commit 3d7cb6b04c3f3115719235cc6866b10326de34cd Author: Linus Torvalds Date: Sun Jul 31 14:03:01 2022 -0700 Linux 5.19 commit 334c0ef6429f261c7f53dc035632435ffbc0c60d Merge: 89caf575400a9 8dc592c41f387 Author: Linus Torvalds Date: Sun Jul 31 09:52:20 2022 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fix from Stephen Boyd: "One-liner fix of a NULL pointer deref in the Allwinner clk driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: sunxi-ng: Fix H6 RTC clock definition commit 89caf575400a9296e45b7de97b07d2fbf249c1f5 Merge: 5e4823e6dab8f ea304a8b89fd0 Author: Linus Torvalds Date: Sun Jul 31 09:26:53 2022 -0700 Merge tag 'x86_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Update the 'mitigations=' kernel param documentation - Check the IBPB feature flag before enabling IBPB in firmware calls because cloud vendors' fantasy when it comes to creating guest configurations is unlimited - Unexport sev_es_ghcb_hv_call() before 5.19 releases now that HyperV doesn't need it anymore - Remove dead CONFIG_* items * tag 'x86_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: docs/kernel-parameters: Update descriptions for "mitigations=" param with retbleed x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available Revert "x86/sev: Expose sev_es_ghcb_hv_call() for use by HyperV" x86/configs: Update configs in x86_debug.config commit 5e4823e6dab8fcc897757c1be68d157a369e4bb5 Merge: cd2715b7929bc 6eebd5fb20838 Author: Linus Torvalds Date: Sun Jul 31 09:21:13 2022 -0700 Merge tag 'locking_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Borislav Petkov: - Avoid rwsem lockups in certain situations when handling the handoff bit * tag 'locking_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/rwsem: Allow slowpath writer to ignore handoff bit if not set by first waiter commit cd2715b7929bcaf6e38d13ac512e0a9bba8df10d Merge: 6a010258447d3 5e2805d537961 Author: Linus Torvalds Date: Sun Jul 31 09:12:58 2022 -0700 Merge tag 'edac_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fixes from Borislav Petkov: - Relax the condition under which the DIMM label in ghes_edac is set in order to accomodate an HPE BIOS which sets only the device but not the bank - Two forgotten fixes to synopsys_edac when handling error interrupts * tag 'edac_urgent_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/ghes: Set the DIMM label unconditionally EDAC/synopsys: Re-enable the error interrupts on v3 hw EDAC/synopsys: Use the correct register to disable the error interrupt on v3 hw commit 6a010258447d386186ca10cd374d888ac66ffe1a Merge: 620725263f422 ec85bd369fd2b Author: Linus Torvalds Date: Sat Jul 30 17:24:16 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: "Last set of ARM fixes for 5.19: - fix for MAX_DMA_ADDRESS overflow - fix for find_*_bit performing an out of bounds memory access" * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: findbit: fix overflowing offset ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow commit 6eebd5fb20838f5971ba17df9f55cc4f84a31053 Author: Waiman Long Date: Wed Jun 22 16:04:19 2022 -0400 locking/rwsem: Allow slowpath writer to ignore handoff bit if not set by first waiter With commit d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more consistent"), the writer that sets the handoff bit can be interrupted out without clearing the bit if the wait queue isn't empty. This disables reader and writer optimistic lock spinning and stealing. Now if a non-first writer in the queue is somehow woken up or a new waiter enters the slowpath, it can't acquire the lock. This is not the case before commit d257cc8cb8d5 as the writer that set the handoff bit will clear it when exiting out via the out_nolock path. This is less efficient as the busy rwsem stays in an unlock state for a longer time. In some cases, this new behavior may cause lockups as shown in [1] and [2]. This patch allows a non-first writer to ignore the handoff bit if it is not originally set or initiated by the first waiter. This patch is shown to be effective in fixing the lockup problem reported in [1]. [1] https://lore.kernel.org/lkml/20220617134325.GC30825@techsingularity.net/ [2] https://lore.kernel.org/lkml/3f02975c-1a9d-be20-32cf-f1d8e3dfafcc@oracle.com/ Fixes: d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more consistent") Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Acked-by: John Donnelly Tested-by: Mel Gorman Link: https://lore.kernel.org/r/20220622200419.778799-1-longman@redhat.com commit 620725263f4222b3c94d4ee19846835feec0ad69 Merge: 8a91f86f3e9e9 8a295dbbaf729 Author: Linus Torvalds Date: Fri Jul 29 21:02:35 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "Two hotfixes, both cc:stable" * tag 'mm-hotfixes-stable-2022-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/hmm: fault non-owner device private entries page_alloc: fix invalid watermark check on a negative value commit 8a91f86f3e9e9608210166c70aaad4919018c0e7 Merge: e65c6a46df94c eda3953b6a805 Author: Linus Torvalds Date: Fri Jul 29 16:07:35 2022 -0700 Merge tag 'block-5.19-2022-07-29' of git://git.kernel.dk/linux-block Pull block fix from Jens Axboe: "Just a single fix for NVMe, yet another quirk addition" * tag 'block-5.19-2022-07-29' of git://git.kernel.dk/linux-block: nvme-pci: Crucial P2 has bogus namespace ids commit e65c6a46df94c8d76ea1129eb2d4564670c6f214 Merge: 1c8ac1c4af178 ce156c8a1811c Author: Linus Torvalds Date: Fri Jul 29 13:25:31 2022 -0700 Merge tag 'drm-fixes-2022-07-30' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Dave Airlie: "Maxime had the dog^Wmailing list server eat his homework^Wmisc pull request. Two more small fixes, one in nouveau svm code and the other in simpledrm. nouveau: - page migration fix simpledrm: - fix mode_valid return value" * tag 'drm-fixes-2022-07-30' of git://anongit.freedesktop.org/drm/drm: nouveau/svm: Fix to migrate all requested pages drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid() commit ce156c8a1811c96a243590abd0e9b5a3b72c1f3a Merge: f16a2f593d009 66cee9097e2b7 Author: Dave Airlie Date: Sat Jul 30 06:09:48 2022 +1000 Merge tag 'drm-misc-fixes-2022-07-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes One fix to fix simpledrm mode_valid return value, and one for page migration in nouveau Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220729094514.sfzhc3gqjgwgal62@penduick commit 1c8ac1c4af178ebcdf6fd4a0ba11716e2c814593 Merge: bb83c99d3d0aa f5c2976e0cb0f Author: Linus Torvalds Date: Fri Jul 29 13:07:03 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Four fixes, three in drivers. The two biggest fixes are ufs and the remaining driver and core fix are small and obvious (and the core fix is low risk)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Fix a race condition related to device management scsi: core: Fix warning in scsi_alloc_sgtables() scsi: ufs: host: Hold reference returned by of_parse_phandle() scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown commit ea304a8b89fd0d6cf94ee30cb139dc23d9f1a62f Author: Eiichi Tsukata Date: Thu Jul 28 04:39:07 2022 +0000 docs/kernel-parameters: Update descriptions for "mitigations=" param with retbleed Updates descriptions for "mitigations=off" and "mitigations=auto,nosmt" with the respective retbleed= settings. Signed-off-by: Eiichi Tsukata Signed-off-by: Borislav Petkov Cc: corbet@lwn.net Link: https://lore.kernel.org/r/20220728043907.165688-1-eiichi.tsukata@nutanix.com commit 8a295dbbaf7292c582a40ce469c326f472d51f66 Author: Ralph Campbell Date: Mon Jul 25 11:36:14 2022 -0700 mm/hmm: fault non-owner device private entries If hmm_range_fault() is called with the HMM_PFN_REQ_FAULT flag and a device private PTE is found, the hmm_range::dev_private_owner page is used to determine if the device private page should not be faulted in. However, if the device private page is not owned by the caller, hmm_range_fault() returns an error instead of calling migrate_to_ram() to fault in the page. For example, if a page is migrated to GPU private memory and a RDMA fault capable NIC tries to read the migrated page, without this patch it will get an error. With this patch, the page will be migrated back to system memory and the NIC will be able to read the data. Link: https://lkml.kernel.org/r/20220727000837.4128709-2-rcampbell@nvidia.com Link: https://lkml.kernel.org/r/20220725183615.4118795-2-rcampbell@nvidia.com Fixes: 08ddddda667b ("mm/hmm: check the device private page owner in hmm_range_fault()") Signed-off-by: Ralph Campbell Reported-by: Felix Kuehling Reviewed-by: Alistair Popple Cc: Philip Yang Cc: Jason Gunthorpe Cc: Signed-off-by: Andrew Morton commit 9282012fc0aa248b77a69f5eb802b67c5a16bb13 Author: Jaewon Kim Date: Mon Jul 25 18:52:12 2022 +0900 page_alloc: fix invalid watermark check on a negative value There was a report that a task is waiting at the throttle_direct_reclaim. The pgscan_direct_throttle in vmstat was increasing. This is a bug where zone_watermark_fast returns true even when the free is very low. The commit f27ce0e14088 ("page_alloc: consider highatomic reserve in watermark fast") changed the watermark fast to consider highatomic reserve. But it did not handle a negative value case which can be happened when reserved_highatomic pageblock is bigger than the actual free. If watermark is considered as ok for the negative value, allocating contexts for order-0 will consume all free pages without direct reclaim, and finally free page may become depleted except highatomic free. Then allocating contexts may fall into throttle_direct_reclaim. This symptom may easily happen in a system where wmark min is low and other reclaimers like kswapd does not make free pages quickly. Handle the negative case by using MIN. Link: https://lkml.kernel.org/r/20220725095212.25388-1-jaewon31.kim@samsung.com Fixes: f27ce0e14088 ("page_alloc: consider highatomic reserve in watermark fast") Signed-off-by: Jaewon Kim Reported-by: GyeongHwan Hong Acked-by: Mel Gorman Cc: Minchan Kim Cc: Baoquan He Cc: Vlastimil Babka Cc: Johannes Weiner Cc: Michal Hocko Cc: Yong-Taek Lee Cc: Signed-off-by: Andrew Morton commit bb83c99d3d0aa2f51ba0b2abd7115002620118e6 Merge: 4b20426d04416 9a241805673ec Author: Linus Torvalds Date: Fri Jul 29 11:26:28 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.19-2022-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix addresses for bss symbols, describing variables used in resolving data access in tools such as 'perf c2c' and 'perf mem'. - Skip symbols if SHF_ALLOC flag is not set, a technique used for listing deprecated symbols, its addresses are zeros, so not useful. - Remove undefined behavior from bpf_perf_object__next() when dealing with an empty bpf_objects_list list. - Make a ARM CoreSight disasm script work with both python2 and python3. - Sync x86's cpufeatures header with with the kernel sources. * tag 'perf-tools-fixes-for-v5.19-2022-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf bpf: Remove undefined behavior from bpf_perf_object__next() perf symbol: Skip symbols if SHF_ALLOC flag is not set perf symbol: Correct address for bss symbols perf scripts python: Let script to be python2 compliant tools headers cpufeatures: Sync with the kernel sources commit 4b20426d044163df0ff9d868e9767ca9e65dd36c Merge: 506e6dfb0f113 46a4d679ef882 Author: Linus Torvalds Date: Fri Jul 29 11:20:40 2022 -0700 Merge tag 'wq-for-5.19-rc8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue fix from Tejun Heo: "Just one commit to suppress a spurious warning added during the 5.19 cycle" * tag 'wq-for-5.19-rc8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Avoid a false warning in unbind_workers() commit 506e6dfb0f1131f104df66ccae1197bdf8f1b6b0 Merge: e4d8b09d671f0 d295ad34f236c Author: Linus Torvalds Date: Fri Jul 29 10:57:26 2022 -0700 Merge tag 'pm-5.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Make some false positive RCU splats resulting from a recent intel_idle driver change go away (Waiman Long)" * tag 'pm-5.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: intel_idle: Fix false positive RCU splats due to incorrect hardirqs state commit 46a4d679ef88285ea17c3e1e4fed330be2044f21 Author: Lai Jiangshan Date: Fri Jul 29 17:44:38 2022 +0800 workqueue: Avoid a false warning in unbind_workers() Doing set_cpus_allowed_ptr() with wq_unbound_cpumask can be possible fails and trigger the false warning. Use cpu_possible_mask instead when wq_unbound_cpumask has no active CPUs. It is very easy to trigger the warning: Set wq_unbound_cpumask to a small set of CPUs. Offline all the CPUs of wq_unbound_cpumask. Offline an extra CPU and trigger the warning. Fixes: 10a5a651e3af ("workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs") Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit e4d8b09d671f0ee92d36c48b65d2f34affcdd531 Merge: a95eb1d086dcc 88bd24d73d5bf Author: Linus Torvalds Date: Fri Jul 29 10:46:03 2022 -0700 Merge tag 'riscv-for-linus-5.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fix from Palmer Dabbelt: "A build fix for 'make vdso_install' that avoids an issue trying to install the compat VDSO" * tag 'riscv-for-linus-5.19-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: compat: vdso: Fix vdso_install target commit a95eb1d086dcc579d52ca4c34742516f6434d1f2 Merge: 9d928d9b78bee 45b53c9051770 Author: Linus Torvalds Date: Fri Jul 29 10:10:30 2022 -0700 Merge tag 'loongarch-fixes-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: - Fix cache size calculation, stack protection attributes, ptrace's fpr_set and "ROM Size" in boardinfo - Some cleanups and improvements of assembly - Some cleanups of unused code and useless code * tag 'loongarch-fixes-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Fix wrong "ROM Size" of boardinfo LoongArch: Fix missing fcsr in ptrace's fpr_set LoongArch: Fix shared cache size calculation LoongArch: Disable executable stack by default LoongArch: Remove unused variables LoongArch: Remove clock setting during cpu hotplug stage LoongArch: Remove useless header compiler.h LoongArch: Remove several syntactic sugar macros for branches LoongArch: Re-tab the assembly files LoongArch: Simplify "BGT foo, zero" with BGTZ LoongArch: Simplify "BLT foo, zero" with BLTZ LoongArch: Simplify "BEQ/BNE foo, zero" with BEQZ/BNEZ LoongArch: Use the "move" pseudo-instruction where applicable LoongArch: Use the "jr" pseudo-instruction where applicable LoongArch: Use ABI names of registers where appropriate commit 9d928d9b78beec5d4b8afde9c144919b979685f2 Merge: 6e2c0490769ef c653c591789b3 Author: Linus Torvalds Date: Fri Jul 29 09:57:07 2022 -0700 Merge tag 'powerpc-5.19-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Re-enable the new amdgpu display engine for powerpc, as long as the compiler is correctly configured. - Disable stack variable initialisation in prom_init to fix GCC 12 allmodconfig. Thanks to Dan Horák and Sudip Mukherjee. * tag 'powerpc-5.19-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: drm/amdgpu: Re-enable DCN for 64-bit powerpc powerpc/64s: Disable stack variable initialisation for prom_init commit 45b53c9051770c0d9145083a328548745ee2e75b Author: Tiezhu Yang Date: Thu Jul 21 17:53:01 2022 +0800 LoongArch: Fix wrong "ROM Size" of boardinfo We can see the "ROM Size" is different in the following outputs: [root@linux loongson]# cat /sys/firmware/loongson/boardinfo BIOS Information Vendor : Loongson Version : vUDK2018-LoongArch-V2.0.pre-beta8 ROM Size : 63 KB Release Date : 06/15/2022 Board Information Manufacturer : Loongson Board Name : Loongson-LS3A5000-7A1000-1w-A2101 Family : LOONGSON64 [root@linux loongson]# dmidecode | head -11 ... Handle 0x0000, DMI type 0, 26 bytes BIOS Information Vendor: Loongson Version: vUDK2018-LoongArch-V2.0.pre-beta8 Release Date: 06/15/2022 ROM Size: 4 MB According to "BIOS Information (Type 0) structure" in the SMBIOS Reference Specification [1], it shows 64K * (n+1) is the size of the physical device containing the BIOS if the size is less than 16M. Additionally, we can see the related code in dmidecode [2]: u64 s = { .l = (code1 + 1) << 6 }; So the output of dmidecode is correct, the output of boardinfo is wrong, fix it. By the way, at present no need to consider the size is 16M or greater on LoongArch, because it is usually 4M or 8M which is enough to use. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.6.0.pdf [2] https://git.savannah.nongnu.org/cgit/dmidecode.git/tree/dmidecode.c#n347 Fixes: 628c3bb40e9a ("LoongArch: Add boot and setup routines") Reviewed-by: WANG Xuerui Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit b0f3bdc00240fc9d7bf0f2a076943122d168c95e Author: Qi Hu Date: Thu Jul 14 14:25:50 2022 +0800 LoongArch: Fix missing fcsr in ptrace's fpr_set In file ptrace.c, function fpr_set does not copy fcsr data from ubuf to kbuf. That's the reason why fcsr cannot be modified by ptrace. This patch fixs this problem and allows users using ptrace to modify the fcsr. Co-developed-by: Xu Li Signed-off-by: Qi Hu Signed-off-by: Huacai Chen commit 1aea29d7c3569e5b6c40e73c51e9f4b2142c96ef Author: Huacai Chen Date: Wed Jul 13 18:00:41 2022 +0800 LoongArch: Fix shared cache size calculation Current calculation of shared cache size is from the node (die) scope, but we hope 'lscpu' to show the shared cache size of the whole package for multi-die chips (e.g., Loongson-3C5000L, which contains 4 dies in one package). So fix it by multiplying nodes_per_package. Signed-off-by: Huacai Chen commit 317980e6b4d03884429f2cdaf51efd28f01b71b0 Author: Huacai Chen Date: Tue Jul 26 20:43:11 2022 +0800 LoongArch: Disable executable stack by default Disable executable stack for LoongArch by default, as all modern architectures do. Reported-by: Andreas Schwab Suggested-by: WANG Xuerui Link: https://sourceware.org/pipermail/binutils/2022-July/121992.html Tested-by: WANG Xuerui Tested-by: Xi Ruoyao Signed-off-by: Huacai Chen commit 3a3a4f7a65e3ff7ad395afc8c41ac317c8667546 Author: Bibo Mao Date: Wed Jul 20 15:21:52 2022 +0800 LoongArch: Remove unused variables There are some variables never used or referenced, this patch removes these varaibles and make the code cleaner. Reviewed-by: WANG Xuerui Signed-off-by: Bibo Mao Signed-off-by: Huacai Chen commit 71610ab1d017e131a9888ef8acd035284fb0e1dd Author: Bibo Mao Date: Wed Jul 20 15:21:51 2022 +0800 LoongArch: Remove clock setting during cpu hotplug stage On physical machine we can save power by disabling clock of hot removed cpu. However as different platforms require different methods to configure clocks, the code is platform-specific, and probably belongs to firmware/pmu or cpu regulator, rather than generic arch/loongarch code. Also, there is no such register on QEMU virt machine since the clock/frequency regulation is not emulated. This patch removes the hard-coded clock register accesses in generic LoongArch cpu hotplug flow. Reviewed-by: WANG Xuerui Signed-off-by: Bibo Mao Signed-off-by: Huacai Chen commit f62b7626cb79dfbfe292145b7ebeee4dc63c9499 Author: Jun Yi Date: Thu Jul 21 19:10:49 2022 +0800 LoongArch: Remove useless header compiler.h The content of LoongArch's compiler.h is trivial, with some unused anywhere, so inline the definitions and remove the header. Signed-off-by: Jun Yi Signed-off-by: Huacai Chen commit ab6e57a69df515cc9231b578de5b820f9ba3d0be Author: WANG Xuerui Date: Tue Jul 26 23:57:15 2022 +0800 LoongArch: Remove several syntactic sugar macros for branches These syntactic sugars have been supported by upstream binutils from the beginning, so no need to patch them locally. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit f5c3c22f21b6a002e371afdcc9180a2fa47dc267 Author: WANG Xuerui Date: Tue Jul 26 23:57:22 2022 +0800 LoongArch: Re-tab the assembly files Reflow the *.S files for better stylistic consistency, namely hard tabs after mnemonic position, and vertical alignment of the first operand with hard tabs. Tab width is obviously 8. Some pre-existing intra-block vertical alignments are preserved. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 1fdb9a92495a6b6996530d27781892796e22f08b Author: WANG Xuerui Date: Tue Jul 26 23:57:21 2022 +0800 LoongArch: Simplify "BGT foo, zero" with BGTZ Support for the syntactic sugar is present in upstream binutils port from the beginning. Use it for shorter lines and better consistency. Generated code should be identical. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit d1bc75d7595b237f78b594509ea7cc159f98cae9 Author: WANG Xuerui Date: Tue Jul 26 23:57:20 2022 +0800 LoongArch: Simplify "BLT foo, zero" with BLTZ Support for the syntactic sugar is present in upstream binutils port from the beginning. Use it for shorter lines and better consistency. Generated code should be identical. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit d47b2dc87c58154052daf8ac0f9229db5c7890cc Author: WANG Xuerui Date: Tue Jul 26 23:57:19 2022 +0800 LoongArch: Simplify "BEQ/BNE foo, zero" with BEQZ/BNEZ While B{EQ,NE}Z and B{EQ,NE} are different instructions, and the vastly expanded range for branch destination does not really matter in the few cases touched, use the B{EQ,NE}Z where possible for shorter lines and better consistency (e.g. some places used "BEQ foo, zero", while some used "BEQ zero, foo"). Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 57ce5d3eefacfaadfe2ed0a3a85713d1ae6287b9 Author: WANG Xuerui Date: Tue Jul 26 23:57:18 2022 +0800 LoongArch: Use the "move" pseudo-instruction where applicable Some of the assembly code in the LoongArch port likely originated from a time when the assembler did not support pseudo-instructions like "move" or "jr", so the desugared form was used and readability suffers (to a minor degree) as a result. As the upstream toolchain supports these pseudo-instructions from the beginning, migrate the existing few usages to them for better readability. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 07b480695d24d1c9f27bb60fd4b980ae87e8bc1e Author: WANG Xuerui Date: Tue Jul 26 23:57:17 2022 +0800 LoongArch: Use the "jr" pseudo-instruction where applicable Some of the assembly code in the LoongArch port likely originated from a time when the assembler did not support pseudo-instructions like "move" or "jr", so the desugared form was used and readability suffers (to a minor degree) as a result. As the upstream toolchain supports these pseudo-instructions from the beginning, migrate the existing few usages to them for better readability. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit d8e7f201a4cf148c3801cdc9603963061d28d64f Author: WANG Xuerui Date: Tue Jul 26 23:57:16 2022 +0800 LoongArch: Use ABI names of registers where appropriate Some of the assembly in the LoongArch port seem to come from a prehistoric time, when the assembler didn't even have support for the ABI names we all come to know and love, thus used raw register numbers which hampered readability. The usages are found with a regex match inside arch/loongarch, then manually adjusted for those non-definitions. Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit ec85bd369fd2bfaed6f45dd678706429d4f75b48 Author: Russell King (Oracle) Date: Tue Jul 26 23:51:48 2022 +0100 ARM: findbit: fix overflowing offset When offset is larger than the size of the bit array, we should not attempt to access the array as we can perform an access beyond the end of the array. Fix this by changing the pre-condition. Using "cmp r2, r1; bhs ..." covers us for the size == 0 case, since this will always take the branch when r1 is zero, irrespective of the value of r2. This means we can fix this bug without adding any additional code! Tested-by: Guenter Roeck Signed-off-by: Russell King (Oracle) commit 571c30b1a88465a1c85a6f7762609939b9085a15 Author: Thadeu Lima de Souza Cascardo Date: Thu Jul 28 09:26:02 2022 -0300 x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available Some cloud hypervisors do not provide IBPB on very recent CPU processors, including AMD processors affected by Retbleed. Using IBPB before firmware calls on such systems would cause a GPF at boot like the one below. Do not enable such calls when IBPB support is not present. EFI Variables Facility v0.08 2004-May-17 general protection fault, maybe for address 0x1: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 24 Comm: kworker/u2:1 Not tainted 5.19.0-rc8+ #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 Workqueue: efi_rts_wq efi_call_rts RIP: 0010:efi_call_rts Code: e8 37 33 58 ff 41 bf 48 00 00 00 49 89 c0 44 89 f9 48 83 c8 01 4c 89 c2 48 c1 ea 20 66 90 b9 49 00 00 00 b8 01 00 00 00 31 d2 <0f> 30 e8 7b 9f 5d ff e8 f6 f8 ff ff 4c 89 f1 4c 89 ea 4c 89 e6 48 RSP: 0018:ffffb373800d7e38 EFLAGS: 00010246 RAX: 0000000000000001 RBX: 0000000000000006 RCX: 0000000000000049 RDX: 0000000000000000 RSI: ffff94fbc19d8fe0 RDI: ffff94fbc1b2b300 RBP: ffffb373800d7e70 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000000b R11: 000000000000000b R12: ffffb3738001fd78 R13: ffff94fbc2fcfc00 R14: ffffb3738001fd80 R15: 0000000000000048 FS: 0000000000000000(0000) GS:ffff94fc3da00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff94fc30201000 CR3: 000000006f610000 CR4: 00000000000406f0 Call Trace: ? __wake_up process_one_work worker_thread ? rescuer_thread kthread ? kthread_complete_and_exit ret_from_fork Modules linked in: Fixes: 28a99e95f55c ("x86/amd: Use IBPB for firmware calls") Reported-by: Dimitri John Ledkov Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220728122602.2500509-1-cascardo@canonical.com commit 6e2c0490769ef8a95b61304389116ccc85c53e12 Merge: 33ea1340bafe1 f16a2f593d009 Author: Linus Torvalds Date: Thu Jul 28 20:34:59 2022 -0700 Merge tag 'drm-fixes-2022-07-29' of git://anongit.freedesktop.org/drm/drm Pull drm fix from Dave Airlie: "Quiet extra week, just a single fix for i915 workaround with execlist backend. i915: - Further reset robustness improvements for execlists [Wa_22011802037]" * tag 'drm-fixes-2022-07-29' of git://anongit.freedesktop.org/drm/drm: drm/i915/reset: Add additional steps for Wa_22011802037 for execlist backend commit f16a2f593d0095e82e6b7f9d776f869c8ab45952 Merge: e0dccc3b76fb3 a7a47a5dfa9a9 Author: Dave Airlie Date: Fri Jul 29 11:39:13 2022 +1000 Merge tag 'drm-intel-fixes-2022-07-28-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Further reset robustness improvements for execlists [Wa_22011802037] (Umesh Nerlige Ramappa) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YuJIWaEbKcs/q0NY@tursulin-desk commit 66cee9097e2b74ff3c8cc040ce5717c521a0c3fa Author: Alistair Popple Date: Wed Jul 20 16:27:45 2022 +1000 nouveau/svm: Fix to migrate all requested pages Users may request that pages from an OpenCL SVM allocation be migrated to the GPU with clEnqueueSVMMigrateMem(). In Nouveau this will call into nouveau_dmem_migrate_vma() to do the migration. If the total range to be migrated exceeds SG_MAX_SINGLE_ALLOC the pages will be migrated in chunks of size SG_MAX_SINGLE_ALLOC. However a typo in updating the starting address means that only the first chunk will get migrated. Fix the calculation so that the entire range will get migrated if possible. Signed-off-by: Alistair Popple Fixes: e3d8b0890469 ("drm/nouveau/svm: map pages after migration") Reviewed-by: Ralph Campbell Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220720062745.960701-1-apopple@nvidia.com Cc: # v5.8+ commit 33ea1340bafe1f394e5bf96fceef73e9771d066b Merge: e64ab2dbd8829 4d3d3a1b244fd Author: Linus Torvalds Date: Thu Jul 28 11:54:59 2022 -0700 Merge tag 'net-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth and netfilter, no known blockers for the release. Current release - regressions: - wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop(), fix taking the lock before its initialized - Bluetooth: mgmt: fix double free on error path Current release - new code bugs: - eth: ice: fix tunnel checksum offload with fragmented traffic Previous releases - regressions: - tcp: md5: fix IPv4-mapped support after refactoring, don't take the pure v6 path - Revert "tcp: change pingpong threshold to 3", improving detection of interactive sessions - mld: fix netdev refcount leak in mld_{query | report}_work() due to a race - Bluetooth: - always set event mask on suspend, avoid early wake ups - L2CAP: fix use-after-free caused by l2cap_chan_put - bridge: do not send empty IFLA_AF_SPEC attribute Previous releases - always broken: - ping6: fix memleak in ipv6_renew_options() - sctp: prevent null-deref caused by over-eager error paths - virtio-net: fix the race between refill work and close, resulting in NAPI scheduled after close and a BUG() - macsec: - fix three netlink parsing bugs - avoid breaking the device state on invalid change requests - fix a memleak in another error path Misc: - dt-bindings: net: ethernet-controller: rework 'fixed-link' schema - two more batches of sysctl data race adornment" * tag 'net-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits) stmmac: dwmac-mediatek: fix resource leak in probe ipv6/addrconf: fix a null-ptr-deref bug for ip6_ptr net: ping6: Fix memleak in ipv6_renew_options(). net/funeth: Fix fun_xdp_tx() and XDP packet reclaim sctp: leave the err path free in sctp_stream_init to sctp_stream_free sfc: disable softirqs for ptp TX ptp: ocp: Select CRC16 in the Kconfig. tcp: md5: fix IPv4-mapped support virtio-net: fix the race between refill work and close mptcp: Do not return EINPROGRESS when subflow creation succeeds Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put Bluetooth: Always set event mask on suspend Bluetooth: mgmt: Fix double free on error path wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop() ice: do not setup vlan for loopback VSI ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) ice: Fix VSIs unable to share unicast MAC ice: Fix tunnel checksum offload with fragmented traffic ice: Fix max VLANs available for VF netfilter: nft_queue: only allow supported familes and hooks ... commit 4d3d3a1b244fd54629a6b7047f39a7bbc8d11910 Author: Dan Carpenter Date: Thu Jul 28 14:52:09 2022 +0300 stmmac: dwmac-mediatek: fix resource leak in probe If mediatek_dwmac_clks_config() fails, then call stmmac_remove_config_dt() before returning. Otherwise it is a resource leak. Fixes: fa4b3ca60e80 ("stmmac: dwmac-mediatek: fix clock issue") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YuJ4aZyMUlG6yGGa@kili Signed-off-by: Jakub Kicinski commit 85f0173df35e5462d89947135a6a5599c6c3ef6f Author: Ziyang Xuan Date: Thu Jul 28 09:33:07 2022 +0800 ipv6/addrconf: fix a null-ptr-deref bug for ip6_ptr Change net device's MTU to smaller than IPV6_MIN_MTU or unregister device while matching route. That may trigger null-ptr-deref bug for ip6_ptr probability as following. ========================================================= BUG: KASAN: null-ptr-deref in find_match.part.0+0x70/0x134 Read of size 4 at addr 0000000000000308 by task ping6/263 CPU: 2 PID: 263 Comm: ping6 Not tainted 5.19.0-rc7+ #14 Call trace: dump_backtrace+0x1a8/0x230 show_stack+0x20/0x70 dump_stack_lvl+0x68/0x84 print_report+0xc4/0x120 kasan_report+0x84/0x120 __asan_load4+0x94/0xd0 find_match.part.0+0x70/0x134 __find_rr_leaf+0x408/0x470 fib6_table_lookup+0x264/0x540 ip6_pol_route+0xf4/0x260 ip6_pol_route_output+0x58/0x70 fib6_rule_lookup+0x1a8/0x330 ip6_route_output_flags_noref+0xd8/0x1a0 ip6_route_output_flags+0x58/0x160 ip6_dst_lookup_tail+0x5b4/0x85c ip6_dst_lookup_flow+0x98/0x120 rawv6_sendmsg+0x49c/0xc70 inet_sendmsg+0x68/0x94 Reproducer as following: Firstly, prepare conditions: $ip netns add ns1 $ip netns add ns2 $ip link add veth1 type veth peer name veth2 $ip link set veth1 netns ns1 $ip link set veth2 netns ns2 $ip netns exec ns1 ip -6 addr add 2001:0db8:0:f101::1/64 dev veth1 $ip netns exec ns2 ip -6 addr add 2001:0db8:0:f101::2/64 dev veth2 $ip netns exec ns1 ifconfig veth1 up $ip netns exec ns2 ifconfig veth2 up $ip netns exec ns1 ip -6 route add 2000::/64 dev veth1 metric 1 $ip netns exec ns2 ip -6 route add 2001::/64 dev veth2 metric 1 Secondly, execute the following two commands in two ssh windows respectively: $ip netns exec ns1 sh $while true; do ip -6 addr add 2001:0db8:0:f101::1/64 dev veth1; ip -6 route add 2000::/64 dev veth1 metric 1; ping6 2000::2; done $ip netns exec ns1 sh $while true; do ip link set veth1 mtu 1000; ip link set veth1 mtu 1500; sleep 5; done It is because ip6_ptr has been assigned to NULL in addrconf_ifdown() firstly, then ip6_ignore_linkdown() accesses ip6_ptr directly without NULL check. cpu0 cpu1 fib6_table_lookup __find_rr_leaf addrconf_notify [ NETDEV_CHANGEMTU ] addrconf_ifdown RCU_INIT_POINTER(dev->ip6_ptr, NULL) find_match ip6_ignore_linkdown So we can add NULL check for ip6_ptr before using in ip6_ignore_linkdown() to fix the null-ptr-deref bug. Fixes: dcd1f572954f ("net/ipv6: Remove fib6_idev") Signed-off-by: Ziyang Xuan Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220728013307.656257-1-william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit e27326009a3d247b831eda38878c777f6f4eb3d1 Author: Kuniyuki Iwashima Date: Wed Jul 27 18:22:20 2022 -0700 net: ping6: Fix memleak in ipv6_renew_options(). When we close ping6 sockets, some resources are left unfreed because pingv6_prot is missing sk->sk_prot->destroy(). As reported by syzbot [0], just three syscalls leak 96 bytes and easily cause OOM. struct ipv6_sr_hdr *hdr; char data[24] = {0}; int fd; hdr = (struct ipv6_sr_hdr *)data; hdr->hdrlen = 2; hdr->type = IPV6_SRCRT_TYPE_4; fd = socket(AF_INET6, SOCK_DGRAM, NEXTHDR_ICMP); setsockopt(fd, IPPROTO_IPV6, IPV6_RTHDR, data, 24); close(fd); To fix memory leaks, let's add a destroy function. Note the socket() syscall checks if the GID is within the range of net.ipv4.ping_group_range. The default value is [1, 0] so that no GID meets the condition (1 <= GID <= 0). Thus, the local DoS does not succeed until we change the default value. However, at least Ubuntu/Fedora/RHEL loosen it. $ cat /usr/lib/sysctl.d/50-default.conf ... -net.ipv4.ping_group_range = 0 2147483647 Also, there could be another path reported with these options, and some of them require CAP_NET_RAW. setsockopt IPV6_ADDRFORM (inet6_sk(sk)->pktoptions) IPV6_RECVPATHMTU (inet6_sk(sk)->rxpmtu) IPV6_HOPOPTS (inet6_sk(sk)->opt) IPV6_RTHDRDSTOPTS (inet6_sk(sk)->opt) IPV6_RTHDR (inet6_sk(sk)->opt) IPV6_DSTOPTS (inet6_sk(sk)->opt) IPV6_2292PKTOPTIONS (inet6_sk(sk)->opt) getsockopt IPV6_FLOWLABEL_MGR (inet6_sk(sk)->ipv6_fl_list) For the record, I left a different splat with syzbot's one. unreferenced object 0xffff888006270c60 (size 96): comm "repro2", pid 231, jiffies 4294696626 (age 13.118s) hex dump (first 32 bytes): 01 00 00 00 44 00 00 00 00 00 00 00 00 00 00 00 ....D........... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f6bc7ea9>] sock_kmalloc (net/core/sock.c:2564 net/core/sock.c:2554) [<000000006d699550>] do_ipv6_setsockopt.constprop.0 (net/ipv6/ipv6_sockglue.c:715) [<00000000c3c3b1f5>] ipv6_setsockopt (net/ipv6/ipv6_sockglue.c:1024) [<000000007096a025>] __sys_setsockopt (net/socket.c:2254) [<000000003a8ff47b>] __x64_sys_setsockopt (net/socket.c:2265 net/socket.c:2262 net/socket.c:2262) [<000000007c409dcb>] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) [<00000000e939c4a9>] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120) [0]: https://syzkaller.appspot.com/bug?extid=a8430774139ec3ab7176 Fixes: 6d0bfe226116 ("net: ipv6: Add IPv6 support to the ping socket.") Reported-by: syzbot+a8430774139ec3ab7176@syzkaller.appspotmail.com Reported-by: Ayushman Dutta Signed-off-by: Kuniyuki Iwashima Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220728012220.46918-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit e64ab2dbd882933b65cd82ff6235d705ad65dbb6 Author: Linus Torvalds Date: Thu Jul 28 10:31:12 2022 +0100 watch_queue: Fix missing locking in add_watch_to_object() If a watch is being added to a queue, it needs to guard against interference from addition of a new watch, manual removal of a watch and removal of a watch due to some other queue being destroyed. KEYCTL_WATCH_KEY guards against this for the same {key,queue} pair by holding the key->sem writelocked and by holding refs on both the key and the queue - but that doesn't prevent interaction from other {key,queue} pairs. While add_watch_to_object() does take the spinlock on the event queue, it doesn't take the lock on the source's watch list. The assumption was that the caller would prevent that (say by taking key->sem) - but that doesn't prevent interference from the destruction of another queue. Fix this by locking the watcher list in add_watch_to_object(). Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: syzbot+03d7b43290037d1f87ca@syzkaller.appspotmail.com Signed-off-by: David Howells cc: keyrings@vger.kernel.org Signed-off-by: Linus Torvalds commit e0339f036ef4beb9b20f0b6532a1e0ece7f594c6 Author: David Howells Date: Thu Jul 28 10:31:06 2022 +0100 watch_queue: Fix missing rcu annotation Since __post_watch_notification() walks wlist->watchers with only the RCU read lock held, we need to use RCU methods to add to the list (we already use RCU methods to remove from the list). Fix add_watch_to_object() to use hlist_add_head_rcu() instead of hlist_add_head() for that list. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 51a83391d77bb0f7ff0aef06ca4c7f5aa9e80b4c Author: Dimitris Michailidis Date: Tue Jul 26 14:59:23 2022 -0700 net/funeth: Fix fun_xdp_tx() and XDP packet reclaim The current implementation of fun_xdp_tx(), used for XPD_TX, is incorrect in that it takes an address/length pair and later releases it with page_frag_free(). It is OK for XDP_TX but the same code is used by ndo_xdp_xmit. In that case it loses the XDP memory type and releases the packet incorrectly for some of the types. Assorted breakage follows. Change fun_xdp_tx() to take xdp_frame and rely on xdp_return_frame() in reclaim. Fixes: db37bc177dae ("net/funeth: add the data path") Signed-off-by: Dimitris Michailidis Link: https://lore.kernel.org/r/20220726215923.7887-1-dmichail@fungible.com Signed-off-by: Paolo Abeni commit bf84719df765f1a832a770f3cd0cdc8bee20c91f Merge: 181d8d2066c00 cc019545a2385 Author: Jakub Kicinski Date: Wed Jul 27 19:56:28 2022 -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 2022-07-26 This series contains updates to ice driver only. Przemyslaw corrects accounting for VF VLANs to allow for correct number of VLANs for untrusted VF. He also correct issue with checksum offload on VXLAN tunnels. Ani allows for two VSIs to share the same MAC address. Maciej corrects checked bits for descriptor completion of loopback * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: do not setup vlan for loopback VSI ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) ice: Fix VSIs unable to share unicast MAC ice: Fix tunnel checksum offload with fragmented traffic ice: Fix max VLANs available for VF ==================== Link: https://lore.kernel.org/r/20220726204646.2171589-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 181d8d2066c000ba0a0e6940a7ad80f1a0e68e9d Author: Xin Long Date: Mon Jul 25 18:11:06 2022 -0400 sctp: leave the err path free in sctp_stream_init to sctp_stream_free A NULL pointer dereference was reported by Wei Chen: BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:__list_del_entry_valid+0x26/0x80 Call Trace: sctp_sched_dequeue_common+0x1c/0x90 sctp_sched_prio_dequeue+0x67/0x80 __sctp_outq_teardown+0x299/0x380 sctp_outq_free+0x15/0x20 sctp_association_free+0xc3/0x440 sctp_do_sm+0x1ca7/0x2210 sctp_assoc_bh_rcv+0x1f6/0x340 This happens when calling sctp_sendmsg without connecting to server first. In this case, a data chunk already queues up in send queue of client side when processing the INIT_ACK from server in sctp_process_init() where it calls sctp_stream_init() to alloc stream_in. If it fails to alloc stream_in all stream_out will be freed in sctp_stream_init's err path. Then in the asoc freeing it will crash when dequeuing this data chunk as stream_out is missing. As we can't free stream out before dequeuing all data from send queue, and this patch is to fix it by moving the err path stream_out/in freeing in sctp_stream_init() to sctp_stream_free() which is eventually called when freeing the asoc in sctp_association_free(). This fix also makes the code in sctp_process_init() more clear. Note that in sctp_association_init() when it fails in sctp_stream_init(), sctp_association_free() will not be called, and in that case it should go to 'stream_free' err path to free stream instead of 'fail_init'. Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations") Reported-by: Wei Chen Signed-off-by: Xin Long Link: https://lore.kernel.org/r/831a3dc100c4908ff76e5bcc363be97f2778bc0b.1658787066.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 67c3b611d92fc238c43734878bc3e232ab570c79 Author: Alejandro Lucero Date: Tue Jul 26 08:45:04 2022 +0200 sfc: disable softirqs for ptp TX Sending a PTP packet can imply to use the normal TX driver datapath but invoked from the driver's ptp worker. The kernel generic TX code disables softirqs and preemption before calling specific driver TX code, but the ptp worker does not. Although current ptp driver functionality does not require it, there are several reasons for doing so: 1) The invoked code is always executed with softirqs disabled for non PTP packets. 2) Better if a ptp packet transmission is not interrupted by softirq handling which could lead to high latencies. 3) netdev_xmit_more used by the TX code requires preemption to be disabled. Indeed a solution for dealing with kernel preemption state based on static kernel configuration is not possible since the introduction of dynamic preemption level configuration at boot time using the static calls functionality. Fixes: f79c957a0b537 ("drivers: net: sfc: use netdev_xmit_more helper") Signed-off-by: Alejandro Lucero Link: https://lore.kernel.org/r/20220726064504.49613-1-alejandro.lucero-palau@amd.com Signed-off-by: Jakub Kicinski commit 0c104556267242d922a3def60be8092b280e4fee Author: Jonathan Lemon Date: Tue Jul 26 15:06:04 2022 -0700 ptp: ocp: Select CRC16 in the Kconfig. The crc16() function is used to check the firmware validity, but the library was not explicitly selected. Fixes: 3c3673bde50c ("ptp: ocp: Add firmware header checks") Reported-by: kernel test robot Signed-off-by: Jonathan Lemon Acked-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20220726220604.1339972-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski commit 8dc592c41f38735306d1f1dc0b183601379c6d94 Author: Jernej Skrabec Date: Tue Jul 19 20:37:25 2022 +0200 clk: sunxi-ng: Fix H6 RTC clock definition While RTC clock was added in H616 ccu_common list, it was not in H6 list. That caused invalid pointer dereference like this: Unable to handle kernel NULL pointer dereference at virtual address 000000000000020c Mem abort info: ESR = 0x96000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=000000004d574000 [000000000000020c] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP CPU: 3 PID: 339 Comm: cat Tainted: G B 5.18.0-rc1+ #1352 Hardware name: Tanix TX6 (DT) pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ccu_gate_is_enabled+0x48/0x74 lr : ccu_gate_is_enabled+0x40/0x74 sp : ffff80000c0b76d0 x29: ffff80000c0b76d0 x28: 00000000016e3600 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000002 x24: ffff00000952fe08 x23: ffff800009611400 x22: ffff00000952fe79 x21: 0000000000000000 x20: 0000000000000001 x19: ffff80000aad6f08 x18: 0000000000000000 x17: 2d2d2d2d2d2d2d2d x16: 2d2d2d2d2d2d2d2d x15: 2d2d2d2d2d2d2d2d x14: 0000000000000000 x13: 00000000f2f2f2f2 x12: ffff700001816e89 x11: 1ffff00001816e88 x10: ffff700001816e88 x9 : dfff800000000000 x8 : ffff80000c0b7447 x7 : 0000000000000001 x6 : ffff700001816e88 x5 : ffff80000c0b7440 x4 : 0000000000000001 x3 : ffff800008935c50 x2 : dfff800000000000 x1 : 0000000000000000 x0 : 000000000000020c Call trace: ccu_gate_is_enabled+0x48/0x74 clk_core_is_enabled+0x7c/0x1c0 clk_summary_show_subtree+0x1dc/0x334 clk_summary_show_subtree+0x250/0x334 clk_summary_show_subtree+0x250/0x334 clk_summary_show_subtree+0x250/0x334 clk_summary_show_subtree+0x250/0x334 clk_summary_show+0x90/0xdc seq_read_iter+0x248/0x6d4 seq_read+0x17c/0x1fc full_proxy_read+0x90/0xf0 vfs_read+0xdc/0x28c ksys_read+0xc8/0x174 __arm64_sys_read+0x44/0x5c invoke_syscall+0x60/0x190 el0_svc_common.constprop.0+0x7c/0x160 do_el0_svc+0x38/0xa0 el0_svc+0x68/0x160 el0t_64_sync_handler+0x10c/0x140 el0t_64_sync+0x18c/0x190 Code: d1006260 97e5c981 785e8260 8b0002a0 (b9400000) ---[ end trace 0000000000000000 ]--- Fix that by adding rtc clock to H6 ccu_common list too. Fixes: 38d321b61bda ("clk: sunxi-ng: h6-r: Add RTC gate clock") Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220719183725.2605141-1-jernej.skrabec@gmail.com Reviewed-by: Samuel Holland Signed-off-by: Stephen Boyd commit e62d2e110356093c034998e093675df83057e511 Author: Eric Dumazet Date: Tue Jul 26 11:57:43 2022 +0000 tcp: md5: fix IPv4-mapped support After the blamed commit, IPv4 SYN packets handled by a dual stack IPv6 socket are dropped, even if perfectly valid. $ nstat | grep MD5 TcpExtTCPMD5Failure 5 0.0 For a dual stack listener, an incoming IPv4 SYN packet would call tcp_inbound_md5_hash() with @family == AF_INET, while tp->af_specific is pointing to tcp_sock_ipv6_specific. Only later when an IPv4-mapped child is created, tp->af_specific is changed to tcp_sock_ipv6_mapped_specific. Fixes: 7bbb765b7349 ("net/tcp: Merge TCP-MD5 inbound callbacks") Reported-by: Brian Vazquez Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reviewed-by: Dmitry Safonov Tested-by: Leonard Crestez Link: https://lore.kernel.org/r/20220726115743.2759832-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit fb0fd3469ead5b937293c213daa1f589b4b7ce46 Author: Florian Fainelli Date: Tue Jul 19 17:33:21 2022 +0100 ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow Commit 26f09e9b3a06 ("mm/memblock: add memblock memory allocation apis") added a check to determine whether arm_dma_zone_size is exceeding the amount of kernel virtual address space available between the upper 4GB virtual address limit and PAGE_OFFSET in order to provide a suitable definition of MAX_DMA_ADDRESS that should fit within the 32-bit virtual address space. The quantity used for comparison was off by a missing trailing 0, leading to MAX_DMA_ADDRESS to be overflowing a 32-bit quantity. This was caught thanks to CONFIG_DEBUG_VIRTUAL on the bcm2711 platform where we define a dma_zone_size of 1GB and we have a PAGE_OFFSET value of 0xc000_0000 (CONFIG_VMSPLIT_3G) leading to MAX_DMA_ADDRESS being 0x1_0000_0000 which overflows the unsigned long type used throughout __pa() and then __virt_addr_valid(). Because the virtual address passed to __virt_addr_valid() would now be 0, the function would loudly warn and flood the kernel log, thus making the platform unable to boot properly. Fixes: 26f09e9b3a06 ("mm/memblock: add memblock memory allocation apis") Signed-off-by: Florian Fainelli Reviewed-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 6e7765cb477a9753670d4351d14de93f1e9dbbd4 Merge: 9d8a8616ee47f e2a619ca0b38f Author: Linus Torvalds Date: Wed Jul 27 09:50:18 2022 -0700 Merge tag 'asm-generic-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic fixes from Arnd Bergmann: "Two more bug fixes for asm-generic, one addressing an incorrect Kconfig symbol reference and another one fixing a build failure for the perf tool on mips and possibly others" * tag 'asm-generic-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic: remove a broken and needless ifdef conditional tools: Fixed MIPS builds due to struct flock re-definition commit 9d8a8616ee47f478a9f78ab97f55c3fbf71bb5f0 Merge: 39c3c396f8131 c5cdb9286913a Author: Linus Torvalds Date: Wed Jul 27 09:43:07 2022 -0700 Merge tag 'soc-fixes-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "One last set of changes for the soc tree: - fix clock frequency on lan966x - fix incorrect GPIO numbers on some pxa machines - update Baolin's email address" * tag 'soc-fixes-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: pxa2xx: Fix GPIO descriptor tables mailmap: update Baolin Wang's email ARM: dts: lan966x: fix sys_clk frequency commit 5bb6c1d1126ebcbcd6314f80d82f50b021a9e351 Author: Borislav Petkov Date: Wed Jul 27 13:24:21 2022 +0200 Revert "x86/sev: Expose sev_es_ghcb_hv_call() for use by HyperV" This reverts commit 007faec014cb5d26983c1f86fd08c6539b41392e. Now that hyperv does its own protocol negotiation: 49d6a3c062a1 ("x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM") revert this exposure of the sev_es_ghcb_hv_call() helper. Cc: Wei Liu Signed-off-by: Borislav Petkov Reviewed-by:Tianyu Lan Link: https://lore.kernel.org/r/20220614014553.1915929-1-ltykernel@gmail.com commit 871808fd6981bcc6bb48f71032f983ca77748e96 Author: Lukas Bulwahn Date: Fri Jul 22 14:18:15 2022 +0200 x86/configs: Update configs in x86_debug.config Commit 4675ff05de2d ("kmemcheck: rip it out") removed kmemcheck and its corresponding build config KMEMCHECK. Commit 0f620cefd775 ("objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION"") renamed the debug config option. Adjust x86_debug.config to those changes in debug configs. Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220722121815.27535-1-lukas.bulwahn@gmail.com commit eda3953b6a805d6df87a4c51058493ec88bfc622 Merge: 82e094f7bd988 d6c52fa3e955b Author: Jens Axboe Date: Wed Jul 27 10:03:40 2022 -0600 Merge tag 'nvme-5.19-2022-07-27' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fix from Christoph: "nvme fix for Linux 5.19 - yet another duplicate ID quirk (Tobias Gruetzmacher)" * tag 'nvme-5.19-2022-07-27' of git://git.infradead.org/nvme: nvme-pci: Crucial P2 has bogus namespace ids commit 9a241805673ec0a826b7ddf84b00f4e03adb0a5e Author: Ian Rogers Date: Tue Jul 26 15:09:21 2022 -0700 perf bpf: Remove undefined behavior from bpf_perf_object__next() bpf_perf_object__next() folded the last element in the list test with the empty list test. However, this meant that offsets were computed against null and that a struct list_head was compared against a 'struct bpf_perf_object'. Working around this with clang's undefined behavior sanitizer required -fno-sanitize=null and -fno-sanitize=object-size. Remove the undefined behavior by using the regular Linux list APIs and handling the starting case separately from the end testing case. Looking at uses like bpf_perf_object__for_each(), as the constant NULL or non-NULL argument can be constant propagated, the code is no less efficient. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Christy Lee Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Tom Rix Cc: bpf@vger.kernel.org Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/r/20220726220921.2567761-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 882528d2e77687c3ef26abb9c490f77a9c1f6e1a Author: Leo Yan Date: Sun Jul 24 14:00:13 2022 +0800 perf symbol: Skip symbols if SHF_ALLOC flag is not set Some symbols are observed with the 'st_value' field zeroed. E.g. libc.so.6 in Ubuntu contains a symbol '__evoke_link_warning_getwd' which resides in the '.gnu.warning.getwd' section. Unlike normal sections, such kind of sections are used for linker warning when a file calls deprecated functions, but they are not part of memory images, the symbols in these sections should be dropped. This patch checks the section attribute SHF_ALLOC bit, if the bit is not set, it skips symbols to avoid spurious ones. Suggested-by: Fangrui Song Signed-off-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Chang Rui Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220724060013.171050-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 2d86612aacb7805f72873691a2644d7279ed0630 Author: Leo Yan Date: Sun Jul 24 14:00:12 2022 +0800 perf symbol: Correct address for bss symbols When using 'perf mem' and 'perf c2c', an issue is observed that tool reports the wrong offset for global data symbols. This is a common issue on both x86 and Arm64 platforms. Let's see an example, for a test program, below is the disassembly for its .bss section which is dumped with objdump: ... Disassembly of section .bss: 0000000000004040 : ... 0000000000004080 : ... 00000000000040c0 : ... 0000000000004100 : ... First we used 'perf mem record' to run the test program and then used 'perf --debug verbose=4 mem report' to observe what's the symbol info for 'buf1' and 'buf2' structures. # ./perf mem record -e ldlat-loads,ldlat-stores -- false_sharing.exe 8 # ./perf --debug verbose=4 mem report ... dso__load_sym_internal: adjusting symbol: st_value: 0x40c0 sh_addr: 0x4040 sh_offset: 0x3028 symbol__new: buf2 0x30a8-0x30e8 ... dso__load_sym_internal: adjusting symbol: st_value: 0x4080 sh_addr: 0x4040 sh_offset: 0x3028 symbol__new: buf1 0x3068-0x30a8 ... The perf tool relies on libelf to parse symbols, in executable and shared object files, 'st_value' holds a virtual address; 'sh_addr' is the address at which section's first byte should reside in memory, and 'sh_offset' is the byte offset from the beginning of the file to the first byte in the section. The perf tool uses below formula to convert a symbol's memory address to a file address: file_address = st_value - sh_addr + sh_offset ^ ` Memory address We can see the final adjusted address ranges for buf1 and buf2 are [0x30a8-0x30e8) and [0x3068-0x30a8) respectively, apparently this is incorrect, in the code, the structure for 'buf1' and 'buf2' specifies compiler attribute with 64-byte alignment. The problem happens for 'sh_offset', libelf returns it as 0x3028 which is not 64-byte aligned, combining with disassembly, it's likely libelf doesn't respect the alignment for .bss section, therefore, it doesn't return the aligned value for 'sh_offset'. Suggested by Fangrui Song, ELF file contains program header which contains PT_LOAD segments, the fields p_vaddr and p_offset in PT_LOAD segments contain the execution info. A better choice for converting memory address to file address is using the formula: file_address = st_value - p_vaddr + p_offset This patch introduces elf_read_program_header() which returns the program header based on the passed 'st_value', then it uses the formula above to calculate the symbol file address; and the debugging log is updated respectively. After applying the change: # ./perf --debug verbose=4 mem report ... dso__load_sym_internal: adjusting symbol: st_value: 0x40c0 p_vaddr: 0x3d28 p_offset: 0x2d28 symbol__new: buf2 0x30c0-0x3100 ... dso__load_sym_internal: adjusting symbol: st_value: 0x4080 p_vaddr: 0x3d28 p_offset: 0x2d28 symbol__new: buf1 0x3080-0x30c0 ... Fixes: f17e04afaff84b5c ("perf report: Fix ELF symbol parsing") Reported-by: Chang Rui Suggested-by: Fangrui Song Signed-off-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220724060013.171050-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit b226521923aee7051f4b24df9be5bf07d53f0a2b Author: Leo Yan Date: Mon Jul 25 18:42:20 2022 +0800 perf scripts python: Let script to be python2 compliant The mainline kernel can be used for relative old distros, e.g. RHEL 7. The distro doesn't upgrade from python2 to python3, this causes the building error that the python script is not python2 compliant. To fix the building failure, this patch changes from the python f-string format to traditional string format. Fixes: 12fdd6c009da0d02 ("perf scripts python: Support Arm CoreSight trace data disassembly") Reported-by: Akemi Yagi Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: ElRepo Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220725104220.1106663-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 553de6e1157df63fc6cdfe4573e04c8edcbe68f2 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: 28a99e95f55c6185 ("x86/amd: Use IBPB for firmware calls") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Adrian Hunter Cc: Borislav Petkov Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra commit 5a159128faff151b7fe5f4eb0f310b1e0a2d56bf Author: Jason Wang Date: Mon Jul 25 15:21:59 2022 +0800 virtio-net: fix the race between refill work and close We try using cancel_delayed_work_sync() to prevent the work from enabling NAPI. This is insufficient since we don't disable the source of the refill work scheduling. This means an NAPI poll callback after cancel_delayed_work_sync() can schedule the refill work then can re-enable the NAPI that leads to use-after-free [1]. Since the work can enable NAPI, we can't simply disable NAPI before calling cancel_delayed_work_sync(). So fix this by introducing a dedicated boolean to control whether or not the work could be scheduled from NAPI. [1] ================================================================== BUG: KASAN: use-after-free in refill_work+0x43/0xd4 Read of size 2 at addr ffff88810562c92e by task kworker/2:1/42 CPU: 2 PID: 42 Comm: kworker/2:1 Not tainted 5.19.0-rc1+ #480 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: events refill_work Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0xbb/0x6ac ? _printk+0xad/0xde ? refill_work+0x43/0xd4 kasan_report+0xa8/0x130 ? refill_work+0x43/0xd4 refill_work+0x43/0xd4 process_one_work+0x43d/0x780 worker_thread+0x2a0/0x6f0 ? process_one_work+0x780/0x780 kthread+0x167/0x1a0 ? kthread_exit+0x50/0x50 ret_from_fork+0x22/0x30 ... Fixes: b2baed69e605c ("virtio_net: set/cancel work on ndo_open/ndo_stop") Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Signed-off-by: David S. Miller commit 5e2805d5379619c4a2e3ae4994e73b36439f4bad Author: Toshi Kani Date: Thu Jul 21 12:05:03 2022 -0600 EDAC/ghes: Set the DIMM label unconditionally The commit cb51a371d08e ("EDAC/ghes: Setup DIMM label from DMI and use it in error reports") enforced that both the bank and device strings passed to dimm_setup_label() are not NULL. However, there are BIOSes, for example on a HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 03/15/2019 which don't populate both strings: Handle 0x0020, DMI type 17, 84 bytes Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 32 GB Form Factor: DIMM Set: None Locator: PROC 1 DIMM 1 <===== device Bank Locator: Not Specified <===== bank This results in a buffer overflow because ghes_edac_register() calls strlen() on an uninitialized label, which had non-zero values left over from krealloc_array(): detected buffer overflow in __fortify_strlen ------------[ cut here ]------------ kernel BUG at lib/string_helpers.c:983! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 1 PID: 1 Comm: swapper/0 Tainted: G I 5.18.6-200.fc36.x86_64 #1 Hardware name: HPE ProLiant DL360 Gen10/ProLiant DL360 Gen10, BIOS U32 03/15/2019 RIP: 0010:fortify_panic ... Call Trace: ghes_edac_register.cold ghes_probe platform_probe really_probe __driver_probe_device driver_probe_device __driver_attach ? __device_attach_driver bus_for_each_dev bus_add_driver driver_register acpi_ghes_init acpi_init ? acpi_sleep_proc_init do_one_initcall The label contains garbage because the commit in Fixes reallocs the DIMMs array while scanning the system but doesn't clear the newly allocated memory. Change dimm_setup_label() to always initialize the label to fix the issue. Set it to the empty string in case BIOS does not provide both bank and device so that ghes_edac_register() can keep the default label given by edac_mc_alloc_dimms(). [ bp: Rewrite commit message. ] Fixes: b9cae27728d1f ("EDAC/ghes: Scan the system once on driver init") Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Toshi Kani Signed-off-by: Borislav Petkov Tested-by: Robert Elliott Cc: Link: https://lore.kernel.org/r/20220719220124.760359-1-toshi.kani@hpe.com commit b5177ed92bf6f9d90a2493ed51c1327e088be1df Author: Mat Martineau Date: Mon Jul 25 13:52:31 2022 -0700 mptcp: Do not return EINPROGRESS when subflow creation succeeds New subflows are created within the kernel using O_NONBLOCK, so EINPROGRESS is the expected return value from kernel_connect(). __mptcp_subflow_connect() has the correct logic to consider EINPROGRESS to be a successful case, but it has also used that error code as its return value. Before v5.19 this was benign: all the callers ignored the return value. Starting in v5.19 there is a MPTCP_PM_CMD_SUBFLOW_CREATE generic netlink command that does use the return value, so the EINPROGRESS gets propagated to userspace. Make __mptcp_subflow_connect() always return 0 on success instead. Fixes: ec3edaa7ca6c ("mptcp: Add handling of outgoing MP_JOIN requests") Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20220725205231.87529-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit e77ea97d2bd99b004e96c339ee22408c5475a52e Merge: e53f529397318 47f4f510ad586 Author: Jakub Kicinski Date: Tue Jul 26 19:53:09 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Florian Westphal says: ==================== netfilter updates for net Three late fixes for netfilter: 1) If nf_queue user requests packet truncation below size of l3 header, we corrupt the skb, then crash. Reject such requests. 2) add cond_resched() calls when doing cycle detection in the nf_tables graph. This avoids softlockup warning with certain rulesets. 3) Reject rulesets that use nftables 'queue' expression in family/chain combinations other than those that are supported. Currently the ruleset will load, but when userspace attempts to reinject you get WARN splat + packet drops. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_queue: only allow supported familes and hooks netfilter: nf_tables: add rescheduling points during loop detection walks netfilter: nf_queue: do not allow packet truncation below transport header offset ==================== Link: https://lore.kernel.org/r/20220726192056.13497-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit e53f5293973181e8f557a7fef9a47f131fc3d4f0 Merge: aa40d5a43526c d0be8347c623e Author: Jakub Kicinski Date: Tue Jul 26 19:48:24 2022 -0700 Merge tag 'for-net-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix early wakeup after suspend - Fix double free on error - Fix use-after-free on l2cap_chan_put * tag 'for-net-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put Bluetooth: Always set event mask on suspend Bluetooth: mgmt: Fix double free on error path ==================== Link: https://lore.kernel.org/r/20220726221328.423714-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 39c3c396f8131f3db454c80e0fcfcdc54ed9ec01 Merge: 5de64d44968e4 1f7ea54727caa Author: Linus Torvalds Date: Tue Jul 26 19:38:46 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "Thirteen hotfixes. Eight are cc:stable and the remainder are for post-5.18 issues or are too minor to warrant backporting" * tag 'mm-hotfixes-stable-2022-07-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mailmap: update Gao Xiang's email addresses userfaultfd: provide properly masked address for huge-pages Revert "ocfs2: mount shared volume without ha stack" hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte fs: sendfile handles O_NONBLOCK of out_fd ntfs: fix use-after-free in ntfs_ucsncmp() secretmem: fix unhandled fault in truncate mm/hugetlb: separate path for hwpoison entry in copy_hugetlb_page_range() mm: fix missing wake-up event for FSDAX pages mm: fix page leak with multiple threads mapping the same page mailmap: update Seth Forshee's email address tmpfs: fix the issue that the mount and remount results are inconsistent. mm: kfence: apply kmemleak_ignore_phys on early allocated pool commit f5c2976e0cb0f6236013bfb479868531b04f61d4 Author: Bart Van Assche Date: Wed Jul 20 10:02:23 2022 -0700 scsi: ufs: core: Fix a race condition related to device management If a device management command completion happens after wait_for_completion_timeout() times out and before ufshcd_clear_cmds() is called, then the completion code may crash on the complete() call in __ufshcd_transfer_req_compl(). Fix the following crash: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Call trace: complete+0x64/0x178 __ufshcd_transfer_req_compl+0x30c/0x9c0 ufshcd_poll+0xf0/0x208 ufshcd_sl_intr+0xb8/0xf0 ufshcd_intr+0x168/0x2f4 __handle_irq_event_percpu+0xa0/0x30c handle_irq_event+0x84/0x178 handle_fasteoi_irq+0x150/0x2e8 __handle_domain_irq+0x114/0x1e4 gic_handle_irq.31846+0x58/0x300 el1_irq+0xe4/0x1c0 efi_header_end+0x110/0x680 __irq_exit_rcu+0x108/0x124 __handle_domain_irq+0x118/0x1e4 gic_handle_irq.31846+0x58/0x300 el1_irq+0xe4/0x1c0 cpuidle_enter_state+0x3ac/0x8c4 do_idle+0x2fc/0x55c cpu_startup_entry+0x84/0x90 kernel_init+0x0/0x310 start_kernel+0x0/0x608 start_kernel+0x4ec/0x608 Link: https://lore.kernel.org/r/20220720170228.1598842-1-bvanassche@acm.org Fixes: 5a0b0cb9bee7 ("[SCSI] ufs: Add support for sending NOP OUT UPIU") Cc: Adrian Hunter Cc: Avri Altman Cc: Bean Huo Cc: Stanley Chu Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d9a434fa0c12ed5f7afe1e9dd30003ab5d059b85 Author: Jason Yan Date: Wed Jul 20 10:51:20 2022 +0800 scsi: core: Fix warning in scsi_alloc_sgtables() As explained in SG_IO howto[1]: "If iovec_count is non-zero then 'dxfer_len' should be equal to the sum of iov_len lengths. If not, the minimum of the two is the transfer length." When iovec_count is non-zero and dxfer_len is zero, the sg_io() just genarated a null bio, and finally caused a warning below. To fix it, skip generating a bio for this request if dxfer_len is zero. [1] https://tldp.org/HOWTO/SCSI-Generic-HOWTO/x198.html WARNING: CPU: 2 PID: 3643 at drivers/scsi/scsi_lib.c:1032 scsi_alloc_sgtables+0xc7d/0xf70 drivers/scsi/scsi_lib.c:1032 Modules linked in: CPU: 2 PID: 3643 Comm: syz-executor397 Not tainted 5.17.0-rc3-syzkaller-00316-gb81b1829e7e3 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-204/01/2014 RIP: 0010:scsi_alloc_sgtables+0xc7d/0xf70 drivers/scsi/scsi_lib.c:1032 Code: e7 fc 31 ff 44 89 f6 e8 c1 4e e7 fc 45 85 f6 0f 84 1a f5 ff ff e8 93 4c e7 fc 83 c5 01 0f b7 ed e9 0f f5 ff ff e8 83 4c e7 fc <0f> 0b 41 bc 0a 00 00 00 e9 2b fb ff ff 41 bc 09 00 00 00 e9 20 fb RSP: 0018:ffffc90000d07558 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff88801bfc96a0 RCX: 0000000000000000 RDX: ffff88801c876000 RSI: ffffffff849060bd RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff849055b9 R11: 0000000000000000 R12: ffff888012b8c000 R13: ffff88801bfc9580 R14: 0000000000000000 R15: ffff88801432c000 FS: 00007effdec8e700(0000) GS:ffff88802cc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007effdec6d718 CR3: 00000000206d6000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: scsi_setup_scsi_cmnd drivers/scsi/scsi_lib.c:1219 [inline] scsi_prepare_cmd drivers/scsi/scsi_lib.c:1614 [inline] scsi_queue_rq+0x283e/0x3630 drivers/scsi/scsi_lib.c:1730 blk_mq_dispatch_rq_list+0x6ea/0x22e0 block/blk-mq.c:1851 __blk_mq_sched_dispatch_requests+0x20b/0x410 block/blk-mq-sched.c:299 blk_mq_sched_dispatch_requests+0xfb/0x180 block/blk-mq-sched.c:332 __blk_mq_run_hw_queue+0xf9/0x350 block/blk-mq.c:1968 __blk_mq_delay_run_hw_queue+0x5b6/0x6c0 block/blk-mq.c:2045 blk_mq_run_hw_queue+0x30f/0x480 block/blk-mq.c:2096 blk_mq_sched_insert_request+0x340/0x440 block/blk-mq-sched.c:451 blk_execute_rq+0xcc/0x340 block/blk-mq.c:1231 sg_io+0x67c/0x1210 drivers/scsi/scsi_ioctl.c:485 scsi_ioctl_sg_io drivers/scsi/scsi_ioctl.c:866 [inline] scsi_ioctl+0xa66/0x1560 drivers/scsi/scsi_ioctl.c:921 sd_ioctl+0x199/0x2a0 drivers/scsi/sd.c:1576 blkdev_ioctl+0x37a/0x800 block/ioctl.c:588 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7effdecdc5d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007effdec8e2f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007effded664c0 RCX: 00007effdecdc5d9 RDX: 0000000020002300 RSI: 0000000000002285 RDI: 0000000000000004 RBP: 00007effded34034 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 R13: 00007effded34054 R14: 2f30656c69662f2e R15: 00007effded664c8 Link: https://lore.kernel.org/r/20220720025120.3226770-1-yanaijie@huawei.com Fixes: 25636e282fe9 ("block: fix SG_IO vector request data length handling") Reported-by: syzbot+d44b35ecfb807e5af0b5@syzkaller.appspotmail.com Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Jason Yan Signed-off-by: Martin K. Petersen commit a3435afba87dc6cd83f5595e7607f3c40f93ef01 Author: Liang He Date: Tue Jul 19 15:15:29 2022 +0800 scsi: ufs: host: Hold reference returned by of_parse_phandle() In ufshcd_populate_vreg(), we should hold the reference returned by of_parse_phandle() and then use it to call of_node_put() for refcount balance. Link: https://lore.kernel.org/r/20220719071529.1081166-1-windhl@126.com Fixes: aa4976130934 ("ufs: Add regulator enable support") Reviewed-by: Bart Van Assche Signed-off-by: Liang He Signed-off-by: Martin K. Petersen commit 0fde22c5420ed258ee538a760291c2f3935f6a01 Author: David Jeffery Date: Fri Jul 22 10:24:48 2022 -0400 scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown During system shutdown or reboot, mpt3sas will reset the firmware back to ready state. However, the driver leaves running a watchdog work item intended to keep the firmware in operational state. This causes a second, unneeded reset on shutdown and moves the firmware back to operational instead of in ready state as intended. And if the mpt3sas_fwfault_debug module parameter is set, this extra reset also panics the system. mpt3sas's scsih_shutdown needs to stop the watchdog before resetting the firmware back to ready state. Link: https://lore.kernel.org/r/20220722142448.6289-1-djeffery@redhat.com Fixes: fae21608c31c ("scsi: mpt3sas: Transition IOC to Ready state during shutdown") Tested-by: Laurence Oberman Acked-by: Sreekanth Reddy Signed-off-by: David Jeffery Signed-off-by: Martin K. Petersen commit 1f7ea54727caaa6701a15af0cbeddfdb015b2869 Author: Gao Xiang Date: Tue Jul 19 23:42:46 2022 +0800 mailmap: update Gao Xiang's email addresses I've been in Alibaba Cloud for more than one year, mainly to address cloud-native challenges (such as high-performance container images) for open source communities. Update my email addresses on behalf of my current employer (Alibaba Cloud) to support all my (team) work in this area. Also add an outdated @redhat.com address of me. Link: https://lkml.kernel.org/r/20220719154246.62970-1-xiang@kernel.org Signed-off-by: Gao Xiang Signed-off-by: Andrew Morton commit d172b1a3bd065dd89234eac547fc62cf80681631 Author: Nadav Amit Date: Mon Jul 11 09:59:06 2022 -0700 userfaultfd: provide properly masked address for huge-pages Commit 824ddc601adc ("userfaultfd: provide unmasked address on page-fault") was introduced to fix an old bug, in which the offset in the address of a page-fault was masked. Concerns were raised - although were never backed by actual code - that some userspace code might break because the bug has been around for quite a while. To address these concerns a new flag was introduced, and only when this flag is set by the user, userfaultfd provides the exact address of the page-fault. The commit however had a bug, and if the flag is unset, the offset was always masked based on a base-page granularity. Yet, for huge-pages, the behavior prior to the commit was that the address is masked to the huge-page granulrity. While there are no reports on real breakage, fix this issue. If the flag is unset, use the address with the masking that was done before. Link: https://lkml.kernel.org/r/20220711165906.2682-1-namit@vmware.com Fixes: 824ddc601adc ("userfaultfd: provide unmasked address on page-fault") Signed-off-by: Nadav Amit Reported-by: James Houghton Reviewed-by: Mike Rapoport Reviewed-by: Peter Xu Reviewed-by: James Houghton Cc: David Hildenbrand Cc: Jan Kara Cc: Andrea Arcangeli Cc: Signed-off-by: Andrew Morton commit d0be8347c623e0ac4202a1d4e0373882821f56b0 Author: Luiz Augusto von Dentz Date: Thu Jul 21 09:10:50 2022 -0700 Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put This fixes the following trace which is caused by hci_rx_work starting up *after* the final channel reference has been put() during sock_close() but *before* the references to the channel have been destroyed, so instead the code now rely on kref_get_unless_zero/l2cap_chan_hold_unless_zero to prevent referencing a channel that is about to be destroyed. refcount_t: increment on 0; use-after-free. BUG: KASAN: use-after-free in refcount_dec_and_test+0x20/0xd0 Read of size 4 at addr ffffffc114f5bf18 by task kworker/u17:14/705 CPU: 4 PID: 705 Comm: kworker/u17:14 Tainted: G S W 4.14.234-00003-g1fb6d0bd49a4-dirty #28 Hardware name: Qualcomm Technologies, Inc. SM8150 V2 PM8150 Google Inc. MSM sm8150 Flame DVT (DT) Workqueue: hci0 hci_rx_work Call trace: dump_backtrace+0x0/0x378 show_stack+0x20/0x2c dump_stack+0x124/0x148 print_address_description+0x80/0x2e8 __kasan_report+0x168/0x188 kasan_report+0x10/0x18 __asan_load4+0x84/0x8c refcount_dec_and_test+0x20/0xd0 l2cap_chan_put+0x48/0x12c l2cap_recv_frame+0x4770/0x6550 l2cap_recv_acldata+0x44c/0x7a4 hci_acldata_packet+0x100/0x188 hci_rx_work+0x178/0x23c process_one_work+0x35c/0x95c worker_thread+0x4cc/0x960 kthread+0x1a8/0x1c4 ret_from_fork+0x10/0x18 Cc: stable@kernel.org Reported-by: Lee Jones Signed-off-by: Luiz Augusto von Dentz Tested-by: Lee Jones Signed-off-by: Luiz Augusto von Dentz commit ef61b6ea154464fefd8a6712d7a3b43b445c3d4a Author: Abhishek Pandit-Subedi Date: Mon Jul 25 15:34:21 2022 -0700 Bluetooth: Always set event mask on suspend When suspending, always set the event mask once disconnects are successful. Otherwise, if wakeup is disallowed, the event mask is not set before suspend continues and can result in an early wakeup. Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier") Cc: stable@vger.kernel.org Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Luiz Augusto von Dentz commit 4b2f4e072fb2599b6a2e5e277f0d2b5705eaa630 Author: Dan Carpenter Date: Tue Jul 26 18:13:44 2022 +0300 Bluetooth: mgmt: Fix double free on error path Don't call mgmt_pending_remove() twice (double free). Fixes: 6b88eff43704 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Signed-off-by: Dan Carpenter Signed-off-by: Luiz Augusto von Dentz commit aa40d5a43526cca9439a2b45fcfdcd016594dece Author: Tetsuo Handa Date: Sun Jul 17 21:21:52 2022 +0900 wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop() lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1], for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped") guards clear_bit() using fq.lock even before fq_init() from ieee80211_txq_setup_flows() initializes this spinlock. According to discussion [2], Toke was not happy with expanding usage of fq.lock. Since __ieee80211_wake_txqs() is called under RCU read lock, we can instead use synchronize_rcu() for flushing ieee80211_wake_txqs(). Link: https://syzkaller.appspot.com/bug?extid=eceab52db7c4b961e9d6 [1] Link: https://lkml.kernel.org/r/874k0zowh2.fsf@toke.dk [2] Reported-by: syzbot Signed-off-by: Tetsuo Handa Fixes: f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped") Tested-by: syzbot Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/9cc9b81d-75a3-3925-b612-9d0ad3cab82b@I-love.SAKURA.ne.jp [ pick up commit 3598cb6e1862 ("wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop()") from -next] Link: https://lore.kernel.org/all/87o7xcq6qt.fsf@kernel.org/ Signed-off-by: Jakub Kicinski commit cc019545a238518fa9da1e2a889f6e1bb1005a63 Author: Maciej Fijalkowski Date: Thu Jul 7 12:20:43 2022 +0200 ice: do not setup vlan for loopback VSI Currently loopback test is failiing due to the error returned from ice_vsi_vlan_setup(). Skip calling it when preparing loopback VSI. Fixes: 0e674aeb0b77 ("ice: Add handler for ethtool selftest") Signed-off-by: Maciej Fijalkowski Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit 283d736ff7c7e96ac5b32c6c0de40372f8eb171e Author: Maciej Fijalkowski Date: Thu Jul 7 12:20:42 2022 +0200 ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS) Tx side sets EOP and RS bits on descriptors to indicate that a particular descriptor is the last one and needs to generate an irq when it was sent. These bits should not be checked on completion path regardless whether it's the Tx or the Rx. DD bit serves this purpose and it indicates that a particular descriptor is either for Rx or was successfully Txed. EOF is also set as loopback test does not xmit fragmented frames. Look at (DD | EOF) bits setting in ice_lbtest_receive_frames() instead of EOP and RS pair. Fixes: 0e674aeb0b77 ("ice: Add handler for ethtool selftest") Signed-off-by: Maciej Fijalkowski Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit 5c8e3c7ff3e7bd7b938659be704f75cc746b697f Author: Anirudh Venkataramanan Date: Thu Jul 21 10:03:09 2022 +0200 ice: Fix VSIs unable to share unicast MAC The driver currently does not allow two VSIs in the same PF domain to have the same unicast MAC address. This is incorrect in the sense that a policy decision is being made in the driver when it must be left to the user. This approach was causing issues when rebooting the system with VFs spawned not being able to change their MAC addresses. Such errors were present in dmesg: [ 7921.068237] ice 0000:b6:00.2 ens2f2: Unicast MAC 6a:0d:e4:70:ca:d1 already exists on this PF. Preventing setting VF 7 unicast MAC address to 6a:0d:e4:70:ca:d1 Fix that by removing this restriction. Doing this also allows us to remove some additional code that's checking if a unicast MAC filter already exists. Fixes: 47ebc7b02485 ("ice: Check if unicast MAC exists before setting VF MAC") Signed-off-by: Anirudh Venkataramanan Signed-off-by: Sylwester Dziedziuch Signed-off-by: Mateusz Palczewski Signed-off-by: Jedrzej Jagielski Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen commit 01658aeeada6f93c2924af94d895ff28d559690c Author: Przemyslaw Patynowski Date: Mon Jul 18 13:34:27 2022 +0200 ice: Fix tunnel checksum offload with fragmented traffic Fix checksum offload on VXLAN tunnels. In case, when mpls protocol is not used, set l4 header to transport header of skb. This fixes case, when user tries to offload checksums of VXLAN tunneled traffic. Steps for reproduction (requires link partner with tunnels): ip l s enp130s0f0 up ip a f enp130s0f0 ip a a 10.10.110.2/24 dev enp130s0f0 ip l s enp130s0f0 mtu 1600 ip link add vxlan12_sut type vxlan id 12 group 238.168.100.100 dev enp130s0f0 dstport 4789 ip l s vxlan12_sut up ip a a 20.10.110.2/24 dev vxlan12_sut iperf3 -c 20.10.110.1 #should connect Offload params: td_offset, cd_tunnel_params were corrupted, due to l4 header pointing wrong address. NIC would then drop those packets internally, due to incorrect TX descriptor data, which increased GLV_TEPC register. Fixes: 69e66c04c672 ("ice: Add mpls+tso support") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 1e308c6fb7127371f48a0fb9770ea0b30a6b5698 Author: Przemyslaw Patynowski Date: Mon Jul 4 15:46:12 2022 +0200 ice: Fix max VLANs available for VF Legacy VLAN implementation allows for untrusted VF to have 8 VLAN filters, not counting VLAN 0 filters. Current VLAN_V2 implementation lowers available filters for VF, by counting in VLAN 0 filter for both TPIDs. Fix this by counting only non zero VLAN filters. Without this patch, untrusted VF would not be able to access 8 VLAN filters. Fixes: cc71de8fa133 ("ice: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen commit 47f4f510ad586032b85c89a0773fbb011d412425 Author: Florian Westphal Date: Tue Jul 26 19:49:00 2022 +0200 netfilter: nft_queue: only allow supported familes and hooks Trying to use 'queue' statement in ingress (for example) triggers a splat on reinject: WARNING: CPU: 3 PID: 1345 at net/netfilter/nf_queue.c:291 ... because nf_reinject cannot find the ruleset head. The netdev family doesn't support async resume at the moment anyway, so disallow loading such rulesets with a more appropriate error message. v2: add 'validate' callback and also check hook points, v1 did allow ingress use in 'table inet', but that doesn't work either. (Pablo) Signed-off-by: Florian Westphal Reviewed-by: Pablo Neira Ayuso commit 81ea010667417ef3f218dfd99b69769fe66c2b67 Author: Florian Westphal Date: Tue Jul 26 12:44:35 2022 +0200 netfilter: nf_tables: add rescheduling points during loop detection walks Add explicit rescheduling points during ruleset walk. Switching to a faster algorithm is possible but this is a much smaller change, suitable for nf tree. Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1460 Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso commit 99a63d36cb3ed5ca3aa6fcb64cffbeaf3b0fb164 Author: Florian Westphal Date: Tue Jul 26 12:42:06 2022 +0200 netfilter: nf_queue: do not allow packet truncation below transport header offset Domingo Dirutigliano and Nicola Guerrera report kernel panic when sending nf_queue verdict with 1-byte nfta_payload attribute. The IP/IPv6 stack pulls the IP(v6) header from the packet after the input hook. If user truncates the packet below the header size, this skb_pull() will result in a malformed skb (skb->len < 0). Fixes: 7af4cc3fa158 ("[NETFILTER]: Add "nfnetlink_queue" netfilter queue handler over nfnetlink") Reported-by: Domingo Dirutigliano Signed-off-by: Florian Westphal Reviewed-by: Pablo Neira Ayuso commit 5de64d44968e4ae66ebdb0a2d08b443f189d3651 Merge: cdb281e638740 918e75f77af7d Author: Linus Torvalds Date: Tue Jul 26 10:03:53 2022 -0700 Merge tag 's390-5.19-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fix from Alexander GordeevL - Prevent relatively slow PRNO TRNG random number operation from being called from interrupt context. That could for example cause some network loads to timeout. * tag 's390-5.19-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/archrandom: prevent CPACF trng invocations in interrupt context commit cdb281e63874086a650552d36c504ea717a0e0cb Author: Qi Zheng Date: Tue Jul 26 14:24:36 2022 +0800 mm: fix NULL pointer dereference in wp_page_reuse() The vmf->page can be NULL when the wp_page_reuse() is invoked by wp_pfn_shared(), it will cause the following panic: BUG: kernel NULL pointer dereference, address: 000000000000008 #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: 18 PID: 923 Comm: Xorg Not tainted 5.19.0-rc8.bm.1-amd64 #263 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g14 RIP: 0010:_compound_head+0x0/0x40 [...] Call Trace: wp_page_reuse+0x1c/0xa0 do_wp_page+0x1a5/0x3f0 __handle_mm_fault+0x8cf/0xd20 handle_mm_fault+0xd5/0x2a0 do_user_addr_fault+0x1d0/0x680 exc_page_fault+0x78/0x170 asm_exc_page_fault+0x22/0x30 To fix it, this patch performs a NULL pointer check before dereferencing the vmf->page. Fixes: 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") Signed-off-by: Qi Zheng Reviewed-by: David Hildenbrand Signed-off-by: Linus Torvalds commit 0c09bc33aa8e9dc867300acaadc318c2f0d85a1e Author: Nathan Chancellor Date: Mon Jul 25 16:36:29 2022 -0700 drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid() When booting a kernel compiled with clang's CFI protection (CONFIG_CFI_CLANG), there is a CFI failure in drm_simple_kms_crtc_mode_valid() when trying to call simpledrm_simple_display_pipe_mode_valid() through ->mode_valid(): [ 0.322802] CFI failure (target: simpledrm_simple_display_pipe_mode_valid+0x0/0x8): ... [ 0.324928] Call trace: [ 0.324969] __ubsan_handle_cfi_check_fail+0x58/0x60 [ 0.325053] __cfi_check_fail+0x3c/0x44 [ 0.325120] __cfi_slowpath_diag+0x178/0x200 [ 0.325192] drm_simple_kms_crtc_mode_valid+0x58/0x80 [ 0.325279] __drm_helper_update_and_validate+0x31c/0x464 ... The ->mode_valid() member in 'struct drm_simple_display_pipe_funcs' expects a return type of 'enum drm_mode_status', not 'int'. Correct it to fix the CFI failure. Cc: stable@vger.kernel.org Fixes: 11e8f5fd223b ("drm: Add simpledrm driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1647 Reported-by: Tomasz Paweł Gajc Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Zimmermann Reviewed-by: Sami Tolvanen Link: https://patchwork.freedesktop.org/patch/msgid/20220725233629.223223-1-nathan@kernel.org commit 9b134b1694ec8926926ba6b7b80884ea829245a0 Author: Benjamin Poirier Date: Mon Jul 25 09:12:36 2022 +0900 bridge: Do not send empty IFLA_AF_SPEC attribute After commit b6c02ef54913 ("bridge: Netlink interface fix."), br_fill_ifinfo() started to send an empty IFLA_AF_SPEC attribute when a bridge vlan dump is requested but an interface does not have any vlans configured. iproute2 ignores such an empty attribute since commit b262a9becbcb ("bridge: Fix output with empty vlan lists") but older iproute2 versions as well as other utilities have their output changed by the cited kernel commit, resulting in failed test cases. Regardless, emitting an empty attribute is pointless and inefficient. Avoid this change by canceling the attribute if no AF_SPEC data was added. Fixes: b6c02ef54913 ("bridge: Netlink interface fix.") Reviewed-by: Ido Schimmel Signed-off-by: Benjamin Poirier Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220725001236.95062-1-bpoirier@nvidia.com Signed-off-by: Paolo Abeni commit 33881ab73d6f6b4f0a2a89aece86dd60e6e507c6 Merge: b89fc26f741d9 59e1be6f83b92 Author: Paolo Abeni Date: Tue Jul 26 13:05:46 2022 +0200 Merge branch 'octeontx2-minor-tc-fixes' Subbaraya Sundeep says: ==================== Octeontx2 minor tc fixes This patch set fixes two problems found in tc code wrt to ratelimiting and when installing UDP/TCP filters. Patch 1: CN10K has different register format compared to CN9xx hence fixes that. Patch 2: Check flow mask also before installing a src/dst port filter, otherwise installing for one port installs for other one too. ==================== Link: https://lore.kernel.org/r/1658650874-16459-1-git-send-email-sbhatta@marvell.com Signed-off-by: Paolo Abeni commit 59e1be6f83b928a04189bbf3ab683a1fc6248db3 Author: Subbaraya Sundeep Date: Sun Jul 24 13:51:14 2022 +0530 octeontx2-pf: Fix UDP/TCP src and dst port tc filters Check the mask for non-zero value before installing tc filters for L4 source and destination ports. Otherwise installing a filter for source port installs destination port too and vice-versa. Fixes: 1d4d9e42c240 ("octeontx2-pf: Add tc flower hardware offload on ingress traffic") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: Paolo Abeni commit b354eaeec8637d87003945439209251d76a2bb95 Author: Sunil Goutham Date: Sun Jul 24 13:51:13 2022 +0530 octeontx2-pf: cn10k: Fix egress ratelimit configuration NIX_AF_TLXX_PIR/CIR register format has changed from OcteonTx2 to CN10K. CN10K supports larger burst size. Fix burst exponent and burst mantissa configuration for CN10K. Also fixed 'maxrate' from u32 to u64 since 'police.rate_bytes_ps' passed by stack is also u64. Fixes: e638a83f167e ("octeontx2-pf: TC_MATCHALL egress ratelimiting offload") Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: Paolo Abeni commit b89fc26f741d9f9efb51cba3e9b241cf1380ec5a Author: Duoming Zhou Date: Sat Jul 23 09:58:09 2022 +0800 sctp: fix sleep in atomic context bug in timer handlers There are sleep in atomic context bugs in timer handlers of sctp such as sctp_generate_t3_rtx_event(), sctp_generate_probe_event(), sctp_generate_t1_init_event(), sctp_generate_timeout_event(), sctp_generate_t3_rtx_event() and so on. The root cause is sctp_sched_prio_init_sid() with GFP_KERNEL parameter that may sleep could be called by different timer handlers which is in interrupt context. One of the call paths that could trigger bug is shown below: (interrupt context) sctp_generate_probe_event sctp_do_sm sctp_side_effects sctp_cmd_interpreter sctp_outq_teardown sctp_outq_init sctp_sched_set_sched n->init_sid(..,GFP_KERNEL) sctp_sched_prio_init_sid //may sleep This patch changes gfp_t parameter of init_sid in sctp_sched_set_sched() from GFP_KERNEL to GFP_ATOMIC in order to prevent sleep in atomic context bugs. Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations") Signed-off-by: Duoming Zhou Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/20220723015809.11553-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski commit c7560d1203b7a1ea0b99a5c575547e95d564b2a8 Author: Vladimir Oltean Date: Sat Jul 23 04:24:11 2022 +0300 net: dsa: fix reference counting for LAG FDBs Due to an invalid conflict resolution on my side while working on 2 different series (LAG FDBs and FDB isolation), dsa_switch_do_lag_fdb_add() does not store the database associated with a dsa_mac_addr structure. So after adding an FDB entry associated with a LAG, dsa_mac_addr_find() fails to find it while deleting it, because &a->db is zeroized memory for all stored FDB entries of lag->fdbs, and dsa_switch_do_lag_fdb_del() returns -ENOENT rather than deleting the entry. Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220723012411.1125066-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 5fcbb711024aac6d4db385623e6f2fdf019f7782 Author: Michal Maloszewski Date: Fri Jul 22 10:54:01 2022 -0700 i40e: Fix interface init with MSI interrupts (no MSI-X) Fix the inability to bring an interface up on a setup with only MSI interrupts enabled (no MSI-X). Solution is to add a default number of QPs = 1. This is enough, since without MSI-X support driver enables only a basic feature set. Fixes: bc6d33c8d93f ("i40e: Fix the number of queues available to be mapped for use") Signed-off-by: Dawid Lukwinski Signed-off-by: Michal Maloszewski Tested-by: Dave Switzer Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220722175401.112572-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c653c591789b3acfa4bf6ae45d5af4f330e50a91 Author: Michael Ellerman Date: Mon Jul 25 14:37:29 2022 +1000 drm/amdgpu: Re-enable DCN for 64-bit powerpc Commit d11219ad53dc ("amdgpu: disable powerpc support for the newer display engine") disabled the DCN driver for all of powerpc due to unresolved build failures with some compilers. Further digging shows that the build failures only occur with compilers that default to 64-bit long double. Both the ppc64 and ppc64le ABIs define long double to be 128-bits, but there are compilers in the wild that default to 64-bits. The compilers provided by the major distros (Fedora, Ubuntu) default to 128-bits and are not affected by the build failure. There is a compiler flag to force 128-bit long double, which may be the correct long term fix, but as an interim fix only allow building the DCN driver if long double is 128-bits by default. The bisection in commit d11219ad53dc must have gone off the rails at some point, the build failure occurs all the way back to the original commit that enabled DCN support on powerpc, at least with some toolchains. Depends-on: d11219ad53dc ("amdgpu: disable powerpc support for the newer display engine") Fixes: 16a9dea110a6 ("amdgpu: Enable initial DCN support on POWER") Signed-off-by: Michael Ellerman Acked-by: Alex Deucher Reviewed-by: Dan Horák Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2100 Link: https://lore.kernel.org/r/20220725123918.1903255-1-mpe@ellerman.id.au commit d295ad34f236c3518634fb6403d4c0160456e470 Author: Waiman Long Date: Sat Jul 23 15:59:32 2022 -0400 intel_idle: Fix false positive RCU splats due to incorrect hardirqs state Commit 32d4fd5751ea ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE") uses raw_local_irq_enable/local_irq_disable() around call to __intel_idle() in intel_idle_irq(). With interrupt enabled, timer tick interrupt can happen and a subsequently call to __do_softirq() may change the lockdep hardirqs state of a debug kernel back to 'on'. This will result in a mismatch between the cpu hardirqs state (off) and the lockdep hardirqs state (on) causing a number of false positive "WARNING: suspicious RCU usage" splats. Fix that by using local_irq_disable() to disable interrupt in intel_idle_irq(). Fixes: 32d4fd5751ea ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE") Signed-off-by: Waiman Long Cc: 5.16+ # 5.16+ Signed-off-by: Rafael J. Wysocki commit a7a47a5dfa9a9692a41764ee9ab4054f12924a42 Author: Umesh Nerlige Ramappa Date: Tue Jun 21 12:21:05 2022 -0700 drm/i915/reset: Add additional steps for Wa_22011802037 for execlist backend For execlists backend, current implementation of Wa_22011802037 is to stop the CS before doing a reset of the engine. This WA was further extended to wait for any pending MI FORCE WAKEUPs before issuing a reset. Add the extended steps in the execlist path of reset. In addition, extend the WA to gen11. v2: (Tvrtko) - Clarify comments, commit message, fix typos - Use IS_GRAPHICS_VER for gen 11/12 checks v3: (Daneile) - Drop changes to intel_ring_submission since WA does not apply to it - Log an error if MSG IDLE is not defined for an engine Signed-off-by: Umesh Nerlige Ramappa Fixes: f6aa0d713c88 ("drm/i915: Add Wa_22011802037 force cs halt") Acked-by: Tvrtko Ursulin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220621192105.2100585-1-umesh.nerlige.ramappa@intel.com (cherry picked from commit 0667429ce68e0b08f9f1fec8fd0b1f57228f605e) Signed-off-by: Tvrtko Ursulin commit 9af0620de1e118666881376f6497d1785758b04c Merge: 3e7d18b9dca38 96b9bd8c6d125 Author: David S. Miller Date: Mon Jul 25 12:42:10 2022 +0100 Merge branch 'net-sysctl-races-part-6' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Round 6, Final). This series fixes data-races around 11 knobs after tcp_pacing_ss_ratio ipv4_net_table, and this is the final round for ipv4_net_table. While at it, other data-races around these related knobs are fixed. - decnet_mem - decnet_rmem - tipc_rmem There are still 58 tables possibly missing some fixes under net/. $ grep -rnE "struct ctl_table.*?\[\] =" net/ | wc -l 60 ==================== Signed-off-by: David S. Miller commit 96b9bd8c6d125490f9adfb57d387ef81a55a103e Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:05 2022 -0700 ipv4: Fix data-races around sysctl_fib_notify_on_flag_change. While reading sysctl_fib_notify_on_flag_change, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 680aea08e78c ("net: ipv4: Emit notification when fib hardware flags are changed") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 870e3a634b6a6cb1543b359007aca73fe6a03ac5 Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:04 2022 -0700 tcp: Fix data-races around sysctl_tcp_reflect_tos. While reading sysctl_tcp_reflect_tos, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: ac8f1710c12b ("tcp: reflect tos value received in SYN to the socket") Signed-off-by: Kuniyuki Iwashima Acked-by: Wei Wang Signed-off-by: David S. Miller commit 79f55473bfc8ac51bd6572929a679eeb4da22251 Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:03 2022 -0700 tcp: Fix a data-race around sysctl_tcp_comp_sack_nr. While reading sysctl_tcp_comp_sack_nr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 9c21d2fc41c0 ("tcp: add tcp_comp_sack_nr sysctl") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 22396941a7f343d704738360f9ef0e6576489d43 Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:02 2022 -0700 tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns. While reading sysctl_tcp_comp_sack_slack_ns, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: a70437cc09a1 ("tcp: add hrtimer slack to sack compression") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4866b2b0f7672b6d760c4b8ece6fb56f965dcc8a Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:01 2022 -0700 tcp: Fix a data-race around sysctl_tcp_comp_sack_delay_ns. While reading sysctl_tcp_comp_sack_delay_ns, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 6d82aa242092 ("tcp: add tcp_comp_sack_delay_ns sysctl") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 02739545951ad4c1215160db7fbf9b7a918d3c0b Author: Kuniyuki Iwashima Date: Fri Jul 22 11:22:00 2022 -0700 net: Fix data-races around sysctl_[rw]mem(_offset)?. While reading these sysctl variables, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. - .sysctl_rmem - .sysctl_rwmem - .sysctl_rmem_offset - .sysctl_wmem_offset - sysctl_tcp_rmem[1, 2] - sysctl_tcp_wmem[1, 2] - sysctl_decnet_rmem[1] - sysctl_decnet_wmem[1] - sysctl_tipc_rmem[1] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 59bf6c65a09fff74215517aecffbbdcd67df76e3 Author: Kuniyuki Iwashima Date: Fri Jul 22 11:21:59 2022 -0700 tcp: Fix data-races around sk_pacing_rate. While reading sysctl_tcp_pacing_(ss|ca)_ratio, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. Fixes: 43e122b014c9 ("tcp: refine pacing rate determination") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 3e7d18b9dca388940a19cae30bfc1f76dccd8c28 Author: Taehee Yoo Date: Fri Jul 22 17:06:35 2022 +0000 net: mld: fix reference count leak in mld_{query | report}_work() mld_{query | report}_work() processes queued events. If there are too many events in the queue, it re-queue a work. And then, it returns without in6_dev_put(). But if queuing is failed, it should call in6_dev_put(), but it doesn't. So, a reference count leak would occur. THREAD0 THREAD1 mld_report_work() spin_lock_bh() if (!mod_delayed_work()) in6_dev_hold(); spin_unlock_bh() spin_lock_bh() schedule_delayed_work() spin_unlock_bh() Script to reproduce(by Hangbin Liu): ip netns add ns1 ip netns add ns2 ip netns exec ns1 sysctl -w net.ipv6.conf.all.force_mld_version=1 ip netns exec ns2 sysctl -w net.ipv6.conf.all.force_mld_version=1 ip -n ns1 link add veth0 type veth peer name veth0 netns ns2 ip -n ns1 link set veth0 up ip -n ns2 link set veth0 up for i in `seq 50`; do for j in `seq 100`; do ip -n ns1 addr add 2021:${i}::${j}/64 dev veth0 ip -n ns2 addr add 2022:${i}::${j}/64 dev veth0 done done modprobe -r veth ip -a netns del splat looks like: unregister_netdevice: waiting for veth0 to become free. Usage count = 2 leaked reference. ipv6_add_dev+0x324/0xec0 addrconf_notify+0x481/0xd10 raw_notifier_call_chain+0xe3/0x120 call_netdevice_notifiers+0x106/0x160 register_netdevice+0x114c/0x16b0 veth_newlink+0x48b/0xa50 [veth] rtnl_newlink+0x11a2/0x1a40 rtnetlink_rcv_msg+0x63f/0xc00 netlink_rcv_skb+0x1df/0x3e0 netlink_unicast+0x5de/0x850 netlink_sendmsg+0x6c9/0xa90 ____sys_sendmsg+0x76a/0x780 __sys_sendmsg+0x27c/0x340 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Tested-by: Hangbin Liu Fixes: f185de28d9ae ("mld: add new workqueues for process mld events") Signed-off-by: Taehee Yoo Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit c7b205fbbf3cffa374721bb7623f7aa8c46074f1 Author: Jianglei Nie Date: Fri Jul 22 17:29:02 2022 +0800 net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa() init_rx_sa() allocates relevant resource for rx_sa->stats and rx_sa-> key.tfm with alloc_percpu() and macsec_alloc_tfm(). When some error occurs after init_rx_sa() is called in macsec_add_rxsa(), the function released rx_sa with kfree() without releasing rx_sa->stats and rx_sa-> key.tfm, which will lead to a resource leak. We should call macsec_rxsa_put() instead of kfree() to decrease the ref count of rx_sa and release the relevant resource if the refcount is 0. The same bug exists in macsec_add_txsa() for tx_sa as well. This patch fixes the above two bugs. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: Jianglei Nie Signed-off-by: David S. Miller commit 20a854616d384d3210d96fee248a3ea327bab810 Merge: 1aaa62c4838a1 c630d1fe62197 Author: David S. Miller Date: Mon Jul 25 11:49:25 2022 +0100 Merge branch 'macsec-config-issues' Sabrina Dubroca says: ==================== macsec: fix config issues The patch adding netlink support for XPN (commit 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)")) introduced several issues, including a kernel panic reported at [1]. Reproducing those bugs with upstream iproute is limited, since iproute doesn't currently support XPN. I'm also working on this. [1] https://bugzilla.kernel.org/show_bug.cgi?id=208315 ==================== Signed-off-by: David S. Miller commit c630d1fe6219769049c87d1a6a0e9a6de55328a1 Author: Sabrina Dubroca Date: Fri Jul 22 11:16:30 2022 +0200 macsec: always read MACSEC_SA_ATTR_PN as a u64 Currently, MACSEC_SA_ATTR_PN is handled inconsistently, sometimes as a u32, sometimes forced into a u64 without checking the actual length of the attribute. Instead, we can use nla_get_u64 everywhere, which will read up to 64 bits into a u64, capped by the actual length of the attribute coming from userspace. This fixes several issues: - the check in validate_add_rxsa doesn't work with 32-bit attributes - the checks in validate_add_txsa and validate_upd_sa incorrectly reject X << 32 (with X != 0) Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit b07a0e2044057f201d694ab474f5c42a02b6465b Author: Sabrina Dubroca Date: Fri Jul 22 11:16:29 2022 +0200 macsec: limit replay window size with XPN IEEE 802.1AEbw-2013 (section 10.7.8) specifies that the maximum value of the replay window is 2^30-1, to help with recovery of the upper bits of the PN. To avoid leaving the existing macsec device in an inconsistent state if this test fails during changelink, reuse the cleanup mechanism introduced for HW offload. This wasn't needed until now because macsec_changelink_common could not fail during changelink, as modifying the cipher suite was not allowed. Finally, this must happen after handling IFLA_MACSEC_CIPHER_SUITE so that secy->xpn is set. Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 3240eac4ff20e51b87600dbd586ed814daf313db Author: Sabrina Dubroca Date: Fri Jul 22 11:16:28 2022 +0200 macsec: fix error message in macsec_add_rxsa and _txsa The expected length is MACSEC_SALT_LEN, not MACSEC_SA_ATTR_SALT. Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)") Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit f46040eeaf2e523a4096199fd93a11e794818009 Author: Sabrina Dubroca Date: Fri Jul 22 11:16:27 2022 +0200 macsec: fix NULL deref in macsec_add_rxsa Commit 48ef50fa866a added a test on tb_sa[MACSEC_SA_ATTR_PN], but nothing guarantees that it's not NULL at this point. The same code was added to macsec_add_txsa, but there it's not a problem because validate_add_txsa checks that the MACSEC_SA_ATTR_PN attribute is present. Note: it's not possible to reproduce with iproute, because iproute doesn't allow creating an SA without specifying the PN. Fixes: 48ef50fa866a ("macsec: Netlink support of XPN cipher suites (IEEE 802.1AEbw)") Link: https://bugzilla.kernel.org/show_bug.cgi?id=208315 Reported-by: Frantisek Sumsal Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 1aaa62c4838a140d0592935c51985158963d5971 Author: Slark Xiao Date: Fri Jul 22 17:38:34 2022 +0800 s390/qeth: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: David S. Miller commit 2540d3c99926c234718e058acdd956d7c614eddd Author: Slark Xiao Date: Fri Jul 22 16:22:27 2022 +0800 net: ipa: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Signed-off-by: David S. Miller commit af35f95aca69a86058d480a63f4e096f0220905c Author: Slark Xiao Date: Fri Jul 22 16:20:27 2022 +0800 nfp: bpf: Fix typo 'the the' in comment Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao Acked-by: Simon Horman Signed-off-by: David S. Miller commit d6c52fa3e955b97f8eb3ac824d2a3e0af147b3ce Author: Tobias Gruetzmacher Date: Fri Jul 22 19:05:57 2022 +0200 nvme-pci: Crucial P2 has bogus namespace ids This adds a quirk for the Crucial P2. Signed-off-by: Tobias Gruetzmacher Signed-off-by: Christoph Hellwig commit 3c69a99b62fde9de86a612ef1daaa07d95f0a773 Merge: be640317a1d0b ff6992735ade7 Author: Michael Ellerman Date: Mon Jul 25 13:49:22 2022 +1000 Merge tag 'v5.19-rc7' into fixes Merge v5.19-rc7 into fixes to bring in: d11219ad53dc ("amdgpu: disable powerpc support for the newer display engine") commit aa709da0e032cee7c202047ecd75f437bb0126ed Author: Xin Long Date: Thu Jul 21 10:35:46 2022 -0400 Documentation: fix sctp_wmem in ip-sysctl.rst Since commit 1033990ac5b2 ("sctp: implement memory accounting on tx path"), SCTP has supported memory accounting on tx path where 'sctp_wmem' is used by sk_wmem_schedule(). So we should fix the description for this option in ip-sysctl.rst accordingly. v1->v2: - Improve the description as Marcelo suggested. Fixes: 1033990ac5b2 ("sctp: implement memory accounting on tx path") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit f6336724a4d4220c89a4ec38bca84b03b178b1a3 Author: Maxim Mikityanskiy Date: Thu Jul 21 12:11:27 2022 +0300 net/tls: Remove the context from the list in tls_device_down tls_device_down takes a reference on all contexts it's going to move to the degraded state (software fallback). If sk_destruct runs afterwards, it can reduce the reference counter back to 1 and return early without destroying the context. Then tls_device_down will release the reference it took and call tls_device_free_ctx. However, the context will still stay in tls_device_down_list forever. The list will contain an item, memory for which is released, making a memory corruption possible. Fix the above bug by properly removing the context from all lists before any call to tls_device_free_ctx. Fixes: 3740651bf7e2 ("tls: Fix context leak on tls_device_down") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit e0dccc3b76fb35bb257b4118367a883073d7390e Author: Linus Torvalds Date: Sun Jul 24 13:26:27 2022 -0700 Linux 5.19-rc8 commit e90886291c7cd89577bf11729b205cc0ed42fbec Author: Adam Borowski Date: Mon Jul 18 15:50:34 2022 +0200 certs: make system keyring depend on x509 parser This code requires x509_load_certificate_list() to be built-in. Fixes: 60050ffe3d77 ("certs: Move load_certificate_list() to be with the asymmetric keys code") Reported-by: kernel test robot Reported-by: Steven Rostedt Link: https://lore.kernel.org/all/202206221515.DqpUuvbQ-lkp@intel.com/ Link: https://lore.kernel.org/all/20220712104554.408dbf42@gandalf.local.home/ Signed-off-by: Adam Borowski Signed-off-by: Linus Torvalds commit af2c9ac24019ece9281e606662e5c78fa67f5930 Merge: c2602a7ce0fc6 b0380e13502ad Author: Linus Torvalds Date: Sun Jul 24 09:55:53 2022 -0700 Merge tag 'perf_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Reorganize the perf LBR init code so that a TSX quirk is applied early enough in order for the LBR MSR access to not #GP * tag 'perf_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/lbr: Fix unchecked MSR access error on HSW commit c2602a7ce0fc66318325df170a9ee275d7df5c2e Merge: 05017fed92de3 ddfc710395ccc Author: Linus Torvalds Date: Sun Jul 24 09:50:53 2022 -0700 Merge tag 'sched_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "A single fix to correct a wrong BUG_ON() condition for deboosted tasks" * tag 'sched_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/deadline: Fix BUG_ON condition for deboosted tasks commit 05017fed92de32c167bbd21a5ee9ad0e489e19d4 Merge: 714b82c18ba0d b648ab487f31b Author: Linus Torvalds Date: Sun Jul 24 09:40:17 2022 -0700 Merge tag 'x86_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: "A couple more retbleed fallout fixes. It looks like their urgency is decreasing so it seems like we've managed to catch whatever snafus the limited -rc testing has exposed. Maybe we're getting ready... :) - Make retbleed mitigations 64-bit only (32-bit will need a bit more work if even needed, at all). - Prevent return thunks patching of the LKDTM modules as it is not needed there - Avoid writing the SPEC_CTRL MSR on every kernel entry on eIBRS parts - Enhance error output of apply_returns() when it fails to patch a return thunk - A sparse fix to the sev-guest module - Protect EFI fw calls by issuing an IBPB on AMD" * tag 'x86_urgent_for_v5.19_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Make all RETbleed mitigations 64-bit only lkdtm: Disable return thunks in rodata.c x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS parts x86/alternative: Report missing return thunk details virt: sev-guest: Pass the appropriate argument type to iounmap() x86/amd: Use IBPB for firmware calls commit 714b82c18ba0d2e76e9c3fd7785ff5a060f5980b Merge: 515f71412bb73 25c2a075eb6a3 Author: Linus Torvalds Date: Sun Jul 24 09:33:13 2022 -0700 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fix from Stephen Boyd: "One more fix to set the correct IO mapping for a clk gate in the lan966x driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: lan966x: Fix the lan966x clock gate register address commit 515f71412bb73ebd7f41f90e1684fc80b8730789 Merge: 301c8949322fe cf5029d5dd7cb Author: Linus Torvalds Date: Sat Jul 23 10:22:26 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: - Check for invalid flags to KVM_CAP_X86_USER_SPACE_MSR - Fix use of sched_setaffinity in selftests - Sync kernel headers to tools - Fix KVM_STATS_UNIT_MAX * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: Protect the unused bits in MSR exiting flags tools headers UAPI: Sync linux/kvm.h with the kernel sources KVM: selftests: Fix target thread to be migrated in rseq_test KVM: stats: Fix value for KVM_STATS_UNIT_MAX for boolean stats commit b648ab487f31bc4c38941bc770ea97fe394304bb Author: Ben Hutchings Date: Sat Jul 23 17:22:47 2022 +0200 x86/speculation: Make all RETbleed mitigations 64-bit only The mitigations for RETBleed are currently ineffective on x86_32 since entry_32.S does not use the required macros. However, for an x86_32 target, the kconfig symbols for them are still enabled by default and /sys/devices/system/cpu/vulnerabilities/retbleed will wrongly report that mitigations are in place. Make all of these symbols depend on X86_64, and only enable RETHUNK by default on X86_64. Fixes: f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs") Signed-off-by: Ben Hutchings Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/YtwSR3NNsWp1ohfV@decadent.org.uk commit 301c8949322fe46766b334cc60ada5819b92000e Merge: 70664fc10c0d7 b620aa3a7be34 Author: Linus Torvalds Date: Fri Jul 22 16:40:03 2022 -0700 Merge tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few more small driver specific fixes" * tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-rspi: Fix PIO fallback on RZ platforms spi: spi-cadence: Fix SPI NO Slave Select macro definition spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers commit 4d8f24eeedc58d5f87b650ddda73c16e8ba56559 Author: Wei Wang Date: Thu Jul 21 20:44:04 2022 +0000 Revert "tcp: change pingpong threshold to 3" This reverts commit 4a41f453bedfd5e9cd040bad509d9da49feb3e2c. This to-be-reverted commit was meant to apply a stricter rule for the stack to enter pingpong mode. However, the condition used to check for interactive session "before(tp->lsndtime, icsk->icsk_ack.lrcvtime)" is jiffy based and might be too coarse, which delays the stack entering pingpong mode. We revert this patch so that we no longer use the above condition to determine interactive session, and also reduce pingpong threshold to 1. Fixes: 4a41f453bedf ("tcp: change pingpong threshold to 3") Reported-by: LemmyHuang Suggested-by: Neal Cardwell Signed-off-by: Wei Wang Acked-by: Neal Cardwell Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220721204404.388396-1-weiwan@google.com Signed-off-by: Jakub Kicinski commit 70664fc10c0d722ec79d746d8ac1db8546c94114 Merge: ae21fbac18b98 c1f6eff304e4d Author: Linus Torvalds Date: Fri Jul 22 13:02:05 2022 -0700 Merge tag 'riscv-for-linus-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - Two kexec-related build fixes - A DTS update to make the GPIO nodes match the upcoming dtschema - A fix that passes -mno-relax directly to the assembler when building modules, to work around compilers that fail to do so * tag 'riscv-for-linus-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: add as-options for modules with assembly compontents riscv: dts: align gpio-key node names with dtschema RISC-V: kexec: Fix build error without CONFIG_KEXEC RISCV: kexec: Fix build error without CONFIG_MODULES commit ae21fbac18b980ecfd895ff32833a2543c157ee2 Merge: a5235996e1b04 09073396ea62d Author: Linus Torvalds Date: Fri Jul 22 12:56:49 2022 -0700 Merge tag 'acpi-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix yet another piece of ACPI CPPC changes fallout on AMD platforms (Mario Limonciello)" * tag 'acpi-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: CPPC: Don't require flexible address space if X86_FEATURE_CPPC is supported commit a5235996e1b04405fbd6deea37b051715214fd2a Merge: d945404f74f34 934447a603b22 Author: Linus Torvalds Date: Fri Jul 22 12:47:09 2022 -0700 Merge tag 'io_uring-5.19-2022-07-21' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Fix for a bad kfree() introduced in this cycle, and a quick fix for disabling buffer recycling for IORING_OP_READV. The latter will get reworked for 5.20, but it gets the job done for 5.19" * tag 'io_uring-5.19-2022-07-21' of git://git.kernel.dk/linux-block: io_uring: do not recycle buffer in READV io_uring: fix free of unallocated buffer list commit d945404f74f34b76cb02d73025b92ce8b4729d3f Merge: 4a1dcf77f47ec 82e094f7bd988 Author: Linus Torvalds Date: Fri Jul 22 12:41:14 2022 -0700 Merge tag 'block-5.19-2022-07-21' of git://git.kernel.dk/linux-block Pull block fix from Jens Axboe: "Just a single fix for missing error propagation for an allocation failure in raid5" * tag 'block-5.19-2022-07-21' of git://git.kernel.dk/linux-block: md/raid5: missing error code in setup_conf() commit 4a1dcf77f47ec45e4c66787b2cd47f8b768c74da Merge: 6f8e4e10434e2 4ca8ca873d454 Author: Linus Torvalds Date: Fri Jul 22 12:36:59 2022 -0700 Merge tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Two driver bugfixes and a typo fix" * tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: cadence: Change large transfer count reset logic to be unconditional i2c: imx: fix typo in comment i2c: mlxcpld: Fix register setting for 400KHz frequency commit 6f8e4e10434e2345c1e929aa93919808f99ba66e Merge: 614719111265a 32c094a09d582 Author: Linus Torvalds Date: Fri Jul 22 12:28:47 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix several regmap usage issues in gpio-pca953x - fix out-of-tree build for GPIO selftests - fix integer overflow in gpio-xilinx * tag 'gpio-fixes-for-v5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: gpio-xilinx: Fix integer overflow selftests: gpio: fix include path to kernel headers for out of tree builds gpio: pca953x: use the correct register address when regcache sync during init gpio: pca953x: use the correct range when do regmap sync gpio: pca953x: only use single read/write for No AI mode commit 614719111265a7a76d0ae54758f23d8614966b82 Merge: 8f636c6a16f2a 4546760619cfa Author: Linus Torvalds Date: Fri Jul 22 12:24:04 2022 -0700 Merge tag 'pinctrl-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Only driver fixes: - NULL check for the ralink and sunplus drivers - Add Jacky Bai as maintainer for the Freescale pin controllers - Fix pin config ops for the Ocelot LAN966x and SparX5 - Disallow AMD pin control to be a module: the GPIO lines need to be active in early boot, so no can do - Fix the Armada 37xx to use raw spinlocks in the interrupt handler path to avoid wait context" * tag 'pinctrl-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: armada-37xx: use raw spinlocks for regmap to avoid invalid wait context pinctrl: armada-37xx: make irq_lock a raw spinlock to avoid invalid wait context pinctrl: Don't allow PINCTRL_AMD to be a module pinctrl: ocelot: Fix pincfg pinctrl: ocelot: Fix pincfg for lan966x MAINTAINERS: Update freescale pin controllers maintainer pinctrl: sunplus: Add check for kcalloc pinctrl: ralink: Check for null return of devm_kcalloc commit 88bd24d73d5bfa1b7b97a9221ff320fc44ef401a Author: Emil Renner Berthing Date: Sat Jun 25 16:42:07 2022 +0100 riscv: compat: vdso: Fix vdso_install target When CONFIG_COMPAT=y the vdso_install target fails: $ make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- vdso_install INSTALL vdso.so make[1]: *** No rule to make target 'vdso_install'. Stop. make: *** [arch/riscv/Makefile:112: vdso_install] Error 2 The problem is that arch/riscv/kernel/compat_vdso/Makefile doesn't have a vdso_install target, but instead calls it compat_vdso_install. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220625154207.80972-1-emil.renner.berthing@canonical.com Fixes: 0715372a06ce ("riscv: compat: vdso: Add COMPAT_VDSO base code implementation") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 8f636c6a16f2a6809f7de27c99e0780dd569fb23 Merge: 85029503fc95e cf33ce6f0c220 Author: Linus Torvalds Date: Fri Jul 22 12:19:02 2022 -0700 Merge tag 'sound-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Only undoes the Rockchip BCLK changes to address a regression" * tag 'sound-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: rockchip-i2s: Undo BCLK pinctrl changes ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found commit 85029503fc95ea16e0c0856251f5cba750847c85 Merge: 8e65afba6baaa 51189eb9ddc88 Author: Linus Torvalds Date: Fri Jul 22 12:14:13 2022 -0700 Merge tag 'mmc-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fix from Ulf Hansson: - sdhci-omap: Fix a lockdep warning while probing * tag 'mmc-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-omap: Fix a lockdep warning for PM runtime init commit 8e65afba6baaa1317efc4038cbced1268c6e2f6b Merge: 4ba1329cbb945 7f5ec14a4e07a Author: Linus Torvalds Date: Fri Jul 22 12:03:19 2022 -0700 Merge tag 'drm-fixes-2022-07-22' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Fixes for this week. The main one is the i915 firmware fix for the phoronix reported issue. I've written some firmware guidelines as a result, should land in -next soon. Otherwise a few amdgpu fixes, a scheduler fix, ttm fix and two other minor ones. scheduler: - scheduling while atomic fix ttm: - locking fix edp: - variable typo fix i915: - add back support for v69 firmware on ADL-P amdgpu: - Drop redundant buffer cleanup that can lead to a segfault - Add a bo_list mutex to avoid possible list corruption in CS - dmub notification fix imx: - fix error path" * tag 'drm-fixes-2022-07-22' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2 drm/imx/dcss: Add missing of_node_put() in fail path drm/i915/guc: support v69 in parallel to v70 drm/i915/guc: Support programming the EU priority in the GuC descriptor drm/panel-edp: Fix variable typo when saving hpd absent delay from DT drm/amdgpu: Remove one duplicated ef removal drm/ttm: fix locking in vmap/vunmap TTM GEM helpers drm/scheduler: Don't kill jobs in interrupt context drm/amd/display: Fix new dmub notification enabling in DM commit 4ba1329cbb9456c937bff1ed8ad4ca91ab75eab6 Merge: 7fb5e50831906 4f2bfd9494a07 Author: Linus Torvalds Date: Fri Jul 22 10:01:20 2022 -0700 Merge tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU fix from Paul McKenney: "This contains a pair of commits that fix 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers from consuming CPU"), which was itself a fix to an SRCU expedited grace-period problem that could prevent kernel live patching (KLP) from completing. That SRCU fix for KLP introduced large (as in minutes) boot-time delays to embedded Linux kernels running on qemu/KVM. These delays were due to the emulation of certain MMIO operations controlling memory layout, which were emulated with one expedited grace period per access. Common configurations required thousands of boot-time MMIO accesses, and thus thousands of boot-time expedited SRCU grace periods. In these configurations, the occasional sleeps that allowed KLP to proceed caused excessive boot delays. These commits preserve enough sleeps to permit KLP to proceed, but few enough that the virtual embedded kernels still boot reasonably quickly. This represents a regression introduced in the v5.19 merge window, and the bug is causing significant inconvenience" * tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: srcu: Make expedited RCU grace periods block even less frequently srcu: Block less aggressively for expedited grace periods commit 7fb5e508319068de1d69e6d7230416c390cb3cbb Author: Linus Torvalds Date: Fri Jul 22 09:28:34 2022 -0700 mmu_gather: fix the CONFIG_MMU_GATHER_NO_RANGE case Sudip reports that alpha doesn't build properly, with errors like include/asm-generic/tlb.h:401:1: error: redefinition of 'tlb_update_vma_flags' 401 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) | ^~~~~~~~~~~~~~~~~~~~ include/asm-generic/tlb.h:372:1: note: previous definition of 'tlb_update_vma_flags' with type 'void(struct mmu_gather *, struct vm_area_struct *)' 372 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) { } the cause being that We have this odd situation where some architectures were never converted to the newer TLB flushing interfaces that have a range for the flush. Instead people left them alone, and we have them select the MMU_GATHER_NO_RANGE config option to make the tlb header files account for this. Peter Zijlstra cleaned some of these nasty header file games up in commits 1e9fdf21a433 ("mmu_gather: Remove per arch tlb_{start,end}_vma()") 18ba064e42df ("mmu_gather: Let there be one tlb_{start,end}_vma() implementation") but tlb_update_vma_flags() was left alone, and then commit b67fbebd4cf9 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas") ended up removing only _one_ of the two stale duplicate dummy inline functions. This removes the other stale one. Somebody braver than me should try to remove MMU_GATHER_NO_RANGE entirely, but it requires fixing up the oddball architectures that use it: alpha, m68k, microblaze, nios2 and openrisc. The fixups should be fairly straightforward ("fix the build errors it exposes by adding the appropriate range arguments"), but the reason this wasn't done in the first place is that so few people end up working on those architectures. But it could be done one architecture at a time, hint, hint. Reported-by: Sudip Mukherjee (Codethink) Fixes: b67fbebd4cf9 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas") Link: https://lore.kernel.org/all/YtpXh0QHWwaEWVAY@debian/ Cc: Peter Zijlstra Cc: Will Deacon Cc: "Aneesh Kumar K.V" Cc: Andrew Morton Cc: Nick Piggin Cc: Arnd Bergmann Signed-off-by: Linus Torvalds commit c5cdb9286913aa5a5ebb81bcca0c17df3b0e2c79 Author: Linus Walleij Date: Fri Jul 22 13:46:11 2022 +0200 ARM: pxa2xx: Fix GPIO descriptor tables Laurence reports: "Kernel >5.18 on Zaurus has a bug where the power management code can't talk to devices, emitting the following errors: sharpsl-pm sharpsl-pm: Error: AC check failed: voltage -22. sharpsl-pm sharpsl-pm: Charging Error! sharpsl-pm sharpsl-pm: Warning: Cannot read main battery! Looking at the recent changes, I found that commit 31455bbda208 ("spi: pxa2xx_spi: Convert to use GPIO descriptors") replaced the deprecated SPI chip select platform device code with a gpiod lookup table. However, this didn't seem to work until I changed the `dev_id` member from the device name to the bus id. I'm not entirely sure why this is necessary, but I suspect it is related to the fact that in sysfs SPI devices are attached under /sys/devices/.../dev_name/spi_master/spiB/spiB.C, rather than directly to the device." After reviewing the change I conclude that the same fix is needed for all affected boards. Fixes: 31455bbda208 ("spi: pxa2xx_spi: Convert to use GPIO descriptors") Reported-by: Laurence de Bruxelles Signed-off-by: Linus Walleij Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220722114611.1517414-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit e2a619ca0b38f2114347b7078b8a67d72d457a3d Author: Lukas Bulwahn Date: Fri Jul 22 13:07:11 2022 +0200 asm-generic: remove a broken and needless ifdef conditional Commit 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()") introduces the config symbol GENERIC_LIB_DEVMEM_IS_ALLOWED, but then falsely refers to CONFIG_GENERIC_DEVMEM_IS_ALLOWED (note the missing LIB in the reference) in ./include/asm-generic/io.h. Luckily, ./scripts/checkkconfigsymbols.py warns on non-existing configs: GENERIC_DEVMEM_IS_ALLOWED Referencing files: include/asm-generic/io.h The actual fix, though, is simply to not to make this function declaration dependent on any kernel config. For architectures that intend to use the generic version, the arch's 'select GENERIC_LIB_DEVMEM_IS_ALLOWED' will lead to picking the function definition, and for other architectures, this function is simply defined elsewhere. The wrong '#ifndef' on a non-existing config symbol also always had the same effect (although more by mistake than by intent). So, there is no functional change. Remove this broken and needless ifdef conditional. Fixes: 527701eda5f1 ("lib: Add a generic version of devmem_is_allowed()") Signed-off-by: Lukas Bulwahn Signed-off-by: Arnd Bergmann commit 4bcffe941758ee17becb43af3b25487f848f6512 Author: Sherry Sun Date: Wed Apr 27 09:51:37 2022 +0800 EDAC/synopsys: Re-enable the error interrupts on v3 hw zynqmp_get_error_info() writes 0 to the ECC_CLR_OFST register after an interrupt for a {un-,}correctable error is raised, which disables the error interrupts. Then the interrupt handler will be called only once. Therefore, re-enable the error interrupt line at the end of intr_handler() for v3.x Synopsys EDAC DDR. Fixes: f7824ded4149 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR") Signed-off-by: Sherry Sun Signed-off-by: Borislav Petkov Reviewed-by: Shubhrajyoti Datta Acked-by: Michal Simek Cc: Link: https://lore.kernel.org/r/20220427015137.8406-3-sherry.sun@nxp.com commit be76ceaf03bc04e74be5e28f608316b73c2b04ad Author: Sherry Sun Date: Wed Apr 27 09:51:36 2022 +0800 EDAC/synopsys: Use the correct register to disable the error interrupt on v3 hw v3.x Synopsys EDAC DDR doesn't have the QOS Interrupt register. Use the ECC Clear Register to disable the error interrupts instead. Fixes: f7824ded4149 ("EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR") Signed-off-by: Sherry Sun Signed-off-by: Borislav Petkov Reviewed-by: Shubhrajyoti Datta Acked-by: Michal Simek Cc: Link: https://lore.kernel.org/r/20220427015137.8406-2-sherry.sun@nxp.com commit 8ee18e2a9e7b0e97730549f58dd618433c15811b Author: Christophe JAILLET Date: Wed Jul 20 21:49:46 2022 +0200 caif: Fix bitmap data type in "struct caifsock" Bitmap are "unsigned long", so use it instead of a "u32" to make things more explicit. While at it, remove some useless cast (and leading spaces) when using the bitmap API. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 030f21ba2ab14c221ff31cf22a16c78963328f6f Author: Rob Herring Date: Tue Jul 19 15:51:08 2022 -0600 dt-bindings: net: fsl,fec: Add missing types to phy-reset-* properties The phy-reset-* properties are missing type definitions and are not common properties. Even though they are deprecated, a type is needed. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit 17161c341de0b02788b0428cb253a35b9a3c89b3 Author: Rob Herring Date: Tue Jul 19 15:50:59 2022 -0600 dt-bindings: net: ethernet-controller: Rework 'fixed-link' schema While the if/then schemas mostly work, there's a few issues. The 'allOf' schema will also be true if 'fixed-link' is not an array or object as a false 'if' schema (without an 'else') will be true. In the array case doesn't set the type (uint32-array) in the 'then' clause. In the node case, 'additionalProperties' is missing. Rework the schema to use oneOf with each possible type. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit b20a7ca8cfa4dce01f848056fe6313b444b7dcf5 Merge: ebbbe23fdf607 2afdbe7b8de84 Author: David S. Miller Date: Fri Jul 22 12:06:18 2022 +0100 Merge branch 'sysctl-races-part-5' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Round 5). This series fixes data-races around 15 knobs after tcp_dsack in ipv4_net_table. tcp_tso_win_divisor was skipped because it already uses READ_ONCE(). So, the final round for ipv4_net_table will start with tcp_pacing_ss_ratio. ==================== Signed-off-by: David S. Miller commit 2afdbe7b8de84c28e219073a6661080e1b3ded48 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:26 2022 -0700 tcp: Fix a data-race around sysctl_tcp_invalid_ratelimit. While reading sysctl_tcp_invalid_ratelimit, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 032ee4236954 ("tcp: helpers to mitigate ACK loops by rate-limiting out-of-window dupacks") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 85225e6f0a76e6745bc841c9f25169c509b573d8 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:25 2022 -0700 tcp: Fix a data-race around sysctl_tcp_autocorking. While reading sysctl_tcp_autocorking, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: f54b311142a9 ("tcp: auto corking") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1330ffacd05fc9ac4159d19286ce119e22450ed2 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:24 2022 -0700 tcp: Fix a data-race around sysctl_tcp_min_rtt_wlen. While reading sysctl_tcp_min_rtt_wlen, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: f672258391b4 ("tcp: track min RTT using windowed min-filter") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 2455e61b85e9c99af38cd889a7101f1d48b33cb4 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:23 2022 -0700 tcp: Fix a data-race around sysctl_tcp_tso_rtt_log. While reading sysctl_tcp_tso_rtt_log, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 65466904b015 ("tcp: adjust TSO packet sizes based on min_rtt") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit e0bb4ab9dfddd872622239f49fb2bd403b70853b Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:22 2022 -0700 tcp: Fix a data-race around sysctl_tcp_min_tso_segs. While reading sysctl_tcp_min_tso_segs, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 95bd09eb2750 ("tcp: TSO packets automatic sizing") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit db3815a2fa691da145cfbe834584f31ad75df9ff Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:21 2022 -0700 tcp: Fix a data-race around sysctl_tcp_challenge_ack_limit. While reading sysctl_tcp_challenge_ack_limit, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 282f23c6ee34 ("tcp: implement RFC 5961 3.2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 9fb90193fbd66b4c5409ef729fd081861f8b6351 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:20 2022 -0700 tcp: Fix a data-race around sysctl_tcp_limit_output_bytes. While reading sysctl_tcp_limit_output_bytes, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 46d3ceabd8d9 ("tcp: TCP Small Queues") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 0f1e4d06591d0a7907c71f7b6d1c79f8a4de8098 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:19 2022 -0700 tcp: Fix data-races around sysctl_tcp_workaround_signed_windows. While reading sysctl_tcp_workaround_signed_windows, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 15d99e02baba ("[TCP]: sysctl to allow TCP window > 32767 sans wscale") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 780476488844e070580bfc9e3bc7832ec1cea883 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:18 2022 -0700 tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf. While reading sysctl_tcp_moderate_rcvbuf, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit ab1ba21b523ab496b1a4a8e396333b24b0a18f9a Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:17 2022 -0700 tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save. While reading sysctl_tcp_no_ssthresh_metrics_save, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 65e6d90168f3 ("net-tcp: Disable TCP ssthresh metrics cache by default") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8499a2454d9e8a55ce616ede9f9580f36fd5b0f3 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:16 2022 -0700 tcp: Fix a data-race around sysctl_tcp_nometrics_save. While reading sysctl_tcp_nometrics_save, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 706c6202a3589f290e1ef9be0584a8f4a3cc0507 Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:15 2022 -0700 tcp: Fix a data-race around sysctl_tcp_frto. While reading sysctl_tcp_frto, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 36eeee75ef0157e42fb6593dcc65daab289b559e Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:14 2022 -0700 tcp: Fix a data-race around sysctl_tcp_adv_win_scale. While reading sysctl_tcp_adv_win_scale, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 02ca527ac5581cf56749db9fd03d854e842253dd Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:13 2022 -0700 tcp: Fix a data-race around sysctl_tcp_app_win. While reading sysctl_tcp_app_win, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 58ebb1c8b35a8ef38cd6927431e0fa7b173a632d Author: Kuniyuki Iwashima Date: Wed Jul 20 09:50:12 2022 -0700 tcp: Fix data-races around sysctl_tcp_dsack. While reading sysctl_tcp_dsack, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 32c094a09d5829ad9b02cdf667569aefa8de0ea6 Author: Srinivas Neeli Date: Thu Jul 21 13:09:09 2022 +0530 gpio: gpio-xilinx: Fix integer overflow Current implementation is not able to configure more than 32 pins due to incorrect data type. So type casting with unsigned long to avoid it. Fixes: 02b3f84d9080 ("xilinx: Switch to use bitmap APIs") Signed-off-by: Srinivas Neeli Signed-off-by: Bartosz Golaszewski commit 7f5ec14a4e07a2a78fbde069709d5c8806882be2 Merge: 1c46f3c075911 02c87df2480ac Author: Dave Airlie Date: Fri Jul 22 12:16:15 2022 +1000 Merge tag 'drm-misc-fixes-2022-07-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes A scheduling-while-atomic fix for drm/scheduler, a locking fix for TTM, a typo fix for panel-edp and a resource removal fix for imx/dcss Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220721085550.hrwbukj34y56rzva@houat commit ebbbe23fdf6070e31509638df3321688358cc211 Author: Liang He Date: Wed Jul 20 21:10:03 2022 +0800 net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() In bcm5421_init(), we should call of_node_put() for the reference returned by of_get_parent() which has increased the refcount. Fixes: 3c326fe9cb7a ("[PATCH] ppc64: Add new PHY to sungem") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220720131003.1287426-1-windhl@126.com Signed-off-by: Jakub Kicinski commit 27161db0904ee48e59140aa8d0835939a666c1f1 Author: Vladimir Oltean Date: Wed Jul 20 14:20:57 2022 +0300 net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii While phylink_pcs_ops :: pcs_get_state does return void, xpcs_get_state() does check for a non-zero return code from xpcs_get_state_c37_sgmii() and prints that as a message to the kernel log. However, a non-zero return code from xpcs_read() is translated into "return false" (i.e. zero as int) and the I/O error is therefore not printed. Fix that. Fixes: b97b5331b8ab ("net: pcs: add C37 SGMII AN support for intel mGbE controller") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220720112057.3504398-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit c1f6eff304e4dfa4558b6a8c6b2d26a91db6c998 Author: Ben Dooks Date: Sun May 29 16:22:00 2022 +0100 riscv: add as-options for modules with assembly compontents When trying to load modules built for RISC-V which include assembly files the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'" due to R_RISCV_ALIGN relocations being generated by the assembler. The R_RISCV_ALIGN relocations can be removed at the expense of code space by adding -mno-relax to gcc and as. In commit 7a8e7da42250138 ("RISC-V: Fixes to module loading") -mno-relax is added to the build variable KBUILD_CFLAGS_MODULE. See [1] for more info. The issue is that when kbuild builds a .S file, it invokes gcc with the -mno-relax flag, but this is not being passed through to the assembler. Adding -Wa,-mno-relax to KBUILD_AFLAGS_MODULE ensures that the assembler is invoked correctly. This may have now been fixed in gcc[2] and this addition should not stop newer gcc and as from working. [1] https://github.com/riscv/riscv-elf-psabi-doc/issues/183 [2] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 Signed-off-by: Ben Dooks Reviewed-by: Bin Meng Link: https://lore.kernel.org/r/20220529152200.609809-1-ben.dooks@codethink.co.uk Fixes: ab1ef68e5401 ("RISC-V: Add sections of PLT and GOT for kernel module") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 68e77ffbfd06ae3ef8f2abf1c3b971383c866983 Merge: 7ca433dc6dedb 0fddf9ad06fd9 Author: Linus Torvalds Date: Thu Jul 21 11:28:26 2022 -0700 Merge tag 'mtd/fixes-for-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD fix from Richard Weinberger: "A aingle NAND controller fix: - gpmi: Fix busy timeout setting (wrong calculation, yes again)" * tag 'mtd/fixes-for-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: gpmi: Set WAIT_FOR_READY timeout based on program/erase times commit 7ca433dc6dedb2ec98dfc943f6db0c9b8996ed11 Merge: b67fbebd4cf98 44484fa8eedf1 Author: Linus Torvalds Date: Thu Jul 21 11:08:35 2022 -0700 Merge tag 'net-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from can. Still no major regressions, most of the changes are still due to data races fixes, plus the usual bunch of drivers fixes. Previous releases - regressions: - tcp/udp: make early_demux back namespacified. - dsa: fix issues with vlan_filtering_is_global Previous releases - always broken: - ip: fix data-races around ipv4_net_table (round 2, 3 & 4) - amt: fix validation and synchronization bugs - can: fix detection of mcp251863 - eth: iavf: fix handling of dummy receive descriptors - eth: lan966x: fix issues with MAC table - eth: stmmac: dwmac-mediatek: fix clock issue Misc: - dsa: update documentation" * tag 'net-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (107 commits) mlxsw: spectrum_router: Fix IPv4 nexthop gateway indication net/sched: cls_api: Fix flow action initialization tcp: Fix data-races around sysctl_tcp_max_reordering. tcp: Fix a data-race around sysctl_tcp_abort_on_overflow. tcp: Fix a data-race around sysctl_tcp_rfc1337. tcp: Fix a data-race around sysctl_tcp_stdurg. tcp: Fix a data-race around sysctl_tcp_retrans_collapse. tcp: Fix data-races around sysctl_tcp_slow_start_after_idle. tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts. tcp: Fix data-races around sysctl_tcp_recovery. tcp: Fix a data-race around sysctl_tcp_early_retrans. tcp: Fix data-races around sysctl knobs related to SYN option. udp: Fix a data-race around sysctl_udp_l3mdev_accept. ip: Fix data-races around sysctl_ip_prot_sock. ipv4: Fix data-races around sysctl_fib_multipath_hash_fields. ipv4: Fix data-races around sysctl_fib_multipath_hash_policy. ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh. can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() can: mcp251xfd: fix detection of mcp251863 Documentation: fix udp_wmem_min in ip-sysctl.rst ... commit 918e75f77af7d2e049bb70469ec0a2c12782d96a Author: Harald Freudenberger Date: Wed Jul 13 15:17:21 2022 +0200 s390/archrandom: prevent CPACF trng invocations in interrupt context This patch slightly reworks the s390 arch_get_random_seed_{int,long} implementation: Make sure the CPACF trng instruction is never called in any interrupt context. This is done by adding an additional condition in_task(). Justification: There are some constrains to satisfy for the invocation of the arch_get_random_seed_{int,long}() functions: - They should provide good random data during kernel initialization. - They should not be called in interrupt context as the TRNG instruction is relatively heavy weight and may for example make some network loads cause to timeout and buck. However, it was not clear what kind of interrupt context is exactly encountered during kernel init or network traffic eventually calling arch_get_random_seed_long(). After some days of investigations it is clear that the s390 start_kernel function is not running in any interrupt context and so the trng is called: Jul 11 18:33:39 t35lp54 kernel: [<00000001064e90ca>] arch_get_random_seed_long.part.0+0x32/0x70 Jul 11 18:33:39 t35lp54 kernel: [<000000010715f246>] random_init+0xf6/0x238 Jul 11 18:33:39 t35lp54 kernel: [<000000010712545c>] start_kernel+0x4a4/0x628 Jul 11 18:33:39 t35lp54 kernel: [<000000010590402a>] startup_continue+0x2a/0x40 The condition in_task() is true and the CPACF trng provides random data during kernel startup. The network traffic however, is more difficult. A typical call stack looks like this: Jul 06 17:37:07 t35lp54 kernel: [<000000008b5600fc>] extract_entropy.constprop.0+0x23c/0x240 Jul 06 17:37:07 t35lp54 kernel: [<000000008b560136>] crng_reseed+0x36/0xd8 Jul 06 17:37:07 t35lp54 kernel: [<000000008b5604b8>] crng_make_state+0x78/0x340 Jul 06 17:37:07 t35lp54 kernel: [<000000008b5607e0>] _get_random_bytes+0x60/0xf8 Jul 06 17:37:07 t35lp54 kernel: [<000000008b56108a>] get_random_u32+0xda/0x248 Jul 06 17:37:07 t35lp54 kernel: [<000000008aefe7a8>] kfence_guarded_alloc+0x48/0x4b8 Jul 06 17:37:07 t35lp54 kernel: [<000000008aeff35e>] __kfence_alloc+0x18e/0x1b8 Jul 06 17:37:07 t35lp54 kernel: [<000000008aef7f10>] __kmalloc_node_track_caller+0x368/0x4d8 Jul 06 17:37:07 t35lp54 kernel: [<000000008b611eac>] kmalloc_reserve+0x44/0xa0 Jul 06 17:37:07 t35lp54 kernel: [<000000008b611f98>] __alloc_skb+0x90/0x178 Jul 06 17:37:07 t35lp54 kernel: [<000000008b6120dc>] __napi_alloc_skb+0x5c/0x118 Jul 06 17:37:07 t35lp54 kernel: [<000000008b8f06b4>] qeth_extract_skb+0x13c/0x680 Jul 06 17:37:07 t35lp54 kernel: [<000000008b8f6526>] qeth_poll+0x256/0x3f8 Jul 06 17:37:07 t35lp54 kernel: [<000000008b63d76e>] __napi_poll.constprop.0+0x46/0x2f8 Jul 06 17:37:07 t35lp54 kernel: [<000000008b63dbec>] net_rx_action+0x1cc/0x408 Jul 06 17:37:07 t35lp54 kernel: [<000000008b937302>] __do_softirq+0x132/0x6b0 Jul 06 17:37:07 t35lp54 kernel: [<000000008abf46ce>] __irq_exit_rcu+0x13e/0x170 Jul 06 17:37:07 t35lp54 kernel: [<000000008abf531a>] irq_exit_rcu+0x22/0x50 Jul 06 17:37:07 t35lp54 kernel: [<000000008b922506>] do_io_irq+0xe6/0x198 Jul 06 17:37:07 t35lp54 kernel: [<000000008b935826>] io_int_handler+0xd6/0x110 Jul 06 17:37:07 t35lp54 kernel: [<000000008b9358a6>] psw_idle_exit+0x0/0xa Jul 06 17:37:07 t35lp54 kernel: ([<000000008ab9c59a>] arch_cpu_idle+0x52/0xe0) Jul 06 17:37:07 t35lp54 kernel: [<000000008b933cfe>] default_idle_call+0x6e/0xd0 Jul 06 17:37:07 t35lp54 kernel: [<000000008ac59f4e>] do_idle+0xf6/0x1b0 Jul 06 17:37:07 t35lp54 kernel: [<000000008ac5a28e>] cpu_startup_entry+0x36/0x40 Jul 06 17:37:07 t35lp54 kernel: [<000000008abb0d90>] smp_start_secondary+0x148/0x158 Jul 06 17:37:07 t35lp54 kernel: [<000000008b935b9e>] restart_int_handler+0x6e/0x90 which confirms that the call is in softirq context. So in_task() covers exactly the cases where we want to have CPACF trng called: not in nmi, not in hard irq, not in soft irq but in normal task context and during kernel init. Signed-off-by: Harald Freudenberger Acked-by: Jason A. Donenfeld Reviewed-by: Juergen Christ Link: https://lore.kernel.org/r/20220713131721.257907-1-freude@linux.ibm.com Fixes: e4f74400308c ("s390/archrandom: simplify back to earlier design and initialize earlier") [agordeev@linux.ibm.com changed desc, added Fixes and Link, removed -stable] Signed-off-by: Alexander Gordeev commit b67fbebd4cf980aecbcc750e1462128bffe8ae15 Author: Peter Zijlstra Date: Fri Jul 8 09:18:06 2022 +0200 mmu_gather: Force tlb-flush VM_PFNMAP vmas Jann reported a race between munmap() and unmap_mapping_range(), where unmap_mapping_range() will no-op once unmap_vmas() has unlinked the VMA; however munmap() will not yet have invalidated the TLBs. Therefore unmap_mapping_range() will complete while there are still (stale) TLB entries for the specified range. Mitigate this by force flushing TLBs for VM_PFNMAP ranges. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Signed-off-by: Linus Torvalds commit 18ba064e42df3661e196ab58a23931fc732a420b Author: Peter Zijlstra Date: Fri Jul 8 09:18:05 2022 +0200 mmu_gather: Let there be one tlb_{start,end}_vma() implementation Now that architectures are no longer allowed to override tlb_{start,end}_vma() re-arrange code so that there is only one implementation for each of these functions. This much simplifies trying to figure out what they actually do. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Signed-off-by: Linus Torvalds commit 1d7708e75c49d08392884a08feeebaa3f9d80703 Author: Peter Zijlstra Date: Fri Jul 8 09:18:04 2022 +0200 csky/tlb: Remove tlb_flush() define The previous patch removed the tlb_flush_end() implementation which used tlb_flush_range(). This means: - csky did double invalidates, a range invalidate per vma and a full invalidate at the end - csky actually has range invalidates and as such the generic tlb_flush implementation is more efficient for it. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Tested-by: Guo Ren Signed-off-by: Linus Torvalds commit 1e9fdf21a4339b102539f476a9842e7526c01939 Author: Peter Zijlstra Date: Fri Jul 8 09:18:03 2022 +0200 mmu_gather: Remove per arch tlb_{start,end}_vma() Scattered across the archs are 3 basic forms of tlb_{start,end}_vma(). Provide two new MMU_GATHER_knobs to enumerate them and remove the per arch tlb_{start,end}_vma() implementations. - MMU_GATHER_NO_FLUSH_CACHE indicates the arch has flush_cache_range() but does *NOT* want to call it for each VMA. - MMU_GATHER_MERGE_VMAS indicates the arch wants to merge the invalidate across multiple VMAs if possible. With these it is possible to capture the three forms: 1) empty stubs; select MMU_GATHER_NO_FLUSH_CACHE and MMU_GATHER_MERGE_VMAS 2) start: flush_cache_range(), end: empty; select MMU_GATHER_MERGE_VMAS 3) start: flush_cache_range(), end: flush_tlb_range(); default Obviously, if the architecture does not have flush_cache_range() then it also doesn't need to select MMU_GATHER_NO_FLUSH_CACHE. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: David Miller Signed-off-by: Linus Torvalds commit 23a67619bc7e12e1b3776802f16084530b357a5d Author: Khalid Masum Date: Thu Jul 21 15:30:42 2022 +0600 scripts/gdb: Fix gdb 'lx-symbols' command Currently the command 'lx-symbols' in gdb exits with the error`Function "do_init_module" not defined in "kernel/module.c"`. This occurs because the file kernel/module.c was moved to kernel/module/main.c. Fix this breakage by changing the path to "kernel/module/main.c" in LoadModuleBreakpoint. Signed-off-by: Khalid Masum Acked-by: Luis Chamberlain Fixes: cfc1d277891e ("module: Move all into module/") Reviewed-by: Douglas Anderson Signed-off-by: Linus Torvalds commit 44e29e64cf1ac0cffb152e0532227ea6d002aa28 Author: Linus Torvalds Date: Thu Jul 21 10:30:14 2022 -0700 watch-queue: remove spurious double semicolon Sedat Dilek noticed that I had an extraneous semicolon at the end of a line in the previous patch. It's harmless, but unintentional, and while compilers just treat it as an extra empty statement, for all I know some other tooling might warn about it. So clean it up before other people notice too ;) Fixes: 353f7988dd84 ("watchqueue: make sure to serialize 'wqueue->defunct' properly") Reported-by: Sedat Dilek Signed-off-by: Linus Torvalds Reported-by: Sedat Dilek commit b620aa3a7be346f04ae7789b165937615c6ee8d3 Author: Biju Das Date: Thu Jul 21 15:34:49 2022 +0100 spi: spi-rspi: Fix PIO fallback on RZ platforms RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt and DMA transfer request. Setting DMARS register for DMA transfer makes the signal to work as a DMA transfer request signal and subsequent interrupt requests to the interrupt controller are masked. PIO fallback does not work as interrupt signal is disabled. This patch fixes this issue by re-enabling the interrupts by calling dmaengine_synchronize(). Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220721143449.879257-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 934447a603b22d98f45a679115d8402e1efdd0f7 Author: Dylan Yudaken Date: Thu Jul 21 06:13:25 2022 -0700 io_uring: do not recycle buffer in READV READV cannot recycle buffers as it would lose some of the data required to reimport that buffer. Reported-by: Ammar Faizi Fixes: b66e65f41426 ("io_uring: never call io_buffer_select() for a buffer re-select") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220721131325.624788-1-dylany@fb.com Signed-off-by: Jens Axboe commit ec8516f3b7c40ba7050e6b3a32467e9de451ecdf Author: Dylan Yudaken Date: Thu Jul 21 04:01:15 2022 -0700 io_uring: fix free of unallocated buffer list in the error path of io_register_pbuf_ring, only free bl if it was allocated. Reported-by: Dipanjan Das Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Dylan Yudaken Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/all/CANX2M5bXKw1NaHdHNVqssUUaBCs8aBpmzRNVEYEvV0n44P7ioA@mail.gmail.com/ Link: https://lore.kernel.org/all/CANX2M5YiZBXU3L6iwnaLs-HHJXRvrxM8mhPDiMDF9Y9sAvOHUA@mail.gmail.com/ Signed-off-by: Jens Axboe commit 430d31bb2e6031f82fe2f2fe15500dde2ac5f8a6 Merge: 7849f5cf7639c ef0324b6415db Author: Arnd Bergmann Date: Thu Jul 21 14:58:45 2022 +0200 Merge tag 'at91-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 5.19 #3 It contains one fix for LAN966 based SoCs fixing the frequency of sys_clk. sys_clk is feeding different IPs so having proper frequency for it in DT is necessary for proper working of different drivers. * tag 'at91-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: lan966x: fix sys_clk frequency Link: https://lore.kernel.org/r/20220721075705.1739915-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit ddfc710395cccc61247348df9eb18ea50321cbed Author: Juri Lelli Date: Thu Jul 14 17:19:08 2022 +0200 sched/deadline: Fix BUG_ON condition for deboosted tasks Tasks the are being deboosted from SCHED_DEADLINE might enter enqueue_task_dl() one last time and hit an erroneous BUG_ON condition: since they are not boosted anymore, the if (is_dl_boosted()) branch is not taken, but the else if (!dl_prio) is and inside this one we BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered) otherwise we had entered the if branch above. Long story short, the current condition doesn't make sense and always leads to triggering of a BUG. Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has to be present, but additional flags are not a problem. Fixes: 64be6f1f5f71 ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity") Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220714151908.533052-1-juri.lelli@redhat.com commit 1c46f3c0759116d70cb424fc227371a254c47b25 Merge: 4b2b2ee1f87db 90af0ca047f30 Author: Dave Airlie Date: Thu Jul 21 13:22:39 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-07-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-07-20: amdgpu: - Drop redundant buffer cleanup that can lead to a segfault - Add a bo_list mutex to avoid possible list corruption in CS Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220720210917.6202-1-alexander.deucher@amd.com commit 4b2b2ee1f87db6354895ed4fd76420ceeca0fda6 Merge: ff6992735ade7 443148858f26e Author: Dave Airlie Date: Thu Jul 21 13:21:58 2022 +1000 Merge tag 'drm-intel-fixes-2022-07-20-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix the regression caused by the lack of GuC v70. Let's accept the fallback to v69. Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/YtgguaR5JYK083oZ@intel.com commit 90af0ca047f3049c4b46e902f432ad6ef1e2ded6 Author: Luben Tuikov Date: Wed Jul 20 15:04:18 2022 -0400 drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2 Protect the struct amdgpu_bo_list with a mutex. This is used during command submission in order to avoid buffer object corruption as recorded in the link below. v2 (chk): Keep the mutex looked for the whole CS to avoid using the list from multiple CS threads at the same time. Suggested-by: Christian König Cc: Alex Deucher Cc: Andrey Grodzovsky Cc: Vitaly Prosyak Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2048 Signed-off-by: Luben Tuikov Signed-off-by: Christian König Tested-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 353f7988dd8413c47718f7ca79c030b6fb62cfe5 Author: Linus Torvalds Date: Tue Jul 19 11:09:01 2022 -0700 watchqueue: make sure to serialize 'wqueue->defunct' properly When the pipe is closed, we mark the associated watchqueue defunct by calling watch_queue_clear(). However, while that is protected by the watchqueue lock, new watchqueue entries aren't actually added under that lock at all: they use the pipe->rd_wait.lock instead, and looking up that pipe happens without any locking. The watchqueue code uses the RCU read-side section to make sure that the wqueue entry itself hasn't disappeared, but that does not protect the pipe_info in any way. So make sure to actually hold the wqueue lock when posting watch events, properly serializing against the pipe being torn down. Reported-by: Noam Rathaus Cc: Greg KH Cc: David Howells Signed-off-by: Linus Torvalds commit e1502ba41699736c578ba9d61ae6285d49f6921b Author: Sai Krishna Potthuri Date: Wed Jul 13 22:15:29 2022 +0530 spi: spi-cadence: Fix SPI NO Slave Select macro definition Fix SPI NO Slave Select macro definition, when all the SPI CS bits are high which means no slave is selected. Fixes: 21b511ddee09 ("spi: spi-cadence: Fix SPI CS gets toggling sporadically") Signed-off-by: Sai Krishna Potthuri Signed-off-by: Amit Kumar Mahapatra Link: https://lore.kernel.org/r/20220713164529.28444-1-amit.kumar-mahapatra@xilinx.com Signed-off-by: Mark Brown commit b0380e13502adf7dd8be4c47d622c3522aae6c63 Author: Kan Liang Date: Thu Jul 14 11:26:30 2022 -0700 perf/x86/intel/lbr: Fix unchecked MSR access error on HSW The fuzzer triggers the below trace. [ 7763.384369] unchecked MSR access error: WRMSR to 0x689 (tried to write 0x1fffffff8101349e) at rIP: 0xffffffff810704a4 (native_write_msr+0x4/0x20) [ 7763.397420] Call Trace: [ 7763.399881] [ 7763.401994] intel_pmu_lbr_restore+0x9a/0x1f0 [ 7763.406363] intel_pmu_lbr_sched_task+0x91/0x1c0 [ 7763.410992] __perf_event_task_sched_in+0x1cd/0x240 On a machine with the LBR format LBR_FORMAT_EIP_FLAGS2, when the TSX is disabled, a TSX quirk is required to access LBR from registers. The lbr_from_signext_quirk_needed() is introduced to determine whether the TSX quirk should be applied. However, the lbr_from_signext_quirk_needed() is invoked before the intel_pmu_lbr_init(), which parses the LBR format information. Without the correct LBR format information, the TSX quirk never be applied. Move the lbr_from_signext_quirk_needed() into the intel_pmu_lbr_init(). Checking x86_pmu.lbr_has_tsx in the lbr_from_signext_quirk_needed() is not required anymore. Both LBR_FORMAT_EIP_FLAGS2 and LBR_FORMAT_INFO have LBR_TSX flag, but only the LBR_FORMAT_EIP_FLAGS2 requirs the quirk. Update the comments accordingly. Fixes: 1ac7fd8159a8 ("perf/x86/intel/lbr: Support LBR format V7") Reported-by: Vince Weaver Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220714182630.342107-1-kan.liang@linux.intel.com commit efc72a665a61fd48c462f5248a9e3dc991398ddd Author: Josh Poimboeuf Date: Mon Jul 18 07:50:25 2022 -0700 lkdtm: Disable return thunks in rodata.c The following warning was seen: WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:557 apply_returns (arch/x86/kernel/alternative.c:557 (discriminator 1)) Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc4-00008-gee88d363d156 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-debian-1.16.0-4 04/01/2014 RIP: 0010:apply_returns (arch/x86/kernel/alternative.c:557 (discriminator 1)) Code: ff ff 74 cb 48 83 c5 04 49 39 ee 0f 87 81 fe ff ff e9 22 ff ff ff 0f 0b 48 83 c5 04 49 39 ee 0f 87 6d fe ff ff e9 0e ff ff ff <0f> 0b 48 83 c5 04 49 39 ee 0f 87 59 fe ff ff e9 fa fe ff ff 48 89 The warning happened when apply_returns() failed to convert "JMP __x86_return_thunk" to RET. It was instead a JMP to nowhere, due to the thunk relocation not getting resolved. That rodata.o code is objcopy'd to .rodata, and later memcpy'd, so relocations don't work (and are apparently silently ignored). LKDTM is only used for testing, so the naked RET should be fine. So just disable return thunks for that file. While at it, disable objtool and KCSAN for the file. Fixes: 0b53c374b9ef ("x86/retpoline: Use -mfunction-return") Reported-by: kernel test robot Debugged-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/lkml/Ys58BxHxoDZ7rfpr@xsang-OptiPlex-9020/ commit eb23b5ef9131e6d65011de349a4d25ef1b3d4314 Author: Pawan Gupta Date: Thu Jul 14 16:15:35 2022 -0700 x86/bugs: Warn when "ibrs" mitigation is selected on Enhanced IBRS parts IBRS mitigation for spectre_v2 forces write to MSR_IA32_SPEC_CTRL at every kernel entry/exit. On Enhanced IBRS parts setting MSR_IA32_SPEC_CTRL[IBRS] only once at boot is sufficient. MSR writes at every kernel entry/exit incur unnecessary performance loss. When Enhanced IBRS feature is present, print a warning about this unnecessary performance loss. Signed-off-by: Pawan Gupta Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thadeu Lima de Souza Cascardo Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/2a5eaf54583c2bfe0edc4fea64006656256cca17.1657814857.git.pawan.kumar.gupta@linux.intel.com commit 65cdf0d623bedf0e069bb64ed52e8bb20105e2ba Author: Kees Cook Date: Wed Jul 13 14:38:19 2022 -0700 x86/alternative: Report missing return thunk details Debugging missing return thunks is easier if we can see where they're happening. Suggested-by: Peter Zijlstra Signed-off-by: Kees Cook Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/lkml/Ys66hwtFcGbYmoiZ@hirez.programming.kicks-ass.net/ commit 543ce63b664e2c2f9533d089a4664b559c3e6b5b Author: Eric Snowberg Date: Wed Jul 20 12:40:27 2022 -0400 lockdown: Fix kexec lockdown bypass with ima policy The lockdown LSM is primarily used in conjunction with UEFI Secure Boot. This LSM may also be used on machines without UEFI. It can also be enabled when UEFI Secure Boot is disabled. One of lockdown's features is to prevent kexec from loading untrusted kernels. Lockdown can be enabled through a bootparam or after the kernel has booted through securityfs. If IMA appraisal is used with the "ima_appraise=log" boot param, lockdown can be defeated with kexec on any machine when Secure Boot is disabled or unavailable. IMA prevents setting "ima_appraise=log" from the boot param when Secure Boot is enabled, but this does not cover cases where lockdown is used without Secure Boot. To defeat lockdown, boot without Secure Boot and add ima_appraise=log to the kernel command line; then: $ echo "integrity" > /sys/kernel/security/lockdown $ echo "appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig" > \ /sys/kernel/security/ima/policy $ kexec -ls unsigned-kernel Add a call to verify ima appraisal is set to "enforce" whenever lockdown is enabled. This fixes CVE-2022-21505. Cc: stable@vger.kernel.org Fixes: 29d3c1c8dfe7 ("kexec: Allow kexec_file() with appropriate IMA policy when locked down") Signed-off-by: Eric Snowberg Acked-by: Mimi Zohar Reviewed-by: John Haxby Signed-off-by: Linus Torvalds commit 4ceaa684459d414992acbefb4e4c31f2dfc50641 Author: Marc Kleine-Budde Date: Tue Jul 19 09:22:35 2022 +0200 spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers In case a IRQ based transfer times out the bcm2835_spi_handle_err() function is called. Since commit 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag") the TX and RX DMA transfers are unconditionally canceled, leading to NULL pointer derefs if ctlr->dma_tx or ctlr->dma_rx are not set. Fix the NULL pointer deref by checking that ctlr->dma_tx and ctlr->dma_rx are valid pointers before accessing them. Fixes: 1513ceee70f2 ("spi: bcm2835: Drop dma_pending flag") Cc: Lukas Wunner Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220719072234.2782764-1-mkl@pengutronix.de Signed-off-by: Mark Brown commit f63731e18e8d8350e05b0176e39a76639f6483c7 Author: Kent Gibson Date: Tue Jul 19 19:06:01 2022 +0800 selftests: gpio: fix include path to kernel headers for out of tree builds When building selftests out of the kernel tree the gpio.h the include path is incorrect and the build falls back to the system includes which may be outdated. Add the KHDR_INCLUDES to the CFLAGS to include the gpio.h from the build tree. Fixes: 4f4d0af7b2d9 ("selftests: gpio: restore CFLAGS options") Reported-by: kernel test robot Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski commit 9b31e60800d8fa69027baf9ec7f03a0c5b145079 Author: Florian Fainelli Date: Fri Jul 15 11:55:49 2022 -0700 tools: Fixed MIPS builds due to struct flock re-definition Building perf for MIPS failed after 9f79b8b72339 ("uapi: simplify __ARCH_FLOCK{,64}_PAD a little") with the following error: CC /home/fainelli/work/buildroot/output/bmips/build/linux-custom/tools/perf/trace/beauty/fcntl.o In file included from ../../../../host/mipsel-buildroot-linux-gnu/sysroot/usr/include/asm/fcntl.h:77, from ../include/uapi/linux/fcntl.h:5, from trace/beauty/fcntl.c:10: ../include/uapi/asm-generic/fcntl.h:188:8: error: redefinition of 'struct flock' struct flock { ^~~~~ In file included from ../include/uapi/linux/fcntl.h:5, from trace/beauty/fcntl.c:10: ../../../../host/mipsel-buildroot-linux-gnu/sysroot/usr/include/asm/fcntl.h:63:8: note: originally defined here struct flock { ^~~~~ This is due to the local copy under tools/include/uapi/asm-generic/fcntl.h including the toolchain's kernel headers which already define 'struct flock' and define HAVE_ARCH_STRUCT_FLOCK to future inclusions make a decision as to whether re-defining 'struct flock' is appropriate or not. Make sure what do not re-define 'struct flock' when HAVE_ARCH_STRUCT_FLOCK is already defined. Fixes: 9f79b8b72339 ("uapi: simplify __ARCH_FLOCK{,64}_PAD a little") Signed-off-by: Florian Fainelli Reviewed-by: Christoph Hellwig [arnd: sync with include/uapi/asm-generic/fcntl.h as well] Signed-off-by: Arnd Bergmann commit 44484fa8eedf1c6e8f23ba2675b266abdd170a6e Merge: e5ec6a2513383 7b66dfcc6e1e1 Author: David S. Miller Date: Wed Jul 20 11:13:54 2022 +0100 Merge tag 'linux-can-fixes-for-5.19-20220720' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== this is a pull request of 2 patches for net/master. The first patch is by me and fixes the detection of the mcp251863 in the mcp251xfd driver. The last patch is by Liang He and adds a missing of_node_put() in the rcar_canfd driver. ==================== Signed-off-by: David S. Miller commit e5ec6a2513383fe2ecc2ee3b5f51d97acbbcd4d8 Author: Ido Schimmel Date: Tue Jul 19 15:26:26 2022 +0300 mlxsw: spectrum_router: Fix IPv4 nexthop gateway indication mlxsw needs to distinguish nexthops with a gateway from connected nexthops in order to write the former to the adjacency table of the device. The check used to rely on the fact that nexthops with a gateway have a 'link' scope whereas connected nexthops have a 'host' scope. This is no longer correct after commit 747c14307214 ("ip: fix dflt addr selection for connected nexthop"). Fix that by instead checking the address family of the gateway IP. This is a more direct way and also consistent with the IPv6 counterpart in mlxsw_sp_rt6_is_gateway(). Cc: stable@vger.kernel.org Fixes: 747c14307214 ("ip: fix dflt addr selection for connected nexthop") Fixes: 597cfe4fc339 ("nexthop: Add support for IPv4 nexthops") Signed-off-by: Ido Schimmel Reviewed-by: Amit Cohen Reviewed-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c0f47c2822aadeb8b2829f3e4c3792f184c7be33 Author: Oz Shlomo Date: Tue Jul 19 15:24:09 2022 +0300 net/sched: cls_api: Fix flow action initialization The cited commit refactored the flow action initialization sequence to use an interface method when translating tc action instances to flow offload objects. The refactored version skips the initialization of the generic flow action attributes for tc actions, such as pedit, that allocate more than one offload entry. This can cause potential issues for drivers mapping flow action ids. Populate the generic flow action fields for all the flow action entries. Fixes: c54e1d920f04 ("flow_offload: add ops to tc_action_ops for flow action setup") Signed-off-by: Oz Shlomo Reviewed-by: Roi Dayan ---- v1 -> v2: - coalese the generic flow action fields initialization to a single loop Reviewed-by: Baowen Zheng Signed-off-by: David S. Miller commit 3b15b3e93e405828c0b38df15439d9a851468d98 Merge: ef5621758a02f a11e5b3e7a59f Author: David S. Miller Date: Wed Jul 20 10:14:50 2022 +0100 Merge branch 'net-sysctl-races-round-4' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Round 4). This series fixes data-races around 17 knobs after fib_multipath_use_neigh in ipv4_net_table. tcp_fack was skipped because it's obsolete and there's no readers. So, round 5 will start with tcp_dsack, 2 rounds left for 27 knobs. ==================== Signed-off-by: David S. Miller commit a11e5b3e7a59fde1a90b0eaeaa82320495cf8cae Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:53 2022 -0700 tcp: Fix data-races around sysctl_tcp_max_reordering. While reading sysctl_tcp_max_reordering, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: dca145ffaa8d ("tcp: allow for bigger reordering level") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 2d17d9c7382327d00aeaea35af44e9b26d53206e Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:52 2022 -0700 tcp: Fix a data-race around sysctl_tcp_abort_on_overflow. While reading sysctl_tcp_abort_on_overflow, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 0b484c91911e758e53656d570de58c2ed81ec6f2 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:51 2022 -0700 tcp: Fix a data-race around sysctl_tcp_rfc1337. While reading sysctl_tcp_rfc1337, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4e08ed41cb1194009fc1a916a59ce3ed4afd77cd Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:50 2022 -0700 tcp: Fix a data-race around sysctl_tcp_stdurg. While reading sysctl_tcp_stdurg, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1a63cb91f0c2fcdeced6d6edee8d1d886583d139 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:49 2022 -0700 tcp: Fix a data-race around sysctl_tcp_retrans_collapse. While reading sysctl_tcp_retrans_collapse, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4845b5713ab18a1bb6e31d1fbb4d600240b8b691 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:48 2022 -0700 tcp: Fix data-races around sysctl_tcp_slow_start_after_idle. While reading sysctl_tcp_slow_start_after_idle, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 35089bb203f4 ("[TCP]: Add tcp_slow_start_after_idle sysctl.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 7c6f2a86ca590d5187a073d987e9599985fb1c7c Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:47 2022 -0700 tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts. While reading sysctl_tcp_thin_linear_timeouts, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 36e31b0af587 ("net: TCP thin linear timeouts") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit e7d2ef837e14a971a05f60ea08c47f3fed1a36e4 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:46 2022 -0700 tcp: Fix data-races around sysctl_tcp_recovery. While reading sysctl_tcp_recovery, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 4f41b1c58a32 ("tcp: use RACK to detect losses") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 52e65865deb6a36718a463030500f16530eaab74 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:45 2022 -0700 tcp: Fix a data-race around sysctl_tcp_early_retrans. While reading sysctl_tcp_early_retrans, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: eed530b6c676 ("tcp: early retransmit") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 3666f666e99600518ab20982af04a078bbdad277 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:44 2022 -0700 tcp: Fix data-races around sysctl knobs related to SYN option. While reading these knobs, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. - tcp_sack - tcp_window_scaling - tcp_timestamps Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 3d72bb4188c708bb16758c60822fc4dda7a95174 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:43 2022 -0700 udp: Fix a data-race around sysctl_udp_l3mdev_accept. While reading sysctl_udp_l3mdev_accept, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 63a6fff353d0 ("net: Avoid receiving packets with an l3mdev on unbound UDP sockets") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 9b55c20f83369dd54541d9ddbe3a018a8377f451 Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:42 2022 -0700 ip: Fix data-races around sysctl_ip_prot_sock. sysctl_ip_prot_sock is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. Fixes: 4548b683b781 ("Introduce a sysctl that modifies the value of PROT_SOCK.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8895a9c2ac76fb9d3922fed4fe092c8ec5e5cccc Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:41 2022 -0700 ipv4: Fix data-races around sysctl_fib_multipath_hash_fields. While reading sysctl_fib_multipath_hash_fields, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: ce5c9c20d364 ("ipv4: Add a sysctl to control multipath hash fields") Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 7998c12a08c97cc26660532c9f90a34bd7d8da5a Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:40 2022 -0700 ipv4: Fix data-races around sysctl_fib_multipath_hash_policy. While reading sysctl_fib_multipath_hash_policy, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: bf4e0a3db97e ("net: ipv4: add support for ECMP hash policy choice") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 87507bcb4f5de16bb419e9509d874f4db6c0ad0f Author: Kuniyuki Iwashima Date: Mon Jul 18 10:26:39 2022 -0700 ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh. While reading sysctl_fib_multipath_use_neigh, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: a6db4494d218 ("net: ipv4: Consider failed nexthops in multipath routes") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit ef5621758a02fe8178de9d0df414ffb79463ff86 Merge: 48ea8ea32dbf3 e79b9473e9b59 Author: David S. Miller Date: Wed Jul 20 10:11:58 2022 +0100 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2022-07-20 1) Fix a policy refcount imbalance in xfrm_bundle_lookup. From Hangyu Hua. 2) Fix some clang -Wformat warnings. Justin Stitt ==================== Signed-off-by: David S. Miller commit 7b66dfcc6e1e1f018492619c3d0fc432b6b54272 Author: Liang He Date: Tue Jul 12 17:56:23 2022 +0800 can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() We should use of_node_put() for the reference returned by of_get_child_by_name() which has increased the refcount. Fixes: 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC") Link: https://lore.kernel.org/all/20220712095623.364287-1-windhl@126.com Signed-off-by: Liang He Signed-off-by: Marc Kleine-Budde commit db87c005b9cce0b815b2268963502c178a1e27c8 Author: Marc Kleine-Budde Date: Tue Jul 5 21:30:38 2022 +0200 can: mcp251xfd: fix detection of mcp251863 In commit c6f2a617a0a8 ("can: mcp251xfd: add support for mcp251863") support for the mcp251863 was added. However it was not taken into account that the auto detection of the chip model cannot distinguish between mcp2518fd and mcp251863 and would lead to a warning message if the firmware specifies a mcp251863. Fix auto detection: If a mcp2518fd compatible chip is found, keep the mcp251863 if specified by firmware, use mcp2518fd instead. Link: https://lore.kernel.org/all/20220706064835.1848864-1-mkl@pengutronix.de Fixes: c6f2a617a0a8 ("can: mcp251xfd: add support for mcp251863") Signed-off-by: Marc Kleine-Budde commit 02c87df2480ac855d88ee308ce3fa857d9bd55a8 Author: Liang He Date: Thu Jul 14 16:13:37 2022 +0800 drm/imx/dcss: Add missing of_node_put() in fail path In dcss_dev_create() and dcss_dev_destroy(), we should call of_node_put() in fail path or before the dcss's destroy as of_graph_get_port_by_id() has increased the refcount. Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ") Signed-off-by: Liang He Reviewed-by: Laurentiu Palcu Signed-off-by: Laurentiu Palcu Link: https://patchwork.freedesktop.org/patch/msgid/20220714081337.374761-1-windhl@126.com commit 7849f5cf7639cd1125a3546a31675af4ab54278f Author: Baolin Wang Date: Wed Jul 20 15:03:58 2022 +0800 mailmap: update Baolin Wang's email I recently switched to my Alibaba email address. So add aliases for my previous email addresses. Signed-off-by: Baolin Wang Signed-off-by: Arnd Bergmann commit be640317a1d0b9cf42fedb2debc2887a7cfa38de Author: Michael Ellerman Date: Mon Jul 18 23:44:18 2022 +1000 powerpc/64s: Disable stack variable initialisation for prom_init With GCC 12 allmodconfig prom_init fails to build: Error: External symbol 'memset' referenced from prom_init.c make[2]: *** [arch/powerpc/kernel/Makefile:204: arch/powerpc/kernel/prom_init_check] Error 1 The allmodconfig build enables KASAN, so all calls to memset in prom_init should be converted to __memset by the #ifdefs in asm/string.h, because prom_init must use the non-KASAN instrumented versions. The build failure happens because there's a call to memset that hasn't been caught by the pre-processor and converted to __memset. Typically that's because it's a memset generated by the compiler itself, and that is the case here. With GCC 12, allmodconfig enables CONFIG_INIT_STACK_ALL_PATTERN, which causes the compiler to emit memset calls to initialise on-stack variables with a pattern. Because prom_init is non-user-facing boot-time only code, as a workaround just disable stack variable initialisation to unbreak the build. Reported-by: Sudip Mukherjee Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220718134418.354114-1-mpe@ellerman.id.au commit 443148858f26ee0fea6ad1b292d49d884dce92d1 Author: Daniele Ceraolo Spurio Date: Mon Jul 18 16:07:32 2022 -0700 drm/i915/guc: support v69 in parallel to v70 This patch re-introduces support for GuC v69 in parallel to v70. As this is a quick fix, v69 has been re-introduced as the single "fallback" guc version in case v70 is not available on disk and only for platforms that are out of force_probe and require the GuC by default. All v69 specific code has been labeled as such for easy identification, and the same was done for all v70 functions for which there is a separate v69 version, to avoid accidentally calling the wrong version via the unlabeled name. When the fallback mode kicks in, a drm_notice message is printed in dmesg to inform the user of the required update. The existing logging of the fetch function has also been updated so that we no longer complain immediately if we can't find a fw and we only throw an error if the fetch of both the base and fallback blobs fails. The plan is to follow this up with a more complex rework to allow for multiple different GuC versions to be supported at the same time. v2: reduce the fallback to platform that require it, switch to firmware_request_nowarn(), improve logs. Fixes: 2584b3549f4c ("drm/i915/guc: Update to GuC version 70.1.1") Link: https://lists.freedesktop.org/archives/intel-gfx/2022-July/301640.html Signed-off-by: Daniele Ceraolo Spurio Cc: John Harrison Cc: Matthew Brost Cc: Matt Roper Cc: Dave Airlie Cc: Michal Wajdeczko Acked-by: Rodrigo Vivi Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220718230732.1409641-1-daniele.ceraolospurio@intel.com (cherry picked from commit 774ce1510e6ccb9c0752d4aa7a9ff3624b3db3f3) Signed-off-by: Rodrigo Vivi commit e7999fa14f19254ee6a8b52e2711de1f6bef2a1c Author: Matthew Brost Date: Wed May 4 16:46:36 2022 -0700 drm/i915/guc: Support programming the EU priority in the GuC descriptor In GuC submission mode the EU priority must be updated by the GuC rather than the driver as the GuC owns the programming of the context descriptor. Given that the GuC code uses the GuC priorities, we can't use a generic function using i915 priorities for both execlists and GuC submission. The existing function has therefore been pushed to the execlists back-end while a new one has been added for GuC. v2: correctly use the GuC prio. Cc: John Harrison Cc: Matt Roper Signed-off-by: Matthew Brost Signed-off-by: Aravind Iddamsetty Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220504234636.2119794-1-daniele.ceraolospurio@intel.com (cherry picked from commit a5c89f7c43c12c592a882a0ec2a15e9df0011e80) Signed-off-by: Rodrigo Vivi commit 48ea8ea32dbf3231882e9bc0b297fe1400785219 Merge: c6b10de537b90 d8fa2fd791a72 Author: Jakub Kicinski Date: Tue Jul 19 17:43:02 2022 -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 2022-07-18 This series contains updates to iavf driver only. Przemyslaw fixes handling of multiple VLAN requests to account for individual errors instead of rejecting them all. He removes incorrect implementations of ETHTOOL_COALESCE_MAX_FRAMES and ETHTOOL_COALESCE_MAX_FRAMES_IRQ. He also corrects an issue with NULL pointer caused by improper handling of dummy receive descriptors. Finally, he corrects debug prints reporting an unknown state. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: Fix missing state logs iavf: Fix handling of dummy receive descriptors iavf: Disallow changing rx/tx-frames and rx/tx-frames-irq iavf: Fix VLAN_V2 addition/rejection ==================== Link: https://lore.kernel.org/r/20220718174807.4113582-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c6b10de537b904fb70522d8cc4600c2f11246c93 Author: Xin Long Date: Mon Jul 18 13:56:59 2022 -0400 Documentation: fix udp_wmem_min in ip-sysctl.rst UDP doesn't support tx memory accounting, and sysctl udp_wmem_min is not really used anywhere. So we should fix the description in ip-sysctl.rst accordingly. Fixes: 95766fff6b9a ("[UDP]: Add memory accounting.") Signed-off-by: Xin Long Link: https://lore.kernel.org/r/c880a963d9b1fb5f442ae3c9e4dfa70d45296a16.1658167019.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 53eb9b04560cc368b7874a7ef1ca7666741739e4 Author: Lorenzo Bianconi Date: Mon Jul 18 11:51:53 2022 +0200 net: ethernet: mtk_ppe: fix possible NULL pointer dereference in mtk_flow_get_wdma_info odev pointer can be NULL in mtk_flow_offload_replace routine according to the flower action rules. Fix possible NULL pointer dereference in mtk_flow_get_wdma_info. Fixes: a333215e10cb5 ("net: ethernet: mtk_eth_soc: implement flow offloading to WED devices") Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/4e1685bc4976e21e364055f6bee86261f8f9ee93.1658137753.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit cdf0b86b250fd3c1c3e120c86583ea510c52e4ce Author: Hayes Wang Date: Mon Jul 18 16:21:20 2022 +0800 r8152: fix a WOL issue This fixes that the platform is waked by an unexpected packet. The size and range of FIFO is different when the device enters S3 state, so it is necessary to correct some settings when suspending. Regardless of jumbo frame, set RMS to 1522 and MTPS to MTPS_DEFAULT. Besides, enable MCU_BORW_EN to update the method of calculating the pointer of data. Then, the hardware could get the correct data. Fixes: 195aae321c82 ("r8152: support new chips") Signed-off-by: Hayes Wang Link: https://lore.kernel.org/r/20220718082120.10957-391-nic_swsd@realtek.com Signed-off-by: Jakub Kicinski commit ef2084a8388b19c8812356106e0c8d29915f9d8b Author: Nícolas F. R. A. Prado Date: Tue Jul 19 16:38:56 2022 -0400 drm/panel-edp: Fix variable typo when saving hpd absent delay from DT The value read from the "hpd-absent-delay-ms" property in DT was being saved to the wrong variable, overriding the hpd_reliable delay. Fix the typo. Fixes: 5540cf8f3e8d ("drm/panel-edp: Implement generic "edp-panel"s probed by EDID") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: André Almeida Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220719203857.1488831-4-nfraprado@collabora.com commit 908fc4c2abdb1835f303cf6827e66676568943e7 Author: Tom Lendacky Date: Tue Jul 19 12:12:52 2022 -0500 virt: sev-guest: Pass the appropriate argument type to iounmap() Fix a sparse warning in sev_guest_probe() where the wrong argument type is provided to iounmap(). Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Reported-by: kernel test robot Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/202207150617.jqwQ0Rpz-lkp@intel.com commit 82e094f7bd988c02df27f8c8d81af8f750660b2a Merge: 957a2b345cbcf 5f7ef4875f995 Author: Jens Axboe Date: Tue Jul 19 12:42:33 2022 -0600 Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.19 Pull MD fix from Song. * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid5: missing error code in setup_conf() commit 4f2bfd9494a072d58203600de6bedd72680e612a Author: Neeraj Upadhyay Date: Fri Jul 1 08:45:45 2022 +0530 srcu: Make expedited RCU grace periods block even less frequently The purpose of commit 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers from consuming CPU") was to prevent a long series of never-blocking expedited SRCU grace periods from blocking kernel-live-patching (KLP) progress. Although it was successful, it also resulted in excessive boot times on certain embedded workloads running under qemu with the "-bios QEMU_EFI.fd" command line. Here "excessive" means increasing the boot time up into the three-to-four minute range. This increase in boot time was due to the more than 6000 back-to-back invocations of synchronize_rcu_expedited() within the KVM host OS, which in turn resulted from qemu's emulation of a long series of MMIO accesses. Commit 640a7d37c3f4 ("srcu: Block less aggressively for expedited grace periods") did not significantly help this particular use case. Zhangfei Gao and Shameerali Kolothum Thodi did experiments varying the value of SRCU_MAX_NODELAY_PHASE with HZ=250 and with various values of non-sleeping per phase counts on a system with preemption enabled, and observed the following boot times: +──────────────────────────+────────────────+ | SRCU_MAX_NODELAY_PHASE | Boot time (s) | +──────────────────────────+────────────────+ | 100 | 30.053 | | 150 | 25.151 | | 200 | 20.704 | | 250 | 15.748 | | 500 | 11.401 | | 1000 | 11.443 | | 10000 | 11.258 | | 1000000 | 11.154 | +──────────────────────────+────────────────+ Analysis on the experiment results show additional improvements with CPU-bound delays approaching one jiffy in duration. This improvement was also seen when number of per-phase iterations were scaled to one jiffy. This commit therefore scales per-grace-period phase number of non-sleeping polls so that non-sleeping polls extend for about one jiffy. In addition, the delay-calculation call to srcu_get_delay() in srcu_gp_end() is replaced with a simple check for an expedited grace period. This change schedules callback invocation immediately after expedited grace periods complete, which results in greatly improved boot times. Testing done by Marc and Zhangfei confirms that this change recovers most of the performance degradation in boottime; for CONFIG_HZ_250 configuration, specifically, boot times improve from 3m50s to 41s on Marc's setup; and from 2m40s to ~9.7s on Zhangfei's setup. In addition to the changes to default per phase delays, this change adds 3 new kernel parameters - srcutree.srcu_max_nodelay, srcutree.srcu_max_nodelay_phase, and srcutree.srcu_retry_check_delay. This allows users to configure the srcu grace period scanning delays in order to more quickly react to additional use cases. Fixes: 640a7d37c3f4 ("srcu: Block less aggressively for expedited grace periods") Fixes: 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers from consuming CPU") Reported-by: Zhangfei Gao Reported-by: yueluck Signed-off-by: Neeraj Upadhyay Tested-by: Marc Zyngier Tested-by: Zhangfei Gao Link: https://lore.kernel.org/all/20615615-0013-5adc-584f-2b1d5c03ebfc@linaro.org/ Signed-off-by: Paul E. McKenney commit 8f870e6eb8c0c3f9869bf3fcf9db39f86cfcea49 Author: Paul E. McKenney Date: Sun Jun 12 15:00:06 2022 -0700 srcu: Block less aggressively for expedited grace periods Commit 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers from consuming CPU") fixed a problem where a long-running expedited SRCU grace period could block kernel live patching. It did so by giving up on expediting once a given SRCU expedited grace period grew too old. Unfortunately, this added excessive delays to boots of virtual embedded systems specifying "-bios QEMU_EFI.fd" to qemu. This commit therefore makes the transition away from expediting less aggressive, increasing the per-grace-period phase number of non-sleeping polls of readers from one to three and increasing the required grace-period age from one jiffy (actually from zero to one jiffies) to two jiffies (actually from one to two jiffies). Fixes: 282d8998e997 ("srcu: Prevent expedited GPs and blocking readers from consuming CPU") Signed-off-by: Paul E. McKenney Reported-by: Zhangfei Gao Reported-by: chenxiang (M)" Cc: Shameerali Kolothum Thodi Cc: Paolo Bonzini Reviewed-by: Neeraj Upadhyay Link: https://lore.kernel.org/all/20615615-0013-5adc-584f-2b1d5c03ebfc@linaro.org/ commit cf5029d5dd7cb0aaa53250fa9e389abd231606b3 Author: Aaron Lewis Date: Thu Jul 14 16:13:15 2022 +0000 KVM: x86: Protect the unused bits in MSR exiting flags The flags for KVM_CAP_X86_USER_SPACE_MSR and KVM_X86_SET_MSR_FILTER have no protection for their unused bits. Without protection, future development for these features will be difficult. Add the protection needed to make it possible to extend these features in the future. Signed-off-by: Aaron Lewis Message-Id: <20220714161314.1715227-1-aaronlewis@google.com> Signed-off-by: Paolo Bonzini commit 5f7ef4875f99538b741527963ffe09e869b49826 Author: Dan Carpenter Date: Tue Jul 19 12:48:01 2022 +0300 md/raid5: missing error code in setup_conf() Return -ENOMEM if the allocation fails. Don't return success. Fixes: 8fbcba6b999b ("md/raid5: Cleanup setup_conf() error returns") Signed-off-by: Dan Carpenter Reviewed-by: Logan Gunthorpe Signed-off-by: Song Liu commit dc951e22a1a2a6a11b29648c3c8b191bc8f3e5df Author: Paolo Bonzini Date: Tue Jul 19 09:16:53 2022 -0400 tools headers UAPI: Sync linux/kvm.h with the kernel sources Silence this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Reported-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Paolo Bonzini commit e923b0537d28e15c9d31ce8b38f810b325816903 Author: Gavin Shan Date: Tue Jul 19 10:08:30 2022 +0800 KVM: selftests: Fix target thread to be migrated in rseq_test In rseq_test, there are two threads, which are vCPU thread and migration worker separately. Unfortunately, the test has the wrong PID passed to sched_setaffinity() in the migration worker. It forces migration on the migration worker because zeroed PID represents the calling thread, which is the migration worker itself. It means the vCPU thread is never enforced to migration and it can migrate at any time, which eventually leads to failure as the following logs show. host# uname -r 5.19.0-rc6-gavin+ host# # cat /proc/cpuinfo | grep processor | tail -n 1 processor : 223 host# pwd /home/gavin/sandbox/linux.main/tools/testing/selftests/kvm host# for i in `seq 1 100`; do \ echo "--------> $i"; ./rseq_test; done --------> 1 --------> 2 --------> 3 --------> 4 --------> 5 --------> 6 ==== Test Assertion Failure ==== rseq_test.c:265: rseq_cpu == cpu pid=3925 tid=3925 errno=4 - Interrupted system call 1 0x0000000000401963: main at rseq_test.c:265 (discriminator 2) 2 0x0000ffffb044affb: ?? ??:0 3 0x0000ffffb044b0c7: ?? ??:0 4 0x0000000000401a6f: _start at ??:? rseq CPU = 4, sched CPU = 27 Fix the issue by passing correct parameter, TID of the vCPU thread, to sched_setaffinity() in the migration worker. Fixes: 61e52f1630f5 ("KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs") Suggested-by: Sean Christopherson Signed-off-by: Gavin Shan Reviewed-by: Oliver Upton Message-Id: <20220719020830.3479482-1-gshan@redhat.com> Reviewed-by: Andrew Jones Signed-off-by: Paolo Bonzini commit 450a563924ae9437758bd468c5b7cee9468ce749 Author: Oliver Upton Date: Tue Jul 19 12:52:29 2022 +0000 KVM: stats: Fix value for KVM_STATS_UNIT_MAX for boolean stats commit 1b870fa5573e ("kvm: stats: tell userspace which values are boolean") added a new stat unit (boolean) but failed to raise KVM_STATS_UNIT_MAX. Fix by pointing UNIT_MAX at the new max value of UNIT_BOOLEAN. Fixes: 1b870fa5573e ("kvm: stats: tell userspace which values are boolean") Reported-by: Janis Schoetterl-Glausch Signed-off-by: Oliver Upton Message-Id: <20220719125229.2934273-1-oupton@google.com> Signed-off-by: Paolo Bonzini commit b3fcfc4f0c50a716487fd7ebd0e6b64a2db29d76 Merge: 1774559f07993 989918482bbcc Author: Paolo Abeni Date: Tue Jul 19 12:37:04 2022 +0200 Merge branch 'amt-fix-validation-and-synchronization-bugs' Taehee Yoo says: ==================== amt: fix validation and synchronization bugs There are some synchronization issues in the amt module. Especially, an amt gateway doesn't well synchronize its own variables and status(amt->status). It tries to use a workqueue for handles in a single thread. A global lock is also good, but it would occur complex locking complex. In this patchset, only the gateway uses workqueue. The reason why only gateway interface uses workqueue is that gateway should manage its own states and variables a little bit statefully. But relay doesn't need to manage tunnels statefully, stateless is okay. So, relay side message handlers are okay to be called concurrently. But it doesn't mean that no lock is needed. Only amt multicast data message type will not be processed by the work queue because It contains actual multicast data. So, it should be processed immediately. When any amt gateway events are triggered(sending discovery message by delayed_work, sending request message by delayed_work and receiving messages), it stores event and skb into the event queue(amt->events[16]). Then, workqueue processes these events one by one. The first patch is to use the work queue. The second patch is to remove unnecessary lock due to a previous patch. The third patch is to use READ_ONCE() in the amt module. Even if the amt module uses a single thread, some variables (ready4, ready6, amt->status) can be accessed concurrently. The fourth patch is to add missing nonce generation logic when it sends a new request message. The fifth patch is to drop unexpected advertisement messages. advertisement message should be received only after the gateway sends a discovery message first. So, the gateway should drop advertisement messages if it has never sent a discovery message and it also should drop duplicate advertisement messages. Using nonce is good to distinguish whether a received message is an expected message or not. The sixth patch is to drop unexpected query messages. This is the same behavior as the fourth patch. Query messages should be received only after the gateway sends a request message first. The nonce variable is used to distinguish whether it is a reply to a previous request message or not. amt->ready4 and amt->ready6 are used to distinguish duplicate messages. The seventh patch is to drop unexpected multicast data. AMT gateway should not receive multicast data message type before establish between gateway and relay. In order to drop unexpected multicast data messages, it checks amt->status. The last patch is to fix a locking problem on the relay side. amt->nr_tunnels variable is protected by amt->lock. But amt_request_handler() doesn't protect this variable. v2: - Use local_bh_disable() instead of rcu_read_lock_bh() in amt_membership_query_handler. - Fix using uninitialized variables. - Fix unexpectedly start the event_wq after stopping. - Fix possible deadlock in amt_event_work(). - Add a limit variable in amt_event_work() to prevent infinite working. - Rename amt_queue_events() to amt_queue_event(). ==================== Link: https://lore.kernel.org/r/20220717160910.19156-1-ap420073@gmail.com Signed-off-by: Paolo Abeni commit 989918482bbccbbce3ba2bb9156eb4c193319983 Author: Taehee Yoo Date: Sun Jul 17 16:09:10 2022 +0000 amt: do not use amt->nr_tunnels outside of lock amt->nr_tunnels is protected by amt->lock. But, amt_request_handler() has been using this variable without the amt->lock. So, it expands context of amt->lock in the amt_request_handler() to protect amt->nr_tunnels variable. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit e882827d5b8942a27b4d28548aa27562a3a7e94c Author: Taehee Yoo Date: Sun Jul 17 16:09:09 2022 +0000 amt: drop unexpected multicast data AMT gateway interface should not receive unexpected multicast data. Multicast data message type should be received after sending an update message, which means all establishment between gateway and relay is finished. So, amt_multicast_data_handler() checks amt->status. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 239d886601e38d948a28f3b2a1c9ce5f01bf75f2 Author: Taehee Yoo Date: Sun Jul 17 16:09:08 2022 +0000 amt: drop unexpected query message AMT gateway interface should not receive unexpected query messages. In order to drop unexpected query messages, it checks nonce. And it also checks ready4 and ready6 variables to drop duplicated messages. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 40185f359fbabaa61da754cc29d12f3a41e0a987 Author: Taehee Yoo Date: Sun Jul 17 16:09:07 2022 +0000 amt: drop unexpected advertisement message AMT gateway interface should not receive unexpected advertisement messages. In order to drop these packets, it should check nonce and amt->status. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 627f16931bf3cb20d50274d9341380ac2c3035fd Author: Taehee Yoo Date: Sun Jul 17 16:09:06 2022 +0000 amt: add missing regeneration nonce logic in request logic When AMT gateway starts sending a new request message, it should regenerate the nonce variable. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 928f353cb8672f0d6078aad75eeec0ed33875b12 Author: Taehee Yoo Date: Sun Jul 17 16:09:05 2022 +0000 amt: use READ_ONCE() in amt module There are some data races in the amt module. amt->ready4, amt->ready6, and amt->status can be accessed concurrently without locks. So, it uses READ_ONCE() and WRITE_ONCE(). Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 9c343ea6185febe5f6b74f7f7b3757f3dd9c5af6 Author: Taehee Yoo Date: Sun Jul 17 16:09:04 2022 +0000 amt: remove unnecessary locks By the previous patch, amt gateway handlers are changed to worked by a single thread. So, most locks for gateway are not needed. So, it removes. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 30e22a6ebca039572ce9bc10f1934f4eabfb5b7f Author: Taehee Yoo Date: Sun Jul 17 16:09:03 2022 +0000 amt: use workqueue for gateway side message handling There are some synchronization issues(amt->status, amt->req_cnt, etc) if the interface is in gateway mode because gateway message handlers are processed concurrently. This applies a work queue for processing these messages instead of expanding the locking context. So, the purposes of this patch are to fix exist race conditions and to make gateway to be able to validate a gateway status more correctly. When the AMT gateway interface is created, it tries to establish to relay. The establishment step looks stateless, but it should be managed well. In order to handle messages in the gateway, it saves the current status(i.e. AMT_STATUS_XXX). This patch makes gateway code to be worked with a single thread. Now, all messages except the multicast are triggered(received or delay expired), and these messages will be stored in the event queue(amt->events). Then, the single worker processes stored messages asynchronously one by one. The multicast data message type will be still processed immediately. Now, amt->lock is only needed to access the event queue(amt->events) if an interface is the gateway mode. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Paolo Abeni commit 1774559f07993e1cac33c2406e99049d4bdea6c8 Author: Oleksij Rempel Date: Sun Jul 17 15:58:31 2022 +0200 net: dsa: vitesse-vsc73xx: silent spi_device_id warnings Add spi_device_id entries to silent SPI warnings. Fixes: 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible") Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220717135831.2492844-2-o.rempel@pengutronix.de Signed-off-by: Paolo Abeni commit 855fe49984a8a3899f07ae1d149d46cd8d4acb52 Author: Oleksij Rempel Date: Sun Jul 17 15:58:30 2022 +0200 net: dsa: sja1105: silent spi_device_id warnings Add spi_device_id entries to silent following warnings: SPI driver sja1105 has no spi_device_id for nxp,sja1105e SPI driver sja1105 has no spi_device_id for nxp,sja1105t SPI driver sja1105 has no spi_device_id for nxp,sja1105p SPI driver sja1105 has no spi_device_id for nxp,sja1105q SPI driver sja1105 has no spi_device_id for nxp,sja1105r SPI driver sja1105 has no spi_device_id for nxp,sja1105s SPI driver sja1105 has no spi_device_id for nxp,sja1110a SPI driver sja1105 has no spi_device_id for nxp,sja1110b SPI driver sja1105 has no spi_device_id for nxp,sja1110c SPI driver sja1105 has no spi_device_id for nxp,sja1110d Fixes: 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible") Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220717135831.2492844-1-o.rempel@pengutronix.de Signed-off-by: Paolo Abeni commit d7241f679a59cfe27f92cb5c6272cb429fb1f7ec Author: Hristo Venev Date: Sat Jul 16 11:51:34 2022 +0300 be2net: Fix buffer overflow in be_get_module_eeprom be_cmd_read_port_transceiver_data assumes that it is given a buffer that is at least PAGE_DATA_LEN long, or twice that if the module supports SFF 8472. However, this is not always the case. Fix this by passing the desired offset and length to be_cmd_read_port_transceiver_data so that we only copy the bytes once. Fixes: e36edd9d26cf ("be2net: add ethtool "-m" option support") Signed-off-by: Hristo Venev Link: https://lore.kernel.org/r/20220716085134.6095-1-hristo@venev.name Signed-off-by: Paolo Abeni commit b8c768ccdd8338504fb78370747728d5002b1b5a Author: Haibo Chen Date: Mon Jul 18 16:31:43 2022 +0800 gpio: pca953x: use the correct register address when regcache sync during init For regcache_sync_region, we need to use pca953x_recalc_addr() to get the real register address. Fixes: ec82d1eba346 ("gpio: pca953x: Zap ad-hoc reg_output cache") Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache") Signed-off-by: Haibo Chen Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 2abc17a93867dc816f0ed9d32021dda8078e7330 Author: Haibo Chen Date: Mon Jul 18 16:31:42 2022 +0800 gpio: pca953x: use the correct range when do regmap sync regmap will sync a range of registers, here use the correct range to make sure the sync do not touch other unexpected registers. Find on pca9557pw on imx8qxp/dxl evk board, this device support 8 pin, so only need one register(8 bits) to cover all the 8 pins's property setting. But when sync the output, we find it actually update two registers, output register and the following register. Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle") Fixes: ec82d1eba346 ("gpio: pca953x: Zap ad-hoc reg_output cache") Fixes: 0f25fda840a9 ("gpio: pca953x: Zap ad-hoc reg_direction cache") Signed-off-by: Haibo Chen Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit db8edaa09d7461ec08672a92a2eef63d5882bb79 Author: Haibo Chen Date: Mon Jul 18 16:31:41 2022 +0800 gpio: pca953x: only use single read/write for No AI mode For the device use NO AI mode(not support auto address increment), only use the single read/write when config the regmap. We meet issue on PCA9557PW on i.MX8QXP/DXL evk board, this device do not support AI mode, but when do the regmap sync, regmap will sync 3 byte data to register 1, logically this means write first data to register 1, write second data to register 2, write third data to register 3. But this device do not support AI mode, finally, these three data write only into register 1 one by one. the reault is the value of register 1 alway equal to the latest data, here is the third data, no operation happened on register 2 and register 3. This is not what we expect. Fixes: 49427232764d ("gpio: pca953x: Perform basic regmap conversion") Signed-off-by: Haibo Chen Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 25c2a075eb6a3031813b6051bd10dfc22c36a2a4 Author: Herve Codina Date: Mon Jul 4 12:28:43 2022 +0200 clk: lan966x: Fix the lan966x clock gate register address The register address used for the clock gate register is the base register address coming from first reg map (ie. the generic clock registers) instead of the second reg map defining the clock gate register. Use the correct clock gate register address. Fixes: 5ad5915dea00 ("clk: lan966x: Extend lan966x clock driver for clock gating support") Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220704102845.168438-2-herve.codina@bootlin.com Reviewed-by: Claudiu Beznea Tested-by: Michael Walle Signed-off-by: Stephen Boyd commit da791bac104a3169b05b54270afe75daacba4641 Author: Wong Vee Khee Date: Fri Jul 15 20:24:02 2022 +0800 net: stmmac: remove redunctant disable xPCS EEE call Disable is done in stmmac_init_eee() on the event of MAC link down. Since setting enable/disable EEE via ethtool will eventually trigger a MAC down, removing this redunctant call in stmmac_ethtool.c to avoid calling xpcs_config_eee() twice. Fixes: d4aeaed80b0e ("net: stmmac: trigger PCS EEE to turn off on link down") Signed-off-by: Wong Vee Khee Link: https://lore.kernel.org/r/20220715122402.1017470-1-vee.khee.wong@linux.intel.com Signed-off-by: Jakub Kicinski commit 49a2f5c88e8f8a66d81e93ed034f00dee9fe9cf7 Merge: 1e53834ce541d 1699b4d502eda Author: Jakub Kicinski Date: Mon Jul 18 20:14:27 2022 -0700 Merge branch 'fix-2-dsa-issues-with-vlan_filtering_is_global' Vladimir Oltean says: ==================== Fix 2 DSA issues with vlan_filtering_is_global This patch set fixes 2 issues with vlan_filtering_is_global switches. Both are regressions introduced by refactoring commit d0004a020bb5 ("net: dsa: remove the "dsa_to_port in a loop" antipattern from the core"), which wasn't tested on a wide enough variety of switches. Tested on the sja1105 driver. ==================== Link: https://lore.kernel.org/r/20220715151659.780544-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 1699b4d502eda3c7ea4070debad3ee570b5091b1 Author: Vladimir Oltean Date: Fri Jul 15 18:16:59 2022 +0300 net: dsa: fix NULL pointer dereference in dsa_port_reset_vlan_filtering The "ds" iterator variable used in dsa_port_reset_vlan_filtering() -> dsa_switch_for_each_port() overwrites the "dp" received as argument, which is later used to call dsa_port_vlan_filtering() proper. As a result, switches which do enter that code path (the ones with vlan_filtering_is_global=true) will dereference an invalid dp in dsa_port_reset_vlan_filtering() after leaving a VLAN-aware bridge. Use a dedicated "other_dp" iterator variable to avoid this from happening. Fixes: d0004a020bb5 ("net: dsa: remove the "dsa_to_port in a loop" antipattern from the core") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 4db2a5ef4ccbe6d138828284cfab241b434b5d95 Author: Vladimir Oltean Date: Fri Jul 15 18:16:58 2022 +0300 net: dsa: fix dsa_port_vlan_filtering when global The blamed refactoring commit changed a "port" iterator with "other_dp", but still looked at the slave_dev of the dp outside the loop, instead of other_dp->slave from the loop. As a result, dsa_port_vlan_filtering() would not call dsa_slave_manage_vlan_filtering() except for the port in cause, and not for all switch ports as expected. Fixes: d0004a020bb5 ("net: dsa: remove the "dsa_to_port in a loop" antipattern from the core") Reported-by: Lucian Banu Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 1e53834ce541d4fe271cdcca7703e50be0a44f8a Author: Piotr Skajewski Date: Fri Jul 15 14:44:56 2022 -0700 ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero It is possible to disable VFs while the PF driver is processing requests from the VF driver. This can result in a panic. BUG: unable to handle kernel paging request at 000000000000106c PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI CPU: 8 PID: 0 Comm: swapper/8 Kdump: loaded Tainted: G I --------- - Hardware name: Dell Inc. PowerEdge R740/06WXJT, BIOS 2.8.2 08/27/2020 RIP: 0010:ixgbe_msg_task+0x4c8/0x1690 [ixgbe] Code: 00 00 48 8d 04 40 48 c1 e0 05 89 7c 24 24 89 fd 48 89 44 24 10 83 ff 01 0f 84 b8 04 00 00 4c 8b 64 24 10 4d 03 a5 48 22 00 00 <41> 80 7c 24 4c 00 0f 84 8a 03 00 00 0f b7 c7 83 f8 08 0f 84 8f 0a RSP: 0018:ffffb337869f8df8 EFLAGS: 00010002 RAX: 0000000000001020 RBX: 0000000000000000 RCX: 000000000000002b RDX: 0000000000000002 RSI: 0000000000000008 RDI: 0000000000000006 RBP: 0000000000000006 R08: 0000000000000002 R09: 0000000000029780 R10: 00006957d8f42832 R11: 0000000000000000 R12: 0000000000001020 R13: ffff8a00e8978ac0 R14: 000000000000002b R15: ffff8a00e8979c80 FS: 0000000000000000(0000) GS:ffff8a07dfd00000(0000) knlGS:00000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000106c CR3: 0000000063e10004 CR4: 00000000007726e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ? ttwu_do_wakeup+0x19/0x140 ? try_to_wake_up+0x1cd/0x550 ? ixgbevf_update_xcast_mode+0x71/0xc0 [ixgbevf] ixgbe_msix_other+0x17e/0x310 [ixgbe] __handle_irq_event_percpu+0x40/0x180 handle_irq_event_percpu+0x30/0x80 handle_irq_event+0x36/0x53 handle_edge_irq+0x82/0x190 handle_irq+0x1c/0x30 do_IRQ+0x49/0xd0 common_interrupt+0xf/0xf This can be eventually be reproduced with the following script: while : do echo 63 > /sys/class/net//device/sriov_numvfs sleep 1 echo 0 > /sys/class/net//device/sriov_numvfs sleep 1 done Add lock when disabling SR-IOV to prevent process VF mailbox communication. Fixes: d773d1310625 ("ixgbe: Fix memory leak when SR-IOV VFs are direct assigned") Signed-off-by: Piotr Skajewski Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220715214456.2968711-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit f838a63369818faadec4ad1736cfbd20ab5da00e Author: Dawid Lukwinski Date: Fri Jul 15 14:45:41 2022 -0700 i40e: Fix erroneous adapter reinitialization during recovery process Fix an issue when driver incorrectly detects state of recovery process and erroneously reinitializes interrupts, which results in a kernel error and call trace message. The issue was caused by a combination of two factors: 1. Assuming the EMP reset issued after completing firmware recovery means the whole recovery process is complete. 2. Erroneous reinitialization of interrupt vector after detecting the above mentioned EMP reset. Fixes (1) by changing how recovery state change is detected and (2) by adjusting the conditional expression to ensure using proper interrupt reinitialization method, depending on the situation. Fixes: 4ff0ee1af016 ("i40e: Introduce recovery mode support") Signed-off-by: Dawid Lukwinski Signed-off-by: Jan Sokolowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220715214542.2968762-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 3696c952da0733b843c8da3441345055b1cbacd9 Author: Tom Rix Date: Sat Jul 16 17:46:54 2022 -0400 net: ethernet: mtk_eth_soc: fix off by one check of ARRAY_SIZE In mtk_wed_tx_ring_setup(.., int idx, ..), idx is used as an index here struct mtk_wed_ring *ring = &dev->tx_ring[idx]; The bounds of idx are checked here BUG_ON(idx > ARRAY_SIZE(dev->tx_ring)); If idx is the size of the array, it will pass this check and overflow. So change the check to >= . Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220716214654.1540240-1-trix@redhat.com Signed-off-by: Jakub Kicinski commit b6224a36de8bb30bfec9ff2bc45ed8002e79a79a Merge: c32349f3257f3 675c807ae26b2 Author: Jakub Kicinski Date: Mon Jul 18 20:00:05 2022 -0700 Merge branch 'net-lan966x-fix-issues-with-mac-table' Horatiu Vultur says: ==================== net: lan966x: Fix issues with MAC table The patch series fixes 2 issues: - when an entry was forgotten the irq thread was holding a spin lock and then was talking also rtnl_lock. - the access to the HW MAC table is indirect, so the access to the HW MAC table was not synchronized, which means that there could be race conditions. ==================== Link: https://lore.kernel.org/r/20220714194040.231651-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 675c807ae26b267233b97cd5006979a6bb8d54d4 Author: Horatiu Vultur Date: Thu Jul 14 21:40:40 2022 +0200 net: lan966x: Fix usage of lan966x->mac_lock when used by FDB When the SW bridge was trying to add/remove entries to/from HW, the access to HW was not protected by any lock. In this way, it was possible to have race conditions. Fix this by using the lan966x->mac_lock to protect parallel access to HW for this cases. Fixes: 25ee9561ec622 ("net: lan966x: More MAC table functionality") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit c1924684369762b112428a333ad00eac6ca89d96 Author: Horatiu Vultur Date: Thu Jul 14 21:40:39 2022 +0200 net: lan966x: Fix usage of lan966x->mac_lock inside lan966x_mac_irq_handler The problem with this spin lock is that it was just protecting the list of the MAC entries in SW and not also the access to the MAC entries in HW. Because the access to HW is indirect, then it could happen to have race conditions. For example when SW introduced an entry in MAC table and the irq mac is trying to read something from the MAC. Update such that also the access to MAC entries in HW is protected by this lock. Fixes: 5ccd66e01cbef ("net: lan966x: add support for interrupts from analyzer") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 99343cfa4f7560abf933fff7ab3ea58a6905c917 Author: Horatiu Vultur Date: Thu Jul 14 21:40:38 2022 +0200 net: lan966x: Fix usage of lan966x->mac_lock when entry is removed To remove an entry to the MAC table, it is required first to setup the entry and then issue a command for the MAC to forget the entry. So if it happens for two threads to remove simultaneously an entry in MAC table then it would be a race condition. Fix this by using lan966x->mac_lock to protect the HW access. Fixes: e18aba8941b40 ("net: lan966x: add mactable support") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 43243bb3195b0dc27741679471e23baed1efe98e Author: Horatiu Vultur Date: Thu Jul 14 21:40:37 2022 +0200 net: lan966x: Fix usage of lan966x->mac_lock when entry is added To add an entry to the MAC table, it is required first to setup the entry and then issue a command for the MAC to learn the entry. So if it happens for two threads to add simultaneously an entry in MAC table then it would be a race condition. Fix this by using lan966x->mac_lock to protect the HW access. Fixes: fc0c3fe7486f2 ("net: lan966x: Add function lan966x_mac_ip_learn()") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 45533a534a45cb12c20c81615d17306176cb1c57 Author: Horatiu Vultur Date: Thu Jul 14 21:40:36 2022 +0200 net: lan966x: Fix taking rtnl_lock while holding spin_lock When the HW deletes an entry in MAC table then it generates an interrupt. The SW will go through it's own list of MAC entries and if it is not found then it would notify the listeners about this. The problem is that when the SW will go through it's own list it would take a spin lock(lan966x->mac_lock) and when it notifies that the entry is deleted. But to notify the listeners it taking the rtnl_lock which is illegal. This is fixed by instead of notifying right away that the entry is deleted, move the entry on a temp list and once, it checks all the entries then just notify that the entries from temp list are deleted. Fixes: 5ccd66e01cbe ("net: lan966x: add support for interrupts from analyzer") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit ca85855bdcae8f84f1512e88b4c75009ea17ea2f Merge: 80e19f34c2887 cc0315564d6ee Author: Linus Torvalds Date: Mon Jul 18 17:16:22 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Two bug fixes for irdma: - x722 does not support 1GB pages, trying to configure them will corrupt the dma mapping - Fix a sleep while holding a spinlock" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/irdma: Fix sleep from invalid context BUG RDMA/irdma: Do not advertise 1GB page size for x722 commit 4546760619cfa9b718fe2059ceb07101cf9ff61e Author: Vladimir Oltean Date: Sun Jul 17 02:37:45 2022 +0300 pinctrl: armada-37xx: use raw spinlocks for regmap to avoid invalid wait context The irqchip->irq_set_type method is called by __irq_set_trigger() under the desc->lock raw spinlock. The armada-37xx implementation, armada_37xx_irq_set_type(), uses an MMIO regmap created by of_syscon_register(), which uses plain spinlocks (the kind that are sleepable on RT). Therefore, this is an invalid locking scheme for which we get a kernel splat stating just that ("[ BUG: Invalid wait context ]"), because the context in which the plain spinlock may sleep is atomic due to the raw spinlock. We need to go raw spinlocks all the way. Make this driver create its own MMIO regmap, with use_raw_spinlock=true, and stop relying on syscon to provide it. This patch depends on commit 67021f25d952 ("regmap: teach regmap to use raw spinlocks if requested in the config"). Cc: # 5.15+ Fixes: 2f227605394b ("pinctrl: armada-37xx: Add irqchip support") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220716233745.1704677-3-vladimir.oltean@nxp.com Signed-off-by: Linus Walleij commit 984245b66cf32c494b1e4f95f5ed6ba16b8771eb Author: Vladimir Oltean Date: Sun Jul 17 02:37:44 2022 +0300 pinctrl: armada-37xx: make irq_lock a raw spinlock to avoid invalid wait context The irqchip->irq_set_type method is called by __irq_set_trigger() under the desc->lock raw spinlock. The armada-37xx implementation, armada_37xx_irq_set_type(), takes a plain spinlock, the kind that becomes sleepable on RT. Therefore, this is an invalid locking scheme for which we get a kernel splat stating just that ("[ BUG: Invalid wait context ]"), because the context in which the plain spinlock may sleep is atomic due to the raw spinlock. We need to go raw spinlocks all the way. Replace the driver's irq_lock with a raw spinlock, to disable preemption even on RT. Cc: # 5.15+ Fixes: 2f227605394b ("pinctrl: armada-37xx: Add irqchip support") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220716233745.1704677-2-vladimir.oltean@nxp.com Signed-off-by: Linus Walleij commit c80af0c250c8f8a3c978aa5aafbe9c39b336b813 Author: Junxiao Bi Date: Fri Jun 3 15:28:01 2022 -0700 Revert "ocfs2: mount shared volume without ha stack" This reverts commit 912f655d78c5d4ad05eac287f23a435924df7144. This commit introduced a regression that can cause mount hung. The changes in __ocfs2_find_empty_slot causes that any node with none-zero node number can grab the slot that was already taken by node 0, so node 1 will access the same journal with node 0, when it try to grab journal cluster lock, it will hung because it was already acquired by node 0. It's very easy to reproduce this, in one cluster, mount node 0 first, then node 1, you will see the following call trace from node 1. [13148.735424] INFO: task mount.ocfs2:53045 blocked for more than 122 seconds. [13148.739691] Not tainted 5.15.0-2148.0.4.el8uek.mountracev2.x86_64 #2 [13148.742560] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [13148.745846] task:mount.ocfs2 state:D stack: 0 pid:53045 ppid: 53044 flags:0x00004000 [13148.749354] Call Trace: [13148.750718] [13148.752019] ? usleep_range+0x90/0x89 [13148.753882] __schedule+0x210/0x567 [13148.755684] schedule+0x44/0xa8 [13148.757270] schedule_timeout+0x106/0x13c [13148.759273] ? __prepare_to_swait+0x53/0x78 [13148.761218] __wait_for_common+0xae/0x163 [13148.763144] __ocfs2_cluster_lock.constprop.0+0x1d6/0x870 [ocfs2] [13148.765780] ? ocfs2_inode_lock_full_nested+0x18d/0x398 [ocfs2] [13148.768312] ocfs2_inode_lock_full_nested+0x18d/0x398 [ocfs2] [13148.770968] ocfs2_journal_init+0x91/0x340 [ocfs2] [13148.773202] ocfs2_check_volume+0x39/0x461 [ocfs2] [13148.775401] ? iput+0x69/0xba [13148.777047] ocfs2_mount_volume.isra.0.cold+0x40/0x1f5 [ocfs2] [13148.779646] ocfs2_fill_super+0x54b/0x853 [ocfs2] [13148.781756] mount_bdev+0x190/0x1b7 [13148.783443] ? ocfs2_remount+0x440/0x440 [ocfs2] [13148.785634] legacy_get_tree+0x27/0x48 [13148.787466] vfs_get_tree+0x25/0xd0 [13148.789270] do_new_mount+0x18c/0x2d9 [13148.791046] __x64_sys_mount+0x10e/0x142 [13148.792911] do_syscall_64+0x3b/0x89 [13148.794667] entry_SYSCALL_64_after_hwframe+0x170/0x0 [13148.797051] RIP: 0033:0x7f2309f6e26e [13148.798784] RSP: 002b:00007ffdcee7d408 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 [13148.801974] RAX: ffffffffffffffda RBX: 00007ffdcee7d4a0 RCX: 00007f2309f6e26e [13148.804815] RDX: 0000559aa762a8ae RSI: 0000559aa939d340 RDI: 0000559aa93a22b0 [13148.807719] RBP: 00007ffdcee7d5b0 R08: 0000559aa93a2290 R09: 00007f230a0b4820 [13148.810659] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffdcee7d420 [13148.813609] R13: 0000000000000000 R14: 0000559aa939f000 R15: 0000000000000000 [13148.816564] To fix it, we can just fix __ocfs2_find_empty_slot. But original commit introduced the feature to mount ocfs2 locally even it is cluster based, that is a very dangerous, it can easily cause serious data corruption, there is no way to stop other nodes mounting the fs and corrupting it. Setup ha or other cluster-aware stack is just the cost that we have to take for avoiding corruption, otherwise we have to do it in kernel. Link: https://lkml.kernel.org/r/20220603222801.42488-1-junxiao.bi@oracle.com Fixes: 912f655d78c5("ocfs2: mount shared volume without ha stack") Signed-off-by: Junxiao Bi Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Cc: Signed-off-by: Andrew Morton commit da9a298f5fad0dc615079a340da42928bc5b138e Author: Miaohe Lin Date: Sat Jul 9 17:26:29 2022 +0800 hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte When alloc_huge_page fails, *pagep is set to NULL without put_page first. So the hugepage indicated by *pagep is leaked. Link: https://lkml.kernel.org/r/20220709092629.54291-1-linmiaohe@huawei.com Fixes: 8cc5fcbb5be8 ("mm, hugetlb: fix racy resv_huge_pages underflow on UFFDIO_COPY") Signed-off-by: Miaohe Lin Acked-by: Muchun Song Reviewed-by: Anshuman Khandual Reviewed-by: Baolin Wang Reviewed-by: Mike Kravetz Cc: Signed-off-by: Andrew Morton commit bdeb77bc2c405fa9f954c20269db175a0bd2793f Author: Andrei Vagin Date: Sat Jul 16 21:37:10 2022 -0700 fs: sendfile handles O_NONBLOCK of out_fd sendfile has to return EAGAIN if out_fd is nonblocking and the write into it would block. Here is a small reproducer for the problem: #define _GNU_SOURCE /* See feature_test_macros(7) */ #include #include #include #include #include #include #include #define FILE_SIZE (1UL << 30) int main(int argc, char **argv) { int p[2], fd; if (pipe2(p, O_NONBLOCK)) return 1; fd = open(argv[1], O_RDWR | O_TMPFILE, 0666); if (fd < 0) return 1; ftruncate(fd, FILE_SIZE); if (sendfile(p[1], fd, 0, FILE_SIZE) == -1) { fprintf(stderr, "FAIL\n"); } if (sendfile(p[1], fd, 0, FILE_SIZE) != -1 || errno != EAGAIN) { fprintf(stderr, "FAIL\n"); } return 0; } It worked before b964bf53e540, it is stuck after b964bf53e540, and it works again with this fix. This regression occurred because do_splice_direct() calls pipe_write that handles O_NONBLOCK. Here is a trace log from the reproducer: 1) | __x64_sys_sendfile64() { 1) | do_sendfile() { 1) | __fdget() 1) | rw_verify_area() 1) | __fdget() 1) | rw_verify_area() 1) | do_splice_direct() { 1) | rw_verify_area() 1) | splice_direct_to_actor() { 1) | do_splice_to() { 1) | rw_verify_area() 1) | generic_file_splice_read() 1) + 74.153 us | } 1) | direct_splice_actor() { 1) | iter_file_splice_write() { 1) | __kmalloc() 1) 0.148 us | pipe_lock(); 1) 0.153 us | splice_from_pipe_next.part.0(); 1) 0.162 us | page_cache_pipe_buf_confirm(); ... 16 times 1) 0.159 us | page_cache_pipe_buf_confirm(); 1) | vfs_iter_write() { 1) | do_iter_write() { 1) | rw_verify_area() 1) | do_iter_readv_writev() { 1) | pipe_write() { 1) | mutex_lock() 1) 0.153 us | mutex_unlock(); 1) 1.368 us | } 1) 1.686 us | } 1) 5.798 us | } 1) 6.084 us | } 1) 0.174 us | kfree(); 1) 0.152 us | pipe_unlock(); 1) + 14.461 us | } 1) + 14.783 us | } 1) 0.164 us | page_cache_pipe_buf_release(); ... 16 times 1) 0.161 us | page_cache_pipe_buf_release(); 1) | touch_atime() 1) + 95.854 us | } 1) + 99.784 us | } 1) ! 107.393 us | } 1) ! 107.699 us | } Link: https://lkml.kernel.org/r/20220415005015.525191-1-avagin@gmail.com Fixes: b964bf53e540 ("teach sendfile(2) to handle send-to-pipe directly") Signed-off-by: Andrei Vagin Cc: Al Viro Cc: Signed-off-by: Andrew Morton commit 38c9c22a85aeed28d0831f230136e9cf6fa2ed44 Author: ChenXiaoSong Date: Thu Jul 7 18:53:29 2022 +0800 ntfs: fix use-after-free in ntfs_ucsncmp() Syzkaller reported use-after-free bug as follows: ================================================================== BUG: KASAN: use-after-free in ntfs_ucsncmp+0x123/0x130 Read of size 2 at addr ffff8880751acee8 by task a.out/879 CPU: 7 PID: 879 Comm: a.out Not tainted 5.19.0-rc4-next-20220630-00001-gcc5218c8bd2c-dirty #7 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_lvl+0x1c0/0x2b0 print_address_description.constprop.0.cold+0xd4/0x484 print_report.cold+0x55/0x232 kasan_report+0xbf/0xf0 ntfs_ucsncmp+0x123/0x130 ntfs_are_names_equal.cold+0x2b/0x41 ntfs_attr_find+0x43b/0xb90 ntfs_attr_lookup+0x16d/0x1e0 ntfs_read_locked_attr_inode+0x4aa/0x2360 ntfs_attr_iget+0x1af/0x220 ntfs_read_locked_inode+0x246c/0x5120 ntfs_iget+0x132/0x180 load_system_files+0x1cc6/0x3480 ntfs_fill_super+0xa66/0x1cf0 mount_bdev+0x38d/0x460 legacy_get_tree+0x10d/0x220 vfs_get_tree+0x93/0x300 do_new_mount+0x2da/0x6d0 path_mount+0x496/0x19d0 __x64_sys_mount+0x284/0x300 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f3f2118d9ea Code: 48 8b 0d a9 f4 0b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 76 f4 0b 00 f7 d8 64 89 01 48 RSP: 002b:00007ffc269deac8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3f2118d9ea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffc269dec00 RBP: 00007ffc269dec80 R08: 00007ffc269deb00 R09: 00007ffc269dec44 R10: 0000000000000000 R11: 0000000000000202 R12: 000055f81ab1d220 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page:0000000085430378 refcount:1 mapcount:1 mapping:0000000000000000 index:0x555c6a81d pfn:0x751ac memcg:ffff888101f7e180 anon flags: 0xfffffc00a0014(uptodate|lru|mappedtodisk|swapbacked|node=0|zone=1|lastcpupid=0x1fffff) raw: 000fffffc00a0014 ffffea0001bf2988 ffffea0001de2448 ffff88801712e201 raw: 0000000555c6a81d 0000000000000000 0000000100000000 ffff888101f7e180 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880751acd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880751ace00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880751ace80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880751acf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880751acf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== The reason is that struct ATTR_RECORD->name_offset is 6485, end address of name string is out of bounds. Fix this by adding sanity check on end address of attribute name string. [akpm@linux-foundation.org: coding-style cleanups] [chenxiaosong2@huawei.com: cleanup suggested by Hawkins Jiawei] Link: https://lkml.kernel.org/r/20220709064511.3304299-1-chenxiaosong2@huawei.com Link: https://lkml.kernel.org/r/20220707105329.4020708-1-chenxiaosong2@huawei.com Signed-off-by: ChenXiaoSong Signed-off-by: Hawkins Jiawei Cc: Anton Altaparmakov Cc: ChenXiaoSong Cc: Yongqiang Liu Cc: Zhang Yi Cc: Zhang Xiaoxu Signed-off-by: Andrew Morton commit 84ac013046ccc438af04b7acecd4d3ab84fe4bde Author: Mike Rapoport Date: Thu Jul 7 19:56:50 2022 +0300 secretmem: fix unhandled fault in truncate syzkaller reports the following issue: BUG: unable to handle page fault for address: ffff888021f7e005 PGD 11401067 P4D 11401067 PUD 11402067 PMD 21f7d063 PTE 800fffffde081060 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3761 Comm: syz-executor281 Not tainted 5.19.0-rc4-syzkaller-00014-g941e3e791269 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 RSP: 0018:ffffc9000329fa90 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 0000000000001000 RCX: 0000000000000ffb RDX: 0000000000000ffb RSI: 0000000000000000 RDI: ffff888021f7e005 RBP: ffffea000087df80 R08: 0000000000000001 R09: ffff888021f7e005 R10: ffffed10043efdff R11: 0000000000000000 R12: 0000000000000005 R13: 0000000000000000 R14: 0000000000001000 R15: 0000000000000ffb FS: 00007fb29d8b2700(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff888021f7e005 CR3: 0000000026e7b000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: zero_user_segments include/linux/highmem.h:272 [inline] folio_zero_range include/linux/highmem.h:428 [inline] truncate_inode_partial_folio+0x76a/0xdf0 mm/truncate.c:237 truncate_inode_pages_range+0x83b/0x1530 mm/truncate.c:381 truncate_inode_pages mm/truncate.c:452 [inline] truncate_pagecache+0x63/0x90 mm/truncate.c:753 simple_setattr+0xed/0x110 fs/libfs.c:535 secretmem_setattr+0xae/0xf0 mm/secretmem.c:170 notify_change+0xb8c/0x12b0 fs/attr.c:424 do_truncate+0x13c/0x200 fs/open.c:65 do_sys_ftruncate+0x536/0x730 fs/open.c:193 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fb29d900899 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:00007fb29d8b2318 EFLAGS: 00000246 ORIG_RAX: 000000000000004d RAX: ffffffffffffffda RBX: 00007fb29d988408 RCX: 00007fb29d900899 RDX: 00007fb29d900899 RSI: 0000000000000005 RDI: 0000000000000003 RBP: 00007fb29d988400 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb29d98840c R13: 00007ffca01a23bf R14: 00007fb29d8b2400 R15: 0000000000022000 Modules linked in: CR2: ffff888021f7e005 ---[ end trace 0000000000000000 ]--- Eric Biggers suggested that this happens when secretmem_setattr()->simple_setattr() races with secretmem_fault() so that a page that is faulted in by secretmem_fault() (and thus removed from the direct map) is zeroed by inode truncation right afterwards. Use mapping->invalidate_lock to make secretmem_fault() and secretmem_setattr() mutually exclusive. [rppt@linux.ibm.com: v3] Link: https://lkml.kernel.org/r/20220714091337.412297-1-rppt@kernel.org Link: https://lkml.kernel.org/r/20220707165650.248088-1-rppt@kernel.org Reported-by: syzbot+9bd2b7adbd34b30b87e4@syzkaller.appspotmail.com Signed-off-by: Mike Rapoport Suggested-by: Eric Biggers Reviewed-by: Axel Rasmussen Reviewed-by: Jan Kara Cc: Eric Biggers Cc: Hillf Danton Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton commit c2cb0dcce9dd8b748b6ca8bb8d4a389f2e232307 Author: Naoya Horiguchi Date: Mon Jul 4 10:33:05 2022 +0900 mm/hugetlb: separate path for hwpoison entry in copy_hugetlb_page_range() Originally copy_hugetlb_page_range() handles migration entries and hwpoisoned entries in similar manner. But recently the related code path has more code for migration entries, and when is_writable_migration_entry() was converted to !is_readable_migration_entry(), hwpoison entries on source processes got to be unexpectedly updated (which is legitimate for migration entries, but not for hwpoison entries). This results in unexpected serious issues like kernel panic when forking processes with hwpoison entries in pmd. Separate the if branch into one for hwpoison entries and one for migration entries. Link: https://lkml.kernel.org/r/20220704013312.2415700-3-naoya.horiguchi@linux.dev Fixes: 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") Signed-off-by: Naoya Horiguchi Reviewed-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: [5.18] Cc: David Hildenbrand Cc: Liu Shixin Cc: Oscar Salvador Cc: Yang Shi Signed-off-by: Andrew Morton commit f4f451a16dd1f478fdb966bcbb612c1e4ce6b962 Author: Muchun Song Date: Tue Jul 5 20:35:32 2022 +0800 mm: fix missing wake-up event for FSDAX pages FSDAX page refcounts are 1-based, rather than 0-based: if refcount is 1, then the page is freed. The FSDAX pages can be pinned through GUP, then they will be unpinned via unpin_user_page() using a folio variant to put the page, however, folio variants did not consider this special case, the result will be to miss a wakeup event (like the user of __fuse_dax_break_layouts()). This results in a task being permanently stuck in TASK_INTERRUPTIBLE state. Since FSDAX pages are only possibly obtained by GUP users, so fix GUP instead of folio_put() to lower overhead. Link: https://lkml.kernel.org/r/20220705123532.283-1-songmuchun@bytedance.com Fixes: d8ddc099c6b3 ("mm/gup: Add gup_put_folio()") Signed-off-by: Muchun Song Suggested-by: Matthew Wilcox Cc: Jason Gunthorpe Cc: John Hubbard Cc: William Kucharski Cc: Dan Williams Cc: Jan Kara Cc: Signed-off-by: Andrew Morton commit 3fe2895cfecd03ac74977f32102b966b6589f481 Author: Josef Bacik Date: Tue Jul 5 16:00:36 2022 -0400 mm: fix page leak with multiple threads mapping the same page We have an application with a lot of threads that use a shared mmap backed by tmpfs mounted with -o huge=within_size. This application started leaking loads of huge pages when we upgraded to a recent kernel. Using the page ref tracepoints and a BPF program written by Tejun Heo we were able to determine that these pages would have multiple refcounts from the page fault path, but when it came to unmap time we wouldn't drop the number of refs we had added from the faults. I wrote a reproducer that mmap'ed a file backed by tmpfs with -o huge=always, and then spawned 20 threads all looping faulting random offsets in this map, while using madvise(MADV_DONTNEED) randomly for huge page aligned ranges. This very quickly reproduced the problem. The problem here is that we check for the case that we have multiple threads faulting in a range that was previously unmapped. One thread maps the PMD, the other thread loses the race and then returns 0. However at this point we already have the page, and we are no longer putting this page into the processes address space, and so we leak the page. We actually did the correct thing prior to f9ce0be71d1f, however it looks like Kirill copied what we do in the anonymous page case. In the anonymous page case we don't yet have a page, so we don't have to drop a reference on anything. Previously we did the correct thing for file based faults by returning VM_FAULT_NOPAGE so we correctly drop the reference on the page we faulted in. Fix this by returning VM_FAULT_NOPAGE in the pmd_devmap_trans_unstable() case, this makes us drop the ref on the page properly, and now my reproducer no longer leaks the huge pages. [josef@toxicpanda.com: v2] Link: https://lkml.kernel.org/r/e90c8f0dbae836632b669c2afc434006a00d4a67.1657721478.git.josef@toxicpanda.com Link: https://lkml.kernel.org/r/2b798acfd95c9ab9395fe85e8d5a835e2e10a920.1657051137.git.josef@toxicpanda.com Fixes: f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") Signed-off-by: Josef Bacik Signed-off-by: Rik van Riel Signed-off-by: Chris Mason Acked-by: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Signed-off-by: Andrew Morton commit f073c8335929a9746c19d4551aeb2d4d0dbef0d1 Author: Seth Forshee Date: Tue Jun 28 15:07:34 2022 -0500 mailmap: update Seth Forshee's email address seth.forshee@canonical.com is no longer valid, use sforshee@kernel.org instead. Link: https://lkml.kernel.org/r/20220628200734.424495-1-sforshee@kernel.org Signed-off-by: Seth Forshee Signed-off-by: Andrew Morton commit 0c98c8e1e181478152d440a89d802ee4508c66a6 Author: ZhaoLong Wang Date: Wed Jun 29 20:43:24 2022 +0800 tmpfs: fix the issue that the mount and remount results are inconsistent. An undefined-behavior issue has not been completely fixed since commit d14f5efadd84 ("tmpfs: fix undefined-behaviour in shmem_reconfigure()"). In the commit, check in the shmem_reconfigure() is added in remount process to avoid the Ubsan problem. However, the check is not added to the mount process. It causes inconsistent results between mount and remount. The operations to reproduce the problem in user mode as follows: If nr_blocks is set to 0x8000000000000000, the mounting is successful. # mount tmpfs /dev/shm/ -t tmpfs -o nr_blocks=0x8000000000000000 However, when -o remount is used, the mount fails because of the check in the shmem_reconfigure() # mount tmpfs /dev/shm/ -t tmpfs -o remount,nr_blocks=0x8000000000000000 mount: /dev/shm: mount point not mounted or bad option. Therefore, add checks in the shmem_parse_one() function and remove the check in shmem_reconfigure() to avoid this problem. Link: https://lkml.kernel.org/r/20220629124324.1640807-1-wangzhaolong1@huawei.com Signed-off-by: ZhaoLong Wang Cc: Luo Meng Cc: Hugh Dickins Cc: Yu Kuai Cc: Zhihao Cheng Cc: Zhang Yi Signed-off-by: Andrew Morton commit 07313a2b29ed1079eaa7722624544b97b3ead84b Author: Yee Lee Date: Tue Jun 28 19:37:11 2022 +0800 mm: kfence: apply kmemleak_ignore_phys on early allocated pool This patch solves two issues. (1) The pool allocated by memblock needs to unregister from kmemleak scanning. Apply kmemleak_ignore_phys to replace the original kmemleak_free as its address now is stored in the phys tree. (2) The pool late allocated by page-alloc doesn't need to unregister. Move out the freeing operation from its call path. Link: https://lkml.kernel.org/r/20220628113714.7792-2-yee.lee@mediatek.com Fixes: 0c24e061196c21d5 ("mm: kmemleak: add rbtree and store physical address for objects allocated with PA") Signed-off-by: Yee Lee Suggested-by: Catalin Marinas Reviewed-by: Catalin Marinas Suggested-by: Marco Elver Reviewed-by: Marco Elver Tested-by: Geert Uytterhoeven Signed-off-by: Andrew Morton commit 80e19f34c2887a8881084b7bb7480e9544d56b91 Merge: ff6992735ade7 85ff37e302efd Author: Linus Torvalds Date: Mon Jul 18 11:47:04 2022 -0700 Merge tag 'hte/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux Pull hardware timestamp fix from Thierry Reding: "A single fix for an out-of-sync kerneldoc comment" * tag 'hte/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: gpiolib: cdev: Fix kernel doc for struct line commit 09073396ea62d0a10b03f5661dcabfd8eca3f098 Author: Mario Limonciello Date: Fri Jul 15 12:33:25 2022 -0500 ACPI: CPPC: Don't require flexible address space if X86_FEATURE_CPPC is supported Commit 0651ab90e4ad ("ACPI: CPPC: Check _OSC for flexible address space") changed _CPC probing to require flexible address space to be negotiated for CPPC to work. However it was observed that this caused a regression for Arek's ROG Zephyrus G15 GA503QM which previously CPPC worked, but now it stopped working. To avoid causing a regression waive this failure when the CPU is known to support CPPC. Cc: Pierre Gondois Link: https://bugzilla.kernel.org/show_bug.cgi?id=216248 Fixes: 0651ab90e4ad ("ACPI: CPPC: Check _OSC for flexible address space") Reported-and-tested-by: Arek Ruśniak Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit d8fa2fd791a72087c1ce3336fbeefec4057c37c8 Author: Przemyslaw Patynowski Date: Wed Jun 15 13:57:20 2022 -0400 iavf: Fix missing state logs Fix debug prints, by adding missing state prints. Extend iavf_state_str by strings for __IAVF_INIT_EXTENDED_CAPS and __IAVF_INIT_CONFIG_ADAPTER. Without this patch, when enabling debug prints for iavf.h, user will see: iavf 0000:06:0e.0: state transition from:__IAVF_INIT_GET_RESOURCES to:__IAVF_UNKNOWN_STATE iavf 0000:06:0e.0: state transition from:__IAVF_UNKNOWN_STATE to:__IAVF_UNKNOWN_STATE Fixes: 605ca7c5c670 ("iavf: Fix kernel BUG in free_msi_irqs") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Jun Zhang Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit a9f49e0060301a9bfebeca76739158d0cf91cdf6 Author: Przemyslaw Patynowski Date: Fri Jun 24 17:33:01 2022 -0700 iavf: Fix handling of dummy receive descriptors Fix memory leak caused by not handling dummy receive descriptor properly. iavf_get_rx_buffer now sets the rx_buffer return value for dummy receive descriptors. Without this patch, when the hardware writes a dummy descriptor, iavf would not free the page allocated for the previous receive buffer. This is an unlikely event but can still happen. [Jesse: massaged commit message] Fixes: efa14c398582 ("iavf: allow null RX descriptors") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Jesse Brandeburg Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 4635fd3a9d77581498f34ab9a7e4bcc211bf0a4c Author: Przemyslaw Patynowski Date: Mon Jun 13 19:07:42 2022 -0400 iavf: Disallow changing rx/tx-frames and rx/tx-frames-irq Remove from supported_coalesce_params ETHTOOL_COALESCE_MAX_FRAMES and ETHTOOL_COALESCE_MAX_FRAMES_IRQ. As tx-frames-irq allowed user to change budget for iavf_clean_tx_irq, remove work_limit and use define for budget. Without this patch there would be possibility to change rx/tx-frames and rx/tx-frames-irq, which for rx/tx-frames did nothing, while for rx/tx-frames-irq it changed rx/tx-frames and only changed budget for cleaning NAPI poll. Fixes: fbb7ddfef253 ("i40evf: core ethtool functionality") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Jun Zhang Tested-by: Marek Szlosek Signed-off-by: Tony Nguyen commit 968996c070ef080ee7d6150faa98a4e562ce4625 Author: Przemyslaw Patynowski Date: Fri Jun 10 14:15:54 2022 +0200 iavf: Fix VLAN_V2 addition/rejection Fix VLAN addition, so that PF driver does not reject whole VLAN batch. Add VLAN reject handling, so rejected VLANs, won't litter VLAN filter list. Fix handling of active_(c/s)vlans, so it will be possible to re-add VLAN filters for user. Without this patch, after changing trust to off, with VLAN filters saturated, no VLAN is added, due to PF rejecting addition. Fixes: 92fc50859872 ("iavf: Restrict maximum VLAN filters for VIRTCHNL_VF_OFFLOAD_VLAN_V2") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Jedrzej Jagielski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit e1aadbab445b06e072013a1365fd0cf2aa25e843 Author: xinhui pan Date: Fri Jul 8 09:22:44 2022 +0800 drm/amdgpu: Remove one duplicated ef removal That has been done in BO release notify. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2074 Signed-off-by: xinhui pan Acked-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 28a99e95f55c61855983d36a88c05c178d966bb7 Author: Peter Zijlstra Date: Mon Jul 18 13:41:37 2022 +0200 x86/amd: Use IBPB for firmware calls On AMD IBRS does not prevent Retbleed; as such use IBPB before a firmware call to flush the branch history state. And because in order to do an EFI call, the kernel maps a whole lot of the kernel page table into the EFI page table, do an IBPB just in case in order to prevent the scenario of poisoning the BTB and causing an EFI call using the unprotected RET there. [ bp: Massage. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220715194550.793957-1-cascardo@canonical.com commit c32349f3257f329a01e776e02b577bf7af97f30b Merge: c9f21106d97b5 7b02f40350f1b Author: David S. Miller Date: Mon Jul 18 12:44:37 2022 +0100 Merge branch 'dsa-docs' Vladimir Oltean says: ==================== Update DSA documentation These are some updates of dsa.rst, since it hasn't kept up with development (in some cases, even since 2017). I've added Fixes: tags as I thought was appropriate. ==================== Signed-off-by: David S. Miller commit 7b02f40350f1b8011f724a052dcb0849cffa6c38 Author: Vladimir Oltean Date: Sat Jul 16 21:53:44 2022 +0300 docs: net: dsa: mention that VLANs are now refcounted on shared ports The blamed commit updated the way in which VLANs are handled at the cross-chip notifier layer and didn't update the documentation to say that. Fix it. Fixes: 134ef2388e7f ("net: dsa: add explicit support for host bridge VLANs") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6ba1a4aa5974f8a47e6322cecc965e6357b58d80 Author: Vladimir Oltean Date: Sat Jul 16 21:53:43 2022 +0300 docs: net: dsa: delete misinformation about -EOPNOTSUPP for FDB/MDB/VLAN Returning -EOPNOTSUPP does *NOT* mean anything special. port_vlan_add() is actually called from 2 code paths, one is vlan_vid_add() from 8021q module and the other is br_switchdev_port_vlan_add() from switchdev. The bridge has a wrapper __vlan_vid_add() which first tries via switchdev, then if that returns -EOPNOTSUPP, tries again via the VLAN RX filters in the 8021q module. But DSA doesn't distinguish between one call path and the other when calling the driver's port_vlan_add(), so if the driver returns -EOPNOTSUPP to switchdev, it also returns -EOPNOTSUPP to the 8021q module. And the latter is a hard error. port_fdb_add() is called from the deferred dsa_owq only, so obviously its return code isn't propagated anywhere, and cannot be interpreted in any way. The return code from port_mdb_add() is propagated to the bridge, but again, this doesn't do anything special when -EOPNOTSUPP is returned, but rather, br_switchdev_mdb_notify() returns void. Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ea7006a7aaee54a8861e0bfd5cf6a8495fb998a7 Author: Vladimir Oltean Date: Sat Jul 16 21:53:42 2022 +0300 docs: net: dsa: re-explain what port_fdb_dump actually does Switchdev has changed radically from its initial implementation, and the currently provided definition is incorrect and very confusing. Rewrite it in light of what it actually does. Fixes: 2bedde1abbef ("net: dsa: Move FDB dump implementation inside DSA") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4e9d9bb6df6b4ef87f217e81a8eb37c359400e2e Author: Vladimir Oltean Date: Sat Jul 16 21:53:41 2022 +0300 docs: net: dsa: add a section for address databases The given definition for what VID 0 represents in the current port_fdb_add and port_mdb_add is blatantly wrong. Delete it and explain the concepts surrounding DSA's understanding of FDB isolation. Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 7f75d3dd4f5b00a1d3ef853f044a25b4cb55082a Author: Vladimir Oltean Date: Sat Jul 16 21:53:40 2022 +0300 docs: net: dsa: delete port_mdb_dump This was deleted in 2017, stop documenting it. Fixes: dc0cbff3ff9f ("net: dsa: Remove redundant MDB dump support") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e465d507c76ce2552e1e08513f1d1ca8c4175e9c Author: Vladimir Oltean Date: Sat Jul 16 21:53:39 2022 +0300 docs: net: dsa: remove port_vlan_dump This was deleted in 2017, delete the obsolete documentation. Fixes: c069fcd82c57 ("net: dsa: Remove support for bypass bridge port attributes/vlan set") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 308362394850b680ef3e2cd548bfaa27fd120a4d Author: Vladimir Oltean Date: Sat Jul 16 21:53:38 2022 +0300 docs: net: dsa: remove port_bridge_tx_fwd_offload We've changed the API through which we can offload the bridge TX forwarding process. Update the documentation in light of the removal of 2 DSA switch ops. Fixes: b079922ba2ac ("net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 0cb8682ebf5eedbfd71a8b212f23afc1aedfe1ba Author: Vladimir Oltean Date: Sat Jul 16 21:53:37 2022 +0300 docs: net: dsa: document port_fast_age The provided information about FDB flushing is not really up to date. The DSA core automatically calls port_fast_age() when necessary, and drivers should just implement that rather than hooking it to port_bridge_leave, port_stp_state_set and others. Fixes: 732f794c1baf ("net: dsa: add port fast ageing") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 3c87237ecd27fe5534f3324a4dccbce059c04e40 Author: Vladimir Oltean Date: Sat Jul 16 21:53:36 2022 +0300 docs: net: dsa: document port_setup and port_teardown These methods were added without being documented, fix that. Fixes: fd292c189a97 ("net: dsa: tear down devlink port regions when tearing down the devlink port on error") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b763f50dc157c2796dded090fac3e05cb5147348 Author: Vladimir Oltean Date: Sat Jul 16 21:53:35 2022 +0300 docs: net: dsa: document the teardown method A teardown method was added to dsa_switch_ops without being documented. Do so now. Fixes: 5e3f847a02aa ("net: dsa: Add teardown callback for drivers") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit d6a0336addd47af8869953a480e44a63726fad8f Author: Vladimir Oltean Date: Sat Jul 16 21:53:34 2022 +0300 docs: net: dsa: document change_tag_protocol Support for changing the tagging protocol was added without this operation being documented; do so now. Fixes: 53da0ebaad10 ("net: dsa: allow changing the tag protocol via the "tagging" device attribute") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c56313a42aaa0c353af6425aed63719823ccfc32 Author: Vladimir Oltean Date: Sat Jul 16 21:53:33 2022 +0300 docs: net: dsa: add more info about the other arguments to get_tag_protocol Changes were made to the prototype of get_tag_protocol without describing at a high level what they are about. Update the documentation to explain that. Fixes: 5ed4e3eb0217 ("net: dsa: Pass a port to get_tag_protocol()") Fixes: 4d776482ecc6 ("net: dsa: Get information about stacked DSA protocol") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c3f0e84d10862b2b2ed927561f12fe0bf8033590 Author: Vladimir Oltean Date: Sat Jul 16 21:53:32 2022 +0300 docs: net: dsa: rename tag_protocol to get_tag_protocol Since the blamed commit, the enum was turned into a function pointer and also renamed. Update the documentation. Fixes: 7b314362a234 ("net: dsa: Allow the DSA driver to indicate the tag protocol") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 54367831c5d0ce273d82814f5fcb35c004f6a912 Author: Vladimir Oltean Date: Sat Jul 16 21:53:31 2022 +0300 docs: net: dsa: document the shutdown behavior Document the changes that took place in the DSA core in the blamed commit. Fixes: 0650bf52b31f ("net: dsa: be compatible with masters which unregister on shutdown") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 19b3b13c932fc8d613e50e3e92c1944f9fcc02c7 Author: Vladimir Oltean Date: Sat Jul 16 21:53:30 2022 +0300 docs: net: dsa: update probing documentation Since the blamed commit we don't have register_switch_driver() and unregister_switch_driver() anymore. Additionally, the expected dsa_register_switch() and dsa_unregister_switch() calls aren't documented. Update the probing section with the details of how things are currently done. Fixes: 93e86b3bc842 ("net: dsa: Remove legacy probing support") Signed-off-by: Vladimir Oltean Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c9f21106d97b5056f36613792fe55284a9c5f75b Merge: 1e20904e41773 021266ec640c7 Author: David S. Miller Date: Mon Jul 18 12:21:54 2022 +0100 Merge branch 'net-ipv4-sysctl-races-part-3' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Round 3). This series fixes data-races around 21 knobs after igmp_link_local_mcast_reports in ipv4_net_table. These 4 knobs are skipped because they are safe. - tcp_congestion_control: Safe with RCU and xchg(). - tcp_available_congestion_control: Read only. - tcp_allowed_congestion_control: Safe with RCU and spinlock(). - tcp_fastopen_key: Safe with RCU and xchg() So, round 4 will start with fib_multipath_use_neigh. ==================== Signed-off-by: David S. Miller commit 021266ec640c7a4527e6cd4b7349a512b351de1d Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:55 2022 -0700 tcp: Fix data-races around sysctl_tcp_fastopen_blackhole_timeout. While reading sysctl_tcp_fastopen_blackhole_timeout, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: cf1ef3f0719b ("net/tcp_fastopen: Disable active side TFO in certain scenarios") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 5a54213318c43f4009ae158347aa6016e3b9b55a Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:54 2022 -0700 tcp: Fix data-races around sysctl_tcp_fastopen. While reading sysctl_tcp_fastopen, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 2100c8d2d9db ("net-tcp: Fast Open base") Signed-off-by: Kuniyuki Iwashima Acked-by: Yuchung Cheng Signed-off-by: David S. Miller commit 79539f34743d3e14cc1fa6577d326a82cc64d62f Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:53 2022 -0700 tcp: Fix data-races around sysctl_max_syn_backlog. While reading sysctl_max_syn_backlog, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit cbfc6495586a3f09f6f07d9fb3c7cafe807e3c55 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:52 2022 -0700 tcp: Fix a data-race around sysctl_tcp_tw_reuse. While reading sysctl_tcp_tw_reuse, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 55be873695ed8912eb77ff46d1d1cadf028bd0f3 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:51 2022 -0700 tcp: Fix a data-race around sysctl_tcp_notsent_lowat. While reading sysctl_tcp_notsent_lowat, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: c9bee3b7fdec ("tcp: TCP_NOTSENT_LOWAT socket option") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 39e24435a776e9de5c6dd188836cf2523547804b Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:50 2022 -0700 tcp: Fix data-races around some timeout sysctl knobs. While reading these sysctl knobs, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. - tcp_retries1 - tcp_retries2 - tcp_orphan_retries - tcp_fin_timeout Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 46778cd16e6a5ad1b2e3a91f6c057c907379418e Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:49 2022 -0700 tcp: Fix data-races around sysctl_tcp_reordering. While reading sysctl_tcp_reordering, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4177f545895b1da08447a80692f30617154efa6e Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:48 2022 -0700 tcp: Fix data-races around sysctl_tcp_migrate_req. While reading sysctl_tcp_migrate_req, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: f9ac779f881c ("net: Introduce net.ipv4.tcp_migrate_req.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit f2e383b5bb6bbc60a0b94b87b3e49a2b1aefd11e Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:47 2022 -0700 tcp: Fix data-races around sysctl_tcp_syncookies. While reading sysctl_tcp_syncookies, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 20a3b1c0f603e8c55c3396abd12dfcfb523e4d3c Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:46 2022 -0700 tcp: Fix data-races around sysctl_tcp_syn(ack)?_retries. While reading sysctl_tcp_syn(ack)?_retries, they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit f2f316e287e6c2e3a1c5bab8d9b77ee03daa0463 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:45 2022 -0700 tcp: Fix data-races around keepalive sysctl knobs. While reading sysctl_tcp_keepalive_(time|probes|intvl), they can be changed concurrently. Thus, we need to add READ_ONCE() to their readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8ebcc62c738f68688ee7c6fec2efe5bc6d3d7e60 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:44 2022 -0700 igmp: Fix data-races around sysctl_igmp_qrv. While reading sysctl_igmp_qrv, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. This test can be packed into a helper, so such changes will be in the follow-up series after net is merged into net-next. qrv ?: READ_ONCE(net->ipv4.sysctl_igmp_qrv); Fixes: a9fe8e29945d ("ipv4: implement igmp_qrv sysctl to tune igmp robustness variable") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 6ae0f2e553737b8cce49a1372573c81130ffa80e Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:43 2022 -0700 igmp: Fix data-races around sysctl_igmp_max_msf. While reading sysctl_igmp_max_msf, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 6305d821e3b9b5379d348528e5b5faf316383bc2 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:42 2022 -0700 igmp: Fix a data-race around sysctl_igmp_max_memberships. While reading sysctl_igmp_max_memberships, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit f6da2267e71106474fbc0943dc24928b9cb79119 Author: Kuniyuki Iwashima Date: Fri Jul 15 10:17:41 2022 -0700 igmp: Fix data-races around sysctl_igmp_llm_reports. While reading sysctl_igmp_llm_reports, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. This test can be packed into a helper, so such changes will be in the follow-up series after net is merged into net-next. if (ipv4_is_local_multicast(pmc->multiaddr) && !READ_ONCE(net->ipv4.sysctl_igmp_llm_reports)) Fixes: df2cf4a78e48 ("IGMP: Inhibit reports for local multicast groups") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 41ef3c1a6bb0fd4a3f81170dd17de3adbff80783 Author: Mario Limonciello Date: Wed Jul 13 12:59:50 2022 -0500 pinctrl: Don't allow PINCTRL_AMD to be a module It was observed that by allowing pinctrl_amd to be loaded later in the boot process that interrupts sent to the GPIO controller early in the boot are not serviced. The kernel treats these as a spurious IRQ and disables the IRQ. This problem was exacerbated because it happened on a system with an encrypted partition so the kernel object was not accesssible for an extended period of time while waiting for a passphrase. To avoid this situation from occurring, stop allowing pinctrl-amd from being built as a module and instead require it to be built-in or disabled. Reported-by: madcatx@atlas.cz Suggested-by: jwrdegoede@fedoraproject.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=216230 Signed-off-by: Mario Limonciello Acked-by: Hans de Goede Link: https://lore.kernel.org/r/20220713175950.964-1-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit 1e20904e417738066b26490de2daf7ef3ed34483 Author: Maksym Glubokiy Date: Fri Jul 15 15:55:50 2022 +0300 net: prestera: acl: use proper mask for port selector Adjusted as per packet processor documentation. This allows to properly match 'indev' for clsact rules. Fixes: 47327e198d42 ("net: prestera: acl: migrate to new vTCAM api") Signed-off-by: Maksym Glubokiy Signed-off-by: David S. Miller commit f08d8c1bb97c48f24a82afaa2fd8c140f8d3da8b Author: Tariq Toukan Date: Fri Jul 15 11:42:16 2022 +0300 net/tls: Fix race in TLS device down flow Socket destruction flow and tls_device_down function sync against each other using tls_device_lock and the context refcount, to guarantee the device resources are freed via tls_dev_del() by the end of tls_device_down. In the following unfortunate flow, this won't happen: - refcount is decreased to zero in tls_device_sk_destruct. - tls_device_down starts, skips the context as refcount is zero, going all the way until it flushes the gc work, and returns without freeing the device resources. - only then, tls_device_queue_ctx_destruction is called, queues the gc work and frees the context's device resources. Solve it by decreasing the refcount in the socket's destruction flow under the tls_device_lock, for perfect synchronization. This does not slow down the common likely destructor flow, in which both the refcount is decreased and the spinlock is acquired, anyway. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Reviewed-by: Maxim Mikityanskiy Signed-off-by: Tariq Toukan Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 613b065ca32e90209024ec4a6bb5ca887ee70980 Author: Junxiao Chang Date: Fri Jul 15 15:47:01 2022 +0800 net: stmmac: fix dma queue left shift overflow issue When queue number is > 4, left shift overflows due to 32 bits integer variable. Mask calculation is wrong for MTL_RXQ_DMA_MAP1. If CONFIG_UBSAN is enabled, kernel dumps below warning: [ 10.363842] ================================================================== [ 10.363882] UBSAN: shift-out-of-bounds in /build/linux-intel-iotg-5.15-8e6Tf4/ linux-intel-iotg-5.15-5.15.0/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:224:12 [ 10.363929] shift exponent 40 is too large for 32-bit type 'unsigned int' [ 10.363953] CPU: 1 PID: 599 Comm: NetworkManager Not tainted 5.15.0-1003-intel-iotg [ 10.363956] Hardware name: ADLINK Technology Inc. LEC-EL/LEC-EL, BIOS 0.15.11 12/22/2021 [ 10.363958] Call Trace: [ 10.363960] [ 10.363963] dump_stack_lvl+0x4a/0x5f [ 10.363971] dump_stack+0x10/0x12 [ 10.363974] ubsan_epilogue+0x9/0x45 [ 10.363976] __ubsan_handle_shift_out_of_bounds.cold+0x61/0x10e [ 10.363979] ? wake_up_klogd+0x4a/0x50 [ 10.363983] ? vprintk_emit+0x8f/0x240 [ 10.363986] dwmac4_map_mtl_dma.cold+0x42/0x91 [stmmac] [ 10.364001] stmmac_mtl_configuration+0x1ce/0x7a0 [stmmac] [ 10.364009] ? dwmac410_dma_init_channel+0x70/0x70 [stmmac] [ 10.364020] stmmac_hw_setup.cold+0xf/0xb14 [stmmac] [ 10.364030] ? page_pool_alloc_pages+0x4d/0x70 [ 10.364034] ? stmmac_clear_tx_descriptors+0x6e/0xe0 [stmmac] [ 10.364042] stmmac_open+0x39e/0x920 [stmmac] [ 10.364050] __dev_open+0xf0/0x1a0 [ 10.364054] __dev_change_flags+0x188/0x1f0 [ 10.364057] dev_change_flags+0x26/0x60 [ 10.364059] do_setlink+0x908/0xc40 [ 10.364062] ? do_setlink+0xb10/0xc40 [ 10.364064] ? __nla_validate_parse+0x4c/0x1a0 [ 10.364068] __rtnl_newlink+0x597/0xa10 [ 10.364072] ? __nla_reserve+0x41/0x50 [ 10.364074] ? __kmalloc_node_track_caller+0x1d0/0x4d0 [ 10.364079] ? pskb_expand_head+0x75/0x310 [ 10.364082] ? nla_reserve_64bit+0x21/0x40 [ 10.364086] ? skb_free_head+0x65/0x80 [ 10.364089] ? security_sock_rcv_skb+0x2c/0x50 [ 10.364094] ? __cond_resched+0x19/0x30 [ 10.364097] ? kmem_cache_alloc_trace+0x15a/0x420 [ 10.364100] rtnl_newlink+0x49/0x70 This change fixes MTL_RXQ_DMA_MAP1 mask issue and channel/queue mapping warning. Fixes: d43042f4da3e ("net: stmmac: mapping mtl rx to dma channel") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216195 Reported-by: Cedric Wassenaar Signed-off-by: Junxiao Chang Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 76c16d3e19446deea98b7883f261758b96b8781a Author: Wong Vee Khee Date: Thu Jul 14 15:54:27 2022 +0800 net: stmmac: switch to use interrupt for hw crosstimestamping Using current implementation of polling mode, there is high chances we will hit into timeout error when running phc2sys. Hence, update the implementation of hardware crosstimestamping to use the MAC interrupt service routine instead of polling for TSIS bit in the MAC Timestamp Interrupt Status register to be set. Cc: Richard Cochran Signed-off-by: Wong Vee Khee Signed-off-by: David S. Miller commit ba9c4745fca70bf773b2d5c602dcd85d1a40b07a Author: Horatiu Vultur Date: Wed Jul 13 21:37:50 2022 +0200 pinctrl: ocelot: Fix pincfg The blamed commit changed to use regmaps instead of __iomem. But it didn't update the register offsets to be at word offset, so it uses byte offset. Another issue with the same commit is that it has a limit of 32 registers which is incorrect. The sparx5 has 64 while lan966x has 77. Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap") Acked-by: Colin Foster Reviewed-by: Andy Shevchenko Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220713193750.4079621-3-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij commit dc62db7138aa9365480254dda4c3e1316b1b1bbc Author: Horatiu Vultur Date: Wed Jul 13 21:37:49 2022 +0200 pinctrl: ocelot: Fix pincfg for lan966x The blamed commit introduce support for lan966x which use the same pinconf_ops as sparx5. The problem is that pinconf_ops is specific to sparx5. More precisely the offset of the bits in the pincfg register are different and also lan966x doesn't have support for PIN_CONFIG_INPUT_SCHMITT_ENABLE. Fix this by making pinconf_ops more generic such that it can be also used by lan966x. This is done by introducing 'ocelot_pincfg_data' which contains the offset and what is supported for each SOC. Fixes: 531d6ab36571 ("pinctrl: ocelot: Extend support for lan966x") Signed-off-by: Horatiu Vultur Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220713193750.4079621-2-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij commit dbd0da2453c694f2f74651834d90fb280b57f151 Author: Christian König Date: Fri Jul 15 09:57:22 2022 +0200 drm/ttm: fix locking in vmap/vunmap TTM GEM helpers I've stumbled over this while reviewing patches for DMA-buf and it looks like we completely messed the locking up here. In general most TTM function should only be called while holding the appropriate BO resv lock. Without this we could break the internal buffer object state here. Only compile tested! Signed-off-by: Christian König Fixes: 43676605f890 ("drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers") Cc: stable@vger.kernel.org Reviewed-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20220715111533.467012-1-christian.koenig@amd.com commit ef0324b6415db6742bd632dc0dfbb8fbc111473b Author: Michael Walle Date: Sat Mar 26 20:40:28 2022 +0100 ARM: dts: lan966x: fix sys_clk frequency The sys_clk frequency is 165.625MHz. The register reference of the Generic Clock controller lists the CPU clock as 600MHz, the DDR clock as 300MHz and the SYS clock as 162.5MHz. This is wrong. It was first noticed during the fan driver development and it was measured and verified via the CLK_MON output of the SoC which can be configured to output sys_clk/64. The core PLL settings (which drives the SYS clock) seems to be as follows: DIVF = 52 DIVQ = 3 DIVR = 1 With a refernce clock of 25MHz, this means we have a post divider clock Fpfd = Fref / (DIVR + 1) = 25MHz / (1 + 1) = 12.5MHz The resulting VCO frequency is then Fvco = Fpfd * (DIVF + 1) * 2 = 12.5MHz * (52 + 1) * 2 = 1325MHz And the output frequency is Fout = Fvco / 2^DIVQ = 1325MHz / 2^3 = 165.625Mhz This all adds up to the constrains of the PLL: 10MHz <= Fpfd <= 200MHz 20MHz <= Fout <= 1000MHz 1000MHz <= Fvco <= 2000MHz Fixes: 290deaa10c50 ("ARM: dts: add DT for lan966 SoC and 2-port board pcb8291") Signed-off-by: Michael Walle Reviewed-by: Kavyasree Kotagiri Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220326194028.2945985-1-michael@walle.cc commit ff6992735ade75aae3e35d16b17da1008d753d28 Author: Linus Torvalds Date: Sun Jul 17 13:30:22 2022 -0700 Linux 5.19-rc7 commit 55ea9bd666887ed4159df38d1494c204246cf2bc Merge: f7f4da303dd89 ced7866db39fc Author: Linus Torvalds Date: Sun Jul 17 13:08:03 2022 -0700 Merge tag 'drm-intel-fixes-2022-07-17' of git://anongit.freedesktop.org/drm/drm-intel Pull intel drm build fix from Rodrigo Vivi: "Our 'dim' flow has a problem with fixes of fixes getting missed. We need to take a look on that later. Meanwhile, please allow me to quickly propagate this fix for the 32-bit build issue here upstream" * tag 'drm-intel-fixes-2022-07-17' of git://anongit.freedesktop.org/drm/drm-intel: drm/i915/ttm: fix 32b build commit f7f4da303dd8946228860e78bd7f36c2cc47a636 Merge: 2b18593e4b9f5 4b335e1e0d6f8 Author: Linus Torvalds Date: Sun Jul 17 12:42:57 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.19-2022-07-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix SIGSEGV when processing syscall args in perf.data files in 'perf trace' - Sync kvm, msr-index and cpufeatures headers with the kernel sources - Fix 'convert perf time to TSC' 'perf test': - No need to open events twice - Fix finding correct event on hybrid systems * tag 'perf-tools-fixes-for-v5.19-2022-07-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf trace: Fix SIGSEGV when processing syscall args perf tests: Fix Convert perf time to TSC test for hybrid perf tests: Stop Convert perf time to TSC test opening events twice tools arch x86: Sync the msr-index.h copy with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources commit ced7866db39fc5c59ee05e154d4abc0977a17f6b Author: Matthew Auld Date: Tue Jul 12 18:40:50 2022 +0100 drm/i915/ttm: fix 32b build Since segment_pages is no longer a compile time constant, it looks the DIV_ROUND_UP(node->size, segment_pages) breaks the 32b build. Simplest is just to use the ULL variant, but really we should need not need more than u32 for the page alignment (also we are limited by that due to the sg->length type), so also make it all u32. Reported-by: Ville Syrjälä Fixes: aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction") Signed-off-by: Matthew Auld Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220712174050.592550-1-matthew.auld@intel.com (cherry picked from commit 9306b2b2dfce6931241ef804783692cee526599c) Signed-off-by: Rodrigo Vivi commit 2b18593e4b9f5781a7683fca256036515bd9b946 Merge: 59c80f053d504 68e3c69803dad Author: Linus Torvalds Date: Sun Jul 17 08:34:02 2022 -0700 Merge tag 'perf_urgent_for_v5.19_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - A single data race fix on the perf event cleanup path to avoid endless loops due to insufficient locking * tag 'perf_urgent_for_v5.19_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix data race between perf_event_set_output() and perf_mmap_close() commit 59c80f053d50467758c8284348b463fa820b1b1f Merge: 2eccaca7b62b2 bcf163150cd37 Author: Linus Torvalds Date: Sun Jul 17 08:27:30 2022 -0700 Merge tag 'x86_urgent_for_v5.19_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Improve the check whether the kernel supports WP mappings so that it can accomodate a XenPV guest due to how the latter is setting up the PAT machinery - Now that the retbleed nightmare is public, here's the first round of fallout fixes: * Fix a build failure on 32-bit due to missing include * Remove an untraining point in espfix64 return path * other small cleanups * tag 'x86_urgent_for_v5.19_rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/bugs: Remove apostrophe typo um: Add missing apply_returns() x86/entry: Remove UNTRAIN_RET from native_irq_return_ldt x86/bugs: Mark retbleed_strings static x86/pat: Fix x86_has_pat_wp() x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit commit 2eccaca7b62b2836260c6fb22156a44e3d99a74a Merge: 8ad4b6fa0f874 7329b07172964 Author: Linus Torvalds Date: Sun Jul 17 07:58:19 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fix from Bartosz Golaszewski: - fix a configfs attribute of the gpio-sim module * tag 'gpio-fixes-for-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: fix the chip_name configfs item commit 8ad4b6fa0f874ec8ec6e92a90116e3ab43cded6c Merge: 396df7005ba0f 2a96271fb66c4 Author: Linus Torvalds Date: Sun Jul 17 07:52:46 2022 -0700 Merge tag 'input-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - fix Goodix driver to properly behave on the Aya Neo Next - some more sanity checks in usbtouchscreen driver - a tweak in wm97xx driver in preparation for remove() to return void - a clarification in input core regarding units of measurement for resolution on touch events. * tag 'input-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: document the units for resolution of size axes Input: goodix - call acpi_device_fix_up_power() in some cases Input: wm97xx - make .remove() obviously always return 0 Input: usbtouchscreen - add driver_info sanity check commit 396df7005ba0f02646e96e05456a14b52e0f02f4 Merge: 972a278fe60c3 093d27bb6f2d1 Author: Linus Torvalds Date: Sun Jul 17 07:45:51 2022 -0700 Merge tag 'for-v5.19-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: - power-supply core temperature interpolation regression fix for incorrect boundaries - ab8500 needs to destroy its work queues in error paths - Fix old DT refcount leak in arm-versatile * tag 'for-v5.19-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: core: Fix boundary conditions in interpolation power/reset: arm-versatile: Fix refcount leak in versatile_reboot_probe power: supply: ab8500_fg: add missing destroy_workqueue in ab8500_fg_probe commit 4b335e1e0d6f8fa91dac615a44b123c9f26e93d3 Author: Naveen N. Rao Date: Thu Jul 7 14:39:00 2022 +0530 perf trace: Fix SIGSEGV when processing syscall args On powerpc, 'perf trace' is crashing with a SIGSEGV when trying to process a perf.data file created with 'perf trace record -p': #0 0x00000001225b8988 in syscall_arg__scnprintf_augmented_string at builtin-trace.c:1492 #1 syscall_arg__scnprintf_filename at builtin-trace.c:1492 #2 syscall_arg__scnprintf_filename at builtin-trace.c:1486 #3 0x00000001225bdd9c in syscall_arg_fmt__scnprintf_val at builtin-trace.c:1973 #4 syscall__scnprintf_args at builtin-trace.c:2041 #5 0x00000001225bff04 in trace__sys_enter at builtin-trace.c:2319 That points to the below code in tools/perf/builtin-trace.c: /* * If this is raw_syscalls.sys_enter, then it always comes with the 6 possible * arguments, even if the syscall being handled, say "openat", uses only 4 arguments * this breaks syscall__augmented_args() check for augmented args, as we calculate * syscall->args_size using each syscalls:sys_enter_NAME tracefs format file, * so when handling, say the openat syscall, we end up getting 6 args for the * raw_syscalls:sys_enter event, when we expected just 4, we end up mistakenly * thinking that the extra 2 u64 args are the augmented filename, so just check * here and avoid using augmented syscalls when the evsel is the raw_syscalls one. */ if (evsel != trace->syscalls.events.sys_enter) augmented_args = syscall__augmented_args(sc, sample, &augmented_args_size, trace->raw_augmented_syscalls_args_size); As the comment points out, we should not be trying to augment the args for raw_syscalls. However, when processing a perf.data file, we are not initializing those properly. Fix the same. Reported-by: Claudio Carvalho Signed-off-by: Naveen N. Rao Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220707090900.572584-1-naveen.n.rao@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit deb44a6249f696106645c63c0603eab08a6122af Author: Adrian Hunter Date: Wed Jul 13 15:34:59 2022 +0300 perf tests: Fix Convert perf time to TSC test for hybrid The test does not always correctly determine the number of events for hybrids, nor allow for more than 1 evsel when parsing. Fix by iterating the events actually created and getting the correct evsel for the events processed. Fixes: d9da6f70eb235110 ("perf tests: Support 'Convert perf time to TSC' test for hybrid") Reviewed-by: Kan Liang Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thomas Richter Link: https://lore.kernel.org/r/20220713123459.24145-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 498c7a54f169b2699104d3060604d840424f15d2 Author: Adrian Hunter Date: Wed Jul 13 15:34:58 2022 +0300 perf tests: Stop Convert perf time to TSC test opening events twice Do not call evlist__open() twice. Fixes: 5bb017d4b97a0f13 ("perf test: Fix error message for test case 71 on s390, where it is not supported") Reviewed-by: Kan Liang Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thomas Richter Link: https://lore.kernel.org/r/20220713123459.24145-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 91d248c3b903b46a58cbc7e8d38d684d3e4007c2 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:32:18 2021 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes from these csets: 4ad3278df6fe2b08 ("x86/speculation: Disable RRSBA behavior") d7caac991feeef1b ("x86/cpu/amd: Add Spectral Chicken") 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 at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Cc: Adrian Hunter Cc: Borislav Petkov Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Pawan Gupta Cc: Peter Zijlstra Link: https://lore.kernel.org/lkml/YtQTm9wsB3hxQWvy@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f098addbdb44c8a565367f5162f3ab170ed9404a Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: f43b9876e857c739 ("x86/retbleed: Add fine grained Kconfig knobs") a149180fbcf336e9 ("x86: Add magic AMD return-thunk") 15e67227c49a5783 ("x86: Undo return-thunk damage") 369ae6ffc41a3c11 ("x86/retpoline: Cleanup some #ifdefery") 4ad3278df6fe2b08 x86/speculation: Disable RRSBA behavior 26aae8ccbc197223 x86/cpu/amd: Enumerate BTC_NO 9756bba28470722d x86/speculation: Fill RSB on vmexit for IBRS 3ebc170068885b6f x86/bugs: Add retbleed=ibpb 2dbb887e875b1de3 x86/entry: Add kernel IBRS implementation 6b80b59b35557065 x86/bugs: Report AMD retbleed vulnerability a149180fbcf336e9 x86: Add magic AMD return-thunk 15e67227c49a5783 x86: Undo return-thunk damage a883d624aed463c8 x86/cpufeatures: Move RETPOLINE flags to word 11 51802186158c74a0 x86/speculation/mmio: Enumerate Processor MMIO Stale Data bug This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h' diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h Cc: Adrian Hunter Cc: Borislav Petkov Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra commit eee51fe38e372b89317f3950d2dc3e3ea7bace12 Author: Arnaldo Carvalho de Melo Date: Sun May 9 09:39:02 2021 -0300 tools headers UAPI: Sync linux/kvm.h with the kernel sources To pick the changes in: 1b870fa5573e260b ("kvm: stats: tell userspace which values are boolean") 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 is also by now used by tools/testing/selftests/kvm/, a simple test build succeeded. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/YtQLDvQrBhJNl3n5@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 972a278fe60c361eb8f37619f562f092e8786d7c Merge: c5fe7a97f20c7 088aea3b97e0a Author: Linus Torvalds Date: Sat Jul 16 13:48:55 2022 -0700 Merge tag 'for-5.19-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs reverts from David Sterba: "Due to a recent report [1] we need to revert the radix tree to xarray conversion patches. There's a problem with sleeping under spinlock, when xa_insert could allocate memory under pressure. We use GFP_NOFS so this is a real problem that we unfortunately did not discover during review. I'm sorry to do such change at rc6 time but the revert is IMO the safer option, there are patches to use mutex instead of the spin locks but that would need more testing. The revert branch has been tested on a few setups, all seem ok. The conversion to xarray will be revisited in the future" Link: https://lore.kernel.org/linux-btrfs/cover.1657097693.git.fdmanana@suse.com/ [1] * tag 'for-5.19-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Revert "btrfs: turn delayed_nodes_tree into an XArray" Revert "btrfs: turn name_cache radix tree into XArray in send_ctx" Revert "btrfs: turn fs_info member buffer_radix into XArray" Revert "btrfs: turn fs_roots_radix in btrfs_fs_info into an XArray" commit c5fe7a97f20c7f3070ac870144515c0fabc6b999 Merge: 6bca047ecd675 355bf2e036c95 Author: Linus Torvalds Date: Sat Jul 16 11:45:40 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Six small and reasonably obvious fixes, all in drivers" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: pm80xx: Set stopped phy's linkrate to Disabled scsi: pm80xx: Fix 'Unknown' max/min linkrate scsi: ufs: core: Fix missing clk change notification on host reset scsi: ufs: core: Drop loglevel of WriteBoost message scsi: megaraid: Clear READ queue map's nr_queues scsi: target: Fix WRITE_SAME No Data Buffer crash commit 6bca047ecd675325eca4bc0753ef91864954bd3d Merge: 9ed714dbd5746 957a2b345cbcf Author: Linus Torvalds Date: Sat Jul 16 11:40:10 2022 -0700 Merge tag 'block-5.19-2022-07-15' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Two NVMe fixes, and a regression fix for the core block layer from this merge window" * tag 'block-5.19-2022-07-15' of git://git.kernel.dk/linux-block: block: fix missing blkcg_bio_issue_init nvme: fix block device naming collision nvme-pci: fix freeze accounting for error handling commit 9ed714dbd574663c1fcb01dde07e949fe7473fa8 Merge: 8c91723ac9c60 3486af89dd3c0 Author: Linus Torvalds Date: Sat Jul 16 11:21:15 2022 -0700 Merge tag 'usb-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are some small USB driver fixes and new device ids for 5.19-rc7. They include: - new usb-serial driver ids - typec uevent fix - uvc gadget driver fix - dwc3 driver fixes - ehci-fsl driver fix All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: ftdi_sio: add Belimo device ids drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode. usb: gadget: uvc: fix changing interface name via configfs usb: typec: add missing uevent when partner support PD usb: dwc3-am62: remove unnecesary clk_put() usb: dwc3: gadget: Fix event pending check commit 8c91723ac9c60840e3a9819e5f767af3e7ca2660 Merge: c658cabbfd325 a501ab75e7624 Author: Linus Torvalds Date: Sat Jul 16 11:11:56 2022 -0700 Merge tag 'tty-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial driver fixes from Greg KH: "Here are some TTY and Serial driver fixes for 5.19-rc7. They resolve a number of reported problems including: - longtime bug in pty_write() that has been reported in the past. - 8250 driver fixes - new serial device ids - vt overlapping data copy bugfix - other tiny serial driver bugfixes All of these have been in linux-next for a while with no reported problems" * tag 'tty-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: use new tty_insert_flip_string_and_push_buffer() in pty_write() tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push() serial: 8250: dw: Fix the macro RZN1_UART_xDMACR_8_WORD_BURST vt: fix memory overlapping when deleting chars in the buffer serial: mvebu-uart: correctly report configured baudrate value serial: 8250: Fix PM usage_count for console handover serial: 8250: fix return error code in serial8250_request_std_resource() serial: stm32: Clear prev values before setting RTS delays tty: Add N_CAN327 line discipline ID for ELM327 based CAN driver serial: 8250: Fix __stop_tx() & DMA Tx restart races serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle tty: serial: samsung_tty: set dma burst_size to 1 serial: 8250: dw: enable using pdata with ACPI commit c658cabbfd32527060c2367f405bafb4e5815c6e Merge: ab6efe68a7367 2f23256c0ea20 Author: Linus Torvalds Date: Sat Jul 16 11:00:40 2022 -0700 Merge tag 's390-5.19-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix building of out-of-tree kernel modules without a pre-built kernel in case CONFIG_EXPOLINE_EXTERN=y. - Fix a reference counting error that could prevent unloading of zcrypt modules. * tag 's390-5.19-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/ap: fix error handling in __verify_queue_reservations() s390/nospec: remove unneeded header includes s390/nospec: build expoline.o for modules_prepare target commit ab6efe68a736748cf922a7641751583a3c783cb1 Merge: 16c957f089d52 5a5adb1528e59 Author: Linus Torvalds Date: Sat Jul 16 10:56:28 2022 -0700 Merge tag 'pm-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki "Fix recent regression in the cpufreq mediatek driver related to incorrect handling of regulator_get_optional() return value (AngeloGioacchino Del Regno)" * tag 'pm-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: mediatek: Handle sram regulator probe deferral commit 16c957f089d520893b0b08e06641329fbcec492d Merge: be9b7b6acfeae fbd74d16890b9 Author: Linus Torvalds Date: Sat Jul 16 10:52:41 2022 -0700 Merge tag 'acpi-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix more fallout from recent changes of the ACPI CPPC handling on AMD platforms (Mario Limonciello)" * tag 'acpi-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory commit be9b7b6acfeae47778f829d9d176ab1f9269593e Merge: 829d680e82a96 1ac8ec2731a5a Author: Linus Torvalds Date: Sat Jul 16 10:46:03 2022 -0700 Merge tag 'printk-for-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fix from Petr Mladek: - Make pr_flush() fast when consoles are suspended. * tag 'printk-for-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: do not wait for consoles when suspended commit 829d680e82a961c5370d9636130b43009ac36eb8 Author: Jason A. Donenfeld Date: Wed Jul 13 17:11:15 2022 +0200 random: cap jitter samples per bit to factor of HZ Currently the jitter mechanism will require two timer ticks per iteration, and it requires N iterations per bit. This N is determined with a small measurement, and if it's too big, it won't waste time with jitter entropy because it'd take too long or not have sufficient entropy anyway. With the current max N of 32, there are large timeouts on systems with a small CONFIG_HZ. Rather than set that maximum to 32, instead choose a factor of CONFIG_HZ. In this case, 1/30 seems to yield sane values for different configurations of CONFIG_HZ. Reported-by: Vladimir Murzin Fixes: 78c768e619fb ("random: vary jitter iterations based on cycle counter speed") Signed-off-by: Jason A. Donenfeld Tested-by: Vladimir Murzin Signed-off-by: Linus Torvalds commit 51a6fa0732d6be6a44e0032752ad2ac10d67c796 Author: Thadeu Lima de Souza Cascardo Date: Fri Jul 15 16:45:50 2022 -0300 efi/x86: use naked RET on mixed mode call wrapper When running with return thunks enabled under 32-bit EFI, the system crashes with: kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle page fault for address: 000000005bc02900 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0011) - permissions violation PGD 18f7063 P4D 18f7063 PUD 18ff063 PMD 190e063 PTE 800000005bc02063 Oops: 0011 [#1] PREEMPT SMP PTI CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.19.0-rc6+ #166 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:0x5bc02900 Code: Unable to access opcode bytes at RIP 0x5bc028d6. RSP: 0018:ffffffffb3203e10 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000048 RDX: 000000000190dfac RSI: 0000000000001710 RDI: 000000007eae823b RBP: ffffffffb3203e70 R08: 0000000001970000 R09: ffffffffb3203e28 R10: 747563657865206c R11: 6c6977203a696665 R12: 0000000000001710 R13: 0000000000000030 R14: 0000000001970000 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8e013ca00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0018 ES: 0018 CR0: 0000000080050033 CR2: 000000005bc02900 CR3: 0000000001930000 CR4: 00000000000006f0 Call Trace: ? efi_set_virtual_address_map+0x9c/0x175 efi_enter_virtual_mode+0x4a6/0x53e start_kernel+0x67c/0x71e x86_64_start_reservations+0x24/0x2a x86_64_start_kernel+0xe9/0xf4 secondary_startup_64_no_verify+0xe5/0xeb That's because it cannot jump to the return thunk from the 32-bit code. Using a naked RET and marking it as safe allows the system to proceed booting. Fixes: aa3d480315ba ("x86: Use return-thunk in asm code") Reported-by: Guenter Roeck Signed-off-by: Thadeu Lima de Souza Cascardo Cc: Peter Zijlstra (Intel) Cc: Borislav Petkov Cc: Josh Poimboeuf Cc: Tested-by: Guenter Roeck Signed-off-by: Linus Torvalds commit 4ca8ca873d454635c20d508261bfc0081af75cf8 Author: Robert Hancock Date: Tue Jun 14 17:29:19 2022 -0600 i2c: cadence: Change large transfer count reset logic to be unconditional Problems were observed on the Xilinx ZynqMP platform with large I2C reads. When a read of 277 bytes was performed, the controller NAKed the transfer after only 252 bytes were transferred and returned an ENXIO error on the transfer. There is some code in cdns_i2c_master_isr to handle this case by resetting the transfer count in the controller before it reaches 0, to allow larger transfers to work, but it was conditional on the CDNS_I2C_BROKEN_HOLD_BIT quirk being set on the controller, and ZynqMP uses the r1p14 version of the core where this quirk is not being set. The requirement to do this to support larger reads seems like an inherently required workaround due to the core only having an 8-bit transfer size register, so it does not appear that this should be conditional on the broken HOLD bit quirk which is used elsewhere in the driver. Remove the dependency on the CDNS_I2C_BROKEN_HOLD_BIT for this transfer size reset logic to fix this problem. Fixes: 63cab195bf49 ("i2c: removed work arounds in i2c driver for Zynq Ultrascale+ MPSoC") Signed-off-by: Robert Hancock Reviewed-by: Shubhrajyoti Datta Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 824a826e2e767ae1051a4c5c8ea44ec7a0c1dd26 Author: Flavio Suligoi Date: Fri Jul 15 15:42:18 2022 +0200 i2c: imx: fix typo in comment to provid --> to provide Signed-off-by: Flavio Suligoi Acked-by: Oleksij Rempel Signed-off-by: Wolfram Sang commit e1f77ecc75aaee6bed04e8fd7830e00032af012e Author: Vadim Pasternak Date: Wed Jul 13 12:14:05 2022 +0300 i2c: mlxcpld: Fix register setting for 400KHz frequency Fix setting of 'Half Cycle' register for 400KHz frequency. Fixes: fa1049135c15 ("i2c: mlxcpld: Modify register setting for 400KHz frequency") Signed-off-by: Vadim Pasternak Signed-off-by: Wolfram Sang commit bcf163150cd37348a0cb59e95c916a83a9344b0e Author: Kim Phillips Date: Fri Jul 8 16:21:28 2022 -0500 x86/bugs: Remove apostrophe typo Remove a superfluous ' in the mitigation string. Fixes: e8ec1b6e08a2 ("x86/bugs: Enable STIBP for JMP2RET") Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov commit 11052589cf5c0bab3b4884d423d5f60c38fcf25d Author: Kuniyuki Iwashima Date: Wed Jul 13 10:52:07 2022 -0700 tcp/udp: Make early_demux back namespacified. Commit e21145a9871a ("ipv4: namespacify ip_early_demux sysctl knob") made it possible to enable/disable early_demux on a per-netns basis. Then, we introduced two knobs, tcp_early_demux and udp_early_demux, to switch it for TCP/UDP in commit dddb64bcb346 ("net: Add sysctl to toggle early demux for tcp and udp"). However, the .proc_handler() was wrong and actually disabled us from changing the behaviour in each netns. We can execute early_demux if net.ipv4.ip_early_demux is on and each proto .early_demux() handler is not NULL. When we toggle (tcp|udp)_early_demux, the change itself is saved in each netns variable, but the .early_demux() handler is a global variable, so the handler is switched based on the init_net's sysctl variable. Thus, netns (tcp|udp)_early_demux knobs have nothing to do with the logic. Whether we CAN execute proto .early_demux() is always decided by init_net's sysctl knob, and whether we DO it or not is by each netns ip_early_demux knob. This patch namespacifies (tcp|udp)_early_demux again. For now, the users of the .early_demux() handler are TCP and UDP only, and they are called directly to avoid retpoline. So, we can remove the .early_demux() handler from inet6?_protos and need not dereference them in ip6?_rcv_finish_core(). If another proto needs .early_demux(), we can restore it at that time. Fixes: dddb64bcb346 ("net: Add sysctl to toggle early demux for tcp and udp") Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20220713175207.7727-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit df254d4508f96f298be8aff08da4d7e33d8584a0 Merge: a14bd7475452c 7c1ddcee5311f Author: Jakub Kicinski Date: Fri Jul 15 16:45:29 2022 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-07-14 This series contains updates to e1000e and igc drivers. Sasha re-enables GPT clock when exiting s0ix to prevent hardware unit hang and reverts a workaround for this issue on e1000e. Lennert Buytenhek restores checks for removed device while accessing registers to prevent NULL pointer dereferences for igc. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: Reinstate IGC_REMOVED logic and implement it properly Revert "e1000e: Fix possible HW unit hang after an s0ix exit" e1000e: Enable GPT clock before sending message to CSME ==================== Link: https://lore.kernel.org/r/20220714175857.933537-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit a14bd7475452c51835dd5a0cee4c8fa48dd0b539 Author: Liang He Date: Thu Jul 14 23:31:38 2022 +0800 net: dsa: microchip: ksz_common: Fix refcount leak bug In ksz_switch_register(), we should call of_node_put() for the reference returned by of_get_child_by_name() which has increased the refcount. Fixes: 912aae27c6af ("net: dsa: microchip: really look for phy-mode in port nodes") Signed-off-by: Liang He Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220714153138.375919-1-windhl@126.com Signed-off-by: Jakub Kicinski commit 9b59ec8d50a1f28747ceff9a4f39af5deba9540e Merge: a8ebfcd33caf2 7fccd72391270 Author: Linus Torvalds Date: Fri Jul 15 10:40:50 2022 -0700 Merge tag 'riscv-for-linus-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix to avoid printing a warning when modules do not exercise any errata-dependent behavior and the SiFive errata are enabled. - A fix to the Microchip PFSOC to attach the L2 cache to the CPU nodes. * tag 'riscv-for-linus-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: don't warn for sifive erratas in modules riscv: dts: microchip: hook up the mpfs' l2cache commit a8ebfcd33caf29592957229c8350f67b48b8efce Merge: 1ce9d792e8ef2 79629181607e8 Author: Linus Torvalds Date: Fri Jul 15 10:31:46 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM fixes from Paolo Bonzini: "RISC-V: - Fix missing PAGE_PFN_MASK - Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests() x86: - Fix for nested virtualization when TSC scaling is active - Estimate the size of fastcc subroutines conservatively, avoiding disastrous underestimation when return thunks are enabled - Avoid possible use of uninitialized fields of 'struct kvm_lapic_irq' Generic: - Mark as such the boolean values available from the statistics file descriptors - Clarify statistics documentation" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: emulate: do not adjust size of fastop and setcc subroutines KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op() Documentation: kvm: clarify histogram units kvm: stats: tell userspace which values are boolean x86/kvm: fix FASTOP_SIZE when return thunks are enabled KVM: nVMX: Always enable TSC scaling for L2 when it was enabled for L1 RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests() riscv: Fix missing PAGE_PFN_MASK commit 1ce9d792e8ef286ed03b151b9bdfcd921e04a988 Merge: 8006112d6c413 fac47b43c760e Author: Linus Torvalds Date: Fri Jul 15 10:27:28 2022 -0700 Merge tag 'ceph-for-5.19-rc7' of https://github.com/ceph/ceph-client Pull ceph fix from Ilya Dryomov: "A folio locking fixup that Xiubo and David cooperated on, marked for stable. Most of it is in netfs but I picked it up into ceph tree on agreement with David" * tag 'ceph-for-5.19-rc7' of https://github.com/ceph/ceph-client: netfs: do not unlock and put the folio twice commit 8006112d6c4137bc48ca723261198c63d9e6d38a Merge: 1c49f281c9b78 73d5fe0462702 Author: Linus Torvalds Date: Fri Jul 15 10:23:43 2022 -0700 Merge tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few driver specific fixes, none especially remarkable, plus a MAINTAINERS file update due to the previous maintainer for the NXP FSPI driver having left the company" * tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: cadence-quadspi: Remove spi_master_put() in probe failure path MAINTAINERS: change the NXP FSPI driver maintainer. spi: amd: Limit max transfer and message size spi: aspeed: Fix division by zero spi: aspeed: Add dev_dbg() to dump the spi-mem direct mapping descriptor commit 1c49f281c9b78da9c0f0d7a8965c26fb46e71a53 Merge: 2a347a06ebb1b d332a1f6b4c4b Author: Linus Torvalds Date: Fri Jul 15 10:16:44 2022 -0700 Merge tag 'soc-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Most of the contents are bugfixes for the devicetree files: - A Qualcomm MSM8974 pin controller regression, caused by a cleanup patch that gets partially reverted here. - Missing properties for Broadcom BCM49xx to fix timer detection and SMP boot. - Fix touchscreen pinctrl for imx6ull-colibri board - Multiple fixes for Rockchip rk3399 based machines including the vdu clock-rate fix, otg port fix on Quartz64-A and ethernet on Quartz64-B - Fixes for misspelled DT contents causing minor problems on imx6qdl-ts7970m, orangepi-zero, sama5d2, kontron-kswitch-d10, and ls1028a And a couple of changes elsewhere: - Fix binding for Allwinner D1 display pipeline - Trivial code fixes to the TEE and reset controller driver subsystems and the rockchip platform code. - Multiple updates to the MAINTAINERS files, marking the Palm Treo support as orphaned, and fixing some entries for added or changed file names" * tag 'soc-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (21 commits) arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero ARM: dts: at91: sama5d2: Fix typo in i2s1 node tee: tee_get_drvdata(): fix description of return value optee: Remove duplicate 'of' in two places. ARM: dts: kswitch-d10: use open drain mode for coma-mode pins ARM: dts: colibri-imx6ull: fix snvs pinmux group optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR() MAINTAINERS: add polarfire rng, pci and clock drivers MAINTAINERS: mark ARM/PALM TREO SUPPORT orphan ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count arm64: dts: ls1028a: Update SFP node to include clock dt-bindings: display: sun4i: Fix D1 pipeline count ARM: dts: qcom: msm8974: re-add missing pinctrl reset: Fix devm bulk optional exclusive control getter MAINTAINERS: rectify entry for SYNOPSYS AXS10x RESET CONTROLLER DRIVER ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init() arm64: dts: rockchip: Assign RK3399 VDU clock rate arm64: dts: rockchip: Fix Quartz64-A dwc3 otg port behavior ... commit 088aea3b97e0ae5a2a86f5d142ad10fec8a1b80f Author: David Sterba Date: Fri Jul 15 13:59:45 2022 +0200 Revert "btrfs: turn delayed_nodes_tree into an XArray" This reverts commit 253bf57555e451dec5a7f09dc95d380ce8b10e5b. Revert the xarray conversion, there's a problem with potential sleep-inside-spinlock [1] when calling xa_insert that triggers GFP_NOFS allocation. The radix tree used the preloading mechanism to avoid sleeping but this is not available in xarray. Conversion from spin lock to mutex is possible but at time of rc6 is riskier than a clean revert. [1] https://lore.kernel.org/linux-btrfs/cover.1657097693.git.fdmanana@suse.com/ Reported-by: Filipe Manana Signed-off-by: David Sterba commit 5b8418b84303d9a0a0f7f28d6eaed915247ebdc3 Author: David Sterba Date: Fri Jul 15 13:59:38 2022 +0200 Revert "btrfs: turn name_cache radix tree into XArray in send_ctx" This reverts commit 4076942021fe14efecae33bf98566df6dd5ae6f7. Revert the xarray conversion, there's a problem with potential sleep-inside-spinlock [1] when calling xa_insert that triggers GFP_NOFS allocation. The radix tree used the preloading mechanism to avoid sleeping but this is not available in xarray. Conversion from spin lock to mutex is possible but at time of rc6 is riskier than a clean revert. [1] https://lore.kernel.org/linux-btrfs/cover.1657097693.git.fdmanana@suse.com/ Reported-by: Filipe Manana Signed-off-by: David Sterba commit 01cd390903e00c8f42ba0e84f25a70e3d613a15c Author: David Sterba Date: Fri Jul 15 13:59:31 2022 +0200 Revert "btrfs: turn fs_info member buffer_radix into XArray" This reverts commit 8ee922689d67b7cfa6acbe2aa1ee76ac72e6fc8a. Revert the xarray conversion, there's a problem with potential sleep-inside-spinlock [1] when calling xa_insert that triggers GFP_NOFS allocation. The radix tree used the preloading mechanism to avoid sleeping but this is not available in xarray. Conversion from spin lock to mutex is possible but at time of rc6 is riskier than a clean revert. [1] https://lore.kernel.org/linux-btrfs/cover.1657097693.git.fdmanana@suse.com/ Reported-by: Filipe Manana Signed-off-by: David Sterba commit fc7cbcd4890e297de5d6487e04344a99b39de9be Author: David Sterba Date: Fri Jul 15 13:59:21 2022 +0200 Revert "btrfs: turn fs_roots_radix in btrfs_fs_info into an XArray" This reverts commit 48b36a602a335c184505346b5b37077840660634. Revert the xarray conversion, there's a problem with potential sleep-inside-spinlock [1] when calling xa_insert that triggers GFP_NOFS allocation. The radix tree used the preloading mechanism to avoid sleeping but this is not available in xarray. Conversion from spin lock to mutex is possible but at time of rc6 is riskier than a clean revert. [1] https://lore.kernel.org/linux-btrfs/cover.1657097693.git.fdmanana@suse.com/ Reported-by: Filipe Manana Signed-off-by: David Sterba commit 2a347a06ebb1b186a5cb919c9f5ab6e040554be7 Merge: 339f74e38f53c 5ad26161a371e Author: Linus Torvalds Date: Fri Jul 15 10:12:22 2022 -0700 Merge tag 'platform-drivers-x86-v5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Highlights: - Fix brightness key events getting reported twice on some Dells. Regression caused by recent Panasonic hotkey fixes - Fix poweroff no longer working on some devices regression caused by recent poweroff handler rework - Mark new (in 5.19) Intel IFS driver as broken, because of some issues surrounding the userspace (sysfs) API which need to be cleared up - Some hardware-id / quirk additions" * tag 'platform-drivers-x86-v5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: ACPI: video: Fix acpi_video_handles_brightness_key_presses() platform/x86: intel_atomisp2_led: Also turn off the always-on camera LED on the Asus T100TAF platform/x86/intel/ifs: Mark as BROKEN platform/x86: asus-wmi: Add key mappings efi: Fix efi_power_off() not being run before acpi_power_off() when necessary platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again platform/x86: gigabyte-wmi: add support for B660I AORUS PRO DDR4 platform/x86/amd/pmc: Add new platform support platform/x86/amd/pmc: Add new acpi id for PMC controller commit 339f74e38f53c83b5715abd28f7002b66731d917 Merge: fcd1b2b9c7b08 166d386323166 Author: Linus Torvalds Date: Fri Jul 15 10:00:49 2022 -0700 Merge tag 'for-linus-5.19a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fix from Juergen Gross: "Fix for the Xen gntdev driver causing inappropriate WARN() messages" * tag 'for-linus-5.19a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE commit fcd1b2b9c7b085e9c200f73c079b322eb8c666f9 Merge: 862161e8af0db 093f8d8f10aa2 Author: Linus Torvalds Date: Fri Jul 15 09:56:24 2022 -0700 Merge tag 'drm-fixes-2022-07-15' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "This is the regular fixes pull for this week. This has a bunch of amdgpu fixes, major one reverts the buddy allocator until it can be tested more, otherwise just small ones, then i915 has a bunch of fixes. The outstanding firmware regressions reported by phoronix will hopefully be dealt with ASAP. amdgpu: - revert buddy allocator support for now - DP MST blank screen fix for specific platforms - MEC firmware check fix for GC 10.3.7 - Deep color fix for DCE - Fix possible divide by 0 - Coverage blend mode fix - Fix cursor only commit timestamps i915: - Selftest fix - TTM fix sg_table construction - Error return fixes - Fix a performance regression related to waitboost - Fix GT resets" * tag 'drm-fixes-2022-07-15' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Ensure valid event timestamp for cursor-only commits drm/amd/display: correct check of coverage blend mode drm/amd/pm: Prevent divide by zero drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines. drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7 drm/amd/display: Ignore First MST Sideband Message Return Error drm/i915/selftests: fix subtraction overflow bug drm/i915/gem: Look for waitboosting across the whole object prior to individual waits drm/i915/gt: Serialize TLB invalidates with GT resets drm/i915/gt: Serialize GRDOM access between multiple engine resets drm/i915/ttm: fix sg_table construction drm/i915/selftests: fix a couple IS_ERR() vs NULL tests drm/i915: Fix vm use-after-free in vma destruction drm/i915/guc: ADL-N should use the same GuC FW as ADL-S drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector() drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist() Revert "drm/amdgpu: add drm buddy support to amdgpu" commit 862161e8af0db1b725c6ad5fd93aa636125f3db5 Merge: e5d523f1ae8f2 43b5240ca6b33 Author: Linus Torvalds Date: Fri Jul 15 09:52:35 2022 -0700 Merge tag 'sysctl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pyll sysctl fix from Luis Chamberlain: "Only one fix for sysctl" * tag 'sysctl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE commit 0fddf9ad06fd9f439f137139861556671673e31c Author: Sascha Hauer Date: Fri Jul 1 13:03:41 2022 +0200 mtd: rawnand: gpmi: Set WAIT_FOR_READY timeout based on program/erase times 06781a5026350 Fixes the calculation of the DEVICE_BUSY_TIMEOUT register value from busy_timeout_cycles. busy_timeout_cycles is calculated wrong though: It is calculated based on the maximum page read time, but the timeout is also used for page write and block erase operations which require orders of magnitude bigger timeouts. Fix this by calculating busy_timeout_cycles from the maximum of tBERS_max and tPROG_max. This is for now the easiest and most obvious way to fix the driver. There's room for improvements though: The NAND_OP_WAITRDY_INSTR tells us the desired timeout for the current operation, so we could program the timeout dynamically for each operation instead of setting a fixed timeout. Also we could wire up the interrupt handler to actually detect and forward timeouts occurred when waiting for the chip being ready. As a sidenote I verified that the change in 06781a5026350 is really correct. I wired up the interrupt handler in my tree and measured the time between starting the operation and the timeout interrupt handler coming in. The time increases 41us with each step in the timeout register which corresponds to 4096 clock cycles with the 99MHz clock that I have. Fixes: 06781a5026350 ("mtd: rawnand: gpmi: Fix setting busy timeout setting") Fixes: b1206122069aa ("mtd: rawniand: gpmi: use core timings instead of an empirical derivation") Cc: stable@vger.kernel.org Signed-off-by: Sascha Hauer Acked-by: Han Xu Tested-by: Tomasz Moń Signed-off-by: Richard Weinberger commit 1ac8ec2731a5ae0f283d103873be7b945ba97e90 Merge: 51889d225ce2c 9023ca0866250 Author: Petr Mladek Date: Fri Jul 15 16:43:42 2022 +0200 Merge branch 'rework/kthreads' into for-linus commit 9b04369b060fd4885f728b7a4ab4851ffb1abb64 Author: Dmitry Osipenko Date: Tue Apr 12 01:15:36 2022 +0300 drm/scheduler: Don't kill jobs in interrupt context Interrupt context can't sleep. Drivers like Panfrost and MSM are taking mutex when job is released, and thus, that code can sleep. This results into "BUG: scheduling while atomic" if locks are contented while job is freed. There is no good reason for releasing scheduler's jobs in IRQ context, hence use normal context to fix the trouble. Cc: stable@vger.kernel.org Fixes: 542cff7893a3 ("drm/sched: Avoid lockdep spalt on killing a processes") Signed-off-by: Dmitry Osipenko Signed-off-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220411221536.283312-1-dmitry.osipenko@collabora.com commit 2d4bd81fea1ad6ebba543bd6da3ef5179d130e6a Author: Stylon Wang Date: Thu Jul 7 16:23:29 2022 +0800 drm/amd/display: Fix new dmub notification enabling in DM [Why] Changes from "Fix for dmub outbox notification enable" need to land in DM or DMUB outbox notification would be disabled. [How] Enable outbox notification only after interrupt are enabled and IRQ handlers registered. Any pending notification will be sent by DMUB once outbox notification is enabled. Fixes: ed7208706448 ("drm/amd/display: Fix for dmub outbox notification enable") Reviewed-by: Nicholas Kazlauskas Acked-by: Solomon Chiu Signed-off-by: Stylon Wang Acked-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5a5adb1528e59e8a4b23ffa7dda4849b61e97cf8 Merge: 32346491ddf24 d2394860b45c3 Author: Rafael J. Wysocki Date: Fri Jul 15 13:54:14 2022 +0200 Merge tag 'cpufreq-arm-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull a cpufreq ARM fix for 5.19-rc7 from Viresh Kumar: - mediatek: Handle sram regulator probe deferral * tag 'cpufreq-arm-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: mediatek: Handle sram regulator probe deferral commit 79629181607e801c0b41b8790ac4ee2eb5d7bc3e Author: Paolo Bonzini Date: Fri Jul 15 07:34:55 2022 -0400 KVM: emulate: do not adjust size of fastop and setcc subroutines Instead of doing complicated calculations to find the size of the subroutines (which are even more complicated because they need to be stringified into an asm statement), just hardcode to 16. It is less dense for a few combinations of IBT/SLS/retbleed, but it has the advantage of being really simple. Cc: stable@vger.kernel.org # 5.15.x: 84e7051c0bc1: x86/kvm: fix FASTOP_SIZE when return thunks are enabled Cc: stable@vger.kernel.org Suggested-by: Linus Torvalds Signed-off-by: Paolo Bonzini commit 8f3184b951164131a8b35770f225082cc02008be Merge: 782d86fe44e38 f4c7d8948e866 Author: David S. Miller Date: Fri Jul 15 12:06:56 2022 +0100 Merge branch 'stmmac-dwmac-mediatec-clock-fix' Biao Huang says: ==================== stmmac: dwmac-mediatek: fix clock issue changes in v5: 1. add reivewd-by as Matthias's comments. 2. fix "warning: unused variable 'ret' [-Wunused-variable]" as Jakub's comments changes in v4: 1. improve commit message and test ko insertion/remove as Matthias's comments. 2. add patch "net: stmmac: fix pm runtime issue in stmmac_dvr_remove()" to fix vlan filter deletion issue. 3. add patch "net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow" to fix unbalanced ptp clock issue in suspend/resume flow. changes in v3: 1. delete mediatek_dwmac_exit() since there is no operation in it, as Matthias's comments. changes in v2: 1. clock configuration is still needed in probe, and invoke mediatek_dwmac_clks_config() instead. 2. update commit message. v1: remove duplicated clock configuration in init/exit. ==================== Signed-off-by: David S. Miller commit f4c7d8948e866918d61493264dbbd67e45ef2bda Author: Biao Huang Date: Thu Jul 14 14:00:14 2022 +0800 net: stmmac: fix unbalanced ptp clock issue in suspend/resume flow Current stmmac driver will prepare/enable ptp_ref clock in stmmac_init_tstamp_counter(). The stmmac_pltfr_noirq_suspend will disable it once in suspend flow. But in resume flow, stmmac_pltfr_noirq_resume --> stmmac_init_tstamp_counter stmmac_resume --> stmmac_hw_setup --> stmmac_init_ptp --> stmmac_init_tstamp_counter ptp_ref clock reference counter increases twice, which leads to unbalance ptp clock when resume back. Move ptp_ref clock prepare/enable out of stmmac_init_tstamp_counter to fix it. Fixes: 0735e639f129d ("net: stmmac: skip only stmmac_ptp_register when resume from suspend") Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit 0d9a15913b871e03fdd3b3d90a2e665fb22f9bcf Author: Biao Huang Date: Thu Jul 14 14:00:13 2022 +0800 net: stmmac: fix pm runtime issue in stmmac_dvr_remove() If netif is running when stmmac_dvr_remove is invoked, the unregister_netdev will call ndo_stop(stmmac_release) and vlan_kill_rx_filter(stmmac_vlan_rx_kill_vid). Currently, stmmac_dvr_remove() will disable pm runtime before unregister_netdev. When stmmac_vlan_rx_kill_vid is invoked, pm_runtime_resume_and_get in it returns EACCESS error number, and reports: dwmac-mediatek 11021000.ethernet eth0: stmmac_dvr_remove: removing driver dwmac-mediatek 11021000.ethernet eth0: FPE workqueue stop dwmac-mediatek 11021000.ethernet eth0: failed to kill vid 0081/0 Move the pm_runtime_disable to the end of stmmac_dvr_remove to fix this issue. Fixes: 6449520391dfc ("net: stmmac: properly handle with runtime pm in stmmac_dvr_remove()") Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit fa4b3ca60e8011d3046765b3de8d3f1ffc53af28 Author: Biao Huang Date: Thu Jul 14 14:00:12 2022 +0800 stmmac: dwmac-mediatek: fix clock issue The pm_runtime takes care of the clock handling in current stmmac drivers, and dwmac-mediatek implement the mediatek_dwmac_clks_config() as the callback for pm_runtime. Then, stripping duplicated clocks handling in old init()/exit() to fix clock issue in suspend/resume test. As to clocks in probe/remove, vendor need symmetric handling to ensure clocks balance. Test pass, including suspend/resume and ko insertion/remove. Fixes: 3186bdad97d5 ("stmmac: dwmac-mediatek: add platform level clocks management") Signed-off-by: Biao Huang Reviewed-by: Matthias Brugger Signed-off-by: David S. Miller commit 782d86fe44e38c0a02e92042fff2ce417d62c61a Merge: db886979683a8 2a85388f1d94a Author: David S. Miller Date: Fri Jul 15 11:49:56 2022 +0100 Merge branch 'net-sysctl-races-round2' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Round 2). This series fixes data-races around 15 knobs after ip_default_ttl in ipv4_net_table. These two knobs are skipped. - ip_local_port_range is safe with its own lock. - ip_local_reserved_ports uses proc_do_large_bitmap(), which will need an additional lock and can be fixed later. So, the next round will start with igmp_link_local_mcast_reports. ==================== Signed-off-by: David S. Miller commit 2a85388f1d94a9f8b5a529118a2c5eaa0520d85c Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:05 2022 -0700 tcp: Fix a data-race around sysctl_tcp_probe_interval. While reading sysctl_tcp_probe_interval, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 05cbc0db03e8 ("ipv4: Create probe timer for tcp PMTU as per RFC4821") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 92c0aa4175474483d6cf373314343d4e624e882a Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:04 2022 -0700 tcp: Fix a data-race around sysctl_tcp_probe_threshold. While reading sysctl_tcp_probe_threshold, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 6b58e0a5f32d ("ipv4: Use binary search to choose tcp PMTU probe_size") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8e92d4423615a5257d0d871fc067aa561f597deb Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:03 2022 -0700 tcp: Fix a data-race around sysctl_tcp_mtu_probe_floor. While reading sysctl_tcp_mtu_probe_floor, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: c04b79b6cfd7 ("tcp: add new tcp_mtu_probe_floor sysctl") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 78eb166cdefcc3221c8c7c1e2d514e91a2eb5014 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:02 2022 -0700 tcp: Fix data-races around sysctl_tcp_min_snd_mss. While reading sysctl_tcp_min_snd_mss, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 5f3e2bf008c2 ("tcp: add tcp_min_snd_mss sysctl") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 88d78bc097cd8ebc6541e93316c9d9bf651b13e8 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:01 2022 -0700 tcp: Fix data-races around sysctl_tcp_base_mss. While reading sysctl_tcp_base_mss, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 5d424d5a674f ("[TCP]: MTU probing") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit f47d00e077e7d61baf69e46dde3210c886360207 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:52:00 2022 -0700 tcp: Fix data-races around sysctl_tcp_mtu_probing. While reading sysctl_tcp_mtu_probing, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 5d424d5a674f ("[TCP]: MTU probing") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 08a75f10679470552a3a443f9aefd1399604d31d Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:59 2022 -0700 tcp: Fix data-races around sysctl_tcp_l3mdev_accept. While reading sysctl_tcp_l3mdev_accept, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 6dd9a14e92e5 ("net: Allow accepted sockets to be bound to l3mdev domain") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1a0008f9df59451d0a17806c1ee1a19857032fa8 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:58 2022 -0700 tcp/dccp: Fix a data-race around sysctl_tcp_fwmark_accept. While reading sysctl_tcp_fwmark_accept, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 84f39b08d786 ("net: support marking accepting TCP sockets") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 85d0b4dbd74b95cc492b1f4e34497d3f894f5d9a Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:57 2022 -0700 ip: Fix a data-race around sysctl_fwmark_reflect. While reading sysctl_fwmark_reflect, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: e110861f8609 ("net: add a sysctl to reflect the fwmark on replies") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 0db232765887d9807df8bcb7b6f29b2871539eab Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:56 2022 -0700 ip: Fix a data-race around sysctl_ip_autobind_reuse. While reading sysctl_ip_autobind_reuse, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 4b01a9674231 ("tcp: bind(0) remove the SO_REUSEADDR restriction when ephemeral ports are exhausted.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 289d3b21fb0bfc94c4e98f10635bba1824e5f83c Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:55 2022 -0700 ip: Fix data-races around sysctl_ip_nonlocal_bind. While reading sysctl_ip_nonlocal_bind, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 7bf9e18d9a5e99e3c83482973557e9f047b051e7 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:54 2022 -0700 ip: Fix data-races around sysctl_ip_fwd_update_priority. While reading sysctl_ip_fwd_update_priority, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 432e05d32892 ("net: ipv4: Control SKB reprioritization after forwarding") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 60c158dc7b1f0558f6cadd5b50d0386da0000d50 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:53 2022 -0700 ip: Fix data-races around sysctl_ip_fwd_use_pmtu. While reading sysctl_ip_fwd_use_pmtu, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: f87c10a8aa1e ("ipv4: introduce ip_dst_mtu_maybe_forward and protect forwarding path against pmtu spoofing") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 0968d2a441bf6afb551fd99e60fa65ed67068963 Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:52 2022 -0700 ip: Fix data-races around sysctl_ip_no_pmtu_disc. While reading sysctl_ip_no_pmtu_disc, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8281b7ec5c56b71cb2cc5a1728b41607be66959c Author: Kuniyuki Iwashima Date: Wed Jul 13 13:51:51 2022 -0700 ip: Fix data-races around sysctl_ip_default_ttl. While reading sysctl_ip_default_ttl, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit cf33ce6f0c220fbfe5dafcb08d4c5655097a5fa4 Merge: 9b043a8f38648 1e347f861da8d Author: Takashi Iwai Date: Fri Jul 15 12:31:07 2022 +0200 Merge tag 'asoc-fix-v5.19-rc4-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Drop Rockchip BCLK management for v5.19 As covered in the second revert commit in this pull request the version of the BCLK muxing that's in v5.19 is causing issues, let's just revert it and wait for the more complete support in v5.20 instead. commit 9023ca0866250d268b047f21e1392e7a81277a54 Author: John Ogness Date: Fri Jul 15 08:16:42 2022 +0206 printk: do not wait for consoles when suspended The console_stop() and console_start() functions call pr_flush(). When suspending, these functions are called by the serial subsystem while the serial port is suspended. In this scenario, if there are any pending messages, a call to pr_flush() will always result in a timeout because the serial port cannot make forward progress. This causes longer suspend and resume times. Add a check in pr_flush() so that it will immediately timeout if the consoles are suspended. Fixes: 3b604ca81202 ("printk: add pr_flush()") Reported-by: Todd Brandt Signed-off-by: John Ogness Tested-by: Todd Brandt Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220715061042.373640-2-john.ogness@linutronix.de commit 2f23256c0ea20627c91ea2d468cda945f68c3395 Author: Tony Krowiak Date: Wed Jul 6 17:43:29 2022 -0400 s390/ap: fix error handling in __verify_queue_reservations() The AP bus's __verify_queue_reservations function increments the ref count for the device driver passed in as a parameter, but fails to decrement it before returning control to the caller. This will prevents any subsequent removal of the module. Signed-off-by: Tony Krowiak Reported-by: Tony Krowiak Reviewed-by: Harald Freudenberger Fixes: 4f8206b88286 ("s390/ap: driver callback to indicate resource in use") Link: https://lore.kernel.org/r/20220706222619.602094-1-akrowiak@linux.ibm.com Cc: stable@vger.kernel.org [agordeev@linux.ibm.com fixed description, added Fixes and Link] Signed-off-by: Alexander Gordeev commit 093f8d8f10aa22935bc8bf7100700f714ebaba9c Merge: 5bde069b30503 3283c83eb6fcf Author: Dave Airlie Date: Fri Jul 15 11:26:20 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-07-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-07-13: amdgpu: - DP MST blank screen fix for specific platforms - MEC firmware check fix for GC 10.3.7 - Deep color fix for DCE - Fix possible divide by 0 - Coverage blend mode fix - Fix cursor only commit timestamps Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220713172920.6037-1-alexander.deucher@amd.com commit 5bde069b305037f9a0beb95094e047d45de9a249 Merge: b1f4347f732f8 333991c4e66b3 Author: Dave Airlie Date: Fri Jul 15 09:27:05 2022 +1000 Merge tag 'drm-intel-fixes-2022-07-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Selftest fix (Andrzej) - TTM fix sg_table construction (Matt Auld) - Error return fixes (Dan) - Fix a performance regression related to waitboost (Chris) - Fix GT resets (Chris) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/Ys87yMujcG2sJC1R@intel.com commit b1f4347f732f84c7ef77467a20edc893e9ec5f92 Merge: 3590b44b9434a 925b6e59138ce Author: Dave Airlie Date: Fri Jul 15 09:26:00 2022 +1000 Merge tag 'drm-misc-fixes-2022-07-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Only a revert for amdgpu reverting the switch to the drm buddy allocator. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220714071821.hsejxpsgkbbzlec2@houat commit e5d523f1ae8f2cef01f8e071aeee432654166708 Author: Nick Desaulniers Date: Thu Jul 14 13:56:43 2022 -0700 ubsan: disable UBSAN_DIV_ZERO for clang Building with UBSAN_DIV_ZERO with clang produces numerous fallthrough warnings from objtool. In the case of uncheck division, UBSAN_DIV_ZERO may introduce new control flow to check for division by zero. Because the result of the division is undefined, LLVM may optimize the control flow such that after the call to __ubsan_handle_divrem_overflow doesn't matter. If panic_on_warn was set, __ubsan_handle_divrem_overflow would panic. The problem is is that panic_on_warn is run time configurable. If it's disabled, then we cannot guarantee that we will be able to recover safely. Disable this config for clang until we can come up with a solution in LLVM. Link: https://github.com/ClangBuiltLinux/linux/issues/1657 Link: https://github.com/llvm/llvm-project/issues/56289 Link: https://lore.kernel.org/lkml/CAHk-=wj1qhf7y3VNACEexyp5EbkNpdcu_542k-xZpzmYLOjiCg@mail.gmail.com/ Reported-by: Sudip Mukherjee Suggested-by: Linus Torvalds Signed-off-by: Nick Desaulniers Acked-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit b926f2adb0442090351dc8321ec1f99b22e372da Author: Linus Torvalds Date: Thu Jul 14 15:35:24 2022 -0700 Revert "vf/remap: return the amount of bytes actually deduplicated" This reverts commit 4a57a8400075bc5287c5c877702c68aeae2a033d. Dave Chinner reports: "As I suspected would occur, this change causes test failures. e.g generic/517 in fstests fails with: generic/517 1s ... - output mismatch [..] -deduped 131172/131172 bytes at offset 65536 +deduped 131072/131172 bytes at offset 65536" can you please revert this commit for the 5.19 series to give us more time to investigate and consider the impact of the the API change on userspace applications before we commit to changing the API" That changed return value seems to reflect reality, but with the fstest change, let's revert for now. Requested-by: Dave Chinner Link: https://lore.kernel.org/all/20220714223238.GH3600936@dread.disaster.area/ Cc: Ansgar Lößer Signed-off-by: Linus Torvalds commit db886979683a8360ced9b24ab1125ad0c4d2cf76 Author: Nathan Chancellor Date: Wed Jul 13 08:24:37 2022 -0700 x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current Clang warns: arch/x86/kernel/cpu/bugs.c:58:21: error: section attribute is specified on redeclared variable [-Werror,-Wsection] DEFINE_PER_CPU(u64, x86_spec_ctrl_current); ^ arch/x86/include/asm/nospec-branch.h:283:12: note: previous declaration is here extern u64 x86_spec_ctrl_current; ^ 1 error generated. The declaration should be using DECLARE_PER_CPU instead so all attributes stay in sync. Cc: stable@vger.kernel.org Fixes: fc02735b14ff ("KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 89551fdd44a272ac88258b231b07e5644fd2b2e7 Author: Krzysztof Kozlowski Date: Fri Jun 24 19:08:11 2022 +0200 riscv: dts: align gpio-key node names with dtschema The node names should be generic and DT schema expects certain pattern (e.g. with key/button/switch). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220624170811.66395-1-krzysztof.kozlowski@linaro.org Link: https://lore.kernel.org/all/20220616005224.18391-1-krzysztof.kozlowski@linaro.org/ Signed-off-by: Palmer Dabbelt commit 3a66a087599483612a6e6a4970ec403e61c30821 Author: Li Zhengyu Date: Wed Jun 1 15:02:04 2022 +0800 RISC-V: kexec: Fix build error without CONFIG_KEXEC When CONFIG_KEXEC_FILE=y but CONFIG_KEXEC is not set: kernel/kexec_core.o: In function `kimage_free': kexec_core.c:(.text+0xa0c): undefined reference to `machine_kexec_cleanup' kernel/kexec_core.o: In function `.L0 ': kexec_core.c:(.text+0xde8): undefined reference to `machine_crash_shutdown' kexec_core.c:(.text+0xdf4): undefined reference to `machine_kexec' kernel/kexec_core.o: In function `.L231': kexec_core.c:(.text+0xe1c): undefined reference to `riscv_crash_save_regs' kernel/kexec_core.o: In function `.L0 ': kexec_core.c:(.text+0x119e): undefined reference to `machine_shutdown' kernel/kexec_core.o: In function `.L312': kexec_core.c:(.text+0x11b2): undefined reference to `machine_kexec' kernel/kexec_file.o: In function `.L0 ': kexec_file.c:(.text+0xb84): undefined reference to `machine_kexec_prepare' kernel/kexec_file.o: In function `.L177': kexec_file.c:(.text+0xc5a): undefined reference to `machine_kexec_prepare' Makefile:1160: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 These symbols should depend on CONFIG_KEXEC_CORE rather than CONFIG_KEXEC when kexec_file has been implemented on RISC-V, like the other archs have done. Signed-off-by: Li Zhengyu Reviewed-by: Masahiro Yamada Acked-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20220601070204.26882-1-lizhengyu3@huawei.com Fixes: 6261586e0c91 ("RISC-V: Add kexec_file support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit a927444aa953f757eaea5bb3615916fba6db58bf Author: Li Zhengyu Date: Wed Jun 1 14:39:24 2022 +0800 RISCV: kexec: Fix build error without CONFIG_MODULES When CONFIG_MODULES is not set/enabled: ../arch/riscv/kernel/elf_kexec.c:353:9: error: unknown type name 'Elf_Rela'; did you mean 'Elf64_Rela'? 353 | Elf_Rela *relas; | ^~~~~~~~ | Elf64_Rela Replace Elf_Rela by Elf64_Rela to avoid relying on CONFIG_MODULES. Signed-off-by: Li Zhengyu Acked-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20220601063924.13037-1-lizhengyu3@huawei.com Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 43b5240ca6b33108998810593248186b1e3ae34a Author: Muchun Song Date: Thu Jun 9 18:40:32 2022 +0800 mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE "numa_stat" should not be included in the scope of CONFIG_HUGETLB_PAGE, if CONFIG_HUGETLB_PAGE is not configured even if CONFIG_NUMA is configured, "numa_stat" is missed form /proc. Move it out of CONFIG_HUGETLB_PAGE to fix it. Fixes: 4518085e127d ("mm, sysctl: make NUMA stats configurable") Signed-off-by: Muchun Song Cc: Acked-by: Michal Hocko Acked-by: Mel Gorman Signed-off-by: Luis Chamberlain commit 9bd572ec7a66b56e1aed896217ff311d981cf575 Merge: f41d5df5f146d 656bd03a2cd85 Author: Linus Torvalds Date: Thu Jul 14 12:48:07 2022 -0700 Merge tag 'net-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, bpf and wireless. Still no major regressions, the release continues to be calm. An uptick of fixes this time around due to trivial data race fixes and patches flowing down from subtrees. There has been a few driver fixes (particularly a few fixes for false positives due to 66e4c8d95008 which went into -next in May!) that make me worry the wide testing is not exactly fully through. So "calm" but not "let's just cut the final ASAP" vibes over here. Current release - regressions: - wifi: rtw88: fix write to const table of channel parameters Current release - new code bugs: - mac80211: add gfp_t arg to ieeee80211_obss_color_collision_notify - mlx5: - TC, allow offload from uplink to other PF's VF - Lag, decouple FDB selection and shared FDB - Lag, correct get the port select mode str - bnxt_en: fix and simplify XDP transmit path - r8152: fix accessing unset transport header Previous releases - regressions: - conntrack: fix crash due to confirmed bit load reordering (after atomic -> refcount conversion) - stmmac: dwc-qos: disable split header for Tegra194 Previous releases - always broken: - mlx5e: ring the TX doorbell on DMA errors - bpf: make sure mac_header was set before using it - mac80211: do not wake queues on a vif that is being stopped - mac80211: fix queue selection for mesh/OCB interfaces - ip: fix dflt addr selection for connected nexthop - seg6: fix skb checksums for SRH encapsulation/insertion - xdp: fix spurious packet loss in generic XDP TX path - bunch of sysctl data race fixes - nf_log: incorrect offset to network header Misc: - bpf: add flags arg to bpf_dynptr_read and bpf_dynptr_write APIs" * tag 'net-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (87 commits) nfp: flower: configure tunnel neighbour on cmsg rx net/tls: Check for errors in tls_device_init MAINTAINERS: Add an additional maintainer to the AMD XGBE driver xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue selftests/net: test nexthop without gw ip: fix dflt addr selection for connected nexthop net: atlantic: remove aq_nic_deinit() when resume net: atlantic: remove deep parameter on suspend/resume functions sfc: fix kernel panic when creating VF seg6: bpf: fix skb checksum in bpf_push_seg6_encap() seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors seg6: fix skb checksum evaluation in SRH encapsulation/insertion sfc: fix use after free when disabling sriov net: sunhme: output link status with a single print. r8152: fix accessing unset transport header net: stmmac: fix leaks in probe net: ftgmac100: Hold reference returned by of_get_child_by_name() nexthop: Fix data-races around nexthop_compat_mode. ipv4: Fix data-races around sysctl_ip_dynaddr. tcp: Fix a data-race around sysctl_tcp_ecn_fallback. ... commit 5ad26161a371e4aa2d2553286f0cac580987a493 Author: Hans de Goede Date: Wed Jul 13 23:11:01 2022 +0200 ACPI: video: Fix acpi_video_handles_brightness_key_presses() Commit 3a0cf7ab8df3 ("ACPI: video: Change how we determine if brightness key-presses are handled") made acpi_video_handles_brightness_key_presses() report false when none of the ACPI Video Devices support backlight control. But it turns out that at least on a Dell Inspiron N4010 there is no ACPI backlight control, yet brightness hotkeys are still reported through the ACPI Video Bus; and since acpi_video_handles_brightness_key_presses() now returns false, brightness keypresses are now reported twice. To fix this rename the has_backlight flag to may_report_brightness_keys and also set it the first time a brightness key press event is received. Depending on the delivery of the other ACPI (WMI) event vs the ACPI Video Bus event this means that the first brightness key press might still get reported twice, but all further keypresses will be filtered as before. Note that this relies on other drivers reporting brightness key events calling acpi_video_handles_brightness_key_presses() when delivering the events (rather then once during driver probe). This is already required and documented in include/acpi/video.h: /* * Note: The value returned by acpi_video_handles_brightness_key_presses() * may change over time and should not be cached. */ Fixes: 3a0cf7ab8df3 ("ACPI: video: Change how we determine if brightness key-presses are handled") Link: https://lore.kernel.org/regressions/CALF=6jEe5G8+r1Wo0vvz4GjNQQhdkLT5p8uCHn6ZXhg4nsOWow@mail.gmail.com/ Reported-and-tested-by: Ben Greening Signed-off-by: Hans de Goede Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220713211101.85547-2-hdegoede@redhat.com commit f41d5df5f146d606df02ec8fafd080a5ee6e6e81 Merge: a24a6c05ffa7a 32f319183c439 Author: Linus Torvalds Date: Thu Jul 14 12:35:15 2022 -0700 Merge tag '5.19-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Three smb3 client fixes: - two multichannel fixes: fix a potential deadlock freeing a channel, and fix a race condition on failed creation of a new channel - mount failure fix: work around a server bug in some common older Samba servers by avoiding padding at the end of the negotiate protocol request" * tag '5.19-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: workaround negprot bug in some Samba servers cifs: remove unnecessary locking of chan_lock while freeing session cifs: fix race condition with delayed threads commit a24a6c05ffa7adb3f2d4b417ca46eedbe67b7302 Merge: 4adfa865bb972 1197eb5906a54 Author: Linus Torvalds Date: Thu Jul 14 12:29:43 2022 -0700 Merge tag 'nfsd-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Notable regression fixes: - Enable SETATTR(time_create) to fix regression with Mac OS clients - Fix a lockd crasher and broken NLM UNLCK behavior" * tag 'nfsd-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: lockd: fix nlm_close_files lockd: set fl_owner when unlocking files NFSD: Decode NFSv4 birth time attribute commit 4adfa865bb972d38d35a6fb19e59a86074d25a75 Merge: 2eb5866cac071 067d252187413 Author: Linus Torvalds Date: Thu Jul 14 12:15:42 2022 -0700 Merge tag 'integrity-v5.19-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity fixes from Mimi Zohar: "Here are a number of fixes for recently found bugs. Only 'ima: fix violation measurement list record' was introduced in the current release. The rest address existing bugs" * tag 'integrity-v5.19-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: Fix potential memory leak in ima_init_crypto() ima: force signature verification when CONFIG_KEXEC_SIG is configured ima: Fix a potential integer overflow in ima_appraise_measurement ima: fix violation measurement list record Revert "evm: Fix memleak in init_desc" commit 2eb5866cac07121b0990d0af5085e36ca5b1ccad Merge: 097da1a44d1ae 29589ca09a74c Author: Linus Torvalds Date: Thu Jul 14 12:08:59 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - quieten the spectre-bhb prints - mark flattened device tree sections as shareable - remove some obsolete CPU domain code and help text - fix thumb unaligned access abort emulation - fix amba_device_add() refcount underflow - fix literal placement * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9208/1: entry: add .ltorg directive to keep literals in range ARM: 9207/1: amba: fix refcount underflow if amba_device_add() fails ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction ARM: 9213/1: Print message about disabled Spectre workarounds only once ARM: 9212/1: domain: Modify Kconfig help text ARM: 9211/1: domain: drop modify_domain() ARM: 9210/1: Mark the FDT_FIXED sections as shareable ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle commit 097da1a44d1aef15739214fecf8f4c63792bb665 Author: Guenter Roeck Date: Thu Jul 14 11:46:00 2022 -0700 um: Replace to_phys() and to_virt() with less generic function names The UML function names to_virt() and to_phys() are exposed by UML headers, and are very generic and may be defined by drivers. As it turns out, commit 9409c9b6709e ("pmem: refactor pmem_clear_poison()") did exactly that. This results in build errors such as the following when trying to build um:allmodconfig: drivers/nvdimm/pmem.c: In function ‘pmem_dax_zero_page_range’: ./arch/um/include/asm/page.h:105:20: error: too few arguments to function ‘to_phys’ 105 | #define __pa(virt) to_phys((void *) (unsigned long) (virt)) | ^~~~~~~ Use less generic function names for the um specific to_phys() and to_virt() functions to fix the problem and to avoid similar problems in the future. Fixes: 9409c9b6709e ("pmem: refactor pmem_clear_poison()") Cc: Dan Williams Cc: Christoph Hellwig Signed-off-by: Guenter Roeck Signed-off-by: Linus Torvalds commit c4634a3c7dcabed7321304efc00b5a81559adeca Merge: d11219ad53dcf 9b043a8f38648 Author: Linus Torvalds Date: Thu Jul 14 11:34:16 2022 -0700 Merge tag 'sound-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Hopefully the last one for 5.19. This became bigger than wished, but all changes are pretty device-specific small fixes, which look less worrisome. The majority of changes are about various ASoC fixes, while the usual HD-audio quirks are included as well" * tag 'sound-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (28 commits) ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc221 ALSA: hda/realtek: fix mute/micmute LEDs for HP machines ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 ALSA: hda - Add fixup for Dell Latitidue E5430 ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model ALSA: hda/realtek: Fix headset mic for Acer SF313-51 ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks() ASoC: rt5640: Fix the wrong state of JD1 and JD2 ASoC: Intel: sof_rt5682: fix out-of-bounds array access ASoC: qdsp6: fix potential memory leak in q6apm_get_audioreach_graph() ASoC: tas2764: Fix amp gain register offset & default ASoC: tas2764: Correct playback volume range ASoC: tas2764: Fix and extend FSYNC polarity handling ASoC: tas2764: Add post reset delays ASoC: dt-bindings: Fix description for msm8916 ASoC: doc: Capitalize RESET line name ASoC: arizona: Update arizona_aif_cfg_changed to use RX_BCLK_RATE ASoC: cs47l92: Fix event generation for OUT1 demux ... commit 656bd03a2cd853e7c7c4e08968ad8c0ea993737d Author: Tianyu Yuan Date: Thu Jul 14 10:19:15 2022 +0200 nfp: flower: configure tunnel neighbour on cmsg rx nfp_tun_write_neigh() function will configure a tunnel neighbour when calling nfp_tun_neigh_event_handler() or nfp_flower_cmsg_process_one_rx() (with no tunnel neighbour type) from firmware. When configuring IP on physical port as a tunnel endpoint, no operation will be performed after receiving the cmsg mentioned above. Therefore, add a progress to configure tunnel neighbour in this case. v2: Correct format of fixes tag. Fixes: f1df7956c11f ("nfp: flower: rework tunnel neighbour configuration") Signed-off-by: Tianyu Yuan Reviewed-by: Louis Peens Reviewed-by: Baowen Zheng Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220714081915.148378-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 3d8c51b25a235e283e37750943bbf356ef187230 Author: Tariq Toukan Date: Thu Jul 14 10:07:54 2022 +0300 net/tls: Check for errors in tls_device_init Add missing error checks in tls_device_init. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Reported-by: Jakub Kicinski Reviewed-by: Maxim Mikityanskiy Signed-off-by: Tariq Toukan Link: https://lore.kernel.org/r/20220714070754.1428-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski commit 51f1c31f8ba713f70f1659e7c91e837fe5f5554f Author: Tom Lendacky Date: Wed Jul 13 17:31:41 2022 -0500 MAINTAINERS: Add an additional maintainer to the AMD XGBE driver Add Shyam Sundar S K as an additional maintainer to support the AMD XGBE network device driver. Cc: Shyam Sundar S K Signed-off-by: Tom Lendacky Link: https://lore.kernel.org/r/db367f24089c2bbbcd1cec8e21af49922017a110.1657751501.git.thomas.lendacky@amd.com Signed-off-by: Jakub Kicinski commit 94e8100678889ab428e68acadf042de723f094b9 Author: Juergen Gross Date: Wed Jul 13 15:53:22 2022 +0200 xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue xenvif_rx_next_skb() is expecting the rx queue not being empty, but in case the loop in xenvif_rx_action() is doing multiple iterations, the availability of another skb in the rx queue is not being checked. This can lead to crashes: [40072.537261] BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 [40072.537407] IP: xenvif_rx_skb+0x23/0x590 [xen_netback] [40072.537534] PGD 0 P4D 0 [40072.537644] Oops: 0000 [#1] SMP NOPTI [40072.537749] CPU: 0 PID: 12505 Comm: v1-c40247-q2-gu Not tainted 4.12.14-122.121-default #1 SLE12-SP5 [40072.537867] Hardware name: HP ProLiant DL580 Gen9/ProLiant DL580 Gen9, BIOS U17 11/23/2021 [40072.537999] task: ffff880433b38100 task.stack: ffffc90043d40000 [40072.538112] RIP: e030:xenvif_rx_skb+0x23/0x590 [xen_netback] [40072.538217] RSP: e02b:ffffc90043d43de0 EFLAGS: 00010246 [40072.538319] RAX: 0000000000000000 RBX: ffffc90043cd7cd0 RCX: 00000000000000f7 [40072.538430] RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffffc90043d43df8 [40072.538531] RBP: 000000000000003f R08: 000077ff80000000 R09: 0000000000000008 [40072.538644] R10: 0000000000007ff0 R11: 00000000000008f6 R12: ffffc90043ce2708 [40072.538745] R13: 0000000000000000 R14: ffffc90043d43ed0 R15: ffff88043ea748c0 [40072.538861] FS: 0000000000000000(0000) GS:ffff880484600000(0000) knlGS:0000000000000000 [40072.538988] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 [40072.539088] CR2: 0000000000000080 CR3: 0000000407ac8000 CR4: 0000000000040660 [40072.539211] Call Trace: [40072.539319] xenvif_rx_action+0x71/0x90 [xen_netback] [40072.539429] xenvif_kthread_guest_rx+0x14a/0x29c [xen_netback] Fix that by stopping the loop in case the rx queue becomes empty. Cc: stable@vger.kernel.org Fixes: 98f6d57ced73 ("xen-netback: process guest rx packets in batches") Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Reviewed-by: Paul Durrant Link: https://lore.kernel.org/r/20220713135322.19616-1-jgross@suse.com Signed-off-by: Jakub Kicinski commit d11219ad53dcf61ced53ca60fe0c4a8d34393e6c Author: Linus Torvalds Date: Wed Jul 13 12:36:50 2022 -0700 amdgpu: disable powerpc support for the newer display engine The DRM_AMD_DC_DCN display engine support (Raven, Navi, and newer) has not been building cleanly on powerpc and causes link errors due to mixing hard- and soft-float object files: powerpc64-linux-ld: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o uses hard float, drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o uses soft float powerpc64-linux-ld: failed to merge target specific data of file drivers/gpu/drm/amd/amdgpu/../display/dc/dcn31/dcn31_resource.o [..] and while patches are floating around, it's not exactly obvious what is going on. The problem bisects to commit 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support") but that is probably more about changing config variables than the fundamental cause. Despite the bisection result, a more directly related commit seems to be 26f4712aedbd ("drm/amd/display: move FPU related code from dcn31 to dml/dcn31 folder"). It's probably a combination of the two. This has been going on since the merge window, without any final word. So instead of blindly applying patches that may or may not be the right thing, let's disable this for now. As Michael Ellerman says: "IIUIC this code was never enabled on ppc before, so disabling it seems like a reasonable fix to get the build clean" and once we have more actual feedback (and find any potential users) we can always re-enable it with the patch that fixes the issues and back-port as necessary. Fixes: 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support") Fixes: 26f4712aedbd ("drm/amd/display: move FPU related code from dcn31 to dml/dcn31 folder") Reported-and-tested-by: Guenter Roeck Link: https://lore.kernel.org/all/20220606153910.GA1773067@roeck-us.net/ Link: https://lore.kernel.org/all/20220618232737.2036722-1-linux@roeck-us.net/ Link: https://lore.kernel.org/all/20220713050724.GA2471738@roeck-us.net/ Acked-by: Michael Ellerman Acked-by: Alex Deucher Signed-off-by: Linus Torvalds commit 957a2b345cbcf41b4b25d471229f0e35262f066c Author: Muchun Song Date: Wed Jul 13 22:02:26 2022 +0800 block: fix missing blkcg_bio_issue_init The commit 513616843d73 ("block: remove superfluous calls to blkcg_bio_issue_init") has removed blkcg_bio_issue_init from __bio_clone since submit_bio will override ->bi_issue. However, __blk_queue_split is called after blkcg_bio_issue_init (see blk_mq_submit_bio) in submit_bio. In this case, the ->bi_issue is 0. Fix it. Fixes: 513616843d73 ("block: remove superfluous calls to blkcg_bio_issue_init") Signed-off-by: Muchun Song Link: https://lore.kernel.org/r/20220713140226.68135-1-songmuchun@bytedance.com Signed-off-by: Jens Axboe commit c24b06e1c237ee2bf3245786b0ee844ddd1610be Merge: 6b0de7d0f3285 6961b5e02876b Author: Jens Axboe Date: Thu Jul 14 10:29:56 2022 -0600 Merge tag 'nvme-5.19-2022-07-14' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - fix a block device naming collision (Israel Rukshin) - fix freeze accounting for PCI error handling (Keith Busch)" * tag 'nvme-5.19-2022-07-14' of git://git.infradead.org/nvme: nvme: fix block device naming collision nvme-pci: fix freeze accounting for error handling commit 7c1ddcee5311f3315096217881d2dbe47cc683f9 Author: Lennert Buytenhek Date: Thu Jun 2 18:58:11 2022 +0300 igc: Reinstate IGC_REMOVED logic and implement it properly The initially merged version of the igc driver code (via commit 146740f9abc4, "igc: Add support for PF") contained the following IGC_REMOVED checks in the igc_rd32/wr32() MMIO accessors: u32 igc_rd32(struct igc_hw *hw, u32 reg) { u8 __iomem *hw_addr = READ_ONCE(hw->hw_addr); u32 value = 0; if (IGC_REMOVED(hw_addr)) return ~value; value = readl(&hw_addr[reg]); /* reads should not return all F's */ if (!(~value) && (!reg || !(~readl(hw_addr)))) hw->hw_addr = NULL; return value; } And: #define wr32(reg, val) \ do { \ u8 __iomem *hw_addr = READ_ONCE((hw)->hw_addr); \ if (!IGC_REMOVED(hw_addr)) \ writel((val), &hw_addr[(reg)]); \ } while (0) E.g. igb has similar checks in its MMIO accessors, and has a similar macro E1000_REMOVED, which is implemented as follows: #define E1000_REMOVED(h) unlikely(!(h)) These checks serve to detect and take note of an 0xffffffff MMIO read return from the device, which can be caused by a PCIe link flap or some other kind of PCI bus error, and to avoid performing MMIO reads and writes from that point onwards. However, the IGC_REMOVED macro was not originally implemented: #ifndef IGC_REMOVED #define IGC_REMOVED(a) (0) #endif /* IGC_REMOVED */ This led to the IGC_REMOVED logic to be removed entirely in a subsequent commit (commit 3c215fb18e70, "igc: remove IGC_REMOVED function"), with the rationale that such checks matter only for virtualization and that igc does not support virtualization -- but a PCIe device can become detached even without virtualization being in use, and without proper checks, a PCIe bus error affecting an igc adapter will lead to various NULL pointer dereferences, as the first access after the error will set hw->hw_addr to NULL, and subsequent accesses will blindly dereference this now-NULL pointer. This patch reinstates the IGC_REMOVED checks in igc_rd32/wr32(), and implements IGC_REMOVED the way it is done for igb, by checking for the unlikely() case of hw_addr being NULL. This change prevents the oopses seen when a PCIe link flap occurs on an igc adapter. Fixes: 146740f9abc4 ("igc: Add support for PF") Signed-off-by: Lennert Buytenhek Tested-by: Naama Meir Acked-by: Sasha Neftin Signed-off-by: Tony Nguyen commit 6cfa45361d3eac31ba67d7d0bbef547151450106 Author: Sasha Neftin Date: Mon May 9 11:52:54 2022 +0300 Revert "e1000e: Fix possible HW unit hang after an s0ix exit" This reverts commit 1866aa0d0d6492bc2f8d22d0df49abaccf50cddd. Commit 1866aa0d0d64 ("e1000e: Fix possible HW unit hang after an s0ix exit") was a workaround for CSME problem to handle messages comes via H2ME mailbox. This problem has been fixed by patch "e1000e: Enable the GPT clock before sending message to the CSME". Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821 Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit b49feacbeffc7635cc6692cbcc6a1eae2c17da6f Author: Sasha Neftin Date: Sun May 8 10:09:05 2022 +0300 e1000e: Enable GPT clock before sending message to CSME On corporate (CSME) ADL systems, the Ethernet Controller may stop working ("HW unit hang") after exiting from the s0ix state. The reason is that CSME misses the message sent by the host. Enabling the dynamic GPT clock solves this problem. This clock is cleared upon HW initialization. Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821 Reviewed-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Chia-Lin Kao (AceLan) Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 8a414f943f8b5f94bbaafdec863d6f3dbef33f8a Author: Vitaly Kuznetsov Date: Fri Jul 8 14:51:47 2022 +0200 KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op() 'vector' and 'trig_mode' fields of 'struct kvm_lapic_irq' are left uninitialized in kvm_pv_kick_cpu_op(). While these fields are normally not needed for APIC_DM_REMRD, they're still referenced by __apic_accept_irq() for trace_kvm_apic_accept_irq(). Fully initialize the structure to avoid consuming random stack memory. Fixes: a183b638b61c ("KVM: x86: make apic_accept_irq tracepoint more generic") Reported-by: syzbot+d6caa905917d353f0d07@syzkaller.appspotmail.com Signed-off-by: Vitaly Kuznetsov Reviewed-by: Sean Christopherson Message-Id: <20220708125147.593975-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 6961b5e02876b3b47f030a1f1ee8fd3e631ac270 Author: Israel Rukshin Date: Thu Jul 14 12:42:10 2022 +0000 nvme: fix block device naming collision The issue exists when multipath is enabled and the namespace is shared, but all the other controller checks at nvme_is_unique_nsid() are false. The reason for this issue is that nvme_is_unique_nsid() returns false when is called from nvme_mpath_alloc_disk() due to an uninitialized value of head->shared. The patch fixes it by setting head->shared before nvme_mpath_alloc_disk() is called. Fixes: 5974ea7ce0f9 ("nvme: allow duplicate NSIDs for private namespaces") Signed-off-by: Israel Rukshin Reviewed-by: Keith Busch Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit 081f5e753c9c4cd1dd86000bcc7f5fe14cbdcab0 Author: Keith Busch Date: Tue Jul 12 08:16:32 2022 -0700 nvme-pci: fix freeze accounting for error handling A reset on a live device experiencing a link error still needs to have the queue freeze state started for the subsequent reinitialization. Skip only the register read if the device is not present instead of bypassing the freeze checks. Fixes: b98235d3a471e ("nvme-pci: harden drive presence detect in nvme_dev_disable()") Reported-by: Niklas Schnelle Signed-off-by: Keith Busch Tested-by: Niklas Schnelle Signed-off-by: Christoph Hellwig commit 3486af89dd3c0b0bef194c4bccf17c31ef16b99f Merge: 7e50133234007 7c239a071d1f0 Author: Greg Kroah-Hartman Date: Thu Jul 14 16:22:12 2022 +0200 Merge tag 'usb-serial-5.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.19-rc7 Here are a couple of new device ids for ftdi_sio. Everything has been in linux-next with no reported issues. * tag 'usb-serial-5.19-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: ftdi_sio: add Belimo device ids commit 7e50133234007f77d40c5ad871960a3171b362c3 Merge: bb160ee61c04f 32346491ddf24 Author: Greg Kroah-Hartman Date: Thu Jul 14 16:18:22 2022 +0200 Merge tag 'v5.19-rc6' into usb-linus The usb-serial fixes are based on this branch, so merge it in here to prevent merge confusion when merging in that tree. Signed-off-by: Greg Kroah-Hartman commit cca3f3381bef16ae04933cc3ff480952f7ae298f Merge: 942d9e89524c1 99482726452bd Author: Paolo Bonzini Date: Thu Jul 14 10:04:12 2022 -0400 Merge commit 'kvm-vmx-nested-tsc-fix' into kvm-master Merge bugfix needed in both 5.19 (because it's bad) and 5.20 (because it is a prerequisite to test new features). commit cd72e61bad145a0968df85193dcf1261cb66c4c6 Author: Nicolas Dichtel Date: Wed Jul 13 13:48:53 2022 +0200 selftests/net: test nexthop without gw This test implement the scenario described in the commit "ip: fix dflt addr selection for connected nexthop". The test configures a nexthop object with an output device only (no gateway address) and a route that uses this nexthop. The goal is to check if the kernel selects a valid source address. Link: https://lore.kernel.org/netdev/20220712095545.10947-1-nicolas.dichtel@6wind.com/ Signed-off-by: Nicolas Dichtel Link: https://lore.kernel.org/r/20220713114853.29406-2-nicolas.dichtel@6wind.com Signed-off-by: Paolo Abeni commit 747c14307214b55dbd8250e1ab44cad8305756f1 Author: Nicolas Dichtel Date: Wed Jul 13 13:48:52 2022 +0200 ip: fix dflt addr selection for connected nexthop When a nexthop is added, without a gw address, the default scope was set to 'host'. Thus, when a source address is selected, 127.0.0.1 may be chosen but rejected when the route is used. When using a route without a nexthop id, the scope can be configured in the route, thus the problem doesn't exist. To explain more deeply: when a user creates a nexthop, it cannot specify the scope. To create it, the function nh_create_ipv4() calls fib_check_nh() with scope set to 0. fib_check_nh() calls fib_check_nh_nongw() wich was setting scope to 'host'. Then, nh_create_ipv4() calls fib_info_update_nhc_saddr() with scope set to 'host'. The src addr is chosen before the route is inserted. When a 'standard' route (ie without a reference to a nexthop) is added, fib_create_info() calls fib_info_update_nhc_saddr() with the scope set by the user. iproute2 set the scope to 'link' by default. Here is a way to reproduce the problem: ip netns add foo ip -n foo link set lo up ip netns add bar ip -n bar link set lo up sleep 1 ip -n foo link add name eth0 type dummy ip -n foo link set eth0 up ip -n foo address add 192.168.0.1/24 dev eth0 ip -n foo link add name veth0 type veth peer name veth1 netns bar ip -n foo link set veth0 up ip -n bar link set veth1 up ip -n bar address add 192.168.1.1/32 dev veth1 ip -n bar route add default dev veth1 ip -n foo nexthop add id 1 dev veth0 ip -n foo route add 192.168.1.1 nhid 1 Try to get/use the route: > $ ip -n foo route get 192.168.1.1 > RTNETLINK answers: Invalid argument > $ ip netns exec foo ping -c1 192.168.1.1 > ping: connect: Invalid argument Try without nexthop group (iproute2 sets scope to 'link' by dflt): ip -n foo route del 192.168.1.1 ip -n foo route add 192.168.1.1 dev veth0 Try to get/use the route: > $ ip -n foo route get 192.168.1.1 > 192.168.1.1 dev veth0 src 192.168.0.1 uid 0 > cache > $ ip netns exec foo ping -c1 192.168.1.1 > PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. > 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.039 ms > > --- 192.168.1.1 ping statistics --- > 1 packets transmitted, 1 received, 0% packet loss, time 0ms > rtt min/avg/max/mdev = 0.039/0.039/0.039/0.000 ms CC: stable@vger.kernel.org Fixes: 597cfe4fc339 ("nexthop: Add support for IPv4 nexthops") Reported-by: Edwin Brossette Signed-off-by: Nicolas Dichtel Link: https://lore.kernel.org/r/20220713114853.29406-1-nicolas.dichtel@6wind.com Signed-off-by: Paolo Abeni commit 73d5fe046270281a46344e06bf986c607632f7ea Author: Vaishnav Achath Date: Wed Jun 1 12:46:11 2022 +0530 spi: cadence-quadspi: Remove spi_master_put() in probe failure path Currently the spi_master is allocated by devm_spi_alloc_master() and devres core manages the deallocation, but in probe failure path spi_master_put() is being handled manually which causes "refcount underflow use-after-free" warning when probe failure happens after allocating spi_master. Trimmed backtrace during failure: refcount_t: underflow; use-after-free. pc : refcount_warn_saturate+0xf4/0x144 Call trace: refcount_warn_saturate kobject_put put_device devm_spi_release_controller devres_release_all This commit makes relevant changes to remove spi_master_put() from probe failure path. Fixes: 606e5d408184 ("spi: cadence-quadspi: Handle spi_unregister_master() in remove()") Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20220601071611.11853-1-vaishnav.a@ti.com Signed-off-by: Mark Brown commit 1e347f861da8ddb17e1d1b3113cb6c188e0de3e5 Author: Mark Brown Date: Wed Jul 13 14:04:51 2022 +0100 ASoC: rockchip-i2s: Undo BCLK pinctrl changes The version of the BCLK pinctrl management changes that made it into v5.19 has caused problems on some systems due to overly strict DT requirements but attempts to fix it have caused further breakage on other platforms. Just drop the changes for this release, we already have a better version queued for -next. Fixes: 26b9f2fa7b1c ("ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found") Fixes: a5450aba737d ("ASoC: rockchip: i2s: switch BCLK to GPIO") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220713130451.31481-1-broonie@kernel.org Signed-off-by: Mark Brown commit 29589ca09a74cfc0c50ad002e298bf4b8e69e0bd Author: Ard Biesheuvel Date: Tue May 31 09:49:24 2022 +0100 ARM: 9208/1: entry: add .ltorg directive to keep literals in range LKP reports a build issue on Clang, related to a literal load of __current issued through the ldr_va macro. This turns out to be due to the fact that group relocations are disabled when CONFIG_COMPILE_TEST=y, which means that the ldr_va macro resolves to a pair of LDR instructions, the first one being a literal load issued too far from its literal pool. Due to the introduction of a couple of new uses of this macro in commit 508074607c7b95b2 ("ARM: 9195/1: entry: avoid explicit literal loads"), the literal pools end up getting rearranged in a way that causes the literal for __current to go out of range. Let's fix this up by putting a .ltorg directive in a suitable place in the code. Link: https://lore.kernel.org/all/202205290805.1vZLAr36-lkp@intel.com/ Fixes: 508074607c7b95b2 ("ARM: 9195/1: entry: avoid explicit literal loads") Reported-by: kernel test robot Signed-off-by: Ard Biesheuvel Tested-by: Nathan Chancellor Signed-off-by: Russell King (Oracle) commit 8030aa3ce12e3b9d47afa62344c601ed508c2d9e Author: Wang Kefeng Date: Tue May 24 09:03:46 2022 +0100 ARM: 9207/1: amba: fix refcount underflow if amba_device_add() fails "ARM: 9192/1: amba: fix memory leak in amba_device_try_add()" leads to a refcount underflow if amba_device_add() fails, which called by of_amba_device_create(), the of_amba_device_create() already exists the error handling, so amba_put_device() only need to be added into amba_deferred_retry(). Fixes: 7719a68b2fa4 ("ARM: 9192/1: amba: fix memory leak in amba_device_try_add()") Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 942d9e89524c135615e557fffa144104ea8fb361 Author: Paolo Bonzini Date: Thu Jul 14 07:29:57 2022 -0400 Documentation: kvm: clarify histogram units In the case of histogram statistics, the values are always sample counts; the unit instead applies to the bucket range. For example, halt_poll_success_hist is a nanosecond statistic because the buckets are for 0ns, 1ns, 2-3ns, 4-7ns etc. There isn't really any other sensible interpretation, but clarify this anyway in the Documentation. Signed-off-by: Paolo Bonzini commit 1b870fa5573e260bc74d19f381ab0dd971a8d8e7 Author: Paolo Bonzini Date: Thu Jul 14 07:27:31 2022 -0400 kvm: stats: tell userspace which values are boolean Some of the statistics values exported by KVM are always only 0 or 1. It can be useful to export this fact to userspace so that it can track them specially (for example by polling the value every now and then to compute a % of time spent in a specific state). Therefore, add "boolean value" as a new "unit". While it is not exactly a unit, it walks and quacks like one. In particular, using the type would be wrong because boolean values could be instantaneous or peak values (e.g. "is the rmap allocated?") or even two-bucket histograms (e.g. "number of posted vs. non-posted interrupt injections"). Suggested-by: Amneesh Singh Signed-off-by: Paolo Bonzini commit 84e7051c0bc1f2a13101553959b3a9d9a8e24939 Author: Thadeu Lima de Souza Cascardo Date: Wed Jul 13 14:12:41 2022 -0300 x86/kvm: fix FASTOP_SIZE when return thunks are enabled The return thunk call makes the fastop functions larger, just like IBT does. Consider a 16-byte FASTOP_SIZE when CONFIG_RETHUNK is enabled. Otherwise, functions will be incorrectly aligned and when computing their position for differently sized operators, they will executed in the middle or end of a function, which may as well be an int3, leading to a crash like: [ 36.091116] int3: 0000 [#1] SMP NOPTI [ 36.091119] CPU: 3 PID: 1371 Comm: qemu-system-x86 Not tainted 5.15.0-41-generic #44 [ 36.091120] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 [ 36.091121] RIP: 0010:xaddw_ax_dx+0x9/0x10 [kvm] [ 36.091185] Code: 00 0f bb d0 c3 cc cc cc cc 48 0f bb d0 c3 cc cc cc cc 0f 1f 80 00 00 00 00 0f c0 d0 c3 cc cc cc cc 66 0f c1 d0 c3 cc cc cc cc <0f> 1f 80 00 00 00 00 0f c1 d0 c3 cc cc cc cc 48 0f c1 d0 c3 cc cc [ 36.091186] RSP: 0018:ffffb1f541143c98 EFLAGS: 00000202 [ 36.091188] RAX: 0000000089abcdef RBX: 0000000000000001 RCX: 0000000000000000 [ 36.091188] RDX: 0000000076543210 RSI: ffffffffc073c6d0 RDI: 0000000000000200 [ 36.091189] RBP: ffffb1f541143ca0 R08: ffff9f1803350a70 R09: 0000000000000002 [ 36.091190] R10: ffff9f1803350a70 R11: 0000000000000000 R12: ffff9f1803350a70 [ 36.091190] R13: ffffffffc077fee0 R14: 0000000000000000 R15: 0000000000000000 [ 36.091191] FS: 00007efdfce8d640(0000) GS:ffff9f187dd80000(0000) knlGS:0000000000000000 [ 36.091192] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 36.091192] CR2: 0000000000000000 CR3: 0000000009b62002 CR4: 0000000000772ee0 [ 36.091195] PKRU: 55555554 [ 36.091195] Call Trace: [ 36.091197] [ 36.091198] ? fastop+0x5a/0xa0 [kvm] [ 36.091222] x86_emulate_insn+0x7b8/0xe90 [kvm] [ 36.091244] x86_emulate_instruction+0x2f4/0x630 [kvm] [ 36.091263] ? kvm_arch_vcpu_load+0x7c/0x230 [kvm] [ 36.091283] ? vmx_prepare_switch_to_host+0xf7/0x190 [kvm_intel] [ 36.091290] complete_emulated_mmio+0x297/0x320 [kvm] [ 36.091310] kvm_arch_vcpu_ioctl_run+0x32f/0x550 [kvm] [ 36.091330] kvm_vcpu_ioctl+0x29e/0x6d0 [kvm] [ 36.091344] ? kvm_vcpu_ioctl+0x120/0x6d0 [kvm] [ 36.091357] ? __fget_files+0x86/0xc0 [ 36.091362] ? __fget_files+0x86/0xc0 [ 36.091363] __x64_sys_ioctl+0x92/0xd0 [ 36.091366] do_syscall_64+0x59/0xc0 [ 36.091369] ? syscall_exit_to_user_mode+0x27/0x50 [ 36.091370] ? do_syscall_64+0x69/0xc0 [ 36.091371] ? syscall_exit_to_user_mode+0x27/0x50 [ 36.091372] ? __x64_sys_writev+0x1c/0x30 [ 36.091374] ? do_syscall_64+0x69/0xc0 [ 36.091374] ? exit_to_user_mode_prepare+0x37/0xb0 [ 36.091378] ? syscall_exit_to_user_mode+0x27/0x50 [ 36.091379] ? do_syscall_64+0x69/0xc0 [ 36.091379] ? do_syscall_64+0x69/0xc0 [ 36.091380] ? do_syscall_64+0x69/0xc0 [ 36.091381] ? do_syscall_64+0x69/0xc0 [ 36.091381] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 36.091384] RIP: 0033:0x7efdfe6d1aff [ 36.091390] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <41> 89 c0 3d 00 f0 ff ff 77 1f 48 8b 44 24 18 64 48 2b 04 25 28 00 [ 36.091391] RSP: 002b:00007efdfce8c460 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 36.091393] RAX: ffffffffffffffda RBX: 000000000000ae80 RCX: 00007efdfe6d1aff [ 36.091393] RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 000000000000000c [ 36.091394] RBP: 0000558f1609e220 R08: 0000558f13fb8190 R09: 00000000ffffffff [ 36.091394] R10: 0000558f16b5e950 R11: 0000000000000246 R12: 0000000000000000 [ 36.091394] R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000 [ 36.091396] [ 36.091397] Modules linked in: isofs nls_iso8859_1 kvm_intel joydev kvm input_leds serio_raw sch_fq_codel dm_multipath scsi_dh_rdac scsi_dh_emc scsi_dh_alua ipmi_devintf ipmi_msghandler drm msr ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 multipath linear crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel virtio_net net_failover crypto_simd ahci xhci_pci cryptd psmouse virtio_blk libahci xhci_pci_renesas failover [ 36.123271] ---[ end trace db3c0ab5a48fabcc ]--- [ 36.123272] RIP: 0010:xaddw_ax_dx+0x9/0x10 [kvm] [ 36.123319] Code: 00 0f bb d0 c3 cc cc cc cc 48 0f bb d0 c3 cc cc cc cc 0f 1f 80 00 00 00 00 0f c0 d0 c3 cc cc cc cc 66 0f c1 d0 c3 cc cc cc cc <0f> 1f 80 00 00 00 00 0f c1 d0 c3 cc cc cc cc 48 0f c1 d0 c3 cc cc [ 36.123320] RSP: 0018:ffffb1f541143c98 EFLAGS: 00000202 [ 36.123321] RAX: 0000000089abcdef RBX: 0000000000000001 RCX: 0000000000000000 [ 36.123321] RDX: 0000000076543210 RSI: ffffffffc073c6d0 RDI: 0000000000000200 [ 36.123322] RBP: ffffb1f541143ca0 R08: ffff9f1803350a70 R09: 0000000000000002 [ 36.123322] R10: ffff9f1803350a70 R11: 0000000000000000 R12: ffff9f1803350a70 [ 36.123323] R13: ffffffffc077fee0 R14: 0000000000000000 R15: 0000000000000000 [ 36.123323] FS: 00007efdfce8d640(0000) GS:ffff9f187dd80000(0000) knlGS:0000000000000000 [ 36.123324] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 36.123325] CR2: 0000000000000000 CR3: 0000000009b62002 CR4: 0000000000772ee0 [ 36.123327] PKRU: 55555554 [ 36.123328] Kernel panic - not syncing: Fatal exception in interrupt [ 36.123410] Kernel Offset: 0x1400000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) [ 36.135305] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Fixes: aa3d480315ba ("x86: Use return-thunk in asm code") Signed-off-by: Thadeu Lima de Souza Cascardo Co-developed-by: Peter Zijlstra (Intel) Cc: Borislav Petkov Cc: Josh Poimboeuf Cc: Paolo Bonzini Reported-by: Linux Kernel Functional Testing Message-Id: <20220713171241.184026-1-cascardo@canonical.com> Tested-by: Jack Wang Signed-off-by: Paolo Bonzini commit 99482726452bdf8be9325199022b17fa6d7d58fe Author: Vitaly Kuznetsov Date: Tue Jul 12 15:50:09 2022 +0200 KVM: nVMX: Always enable TSC scaling for L2 when it was enabled for L1 Windows 10/11 guests with Hyper-V role (WSL2) enabled are observed to hang upon boot or shortly after when a non-default TSC frequency was set for L1. The issue is observed on a host where TSC scaling is supported. The problem appears to be that Windows doesn't use TSC frequency for its guests even when the feature is advertised and KVM filters SECONDARY_EXEC_TSC_SCALING out when creating L2 controls from L1's. This leads to L2 running with the default frequency (matching host's) while L1 is running with an altered one. Keep SECONDARY_EXEC_TSC_SCALING in secondary exec controls for L2 when it was set for L1. TSC_MULTIPLIER is already correctly computed and written by prepare_vmcs02(). Signed-off-by: Vitaly Kuznetsov Reviewed-by: Maxim Levitsky Message-Id: <20220712135009.952805-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 564d998106397394b6aad260f219b882b3347e62 Author: Peter Zijlstra Date: Thu Jul 14 12:20:19 2022 +0200 um: Add missing apply_returns() Implement apply_returns() stub for UM, just like all the other patching routines. Fixes: 15e67227c49a ("x86: Undo return-thunk damage") Reported-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/Ys%2Ft45l%2FgarIrD0u@worktop.programming.kicks-ass.net commit 2e15c51fefaffaf9f72255eaef4fada05055e4c5 Author: Chia-Lin Kao (AceLan) Date: Wed Jul 13 19:12:24 2022 +0800 net: atlantic: remove aq_nic_deinit() when resume aq_nic_deinit() has been called while suspending, so we don't have to call it again on resume. Actually, call it again leads to another hang issue when resuming from S3. Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992345] Call Trace: Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992346] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992348] aq_nic_deinit+0xb4/0xd0 [atlantic] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992356] aq_pm_thaw+0x7f/0x100 [atlantic] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992362] pci_pm_resume+0x5c/0x90 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992366] ? pci_pm_thaw+0x80/0x80 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992368] dpm_run_callback+0x4e/0x120 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992371] device_resume+0xad/0x200 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992373] async_resume+0x1e/0x40 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992374] async_run_entry_fn+0x33/0x120 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992377] process_one_work+0x220/0x3c0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992380] worker_thread+0x4d/0x3f0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992382] ? process_one_work+0x3c0/0x3c0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992384] kthread+0x12a/0x150 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992386] ? set_kthread_struct+0x40/0x40 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992387] ret_from_fork+0x22/0x30 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992391] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992392] ---[ end trace 1ec8c79604ed5e0d ]--- Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992394] PM: dpm_run_callback(): pci_pm_resume+0x0/0x90 returns -110 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992397] atlantic 0000:02:00.0: PM: failed to resume async: error -110 Fixes: 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") Signed-off-by: Chia-Lin Kao (AceLan) Link: https://lore.kernel.org/r/20220713111224.1535938-2-acelan.kao@canonical.com Signed-off-by: Paolo Abeni commit 0f33250760384e05c36466b0a2f92f3c6007ba92 Author: Chia-Lin Kao (AceLan) Date: Wed Jul 13 19:12:23 2022 +0800 net: atlantic: remove deep parameter on suspend/resume functions Below commit claims that atlantic NIC requires to reset the device on pm op, and had set the deep to true for all suspend/resume functions. commit 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") So, we could remove deep parameter on suspend/resume functions without any functional change. Fixes: 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") Signed-off-by: Chia-Lin Kao (AceLan) Link: https://lore.kernel.org/r/20220713111224.1535938-1-acelan.kao@canonical.com Signed-off-by: Paolo Abeni commit ada74c5539eba06cf8b47d068f92e0b3963a9a6e Author: Íñigo Huguet Date: Wed Jul 13 11:21:16 2022 +0200 sfc: fix kernel panic when creating VF When creating VFs a kernel panic can happen when calling to efx_ef10_try_update_nic_stats_vf. When releasing a DMA coherent buffer, sometimes, I don't know in what specific circumstances, it has to unmap memory with vunmap. It is disallowed to do that in IRQ context or with BH disabled. Otherwise, we hit this line in vunmap, causing the crash: BUG_ON(in_interrupt()); This patch reenables BH to release the buffer. Log messages when the bug is hit: kernel BUG at mm/vmalloc.c:2727! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 6 PID: 1462 Comm: NetworkManager Kdump: loaded Tainted: G I --------- --- 5.14.0-119.el9.x86_64 #1 Hardware name: Dell Inc. PowerEdge R740/06WXJT, BIOS 2.8.2 08/27/2020 RIP: 0010:vunmap+0x2e/0x30 ...skip... Call Trace: __iommu_dma_free+0x96/0x100 efx_nic_free_buffer+0x2b/0x40 [sfc] efx_ef10_try_update_nic_stats_vf+0x14a/0x1c0 [sfc] efx_ef10_update_stats_vf+0x18/0x40 [sfc] efx_start_all+0x15e/0x1d0 [sfc] efx_net_open+0x5a/0xe0 [sfc] __dev_open+0xe7/0x1a0 __dev_change_flags+0x1d7/0x240 dev_change_flags+0x21/0x60 ...skip... Fixes: d778819609a2 ("sfc: DMA the VF stats only when requested") Reported-by: Ma Yuying Signed-off-by: Íñigo Huguet Acked-by: Edward Cree Link: https://lore.kernel.org/r/20220713092116.21238-1-ihuguet@redhat.com Signed-off-by: Paolo Abeni commit d13122ca3cdf75f0ab82b4080c2058604834d1da Merge: 4a57a8400075b be82abe6a76ba Author: Paolo Bonzini Date: Thu Jul 14 06:01:53 2022 -0400 Merge tag 'kvm-riscv-fixes-5.19-2' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.19, take #2 - Fix missing PAGE_PFN_MASK - Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests() commit cc91b09b9ef8f8a9f29b4fdff5f65ab5700872e2 Merge: f46a5a9c679f4 4889fbd98deaf Author: Paolo Abeni Date: Thu Jul 14 10:15:15 2022 +0200 Merge branch 'seg6-fix-skb-checksum-for-srh-encapsulation-insertion' Andrea Mayer says: ==================== seg6: fix skb checksum for SRH encapsulation/insertion The Linux kernel supports Segment Routing Header (SRH) encapsulation/insertion operations by providing the capability to: i) encapsulate a packet in an outer IPv6 header with a specified SRH; ii) insert a specified SRH directly after the IPv6 header of the packet. Note that the insertion operation is also referred to as 'injection'. The two operations are respectively supported by seg6_do_srh_encap() and seg6_do_srh_inline(), which operate on the skb associated to the packet as needed (e.g. adding the necessary headers and initializing them, while taking care to recalculate the skb checksum). seg6_do_srh_encap() and seg6_do_srh_inline() do not initialize the payload length of the IPv6 header, which is carried out by the caller functions. However, this approach causes the corruption of the skb checksum which needs to be updated only after initialization of headers is completed (thanks to Paolo Abeni for detecting this issue). The patchset fixes the skb checksum corruption by moving the IPv6 header payload length initialization from the callers of seg6_do_srh_encap() and seg6_do_srh_inline() directly into these functions. This patchset is organized as follows: - patch 1/3, seg6: fix skb checksum evaluation in SRH encapsulation/insertion; (* SRH encapsulation/insertion available since v4.10) - patch 2/3, seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors; (* SRv6 End.B6 and End.B6.Encaps behaviors available since v4.14) - patch 3/3, seg6: bpf: fix skb checksum in bpf_push_seg6_encap(); (* bpf IPv6 Segment Routing helpers available since v4.18) ==================== Link: https://lore.kernel.org/r/20220712175837.16267-1-andrea.mayer@uniroma2.it Signed-off-by: Paolo Abeni commit 4889fbd98deaf243c3baadc54e296d71c6af1eb0 Author: Andrea Mayer Date: Tue Jul 12 19:58:37 2022 +0200 seg6: bpf: fix skb checksum in bpf_push_seg6_encap() Both helper functions bpf_lwt_seg6_action() and bpf_lwt_push_encap() use the bpf_push_seg6_encap() to encapsulate the packet in an IPv6 with Segment Routing Header (SRH) or insert an SRH between the IPv6 header and the payload. To achieve this result, such helper functions rely on bpf_push_seg6_encap() which, in turn, leverages seg6_do_srh_{encap,inline}() to perform the required operation (i.e. encap/inline). This patch removes the initialization of the IPv6 header payload length from bpf_push_seg6_encap(), as it is now handled properly by seg6_do_srh_{encap,inline}() to prevent corruption of the skb checksum. Fixes: fe94cc290f53 ("bpf: Add IPv6 Segment Routing helpers") Signed-off-by: Andrea Mayer Signed-off-by: Paolo Abeni commit f048880fc77058d864aff5c674af7918b30f312a Author: Andrea Mayer Date: Tue Jul 12 19:58:36 2022 +0200 seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors The SRv6 End.B6 and End.B6.Encaps behaviors rely on functions seg6_do_srh_{encap,inline}() to, respectively: i) encapsulate the packet within an outer IPv6 header with the specified Segment Routing Header (SRH); ii) insert the specified SRH directly after the IPv6 header of the packet. This patch removes the initialization of the IPv6 header payload length from the input_action_end_b6{_encap}() functions, as it is now handled properly by seg6_do_srh_{encap,inline}() to avoid corruption of the skb checksum. Fixes: 140f04c33bbc ("ipv6: sr: implement several seg6local actions") Signed-off-by: Andrea Mayer Signed-off-by: Paolo Abeni commit df8386d13ea280d55beee1b95f61a59234a3798b Author: Andrea Mayer Date: Tue Jul 12 19:58:35 2022 +0200 seg6: fix skb checksum evaluation in SRH encapsulation/insertion Support for SRH encapsulation and insertion was introduced with commit 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels"), through the seg6_do_srh_encap() and seg6_do_srh_inline() functions, respectively. The former encapsulates the packet in an outer IPv6 header along with the SRH, while the latter inserts the SRH between the IPv6 header and the payload. Then, the headers are initialized/updated according to the operating mode (i.e., encap/inline). Finally, the skb checksum is calculated to reflect the changes applied to the headers. The IPv6 payload length ('payload_len') is not initialized within seg6_do_srh_{inline,encap}() but is deferred in seg6_do_srh(), i.e. the caller of seg6_do_srh_{inline,encap}(). However, this operation invalidates the skb checksum, since the 'payload_len' is updated only after the checksum is evaluated. To solve this issue, the initialization of the IPv6 payload length is moved from seg6_do_srh() directly into the seg6_do_srh_{inline,encap}() functions and before the skb checksum update takes place. Fixes: 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels") Reported-by: Paolo Abeni Link: https://lore.kernel.org/all/20220705190727.69d532417be7438b15404ee1@uniroma2.it Signed-off-by: Andrea Mayer Signed-off-by: Paolo Abeni commit fac47b43c760ea90e64b895dba60df0327be7775 Author: Xiubo Li Date: Mon Jul 11 12:11:21 2022 +0800 netfs: do not unlock and put the folio twice check_write_begin() will unlock and put the folio when return non-zero. So we should avoid unlocking and putting it twice in netfs layer. Change the way ->check_write_begin() works in the following two ways: (1) Pass it a pointer to the folio pointer, allowing it to unlock and put the folio prior to doing the stuff it wants to do, provided it clears the folio pointer. (2) Change the return values such that 0 with folio pointer set means continue, 0 with folio pointer cleared means re-get and all error codes indicating an error (no special treatment for -EAGAIN). [ bagasdotme: use Sphinx code text syntax for *foliop pointer ] Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/56423 Link: https://lore.kernel.org/r/cf169f43-8ee7-8697-25da-0204d1b4343e@redhat.com Co-developed-by: David Howells Signed-off-by: Xiubo Li Signed-off-by: David Howells Signed-off-by: Bagas Sanjaya Signed-off-by: Ilya Dryomov commit d16e0b26672066035439b2f49887f6576c4a3689 Author: Alexandre Chartre Date: Wed Jul 13 21:58:08 2022 +0200 x86/entry: Remove UNTRAIN_RET from native_irq_return_ldt UNTRAIN_RET is not needed in native_irq_return_ldt because RET untraining has already been done at this point. In addition, when the RETBleed mitigation is IBPB, UNTRAIN_RET clobbers several registers (AX, CX, DX) so here it trashes user values which are in these registers. Signed-off-by: Alexandre Chartre Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/35b0d50f-12d1-10c3-f5e8-d6c140486d4a@oracle.com commit 33a8573bdfeec5b746aedeea880733a4c7993158 Author: Jiapeng Chong Date: Thu Jul 14 15:29:39 2022 +0800 x86/bugs: Mark retbleed_strings static This symbol is not used outside of bugs.c, so mark it static. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220714072939.71162-1-jiapeng.chong@linux.alibaba.com commit 355bf2e036c954317ddc4a9618b4f7e38ea5a970 Author: Changyuan Lyu Date: Fri Jul 8 13:50:26 2022 -0700 scsi: pm80xx: Set stopped phy's linkrate to Disabled Negotiated link rate needs to be updated to 'Disabled' when phy is stopped. Link: https://lore.kernel.org/r/20220708205026.969161-1-changyuanl@google.com Reviewed-by: Igor Pylypiv Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit e78276cadb669d3e55cffe66bd166ff3c8572e38 Author: Changyuan Lyu Date: Thu Jul 7 10:52:10 2022 -0700 scsi: pm80xx: Fix 'Unknown' max/min linkrate Currently, the data flow of the max/min linkrate in the driver is * in pm8001_get_lrate_mode(): hardcoded value ==> struct sas_phy * in pm8001_bytes_dmaed(): struct pm8001_phy ==> struct sas_phy * in pm8001_phy_control(): libsas data ==> struct pm8001_phy Since pm8001_bytes_dmaed() follows pm8001_get_lrate_mode(), and the fields in struct pm8001_phy are not initialized, sysfs `/sys/class/sas_phy/phy-*/maximum_linkrate` always shows `Unknown`. To fix the issue, change the dataflow to the following: * in pm8001_phy_init(): initial value ==> struct pm8001_phy * in pm8001_get_lrate_mode(): struct pm8001_phy ==> struct sas_phy * in pm8001_phy_control(): libsas data ==> struct pm8001_phy For negotiated linkrate, the current dataflow is: * in pm8001_get_lrate_mode(): iomb data ==> struct asd_sas_phy ==> struct sas_phy * in pm8001_bytes_dmaed(): struct asd_sas_phy ==> struct sas_phy Since pm8001_bytes_dmaed() follows pm8001_get_lrate_mode(), the assignment statements in pm8001_bytes_dmaed() are unnecessary and cleaned up. Link: https://lore.kernel.org/r/20220707175210.528858-1-changyuanl@google.com Reviewed-by: Igor Pylypiv Acked-by: Jack Wang Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit 52a518019ca187227b786f8b8ee20869a97f3af4 Author: Po-Wen Kao Date: Mon Jul 11 22:42:23 2022 +0800 scsi: ufs: core: Fix missing clk change notification on host reset In ufshcd_host_reset_and_restore(), ufshcd_set_clk_freq() is called to scale clock rate. However, this did not call vops->clk_scale_notify() to inform platform driver of clock change. Call ufshcd_scale_clks() instead so that clock change can be properly handled. Link: https://lore.kernel.org/r/20220711144224.17916-2-powen.kao@mediatek.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Po-Wen Kao Signed-off-by: Martin K. Petersen commit 2ae57c995003a7840cb6b5ec5f0c06193695321b Author: Bjorn Andersson Date: Fri Jul 8 17:00:27 2022 -0700 scsi: ufs: core: Drop loglevel of WriteBoost message Commit '3b5f3c0d0548 ("scsi: ufs: core: Tidy up WB configuration code")' changed the log level of the write boost enable/disable notification from debug to info. This results in a lot of noise in the kernel log during normal operation. Drop it back to debug level to avoid this. Link: https://lore.kernel.org/r/20220709000027.3929970-1-bjorn.andersson@linaro.org Fixes: 3b5f3c0d0548 ("scsi: ufs: core: Tidy up WB configuration code") Reviewed-by: Alim Akhtar Acked-by: Bean Huo Signed-off-by: Bjorn Andersson Signed-off-by: Martin K. Petersen commit f46a5a9c679f495c555b7842807db5e886a9e650 Merge: ebe41da5d47ac 7b6f9462a3234 Author: Jakub Kicinski Date: Wed Jul 13 20:16:03 2022 -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 2022-07-12 This series contains updates to ice driver only. Paul fixes detection of E822 devices for firmware update and changes NVM read for snapshot creation to be done in chunks as some systems cannot read the entire NVM in the allotted time. ==================== Link: https://lore.kernel.org/r/20220712164829.7275-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 8312cd3a7b835ae3033a679e5f0014a40e7891c5 Author: Ming Lei Date: Wed Jul 6 20:59:42 2022 +0800 scsi: megaraid: Clear READ queue map's nr_queues The megaraid SCSI driver sets set->nr_maps as 3 if poll_queues is > 0, and blk-mq actually initializes each map's nr_queues as nr_hw_queues. Consequently the driver has to clear READ queue map's nr_queues, otherwise the queue map becomes broken if poll_queues is set as non-zero. Link: https://lore.kernel.org/r/20220706125942.528533-1-ming.lei@redhat.com Fixes: 9e4bec5b2a23 ("scsi: megaraid_sas: mq_poll support") Cc: Kashyap Desai Cc: sumit.saxena@broadcom.com Cc: chandrakanth.patil@broadcom.com Cc: linux-block@vger.kernel.org Cc: Hannes Reinecke Reported-by: Guangwu Zhang Tested-by: Guangwu Zhang Reviewed-by: Bart Van Assche Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit ebe41da5d47ac0fff877e57bd14c54dccf168827 Author: Íñigo Huguet Date: Tue Jul 12 08:26:42 2022 +0200 sfc: fix use after free when disabling sriov Use after free is detected by kfence when disabling sriov. What was read after being freed was vf->pci_dev: it was freed from pci_disable_sriov and later read in efx_ef10_sriov_free_vf_vports, called from efx_ef10_sriov_free_vf_vswitching. Set the pointer to NULL at release time to not trying to read it later. Reproducer and dmesg log (note that kfence doesn't detect it every time): $ echo 1 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs $ echo 0 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs BUG: KFENCE: use-after-free read in efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc] Use-after-free read at 0x00000000ff3c1ba5 (in kfence-#224): efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc] efx_ef10_pci_sriov_disable+0x38/0x70 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xfe/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae kfence-#224: 0x00000000edb8ef95-0x00000000671f5ce1, size=2792, cache=kmalloc-4k allocated by task 6771 on cpu 10 at 3137.860196s: pci_alloc_dev+0x21/0x60 pci_iov_add_virtfn+0x2a2/0x320 sriov_enable+0x212/0x3e0 efx_ef10_sriov_configure+0x67/0x80 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xba/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae freed by task 6771 on cpu 12 at 3170.991309s: device_release+0x34/0x90 kobject_cleanup+0x3a/0x130 pci_iov_remove_virtfn+0xd9/0x120 sriov_disable+0x30/0xe0 efx_ef10_pci_sriov_disable+0x57/0x70 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xfe/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 3c5eb87605e85 ("sfc: create vports for VFs and assign random MAC addresses") Reported-by: Yanghang Liu Signed-off-by: Íñigo Huguet Acked-by: Martin Habets Link: https://lore.kernel.org/r/20220712062642.6915-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski commit 32f319183c439b239294cb2d70ada3564c4c7c39 Author: Steve French Date: Tue Jul 12 00:11:42 2022 -0500 smb3: workaround negprot bug in some Samba servers Mount can now fail to older Samba servers due to a server bug handling padding at the end of the last negotiate context (negotiate contexts typically are rounded up to 8 bytes by adding padding if needed). This server bug can be avoided by switching the order of negotiate contexts, placing a negotiate context at the end that does not require padding (prior to the recent netname context fix this was the case on the client). Fixes: 73130a7b1ac9 ("smb3: fix empty netname context on secondary channels") Reported-by: Julian Sikorski Tested-by: Julian Sikorski Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit fbd74d16890b9f5d08ea69b5282b123c894f8860 Author: Mario Limonciello Date: Wed Jul 13 12:53:46 2022 -0500 ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory When commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") was introduced, we found collateral damage that a number of AMD systems that supported CPPC but didn't advertise support in _OSC stopped having a functional amd-pstate driver. The _OSC was only enforced on Intel systems at that time. This was fixed for the MSR based designs by commit 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported") but some shared memory based designs also support CPPC but haven't advertised support in the _OSC. Add support for those designs as well by hardcoding the list of systems. Fixes: 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") Fixes: 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported") Link: https://lore.kernel.org/all/3559249.JlDtxWtqDm@natalenko.name/ Cc: 5.18+ # 5.18+ Reported-and-tested-by: Oleksandr Natalenko Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 4a57a8400075bc5287c5c877702c68aeae2a033d Author: Ansgar Lößer Date: Wed Jul 13 20:51:44 2022 +0200 vf/remap: return the amount of bytes actually deduplicated When using the FIDEDUPRANGE ioctl, in case of success the requested size is returned. In some cases this might not be the actual amount of bytes deduplicated. This change modifies vfs_dedupe_file_range() to report the actual amount of bytes deduplicated, instead of the requested amount. Link: https://lore.kernel.org/linux-fsdevel/5548ef63-62f9-4f46-5793-03165ceccacc@tu-darmstadt.de/ Reported-by: Ansgar Lößer Reported-by: Max Schlecht Reported-by: Björn Scheuermann Cc: Dave Chinner Cc: Darrick J Wong Signed-off-by: Ansgar Lößer Signed-off-by: Linus Torvalds commit d0b97f3891fb414bd1fd1cb3d83f0f6b9fd0d357 Merge: 5750676b64a56 07fd5b6cdf3cc Author: Linus Torvalds Date: Wed Jul 13 11:47:01 2022 -0700 Merge tag 'cgroup-for-5.19-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fix from Tejun Heo: "Fix an old and subtle bug in the migration path. css_sets are used to track tasks and migrations are tasks moving from a group of css_sets to another group of css_sets. The migration path pins all source and destination css_sets in the prep stage. Unfortunately, it was overloading the same list_head entry to track sources and destinations, which got confused for migrations which are partially identity leading to use-after-frees. Fixed by using dedicated list_heads for tracking sources and destinations" * tag 'cgroup-for-5.19-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Use separate src/dst nodes when preloading css_sets for migration commit 7fccd723912702acfc2d75e8f0596982534f7f24 Merge: dc5cb7a833e83 efa310ba00716 Author: Palmer Dabbelt Date: Wed Jul 13 10:42:57 2022 -0700 Merge tag 'dt-fixes-for-palmer-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git into fixes Microchip RISC-V devicetree fixes for 5.19-rc6 A single fix for mpfs.dtsi: - The l2 cache controller was never hooked up in the dt, so userspace is presented with the wrong topology information, so it has been hooked up. * tag 'dt-fixes-for-palmer-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git: riscv: dts: microchip: hook up the mpfs' l2cache commit 5750676b64a561f7ec920d7c6ba130fc9c7378f3 Author: Dave Chinner Date: Wed Jul 13 17:49:15 2022 +1000 fs/remap: constrain dedupe of EOF blocks If dedupe of an EOF block is not constrainted to match against only other EOF blocks with the same EOF offset into the block, it can match against any other block that has the same matching initial bytes in it, even if the bytes beyond EOF in the source file do not match. Fix this by constraining the EOF block matching to only match against other EOF blocks that have identical EOF offsets and data. This allows "whole file dedupe" to continue to work without allowing eof blocks to randomly match against partial full blocks with the same data. Reported-by: Ansgar Lößer Fixes: 1383a7ed6749 ("vfs: check file ranges before cloning files") Link: https://lore.kernel.org/linux-fsdevel/a7c93559-4ba1-df2f-7a85-55a143696405@tu-darmstadt.de/ Signed-off-by: Dave Chinner Signed-off-by: Linus Torvalds commit 3283c83eb6fcfbda8ea03d7149d8e42e71c5d45e Author: Michel Dänzer Date: Mon Jul 11 16:51:31 2022 +0200 drm/amd/display: Ensure valid event timestamp for cursor-only commits Requires enabling the vblank machinery for them. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2030 Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 47053b1e7382628dd30415685ae257f766a311e4 Author: Melissa Wen Date: Tue Jul 12 10:32:39 2022 -0100 drm/amd/display: correct check of coverage blend mode Check the value of per_pixel_alpha to decide whether the Coverage pixel blend mode is applicable or not. Fixes: 76818cdd11a2 ("drm/amd/display: add Coverage blend mode for overlay plane") Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Harry Wentland Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 0638c98c17aa12fe914459c82cd178247e21fb2b Author: Yefim Barashkin Date: Mon Jul 11 14:35:11 2022 -0800 drm/amd/pm: Prevent divide by zero divide error: 0000 [#1] SMP PTI CPU: 3 PID: 78925 Comm: tee Not tainted 5.15.50-1-lts #1 Hardware name: MSI MS-7A59/Z270 SLI PLUS (MS-7A59), BIOS 1.90 01/30/2018 RIP: 0010:smu_v11_0_set_fan_speed_rpm+0x11/0x110 [amdgpu] Speed is user-configurable through a file. I accidentally set it to zero, and the driver crashed. Reviewed-by: Evan Quan Reviewed-by: André Almeida Signed-off-by: Yefim Barashkin Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit add61d3c31de6a4b5e11a2ab96aaf4c873481568 Author: Mario Kleiner Date: Mon Jul 11 19:39:28 2022 +0200 drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines. Various DCE versions had trouble with 36 bpp lb depth, requiring fixes, last time in commit 353ca0fa5630 ("drm/amd/display: Fix 10bit 4K display on CIK GPUs") for DCE-8. So far >= DCE-11.2 was considered ok, but now I found out that on DCE-11.2 it causes dithering when there shouldn't be any, so identity pixel passthrough with identity gamma LUTs doesn't work when it should. This breaks various important neuroscience applications, as reported to me by scientific users of Polaris cards under Ubuntu 22.04 with Linux 5.15, and confirmed by testing it myself on DCE-11.2. Lets only use depth 36 for DCN engines, where my testing showed that it is both necessary for high color precision output, e.g., RGBA16 fb's, and not harmful, as far as more than one year in real-world use showed. DCE engines seem to work fine for high precision output at 30 bpp, so this ("famous last words") depth 30 should hopefully fix all known problems without introducing new ones. Successfully retested on DCE-11.2 Polaris and DCN-1.0 Raven Ridge on top of Linux 5.19.0-rc2 + drm-next. Fixes: 353ca0fa5630 ("drm/amd/display: Fix 10bit 4K display on CIK GPUs") Signed-off-by: Mario Kleiner Tested-by: Mario Kleiner Cc: stable@vger.kernel.org # 5.14.0 Cc: Alex Deucher Cc: Harry Wentland Signed-off-by: Alex Deucher commit c0044865480a162146b9dfe7783e73a08e97b2b9 Author: Prike Liang Date: Mon Jul 11 16:03:08 2022 +0800 drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7 On the GC 10.3.7 platform the initial MEC release version #3 can support atomic operation,so need correct and set its MEC atomic support version to #3. Signed-off-by: Prike Liang Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit acea108fa067d140bd155161a79b1fcd967f4137 Author: Fangzhi Zuo Date: Wed Jul 6 15:52:46 2022 -0400 drm/amd/display: Ignore First MST Sideband Message Return Error [why] First MST sideband message returns AUX_RET_ERROR_HPD_DISCON on certain intel platform. Aux transaction considered failure if HPD unexpected pulled low. The actual aux transaction success in such case, hence do not return error. [how] Not returning error when AUX_RET_ERROR_HPD_DISCON detected on the first sideband message. v2: squash in additional DMI entries v3: squash in static fix Signed-off-by: Fangzhi Zuo Acked-by: Solomon Chiu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 067d2521874135267e681c19d42761c601d503d6 Author: Jianglei Nie Date: Tue Jul 12 09:10:37 2022 +0800 ima: Fix potential memory leak in ima_init_crypto() On failure to allocate the SHA1 tfm, IMA fails to initialize and exits without freeing the ima_algo_array. Add the missing kfree() for ima_algo_array to avoid the potential memory leak. Signed-off-by: Jianglei Nie Fixes: 6d94809af6b0 ("ima: Allocate and initialize tfm for each PCR bank") Signed-off-by: Mimi Zohar commit af16df54b89dee72df253abc5e7b5e8a6d16c11c Author: Coiby Xu Date: Wed Jul 13 15:21:11 2022 +0800 ima: force signature verification when CONFIG_KEXEC_SIG is configured Currently, an unsigned kernel could be kexec'ed when IMA arch specific policy is configured unless lockdown is enabled. Enforce kernel signature verification check in the kexec_file_load syscall when IMA arch specific policy is configured. Fixes: 99d5cadfde2b ("kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE") Reported-and-suggested-by: Mimi Zohar Signed-off-by: Coiby Xu Signed-off-by: Mimi Zohar commit b11e5f6a3a5c170d16c2cf0b1d8053bbf1f6b7de Author: Nick Bowler Date: Tue Jul 12 21:58:35 2022 -0400 net: sunhme: output link status with a single print. This driver currently prints the link status using four separate printk calls, which these days gets presented to the user as four distinct messages, not exactly ideal: [ 32.582778] eth0: Link is up using [ 32.582828] internal [ 32.582837] transceiver at [ 32.582888] 100Mb/s, Full Duplex. Restructure the display_link_mode function to use a single netdev_info call to present all this information as a single message, which is much nicer: [ 33.640143] hme 0000:00:01.1 eth0: Link is up using internal transceiver at 100Mb/s, Full Duplex. The display_forced_link_mode function has a similar structure, so adjust it in a similar fashion. Signed-off-by: Nick Bowler Signed-off-by: David S. Miller commit 057cc8c9005e23330e368afd18839ce3764dc0af Author: Hayes Wang Date: Wed Jul 13 11:31:11 2022 +0800 r8152: fix accessing unset transport header A warning is triggered by commit 66e4c8d95008 ("net: warn if transport header was not set"). The warning is harmless, because the value from skb_transport_offset() is only used for skb_is_gso() is true or the skb->ip_summed is equal to CHECKSUM_PARTIAL. Fixes: 66e4c8d95008 ("net: warn if transport header was not set") Signed-off-by: Hayes Wang Signed-off-by: David S. Miller commit 67de8acdd375e6f0d4ee9aa5745b9f9b329980b7 Merge: 23aa6d5088e3b 50e2ab3929194 Author: David S. Miller Date: Wed Jul 13 14:27:38 2022 +0100 Merge tag 'wireless-2022-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== A small set of fixes for * queue selection in mesh/ocb * queue handling on interface stop * hwsim virtio device vs. some other virtio changes * dt-bindings email addresses * color collision memory allocation * a const variable in rtw88 * shared SKB transmit in the ethernet format path * P2P client port authorization ==================== Signed-off-by: David S. Miller commit a0b0987a781157263b82f4022649cf686d36c787 Author: Vasily Gorbik Date: Mon Jun 27 14:50:56 2022 +0200 s390/nospec: remove unneeded header includes Commit 4efd417f298b ("s390: raise minimum supported machine generation to z10") removed the usage of alternatives and lowcore in expolines macros. Remove unneeded header includes as well. With that, expoline.S doesn't require asm-offsets.h and expoline_prepare target dependency could be removed. Tested-by: Joe Lawrence Link: https://lore.kernel.org/r/patch-2.thread-d13b6c.git-d13b6c96fb5f.your-ad-here.call-01656331067-ext-4899@work.hours Signed-off-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit c4e789572557aa147b13bf7fe09cc99663ed0cf5 Author: Vasily Gorbik Date: Mon Jun 27 14:50:53 2022 +0200 s390/nospec: build expoline.o for modules_prepare target When CONFIG_EXPOLINE_EXTERN is used expoline thunks are generated from arch/s390/lib/expoline.S and postlinked into every module. This is also true for external modules. Add expoline.o build to the modules_prepare target. Fixes: 1d2ad084800e ("s390/nospec: add an option to use thunk-extern") Reported-by: Joe Lawrence Tested-by: Sumanth Korikkar Acked-by: Sumanth Korikkar Tested-by: C. Erastus Toe Tested-by: Joe Lawrence Link: https://lore.kernel.org/r/patch-1.thread-d13b6c.git-a2387a74dc49.your-ad-here.call-01656331067-ext-4899@work.hours Signed-off-by: Vasily Gorbik Signed-off-by: Alexander Gordeev commit 23aa6d5088e3bd65de77c5c307237b9937f8b48a Author: Dan Carpenter Date: Tue Jul 12 17:42:25 2022 +0300 net: stmmac: fix leaks in probe These two error paths should clean up before returning. Fixes: 2bb4b98b60d7 ("net: stmmac: Add Ingenic SoCs MAC support.") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 49b9f431ff0d845a36be0b3ede35ec324f2e5fee Author: Liang He Date: Tue Jul 12 14:14:17 2022 +0800 net: ftgmac100: Hold reference returned by of_get_child_by_name() In ftgmac100_probe(), we should hold the refernece returned by of_get_child_by_name() and use it to call of_node_put() for reference balance. Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property") Signed-off-by: Liang He Signed-off-by: David S. Miller commit 7d5424b26f17b74d94e73815718b424ad207a3e7 Merge: 22b9c41a3fb8e bdf00bf24bef9 Author: David S. Miller Date: Wed Jul 13 12:56:50 2022 +0100 Merge branch 'net-sysctl-races' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_net_table (Roun). This series fixes data-races around the first 13 knobs and nexthop_compat_mode in ipv4_net_table. I will post another patch for three early_demux knobs later, so the next round will start from ip_default_ttl. ==================== Signed-off-by: David S. Miller commit bdf00bf24bef9be1ca641a6390fd5487873e0d2e Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:33 2022 -0700 nexthop: Fix data-races around nexthop_compat_mode. While reading nexthop_compat_mode, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 4f80116d3df3 ("net: ipv4: add sysctl for nexthop api compatibility mode") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit e49e4aff7ec19b2d0d0957ee30e93dade57dab9e Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:32 2022 -0700 ipv4: Fix data-races around sysctl_ip_dynaddr. While reading sysctl_ip_dynaddr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 12b8d9ca7e678abc48195294494f1815b555d658 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:31 2022 -0700 tcp: Fix a data-race around sysctl_tcp_ecn_fallback. While reading sysctl_tcp_ecn_fallback, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 492135557dc0 ("tcp: add rfc3168, section 6.1.1.1. fallback") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4785a66702f086cf2ea84bdbe6ec921f274bd9f2 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:30 2022 -0700 tcp: Fix data-races around sysctl_tcp_ecn. While reading sysctl_tcp_ecn, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1dace014928e6e385363032d359a04dee9158af0 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:29 2022 -0700 raw: Fix a data-race around sysctl_raw_l3mdev_accept. While reading sysctl_raw_l3mdev_accept, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 6897445fb194 ("net: provide a sysctl raw_l3mdev_accept for raw socket lookup with VRFs") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1ebcb25ad6fc3d50fca87350acf451b9a66dd31e Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:28 2022 -0700 icmp: Fix a data-race around sysctl_icmp_ratemask. While reading sysctl_icmp_ratemask, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 2a4eb714841f288cf51c7d942d98af6a8c6e4b01 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:27 2022 -0700 icmp: Fix a data-race around sysctl_icmp_ratelimit. While reading sysctl_icmp_ratelimit, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit d2efabce81db7eed1c98fa1a3f203f0edd738ac3 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:26 2022 -0700 icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr. While reading sysctl_icmp_errors_use_inbound_ifaddr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1c2fb7f93cb2 ("[IPV4]: Sysctl configurable icmp error source address.") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit b04f9b7e85c7d7aecbada620e8759a662af068d3 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:25 2022 -0700 icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses. While reading sysctl_icmp_ignore_bogus_error_responses, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 66484bb98ed2dfa1dda37a32411483d8311ac269 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:24 2022 -0700 icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts. While reading sysctl_icmp_echo_ignore_broadcasts, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4a2f7083cc6cb72dade9a63699ca352fad26d1cd Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:23 2022 -0700 icmp: Fix data-races around sysctl_icmp_echo_enable_probe. While reading sysctl_icmp_echo_enable_probe, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers. Fixes: d329ea5bd884 ("icmp: add response to RFC 8335 PROBE messages") Fixes: 1fd07f33c3ea ("ipv6: ICMPV6: add response to ICMPV6 RFC 8335 PROBE messages") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit bb7bb35a63b4812da8e3aff587773678e31d23e3 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:22 2022 -0700 icmp: Fix a data-race around sysctl_icmp_echo_ignore_all. While reading sysctl_icmp_echo_ignore_all, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 6f605b57f3782114e330e108ce1903ede22ec675 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:21 2022 -0700 tcp: Fix a data-race around sysctl_max_tw_buckets. While reading sysctl_max_tw_buckets, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 7d1025e559782b58824b36cb8ad547a69f2e4b31 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:20 2022 -0700 sysctl: Fix data-races in proc_dointvec_ms_jiffies(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_dointvec_ms_jiffies() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dointvec_ms_jiffies() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 7dee5d7747a69aa2be41f04c6a7ecfe3ac8cdf18 Author: Kuniyuki Iwashima Date: Mon Jul 11 17:15:19 2022 -0700 sysctl: Fix data-races in proc_dou8vec_minmax(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_dou8vec_minmax() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dou8vec_minmax() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: cb9444130662 ("sysctl: add proc_dou8vec_minmax()") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit d2394860b45c3c1484e4b0a5d09909a1e3f6569e Author: AngeloGioacchino Del Regno Date: Wed Jul 13 13:15:36 2022 +0200 cpufreq: mediatek: Handle sram regulator probe deferral If the regulator_get_optional() call for the SRAM regulator returns a probe deferral, we must bail out and retry probing later: failing to do this will produce unstabilities on platforms requiring the handling for this regulator. Fixes: ffa7bdf7f344 ("cpufreq: mediatek: Make sram regulator optional") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 230ec83d4299b30c51a1c133b4f2a669972cc08a Author: Juergen Gross Date: Fri Jul 8 15:14:56 2022 +0200 x86/pat: Fix x86_has_pat_wp() x86_has_pat_wp() is using a wrong test, as it relies on the normal PAT configuration used by the kernel. In case the PAT MSR has been setup by another entity (e.g. Xen hypervisor) it might return false even if the PAT configuration is allowing WP mappings. This due to the fact that when running as Xen PV guest the PAT MSR is setup by the hypervisor and cannot be changed by the guest. This results in the WP related entry to be at a different position when running as Xen PV guest compared to the bare metal or fully virtualized case. The correct way to test for WP support is: 1. Get the PTE protection bits needed to select WP mode by reading __cachemode2pte_tbl[_PAGE_CACHE_MODE_WP] (depending on the PAT MSR setting this might return protection bits for a stronger mode, e.g. UC-) 2. Translate those bits back into the real cache mode selected by those PTE bits by reading __pte2cachemode_tbl[__pte2cm_idx(prot)] 3. Test for the cache mode to be _PAGE_CACHE_MODE_WP Fixes: f88a68facd9a ("x86/mm: Extend early_memremap() support with additional attrs") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Cc: # 4.14 Link: https://lore.kernel.org/r/20220503132207.17234-1-jgross@suse.com commit 3131ef39fb03bbde237d0b8260445898f3dfda5b Author: Jiri Slaby Date: Wed Jul 13 11:50:46 2022 +0200 x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit The build on x86_32 currently fails after commit 9bb2ec608a20 (objtool: Update Retpoline validation) with: arch/x86/kernel/../../x86/xen/xen-head.S:35: Error: no such instruction: `annotate_unret_safe' ANNOTATE_UNRET_SAFE is defined in nospec-branch.h. And head_32.S is missing this include. Fix this. Fixes: 9bb2ec608a20 ("objtool: Update Retpoline validation") Signed-off-by: Jiri Slaby Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/63e23f80-033f-f64e-7522-2816debbc367@kernel.org commit 9b043a8f386485c74c0f8eea2c287d5bdbdf3279 Author: Meng Tang Date: Wed Jul 13 17:41:33 2022 +0800 ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop The headset on this machine is not defined, after applying the quirk ALC256_FIXUP_ASUS_HEADSET_MIC, the headset-mic works well Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220713094133.9894-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 51189eb9ddc88851edc42f539a0f9862fd0630c2 Author: Tony Lindgren Date: Wed Jun 22 08:12:15 2022 +0300 mmc: sdhci-omap: Fix a lockdep warning for PM runtime init We need runtime PM enabled early in probe before sdhci_setup_host() for sdhci_omap_set_capabilities(). But on the first runtime resume we must not call sdhci_runtime_resume_host() as sdhci_setup_host() has not been called yet. Let's check for an initialized controller like we already do for context restore to fix a lockdep warning. Fixes: f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions") Reported-by: Yegor Yefremov Suggested-by: Arnd Bergmann Signed-off-by: Tony Lindgren Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220622051215.34063-1-tony@atomide.com Signed-off-by: Ulf Hansson commit 68e3c69803dada336893640110cb87221bb01dcf Author: Peter Zijlstra Date: Tue Jul 5 15:07:26 2022 +0200 perf/core: Fix data race between perf_event_set_output() and perf_mmap_close() Yang Jihing reported a race between perf_event_set_output() and perf_mmap_close(): CPU1 CPU2 perf_mmap_close(e2) if (atomic_dec_and_test(&e2->rb->mmap_count)) // 1 - > 0 detach_rest = true ioctl(e1, IOC_SET_OUTPUT, e2) perf_event_set_output(e1, e2) ... list_for_each_entry_rcu(e, &e2->rb->event_list, rb_entry) ring_buffer_attach(e, NULL); // e1 isn't yet added and // therefore not detached ring_buffer_attach(e1, e2->rb) list_add_rcu(&e1->rb_entry, &e2->rb->event_list) After this; e1 is attached to an unmapped rb and a subsequent perf_mmap() will loop forever more: again: mutex_lock(&e->mmap_mutex); if (event->rb) { ... if (!atomic_inc_not_zero(&e->rb->mmap_count)) { ... mutex_unlock(&e->mmap_mutex); goto again; } } The loop in perf_mmap_close() holds e2->mmap_mutex, while the attach in perf_event_set_output() holds e1->mmap_mutex. As such there is no serialization to avoid this race. Change perf_event_set_output() to take both e1->mmap_mutex and e2->mmap_mutex to alleviate that problem. Additionally, have the loop in perf_mmap() detach the rb directly, this avoids having to wait for the concurrent perf_mmap_close() to get around to doing it to make progress. Fixes: 9bb5d40cd93c ("perf: Fix mmap() accounting hole") Reported-by: Yang Jihong Signed-off-by: Peter Zijlstra (Intel) Tested-by: Yang Jihong Link: https://lkml.kernel.org/r/YsQ3jm2GR38SW7uD@worktop.programming.kicks-ass.net commit d332a1f6b4c4b07bf984f04df897818c7c7fce8f Merge: 52905140c3ed4 03110b46c99bb Author: Arnd Bergmann Date: Wed Jul 13 09:37:20 2022 +0200 Merge tag 'qcom-dts-fixes-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm DTS fixe for 5.19 The pinctrl state was lost in the recent refactoring of the MSM8974 Devicetree, this contains a fix for this. * tag 'qcom-dts-fixes-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: msm8974: re-add missing pinctrl Link: https://lore.kernel.org/r/20220713030627.1371156-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 52905140c3ed42a16644650d431cdd1051a0a337 Merge: 01277737e9bed 8bd582ae9a71d Author: Arnd Bergmann Date: Wed Jul 13 09:35:55 2022 +0200 Merge tag 'arm-soc/for-5.19/devicetree-arm64-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM64-based SoCs Device Tree fixes for 5.19, please pull the following: - William corrects the BCM4906 DTS to have an armv8-timer Device Tree, necessary for booting, and fixes the BCM4908 DTS to have a proper 'enable-method' and 'cpu-release-addr' properties for the kernel to boot when using u-boot * tag 'arm-soc/for-5.19/devicetree-arm64-fixes' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC Link: https://lore.kernel.org/r/20220712231222.97850-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 4ba5c853d7945b3855c3dcb293f7f9f019db641e Author: Meng Tang Date: Wed Jul 13 14:33:32 2022 +0800 ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc221 On a HP 288 Pro G2 MT (X9W02AV), the front mic could not be detected. In order to get it working, the pin configuration needs to be set correctly, and the ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE fixup needs to be applied. Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220713063332.30095-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 61d307855eb1a2ae849da445edd5389db8a58a5c Author: Jeremy Szu Date: Wed Jul 13 10:27:04 2022 +0800 ALSA: hda/realtek: fix mute/micmute LEDs for HP machines The HP ProBook 440/450 G9 and EliteBook 640/650 G9 have multiple motherboard design and they are using different subsystem ID of audio codec. Add the same quirk for other MBs. Signed-off-by: Jeremy Szu Cc: Link: https://lore.kernel.org/r/20220713022706.22892-1-jeremy.szu@canonical.com Signed-off-by: Takashi Iwai commit 7c239a071d1f04b7137789810807b4108d475c72 Author: Lucien Buchmann Date: Sat Jun 25 02:17:44 2022 +0200 USB: serial: ftdi_sio: add Belimo device ids Those two product ids are known. Signed-off-by: Lucien Buchmann Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 22b9c41a3fb8ef4624bcda312665937d2ba98aa7 Merge: f946964a9f79f ddde5412fdaa5 Author: Jakub Kicinski Date: Tue Jul 12 20:36:00 2022 -0700 Merge branch 'bnxt_en-5-bug-fixes' Michael Chan says: ==================== bnxt_en: 5 Bug fixes This patchset fixes various issues, including SRIOV error unwinding, one error recovery path, live patch reporting, XDP transmit path, and PHC clock reading. ==================== Link: https://lore.kernel.org/r/1657592778-12730-1-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit ddde5412fdaa5048bbca31529d46cb8da882870c Author: Pavan Chebbi Date: Mon Jul 11 22:26:18 2022 -0400 bnxt_en: Fix bnxt_refclk_read() The upper 32-bit PHC register is not latched when reading the lower 32-bit PHC register. Current code leaves a small window where we may not read correct higher order bits if the lower order bits are just about to wrap around. This patch fixes this by reading higher order bits twice and makes sure that final value is correctly paired with its lower 32 bits. Fixes: 30e96f487f64 ("bnxt_en: Do not read the PTP PHC during chip reset") Cc: Richard Cochran Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 53f8c2d37efb5b03b9527ad04332df3bb889f0fa Author: Michael Chan Date: Mon Jul 11 22:26:17 2022 -0400 bnxt_en: Fix and simplify XDP transmit path Fix the missing length hint in the TX BD for the XDP transmit path. The length hint is required on legacy chips. Also, simplify the code by eliminating the first_buf local variable. tx_buf contains the same value. The opaque value only needs to be set on the first BD. Fix this also for correctness. Fixes: a7559bc8c17c ("bnxt: support transmit and free of aggregation buffers") Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 619b9b1622c283cc5ca86f4c487db266a8f55dab Author: Vikas Gupta Date: Mon Jul 11 22:26:16 2022 -0400 bnxt_en: fix livepatch query In the livepatch query fw_target BNXT_FW_SRT_PATCH is applicable for P5 chips only. Fixes: 3c4153394e2c ("bnxt_en: implement firmware live patching") Reviewed-by: Saravanan Vajravel Reviewed-by: Somnath Kotur Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 4279414bff8af9898e8c53ae6c5bc17f68ad67b7 Author: Michael Chan Date: Mon Jul 11 22:26:15 2022 -0400 bnxt_en: Fix bnxt_reinit_after_abort() code path bnxt_reinit_after_abort() is called during ifup when a previous FW reset sequence has aborted or a previous ifup has failed after detecting FW reset. In all cases, it is safe to assume that a previous FW reset has completed and the driver may not have fully reinitialized. Prior to this patch, it is assumed that the FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE flag will always be set by the firmware in bnxt_hwrm_if_change(). This may not be true if the driver has already attempted to register with the firmware. The firmware may not set the RESET_DONE flag again after the driver has registered, assuming that the driver has seen the flag already. Fix it to always go through the FW reset initialization path if the BNXT_STATE_FW_RESET_DET flag is set. This flag is always set by the driver after successfully going through bnxt_reinit_after_abort(). Fixes: 6882c36cf82e ("bnxt_en: attempt to reinitialize after aborted reset") Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit c5b744d38c36a407a41e918602eec4d89730787b Author: Kashyap Desai Date: Mon Jul 11 22:26:14 2022 -0400 bnxt_en: reclaim max resources if sriov enable fails If bnxt_sriov_enable() fails after some resources have been reserved for the VFs, the current code is not unwinding properly and the reserved resources become unavailable afterwards. Fix it by properly unwinding with a call to bnxt_hwrm_func_qcaps() to reset all maximum resources. Also, add the missing bnxt_ulp_sriov_cfg() call to let the RDMA driver know to abort. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Signed-off-by: Kashyap Desai Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit b047602d579b4fb028128a525f056bbdc890e7f0 Merge: 72a8e05d4f66b 1e1fb420fe68d Author: Linus Torvalds Date: Tue Jul 12 16:17:40 2022 -0700 Merge tag 'trace-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Fixes and minor clean ups for tracing: - Fix memory leak by reverting what was thought to be a double free. A static tool had gave a false positive that a double free was possible in the error path, but it was actually a different location that confused the static analyzer (and those of us that reviewed it). - Move use of static buffers by ftrace_dump() to a location that can be used by kgdb's ftdump(), as it needs it for the same reasons. - Clarify in the Kconfig description that function tracing has negligible impact on x86, but may have a bit bigger impact on other architectures. - Remove unnecessary extra semicolon in trace event. - Make a local variable static that is used in the fprobes sample - Use KSYM_NAME_LEN for length of function in kprobe sample and get rid of unneeded macro for the same purpose" * tag 'trace-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: samples: Use KSYM_NAME_LEN for kprobes fprobe/samples: Make sample_probe static blk-iocost: tracing: atomic64_read(&ioc->vtime_rate) is assigned an extra semicolon ftrace: Be more specific about arch impact when function tracer is enabled tracing: Fix sleeping while atomic in kdb ftdump tracing/histograms: Fix memory leak problem commit 333991c4e66b3d4b5613315f18016da80344f659 Author: Andrzej Hajda Date: Fri Jun 24 13:35:28 2022 +0200 drm/i915/selftests: fix subtraction overflow bug On some machines hole_end can be small enough to cause subtraction overflow. On the other side (addr + 2 * min_alignment) can overflow in case of mock tests. This patch should handle both cases. Fixes: e1c5f754067b59 ("drm/i915: Avoid overflow in computing pot_hole loop termination") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3674 Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20220624113528.2159210-1-andrzej.hajda@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit ab3edc679c552a466e4bf0b11af3666008bd65a2) Signed-off-by: Rodrigo Vivi commit ad765fae792e16ce3c1d0b69ce939e3f7dba40ab Author: Chris Wilson Date: Fri Jul 8 16:20:11 2022 +0200 drm/i915/gem: Look for waitboosting across the whole object prior to individual waits We employ a "waitboost" heuristic to detect when userspace is stalled waiting for results from earlier execution. Under latency sensitive work mixed between the gpu/cpu, the GPU is typically under-utilised and so RPS sees that low utilisation as a reason to downclock the frequency, causing longer stalls and lower throughput. The user left waiting for the results is not impressed. On applying commit 047a1b877ed4 ("dma-buf & drm/amdgpu: remove dma_resv workaround") it was observed that deinterlacing h264 on Haswell performance dropped by 2-5x. The reason being that the natural workload was not intense enough to trigger RPS (using HW evaluation intervals) to upclock, and so it was depending on waitboosting for the throughput. Commit 047a1b877ed4 ("dma-buf & drm/amdgpu: remove dma_resv workaround") changes the composition of dma-resv from keeping a single write fence + multiple read fences, to a single array of multiple write and read fences (a maximum of one pair of write/read fences per context). The iteration order was also changed implicitly from all-read fences then the single write fence, to a mix of write fences followed by read fences. It is that ordering change that belied the fragility of waitboosting. Currently, a waitboost is inspected at the point of waiting on an outstanding fence. If the GPU is backlogged such that we haven't yet stated the request we need to wait on, we force the GPU to upclock until the completion of that request. By changing the order in which we waited upon requests, we ended up waiting on those requests in sequence and as such we saw that each request was already started and so not a suitable candidate for waitboosting. Instead of asking whether to boost each fence in turn, we can look at whether boosting is required for the dma-resv ensemble prior to waiting on any fence, making the heuristic more robust to the order in which fences are stored in the dma-resv. Reported-by: Thomas Voegtle Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6284 Fixes: 047a1b877ed4 ("dma-buf & drm/amdgpu: remove dma_resv workaround") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Signed-off-by: Karolina Drobnik Tested-by: Thomas Voegtle Reviewed-by: Andi Shyti Acked-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/07e05518d9f6620d20cc1101ec1849203fe973f9.1657289332.git.karolina.drobnik@intel.com (cherry picked from commit 394e2b57a989113de494c52d4683444bcb02d4e1) Signed-off-by: Rodrigo Vivi commit a1c5a7bf79c1faa5633b918b5c0666545e84c4d1 Author: Chris Wilson Date: Tue Jul 12 16:21:33 2022 +0100 drm/i915/gt: Serialize TLB invalidates with GT resets Avoid trying to invalidate the TLB in the middle of performing an engine reset, as this may result in the reset timing out. Currently, the TLB invalidate is only serialised by its own mutex, forgoing the uncore lock, but we can take the uncore->lock as well to serialise the mmio access, thereby serialising with the GDRST. Tested on a NUC5i7RYB, BIOS RYBDWi35.86A.0380.2019.0517.1530 with i915 selftest/hangcheck. Cc: stable@vger.kernel.org # v4.4 and upper Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Reported-by: Mauro Carvalho Chehab Tested-by: Mauro Carvalho Chehab Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Reviewed-by: Andi Shyti Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/1e59a7c45dd919a530256b9ac721ac6ea86c0677.1657639152.git.mchehab@kernel.org (cherry picked from commit 33da97894758737895e90c909f16786052680ef4) Signed-off-by: Rodrigo Vivi commit b24dcf1dc507f69ed3b5c66c2b6a0209ae80d4d4 Author: Chris Wilson Date: Tue Jul 12 16:21:32 2022 +0100 drm/i915/gt: Serialize GRDOM access between multiple engine resets Don't allow two engines to be reset in parallel, as they would both try to select a reset bit (and send requests to common registers) and wait on that register, at the same time. Serialize control of the reset requests/acks using the uncore->lock, which will also ensure that no other GT state changes at the same time as the actual reset. Cc: stable@vger.kernel.org # v4.4 and upper Reported-by: Mika Kuoppala Signed-off-by: Chris Wilson Acked-by: Mika Kuoppala Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/e0a2d894e77aed7c2e36b0d1abdc7dbac3011729.1657639152.git.mchehab@kernel.org (cherry picked from commit 336561a914fc0c6f1218228718f633b31b7af1c3) Signed-off-by: Rodrigo Vivi commit aff1e0b09b54b64944b7fe32997229552737b9e9 Author: Matthew Auld Date: Mon Jul 11 09:58:59 2022 +0100 drm/i915/ttm: fix sg_table construction If we encounter some monster sized local-memory page that exceeds the maximum sg length (UINT32_MAX), ensure that don't end up with some misaligned address in the entry that follows, leading to fireworks later. Also ensure we have some coverage of this in the selftests. v2(Chris): - Use round_down consistently to avoid udiv errors v3(Nirmoy): - Also update the max_segment in the selftest Fixes: f701b16d4cc5 ("drm/i915/ttm: add i915_sg_from_buddy_resource") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6379 Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220711085859.24198-1-matthew.auld@intel.com (cherry picked from commit bc99f1209f19fefa3ee11e77464ccfae541f4291) Signed-off-by: Rodrigo Vivi commit 896dcabd1f8f613c533d948df17408c41f8929f5 Author: Dan Carpenter Date: Fri Jul 8 12:41:04 2022 +0300 drm/i915/selftests: fix a couple IS_ERR() vs NULL tests The shmem_pin_map() function doesn't return error pointers, it returns NULL. Fixes: be1cb55a07bf ("drm/i915/gt: Keep a no-frills swappable copy of the default context state") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220708094104.GL2316@kadam (cherry picked from commit d50f5a109cf4ed50c5b575c1bb5fc3bd17b23308) Signed-off-by: Rodrigo Vivi commit f99546298a4537965b75d518c210742f641be389 Merge: 48da0f67c53ee e87197fbd137c Author: Rodrigo Vivi Date: Tue Jul 12 18:21:10 2022 -0400 Merge tag 'gvt-fixes-2022-07-11' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2022-07-11 - Fix return value for shmem_pin_map() Signed-off-by: Rodrigo Vivi From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20220711052021.GV1089@zhen-hp.sh.intel.com commit 48da0f67c53eecd2594c302be6c8a665b7740eaf Author: Thomas Hellström Date: Mon Jun 20 14:36:59 2022 +0200 drm/i915: Fix vm use-after-free in vma destruction In vma destruction, the following race may occur: Thread 1: Thread 2: i915_vma_destroy(); ... list_del_init(vma->vm_link); ... mutex_unlock(vma->vm->mutex); __i915_vm_release(); release_references(); And in release_reference() we dereference vma->vm to get to the vm gt pointer, leading to a use-after free. However, __i915_vm_release() grabs the vm->mutex so the vm won't be destroyed before vma->vm->mutex is released, so extract the gt pointer under the vm->mutex to avoid the vma->vm dereference in release_references(). v2: Fix a typo in the commit message (Andi Shyti) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5944 Fixes: e1a7ab4fca0c ("drm/i915: Remove the vm open count") Cc: Niranjana Vishwanathapura Cc: Matthew Auld Signed-off-by: Thomas Hellström Acked-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220620123659.381772-1-thomas.hellstrom@linux.intel.com (cherry picked from commit 1926a6b75954fc1a8b44d10bd0c67db957b78cf7) Signed-off-by: Rodrigo Vivi commit 1391b9cfd35bb8f10785a17cb4bb5ea8d10faaae Author: Daniele Ceraolo Spurio Date: Tue Jun 21 16:30:05 2022 -0700 drm/i915/guc: ADL-N should use the same GuC FW as ADL-S The only difference between the ADL S and P GuC FWs is the HWConfig support. ADL-N does not support HWConfig, so we should use the same binary as ADL-S, otherwise the GuC might attempt to fetch a config table that does not exist. ADL-N is internally identified as an ADL-P, so we need to special-case it in the FW selection code. Fixes: 7e28d0b26759 ("drm/i915/adl-n: Enable ADL-N platform") Cc: John Harrison Cc: Tejas Upadhyay Cc: Anusha Srivatsa Cc: Jani Nikula Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220621233005.3952293-1-daniele.ceraolospurio@intel.com (cherry picked from commit 971e4a9781742aaad1587e25fd5582b2dd595ef8) Signed-off-by: Rodrigo Vivi commit 046cd8a2a9eec7c2b46b03958a2b6252ddff55b2 Author: Hangyu Hua Date: Fri Jun 24 06:04:06 2022 -0700 drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector() If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free. Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector") Signed-off-by: Hangyu Hua Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220624130406.17996-1-jose.souza@intel.com Signed-off-by: José Roberto de Souza (cherry picked from commit cea9ed611e85d36a05db52b6457bf584b7d969e2) Signed-off-by: Rodrigo Vivi commit 1e1fb420fe68d9d938db360fec700dfd230cc22a Author: Tiezhu Yang Date: Wed Jun 8 09:23:22 2022 +0800 samples: Use KSYM_NAME_LEN for kprobes It is better and enough to use KSYM_NAME_LEN for kprobes in samples, no need to define and use the other values. Link: https://lkml.kernel.org/r/1654651402-21552-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit e3655dfa58053d614ca9601c36657b469402650f Author: sunliming Date: Mon Jun 6 15:56:59 2022 +0800 fprobe/samples: Make sample_probe static This symbol is not used outside of fprobe_example.c, so marks it static. Fixes the following warning: sparse warnings: (new ones prefixed by >>) >> samples/fprobe/fprobe_example.c:23:15: sparse: sparse: symbol 'sample_probe' was not declared. Should it be static? Link: https://lkml.kernel.org/r/20220606075659.674556-1-sunliming@kylinos.cn Reported-by: kernel test robot Signed-off-by: sunliming Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 0bb7e14c8e15ad78b7300e7d89a615ea8b8c89a9 Author: Li kunyu Date: Wed Jun 29 11:00:13 2022 +0800 blk-iocost: tracing: atomic64_read(&ioc->vtime_rate) is assigned an extra semicolon Remove extra semicolon. Link: https://lkml.kernel.org/r/20220629030013.10362-1-kunyu@nfschina.com Cc: Tejun Heo Cc: Jens Axboe Signed-off-by: Li kunyu Signed-off-by: Steven Rostedt (Google) commit 0a6d7d45414a77876e8e9a77e454af754cea3a60 Author: Steven Rostedt (Google) Date: Wed Jul 6 16:12:31 2022 -0400 ftrace: Be more specific about arch impact when function tracer is enabled It was brought up that on ARMv7, that because the FUNCTION_TRACER does not use nops to keep function tracing disabled because of the use of a link register, it does have some performance impact. The start of functions when -pg is used to compile the kernel is: push {lr} bl 8010e7c0 <__gnu_mcount_nc> When function tracing is tuned off, it becomes: push {lr} add sp, sp, #4 Which just puts the stack back to its normal location. But these two instructions at the start of every function does incur some overhead. Be more honest in the Kconfig FUNCTION_TRACER description and specify that the overhead being in the noise was x86 specific, but other architectures may vary. Link: https://lore.kernel.org/all/20220705105416.GE5208@pengutronix.de/ Link: https://lkml.kernel.org/r/20220706161231.085a83da@gandalf.local.home Reported-by: Sascha Hauer Acked-by: Sascha Hauer Signed-off-by: Steven Rostedt (Google) commit 495fcec8648cdfb483b5b9ab310f3839f07cb3b8 Author: Douglas Anderson Date: Fri Jul 8 17:09:52 2022 -0700 tracing: Fix sleeping while atomic in kdb ftdump If you drop into kdb and type "ftdump" you'll get a sleeping while atomic warning from memory allocation in trace_find_next_entry(). This appears to have been caused by commit ff895103a84a ("tracing: Save off entry when peeking at next entry"), which added the allocation in that path. The problematic commit was already fixed by commit 8e99cf91b99b ("tracing: Do not allocate buffer in trace_find_next_entry() in atomic") but that fix missed the kdb case. The fix here is easy: just move the assignment of the static buffer to the place where it should have been to begin with: trace_init_global_iter(). That function is called in two places, once is right before the assignment of the static buffer added by the previous fix and once is in kdb. Note that it appears that there's a second static buffer that we need to assign that was added in commit efbbdaa22bb7 ("tracing: Show real address for trace event arguments"), so we'll move that too. Link: https://lkml.kernel.org/r/20220708170919.1.I75844e5038d9425add2ad853a608cb44bb39df40@changeid Fixes: ff895103a84a ("tracing: Save off entry when peeking at next entry") Fixes: efbbdaa22bb7 ("tracing: Show real address for trace event arguments") Signed-off-by: Douglas Anderson Signed-off-by: Steven Rostedt (Google) commit 7edc3945bdce9c39198a10d6129377a5c53559c2 Author: Zheng Yejian Date: Mon Jul 11 09:47:31 2022 +0800 tracing/histograms: Fix memory leak problem This reverts commit 46bbe5c671e06f070428b9be142cc4ee5cedebac. As commit 46bbe5c671e0 ("tracing: fix double free") said, the "double free" problem reported by clang static analyzer is: > In parse_var_defs() if there is a problem allocating > var_defs.expr, the earlier var_defs.name is freed. > This free is duplicated by free_var_defs() which frees > the rest of the list. However, if there is a problem allocating N-th var_defs.expr: + in parse_var_defs(), the freed 'earlier var_defs.name' is actually the N-th var_defs.name; + then in free_var_defs(), the names from 0th to (N-1)-th are freed; IF ALLOCATING PROBLEM HAPPENED HERE!!! -+ \ | 0th 1th (N-1)-th N-th V +-------------+-------------+-----+-------------+----------- var_defs: | name | expr | name | expr | ... | name | expr | name | /// +-------------+-------------+-----+-------------+----------- These two frees don't act on same name, so there was no "double free" problem before. Conversely, after that commit, we get a "memory leak" problem because the above "N-th var_defs.name" is not freed. If enable CONFIG_DEBUG_KMEMLEAK and inject a fault at where the N-th var_defs.expr allocated, then execute on shell like: $ echo 'hist:key=call_site:val=$v1,$v2:v1=bytes_req,v2=bytes_alloc' > \ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger Then kmemleak reports: unreferenced object 0xffff8fb100ef3518 (size 8): comm "bash", pid 196, jiffies 4295681690 (age 28.538s) hex dump (first 8 bytes): 76 31 00 00 b1 8f ff ff v1...... backtrace: [<0000000038fe4895>] kstrdup+0x2d/0x60 [<00000000c99c049a>] event_hist_trigger_parse+0x206f/0x20e0 [<00000000ae70d2cc>] trigger_process_regex+0xc0/0x110 [<0000000066737a4c>] event_trigger_write+0x75/0xd0 [<000000007341e40c>] vfs_write+0xbb/0x2a0 [<0000000087fde4c2>] ksys_write+0x59/0xd0 [<00000000581e9cdf>] do_syscall_64+0x3a/0x80 [<00000000cf3b065c>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Link: https://lkml.kernel.org/r/20220711014731.69520-1-zhengyejian1@huawei.com Cc: stable@vger.kernel.org Fixes: 46bbe5c671e0 ("tracing: fix double free") Reported-by: Hulk Robot Suggested-by: Steven Rostedt Reviewed-by: Tom Zanussi Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 7b6f9462a3234c35cf808453d39a074a04e71de1 Author: Paul M Stillwell Jr Date: Wed Jun 8 14:48:32 2022 -0700 ice: change devlink code to read NVM in blocks When creating a snapshot of the NVM the driver needs to read the entire contents from the NVM and store it. The NVM reads are protected by a lock that is shared between the driver and the firmware. If the driver takes too long to read the entire NVM (which can happen on some systems) then the firmware could reclaim the lock and cause subsequent reads from the driver to fail. We could fix this by increasing the timeout that we pass to the firmware, but we could end up in the same situation again if the system is slow. Instead have the driver break the reading of the NVM into blocks that are small enough that we have confidence that the read will complete within the timeout time, but large enough not to cause significant AQ overhead. Fixes: dce730f17825 ("ice: add a devlink region for dumping NVM contents") Signed-off-by: Paul M Stillwell Jr Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit f52d166819a4d8e0d5cca07d8a8dd6397c96dcf1 Author: Paul M Stillwell Jr Date: Wed Jun 8 14:09:52 2022 -0700 ice: handle E822 generic device ID in PLDM header The driver currently presumes that the record data in the PLDM header of the firmware image will match the device ID of the running device. This is true for E810 devices. It appears that for E822 devices that this is not guaranteed to be true. Fix this by adding a check for the generic E822 device. Fixes: d69ea414c9b4 ("ice: implement device flash update via devlink") Signed-off-by: Paul M Stillwell Jr Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 72a8e05d4f66b5af7854df4490e3135168694b6b Merge: 29851567d1aa8 4a47c6385bb4e Author: Linus Torvalds Date: Tue Jul 12 08:59:35 2022 -0700 Merge tag 'ovl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs fix from Miklos Szeredi: "Add a temporary fix for posix acls on idmapped mounts introduced in this cycle. A proper fix will be added in the next cycle" * tag 'ovl-fixes-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: turn off SB_POSIXACL with idmapped layers temporarily commit 29851567d1aa8f0045170545d2e1a5d7a4057667 Merge: 0d8ba24e72b6e 3590b44b9434a Author: Linus Torvalds Date: Tue Jul 12 08:52:15 2022 -0700 Merge tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "I see you picked up one of the fbdev fixes, this is the other stuff that was queued up last week. A bit of a scattering of fixes, three for i915, one amdgpu, and a couple of panfrost, rockchip, panel and bridge ones. amdgpu: - Hibernation fix dma-buf: - fix use after free of fence i915: - Fix a possible refcount leak in DP MST connector (Hangyu) - Fix on loading guc on ADL-N (Daniele) - Fix vm use-after-free in vma destruction (Thomas) bridge: - fsl-ldb : 3 LVDS modesetting fixes rockchip: - iommu domain fix panfrost: - fix memory corruption - error path fix panel: - orientation quirk fix for Yoga tablet 2 ssd130x: - fix pre-charge period setting" * tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm: drm/ssd130x: Fix pre-charge period setting dma-buf: Fix one use-after-free of fence drm/i915: Fix vm use-after-free in vma destruction drm/i915/guc: ADL-N should use the same GuC FW as ADL-S drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector() drm/amdgpu/display: disable prefer_shadow for generic fb helpers drm/amdgpu: keep fbdev buffers pinned during suspend drm/panfrost: Fix shrinker list corruption by madvise IOCTL drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error drm/rockchip: Detach from ARM DMA domain in attach_device drm/bridge: fsl-ldb: Drop DE signal polarity inversion drm/bridge: fsl-ldb: Enable split mode for LVDS dual link drm/bridge: fsl-ldb: Fix mode clock rate validation drm/aperture: Run fbdev removal before internal helpers drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Tablet 2 830 commit 0d8ba24e72b6ec45b1d62148c711bad54483b29a Merge: ce114c866860a c27c753ea6fd1 Author: Linus Torvalds Date: Tue Jul 12 08:40:09 2022 -0700 Merge tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull lockdep fix for x86 retbleed from Borislav Petkov: - Fix lockdep complaint for __static_call_fixup() * tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/static_call: Serialize __static_call_fixup() properly commit 2883f4b5a0e1ac9472c7e3ae9bbdb4ea5a2117c6 Author: Shyam Prasad N Date: Wed Jul 6 14:29:12 2022 +0000 cifs: remove unnecessary locking of chan_lock while freeing session In cifs_put_smb_ses, when we're freeing the last ref count to the session, we need to free up each channel. At this point, it is unnecessary to take chan_lock, since we have the last reference to the ses. Picking up this lock also introduced a deadlock because it calls cifs_put_tcp_ses, which locks cifs_tcp_ses_lock. Signed-off-by: Shyam Prasad N Acked-by: Enzo Matsumiya Signed-off-by: Steve French commit 50bd7d5a647bdf533575111c5335f49707c2ce2f Author: Shyam Prasad N Date: Tue Jul 5 11:16:24 2022 +0000 cifs: fix race condition with delayed threads On failure to create a new channel, first cancel the delayed threads, which could try to search for this channel, and not find it. The other option was to put the tcp session for the channel first, before decrementing chan_count. But that would leave a reference to the tcp session, when it has been freed already. So going with the former option and cancelling the delayed works first, before rolling back the channel. Fixes: aa45dadd34e4 ("cifs: change iface_list from array to sorted linked list") Signed-off-by: Shyam Prasad N Acked-by: Enzo Matsumiya Signed-off-by: Steve French commit a77c46f2b4d48a81f36442ee0c2160baebf6c1a0 Author: Han Xu Date: Mon Jul 11 11:08:02 2022 -0500 MAINTAINERS: change the NXP FSPI driver maintainer. Haibo Chen and me will take over the NXP FSPI driver maintainer role. Signed-off-by: Han Xu Link: https://lore.kernel.org/r/20220711160802.4938-1-han.xu@nxp.com Signed-off-by: Mark Brown commit c27c753ea6fd1237f4f96abf8b623d7bab505513 Author: Thomas Gleixner Date: Tue Jul 12 14:01:06 2022 +0200 x86/static_call: Serialize __static_call_fixup() properly __static_call_fixup() invokes __static_call_transform() without holding text_mutex, which causes lockdep to complain in text_poke_bp(). Adding the proper locking cures that, but as this is either used during early boot or during module finalizing, it's not required to use text_poke_bp(). Add an argument to __static_call_transform() which tells it to use text_poke_early() for it. Fixes: ee88d363d156 ("x86,static_call: Use alternative RET encoding") Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov commit 7329b071729645e243b6207e76bca2f4951c991b Author: Bartosz Golaszewski Date: Tue Jul 12 09:40:55 2022 +0200 gpio: sim: fix the chip_name configfs item The chip_name configs attribute always displays the device name of the first GPIO bank because the logic of the relevant function is simply wrong. Fix it by correctly comparing the bank's swnode against the GPIO device's children. Fixes: cb8c474e79be ("gpio: sim: new testing module") Cc: stable@vger.kernel.org Reported-by: Kent Gibson Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Kent Gibson Tested-by: Kent Gibson commit e79b9473e9b59e83e23db9b7411c6080b5a6826d Author: Justin Stitt Date: Fri Jul 8 17:37:04 2022 -0700 net: ipv4: fix clang -Wformat warnings When building with Clang we encounter these warnings: | net/ipv4/ah4.c:513:4: error: format specifies type 'unsigned short' but | the argument has type 'int' [-Werror,-Wformat] | aalg_desc->uinfo.auth.icv_fullbits / 8); - | net/ipv4/esp4.c:1114:5: error: format specifies type 'unsigned short' | but the argument has type 'int' [-Werror,-Wformat] | aalg_desc->uinfo.auth.icv_fullbits / 8); `aalg_desc->uinfo.auth.icv_fullbits` is a u16 but due to default argument promotion becomes an int. Variadic functions (printf-like) undergo default argument promotion. Documentation/core-api/printk-formats.rst specifically recommends using the promoted-to-type's format flag. As per C11 6.3.1.1: (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int can represent all values of the original type ..., the value is converted to an int; otherwise, it is converted to an unsigned int. These are called the integer promotions.` Thus it makes sense to change %hu to %d not only to follow this standard but to suppress the warning as well. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt Suggested-by: Joe Perches Suggested-by: Nathan Chancellor Suggested-by: Nick Desaulniers Signed-off-by: Steffen Klassert commit f946964a9f79f8dcb5a6329265281eebfc23aee5 Author: Yevhen Orlov Date: Sun Jul 10 15:20:21 2022 +0300 net: marvell: prestera: fix missed deinit sequence Add unregister_fib_notifier as rollback of register_fib_notifier. Fixes: 4394fbcb78cf ("net: marvell: prestera: handle fib notifications") Signed-off-by: Yevhen Orlov Link: https://lore.kernel.org/r/20220710122021.7642-1-yevhen.orlov@plvision.eu Signed-off-by: Paolo Abeni commit dbe75d314748e08fc6e4576d153d8a69621ee5ca Author: Meng Tang Date: Tue Jul 12 17:22:22 2022 +0800 ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 On a HP 288 Pro G6, the front mic could not be detected.In order to get it working, the pin configuration needs to be set correctly, and the ALC671_FIXUP_HP_HEADSET_MIC2 fixup needs to be applied. Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220712092222.21738-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 841bdf85c226803a78a9319af9b2caa9bf3e2eda Author: Meng Tang Date: Tue Jul 12 14:00:05 2022 +0800 ALSA: hda - Add fixup for Dell Latitidue E5430 Another Dell model, another fixup entry: Latitude E5430 needs the same fixup as other Latitude E series as workaround for noise problems. Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220712060005.20176-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 4a46de446d3fb9ae304dd0f4b4fceb551b152498 Author: Jakub Kicinski Date: Fri Jul 8 19:41:41 2022 -0700 selftest: net: add tun to .gitignore Add missing .gitignore entry. Fixes: 839b92fede7b ("selftest: tun: add test for NAPI dismantle") Link: https://lore.kernel.org/r/20220709024141.321683-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ce114c866860aa9eae3f50974efc68241186ba60 Merge: 5a29232d870d9 4ad3278df6fe2 Author: Linus Torvalds Date: Mon Jul 11 18:15:25 2022 -0700 Merge tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 retbleed fixes from Borislav Petkov: "Just when you thought that all the speculation bugs were addressed and solved and the nightmare is complete, here's the next one: speculating after RET instructions and leaking privileged information using the now pretty much classical covert channels. It is called RETBleed and the mitigation effort and controlling functionality has been modelled similar to what already existing mitigations provide" * tag 'x86_bugs_retbleed' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (54 commits) x86/speculation: Disable RRSBA behavior x86/kexec: Disable RET on kexec x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry x86/bugs: Add Cannon lake to RETBleed affected CPU list x86/retbleed: Add fine grained Kconfig knobs x86/cpu/amd: Enumerate BTC_NO x86/common: Stamp out the stepping madness KVM: VMX: Prevent RSB underflow before vmenter x86/speculation: Fill RSB on vmexit for IBRS KVM: VMX: Fix IBRS handling after vmexit KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS KVM: VMX: Convert launched argument to flags KVM: VMX: Flatten __vmx_vcpu_run() objtool: Re-add UNWIND_HINT_{SAVE_RESTORE} x86/speculation: Remove x86_spec_ctrl_mask x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit x86/speculation: Fix SPEC_CTRL write on SMT state change x86/speculation: Fix firmware entry SPEC_CTRL handling x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n ... commit 3590b44b9434af1b9c81c3f40189087ed4fe3635 Merge: 42e0a87233e37 b68277f19e31a Author: Dave Airlie Date: Tue Jul 12 10:43:49 2022 +1000 Merge tag 'drm-misc-fixes-2022-07-07-1' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes Three mode setting fixes for fsl-ldb, a fbdev removal use-after-free fix, a dma-buf fence use-after-free fix, a DMA setup fix for rockchip, an error path fix and memory corruption fix for panfrost and one more orientation quirk Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220708054306.wr6jcfdunuypftbq@houat commit 42e0a87233e373e1c0d0831d342294b1ba103d23 Merge: 7de96365878f7 12058077b2e96 Author: Dave Airlie Date: Tue Jul 12 10:40:24 2022 +1000 Merge tag 'drm-intel-fixes-2022-07-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix a possible refcount leak in DP MST connector (Hangyu) - Fix on loading guc on ADL-N (Daniele) - Fix vm use-after-free in vma destruction (Thomas) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/YsbbgWnLTR8fr4lj@intel.com commit 7de96365878f769f21eae8205fc58f7f61250745 Merge: 32346491ddf24 3a4b1cc28fbdc Author: Dave Airlie Date: Tue Jul 12 10:34:42 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-07-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-07-06: amdgpu: - Hibernation fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220707024421.5773-1-alexander.deucher@amd.com commit 5a29232d870d9e63fe5ff30b081be6ea7cc2465d Merge: 23458ac91dc8e b3a3b0255797e Author: Linus Torvalds Date: Mon Jul 11 14:41:44 2022 -0700 Merge tag 'for-5.19-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A more fixes that seem to me to be important enough to get merged before release: - in zoned mode, fix leak of a structure when reading zone info, this happens on normal path so this can be significant - in zoned mode, revert an optimization added in 5.19-rc1 to finish a zone when the capacity is full, but this is not reliable in all cases - try to avoid short reads for compressed data or inline files when it's a NOWAIT read, applications should handle that but there are two, qemu and mariadb, that are affected" * tag 'for-5.19-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: zoned: drop optimization of zone finish btrfs: zoned: fix a leaked bioc in read_zone_info btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents commit 23458ac91dc8e9a30c95b4208727f7e053eb5ff8 Merge: 8e59a6a7a4fa0 db7cfc380900b 3418357a32db6 Author: Linus Torvalds Date: Mon Jul 11 14:33:41 2022 -0700 Merge tags 'free-mq_sysctls-for-v5.19' and 'ptrace_unfreeze_fix-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ipc namespace fix from Eric Biederman: "This fixes a bug with error handling if ipc creation fails that was reported by syzbot" For completeness, this also pulls the ptrace_unfreeze_fix tag that contains the original version of one of the hotfixes that I manually applied earlier so that it would be fixed in rc6. * tag 'free-mq_sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ipc: Free mq_sysctls if ipc namespace creation failed * tag 'ptrace_unfreeze_fix-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced() commit 1197eb5906a5464dbaea24cac296dfc38499cc00 Author: Jeff Layton Date: Mon Jul 11 14:30:14 2022 -0400 lockd: fix nlm_close_files This loop condition tries a bit too hard to be clever. Just test for the two indices we care about explicitly. Cc: J. Bruce Fields Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 8e59a6a7a4fa0bbcd174ea75f1da9531d3857937 Merge: b5374396e5de0 14c99d6594153 Author: Linus Torvalds Date: Mon Jul 11 12:49:56 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "Mainly MM fixes. About half for issues which were introduced after 5.18 and the remainder for longer-term issues" * tag 'mm-hotfixes-stable-2022-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm: split huge PUD on wp_huge_pud fallback nilfs2: fix incorrect masking of permission flags for symlinks mm/rmap: fix dereferencing invalid subpage pointer in try_to_migrate_one() riscv/mm: fix build error while PAGE_TABLE_CHECK enabled without MMU Documentation: highmem: use literal block for code example in highmem.h comment mm: sparsemem: fix missing higher order allocation splitting mm/damon: use set_huge_pte_at() to make huge pte old sh: convert nommu io{re,un}map() to static inline functions mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages commit aec158242b87a43d83322e99bc71ab4428e5ab79 Author: Jeff Layton Date: Mon Jul 11 14:30:13 2022 -0400 lockd: set fl_owner when unlocking files Unlocking a POSIX lock on an inode with vfs_lock_file only works if the owner matches. Ensure we set it in the request. Cc: J. Bruce Fields Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit b5374396e5de0402822bce4945c886d2a2962a40 Merge: 816e51dfb5ba4 e69a66147d495 Author: Linus Torvalds Date: Mon Jul 11 12:39:12 2022 -0700 Merge tag 'modules-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module fixes from Luis Chamberlain: "Although most of the move of code in in v5.19-rc1 should have not introduced a regression patch review on one of the file changes captured a checkpatch warning which advised to use strscpy() and it caused a buffer overflow when an incorrect length is passed. Another change which checkpatch complained about was an odd RCU usage, but that was properly addressed in a separate patch to the move by Aaron. That caused a regression with PREEMPT_RT=y due to an unbounded latency. This series fixes both and adjusts documentation which we forgot to do for the move" * tag 'modules-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module: kallsyms: Ensure preemption in add_kallsyms() with PREEMPT_RT doc: module: update file references module: Fix "warning: variable 'exit' set but not used" module: Fix selfAssignment cppcheck warning modules: Fix corruption of /proc/kallsyms commit 5b2f3e0777da2a5dd62824bbe2fdab1d12caaf8f Author: Chuck Lever Date: Sun Jul 10 14:46:04 2022 -0400 NFSD: Decode NFSv4 birth time attribute NFSD has advertised support for the NFSv4 time_create attribute since commit e377a3e698fb ("nfsd: Add support for the birth time attribute"). Igor Mammedov reports that Mac OS clients attempt to set the NFSv4 birth time attribute via OPEN(CREATE) and SETATTR if the server indicates that it supports it, but since the above commit was merged, those attempts now fail. Table 5 in RFC 8881 lists the time_create attribute as one that can be both set and retrieved, but the above commit did not add server support for clients to provide a time_create attribute. IMO that's a bug in our implementation of the NFSv4 protocol, which this commit addresses. Whether NFSD silently ignores the new birth time or actually sets it is another matter. I haven't found another filesystem service in the Linux kernel that enables users or clients to modify a file's birth time attribute. This commit reflects my (perhaps incorrect) understanding of whether Linux users can set a file's birth time. NFSD will now recognize a time_create attribute but it ignores its value. It clears the time_create bit in the returned attribute bitmask to indicate that the value was not used. Reported-by: Igor Mammedov Fixes: e377a3e698fb ("nfsd: Add support for the birth time attribute") Tested-by: Igor Mammedov Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit e69a66147d49506062cd837f3b230ee3e98102ab Author: Aaron Tomlin Date: Mon Jul 11 18:17:19 2022 +0100 module: kallsyms: Ensure preemption in add_kallsyms() with PREEMPT_RT The commit 08126db5ff73 ("module: kallsyms: Fix suspicious rcu usage") under PREEMPT_RT=y, disabling preemption introduced an unbounded latency since the loop is not fixed. This change caused a regression since previously preemption was not disabled and we would dereference RCU-protected pointers explicitly. That being said, these pointers cannot change. Before kallsyms-specific data is prepared/or set-up, we ensure that the unformed module is known to be unique i.e. does not already exist (see load_module()). Therefore, we can fix this by using the common and more appropriate RCU flavour as this section of code can be safely preempted. Reported-by: Steven Rostedt Fixes: 08126db5ff73 ("module: kallsyms: Fix suspicious rcu usage") Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 816e51dfb5ba47e4f989af656c956a8c0cc686c0 Merge: d5b36a4dbd06c afe4e376ac5d5 Author: Linus Torvalds Date: Mon Jul 11 10:02:03 2022 -0700 Merge tag 'vfio-v5.19-rc7' of https://github.com/awilliam/linux-vfio Pull VFIO fix from Alex Williamson: - Move IOMMU test to unbreak no-iommu support (Jason Gunthorpe) * tag 'vfio-v5.19-rc7' of https://github.com/awilliam/linux-vfio: vfio: Move IOMMU_CAP_CACHE_COHERENCY test to after we know we have a group commit d5b36a4dbd06c5e8e36ca8ccc552f679069e2946 Author: Oleg Nesterov Date: Mon Jul 11 18:16:25 2022 +0200 fix race between exit_itimers() and /proc/pid/timers As Chris explains, the comment above exit_itimers() is not correct, we can race with proc_timers_seq_ops. Change exit_itimers() to clear signal->posix_timers with ->siglock held. Cc: Reported-by: chris@accessvector.net Signed-off-by: Oleg Nesterov Signed-off-by: Linus Torvalds commit d16d69bf5a25d91c6d8f3e29711be12551bf56cd Author: Meng Tang Date: Mon Jul 11 18:17:44 2022 +0800 ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model There is another HP ProDesk 600 G3 model with the PCI SSID 103c:82b4 that requires the quirk HP_MIC_NO_PRESENCE. Add the corresponding entry to the quirk table. Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220711101744.25189-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 5f3fe25e70559fa3b096ab17e13316c93ddb7020 Author: Meng Tang Date: Mon Jul 11 16:15:27 2022 +0800 ALSA: hda/realtek: Fix headset mic for Acer SF313-51 The issue on Acer SWIFT SF313-51 is that headset microphone doesn't work. The following quirk fixed headset microphone issue. Note that the fixup of SF314-54/55 (ALC256_FIXUP_ACER_HEADSET_MIC) was not successful on my SF313-51. Signed-off-by: Meng Tang Cc: Link: https://lore.kernel.org/r/20220711081527.6254-1-tangmeng@uniontech.com Signed-off-by: Takashi Iwai commit 26b9f2fa7b1c6aba6fa9b83274a3e54868f69562 Author: Alexandru Elisei Date: Mon Jul 11 14:05:22 2022 +0100 ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found Commit a5450aba737d ("ASoC: rockchip: i2s: switch BCLK to GPIO") switched BCLK to GPIO functions when probing the i2s bus interface, but missed adding a check for when devm_pinctrl_get() returns an error. This can lead to the following NULL pointer dereference on a rockpro64-v2 if there are no "pinctrl" properties in the i2s device tree node. Check that i2s->pinctrl is valid before attempting to search for the bclk_on and bclk_off pinctrl states. Fixes: a5450aba737d ("ASoC: rockchip: i2s: switch BCLK to GPIO") Signed-off-by: Alexandru Elisei Link: https://lore.kernel.org/r/20220711130522.401551-1-alexandru.elisei@arm.com Signed-off-by: Mark Brown commit a9ab5bf33ce9883fbf5c2fc8f4eada00c46dc089 Author: Jacky Bai Date: Mon Jul 11 16:35:28 2022 +0800 MAINTAINERS: Update freescale pin controllers maintainer Add myself as co-maintainer of freescale pin controllers driver. As Stefan is no longer working on NXP pin controller, so remove Stefan from the list as suggested by him. Signed-off-by: Jacky Bai Reviewed-by: Fabio Estevam Acked-by: Stefan Agner Link: https://lore.kernel.org/r/20220711083528.27710-1-ping.bai@nxp.com Signed-off-by: Linus Walleij commit acf50233fc979b566e3b87d329191dcd01e2a72c Author: William Dean Date: Sun Jul 10 23:48:22 2022 +0800 pinctrl: sunplus: Add check for kcalloc As the potential failure of the kcalloc(), it should be better to check it in order to avoid the dereference of the NULL pointer. Fixes: aa74c44be19c8 ("pinctrl: Add driver for Sunplus SP7021") Reported-by: Hacash Robot Signed-off-by: William Dean Link: https://lore.kernel.org/r/20220710154822.2610801-1-williamsukatube@163.com Signed-off-by: Linus Walleij commit c3b821e8e406d5650e587b7ac624ac24e9b780a8 Author: William Dean Date: Sun Jul 10 23:49:22 2022 +0800 pinctrl: ralink: Check for null return of devm_kcalloc Because of the possible failure of the allocation, data->domains might be NULL pointer and will cause the dereference of the NULL pointer later. Therefore, it might be better to check it and directly return -ENOMEM without releasing data manually if fails, because the comment of the devm_kmalloc() says "Memory allocated with this function is automatically freed on driver detach.". Fixes: a86854d0c599b ("treewide: devm_kzalloc() -> devm_kcalloc()") Reported-by: Hacash Robot Signed-off-by: William Dean Link: https://lore.kernel.org/r/20220710154922.2610876-1-williamsukatube@163.com Signed-off-by: Linus Walleij commit 01277737e9bedf74b094c43704aa2ec7c1bc1230 Merge: 3f231ccb38835 6177a50fd32c6 Author: Arnd Bergmann Date: Mon Jul 11 13:17:23 2022 +0200 Merge tag 'imx-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.19, round 3: - Fix GPIO property for imx6qdl-ts7970 board. - Fix touchscreen pinctrl for imx6ull-colibri board by moving iomuxc-snvs pin to the correct controller device. - Fix SFP node of fsl-ls1028a to have a required clock property. * tag 'imx-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: colibri-imx6ull: fix snvs pinmux group ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count arm64: dts: ls1028a: Update SFP node to include clock Link: https://lore.kernel.org/r/20220709032716.GA9868@dragon Signed-off-by: Arnd Bergmann commit e45955766b4300e7bbeeaa1c31e0001fe16383e7 Merge: 3c079a22db79c c39ba4de6b0a8 Author: David S. Miller Date: Mon Jul 11 11:58:38 2022 +0100 Merge 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) refcount_inc_not_zero() is not semantically equivalent to atomic_int_not_zero(), from Florian Westphal. My understanding was that refcount_*() API provides a wrapper to easier debugging of reference count leaks, however, there are semantic differences between these two APIs, where refcount_inc_not_zero() needs a barrier. Reason for this subtle difference to me is unknown. 2) packet logging is not correct for ARP and IP packets, from the ARP family and netdev/egress respectively. Use skb_network_offset() to reach the headers accordingly. 3) set element extension length have been growing over time, replace a BUG_ON by EINVAL which might be triggerable from userspace. ==================== Signed-off-by: David S. Miller commit 3c079a22db79cf2cdd1b13b41a5447790e08069a Merge: 72a0b329114b1 3ddabc4336702 Author: David S. Miller Date: Mon Jul 11 11:31:38 2022 +0100 Merge branch 'mptcp-fixes' Mat Martineau says: ==================== mptcp: Disconnect and selftest fixes Patch 1 switches to a safe list iterator in the MPTCP disconnect code. Patch 2 adds the userspace_pm.sh selftest script to the MPTCP selftest Makefile, resolving the netdev/check_selftest CI failure. ==================== Signed-off-by: David S. Miller commit 3ddabc433670292492d217e0f3b5ce017c42da2c Author: Matthieu Baerts Date: Fri Jul 8 16:36:10 2022 -0700 selftests: mptcp: validate userspace PM tests by default The new script was not listed in the programs to test. By consequence, some CIs running MPTCP selftests were not validating these new tests. Note that MPTCP CI was validating it as it executes all .sh scripts from 'tools/testing/selftests/net/mptcp' directory. Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type") Reported-by: Jakub Kicinski Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 5c835bb142d4013c2ab24bff5ae9f6709a39cbcf Author: Paolo Abeni Date: Fri Jul 8 16:36:09 2022 -0700 mptcp: fix subflow traversal at disconnect time At disconnect time the MPTCP protocol traverse the subflows list closing each of them. In some circumstances - MPJ subflow, passive MPTCP socket, the latter operation can remove the subflow from the list, invalidating the current iterator. Address the issue using the safe list traversing helper variant. Reported-by: van fantasy Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation") Tested-by: Matthieu Baerts Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 166d3863231667c4f64dee72b77d1102cdfad11f Author: Demi Marie Obenour Date: Sun Jul 10 19:05:22 2022 -0400 xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE The error paths of gntdev_mmap() can call unmap_grant_pages() even though not all of the pages have been successfully mapped. This will trigger the WARN_ON()s in __unmap_grant_pages_done(). The number of warnings can be very large; I have observed thousands of lines of warnings in the systemd journal. Avoid this problem by only warning on unmapping failure if the handle being unmapped is not INVALID_GRANT_HANDLE. The handle field of any page that was not successfully mapped will be INVALID_GRANT_HANDLE, so this catches all cases where unmapping can legitimately fail. Fixes: dbe97cff7dd9 ("xen/gntdev: Avoid blocking in unmap_grant_pages()") Cc: stable@vger.kernel.org Suggested-by: Juergen Gross Signed-off-by: Demi Marie Obenour Reviewed-by: Oleksandr Tyshchenko Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220710230522.1563-1-demi@invisiblethingslab.com Signed-off-by: Juergen Gross commit 50e2ab39291947b6c6c7025cf01707c270fcde59 Author: Felix Fietkau Date: Sat Jul 2 16:52:27 2022 +0200 wifi: mac80211: fix queue selection for mesh/OCB interfaces When using iTXQ, the code assumes that there is only one vif queue for broadcast packets, using the BE queue. Allowing non-BE queue marking violates that assumption and txq->ac == skb_queue_mapping is no longer guaranteed. This can cause issues with queue handling in the driver and also causes issues with the recent ATF change, resulting in an AQL underflow warning. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20220702145227.39356-1-nbd@nbd.name Signed-off-by: Johannes Berg commit cc0315564d6eec91c716d314b743321be24c70b3 Author: Mustafa Ismail Date: Tue Jul 5 18:08:37 2022 -0500 RDMA/irdma: Fix sleep from invalid context BUG Taking the qos_mutex to process RoCEv2 QP's on netdev events causes a kernel splat. Fix this by removing the handling for RoCEv2 in irdma_cm_teardown_connections that uses the mutex. This handling is only needed for iWARP to avoid having connections established while the link is down or having connections remain functional after the IP address is removed. BUG: sleeping function called from invalid context at kernel/locking/mutex. Call Trace: kernel: dump_stack+0x66/0x90 kernel: ___might_sleep.cold.92+0x8d/0x9a kernel: mutex_lock+0x1c/0x40 kernel: irdma_cm_teardown_connections+0x28e/0x4d0 [irdma] kernel: ? check_preempt_curr+0x7a/0x90 kernel: ? select_idle_sibling+0x22/0x3c0 kernel: ? select_task_rq_fair+0x94c/0xc90 kernel: ? irdma_exec_cqp_cmd+0xc27/0x17c0 [irdma] kernel: ? __wake_up_common+0x7a/0x190 kernel: irdma_if_notify+0x3cc/0x450 [irdma] kernel: ? sched_clock_cpu+0xc/0xb0 kernel: irdma_inet6addr_event+0xc6/0x150 [irdma] Fixes: 146b9756f14c ("RDMA/irdma: Add connection manager") Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 5e8afb8792f3b6ae7ccf700f8c19225382636401 Author: Mustafa Ismail Date: Tue Jul 5 18:08:36 2022 -0500 RDMA/irdma: Do not advertise 1GB page size for x722 x722 does not support 1GB page size but the irdma driver incorrectly advertises 1GB page size support for x722 device to ib_core to compute the best page size to use on this MR. This could lead to incorrect start offsets computed by hardware on the MR. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit e87197fbd137c888fd6c871c72fe7e89445dd015 Author: Dan Carpenter Date: Fri Jul 8 11:41:06 2022 +0300 drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist() The shmem_pin_map() function returns NULL, it doesn't return error pointers. Fixes: 97ea656521c8 ("drm/i915/gvt: Parse default state to update reg whitelist") Reviewed-by: Andrzej Hajda Signed-off-by: Dan Carpenter Signed-off-by: Zhenyu Wang Link: http://patchwork.freedesktop.org/patch/msgid/Ysftoia2BPUyqVcD@kili Acked-by: Zhenyu Wang commit be82abe6a76ba8e76f25312566182b0f13c4fbf9 Author: Anup Patel Date: Mon Jul 11 09:36:32 2022 +0530 RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests() The kvm_riscv_check_vcpu_requests() is called with SRCU read lock held and for KVM_REQ_SLEEP request it will block the VCPU without releasing SRCU read lock. This causes KVM ioctls (such as KVM_IOEVENTFD) from other VCPUs of the same Guest/VM to hang/deadlock if there is any synchronize_srcu() or synchronize_srcu_expedited() in the path. To fix the above in kvm_riscv_check_vcpu_requests(), we should do SRCU read unlock before blocking the VCPU and do SRCU read lock after VCPU wakeup. Fixes: cce69aff689e ("RISC-V: KVM: Implement VCPU interrupts and requests handling") Reported-by: Bin Meng Signed-off-by: Anup Patel Reviewed-by: Atish Patra Tested-by: Heinrich Schuchardt Tested-by: Bin Meng Signed-off-by: Anup Patel commit 88573389aaa34640b9ecde15622c68e8737d8f8c Author: Alexandre Ghiti Date: Mon Jul 11 09:29:51 2022 +0530 riscv: Fix missing PAGE_PFN_MASK There are a bunch of functions that use the PFN from a page table entry that end up with the svpbmt upper-bits because they are missing the newly introduced PAGE_PFN_MASK which leads to wrong addresses conversions and then crash: fix this by adding this mask. Fixes: 100631b48ded ("riscv: Fix accessing pfn bits in PTEs for non-32bit variants") Signed-off-by: Alexandre Ghiti Signed-off-by: Anup Patel commit 32346491ddf24599decca06190ebca03ff9de7f8 Author: Linus Torvalds Date: Sun Jul 10 14:40:51 2022 -0700 Linux 5.19-rc6 commit 24f4b40ec2184f3698faed3082895fcc1f6be282 Merge: 952c53cd357c7 fc82bbf4dede7 Author: Linus Torvalds Date: Sun Jul 10 14:26:49 2022 -0700 Merge branch 'hot-fixes' (fixes for rc6) This is a collection of three fixes for small annoyances. Two of these are already pending in other trees, but I really don't want to release another -rc with these issues pending, so I picked up the patches for these things directly. We'll end up with duplicate commits eventually, I prefer that over having these issues pending. The third one is just me getting rid of another BUG_ON() just because it was reported and I dislike those things so much. * merge 'hot-fixes' branch: ida: don't use BUG_ON() for debugging drm/aperture: Run fbdev removal before internal helpers ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced() commit fc82bbf4dede758007763867d0282353c06d1121 Author: Linus Torvalds Date: Sun Jul 10 13:55:49 2022 -0700 ida: don't use BUG_ON() for debugging This is another old BUG_ON() that just shouldn't exist (see also commit a382f8fee42c: "signal handling: don't use BUG_ON() for debugging"). In fact, as Matthew Wilcox points out, this condition shouldn't really even result in a warning, since a negative id allocation result is just a normal allocation failure: "I wonder if we should even warn here -- sure, the caller is trying to free something that wasn't allocated, but we don't warn for kfree(NULL)" and goes on to point out how that current error check is only causing people to unnecessarily do their own index range checking before freeing it. This was noted by Itay Iellin, because the bluetooth HCI socket cookie code does *not* do that range checking, and ends up just freeing the error case too, triggering the BUG_ON(). The HCI code requires CAP_NET_RAW, and seems to just result in an ugly splat, but there really is no reason to BUG_ON() here, and we have generally striven for allocation models where it's always ok to just do free(alloc()); even if the allocation were to fail for some random reason (usually obviously that "random" reason being some resource limit). Fixes: 88eca0207cf1 ("ida: simplified functions for id allocation") Reported-by: Itay Iellin Suggested-by: Matthew Wilcox Signed-off-by: Linus Torvalds commit 952c53cd357c71338a59d444933ed48a879229e1 Merge: 5867f3b88bb54 607a48c78e6b4 Author: Linus Torvalds Date: Sun Jul 10 11:23:01 2022 -0700 Merge tag 'dmaengine-fix-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: "One core fix for DMA_INTERRUPT and rest driver fixes. Core: - Revert verification of DMA_INTERRUPT capability as that was incorrect Bunch of driver fixes for: - ti: refcount and put_device leak - qcom_bam: runtime pm overflow - idxd: force wq context cleanup and call idxd_enable_system_pasid() on success - dw-axi-dmac: RMW on channel suspend register - imx-sdma: restart cyclic channel when enabled - at_xdma: error handling for at_xdmac_alloc_desc - pl330: lockdep warning - lgm: error handling path in probe - allwinner: Fix min/max typo in binding" * tag 'dmaengine-fix-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dt-bindings: dma: allwinner,sun50i-a64-dma: Fix min/max typo dmaengine: lgm: Fix an error handling path in intel_ldma_probe() dmaengine: pl330: Fix lockdep warning about non-static key dmaengine: idxd: Only call idxd_enable_system_pasid() if succeeded in enabling SVA feature dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly dmaengine: imx-sdma: only restart cyclic channel when enabled dmaengine: dw-axi-dmac: Fix RMW on channel suspend register dmaengine: idxd: force wq context cleanup on device disable path dmaengine: qcom: bam_dma: fix runtime PM underflow dmaengine: imx-sdma: Allow imx8m for imx7 FW revs dmaengine: Revert "dmaengine: add verification of DMA_INTERRUPT capability for dmatest" dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate dmaengine: ti: Fix refcount leak in ti_dra7_xbar_route_allocate commit b0d55983b2b885f6f96d6d6898d27a60bd9dc9a2 Author: Hans de Goede Date: Sun Jul 10 19:36:58 2022 +0200 platform/x86: intel_atomisp2_led: Also turn off the always-on camera LED on the Asus T100TAF Like the Asus T100TA the Asus T100TAF has a camera LED which is always on by default and both also use the same GPIO for the LED. Relax the DMI match for the Asus T100TA so that it also matches the T100TAF. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220710173658.221528-1-hdegoede@redhat.com commit 5867f3b88bb54016c42cdde510c184255488a12b Merge: b41362fdf2671 ee6c6e7342471 Author: Linus Torvalds Date: Sun Jul 10 09:51:56 2022 -0700 Merge tag 'staging-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fix from Greg KH: "Here is a single staging driver fix for a reported problem that showed up in 5.19-rc1 in the wlan-ng driver. It has been in linux-next for a week with no reported problems" * tag 'staging-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging/wlan-ng: get the correct struct hfa384x in work callback commit b41362fdf26710693535fade5e4eeda019c3b410 Merge: d9919d43cbf67 2cd37c2e72449 Author: Linus Torvalds Date: Sun Jul 10 09:45:29 2022 -0700 Merge tag 'char-misc-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are four small char/misc driver fixes for 5.19-rc6 to resolve some reported issues. They only affect two drivers: - rtsx_usb: fix for of-reported DMA warning error, the driver was handling memory buffers in odd ways, it has now been fixed up to be much simpler and correct by Shuah. - at25 eeprom driver bugfix for reported problem All of these have been in linux-next for a week with no reported problems" * tag 'char-misc-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: misc: rtsx_usb: set return value in rsp_buf alloc err path misc: rtsx_usb: use separate command and response buffers misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer eeprom: at25: Rework buggy read splitting commit d9919d43cbf6790d2bc0c0a2743c51fc25f26919 Merge: 2fbd36dfae40c d785a773bed96 Author: Linus Torvalds Date: Sun Jul 10 09:14:54 2022 -0700 Merge tag 'io_uring-5.19-2022-07-09' of git://git.kernel.dk/linux-block Pull io_uring fix from Jens Axboe: "A single fix for an issue that came up yesterday that we should plug for -rc6. This is a regression introduced in this cycle" * tag 'io_uring-5.19-2022-07-09' of git://git.kernel.dk/linux-block: io_uring: check that we have a file table when allocating update slots commit 2fbd36dfae40cc90ba6a4761e0efff62e4d919fe Merge: 2b9b31cedb706 f5a4618587fb5 Author: Linus Torvalds Date: Sun Jul 10 08:59:02 2022 -0700 Merge tag 'kbuild-fixes-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Adjust gen_compile_commands.py to the format change of *.mod files - Remove unused macro in scripts/Makefile.modinst * tag 'kbuild-fixes-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: remove unused cmd_none in scripts/Makefile.modinst gen_compile_commands: handle multiple lines per .mod file commit 2b9b31cedb7064b16510251cf20ed44b05b71456 Merge: 74a0032b8524e 80f2a248a2f92 Author: Linus Torvalds Date: Sun Jul 10 08:52:12 2022 -0700 Merge tag 'irq_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Borislav Petkov: - Gracefully handle failure to request MMIO resources in the GICv3 driver - Make a static key static in the Apple AIC driver - Fix the Xilinx intc driver dependency on OF_ADDRESS * tag 'irq_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/apple-aic: Make symbol 'use_fast_ipi' static irqchip/xilinx: Add explicit dependency on OF_ADDRESS irqchip/gicv3: Handle resource request failure consistently commit 74a0032b8524ee2bd4443128c0bf9775928680b0 Merge: b1c428b6c3684 cb8a4beac39b9 Author: Linus Torvalds Date: Sun Jul 10 08:43:52 2022 -0700 Merge tag 'x86_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Prepare for and clear .brk early in order to address XenPV guests failures where the hypervisor verifies page tables and uninitialized data in that range leads to bogus failures in those checks - Add any potential setup_data entries supplied at boot to the identity pagetable mappings to prevent kexec kernel boot failures. Usually, this is not a problem for the normal kernel as those mappings are part of the initially mapped 2M pages but if kexec gets to allocate the second kernel somewhere else, those setup_data entries need to be mapped there too. - Fix objtool not to discard text references from the __tracepoints section so that ENDBR validation still works - Correct the setup_data types limit as it is user-visible, before 5.19 releases * tag 'x86_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Fix the setup data types max limit x86/ibt, objtool: Don't discard text references from tracepoint section x86/compressed/64: Add identity mappings for setup_data entries x86: Fix .brk attribute in linker script x86: Clear .brk area at early boot x86/xen: Use clear_bss() for Xen PV guests commit c483e7ea10fa889f9da5012753a6766be6e11309 Author: Hans de Goede Date: Sun Jul 10 16:07:36 2022 +0200 platform/x86/intel/ifs: Mark as BROKEN A recent suggested change to the IFS code has shown that the userspace API needs a bit more work, see: https://lore.kernel.org/platform-driver-x86/20220708151938.986530-1-jithu.joseph@intel.com/ Mark it as BROKEN before 5.19 ships, to give ourselves one more kernel-devel cycle to get the userspace API right. Link: https://lore.kernel.org/platform-driver-x86/20220708151938.986530-1-jithu.joseph@intel.com/ Cc: Jithu Joseph Cc: Ashok Raj Cc: Tony Luck Suggested-by: Greg KH Signed-off-by: Hans de Goede Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220710140736.6492-1-hdegoede@redhat.com commit f56e676a7f1ca7de9002526df3d2ee0e47dfd8ce Author: Misaka19465 Date: Sun Jul 10 19:37:27 2022 +0800 platform/x86: asus-wmi: Add key mappings On laptops like ASUS TUF Gaming A15, which have hotkeys to start Armoury Crate or AURA Sync, these hotkeys are unavailable. This patch add mappings for them. Signed-off-by: Misaka19465 Link: https://lore.kernel.org/r/20220710113727.281634-1-misaka19465@olddoctor.net Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d40908f2621ea7abc6132ec8c5688a2960eeee3c Author: Hans de Goede Date: Fri Jul 8 15:14:12 2022 +0200 efi: Fix efi_power_off() not being run before acpi_power_off() when necessary Commit 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") switched the ACPI sleep code from directly setting the old global pm_power_off handler to using the new register_sys_off_handler() mechanism with a priority of SYS_OFF_PRIO_FIRMWARE. This is a problem when the old global pm_power_off handler would later be overwritten, such as done by the late_initcall(efi_shutdown_init): if (efi_poweroff_required()) pm_power_off = efi_power_off; The old global pm_power_off handler gets run with a priority of SYS_OFF_PRIO_DEFAULT which is lower then SYS_OFF_PRIO_FIRMWARE, causing acpi_power_off() to run first, changing the behavior from before the ACPI sleep code switched to the new register_sys_off_handler(). Switch the registering of efi_power_off over to register_sys_off_handler() with a priority of SYS_OFF_PRIO_FIRMWARE + 1 so that it will run before acpi_power_off() as before. Note since the new sys-off-handler code will try all handlers in priority order, there is no more need for the EFI code to store and call the original pm_power_off handler. Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") Cc: Dmitry Osipenko Signed-off-by: Hans de Goede Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220708131412.81078-3-hdegoede@redhat.com commit 4ce8f4c2027db46299b450b28e9e116aaf00a757 Author: Hans de Goede Date: Fri Jul 8 15:14:11 2022 +0200 platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again Commit 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") switched the ACPI sleep code from directly setting the old global pm_power_off handler to using the new register_sys_off_handler() mechanism with a priority of SYS_OFF_PRIO_FIRMWARE. This is a problem in special cases where the old global pm_power_off handler later gets overwritten, such as the Lenovo Tab2 poweroff bugfix in x86-android-tablets. The old global pm_power_off handler gets run with a priority of SYS_OFF_PRIO_DEFAULT which is lower then SYS_OFF_PRIO_FIRMWARE, causing the troublesome ACPI poweroff (which freezes the system) to run first. Switch the registering of lenovo_yoga_tab2_830_1050_power_off over to register_sys_off_handler() with a priority of SYS_OFF_PRIO_FIRMWARE + 1 so that it will run before acpi_power_off() to fix this. Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") Cc: Dmitry Osipenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220708131412.81078-2-hdegoede@redhat.com commit 5d62261a65698c1ee4e71f00963b269282015b1e Author: Pär Eriksson Date: Tue Jul 5 20:44:07 2022 +0200 platform/x86: gigabyte-wmi: add support for B660I AORUS PRO DDR4 Add support for the B660I AORUS PRO DDR4. Signed-off-by: Pär Eriksson Link: https://lore.kernel.org/r/20220705184407.14181-1-parherman@gmail.com Signed-off-by: Hans de Goede commit 4ddef52f26cfaf330240c93d7685a00628c66b04 Author: Shyam Sundar S K Date: Thu Jun 30 10:33:24 2022 +0530 platform/x86/amd/pmc: Add new platform support PMC driver can be supported on a new upcoming platform. Add this information to the support list. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220630050324.3780654-2-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1968f2be5c03073c3f90d49226723eac4d431282 Author: Shyam Sundar S K Date: Thu Jun 30 10:33:23 2022 +0530 platform/x86/amd/pmc: Add new acpi id for PMC controller New version of PMC controller will have a separate ACPI id, add that to the support list. Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20220630050324.3780654-1-Shyam-sundar.S-k@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f5a4618587fb5c5eb5fec3dcce165ca8fd7d7f91 Author: Masahiro Yamada Date: Thu Jun 30 17:09:35 2022 +0900 kbuild: remove unused cmd_none in scripts/Makefile.modinst Commit 65ce9c38326e ("kbuild: move module strip/compression code into scripts/Makefile.modinst") added this unused code. Perhaps, I thought cmd_none was useful for CONFIG_MODULE_COMPRESS_NONE, but I did not use it after all. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit cb8a4beac39b90cd60abbf9fd639a3357274e469 Author: Borislav Petkov Date: Sun Jul 10 11:15:47 2022 +0200 x86/boot: Fix the setup data types max limit Commit in Fixes forgot to change the SETUP_TYPE_MAX definition which contains the highest valid setup data type. Correct that. Fixes: 5ea98e01ab52 ("x86/boot: Add Confidential Computing type to setup_data") Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/ddba81dd-cc92-699c-5274-785396a17fb5@zytor.com commit b1c428b6c3684ee8ddf4137d68b3e8d51d2a700f Merge: d9cdc3b12525c 3501f0c663063 Author: Linus Torvalds Date: Sat Jul 9 11:20:15 2022 -0700 Merge tag 'i2c-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Two I2C driver bugfixes preventing resource leaks" * tag 'i2c-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: cadence: Unregister the clk notifier in error path i2c: piix4: Fix a memory leak in the EFCH MMIO support commit 84499c5d220a4f8fb0a35fa4673148525c81ea83 Author: Thomas Zimmermann Date: Fri Jun 17 14:10:27 2022 +0200 drm/aperture: Run fbdev removal before internal helpers Always run fbdev removal first to remove simpledrm via sysfb_disable(). This clears the internal state. The later call to drm_aperture_detach_drivers() then does nothing. Otherwise, with drm_aperture_detach_drivers() running first, the call to sysfb_disable() uses inconsistent state. Example backtrace show below: BUG: KASAN: use-after-free in device_del+0x79/0x5f0 Read of size 8 at addr ffff888108185050 by task systemd-udevd/311 CPU: 0 PID: 311 Comm: systemd-udevd Tainted: G E 5.19.0-rc2-1-default+ #1689 Hardware name: HP ProLiant DL120 G7, BIOS J01 04/21/2011 Call Trace: device_del+0x79/0x5f0 platform_device_del.part.0+0x19/0xe0 platform_device_unregister+0x1c/0x30 sysfb_disable+0x2d/0x70 remove_conflicting_framebuffers+0x1c/0xf0 remove_conflicting_pci_framebuffers+0x130/0x1a0 drm_aperture_remove_conflicting_pci_framebuffers+0x86/0xb0 mgag200_pci_probe+0x2d/0x140 [mgag200] Signed-off-by: Thomas Zimmermann Fixes: 873eb3b11860 ("fbdev: Disable sysfb device registration when removing conflicting FBs") Cc: Javier Martinez Canillas Cc: Daniel Vetter Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Helge Deller Cc: Thomas Zimmermann Cc: Alex Deucher Cc: Zhen Lei Cc: Changcheng Deng Reviewed-by: Zack Rusin Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Torvalds commit de2a34771f5123270bc3842535ac91673116dd03 Author: Sven Schnelle Date: Wed Jul 6 12:16:25 2022 +0200 ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced() CI reported the following splat while running the strace testsuite: WARNING: CPU: 1 PID: 3570031 at kernel/ptrace.c:272 ptrace_check_attach+0x12e/0x178 CPU: 1 PID: 3570031 Comm: strace Tainted: G OE 5.19.0-20220624.rc3.git0.ee819a77d4e7.300.fc36.s390x #1 Hardware name: IBM 3906 M04 704 (z/VM 7.1.0) Call Trace: [<00000000ab4b645a>] ptrace_check_attach+0x132/0x178 ([<00000000ab4b6450>] ptrace_check_attach+0x128/0x178) [<00000000ab4b6cde>] __s390x_sys_ptrace+0x86/0x160 [<00000000ac03fcec>] __do_syscall+0x1d4/0x200 [<00000000ac04e312>] system_call+0x82/0xb0 Last Breaking-Event-Address: [<00000000ab4ea3c8>] wait_task_inactive+0x98/0x190 This is because JOBCTL_TRACED is set, but the task is not in TASK_TRACED state. Caused by ptrace_unfreeze_traced() which does: task->jobctl &= ~TASK_TRACED but it should be: task->jobctl &= ~JOBCTL_TRACED Fixes: 31cae1eaae4f ("sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state") Signed-off-by: Sven Schnelle Tested-by: Alexander Gordeev Acked-by: Oleg Nesterov Acked-by: Peter Zijlstra Cc: Eric Biederman Cc: Steven Rostedt Cc: Kees Cook Signed-off-by: Linus Torvalds commit d9cdc3b12525c85b4a2a8b6f3f8f61d9f467ab9a Merge: e5524c2a1fc40 887502826549c Author: Linus Torvalds Date: Sat Jul 9 10:34:08 2022 -0700 Merge tag 'powerpc-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: - On Power8 bare metal, fix creation of RNG platform devices, which are needed for the /dev/hwrng driver to probe correctly. Thanks to Jason A. Donenfeld, and Sachin Sant. * tag 'powerpc-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powernv: delay rng platform device creation until later in boot commit a4bd9358d5539516c19daa1b35b36bbc0c0637df Merge: c5e58c4545a69 fc976f5629afb Author: Takashi Iwai Date: Sat Jul 9 18:23:54 2022 +0200 Merge tag 'asoc-fix-v5.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.19 Quite a large batch due to things building up for a couple of weeks but all driver specific apart from Marek's documentation fix. commit c39ba4de6b0a843bec5d46c2b6f2064428dada5e Author: Pablo Neira Ayuso Date: Tue Jul 5 11:41:59 2022 +0200 netfilter: nf_tables: replace BUG_ON by element length check BUG_ON can be triggered from userspace with an element with a large userdata area. Replace it by length check and return EINVAL instead. Over time extensions have been growing in size. Pick a sufficiently old Fixes: tag to propagate this fix. Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys / data") Signed-off-by: Pablo Neira Ayuso commit d785a773bed966a75ca1f11d108ae1897189975b Author: Jens Axboe Date: Sat Jul 9 07:02:10 2022 -0600 io_uring: check that we have a file table when allocating update slots If IORING_FILE_INDEX_ALLOC is set asking for an allocated slot, the helper doesn't check if we actually have a file table or not. The non alloc path does do that correctly, and returns -ENXIO if we haven't set one up. Do the same for the allocated path, avoiding a NULL pointer dereference when trying to find a free bit. Fixes: a7c41b4687f5 ("io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots") Signed-off-by: Jens Axboe commit 72a0b329114b1caa8e69dfa7cdad1dd3c69b8602 Author: Eric Dumazet Date: Fri Jul 8 15:11:53 2022 +0000 vlan: fix memory leak in vlan_newlink() Blamed commit added back a bug I fixed in commit 9bbd917e0bec ("vlan: fix memory leak in vlan_dev_set_egress_priority") If a memory allocation fails in vlan_changelink() after other allocations succeeded, we need to call vlan_dev_free_egress_priority() to free all allocated memory because after a failed ->newlink() we do not call any methods like ndo_uninit() or dev->priv_destructor(). In following example, if the allocation for last element 2000:2001 fails, we need to free eight prior allocations: ip link add link dummy0 dummy0.100 type vlan id 100 \ egress-qos-map 1:2 2:3 3:4 4:5 5:6 6:7 7:8 8:9 2000:2001 syzbot report was: BUG: memory leak unreferenced object 0xffff888117bd1060 (size 32): comm "syz-executor408", pid 3759, jiffies 4294956555 (age 34.090s) hex dump (first 32 bytes): 09 00 00 00 00 a0 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: [] kmalloc include/linux/slab.h:600 [inline] [] vlan_dev_set_egress_priority+0xed/0x170 net/8021q/vlan_dev.c:193 [] vlan_changelink+0x178/0x1d0 net/8021q/vlan_netlink.c:128 [] vlan_newlink+0x148/0x260 net/8021q/vlan_netlink.c:185 [] rtnl_newlink_create net/core/rtnetlink.c:3363 [inline] [] __rtnl_newlink+0xa58/0xdc0 net/core/rtnetlink.c:3580 [] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3593 [] rtnetlink_rcv_msg+0x21c/0x5c0 net/core/rtnetlink.c:6089 [] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2501 [] netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] [] netlink_unicast+0x397/0x4c0 net/netlink/af_netlink.c:1345 [] netlink_sendmsg+0x396/0x710 net/netlink/af_netlink.c:1921 [] sock_sendmsg_nosec net/socket.c:714 [inline] [] sock_sendmsg+0x56/0x80 net/socket.c:734 [] ____sys_sendmsg+0x36c/0x390 net/socket.c:2488 [] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2542 [] __sys_sendmsg net/socket.c:2571 [inline] [] __do_sys_sendmsg net/socket.c:2580 [inline] [] __se_sys_sendmsg net/socket.c:2578 [inline] [] __x64_sys_sendmsg+0x78/0xf0 net/socket.c:2578 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 37aa50c539bc ("vlan: introduce vlan_dev_free_egress_priority") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Xin Long Reviewed-by: Xin Long Signed-off-by: David S. Miller commit 9c840d5f9aaef87e65db900bae21c70b059aba5f Author: Baowen Zheng Date: Fri Jul 8 11:07:18 2022 +0100 nfp: fix issue of skb segments exceeds descriptor limitation TCP packets will be dropped if the segments number in the tx skb exceeds limitation when sending iperf3 traffic with --zerocopy option. we make the following changes: Get nr_frags in nfp_nfdk_tx_maybe_close_block instead of passing from outside because it will be changed after skb_linearize operation. Fill maximum dma_len in first tx descriptor to make sure the whole head is included in the first descriptor. Fixes: c10d12e3dce8 ("nfp: add support for NFDK data path") Signed-off-by: Baowen Zheng Reviewed-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 4ad3278df6fe2b0852b00d5757fc2ccd8e92c26e Author: Pawan Gupta Date: Fri Jul 8 13:36:09 2022 -0700 x86/speculation: Disable RRSBA behavior Some Intel processors may use alternate predictors for RETs on RSB-underflow. This condition may be vulnerable to Branch History Injection (BHI) and intramode-BTI. Kernel earlier added spectre_v2 mitigation modes (eIBRS+Retpolines, eIBRS+LFENCE, Retpolines) which protect indirect CALLs and JMPs against such attacks. However, on RSB-underflow, RET target prediction may fallback to alternate predictors. As a result, RET's predicted target may get influenced by branch history. A new MSR_IA32_SPEC_CTRL bit (RRSBA_DIS_S) controls this fallback behavior when in kernel mode. When set, RETs will not take predictions from alternate predictors, hence mitigating RETs as well. Support for this is enumerated by CPUID.7.2.EDX[RRSBA_CTRL] (bit2). For spectre v2 mitigation, when a user selects a mitigation that protects indirect CALLs and JMPs against BHI and intramode-BTI, set RRSBA_DIS_S also to protect RETs for RSB-underflow case. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 697977d8415d61f3acbc4ee6d564c9dcf0309507 Author: Konrad Rzeszutek Wilk Date: Fri Jul 8 19:10:11 2022 +0200 x86/kexec: Disable RET on kexec All the invocations unroll to __x86_return_thunk and this file must be PIC independent. This fixes kexec on 64-bit AMD boxes. [ bp: Fix 32-bit build. ] Reported-by: Edward Tran Reported-by: Awais Tanveer Suggested-by: Ankur Arora Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Alexandre Chartre Signed-off-by: Borislav Petkov commit 7a847c00eeba9744353ecdfad253143b9115678a Author: Pablo Neira Ayuso Date: Tue Jul 5 10:26:15 2022 +0200 netfilter: nf_log: incorrect offset to network header NFPROTO_ARP is expecting to find the ARP header at the network offset. In the particular case of ARP, HTYPE= field shows the initial bytes of the ethernet header destination MAC address. netdev out: IN= OUT=bridge0 MACSRC=c2:76:e5:71:e1:de MACDST=36:b0:4a:e2:72:ea MACPROTO=0806 ARP HTYPE=14000 PTYPE=0x4ae2 OPCODE=49782 NFPROTO_NETDEV egress hook is also expecting to find the IP headers at the network offset. Fixes: 35b9395104d5 ("netfilter: add generic ARP packet logger") Reported-by: Tom Yan Signed-off-by: Pablo Neira Ayuso commit 2a96271fb66c499e4a89d76a89d3d01170c10bef Author: Siarhei Vishniakou Date: Fri Jul 8 21:59:23 2022 -0700 Input: document the units for resolution of size axes Today, the resolution of size axes is not documented. As a result, it's not clear what the canonical interpretation of this value should be. On Android, there is a need to calculate the size of the touch ellipse in physical units (millimeters). After reviewing linux source, it turned out that most of the existing usages are already interpreting this value as "units/mm". This documentation will make it explicit. This will help device implementations with correctly following the linux specs, and will ensure that the devices will work on Android without needing further customized parameters for scaling of major/minor values. Signed-off-by: Siarhei Vishniakou Reviewed-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220520084514.3451193-1-svv@google.com Signed-off-by: Dmitry Torokhov commit 3de93e6ed2df6521e3f68fb45eec0bb4fe1bb218 Author: Hans de Goede Date: Fri Jul 8 21:42:12 2022 -0700 Input: goodix - call acpi_device_fix_up_power() in some cases On ACPI boards, when we cannot get the GPIOs to do a reset ourselves if necessary, call acpi_device_fix_up_power() to force the ACPI _PS0 method to run. On some devices without proper GPIO descriptions this will reset the touchscreen for us and this may be necessary for us to be able to communicate to the touchscreen at all. Specifically on an Aya Neo Next this change will cause the _PS0() ACPI function to call INIT() which does: Method (INIT, 0, Serialized) { TP_I = 0x00A50000 TP_R = 0x00A50000 Sleep (0x0A) TP_I = 0x00E50000 Sleep (One) TP_R = 0x00E50000 Sleep (0x06) TP_I = 0x00A50000 Sleep (0x3C) TP_I = 0x00041800 } On older kernels the ACPI core assumed a power-on was necessary by itself and would run _PS0 before our probe function runs, which can be seen from the GPIO pin ctrl registers in /sys/kernel/debug/gpio which match the above hex values with older kernels. With newer kernels before this change the GPIO pin ctrl registers do not match, indicating INIT() has not run and probing the touchscreen fails. This change makes Linux run _PS0() again fixing the touchscreen not working on the Aya Neo Next. Reported-and-tested-by: Maya Matuszczyk Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220618210233.208027-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 6676d7270ce254596ab1d4ae0de27b8e19705d44 Merge: 7c895ef88403b cfbba7b46aef6 Author: Jakub Kicinski Date: Fri Jul 8 20:31:02 2022 -0700 Merge branch 'selftests-forwarding-install-two-missing-tests' Martin Blumenstingl says: ==================== selftests: forwarding: Install two missing tests For some distributions (e.g. OpenWrt) we don't want to rely on rsync to copy the tests to the target as some extra dependencies need to be installed. The Makefile in tools/testing/selftests/net/forwarding already installs most of the tests. This series adds the two missing tests to the list of installed tests. That way a downstream distribution can build a package using this Makefile (and add dependencies there as needed). ==================== Link: https://lore.kernel.org/r/20220707135532.1783925-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski commit cfbba7b46aef631445909ab4c35b98c16e36074b Author: Martin Blumenstingl Date: Thu Jul 7 15:55:32 2022 +0200 selftests: forwarding: Install no_forwarding.sh When using the Makefile from tools/testing/selftests/net/forwarding/ all tests should be installed. Add no_forwarding.sh to the list of "to be installed tests" where it has been missing so far. Fixes: 476a4f05d9b83f ("selftests: forwarding: add a no_forwarding.sh test") Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 437ac2592c09fcf27430db3ac878d2a566a58692 Author: Martin Blumenstingl Date: Thu Jul 7 15:55:31 2022 +0200 selftests: forwarding: Install local_termination.sh When using the Makefile from tools/testing/selftests/net/forwarding/ all tests should be installed. Add local_termination.sh to the list of "to be installed tests" where it has been missing so far. Fixes: 90b9566aa5cd3f ("selftests: forwarding: add a test for local_termination.sh") Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit e5524c2a1fc4002a52e16236659e779767617a4f Merge: 525496a030de4 85e4ea1049c70 Author: Linus Torvalds Date: Fri Jul 8 16:08:48 2022 -0700 Merge tag 'fscache-fixes-20220708' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull fscache fixes from David Howells: - Fix a check in fscache_wait_on_volume_collision() in which the polarity is reversed. It should complain if a volume is still marked acquisition-pending after 20s, but instead complains if the mark has been cleared (ie. the condition has cleared). Also switch an open-coded test of the ACQUIRE_PENDING volume flag to use the helper function for consistency. - Not a fix per se, but neaten the code by using a helper to check for the DROPPED state. - Fix cachefiles's support for erofs to only flush requests associated with a released control file, not all requests. - Fix a race between one process invalidating an object in the cache and another process trying to look it up. * tag 'fscache-fixes-20220708' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: fscache: Fix invalidation/lookup race cachefiles: narrow the scope of flushed requests when releasing fd fscache: Introduce fscache_cookie_is_dropped() fscache: Fix if condition in fscache_wait_on_volume_collision() commit 7c895ef88403bf970843c443a29e0385f65c3f39 Merge: 32b3ad1418ea5 f8d3da4ef8faf Author: Jakub Kicinski Date: Fri Jul 8 15:24:16 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== bpf 2022-07-08 We've added 3 non-merge commits during the last 2 day(s) which contain a total of 7 files changed, 40 insertions(+), 24 deletions(-). The main changes are: 1) Fix cBPF splat triggered by skb not having a mac header, from Eric Dumazet. 2) Fix spurious packet loss in generic XDP when pushing packets out (note that native XDP is not affected by the issue), from Johan Almbladh. 3) Fix bpf_dynptr_{read,write}() helper signatures with flag argument before its set in stone as UAPI, from Joanne Koong. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Add flags arg to bpf_dynptr_read and bpf_dynptr_write APIs bpf: Make sure mac_header was set before using it xdp: Fix spurious packet loss in generic XDP TX path ==================== Link: https://lore.kernel.org/r/20220708213418.19626-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 3418357a32db6c8ce5e4417964bac1edcc3f281a Author: Sven Schnelle Date: Wed Jul 6 12:16:25 2022 +0200 ptrace: fix clearing of JOBCTL_TRACED in ptrace_unfreeze_traced() CI reported the following splat while running the strace testsuite: [ 3976.640309] WARNING: CPU: 1 PID: 3570031 at kernel/ptrace.c:272 ptrace_check_attach+0x12e/0x178 [ 3976.640391] CPU: 1 PID: 3570031 Comm: strace Tainted: G OE 5.19.0-20220624.rc3.git0.ee819a77d4e7.300.fc36.s390x #1 [ 3976.640410] Hardware name: IBM 3906 M04 704 (z/VM 7.1.0) [ 3976.640452] Call Trace: [ 3976.640454] [<00000000ab4b645a>] ptrace_check_attach+0x132/0x178 [ 3976.640457] ([<00000000ab4b6450>] ptrace_check_attach+0x128/0x178) [ 3976.640460] [<00000000ab4b6cde>] __s390x_sys_ptrace+0x86/0x160 [ 3976.640463] [<00000000ac03fcec>] __do_syscall+0x1d4/0x200 [ 3976.640468] [<00000000ac04e312>] system_call+0x82/0xb0 [ 3976.640470] Last Breaking-Event-Address: [ 3976.640471] [<00000000ab4ea3c8>] wait_task_inactive+0x98/0x190 This is because JOBCTL_TRACED is set, but the task is not in TASK_TRACED state. Caused by ptrace_unfreeze_traced() which does: task->jobctl &= ~TASK_TRACED but it should be: task->jobctl &= ~JOBCTL_TRACED Fixes: 31cae1eaae4f ("sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state") Signed-off-by: Sven Schnelle Link: https://lkml.kernel.org/r/20220706101625.2100298-1-svens@linux.ibm.com Link: https://lkml.kernel.org/r/YrHA5UkJLornOdCz@li-4a3a4a4c-28e5-11b2-a85c-a8d192c6f089.ibm.com Link: https://bugzilla.redhat.com/show_bug.cgi?id=2101641 Acked-by: Peter Zijlstra (Intel) Tested-by: Alexander Gordeev Tested-by: Linus Torvalds Signed-off-by: Eric W. Biederman commit 3f231ccb38835121034a8fe09c798e57801ff4fd Merge: 5b7925988de46 884b66976a727 Author: Arnd Bergmann Date: Fri Jul 8 22:47:33 2022 +0200 Merge tag 'sunxi-fixes-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes - Fix SPI NOR compatible on Orange Pi Zero * tag 'sunxi-fixes-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero Link: https://lore.kernel.org/r/Ysh44qUmdmF6TWS6@kista.localdomain Signed-off-by: Arnd Bergmann commit 5b7925988de4653f70831857c269af083806177a Merge: 5e7230a4daf97 79471f29ec487 Author: Arnd Bergmann Date: Fri Jul 8 22:45:00 2022 +0200 Merge tag 'sunxi-fixes-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes - fix binding for D1 display pipeline * tag 'sunxi-fixes-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: dt-bindings: display: sun4i: Fix D1 pipeline count Link: https://lore.kernel.org/r/YshiPKZRq6NHxPzO@kista.localdomain Signed-off-by: Arnd Bergmann commit 5e7230a4daf97d2fb4c764395f1c79fc420dd96f Merge: 2dc94f06127f3 2fdf15b50a46e Author: Arnd Bergmann Date: Fri Jul 8 22:43:59 2022 +0200 Merge tag 'at91-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 5.19 #2 It contains 2 DT fixes: - one for SAMA5D2 to fix the i2s1 assigned-clock-parents property - one for kswitch-d10 (LAN966 based) enforcing proper settings on GPIO pins * tag 'at91-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama5d2: Fix typo in i2s1 node ARM: dts: kswitch-d10: use open drain mode for coma-mode pins Link: https://lore.kernel.org/r/20220708151621.860339-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit 12dc6adc49c9c491d830504e1e01b688ef789093 Author: Uwe Kleine-König Date: Fri Jul 8 13:19:19 2022 -0700 Input: wm97xx - make .remove() obviously always return 0 wm97xx_remove() returns zero unconditionally. To prepare changing the prototype for platform remove callbacks to return void, make it explicit that wm97xx_mfd_remove() always returns zero. The prototype for wm97xx_remove cannot be changed, as it's also used as a plain device remove callback. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220708062718.240013-1-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 525496a030de4ae64bb9e1d6bfc88eec6f5fe6e2 Merge: 3784fad934c5b 8b356e536e69f Author: Linus Torvalds Date: Fri Jul 8 13:05:56 2022 -0700 Merge tag 'acpi-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix two recent regressions related to CPPC support. Specifics: - Prevent _CPC from being used if the platform firmware does not confirm CPPC v2 support via _OSC (Mario Limonciello) - Allow systems with X86_FEATURE_CPPC set to use _CPC even if CPPC support cannot be agreed on via _OSC (Mario Limonciello)" * tag 'acpi-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked commit 3784fad934c5bd68551f0af4252821697957a72a Merge: 483e4a1d83db1 fe7c758c07c47 Author: Linus Torvalds Date: Fri Jul 8 13:01:04 2022 -0700 Merge tag 'pm-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix a NULL pointer dereference in a devfreq driver and a runtime PM framework issue that may cause a supplier device to be suspended before its consumer. Specifics: - Fix NULL pointer dereference related to printing a diagnostic message in the exynos-bus devfreq driver (Christian Marangi) - Fix race condition in the runtime PM framework which in some cases may cause a supplier device to be suspended when its consumer is still active (Rafael Wysocki)" * tag 'pm-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / devfreq: exynos-bus: Fix NULL pointer dereference PM: runtime: Fix supplier device management during consumer probe PM: runtime: Redefine pm_runtime_release_supplier() commit 483e4a1d83db1a6d339cd76f7966bf9e1748f752 Merge: f5645edf6cffb e35f5718903b0 Author: Linus Torvalds Date: Fri Jul 8 12:55:25 2022 -0700 Merge tag 'cxl-fixes-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull cxl fixes from Vishal Verma: - Update MAINTAINERS for Ben's email - Fix cleanup of port devices on failure to probe driver - Fix endianness in get/set LSA mailbox command structures - Fix memregion_free() fallback definition - Fix missing variable payload checks in CXL cmd size validation * tag 'cxl-fixes-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/mbox: Fix missing variable payload checks in cmd size validation memregion: Fix memregion_free() fallback definition cxl/mbox: Use __le32 in get,set_lsa mailbox structures cxl/core: Use is_endpoint_decoder cxl: Fix cleanup of port devices on failure to probe driver. MAINTAINERS: Update Ben's email address commit f5645edf6cffb97d976c6eef31fb536a09f114fd Merge: 2b93fe647c0a9 c51b8f85c4157 Author: Linus Torvalds Date: Fri Jul 8 12:49:00 2022 -0700 Merge tag 'iommu-fixes-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - fix device setup failures in the Intel VT-d driver when the PASID table is shared - fix Intel VT-d device hot-add failure due to wrong device notifier order - remove the old IOMMU mailing list from the MAINTAINERS file now that it has been retired * tag 'iommu-fixes-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: MAINTAINERS: Remove iommu@lists.linux-foundation.org iommu/vt-d: Fix RID2PASID setup/teardown failure iommu/vt-d: Fix PCI bus rescan device hot add commit 8bd582ae9a71d7f14c4e0c735b2eacaf7516d626 Author: William Zhang Date: Fri Jul 8 11:25:07 2022 -0700 arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot Add spin-table enable-method and cpu-release-addr properties for cpu0 node. This is required by all ARMv8 SoC. Otherwise some bootloader like u-boot can not update cpu-release-addr and linux fails to start up secondary cpus. Fixes: 2961f69f151c ("arm64: dts: broadcom: add BCM4908 and Asus GT-AC5300 early DTS files") Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit b4a544e415e9be33b37d9bfa9d9f9f4d13f553d6 Author: William Zhang Date: Fri Jul 8 11:25:06 2022 -0700 arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC The cpu mask value in interrupt property inherits from bcm4908.dtsi which sets to four cpus. Correct the value to two cpus for dual core BCM4906 SoC. Fixes: c8b404fb05dc ("arm64: dts: broadcom: bcm4908: add BCM4906 Netgear R8000P DTS files") Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit 2b93fe647c0a901e00eba0adab84a6ecba3f25c4 Merge: a471da3100ef2 c8e27a4a5136e Author: Linus Torvalds Date: Fri Jul 8 12:39:52 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix a build error in gpio-vf610 - fix a null-pointer dereference in the GPIO character device code * tag 'gpio-fixes-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpiolib: cdev: fix null pointer dereference in linereq_free() gpio: vf610: fix compilation error commit fe7c758c07c4729a16f940eb1d77027ad032ab29 Merge: ba7c3507087aa 8873710660390 Author: Rafael J. Wysocki Date: Fri Jul 8 20:38:51 2022 +0200 Merge branch 'pm-core' Merge a runtime PM framework cleanup and fix related to device links. * pm-core: PM: runtime: Fix supplier device management during consumer probe PM: runtime: Redefine pm_runtime_release_supplier() commit a471da3100ef2e8feb8449d378a52e29dd1e9ae1 Merge: 29837019d5ebb 6b0de7d0f3285 Author: Linus Torvalds Date: Fri Jul 8 11:32:23 2022 -0700 Merge tag 'block-5.19-2022-07-08' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "NVMe pull request with another id quirk addition, and a tracing fix" * tag 'block-5.19-2022-07-08' of git://git.kernel.dk/linux-block: nvme: use struct group for generic command dwords nvme-pci: phison e16 has bogus namespace ids commit 884b66976a7279ee889ba885fe364244d50b79e7 Author: Michal Suchanek Date: Fri Jul 8 19:45:29 2022 +0200 ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero The device tree should include generic "jedec,spi-nor" compatible, and a manufacturer-specific one. The macronix part is what is shipped on the boards that come with a flash chip. Fixes: 45857ae95478 ("ARM: dts: orange-pi-zero: add node for SPI NOR") Signed-off-by: Michal Suchanek Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220708174529.3360-1-msuchanek@suse.de commit 29837019d5ebb80a5f180af3107a0645c731a770 Merge: 086ff84617185 bdb2c48e4b38e Author: Linus Torvalds Date: Fri Jul 8 11:25:01 2022 -0700 Merge tag 'io_uring-5.19-2022-07-08' of git://git.kernel.dk/linux-block Pull io_uring tweak from Jens Axboe: "Just a minor tweak to an addition made in this release cycle: padding a 32-bit value that's in a 64-bit union to avoid any potential funkiness from that" * tag 'io_uring-5.19-2022-07-08' of git://git.kernel.dk/linux-block: io_uring: explicit sqe padding for ioctl commands commit 086ff84617185393a0bbf25830c4f36412a7d3f4 Merge: e8a4e1c1bb697 53a6e66b1b4fe Author: Linus Torvalds Date: Fri Jul 8 11:03:26 2022 -0700 Merge tag 'for-5.19/fbdev-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes from Helge Deller: - fbcon now prevents switching to screen resolutions which are smaller than the font size, and prevents enabling a font which is bigger than the current screen resolution. This fixes vmalloc-out-of-bounds accesses found by KASAN. - Guiling Deng fixed a bug where the centered fbdev logo wasn't displayed correctly if the screen size matched the logo size. - Hsin-Yi Wang provided a patch to include errno.h to fix build when CONFIG_OF isn't enabled. * tag 'for-5.19/fbdev-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbcon: Use fbcon_info_from_console() in fbcon_modechange_possible() fbmem: Check virtual screen sizes in fb_set_var() fbcon: Prevent that screen size is smaller than font size fbcon: Disallow setting font bigger than screen size video: of_display_timing.h: include errno.h fbdev: fbmem: Fix logo center image dx issue commit b3a3b0255797e1d395253366ba24a4cc6c8bdf9c Author: Naohiro Aota Date: Wed Jun 29 11:00:38 2022 +0900 btrfs: zoned: drop optimization of zone finish We have an optimization in do_zone_finish() to send REQ_OP_ZONE_FINISH only when necessary, i.e. we don't send REQ_OP_ZONE_FINISH when we assume we wrote fully into the zone. The assumption is determined by "alloc_offset == capacity". This condition won't work if the last ordered extent is canceled due to some errors. In that case, we consider the zone is deactivated without sending the finish command while it's still active. This inconstancy results in activating another block group while we cannot really activate the underlying zone, which causes the active zone exceeds errors like below. BTRFS error (device nvme3n2): allocation failed flags 1, wanted 520192 tree-log 0, relocation: 0 nvme3n2: I/O Cmd(0x7d) @ LBA 160432128, 127 blocks, I/O Error (sct 0x1 / sc 0xbd) MORE DNR active zones exceeded error, dev nvme3n2, sector 0 op 0xd:(ZONE_APPEND) flags 0x4800 phys_seg 1 prio class 0 nvme3n2: I/O Cmd(0x7d) @ LBA 160432128, 127 blocks, I/O Error (sct 0x1 / sc 0xbd) MORE DNR active zones exceeded error, dev nvme3n2, sector 0 op 0xd:(ZONE_APPEND) flags 0x4800 phys_seg 1 prio class 0 Fix the issue by removing the optimization for now. Fixes: 8376d9e1ed8f ("btrfs: zoned: finish superblock zone once no space left for new SB") Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 2963457829decf0c824a443238d251151ed18ff5 Author: Christoph Hellwig Date: Thu Jun 30 18:03:19 2022 +0200 btrfs: zoned: fix a leaked bioc in read_zone_info The bioc would leak on the normal completion path and also on the RAID56 check (but that one won't happen in practice due to the invalid combination with zoned mode). Fixes: 7db1c5d14dcd ("btrfs: zoned: support dev-replace in zoned filesystems") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Anand Jain Signed-off-by: Christoph Hellwig [ update changelog ] Reviewed-by: David Sterba Signed-off-by: David Sterba commit a4527e1853f8ff6e0b7c2dadad6268bd38427a31 Author: Filipe Manana Date: Mon Jul 4 12:42:03 2022 +0100 btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents When doing a direct IO read or write, we always return -ENOTBLK when we find a compressed extent (or an inline extent) so that we fallback to buffered IO. This however is not ideal in case we are in a NOWAIT context (io_uring for example), because buffered IO can block and we currently have no support for NOWAIT semantics for buffered IO, so if we need to fallback to buffered IO we should first signal the caller that we may need to block by returning -EAGAIN instead. This behaviour can also result in short reads being returned to user space, which although it's not incorrect and user space should be able to deal with partial reads, it's somewhat surprising and even some popular applications like QEMU (Link tag #1) and MariaDB (Link tag #2) don't deal with short reads properly (or at all). The short read case happens when we try to read from a range that has a non-compressed and non-inline extent followed by a compressed extent. After having read the first extent, when we find the compressed extent we return -ENOTBLK from btrfs_dio_iomap_begin(), which results in iomap to treat the request as a short read, returning 0 (success) and waiting for previously submitted bios to complete (this happens at fs/iomap/direct-io.c:__iomap_dio_rw()). After that, and while at btrfs_file_read_iter(), we call filemap_read() to use buffered IO to read the remaining data, and pass it the number of bytes we were able to read with direct IO. Than at filemap_read() if we get a page fault error when accessing the read buffer, we return a partial read instead of an -EFAULT error, because the number of bytes previously read is greater than zero. So fix this by returning -EAGAIN for NOWAIT direct IO when we find a compressed or an inline extent. Reported-by: Dominique MARTINET Link: https://lore.kernel.org/linux-btrfs/YrrFGO4A1jS0GI0G@atmark-techno.com/ Link: https://jira.mariadb.org/browse/MDEV-27900?focusedCommentId=216582&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-216582 Tested-by: Dominique MARTINET CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Christoph Hellwig Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 2fdf15b50a46e366740df4cccbe2343269b4ff55 Author: Ryan Wanner Date: Thu Jul 7 14:58:12 2022 -0700 ARM: dts: at91: sama5d2: Fix typo in i2s1 node Fix typo in i2s1 causing errors in dt binding validation. Change assigned-parrents to assigned-clock-parents to match i2s0 node formatting. Fixes: 1ca81883c557 ("ARM: dts: at91: sama5d2: add nodes for I2S controllers") Signed-off-by: Ryan Wanner [claudiu.beznea: use imperative addressing in commit description, remove blank line after fixes tag, fix typo in commit message] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220707215812.193008-1-Ryan.Wanner@microchip.com commit 2dc94f06127f306201b10617df54ea7f265bcce9 Merge: a902fa8eccaf9 e5ce073c8a1e0 Author: Arnd Bergmann Date: Fri Jul 8 15:59:42 2022 +0200 Merge tag 'tee-fixes-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes Fixes for TEE subsystem A fix for the recently merged commit ed8faf6c8f8c ("optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG"). Two small fixes in comment, repeated words etc. * tag 'tee-fixes-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: tee_get_drvdata(): fix description of return value optee: Remove duplicate 'of' in two places. optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR() Link: https://lore.kernel.org/r/20220708134607.GA901814@jade Signed-off-by: Arnd Bergmann commit 4a47c6385bb4e0786826e75bd4555aba32953653 Author: Christian Brauner Date: Wed Jul 6 15:56:11 2022 +0200 ovl: turn of SB_POSIXACL with idmapped layers temporarily This cycle we added support for mounting overlayfs on top of idmapped mounts. Recently I've started looking into potential corner cases when trying to add additional tests and I noticed that reporting for POSIX ACLs is currently wrong when using idmapped layers with overlayfs mounted on top of it. I have sent out an patch that fixes this and makes POSIX ACLs work correctly but the patch is a bit bigger and we're already at -rc5 so I recommend we simply don't raise SB_POSIXACL when idmapped layers are used. Then we can fix the VFS part described below for the next merge window so we can have good exposure in -next. I'm going to give a rather detailed explanation to both the origin of the problem and mention the solution so people know what's going on. Let's assume the user creates the following directory layout and they have a rootfs /var/lib/lxc/c1/rootfs. The files in this rootfs are owned as you would expect files on your host system to be owned. For example, ~/.bashrc for your regular user would be owned by 1000:1000 and /root/.bashrc would be owned by 0:0. IOW, this is just regular boring filesystem tree on an ext4 or xfs filesystem. The user chooses to set POSIX ACLs using the setfacl binary granting the user with uid 4 read, write, and execute permissions for their .bashrc file: setfacl -m u:4:rwx /var/lib/lxc/c2/rootfs/home/ubuntu/.bashrc Now they to expose the whole rootfs to a container using an idmapped mount. So they first create: mkdir -pv /vol/contpool/{ctrover,merge,lowermap,overmap} mkdir -pv /vol/contpool/ctrover/{over,work} chown 10000000:10000000 /vol/contpool/ctrover/{over,work} The user now creates an idmapped mount for the rootfs: mount-idmapped/mount-idmapped --map-mount=b:0:10000000:65536 \ /var/lib/lxc/c2/rootfs \ /vol/contpool/lowermap This for example makes it so that /var/lib/lxc/c2/rootfs/home/ubuntu/.bashrc which is owned by uid and gid 1000 as being owned by uid and gid 10001000 at /vol/contpool/lowermap/home/ubuntu/.bashrc. Assume the user wants to expose these idmapped mounts through an overlayfs mount to a container. mount -t overlay overlay \ -o lowerdir=/vol/contpool/lowermap, \ upperdir=/vol/contpool/overmap/over, \ workdir=/vol/contpool/overmap/work \ /vol/contpool/merge The user can do this in two ways: (1) Mount overlayfs in the initial user namespace and expose it to the container. (2) Mount overlayfs on top of the idmapped mounts inside of the container's user namespace. Let's assume the user chooses the (1) option and mounts overlayfs on the host and then changes into a container which uses the idmapping 0:10000000:65536 which is the same used for the two idmapped mounts. Now the user tries to retrieve the POSIX ACLs using the getfacl command getfacl -n /vol/contpool/lowermap/home/ubuntu/.bashrc and to their surprise they see: # file: vol/contpool/merge/home/ubuntu/.bashrc # owner: 1000 # group: 1000 user::rw- user:4294967295:rwx group::r-- mask::rwx other::r-- indicating the uid wasn't correctly translated according to the idmapped mount. The problem is how we currently translate POSIX ACLs. Let's inspect the callchain in this example: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:0:4k /* initial idmapping */ sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() |> vfs_getxattr() | -> __vfs_getxattr() | -> handler->get == ovl_posix_acl_xattr_get() | -> ovl_xattr_get() | -> vfs_getxattr() | -> __vfs_getxattr() | -> handler->get() /* lower filesystem callback */ |> posix_acl_fix_xattr_to_user() { 4 = make_kuid(&init_user_ns, 4); 4 = mapped_kuid_fs(&init_user_ns /* no idmapped mount */, 4); /* FAILURE */ -1 = from_kuid(0:10000000:65536 /* caller's idmapping */, 4); } If the user chooses to use option (2) and mounts overlayfs on top of idmapped mounts inside the container things don't look that much better: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:10000000:65536 sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() |> vfs_getxattr() | -> __vfs_getxattr() | -> handler->get == ovl_posix_acl_xattr_get() | -> ovl_xattr_get() | -> vfs_getxattr() | -> __vfs_getxattr() | -> handler->get() /* lower filesystem callback */ |> posix_acl_fix_xattr_to_user() { 4 = make_kuid(&init_user_ns, 4); 4 = mapped_kuid_fs(&init_user_ns, 4); /* FAILURE */ -1 = from_kuid(0:10000000:65536 /* caller's idmapping */, 4); } As is easily seen the problem arises because the idmapping of the lower mount isn't taken into account as all of this happens in do_gexattr(). But do_getxattr() is always called on an overlayfs mount and inode and thus cannot possible take the idmapping of the lower layers into account. This problem is similar for fscaps but there the translation happens as part of vfs_getxattr() already. Let's walk through an fscaps overlayfs callchain: setcap 'cap_net_raw+ep' /var/lib/lxc/c2/rootfs/home/ubuntu/.bashrc The expected outcome here is that we'll receive the cap_net_raw capability as we are able to map the uid associated with the fscap to 0 within our container. IOW, we want to see 0 as the result of the idmapping translations. If the user chooses option (1) we get the following callchain for fscaps: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:0:4k /* initial idmapping */ sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() -> vfs_getxattr() -> xattr_getsecurity() -> security_inode_getsecurity() ________________________________ -> cap_inode_getsecurity() | | { V | 10000000 = make_kuid(0:0:4k /* overlayfs idmapping */, 10000000); | 10000000 = mapped_kuid_fs(0:0:4k /* no idmapped mount */, 10000000); | /* Expected result is 0 and thus that we own the fscap. */ | 0 = from_kuid(0:10000000:65536 /* caller's idmapping */, 10000000); | } | -> vfs_getxattr_alloc() | -> handler->get == ovl_other_xattr_get() | -> vfs_getxattr() | -> xattr_getsecurity() | -> security_inode_getsecurity() | -> cap_inode_getsecurity() | { | 0 = make_kuid(0:0:4k /* lower s_user_ns */, 0); | 10000000 = mapped_kuid_fs(0:10000000:65536 /* idmapped mount */, 0); | 10000000 = from_kuid(0:0:4k /* overlayfs idmapping */, 10000000); | |____________________________________________________________________| } -> vfs_getxattr_alloc() -> handler->get == /* lower filesystem callback */ And if the user chooses option (2) we get: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:10000000:65536 sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() -> vfs_getxattr() -> xattr_getsecurity() -> security_inode_getsecurity() _______________________________ -> cap_inode_getsecurity() | | { V | 10000000 = make_kuid(0:10000000:65536 /* overlayfs idmapping */, 0); | 10000000 = mapped_kuid_fs(0:0:4k /* no idmapped mount */, 10000000); | /* Expected result is 0 and thus that we own the fscap. */ | 0 = from_kuid(0:10000000:65536 /* caller's idmapping */, 10000000); | } | -> vfs_getxattr_alloc() | -> handler->get == ovl_other_xattr_get() | |-> vfs_getxattr() | -> xattr_getsecurity() | -> security_inode_getsecurity() | -> cap_inode_getsecurity() | { | 0 = make_kuid(0:0:4k /* lower s_user_ns */, 0); | 10000000 = mapped_kuid_fs(0:10000000:65536 /* idmapped mount */, 0); | 0 = from_kuid(0:10000000:65536 /* overlayfs idmapping */, 10000000); | |____________________________________________________________________| } -> vfs_getxattr_alloc() -> handler->get == /* lower filesystem callback */ We can see how the translation happens correctly in those cases as the conversion happens within the vfs_getxattr() helper. For POSIX ACLs we need to do something similar. However, in contrast to fscaps we cannot apply the fix directly to the kernel internal posix acl data structure as this would alter the cached values and would also require a rework of how we currently deal with POSIX ACLs in general which almost never take the filesystem idmapping into account (the noteable exception being FUSE but even there the implementation is special) and instead retrieve the raw values based on the initial idmapping. The correct values are then generated right before returning to userspace. The fix for this is to move taking the mount's idmapping into account directly in vfs_getxattr() instead of having it be part of posix_acl_fix_xattr_to_user(). To this end we simply move the idmapped mount translation into a separate step performed in vfs_{g,s}etxattr() instead of in posix_acl_fix_xattr_{from,to}_user(). To see how this fixes things let's go back to the original example. Assume the user chose option (1) and mounted overlayfs on top of idmapped mounts on the host: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:0:4k /* initial idmapping */ sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() |> vfs_getxattr() | |> __vfs_getxattr() | | -> handler->get == ovl_posix_acl_xattr_get() | | -> ovl_xattr_get() | | -> vfs_getxattr() | | |> __vfs_getxattr() | | | -> handler->get() /* lower filesystem callback */ | | |> posix_acl_getxattr_idmapped_mnt() | | { | | 4 = make_kuid(&init_user_ns, 4); | | 10000004 = mapped_kuid_fs(0:10000000:65536 /* lower idmapped mount */, 4); | | 10000004 = from_kuid(&init_user_ns, 10000004); | | |_______________________ | | } | | | | | |> posix_acl_getxattr_idmapped_mnt() | | { | | V | 10000004 = make_kuid(&init_user_ns, 10000004); | 10000004 = mapped_kuid_fs(&init_user_ns /* no idmapped mount */, 10000004); | 10000004 = from_kuid(&init_user_ns, 10000004); | } |_________________________________________________ | | | | |> posix_acl_fix_xattr_to_user() | { V 10000004 = make_kuid(0:0:4k /* init_user_ns */, 10000004); /* SUCCESS */ 4 = from_kuid(0:10000000:65536 /* caller's idmapping */, 10000004); } And similarly if the user chooses option (1) and mounted overayfs on top of idmapped mounts inside the container: idmapped mount /vol/contpool/merge: 0:10000000:65536 caller's idmapping: 0:10000000:65536 overlayfs idmapping (ofs->creator_cred): 0:10000000:65536 sys_getxattr() -> path_getxattr() -> getxattr() -> do_getxattr() |> vfs_getxattr() | |> __vfs_getxattr() | | -> handler->get == ovl_posix_acl_xattr_get() | | -> ovl_xattr_get() | | -> vfs_getxattr() | | |> __vfs_getxattr() | | | -> handler->get() /* lower filesystem callback */ | | |> posix_acl_getxattr_idmapped_mnt() | | { | | 4 = make_kuid(&init_user_ns, 4); | | 10000004 = mapped_kuid_fs(0:10000000:65536 /* lower idmapped mount */, 4); | | 10000004 = from_kuid(&init_user_ns, 10000004); | | |_______________________ | | } | | | | | |> posix_acl_getxattr_idmapped_mnt() | | { V | 10000004 = make_kuid(&init_user_ns, 10000004); | 10000004 = mapped_kuid_fs(&init_user_ns /* no idmapped mount */, 10000004); | 10000004 = from_kuid(0(&init_user_ns, 10000004); | |_________________________________________________ | } | | | |> posix_acl_fix_xattr_to_user() | { V 10000004 = make_kuid(0:0:4k /* init_user_ns */, 10000004); /* SUCCESS */ 4 = from_kuid(0:10000000:65536 /* caller's idmappings */, 10000004); } The last remaining problem we need to fix here is ovl_get_acl(). During ovl_permission() overlayfs will call: ovl_permission() -> generic_permission() -> acl_permission_check() -> check_acl() -> get_acl() -> inode->i_op->get_acl() == ovl_get_acl() > get_acl() /* on the underlying filesystem) ->inode->i_op->get_acl() == /*lower filesystem callback */ -> posix_acl_permission() passing through the get_acl request to the underlying filesystem. This will retrieve the acls stored in the lower filesystem without taking the idmapping of the underlying mount into account as this would mean altering the cached values for the lower filesystem. The simple solution is to have ovl_get_acl() simply duplicate the ACLs, update the values according to the idmapped mount and return it to acl_permission_check() so it can be used in posix_acl_permission(). Since overlayfs doesn't cache ACLs they'll be released right after. Link: https://github.com/brauner/mount-idmapped/issues/9 Cc: Seth Forshee Cc: Amir Goldstein Cc: Vivek Goyal Cc: Christoph Hellwig Cc: Aleksa Sarai Cc: linux-unionfs@vger.kernel.org Signed-off-by: Christian Brauner (Microsoft) Fixes: bc70682a497c ("ovl: support idmapped layers") Signed-off-by: Miklos Szeredi commit a501ab75e7624d133a5a3c7ec010687c8b961d23 Author: Jiri Slaby Date: Thu Jul 7 10:25:58 2022 +0200 tty: use new tty_insert_flip_string_and_push_buffer() in pty_write() There is a race in pty_write(). pty_write() can be called in parallel with e.g. ioctl(TIOCSTI) or ioctl(TCXONC) which also inserts chars to the buffer. Provided, tty_flip_buffer_push() in pty_write() is called outside the lock, it can commit inconsistent tail. This can lead to out of bounds writes and other issues. See the Link below. To fix this, we have to introduce a new helper called tty_insert_flip_string_and_push_buffer(). It does both tty_insert_flip_string() and tty_flip_buffer_commit() under the port lock. It also calls queue_work(), but outside the lock. See 71a174b39f10 (pty: do tty_flip_buffer_push without port->lock in pty_write) for the reasons. Keep the helper internal-only (in drivers' tty.h). It is not intended to be used widely. Link: https://seclists.org/oss-sec/2022/q2/155 Fixes: 71a174b39f10 (pty: do tty_flip_buffer_push without port->lock in pty_write) Cc: 一只狗 Cc: Dan Carpenter Suggested-by: Hillf Danton Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220707082558.9250-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 716b10580283fda66f2b88140e3964f8a7f9da89 Author: Jiri Slaby Date: Thu Jul 7 10:25:57 2022 +0200 tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push() We will need this new helper in the next patch. Cc: Hillf Danton Cc: 一只狗 Cc: Dan Carpenter Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220707082558.9250-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit bb160ee61c04fe96f3cc0088ef1907214861dccc Author: Darren Stevens Date: Sat Jul 2 22:03:55 2022 +0100 drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode. In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT core) we stopped platform_get_resource() from returning the IRQ, as all drivers were supposed to have switched to platform_get_irq() Unfortunately the Freescale EHCI driver in host mode got missed. Fix it. Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") Reported-by: Christian Zigotzky Suggested-by: Rob Herring Tested-by: Christian Zigotzky Acked-by: Rob Herring Acked-by: Alan Stern Signed-off-by: Darren Stevens Link: https://lore.kernel.org/r/20220702220355.63b36fb8@Cyrus.lan Signed-off-by: Greg Kroah-Hartman commit 3d0dc539029b09fbd125444c16b11a8ed10b9d0f Author: Michael Grzeschik Date: Thu Jul 7 13:56:12 2022 +0200 usb: gadget: uvc: fix changing interface name via configfs When setting the function name, it is always truncated by one char since snprintf is always including the null-termination in the len parameter. We use strscpy and fix the size setting to use len + 1 instead. Fixes: 324e4f85070f ("usb: gadget: uvc: allow changing interface name via configfs") Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220707115612.2760569-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6fb9e1d94789e8ee5a258a23bc588693f743fd6c Author: Linyu Yuan Date: Fri Jul 1 16:08:54 2022 +0800 usb: typec: add missing uevent when partner support PD System like Android allow user control power role from UI, it is possible to implement application base on typec uevent to refresh UI, but found there is chance that UI show different state from typec attribute file. In typec_set_pwr_opmode(), when partner support PD, there is no uevent send to user space which cause the problem. Fix it by sending uevent notification when change power mode to PD. Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers") Cc: stable@vger.kernel.org Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1656662934-10226-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 925b6e59138cefa47275c67891c65d48d3266d57 Author: Arunpravin Paneer Selvam Date: Fri Jul 8 02:30:47 2022 -0700 Revert "drm/amdgpu: add drm buddy support to amdgpu" This reverts commit c9cad937c0c58618fe5b0310fd539a854dc1ae95. This is part of a revert of the following commits: commit 708d19d9f362 ("drm/amdgpu: move internal vram_mgr function into the C file") commit 5e3f1e7729ec ("drm/amdgpu: fix start calculation in amdgpu_vram_mgr_new") commit c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu") [WHY] Few users reported garbaged graphics as soon as x starts, reverting until this can be resolved. Signed-off-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20220708093047.492662-3-Arunpravin.PaneerSelvam@amd.com Reviewed-by: Christian König Signed-off-by: Christian König commit 32b3ad1418ea53184ab7d652f13b5d66414d1bba Merge: 820b8963adaea 73318c4b7dbd0 Author: David S. Miller Date: Fri Jul 8 12:10:34 2022 +0100 Merge branch 'sysctl-data-races' Kuniyuki Iwashima says: ==================== sysctl: Fix data-races around ipv4_table. A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. The first half of this series changes some proc handlers used in ipv4_table to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. Then, the second half adds READ_ONCE() to the other readers of ipv4_table. Changes: v2: * Drop some changes that makes backporting difficult * First cleanup patch * Lockless helpers and .proc_handler changes * Drop the tracing part for .sysctl_mem * Steve already posted a fix * Drop int-to-bool change for cipso * Should be posted to net-next later * Drop proc_dobool() change * Can be included in another series v1: https://lore.kernel.org/netdev/20220706052130.16368-1-kuniyu@amazon.com/ ==================== Signed-off-by: David S. Miller commit 73318c4b7dbd0e781aaababff17376b2894745c0 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:40:03 2022 -0700 ipv4: Fix a data-race around sysctl_fib_sync_mem. While reading sysctl_fib_sync_mem, it can be changed concurrently. So, we need to add READ_ONCE() to avoid a data-race. Fixes: 9ab948a91b2c ("ipv4: Allow amount of dirty memory from fib resizing to be controllable") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 48d7ee321ea5182c6a70782aa186422a70e67e22 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:40:02 2022 -0700 icmp: Fix data-races around sysctl. While reading icmp sysctl variables, they can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races. Fixes: 4cdf507d5452 ("icmp: add a global rate limitation") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit dd44f04b9214adb68ef5684ae87a81ba03632250 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:40:01 2022 -0700 cipso: Fix data-races around sysctl. While reading cipso sysctl variables, they can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races. Fixes: 446fda4f2682 ("[NetLabel]: CIPSOv4 engine") Signed-off-by: Kuniyuki Iwashima Acked-by: Paul Moore Signed-off-by: David S. Miller commit 310731e2f1611d1d13aae237abcf8e66d33345d5 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:40:00 2022 -0700 net: Fix data-races around sysctl_mem. While reading .sysctl_mem, it can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 3d32edf1f3c38d3301f6434e56316f293466d7fb Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:59 2022 -0700 inetpeer: Fix data-races around sysctl. While reading inetpeer sysctl variables, they can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 47e6ab24e8c6e3ca10ceb5835413f401f90de4bf Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:58 2022 -0700 tcp: Fix a data-race around sysctl_tcp_max_orphans. While reading sysctl_tcp_max_orphans, it can be changed concurrently. So, we need to add READ_ONCE() to avoid a data-race. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit e877820877663fbae8cb9582ea597a7230b94df3 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:57 2022 -0700 sysctl: Fix data races in proc_dointvec_jiffies(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_dointvec_jiffies() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dointvec_jiffies() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit c31bcc8fb89fc2812663900589c6325ba35d9a65 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:56 2022 -0700 sysctl: Fix data races in proc_doulongvec_minmax(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_doulongvec_minmax() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_doulongvec_minmax() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 2d3b559df3ed39258737789aae2ae7973d205bc1 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:55 2022 -0700 sysctl: Fix data races in proc_douintvec_minmax(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_douintvec_minmax() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_douintvec_minmax() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 61d9b56a8920 ("sysctl: add unsigned int range support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit f613d86d014b6375a4085901de39406598121e35 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:54 2022 -0700 sysctl: Fix data races in proc_dointvec_minmax(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_dointvec_minmax() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dointvec_minmax() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 4762b532ec9539755aab61445d5da6e1926ccb99 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:53 2022 -0700 sysctl: Fix data races in proc_douintvec(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_douintvec() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_douintvec() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: e7d316a02f68 ("sysctl: handle error writing UINT_MAX to u32 fields") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 1f1be04b4d48a2475ea1aab46a99221bfc5c0968 Author: Kuniyuki Iwashima Date: Wed Jul 6 16:39:52 2022 -0700 sysctl: Fix data races in proc_dointvec(). A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing. This patch changes proc_dointvec() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dointvec() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 820b8963adaea34a87abbecb906d1f54c0aabfb7 Author: Steven Rostedt (Google) Date: Wed Jul 6 10:50:40 2022 -0400 net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer The trace event sock_exceed_buf_limit saves the prot->sysctl_mem pointer and then dereferences it in the TP_printk() portion. This is unsafe as the TP_printk() portion is executed at the time the buffer is read. That is, it can be seconds, minutes, days, months, even years later. If the proto is freed, then this dereference will can also lead to a kernel crash. Instead, save the sysctl_mem array into the ring buffer and have the TP_printk() reference that instead. This is the proper and safe way to read pointers in trace events. Link: https://lore.kernel.org/all/20220706052130.16368-12-kuniyu@amazon.com/ Cc: stable@vger.kernel.org Fixes: 3847ce32aea9f ("core: add tracepoints for queueing skb to rcvbuf") Signed-off-by: Steven Rostedt (Google) Acked-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 2259da159fbe5dba8ac00b560cf00b6a6537fa18 Author: Thadeu Lima de Souza Cascardo Date: Thu Jul 7 13:41:52 2022 -0300 x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported There are some VM configurations which have Skylake model but do not support IBPB. In those cases, when using retbleed=ibpb, userspace is going to be killed and kernel is going to panic. If the CPU does not support IBPB, warn and proceed with the auto option. Also, do not fallback to IBPB on AMD/Hygon systems if it is not supported. Fixes: 3ebc17006888 ("x86/bugs: Add retbleed=ibpb") Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Borislav Petkov commit f8d3da4ef8faf027261e06b7864583930dd7c7b9 Author: Joanne Koong Date: Wed Jul 6 16:25:47 2022 -0700 bpf: Add flags arg to bpf_dynptr_read and bpf_dynptr_write APIs Commit 13bbbfbea759 ("bpf: Add bpf_dynptr_read and bpf_dynptr_write") added the bpf_dynptr_write() and bpf_dynptr_read() APIs. However, it will be needed for some dynptr types to pass in flags as well (e.g. when writing to a skb, the user may like to invalidate the hash or recompute the checksum). This patch adds a "u64 flags" arg to the bpf_dynptr_read() and bpf_dynptr_write() APIs before their UAPI signature freezes where we then cannot change them anymore with a 5.19.x released kernel. Fixes: 13bbbfbea759 ("bpf: Add bpf_dynptr_read and bpf_dynptr_write") Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/r/20220706232547.4016651-1-joannelkoong@gmail.com commit e5ce073c8a1e01b215a5eb32ba48f8d17ded3bd5 Author: Marc Kleine-Budde Date: Mon Jun 6 13:43:53 2022 +0200 tee: tee_get_drvdata(): fix description of return value This patch fixes the description of tee_get_drvdata()'s return value. It actually returns the driver_data pointer supplied to tee_device_alloc() since the TEE subsystem was added to the kernel. Fixes: 967c9cca2cc5 ("tee: generic TEE subsystem") Cc: Jens Wiklander Signed-off-by: Marc Kleine-Budde Signed-off-by: Jens Wiklander commit b66527ee98d0e12fbf570d394fbea2be4ef1229e Author: Jiang Jian Date: Wed Jun 22 00:16:48 2022 +0800 optee: Remove duplicate 'of' in two places. file: ./drivers/tee/optee/optee_smc.h line: 192 * a2 Size of of SHM chanegd to * a2 Size of SHM Signed-off-by: Jiang Jian Signed-off-by: Jens Wiklander commit 86c43ea071ae9988b52fd0f654de439da4b5c20a Author: Michael Walle Date: Mon Jul 4 17:08:08 2022 +0200 ARM: dts: kswitch-d10: use open drain mode for coma-mode pins The driver use the coma-mode pins as open-drain. Flag them in the device tree accordingly. This avoids the following error: [ 14.114180] gpio-2007 (coma-mode): enforced open drain please flag it properly in DT/ACPI DSDT/board file Fixes: 46a9556d977e ("ARM: dts: kswitch-d10: enable networking") Signed-off-by: Michael Walle Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220704150808.1104295-1-michael@walle.cc commit 6177a50fd32c6fd956c7265bc5297e725d221bfc Author: Max Krummenacher Date: Tue Jul 5 10:58:24 2022 +0200 ARM: dts: colibri-imx6ull: fix snvs pinmux group A pin controlled by the iomuxc-snvs pin controller must be specified under the dtb's iomuxc-snvs node. Move the one and only pin of that category from the iomuxc node and set the pinctrl-0 using it accordingly. Fixes: 2aa9d6201949 ("ARM: dts: imx6ull-colibri: add touchscreen device nodes") Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit d4fac258d971bead9a6b5c5ebe2f0e415d05d110 Author: Yang Yingliang Date: Tue Jun 28 14:52:16 2022 +0800 optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR() In optee_smc_do_call_with_arg() there is a code path when the argument struct for RPC is passed appended to the primary argument struct. When the address of the RPC struct is retrieved there's an invalid check for success. It should be 'rpc_arg' pass to IS_ERR/PTR_ERR(). Fixes: ed8faf6c8f8c ("optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang [jw: added background to the problem] Signed-off-by: Jens Wiklander commit c51b8f85c4157eb91c2f4ab34b0c52fea642e77c Author: Joerg Roedel Date: Wed Jul 6 12:33:31 2022 +0200 MAINTAINERS: Remove iommu@lists.linux-foundation.org The IOMMU mailing list has moved to iommu@lists.linux.dev and the old list should bounce by now. Remove it from the MAINTAINERS file. Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220706103331.10215-1-joro@8bytes.org commit a902fa8eccaf9ace2886e02aaf75d550996d077b Merge: 2058dc831ff82 a57f68ddc8865 Author: Arnd Bergmann Date: Fri Jul 8 09:10:26 2022 +0200 Merge tag 'reset-fixes-for-v5.19' of git://git.pengutronix.de/pza/linux into arm/fixes Reset controller fixes for v5.19 Fix the MAINTAINERS entry for the Synopsys AXS10x reset controller driver, which still points to a nonexistent .txt file after the device tree binding .yaml conversion. Also, fix the devm_reset_control_bulk_get_optional_exclusive() call, which was defective since its introduction due to a copy & paste error. * tag 'reset-fixes-for-v5.19' of git://git.pengutronix.de/pza/linux: reset: Fix devm bulk optional exclusive control getter MAINTAINERS: rectify entry for SYNOPSYS AXS10x RESET CONTROLLER DRIVER Link: https://lore.kernel.org/r/20220707101344.3329314-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann commit 2058dc831ff82eb8e93e882efd1ca964bd8a74c8 Author: Conor Dooley Date: Thu Jul 7 15:20:42 2022 +0100 MAINTAINERS: add polarfire rng, pci and clock drivers Hardware random, PCI and clock drivers for the PolarFire SoC have been upstreamed but are not covered by the MAINTAINERS entry, so add them. Daire is the author of the clock & PCI drivers, so add him as a maintainer in place of Lewis. Signed-off-by: Conor Dooley Acked-by: Bjorn Helgaas Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20220707142041.4096246-1-conor.dooley@microchip.com' Signed-off-by: Arnd Bergmann commit dc5cb7a833e83a0d51373ba7d96e2ed8e1890944 Author: Heiko Stuebner Date: Wed Jun 8 14:08:49 2022 +0200 riscv: don't warn for sifive erratas in modules The SiFive errata code contains code checking applicable erratas vs. actually applied erratas to suggest missing erratas to the user when their Kconfig options are not enabled. In the main kernel image one can be quite sure that all available erratas appear at least once, so that check will succeed. On the other hand modules can very well not use any errata-relevant code, so the newly added module-alternative support may also patch the module code, but not touch SiFive-specific erratas at all. So to restore the original behaviour don't warn when patching modules. This will keep the warning if necessary for the main kernel image but prevent spurious warnings for modules. Of course having such a vendor-specific warning may not be needed at all, as CONFIG_ERRATA_SIFIVE is selected by CONFIG_SOC_SIFIVE and the individual erratas are default-y so disabling them requires deliberate action anyway. But for now just restore the old behaviour. Fixes: a8e910168bba ("riscv: implement module alternatives") Reported-by: Ron Economos Signed-off-by: Heiko Stuebner Tested-by: Ron Economos Link: https://lore.kernel.org/r/20220608120849.1695191-1-heiko@sntech.de Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit f46fd3d7c3bd5d7bd5bb664135cf32ca9e97190b Author: Pavel Skripkin Date: Wed Jul 6 16:28:45 2022 +0300 net: ocelot: fix wrong time_after usage Accidentally noticed, that this driver is the only user of while (time_after(jiffies...)). It looks like typo, because likely this while loop will finish after 1st iteration, because time_after() returns true when 1st argument _is after_ 2nd one. There is one possible problem with this poll loop: the scheduler could put the thread to sleep, and it does not get woken up for OCELOT_FDMA_CH_SAFE_TIMEOUT_US. During that time, the hardware has done its thing, but you exit the while loop and return -ETIMEDOUT. Fix it by using sane poll API that avoids all problems described above Fixes: 753a026cfec1 ("net: ocelot: add FDMA support") Suggested-by: Andrew Lunn Signed-off-by: Pavel Skripkin Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220706132845.27968-1-paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit fe5235aef8558573c1d225199be3aaa7bcd22943 Merge: 0680e20af5fbf 5b759bf2f9d73 Author: Jakub Kicinski Date: Thu Jul 7 17:44:45 2022 -0700 Merge tag 'mlx5-fixes-2022-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-07-06 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Ring the TX doorbell on DMA errors net/mlx5e: Fix capability check for updating vnic env counters net/mlx5e: CT: Use own workqueue instead of mlx5e priv net/mlx5: Lag, correct get the port select mode str net/mlx5e: Fix enabling sriov while tc nic rules are offloaded net/mlx5e: kTLS, Fix build time constant test in RX net/mlx5e: kTLS, Fix build time constant test in TX net/mlx5: Lag, decouple FDB selection and shared FDB net/mlx5: TC, allow offload from uplink to other PF's VF ==================== Link: https://lore.kernel.org/r/20220706231309.38579-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 0680e20af5fbf41df8a11b11bd9a7c25b2ca0746 Author: Siddharth Vadapalli Date: Wed Jul 6 12:32:08 2022 +0530 net: ethernet: ti: am65-cpsw: Fix devlink port register sequence Renaming interfaces using udevd depends on the interface being registered before its netdev is registered. Otherwise, udevd reads an empty phys_port_name value, resulting in the interface not being renamed. Fix this by registering the interface before registering its netdev by invoking am65_cpsw_nuss_register_devlink() before invoking register_netdev() for the interface. Move the function call to devlink_port_type_eth_set(), invoking it after register_netdev() is invoked, to ensure that netlink notification for the port state change is generated after the netdev is completely initialized. Fixes: 58356eb31d60 ("net: ti: am65-cpsw-nuss: Add devlink support") Signed-off-by: Siddharth Vadapalli Link: https://lore.kernel.org/r/20220706070208.12207-1-s-vadapalli@ti.com Signed-off-by: Jakub Kicinski commit 029c1c2059e9c4b38f97a06204cdecd10cfbeb8a Author: Jon Hunter Date: Wed Jul 6 09:39:13 2022 +0100 net: stmmac: dwc-qos: Disable split header for Tegra194 There is a long-standing issue with the Synopsys DWC Ethernet driver for Tegra194 where random system crashes have been observed [0]. The problem occurs when the split header feature is enabled in the stmmac driver. In the bad case, a larger than expected buffer length is received and causes the calculation of the total buffer length to overflow. This results in a very large buffer length that causes the kernel to crash. Why this larger buffer length is received is not clear, however, the feedback from the NVIDIA design team is that the split header feature is not supported for Tegra194. Therefore, disable split header support for Tegra194 to prevent these random crashes from occurring. [0] https://lore.kernel.org/linux-tegra/b0b17697-f23e-8fa5-3757-604a86f3a095@nvidia.com/ Fixes: 67afd6d1cfdf ("net: stmmac: Add Split Header support and enable it in XGMAC cores") Signed-off-by: Jon Hunter Link: https://lore.kernel.org/r/20220706083913.13750-1-jonathanh@nvidia.com Signed-off-by: Jakub Kicinski commit 6b0de7d0f3285df849be2b3cc94fc3a0a31987bf Merge: f3163d8567adb 5c629dc9609dc Author: Jens Axboe Date: Thu Jul 7 17:38:19 2022 -0600 Merge tag 'nvme-5.19-2022-07-07' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - another bogus identifier quirk (Keith Busch) - use struct group in the tracer to avoid a gcc warning (Keith Busch)" * tag 'nvme-5.19-2022-07-07' of git://git.infradead.org/nvme: nvme: use struct group for generic command dwords nvme-pci: phison e16 has bogus namespace ids commit bdb2c48e4b38e6dbe82533b437468999ba3ae498 Author: Pavel Begunkov Date: Thu Jul 7 15:00:38 2022 +0100 io_uring: explicit sqe padding for ioctl commands 32 bit sqe->cmd_op is an union with 64 bit values. It's always a good idea to do padding explicitly. Also zero check it in prep, so it can be used in the future if needed without compatibility concerns. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e6b95a05e970af79000435166185e85b196b2ba2.1657202417.git.asml.silence@gmail.com [axboe: turn bitwise OR into logical variant] Signed-off-by: Jens Axboe commit 3501f0c663063513ad604fb1b3f06af637d3396d Author: Satish Nagireddy Date: Tue Jun 28 12:12:16 2022 -0700 i2c: cadence: Unregister the clk notifier in error path This patch ensures that the clock notifier is unregistered when driver probe is returning error. Fixes: df8eb5691c48 ("i2c: Add driver for Cadence I2C controller") Signed-off-by: Satish Nagireddy Tested-by: Lars-Peter Clausen Reviewed-by: Michal Simek Signed-off-by: Wolfram Sang commit ccd3f449052449a917a3e577d8ba0368f43b8f29 Author: Mike Christie Date: Mon Jun 27 21:23:25 2022 -0500 scsi: target: Fix WRITE_SAME No Data Buffer crash In newer version of the SBC specs, we have a NDOB bit that indicates there is no data buffer that gets written out. If this bit is set using commands like "sg_write_same --ndob" we will crash in target_core_iblock/file's execute_write_same handlers when we go to access the se_cmd->t_data_sg because its NULL. This patch adds a check for the NDOB bit in the common WRITE SAME code because we don't support it. And, it adds a check for zero SG elements in each handler in case the initiator tries to send a normal WRITE SAME with no data buffer. Link: https://lore.kernel.org/r/20220628022325.14627-2-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit ba7c3507087aaf98bbeab04a62251bf63c6348c1 Merge: 88084a3df1672 c8934e4e34891 Author: Rafael J. Wysocki Date: Thu Jul 7 21:46:05 2022 +0200 Merge tag 'devfreq-fixes-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull a devfreq fix for 5.19-rc6 from Chanwoo Choi: "- Fix exynos-bus NULL pointer dereference by correctly using the local generated freq_table to output the debug values instead of using the profile freq_table that is not used in the driver." * tag 'devfreq-fixes-for-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: exynos-bus: Fix NULL pointer dereference commit c8934e4e348915caac54085c01fd9d04fa16134a Author: Christian Marangi Date: Fri Jul 1 15:31:26 2022 +0200 PM / devfreq: exynos-bus: Fix NULL pointer dereference Fix exynos-bus NULL pointer dereference by correctly using the local generated freq_table to output the debug values instead of using the profile freq_table that is not used in the driver. Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Fixes: b5d281f6c16d ("PM / devfreq: Rework freq_table to be local to devfreq struct") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit 0ed8f619b412b52360ccdfaf997223ccd9319569 Author: Florian Westphal Date: Wed Jul 6 16:50:04 2022 +0200 netfilter: conntrack: fix crash due to confirmed bit load reordering Kajetan Puchalski reports crash on ARM, with backtrace of: __nf_ct_delete_from_lists nf_ct_delete early_drop __nf_conntrack_alloc Unlike atomic_inc_not_zero, refcount_inc_not_zero is not a full barrier. conntrack uses SLAB_TYPESAFE_BY_RCU, i.e. it is possible that a 'newly' allocated object is still in use on another CPU: CPU1 CPU2 encounter 'ct' during hlist walk delete_from_lists refcount drops to 0 kmem_cache_free(ct); __nf_conntrack_alloc() // returns same object refcount_inc_not_zero(ct); /* might fail */ /* If set, ct is public/in the hash table */ test_bit(IPS_CONFIRMED_BIT, &ct->status); In case CPU1 already set refcount back to 1, refcount_inc_not_zero() will succeed. The expected possibilities for a CPU that obtained the object 'ct' (but no reference so far) are: 1. refcount_inc_not_zero() fails. CPU2 ignores the object and moves to the next entry in the list. This happens for objects that are about to be free'd, that have been free'd, or that have been reallocated by __nf_conntrack_alloc(), but where the refcount has not been increased back to 1 yet. 2. refcount_inc_not_zero() succeeds. CPU2 checks the CONFIRMED bit in ct->status. If set, the object is public/in the table. If not, the object must be skipped; CPU2 calls nf_ct_put() to un-do the refcount increment and moves to the next object. Parallel deletion from the hlists is prevented by a 'test_and_set_bit(IPS_DYING_BIT, &ct->status);' check, i.e. only one cpu will do the unlink, the other one will only drop its reference count. Because refcount_inc_not_zero is not a full barrier, CPU2 may try to delete an object that is not on any list: 1. refcount_inc_not_zero() successful (refcount inited to 1 on other CPU) 2. CONFIRMED test also successful (load was reordered or zeroing of ct->status not yet visible) 3. delete_from_lists unlinks entry not on the hlist, because IPS_DYING_BIT is 0 (already cleared). 2) is already wrong: CPU2 will handle a partially initited object that is supposed to be private to CPU1. Add needed barriers when refcount_inc_not_zero() is successful. It also inserts a smp_wmb() before the refcount is set to 1 during allocation. Because other CPU might still see the object, refcount_set(1) "resurrects" it, so we need to make sure that other CPUs will also observe the right content. In particular, the CONFIRMED bit test must only pass once the object is fully initialised and either in the hash or about to be inserted (with locks held to delay possible unlink from early_drop or gc worker). I did not change flow_offload_alloc(), as far as I can see it should call refcount_inc(), not refcount_inc_not_zero(): the ct object is attached to the skb so its refcount should be >= 1 in all cases. v2: prefer smp_acquire__after_ctrl_dep to smp_rmb (Will Deacon). v3: keep smp_acquire__after_ctrl_dep close to refcount_inc_not_zero call add comment in nf_conntrack_netlink, no control dependency there due to locks. Cc: Peter Zijlstra Link: https://lore.kernel.org/all/Yr7WTfd6AVTQkLjI@e126311.manchester.arm.com/ Reported-by: Kajetan Puchalski Diagnosed-by: Will Deacon Fixes: 719774377622 ("netfilter: conntrack: convert to refcount_t api") Signed-off-by: Florian Westphal Acked-by: Will Deacon commit 0326195f523a549e0a9d7fd44c70b26fd7265090 Author: Eric Dumazet Date: Thu Jul 7 12:39:00 2022 +0000 bpf: Make sure mac_header was set before using it Classic BPF has a way to load bytes starting from the mac header. Some skbs do not have a mac header, and skb_mac_header() in this case is returning a pointer that 65535 bytes after skb->head. Existing range check in bpf_internal_load_pointer_neg_helper() was properly kicking and no illegal access was happening. New sanity check in skb_mac_header() is firing, so we need to avoid it. WARNING: CPU: 1 PID: 28990 at include/linux/skbuff.h:2785 skb_mac_header include/linux/skbuff.h:2785 [inline] WARNING: CPU: 1 PID: 28990 at include/linux/skbuff.h:2785 bpf_internal_load_pointer_neg_helper+0x1b1/0x1c0 kernel/bpf/core.c:74 Modules linked in: CPU: 1 PID: 28990 Comm: syz-executor.0 Not tainted 5.19.0-rc4-syzkaller-00865-g4874fb9484be #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 RIP: 0010:skb_mac_header include/linux/skbuff.h:2785 [inline] RIP: 0010:bpf_internal_load_pointer_neg_helper+0x1b1/0x1c0 kernel/bpf/core.c:74 Code: ff ff 45 31 f6 e9 5a ff ff ff e8 aa 27 40 00 e9 3b ff ff ff e8 90 27 40 00 e9 df fe ff ff e8 86 27 40 00 eb 9e e8 2f 2c f3 ff <0f> 0b eb b1 e8 96 27 40 00 e9 79 fe ff ff 90 41 57 41 56 41 55 41 RSP: 0018:ffffc9000309f668 EFLAGS: 00010216 RAX: 0000000000000118 RBX: ffffffffffeff00c RCX: ffffc9000e417000 RDX: 0000000000040000 RSI: ffffffff81873f21 RDI: 0000000000000003 RBP: ffff8880842878c0 R08: 0000000000000003 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000001 R12: 0000000000000004 R13: ffff88803ac56c00 R14: 000000000000ffff R15: dffffc0000000000 FS: 00007f5c88a16700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fdaa9f6c058 CR3: 000000003a82c000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ____bpf_skb_load_helper_32 net/core/filter.c:276 [inline] bpf_skb_load_helper_32+0x191/0x220 net/core/filter.c:264 Fixes: f9aefd6b2aa3 ("net: warn if mac header was not set") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220707123900.945305-1-edumazet@google.com commit e8a4e1c1bb697b1d9fc48f0e56dc0f50bc024bee Merge: ef4ab3ba4e4f9 f0fbe652e8529 Author: Linus Torvalds Date: Thu Jul 7 10:41:27 2022 -0700 Merge tag 'loongarch-fixes-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "A fix for tinyconfig build error, a fix for section mismatch warning, and two cleanups of obsolete code" * tag 'loongarch-fixes-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Fix section mismatch warning LoongArch: Fix build errors for tinyconfig LoongArch: Remove obsolete mentions of vcsr LoongArch: Drop these obsolete selects in Kconfig commit ef4ab3ba4e4f99b1f3af3a7b74815f59394d822e Merge: 651a8536572ae 07266d066301b Author: Linus Torvalds Date: Thu Jul 7 10:08:20 2022 -0700 Merge tag 'net-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf, netfilter, can, and bluetooth. Current release - regressions: - bluetooth: fix deadlock on hci_power_on_sync Previous releases - regressions: - sched: act_police: allow 'continue' action offload - eth: usbnet: fix memory leak in error case - eth: ibmvnic: properly dispose of all skbs during a failover Previous releases - always broken: - bpf: - fix insufficient bounds propagation from adjust_scalar_min_max_vals - clear page contiguity bit when unmapping pool - netfilter: nft_set_pipapo: release elements in clone from abort path - mptcp: netlink: issue MP_PRIO signals from userspace PMs - can: - rcar_canfd: fix data transmission failed on R-Car V3U - gs_usb: gs_usb_open/close(): fix memory leak Misc: - add Wenjia as SMC maintainer" * tag 'net-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits) wireguard: Kconfig: select CRYPTO_CHACHA_S390 crypto: s390 - do not depend on CRYPTO_HW for SIMD implementations wireguard: selftests: use microvm on x86 wireguard: selftests: always call kernel makefile wireguard: selftests: use virt machine on m68k wireguard: selftests: set fake real time in init r8169: fix accessing unset transport header net: rose: fix UAF bug caused by rose_t0timer_expiry usbnet: fix memory leak in error case Revert "tls: rx: move counting TlsDecryptErrors for sync" mptcp: update MIB_RMSUBFLOW in cmd_sf_destroy mptcp: fix local endpoint accounting selftests: mptcp: userspace PM support for MP_PRIO signals mptcp: netlink: issue MP_PRIO signals from userspace PMs mptcp: Acquire the subflow socket lock before modifying MP_PRIO flags mptcp: Avoid acquiring PM lock for subflow priority changes mptcp: fix locking in mptcp_nl_cmd_sf_destroy() net/mlx5e: Fix matchall police parameters validation net/sched: act_police: allow 'continue' action offload net: lan966x: hardcode the number of external ports ... commit 651a8536572ae0dcce608b3e6720ae844155a787 Merge: a382f8fee42ca a1d4ef1adf8bb Author: Linus Torvalds Date: Thu Jul 7 10:02:38 2022 -0700 Merge tag 'pinctrl-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Tag Intel pin control as supported in MAINTAINERS - Fix a NULL pointer exception in the Aspeed driver - Correct some NAND functions in the Sunxi A83T driver - Use the right offset for some Sunxi pins - Fix a zero base offset in the Freescale (NXP) i.MX93 - Fix the IRQ support in the STM32 driver * tag 'pinctrl-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: stm32: fix optional IRQ support to gpios pinctrl: imx: Add the zero base flag for imx93 pinctrl: sunxi: sunxi_pconf_set: use correct offset pinctrl: sunxi: a83t: Fix NAND function name for some pins pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() MAINTAINERS: Update Intel pin control to Supported commit a382f8fee42ca10c9bfce0d2352d4153f931f5dc Author: Linus Torvalds Date: Wed Jul 6 12:20:59 2022 -0700 signal handling: don't use BUG_ON() for debugging These are indeed "should not happen" situations, but it turns out recent changes made the 'task_is_stopped_or_trace()' case trigger (fix for that exists, is pending more testing), and the BUG_ON() makes it unnecessarily hard to actually debug for no good reason. It's been that way for a long time, but let's make it clear: BUG_ON() is not good for debugging, and should never be used in situations where you could just say "this shouldn't happen, but we can continue". Use WARN_ON_ONCE() instead to make sure it gets logged, and then just continue running. Instead of making the system basically unusuable because you crashed the machine while potentially holding some very core locks (eg this function is commonly called while holding 'tasklist_lock' for writing). Signed-off-by: Linus Torvalds commit fc976f5629afb4160ee77798b14a693eac903ffd Author: Peter Ujfalusi Date: Thu Jun 30 09:56:38 2022 +0300 ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array The struct nhlt_format's fmt_config is a flexible array, it must not be used as normal array. When moving to the next nhlt_fmt_cfg we need to take into account the data behind the ->config.caps (indicated by ->config.size). The logic of the code also changed: it is no longer saves the _last_ fmt_cfg for all found rates. Fixes: bc2bd45b1f7f3 ("ASoC: Intel: Skylake: Parse nhlt and register clock device") Signed-off-by: Peter Ujfalusi Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220630065638.11183-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 219af251bd1694bce1f627d238347d2eaf13de61 Author: Peter Ujfalusi Date: Thu Jun 30 09:56:37 2022 +0300 ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks() The present flag is only set once when one rate has been found to be saved. This will effectively going to ignore any rate discovered at later time and based on the code, this is not the intention. Fixes: bc2bd45b1f7f3 ("ASoC: Intel: Skylake: Parse nhlt and register clock device") Signed-off-by: Peter Ujfalusi Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220630065638.11183-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 051dade346957d5b68ad986f497835805fa7a9dd Author: Oder Chiou Date: Tue Jul 5 18:11:33 2022 +0800 ASoC: rt5640: Fix the wrong state of JD1 and JD2 The patch fixes the wrong state of JD1 and JD2 while the bst1 or bst2 is power on in the HDA JD using. Signed-off-by: Oder Chiou Reported-by: Sameer Pujar Link: https://lore.kernel.org/r/20220705101134.16792-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit c7dab6745f4288af1e45d3809bf86a3778301616 Author: Brent Lu Date: Fri Jul 1 22:15:17 2022 +0800 ASoC: Intel: sof_rt5682: fix out-of-bounds array access Starting from ADL platform we have four HDMI PCM devices which exceeds the size of sof_hdmi array. Since each sof_hdmi_pcm structure represents one HDMI PCM device, we remove the sof_hdmi array and add a new member hdmi_jack to the sof_hdmi_pcm structure to fix the out-of-bounds problem. Signed-off-by: Brent Lu Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220701141517.264070-1-brent.lu@intel.com Signed-off-by: Mark Brown commit df5b4aca7248dc5a5cae93f162eae0decf972e48 Author: Jianglei Nie Date: Thu Jun 30 02:25:20 2022 +0800 ASoC: qdsp6: fix potential memory leak in q6apm_get_audioreach_graph() q6apm_get_audioreach_graph() allocates a memory chunk for graph->graph with audioreach_alloc_graph_pkt(). When idr_alloc() fails, graph->graph is not released, which will lead to a memory leak. We can release the graph->graph with kfree() when idr_alloc() fails to fix the memory leak. Signed-off-by: Jianglei Nie Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220629182520.2164409-1-niejianglei2021@163.com Signed-off-by: Mark Brown commit 1c4f29ec878bbf1cc0a1eb54ae7da5ff98e19641 Author: Hector Martin Date: Thu Jun 30 09:51:35 2022 +0200 ASoC: tas2764: Fix amp gain register offset & default The register default is 0x28 per the datasheet, and the amp gain field is supposed to be shifted left by one. With the wrong default, the ALSA controls lie about the power-up state. With the wrong shift, we get only half the gain we expect. Signed-off-by: Hector Martin Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220630075135.2221-4-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 3e99e5697e1f7120b5abc755e8a560b22612d6ed Author: Hector Martin Date: Thu Jun 30 09:51:34 2022 +0200 ASoC: tas2764: Correct playback volume range DVC value 0xc8 is -100dB and 0xc9 is mute; this needs to map to -100.5dB as far as the dB scale is concerned. Fix that and enable the mute flag, so alsamixer correctly shows the control as <0 dB .. -100 dB, mute>. Signed-off-by: Hector Martin Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220630075135.2221-3-povik+lin@cutebit.org Signed-off-by: Mark Brown commit d1a10f1b48202e2d183cce144c218a211e98d906 Author: Martin Povišer Date: Thu Jun 30 09:51:33 2022 +0200 ASoC: tas2764: Fix and extend FSYNC polarity handling Fix setting of FSYNC polarity in case of LEFT_J and DSP_A/B formats. Do NOT set the SCFG field as was previously done, because that is not correct and is also in conflict with the "ASI1 Source" control which sets the same SCFG field! Also add support for explicit polarity inversion. Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220630075135.2221-2-povik+lin@cutebit.org Signed-off-by: Mark Brown commit cd10bb89b0d57bca98eb75e0444854a1c129a14e Author: Martin Povišer Date: Thu Jun 30 09:51:32 2022 +0200 ASoC: tas2764: Add post reset delays Make sure there is at least 1 ms delay from reset to first command as is specified in the datasheet. This is a fix similar to commit 307f31452078 ("ASoC: tas2770: Insert post reset delay"). Fixes: 827ed8a0fa50 ("ASoC: tas2764: Add the driver for the TAS2764") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220630075135.2221-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 94c65dffd4c4af052b3ea8934fbcb2fa8da276a8 Author: Bryan O'Donoghue Date: Wed Jun 29 12:40:12 2022 +0100 ASoC: dt-bindings: Fix description for msm8916 For the existing msm8916 bindings the minimum reg/reg-names is 1 not 2. Similarly the minimum interrupt/interrupt-names is 1 not 2. Fixes: f3fc4fbfa2d2 ("ASoC: dt-bindings: Add SC7280 lpass cpu bindings") Signed-off-by: Bryan O'Donoghue Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220629114012.3282945-1-bryan.odonoghue@linaro.org Signed-off-by: Mark Brown commit 0735e400fa07a3687797f241f5b74d77a6d383c7 Author: Marek Vasut Date: Tue Jun 28 18:58:40 2022 +0200 ASoC: doc: Capitalize RESET line name Make sure all AC97 interface lines are spelled in capitals, to avoid confusing readers about where the 5th line is. Signed-off-by: Marek Vasut Cc: Mark Brown Cc: Takashi Iwai Link: https://lore.kernel.org/r/20220628165840.152235-1-marex@denx.de Signed-off-by: Mark Brown commit f99e930655f411453170a5f332e12c2d2748822e Author: Charles Keepax Date: Tue Jun 28 16:34:09 2022 +0100 ASoC: arizona: Update arizona_aif_cfg_changed to use RX_BCLK_RATE Currently the function arizona_aif_cfg_changed uses the TX_BCLK_RATE, however this register is not used on wm8998. This was not noticed as previously snd_soc_component_read did not print an error message. However, now the log gets filled with error messages, further more the test for if the LRCLK changed will return spurious results. Update the code to use the RX_BCLK_RATE register, the LRCLK parameters are written to both registers and the RX_BCLK_RATE register is used across all Arizona devices. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220628153409.3266932-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 870d72ab9228575b2f005c9a23ea08787e0f63e6 Author: Charles Keepax Date: Tue Jun 28 16:34:08 2022 +0100 ASoC: cs47l92: Fix event generation for OUT1 demux cs47l92_put_demux returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220628153409.3266932-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 15b2e5d10ccf32a1a1ae7c636511e2f51320fdb5 Author: Charles Keepax Date: Tue Jun 28 16:34:07 2022 +0100 ASoC: wm8998: Fix event generation for input mux wm8998_inmux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220628153409.3266932-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 71b5ab96ffe6589abe7a2e302b83f7a426ebe099 Author: Charles Keepax Date: Tue Jun 28 16:34:06 2022 +0100 ASoC: wm5102: Fix event generation for output compensation The output compensation controls always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220628153409.3266932-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a5d6d28e2ea38dff017cb562dfbe0259d093a851 Author: Yassine Oudjana Date: Wed Jun 22 10:17:45 2022 +0400 ASoC: wcd9335: Use int array instead of bitmask for TX mixers Currently slim_tx_mixer_get reports all TX mixers as enabled when at least one is, due to it reading the entire tx_port_value bitmask without testing the specific bit corresponding to a TX port. Furthermore, using the same bitmask for all capture DAIs makes setting one mixer affect them all. To prevent this, and since the SLIM TX muxes effectively only connect to one of the mixers at a time, turn tx_port_value into an int array storing the DAI index each of the ports is connected to. Signed-off-by: Yassine Oudjana Link: https://lore.kernel.org/r/20220622061745.35399-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown commit 7d90c8e6396ba245da16bedd789df6d669375408 Author: Sascha Hauer Date: Fri Jun 24 12:57:16 2022 +0200 ASoC: tlv320adcx140: Fix tx_mask check The tx_mask check doesn't reflect what the driver and the chip support. The check currently checks for exactly two slots being enabled. The tlv320adcx140 supports anything between one and eight channels, so relax the check accordingly. The tlv320adcx140 supports arbitrary tx_mask settings, but the driver currently only supports adjacent slots beginning with the first slot, so extend the check to check that the first slot is being used and that there are no holes in the tx_mask. Leave a comment to make it's the driver that limits the tx_mask settings, not the chip itself. While at it remove the set-but-unused struct adcx140p_priv::tdm_delay field. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220624105716.2579539-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 9e51ac6ea6041641f64fb761ccf9de271e6576cb Author: Daniel Mack Date: Fri Jun 24 12:47:10 2022 +0200 ASoC: max98396: Fix register access for PCM format settings max98396_dai_set_fmt() modifes register 2041 and touches bits in the mask 0x3a. Make sure to use the right mask for that operation. Signed-off-by: Daniel Mack Link: https://lore.kernel.org/r/20220624104712.1934484-7-daniel@zonque.org Signed-off-by: Mark Brown commit f0d96937d31c4615a6418e4bed5cee50a952040e Author: David Owens Date: Mon Jun 20 13:37:43 2022 -0500 ASoC: ti: omap-mcbsp: duplicate sysfs error Convert to managed versions of sysfs and clk allocation to simplify unbinding and error handling in probe. Managed sysfs node creation specifically addresses the following error seen the second time probe is attempted after sdma_pcm_platform_register() previously requsted probe deferral: sysfs: cannot create duplicate filename '/devices/platform/68000000.ocp/49022000.mcbsp/max_tx_thres' Signed-off-by: David Owens Link: https://lore.kernel.org/r/20220620183744.3176557-1-dowens@precisionplanting.com Signed-off-by: Mark Brown commit 242a88ff27b23cbf626f9764955d91200f12b53a Author: Sascha Hauer Date: Fri Jun 24 11:26:01 2022 +0200 ASoC: audio_graph_card2: Fix port numbers in example The example in audio-graph-card2.c has multiple nodes with the same name in it. Change the port numbers to get different names. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220624092601.2445224-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 040e3360af3736348112d29425bf5d0be5b93115 Author: Francesco Dolcini Date: Fri Jun 24 12:13:01 2022 +0200 ASoC: sgtl5000: Fix noise on shutdown/remove Put the SGTL5000 in a silent/safe state on shutdown/remove, this is required since the SGTL5000 produces a constant noise on its output after it is configured and its clock is removed. Without this change this is happening every time the module is unbound/removed or from reboot till the clock is enabled again. The issue was experienced on both a Toradex Colibri/Apalis iMX6, but can be easily reproduced everywhere just playing something on the codec and after that removing/unbinding the driver. Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support") Signed-off-by: Francesco Dolcini Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220624101301.441314-1-francesco.dolcini@toradex.com Signed-off-by: Mark Brown commit d2ee2cfc4aa85ff6a2a3b198a3a524ec54e3d999 Author: Huaxin Lu Date: Tue Jul 5 13:14:17 2022 +0800 ima: Fix a potential integer overflow in ima_appraise_measurement When the ima-modsig is enabled, the rc passed to evm_verifyxattr() may be negative, which may cause the integer overflow problem. Fixes: 39b07096364a ("ima: Implement support for module-style appended signatures") Signed-off-by: Huaxin Lu Signed-off-by: Mimi Zohar commit fa293fb960ab8350c92e2327a08fc141f228b044 Author: Lukas Bulwahn Date: Thu Jul 7 13:26:45 2022 +0200 MAINTAINERS: mark ARM/PALM TREO SUPPORT orphan The email address sleep_walker@suse.com and the url http://hackndev.com/, provided in the ARM/PALM TREO SUPPORT section, are not reachable anymore. Make this machine support orphan, and give somebody the chance to step up. Move the maintainer into CREDITS to keep the attribution to his work. Signed-off-by: Lukas Bulwahn Signed-off-by: Arnd Bergmann commit 2c08b9b38f5b0f4a6c2d29be22b695e4ec4a556b Author: Peter Zijlstra Date: Wed Jul 6 15:33:30 2022 +0200 x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry Commit ee774dac0da1 ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()") moved PUSH_AND_CLEAR_REGS out of error_entry, into its own function, in part to avoid calling error_entry() for XenPV. However, commit 7c81c0c9210c ("x86/entry: Avoid very early RET") had to change that because the 'ret' was too early and moved it into idtentry, bloating the text size, since idtentry is expanded for every exception vector. However, with the advent of xen_error_entry() in commit d147553b64bad ("x86/xen: Add UNTRAIN_RET") it became possible to remove PUSH_AND_CLEAR_REGS from idtentry, back into *error_entry(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 38e0e4d04d4187c63d6b511396faae7db6a3cd9e Author: Peter Zijlstra Date: Tue Jun 28 12:57:42 2022 +0200 x86/ibt, objtool: Don't discard text references from tracepoint section On Tue, Jun 28, 2022 at 04:28:58PM +0800, Pengfei Xu wrote: > # ./ftracetest > === Ftrace unit tests === > [1] Basic trace file check [PASS] > [2] Basic test for tracers [PASS] > [3] Basic trace clock test [PASS] > [4] Basic event tracing check [PASS] > [5] Change the ringbuffer size [PASS] > [6] Snapshot and tracing setting [PASS] > [7] trace_pipe and trace_marker [PASS] > [8] Test ftrace direct functions against tracers [UNRESOLVED] > [9] Test ftrace direct functions against kprobes [UNRESOLVED] > [10] Generic dynamic event - add/remove eprobe events [FAIL] > [11] Generic dynamic event - add/remove kprobe events > > It 100% reproduced in step 11 and then missing ENDBR BUG generated: > " > [ 9332.752836] mmiotrace: enabled CPU7. > [ 9332.788612] mmiotrace: disabled. > [ 9337.103426] traps: Missing ENDBR: syscall_regfunc+0x0/0xb0 It turns out that while syscall_regfunc() does have an ENDBR when generated, it gets sealed by objtool's .ibt_endbr_seal list. Since the only text references to this function: $ git grep syscall_regfunc include/linux/tracepoint.h:extern int syscall_regfunc(void); include/trace/events/syscalls.h: syscall_regfunc, syscall_unregfunc include/trace/events/syscalls.h: syscall_regfunc, syscall_unregfunc kernel/tracepoint.c:int syscall_regfunc(void) appear in the __tracepoint section which is excluded by objtool. Fixes: 3c6f9f77e618 ("objtool: Rework ibt and extricate from stack validation") Reported-by: Pengfei Xu Link: https://lkml.kernel.org/r/Yrrepdaow4F5kqG0@hirez.programming.kicks-ass.net commit f54d45372c6ac9c993451de5e51312485f7d10bc Author: Pawan Gupta Date: Wed Jul 6 15:01:15 2022 -0700 x86/bugs: Add Cannon lake to RETBleed affected CPU list Cannon lake is also affected by RETBleed, add it to the list. Fixes: 6ad0ad2bf8a6 ("x86/bugs: Report Intel retbleed vulnerability") Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit c8e27a4a5136e7230f9e4ffcf132705bf56864cc Author: Kent Gibson Date: Wed Jul 6 16:45:07 2022 +0800 gpiolib: cdev: fix null pointer dereference in linereq_free() Fix a kernel NULL pointer dereference reported by gpio kselftests. linereq_free() can be called as part of the cleanup of a failed request, at which time the desc for a line may not have been determined, so it is unsafe to dereference without a check. Add a check prior to dereferencing the line desc. Fixes: 2068339a6c35 ("gpiolib: cdev: Add hardware timestamp clock type") Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski commit f0fbe652e8529a180630617a17cd5922298c4f13 Author: Tiezhu Yang Date: Mon Jun 27 14:57:35 2022 +0800 LoongArch: Fix section mismatch warning init_numa_memory() is annotated __init and not used by any module, thus don't export it. Remove not needed EXPORT_SYMBOL for init_numa_memory() to fix the following section mismatch warning: MODPOST vmlinux.symvers WARNING: modpost: vmlinux.o(___ksymtab+init_numa_memory+0x0): Section mismatch in reference from the variable __ksymtab_init_numa_memory to the function .init.text:init_numa_memory() The symbol init_numa_memory is exported and annotated __init Fix this by removing the __init annotation of init_numa_memory or drop the export. This is build on Linux 5.19-rc4. Fixes: d4b6f1562a3c ("LoongArch: Add Non-Uniform Memory Access (NUMA) support") Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit e6ee90233eb155991e469d2047855fc466b831b6 Author: Huacai Chen Date: Wed Jul 6 11:03:09 2022 +0800 LoongArch: Fix build errors for tinyconfig Building loongarch:tinyconfig fails with the following error. ./arch/loongarch/include/asm/page.h: In function 'pfn_valid': ./arch/loongarch/include/asm/page.h:42:32: error: 'PHYS_OFFSET' undeclared Add the missing include file and fix succeeding vdso errors. Fixes: 09cfefb7fa70 ("LoongArch: Add memory management") Signed-off-by: Guenter Roeck Signed-off-by: Huacai Chen commit 112380996ac22e428264cd7186722e784db887e4 Author: Qi Hu Date: Wed Jul 6 19:29:37 2022 +0800 LoongArch: Remove obsolete mentions of vcsr The `vcsr` only exists in the old hardware design, it isn't used in any shipped hardware from Loongson-3A5000 on. Both scalar FP and LSX/LASX instructions use the `fcsr` as their control and status registers now. For example, the RM control bit in fcsr0 is shared by FP, LSX and LASX instructions. Particularly, fcsr16 to fcsr31 are reserved for LSX/LASX now, access to these registers has no visible effect if LSX/LASX is enabled, and will cause SXD/ASXD exceptions if LSX/LASX is not enabled. So, mentions of vcsr are obsolete in the first place (it was just used for debugging), let's remove them. Reviewed-by: WANG Xuerui Signed-off-by: Qi Hu Signed-off-by: Huacai Chen commit 7fd6ef61a5d610b4f74c0ac59450237b40130319 Author: Lukas Bulwahn Date: Tue Jul 5 09:34:05 2022 +0200 LoongArch: Drop these obsolete selects in Kconfig Commit fa96b57c1490 ("LoongArch: Add build infrastructure") adds the new file arch/loongarch/Kconfig. As the work on LoongArch was probably quite some time under development, various config symbols have changed and disappeared from the time of initial writing of the Kconfig file and its inclusion in the repository. The following four commits: commit c126a53c2760 ("arch: remove GENERIC_FIND_FIRST_BIT entirely") commit 140c8180eb7c ("arch: remove HAVE_COPY_THREAD_TLS") commit aca52c398389 ("mm: remove CONFIG_HAVE_MEMBLOCK") commit 3f08a302f533 ("mm: remove CONFIG_HAVE_MEMBLOCK_NODE_MAP option") remove the mentioned config symbol, and enable the intended setup by default without configuration. Drop these obsolete selects in loongarch's Kconfig. Reviewed-by: WANG Xuerui Signed-off-by: Lukas Bulwahn Signed-off-by: Huacai Chen commit 53a6e66b1b4fea4b52f8bc62e5f9530af9061027 Author: Helge Deller Date: Sat Jun 25 13:00:34 2022 +0200 fbcon: Use fbcon_info_from_console() in fbcon_modechange_possible() Use the fbcon_info_from_console() wrapper which was added to kernel v5.19 with commit 409d6c95f9c6 ("fbcon: Introduce wrapper for console->fb_info lookup"). Signed-off-by: Helge Deller Reviewed-by: Geert Uytterhoeven commit 6c11df58fd1ac0aefcb3b227f72769272b939e56 Author: Helge Deller Date: Wed Jun 29 15:53:55 2022 +0200 fbmem: Check virtual screen sizes in fb_set_var() Verify that the fbdev or drm driver correctly adjusted the virtual screen sizes. On failure report the failing driver and reject the screen size change. Signed-off-by: Helge Deller Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v5.4+ commit b68277f19e31a25312c4acccadb5cf1502e52e84 Author: Ezequiel Garcia Date: Wed Jul 6 15:41:33 2022 -0300 drm/ssd130x: Fix pre-charge period setting Fix small typo which causes the mask for the 'precharge1' setting to be used with the 'precharge2' value. Signed-off-by: Ezequiel Garcia Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220706184133.210888-1-ezequiel@vanguardiasur.com.ar commit e64242caef18b4a5840b0e7a9bff37abd4f4f933 Author: Helge Deller Date: Sat Jun 25 13:00:34 2022 +0200 fbcon: Prevent that screen size is smaller than font size We need to prevent that users configure a screen size which is smaller than the currently selected font size. Otherwise rendering chars on the screen will access memory outside the graphics memory region. This patch adds a new function fbcon_modechange_possible() which implements this check and which later may be extended with other checks if necessary. The new function is called from the FBIOPUT_VSCREENINFO ioctl handler in fbmem.c, which will return -EINVAL if userspace asked for a too small screen size. Signed-off-by: Helge Deller Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v5.4+ commit 65a01e601dbba8b7a51a2677811f70f783766682 Author: Helge Deller Date: Sat Jun 25 12:56:49 2022 +0200 fbcon: Disallow setting font bigger than screen size Prevent that users set a font size which is bigger than the physical screen. It's unlikely this may happen (because screens are usually much larger than the fonts and each font char is limited to 32x32 pixels), but it may happen on smaller screens/LCD displays. Signed-off-by: Helge Deller Reviewed-by: Daniel Vetter Reviewed-by: Geert Uytterhoeven Cc: stable@vger.kernel.org # v4.14+ commit 7c1aeba7bb977fe327fbc9682e9ccb36134cbf77 Author: xinhui pan Date: Thu Jul 7 16:02:41 2022 +0800 dma-buf: Fix one use-after-free of fence Need get the new fence when we replace the old one. Fixes: 047a1b877ed48 ("dma-buf & drm/amdgpu: remove dma_resv workaround") Signed-off-by: xinhui pan Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220707080241.20060-1-xinhui.pan@amd.com Signed-off-by: Christian König commit 12058077b2e963d16d2d673d46233a7f46add7c9 Author: Thomas Hellström Date: Mon Jun 20 14:36:59 2022 +0200 drm/i915: Fix vm use-after-free in vma destruction In vma destruction, the following race may occur: Thread 1: Thread 2: i915_vma_destroy(); ... list_del_init(vma->vm_link); ... mutex_unlock(vma->vm->mutex); __i915_vm_release(); release_references(); And in release_reference() we dereference vma->vm to get to the vm gt pointer, leading to a use-after free. However, __i915_vm_release() grabs the vm->mutex so the vm won't be destroyed before vma->vm->mutex is released, so extract the gt pointer under the vm->mutex to avoid the vma->vm dereference in release_references(). v2: Fix a typo in the commit message (Andi Shyti) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5944 Fixes: e1a7ab4fca0c ("drm/i915: Remove the vm open count") Cc: Niranjana Vishwanathapura Cc: Matthew Auld Signed-off-by: Thomas Hellström Acked-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220620123659.381772-1-thomas.hellstrom@linux.intel.com (cherry picked from commit 1926a6b75954fc1a8b44d10bd0c67db957b78cf7) Signed-off-by: Rodrigo Vivi commit 25c95bf494067f7bd1dfa8064ef964abe88cafc2 Author: Daniele Ceraolo Spurio Date: Tue Jun 21 16:30:05 2022 -0700 drm/i915/guc: ADL-N should use the same GuC FW as ADL-S The only difference between the ADL S and P GuC FWs is the HWConfig support. ADL-N does not support HWConfig, so we should use the same binary as ADL-S, otherwise the GuC might attempt to fetch a config table that does not exist. ADL-N is internally identified as an ADL-P, so we need to special-case it in the FW selection code. Fixes: 7e28d0b26759 ("drm/i915/adl-n: Enable ADL-N platform") Cc: John Harrison Cc: Tejas Upadhyay Cc: Anusha Srivatsa Cc: Jani Nikula Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220621233005.3952293-1-daniele.ceraolospurio@intel.com (cherry picked from commit 971e4a9781742aaad1587e25fd5582b2dd595ef8) Signed-off-by: Rodrigo Vivi commit 85144df9ff4652816448369de76897c57cbb1b93 Author: Hangyu Hua Date: Fri Jun 24 06:04:06 2022 -0700 drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector() If drm_connector_init fails, intel_connector_free will be called to take care of proper free. So it is necessary to drop the refcount of port before intel_connector_free. Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector") Signed-off-by: Hangyu Hua Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220624130406.17996-1-jose.souza@intel.com Signed-off-by: José Roberto de Souza (cherry picked from commit cea9ed611e85d36a05db52b6457bf584b7d969e2) Signed-off-by: Rodrigo Vivi commit 07266d066301b97ad56a693f81b29b7ced429b27 Merge: faa4e04e5e140 0d1f700807d84 Author: Jakub Kicinski Date: Wed Jul 6 20:04:09 2022 -0700 Merge branch 'wireguard-patches-for-5-19-rc6' Jason A. Donenfeld says: ==================== wireguard patches for 5.19-rc6 1) A few small fixups to the selftests, per usual. Of particular note is a fix for a test flake that occurred on especially fast systems that boot in less than a second. 2) An addition during this cycle of some s390 crypto interacted with the way wireguard selects dependencies, resulting in linker errors reported by the kernel test robot. So Vladis sent in a patch for that, which also required a small preparatory fix moving some Kconfig symbols around. ==================== Link: https://lore.kernel.org/r/20220707003157.526645-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 0d1f700807d846b00e33cc87d90f404bbc904a97 Author: Vladis Dronov Date: Thu Jul 7 02:31:57 2022 +0200 wireguard: Kconfig: select CRYPTO_CHACHA_S390 Select the new implementation of CHACHA20 for S390 when available. It is faster than the generic software implementation, but also prevents some linker errors in certain situations. Reported-by: kernel test robot Link: https://lore.kernel.org/linux-kernel/202207030630.6SZVkrWf-lkp@intel.com/ Signed-off-by: Vladis Dronov Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit b7133757da4c4c17d625970f6da3d76af12a8867 Author: Jason A. Donenfeld Date: Thu Jul 7 02:31:56 2022 +0200 crypto: s390 - do not depend on CRYPTO_HW for SIMD implementations Various accelerated software implementation Kconfig values for S390 were mistakenly placed into drivers/crypto/Kconfig, even though they're mainly just SIMD code and live in arch/s390/crypto/ like usual. This gives them the very unusual dependency on CRYPTO_HW, which leads to problems elsewhere. This patch fixes the issue by moving the Kconfig values for non-hardware drivers into the usual place in crypto/Kconfig. Acked-by: Herbert Xu Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit b83fdcd9fb8ad7e59f4188ba9ec221917f463a17 Author: Jason A. Donenfeld Date: Thu Jul 7 02:31:55 2022 +0200 wireguard: selftests: use microvm on x86 This makes for faster tests, faster compile time, and allows us to ditch ACPI finally. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit 1a087eec257154e26a81a7a0a15380d7a2431765 Author: Jason A. Donenfeld Date: Thu Jul 7 02:31:54 2022 +0200 wireguard: selftests: always call kernel makefile These selftests are used for much more extensive changes than just the wireguard source files. So always call the kernel's build file, which will do something or nothing after checking the whole tree, per usual. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit 1f2f341a62639c7066ee4c76b7d9ebe867e0a1d5 Author: Jason A. Donenfeld Date: Thu Jul 7 02:31:53 2022 +0200 wireguard: selftests: use virt machine on m68k This should be a bit more stable hopefully. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit 829be057dbc1e71383b8d7de8edb31dcf07b4aa0 Author: Jason A. Donenfeld Date: Thu Jul 7 02:31:52 2022 +0200 wireguard: selftests: set fake real time in init Not all platforms have an RTC, and rather than trying to force one into each, it's much easier to just set a fixed time. This is necessary because WireGuard's latest handshakes parameter is returned in wallclock time, and if the system time isn't set, and the system is really fast, then this returns 0, which trips the test. Turning this on requires setting CONFIG_COMPAT_32BIT_TIME=y, as musl doesn't support settimeofday without it. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski commit faa4e04e5e140a6d02260289a8fba8fd8d7a3003 Author: Heiner Kallweit Date: Tue Jul 5 21:15:22 2022 +0200 r8169: fix accessing unset transport header 66e4c8d95008 ("net: warn if transport header was not set") added a check that triggers a warning in r8169, see [0]. The commit referenced in the Fixes tag refers to the change from which the patch applies cleanly, there's nothing wrong with this commit. It seems the actual issue (not bug, because the warning is harmless here) was introduced with bdfa4ed68187 ("r8169: use Giant Send"). [0] https://bugzilla.kernel.org/show_bug.cgi?id=216157 Fixes: 8d520b4de3ed ("r8169: work around RTL8125 UDP hw bug") Reported-by: Erhard F. Tested-by: Erhard F. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/1b2c2b29-3dc0-f7b6-5694-97ec526d51a0@gmail.com Signed-off-by: Jakub Kicinski commit 148ca04518070910739dfc4eeda765057856403d Author: Duoming Zhou Date: Tue Jul 5 20:56:10 2022 +0800 net: rose: fix UAF bug caused by rose_t0timer_expiry There are UAF bugs caused by rose_t0timer_expiry(). The root cause is that del_timer() could not stop the timer handler that is running and there is no synchronization. One of the race conditions is shown below: (thread 1) | (thread 2) | rose_device_event | rose_rt_device_down | rose_remove_neigh rose_t0timer_expiry | rose_stop_t0timer(rose_neigh) ... | del_timer(&neigh->t0timer) | kfree(rose_neigh) //[1]FREE neigh->dce_mode //[2]USE | The rose_neigh is deallocated in position [1] and use in position [2]. The crash trace triggered by POC is like below: BUG: KASAN: use-after-free in expire_timers+0x144/0x320 Write of size 8 at addr ffff888009b19658 by task swapper/0/0 ... Call Trace: dump_stack_lvl+0xbf/0xee print_address_description+0x7b/0x440 print_report+0x101/0x230 ? expire_timers+0x144/0x320 kasan_report+0xed/0x120 ? expire_timers+0x144/0x320 expire_timers+0x144/0x320 __run_timers+0x3ff/0x4d0 run_timer_softirq+0x41/0x80 __do_softirq+0x233/0x544 ... This patch changes rose_stop_ftimer() and rose_stop_t0timer() in rose_remove_neigh() to del_timer_sync() in order that the timer handler could be finished before the resources such as rose_neigh and so on are deallocated. As a result, the UAF bugs could be mitigated. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220705125610.77971-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski commit 9fab303a2cb3d323ca3a32a8b4ab60b451141901 Author: Mimi Zohar Date: Thu Jun 30 11:23:38 2022 -0400 ima: fix violation measurement list record Although the violation digest in the IMA measurement list is always zeroes, the size of the digest should be based on the hash algorithm. Until recently the hash algorithm was hard coded to sha1. Fix the violation digest size included in the IMA measurement list. This is just a cosmetic change which should not affect attestation. Reported-by: Stefan Berger Fixes: 09091c44cb73 ("ima: use IMA default hash algorithm for integrity violations") Tested-by: Stefan Berger Signed-off-by: Mimi Zohar commit 3a4b1cc28fbdc2325b3e3ed7d8024995a75f9216 Author: Alex Deucher Date: Tue Jun 21 10:10:37 2022 -0400 drm/amdgpu/display: disable prefer_shadow for generic fb helpers Seems to break hibernation. Disable for now until we can root cause it. Fixes: 087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216119 Acked-by: Evan Quan Signed-off-by: Alex Deucher commit f9a89117fbdc63c0d4ab63a8f3596a72c245bcfe Author: Alex Deucher Date: Tue Jun 21 10:04:55 2022 -0400 drm/amdgpu: keep fbdev buffers pinned during suspend Was dropped when we converted to the generic helpers. Fixes: 087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Acked-by: Evan Quan Signed-off-by: Alex Deucher commit b55a21b764c1e182014630fa5486d717484ac58f Author: Oliver Neukum Date: Tue Jul 5 14:53:51 2022 +0200 usbnet: fix memory leak in error case usbnet_write_cmd_async() mixed up which buffers need to be freed in which error case. v2: add Fixes tag v3: fix uninitialized buf pointer Fixes: 877bd862f32b8 ("usbnet: introduce usbnet 3 command helpers") Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220705125351.17309-1-oneukum@suse.com Signed-off-by: Jakub Kicinski commit 5b759bf2f9d73db05369aef2344502095c4e5e73 Author: Maxim Mikityanskiy Date: Mon May 30 14:01:37 2022 +0300 net/mlx5e: Ring the TX doorbell on DMA errors TX doorbells may be postponed, because sometimes the driver knows that another packet follows (for example, when xmit_more is true, or when a MPWQE session is closed before transmitting a packet). However, the DMA mapping may fail for the next packet, in which case a new WQE is not posted, the doorbell isn't updated either, and the transmission of the previous packet will be delayed indefinitely. This commit fixes the described rare error flow by posting a NOP and ringing the doorbell on errors to flush all the previous packets. The MPWQE session is closed before that. DMA mapping in the MPWQE flow is moved to the beginning of mlx5e_sq_xmit_mpwqe, because empty sessions are not allowed. Stop room always has enough space for a NOP, because the actual TX WQE is not posted. Fixes: e586b3b0baee ("net/mlx5: Ethernet Datapath files") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 452133dd580811f184e76b1402983182ee425298 Author: Gal Pressman Date: Mon Jun 27 15:05:53 2022 +0300 net/mlx5e: Fix capability check for updating vnic env counters The existing capability check for vnic env counters only checks for receive steering discards, although we need the counters update for the exposed internal queue oob counter as well. This could result in the latter counter not being updated correctly when the receive steering discards counter is not supported. Fix that by checking whether any counter is supported instead of only the steering counter capability. Fixes: 0cfafd4b4ddf ("net/mlx5e: Add device out of buffer counter") Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 6c4e8fa03fde7e5b304594294e397a9ba92feaf6 Author: Roi Dayan Date: Tue Jun 21 10:43:55 2022 +0300 net/mlx5e: CT: Use own workqueue instead of mlx5e priv Allocate a ct priv workqueue instead of using mlx5e priv one so flushing will only be of related CT entries. Also move flushing of the workqueue before rhashtable destroy otherwise entries won't be valid. Fixes: b069e14fff46 ("net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release") Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 1afbd1e283d6a5449d8c24ce8ccae8ccb15ee943 Author: Liu, Changcheng Date: Fri May 27 16:49:14 2022 +0800 net/mlx5: Lag, correct get the port select mode str mode & mode_flags is updated at the end of mlx5_activate_lag which may not reflect the actual mode as shown in below logic: mlx5_activate_lag(struct mlx5_lag *ldev, |-- unsigned long flags = 0; |-- err = mlx5_lag_set_flags(ldev, mode, tracker, shared_fdb, &flags); |-- err = mlx5_create_lag(ldev, tracker, mode, flags); |-- mlx5_get_str_port_sel_mode(ldev); |-- ldev->mode = mode; |-- ldev->mode_flags = flags; Use mode & flag as parameters to get port select mode info. Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode") Signed-off-by: Liu, Changcheng Reviewed-by: Eli Cohen Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 0c9d876545a56aebed30fa306d0460a4d28d271a Author: Paul Blakey Date: Wed Jun 22 13:11:18 2022 +0300 net/mlx5e: Fix enabling sriov while tc nic rules are offloaded There is a total of four 4M entries flow tables. In sriov disabled mode, ct, ct_nat and post_act take three of them. When adding the first tc nic rule in this mode, it will take another 4M table for the tc table. If user then enables sriov, the legacy flow table tries to take another 4M and fails, and so enablement fails. To fix that, have legacy fdb take the next available maximum size from the fs ft pool. Fixes: 4a98544d1827 ("net/mlx5: Move chains ft pool to be used by all firmware steering") Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 2ec6cf9b742a5c18982861322fa5de6510f8f57e Author: Tariq Toukan Date: Mon Jun 6 21:21:10 2022 +0300 net/mlx5e: kTLS, Fix build time constant test in RX Use the correct constant (TLS_DRIVER_STATE_SIZE_RX) in the comparison against the size of the private RX TLS driver context. Fixes: 1182f3659357 ("net/mlx5e: kTLS, Add kTLS RX HW offload support") Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 6cc2714e85754a621219693ea8aa3077d6fca0cb Author: Tariq Toukan Date: Mon Jun 6 21:20:29 2022 +0300 net/mlx5e: kTLS, Fix build time constant test in TX Use the correct constant (TLS_DRIVER_STATE_SIZE_TX) in the comparison against the size of the private TX TLS driver context. Fixes: df8d866770f9 ("net/mlx5e: kTLS, Use kernel API to extract private offload context") Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit 4892bd9830c363420f00d90186630e7acbed5c9e Author: Mark Bloch Date: Tue May 24 12:08:10 2022 +0300 net/mlx5: Lag, decouple FDB selection and shared FDB Multiport eswitch is required to use native FDB selection instead of affinity, This was achieved by passing the shared_fdb flag down the HW lag creation path. While it did accomplish the goal of setting FDB selection mode to native, it had the side effect of also creating a shared FDB configuration. This created a few issues: - TC rules are inserted into a non active FDB, which means traffic isn't offloaded as all traffic will reach only a single FDB. - All wire traffic is treated as if a single physical port received it; while this is true for a bond configuration, this shouldn't be the case for multiport eswitch. Create a new flag MLX5_LAG_MODE_FLAG_FDB_SEL_MODE_NATIVE to indicate what FDB selection mode should be used. Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode") Signed-off-by: Mark Bloch Reviewed-by: Eli Cohen Signed-off-by: Saeed Mahameed commit d6c13d74b5c06bef75febf1f351de3c4c255f149 Author: Eli Cohen Date: Wed Jun 8 17:34:16 2022 +0300 net/mlx5: TC, allow offload from uplink to other PF's VF Redirecting traffic from uplink to a VF is a legal operation of mulitport eswitch mode. Remove the limitation. Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode") Signed-off-by: Eli Cohen Reviewed-by: Maor Dickman Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit e5c46fde75e43c15a29b40e5fc5641727f97ae47 Author: Ard Biesheuvel Date: Thu Jun 30 16:46:54 2022 +0100 ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction After emulating a misaligned load or store issued in Thumb mode, we have to advance the IT state by hand, or it will get out of sync with the actual instruction stream, which means we'll end up applying the wrong condition code to subsequent instructions. This might corrupt the program state rather catastrophically. So borrow the it_advance() helper from the probing code, and use it on CPSR if the emulated instruction is Thumb. Cc: Reviewed-by: Linus Walleij Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit e4ced82deb5fb17222fb82e092c3f8311955b585 Author: Dmitry Osipenko Date: Tue Jun 28 08:55:45 2022 +0100 ARM: 9213/1: Print message about disabled Spectre workarounds only once Print the message about disabled Spectre workarounds only once. The message is printed each time CPU goes out from idling state on NVIDIA Tegra boards, causing storm in KMSG that makes system unusable. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko Signed-off-by: Russell King (Oracle) commit 2bf6204240fddb22cc4940b9e3f40c538390212e Author: Linus Walleij Date: Sun Jun 19 20:40:16 2022 +0100 ARM: 9212/1: domain: Modify Kconfig help text After the removal of set_fs() the reference to set_fs() is stale. Alter the helptext to reflect what the config option really does. Fixes: 8ac6f5d7f84b ("ARM: 9113/1: uaccess: remove set_fs() implementation") Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit cc45b836388f0ccc6831288a08f77a33845f10b0 Author: Linus Walleij Date: Sun Jun 19 20:39:29 2022 +0100 ARM: 9211/1: domain: drop modify_domain() This function/macro isn't used anywhere in the kernel. The only user was set_fs() and was deleted in the set_fs() removal patch set. Fixes: 8ac6f5d7f84b ("ARM: 9113/1: uaccess: remove set_fs() implementation") Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 598f0a99fa8a35be44b27106b43ddc66417af3b1 Author: Zhen Lei Date: Mon Jun 13 15:05:41 2022 +0100 ARM: 9210/1: Mark the FDT_FIXED sections as shareable commit 7a1be318f579 ("ARM: 9012/1: move device tree mapping out of linear region") use FDT_FIXED_BASE to map the whole FDT_FIXED_SIZE memory area which contains fdt. But it only reserves the exact physical memory that fdt occupied. Unfortunately, this mapping is non-shareable. An illegal or speculative read access can bring the RAM content from non-fdt zone into cache, PIPT makes it to be hit by subsequently read access through shareable mapping(such as linear mapping), and the cache consistency between cores is lost due to non-shareable property. |<---------FDT_FIXED_SIZE------>| | | ------------------------------- | | | | ------------------------------- 1. CoreA read through MT_ROM mapping, the old data is loaded into the cache. 2. CoreB write to update data through linear mapping. CoreA received the notification to invalid the corresponding cachelines, but the property non-shareable makes it to be ignored. 3. CoreA read through linear mapping, cache hit, the old data is read. To eliminate this risk, add a new memory type MT_MEMORY_RO. Compared to MT_ROM, it is shareable and non-executable. Here's an example: list_del corruption. prev->next should be c0ecbf74, but was c08410dc kernel BUG at lib/list_debug.c:53! ... ... PC is at __list_del_entry_valid+0x58/0x98 LR is at __list_del_entry_valid+0x58/0x98 psr: 60000093 sp : c0ecbf30 ip : 00000000 fp : 00000001 r10: c08410d0 r9 : 00000001 r8 : c0825e0c r7 : 20000013 r6 : c08410d0 r5 : c0ecbf74 r4 : c0ecbf74 r3 : c0825d08 r2 : 00000000 r1 : df7ce6f4 r0 : 00000044 ... ... Stack: (0xc0ecbf30 to 0xc0ecc000) bf20: c0ecbf74 c0164fd0 c0ecbf70 c0165170 bf40: c0eca000 c0840c00 c0840c00 c0824500 c0825e0c c0189bbc c088f404 60000013 bf60: 60000013 c0e85100 000004ec 00000000 c0ebcdc0 c0ecbf74 c0ecbf74 c0825d08 ... ... < next prev > (__list_del_entry_valid) from (__list_del_entry+0xc/0x20) (__list_del_entry) from (finish_swait+0x60/0x7c) (finish_swait) from (rcu_gp_kthread+0x560/0xa20) (rcu_gp_kthread) from (kthread+0x14c/0x15c) (kthread) from (ret_from_fork+0x14/0x24) The faulty list node to be deleted is a local variable, its address is c0ecbf74. The dumped stack shows that 'prev' = c0ecbf74, but its value before lib/list_debug.c:53 is c08410dc. A large amount of printing results in swapping out the cacheline containing the old data(MT_ROM mapping is read only, so the cacheline cannot be dirty), and the subsequent dump operation obtains new data from the DDR. Fixes: 7a1be318f579 ("ARM: 9012/1: move device tree mapping out of linear region") Suggested-by: Ard Biesheuvel Signed-off-by: Zhen Lei Reviewed-by: Ard Biesheuvel Reviewed-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 0609e200246bfd3b7516091c491bec4308349055 Author: Ard Biesheuvel Date: Tue May 31 09:53:42 2022 +0100 ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle Jon reports that the Spectre-BHB init code is filling up the kernel log with spurious notifications about which mitigation has been enabled, every time any CPU comes out of a low power state. Given that Spectre-BHB mitigations are system wide, only a single mitigation can be enabled, and we already print an error if two types of CPUs coexist in a single system that require different Spectre-BHB mitigations. This means that the pr_info() that describes the selected mitigation does not need to be emitted for each CPU anyway, and so we can simply emit it only once. In order to clarify the above in the log message, update it to describe that the selected mitigation will be enabled on all CPUs, including ones that are unaffected. If another CPU comes up later that is affected and requires a different mitigation, we report an error as before. Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Tested-by: Jon Hunter Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 5b1a01c16292208be9a1ccc170c99c747df0c4c4 Merge: 30554a1f0fd6a 6ece49c569655 Author: Mark Brown Date: Wed Jul 6 20:37:43 2022 +0100 spi: Merge AMD fix Work around problems with large transfers. commit 5c629dc9609dc43492a7bc8060cc6120875bf096 Author: Keith Busch Date: Wed Jul 6 10:05:05 2022 -0700 nvme: use struct group for generic command dwords This will allow the trace event to know the full size of the data intended to be copied and silence read overflow checks. Reported-by: John Garry Suggested-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 9f09069cde34dcd86f5ecf3a3139fd752020812f Merge: c3850b3f975f9 48bddb89d59ee Author: Linus Torvalds Date: Wed Jul 6 10:10:26 2022 -0700 Merge tag 'for-linus' of https://github.com/openrisc/linux Pull OpenRISC fixes from Stafford Horne: "Fixups for OpenRISC found during recent testing: - An OpenRISC irqchip fix to stop acking level interrupts which was causing issues on SMP platforms - A comment typo fix in our unwinder code" * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: unwinder: Fix grammar issue in comment irqchip: or1k-pic: Undefine mask_ack for level triggered hardware commit c3850b3f975f94317011421bb55325f828ae72ea Merge: e35e5b6f695d2 c5e58c4545a69 Author: Linus Torvalds Date: Wed Jul 6 10:01:00 2022 -0700 Merge tag 'sound-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This became largish as it includes the pending ASoC fixes. Almost all changes are device-specific small fixes, while many of them are coverage for mixer issues that were detected by selftest. In addition, usual suspects for HD/USB-audio are there" * tag 'sound-5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (43 commits) ALSA: cs46xx: Fix missing snd_card_free() call at probe error ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) ALSA: usb-audio: Add quirk for Fiero SC-01 ALSA: hda/realtek: Add quirk for Clevo L140PU ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices ASoC: madera: Fix event generation for rate controls ASoC: madera: Fix event generation for OUT1 demux ASoC: cs47l15: Fix event generation for low power mux control ASoC: cs35l41: Add ASP TX3/4 source to register patch ASoC: dapm: Initialise kcontrol data for mux/demux controls ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error ASoC: cs35l41: Correct some control names ASoC: wm5110: Fix DRE control ASoC: wm_adsp: Fix event for preloader MAINTAINERS: update ASoC Qualcomm maintainer email-id ASoC: rockchip: i2s: switch BCLK to GPIO ASoC: SOF: Intel: disable IMR boot when resuming from ACPI S4 and S5 states ASoC: SOF: pm: add definitions for S4 and S5 states ASoC: SOF: pm: add explicit behavior for ACPI S1 and S2 ASoC: SOF: Intel: hda: Fix compressed stream position tracking ... commit 80f2a248a2f92c07873128808359756f72a0438b Merge: e35e5b6f695d2 1357d2a65601b Author: Thomas Gleixner Date: Wed Jul 6 18:31:59 2022 +0200 Merge tag 'irqchip-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zygnier: - Gracefully handle failure to request MMIO resources in the GICv3 driver - Make a static key static in the Apple AIC driver - Fix the Xilinx intc driver dependency on OF_ADDRESS Link: https://lore.kernel.org/all/20220701133531.1545319-1-maz@kernel.org commit 607a48c78e6b427b0b684d24e61c19e846ad65d6 Author: Samuel Holland Date: Fri Jul 1 22:19:02 2022 -0500 dt-bindings: dma: allwinner,sun50i-a64-dma: Fix min/max typo The conditional block for variants with a second clock should have set minItems, not maxItems, which was already 2. Since clock-names requires two items, this typo should not have caused any problems. Fixes: edd14218bd66 ("dt-bindings: dmaengine: Convert Allwinner A31 and A64 DMA to a schema") Signed-off-by: Samuel Holland Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220702031903.21703-1-samuel@sholland.org Signed-off-by: Vinod Koul commit 73029c9b23cf1213e5f54c2b59efce08665199e7 Author: Keith Busch Date: Tue Jul 5 10:21:02 2022 -0700 nvme-pci: phison e16 has bogus namespace ids Add the quirk. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216049 Reported-by: Chris Egolf Signed-off-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 3663a2fb325b8782524f3edb0ae32d6faa615109 Author: Hsin-Yi Wang Date: Fri Jul 1 01:33:29 2022 +0800 video: of_display_timing.h: include errno.h If CONFIG_OF is not enabled, default of_get_display_timing() returns an errno, so include the header. Fixes: 422b67e0b31a ("videomode: provide dummy inline functions for !CONFIG_OF") Suggested-by: Stephen Boyd Signed-off-by: Hsin-Yi Wang Reviewed-by: Stephen Boyd Signed-off-by: Helge Deller commit 955f04766d4e6eb94bf3baa539e096808c74ebfb Author: Guiling Deng Date: Tue Jun 28 09:36:41 2022 -0700 fbdev: fbmem: Fix logo center image dx issue Image.dx gets wrong value because of missing '()'. If xres == logo->width and n == 1, image.dx = -16. Signed-off-by: Guiling Deng Fixes: 3d8b1933eb1c ("fbdev: fbmem: add config option to center the bootup logo") Cc: stable@vger.kernel.org # v5.0+ Signed-off-by: Helge Deller commit 1fd6e5675336daf4747940b4285e84b0c114ae32 Author: Johan Almbladh Date: Tue Jul 5 10:23:45 2022 +0200 xdp: Fix spurious packet loss in generic XDP TX path The byte queue limits (BQL) mechanism is intended to move queuing from the driver to the network stack in order to reduce latency caused by excessive queuing in hardware. However, when transmitting or redirecting a packet using generic XDP, the qdisc layer is bypassed and there are no additional queues. Since netif_xmit_stopped() also takes BQL limits into account, but without having any alternative queuing, packets are silently dropped. This patch modifies the drop condition to only consider cases when the driver itself cannot accept any more packets. This is analogous to the condition in __dev_direct_xmit(). Dropped packets are also counted on the device. Bypassing the qdisc layer in the generic XDP TX path means that XDP packets are able to starve other packets going through a qdisc, and DDOS attacks will be more effective. In-driver-XDP use dedicated TX queues, so they do not have this starvation issue. Signed-off-by: Johan Almbladh Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220705082345.2494312-1-johan.almbladh@anyfinetworks.com commit 6ece49c56965544262523dae4a071ace3db63507 Author: Cristian Ciocaltea Date: Wed Jul 6 13:06:22 2022 +0300 spi: amd: Limit max transfer and message size Enabling the SPI CS35L41 audio codec driver for Steam Deck [1] revealed a problem with the current AMD SPI controller driver implementation, consisting of an unrecoverable system hang. The issue can be prevented if we ensure the max transfer size and the max message size do not exceed the FIFO buffer size. According to the implementation of the downstream driver, the AMD SPI controller is not able to handle more than 70 bytes per transfer, which corresponds to the size of the FIFO buffer. Hence, let's fix this by setting the SPI limits mentioned above. [1] https://lore.kernel.org/r/20220621213819.262537-1-cristian.ciocaltea@collabora.com Reported-by: Anastasios Vacharakis Fixes: bbb336f39efc ("spi: spi-amd: Add AMD SPI controller driver support") Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20220706100626.1234731-2-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit a069a90554168ac4cc81af65f000557d2a8a0745 Author: Gal Pressman Date: Tue Jul 5 14:08:37 2022 +0300 Revert "tls: rx: move counting TlsDecryptErrors for sync" This reverts commit 284b4d93daee56dff3e10029ddf2e03227f50dbf. When using TLS device offload and coming from tls_device_reencrypt() flow, -EBADMSG error in tls_do_decryption() should not be counted towards the TLSTlsDecryptError counter. Move the counter increase back to the decrypt_internal() call site in decrypt_skb_update(). This also fixes an issue where: if (n_sgin < 1) return -EBADMSG; Errors in decrypt_internal() were not counted after the cited patch. Fixes: 284b4d93daee ("tls: rx: move counting TlsDecryptErrors for sync") Cc: Jakub Kicinski Reviewed-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit ae9fdf6cb4da4265bdc3a574d06eaad02a7f669a Merge: 44d632d5dde25 d2d21f175f1f9 Author: David S. Miller Date: Wed Jul 6 12:50:27 2022 +0100 Merge branch 'mptcp-path-manager-fixes' Mat Martineau says: ==================== mptcp: Path manager fixes for 5.19 The MPTCP userspace path manager is new in 5.19, and these patches fix some issues in that new code. Patches 1-3 fix path manager locking issues. Patches 4 and 5 allow userspace path managers to change priority of established subflows using the existing MPTCP_PM_CMD_SET_FLAGS generic netlink command. Includes corresponding self test update. Patches 6 and 7 fix accounting of available endpoint IDs and the MPTCP_MIB_RMSUBFLOW counter. ==================== Signed-off-by: David S. Miller commit d2d21f175f1f9580eb5681f5b476c8d7a0a3c895 Author: Geliang Tang Date: Tue Jul 5 14:32:17 2022 -0700 mptcp: update MIB_RMSUBFLOW in cmd_sf_destroy This patch increases MPTCP_MIB_RMSUBFLOW mib counter in userspace pm destroy subflow function mptcp_nl_cmd_sf_destroy() when removing subflow. Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment") Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 843b5e75efff04db34fcf9856de53c9e415530a2 Author: Paolo Abeni Date: Tue Jul 5 14:32:16 2022 -0700 mptcp: fix local endpoint accounting In mptcp_pm_nl_rm_addr_or_subflow() we always mark as available the id corresponding to the just removed address. The used bitmap actually tracks only the local IDs: we must restrict the operation when a (local) subflow is removed. Fixes: a88c9e496937 ("mptcp: do not block subflows creation on errors") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ca188a25d43f85f9c6f1e0a303edad47c9d24989 Author: Kishen Maloor Date: Tue Jul 5 14:32:15 2022 -0700 selftests: mptcp: userspace PM support for MP_PRIO signals This change updates the testing sample (pm_nl_ctl) to exercise the updated MPTCP_PM_CMD_SET_FLAGS command for userspace PMs to issue MP_PRIO signals over the selected subflow. E.g. ./pm_nl_ctl set 10.0.1.2 port 47234 flags backup token 823274047 rip 10.0.1.1 rport 50003 userspace_pm.sh has a new selftest that invokes this command. Fixes: 259a834fadda ("selftests: mptcp: functional tests for the userspace PM type") Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 892f396c8e68faab7f76ff49cf39e9fbbeea4097 Author: Kishen Maloor Date: Tue Jul 5 14:32:14 2022 -0700 mptcp: netlink: issue MP_PRIO signals from userspace PMs This change updates MPTCP_PM_CMD_SET_FLAGS to allow userspace PMs to issue MP_PRIO signals over a specific subflow selected by the connection token, local and remote address+port. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/286 Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment") Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit a657430260e5437df16004c8c317821d946b5ead Author: Mat Martineau Date: Tue Jul 5 14:32:13 2022 -0700 mptcp: Acquire the subflow socket lock before modifying MP_PRIO flags When setting up a subflow's flags for sending MP_PRIO MPTCP options, the subflow socket lock was not held while reading and modifying several struct members that are also read and modified in mptcp_write_options(). Acquire the subflow socket lock earlier and send the MP_PRIO ACK with that lock already acquired. Add a new variant of the mptcp_subflow_send_ack() helper to use with the subflow lock held. Fixes: 067065422fcd ("mptcp: add the outgoing MP_PRIO support") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit c21b50d5912b68c4414c60ef5b30416c103f9fd8 Author: Mat Martineau Date: Tue Jul 5 14:32:12 2022 -0700 mptcp: Avoid acquiring PM lock for subflow priority changes The in-kernel path manager code for changing subflow flags acquired both the msk socket lock and the PM lock when possibly changing the "backup" and "fullmesh" flags. mptcp_pm_nl_mp_prio_send_ack() does not access anything protected by the PM lock, and it must release and reacquire the PM lock. By pushing the PM lock to where it is needed in mptcp_pm_nl_fullmesh(), the lock is only acquired when the fullmesh flag is changed and the backup flag code no longer has to release and reacquire the PM lock. The change in locking context requires the MIB update to be modified - move that to a better location instead. This change also makes it possible to call mptcp_pm_nl_mp_prio_send_ack() for the userspace PM commands without manipulating the in-kernel PM lock. Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 5ccecaec5c1e85cabfda848c6f146da0d8d55bd6 Author: Paolo Abeni Date: Tue Jul 5 14:32:11 2022 -0700 mptcp: fix locking in mptcp_nl_cmd_sf_destroy() The user-space PM subflow removal path uses a couple of helpers that must be called under the msk socket lock and the current code lacks such requirement. Change the existing lock scope so that the relevant code is under its protection. Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/287 Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 44d632d5dde2514b414bd6344918d68dacd8fe6f Merge: e6fa930f73a15 4d1e07d83ccc8 Author: David S. Miller Date: Wed Jul 6 12:44:39 2022 +0100 Merge branch 'act_police-continue-offload-fix' Vlad Buslov says: ==================== net: Fix police 'continue' action offload TC act_police with 'continue' action had been supported by mlx5 matchall classifier offload implementation for some time. However, 'continue' was assumed implicitly and recently got broken in multiple places. Fix it in both TC hardware offload validation code and mlx5 driver. ==================== Signed-off-by: David S. Miller commit 4d1e07d83ccc87f210e5b852b0a5ea812a2f191c Author: Vlad Buslov Date: Mon Jul 4 22:44:05 2022 +0200 net/mlx5e: Fix matchall police parameters validation Referenced commit prepared the code for upcoming extension that allows mlx5 to offload police action attached to flower classifier. However, with regard to existing matchall classifier offload validation should be reversed as FLOW_ACTION_CONTINUE is the only supported notexceed police action type. Fix the problem by allowing FLOW_ACTION_CONTINUE for police action and extend scan_tc_matchall_fdb_actions() to only allow such actions with matchall classifier. Fixes: d97b4b105ce7 ("flow_offload: reject offload for all drivers with invalid police parameters") Signed-off-by: Vlad Buslov Acked-by: Saeed Mahameed Signed-off-by: David S. Miller commit 052f744f44462cc49b88a125b0f7b93a9e47a9dd Author: Vlad Buslov Date: Mon Jul 4 22:44:04 2022 +0200 net/sched: act_police: allow 'continue' action offload Offloading police with action TC_ACT_UNSPEC was erroneously disabled even though it was supported by mlx5 matchall offload implementation, which didn't verify the action type but instead assumed that any single police action attached to matchall classifier is a 'continue' action. Lack of action type check made it non-obvious what mlx5 matchall implementation actually supports and caused implementers and reviewers of referenced commits to disallow it as a part of improved validation code. Fixes: b8cd5831c61c ("net: flow_offload: add tc police action parameters") Fixes: b50e462bc22d ("net/sched: act_police: Add extack messages for offload failure") Signed-off-by: Vlad Buslov Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: David S. Miller commit aafc013e8297b30c517a6383516bc88a3425856c Merge: 3c5a4e6d833a6 f4470dbfb5ff9 Author: Arnd Bergmann Date: Wed Jul 6 13:36:16 2022 +0200 Merge tag 'v5.19-rockchip-socfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Add a missing of_node_put in suspend code error path. * tag 'v5.19-rockchip-socfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init() Link: https://lore.kernel.org/r/7527945.6fTUFtlzNn@phil Signed-off-by: Arnd Bergmann commit 3c5a4e6d833a6165566d7467a34c82e6e5a987f3 Merge: c0d1a7bd6574c 2d56af33d4df9 Author: Arnd Bergmann Date: Wed Jul 6 13:35:12 2022 +0200 Merge tag 'v5.19-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes rk3399 vdu clock-rate fix, otg port fix on Quartz64-A and ethernet fix on Quartz64-B (actual production model) * tag 'v5.19-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Assign RK3399 VDU clock rate arm64: dts: rockchip: Fix Quartz64-A dwc3 otg port behavior arm64: dts: rockchip: Fix ethernet on production Quartz64-B Link: https://lore.kernel.org/r/7723415.29KlJPOoH8@phil Signed-off-by: Arnd Bergmann commit 4140d77a022101376bbfa3ec3e3da5063455c60e Author: Lu Baolu Date: Sat Jun 25 21:34:30 2022 +0800 iommu/vt-d: Fix RID2PASID setup/teardown failure The IOMMU driver shares the pasid table for PCI alias devices. When the RID2PASID entry of the shared pasid table has been filled by the first device, the subsequent device will encounter the "DMAR: Setup RID2PASID failed" failure as the pasid entry has already been marked as present. As the result, the IOMMU probing process will be aborted. On the contrary, when any alias device is hot-removed from the system, for example, by writing to /sys/bus/pci/devices/.../remove, the shared RID2PASID will be cleared without any notifications to other devices. As the result, any DMAs from those rest devices are blocked. Sharing pasid table among PCI alias devices could save two memory pages for devices underneath the PCIe-to-PCI bridges. Anyway, considering that those devices are rare on modern platforms that support VT-d in scalable mode and the saved memory is negligible, it's reasonable to remove this part of immature code to make the driver feasible and stable. Fixes: ef848b7e5a6a0 ("iommu/vt-d: Setup pasid entry for RID2PASID support") Reported-by: Chenyi Qiang Reported-by: Ethan Zhao Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Ethan Zhao Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220623065720.727849-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220625133430.2200315-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 316f92a705a4c2bf4712135180d56f3cca09243a Author: Yian Chen Date: Fri May 20 17:21:15 2022 -0700 iommu/vt-d: Fix PCI bus rescan device hot add Notifier calling chain uses priority to determine the execution order of the notifiers or listeners registered to the chain. PCI bus device hot add utilizes the notification mechanism. The current code sets low priority (INT_MIN) to Intel dmar_pci_bus_notifier and postpones DMAR decoding after adding new device into IOMMU. The result is that struct device pointer cannot be found in DRHD search for the new device's DMAR/IOMMU. Subsequently, the device is put under the "catch-all" IOMMU instead of the correct one. This could cause system hang when device TLB invalidation is sent to the wrong IOMMU. Invalidation timeout error and hard lockup have been observed and data inconsistency/crush may occur as well. This patch fixes the issue by setting a positive priority(1) for dmar_pci_bus_notifier while the priority of IOMMU bus notifier uses the default value(0), therefore DMAR decoding will be in advance of DRHD search for a new device to find the correct IOMMU. Following is a 2-step example that triggers the bug by simulating PCI device hot add behavior in Intel Sapphire Rapids server. echo 1 > /sys/bus/pci/devices/0000:6a:01.0/remove echo 1 > /sys/bus/pci/rescan Fixes: 59ce0515cdaf ("iommu/vt-d: Update DRHD/RMRR/ATSR device scope") Cc: stable@vger.kernel.org # v3.15+ Reported-by: Zhang, Bernice Signed-off-by: Jacob Pan Signed-off-by: Yian Chen Link: https://lore.kernel.org/r/20220521002115.1624069-1-yian.chen@intel.com Signed-off-by: Joerg Roedel commit b57feed2cc2622ae14b2fa62f19e973e5e0a60cf Author: Michael Roth Date: Tue Jul 5 21:53:15 2022 -0500 x86/compressed/64: Add identity mappings for setup_data entries The decompressed kernel initially relies on the identity map set up by the boot/compressed kernel for accessing things like boot_params. With the recent introduction of SEV-SNP support, the decompressed kernel also needs to access the setup_data entries pointed to by boot_params->hdr.setup_data. This can lead to a crash in the kexec kernel during early boot due to these entries not currently being included in the initial identity map, see thread at Link below. Include mappings for the setup_data entries in the initial identity map. [ bp: Massage commit message and use a helper var for better readability. ] Fixes: b190a043c49a ("x86/sev: Add SEV-SNP feature detection/setup") Reported-by: Jun'ichi Nomura Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/TYCPR01MB694815CD815E98945F63C99183B49@TYCPR01MB6948.jpnprd01.prod.outlook.com commit 1dbe67b9faea0bc340cce894018076679c16cb71 Author: Christophe JAILLET Date: Sun May 22 19:41:05 2022 +0200 dmaengine: lgm: Fix an error handling path in intel_ldma_probe() ldma_clk_disable() calls both: clk_disable_unprepare(d->core_clk); reset_control_assert(d->rst); So, should devm_reset_control_get_optional() fail, core_clk should not be prepare_enable'd before it, otherwise it will never be disable_unprepare'd. Reorder the code to handle the error handling path as expected. Fixes: 32d31c79a1a4 ("dmaengine: Add Intel LGM SoC DMA support.") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/18504549bc4d2b62a72a02cb22a2e4d8e6a58720.1653241224.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit b64b3b2f1d81f83519582e1feee87d77f51f5f17 Author: Dmitry Osipenko Date: Fri May 20 21:14:32 2022 +0300 dmaengine: pl330: Fix lockdep warning about non-static key The DEFINE_SPINLOCK() macro shouldn't be used for dynamically allocated spinlocks. The lockdep warns about this and disables locking validator. Fix the warning by making lock static. INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. Hardware name: Radxa ROCK Pi 4C (DT) Call trace: dump_backtrace.part.0+0xcc/0xe0 show_stack+0x18/0x6c dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 register_lock_class+0x4a8/0x4cc __lock_acquire+0x78/0x20cc lock_acquire.part.0+0xe0/0x230 lock_acquire+0x68/0x84 _raw_spin_lock_irqsave+0x84/0xc4 add_desc+0x44/0xc0 pl330_get_desc+0x15c/0x1d0 pl330_prep_dma_cyclic+0x100/0x270 snd_dmaengine_pcm_trigger+0xec/0x1c0 dmaengine_pcm_trigger+0x18/0x24 ... Fixes: e588710311ee ("dmaengine: pl330: fix descriptor allocation fail") Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220520181432.149904-1-dmitry.osipenko@collabora.com Signed-off-by: Vinod Koul commit e6fa930f73a15238f3cb0c204e2f786c919b815c Author: Michael Walle Date: Mon Jul 4 17:36:54 2022 +0200 net: lan966x: hardcode the number of external ports Instead of counting the child nodes in the device tree, hardcode the number of ports in the driver itself. The counting won't work at all if an ethernet port is marked as disabled, e.g. because it is not connected on the board at all. It turns out that the LAN9662 and LAN9668 use the same switching IP with the same synthesis parameters. The only difference is that the output ports are not connected. Thus, we can just hardcode the number of physical ports to 8. Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver") Signed-off-by: Michael Walle Reviewed-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220704153654.1167886-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit afe4e376ac5d568367b447ca90c12858d0935b86 Author: Jason Gunthorpe Date: Mon Jul 4 22:10:50 2022 -0300 vfio: Move IOMMU_CAP_CACHE_COHERENCY test to after we know we have a group The test isn't going to work if a group doesn't exist. Normally this isn't a problem since VFIO isn't going to create a device if there is no group, but the special CONFIG_VFIO_NOIOMMU behavior allows bypassing this prevention. The new cap test effectively forces a group and breaks this config option. Move the cap test to vfio_group_find_or_alloc() which is the earliest time we know we have a group available and thus are not running in noiommu mode. Fixes: e8ae0e140c05 ("vfio: Require that devices support DMA cache coherence") Reported-by: Xiang Chen Tested-by: Xiang Chen Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v1-e8934b490f36+f4-vfio_cap_fix_jgg@nvidia.com Signed-off-by: Alex Williamson commit 26c12725b462a4d39a8494554c9713d6fb86f6bd Merge: 029cc0963412c e36bea6e78ab2 Author: Jakub Kicinski Date: Tue Jul 5 14:42:09 2022 -0700 Merge tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix deadlock when powering on. * tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: core: Fix deadlock on hci_power_on_sync. ==================== Link: https://lore.kernel.org/r/20220705202700.1689796-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit e36bea6e78ab2b6c9c7396972fee231eae551cfc Author: Vasyl Vavrychuk Date: Tue Jul 5 15:59:31 2022 +0300 Bluetooth: core: Fix deadlock on hci_power_on_sync. `cancel_work_sync(&hdev->power_on)` was moved to hci_dev_close_sync in commit [1] to ensure that power_on work is canceled after HCI interface down. But, in certain cases power_on work function may call hci_dev_close_sync itself: hci_power_on -> hci_dev_do_close -> hci_dev_close_sync -> cancel_work_sync(&hdev->power_on), causing deadlock. In particular, this happens when device is rfkilled on boot. To avoid deadlock, move power_on work canceling out of hci_dev_do_close/hci_dev_close_sync. Deadlock introduced by commit [1] was reported in [2,3] as broken suspend. Suspend did not work because `hdev->req_lock` held as result of `power_on` work deadlock. In fact, other BT features were not working. It was not observed when testing [1] since it was verified without rfkill in place. NOTE: It is not needed to cancel power_on work from other places where hci_dev_do_close/hci_dev_close_sync is called in case: * Requests were serialized due to `hdev->req_workqueue`. The power_on work is first in that workqueue. * hci_rfkill_set_block which won't close device anyway until HCI_SETUP is on. * hci_sock_release which runs after hci_sock_bind which ensures HCI_SETUP was cleared. As result, behaviour is the same as in pre-dd06ed7 commit, except power_on work cancel added to hci_dev_close. [1]: commit ff7f2926114d ("Bluetooth: core: Fix missing power_on work cancel on HCI close") [2]: https://lore.kernel.org/lkml/20220614181706.26513-1-max.oss.09@gmail.com/ [2]: https://lore.kernel.org/lkml/1236061d-95dd-c3ad-a38f-2dae7aae51ef@o2.pl/ Fixes: ff7f2926114d ("Bluetooth: core: Fix missing power_on work cancel on HCI close") Signed-off-by: Vasyl Vavrychuk Reported-by: Max Krummenacher Reported-by: Mateusz Jonczyk Tested-by: Max Krummenacher Signed-off-by: Luiz Augusto von Dentz commit 8b356e536e69f3a4d6778ae9f0858a1beadabb1f Author: Mario Limonciello Date: Tue Jul 5 13:29:15 2022 -0500 ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") added support for claiming to support CPPC in _OSC on non-Intel platforms. This unfortunately caused a regression on a vartiety of AMD platforms in the field because a number of AMD platforms don't set the `_OSC` bit 5 or 6 to indicate CPPC or CPPC v2 support. As these AMD platforms already claim CPPC support via a dedicated MSR from `X86_FEATURE_CPPC`, use this enable this feature rather than requiring the `_OSC` on platforms with a dedicated MSR. If there is additional breakage on the shared memory designs also missing this _OSC, additional follow up changes may be needed. Fixes: 72f2ecb7ece7 ("Set CPPC _OSC bits for all and when CPPC_LIB is supported") Reported-by: Perry Yuan Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 7feec7430edddb87c24b0a86b08a03d0b496a755 Author: Mario Limonciello Date: Tue Jul 5 13:29:14 2022 -0500 ACPI: CPPC: Only probe for _CPC if CPPC v2 is acked Previously the kernel used to ignore whether the firmware masked CPPC or CPPCv2 and would just pretend that it worked. When support for the USB4 bit in _OSC was introduced from commit 9e1f561afb ("ACPI: Execute platform _OSC also with query bit clear") the kernel began to look at the return when the query bit was clear. This caused regressions that were misdiagnosed and attempted to be solved as part of commit 2ca8e6285250 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag""). This caused a different regression where non-Intel systems weren't able to negotiate _OSC properly. This was reverted in commit 2ca8e6285250 ("Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag"") and attempted to be fixed by commit c42fa24b4475 ("ACPI: bus: Avoid using CPPC if not supported by firmware") but the regression still returned. These systems with the regression only load support for CPPC from an SSDT dynamically when _OSC reports CPPC v2. Avoid the problem by not letting CPPC satisfy the requirement in `acpi_cppc_processor_probe`. Reported-by: CUI Hao Reported-by: maxim.novozhilov@gmail.com Reported-by: lethe.tree@protonmail.com Reported-by: garystephenwright@gmail.com Reported-by: galaxyking0419@gmail.com Fixes: c42fa24b4475 ("ACPI: bus: Avoid using CPPC if not supported by firmware") Fixes: 2ca8e6285250 ("Revert "ACPI Pass the same capabilities to the _OSC regardless of the query flag"") Link: https://bugzilla.kernel.org/show_bug.cgi?id=213023 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2075387 Reviewed-by: Mika Westerberg Tested-by: CUI Hao Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit e35e5b6f695d241ffb1d223207da58a1fbcdff4b Merge: c1084b6c5620a b75cd218274e0 Author: Linus Torvalds Date: Tue Jul 5 09:18:32 2022 -0700 Merge tag 'xsa-5.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen security fixes from Juergen Gross: - XSA-403 (4 patches for blkfront and netfront drivers): Linux Block and Network PV device frontends don't zero memory regions before sharing them with the backend (CVE-2022-26365, CVE-2022-33740). Additionally the granularity of the grant table doesn't allow sharing less than a 4K page, leading to unrelated data residing in the same 4K page as data shared with a backend being accessible by such backend (CVE-2022-33741, CVE-2022-33742). - XSA-405 (1 patch for netfront driver, only 5.10 and newer): While adding logic to support XDP (eXpress Data Path), a code label was moved in a way allowing for SKBs having references (pointers) retained for further processing to nevertheless be freed. - XSA-406 (1 patch for Arm specific dom0 code): When mapping pages of guests on Arm, dom0 is using an rbtree to keep track of the foreign mappings. Updating of that rbtree is not always done completely with the related lock held, resulting in a small race window, which can be used by unprivileged guests via PV devices to cause inconsistencies of the rbtree. These inconsistencies can lead to Denial of Service (DoS) of dom0, e.g. by causing crashes or the inability to perform further mappings of other guests' memory pages. * tag 'xsa-5.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/arm: Fix race in RB-tree based P2M accounting xen-netfront: restore __skb_queue_tail() positioning in xennet_get_responses() xen/blkfront: force data bouncing when backend is untrusted xen/netfront: force data bouncing when backend is untrusted xen/netfront: fix leaking data in shared pages xen/blkfront: fix leaking data in shared pages commit efa310ba00716d7a872bdc5fa1f5545edc9efd69 Author: Conor Dooley Date: Wed Jun 29 21:07:33 2022 +0100 riscv: dts: microchip: hook up the mpfs' l2cache The initial PolarFire SoC devicetree must have been forked off from the fu540 one prior to the addition of l2cache controller support being added there. When the controller node was added to mpfs.dtsi, it was not hooked up to the CPUs & thus sysfs reports an incorrect cache configuration. Hook it up. Fixes: 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board") Reviewed-by: Sudeep Holla Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley commit c5e58c4545a69677d078b4c813b5d10d3481be9c Author: Takashi Iwai Date: Tue Jul 5 17:23:36 2022 +0200 ALSA: cs46xx: Fix missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 5bff69b3645d ("ALSA: cs46xx: Allocate resources with device-managed APIs") Cc: Reported-and-tested-by: Jan Engelhardt Link: https://lore.kernel.org/r/p2p1s96o-746-74p4-s95-61qo1p7782pn@vanv.qr Link: https://lore.kernel.org/r/20220705152336.350-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 85e4ea1049c70fb99de5c6057e835d151fb647da Author: David Howells Date: Wed Apr 20 14:27:17 2022 +0100 fscache: Fix invalidation/lookup race If an NFS file is opened for writing and closed, fscache_invalidate() will be asked to invalidate the file - however, if the cookie is in the LOOKING_UP state (or the CREATING state), then request to invalidate doesn't get recorded for fscache_cookie_state_machine() to do something with. Fix this by making __fscache_invalidate() set a flag if it sees the cookie is in the LOOKING_UP state to indicate that we need to go to invalidation. Note that this requires a count on the n_accesses counter for the state machine, which that will release when it's done. fscache_cookie_state_machine() then shifts to the INVALIDATING state if it sees the flag. Without this, an nfs file can get corrupted if it gets modified locally and then read locally as the cache contents may not get updated. Fixes: d24af13e2e23 ("fscache: Implement cookie invalidation") Reported-by: Max Kellermann Signed-off-by: David Howells Tested-by: Max Kellermann Link: https://lore.kernel.org/r/YlWWbpW5Foynjllo@rabbit.intern.cm-ag [1] commit 65aa5f6fd8a12e0a343aaf1815949a79a49e3f35 Author: Jia Zhu Date: Thu Jun 9 16:54:10 2022 +0800 cachefiles: narrow the scope of flushed requests when releasing fd When an anonymous fd is released, only flush the requests associated with it, rather than all of requests in xarray. Fixes: 9032b6e8589f ("cachefiles: implement on-demand read") Signed-off-by: Jia Zhu Signed-off-by: David Howells Reviewed-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://listman.redhat.com/archives/linux-cachefs/2022-June/006937.html commit 5c4588aea6675b69e328d468c5b6be5127e19a79 Author: Yue Hu Date: Wed May 25 10:51:50 2022 +0800 fscache: Introduce fscache_cookie_is_dropped() FSCACHE_COOKIE_STATE_DROPPED will be read more than once, so let's add a helper to avoid code duplication. Signed-off-by: Yue Hu Signed-off-by: David Howells Link: https://listman.redhat.com/archives/linux-cachefs/2022-May/006919.html commit bf17455b9cbd4b10bf30d39c047307e1d774fb1a Author: Yue Hu Date: Wed May 25 10:32:22 2022 +0800 fscache: Fix if condition in fscache_wait_on_volume_collision() After waiting for the volume to complete the acquisition with timeout, the if condition under which potential volume collision occurs should be acquire the volume is still pending rather than not pending so that we will continue to wait until the pending flag is cleared. Also, use the existing test pending wrapper directly instead of test_bit(). Fixes: 62ab63352350 ("fscache: Implement volume registration") Signed-off-by: Yue Hu Signed-off-by: David Howells Reviewed-by: Gao Xiang Reviewed-by: Jeffle Xu Reviewed-by: Jeff Layton Link: https://listman.redhat.com/archives/linux-cachefs/2022-May/006918.html commit 8af3a0b23818af59971f538bf258c15e1033ea55 Author: Leon Romanovsky Date: Tue Jul 5 13:21:14 2022 +0300 gpio: vf610: fix compilation error Fix compilation error by explicitly adding the missing include. drivers/gpio/gpio-vf610.c: In function ‘vf610_gpio_direction_input’: drivers/gpio/gpio-vf610.c:120:9: error: implicit declaration of function ‘pinctrl_gpio_direction_input’; did you mean ‘vf610_gpio_direction_input’? [-Werror=implicit-function-declaration] 120 | return pinctrl_gpio_direction_input(chip->base + gpio); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | vf610_gpio_direction_input Fixes: 30a35c07d9e9 ("gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610") Signed-off-by: Leon Romanovsky Signed-off-by: Tariq Toukan Reviewed-by: Andy Shevchenko Reviewed-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 8ffccd119a5908b240a26182be44c0ff3d1e3d85 Author: Jerry Snitselaar Date: Sat Jun 25 22:16:48 2022 -0700 dmaengine: idxd: Only call idxd_enable_system_pasid() if succeeded in enabling SVA feature On a Sapphire Rapids system if boot without intel_iommu=on, the IDXD driver will crash during probe in iommu_sva_bind_device(). [ 21.423729] BUG: kernel NULL pointer dereference, address: 0000000000000038 [ 21.445108] #PF: supervisor read access in kernel mode [ 21.450912] #PF: error_code(0x0000) - not-present page [ 21.456706] PGD 0 [ 21.459047] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 21.464004] CPU: 0 PID: 1420 Comm: kworker/0:3 Not tainted 5.19.0-0.rc3.27.eln120.x86_64 #1 [ 21.464011] Hardware name: Intel Corporation EAGLESTREAM/EAGLESTREAM, BIOS EGSDCRB1.SYS.0067.D12.2110190954 10/19/2021 [ 21.464015] Workqueue: events work_for_cpu_fn [ 21.464030] RIP: 0010:iommu_sva_bind_device+0x1d/0xe0 [ 21.464046] Code: c3 cc 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 57 41 56 49 89 d6 41 55 41 54 55 53 48 83 ec 08 48 8b 87 d8 02 00 00 <48> 8b 40 38 48 8b 50 10 48 83 7a 70 00 48 89 14 24 0f 84 91 00 00 [ 21.464050] RSP: 0018:ff7245d9096b7db8 EFLAGS: 00010296 [ 21.464054] RAX: 0000000000000000 RBX: ff1eadeec8a51000 RCX: 0000000000000000 [ 21.464058] RDX: ff7245d9096b7e24 RSI: 0000000000000000 RDI: ff1eadeec8a510d0 [ 21.464060] RBP: ff1eadeec8a51000 R08: ffffffffb1a12300 R09: ff1eadffbfce25b4 [ 21.464062] R10: ffffffffffffffff R11: 0000000000000038 R12: ffffffffc09f8000 [ 21.464065] R13: ff1eadeec8a510d0 R14: ff7245d9096b7e24 R15: ff1eaddf54429000 [ 21.464067] FS: 0000000000000000(0000) GS:ff1eadee7f600000(0000) knlGS:0000000000000000 [ 21.464070] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 21.464072] CR2: 0000000000000038 CR3: 00000008c0e10006 CR4: 0000000000771ef0 [ 21.464074] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 21.464076] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 [ 21.464078] PKRU: 55555554 [ 21.464079] Call Trace: [ 21.464083] [ 21.464092] idxd_pci_probe+0x259/0x1070 [idxd] [ 21.464121] local_pci_probe+0x3e/0x80 [ 21.464132] work_for_cpu_fn+0x13/0x20 [ 21.464136] process_one_work+0x1c4/0x380 [ 21.464143] worker_thread+0x1ab/0x380 [ 21.464147] ? _raw_spin_lock_irqsave+0x23/0x50 [ 21.464158] ? process_one_work+0x380/0x380 [ 21.464161] kthread+0xe6/0x110 [ 21.464168] ? kthread_complete_and_exit+0x20/0x20 [ 21.464172] ret_from_fork+0x1f/0x30 iommu_sva_bind_device() requires SVA has been enabled successfully on the IDXD device before it's called. Otherwise, iommu_sva_bind_device() will access a NULL pointer. If Intel IOMMU is disabled, SVA cannot be enabled and thus idxd_enable_system_pasid() and iommu_sva_bind_device() should not be called. Fixes: 42a1b73852c4 ("dmaengine: idxd: Separate user and kernel pasid enabling") Cc: Vinod Koul Cc: linux-kernel@vger.kernel.org Cc: Dave Jiang Cc: Fenghua Yu Link: https://lore.kernel.org/dmaengine/20220623170232.6whonfjuh3m5vcoy@cantor/ Signed-off-by: Jerry Snitselaar Acked-by: Fenghua Yu Link: https://lore.kernel.org/r/20220626051648.14249-1-jsnitsel@redhat.com Signed-off-by: Vinod Koul commit 3770d92bd5237d686e49da7b2fb86f53ee6ed259 Author: Michael Walle Date: Thu May 26 15:51:11 2022 +0200 dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly It seems that it is valid to have less than the requested number of descriptors. But what is not valid and leads to subsequent errors is to have zero descriptors. In that case, abort the probing. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220526135111.1470926-1-michael@walle.cc Signed-off-by: Vinod Koul commit 029cc0963412c4f989d2731759ce4578f7e1a667 Merge: 7e8c182c36e23 83844aacab201 Author: Paolo Abeni Date: Tue Jul 5 11:52:35 2022 +0200 Merge branch 'fix-bridge_vlan_aware-sh-and-bridge_vlan_unaware-sh-with-iff_unicast_flt' Vladimir Oltean says: ==================== Fix bridge_vlan_aware.sh and bridge_vlan_unaware.sh with IFF_UNICAST_FLT Make sure that h1 and h2 don't drop packets with a random MAC DA, which otherwise confuses these selftests. Also, fix an incorrect error message found during those failures. ==================== Link: https://lore.kernel.org/r/20220703073626.937785-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit 83844aacab2015da1dba1df0cc61fc4b4c4e8076 Author: Vladimir Oltean Date: Sun Jul 3 10:36:26 2022 +0300 selftests: forwarding: fix error message in learning_test When packets are not received, they aren't received on $host1_if, so the message talking about the second host not receiving them is incorrect. Fix it. Fixes: d4deb01467ec ("selftests: forwarding: Add a test for FDB learning") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Signed-off-by: Paolo Abeni commit 1a635d3e1c80626237fdae47a5545b6655d8d81c Author: Vladimir Oltean Date: Sun Jul 3 10:36:25 2022 +0300 selftests: forwarding: fix learning_test when h1 supports IFF_UNICAST_FLT The first host interface has by default no interest in receiving packets MAC DA de:ad:be:ef:13:37, so it might drop them before they hit the tc filter and this might confuse the selftest. Enable promiscuous mode such that the filter properly counts received packets. Fixes: d4deb01467ec ("selftests: forwarding: Add a test for FDB learning") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Paolo Abeni commit b8e629b05f5d23f9649c901bef09fab8b0c2e4b9 Author: Vladimir Oltean Date: Sun Jul 3 10:36:24 2022 +0300 selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT As mentioned in the blamed commit, flood_unicast_test() works by checking the match count on a tc filter placed on the receiving interface. But the second host interface (host2_if) has no interest in receiving a packet with MAC DA de:ad:be:ef:13:37, so its RX filter drops it even before the ingress tc filter gets to be executed. So we will incorrectly get the message "Packet was not flooded when should", when in fact, the packet was flooded as expected but dropped due to an unrelated reason, at some other layer on the receiving side. Force h2 to accept this packet by temporarily placing it in promiscuous mode. Alternatively we could either deliver to its MAC address or use tcpdump_start, but this has the fewest complications. This fixes the "flooding" test from bridge_vlan_aware.sh and bridge_vlan_unaware.sh, which calls flood_test from the lib. Fixes: 236dd50bf67a ("selftests: forwarding: Add a test for flooded traffic") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Paolo Abeni commit 7e8c182c36e2366b7402d3913bf717eac04e458d Merge: 1b18f09d31cfa 1c0e78a287e34 Author: Jakub Kicinski Date: Mon Jul 4 20:21:01 2022 -0700 Merge tag 'linux-can-fixes-for-5.19-20220704' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== can 2022-07-04 The 1st patch is by Oliver Hartkopp, targets the BCM CAN protocol and converts a costly synchronize_rcu() to call_rcu() to fix a performance regression. Srinivas Neeli's patch for the xilinx_can driver drops the brp limit down to 1, as only the pre-production silicon have an issue with a brp of 1. The next patch is by Duy Nguyen and fixes the data transmission on R-Car V3U SoCs in the rcar_canfd driver. Rhett Aultman's patch fixes a DMA memory leak in the gs_usb driver. Liang He's patch removes an extra of_node_get() in the grcan driver. The next 2 patches are by me, target the m_can driver and fix the timestamp handling used for peripheral devices like the tcan4x5x. Jimmy Assarsson contributes 3 patches for the kvaser_usb driver and fixes CAN clock and bit timing related issues. The remaining 5 patches target the mcp251xfd driver. Thomas Kopp contributes 2 patches to improve the workaround for broken CRC when reading the TBC register. 3 patches by me add a missing hrtimer_cancel() during the ndo_stop() callback, and fix the reading of the Device ID register. * tag 'linux-can-fixes-for-5.19-20220704' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix endianness conversion can: mcp251xfd: mcp251xfd_register_get_dev_id(): use correct length to read dev_id can: mcp251xfd: mcp251xfd_stop(): add missing hrtimer_cancel() can: mcp251xfd: mcp251xfd_regmap_crc_read(): update workaround broken CRC on TBC register can: mcp251xfd: mcp251xfd_regmap_crc_read(): improve workaround handling for mcp2517fd can: kvaser_usb: kvaser_usb_leaf: fix bittiming limits can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression can: kvaser_usb: replace run-time checks with struct kvaser_usb_driver_info can: m_can: m_can_{read_fifo,echo_tx_event}(): shift timestamp to full 32 bits can: m_can: m_can_chip_config(): actually enable internal timestamping can: grcan: grcan_probe(): remove extra of_node_get() can: gs_usb: gs_usb_open/close(): fix memory leak can: rcar_canfd: Fix data transmission failed on R-Car V3U Revert "can: xilinx_can: Limit CANFD brp to 2" can: bcm: use call_rcu() instead of costly synchronize_rcu() ==================== Link: https://lore.kernel.org/r/20220704122613.1551119-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit e95ea0f687e679fcb0a3a67d0755b81ee7d60db0 Author: Kris Bahnsen Date: Thu Jun 30 14:03:27 2022 -0700 ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count Device-tree incorrectly used "ngpio" which caused the driver to fallback to 32 ngpios. This platform has 62 GPIO registers. Fixes: 9ff8e9fccef9 ("ARM: dts: TS-7970: add basic device tree") Signed-off-by: Kris Bahnsen Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3c12e9da3098a30fc82dea01768d355c28e3692d Author: Sean Anderson Date: Thu Apr 28 14:16:59 2022 -0400 arm64: dts: ls1028a: Update SFP node to include clock The clocks property is now mandatory. Add it to avoid warning message. Signed-off-by: Sean Anderson Reviewed-by: Michael Walle Fixes: eba5bea8f37f ("arm64: dts: ls1028a: add efuse node") Signed-off-by: Shawn Guo commit 79471f29ec4870bc02b4fea844e86669a8a4f2a5 Author: Samuel Holland Date: Fri Jul 1 22:29:21 2022 -0500 dt-bindings: display: sun4i: Fix D1 pipeline count When adding the bindings for the D1 display engine, I missed the condition for the number of pipelines. D1 has two mixers, so it will have two pipeline references. Fixes: ae5a5d26c15c ("dt-bindings: display: Add D1 display engine compatibles") Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220702032921.22433-1-samuel@sholland.org commit c1084b6c5620a743f86947caca66d90f24060f56 Merge: 88084a3df1672 c0d1a7bd6574c Author: Linus Torvalds Date: Mon Jul 4 10:41:59 2022 -0700 Merge tag 'soc-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Another set of minor patches for Arm DTS files and soc specific drivers: - More reference counting bug fixes for DT nodes, and other trivial code fixes - Multiple code fixes for the Arm SCMI firmware driver to improve compatibility with firmware implementations. - A patch series for at91 to address power management issues from using the wrong DT compatible properties. - A series of patches to fix pad settings for NXP imx8mp to leave the configuration untouched from the boot loader - Additional DT fixes for qualcomm and NXP platforms - A boot time fix for stm32mp15 DT - Konrad Dybcio becomes an additional reviewer for the Qualcomm platforms" * tag 'soc-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (42 commits) soc: qcom: smem: use correct format characters ARM: dts: stm32: add missing usbh clock and fix clk order on stm32mp15 ARM: dts: stm32: delete fixed clock node on STM32MP15-SCMI ARM: dts: stm32: DSI should use LSE SCMI clock on DK1/ED1 STM32 board ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 ARM: dts: stm32: fix pwr regulators references to use scmi soc: ixp4xx/npe: Fix unused match warning ARM: at91: pm: Mark at91_pm_secure_init as __init ARM: at91: fix soc detection for SAM9X60 SiPs ARM: dts: at91: sama5d2_icp: fix eeprom compatibles ARM: dts: at91: sam9x60ek: fix eeprom compatible and size ARM: at91: pm: use proper compatibles for sama7g5's rtc and rtt ARM: at91: pm: use proper compatibles for sam9x60's rtc and rtt ARM: at91: pm: use proper compatible for sama5d2's rtc arm64: dts: qcom: msm8992-*: Fix vdd_lvs1_2-supply typo firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API firmware: arm_scmi: Fix response size warning for OPTEE transport arm64: dts: imx8mp-icore-mx8mp-edim2.2: correct pad settings arm64: dts: imx8mp-phyboard-pollux-rdk: correct i2c2 & mmc settings arm64: dts: imx8mp-phyboard-pollux-rdk: correct eqos pad settings ... commit 9fc33eaaa979d112d10fea729edcd2a2e21aa912 Author: Dmitry Osipenko Date: Thu Jun 30 23:06:01 2022 +0300 drm/panfrost: Fix shrinker list corruption by madvise IOCTL Calling madvise IOCTL twice on BO causes memory shrinker list corruption and crashes kernel because BO is already on the list and it's added to the list again, while BO should be removed from the list before it's re-added. Fix it. Cc: stable@vger.kernel.org Fixes: 013b65101315 ("drm/panfrost: Add madvise and shrinker support") Acked-by: Alyssa Rosenzweig Reviewed-by: Steven Price Signed-off-by: Dmitry Osipenko Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220630200601.1884120-3-dmitry.osipenko@collabora.com commit fb6e0637ab7ebd8e61fe24f4d663c4bae99cfa62 Author: Dmitry Osipenko Date: Thu Jun 30 23:06:00 2022 +0300 drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error When panfrost_mmu_map_fault_addr() fails, the BO's mapping should be unreferenced and not the shmem object which backs the mapping. Cc: stable@vger.kernel.org Fixes: bdefca2d8dc0 ("drm/panfrost: Add the panfrost_gem_mapping concept") Reviewed-by: Steven Price Signed-off-by: Dmitry Osipenko Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220630200601.1884120-2-dmitry.osipenko@collabora.com commit 8490cad4dc4e2ee265ba9e12cd47bdfd6b9a3d34 Author: Steven Price Date: Wed Jun 15 16:48:30 2022 +0100 drm/rockchip: Detach from ARM DMA domain in attach_device Since commit 1ea2a07a532b ("iommu: Add DMA ownership management interfaces") the Rockchip display driver on the Firefly RK3288 fails to initialise properly. This is because ARM DMA domain is still attached. Let's follow the lead of exynos and tegra and add code to explicitly remove the ARM domain before attaching a new one. Fixes: 1ea2a07a532b ("iommu: Add DMA ownership management interfaces") Suggested-by: Robin Murphy Signed-off-by: Steven Price Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220615154830.555422-1-steven.price@arm.com commit 1dbc790b4d416dacb124a6acd05f88a0bcf3be39 Author: Liu Ying Date: Fri Jul 1 14:56:34 2022 +0800 drm/bridge: fsl-ldb: Drop DE signal polarity inversion It's unnecessary to invert input data enable signal polarity according to the output one. Let's drop the inversion. Since ->atomic_check() does nothing more than the inversion, it can be dropped entirely as well. Without this patch, 'koe,tx26d202vm0bwa' LVDS panel connected with i.MX8MP EVK board does not show any data on screen. Fixes: 463db5c2ed4a ("drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge") Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Marek Vasut Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Marek Vasut Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220701065634.4027537-4-victor.liu@nxp.com commit 57ef278ef125e9188474a164f35dcffc69836d01 Author: Liu Ying Date: Fri Jul 1 14:56:33 2022 +0800 drm/bridge: fsl-ldb: Enable split mode for LVDS dual link When LVDS dual link is used, we have to enable the LDB_CTRL_SPLIT_MODE bit. Fixes: 463db5c2ed4a ("drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge") Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Marek Vasut Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Marek Vasut Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220701065634.4027537-3-victor.liu@nxp.com commit 591129d3db266648823bb953ebbc28c92e059bf3 Author: Liu Ying Date: Fri Jul 1 14:56:32 2022 +0800 drm/bridge: fsl-ldb: Fix mode clock rate validation With LVDS dual link, up to 160MHz mode clock rate is supported. With LVDS single link, up to 80MHz mode clock rate is supported. Fix mode clock rate validation by swapping the maximum mode clock rates of the two link modes. Fixes: 463db5c2ed4a ("drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge") Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Marek Vasut Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Marek Vasut Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220701065634.4027537-2-victor.liu@nxp.com commit c0d1a7bd6574c8805184468c736e26dc416bebf0 Merge: 0ec29ccf94eb4 1d0c1aadf1fd9 Author: Arnd Bergmann Date: Mon Jul 4 14:29:17 2022 +0200 Merge tag 'stm32-dt-for-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/fixes STM32 DT fixes for v5.19, round 2 Highlights: ----------- -Fixes STM32MP15: - Add missing usbh clock and fix clk order for usbh to avoid PLL issue. - Fix SCMI version: use scmi regulator and update missing SCMI clocks to be able to correcly boot. * tag 'stm32-dt-for-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: dts: stm32: add missing usbh clock and fix clk order on stm32mp15 ARM: dts: stm32: delete fixed clock node on STM32MP15-SCMI ARM: dts: stm32: DSI should use LSE SCMI clock on DK1/ED1 STM32 board ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 ARM: dts: stm32: fix pwr regulators references to use scmi Link: https://lore.kernel.org/r/1259e082-a3a4-96a5-ec9c-05dbb893a746@foss.st.com Signed-off-by: Arnd Bergmann commit 0ec29ccf94eb4c32570555a882575eca9eec6467 Author: Bill Wendling Date: Mon Mar 21 10:49:12 2022 -0700 soc: qcom: smem: use correct format characters When compiling with -Wformat, clang emits the following warnings: drivers/soc/qcom/smem.c:847:41: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "bad host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./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/soc/qcom/smem.c:852:47: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat] dev_err(smem->dev, "duplicate host %hu\n", remote_host); ~~~ ^~~~~~~~~~~ %u ./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__); \ ~~~ ^~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct one and change type of remote_host to "u16" to match with other types. Signed-off-by: Bill Wendling Tested-by: Justin Stitt Reviewed-by: Justin Stitt Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Arnd Bergmann commit dd84cfff3cc3b79c9d616f85bd1178df135cbd1a Merge: 2307a0e1ca0b5 980555e95f7ca Author: Takashi Iwai Date: Mon Jul 4 14:14:04 2022 +0200 Merge tag 'asoc-fix-v5.19-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.19 A collection of fixes for v5.19, quite large but nothing major - a good chunk of it is more stuff that was identified by mixer-test regarding event generation. commit 2307a0e1ca0b5c1337b37ac6302f96e017ebac3c Author: Egor Vorontsov Date: Mon Jun 27 13:00:35 2022 +0300 ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0) The patch applies the same quirks used for SC-01 at firmware v1.1.0 to the ones running v1.0.0, with respect to hard-coded sample rates. I got two more units and successfully tested the patch series with both firmwares. The support is now complete (not accounting ASIO). Signed-off-by: Egor Vorontsov Link: https://lore.kernel.org/r/20220627100041.2861494-2-sdoregor@sdore.me Signed-off-by: Takashi Iwai commit 4fb7c24f69c48fdc02ea7858dbd5a60ff08bf7e5 Author: Egor Vorontsov Date: Mon Jun 27 13:00:34 2022 +0300 ALSA: usb-audio: Add quirk for Fiero SC-01 Fiero SC-01 is a USB sound card with two mono inputs and a single stereo output. The inputs are composed into a single stereo stream. The device uses a vendor-provided driver on Windows and does not work at all without it. The driver mostly provides ASIO functionality, but also alters the way the sound card is queried for sample rates and clocks. ALSA queries those failing with an EPIPE (same as Windows 10 does). Presumably, the vendor-provided driver does not query it at all, simply matching by VID:PID. Thus, I consider this a buggy firmware and adhere to a set of fixed endpoint quirks instead. The soundcard has an internal clock. Implicit feedback mode is required for the playback. I have updated my device to v1.1.0 from a Windows 10 VM using a vendor- provided binary prior to the development, hoping for it to just begin working. The device provides no obvious way to downgrade the firmware, and regardless, there's no binary available for v1.0.0 anyway. Thus, I will be getting another unit to extend the patch with support for that. Expected to be a simple copy-paste of the existing one, though. There were no previous reports of that device in context of Linux anywhere. Other issues have been reported though, but that's out of the scope. Signed-off-by: Egor Vorontsov Link: https://lore.kernel.org/r/20220627100041.2861494-1-sdoregor@sdore.me Signed-off-by: Takashi Iwai commit 11bea26929a1a3a9dd1a287b60c2f471701bf706 Author: Tim Crawford Date: Fri Jun 24 08:41:09 2022 -0600 ALSA: hda/realtek: Add quirk for Clevo L140PU Fixes headset detection on Clevo L140PU. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220624144109.3957-1-tcrawford@system76.com Signed-off-by: Takashi Iwai commit 6e2c9105e0b743c92a157389d40f00b81bdd09fe Author: John Veness Date: Fri Jun 24 15:07:57 2022 +0100 ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices Treat the claimed 96kHz 1ch in the descriptors as 48kHz 2ch, so that the audio stream doesn't sound mono. Also fix initial stream alignment, so that left and right channels are in the correct order. Signed-off-by: John Veness Link: https://lore.kernel.org/r/20220624140757.28758-1-john-linux@pelago.org.uk Signed-off-by: Takashi Iwai commit bf43e4521ff3223a613f3a496991a22a4d78e04b Author: Thomas Zimmermann Date: Fri Jun 17 14:10:27 2022 +0200 drm/aperture: Run fbdev removal before internal helpers Always run fbdev removal first to remove simpledrm via sysfb_disable(). This clears the internal state. The later call to drm_aperture_detach_drivers() then does nothing. Otherwise, with drm_aperture_detach_drivers() running first, the call to sysfb_disable() uses inconsistent state. Example backtrace show below: [ 11.663422] ================================================================== [ 11.663426] BUG: KASAN: use-after-free in device_del+0x79/0x5f0 [ 11.663435] Read of size 8 at addr ffff888108185050 by task systemd-udevd/311 [ 11.663440] CPU: 0 PID: 311 Comm: systemd-udevd Tainted: G E 5 .19.0-rc2-1-default+ #1689 [ 11.663445] Hardware name: HP ProLiant DL120 G7, BIOS J01 04/21/2011 [ 11.663447] Call Trace: [ 11.663449] [ 11.663451] ? device_del+0x79/0x5f0 [ 11.663456] dump_stack_lvl+0x5b/0x73 [ 11.663462] print_address_description.constprop.0+0x1f/0x1b0 [ 11.663468] ? device_del+0x79/0x5f0 [ 11.663471] ? device_del+0x79/0x5f0 [ 11.663475] print_report.cold+0x3c/0x21c [ 11.663481] ? lock_acquired+0x87/0x1e0 [ 11.663484] ? lock_acquired+0x87/0x1e0 [ 11.663489] ? device_del+0x79/0x5f0 [ 11.663492] kasan_report+0xbf/0xf0 [ 11.663498] ? device_del+0x79/0x5f0 [ 11.663503] device_del+0x79/0x5f0 [ 11.663509] ? device_remove_attrs+0x170/0x170 [ 11.663514] ? lock_is_held_type+0xe8/0x140 [ 11.663523] platform_device_del.part.0+0x19/0xe0 [ 11.663530] platform_device_unregister+0x1c/0x30 [ 11.663535] sysfb_disable+0x2d/0x70 [ 11.663540] remove_conflicting_framebuffers+0x1c/0xf0 [ 11.663546] remove_conflicting_pci_framebuffers+0x130/0x1a0 [ 11.663554] drm_aperture_remove_conflicting_pci_framebuffers+0x86/0xb0 [ 11.663561] ? mgag200_pci_remove+0x30/0x30 [mgag200] [ 11.663578] mgag200_pci_probe+0x2d/0x140 [mgag200] Reported-by: Zack Rusin Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Zack Rusin Fixes: ee7a69aa38d8 ("fbdev: Disable sysfb device registration when removing conflicting FBs") Cc: Javier Martinez Canillas Cc: Daniel Vetter Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Helge Deller Cc: Thomas Zimmermann Cc: Alex Deucher Cc: Zhen Lei Cc: Changcheng Deng Link: https://patchwork.freedesktop.org/patch/msgid/20220617121027.30273-1-tzimmermann@suse.de (cherry picked from commit fb84efa28a48e30b87fa1122e8aab8016c7347cd) Signed-off-by: Thomas Zimmermann commit 887502826549caa7e4215fd9e628f48f14c0825a Author: Jason A. Donenfeld Date: Thu Jun 30 14:16:54 2022 +0200 powerpc/powernv: delay rng platform device creation until later in boot The platform device for the rng must be created much later in boot. Otherwise it tries to connect to a parent that doesn't yet exist, resulting in this splat: [ 0.000478] kobject: '(null)' ((____ptrval____)): is not initialized, yet kobject_get() is being called. [ 0.002925] [c000000002a0fb30] [c00000000073b0bc] kobject_get+0x8c/0x100 (unreliable) [ 0.003071] [c000000002a0fba0] [c00000000087e464] device_add+0xf4/0xb00 [ 0.003194] [c000000002a0fc80] [c000000000a7f6e4] of_device_add+0x64/0x80 [ 0.003321] [c000000002a0fcb0] [c000000000a800d0] of_platform_device_create_pdata+0xd0/0x1b0 [ 0.003476] [c000000002a0fd00] [c00000000201fa44] pnv_get_random_long_early+0x240/0x2e4 [ 0.003623] [c000000002a0fe20] [c000000002060c38] random_init+0xc0/0x214 This patch fixes the issue by doing the platform device creation inside of machine_subsys_initcall. Fixes: f3eac426657d ("powerpc/powernv: wire up rng during setup_arch") Cc: stable@vger.kernel.org Reported-by: Sachin Sant Signed-off-by: Jason A. Donenfeld Tested-by: Sachin Sant [mpe: Change "of node" to "platform device" in change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220630121654.1939181-1-Jason@zx2c4.com commit 1c0e78a287e3493e22bde8553d02f3b89177eaf7 Author: Marc Kleine-Budde Date: Mon Jun 20 11:49:24 2022 +0200 can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix endianness conversion In mcp251xfd_register_get_dev_id() the device ID register is read with handcrafted SPI transfers. As all registers, this register is in little endian. Further it is not naturally aligned in struct mcp251xfd_map_buf_nocrc::data. However after the transfer the register content is converted from big endian to CPU endianness not taking care of being unaligned. Fix the conversion by converting from little endian to CPU endianness taking the unaligned source into account. Side note: So far the register content is 0x0 on all mcp251xfd compatible chips, and is only used for an informative printk. Link: https://lore.kernel.org/all/20220627092859.809042-1-mkl@pengutronix.de Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Reviewed-by: Rasmus Villemoes Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde commit 0ff32bfa0e794ccc3601de7158b522bf736fa63c Author: Marc Kleine-Budde Date: Thu Jun 16 11:38:00 2022 +0200 can: mcp251xfd: mcp251xfd_register_get_dev_id(): use correct length to read dev_id The device ID register is 32 bits wide. The driver uses incorrectly the size of a pointer to a u32 to calculate the length of the SPI transfer. This results in a read of 2 registers on 64 bit platforms. This is no problem on the Linux side, as the RX buffer of the SPI transfer is large enough. In the mpc251xfd chip this results in the read of an undocumented register. So far no problems were observed. Fix the length of the SPI transfer to read the device ID register only. Link: https://lore.kernel.org/all/20220616094914.244440-1-mkl@pengutronix.de Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Reported-by: Rasmus Villemoes Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde commit d5a972f561a003e302e4267340c57e8fbd096fa4 Author: Marc Kleine-Budde Date: Mon Jun 6 14:46:18 2022 +0200 can: mcp251xfd: mcp251xfd_stop(): add missing hrtimer_cancel() In commit 169d00a25658 ("can: mcp251xfd: add TX IRQ coalescing support") software based TX coalescing was added to the driver. The key idea is to keep the TX complete IRQ disabled for some time after processing it and re-enable later by a hrtimer. When bringing the interface down, this timer has to be stopped. Add the missing hrtimer_cancel() of the tx_irq_time hrtimer to mcp251xfd_stop(). Link: https://lore.kernel.org/all/20220620143942.891811-1-mkl@pengutronix.de Fixes: 169d00a25658 ("can: mcp251xfd: add TX IRQ coalescing support") Cc: stable@vger.kernel.org # v5.18 Reviewed-by: Manivannan Sadhasivam Signed-off-by: Marc Kleine-Budde commit e3d4ee7d5f7f5256dfe89219afcc7a2d553b731f Author: Thomas Kopp Date: Tue Dec 21 22:24:52 2021 +0000 can: mcp251xfd: mcp251xfd_regmap_crc_read(): update workaround broken CRC on TBC register The mcp251xfd compatible chips have an erratum ([1], [2]), where the received CRC doesn't match the calculated CRC. In commit c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") the following workaround was implementierend. - If a CRC read error on the TBC register is detected and the first byte is 0x00 or 0x80, the most significant bit of the first byte is flipped and the CRC is calculated again. - If the CRC now matches, the _original_ data is passed to the reader. For now we assume transferred data was OK. New investigations and simulations indicate that the CRC send by the device is calculated on correct data, and the data is incorrectly received by the SPI host controller. Use flipped instead of original data and update workaround description in mcp251xfd_regmap_crc_read(). [1] mcp2517fd: DS80000792C: "Incorrect CRC for certain READ_CRC commands" [2] mcp2518fd: DS80000789C: "Incorrect CRC for certain READ_CRC commands" Link: https://lore.kernel.org/all/DM4PR11MB53901D49578FE265B239E55AFB7C9@DM4PR11MB5390.namprd11.prod.outlook.com Fixes: c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") Cc: stable@vger.kernel.org Signed-off-by: Thomas Kopp [mkl: split into 2 patches, update patch description and documentation] Signed-off-by: Marc Kleine-Budde commit 406cc9cdb3e8d644b15e8028948f091b82abdbca Author: Thomas Kopp Date: Tue Dec 21 22:24:52 2021 +0000 can: mcp251xfd: mcp251xfd_regmap_crc_read(): improve workaround handling for mcp2517fd The mcp251xfd compatible chips have an erratum ([1], [2]), where the received CRC doesn't match the calculated CRC. In commit c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") the following workaround was implementierend. - If a CRC read error on the TBC register is detected and the first byte is 0x00 or 0x80, the most significant bit of the first byte is flipped and the CRC is calculated again. - If the CRC now matches, the _original_ data is passed to the reader. For now we assume transferred data was OK. Measurements on the mcp2517fd show that the workaround is applicable not only of the lowest byte is 0x00 or 0x80, but also if 3 least significant bits are set. Update check on 1st data byte and workaround description accordingly. [1] mcp2517fd: DS80000792C: "Incorrect CRC for certain READ_CRC commands" [2] mcp2518fd: DS80000789C: "Incorrect CRC for certain READ_CRC commands" Link: https://lore.kernel.org/all/DM4PR11MB53901D49578FE265B239E55AFB7C9@DM4PR11MB5390.namprd11.prod.outlook.com Fixes: c7eb923c3caf ("can: mcp251xfd: mcp251xfd_regmap_crc_read(): work around broken CRC on TBC register") Cc: stable@vger.kernel.org Reported-by: Pavel Modilaynen Signed-off-by: Thomas Kopp [mkl: split into 2 patches, update patch description and documentation] Signed-off-by: Marc Kleine-Budde commit b3b6df2c56d80b8c6740433cff5f016668b8de70 Author: Jimmy Assarsson Date: Fri Jun 3 10:38:20 2022 +0200 can: kvaser_usb: kvaser_usb_leaf: fix bittiming limits Use correct bittiming limits depending on device. For devices based on USBcanII, Leaf M32C or Leaf i.MX28. Fixes: 080f40a6fa28 ("can: kvaser_usb: Add support for Kvaser CAN/USB devices") Fixes: b4f20130af23 ("can: kvaser_usb: add support for Kvaser Leaf v2 and usb mini PCIe") Fixes: f5d4abea3ce0 ("can: kvaser_usb: Add support for the USBcan-II family") Link: https://lore.kernel.org/all/20220603083820.800246-4-extja@kvaser.com Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson [mkl: remove stray netlink.h include] [mkl: keep struct can_bittiming_const kvaser_usb_flexc_bittiming_const in kvaser_usb_hydra.c] Signed-off-by: Marc Kleine-Budde commit e6c80e601053ffdac5709f11ff3ec1e19ed05f7b Author: Jimmy Assarsson Date: Fri Jun 3 10:38:19 2022 +0200 can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression The firmware of M32C based Leaf devices expects bittiming parameters calculated for 16MHz clock. Since we use the actual clock frequency of the device, the device may end up with wrong bittiming parameters, depending on user requested parameters. This regression affects M32C based Leaf devices with non-16MHz clock. Fixes: fb12797ab1fe ("can: kvaser_usb: get CAN clock frequency from device") Link: https://lore.kernel.org/all/20220603083820.800246-3-extja@kvaser.com Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 49f274c72357d2d74cba70b172cf369768909707 Author: Jimmy Assarsson Date: Fri Jun 3 10:38:18 2022 +0200 can: kvaser_usb: replace run-time checks with struct kvaser_usb_driver_info Unify and move compile-time known information into new struct kvaser_usb_driver_info, in favor of run-time checks. All Kvaser USBcanII supports listen-only mode and error counter reporting. Link: https://lore.kernel.org/all/20220603083820.800246-2-extja@kvaser.com Suggested-by: Marc Kleine-Budde Cc: stable@vger.kernel.org Signed-off-by: Jimmy Assarsson [mkl: move struct kvaser_usb_driver_info into kvaser_usb_core.c] Signed-off-by: Marc Kleine-Budde commit 1b18f09d31cfa7148df15a7d5c5e0e86f105f7d1 Author: Rick Lindsley Date: Sat Jul 2 03:37:12 2022 -0700 ibmvnic: Properly dispose of all skbs during a failover. During a reset, there may have been transmits in flight that are no longer valid and cannot be fulfilled. Resetting and clearing the queues is insufficient; each skb also needs to be explicitly freed so that upper levels are not left waiting for confirmation of a transmit that will never happen. If this happens frequently enough, the apparent backlog will cause TCP to begin "congestion control" unnecessarily, culminating in permanently decreased throughput. Fixes: d7c0ef36bde03 ("ibmvnic: Free and re-allocate scrqs when tx/rx scrqs change") Tested-by: Nick Child Reviewed-by: Brian King Signed-off-by: Rick Lindsley Signed-off-by: David S. Miller commit 4c3333693f07313f5f0145a922f14a7d3c0f4f21 Author: Marc Kleine-Budde Date: Mon May 30 19:30:28 2022 +0200 can: m_can: m_can_{read_fifo,echo_tx_event}(): shift timestamp to full 32 bits In commit 1be37d3b0414 ("can: m_can: fix periph RX path: use rx-offload to ensure skbs are sent from softirq context") the RX path for peripheral devices was switched to RX-offload. Received CAN frames are pushed to RX-offload together with a timestamp. RX-offload is designed to handle overflows of the timestamp correctly, if 32 bit timestamps are provided. The timestamps of m_can core are only 16 bits wide. So this patch shifts them to full 32 bit before passing them to RX-offload. Link: https://lore.kernel.org/all/20220612211410.4081390-1-mkl@pengutronix.de Fixes: 1be37d3b0414 ("can: m_can: fix periph RX path: use rx-offload to ensure skbs are sent from softirq context") Cc: # 5.13 Cc: Torin Cooper-Bennun Reviewed-by: Chandrasekar Ramakrishnan Signed-off-by: Marc Kleine-Budde commit 5b12933de4e76ec164031c18ce8e0904abf530d7 Author: Marc Kleine-Budde Date: Mon May 23 17:18:33 2022 +0200 can: m_can: m_can_chip_config(): actually enable internal timestamping In commit df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") the timestamping in the m_can core should be enabled. In peripheral mode, the RX'ed CAN frames, TX compete frames and error events are sorted by the timestamp. The above mentioned commit however forgot to enable the timestamping. Add the missing bits to enable the timestamp counter to the write of the Timestamp Counter Configuration register. Link: https://lore.kernel.org/all/20220612212708.4081756-1-mkl@pengutronix.de Fixes: df06fd678260 ("can: m_can: m_can_chip_config(): enable and configure internal timestamps") Cc: # 5.13 Cc: Torin Cooper-Bennun Reviewed-by: Chandrasekar Ramakrishnan Signed-off-by: Marc Kleine-Budde commit 562fed945ea482833667f85496eeda766d511386 Author: Liang He Date: Sun Jun 19 15:02:57 2022 +0800 can: grcan: grcan_probe(): remove extra of_node_get() In grcan_probe(), of_find_node_by_path() has already increased the refcount. There is no need to call of_node_get() again, so remove it. Link: https://lore.kernel.org/all/20220619070257.4067022-1-windhl@126.com Fixes: 1e93ed26acf0 ("can: grcan: grcan_probe(): fix broken system id check for errata workaround needs") Cc: stable@vger.kernel.org # v5.18 Cc: Andreas Larsson Signed-off-by: Liang He Signed-off-by: Marc Kleine-Budde commit 2bda24ef95c0311ab93bda00db40486acf30bd0a Author: Rhett Aultman Date: Sun Jul 3 19:33:06 2022 +0200 can: gs_usb: gs_usb_open/close(): fix memory leak The gs_usb driver appears to suffer from a malady common to many USB CAN adapter drivers in that it performs usb_alloc_coherent() to allocate a number of USB request blocks (URBs) for RX, and then later relies on usb_kill_anchored_urbs() to free them, but this doesn't actually free them. As a result, this may be leaking DMA memory that's been used by the driver. This commit is an adaptation of the techniques found in the esd_usb2 driver where a similar design pattern led to a memory leak. It explicitly frees the RX URBs and their DMA memory via a call to usb_free_coherent(). Since the RX URBs were allocated in the gs_can_open(), we remove them in gs_can_close() rather than in the disconnect function as was done in esd_usb2. For more information, see the 928150fad41b ("can: esd_usb2: fix memory leak"). Link: https://lore.kernel.org/all/alpine.DEB.2.22.394.2206031547001.1630869@thelappy Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: stable@vger.kernel.org Signed-off-by: Rhett Aultman Signed-off-by: Marc Kleine-Budde commit 374e11f1bde91545674233459e5a0416ba842b69 Author: Duy Nguyen Date: Mon Jul 4 16:46:11 2022 +0900 can: rcar_canfd: Fix data transmission failed on R-Car V3U On R-Car V3U, this driver should use suitable register offset instead of other SoCs' one. Otherwise, data transmission failed on R-Car V3U. Fixes: 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC") Link: https://lore.kernel.org/all/20220704074611.957191-1-yoshihiro.shimoda.uh@renesas.com Reviewed-by: Geert Uytterhoeven Signed-off-by: Duy Nguyen Signed-off-by: Yoshihiro Shimoda Signed-off-by: Marc Kleine-Budde commit c6da4590fe819dfe28a4f8037a8dc1e056542fb4 Author: Srinivas Neeli Date: Thu Jun 9 13:54:32 2022 +0530 Revert "can: xilinx_can: Limit CANFD brp to 2" This reverts commit 05ca14fdb6fe65614e0652d03e44b02748d25af7. On early silicon engineering samples observed bit shrinking issue when we use brp as 1. Hence updated brp_min as 2. As in production silicon this issue is fixed, so reverting the patch. Link: https://lore.kernel.org/all/20220609082433.1191060-2-srinivas.neeli@xilinx.com Signed-off-by: Srinivas Neeli Signed-off-by: Marc Kleine-Budde commit ea1c3b77bc0b2a414496b3fe988f3abba33db288 Merge: 280e3a857d96f 5d407ca738926 Author: David S. Miller Date: Mon Jul 4 10:06:50 2022 +0100 Merge branch 'netdev-docs' Jakub Kicinski says: ==================== docs: netdev: document more of our rules The patch series length limit and reverse xmas tree are not documented. Add those, and a tl;dr section summarizing how we differ. v2: improve the series length blurb (Andrew) ==================== Signed-off-by: David S. Miller commit 5d407ca7389261c002c49068e4a11ed3bff0fc8e Author: Jakub Kicinski Date: Fri Jul 1 20:12:09 2022 -0700 docs: netdev: add a cheat sheet for the rules Summarize the rules we see broken most often and which may be less familiar to kernel devs who are used to working outside of netdev. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a24875641143fce726529e6d550b313c53eb5821 Author: Jakub Kicinski Date: Fri Jul 1 20:12:08 2022 -0700 docs: netdev: document reverse xmas tree Similarly to the 15 patch rule the reverse xmas tree is not documented. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 02514a067fad6df27c4b21c316c1af93066af06e Author: Jakub Kicinski Date: Fri Jul 1 20:12:07 2022 -0700 docs: netdev: document that patch series length limit We had been asking people to avoid massive patch series but it does not appear in the FAQ. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit f1b4e32aca0811aa011c76e5d6cf2fa19224b386 Author: Oliver Hartkopp Date: Fri May 20 20:32:39 2022 +0200 can: bcm: use call_rcu() instead of costly synchronize_rcu() In commit d5f9023fa61e ("can: bcm: delay release of struct bcm_op after synchronize_rcu()") Thadeu Lima de Souza Cascardo introduced two synchronize_rcu() calls in bcm_release() (only once at socket close) and in bcm_delete_rx_op() (called on removal of each single bcm_op). Unfortunately this slow removal of the bcm_op's affects user space applications like cansniffer where the modification of a filter removes 2048 bcm_op's which blocks the cansniffer application for 40(!) seconds. In commit 181d4447905d ("can: gw: use call_rcu() instead of costly synchronize_rcu()") Eric Dumazet replaced the synchronize_rcu() calls with several call_rcu()'s to safely remove the data structures after the removal of CAN ID subscriptions with can_rx_unregister() calls. This patch adopts Erics approach for the can-bcm which should be applicable since the removal of tasklet_kill() in bcm_remove_op() and the introduction of the HRTIMER_MODE_SOFT timer handling in Linux 5.4. Fixes: d5f9023fa61e ("can: bcm: delay release of struct bcm_op after synchronize_rcu()") # >= 5.4 Link: https://lore.kernel.org/all/20220520183239.19111-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Cc: Eric Dumazet Cc: Norbert Slusarek Cc: Thadeu Lima de Souza Cascardo Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 1d0c1aadf1fd9f3de95d1532b3651e8634546e71 Author: Fabrice Gasnier Date: Tue Jun 21 10:45:09 2022 +0200 ARM: dts: stm32: add missing usbh clock and fix clk order on stm32mp15 The USBH composed of EHCI and OHCI controllers needs the PHY clock to be initialized first, before enabling (gating) them. The reverse is also required when going to suspend. So, add USBPHY clock as 1st entry in both controllers, so the USBPHY PLL gets enabled 1st upon controller init. Upon suspend/resume, this also makes the clock to be disabled/re-enabled in the correct order. This fixes some IRQ storm conditions seen when going to low-power, due to PHY PLL being disabled before all clocks are cleanly gated. Fixes: 949a0c0dec85 ("ARM: dts: stm32: add USB Host (USBH) support to stm32mp157c") Fixes: db7be2cb87ae ("ARM: dts: stm32: use usbphyc ck_usbo_48m as USBH OHCI clock on stm32mp151") Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit bf74181e75c93a1b2b000ebf3c8b4c8c17cd59da Author: Gabriel Fernandez Date: Fri Jun 24 11:27:15 2022 +0200 ARM: dts: stm32: delete fixed clock node on STM32MP15-SCMI Delete the node fixed clock managed by secure world with SCMI. Signed-off-by: Gabriel Fernandez Signed-off-by: Alexandre Torgue commit cfd7ea394cd3b70ba4d9d87ee7b88e37459036b0 Author: Gabriel Fernandez Date: Fri Jun 24 11:27:14 2022 +0200 ARM: dts: stm32: DSI should use LSE SCMI clock on DK1/ED1 STM32 board LSE clock is provided by SCMI. Signed-off-by: Gabriel Fernandez Signed-off-by: Alexandre Torgue commit 78ece8cce1ba0c3f3e5a7c6c1b914b3794f04c44 Author: Gabriel Fernandez Date: Fri Jun 24 11:27:13 2022 +0200 ARM: dts: stm32: use the correct clock source for CEC on stm32mp151 The peripheral clock of CEC is not LSE but CEC. Signed-off-by: Gabriel Fernandez Signed-off-by: Alexandre Torgue commit a34b42f8690ce2b8360971ca5b886786ee1781af Author: Etienne Carriere Date: Fri Jun 24 11:00:55 2022 +0200 ARM: dts: stm32: fix pwr regulators references to use scmi Fixes stm32mp15*-scmi DTS files introduced in [1] to also access PWR regulators through SCMI service. This is needed since enabling secure only access to RCC clock and reset controllers also enables secure access only on PWR voltage regulators reg11, reg18 and usb33 hence these must also be accessed through SCMI Voltage Domain protocol. This change applies on commit [2] that already corrects issues from commit [1]. Cc: Alexandre Torgue Link: [1] https://lore.kernel.org/linux-arm-kernel/20220422150952.20587-7-alexandre.torgue@foss.st.com Link: [2] https://lore.kernel.org/linux-arm-kernel/20220613071920.5463-1-alexandre.torgue@foss.st.com Signed-off-by: Etienne Carriere Signed-off-by: Alexandre Torgue commit 14c99d65941538aa33edd8dc7b1bbbb593c324a2 Author: Gowans, James Date: Thu Jun 23 05:24:03 2022 +0000 mm: split huge PUD on wp_huge_pud fallback Currently the implementation will split the PUD when a fallback is taken inside the create_huge_pud function. This isn't where it should be done: the splitting should be done in wp_huge_pud, just like it's done for PMDs. Reason being that if a callback is taken during create, there is no PUD yet so nothing to split, whereas if a fallback is taken when encountering a write protection fault there is something to split. It looks like this was the original intention with the commit where the splitting was introduced, but somehow it got moved to the wrong place between v1 and v2 of the patch series. Rebase mistake perhaps. Link: https://lkml.kernel.org/r/6f48d622eb8bce1ae5dd75327b0b73894a2ec407.camel@amazon.com Fixes: 327e9fd48972 ("mm: Split huge pages on write-notify or COW") Signed-off-by: James Gowans Reviewed-by: Thomas Hellström Cc: Christian König Cc: Jan H. Schönherr Signed-off-by: Andrew Morton commit 5924e6ec1585445f251ea92713eb15beb732622a Author: Ryusuke Konishi Date: Thu Jun 23 17:54:01 2022 +0900 nilfs2: fix incorrect masking of permission flags for symlinks The permission flags of newly created symlinks are wrongly dropped on nilfs2 with the current umask value even though symlinks should have 777 (rwxrwxrwx) permissions: $ umask 0022 $ touch file && ln -s file symlink; ls -l file symlink -rw-r--r--. 1 root root 0 Jun 23 16:29 file lrwxr-xr-x. 1 root root 4 Jun 23 16:29 symlink -> file This fixes the bug by inserting a missing check that excludes symlinks. Link: https://lkml.kernel.org/r/1655974441-5612-1-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: Tommy Pettersson Reported-by: Ciprian Craciun Tested-by: Ryusuke Konishi Signed-off-by: Andrew Morton commit 1118234e4bc22ff50e9eae40ad95b17a6b12cefa Author: David Hildenbrand Date: Thu Jun 23 22:53:32 2022 +0200 mm/rmap: fix dereferencing invalid subpage pointer in try_to_migrate_one() The subpage we calculate is an invalid pointer for device private pages, because device private pages are mapped via non-present device private entries, not ordinary present PTEs. Let's just not compute broken pointers and fixup later. Move the proper assignment of the correct subpage to the beginning of the function and assert that we really only have a single page in our folio. This currently results in a BUG when tying to compute anon_exclusive, because: [ 528.727237] BUG: unable to handle page fault for address: ffffea1fffffffc0 [ 528.739585] #PF: supervisor read access in kernel mode [ 528.745324] #PF: error_code(0x0000) - not-present page [ 528.751062] PGD 44eaf2067 P4D 44eaf2067 PUD 0 [ 528.756026] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 528.760890] CPU: 120 PID: 18275 Comm: hmm-tests Not tainted 5.19.0-rc3-kfd-alex #257 [ 528.769542] Hardware name: AMD Corporation BardPeak/BardPeak, BIOS RTY1002BDS 09/17/2021 [ 528.778579] RIP: 0010:try_to_migrate_one+0x21a/0x1000 [ 528.784225] Code: f6 48 89 c8 48 2b 05 45 d1 6a 01 48 c1 f8 06 48 29 c3 48 8b 45 a8 48 c1 e3 06 48 01 cb f6 41 18 01 48 89 85 50 ff ff ff 74 0b <4c> 8b 33 49 c1 ee 11 41 83 e6 01 48 8b bd 48 ff ff ff e8 3f 99 02 [ 528.805194] RSP: 0000:ffffc90003cdfaa0 EFLAGS: 00010202 [ 528.811027] RAX: 00007ffff7ff4000 RBX: ffffea1fffffffc0 RCX: ffffeaffffffffc0 [ 528.818995] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90003cdfaf8 [ 528.826962] RBP: ffffc90003cdfb70 R08: 0000000000000000 R09: 0000000000000000 [ 528.834930] R10: ffffc90003cdf910 R11: 0000000000000002 R12: ffff888194450540 [ 528.842899] R13: ffff888160d057c0 R14: 0000000000000000 R15: 03ffffffffffffff [ 528.850865] FS: 00007ffff7fdb740(0000) GS:ffff8883b0600000(0000) knlGS:0000000000000000 [ 528.859891] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 528.866308] CR2: ffffea1fffffffc0 CR3: 00000001562b4003 CR4: 0000000000770ee0 [ 528.874275] PKRU: 55555554 [ 528.877286] Call Trace: [ 528.880016] [ 528.882356] ? lock_is_held_type+0xdf/0x130 [ 528.887033] rmap_walk_anon+0x167/0x410 [ 528.891316] try_to_migrate+0x90/0xd0 [ 528.895405] ? try_to_unmap_one+0xe10/0xe10 [ 528.900074] ? anon_vma_ctor+0x50/0x50 [ 528.904260] ? put_anon_vma+0x10/0x10 [ 528.908347] ? invalid_mkclean_vma+0x20/0x20 [ 528.913114] migrate_vma_setup+0x5f4/0x750 [ 528.917691] dmirror_devmem_fault+0x8c/0x250 [test_hmm] [ 528.923532] do_swap_page+0xac0/0xe50 [ 528.927623] ? __lock_acquire+0x4b2/0x1ac0 [ 528.932199] __handle_mm_fault+0x949/0x1440 [ 528.936876] handle_mm_fault+0x13f/0x3e0 [ 528.941256] do_user_addr_fault+0x215/0x740 [ 528.945928] exc_page_fault+0x75/0x280 [ 528.950115] asm_exc_page_fault+0x27/0x30 [ 528.954593] RIP: 0033:0x40366b ... Link: https://lkml.kernel.org/r/20220623205332.319257-1-david@redhat.com Fixes: 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") Signed-off-by: David Hildenbrand Reported-by: "Sierra Guiza, Alejandro (Alex)" Reviewed-by: Alistair Popple Tested-by: Alistair Popple Cc: Vlastimil Babka Cc: Christoph Hellwig Cc: "Matthew Wilcox (Oracle)" Signed-off-by: Andrew Morton commit 34c0a5b04da8a543bc7335953c635dea1099d757 Author: YueHaibing Date: Fri Jun 24 16:52:36 2022 +0800 riscv/mm: fix build error while PAGE_TABLE_CHECK enabled without MMU mm/page_table_check.c: In function `__page_table_check_pte_clear': mm/page_table_check.c:148:6: error: implicit declaration of function `pte_user_accessible_page'; did you mean `user_access_save'? [-Werror=implicit-function-declaration] if (pte_user_accessible_page(pte)) { ^~~~~~~~~~~~~~~~~~~~~~~~ user_access_save ARCH_SUPPORTS_PAGE_TABLE_CHECK should only enabled with MMU. Link: https://lkml.kernel.org/r/20220624085236.18544-1-yuehaibing@huawei.com Fixes: 3fee229a8eb9 ("riscv/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: YueHaibing Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Pasha Tatashin Cc: Tong Tiangen Signed-off-by: Andrew Morton commit cffe57bee62b155c08d71218fc0e9e84a0a90bbb Author: Bagas Sanjaya Date: Wed Jun 22 15:45:46 2022 +0700 Documentation: highmem: use literal block for code example in highmem.h comment When building htmldocs on Linus's tree, there are inline emphasis warnings on include/linux/highmem.h: Documentation/vm/highmem:166: ./include/linux/highmem.h:154: WARNING: Inline emphasis start-string without end-string. Documentation/vm/highmem:166: ./include/linux/highmem.h:157: WARNING: Inline emphasis start-string without end-string. These warnings above are due to comments in code example at the mentioned lines above are enclosed by double dash (--), which confuses Sphinx as inline markup delimiters instead. Fix these warnings by indenting the code example with literal block indentation and making the comments C comments. Link: https://lkml.kernel.org/r/20220622084546.17745-1-bagasdotme@gmail.com Fixes: 85a85e7601263f ("Documentation/vm: move "Using kmap-atomic" to highmem.h") Signed-off-by: Bagas Sanjaya Reviewed-by: Ira Weiny Tested-by: Ira Weiny Cc: "Matthew Wilcox (Oracle)" Cc: "Fabio M. De Francesco" Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton commit 39d35edee4537487e5178f258e23518272a66413 Author: Muchun Song Date: Mon Jun 20 10:30:19 2022 +0800 mm: sparsemem: fix missing higher order allocation splitting Higher order allocations for vmemmap pages from buddy allocator must be able to be treated as indepdenent small pages as they can be freed individually by the caller. There is no problem for higher order vmemmap pages allocated at boot time since each individual small page will be initialized at boot time. However, it will be an issue for memory hotplug case since those higher order vmemmap pages are allocated from buddy allocator without initializing each individual small page's refcount. The system will panic in put_page_testzero() when CONFIG_DEBUG_VM is enabled if the vmemmap page is freed. Link: https://lkml.kernel.org/r/20220620023019.94257-1-songmuchun@bytedance.com Fixes: d8d55f5616cf ("mm: sparsemem: use page table lock to protect kernel pmd operations") Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Xiongchun Duan Cc: Signed-off-by: Andrew Morton commit ed1523a895ffdabcab6e067af18685ed00f5ce15 Author: Baolin Wang Date: Mon Jun 20 10:34:42 2022 +0800 mm/damon: use set_huge_pte_at() to make huge pte old The huge_ptep_set_access_flags() can not make the huge pte old according to the discussion [1], that means we will always mornitor the young state of the hugetlb though we stopped accessing the hugetlb, as a result DAMON will get inaccurate accessing statistics. So changing to use set_huge_pte_at() to make the huge pte old to fix this issue. [1] https://lore.kernel.org/all/Yqy97gXI4Nqb7dYo@arm.com/ Link: https://lkml.kernel.org/r/1655692482-28797-1-git-send-email-baolin.wang@linux.alibaba.com Fixes: 49f4203aae06 ("mm/damon: add access checking for hugetlb pages") Signed-off-by: Baolin Wang Reviewed-by: SeongJae Park Acked-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Signed-off-by: Andrew Morton commit d684e0a52d36f8939eda30a0f31ee235ee4ee741 Author: Geert Uytterhoeven Date: Mon Jun 20 09:01:43 2022 +0200 sh: convert nommu io{re,un}map() to static inline functions Recently, nommu iounmap() was converted from a static inline function to a macro again, basically reverting commit 4580ba4ad2e6b8dd ("sh: Convert iounmap() macros to inline functions"). With -Werror, this leads to build failures like: drivers/iio/adc/xilinx-ams.c: In function `ams_iounmap_ps': drivers/iio/adc/xilinx-ams.c:1195:14: error: unused variable `ams' [-Werror=unused-variable] 1195 | struct ams *ams = data; | ^~~ Fix this by replacing the macros for ioremap() and iounmap() by static inline functions, based on . Link: https://lkml.kernel.org/r/8d1b1766260961799b04035e7bc39a7f59729f72.1655708312.git.geert+renesas@glider.be Fixes: 13f1fc870dd74713 ("sh: move the ioremap implementation out of line") Signed-off-by: Geert Uytterhoeven Reported-by: kernel test robot Reported-by: Jonathan Cameron Acked-by: Jonathan Cameron Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 73f37dbcfe1763ee2294c7717a1f571e27d17fd8 Author: Axel Rasmussen Date: Fri Jun 10 10:38:12 2022 -0700 mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages When fallocate() is used on a shmem file, the pages we allocate can end up with !PageUptodate. Since UFFDIO_CONTINUE tries to find the existing page the user wants to map with SGP_READ, we would fail to find such a page, since shmem_getpage_gfp returns with a "NULL" pagep for SGP_READ if it discovers !PageUptodate. As a result, UFFDIO_CONTINUE returns -EFAULT, as it would do if the page wasn't found in the page cache at all. This isn't the intended behavior. UFFDIO_CONTINUE is just trying to find if a page exists, and doesn't care whether it still needs to be cleared or not. So, instead of SGP_READ, pass in SGP_NOALLOC. This is the same, except for one critical difference: in the !PageUptodate case, SGP_NOALLOC will clear the page and then return it. With this change, UFFDIO_CONTINUE works properly (succeeds) on a shmem file which has been fallocated, but otherwise not modified. Link: https://lkml.kernel.org/r/20220610173812.1768919-1-axelrasmussen@google.com Fixes: 153132571f02 ("userfaultfd/shmem: support UFFDIO_CONTINUE for shmem") Signed-off-by: Axel Rasmussen Acked-by: Peter Xu Cc: Hugh Dickins Cc: Signed-off-by: Andrew Morton commit 88084a3df1672e131ddc1b4e39eeacfd39864acf Author: Linus Torvalds Date: Sun Jul 3 15:39:28 2022 -0700 Linux 5.19-rc5 commit b8d5109f50969ead9d49c3e8bd78ec1f82e548e3 Author: Linus Torvalds Date: Sun Jul 3 14:40:28 2022 -0700 lockref: remove unused 'lockref_get_or_lock()' function Looking at the conditional lock acquire functions in the kernel due to the new sparse support (see commit 4a557a5d1a61 "sparse: introduce conditional lock acquire function attribute"), it became obvious that the lockref code has a couple of them, but they don't match the usual naming convention for the other ones, and their return value logic is also reversed. In the other very similar places, the naming pattern is '*_and_lock()' (eg 'atomic_put_and_lock()' and 'refcount_dec_and_lock()'), and the function returns true when the lock is taken. The lockref code is superficially very similar to the refcount code, only with the special "atomic wrt the embedded lock" semantics. But instead of the '*_and_lock()' naming it uses '*_or_lock()'. And instead of returning true in case it took the lock, it returns true if it *didn't* take the lock. Now, arguably the reflock code is quite logical: it really is a "either decrement _or_ lock" kind of situation - and the return value is about whether the operation succeeded without any special care needed. So despite the similarities, the differences do make some sense, and maybe it's not worth trying to unify the different conditional locking primitives in this area. But while looking at this all, it did become obvious that the 'lockref_get_or_lock()' function hasn't actually had any users for almost a decade. The only user it ever had was the shortlived 'd_rcu_to_refcount()' function, and it got removed and replaced with 'lockref_get_not_dead()' back in 2013 in commits 0d98439ea3c6 ("vfs: use lockred 'dead' flag to mark unrecoverably dead dentries") and e5c832d55588 ("vfs: fix dentry RCU to refcounting possibly sleeping dput()") In fact, that single use was removed less than a week after the whole function was introduced in commit b3abd80250c1 ("lockref: add 'lockref_get_or_lock() helper") so this function has been around for a decade, but only had a user for six days. Let's just put this mis-designed and unused function out of its misery. We can think about the naming and semantic oddities of the remaining 'lockref_put_or_lock()' later, but at least that function has users. And while the naming is different and the return value doesn't match, that function matches the whole '{atomic,refcount}_dec_and_test()' pattern much better (ie the magic happens when the count goes down to zero, not when it is incremented from zero). Signed-off-by: Linus Torvalds commit 7ecd8a7af36efa52fb95fb42ecab03bc4e76c848 Merge: f99d621133ef4 5fb779558f1c9 Author: Arnd Bergmann Date: Sun Jul 3 22:36:46 2022 +0200 Merge tag 'qcom-arm64-fixes-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 DT fixes for v5.19 This removes duplicate includes in the sc7180-trogdor files, which accidentally ended up disabling nodes intended to be enabled. It corrects identifiers for CPU6/7 on MSM8994. On SM8450 the UFS node's interconnects property is updated to match the #interconnect-cells, avoiding sync_state issues and the GIC ITS is defined, to correct the references from the PCIe nodes. On SDM845 the display subsystem's AHB clock is corrected and on msm8992 devices, the supplies for lvs 1 and 2 are correctly specified. Lastly, a welcome addition of Konrad as reviewer for the Qualcomm SoC. * tag 'qcom-arm64-fixes-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: dts: qcom: msm8992-*: Fix vdd_lvs1_2-supply typo MAINTAINERS: Add myself as a reviewer for Qualcomm ARM/64 support arm64: dts: qcom: sdm845: use dispcc AHB clock for mdss node arm64: dts: qcom: sm8450 add ITS device tree node arm64: dts: qcom: msm8994: Fix CPU6/7 reg values arm64: dts: qcom: sm8450: fix interconnects property of UFS node arm64: dts: qcom: Remove duplicate sc7180-trogdor include on lazor/homestar Link: https://lore.kernel.org/r/20220703030208.408109-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 4a557a5d1a6145ea586dc9b17a9b4e5190c9c017 Author: Linus Torvalds Date: Thu Jun 30 09:34:10 2022 -0700 sparse: introduce conditional lock acquire function attribute The kernel tends to try to avoid conditional locking semantics because it makes it harder to think about and statically check locking rules, but we do have a few fundamental locking primitives that take locks conditionally - most obviously the 'trylock' functions. That has always been a problem for 'sparse' checking for locking imbalance, and we've had a special '__cond_lock()' macro that we've used to let sparse know how the locking works: # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) so that you can then use this to tell sparse that (for example) the spinlock trylock macro ends up acquiring the lock when it succeeds, but not when it fails: #define raw_spin_trylock(lock) __cond_lock(lock, _raw_spin_trylock(lock)) and then sparse can follow along the locking rules when you have code like if (!spin_trylock(&dentry->d_lock)) return LRU_SKIP; .. sparse sees that the lock is held here.. spin_unlock(&dentry->d_lock); and sparse ends up happy about the lock contexts. However, this '__cond_lock()' use does result in very ugly header files, and requires you to basically wrap the real function with that macro that uses '__cond_lock'. Which has made PeterZ NAK things that try to fix sparse warnings over the years [1]. To solve this, there is now a very experimental patch to sparse that basically does the exact same thing as '__cond_lock()' did, but using a function attribute instead. That seems to make PeterZ happy [2]. Note that this does not replace existing use of '__cond_lock()', but only exposes the new proposed attribute and uses it for the previously unannotated 'refcount_dec_and_lock()' family of functions. For existing sparse installations, this will make no difference (a negative output context was ignored), but if you have the experimental sparse patch it will make sparse now understand code that uses those functions, the same way '__cond_lock()' makes sparse understand the very similar 'atomic_dec_and_lock()' uses that have the old '__cond_lock()' annotations. Note that in some cases this will silence existing context imbalance warnings. But in other cases it may end up exposing new sparse warnings for code that sparse just didn't see the locking for at all before. This is a trial, in other words. I'd expect that if it ends up being successful, and new sparse releases end up having this new attribute, we'll migrate the old-style '__cond_lock()' users to use the new-style '__cond_acquires' function attribute. The actual experimental sparse patch was posted in [3]. Link: https://lore.kernel.org/all/20130930134434.GC12926@twins.programming.kicks-ass.net/ [1] Link: https://lore.kernel.org/all/Yr60tWxN4P568x3W@worktop.programming.kicks-ass.net/ [2] Link: https://lore.kernel.org/all/CAHk-=wjZfO9hGqJ2_hGQG3U_XzSh9_XaXze=HgPdvJbgrvASfA@mail.gmail.com/ [3] Acked-by: Peter Zijlstra Cc: Alexander Aring Cc: Luc Van Oostenryck Signed-off-by: Linus Torvalds commit 20855e4cb361adeabce3665f5174b09b4a6ebfe6 Merge: 69cb6c6556ad8 7561cea5dbb97 Author: Linus Torvalds Date: Sun Jul 3 09:42:17 2022 -0700 Merge tag 'xfs-5.19-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "This fixes some stalling problems and corrects the last of the problems (I hope) observed during testing of the new atomic xattr update feature. - Fix statfs blocking on background inode gc workers - Fix some broken inode lock assertion code - Fix xattr leaf buffer leaks when cancelling a deferred xattr update operation - Clean up xattr recovery to make it easier to understand. - Fix xattr leaf block verifiers tripping over empty blocks. - Remove complicated and error prone xattr leaf block bholding mess. - Fix a bug where an rt extent crossing EOF was treated as "posteof" blocks and cleaned unnecessarily. - Fix a UAF when log shutdown races with unmount" * tag 'xfs-5.19-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: prevent a UAF when log IO errors race with unmount xfs: dont treat rt extents beyond EOF as eofblocks to be cleared xfs: don't hold xattr leaf buffers across transaction rolls xfs: empty xattr leaf header blocks are not corruption xfs: clean up the end of xfs_attri_item_recover xfs: always free xattri_leaf_bp when cancelling a deferred op xfs: use invalidate_lock to check the state of mmap_lock xfs: factor out the common lock flags assert xfs: introduce xfs_inodegc_push() xfs: bound maximum wait time for inodegc work commit 280e3a857d96f9ca8e24632788e1e7a0fec4e9f7 Merge: 3d5a2a396f198 9827a0e6e23bf Author: David S. Miller Date: Sun Jul 3 12:29:18 2022 +0100 Merge 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) Insufficient validation of element datatype and length in nft_setelem_parse_data(). At least commit 7d7402642eaf updates maximum element data area up to 64 bytes when only 16 bytes where supported at the time. Support for larger element size came later in fdb9c405e35b though. Picking this older commit as Fixes: tag to be safe than sorry. 2) Memleak in pipapo destroy path, reproducible when transaction in aborted. This is already triggering in the existing netfilter test infrastructure since more recent new tests are covering this path. ==================== Signed-off-by: David S. Miller commit 9827a0e6e23bf43003cd3d5b7fb11baf59a35e1e Author: Pablo Neira Ayuso Date: Sat Jul 2 04:16:31 2022 +0200 netfilter: nft_set_pipapo: release elements in clone from abort path New elements that reside in the clone are not released in case that the transaction is aborted. [16302.231754] ------------[ cut here ]------------ [16302.231756] WARNING: CPU: 0 PID: 100509 at net/netfilter/nf_tables_api.c:1864 nf_tables_chain_destroy+0x26/0x127 [nf_tables] [...] [16302.231882] CPU: 0 PID: 100509 Comm: nft Tainted: G W 5.19.0-rc3+ #155 [...] [16302.231887] RIP: 0010:nf_tables_chain_destroy+0x26/0x127 [nf_tables] [16302.231899] Code: f3 fe ff ff 41 55 41 54 55 53 48 8b 6f 10 48 89 fb 48 c7 c7 82 96 d9 a0 8b 55 50 48 8b 75 58 e8 de f5 92 e0 83 7d 50 00 74 09 <0f> 0b 5b 5d 41 5c 41 5d c3 4c 8b 65 00 48 8b 7d 08 49 39 fc 74 05 [...] [16302.231917] Call Trace: [16302.231919] [16302.231921] __nf_tables_abort.cold+0x23/0x28 [nf_tables] [16302.231934] nf_tables_abort+0x30/0x50 [nf_tables] [16302.231946] nfnetlink_rcv_batch+0x41a/0x840 [nfnetlink] [16302.231952] ? __nla_validate_parse+0x48/0x190 [16302.231959] nfnetlink_rcv+0x110/0x129 [nfnetlink] [16302.231963] netlink_unicast+0x211/0x340 [16302.231969] netlink_sendmsg+0x21e/0x460 Add nft_set_pipapo_match_destroy() helper function to release the elements in the lookup tables. Stefano Brivio says: "We additionally look for elements pointers in the cloned matching data if priv->dirty is set, because that means that cloned data might point to additional elements we did not commit to the working copy yet (such as the abort path case, but perhaps not limited to it)." Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit 7e6bc1f6cabcd30aba0b11219d8e01b952eacbb6 Author: Pablo Neira Ayuso Date: Sat Jul 2 04:16:30 2022 +0200 netfilter: nf_tables: stricter validation of element data Make sure element data type and length do not mismatch the one specified by the set declaration. Fixes: 7d7402642eaf ("netfilter: nf_tables: variable sized set element keys / data") Reported-by: Hugues ANGUELKOV Signed-off-by: Pablo Neira Ayuso commit 69cb6c6556ad89620547318439d6be8bb1629a5a Merge: 34074da5424c0 a23dd544debcd Author: Linus Torvalds Date: Sat Jul 2 11:20:56 2022 -0700 Merge tag 'nfsd-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Notable regression fixes: - Fix NFSD crash during NFSv4.2 READ_PLUS operation - Fix incorrect status code returned by COMMIT operation" * tag 'nfsd-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Fix READ_PLUS crasher NFSD: restore EINVAL error translation in nfsd_commit() commit 34074da5424c08542d197396757cc3194ef754b4 Merge: bb7c512687769 aa78fa905b443 Author: Linus Torvalds Date: Sat Jul 2 10:23:36 2022 -0700 Merge tag 'for-5.19/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "Two important fixes for bugs in code which was added in 5.18: - Fix userspace signal failures on 32-bit kernel due to a bug in vDSO - Fix 32-bit load-word unalignment exception handler which returned wrong values" * tag 'for-5.19/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix vDSO signal breakage on 32-bit kernel parisc/unaligned: Fix emulate_ldw() breakage commit aa78fa905b4431c432071a878da99c2b37fc0e79 Author: Helge Deller Date: Fri Jul 1 09:00:41 2022 +0200 parisc: Fix vDSO signal breakage on 32-bit kernel Addition of vDSO support for parisc in kernel v5.18 suddenly broke glibc signal testcases on a 32-bit kernel. The trampoline code (sigtramp.S) which is mapped into userspace includes an offset to the context data on the stack, which is used by gdb and glibc to get access to registers. In a 32-bit kernel we used by mistake the offset into the compat context (which is valid on a 64-bit kernel only) instead of the offset into the "native" 32-bit context. Reported-by: John David Anglin Tested-by: John David Anglin Fixes: df24e1783e6e ("parisc: Add vDSO support") CC: stable@vger.kernel.org # 5.18 Signed-off-by: Helge Deller commit bb7c51268776941b7533374caabcaaed302b91e0 Merge: 5411de0733623 ff898552fb32d Author: Linus Torvalds Date: Sat Jul 2 09:28:36 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.19-2022-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - BPF program info linear (BPIL) data is accessed assuming 64-bit alignment resulting in undefined behavior as the data is just byte aligned. Fix it, Found using -fsanitize=undefined. - Fix 'perf offcpu' build on old kernels wrt task_struct's state/__state field. - Fix perf_event_attr.sample_type setting on the 'offcpu-time' event synthesized by the 'perf offcpu' tool. - Don't bail out when synthesizing PERF_RECORD_ events for pre-existing threads when one goes away while parsing its procfs entries. - Don't sort the task scan result from /proc, its not needed and introduces bugs when the main thread isn't the first one to be processed. - Fix uninitialized 'offset' variable on aarch64 in the unwind code. - Sync KVM headers with the kernel sources. * tag 'perf-tools-fixes-for-v5.19-2022-07-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf synthetic-events: Ignore dead threads during event synthesis perf synthetic-events: Don't sort the task scan result from /proc perf unwind: Fix unitialized 'offset' variable on aarch64 tools headers UAPI: Sync linux/kvm.h with the kernel sources perf bpf: 8 byte align bpil data tools kvm headers arm64: Update KVM headers from the kernel sources perf offcpu: Accept allowed sample types only perf offcpu: Fix build failure on old kernels commit 5411de073362300d99bb35d46d77d656760e4606 Merge: 089866061428e ac790d09885d3 Author: Linus Torvalds Date: Sat Jul 2 09:11:44 2022 -0700 Merge tag 'powerpc-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix BPF uapi confusion about the correct type of bpf_user_pt_regs_t. - Fix virt_addr_valid() when memory is hotplugged above the boot-time high_memory value. - Fix a bug in 64-bit Book3E map_kernel_page() which would incorrectly allocate a PMD page at PUD level. - Fix a couple of minor issues found since we enabled KASAN for 64-bit Book3S. Thanks to Aneesh Kumar K.V, Cédric Le Goater, Christophe Leroy, Kefeng Wang, Liam Howlett, Nathan Lynch, and Naveen N. Rao. * tag 'powerpc-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/memhotplug: Add add_pages override for PPC powerpc/bpf: Fix use of user_pt_regs in uapi powerpc/prom_init: Fix kernel config grep powerpc/book3e: Fix PUD allocation size in map_kernel_page() powerpc/xive/spapr: correct bitmap allocation size commit 3d5a2a396f19874b02196268a567a529ad5c7448 Author: Karsten Graul Date: Fri Jul 1 20:41:43 2022 +0200 MAINTAINERS: add Wenjia as SMC maintainer Add Wenjia as maintainer for Shared Memory Communications (SMC) Sockets. Acked-by: Wenjia Zhang Acked-by: Alexandra Winter Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 2cd37c2e72449a7add6da1183d20a6247d6db111 Author: Shuah Khan Date: Fri Jul 1 10:53:52 2022 -0600 misc: rtsx_usb: set return value in rsp_buf alloc err path Set return value in rsp_buf alloc error path before going to error handling. drivers/misc/cardreader/rtsx_usb.c:639:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!ucr->rsp_buf) ^~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:678:9: note: uninitialized use occurs here return ret; ^~~ drivers/misc/cardreader/rtsx_usb.c:639:2: note: remove the 'if' if its condition is always false if (!ucr->rsp_buf) ^~~~~~~~~~~~~~~~~~ drivers/misc/cardreader/rtsx_usb.c:622:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 Fixes: 3776c7855985 ("misc: rtsx_usb: use separate command and response buffers") Reported-by: kernel test robot Cc: stable Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220701165352.15687-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit ff898552fb32d255517fb0676f9fa500664c484d Author: Namhyung Kim Date: Fri Jul 1 13:54:58 2022 -0700 perf synthetic-events: Ignore dead threads during event synthesis When it synthesize various task events, it scans the list of task first and then accesses later. There's a window threads can die between the two and proc entries may not be available. Instead of bailing out, we can ignore that thread and move on. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220701205458.985106-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 363afa3aef24f5e08df6a539f5dc3aae4cddcc1a Author: Namhyung Kim Date: Fri Jul 1 13:54:57 2022 -0700 perf synthetic-events: Don't sort the task scan result from /proc It should not sort the result as procfs already returns a proper ordering of tasks. Actually sorting the order caused problems that it doesn't guararantee to process the main thread first. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220701205458.985106-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5eb502b2e1ae1ab052cdf6bdd7615217e8517360 Author: Ivan Babrou Date: Fri Jul 1 11:20:46 2022 -0700 perf unwind: Fix unitialized 'offset' variable on aarch64 Commit dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects") uncovered the following issue on aarch64: util/unwind-libunwind-local.c: In function 'find_proc_info': util/unwind-libunwind-local.c:386:28: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] 386 | if (ofs > 0) { | ^ util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here 199 | u64 address, offset; | ^~~~~~ util/unwind-libunwind-local.c:371:20: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] 371 | if (ofs <= 0) { | ^ util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here 199 | u64 address, offset; | ^~~~~~ util/unwind-libunwind-local.c:363:20: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] 363 | if (ofs <= 0) { | ^ util/unwind-libunwind-local.c:199:22: note: 'offset' was declared here 199 | u64 address, offset; | ^~~~~~ In file included from util/libunwind/arm64.c:37: Fixes: dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects") Signed-off-by: Ivan Babrou Cc: Alexander Shishkin Cc: Fangrui Song Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: kernel-team@cloudflare.com Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220701182046.12589-1-ivan@cloudflare.com Signed-off-by: Arnaldo Carvalho de Melo commit d28b25a62a47a8c8aa19bd543863aab6717e68c9 Author: Hangbin Liu Date: Thu Jun 30 14:22:28 2022 +0800 selftests/net: fix section name when using xdp_dummy.o Since commit 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests") the xdp_dummy.o's section name has changed to xdp. But some tests are still using "section xdp_dummy", which make the tests failed. Fix them by updating to the new section name. Fixes: 8fffa0e3451a ("selftests/bpf: Normalize XDP section names in selftests") Signed-off-by: Hangbin Liu Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220630062228.3453016-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit bc38fae3a68b5140a39e2948de2b5b301438abfe Merge: 8dfeee9dc52cb a49b8ce7306cf Author: Jakub Kicinski Date: Fri Jul 1 19:56:28 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-07-02 We've added 7 non-merge commits during the last 14 day(s) which contain a total of 6 files changed, 193 insertions(+), 86 deletions(-). The main changes are: 1) Fix clearing of page contiguity when unmapping XSK pool, from Ivan Malov. 2) Two verifier fixes around bounds data propagation, from Daniel Borkmann. 3) Fix fprobe sample module's parameter descriptions, from Masami Hiramatsu. 4) General BPF maintainer entry revamp to better scale patch reviews. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf, selftests: Add verifier test case for jmp32's jeq/jne bpf, selftests: Add verifier test case for imm=0,umin=0,umax=1 scalar bpf: Fix insufficient bounds propagation from adjust_scalar_min_max_vals bpf: Fix incorrect verifier simulation around jmp32's jeq/jne xsk: Clear page contiguity bit when unmapping pool bpf, docs: Better scale maintenance of BPF subsystem fprobe, samples: Add module parameter descriptions ==================== Link: https://lore.kernel.org/r/20220701230121.10354-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 089866061428ec9bf67221247c936792078c41a4 Merge: 1ce8c443e9569 ef9102004a87c Author: Linus Torvalds Date: Fri Jul 1 16:58:19 2022 -0700 Merge tag 'libnvdimm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fix from Vishal Verma: - Fix a bug in the libnvdimm 'BTT' (Block Translation Table) driver where accounting for poison blocks to be cleared was off by one, causing a failure to clear the the last badblock in an nvdimm region. * tag 'libnvdimm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm: Fix badblocks clear off-by-one error commit 2cc39179acbbe524127f0427cee92b629db4d64b Author: Masahiro Yamada Date: Wed Jun 15 06:33:03 2022 +0900 doc: module: update file references Adjust documents to the file moves made by commit cfc1d277891e ("module: Move all into module/"). Thanks to Yanteng Si for helping me to update Documentation/translations/zh_CN/core-api/kernel-api.rst Signed-off-by: Masahiro Yamada Acked-by: Yanteng Si Signed-off-by: Luis Chamberlain commit f963ef123900ac534aeb6141642e5351989ac14c Author: Christophe Leroy Date: Sun Jun 12 17:33:20 2022 +0200 module: Fix "warning: variable 'exit' set but not used" When CONFIG_MODULE_UNLOAD is not selected, 'exit' is set but never used. It is not possible to replace the #ifdef CONFIG_MODULE_UNLOAD by IS_ENABLED(CONFIG_MODULE_UNLOAD) because mod->exit doesn't exist when CONFIG_MODULE_UNLOAD is not selected. And because of the rcu_read_lock_sched() section it is not easy to regroup everything in a single #ifdef. Let's regroup partially and add missing #ifdef to completely opt out the use of 'exit' when CONFIG_MODULE_UNLOAD is not selected. Reported-by: kernel test robot Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit cfa94c538be621a0ba645adfa9ead005b5fa02f6 Author: Christophe Leroy Date: Sun Jun 12 17:21:56 2022 +0200 module: Fix selfAssignment cppcheck warning cppcheck reports the following warnings: kernel/module/main.c:1455:26: warning: Redundant assignment of 'mod->core_layout.size' to itself. [selfAssignment] mod->core_layout.size = strict_align(mod->core_layout.size); ^ kernel/module/main.c:1489:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment] mod->init_layout.size = strict_align(mod->init_layout.size); ^ kernel/module/main.c:1493:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment] mod->init_layout.size = strict_align(mod->init_layout.size); ^ kernel/module/main.c:1504:26: warning: Redundant assignment of 'mod->init_layout.size' to itself. [selfAssignment] mod->init_layout.size = strict_align(mod->init_layout.size); ^ kernel/module/main.c:1459:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment] mod->data_layout.size = strict_align(mod->data_layout.size); ^ kernel/module/main.c:1463:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment] mod->data_layout.size = strict_align(mod->data_layout.size); ^ kernel/module/main.c:1467:26: warning: Redundant assignment of 'mod->data_layout.size' to itself. [selfAssignment] mod->data_layout.size = strict_align(mod->data_layout.size); ^ This is due to strict_align() being a no-op when CONFIG_STRICT_MODULE_RWX is not selected. Transform strict_align() macro into an inline function. It will allow type checking and avoid the selfAssignment warning. Reported-by: kernel test robot Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 35adf9a4e55e0b0a9d5e313e65ad83681dc32e9a Author: Adrian Hunter Date: Fri Jul 1 12:44:03 2022 +0300 modules: Fix corruption of /proc/kallsyms The commit 91fb02f31505 ("module: Move kallsyms support into a separate file") changed from using strlcpy() to using strscpy() which created a buffer overflow. That happened because: 1) an incorrect value was passed as the buffer length 2) strscpy() (unlike strlcpy()) may copy beyond the length of the input string when copying word-by-word. The assumption was that because it was already known that the strings being copied would fit in the space available, it was not necessary to correctly set the buffer length. strscpy() breaks that assumption because although it will not touch bytes beyond the given buffer length it may write bytes beyond the input string length when writing word-by-word. The result of the buffer overflow is to corrupt the symbol type information that follows. e.g. $ sudo cat -v /proc/kallsyms | grep '\^' | head ffffffffc0615000 ^@ rfcomm_session_get [rfcomm] ffffffffc061c060 ^@ session_list [rfcomm] ffffffffc06150d0 ^@ rfcomm_send_frame [rfcomm] ffffffffc0615130 ^@ rfcomm_make_uih [rfcomm] ffffffffc07ed58d ^@ bnep_exit [bnep] ffffffffc07ec000 ^@ bnep_rx_control [bnep] ffffffffc07ec1a0 ^@ bnep_session [bnep] ffffffffc07e7000 ^@ input_leds_event [input_leds] ffffffffc07e9000 ^@ input_leds_handler [input_leds] ffffffffc07e7010 ^@ input_leds_disconnect [input_leds] Notably, the null bytes (represented above by ^@) can confuse tools. Fix by correcting the buffer length. Fixes: 91fb02f31505 ("module: Move kallsyms support into a separate file") Signed-off-by: Adrian Hunter Signed-off-by: Luis Chamberlain commit f99d621133ef48c9ace6416e864ffacba1cb2bc8 Merge: d95ce66d4cc3b 34d2cd3fccced Author: Arnd Bergmann Date: Fri Jul 1 22:27:45 2022 +0200 Merge tag 'amlogic-arm-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/fixes Amlogic ARM mach-meson changes for v5.20: - Fix refcount leak in meson_smp_prepare_cpus * tag 'amlogic-arm-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: meson: Fix refcount leak in meson_smp_prepare_cpus Link: https://lore.kernel.org/r/cbf6bcb5-c7be-40fe-4436-4578c9d6c532@baylibre.com Signed-off-by: Arnd Bergmann commit d95ce66d4cc3b088308821de185cb372097fec84 Merge: 1f66f63c7312e 4ce7e51dc712f Author: Arnd Bergmann Date: Fri Jul 1 22:25:43 2022 +0200 Merge tag 'scmi-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI firmware driver fixes for v5.19 Few more fixes to address: 1. Issue reported on Juno with HDLCD clock which turned out to be yet another firmware issue. The firmware is not conformant to the spec and we now have to workaround as this may be copied to other platforms as well. The spec expects to return size of 3 for a range clock rate description while the firmware returns 1. We have other ways to validate all the 3 entries the driver reads are polpulated and we use the same to workaround this firmware bug. 2. Optee transport not setting the correct reponse length which is similar to the one reported earlier on Rockchip platform. 3. Drop the usage of the deprecated ida_simple_{get,remove} and migrate to the ida_{alloc,free} * tag 'scmi-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API firmware: arm_scmi: Fix response size warning for OPTEE transport firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks Link: https://lore.kernel.org/r/20220628133315.699803-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 1ce8c443e95698cecc32cc8ed5ff4b72da61eed4 Merge: 9ee7827668c7c 62f46fc7b8c63 Author: Linus Torvalds Date: Fri Jul 1 13:00:47 2022 -0700 Merge tag 'thermal-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fix from Rafael Wysocki: "Add a new CPU ID to the list of supported processors in the intel_tcc_cooling driver (Sumeet Pawnikar)" * tag 'thermal-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: intel_tcc_cooling: Add TCC cooling support for RaptorLake commit a49b8ce7306cf8031361a6a4f7f6bc7a775a39c8 Author: Daniel Borkmann Date: Fri Jul 1 14:47:27 2022 +0200 bpf, selftests: Add verifier test case for jmp32's jeq/jne Add a test case to trigger the verifier's incorrect conclusion in the case of jmp32's jeq/jne. Also here, make use of dead code elimination, so that we can see the verifier bailing out on unfixed kernels. Before: # ./test_verifier 724 #724/p jeq32/jne32: bounds checking FAIL Failed to load prog 'Permission denied'! R4 !read_ok verification time 8 usec stack depth 0 processed 8 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 0 Summary: 0 PASSED, 0 SKIPPED, 1 FAILED After: # ./test_verifier 724 #724/p jeq32/jne32: bounds checking OK Summary: 1 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220701124727.11153-4-daniel@iogearbox.net commit 73c4936f916de73fa3faec204a4deb37c25e18c1 Author: Daniel Borkmann Date: Fri Jul 1 14:47:26 2022 +0200 bpf, selftests: Add verifier test case for imm=0,umin=0,umax=1 scalar Add a test case to trigger the constant scalar issue which leaves the register in scalar(imm=0,umin=0,umax=1,var_off=(0x0; 0x0)) state. Make use of dead code elimination, so that we can see the verifier bailing out on unfixed kernels. For the condition, we use jle given it checks on umax bound. Before: # ./test_verifier 743 #743/p jump & dead code elimination FAIL Failed to load prog 'Permission denied'! R4 !read_ok verification time 11 usec stack depth 0 processed 13 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 1 Summary: 0 PASSED, 0 SKIPPED, 1 FAILED After: # ./test_verifier 743 #743/p jump & dead code elimination OK Summary: 1 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220701124727.11153-3-daniel@iogearbox.net commit 3844d153a41adea718202c10ae91dc96b37453b5 Author: Daniel Borkmann Date: Fri Jul 1 14:47:25 2022 +0200 bpf: Fix insufficient bounds propagation from adjust_scalar_min_max_vals Kuee reported a corner case where the tnum becomes constant after the call to __reg_bound_offset(), but the register's bounds are not, that is, its min bounds are still not equal to the register's max bounds. This in turn allows to leak pointers through turning a pointer register as is into an unknown scalar via adjust_ptr_min_max_vals(). Before: func#0 @0 0: R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 0: (b7) r0 = 1 ; R0_w=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) 1: (b7) r3 = 0 ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0)) 2: (87) r3 = -r3 ; R3_w=scalar() 3: (87) r3 = -r3 ; R3_w=scalar() 4: (47) r3 |= 32767 ; R3_w=scalar(smin=-9223372036854743041,umin=32767,var_off=(0x7fff; 0xffffffffffff8000),s32_min=-2147450881) 5: (75) if r3 s>= 0x0 goto pc+1 ; R3_w=scalar(umin=9223372036854808575,var_off=(0x8000000000007fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767) 6: (95) exit from 5 to 7: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 7: (d5) if r3 s<= 0x8000 goto pc+1 ; R3=scalar(umin=32769,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767) 8: (95) exit from 7 to 9: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=32768,var_off=(0x7fff; 0x8000)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 9: (07) r3 += -32767 ; R3_w=scalar(imm=0,umax=1,var_off=(0x0; 0x0)) <--- [*] 10: (95) exit What can be seen here is that R3=scalar(umin=32767,umax=32768,var_off=(0x7fff; 0x8000)) after the operation R3 += -32767 results in a 'malformed' constant, that is, R3_w=scalar(imm=0,umax=1,var_off=(0x0; 0x0)). Intersecting with var_off has not been done at that point via __update_reg_bounds(), which would have improved the umax to be equal to umin. Refactor the tnum <> min/max bounds information flow into a reg_bounds_sync() helper and use it consistently everywhere. After the fix, bounds have been corrected to R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0)) and thus the register is regarded as a 'proper' constant scalar of 0. After: func#0 @0 0: R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 0: (b7) r0 = 1 ; R0_w=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) 1: (b7) r3 = 0 ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0)) 2: (87) r3 = -r3 ; R3_w=scalar() 3: (87) r3 = -r3 ; R3_w=scalar() 4: (47) r3 |= 32767 ; R3_w=scalar(smin=-9223372036854743041,umin=32767,var_off=(0x7fff; 0xffffffffffff8000),s32_min=-2147450881) 5: (75) if r3 s>= 0x0 goto pc+1 ; R3_w=scalar(umin=9223372036854808575,var_off=(0x8000000000007fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767) 6: (95) exit from 5 to 7: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 7: (d5) if r3 s<= 0x8000 goto pc+1 ; R3=scalar(umin=32769,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767) 8: (95) exit from 7 to 9: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=32768,var_off=(0x7fff; 0x8000)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) 9: (07) r3 += -32767 ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0)) <--- [*] 10: (95) exit Fixes: b03c9f9fdc37 ("bpf/verifier: track signed and unsigned min/max values") Reported-by: Kuee K1r0a Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220701124727.11153-2-daniel@iogearbox.net commit a12ca6277eca6aeeccf66e840c23a2b520e24c8f Author: Daniel Borkmann Date: Fri Jul 1 14:47:24 2022 +0200 bpf: Fix incorrect verifier simulation around jmp32's jeq/jne Kuee reported a quirk in the jmp32's jeq/jne simulation, namely that the register value does not match expectations for the fall-through path. For example: Before fix: 0: R1=ctx(off=0,imm=0) R10=fp0 0: (b7) r2 = 0 ; R2_w=P0 1: (b7) r6 = 563 ; R6_w=P563 2: (87) r2 = -r2 ; R2_w=Pscalar() 3: (87) r2 = -r2 ; R2_w=Pscalar() 4: (4c) w2 |= w6 ; R2_w=Pscalar(umin=563,umax=4294967295,var_off=(0x233; 0xfffffdcc),s32_min=-2147483085) R6_w=P563 5: (56) if w2 != 0x8 goto pc+1 ; R2_w=P571 <--- [*] 6: (95) exit R0 !read_ok After fix: 0: R1=ctx(off=0,imm=0) R10=fp0 0: (b7) r2 = 0 ; R2_w=P0 1: (b7) r6 = 563 ; R6_w=P563 2: (87) r2 = -r2 ; R2_w=Pscalar() 3: (87) r2 = -r2 ; R2_w=Pscalar() 4: (4c) w2 |= w6 ; R2_w=Pscalar(umin=563,umax=4294967295,var_off=(0x233; 0xfffffdcc),s32_min=-2147483085) R6_w=P563 5: (56) if w2 != 0x8 goto pc+1 ; R2_w=P8 <--- [*] 6: (95) exit R0 !read_ok As can be seen on line 5 for the branch fall-through path in R2 [*] is that given condition w2 != 0x8 is false, verifier should conclude that r2 = 8 as upper 32 bit are known to be zero. However, verifier incorrectly concludes that r2 = 571 which is far off. The problem is it only marks false{true}_reg as known in the switch for JE/NE case, but at the end of the function, it uses {false,true}_{64,32}off to update {false,true}_reg->var_off and they still hold the prior value of {false,true}_reg->var_off before it got marked as known. The subsequent __reg_combine_32_into_64() then propagates this old var_off and derives new bounds. The information between min/max bounds on {false,true}_reg from setting the register to known const combined with the {false,true}_reg->var_off based on the old information then derives wrong register data. Fix it by detangling the BPF_JEQ/BPF_JNE cases and updating relevant {false,true}_{64,32}off tnums along with the register marking to known constant. Fixes: 3f50f132d840 ("bpf: Verifier, do explicit ALU32 bounds tracking") Reported-by: Kuee K1r0a Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220701124727.11153-1-daniel@iogearbox.net commit 9ee7827668c7c30f587b0101c4e6240672a4f429 Merge: b336ad598a3bb bc621588ff591 Author: Linus Torvalds Date: Fri Jul 1 12:55:28 2022 -0700 Merge tag 'pm-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix some issues in cpufreq drivers and some issues in devfreq: - Fix error code path issues related PROBE_DEFER handling in devfreq (Christian Marangi) - Revert an editing accident in SPDX-License line in the devfreq passive governor (Lukas Bulwahn) - Fix refcount leak in of_get_devfreq_events() in the exynos-ppmu devfreq driver (Miaoqian Lin) - Use HZ_PER_KHZ macro in the passive devfreq governor (Yicong Yang) - Fix missing of_node_put for qoriq and pmac32 driver (Liang He) - Fix issues around throttle interrupt for qcom driver (Stephen Boyd) - Add MT8186 to cpufreq-dt-platdev blocklist (AngeloGioacchino Del Regno) - Make amd-pstate enable CPPC on resume from S3 (Jinzhou Su)" * tag 'pm-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM / devfreq: passive: revert an editing accident in SPDX-License line PM / devfreq: Fix kernel warning with cpufreq passive register fail PM / devfreq: Rework freq_table to be local to devfreq struct PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events PM / devfreq: passive: Use HZ_PER_KHZ macro in units.h PM / devfreq: Fix cpufreq passive unregister erroring on PROBE_DEFER PM / devfreq: Mute warning on governor PROBE_DEFER PM / devfreq: Fix kernel panic with cpu based scaling to passive gov cpufreq: Add MT8186 to cpufreq-dt-platdev blocklist cpufreq: pmac32-cpufreq: Fix refcount leak bug cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c cpufreq: amd-pstate: Add resume and suspend callbacks commit bc621588ff591564ea01ad107e7bae869c1c0285 Merge: 589cb2c0b8daf 049b1ed9bef1e Author: Rafael J. Wysocki Date: Fri Jul 1 21:43:08 2022 +0200 Merge branch 'pm-cpufreq' Merge cpufreq fixes for 5.19-rc5, including ARM cpufreq fixes and the following one: - Make amd-pstate enable CPPC on resume from S3 (Jinzhou Su). * pm-cpufreq: cpufreq: Add MT8186 to cpufreq-dt-platdev blocklist cpufreq: pmac32-cpufreq: Fix refcount leak bug cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c cpufreq: amd-pstate: Add resume and suspend callbacks commit b336ad598a3bbeddfdb71d86349b9d4024bddefe Merge: d0f67adb79069 d0e51022a025c Author: Linus Torvalds Date: Fri Jul 1 12:05:27 2022 -0700 Merge tag 'hwmon-for-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix error handling in ibmaem driver initialization - Fix bad data reported by occ driver after setting power cap - Fix typos in pmbus/ucd9200 driver comments * tag 'hwmon-for-v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (ibmaem) don't call platform_device_del() if platform_device_add() fails hwmon: (pmbus/ucd9200) fix typos in comments hwmon: (occ) Prevent power cap command overwriting poll response commit 887371066039011144b4a94af97d9328df6869a2 Author: Rafael J. Wysocki Date: Thu Jun 30 21:16:41 2022 +0200 PM: runtime: Fix supplier device management during consumer probe Because pm_runtime_get_suppliers() bumps up the rpm_active counter of each device link to a supplier of the given device in addition to bumping up the supplier's PM-runtime usage counter, a runtime suspend of the consumer device may case the latter to go down to 0 when pm_runtime_put_suppliers() is running on a remote CPU. If that happens after pm_runtime_put_suppliers() has released power.lock for the consumer device, and a runtime resume of that device takes place immediately after it, before pm_runtime_put() is called for the supplier, that pm_runtime_put() call may cause the supplier to be suspended even though the consumer is active. To prevent that from happening, modify pm_runtime_get_suppliers() to call pm_runtime_get_sync() for the given device's suppliers without touching the rpm_active counters of the involved device links Accordingly, modify pm_runtime_put_suppliers() to call pm_runtime_put() for the given device's suppliers without looking at the rpm_active counters of the device links at hand. [This is analogous to what happened before commit 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter imbalance").] Since pm_runtime_get_suppliers() sets supplier_preactivated for each device link where the supplier's PM-runtime usage counter has been incremented and pm_runtime_put_suppliers() calls pm_runtime_put() for the suppliers whose device links have supplier_preactivated set, the PM-runtime usage counter is balanced for each supplier and this is independent of the runtime suspend and resume of the consumer device. However, in case a device link with DL_FLAG_PM_RUNTIME set is dropped during the consumer device probe, so pm_runtime_get_suppliers() bumps up the supplier's PM-runtime usage counter, but it cannot be dropped by pm_runtime_put_suppliers(), make device_link_release_fn() take care of that. Fixes: 4c06c4e6cf63 ("driver core: Fix possible supplier PM-usage counter imbalance") Reported-by: Peter Wang Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Reviewed-by: Peter Wang Cc: 5.1+ # 5.1+ commit 07358194badf73e267289b40b761f5dc56928eab Author: Rafael J. Wysocki Date: Mon Jun 27 20:42:18 2022 +0200 PM: runtime: Redefine pm_runtime_release_supplier() Instead of passing an extra bool argument to pm_runtime_release_supplier(), make its callers take care of triggering a runtime-suspend of the supplier device as needed. No expected functional impact. Suggested-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Cc: 5.1+ # 5.1+ commit d0e51022a025ca5350fafb8e413a6fe5d4baf833 Author: Yang Yingliang Date: Fri Jul 1 15:41:53 2022 +0800 hwmon: (ibmaem) don't call platform_device_del() if platform_device_add() fails If platform_device_add() fails, it no need to call platform_device_del(), split platform_device_unregister() into platform_device_del/put(), so platform_device_put() can be called separately. Fixes: 8808a793f052 ("ibmaem: new driver for power/energy/temp meters in IBM System X hardware") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220701074153.4021556-1-yangyingliang@huawei.com Signed-off-by: Guenter Roeck commit d0f67adb790698017030365e90e9e394de7cac7c Merge: cec84e7547d3f 4109823037729 Author: Linus Torvalds Date: Fri Jul 1 11:23:21 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Catalin Marinas: "Restore TLB invalidation for the 'break-before-make' rule on contiguous ptes (missed in a recent clean-up)" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes commit cec84e7547d3f95b3fa4ded1618cb43d5d98a76a Merge: 76ff294e16192 d7d488f41b41a Author: Linus Torvalds Date: Fri Jul 1 11:19:14 2022 -0700 Merge tag 's390-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix purgatory build process so bin2c tool does not get built unnecessarily and the Makefile is more consistent with other architectures. - Return earlier simple design of arch_get_random_seed_long|int() and arch_get_random_long|int() callbacks as result of changes in generic RNG code. - Fix minor comment typos and spelling mistakes. * tag 's390-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/qdio: Fix spelling mistake s390/sclp: Fix typo in comments s390/archrandom: simplify back to earlier design and initialize earlier s390/purgatory: remove duplicated build rule of kexec-purgatory.o s390/purgatory: hard-code obj-y in Makefile s390: remove unneeded 'select BUILD_BIN2C' commit 76ff294e161921e9867ad68775ba95a210eb5ec3 Merge: 6f8693ea2bfe8 4f40a5b554461 Author: Linus Torvalds Date: Fri Jul 1 11:11:32 2022 -0700 Merge tag 'nfs-for-5.19-3' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client fixes from Anna Schumaker: - Allocate a fattr for _nfs4_discover_trunking() - Fix module reference count leak in nfs4_run_state_manager() * tag 'nfs-for-5.19-3' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFSv4: Add an fattr allocation to _nfs4_discover_trunking() NFS: restore module put when manager exits. commit 6f8693ea2bfe8c10a859841b907bc7c8f41dbd55 Merge: 8300d380309a4 8692969e9164c Author: Linus Torvalds Date: Fri Jul 1 11:06:21 2022 -0700 Merge tag 'ceph-for-5.19-rc5' of https://github.com/ceph/ceph-client Pull ceph fix from Ilya Dryomov: "A ceph filesystem fix, marked for stable. There appears to be a deeper issue on the MDS side, but for now we are going with this one-liner to avoid busy looping and potential soft lockups" * tag 'ceph-for-5.19-rc5' of https://github.com/ceph/ceph-client: ceph: wait on async create before checking caps for syncfs commit 8300d380309a47b4f960379667278bcfa4d901e1 Merge: 0a35d1622d5cd 617b365872a24 Author: Linus Torvalds Date: Fri Jul 1 10:58:39 2022 -0700 Merge tag 'for-5.19/dm-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: "Three fixes for invalid memory accesses discovered by using KASAN while running the lvm2 testsuite's dm-raid tests. Includes changes to MD's raid5.c given the dependency dm-raid has on the MD code" * tag 'for-5.19/dm-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm raid: fix KASAN warning in raid5_add_disks dm raid: fix KASAN warning in raid5_remove_disk dm raid: fix accesses beyond end of raid member array commit 0a35d1622d5cd7693d75b7124913c75a7e3fabd0 Merge: d516e221e2fb8 09007af2b627f Author: Linus Torvalds Date: Fri Jul 1 10:52:01 2022 -0700 Merge tag 'io_uring-5.19-2022-07-01' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Two minor tweaks: - While we still can, adjust the send/recv based flags to be in ->ioprio rather than in ->addr2. This is consistent with eg accept, and also doesn't waste a full 64-bit field for flags (Pavel) - 5.18-stable fix for re-importing provided buffers. Not much real world relevance here as it'll only impact non-pollable files gone async, which is more of a practical test case rather than something that is used in the wild (Dylan)" * tag 'io_uring-5.19-2022-07-01' of git://git.kernel.dk/linux-block: io_uring: fix provided buffer import io_uring: keep sendrecv flags in ioprio commit d516e221e2fb88cd31c7ea29d743045efc4e69dd Merge: 067c227379c0e f3163d8567adb Author: Linus Torvalds Date: Fri Jul 1 10:42:10 2022 -0700 Merge tag 'block-5.19-2022-07-01' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Fix for batch getting of tags in sbitmap (wuchi) - NVMe pull request via Christoph: - More quirks (Lamarque Vieira Souza, Pablo Greco) - Fix a fabrics disconnect regression (Ruozhu Li) - Fix a nvmet-tcp data_digest calculation regression (Sagi Grimberg) - Fix nvme-tcp send failure handling (Sagi Grimberg) - Fix a regression with nvmet-loop and passthrough controllers (Alan Adamson) * tag 'block-5.19-2022-07-01' of git://git.kernel.dk/linux-block: nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA IM2P33F8ABR1 nvmet: add a clear_ids attribute for passthru targets nvme: fix regression when disconnect a recovering ctrl nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G) nvme-tcp: always fail a request when sending it failed nvmet-tcp: fix regression in data_digest calculation lib/sbitmap: Fix invalid loop in __sbitmap_queue_get_batch() commit 067c227379c0ec96cb19ed9aacea6b1281982368 Merge: 690685ffcdcec fce54ed027577 Author: Linus Torvalds Date: Fri Jul 1 10:38:17 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fix from James Bottomley: "One simple driver fix for a dma overrun" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: hisi_sas: Limit max hw sectors for v3 HW commit 690685ffcdcec3975f45eafe3dcf4bff29aa1676 Merge: 9650910d05a31 32788beb103f7 Author: Linus Torvalds Date: Fri Jul 1 10:31:44 2022 -0700 Merge tag 'ata-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: - Fix a compilation warning with some versions of gcc/sparse when compiling the pata_cs5535 driver, from John. * tag 'ata-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_cs5535: Fix W=1 warnings commit 410982303772993a86bb7a9cfa7ece34522b2636 Author: Will Deacon Date: Wed Jun 29 10:53:49 2022 +0100 arm64: hugetlb: Restore TLB invalidation for BBM on contiguous ptes Commit fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()") removed TLB invalidation from get_clear_flush() [now get_clear_contig()] on the basis that the core TLB invalidation code is aware of hugetlb mappings backed by contiguous page-table entries and will cover the correct virtual address range. However, this change also resulted in the TLB invalidation being removed from the "break" step in the break-before-make (BBM) sequence used internally by huge_ptep_set_{access_flags,wrprotect}(), therefore making the BBM sequence unsafe irrespective of later invalidation. Although the architecture is desperately unclear about how exactly contiguous ptes should be updated in a live page-table, restore TLB invalidation to our BBM sequence under the assumption that BBM is the right thing to be doing in the first place. Fixes: fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()") Cc: Ard Biesheuvel Cc: Steve Capper Cc: Anshuman Khandual Cc: Mike Kravetz Cc: Marc Zyngier Signed-off-by: Will Deacon Reviewed-by: Catalin Marinas Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220629095349.25748-1-will@kernel.org Signed-off-by: Catalin Marinas commit 9650910d05a31d62f562f90ca15ece685a4c1b9c Merge: a175eca0f3d74 a79e69c8714f4 Author: Linus Torvalds Date: Fri Jul 1 10:01:32 2022 -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: "Two small fixes - Initialize a spinlock in the stm32 reset code - Add dt bindings to the clk maintainer filepattern" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: MAINTAINERS: add include/dt-bindings/clock to COMMON CLK FRAMEWORK clk: stm32: rcc_reset: Fix missing spin_lock_init() commit 09f7b80fac3e588b282ad26aabd7336d7d293efd Author: Sascha Hauer Date: Fri Jun 17 13:50:42 2022 +0200 dmaengine: imx-sdma: only restart cyclic channel when enabled An interrupt for a channel might be pending even after struct dma_device::device_terminate_all has been called. In that case the recently introduced warning message "restart cyclic channel..." triggers and the channel will be restarted. This is not desired as the channel has just been stopped. Only restart the channel when we still have a descriptor set for it (which will be set to NULL in sdma_terminate_all()). Fixes: 5b215c28b9235 ("dmaengine: imx-sdma: restart cyclic channel if needed") Cc: stable@vger.kernel.org Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220617115042.4004062-1-s.hauer@pengutronix.de Signed-off-by: Vinod Koul commit 7561cea5dbb97fecb952548a0fb74fb105bf4664 Author: Darrick J. Wong Date: Fri Jul 1 09:08:33 2022 -0700 xfs: prevent a UAF when log IO errors race with unmount KASAN reported the following use after free bug when running generic/475: XFS (dm-0): Mounting V5 Filesystem XFS (dm-0): Starting recovery (logdev: internal) XFS (dm-0): Ending recovery (logdev: internal) Buffer I/O error on dev dm-0, logical block 20639616, async page read Buffer I/O error on dev dm-0, logical block 20639617, async page read XFS (dm-0): log I/O error -5 XFS (dm-0): Filesystem has been shut down due to log error (0x2). XFS (dm-0): Unmounting Filesystem XFS (dm-0): Please unmount the filesystem and rectify the problem(s). ================================================================== BUG: KASAN: use-after-free in do_raw_spin_lock+0x246/0x270 Read of size 4 at addr ffff888109dd84c4 by task 3:1H/136 CPU: 3 PID: 136 Comm: 3:1H Not tainted 5.19.0-rc4-xfsx #rc4 8e53ab5ad0fddeb31cee5e7063ff9c361915a9c4 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 Workqueue: xfs-log/dm-0 xlog_ioend_work [xfs] Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0x2b8/0x661 ? do_raw_spin_lock+0x246/0x270 kasan_report+0xab/0x120 ? do_raw_spin_lock+0x246/0x270 do_raw_spin_lock+0x246/0x270 ? rwlock_bug.part.0+0x90/0x90 xlog_force_shutdown+0xf6/0x370 [xfs 4ad76ae0d6add7e8183a553e624c31e9ed567318] xlog_ioend_work+0x100/0x190 [xfs 4ad76ae0d6add7e8183a553e624c31e9ed567318] process_one_work+0x672/0x1040 worker_thread+0x59b/0xec0 ? __kthread_parkme+0xc6/0x1f0 ? process_one_work+0x1040/0x1040 ? process_one_work+0x1040/0x1040 kthread+0x29e/0x340 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Allocated by task 154099: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 kmem_alloc+0x8d/0x2e0 [xfs] xlog_cil_init+0x1f/0x540 [xfs] xlog_alloc_log+0xd1e/0x1260 [xfs] xfs_log_mount+0xba/0x640 [xfs] xfs_mountfs+0xf2b/0x1d00 [xfs] xfs_fs_fill_super+0x10af/0x1910 [xfs] get_tree_bdev+0x383/0x670 vfs_get_tree+0x7d/0x240 path_mount+0xdb7/0x1890 __x64_sys_mount+0x1fa/0x270 do_syscall_64+0x2b/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 154151: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 ____kasan_slab_free+0x110/0x190 slab_free_freelist_hook+0xab/0x180 kfree+0xbc/0x310 xlog_dealloc_log+0x1b/0x2b0 [xfs] xfs_unmountfs+0x119/0x200 [xfs] xfs_fs_put_super+0x6e/0x2e0 [xfs] generic_shutdown_super+0x12b/0x3a0 kill_block_super+0x95/0xd0 deactivate_locked_super+0x80/0x130 cleanup_mnt+0x329/0x4d0 task_work_run+0xc5/0x160 exit_to_user_mode_prepare+0xd4/0xe0 syscall_exit_to_user_mode+0x1d/0x40 entry_SYSCALL_64_after_hwframe+0x46/0xb0 This appears to be a race between the unmount process, which frees the CIL and waits for in-flight iclog IO; and the iclog IO completion. When generic/475 runs, it starts fsstress in the background, waits a few seconds, and substitutes a dm-error device to simulate a disk falling out of a machine. If the fsstress encounters EIO on a pure data write, it will exit but the filesystem will still be online. The next thing the test does is unmount the filesystem, which tries to clean the log, free the CIL, and wait for iclog IO completion. If an iclog was being written when the dm-error switch occurred, it can race with log unmounting as follows: Thread 1 Thread 2 xfs_log_unmount xfs_log_clean xfs_log_quiesce xlog_ioend_work xlog_force_shutdown test_and_set_bit(XLOG_IOERROR) xfs_log_force xfs_log_umount_write xlog_dealloc_log xlog_cil_destroy spin_lock(&log->l_cilp->xc_push_lock) Therefore, free the CIL after waiting for the iclogs to complete. I /think/ this race has existed for quite a few years now, though I don't remember the ~2014 era logging code well enough to know if it was a real threat then or if the actual race was exposed only more recently. Fixes: ac983517ec59 ("xfs: don't sleep in xlog_cil_force_lsn on shutdown") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 1357d2a65601bc0afb221672d5a8f1649063a141 Author: Wei Yongjun Date: Sat Jun 18 07:28:24 2022 +0000 irqchip/apple-aic: Make symbol 'use_fast_ipi' static The sparse tool complains as follows: drivers/irqchip/irq-apple-aic.c:231:1: warning: symbol 'use_fast_ipi' was not declared. Should it be static? This symbol is not used outside of irq-apple-aic.c, so marks it static. Fixes: 2cf68211664a ("irqchip/apple-aic: Add Fast IPI support") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220618072824.562350-1-weiyongjun1@huawei.com commit fd31000d58f41588fa10128278efdab8474f5ce8 Author: Jamie Iles Date: Thu Jun 30 12:10:08 2022 +0100 irqchip/xilinx: Add explicit dependency on OF_ADDRESS Commit b84dc7f0e364 ("irqchip/xilinx: Remove microblaze+zynq dependency") relaxed the dependencies on the Xilinx interrupt controller to be OF only, but some OF architectures (s390 for example) do not support OF_ADDRESS and so a build of the driver will result in undefined references to of_iomap/iounmap and friends. Fixes: b84dc7f0e364 ("irqchip/xilinx: Remove microblaze+zynq dependency") Reported-by: kernel test robot Signed-off-by: Jamie Iles Acked-by: Michal Simek Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220630111008.3838307-1-jamie@jamieiles.com commit 1f66f63c7312ee085dc989b3c5fa4b3d09fe9d52 Merge: a38dbb4f2028f 8630354f42bef Author: Arnd Bergmann Date: Fri Jul 1 15:15:21 2022 +0200 Merge tag 'imx-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.19, round 2: - Fix the SDIO description for imx7d-smegw01 board to ensure there is no communication made at 1.8V. - Fix pgc_ispdwp power-domain clock, which should be IMX8MP_CLK_MEDIA_ISP_ROOT. - Re-enable framebuffer support in mxs_defconfig to fix a Kconfig regression. - A series from Peng Fan (and Sherry Sun) fixing various pads on i.MX8MP based boards to leave reserved bits untouched. * tag 'imx-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8mp-icore-mx8mp-edim2.2: correct pad settings arm64: dts: imx8mp-phyboard-pollux-rdk: correct i2c2 & mmc settings arm64: dts: imx8mp-phyboard-pollux-rdk: correct eqos pad settings arm64: dts: imx8mp-phyboard-pollux-rdk: correct uart pad settings arm64: dts: imx8mp-venice-gw74xx: correct pad settings arm64: dts: imx8mp-evk: correct I2C3 pad settings arm64: dts: imx8mp-evk: correct I2C1 pad settings arm64: dts: imx8mp-evk: correct I2C5 pad settings arm64: dts: imx8mp-evk: correct vbus pad settings arm64: dts: imx8mp-evk: correct eqos pad settings arm64: dts: imx8mp-evk: correct vbus pad settings arm64: dts: imx8mp-evk: correct gpio-led pad settings arm64: dts: imx8mp-evk: correct the uart2 pinctl value arm64: dts: imx8mp-evk: correct mmc pad settings ARM: mxs_defconfig: Enable the framebuffer arm64: dts: imx8mp: correct clock of pgc_ispdwp ARM: dts: imx7d-smegw01: Fix the SDIO description Link: https://lore.kernel.org/r/20220629021244.GL819983@dragon Signed-off-by: Arnd Bergmann commit a38dbb4f2028f4b9418855239a4c82466ecb935b Merge: 620f83b8326ce 91d60e259c0f5 Author: Arnd Bergmann Date: Fri Jul 1 15:15:07 2022 +0200 Merge tag 'at91-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes for 5.19 It contains 3 SoC fixes and 2 DT fixes: SoC: - fix the wakeup from RTC and RTT for ULP1 mode - fix section mismatch warning - fix SAM9X60 SiP detection DT: - fixes the EEPROMs compatibles for sama5d2_icp and sam9x60ek and EEPROM size for sam9x60ek * tag 'at91-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: pm: Mark at91_pm_secure_init as __init ARM: at91: fix soc detection for SAM9X60 SiPs ARM: dts: at91: sama5d2_icp: fix eeprom compatibles ARM: dts: at91: sam9x60ek: fix eeprom compatible and size ARM: at91: pm: use proper compatibles for sama7g5's rtc and rtt ARM: at91: pm: use proper compatibles for sam9x60's rtc and rtt ARM: at91: pm: use proper compatible for sama5d2's rtc Link: https://lore.kernel.org/r/20220628135130.3114878-1-claudiu.beznea@microchip.com Signed-off-by: Arnd Bergmann commit 620f83b8326ce9706b1118334f0257ae028ce045 Author: Linus Walleij Date: Sun Jun 26 09:43:15 2022 +0200 soc: ixp4xx/npe: Fix unused match warning The kernel test robot found this inconsistency: drivers/soc/ixp4xx/ixp4xx-npe.c:737:34: warning: 'ixp4xx_npe_of_match' defined but not used [-Wunused-const-variable=] 737 | static const struct of_device_id ixp4xx_npe_of_match[] = { This is because the match is enclosed in the of_match_ptr() which compiles into NULL when OF is disabled and this is unnecessary. Fix it by dropping of_match_ptr() around the match. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220626074315.61209-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 8dfeee9dc52cb979cf520f6b345e7baa6b29ecb4 Author: Li kunyu Date: Fri Jul 1 14:47:23 2022 +0800 net: usb: Fix typo in code Remove the repeated ';' from code. Signed-off-by: Li kunyu Signed-off-by: David S. Miller commit 49db68d45bdcad06e28a420d5d911e4178389666 Author: Emil Renner Berthing Date: Mon Jun 27 11:09:39 2022 +0200 dmaengine: dw-axi-dmac: Fix RMW on channel suspend register When the DMA is configured for more than 8 channels the bits controlling suspend moves to another register. However when adding support for this the new register would be completely overwritten in one case and overwritten with values from the old register in another case. Found by comparing the parallel implementation of more than 8 channel support for the StarFive JH7100 SoC by Samin. Fixes: 824351668a41 ("dmaengine: dw-axi-dmac: support DMAX_NUM_CHANNELS > 8") Co-developed-by: Samin Guo Signed-off-by: Samin Guo Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220627090939.1775717-1-emil.renner.berthing@canonical.com Signed-off-by: Vinod Koul commit 44c4237cf3436bda2b185ff728123651ad133f69 Author: Dave Jiang Date: Tue Jun 28 16:00:56 2022 -0700 dmaengine: idxd: force wq context cleanup on device disable path Testing shown that when a wq mode is setup to be dedicated and then torn down and reconfigured to shared, the wq configured end up being dedicated anyays. The root cause is when idxd_device_wqs_clear_state() gets called during idxd_driver removal, idxd_wq_disable_cleanup() does not get called vs when the wq driver is removed first. The check of wq state being "enabled" causes the cleanup to be bypassed. However, idxd_driver->remove() releases all wq drivers. So the wqs goes to "disabled" state and will never be "enabled". By that point, the driver has no idea if the wq was previously configured or clean. So force call idxd_wq_disable_cleanup() on all wqs always to make sure everything gets cleaned up. Reported-by: Tony Zhu Tested-by: Tony Zhu Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits after disabling device") Signed-off-by: Dave Jiang Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Link: https://lore.kernel.org/r/20220628230056.2527816-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 0ac9c3dd0d6fe293cd5044cfad10bec27d171e4e Author: Caleb Connolly Date: Wed Jun 29 15:06:00 2022 +0100 dmaengine: qcom: bam_dma: fix runtime PM underflow Commit dbad41e7bb5f ("dmaengine: qcom: bam_dma: check if the runtime pm enabled") caused unbalanced pm_runtime_get/put() calls when the bam is controlled remotely. This commit reverts it and just enables pm_runtime in all cases, the clk_* functions already just nop when the clock is NULL. Also clean up a bit by removing unnecessary bamclk null checks. Suggested-by: Stephan Gerhold Fixes: dbad41e7bb5f ("dmaengine: qcom: bam_dma: check if the runtime pm enabled") Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20220629140559.118537-1-caleb.connolly@linaro.org Signed-off-by: Vinod Koul commit 71560d98e7f18eb316a17cf12dc139eacb5b490f Merge: 5e8379351dbde fed0d9f13266a Author: David S. Miller Date: Fri Jul 1 11:25:20 2022 +0100 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-06-30 This series contains updates to i40e driver only. Lukasz adds reporting of packets dropped for being too large into the Rx dropped statistics. Norbert clears VF filter and MAC address to resolve issue with older VFs being unable to change their MAC address. ==================== Signed-off-by: David S. Miller commit 7e09ac27f43b382f5fe9bb7c7f4c465ece1f8a23 Author: Juergen Gross Date: Thu Jun 30 09:14:41 2022 +0200 x86: Fix .brk attribute in linker script Commit in Fixes added the "NOLOAD" attribute to the .brk section as a "failsafe" measure. Unfortunately, this leads to the linker no longer covering the .brk section in a program header, resulting in the kernel loader not knowing that the memory for the .brk section must be reserved. This has led to crashes when loading the kernel as PV dom0 under Xen, but other scenarios could be hit by the same problem (e.g. in case an uncompressed kernel is used and the initrd is placed directly behind it). So drop the "NOLOAD" attribute. This has been verified to correctly cover the .brk section by a program header of the resulting ELF file. Fixes: e32683c6f7d2 ("x86/mm: Fix RESERVE_BRK() for older binutils") Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220630071441.28576-4-jgross@suse.com commit 38fa5479b41376dc9d7f57e71c83514285a25ca0 Author: Juergen Gross Date: Thu Jun 30 09:14:40 2022 +0200 x86: Clear .brk area at early boot The .brk section has the same properties as .bss: it is an alloc-only section and should be cleared before being used. Not doing so is especially a problem for Xen PV guests, as the hypervisor will validate page tables (check for writable page tables and hypervisor private bits) before accepting them to be used. Make sure .brk is initially zero by letting clear_bss() clear the brk area, too. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220630071441.28576-3-jgross@suse.com commit 96e8fc5818686d4a1591bb6907e7fdb64ef29884 Author: Juergen Gross Date: Thu Jun 30 09:14:39 2022 +0200 x86/xen: Use clear_bss() for Xen PV guests Instead of clearing the bss area in assembly code, use the clear_bss() function. This requires to pass the start_info address as parameter to xen_start_kernel() in order to avoid the xen_start_info being zeroed again. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Reviewed-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220630071441.28576-2-jgross@suse.com commit 144248515246e52a3706de1ee928af29a63794b8 Author: Hans de Goede Date: Thu Jun 23 13:27:10 2022 +0200 drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Tablet 2 830 The Lenovo Yoga Tablet 2 830F / 830L use a panel which has been mounted 90 degrees rotated. Add a quirk for this. Signed-off-by: Hans de Goede Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220623112710.15693-1-hdegoede@redhat.com commit b75cd218274e01d026dc5240e86fdeb44bbed0c8 Author: Oleksandr Tyshchenko Date: Fri Jul 1 08:57:44 2022 +0200 xen/arm: Fix race in RB-tree based P2M accounting During the PV driver life cycle the mappings are added to the RB-tree by set_foreign_p2m_mapping(), which is called from gnttab_map_refs() and are removed by clear_foreign_p2m_mapping() which is called from gnttab_unmap_refs(). As both functions end up calling __set_phys_to_machine_multi() which updates the RB-tree, this function can be called concurrently. There is already a "p2m_lock" to protect against concurrent accesses, but the problem is that the first read of "phys_to_mach.rb_node" in __set_phys_to_machine_multi() is not covered by it, so this might lead to the incorrect mappings update (removing in our case) in RB-tree. In my environment the related issue happens rarely and only when PV net backend is running, the xen_add_phys_to_mach_entry() claims that it cannot add new pfn <-> mfn mapping to the tree since it is already exists which results in a failure when mapping foreign pages. But there might be other bad consequences related to the non-protected root reads such use-after-free, etc. While at it, also fix the similar usage in __pfn_to_mfn(), so initialize "struct rb_node *n" with the "p2m_lock" held in both functions to avoid possible bad consequences. This is CVE-2022-33744 / XSA-406. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Signed-off-by: Juergen Gross commit f63c2c2032c2e3caad9add3b82cc6e91c376fd26 Author: Jan Beulich Date: Fri Jul 1 08:56:52 2022 +0200 xen-netfront: restore __skb_queue_tail() positioning in xennet_get_responses() The commit referenced below moved the invocation past the "next" label, without any explanation. In fact this allows misbehaving backends undue control over the domain the frontend runs in, as earlier detected errors require the skb to not be freed (it may be retained for later processing via xennet_move_rx_slot(), or it may simply be unsafe to have it freed). This is CVE-2022-33743 / XSA-405. Fixes: 6c5aa6fc4def ("xen networking: add basic XDP support for xen-netfront") Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit 2400617da7eebf9167d71a46122828bc479d64c9 Author: Roger Pau Monne Date: Thu Apr 7 13:04:24 2022 +0200 xen/blkfront: force data bouncing when backend is untrusted Split the current bounce buffering logic used with persistent grants into it's own option, and allow enabling it independently of persistent grants. This allows to reuse the same code paths to perform the bounce buffering required to avoid leaking contiguous data in shared pages not part of the request fragments. Reporting whether the backend is to be trusted can be done using a module parameter, or from the xenstore frontend path as set by the toolstack when adding the device. This is CVE-2022-33742, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit 4491001c2e0fa69efbb748c96ec96b100a5cdb7e Author: Roger Pau Monne Date: Thu Apr 7 12:20:06 2022 +0200 xen/netfront: force data bouncing when backend is untrusted Bounce all data on the skbs to be transmitted into zeroed pages if the backend is untrusted. This avoids leaking data present in the pages shared with the backend but not part of the skb fragments. This requires introducing a new helper in order to allocate skbs with a size multiple of XEN_PAGE_SIZE so we don't leak contiguous data on the granted pages. Reporting whether the backend is to be trusted can be done using a module parameter, or from the xenstore frontend path as set by the toolstack when adding the device. This is CVE-2022-33741, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit 307c8de2b02344805ebead3440d8feed28f2f010 Author: Roger Pau Monne Date: Wed Apr 6 17:38:04 2022 +0200 xen/netfront: fix leaking data in shared pages When allocating pages to be used for shared communication with the backend always zero them, this avoids leaking unintended data present on the pages. This is CVE-2022-33740, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit ee6c6e7342471d468096a16bee9f89b5a6c1e39d Author: Davidlohr Bueso Date: Wed Jun 29 09:52:25 2022 -0700 staging/wlan-ng: get the correct struct hfa384x in work callback hfa384x_usbctlx_completion_task() is bogusly using the reaper BH when in fact this is the completion_bh. This was reflected when trying to acquire the hw->ctlxq.lock and getting a failed lockdep class initialized to it. Fixes: 9442e81d7e7c ("staging/wlan-ng, prism2usb: replace completion_bh tasklet with work") Reported-by: syzbot+ce3408364c4a234dd90c@syzkaller.appspotmail.com Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220629165225.3436822-1-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit 3776c78559853fd151be7c41e369fd076fb679d5 Author: Shuah Khan Date: Thu Jun 30 20:32:56 2022 -0600 misc: rtsx_usb: use separate command and response buffers rtsx_usb uses same buffer for command and response. There could be a potential conflict using the same buffer for both especially if retries and timeouts are involved. Use separate command and response buffers to avoid conflicts. Signed-off-by: Shuah Khan Cc: stable Link: https://lore.kernel.org/r/07e3721804ff07aaab9ef5b39a5691d0718b9ade.1656642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit eb7f8e28420372787933eec079735c35034bda7d Author: Shuah Khan Date: Thu Jun 30 20:32:55 2022 -0600 misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer rtsx_usb driver allocates coherent dma buffer for urb transfers. This buffer is passed to usb_bulk_msg() and usb core tries to map already mapped buffer running into a dma mapping error. xhci_hcd 0000:01:00.0: rejecting DMA map of vmalloc memory WARNING: CPU: 1 PID: 279 at include/linux/dma-mapping.h:326 usb_ hcd_map_urb_for_dma+0x7d6/0x820 ... xhci_map_urb_for_dma+0x291/0x4e0 usb_hcd_submit_urb+0x199/0x12b0 ... usb_submit_urb+0x3b8/0x9e0 usb_start_wait_urb+0xe3/0x2d0 usb_bulk_msg+0x115/0x240 rtsx_usb_transfer_data+0x185/0x1a8 [rtsx_usb] rtsx_usb_send_cmd+0xbb/0x123 [rtsx_usb] rtsx_usb_write_register+0x12c/0x143 [rtsx_usb] rtsx_usb_probe+0x226/0x4b2 [rtsx_usb] Fix it to use kmalloc() to get DMA-able memory region instead. Signed-off-by: Shuah Khan Cc: stable Link: https://lore.kernel.org/r/667d627d502e1ba9ff4f9b94966df3299d2d3c0d.1656642167.git.skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 2f446ffe9d737e9a844b97887919c4fda18246e7 Author: Roger Pau Monne Date: Fri Jul 1 08:23:54 2022 +0200 xen/blkfront: fix leaking data in shared pages When allocating pages to be used for shared communication with the backend always zero them, this avoids leaking unintended data present on the pages. This is CVE-2022-26365, part of XSA-403. Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit 03110b46c99bb0c712f46bec660b1c3f674ce100 Author: Luca Weiss Date: Mon Jun 6 18:04:21 2022 +0200 ARM: dts: qcom: msm8974: re-add missing pinctrl As part of a recent cleanup commit, the pinctrl for a few uart and i2c nodes was removed. Adjust the names and/or add it back and assign it to the uart and i2c nodes. Fixes: 1dfe967ec7cf ("ARM: dts: qcom-msm8974*: Consolidate I2C/UART/SDHCI") Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220606160421.1641778-1-luca@z3ntu.xyz commit a175eca0f3d747599f1fdfac04cc9195b71ec996 Merge: 5e8379351dbde b8f0009bc9edf Author: Linus Torvalds Date: Thu Jun 30 17:19:19 2022 -0700 Merge tag 'drm-fixes-2022-07-01' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Bit quieter this week, the main thing is it pulls in the fixes for the sysfb resource issue you were seeing. these had been queued for next so should have had some decent testing. Otherwise amdgpu, i915 and msm each have a few fixes, and vc4 has one. fbdev: - sysfb fixes/conflicting fb fixes amdgpu: - GPU recovery fix - Fix integer type usage in fourcc header for AMD modifiers - KFD TLB flush fix for gfx9 APUs - Display fix i915: - Fix ioctl argument error return - Fix d3cold disable to allow PCI upstream bridge D3 transition - Fix setting cache_dirty for dma-buf objects on discrete msm: - Fix to increment vsync_cnt before calling drm_crtc_handle_vblank so that userspace sees the value *after* it is incremented if waiting for vblank events - Fix to reset drm_dev to NULL in dp_display_unbind to avoid a crash in probe/bind error paths - Fix to resolve the smatch error of de-referencing before NULL check in dpu_encoder_phys_wb.c - Fix error return to userspace if fence-id allocation fails in submit ioctl vc4: - NULL ptr dereference fix" * tag 'drm-fixes-2022-07-01' of git://anongit.freedesktop.org/drm/drm: Revert "drm/amdgpu/display: set vblank_disable_immediate for DC" drm/amdgpu: To flush tlb for MMHUB of RAVEN series drm/fourcc: fix integer type usage in uapi header drm/amdgpu: fix adev variable used in amdgpu_device_gpu_recover() fbdev: Disable sysfb device registration when removing conflicting FBs firmware: sysfb: Add sysfb_disable() helper function firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer drm/msm/gem: Fix error return on fence id alloc fail drm/i915: tweak the ordering in cpu_write_needs_clflush drm/i915/dgfx: Disable d3cold at gfx root port drm/i915/gem: add missing else drm/vc4: perfmon: Fix variable dereferenced before check drm/msm/dpu: Fix variable dereferenced before check drm/msm/dp: reset drm_dev to NULL at dp_display_unbind() drm/msm/dpu: Increment vsync_cnt before waking up userspace commit b8f0009bc9edf9186b20ae2a9e442ef0af93040e Merge: 078a3be79325e ee7a69aa38d87 Author: Dave Airlie Date: Fri Jul 1 09:27:28 2022 +1000 Merge tag 'drm-misc-fixes-2022-06-30' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes A NULL pointer dereference fix for vc4, and 3 patches to improve the sysfb device behaviour when removing conflicting framebuffers Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220630072404.2fa4z3nk5h5q34ci@houat commit 5e8379351dbde61ea383e514f0f9ecb2c047cf4e Merge: 868f9f2f8e004 58bf4db695287 Author: Linus Torvalds Date: Thu Jun 30 15:26:55 2022 -0700 Merge tag 'net-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter. Current release - new code bugs: - clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user() - mptcp: - invoke MP_FAIL response only when needed - fix shutdown vs fallback race - consistent map handling on failure - octeon_ep: use bitwise AND Previous releases - regressions: - tipc: move bc link creation back to tipc_node_create, fix NPD Previous releases - always broken: - tcp: add a missing nf_reset_ct() in 3WHS handling to prevent socket buffered skbs from keeping refcount on the conntrack module - ipv6: take care of disable_policy when restoring routes - tun: make sure to always disable and unlink NAPI instances - phy: don't trigger state machine while in suspend - netfilter: nf_tables: avoid skb access on nf_stolen - asix: fix "can't send until first packet is send" issue - usb: asix: do not force pause frames support - nxp-nci: don't issue a zero length i2c_master_read() Misc: - ncsi: allow use of proper "mellanox" DT vendor prefix - act_api: add a message for user space if any actions were already flushed before the error was hit" * tag 'net-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (55 commits) net: dsa: felix: fix race between reading PSFP stats and port stats selftest: tun: add test for NAPI dismantle net: tun: avoid disabling NAPI twice net: sparx5: mdb add/del handle non-sparx5 devices net: sfp: fix memory leak in sfp_probe() mlxsw: spectrum_router: Fix rollback in tunnel next hop init net: rose: fix UAF bugs caused by timer handler net: usb: ax88179_178a: Fix packet receiving net: bonding: fix use-after-free after 802.3ad slave unbind ipv6: fix lockdep splat in in6_dump_addrs() net: phy: ax88772a: fix lost pause advertisement configuration net: phy: Don't trigger state machine while in suspend usbnet: fix memory allocation in helpers selftests net: fix kselftest net fatal error NFC: nxp-nci: don't print header length mismatch on i2c error NFC: nxp-nci: Don't issue a zero length i2c_master_read() net: tipc: fix possible refcount leak in tipc_sk_create() nfc: nfcmrvl: Fix irq_of_parse_and_map() return value net: ipv6: unexport __init-annotated seg6_hmac_net_init() ipv6/sit: fix ipip6_tunnel_get_prl return value ... commit 868f9f2f8e004bfe0d3935b1976f625b2924893b Author: Amir Goldstein Date: Thu Jun 30 22:58:49 2022 +0300 vfs: fix copy_file_range() regression in cross-fs copies A regression has been reported by Nicolas Boichat, found while using the copy_file_range syscall to copy a tracefs file. Before commit 5dae222a5ff0 ("vfs: allow copy_file_range to copy across devices") the kernel would return -EXDEV to userspace when trying to copy a file across different filesystems. After this commit, the syscall doesn't fail anymore and instead returns zero (zero bytes copied), as this file's content is generated on-the-fly and thus reports a size of zero. Another regression has been reported by He Zhe - the assertion of WARN_ON_ONCE(ret == -EOPNOTSUPP) can be triggered from userspace when copying from a sysfs file whose read operation may return -EOPNOTSUPP. Since we do not have test coverage for copy_file_range() between any two types of filesystems, the best way to avoid these sort of issues in the future is for the kernel to be more picky about filesystems that are allowed to do copy_file_range(). This patch restores some cross-filesystem copy restrictions that existed prior to commit 5dae222a5ff0 ("vfs: allow copy_file_range to copy across devices"), namely, cross-sb copy is not allowed for filesystems that do not implement ->copy_file_range(). Filesystems that do implement ->copy_file_range() have full control of the result - if this method returns an error, the error is returned to the user. Before this change this was only true for fs that did not implement the ->remap_file_range() operation (i.e. nfsv3). Filesystems that do not implement ->copy_file_range() still fall-back to the generic_copy_file_range() implementation when the copy is within the same sb. This helps the kernel can maintain a more consistent story about which filesystems support copy_file_range(). nfsd and ksmbd servers are modified to fall-back to the generic_copy_file_range() implementation in case vfs_copy_file_range() fails with -EOPNOTSUPP or -EXDEV, which preserves behavior of server-side-copy. fall-back to generic_copy_file_range() is not implemented for the smb operation FSCTL_DUPLICATE_EXTENTS_TO_FILE, which is arguably a correct change of behavior. Fixes: 5dae222a5ff0 ("vfs: allow copy_file_range to copy across devices") Link: https://lore.kernel.org/linux-fsdevel/20210212044405.4120619-1-drinkcat@chromium.org/ Link: https://lore.kernel.org/linux-fsdevel/CANMq1KDZuxir2LM5jOTm0xx+BnvW=ZmpsG47CyHFJwnw7zSX6Q@mail.gmail.com/ Link: https://lore.kernel.org/linux-fsdevel/20210126135012.1.If45b7cdc3ff707bc1efa17f5366057d60603c45f@changeid/ Link: https://lore.kernel.org/linux-fsdevel/20210630161320.29006-1-lhenriques@suse.de/ Reported-by: Nicolas Boichat Reported-by: kernel test robot Signed-off-by: Luis Henriques Fixes: 64bf5ff58dff ("vfs: no fallback for ->copy_file_range") Link: https://lore.kernel.org/linux-fsdevel/20f17f64-88cb-4e80-07c1-85cb96c83619@windriver.com/ Reported-by: He Zhe Tested-by: Namjae Jeon Tested-by: Luis Henriques Signed-off-by: Amir Goldstein Signed-off-by: Linus Torvalds commit a23dd544debcda4ee4a549ec7de59e85c3c8345c Author: Chuck Lever Date: Thu Jun 30 16:48:18 2022 -0400 SUNRPC: Fix READ_PLUS crasher Looks like there are still cases when "space_left - frag1bytes" can legitimately exceed PAGE_SIZE. Ensure that xdr->end always remains within the current encode buffer. Reported-by: Bruce Fields Reported-by: Zorro Lang Link: https://bugzilla.kernel.org/show_bug.cgi?id=216151 Fixes: 6c254bf3b637 ("SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer()") Signed-off-by: Chuck Lever commit 4f40a5b5544618b096d1611a18219dd91fd57f80 Author: Scott Mayhew Date: Mon Jun 27 17:31:29 2022 -0400 NFSv4: Add an fattr allocation to _nfs4_discover_trunking() This was missed in c3ed222745d9 ("NFSv4: Fix free of uninitialized nfs4_label on referral lookup.") and causes a panic when mounting with '-o trunkdiscovery': PID: 1604 TASK: ffff93dac3520000 CPU: 3 COMMAND: "mount.nfs" #0 [ffffb79140f738f8] machine_kexec at ffffffffaec64bee #1 [ffffb79140f73950] __crash_kexec at ffffffffaeda67fd #2 [ffffb79140f73a18] crash_kexec at ffffffffaeda76ed #3 [ffffb79140f73a30] oops_end at ffffffffaec2658d #4 [ffffb79140f73a50] general_protection at ffffffffaf60111e [exception RIP: nfs_fattr_init+0x5] RIP: ffffffffc0c18265 RSP: ffffb79140f73b08 RFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff93dac304a800 RCX: 0000000000000000 RDX: ffffb79140f73bb0 RSI: ffff93dadc8cbb40 RDI: d03ee11cfaf6bd50 RBP: ffffb79140f73be8 R8: ffffffffc0691560 R9: 0000000000000006 R10: ffff93db3ffd3df8 R11: 0000000000000000 R12: ffff93dac4040000 R13: ffff93dac2848e00 R14: ffffb79140f73b60 R15: ffffb79140f73b30 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #5 [ffffb79140f73b08] _nfs41_proc_get_locations at ffffffffc0c73d53 [nfsv4] #6 [ffffb79140f73bf0] nfs4_proc_get_locations at ffffffffc0c83e90 [nfsv4] #7 [ffffb79140f73c60] nfs4_discover_trunking at ffffffffc0c83fb7 [nfsv4] #8 [ffffb79140f73cd8] nfs_probe_fsinfo at ffffffffc0c0f95f [nfs] #9 [ffffb79140f73da0] nfs_probe_server at ffffffffc0c1026a [nfs] RIP: 00007f6254fce26e RSP: 00007ffc69496ac8 RFLAGS: 00000246 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6254fce26e RDX: 00005600220a82a0 RSI: 00005600220a64d0 RDI: 00005600220a6520 RBP: 00007ffc69496c50 R8: 00005600220a8710 R9: 003035322e323231 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc69496c50 R13: 00005600220a8440 R14: 0000000000000010 R15: 0000560020650ef9 ORIG_RAX: 00000000000000a5 CS: 0033 SS: 002b Fixes: c3ed222745d9 ("NFSv4: Fix free of uninitialized nfs4_label on referral lookup.") Signed-off-by: Scott Mayhew Signed-off-by: Anna Schumaker commit 080abad71e99d2becf38c978572982130b927a28 Author: NeilBrown Date: Thu Jun 23 14:47:34 2022 +1000 NFS: restore module put when manager exits. Commit f49169c97fce ("NFSD: Remove svc_serv_ops::svo_module") removed calls to module_put_and_kthread_exit() from threads that acted as SUNRPC servers and had a related svc_serv_ops structure. This was correct. It ALSO removed the module_put_and_kthread_exit() call from nfs4_run_state_manager() which is NOT a SUNRPC service. Consequently every time the NFSv4 state manager runs the module count increments and won't be decremented. So the nfsv4 module cannot be unloaded. So restore the module_put_and_kthread_exit() call. Fixes: f49169c97fce ("NFSD: Remove svc_serv_ops::svo_module") Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit fed0d9f13266a22ce1fc9a97521ef9cdc6271a23 Author: Norbert Zulinski Date: Wed Jun 8 11:10:56 2022 +0200 i40e: Fix VF's MAC Address change on VM Clear VF MAC from parent PF and remove VF filter from VSI when both conditions are true: -VIRTCHNL_VF_OFFLOAD_USO is not used -VM MAC was not set from PF level It affects older version of IAVF and it allow them to change MAC Address on VM, newer IAVF won't change their behaviour. Previously it wasn't possible to change VF's MAC Address on VM because there is flag on IAVF driver that won't allow to change MAC Address if this address is given from PF driver. Fixes: 155f0ac2c96b ("iavf: allow permanent MAC address to change") Signed-off-by: Norbert Zulinski Signed-off-by: Jan Sokolowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 1adb1563e7b7ec659379a18e607e8bc3522d8a78 Author: Lukasz Cieplicki Date: Tue May 31 12:54:20 2022 +0200 i40e: Fix dropped jumbo frames statistics Dropped packets caused by too large frames were not included in dropped RX packets statistics. Issue was caused by not reading the GL_RXERR1 register. That register stores count of packet which was have been dropped due to too large size. Fix it by reading GL_RXERR1 register for each interface. Repro steps: Send a packet larger than the set MTU to SUT Observe rx statists: ethtool -S | grep rx | grep -v ": 0" Fixes: 41a9e55c89be ("i40e: add missing VSI statistics") Signed-off-by: Lukasz Cieplicki Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit f3163d8567adbfebe574fb22c647ce5b829c5971 Merge: fbb564a557809 e1c70d7934635 Author: Jens Axboe Date: Thu Jun 30 14:00:11 2022 -0600 Merge tag 'nvme-5.19-2022-06-30' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - more quirks (Lamarque Vieira Souza, Pablo Greco) - fix a fabrics disconnect regression (Ruozhu Li) - fix a nvmet-tcp data_digest calculation regression (Sagi Grimberg) - fix nvme-tcp send failure handling (Sagi Grimberg) - fix a regression with nvmet-loop and passthrough controllers (Alan Adamson)" * tag 'nvme-5.19-2022-06-30' of git://git.infradead.org/nvme: nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA IM2P33F8ABR1 nvmet: add a clear_ids attribute for passthru targets nvme: fix regression when disconnect a recovering ctrl nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G) nvme-tcp: always fail a request when sending it failed nvmet-tcp: fix regression in data_digest calculation commit 58bf4db695287c4bb2a5fc9fc12c78fdd4c36894 Author: Vladimir Oltean Date: Wed Jun 29 21:30:07 2022 +0300 net: dsa: felix: fix race between reading PSFP stats and port stats Both PSFP stats and the port stats read by ocelot_check_stats_work() are indirectly read through the same mechanism - write to STAT_CFG:STAT_VIEW, read from SYS:STAT:CNT[n]. It's just that for port stats, we write STAT_VIEW with the index of the port, and for PSFP stats, we write STAT_VIEW with the filter index. So if we allow them to run concurrently, ocelot_check_stats_work() may change the view from vsc9959_psfp_counters_get(), and vice versa. Fixes: 7d4b564d6add ("net: dsa: felix: support psfp filter on vsc9959") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220629183007.3808130-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 839b92fede7ba308f1a475aa00fea55f63b7fccf Author: Jakub Kicinski Date: Wed Jun 29 11:19:11 2022 -0700 selftest: tun: add test for NAPI dismantle Being lazy does not pay, add the test for various ordering of tun queue close / detach / destroy. Link: https://lore.kernel.org/r/20220629181911.372047-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ff1fa2081d173b01cebe2fbf0a2d0f1cee9ce4b5 Author: Jakub Kicinski Date: Wed Jun 29 11:19:10 2022 -0700 net: tun: avoid disabling NAPI twice Eric reports that syzbot made short work out of my speculative fix. Indeed when queue gets detached its tfile->tun remains, so we would try to stop NAPI twice with a detach(), close() sequence. Alternative fix would be to move tun_napi_disable() to tun_detach_all() and let the NAPI run after the queue has been detached. Fixes: a8fc8cb5692a ("net: tun: stop NAPI when detaching queues") Reported-by: syzbot Reported-by: Eric Dumazet Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220629181911.372047-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9c5de246c1dbe785268fc2e83c88624b92e4ec93 Author: Casper Andersson Date: Thu Jun 30 14:22:26 2022 +0200 net: sparx5: mdb add/del handle non-sparx5 devices When adding/deleting mdb entries on other net_devices, eg., tap interfaces, it should not crash. Fixes: 3bacfccdcb2d ("net: sparx5: Add mdb handlers") Signed-off-by: Casper Andersson Reviewed-by: Steen Hegelund Link: https://lore.kernel.org/r/20220630122226.316812-1-casper.casan@gmail.com Signed-off-by: Jakub Kicinski commit 62f46fc7b8c639bc97cc9c69e063c40970b6e14c Author: Sumeet Pawnikar Date: Fri May 6 19:20:09 2022 +0530 thermal: intel_tcc_cooling: Add TCC cooling support for RaptorLake Add RaptorLake to the list of processor models supported by the Intel TCC cooling driver. Signed-off-by: Sumeet Pawnikar [ rjw: Subject edits, new changelog ] Signed-off-by: Rafael J. Wysocki commit d7d488f41b41a1b7a1df3c74f2f65eb4585f5d55 Author: Zhang Jiaming Date: Thu Jun 23 14:05:43 2022 +0800 s390/qdio: Fix spelling mistake Change 'defineable' to 'definable'. Change 'paramater' to 'parameter'. Signed-off-by: Zhang Jiaming Reviewed-by: Benjamin Block Link: https://lore.kernel.org/r/20220623060543.12870-1-jiaming@nfschina.com Signed-off-by: Alexander Gordeev commit d608f45ed3cfd411a409cec93fa64232181752ff Author: Jiang Jian Date: Wed Jun 22 22:27:13 2022 +0800 s390/sclp: Fix typo in comments Remove the repeated word 'and' from comments Signed-off-by: Jiang Jian Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220622142713.14187-1-jiangjian@cdjrlc.com Signed-off-by: Alexander Gordeev commit e4f74400308cb8abde5fdc9cad609c2aba32110c Author: Jason A. Donenfeld Date: Sat Jun 11 00:20:23 2022 +0200 s390/archrandom: simplify back to earlier design and initialize earlier s390x appears to present two RNG interfaces: - a "TRNG" that gathers entropy using some hardware function; and - a "DRBG" that takes in a seed and expands it. Previously, the TRNG was wired up to arch_get_random_{long,int}(), but it was observed that this was being called really frequently, resulting in high overhead. So it was changed to be wired up to arch_get_random_ seed_{long,int}(), which was a reasonable decision. Later on, the DRBG was then wired up to arch_get_random_{long,int}(), with a complicated buffer filling thread, to control overhead and rate. Fortunately, none of the performance issues matter much now. The RNG always attempts to use arch_get_random_seed_{long,int}() first, which means a complicated implementation of arch_get_random_{long,int}() isn't really valuable or useful to have around. And it's only used when reseeding, which means it won't hit the high throughput complications that were faced before. So this commit returns to an earlier design of just calling the TRNG in arch_get_random_seed_{long,int}(), and returning false in arch_get_ random_{long,int}(). Part of what makes the simplification possible is that the RNG now seeds itself using the TRNG at bootup. But this only works if the TRNG is detected early in boot, before random_init() is called. So this commit also causes that check to happen in setup_arch(). Cc: stable@vger.kernel.org Cc: Harald Freudenberger Cc: Ingo Franzki Cc: Juergen Christ Cc: Heiko Carstens Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220610222023.378448-1-Jason@zx2c4.com Reviewed-by: Harald Freudenberger Acked-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 09007af2b627f0f195c6c53c4829b285cc3990ec Author: Dylan Yudaken Date: Thu Jun 30 06:20:06 2022 -0700 io_uring: fix provided buffer import io_import_iovec uses the s pointer, but this was changed immediately after the iovec was re-imported and so it was imported into the wrong place. Change the ordering. Fixes: 2be2eb02e2f5 ("io_uring: ensure reads re-import for selected buffers") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220630132006.2825668-1-dylany@fb.com [axboe: ensure we don't half-import as well] Signed-off-by: Jens Axboe commit 1a0e93df1e107dc766fdf86ae88076efd9f376e6 Merge: 9fb3bb25d1532 0fe3dbbefb74a Author: Linus Torvalds Date: Thu Jun 30 10:03:22 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Three minor bug fixes: - qedr not setting the QP timeout properly toward userspace - Memory leak on error path in ib_cm - Divide by 0 in RDMA interrupt moderation" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: linux/dim: Fix divide by 0 in RDMA DIM RDMA/cm: Fix memory leak in ib_cm_insert_listen RDMA/qedr: Fix reporting QP timeout attribute commit 9fb3bb25d15326464e2183a5eb4b1ea8725d560c Merge: f5da5ddf81ad0 8698e3bab4dd7 Author: Linus Torvalds Date: Thu Jun 30 09:57:18 2022 -0700 Merge tag 'fsnotify_for_v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fanotify fix from Jan Kara: "A fix for recently added fanotify API to have stricter checks and refuse some invalid flag combinations to make our life easier in the future" * tag 'fsnotify_for_v5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: refine the validation checks on non-dir inode mask commit f5da5ddf81ad0bfb91fa5e7d087e2ad96f26b7b7 Merge: d9b2ba67917c1 87d044096ea62 Author: Linus Torvalds Date: Thu Jun 30 09:45:42 2022 -0700 Merge tag 'v5.19-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "Fix a regression that breaks the ccp driver" * tag 'v5.19-p3' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ccp - Fix device IRQ counting by using platform_irq_count() commit b941e487152e0909ef43faacae6eeee266d9b378 Author: Biju Das Date: Thu Jun 30 09:39:09 2022 +0100 serial: 8250: dw: Fix the macro RZN1_UART_xDMACR_8_WORD_BURST As per RZ/N1 peripheral user manual(r01uh0752ej0100-rzn1-peripheral.pdf) rev 1.0.0 Mar,2019, the value for 8_WORD_BURST is 4(b2,b1=2’b10). This patch fixes the macro as per the user manual. Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices") Reviewed-by: Phil Edworthy Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220630083909.4294-1-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 39cdb68c64d84e71a4a717000b6e5de208ee60cc Author: Yangxi Xiang Date: Tue Jun 28 17:33:22 2022 +0800 vt: fix memory overlapping when deleting chars in the buffer A memory overlapping copy occurs when deleting a long line. This memory overlapping copy can cause data corruption when scr_memcpyw is optimized to memcpy because memcpy does not ensure its behavior if the destination buffer overlaps with the source buffer. The line buffer is not always broken, because the memcpy utilizes the hardware acceleration, whose result is not deterministic. Fix this problem by using replacing the scr_memcpyw with scr_memmovew. Fixes: 81732c3b2fed ("tty vt: Fix line garbage in virtual console on command line edition") Cc: stable Signed-off-by: Yangxi Xiang Link: https://lore.kernel.org/r/20220628093322.5688-1-xyangxi5@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4f532c1e25319e42996ec18a1f473fd50c8e575d Author: Pali Rohár Date: Tue Jun 28 12:09:22 2022 +0200 serial: mvebu-uart: correctly report configured baudrate value Functions tty_termios_encode_baud_rate() and uart_update_timeout() should be called with the baudrate value which was set to hardware. Linux then report exact values via ioctl(TCGETS2) to userspace. Change mvebu_uart_baud_rate_set() function to return baudrate value which was set to hardware and propagate this value to above mentioned functions. With this change userspace would see precise value in termios c_ospeed field. Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") Cc: stable Reviewed-by: Ilpo Järvinen Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220628100922.10717-1-pali@kernel.org Signed-off-by: Greg Kroah-Hartman commit f9b11229b79c0fb2100b5bb4628a101b1d37fbf6 Author: Ilpo Järvinen Date: Wed Jun 29 12:48:41 2022 +0300 serial: 8250: Fix PM usage_count for console handover When console is enabled, univ8250_console_setup() calls serial8250_console_setup() before .dev is set to uart_port. Therefore, it will not call pm_runtime_get_sync(). Later, when the actual driver is going to take over univ8250_console_exit() is called. As .dev is already set, serial8250_console_exit() makes pm_runtime_put_sync() call with usage count being zero triggering PM usage count warning (extra debug for univ8250_console_setup(), univ8250_console_exit(), and serial8250_register_ports()): [ 0.068987] univ8250_console_setup ttyS0 nodev [ 0.499670] printk: console [ttyS0] enabled [ 0.717955] printk: console [ttyS0] printing thread started [ 1.960163] serial8250_register_ports assigned dev for ttyS0 [ 1.976830] printk: console [ttyS0] disabled [ 1.976888] printk: console [ttyS0] printing thread stopped [ 1.977073] univ8250_console_exit ttyS0 usage:0 [ 1.977075] serial8250 serial8250: Runtime PM usage count underflow! [ 1.977429] dw-apb-uart.6: ttyS0 at MMIO 0x4010006000 (irq = 33, base_baud = 115200) is a 16550A [ 1.977812] univ8250_console_setup ttyS0 usage:2 [ 1.978167] printk: console [ttyS0] printing thread started [ 1.978203] printk: console [ttyS0] enabled To fix the issue, call pm_runtime_get_sync() in serial8250_register_ports() as soon as .dev is set for an uart_port if it has console enabled. This problem became apparent only recently because 82586a721595 ("PM: runtime: Avoid device usage count underflows") added the warning printout. I confirmed this problem also occurs with v5.18 (w/o the warning printout, obviously). Fixes: bedb404e91bb ("serial: 8250_port: Don't use power management for kernel console") Cc: stable Tested-by: Tony Lindgren Reviewed-by: Andy Shevchenko Reviewed-by: Tony Lindgren Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/b4f428e9-491f-daf2-2232-819928dc276e@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 Author: Yi Yang Date: Tue Jun 28 16:35:15 2022 +0800 serial: 8250: fix return error code in serial8250_request_std_resource() If port->mapbase = NULL in serial8250_request_std_resource() , it need return a error code instead of 0. If uart_set_info() fail to request new regions by serial8250_request_std_resource() but the return value of serial8250_request_std_resource() is 0, The system incorrectly considers that the resource application is successful and does not attempt to restore the old setting. A null pointer reference is triggered when the port resource is later invoked. Signed-off-by: Yi Yang Cc: stable Link: https://lore.kernel.org/r/20220628083515.64138-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 5c5f44e36217de5ead789ff25da71c31c2331c96 Author: Ilpo Järvinen Date: Mon Jun 27 18:07:52 2022 +0300 serial: stm32: Clear prev values before setting RTS delays The code lacks clearing of previous DEAT/DEDT values. Thus, changing values on the fly results in garbage delays tending towards the maximum value as more and more bits are ORed together. (Leaving RS485 mode would have cleared the old values though). Fixes: 1bcda09d2910 ("serial: stm32: add support for RS485 hardware control mode") Cc: stable Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220627150753.34510-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 589cb2c0b8daf4fd03e7012c00a52804769e7699 Merge: 03c765b0e3b4c f08fe6fcbe13f Author: Rafael J. Wysocki Date: Thu Jun 30 15:30:30 2022 +0200 Merge tag 'devfreq-fixes-for-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull devfreq fixes for 5.19-rc5 from Chanwoo Choi: "1. Fix devfreq passive governor issue when cpufreq policies are not ready during kernel boot because some CPUs turn on after kernel booting or others. - Re-initialize the vairables of struct devfreq_passive_data when PROBE_DEFER happens when cpufreq_get() returns NULL. - Use dev_err_probe to mute warning when PROBE_DEFER. - Fix cpufreq passive unregister erroring on PROBE_DEFER by using the allocated parent_cpu_data list to free resouce instead of for_each_possible_cpu(). - Remove duplicate cpufreq passive unregister and warning when PROBE_DEFER. - Use HZ_PER_KZH macro in units.h. - Fix wrong indentation in SPDX-License line. 2. Fix reference count leak in exynos-ppmu.c by using of_node_put(). 3. Rework freq_table to be local to devfreq struct - struct devfreq_dev_profile includes freq_table array to store the supported frequencies. If devfreq driver doesn't initialize the freq_table, devfreq core allocates the memory and initializes the freq_table. On a devfreq PROBE_DEFER, the freq_table in the driver profile struct is never reset and may be left in an undefined state. To fix this and correctly handle PROBE_DEFER, use a local freq_table and max_state in the devfreq struct." * tag 'devfreq-fixes-for-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: passive: revert an editing accident in SPDX-License line PM / devfreq: Fix kernel warning with cpufreq passive register fail PM / devfreq: Rework freq_table to be local to devfreq struct PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events PM / devfreq: passive: Use HZ_PER_KHZ macro in units.h PM / devfreq: Fix cpufreq passive unregister erroring on PROBE_DEFER PM / devfreq: Mute warning on governor PROBE_DEFER PM / devfreq: Fix kernel panic with cpu based scaling to passive gov commit 29c1ac230e6056b26846c66881802b581a78ad72 Author: Pavel Begunkov Date: Thu Jun 30 13:25:57 2022 +0100 io_uring: keep sendrecv flags in ioprio We waste a u64 SQE field for flags even though we don't need as many bits and it can be used for something more useful later. Store io_uring specific send/recv flags in sqe->ioprio instead of ->addr2. Signed-off-by: Pavel Begunkov Fixes: 0455d4ccec54 ("io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg") [axboe: change comment in io_uring.h as well] Signed-off-by: Jens Axboe commit 20159e287a031bd6a28429675ccc66b06372fa3c Author: Masahiro Yamada Date: Tue Jun 14 02:09:02 2022 +0900 s390/purgatory: remove duplicated build rule of kexec-purgatory.o This is equivalent to the pattern rule in scripts/Makefile.build. Having the dependency on $(obj)/purgatory.ro is enough. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220613170902.1775211-3-masahiroy@kernel.org Signed-off-by: Alexander Gordeev commit b9a56c113f907b19b91dc5c2383b0169831e15a4 Author: Masahiro Yamada Date: Tue Jun 14 02:09:01 2022 +0900 s390/purgatory: hard-code obj-y in Makefile The purgatory/ directory is entirely guarded in arch/s390/Kbuild. CONFIG_ARCH_HAS_KEXEC_PURGATORY is bool type. $(CONFIG_ARCH_HAS_KEXEC_PURGATORY) is always 'y' when Kbuild visits this Makefile for building. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220613170902.1775211-2-masahiroy@kernel.org Signed-off-by: Alexander Gordeev commit 25deecb21c18ee29e3be8ac6177b2a9504c33d2d Author: Masahiro Yamada Date: Tue Jun 14 02:09:00 2022 +0900 s390: remove unneeded 'select BUILD_BIN2C' Since commit 4c0f032d4963 ("s390/purgatory: Omit use of bin2c"), s390 builds the purgatory without using bin2c. Remove 'select BUILD_BIN2C' to avoid the unneeded build of bin2c. Fixes: 4c0f032d4963 ("s390/purgatory: Omit use of bin2c") Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220613170902.1775211-1-masahiroy@kernel.org Signed-off-by: Alexander Gordeev commit 0a18d802d65cf662644fd1d369c86d84a5630652 Author: Jianglei Nie Date: Wed Jun 29 15:55:50 2022 +0800 net: sfp: fix memory leak in sfp_probe() sfp_probe() allocates a memory chunk from sfp with sfp_alloc(). When devm_add_action() fails, sfp is not freed, which leads to a memory leak. We should use devm_add_action_or_reset() instead of devm_add_action(). Signed-off-by: Jianglei Nie Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220629075550.2152003-1-niejianglei2021@163.com Signed-off-by: Paolo Abeni commit 665030fd0c1ed9f505932e6e73e7a2c788787a0a Author: Petr Machata Date: Wed Jun 29 10:02:05 2022 +0300 mlxsw: spectrum_router: Fix rollback in tunnel next hop init In mlxsw_sp_nexthop6_init(), a next hop is always added to the router linked list, and mlxsw_sp_nexthop_type_init() is invoked afterwards. When that function results in an error, the next hop will not have been removed from the linked list. As the error is propagated upwards and the caller frees the next hop object, the linked list ends up holding an invalid object. A similar issue comes up with mlxsw_sp_nexthop4_init(), where rollback block does exist, however does not include the linked list removal. Both IPv6 and IPv4 next hops have a similar issue with next-hop counter rollbacks. As these were introduced in the same patchset as the next hop linked list, include the cleanup in this patch. Fixes: dbe4598c1e92 ("mlxsw: spectrum_router: Keep nexthops in a linked list") Fixes: a5390278a5eb ("mlxsw: spectrum: Add support for setting counters on nexthops") Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220629070205.803952-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit 9cc02ede696272c5271a401e4f27c262359bc2f6 Author: Duoming Zhou Date: Wed Jun 29 08:26:40 2022 +0800 net: rose: fix UAF bugs caused by timer handler There are UAF bugs in rose_heartbeat_expiry(), rose_timer_expiry() and rose_idletimer_expiry(). The root cause is that del_timer() could not stop the timer handler that is running and the refcount of sock is not managed properly. One of the UAF bugs is shown below: (thread 1) | (thread 2) | rose_bind | rose_connect | rose_start_heartbeat rose_release | (wait a time) case ROSE_STATE_0 | rose_destroy_socket | rose_heartbeat_expiry rose_stop_heartbeat | sock_put(sk) | ... sock_put(sk) // FREE | | bh_lock_sock(sk) // USE The sock is deallocated by sock_put() in rose_release() and then used by bh_lock_sock() in rose_heartbeat_expiry(). Although rose_destroy_socket() calls rose_stop_heartbeat(), it could not stop the timer that is running. The KASAN report triggered by POC is shown below: BUG: KASAN: use-after-free in _raw_spin_lock+0x5a/0x110 Write of size 4 at addr ffff88800ae59098 by task swapper/3/0 ... Call Trace: dump_stack_lvl+0xbf/0xee print_address_description+0x7b/0x440 print_report+0x101/0x230 ? irq_work_single+0xbb/0x140 ? _raw_spin_lock+0x5a/0x110 kasan_report+0xed/0x120 ? _raw_spin_lock+0x5a/0x110 kasan_check_range+0x2bd/0x2e0 _raw_spin_lock+0x5a/0x110 rose_heartbeat_expiry+0x39/0x370 ? rose_start_heartbeat+0xb0/0xb0 call_timer_fn+0x2d/0x1c0 ? rose_start_heartbeat+0xb0/0xb0 expire_timers+0x1f3/0x320 __run_timers+0x3ff/0x4d0 run_timer_softirq+0x41/0x80 __do_softirq+0x233/0x544 irq_exit_rcu+0x41/0xa0 sysvec_apic_timer_interrupt+0x8c/0xb0 asm_sysvec_apic_timer_interrupt+0x1b/0x20 RIP: 0010:default_idle+0xb/0x10 RSP: 0018:ffffc9000012fea0 EFLAGS: 00000202 RAX: 000000000000bcae RBX: ffff888006660f00 RCX: 000000000000bcae RDX: 0000000000000001 RSI: ffffffff843a11c0 RDI: ffffffff843a1180 RBP: dffffc0000000000 R08: dffffc0000000000 R09: ffffed100da36d46 R10: dfffe9100da36d47 R11: ffffffff83cf0950 R12: 0000000000000000 R13: 1ffff11000ccc1e0 R14: ffffffff8542af28 R15: dffffc0000000000 ... Allocated by task 146: __kasan_kmalloc+0xc4/0xf0 sk_prot_alloc+0xdd/0x1a0 sk_alloc+0x2d/0x4e0 rose_create+0x7b/0x330 __sock_create+0x2dd/0x640 __sys_socket+0xc7/0x270 __x64_sys_socket+0x71/0x80 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 152: kasan_set_track+0x4c/0x70 kasan_set_free_info+0x1f/0x40 ____kasan_slab_free+0x124/0x190 kfree+0xd3/0x270 __sk_destruct+0x314/0x460 rose_release+0x2fa/0x3b0 sock_close+0xcb/0x230 __fput+0x2d9/0x650 task_work_run+0xd6/0x160 exit_to_user_mode_loop+0xc7/0xd0 exit_to_user_mode_prepare+0x4e/0x80 syscall_exit_to_user_mode+0x20/0x40 do_syscall_64+0x4f/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 This patch adds refcount of sock when we use functions such as rose_start_heartbeat() and so on to start timer, and decreases the refcount of sock when timer is finished or deleted by functions such as rose_stop_heartbeat() and so on. As a result, the UAF bugs could be mitigated. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Duoming Zhou Tested-by: Duoming Zhou Link: https://lore.kernel.org/r/20220629002640.5693-1-duoming@zju.edu.cn Signed-off-by: Paolo Abeni commit f8ebb3ac881b17712e1d5967c97ab1806b16d3d6 Author: Jose Alonso Date: Tue Jun 28 12:13:02 2022 -0300 net: usb: ax88179_178a: Fix packet receiving This patch corrects packet receiving in ax88179_rx_fixup. - problem observed: ifconfig shows allways a lot of 'RX Errors' while packets are received normally. This occurs because ax88179_rx_fixup does not recognise properly the usb urb received. The packets are normally processed and at the end, the code exits with 'return 0', generating RX Errors. (pkt_cnt==-2 and ptk_hdr over field rx_hdr trying to identify another packet there) This is a usb urb received by "tcpdump -i usbmon2 -X" on a little-endian CPU: 0x0000: eeee f8e3 3b19 87a0 94de 80e3 daac 0800 ^ packet 1 start (pkt_len = 0x05ec) ^^^^ IP alignment pseudo header ^ ethernet packet start last byte ethernet packet v padding (8-bytes aligned) vvvv vvvv 0x05e0: c92d d444 1420 8a69 83dd 272f e82b 9811 0x05f0: eeee f8e3 3b19 87a0 94de 80e3 daac 0800 ... ^ packet 2 0x0be0: eeee f8e3 3b19 87a0 94de 80e3 daac 0800 ... 0x1130: 9d41 9171 8a38 0ec5 eeee f8e3 3b19 87a0 ... 0x1720: 8cfc 15ff 5e4c e85c eeee f8e3 3b19 87a0 ... 0x1d10: ecfa 2a3a 19ab c78c eeee f8e3 3b19 87a0 ... 0x2070: eeee f8e3 3b19 87a0 94de 80e3 daac 0800 ... ^ packet 7 0x2120: 7c88 4ca5 5c57 7dcc 0d34 7577 f778 7e0a 0x2130: f032 e093 7489 0740 3008 ec05 0000 0080 ====1==== ====2==== hdr_off ^ pkt_len = 0x05ec ^^^^ AX_RXHDR_*=0x00830 ^^^^ ^ pkt_len = 0 ^^^^ AX_RXHDR_DROP_ERR=0x80000000 ^^^^ ^ 0x2140: 3008 ec05 0000 0080 3008 5805 0000 0080 0x2150: 3008 ec05 0000 0080 3008 ec05 0000 0080 0x2160: 3008 5803 0000 0080 3008 c800 0000 0080 ===11==== ===12==== ===13==== ===14==== 0x2170: 0000 0000 0e00 3821 ^^^^ ^^^^ rx_hdr ^^^^ pkt_cnt=14 ^^^^ hdr_off=0x2138 ^^^^ ^^^^ padding The dump shows that pkt_cnt is the number of entrys in the per-packet metadata. It is "2 * packet count". Each packet have two entrys. The first have a valid value (pkt_len and AX_RXHDR_*) and the second have a dummy-header 0x80000000 (pkt_len=0 with AX_RXHDR_DROP_ERR). Why exists dummy-header for each packet?!? My guess is that this was done probably to align the entry for each packet to 64-bits and maintain compatibility with old firmware. There is also a padding (0x00000000) before the rx_hdr to align the end of rx_hdr to 64-bit. Note that packets have a alignment of 64-bits (8-bytes). This patch assumes that the dummy-header and the last padding are optional. So it preserves semantics and recognises the same valid packets as the current code. This patch was made using only the dumpfile information and tested with only one device: 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet Fixes: 57bc3d3ae8c1 ("net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup") Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Jose Alonso Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/d6970bb04bf67598af4d316eaeb1792040b18cfd.camel@gmail.com Signed-off-by: Paolo Abeni commit e1c70d79346356bb1ede3f79436df80917845ab9 Author: Lamarque Vieira Souza Date: Wed Jun 29 21:30:53 2022 -0300 nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA IM2P33F8ABR1 ADATA IM2P33F8ABR1 reports bogus eui64 values that appear to be the same across all drives. Quirk them out so they are not marked as "non globally unique" duplicates. Co-developed-by: Felipe de Jesus Araujo da Conceição Signed-off-by: Felipe de Jesus Araujo da Conceição Signed-off-by: Lamarque V. Souza Cc: stable@vger.kernel.org Signed-off-by: Christoph Hellwig commit 34ad61514c4c3657df21a058f9961c3bb2f84ff2 Author: Alan Adamson Date: Mon Jun 27 16:25:43 2022 -0700 nvmet: add a clear_ids attribute for passthru targets If the clear_ids attribute is set to true, the EUI/GUID/UUID is cleared for the passthru target. By default, loop targets will set clear_ids to true. This resolves an issue where a connect to a passthru target fails when using a trtype of 'loop' because EUI/GUID/UUID is not unique. Fixes: 2079f41ec6ff ("nvme: check that EUI/GUID/UUID are globally unique") Signed-off-by: Alan Adamson Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 050133e1aa2cb49bb17be847d48a4431598ef562 Author: Yevhen Orlov Date: Wed Jun 29 04:29:14 2022 +0300 net: bonding: fix use-after-free after 802.3ad slave unbind commit 0622cab0341c ("bonding: fix 802.3ad aggregator reselection"), resolve case, when there is several aggregation groups in the same bond. bond_3ad_unbind_slave will invalidate (clear) aggregator when __agg_active_ports return zero. So, ad_clear_agg can be executed even, when num_of_ports!=0. Than bond_3ad_unbind_slave can be executed again for, previously cleared aggregator. NOTE: at this time bond_3ad_unbind_slave will not update slave ports list, because lag_ports==NULL. So, here we got slave ports, pointing to freed aggregator memory. Fix with checking actual number of ports in group (as was before commit 0622cab0341c ("bonding: fix 802.3ad aggregator reselection") ), before ad_clear_agg(). The KASAN logs are as follows: [ 767.617392] ================================================================== [ 767.630776] BUG: KASAN: use-after-free in bond_3ad_state_machine_handler+0x13dc/0x1470 [ 767.638764] Read of size 2 at addr ffff00011ba9d430 by task kworker/u8:7/767 [ 767.647361] CPU: 3 PID: 767 Comm: kworker/u8:7 Tainted: G O 5.15.11 #15 [ 767.655329] Hardware name: DNI AmazonGo1 A7040 board (DT) [ 767.660760] Workqueue: lacp_1 bond_3ad_state_machine_handler [ 767.666468] Call trace: [ 767.668930] dump_backtrace+0x0/0x2d0 [ 767.672625] show_stack+0x24/0x30 [ 767.675965] dump_stack_lvl+0x68/0x84 [ 767.679659] print_address_description.constprop.0+0x74/0x2b8 [ 767.685451] kasan_report+0x1f0/0x260 [ 767.689148] __asan_load2+0x94/0xd0 [ 767.692667] bond_3ad_state_machine_handler+0x13dc/0x1470 Fixes: 0622cab0341c ("bonding: fix 802.3ad aggregator reselection") Co-developed-by: Maksym Glubokiy Signed-off-by: Maksym Glubokiy Signed-off-by: Yevhen Orlov Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20220629012914.361-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit 4e43e64d0f1332fcc503babad4dc31aead7131ca Author: Eric Dumazet Date: Tue Jun 28 12:12:48 2022 +0000 ipv6: fix lockdep splat in in6_dump_addrs() As reported by syzbot, we should not use rcu_dereference() when rcu_read_lock() is not held. WARNING: suspicious RCU usage 5.19.0-rc2-syzkaller #0 Not tainted net/ipv6/addrconf.c:5175 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by syz-executor326/3617: #0: ffffffff8d5848e8 (rtnl_mutex){+.+.}-{3:3}, at: netlink_dump+0xae/0xc20 net/netlink/af_netlink.c:2223 stack backtrace: CPU: 0 PID: 3617 Comm: syz-executor326 Not tainted 5.19.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 in6_dump_addrs+0x12d1/0x1790 net/ipv6/addrconf.c:5175 inet6_dump_addr+0x9c1/0xb50 net/ipv6/addrconf.c:5300 netlink_dump+0x541/0xc20 net/netlink/af_netlink.c:2275 __netlink_dump_start+0x647/0x900 net/netlink/af_netlink.c:2380 netlink_dump_start include/linux/netlink.h:245 [inline] rtnetlink_rcv_msg+0x73e/0xc90 net/core/rtnetlink.c:6046 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Fixes: 88e2ca308094 ("mld: convert ifmcaddr6 to RCU") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Taehee Yoo Link: https://lore.kernel.org/r/20220628121248.858695-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit fa152f626b24ec2ca3489100d8c5c0a0bce4e2ef Author: Oleksij Rempel Date: Tue Jun 28 13:43:49 2022 +0200 net: phy: ax88772a: fix lost pause advertisement configuration In case of asix_ax88772a_link_change_notify() workaround, we run soft reset which will automatically clear MII_ADVERTISE configuration. The PHYlib framework do not know about changed configuration state of the PHY, so we need use phy_init_hw() to reinit PHY configuration. Fixes: dde258469257 ("net: usb/phy: asix: add support for ax88772A/C PHYs") Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220628114349.3929928-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 1758bde2e4aa5ff188d53e7d9d388bbb7e12eebb Author: Lukas Wunner Date: Tue Jun 28 12:15:08 2022 +0200 net: phy: Don't trigger state machine while in suspend Upon system sleep, mdio_bus_phy_suspend() stops the phy_state_machine(), but subsequent interrupts may retrigger it: They may have been left enabled to facilitate wakeup and are not quiesced until the ->suspend_noirq() phase. Unwanted interrupts may hence occur between mdio_bus_phy_suspend() and dpm_suspend_noirq(), as well as between dpm_resume_noirq() and mdio_bus_phy_resume(). Retriggering the phy_state_machine() through an interrupt is not only undesirable for the reason given in mdio_bus_phy_suspend() (freezing it midway with phydev->lock held), but also because the PHY may be inaccessible after it's suspended: Accesses to USB-attached PHYs are blocked once usb_suspend_both() clears the can_submit flag and PHYs on PCI network cards may become inaccessible upon suspend as well. Amend phy_interrupt() to avoid triggering the state machine if the PHY is suspended. Signal wakeup instead if the attached net_device or its parent has been configured as a wakeup source. (Those conditions are identical to mdio_bus_phy_may_suspend().) Postpone handling of the interrupt until the PHY has resumed. Before stopping the phy_state_machine() in mdio_bus_phy_suspend(), wait for a concurrent phy_interrupt() to run to completion. That is necessary because phy_interrupt() may have checked the PHY's suspend status before the system sleep transition commenced and it may thus retrigger the state machine after it was stopped. Likewise, after re-enabling interrupt handling in mdio_bus_phy_resume(), wait for a concurrent phy_interrupt() to complete to ensure that interrupts which it postponed are properly rerun. The issue was exposed by commit 1ce8b37241ed ("usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling"), but has existed since forever. Fixes: 541cd3ee00a4 ("phylib: Fix deadlock on resume") Link: https://lore.kernel.org/netdev/a5315a8a-32c2-962f-f696-de9a26d30091@samsung.com/ Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Lukas Wunner Acked-by: Rafael J. Wysocki Cc: stable@vger.kernel.org # v2.6.33+ Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/b7f386d04e9b5b0e2738f0125743e30676f309ef.1656410895.git.lukas@wunner.de Signed-off-by: Jakub Kicinski commit e65af5403e462ccd7dff6a045a886c64da598c2e Author: Oliver Neukum Date: Tue Jun 28 11:35:17 2022 +0200 usbnet: fix memory allocation in helpers usbnet provides some helper functions that are also used in the context of reset() operations. During a reset the other drivers on a device are unable to operate. As that can be block drivers, a driver for another interface cannot use paging in its memory allocations without risking a deadlock. Use GFP_NOIO in the helpers. Fixes: 877bd862f32b8 ("usbnet: introduce usbnet 3 command helpers") Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220628093517.7469-1-oneukum@suse.com Signed-off-by: Jakub Kicinski commit 7b92aa9e613508cbaa29dd35bf27db4c35628b10 Author: Coleman Dietsch Date: Tue Jun 28 12:47:44 2022 -0500 selftests net: fix kselftest net fatal error The incorrect path is causing the following error when trying to run net kselftests: In file included from bpf/nat6to4.c:43: ../../../lib/bpf/bpf_helpers.h:11:10: fatal error: 'bpf_helper_defs.h' file not found ^~~~~~~~~~~~~~~~~~~ 1 error generated. Fixes: cf67838c4422 ("selftests net: fix bpf build error") Signed-off-by: Coleman Dietsch Link: https://lore.kernel.org/r/20220628174744.7908-1-dietschc@csp.edu Signed-off-by: Jakub Kicinski commit 236d59292efab107fb7b83f34c78ed2b10ed8e6d Merge: 9577fc5fdc8b0 c2577862eeb0b Author: Jakub Kicinski Date: Wed Jun 29 20:09:32 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Restore set counter when one of the CPU loses race to add elements to sets. 2) After NF_STOLEN, skb might be there no more, update nftables trace infra to avoid access to skb in this case. From Florian Westphal. 3) nftables bridge might register a prerouting hook with zero priority, br_netfilter incorrectly skips it. Also from Florian. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: br_netfilter: do not skip all hooks with 0 priority netfilter: nf_tables: avoid skb access on nf_stolen netfilter: nft_dynset: restore set element counter when failing to update ==================== Link: https://lore.kernel.org/r/ Signed-off-by: Jakub Kicinski commit 078a3be79325e4a5e7e16576b3919999efadfa3f Merge: 8cdf1b56ccab9 a775e4e4941bf Author: Dave Airlie Date: Thu Jun 30 10:48:54 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-06-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-06-29: amdgpu: - GPU recovery fix - Fix integer type usage in fourcc header for AMD modifiers - KFD TLB flush fix for gfx9 APUs - Display fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220629192220.5870-1-alexander.deucher@amd.com commit 8cdf1b56ccab969b393269a8abbf5e1d6dc700c9 Merge: 76f0544428ace 79538490fd7ad Author: Dave Airlie Date: Thu Jun 30 10:21:14 2022 +1000 Merge tag 'drm-intel-fixes-2022-06-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.19-rc5: - Fix ioctl argument error return - Fix d3cold disable to allow PCI upstream bridge D3 transition - Fix setting cache_dirty for dma-buf objects on discrete Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/871qv7rblv.fsf@intel.com commit 617b365872a247480e9dcd50a32c8d1806b21861 Author: Mikulas Patocka Date: Wed Jun 29 13:40:57 2022 -0400 dm raid: fix KASAN warning in raid5_add_disks There's a KASAN warning in raid5_add_disk when running the LVM testsuite. The warning happens in the test lvconvert-raid-reshape-linear_to_raid6-single-type.sh. We fix the warning by verifying that rdev->saved_raid_disk is within limits. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 1ebc2cec0b7dd8dad0812449110803bd875ac816 Author: Mikulas Patocka Date: Wed Jun 29 13:40:01 2022 -0400 dm raid: fix KASAN warning in raid5_remove_disk There's a KASAN warning in raid5_remove_disk when running the LVM testsuite. We fix this warning by verifying that the "number" variable is within limits. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 32788beb103f7f71e0192dce701f387070914651 Author: John Garry Date: Wed Jun 29 17:18:44 2022 +0800 ata: pata_cs5535: Fix W=1 warnings x86_64 allmodconfig build with W=1 gives these warnings: drivers/ata/pata_cs5535.c: In function ‘cs5535_set_piomode’: drivers/ata/pata_cs5535.c:93:11: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable] u32 reg, dummy; ^~~~~ drivers/ata/pata_cs5535.c: In function ‘cs5535_set_dmamode’: drivers/ata/pata_cs5535.c:132:11: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable] u32 reg, dummy; ^~~~~ cc1: all warnings being treated as errors Mark variables 'dummy' as "maybe unused" as they are only ever written in rdmsr() calls. Signed-off-by: John Garry Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit f0aa153b6ce8018a052d9c05dc1b8483ac3a0f1a Author: Jiang Jian Date: Wed Jun 22 14:32:31 2022 +0800 hwmon: (pmbus/ucd9200) fix typos in comments Drop the redundant word 'the' in the comments following /* * Set PHASE registers on all pages to 0xff to ensure that phase * specific commands will apply to all phases of a given page (rail). * This only affects the READ_IOUT and READ_TEMPERATURE2 registers. * READ_IOUT will return the sum of currents of all phases of a rail, * and READ_TEMPERATURE2 will return the maximum temperature detected * for the [the - DROP] phases of the rail. */ Signed-off-by: Jiang Jian Link: https://lore.kernel.org/r/20220622063231.20612-1-jiangjian@cdjrlc.com Signed-off-by: Guenter Roeck commit 1bbb2809040a1f9c7c53c9f06c21aa83275ed27b Author: Eddie James Date: Tue Jun 28 15:30:29 2022 -0500 hwmon: (occ) Prevent power cap command overwriting poll response Currently, the response to the power cap command overwrites the first eight bytes of the poll response, since the commands use the same buffer. This means that user's get the wrong data between the time of sending the power cap and the next poll response update. Fix this by specifying a different buffer for the power cap command response. Fixes: 5b5513b88002 ("hwmon: Add On-Chip Controller (OCC) hwmon driver") Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220628203029.51747-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck commit f08fe6fcbe13f83558ecccc4acaf5af3dce71a1f Author: Lukas Bulwahn Date: Tue Jun 28 07:34:11 2022 +0200 PM / devfreq: passive: revert an editing accident in SPDX-License line Commit 26984d9d581e ("PM / devfreq: passive: Keep cpufreq_policy for possible cpus") reworked governor_passive.c, and accidently added a tab in the first line, i.e., the SPDX-License-Identifier line. The checkpatch script warns with the SPDX_LICENSE_TAG warning, and hence pointed this issue out while investigating checkpatch warnings. Revert this editing accident. No functional change. Signed-off-by: Lukas Bulwahn Signed-off-by: Chanwoo Choi commit 82c66d2bbbeda9e493487e7413769087a0b46250 Author: Christian Marangi Date: Mon Jun 20 00:29:39 2022 +0200 PM / devfreq: Fix kernel warning with cpufreq passive register fail Remove cpufreq_passive_unregister_notifier from cpufreq_passive_register_notifier in case of error as devfreq core already call unregister on GOV_START fail. This fix the kernel always printing a WARN on governor PROBE_DEFER as cpufreq_passive_unregister_notifier is called two times and return error on the second call as the cpufreq is already unregistered. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian Marangi Signed-off-by: Chanwoo Choi commit b5d281f6c16dd432b618bdfd36ddba1a58d5b603 Author: Christian Marangi Date: Mon Jun 20 00:03:51 2022 +0200 PM / devfreq: Rework freq_table to be local to devfreq struct On a devfreq PROBE_DEFER, the freq_table in the driver profile struct, is never reset and may be leaved in an undefined state. This comes from the fact that we store the freq_table in the driver profile struct that is commonly defined as static and not reset on PROBE_DEFER. We currently skip the reinit of the freq_table if we found it's already defined since a driver may declare his own freq_table. This logic is flawed in the case devfreq core generate a freq_table, set it in the profile struct and then PROBE_DEFER, freeing the freq_table. In this case devfreq will found a NOT NULL freq_table that has been freed, skip the freq_table generation and probe the driver based on the wrong table. To fix this and correctly handle PROBE_DEFER, use a local freq_table and max_state in the devfreq struct and never modify the freq_table present in the profile struct if it does provide it. Fixes: 0ec09ac2cebe ("PM / devfreq: Set the freq_table of devfreq device") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi Signed-off-by: Chanwoo Choi commit f44b799603a9b5d2e375b0b2d54dd0b791eddfc2 Author: Miaoqian Lin Date: Thu May 26 12:28:56 2022 +0400 PM / devfreq: exynos-ppmu: Fix refcount leak in of_get_devfreq_events of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. This function only calls of_node_put() in normal path, missing it in error paths. Add missing of_node_put() to avoid refcount leak. Fixes: f262f28c1470 ("PM / devfreq: event: Add devfreq_event class") Signed-off-by: Miaoqian Lin Signed-off-by: Chanwoo Choi commit 20e6c3cc90c0a86dba659dd9e7d60b429d88746d Author: Yicong Yang Date: Fri Jun 10 15:54:28 2022 +0800 PM / devfreq: passive: Use HZ_PER_KHZ macro in units.h HZ macros has been centralized in units.h since [1]. Use it to avoid duplicated definition. [1] commit e2c77032fcbe ("units: add the HZ macros") Signed-off-by: Yicong Yang Signed-off-by: Chanwoo Choi commit 0cca7e8dcfa9e6fe7ba697e534a732571f1689d0 Author: Christian Marangi Date: Wed Jun 15 01:09:47 2022 +0200 PM / devfreq: Fix cpufreq passive unregister erroring on PROBE_DEFER With the passive governor, the cpu based scaling can PROBE_DEFER due to the fact that CPU policy are not ready. The cpufreq passive unregister notifier is called both from the GOV_START errors and for the GOV_STOP and assume the notifier is successfully registred every time. With GOV_START failing it's wrong to loop over each possible CPU since the register path has failed for some CPU policy not ready. Change the logic and unregister the notifer based on the current allocated parent_cpu_data list to correctly handle errors and the governor unregister path. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian 'Ansuel' Marangi Signed-off-by: Chanwoo Choi commit e52b045fe07d7874474665c843befa7521853234 Author: Christian Marangi Date: Wed Jun 15 01:09:50 2022 +0200 PM / devfreq: Mute warning on governor PROBE_DEFER Don't print warning when a governor PROBE_DEFER as it's not a real GOV_START fail. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian 'Ansuel' Marangi Signed-off-by: Chanwoo Choi commit 57e00b40033a376de3f3cf0bb9bf7590d2dd679d Author: Christian Marangi Date: Tue Jun 14 13:06:59 2022 +0200 PM / devfreq: Fix kernel panic with cpu based scaling to passive gov The cpufreq passive register notifier can PROBE_DEFER and the devfreq struct is freed and then reallocaed on probe retry. The current logic assume that the code can't PROBE_DEFER so the devfreq struct in the this variable in devfreq_passive_data is assumed to be (if already set) always correct. This cause kernel panic as the code try to access the wrong address. To correctly handle this, update the this variable in devfreq_passive_data to the devfreq reallocated struct. Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor") Signed-off-by: Christian 'Ansuel' Marangi Signed-off-by: Chanwoo Choi commit 8ad59b397f86a4d8014966fdc0552095a0c4fb2b Author: Jean Delvare Date: Wed Jun 22 08:37:43 2022 +0200 i2c: piix4: Fix a memory leak in the EFCH MMIO support The recently added support for EFCH MMIO regions introduced a memory leak in that code path. The leak is caused by the fact that release_resource() merely removes the resource from the tree but does not free its memory. We need to call release_mem_region() instead, which does free the memory. As a nice side effect, this brings back some symmetry between the legacy and MMIO paths. Signed-off-by: Jean Delvare Reported-by: Yi Zhang Tested-by: Yi Zhang Reviewed-by: Terry Bowman Tested-by: Terry Bowman Fixes: 7c148722d074 ("i2c: piix4: Add EFCH MMIO support to region request and release") Signed-off-by: Wolfram Sang commit 5812175389e258141c5e9f8eadc1ed226f67bc11 Author: Yang Yingliang Date: Wed Jun 29 17:46:35 2022 +0800 usb: dwc3-am62: remove unnecesary clk_put() The clk get by devm_clk_get() will be released in devres_release_all(), so there is no need explicitly call clk_put(), or it will cause UAF. Fixes: e8784c0aec03 ("drivers: usb: dwc3: Add AM62 USB wrapper driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220629094635.3116961-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 7441b273388b9a59d8387a03ffbbca9d5af6348c Author: Thinh Nguyen Date: Mon Jun 27 18:41:19 2022 -0700 usb: dwc3: gadget: Fix event pending check The DWC3_EVENT_PENDING flag is used to protect against invalid call to top-half interrupt handler, which can occur when there's a delay in software detection of the interrupt line deassertion. However, the clearing of this flag was done prior to unmasking the interrupt line, creating opportunity where the top-half handler can come. This breaks the serialization and creates a race between the top-half and bottom-half handler, resulting in losing synchronization between the controller and the driver when processing events. To fix this, make sure the clearing of the DWC3_EVENT_PENDING is done at the end of the bottom-half handler. Fixes: d325a1de49d6 ("usb: dwc3: gadget: Prevent losing events in event cache") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/8670aaf1cf52e7d1e6df2a827af2d77263b93b75.1656380429.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit a775e4e4941bf2f326aa36c58f67bd6c96cac717 Author: Alex Deucher Date: Mon Jun 20 18:29:39 2022 -0400 Revert "drm/amdgpu/display: set vblank_disable_immediate for DC" This reverts commit 92020e81ddbeac351ea4a19bcf01743f32b9c800. This causes stuttering and timeouts with DMCUB for some users so revert it until we understand why and safely enable it to save power. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1887 Acked-by: Harry Wentland Signed-off-by: Alex Deucher Cc: Nicholas Kazlauskas Cc: stable@vger.kernel.org commit 5cb0e3fb2c54eabfb3f932a1574bff1774946bc0 Author: Ruili Ji Date: Wed Jun 22 14:20:22 2022 +0800 drm/amdgpu: To flush tlb for MMHUB of RAVEN series amdgpu: [mmhub0] no-retry page fault (src_id:0 ring:40 vmid:8 pasid:32769, for process test_basic pid 3305 thread test_basic pid 3305) amdgpu: in page starting at address 0x00007ff990003000 from IH client 0x12 (VMC) amdgpu: VM_L2_PROTECTION_FAULT_STATUS:0x00840051 amdgpu: Faulty UTCL2 client ID: MP1 (0x0) amdgpu: MORE_FAULTS: 0x1 amdgpu: WALKER_ERROR: 0x0 amdgpu: PERMISSION_FAULTS: 0x5 amdgpu: MAPPING_ERROR: 0x0 amdgpu: RW: 0x1 When memory is allocated by kfd, no one triggers the tlb flush for MMHUB0. There is page fault from MMHUB0. v2:fix indentation v3:change subject and fix indentation Signed-off-by: Ruili Ji Reviewed-by: Philip Yang Reviewed-by: Aaron Liu Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 20b8264394b33adb1640a485a62a84bc1388b6a3 Author: Carlos Llamas Date: Tue Jun 21 20:39:21 2022 +0000 drm/fourcc: fix integer type usage in uapi header Kernel uapi headers are supposed to use __[us]{8,16,32,64} types defined by as opposed to 'uint32_t' and similar. See [1] for the relevant discussion about this topic. In this particular case, the usage of 'uint64_t' escaped headers_check as these macros are not being called here. However, the following program triggers a compilation error: #include int main() { unsigned long x = AMD_FMT_MOD_CLEAR(RB); return 0; } gcc error: drm.c:5:27: error: ‘uint64_t’ undeclared (first use in this function) 5 | unsigned long x = AMD_FMT_MOD_CLEAR(RB); | ^~~~~~~~~~~~~~~~~ This patch changes AMD_FMT_MOD_{SET,CLEAR} macros to use the correct integer types, which fixes the above issue. [1] https://lkml.org/lkml/2019/6/5/18 Fixes: 8ba16d599374 ("drm/fourcc: Add AMD DRM modifiers.") Signed-off-by: Carlos Llamas Reviewed-by: Simon Ser Signed-off-by: Alex Deucher commit bbba251577b27422ebe173e1bd006424d6a8cfb3 Author: Alex Deucher Date: Thu Jun 16 16:52:01 2022 -0400 drm/amdgpu: fix adev variable used in amdgpu_device_gpu_recover() Use the correct adev variable for the drm_fb_helper in amdgpu_device_gpu_recover(). Noticed by inspection. Fixes: 087451f372bf ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 30554a1f0fd6a5d2e2413bdc05389995d5611736 Author: Cédric Le Goater Date: Wed Jun 22 18:16:17 2022 +0200 spi: aspeed: Fix division by zero When using the normal read operation for data transfers, the dummy bus width is zero. In that case, they are no dummy bytes to transfer and setting the dummy field in the controller register becomes useless. Issue was found on a custom "Bifrost" board based on the AST2500 SoC and using a MX25L51245GMI-08G SPI Flash. Reported-by: Ian Woloschin Reviewed-by: Pratyush Yadav Tested-by: Ian Woloschin Fixes: 9da06d7bdec7dad80 ("spi: aspeed: Add support for direct mapping") Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220622161617.3719096-3-clg@kaod.org Signed-off-by: Mark Brown commit 8988ba7dec43aabd43adb1214b922b8873e9da88 Author: Cédric Le Goater Date: Wed Jun 22 18:16:16 2022 +0200 spi: aspeed: Add dev_dbg() to dump the spi-mem direct mapping descriptor The default value of the control register is set using the direct mapping information passed to the ->dirmap_create() handler. Dump the mapping range and the SPI memory operation characteristics to analyze how the register value has been computed. spi-aspeed-smc 1e630000.spi: CE0 read dirmap [ 0x00000000 - 0x04000000 ] OP 0x6c mode:1.1.1.4 naddr:0x4 ndummies:0x1 ... spi-aspeed-smc 1e630000.spi: CE0 write dirmap [ 0x00000000 - 0x04000000 ] OP 0x12 mode:1.1.0.1 naddr:0x4 ndummies:0x0 Reviewed-by: Paul Menzel Signed-off-by: Cédric Le Goater Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220622161617.3719096-2-clg@kaod.org Signed-off-by: Mark Brown commit d9b2ba67917c18822c6a09af41c32fa161f1606b Merge: 732f30694325a 9ab762a84b809 Author: Linus Torvalds Date: Wed Jun 29 09:32:06 2022 -0700 Merge tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: - thinkpad_acpi/ideapad-laptop: mem-leak and platform-profile fixes - panasonic-laptop: missing hotkey presses regression fix - some hardware-id additions - some other small fixes * tag 'platform-drivers-x86-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: hp-wmi: Ignore Sanitization Mode event platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms platform/x86: thinkpad-acpi: profile capabilities as integer platform/x86: panasonic-laptop: filter out duplicate volume up/down/mute keypresses platform/x86: panasonic-laptop: don't report duplicate brightness key-presses platform/x86: panasonic-laptop: revert "Resolve hotkey double trigger bug" platform/x86: panasonic-laptop: sort includes alphabetically platform/x86: panasonic-laptop: de-obfuscate button codes ACPI: video: Change how we determine if brightness key-presses are handled platform/x86: ideapad-laptop: Add Ideapad 5 15ITL05 to ideapad_dytc_v4_allow_table[] platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource platform/mellanox: nvsw-sn2201: fix error code in nvsw_sn2201_create_static_devices() platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver commit 732f30694325ab586a4d90412ace81e50dfe448e Merge: 941e3e7912696 067baa9a37b32 Author: Linus Torvalds Date: Wed Jun 29 09:20:40 2022 -0700 Merge tag '5.19-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: - seek null check (don't use f_seek op directly and blindly) - offset validation in FSCTL_SET_ZERO_DATA - fallocate fix (relates e.g. to xfstests generic/091 and 263) - two cleanup fixes - fix socket settings on some arch * tag '5.19-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: use vfs_llseek instead of dereferencing NULL ksmbd: check invalid FileOffset and BeyondFinalZero in FSCTL_ZERO_DATA ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA ksmbd: remove duplicate flag set in smb2_write ksmbd: smbd: Remove useless license text when SPDX-License-Identifier is already used ksmbd: use SOCK_NONBLOCK type for kernel_accept() commit 8692969e9164c15474b356b9898e5b9b21a85643 Author: Jeff Layton Date: Mon Jun 6 19:31:42 2022 -0400 ceph: wait on async create before checking caps for syncfs Currently, we'll call ceph_check_caps, but if we're still waiting on the reply, we'll end up spinning around on the same inode in flush_dirty_session_caps. Wait for the async create reply before flushing caps. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/55823 Fixes: fbed7045f552 ("ceph: wait for async create reply before sending any cap messages") Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 8944c6fb8add384154b784a90ceca88a51a8c364 Author: Darrick J. Wong Date: Sat Jun 25 10:47:45 2022 -0700 xfs: dont treat rt extents beyond EOF as eofblocks to be cleared On a system with a realtime volume and a 28k realtime extent, generic/491 fails because the test opens a file on a frozen filesystem and closing it causes xfs_release -> xfs_can_free_eofblocks to mistakenly think that the the blocks of the realtime extent beyond EOF are posteof blocks to be freed. Realtime extents cannot be partially unmapped, so this is pointless. Worse yet, this triggers posteof cleanup, which stalls on a transaction allocation, which is why the test fails. Teach the predicate to account for realtime extents properly. Reviewed-by: Dave Chinner Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit e53bcffad0326c1ef4b4baec4262b5343e420c44 Author: Darrick J. Wong Date: Sat Jun 25 10:01:20 2022 -0700 xfs: don't hold xattr leaf buffers across transaction rolls Now that we've established (again!) that empty xattr leaf buffers are ok, we no longer need to bhold them to transactions when we're creating new leaf blocks. Get rid of the entire mechanism, which should simplify the xattr code quite a bit. The original justification for using bhold here was to prevent the AIL from trying to write the empty leaf block into the fs during the brief time that we release the buffer lock. The reason for /that/ was to prevent recovery from tripping over the empty ondisk block. Reviewed-by: Dave Chinner Signed-off-by: Darrick J. Wong commit 7be3bd8856fba99f8b25b9c223250e42292c312e Author: Darrick J. Wong Date: Fri Jun 24 15:01:28 2022 -0700 xfs: empty xattr leaf header blocks are not corruption TLDR: Revert commit 51e6104fdb95 ("xfs: detect empty attr leaf blocks in xfs_attr3_leaf_verify") because it was wrong. Every now and then we get a corruption report from the kernel or xfs_repair about empty leaf blocks in the extended attribute structure. We've long thought that these shouldn't be possible, but prior to 5.18 one would shake loose in the recoveryloop fstests about once a month. A new addition to the xattr leaf block verifier in 5.19-rc1 makes this happen every 7 minutes on my testing cloud. I added a ton of logging to detect any time we set the header count on an xattr leaf block to zero. This produced the following dmesg output on generic/388: XFS (sda4): ino 0x21fcbaf leaf 0x129bf78 hdcount==0! Call Trace: dump_stack_lvl+0x34/0x44 xfs_attr3_leaf_create+0x187/0x230 xfs_attr_shortform_to_leaf+0xd1/0x2f0 xfs_attr_set_iter+0x73e/0xa90 xfs_xattri_finish_update+0x45/0x80 xfs_attr_finish_item+0x1b/0xd0 xfs_defer_finish_noroll+0x19c/0x770 __xfs_trans_commit+0x153/0x3e0 xfs_attr_set+0x36b/0x740 xfs_xattr_set+0x89/0xd0 __vfs_setxattr+0x67/0x80 __vfs_setxattr_noperm+0x6e/0x120 vfs_setxattr+0x97/0x180 setxattr+0x88/0xa0 path_setxattr+0xc3/0xe0 __x64_sys_setxattr+0x27/0x30 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 So now we know that someone is creating empty xattr leaf blocks as part of converting a sf xattr structure into a leaf xattr structure. The conversion routine logs any existing sf attributes in the same transaction that creates the leaf block, so we know this is a setxattr to a file that has no attributes at all. Next, g/388 calls the shutdown ioctl and cycles the mount to trigger log recovery. I also augmented buffer item recovery to call ->verify_struct on any attr leaf blocks and complain if it finds a failure: XFS (sda4): Unmounting Filesystem XFS (sda4): Mounting V5 Filesystem XFS (sda4): Starting recovery (logdev: internal) XFS (sda4): xattr leaf daddr 0x129bf78 hdrcount == 0! Call Trace: dump_stack_lvl+0x34/0x44 xfs_attr3_leaf_verify+0x3b8/0x420 xlog_recover_buf_commit_pass2+0x60a/0x6c0 xlog_recover_items_pass2+0x4e/0xc0 xlog_recover_commit_trans+0x33c/0x350 xlog_recovery_process_trans+0xa5/0xe0 xlog_recover_process_data+0x8d/0x140 xlog_do_recovery_pass+0x19b/0x720 xlog_do_log_recovery+0x62/0xc0 xlog_do_recover+0x33/0x1d0 xlog_recover+0xda/0x190 xfs_log_mount+0x14c/0x360 xfs_mountfs+0x517/0xa60 xfs_fs_fill_super+0x6bc/0x950 get_tree_bdev+0x175/0x280 vfs_get_tree+0x1a/0x80 path_mount+0x6f5/0xaa0 __x64_sys_mount+0x103/0x140 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fc61e241eae And a moment later, the _delwri_submit of the recovered buffers trips the same verifier and recovery fails: XFS (sda4): Metadata corruption detected at xfs_attr3_leaf_verify+0x393/0x420 [xfs], xfs_attr3_leaf block 0x129bf78 XFS (sda4): Unmount and run xfs_repair XFS (sda4): First 128 bytes of corrupted metadata buffer: 00000000: 00 00 00 00 00 00 00 00 3b ee 00 00 00 00 00 00 ........;....... 00000010: 00 00 00 00 01 29 bf 78 00 00 00 00 00 00 00 00 .....).x........ 00000020: a5 1b d0 02 b2 9a 49 df 8e 9c fb 8d f8 31 3e 9d ......I......1>. 00000030: 00 00 00 00 02 1f cb af 00 00 00 00 10 00 00 00 ................ 00000040: 00 50 0f b0 00 00 00 00 00 00 00 00 00 00 00 00 .P.............. 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ XFS (sda4): Corruption of in-memory data (0x8) detected at _xfs_buf_ioapply+0x37f/0x3b0 [xfs] (fs/xfs/xfs_buf.c:1518). Shutting down filesystem. XFS (sda4): Please unmount the filesystem and rectify the problem(s) XFS (sda4): log mount/recovery failed: error -117 XFS (sda4): log mount failed I think I see what's going on here -- setxattr is racing with something that shuts down the filesystem: Thread 1 Thread 2 -------- -------- xfs_attr_sf_addname xfs_attr_shortform_to_leaf xfs_trans_bhold(leaf) xattri_dela_state = XFS_DAS_LEAF_ADD xfs_trans_bhold_release(leaf) Thread 3 -------- xlog_recover_buf_commit_pass2 xlog_recover_do_reg_buffer xfs_buf_delwri_queue(leaf) xfs_buf_delwri_submit _xfs_buf_ioapply(leaf) xfs_attr3_leaf_write_verify As you can see, the bhold keeps the leaf buffer locked and thus prevents the *AIL* from tripping over the ichdr.count==0 check in the write verifier. Unfortunately, it doesn't prevent the log from getting flushed to disk, which sets up log recovery to fail. So. It's clear that the kernel has always had the ability to persist attr leaf blocks with ichdr.count==0, which means that it's part of the ondisk format now. Unfortunately, this check has been added and removed multiple times throughout history. It first appeared in[1] kernel 3.10 as part of the early V5 format patches. The check was later discovered to break log recovery and hence disabled[2] during log recovery in kernel 4.10. Simultaneously, the check was added[3] to xfs_repair 4.9.0 to try to weed out the empty leaf blocks. This was still not correct because log recovery would recover an empty attr leaf block successfully only for regular xattr operations to trip over the empty block during of the block during regular operation. Therefore, the check was removed entirely[4] in kernel 5.7 but removal of the xfs_repair check was forgotten. The continued complaints from xfs_repair lead to us mistakenly re-adding[5] the verifier check for kernel 5.19. Remove it once again. [1] 517c22207b04 ("xfs: add CRCs to attr leaf blocks") [2] 2e1d23370e75 ("xfs: ignore leaf attr ichdr.count in verifier during log replay") [3] f7140161 ("xfs_repair: junk leaf attribute if count == 0") [4] f28cef9e4dac ("xfs: don't fail verifier on empty attr3 leaf block") [5] 51e6104fdb95 ("xfs: detect empty attr leaf blocks in xfs_attr3_leaf_verify") Looking at the rest of the xattr code, it seems that files with empty leaf blocks behave as expected -- listxattr reports no attributes; getxattr on any xattr returns nothing as expected; removexattr does nothing; and setxattr can add attributes just fine. Original-bug: 517c22207b04 ("xfs: add CRCs to attr leaf blocks") Still-not-fixed-by: 2e1d23370e75 ("xfs: ignore leaf attr ichdr.count in verifier during log replay") Removed-in: f28cef9e4dac ("xfs: don't fail verifier on empty attr3 leaf block") Fixes: 51e6104fdb95 ("xfs: detect empty attr leaf blocks in xfs_attr3_leaf_verify") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f43b9876e857c739d407bc56df288b0ebe1a9164 Author: Peter Zijlstra Date: Mon Jun 27 22:21:17 2022 +0000 x86/retbleed: Add fine grained Kconfig knobs Do fine-grained Kconfig for all the various retbleed parts. NOTE: if your compiler doesn't support return thunks this will silently 'upgrade' your mitigation to IBPB, you might not like this. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit f7f70f4aa09dc43d7455c060143e86a017c30548 Author: Ruozhu Li Date: Thu Jun 23 14:45:39 2022 +0800 nvme: fix regression when disconnect a recovering ctrl We encountered a problem that the disconnect command hangs. After analyzing the log and stack, we found that the triggering process is as follows: CPU0 CPU1 nvme_rdma_error_recovery_work nvme_rdma_teardown_io_queues nvme_do_delete_ctrl nvme_stop_queues nvme_remove_namespaces --clear ctrl->namespaces nvme_start_queues --no ns in ctrl->namespaces nvme_ns_remove return(because ctrl is deleting) blk_freeze_queue blk_mq_freeze_queue_wait --wait for ns to unquiesce to clean infligt IO, hang forever This problem was not found in older kernels because we will flush err work in nvme_stop_ctrl before nvme_remove_namespaces.It does not seem to be modified for functional reasons, the patch can be revert to solve the problem. Revert commit 794a4cb3d2f7 ("nvme: remove the .stop_ctrl callout") Signed-off-by: Ruozhu Li Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 1629de0e0373e04d68e88e6d9d3071fbf70b7ea8 Author: Pablo Greco Date: Sat Jun 25 09:15:02 2022 -0300 nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G) ADATA XPG SPECTRIX S40G drives report bogus eui64 values that appear to be the same across drives in one system. Quirk them out so they are not marked as "non globally unique" duplicates. Before: [ 2.258919] nvme nvme1: pci function 0000:06:00.0 [ 2.264898] nvme nvme2: pci function 0000:05:00.0 [ 2.323235] nvme nvme1: failed to set APST feature (2) [ 2.326153] nvme nvme2: failed to set APST feature (2) [ 2.333935] nvme nvme1: allocated 64 MiB host memory buffer. [ 2.336492] nvme nvme2: allocated 64 MiB host memory buffer. [ 2.339611] nvme nvme1: 7/0/0 default/read/poll queues [ 2.341805] nvme nvme2: 7/0/0 default/read/poll queues [ 2.346114] nvme1n1: p1 [ 2.347197] nvme nvme2: globally duplicate IDs for nsid 1 After: [ 2.427715] nvme nvme1: pci function 0000:06:00.0 [ 2.427771] nvme nvme2: pci function 0000:05:00.0 [ 2.488154] nvme nvme2: failed to set APST feature (2) [ 2.489895] nvme nvme1: failed to set APST feature (2) [ 2.498773] nvme nvme2: allocated 64 MiB host memory buffer. [ 2.500587] nvme nvme1: allocated 64 MiB host memory buffer. [ 2.504113] nvme nvme2: 7/0/0 default/read/poll queues [ 2.507026] nvme nvme1: 7/0/0 default/read/poll queues [ 2.509467] nvme nvme2: Ignoring bogus Namespace Identifiers [ 2.512804] nvme nvme1: Ignoring bogus Namespace Identifiers [ 2.513698] nvme1n1: p1 Signed-off-by: Pablo Greco Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Cc: Signed-off-by: Christoph Hellwig commit 41d07df7de841bfbc32725ce21d933ad358f2844 Author: Sagi Grimberg Date: Sun Jun 26 12:24:51 2022 +0300 nvme-tcp: always fail a request when sending it failed queue stoppage and inflight requests cancellation is fully fenced from io_work and thus failing a request from this context. Hence we don't need to try to guess from the socket retcode if this failure is because the queue is about to be torn down or not. We are perfectly safe to just fail it, the request will not be cancelled later on. This solves possible very long shutdown delays when the users issues a 'nvme disconnect-all' Reported-by: Daniel Wagner Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit ed0691cf55140ce0f3fb100225645d902cce904b Author: Sagi Grimberg Date: Fri Jun 24 00:49:53 2022 +0300 nvmet-tcp: fix regression in data_digest calculation Data digest calculation iterates over command mapped iovec. However since commit bac04454ef9f we unmap the iovec before we handle the data digest, and since commit 69b85e1f1d1d we clear nr_mapped when we unmap the iov. Instead of open-coding the command iov traversal, simply call crypto_ahash_digest with the command sg that is already allocated (we already do that for the send path). Rename nvmet_tcp_send_ddgst to nvmet_tcp_calc_ddgst and call it from send and recv paths. Fixes: 69b85e1f1d1d ("nvmet-tcp: add an helper to free the cmd buffers") Fixes: bac04454ef9f ("nvmet-tcp: fix kmap leak when data digest in use") Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit a57f68ddc8865d59a19783080cc52fb4a11dc209 Author: Serge Semin Date: Fri Jun 24 17:18:45 2022 +0300 reset: Fix devm bulk optional exclusive control getter Most likely due to copy-paste mistake the device managed version of the denoted reset control getter has been implemented with invalid semantic, which can be immediately spotted by having "WARN_ON(shared && acquired)" warning in the system log as soon as the method is called. Anyway let's fix it by altering the boolean arguments passed to the __devm_reset_control_bulk_get() method from - shared = true, optional = false, acquired = true to + shared = false, optional = true, acquired = true That's what they were supposed to be in the first place (see the non-devm version of the same method: reset_control_bulk_get_optional_exclusive()). Fixes: 48d71395896d ("reset: Add reset_control_bulk API") Signed-off-by: Serge Semin Reviewed-by: Dmitry Osipenko Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220624141853.7417-2-Sergey.Semin@baikalelectronics.ru commit a5bdaae7ae596686b83a8a5038ee6d9afeb24531 Author: Lukas Bulwahn Date: Wed Jun 1 10:22:39 2022 +0200 MAINTAINERS: rectify entry for SYNOPSYS AXS10x RESET CONTROLLER DRIVER Commit 820f722c05dd ("dt-bindings: reset: snps,axs10x-reset: Convert to yaml") converts snps,axs10x-reset.txt to yaml, but misses to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in SYNOPSYS AXS10x RESET CONTROLLER DRIVER. Signed-off-by: Lukas Bulwahn Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220601082239.12009-1-lukas.bulwahn@gmail.com commit 9577fc5fdc8b07b891709af6453545db405e24ad Author: Michael Walle Date: Mon Jun 27 19:06:43 2022 +0200 NFC: nxp-nci: don't print header length mismatch on i2c error Don't print a misleading header length mismatch error if the i2c call returns an error. Instead just return the error code without any error message. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit eddd95b9423946aaacb55cac6a9b2cea8ab944fc Author: Michael Walle Date: Mon Jun 27 19:06:42 2022 +0200 NFC: nxp-nci: Don't issue a zero length i2c_master_read() There are packets which doesn't have a payload. In that case, the second i2c_master_read() will have a zero length. But because the NFC controller doesn't have any data left, it will NACK the I2C read and -ENXIO will be returned. In case there is no payload, just skip the second i2c master read. Fixes: 6be88670fc59 ("NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver") Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 00aff3590fc0a73bddd3b743863c14e76fd35c0c Author: Hangyu Hua Date: Wed Jun 29 14:34:18 2022 +0800 net: tipc: fix possible refcount leak in tipc_sk_create() Free sk in case tipc_sk_insert() fails. Signed-off-by: Hangyu Hua Reviewed-by: Tung Nguyen Signed-off-by: David S. Miller commit ac790d09885d36143076e7e02825c541e8eee899 Author: Aneesh Kumar K.V Date: Wed Jun 29 10:39:25 2022 +0530 powerpc/memhotplug: Add add_pages override for PPC With commit ffa0b64e3be5 ("powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit") the kernel now validate the addr against high_memory value. This results in the below BUG_ON with dax pfns. [ 635.798741][T26531] kernel BUG at mm/page_alloc.c:5521! 1:mon> e cpu 0x1: Vector: 700 (Program Check) at [c000000007287630] pc: c00000000055ed48: free_pages.part.0+0x48/0x110 lr: c00000000053ca70: tlb_finish_mmu+0x80/0xd0 sp: c0000000072878d0 msr: 800000000282b033 current = 0xc00000000afabe00 paca = 0xc00000037ffff300 irqmask: 0x03 irq_happened: 0x05 pid = 26531, comm = 50-landscape-sy kernel BUG at :5521! Linux version 5.19.0-rc3-14659-g4ec05be7c2e1 (kvaneesh@ltc-boston8) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #625 SMP Thu Jun 23 00:35:43 CDT 2022 1:mon> t [link register ] c00000000053ca70 tlb_finish_mmu+0x80/0xd0 [c0000000072878d0] c00000000053ca54 tlb_finish_mmu+0x64/0xd0 (unreliable) [c000000007287900] c000000000539424 exit_mmap+0xe4/0x2a0 [c0000000072879e0] c00000000019fc1c mmput+0xcc/0x210 [c000000007287a20] c000000000629230 begin_new_exec+0x5e0/0xf40 [c000000007287ae0] c00000000070b3cc load_elf_binary+0x3ac/0x1e00 [c000000007287c10] c000000000627af0 bprm_execve+0x3b0/0xaf0 [c000000007287cd0] c000000000628414 do_execveat_common.isra.0+0x1e4/0x310 [c000000007287d80] c00000000062858c sys_execve+0x4c/0x60 [c000000007287db0] c00000000002c1b0 system_call_exception+0x160/0x2c0 [c000000007287e10] c00000000000c53c system_call_common+0xec/0x250 The fix is to make sure we update high_memory on memory hotplug. This is similar to what x86 does in commit 3072e413e305 ("mm/memory_hotplug: introduce add_pages") Fixes: ffa0b64e3be5 ("powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Kefeng Wang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220629050925.31447-1-aneesh.kumar@linux.ibm.com commit b21bd5a4b130f8370861478d2880985daace5913 Author: Naveen N. Rao Date: Tue Jun 28 00:41:19 2022 +0530 powerpc/bpf: Fix use of user_pt_regs in uapi Trying to build a .c file that includes : $ cat test_bpf_headers.c #include throws the below error: /usr/include/linux/bpf_perf_event.h:14:28: error: field ‘regs’ has incomplete type 14 | bpf_user_pt_regs_t regs; | ^~~~ This is because we typedef bpf_user_pt_regs_t to 'struct user_pt_regs' in arch/powerpc/include/uaps/asm/bpf_perf_event.h, but 'struct user_pt_regs' is not exposed to userspace. Powerpc has both pt_regs and user_pt_regs structures. However, unlike arm64 and s390, we expose user_pt_regs to userspace as just 'pt_regs'. As such, we should typedef bpf_user_pt_regs_t to 'struct pt_regs' for userspace. Within the kernel though, we want to typedef bpf_user_pt_regs_t to 'struct user_pt_regs'. Remove arch/powerpc/include/uapi/asm/bpf_perf_event.h so that the uapi/asm-generic version of the header is exposed to userspace. Introduce arch/powerpc/include/asm/bpf_perf_event.h so that we can typedef bpf_user_pt_regs_t to 'struct user_pt_regs' for use within the kernel. Note that this was not showing up with the bpf selftest build since tools/include/uapi/asm/bpf_perf_event.h didn't include the powerpc variant. Fixes: a6460b03f945ee ("powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT") Cc: stable@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao [mpe: Use typical naming for header include guard] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220627191119.142867-1-naveen.n.rao@linux.vnet.ibm.com commit 8d70f33ed7207e82e51d5a4436c8ba2268a83b14 Author: Vinayak Yadawad Date: Wed Jun 22 19:17:39 2022 +0530 wifi: cfg80211: Allow P2P client interface to indicate port authorization In case of 4way handshake offload, cfg80211_port_authorized enables driver to indicate successful 4way handshake to cfg80211 layer. Currently this path of port authorization is restricted to interface type NL80211_IFTYPE_STATION. This patch extends the use of port authorization API for P2P client as well. Signed-off-by: Vinayak Yadawad Link: https://lore.kernel.org/r/ef25cb49fcb921df2e5d99e574f65e8a009cc52c.1655905440.git.vinayak.yadawad@broadcom.com Signed-off-by: Johannes Berg commit f856373e2f31ffd340e47e2b00027bd4070f74b3 Author: Felix Fietkau Date: Tue May 31 21:08:24 2022 +0200 wifi: mac80211: do not wake queues on a vif that is being stopped When a vif is being removed and sdata->bss is cleared, __ieee80211_wake_txqs can still be called on it, which crashes as soon as sdata->bss is being dereferenced. To fix this properly, check for SDATA_STATE_RUNNING before waking queues, and take the fq lock when setting it (to ensure that __ieee80211_wake_txqs observes the change when running on a different CPU) Signed-off-by: Felix Fietkau Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220531190824.60019-1-nbd@nbd.name Signed-off-by: Johannes Berg commit a4926abb787e2ef3ee2997e6ca8844d859478647 Author: Ryder Lee Date: Thu May 26 21:35:32 2022 +0800 wifi: mac80211: check skb_shared in ieee80211_8023_xmit() Add a missing skb_shared check into 802.3 path to prevent potential use-after-free from happening. This also uses skb_share_check() instead of open-coding in tx path. Signed-off-by: Ryder Lee Link: https://lore.kernel.org/r/e7a73aaf7742b17e43421c56625646dfc5c4d2cb.1653571902.git.ryder.lee@mediatek.com Signed-off-by: Johannes Berg commit 03895c8414d748747900ede2cb603d0ed3eeae1c Author: Lorenzo Bianconi Date: Fri Jun 17 00:42:12 2022 +0200 wifi: mac80211: add gfp_t parameter to ieeee80211_obss_color_collision_notify Introduce the capability to specify gfp_t parameter to ieeee80211_obss_color_collision_notify routine since it runs in interrupt context in ieee80211_rx_check_bss_color_collision(). Fixes: 6d945a33f2b0a ("mac80211: introduce BSS color collision detection") Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/02c990fb3fbd929c8548a656477d20d6c0427a13.1655419135.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 3f3558c8054f82950b6decf928738306f556edf3 Author: Johannes Berg Date: Mon Jun 13 23:04:01 2022 +0200 wifi: mac80211_hwsim: set virtio device ready in probe() Just like a similar commit to arch/um/drivers/virt-pci.c, call virtio_device_ready() to make this driver work after commit b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the virtqueues in the probe function. (The virtio core sets the device ready when probe returns.) Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ") Fixes: 5d44fe7c9808 ("mac80211_hwsim: add frame transmission support over virtio") Signed-off-by: Johannes Berg Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220613210401.327958-1-johannes@sipsolutions.net Signed-off-by: Johannes Berg commit ee7a69aa38d87a3bbced7b8245c732c05ed0c6ec Author: Javier Martinez Canillas Date: Tue Jun 7 20:23:36 2022 +0200 fbdev: Disable sysfb device registration when removing conflicting FBs The platform devices registered by sysfb match with firmware-based DRM or fbdev drivers, that are used to have early graphics using a framebuffer provided by the system firmware. DRM or fbdev drivers later are probed and remove conflicting framebuffers, leading to these platform devices for generic drivers to be unregistered. But the current solution has a race, since the sysfb_init() function could be called after a DRM or fbdev driver is probed and request to unregister the devices for drivers with conflicting framebuffes. To prevent this, disable any future sysfb platform device registration by calling sysfb_disable(), if a driver requests to remove the conflicting framebuffers. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220607182338.344270-4-javierm@redhat.com commit bde376e9de3c0bc55eedc8956b0f114c05531595 Author: Javier Martinez Canillas Date: Tue Jun 7 20:23:35 2022 +0200 firmware: sysfb: Add sysfb_disable() helper function This can be used by subsystems to unregister a platform device registered by sysfb and also to disable future platform device registration in sysfb. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220607182338.344270-3-javierm@redhat.com commit 9e121040e54abef9ed5542e5fdfa87911cd96204 Author: Javier Martinez Canillas Date: Tue Jun 7 20:23:34 2022 +0200 firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer This function just returned 0 on success or an errno code on error, but it could be useful for sysfb_init() callers to have a pointer to the device. Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220607182338.344270-2-javierm@redhat.com commit e35f5718903b093be4b1d3833aa8a32f864a3ef1 Author: Vishal Verma Date: Tue Jun 28 16:01:09 2022 -0600 cxl/mbox: Fix missing variable payload checks in cmd size validation The conversion of command sizes to unsigned missed a couple of checks against variable size payloads during command validation, which made all variable payload commands unconditionally fail. Add the checks back using the new CXL_VARIABLE_PAYLOAD scheme. Fixes: 26f89535a5bb ("cxl/mbox: Use type __u32 for mailbox payload sizes") Cc: Cc: Ira Weiny Cc: Dan Williams Cc: Alison Schofield Reported-by: Abhi Cs Reviewed-by: Dan Williams Reviewed-by: Alison Schofield Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20220628220109.633564-1-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit 5a478a653b4cca148d5c89832f007ec0809d7e6d Author: Krzysztof Kozlowski Date: Mon Jun 27 14:40:48 2022 +0200 nfc: nfcmrvl: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Reported-by: Lv Ruyi Fixes: caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220627124048.296253-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jakub Kicinski commit 53ad46169fe2996fe1b623ba6c9c4fa33847876f Author: YueHaibing Date: Tue Jun 28 11:31:34 2022 +0800 net: ipv6: unexport __init-annotated seg6_hmac_net_init() As of commit 5801f064e351 ("net: ipv6: unexport __init-annotated seg6_hmac_init()"), EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. This remove the EXPORT_SYMBOL to fix modpost warning: WARNING: modpost: vmlinux.o(___ksymtab+seg6_hmac_net_init+0x0): Section mismatch in reference from the variable __ksymtab_seg6_hmac_net_init to the function .init.text:seg6_hmac_net_init() The symbol seg6_hmac_net_init is exported and annotated __init Fix this by removing the __init annotation of seg6_hmac_net_init or drop the export. Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support") Reported-by: Hulk Robot Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220628033134.21088-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit 76f0544428aced9e2f0d50ac7429e0f3064658cd Merge: 03c765b0e3b4c 08de214138cde Author: Dave Airlie Date: Wed Jun 29 14:16:46 2022 +1000 Merge tag 'drm-msm-fixes-2022-06-28' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Fixes for v5.19-rc5 - Fix to increment vsync_cnt before calling drm_crtc_handle_vblank so that userspace sees the value *after* it is incremented if waiting for vblank events - Fix to reset drm_dev to NULL in dp_display_unbind to avoid a crash in probe/bind error paths - Fix to resolve the smatch error of de-referencing before NULL check in dpu_encoder_phys_wb.c - Fix error return to userspace if fence-id allocation fails in submit ioctl Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvswNKdd02EYKYv5Zjv7f+mcqeWC7hHQ1SBjqYzN_ZHnA@mail.gmail.com commit adabdd8f6acabc0c3fdbba2e7f5a2edd9c5ef22d Author: katrinzhou Date: Tue Jun 28 11:50:30 2022 +0800 ipv6/sit: fix ipip6_tunnel_get_prl return value When kcalloc fails, ipip6_tunnel_get_prl() should return -ENOMEM. Move the position of label "out" to return correctly. Addresses-Coverity: ("Unused value") Fixes: 300aaeeaab5f ("[IPV6] SIT: Add SIOCGETPRL ioctl to get/dump PRL.") Signed-off-by: katrinzhou Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220628035030.1039171-1-zys.zljxml@gmail.com Signed-off-by: Jakub Kicinski commit bce3bb30b266a12fa32d4f08bdaf59a03887f802 Merge: ab84db251c04d fd37c2ecb21f7 Author: Jakub Kicinski Date: Tue Jun 28 20:45:46 2022 -0700 Merge branch 'mptcp-fixes-for-5-19' Mat Martineau says: ==================== mptcp: Fixes for 5.19 Several categories of fixes from the mptcp tree: Patches 1-3 are fixes related to MP_FAIL and FASTCLOSE, to make sure MIBs are accurate, and to handle MP_FAIL transmission and responses at the correct times. sk_timer conflicts are also resolved. Patches 4 and 6 handle two separate race conditions, one at socket shutdown and one with unaccepted subflows. Patch 5 makes sure read operations are not blocked during fallback to TCP. Patch 7 improves the diag selftest, which were incorrectly failing on slow machines (like the VMs used for CI testing). Patch 8 avoids possible symbol redefinition errors in the userspace mptcp.h file. Patch 9 fixes a selftest build issue with gcc 12. ==================== Link: https://lore.kernel.org/r/20220628010243.166605-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit fd37c2ecb21f7aee04ccca5f561469f07d00063c Author: Mat Martineau Date: Mon Jun 27 18:02:43 2022 -0700 selftests: mptcp: Initialize variables to quiet gcc 12 warnings In a few MPTCP selftest tools, gcc 12 complains that the 'sock' variable might be used uninitialized. This is a false positive because the only code path that could lead to uninitialized access is where getaddrinfo() fails, but the local xgetaddrinfo() wrapper exits if such a failure occurs. Initialize the 'sock' variable anyway to allow the tools to build with gcc 12. Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 06e445f740c1a0fe5d16b3dff8a4ef18e124e54e Author: Ossama Othman Date: Mon Jun 27 18:02:42 2022 -0700 mptcp: fix conflict with Including before the C library header causes symbol redefinition errors at compile-time due to duplicate declarations and definitions in the header included by . Explicitly include before in when __KERNEL__ is not defined so that the C library compatibility logic in is enabled when including in user space code. Fixes: c11c5906bc0a ("mptcp: add MPTCP_SUBFLOW_ADDRS getsockopt support") Signed-off-by: Ossama Othman Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 42fb6cddec3b306c9f6ef136b6438e0de1836431 Author: Paolo Abeni Date: Mon Jun 27 18:02:41 2022 -0700 selftests: mptcp: more stable diag tests The mentioned test-case still use an hard-coded-len sleep to wait for a relative large number of connection to be established. On very slow VM and with debug build such timeout could be exceeded, causing failures in our CI. Address the issue polling for the expected condition several times, up to an unreasonable high amount of time. On reasonably fast system the self-tests will be faster then before, on very slow one we will still catch the correct condition. Fixes: df62f2ec3df6 ("selftests/mptcp: add diag interface tests") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 6aeed9045071f2252ff4e98fc13d1e304f33e5b0 Author: Paolo Abeni Date: Mon Jun 27 18:02:40 2022 -0700 mptcp: fix race on unaccepted mptcp sockets When the listener socket owning the relevant request is closed, it frees the unaccepted subflows and that causes later deletion of the paired MPTCP sockets. The mptcp socket's worker can run in the time interval between such delete operations. When that happens, any access to msk->first will cause an UaF access, as the subflow cleanup did not cleared such field in the mptcp socket. Address the issue explicitly traversing the listener socket accept queue at close time and performing the needed cleanup on the pending msk. Note that the locking is a bit tricky, as we need to acquire the msk socket lock, while still owning the subflow socket one. Fixes: 86e39e04482b ("mptcp: keep track of local endpoint still available for each msk") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit f745a3ebdfb9041d3a55e66eb345895cd8ecc90c Author: Paolo Abeni Date: Mon Jun 27 18:02:39 2022 -0700 mptcp: consistent map handling on failure When the MPTCP receive path reach a non fatal fall-back condition, e.g. when the MPC sockets must fall-back to TCP, the existing code is a little self-inconsistent: it reports that new data is available - return true - but sets the MPC flag to the opposite value. As the consequence read operations in some exceptional scenario may block unexpectedly. Address the issue setting the correct MPC read status. Additionally avoid some code duplication in the fatal fall-back scenario. Fixes: 9c81be0dbc89 ("mptcp: add MP_FAIL response support") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d51991e2e31477853e5b9c1005ac617707077286 Author: Paolo Abeni Date: Mon Jun 27 18:02:38 2022 -0700 mptcp: fix shutdown vs fallback race If the MPTCP socket shutdown happens before a fallback to TCP, and all the pending data have been already spooled, we never close the TCP connection. Address the issue explicitly checking for critical condition at fallback time. Fixes: 1e39e5a32ad7 ("mptcp: infinite mapping sending") Fixes: 0348c690ed37 ("mptcp: add the fallback check") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 76a13b315709b5b65a7b65caf9ede9a8a38d8930 Author: Geliang Tang Date: Mon Jun 27 18:02:37 2022 -0700 mptcp: invoke MP_FAIL response when needed mptcp_mp_fail_no_response shouldn't be invoked on each worker run, it should be invoked only when MP_FAIL response timeout occurs. This patch refactors the MP_FAIL response logic. It leverages the fact that only the MPC/first subflow can gracefully fail to avoid unneeded subflows traversal: the failing subflow can be only msk->first. A new 'fail_tout' field is added to the subflow context to record the MP_FAIL response timeout and use such field to reliably share the timeout timer between the MP_FAIL event and the MPTCP socket close timeout. Finally, a new ack is generated to send out MP_FAIL notification as soon as we hit the relevant condition, instead of waiting a possibly unbound time for the next data packet. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/281 Fixes: d9fb797046c5 ("mptcp: Do not traverse the subflow connection list without lock") Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 31bf11de146c3f8892093ff39f8f9b3069d6a852 Author: Paolo Abeni Date: Mon Jun 27 18:02:36 2022 -0700 mptcp: introduce MAPPING_BAD_CSUM This allow moving a couple of conditional out of the fast path, making the code more easy to follow and will simplify the next patch. Fixes: ae66fb2ba6c3 ("mptcp: Do TCP fallback on early DSS checksum failure") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 0c1f78a49af721490a5ad70b73e8b4d382465dae Author: Paolo Abeni Date: Mon Jun 27 18:02:35 2022 -0700 mptcp: fix error mibs accounting The current accounting for MP_FAIL and FASTCLOSE is not very accurate: both can be increased even when the related option is not really sent. Move the accounting into the correct place. Fixes: eb7f33654dc1 ("mptcp: add the mibs for MP_FAIL") Fixes: 1e75629cb964 ("mptcp: add the mibs for MP_FASTCLOSE") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit a4ab14e1d8fe83cc1ed8910b788117ec2ed25179 Author: John Hubbard Date: Mon Jun 27 18:23:53 2022 -0700 gen_compile_commands: handle multiple lines per .mod file scripts/clang-tools/gen_compile_commands.py incorrectly assumes that each .mod file only contains one line. That assumption was correct when the script was originally created, but commit 9413e7640564 ("kbuild: split the second line of *.mod into *.usyms") changed the .mod file format so that there is one entry per line, and potentially many lines. The problem can be reproduced by using Kbuild to generate compile_commands.json, like this: make CC=clang compile_commands.json In many cases, the problem might be overlooked because many subsystems only have one line anyway. However, in some subsystems (Nouveau, with 762 entries, is a notable example) it results in skipping most of the subsystem. Fix this by fully processing each .mod file. Fixes: 9413e7640564 ("kbuild: split the second line of *.mod into *.usyms") Signed-off-by: John Hubbard Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 512d1999b8e94a5d43fba3afc73e774849674742 Author: Ivan Malov Date: Tue Jun 28 12:18:48 2022 +0300 xsk: Clear page contiguity bit when unmapping pool When a XSK pool gets mapped, xp_check_dma_contiguity() adds bit 0x1 to pages' DMA addresses that go in ascending order and at 4K stride. The problem is that the bit does not get cleared before doing unmap. As a result, a lot of warnings from iommu_dma_unmap_page() are seen in dmesg, which indicates that lookups by iommu_iova_to_phys() fail. Fixes: 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API") Signed-off-by: Ivan Malov Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220628091848.534803-1-ivan.malov@oktetlabs.ru commit 9ab762a84b8094540c18a170e5ddd6488632c456 Author: Kai-Heng Feng Date: Tue Jun 28 20:37:26 2022 +0800 platform/x86: hp-wmi: Ignore Sanitization Mode event After system resume the hp-wmi driver may complain: [ 702.620180] hp_wmi: Unknown event_id - 23 - 0x0 According to HP it means 'Sanitization Mode' and it's harmless to just ignore the event. Cc: Jorge Lopez Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220628123726.250062-1-kai.heng.feng@canonical.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bce6243f767f7da88aa4674d5d678f9f156eaba9 Author: Mark Pearson Date: Mon Jun 27 14:14:49 2022 -0400 platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms PSC platform profile mode is only supported on Linux for AMD platforms. Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems. Add a check to prevent it being enabled incorrectly. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220627181449.3537-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 42504af775361ca2330a2bfde496a5ebc5655c86 Author: Mark Pearson Date: Fri Jun 3 13:02:09 2022 -0400 platform/x86: thinkpad-acpi: profile capabilities as integer Currently the active mode (PSC/MMC) is stored in an enum and queried throughout the driver. Other driver changes will enumerate additional submodes that are relevant to be tracked, so instead track PSC/MMC in a single integer variable. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220603170212.164963-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit aacb455dfe01b7a24a792a2fbe7a04112ce8321d Author: Hans de Goede Date: Fri Jun 24 13:23:39 2022 +0200 platform/x86: panasonic-laptop: filter out duplicate volume up/down/mute keypresses On some Panasonic models the volume up/down/mute keypresses get reported both through the Panasonic ACPI HKEY interface as well as through the atkbd device. Filter out the atkbd scan-codes for these to avoid reporting presses twice. Note normally we would leave the filtering of these to userspace by mapping the scan-codes to KEY_UNKNOWN through /lib/udev/hwdb.d/60-keyboard.hwdb. However in this case that would cause regressions since we were filtering the Panasonic ACPI HKEY events before, so filter these in the kernel. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried Reported-and-tested-by: Kenneth Chan Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-7-hdegoede@redhat.com commit 1f2c9de83a50447a2d7166f6273ab0c0e97cd68e Author: Hans de Goede Date: Fri Jun 24 13:23:38 2022 +0200 platform/x86: panasonic-laptop: don't report duplicate brightness key-presses The brightness key-presses might also get reported by the ACPI video bus, check for this and in this case don't report the presses to avoid reporting 2 presses for a single key-press. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried Reported-and-tested-by: Kenneth Chan Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-6-hdegoede@redhat.com commit 83a5ddc3dc561c40d948b85553514aaba99123d8 Author: Hans de Goede Date: Fri Jun 24 13:23:37 2022 +0200 platform/x86: panasonic-laptop: revert "Resolve hotkey double trigger bug" In hindsight blindly throwing away most of the key-press events is not a good idea. So revert commit ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug"). Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried Reported-and-tested-by: Kenneth Chan Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-5-hdegoede@redhat.com commit fe4326c8d18dc8a54affdc9ab269ad92dafef659 Author: Hans de Goede Date: Fri Jun 24 13:23:36 2022 +0200 platform/x86: panasonic-laptop: sort includes alphabetically Sort includes alphabetically, small cleanup patch in preparation of further changes. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-4-hdegoede@redhat.com commit 65a3e6c8d3f7c346813a05f3d76fc46b640d76d6 Author: Stefan Seyfried Date: Fri Jun 24 13:23:35 2022 +0200 platform/x86: panasonic-laptop: de-obfuscate button codes In the definition of panasonic_keymap[] the key codes are given in decimal, later checks are done with hexadecimal values, which does not help in understanding the code. Additionally use two helper variables to shorten the code and make the logic more obvious. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Signed-off-by: Stefan Seyfried Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-3-hdegoede@redhat.com commit 3a0cf7ab8df3878a7e2f3d29275b785cf4e7afb6 Author: Hans de Goede Date: Fri Jun 24 13:23:34 2022 +0200 ACPI: video: Change how we determine if brightness key-presses are handled Some systems have an ACPI video bus but not ACPI video devices with backlight capability. On these devices brightness key-presses are (logically) not reported through the ACPI video bus. Change how acpi_video_handles_brightness_key_presses() determines if brightness key-presses are handled by the ACPI video driver to avoid vendor specific drivers/platform/x86 drivers filtering out their brightness key-presses even though they are the only ones reporting these presses. Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried Reported-and-tested-by: Kenneth Chan Signed-off-by: Hans de Goede Acked-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220624112340.10130-2-hdegoede@redhat.com commit 7fe718fb8f3f543da1f04ca08bf652dd2afb55f8 Author: Arnaldo Carvalho de Melo Date: Sun May 9 09:39:02 2021 -0300 tools headers UAPI: Sync linux/kvm.h with the kernel sources To pick the changes in: bfbab44568779e16 ("KVM: arm64: Implement PSCI SYSTEM_SUSPEND") 7b33a09d036ffd9a ("KVM: arm64: Add support for userspace to suspend a vCPU") ffbb61d09fc56c85 ("KVM: x86: Accept KVM_[GS]ET_TSC_KHZ as a VM ioctl.") 661a20fab7d156cf ("KVM: x86/xen: Advertise and document KVM_XEN_HVM_CONFIG_EVTCHN_SEND") fde0451be8fb3208 ("KVM: x86/xen: Support per-vCPU event channel upcall via local APIC") 28d1629f751c4a5f ("KVM: x86/xen: Kernel acceleration for XENVER_version") 536395260582be74 ("KVM: x86/xen: handle PV timers oneshot mode") 942c2490c23f2800 ("KVM: x86/xen: Add KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID") 2fd6df2f2b47d430 ("KVM: x86/xen: intercept EVTCHNOP_send from guests") 35025735a79eaa89 ("KVM: x86/xen: Support direct injection of event channel events") That automatically adds support for this new ioctl: $ tools/perf/trace/beauty/kvm_ioctl.sh > before $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h $ tools/perf/trace/beauty/kvm_ioctl.sh > after $ diff -u before after --- before 2022-06-28 12:13:07.281150509 -0300 +++ after 2022-06-28 12:13:16.423392896 -0300 @@ -98,6 +98,7 @@ [0xcc] = "GET_SREGS2", [0xcd] = "SET_SREGS2", [0xce] = "GET_STATS_FD", + [0xd0] = "XEN_HVM_EVTCHN_SEND", [0xe0] = "CREATE_DEVICE", [0xe1] = "SET_DEVICE_ATTR", [0xe2] = "GET_DEVICE_ATTR", $ This silences these perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: David Woodhouse Cc: Ian Rogers Cc: Jiri Olsa Cc: Joao Martins Cc: Marc Zyngier Cc: Namhyung Kim Cc: Oliver Upton Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/Yrs4RE+qfgTaWdAt@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 32df6fe110c443763d6749a758f33a7117ec1270 Author: Alexei Starovoitov Date: Mon Jun 27 20:22:55 2022 +0200 bpf, docs: Better scale maintenance of BPF subsystem The BPF subsystem consists of a large number of pieces. There is not a single person that understands it all. Yet reviews are crucially important for the BPF community to provide productive quality feedback to contributors in a timely manner and therefore to ultimately expand the number of active developers in the community. So far, the BPF community had a two-stage review system, that is, a weekly rotation among 7 developers (Alexei, Daniel, Andrii, Martin, Song, Yonghong, John) as a first-level review of all inbound patches accompanied by a BPF CI system which runs the in-tree BPF selftests to check for regressions for every new patch, and then, a final check by Alexei, Daniel, Andrii to apply the patches to either bpf or bpf-next trees. This system worked well for the last ~3.5 years, but clearly reaches its limits these days as it does not scale enough. Especially, as we also need to allow enough room for every developer to contribute patches themselves, integrate with their day to day job, and in particular avoid burnout. We want to better scale both horizontally and vertically going forward. On the horizontal scale, we are adding more developers (KP, Stan, Hao, Jiri) to the overall core reviewer team, thus growing to 11 people in total. The weekly rotation for the horizontal oncall reviewer is shortened to 1/2 week (Mo - Wed and Thur - Fri). Instead of just patches, the coverage however extends also generally to triage and reply to mailing list traffic (e.g. RFCs, questions, etc). On the vertical scale, there is clearly a need for deep expertise areas to assign dedicated maintainer/reviewer teams that are responsible for code reviews and help with design of individual building blocks. To some degree we have been doing this implicitly, but the point is to formalize the teams and commitment. There is an overlap between areas and boundaries are intentionally grey. These additional entries provide a guidance on who has to look at the patches. The patch series which span multiple areas will be looked at by multiple people. The vertical review with areas of deep expertise are bundled at the same time with the horizontal side. This patch cleans up a bit the BPF entries, adds mentioned developers to the horizontal scale and creates new sub-entries with teams for developers committing to the above outlined vertical scale. Also, pw.git tools we use for BPF tree maintenance have been updated with a new pw-schedule script to semi-automate vertical oncall review rotation. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Acked-by: Song Liu Acked-by: Yonghong Song Acked-by: Mykola Lysenko Acked-by: John Fastabend Acked-by: Jiri Olsa Acked-by: KP Singh Acked-by: Stanislav Fomichev Acked-by: Hao Luo Acked-by: Quentin Monnet Link: https://git.kernel.org/pub/scm/linux/kernel/git/dborkman/pw.git Link: https://lore.kernel.org/bpf/5bdc73e7f5a087299589944fa074563cdf2c2c1a.1656353995.git.daniel@iogearbox.net commit 049b1ed9bef1e544ddca37e60debc809c3bd9f34 Merge: b376471fb47d4 be4b61ec45b3e Author: Rafael J. Wysocki Date: Tue Jun 28 17:56:57 2022 +0200 Merge tag 'cpufreq-arm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull cpufreq ARM fixes for 5.19-rc5 from Viresh Kumar: - Fix missing of_node_put for qoriq and pmac32 driver (Liang He). - Fix issues around throttle interrupt for qcom driver (Stephen Boyd). - Add MT8186 to cpufreq-dt-platdev blocklist (AngeloGioacchino Del Regno). * tag 'cpufreq-arm-fixes-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: Add MT8186 to cpufreq-dt-platdev blocklist cpufreq: pmac32-cpufreq: Fix refcount leak bug cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c commit 579d6c6d77a7b55d74db8a506d5fc0c77fb1a5e1 Author: Ian Rogers Date: Mon Jun 13 18:47:14 2022 -0700 perf bpf: 8 byte align bpil data bpil data is accessed assuming 64-bit alignment resulting in undefined behavior as the data is just byte aligned. With an -fsanitize=undefined build the following errors are observed: $ sudo perf record -a sleep 1 util/bpf-event.c:310:22: runtime error: load of misaligned address 0x55f61084520f for type '__u64', which requires 8 byte alignment 0x55f61084520f: note: pointer points here a8 fe ff ff 3c 51 d3 c0 ff ff ff ff 04 84 d3 c0 ff ff ff ff d8 aa d3 c0 ff ff ff ff a4 c0 d3 c0 ^ util/bpf-event.c:311:20: runtime error: load of misaligned address 0x55f61084522f for type '__u32', which requires 4 byte alignment 0x55f61084522f: note: pointer points here ff ff ff ff c7 17 00 00 f1 02 00 00 1f 04 00 00 58 04 00 00 00 00 00 00 0f 00 00 00 63 02 00 00 ^ util/bpf-event.c:198:33: runtime error: member access within misaligned address 0x55f61084523f for type 'const struct bpf_func_info', which requires 4 byte alignment 0x55f61084523f: note: pointer points here 58 04 00 00 00 00 00 00 0f 00 00 00 63 02 00 00 3b 00 00 00 ab 02 00 00 44 00 00 00 14 03 00 00 Correct this by rouding up the data sizes and aligning the pointers. Signed-off-by: Ian Rogers Acked-by: Andrii Nakryiko Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Dave Marchevsky Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220614014714.1407239-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 117c49505b5918388157321c68c6e5a58b67f649 Author: Arnaldo Carvalho de Melo Date: Mon Dec 21 12:53:44 2020 -0300 tools kvm headers arm64: Update KVM headers from the kernel sources To pick the changes from: 2cde51f1e10f2600 ("KVM: arm64: Hide KVM_REG_ARM_*_BMAP_BIT_COUNT from userspace") b22216e1a617ca55 ("KVM: arm64: Add vendor hypervisor firmware register") 428fd6788d4d0e0d ("KVM: arm64: Add standard hypervisor firmware register") 05714cab7d63b189 ("KVM: arm64: Setup a framework for hypercall bitmap firmware registers") 18f3976fdb5da2ba ("KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high") a5905d6af492ee6a ("KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated") That don't causes any changes in tooling (when built on x86), only addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h' diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h Cc: Adrian Hunter Cc: Alexandru Elisei Cc: Catalin Marinas Cc: Ian Rogers Cc: James Morse Cc: Jiri Olsa Cc: Marc Zyngier Cc: Namhyung Kim Cc: Raghavendra Rao Ananta Link: https://lore.kernel.org/lkml/YrsWcDQyJC+xsfmm@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 49c692b7dfc9b6c06a1dc11359a8780575b16d4a Author: Namhyung Kim Date: Fri Jun 24 16:13:09 2022 -0700 perf offcpu: Accept allowed sample types only As offcpu-time event is synthesized at the end, it could not get the all the sample info. Define OFFCPU_SAMPLE_TYPES for allowed ones and mask out others in evsel__config() to prevent parse errors. Because perf sample parsing assumes a specific ordering with the sample types, setting unsupported one would make it fail to read data like perf record -d/--data. Fixes: edc41a1099c2d08c ("perf record: Enable off-cpu analysis with BPF") Signed-off-by: Namhyung Kim Cc: Blake Jones Cc: Hao Luo Cc: Ian Rogers Cc: Jiri Olsa Cc: Milian Wolff Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20220624231313.367909-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d6838ec44b4513280a3f43fcc402e246d543fb53 Author: Namhyung Kim Date: Fri Jun 24 16:13:08 2022 -0700 perf offcpu: Fix build failure on old kernels Old kernels have a 'struct task_struct' which contains a "state" field and newer kernels have "__state" instead. While the get_task_state() in the BPF code handles that in some way, it assumed the current kernel has the new definition and it caused a build error on old kernels. We should not assume anything and access them carefully. Do not use 'task struct' directly access it instead using new and old definitions in a row. Fixes: edc41a1099c2d08c ("perf record: Enable off-cpu analysis with BPF") Reported-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Blake Jones Cc: Hao Luo Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20220624231313.367909-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a1d4ef1adf8bbd302067534ead671a94759687ed Author: Fabien Dessenne Date: Mon Jun 27 16:23:50 2022 +0200 pinctrl: stm32: fix optional IRQ support to gpios To act as an interrupt controller, a gpio bank relies on the "interrupt-parent" of the pin controller. When this optional "interrupt-parent" misses, do not create any IRQ domain. This fixes a "NULL pointer in stm32_gpio_domain_alloc()" kernel crash when the interrupt-parent = property is not declared in the Device Tree. Fixes: 0eb9f683336d ("pinctrl: Add IRQ support to STM32 gpios") Signed-off-by: Fabien Dessenne Link: https://lore.kernel.org/r/20220627142350.742973-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij commit 0fe3dbbefb74a8575f61d7801b08dbc50523d60d Author: Tao Liu Date: Mon Jun 27 22:00:04 2022 +0800 linux/dim: Fix divide by 0 in RDMA DIM Fix a divide 0 error in rdma_dim_stats_compare() when prev->cpe_ratio == 0. CallTrace: Hardware name: H3C R4900 G3/RS33M2C9S, BIOS 2.00.37P21 03/12/2020 task: ffff880194b78000 task.stack: ffffc90006714000 RIP: 0010:backport_rdma_dim+0x10e/0x240 [mlx_compat] RSP: 0018:ffff880c10e83ec0 EFLAGS: 00010202 RAX: 0000000000002710 RBX: ffff88096cd7f780 RCX: 0000000000000064 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000001 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 000000001d7c6c09 R13: ffff88096cd7f780 R14: ffff880b174fe800 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff880c10e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000a0965b00 CR3: 000000000200a003 CR4: 00000000007606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: ib_poll_handler+0x43/0x80 [ib_core] irq_poll_softirq+0xae/0x110 __do_softirq+0xd1/0x28c irq_exit+0xde/0xf0 do_IRQ+0x54/0xe0 common_interrupt+0x8f/0x8f ? cpuidle_enter_state+0xd9/0x2a0 ? cpuidle_enter_state+0xc7/0x2a0 ? do_idle+0x170/0x1d0 ? cpu_startup_entry+0x6f/0x80 ? start_secondary+0x1b9/0x210 ? secondary_startup_64+0xa5/0xb0 Code: 0f 87 e1 00 00 00 8b 4c 24 14 44 8b 43 14 89 c8 4d 63 c8 44 29 c0 99 31 d0 29 d0 31 d2 48 98 48 8d 04 80 48 8d 04 80 48 c1 e0 02 <49> f7 f1 48 83 f8 0a 0f 86 c1 00 00 00 44 39 c1 7f 10 48 89 df RIP: backport_rdma_dim+0x10e/0x240 [mlx_compat] RSP: ffff880c10e83ec0 Fixes: f4915455dcf0 ("linux/dim: Implement RDMA adaptive moderation (DIM)") Link: https://lore.kernel.org/r/20220627140004.3099-1-thomas.liu@ucloud.cn Signed-off-by: Tao Liu Reviewed-by: Max Gurtovoy Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ab84db251c04d38b8dc7ee86e13d4050bedb1c88 Author: Eric Dumazet Date: Mon Jun 27 10:28:13 2022 +0000 net: bonding: fix possible NULL deref in rlb code syzbot has two reports involving the same root cause. bond_alb_initialize() must not set bond->alb_info.rlb_enabled if a memory allocation error is detected. Report 1: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 0 PID: 12276 Comm: kworker/u4:10 Not tainted 5.19.0-rc3-syzkaller-00132-g3b89b511ea0c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net RIP: 0010:rlb_clear_slave+0x10e/0x690 drivers/net/bonding/bond_alb.c:393 Code: 8e fc 83 fb ff 0f 84 74 02 00 00 e8 cc 2a 8e fc 48 8b 44 24 08 89 dd 48 c1 e5 06 4c 8d 34 28 49 8d 7e 14 48 89 f8 48 c1 e8 03 <42> 0f b6 14 20 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 RSP: 0018:ffffc90018a8f678 EFLAGS: 00010203 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88803375bb00 RSI: ffffffff84ec4ac4 RDI: 0000000000000014 RBP: 0000000000000000 R08: 0000000000000005 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000000 R12: dffffc0000000000 R13: ffff8880ac889000 R14: 0000000000000000 R15: ffff88815a668c80 FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005597077e10b0 CR3: 0000000026668000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: bond_alb_deinit_slave+0x43c/0x6b0 drivers/net/bonding/bond_alb.c:1663 __bond_release_one.cold+0x383/0xd53 drivers/net/bonding/bond_main.c:2370 bond_slave_netdev_event drivers/net/bonding/bond_main.c:3778 [inline] bond_netdev_event+0x993/0xad0 drivers/net/bonding/bond_main.c:3889 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1945 call_netdevice_notifiers_extack net/core/dev.c:1983 [inline] call_netdevice_notifiers net/core/dev.c:1997 [inline] unregister_netdevice_many+0x948/0x18b0 net/core/dev.c:10839 default_device_exit_batch+0x449/0x590 net/core/dev.c:11333 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Report 2: general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] CPU: 1 PID: 5206 Comm: syz-executor.1 Not tainted 5.18.0-syzkaller-12108-g58f9d52ff689 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:rlb_req_update_slave_clients+0x109/0x2f0 drivers/net/bonding/bond_alb.c:502 Code: 5d 18 8f fc 41 80 3e 00 0f 85 a5 01 00 00 89 d8 48 c1 e0 06 49 03 84 24 68 01 00 00 48 8d 78 30 49 89 c7 48 89 fa 48 c1 ea 03 <80> 3c 2a 00 0f 85 98 01 00 00 4d 39 6f 30 75 83 e8 22 18 8f fc 49 RSP: 0018:ffffc9000300ee80 EFLAGS: 00010206 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffc90016c11000 RDX: 0000000000000006 RSI: ffffffff84eb6bf3 RDI: 0000000000000030 RBP: dffffc0000000000 R08: 0000000000000005 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000000 R12: ffff888027c80c80 R13: ffff88807d7ff800 R14: ffffed1004f901bd R15: 0000000000000000 FS: 00007f6f46c58700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010000 CR3: 00000000516cc000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: alb_fasten_mac_swap+0x886/0xa80 drivers/net/bonding/bond_alb.c:1070 bond_alb_handle_active_change+0x624/0x1050 drivers/net/bonding/bond_alb.c:1765 bond_change_active_slave+0xfa1/0x29b0 drivers/net/bonding/bond_main.c:1173 bond_select_active_slave+0x23f/0xa50 drivers/net/bonding/bond_main.c:1253 bond_enslave+0x3b34/0x53b0 drivers/net/bonding/bond_main.c:2159 do_set_master+0x1c8/0x220 net/core/rtnetlink.c:2577 rtnl_newlink_create net/core/rtnetlink.c:3380 [inline] __rtnl_newlink+0x13ac/0x17e0 net/core/rtnetlink.c:3580 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x43a/0xc90 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2501 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f6f45a89109 Code: ff ff 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 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:00007f6f46c58168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f6f45b9c030 RCX: 00007f6f45a89109 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000006 RBP: 00007f6f45ae308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffed99029af R14: 00007f6f46c58300 R15: 0000000000022000 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20220627102813.126264-1-edumazet@google.com Signed-off-by: Paolo Abeni commit fbc24ebc65507feb9728dc38197f90486148dda0 Author: Jacky Bai Date: Mon Jun 13 11:18:54 2022 +0800 pinctrl: imx: Add the zero base flag for imx93 On i.MX93, the pin mux reg offset is from 0x0, so need to add the 'ZERO_OFFSET_VALID' flag to make sure the pin at mux offset 0 can be found. Signed-off-by: Jacky Bai Link: https://lore.kernel.org/r/20220613031854.1571357-1-ping.bai@nxp.com Signed-off-by: Linus Walleij commit 91d60e259c0f58c855f88f3fe5b7909aec563525 Author: Fabio Estevam Date: Wed Jun 22 08:48:10 2022 -0300 ARM: at91: pm: Mark at91_pm_secure_init as __init at91_pm_secure_init() is used inside sama5d2_pm_init(), which has the __init notation. Pass the __init notation to at91_pm_secure_init() as well to fix the following section mismatch warning: WARNING: modpost: vmlinux.o(.text.unlikely+0x2138): Section mismatch in reference from the function at91_pm_secure_init() to the (unknown reference) .init.rodata:(unknown) Fixes: f2f5cf78a333 ("ARM: at91: pm: add support for sama5d2 secure suspend") Signed-off-by: Fabio Estevam Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220622114810.1186330-1-festevam@gmail.com commit 35074df65a8d8c5328a83e2eea948f7bbc8e6e08 Author: Mihai Sain Date: Thu Jun 16 11:13:44 2022 +0300 ARM: at91: fix soc detection for SAM9X60 SiPs Fix SoC detection for SAM9X60 SiPs: SAM9X60D5M SAM9X60D1G SAM9X60D6K Fixes: af3a10513cd6 ("drivers: soc: atmel: add per soc id and version match masks") Signed-off-by: Mihai Sain Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220616081344.1978664-1-claudiu.beznea@microchip.com commit 416ce193d73a734ded6d09fe141017b38af1c567 Author: Eugen Hristev Date: Tue Jun 7 12:04:55 2022 +0300 ARM: dts: at91: sama5d2_icp: fix eeprom compatibles The eeprom memories on the board are microchip 24aa025e48, which are 2 Kbits and are compatible with at24c02 not at24c32. Fixes: 68a95ef72cefe ("ARM: dts: at91: sama5d2-icp: add SAMA5D2-ICP") Signed-off-by: Eugen Hristev Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220607090455.80433-2-eugen.hristev@microchip.com commit f2cbbc3f926316ccf8ef9363d8a60c1110afc1c7 Author: Eugen Hristev Date: Tue Jun 7 12:04:54 2022 +0300 ARM: dts: at91: sam9x60ek: fix eeprom compatible and size The board has a microchip 24aa025e48 eeprom, which is a 2 Kbits memory, so it's compatible with at24c02 not at24c32. Also the size property is wrong, it's not 128 bytes, but 256 bytes. Thus removing and leaving it to the default (256). Fixes: 1e5f532c27371 ("ARM: dts: at91: sam9x60: add device tree for soc and board") Signed-off-by: Eugen Hristev Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220607090455.80433-1-eugen.hristev@microchip.com commit 1c40169b35ad58906814d53a517ac92db3d20d5f Author: Claudiu Beznea Date: Mon May 23 12:24:21 2022 +0300 ARM: at91: pm: use proper compatibles for sama7g5's rtc and rtt Use proper compatible strings for SAMA7G5's RTC and RTT IPs. These are necessary for configuring wakeup sources for ULP1 PM mode. Fixes: 6501330f9f5e ("ARM: at91: pm: add pm support for SAMA7G5") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-4-claudiu.beznea@microchip.com commit 641522665dbb25ce117c78746df1aad8b58c80e5 Author: Claudiu Beznea Date: Mon May 23 12:24:20 2022 +0300 ARM: at91: pm: use proper compatibles for sam9x60's rtc and rtt Use proper compatible strings for SAM9X60's RTC and RTT IPs. These are necessary for configuring wakeup sources for ULP1 PM mode. Fixes: eaedc0d379da ("ARM: at91: pm: add ULP1 support for SAM9X60") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-3-claudiu.beznea@microchip.com commit ddc980da8043779119acaca106c6d9b445c9b65b Author: Claudiu Beznea Date: Mon May 23 12:24:19 2022 +0300 ARM: at91: pm: use proper compatible for sama5d2's rtc Use proper compatible strings for SAMA5D2's RTC IPs. This is necessary for configuring wakeup sources for ULP1 PM mode. Fixes: d7484f5c6b3b ("ARM: at91: pm: configure wakeup sources for ULP1 mode") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220523092421.317345-2-claudiu.beznea@microchip.com commit 8698e3bab4dd7968666e84e111d0bfd17c040e77 Author: Amir Goldstein Date: Mon Jun 27 20:47:19 2022 +0300 fanotify: refine the validation checks on non-dir inode mask Commit ceaf69f8eadc ("fanotify: do not allow setting dirent events in mask of non-dir") added restrictions about setting dirent events in the mask of a non-dir inode mark, which does not make any sense. For backward compatibility, these restictions were added only to new (v5.17+) APIs. It also does not make any sense to set the flags FAN_EVENT_ON_CHILD or FAN_ONDIR in the mask of a non-dir inode. Add these flags to the dir-only restriction of the new APIs as well. Move the check of the dir-only flags for new APIs into the helper fanotify_events_supported(), which is only called for FAN_MARK_ADD, because there is no need to error on an attempt to remove the dir-only flags from non-dir inode. Fixes: ceaf69f8eadc ("fanotify: do not allow setting dirent events in mask of non-dir") Link: https://lore.kernel.org/linux-fsdevel/20220627113224.kr2725conevh53u4@quack3.lan/ Link: https://lore.kernel.org/r/20220627174719.2838175-1-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 48bddb89d59eec27c3305d179b1832d5292e285d Author: Xiang wangx Date: Thu Jun 2 16:53:50 2022 +0800 openrisc: unwinder: Fix grammar issue in comment Delete the redundant word 'the'. Signed-off-by: Xiang wangx Signed-off-by: Stafford Horne commit 8520501346ed8d1c4a6dfa751cb57328a9c843f1 Author: Stafford Horne Date: Wed Jun 15 08:54:26 2022 +0900 irqchip: or1k-pic: Undefine mask_ack for level triggered hardware The mask_ack operation clears the interrupt by writing to the PICSR register. This we don't want for level triggered interrupt because it does not actually clear the interrupt on the source hardware. This was causing issues in qemu with multi core setups where interrupts would continue to fire even though they had been cleared in PICSR. Just remove the mask_ack operation. Acked-by: Marc Zyngier Signed-off-by: Stafford Horne commit be4b61ec45b3efe5e9077525fc92d544305eb2a6 Author: AngeloGioacchino Del Regno Date: Fri Jun 17 13:09:26 2022 +0200 cpufreq: Add MT8186 to cpufreq-dt-platdev blocklist This SoC shall use the mediatek-cpufreq driver, or the system will crash upon any clock scaling request: add it to the cpufreq-dt-platdev blocklist. Fixes: 39b360102f3a ("cpufreq: mediatek: Add support for MT8186") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Signed-off-by: Viresh Kumar commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 Author: Liang He Date: Sat Jun 18 10:25:45 2022 +0800 cpufreq: pmac32-cpufreq: Fix refcount leak bug In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name(). Signed-off-by: Liang He Signed-off-by: Viresh Kumar commit 668a7a12ded7077d4fd7ad1305667e559907e5bb Author: Stephen Boyd Date: Thu Jun 16 15:45:31 2022 -0700 cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt Offlining cpu6 and cpu7 and then onlining cpu6 hangs on sc7180-trogdor-lazor because the throttle interrupt doesn't exist. Similarly, things go sideways when suspend/resume runs. That's because the qcom_cpufreq_hw_cpu_online() and qcom_cpufreq_hw_lmh_exit() functions are calling genirq APIs with an interrupt value of '-6', i.e. -ENXIO, and that isn't good. Check the value of the throttle interrupt like we already do in other functions in this file and bail out early from lmh code to fix the hang. Reported-by: Rob Clark Cc: Vladimir Zapolskiy Cc: Bjorn Andersson Cc: Dmitry Baryshkov Fixes: a1eb080a0447 ("cpufreq: qcom-hw: provide online/offline operations") Signed-off-by: Stephen Boyd Reviewed-by: Vladimir Zapolskiy Signed-off-by: Viresh Kumar commit 4ff5a9b6d95f3524bf6d27147df497eb21968300 Author: Liang He Date: Wed Jun 15 17:48:07 2022 +0800 drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c In qoriq_cpufreq_probe(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Fixes: 157f527639da ("cpufreq: qoriq: convert to a platform driver") [ Viresh: Fixed Author's name in commit log ] Signed-off-by: Liang He Signed-off-by: Viresh Kumar commit 3b0dc529f56b5f2328244130683210be98f16f7f Author: Nicolas Dichtel Date: Thu Jun 23 14:00:15 2022 +0200 ipv6: take care of disable_policy when restoring routes When routes corresponding to addresses are restored by fixup_permanent_addr(), the dst_nopolicy parameter was not set. The typical use case is a user that configures an address on a down interface and then put this interface up. Let's take care of this flag in addrconf_f6i_alloc(), so that every callers benefit ont it. CC: stable@kernel.org CC: David Forster Fixes: df789fe75206 ("ipv6: Provide ipv6 version of "disable_policy" sysctl") Reported-by: Siwar Zitouni Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220623120015.32640-1-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski commit ce95ab775f8d8e89a038c0e5611a7381a2ef8e43 Author: Oleksij Rempel Date: Fri Jun 24 09:51:39 2022 +0200 net: usb: asix: do not force pause frames support We should respect link partner capabilities and not force flow control support on every link. Even more, in current state the MAC driver do not advertises pause support so we should not keep flow control enabled at all. Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support") Reported-by: Anton Lundin Signed-off-by: Oleksij Rempel Tested-by: Anton Lundin Link: https://lore.kernel.org/r/20220624075139.3139300-2-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 805206e66fab4ba1e0ebd19402006d62cd1d4902 Author: Oleksij Rempel Date: Fri Jun 24 09:51:38 2022 +0200 net: asix: fix "can't send until first packet is send" issue If cable is attached after probe sequence, the usbnet framework would not automatically start processing RX packets except at least one packet was transmitted. On systems with any kind of address auto configuration this issue was not detected, because some packets are send immediately after link state is changed to "running". With this patch we will notify usbnet about link status change provided by the PHYlib. Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support") Reported-by: Anton Lundin Signed-off-by: Oleksij Rempel Tested-by: Anton Lundin Link: https://lore.kernel.org/r/20220624075139.3139300-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 6b9f1d46fdada756294d2d5f04df613478386d34 Author: Michael Walle Date: Sun Jun 26 22:00:39 2022 +0200 MAINTAINERS: nfc: drop Charles Gorand from NXP-NCI Mails to Charles get an auto reply, that he is no longer working at Eff'Innov technologies. Drop the entry and mark the driver as orphaned. Signed-off-by: Michael Walle Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220626200039.4062784-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 4bbfed9112ca9da88ac83d5ffe62c988f7169e9f Author: Shreenidhi Shedi Date: Sun Jun 26 18:59:47 2022 +0530 octeon_ep: use bitwise AND This should be bitwise operator not logical. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Shreenidhi Shedi Link: https://lore.kernel.org/r/20220626132947.3992423-1-sshedi@vmware.com Signed-off-by: Jakub Kicinski commit cce13b82cf97b26919144e01c49fbf3da61c9d6c Merge: 8ee9d82cd0a45 88153e29c1e0f Author: Jakub Kicinski Date: Mon Jun 27 21:51:29 2022 -0700 Merge branch 'notify-user-space-if-any-actions-were-flushed-before-error' Victor Nogueira says: ==================== Notify user space if any actions were flushed before error This patch series fixes the behaviour of actions flush so that the kernel always notifies user space whenever it deletes actions during a flush operation, even if it didn't flush all the actions. This series also introduces tdc tests to verify this new behaviour. ==================== Link: https://lore.kernel.org/r/20220623140742.684043-1-victor@mojatatu.com Signed-off-by: Jakub Kicinski commit 88153e29c1e0f3ace8c831b06f6cea9503f16cec Author: Victor Nogueira Date: Thu Jun 23 11:07:42 2022 -0300 selftests: tc-testing: Add testcases to test new flush behaviour Add tdc test cases to verify new flush behaviour is correct, which do the following: - Try to flush only one action which is being referenced by a filter - Try to flush three actions where the last one (index 3) is being referenced by a filter Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski commit 76b39b94382f9e0a639e1c70c3253de248cc4c83 Author: Victor Nogueira Date: Thu Jun 23 11:07:41 2022 -0300 net/sched: act_api: Notify user space if any actions were flushed before error If during an action flush operation one of the actions is still being referenced, the flush operation is aborted and the kernel returns to user space with an error. However, if the kernel was able to flush, for example, 3 actions and failed on the fourth, the kernel will not notify user space that it deleted 3 actions before failing. This patch fixes that behaviour by notifying user space of how many actions were deleted before flush failed and by setting extack with a message describing what happened. Fixes: 55334a5db5cd ("net_sched: act: refuse to remove bound action outside") Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski commit 8ee9d82cd0a45e7d050ade598c9f33032a0f2891 Author: Tong Zhang Date: Sun Jun 26 21:33:48 2022 -0700 epic100: fix use after free on rmmod epic_close() calls epic_rx() and uses dma buffer, but in epic_remove_one() we already freed the dma buffer. To fix this issue, reorder function calls like in the .probe function. BUG: KASAN: use-after-free in epic_rx+0xa6/0x7e0 [epic100] Call Trace: epic_rx+0xa6/0x7e0 [epic100] epic_close+0xec/0x2f0 [epic100] unregister_netdev+0x18/0x20 epic_remove_one+0xaa/0xf0 [epic100] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Yilun Wu Signed-off-by: Tong Zhang Reviewed-by: Francois Romieu Link: https://lore.kernel.org/r/20220627043351.25615-1-ztong0001@gmail.com Signed-off-by: Jakub Kicinski commit a8fc8cb5692aebb9c6f7afd4265366d25dcd1d01 Author: Jakub Kicinski Date: Wed Jun 22 21:21:05 2022 -0700 net: tun: stop NAPI when detaching queues While looking at a syzbot report I noticed the NAPI only gets disabled before it's deleted. I think that user can detach the queue before destroying the device and the NAPI will never be stopped. Fixes: 943170998b20 ("tun: enable NAPI for TUN/TAP driver") Acked-by: Petar Penkov Link: https://lore.kernel.org/r/20220623042105.2274812-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fce54ed027577517df1e74b7d54dc2b1bd536887 Author: John Garry Date: Thu Jun 23 20:41:59 2022 +0800 scsi: hisi_sas: Limit max hw sectors for v3 HW If the controller is behind an IOMMU then the IOMMU IOVA caching range can affect performance, as discussed in [0]. Limit the max HW sectors to not exceed this limit. We need to hardcode the value until a proper DMA mapping API is available. [0] https://lore.kernel.org/linux-iommu/20210129092120.1482-1-thunder.leizhen@huawei.com/ Link: https://lore.kernel.org/r/1655988119-223714-1-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 332bd0778775d0cf105c4b9e03e460b590749916 Author: Heinz Mauelshagen Date: Tue Jun 28 00:37:22 2022 +0200 dm raid: fix accesses beyond end of raid member array On dm-raid table load (using raid_ctr), dm-raid allocates an array rs->devs[rs->raid_disks] for the raid device members. rs->raid_disks is defined by the number of raid metadata and image tupples passed into the target's constructor. In the case of RAID layout changes being requested, that number can be different from the current number of members for existing raid sets as defined in their superblocks. Example RAID layout changes include: - raid1 legs being added/removed - raid4/5/6/10 number of stripes changed (stripe reshaping) - takeover to higher raid level (e.g. raid5 -> raid6) When accessing array members, rs->raid_disks must be used in control loops instead of the potentially larger value in rs->md.raid_disks. Otherwise it will cause memory access beyond the end of the rs->devs array. Fix this by changing code that is prone to out-of-bounds access. Also fix validate_raid_redundancy() to validate all devices that are added. Also, use braces to help clean up raid_iterate_devices(). The out-of-bounds memory accesses was discovered using KASAN. This commit was verified to pass all LVM2 RAID tests (with KASAN enabled). Cc: stable@vger.kernel.org Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit 039d4ed3428cf9c2052048d177880ebd02104764 Author: Johan Hovold Date: Mon Jun 27 15:11:41 2022 -0700 Input: usbtouchscreen - add driver_info sanity check Add a sanity check on the device id-table driver_info field to make sure we never access a type structure (and function pointers) outside of the device info array (e.g. if someone fails to ifdef a device-id entry). Note that this also suppresses a compiler warning with -Warray-bounds (gcc-11.3.0) when compile-testing the driver without enabling any of the device type Kconfig options: drivers/input/touchscreen/usbtouchscreen.c: In function 'usbtouch_probe': drivers/input/touchscreen/usbtouchscreen.c:1668:16:warning: array subscript is outside array bounds of 'struct usbtouch_device_info[0]' [-Warray-bounds] 1668 | type = &usbtouch_dev_info[id->driver_info]; Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220623062446.16944-1-johan@kernel.org Signed-off-by: Dmitry Torokhov commit 5fb779558f1c97e2bf2794cb59553e569c38e2f9 Author: Stephan Gerhold Date: Mon Jun 27 15:59:38 2022 +0200 arm64: dts: qcom: msm8992-*: Fix vdd_lvs1_2-supply typo "make dtbs_check" complains about the missing "-supply" suffix for vdd_lvs1_2 which is clearly a typo, originally introduced in the msm8994-smd-rpm.dtsi file and apparently later copied to msm8992-xiaomi-libra.dts: msm8992-lg-bullhead-rev-10/101.dtb: pm8994-regulators: 'vdd_lvs1_2' does not match any of the regexes: '.*-supply$', '^((s|l|lvs|5vs)[0-9]*)|(boost-bypass)|(bob)$', 'pinctrl-[0-9]+' From schema: regulator/qcom,smd-rpm-regulator.yaml msm8992-xiaomi-libra.dtb: pm8994-regulators: 'vdd_lvs1_2' does not match any of the regexes: '.*-supply$', '^((s|l|lvs|5vs)[0-9]*)|(boost-bypass)|(bob)$', 'pinctrl-[0-9]+' From schema: regulator/qcom,smd-rpm-regulator.yaml Reported-by: Rob Herring Cc: Konrad Dybcio Fixes: f3b2c99e73be ("arm64: dts: Enable onboard SDHCI on msm8992") Fixes: 0f5cdb31e850 ("arm64: dts: qcom: Add Xiaomi Libra (Mi 4C) device tree") Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220627135938.2901871-1-stephan.gerhold@kernkonzept.com commit 08de214138cdea438a0dfcb10d355a6650c6017c Author: Rob Clark Date: Fri Jun 24 11:45:28 2022 -0700 drm/msm/gem: Fix error return on fence id alloc fail This was a typo, we didn't actually want to return zero. Fixes: a61acbbe9cf8 ("drm/msm: Track "seqno" fences by idr") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/491145/ Link: https://lore.kernel.org/r/20220624184528.4036837-1-robdclark@gmail.com commit 96b80fcd2705fc50ebe1f7f3ce204e861b3099ab Author: Helge Deller Date: Mon Jun 27 01:39:11 2022 +0200 parisc/unaligned: Fix emulate_ldw() breakage The commit e8aa7b17fe41 broke the 32-bit load-word unalignment exception handler because it calculated the wrong amount of bits by which the value should be shifted. This patch fixes it. Signed-off-by: Helge Deller Fixes: e8aa7b17fe41 ("parisc/unaligned: Rewrite inline assembly of emulate_ldw()") Cc: stable@vger.kernel.org # v5.18 commit 941e3e7912696b9fbe3586083a7c2e102cee7a87 Merge: 2390095113e98 c7cc29aaebf9e Author: Linus Torvalds Date: Mon Jun 27 10:47:34 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Fixes all over the place, most notably we are disabling IRQ hardening (again!)" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio_ring: make vring_create_virtqueue_split prettier vhost-vdpa: call vhost_vdpa_cleanup during the release virtio_mmio: Restore guest page size on resume virtio_mmio: Add missing PM calls to freeze/restore caif_virtio: fix race between virtio_device_ready() and ndo_open() virtio-net: fix race between ndo_open() and virtio_device_ready() virtio: disable notification hardening by default virtio: Remove unnecessary variable assignments virtio_ring : keep used_wrap_counter in vq->last_used_idx vduse: Tie vduse mgmtdev and its device vdpa/mlx5: Initialize CVQ vringh only once vdpa/mlx5: Update Control VQ callback information commit 2390095113e98fc52fffe35c5206d30d9efe3f78 Author: Masahiro Yamada Date: Mon Jun 27 12:22:09 2022 +0900 tick/nohz: unexport __init-annotated tick_nohz_full_setup() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it had been broken for a decade. Commit 28438794aba4 ("modpost: fix section mismatch check for exported init/exit sections") fixed it so modpost started to warn it again, then this showed up: MODPOST vmlinux.symvers WARNING: modpost: vmlinux.o(___ksymtab_gpl+tick_nohz_full_setup+0x0): Section mismatch in reference from the variable __ksymtab_tick_nohz_full_setup to the function .init.text:tick_nohz_full_setup() The symbol tick_nohz_full_setup is exported and annotated __init Fix this by removing the __init annotation of tick_nohz_full_setup or drop the export. Drop the export because tick_nohz_full_setup() is only called from the built-in code in kernel/sched/isolation.c. Fixes: ae9e557b5be2 ("time: Export tick start/stop functions for rcutorture") Reported-by: Linus Torvalds Signed-off-by: Masahiro Yamada Tested-by: Paul E. McKenney Signed-off-by: Linus Torvalds commit c2577862eeb0be94f151f2f1fff662b028061b00 Author: Florian Westphal Date: Tue Jun 21 18:26:03 2022 +0200 netfilter: br_netfilter: do not skip all hooks with 0 priority When br_netfilter module is loaded, skbs may be diverted to the ipv4/ipv6 hooks, just like as if we were routing. Unfortunately, bridge filter hooks with priority 0 may be skipped in this case. Example: 1. an nftables bridge ruleset is loaded, with a prerouting hook that has priority 0. 2. interface is added to the bridge. 3. no tcp packet is ever seen by the bridge prerouting hook. 4. flush the ruleset 5. load the bridge ruleset again. 6. tcp packets are processed as expected. After 1) the only registered hook is the bridge prerouting hook, but its not called yet because the bridge hasn't been brought up yet. After 2), hook order is: 0 br_nf_pre_routing // br_netfilter internal hook 0 chain bridge f prerouting // nftables bridge ruleset The packet is diverted to br_nf_pre_routing. If call-iptables is off, the nftables bridge ruleset is called as expected. But if its enabled, br_nf_hook_thresh() will skip it because it assumes that all 0-priority hooks had been called previously in bridge context. To avoid this, check for the br_nf_pre_routing hook itself, we need to resume directly after it, even if this hook has a priority of 0. Unfortunately, this still results in different packet flow. With this fix, the eval order after in 3) is: 1. br_nf_pre_routing 2. ip(6)tables (if enabled) 3. nftables bridge but after 5 its the much saner: 1. nftables bridge 2. br_nf_pre_routing 3. ip(6)tables (if enabled) Unfortunately I don't see a solution here: It would be possible to move br_nf_pre_routing to a higher priority so that it will be called later in the pipeline, but this also impacts ebtables evaluation order, and would still result in this very ordering problem for all nftables-bridge hooks with the same priority as the br_nf_pre_routing one. Searching back through the git history I don't think this has ever behaved in any other way, hence, no fixes-tag. Reported-by: Radim Hrazdil Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit e34b9ed96ce3b06c79bf884009b16961ca478f87 Author: Florian Westphal Date: Wed Jun 22 16:43:57 2022 +0200 netfilter: nf_tables: avoid skb access on nf_stolen When verdict is NF_STOLEN, the skb might have been freed. When tracing is enabled, this can result in a use-after-free: 1. access to skb->nf_trace 2. access to skb->mark 3. computation of trace id 4. dump of packet payload To avoid 1, keep a cached copy of skb->nf_trace in the trace state struct. Refresh this copy whenever verdict is != STOLEN. Avoid 2 by skipping skb->mark access if verdict is STOLEN. 3 is avoided by precomputing the trace id. Only dump the packet when verdict is not "STOLEN". Reported-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 05907f10e235680cc7fb196810e4ad3215d5e648 Author: Pablo Neira Ayuso Date: Tue Jun 21 14:01:41 2022 +0200 netfilter: nft_dynset: restore set element counter when failing to update This patch fixes a race condition. nft_rhash_update() might fail for two reasons: - Element already exists in the hashtable. - Another packet won race to insert an entry in the hashtable. In both cases, new() has already bumped the counter via atomic_add_unless(), therefore, decrement the set element counter. Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates") Signed-off-by: Pablo Neira Ayuso commit 4ce7e51dc712f8a006ce6abcc49f788c79287c03 Author: Bo Liu Date: Thu Jun 16 01:50:52 2022 -0400 firmware: arm_scmi: Remove usage of the deprecated ida_simple_xxx API Replace the deprecated ida_simple_{get,remove} with ida_{alloc,free}. Link: https://lore.kernel.org/r/20220616055052.4559-1-liubo03@inspur.com Signed-off-by: Bo Liu [sudeep.holla: Replace ida_alloc_min with ida_alloc as suggested by Cristian] Signed-off-by: Sudeep Holla commit 79538490fd7ade244dba400923e792519a2bdfea Author: Matthew Auld Date: Wed Jun 22 16:59:19 2022 +0100 drm/i915: tweak the ordering in cpu_write_needs_clflush For imported dma-buf objects we leave the object as cache_coherent = 0 across all platforms, which is reasonable given that have no clue what the memory underneath is, and its not like the driver can ever manually clflush the pages anyway (like with i915_gem_clflush_object) for such objects. However on discrete we choose to treat cache_dirty = true as a programmer error, leading to a warning. The simplest fix looks to be to just change the ordering in cpu_write_needs_clflush to prevent ever setting cache_dirty for dma-buf objects on discrete. Fixes: d028a7690d87 ("drm/i915/dmabuf: Fix prime_mmap to work when using LMEM") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5266 Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Gwan-gyeong Mun Reviewed-by: Gwan-gyeong Mun Link: https://patchwork.freedesktop.org/patch/msgid/20220622155919.355081-1-matthew.auld@intel.com (cherry picked from commit 563aaf4a928def2d36d1b3de0a4b515e2477b4da) Signed-off-by: Jani Nikula commit 7d23a80dc9720a378707edc03a7275d5a372355f Author: Anshuman Gupta Date: Thu Jun 16 17:52:49 2022 +0530 drm/i915/dgfx: Disable d3cold at gfx root port Currently i915 disables d3cold for i915 pci dev. This blocks D3 for i915 gfx pci upstream bridge (VSP). Let's disable d3cold at gfx root port to make sure that i915 gfx VSP can transition to D3 to save some power. We don't need to disable/enable d3cold in rpm, s2idle suspend/resume handlers. Disabling/Enabling d3cold at gfx root port in probe/remove phase is sufficient. Fixes: 1a085e23411d ("drm/i915: Disable D3Cold in s2idle and runtime pm") Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Badal Nilawar Acked-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20220616122249.5007-1-anshuman.gupta@intel.com (cherry picked from commit 138c2fca6f408f397ea8fbbbf33203f244d96e01) Signed-off-by: Jani Nikula commit 9efdd519d001ee3e761f6ff80d5eb123387421c1 Author: katrinzhou Date: Tue Jun 21 13:49:26 2022 +0100 drm/i915/gem: add missing else Add missing else in set_proto_ctx_param() to fix coverity issue. Addresses-Coverity: ("Unused value") Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Suggested-by: Tvrtko Ursulin Signed-off-by: katrinzhou [tursulin: fixup alignment] Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220621124926.615884-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 7482a65664c16cc88eb84d2b545a1fed887378a1) Signed-off-by: Jani Nikula commit 8a9ffb8c857c2c99403bd6483a5a005fed5c0773 Author: Alexey Khoroshilov Date: Sat Jun 25 23:52:43 2022 +0300 NFSD: restore EINVAL error translation in nfsd_commit() commit 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t") incidentally broke translation of -EINVAL to nfserr_notsupp. The patch restores that. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Fixes: 555dbf1a9aac ("nfsd: Replace use of rwsem with errseq_t") Signed-off-by: Chuck Lever commit 19e506b317497a8c2b3ec2f12314d355d2f00ad0 Author: Geert Uytterhoeven Date: Tue Jun 21 15:22:26 2022 +0200 eeprom: at25: Rework buggy read splitting The recent change to split reads into chunks has several problems: 1. If an SPI controller has no transfer size limit, max_chunk is SIZE_MAX, and num_msgs becomes zero, causing no data to be read into the buffer, and exposing the original contents of the buffer to userspace, 2. If the requested read size is not a multiple of the maximum transfer size, the last transfer reads too much data, overflowing the buffer, 3. The loop logic differs from the write case. Fix the above by: 1. Keeping track of the number of bytes that are still to be transferred, instead of precalculating the number of messages and keeping track of the number of bytes tranfered, 2. Calculating the transfer size of each individual message, taking into account the number of bytes left, 3. Switching from a "while"-loop to a "do-while"-loop, and renaming "msg_count" to "segment". While at it, drop the superfluous cast from "unsigned int" to "unsigned int", also from at25_ee_write(), where it was probably copied from. Fixes: 0a35780c755ccec0 ("eeprom: at25: Split reads into chunks and cap write size") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7ae260778d2c08986348ea48ce02ef148100e088.1655817534.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 8853e8ce9b576e0a3aad8381e19a117964d445fa Author: Hans de Goede Date: Mon Jun 27 15:08:50 2022 +0200 platform/x86: ideapad-laptop: Add Ideapad 5 15ITL05 to ideapad_dytc_v4_allow_table[] The Ideapad 5 15ITL05 uses DYTC version 4 for platform-profile control. This has been tested successfully with the ideapad-laptop DYTC version 5 code; Add the Ideapad 5 15ITL05 to the ideapad_dytc_v4_allow_table[]. Fixes: 599482c58ebd ("platform/x86: ideapad-laptop: Add platform support for Ideapad 5 Pro 16ACH6-82L5") Link: https://bugzilla.kernel.org/show_bug.cgi?id=213297 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220627130850.313537-1-hdegoede@redhat.com commit a27a1e35f5c87463ba7c12d5b7d7cbafbefc9213 Author: Hans de Goede Date: Thu Jun 23 13:59:14 2022 +0200 platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter Add an allow_v4_dytc module parameter to allow users to easily test if DYTC version 4 platform-profiles work on their laptop. Fixes: 599482c58ebd ("platform/x86: ideapad-laptop: Add platform support for Ideapad 5 Pro 16ACH6-82L5") Link: https://bugzilla.kernel.org/show_bug.cgi?id=213297 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220623115914.103001-1-hdegoede@redhat.com commit ec5ad331680c96ef3dd30dc297b206988023b9e1 Author: Max Staudt Date: Sat Jun 18 20:01:34 2022 +0200 tty: Add N_CAN327 line discipline ID for ELM327 based CAN driver The actual driver will be added via the CAN tree. Acked-by: Marc Kleine-Budde Signed-off-by: Max Staudt Link: https://lore.kernel.org/r/20220618180134.9890-1-max@enpas.org Signed-off-by: Greg Kroah-Hartman commit 5f701324c0fb6f9f5aaac3f8d1575321375f6d8f Author: Maxime Ripard Date: Wed Jun 22 10:02:43 2022 +0200 drm/vc4: perfmon: Fix variable dereferenced before check Commit 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711") introduced a check in vc4_perfmon_get() that dereferences a pointer before we checked whether that pointer is valid or not. Let's rework that function a bit to do things in the proper order. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711") Signed-off-by: Maxime Ripard Reviewed-by: José Expósito Link: https://patchwork.freedesktop.org/patch/msgid/20220622080243.22119-1-maxime@cerno.tech commit f8d6e9d3ca5c68e24dd485132a93d49abd444eaf Author: Ilpo Järvinen Date: Wed Jun 15 12:06:49 2022 +0300 serial: 8250: Fix __stop_tx() & DMA Tx restart races Commit e8ffbb71f783 ("serial: 8250: use THRE & __stop_tx also with DMA") changed __dma_tx_complete() to enable THRI that is cleared in __stop_tx() once THRE is asserted as UART runs out bits to transmit. It is possible, however, that more data arrives in between in which case serial8250_tx_dma() resumes Tx. THRI is not supposed to be on during DMA Tx because DMA is based on completion handler, therefore THRI must be cleared unconditionally in serial8250_tx_dma(). When Tx is about to start, another race window exists with serial8250_handle_irq() leading to a call into __stop_tx() while the Tx has already been resumed: __tx_complete(): -> spin_lock(port->lock) -> dma->tx_running = 0 -> serial8250_set_THRI() -> spin_unlock(port->lock) uart_start(): serial8250_handle_irq(): -> spin_lock(port->lock) -> serial8250_tx_dma(): -> dma->tx_running = 1 -> spin_unlock(port->lock) -> spin_lock(port->lock) -> __stop_tx() Close this race by checking !dma->tx_running before calling into __stop_tx(). Fixes: e8ffbb71f783 ("serial: 8250: use THRE & __stop_tx also with DMA") Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220615090651.15340-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 211565b100993c90b53bf40851eacaefc830cfe0 Author: Ilpo Järvinen Date: Tue Jun 14 10:56:37 2022 +0300 serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle The driver must provide throttle and unthrottle in uart_ops when it sets UPSTAT_AUTORTS. Add them using existing stop_rx & enable_interrupts functions. Fixes: 2a76fa283098 (serial: pl011: Adopt generic flag to store auto RTS status) Cc: stable Cc: Lukas Wunner Reported-by: Nuno Gonçalves Tested-by: Nuno Gonçalves Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220614075637.8558-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0 Author: Chanho Park Date: Mon Jun 27 15:51:13 2022 +0900 tty: serial: samsung_tty: set dma burst_size to 1 The src_maxburst and dst_maxburst have been changed to 1 but the settings of the UCON register aren't changed yet. They should be changed as well according to the dmaengine slave config. Fixes: aa2f80e752c7 ("serial: samsung: fix maxburst parameter for DMA transactions") Cc: stable Cc: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanho Park Link: https://lore.kernel.org/r/20220627065113.139520-1-chanho61.park@samsung.com Signed-off-by: Greg Kroah-Hartman commit cd16044d7c38d76fe2f9b71a06619e9590e3e401 Author: Marcin Wojtas Date: Mon Jun 20 14:10:46 2022 +0200 serial: 8250: dw: enable using pdata with ACPI Commit ffd381445eac ("serial: 8250: dw: Move the USR register to pdata") caused NULL-pointer dereference when booting with ACPI by unconditional usage of the recently added pdata. In order to fix that and prevent similar issues in future, hook the default version of this structure in dw8250_acpi_match table. While at it, sort all entries alphabetically. Fixes: ffd381445eac ("serial: 8250: dw: Move the USR register to pdata") Reviewed-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Signed-off-by: Marcin Wojtas Link: https://lore.kernel.org/r/20220620121046.1307412-1-mw@semihalf.com Signed-off-by: Greg Kroah-Hartman commit c7cc29aaebf9eaa543b4c70801e0ecef1101b3c8 Author: Deming Wang Date: Wed Jun 22 15:23:06 2022 -0400 virtio_ring: make vring_create_virtqueue_split prettier Add some spaces to vring_alloc_queue(make it look prettier). Signed-off-by: Deming Wang Message-Id: <20220622192306.4371-1-wangdeming@inspur.com> Signed-off-by: Michael S. Tsirkin commit 037d4305569aacaa018a617771dccbb81cc60257 Author: Stefano Garzarella Date: Wed Jun 22 17:14:07 2022 +0200 vhost-vdpa: call vhost_vdpa_cleanup during the release Before commit 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") we call vhost_vdpa_iotlb_free() during the release to clean all regions mapped in the iotlb. That commit removed vhost_vdpa_iotlb_free() and added vhost_vdpa_cleanup() to do some cleanup, including deleting all mappings, but we forgot to call it in vhost_vdpa_release(). This causes that if an application does not remove all mappings explicitly (or it crashes), the mappings remain in the iotlb and subsequent applications may fail if they map the same addresses. Calling vhost_vdpa_cleanup() also fixes a memory leak since we are not freeing `v->vdev.vqs` during the release from the same commit. Since vhost_vdpa_cleanup() calls vhost_dev_cleanup() we can remove its call from vhost_vdpa_release(). Fixes: 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") Cc: gautam.dawar@xilinx.com Signed-off-by: Stefano Garzarella Message-Id: <20220622151407.51232-1-sgarzare@redhat.com> Signed-off-by: Michael S. Tsirkin Tested-by: Eugenio Pérez Acked-by: Jason Wang commit e0c2ce8217955537dd5434baeba061f209797119 Author: Stephan Gerhold Date: Tue Jun 21 13:06:21 2022 +0200 virtio_mmio: Restore guest page size on resume Virtio devices might lose their state when the VMM is restarted after a suspend to disk (hibernation) cycle. This means that the guest page size register must be restored for the virtio_mmio legacy interface, since otherwise the virtio queues are not functional. This is particularly problematic for QEMU that currently still defaults to using the legacy interface for virtio_mmio. Write the guest page size register again in virtio_mmio_restore() to make legacy virtio_mmio devices work correctly after hibernation. Signed-off-by: Stephan Gerhold Message-Id: <20220621110621.3638025-3-stephan.gerhold@kernkonzept.com> Signed-off-by: Michael S. Tsirkin commit ed7ac37fde33ccd84e4bd2b9363c191f925364c7 Author: Stephan Gerhold Date: Tue Jun 21 13:06:20 2022 +0200 virtio_mmio: Add missing PM calls to freeze/restore Most virtio drivers provide freeze/restore callbacks to finish up device usage before suspend and to reinitialize the virtio device after resume. However, these callbacks are currently only called when using virtio_pci. virtio_mmio does not have any PM ops defined. This causes problems for example after suspend to disk (hibernation), since the virtio devices might lose their state after the VMM is restarted. Calling virtio_device_freeze()/restore() ensures that the virtio devices are re-initialized correctly. Fix this by implementing the dev_pm_ops for virtio_mmio, similar to virtio_pci_common. Signed-off-by: Stephan Gerhold Message-Id: <20220621110621.3638025-2-stephan.gerhold@kernkonzept.com> Signed-off-by: Michael S. Tsirkin commit 11a37eb66812ce6a06b79223ad530eb0e1d7294d Author: Jason Wang Date: Mon Jun 20 13:11:14 2022 +0800 caif_virtio: fix race between virtio_device_ready() and ndo_open() We currently depend on probe() calling virtio_device_ready() - which happens after netdev registration. Since ndo_open() can be called immediately after register_netdev, this means there exists a race between ndo_open() and virtio_device_ready(): the driver may start to use the device (e.g. TX) before DRIVER_OK which violates the spec. Fix this by switching to use register_netdevice() and protect the virtio_device_ready() with rtnl_lock() to make sure ndo_open() can only be called after virtio_device_ready(). Fixes: 0d2e1a2926b18 ("caif_virtio: Introduce caif over virtio") Signed-off-by: Jason Wang Message-Id: <20220620051115.3142-3-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit 50c0ada627f56c92f5953a8bf9158b045ad026a1 Author: Jason Wang Date: Fri Jun 17 15:29:49 2022 +0800 virtio-net: fix race between ndo_open() and virtio_device_ready() We currently call virtio_device_ready() after netdev registration. Since ndo_open() can be called immediately after register_netdev, this means there exists a race between ndo_open() and virtio_device_ready(): the driver may start to use the device before DRIVER_OK which violates the spec. Fix this by switching to use register_netdevice() and protect the virtio_device_ready() with rtnl_lock() to make sure ndo_open() can only be called after virtio_device_ready(). Fixes: 4baf1e33d0842 ("virtio_net: enable VQs early") Signed-off-by: Jason Wang Message-Id: <20220617072949.30734-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit 75c8f430d8596cf16634337fec8aec50e7b0feed Author: Vincent Guittot Date: Fri Jun 24 09:45:49 2022 +0200 firmware: arm_scmi: Fix response size warning for OPTEE transport Some protocols check the response size with the expected value but optee shared memory doesn't return such size whereas it is available in the optee output buffer. As an example, the base protocol compares the response size with the expected result when requesting the list of protocol which triggers a warning with optee shared memory: arm-scmi firmware:scmi0: Malformed reply - real_sz:116 calc_sz:4 (loop_num_ret:4) Save the output buffer length and use it when fetching the answer. Link: https://lore.kernel.org/r/20220624074549.3298-1-vincent.guittot@linaro.org Reviewed-by: Etienne Carriere Reviewed-by: Cristian Marussi Signed-off-by: Vincent Guittot Signed-off-by: Sudeep Holla commit cb8092d70a6f5f01ec1490fce4d35efed3ed996c Author: Xin Long Date: Fri Jun 24 12:24:31 2022 -0400 tipc: move bc link creation back to tipc_node_create Shuang Li reported a NULL pointer dereference crash: [] BUG: kernel NULL pointer dereference, address: 0000000000000068 [] RIP: 0010:tipc_link_is_up+0x5/0x10 [tipc] [] Call Trace: [] [] tipc_bcast_rcv+0xa2/0x190 [tipc] [] tipc_node_bc_rcv+0x8b/0x200 [tipc] [] tipc_rcv+0x3af/0x5b0 [tipc] [] tipc_udp_recv+0xc7/0x1e0 [tipc] It was caused by the 'l' passed into tipc_bcast_rcv() is NULL. When it creates a node in tipc_node_check_dest(), after inserting the new node into hashtable in tipc_node_create(), it creates the bc link. However, there is a gap between this insert and bc link creation, a bc packet may come in and get the node from the hashtable then try to dereference its bc link, which is NULL. This patch is to fix it by moving the bc link creation before inserting into the hashtable. Note that for a preliminary node becoming "real", the bc link creation should also be called before it's rehashed, as we don't create it for preliminary nodes. Fixes: 4cbf8ac2fe5a ("tipc: enable creating a "preliminary" node") Reported-by: Shuang Li Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 853a7614880231747040cada91d2b8d2e995c51a Author: Eric Dumazet Date: Fri Jun 24 15:30:20 2022 +0000 tunnels: do not assume mac header is set in skb_tunnel_check_pmtu() Recently added debug in commit f9aefd6b2aa3 ("net: warn if mac header was not set") caught a bug in skb_tunnel_check_pmtu(), as shown in this syzbot report [1]. In ndo_start_xmit() paths, there is really no need to use skb->mac_header, because skb->data is supposed to point at it. [1] WARNING: CPU: 1 PID: 8604 at include/linux/skbuff.h:2784 skb_mac_header_len include/linux/skbuff.h:2784 [inline] WARNING: CPU: 1 PID: 8604 at include/linux/skbuff.h:2784 skb_tunnel_check_pmtu+0x5de/0x2f90 net/ipv4/ip_tunnel_core.c:413 Modules linked in: CPU: 1 PID: 8604 Comm: syz-executor.3 Not tainted 5.19.0-rc2-syzkaller-00443-g8720bd951b8e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:skb_mac_header_len include/linux/skbuff.h:2784 [inline] RIP: 0010:skb_tunnel_check_pmtu+0x5de/0x2f90 net/ipv4/ip_tunnel_core.c:413 Code: 00 00 00 00 fc ff df 4c 89 fa 48 c1 ea 03 80 3c 02 00 0f 84 b9 fe ff ff 4c 89 ff e8 7c 0f d7 f9 e9 ac fe ff ff e8 c2 13 8a f9 <0f> 0b e9 28 fc ff ff e8 b6 13 8a f9 48 8b 54 24 70 48 b8 00 00 00 RSP: 0018:ffffc90002e4f520 EFLAGS: 00010212 RAX: 0000000000000324 RBX: ffff88804d5fd500 RCX: ffffc90005b52000 RDX: 0000000000040000 RSI: ffffffff87f05e3e RDI: 0000000000000003 RBP: ffffc90002e4f650 R08: 0000000000000003 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000000 R12: 000000000000ffff R13: 0000000000000000 R14: 000000000000ffcd R15: 000000000000001f FS: 00007f3babba9700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000080 CR3: 0000000075319000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: geneve_xmit_skb drivers/net/geneve.c:927 [inline] geneve_xmit+0xcf8/0x35d0 drivers/net/geneve.c:1107 __netdev_start_xmit include/linux/netdevice.h:4805 [inline] netdev_start_xmit include/linux/netdevice.h:4819 [inline] __dev_direct_xmit+0x500/0x730 net/core/dev.c:4309 dev_direct_xmit include/linux/netdevice.h:3007 [inline] packet_direct_xmit+0x1b8/0x2c0 net/packet/af_packet.c:282 packet_snd net/packet/af_packet.c:3073 [inline] packet_sendmsg+0x21f4/0x55d0 net/packet/af_packet.c:3104 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2489 ___sys_sendmsg+0xf3/0x170 net/socket.c:2543 __sys_sendmsg net/socket.c:2572 [inline] __do_sys_sendmsg net/socket.c:2581 [inline] __se_sys_sendmsg net/socket.c:2579 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f3baaa89109 Code: ff ff 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 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:00007f3babba9168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f3baab9bf60 RCX: 00007f3baaa89109 RDX: 0000000000000000 RSI: 0000000020000a00 RDI: 0000000000000003 RBP: 00007f3baaae305d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe74f2543f R14: 00007f3babba9300 R15: 0000000000022000 Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Stefano Brivio Reviewed-by: Stefano Brivio Signed-off-by: David S. Miller commit cd4c1e65a32afd003b08ad4aafe1e4d3e4e8e61b Author: Andrei Lalaev Date: Wed May 25 22:04:25 2022 +0300 pinctrl: sunxi: sunxi_pconf_set: use correct offset Some Allwinner SoCs have 2 pinctrls (PIO and R_PIO). Previous implementation used absolute pin numbering and it was incorrect for R_PIO pinctrl. It's necessary to take into account the base pin number. Fixes: 90be64e27621 ("pinctrl: sunxi: implement pin_config_set") Signed-off-by: Andrei Lalaev Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220525190423.410609-1-andrey.lalaev@gmail.com Signed-off-by: Linus Walleij commit 26aae8ccbc1972233afd08fb3f368947c0314265 Author: Andrew Cooper Date: Fri Jun 24 14:41:21 2022 +0100 x86/cpu/amd: Enumerate BTC_NO BTC_NO indicates that hardware is not susceptible to Branch Type Confusion. Zen3 CPUs don't suffer BTC. Hypervisors are expected to synthesise BTC_NO when it is appropriate given the migration pool, to prevent kernels using heuristics. [ bp: Massage. ] Signed-off-by: Andrew Cooper Signed-off-by: Borislav Petkov commit 7a05bc95ed1c5a59e47aaade9fb4083c27de9e62 Author: Peter Zijlstra Date: Fri Jun 24 14:03:25 2022 +0200 x86/common: Stamp out the stepping madness The whole MMIO/RETBLEED enumeration went overboard on steppings. Get rid of all that and simply use ANY. If a future stepping of these models would not be affected, it had better set the relevant ARCH_CAP_$FOO_NO bit in IA32_ARCH_CAPABILITIES. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Signed-off-by: Borislav Petkov commit 07853adc29a058c5fd143c14e5ac528448a72ed9 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:16 2022 +0200 KVM: VMX: Prevent RSB underflow before vmenter On VMX, there are some balanced returns between the time the guest's SPEC_CTRL value is written, and the vmenter. Balanced returns (matched by a preceding call) are usually ok, but it's at least theoretically possible an NMI with a deep call stack could empty the RSB before one of the returns. For maximum paranoia, don't allow *any* returns (balanced or otherwise) between the SPEC_CTRL write and the vmenter. [ bp: Fix 32-bit build. ] Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 9756bba28470722dacb79ffce554336dd1f6a6cd Author: Josh Poimboeuf Date: Tue Jun 14 23:16:15 2022 +0200 x86/speculation: Fill RSB on vmexit for IBRS Prevent RSB underflow/poisoning attacks with RSB. While at it, add a bunch of comments to attempt to document the current state of tribal knowledge about RSB attacks and what exactly is being mitigated. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit bea7e31a5caccb6fe8ed989c065072354f0ecb52 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:14 2022 +0200 KVM: VMX: Fix IBRS handling after vmexit For legacy IBRS to work, the IBRS bit needs to be always re-written after vmexit, even if it's already on. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit fc02735b14fff8c6678b521d324ade27b1a3d4cf Author: Josh Poimboeuf Date: Tue Jun 14 23:16:13 2022 +0200 KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS On eIBRS systems, the returns in the vmexit return path from __vmx_vcpu_run() to vmx_vcpu_run() are exposed to RSB poisoning attacks. Fix that by moving the post-vmexit spec_ctrl handling to immediately after the vmexit. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit bb06650634d3552c0f8557e9d16aa1a408040e28 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:12 2022 +0200 KVM: VMX: Convert launched argument to flags Convert __vmx_vcpu_run()'s 'launched' argument to 'flags', in preparation for doing SPEC_CTRL handling immediately after vmexit, which will need another flag. This is much easier than adding a fourth argument, because this code supports both 32-bit and 64-bit, and the fourth argument on 32-bit would have to be pushed on the stack. Note that __vmx_vcpu_run_flags() is called outside of the noinstr critical section because it will soon start calling potentially traceable functions. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 8bd200d23ec42d66ccd517a72dd0b9cc6132d2fd Author: Josh Poimboeuf Date: Tue Jun 14 23:16:11 2022 +0200 KVM: VMX: Flatten __vmx_vcpu_run() Move the vmx_vm{enter,exit}() functionality into __vmx_vcpu_run(). This will make it easier to do the spec_ctrl handling before the first RET. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 8faea26e611189e933ea2281975ff4dc7c1106b6 Author: Josh Poimboeuf Date: Fri Jun 24 12:52:40 2022 +0200 objtool: Re-add UNWIND_HINT_{SAVE_RESTORE} Commit c536ed2fffd5 ("objtool: Remove SAVE/RESTORE hints") removed the save/restore unwind hints because they were no longer needed. Now they're going to be needed again so re-add them. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit acac5e98ef8d638a411cfa2ee676c87e1973f126 Author: Josh Poimboeuf Date: Fri Jun 17 12:12:48 2022 -0700 x86/speculation: Remove x86_spec_ctrl_mask This mask has been made redundant by kvm_spec_ctrl_test_value(). And it doesn't even work when MSR interception is disabled, as the guest can just write to SPEC_CTRL directly. Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Reviewed-by: Paolo Bonzini Signed-off-by: Borislav Petkov commit bbb69e8bee1bd882784947095ffb2bfe0f7c9470 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:08 2022 +0200 x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit There's no need to recalculate the host value for every entry/exit. Just use the cached value in spec_ctrl_current(). Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 56aa4d221f1ee2c3a49b45b800778ec6e0ab73c5 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:07 2022 +0200 x86/speculation: Fix SPEC_CTRL write on SMT state change If the SMT state changes, SSBD might get accidentally disabled. Fix that. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit e6aa13622ea8283cc699cac5d018cc40a2ba2010 Author: Josh Poimboeuf Date: Tue Jun 14 23:16:06 2022 +0200 x86/speculation: Fix firmware entry SPEC_CTRL handling The firmware entry code may accidentally clear STIBP or SSBD. Fix that. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit b2620facef4889fefcbf2e87284f34dcd4189bce Author: Josh Poimboeuf Date: Tue Jun 14 23:16:05 2022 +0200 x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n If a kernel is built with CONFIG_RETPOLINE=n, but the user still wants to mitigate Spectre v2 using IBRS or eIBRS, the RSB filling will be silently disabled. There's nothing retpoline-specific about RSB buffer filling. Remove the CONFIG_RETPOLINE guards around it. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit d7caac991feeef1b871ee6988fd2c9725df09039 Author: Peter Zijlstra Date: Tue Jun 14 23:16:04 2022 +0200 x86/cpu/amd: Add Spectral Chicken Zen2 uarchs have an undocumented, unnamed, MSR that contains a chicken bit for some speculation behaviour. It needs setting. Note: very belatedly AMD released naming; it's now officially called MSR_AMD64_DE_CFG2 and MSR_AMD64_DE_CFG2_SUPPRESS_NOBR_PRED_BIT but shall remain the SPECTRAL CHICKEN. Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit a09a6e2399ba0595c3042b3164f3ca68a3cff33e Author: Peter Zijlstra Date: Tue Jun 14 23:16:03 2022 +0200 objtool: Add entry UNRET validation Since entry asm is tricky, add a validation pass that ensures the retbleed mitigation has been done before the first actual RET instruction. Entry points are those that either have UNWIND_HINT_ENTRY, which acts as UNWIND_HINT_EMPTY but marks the instruction as an entry point, or those that have UWIND_HINT_IRET_REGS at +0. This is basically a variant of validate_branch() that is intra-function and it will simply follow all branches from marked entry points and ensures that all paths lead to ANNOTATE_UNRET_END. If a path hits RET or an indirection the path is a fail and will be reported. There are 3 ANNOTATE_UNRET_END instances: - UNTRAIN_RET itself - exception from-kernel; this path doesn't need UNTRAIN_RET - all early exceptions; these also don't need UNTRAIN_RET Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 0fe4aeea9c01baabecc8c3afc7889c809d939bc2 Author: Josh Poimboeuf Date: Tue Jun 14 15:07:19 2022 -0700 x86/bugs: Do IBPB fallback check only once When booting with retbleed=auto, if the kernel wasn't built with CONFIG_CC_HAS_RETURN_THUNK, the mitigation falls back to IBPB. Make sure a warning is printed in that case. The IBPB fallback check is done twice, but it really only needs to be done once. Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 3ebc170068885b6fc7bedda6c667bb2c4d533159 Author: Peter Zijlstra Date: Tue Jun 14 23:16:02 2022 +0200 x86/bugs: Add retbleed=ibpb jmp2ret mitigates the easy-to-attack case at relatively low overhead. It mitigates the long speculation windows after a mispredicted RET, but it does not mitigate the short speculation window from arbitrary instruction boundaries. On Zen2, there is a chicken bit which needs setting, which mitigates "arbitrary instruction boundaries" down to just "basic block boundaries". But there is no fix for the short speculation window on basic block boundaries, other than to flush the entire BTB to evict all attacker predictions. On the spectrum of "fast & blurry" -> "safe", there is (on top of STIBP or no-SMT): 1) Nothing System wide open 2) jmp2ret May stop a script kiddy 3) jmp2ret+chickenbit Raises the bar rather further 4) IBPB Only thing which can count as "safe". Tentative numbers put IBPB-on-entry at a 2.5x hit on Zen2, and a 10x hit on Zen1 according to lmbench. [ bp: Fixup feature bit comments, document option, 32-bit build fix. ] Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit d147553b64bad34d2f92cb7d8ba454ae95c3baac Author: Peter Zijlstra Date: Tue Jun 14 23:16:01 2022 +0200 x86/xen: Add UNTRAIN_RET Ensure the Xen entry also passes through UNTRAIN_RET. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit b75b7f8ef1148be1b9321ffc2f6c19238904b438 Author: Peter Zijlstra Date: Tue Jun 14 23:16:00 2022 +0200 x86/xen: Rename SYS* entry points Native SYS{CALL,ENTER} entry points are called entry_SYS{CALL,ENTER}_{64,compat}, make sure the Xen versions are named consistently. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 9bb2ec608a209018080ca262f771e6a9ff203b6f Author: Peter Zijlstra Date: Tue Jun 14 23:15:59 2022 +0200 objtool: Update Retpoline validation Update retpoline validation with the new CONFIG_RETPOLINE requirement of not having bare naked RET instructions. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit bf5835bcdb9635c97f85120dba9bfa21e111130f Author: Peter Zijlstra Date: Tue Jun 14 23:15:58 2022 +0200 intel_idle: Disable IBRS during long idle Having IBRS enabled while the SMT sibling is idle unnecessarily slows down the running sibling. OTOH, disabling IBRS around idle takes two MSR writes, which will increase the idle latency. Therefore, only disable IBRS around deeper idle states. Shallow idle states are bounded by the tick in duration, since NOHZ is not allowed for them by virtue of their short target residency. Only do this for mwait-driven idle, since that keeps interrupts disabled across idle, which makes disabling IBRS vs IRQ-entry a non-issue. Note: C6 is a random threshold, most importantly C1 probably shouldn't disable IBRS, benchmarking needed. Suggested-by: Tim Chen Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 6ad0ad2bf8a67e27d1f9d006a1dabb0e1c360cc3 Author: Peter Zijlstra Date: Fri Jun 24 13:48:58 2022 +0200 x86/bugs: Report Intel retbleed vulnerability Skylake suffers from RSB underflow speculation issues; report this vulnerability and it's mitigation (spectre_v2=ibrs). [jpoimboe: cleanups, eibrs] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 166115c08a9b0b846b783088808a27d739be6e8d Author: Peter Zijlstra Date: Tue Jun 14 23:15:56 2022 +0200 x86/bugs: Split spectre_v2_select_mitigation() and spectre_v2_user_select_mitigation() retbleed will depend on spectre_v2, while spectre_v2_user depends on retbleed. Break this cycle. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 7c693f54c873691a4b7da05c7e0f74e67745d144 Author: Pawan Gupta Date: Tue Jun 14 23:15:55 2022 +0200 x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS Extend spectre_v2= boot option with Kernel IBRS. [jpoimboe: no STIBP with IBRS] Signed-off-by: Pawan Gupta Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit c779bc1a9002fa474175b80e72b85c9bf628abb0 Author: Peter Zijlstra Date: Tue Jun 14 23:15:54 2022 +0200 x86/bugs: Optimize SPEC_CTRL MSR writes When changing SPEC_CTRL for user control, the WRMSR can be delayed until return-to-user when KERNEL_IBRS has been enabled. This avoids an MSR write during context switch. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 2dbb887e875b1de3ca8f40ddf26bcfe55798c609 Author: Peter Zijlstra Date: Tue Jun 14 23:15:53 2022 +0200 x86/entry: Add kernel IBRS implementation Implement Kernel IBRS - currently the only known option to mitigate RSB underflow speculation issues on Skylake hardware. Note: since IBRS_ENTER requires fuller context established than UNTRAIN_RET, it must be placed after it. However, since UNTRAIN_RET itself implies a RET, it must come after IBRS_ENTER. This means IBRS_ENTER needs to also move UNTRAIN_RET. Note 2: KERNEL_IBRS is sub-optimal for XenPV. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit caa0ff24d5d0e02abce5e65c3d2b7f20a6617be5 Author: Peter Zijlstra Date: Tue Jun 14 23:15:52 2022 +0200 x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value Due to TIF_SSBD and TIF_SPEC_IB the actual IA32_SPEC_CTRL value can differ from x86_spec_ctrl_base. As such, keep a per-CPU value reflecting the current task's MSR content. [jpoimboe: rename] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit e8ec1b6e08a2102d8755ccb06fa26d540f26a2fa Author: Kim Phillips Date: Tue Jun 14 23:15:51 2022 +0200 x86/bugs: Enable STIBP for JMP2RET For untrained return thunks to be fully effective, STIBP must be enabled or SMT disabled. Co-developed-by: Josh Poimboeuf Signed-off-by: Josh Poimboeuf Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 7fbf47c7ce50b38a64576b150e7011ae73d54669 Author: Alexandre Chartre Date: Tue Jun 14 23:15:50 2022 +0200 x86/bugs: Add AMD retbleed= boot parameter Add the "retbleed=" boot parameter to select a mitigation for RETBleed. Possible values are "off", "auto" and "unret" (JMP2RET mitigation). The default value is "auto". Currently, "retbleed=auto" will select the unret mitigation on AMD and Hygon and no mitigation on Intel (JMP2RET is not effective on Intel). [peterz: rebase; add hygon] [jpoimboe: cleanups] Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 6b80b59b3555706508008f1f127b5412c89c7fd8 Author: Alexandre Chartre Date: Tue Jun 14 23:15:49 2022 +0200 x86/bugs: Report AMD retbleed vulnerability Report that AMD x86 CPUs are vulnerable to the RETBleed (Arbitrary Speculative Code Execution with Return Instructions) attack. [peterz: add hygon] [kim: invert parity; fam15h] Co-developed-by: Kim Phillips Signed-off-by: Kim Phillips Signed-off-by: Alexandre Chartre Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit a149180fbcf336e97ce4eb2cdc13672727feb94d Author: Peter Zijlstra Date: Tue Jun 14 23:15:48 2022 +0200 x86: Add magic AMD return-thunk Note: needs to be in a section distinct from Retpolines such that the Retpoline RET substitution cannot possibly use immediate jumps. ORC unwinding for zen_untrain_ret() and __x86_return_thunk() is a little tricky but works due to the fact that zen_untrain_ret() doesn't have any stack ops and as such will emit a single ORC entry at the start (+0x3f). Meanwhile, unwinding an IP, including the __x86_return_thunk() one (+0x40) will search for the largest ORC entry smaller or equal to the IP, these will find the one ORC entry (+0x3f) and all works. [ Alexandre: SVM part. ] [ bp: Build fix, massages. ] Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 951ddecf435659553ed15a9214e153a3af43a9a1 Author: Peter Zijlstra Date: Tue Jun 14 23:15:47 2022 +0200 objtool: Treat .text.__x86.* as noinstr Needed because zen_untrain_ret() will be called from noinstr code. Also makes sense since the thunks MUST NOT contain instrumentation nor be poked with dynamic instrumentation. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 7c81c0c9210c9bfab2bae76aab2999de5bad27db Author: Peter Zijlstra Date: Tue Jun 14 23:15:46 2022 +0200 x86/entry: Avoid very early RET Commit ee774dac0da1 ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()") manages to introduce a CALL/RET pair that is before SWITCH_TO_KERNEL_CR3, which means it is before RETBleed can be mitigated. Revert to an earlier version of the commit in Fixes. Down side is that this will bloat .text size somewhat. The alternative is fully reverting it. The purpose of this patch was to allow migrating error_entry() to C, including the whole of kPTI. Much care needs to be taken moving that forward to not re-introduce this problem of early RETs. Fixes: ee774dac0da1 ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit aa3d480315ba6c3025a60958e1981072ea37c3df Author: Peter Zijlstra Date: Tue Jun 14 23:15:45 2022 +0200 x86: Use return-thunk in asm code Use the return thunk in asm code. If the thunk isn't needed, it will get patched into a RET instruction during boot by apply_returns(). Since alternatives can't handle relocations outside of the first instruction, putting a 'jmp __x86_return_thunk' in one is not valid, therefore carve out the memmove ERMS path into a separate label and jump to it. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 0ee9073000e8791f8b134a8ded31bcc767f7f232 Author: Kim Phillips Date: Tue Jun 14 23:15:44 2022 +0200 x86/sev: Avoid using __x86_return_thunk Specifically, it's because __enc_copy() encrypts the kernel after being relocated outside the kernel in sme_encrypt_execute(), and the RET macro's jmp offset isn't amended prior to execution. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 15583e514eb16744b80be85dea0774ece153177d Author: Peter Zijlstra Date: Tue Jun 14 23:15:43 2022 +0200 x86/vsyscall_emu/64: Don't use RET in vsyscall emulation This is userspace code and doesn't play by the normal kernel rules. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit af2e140f34208a5dfb6b7a8ad2d56bda88f0524d Author: Peter Zijlstra Date: Tue Jun 14 23:15:42 2022 +0200 x86/kvm: Fix SETcc emulation for return thunks Prepare the SETcc fastop stuff for when RET can be larger still. The tricky bit here is that the expressions should not only be constant C expressions, but also absolute GAS expressions. This means no ?: and 'true' is ~0. Also ensure em_setcc() has the same alignment as the actual FOP_SETCC() ops, this ensures there cannot be an alignment hole between em_setcc() and the first op. Additionally, add a .skip directive to the FOP_SETCC() macro to fill any remaining space with INT3 traps; however the primary purpose of this directive is to generate AS warnings when the remaining space goes negative. Which is a very good indication the alignment magic went side-ways. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit d77cfe594ad50e0bf95d457e02ccd578791b2a15 Author: Peter Zijlstra Date: Tue Jun 14 23:15:41 2022 +0200 x86/bpf: Use alternative RET encoding Use the return thunk in eBPF generated code, if needed. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 1f001e9da6bbf482311e45e48f53c2bd2179e59c Author: Peter Zijlstra Date: Tue Jun 14 23:15:40 2022 +0200 x86/ftrace: Use alternative RET encoding Use the return thunk in ftrace trampolines, if needed. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit ee88d363d15617ff50ac24fab0ffec11113b2aeb Author: Peter Zijlstra Date: Tue Jun 14 23:15:39 2022 +0200 x86,static_call: Use alternative RET encoding In addition to teaching static_call about the new way to spell 'RET', there is an added complication in that static_call() is allowed to rewrite text before it is known which particular spelling is required. In order to deal with this; have a static_call specific fixup in the apply_return() 'alternative' patching routine that will rewrite the static_call trampoline to match the definite sequence. This in turn creates the problem of uniquely identifying static call trampolines. Currently trampolines are 8 bytes, the first 5 being the jmp.d32/ret sequence and the final 3 a byte sequence that spells out 'SCT'. This sequence is used in __static_call_validate() to ensure it is patching a trampoline and not a random other jmp.d32. That is, false-positives shouldn't be plenty, but aren't a big concern. OTOH the new __static_call_fixup() must not have false-positives, and 'SCT' decodes to the somewhat weird but semi plausible sequence: push %rbx rex.XB push %r12 Additionally, there are SLS concerns with immediate jumps. Combined it seems like a good moment to change the signature to a single 3 byte trap instruction that is unique to this usage and will not ever get generated by accident. As such, change the signature to: '0x0f, 0xb9, 0xcc', which decodes to: ud1 %esp, %ecx Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit d9e9d2300681d68a775c28de6aa6e5290ae17796 Author: Peter Zijlstra Date: Tue Jun 14 23:15:38 2022 +0200 x86,objtool: Create .return_sites Find all the return-thunk sites and record them in a .return_sites section such that the kernel can undo this. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 15e67227c49a57837108acfe1c80570e1bd9f962 Author: Peter Zijlstra Date: Tue Jun 14 23:15:37 2022 +0200 x86: Undo return-thunk damage Introduce X86_FEATURE_RETHUNK for those afflicted with needing this. [ bp: Do only INT3 padding - simpler. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 0b53c374b9eff2255a386f1f1cfb9a928e52a5ae Author: Peter Zijlstra Date: Tue Jun 14 23:15:36 2022 +0200 x86/retpoline: Use -mfunction-return Utilize -mfunction-return=thunk-extern when available to have the compiler replace RET instructions with direct JMPs to the symbol __x86_return_thunk. This does not affect assembler (.S) sources, only C sources. -mfunction-return=thunk-extern has been available since gcc 7.3 and clang 15. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Reviewed-by: Josh Poimboeuf Tested-by: Nick Desaulniers Signed-off-by: Borislav Petkov commit 00e1533325fd1fb5459229fe37f235462649f668 Author: Peter Zijlstra Date: Tue Jun 14 23:15:35 2022 +0200 x86/retpoline: Swizzle retpoline thunk Put the actual retpoline thunk as the original code so that it can become more complicated. Specifically, it allows RET to be a JMP, which can't be .altinstr_replacement since that doesn't do relocations (except for the very first instruction). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 369ae6ffc41a3c1137cab697635a84d0cc7cdcea Author: Peter Zijlstra Date: Tue Jun 14 23:15:34 2022 +0200 x86/retpoline: Cleanup some #ifdefery On it's own not much of a cleanup but it prepares for more/similar code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit a883d624aed463c84c22596006e5a96f5b44db31 Author: Peter Zijlstra Date: Tue Jun 14 23:15:33 2022 +0200 x86/cpufeatures: Move RETPOLINE flags to word 11 In order to extend the RETPOLINE features to 4, move them to word 11 where there is still room. This mostly keeps DISABLE_RETPOLINE simple. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit 742ab6df974ae8384a2dd213db1a3a06cf6d8936 Author: Peter Zijlstra Date: Tue Jun 14 23:15:32 2022 +0200 x86/kvm/vmx: Make noinstr clean The recent mmio_stale_data fixes broke the noinstr constraints: vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0x15b: call to wrmsrl.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0x1bf: call to kvm_arch_has_assigned_device() leaves .noinstr.text section make it all happy again. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov commit 8630354f42bef90f51e003a7ce62b69aceb735ca Author: Peng Fan Date: Wed Jun 22 14:14:10 2022 +0800 arm64: dts: imx8mp-icore-mx8mp-edim2.2: correct pad settings BIT3 and BIT0 are reserved bits, should not touch. Fixes: aec8ad34f7f2 ("arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 242d8ee9111171a6e68249aaff62643c513be6ec Author: Peng Fan Date: Wed Jun 22 14:14:09 2022 +0800 arm64: dts: imx8mp-phyboard-pollux-rdk: correct i2c2 & mmc settings BIT3 and BIT0 are reserved bits, should not touch. Fixes: 88f7f6bcca37 ("arm64: dts: freescale: Add support for phyBOARD-Pollux-i.MX8MP") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit bae4de618efe1c41d34aa2e6cef8b08e46256667 Author: Peng Fan Date: Wed Jun 22 14:14:08 2022 +0800 arm64: dts: imx8mp-phyboard-pollux-rdk: correct eqos pad settings BIT3 and BIT0 are reserved bits, should not touch. Fixes: 6f96852619d5 ("arm64: dts: freescale: Add support EQOS MAC on phyBOARD-Pollux-i.MX8MP") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit e266c155bd88e95f9b86379d6b0add6ac6e5452e Author: Peng Fan Date: Wed Jun 22 14:14:07 2022 +0800 arm64: dts: imx8mp-phyboard-pollux-rdk: correct uart pad settings BIT3 and BIT0 are reserved bits, should not touch. Fixes: 846f752866bd ("arm64: dts: imx8mp-phyboard-pollux-rdk: Change debug UART") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 843af59e577021bd9c975b7a17c237394f26b929 Author: Peng Fan Date: Wed Jun 22 14:14:06 2022 +0800 arm64: dts: imx8mp-venice-gw74xx: correct pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Should not set reserved bit. Fixes: 7899eb6cb15d ("arm64: dts: imx: Add i.MX8M Plus Gateworks gw7400 dts support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 0836de513ebaae5f03014641eac996290d67493d Author: Peng Fan Date: Wed Jun 22 14:14:05 2022 +0800 arm64: dts: imx8mp-evk: correct I2C3 pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 5e4a67ff7f69 ("arm64: dts: imx8mp-evk: Add i2c3 support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 05a7f43478e890513d571f36660bfedc1482a588 Author: Peng Fan Date: Wed Jun 22 14:14:04 2022 +0800 arm64: dts: imx8mp-evk: correct I2C1 pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 5497bc2a2bff ("arm64: dts: imx8mp-evk: Add PMIC device") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 8c214b78e149dc7209e38a031292fe21d7017561 Author: Peng Fan Date: Wed Jun 22 14:14:03 2022 +0800 arm64: dts: imx8mp-evk: correct I2C5 pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: 8134822db08d ("arm64: dts: imx8mp-evk: add support for I2C5") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 95587ecfcf25e1b9e7810ed91df084d823ee8023 Author: Peng Fan Date: Wed Jun 22 14:14:02 2022 +0800 arm64: dts: imx8mp-evk: correct vbus pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Not set reserved bit. Fixes: 9e847693c6f3 ("arm64: dts: freescale: Add i.MX8MP EVK board support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit e6e1bc0ec9e8ad212fa46d8878a6e17cd31fdf7b Author: Peng Fan Date: Wed Jun 22 14:14:01 2022 +0800 arm64: dts: imx8mp-evk: correct eqos pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Although function is not broken, we should not set reserved bit. Fixes: dc6d5dc89bad ("arm64: dts: imx8mp-evk: enable EQOS ethernet") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit e2c00820a99c55c9bb40642d5818a904a1e0d664 Author: Peng Fan Date: Wed Jun 22 14:14:00 2022 +0800 arm64: dts: imx8mp-evk: correct vbus pad settings 0x19 is not a valid setting. According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Not set reserved bit. Fixes: 43da4f92a611 ("arm64: dts: imx8mp-evk: enable usb1 as host mode") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit b838582ab8d5fb11b2c0275056a9f34e1d94fece Author: Peng Fan Date: Wed Jun 22 14:13:59 2022 +0800 arm64: dts: imx8mp-evk: correct gpio-led pad settings 0x19 is not a valid setting. According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Correct setting with PE PUE set, DSE set to 0. Fixes: 50d336b12f34 ("arm64: dts: imx8mp-evk: Add GPIO LED support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 2d4fb72b681205eed4553d8802632bd3270be3ba Author: Sherry Sun Date: Wed Jun 22 14:13:58 2022 +0800 arm64: dts: imx8mp-evk: correct the uart2 pinctl value According to the IOMUXC_SW_PAD_CTL_PAD_UART2_RXD/TXD register define in imx8mp RM, bit0 and bit3 are reserved, and the uart2 rx/tx pin should enable the pull up, so need to set bit8 to 1. The original pinctl value 0x49 is incorrect and needs to be changed to 0x140, same as uart1 and uart3. Fixes: 9e847693c6f3 ("arm64: dts: freescale: Add i.MX8MP EVK board support") Reviewed-by: Haibo Chen Signed-off-by: Sherry Sun Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit 01785f1f156511c4f285786b4192245d4f476bf1 Author: Peng Fan Date: Wed Jun 22 14:13:57 2022 +0800 arm64: dts: imx8mp-evk: correct mmc pad settings According to RM bit layout, BIT3 and BIT0 are reserved. 8 7 6 5 4 3 2 1 0 PE HYS PUE ODE FSEL X DSE X Not set reserved bit. Fixes: 9e847693c6f3 ("arm64: dts: freescale: Add i.MX8MP EVK board support") Signed-off-by: Peng Fan Reviewed-by: Rasmus Villemoes Signed-off-by: Shawn Guo commit b10ef5f2ddb3a5a22ac0936c8d91a50ac5e55e77 Author: Fabio Estevam Date: Tue Jun 21 13:45:05 2022 -0300 ARM: mxs_defconfig: Enable the framebuffer Currently, when booting Linux on a imx28-evk board there is no display activity. Enable CONFIG_FB which is nowadays required for CONFIG_DRM_PANEL_LVDS, CONFIG_DRM_PANEL_SIMPLE, CONFIG_DRM_PANEL_SEIKO_43WVF1G, CONFIG_FB_MODE_HELPERS, CONFIG_BACKLIGHT_PWM, CONFIG_BACKLIGHT_GPIO, CONFIG_FRAMEBUFFER_CONSOLE, CONFIG_LOGO, CONFIG_FONTS, CONFIG_FONT_8x8 and CONFIG_FONT_8x16. Based on commit c54467482ffd ("ARM: imx_v6_v7_defconfig: enable fb"). Fixes: f611b1e7624c ("drm: Avoid circular dependencies for CONFIG_FB") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit d2f33f0c3ad7b0d5262d9b986f1353265fad7a08 Author: Jean Delvare Date: Tue Jun 21 15:55:11 2022 +0200 platform/x86: thinkpad_acpi: Fix a memory leak of EFCH MMIO resource Unlike release_mem_region(), a call to release_resource() does not free the resource, so it has to be freed explicitly to avoid a memory leak. Signed-off-by: Jean Delvare Fixes: 455cd867b85b ("platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops") Cc: Mario Limonciello Cc: Henrique de Moraes Holschuh Cc: Hans de Goede Cc: Mark Gross Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20220621155511.5b266395@endymion.delvare Signed-off-by: Hans de Goede commit 79e90ca02d7d45898c52fd8523cd4a2a304e409c Author: Dan Carpenter Date: Wed Jun 15 11:11:07 2022 +0300 platform/mellanox: nvsw-sn2201: fix error code in nvsw_sn2201_create_static_devices() This should return PTR_ERR() instead of IS_ERR(). Also "dev->client" has been set to NULL by this point so it returns 0/success so preserve the error code earlier. Fixes: 662f24826f95 ("platform/mellanox: Add support for new SN2201 system") Signed-off-by: Dan Carpenter Acked-by: Michael Shych Link: https://lore.kernel.org/r/YqmUGwmPK7cPolk/@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d63eae6747eb8b3192e89712f6553c6aa162f872 Author: Gayatri Kammela Date: Tue Jun 14 17:27:51 2022 -0700 platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver Add Alder Lake N (ADL-N) to the list of the platforms that Intel's PMC core driver supports. Alder Lake N reuses all the TigerLake PCH IPs. Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David E. Box Signed-off-by: Gayatri Kammela Reviewed-by: Rajneesh Bhardwaj Link: https://lore.kernel.org/r/20220615002751.3371730-1-gayatri.kammela@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3fdd4ef444f99d25f524e68777d210d453757698 Author: Peng Fan Date: Mon Jun 20 11:20:44 2022 +0800 arm64: dts: imx8mp: correct clock of pgc_ispdwp The deprecated DIV clk is previously part of the ISP composite clk, but there is still one child clk(IMX8MP_CLK_MEDIA_ISP_ROOT) sourcing from IMX8MP_CLK_MEDIA_ISP( previously IMX8MP_CLK_MEDIA_ISP_DIV) So IMX8MP_CLK_MEDIA_ISP_ROOT should be used, not IMX8MP_CLK_MEDIA_ISP_DIV. Fixes: 9d89189d5227 ("arm64: dts: imx8mp: Add MEDIAMIX power domains") Signed-off-by: Peng Fan Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: Shawn Guo commit f94e08b602d45ec8ea69fb0aa1c85b712a6a4558 Author: Darrick J. Wong Date: Thu Jun 23 09:26:38 2022 -0700 xfs: clean up the end of xfs_attri_item_recover The end of this function could use some cleanup -- the EAGAIN conditionals make it harder to figure out what's going on with the disposal of xattri_leaf_bp, and the dual error/ret variables aren't needed. Turn the EAGAIN case into a separate block documenting all the subtleties of recovering in the middle of an xattr update chain, which makes the rest of the prologue much simpler. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit b822ea17fd15659b92cb86c48d018c9e43d0fd98 Author: Darrick J. Wong Date: Wed Jun 22 16:57:07 2022 -0700 xfs: always free xattri_leaf_bp when cancelling a deferred op While running the following fstest with logged xattrs DISabled, I noticed the following: # FSSTRESS_AVOID="-z -f unlink=1 -f rmdir=1 -f creat=2 -f mkdir=2 -f getfattr=3 -f listfattr=3 -f attr_remove=4 -f removefattr=4 -f setfattr=20 -f attr_set=60" ./check generic/475 INFO: task u9:1:40 blocked for more than 61 seconds. Tainted: G O 5.19.0-rc2-djwx #rc2 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:u9:1 state:D stack:12872 pid: 40 ppid: 2 flags:0x00004000 Workqueue: xfs-cil/dm-0 xlog_cil_push_work [xfs] Call Trace: __schedule+0x2db/0x1110 schedule+0x58/0xc0 schedule_timeout+0x115/0x160 __down_common+0x126/0x210 down+0x54/0x70 xfs_buf_lock+0x2d/0xe0 [xfs 0532c1cb1d67dd81d15cb79ac6e415c8dec58f73] xfs_buf_item_unpin+0x227/0x3a0 [xfs 0532c1cb1d67dd81d15cb79ac6e415c8dec58f73] xfs_trans_committed_bulk+0x18e/0x320 [xfs 0532c1cb1d67dd81d15cb79ac6e415c8dec58f73] xlog_cil_committed+0x2ea/0x360 [xfs 0532c1cb1d67dd81d15cb79ac6e415c8dec58f73] xlog_cil_push_work+0x60f/0x690 [xfs 0532c1cb1d67dd81d15cb79ac6e415c8dec58f73] process_one_work+0x1df/0x3c0 worker_thread+0x53/0x3b0 kthread+0xea/0x110 ret_from_fork+0x1f/0x30 This appears to be the result of shortform_to_leaf creating a new leaf buffer as part of adding an xattr to a file. The new leaf buffer is held and attached to the xfs_attr_intent structure, but then the filesystem shuts down. Instead of the usual path (which adds the attr to the held leaf buffer which releases the hold), we instead cancel the entire deferred operation. Unfortunately, xfs_attr_cancel_item doesn't release any attached leaf buffers, so we leak the locked buffer. The CIL cannot do anything about that, and hangs. Fix this by teaching it to release leaf buffers, and make XFS a little more careful about not leaving a dangling reference. The prologue of xfs_attri_item_recover is (in this author's opinion) a little hard to figure out, so I'll clean that up in the next patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 82af88063961da9425924d9aec3fb67a4ebade3e Author: Kaixu Xia Date: Sun Jun 19 14:53:43 2022 -0700 xfs: use invalidate_lock to check the state of mmap_lock We should use invalidate_lock and XFS_MMAPLOCK_SHARED to check the state of mmap_lock rw_semaphore in xfs_isilocked(), rather than i_rwsem and XFS_IOLOCK_SHARED. Fixes: 2433480a7e1d ("xfs: Convert to use invalidate_lock") Signed-off-by: Kaixu Xia Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit ca76a761ea2497a250988fd67f12fd93524e611e Author: Kaixu Xia Date: Sun Jun 19 14:53:42 2022 -0700 xfs: factor out the common lock flags assert There are similar lock flags assert in xfs_ilock(), xfs_ilock_nowait(), xfs_iunlock(), thus we can factor it out into a helper that is clear. Signed-off-by: Kaixu Xia Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 03c765b0e3b4cb5063276b086c76f7a612856a9a Author: Linus Torvalds Date: Sun Jun 26 14:22:10 2022 -0700 Linux 5.19-rc4 commit 1709b887397cb371ed149560a48d24b232c53ccd Merge: 413c1f14919b3 7f058112873e8 Author: Linus Torvalds Date: Sun Jun 26 14:12:56 2022 -0700 Merge tag 'soc-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "A number of fixes have accumulated, but they are largely for harmless issues: - Several OF node leak fixes - A fix to the Exynos7885 UART clock description - DTS fixes to prevent boot failures on TI AM64 and J721s2 - Bus probe error handling fixes for Baikal-T1 - A fixup to the way STM32 SoCs use separate dts files for different firmware stacks - Multiple code fixes for Arm SCMI firmware, all dealing with robustness of the implementation - Multiple NXP i.MX devicetree fixes, addressing incorrect data in DT nodes - Three updates to the MAINTAINERS file, including Florian Fainelli taking over BCM283x/BCM2711 (Raspberry Pi) from Nicolas Saenz Julienne" * tag 'soc-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (29 commits) ARM: dts: aspeed: nuvia: rename vendor nuvia to qcom arm: mach-spear: Add missing of_node_put() in time.c ARM: cns3xxx: Fix refcount leak in cns3xxx_init MAINTAINERS: Update email address arm64: dts: ti: k3-am64-main: Remove support for HS400 speed mode arm64: dts: ti: k3-j721s2: Fix overlapping GICD memory region ARM: dts: bcm2711-rpi-400: Fix GPIO line names bus: bt1-axi: Don't print error on -EPROBE_DEFER bus: bt1-apb: Don't print error on -EPROBE_DEFER ARM: Fix refcount leak in axxia_boot_secondary ARM: dts: stm32: move SCMI related nodes in a dedicated file for stm32mp15 soc: imx: imx8m-blk-ctrl: fix display clock for LCDIF2 power domain ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity ARM: dts: imx6qdl: correct PU regulator ramp delay firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported ARM: dts: imx7: Move hsic_phy power domain to HSIC PHY node soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe MAINTAINERS: Update BCM2711/BCM2835 maintainer ... commit 413c1f14919b3efee05eb79d2e913663e964abda Merge: 893d1eaa56e8e e67679cc4264c Author: Linus Torvalds Date: Sun Jun 26 14:00:55 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "Minor things, mainly - mailmap updates, MAINTAINERS updates, etc. Fixes for this merge window: - fix for a damon boot hang, from SeongJae - fix for a kfence warning splat, from Jason Donenfeld - fix for zero-pfn pinning, from Alex Williamson - fix for fallocate hole punch clearing, from Mike Kravetz Fixes for previous releases: - fix for a performance regression, from Marcelo - fix for a hwpoisining BUG from zhenwei pi" * tag 'mm-hotfixes-stable-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mailmap: add entry for Christian Marangi mm/memory-failure: disable unpoison once hw error happens hugetlbfs: zero partial pages during fallocate hole punch mm: memcontrol: reference to tools/cgroup/memcg_slabinfo.py mm: re-allow pinning of zero pfns mm/kfence: select random number before taking raw lock MAINTAINERS: add maillist information for LoongArch MAINTAINERS: update MM tree references MAINTAINERS: update Abel Vesa's email MAINTAINERS: add MEMORY HOT(UN)PLUG section and add David as reviewer MAINTAINERS: add Miaohe Lin as a memory-failure reviewer mailmap: add alias for jarkko@profian.com mm/damon/reclaim: schedule 'damon_reclaim_timer' only after 'system_wq' is initialized kthread: make it clear that kthread_create_on_node() might be terminated by any fatal signal mm: lru_cache_disable: use synchronize_rcu_expedited mm/page_isolation.c: fix one kernel-doc comment commit 893d1eaa56e8ed8ebf0726556454c9e53c0bf047 Merge: 82708bb1eb9eb f8d866194082e Author: Linus Torvalds Date: Sun Jun 26 12:12:25 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Enable ignore_missing_thread in 'perf stat', enabling counting with '--pid' when threads disappear during counting session setup - Adjust output data offset for backward compatibility in 'perf inject' - Fix missing free in copy_kcore_dir() in 'perf inject' - Fix caching files with a wrong build ID - Sync drm, cpufeatures, vhost and svn headers with the kernel * tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: tools headers UAPI: Synch KVM's svm.h header with the kernel tools include UAPI: Sync linux/vhost.h with the kernel sources perf stat: Enable ignore_missing_thread perf inject: Adjust output data offset for backward compatibility perf trace beauty: Fix generation of errno id->str table on ALT Linux perf build-id: Fix caching files with a wrong build ID tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Sync drm/i915_drm.h with the kernel sources perf inject: Fix missing free in copy_kcore_dir() commit 82708bb1eb9ebc2d1e296f2c919685761f2fa8dd Merge: c898c67db6d7d 037e127452b97 Author: Linus Torvalds Date: Sun Jun 26 10:11:36 2022 -0700 Merge tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - zoned relocation fixes: - fix critical section end for extent writeback, this could lead to out of order write - prevent writing to previous data relocation block group if space gets low - reflink fixes: - fix race between reflinking and ordered extent completion - proper error handling when block reserve migration fails - add missing inode iversion/mtime/ctime updates on each iteration when replacing extents - fix deadlock when running fsync/fiemap/commit at the same time - fix false-positive KCSAN report regarding pid tracking for read locks and data race - minor documentation update and link to new site * tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: Documentation: update btrfs list of features and link to readthedocs.io btrfs: fix deadlock with fsync+fiemap+transaction commit btrfs: don't set lock_owner when locking extent buffer for reading btrfs: zoned: fix critical section of relocation inode writeback btrfs: zoned: prevent allocation from previous data relocation BG btrfs: do not BUG_ON() on failure to migrate space when replacing extents btrfs: add missing inode updates on each iteration when replacing extents btrfs: fix race between reflinking and ordered extent completion commit c898c67db6d7de1b1e7970cd16c45eaa46bd231b Merge: be129fab66f28 3be4562584bba Author: Linus Torvalds Date: Sun Jun 26 10:01:40 2022 -0700 Merge tag 'dma-mapping-5.19-2022-06-26' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fix from Christoph Hellwig: - pass the correct size to dma_set_encrypted() when freeing memory (Dexuan Cui) * tag 'dma-mapping-5.19-2022-06-26' of git://git.infradead.org/users/hch/dma-mapping: dma-direct: use the correct size for dma_set_encrypted() commit be129fab66f284c239251ec5b6e30c6e903d8881 Merge: c0c6a7bd4c6f8 cb5177336ecb0 Author: Linus Torvalds Date: Sun Jun 26 09:13:51 2022 -0700 Merge tag 'for-5.19/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes from Helge Deller: "Two bug fixes for the pxa3xx and intelfb drivers: - pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write - intelfb: Initialize value of stolen size The other changes are small cleanups, simplifications and documentation updates to the cirrusfb, skeletonfb, omapfb, intelfb, au1100fb and simplefb drivers" * tag 'for-5.19/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: video: fbdev: omap: Remove duplicate 'the' in comment video: fbdev: omapfb: Align '*' in comment video: fbdev: simplefb: Check before clk_put() not needed video: fbdev: au1100fb: Drop unnecessary NULL ptr check video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write video: fbdev: skeletonfb: Convert to generic power management video: fbdev: cirrusfb: Remove useless reference to PCI power management video: fbdev: intelfb: Initialize value of stolen size video: fbdev: intelfb: Use aperture size from pci_resource_len video: fbdev: skeletonfb: Fix syntax errors in comments commit c0c6a7bd4c6f87d6d3621fd58c94110bf2404e12 Merge: e963d685dda05 0a1355db36718 Author: Linus Torvalds Date: Sun Jun 26 09:08:30 2022 -0700 Merge tag 'for-5.19/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: - enable ARCH_HAS_STRICT_MODULE_RWX to prevent a boot crash on c8000 machines - flush all mappings of a shared anonymous page on PA8800/8900 machines via flushing the whole data cache. This may slow down such machines but makes sure that the cache is consistent - Fix duplicate definition build error regarding fb_is_primary_device() * tag 'for-5.19/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Enable ARCH_HAS_STRICT_MODULE_RWX parisc: Fix flush_anon_page on PA8800/PA8900 parisc: align '*' in comment in math-emu code parisc/stifb: Fix fb_is_primary_device() only available with CONFIG_FB_STI commit e963d685dda05b978cf6bcab74b3a0ad6199327a Merge: 8100775d59a67 a2d9b75b19dc8 Author: Linus Torvalds Date: Sun Jun 26 08:59:21 2022 -0700 Merge tag 'xtensa-20220626' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa fixes from Max Filippov: - fix OF reference leaks in xtensa arch code - replace '.bss' with '.section .bss' to fix entry.S build with old assembler * tag 'xtensa-20220626' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: change '.bss' to '.section .bss' xtensa: xtfpga: Fix refcount leak bug in setup xtensa: Fix refcount leak bug in time.c commit 8100775d59a6789c3c6c309de26fac52f129cba8 Merge: 393ed5d85e8e0 f3eac426657d9 Author: Linus Torvalds Date: Sun Jun 26 08:53:20 2022 -0700 Merge tag 'powerpc-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - A fix for a CMA change that broke booting guests with > 2G RAM on Power8 hosts. - Fix the RTAS call filter to allow a special case that applications rely on. - A change to our execve path, to make the execve syscall exit tracepoint work. - Three fixes to wire up our various RNGs earlier in boot so they're available for use in the initial seeding in random_init(). - A build fix for when KASAN is enabled along with STRUCTLEAK_BYREF_ALL. Thanks to Andrew Donnellan, Aneesh Kumar K.V, Christophe Leroy, Jason Donenfeld, Nathan Lynch, Naveen N. Rao, Sathvika Vasireddy, Sumit Dubey2, Tyrel Datwyler, and Zi Yan. * tag 'powerpc-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powernv: wire up rng during setup_arch powerpc/prom_init: Fix build failure with GCC_PLUGIN_STRUCTLEAK_BYREF_ALL and KASAN powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address powerpc: Enable execve syscall exit tracepoint powerpc/pseries: wire up rng during setup_arch() powerpc/microwatt: wire up rng during setup_arch() powerpc/mm: Move CMA reservations after initmem_init() commit 393ed5d85e8e07021d8db07d7c8348dd928349d7 Merge: 97d4d0269706c ff13976676467 Author: Linus Torvalds Date: Sun Jun 26 08:47:28 2022 -0700 Merge tag 'kbuild-fixes-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix modpost to detect EXPORT_SYMBOL marked as __init or__exit - Update the supported arch list in the LLVM document - Avoid the second link of vmlinux for CONFIG_TRIM_UNUSED_KSYMS - Avoid false __KSYM___this_module define in include/generated/autoksyms.h * tag 'kbuild-fixes-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: Ignore __this_module in gen_autoksyms.sh kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) Documentation/llvm: Update Supported Arch table modpost: fix section mismatch check for exported init/exit sections commit 97d4d0269706c468ec57cbb95a79f1a5c8fd1892 Merge: 918c30dffd14c 204e6ceaa1035 Author: Linus Torvalds Date: Sun Jun 26 08:41:04 2022 -0700 Merge tag 'exfat-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat fix from Namjae Jeon: - Use updated exfat_chain directly instead of snapshot values in rename. * tag 'exfat-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: use updated exfat_chain directly during renaming commit 918c30dffd14cd3f4af1e67cb40db91a008fc4fe Merge: 0840a7914caa1 af3a6d1018f02 Author: Linus Torvalds Date: Sun Jun 26 08:34:52 2022 -0700 Merge tag '5.19-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: "Fixes addressing important multichannel, and reconnect issues. Multichannel mounts when the server network interfaces changed, or ip addresses changed, uncovered problems, especially in reconnect, but the patches for this were held up until recently due to some lock conflicts that are now addressed. Included in this set of fixes: - three fixes relating to multichannel reconnect, dynamically adjusting the list of server interfaces to avoid problems during reconnect - a lock conflict fix related to the above - two important fixes for negotiate on secondary channels (null netname can unintentionally cause multichannel to be disabled to some servers) - a reconnect fix (reporting incorrect IP address in some cases)" * tag '5.19-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update cifs_ses::ip_addr after failover cifs: avoid deadlocks while updating iface cifs: periodically query network interfaces from server cifs: during reconnect, update interface if necessary cifs: change iface_list from array to sorted linked list smb3: use netname when available on secondary channels smb3: fix empty netname context on secondary channels commit f8d866194082e703c86751cceb07f6243cde96d2 Author: Arnaldo Carvalho de Melo Date: Mon Dec 21 20:04:45 2020 -0300 tools headers UAPI: Synch KVM's svm.h header with the kernel To pick up the changes from: d5af44dde5461d12 ("x86/sev: Provide support for SNP guest request NAEs") 0afb6b660a6b58cb ("x86/sev: Use SEV-SNP AP creation to start secondary CPUs") dc3f3d2474b80eae ("x86/mm: Validate memory when changing the C-bit") cbd3d4f7c4e5a93e ("x86/sev: Check SEV-SNP features support") That gets these new SVM exit reasons: + { SVM_VMGEXIT_PSC, "vmgexit_page_state_change" }, \ + { SVM_VMGEXIT_GUEST_REQUEST, "vmgexit_guest_request" }, \ + { SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \ + { SVM_VMGEXIT_AP_CREATION, "vmgexit_ap_creation" }, \ + { SVM_VMGEXIT_HV_FEATURES, "vmgexit_hypervisor_feature" }, \ Addressing this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/svm.h' differs from latest version at 'arch/x86/include/uapi/asm/svm.h' diff -u tools/arch/x86/include/uapi/asm/svm.h arch/x86/include/uapi/asm/svm.h This causes these changes: CC /tmp/build/perf-urgent/arch/x86/util/kvm-stat.o LD /tmp/build/perf-urgent/arch/x86/util/perf-in.o LD /tmp/build/perf-urgent/arch/x86/perf-in.o LD /tmp/build/perf-urgent/arch/perf-in.o LD /tmp/build/perf-urgent/perf-in.o LINK /tmp/build/perf-urgent/perf Cc: Adrian Hunter Cc: Borislav Petkov Cc: Brijesh Singh Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Tom Lendacky Signed-off-by: Arnaldo Carvalho de Melo commit e2213a2dc63e1b2941728a9a938c2196548e980f Author: Arnaldo Carvalho de Melo Date: Tue Apr 14 09:12:55 2020 -0300 tools include UAPI: Sync linux/vhost.h with the kernel sources To get the changes in: 84d7c8fd3aade2fe ("vhost-vdpa: introduce uAPI to set group ASID") 2d1fcb7758e49fd9 ("vhost-vdpa: uAPI to get virtqueue group id") a0c95f201170bd55 ("vhost-vdpa: introduce uAPI to get the number of address spaces") 3ace88bd37436abc ("vhost-vdpa: introduce uAPI to get the number of virtqueue groups") 175d493c3c3e09a3 ("vhost: move the backend feature bits to vhost_types.h") Silencing this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h' diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h 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 2022-06-26 12:04:35.982003781 -0300 +++ after 2022-06-26 12:04:43.819972476 -0300 @@ -28,6 +28,7 @@ [0x74] = "VDPA_SET_CONFIG", [0x75] = "VDPA_SET_VRING_ENABLE", [0x77] = "VDPA_SET_CONFIG_CALL", + [0x7C] = "VDPA_SET_GROUP_ASID", }; static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", @@ -39,5 +40,8 @@ [0x76] = "VDPA_GET_VRING_NUM", [0x78] = "VDPA_GET_IOVA_RANGE", [0x79] = "VDPA_GET_CONFIG_SIZE", + [0x7A] = "VDPA_GET_AS_NUM", + [0x7B] = "VDPA_GET_VRING_GROUP", [0x80] = "VDPA_GET_VQS_COUNT", + [0x81] = "VDPA_GET_GROUP_NUM", }; $ Cc: Adrian Hunter Cc: Gautam Dawar Cc: Jiri Olsa Cc: Michael S. Tsirkin Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/Yrh3xMYbfeAD0MFL@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 448ce0e6ea93ae99e0b36055e5f5a3f723fe3665 Author: Gang Li Date: Wed Jun 22 11:00:37 2022 +0800 perf stat: Enable ignore_missing_thread perf already support ignore_missing_thread for -p, but not yet applied to `perf stat -p `. This patch enables ignore_missing_thread for `perf stat -p `. Committer notes: And here is a refresher about the 'ignore_missing_thread' knob, from a previous patch using it: ca8000684ec4e66f ("perf evsel: Enable ignore_missing_thread for pid option") --- While monitoring a multithread process with pid option, perf sometimes may return sys_perf_event_open failure with 3(No such process) if any of the process's threads die before we open the event. However, we want perf continue monitoring the remaining threads and do not exit with error. --- Signed-off-by: Gang Li Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220622030037.15005-1-ligang.bdlg@bytedance.com Signed-off-by: Arnaldo Carvalho de Melo commit 37ed2cddcbf1b52b03b9b2344c752ed867fa3539 Author: Raul Silvera Date: Tue Jun 21 15:27:25 2022 +0000 perf inject: Adjust output data offset for backward compatibility When 'perf inject' creates a new file, it reuses the data offset from the input file. If there has been a change on the size of the header, as happened in v5.12 -> v5.13, the new offsets will be wrong, resulting in a corrupted output file. This change adds the function perf_session__data_offset to compute the data offset based on the current header size, and uses that instead of the offset from the original input file. Signed-off-by: Raul Silvera Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Athira Jajeev Cc: Colin Ian King Cc: Dave Marchevsky Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220621152725.2668041-1-rsilvera@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3713e2494b6ab98f0476bb575b22323775f7d77a Author: Arnaldo Carvalho de Melo Date: Tue Jun 21 12:34:37 2022 -0300 perf trace beauty: Fix generation of errno id->str table on ALT Linux For some reason using: cat < Signed-off-by: Arnaldo Carvalho de Melo commit ab66fdace8581ef3b4e7cf5381a168ed4058d779 Author: Adrian Hunter Date: Tue Jun 21 15:51:44 2022 +0300 perf build-id: Fix caching files with a wrong build ID Build ID events associate a file name with a build ID. However, when using perf inject, there is no guarantee that the file on the current machine at the current time has that build ID. Fix by comparing the build IDs and skip adding to the cache if they are different. Example: $ echo "int main() {return 0;}" > prog.c $ gcc -o prog prog.c $ perf record --buildid-all ./prog [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.019 MB perf.data ] $ file-buildid() { file $1 | awk -F= '{print $2}' | awk -F, '{print $1}' ; } $ file-buildid prog 444ad9be165d8058a48ce2ffb4e9f55854a3293e $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf 444ad9be165d8058a48ce2ffb4e9f55854a3293e $ echo "int main() {return 1;}" > prog.c $ gcc -o prog prog.c $ file-buildid prog 885524d5aaa24008a3e2b06caa3ea95d013c0fc5 Before: $ perf buildid-cache --purge $(pwd)/prog $ perf inject -i perf.data -o junk $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf 885524d5aaa24008a3e2b06caa3ea95d013c0fc5 $ After: $ perf buildid-cache --purge $(pwd)/prog $ perf inject -i perf.data -o junk $ file-buildid ~/.debug/$(pwd)/prog/444ad9be165d8058a48ce2ffb4e9f55854a3293e/elf $ Fixes: 454c407ec17a0c63 ("perf: add perf-inject builtin") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Tom Zanussi Link: https://lore.kernel.org/r/20220621125144.5623-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 4b3f7644ae84bcf785cc88d35327227cb2fb6b82 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: d6d0c7f681fda1d0 ("x86/cpufeatures: Add PerfMonV2 feature bit") 296d5a17e793956f ("KVM: SEV-ES: Use V_TSC_AUX if available instead of RDTSC/MSR_TSC_AUX intercepts") f30903394eb62316 ("x86/cpufeatures: Add virtual TSC_AUX feature bit") 8ad7e8f696951f19 ("x86/fpu/xsave: Support XSAVEC in the kernel") 59bd54a84d15e933 ("x86/tdx: Detect running as a TDX guest in early boot") a77d41ac3a0f41c8 ("x86/cpufeatures: Add AMD Fam19h Branch Sampling feature") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h' diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h Cc: Peter Zijlstra Cc: Sandipan Das Cc: Babu Moger Cc: Paolo Bonzini Cc: Thomas Gleixner Cc: Dave Hansen Cc: Kuppuswamy Sathyanarayanan Cc: Stephane Eranian Cc: Peter Zijlstra Link: https://lore.kernel.org/lkml/YrDkgmwhLv+nKeOo@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0fdd435cb4f873b5602913db4f2ba497a5443daf Author: Arnaldo Carvalho de Melo Date: Sat Nov 13 11:08:31 2021 -0300 tools headers UAPI: Sync drm/i915_drm.h with the kernel sources To pick up the changes in: ecf8eca51f33dbfd ("drm/i915/xehp: Add compute engine ABI") 991b4de3275728fd ("drm/i915/uapi: Add kerneldoc for engine class enum") c94fde8f516610b0 ("drm/i915/uapi: Add DRM_I915_QUERY_GEOMETRY_SUBSLICES") 1c671ad753dbbf5f ("drm/i915/doc: Link query items to their uapi structs") a2e5402691e23269 ("drm/i915/doc: Convert perf UAPI comments to kerneldoc") 462ac1cdf4d7acf1 ("drm/i915/doc: Convert drm_i915_query_topology_info comment to kerneldoc") 034d47b25b2ce627 ("drm/i915/uapi: Document DRM_I915_QUERY_HWCONFIG_BLOB") 78e1fb3112c0ac44 ("drm/i915/uapi: Add query for hwconfig blob") That don't add any new ioctl, so no changes in tooling. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h' diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h Cc: John Harrison Cc: Matt Atwood Cc: Matt Roper Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Link: http://lore.kernel.org/lkml/YrDi4ALYjv9Mdocq@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 342cb0d80613719c5e5ac30619e54b9a3fd83625 Author: Adrian Hunter Date: Mon Jun 20 13:39:04 2022 +0300 perf inject: Fix missing free in copy_kcore_dir() Free string allocated by asprintf(). Fixes: d8fc08550929bb84 ("perf inject: Keep a copy of kcore_dir") Signed-off-by: Adrian Hunter Cc: Adrian Hunter Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220620103904.7960-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 0a1355db36718178becd2bfe728a023933d73123 Author: Helge Deller Date: Sun Jun 26 11:50:43 2022 +0200 parisc: Enable ARCH_HAS_STRICT_MODULE_RWX Fix a boot crash on a c8000 machine as reported by Dave. Basically it changes patch_map() to return an alias mapping to the to-be-patched code in order to prevent writing to write-protected memory. Signed-off-by: Helge Deller Suggested-by: John David Anglin Cc: stable@vger.kernel.org # v5.2+ Link: https://lore.kernel.org/all/e8ec39e8-25f8-e6b4-b7ed-4cb23efc756e@bell.net/ commit e9ed22e6e5010997a2f922eef61ca797d0a2a246 Author: John David Anglin Date: Sat Jun 18 15:14:34 2022 +0000 parisc: Fix flush_anon_page on PA8800/PA8900 Anonymous pages are allocated with the shared mappings colouring, SHM_COLOUR. Since the alias boundary on machines with PA8800 and PA8900 processors is unknown, flush_user_cache_page() might not flush all mappings of a shared anonymous page. Flushing the whole data cache flushes all mappings. This won't fix all coherency issues with shared mappings but it seems to work well in practice. I haven't seen any random memory faults in almost a month on a rp3440 running as a debian buildd machine. There is a small preformance hit. Signed-off-by: John David Anglin Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.18+ commit d640974d1c4ee510fcc8f05f0ddaaf9d17b47643 Author: Konrad Dybcio Date: Mon May 23 23:03:04 2022 +0200 MAINTAINERS: Add myself as a reviewer for Qualcomm ARM/64 support Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220523210304.19125-1-konrad.dybcio@somainline.org commit 3ba500dee327e0261e728edec8a4f2f563d2760c Author: Dmitry Baryshkov Date: Tue May 31 15:47:35 2022 +0300 arm64: dts: qcom: sdm845: use dispcc AHB clock for mdss node It was noticed that on sdm845 after an MDSS suspend/resume cycle the driver can not read HW_REV registers properly (they will return 0 instead). Chaning the "iface" clock from <&gcc GCC_DISP_AHB_CLK> to <&dispcc DISP_CC_MDSS_AHB_CLK> fixes the issue. Fixes: 08c2a076d18f ("arm64: dts: qcom: sdm845: Add dpu to sdm845 dts file") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220531124735.1165582-1-dmitry.baryshkov@linaro.org commit 067baa9a37b32b95fdeabccde4b0cb6a2cf95f96 Author: Jason A. Donenfeld Date: Sat Jun 25 13:01:08 2022 +0200 ksmbd: use vfs_llseek instead of dereferencing NULL By not checking whether llseek is NULL, this might jump to NULL. Also, it doesn't check FMODE_LSEEK. Fix this by using vfs_llseek(), which always does the right thing. Fixes: f44158485826 ("cifsd: add file operations") Cc: stable@vger.kernel.org Cc: linux-cifs@vger.kernel.org Cc: Ronnie Sahlberg Cc: Hyunchul Lee Cc: Sergey Senozhatsky Reviewed-by: Namjae Jeon Acked-by: Al Viro Signed-off-by: Jason A. Donenfeld Signed-off-by: Steve French commit d16c5c7c925658ea94689dfe4469441f7fd59f00 Author: Jiang Jian Date: Tue Jun 21 14:38:23 2022 +0800 parisc: align '*' in comment in math-emu code Signed-off-by: Jiang Jian Reviewed-by: Kees Cook Signed-off-by: Helge Deller commit ff139766764675b9df12bcbc8928a02149b7ba95 Author: Sami Tolvanen Date: Thu Jun 16 19:57:59 2022 +0000 kbuild: Ignore __this_module in gen_autoksyms.sh Module object files can contain an undefined reference to __this_module, which isn't resolved until we link the final .ko. The kernel doesn't export this symbol, so ignore it in gen_autoksyms.sh. Signed-off-by: Sami Tolvanen Tested-by: Steve Muckle Reviewed-by: Nick Desaulniers Tested-by: Ramji Jiyani commit 53632ba87d9f302a8d97a11ec2f4f4eec7bb75ea Author: Masahiro Yamada Date: Fri Jun 24 04:11:47 2022 +0900 kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS (2nd attempt) If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice. Commit 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") explains why this happens, but it did not fix the issue at all. Now I realized I had applied a wrong patch. In v1 patch [1], the autoksyms_recursive target correctly recurses to "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive". In v2 patch [2], I accidentally dropped the diff line, and it recurses to "$(MAKE) -f $(srctree)/Makefile vmlinux". Restore the code I intended in v1. [1]: https://lore.kernel.org/linux-kbuild/1521045861-22418-8-git-send-email-yamada.masahiro@socionext.com/ [2]: https://lore.kernel.org/linux-kbuild/1521166725-24157-8-git-send-email-yamada.masahiro@socionext.com/ Fixes: 3fdc7d3fe4c0 ("kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS") Signed-off-by: Masahiro Yamada Tested-by: Sami Tolvanen Reviewed-by: Nick Desaulniers commit fc8b0b9b630df6de7415f527fe27c0c441b5dc70 Author: Dmitry Baryshkov Date: Mon May 2 22:26:04 2022 +0300 arm64: dts: qcom: sm8450 add ITS device tree node Add device tree node corresponding to the ITS part of GICv3. Reviewed-by: Vinod Koul Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220502192604.272686-1-dmitry.baryshkov@linaro.org commit 47bf59c4755930f616dd90c8c6a85f40a6d347ea Author: Konrad Dybcio Date: Sun May 1 20:40:16 2022 +0200 arm64: dts: qcom: msm8994: Fix CPU6/7 reg values CPU6 and CPU7 were mistakengly pointing to CPU5 reg. Fix it. Fixes: 02d8091bbca0 ("arm64: dts: qcom: msm8994: Add a proper CPU map") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220501184016.64138-1-konrad.dybcio@somainline.org commit 0840a7914caa14315a3191178a9f72c742477860 Merge: c24eb8d6a5b2d 315f7e15c2611 Author: Linus Torvalds Date: Sat Jun 25 10:07:36 2022 -0700 Merge tag 'char-misc-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull IIO driver fixes from Greg KH: "Here are a set of IIO driver fixes for 5.19-rc4. Jonathan said it best in his pull request to me, so I'll just quote it here below, as that's the only changes we have right now for the char-misc driver tree: testing: - Fix a missing MODULE_LICENSE() warning by restricting possible build configs. Various drivers: - Fix ordering of iio_get_trigger() being called before iio_trigger_register() adi,admv1014: - Fix dubious x & !y warning. adi,axi-adc: - Fix missing of_node_put() in error and normal paths. aspeed,adc: - Add missing of_node_put() fsl,mma8452: - Fix broken probing from device tree. - Drop check on return value of i2c write to device to cause reset as ACK will be missing (device reset before sending it). fsl,vf610: - Fix documentation of in_conversion_mode ABI. iio-trig-sysfs: - Ensure irq work has finished before freeing the trigger. invensense,mpu3050: - Disable regulators in error path. invensense,icm42600: - Fix collision of enum value of 0 with error path where 0 is no match. renesas,rzg2l_Adc: - Add missing fwnode_handle_put() in error path. rescale: - Fix a boolean logic bug for detection of raw + scale affecting an obscure corner case. semtech,sx9324: - Check return value of read of pin_defs st,stm32-adc: - Fix interaction across ADC instances for some supported devices. - Drop false spurious IRQ messages. - Fix calibration value handling. If we can't calibrate don't expose the vref_int channel. - Fix maximum clock rate for stm32pm15x ti,ads131e08: - Add missing fwnode_handle_put() in error paths. xilinx,ams: - Fix variable checked for error from platform_get_irq() x-powers,axp288: - Overide TS_PIN bias current for boards where it is not correctly initialized. yamaha,yas530: - Fix inverted check on calibration data being all zeros. All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (26 commits) iio:proximity:sx9324: Check ret value of device_property_read_u32_array() iio: accel: mma8452: ignore the return value of reset operation iio: adc: stm32: fix maximum clock rate for stm32mp15x iio: adc: stm32: fix vrefint wrong calibration value handling iio: imu: inv_icm42600: Fix broken icm42600 (chip id 0 value) iio: adc: vf610: fix conversion mode sysfs node name iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client iio: test: fix missing MODULE_LICENSE for IIO_RESCALE=m iio:humidity:hts221: rearrange iio trigger get and register iio:chemical:ccs811: rearrange iio trigger get and register iio:accel:mxc4005: rearrange iio trigger get and register iio:accel:kxcjk-1013: rearrange iio trigger get and register iio:accel:bma180: rearrange iio trigger get and register iio: afe: rescale: Fix boolean logic bug iio: adc: aspeed: Fix refcount leak in aspeed_adc_set_trim_data iio: adc: stm32: Fix IRQs on STM32F4 by removing custom spurious IRQs message iio: adc: stm32: Fix ADCs iteration in irq handler iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels() iio: adc: rzg2l_adc: add missing fwnode_handle_put() in rzg2l_adc_parse_properties() iio: trigger: sysfs: fix use-after-free on remove ... commit c24eb8d6a5b2da4cbef6a053f58ea9818c6dd659 Merge: cb84318baa063 b24346a240b36 Author: Linus Torvalds Date: Sat Jun 25 10:02:05 2022 -0700 Merge tag 'usb-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are some small USB driver fixes and new device ids for 5.19-rc4 for a few small reported issues. They include: - new usb-serial driver ids - MAINTAINERS file update to properly catch the USB dts files - dt-bindings fixes for reported build warnings - xhci driver fixes for reported problems - typec Kconfig dependancy fix - raw_gadget fuzzing fixes found by syzbot - chipidea driver bugfix - usb gadget uvc bugfix All of these have been in linux-next with no reported issues" * tag 'usb-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: chipidea: udc: check request status before setting device address USB: gadget: Fix double-free bug in raw_gadget driver xhci-pci: Allow host runtime PM as default for Intel Meteor Lake xHCI xhci-pci: Allow host runtime PM as default for Intel Raptor Lake xHCI xhci: turn off port power in shutdown xhci: Keep interrupt disabled in initialization until host is running. USB: serial: option: add Quectel RM500K module support USB: serial: option: add Quectel EM05-G modem USB: serial: pl2303: add support for more HXN (G) types usb: typec: wcove: Drop wrong dependency to INTEL_SOC_PMIC usb: gadget: uvc: fix list double add in uvcg_video_pump dt-bindings: usb: ehci: Increase the number of PHYs dt-bindings: usb: ohci: Increase the number of PHYs usb: gadget: Fix non-unique driver names in raw-gadget driver MAINTAINERS: add include/dt-bindings/usb to USB SUBSYSTEM USB: serial: option: add Telit LE910Cx 0x1250 composition commit fbb564a557809466c171b95f8d593a0972450ff2 Author: wuchi Date: Sun Jun 5 22:58:35 2022 +0800 lib/sbitmap: Fix invalid loop in __sbitmap_queue_get_batch() 1. Getting next index before continue branch. 2. Checking free bits when setting the target bits. Otherwise, it may reuse the busying bits. Signed-off-by: wuchi Reviewed-by: Martin Wilck Link: https://lore.kernel.org/r/20220605145835.26916-1-wuchi.zero@gmail.com Fixes: 9672b0d43782 ("sbitmap: add __sbitmap_queue_get_batch()") Signed-off-by: Jens Axboe commit cb84318baa063ffd11d4c5eec5c429c85855504a Merge: 29eeafc661f28 ea18d43478110 Author: Linus Torvalds Date: Sat Jun 25 09:24:59 2022 -0700 Merge tag 'loongarch-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Some bug fixes and a trivial cleanup" * tag 'loongarch-fixes-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Make compute_return_era() return void LoongArch: Fix wrong fpu version LoongArch: Fix EENTRY/MERRENTRY setting in setup_tlb_handler() LoongArch: Fix sleeping in atomic context in setup_tlb_handler() LoongArch: Fix the _stext symbol address LoongArch: Fix the !THP build commit 29eeafc661f283a7412ecf8d9899a5ffd0c80f59 Merge: 8c23f235a6a8a 82c7863ed95d0 Author: Linus Torvalds Date: Sat Jun 25 09:19:51 2022 -0700 Merge tag 'f2fs-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs fixes from Jaegeuk Kim: "Some urgent fixes to avoid generating corrupted inodes caused by compressed and inline_data files. In addition, avoid a wrong error report which prevents a roll-forward recovery" * tag 'f2fs-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: f2fs: do not count ENOENT for error case f2fs: fix iostat related lock protection f2fs: attach inline_data after setting compression commit ea18d434781105ce61ff3ef7f74c9e51812f0580 Author: Tiezhu Yang Date: Sat Jun 18 16:39:11 2022 +0800 LoongArch: Make compute_return_era() return void compute_return_era() always returns 0, make it return void, and then no need to check its return value for its callers. Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit ad82eef3cebf8cd4f67e20b902e6d02e679e2ef1 Author: Tiezhu Yang Date: Sat Jun 18 12:50:31 2022 +0800 LoongArch: Fix wrong fpu version According to the configuration information accessible by the CPUCFG instruction in LoongArch Reference Manual [1], FP_ver is stored in bit [5: 3] of CPUCFG2, the current code to get fpu version is wrong, use CPUCFG2_FPVERS to fix it. [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html Fixes: 628c3bb40e9a ("LoongArch: Add boot and setup routines") Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 26808cebf14cdf1d835ae256188ece116d2ab377 Author: Huacai Chen Date: Thu Jun 23 16:11:54 2022 +0800 LoongArch: Fix EENTRY/MERRENTRY setting in setup_tlb_handler() setup_tlb_handler() is expected to set per-cpu exception handlers, but it only set the TLBRENTRY successfully because of copy & paste errors, so fix it. Reviewed-by: WANG Xuerui Signed-off-by: Huacai Chen commit bab1c299f3945ffe7934c05f3c50377ca4b291b4 Author: Huacai Chen Date: Thu Jun 23 09:55:42 2022 +0800 LoongArch: Fix sleeping in atomic context in setup_tlb_handler() Since setup_tlb_handler() is executed in atomic context, we should use GFP_ATOMIC instead of GFP_KERNEL to alloc pages. Otherwise we will get a "sleeping in atomic context" error: [ 0.013118] BUG: sleeping function called from invalid context at mm/page_alloc.c:5158 [ 0.013126] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1 [ 0.013131] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.19-rc3+ #1008 1a223086d14d07967cc427f15d52139422271360 [ 0.013136] Hardware name: Loongson Loongson-3A5000-7A1000-1w-V0.1-CRB/Loongson-LS3A5000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27 [ 0.013140] Stack : 90000000015fc990 9000000100493c18 9000000000df3370 9000000100490000 [ 0.013151] 9000000100493b50 0000000000000000 9000000100493b58 9000000001417ef0 [ 0.013160] 900000000199e54e 0000000000000040 9000000100493c18 90000000015f7a98 [ 0.013168] ffffffffffffffff 6de72f8b42179d1e 9000000100403b80 90000000015f7890 [ 0.013176] 0000000000000001 00000000fffff175 9000000000eb9860 9000000001530b4b [ 0.013184] 9000000000e99e60 0000000000000013 0000000006ecc000 0000000000000001 [ 0.013193] 90000000015f7a98 9000000001417ef0 0000000000000004 0000000000000000 [ 0.013201] 0000000000000cc0 0000000000000000 0000000000000001 90000000015fc990 [ 0.013209] 9000000000217e74 9000000001603b6b 9000000000208640 0000000000000000 [ 0.013217] 00000000000000b0 0000000000000004 0000000000000000 0000000000070000 [ 0.013225] ... [ 0.013229] Call Trace: [ 0.013230] [<9000000000208640>] show_stack+0x4c/0x14c [ 0.013240] [<9000000000df3370>] dump_stack_lvl+0x70/0xac [ 0.013246] [<9000000000270c8c>] ___might_sleep+0x104/0x124 [ 0.013253] [<9000000000477e84>] __alloc_pages+0x240/0x464 [ 0.013260] [<9000000000214214>] setup_tlb_handler+0x104/0x1e8 [ 0.013265] [<9000000000214324>] tlb_init+0x2c/0x3c [ 0.013270] [<9000000000208b74>] per_cpu_trap_init+0xec/0x108 [ 0.013275] [<9000000000202850>] cpu_probe+0x400/0x8a4 [ 0.013279] [<900000000020d160>] start_secondary+0x5c/0x3d4 Signed-off-by: Huacai Chen commit 92264f2dae7324f3189d22c0a0f0cb4e5d30d617 Author: Huacai Chen Date: Sat Jun 25 16:55:41 2022 +0800 LoongArch: Fix the _stext symbol address _stext means the start of .text section (see __is_kernel_text()), but we put its definition in .ref.text by mistake. Fix it by defining it in the vmlinux.lds.S. Signed-off-by: Huacai Chen commit 501dcbe495c0484a8f7954f1b24d2002dc6cb2d2 Author: Huacai Chen Date: Wed Jun 22 21:56:16 2022 +0800 LoongArch: Fix the !THP build Fix the !THP build by making pmd_pfn() available in all configurations. Because pmd_pfn() is used in mm/page_vma_mapped.c whether or not THP is configured. Signed-off-by: Huacai Chen commit 8c23f235a6a8ae43abea215812eb9d8cf4dd165e Merge: 6a0a17e6c6d10 b0d473185ba88 Author: Linus Torvalds Date: Fri Jun 24 17:01:31 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - make the irqchip immutable in gpio-realtek-otto - fix error code propagation in gpio-winbond - fix device removing in gpio-grgpio - fix a typo in gpio-mxs which indicates the driver is for a different model - documentation fixes - MAINTAINERS file updates * tag 'gpio-fixes-for-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mxs: Fix header comment gpio: Fix kernel-doc comments to nested union gpio: grgpio: Fix device removing gpio: winbond: Fix error code in winbond_gpio_get() gpio: realtek-otto: Make the irqchip immutable docs: driver-api: gpio: Fix filename mismatch MAINTAINERS: add include/dt-bindings/gpio to GPIO SUBSYSTEM commit 3b89b511ea0c705cc418440e2abf9d692a556d84 Author: Dan Carpenter Date: Thu Jun 23 16:32:32 2022 +0300 net: fix IFF_TX_SKB_NO_LINEAR definition The "1<<31" shift has a sign extension bug so IFF_TX_SKB_NO_LINEAR is 0xffffffff80000000 instead of 0x0000000080000000. Fixes: c2ff53d8049f ("net: Add priv_flags for allow tx skb without linear") Signed-off-by: Dan Carpenter Reviewed-by: Xuan Zhuo Link: https://lore.kernel.org/r/YrRrcGttfEVnf85Q@kili Signed-off-by: Jakub Kicinski commit 8cc683833726912498130a0130fc3bd0d169ef59 Merge: 3b9bc84d31110 0e597e2affb90 Author: Jakub Kicinski Date: Fri Jun 24 16:33:44 2022 -0700 Merge branch 'net-dp83822-fix-interrupt-floods' Enguerrand de Ribaucourt says: ==================== net: dp83822: fix interrupt floods The false carrier and RX error counters, once half full, produce interrupt floods. Since we do not use these counters, these interrupts should be disabled. ==================== Link: https://lore.kernel.org/r/20220623134645.1858361-1-enguerrand.de-ribaucourt@savoirfairelinux.com Signed-off-by: Jakub Kicinski commit 0e597e2affb90d6ea48df6890d882924acf71e19 Author: Enguerrand de Ribaucourt Date: Thu Jun 23 15:46:45 2022 +0200 net: dp83822: disable rx error interrupt Some RX errors, notably when disconnecting the cable, increase the RCSR register. Once half full (0x7fff), an interrupt flood is generated. I measured ~3k/s interrupts even after the RX errors transfer was stopped. Since we don't read and clear the RCSR register, we should disable this interrupt. Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit c96614eeab663646f57f67aa591e015abd8bd0ba Author: Enguerrand de Ribaucourt Date: Thu Jun 23 15:46:44 2022 +0200 net: dp83822: disable false carrier interrupt When unplugging an Ethernet cable, false carrier events were produced by the PHY at a very high rate. Once the false carrier counter full, an interrupt was triggered every few clock cycles until the cable was replugged. This resulted in approximately 10k/s interrupts. Since the false carrier counter (FCSCR) is never used, we can safely disable this interrupt. In addition to improving performance, this also solved MDIO read timeouts I was randomly encountering with an i.MX8 fec MAC because of the interrupt flood. The interrupt count and MDIO timeout fix were tested on a v5.4.110 kernel. Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") Signed-off-by: Enguerrand de Ribaucourt Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 3b9bc84d311104906d2b4995a9a02d7b7ddab2db Author: Jakub Kicinski Date: Wed Jun 22 21:20:39 2022 -0700 net: tun: unlink NAPI from device on destruction Syzbot found a race between tun file and device destruction. NAPIs live in struct tun_file which can get destroyed before the netdev so we have to del them explicitly. The current code is missing deleting the NAPI if the queue was detached first. Fixes: 943170998b20 ("tun: enable NAPI for TUN/TAP driver") Reported-by: syzbot+b75c138e9286ac742647@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20220623042039.2274708-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 6f0012e35160cd08a53e46e3b3bbf724b92dfe68 Author: Eric Dumazet Date: Thu Jun 23 05:04:36 2022 +0000 tcp: add a missing nf_reset_ct() in 3WHS handling When the third packet of 3WHS connection establishment contains payload, it is added into socket receive queue without the XFRM check and the drop of connection tracking context. This means that if the data is left unread in the socket receive queue, conntrack module can not be unloaded. As most applications usually reads the incoming data immediately after accept(), bug has been hiding for quite a long time. Commit 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") exposed this bug because even if the application reads this data, the skb with nfct state could stay in a per-cpu cache for an arbitrary time, if said cpu no longer process RX softirqs. Many thanks to Ilya Maximets for reporting this issue, and for testing various patches: https://lore.kernel.org/netdev/20220619003919.394622-1-i.maximets@ovn.org/ Note that I also added a missing xfrm4_policy_check() call, although this is probably not a big issue, as the SYN packet should have been dropped earlier. Fixes: b59c270104f0 ("[NETFILTER]: Keep conntrack reference until IPsec policy checks are done") Reported-by: Ilya Maximets Signed-off-by: Eric Dumazet Cc: Florian Westphal Cc: Pablo Neira Ayuso Cc: Steffen Klassert Tested-by: Ilya Maximets Reviewed-by: Ilya Maximets Link: https://lore.kernel.org/r/20220623050436.1290307-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 179a93f74b29d0f37871d7afe826292cda90f113 Author: Masami Hiramatsu (Google) Date: Fri Jun 24 07:31:35 2022 +0900 fprobe, samples: Add module parameter descriptions Add module parameter descriptions for the fprobe_example module. Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/165602349520.56016.1314423560740428008.stgit@devnote2 commit 6a0a17e6c6d1091ada18d43afd87fb26a82a9823 Merge: 4039974f3b39a 06781a5026350 Author: Linus Torvalds Date: Fri Jun 24 14:04:08 2022 -0700 Merge tag 'mtd/fixes-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd fixes from Miquel RAynal: "NAND controller fix: - gpmi: Fix busy timeout setting (wrong calculation) NAND chip driver fix: - Thoshiba: Revert the commit introducing support for a chip that might have been counterfeit" * tag 'mtd/fixes-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: gpmi: Fix setting busy timeout setting Revert "mtd: rawnand: add support for Toshiba TC58NVG0S3HTA00 NAND flash" commit 4039974f3b39abcdc1b7662489157914fd6613bf Merge: bed051817cb38 419bc8f681a0d Author: Linus Torvalds Date: Fri Jun 24 13:54:16 2022 -0700 Merge tag 'spi-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A bunch of driver specific fixes, plus a fix for spi-mem's status polling for devices that use GPIO chip selects and a DT bindings examples fix that helps with the validation work" * tag 'spi-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: rockchip: Unmask IRQ at the final to avoid preemption spi: dt-bindings: Fix unevaluatedProperties warnings in examples spi: spi-mem: Fix spi_mem_poll_status() spi: cadence: Detect transmit FIFO depth spi: spi-cadence: Fix SPI CS gets toggling sporadically commit bed051817cb38eda5f80201956a2500b4e88cd14 Merge: 7bc83546079a3 122e951eb8045 Author: Linus Torvalds Date: Fri Jun 24 13:51:07 2022 -0700 Merge tag 'regulator-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "One fix for an incorrect device description for MP5496" * tag 'regulator-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: qcom_smd: correct MP5496 ranges commit 7bc83546079a378ce91ef83fc2c6da195e9df0cf Merge: bc3b8977e3747 3f05010f243be Author: Linus Torvalds Date: Fri Jun 24 13:49:13 2022 -0700 Merge tag 'regmap-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "Two sets of fixes - one for things that were missed with the support for custom bulk I/O operations introduced in the last merge window, and another for some long standing issues with regmap-irq which affect a fairly small subset of devices" * tag 'regmap-fix-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap-irq: Fix offset/index mismatch in read_sub_irq_data() regmap-irq: Fix a bug in regmap_irq_enable() for type_in_mask chips regmap: Wire up regmap_config provided bulk write in missed functions regmap: Make regmap_noinc_read() return -ENOTSUPP if map->read isn't set regmap: Re-introduce bulk read support check in regmap_bulk_read() commit bc3b8977e3747ab8aa54a0760dce5cdfa37ad4d6 Merge: 70d605cbeecb4 c242507c1b895 Author: Linus Torvalds Date: Fri Jun 24 13:41:47 2022 -0700 Merge tag 'iommu-fixes-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Add a new IOMMU mailing list to the MAINTAINERS file to prepare for the a list migration happening on July 5th. The old list needs to stay in place until the switch happens to guarantee seemless archiving of list email. - Fix compatible device-tree string for rcar-gen4 in Renesas IOMMU driver. * tag 'iommu-fixes-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: MAINTAINERS: Add new IOMMU development mailing list iommu/ipmmu-vmsa: Fix compatible for rcar-gen4 commit 2990f223ffa7bb25422956b9f79f9176a5b38346 Author: Miaoqian Lin Date: Tue Jun 21 09:25:44 2022 +0400 RDMA/cm: Fix memory leak in ib_cm_insert_listen cm_alloc_id_priv() allocates resource for the cm_id_priv. When cm_init_listen() fails it doesn't free it, leading to memory leak. Add the missing error unwind. Fixes: 98f67156a80f ("RDMA/cm: Simplify establishing a listen cm_id") Link: https://lore.kernel.org/r/20220621052546.4821-1-linmq006@gmail.com Signed-off-by: Miaoqian Lin Signed-off-by: Jason Gunthorpe commit 70d605cbeecb408dd884b1f0cd3963eeeaac144c Merge: f6e9d01468087 e83031564137c Author: Linus Torvalds Date: Fri Jun 24 12:34:13 2022 -0700 Merge tag 'riscv-for-linus-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fix from Palmer Dabbelt: - fix the T-Head memory type errata workaround to avoid behavior that is unsupported in the LLVM assembler * tag 'riscv-for-linus-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fix ALT_THEAD_PMA's asm parameters commit f6e9d01468087e41c0905a60bba6a451882dd3b8 Merge: 2c39d612aa5f3 21e876448792a Author: Linus Torvalds Date: Fri Jun 24 12:27:24 2022 -0700 Merge tag 's390-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix perf stat accounting for cryptography counters when multiple events are installed concurrently. - Prevent installation of unsupported perf events for cryptography counters. - Treat perf events cpum_cf/CPU_CYCLES/ and cpu_cf/INSTRUCTIONS/ identical to basic events CPU_CYCLES" and INSTRUCTIONS, since they address the same hardware. - Restore kcrash operation which was broken by commit 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter"). * tag 's390-5.19-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/pai: Fix multiple concurrent event installation s390/pai: Prevent invalid event number for pai_crypto PMU s390/cpumf: Handle events cycles and instructions identical s390/crash: make copy_oldmem_page() return number of bytes copied s390/crash: add missing iterator advance in copy_oldmem_page() commit 2c39d612aa5f34d63d264598692a7e6cd4fb34eb Merge: e946554905c1d dbe97cff7dd9f Author: Linus Torvalds Date: Fri Jun 24 12:22:11 2022 -0700 Merge tag 'for-linus-5.19a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - A rare deadlock in Qubes-OS between the i915 driver and Xen grant unmapping, solved by making the unmapping fully asynchronous - A bug in the Xen blkfront driver caused by incomplete error handling - A fix for undefined behavior (shifting a signed int by 31 bits) - A fix in the Xen drmfront driver avoiding a WARN() * tag 'for-linus-5.19a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/gntdev: Avoid blocking in unmap_grant_pages() drm/xen: Add missing VM_DONTEXPAND flag in mmap callback x86/xen: Remove undefined behavior in setup_features() xen-blkfront: Handle NULL gendisk commit e946554905c1d04da2a094ce4fdf47708f570bef Merge: 38bc4ac431684 6defa24d3b12b Author: Linus Torvalds Date: Fri Jun 24 12:17:47 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM64: - Fix a regression with pKVM when kmemleak is enabled - Add Oliver Upton as an official KVM/arm64 reviewer selftests: - deal with compiler optimizations around hypervisor exits x86: - MAINTAINERS reorganization - Two SEV fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SEV: Init target VMCBs in sev_migrate_from KVM: x86/svm: add __GFP_ACCOUNT to __sev_dbg_{en,de}crypt_user() MAINTAINERS: Reorganize KVM/x86 maintainership selftests: KVM: Handle compiler optimizations in ucall KVM: arm64: Add Oliver as a reviewer KVM: arm64: Prevent kmemleak from accessing pKVM memory tools/kvm_stat: fix display of error when multiple processes are found commit ef9102004a87cb3f8b26e000a095a261fc0467d3 Author: Chris Ye Date: Tue May 31 17:09:54 2022 -0700 nvdimm: Fix badblocks clear off-by-one error nvdimm_clear_badblocks_region() validates badblock clearing requests against the span of the region, however it compares the inclusive badblock request range to the exclusive region range. Fix up the off-by-one error. Fixes: 23f498448362 ("libnvdimm: rework region badblocks clearing") Cc: Signed-off-by: Chris Ye Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/165404219489.2445897.9792886413715690399.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 38bc4ac431684498126f9baa3a530e5a132f0173 Merge: cbe232ab07ab7 1e9124df8be0a Author: Linus Torvalds Date: Fri Jun 24 11:43:49 2022 -0700 Merge tag 'drm-fixes-2022-06-24' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Fixes for this week, bit larger than normal, but I think the last couple have been quieter, and it's only rc4. There are a lot of small msm fixes, and a slightly larger set of vc4 fixes. The vc4 fixes clean up a lot of crashes around the rPI4 hardware differences from earlier ones, and problems in the page flip and modeset code which assumed earlier hw, so I thought it would be okay to keep them in. Otherwise, it's a few amdgpu, i915, sun4i and a panel quirk. amdgpu: - Adjust GTT size logic - eDP fix for RMB - DCN 3.15 fix - DP training fix - Color encoding fix for DCN2+ sun4i: - multiple suspend fixes vc4: - rework driver split for rpi4, fixes mulitple crashers. panel: - quirk for Aya Neo Next i915: - Revert low voltage SKU check removal to fix display issues - Apply PLL DCO fraction workaround for ADL-S - Don't show engine classes not present in client fdinfo msm: - Workaround for parade DSI bridge power sequencing - Fix for multi-planar YUV format offsets - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a being hit frequently in CI. - Fix to add minimum ICC vote in the msm_mdss pm_resume path to address bootup splats - Fix to avoid dereferencing without checking in WB encoder - Fix to avoid crash during suspend in DP driver by ensuring interrupt mask bits are updated - Remove unused code from dpu_encoder_virt_atomic_check() - Fix to remove redundant init of dsc variable - Fix to ensure mmap offset is initialized to avoid memory corruption from unpin/evict - Fix double runpm disable in probe-defer path - VMA fenced-unpin fixes - Fix for WB max-width - Fix for rare dp resolution change issue" * tag 'drm-fixes-2022-06-24' of git://anongit.freedesktop.org/drm/drm: (41 commits) amd/display/dc: Fix COLOR_ENCODING and COLOR_RANGE doing nothing for DCN20+ drm/amd/display: Fix typo in override_lane_settings drm/amd/display: Fix DC warning at driver load drm/amd: Revert "drm/amd/display: keep eDP Vdd on when eDP stream is already enabled" drm/amdgpu: Adjust logic around GTT size (v3) drm/sun4i: Return if frontend is not present drm/vc4: fix error code in vc4_check_tex_size() drm/sun4i: Add DMA mask and segment size drm/vc4: hdmi: Fixed possible integer overflow drm/i915/display: Re-add check for low voltage sku for max dp source rate drm/i915/fdinfo: Don't show engine classes not present drm/i915: Implement w/a 22010492432 for adl-s drm: panel-orientation-quirks: Add quirk for Aya Neo Next drm/msm/dp: force link training for display resolution change drm/msm/dpu: limit wb modes based on max_mixer_width drm/msm/dp: check core_initialized before disable interrupts at dp_display_unbind() drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf drm/msm: Don't overwrite hw fence in hw_init drm/msm: Drop update_fences() drm/vc4: Warn if some v3d code is run on BCM2711 ... commit af3a6d1018f02c6dc8388f1f3785a559c7ab5961 Author: Paulo Alcantara Date: Fri Jun 24 15:01:43 2022 -0300 cifs: update cifs_ses::ip_addr after failover cifs_ses::ip_addr wasn't being updated in cifs_session_setup() when reconnecting SMB sessions thus returning wrong value in /proc/fs/cifs/DebugData. Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@kernel.org Signed-off-by: Steve French commit 935336c191040809bf5739654ea337c13fe8f9af Author: Jakub Sitnicki Date: Thu Jun 23 11:12:31 2022 +0200 selftests/bpf: Test sockmap update when socket has ULP Cover the scenario when we cannot insert a socket into the sockmap, because it has it is using ULP. Failed insert should not have any effect on the ULP state. This is a regression test. Signed-off-by: Jakub Sitnicki Link: https://lore.kernel.org/r/20220623091231.417138-1-jakub@cloudflare.com Signed-off-by: Jakub Kicinski commit cbe232ab07ab7a1c7743c94c53d0e0d50c3d1b88 Merge: 43627618a0dff 90736eb3232d2 Author: Linus Torvalds Date: Fri Jun 24 11:16:27 2022 -0700 Merge tag 'for-5.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix DM era to commit metadata during suspend using drain_workqueue instead of flush_workqueue. - Fix DM core's dm_io_complete to not return early if io error is BLK_STS_AGAIN but bio polling is not in use. - Fix DM core's dm_io_complete BLK_STS_DM_REQUEUE handling when dm_io represents a split bio. - Fix recent DM mirror log regression by clearing bits up to BITS_PER_LONG boundary. * tag 'for-5.19/dm-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm mirror log: clear log bits up to BITS_PER_LONG boundary dm: fix BLK_STS_DM_REQUEUE handling when dm_io represents split bio dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling dm era: commit metadata in postsuspend after worker stops commit 43627618a0dff4d7b2d743c2b57e0130f3fa6a7e Merge: a237cfd6b7469 540a92bfe6dab Author: Linus Torvalds Date: Fri Jun 24 11:12:34 2022 -0700 Merge tag 'ata-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: - a single patch to fix tracing of command completion (Edward) * tag 'ata-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata: add qc->flags in ata_qc_complete_template tracepoint commit a237cfd6b7469d6f5eeaa45f30128ab78b5281a5 Merge: 598f240487933 e531485a0a0e0 Author: Linus Torvalds Date: Fri Jun 24 11:07:54 2022 -0700 Merge tag 'block-5.19-2022-06-24' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Series fixing issues with sysfs locking and name reuse (Christoph) - NVMe pull request via Christoph: - Fix the mixed up CRIMS/CRWMS constants (Joel Granados) - Add another broken identifier quirk (Leo Savernik) - Fix up a quirk because Samsung reuses PCI IDs over different products (Christoph Hellwig) - Remove old WARN_ON() that doesn't apply anymore (Li) - Fix for using a stale cached request value for rq-qos throttling mechanisms that may schedule(), like iocost (me) - Remove unused parameter to blk_independent_access_range() (Damien) * tag 'block-5.19-2022-06-24' of git://git.kernel.dk/linux-block: block: remove WARN_ON() from bd_link_disk_holder nvme: move the Samsung X5 quirk entry to the core quirks nvme: fix the CRIMS and CRWMS definitions to match the spec nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH block: pop cached rq before potentially blocking rq_qos_throttle() block: remove queue from struct blk_independent_access_range block: freeze the queue earlier in del_gendisk block: remove per-disk debugfs files in blk_unregister_queue block: serialize all debugfs operations using q->debugfs_mutex block: disable the elevator int del_gendisk commit 598f2404879336277a4320ac5000394b873e049a Merge: 9d882352bac8f 386e4fb6962b9 Author: Linus Torvalds Date: Fri Jun 24 11:02:26 2022 -0700 Merge tag 'io_uring-5.19-2022-06-24' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "A few fixes that should go into the 5.19 release. All are fixing issues that either happened in this release, or going to stable. In detail: - A small series of fixlets for the poll handling, all destined for stable (Pavel) - Fix a merge error from myself that caused a potential -EINVAL for the recv/recvmsg flag setting (me) - Fix a kbuf recycling issue for partial IO (me) - Use the original request for the inflight tracking (me) - Fix an issue introduced this merge window with trace points using a custom decoder function, which won't work for perf (Dylan)" * tag 'io_uring-5.19-2022-06-24' of git://git.kernel.dk/linux-block: io_uring: use original request task for inflight tracking io_uring: move io_uring_get_opcode out of TP_printk io_uring: fix double poll leak on repolling io_uring: fix wrong arm_poll error handling io_uring: fail links when poll fails io_uring: fix req->apoll_events io_uring: fix merge error in checking send/recv addr2 flags io_uring: mark reissue requests with REQ_F_PARTIAL_IO commit 9d882352bac8f2ff3753d691e2dc65fcaf738729 Merge: 92f20ff72066d 51889d225ce2c Author: Linus Torvalds Date: Fri Jun 24 10:54:07 2022 -0700 Merge tag 'printk-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk kernel thread revert from Petr Mladek: "Revert printk console kthreads. The testing of 5.19 release candidates revealed issues that did not happen when all consoles were serialized using the console semaphore. More time is needed to check expectations of the existing console drivers and be confident that they can be safely used in parallel" * tag 'printk-for-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: Revert "printk: add functions to prefer direct printing" Revert "printk: add kthread console printers" Revert "printk: extend console_lock for per-console locking" Revert "printk: remove @console_locked" Revert "printk: Block console kthreads when direct printing will be required" Revert "printk: Wait for the global console lock when the system is going down" commit de9b3d9616078f1d1d0d51b01cdafa101733f935 Author: Vladimir Zapolskiy Date: Fri Mar 11 00:19:34 2022 +0200 arm64: dts: qcom: sm8450: fix interconnects property of UFS node All interconnect device tree nodes on sm8450 are 2-cells, however in UFS node they are handled as 1-cells, fix it. Fixes: aa2d0bf04a3c ("arm64: dts: qcom: sm8450: add interconnect nodes") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Dmitry Baryshkov Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220310221934.1560729-1-vladimir.zapolskiy@linaro.org commit 7f058112873e86ca760f2d2b0e1ccc2ab111f418 Author: Jae Hyun Yoo Date: Fri Jun 24 16:35:11 2022 +0930 ARM: dts: aspeed: nuvia: rename vendor nuvia to qcom Nuvia has been acquired by Qualcomm and the vendor name 'nuvia' will not be used anymore so rename aspeed-bmc-nuvia-dc-scm.dts to aspeed-bmc-qcom-dc-scm-v1.dts and change 'nuvia' to 'qcom' as its vendor name in the file. Fixes: 7b46aa7c008d ("ARM: dts: aspeed: Add Nuvia DC-SCM BMC") Signed-off-by: Jae Hyun Yoo Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20220523175640.60155-1-quic_jaehyoo@quicinc.com Link: https://lore.kernel.org/r/20220624070511.4070659-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit 980555e95f7cabdc9c80a07107622b097ba23703 Author: Charles Keepax Date: Thu Jun 23 11:51:19 2022 +0100 ASoC: madera: Fix event generation for rate controls madera_adsp_rate_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit e3cabbef3db8269207a6b8808f510137669f8deb Author: Charles Keepax Date: Thu Jun 23 11:51:18 2022 +0100 ASoC: madera: Fix event generation for OUT1 demux madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 7f103af4a10f375b9b346b4d0b730f6a66b8c451 Author: Charles Keepax Date: Thu Jun 23 11:51:17 2022 +0100 ASoC: cs47l15: Fix event generation for low power mux control cs47l15_in1_adc_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 46b0d050c8c7df6dfb2c376aaa149bf2cfc5ca3e Author: Charles Keepax Date: Thu Jun 23 11:51:16 2022 +0100 ASoC: cs35l41: Add ASP TX3/4 source to register patch The mixer controls for ASP TX3/4 are set to values that are not included in their enumeration control. This will cause spurious event notifications when the controls are first changed, as the register value changes whilst the actual visible enumeration value does not. Use the register patch to set them to a known value, zero, which equates to zero fill, thereby avoiding the spurious notifications. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 11d7a12f7f50baa5af9090b131c9b03af59503e7 Author: Charles Keepax Date: Thu Jun 23 11:51:15 2022 +0100 ASoC: dapm: Initialise kcontrol data for mux/demux controls DAPM keeps a copy of the current value of mux/demux controls, however this value is only initialised in the case of autodisable controls. This leads to false notification events when first modifying a DAPM kcontrol that has a non-zero default. Autodisable controls are left as they are, since they already initialise the value, and there would be more work required to support autodisable muxes where the first option isn't disabled and/or that isn't the default. Technically this issue could affect mixer/switch elements as well, although not on any of the devices I am currently running. There is also a little more work to do to address the issue there due to that side supporting stereo controls, so that has not been tackled in this patch. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1df793d479bef546569fc2e409ff8bb3f0fb8e99 Author: Shuming Fan Date: Tue Jun 21 17:07:19 2022 +0800 ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error The initial settings will be written before the codec probe function. But, the rt711->component doesn't be assigned yet. If IO error happened during initial settings operations, it will cause the kernel panic. This patch changed component->dev to slave->dev to fix this issue. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20220621090719.30558-1-shumingf@realtek.com Signed-off-by: Mark Brown commit c6a5f22f9b4fd5f21414be690ce34046d9712f05 Author: Charles Keepax Date: Tue Jun 21 11:20:40 2022 +0100 ASoC: cs35l41: Correct some control names Various boolean controls on cs35l41 are missing the required "Switch" in the name, add these. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220621102041.1713504-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 Author: Charles Keepax Date: Tue Jun 21 11:20:39 2022 +0100 ASoC: wm5110: Fix DRE control The DRE controls on wm5110 should return a value of 1 if the DRE state is actually changed, update to fix this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220621102041.1713504-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 9896c029f0df628c6cb108253d09b1d61f1d4a88 Author: Charles Keepax Date: Tue Jun 21 11:20:38 2022 +0100 ASoC: wm_adsp: Fix event for preloader The preloader controls on ADSP should return a value of 1 if the preloader value was changed, update to correct this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220621102041.1713504-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f2c2f31f00ce48d96dec28b9f8d70f73213ed4af Author: Srinivas Kandagatla Date: Fri Jun 17 14:02:30 2022 -0700 MAINTAINERS: update ASoC Qualcomm maintainer email-id Update Banajit's email address from codeaurora.org to quicinc.com, as codeaurora.org is not in use anymore. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220617210230.7685-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit a5450aba737dae3ee1a64b282e609d8375d6700c Author: Judy Hsiao Date: Wed Jun 15 04:56:43 2022 +0000 ASoC: rockchip: i2s: switch BCLK to GPIO We discoverd that the state of BCLK on, LRCLK off and SD_MODE on may cause the speaker melting issue. Removing LRCLK while BCLK is present can cause unexpected output behavior including a large DC output voltage as described in the Max98357a datasheet. In order to: 1. prevent BCLK from turning on by other component. 2. keep BCLK and LRCLK being present at the same time This patch switches BCLK to GPIO func before LRCLK output, and configures BCLK func back during LRCLK is output. Without this fix, BCLK is turned on 11 ms earlier than LRCK by the da7219. With this fix, BCLK is turned on only 0.4 ms earlier than LRCK by the rockchip codec. Signed-off-by: Judy Hsiao Link: https://lore.kernel.org/r/20220615045643.3137287-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 391153522d186f19a008d824bb3a05950351ce6c Author: Pierre-Louis Bossart Date: Thu Jun 16 15:18:18 2022 -0500 ASoC: SOF: Intel: disable IMR boot when resuming from ACPI S4 and S5 states The IMR was assumed to be preserved when suspending to S4 and S5 states, but community reports invalidate that assumption, the hardware seems to be powered off and the IMR memory content cleared. Make sure regular boot with firmware download is used for S4 and S5. BugLink: https://github.com/thesofproject/sof/issues/5892 Fixes: 5fb5f51185126 ("ASoC: SOF: Intel: hda-loader: add IMR restore support") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220616201818.130802-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9d2d462713384538477703e68577b05131c7d97d Author: Pierre-Louis Bossart Date: Thu Jun 16 15:18:17 2022 -0500 ASoC: SOF: pm: add definitions for S4 and S5 states We currently don't have a means to differentiate between S3, S4 and S5. Add definitions so that we have select different code paths depending on the target state in follow-up patches. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220616201818.130802-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a933084558c61cac8c902d2474b39444d87fba46 Author: Pierre-Louis Bossart Date: Thu Jun 16 15:18:16 2022 -0500 ASoC: SOF: pm: add explicit behavior for ACPI S1 and S2 The existing code only deals with S0 and S3, let's start adding S1 and S2. No functional change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220616201818.130802-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ca7ab1dcf58dfce5bc851bf7e50fd94822c24665 Author: Peter Ujfalusi Date: Thu Jun 16 15:19:53 2022 -0500 ASoC: SOF: Intel: hda: Fix compressed stream position tracking Commit 288fad2f71fa ("ASoC: SOF: Intel: hda: add quirks for HDAudio DMA position information") modified the PCM path only, but left the compressed data patch using an obsolete option. Move the functionality in a helper that can be called for both PCM and compressed data. Reviewed-by: Ranjani Sridharan Fixes: 288fad2f71fa ("ASoC: SOF: Intel: hda: add quirks for HDAudio DMA position information") Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220616201953.130876-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 427eb3e1ed530792231bc5bbee6dec99fc57aeb7 Author: Dan Carpenter Date: Wed Jun 15 11:19:44 2022 +0300 ASoC: SOF: mediatek: Fix error code in probe This should return PTR_ERR() instead of IS_ERR(). Fixes: e0100bfd383c ("ASoC: SOF: mediatek: Add mt8186 ipc support") Signed-off-by: Dan Carpenter Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/YqmWIK8sTj578OJP@kili Signed-off-by: Mark Brown commit 4e07479eab8a044cc9542414ccb4aeb8eb033bde Author: Hans de Goede Date: Sun Jun 12 17:56:52 2022 +0200 ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem The "wlf,spkvdd-ena" GPIO needed by the bytcr_wm5102 driver is made available through a gpio-lookup table. This gpio-lookup table is registered by drivers/mfd/arizona-spi.c, which may get probed after the bytcr_wm5102 driver. If the gpio-lookup table has not registered yet then the gpiod_get() will return -ENOENT. Treat -ENOENT as -EPROBE_DEFER to still keep things working in this case. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220612155652.107310-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit a7d9391dc3d570aed87ed764db95b16760c898e4 Author: Pierre-Louis Bossart Date: Fri Jun 10 16:43:13 2022 -0500 MAINTAINERS: update ASoC/Intel/SOF maintainers Keyon Jie was a key contributor to the Intel ASoC and SOF Intel drivers, but he's moved on to a different role within Intel. We wish him all the best in his new endeavors. Bard Liao, Kai Vehmanen, Ranjani Sridharan and Peter Ujfalusi have been involved in the Intel multi-maintainer team, it's time to update the MAINTAINERS entry to reflect their contributions and clarify their role. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220610214313.42903-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 10e7ff0047921e32b919ecee7be706dd33c107f8 Author: Mark Brown Date: Fri Jun 3 14:25:26 2022 +0200 ASoC: wcd938x: Fix event generation for some controls Currently wcd938x_*_put() unconditionally report that the value of the control changed, resulting in spurious events being generated. Return 0 in that case instead as we should. There is still an issue in the compander control which is a bit more complex. Signed-off-by: Mark Brown Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220603122526.3914942-1-broonie@kernel.org Signed-off-by: Mark Brown commit a7786cbae4b2732815da98efa39df96746b5bd0d Author: Mark Brown Date: Fri Jun 3 14:46:09 2022 +0200 ASoC: wcd9335: Fix spurious event generation The slimbus mux put operation unconditionally reports a change in value which means that spurious events are generated. Fix this by exiting early in that case. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220603124609.4024666-1-broonie@kernel.org Signed-off-by: Mark Brown commit be6dd72edb216f20fc80e426ece9fe9b8aabf033 Author: Yassine Oudjana Date: Mon Jun 6 19:22:26 2022 +0400 ASoC: wcd9335: Remove RX channel from old list before adding it to a new one Currently in slim_rx_mux_put, an RX channel gets added to a new list even if it is already in one. This can mess up links and make either it, the new list head, or both, get linked to the wrong entries. This can cause an entry to link to itself which in turn ends up making list_for_each_entry in other functions loop infinitely. To avoid issues, always remove the RX channel from any list it's in before adding it to a new list. Signed-off-by: Yassine Oudjana Link: https://lore.kernel.org/r/20220606152226.149164-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown commit 58136d93d4e2c1207a5e4f3044815cd40b1d95fd Author: Srinivas Kandagatla Date: Fri Jun 10 15:48:18 2022 +0100 ASoC: qdsp6: q6apm-dai: unprepare stream if its already prepared prepare callback can be called multiple times, so unprepare the stream if its already prepared. Without this DSP is not happy to setting the params on a already prepared graph. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Reported-by: Srinivasa Rao Mandadapu Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220610144818.511797-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 12abc4d10d5502e4f3d8f1c6f9e8245747a44708 Author: Amadeusz Sławiński Date: Fri Jun 10 14:44:20 2022 +0200 ASoC: Remove unused hw_write_t type Commit 81da8a0b7975 ("ASoC: remove codec hw_write/control_data") removed use of hw_write_t in struct snd_soc_codec, but it left type definition. Fully clean it up. Fixes: 81da8a0b7975 ("ASoC: remove codec hw_write/control_data") Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220610124420.4160986-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit af2d146a8041c67efdd620c9463973ce0650b7b7 Author: Amadeusz Sławiński Date: Fri Jun 10 14:42:57 2022 +0200 ASoC: Intel: avs: Fix parsing UUIDs in topology Use correct type for parsing UUIDs, this eliminates warning present, when compiling with W=1. Fixes: 34ae2cd53673 ("ASoC: Intel: avs: Add topology parsing infrastructure") Reported-by: Pierre-Louis Bossart Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220610124257.4160658-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit c2d1aec3f5da2475aa13a487d329823b7d27d499 Author: Peter Ujfalusi Date: Fri Jun 10 11:47:35 2022 +0300 ASoC: SOF: ipc3-topology: Move and correct size checks in sof_ipc3_control_load_bytes() Move the size checks prior to allocating memory as these checks do not need the data to be allocated and in case of an error we would not need to free the allocation. The max size must not be less than the size of struct sof_ipc_ctrl_data + struct sof_abi_hdr as the ABI header needs to be present under all circumstances. The check was incorrectly used or between the two size checks. Fixes: b5cee8feb1d4 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220610084735.19397-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit bbfef046c6613404c01aeb9e9928bebb78dd327a Author: Peter Ujfalusi Date: Thu Jun 9 11:59:49 2022 +0300 ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow Update the comment for the cl_dsp_init() to clarify what is done by the function and use the chip->init_core_mask instead of BIT(0) when unstalling/running the init core. Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220609085949.29062-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c31691e0d126ec5d60d2b6b03f699c11b613b219 Author: Peter Ujfalusi Date: Thu Jun 9 11:59:48 2022 +0300 ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed The hda_dsp_enable_core() is powering up _and_ unstall the core in one call while the first step of the firmware loading must not unstall the core. The core can be unstalled only after the set cpb_cfp and the configuration of the IPC register for the ROM_CONTROL message. Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220609085949.29062-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 08f8a93198e300dff9649bbae424cd805d313326 Author: Peter Ujfalusi Date: Thu Jun 9 11:59:47 2022 +0300 ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up() The hda_dsp_core_power_up() needs to be exposed so that it can be used in hda-loader.c to correct the boot flow. The first step must not unstall the core, it should only power up the core(s). Add sanity check for the core_mask while exposing it to be safe. Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220609085949.29062-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ed0073bd0fccec459b526918be70bf9dc551581a Author: Kuninori Morimoto Date: Wed Jun 8 02:09:16 2022 +0000 ASoC: ak4613: cares Simple-Audio-Card case for TDM Renesas is the only user of ak4613 on upstream for now, and commit f28dbaa958fbd8 ("ASoC: ak4613: add TDM256 support") added TDM256 support. Renesas tested part of it, because of board connection. It was assuming ak4613 is probed via Audio-Graph-Card, but it might be probed via Simple-Audio-Card either. It will indicates WARNING in such case. This patch fixup it. Reported-by: Geert Uytterhoeven Signed-off-by: Kuninori Morimoto Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87h74v29f7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 40737057b48f1b4db67b0d766b95c87ba8fc5e03 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:52 2022 -0500 ASoC: codecs: rt700/rt711/rt711-sdca: resume bus/codec in .set_jack_detect The .set_jack_detect() codec component callback is invoked during card registration, which happens when the machine driver is probed. The issue is that this callback can race with the bus suspend/resume, and IO timeouts can happen. This can be reproduced very easily if the machine driver is 'blacklisted' and manually probed after the bus suspends. The bus and codec need to be re-initialized using pm_runtime helpers. Previous contributions tried to make sure accesses to the bus during the .set_jack_detect() component callback only happen when the bus is active. This was done by changing the regcache status on a component remove. This is however a layering violation, the regcache status should only be modified on device probe, suspend and resume. The component probe/remove should not modify how the device regcache is handled. This solution also didn't handle all the possible race conditions, and the RT700 headset codec was not handled. This patch tries to resume the codec device before handling the jack initializations. In case the codec has not yet been initialized, pm_runtime may not be enabled yet, so we don't squelch the -EACCES error code and only stop the jack information. When the codec reports as attached, the jack initialization will proceed as usual. BugLink: https://github.com/thesofproject/linux/issues/3643 Fixes: 7ad4d237e7c4a ('ASoC: rt711-sdca: Add RT711 SDCA vendor-specific driver') Fixes: 899b12542b089 ('ASoC: rt711: add snd_soc_component remove callback') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ba98d7d8b60ba410aa03834f6aa48fd3b2e68478 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:51 2022 -0500 ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe The workqueues are initialized in the io_init functions, which isn't quite right. In some tests, this leads to warnings throw from __queue_delayed_work() WARN_ON_FUNCTION_MISMATCH(timer->function, delayed_work_timer_fn); Move all the initializations to the probe functions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0484271ab0ce50649329fa9dc23c50853c5b26a4 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:50 2022 -0500 ASoC: rt7*-sdw: harden jack_detect_handler Realtek headset codec drivers typically check if the card is instantiated before proceeding with the jack detection. The rt700, rt711 and rt711-sdca are however missing a check on the card pointer, which can lead to NULL dereferences encountered in driver bind/unbind tests. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 08bb5dc6ce02374169213cea772b1c297eaf32d5 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:49 2022 -0500 ASoC: rt711: fix calibrate mutex initialization Follow the same flow as rt711-sdca and initialize all mutexes at probe time. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fe154c4ff376bc31041c6441958a08243df09c99 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:48 2022 -0500 ASoC: Intel: sof_sdw: handle errors on card registration If the card registration fails, typically because of deferred probes, the device properties added for headset codecs are not removed, which leads to kernel oopses in driver bind/unbind tests. We already clean-up the device properties when the card is removed, this code can be moved as a helper and called upon card registration errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ed0a7fb29c9fd4f53eeb37d1fe2354df7a038047 Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:47 2022 -0500 ASoC: rt711-sdca-sdw: fix calibrate mutex initialization In codec driver bind/unbind test, the following warning is thrown: DEBUG_LOCKS_WARN_ON(lock->magic != lock) ... [ 699.182495] rt711_sdca_jack_init+0x1b/0x1d0 [snd_soc_rt711_sdca] [ 699.182498] rt711_sdca_set_jack_detect+0x3b/0x90 [snd_soc_rt711_sdca] [ 699.182500] snd_soc_component_set_jack+0x24/0x50 [snd_soc_core] A quick check in the code shows that the 'calibrate_mutex' used by this driver are not initialized at probe time. Moving the initialization to the probe removes the issue. BugLink: https://github.com/thesofproject/linux/issues/3644 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ac63716da3070f8cb6baaba3a058a0c7f22aeb5b Author: Pierre-Louis Bossart Date: Mon Jun 6 15:37:46 2022 -0500 ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove When binding/unbinding codec drivers, the following warnings are thrown: [ 107.266879] rt715-sdca sdw:3:025d:0714:01: Unbalanced pm_runtime_enable! [ 306.879700] rt711-sdca sdw:0:025d:0711:01: Unbalanced pm_runtime_enable! Add a remove callback for all Realtek/Maxim SoundWire codecs and remove this warning. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 60192dd85c3ca24fe0a66be939bba68c13f440aa Merge: 416e95a4798e0 1332661e09304 Author: Arnd Bergmann Date: Fri Jun 24 17:21:23 2022 +0200 Merge tag 'memory-controller-drv-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/fixes Memory controller drivers - fixes for v5.19 Broken in current cycle: 1. OMAP GPMC: fix Kconfig dependency for OMAP_GPMC, so it will not be visible for everyone (driver is specific to OMAP). Broken before: 1. Mediatek SMI: fix missing put_device() in error paths. 2. Exynos DMC: fix OF node leaks in error paths. * tag 'memory-controller-drv-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: samsung: exynos5422-dmc: Fix refcount leak in of_get_dram_timings memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common memory: omap-gpmc: OMAP_GPMC should depend on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 Link: https://lore.kernel.org/r/20220624081819.33617-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 416e95a4798e0504492f2645265f61e5dd0c0bcd Merge: b262b3b571bc5 c4c79525042a4 Author: Arnd Bergmann Date: Fri Jun 24 17:20:23 2022 +0200 Merge tag 'samsung-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/fixes Samsung fixes for v5.19 Both fixes are for issues present before v5.19 merge window: 1. Correct UART clocks on Exynos7885. Although the initial, fixed DTS commit is from v5.18, the issue will be exposed with a upcoming fix to Exynos7885 clock driver, so we need to correct the DTS earlier. 2. Fix theoretical OF node leak in Exynos machine code. * tag 'samsung-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: exynos: Fix refcount leak in exynos_map_pmu arm64: dts: exynos: Correct UART clocks on Exynos7885 Link: https://lore.kernel.org/r/20220624080423.31427-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit b262b3b571bc58775e7a115d94b0fcd1b1636c34 Merge: db6b92459f598 b9b6d4c925604 Author: Arnd Bergmann Date: Fri Jun 24 17:19:49 2022 +0200 Merge tag 'arm-soc/for-5.19/devicetree-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-SoC Device Tree fixes for 5.19, please pull the following: - Stefan fixes the Raspberry Pi 400 GPIO expander line names to match that of the downstream Raspberry Pi Linux tree * tag 'arm-soc/for-5.19/devicetree-fixes' of https://github.com/Broadcom/stblinux: ARM: dts: bcm2711-rpi-400: Fix GPIO line names Link: https://lore.kernel.org/r/20220620170745.2485199-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit db6b92459f598d0a02b3a33aab9d995f0378e476 Merge: 2c629dd2d14fd 0c0af88f3f318 Author: Arnd Bergmann Date: Fri Jun 24 17:19:21 2022 +0200 Merge tag 'ti-k3-dt-fixes-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/fixes Devicetree fixes for TI K3 platforms for v5.19 Critical fixes for the following: * Boot failure on J721s2 (overlap GIC memory map) * AM64 boot fails on highspeed cards (SoC characterization updates) * tag 'ti-k3-dt-fixes-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: dts: ti: k3-am64-main: Remove support for HS400 speed mode arm64: dts: ti: k3-j721s2: Fix overlapping GICD memory region Link: https://lore.kernel.org/r/20220618031627.xxvscc22c6doaa3t@kahuna Signed-off-by: Arnd Bergmann commit 2c629dd2d14fd7f64a553f809eda6d0b3a4f615a Author: Liang He Date: Thu Jun 16 17:30:27 2022 +0800 arm: mach-spear: Add missing of_node_put() in time.c In spear_setup_of_timer(), of_find_matching_node() will return a node pointer with refcount incrementd. We should use of_node_put() in each fail path or when it is not used anymore. Signed-off-by: Liang He Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220616093027.3984903-1-windhl@126.com' Signed-off-by: Arnd Bergmann commit 1ba904b6b16e08de5aed7c1349838d9cd0d178c5 Author: Miaoqian Lin Date: Sun Jun 5 11:58:41 2022 +0400 ARM: cns3xxx: Fix refcount leak in cns3xxx_init of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support") Signed-off-by: Miaoqian Lin Acked-by: Krzysztof Halasa Signed-off-by: Arnd Bergmann commit 17b1362d49191625440ca2c195959ce0b37ec296 Author: Thara Gopinath Date: Fri Jan 7 09:51:54 2022 -0500 MAINTAINERS: Update email address Update my email address in the MAINTAINERS file as the current one will stop functioning in a while. Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson Signed-off-by: Arnd Bergmann commit 8da33fd11c05b7c64ef6456970f2fce61851806e Author: Shyam Prasad N Date: Fri Jun 24 09:43:59 2022 +0000 cifs: avoid deadlocks while updating iface We use cifs_tcp_ses_lock to protect a lot of things. Not only does it protect the lists of connections, sessions, tree connects, open file lists, etc., we also use it to protect some fields in each of it's entries. In this case, cifs_mark_ses_for_reconnect takes the cifs_tcp_ses_lock to traverse the lists, and then calls cifs_update_iface. However, that can end up calling cifs_put_tcp_session, which picks up the same lock again. Avoid this by taking a ref for the session, drop the lock, and then call update iface. Also, in cifs_update_iface, avoid nested locking of iface_lock and chan_lock, as much as possible. When unavoidable, we need to pick iface_lock first. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit c242507c1b895646b4a25060df13b6214805759f Author: Joerg Roedel Date: Fri Jun 24 14:51:39 2022 +0200 MAINTAINERS: Add new IOMMU development mailing list The IOMMU mailing list will move from lists.linux-foundation.org to lists.linux.dev. The hard switch of the archive will happen on July 5th, but add the new list now already so that people start using the list when sending patches. After July 5th the old list will disappear. Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220624125139.412-1-joro@8bytes.org Signed-off-by: Joerg Roedel commit b24346a240b36cfc4df194d145463874985aa29b Author: Xu Yang Date: Thu Jun 23 11:02:42 2022 +0800 usb: chipidea: udc: check request status before setting device address The complete() function may be called even though request is not completed. In this case, it's necessary to check request status so as not to set device address wrongly. Fixes: 10775eb17bee ("usb: chipidea: udc: update gadget states according to ch9") cc: Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20220623030242.41796-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit 90bc2af24638659da56397ff835f3c95a948f991 Author: Alan Stern Date: Wed Jun 22 10:46:31 2022 -0400 USB: gadget: Fix double-free bug in raw_gadget driver Re-reading a recently merged fix to the raw_gadget driver showed that it inadvertently introduced a double-free bug in a failure pathway. If raw_ioctl_init() encounters an error after the driver ID number has been allocated, it deallocates the ID number before returning. But when dev_free() runs later on, it will then try to deallocate the ID number a second time. Closely related to this issue is another error in the recent fix: The ID number is stored in the raw_dev structure before the code checks to see whether the structure has already been initialized, in which case the new ID number would overwrite the earlier value. The solution to both bugs is to keep the new ID number in a local variable, and store it in the raw_dev structure only after the check for prior initialization. No errors can occur after that point, so the double-free will never happen. Fixes: f2d8c2606825 ("usb: gadget: Fix non-unique driver names in raw-gadget driver") CC: Andrey Konovalov CC: Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YrMrRw5AyIZghN0v@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit ae8b1631561a3634cc09d0c62bbdd938eade05ec Author: Takashi Iwai Date: Fri Jun 24 12:11:32 2022 +0200 ALSA: usb-audio: Workarounds for Behringer UMC 204/404 HD Both Behringer UMC 202 HD and 404 HD need explicit quirks to enable the implicit feedback mode and start the playback stream primarily. The former seems fixing the stuttering and the latter is required for a playback-only case. Note that the "clock source 41 is not valid" error message still appears even after this fix, but it should be only once at probe. The reason of the error is still unknown, but this seems to be mostly harmless as it's a one-off error and the driver retires the clock setup and it succeeds afterwards. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215934 Cc: Link: https://lore.kernel.org/r/20220624101132.14528-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 87d044096ea62f1f230e8c4679ee8abf03266f64 Author: Tom Lendacky Date: Mon Jun 13 14:16:27 2022 -0500 crypto: ccp - Fix device IRQ counting by using platform_irq_count() The ccp driver loops through the platform device resources array to get the IRQ count for the device. With commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"), the IRQ resources are no longer stored in the platform device resource array. As a result, the IRQ count is now always zero. This causes the driver to issue a second call to platform_get_irq(), which fails if the IRQ count is really 1, causing the loading of the driver to fail. Replace looping through the resources array to count the number of IRQs with a call to platform_irq_count(). Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") Signed-off-by: Tom Lendacky Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 6defa24d3b12bbd418bc8526dea1cbc605265c06 Author: Peter Gonda Date: Thu Jun 23 10:34:06 2022 -0700 KVM: SEV: Init target VMCBs in sev_migrate_from The target VMCBs during an intra-host migration need to correctly setup for running SEV and SEV-ES guests. Add sev_init_vmcb() function and make sev_es_init_vmcb() static. sev_init_vmcb() uses the now private function to init SEV-ES guests VMCBs when needed. Fixes: 0b020f5af092 ("KVM: SEV: Add support for SEV-ES intra host migration") Fixes: b56639318bb2 ("KVM: SEV: Add support for SEV intra host migration") Signed-off-by: Peter Gonda Cc: Marc Orr Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Tom Lendacky Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: <20220623173406.744645-1-pgonda@google.com> Signed-off-by: Paolo Bonzini commit ebdec859faa8cfbfef9f6c1f83d79dd6c8f4ab8c Author: Mingwei Zhang Date: Thu Jun 23 17:18:58 2022 +0000 KVM: x86/svm: add __GFP_ACCOUNT to __sev_dbg_{en,de}crypt_user() Adding the accounting flag when allocating pages within the SEV function, since these memory pages should belong to individual VM. No functional change intended. Signed-off-by: Mingwei Zhang Message-Id: <20220623171858.2083637-1-mizhang@google.com> Signed-off-by: Paolo Bonzini commit c346dae4f3fbce51bbd4f2ec5e8c6f9b91e93163 Author: Jason Wang Date: Wed Jun 22 09:29:40 2022 +0800 virtio: disable notification hardening by default We try to harden virtio device notifications in 8b4ec69d7e09 ("virtio: harden vring IRQ"). It works with the assumption that the driver or core can properly call virtio_device_ready() at the right place. Unfortunately, this seems to be not true and uncover various bugs of the existing drivers, mainly the issue of using virtio_device_ready() incorrectly. So let's add a Kconfig option and disable it by default. It gives us time to fix the drivers and then we can consider re-enabling it. Signed-off-by: Jason Wang Message-Id: <20220622012940.21441-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck commit 03d9571706942fa653a4975709820596d13563c7 Author: Bo Liu Date: Fri Jun 17 01:59:52 2022 -0400 virtio: Remove unnecessary variable assignments In function vp_modern_probe(), "pci_dev" is initialized with the value of "mdev->pci_dev", so assigning "pci_dev" to "mdev->pci_dev" is unnecessary since they store the same value. Signed-off-by: Bo Liu Message-Id: <20220617055952.5364-1-liubo03@inspur.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit a7722890fdfb2aaeb6b02d68bb0f1e411e58d539 Author: huangjie.albert Date: Fri Jun 17 10:04:11 2022 +0800 virtio_ring : keep used_wrap_counter in vq->last_used_idx the used_wrap_counter and the vq->last_used_idx may get out of sync if they are separate assignment,and interrupt might use an incorrect value to check for the used index. for example:OOB access ksoftirqd may consume the packet and it will call: virtnet_poll -->virtnet_receive -->virtqueue_get_buf_ctx -->virtqueue_get_buf_ctx_packed and in virtqueue_get_buf_ctx_packed: vq->last_used_idx += vq->packed.desc_state[id].num; if (unlikely(vq->last_used_idx >= vq->packed.vring.num)) { vq->last_used_idx -= vq->packed.vring.num; vq->packed.used_wrap_counter ^= 1; } if at the same time, there comes a vring interrupt,in vring_interrupt: we will call: vring_interrupt -->more_used -->more_used_packed -->is_used_desc_packed in is_used_desc_packed, the last_used_idx maybe >= vq->packed.vring.num. so this could case a memory out of bounds bug. this patch is to keep the used_wrap_counter in vq->last_used_idx so we can get the correct value to check for used index in interrupt. v3->v4: - use READ_ONCE/WRITE_ONCE to get/set vq->last_used_idx v2->v3: - add inline function to get used_wrap_counter and last_used - when use vq->last_used_idx, only read once if vq->last_used_idx is read twice, the values can be inconsistent. - use last_used_idx & ~(-(1 << VRING_PACKED_EVENT_F_WRAP_CTR)) to get the all bits below VRING_PACKED_EVENT_F_WRAP_CTR v1->v2: - reuse the VRING_PACKED_EVENT_F_WRAP_CTR - Remove parameter judgment in is_used_desc_packed, because it can't be illegal Signed-off-by: huangjie.albert Message-Id: <20220617020411.80367-1-huangjie.albert@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 0e0348ac3f0a6e6606f1aa5acb1803ada913aa3d Author: Parav Pandit Date: Mon Jun 13 22:52:23 2022 +0300 vduse: Tie vduse mgmtdev and its device vduse devices are not backed by any real devices such as PCI. Hence it doesn't have any parent device linked to it. Kernel driver model in [1] suggests to avoid an empty device release callback. Hence tie the mgmtdevice object's life cycle to an allocate dummy struct device instead of static one. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/core-api/kobject.rst?h=v5.18-rc7#n284 Signed-off-by: Parav Pandit Message-Id: <20220613195223.473966-1-parav@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xie Yongji Acked-by: Jason Wang commit ace9252446ec615cd79a5f77d90edb25c0b9d024 Author: Eli Cohen Date: Mon Jun 13 10:59:58 2022 +0300 vdpa/mlx5: Initialize CVQ vringh only once Currently, CVQ vringh is initialized inside setup_virtqueues() which is called every time a memory update is done. This is undesirable since it resets all the context of the vring, including the available and used indices. Move the initialization to mlx5_vdpa_set_status() when VIRTIO_CONFIG_S_DRIVER_OK is set. Signed-off-by: Eli Cohen Message-Id: <20220613075958.511064-2-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Acked-by: Eugenio Pérez commit 40f2f3e94178d45e4ee6078effba2dfc76f6f5ba Author: Eli Cohen Date: Mon Jun 13 10:59:57 2022 +0300 vdpa/mlx5: Update Control VQ callback information The control VQ specific information is stored in the dedicated struct mlx5_control_vq. When the callback is updated through mlx5_vdpa_set_vq_cb(), make sure to update the control VQ struct. Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Eli Cohen Message-Id: <20220613075958.511064-1-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Date: Sun Jun 19 22:37:17 2022 +0900 ksmbd: check invalid FileOffset and BeyondFinalZero in FSCTL_ZERO_DATA FileOffset should not be greater than BeyondFinalZero in FSCTL_ZERO_DATA. And don't call ksmbd_vfs_zero_data() if length is zero. Cc: stable@vger.kernel.org Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 18e39fb960e6a908ac5230b57e3d0d6c25232368 Author: Namjae Jeon Date: Sun Jun 19 22:35:48 2022 +0900 ksmbd: set the range of bytes to zero without extending file size in FSCTL_ZERO_DATA generic/091, 263 test failed since commit f66f8b94e7f2 ("cifs: when extending a file with falloc we should make files not-sparse"). FSCTL_ZERO_DATA sets the range of bytes to zero without extending file size. The VFS_FALLOCATE_FL_KEEP_SIZE flag should be used even on non-sparse files. Cc: stable@vger.kernel.org Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 745bbc0995c25917dfafb645b8efb29813ef9e0b Author: Hyunchul Lee Date: Tue Jun 14 08:25:50 2022 +0900 ksmbd: remove duplicate flag set in smb2_write The writethrough flag is set again if is_rdma_channel is false. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit b968080808f7f28b89aa495b7402ba48eb17ee93 Author: Dimitris Michailidis Date: Wed Jun 22 17:02:34 2022 -0700 selftests/net: pass ipv6_args to udpgso_bench's IPv6 TCP test udpgso_bench.sh has been running its IPv6 TCP test with IPv4 arguments since its initial conmit. Looks like a typo. Fixes: 3a687bef148d ("selftests: udp gso benchmark") Cc: willemb@google.com Signed-off-by: Dimitris Michailidis Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20220623000234.61774-1-dmichail@fungible.com Signed-off-by: Jakub Kicinski commit 1228b34c8d0ecf6de18c4c95d22f60cc8607c50a Author: Eric Dumazet Date: Wed Jun 22 15:02:20 2022 +0000 net: clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user() syzbot reported uninit-value in tcp_recvmsg() [1] Issue here is that msg->msg_get_inq should have been cleared, otherwise tcp_recvmsg() might read garbage and perform more work than needed, or have undefined behavior. Given CONFIG_INIT_STACK_ALL_ZERO=y is probably going to be the default soon, I chose to change __sys_recvfrom() to clear all fields but msghdr.addr which might be not NULL. For __copy_msghdr_from_user(), I added an explicit clear of kmsg->msg_get_inq. [1] BUG: KMSAN: uninit-value in tcp_recvmsg+0x6cf/0xb60 net/ipv4/tcp.c:2557 tcp_recvmsg+0x6cf/0xb60 net/ipv4/tcp.c:2557 inet_recvmsg+0x13a/0x5a0 net/ipv4/af_inet.c:850 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] __sys_recvfrom+0x696/0x900 net/socket.c:2176 __do_sys_recvfrom net/socket.c:2194 [inline] __se_sys_recvfrom net/socket.c:2190 [inline] __x64_sys_recvfrom+0x122/0x1c0 net/socket.c:2190 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+0x46/0xb0 Local variable msg created at: __sys_recvfrom+0x81/0x900 net/socket.c:2154 __do_sys_recvfrom net/socket.c:2194 [inline] __se_sys_recvfrom net/socket.c:2190 [inline] __x64_sys_recvfrom+0x122/0x1c0 net/socket.c:2190 CPU: 0 PID: 3493 Comm: syz-executor170 Not tainted 5.19.0-rc3-syzkaller-30868-g4b28366af7d9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: f94fd25cb0aa ("tcp: pass back data left in socket after receive") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Jens Axboe Tested-by: Alexander Potapenko Link: https://lore.kernel.org/r/20220622150220.1091182-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit ad887a507d7386de09a532c5d303ed659eba2cfb Author: Krzysztof Kozlowski Date: Wed Jun 22 13:54:16 2022 +0200 net/ncsi: use proper "mellanox" DT vendor prefix "mlx" Devicetree vendor prefix is not documented and instead "mellanox" should be used. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220622115416.7400-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jakub Kicinski commit 6886da5f49e6d86aad76807a93f3eef5e4f01b10 Author: Liam Howlett Date: Fri Jun 24 01:17:58 2022 +0000 powerpc/prom_init: Fix kernel config grep When searching for config options, use the KCONFIG_CONFIG shell variable so that builds using non-standard config locations work. Fixes: 26deb04342e3 ("powerpc: prepare string/mem functions for KASAN") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Liam R. Howlett Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220624011745.4060795-1-Liam.Howlett@oracle.com commit 7c97bc0128b2eecc703106112679a69d446d1a12 Author: Doug Berger Date: Wed Jun 22 20:02:04 2022 -0700 net: dsa: bcm_sf2: force pause link settings The pause settings reported by the PHY should also be applied to the GMII port status override otherwise the switch will not generate pause frames towards the link partner despite the advertisement saying otherwise. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220623030204.1966851-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 16d584d2fc8f4ea36203af45a76becd7093586f1 Author: Liang He Date: Wed Jun 22 12:06:21 2022 +0800 net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup() of_find_node_by_name() will decrease the refcount of its first arg and we need a of_node_get() to keep refcount balance. Fixes: 7d9ee2e8ff15 ("net: dsa: hellcreek: Add PTP status LEDs") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220622040621.4094304-1-windhl@126.com Signed-off-by: Jakub Kicinski commit 986481618023e18e187646b0fff05a3c337531cb Author: Christophe Leroy Date: Thu Jun 23 10:56:17 2022 +0200 powerpc/book3e: Fix PUD allocation size in map_kernel_page() Commit 2fb4706057bc ("powerpc: add support for folded p4d page tables") erroneously changed PUD setup to a mix of PMD and PUD. Fix it. While at it, use PTE_TABLE_SIZE instead of PAGE_SIZE for PTE tables in order to avoid any confusion. Fixes: 2fb4706057bc ("powerpc: add support for folded p4d page tables") Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Christophe Leroy Acked-by: Mike Rapoport Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/95ddfd6176d53e6c85e13bd1c358359daa56775f.1655974558.git.christophe.leroy@csgroup.eu commit 19fc5bb93c6bbdce8292b4d7eed04e2fa118d2fe Author: Nathan Lynch Date: Thu Jun 23 13:25:09 2022 -0500 powerpc/xive/spapr: correct bitmap allocation size kasan detects access beyond the end of the xibm->bitmap allocation: BUG: KASAN: slab-out-of-bounds in _find_first_zero_bit+0x40/0x140 Read of size 8 at addr c00000001d1d0118 by task swapper/0/1 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc2-00001-g90df023b36dd #28 Call Trace: [c00000001d98f770] [c0000000012baab8] dump_stack_lvl+0xac/0x108 (unreliable) [c00000001d98f7b0] [c00000000068faac] print_report+0x37c/0x710 [c00000001d98f880] [c0000000006902c0] kasan_report+0x110/0x354 [c00000001d98f950] [c000000000692324] __asan_load8+0xa4/0xe0 [c00000001d98f970] [c0000000011c6ed0] _find_first_zero_bit+0x40/0x140 [c00000001d98f9b0] [c0000000000dbfbc] xive_spapr_get_ipi+0xcc/0x260 [c00000001d98fa70] [c0000000000d6d28] xive_setup_cpu_ipi+0x1e8/0x450 [c00000001d98fb30] [c000000004032a20] pSeries_smp_probe+0x5c/0x118 [c00000001d98fb60] [c000000004018b44] smp_prepare_cpus+0x944/0x9ac [c00000001d98fc90] [c000000004009f9c] kernel_init_freeable+0x2d4/0x640 [c00000001d98fd90] [c0000000000131e8] kernel_init+0x28/0x1d0 [c00000001d98fe10] [c00000000000cd54] ret_from_kernel_thread+0x5c/0x64 Allocated by task 0: kasan_save_stack+0x34/0x70 __kasan_kmalloc+0xb4/0xf0 __kmalloc+0x268/0x540 xive_spapr_init+0x4d0/0x77c pseries_init_irq+0x40/0x27c init_IRQ+0x44/0x84 start_kernel+0x2a4/0x538 start_here_common+0x1c/0x20 The buggy address belongs to the object at c00000001d1d0118 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [c00000001d1d0118, c00000001d1d0120) The buggy address belongs to the physical page: page:c00c000000074740 refcount:1 mapcount:0 mapping:0000000000000000 index:0xc00000001d1d0558 pfn:0x1d1d flags: 0x7ffff000000200(slab|node=0|zone=0|lastcpupid=0x7ffff) raw: 007ffff000000200 c00000001d0003c8 c00000001d0003c8 c00000001d010480 raw: c00000001d1d0558 0000000001e1000a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: c00000001d1d0000: fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc c00000001d1d0080: fc fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc >c00000001d1d0100: fc fc fc 02 fc fc fc fc fc fc fc fc fc fc fc fc ^ c00000001d1d0180: fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc fc c00000001d1d0200: fc fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc This happens because the allocation uses the wrong unit (bits) when it should pass (BITS_TO_LONGS(count) * sizeof(long)) or equivalent. With small numbers of bits, the allocated object can be smaller than sizeof(long), which results in invalid accesses. Use bitmap_zalloc() to allocate and initialize the irq bitmap, paired with bitmap_free() for consistency. Signed-off-by: Nathan Lynch Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220623182509.3985625-1-nathanl@linux.ibm.com commit f50974eee5c4a5de1e4f1a3d873099f170df25f8 Author: Dan Williams Date: Thu Jun 23 13:02:31 2022 -0700 memregion: Fix memregion_free() fallback definition In the CONFIG_MEMREGION=n case, memregion_free() is meant to be a static inline. 0day reports: In file included from drivers/cxl/core/port.c:4: include/linux/memregion.h:19:6: warning: no previous prototype for function 'memregion_free' [-Wmissing-prototypes] Mark memregion_free() static. Fixes: 33dd70752cd7 ("lib: Uplevel the pmem "region" ida to a global allocator") Reported-by: kernel test robot Reviewed-by: Alison Schofield Link: https://lore.kernel.org/r/165601455171.4042645.3350844271068713515.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 1e9124df8be0a43e4e9a10c5d1140d6ca8e50132 Merge: 08d27daaaa9e2 a6e2af64a79af Author: Dave Airlie Date: Fri Jun 24 10:11:26 2022 +1000 Merge tag 'drm-msm-fixes-2022-06-20' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Fixes for v5.19-rc4 - Workaround for parade DSI bridge power sequencing - Fix for multi-planar YUV format offsets - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a being hit frequently in CI. - Fix to add minimum ICC vote in the msm_mdss pm_resume path to address bootup splats - Fix to avoid dereferencing without checking in WB encoder - Fix to avoid crash during suspend in DP driver by ensuring interrupt mask bits are updated - Remove unused code from dpu_encoder_virt_atomic_check() - Fix to remove redundant init of dsc variable - Fix to ensure mmap offset is initialized to avoid memory corruption from unpin/evict - Fix double runpm disable in probe-defer path - VMA fenced-unpin fixes - Fix for WB max-width - Fix for rare dp resolution change issue Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvdsOF1-+WfTWyEyu33XPcvxOCU00G-dz7EF2J+fdyUHg@mail.gmail.com commit 08d27daaaa9e215ce9c78a35a94fc4fa7a434d3a Merge: 0a86b0db38d84 c7b28f52f406b Author: Dave Airlie Date: Fri Jun 24 09:58:06 2022 +1000 Merge tag 'drm-intel-fixes-2022-06-22' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.19-rc4: - Revert low voltage SKU check removal to fix display issues - Apply PLL DCO fraction workaround for ADL-S - Don't show engine classes not present in client fdinfo Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87a6a4syrr.fsf@intel.com commit 0a86b0db38d848e5e3928707cca55ed664a53eb4 Merge: 382cf35f2508d 85016f66af850 Author: Dave Airlie Date: Fri Jun 24 09:45:41 2022 +1000 Merge tag 'drm-misc-fixes-2022-06-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Multiple fixes in sun4i for suspend, DDC, DMA setup; A rework of vc4 to properly split the driver between hardware capabilities that wasn't done properly causing multiple crashes; and a panel quirk for Aya Neo Next Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220623064152.ubjmnpj7tdejdcw6@houat commit 382cf35f2508ddf444f4d5af33c5860620add29a Merge: a111daf0c53ae e84131a88a8cd Author: Dave Airlie Date: Fri Jun 24 09:36:30 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-06-22' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-06-22: amdgpu: - Adjust GTT size logic - eDP fix for RMB - DCN 3.15 fix - DP training fix - Color encoding fix for DCN2+ Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220622214106.5984-1-alexander.deucher@amd.com commit b0d473185ba887c798ed0cd6f5abf4075363baa4 Author: Stefan Wahren Date: Fri Jun 17 12:38:09 2022 +0200 gpio: mxs: Fix header comment This driver is about MXS GPIO support. MXC is a different platform. Signed-off-by: Stefan Wahren Signed-off-by: Bartosz Golaszewski commit 5e672cd69f0a534a445df4372141fd0d1d00901d Author: Dave Chinner Date: Thu Jun 16 07:44:32 2022 -0700 xfs: introduce xfs_inodegc_push() The current blocking mechanism for pushing the inodegc queue out to disk can result in systems becoming unusable when there is a long running inodegc operation. This is because the statfs() implementation currently issues a blocking flush of the inodegc queue and a significant number of common system utilities will call statfs() to discover something about the underlying filesystem. This can result in userspace operations getting stuck on inodegc progress, and when trying to remove a heavily reflinked file on slow storage with a full journal, this can result in delays measuring in hours. Avoid this problem by adding "push" function that expedites the flushing of the inodegc queue, but doesn't wait for it to complete. Convert xfs_fs_statfs() and xfs_qm_scall_getquota() to use this mechanism so they don't block but still ensure that queued operations are expedited. Fixes: ab23a7768739 ("xfs: per-cpu deferred inode inactivation queues") Reported-by: Chris Dunlop Signed-off-by: Dave Chinner [djwong: fix _getquota_next to use _inodegc_push too] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7cf2b0f9611b9971d663e1fc3206eeda3b902922 Author: Dave Chinner Date: Thu Jun 16 07:44:31 2022 -0700 xfs: bound maximum wait time for inodegc work Currently inodegc work can sit queued on the per-cpu queue until the workqueue is either flushed of the queue reaches a depth that triggers work queuing (and later throttling). This means that we could queue work that waits for a long time for some other event to trigger flushing. Hence instead of just queueing work at a specific depth, use a delayed work that queues the work at a bound time. We can still schedule the work immediately at a given depth, but we no long need to worry about leaving a number of items on the list that won't get processed until external events prevail. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c7e1c443584ddd7facffca00e9e23b0d084e5bb3 Author: Akira Yokosawa Date: Mon Jun 6 13:44:24 2022 +0900 gpio: Fix kernel-doc comments to nested union Commit 48ec13d36d3f ("gpio: Properly document parent data union") is supposed to have fixed a warning from "make htmldocs" regarding kernel-doc comments to union members. However, the same warning still remains [1]. Fix the issue by following the example found in section "Nested structs/unions" of Documentation/doc-guide/kernel-doc.rst. Signed-off-by: Akira Yokosawa Reported-by: Stephen Rothwell Fixes: 48ec13d36d3f ("gpio: Properly document parent data union") Link: https://lore.kernel.org/r/20220606093302.21febee3@canb.auug.org.au/ [1] Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Joey Gouly Cc: Marc Zyngier Tested-by: Stephen Rothwell Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Bartosz Golaszewski commit b376471fb47d4905e72fe73e9eeed228f8f2f230 Author: Jinzhou Su Date: Thu Jun 23 11:15:09 2022 +0800 cpufreq: amd-pstate: Add resume and suspend callbacks When system resumes from S3, the CPPC enable register will be cleared and reset to 0. So enable the CPPC interface by writing 1 to this register on system resume and disable it during system suspend. Signed-off-by: Jinzhou Su Signed-off-by: Jinzhou Su Acked-by: Huang Rui [ rjw: Subject and changelog edits ] Cc: All applicable Signed-off-by: Rafael J. Wysocki commit 92f20ff72066d8d7e2ffb655c2236259ac9d1c5d Merge: ba461afbef604 202773260023b Author: Linus Torvalds Date: Thu Jun 23 14:17:15 2022 -0500 Merge tag 'pm-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix a recent regression preventing some systems from powering off after saving a hibernation image (Dmitry Osipenko)" * tag 'pm-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: hibernate: Use kernel_can_power_off() commit ba461afbef604f58e05676ca38c2a599f073f296 Merge: fa1796a835fc2 63b8ea5e4f1a8 Author: Linus Torvalds Date: Thu Jun 23 14:00:49 2022 -0500 Merge tag 'random-5.19-rc4-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - A change to schedule the interrupt randomness mixing less often, yet credit a little more each time, to reduce overhead during interrupt storms. - Squelch an undesired pr_warn() from __ratelimit(), which was causing problems in the reporters' CI. - A trivial comment fix. * tag 'random-5.19-rc4-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: update comment from copy_to_user() -> copy_to_iter() random: quiet urandom warning ratelimit suppression message random: schedule mix_interrupt_randomness() less often commit 90736eb3232d208ee048493f371075e4272e0944 Author: Mikulas Patocka Date: Thu Jun 23 14:53:25 2022 -0400 dm mirror log: clear log bits up to BITS_PER_LONG boundary Commit 85e123c27d5c ("dm mirror log: round up region bitmap size to BITS_PER_LONG") introduced a regression on 64-bit architectures in the lvm testsuite tests: lvcreate-mirror, mirror-names and vgsplit-operation. If the device is shrunk, we need to clear log bits beyond the end of the device. The code clears bits up to a 32-bit boundary and then calculates lc->sync_count by summing set bits up to a 64-bit boundary (the commit changed that; previously, this boundary was 32-bit too). So, it was using some non-zeroed bits in the calculation and this caused misbehavior. Fix this regression by clearing bits up to BITS_PER_LONG boundary. Fixes: 85e123c27d5c ("dm mirror log: round up region bitmap size to BITS_PER_LONG") Cc: stable@vger.kernel.org Reported-by: Benjamin Marzinski Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 61b6e2e5321da281ab3c0c04e1962b3d000f6248 Author: Ming Lei Date: Thu Jun 23 21:20:05 2022 +0800 dm: fix BLK_STS_DM_REQUEUE handling when dm_io represents split bio Commit 7dd76d1feec7 ("dm: improve bio splitting and associated IO accounting") removed using cloned bio when dm io splitting is needed. Using bio_trim()+bio_inc_remaining() rather than bio_split()+bio_chain() causes multiple dm_io instances to share the same original bio, and it works fine if IOs are completed successfully. But a regression was caused for the case when BLK_STS_DM_REQUEUE is returned from any one of DM's cloned bios (whose dm_io share the same orig_bio). In this BLK_STS_DM_REQUEUE case only the mapped subset of the original bio for the current exact dm_io needs to be re-submitted. However, since the original bio is shared among all dm_io instances, the ->orig_bio actually only represents the last dm_io instance, so requeue can't work as expected. Also when more than one dm_io is requeued, the same original bio is requeued from all dm_io's completion handler, then race is caused. Fix this issue by still allocating one clone bio for completing io only, then io accounting can rely on ->orig_bio being unmodified. This is needed because the dm_io's sector_offset and sectors members are recorded relative to an unmodified ->orig_bio. In the future, we can go back to using bio_trim()+bio_inc_remaining() for dm's io splitting but then delay needing a bio clone only when handling BLK_STS_DM_REQUEUE, but that approach is a bit complicated (so it needs a development cycle): 1) bio clone needs to be done in task context 2) a block interface for unwinding bio is required Fixes: 7dd76d1feec7 ("dm: improve bio splitting and associated IO accounting") Reported-by: Benjamin Marzinski Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit eb174bd875ae504cdc1b5b209da288fffb1e5128 Author: sunliming Date: Thu Jun 23 09:27:07 2022 +0800 drm/msm/dpu: Fix variable dereferenced before check Fixes the following smatch warning: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:261 dpu_encoder_phys_wb_atomic_check() warn: variable dereferenced before check 'conn_state' Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Signed-off-by: sunliming Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/490850/ Link: https://lore.kernel.org/r/20220623012707.453972-1-sunliming@kylinos.cn Signed-off-by: Abhinav Kumar commit 0769d0a7ae3c26c0f2210578f83b3d1b30391601 Author: Kuogee Hsieh Date: Wed Jun 22 12:55:31 2022 -0700 drm/msm/dp: reset drm_dev to NULL at dp_display_unbind() During msm initialize phase, dp_display_unbind() will be called to undo initializations had been done by dp_display_bind() previously if there is error happen at msm_drm_bind. Under this kind of circumstance, drm_device may not be populated completed which causes system crash at drm_dev_dbg(). This patch reset drm_dev to NULL so that following drm_dev_dbg() will not refer to any internal fields of drm_device to prevent system from crashing. Below are panic stack trace, [ 53.584904] Unable to handle kernel paging request at virtual address 0000000070018001 . [ 53.702212] Hardware name: Qualcomm Technologies, Inc. sc7280 CRD platform (rev5+) (DT) [ 53.710445] pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 53.717596] pc : string_nocheck+0x1c/0x64 [ 53.721738] lr : string+0x54/0x60 [ 53.725162] sp : ffffffc013d6b650 [ 53.728590] pmr_save: 000000e0 [ 53.731743] x29: ffffffc013d6b650 x28: 0000000000000002 x27: 0000000000ffffff [ 53.739083] x26: ffffffc013d6b710 x25: ffffffd07a066ae0 x24: ffffffd07a419f97 [ 53.746420] x23: ffffffd07a419f99 x22: ffffff81fef360d4 x21: ffffff81fef364d4 [ 53.753760] x20: ffffffc013d6b6f8 x19: ffffffd07a06683c x18: 0000000000000000 [ 53.761093] x17: 4020386678302f30 x16: 00000000000000b0 x15: ffffffd0797523c8 [ 53.768429] x14: 0000000000000004 x13: ffff0000ffffff00 x12: ffffffd07a066b2c [ 53.775780] x11: 0000000000000000 x10: 000000000000013c x9 : 0000000000000000 [ 53.783117] x8 : ffffff81fef364d4 x7 : 0000000000000000 x6 : 0000000000000000 [ 53.790445] x5 : 0000000000000000 x4 : ffff0a00ffffff04 x3 : ffff0a00ffffff04 [ 53.797783] x2 : 0000000070018001 x1 : ffffffffffffffff x0 : ffffff81fef360d4 [ 53.805136] Call trace: [ 53.807667] string_nocheck+0x1c/0x64 [ 53.811439] string+0x54/0x60 [ 53.814498] vsnprintf+0x374/0x53c [ 53.818009] pointer+0x3dc/0x40c [ 53.821340] vsnprintf+0x398/0x53c [ 53.824854] vscnprintf+0x3c/0x88 [ 53.828274] __trace_array_vprintk+0xcc/0x2d4 [ 53.832768] trace_array_printk+0x8c/0xb4 [ 53.836900] drm_trace_printf+0x74/0x9c [ 53.840875] drm_dev_dbg+0xfc/0x1b8 [ 53.844480] dp_pm_suspend+0x70/0xf8 [ 53.848164] dpm_run_callback+0x60/0x1a0 [ 53.852222] __device_suspend+0x304/0x3f4 [ 53.856363] dpm_suspend+0xf8/0x3a8 [ 53.859959] dpm_suspend_start+0x8c/0xc0 Fixes: 570d3e5d28db ("drm/msm/dp: stop event kernel thread when DP unbind") Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/490756/ Link: https://lore.kernel.org/r/1655927731-22396-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar commit c28d76d360f9f7af1f910342bde27939873bc45e Author: Stephen Boyd Date: Tue Jun 21 19:38:55 2022 -0700 drm/msm/dpu: Increment vsync_cnt before waking up userspace The 'vsync_cnt' is used to count the number of frames for a crtc. Unfortunately, we increment the count after waking up userspace via dpu_crtc_vblank_callback() calling drm_crtc_handle_vblank(). drm_crtc_handle_vblank() wakes up userspace processes that have called drm_wait_vblank_ioctl(), and if that ioctl is expecting the count to increase it won't. Increment the count before calling into the drm APIs so that we don't have to worry about ordering the increment with anything else in drm. This fixes a software video decode test that fails to see frame counts increase on Trogdor boards. Cc: Mark Yacoub Cc: Jessica Zhang Fixes: 885455d6bf82 ("drm/msm: Change dpu_crtc_get_vblank_counter to use vsync count.") Signed-off-by: Stephen Boyd Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Tested-by: Jessica Zhang # Trogdor (sc7180) Patchwork: https://patchwork.freedesktop.org/patch/490531/ Link: https://lore.kernel.org/r/20220622023855.2970913-1-swboyd@chromium.org Signed-off-by: Abhinav Kumar commit fa1796a835fc24eb8fb5d794512ec299dcd9f3fd Merge: 16e4bce6de64c 12c3e0c92fd7c Author: Linus Torvalds Date: Thu Jun 23 12:24:49 2022 -0500 Merge tag 'trace-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: - Check for NULL in kretprobe_dispatcher() NULL can now be passed in, make sure it can handle it - Clean up unneeded #endif #ifdef of the same preprocessor check in the middle of the block. - Comment clean up - Remove unneeded initialization of the "ret" variable in __trace_uprobe_create() * tag 'trace-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/uprobes: Remove unwanted initialization in __trace_uprobe_create() tracefs: Fix syntax errors in comments tracing: Simplify conditional compilation code in tracing_set_tracer() tracing/kprobes: Check whether get_kretprobe() returns NULL in kretprobe_dispatcher() commit 16e4bce6de64c8f6a0f2f221154ffa8c5fe9cdd0 Merge: 599d16912d074 00fa15e0d5648 Author: Linus Torvalds Date: Thu Jun 23 12:16:14 2022 -0500 Merge tag 'folio-5.19b' of git://git.infradead.org/users/willy/pagecache Pull pagecache fixes from Matthew Wilcox: "Four folio-related fixes for 5.19: - Mark a folio accessed at the right time (Yu Kuai) - Fix a race for folios being replaced in the middle of a read (Brian Foster) - Clear folio->private in more places (Xiubo Li) - Take the invalidate_lock in page_cache_ra_order() (Alistair Popple)" * tag 'folio-5.19b' of git://git.infradead.org/users/willy/pagecache: filemap: Fix serialization adding transparent huge pages to page cache mm: Clear page->private when splitting or migrating a page filemap: Handle sibling entries in filemap_get_read_batch() filemap: Correct the conditions for marking a folio as accessed commit 51889d225ce2ce118d8413eb4282045add81a689 Merge: 93d17c1c8c1cc 07a22b61946f0 Author: Petr Mladek Date: Thu Jun 23 19:11:28 2022 +0200 Merge branch 'rework/kthreads' into for-linus commit 599d16912d0746aa67ec645ca6c121efa7bfd377 Merge: 399bd66e219e3 3748d2185ac4c Author: Linus Torvalds Date: Thu Jun 23 12:11:26 2022 -0500 Merge tag 'mips-fixes_5.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - several refcount fixes - added missing clock for ingenic - fix wrong irq_err_count for vr41xx * tag 'mips-fixes_5.19_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: mips: lantiq: Add missing of_node_put() in irq.c mips: dts: ingenic: Add TCU clock to x1000/x1830 tcu device node mips/pic32/pic32mzda: Fix refcount leak bugs mips: lantiq: xway: Fix refcount leak bug in sysctrl mips: lantiq: falcon: Fix refcount leak bug in sysctrl mips: ralink: Fix refcount leak in of.c mips: mti-malta: Fix refcount leak in malta-time.c arch: mips: generic: Add missing of_node_put() in board-ranchu.c MIPS: Remove repetitive increase irq_err_count commit 386e4fb6962b9f248a80f8870aea0870ca603e89 Author: Jens Axboe Date: Thu Jun 23 11:06:43 2022 -0600 io_uring: use original request task for inflight tracking In prior kernels, we did file assignment always at prep time. This meant that req->task == current. But after deferring that assignment and then pushing the inflight tracking back in, we've got the inflight tracking using current when it should in fact now be using req->task. Fixup that error introduced by adding the inflight tracking back after file assignments got modifed. Fixes: 9cae36a094e7 ("io_uring: reinstate the inflight tracking") Signed-off-by: Jens Axboe commit 6945b2141fc9429f30fd6df2bcdd657a7f309f2f Author: Paolo Bonzini Date: Thu Jun 23 07:15:17 2022 -0400 MAINTAINERS: Reorganize KVM/x86 maintainership For the last few years I have been the sole maintainer of KVM, albeit getting serious help from all the people who have reviewed hundreds of patches. The volume of KVM x86 alone has gotten to the point where one maintainer is not enough; especially if that maintainer is not doing it full time and if they want to keep up with the evolution of ARM64 and RISC-V at both the architecture and the hypervisor level. So, this patch is the first step in restoring double maintainership or even transitioning to the submaintainer model of other architectures. The changes here were mostly proposed by Sean offlist and they are twofold: - revisiting the set of KVM x86 reviewers. It's important to have an an accurate list of people that are actively reviewing patches ("R"), as well as people that are able to act on bug reports ("M"). Otherwise, voids to be filled are not easily visible. The proposal is to split KVM on Hyper-V, which is where Vitaly has been the main contributor for quite some time now; likewise for KVM paravirt support, which has been the main interest of Wanpeng and to which Vitaly has also contributed (e.g., for async page faults). Jim and Joerg have not been particularly active (though Joerg has worked on guest support for AMD SEV); knowing them a bit, I can't imagine they would object to their removal or even be surprised, but please speak up if you do. - promoting Sean to maintainer for KVM x86 host support. While for now this changes little, let's treat it as a harbinger for future changes. The plan is that I would keep the final integration testing for quite some time, and probably focus more on -rc work. This will give me more time to clean up my ad hoc setup and moving towards a more public CI, with Sean focusing instead on next-release patches, and the testing up to where kvm-unit-tests and selftests pass. In order to facilitate collaboration between Sean and myself, we'll also formalize a bit more the various branches of kvm.git. Nothing is going to change with respect to handling pull requests to Linus and from other architectures, as well as maintainance of the generic code (which I expect and hope to be more important as architectures try to share more code) and documentation. However, it's not a coincidence that my entry is now the last for x86, ready to be demoted to reviewer if/when the right time comes. Suggested-by: Sean Christopherson Co-developed-by: Sean Christopherson Cc: kvm@vger.kernel.org Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Acked-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 07a22b61946f0b80065b0ddcc703b715f84355f5 Author: Petr Mladek Date: Thu Jun 23 16:51:57 2022 +0200 Revert "printk: add functions to prefer direct printing" This reverts commit 2bb2b7b57f81255c13f4395ea911d6bdc70c9fe2. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-7-pmladek@suse.com commit 5831788afb17b89c5b531fb60cbd798613ccbb63 Author: Petr Mladek Date: Thu Jun 23 16:51:56 2022 +0200 Revert "printk: add kthread console printers" This reverts commit 09c5ba0aa2fcfdadb17d045c3ee6f86d69270df7. This reverts commit b87f02307d3cfbda768520f0687c51ca77e14fc3. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-6-pmladek@suse.com commit 2d9ef940f89e0ab4fde7ba6f769d82f2a450c35a Author: Petr Mladek Date: Thu Jun 23 16:51:55 2022 +0200 Revert "printk: extend console_lock for per-console locking" This reverts commit 8e274732115f63c1d09136284431b3555bd5cc56. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-5-pmladek@suse.com commit 007eeab7e9f03a3108c300c03e11a6c151e430c9 Author: Petr Mladek Date: Thu Jun 23 16:51:54 2022 +0200 Revert "printk: remove @console_locked" This reverts commit ab406816fca009349b89cbde885daf68a8c77e33. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-4-pmladek@suse.com commit 05c96b3713aa2a406d0c4ef0505bf80a6748fedb Author: Petr Mladek Date: Thu Jun 23 16:51:53 2022 +0200 Revert "printk: Block console kthreads when direct printing will be required" This reverts commit c3230283e2819a69dad2cf7a63143fde8bab8b5c. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-3-pmladek@suse.com commit 20fb0c8272bbb102d15bdd11aa64f828619dd7cc Author: Petr Mladek Date: Thu Jun 23 16:51:52 2022 +0200 Revert "printk: Wait for the global console lock when the system is going down" This reverts commit b87f02307d3cfbda768520f0687c51ca77e14fc3. The testing of 5.19 release candidates revealed missing synchronization between early and regular console functionality. It would be possible to start the console kthreads later as a workaround. But it is clear that console lock serialized console drivers between each other. It opens a big area of possible problems that were not considered by people involved in the development and review. printk() is crucial for debugging kernel issues and console output is very important part of it. The number of consoles is huge and a proper review would take some time. As a result it need to be reverted for 5.19. Link: https://lore.kernel.org/r/YrBdjVwBOVgLfHyb@alley Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220623145157.21938-2-pmladek@suse.com commit 00fa15e0d56482e32d8ca1f51d76b0ee00afb16b Author: Alistair Popple Date: Mon Jun 20 19:05:36 2022 +1000 filemap: Fix serialization adding transparent huge pages to page cache Commit 793917d997df ("mm/readahead: Add large folio readahead") introduced support for using large folios for filebacked pages if the filesystem supports it. page_cache_ra_order() was introduced to allocate and add these large folios to the page cache. However adding pages to the page cache should be serialized against truncation and hole punching by taking invalidate_lock. Not doing so can lead to data races resulting in stale data getting added to the page cache and marked up-to-date. See commit 730633f0b7f9 ("mm: Protect operations adding pages to page cache with invalidate_lock") for more details. This issue was found by inspection but a testcase revealed it was possible to observe in practice on XFS. Fix this by taking invalidate_lock in page_cache_ra_order(), to mirror what is done for the non-thp case in page_cache_ra_unbounded(). Signed-off-by: Alistair Popple Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Reviewed-by: Jan Kara Signed-off-by: Matthew Wilcox (Oracle) commit b653db77350c7307a513b81856fe53e94cf42446 Author: Matthew Wilcox (Oracle) Date: Sun Jun 19 10:37:32 2022 -0400 mm: Clear page->private when splitting or migrating a page In our efforts to remove uses of PG_private, we have found folios with the private flag clear and folio->private not-NULL. That is the root cause behind 642d51fb0775 ("ceph: check folio PG_private bit instead of folio->private"). It can also affect a few other filesystems that haven't yet reported a problem. compaction_alloc() can return a page with uninitialised page->private, and rather than checking all the callers of migrate_pages(), just zero page->private after calling get_new_page(). Similarly, the tail pages from split_huge_page() may also have an uninitialised page->private. Reported-by: Xiubo Li Tested-by: Xiubo Li Signed-off-by: Matthew Wilcox (Oracle) commit 21e876448792af2dd5261338907c72bdf37fa056 Author: Thomas Richter Date: Wed Jun 15 14:02:07 2022 +0200 s390/pai: Fix multiple concurrent event installation Two different events such as pai_crypto/KM_AES_128/ and pai_crypto/KM_AES_192/ can be installed multiple times on the same CPU and the events are executed concurrently: # perf stat -e pai_crypto/KM_AES_128/ -C0 -a -- sleep 5 & # sleep 2 # perf stat -e pai_crypto/KM_AES_192/ -C0 -a -- true This results in the first event being installed two times with two seconds delay. The kernel does install the second event after the first event has been deleted and re-added, as can be seen in the traces: 13:48:47.600350 paicrypt_start event 0x1007 (event KM_AES_128) 13:48:49.599359 paicrypt_stop event 0x1007 (event KM_AES_128) 13:48:49.599198 paicrypt_start event 0x1007 13:48:49.599199 paicrypt_start event 0x1008 13:48:49.599921 paicrypt_event_destroy event 0x1008 13:48:52.601507 paicrypt_event_destroy event 0x1007 This is caused by functions event_sched_in() and event_sched_out() which call the PMU's add() and start() functions on schedule_in and the PMU's stop() and del() functions on schedule_out. This is correct for events attached to processes. The pai_crypto events are system-wide events and not attached to processes. Since the kernel common code can not be changed easily, fix this issue and do not reset the event count value to zero each time the event is added and started. Instead use a flag and zero the event count value only when called immediately after the event has been initialized. Therefore only the first invocation of the the event's add() function initializes the event count value to zero. The following invocations of the event's add() function leave the current event count value untouched. Fixes: 39d62336f5c1 ("s390/pai: add support for cryptography counters") Reported-by: Sumanth Korikkar Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Alexander Gordeev commit 541a496644512ebed429b33f19a3fadfb19c6ee7 Author: Thomas Richter Date: Tue Jun 14 12:40:46 2022 +0200 s390/pai: Prevent invalid event number for pai_crypto PMU The pai_crypto PMU has to check the event number. It has to be in the supported range. This is not the case, the lower limit is not checked. Fix this and obey the lower limit. Fixes: 39d62336f5c1 ("s390/pai: add support for cryptography counters") Signed-off-by: Thomas Richter Suggested-by: Sumanth Korikkar Reviewed-by: Sumanth Korikkar Signed-off-by: Alexander Gordeev commit be857b7f77d130dbbd47c91fc35198b040f35865 Author: Thomas Richter Date: Fri Jun 10 15:19:00 2022 +0200 s390/cpumf: Handle events cycles and instructions identical Events CPU_CYCLES and INSTRUCTIONS can be submitted with two different perf_event attribute::type values: - PERF_TYPE_HARDWARE: when invoked via perf tool predefined events name cycles or cpu-cycles or instructions. - pmu->type: when invoked via perf tool event name cpu_cf/CPU_CYLCES/ or cpu_cf/INSTRUCTIONS/. This invocation also selects the PMU to which the event belongs. Handle both type of invocations identical for events CPU_CYLCES and INSTRUCTIONS. They address the same hardware. The result is different when event modifier exclude_kernel is also set. Invocation with event modifier for user space event counting fails. Output before: # perf stat -e cpum_cf/cpu_cycles/u -- true Performance counter stats for 'true': cpum_cf/cpu_cycles/u 0.000761033 seconds time elapsed 0.000076000 seconds user 0.000725000 seconds sys # Output after: # perf stat -e cpum_cf/cpu_cycles/u -- true Performance counter stats for 'true': 349,613 cpum_cf/cpu_cycles/u 0.000844143 seconds time elapsed 0.000079000 seconds user 0.000800000 seconds sys # Fixes: 6a82e23f45fe ("s390/cpumf: Adjust registration of s390 PMU device drivers") Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar [agordeev@linux.ibm.com corrected commit ID of Fixes commit] Signed-off-by: Alexander Gordeev commit af2debd58bd769e38f538143f0d332e15d753396 Author: Alexander Gordeev Date: Thu Jun 9 21:32:39 2022 +0200 s390/crash: make copy_oldmem_page() return number of bytes copied Callback copy_oldmem_page() returns either error code or zero. Instead, it should return the error code or number of bytes copied. Fixes: df9694c7975f ("s390/dump: streamline oldmem copy functions") Reviewed-by: Alexander Egorenkov Tested-by: Alexander Egorenkov Signed-off-by: Alexander Gordeev commit cc02e6e21aa5f2ac0defe8c15e5a9d024da6e73d Author: Alexander Gordeev Date: Fri Jun 10 11:04:36 2022 +0200 s390/crash: add missing iterator advance in copy_oldmem_page() In case old memory was successfully copied the passed iterator should be advanced as well. Currently copy_oldmem_page() is always called with single-segment iterator. Should that ever change - copy_oldmem_user and copy_oldmem_kernel() functions would need a rework to deal with multi-segment iterators. Fixes: 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter") Reviewed-by: Alexander Egorenkov Tested-by: Alexander Egorenkov Signed-off-by: Alexander Gordeev commit c1c2a15c2b5379ea8e44dcdcc298e3de42076ba0 Author: Uwe Kleine-König Date: Tue Jun 21 08:40:36 2022 +0200 gpio: grgpio: Fix device removing If a platform device's remove callback returns non-zero, the device core emits a warning and still removes the device and calls the devm cleanup callbacks. So it's not save to not unregister the gpiochip because on the next request to a GPIO the driver accesses kfree()'d memory. Also if an IRQ triggers, the freed memory is accessed. Instead rely on the GPIO framework to ensure that after gpiochip_remove() all GPIOs are freed and so the corresponding IRQs are unmapped. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit e70b64a3f28b9f54602ae3e706b1dc1338de3df7 Author: Dylan Yudaken Date: Thu Jun 23 01:37:43 2022 -0700 io_uring: move io_uring_get_opcode out of TP_printk The TP_printk macro's are not supposed to use custom code ([1]) or else tools such as perf cannot use these events. Convert the opcode string representation to use the __string wiring that the event framework provides ([2]). [1]: https://lwn.net/Articles/379903/ [2]: https://lwn.net/Articles/381064/ Fixes: 033b87d24f72 ("io_uring: use the text representation of ops in trace") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220623083743.2648321-1-dylany@fb.com [axboe: fixup spurious removal of sq_thread assignment] Signed-off-by: Jens Axboe commit 9ca766eaea2e87b8b773bff04ee56c055cb76d4e Author: Dan Carpenter Date: Thu Jun 23 11:29:48 2022 +0300 gpio: winbond: Fix error code in winbond_gpio_get() This error path returns 1, but it should instead propagate the negative error code from winbond_sio_enter(). Fixes: a0d65009411c ("gpio: winbond: Add driver") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 8ffdc53a60049f3930afe161dc51c67959c8d83d Author: Utkarsh Patel Date: Thu Jun 23 14:19:45 2022 +0300 xhci-pci: Allow host runtime PM as default for Intel Meteor Lake xHCI Meteor Lake TCSS(Type-C Subsystem) xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3cold and thus save energy. Cc: stable@kernel.org Signed-off-by: Utkarsh Patel Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220623111945.1557702-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7516da47a349e74de623243a27f9b8a91446bf4f Author: Tanveer Alam Date: Thu Jun 23 14:19:44 2022 +0300 xhci-pci: Allow host runtime PM as default for Intel Raptor Lake xHCI In the same way as Intel Alder Lake TCSS (Type-C Subsystem) the Raptor Lake TCSS xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3cold and thus save energy. Cc: stable@kernel.org Signed-off-by: Tanveer Alam Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220623111945.1557702-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 83810f84ecf11dfc5a9414a8b762c3501b328185 Author: Mathias Nyman Date: Thu Jun 23 14:19:43 2022 +0300 xhci: turn off port power in shutdown If ports are not turned off in shutdown then runtime suspended self-powered USB devices may survive in U3 link state over S5. During subsequent boot, if firmware sends an IPC command to program the port in DISCONNECT state, it will time out, causing significant delay in the boot time. Turning off roothub port power is also recommended in xhci specification 4.19.4 "Port Power" in the additional note. Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220623111945.1557702-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a808925075fb750804a60ff0710614466c396db4 Author: Hongyu Xie Date: Thu Jun 23 14:19:42 2022 +0300 xhci: Keep interrupt disabled in initialization until host is running. irq is disabled in xhci_quiesce(called by xhci_halt, with bit:2 cleared in USBCMD register), but xhci_run(called by usb_add_hcd) re-enable it. It's possible that you will receive thousands of interrupt requests after initialization for 2.0 roothub. And you will get a lot of warning like, "xHCI dying, ignoring interrupt. Shouldn't IRQs be disabled?". This amount of interrupt requests will cause the entire system to freeze. This problem was first found on a device with ASM2142 host controller on it. [tidy up old code while moving it, reword header -Mathias] Cc: stable@kernel.org Signed-off-by: Hongyu Xie Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220623111945.1557702-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 922d4578cfd017da67f545bfd07331bda86f795d Merge: 9e2f6498efbbc cbc6d44867a24 Author: Paolo Bonzini Date: Thu Jun 23 10:27:21 2022 -0400 Merge tag 'kvmarm-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.19, take #2 - Fix a regression with pKVM when kmemleak is enabled - Add Oliver Upton as an official KVM/arm64 reviewer commit 9e2f6498efbbc880d7caa7935839e682b64fe5a6 Author: Raghavendra Rao Ananta Date: Wed Jun 15 18:57:06 2022 +0000 selftests: KVM: Handle compiler optimizations in ucall The selftests, when built with newer versions of clang, is found to have over optimized guests' ucall() function, and eliminating the stores for uc.cmd (perhaps due to no immediate readers). This resulted in the userspace side always reading a value of '0', and causing multiple test failures. As a result, prevent the compiler from optimizing the stores in ucall() with WRITE_ONCE(). Suggested-by: Ricardo Koller Suggested-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Message-Id: <20220615185706.1099208-1-rananta@google.com> Reviewed-by: Andrew Jones Signed-off-by: Paolo Bonzini commit 2bdc2bcd9a759613d6340c4a0b7f5d3b7a1a71a2 Merge: 9ef1654063085 15b694e96c318 Author: Greg Kroah-Hartman Date: Thu Jun 23 16:25:55 2022 +0200 Merge tag 'usb-serial-5.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.19-rc4 Here are some new modem device ids and support for further PL2303 device types. All but the final commit (RM500K device id) have been in linux-next and with no reported issues. * tag 'usb-serial-5.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Quectel RM500K module support USB: serial: option: add Quectel EM05-G modem USB: serial: pl2303: add support for more HXN (G) types USB: serial: option: add Telit LE910Cx 0x1250 composition commit 399bd66e219e331976fe6fa6ab81a023c0c97870 Merge: f410c3e000a3c 12378a5a75e33 Author: Linus Torvalds Date: Thu Jun 23 09:01:01 2022 -0500 Merge tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf and netfilter. Current release - regressions: - netfilter: cttimeout: fix slab-out-of-bounds read in cttimeout_net_exit Current release - new code bugs: - bpf: ftrace: keep address offset in ftrace_lookup_symbols - bpf: force cookies array to follow symbols sorting Previous releases - regressions: - ipv4: ping: fix bind address validity check - tipc: fix use-after-free read in tipc_named_reinit - eth: veth: add updating of trans_start Previous releases - always broken: - sock: redo the psock vs ULP protection check - netfilter: nf_dup_netdev: fix skb_under_panic - bpf: fix request_sock leak in sk lookup helpers - eth: igb: fix a use-after-free issue in igb_clean_tx_ring - eth: ice: prohibit improper channel config for DCB - eth: at803x: fix null pointer dereference on AR9331 phy - eth: virtio_net: fix xdp_rxq_info bug after suspend/resume Misc: - eth: hinic: replace memcpy() with direct assignment" * tag 'net-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (47 commits) net: openvswitch: fix parsing of nw_proto for IPv6 fragments sock: redo the psock vs ULP protection check Revert "net/tls: fix tls_sk_proto_close executed repeatedly" virtio_net: fix xdp_rxq_info bug after suspend/resume igb: Make DMA faster when CPU is active on the PCIe link net: dsa: qca8k: reduce mgmt ethernet timeout net: dsa: qca8k: reset cpu port on MTU change MAINTAINERS: Add a maintainer for OCP Time Card hinic: Replace memcpy() with direct assignment Revert "drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c" net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode ice: ethtool: Prohibit improper channel config for DCB ice: ethtool: advertise 1000M speeds properly ice: Fix switchdev rules book keeping ice: ignore protocol field in GTP offload netfilter: nf_dup_netdev: add and use recursion counter netfilter: nf_dup_netdev: do not push mac header a second time selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh net/tls: fix tls_sk_proto_close executed repeatedly erspan: do not assume transport header is always set ... commit f410c3e000a3ced328b2c4c8bb6d121ff5572dde Merge: ddfe80311b81a 89bcd9a64b849 Author: Linus Torvalds Date: Thu Jun 23 08:55:37 2022 -0500 Merge tag 'mmc-v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: - mtk-sd: Fix dma hang issues - sdhci-pci-o2micro: Fix card detect by dealing with debouncing * tag 'mmc-v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: mediatek: wait dma stop bit reset to 0 mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing commit e531485a0a0e0a06644de1b639502471415d5e12 Merge: ca2a3343d6974 e6487833182a8 Author: Jens Axboe Date: Thu Jun 23 07:55:07 2022 -0600 Merge tag 'nvme-5.19-2022-06-23' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - fix the mixed up CRIMS/CRWMS constants (Joel Granados) - add another broken identifier quirk (Leo Savernik) - fix up a quirk because Samsung reuses PCI IDs over different products (Christoph Hellwig)" * tag 'nvme-5.19-2022-06-23' of git://git.infradead.org/nvme: nvme: move the Samsung X5 quirk entry to the core quirks nvme: fix the CRIMS and CRWMS definitions to match the spec nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH commit ca2a3343d69741dae4df2dbb954fb806d9a835de Author: Li Nan Date: Thu Jun 23 15:41:00 2022 +0800 block: remove WARN_ON() from bd_link_disk_holder Since commit 83cbce957446("block: add error handling for device_add_disk / add_disk"), bdev->bd_holder_dir can not be empty now, so remove WARN_ON() from bd_link_disk_holder. Signed-off-by: Li Nan Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220623074100.2251301-1-linan122@huawei.com Signed-off-by: Jens Axboe commit ddfe80311b81a83d3fde7e59fddc6aa822a5188d Merge: de5c208d533a4 627ce0d68eb4b Author: Linus Torvalds Date: Thu Jun 23 08:44:00 2022 -0500 Merge tag 'sound-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "All small changes, mostly device-specific: - A regression fix for PCM WC-page allocation on x86 - A regression fix for i915 audio component binding - Fixes for (longstanding) beep handling bug - Runtime PM fixes for Intel LPE HDMI audio - A couple of pending FireWire fixes - Usual HD-audio and USB-audio quirks, new Intel dspconf entries" * tag 'sound-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Add quirk for Clevo NS50PU ALSA: hda: Fix discovery of i915 graphics PCI device ALSA: hda/via: Fix missing beep setup ALSA: hda/conexant: Fix missing beep setup ALSA: memalloc: Drop x86-specific hack for WC allocations ALSA: hda/realtek: Add quirk for Clevo PD70PNT ALSA: x86: intel_hdmi_audio: use pm_runtime_resume_and_get() ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay ALSA: hda: intel-nhlt: remove use of __func__ in dev_dbg ALSA: hda: intel-dspcfg: use SOF for UpExtreme and UpExtreme11 boards firewire: convert sysfs sprintf/snprintf family to sysfs_emit firewire: cdev: fix potential leak of kernel stack due to uninitialized value ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly ALSA: hda/realtek - ALC897 headset MIC no sound ALSA: usb-audio: US16x08: Move overflow check before array access ALSA: hda/realtek: Add mute LED quirk for HP Omen laptop commit dbe97cff7dd9f0f75c524afdd55ad46be3d15295 Author: Demi Marie Obenour Date: Tue Jun 21 22:27:26 2022 -0400 xen/gntdev: Avoid blocking in unmap_grant_pages() unmap_grant_pages() currently waits for the pages to no longer be used. In https://github.com/QubesOS/qubes-issues/issues/7481, this lead to a deadlock against i915: i915 was waiting for gntdev's MMU notifier to finish, while gntdev was waiting for i915 to free its pages. I also believe this is responsible for various deadlocks I have experienced in the past. Avoid these problems by making unmap_grant_pages async. This requires making it return void, as any errors will not be available when the function returns. Fortunately, the only use of the return value is a WARN_ON(), which can be replaced by a WARN_ON when the error is detected. Additionally, a failed call will not prevent further calls from being made, but this is harmless. Because unmap_grant_pages is now async, the grant handle will be sent to INVALID_GRANT_HANDLE too late to prevent multiple unmaps of the same handle. Instead, a separate bool array is allocated for this purpose. This wastes memory, but stuffing this information in padding bytes is too fragile. Furthermore, it is necessary to grab a reference to the map before making the asynchronous call, and release the reference when the call returns. It is also necessary to guard against reentrancy in gntdev_map_put(), and to handle the case where userspace tries to map a mapping whose contents have not all been freed yet. Fixes: 745282256c75 ("xen/gntdev: safely unmap grants in case they are still in use") Cc: stable@vger.kernel.org Signed-off-by: Demi Marie Obenour Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220622022726.2538-1-demi@invisiblethingslab.com Signed-off-by: Juergen Gross commit 3be4562584bba603f33863a00c1c32eecf772ee6 Author: Dexuan Cui Date: Wed Jun 22 12:14:24 2022 -0700 dma-direct: use the correct size for dma_set_encrypted() The third parameter of dma_set_encrypted() is a size in bytes rather than the number of pages. Fixes: 4d0564785bb0 ("dma-direct: factor out dma_set_{de,en}crypted helpers") Signed-off-by: Dexuan Cui Reviewed-by: Robin Murphy Signed-off-by: Christoph Hellwig commit e6487833182a8a0187f0292aca542fc163ccd03e Author: Christoph Hellwig Date: Fri Jun 17 10:29:42 2022 +0200 nvme: move the Samsung X5 quirk entry to the core quirks This device shares the PCI ID with the Samsung 970 Evo Plus that does not need or want the quirks. Move the the quirk entry to the core table based on the model number instead. Fixes: bc360b0b1611 ("nvme-pci: add quirks for Samsung X5 SSDs") Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Raghav commit 23c9cd56007e90b2c2317c5eab6ab12921b4314a Author: Joel Granados Date: Tue Jun 21 09:05:00 2022 +0200 nvme: fix the CRIMS and CRWMS definitions to match the spec Adjust the values of NVME_CAP_CRMS_CRIMS and NVME_CAP_CRMS_CRWMS masks as they are different from the ones in TP4084 - Time-to-ready. Fixes: 354201c53e61 ("nvme: add support for TP4084 - Time-to-Ready Enhancements"). Signed-off-by: Joel Granados Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 41f38043f884c66af4114a7109cf540d6222f450 Author: Leo Savernik Date: Wed Jun 22 12:19:21 2022 +0200 nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH The Micron MTFDKBA2T0TFH device reports the same subsysem NQN for all devices. Add a quick to ignore it. Signed-off-by: Leo Savernik Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit 15b694e96c31807d8515aacfa687a1e8a4fbbadc Author: Macpaul Lin Date: Thu Jun 23 16:56:44 2022 +0800 USB: serial: option: add Quectel RM500K module support Add usb product id of the Quectel RM500K module. RM500K provides 2 mandatory interfaces to Linux host after enumeration. - /dev/ttyUSB5: this is a serial interface for control path. User needs to write AT commands to this device node to query status, set APN, set PIN code, and enable/disable the data connection to 5G network. - ethX: this is the data path provided as a RNDIS devices. After the data connection has been established, Linux host can access 5G data network via this interface. "RNDIS": RNDIS + ADB + AT (/dev/ttyUSB5) + MODEM COMs usb-devices output for 0x7001: T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=7001 Rev=00.01 S: Manufacturer=MediaTek Inc. S: Product=USB DATA CARD S: SerialNumber=869206050009672 C: #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=ff Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(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=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms Co-developed-by: Ballon Shi Signed-off-by: Ballon Shi Signed-off-by: Macpaul Lin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 12378a5a75e33f34f8586706eb61cca9e6d4690c Author: Rosemarie O'Riorden Date: Tue Jun 21 16:48:45 2022 -0400 net: openvswitch: fix parsing of nw_proto for IPv6 fragments When a packet enters the OVS datapath and does not match any existing flows installed in the kernel flow cache, the packet will be sent to userspace to be parsed, and a new flow will be created. The kernel and OVS rely on each other to parse packet fields in the same way so that packets will be handled properly. As per the design document linked below, OVS expects all later IPv6 fragments to have nw_proto=44 in the flow key, so they can be correctly matched on OpenFlow rules. OpenFlow controllers create pipelines based on this design. This behavior was changed by the commit in the Fixes tag so that nw_proto equals the next_header field of the last extension header. However, there is no counterpart for this change in OVS userspace, meaning that this field is parsed differently between OVS and the kernel. This is a problem because OVS creates actions based on what is parsed in userspace, but the kernel-provided flow key is used as a match criteria, as described in Documentation/networking/openvswitch.rst. This leads to issues such as packets incorrectly matching on a flow and thus the wrong list of actions being applied to the packet. Such changes in packet parsing cannot be implemented without breaking the userspace. The offending commit is partially reverted to restore the expected behavior. The change technically made sense and there is a good reason that it was implemented, but it does not comply with the original design of OVS. If in the future someone wants to implement such a change, then it must be user-configurable and disabled by default to preserve backwards compatibility with existing OVS versions. Cc: stable@vger.kernel.org Fixes: fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later frags") Link: https://docs.openvswitch.org/en/latest/topics/design/#fragments Signed-off-by: Rosemarie O'Riorden Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/20220621204845.9721-1-roriorden@redhat.com Signed-off-by: Paolo Abeni commit e34a07c0ae3906f97eb18df50902e2a01c1015b6 Author: Jakub Kicinski Date: Mon Jun 20 12:13:53 2022 -0700 sock: redo the psock vs ULP protection check Commit 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()") has moved the inet_csk_has_ulp(sk) check from sk_psock_init() to the new tcp_bpf_update_proto() function. I'm guessing that this was done to allow creating psocks for non-inet sockets. Unfortunately the destruction path for psock includes the ULP unwind, so we need to fail the sk_psock_init() itself. Otherwise if ULP is already present we'll notice that later, and call tcp_update_ulp() with the sk_proto of the ULP itself, which will most likely result in the ULP looping its callbacks. Fixes: 8a59f9d1e3d4 ("sock: Introduce sk->sk_prot->psock_update_sk_prot()") Signed-off-by: Jakub Kicinski Reviewed-by: John Fastabend Reviewed-by: Jakub Sitnicki Tested-by: Jakub Sitnicki Link: https://lore.kernel.org/r/20220620191353.1184629-2-kuba@kernel.org Signed-off-by: Paolo Abeni commit 1b205d948fbb06a7613d87dcea0ff5fd8a08ed91 Author: Jakub Kicinski Date: Mon Jun 20 12:13:52 2022 -0700 Revert "net/tls: fix tls_sk_proto_close executed repeatedly" This reverts commit 69135c572d1f84261a6de2a1268513a7e71753e2. This commit was just papering over the issue, ULP should not get ->update() called with its own sk_prot. Each ULP would need to add this check. Fixes: 69135c572d1f ("net/tls: fix tls_sk_proto_close executed repeatedly") Signed-off-by: Jakub Kicinski Reviewed-by: John Fastabend Link: https://lore.kernel.org/r/20220620191353.1184629-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 8af52fe9fd3bf5e7478da99193c0632276e1dfce Author: Stephan Gerhold Date: Tue Jun 21 13:48:44 2022 +0200 virtio_net: fix xdp_rxq_info bug after suspend/resume The following sequence currently causes a driver bug warning when using virtio_net: # ip link set eth0 up # echo mem > /sys/power/state (or e.g. # rtcwake -s 10 -m mem) # ip link set eth0 down Missing register, driver bug WARNING: CPU: 0 PID: 375 at net/core/xdp.c:138 xdp_rxq_info_unreg+0x58/0x60 Call trace: xdp_rxq_info_unreg+0x58/0x60 virtnet_close+0x58/0xac __dev_close_many+0xac/0x140 __dev_change_flags+0xd8/0x210 dev_change_flags+0x24/0x64 do_setlink+0x230/0xdd0 ... This happens because virtnet_freeze() frees the receive_queue completely (including struct xdp_rxq_info) but does not call xdp_rxq_info_unreg(). Similarly, virtnet_restore() sets up the receive_queue again but does not call xdp_rxq_info_reg(). Actually, parts of virtnet_freeze_down() and virtnet_restore_up() are almost identical to virtnet_close() and virtnet_open(): only the calls to xdp_rxq_info_(un)reg() are missing. This means that we can fix this easily and avoid such problems in the future by just calling virtnet_close()/open() from the freeze/restore handlers. Aside from adding the missing xdp_rxq_info calls the only difference is that the refill work is only cancelled if netif_running(). However, this should not make any functional difference since the refill work should only be active if the network interface is actually up. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Stephan Gerhold Acked-by: Jesper Dangaard Brouer Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220621114845.3650258-1-stephan.gerhold@kernkonzept.com Signed-off-by: Jakub Kicinski commit 448ad88f8011af77e0960fd011039e525fcb7cde Merge: 4e0effd9007ea a632b2a4c920c Author: Jakub Kicinski Date: Wed Jun 22 18:59:29 2022 -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 2022-06-21 This series contains updates to ice driver only. Marcin fixes GTP filters by allowing ignoring of the inner ethertype field. Wojciech adds VSI handle tracking in order to properly distinguish similar filters for removal. Anatolii removes ability to set 1000baseT and 1000baseX fields concurrently which caused link issues. He also disallows setting channels to less than the number of Traffic Classes which would cause NULL pointer dereference. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: ethtool: Prohibit improper channel config for DCB ice: ethtool: advertise 1000M speeds properly ice: Fix switchdev rules book keeping ice: ignore protocol field in GTP offload ==================== Link: https://lore.kernel.org/r/20220621224756.631765-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 4e0effd9007ea0be31f7488611eb3824b4541554 Author: Kai-Heng Feng Date: Tue Jun 21 15:10:56 2022 -0700 igb: Make DMA faster when CPU is active on the PCIe link Intel I210 on some Intel Alder Lake platforms can only achieve ~750Mbps Tx speed via iperf. The RR2DCDELAY shows around 0x2xxx DMA delay, which will be significantly lower when 1) ASPM is disabled or 2) SoC package c-state stays above PC3. When the RR2DCDELAY is around 0x1xxx the Tx speed can reach to ~950Mbps. According to the I210 datasheet "8.26.1 PCIe Misc. Register - PCIEMISC", "DMA Idle Indication" doesn't seem to tie to DMA coalesce anymore, so set it to 1b for "DMA is considered idle when there is no Rx or Tx AND when there are no TLPs indicating that CPU is active detected on the PCIe link (such as the host executes CSR or Configuration register read or write operation)" and performing Tx should also fall under "active CPU on PCIe link" case. In addition to that, commit b6e0c419f040 ("igb: Move DMA Coalescing init code to separate function.") seems to wrongly changed from enabling E1000_PCIEMISC_LX_DECISION to disabling it, also fix that. Fixes: b6e0c419f040 ("igb: Move DMA Coalescing init code to separate function.") Signed-off-by: Kai-Heng Feng Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220621221056.604304-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 85467f7da18992311deafdbf32a8d163cb1e98d7 Author: Christian Marangi Date: Tue Jun 21 17:16:33 2022 +0200 net: dsa: qca8k: reduce mgmt ethernet timeout The current mgmt ethernet timeout is set to 100ms. This value is too big and would slow down any mdio command in case the mgmt ethernet packet have some problems on the receiving part. Reduce it to just 5ms to handle case when some operation are done on the master port that would cause the mgmt ethernet to not work temporarily. Fixes: 5950c7c0a68c ("net: dsa: qca8k: add support for mgmt read/write in Ethernet packet") Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20220621151633.11741-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 386228c694bf1e7a7688e44412cb33500b0ac585 Author: Christian Marangi Date: Tue Jun 21 17:11:22 2022 +0200 net: dsa: qca8k: reset cpu port on MTU change It was discovered that the Documentation lacks of a fundamental detail on how to correctly change the MAX_FRAME_SIZE of the switch. In fact if the MAX_FRAME_SIZE is changed while the cpu port is on, the switch panics and cease to send any packet. This cause the mgmt ethernet system to not receive any packet (the slow fallback still works) and makes the device not reachable. To recover from this a switch reset is required. To correctly handle this, turn off the cpu ports before changing the MAX_FRAME_SIZE and turn on again after the value is applied. Fixes: f58d2598cf70 ("net: dsa: qca8k: implement the port MTU callbacks") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20220621151122.10220-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 6e1c1c08cdf3d7d7b8c571c0f032a283af6ca024 Author: Shyam Prasad N Date: Mon Jun 6 09:17:56 2022 +0000 cifs: periodically query network interfaces from server Currently, we only query the server for network interfaces information at the time of mount, and never afterwards. This can be a problem, especially for services like Azure, where the IP address of the channel endpoints can change over time. With this change, we schedule a 600s polling of this info from the server for each tree connect. An alternative for periodic polling was to do this only at the time of reconnect. But this could delay the reconnect time slightly. Also, there are some challenges w.r.t how we have cifs_reconnect implemented today. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit b54034a73baf9fe31fb3f218c17bd5308a27a1ca Author: Shyam Prasad N Date: Mon Jan 3 08:47:30 2022 +0000 cifs: during reconnect, update interface if necessary Going forward, the plan is to periodically query the server for it's interfaces (when multichannel is enabled). This change allows checking for inactive interfaces during reconnect, and reconnect to a new interface if necessary. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit aa45dadd34e44fcd6a9df4b395bee5b5633b4cec Author: Shyam Prasad N Date: Sat Jan 1 12:50:21 2022 +0000 cifs: change iface_list from array to sorted linked list A server's published interface list can change over time, and needs to be updated. We've storing iface_list as a simple array, which makes it difficult to manipulate an existing list. With this change, iface_list is modified into a linked list of interfaces, which is kept sorted by speed. Also added a reference counter for an iface entry, so that each channel can maintain a backpointer to the iface and drop it easily when needed. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 9de74996a739bf0b7b5d8c260bd207ad6007442b Author: Shyam Prasad N Date: Wed Jun 22 12:36:36 2022 -0500 smb3: use netname when available on secondary channels Some servers do not allow null netname contexts, which would cause multichannel to revert to single channel when mounting to some servers (e.g. Azure xSMB). The previous patch fixed that by avoiding incorrectly sending the netname context when there would be a null hostname sent in the netname context, while this patch fixes the null hostname for the secondary channel by using the hostname of the primary channel for the secondary channel. Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels") Signed-off-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 13f28c2cf0701eaf3b251a57b46bca0fe17248ca Author: Vadim Fedorenko Date: Wed Jun 22 02:31:31 2022 +0300 MAINTAINERS: Add a maintainer for OCP Time Card I've been contributing and reviewing patches for ptp_ocp driver for some time and I'm taking care of it's github mirror. On Jakub's suggestion, I would like to step forward and become a maintainer for this driver. This patch adds a dedicated entry to MAINTAINERS. Signed-off-by: Vadim Fedorenko Acked-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220621233131.21240-1-vfedorenko@novek.ru Signed-off-by: Jakub Kicinski commit db7cfc380900bc4243b09623fd72fabe0a8ff23b Author: Alexey Gladkov Date: Wed Jun 22 22:07:29 2022 +0200 ipc: Free mq_sysctls if ipc namespace creation failed The problem that Dmitry Vyukov pointed out is that if setup_ipc_sysctls fails, mq_sysctls must be freed before return. executing program BUG: memory leak unreferenced object 0xffff888112fc9200 (size 512): comm "syz-executor237", pid 3648, jiffies 4294970469 (age 12.270s) hex dump (first 32 bytes): ef d3 60 85 ff ff ff ff 0c 9b d2 12 81 88 ff ff ..`............. 04 00 00 00 a4 01 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmemdup+0x23/0x50 mm/util.c:129 [] kmemdup include/linux/fortify-string.h:456 [inline] [] setup_mq_sysctls+0x4b/0x1c0 ipc/mq_sysctl.c:89 [] create_ipc_ns ipc/namespace.c:63 [inline] [] copy_ipcs+0x292/0x390 ipc/namespace.c:91 [] create_new_namespaces+0xdc/0x4f0 kernel/nsproxy.c:90 [] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226 [] ksys_unshare+0x2fe/0x600 kernel/fork.c:3165 [] __do_sys_unshare kernel/fork.c:3236 [inline] [] __se_sys_unshare kernel/fork.c:3234 [inline] [] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3234 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 BUG: memory leak unreferenced object 0xffff888112fd5f00 (size 256): comm "syz-executor237", pid 3648, jiffies 4294970469 (age 12.270s) hex dump (first 32 bytes): 00 92 fc 12 81 88 ff ff 00 00 00 00 01 00 00 00 ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:605 [inline] [] kzalloc include/linux/slab.h:733 [inline] [] __register_sysctl_table+0x7b/0x7f0 fs/proc/proc_sysctl.c:1344 [] setup_mq_sysctls+0x12a/0x1c0 ipc/mq_sysctl.c:112 [] create_ipc_ns ipc/namespace.c:63 [inline] [] copy_ipcs+0x292/0x390 ipc/namespace.c:91 [] create_new_namespaces+0xdc/0x4f0 kernel/nsproxy.c:90 [] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226 [] ksys_unshare+0x2fe/0x600 kernel/fork.c:3165 [] __do_sys_unshare kernel/fork.c:3236 [inline] [] __se_sys_unshare kernel/fork.c:3234 [inline] [] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3234 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 BUG: memory leak unreferenced object 0xffff888112fbba00 (size 256): comm "syz-executor237", pid 3648, jiffies 4294970469 (age 12.270s) hex dump (first 32 bytes): 78 ba fb 12 81 88 ff ff 00 00 00 00 01 00 00 00 x............... 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:605 [inline] [] kzalloc include/linux/slab.h:733 [inline] [] new_dir fs/proc/proc_sysctl.c:978 [inline] [] get_subdir fs/proc/proc_sysctl.c:1022 [inline] [] __register_sysctl_table+0x5a9/0x7f0 fs/proc/proc_sysctl.c:1373 [] setup_mq_sysctls+0x12a/0x1c0 ipc/mq_sysctl.c:112 [] create_ipc_ns ipc/namespace.c:63 [inline] [] copy_ipcs+0x292/0x390 ipc/namespace.c:91 [] create_new_namespaces+0xdc/0x4f0 kernel/nsproxy.c:90 [] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226 [] ksys_unshare+0x2fe/0x600 kernel/fork.c:3165 [] __do_sys_unshare kernel/fork.c:3236 [inline] [] __se_sys_unshare kernel/fork.c:3234 [inline] [] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3234 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 BUG: memory leak unreferenced object 0xffff888112fbb900 (size 256): comm "syz-executor237", pid 3648, jiffies 4294970469 (age 12.270s) hex dump (first 32 bytes): 78 b9 fb 12 81 88 ff ff 00 00 00 00 01 00 00 00 x............... 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:605 [inline] [] kzalloc include/linux/slab.h:733 [inline] [] new_dir fs/proc/proc_sysctl.c:978 [inline] [] get_subdir fs/proc/proc_sysctl.c:1022 [inline] [] __register_sysctl_table+0x5a9/0x7f0 fs/proc/proc_sysctl.c:1373 [] setup_mq_sysctls+0x12a/0x1c0 ipc/mq_sysctl.c:112 [] create_ipc_ns ipc/namespace.c:63 [inline] [] copy_ipcs+0x292/0x390 ipc/namespace.c:91 [] create_new_namespaces+0xdc/0x4f0 kernel/nsproxy.c:90 [] unshare_nsproxy_namespaces+0x9b/0x120 kernel/nsproxy.c:226 [] ksys_unshare+0x2fe/0x600 kernel/fork.c:3165 [] __do_sys_unshare kernel/fork.c:3236 [inline] [] __se_sys_unshare kernel/fork.c:3234 [inline] [] __x64_sys_unshare+0x12/0x20 kernel/fork.c:3234 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Reported-by: syzbot+b4b0d1b35442afbf6fd2@syzkaller.appspotmail.com Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/000000000000f5004705e1db8bad@google.com Link: https://lkml.kernel.org/r/20220622200729.2639663-1-legion@kernel.org Signed-off-by: Eric W. Biederman commit e84131a88a8cdcd6fe9f234ed98e3f8ca049142b Author: Joshua Ashton Date: Thu Jun 16 01:21:27 2022 +0000 amd/display/dc: Fix COLOR_ENCODING and COLOR_RANGE doing nothing for DCN20+ For DCN20 and above, the code that actually hooks up the provided input_color_space got lost at some point. Fixes COLOR_ENCODING and COLOR_RANGE doing nothing on DCN20+. Tested using Steam Remote Play Together + gamescope. Update other DCNs the same wasy DCN1.x was updates in commit a1e07ba89d49 ("drm/amd/display: Use plane->color_space for dpp if specified") Fixes: a1e07ba89d49 ("drm/amd/display: Use plane->color_space for dpp if specified") Signed-off-by: Joshua Ashton Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 98b02e9f002b21944176774cf420c4d674f6201c Author: George Shen Date: Thu Oct 7 15:59:44 2021 -0400 drm/amd/display: Fix typo in override_lane_settings [Why] The function currently skips overriding the drive settings of the first lane. [How] Change for loop to start at 0 instead of 1. Tested-by: Daniel Wheeler Reviewed-by: Wenjing Liu Acked-by: Alan Liu Signed-off-by: George Shen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 235870f659687b48b12c28f9427e6ca39dcaa81e Author: Qingqing Zhuo Date: Fri Jun 10 10:43:53 2022 -0400 drm/amd/display: Fix DC warning at driver load [Why] Wrong index was checked for dcfclk_mhz, causing false warning. [How] Fix the assertion index. Tested-by: Daniel Wheeler Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit 937e24b7f5595566a64e0f856ebab9147f2e4d1b Author: Mario Limonciello Date: Wed Jun 15 17:30:05 2022 -0500 drm/amd: Revert "drm/amd/display: keep eDP Vdd on when eDP stream is already enabled" A variety of Lenovo machines with Rembrandt APUs and OLED panels have stopped showing the display at login. This behavior clears up after leaving it idle and moving the mouse or touching keyboard. It was bisected to be caused by commit 559e2655220d ("drm/amd/display: keep eDP Vdd on when eDP stream is already enabled"). Revert this commit to fix the issue. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2047 Reported-by: Aaron Ma Fixes: 559e2655220d ("drm/amd/display: keep eDP Vdd on when eDP stream is already enabled") Signed-off-by: Mario Limonciello Tested-by: Mark Pearson Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f15345a377c6ea9c7cc74f079616af8856aff37f Author: Alex Deucher Date: Thu May 19 10:21:08 2022 -0400 drm/amdgpu: Adjust logic around GTT size (v3) Certain GL unit tests for large textures can cause problems with the OOM killer since there is no way to link this memory to a process. This was originally mitigated (but not necessarily eliminated) by limiting the GTT size. The problem is this limit is often too low for many modern games so just make the limit 1/2 of system memory. The OOM accounting needs to be addressed, but we shouldn't prevent common 3D applications from being usable just to potentially mitigate that corner case. Set default GTT size to max(3G, 1/2 of system ram) by default. v2: drop previous logic and default to 3/4 of ram v3: default to half of ram to align with ttm v4: fix spelling in comment (Kent) Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1942 Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher commit de5c208d533a46a074eb46ea17f672cc005a7269 Merge: 3abc3ae553c7e 9b4d5c01eb234 Author: Linus Torvalds Date: Wed Jun 22 14:08:06 2022 -0500 Merge tag 'linux-kselftest-fixes-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Compile time fixes and run-time resources leaks: - Fix clang cross compilation - Fix resource leak when return error - fix compile error for dma_map_benchmark - Fix regression - make use of GUP_TEST_FILE macro" * tag 'linux-kselftest-fixes-5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: make use of GUP_TEST_FILE macro selftests: vm: Fix resource leak when return error selftests dma: fix compile error for dma_map_benchmark selftests: Fix clang cross compilation commit 1e70212e031528918066a631c9fdccda93a1ffaa Author: Kees Cook Date: Wed Jun 15 22:23:12 2022 -0700 hinic: Replace memcpy() with direct assignment Under CONFIG_FORTIFY_SOURCE=y and CONFIG_UBSAN_BOUNDS=y, Clang is bugged here for calculating the size of the destination buffer (0x10 instead of 0x14). This copy is a fixed size (sizeof(struct fw_section_info_st)), with the source and dest being struct fw_section_info_st, so the memcpy should be safe, assuming the index is within bounds, which is UBSAN_BOUNDS's responsibility to figure out. Avoid the whole thing and just do a direct assignment. This results in no change to the executable code. [This is a duplicate of commit 2c0ab32b73cf ("hinic: Replace memcpy() with direct assignment") which was applied to net-next.] Cc: Nick Desaulniers Cc: Tom Rix Cc: llvm@lists.linux.dev Link: https://github.com/ClangBuiltLinux/linux/issues/1592 Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Tested-by: Nathan Chancellor # build Link: https://lore.kernel.org/r/20220616052312.292861-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 627ce0d68eb4b53e995b08089fa9da1e513ec5ba Author: Tim Crawford Date: Wed Jun 22 09:00:17 2022 -0600 ALSA: hda/realtek: Add quirk for Clevo NS50PU Fixes headset detection on Clevo NS50PU. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220622150017.9897-1-tcrawford@system76.com Signed-off-by: Takashi Iwai commit cb5177336ecb07fe1c6804306fe8efc827643c64 Author: Jiang Jian Date: Wed Jun 22 02:55:38 2022 +0800 video: fbdev: omap: Remove duplicate 'the' in comment Signed-off-by: Jiang Jian Signed-off-by: Helge Deller commit bdc48fd571a7bb0aecb9d101d78b29a05f217c72 Author: Jiang Jian Date: Tue Jun 21 14:49:04 2022 +0800 video: fbdev: omapfb: Align '*' in comment Consider '*' alignment in comments Signed-off-by: Jiang Jian Signed-off-by: Helge Deller commit 85016f66af8506cb601fd4f4fde23ed327a266be Author: Saud Farooqui Date: Wed Jun 22 13:59:17 2022 +0500 drm/sun4i: Return if frontend is not present Added return statement in sun4i_layer_format_mod_supported() in case frontend is not present. Signed-off-by: Saud Farooqui Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/PA4P189MB1421E93EF5F8E8E00E71B7878BB29@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM commit 3026b5ca06fa872147f9726ca7c1f658bae71abf Author: Dan Carpenter Date: Wed Jun 22 15:25:15 2022 +0300 drm/vc4: fix error code in vc4_check_tex_size() The vc4_check_tex_size() function is supposed to return false on error but this error path accidentally returns -ENODEV (which means true). Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711") Signed-off-by: Dan Carpenter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/YrMKK89/viQiaiAg@kili commit 9f7d09fe23a0112c08d2326d9116fccb5a912660 Author: Yoshihiro Shimoda Date: Fri Jun 17 10:01:07 2022 +0900 iommu/ipmmu-vmsa: Fix compatible for rcar-gen4 Fix compatible string for R-Car Gen4. Fixes: ae684caf465b ("iommu/ipmmu-vmsa: Add support for R-Car Gen4") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220617010107.3229784-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Joerg Roedel commit 3abc3ae553c7ed73365b385b9a4cffc5176aae45 Merge: ca1fdab7fd27e b0017602fdf6b Author: Linus Torvalds Date: Wed Jun 22 08:09:49 2022 -0500 Merge tag '9p-for-5.19-rc4' of https://github.com/martinetd/linux Pull 9pfs fixes from Dominique Martinet: "A couple of fid refcount and fscache fixes: - fid refcounting was incorrect in some corner cases and would leak resources, only freed at umount time. The first three commits fix three such cases - 'cache=loose' or fscache was broken when trying to write a partial page to a file with no read permission since the rework a few releases ago. The fix taken here is just to restore old behavior of using the special 'writeback_fid' for such reads, which is open as root/RDWR and such not get complains that we try to read on a WRONLY fid. Long-term it'd be nice to get rid of this and not issue the read at all (skip cache?) in such cases, but that direction hasn't progressed" * tag '9p-for-5.19-rc4' of https://github.com/martinetd/linux: 9p: fix EBADF errors in cached mode 9p: Fix refcounting during full path walks for fid lookups 9p: fix fid refcount leak in v9fs_vfs_get_link 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl commit 877fe9d49b74e5f84346f9df34e2c7f8086dbceb Author: Jakub Kicinski Date: Mon Jun 20 12:12:37 2022 -0700 Revert "drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c" This reverts commit 8fc74d18639a2402ca52b177e990428e26ea881f. BAR0 is the main (only?) register bank for this device. We most obviously can't unmap it before the netdev is unregistered. This was pointed out in review but the patch got reposted and merged, anyway. The author of the patch was only testing it with a QEMU model, which I presume does not emulate enough for the netdev to be brought up (author's replies are not visible in lore because they kept sending their emails in HTML). Link: https://lore.kernel.org/all/20220616085059.680dc215@kernel.org/ Fixes: 8fc74d18639a ("drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 3f05010f243be06478a9b11cfce0ce994f5a0890 Author: Aidan MacDonald Date: Mon Jun 20 21:05:57 2022 +0100 regmap-irq: Fix offset/index mismatch in read_sub_irq_data() We need to divide the sub-irq status register offset by register stride to get an index for the status buffer to avoid an out of bounds write when the register stride is greater than 1. Fixes: a2d21848d921 ("regmap: regmap-irq: Add main status register support") Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220620200644.1961936-3-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown commit 485037ae9a095491beb7f893c909a76cc4f9d1e7 Author: Aidan MacDonald Date: Mon Jun 20 21:05:56 2022 +0100 regmap-irq: Fix a bug in regmap_irq_enable() for type_in_mask chips When enabling a type_in_mask irq, the type_buf contents must be AND'd with the mask of the IRQ we're enabling to avoid enabling other IRQs by accident, which can happen if several type_in_mask irqs share a mask register. Fixes: bc998a730367 ("regmap: irq: handle HW using separate rising/falling edge interrupts") Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220620200644.1961936-2-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown commit f3eac426657d985b97c92fa5f7ae1d43f04721f3 Author: Jason A. Donenfeld Date: Tue Jun 21 16:08:49 2022 +0200 powerpc/powernv: wire up rng during setup_arch The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Complicating things, however, is that POWER8 systems need some per-cpu state and kmalloc, which isn't available at this stage. So we split things up into an early phase and a later opportunistic phase. This commit also removes some noisy log messages that don't add much. Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Jason A. Donenfeld Reviewed-by: Christophe Leroy [mpe: Add of_node_put(), use pnv naming, minor change log editing] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220621140849.127227-1-Jason@zx2c4.com commit f5aa16807aa4f99293044944590dde81364f434f Author: Jernej Skrabec Date: Mon Jun 20 20:13:33 2022 +0200 drm/sun4i: Add DMA mask and segment size Kernel occasionally complains that there is mismatch in segment size when trying to render HW decoded videos and rendering them directly with sun4i DRM driver. Following message can be observed on H6 SoC: [ 184.298308] ------------[ cut here ]------------ [ 184.298326] DMA-API: sun4i-drm display-engine: mapping sg segment longer than device claims to support [len=6144000] [max=65536] [ 184.298364] WARNING: CPU: 1 PID: 382 at kernel/dma/debug.c:1162 debug_dma_map_sg+0x2b0/0x350 [ 184.322997] CPU: 1 PID: 382 Comm: ffmpeg Not tainted 5.19.0-rc1+ #1331 [ 184.329533] Hardware name: Tanix TX6 (DT) [ 184.333544] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 184.340512] pc : debug_dma_map_sg+0x2b0/0x350 [ 184.344882] lr : debug_dma_map_sg+0x2b0/0x350 [ 184.349250] sp : ffff800009f33a50 [ 184.352567] x29: ffff800009f33a50 x28: 0000000000010000 x27: ffff000001b86c00 [ 184.359725] x26: ffffffffffffffff x25: ffff000005d8cc80 x24: 0000000000000000 [ 184.366879] x23: ffff80000939ab18 x22: 0000000000000001 x21: 0000000000000001 [ 184.374031] x20: 0000000000000000 x19: ffff0000018a7410 x18: ffffffffffffffff [ 184.381186] x17: 0000000000000000 x16: 0000000000000000 x15: ffffffffffffffff [ 184.388338] x14: 0000000000000001 x13: ffff800009534e86 x12: 6f70707573206f74 [ 184.395493] x11: 20736d69616c6320 x10: 000000000000000a x9 : 0000000000010000 [ 184.402647] x8 : ffff8000093b6d40 x7 : ffff800009f33850 x6 : 000000000000000c [ 184.409800] x5 : ffff0000bf997940 x4 : 0000000000000000 x3 : 0000000000000027 [ 184.416953] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000003960e80 [ 184.424106] Call trace: [ 184.426556] debug_dma_map_sg+0x2b0/0x350 [ 184.430580] __dma_map_sg_attrs+0xa0/0x110 [ 184.434687] dma_map_sgtable+0x28/0x4c [ 184.438447] vb2_dc_dmabuf_ops_map+0x60/0xcc [ 184.442729] __map_dma_buf+0x2c/0xd4 [ 184.446321] dma_buf_map_attachment+0xa0/0x130 [ 184.450777] drm_gem_prime_import_dev+0x7c/0x18c [ 184.455410] drm_gem_prime_fd_to_handle+0x1b8/0x214 [ 184.460300] drm_prime_fd_to_handle_ioctl+0x2c/0x40 [ 184.465190] drm_ioctl_kernel+0xc4/0x174 [ 184.469123] drm_ioctl+0x204/0x420 [ 184.472534] __arm64_sys_ioctl+0xac/0xf0 [ 184.476474] invoke_syscall+0x48/0x114 [ 184.480240] el0_svc_common.constprop.0+0x44/0xec [ 184.484956] do_el0_svc+0x2c/0xc0 [ 184.488283] el0_svc+0x2c/0x84 [ 184.491354] el0t_64_sync_handler+0x11c/0x150 [ 184.495723] el0t_64_sync+0x18c/0x190 [ 184.499397] ---[ end trace 0000000000000000 ]--- Fix that by setting DMA mask and segment size. Signed-off-by: Jernej Skrabec Reviewed-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220620181333.650301-1-jernej.skrabec@gmail.com commit 5f940e528da6bce52a86fbdf881b76f60240aeaf Author: Saud Farooqui Date: Thu Jun 9 23:50:31 2022 +0500 drm/vc4: hdmi: Fixed possible integer overflow Multiplying ints and saving it in unsigned long long could lead to integer overflow before being type casted to unsigned long long. Addresses-Coverity: 1505113: Unintentional integer overflow. Signed-off-by: Saud Farooqui Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/PA4P189MB1421E63C0FF3EBF234A80AB38BA79@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM commit 33b29dbb39bcbd0a96e440646396bbf670b914fa Author: Yonglin Tan Date: Tue Jun 21 20:37:53 2022 +0800 USB: serial: option: add Quectel EM05-G modem The EM05-G modem has 2 USB configurations that are configurable via the AT command AT+QCFG="usbnet",[ 0 | 2 ] which make the modem enumerate with the following interfaces, respectively: "RMNET" : AT + DIAG + NMEA + Modem + QMI "MBIM" : MBIM + AT + DIAG + NMEA + Modem The detailed description of the USB configuration for each mode as follows: RMNET Mode -------------- T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 21 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=030a Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 3 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#= 4 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#= 5 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#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) 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 MBIM Mode -------------- T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=030a Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 3 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#= 4 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#= 5 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#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=89(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=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Yonglin Tan Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit ae60aac59a9ad8ab64a4b07de509a534a75b6bac Author: Johan Hovold Date: Tue Jun 21 10:58:55 2022 +0200 USB: serial: pl2303: add support for more HXN (G) types Add support for further HXN (G) type devices (GT variant, GL variant, GS variant and GR) and document the bcdDevice mapping. Note that the TA and TB types use the same bcdDevice as some GT and GE variants, respectively, but that the HX status request can be used to determine which is which. Also note that we currently do not distinguish between the various HXN (G) types in the driver but that this may change eventually (e.g. when adding GPIO support). Reported-by: Charles Yeh Link: https://lore.kernel.org/r/YrF77b9DdeumUAee@hovoldconsulting.com Cc: stable@vger.kernel.org # 5.13 Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit 53664d51d3510e1d4092e539c5928fc9951f63b0 Merge: 2642cc6c3bbe0 fcd53c51d0370 Author: Jakub Kicinski Date: Tue Jun 21 22:41:40 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Use get_random_u32() instead of prandom_u32_state() in nft_meta and nft_numgen, from Florian Westphal. 2) Incorrect list head in nfnetlink_cttimeout in recent update coming from previous development cycle. Also from Florian. 3) Incorrect path to pktgen scripts for nft_concat_range.sh selftest. From Jie2x Zhou. 4) Two fixes for the for nft_fwd and nft_dup egress support, from Florian. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_dup_netdev: add and use recursion counter netfilter: nf_dup_netdev: do not push mac header a second time selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh netfilter: cttimeout: fix slab-out-of-bounds read typo in cttimeout_net_exit netfilter: use get_random_u32 instead of prandom ==================== Link: https://lore.kernel.org/r/20220621085618.3975-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 2642cc6c3bbe0900ba15bab078fd15ad8baccbc5 Author: Lukas Wunner Date: Mon Jun 20 13:04:50 2022 +0200 net: phy: smsc: Disable Energy Detect Power-Down in interrupt mode Simon reports that if two LAN9514 USB adapters are directly connected without an intermediate switch, the link fails to come up and link LEDs remain dark. The issue was introduced by commit 1ce8b37241ed ("usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling"). The PHY suffers from a known erratum wherein link detection becomes unreliable if Energy Detect Power-Down is used. In poll mode, the driver works around the erratum by briefly disabling EDPD for 640 msec to detect a neighbor, then re-enabling it to save power. In interrupt mode, no interrupt is signaled if EDPD is used by both link partners, so it must not be enabled at all. We'll recoup the power savings by enabling SUSPEND1 mode on affected LAN95xx chips in a forthcoming commit. Fixes: 1ce8b37241ed ("usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling") Reported-by: Simon Han Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/439a3f3168c2f9d44b5fd9bb8d2b551711316be6.1655714438.git.lukas@wunner.de Signed-off-by: Jakub Kicinski commit c0737fa9a5a5cf5a053bcc983f72d58919b997c6 Author: Pavel Begunkov Date: Wed Jun 22 00:00:37 2022 +0100 io_uring: fix double poll leak on repolling We have re-polling for partial IO, so a request can be polled twice. If it used two poll entries the first time then on the second io_arm_poll_handler() it will find the old apoll entry and NULL kmalloc()'ed second entry, i.e. apoll->double_poll, so leaking it. Fixes: 10c873334feba ("io_uring: allow re-poll if we made progress") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fee2452494222ecc7f1f88c8fb659baef971414a.1655852245.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 9d2ad2947a53abf5e5e6527a9eeed50a3a4cbc72 Author: Pavel Begunkov Date: Wed Jun 22 00:00:36 2022 +0100 io_uring: fix wrong arm_poll error handling Leaving ip.error set when a request was punted to task_work execution is problematic, don't forget to clear it. Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a6c84ef4182c6962380aebe11b35bdcb25b0ccfb.1655852245.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c487a5ad48831afa6784b368ec40d0ee50f2fe1b Author: Pavel Begunkov Date: Wed Jun 22 00:00:35 2022 +0100 io_uring: fail links when poll fails Don't forget to cancel all linked requests of poll request when __io_arm_poll_handler() failed. Fixes: aa43477b04025 ("io_uring: poll rework") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a78aad962460f9fdfe4aa4c0b62425c88f9415bc.1655852245.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a632b2a4c920ce5af29410fb091f7ee6d2e77dc6 Author: Anatolii Gerasymenko Date: Mon Jun 6 09:01:21 2022 +0200 ice: ethtool: Prohibit improper channel config for DCB Do not allow setting less channels, than Traffic Classes there are via ethtool. There must be at least one channel per Traffic Class. If you set less channels, than Traffic Classes there are, then during ice_vsi_rebuild there would be allocated only the requested amount of tx/rx rings in ice_vsi_alloc_arrays. But later in ice_vsi_setup_q_map there would be requested at least one channel per Traffic Class. This results in setting num_rxq > alloc_rxq and num_txq > alloc_txq. Later, there would be a NULL pointer dereference in ice_vsi_map_rings_to_vectors, because we go beyond of rx_rings or tx_rings arrays. Change ice_set_channels() to return error if you try to allocate less channels, than Traffic Classes there are. Change ice_vsi_setup_q_map() and ice_vsi_setup_q_map_mqprio() to return status code instead of void. Add error handling for ice_vsi_setup_q_map() and ice_vsi_setup_q_map_mqprio() in ice_vsi_init() and ice_vsi_cfg_tc(). [53753.889983] INFO: Flow control is disabled for this traffic class (0) on this vsi. [53763.984862] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028 [53763.992915] PGD 14b45f5067 P4D 0 [53763.996444] Oops: 0002 [#1] SMP NOPTI [53764.000312] CPU: 12 PID: 30661 Comm: ethtool Kdump: loaded Tainted: GOE --------- - - 4.18.0-240.el8.x86_64 #1 [53764.011825] Hardware name: Intel Corporation WilsonCity/WilsonCity, BIOS WLYDCRB1.SYS.0020.P21.2012150710 12/15/2020 [53764.022584] RIP: 0010:ice_vsi_map_rings_to_vectors+0x7e/0x120 [ice] [53764.029089] Code: 41 0d 0f b7 b7 12 05 00 00 0f b6 d0 44 29 de 44 0f b7 c6 44 01 c2 41 39 d0 7d 2d 4c 8b 47 28 44 0f b7 ce 83 c6 01 4f 8b 04 c8 <49> 89 48 28 4 c 8b 89 b8 01 00 00 4d 89 08 4c 89 81 b8 01 00 00 44 [53764.048379] RSP: 0018:ff550dd88ea47b20 EFLAGS: 00010206 [53764.053884] RAX: 0000000000000002 RBX: 0000000000000004 RCX: ff385ea42fa4a018 [53764.061301] RDX: 0000000000000006 RSI: 0000000000000005 RDI: ff385e9baeedd018 [53764.068717] RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000004 [53764.076133] R10: 0000000000000002 R11: 0000000000000004 R12: 0000000000000000 [53764.083553] R13: 0000000000000000 R14: ff385e658fdd9000 R15: ff385e9baeedd018 [53764.090976] FS: 000014872c5b5740(0000) GS:ff385e847f100000(0000) knlGS:0000000000000000 [53764.099362] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [53764.105409] CR2: 0000000000000028 CR3: 0000000a820fa002 CR4: 0000000000761ee0 [53764.112851] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [53764.120301] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [53764.127747] PKRU: 55555554 [53764.130781] Call Trace: [53764.133564] ice_vsi_rebuild+0x611/0x870 [ice] [53764.138341] ice_vsi_recfg_qs+0x94/0x100 [ice] [53764.143116] ice_set_channels+0x1a8/0x3e0 [ice] [53764.147975] ethtool_set_channels+0x14e/0x240 [53764.152667] dev_ethtool+0xd74/0x2a10 [53764.156665] ? __mod_lruvec_state+0x44/0x110 [53764.161280] ? __mod_lruvec_state+0x44/0x110 [53764.165893] ? page_add_file_rmap+0x15/0x170 [53764.170518] ? inet_ioctl+0xd1/0x220 [53764.174445] ? netdev_run_todo+0x5e/0x290 [53764.178808] dev_ioctl+0xb5/0x550 [53764.182485] sock_do_ioctl+0xa0/0x140 [53764.186512] sock_ioctl+0x1a8/0x300 [53764.190367] ? selinux_file_ioctl+0x161/0x200 [53764.195090] do_vfs_ioctl+0xa4/0x640 [53764.199035] ksys_ioctl+0x60/0x90 [53764.202722] __x64_sys_ioctl+0x16/0x20 [53764.206845] do_syscall_64+0x5b/0x1a0 [53764.210887] entry_SYSCALL_64_after_hwframe+0x65/0xca Fixes: 87324e747fde ("ice: Implement ethtool ops for channels") Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 8a66487506161dbc1d22fd154d2de0244e232040 Author: Alison Schofield Date: Fri Feb 25 14:14:56 2022 -0800 cxl/mbox: Use __le32 in get,set_lsa mailbox structures CXL specification defines these as little endian. Fixes: 60b8f17215de ("cxl/pmem: Translate NVDIMM label commands to CXL label commands") Reported-by: Dan Williams Signed-off-by: Alison Schofield Link: https://lore.kernel.org/r/20220225221456.1025635-1-alison.schofield@intel.com Signed-off-by: Dan Williams commit 8ae3cebc1704b9a3ab8398dc7820c37183026bbc Author: Ben Widawsky Date: Fri Mar 4 13:36:45 2022 -0800 cxl/core: Use is_endpoint_decoder Save some characters and directly check decoder type rather than port type. There's no need to check if the port is an endpoint port since, by this point, cxl_endpoint_decoder_alloc() has a specified type. Reviewed by: Adam Manzanares Signed-off-by: Ben Widawsky Signed-off-by: Dan Williams commit db9a3a35d31ea337331f0e6e07e04bcd52642894 Author: Jonathan Cameron Date: Thu Jun 9 14:45:19 2022 +0100 cxl: Fix cleanup of port devices on failure to probe driver. The device is created, and then there is a check if a driver succesfully bound to it. In event of failing the bind (e.g. failure in cxl_port_probe()) the device is left registered. When a bus rescan later occurs, fresh devices are created leading to a multiple device representing the same underlying hardware. Bad things may follow and at very least we have far too many devices. Fix by ensuring autoremove is registered if the device create succeeds, but doesn't depend on sucessful binding to a driver. Bug was observed as side effect of incorrect ownership in [PATCH v9 6/9] cxl/port: Read CDAT table but will result from any failure to in cxl_port_probe(). Fixes: 8dd2bc0f8e02 ("cxl/mem: Add the cxl_mem driver") Signed-off-by: Jonathan Cameron Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220609134519.11668-1-Jonathan.Cameron@huawei.com Signed-off-by: Dan Williams commit c3d184c83ff4b80167e34edfc3d21df424bf27ff Author: Anatolii Gerasymenko Date: Mon Jun 20 09:47:05 2022 +0200 ice: ethtool: advertise 1000M speeds properly In current implementation ice_update_phy_type enables all link modes for selected speed. This approach doesn't work for 1000M speeds, because both copper (1000baseT) and optical (1000baseX) standards cannot be enabled at once. Fix this, by adding the function `ice_set_phy_type_from_speed()` for 1000M speeds. Fixes: 48cb27f2fd18 ("ice: Implement handlers for ethtool PHY/link operations") Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 3748d2185ac4c2c6f80989672253aad909ecaf95 Author: Liang He Date: Tue Jun 21 23:41:25 2022 +0800 mips: lantiq: Add missing of_node_put() in irq.c In icu_of_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 3578dc90013b1fa20da996cdadd8515802716132 Author: Wojciech Drewek Date: Mon May 23 11:41:55 2022 +0200 ice: Fix switchdev rules book keeping Adding two filters with same matching criteria ends up with one rule in hardware with act = ICE_FWD_TO_VSI_LIST. In order to remove them properly we have to keep the information about vsi handle which is used in VSI bitmap (ice_adv_fltr_mgmt_list_entry::vsi_list_info::vsi_map). Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF") Reported-by: Sridhar Samudrala Signed-off-by: Wojciech Drewek Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit f6f0dab5efe4fcabe726f9218a0b3000fee0fa8a Author: Ben Widawsky Date: Fri May 20 11:00:59 2022 -0700 MAINTAINERS: Update Ben's email address I'm leaving Intel. Update email address to korg and add .mailmap entries. For now, I will be taking a reduced role in CXL development, but I still plan to spend time working on it, and I can still serve as a good substitute if needed for maintainer responsibilities (that may change in the future). Signed-off-by: Ben Widawsky Reviewed-by: Alison Schofield Link: https://lore.kernel.org/r/20220520180059.632054-1-bwidawsk@kernel.org Signed-off-by: Dan Williams commit 202773260023b56e868d09d13d3a417028f1ff5b Author: Dmitry Osipenko Date: Fri Jun 17 15:24:02 2022 +0300 PM: hibernate: Use kernel_can_power_off() Use new kernel_can_power_off() API instead of legacy pm_power_off global variable to fix regressed hibernation to disk where machine no longer powers off when it should because ACPI power driver transitioned to the new sys-off based API and it doesn't use pm_power_off anymore. Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") Tested-by: Ken Moffat Reported-by: Ken Moffat Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit d4ea6f6373ef56d1d795a24f1f5874f4a6019199 Author: Marcin Szycik Date: Mon May 9 21:01:18 2022 +0200 ice: ignore protocol field in GTP offload Commit 34a897758efe ("ice: Add support for inner etype in switchdev") added the ability to match on inner ethertype. A side effect of that change is that it is now impossible to add some filters for protocols which do not contain inner ethtype field. tc requires the protocol field to be specified when providing certain other options, e.g. src_ip. This is a problem in case of GTP - when user wants to specify e.g. src_ip, they also need to specify protocol in tc command (otherwise tc fails with: Illegal "src_ip"). Because GTP is a tunnel, the protocol field is treated as inner protocol. GTP does not contain inner ethtype field and the filter cannot be added. To fix this, ignore the ethertype field in case of GTP filters. Fixes: 9a225f81f540 ("ice: Support GTP-U and GTP-C offload in switchdev") Signed-off-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 78ccef91234ba331c04d71f3ecb1377451d21056 Author: Mike Snitzer Date: Tue Jun 21 13:37:06 2022 -0400 dm: do not return early from dm_io_complete if BLK_STS_AGAIN without polling Commit 5291984004edf ("dm: fix bio polling to handle possibile BLK_STS_AGAIN") inadvertently introduced an early return from dm_io_complete() without first queueing the bio to DM if BLK_STS_AGAIN occurs and bio-polling is _not_ being used. Fix this by only returning early from dm_io_complete() if the bio has first been properly queued to DM. Otherwise, the bio will never finish via bio_endio. Fixes: 5291984004edf ("dm: fix bio polling to handle possibile BLK_STS_AGAIN") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit 9ae6e8b1c9bbf6874163d1243e393137313762b7 Author: Nikos Tsironis Date: Tue Jun 21 15:24:03 2022 +0300 dm era: commit metadata in postsuspend after worker stops During postsuspend dm-era does the following: 1. Archives the current era 2. Commits the metadata, as part of the RPC call for archiving the current era 3. Stops the worker Until the worker stops, it might write to the metadata again. Moreover, these writes are not flushed to disk immediately, but are cached by the dm-bufio client, which writes them back asynchronously. As a result, the committed metadata of a suspended dm-era device might not be consistent with the in-core metadata. In some cases, this can result in the corruption of the on-disk metadata. Suppose the following sequence of events: 1. Load a new table, e.g. a snapshot-origin table, to a device with a dm-era table 2. Suspend the device 3. dm-era commits its metadata, but the worker does a few more metadata writes until it stops, as part of digesting an archived writeset 4. These writes are cached by the dm-bufio client 5. Load the dm-era table to another device. 6. The new instance of the dm-era target loads the committed, on-disk metadata, which don't include the extra writes done by the worker after the metadata commit. 7. Resume the new device 8. The new dm-era target instance starts using the metadata 9. Resume the original device 10. The destructor of the old dm-era target instance is called and destroys the dm-bufio client, which results in flushing the cached writes to disk 11. These writes might overwrite the writes done by the new dm-era instance, hence corrupting its metadata. Fix this by committing the metadata after the worker stops running. stop_worker uses flush_workqueue to flush the current work. However, the work item may re-queue itself and flush_workqueue doesn't wait for re-queued works to finish. This could result in the worker changing the metadata after they have been committed, or writing to the metadata concurrently with the commit in the postsuspend thread. Use drain_workqueue instead, which waits until the work and all re-queued works finish. Fixes: eec40579d8487 ("dm: add era target") Cc: stable@vger.kernel.org # v3.15+ Signed-off-by: Nikos Tsironis Signed-off-by: Mike Snitzer commit ca1fdab7fd27eb069df1384b2850dcd0c2bebe8d Merge: 0273fd423b2fe aa6d1ed107eba Author: Linus Torvalds Date: Tue Jun 21 12:20:11 2022 -0500 Merge tag 'efi-urgent-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - remove pointless include of asm/efi.h, which does not exist on ia64 - fix DXE service marshalling prototype for mixed mode * tag 'efi-urgent-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi/x86: libstub: Fix typo in __efi64_argmap* name efi: sysfb_efi: remove unnecessary include commit 0273fd423b2fe10af96ff713273137c63a7736c0 Merge: ff872b76b3d89 3cde3174eb910 Author: Linus Torvalds Date: Tue Jun 21 12:13:53 2022 -0500 Merge tag 'certs-20220621' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull signature checking selftest from David Howells: "The signature checking code, as used by module signing, kexec, etc., is non-FIPS compliant as there is no selftest. For a kernel to be FIPS-compliant, signature checking would have to be tested before being used, and the box would need to panic if it's not available (probably reasonable as simply disabling signature checking would prevent you from loading any driver modules). Deal with this by adding a minimal test. This is split into two patches: the first moves load_certificate_list() to the same place as the X.509 code to make it more accessible internally; the second adds a selftest" * tag 'certs-20220621' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: certs: Add FIPS selftests certs: Move load_certificate_list() to be with the asymmetric keys code commit ff872b76b3d89a09a997cc45c133e4a3ddc12f90 Merge: cb78d1b5efffe e3a4167c880cf Author: Linus Torvalds Date: Tue Jun 21 12:06:04 2022 -0500 Merge tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - print more error messages for invalid mount option values - prevent remount with v1 space cache for subpage filesystem - fix hang during unmount when block group reclaim task is running * tag 'for-5.19-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: add error messages to all unrecognized mount options btrfs: prevent remounting to v1 space cache for subpage mount btrfs: fix hang during unmount when block group reclaim task is running commit 2645672ffe21f0a1c139bfbc05ad30fd4e4f2583 Author: Jens Axboe Date: Tue Jun 21 10:03:57 2022 -0600 block: pop cached rq before potentially blocking rq_qos_throttle() If rq_qos_throttle() ends up blocking, then we will have invalidated and flushed our current plug. Since blk_mq_get_cached_request() hasn't popped the cached request off the plug list just yet, we end holding a pointer to a request that is no longer valid. This insta-crashes with rq->mq_hctx being NULL in the validity checks just after. Pop the request off the cached list before doing rq_qos_throttle() to avoid using a potentially stale request. Fixes: 0a5aa8d161d1 ("block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection") Reported-by: Dylan Yudaken Tested-by: Dylan Yudaken Signed-off-by: Jens Axboe commit cb78d1b5efffe4cf97e16766329dd7358aed3deb Author: David Howells Date: Tue Jun 21 15:59:57 2022 +0100 afs: Fix dynamic root getattr The recent patch to make afs_getattr consult the server didn't account for the pseudo-inodes employed by the dynamic root-type afs superblock not having a volume or a server to access, and thus an oops occurs if such a directory is stat'd. Fix this by checking to see if the vnode->volume pointer actually points anywhere before following it in afs_getattr(). This can be tested by stat'ing a directory in /afs. It may be sufficient just to do "ls /afs" and the oops looks something like: BUG: kernel NULL pointer dereference, address: 0000000000000020 ... RIP: 0010:afs_getattr+0x8b/0x14b ... Call Trace: vfs_statx+0x79/0xf5 vfs_fstatat+0x49/0x62 Fixes: 2aeb8c86d499 ("afs: Fix afs_getattr() to refetch file status if callback break occurred") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/165408450783.1031787.7941404776393751186.stgit@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds commit aa6d1ed107eba26f49933216cffe797253914132 Author: Evgeniy Baskov Date: Thu Jun 9 14:37:30 2022 +0300 efi/x86: libstub: Fix typo in __efi64_argmap* name The actual name of the DXE services function used is set_memory_space_attributes(), not set_memory_space_descriptor(). Change EFI mixed mode helper macro name to match the function name. Fixes: 31f1a0edff78 ("efi/x86: libstub: Make DXE calls mixed mode safe") Signed-off-by: Evgeniy Baskov Signed-off-by: Ard Biesheuvel commit 34705a57e7df97d161324263c103c4d4d120dfe7 Author: Javier Martinez Canillas Date: Fri Jun 10 11:00:05 2022 +0200 efi: sysfb_efi: remove unnecessary include Nothing defined in the header is used by drivers/firmware/efi/sysfb_efi.c but also, including it can lead to build errors when built on arches that don't have an asm/efi.h header file. This can happen for example if a driver that is built when COMPILE_TEST is enabled selects the SYSFB symbol, e.g. on powerpc with allyesconfig: drivers/firmware/efi/sysfb_efi.c:29:10: fatal error: asm/efi.h: No such file or directory 29 | #include | ^~~~~~~~~~~ Reported-by: Stephen Rothwell Signed-off-by: Javier Martinez Canillas Signed-off-by: Ard Biesheuvel commit 82c7863ed95d0914f02c7c8c011200a763bc6725 Author: Jaegeuk Kim Date: Sat Jun 18 00:42:24 2022 -0700 f2fs: do not count ENOENT for error case Otherwise, we can get a wrong cp_error mark. Cc: Fixes: a7b8618aa2f0 ("f2fs: avoid infinite loop to flush node pages") Signed-off-by: Jaegeuk Kim commit db30dc1a5226eb74d52f748989e9a06451333678 Author: Aidan MacDonald Date: Fri Jun 17 13:18:05 2022 +0100 mips: dts: ingenic: Add TCU clock to x1000/x1830 tcu device node This clock is a gate for the TCU hardware block on these SoCs, but it wasn't included in the device tree since the ingenic-tcu driver erroneously did not request it. Reviewed-by: Paul Cercueil Signed-off-by: Aidan MacDonald Signed-off-by: Thomas Bogendoerfer commit 3cde3174eb910513d32a9ec8a9b95ea59be833df Author: David Howells Date: Wed May 18 17:15:34 2022 +0100 certs: Add FIPS selftests Add some selftests for signature checking when FIPS mode is enabled. These need to be done before we start actually using the signature checking for things and must panic the kernel upon failure. Note that the tests must not check the blacklist lest this provide a way to prevent a kernel from booting by installing a hash of a test key in the appropriate UEFI table. Reported-by: Simo Sorce Signed-off-by: David Howells Reviewed-by: Simo Sorce Reviewed-by: Herbert Xu cc: keyrings@vger.kernel.org cc: linux-crypto@vger.kernel.org Link: https://lore.kernel.org/r/165515742832.1554877.2073456606206090838.stgit@warthog.procyon.org.uk/ commit 60050ffe3d770dd1df5b641aa48f49d07a54bd84 Author: David Howells Date: Wed May 18 23:48:09 2022 +0100 certs: Move load_certificate_list() to be with the asymmetric keys code Move load_certificate_list(), which loads a series of binary X.509 certificates from a blob and inserts them as keys into a keyring, to be with the asymmetric keys code that it drives. This makes it easier to add FIPS selftest code in which we need to load up a private keyring for the tests to use. Signed-off-by: David Howells Reviewed-by: Simo Sorce Reviewed-by: Herbert Xu cc: keyrings@vger.kernel.org cc: linux-crypto@vger.kernel.org Link: https://lore.kernel.org/r/165515742145.1554877.13488098107542537203.stgit@warthog.procyon.org.uk/ commit eb9e9bc4fa5fb489c92ec588b3fb35f042ba6d86 Author: Liang He Date: Sun Jun 19 12:54:27 2022 +0800 mips/pic32/pic32mzda: Fix refcount leak bugs of_find_matching_node(), of_find_compatible_node() and of_find_node_by_path() will return node pointers with refcout incremented. We should call of_node_put() when they are not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 76695592711ef1e215cc24ed3e1cd857d7fc3098 Author: Liang He Date: Fri Jun 17 20:25:05 2022 +0800 mips: lantiq: xway: Fix refcount leak bug in sysctrl In ltq_soc_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 72a2af539fff975caadd9a4db3f99963569bd9c9 Author: Liang He Date: Fri Jun 17 20:19:58 2022 +0800 mips: lantiq: falcon: Fix refcount leak bug in sysctrl In ltq_soc_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 48ca54e39173d1ed4c4dc8cf045484014bb26eaf Author: Liang He Date: Fri Jun 17 11:39:29 2022 +0800 mips: ralink: Fix refcount leak in of.c In plat_of_remap_node(), plat_of_remap_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 608d94cb84c42585058d692f2fe5d327f8868cdb Author: Liang He Date: Thu Jun 16 22:27:56 2022 +0800 mips: mti-malta: Fix refcount leak in malta-time.c In update_gic_frequency_dt(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit 4becf6417bbdc293734a590fe4ed38437bbcea2c Author: Liang He Date: Wed Jun 15 22:11:23 2022 +0800 arch: mips: generic: Add missing of_node_put() in board-ranchu.c In ranchu_measure_hpt_freq(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_put_node() when it is not used anymore. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer commit c81aba8fde2aee4f5778ebab3a1d51bd2ef48e4c Author: huhai Date: Fri Jun 10 19:14:20 2022 +0800 MIPS: Remove repetitive increase irq_err_count commit 979934da9e7a ("[PATCH] mips: update IRQ handling for vr41xx") added a function irq_dispatch, and it'll increase irq_err_count when the get_irq callback returns a negative value, but increase irq_err_count in get_irq was not removed. And also, modpost complains once gpio-vr41xx drivers become modules. ERROR: modpost: "irq_err_count" [drivers/gpio/gpio-vr41xx.ko] undefined! So it would be a good idea to remove repetitive increase irq_err_count in get_irq callback. Fixes: 27fdd325dace ("MIPS: Update VR41xx GPIO driver to use gpiolib") Fixes: 979934da9e7a ("[PATCH] mips: update IRQ handling for vr41xx") Reported-by: k2ci Signed-off-by: huhai Signed-off-by: Genjian Zhang Signed-off-by: Thomas Bogendoerfer commit ca6969013d13282b42cb5edcc13db731a08e0ad8 Author: Oleksandr Tyshchenko Date: Mon May 9 16:51:43 2022 +0300 drm/xen: Add missing VM_DONTEXPAND flag in mmap callback With Xen PV Display driver in use the "expected" VM_DONTEXPAND flag is not set (neither explicitly nor implicitly), so the driver hits the code path in drm_gem_mmap_obj() which triggers the WARNING. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Oleksandr Andrushchenko Link: https://lore.kernel.org/r/1652104303-5098-1-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit ecb6237fa397b7b810d798ad19322eca466dbab1 Author: Julien Grall Date: Fri Jun 17 11:30:37 2022 +0100 x86/xen: Remove undefined behavior in setup_features() 1 << 31 is undefined. So switch to 1U << 31. Fixes: 5ead97c84fa7 ("xen: Core Xen implementation") Signed-off-by: Julien Grall Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220617103037.57828-1-julien@xen.org Signed-off-by: Juergen Gross commit f9710c357e5bbf64d7ce45ba0bc75a52222491c1 Author: Jason Andryuk Date: Wed Jun 1 15:53:41 2022 -0400 xen-blkfront: Handle NULL gendisk When a VBD is not fully created and then closed, the kernel can have a NULL pointer dereference: The reproducer is trivial: [user@dom0 ~]$ sudo xl block-attach work backend=sys-usb vdev=xvdi target=/dev/sdz [user@dom0 ~]$ xl block-list work Vdev BE handle state evt-ch ring-ref BE-path 51712 0 241 4 -1 -1 /local/domain/0/backend/vbd/241/51712 51728 0 241 4 -1 -1 /local/domain/0/backend/vbd/241/51728 51744 0 241 4 -1 -1 /local/domain/0/backend/vbd/241/51744 51760 0 241 4 -1 -1 /local/domain/0/backend/vbd/241/51760 51840 3 241 3 -1 -1 /local/domain/3/backend/vbd/241/51840 ^ note state, the /dev/sdz doesn't exist in the backend [user@dom0 ~]$ sudo xl block-detach work xvdi [user@dom0 ~]$ xl block-list work Vdev BE handle state evt-ch ring-ref BE-path work is an invalid domain identifier And its console has: BUG: kernel NULL pointer dereference, address: 0000000000000050 PGD 80000000edebb067 P4D 80000000edebb067 PUD edec2067 PMD 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 52 Comm: xenwatch Not tainted 5.16.18-2.43.fc32.qubes.x86_64 #1 RIP: 0010:blk_mq_stop_hw_queues+0x5/0x40 Code: 00 48 83 e0 fd 83 c3 01 48 89 85 a8 00 00 00 41 39 5c 24 50 77 c0 5b 5d 41 5c 41 5d c3 c3 0f 1f 80 00 00 00 00 0f 1f 44 00 00 <8b> 47 50 85 c0 74 32 41 54 49 89 fc 55 53 31 db 49 8b 44 24 48 48 RSP: 0018:ffffc90000bcfe98 EFLAGS: 00010293 RAX: ffffffffc0008370 RBX: 0000000000000005 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000000 RBP: ffff88800775f000 R08: 0000000000000001 R09: ffff888006e620b8 R10: ffff888006e620b0 R11: f000000000000000 R12: ffff8880bff39000 R13: ffff8880bff39000 R14: 0000000000000000 R15: ffff88800604be00 FS: 0000000000000000(0000) GS:ffff8880f3300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000050 CR3: 00000000e932e002 CR4: 00000000003706e0 Call Trace: blkback_changed+0x95/0x137 [xen_blkfront] ? read_reply+0x160/0x160 xenwatch_thread+0xc0/0x1a0 ? do_wait_intr_irq+0xa0/0xa0 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Modules linked in: snd_seq_dummy snd_hrtimer snd_seq snd_seq_device snd_timer snd soundcore ipt_REJECT nf_reject_ipv4 xt_state xt_conntrack nft_counter nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat nf_tables nfnetlink intel_rapl_msr intel_rapl_common crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel xen_netfront pcspkr xen_scsiback target_core_mod xen_netback xen_privcmd xen_gntdev xen_gntalloc xen_blkback xen_evtchn ipmi_devintf ipmi_msghandler fuse bpf_preload ip_tables overlay xen_blkfront CR2: 0000000000000050 ---[ end trace 7bc9597fd06ae89d ]--- RIP: 0010:blk_mq_stop_hw_queues+0x5/0x40 Code: 00 48 83 e0 fd 83 c3 01 48 89 85 a8 00 00 00 41 39 5c 24 50 77 c0 5b 5d 41 5c 41 5d c3 c3 0f 1f 80 00 00 00 00 0f 1f 44 00 00 <8b> 47 50 85 c0 74 32 41 54 49 89 fc 55 53 31 db 49 8b 44 24 48 48 RSP: 0018:ffffc90000bcfe98 EFLAGS: 00010293 RAX: ffffffffc0008370 RBX: 0000000000000005 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000000 RBP: ffff88800775f000 R08: 0000000000000001 R09: ffff888006e620b8 R10: ffff888006e620b0 R11: f000000000000000 R12: ffff8880bff39000 R13: ffff8880bff39000 R14: 0000000000000000 R15: ffff88800604be00 FS: 0000000000000000(0000) GS:ffff8880f3300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000050 CR3: 00000000e932e002 CR4: 00000000003706e0 Kernel panic - not syncing: Fatal exception Kernel Offset: disabled info->rq and info->gd are only set in blkfront_connect(), which is called for state 4 (XenbusStateConnected). Guard against using NULL variables in blkfront_closing() to avoid the issue. The rest of blkfront_closing looks okay. If info->nr_rings is 0, then for_each_rinfo won't do anything. blkfront_remove also needs to check for non-NULL pointers before cleaning up the gendisk and request queue. Fixes: 05d69d950d9d "xen-blkfront: sanitize the removal state machine" Reported-by: Marek Marczykowski-Górecki Signed-off-by: Jason Andryuk Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220601195341.28581-1-jandryuk@gmail.com Signed-off-by: Juergen Gross commit 9ef165406308515dcf2e3f6e97b39a1c56d86db5 Author: Andy Shevchenko Date: Mon Jun 20 13:43:16 2022 +0300 usb: typec: wcove: Drop wrong dependency to INTEL_SOC_PMIC Intel SoC PMIC is a generic name for all PMICs that are used on Intel platforms. In particular, INTEL_SOC_PMIC kernel configuration option refers to Crystal Cove PMIC, which has never been a part of any Intel Broxton hardware. Drop wrong dependency from Kconfig. Note, the correct dependency is satisfied via ACPI PMIC OpRegion driver, which the Type-C depends on. Fixes: d2061f9cc32d ("usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY") Reported-by: Hans de Goede Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220620104316.57592-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 96163f835e65f8c9897487fac965819f0651d671 Author: Dan Vacura Date: Fri Jun 17 11:31:53 2022 -0500 usb: gadget: uvc: fix list double add in uvcg_video_pump A panic can occur if the endpoint becomes disabled and the uvcg_video_pump adds the request back to the req_free list after it has already been queued to the endpoint. The endpoint complete will add the request back to the req_free list. Invalidate the local request handle once it's been queued. <6>[ 246.796704][T13726] configfs-gadget gadget: uvc: uvc_function_set_alt(1, 0) <3>[ 246.797078][ T26] list_add double add: new=ffffff878bee5c40, prev=ffffff878bee5c40, next=ffffff878b0f0a90. <6>[ 246.797213][ T26] ------------[ cut here ]------------ <2>[ 246.797224][ T26] kernel BUG at lib/list_debug.c:31! <6>[ 246.807073][ T26] Call trace: <6>[ 246.807180][ T26] uvcg_video_pump+0x364/0x38c <6>[ 246.807366][ T26] process_one_work+0x2a4/0x544 <6>[ 246.807394][ T26] worker_thread+0x350/0x784 <6>[ 246.807442][ T26] kthread+0x2ac/0x320 Fixes: f9897ec0f6d3 ("usb: gadget: uvc: only pump video data if necessary") Cc: stable@vger.kernel.org Reviewed-by: Laurent Pinchart Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20220617163154.16621-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 9faa1c8f92f33daad9db96944139de225cefa199 Author: Geert Uytterhoeven Date: Wed Jun 15 15:53:09 2022 +0200 dt-bindings: usb: ehci: Increase the number of PHYs "make dtbs_check": arch/arm/boot/dts/r8a77470-iwg23s-sbc.dtb: usb@ee080100: phys: [[17, 0], [31]] is too long From schema: Documentation/devicetree/bindings/usb/generic-ehci.yaml arch/arm/boot/dts/r8a77470-iwg23s-sbc.dtb: usb@ee0c0100: phys: [[17, 1], [33], [21, 0]] is too long From schema: Documentation/devicetree/bindings/usb/generic-ehci.yaml Some USB EHCI controllers (e.g. on the Renesas RZ/G1C SoC) have multiple PHYs. Increase the maximum number of PHYs to 3, which is sufficient for now. Fixes: 0499220d6dadafa5 ("dt-bindings: Add missing array size constraints") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c5d19e2f9714f43effd90208798fc1936098078f.1655301043.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 0f074c1c95ea496dc91279b6c4b9845a337517fa Author: Geert Uytterhoeven Date: Wed Jun 15 15:54:02 2022 +0200 dt-bindings: usb: ohci: Increase the number of PHYs "make dtbs_check": arch/arm/boot/dts/r8a77470-iwg23s-sbc.dtb: usb@ee080000: phys: [[17, 0], [31]] is too long From schema: Documentation/devicetree/bindings/usb/generic-ohci.yaml arch/arm/boot/dts/r8a77470-iwg23s-sbc.dtb: usb@ee0c0000: phys: [[17, 1], [33], [21, 0]] is too long From schema: Documentation/devicetree/bindings/usb/generic-ohci.yaml Some USB OHCI controllers (e.g. on the Renesas RZ/G1C SoC) have multiple PHYs. Increase the maximum number of PHYs to 3, which is sufficient for now. Fixes: 0499220d6dadafa5 ("dt-bindings: Add missing array size constraints") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0112f9c8881513cb33bf7b66bc743dd08b35a2f5.1655301203.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit aacf2f9f382c91df73f33317e28a4c34c8038986 Author: Pavel Begunkov Date: Tue Jun 21 13:25:06 2022 +0100 io_uring: fix req->apoll_events apoll_events should be set once in the beginning of poll arming just as poll->events and not change after. However, currently io_uring resets it on each __io_poll_execute() for no clear reason. There is also a place in __io_arm_poll_handler() where we add EPOLLONESHOT to downgrade a multishot, but forget to do the same thing with ->apoll_events, which is buggy. Fixes: 81459350d581e ("io_uring: cache req->apoll->events in req->cflags") Signed-off-by: Pavel Begunkov Reviewed-by: Hao Xu Link: https://lore.kernel.org/r/0aef40399ba75b1a4d2c2e85e6e8fd93c02fc6e4.1655814213.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b60cac14bb3c88cff2a7088d9095b01a80938c41 Author: Jens Axboe Date: Tue Jun 21 07:47:13 2022 -0600 io_uring: fix merge error in checking send/recv addr2 flags With the dropping of the IOPOLL checking in the per-opcode handlers, we inadvertently left two checks in the recv/recvmsg and send/sendmsg prep handlers for the same thing, and one of them includes addr2 which holds the flags for these opcodes. Fix it up and kill the redundant checks. Signed-off-by: Jens Axboe commit 037e127452b973f45b34c1e88a1af183e652e657 Author: David Sterba Date: Tue Jun 14 15:27:48 2022 +0200 Documentation: update btrfs list of features and link to readthedocs.io The btrfs documentation in kernel is only meant as a starting point, so update the list of features and add link to btrfs.readthedocs.io page that is most up-to-date. The wiki is still used but information is migrated from there. Signed-off-by: David Sterba commit bf7ba8ee759b7b7a34787ddd8dc3f190a3d7fa24 Author: Josef Bacik Date: Mon Jun 13 15:09:49 2022 -0400 btrfs: fix deadlock with fsync+fiemap+transaction commit We are hitting the following deadlock in production occasionally Task 1 Task 2 Task 3 Task 4 Task 5 fsync(A) start trans start commit falloc(A) lock 5m-10m start trans wait for commit fiemap(A) lock 0-10m wait for 5m-10m (have 0-5m locked) have btrfs_need_log_full_commit !full_sync wait_ordered_extents finish_ordered_io(A) lock 0-5m DEADLOCK We have an existing dependency of file extent lock -> transaction. However in fsync if we tried to do the fast logging, but then had to fall back to committing the transaction, we will be forced to call btrfs_wait_ordered_range() to make sure all of our extents are updated. This creates a dependency of transaction -> file extent lock, because btrfs_finish_ordered_io() will need to take the file extent lock in order to run the ordered extents. Fix this by stopping the transaction if we have to do the full commit and we attempted to do the fast logging. Then attach to the transaction and commit it if we need to. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 97e86631bccddfbbe0c13f9a9605cdef11d31296 Author: Zygo Blaxell Date: Wed Jun 8 22:39:36 2022 -0400 btrfs: don't set lock_owner when locking extent buffer for reading In 196d59ab9ccc "btrfs: switch extent buffer tree lock to rw_semaphore" the functions for tree read locking were rewritten, and in the process the read lock functions started setting eb->lock_owner = current->pid. Previously lock_owner was only set in tree write lock functions. Read locks are shared, so they don't have exclusive ownership of the underlying object, so setting lock_owner to any single value for a read lock makes no sense. It's mostly harmless because write locks and read locks are mutually exclusive, and none of the existing code in btrfs (btrfs_init_new_buffer and print_eb_refs_lock) cares what nonsense is written in lock_owner when no writer is holding the lock. KCSAN does care, and will complain about the data race incessantly. Remove the assignments in the read lock functions because they're useless noise. Fixes: 196d59ab9ccc ("btrfs: switch extent buffer tree lock to rw_semaphore") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Nikolay Borisov Reviewed-by: Filipe Manana Signed-off-by: Zygo Blaxell Signed-off-by: David Sterba commit 19ab78ca86981e0e1e73036fb73a508731a7c078 Author: Naohiro Aota Date: Tue Jun 7 16:08:30 2022 +0900 btrfs: zoned: fix critical section of relocation inode writeback We use btrfs_zoned_data_reloc_{lock,unlock} to allow only one process to write out to the relocation inode. That critical section must include all the IO submission for the inode. However, flush_write_bio() in extent_writepages() is out of the critical section, causing an IO submission outside of the lock. This leads to an out of the order IO submission and fail the relocation process. Fix it by extending the critical section. Fixes: 35156d852762 ("btrfs: zoned: only allow one process to add pages to a relocation inode") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 343d8a30851c48a4ef0f5ef61d5e9fbd847a6883 Author: Naohiro Aota Date: Tue Jun 7 16:08:29 2022 +0900 btrfs: zoned: prevent allocation from previous data relocation BG After commit 5f0addf7b890 ("btrfs: zoned: use dedicated lock for data relocation"), we observe IO errors on e.g, btrfs/232 like below. [09.0][T4038707] WARNING: CPU: 3 PID: 4038707 at fs/btrfs/extent-tree.c:2381 btrfs_cross_ref_exist+0xfc/0x120 [btrfs] [09.9][T4038707] Call Trace: [09.5][T4038707] [09.3][T4038707] run_delalloc_nocow+0x7f1/0x11a0 [btrfs] [09.6][T4038707] ? test_range_bit+0x174/0x320 [btrfs] [09.2][T4038707] ? fallback_to_cow+0x980/0x980 [btrfs] [09.3][T4038707] ? find_lock_delalloc_range+0x33e/0x3e0 [btrfs] [09.5][T4038707] btrfs_run_delalloc_range+0x445/0x1320 [btrfs] [09.2][T4038707] ? test_range_bit+0x320/0x320 [btrfs] [09.4][T4038707] ? lock_downgrade+0x6a0/0x6a0 [09.2][T4038707] ? orc_find.part.0+0x1ed/0x300 [09.5][T4038707] ? __module_address.part.0+0x25/0x300 [09.0][T4038707] writepage_delalloc+0x159/0x310 [btrfs] [09.4][ C3] sd 10:0:1:0: [sde] tag#2620 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s [09.5][ C3] sd 10:0:1:0: [sde] tag#2620 Sense Key : Illegal Request [current] [09.9][ C3] sd 10:0:1:0: [sde] tag#2620 Add. Sense: Unaligned write command [09.5][ C3] sd 10:0:1:0: [sde] tag#2620 CDB: Write(16) 8a 00 00 00 00 00 02 f3 63 87 00 00 00 2c 00 00 [09.4][ C3] critical target error, dev sde, sector 396041272 op 0x1:(WRITE) flags 0x800 phys_seg 3 prio class 0 [09.9][ C3] BTRFS error (device dm-1): bdev /dev/mapper/dml_102_2 errs: wr 1, rd 0, flush 0, corrupt 0, gen 0 The IO errors occur when we allocate a regular extent in previous data relocation block group. On zoned btrfs, we use a dedicated block group to relocate a data extent. Thus, we allocate relocating data extents (pre-alloc) only from the dedicated block group and vice versa. Once the free space in the dedicated block group gets tight, a relocating extent may not fit into the block group. In that case, we need to switch the dedicated block group to the next one. Then, the previous one is now freed up for allocating a regular extent. The BG is already not enough to allocate the relocating extent, but there is still room to allocate a smaller extent. Now the problem happens. By allocating a regular extent while nocow IOs for the relocation is still on-going, we will issue WRITE IOs (for relocation) and ZONE APPEND IOs (for the regular writes) at the same time. That mixed IOs confuses the write pointer and arises the unaligned write errors. This commit introduces a new bit 'zoned_data_reloc_ongoing' to the btrfs_block_group. We set this bit before releasing the dedicated block group, and no extent are allocated from a block group having this bit set. This bit is similar to setting block_group->ro, but is different from it by allowing nocow writes to start. Once all the nocow IO for relocation is done (hooked from btrfs_finish_ordered_io), we reset the bit to release the block group for further allocation. Fixes: c2707a255623 ("btrfs: zoned: add a dedicated data relocation block group") CC: stable@vger.kernel.org # 5.16+ Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 650c9caba32a0167a018cca0fab32a2965d23513 Author: Filipe Manana Date: Mon Jun 6 10:41:19 2022 +0100 btrfs: do not BUG_ON() on failure to migrate space when replacing extents At btrfs_replace_file_extents(), if we fail to migrate reserved metadata space from the transaction block reserve into the local block reserve, we trigger a BUG_ON(). This is because it should not be possible to have a failure here, as we reserved more space when we started the transaction than the space we want to migrate. However having a BUG_ON() is way too drastic, we can perfectly handle the failure and return the error to the caller. So just do that instead, and add a WARN_ON() to make it easier to notice the failure if it ever happens (which is particularly useful for fstests, and the warning will trigger a failure of a test case). Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 983d8209c6803345c9958f4cc358d1155f93a099 Author: Filipe Manana Date: Mon Jun 6 10:41:18 2022 +0100 btrfs: add missing inode updates on each iteration when replacing extents When replacing file extents, called during fallocate, hole punching, clone and deduplication, we may not be able to replace/drop all the target file extent items with a single transaction handle. We may get -ENOSPC while doing it, in which case we release the transaction handle, balance the dirty pages of the btree inode, flush delayed items and get a new transaction handle to operate on what's left of the target range. By dropping and replacing file extent items we have effectively modified the inode, so we should bump its iversion and update its mtime/ctime before we update the inode item. This is because if the transaction we used for partially modifying the inode gets committed by someone after we release it and before we finish the rest of the range, a power failure happens, then after mounting the filesystem our inode has an outdated iversion and mtime/ctime, corresponding to the values it had before we changed it. So add the missing iversion and mtime/ctime updates. Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d4597898ba7b9d467b94a9aafd65ec408a75041f Author: Filipe Manana Date: Mon Jun 6 10:41:17 2022 +0100 btrfs: fix race between reflinking and ordered extent completion While doing a reflink operation, if an ordered extent for a file range that does not overlap with the source and destination ranges of the reflink operation happens, we can end up having a failure in the reflink operation and return -EINVAL to user space. The following sequence of steps explains how this can happen: 1) We have the page at file offset 315392 dirty (under delalloc); 2) A reflink operation for this file starts, using the same file as both source and destination, the source range is [372736, 409600) (length of 36864 bytes) and the destination range is [208896, 245760); 3) At btrfs_remap_file_range_prep(), we flush all delalloc in the source and destination ranges, and wait for any ordered extents in those range to complete; 4) Still at btrfs_remap_file_range_prep(), we then flush all delalloc in the inode, but we neither wait for it to complete nor any ordered extents to complete. This results in starting delalloc for the page at file offset 315392 and creating an ordered extent for that single page range; 5) We then move to btrfs_clone() and enter the loop to find file extent items to copy from the source range to destination range; 6) In the first iteration we end up at last file extent item stored in leaf A: (...) item 131 key (143616 108 315392) itemoff 5101 itemsize 53 extent data disk bytenr 1903988736 nr 73728 extent data offset 12288 nr 61440 ram 73728 This represents the file range [315392, 376832), which overlaps with the source range to clone. @datal is set to 61440, key.offset is 315392 and @next_key_min_offset is therefore set to 376832 (315392 + 61440). @off (372736) is > key.offset (315392), so @new_key.offset is set to the value of @destoff (208896). @new_key.offset == @last_dest_end (208896) so @drop_start is set to 208896 (@new_key.offset). @datal is adjusted to 4096, as @off is > @key.offset. So in this iteration we call btrfs_replace_file_extents() for the range [208896, 212991] (a single page, which is [@drop_start, @new_key.offset + @datal - 1]). @last_dest_end is set to 212992 (@new_key.offset + @datal = 208896 + 4096 = 212992). Before the next iteration of the loop, @key.offset is set to the value 376832, which is @next_key_min_offset; 7) On the second iteration btrfs_search_slot() leaves us again at leaf A, but this time pointing beyond the last slot of leaf A, as that's where a key with offset 376832 should be at if it existed. So end up calling btrfs_next_leaf(); 8) btrfs_next_leaf() releases the path, but before it searches again the tree for the next key/leaf, the ordered extent for the single page range at file offset 315392 completes. That results in trimming the file extent item we processed before, adjusting its key offset from 315392 to 319488, reducing its length from 61440 to 57344 and inserting a new file extent item for that single page range, with a key offset of 315392 and a length of 4096. Leaf A now looks like: (...) item 132 key (143616 108 315392) itemoff 4995 itemsize 53 extent data disk bytenr 1801666560 nr 4096 extent data offset 0 nr 4096 ram 4096 item 133 key (143616 108 319488) itemoff 4942 itemsize 53 extent data disk bytenr 1903988736 nr 73728 extent data offset 16384 nr 57344 ram 73728 9) When btrfs_next_leaf() returns, it gives us a path pointing to leaf A at slot 133, since it's the first key that follows what was the last key we saw (143616 108 315392). In fact it's the same item we processed before, but its key offset was changed, so it counts as a new key; 10) So now we have: @key.offset == 319488 @datal == 57344 @off (372736) is > key.offset (319488), so @new_key.offset is set to 208896 (@destoff value). @new_key.offset (208896) != @last_dest_end (212992), so @drop_start is set to 212992 (@last_dest_end value). @datal is adjusted to 4096 because @off > @key.offset. So in this iteration we call btrfs_replace_file_extents() for the invalid range of [212992, 212991] (which is [@drop_start, @new_key.offset + @datal - 1]). This range is empty, the end offset is smaller than the start offset so btrfs_replace_file_extents() returns -EINVAL, which we end up returning to user space and fail the reflink operation. This all happens because the range of this file extent item was already processed in the previous iteration. This scenario can be triggered very sporadically by fsx from fstests, for example with test case generic/522. So fix this by having btrfs_clone() skip file extent items that cover a file range that we have already processed. CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 36a38c53b4ee51b90566f8f44a613601eb31a10e Author: Takashi Iwai Date: Tue Jun 21 14:00:44 2022 +0200 ALSA: hda: Fix discovery of i915 graphics PCI device It's been reported that the recent fix for skipping the component-binding with D-GPU caused a regression on some systems; it resulted in the completely missing component binding with i915 GPU. The problem was the use of pci_get_class() function. It matches with the full PCI class bits, while we want to match only partially the PCI base class bits. So, when a system has an i915 graphics device with the PCI class 0380, it won't hit because we're looking for only the PCI class 0300. This patch fixes i915_gfx_present() to look up each PCI device and match with PCI base class explicitly instead of pci_get_class(). Fixes: c9db8a30d9f0 ("ALSA: hda/i915 - skip acomp init if no matching display") Reviewed-by: Kai Vehmanen Tested-by: Kai Vehmanen Cc: Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1200611 Link: https://lore.kernel.org/r/87bkunztec.wl-tiwai@suse.de Link: https://lore.kernel.org/r/20220621120044.11573-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit f2d8c2606825317b77db1f9ba0fc26ef26160b30 Author: Alan Stern Date: Mon Jun 13 10:17:03 2022 -0400 usb: gadget: Fix non-unique driver names in raw-gadget driver In a report for a separate bug (which has already been fixed by commit 5f0b5f4d50fa "usb: gadget: fix race when gadget driver register via ioctl") in the raw-gadget driver, the syzbot console log included error messages caused by attempted registration of a new driver with the same name as an existing driver: > kobject_add_internal failed for raw-gadget with -EEXIST, don't try to register things with the same name in the same directory. > UDC core: USB Raw Gadget: driver registration failed: -17 > misc raw-gadget: fail, usb_gadget_register_driver returned -17 These errors arise because raw_gadget.c registers a separate UDC driver for each of the UDC instances it creates, but these drivers all have the same name: "raw-gadget". Until recently this wasn't a problem, but when the "gadget" bus was added and UDC drivers were registered on this bus, it became possible for name conflicts to cause the registrations to fail. The reason is simply that the bus code in the driver core uses the driver name as a sysfs directory name (e.g., /sys/bus/gadget/drivers/raw-gadget/), and you can't create two directories with the same pathname. To fix this problem, the driver names used by raw-gadget are made distinct by appending a unique ID number: "raw-gadget.N", with a different value of N for each driver instance. And to avoid the proliferation of error handling code in the raw_ioctl_init() routine, the error return paths are refactored into the common pattern (goto statements leading to cleanup code at the end of the routine). Link: https://lore.kernel.org/all/0000000000008c664105dffae2eb@google.com/ Fixes: fc274c1e9973 "USB: gadget: Add a new bus for gadgets" CC: Andrey Konovalov CC: Reported-and-tested-by: syzbot+02b16343704b3af1667e@syzkaller.appspotmail.com Reviewed-by: Andrey Konovalov Acked-by: Hillf Danton Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YqdG32w+3h8c1s7z@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit dbab764ed5e987306480f827775876b99b81429e Author: Lukas Bulwahn Date: Mon Jun 13 14:46:47 2022 +0200 MAINTAINERS: add include/dt-bindings/usb to USB SUBSYSTEM Maintainers of the directory Documentation/devicetree/bindings/usb are also the maintainers of the corresponding directory include/dt-bindings/usb. Add the file entry for include/dt-bindings/usb to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220613124647.32019-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit fcd53c51d03709bc429822086f1e9b3e88904284 Author: Florian Westphal Date: Mon Jun 20 16:17:31 2022 +0200 netfilter: nf_dup_netdev: add and use recursion counter Now that the egress function can be called from egress hook, we need to avoid recursive calls into the nf_tables traverser, else crash. Fixes: f87b9464d152 ("netfilter: nft_fwd_netdev: Support egress hook") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 574a5b85dc3b9ab672ff3fba0ee020f927960648 Author: Florian Westphal Date: Mon Jun 20 16:17:30 2022 +0200 netfilter: nf_dup_netdev: do not push mac header a second time Eric reports skb_under_panic when using dup/fwd via bond+egress hook. Before pushing mac header, we should make sure that we're called from ingress to put back what was pulled earlier. In egress case, the MAC header is already there; we should leave skb alone. While at it be more careful here: skb might have been altered and headroom reduced, so add a skb_cow() before so that headroom is increased if necessary. nf_do_netdev_egress() assumes skb ownership (it normally ends with a call to dev_queue_xmit), so we must free the packet on error. Fixes: f87b9464d152 ("netfilter: nft_fwd_netdev: Support egress hook") Reported-by: Eric Garver Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 5d79d8af8dec58bf709b3124d09d9572edd9c617 Author: Jie2x Zhou Date: Thu Jun 16 15:40:46 2022 +0800 selftests: netfilter: correct PKTGEN_SCRIPT_PATHS in nft_concat_range.sh Before change: make -C netfilter TEST: performance net,port [SKIP] perf not supported port,net [SKIP] perf not supported net6,port [SKIP] perf not supported port,proto [SKIP] perf not supported net6,port,mac [SKIP] perf not supported net6,port,mac,proto [SKIP] perf not supported net,mac [SKIP] perf not supported After change: net,mac [ OK ] baseline (drop from netdev hook): 2061098pps baseline hash (non-ranged entries): 1606741pps baseline rbtree (match on first field only): 1191607pps set with 1000 full, ranged entries: 1639119pps ok 8 selftests: netfilter: nft_concat_range.sh Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation") Reported-by: kernel test robot Signed-off-by: Jie2x Zhou Signed-off-by: Pablo Neira Ayuso commit 372b2aee97028c75a6e12d205a2e5f0c8626efc6 Author: Stephen Boyd Date: Thu Jun 2 12:06:21 2022 -0700 arm64: dts: qcom: Remove duplicate sc7180-trogdor include on lazor/homestar The sc7180-trogdor-{lazor,homestar}-*.dtsi files all include sc7180-trogdor.dtsi and sc7180-trogdor-lazor.dtsi or sc7180-trogdor-homestar.dtsi, so including it here in the sc7180-trogdor-{lazor,homestar}.dtsi file means we have a duplicate include after commit 19794489fa24 ("arm64: dts: qcom: Only include sc7180.dtsi in sc7180-trogdor.dtsi"). We include the sc7180-trogdor.dtsi file in a board like sc7180-trogdor-lazor-r1.dts so that we can include the display bridge snippet (e.g. sc7180-trogdor-ti-sn65dsi86.dtsi) instead of making ever increasing variants like sc7180-trogdor-lazor-ti-sn65dsi86.dtsi. Unfortunately, having the double include like this means the display bridge's i2c bus is left disabled instead of enabled by the bridge snippet. Any boards that use the i2c bus for the display bridge will have the bus disabled when we include sc7180-trogdor.dtsi the second time, which picks up the i2c status="disabled" line from sc7180.dtsi. This leads to the display not turning on and black screens at boot on lazor and homestar devices. Fix this by dropping the include and making a note that the sc7180-trogdor-{lazor,homestar}.dtsi file must be included after sc7180-trogdor.dtsi Reported-by: Douglas Anderson Cc: "Joseph S. Barrera III" Cc: Matthias Kaehlcke Fixes: 19794489fa24 ("arm64: dts: qcom: Only include sc7180.dtsi in sc7180-trogdor.dtsi") Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220602190621.1646679-1-swboyd@chromium.org commit 73130a7b1ac92c9f30e0a255951129f4851c5794 Author: Steve French Date: Sat Jun 18 17:24:23 2022 -0500 smb3: fix empty netname context on secondary channels Some servers do not allow null netname contexts, which would cause multichannel to revert to single channel when mounting to some servers (e.g. Azure xSMB). Fixes: 4c14d7043fede ("cifs: populate empty hostnames for extra channels") Reviewed-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit cb995f4eeba9d268fd4b56c2423ad6c1d1ea1b82 Author: Matthew Wilcox (Oracle) Date: Fri Jun 17 20:00:17 2022 -0400 filemap: Handle sibling entries in filemap_get_read_batch() If a read races with an invalidation followed by another read, it is possible for a folio to be replaced with a higher-order folio. If that happens, we'll see a sibling entry for the new folio in the next iteration of the loop. This manifests as a NULL pointer dereference while holding the RCU read lock. Handle this by simply returning. The next call will find the new folio and handle it correctly. The other ways of handling this rare race are more complex and it's just not worth it. Reported-by: Dave Chinner Reported-by: Brian Foster Debugged-by: Brian Foster Tested-by: Brian Foster Reviewed-by: Brian Foster Fixes: cbd59c48ae2b ("mm/filemap: use head pages in generic_file_buffered_read") Cc: stable@vger.kernel.org Signed-off-by: Matthew Wilcox (Oracle) commit 5ccc944dce3df5fd2fd683a7df4fd49d1068eba2 Author: Matthew Wilcox (Oracle) Date: Fri Jun 10 14:44:41 2022 -0400 filemap: Correct the conditions for marking a folio as accessed We had an off-by-one error which meant that we never marked the first page in a read as accessed. This was visible as a slowdown when re-reading a file as pages were being evicted from cache too soon. In reviewing this code, we noticed a second bug where a multi-page folio would be marked as accessed multiple times when doing reads that were less than the size of the folio. Abstract the comparison of whether two file positions are in the same folio into a new function, fixing both of these bugs. Reported-by: Yu Kuai Reviewed-by: Kent Overstreet Signed-off-by: Matthew Wilcox (Oracle) commit 5491424d17bdeb7b7852a59367858251783f8398 Author: Yihao Han Date: Thu Jun 2 02:42:18 2022 -0700 video: fbdev: simplefb: Check before clk_put() not needed clk_put() already checks the clk ptr using !clk and IS_ERR() so there is no need to check it again before calling it. Signed-off-by: Yihao Han Reviewed-by: Hans de Goede Signed-off-by: Helge Deller commit b5c525abe717f2f41684b8581c13347d50d5285a Author: Yihao Han Date: Wed Jun 8 04:43:25 2022 -0700 video: fbdev: au1100fb: Drop unnecessary NULL ptr check clk_disable() already checks the clk ptr using IS_ERR_OR_NULL(clk) and clk_enable() checks the clk ptr using !clk, so there is no need to check clk ptr again before calling them. Signed-off-by: Yihao Han Signed-off-by: Helge Deller commit a09d2d00af53b43c6f11e6ab3cb58443c2cac8a7 Author: Hyunwoo Kim Date: Mon Jun 20 07:17:46 2022 -0700 video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write In pxa3xx_gcu_write, a count parameter of type size_t is passed to words of type int. Then, copy_from_user() may cause a heap overflow because it is used as the third argument of copy_from_user(). Signed-off-by: Hyunwoo Kim Signed-off-by: Helge Deller commit c7b28f52f406bc89d15ca0ccbc47994f979f2fcd Author: Jason A. Donenfeld Date: Mon Jun 13 12:22:41 2022 +0200 drm/i915/display: Re-add check for low voltage sku for max dp source rate This reverts commit 73867c8709b5 ("drm/i915/display: Remove check for low voltage sku for max dp source rate"), which, on an i7-11850H iGPU with a Thinkpad X1 Extreme Gen 4, attached to a LG LP160UQ1-SPB1 embedded panel, causes wild flickering glitching technicolor pyrotechnics on resumption from suspend. The display shows strobing colors in an utter disaster explosion of pantone, as though bombs were dropped on the leprechauns at the base of the rainbow. Rebooting the machine fixes the issue, presumably because the display is initialized by firmware rather than by i915. Otherwise, the GPU appears to work fine. Bisection traced it back to this commit, which makes sense given the issues. Note: This re-opens, and puts back to the drawing board, https://gitlab.freedesktop.org/drm/intel/-/issues/5272 which was fixed by the regressing commit. Fixes: 73867c8709b5 ("drm/i915/display: Remove check for low voltage sku for max dp source rate") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6205 Cc: Ankit Nautiyal Cc: Imre Deak Cc: Jani Nikula Cc: Uma Shankar Cc: Animesh Manna Cc: Jani Saarinen Signed-off-by: Jason A. Donenfeld Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220613102241.9236-1-Jason@zx2c4.com (cherry picked from commit d5929835080a60f9119d024fa42f315913942f76) Signed-off-by: Jani Nikula commit 2a166929bc0a3ae754365dabc455039fd1be82ca Author: Javier Martinez Canillas Date: Thu Jun 16 09:34:35 2022 +0200 regmap: Wire up regmap_config provided bulk write in missed functions There are some functions that were missed by commit d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config") when support to define bulk read/write callbacks in regmap_config was introduced. The regmap_bulk_write() and regmap_noinc_write() functions weren't changed to use the added map->write instead of the map->bus->write handler. Also, the regmap_can_raw_write() was not modified to take map->write into account. So will only return true if a bus with a .write callback is set. Fixes: d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config") Signed-off-by: Javier Martinez Canillas Reviewed-by: Marek Vasut Link: https://lore.kernel.org/r/20220616073435.1988219-4-javierm@redhat.com Signed-off-by: Mark Brown commit c42e99a3f93b4ca15720fdfd7aa8f6141dcc2a58 Author: Javier Martinez Canillas Date: Thu Jun 16 09:34:34 2022 +0200 regmap: Make regmap_noinc_read() return -ENOTSUPP if map->read isn't set Before adding support to define bulk read/write callbacks in regmap_config by the commit d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config"), the regmap_noinc_read() function returned an errno early a map->bus->read callback wasn't set. But that commit dropped the check and now a call to _regmap_raw_read() is attempted even when bulk read operations are not supported. That function checks for map->read anyways but there's no point to continue if the read can't succeed. Also is a fragile assumption to make so is better to make it fail earlier. Fixes: d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config") Signed-off-by: Javier Martinez Canillas Reviewed-by: Marek Vasut Link: https://lore.kernel.org/r/20220616073435.1988219-3-javierm@redhat.com Signed-off-by: Mark Brown commit ea50e2a1540fd94e6439a961daae595f65e574fb Author: Javier Martinez Canillas Date: Thu Jun 16 09:34:33 2022 +0200 regmap: Re-introduce bulk read support check in regmap_bulk_read() Support for drivers to define bulk read/write callbacks in regmap_config was introduced by the commit d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config"), but this commit wrongly dropped a check in regmap_bulk_read() to determine whether bulk reads can be done or not. Before that commit, it was checked if map->bus was set. Now has to check if a map->read callback has been set. Fixes: d77e74561368 ("regmap: Add bulk read/write callbacks into regmap_config") Signed-off-by: Javier Martinez Canillas Reviewed-by: Marek Vasut Link: https://lore.kernel.org/r/20220616073435.1988219-2-javierm@redhat.com Signed-off-by: Mark Brown commit 78ca55889a549a9a194c6ec666836329b774ab6d Merge: c5b3a0946bbe0 aeaadcde1a601 Author: Linus Torvalds Date: Mon Jun 20 09:35:04 2022 -0500 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Eight fixes, all in drivers (ufs, scsi_debug, storvsc, iscsi, ibmvfc). Apart from the ufs command clearing updates, these are mostly minor and obvious fixes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ibmvfc: Store vhost pointer during subcrq allocation scsi: ibmvfc: Allocate/free queue resource only during probe/remove scsi: storvsc: Correct reporting of Hyper-V I/O size limits scsi: ufs: Fix a race between the interrupt handler and the reset handler scsi: ufs: Support clearing multiple commands at once scsi: ufs: Simplify ufshcd_clear_cmd() scsi: iscsi: Exclude zero from the endpoint ID range scsi: scsi_debug: Fix zone transition to full condition commit c5b3a0946bbe050502c3faef2d4ff02b0da11bd1 Merge: 59b785fe2abbe 140cd9ec8fddd Author: Linus Torvalds Date: Mon Jun 20 09:31:03 2022 -0500 Merge tag 'perf-tools-fixes-for-v5.19-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tool fixes from Arnaldo Carvalho de Melo: - Don't set data source if it's not a memory operation in ARM SPE (Statistical Profiling Extensions). - Fix handling of exponent floating point values in perf stat expressions. - Don't leak fd on failure on libperf open. - Fix 'perf test' CPU topology test for PPC guest systems. - Fix undefined behaviour on breakpoint account 'perf test' entry. - Record only user callchains on the "Check ARM64 callgraphs are complete in FP mode" 'perf test' entry. - Fix "perf stat CSV output linter" test on s390. - Sync batch of kernel headers with tools/perf/. * tag 'perf-tools-fixes-for-v5.19-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: tools headers UAPI: Sync linux/prctl.h with the kernel sources perf metrics: Ensure at least 1 id per metric tools headers arm64: Sync arm64's cputype.h with the kernel sources tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources perf arm-spe: Don't set data source if it's not a memory operation perf expr: Allow exponents on floating point values perf test topology: Use !strncmp(right platform) to fix guest PPC comparision check perf test: Record only user callchains on the "Check Arm64 callgraphs are complete in fp mode" test perf beauty: Update copy of linux/socket.h with the kernel sources perf test: Fix variable length array undefined behavior in bp_account libperf evsel: Open shouldn't leak fd on failure perf test: Fix "perf stat CSV output linter" test on s390 perf unwind: Fix uninitialized variable commit 59b785fe2abbe21267516799f6c584cf4fe5f08b Merge: 05b252cccb2e5 eeaa345e12851 Author: Linus Torvalds Date: Mon Jun 20 09:28:51 2022 -0500 Merge tag 'slab-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab fixes from Vlastimil Babka: - A slub fix for PREEMPT_RT locking semantics from Sebastian. - A slub fix for state corruption due to a possible race scenario from Jann. * tag 'slab-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm/slub: add missing TID updates on slab deactivation mm/slub: Move the stackdepot related allocation out of IRQ-off section. commit 05b252cccb2e5c3f56119d25de684b4f810ba40a Author: Gerd Hoffmann Date: Mon Jun 20 09:15:47 2022 +0200 udmabuf: add back sanity check Check vm_fault->pgoff before using it. When we removed the warning, we also removed the check. Fixes: 7b26e4e2119d ("udmabuf: drop WARN_ON() check.") Reported-by: zdi-disclosures@trendmicro.com Suggested-by: Linus Torvalds Signed-off-by: Gerd Hoffmann Signed-off-by: Linus Torvalds commit 1bacd264d3c3a05de4afdd1712c9dd6ccebb9490 Author: Jens Axboe Date: Mon Jun 20 06:39:27 2022 -0600 io_uring: mark reissue requests with REQ_F_PARTIAL_IO If we mark for reissue, we assume that the buffer will remain stable. Hence if are using a provided buffer, we need to ensure that we stick with it for the duration of that request. This only affects block devices that use provided buffers, as those are the only ones that get marked with REQ_F_REISSUE. Signed-off-by: Jens Axboe commit 267173cbf4a6b37599e644098c756e7e4b771fe9 Author: Bjorn Helgaas Date: Tue Jun 7 18:11:12 2022 -0500 video: fbdev: skeletonfb: Convert to generic power management PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. If drivers implement power management, they should use the generic power management framework, not the PCI-specific hooks. Convert the sample code to use the generic power management framework. Signed-off-by: Bjorn Helgaas Acked-by: Daniel Vetter Signed-off-by: Helge Deller commit e146a096217e335f4e297a4fbba7ce6c722a1115 Author: Bjorn Helgaas Date: Tue Jun 7 18:11:11 2022 -0500 video: fbdev: cirrusfb: Remove useless reference to PCI power management PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. The cirrusfb driver has never implemented power management at all, but if it ever does, it should use the generic power management framework, not the PCI-specific hooks. Remove the commented-out references to the PCI-specific power management hooks. Signed-off-by: Bjorn Helgaas Acked-by: Daniel Vetter Signed-off-by: Helge Deller commit d36a869e0d0e56439365ed6d836480c480470e88 Author: Petr Cvek Date: Fri Jun 17 15:38:13 2022 +0200 video: fbdev: intelfb: Initialize value of stolen size Variable stolen_size can be left uninitialized in a code path with INTEL_855_GMCH_GMS_DISABLED. Fix this by initializing the variable to 0. Also fix indentation of function arguments. Signed-off-by: Petr Cvek Signed-off-by: Helge Deller commit 25c9a15fb7bbfafb94dd3b4e3165c18b8e1bd039 Author: Petr Cvek Date: Fri Jun 17 15:38:04 2022 +0200 video: fbdev: intelfb: Use aperture size from pci_resource_len Aperture size for i9x5 variants is determined from PCI base address. if (pci_resource_start(pdev, 2) & 0x08000000) *aperture_size = MB(128); ... This condition is incorrect as 128 MiB address can have the address set as 0x?8000000 or 0x?0000000. Also the code can be simplified to just use pci_resource_len(). The true settings of the aperture size is in the MSAC register, which could be used instead. However the value is used only as an info message, so it doesn't matter. Signed-off-by: Petr Cvek Signed-off-by: Helge Deller commit fc378794a2f7a19cf26010dc33b89ba608d4c70f Author: Xiang wangx Date: Sun Jun 5 16:59:13 2022 +0800 video: fbdev: skeletonfb: Fix syntax errors in comments Delete the redundant word 'its'. Signed-off-by: Xiang wangx Signed-off-by: Helge Deller commit c7807b27d510e5aa53c8a120cfc02c33c24ebb5f Author: Takashi Iwai Date: Mon Jun 20 12:40:08 2022 +0200 ALSA: hda/via: Fix missing beep setup Like the previous fix for Conexant codec, the beep_nid has to be set up before calling snd_hda_gen_parse_auto_config(); otherwise it'd miss the path setup. Fix the call order for addressing the missing beep setup. Fixes: 0e8f9862493a ("ALSA: hda/via - Simplify control management") Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=216152 Link: https://lore.kernel.org/r/20220620104008.1994-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5faa0bc69102f3a4c605581564c367be5eb94dfa Author: Takashi Iwai Date: Mon Jun 20 12:40:07 2022 +0200 ALSA: hda/conexant: Fix missing beep setup Currently the Conexant codec driver sets up the beep NID after calling snd_hda_gen_parse_auto_config(). It turned out that this results in the insufficient setup for the beep control, as the generic parser handles the fake path in snd_hda_gen_parse_auto_config() only if the beep_nid is set up beforehand. For dealing with the beep widget properly, call cx_auto_parse_beep() before snd_hda_gen_parse_auto_config() call. Fixes: 51e19ca5f755 ("ALSA: hda/conexant - Clean up beep code") Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=216152 Link: https://lore.kernel.org/r/20220620104008.1994-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 419bc8f681a0dc63588cee693b6d45e7caa6006c Author: Jon Lin Date: Fri Jun 17 20:42:51 2022 +0800 spi: rockchip: Unmask IRQ at the final to avoid preemption Avoid pio_write process is preempted, resulting in abnormal state. Signed-off-by: Jon Lin Signed-off-by: Jon Link: https://lore.kernel.org/r/20220617124251.5051-1-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit 342fc0c3b345525da21112bd0478a0dc741598ea Author: Carlo Lobrano Date: Tue Jun 14 09:56:23 2022 +0200 USB: serial: option: add Telit LE910Cx 0x1250 composition Add support for the following Telit LE910Cx composition: 0x1250: rmnet, tty, tty, tty, tty Reviewed-by: Daniele Palmas Signed-off-by: Carlo Lobrano Link: https://lore.kernel.org/r/20220614075623.2392607-1-c.lobrano@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 3828296ad6242c25d2679d32a377b8e07c6b08c0 Author: Tvrtko Ursulin Date: Thu Jun 16 15:00:56 2022 +0100 drm/i915/fdinfo: Don't show engine classes not present Stop displaying engine classes with no engines - it is not a huge problem if they are shown, since the values will correctly be all zeroes, but it does count as misleading. Signed-off-by: Tvrtko Ursulin Fixes: 055634e4b62f ("drm/i915: Expose client engine utilisation via fdinfo") Cc: Umesh Nerlige Ramappa Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220616140056.559074-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 9f1b1d0b2242171b2891a0398def233801601c14) Signed-off-by: Jani Nikula commit 13bd259b64bb58ae130923ada42ebc19bf3f2fa2 Author: Ville Syrjälä Date: Mon Jun 13 23:14:39 2022 +0300 drm/i915: Implement w/a 22010492432 for adl-s adl-s needs the combo PLL DCO fraction w/a as well. Gets us slightly more accurate clock out of the PLL. Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220613201439.23341-1-ville.syrjala@linux.intel.com Reviewed-by: Matt Roper (cherry picked from commit d36bdd77b9e6aa7f5cb7b0f11ebbab8e5febf10b) Signed-off-by: Jani Nikula commit a2d9b75b19dc8863f0845ffb401d33b2286d0aa1 Author: Max Filippov Date: Mon Jun 20 02:45:10 2022 -0700 xtensa: change '.bss' to '.section .bss' For some reason (ancient assembler?) the following build error is reported by the kisskb: kisskb/src/arch/xtensa/kernel/entry.S: Error: unknown pseudo-op: `.bss': => 2176 Change abbreviated '.bss' to the full '.section .bss, "aw"' to fix this error. Reported-by: Geert Uytterhoeven Signed-off-by: Max Filippov commit 754f04cac362417b157e30d5dc4046b5ec92060c Author: Cristian Marussi Date: Thu Jun 16 18:03:47 2022 +0100 firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks A reply to CLOCK_DESCRIBE_RATES issued against a non rate-discrete clock should be composed of a triplet of rates descriptors (min/max/step) returned all in one reply message. This is not always the case when dealing with some SCMI server deployed in the wild: relax such constraint while maintaining memory safety by checking carefully the returned payload size. While at that cleanup a stale debug printout. Link: https://lore.kernel.org/r/20220616170347.2800771-1-cristian.marussi@arm.com Fixes: 7bc7caafe6b1 ("firmware: arm_scmi: Use common iterators in the clock protocol") Tested-by: Robin Murphy Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 63b8ea5e4f1a87dea4d3114293fc8e96a8f193d7 Author: Jason A. Donenfeld Date: Mon Jun 20 11:03:48 2022 +0200 random: update comment from copy_to_user() -> copy_to_iter() This comment wasn't updated when we moved from read() to read_iter(), so this patch makes the trivial fix. Fixes: 1b388e7765f2 ("random: convert to using fops->read_iter()") Signed-off-by: Jason A. Donenfeld commit 69135c572d1f84261a6de2a1268513a7e71753e2 Author: Ziyang Xuan Date: Mon Jun 20 12:35:08 2022 +0800 net/tls: fix tls_sk_proto_close executed repeatedly After setting the sock ktls, update ctx->sk_proto to sock->sk_prot by tls_update(), so now ctx->sk_proto->close is tls_sk_proto_close(). When close the sock, tls_sk_proto_close() is called for sock->sk_prot->close is tls_sk_proto_close(). But ctx->sk_proto->close() will be executed later in tls_sk_proto_close(). Thus tls_sk_proto_close() executed repeatedly occurred. That will trigger the following bug. ================================================================= KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:tls_sk_proto_close+0xd8/0xaf0 net/tls/tls_main.c:306 Call Trace: tls_sk_proto_close+0x356/0xaf0 net/tls/tls_main.c:329 inet_release+0x12e/0x280 net/ipv4/af_inet.c:428 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1365 Updating a proto which is same with sock->sk_prot is incorrect. Add proto and sock->sk_prot equality check at the head of tls_update() to fix it. Fixes: 95fa145479fb ("bpf: sockmap/tls, close can race with map free") Reported-by: syzbot+29c3c12f3214b85ad081@syzkaller.appspotmail.com Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit 301bd140ed0b24f0da660874c7e8a47dad8c8222 Author: Eric Dumazet Date: Mon Jun 20 01:35:06 2022 -0700 erspan: do not assume transport header is always set Rewrite tests in ip6erspan_tunnel_xmit() and erspan_fb_xmit() to not assume transport header is set. syzbot reported: WARNING: CPU: 0 PID: 1350 at include/linux/skbuff.h:2911 skb_transport_header include/linux/skbuff.h:2911 [inline] WARNING: CPU: 0 PID: 1350 at include/linux/skbuff.h:2911 ip6erspan_tunnel_xmit+0x15af/0x2eb0 net/ipv6/ip6_gre.c:963 Modules linked in: CPU: 0 PID: 1350 Comm: aoe_tx0 Not tainted 5.19.0-rc2-syzkaller-00160-g274295c6e53f #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:skb_transport_header include/linux/skbuff.h:2911 [inline] RIP: 0010:ip6erspan_tunnel_xmit+0x15af/0x2eb0 net/ipv6/ip6_gre.c:963 Code: 0f 47 f0 40 88 b5 7f fe ff ff e8 8c 16 4b f9 89 de bf ff ff ff ff e8 a0 12 4b f9 66 83 fb ff 0f 85 1d f1 ff ff e8 71 16 4b f9 <0f> 0b e9 43 f0 ff ff e8 65 16 4b f9 48 8d 85 30 ff ff ff ba 60 00 RSP: 0018:ffffc90005daf910 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 000000000000ffff RCX: 0000000000000000 RDX: ffff88801f032100 RSI: ffffffff882e8d3f RDI: 0000000000000003 RBP: ffffc90005dafab8 R08: 0000000000000003 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000000 R12: ffff888024f21d40 R13: 000000000000a288 R14: 00000000000000b0 R15: ffff888025a2e000 FS: 0000000000000000(0000) GS:ffff88802c800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e425000 CR3: 000000006d099000 CR4: 0000000000152ef0 Call Trace: __netdev_start_xmit include/linux/netdevice.h:4805 [inline] netdev_start_xmit include/linux/netdevice.h:4819 [inline] xmit_one net/core/dev.c:3588 [inline] dev_hard_start_xmit+0x188/0x880 net/core/dev.c:3604 sch_direct_xmit+0x19f/0xbe0 net/sched/sch_generic.c:342 __dev_xmit_skb net/core/dev.c:3815 [inline] __dev_queue_xmit+0x14a1/0x3900 net/core/dev.c:4219 dev_queue_xmit include/linux/netdevice.h:2994 [inline] tx+0x6a/0xc0 drivers/block/aoe/aoenet.c:63 kthread+0x1e7/0x3b0 drivers/block/aoe/aoecmd.c:1229 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 Fixes: d5db21a3e697 ("erspan: auto detect truncated ipv6 packets.") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: William Tu Signed-off-by: David S. Miller commit 313c502fa3b3494159cb8f18d4a6444d06c5c9a5 Author: Riccardo Paolo Bestetti Date: Sun Jun 19 18:27:35 2022 +0200 ipv4: fix bind address validity regression tests Commit 8ff978b8b222 ("ipv4/raw: support binding to nonlocal addresses") introduces support for binding to nonlocal addresses, as well as some basic test coverage for some of the related cases. Commit b4a028c4d031 ("ipv4: ping: fix bind address validity check") fixes a regression which incorrectly removed some checks for bind address validation. In addition, it introduces regression tests for those specific checks. However, those regression tests are defective, in that they perform the tests using an incorrect combination of bind flags. As a result, those tests fail when they should succeed. This commit introduces additional regression tests for nonlocal binding and fixes the defective regression tests. It also introduces new set_sysctl calls for the ipv4_bind test group, as to perform the ICMP binding tests it is necessary to allow ICMP socket creation by setting the net.ipv4.ping_group_range knob. Fixes: b4a028c4d031 ("ipv4: ping: fix bind address validity check") Reported-by: Riccardo Paolo Bestetti Signed-off-by: Riccardo Paolo Bestetti Signed-off-by: David S. Miller commit 315f7e15c261167ea71c1a4cce2a18ca30e990ea Merge: a111daf0c53ae 70171ed6dc53d Author: Greg Kroah-Hartman Date: Mon Jun 20 09:49:52 2022 +0200 Merge tag 'iio-fixes-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO fixes for the 5.19 cycle. Most of these have been in next for a long time. Unfortunately there was one stray patch in the branch (wasn't a fix), so I've just rebased to remove that. * testing - Fix a missing MODULE_LICENSE() warning by restricting possible build configs. * Various drivers - Fix ordering of iio_get_trigger() being called before iio_trigger_register() * adi,admv1014 - Fix dubious x & !y warning. * adi,axi-adc - Fix missing of_node_put() in error and normal paths. * aspeed,adc - Add missing of_node_put() * fsl,mma8452 - Fix broken probing from device tree. - Drop check on return value of i2c write to device to cause reset as ACK will be missing (device reset before sending it). * fsl,vf610 - Fix documentation of in_conversion_mode ABI. * iio-trig-sysfs - Ensure irq work has finished before freeing the trigger. * invensense,mpu3050 - Disable regulators in error path. * invensense,icm42600 - Fix collision of enum value of 0 with error path where 0 is no match. * renesas,rzg2l_Adc - Add missing fwnode_handle_put() in error path. * rescale - Fix a boolean logic bug for detection of raw + scale affecting an obscure corner case. * semtech,sx9324 - Check return value of read of pin_defs * st,stm32-adc: - Fix interaction across ADC instances for some supported devices. - Drop false spurious IRQ messages. - Fix calibration value handling. If we can't calibrate don't expose the vref_int channel. - Fix maximum clock rate for stm32pm15x * ti,ads131e08 - Add missing fwnode_handle_put() in error paths. * xilinx,ams - Fix variable checked for error from platform_get_irq() * x-powers,axp288 - Overide TS_PIN bias current for boards where it is not correctly initialized. * yamaha,yas530 - Fix inverted check on calibration data being all zeros. * tag 'iio-fixes-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (26 commits) iio:proximity:sx9324: Check ret value of device_property_read_u32_array() iio: accel: mma8452: ignore the return value of reset operation iio: adc: stm32: fix maximum clock rate for stm32mp15x iio: adc: stm32: fix vrefint wrong calibration value handling iio: imu: inv_icm42600: Fix broken icm42600 (chip id 0 value) iio: adc: vf610: fix conversion mode sysfs node name iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client iio: test: fix missing MODULE_LICENSE for IIO_RESCALE=m iio:humidity:hts221: rearrange iio trigger get and register iio:chemical:ccs811: rearrange iio trigger get and register iio:accel:mxc4005: rearrange iio trigger get and register iio:accel:kxcjk-1013: rearrange iio trigger get and register iio:accel:bma180: rearrange iio trigger get and register iio: afe: rescale: Fix boolean logic bug iio: adc: aspeed: Fix refcount leak in aspeed_adc_set_trim_data iio: adc: stm32: Fix IRQs on STM32F4 by removing custom spurious IRQs message iio: adc: stm32: Fix ADCs iteration in irq handler iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels() iio: adc: rzg2l_adc: add missing fwnode_handle_put() in rzg2l_adc_parse_properties() iio: trigger: sysfs: fix use-after-free on remove ... commit 9882d63bea14c8b3ed2c9360b9ab9f0e2f64ae2b Author: Takashi Iwai Date: Mon Jun 20 09:34:40 2022 +0200 ALSA: memalloc: Drop x86-specific hack for WC allocations The recent report for a crash on Haswell machines implied that the x86-specific (rather hackish) implementation for write-cache memory buffer allocation in ALSA core is buggy with the recent kernel in some corner cases. This patch drops the x86-specific implementation and uses the standard dma_alloc_wc() & co generically for avoiding the bug and also for simplification. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216112 Cc: # v5.18+ Link: https://lore.kernel.org/r/20220620073440.7514-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9243fc4cd28c8bdddd7fe0abd5bbec3c4fdf5052 Author: Damien Le Moal Date: Fri Jun 3 14:35:29 2022 +0900 block: remove queue from struct blk_independent_access_range The request queue pointer in struct blk_independent_access_range is unused. Remove it. Signed-off-by: Damien Le Moal Fixes: 41e46b3c2aa2 ("block: Fix potential deadlock in blk_ia_range_sysfs_show()") Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220603053529.76405-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit 291810be4227564403807e663f3ec8d3b3d6ba34 Author: Nick Desaulniers Date: Fri Jun 17 09:58:17 2022 -0700 Documentation/llvm: Update Supported Arch table While watching Michael's new talk on Clang-built-Linux, I noticed the arch table in our docs that he refers to is outdated. Add hexagon and User Mode. Bump MIPS and RISCV to LLVM=1. PowerPC is almost LLVM=1 capable; ppc64le works, but ppc64 (big endian) and ppc32 still need more work. Link: https://youtu.be/W4zdEDpvR5c?t=399 Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 28438794aba47a27e922857d27b31b74e8559143 Author: Masahiro Yamada Date: Sat Jun 11 03:32:30 2022 +0900 modpost: fix section mismatch check for exported init/exit sections Since commit f02e8a6596b7 ("module: Sort exported symbols"), EXPORT_SYMBOL* is placed in the individual section ___ksymtab(_gpl)+ (3 leading underscores instead of 2). Since then, modpost cannot detect the bad combination of EXPORT_SYMBOL and __init/__exit. Fix the .fromsec field. Fixes: f02e8a6596b7 ("module: Sort exported symbols") Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 61803e984307c767a96d85f3b61ca50e1705fc67 Author: Daeho Jeong Date: Fri Jun 10 11:32:40 2022 -0700 f2fs: fix iostat related lock protection Made iostat related locks safe to be called from irq context again. Cc: Fixes: a1e09b03e6f5 ("f2fs: use iomap for direct I/O") Signed-off-by: Daeho Jeong Reviewed-by: Stanley Chu Tested-by: Eddie Huang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4cde00d50707c2ef6647b9b96b2cb40b6eb24397 Author: Jaegeuk Kim Date: Tue May 31 18:27:09 2022 -0700 f2fs: attach inline_data after setting compression This fixes the below corruption. [345393.335389] F2FS-fs (vdb): sanity_check_inode: inode (ino=6d0, mode=33206) should not have inline_data, run fsck to fix Cc: Fixes: 677a82b44ebf ("f2fs: fix to do sanity check for inline inode") Signed-off-by: Jaegeuk Kim commit c01d4d0a82b71857be7449380338bc53dde2da92 Author: Jason A. Donenfeld Date: Thu Jun 16 15:00:51 2022 +0200 random: quiet urandom warning ratelimit suppression message random.c ratelimits how much it warns about uninitialized urandom reads using __ratelimit(). When the RNG is finally initialized, it prints the number of missed messages due to ratelimiting. It has been this way since that functionality was introduced back in 2018. Recently, cc1e127bfa95 ("random: remove ratelimiting for in-kernel unseeded randomness") put a bit more stress on the urandom ratelimiting, which teased out a bug in the implementation. Specifically, when under pressure, __ratelimit() will print its own message and reset the count back to 0, making the final message at the end less useful. Secondly, it does so as a pr_warn(), which apparently is undesirable for people's CI. Fortunately, __ratelimit() has the RATELIMIT_MSG_ON_RELEASE flag exactly for this purpose, so we set the flag. Fixes: 4e00b339e264 ("random: rate limit unseeded randomness warnings") Cc: stable@vger.kernel.org Reported-by: Jon Hunter Reported-by: Ron Economos Tested-by: Ron Economos Signed-off-by: Jason A. Donenfeld commit 534d2eaf1970274150596fdd2bf552721e65d6b2 Author: Jason A. Donenfeld Date: Thu Jun 16 02:03:12 2022 +0200 random: schedule mix_interrupt_randomness() less often It used to be that mix_interrupt_randomness() would credit 1 bit each time it ran, and so add_interrupt_randomness() would schedule mix() to run every 64 interrupts, a fairly arbitrary number, but nonetheless considered to be a decent enough conservative estimate. Since e3e33fc2ea7f ("random: do not use input pool from hard IRQs"), mix() is now able to credit multiple bits, depending on the number of calls to add(). This was done for reasons separate from this commit, but it has the nice side effect of enabling this patch to schedule mix() less often. Currently the rules are: a) Credit 1 bit for every 64 calls to add(). b) Schedule mix() once a second that add() is called. c) Schedule mix() once every 64 calls to add(). Rules (a) and (c) no longer need to be coupled. It's still important to have _some_ value in (c), so that we don't "over-saturate" the fast pool, but the once per second we get from rule (b) is a plenty enough baseline. So, by increasing the 64 in rule (c) to something larger, we avoid calling queue_work_on() as frequently during irq storms. This commit changes that 64 in rule (c) to be 1024, which means we schedule mix() 16 times less often. And it does *not* need to change the 64 in rule (a). Fixes: 58340f8e952b ("random: defer fast pool mixing to worker") Cc: stable@vger.kernel.org Cc: Dominik Brodowski Acked-by: Sebastian Andrzej Siewior Signed-off-by: Jason A. Donenfeld commit a111daf0c53ae91e71fd2bfe7497862d14132e3e Author: Linus Torvalds Date: Sun Jun 19 15:06:47 2022 -0500 Linux 5.19-rc3 commit 70171ed6dc53d2f580166d47f5b66cf51a6d0092 Author: Aashish Sharma Date: Mon Jun 13 16:22:24 2022 -0700 iio:proximity:sx9324: Check ret value of device_property_read_u32_array() 0-day reports: drivers/iio/proximity/sx9324.c:868:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] Put an if condition to break out of switch if ret is non-zero. Signed-off-by: Aashish Sharma Fixes: a8ee3b32f5da ("iio:proximity:sx9324: Add dt_binding support") Reported-by: kernel test robot [swboyd@chromium.org: Reword commit subject, add fixes tag] Signed-off-by: Stephen Boyd Reviewed-by: Gwendal Grignou Link: https://lore.kernel.org/r/20220613232224.2466278-1-swboyd@chromium.org Cc: Signed-off-by: Jonathan Cameron commit bf745142cc0a3e1723f9207fb0c073c88464b7b4 Author: Haibo Chen Date: Wed Jun 15 19:31:58 2022 +0800 iio: accel: mma8452: ignore the return value of reset operation On fxls8471, after set the reset bit, the device will reset immediately, will not give ACK. So ignore the return value of this reset operation, let the following code logic to check whether the reset operation works. Signed-off-by: Haibo Chen Fixes: ecabae713196 ("iio: mma8452: Initialise before activating") Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/1655292718-14287-1-git-send-email-haibo.chen@nxp.com Cc: Signed-off-by: Jonathan Cameron commit 990539486e7e311fb5dab1bf4d85d1a8973ae644 Author: Olivier Moysan Date: Thu Jun 9 11:52:34 2022 +0200 iio: adc: stm32: fix maximum clock rate for stm32mp15x Change maximum STM32 ADC input clock rate to 36MHz, as specified in STM32MP15x datasheets. Fixes: d58c67d1d851 ("iio: adc: stm32-adc: add support for STM32MP1") Signed-off-by: Olivier Moysan Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220609095234.375925-1-olivier.moysan@foss.st.com Cc: Signed-off-by: Jonathan Cameron commit bc05f30fc24705cd023f38659303376eaa5767df Author: Olivier Moysan Date: Thu Jun 9 11:58:56 2022 +0200 iio: adc: stm32: fix vrefint wrong calibration value handling If the vrefint calibration is zero, the vrefint channel output value cannot be computed. Currently, in such case, the raw conversion value is returned, which is not relevant. Do not expose the vrefint channel when the output value cannot be computed, instead. Fixes: 0e346b2cfa85 ("iio: adc: stm32-adc: add vrefint calibration support") Signed-off-by: Olivier Moysan Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220609095856.376961-1-olivier.moysan@foss.st.com Cc: Signed-off-by: Jonathan Cameron commit 106b391e1b859100a3f38f0ad874236e9be06bde Author: Jean-Baptiste Maneyrol Date: Thu Jun 9 12:23:01 2022 +0200 iio: imu: inv_icm42600: Fix broken icm42600 (chip id 0 value) The 0 value used for INV_CHIP_ICM42600 was not working since the match in i2c/spi was checking against NULL value. To keep this check, add a first INV_CHIP_INVALID 0 value as safe guard. Fixes: 31c24c1e93c3 ("iio: imu: inv_icm42600: add core of new inv_icm42600 driver") Signed-off-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20220609102301.4794-1-jmaneyrol@invensense.com Cc: Signed-off-by: Jonathan Cameron commit f1a633b15cd5371a2a83f02c513984e51132dd68 Author: Baruch Siach Date: Mon May 30 11:50:26 2022 +0300 iio: adc: vf610: fix conversion mode sysfs node name The documentation missed the "in_" prefix for this IIO_SHARED_BY_DIR entry. Fixes: bf04c1a367e3 ("iio: adc: vf610: implement configurable conversion modes") Signed-off-by: Baruch Siach Acked-by: Haibo Chen Link: https://lore.kernel.org/r/560dc93fafe5ef7e9a409885fd20b6beac3973d8.1653900626.git.baruch@tkos.co.il Signed-off-by: Jonathan Cameron commit ada7b0c0dedafd7d059115adf49e48acba3153a8 Author: Miaoqian Lin Date: Tue May 24 11:45:17 2022 +0400 iio: adc: adi-axi-adc: Fix refcount leak in adi_axi_adc_attach_client of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: ef04070692a2 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220524074517.45268-1-linmq006@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 7a2f6f61e8ee016b75e1b1dd62fbd03e6d6db37d Author: Liam Beguin Date: Wed Jun 1 10:21:38 2022 -0400 iio: test: fix missing MODULE_LICENSE for IIO_RESCALE=m When IIO_RESCALE_KUNIT_TEST=y and IIO_RESCALE=m, drivers/iio/afe/iio-rescale.o is built twice causing the MODULE_LICENSE() to be lost, as shown by: ERROR: modpost: missing MODULE_LICENSE() in drivers/iio/afe/iio-rescale.o Rework the build configuration to have the dependency specified in the Kconfig. Reported-by: Randy Dunlap Fixes: 8e74a48d17d5 ("iio: test: add basic tests for the iio-rescale driver") Signed-off-by: Liam Beguin Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220601142138.3331278-1-liambeguin@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 10b9c2c33ac706face458feab8965f11743c98c0 Author: Dmitry Rokosov Date: Tue May 24 18:14:46 2022 +0000 iio:humidity:hts221: rearrange iio trigger get and register IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: e4a70e3e7d84 ("iio: humidity: add support to hts221 rh/temp combo device") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-6-ddrokosov@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit d710359c0b445e8c03e24f19ae2fb79ce7282260 Author: Dmitry Rokosov Date: Tue May 24 18:14:45 2022 +0000 iio:chemical:ccs811: rearrange iio trigger get and register IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: f1f065d7ac30 ("iio: chemical: ccs811: Add support for data ready trigger") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-5-ddrokosov@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit 9354c224c9b4f55847a0de3e968cba2ebf15af3b Author: Dmitry Rokosov Date: Tue May 24 18:14:43 2022 +0000 iio:accel:mxc4005: rearrange iio trigger get and register IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: 47196620c82f ("iio: mxc4005: add data ready trigger for mxc4005") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-4-ddrokosov@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit ed302925d708f2f97ae5e9fd6c56c16bb34f6629 Author: Dmitry Rokosov Date: Tue May 24 18:14:42 2022 +0000 iio:accel:kxcjk-1013: rearrange iio trigger get and register IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: c1288b833881 ("iio: accel: kxcjk-1013: Increment ref counter for indio_dev->trig") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-3-ddrokosov@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit e5f3205b04d7f95a2ef43bce4b454a7f264d6923 Author: Dmitry Rokosov Date: Tue May 24 18:14:39 2022 +0000 iio:accel:bma180: rearrange iio trigger get and register IIO trigger interface function iio_trigger_get() should be called after iio_trigger_register() (or its devm analogue) strictly, because of iio_trigger_get() acquires module refcnt based on the trigger->owner pointer, which is initialized inside iio_trigger_register() to THIS_MODULE. If this call order is wrong, the next iio_trigger_put() (from sysfs callback or "delete module" path) will dereference "default" module refcnt, which is incorrect behaviour. Fixes: 0668a4e4d297 ("iio: accel: bma180: Fix indio_dev->trig assignment") Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220524181150.9240-2-ddrokosov@sberdevices.ru Cc: Signed-off-by: Jonathan Cameron commit 9decacd8b3a432316d61c4366f302e63384cb08d Author: Linus Walleij Date: Tue May 24 09:54:48 2022 +0200 iio: afe: rescale: Fix boolean logic bug When introducing support for processed channels I needed to invert the expression: if (!iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) || !iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE)) dev_err(dev, "source channel does not support raw/scale\n"); To the inverse, meaning detect when we can usse raw+scale rather than when we can not. This was the result: if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) || iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE)) dev_info(dev, "using raw+scale source channel\n"); Ooops. Spot the error. Yep old George Boole came up and bit me. That should be an &&. The current code "mostly works" because we have not run into systems supporting only raw but not scale or only scale but not raw, and I doubt there are few using the rescaler on anything such, but let's fix the logic. Cc: Liam Beguin Cc: stable@vger.kernel.org Fixes: 53ebee949980 ("iio: afe: iio-rescale: Support processed channels") Signed-off-by: Linus Walleij Reviewed-by: Liam Beguin Acked-by: Peter Rosin Link: https://lore.kernel.org/r/20220524075448.140238-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron commit 8a2b6b5687984a010ed094b4f436a2f091987758 Author: Miaoqian Lin Date: Mon May 16 11:52:02 2022 +0400 iio: adc: aspeed: Fix refcount leak in aspeed_adc_set_trim_data of_find_node_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: d0a4c17b4073 ("iio: adc: aspeed: Get and set trimming data.") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516075206.34580-1-linmq006@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 99bded02dae5e1e2312813506c41dc8db2fb656c Author: Yannick Brosseau Date: Mon May 16 16:39:39 2022 -0400 iio: adc: stm32: Fix IRQs on STM32F4 by removing custom spurious IRQs message The check for spurious IRQs introduced in 695e2f5c289bb assumed that the bits in the control and status registers are aligned. This is true for the H7 and MP1 version, but not the F4. The interrupt was then never handled on the F4. Instead of increasing the complexity of the comparison and check each bit specifically, we remove this check completely and rely on the generic handler for spurious IRQs. Fixes: 695e2f5c289b ("iio: adc: stm32-adc: fix a regression when using dma and irq") Signed-off-by: Yannick Brosseau Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220516203939.3498673-3-yannick.brosseau@gmail.com Cc: Signed-off-by: Jonathan Cameron commit d2214cca4d3eadc74eac9e30301ec7cad5355f00 Author: Yannick Brosseau Date: Mon May 16 16:39:38 2022 -0400 iio: adc: stm32: Fix ADCs iteration in irq handler The irq handler was only checking the mask for the first ADCs in the case of the F4 and H7 generation, since it was iterating up to the num_irq value. This patch add the maximum number of ADC in the common register, which map to the number of entries of eoc_msk and ovr_msk in stm32_adc_common_regs. This allow the handler to check all ADCs in that module. Tested on a STM32F429NIH6. Fixes: 695e2f5c289b ("iio: adc: stm32-adc: fix a regression when using dma and irq") Signed-off-by: Yannick Brosseau Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220516203939.3498673-2-yannick.brosseau@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 47dcf770abc793f347a65a24c24d550c936f08b0 Author: Jialin Zhang Date: Tue May 17 11:30:20 2022 +0800 iio: adc: ti-ads131e08: add missing fwnode_handle_put() in ads131e08_alloc_channels() fwnode_handle_put() should be used when terminating device_for_each_child_node() iteration with break or return to prevent stale device node references from being left behind. Fixes: d935eddd2799 ("iio: adc: Add driver for Texas Instruments ADS131E0x ADC family") Reported-by: Hulk Robot Signed-off-by: Jialin Zhang Link: https://lore.kernel.org/r/20220517033020.2033324-1-zhangjialin11@huawei.com Cc: Signed-off-by: Jonathan Cameron commit d836715f588ea15f905f607c27bc693587058db4 Author: Jialin Zhang Date: Tue May 17 11:35:26 2022 +0800 iio: adc: rzg2l_adc: add missing fwnode_handle_put() in rzg2l_adc_parse_properties() fwnode_handle_put() should be used when terminating device_for_each_child_node() iteration with break or return to prevent stale device node references from being left behind. Fixes: d484c21bacfa ("iio: adc: Add driver for Renesas RZ/G2L A/D converter") Reported-by: Hulk Robot Signed-off-by: Jialin Zhang Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220517033526.2035735-1-zhangjialin11@huawei.com Cc: Signed-off-by: Jonathan Cameron commit 78601726d4a59a291acc5a52da1d3a0a6831e4e8 Author: Vincent Whitchurch Date: Thu May 19 11:19:25 2022 +0200 iio: trigger: sysfs: fix use-after-free on remove Ensure that the irq_work has completed before the trigger is freed. ================================================================== BUG: KASAN: use-after-free in irq_work_run_list Read of size 8 at addr 0000000064702248 by task python3/25 Call Trace: irq_work_run_list irq_work_tick update_process_times tick_sched_handle tick_sched_timer __hrtimer_run_queues hrtimer_interrupt Allocated by task 25: kmem_cache_alloc_trace iio_sysfs_trig_add dev_attr_store sysfs_kf_write kernfs_fop_write_iter new_sync_write vfs_write ksys_write sys_write Freed by task 25: kfree iio_sysfs_trig_remove dev_attr_store sysfs_kf_write kernfs_fop_write_iter new_sync_write vfs_write ksys_write sys_write ================================================================== Fixes: f38bc926d022 ("staging:iio:sysfs-trigger: Use irq_work to properly active trigger") Signed-off-by: Vincent Whitchurch Reviewed-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220519091925.1053897-1-vincent.whitchurch@axis.com Cc: Signed-off-by: Jonathan Cameron commit b2f5ad97645e1deb5ca9bcb7090084b92cae35d2 Author: Zheyu Ma Date: Tue May 10 17:24:31 2022 +0800 iio: gyro: mpu3050: Fix the error handling in mpu3050_power_up() The driver should disable regulators when fails at regmap_update_bits(). Signed-off-by: Zheyu Ma Reviewed-by: Linus Walleij Cc: Link: https://lore.kernel.org/r/20220510092431.1711284-1-zheyuma97@gmail.com Signed-off-by: Jonathan Cameron commit 6f6bd7591945c679b7f595119ea997b19f5794db Author: Antoniu Miclaus Date: Wed May 11 12:00:06 2022 +0300 iio: freq: admv1014: Fix warning about dubious x & !y and improve readability The warning comes from __BF_FIELD_CHECK() specifically BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \ ~((_mask) >> __bf_shf(_mask)) & (_val) : 0, \ _pfx "value too large for the field"); \ The code was using !(enum value) which is not particularly easy to follow so replace that with explicit matching and use of ? 0 : 1; or ? 1 : 0; to improve readability. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20220511090006.90502-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit be33d52ef5b4bdfec04cfdad39368c343bac97a3 Author: Maya Matuszczyk Date: Sun Jun 19 13:19:52 2022 +0200 drm: panel-orientation-quirks: Add quirk for Aya Neo Next The device is identified by "NEXT" in board name, however there are different versions of it, "Next Advance" and "Next Pro", that have different DMI board names. Due to a production error a batch or two have their board names prefixed by "AYANEO", this makes it 6 different DMI board names. To save some space in final kernel image DMI_MATCH is used instead of DMI_EXACT_MATCH. Signed-off-by: Maya Matuszczyk Reviewed-by: Javier Martinez Canillas Reviewed-by: Hans de Goede Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220619111952.8487-1-maccraft123mc@gmail.com commit 05c6ca8512f2722f57743d653bb68cf2a273a55a Merge: 5d770f11a1623 1e7769653b06b Author: Linus Torvalds Date: Sun Jun 19 09:58:28 2022 -0500 Merge tag 'x86-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: - Make RESERVE_BRK() work again with older binutils. The recent 'simplification' broke that. - Make early #VE handling increment RIP when successful. - Make the #VE code consistent vs. the RIP adjustments and add comments. - Handle load_unaligned_zeropad() across page boundaries correctly in #VE when the second page is shared. * tag 'x86-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page x86/tdx: Clarify RIP adjustments in #VE handler x86/tdx: Fix early #VE handling x86/mm: Fix RESERVE_BRK() for older binutils commit 5d770f11a1623eef83894b60686fb328794ccd23 Merge: 727c3991dfdb3 7b6c7a877cc61 Author: Linus Torvalds Date: Sun Jun 19 09:54:16 2022 -0500 Merge tag 'objtool-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull build tooling updates from Thomas Gleixner: - Remove obsolete CONFIG_X86_SMAP reference from objtool - Fix overlapping text section failures in faddr2line for real - Remove OBJECT_FILES_NON_STANDARD usage from x86 ftrace and replace it with finegrained annotations so objtool can validate that code correctly. * tag 'objtool-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage faddr2line: Fix overlapping text section failures, the sequel objtool: Fix obsolete reference to CONFIG_X86_SMAP commit 727c3991dfdb3ff104e33307e287692ef01daec9 Merge: 4afb65156a79c 04193d590b390 Author: Linus Torvalds Date: Sun Jun 19 09:51:00 2022 -0500 Merge tag 'sched-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Thomas Gleixner: "A single scheduler fix plugging a race between sched_setscheduler() and balance_push(). sched_setscheduler() spliced the balance callbacks accross a lock break which makes it possible for an interleaving schedule() to observe an empty list" * tag 'sched-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Fix balance_push() vs __sched_setscheduler() commit 4afb65156a79c59fbdbc10abb0bf06ff83f73e23 Merge: 36da9f5fb6e3a 4051a81774d6d Author: Linus Torvalds Date: Sun Jun 19 09:47:41 2022 -0500 Merge tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull lockdep fix from Thomas Gleixner: "A RT fix for lockdep. lockdep invokes prandom_u32() to create cookies. This worked until prandom_u32() was switched to the real random generator, which takes a spinlock for extraction, which does not work on RT when invoked from atomic contexts. lockdep has no requirement for real random numbers and it turns out sched_clock() is good enough to create the cookie. That works everywhere and is faster" * tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Use sched_clock() for random numbers commit 36da9f5fb6e3a0a88ba28e5a7cc7d5449641a286 Merge: bc94632ceb4b4 6872fcac7158c Author: Linus Torvalds Date: Sun Jun 19 09:45:16 2022 -0500 Merge tag 'irq-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Thomas Gleixner: "A set of interrupt subsystem updates: Core: - Ensure runtime power management for chained interrupts Drivers: - A collection of OF node refcount fixes - Unbreak MIPS uniprocessor builds - Fix xilinx interrupt controller Kconfig dependencies - Add a missing compatible string to the Uniphier driver" * tag 'irq-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/loongson-liointc: Use architecture register to get coreid irqchip/uniphier-aidet: Add compatible string for NX1 SoC dt-bindings: interrupt-controller/uniphier-aidet: Add bindings for NX1 SoC irqchip/realtek-rtl: Fix refcount leak in map_interrupts irqchip/gic-v3: Fix refcount leak in gic_populate_ppi_partitions irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions irqchip/apple-aic: Fix refcount leak in aic_of_ic_init irqchip/apple-aic: Fix refcount leak in build_fiq_affinity irqchip/gic/realview: Fix refcount leak in realview_gic_of_init irqchip/xilinx: Remove microblaze+zynq dependency genirq: PM: Use runtime PM for chained interrupts commit 140cd9ec8fdddc0e2d1684e6b69bcd05efbc9549 Author: Arnaldo Carvalho de Melo Date: Thu Feb 11 12:50:52 2021 -0300 tools headers UAPI: Sync linux/prctl.h with the kernel sources To pick the changes in: 9e4ab6c891094720 ("arm64/sme: Implement vector length configuration prctl()s") That don't result in any changes in tooling: $ 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 $ Just silences this perf tools build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/prctl.h' differs from latest version at 'include/uapi/linux/prctl.h' diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h Cc: Catalin Marinas Cc: Mark Brown Link: http://lore.kernel.org/lkml/Yq81we+XFOqlBWyu@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bc94632ceb4b4af47b2c86f8f11177884821fb94 Merge: ee4eb6eeaf146 928ea98252ad7 Author: Linus Torvalds Date: Sun Jun 19 09:37:29 2022 -0500 Merge tag 'char-misc-5.19-rc3-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes for real from Greg KH: "Let's tag the proper branch this time... Here are some small char/misc driver fixes for 5.19-rc3 that resolve some reported issues. They include: - mei driver fixes - comedi driver fix - rtsx build warning fix - fsl-mc-bus driver fix All of these have been in linux-next for a while with no reported issues" This is what the merge in commit f0ec9c65a8d6 _should_ have merged, but Greg fat-fingered the pull request and I got some small changes from linux-next instead there. Credit to Nathan Chancellor for eagle-eyes. Link: https://lore.kernel.org/all/Yqywy+Md2AfGDu8v@dev-arch.thelio-3990X/ * tag 'char-misc-5.19-rc3-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: bus: fsl-mc-bus: fix KASAN use-after-free in fsl_mc_bus_remove() mei: me: add raptor lake point S DID mei: hbm: drop capability response on early shutdown mei: me: set internal pg flag to off on hardware reset misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw() comedi: vmk80xx: fix expression for tx buffer size commit ee4eb6eeaf1468f2524cceef92906a378dd3df7e Merge: 063232b6c46ef de87b603b0919 Author: Linus Torvalds Date: Sun Jun 19 09:35:09 2022 -0500 Merge tag 'i2c-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "MAINTAINERS rectifications and a few minor driver fixes" * tag 'i2c-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: mediatek: Fix an error handling path in mtk_i2c_probe() i2c: designware: Use standard optional ref clock implementation MAINTAINERS: core DT include belongs to core MAINTAINERS: add include/dt-bindings/i2c to I2C SUBSYSTEM HOST DRIVERS i2c: npcm7xx: Add check for platform_driver_register MAINTAINERS: Update Synopsys DesignWare I2C to Supported commit 063232b6c46ef81a952362647541d897e806ec5d Merge: 354c6e071be98 e89ab76d7e256 Author: Linus Torvalds Date: Sun Jun 19 09:24:49 2022 -0500 Merge tag 'xfs-5.19-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "There's not a whole lot this time around (I'm still on vacation) but here are some important fixes for new features merged in -rc1: - Fix a bug where inode flag changes would accidentally drop nrext64 - Fix a race condition when toggling LARP mode" * tag 'xfs-5.19-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: preserve DIFLAG2_NREXT64 when setting other inode attributes xfs: fix variable state usage xfs: fix TOCTOU race involving the new logged xattrs control knob commit c788ef61ef2ae51dc9cbd589e118f827585c156f Author: Ian Rogers Date: Fri Jun 17 18:39:57 2022 -0700 perf metrics: Ensure at least 1 id per metric We may have no events for a metric evaluated to a constant. In such a case ensure a tool event is at least evaluated for metric parsing and displaying. Fixes: 8586d2744ff3065e ("perf metrics: Don't add all tool events for sharing") Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220618013957.999321-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 37402d5d061ba914a12d16ee8dda6d6964b4819d Author: Arnaldo Carvalho de Melo Date: Sat Apr 9 11:48:15 2022 -0300 tools headers arm64: Sync arm64's cputype.h with the kernel sources To get the changes in: cae889302ebf5a9b ("KVM: arm64: vgic-v3: List M1 Pro/Max as requiring the SEIS workaround") That addresses this perf build warning: 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 Cc: Marc Zyngier Link: https://lore.kernel.org/lkml/Yq8w7p4omYKNwOij@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2e323f360a7b635a4df6faea616b80c188e68991 Author: Arnaldo Carvalho de Melo Date: Fri Sep 10 11:46:54 2021 -0300 tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources To pick the changes in: f1a9761fbb00639c ("KVM: x86: Allow userspace to opt out of hypercall patching") That just rebuilds kvm-stat.c on x86, no change in functionality. This silences these perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/kvm.h' differs from latest version at 'arch/x86/include/uapi/asm/kvm.h' diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h Cc: Oliver Upton Cc: Paolo Bonzini Link: https://lore.kernel.org/lkml/Yq8qgiMwRcl9ds+f@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 51ba539f5bdb5a8cc7b1dedd5e73ac54564a7602 Author: Leo Yan Date: Tue May 17 02:03:25 2022 +0000 perf arm-spe: Don't set data source if it's not a memory operation Except for memory load and store operations, ARM SPE records also can support other operation types, bug when set the data source field the current code assumes a record is a either load operation or store operation, this leads to wrongly synthesize memory samples. This patch strictly checks the record operation type, it only sets data source only for the operation types ARM_SPE_LD and ARM_SPE_ST, otherwise, returns zero for data source. Therefore, we can synthesize memory samples only when data source is a non-zero value, the function arm_spe__is_memory_event() is useless and removed. Fixes: e55ed3423c1bb29f ("perf arm-spe: Synthesize memory event") Reviewed-by: Ali Saidi Reviewed-by: German Gomez Signed-off-by: Leo Yan Tested-by: Ali Saidi Cc: Alexander Shishkin Cc: alisaidi@amazon.com Cc: Andrew Kilroy Cc: Benjamin Herrenschmidt Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Leo Yan Cc: Li Huafei Cc: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Forrington Cc: Peter Zijlstra Cc: Will Deacon Link: http://lore.kernel.org/lkml/20220517020326.18580-5-alisaidi@amazon.com Signed-off-by: Arnaldo Carvalho de Melo commit e5287e6dd3b07e28e6bca5e33a3813a5e83bbc4c Author: Ian Rogers Date: Thu May 26 19:06:53 2022 -0700 perf expr: Allow exponents on floating point values Pass the optional exponent component through to strtod that already supports it. We already have exponents in ScaleUnit and so this adds uniformity. Reported-by: Zhengjun Xing Reviewed-By: Kajol Jain Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Richter Link: https://lore.kernel.org/r/20220527020653.4160884-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b236371421df57b93fc49c4b9d0e53bd1aab2b2e Author: Athira Rajeev Date: Fri Jun 10 19:29:39 2022 +0530 perf test topology: Use !strncmp(right platform) to fix guest PPC comparision check commit cfd7092c31aed728 ("perf test session topology: Fix test to skip the test in guest environment") added check to skip the testcase if the socket_id can't be fetched from topology info. But the condition check uses strncmp which should be changed to !strncmp and to correctly match platform. Fix this condition check. Fixes: cfd7092c31aed728 ("perf test session topology: Fix test to skip the test in guest environment") Reported-by: Thomas Richter Signed-off-by: Athira Jajeev Acked-by: Ian Rogers Cc: Athira Rajeev Cc: Disha Goel Cc: Jiri Olsa Cc: Kajol Jain Cc: linuxppc-dev@lists.ozlabs.org Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Link: https://lore.kernel.org/r/20220610135939.63361-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 72dcae8efd42699bbfd55e1ef187310c4e2e5dcb Author: Michael Petlan Date: Tue Jun 14 12:52:07 2022 +0200 perf test: Record only user callchains on the "Check Arm64 callgraphs are complete in fp mode" test The testcase 'Check Arm64 callgraphs are complete in fp mode' wants to see the following output: 610 leaf 62f parent 648 main However, without excluding kernel callchains, the output might look like: ffffc2ff40ef1b5c arch_local_irq_enable ffffc2ff419d032c __schedule ffffc2ff419d06c0 schedule ffffc2ff40e4da30 do_notify_resume ffffc2ff40e421b0 work_pending 610 leaf 62f parent 648 main Adding '--user-callchains' leaves only the wanted symbols in the chain. Fixes: cd6382d82752737e ("perf test arm64: Test unwinding using fame-pointer (fp) mode") Suggested-by: German Gomez Reviewed-by: German Gomez Reviewed-by: Leo Yan Signed-off-by: Michael Petlan Cc: German Gomez Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220614105207.26223-1-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 67e7d771580e9f365e75e1cc3690401526cfbb29 Author: Arnaldo Carvalho de Melo Date: Sat Jun 19 10:09:08 2021 -0300 perf beauty: Update copy of linux/socket.h with the kernel sources To pick the changes in: f94fd25cb0aaf77f ("tcp: pass back data left in socket after receive") That don't result in any changes in the tables generated from that header. This silences this perf build warning: Warning: Kernel ABI header at 'tools/perf/trace/beauty/include/linux/socket.h' differs from latest version at 'include/linux/socket.h' diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h Cc: Jakub Kicinski Cc: Jens Axboe Link: https://lore.kernel.org/all/YqORj9d58AiGYl8b@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit cc2145526c9889e3dbddc210c21bc3a080b2a29f Author: Ian Rogers Date: Fri Jun 10 11:02:47 2022 -0700 perf test: Fix variable length array undefined behavior in bp_account Fix: tests/bp_account.c:154:9: runtime error: variable length array bound evaluates to non-positive value 0 by switching from a variable length to an allocated array. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220610180247.444798-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 94725994cfd768b9ee1bd06f15c252694b1e9b89 Author: Ian Rogers Date: Wed Jun 8 22:23:52 2022 -0700 libperf evsel: Open shouldn't leak fd on failure If perf_event_open() fails the fd is opened but it is only freed by closing (not by delete). Typically when an open fails you don't call close and so this results in a memory leak. To avoid this, add a close when open fails. Signed-off-by: Ian Rogers Reviewed-By: Kajol Jain Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220609052355.1300162-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ec906102e5b7d3393cfe83e606b48cf0c1fcb122 Author: Thomas Richter Date: Fri Jun 3 13:30:34 2022 +0200 perf test: Fix "perf stat CSV output linter" test on s390 perf test -F 83 ("perf stat CSV output linter") fails on s390. Reason is the wrong number of fields for certain CPU core/die/socket related output. On x84_64 the output of command: # ./perf stat -x, -A -a --no-merge true CPU0,1.50,msec,cpu-clock,1502781,100.00,1.052,CPUs utilized CPU1,1.48,msec,cpu-clock,1476113,100.00,1.034,CPUs utilized ... results in 8 fields with 7 comma separators. On s390 the output of command: # ./perf stat -x, -A -a --no-merge -- true 0.95,msec,cpu-clock,949800,100.00,1.060,CPUs utilized ... results in 7 fields with 6 comma separators. Therefore this tests fails on s390. Similar issues exist for per-die and per-socket output which is not supported on s390. I have rewritten the python program to count commas in each output line into a bash function to achieve the same result. I hope this makes it a bit easier. Output before: # ./perf test -F 83 83: perf stat CSV output linter : Checking CSV output: no args [Success] Checking CSV output: system wide [Success] Checking CSV output: system wide Checking CSV output: \ system wide no aggregation 6.92,msec,cpu-clock,\ 6918131,100.00,6.972,CPUs utilized ... RuntimeError: wrong number of fields. expected 7 in \ 6.92,msec,cpu-clock,6918131,100.00,6.972,CPUs utilized FAILED! # Output after: # ./perf test -F 83 83: perf stat CSV output linter : Checking CSV output: no args [Success] Checking CSV output: system wide [Success] Checking CSV output: system wide Checking CSV output:\ system wide no aggregation [Success] Checking CSV output: interval [Success] Checking CSV output: event [Success] Checking CSV output: per core [Success] Checking CSV output: per thread [Success] Checking CSV output: per die [Success] Checking CSV output: per node [Success] Checking CSV output: per socket [Success] Ok # Committer notes: Continues to work on x86_64 $ perf test lint 89: perf stat CSV output linter : Ok $ perf test -v lint Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc 89: perf stat CSV output linter : --- start --- test child forked, pid 53133 Checking CSV output: no args [Success] Checking CSV output: system wide [Skip] paranoid and not root Checking CSV output: system wide [Skip] paranoid and not root Checking CSV output: interval [Success] Checking CSV output: event [Success] Checking CSV output: per core [Skip] paranoid and not root Checking CSV output: per thread [Skip] paranoid and not root Checking CSV output: per die [Skip] paranoid and not root Checking CSV output: per node [Skip] paranoid and not root Checking CSV output: per socket [Skip] paranoid and not root test child finished with 0 ---- end ---- perf stat CSV output linter: Ok $ Signed-off-by: Thomas Richter Acked-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Claire Jensen Cc: Heiko Carstens Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Cc: linux390-list@tuxmaker.boeblingen.de.ibm.com Link: https://lore.kernel.org/r/20220603113034.2009728-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 1d98cdf7fa2bc6e8063c0a692a1c091d8ebe3a75 Author: Ian Rogers Date: Mon Jun 6 17:08:51 2022 -0700 perf unwind: Fix uninitialized variable The 'ret' variable may be uninitialized on error goto paths. Fixes: dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects") Reported-by: Sedat Dilek Reviewed-by: Fangrui Song Signed-off-by: Ian Rogers Tested-by: Sedat Dilek # LLVM-14 (x86-64) Cc: Fangrui Song Cc: Ingo Molnar Cc: llvm@lists.linux.dev Cc: Peter Zijlstra Cc: Sebastian Ullrich Link: https://lore.kernel.org/r/20220607000851.39798-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ca5dabcff1df6bc8c413922b5fa63cc602858803 Author: Christophe Leroy Date: Fri Jun 10 17:43:43 2022 +0200 powerpc/prom_init: Fix build failure with GCC_PLUGIN_STRUCTLEAK_BYREF_ALL and KASAN When CONFIG_KASAN is selected, we expect prom_init to use __memset() because it is too early to use memset(). But with CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL, the compiler adds calls to memset() to clear objects on stack, hence the following failure: PROMCHK arch/powerpc/kernel/prom_init_check Error: External symbol 'memset' referenced from prom_init.c make[2]: *** [arch/powerpc/kernel/Makefile:204 : arch/powerpc/kernel/prom_init_check] Erreur 1 prom_find_machine_type() is called from prom_init() and is called only once, so lets put compat[] in BSS instead of stack to avoid that. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3802811f7cf94f730be44688539c01bba3a3b5c0.1654875808.git.christophe.leroy@csgroup.eu commit 9926de7315be3d606cc011a305ad9adb9e8e14c9 Author: Oleksij Rempel Date: Sat Jun 18 14:23:33 2022 +0200 net: phy: at803x: fix NULL pointer dereference on AR9331 PHY Latest kernel will explode on the PHY interrupt config, since it depends now on allocated priv. So, run probe to allocate priv to fix it. ar9331_switch ethernet.1:10 lan0 (uninitialized): PHY [!ahb!ethernet@1a000000!mdio!switch@10:00] driver [Qualcomm Atheros AR9331 built-in PHY] (irq=13) CPU 0 Unable to handle kernel paging request at virtual address 0000000a, epc == 8050e8a8, ra == 80504b34 ... Call Trace: [<8050e8a8>] at803x_config_intr+0x5c/0xd0 [<80504b34>] phy_request_interrupt+0xa8/0xd0 [<8050289c>] phylink_bringup_phy+0x2d8/0x3ac [<80502b68>] phylink_fwnode_phy_connect+0x118/0x130 [<8074d8ec>] dsa_slave_create+0x270/0x420 [<80743b04>] dsa_port_setup+0x12c/0x148 [<8074580c>] dsa_register_switch+0xaf0/0xcc0 [<80511344>] ar9331_sw_probe+0x370/0x388 [<8050cb78>] mdio_probe+0x44/0x70 [<804df300>] really_probe+0x200/0x424 [<804df7b4>] __driver_probe_device+0x290/0x298 [<804df810>] driver_probe_device+0x54/0xe4 [<804dfd50>] __device_attach_driver+0xe4/0x130 [<804dcb00>] bus_for_each_drv+0xb4/0xd8 [<804dfac4>] __device_attach+0x104/0x1a4 [<804ddd24>] bus_probe_device+0x48/0xc4 [<804deb44>] deferred_probe_work_func+0xf0/0x10c [<800a0ffc>] process_one_work+0x314/0x4d4 [<800a17fc>] worker_thread+0x2a4/0x354 [<800a9a54>] kthread+0x134/0x13c [<8006306c>] ret_from_kernel_thread+0x14/0x1c Same Issue would affect some other PHYs (QCA8081, QCA9561), so fix it too. Fixes: 3265f4218878 ("net: phy: at803x: add fiber support") Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8fc74d18639a2402ca52b177e990428e26ea881f Author: Wentao_Liang Date: Sun Jun 19 22:14:54 2022 +0800 drivers/net/ethernet/neterion/vxge: Fix a use-after-free bug in vxge-main.c The pointer vdev points to a memory region adjacent to a net_device structure ndev, which is a field of hldev. At line 4740, the invocation to vxge_device_unregister unregisters device hldev, and it also releases the memory region pointed by vdev->bar0. At line 4743, the freed memory region is referenced (i.e., iounmap(vdev->bar0)), resulting in a use-after-free vulnerability. We can fix the bug by calling iounmap before vxge_device_unregister. 4721. static void vxge_remove(struct pci_dev *pdev) 4722. { 4723. struct __vxge_hw_device *hldev; 4724. struct vxgedev *vdev; … 4731. vdev = netdev_priv(hldev->ndev); … 4740. vxge_device_unregister(hldev); 4741. /* Do not call pci_disable_sriov here, as it will break child devices */ 4742. vxge_hw_device_terminate(hldev); 4743. iounmap(vdev->bar0); … 4749 vxge_debug_init(vdev->level_trace, "%s:%d Device unregistered", 4750 __func__, __LINE__); 4751 vxge_debug_entryexit(vdev->level_trace, "%s:%d Exiting...", __func__, 4752 __LINE__); 4753. } This is the screenshot when the vulnerability is triggered by using KASAN. We can see that there is a use-after-free reported by KASAN. /***************************start**************************/ root@kernel:~# echo 1 > /sys/bus/pci/devices/0000:00:03.0/remove [ 178.296316] vxge_remove [ 182.057081] ================================================================== [ 182.057548] BUG: KASAN: use-after-free in vxge_remove+0xe0/0x15c [ 182.057760] Read of size 8 at addr ffff888006c76598 by task bash/119 [ 182.057983] [ 182.058747] CPU: 0 PID: 119 Comm: bash Not tainted 5.18.0 #5 [ 182.058919] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 182.059463] Call Trace: [ 182.059726] [ 182.060017] dump_stack_lvl+0x34/0x44 [ 182.060316] print_report.cold+0xb2/0x6b7 [ 182.060401] ? kfree+0x89/0x290 [ 182.060478] ? vxge_remove+0xe0/0x15c [ 182.060545] kasan_report+0xa9/0x120 [ 182.060629] ? vxge_remove+0xe0/0x15c [ 182.060706] vxge_remove+0xe0/0x15c [ 182.060793] pci_device_remove+0x5d/0xe0 [ 182.060968] device_release_driver_internal+0xf1/0x180 [ 182.061063] pci_stop_bus_device+0xae/0xe0 [ 182.061150] pci_stop_and_remove_bus_device_locked+0x11/0x20 [ 182.061236] remove_store+0xc6/0xe0 [ 182.061297] ? subordinate_bus_number_show+0xc0/0xc0 [ 182.061359] ? __mutex_lock_slowpath+0x10/0x10 [ 182.061438] ? sysfs_kf_write+0x6d/0xa0 [ 182.061525] kernfs_fop_write_iter+0x1b0/0x260 [ 182.061610] ? sysfs_kf_bin_read+0xf0/0xf0 [ 182.061695] new_sync_write+0x209/0x310 [ 182.061789] ? new_sync_read+0x310/0x310 [ 182.061865] ? cgroup_rstat_updated+0x5c/0x170 [ 182.061937] ? preempt_count_sub+0xf/0xb0 [ 182.061995] ? pick_next_entity+0x13a/0x220 [ 182.062063] ? __inode_security_revalidate+0x44/0x80 [ 182.062155] ? security_file_permission+0x46/0x2a0 [ 182.062230] vfs_write+0x33f/0x3e0 [ 182.062303] ksys_write+0xb4/0x150 [ 182.062369] ? __ia32_sys_read+0x40/0x40 [ 182.062451] do_syscall_64+0x3b/0x90 [ 182.062531] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 182.062894] RIP: 0033:0x7f3f37d17274 [ 182.063558] Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 48 8d 05 89 54 0d 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 49 89 d4 55 48 89 f5 53 [ 182.063797] RSP: 002b:00007ffd5ba9e178 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 182.064117] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f3f37d17274 [ 182.064219] RDX: 0000000000000002 RSI: 000055bbec327180 RDI: 0000000000000001 [ 182.064315] RBP: 000055bbec327180 R08: 000000000000000a R09: 00007f3f37de7cf0 [ 182.064414] R10: 000000000000000a R11: 0000000000000246 R12: 00007f3f37de8760 [ 182.064513] R13: 0000000000000002 R14: 00007f3f37de3760 R15: 0000000000000002 [ 182.064691] [ 182.064916] [ 182.065224] The buggy address belongs to the physical page: [ 182.065804] page:00000000ef31e4f4 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6c76 [ 182.067419] flags: 0x100000000000000(node=0|zone=1) [ 182.068997] raw: 0100000000000000 0000000000000000 ffffea00001b1d88 0000000000000000 [ 182.069118] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 [ 182.069294] page dumped because: kasan: bad access detected [ 182.069331] [ 182.069360] Memory state around the buggy address: [ 182.070006] ffff888006c76480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 182.070136] ffff888006c76500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 182.070230] >ffff888006c76580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 182.070305] ^ [ 182.070456] ffff888006c76600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 182.070505] ffff888006c76680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff [ 182.070606] ================================================================== [ 182.071374] Disabling lock debugging due to kernel taint /*****************************end*****************************/ After fixing the bug as done in the patch, we can find KASAN do not report the bug and the device(00:03.0) has been successfully removed. /*****************************start***************************/ root@kernel:~# echo 1 > /sys/bus/pci/devices/0000:00:03.0/remove root@kernel:~# /******************************end****************************/ Signed-off-by: Wentao_Liang Signed-off-by: David S. Miller commit a1016ba9f908d3d00b9483e2d9d5840ba744f122 Author: Fabio Estevam Date: Tue Jun 7 13:46:40 2022 -0300 ARM: dts: imx7d-smegw01: Fix the SDIO description usdhc2 is connected to a Wifi chip that is powered by a 3.3V supply. Pass the "no-1-8-v" property to guarantee that no communication is made at 1.8V. While at it, also remove the unnecessary properties: "cap-sd-highspeed", "sd-uhs-ddr50", and "mmc-ddr-1_8v". Fixes: 9ac0ae97e349 ("ARM: dts: imx7d-smegw01: Add support for i.MX7D SMEGW01 board") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 354c6e071be986a44b956f7b57f1884244431048 Merge: ace2045ed56f9 1f3ddff375591 Author: Linus Torvalds Date: Sat Jun 18 21:51:12 2022 -0500 Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Fix a variety of bugs, many of which were found by folks using fuzzing or error injection. Also fix up how test_dummy_encryption mount option is handled for the new mount API. Finally, fix/cleanup a number of comments and ext4 Documentation files" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix a doubled word "need" in a comment ext4: add reserved GDT blocks check ext4: make variable "count" signed ext4: correct the judgment of BUG in ext4_mb_normalize_request ext4: fix bug_on ext4_mb_use_inode_pa ext4: fix up test_dummy_encryption handling for new mount API ext4: use kmemdup() to replace kmalloc + memcpy ext4: fix super block checksum incorrect after mount ext4: improve write performance with disabled delalloc ext4: fix warning when submitting superblock in ext4_commit_super() ext4, doc: remove unnecessary escaping ext4: fix incorrect comment in ext4_bio_write_page() fs: fix jbd2_journal_try_to_free_buffers() kernel-doc comment commit ace2045ed56f9b00beb4cd23c76a5b6cae69f2fe Merge: 4b35035bcf80d 5d24968f5b7e0 Author: Linus Torvalds Date: Sat Jun 18 21:44:44 2022 -0500 Merge tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: "Two cifs debugging improvements - one found to deal with debugging a multichannel problem and one for a recent fallocate issue This does include the two larger multichannel reconnect (dynamically adjusting interfaces on reconnect) patches, because we recently found an additional problem with multichannel to one server type that I want to include at the same time" * tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: when a channel is not found for server, log its connection id smb3: add trace point for SMB2_set_eof commit 1f3ddff3755915a2b38de92d53508594de432d3d Author: Xiang wangx Date: Sun Jun 5 17:15:03 2022 +0800 ext4: fix a doubled word "need" in a comment Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20220605091503.12513-1-wangxiang@cdjrlc.com Signed-off-by: Theodore Ts'o commit b55c3cd102a6f48b90e61c44f7f3dda8c290c694 Author: Zhang Yi Date: Wed Jun 1 17:27:17 2022 +0800 ext4: add reserved GDT blocks check We capture a NULL pointer issue when resizing a corrupt ext4 image which is freshly clear resize_inode feature (not run e2fsck). It could be simply reproduced by following steps. The problem is because of the resize_inode feature was cleared, and it will convert the filesystem to meta_bg mode in ext4_resize_fs(), but the es->s_reserved_gdt_blocks was not reduced to zero, so could we mistakenly call reserve_backup_gdb() and passing an uninitialized resize_inode to it when adding new group descriptors. mkfs.ext4 /dev/sda 3G tune2fs -O ^resize_inode /dev/sda #forget to run requested e2fsck mount /dev/sda /mnt resize2fs /dev/sda 8G ======== BUG: kernel NULL pointer dereference, address: 0000000000000028 CPU: 19 PID: 3243 Comm: resize2fs Not tainted 5.18.0-rc7-00001-gfde086c5ebfd #748 ... RIP: 0010:ext4_flex_group_add+0xe08/0x2570 ... Call Trace: ext4_resize_fs+0xbec/0x1660 __ext4_ioctl+0x1749/0x24e0 ext4_ioctl+0x12/0x20 __x64_sys_ioctl+0xa6/0x110 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2dd739617b ======== The fix is simple, add a check in ext4_resize_begin() to make sure that the es->s_reserved_gdt_blocks is zero when the resize_inode feature is disabled. Cc: stable@kernel.org Signed-off-by: Zhang Yi Reviewed-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220601092717.763694-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit bc75a6eb856cb1507fa907bf6c1eda91b3fef52f Author: Ding Xiang Date: Mon May 30 18:00:47 2022 +0800 ext4: make variable "count" signed Since dx_make_map() may return -EFSCORRUPTED now, so change "count" to be a signed integer so we can correctly check for an error code returned by dx_make_map(). Fixes: 46c116b920eb ("ext4: verify dir block before splitting it") Cc: stable@kernel.org Signed-off-by: Ding Xiang Link: https://lore.kernel.org/r/20220530100047.537598-1-dingxiang@cmss.chinamobile.com Signed-off-by: Theodore Ts'o commit cf4ff938b47fc5c00b0ccce53a3b50eca9b32281 Author: Baokun Li Date: Sat May 28 19:00:16 2022 +0800 ext4: correct the judgment of BUG in ext4_mb_normalize_request ext4_mb_normalize_request() can move logical start of allocated blocks to reduce fragmentation and better utilize preallocation. However logical block requested as a start of allocation (ac->ac_o_ex.fe_logical) should always be covered by allocated blocks so we should check that by modifying and to or in the assertion. Signed-off-by: Baokun Li Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220528110017.354175-3-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit a08f789d2ab5242c07e716baf9a835725046be89 Author: Baokun Li Date: Sat May 28 19:00:15 2022 +0800 ext4: fix bug_on ext4_mb_use_inode_pa Hulk Robot reported a BUG_ON: ================================================================== kernel BUG at fs/ext4/mballoc.c:3211! [...] RIP: 0010:ext4_mb_mark_diskspace_used.cold+0x85/0x136f [...] Call Trace: ext4_mb_new_blocks+0x9df/0x5d30 ext4_ext_map_blocks+0x1803/0x4d80 ext4_map_blocks+0x3a4/0x1a10 ext4_writepages+0x126d/0x2c30 do_writepages+0x7f/0x1b0 __filemap_fdatawrite_range+0x285/0x3b0 file_write_and_wait_range+0xb1/0x140 ext4_sync_file+0x1aa/0xca0 vfs_fsync_range+0xfb/0x260 do_fsync+0x48/0xa0 [...] ================================================================== Above issue may happen as follows: ------------------------------------- do_fsync vfs_fsync_range ext4_sync_file file_write_and_wait_range __filemap_fdatawrite_range do_writepages ext4_writepages mpage_map_and_submit_extent mpage_map_one_extent ext4_map_blocks ext4_mb_new_blocks ext4_mb_normalize_request >>> start + size <= ac->ac_o_ex.fe_logical ext4_mb_regular_allocator ext4_mb_simple_scan_group ext4_mb_use_best_found ext4_mb_new_preallocation ext4_mb_new_inode_pa ext4_mb_use_inode_pa >>> set ac->ac_b_ex.fe_len <= 0 ext4_mb_mark_diskspace_used >>> BUG_ON(ac->ac_b_ex.fe_len <= 0); we can easily reproduce this problem with the following commands: `fallocate -l100M disk` `mkfs.ext4 -b 1024 -g 256 disk` `mount disk /mnt` `fsstress -d /mnt -l 0 -n 1000 -p 1` The size must be smaller than or equal to EXT4_BLOCKS_PER_GROUP. Therefore, "start + size <= ac->ac_o_ex.fe_logical" may occur when the size is truncated. So start should be the start position of the group where ac_o_ex.fe_logical is located after alignment. In addition, when the value of fe_logical or EXT4_BLOCKS_PER_GROUP is very large, the value calculated by start_off is more accurate. Cc: stable@kernel.org Fixes: cd648b8a8fd5 ("ext4: trim allocation requests to group size") Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220528110017.354175-2-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 85456054e10b0247920b00422d27365e689d9f4a Author: Eric Biggers Date: Wed May 25 21:04:12 2022 -0700 ext4: fix up test_dummy_encryption handling for new mount API Since ext4 was converted to the new mount API, the test_dummy_encryption mount option isn't being handled entirely correctly, because the needed fscrypt_set_test_dummy_encryption() helper function combines parsing/checking/applying into one function. That doesn't work well with the new mount API, which split these into separate steps. This was sort of okay anyway, due to the parsing logic that was copied from fscrypt_set_test_dummy_encryption() into ext4_parse_param(), combined with an additional check in ext4_check_test_dummy_encryption(). However, these overlooked the case of changing the value of test_dummy_encryption on remount, which isn't allowed but ext4 wasn't detecting until ext4_apply_options() when it's too late to fail. Another bug is that if test_dummy_encryption was specified multiple times with an argument, memory was leaked. Fix this up properly by using the new helper functions that allow splitting up the parse/check/apply steps for test_dummy_encryption. Fixes: cebe85d570cf ("ext4: switch to the new mount api") Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220526040412.173025-1-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit 4efd9f0d120c55b08852ee5605dbb02a77089a5d Author: Shuqi Zhang Date: Wed May 25 11:01:20 2022 +0800 ext4: use kmemdup() to replace kmalloc + memcpy Replace kmalloc + memcpy with kmemdup() Signed-off-by: Shuqi Zhang Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220525030120.803330-1-zhangshuqi3@huawei.com Signed-off-by: Theodore Ts'o commit 9b6641dd95a0c441b277dd72ba22fed8d61f76ad Author: Ye Bin Date: Wed May 25 09:29:04 2022 +0800 ext4: fix super block checksum incorrect after mount We got issue as follows: [home]# mount /dev/sda test EXT4-fs (sda): warning: mounting fs with errors, running e2fsck is recommended [home]# dmesg EXT4-fs (sda): warning: mounting fs with errors, running e2fsck is recommended EXT4-fs (sda): Errors on filesystem, clearing orphan list. EXT4-fs (sda): recovery complete EXT4-fs (sda): mounted filesystem with ordered data mode. Quota mode: none. [home]# debugfs /dev/sda debugfs 1.46.5 (30-Dec-2021) Checksum errors in superblock! Retrying... Reason is ext4_orphan_cleanup will reset ‘s_last_orphan’ but not update super block checksum. To solve above issue, defer update super block checksum after ext4_orphan_cleanup. Signed-off-by: Ye Bin Cc: stable@kernel.org Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220525012904.1604737-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 173940b3ae40114d4179c251a98ee039dc9cd5b3 Author: Liang He Date: Fri Jun 17 19:53:23 2022 +0800 xtensa: xtfpga: Fix refcount leak bug in setup In machine_setup(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: stable@vger.kernel.org Signed-off-by: Liang He Message-Id: <20220617115323.4046905-1-windhl@126.com> Signed-off-by: Max Filippov commit a0117dc956429f2ede17b323046e1968d1849150 Author: Liang He Date: Fri Jun 17 20:44:32 2022 +0800 xtensa: Fix refcount leak bug in time.c In calibrate_ccount(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: stable@vger.kernel.org Signed-off-by: Liang He Message-Id: <20220617124432.4049006-1-windhl@126.com> Signed-off-by: Max Filippov commit 5d24968f5b7e00bae564b1646c3b9e0e3750aabe Author: Shyam Prasad N Date: Tue Jun 14 11:47:24 2022 +0000 cifs: when a channel is not found for server, log its connection id cifs_ses_get_chan_index gets the index for a given server pointer. When a match is not found, we warn about a possible bug. However, printing details about the non-matching server could be more useful to debug here. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit a6e2af64a79afa7f1b29375b5231e840a84bb845 Author: Kuogee Hsieh Date: Thu Jun 16 13:26:40 2022 -0700 drm/msm/dp: force link training for display resolution change Display resolution change is implemented through drm modeset. Older modeset (resolution) has to be disabled first before newer modeset (resolution) can be enabled. Display disable will turn off both pixel clock and main link clock so that main link have to be re-trained during display enable to have new video stream flow again. At current implementation, display enable function manually kicks up irq_hpd_handle which will read panel link status and start link training if link status is not in sync state. However, there is rare case that a particular panel links status keep staying in sync for some period of time after main link had been shut down previously at display disabled. In this case, main link retraining will not be executed by irq_hdp_handle(). Hence video stream of newer display resolution will fail to be transmitted to panel due to main link is not in sync between host and panel. This patch will bypass irq_hpd_handle() in favor of directly call dp_ctrl_on_stream() to always perform link training in regardless of main link status. So that no unexpected exception resolution change failure cases will happen. Also this implementation are more efficient than manual kicking off irq_hpd_handle function. Changes in v2: -- set force_link_train flag on DP only (is_edp == false) Changes in v3: -- revise commit text -- add Fixes tag Changes in v4: -- revise commit text Changes in v5: -- fix spelling at commit text Changes in v6: -- split dp_ctrl_on_stream() for phy test case -- revise commit text for modeset Changes in v7: -- drop 0 assignment at local variable (ret = 0) Changes in v8: -- add patch to remove pixel_rate from dp_ctrl Changes in v9: -- forward declare dp_ctrl_on_stream_phy_test_report() Fixes: 62671d2ef24b ("drm/msm/dp: fixes wrong connection state caused by failure of link train") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/489895/ Link: https://lore.kernel.org/r/1655411200-7255-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark commit 2211e34a9d57973993b644c4a2c76086cb6ce7fd Author: Abhinav Kumar Date: Thu Jun 16 12:26:46 2022 -0700 drm/msm/dpu: limit wb modes based on max_mixer_width As explained in [1], using max_linewidth to limit the modes does not seem to remove 4K modes on chipsets such as sm8250 where the max_linewidth actually supports 4k. This would have been alright if dual SSPP support was present but otherwise fails the per SSPP bandwidth check. The ideal way to implement this would be to filter out the modes which will exceed the bandwidth check by computing it. But this would be an exhaustive solution till we have dual SSPP support. Let's instead use max_mixer_width to limit the modes. max_mixer_width still remains 2560 on sm8250 so even if the max_linewidth is 4096, the only way 4k modes could have been supported is to have source split enabled on the SSPP. Since source split support is not enabled yet in DPU driver, enforce max_mixer_width as the upper limit on the modes. [1] https://patchwork.freedesktop.org/patch/489662/ Fixes: e67dcecda06f ("drm/msm/dpu: limit writeback modes according to max_linewidth") Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/489893/ Link: https://lore.kernel.org/r/1655407606-21760-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Rob Clark commit d80c3ba0ac247791a4ed7a0cd865a64906c8906a Author: Kuogee Hsieh Date: Mon Jun 6 10:55:39 2022 -0700 drm/msm/dp: check core_initialized before disable interrupts at dp_display_unbind() During msm initialize phase, dp_display_unbind() will be called to undo initializations had been done by dp_display_bind() previously if there is error happen at msm_drm_bind. In this case, core_initialized flag had to be check to make sure clocks is on before update DP controller register to disable HPD interrupts. Otherwise system will crash due to below NOC fatal error. QTISECLIB [01f01a7ad]CNOC2 ERROR: ERRLOG0_LOW = 0x00061007 QTISECLIB [01f01a7ad]GEM_NOC ERROR: ERRLOG0_LOW = 0x00001007 QTISECLIB [01f0371a0]CNOC2 ERROR: ERRLOG0_HIGH = 0x00000003 QTISECLIB [01f055297]GEM_NOC ERROR: ERRLOG0_HIGH = 0x00000003 QTISECLIB [01f072beb]CNOC2 ERROR: ERRLOG1_LOW = 0x00000024 QTISECLIB [01f0914b8]GEM_NOC ERROR: ERRLOG1_LOW = 0x00000042 QTISECLIB [01f0ae639]CNOC2 ERROR: ERRLOG1_HIGH = 0x00004002 QTISECLIB [01f0cc73f]GEM_NOC ERROR: ERRLOG1_HIGH = 0x00004002 QTISECLIB [01f0ea092]CNOC2 ERROR: ERRLOG2_LOW = 0x0009020c QTISECLIB [01f10895f]GEM_NOC ERROR: ERRLOG2_LOW = 0x0ae9020c QTISECLIB [01f125ae1]CNOC2 ERROR: ERRLOG2_HIGH = 0x00000000 QTISECLIB [01f143be7]GEM_NOC ERROR: ERRLOG2_HIGH = 0x00000000 QTISECLIB [01f16153a]CNOC2 ERROR: ERRLOG3_LOW = 0x00000000 QTISECLIB [01f17fe07]GEM_NOC ERROR: ERRLOG3_LOW = 0x00000000 QTISECLIB [01f19cf89]CNOC2 ERROR: ERRLOG3_HIGH = 0x00000000 QTISECLIB [01f1bb08e]GEM_NOC ERROR: ERRLOG3_HIGH = 0x00000000 QTISECLIB [01f1d8a31]CNOC2 ERROR: SBM1 FAULTINSTATUS0_LOW = 0x00000002 QTISECLIB [01f1f72a4]GEM_NOC ERROR: SBM0 FAULTINSTATUS0_LOW = 0x00000001 QTISECLIB [01f21a217]CNOC3 ERROR: ERRLOG0_LOW = 0x00000006 QTISECLIB [01f23dfd3]NOC error fatal changes in v2: -- drop the first patch (drm/msm: enable msm irq after all initializations are done successfully at msm_drm_init()) since the problem had been fixed by other patch Fixes: 570d3e5d28db ("drm/msm/dp: stop event kernel thread when DP unbind") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/488387/ Link: https://lore.kernel.org/r/1654538139-7450-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark commit b9cc4598607cb7f7eae5c75fc1e3209cd52ff5e0 Author: Miaoqian Lin Date: Tue Jun 7 15:08:38 2022 +0400 drm/msm/mdp4: Fix refcount leak in mdp4_modeset_init_intf of_graph_get_remote_node() returns remote device node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/488473/ Link: https://lore.kernel.org/r/20220607110841.53889-1-linmq006@gmail.com Signed-off-by: Rob Clark commit c8af219d18502c52319df8d4e3dcfe29a3ca31ab Author: Rob Clark Date: Sat Jun 18 09:11:19 2022 -0700 drm/msm: Don't overwrite hw fence in hw_init Prior to the last commit, this could result in setting the GPU written fence value back to an older value, if we had missed updating completed_fence prior to suspend. This was mostly harmless as the GPU would eventually overwrite it again with the correct value. But we should just not do this. Instead just leave a sanity check that the fence looks plausible (in case the GPU scribbled on memory). Reported-by: Steev Klimaszewski Fixes: 95d1deb02a9c ("drm/msm/gem: Add fenced vma unpin") Signed-off-by: Rob Clark Tested-by: Steev Klimaszewski Patchwork: https://patchwork.freedesktop.org/patch/490138/ Link: https://lore.kernel.org/r/20220618161120.3451993-2-robdclark@gmail.com commit 3c7a52217a8c1e674a9e15b71a7239d71a4d9cfd Author: Rob Clark Date: Sat Jun 18 09:11:18 2022 -0700 drm/msm: Drop update_fences() I noticed while looking at some traces, that we could miss calls to msm_update_fence(), as the irq could have raced with retire_submits() which could have already popped the last submit on a ring out of the queue of in-flight submits. But walking the list of submits in the irq handler isn't really needed, as dma_fence_is_signaled() will dtrt. So lets just drop it entirely. v2: use spin_lock_irqsave/restore as we are no longer protected by the spin_lock_irqsave/restore() in update_fences() Reported-by: Steev Klimaszewski Fixes: 95d1deb02a9c ("drm/msm/gem: Add fenced vma unpin") Signed-off-by: Rob Clark Tested-by: Steev Klimaszewski Patchwork: https://patchwork.freedesktop.org/patch/490136/ Link: https://lore.kernel.org/r/20220618161120.3451993-1-robdclark@gmail.com commit a2b1a5d40bd12b44322c2ccd40bb0ec1699708b6 Author: Peilin Ye Date: Thu Jun 16 16:43:36 2022 -0700 net/sched: sch_netem: Fix arithmetic in netem_dump() for 32-bit platforms As reported by Yuming, currently tc always show a latency of UINT_MAX for netem Qdisc's on 32-bit platforms: $ tc qdisc add dev dummy0 root netem latency 100ms $ tc qdisc show dev dummy0 qdisc netem 8001: root refcnt 2 limit 1000 delay 275s 275s ^^^^^^^^^^^^^^^^ Let us take a closer look at netem_dump(): qopt.latency = min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->latency, UINT_MAX); qopt.latency is __u32, psched_tdiff_t is signed long, (psched_tdiff_t)(UINT_MAX) is negative for 32-bit platforms, so qopt.latency is always UINT_MAX. Fix it by using psched_time_t (u64) instead. Note: confusingly, users have two ways to specify 'latency': 1. normally, via '__u32 latency' in struct tc_netem_qopt; 2. via the TCA_NETEM_LATENCY64 attribute, which is s64. For the second case, theoretically 'latency' could be negative. This patch ignores that corner case, since it is broken (i.e. assigning a negative s64 to __u32) anyways, and should be handled separately. Thanks Ted Lin for the analysis [1] . [1] https://github.com/raspberrypi/linux/issues/3512 Reported-by: Yuming Chen Fixes: 112f9cb65643 ("netem: convert to qdisc_watchdog_schedule_ns") Reviewed-by: Cong Wang Signed-off-by: Peilin Ye Acked-by: Stephen Hemminger Link: https://lore.kernel.org/r/20220616234336.2443-1-yepeilin.cs@gmail.com Signed-off-by: Jakub Kicinski commit a3bb7b63813f674fb62bac321cdd897cc62de094 Author: Ivan Vecera Date: Thu Jun 16 18:08:55 2022 +0200 ethtool: Fix get module eeprom fallback Function fallback_set_params() checks if the module type returned by a driver is ETH_MODULE_SFF_8079 and in this case it assumes that buffer returns a concatenated content of page A0h and A2h. The check is wrong because the correct type is ETH_MODULE_SFF_8472. Fixes: 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command") Signed-off-by: Ivan Vecera Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220616160856.3623273-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski commit 7a9214f3d88cfdb099f3896e102a306b316d8707 Author: Jay Vosburgh Date: Thu Jun 16 12:32:40 2022 -0700 bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers The bonding ARP monitor fails to decrement send_peer_notif, the number of peer notifications (gratuitous ARP or ND) to be sent. This results in a continuous series of notifications. Correct this by decrementing the counter for each notification. Reported-by: Jonathan Toppins Signed-off-by: Jay Vosburgh Fixes: b0929915e035 ("bonding: Fix RTNL: assertion failed at net/core/rtnetlink.c for ab arp monitor") Link: https://lore.kernel.org/netdev/b2fd4147-8f50-bebd-963a-1a3e8d1d9715@redhat.com/ Tested-by: Jonathan Toppins Reviewed-by: Jonathan Toppins Link: https://lore.kernel.org/r/9400.1655407960@famine Signed-off-by: Jakub Kicinski commit 3f6a57ee8544ec3982f8a3cbcbf4aea7d47eb9ec Author: Lorenzo Bianconi Date: Thu Jun 16 16:13:20 2022 +0200 igb: fix a use-after-free issue in igb_clean_tx_ring Fix the following use-after-free bug in igb_clean_tx_ring routine when the NIC is running in XDP mode. The issue can be triggered redirecting traffic into the igb NIC and then closing the device while the traffic is flowing. [ 73.322719] CPU: 1 PID: 487 Comm: xdp_redirect Not tainted 5.18.3-apu2 #9 [ 73.330639] Hardware name: PC Engines APU2/APU2, BIOS 4.0.7 02/28/2017 [ 73.337434] RIP: 0010:refcount_warn_saturate+0xa7/0xf0 [ 73.362283] RSP: 0018:ffffc9000081f798 EFLAGS: 00010282 [ 73.367761] RAX: 0000000000000000 RBX: ffffc90000420f80 RCX: 0000000000000000 [ 73.375200] RDX: ffff88811ad22d00 RSI: ffff88811ad171e0 RDI: ffff88811ad171e0 [ 73.382590] RBP: 0000000000000900 R08: ffffffff82298f28 R09: 0000000000000058 [ 73.390008] R10: 0000000000000219 R11: ffffffff82280f40 R12: 0000000000000090 [ 73.397356] R13: ffff888102343a40 R14: ffff88810359e0e4 R15: 0000000000000000 [ 73.404806] FS: 00007ff38d31d740(0000) GS:ffff88811ad00000(0000) knlGS:0000000000000000 [ 73.413129] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 73.419096] CR2: 000055cff35f13f8 CR3: 0000000106391000 CR4: 00000000000406e0 [ 73.426565] Call Trace: [ 73.429087] [ 73.431314] igb_clean_tx_ring+0x43/0x140 [igb] [ 73.436002] igb_down+0x1d7/0x220 [igb] [ 73.439974] __igb_close+0x3c/0x120 [igb] [ 73.444118] igb_xdp+0x10c/0x150 [igb] [ 73.447983] ? igb_pci_sriov_configure+0x70/0x70 [igb] [ 73.453362] dev_xdp_install+0xda/0x110 [ 73.457371] dev_xdp_attach+0x1da/0x550 [ 73.461369] do_setlink+0xfd0/0x10f0 [ 73.465166] ? __nla_validate_parse+0x89/0xc70 [ 73.469714] rtnl_setlink+0x11a/0x1e0 [ 73.473547] rtnetlink_rcv_msg+0x145/0x3d0 [ 73.477709] ? rtnl_calcit.isra.0+0x130/0x130 [ 73.482258] netlink_rcv_skb+0x8d/0x110 [ 73.486229] netlink_unicast+0x230/0x340 [ 73.490317] netlink_sendmsg+0x215/0x470 [ 73.494395] __sys_sendto+0x179/0x190 [ 73.498268] ? move_addr_to_user+0x37/0x70 [ 73.502547] ? __sys_getsockname+0x84/0xe0 [ 73.506853] ? netlink_setsockopt+0x1c1/0x4a0 [ 73.511349] ? __sys_setsockopt+0xc8/0x1d0 [ 73.515636] __x64_sys_sendto+0x20/0x30 [ 73.519603] do_syscall_64+0x3b/0x80 [ 73.523399] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 73.528712] RIP: 0033:0x7ff38d41f20c [ 73.551866] RSP: 002b:00007fff3b945a68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 73.559640] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ff38d41f20c [ 73.567066] RDX: 0000000000000034 RSI: 00007fff3b945b30 RDI: 0000000000000003 [ 73.574457] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 [ 73.581852] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff3b945ab0 [ 73.589179] R13: 0000000000000000 R14: 0000000000000003 R15: 00007fff3b945b30 [ 73.596545] [ 73.598842] ---[ end trace 0000000000000000 ]--- Fixes: 9cbc948b5a20c ("igb: add XDP support") Signed-off-by: Lorenzo Bianconi Reviewed-by: Jesse Brandeburg Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/e5c01d549dc37bff18e46aeabd6fb28a7bcf84be.1655388571.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit 582573f1b23df1cf7458e665e2aa3acd0551fd2c Merge: b4a028c4d031c c0f3bb4054ef0 Author: Jakub Kicinski Date: Fri Jun 17 18:30:01 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-06-17 We've added 12 non-merge commits during the last 4 day(s) which contain a total of 14 files changed, 305 insertions(+), 107 deletions(-). The main changes are: 1) Fix x86 JIT tailcall count offset on BPF-2-BPF call, from Jakub Sitnicki. 2) Fix a kprobe_multi link bug which misplaces BPF cookies, from Jiri Olsa. 3) Fix an infinite loop when processing a module's BTF, from Kumar Kartikeya Dwivedi. 4) Fix getting a rethook only in RCU available context, from Masami Hiramatsu. 5) Fix request socket refcount leak in sk lookup helpers, from Jon Maxwell. 6) Fix xsk xmit behavior which wrongly adds skb to already full cq, from Ciara Loftus. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: rethook: Reject getting a rethook if RCU is not watching fprobe, samples: Add use_trace option and show hit/missed counter bpf, docs: Update some of the JIT/maintenance entries selftest/bpf: Fix kprobe_multi bench test bpf: Force cookies array to follow symbols sorting ftrace: Keep address offset in ftrace_lookup_symbols selftests/bpf: Shuffle cookies symbols in kprobe multi test selftests/bpf: Test tail call counting with bpf2bpf and data on stack bpf, x86: Fix tail call count offset calculation on bpf2bpf call bpf: Limit maximum modifier chain length in btf_check_type_tags bpf: Fix request_sock leak in sk lookup helpers xsk: Fix generic transmit when completion queue reservation fails ==================== Link: https://lore.kernel.org/r/20220617202119.2421-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 0c0af88f3f318e73237f7fadd02d0bf2b6c996bb Author: Aswath Govindraju Date: Thu May 12 12:18:58 2022 +0530 arm64: dts: ti: k3-am64-main: Remove support for HS400 speed mode AM64 SoC, does not support HS400 and HS200 is the maximum supported speed mode[1]. Therefore, fix the device tree node to reflect the same. [1] - https://www.ti.com/lit/ds/symlink/am6442.pdf (SPRSP56C – JANUARY 2021 – REVISED FEBRUARY 2022) Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC") Signed-off-by: Aswath Govindraju Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220512064859.32059-1-a-govindraju@ti.com commit 856216b70a41ff3f8c866b627546afa01567b389 Author: Matt Ranostay Date: Fri Jun 17 08:13:04 2022 -0700 arm64: dts: ti: k3-j721s2: Fix overlapping GICD memory region GICD region was overlapping with GICR causing the latter to not map successfully, and in turn the gic-v3 driver would fail to initialize. This issue was hidden till commit 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources") replaced of_iomap() calls with of_io_request_and_map() that internally called request_mem_region(). Respective console output before this patchset: [ 0.000000] GICv3: /bus@100000/interrupt-controller@1800000: couldn't map region 0 Fixes: b8545f9d3a54 ("arm64: dts: ti: Add initial support for J721S2 SoC") Cc: linux-stable@vger.kernel.org Cc: Marc Zyngier Cc: Robin Murphy Cc: Nishanth Menon Signed-off-by: Matt Ranostay Acked-by: Marc Zyngier Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220617151304.446607-1-mranostay@ti.com commit 7bc08056a6dabc3a1442216daf527edf61ac24b6 Author: Andrew Donnellan Date: Tue Jun 14 23:49:52 2022 +1000 powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address Add a special case to block_rtas_call() to allow the ibm,platform-dump RTAS call through the RTAS filter if the buffer address is 0. According to PAPR, ibm,platform-dump is called with a null buffer address to notify the platform firmware that processing of a particular dump is finished. Without this, on a pseries machine with CONFIG_PPC_RTAS_FILTER enabled, an application such as rtas_errd that is attempting to retrieve a dump will encounter an error at the end of the retrieval process. Fixes: bd59380c5ba4 ("powerpc/rtas: Restrict RTAS requests from userspace") Cc: stable@vger.kernel.org Reported-by: Sathvika Vasireddy Signed-off-by: Andrew Donnellan Reviewed-by: Tyrel Datwyler Reviewed-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220614134952.156010-1-ajd@linux.ibm.com commit ec6d0dde71d760aa60316f8d1c9a1b0d99213529 Author: Naveen N. Rao Date: Thu Jun 9 16:03:28 2022 +0530 powerpc: Enable execve syscall exit tracepoint On execve[at], we are zero'ing out most of the thread register state including gpr[0], which contains the syscall number. Due to this, we fail to trigger the syscall exit tracepoint properly. Fix this by retaining gpr[0] in the thread register state. Before this patch: # tail /sys/kernel/debug/tracing/trace cat-123 [000] ..... 61.449351: sys_execve(filename: 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8) cat-124 [000] ..... 62.428481: sys_execve(filename: 7fffa6b23448, argv: 7fffa6b233e0, envp: 7fffa6b233f8) echo-125 [000] ..... 65.813702: sys_execve(filename: 7fffa6b23378, argv: 7fffa6b233a0, envp: 7fffa6b233b0) echo-125 [000] ..... 65.822214: sys_execveat(fd: 0, filename: 1009ac48, argv: 7ffff65d0c98, envp: 7ffff65d0ca8, flags: 0) After this patch: # tail /sys/kernel/debug/tracing/trace cat-127 [000] ..... 100.416262: sys_execve(filename: 7fffa41b3448, argv: 7fffa41b33e0, envp: 7fffa41b33f8) cat-127 [000] ..... 100.418203: sys_execve -> 0x0 echo-128 [000] ..... 103.873968: sys_execve(filename: 7fffa41b3378, argv: 7fffa41b33a0, envp: 7fffa41b33b0) echo-128 [000] ..... 103.875102: sys_execve -> 0x0 echo-128 [000] ..... 103.882097: sys_execveat(fd: 0, filename: 1009ac48, argv: 7fffd10d2148, envp: 7fffd10d2158, flags: 0) echo-128 [000] ..... 103.883225: sys_execveat -> 0x0 Cc: stable@vger.kernel.org Signed-off-by: Naveen N. Rao Tested-by: Sumit Dubey2 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220609103328.41306-1-naveen.n.rao@linux.vnet.ibm.com commit e561e472a3d441753bd012333b057f48fef1045b Author: Jason A. Donenfeld Date: Sat Jun 11 17:10:15 2022 +0200 powerpc/pseries: wire up rng during setup_arch() The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire this up. This commit also removes some noisy log messages that don't add much. Fixes: a489043f4626 ("powerpc/pseries: Implement arch_get_random_long() based on H_RANDOM") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Jason A. Donenfeld Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220611151015.548325-4-Jason@zx2c4.com commit 20a9689b3607456d92c6fb764501f6a95950b098 Author: Jason A. Donenfeld Date: Sat Jun 11 17:10:13 2022 +0200 powerpc/microwatt: wire up rng during setup_arch() The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire this up. This commit also removes some noisy log messages that don't add much. Fixes: c25769fddaec ("powerpc/microwatt: Add support for hardware random number generator") Cc: stable@vger.kernel.org # v5.14+ Signed-off-by: Jason A. Donenfeld Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220611151015.548325-2-Jason@zx2c4.com commit 6cf06c17e94f26c290fd3370a5c36514ae15ac43 Author: Michael Ellerman Date: Thu Jun 16 18:41:49 2022 +1000 powerpc/mm: Move CMA reservations after initmem_init() After commit 11ac3e87ce09 ("mm: cma: use pageblock_order as the single alignment") there is an error at boot about the KVM CMA reservation failing, eg: kvm_cma_reserve: reserving 6553 MiB for global area cma: Failed to reserve 6553 MiB That makes it impossible to start KVM guests using the hash MMU with more than 2G of memory, because the VM is unable to allocate a large enough region for the hash page table, eg: $ qemu-system-ppc64 -enable-kvm -M pseries -m 4G ... qemu-system-ppc64: Failed to allocate KVM HPT of order 25: Cannot allocate memory Aneesh pointed out that this happens because when kvm_cma_reserve() is called, pageblock_order has not been initialised yet, and is still zero, causing the checks in cma_init_reserved_mem() against CMA_MIN_ALIGNMENT_PAGES to fail. Fix it by moving the call to kvm_cma_reserve() after initmem_init(). The pageblock_order is initialised in sparse_init() which is called from initmem_init(). Also move the hugetlb CMA reservation. Fixes: 11ac3e87ce09 ("mm: cma: use pageblock_order as the single alignment") Reviewed-by: Aneesh Kumar K.V Reviewed-by: Zi Yan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220616120033.1976732-1-mpe@ellerman.id.au commit 12c3e0c92fd7cb3d3b698d84fdde7dccb6ba8822 Author: Gautam Menghani Date: Sun Jun 12 07:42:32 2022 -0700 tracing/uprobes: Remove unwanted initialization in __trace_uprobe_create() Remove the unwanted initialization of variable 'ret'. This fixes the clang scan warning: Value stored to 'ret' is never read [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20220612144232.145209-1-gautammenghani201@gmail.com Signed-off-by: Gautam Menghani Signed-off-by: Steven Rostedt (Google) commit 93a8c044b9a3711d594702daea9fbe2292c73a42 Author: Xiang wangx Date: Sun Jun 5 17:27:29 2022 +0800 tracefs: Fix syntax errors in comments Delete the redundant word 'to'. Link: https://lkml.kernel.org/r/20220605092729.13010-1-wangxiang@cdjrlc.com Signed-off-by: Xiang wangx Signed-off-by: Steven Rostedt (Google) commit f4b0d318097e45cbac5e14976f8bb56aa2cef504 Author: sunliming Date: Thu Jun 2 22:06:13 2022 +0800 tracing: Simplify conditional compilation code in tracing_set_tracer() Two conditional compilation directives "#ifdef CONFIG_TRACER_MAX_TRACE" are used consecutively, and no other code in between. Simplify conditional the compilation code and only use one "#ifdef CONFIG_TRACER_MAX_TRACE". Link: https://lkml.kernel.org/r/20220602140613.545069-1-sunliming@kylinos.cn Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit 1e7769653b06b56b7ea7d56911d2d5b2957750cd Author: Kirill A. Shutemov Date: Tue Jun 14 15:01:35 2022 +0300 x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page 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. In TDX guests, the second page can be shared page and a VMM may configure it to trigger #VE. The kernel assumes that #VE on a shared page is an MMIO access and tries to decode instruction to handle it. In case of load_unaligned_zeropad() it may result in confusion as it is not MMIO access. Fix it by detecting split page MMIO accesses and failing them. load_unaligned_zeropad() will recover using exception fixups. The issue was discovered by analysis and reproduced artificially. It was not triggered during testing. [ dhansen: fix up changelogs and comments for grammar and clarity, plus incorporate Kirill's off-by-one fix] Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220614120135.14812-4-kirill.shutemov@linux.intel.com commit b9b6d4c925604b70d007feb4c77b8cc4c038d2da Author: Stefan Wahren Date: Wed Jun 15 23:05:34 2022 +0200 ARM: dts: bcm2711-rpi-400: Fix GPIO line names The GPIO expander line names has been fixed in the vendor tree last year, so upstream these changes. Fixes: 1c701accecf2 ("ARM: dts: Add Raspberry Pi 400 support") Reported-by: Ivan T. Ivanov Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit cc72b72073ac982a954d3b43519ca1c28f03c27c Author: Masami Hiramatsu (Google) Date: Sat May 28 00:55:39 2022 +0900 tracing/kprobes: Check whether get_kretprobe() returns NULL in kretprobe_dispatcher() There is a small chance that get_kretprobe(ri) returns NULL in kretprobe_dispatcher() when another CPU unregisters the kretprobe right after __kretprobe_trampoline_handler(). To avoid this issue, kretprobe_dispatcher() checks the get_kretprobe() return value again. And if it is NULL, it returns soon because that kretprobe is under unregistering process. This issue has been introduced when the kretprobe is decoupled from the struct kretprobe_instance by commit d741bf41d7c7 ("kprobes: Remove kretprobe hash"). Before that commit, the struct kretprob_instance::rp directly points the kretprobe and it is never be NULL. Link: https://lkml.kernel.org/r/165366693881.797669.16926184644089588731.stgit@devnote2 Reported-by: Yonghong Song Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash") Cc: Peter Zijlstra Cc: Ingo Molnar Cc: bpf Cc: Kernel Team Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Acked-by: Jiri Olsa Signed-off-by: Steven Rostedt (Google) commit 394e771684f7a2cd4e154647bff50084c31bc7cf Author: Florian Westphal Date: Wed Jun 15 15:36:54 2022 +0200 netfilter: cttimeout: fix slab-out-of-bounds read typo in cttimeout_net_exit syzbot reports: BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid+0xcc/0xf0 lib/list_debug.c:42 [..] list_del include/linux/list.h:148 [inline] cttimeout_net_exit+0x211/0x540 net/netfilter/nfnetlink_cttimeout.c:617 Problem is the wrong name of the list member, so container_of() result is wrong. Reported-by: Fixes: 78222bacfca9 ("netfilter: cttimeout: decouple unlink and free on netns destruction") Signed-off-by: Florian Westphal commit 4b35035bcf80ddb47c0112c4fbd84a63a2836a18 Merge: 32efdbffff280 5ee3d10f84d0a Author: Linus Torvalds Date: Fri Jun 17 15:17:57 2022 -0500 Merge tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client fixes from Anna Schumaker: - Add FMODE_CAN_ODIRECT support to NFSv4 so opens don't fail - Fix trunking detection & cl_max_connect setting - Avoid pnfs_update_layout() livelocks - Don't keep retrying pNFS if the server replies with NFS4ERR_UNAVAILABLE * tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFSv4: Add FMODE_CAN_ODIRECT after successful open of a NFS4.x file sunrpc: set cl_max_connect when cloning an rpc_clnt pNFS: Avoid a live lock condition in pnfs_update_layout() pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE commit 32efdbffff280b304bb2cd48844ee4166078e69c Merge: 93d17c1c8c1cc a2b36ffbf5b6e Author: Linus Torvalds Date: Fri Jun 17 15:12:20 2022 -0500 Merge tag 'pci-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: "Revert clipping of PCI host bridge windows to avoid E820 regions, which broke several machines by forcing unnecessary BAR reassignments (Hans de Goede)" * tag 'pci-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" commit 93d17c1c8c1cc987aad378d5266d99e46efca43c Merge: ef06e68290b2b 38335cc5ffafa Author: Linus Torvalds Date: Fri Jun 17 14:57:42 2022 -0500 Merge tag 'printk-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fixes from Petr Mladek: "Make the global console_sem available for CPU that is handling panic() or shutdown. This is an old problem when an existing console lock owner might block console output, but it became more visible with the kthreads" * tag 'printk-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Wait for the global console lock when the system is going down printk: Block console kthreads when direct printing will be required commit c0f3bb4054ef036e5f67e27f2e3cad9e6512cf00 Author: Masami Hiramatsu (Google) Date: Wed Jun 8 01:11:12 2022 +0900 rethook: Reject getting a rethook if RCU is not watching Since the rethook_recycle() will involve the call_rcu() for reclaiming the rethook_instance, the rethook must be set up at the RCU available context (non idle). This rethook_recycle() in the rethook trampoline handler is inevitable, thus the RCU available check must be done before setting the rethook trampoline. This adds a rcu_is_watching() check in the rethook_try_get() so that it will return NULL if it is called when !rcu_is_watching(). Fixes: 54ecbe6f1ed5 ("rethook: Add a generic return hook") Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Daniel Borkmann Acked-by: Steven Rostedt (Google) Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/165461827269.280167.7379263615545598958.stgit@devnote2 commit c88dbbcd88c233cb759ec857b57864c5bfcea26a Author: Masami Hiramatsu (Google) Date: Wed Jun 8 01:11:02 2022 +0900 fprobe, samples: Add use_trace option and show hit/missed counter Add use_trace option to use trace_printk() instead of pr_info() so that the handler doesn't involve the RCU operations. And show the hit and missed counter so that the user can check how many times the probe handler hit and missed. Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/165461826247.280167.11939123218334322352.stgit@devnote2 commit 63ce81d1c40459e2d9d28f90e2a3e3863e2f63d4 Author: Daniel Borkmann Date: Fri Jun 17 21:42:33 2022 +0200 bpf, docs: Update some of the JIT/maintenance entries Various minor updates around some of the BPF-related entries: JITs for ARM32/NFP/SPARC/X86-32 haven't seen updates in quite a while, thus for now, mark them as 'Odd Fixes' until they become more actively developed. JITs for POWERPC/S390 are in good shape and receive active development and review, thus bump to 'Supported' similar as we have with X86-64/ARM64. JITs for MIPS/RISC-V are in similar good shape as the ones mentioned above, but looked after mostly in spare time, thus leave for now in 'Maintained' state. Add Michael to PPC JIT given he's picking up the patches there, so it better reflects today's state. Also, I haven't done much reviewing around BPF sockmap/kTLS after John and I did the big rework back in the days to integrate sockmap with kTLS. These days, most of this is taken care by John, Jakub {Sitnicki,Kicinski} and others in the community, so remove myself from these two. Lastly, move all BPF-related entries into one place, that is, move the sockmap one over near rest of BPF. Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/r/f9b8a63a0b48dc764bd4c50f87632889f5813f69.1655494758.git.daniel@iogearbox.net Signed-off-by: Alexei Starovoitov commit a2b36ffbf5b6ec301e61249c8b09e610bc80772f Author: Hans de Goede Date: Sun Jun 12 16:43:25 2022 +0200 x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" This reverts commit 4c5e242d3e93. Prior to 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions"), E820 regions did not affect PCI host bridge windows. We only looked at E820 regions and avoided them when allocating new MMIO space. If firmware PCI bridge window and BAR assignments used E820 regions, we left them alone. After 4c5e242d3e93, we removed E820 regions from the PCI host bridge windows before looking at BARs, so firmware assignments in E820 regions looked like errors, and we moved things around to fit in the space left (if any) after removing the E820 regions. This unnecessary BAR reassignment broke several machines. Guilherme reported that Steam Deck fails to boot after 4c5e242d3e93. We clipped the window that contained most 32-bit BARs: BIOS-e820: [mem 0x00000000a0000000-0x00000000a00fffff] reserved acpi PNP0A08:00: clipped [mem 0x80000000-0xf7ffffff window] to [mem 0xa0100000-0xf7ffffff window] for e820 entry [mem 0xa0000000-0xa00fffff] which forced us to reassign all those BARs, for example, this NVMe BAR: pci 0000:00:01.2: PCI bridge to [bus 01] pci 0000:00:01.2: bridge window [mem 0x80600000-0x806fffff] pci 0000:01:00.0: BAR 0: [mem 0x80600000-0x80603fff 64bit] pci 0000:00:01.2: can't claim window [mem 0x80600000-0x806fffff]: no compatible bridge window pci 0000:01:00.0: can't claim BAR 0 [mem 0x80600000-0x80603fff 64bit]: no compatible bridge window pci 0000:00:01.2: bridge window: assigned [mem 0xa0100000-0xa01fffff] pci 0000:01:00.0: BAR 0: assigned [mem 0xa0100000-0xa0103fff 64bit] All the reassignments were successful, so the devices should have been functional at the new addresses, but some were not. Andy reported a similar failure on an Intel MID platform. Benjamin reported a similar failure on a VMWare Fusion VM. Note: this is not a clean revert; this revert keeps the later change to make the clipping dependent on a new pci_use_e820 bool, moving the checking of this bool to arch_remove_reservations(). [bhelgaas: commit log, add more reporters and testers] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216109 Reported-by: Guilherme G. Piccoli Reported-by: Andy Shevchenko Reported-by: Benjamin Coddington Reported-by: Jongman Heo Fixes: 4c5e242d3e93 ("x86/PCI: Clip only host bridge windows for E820 regions") Link: https://lore.kernel.org/r/20220612144325.85366-1-hdegoede@redhat.com Tested-by: Guilherme G. Piccoli Tested-by: Andy Shevchenko Tested-by: Benjamin Coddington Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas commit ef06e68290b2b1b674950da276d6f7724e0b9874 Merge: cc2fb31d49f89 c50f11c6196f4 Author: Linus Torvalds Date: Fri Jun 17 13:55:19 2022 -0500 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Revert the moving of the jump labels initialisation before setup_machine_fdt(). The bug was fixed in drivers/char/random.c. - Ftrace fixes: branch range check and consistent handling of PLTs. - Clean rather than invalidate FROM_DEVICE buffers at start of DMA transfer (safer if such buffer is mapped in user space). A cache invalidation is done already at the end of the transfer. - A couple of clean-ups (unexport symbol, remove unused label). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer arm64/cpufeature: Unexport set_cpu_feature() arm64: ftrace: remove redundant label arm64: ftrace: consistently handle PLTs. arm64: ftrace: fix branch range checks Revert "arm64: Initialize jump labels before setup_machine_fdt()" commit cc2fb31d49f8956283e7cd25face1327dcfa4c16 Merge: f10516322ddab 03dfb4a3abc4c Author: Linus Torvalds Date: Fri Jun 17 13:50:24 2022 -0500 Merge tag 'loongarch-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Add missing ELF_DETAILS in vmlinux.lds.S and fix document rendering" * tag 'loongarch-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: docs/zh_CN/LoongArch: Fix notes rendering by using reST directives docs/LoongArch: Fix notes rendering by using reST directives LoongArch: vmlinux.lds.S: Add missing ELF_DETAILS commit f10516322ddab90e2d9b21990d8c8787c2236b26 Merge: 2d806a688f98a c836d9d17a7d1 Author: Linus Torvalds Date: Fri Jun 17 13:45:47 2022 -0500 Merge tag 'riscv-for-linus-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix for the PolarFire SOC's device tree - A handful of fixes for the recently added Svpmbt support - An improvement to the Kconfig text for Svpbmt * tag 'riscv-for-linus-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol riscv: drop cpufeature_apply_feature tracking variable riscv: fix dependency for t-head errata riscv: dts: microchip: re-add pdma to mpfs device tree commit 2d806a688f98a36792e108ca8583712ee235f815 Merge: 462abc9de7a13 49d6a3c062a10 Author: Linus Torvalds Date: Fri Jun 17 13:39:12 2022 -0500 Merge tag 'hyperv-fixes-signed-20220617' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix hv_init_clocksource annotation (Masahiro Yamada) - Two bug fixes for vmbus driver (Saurabh Sengar) - Fix SEV negotiation (Tianyu Lan) - Fix comments in code (Xiang Wang) - One minor fix to HID driver (Michael Kelley) * tag 'hyperv-fixes-signed-20220617' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM Drivers: hv: vmbus: Release cpu lock in error case HID: hyperv: Correctly access fields declared as __le16 clocksource: hyper-v: unexport __init-annotated hv_init_clocksource() Drivers: hv: Fix syntax errors in comments Drivers: hv: vmbus: Don't assign VMbus channel interrupts to isolated CPUs commit 462abc9de7a13d90c5dcb81f440465041d06ba75 Merge: f8e174c3071dc b96f3cab59654 Author: Linus Torvalds Date: Fri Jun 17 11:22:58 2022 -0700 Merge tag 'block-5.19-2022-06-16' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request from Christoph - Quirks, quirks, quirks to work around buggy consumer grade devices (Keith Bush, Ning Wang, Stefan Reiter, Rasheed Hsueh) - Better kernel messages for devices that need quirking (Keith Bush) - Make a kernel message more useful (Thomas Weißschuh) - MD pull request from Song, with a few fixes - blk-mq sysfs locking fixes (Ming) - BFQ stats fix (Bart) - blk-mq offline queue fix (Bart) - blk-mq flush request tag fix (Ming) * tag 'block-5.19-2022-06-16' of git://git.kernel.dk/linux-block: block/bfq: Enable I/O statistics blk-mq: don't clear flush_rq from tags->rqs[] blk-mq: avoid to touch q->elevator without any protection blk-mq: protect q->elevator by ->sysfs_lock in blk_mq_elv_switch_none block: Fix handling of offline queues in blk_mq_alloc_request_hctx() md/raid5-ppl: Fix argument order in bio_alloc_bioset() Revert "md: don't unregister sync_thread with reconfig_mutex held" nvme-pci: disable write zeros support on UMIC and Samsung SSDs nvme-pci: avoid the deepest sleep state on ZHITAI TiPro7000 SSDs nvme-pci: sk hynix p31 has bogus namespace ids nvme-pci: smi has bogus namespace ids nvme-pci: phison e12 has bogus namespace ids nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S50 nvme-pci: add trouble shooting steps for timeouts nvme: add bug report info for global duplicate id nvme: add device name to warning in uuid_show() commit f8e174c3071dc7614b2a6aa41494b2756d0cd93d Merge: 5c0cd3d4a976b 6436c770f120a Author: Linus Torvalds Date: Fri Jun 17 11:14:07 2022 -0700 Merge tag 'io_uring-5.19-2022-06-16' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Bigger than usual at this time, both because we missed -rc2, but also because of some reverts that we chose to do. In detail: - Adjust mapped buffer API while we still can (Dylan) - Mapped buffer fixes (Dylan, Hao, Pavel, me) - Fix for uring_cmd wrong API usage for task_work (Dylan) - Fix for bug introduced in fixed file closing (Hao) - Fix race in buffer/file resource handling (Pavel) - Revert the NOP support for CQE32 and buffer selection that was brought up during the merge window (Pavel) - Remove IORING_CLOSE_FD_AND_FILE_SLOT introduced in this merge window. The API needs further refining, so just yank it for now and we'll revisit for a later kernel. - Series cleaning up the CQE32 support added in this merge window, making it more integrated rather than sitting on the side (Pavel)" * tag 'io_uring-5.19-2022-06-16' of git://git.kernel.dk/linux-block: (21 commits) io_uring: recycle provided buffer if we punt to io-wq io_uring: do not use prio task_work_add in uring_cmd io_uring: commit non-pollable provided mapped buffers upfront io_uring: make io_fill_cqe_aux honour CQE32 io_uring: remove __io_fill_cqe() helper io_uring: fix ->extra{1,2} misuse io_uring: fill extra big cqe fields from req io_uring: unite fill_cqe and the 32B version io_uring: get rid of __io_fill_cqe{32}_req() io_uring: remove IORING_CLOSE_FD_AND_FILE_SLOT Revert "io_uring: add buffer selection support to IORING_OP_NOP" Revert "io_uring: support CQE32 for nop operation" io_uring: limit size of provided buffer ring io_uring: fix types in provided buffer ring io_uring: fix index calculation io_uring: fix double unlock for pbuf select io_uring: kbuf: fix bug of not consuming ring buffer in partial io case io_uring: openclose: fix bug of closing wrong fixed file io_uring: fix not locked access to fixed buf table io_uring: fix races with buffer table unregister ... commit c50f11c6196f45c92ca48b16a5071615d4ae0572 Author: Will Deacon Date: Fri Jun 10 16:12:27 2022 +0100 arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer Invalidating the buffer memory in arch_sync_dma_for_device() for FROM_DEVICE transfers When using the streaming DMA API to map a buffer prior to inbound non-coherent DMA (i.e. DMA_FROM_DEVICE), we invalidate any dirty CPU cachelines so that they will not be written back during the transfer and corrupt the buffer contents written by the DMA. This, however, poses two potential problems: (1) If the DMA transfer does not write to every byte in the buffer, then the unwritten bytes will contain stale data once the transfer has completed. (2) If the buffer has a virtual alias in userspace, then stale data may be visible via this alias during the period between performing the cache invalidation and the DMA writes landing in memory. Address both of these issues by cleaning (aka writing-back) the dirty lines in arch_sync_dma_for_device(DMA_FROM_DEVICE) instead of discarding them using invalidation. Cc: Ard Biesheuvel Cc: Christoph Hellwig Cc: Robin Murphy Cc: Russell King Cc: Link: https://lore.kernel.org/r/20220606152150.GA31568@willie-the-truck Signed-off-by: Will Deacon Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220610151228.4562-2-will@kernel.org Signed-off-by: Catalin Marinas commit 5c0cd3d4a976b906c3953ff0a0595ba37e04aaa6 Merge: 274295c6e53f8 4bca7e80b6455 Author: Linus Torvalds Date: Fri Jun 17 10:09:24 2022 -0700 Merge tag 'fs_for_v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull writeback and ext2 fixes from Jan Kara: "A fix for writeback bug which prevented machines with kdevtmpfs from booting and also one small ext2 bugfix in IO error handling" * tag 'fs_for_v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: init: Initialize noop_backing_dev_info early ext2: fix fs corruption when trying to remove a non-empty directory with IO error commit f4470dbfb5ff92804650bc71d115c3f150d430f6 Author: Liang He Date: Thu Jun 16 10:17:13 2022 +0800 ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init() In rockchip_suspend_init(), of_find_matching_node_and_match() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220616021713.3973472-1-windhl@126.com Signed-off-by: Heiko Stuebner commit 274295c6e53f8b8b8dfa8b24a3fcb8a9d670c22c Merge: a96e902ba9ab8 85e123c27d5cb Author: Linus Torvalds Date: Fri Jun 17 10:03:53 2022 -0700 Merge tag 'for-5.19/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix a race in DM core's dm_start_io_acct that could result in double accounting for abnormal IO (e.g. discards, write zeroes, etc). - Fix a use-after-free in DM core's dm_put_live_table_bio. - Fix a race for REQ_NOWAIT bios being issued despite no support from underlying DM targets (due to DM table reload at an "unlucky" time) - Fix access beyond allocated bitmap in DM mirror's log. * tag 'for-5.19/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm mirror log: round up region bitmap size to BITS_PER_LONG dm: fix narrow race for REQ_NOWAIT bios being issued despite no support dm: fix use-after-free in dm_put_live_table_bio dm: fix race in dm_start_io_acct commit a96e902ba9ab88f4beb8302c9ade1d53b826a602 Merge: 7c2d03f15f52f ec41c6d82056c Author: Linus Torvalds Date: Fri Jun 17 10:02:26 2022 -0700 Merge tag 'hwmon-for-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Add missing lock protection in occ driver - Add missing comma in board name list in asus-ec-sensors driver - Fix devicetree bindings for ti,tmp401 * tag 'hwmon-for-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (asus-ec-sensors) add missing comma in board name list. hwmon: (occ) Lock mutex in shutdown to prevent race with occ_active dt-bindings: hwmon: ti,tmp401: Drop 'items' from 'ti,n-factor' property commit 7c2d03f15f52fb92d3a0602995fd1fb8fbffd475 Merge: 79fe0f863f920 b6c8cd80ace30 Author: Linus Torvalds Date: Fri Jun 17 10:00:25 2022 -0700 Merge tag 'linux-watchdog-5.19-rc3' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog fix from Wim Van Sebroeck: "Add missing MODULE_LICENSE in gxp driver" * tag 'linux-watchdog-5.19-rc3' of git://www.linux-watchdog.org/linux-watchdog: watchdog: gxp: Add missing MODULE_LICENSE commit 79fe0f863f920c5fcf9dea61676742f813f0b7a6 Merge: f0ec9c65a8d67 abfed87e2a12b Author: Linus Torvalds Date: Fri Jun 17 08:27:27 2022 -0700 Merge tag 'v5.19-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "This fixes a potential build failure when CRYPTO=m" * tag 'v5.19-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: memneq - move into lib/ commit f0ec9c65a8d67e50a16745e62a336355ddf5d03e Merge: 9afc441c3c9c5 0a35780c755cc Author: Linus Torvalds Date: Fri Jun 17 07:58:39 2022 -0700 Merge tag 'char-misc-5.19-rc3' 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 5.19-rc3 that resolve some reported issues. They include: - mei driver fixes - comedi driver fix - rtsx build warning fix - fsl-mc-bus driver fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: eeprom: at25: Split reads into chunks and cap write size misc: atmel-ssc: Fix IRQ check in ssc_probe char: lp: remove redundant initialization of err commit 9afc441c3c9c56f80468c097d25eb1a2a14f0c95 Merge: 62dcd5e198af3 cd756dafd86ee Author: Linus Torvalds Date: Fri Jun 17 07:55:24 2022 -0700 Merge tag 'staging-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are some small staging driver fixes for 5.19-rc3 that resolve reported issues: - remove visorbus.h which was forgotten in the -rc1 merge where the code that used it was removed - olpc_dcon: mark as broken to allow the DRM developers to evolve the fbdev api properly without having to deal with this obsolete driver. It will be removed soon if no one steps up to adopt it and fix the issues with it. - rtl8723bs driver fix - r8188eu driver fix to resolve many reports of the driver being broken with -rc1. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: Also remove the Unisys visorbus.h staging: rtl8723bs: Allocate full pwep structure staging: olpc_dcon: mark driver as broken staging: r8188eu: Fix warning of array overflow in ioctl_linux.c staging: r8188eu: fix rtw_alloc_hwxmits error detection for now commit 62dcd5e198af3b511f3abfd0380a4d71b21b5f6b Merge: 9057a646446c7 be03b0651ffd8 Author: Linus Torvalds Date: Fri Jun 17 07:52:43 2022 -0700 Merge tag 'tty-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are some small tty and serial driver fixes for 5.19-rc3 to resolve some reported problems: - 8250 lsr read bugfix - n_gsm line discipline allocation fix - qcom serial driver fix for reported lockups that happened in -rc1 - goldfish tty driver fix All have been in linux-next for a while now with no reported issues" * tag 'tty-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250: Store to lsr_save_flags after lsr read tty: goldfish: Fix free_irq() on remove tty: serial: qcom-geni-serial: Implement start_rx callback serial: core: Introduce callback for start_rx and do stop_rx in suspend only if this callback implementation is present. tty: n_gsm: Debug output allocation must use GFP_ATOMIC commit 9057a646446c7ff3f1e7a97d0039bde7e7936279 Merge: 47700948a4abb 0698f0209d803 Author: Linus Torvalds Date: Fri Jun 17 07:50:41 2022 -0700 Merge tag 'usb-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are some small USB driver fixes and new device ids for 5.19-rc3 They include: - new usb-serial driver device ids - usb gadget driver fixes for reported problems - cdnsp driver fix - dwc3 driver fixes for reported problems - dwc3 driver fix for merge problem that I caused in 5.18 - xhci driver fixes - dwc2 memory leak fix All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: f_fs: change ep->ep safe in ffs_epfile_io() usb: gadget: f_fs: change ep->status safe in ffs_epfile_io() xhci: Fix null pointer dereference in resume if xhci has only one roothub USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" usb: cdnsp: Fixed setting last_trb incorrectly usb: gadget: u_ether: fix regression in setting fixed MAC address usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe usb: dwc2: Fix memory leak in dwc2_hcd_init usb: dwc3: pci: Restore line lost in merge conflict resolution usb: dwc3: gadget: Fix IN endpoint max packet size allocation USB: serial: option: add support for Cinterion MV31 with new baseline USB: serial: io_ti: add Agilent E5805A support commit d49951219b0249d3eff49e4f02e0de82357bc8a0 Author: Tim Crawford Date: Fri Jun 17 07:30:28 2022 -0600 ALSA: hda/realtek: Add quirk for Clevo PD70PNT Fixes speaker output and headset detection on Clevo PD70PNT. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220617133028.50568-1-tcrawford@system76.com Signed-off-by: Takashi Iwai commit 38335cc5ffafa111210ad6bbe5a63a87db38ee68 Merge: 12831f6486f9d b87f02307d3cf Author: Petr Mladek Date: Fri Jun 17 16:36:48 2022 +0200 Merge branch 'rework/kthreads' into for-linus commit 03dfb4a3abc4cc497850e6968b59005485592369 Author: Yanteng Si Date: Fri Jun 17 20:47:55 2022 +0800 docs/zh_CN/LoongArch: Fix notes rendering by using reST directives Notes are better expressed with reST admonitions. Fixes: f23b22599f8e ("Documentation/zh_CN: Add basic LoongArch documentations") Reviewed-by: WANG Xuerui Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit a667e4d3d0b021e13faad19f59cc49b706ae3d16 Author: Yanteng Si Date: Fri Jun 17 20:47:54 2022 +0800 docs/LoongArch: Fix notes rendering by using reST directives Notes are better expressed with reST admonitions. Fixes: 0ea8ce61cb2c ("Documentation: LoongArch: Add basic documentations") Reviewed-by: WANG Xuerui Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit b672332ef9161f8cada005aaa9b333a19e496f07 Author: Youling Tang Date: Mon Jun 13 18:54:12 2022 +0800 LoongArch: vmlinux.lds.S: Add missing ELF_DETAILS Commit c604abc3f6e ("vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG") splits ELF_DETAILS from STABS_DEBUG, resulting in missing ELF_DETAILS information in LoongArch architecture, so add it. Fixes: c604abc3f6e ("vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG") Signed-off-by: Youling Tang Signed-off-by: Huacai Chen commit a09b314005f3a0956ebf56e01b3b80339df577cc Author: Christoph Hellwig Date: Tue Jun 14 09:48:27 2022 +0200 block: freeze the queue earlier in del_gendisk Freeze the queue earlier in del_gendisk so that the state does not change while we remove debugfs and sysfs files. Ming mentioned that being able to observer request in debugfs might be useful while the queue is being frozen in del_gendisk, which is made possible by this change. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220614074827.458955-5-hch@lst.de Signed-off-by: Jens Axboe commit 99d055b4fd4bbb309c6cdb51a0d420669f777944 Author: Christoph Hellwig Date: Tue Jun 14 09:48:26 2022 +0200 block: remove per-disk debugfs files in blk_unregister_queue The block debugfs files are created in blk_register_queue, which is called by add_disk and use a naming scheme based on the disk_name. After del_gendisk returns that name can be reused and thus we must not leave these debugfs files around, otherwise the kernel is unhappy and spews messages like: Directory XXXXX with parent 'block' already present! and the newly created devices will not have working debugfs files. Move the unregistration to blk_unregister_queue instead (which matches the sysfs unregistration) to make sure the debugfs life time rules match those of the disk name. As part of the move also make sure the whole debugfs unregistration is inside a single debugfs_mutex critical section. Note that this breaks blktests block/002, which checks that the debugfs directory has not been removed while blktests is running, but that particular check should simply be removed from the test case. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220614074827.458955-4-hch@lst.de Signed-off-by: Jens Axboe commit 5cf9c91ba927119fc6606b938b1895bb2459d3bc Author: Christoph Hellwig Date: Tue Jun 14 09:48:25 2022 +0200 block: serialize all debugfs operations using q->debugfs_mutex Various places like I/O schedulers or the QOS infrastructure try to register debugfs files on demans, which can race with creating and removing the main queue debugfs directory. Use the existing debugfs_mutex to serialize all debugfs operations that rely on q->debugfs_dir or the directories hanging off it. To make the teardown code a little simpler declare all debugfs dentry pointers and not just the main one uncoditionally in blkdev.h. Move debugfs_mutex next to the dentries that it protects and document what it is used for. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220614074827.458955-3-hch@lst.de Signed-off-by: Jens Axboe commit 50e34d78815e474d410f342fbe783b18192ca518 Author: Christoph Hellwig Date: Tue Jun 14 09:48:24 2022 +0200 block: disable the elevator int del_gendisk The elevator is only used for file system requests, which are stopped in del_gendisk. Move disabling the elevator and freeing the scheduler tags to the end of del_gendisk instead of doing that work in disk_release and blk_cleanup_queue to avoid a use after free on q->tag_set from disk_release as the tag_set might not be alive at that point. Move the blk_qos_exit call as well, as it just depends on the elevator exit and would be the only reason to keep the not exactly cheap queue freeze in disk_release. Fixes: e155b0c238b2 ("blk-mq: Use shared tags for shared sbitmap support") Reported-by: syzbot+3e3f419f4a7816471838@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig Tested-by: syzbot+3e3f419f4a7816471838@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20220614074827.458955-2-hch@lst.de Signed-off-by: Jens Axboe commit e83031564137cf37e07c2d10ad468046ff48a0cf Author: Nathan Chancellor Date: Wed May 18 11:45:29 2022 -0700 riscv: Fix ALT_THEAD_PMA's asm parameters After commit a35707c3d850 ("riscv: add memory-type errata for T-Head"), builds with LLVM's integrated assembler fail like: In file included from arch/riscv/kernel/asm-offsets.c:10: In file included from ./include/linux/mm.h:29: In file included from ./include/linux/pgtable.h:6: In file included from ./arch/riscv/include/asm/pgtable.h:114: ./arch/riscv/include/asm/pgtable-64.h:210:2: error: invalid input constraint '0' in asm ALT_THEAD_PMA(prot_val); ^ ./arch/riscv/include/asm/errata_list.h:88:4: note: expanded from macro 'ALT_THEAD_PMA' : "0"(_val), \ ^ This was reported upstream to LLVM where Jessica pointed out a couple of issues with the existing implementation of ALT_THEAD_PMA: * t3 is modified but not listed in the clobbers list. * "+r"(_val) marks _val as both an input and output of the asm but then "0"(_val) marks _val as an input matching constraint, which does not make much sense in this situation, as %1 is not actually used in the asm and matching constraints are designed to be used for different inputs that need to use the same register. Drop the matching contraint and shift all the operands by one, as %1 is unused, and mark t3 as clobbered. This resolves the build error and goes not cause any problems with GNU as. Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head") Link: https://github.com/ClangBuiltLinux/linux/issues/1641 Link: https://github.com/llvm/llvm-project/issues/55514 Link: https://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html Suggested-by: Jessica Clarke Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220518184529.454008-1-nathan@kernel.org Signed-off-by: Palmer Dabbelt commit 6436c770f120a9ffeb4e791650467f30f1d062d1 Author: Jens Axboe Date: Fri Jun 17 06:24:26 2022 -0600 io_uring: recycle provided buffer if we punt to io-wq io_arm_poll_handler() will recycle the buffer appropriately if we end up arming poll (or if we're ready to retry), but not for the io-wq case if we have attempted poll first. Explicitly recycle the buffer to avoid both hanging on to it too long, but also to avoid multiple reads grabbing the same one. This can happen for ring mapped buffers, since it hasn't necessarily been committed. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Link: https://github.com/axboe/liburing/issues/605 Signed-off-by: Jens Axboe commit 85ff37e302efdf173cff6d1a310c2f7f38f1d069 Author: Andy Shevchenko Date: Fri May 20 19:47:26 2022 +0300 gpiolib: cdev: Fix kernel doc for struct line Kernel doc validator is not happy: gpiolib-cdev.c:487: warning: Function parameter or member 'hdesc' not described in 'line' gpiolib-cdev.c:487: warning: Function parameter or member 'raw_level' not described in 'line' gpiolib-cdev.c:487: warning: Function parameter or member 'total_discard_seq' not described in 'line' gpiolib-cdev.c:487: warning: Function parameter or member 'last_seqno' not described in 'line' Describe above mentioned parameters. Fixes: 2068339a6c35 ("gpiolib: cdev: Add hardware timestamp clock type") Signed-off-by: Andy Shevchenko Acked-by: Dipen Patel Acked-by: Bartosz Golaszewski Signed-off-by: Thierry Reding commit b4a028c4d031c27704ad73b1195ca69a1206941e Author: Riccardo Paolo Bestetti Date: Fri Jun 17 10:54:35 2022 +0200 ipv4: ping: fix bind address validity check Commit 8ff978b8b222 ("ipv4/raw: support binding to nonlocal addresses") introduced a helper function to fold duplicated validity checks of bind addresses into inet_addr_valid_or_nonlocal(). However, this caused an unintended regression in ping_check_bind_addr(), which previously would reject binding to multicast and broadcast addresses, but now these are both incorrectly allowed as reported in [1]. This patch restores the original check. A simple reordering is done to improve readability and make it evident that multicast and broadcast addresses should not be allowed. Also, add an early exit for INADDR_ANY which replaces lost behavior added by commit 0ce779a9f501 ("net: Avoid unnecessary inet_addr_type() call when addr is INADDR_ANY"). Furthermore, this patch introduces regression selftests to catch these specific cases. [1] https://lore.kernel.org/netdev/CANP3RGdkAcDyAZoT1h8Gtuu0saq+eOrrTiWbxnOs+5zn+cpyKg@mail.gmail.com/ Fixes: 8ff978b8b222 ("ipv4/raw: support binding to nonlocal addresses") Cc: Miaohe Lin Reported-by: Maciej Żenczykowski Signed-off-by: Carlos Llamas Signed-off-by: Riccardo Paolo Bestetti Signed-off-by: David S. Miller commit 2b04495e21cdb9b45c28c6aeb2da560184de20a3 Author: Xu Jia Date: Fri Jun 17 17:31:06 2022 +0800 hamradio: 6pack: fix array-index-out-of-bounds in decode_std_command() Hulk Robot reports incorrect sp->rx_count_cooked value in decode_std_command(). This should be caused by the subtracting from sp->rx_count_cooked before. It seems that sp->rx_count_cooked value is changed to 0, which bypassed the previous judgment. The situation is shown below: (Thread 1) | (Thread 2) decode_std_command() | resync_tnc() ... | if (rest == 2) | sp->rx_count_cooked -= 2; | else if (rest == 3) | ... | sp->rx_count_cooked = 0; sp->rx_count_cooked -= 1; | for (i = 0; i < sp->rx_count_cooked; i++) // report error checksum += sp->cooked_buf[i]; sp->rx_count_cooked is a shared variable but is not protected by a lock. The same applies to sp->rx_count. This patch adds a lock to fix the bug. The fail log is shown below: ======================================================================= UBSAN: array-index-out-of-bounds in drivers/net/hamradio/6pack.c:925:31 index 400 is out of range for type 'unsigned char [400]' CPU: 3 PID: 7433 Comm: kworker/u10:1 Not tainted 5.18.0-rc5-00163-g4b97bac0756a #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: events_unbound flush_to_ldisc Call Trace: dump_stack_lvl+0xcd/0x134 ubsan_epilogue+0xb/0x50 __ubsan_handle_out_of_bounds.cold+0x62/0x6c sixpack_receive_buf+0xfda/0x1330 tty_ldisc_receive_buf+0x13e/0x180 tty_port_default_receive_buf+0x6d/0xa0 flush_to_ldisc+0x213/0x3f0 process_one_work+0x98f/0x1620 worker_thread+0x665/0x1080 kthread+0x2e9/0x3a0 ret_from_fork+0x1f/0x30 ... Reported-by: Hulk Robot Signed-off-by: Xu Jia Signed-off-by: David S. Miller commit 911600bf5a5e84bfda4d33ee32acc75ecf6159f0 Author: Hoang Le Date: Fri Jun 17 08:45:51 2022 +0700 tipc: fix use-after-free Read in tipc_named_reinit syzbot found the following issue on: ================================================================== BUG: KASAN: use-after-free in tipc_named_reinit+0x94f/0x9b0 net/tipc/name_distr.c:413 Read of size 8 at addr ffff88805299a000 by task kworker/1:9/23764 CPU: 1 PID: 23764 Comm: kworker/1:9 Not tainted 5.18.0-rc4-syzkaller-00878-g17d49e6e8012 #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events tipc_net_finalize_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 tipc_named_reinit+0x94f/0x9b0 net/tipc/name_distr.c:413 tipc_net_finalize+0x234/0x3d0 net/tipc/net.c:138 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 [...] ================================================================== In the commit d966ddcc3821 ("tipc: fix a deadlock when flushing scheduled work"), the cancel_work_sync() function just to make sure ONLY the work tipc_net_finalize_work() is executing/pending on any CPU completed before tipc namespace is destroyed through tipc_exit_net(). But this function is not guaranteed the work is the last queued. So, the destroyed instance may be accessed in the work which will try to enqueue later. In order to completely fix, we re-order the calling of cancel_work_sync() to make sure the work tipc_net_finalize_work() was last queued and it must be completed by calling cancel_work_sync(). Reported-by: syzbot+47af19f3307fc9c5c82e@syzkaller.appspotmail.com Fixes: d966ddcc3821 ("tipc: fix a deadlock when flushing scheduled work") Acked-by: Jon Maloy Signed-off-by: Ying Xue Signed-off-by: Hoang Le Signed-off-by: David S. Miller commit e66e257a5d8368d9c0ba13d4630f474436533e8b Author: Jay Vosburgh Date: Thu Jun 16 12:26:30 2022 -0700 veth: Add updating of trans_start Since commit 21a75f0915dd ("bonding: Fix ARP monitor validation"), the bonding ARP / ND link monitors depend on the trans_start time to determine link availability. NETIF_F_LLTX drivers must update trans_start directly, which veth does not do. This prevents use of the ARP or ND link monitors with veth interfaces in a bond. Resolve this by having veth_xmit update the trans_start time. Reported-by: Jonathan Toppins Tested-by: Jonathan Toppins Signed-off-by: Jay Vosburgh Fixes: 21a75f0915dd ("bonding: Fix ARP monitor validation") Link: https://lore.kernel.org/netdev/b2fd4147-8f50-bebd-963a-1a3e8d1d9715@redhat.com/ Signed-off-by: David S. Miller commit cc26c2661fefea215f41edb665193324a5f99021 Author: Eric Dumazet Date: Thu Jun 16 00:34:34 2022 -0700 net: fix data-race in dev_isalive() dev_isalive() is called under RTNL or dev_base_lock protection. This means that changes to dev->reg_state should be done with both locks held. syzbot reported: BUG: KCSAN: data-race in register_netdevice / type_show write to 0xffff888144ecf518 of 1 bytes by task 20886 on cpu 0: register_netdevice+0xb9f/0xdf0 net/core/dev.c:10050 lapbeth_new_device drivers/net/wan/lapbether.c:414 [inline] lapbeth_device_event+0x4a0/0x6c0 drivers/net/wan/lapbether.c:456 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x53/0xb0 kernel/notifier.c:455 __dev_notify_flags+0x1d6/0x3a0 dev_change_flags+0xa2/0xc0 net/core/dev.c:8607 do_setlink+0x778/0x2230 net/core/rtnetlink.c:2780 __rtnl_newlink net/core/rtnetlink.c:3546 [inline] rtnl_newlink+0x114c/0x16a0 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x811/0x8c0 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x13e/0x240 net/netlink/af_netlink.c:2501 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:6107 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x58a/0x660 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x661/0x750 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x21e/0x2c0 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0x74/0x90 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 read to 0xffff888144ecf518 of 1 bytes by task 20423 on cpu 1: dev_isalive net/core/net-sysfs.c:38 [inline] netdev_show net/core/net-sysfs.c:50 [inline] type_show+0x24/0x90 net/core/net-sysfs.c:112 dev_attr_show+0x35/0x90 drivers/base/core.c:2095 sysfs_kf_seq_show+0x175/0x240 fs/sysfs/file.c:59 kernfs_seq_show+0x75/0x80 fs/kernfs/file.c:162 seq_read_iter+0x2c3/0x8e0 fs/seq_file.c:230 kernfs_fop_read_iter+0xd1/0x2f0 fs/kernfs/file.c:235 call_read_iter include/linux/fs.h:2052 [inline] new_sync_read fs/read_write.c:401 [inline] vfs_read+0x5a5/0x6a0 fs/read_write.c:482 ksys_read+0xe8/0x1a0 fs/read_write.c:620 __do_sys_read fs/read_write.c:630 [inline] __se_sys_read fs/read_write.c:628 [inline] __x64_sys_read+0x3e/0x50 fs/read_write.c:628 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 value changed: 0x00 -> 0x01 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 20423 Comm: udevd Tainted: G W 5.19.0-rc2-syzkaller-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit cbc6d44867a24130ee528c20cffcbc28b3e09693 Author: Marc Zyngier Date: Thu Jun 16 09:53:18 2022 +0100 KVM: arm64: Add Oliver as a reviewer Oliver Upton has agreed to help with reviewing the KVM/arm64 patches, and has been doing so for a while now, so adding him as to the reviewer list. Note that Oliver is using a different email address for this purpose, rather than the one his been using for his other contributions. Signed-off-by: Marc Zyngier Acked-by: Oliver Upton Link: https://lore.kernel.org/r/20220616085318.1303657-1-maz@kernel.org commit 56961c6331463cce2d84d0f973177a517fb33a82 Author: Quentin Perret Date: Thu Jun 16 16:11:34 2022 +0000 KVM: arm64: Prevent kmemleak from accessing pKVM memory Commit a7259df76702 ("memblock: make memblock_find_in_range method private") changed the API using which memory is reserved for the pKVM hypervisor. However, memblock_phys_alloc() differs from the original API in terms of kmemleak semantics -- the old one didn't report the reserved regions to kmemleak while the new one does. Unfortunately, when protected KVM is enabled, all kernel accesses to pKVM-private memory result in a fatal exception, which can now happen because of kmemleak scans: $ echo scan > /sys/kernel/debug/kmemleak [ 34.991354] kvm [304]: nVHE hyp BUG at: [] __kvm_nvhe_handle_host_mem_abort+0x270/0x290! [ 34.991580] kvm [304]: Hyp Offset: 0xfffe8be807e00000 [ 34.991813] Kernel panic - not syncing: HYP panic: [ 34.991813] PS:600003c9 PC:0000f418011a3750 ESR:00000000f2000800 [ 34.991813] FAR:ffff000439200000 HPFAR:0000000004792000 PAR:0000000000000000 [ 34.991813] VCPU:0000000000000000 [ 34.993660] CPU: 0 PID: 304 Comm: bash Not tainted 5.19.0-rc2 #102 [ 34.994059] Hardware name: linux,dummy-virt (DT) [ 34.994452] Call trace: [ 34.994641] dump_backtrace.part.0+0xcc/0xe0 [ 34.994932] show_stack+0x18/0x6c [ 34.995094] dump_stack_lvl+0x68/0x84 [ 34.995276] dump_stack+0x18/0x34 [ 34.995484] panic+0x16c/0x354 [ 34.995673] __hyp_pgtable_total_pages+0x0/0x60 [ 34.995933] scan_block+0x74/0x12c [ 34.996129] scan_gray_list+0xd8/0x19c [ 34.996332] kmemleak_scan+0x2c8/0x580 [ 34.996535] kmemleak_write+0x340/0x4a0 [ 34.996744] full_proxy_write+0x60/0xbc [ 34.996967] vfs_write+0xc4/0x2b0 [ 34.997136] ksys_write+0x68/0xf4 [ 34.997311] __arm64_sys_write+0x20/0x2c [ 34.997532] invoke_syscall+0x48/0x114 [ 34.997779] el0_svc_common.constprop.0+0x44/0xec [ 34.998029] do_el0_svc+0x2c/0xc0 [ 34.998205] el0_svc+0x2c/0x84 [ 34.998421] el0t_64_sync_handler+0xf4/0x100 [ 34.998653] el0t_64_sync+0x18c/0x190 [ 34.999252] SMP: stopping secondary CPUs [ 35.000034] Kernel Offset: disabled [ 35.000261] CPU features: 0x800,00007831,00001086 [ 35.000642] Memory Limit: none [ 35.001329] ---[ end Kernel panic - not syncing: HYP panic: [ 35.001329] PS:600003c9 PC:0000f418011a3750 ESR:00000000f2000800 [ 35.001329] FAR:ffff000439200000 HPFAR:0000000004792000 PAR:0000000000000000 [ 35.001329] VCPU:0000000000000000 ]--- Fix this by explicitly excluding the hypervisor's memory pool from kmemleak like we already do for the hyp BSS. Cc: Mike Rapoport Fixes: a7259df76702 ("memblock: make memblock_find_in_range method private") Signed-off-by: Quentin Perret Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220616161135.3997786-1-qperret@google.com commit bb30b453fedac277d66220431fd7063d9ddc10d8 Author: Pierre-Louis Bossart Date: Thu Jun 16 17:29:10 2022 -0500 ALSA: x86: intel_hdmi_audio: use pm_runtime_resume_and_get() The current code does not check for errors and does not release the reference on errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220616222910.136854-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit e87c65aeb46ca4f5b7dc08531200bcb8a426c62e Author: Pierre-Louis Bossart Date: Thu Jun 16 17:29:09 2022 -0500 ALSA: x86: intel_hdmi_audio: enable pm_runtime and set autosuspend delay The existing code uses pm_runtime_get_sync/put_autosuspend, but pm_runtime was not explicitly enabled. The autosuspend delay was not set either, the value is set to 5s since HDMI is rather painful to resume. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220616222910.136854-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 6376ab02374822e1e8758a848ee736a182786a2e Author: Pierre-Louis Bossart Date: Thu Jun 16 17:05:59 2022 -0500 ALSA: hda: intel-nhlt: remove use of __func__ in dev_dbg The module and function information can be added with 'modprobe foo dyndbg=+pmf' Suggested-by: Greg KH 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/20220616220559.136160-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 33fa35db8917118929edacc7fdeebdcde26a6803 Author: Pierre-Louis Bossart Date: Thu Jun 16 15:10:29 2022 -0500 ALSA: hda: intel-dspcfg: use SOF for UpExtreme and UpExtreme11 boards The UpExtreme BIOS reports microphones that are not physically present, so this module ends-up selecting SOF, while the UpExtreme11 BIOS does not report microphones so the snd-hda-intel driver is selected. For consistency use SOF unconditionally in autodetection mode. The use of the snd-hda-intel driver can still be enabled with 'options snd-intel-dspcfg dsp_driver=1' Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220616201029.130477-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 2328fe7a98db3b9d46c41def169e7915dda4b9a9 Author: Jiapeng Chong Date: Wed Jun 15 21:15:03 2022 +0900 firewire: convert sysfs sprintf/snprintf family to sysfs_emit Fix the following coccicheck warning: ./drivers/firewire/core-device.c:375:8-16: WARNING: use scnprintf or sprintf. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220615121505.61412-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit dda8ad0aa8af937feb5113952fb7886c74315010 Author: Takashi Sakamoto Date: Thu May 12 20:20:37 2022 +0900 firewire: cdev: fix potential leak of kernel stack due to uninitialized value Recent change brings potential leak of value on kernel stack to userspace due to uninitialized value. This commit fixes the bug. Reported-by: Dan Carpenter Fixes: baa914cd81f5 ("firewire: add kernel API to access CYCLE_TIME register") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220512112037.103142-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 540a92bfe6dab7310b9df2e488ba247d784d0163 Author: Edward Wu Date: Fri Jun 17 11:32:20 2022 +0800 ata: libata: add qc->flags in ata_qc_complete_template tracepoint Add flags value to check the result of ata completion Fixes: 255c03d15a29 ("libata: Add tracepoints") Cc: stable@vger.kernel.org Signed-off-by: Edward Wu Signed-off-by: Damien Le Moal commit 47700948a4abb4a5ae13ef943ff682a7f327547a Merge: 0639b599f6f3c 65cf7c02cfc7c Author: Linus Torvalds Date: Thu Jun 16 21:39:51 2022 -0700 Merge tag 'drm-fixes-2022-06-17' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular drm fixes for rc3. Nothing too serious, i915, amdgpu and exynos all have a few small driver fixes, and two ttm fixes, and one compiler warning. atomic: - fix spurious compiler warning ttm: - add NULL ptr check in swapout code - fix bulk move handling i915: - Fix page fault on error state read - Fix memory leaks in per-gt sysfs - Fix multiple fence handling - Remove accidental static from a local variable amdgpu: - Fix regression in GTT size reporting - OLED backlight fix exynos: - Check a null pointer instead of IS_ERR() - Rework initialization code of Exynos MIC driver" * tag 'drm-fixes-2022-06-17' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Cap OLED brightness per max frame-average luminance drm/amdgpu: Fix GTT size reporting in amdgpu_ioctl drm/exynos: mic: Rework initialization drm/exynos: fix IS_ERR() vs NULL check in probe drm/ttm: fix bulk move handling v2 drm/i915/uc: remove accidental static from a local variable drm/i915: Individualize fences before adding to dma_resv obj drm/i915/gt: Fix memory leaks in per-gt sysfs drm/i915/reset: Fix error_state_read ptr + offset use drm/ttm: fix missing NULL check in ttm_device_swapout drm/atomic: fix warning of unused variable commit 9b7fd1670a94a57d974795acebde843a5c1a354e Author: Claudiu Manoil Date: Fri Jun 10 11:40:37 2022 +0300 phy: aquantia: Fix AN when higher speeds than 1G are not advertised Even when the eth port is resticted to work with speeds not higher than 1G, and so the eth driver is requesting the phy (via phylink) to advertise up to 1000BASET support, the aquantia phy device is still advertising for 2.5G and 5G speeds. Clear these advertising defaults when requested. Cc: Ondrej Spacek Fixes: 09c4c57f7bc41 ("net: phy: aquantia: add support for auto-negotiation configuration") Signed-off-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220610084037.7625-1-claudiu.manoil@nxp.com Signed-off-by: Jakub Kicinski commit a4a8b2eea49037c1e9aa79654558b6db8cb9d121 Merge: 5e0b0a4c52d30 730067022c013 Author: Alexei Starovoitov Date: Thu Jun 16 19:42:21 2022 -0700 Merge branch 'bpf: Fix cookie values for kprobe multi' Jiri Olsa says: ==================== hi, there's bug in kprobe_multi link that makes cookies misplaced when using symbols to attach. The reason is that we sort symbols by name but not adjacent cookie values. Current test did not find it because bpf_fentry_test* are already sorted by name. v3 changes: - fixed kprobe_multi bench test to filter out invalid entries from available_filter_functions v2 changes: - rebased on top of bpf/master - checking if cookies are defined later in swap function [Andrii] - added acks thanks, jirka ==================== Signed-off-by: Alexei Starovoitov commit 730067022c0137691b27726377c2d088f7f8e33c Author: Jiri Olsa Date: Wed Jun 15 13:21:18 2022 +0200 selftest/bpf: Fix kprobe_multi bench test With [1] the available_filter_functions file contains records starting with __ftrace_invalid_address___ and marking disabled entries. We need to filter them out for the bench test to pass only resolvable symbols to kernel. [1] commit b39181f7c690 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function") Fixes: b39181f7c690 ("ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function") Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220615112118.497303-5-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit eb5fb0325698d05f0bf78d322de82c451a3685a2 Author: Jiri Olsa Date: Wed Jun 15 13:21:17 2022 +0200 bpf: Force cookies array to follow symbols sorting When user specifies symbols and cookies for kprobe_multi link interface it's very likely the cookies will be misplaced and returned to wrong functions (via get_attach_cookie helper). The reason is that to resolve the provided functions we sort them before passing them to ftrace_lookup_symbols, but we do not do the same sort on the cookie values. Fixing this by using sort_r function with custom swap callback that swaps cookie values as well. Fixes: 0236fec57a15 ("bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link") Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220615112118.497303-4-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit eb1b2985fe5c5f02e43e4c0d47bbe7ed835007f3 Author: Jiri Olsa Date: Wed Jun 15 13:21:16 2022 +0200 ftrace: Keep address offset in ftrace_lookup_symbols We want to store the resolved address on the same index as the symbol string, because that's the user (bpf kprobe link) code assumption. Also making sure we don't store duplicates that might be present in kallsyms. Acked-by: Song Liu Acked-by: Steven Rostedt (Google) Fixes: bed0d9a50dac ("ftrace: Add ftrace_lookup_symbols function") Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220615112118.497303-3-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit ad8848535e97f4a5374fc68f7a5d16e2565940cc Author: Jiri Olsa Date: Wed Jun 15 13:21:15 2022 +0200 selftests/bpf: Shuffle cookies symbols in kprobe multi test There's a kernel bug that causes cookies to be misplaced and the reason we did not catch this with this test is that we provide bpf_fentry_test* functions already sorted by name. Shuffling function bpf_fentry_test2 deeper in the list and keeping the current cookie values as before will trigger the bug. The kernel fix is coming in following changes. Acked-by: Song Liu Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220615112118.497303-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit e67679cc4264cf9b318af4e8616eaa2a7565db1f Author: Christian Marangi Date: Thu Jun 16 00:50:12 2022 +0200 mailmap: add entry for Christian Marangi Add entry to map ansuelsmth@gmail.com to the unique identity of Christian Marangi. Link: https://lkml.kernel.org/r/20220615225012.18782-1-ansuelsmth@gmail.com Signed-off-by: Christian Marangi Cc: Jens Axboe Signed-off-by: Andrew Morton commit 67f22ba7750f940bcd7e1b12720896c505c2d63f Author: zhenwei pi Date: Wed Jun 15 17:32:09 2022 +0800 mm/memory-failure: disable unpoison once hw error happens Currently unpoison_memory(unsigned long pfn) is designed for soft poison(hwpoison-inject) only. Since 17fae1294ad9d, the KPTE gets cleared on a x86 platform once hardware memory corrupts. Unpoisoning a hardware corrupted page puts page back buddy only, the kernel has a chance to access the page with *NOT PRESENT* KPTE. This leads BUG during accessing on the corrupted KPTE. Suggested by David&Naoya, disable unpoison mechanism when a real HW error happens to avoid BUG like this: Unpoison: Software-unpoisoned page 0x61234 BUG: unable to handle page fault for address: ffff888061234000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 2c01067 P4D 2c01067 PUD 107267063 PMD 10382b063 PTE 800fffff9edcb062 Oops: 0002 [#1] PREEMPT SMP NOPTI CPU: 4 PID: 26551 Comm: stress Kdump: loaded Tainted: G M OE 5.18.0.bm.1-amd64 #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ... RIP: 0010:clear_page_erms+0x7/0x10 Code: ... RSP: 0000:ffffc90001107bc8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000901 RCX: 0000000000001000 RDX: ffffea0001848d00 RSI: ffffea0001848d40 RDI: ffff888061234000 RBP: ffffea0001848d00 R08: 0000000000000901 R09: 0000000000001276 R10: 0000000000000003 R11: 0000000000000000 R12: 0000000000000001 R13: 0000000000000000 R14: 0000000000140dca R15: 0000000000000001 FS: 00007fd8b2333740(0000) GS:ffff88813fd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff888061234000 CR3: 00000001023d2005 CR4: 0000000000770ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: prep_new_page+0x151/0x170 get_page_from_freelist+0xca0/0xe20 ? sysvec_apic_timer_interrupt+0xab/0xc0 ? asm_sysvec_apic_timer_interrupt+0x1b/0x20 __alloc_pages+0x17e/0x340 __folio_alloc+0x17/0x40 vma_alloc_folio+0x84/0x280 __handle_mm_fault+0x8d4/0xeb0 handle_mm_fault+0xd5/0x2a0 do_user_addr_fault+0x1d0/0x680 ? kvm_read_and_reset_apf_flags+0x3b/0x50 exc_page_fault+0x78/0x170 asm_exc_page_fault+0x27/0x30 Link: https://lkml.kernel.org/r/20220615093209.259374-2-pizhenwei@bytedance.com Fixes: 847ce401df392 ("HWPOISON: Add unpoisoning support") Fixes: 17fae1294ad9d ("x86/{mce,mm}: Unmap the entire page if the whole page is affected and poisoned") Signed-off-by: zhenwei pi Acked-by: David Hildenbrand Acked-by: Naoya Horiguchi Reviewed-by: Miaohe Lin Reviewed-by: Oscar Salvador Cc: Greg Kroah-Hartman Cc: [5.8+] Signed-off-by: Andrew Morton commit 68d32527d340b0d13c8cf6495d6ab4332adca09a Author: Mike Kravetz Date: Mon Jun 13 13:36:48 2022 -0700 hugetlbfs: zero partial pages during fallocate hole punch hugetlbfs fallocate support was originally added with commit 70c3547e36f5 ("hugetlbfs: add hugetlbfs_fallocate()"). Initial support only operated on whole hugetlb pages. This makes sense for populating files as other interfaces such as mmap and truncate require hugetlb page size alignment. Only operating on whole hugetlb pages for the hole punch case was a simplification and there was no compelling use case to zero partial pages. In a recent discussion[1] it was assumed that hugetlbfs hole punch would zero partial hugetlb pages as that is in line with the man page description saying 'partial filesystem blocks are zeroed'. However, the hugetlbfs hole punch code actually does this: hole_start = round_up(offset, hpage_size); hole_end = round_down(offset + len, hpage_size); Modify code to zero partial hugetlb pages in hole punch range. It is possible that application code could note a change in behavior. However, that would imply the code is passing in an unaligned range and expecting only whole pages be removed. This is unlikely as the fallocate documentation states the opposite. The current hugetlbfs fallocate hole punch behavior is tested with the libhugetlbfs test fallocate_align[2]. This test will be updated to validate partial page zeroing. [1] https://lore.kernel.org/linux-mm/20571829-9d3d-0b48-817c-b6b15565f651@redhat.com/ [2] https://github.com/libhugetlbfs/libhugetlbfs/blob/master/tests/fallocate_align.c Link: https://lkml.kernel.org/r/YqeiMlZDKI1Kabfe@monkey Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Naoya Horiguchi Cc: Axel Rasmussen Cc: Dave Hansen Cc: Michal Hocko Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit df4ae285a3d5ce99d69efe81b21c4fed9bbc51b9 Author: Yang Yang Date: Fri Jun 10 02:44:52 2022 +0000 mm: memcontrol: reference to tools/cgroup/memcg_slabinfo.py There is no slabinfo.py in tools/cgroup, but has memcg_slabinfo.py instead. Link: https://lkml.kernel.org/r/20220610024451.744135-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reviewed-by: Muchun Song Acked-by: Roman Gushchin Signed-off-by: Andrew Morton commit 034e5afad921f1c08c001bf147fb1ba76ae33498 Author: Alex Williamson Date: Fri Jun 10 16:35:13 2022 -0600 mm: re-allow pinning of zero pfns The commit referenced below subtly and inadvertently changed the logic to disallow pinning of zero pfns. This breaks device assignment with vfio and potentially various other users of gup. Exclude the zero page test from the negation. Link: https://lkml.kernel.org/r/165490039431.944052.12458624139225785964.stgit@omen Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page") Signed-off-by: Alex Williamson Acked-by: Minchan Kim Acked-by: David Hildenbrand Reported-by: Yishai Hadas Cc: Paul E. McKenney Cc: John Hubbard Cc: John Dias Cc: Jason Gunthorpe Cc: Zhangfei Gao Cc: Matthew Wilcox Cc: Joao Martins Cc: Yi Liu Signed-off-by: Andrew Morton commit 327b18b7aaed5de3b548212e3ab75133bf323759 Author: Jason A. Donenfeld Date: Thu Jun 9 14:33:19 2022 +0200 mm/kfence: select random number before taking raw lock The RNG uses vanilla spinlocks, not raw spinlocks, so kfence should pick its random numbers before taking its raw spinlocks. This also has the nice effect of doing less work inside the lock. It should fix a splat that Geert saw with CONFIG_PROVE_RAW_LOCK_NESTING: dump_backtrace.part.0+0x98/0xc0 show_stack+0x14/0x28 dump_stack_lvl+0xac/0xec dump_stack+0x14/0x2c __lock_acquire+0x388/0x10a0 lock_acquire+0x190/0x2c0 _raw_spin_lock_irqsave+0x6c/0x94 crng_make_state+0x148/0x1e4 _get_random_bytes.part.0+0x4c/0xe8 get_random_u32+0x4c/0x140 __kfence_alloc+0x460/0x5c4 kmem_cache_alloc_trace+0x194/0x1dc __kthread_create_on_node+0x5c/0x1a8 kthread_create_on_node+0x58/0x7c printk_start_kthread.part.0+0x34/0xa8 printk_activate_kthreads+0x4c/0x54 do_one_initcall+0xec/0x278 kernel_init_freeable+0x11c/0x214 kernel_init+0x24/0x124 ret_from_fork+0x10/0x20 Link: https://lkml.kernel.org/r/20220609123319.17576-1-Jason@zx2c4.com Fixes: d4150779e60f ("random32: use real rng for non-deterministic randomness") Signed-off-by: Jason A. Donenfeld Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Reviewed-by: Marco Elver Reviewed-by: Petr Mladek Cc: John Ogness Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 8a6f62a26d1e4e6835fbd4591c2bedcfcceadb1d Author: Huacai Chen Date: Thu Jun 16 20:14:56 2022 +0800 MAINTAINERS: add maillist information for LoongArch Now there is a dedicated maillist (loongarch@lists.linux.dev) for LoongArch, add it for better collaboration. Link: https://lkml.kernel.org/r/20220616121456.3613470-1-chenhuacai@loongson.cn Signed-off-by: Huacai Chen Reviewed-by: WANG Xuerui Cc: Huacai Chen Cc: Arnd Bergmann Cc: Xuefeng Li Cc: Guo Ren Cc: Xuerui Wang Cc: Jiaxun Yang Signed-off-by: Andrew Morton commit f0a7d33a7184df3193e4bd9ef9283a0a92bed4a6 Author: Andrew Morton Date: Wed Jun 15 14:22:44 2022 -0700 MAINTAINERS: update MM tree references Describe the new kernel.org location of the MM trees. Suggested-by: David Hildenbrand Cc: Muchun Song Cc: Greg Kroah-Hartman Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 8585c3971df4bc3b909b5e7e6c7656f379d2642d Author: Abel Vesa Date: Sat Jun 11 12:31:42 2022 +0300 MAINTAINERS: update Abel Vesa's email Use Abel Vesa's kernel.org account in maintainer entry and mailmap. Link: https://lkml.kernel.org/r/20220611093142.202271-1-abelvesa@kernel.org Signed-off-by: Abel Vesa Cc: Stephen Boyd Cc: Dong Aisheng Cc: Arnd Bergmann Signed-off-by: Andrew Morton commit 7757e7627a05c01d137a7fb87ac9d1533f460d33 Author: David Hildenbrand Date: Fri Jun 10 12:12:58 2022 +0200 MAINTAINERS: add MEMORY HOT(UN)PLUG section and add David as reviewer There are certainly a lot more files that partially fall into the memory hot(un)plug category, including parts of mm/sparse.c, mm/page_isolation.c and mm/page_alloc.c. Let's only add what's almost completely memory hot(un)plug related. Add myself as reviewer so it's easier for contributors to figure out whom to CC. Link: https://lkml.kernel.org/r/20220610101258.75738-1-david@redhat.com Link: https://lkml.kernel.org/r/YqlaE/LYHwB0gpaW@localhost.localdomain Signed-off-by: David Hildenbrand Acked-by: Muchun Song Acked-by: Greg Kroah-Hartman Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 6901c0b6df157a88721e5b71f85af4c684877949 Author: Miaohe Lin Date: Tue Jun 7 22:51:35 2022 +0800 MAINTAINERS: add Miaohe Lin as a memory-failure reviewer I have been focusing on mm for the past two years. e.g. fixing bugs, cleaning up the code and reviewing. I would like to help maintainers and people working on memory-failure by reviewing their work. Let me be Cc'd on patches related to memory-failure. Link: https://lkml.kernel.org/r/20220607145135.38670-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 515e1d86c982b169e77cfe245994d2a60fc0d012 Author: Jarkko Sakkinen Date: Tue Jun 7 19:41:39 2022 +0300 mailmap: add alias for jarkko@profian.com Add alias for patches that I contribute on behalf of Profian (my current employer). Link: https://lkml.kernel.org/r/20220607164140.1230876-1-jarkko@kernel.org Signed-off-by: Jarkko Sakkinen Signed-off-by: Andrew Morton commit 2949282938135ab734c3829495ae393523ceb702 Author: SeongJae Park Date: Sat Jun 4 19:50:51 2022 +0000 mm/damon/reclaim: schedule 'damon_reclaim_timer' only after 'system_wq' is initialized Commit 059342d1dd4e ("mm/damon/reclaim: fix the timer always stays active") made DAMON_RECLAIM's 'enabled' parameter store callback, 'enabled_store()', to schedule 'damon_reclaim_timer'. The scheduling uses 'system_wq', which is initialized in 'workqueue_init_early()'. As kernel parameters parsing function ('parse_args()') is called before 'workqueue_init_early()', 'enabled_store()' can be executed before 'workqueue_init_early()' and end up accessing the uninitialized 'system_wq'. As a result, the booting hang[1]. This commit fixes the issue by checking if the initialization is done before scheduling the timer. [1] https://lkml.kernel.org/20220604192222.1488-1-sj@kernel.org/ Link: https://lkml.kernel.org/r/20220604195051.1589-1-sj@kernel.org Fixes: 059342d1dd4e ("mm/damon/reclaim: fix the timer always stays active") Signed-off-by: SeongJae Park Reported-by: Greg White Cc: Hailong Tu Signed-off-by: Andrew Morton commit d25c83c6606ffc3abdf0868136ad3399f648ad70 Author: Petr Mladek Date: Tue Mar 15 11:24:44 2022 +0100 kthread: make it clear that kthread_create_on_node() might be terminated by any fatal signal The comments in kernel/kthread.c create a feeling that only SIGKILL is able to terminate the creation of kernel kthreads by kthread_create()/_on_node()/_on_cpu() APIs. In reality, wait_for_completion_killable() might be killed by any fatal signal that does not have a custom handler: (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) static inline void signal_wake_up(struct task_struct *t, bool resume) { signal_wake_up_state(t, resume ? TASK_WAKEKILL : 0); } static void complete_signal(int sig, struct task_struct *p, enum pid_type type) { [...] /* * Found a killable thread. If the signal will be fatal, * then start taking the whole group down immediately. */ if (sig_fatal(p, sig) ...) { if (!sig_kernel_coredump(sig)) { [...] do { task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK); sigaddset(&t->pending.signal, SIGKILL); signal_wake_up(t, 1); } while_each_thread(p, t); return; } } } Update the comments in kernel/kthread.c to make this more obvious. The motivation for this change was debugging why a module initialization failed. The module was being loaded from initrd. It "magically" failed when systemd was switching to the real root. The clean up operations sent SIGTERM to various pending processed that were started from initrd. Link: https://lkml.kernel.org/r/20220315102444.2380-1-pmladek@suse.com Signed-off-by: Petr Mladek Reviewed-by: "Eric W. Biederman" Cc: Peter Zijlstra Cc: Mathieu Desnoyers Cc: Kees Cook Cc: Marco Elver Cc: Jens Axboe Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 31733463372e8d88ea54bfa1e35178aad9b2ffd2 Author: Marcelo Tosatti Date: Mon May 30 12:51:56 2022 -0300 mm: lru_cache_disable: use synchronize_rcu_expedited commit ff042f4a9b050 ("mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu") replaced lru_cache_disable's usage of work queues with synchronize_rcu. Some users reported large performance regressions due to this commit, for example: https://lore.kernel.org/all/20220521234616.GO1790663@paulmck-ThinkPad-P17-Gen-1/T/ Switching to synchronize_rcu_expedited fixes the problem. Link: https://lkml.kernel.org/r/YpToHCmnx/HEcVyR@fuller.cnet Fixes: ff042f4a9b050 ("mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu") Signed-off-by: Marcelo Tosatti Tested-by: Stefan Wahren Tested-by: Michael Larabel Cc: Sebastian Andrzej Siewior Cc: Nicolas Saenz Julienne Cc: Borislav Petkov Cc: Minchan Kim Cc: Matthew Wilcox Cc: Mel Gorman Cc: Juri Lelli Cc: Thomas Gleixner Cc: Paul E. McKenney Cc: Phil Elwell Cc: Signed-off-by: Andrew Morton commit 042999388ef3dba43e813fdc6d6133ec9ca405dc Author: Yang Li Date: Thu Jun 2 14:21:16 2022 +0800 mm/page_isolation.c: fix one kernel-doc comment Remove one warning found by running scripts/kernel-doc, which is caused by using 'make W=1': mm/page_isolation.c:304: warning: Function parameter or member 'skip_isolation' not described in 'isolate_single_pageblock' Link: https://lkml.kernel.org/r/20220602062116.61199-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li Reported-by: Abaci Robot Signed-off-by: Andrew Morton commit aeaadcde1a60138bceb65de3cdaeec78170b4459 Author: Tyrel Datwyler Date: Thu Jun 16 12:11:25 2022 -0700 scsi: ibmvfc: Store vhost pointer during subcrq allocation Currently the back pointer from a queue to the vhost adapter isn't set until after subcrq interrupt registration. The value is available when a queue is first allocated and can/should be also set for primary and async queues as well as subcrqs. This fixes a crash observed during kexec/kdump on Power 9 with legacy XICS interrupt controller where a pending subcrq interrupt from the previous kernel can be replayed immediately upon IRQ registration resulting in dereference of a garbage backpointer in ibmvfc_interrupt_scsi(). Kernel attempted to read user page (58) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000058 Faulting instruction address: 0xc008000003216a08 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c008000003216a08] ibmvfc_interrupt_scsi+0x40/0xb0 [ibmvfc] LR [c0000000082079e8] __handle_irq_event_percpu+0x98/0x270 Call Trace: [c000000047fa3d80] [c0000000123e6180] 0xc0000000123e6180 (unreliable) [c000000047fa3df0] [c0000000082079e8] __handle_irq_event_percpu+0x98/0x270 [c000000047fa3ea0] [c000000008207d18] handle_irq_event+0x98/0x188 [c000000047fa3ef0] [c00000000820f564] handle_fasteoi_irq+0xc4/0x310 [c000000047fa3f40] [c000000008205c60] generic_handle_irq+0x50/0x80 [c000000047fa3f60] [c000000008015c40] __do_irq+0x70/0x1a0 [c000000047fa3f90] [c000000008016d7c] __do_IRQ+0x9c/0x130 [c000000014622f60] [0000000020000000] 0x20000000 [c000000014622ff0] [c000000008016e50] do_IRQ+0x40/0xa0 [c000000014623020] [c000000008017044] replay_soft_interrupts+0x194/0x2f0 [c000000014623210] [c0000000080172a8] arch_local_irq_restore+0x108/0x170 [c000000014623240] [c000000008eb1008] _raw_spin_unlock_irqrestore+0x58/0xb0 [c000000014623270] [c00000000820b12c] __setup_irq+0x49c/0x9f0 [c000000014623310] [c00000000820b7c0] request_threaded_irq+0x140/0x230 [c000000014623380] [c008000003212a50] ibmvfc_register_scsi_channel+0x1e8/0x2f0 [ibmvfc] [c000000014623450] [c008000003213d1c] ibmvfc_init_sub_crqs+0xc4/0x1f0 [ibmvfc] [c0000000146234d0] [c0080000032145a8] ibmvfc_reset_crq+0x150/0x210 [ibmvfc] [c000000014623550] [c0080000032147c8] ibmvfc_init_crq+0x160/0x280 [ibmvfc] [c0000000146235f0] [c00800000321a9cc] ibmvfc_probe+0x2a4/0x530 [ibmvfc] Link: https://lore.kernel.org/r/20220616191126.1281259-2-tyreld@linux.ibm.com Fixes: 3034ebe26389 ("scsi: ibmvfc: Add alloc/dealloc routines for SCSI Sub-CRQ Channels") Cc: stable@vger.kernel.org Reviewed-by: Brian King Signed-off-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen commit 72ea7fe0db73d65c7d977208842d8ade9b823de9 Author: Tyrel Datwyler Date: Thu Jun 16 12:11:26 2022 -0700 scsi: ibmvfc: Allocate/free queue resource only during probe/remove Currently, the sub-queues and event pool resources are allocated/freed for every CRQ connection event such as reset and LPM. This exposes the driver to a couple issues. First the inefficiency of freeing and reallocating memory that can simply be resued after being sanitized. Further, a system under memory pressue runs the risk of allocation failures that could result in a crippled driver. Finally, there is a race window where command submission/compeletion can try to pull/return elements from/to an event pool that is being deleted or already has been deleted due to the lack of host state around freeing/allocating resources. The following is an example of list corruption following a live partition migration (LPM): Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries Modules linked in: vfat fat isofs cdrom ext4 mbcache jbd2 nft_counter nft_compat nf_tables nfnetlink rpadlpar_io rpaphp xsk_diag nfsv3 nfs_acl nfs lockd grace fscache netfs rfkill bonding tls sunrpc pseries_rng drm drm_panel_orientation_quirks xfs libcrc32c dm_service_time sd_mod t10_pi sg ibmvfc scsi_transport_fc ibmveth vmx_crypto dm_multipath dm_mirror dm_region_hash dm_log dm_mod ipmi_devintf ipmi_msghandler fuse CPU: 0 PID: 2108 Comm: ibmvfc_0 Kdump: loaded Not tainted 5.14.0-70.9.1.el9_0.ppc64le #1 NIP: c0000000007c4bb0 LR: c0000000007c4bac CTR: 00000000005b9a10 REGS: c00000025c10b760 TRAP: 0700 Not tainted (5.14.0-70.9.1.el9_0.ppc64le) MSR: 800000000282b033 CR: 2800028f XER: 0000000f CFAR: c0000000001f55bc IRQMASK: 0 GPR00: c0000000007c4bac c00000025c10ba00 c000000002a47c00 000000000000004e GPR04: c0000031e3006f88 c0000031e308bd00 c00000025c10b768 0000000000000027 GPR08: 0000000000000000 c0000031e3009dc0 00000031e0eb0000 0000000000000000 GPR12: c0000031e2ffffa8 c000000002dd0000 c000000000187108 c00000020fcee2c0 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 c008000002f81300 GPR24: 5deadbeef0000100 5deadbeef0000122 c000000263ba6910 c00000024cc88000 GPR28: 000000000000003c c0000002430a0000 c0000002430ac300 000000000000c300 NIP [c0000000007c4bb0] __list_del_entry_valid+0x90/0x100 LR [c0000000007c4bac] __list_del_entry_valid+0x8c/0x100 Call Trace: [c00000025c10ba00] [c0000000007c4bac] __list_del_entry_valid+0x8c/0x100 (unreliable) [c00000025c10ba60] [c008000002f42284] ibmvfc_free_queue+0xec/0x210 [ibmvfc] [c00000025c10bb10] [c008000002f4246c] ibmvfc_deregister_scsi_channel+0xc4/0x160 [ibmvfc] [c00000025c10bba0] [c008000002f42580] ibmvfc_release_sub_crqs+0x78/0x130 [ibmvfc] [c00000025c10bc20] [c008000002f4f6cc] ibmvfc_do_work+0x5c4/0xc70 [ibmvfc] [c00000025c10bce0] [c008000002f4fdec] ibmvfc_work+0x74/0x1e8 [ibmvfc] [c00000025c10bda0] [c0000000001872b8] kthread+0x1b8/0x1c0 [c00000025c10be10] [c00000000000cd64] ret_from_kernel_thread+0x5c/0x64 Instruction dump: 40820034 38600001 38210060 4e800020 7c0802a6 7c641b78 3c62fe7a 7d254b78 3863b590 f8010070 4ba309cd 60000000 <0fe00000> 7c0802a6 3c62fe7a 3863b640 ---[ end trace 11a2b65a92f8b66c ]--- ibmvfc 30000003: Send warning. Receive queue closed, will retry. Add registration/deregistration helpers that are called instead during connection resets to sanitize and reconfigure the queues. Link: https://lore.kernel.org/r/20220616191126.1281259-3-tyreld@linux.ibm.com Fixes: 3034ebe26389 ("scsi: ibmvfc: Add alloc/dealloc routines for SCSI Sub-CRQ Channels") Cc: stable@vger.kernel.org Reviewed-by: Brian King Signed-off-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen commit 1d3e0980782fbafaf93285779fd3905e4f866802 Author: Saurabh Sengar Date: Tue Jun 14 00:05:55 2022 -0700 scsi: storvsc: Correct reporting of Hyper-V I/O size limits Current code is based on the idea that the max number of SGL entries also determines the max size of an I/O request. While this idea was true in older versions of the storvsc driver when SGL entry length was limited to 4 Kbytes, commit 3d9c3dcc58e9 ("scsi: storvsc: Enable scatterlist entry lengths > 4Kbytes") removed that limitation. It's now theoretically possible for the block layer to send requests that exceed the maximum size supported by Hyper-V. This problem doesn't currently happen in practice because the block layer defaults to a 512 Kbyte maximum, while Hyper-V in Azure supports 2 Mbyte I/O sizes. But some future configuration of Hyper-V could have a smaller max I/O size, and the block layer could exceed that max. Fix this by correctly setting max_sectors as well as sg_tablesize to reflect the maximum I/O size that Hyper-V reports. While allowing I/O sizes larger than the block layer default of 512 Kbytes doesn’t provide any noticeable performance benefit in the tests we ran, it's still appropriate to report the correct underlying Hyper-V capabilities to the Linux block layer. Also tweak the virt_boundary_mask to reflect that the required alignment derives from Hyper-V communication using a 4 Kbyte page size, and not on the guest page size, which might be bigger (eg. ARM64). Link: https://lore.kernel.org/r/1655190355-28722-1-git-send-email-ssengar@linux.microsoft.com Fixes: 3d9c3dcc58e9 ("scsi: storvsc: Enable scatter list entry lengths > 4Kbytes") Reviewed-by: Michael Kelley Signed-off-by: Saurabh Sengar Signed-off-by: Martin K. Petersen commit 65cf7c02cfc7c36a3e86f3da5818dabc32c270ff Merge: d08227a8b1225 7d787184a18f0 Author: Dave Airlie Date: Fri Jun 17 11:32:22 2022 +1000 Merge tag 'exynos-drm-fixes-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes two regression fixups - Check a null pointer instead of IS_ERR(). - Rework initialization code of Exynos MIC driver. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20220614141336.88614-1-inki.dae@samsung.com commit 2acd76e7b8596e307fcec8fc6bc5fe5ab174749a Author: Bart Van Assche Date: Mon Jun 13 14:44:42 2022 -0700 scsi: ufs: Fix a race between the interrupt handler and the reset handler Prevent that both the interrupt handler and the reset handler try to complete a request at the same time. This patch is the result of an analysis of the following crash: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000120 CPU: 0 PID: 0 Comm: swapper/0 Tainted: G OE 5.10.107-android13-4-00051-g1e48e8970cca-ab8664745 #1 pc : ufshcd_release_scsi_cmd+0x30/0x46c lr : __ufshcd_transfer_req_compl+0x4fc/0x9c0 Call trace: ufshcd_release_scsi_cmd+0x30/0x46c __ufshcd_transfer_req_compl+0x4fc/0x9c0 ufshcd_poll+0xf0/0x208 ufshcd_sl_intr+0xb8/0xf0 ufshcd_intr+0x168/0x2f4 __handle_irq_event_percpu+0xa0/0x30c handle_irq_event+0x84/0x178 handle_fasteoi_irq+0x150/0x2e8 __handle_domain_irq+0x114/0x1e4 gic_handle_irq.31846+0x58/0x300 el1_irq+0xe4/0x1c0 cpuidle_enter_state+0x3ac/0x8c4 do_idle+0x2fc/0x55c cpu_startup_entry+0x84/0x90 kernel_init+0x0/0x310 start_kernel+0x0/0x608 start_kernel+0x4ec/0x608 Link: https://lore.kernel.org/r/20220613214442.212466-4-bvanassche@acm.org Reviewed-by: Stanley Chu Reviewed-by: Adrian Hunter Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d1a7644648b7cdacaf8d1013a4285001911e9bc8 Author: Bart Van Assche Date: Mon Jun 13 14:44:41 2022 -0700 scsi: ufs: Support clearing multiple commands at once Modify ufshcd_clear_cmd() such that it supports clearing multiple commands at once instead of one command at a time. This change will be used in a later patch to reduce the time spent in the reset handler. Link: https://lore.kernel.org/r/20220613214442.212466-3-bvanassche@acm.org Reviewed-by: Stanley Chu Reviewed-by: Adrian Hunter Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit da8badd7d3583f447eac2ab65a332f2d773deca1 Author: Bart Van Assche Date: Mon Jun 13 14:44:40 2022 -0700 scsi: ufs: Simplify ufshcd_clear_cmd() Remove the local variable 'err'. This patch does not change any functionality. Link: https://lore.kernel.org/r/20220613214442.212466-2-bvanassche@acm.org Reviewed-by: Stanley Chu Reviewed-by: Adrian Hunter Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d08227a8b1225482aa7640e3f4849595176eac63 Merge: 3f0acf259a287 4fd17f2ac0aa4 Author: Dave Airlie Date: Fri Jun 17 11:17:37 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-06-15' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-06-15: amdgpu: - Fix regression in GTT size reporting - OLED backlight fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220615205609.28763-1-alexander.deucher@amd.com commit 3f0acf259a287b16ec0af8ea8b2ee3fb37575d92 Merge: 2f90ec127195d 2636e00811246 Author: Dave Airlie Date: Fri Jun 17 10:24:42 2022 +1000 Merge tag 'drm-intel-fixes-2022-06-16' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v5.19-rc3: - Fix page fault on error state read - Fix memory leaks in per-gt sysfs - Fix multiple fence handling - Remove accidental static from a local variable Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/8735g5xd25.fsf@intel.com commit 85e123c27d5cbc22cfdc01de1e2ca1d9003a02d0 Author: Mikulas Patocka Date: Thu Jun 16 13:28:57 2022 -0400 dm mirror log: round up region bitmap size to BITS_PER_LONG The code in dm-log rounds up bitset_size to 32 bits. It then uses find_next_zero_bit_le on the allocated region. find_next_zero_bit_le accesses the bitmap using unsigned long pointers. So, on 64-bit architectures, it may access 4 bytes beyond the allocated size. Fix this bug by rounding up bitset_size to BITS_PER_LONG. This bug was found by running the lvm2 testsuite with kasan. Fixes: 29121bd0b00e ("[PATCH] dm mirror log: bitset_size fix") Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 1ee88de395c3ad6791c4baeba40e83b6ec97657a Author: Mikulas Patocka Date: Thu Jun 16 14:14:39 2022 -0400 dm: fix narrow race for REQ_NOWAIT bios being issued despite no support Starting with the commit 63a225c9fd20, device mapper has an optimization that it will take cheaper table lock (dm_get_live_table_fast instead of dm_get_live_table) if the bio has REQ_NOWAIT. The bios with REQ_NOWAIT must not block in the target request routine, if they did, we would be blocking while holding rcu_read_lock, which is prohibited. The targets that are suitable for REQ_NOWAIT optimization (and that don't block in the map routine) have the flag DM_TARGET_NOWAIT set. Device mapper will test if all the targets and all the devices in a table support nowait (see the function dm_table_supports_nowait) and it will set or clear the QUEUE_FLAG_NOWAIT flag on its request queue according to this check. There's a test in submit_bio_noacct: "if ((bio->bi_opf & REQ_NOWAIT) && !blk_queue_nowait(q)) goto not_supported" - this will make sure that REQ_NOWAIT bios can't enter a request queue that doesn't support them. This mechanism works to prevent REQ_NOWAIT bios from reaching dm targets that don't support the REQ_NOWAIT flag (and that may block in the map routine) - except that there is a small race condition: submit_bio_noacct checks if the queue has the QUEUE_FLAG_NOWAIT without holding any locks. Immediatelly after this check, the device mapper table may be reloaded with a table that doesn't support REQ_NOWAIT (for example, if we start moving the logical volume or if we activate a snapshot). However the REQ_NOWAIT bio that already passed the check in submit_bio_noacct would be sent to device mapper, where it could be redirected to a dm target that doesn't support REQ_NOWAIT - the result is sleeping while we hold rcu_read_lock. In order to fix this race, we double-check if the target supports REQ_NOWAIT while we hold the table lock (so that the table can't change under us). Fixes: 563a225c9fd2 ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 5d7362d0d56da3b85b19b5e5ce657026c2eef479 Author: Mikulas Patocka Date: Thu Jun 16 13:21:27 2022 -0400 dm: fix use-after-free in dm_put_live_table_bio dm_put_live_table_bio is called from the end of dm_submit_bio. However, at this point, the bio may be already finished and the caller may have freed the bio. Consequently, dm_put_live_table_bio accesses the stale "bio" pointer. Fix this bug by loading the bi_opf value and passing it to dm_get_live_table_bio and dm_put_live_table_bio instead of the bio. This bug was found by running the lvm2 testsuite with kasan. Fixes: 563a225c9fd2 ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 2f90ec127195d504439f79bbf91eb5e8d0de6ea3 Merge: b13baccc3850c 0f9cd1ea10d30 Author: Dave Airlie Date: Fri Jun 17 09:31:22 2022 +1000 Merge tag 'drm-misc-fixes-2022-06-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Two fixes for TTM, one for a NULL pointer dereference and one to make sure the buffer is pinned prior to a bulk move, and a fix for a spurious compiler warning. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220616072519.qwrsefsemejefowu@houat commit 7c05eae8db9296e28b5dd34deec1ca5ef96d0f08 Author: Steve French Date: Wed Jun 15 22:40:23 2022 -0500 smb3: add trace point for SMB2_set_eof In order to debug problems with file size being reported incorrectly temporarily (in this case xfstest generic/584 intermittent failure) we need to add trace point for the non-compounded code path where we set the file size (SMB2_set_eof). The new trace point is: "smb3_set_eof" Here is sample output from the tracepoint: TASK-PID CPU# ||||| TIMESTAMP FUNCTION | | | ||||| | | xfs_io-75403 [002] ..... 95219.189835: smb3_set_eof: xid=221 sid=0xeef1cbd2 tid=0x27079ee6 fid=0x52edb58c offset=0x100000 aio-dio-append--75418 [010] ..... 95219.242402: smb3_set_eof: xid=226 sid=0xeef1cbd2 tid=0x27079ee6 fid=0xae89852d offset=0x0 Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 9b4d5c01eb234f66a15a746b1c73e10209edb199 Author: Joel Savitz Date: Thu Jun 9 16:32:17 2022 -0400 selftests: make use of GUP_TEST_FILE macro Commit 17de1e559cf1 ("selftests: clarify common error when running gup_test") had most of its hunks dropped due to a conflict with another patch accepted into Linux around the same time that implemented the same behavior as a subset of other changes. However, the remaining hunk defines the GUP_TEST_FILE macro without making use of it. This patch makes use of the macro in the two relevant places. Furthermore, the above mentioned commit's log message erroneously describes the changes that were dropped from the patch. This patch corrects the record. Fixes: 17de1e559cf1 ("selftests: clarify common error when running gup_test") Signed-off-by: Joel Savitz Reviewed-by: Shuah Khan Acked-by: Nico Pache Signed-off-by: Shuah Khan commit b96f3cab59654ee2c30e6adf0b1c13cf8c0850fa Author: Bart Van Assche Date: Mon Jun 13 09:32:34 2022 -0700 block/bfq: Enable I/O statistics BFQ uses io_start_time_ns. That member variable is only set if I/O statistics are enabled. Hence this patch that enables I/O statistics at the time BFQ is associated with a request queue. Compile-tested only. Reported-by: Cixi Geng Cc: Cixi Geng Cc: Yu Kuai Cc: Paolo Valente Reviewed-by: Jan Kara Signed-off-by: Bart Van Assche Signed-off-by: Jens Axboe commit 0639b599f6f3cc871a9e024481a25a7d85946eb8 Merge: 6decbf75c93e6 ef79c396c664b Author: Linus Torvalds Date: Thu Jun 16 15:53:38 2022 -0700 Merge tag 'audit-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "A single audit patch to fix a problem where we were not properly freeing memory allocated when recording information related to a module load" * tag 'audit-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: free module name commit 6decbf75c93e654ce6cb0e93a02ca6575dce9922 Merge: 48a23ec6ff2b2 cad140d00899e Author: Linus Torvalds Date: Thu Jun 16 15:50:36 2022 -0700 Merge tag 'selinux-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux fix from Paul Moore: "A single SELinux patch to fix memory leaks when mounting filesystems with SELinux mount options" * tag 'selinux-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: free contexts previously transferred in selinux_add_opt() commit c836d9d17a7d102ded1ba4dbd4ee0bc42ba26211 Merge: a7c1c97fb1e64 924cbb8cbe346 Author: Palmer Dabbelt Date: Thu Jun 16 15:48:39 2022 -0700 RISC-V: Some Svpbmt fixes Some additionals comments and notes from autobuilders received after the series got applied, warranted some changes. * commit '924cbb8cbe3460ea192e6243017ceb0ceb255b1b': riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol riscv: drop cpufeature_apply_feature tracking variable riscv: fix dependency for t-head errata commit 924cbb8cbe3460ea192e6243017ceb0ceb255b1b Author: Heiko Stuebner Date: Thu May 26 22:56:43 2022 +0200 riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol This improves the symbol's description to make it easier for people to understand what it is about. Suggested-by: Christoph Hellwig Suggested-by: Philipp Tomsich Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220526205646.258337-3-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit 237c0ee4742b6462cb41cdb3fda1ca55011e4aaf Author: Heiko Stuebner Date: Thu May 26 22:56:42 2022 +0200 riscv: drop cpufeature_apply_feature tracking variable The variable was tracking which feature patches got applied but that information was never actually used - and thus resulted in a warning as well. Drop the variable. Reported-by: kernel test robot Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220526205646.258337-2-heiko@sntech.de Fixes: ff689fd21cb1 ("riscv: add RISC-V Svpbmt extension support") Signed-off-by: Palmer Dabbelt commit 21f356f990262329bc387910355833378524fe9f Author: Heiko Stuebner Date: Thu May 26 22:56:45 2022 +0200 riscv: fix dependency for t-head errata alternatives only work correctly on non-xip-kernels and while the selected alternative-symbol has the correct dependency the symbol selecting it also needs that dependency. So add the missing dependency to the T-Head errata Kconfig symbol. Reported-by: kernel test robot Reviewed-by: Guo Ren Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220526205646.258337-5-heiko@sntech.de Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head") Signed-off-by: Palmer Dabbelt commit a7c1c97fb1e64b0825a2ee892d60da6fd22d3b47 Merge: f2906aa863381 5e757deddd918 Author: Palmer Dabbelt Date: Thu Jun 16 15:13:10 2022 -0700 Merge tag 'dt-fixes-for-palmer-5.19-rc3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/conor/linux into fixes Microchip RISC-V devicetree fixes for 5.19-rc3 A single fix for mpfs.dtsi: - The sifive pdma entry fell through the cracks between versions of my dt patches & I gave Zong the wrong conflict resolution, so it is added back. * tag 'dt-fixes-for-palmer-5.19-rc3' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: microchip: re-add pdma to mpfs device tree commit b0017602fdf6bd3f344dd49eaee8b6ffeed6dbac Author: Dominique Martinet Date: Tue Jun 14 12:19:02 2022 +0900 9p: fix EBADF errors in cached mode cached operations sometimes need to do invalid operations (e.g. read on a write only file) Historic fscache had added a "writeback fid", a special handle opened RW as root, for this. The conversion to new fscache missed that bit. This commit reinstates a slightly lesser variant of the original code that uses the writeback fid for partial pages backfills if the regular user fid had been open as WRONLY, and thus would lack read permissions. Link: https://lkml.kernel.org/r/20220614033802.1606738-1-asmadeus@codewreck.org Fixes: eb497943fa21 ("9p: Convert to using the netfs helper lib to do reads and caching") Cc: stable@vger.kernel.org Cc: David Howells Reported-By: Christian Schoenebeck Reviewed-by: Christian Schoenebeck Tested-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 6cfeadbff3f8905f2854735ebb88e581402c16c4 Author: Ming Lei Date: Thu Jun 16 09:44:01 2022 +0800 blk-mq: don't clear flush_rq from tags->rqs[] commit 364b61818f65 ("blk-mq: clearing flush request reference in tags->rqs[]") is added to clear the to-be-free flush request from tags->rqs[] for avoiding use-after-free on the flush rq. Yu Kuai reported that blk_mq_clear_flush_rq_mapping() slows down boot time by ~8s because running scsi probe which may create and remove lots of unpresent LUNs on megaraid-sas which uses BLK_MQ_F_TAG_HCTX_SHARED and each request queue has lots of hw queues. Improve the situation by not running blk_mq_clear_flush_rq_mapping if disk isn't added when there can't be any flush request issued. Reviewed-by: Christoph Hellwig Reported-by: Yu Kuai Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220616014401.817001-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 4d337cebcb1c27d9b48c48b9a98e939d4552d584 Author: Ming Lei Date: Thu Jun 16 09:44:00 2022 +0800 blk-mq: avoid to touch q->elevator without any protection q->elevator is referred in blk_mq_has_sqsched() without any protection, no .q_usage_counter is held, no queue srcu and rcu read lock is held, so potential use-after-free may be triggered. Fix the issue by adding one queue flag for checking if the elevator uses single queue style dispatch. Meantime the elevator feature flag of ELEVATOR_F_MQ_AWARE isn't needed any more. Cc: Jan Kara Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220616014401.817001-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 5fd7a84a09e640016fe106dd3e992f5210e23dc7 Author: Ming Lei Date: Thu Jun 16 09:43:59 2022 +0800 blk-mq: protect q->elevator by ->sysfs_lock in blk_mq_elv_switch_none elevator can be tore down by sysfs switch interface or disk release, so hold ->sysfs_lock before referring to q->elevator, then potential use-after-free can be avoided. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220616014401.817001-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 14dc7a18abbe4176f5626c13c333670da8e06aa1 Author: Bart Van Assche Date: Wed Jun 15 14:00:04 2022 -0700 block: Fix handling of offline queues in blk_mq_alloc_request_hctx() This patch prevents that test nvme/004 triggers the following: UBSAN: array-index-out-of-bounds in block/blk-mq.h:135:9 index 512 is out of range for type 'long unsigned int [512]' Call Trace: show_stack+0x52/0x58 dump_stack_lvl+0x49/0x5e dump_stack+0x10/0x12 ubsan_epilogue+0x9/0x3b __ubsan_handle_out_of_bounds.cold+0x44/0x49 blk_mq_alloc_request_hctx+0x304/0x310 __nvme_submit_sync_cmd+0x70/0x200 [nvme_core] nvmf_connect_io_queue+0x23e/0x2a0 [nvme_fabrics] nvme_loop_connect_io_queues+0x8d/0xb0 [nvme_loop] nvme_loop_create_ctrl+0x58e/0x7d0 [nvme_loop] nvmf_create_ctrl+0x1d7/0x4d0 [nvme_fabrics] nvmf_dev_write+0xae/0x111 [nvme_fabrics] vfs_write+0x144/0x560 ksys_write+0xb7/0x140 __x64_sys_write+0x42/0x50 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Cc: Christoph Hellwig Cc: Ming Lei Fixes: 20e4d8139319 ("blk-mq: simplify queue mapping & schedule with each possisble CPU") Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220615210004.1031820-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit 3084a4ec7f9bb1ec90036cfd01b1abadc5dd4fb2 Author: Ding Xiang Date: Wed Jun 15 17:36:29 2022 +0800 selftests: vm: Fix resource leak when return error When return on an error path, file handle need to be closed to prevent resource leak Signed-off-by: Ding Xiang Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit 12a29115be72dfc72372af9ded4bc4ae7113a729 Author: Yu Liao Date: Tue Jun 14 20:02:35 2022 +0800 selftests dma: fix compile error for dma_map_benchmark When building selftests/dma: $ make -C tools/testing/selftests TARGETS=dma I hit the following compilation error: dma_map_benchmark.c:13:10: fatal error: linux/map_benchmark.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~~~~~ dma/Makefile does not include the map_benchmark.h path, so add more including path, and fix include order in dma_map_benchmark.c Fixes: 8ddde07a3d28 ("dma-mapping: benchmark: extract a common header file for map_benchmark definition") Signed-off-by: Yu Liao Tested-by: Shuah Khan Signed-off-by: Shuah Khan commit 5e0b0a4c52d30bb09659446f40b77a692361600d Author: Jakub Sitnicki Date: Thu Jun 16 18:20:37 2022 +0200 selftests/bpf: Test tail call counting with bpf2bpf and data on stack Cover the case when tail call count needs to be passed from BPF function to BPF function, and the caller has data on stack. Specifically when the size of data allocated on BPF stack is not a multiple on 8. Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220616162037.535469-3-jakub@cloudflare.com commit ff672c67ee7635ca1e28fb13729e8ef0d1f08ce5 Author: Jakub Sitnicki Date: Thu Jun 16 18:20:36 2022 +0200 bpf, x86: Fix tail call count offset calculation on bpf2bpf call On x86-64 the tail call count is passed from one BPF function to another through %rax. Additionally, on function entry, the tail call count value is stored on stack right after the BPF program stack, due to register shortage. The stored count is later loaded from stack either when performing a tail call - to check if we have not reached the tail call limit - or before calling another BPF function call in order to pass it via %rax. In the latter case, we miscalculate the offset at which the tail call count was stored on function entry. The JIT does not take into account that the allocated BPF program stack is always a multiple of 8 on x86, while the actual stack depth does not have to be. This leads to a load from an offset that belongs to the BPF stack, as shown in the example below: SEC("tc") int entry(struct __sk_buff *skb) { /* Have data on stack which size is not a multiple of 8 */ volatile char arr[1] = {}; return subprog_tail(skb); } int entry(struct __sk_buff * skb): 0: (b4) w2 = 0 1: (73) *(u8 *)(r10 -1) = r2 2: (85) call pc+1#bpf_prog_ce2f79bb5f3e06dd_F 3: (95) exit int entry(struct __sk_buff * skb): 0xffffffffa0201788: nop DWORD PTR [rax+rax*1+0x0] 0xffffffffa020178d: xor eax,eax 0xffffffffa020178f: push rbp 0xffffffffa0201790: mov rbp,rsp 0xffffffffa0201793: sub rsp,0x8 0xffffffffa020179a: push rax 0xffffffffa020179b: xor esi,esi 0xffffffffa020179d: mov BYTE PTR [rbp-0x1],sil 0xffffffffa02017a1: mov rax,QWORD PTR [rbp-0x9] !!! tail call count 0xffffffffa02017a8: call 0xffffffffa02017d8 !!! is at rbp-0x10 0xffffffffa02017ad: leave 0xffffffffa02017ae: ret Fix it by rounding up the BPF stack depth to a multiple of 8, when calculating the tail call count offset on stack. Fixes: ebf7d1f508a7 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Maciej Fijalkowski Acked-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220616162037.535469-2-jakub@cloudflare.com commit 07fd5b6cdf3cc30bfde8fe0f644771688be04447 Author: Tejun Heo Date: Mon Jun 13 12:19:50 2022 -1000 cgroup: Use separate src/dst nodes when preloading css_sets for migration Each cset (css_set) is pinned by its tasks. When we're moving tasks around across csets for a migration, we need to hold the source and destination csets to ensure that they don't go away while we're moving tasks about. This is done by linking cset->mg_preload_node on either the mgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using the same cset->mg_preload_node for both the src and dst lists was deemed okay as a cset can't be both the source and destination at the same time. Unfortunately, this overloading becomes problematic when multiple tasks are involved in a migration and some of them are identity noop migrations while others are actually moving across cgroups. For example, this can happen with the following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procs the process including the group leader back into a. In this final migration, non-leader threads would be doing identity migration while the group leader is doing an actual one. After #3, let's say the whole process was in cset A, and that after #4, the leader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it's an identity migration, it culls it by list_del_init()'ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list. This means that A isn't held while migration is in progress. If all tasks leave A before the migration finishes and the incoming task pins it, the cset will be destroyed leading to use-after-free. This is caused by overloading cset->mg_preload_node for both src and dst preload lists. We wanted to exclude the cset from the src list but ended up inadvertently excluding it from the dst list too. This patch fixes the issue by separating out cset->mg_preload_node into ->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dst preloadings don't interfere with each other. Signed-off-by: Tejun Heo Reported-by: Mukesh Ojha Reported-by: shisiyuan Link: http://lkml.kernel.org/r/1654187688-27411-1-git-send-email-shisiyuan@xiaomi.com Link: https://www.spinics.net/lists/cgroups/msg33313.html Fixes: f817de98513d ("cgroup: prepare migration path for unified hierarchy") Cc: stable@vger.kernel.org # v3.16+ commit 48a23ec6ff2b2a5effe8d3ae5f17fc6b7f35df65 Merge: 30306f6194cad 2e7bf4a6af482 Author: Linus Torvalds Date: Thu Jun 16 11:51:32 2022 -0700 Merge tag 'net-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Mostly driver fixes. Current release - regressions: - Revert "net: Add a second bind table hashed by port and address", needs more work - amd-xgbe: use platform_irq_count(), static setup of IRQ resources had been removed from DT core - dts: at91: ksz9477_evb: add phy-mode to fix port/phy validation Current release - new code bugs: - hns3: modify the ring param print info Previous releases - always broken: - axienet: make the 64b addressable DMA depends on 64b architectures - iavf: fix issue with MAC address of VF shown as zero - ice: fix PTP TX timestamp offset calculation - usb: ax88179_178a needs FLAG_SEND_ZLP Misc: - document some net.sctp.* sysctls" * tag 'net-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (31 commits) net: axienet: add missing error return code in axienet_probe() Revert "net: Add a second bind table hashed by port and address" net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg net: usb: ax88179_178a needs FLAG_SEND_ZLP MAINTAINERS: add include/dt-bindings/net to NETWORKING DRIVERS ARM: dts: at91: ksz9477_evb: fix port/phy validation net: bgmac: Fix an erroneous kfree() in bgmac_remove() ice: Fix memory corruption in VF driver ice: Fix queue config fail handling ice: Sync VLAN filtering features for DVM ice: Fix PTP TX timestamp offset calculation mlxsw: spectrum_cnt: Reorder counter pools docs: networking: phy: Fix a typo amd-xgbe: Use platform_irq_count() octeontx2-vf: Add support for adaptive interrupt coalescing xilinx: Fix build on x86. net: axienet: Use iowrite64 to write all 64b descriptor pointers net: axienet: make the 64b addresable DMA depends on 64b archectures net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization net: hns3: fix PF rss size initialization bug ... commit 2e7bf4a6af482f73f01245f08b4a953412c77070 Author: Yang Yingliang Date: Thu Jun 16 14:29:17 2022 +0800 net: axienet: add missing error return code in axienet_probe() It should return error code in error path in axienet_probe(). Fixes: 00be43a74ca2 ("net: axienet: make the 64b addresable DMA depends on 64b archectures") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220616062917.3601-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 593d1ebe00a45af5cb7bda1235c0790987c2a2b2 Author: Joanne Koong Date: Wed Jun 15 12:32:13 2022 -0700 Revert "net: Add a second bind table hashed by port and address" This reverts: commit d5a42de8bdbe ("net: Add a second bind table hashed by port and address") commit 538aaf9b2383 ("selftests: Add test for timing a bind request to a port with a populated bhash entry") Link: https://lore.kernel.org/netdev/20220520001834.2247810-1-kuba@kernel.org/ There are a few things that need to be fixed here: * Updating bhash2 in cases where the socket's rcv saddr changes * Adding bhash2 hashbucket locks Links to syzbot reports: https://lore.kernel.org/netdev/00000000000022208805e0df247a@google.com/ https://lore.kernel.org/netdev/0000000000003f33bc05dfaf44fe@google.com/ Fixes: d5a42de8bdbe ("net: Add a second bind table hashed by port and address") Reported-by: syzbot+015d756bbd1f8b5c8f09@syzkaller.appspotmail.com Reported-by: syzbot+98fd2d1422063b0f8c44@syzkaller.appspotmail.com Reported-by: syzbot+0a847a982613c6438fba@syzkaller.appspotmail.com Signed-off-by: Joanne Koong Link: https://lore.kernel.org/r/20220615193213.2419568-1-joannelkoong@gmail.com Signed-off-by: Jakub Kicinski commit 3f77a1d0570e62cfce8d472319df00008bbeab38 Author: Mark Brown Date: Wed Jun 15 20:15:04 2022 +0100 arm64/cpufeature: Unexport set_cpu_feature() We currently export set_cpu_feature() to modules but there are no in tree users that can be built as modules and it is hard to see cases where it would make sense for there to be any such users. Remove the export to avoid anyone else having to worry about why it is there and ensure that any users that do get added get a bit more visiblity. Signed-off-by: Mark Brown Acked-by: Suzuki K Poulose Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220615191504.626604-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8d5459c11f548131ce48b2fbf45cccc5c382558f Author: Jan Kara Date: Fri May 20 13:14:02 2022 +0200 ext4: improve write performance with disabled delalloc When delayed allocation is disabled (either through mount option or because we are running low on free space), ext4_write_begin() allocates blocks with EXT4_GET_BLOCKS_IO_CREATE_EXT flag. With this flag extent merging is disabled and since ext4_write_begin() is called for each page separately, we end up with a *lot* of 1 block extents in the extent tree and following writeback is writing 1 block at a time which results in very poor write throughput (4 MB/s instead of 200 MB/s). These days when ext4_get_block_unwritten() is used only by ext4_write_begin(), ext4_page_mkwrite() and inline data conversion, we can safely allow extent merging to happen from these paths since following writeback will happen on different boundaries anyway. So use EXT4_GET_BLOCKS_CREATE_UNRIT_EXT instead which restores the performance. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220520111402.4252-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 4deb96e35c5c3ebfeb9cf567f3ba80fa54e2cec1 Author: Robin Murphy Date: Thu Jun 16 14:46:46 2022 +0100 irqchip/gicv3: Handle resource request failure consistently Due to a silly oversight on my part, making the simple switch to of_io_request_and_map() in the DT path inadvertently introduced divergent behaviour, whereby failng to request an iomem region now becomes fatal for DT, vs. being silently ignored for ACPI. Refactor a bit harder, so that request errors are non-fatal in both paths as intended, but also consistently reported as well. Reported-by: Matt Ranostay Fixes: 2b2cd74a06c3 ("irqchip/gic-v3: Claim iomem resources") Signed-off-by: Robin Murphy Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/5f2b57a0131f3082fae9d3002d360bf784ccb092.1655387206.git.robin.murphy@arm.com commit 15baa7dcadf1c4f0b4f752dc054191855ff2d78e Author: Zhang Yi Date: Fri May 20 10:32:16 2022 +0800 ext4: fix warning when submitting superblock in ext4_commit_super() We have already check the io_error and uptodate flag before submitting the superblock buffer, and re-set the uptodate flag if it has been failed to write out. But it was lockless and could be raced by another ext4_commit_super(), and finally trigger '!uptodate' WARNING when marking buffer dirty. Fix it by submit buffer directly. Reported-by: Hulk Robot Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220520023216.3065073-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 32fc810b364f3dd30930c594e461ffa1761fef39 Author: Dylan Yudaken Date: Thu Jun 16 06:50:11 2022 -0700 io_uring: do not use prio task_work_add in uring_cmd io_req_task_prio_work_add has a strict assumption that it will only be used with io_req_task_complete. There is a codepath that assumes this is the case and will not even call the completion function if it is hit. For uring_cmd with an arbitrary completion function change the call to the correct non-priority version. Fixes: ee692a21e9bf8 ("fs,io_uring: add infrastructure for uring-cmd") Signed-off-by: Dylan Yudaken Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220616135011.441980-1-dylany@fb.com Signed-off-by: Jens Axboe commit 3103084afcf2341e12b0ee2c7b2ed570164f44a2 Author: Wang Jianjian Date: Fri May 20 10:22:55 2022 +0800 ext4, doc: remove unnecessary escaping Signed-off-by: Wang Jianjian Link: https://lore.kernel.org/r/20220520022255.2120576-2-wangjianjian3@huawei.com Signed-off-by: Theodore Ts'o commit 48e02e6113825db81e4aacc035933c0d0e4e68ce Author: Wang Jianjian Date: Fri May 20 10:22:54 2022 +0800 ext4: fix incorrect comment in ext4_bio_write_page() Signed-off-by: Wang Jianjian Link: https://lore.kernel.org/r/20220520022255.2120576-1-wangjianjian3@huawei.com Signed-off-by: Theodore Ts'o commit 06781a5026350cde699d2d10c9914a25c1524f45 Author: Sascha Hauer Date: Tue Jun 14 10:31:38 2022 +0200 mtd: rawnand: gpmi: Fix setting busy timeout setting The DEVICE_BUSY_TIMEOUT value is described in the Reference Manual as: | Timeout waiting for NAND Ready/Busy or ATA IRQ. Used in WAIT_FOR_READY | mode. This value is the number of GPMI_CLK cycles multiplied by 4096. So instead of multiplying the value in cycles with 4096, we have to divide it by that value. Use DIV_ROUND_UP to make sure we are on the safe side, especially when the calculated value in cycles is smaller than 4096 as typically the case. This bug likely never triggered because any timeout != 0 usually will do. In my case the busy timeout in cycles was originally calculated as 2408, which multiplied with 4096 is 0x968000. The lower 16 bits were taken for the 16 bit wide register field, so the register value was 0x8000. With 2970bf5a32f0 ("mtd: rawnand: gpmi: fix controller timings setting") however the value in cycles became 2384, which multiplied with 4096 is 0x950000. The lower 16 bit are 0x0 now resulting in an intermediate timeout when reading from NAND. Fixes: b1206122069aa ("mtd: rawnand: gpmi: use core timings instead of an empirical derivation") Cc: stable@vger.kernel.org Signed-off-by: Sascha Hauer Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220614083138.3455683-1-s.hauer@pengutronix.de commit 4f5bf12732fd78e225fc62b7c5c84d9032f8048a Author: Yang Li Date: Thu May 12 15:54:32 2022 +0800 fs: fix jbd2_journal_try_to_free_buffers() kernel-doc comment Add the description of @folio and remove @page in function kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/jbd2/transaction.c:2149: warning: Function parameter or member 'folio' not described in 'jbd2_journal_try_to_free_buffers' fs/jbd2/transaction.c:2149: warning: Excess function parameter 'page' description in 'jbd2_journal_try_to_free_buffers' Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220512075432.31763-1-yang.lee@linux.alibaba.com Signed-off-by: Theodore Ts'o commit a76c0b31eef50fdb8b21d53a6d050f59241fb88e Author: Jens Axboe Date: Wed Jun 15 19:51:11 2022 -0600 io_uring: commit non-pollable provided mapped buffers upfront For recv/recvmsg, IO either completes immediately or gets queued for a retry. This isn't the case for read/readv, if eg a normal file or a block device is used. Here, an operation can get queued with the block layer. If this happens, ring mapped buffers must get committed immediately to avoid that the next read can consume the same buffer. Check if we're dealing with pollable file, when getting a new ring mapped provided buffer. If it's not, commit it immediately rather than wait post issue. If we don't wait, we can race with completions coming in, or just plain buffer reuse by committing after a retry where others could have grabbed the same buffer. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 30f8c74ca9b7b3a2db55f6bb1d2e9f8c47a79f94 Author: Maxime Ripard Date: Fri Jun 10 13:51:49 2022 +0200 drm/vc4: Warn if some v3d code is run on BCM2711 The BCM2711 has a separate driver for the v3d, and thus we can't call into any of the driver entrypoints that rely on the v3d being there. Let's add a bunch of checks and complain loudly if that ever happen. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-15-maxime@cerno.tech commit d19e00ee06a9abf590b178c34cad637a516752f8 Author: Maxime Ripard Date: Fri Jun 10 13:51:48 2022 +0200 drm/vc4: crtc: Fix out of order frames during asynchronous page flips When doing an asynchronous page flip (PAGE_FLIP ioctl with the DRM_MODE_PAGE_FLIP_ASYNC flag set), the current code waits for the possible GPU buffer being rendered through a call to vc4_queue_seqno_cb(). On the BCM2835-37, the GPU driver is part of the vc4 driver and that function is defined in vc4_gem.c to wait for the buffer to be rendered, and once it's done, call a callback. However, on the BCM2711 used on the RaspberryPi4, the GPU driver is separate (v3d) and that function won't do anything. This was working because we were going into a path, due to uninitialized variables, that was always scheduling the callback. However, we were never actually waiting for the buffer to be rendered which was resulting in frames being displayed out of order. The generic API to signal those kind of completion in the kernel are the DMA fences, and fortunately the v3d drivers supports them and signal when its job is done. That API also provides an equivalent function that allows to have a callback being executed when the fence is signalled as done. Let's change our driver a bit to rely on the previous function for the older SoCs, and on DMA fences for the BCM2711. Signed-off-by: Maxime Ripard Reviewed-by: Melissa Wen Link: https://lore.kernel.org/r/20220610115149.964394-14-maxime@cerno.tech commit d87db1c79d6f9ec5505be2ff4ca8811d6e88a667 Author: Maxime Ripard Date: Fri Jun 10 13:51:47 2022 +0200 drm/vc4: crtc: Don't call into BO Handling on Async Page-Flips on BCM2711 The BCM2711 doesn't have a v3d GPU so we don't want to call into its BO management code. Let's create an asynchronous page-flip handler for the BCM2711 that just calls into the common code. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-13-maxime@cerno.tech commit f6766fb265b18248d2c4bc643eb99e853f293dd6 Author: Maxime Ripard Date: Fri Jun 10 13:51:46 2022 +0200 drm/vc4: crtc: Move the BO Handling out of Common Page-Flip Handler The function vc4_async_page_flip() handles asynchronous page-flips in the vc4 driver. However, it mixes some generic code with code that should only be run on older generations that have the GPU handled by the vc4 driver. Let's split the generic part out of vc4_async_page_flip() and into a common function that we be reusable by an handler made for the BCM2711. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-12-maxime@cerno.tech commit 4d12c36fb73b5c49fe2f95d06515fd9846010fd2 Author: Maxime Ripard Date: Fri Jun 10 13:51:45 2022 +0200 drm/vc4: crtc: Move the BO handling out of common page-flip callback We'll soon introduce another completion callback source that won't need to use the BO reference counting, so let's move it around to create a function we will be able to share between both callbacks. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-11-maxime@cerno.tech commit 2523e9dcc3be91bf9fdc0d1e542557ca00bbef42 Author: Maxime Ripard Date: Fri Jun 10 13:51:44 2022 +0200 drm/vc4: crtc: Use an union to store the page flip callback We'll need to extend the vc4_async_flip_state structure to rely on another callback implementation, so let's move the current one into a union. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-10-maxime@cerno.tech commit 257add942a477bb99bdf4bacc6190703f796dcff Author: Maxime Ripard Date: Fri Jun 10 13:51:43 2022 +0200 drm/vc4: drv: Skip BO Backend Initialization on BCM2711 On the BCM2711, we currently call the vc4_bo_cache_init() and vc4_gem_init() functions. These functions initialize the BO and GEM backends. However, this code was initially created to accomodate the requirements of the GPU on the older SoCs, while the BCM2711 has a separate driver for it. So let's just skip these calls when we're on a newer hardware. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-9-maxime@cerno.tech commit 2095848661481e31339b32847acf7759b5635f38 Author: Maxime Ripard Date: Fri Jun 10 13:51:42 2022 +0200 drm/vc4: plane: Register a different drm_plane_helper_funcs on BCM2711 On the BCM2711, our current definition of drm_plane_helper_funcs uses the custom vc4_prepare_fb() and vc4_cleanup_fb(). Those functions rely on the buffer allocation path that was relying on the GPU, and is no longer relevant. Let's create another drm_plane_helper_funcs structure that we will register on the BCM2711. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-8-maxime@cerno.tech commit 39a30ec64510f71d2a9f5059a7fc1283c4108a35 Author: Maxime Ripard Date: Fri Jun 10 13:51:41 2022 +0200 drm/vc4: kms: Register a different drm_mode_config_funcs on BCM2711 On the BCM2711, our current definition of drm_mode_config_funcs uses the custom vc4_fb_create(). However, that function relies on the buffer allocation path that was relying on the GPU, and is no longer relevant. Let's create another drm_mode_config_funcs structure that we will register on the BCM2711. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-7-maxime@cerno.tech commit 538f111160618ef56743a5302e114530edb7df77 Author: Maxime Ripard Date: Fri Jun 10 13:51:40 2022 +0200 drm/vc4: drv: Register a different driver on BCM2711 Prior to the BCM2711/RaspberryPi4, the GPU was a part of the display components of the SoC. It was thus a part of the vc4 driver. However, with the BCM2711, it got split out and thus the v3d driver was created. The vc4 driver now only handles the display part. We didn't properly split out the code when doing the BCM2711 support though, and most of the code around buffer allocations is still involved, even though it doesn't have the backing hardware anymore. Let's start the split out by creating a new drm_driver that only reports and uses what we support on the BCM2711. The ioctl were properly filtered already, but we were still exposing a .gem_create_object hook, as well as having an .open and .postclose hooks which are only relevant on older generations. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-6-maxime@cerno.tech commit 3d7637423be8340f40a669beb253aabbf08239ca Author: Maxime Ripard Date: Fri Jun 10 13:51:39 2022 +0200 drm/vc4: bo: Split out Dumb buffers fixup The vc4_bo_dumb_create() both fixes up the allocation arguments to match the hardware constraints and actually performs the allocation. Since we're going to introduce a new function that uses a different allocator, let's split the arguments fixup to a separate function we will be able to reuse. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-5-maxime@cerno.tech commit dd2dfd44edc5ba5b2de3c2e6c1c823a62e8f1e92 Author: Maxime Ripard Date: Fri Jun 10 13:51:38 2022 +0200 drm/vc4: bo: Rename vc4_dumb_create We're going to add a new variant of the dumb BO allocation function, so let's rename vc4_dumb_create() to something a bit more specific. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-4-maxime@cerno.tech commit 1cbc91eb7b518cc5f80442ff9b517dc5b9d3b849 Author: Maxime Ripard Date: Fri Jun 10 13:51:37 2022 +0200 drm/vc4: Consolidate Hardware Revision Check A new generation of controller has been introduced with the BCM2711/RaspberryPi4. This generation needs a bunch of quirks, and over time we've piled on a number of checks in most parts of the drivers. All these checks are performed several times, and are not always consistent. Let's create a single, global, variable to hold it and use it everywhere. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-3-maxime@cerno.tech commit cb468c7d84d174ab9cd638be9f5b3f1ba2b311a0 Author: Maxime Ripard Date: Fri Jun 10 13:51:36 2022 +0200 drm/vc4: plane: Prevent async update if we don't have a dlist The vc4 planes are setup in hardware by creating a hardware descriptor in a dedicated RAM. As part of the process to setup a plane in KMS, we thus need to allocate some part of that dedicated RAM to store our descriptor there. The async update path will just reuse the descriptor already allocated for that plane and will modify it directly in RAM to match whatever has been asked for. In order to do that, it will compare the descriptor for the old plane state and the new plane state, will make sure they fit in the same size, and check that only the position or buffer address have changed. Reviewed-by: Melissa Wen Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220610115149.964394-2-maxime@cerno.tech commit 4bca7e80b6455772b4bf3f536dcbc19aac424d6a Author: Jan Kara Date: Wed Jun 15 15:22:29 2022 +0200 init: Initialize noop_backing_dev_info early noop_backing_dev_info is used by superblocks of various pseudofilesystems such as kdevtmpfs. After commit 10e14073107d ("writeback: Fix inode->i_io_list not be protected by inode->i_lock error") this broke because __mark_inode_dirty() started to access more fields from noop_backing_dev_info and this led to crashes inside locked_inode_to_wb_and_lock_list() called from __mark_inode_dirty(). Fix the problem by initializing noop_backing_dev_info before the filesystems get mounted. Fixes: 10e14073107d ("writeback: Fix inode->i_io_list not be protected by inode->i_lock error") Reported-and-tested-by: Suzuki K Poulose Reported-and-tested-by: Alexandru Elisei Reported-and-tested-by: Guenter Roeck Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit 27cfa258951a465e3eae63ee1e715e902cd45578 Author: Ye Bin Date: Wed Jun 15 17:00:10 2022 +0800 ext2: fix fs corruption when trying to remove a non-empty directory with IO error We got issue as follows: [home]# mount /dev/sdd test [home]# cd test [test]# ls dir1 lost+found [test]# rmdir dir1 ext2_empty_dir: inject fault [test]# ls lost+found [test]# cd .. [home]# umount test [home]# fsck.ext2 -fn /dev/sdd e2fsck 1.42.9 (28-Dec-2013) Pass 1: Checking inodes, blocks, and sizes Inode 4065, i_size is 0, should be 1024. Fix? no Pass 2: Checking directory structure Pass 3: Checking directory connectivity Unconnected directory inode 4065 (/???) Connect to /lost+found? no '..' in ... (4065) is / (2), should be (0). Fix? no Pass 4: Checking reference counts Inode 2 ref count is 3, should be 4. Fix? no Inode 4065 ref count is 2, should be 3. Fix? no Pass 5: Checking group summary information /dev/sdd: ********** WARNING: Filesystem still has errors ********** /dev/sdd: 14/128016 files (0.0% non-contiguous), 18477/512000 blocks Reason is same with commit 7aab5c84a0f6. We can't assume directory is empty when read directory entry failed. Link: https://lore.kernel.org/r/20220615090010.1544152-1-yebin10@huawei.com Signed-off-by: Ye Bin Signed-off-by: Jan Kara commit 1342b5b23da9559a1578978eaff7f797d8a87d91 Author: Samuel Holland Date: Wed Jun 15 00:42:53 2022 -0500 drm/sun4i: Fix crash during suspend after component bind failure If the component driver fails to bind, or is unbound, the driver data for the top-level platform device points to a freed drm_device. If the system is then suspended, the driver passes this dangling pointer to drm_mode_config_helper_suspend(), which crashes. Fix this by only setting the driver data while the platform driver holds a reference to the drm_device. Fixes: 624b4b48d9d8 ("drm: sun4i: Add support for suspending the display driver") Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220615054254.16352-1-samuel@sholland.org commit 920169041baa0a7497ed702aa97d6a2d6285efd3 Author: Samuel Holland Date: Tue Jun 14 02:31:00 2022 -0500 drm/sun4i: dw-hdmi: Fix ddc-en GPIO consumer conflict commit 6de79dd3a920 ("drm/bridge: display-connector: add ddc-en gpio support") added a consumer for this GPIO in the HDMI connector device. This new consumer conflicts with the pre-existing GPIO consumer in the sun8i HDMI controller driver, which prevents the driver from probing: [ 4.983358] display-connector connector: GPIO lookup for consumer ddc-en [ 4.983364] display-connector connector: using device tree for GPIO lookup [ 4.983392] gpio-226 (ddc-en): gpiod_request: status -16 [ 4.983399] sun8i-dw-hdmi 6000000.hdmi: Couldn't get ddc-en gpio [ 4.983618] sun4i-drm display-engine: failed to bind 6000000.hdmi (ops sun8i_dw_hdmi_ops [sun8i_drm_hdmi]): -16 [ 4.984082] sun4i-drm display-engine: Couldn't bind all pipelines components [ 4.984171] sun4i-drm display-engine: adev bind failed: -16 [ 4.984179] sun8i-dw-hdmi: probe of 6000000.hdmi failed with error -16 Both drivers have the same behavior: they leave the GPIO active for the life of the device. Let's take advantage of the new implementation, and drop the now-obsolete code from the HDMI controller driver. Fixes: 6de79dd3a920 ("drm/bridge: display-connector: add ddc-en gpio support") Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220614073100.11550-1-samuel@sholland.org commit e89ab76d7e2564c65986add3d634cc5cf5bacf14 Author: Darrick J. Wong Date: Sun Jun 5 18:51:23 2022 -0700 xfs: preserve DIFLAG2_NREXT64 when setting other inode attributes It is vitally important that we preserve the state of the NREXT64 inode flag when we're changing the other flags2 fields. Fixes: 9b7d16e34bbe ("xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Chandan Babu R Reviewed-by: Allison Henderson commit 10930b254d5be1cb4350fb7a456ccd5ea7e3cbd9 Author: Darrick J. Wong Date: Sun Jun 5 18:51:22 2022 -0700 xfs: fix variable state usage The variable @args is fed to a tracepoint, and that's the only place it's used. This is fine for the kernel, but for userspace, tracepoints are #define'd out of existence, which results in this warning on gcc 11.2: xfs_attr.c: In function ‘xfs_attr_node_try_addname’: xfs_attr.c:1440:42: warning: unused variable ‘args’ [-Wunused-variable] 1440 | struct xfs_da_args *args = attr->xattri_da_args; | ^~~~ Clean this up. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson commit f4288f01820e2d57722d21874c1fda661003c9b9 Author: Darrick J. Wong Date: Sun Jun 5 18:51:22 2022 -0700 xfs: fix TOCTOU race involving the new logged xattrs control knob I found a race involving the larp control knob, aka the debugging knob that lets developers enable logging of extended attribute updates: Thread 1 Thread 2 echo 0 > /sys/fs/xfs/debug/larp setxattr(REPLACE) xfs_has_larp (returns false) xfs_attr_set echo 1 > /sys/fs/xfs/debug/larp xfs_attr_defer_replace xfs_attr_init_replace_state xfs_has_larp (returns true) xfs_attr_init_remove_state This isn't a particularly severe problem right now because xattr logging is only enabled when CONFIG_XFS_DEBUG=y, and developers *should* know what they're doing. However, the eventual intent is that callers should be able to ask for the assistance of the log in persisting xattr updates. This capability might not be required for /all/ callers, which means that dynamic control must work correctly. Once an xattr update has decided whether or not to use logged xattrs, it needs to stay in that mode until the end of the operation regardless of what subsequent parallel operations might do. Therefore, it is an error to continue sampling xfs_globals.larp once xfs_attr_change has made a decision about larp, and it was not correct for me to have told Allison that ->create_intent functions can sample the global log incompat feature bitfield to decide to elide a log item. Instead, create a new op flag for the xfs_da_args structure, and convert all other callers of xfs_has_larp and xfs_sb_version_haslogxattrs within the attr update state machine to look for the operations flag. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson commit cad140d00899e7a9cb6fe93b282051df589e671c Author: Christian Göttsche Date: Wed Jun 15 17:38:39 2022 +0200 selinux: free contexts previously transferred in selinux_add_opt() `selinux_add_opt()` stopped taking ownership of the passed context since commit 70f4169ab421 ("selinux: parse contexts for mount options early"). unreferenced object 0xffff888114dfd140 (size 64): comm "mount", pid 15182, jiffies 4295687028 (age 796.340s) hex dump (first 32 bytes): 73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f system_u:object_ 72 3a 74 65 73 74 5f 66 69 6c 65 73 79 73 74 65 r:test_filesyste backtrace: [] kmemdup_nul+0x24/0x80 [] selinux_sb_eat_lsm_opts+0x293/0x560 [] security_sb_eat_lsm_opts+0x58/0x80 [] generic_parse_monolithic+0x82/0x180 [] do_new_mount+0x1f5/0x550 [] path_mount+0x2ab/0x1570 [] __x64_sys_mount+0x20e/0x280 [] do_syscall_64+0x34/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 unreferenced object 0xffff888108e71640 (size 64): comm "fsmount", pid 7607, jiffies 4295044974 (age 1601.016s) hex dump (first 32 bytes): 73 79 73 74 65 6d 5f 75 3a 6f 62 6a 65 63 74 5f system_u:object_ 72 3a 74 65 73 74 5f 66 69 6c 65 73 79 73 74 65 r:test_filesyste backtrace: [] memdup_user+0x21/0x90 [] strndup_user+0x47/0xa0 [] __do_sys_fsconfig+0x485/0x9f0 [] do_syscall_64+0x34/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Cc: stable@vger.kernel.org Fixes: 70f4169ab421 ("selinux: parse contexts for mount options early") Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit a79e69c8714f416bd324952d06d1dd7bce3f35bf Author: Lukas Bulwahn Date: Mon Jun 13 10:51:00 2022 +0200 MAINTAINERS: add include/dt-bindings/clock to COMMON CLK FRAMEWORK Maintainers of the directory Documentation/devicetree/bindings/clock are also the maintainers of the corresponding directory in include/dt-bindings/clock. Add the file entry for include/dt-bindings/clock to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220613085100.402-1-lukas.bulwahn@gmail.com Signed-off-by: Stephen Boyd commit ef79c396c664be99d0c5660dc75fe863c1e20315 Author: Christian Göttsche Date: Wed Jun 15 17:44:31 2022 +0200 audit: free module name Reset the type of the record last as the helper `audit_free_module()` depends on it. unreferenced object 0xffff888153b707f0 (size 16): comm "modprobe", pid 1319, jiffies 4295110033 (age 1083.016s) hex dump (first 16 bytes): 62 69 6e 66 6d 74 5f 6d 69 73 63 00 6b 6b 6b a5 binfmt_misc.kkk. backtrace: [] kstrdup+0x2b/0x50 [] __audit_log_kern_module+0x4d/0xf0 [] load_module+0x9d4/0x2e10 [] __do_sys_finit_module+0x114/0x1b0 [] do_syscall_64+0x34/0x80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0 Cc: stable@vger.kernel.org Fixes: 12c5e81d3fd0 ("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 30306f6194cadcc29c77f6ddcd416a75bf5c0232 Merge: afe9eb14ea1cb 1dfbe9fcda4af Author: Linus Torvalds Date: Wed Jun 15 14:20:26 2022 -0700 Merge tag 'hardening-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - Correctly handle vm_map areas in hardened usercopy (Matthew Wilcox) - Adjust CFI RCU usage to avoid boot splats with cpuidle (Sami Tolvanen) * tag 'hardening-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: usercopy: Make usercopy resilient against ridiculously large copies usercopy: Cast pointer to an integer once usercopy: Handle vm_map_ram() areas cfi: Fix __cfi_slowpath_diag RCU usage with cpuidle commit b4d329c451a299323b26039df97b32896fb46abc Author: Rob Clark Date: Fri Jun 10 10:20:55 2022 -0700 drm/msm/gem: Drop early returns in close/purge vma Keep the warn, but drop the early return. If we do manage to hit this sort of issue, skipping the cleanup just makes things worse (dangling drm_mm_nodes when the msm_gem_vma is freed, etc). Whereas the worst that happens if we tear down a mapping the GPU is accessing is that we get GPU iova faults, but otherwise the world keeps spinning. Signed-off-by: Rob Clark Tested-by: Steev Klimaszewski Reported-by: Steev Klimaszewski Patchwork: https://patchwork.freedesktop.org/patch/489115/ Link: https://lore.kernel.org/r/20220610172055.2337977-1-robdclark@gmail.com commit 311e03c29c255665e10a31910308de3777f21274 Author: Rob Clark Date: Fri May 27 10:23:40 2022 -0700 drm/msm/gem: Separate object and vma unpin Previously the BO_PINNED state in the submit was tracking two related but different things: (1) that the buffer object was pinned, and (2) that the vma (mapping within a set of pagetables) was pinned. But with fenced vma unpin (needed so that userspace couldn't race with retire path for releasing a vma) these two were decoupled. The fact that the BO_PINNED flag was already cleared meant that we leaked the bo pin count which should have been dropped when the submit was retired. So split this state into BO_OBJ_PINNED and BO_VMA_PINNED, so they can be dropped independently. Fixes: 95d1deb02a9c ("drm/msm/gem: Add fenced vma unpin") Signed-off-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/487559/ Link: https://lore.kernel.org/r/20220527172341.2151005-1-robdclark@gmail.com commit b87f02307d3cfbda768520f0687c51ca77e14fc3 Author: Petr Mladek Date: Wed Jun 15 18:28:05 2022 +0200 printk: Wait for the global console lock when the system is going down There are reports that the console kthreads block the global console lock when the system is going down, for example, reboot, panic. First part of the solution was to block kthreads in these problematic system states so they stopped handling newly added messages. Second part of the solution is to wait when for the kthreads when they are actively printing. It solves the problem when a message was printed before the system entered the problematic state and the kthreads managed to step in. A busy waiting has to be used because panic() can be called in any context and in an unknown state of the scheduler. There must be a timeout because the kthread might get stuck or sleeping and never release the lock. The timeout 10s is an arbitrary value inspired by the softlockup timeout. Link: https://lore.kernel.org/r/20220610205038.GA3050413@paulmck-ThinkPad-P17-Gen-1 Link: https://lore.kernel.org/r/CAMdYzYpF4FNTBPZsEFeWRuEwSies36QM_As8osPWZSr2q-viEA@mail.gmail.com Signed-off-by: Petr Mladek Tested-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220615162805.27962-3-pmladek@suse.com commit c3230283e2819a69dad2cf7a63143fde8bab8b5c Author: Petr Mladek Date: Wed Jun 15 18:28:04 2022 +0200 printk: Block console kthreads when direct printing will be required There are known situations when the console kthreads are not reliable or does not work in principle, for example, early boot, panic, shutdown. For these situations there is the direct (legacy) mode when printk() tries to get console_lock() and flush the messages directly. It works very well during the early boot when the console kthreads are not available at all. It gets more complicated in the other situations when console kthreads might be actively printing and block console_trylock() in printk(). The same problem is in the legacy code as well. Any console_lock() owner could block console_trylock() in printk(). It is solved by a trick that the current console_lock() owner is responsible for printing all pending messages. It is actually the reason why there is the risk of softlockups and why the console kthreads were introduced. The console kthreads use the same approach. They are responsible for printing the messages by definition. So that they handle the messages anytime when they are awake and see new ones. The global console_lock is available when there is nothing to do. It should work well when the problematic context is correctly detected and printk() switches to the direct mode. But it seems that it is not enough in practice. There are reports that the messages are not printed during panic() or shutdown() even though printk() tries to use the direct mode here. The problem seems to be that console kthreads become active in these situation as well. They steel the job before other CPUs are stopped. Then they are stopped in the middle of the job and block the global console_lock. First part of the solution is to block console kthreads when the system is in a problematic state and requires the direct printk() mode. Link: https://lore.kernel.org/r/20220610205038.GA3050413@paulmck-ThinkPad-P17-Gen-1 Link: https://lore.kernel.org/r/CAMdYzYpF4FNTBPZsEFeWRuEwSies36QM_As8osPWZSr2q-viEA@mail.gmail.com Suggested-by: John Ogness Tested-by: Paul E. McKenney Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220615162805.27962-2-pmladek@suse.com commit afe9eb14ea1cbac5d91ca04eb64810d2d9fa22b0 Merge: 979086f5e0066 27b5b22d252c6 Author: Linus Torvalds Date: Wed Jun 15 12:34:19 2022 -0700 Merge tag 'tpmdd-next-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen: "Two fixes for this merge window" * tag 'tpmdd-next-v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: certs: fix and refactor CONFIG_SYSTEM_BLACKLIST_HASH_LIST build certs/blacklist_hashes.c: fix const confusion in certs blacklist commit 5ee3d10f84d0a32fc11a55c70c204b6d81fd9ef6 Author: Dave Wysochanski Date: Thu Jun 9 20:46:29 2022 -0400 NFSv4: Add FMODE_CAN_ODIRECT after successful open of a NFS4.x file Commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") added the FMODE_CAN_ODIRECT flag for NFSv3 but neglected to add it for NFSv4.x. This causes direct io on NFSv4.x to fail open with EINVAL: mount -o vers=4.2 127.0.0.1:/export /mnt/nfs4 dd if=/dev/zero of=/mnt/nfs4/file.bin bs=128k count=1 oflag=direct dd: failed to open '/mnt/nfs4/file.bin': Invalid argument dd of=/dev/null if=/mnt/nfs4/file.bin bs=128k count=1 iflag=direct dd: failed to open '/mnt/dir1/file1.bin': Invalid argument Fixes: a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") Signed-off-by: Dave Wysochanski Signed-off-by: Anna Schumaker commit 27b5b22d252c6d71a2a37a4bdf18d0be6d25ee5a Author: Masahiro Yamada Date: Sun Jun 12 02:22:31 2022 +0900 certs: fix and refactor CONFIG_SYSTEM_BLACKLIST_HASH_LIST build Commit addf466389d9 ("certs: Check that builtin blacklist hashes are valid") was applied 8 months after the submission. In the meantime, the base code had been removed by commit b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"). Fix the Makefile. Create a local copy of $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST). It is included from certs/blacklist_hashes.c and also works as a timestamp. Send error messages from check-blacklist-hashes.awk to stderr instead of stdout. Fixes: addf466389d9 ("certs: Check that builtin blacklist hashes are valid") Signed-off-by: Masahiro Yamada Reviewed-by: Jarkko Sakkinen Reviewed-by: Mickaël Salaün Signed-off-by: Jarkko Sakkinen commit 6a1c3767d82ed8233de1263aa7da81595e176087 Author: Masahiro Yamada Date: Sun Jun 12 02:22:30 2022 +0900 certs/blacklist_hashes.c: fix const confusion in certs blacklist This file fails to compile as follows: CC certs/blacklist_hashes.o certs/blacklist_hashes.c:4:1: error: ignoring attribute ‘section (".init.data")’ because it conflicts with previous ‘section (".init.rodata")’ [-Werror=attributes] 4 | const char __initdata *const blacklist_hashes[] = { | ^~~~~ In file included from certs/blacklist_hashes.c:2: certs/blacklist.h:5:38: note: previous declaration here 5 | extern const char __initconst *const blacklist_hashes[]; | ^~~~~~~~~~~~~~~~ Apply the same fix as commit 2be04df5668d ("certs/blacklist_nohashes.c: fix const confusion in certs blacklist"). Fixes: 734114f8782f ("KEYS: Add a system blacklist keyring") Signed-off-by: Masahiro Yamada Reviewed-by: Jarkko Sakkinen Reviewed-by: Mickaël Salaün Signed-off-by: Jarkko Sakkinen commit 49d6a3c062a1026a5ba957c46f3603c372288ab6 Author: Tianyu Lan Date: Mon Jun 13 21:45:53 2022 -0400 x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM Hyper-V Isolation VM current code uses sev_es_ghcb_hv_call() to read/write MSR via GHCB page and depends on the sev code. This may cause regression when sev code changes interface design. The latest SEV-ES code requires to negotiate GHCB version before reading/writing MSR via GHCB page and sev_es_ghcb_hv_call() doesn't work for Hyper-V Isolation VM. Add Hyper-V ghcb related implementation to decouple SEV and Hyper-V code. Negotiate GHCB version in the hyperv_init() and use the version to communicate with Hyper-V in the ghcb hv call function. Fixes: 2ea29c5abbc2 ("x86/sev: Save the negotiated GHCB version") Signed-off-by: Tianyu Lan Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220614014553.1915929-1-ltykernel@gmail.com Signed-off-by: Wei Liu commit cdd85786f4b3b9273e4376e69aa95a2d71722764 Author: Kirill A. Shutemov Date: Tue Jun 14 15:01:34 2022 +0300 x86/tdx: Clarify RIP adjustments in #VE handler After successful #VE handling, tdx_handle_virt_exception() has to move RIP to the next instruction. The handler needs to know the length of the instruction. If the #VE happened due to instruction execution, the GET_VEINFO TDX module call provides info on the instruction in R10, including its length. For #VE due to EPT violation, the info in R10 is not populand and the kernel must decode the instruction manually to find out its length. Restructure the code to make it explicit that the instruction length depends on the type of #VE. Make individual #VE handlers return the instruction length on success or -errno on failure. [ dhansen: fix up changelog and comments ] Suggested-by: Dave Hansen Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220614120135.14812-3-kirill.shutemov@linux.intel.com commit 51dd64bb99e4478fc5280171acd8e1b529eadaf7 Author: Xiu Jianfeng Date: Fri May 27 19:17:26 2022 +0800 Revert "evm: Fix memleak in init_desc" This reverts commit ccf11dbaa07b328fa469415c362d33459c140a37. Commit ccf11dbaa07b ("evm: Fix memleak in init_desc") said there is memleak in init_desc. That may be incorrect, as we can see, tmp_tfm is saved in one of the two global variables hmac_tfm or evm_tfm[hash_algo], then if init_desc is called next time, there is no need to alloc tfm again, so in the error path of kmalloc desc or crypto_shash_init(desc), It is not a problem without freeing tmp_tfm. And also that commit did not reset the global variable to NULL after freeing tmp_tfm and this makes *tfm a dangling pointer which may cause a UAF issue. Reported-by: Guozihua (Scott) Signed-off-by: Xiu Jianfeng Signed-off-by: Mimi Zohar commit 04cb45b4956728b2cfd064efa1bbfe5a0bad77eb Merge: 2396e958c8169 f34fdcd4a0e7a Author: Jens Axboe Date: Wed Jun 15 11:56:07 2022 -0600 Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.19 Pull MD fixes from Song. * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid5-ppl: Fix argument order in bio_alloc_bioset() Revert "md: don't unregister sync_thread with reconfig_mutex held" commit 60428d8bc27f52e8f1540f98e1b6ef0156d43f0d Author: Kirill A. Shutemov Date: Tue Jun 14 15:01:33 2022 +0300 x86/tdx: Fix early #VE handling tdx_early_handle_ve() does not increment RIP after successfully handling the exception. That leads to infinite loop of exceptions. Move RIP when exceptions are successfully handled. [ dhansen: make problem statement more clear ] Fixes: 32e72854fa5f ("x86/tdx: Port I/O: Add early boot support") Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Link: https://lkml.kernel.org/r/20220614120135.14812-2-kirill.shutemov@linux.intel.com commit f34fdcd4a0e7a0b92340ad7e48e7bcff9393fab5 Author: Logan Gunthorpe Date: Wed Jun 8 10:27:46 2022 -0600 md/raid5-ppl: Fix argument order in bio_alloc_bioset() bio_alloc_bioset() takes a block device, number of vectors, the OP flags, the GFP mask and the bio set. However when the prototype was changed, the callisite in ppl_do_flush() had the OP flags and the GFP flags reversed. This introduced some sparse error: drivers/md/raid5-ppl.c:632:57: warning: incorrect type in argument 3 (different base types) drivers/md/raid5-ppl.c:632:57: expected unsigned int opf drivers/md/raid5-ppl.c:632:57: got restricted gfp_t [usertype] drivers/md/raid5-ppl.c:633:61: warning: incorrect type in argument 4 (different base types) drivers/md/raid5-ppl.c:633:61: expected restricted gfp_t [usertype] gfp_mask drivers/md/raid5-ppl.c:633:61: got unsigned long long The sparse error introduction may not have been reported correctly by 0day due to other work that was cleaning up other sparse errors in this area. Fixes: 609be1066731 ("block: pass a block_device and opf to bio_alloc_bioset") Cc: stable@vger.kernel.org # 5.18+ Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit d1a374a1aeb7e31191448e225ed2f9c5e894f280 Author: Kumar Kartikeya Dwivedi Date: Wed Jun 15 09:51:51 2022 +0530 bpf: Limit maximum modifier chain length in btf_check_type_tags On processing a module BTF of module built for an older kernel, we might sometimes find that some type points to itself forming a loop. If such a type is a modifier, btf_check_type_tags's while loop following modifier chain will be caught in an infinite loop. Fix this by defining a maximum chain length and bailing out if we spin any longer than that. Fixes: eb596b090558 ("bpf: Ensure type tags precede modifiers in BTF") Reported-by: Daniel Borkmann Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220615042151.2266537-1-memxor@gmail.com commit d0a180341fe00cd0bd1cc259d196dc255c13f229 Author: Guoqing Jiang Date: Tue Jun 7 10:03:56 2022 +0800 Revert "md: don't unregister sync_thread with reconfig_mutex held" The 07reshape5intr test is broke because of below path. md_reap_sync_thread -> mddev_unlock -> md_unregister_thread(&mddev->sync_thread) And md_check_recovery is triggered by, mddev_unlock -> md_wakeup_thread(mddev->thread) then mddev->reshape_position is set to MaxSector in raid5_finish_reshape since MD_RECOVERY_INTR is cleared in md_check_recovery, which means feature_map is not set with MD_FEATURE_RESHAPE_ACTIVE and superblock's reshape_position can't be updated accordingly. Fixes: 8b48ec23cc51a ("md: don't unregister sync_thread with reconfig_mutex held") Reported-by: Logan Gunthorpe Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 89bcd9a64b849380ef57e3032b307574e48db524 Author: Mengqi Zhang Date: Thu Jun 9 19:22:39 2022 +0800 mmc: mediatek: wait dma stop bit reset to 0 MediaTek IP requires that after dma stop, it need to wait this dma stop bit auto-reset to 0. When bus is in high loading state, it will take a while for the dma stop complete. If there is no waiting operation here, when program runs to clear fifo and reset, bus will hang. In addition, there should be no return in msdc_data_xfer_next() if there is data need be transferred, because no matter what error occurs here, it should continue to excute to the following mmc_request_done. Otherwise the core layer may wait complete forever. Signed-off-by: Mengqi Zhang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220609112239.18911-1-mengqi.zhang@mediatek.com Signed-off-by: Ulf Hansson commit 979086f5e0066b4eff66e1eee123da228489985c Merge: 018ab4fabddd9 168f912893407 Author: Linus Torvalds Date: Wed Jun 15 09:04:55 2022 -0700 Merge tag 'fs.fixes.v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull vfs idmapping fix from Christian Brauner: "This fixes an issue where we fail to change the group of a file when the caller owns the file and is a member of the group to change to. This is only relevant on idmapped mounts. There's a detailed description in the commit message and regression tests have been added to xfstests" * tag 'fs.fixes.v5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs: account for group membership commit 10eb3a0d517fcc83eeea4242c149461205675eb4 Author: Benjamin Marzinski Date: Tue Jun 14 11:10:28 2022 -0500 dm: fix race in dm_start_io_acct After commit 82f6cdcc3676c ("dm: switch dm_io booleans over to proper flags") dm_start_io_acct stopped atomically checking and setting was_accounted, which turned into the DM_IO_ACCOUNTED flag. This opened the possibility for a race where IO accounting is started twice for duplicate bios. To remove the race, check the flag while holding the io->lock. Fixes: 82f6cdcc3676c ("dm: switch dm_io booleans over to proper flags") Cc: stable@vger.kernel.org Signed-off-by: Benjamin Marzinski Signed-off-by: Mike Snitzer commit 2396e958c816960d445ecbbadd064abc929402d3 Merge: b13baccc3850c 43047e082b90e Author: Jens Axboe Date: Wed Jun 15 09:39:05 2022 -0600 Merge tag 'nvme-5.19-2022-06-15' of git://git.infradead.org/nvme into block-5.19 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - quirks, quirks, quirks to work around buggy consumer grade devices (Keith Bush, Ning Wang, Stefan Reiter, Rasheed Hsueh) - better kernel messages for devices that need quirking (Keith Bush) - make a kernel message more useful (Thomas Weißschuh)" * tag 'nvme-5.19-2022-06-15' of git://git.infradead.org/nvme: nvme-pci: disable write zeros support on UMIC and Samsung SSDs nvme-pci: avoid the deepest sleep state on ZHITAI TiPro7000 SSDs nvme-pci: sk hynix p31 has bogus namespace ids nvme-pci: smi has bogus namespace ids nvme-pci: phison e12 has bogus namespace ids nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S50 nvme-pci: add trouble shooting steps for timeouts nvme: add bug report info for global duplicate id nvme: add device name to warning in uuid_show() commit 0d8116ccd83b7e5384cf04de570ae19771e8a3d0 Author: Mark Rutland Date: Tue Jun 14 09:09:44 2022 +0100 arm64: ftrace: remove redundant label Since commit: c4a0ebf87cebbfa2 ("arm64/ftrace: Make function graph use ftrace directly") The 'ftrace_common_return' label has been unused. Remove it. Signed-off-by: Mark Rutland Cc: Chengming Zhou Cc: Will Deacon Tested-by: "Ivan T. Ivanov" Reviewed-by: Chengming Zhou Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220614080944.1349146-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit a6253579977e4c6f7818eeb05bf2bc65678a7187 Author: Mark Rutland Date: Tue Jun 14 09:09:43 2022 +0100 arm64: ftrace: consistently handle PLTs. Sometimes it is necessary to use a PLT entry to call an ftrace trampoline. This is handled by ftrace_make_call() and ftrace_make_nop(), with each having *almost* identical logic, but this is not handled by ftrace_modify_call() since its introduction in commit: 3b23e4991fb66f6d ("arm64: implement ftrace with regs") Due to this, if we ever were to call ftrace_modify_call() for a callsite which requires a PLT entry for a trampoline, then either: a) If the old addr requires a trampoline, ftrace_modify_call() will use an out-of-range address to generate the 'old' branch instruction. This will result in warnings from aarch64_insn_gen_branch_imm() and ftrace_modify_code(), and no instructions will be modified. As ftrace_modify_call() will return an error, this will result in subsequent internal ftrace errors. b) If the old addr does not require a trampoline, but the new addr does, ftrace_modify_call() will use an out-of-range address to generate the 'new' branch instruction. This will result in warnings from aarch64_insn_gen_branch_imm(), and ftrace_modify_code() will replace the 'old' branch with a BRK. This will result in a kernel panic when this BRK is later executed. Practically speaking, case (a) is vastly more likely than case (b), and typically this will result in internal ftrace errors that don't necessarily affect the rest of the system. This can be demonstrated with an out-of-tree test module which triggers ftrace_modify_call(), e.g. | # insmod test_ftrace.ko | test_ftrace: Function test_function raw=0xffffb3749399201c, callsite=0xffffb37493992024 | branch_imm_common: offset out of range | branch_imm_common: offset out of range | ------------[ ftrace bug ]------------ | ftrace failed to modify | [] test_function+0x8/0x38 [test_ftrace] | actual: 1d:00:00:94 | Updating ftrace call site to call a different ftrace function | ftrace record flags: e0000002 | (2) R | expected tramp: ffffb374ae42ed54 | ------------[ cut here ]------------ | WARNING: CPU: 0 PID: 165 at kernel/trace/ftrace.c:2085 ftrace_bug+0x280/0x2b0 | Modules linked in: test_ftrace(+) | CPU: 0 PID: 165 Comm: insmod Not tainted 5.19.0-rc2-00002-g4d9ead8b45ce #13 | Hardware name: linux,dummy-virt (DT) | pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : ftrace_bug+0x280/0x2b0 | lr : ftrace_bug+0x280/0x2b0 | sp : ffff80000839ba00 | x29: ffff80000839ba00 x28: 0000000000000000 x27: ffff80000839bcf0 | x26: ffffb37493994180 x25: ffffb374b0991c28 x24: ffffb374b0d70000 | x23: 00000000ffffffea x22: ffffb374afcc33b0 x21: ffffb374b08f9cc8 | x20: ffff572b8462c000 x19: ffffb374b08f9000 x18: ffffffffffffffff | x17: 6c6c6163202c6331 x16: ffffb374ae5ad110 x15: ffffb374b0d51ee4 | x14: 0000000000000000 x13: 3435646532346561 x12: 3437336266666666 | x11: 203a706d61727420 x10: 6465746365707865 x9 : ffffb374ae5149e8 | x8 : 336266666666203a x7 : 706d617274206465 x6 : 00000000fffff167 | x5 : ffff572bffbc4a08 x4 : 00000000fffff167 x3 : 0000000000000000 | x2 : 0000000000000000 x1 : ffff572b84461e00 x0 : 0000000000000022 | Call trace: | ftrace_bug+0x280/0x2b0 | ftrace_replace_code+0x98/0xa0 | ftrace_modify_all_code+0xe0/0x144 | arch_ftrace_update_code+0x14/0x20 | ftrace_startup+0xf8/0x1b0 | register_ftrace_function+0x38/0x90 | test_ftrace_init+0xd0/0x1000 [test_ftrace] | do_one_initcall+0x50/0x2b0 | do_init_module+0x50/0x1f0 | load_module+0x17c8/0x1d64 | __do_sys_finit_module+0xa8/0x100 | __arm64_sys_finit_module+0x2c/0x3c | invoke_syscall+0x50/0x120 | el0_svc_common.constprop.0+0xdc/0x100 | do_el0_svc+0x3c/0xd0 | el0_svc+0x34/0xb0 | el0t_64_sync_handler+0xbc/0x140 | el0t_64_sync+0x18c/0x190 | ---[ end trace 0000000000000000 ]--- We can solve this by consistently determining whether to use a PLT entry for an address. Note that since (the earlier) commit: f1a54ae9af0da4d7 ("arm64: module/ftrace: intialize PLT at load time") ... we can consistently determine the PLT address that a given callsite will use, and therefore ftrace_make_nop() does not need to skip validation when a PLT is in use. This patch factors the existing logic out of ftrace_make_call() and ftrace_make_nop() into a common ftrace_find_callable_addr() helper function, which is used by ftrace_make_call(), ftrace_make_nop(), and ftrace_modify_call(). In ftrace_make_nop() the patching is consistently validated by ftrace_modify_code() as we can always determine what the old instruction should have been. Fixes: 3b23e4991fb6 ("arm64: implement ftrace with regs") Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Will Deacon Tested-by: "Ivan T. Ivanov" Reviewed-by: Chengming Zhou Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220614080944.1349146-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 3eefdf9d1e406f3da47470b2854347009ffcb6fa Author: Mark Rutland Date: Tue Jun 14 09:09:42 2022 +0100 arm64: ftrace: fix branch range checks The branch range checks in ftrace_make_call() and ftrace_make_nop() are incorrect, erroneously permitting a forwards branch of 128M and erroneously rejecting a backwards branch of 128M. This is because both functions calculate the offset backwards, calculating the offset *from* the target *to* the branch, rather than the other way around as the later comparisons expect. If an out-of-range branch were erroeously permitted, this would later be rejected by aarch64_insn_gen_branch_imm() as branch_imm_common() checks the bounds correctly, resulting in warnings and the placement of a BRK instruction. Note that this can only happen for a forwards branch of exactly 128M, and so the caller would need to be exactly 128M bytes below the relevant ftrace trampoline. If an in-range branch were erroeously rejected, then: * For modules when CONFIG_ARM64_MODULE_PLTS=y, this would result in the use of a PLT entry, which is benign. Note that this is the common case, as this is selected by CONFIG_RANDOMIZE_BASE (and therefore RANDOMIZE_MODULE_REGION_FULL), which distributions typically seelct. This is also selected by CONFIG_ARM64_ERRATUM_843419. * For modules when CONFIG_ARM64_MODULE_PLTS=n, this would result in internal ftrace failures. * For core kernel text, this would result in internal ftrace failues. Note that for this to happen, the kernel text would need to be at least 128M bytes in size, and typical configurations are smaller tha this. Fix this by calculating the offset *from* the branch *to* the target in both functions. Fixes: f8af0b364e24 ("arm64: ftrace: don't validate branch via PLT in ftrace_make_nop()") Fixes: e71a4e1bebaf ("arm64: ftrace: add support for far branches to dynamic ftrace") Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Will Deacon Tested-by: "Ivan T. Ivanov" Reviewed-by: Chengming Zhou Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220614080944.1349146-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ec41c6d82056cbbd7ec8f44eed6d86fea50acf4e Author: Michael Carns Date: Wed Jun 15 14:25:44 2022 +0200 hwmon: (asus-ec-sensors) add missing comma in board name list. This fixes a regression where coma lead to concatenating board names and broke module loading for C8H. Fixes: 5b4285c57b6f ("hwmon: (asus-ec-sensors) fix Formula VIII definition") Signed-off-by: Michael Carns Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220615122544.140340-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 27d8fa207835fa5c7cd6f969c6cc94d1123951ee Author: Catalin Marinas Date: Wed Jun 15 14:22:38 2022 +0100 Revert "arm64: Initialize jump labels before setup_machine_fdt()" This reverts commit 73e2d827a501d48dceeb5b9b267a4cd283d6b1ae. The reverted patch was needed as a fix after commit f5bda35fba61 ("random: use static branch for crng_ready()"). However, this was already fixed by 60e5b2886b92 ("random: do not use jump labels before they are initialized") and hence no longer necessary to initialise jump labels before setup_machine_fdt(). Signed-off-by: Catalin Marinas commit 24d0af46d389d70de7d6465801ee1affe0629c88 Merge: aaefa29270d95 ba79c5e45eecb Author: Linus Walleij Date: Wed Jun 15 16:17:08 2022 +0200 Merge tag 'intel-pinctrl-v5.19-3' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v5.19-3 * Update a record in the MAINTAINERS database for Intel pin control drivers The following is an automated git shortlog grouped by driver: MAINTAINERS: - Update Intel pin control to Supported commit 3046a827316c0e55fc563b4fb78c93b9ca5c7c37 Author: Jon Maxwell Date: Wed Jun 15 11:15:40 2022 +1000 bpf: Fix request_sock leak in sk lookup helpers A customer reported a request_socket leak in a Calico cloud environment. We found that a BPF program was doing a socket lookup with takes a refcnt on the socket and that it was finding the request_socket but returning the parent LISTEN socket via sk_to_full_sk() without decrementing the child request socket 1st, resulting in request_sock slab object leak. This patch retains the existing behaviour of returning full socks to the caller but it also decrements the child request_socket if one is present before doing so to prevent the leak. Thanks to Curtis Taylor for all the help in diagnosing and testing this. And thanks to Antoine Tenart for the reproducer and patch input. v2 of this patch contains, refactor as per Daniel Borkmann's suggestions to validate RCU flags on the listen socket so that it balances with bpf_sk_release() and update comments as per Martin KaFai Lau's suggestion. One small change to Daniels suggestion, put "sk = sk2" under "if (sk2 != sk)" to avoid an extra instruction. Fixes: f7355a6c0497 ("bpf: Check sk_fullsock() before returning from bpf_sk_lookup()") Fixes: edbf8c01de5a ("bpf: add skc_lookup_tcp helper") Co-developed-by: Antoine Tenart Signed-off-by: Antoine Tenart Signed-off-by: Jon Maxwell Signed-off-by: Daniel Borkmann Tested-by: Curtis Taylor Cc: Martin KaFai Lau Link: https://lore.kernel.org/bpf/56d6f898-bde0-bb25-3427-12a330b29fb8@iogearbox.net Link: https://lore.kernel.org/bpf/20220615011540.813025-1-jmaxwell37@gmail.com commit aaefa29270d9551b604165a08406543efa9d16f5 Author: Samuel Holland Date: Wed May 25 21:49:56 2022 -0500 pinctrl: sunxi: a83t: Fix NAND function name for some pins The other NAND pins on Port C use the "nand0" function name. "nand0" also matches all of the other Allwinner SoCs. Fixes: 4730f33f0d82 ("pinctrl: sunxi: add allwinner A83T PIO controller support") Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220526024956.49500-1-samuel@sholland.org Signed-off-by: Linus Walleij commit 84a85d3fef2e75b1fe9fc2af6f5267122555a1ed Author: Haowen Bai Date: Thu Apr 21 10:26:59 2022 +0800 pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux() pdesc could be null but still dereference pdesc->name and it will lead to a null pointer access. So we move a null check before dereference. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650508019-22554-1-git-send-email-baihaowen@meizu.com Signed-off-by: Linus Walleij commit c2b3a0759c76d67186199eb1d076fb55497eac98 Author: Kalle Valo Date: Fri Jun 10 16:36:40 2022 +0300 dt-bindings: net: wireless: ath11k: change Kalle's email My codeaurora.org email doesn't work anymore, so switch to my preferred kernel.org address. Signed-off-by: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220610133640.10810-2-kvalo@kernel.org commit f424b1a6e1b460c04018ed5508dd7dbae72e27ab Author: Kalle Valo Date: Fri Jun 10 16:36:39 2022 +0300 dt-bindings: net: wireless: ath9k: Change Toke as maintainer Toke now maintains ath9k so update DT bindings as well. Signed-off-by: Kalle Valo Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220610133640.10810-1-kvalo@kernel.org commit 933b5f9f98da29af646b51b36a0753692908ef64 Author: Dmitry Klochkov Date: Tue Jun 14 15:11:41 2022 +0300 tools/kvm_stat: fix display of error when multiple processes are found Instead of printing an error message, kvm_stat script fails when we restrict statistics to a guest by its name and there are multiple guests with such name: # kvm_stat -g my_vm Traceback (most recent call last): File "/usr/bin/kvm_stat", line 1819, in main() File "/usr/bin/kvm_stat", line 1779, in main options = get_options() File "/usr/bin/kvm_stat", line 1718, in get_options options = argparser.parse_args() File "/usr/lib64/python3.10/argparse.py", line 1825, in parse_args args, argv = self.parse_known_args(args, namespace) File "/usr/lib64/python3.10/argparse.py", line 1858, in parse_known_args namespace, args = self._parse_known_args(args, namespace) File "/usr/lib64/python3.10/argparse.py", line 2067, in _parse_known_args start_index = consume_optional(start_index) File "/usr/lib64/python3.10/argparse.py", line 2007, in consume_optional take_action(action, args, option_string) File "/usr/lib64/python3.10/argparse.py", line 1935, in take_action action(self, namespace, argument_values, option_string) File "/usr/bin/kvm_stat", line 1649, in __call__ ' to specify the desired pid'.format(" ".join(pids))) TypeError: sequence item 0: expected str instance, int found To avoid this, it's needed to convert pids int values to strings before pass them to join(). Signed-off-by: Dmitry Klochkov Message-Id: <20220614121141.160689-1-kdmitry556@gmail.com> Signed-off-by: Paolo Bonzini commit 219b51a6f040fa5367adadd7d58c4dda0896a01d Author: Duoming Zhou Date: Tue Jun 14 17:25:57 2022 +0800 net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg The skb_recv_datagram() in ax25_recvmsg() will hold lock_sock and block until it receives a packet from the remote. If the client doesn`t connect to server and calls read() directly, it will not receive any packets forever. As a result, the deadlock will happen. The fail log caused by deadlock is shown below: [ 369.606973] INFO: task ax25_deadlock:157 blocked for more than 245 seconds. [ 369.608919] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 369.613058] Call Trace: [ 369.613315] [ 369.614072] __schedule+0x2f9/0xb20 [ 369.615029] schedule+0x49/0xb0 [ 369.615734] __lock_sock+0x92/0x100 [ 369.616763] ? destroy_sched_domains_rcu+0x20/0x20 [ 369.617941] lock_sock_nested+0x6e/0x70 [ 369.618809] ax25_bind+0xaa/0x210 [ 369.619736] __sys_bind+0xca/0xf0 [ 369.620039] ? do_futex+0xae/0x1b0 [ 369.620387] ? __x64_sys_futex+0x7c/0x1c0 [ 369.620601] ? fpregs_assert_state_consistent+0x19/0x40 [ 369.620613] __x64_sys_bind+0x11/0x20 [ 369.621791] do_syscall_64+0x3b/0x90 [ 369.622423] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 369.623319] RIP: 0033:0x7f43c8aa8af7 [ 369.624301] RSP: 002b:00007f43c8197ef8 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 [ 369.625756] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f43c8aa8af7 [ 369.626724] RDX: 0000000000000010 RSI: 000055768e2021d0 RDI: 0000000000000005 [ 369.628569] RBP: 00007f43c8197f00 R08: 0000000000000011 R09: 00007f43c8198700 [ 369.630208] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff845e6afe [ 369.632240] R13: 00007fff845e6aff R14: 00007f43c8197fc0 R15: 00007f43c8198700 This patch replaces skb_recv_datagram() with an open-coded variant of it releasing the socket lock before the __skb_wait_for_more_packets() call and re-acquiring it after such call in order that other functions that need socket lock could be executed. what's more, the socket lock will be released only when recvmsg() will block and that should produce nicer overall behavior. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Suggested-by: Thomas Osterried Signed-off-by: Duoming Zhou Reported-by: Thomas Habets Acked-by: Paolo Abeni Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit c5595975b53a487bf329eeba65b5c5f34605a4c0 Author: Pavel Begunkov Date: Wed Jun 15 11:23:07 2022 +0100 io_uring: make io_fill_cqe_aux honour CQE32 Don't let io_fill_cqe_aux() post 16B cqes for CQE32 rings, neither the kernel nor the userspace expect this to happen. Fixes: 76c68fbf1a1f9 ("io_uring: enable CQE32") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/64fae669fae1b7083aa15d0cd807f692b0880b9a.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cd94903d3ba50d7ae797c603f68996af8d1ba1a1 Author: Pavel Begunkov Date: Wed Jun 15 11:23:06 2022 +0100 io_uring: remove __io_fill_cqe() helper In preparation for the following patch, inline __io_fill_cqe(), there is only one user. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/71dab9afc3cde3f8b64d26f20d3b60bdc40726ff.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2caf9822f0507463168a9e83f93c75b3e3fac971 Author: Pavel Begunkov Date: Wed Jun 15 11:23:05 2022 +0100 io_uring: fix ->extra{1,2} misuse We don't really know the state of req->extra{1,2] fields in __io_fill_cqe_req(), if an opcode handler is not aware of CQE32 option, it never sets them up properly. Track the state of those fields with a request flag. Fixes: 76c68fbf1a1f9 ("io_uring: enable CQE32") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/4b3e5be512fbf4debec7270fd485b8a3b014d464.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 29ede2014c87576d2fc83680aa4c1d7403db0dfe Author: Pavel Begunkov Date: Wed Jun 15 11:23:04 2022 +0100 io_uring: fill extra big cqe fields from req The only user of io_req_complete32()-like functions is cmd requests. Instead of keeping the whole complete32 family, remove them and provide the extras in already added for inline completions req->extra{1,2}. When fill_cqe_res() finds CQE32 option enabled it'll use those fields to fill a 32B cqe. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/af1319eb661b1f9a0abceb51cbbf72b8002e019d.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f43de1f88841d59f27f761219b6550bd6ce3dcc1 Author: Pavel Begunkov Date: Wed Jun 15 11:23:03 2022 +0100 io_uring: unite fill_cqe and the 32B version We want just one function that will handle both normal cqes and 32B cqes. Combine __io_fill_cqe_req() and __io_fill_cqe_req32(). It's still not entirely correct yet, but saves us from cases when we fill an CQE of a wrong size. Fixes: 76c68fbf1a1f9 ("io_uring: enable CQE32") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8085c5b2f74141520f60decd45334f87e389b718.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 91ef75a7db0d0855284b78d60d3fcec5c353ec5a Author: Pavel Begunkov Date: Wed Jun 15 11:23:02 2022 +0100 io_uring: get rid of __io_fill_cqe{32}_req() There are too many cqe filling helpers, kill __io_fill_cqe{32}_req(), use __io_fill_cqe{32}_req_filled() instead, and then rename it. It'll simplify fixing in following patches. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c18e0d191014fb574f24721245e4e3fddd0b6917.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 36a15e1cb134c0395261ba1940762703f778438c Author: Jose Alonso Date: Mon Jun 13 15:32:44 2022 -0300 net: usb: ax88179_178a needs FLAG_SEND_ZLP The extra byte inserted by usbnet.c when (length % dev->maxpacket == 0) is causing problems to device. This patch sets FLAG_SEND_ZLP to avoid this. Tested with: 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet Problems observed: ====================================================================== 1) Using ssh/sshfs. The remote sshd daemon can abort with the message: "message authentication code incorrect" This happens because the tcp message sent is corrupted during the USB "Bulk out". The device calculate the tcp checksum and send a valid tcp message to the remote sshd. Then the encryption detects the error and aborts. 2) NETDEV WATCHDOG: ... (ax88179_178a): transmit queue 0 timed out 3) Stop normal work without any log message. The "Bulk in" continue receiving packets normally. The host sends "Bulk out" and the device responds with -ECONNRESET. (The netusb.c code tx_complete ignore -ECONNRESET) Under normal conditions these errors take days to happen and in intense usage take hours. A test with ping gives packet loss, showing that something is wrong: ping -4 -s 462 {destination} # 462 = 512 - 42 - 8 Not all packets fail. My guess is that the device tries to find another packet starting at the extra byte and will fail or not depending on the next bytes (old buffer content). ====================================================================== Signed-off-by: Jose Alonso Signed-off-by: David S. Miller commit 371de1aa000dd5265a32ed934792a306ec873d6e Merge: b60377de77905 efe41860008e5 Author: David S. Miller Date: Wed Jun 15 09:15:33 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-06-14 This series contains updates to ice driver only. Michal fixes incorrect Tx timestamp offset calculation for E822 devices. Roman enforces required VLAN filtering settings for double VLAN mode. Przemyslaw fixes memory corruption issues with VFs by ensuring queues are disabled in the error path of VF queue configuration and to disabled VFs during reset. ==================== Signed-off-by: David S. Miller commit b60377de779052bf00b34a62f0bae03c92b88776 Author: Lukas Bulwahn Date: Mon Jun 13 14:18:26 2022 +0200 MAINTAINERS: add include/dt-bindings/net to NETWORKING DRIVERS Maintainers of the directory Documentation/devicetree/bindings/net are also the maintainers of the corresponding directory include/dt-bindings/net. Add the file entry for include/dt-bindings/net to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220613121826.11484-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit 56ec3e755bd1041d35bdec020a99b327697ee470 Author: Takashi Iwai Date: Tue Jun 14 07:48:31 2022 +0200 ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly It turned out that Lenovo shipped two completely different products with the very same PCI SSID, where both require different quirks; namely, Lenovo C940 has already the fixup for its speaker (ALC298_FIXUP_LENOVO_SPK_VOLUME) with the PCI SSID 17aa:3818, while Yoga Duet 7 has also the very same PCI SSID but requires a different quirk, ALC287_FIXUP_YOGA7_14TIL_SPEAKERS. Fortunately, both are with different codecs (C940 with ALC298 and Duet 7 with ALC287), hence we can apply different fixes by checking the codec ID. This patch implements that special fixup function. For easier handling, the internal function for applying a specific fixup entry is exported as __snd_hda_apply_fixup(), so that it can be called from the codec driver. The rest is simply calling it with a different fixup ID depending on the codec ID. Reported-by: Hans de Goede Tested-by: nikitashvets@flyium.com Cc: Link: https://lore.kernel.org/r/5ca147d1-3a2d-60c6-c491-8aa844183222@redhat.com Link: https://lore.kernel.org/r/20220614054831.14648-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 56315b6bf7fc63d2b26c37869d2753f765849bd6 Author: Oleksij Rempel Date: Fri Jun 10 10:16:21 2022 +0200 ARM: dts: at91: ksz9477_evb: fix port/phy validation Latest drivers version requires phy-mode to be set. Otherwise we will use "NA" mode and the switch driver will invalidate this port mode. Fixes: 65ac79e18120 ("net: dsa: microchip: add the phylink get_caps") Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220610081621.584393-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 2a3dcbccd64ba35c045fac92272ff981c4cbef44 Author: Tyler Hicks Date: Thu May 26 18:59:59 2022 -0500 9p: Fix refcounting during full path walks for fid lookups Decrement the refcount of the parent dentry's fid after walking each path component during a full path walk for a lookup. Failure to do so can lead to fids that are not clunked until the filesystem is unmounted, as indicated by this warning: 9pnet: found fid 3 not clunked The improper refcounting after walking resulted in open(2) returning -EIO on any directories underneath the mount point when using the virtio transport. When using the fd transport, there's no apparent issue until the filesytem is unmounted and the warning above is emitted to the logs. In some cases, the user may not yet be attached to the filesystem and a new root fid, associated with the user, is created and attached to the root dentry before the full path walk is performed. Increment the new root fid's refcount to two in that situation so that it can be safely decremented to one after it is used for the walk operation. The new fid will still be attached to the root dentry when v9fs_fid_lookup_with_uid() returns so a final refcount of one is correct/expected. Link: https://lkml.kernel.org/r/20220527000003.355812-2-tyhicks@linux.microsoft.com Link: https://lkml.kernel.org/r/20220612085330.1451496-4-asmadeus@codewreck.org Fixes: 6636b6dcc3db ("9p: add refcount to p9_fid struct") Cc: stable@vger.kernel.org Signed-off-by: Tyler Hicks Reviewed-by: Christian Schoenebeck [Dominique: fix clunking fid multiple times discussed in second link] Signed-off-by: Dominique Martinet commit e5690f263208c5abce7451370b7786eb25b405eb Author: Dominique Martinet Date: Sun Jun 12 17:14:55 2022 +0900 9p: fix fid refcount leak in v9fs_vfs_get_link we check for protocol version later than required, after a fid has been obtained. Just move the version check earlier. Link: https://lkml.kernel.org/r/20220612085330.1451496-3-asmadeus@codewreck.org Fixes: 6636b6dcc3db ("9p: add refcount to p9_fid struct") Cc: stable@vger.kernel.org Reviewed-by: Tyler Hicks Reviewed-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit beca774fc51a9ba8abbc869cf0c3d965ff17cd24 Author: Dominique Martinet Date: Sun Jun 12 16:00:05 2022 +0900 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl We need to release directory fid if we fail halfway through open This fixes fid leaking with xfstests generic 531 Link: https://lkml.kernel.org/r/20220612085330.1451496-2-asmadeus@codewreck.org Fixes: 6636b6dcc3db ("9p: add refcount to p9_fid struct") Cc: stable@vger.kernel.org Reported-by: Tyler Hicks Reviewed-by: Tyler Hicks Reviewed-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit d7dd6eccfbc95ac47a12396f84e7e1b361db654b Author: Christophe JAILLET Date: Mon Jun 13 22:53:50 2022 +0200 net: bgmac: Fix an erroneous kfree() in bgmac_remove() 'bgmac' is part of a managed resource allocated with bgmac_alloc(). It should not be freed explicitly. Remove the erroneous kfree() from the .remove() function. Fixes: 34a5102c3235 ("net: bgmac: allocate struct bgmac just once & don't copy it") Signed-off-by: Christophe JAILLET Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/a026153108dd21239036a032b95c25b5cece253b.1655153616.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit e591fcf6b4e39335c9b128b17738fcd2fdd278ae Author: Chevron Li Date: Thu Jun 2 06:25:43 2022 -0700 mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing The result from ->get_cd() may be incorrect as the card detect debouncing isn't managed correctly. Let's fix it. Signed-off-by: Chevron Li Fixes: 7d44061704dd ("mmc: sdhci-pci-o2micro: Fix O2 Host data read/write DLL Lock phase shift issue") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220602132543.596-1-chevron.li@bayhubtech.com [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson commit de87b603b0919e31578c8fa312a3541f1fb37e1c Author: Christophe JAILLET Date: Sun May 22 14:22:07 2022 +0200 i2c: mediatek: Fix an error handling path in mtk_i2c_probe() The clsk are prepared, enabled, then disabled. So if an error occurs after the disable step, they are still prepared. Add an error handling path to unprepare the clks in such a case, as already done in the .remove function. Fixes: 8b4fc246c3ff ("i2c: mediatek: Optimize master_xfer() and avoid circular locking") Signed-off-by: Christophe JAILLET Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang commit 62b5e322fb6cc5a5a91fdeba0e4e57e75d9f4387 Author: Jonathan Marek Date: Mon Jun 13 18:10:19 2022 -0400 drm/msm: use for_each_sgtable_sg to iterate over scatterlist The dma_map_sgtable() call (used to invalidate cache) overwrites sgt->nents with 1, so msm_iommu_pagetable_map maps only the first physical segment. To fix this problem use for_each_sgtable_sg(), which uses orig_nents. Fixes: b145c6e65eb0 ("drm/msm: Add support to create a local pagetable") Signed-off-by: Jonathan Marek Link: https://lore.kernel.org/r/20220613221019.11399-1-jonathan@marek.ca Signed-off-by: Rob Clark commit 018ab4fabddd94f1c96f3b59e180691b9e88d5d8 Author: Linus Torvalds Date: Tue Jun 14 10:36:11 2022 -0700 netfs: fix up netfs_inode_init() docbook comment Commit e81fb4198e27 ("netfs: Further cleanups after struct netfs_inode wrapper introduced") changed the argument types and names, and actually updated the comment too (although that was thanks to David Howells, not me: my original patch only changed the code). But the comment fixup didn't go quite far enough, and didn't change the argument name in the comment, resulting in include/linux/netfs.h:314: warning: Function parameter or member 'ctx' not described in 'netfs_inode_init' include/linux/netfs.h:314: warning: Excess function parameter 'inode' description in 'netfs_inode_init' during htmldoc generation. Fixes: e81fb4198e27 ("netfs: Further cleanups after struct netfs_inode wrapper introduced") Reported-by: Stephen Rothwell Signed-off-by: Linus Torvalds commit 795285ef242543bb636556b7225f20adb7d3795c Author: Mark Brown Date: Tue Jun 14 13:10:45 2022 +0100 selftests: Fix clang cross compilation Unlike GCC clang uses a single compiler image to support multiple target architectures meaning that we can't simply rely on CROSS_COMPILE to select the output architecture. Instead we must pass --target to the compiler to tell it what to output, kselftest was not doing this so cross compilation of kselftest using clang resulted in kselftest being built for the host architecture. More work is required to fix tests using custom rules but this gets the bulk of things building. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit 4fd17f2ac0aa4e48823ac2ede5b050fb70300bf4 Author: Roman Li Date: Thu May 19 14:41:16 2022 -0400 drm/amd/display: Cap OLED brightness per max frame-average luminance [Why] For OLED eDP the Display Manager uses max_cll value as a limit for brightness control. max_cll defines the content light luminance for individual pixel. Whereas max_fall defines frame-average level luminance. The user may not observe the difference in brightness in between max_fall and max_cll. That negatively impacts the user experience. [How] Use max_fall value instead of max_cll as a limit for brightness control. Reviewed-by: Rodrigo Siqueira Acked-by: Hamza Mahfooz Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit c904e3acbab3fd97649cd4ab1ff7f1521ad3a255 Author: Michel Dänzer Date: Fri Jun 10 15:54:26 2022 +0200 drm/amdgpu: Fix GTT size reporting in amdgpu_ioctl The commit below changed the TTM manager size unit from pages to bytes, but failed to adjust the corresponding calculations in amdgpu_ioctl. Fixes: dfa714b88eb0 ("drm/amdgpu: remove GTT accounting v2") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1930 Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6642 Tested-by: Martin Roukala Tested-by: Mike Lothian Reviewed-by: Christian König Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit d884b6498d2f022098502e106d5a45ab635f2e9a Author: Pavel Begunkov Date: Tue Jun 14 17:51:18 2022 +0100 io_uring: remove IORING_CLOSE_FD_AND_FILE_SLOT This partially reverts a7c41b4687f5902af70cd559806990930c8a307b Even though IORING_CLOSE_FD_AND_FILE_SLOT might save cycles for some users, but it tries to do two things at a time and it's not clear how to handle errors and what to return in a single result field when one part fails and another completes well. Kill it for now. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/837c745019b3795941eee4fcfd7de697886d645b.1655224415.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit aa165d6d2bb55f8b1bb5047fd634311681316fa2 Author: Pavel Begunkov Date: Tue Jun 14 17:51:17 2022 +0100 Revert "io_uring: add buffer selection support to IORING_OP_NOP" This reverts commit 3d200242a6c968af321913b635fc4014b238cba4. Buffer selection with nops was used for debugging and benchmarking but is useless in real life. Let's revert it before it's released. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c5012098ca6b51dfbdcb190f8c4e3c0bf1c965dc.1655224415.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 8899ce4b2f7364a90e3b9cf332dfd9993c61f46c Author: Pavel Begunkov Date: Tue Jun 14 17:51:16 2022 +0100 Revert "io_uring: support CQE32 for nop operation" This reverts commit 2bb04df7c2af9dad5d28771c723bc39b01cf7df4. CQE32 nops were used for debugging and benchmarking but it doesn't target any real use case. Revert it, we can return it back if someone finds a good way to use it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5ff623d84ccb4b3f3b92a3ea41cdcfa612f3d96f.1655224415.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit efe41860008e57fb6b69855b4b93fdf34bc42798 Author: Przemyslaw Patynowski Date: Thu Jun 2 12:09:17 2022 +0200 ice: Fix memory corruption in VF driver Disable VF's RX/TX queues, when it's disabled. VF can have queues enabled, when it requests a reset. If PF driver assumes that VF is disabled, while VF still has queues configured, VF may unmap DMA resources. In such scenario device still can map packets to memory, which ends up silently corrupting it. Previously, VF driver could experience memory corruption, which lead to crash: [ 5119.170157] BUG: unable to handle kernel paging request at 00001b9780003237 [ 5119.170166] PGD 0 P4D 0 [ 5119.170173] Oops: 0002 [#1] PREEMPT_RT SMP PTI [ 5119.170181] CPU: 30 PID: 427592 Comm: kworker/u96:2 Kdump: loaded Tainted: G W I --------- - - 4.18.0-372.9.1.rt7.166.el8.x86_64 #1 [ 5119.170189] Hardware name: Dell Inc. PowerEdge R740/014X06, BIOS 2.3.10 08/15/2019 [ 5119.170193] Workqueue: iavf iavf_adminq_task [iavf] [ 5119.170219] RIP: 0010:__page_frag_cache_drain+0x5/0x30 [ 5119.170238] Code: 0f 0f b6 77 51 85 f6 74 07 31 d2 e9 05 df ff ff e9 90 fe ff ff 48 8b 05 49 db 33 01 eb b4 0f 1f 80 00 00 00 00 0f 1f 44 00 00 29 77 34 74 01 c3 48 8b 07 f6 c4 80 74 0f 0f b6 77 51 85 f6 74 [ 5119.170244] RSP: 0018:ffffa43b0bdcfd78 EFLAGS: 00010282 [ 5119.170250] RAX: ffffffff896b3e40 RBX: ffff8fb282524000 RCX: 0000000000000002 [ 5119.170254] RDX: 0000000049000000 RSI: 0000000000000000 RDI: 00001b9780003203 [ 5119.170259] RBP: ffff8fb248217b00 R08: 0000000000000022 R09: 0000000000000009 [ 5119.170262] R10: 2b849d6300000000 R11: 0000000000000020 R12: 0000000000000000 [ 5119.170265] R13: 0000000000001000 R14: 0000000000000009 R15: 0000000000000000 [ 5119.170269] FS: 0000000000000000(0000) GS:ffff8fb1201c0000(0000) knlGS:0000000000000000 [ 5119.170274] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5119.170279] CR2: 00001b9780003237 CR3: 00000008f3e1a003 CR4: 00000000007726e0 [ 5119.170283] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5119.170286] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 5119.170290] PKRU: 55555554 [ 5119.170292] Call Trace: [ 5119.170298] iavf_clean_rx_ring+0xad/0x110 [iavf] [ 5119.170324] iavf_free_rx_resources+0xe/0x50 [iavf] [ 5119.170342] iavf_free_all_rx_resources.part.51+0x30/0x40 [iavf] [ 5119.170358] iavf_virtchnl_completion+0xd8a/0x15b0 [iavf] [ 5119.170377] ? iavf_clean_arq_element+0x210/0x280 [iavf] [ 5119.170397] iavf_adminq_task+0x126/0x2e0 [iavf] [ 5119.170416] process_one_work+0x18f/0x420 [ 5119.170429] worker_thread+0x30/0x370 [ 5119.170437] ? process_one_work+0x420/0x420 [ 5119.170445] kthread+0x151/0x170 [ 5119.170452] ? set_kthread_struct+0x40/0x40 [ 5119.170460] ret_from_fork+0x35/0x40 [ 5119.170477] Modules linked in: iavf sctp ip6_udp_tunnel udp_tunnel mlx4_en mlx4_core nfp tls vhost_net vhost vhost_iotlb tap tun xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_counter nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink bridge stp llc rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace fscache sunrpc intel_rapl_msr iTCO_wdt iTCO_vendor_support dell_smbios wmi_bmof dell_wmi_descriptor dcdbas kvm_intel kvm irqbypass intel_rapl_common isst_if_common skx_edac irdma nfit libnvdimm x86_pkg_temp_thermal i40e intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel ib_uverbs rapl ipmi_ssif intel_cstate intel_uncore mei_me pcspkr acpi_ipmi ib_core mei lpc_ich i2c_i801 ipmi_si ipmi_devintf wmi ipmi_msghandler acpi_power_meter xfs libcrc32c sd_mod t10_pi sg mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ice ahci drm libahci crc32c_intel libata tg3 megaraid_sas [ 5119.170613] i2c_algo_bit dm_mirror dm_region_hash dm_log dm_mod fuse [last unloaded: iavf] [ 5119.170627] CR2: 00001b9780003237 Fixes: ec4f5a436bdf ("ice: Check if VF is disabled for Opcode and other operations") Signed-off-by: Przemyslaw Patynowski Co-developed-by: Slawomir Laba Signed-off-by: Slawomir Laba Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit be2af71496a54a7195ac62caba6fab49cfe5006c Author: Przemyslaw Patynowski Date: Thu Jun 2 12:09:04 2022 +0200 ice: Fix queue config fail handling Disable VF's RX/TX queues, when VIRTCHNL_OP_CONFIG_VSI_QUEUES fail. Not disabling them might lead to scenario, where PF driver leaves VF queues enabled, when VF's VSI failed queue config. In this scenario VF should not have RX/TX queues enabled. If PF failed to set up VF's queues, VF will reset due to TX timeouts in VF driver. Initialize iterator 'i' to -1, so if error happens prior to configuring queues then error path code will not disable queue 0. Loop that configures queues will is using same iterator, so error path code will only disable queues that were configured. Fixes: 77ca27c41705 ("ice: add support for virtchnl_queue_select.[tx|rx]_queues bitmap") Suggested-by: Slawomir Laba Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 9542ef4fba8c73e176b8aa18a8adf04aecb889e5 Author: Roman Storozhenko Date: Tue Jun 7 08:54:57 2022 +0200 ice: Sync VLAN filtering features for DVM VLAN filtering features, that is C-Tag and S-Tag, in DVM mode must be both enabled or disabled. In case of turning off/on only one of the features, another feature must be turned off/on automatically with issuing an appropriate message to the kernel log. Fixes: 1babaf77f49d ("ice: Advertise 802.1ad VLAN filtering and offloads for PF netdev") Signed-off-by: Roman Storozhenko Co-developed-by: Anatolii Gerasymenko Signed-off-by: Anatolii Gerasymenko Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 71a579f0d3777a704355e6f1572dfba92a9b58b2 Author: Michal Michalik Date: Tue May 10 13:03:43 2022 +0200 ice: Fix PTP TX timestamp offset calculation The offset was being incorrectly calculated for E822 - that led to collisions in choosing TX timestamp register location when more than one port was trying to use timestamping mechanism. In E822 one quad is being logically split between ports, so quad 0 is having trackers for ports 0-3, quad 1 ports 4-7 etc. Each port should have separate memory location for tracking timestamps. Due to error for example ports 1 and 2 had been assigned to quad 0 with same offset (0), while port 1 should have offset 0 and 1 offset 16. Fix it by correctly calculating quad offset. Fixes: 3a7496234d17 ("ice: implement basic E822 PTP support") Signed-off-by: Michal Michalik Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 24625f7d91fb86b91e14749633a7f022f5866116 Merge: 8e8afafb0b557 e0f3f46e42064 Author: Linus Torvalds Date: Tue Jun 14 07:57:18 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "While last week's pull request contained miscellaneous fixes for x86, this one covers other architectures, selftests changes, and a bigger series for APIC virtualization bugs that were discovered during 5.20 development. The idea is to base 5.20 development for KVM on top of this tag. ARM64: - Properly reset the SVE/SME flags on vcpu load - Fix a vgic-v2 regression regarding accessing the pending state of a HW interrupt from userspace (and make the code common with vgic-v3) - Fix access to the idreg range for protected guests - Ignore 'kvm-arm.mode=protected' when using VHE - Return an error from kvm_arch_init_vm() on allocation failure - A bunch of small cleanups (comments, annotations, indentation) RISC-V: - Typo fix in arch/riscv/kvm/vmid.c - Remove broken reference pattern from MAINTAINERS entry x86-64: - Fix error in page tables with MKTME enabled - Dirty page tracking performance test extended to running a nested guest - Disable APICv/AVIC in cases that it cannot implement correctly" [ This merge also fixes a misplaced end parenthesis bug introduced in commit 3743c2f02517 ("KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base") pointed out by Sean Christopherson ] Link: https://lore.kernel.org/all/20220610191813.371682-1-seanjc@google.com/ * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (34 commits) KVM: selftests: Restrict test region to 48-bit physical addresses when using nested KVM: selftests: Add option to run dirty_log_perf_test vCPUs in L2 KVM: selftests: Clean up LIBKVM files in Makefile KVM: selftests: Link selftests directly with lib object files KVM: selftests: Drop unnecessary rule for STATIC_LIBS KVM: selftests: Add a helper to check EPT/VPID capabilities KVM: selftests: Move VMX_EPT_VPID_CAP_AD_BITS to vmx.h KVM: selftests: Refactor nested_map() to specify target level KVM: selftests: Drop stale function parameter comment for nested_map() KVM: selftests: Add option to create 2M and 1G EPT mappings KVM: selftests: Replace x86_page_size with PG_LEVEL_XX KVM: x86: SVM: fix nested PAUSE filtering when L0 intercepts PAUSE KVM: x86: SVM: drop preempt-safe wrappers for avic_vcpu_load/put KVM: x86: disable preemption around the call to kvm_arch_vcpu_{un|}blocking KVM: x86: disable preemption while updating apicv inhibition KVM: x86: SVM: fix avic_kick_target_vcpus_fast KVM: x86: SVM: remove avic's broken code that updated APIC ID KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base KVM: x86: document AVIC/APICv inhibit reasons KVM: x86/mmu: Set memory encryption "value", not "mask", in shadow PDPTRs ... commit a6e944f25cdbe6b82275402b8bc9a55ad7aac10b Author: Ciara Loftus Date: Tue Jun 14 07:07:46 2022 +0000 xsk: Fix generic transmit when completion queue reservation fails Two points of potential failure in the generic transmit function are: 1. completion queue (cq) reservation failure. 2. skb allocation failure Originally the cq reservation was performed first, followed by the skb allocation. Commit 675716400da6 ("xdp: fix possible cq entry leak") reversed the order because at the time there was no mechanism available to undo the cq reservation which could have led to possible cq entry leaks in the event of skb allocation failure. However if the skb allocation is performed first and the cq reservation then fails, the xsk skb destructor is called which blindly adds the skb address to the already full cq leading to undefined behavior. This commit restores the original order (cq reservation followed by skb allocation) and uses the xskq_prod_cancel helper to undo the cq reserve in event of skb allocation failure. Fixes: 675716400da6 ("xdp: fix possible cq entry leak") Signed-off-by: Ciara Loftus Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220614070746.8871-1-ciara.loftus@intel.com commit 8e8afafb0b5571b7cb10b529dc60cadb7241bed4 Merge: b13baccc3850c 1dc6ff02c8bf7 Author: Linus Torvalds Date: Tue Jun 14 07:43:15 2022 -0700 Merge tag 'x86-bugs-2022-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 MMIO stale data fixes from Thomas Gleixner: "Yet another hw vulnerability with a software mitigation: Processor MMIO Stale Data. They are a class of MMIO-related weaknesses which can expose stale data by propagating it into core fill buffers. Data which can then be leaked using the usual speculative execution methods. Mitigations include this set along with microcode updates and are similar to MDS and TAA vulnerabilities: VERW now clears those buffers too" * tag 'x86-bugs-2022-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation/mmio: Print SMT warning KVM: x86/speculation: Disable Fill buffer clear within guests x86/speculation/mmio: Reuse SRBDS mitigation for SBDS x86/speculation/srbds: Update SRBDS mitigation selection x86/speculation/mmio: Add sysfs reporting for Processor MMIO Stale Data x86/speculation/mmio: Enable CPU Fill buffer clearing on idle x86/bugs: Group MDS, TAA & Processor MMIO Stale Data mitigations x86/speculation/mmio: Add mitigation for Processor MMIO Stale Data x86/speculation: Add a common function for MD_CLEAR mitigation update x86/speculation/mmio: Enumerate Processor MMIO Stale Data bug Documentation: Add documentation for Processor MMIO Stale Data commit 4b7a632ac4e7101ceefee8484d5c2ca505d347b3 Author: Petr Machata Date: Mon Jun 13 15:50:17 2022 +0300 mlxsw: spectrum_cnt: Reorder counter pools Both RIF and ACL flow counters use a 24-bit SW-managed counter address to communicate which counter they want to bind. In a number of Spectrum FW releases, binding a RIF counter is broken and slices the counter index to 16 bits. As a result, on Spectrum-2 and above, no more than about 410 RIF counters can be effectively used. This translates to 205 netdevices for which L3 HW stats can be enabled. (This does not happen on Spectrum-1, because there are fewer counters available overall and the counter index never exceeds 16 bits.) Binding counters to ACLs does not have this issue. Therefore reorder the counter allocation scheme so that RIF counters come first and therefore get lower indices that are below the 16-bit barrier. Fixes: 98e60dce4da1 ("Merge branch 'mlxsw-Introduce-initial-Spectrum-2-support'") Reported-by: Maksym Yaremchuk Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220613125017.2018162-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit 7d787184a18f0f84e996de8ff007e4395c1978ea Author: Marek Szyprowski Date: Fri May 13 10:31:05 2022 +0200 drm/exynos: mic: Rework initialization Commit dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver") moved Exynos MIC attaching from DSI to MIC driver. However the method proposed there is incomplete and cannot really work. To properly attach it to the bridge chain, access to the respective encoder is needed. The Exynos MIC driver always attaches to the encoder created by the Exynos DSI driver, so grab it via available helpers for getting access to the CRTC and encoders. This also requires to change the order of driver component binding to let DSI to be bound before MIC. Fixes: dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver") Signed-off-by: Marek Szyprowski Fixed merge conflict. Signed-off-by: Inki Dae commit 5c2b745173347ba21e3995d815f26925c91c517d Author: Dan Carpenter Date: Fri Apr 8 13:21:34 2022 +0300 drm/exynos: fix IS_ERR() vs NULL check in probe The of_drm_find_bridge() does not return error pointers, it returns NULL on error. Fixes: dd8b6803bc49 ("exynos: drm: dsi: Attach in_bridge in MIC driver") Signed-off-by: Dan Carpenter Signed-off-by: Inki Dae commit 5e93207e962a6d23893ff4405f6c5d4396fb5934 Author: Serge Semin Date: Fri Jun 10 13:40:30 2022 +0300 bus: bt1-axi: Don't print error on -EPROBE_DEFER The Baikal-T1 AXI bus driver correctly handles the deferred probe situation, but still pollutes the system log with a misleading error message. Let's fix that by using the dev_err_probe() method to print the log message in case of the clocks/resets request errors. Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220610104030.28399-2-Sergey.Semin@baikalelectronics.ru' Signed-off-by: Arnd Bergmann commit be5cddef05f519a321a543906f255ac247246074 Author: Serge Semin Date: Fri Jun 10 13:40:29 2022 +0300 bus: bt1-apb: Don't print error on -EPROBE_DEFER The Baikal-T1 APB bus driver correctly handles the deferred probe situation, but still pollutes the system log with a misleading error message. Let's fix that by using the dev_err_probe() method to print the log message in case of the clocks/resets request errors. Signed-off-by: Serge Semin Link: https://lore.kernel.org/r/20220610104030.28399-1-Sergey.Semin@baikalelectronics.ru' Signed-off-by: Arnd Bergmann commit 965890425271b6a35a07b85384f4a6e4fc517322 Merge: 11bb764fbf51b 46d6e11320d21 Author: Arnd Bergmann Date: Tue Jun 14 12:20:46 2022 +0200 Merge tag 'arm-soc/for-5.19/maintainers-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains MAINTAINERS file update for Broadcom SoCs, please pull the following: - Nicolas steps down from maintaining the BCM283x/BCM2711 (Raspberry Pi) architecture and designates Florian to take care of that * tag 'arm-soc/for-5.19/maintainers-fixes' of https://github.com/Broadcom/stblinux: MAINTAINERS: Update BCM2711/BCM2835 maintainer Link: https://lore.kernel.org/r/20220608093132.1465703-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 11bb764fbf51bc8c859484104553f3d627db8b1e Merge: 2d2cb31bd36b7 37d838de369b0 Author: Arnd Bergmann Date: Tue Jun 14 12:20:30 2022 +0200 Merge tag 'arm-soc/for-5.19/drivers-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs driver fixes for 5.19, please pull the following: - Miaoqian fixes a device tree node reference count in the system sleep code for Broadcom STB chips * tag 'arm-soc/for-5.19/drivers-fixes' of https://github.com/Broadcom/stblinux: soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe Link: https://lore.kernel.org/r/20220608093132.1465703-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 2d2cb31bd36b758e20c6922a9793df9ce41e9bc6 Merge: 7c7ff68daa93d 680c0aee97690 Author: Arnd Bergmann Date: Tue Jun 14 12:19:57 2022 +0200 Merge tag 's32g2-fixes-5.19' of https://github.com/chesterlintw/linux-s32g into arm/fixes S32G2 fixes for 5.19 - MAINTAINERS: Add s32@nxp.com as a review group. - dts: Pass unit name to soc node to fix a W=1 build warning. * tag 's32g2-fixes-5.19' of https://github.com/chesterlintw/linux-s32g: MAINTAINERS: add a new reviewer for S32G arm64: s32g2: Pass unit name to soc node Link: https://lore.kernel.org/r/Yp9Y4nGrQ2kVKV6S@linux-8mug Signed-off-by: Arnd Bergmann commit 7c7ff68daa93d8c4cdea482da4f2429c0398fcde Author: Miaoqian Lin Date: Wed Jun 1 13:05:48 2022 +0400 ARM: Fix refcount leak in axxia_boot_secondary of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 1d22924e1c4e ("ARM: Add platform support for LSI AXM55xx SoC") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220601090548.47616-1-linmq006@gmail.com' Signed-off-by: Arnd Bergmann commit 168f912893407a5acb798a4a58613b5f1f98c717 Author: Christian Brauner Date: Mon Jun 13 13:15:17 2022 +0200 fs: account for group membership When calling setattr_prepare() to determine the validity of the attributes the ia_{g,u}id fields contain the value that will be written to inode->i_{g,u}id. This is exactly the same for idmapped and non-idmapped mounts and allows callers to pass in the values they want to see written to inode->i_{g,u}id. When group ownership is changed a caller whose fsuid owns the inode can change the group of the inode to any group they are a member of. When searching through the caller's groups we need to use the gid mapped according to the idmapped mount otherwise we will fail to change ownership for unprivileged users. Consider a caller running with fsuid and fsgid 1000 using an idmapped mount that maps id 65534 to 1000 and 65535 to 1001. Consequently, a file owned by 65534:65535 in the filesystem will be owned by 1000:1001 in the idmapped mount. The caller now requests the gid of the file to be changed to 1000 going through the idmapped mount. In the vfs we will immediately map the requested gid to the value that will need to be written to inode->i_gid and place it in attr->ia_gid. Since this idmapped mount maps 65534 to 1000 we place 65534 in attr->ia_gid. When we check whether the caller is allowed to change group ownership we first validate that their fsuid matches the inode's uid. The inode->i_uid is 65534 which is mapped to uid 1000 in the idmapped mount. Since the caller's fsuid is 1000 we pass the check. We now check whether the caller is allowed to change inode->i_gid to the requested gid by calling in_group_p(). This will compare the passed in gid to the caller's fsgid and search the caller's additional groups. Since we're dealing with an idmapped mount we need to pass in the gid mapped according to the idmapped mount. This is akin to checking whether a caller is privileged over the future group the inode is owned by. And that needs to take the idmapped mount into account. Note, all helpers are nops without idmapped mounts. New regression test sent to xfstests. Link: https://github.com/lxc/lxd/issues/10537 Link: https://lore.kernel.org/r/20220613111517.2186646-1-brauner@kernel.org Fixes: 2f221d6f7b88 ("attr: handle idmapped mounts") Cc: Seth Forshee Cc: Christoph Hellwig Cc: Aleksa Sarai Cc: Al Viro Cc: stable@vger.kernel.org # 5.15+ CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner (Microsoft) commit 89931cb463d861faf987dbbff9db986fe59293f7 Author: Alexandre Torgue Date: Mon Jun 13 09:19:20 2022 +0200 ARM: dts: stm32: move SCMI related nodes in a dedicated file for stm32mp15 Adding a "secure" version of STM32 boards (DK1/DK2/ED1/EV1), SCMI (clock/ reset) protocol and OP-TEE node have been added in SoC dtsi file (stm32mp151.dtsi). They have been added with a status disabled in order to keep our legacy unchanged. It is actually not enough to keep our legacy unchanged. First, just a reminder about our use case: TF-A (BL2) loads and starts OP-TEE, then loads and runs U-Boot. U-Boot code checks if an OP-TEE is running, if yes it searches in Kernel device tree if an OP-TEE node is present: -If the OP-TEE node is not present then U-Boot copies OP-TEE node and its reserved memory region from U-Boot device tree to the kernel device tree. -If the OP-TEE node is present then it does nothing (this OP-TEE node will be used by Linux). So U-Boot lets the kernel device tree unchanged thinking it is correct for an OP-TEE usage. It is the case for our legacy boards, the OP-TEE node is present (although disabled) but the reserved memory region is not declared. As no memory region has been reserved for OP-TEE, the end of DDR is seen by the kernel as free and then used for CMA. But as OP-TEE is running, this end of DDR is already used by OP-TEE. So as soon as kernel tries to access to the CMA region OP-TEE raises an error. To fix it, all OP-TEE node and SCMI is moved in a dedicated file. Fixes: 40b4157dbd8c ("ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15") Signed-off-by: Alexandre Torgue Link: https://lore.kernel.org/r/20220613071920.5463-1-alexandre.torgue@foss.st.com' Signed-off-by: Arnd Bergmann commit 002ec157477c727e238087c8cf3d02962d7bd64e Merge: 2916bf223379c 44dbdf3bb3f44 Author: Arnd Bergmann Date: Tue Jun 14 12:16:34 2022 +0200 Merge tag 'scmi-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI firmware driver fixes for v5.19 Bunch of fixes to address: 1. Issues reported on RK3568 EVB1 and BPI-R2 pro platforms using SCMI. More checks were added to validate the firmware response but that resulted in breaking above platforms, so the checks are relaxed when for cases where there is no potential memory corruption issues. 2. Possible data leak by reading more than required length from the firmware. Recent addition of support for v3.1 extended names used larger buffers in the kernel and used their size to read response from the firmware even for cases where shorter formats are used. While that is mostly harmless except when firmware sends malformed non-NULL terminated buffers. 3. Possible issues sending unsupported commands to the firmware. SENSOR_AXIS_NAME_GET added in v3.1 needs to be used only if the firmware supports it. While the firmware conformant to the spec must return not supported error for any unsupported features, it is always safer to avoid issuing commands that are known to be unsupported. 4. Incorrect error propagation in scmi_voltage_descriptors_get. Since the return value is not reset for each iteration of the loop, the error value in the previous iteration will be carried for the current one. Fix that by not saving the return values into local variable. 5. Some warnings reported by cppcheck * tag 'scmi-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported firmware: arm_scmi: Remove all the unused local variables firmware: arm_scmi: Relax base protocol sanity checks on the protocol list Link: https://lore.kernel.org/r/20220614100007.1029881-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 2916bf223379c7a61ef2b796e547c56894ad9695 Merge: b13baccc3850c 7c7eaeefb0ae2 Author: Arnd Bergmann Date: Tue Jun 14 12:15:43 2022 +0200 Merge tag 'imx-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.19: - Correct i.MX7 power domain for HSIC USB PHY node to fix an USB Host issue, that is all downstream events will be lost if USB host is runtime suspended. - Fix i.MX8M blk-ctrl LCDIF2 power domain to point to refer to the correct clock. - Correct i.MX6Q/DL PU regulator ramp delay to fix some peripherals power-up failure especially when the chip is at a low temperature. - Fix capacitive touch reset polarity for imx6qdl-colibri board. * tag 'imx-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: imx8m-blk-ctrl: fix display clock for LCDIF2 power domain ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity ARM: dts: imx6qdl: correct PU regulator ramp delay ARM: dts: imx7: Move hsic_phy power domain to HSIC PHY node Link: https://lore.kernel.org/r/20220614095515.GU254723@dragon Signed-off-by: Arnd Bergmann commit 0f9cd1ea10d307cad221d6693b648a8956e812b0 Author: Christian König Date: Mon Jun 13 09:37:03 2022 +0200 drm/ttm: fix bulk move handling v2 The resource must be on the LRU before ttm_lru_bulk_move_add() is called and we need to check if the BO is pinned or not before adding it. Additional to that we missed taking the LRU spinlock in ttm_bo_unpin(). Signed-off-by: Christian König Reviewed-by: Arunpravin Paneer Selvam Acked-by: Luben Tuikov Link: https://patchwork.freedesktop.org/patch/msgid/20220613080816.4965-1-christian.koenig@amd.com Fixes: fee2ede15542 ("drm/ttm: rework bulk move handling v5") commit 9cc8ea99bf7ae6f5a5a305bb14a6f1e3f18f5f54 Author: Jonathan Neuschäfer Date: Fri Jun 10 09:28:08 2022 +0200 docs: networking: phy: Fix a typo Write "to be operated" instead of "to be operate". Signed-off-by: Jonathan Neuschäfer Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220610072809.352962-1-j.neuschaefer@gmx.net Signed-off-by: Jakub Kicinski commit 884c65e4daf3eab8730b2bbd5abc5a2c0403b3f3 Author: Jean-Philippe Brucker Date: Thu Jun 9 17:14:59 2022 +0100 amd-xgbe: Use platform_irq_count() The AMD XGbE driver currently counts the number of interrupts assigned to the device by inspecting the pdev->resource array. Since commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") removed IRQs from this array, the driver now attempts to get all interrupts from 1 to -1U and gives up probing once it reaches an invalid interrupt index. Obtain the number of IRQs with platform_irq_count() instead. Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") Signed-off-by: Jean-Philippe Brucker Acked-by: Rob Herring Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20220609161457.69614-1-jean-philippe@linaro.org Signed-off-by: Jakub Kicinski commit 7c7eaeefb0ae226da9233d5db265652d900e1fcb Author: Alexander Stein Date: Tue May 24 09:39:34 2022 +0200 soc: imx: imx8m-blk-ctrl: fix display clock for LCDIF2 power domain LCDIF2 has its own display clock, use this one. Fixes: 07614fed00e9 ("soc: imx: imx8m-blk-ctrl: Add i.MX8MP media blk-ctrl") Signed-off-by: Alexander Stein Reviewed-by: Paul Elder Tested-by: Martyn Welch Signed-off-by: Shawn Guo commit b426310e509a1fde077fbe684ecc4a4a694d2bab Author: Max Krummenacher Date: Fri May 13 12:26:12 2022 +0200 ARM: dts: imx6qdl-colibri: Fix capacitive touch reset polarity The commit feedaacdadfc ("Input: atmel_mxt_ts - fix up inverted RESET handler") requires the reset GPIO to have GPIO_ACTIVE_LOW. Fixes: 1524b27c94a6 ("ARM: dts: imx6dl-colibri: Move common nodes to SoM dtsi") Reviewed-by: Fabio Estevam Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 93a8ba2a619816d631bd69e9ce2172b4d7a481b8 Author: Lucas Stach Date: Wed May 11 18:08:23 2022 +0200 ARM: dts: imx6qdl: correct PU regulator ramp delay Contrary to what was believed at the time, the ramp delay of 150us is not plenty for the PU LDO with the default step time of 512 pulses of the 24MHz clock. Measurements have shown that after enabling the LDO the voltage on VDDPU_CAP jumps to ~750mV in the first step and after that the regulator executes the normal ramp up as defined by the step size control. This means it takes the regulator between 360us and 370us to ramp up to the nominal 1.15V voltage for this power domain. With the old setting of the ramp delay the power up of the PU GPC domain would happen in the middle of the regulator ramp with the voltage being at around 900mV. Apparently this was enough for most units to properly power up the peripherals in the domain and execute the reset. Some units however, fail to power up properly, especially when the chip is at a low temperature. In that case any access to the GPU registers would yield an incorrect result with no way to recover from this situation. Change the ramp delay to 380us to cover the measured ramp up time with a bit of additional slack. Fixes: 40130d327f72 ("ARM: dts: imx6qdl: Allow disabling the PU regulator, add a enable ramp delay") Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit f6eed15f3ea76596ccc689331e1cc850b999133b Author: Sergey Gorenko Date: Mon Jun 13 15:38:54 2022 +0300 scsi: iscsi: Exclude zero from the endpoint ID range The kernel returns an endpoint ID as r.ep_connect_ret.handle in the iscsi_uevent. The iscsid validates a received endpoint ID and treats zero as an error. The commit referenced in the fixes line changed the endpoint ID range, and zero is always assigned to the first endpoint ID. So, the first attempt to create a new iSER connection always fails. Link: https://lore.kernel.org/r/20220613123854.55073-1-sergeygo@nvidia.com Fixes: 3c6ae371b8a1 ("scsi: iscsi: Release endpoint ID when its freed") Reviewed-by: Max Gurtovoy Reviewed-by: Mike Christie Reviewed-by: Lee Duncan Signed-off-by: Sergey Gorenko Signed-off-by: Martin K. Petersen commit 49e477610087a02c3604061b8f3ee3a25a493987 Author: Rob Clark Date: Wed Jun 8 09:13:34 2022 -0700 drm/msm: Switch ordering of runpm put vs devfreq_idle In msm_devfreq_suspend() we cancel idle_work synchronously so that it doesn't run after we power of the hw or in the resume path. But this means that we want to ensure that idle_work is not scheduled *after* we no longer hold a runpm ref. So switch the ordering of pm_runtime_put() vs msm_devfreq_idle(). v2. Only move the runpm _put_autosuspend, and not the _mark_last_busy() Fixes: 9bc95570175a ("drm/msm: Devfreq tuning") Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210927152928.831245-1-robdclark@gmail.com Reviewed-by: Akhil P Oommen Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220608161334.2140611-1-robdclark@gmail.com Signed-off-by: Rob Clark commit 43047e082b90ead395c44b0e8497bc853bd13845 Author: rasheed.hsueh Date: Fri Jun 10 14:27:34 2022 +0800 nvme-pci: disable write zeros support on UMIC and Samsung SSDs Like commit 5611ec2b9814 ("nvme-pci: prevent SK hynix PC400 from using Write Zeroes command"), UMIS and Samsung has the same issue: [ 6305.633887] blk_update_request: operation not supported error, dev nvme0n1, sector 340812032 op 0x9:(WRITE_ZEROES) flags 0x0 phys_seg 0 prio class 0 So also disable Write Zeroes command on UMIS and Samsung. Signed-off-by: rasheed.hsueh Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 6b961bce50e489186232cef51036ddb8d672bc3b Author: Ning Wang Date: Sun Jun 5 20:36:48 2022 +0000 nvme-pci: avoid the deepest sleep state on ZHITAI TiPro7000 SSDs When ZHITAI TiPro7000 SSDs entered deepest power state(ps4) it has the same APST sleep problem as Kingston A2000. by chance the system crashes and displays the same dmesg info: https://bugzilla.kernel.org/show_bug.cgi?id=195039#c65 As the Archlinux wiki suggest (enlat + exlat) < 25000 is fine and my testing shows no system crashes ever since. Therefore disabling the deepest power state will fix the APST sleep issue. https://wiki.archlinux.org/title/Solid_state_drive/NVMe This is the APST data from 'nvme id-ctrl /dev/nvme1' NVME Identify Controller: vid : 0x1e49 ssvid : 0x1e49 sn : [...] mn : ZHITAI TiPro7000 1TB fr : ZTA32F3Y [...] ps 0 : mp:3.50W operational enlat:5 exlat:5 rrt:0 rrl:0 rwt:0 rwl:0 idle_power:- active_power:- ps 1 : mp:3.30W operational enlat:50 exlat:100 rrt:1 rrl:1 rwt:1 rwl:1 idle_power:- active_power:- ps 2 : mp:2.80W operational enlat:50 exlat:200 rrt:2 rrl:2 rwt:2 rwl:2 idle_power:- active_power:- ps 3 : mp:0.1500W non-operational enlat:500 exlat:5000 rrt:3 rrl:3 rwt:3 rwl:3 idle_power:- active_power:- ps 4 : mp:0.0200W non-operational enlat:2000 exlat:60000 rrt:4 rrl:4 rwt:4 rwl:4 idle_power:- active_power:- Signed-off-by: Ning Wang Signed-off-by: Christoph Hellwig commit c4f01a776b28378f4f61b53f8cb0e358f4fa3721 Author: Keith Busch Date: Mon Jun 13 07:45:49 2022 -0700 nvme-pci: sk hynix p31 has bogus namespace ids Add the quirk. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216049 Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit c98a879312caf775c9768faed25ce1c013b4df04 Author: Keith Busch Date: Mon Jun 13 07:45:48 2022 -0700 nvme-pci: smi has bogus namespace ids Add the quirk. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216096 Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 2cf7a77ed5f8903606f4f7833d02d67b08650442 Author: Keith Busch Date: Mon Jun 13 07:45:47 2022 -0700 nvme-pci: phison e12 has bogus namespace ids Add the quirk. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216049 Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 3765fad508964f433ac111c127d6bedd19bdfa04 Author: Stefan Reiter Date: Mon Jun 6 13:01:29 2022 +0000 nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S50 ADATA XPG GAMMIX S50 drives report bogus eui64 values that appear to be the same across drives in one system. Quirk them out so they are not marked as "non globally unique" duplicates. Signed-off-by: Stefan Reiter Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 4641a8e6e145f595059e695f0f8dbbe608134086 Author: Keith Busch Date: Mon Jun 6 09:53:17 2022 -0700 nvme-pci: add trouble shooting steps for timeouts Many users have encountered IO timeouts with a CSTS value of 0xffffffff, which indicates a failure to read the register. While there are various potential causes for this observation, faulty NVMe APST has been the culprit quite frequently. Add the recommended troubleshooting steps in the error output when this condition occurs. Signed-off-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 2f0dad1719cbbd690e916a42d937b7605ee63964 Author: Keith Busch Date: Tue Jun 7 08:30:29 2022 -0700 nvme: add bug report info for global duplicate id The recent global id check is finding poorly implemented devices in the wild. Include relavant device information in the output to help quicken an appropriate quirk patch. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 1fc766b5c08417248e0008bca14c3572ac0f1c26 Author: Thomas Weißschuh Date: Tue Jun 7 17:55:55 2022 +0200 nvme: add device name to warning in uuid_show() This provides more context to users. Old message: [ 00.000000] No UUID available providing old NGUID New message: [ 00.000000] block nvme0n1: No UUID available providing old NGUID Fixes: d934f9848a77 ("nvme: provide UUID value to userspace") Signed-off-by: Thomas Weißschuh Signed-off-by: Christoph Hellwig commit 1dfbe9fcda4afc957f0e371e207ae3cb7e8f3b0e Author: Matthew Wilcox (Oracle) Date: Sun Jun 12 22:32:27 2022 +0100 usercopy: Make usercopy resilient against ridiculously large copies If 'n' is so large that it's negative, we might wrap around and mistakenly think that the copy is OK when it's not. Such a copy would probably crash, but just doing the arithmetic in a more simple way lets us detect and refuse this case. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Uladzislau Rezki (Sony) Tested-by: Zorro Lang Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220612213227.3881769-4-willy@infradead.org commit 35fb9ae4aa2e838b234323e6f7cf6336ff019e5a Author: Matthew Wilcox (Oracle) Date: Sun Jun 12 22:32:26 2022 +0100 usercopy: Cast pointer to an integer once Get rid of a lot of annoying casts by setting 'addr' once at the top of the function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Uladzislau Rezki (Sony) Tested-by: Zorro Lang Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220612213227.3881769-3-willy@infradead.org commit 993d0b287e2ef7bee2e8b13b0ce4d2b5066f278e Author: Matthew Wilcox (Oracle) Date: Sun Jun 12 22:32:25 2022 +0100 usercopy: Handle vm_map_ram() areas vmalloc does not allocate a vm_struct for vm_map_ram() areas. That causes us to deny usercopies from those areas. This affects XFS which uses vm_map_ram() for its directories. Fix this by calling find_vmap_area() instead of find_vm_area(). Fixes: 0aef499f3172 ("mm/usercopy: Detect vmalloc overruns") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Uladzislau Rezki (Sony) Tested-by: Zorro Lang Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220612213227.3881769-2-willy@infradead.org commit 57cd6d157eb479f0a8e820fd36b7240845c8a937 Author: Sami Tolvanen Date: Tue May 31 10:59:10 2022 -0700 cfi: Fix __cfi_slowpath_diag RCU usage with cpuidle RCU_NONIDLE usage during __cfi_slowpath_diag can result in an invalid RCU state in the cpuidle code path: WARNING: CPU: 1 PID: 0 at kernel/rcu/tree.c:613 rcu_eqs_enter+0xe4/0x138 ... Call trace: rcu_eqs_enter+0xe4/0x138 rcu_idle_enter+0xa8/0x100 cpuidle_enter_state+0x154/0x3a8 cpuidle_enter+0x3c/0x58 do_idle.llvm.6590768638138871020+0x1f4/0x2ec cpu_startup_entry+0x28/0x2c secondary_start_kernel+0x1b8/0x220 __secondary_switched+0x94/0x98 Instead, call rcu_irq_enter/exit to wake up RCU only when needed and disable interrupts for the entire CFI shadow/module check when we do. Signed-off-by: Sami Tolvanen Link: https://lore.kernel.org/r/20220531175910.890307-1-samitolvanen@google.com Fixes: cf68fffb66d6 ("add support for Clang CFI") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit a01a40e334996b05df92d5a9d594cb5937dd3cc0 Author: Sander Vanheule Date: Sun Jun 12 13:23:09 2022 +0200 gpio: realtek-otto: Make the irqchip immutable Since commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") a warning is issued for the realtek-otto driver: gpio gpiochip0: (18003500.gpio): not an immutable chip, please consider fixing it! Make the driver's irqchip immutable to fix this. Signed-off-by: Sander Vanheule Signed-off-by: Bartosz Golaszewski commit 30756cc1645080445c957192bc8a7af3b193d617 Author: Tom Schwindl Date: Sun Jun 12 19:01:09 2022 +0000 docs: driver-api: gpio: Fix filename mismatch The filenames were changed a while ago, but board.rst, consumer.rst and intro.rst still refer to the old names. Fix those references to match the Actual names and avoid possible confusion. Signed-off-by: Tom Schwindl Signed-off-by: Bartosz Golaszewski commit 97a4087a363888b818225d890c912a52a24b9f73 Author: Lukas Bulwahn Date: Mon Jun 13 13:11:34 2022 +0200 MAINTAINERS: add include/dt-bindings/gpio to GPIO SUBSYSTEM Maintainers of the directory Documentation/devicetree/bindings/gpio are also the maintainers of the corresponding directory include/dt-bindings/gpio. Add the file entry for include/dt-bindings/gpio to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn Signed-off-by: Bartosz Golaszewski commit fe6900bd8156467365bd5b976df64928fdebfeb0 Author: Kailang Yang Date: Mon Jun 13 14:57:19 2022 +0800 ALSA: hda/realtek - ALC897 headset MIC no sound There is not have Headset Mic verb table in BIOS default. So, it will have recording issue from headset MIC. Add the verb table value without jack detect. It will turn on Headset Mic. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/719133a27d8844a890002cb817001dfa@realtek.com Signed-off-by: Takashi Iwai commit eeaa345e128515135ccb864c04482180c08e3259 Author: Jann Horn Date: Wed Jun 8 20:22:05 2022 +0200 mm/slub: add missing TID updates on slab deactivation The fastpath in slab_alloc_node() assumes that c->slab is stable as long as the TID stays the same. However, two places in __slab_alloc() currently don't update the TID when deactivating the CPU slab. If multiple operations race the right way, this could lead to an object getting lost; or, in an even more unlikely situation, it could even lead to an object being freed onto the wrong slab's freelist, messing up the `inuse` counter and eventually causing a page to be freed to the page allocator while it still contains slab objects. (I haven't actually tested these cases though, this is just based on looking at the code. Writing testcases for this stuff seems like it'd be a pain...) The race leading to state inconsistency is (all operations on the same CPU and kmem_cache): - task A: begin do_slab_free(): - read TID - read pcpu freelist (==NULL) - check `slab == c->slab` (true) - [PREEMPT A->B] - task B: begin slab_alloc_node(): - fastpath fails (`c->freelist` is NULL) - enter __slab_alloc() - slub_get_cpu_ptr() (disables preemption) - enter ___slab_alloc() - take local_lock_irqsave() - read c->freelist as NULL - get_freelist() returns NULL - write `c->slab = NULL` - drop local_unlock_irqrestore() - goto new_slab - slub_percpu_partial() is NULL - get_partial() returns NULL - slub_put_cpu_ptr() (enables preemption) - [PREEMPT B->A] - task A: finish do_slab_free(): - this_cpu_cmpxchg_double() succeeds() - [CORRUPT STATE: c->slab==NULL, c->freelist!=NULL] From there, the object on c->freelist will get lost if task B is allowed to continue from here: It will proceed to the retry_load_slab label, set c->slab, then jump to load_freelist, which clobbers c->freelist. But if we instead continue as follows, we get worse corruption: - task A: run __slab_free() on object from other struct slab: - CPU_PARTIAL_FREE case (slab was on no list, is now on pcpu partial) - task A: run slab_alloc_node() with NUMA node constraint: - fastpath fails (c->slab is NULL) - call __slab_alloc() - slub_get_cpu_ptr() (disables preemption) - enter ___slab_alloc() - c->slab is NULL: goto new_slab - slub_percpu_partial() is non-NULL - set c->slab to slub_percpu_partial(c) - [CORRUPT STATE: c->slab points to slab-1, c->freelist has objects from slab-2] - goto redo - node_match() fails - goto deactivate_slab - existing c->freelist is passed into deactivate_slab() - inuse count of slab-1 is decremented to account for object from slab-2 At this point, the inuse count of slab-1 is 1 lower than it should be. This means that if we free all allocated objects in slab-1 except for one, SLUB will think that slab-1 is completely unused, and may free its page, leading to use-after-free. Fixes: c17dda40a6a4e ("slub: Separate out kmem_cache_cpu processing from deactivate_slab") Fixes: 03e404af26dc2 ("slub: fast release on full slab") Cc: stable@vger.kernel.org Signed-off-by: Jann Horn Acked-by: Christoph Lameter Acked-by: David Rientjes Reviewed-by: Muchun Song Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220608182205.2945720-1-jannh@google.com commit c4cf6785599b8126ea29160800fec5f1db0a6a30 Author: Sebastian Andrzej Siewior Date: Tue Jun 7 17:20:10 2022 +0200 mm/slub: Move the stackdepot related allocation out of IRQ-off section. The set_track() invocation in free_debug_processing() is invoked with acquired slab_lock(). The lock disables interrupts on PREEMPT_RT and this forbids to allocate memory which is done in stack_depot_save(). Split set_track() into two parts: set_track_prepare() which allocate memory and set_track_update() which only performs the assignment of the trace data structure. Use set_track_prepare() before disabling interrupts. [ vbabka@suse.cz: make set_track() call set_track_update() instead of open-coded assignments ] Fixes: 5cf909c553e9e ("mm/slub: use stackdepot to save stack trace in objects") Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/Yp9sqoUi4fVa5ExF@linutronix.de commit 27071b5cbca59d8e8f8750c199a6cbf8c9799963 Author: Serge Semin Date: Fri Jun 10 10:42:33 2022 +0300 i2c: designware: Use standard optional ref clock implementation Even though the DW I2C controller reference clock source is requested by the method devm_clk_get() with non-optional clock requirement the way the clock handler is used afterwards has a pure optional clock semantic (though in some circumstances we can get a warning about the clock missing printed in the system console). There is no point in reimplementing that functionality seeing the kernel clock framework already supports the optional interface from scratch. Thus let's convert the platform driver to using it. Note by providing this commit we get to fix two problems. The first one was introduced in commit c62ebb3d5f0d ("i2c: designware: Add support for an interface clock"). It causes not having the interface clock (pclk) enabled/disabled in case if the reference clock isn't provided. The second problem was first introduced in commit b33af11de236 ("i2c: designware: Do not require clock when SSCN and FFCN are provided"). Since that modification the deferred probe procedure has been unsupported in case if the interface clock isn't ready. Fixes: c62ebb3d5f0d ("i2c: designware: Add support for an interface clock") Fixes: b33af11de236 ("i2c: designware: Do not require clock when SSCN and FFCN are provided") Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 5edc99f0c5b753eb34defad1cdb164824056a487 Author: Wolfram Sang Date: Mon Jun 13 16:45:19 2022 +0200 MAINTAINERS: core DT include belongs to core Signed-off-by: Wolfram Sang commit 6e21408774da49b34fbe258d161e6329a43fcbe8 Author: Lukas Bulwahn Date: Mon Jun 13 13:46:14 2022 +0200 MAINTAINERS: add include/dt-bindings/i2c to I2C SUBSYSTEM HOST DRIVERS Maintainers of the directory Documentation/devicetree/bindings/i2c are also the maintainers of the corresponding directory include/dt-bindings/i2c. Add the file entry for include/dt-bindings/i2c to the appropriate section in MAINTAINERS. Signed-off-by: Lukas Bulwahn Signed-off-by: Wolfram Sang commit feaf625e7055cdfd2c3d82cf60fb3892e27ea7bb Merge: f9437ac0f851c fc9375e3f763b Author: Jens Axboe Date: Mon Jun 13 06:52:52 2022 -0600 Merge branch 'io_uring/io_uring-5.19' of https://github.com/isilence/linux into io_uring-5.19 Pull io_uring fixes from Pavel. * 'io_uring/io_uring-5.19' of https://github.com/isilence/linux: io_uring: fix double unlock for pbuf select io_uring: kbuf: fix bug of not consuming ring buffer in partial io case io_uring: openclose: fix bug of closing wrong fixed file io_uring: fix not locked access to fixed buf table io_uring: fix races with buffer table unregister io_uring: fix races with file table unregister commit 619c010a65391d06bc96e79fa0e7725790e5d1a9 Author: Suman Ghosh Date: Sun Jun 12 23:15:36 2022 +0530 octeontx2-vf: Add support for adaptive interrupt coalescing Fixes: 6e144b47f560 (octeontx2-pf: Add support for adaptive interrupt coalescing) Added support for VF interfaces as well. Signed-off-by: Suman Ghosh Signed-off-by: David S. Miller commit 5f7b84151a89f6f3a8d1db4db2bc4f5b270d66ee Author: David S. Miller Date: Mon Jun 13 12:49:21 2022 +0100 xilinx: Fix build on x86. CONFIG_64BIT is not sufficient for checking for availability of iowrite64() and friends. Also, the out_addr helpers need to be inline. Fixes: b690f8df6497 ("net: axienet: Use iowrite64 to write all 64b descriptor pointers") Signed-off-by: David S. Miller commit a7ffce959cca257ea5a6d3ee9bfa2d7fb12bb9fa Merge: a5b00f5b78b7a b690f8df6497b Author: David S. Miller Date: Mon Jun 13 12:36:56 2022 +0100 Merge branch 'axienet-fixes' Andy Chiu says: ==================== net: axienet: fix DMA Tx error We ran into multiple DMA TX errors while writing files over a network block device running on top of a DMA-connected AXI Ethernet device on 64-bit RISC-V machines. The errors indicated that the DMA had fetched a null descriptor and we found that the reason for this is that AXI DMA had unexpectedly processed a partially updated tail descriptor pointer. To fix it, we suggest that the driver should use one 64-bit write instead of two 32-bit writes to perform such update if possible. For those archectures where double-word load/stores are unavailable, e.g. 32-bit archectures, force a driver probe failure if the driver finds 64-bit capability on DMA. ==================== Signed-off-by: David S. Miller commit b690f8df6497b654c2c871871e0a598e9750c0eb Author: Andy Chiu Date: Mon Jun 13 11:42:02 2022 +0800 net: axienet: Use iowrite64 to write all 64b descriptor pointers According to commit f735c40ed93c ("net: axienet: Autodetect 64-bit DMA capability") and AXI-DMA spec (pg021), on 64-bit capable dma, only writing MSB part of tail descriptor pointer causes DMA engine to start fetching descriptors. However, we found that it is true only if dma is in idle state. In other words, dma would use a tailp even if it only has LSB updated, when the dma is running. The non-atomicity of this behavior could be problematic if enough delay were introduced in between the 2 writes. For example, if an interrupt comes right after the LSB write and the cpu spends long enough time in the handler for the dma to get back into idle state by completing descriptors, then the seconcd write to MSB would treat dma to start fetching descriptors again. Since the descriptor next to the one pointed by current tail pointer is not filled by the kernel yet, fetching a null descriptor here causes a dma internal error and halt the dma engine down. We suggest that the dma engine should start process a 64-bit MMIO write to the descriptor pointer only if ONE 32-bit part of it is written on all states. Or we should restrict the use of 64-bit addressable dma on 32-bit platforms, since those devices have no instruction to guarantee the write to LSB and MSB part of tail pointer occurs atomically to the dma. initial condition: curp = x-3; tailp = x-2; LSB = x; MSB = 0; cpu: |dma: iowrite32(LSB, tailp) | completes #(x-3) desc, curp = x-3 ... | tailp updated => irq | completes #(x-2) desc, curp = x-2 ... | completes #(x-1) desc, curp = x-1 ... | ... ... | completes #x desc, curp = tailp = x <= irqreturn | reaches tailp == curp = x, idle iowrite32(MSB, tailp + 4) | ... | tailp updated, starts fetching... | fetches #(x + 1) desc, sees cntrl = 0 | post Tx error, halt Signed-off-by: Andy Chiu Reported-by: Max Hsu Reviewed-by: Greentime Hu Signed-off-by: David S. Miller commit 00be43a74ca262267ceb96c0c5e3f51d3a56342e Author: Andy Chiu Date: Mon Jun 13 11:42:01 2022 +0800 net: axienet: make the 64b addresable DMA depends on 64b archectures Currently it is not safe to config the IP as 64-bit addressable on 32-bit archectures, which cannot perform a double-word store on its descriptor pointers. The pointer is 64-bit wide if the IP is configured as 64-bit, and the device would process the partially updated pointer on some states if the pointer was updated via two store-words. To prevent such condition, we force a probe fail if we discover that the IP has 64-bit capability but it is not running on a 64-Bit kernel. This is a series of patch (1/2). The next patch must be applied in order to make 64b DMA safe on 64b archectures. Signed-off-by: Andy Chiu Reported-by: Max Hsu Reviewed-by: Greentime Hu Signed-off-by: David S. Miller commit f9437ac0f851cea2374d53594f52fbbefdd977bd Author: Dylan Yudaken Date: Mon Jun 13 03:11:57 2022 -0700 io_uring: limit size of provided buffer ring The type of head and tail do not allow more than 2^15 entries in a provided buffer ring, so do not allow this. At 2^16 while each entry can be indexed, there is no way to disambiguate full vs empty. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220613101157.3687-4-dylany@fb.com Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit c6e9fa5c0ab811f4bec36a96337f4b1bb77d142c Author: Dylan Yudaken Date: Mon Jun 13 03:11:56 2022 -0700 io_uring: fix types in provided buffer ring The type of head needs to match that of tail in order for rollover and comparisons to work correctly. Without this change the comparison of tail to head might incorrectly allow io_uring to use a buffer that userspace had not given it. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220613101157.3687-3-dylany@fb.com Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 97da4a537924d87e2261773f3ac9365abb191fc9 Author: Dylan Yudaken Date: Mon Jun 13 03:11:55 2022 -0700 io_uring: fix index calculation When indexing into a provided buffer ring, do not subtract 1 from the index. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220613101157.3687-2-dylany@fb.com Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit a5b00f5b78b7adb9f6f37381da2a54db6d37cd11 Merge: 6f0e1efc880ae 12a3670887725 Author: David S. Miller Date: Mon Jun 13 11:56:01 2022 +0100 Merge branch 'hns3-fixres' Guangbin Huang says: ==================== net: hns3: add some fixes for -net This series adds some fixes for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 12a3670887725df364cc3e030cf3bede6f13b364 Author: Guangbin Huang Date: Sat Jun 11 20:25:29 2022 +0800 net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization Currently in driver initialization process, driver will set shapping parameters of tm port to default speed read from firmware. However, the speed of SFP module may not be default speed, so shapping parameters of tm port may be incorrect. To fix this problem, driver sets new shapping parameters for tm port after getting exact speed of SFP module in this case. Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 71b215f36dca1a3d5d1c576b2099e6d7ea03047e Author: Jie Wang Date: Sat Jun 11 20:25:28 2022 +0800 net: hns3: fix PF rss size initialization bug Currently hns3 driver misuses the VF rss size to initialize the PF rss size in hclge_tm_vport_tc_info_update. So this patch fix it by checking the vport id before initialization. Fixes: 7347255ea389 ("net: hns3: refactor PF rss get APIs with new common rss get APIs") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e93530ae0e5d8fcf2d908933d206e0c93bc3c09b Author: Guangbin Huang Date: Sat Jun 11 20:25:27 2022 +0800 net: hns3: restore tm priority/qset to default settings when tc disabled Currently, settings parameters of schedule mode, dwrr, shaper of tm priority or qset of one tc are only be set when tc is enabled, they are not restored to the default settings when tc is disabled. It confuses users when they cat tm_priority or tm_qset files of debugfs. So this patch fixes it. Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit cfd80687a5388e731b3db65ad6a557ede9b45905 Author: Jie Wang Date: Sat Jun 11 20:25:26 2022 +0800 net: hns3: modify the ring param print info Currently tx push is also a ring param. So the original ring param print info in hns3_is_ringparam_changed should be adjusted. Fixes: 07fdc163ac88 ("net: hns3: refactor hns3_set_ringparam()") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 283847e3ef6dbf79bf67083b5ce7b8033e8b6f34 Author: Jian Shen Date: Sat Jun 11 20:25:25 2022 +0800 net: hns3: don't push link state to VF if unalive It's unnecessary to push link state to unalive VF, and the VF will query link state from PF when it being start works. Fixes: 18b6e31f8bf4 ("net: hns3: PF add support for pushing link status to VFs") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 9eda7d8bcbdb6909f202edeedff51948f1cad1e5 Author: Guangbin Huang Date: Sat Jun 11 20:25:24 2022 +0800 net: hns3: set port base vlan tbl_sta to false before removing old vlan When modify port base vlan, the port base vlan tbl_sta needs to set to false before removing old vlan, to indicate this operation is not finish. Fixes: c0f46de30c96 ("net: hns3: fix port base vlan add fail when concurrent with reset") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2636e008112465ca54559ac4898da5a2515e118a Author: Jani Nikula Date: Wed May 11 12:46:19 2022 +0300 drm/i915/uc: remove accidental static from a local variable The arrays are static const, but the pointer shouldn't be static. Fixes: 3d832f370d16 ("drm/i915/uc: Allow platforms to have GuC but not HuC") Cc: John Harrison Cc: Lucas De Marchi Cc: Daniele Ceraolo Spurio Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220511094619.27889-1-jani.nikula@intel.com (cherry picked from commit 5821a0bbb4c39960975d29d6b58ae290088db0ed) commit fc9375e3f763b06c3c90c5f5b2b84d3e07c1f4c2 Author: Pavel Begunkov Date: Sun Jun 12 14:31:38 2022 +0100 io_uring: fix double unlock for pbuf select io_buffer_select(), which is the only caller of io_ring_buffer_select(), fully handles locking, mutex unlock in io_ring_buffer_select() will lead to double unlock. Fixes: c7fb19428d67d ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Pavel Begunkov commit 42db0c00e275877eb92480beaa16b33507dc3bda Author: Hao Xu Date: Sat Jun 11 20:29:52 2022 +0800 io_uring: kbuf: fix bug of not consuming ring buffer in partial io case When we use ring-mapped provided buffer, we should consume it before arm poll if partial io has been done. Otherwise the buffer may be used by other requests and thus we lost the data. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Hao Xu [pavel: 5.19 rebase] Signed-off-by: Pavel Begunkov commit e71d7c56dd69f720169c1675f87a1d22d8167767 Author: Hao Xu Date: Sat Jun 11 20:22:20 2022 +0800 io_uring: openclose: fix bug of closing wrong fixed file Don't update ret until fixed file is closed, otherwise the file slot becomes the error code. Fixes: a7c41b4687f5 ("io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots") Signed-off-by: Hao Xu [pavel: 5.19 rebase] Signed-off-by: Pavel Begunkov commit 842d9346b2fdda4d2fb8ccb5b87faef1ac01ab51 Author: Nirmoy Das Date: Wed May 25 11:59:55 2022 +0200 drm/i915: Individualize fences before adding to dma_resv obj _i915_vma_move_to_active() can receive > 1 fences for multiple batch buffers submission. Because dma_resv_add_fence() can only accept one fence at a time, change _i915_vma_move_to_active() to be aware of multiple fences so that it can add individual fences to the dma resv object. v6: fix multi-line comment. v5: remove double fence reservation for batch VMAs. v4: Reserve fences for composite_fence on multi-batch contexts and also reserve fence slots to composite_fence for each VMAs. v3: dma_resv_reserve_fences is not cumulative so pass num_fences. v2: make sure to reserve enough fence slots before adding. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5614 Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf") Cc: # v5.16+ Signed-off-by: Nirmoy Das Reviewed-by: Matthew Auld Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220525095955.15371-1-nirmoy.das@intel.com (cherry picked from commit 420a07b841d03f6a436d8c06571c69aa5c783897) Signed-off-by: Jani Nikula commit 6e3f3c239ee547c5b55a85f467c92a6ba7eee83a Author: Ashutosh Dixit Date: Wed May 25 06:19:20 2022 -0700 drm/i915/gt: Fix memory leaks in per-gt sysfs All kmalloc'd kobjects need a kobject_put() to free memory. For example in previous code, kobj_gt_release() never gets called. The requirement of kobject_put() now results in a slightly different code organization. v2: s/gtn/gt/ (Andi) Fixes: b770bcfae9ad ("drm/i915/gt: create per-tile sysfs interface") Signed-off-by: Ashutosh Dixit Reviewed-by: Andi Shyti Acked-by: Andrzej Hajda Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/a6f6686517c85fba61a0c45097f5bb4fe7e257fb.1653484574.git.ashutosh.dixit@intel.com (cherry picked from commit 69d6bf5c3754ffc491896632438417d1cedc2c68) Signed-off-by: Jani Nikula commit c9b576d0c7bf55aeae1a736da7974fa202c4394d Author: Alan Previn Date: Thu Mar 10 16:43:11 2022 -0800 drm/i915/reset: Fix error_state_read ptr + offset use Fix our pointer offset usage in error_state_read when there is no i915_gpu_coredump but buf offset is non-zero. This fixes a kernel page fault can happen when multiple tests are running concurrently in a loop and one is producing engine resets and consuming the i915 error_state dump while the other is forcing full GT resets. (takes a while to trigger). The dmesg call trace: [ 5590.803000] BUG: unable to handle page fault for address: ffffffffa0b0e000 [ 5590.803009] #PF: supervisor read access in kernel mode [ 5590.803013] #PF: error_code(0x0000) - not-present page [ 5590.803016] PGD 5814067 P4D 5814067 PUD 5815063 PMD 109de4067 PTE 0 [ 5590.803022] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 5590.803026] CPU: 5 PID: 13656 Comm: i915_hangman Tainted: G U 5.17.0-rc5-ups69-guc-err-capt-rev6+ #136 [ 5590.803033] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-M LP4x RVP, BIOS ADLPFWI1.R00. 3031.A02.2201171222 01/17/2022 [ 5590.803039] RIP: 0010:memcpy_erms+0x6/0x10 [ 5590.803045] Code: fe ff ff cc eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 a4 c3 0f 1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe [ 5590.803054] RSP: 0018:ffffc90003a8fdf0 EFLAGS: 00010282 [ 5590.803057] RAX: ffff888107ee9000 RBX: ffff888108cb1a00 RCX: 0000000000000f8f [ 5590.803061] RDX: 0000000000001000 RSI: ffffffffa0b0e000 RDI: ffff888107ee9071 [ 5590.803065] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 5590.803069] R10: 0000000000000001 R11: 0000000000000002 R12: 0000000000000019 [ 5590.803073] R13: 0000000000174fff R14: 0000000000001000 R15: ffff888107ee9000 [ 5590.803077] FS: 00007f62a99bee80(0000) GS:ffff88849f880000(0000) knlGS:0000000000000000 [ 5590.803082] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5590.803085] CR2: ffffffffa0b0e000 CR3: 000000010a1a8004 CR4: 0000000000770ee0 [ 5590.803089] PKRU: 55555554 [ 5590.803091] Call Trace: [ 5590.803093] [ 5590.803096] error_state_read+0xa1/0xd0 [i915] [ 5590.803175] kernfs_fop_read_iter+0xb2/0x1b0 [ 5590.803180] new_sync_read+0x116/0x1a0 [ 5590.803185] vfs_read+0x114/0x1b0 [ 5590.803189] ksys_read+0x63/0xe0 [ 5590.803193] do_syscall_64+0x38/0xc0 [ 5590.803197] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 5590.803201] RIP: 0033:0x7f62aaea5912 [ 5590.803204] Code: c0 e9 b2 fe ff ff 50 48 8d 3d 5a b9 0c 00 e8 05 19 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 24 [ 5590.803213] RSP: 002b:00007fff5b659ae8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 5590.803218] RAX: ffffffffffffffda RBX: 0000000000100000 RCX: 00007f62aaea5912 [ 5590.803221] RDX: 000000000008b000 RSI: 00007f62a8c4000f RDI: 0000000000000006 [ 5590.803225] RBP: 00007f62a8bcb00f R08: 0000000000200010 R09: 0000000000101000 [ 5590.803229] R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000006 [ 5590.803233] R13: 0000000000075000 R14: 00007f62a8acb010 R15: 0000000000200000 [ 5590.803238] [ 5590.803240] Modules linked in: i915 ttm drm_buddy drm_dp_helper drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops prime_numbers nfnetlink br_netfilter overlay mei_pxp mei_hdcp x86_pkg_temp_thermal coretemp kvm_intel snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core snd_pcm mei_me mei fuse ip_tables x_tables crct10dif_pclmul e1000e crc32_pclmul ptp i2c_i801 ghash_clmulni_intel i2c_smbus pps_core [last unloa ded: ttm] [ 5590.803277] CR2: ffffffffa0b0e000 [ 5590.803280] ---[ end trace 0000000000000000 ]--- Fixes: 0e39037b3165 ("drm/i915: Cache the error string") Signed-off-by: Alan Previn Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220311004311.514198-2-alan.previn.teres.alexis@intel.com (cherry picked from commit 3304033a1e69cd81a2044b4422f0d7e593afb4e6) Signed-off-by: Jani Nikula commit 05b538c1765f8d14a71ccf5f85258dcbeaf189f7 Author: Pavel Begunkov Date: Thu Jun 9 08:34:35 2022 +0100 io_uring: fix not locked access to fixed buf table We can look inside the fixed buffer table only while holding ->uring_lock, however in some cases we don't do the right async prep for IORING_OP_{WRITE,READ}_FIXED ending up with NULL req->imu forcing making an io-wq worker to try to resolve the fixed buffer without proper locking. Move req->imu setup into early req init paths, i.e. io_prep_rw(), which is called unconditionally for rw requests and under uring_lock. Fixes: 634d00df5e1cf ("io_uring: add full-fledged dynamic buffers support") Signed-off-by: Pavel Begunkov commit d11d31fc5d8a96f707facee0babdcffaafa38de2 Author: Pavel Begunkov Date: Mon Jun 13 06:30:06 2022 +0100 io_uring: fix races with buffer table unregister Fixed buffer table quiesce might unlock ->uring_lock, potentially letting new requests to be submitted, don't allow those requests to use the table as they will race with unregistration. Reported-and-tested-by: van fantasy Fixes: bd54b6fe3316ec ("io_uring: implement fixed buffers registration similar to fixed files") Signed-off-by: Pavel Begunkov commit b0380bf6dad4601d92025841e2b7a135d566c6e3 Author: Pavel Begunkov Date: Mon Jun 13 06:32:44 2022 +0100 io_uring: fix races with file table unregister Fixed file table quiesce might unlock ->uring_lock, potentially letting new requests to be submitted, don't allow those requests to use the table as they will race with unregistration. Reported-and-tested-by: van fantasy Fixes: 05f3fb3c53975 ("io_uring: avoid ring quiesce for fixed file set unregister and update") Signed-off-by: Pavel Begunkov commit 4051a81774d6d8e28192742c26999d6f29bc0e68 Author: Sebastian Andrzej Siewior Date: Tue May 17 11:16:14 2022 +0200 locking/lockdep: Use sched_clock() for random numbers Since the rewrote of prandom_u32(), in the commit mentioned below, the function uses sleeping locks which extracing random numbers and filling the batch. This breaks lockdep on PREEMPT_RT because lock_pin_lock() disables interrupts while calling __lock_pin_lock(). This can't be moved earlier because the main user of the function (rq_pin_lock()) invokes that function after disabling interrupts in order to acquire the lock. The cookie does not require random numbers as its goal is to provide a random value in order to notice unexpected "unlock + lock" sites. Use sched_clock() to provide random numbers. Fixes: a0103f4d86f88 ("random32: use real rng for non-deterministic randomness") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YoNn3pTkm5+QzE5k@linutronix.de commit 04193d590b390ec7a0592630f46d559ec6564ba1 Author: Peter Zijlstra Date: Tue Jun 7 22:41:55 2022 +0200 sched: Fix balance_push() vs __sched_setscheduler() The purpose of balance_push() is to act as a filter on task selection in the case of CPU hotplug, specifically when taking the CPU out. It does this by (ab)using the balance callback infrastructure, with the express purpose of keeping all the unlikely/odd cases in a single place. In order to serve its purpose, the balance_push_callback needs to be (exclusively) on the callback list at all times (noting that the callback always places itself back on the list the moment it runs, also noting that when the CPU goes down, regular balancing concerns are moot, so ignoring them is fine). And here-in lies the problem, __sched_setscheduler()'s use of splice_balance_callbacks() takes the callbacks off the list across a lock-break, making it possible for, an interleaving, __schedule() to see an empty list and not get filtered. Fixes: ae7927023243 ("sched: Optimize finish_lock_switch()") Reported-by: Jing-Ting Wu Signed-off-by: Peter Zijlstra (Intel) Tested-by: Jing-Ting Wu Link: https://lkml.kernel.org/r/20220519134706.GH2578@worktop.programming.kicks-ass.net commit e32683c6f7d22ba624e0bfc58b02cf3348bdca63 Author: Josh Poimboeuf Date: Thu Jun 9 00:17:32 2022 -0700 x86/mm: Fix RESERVE_BRK() for older binutils With binutils 2.26, RESERVE_BRK() causes a build failure: /tmp/ccnGOKZ5.s: Assembler messages: /tmp/ccnGOKZ5.s:98: Error: missing ')' /tmp/ccnGOKZ5.s:98: Error: missing ')' /tmp/ccnGOKZ5.s:98: Error: missing ')' /tmp/ccnGOKZ5.s:98: Error: junk at end of line, first unrecognized character is `U' The problem is this line: RESERVE_BRK(early_pgt_alloc, INIT_PGT_BUF_SIZE) Specifically, the INIT_PGT_BUF_SIZE macro which (via PAGE_SIZE's use _AC()) has a "1UL", which makes older versions of the assembler unhappy. Unfortunately the _AC() macro doesn't work for inline asm. Inline asm was only needed here to convince the toolchain to add the STT_NOBITS flag. However, if a C variable is placed in a section whose name is prefixed with ".bss", GCC and Clang automatically set STT_NOBITS. In fact, ".bss..page_aligned" already relies on this trick. So fix the build failure (and simplify the macro) by allocating the variable in C. Also, add NOLOAD to the ".brk" output section clause in the linker script. This is a failsafe in case the ".bss" prefix magic trick ever stops working somehow. If there's a section type mismatch, the GNU linker will force the ".brk" output section to be STT_NOBITS. The LLVM linker will fail with a "section type mismatch" error. Note this also changes the name of the variable from .brk.##name to __brk_##name. The variable names aren't actually used anywhere, so it's harmless. Fixes: a1e2c031ec39 ("x86/mm: Simplify RESERVE_BRK()") Reported-by: Joe Damato Reported-by: Byungchul Park Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Tested-by: Joe Damato Link: https://lore.kernel.org/r/22d07a44c80d8e8e1e82b9a806ddc8c6bbb2606e.1654759036.git.jpoimboe@kernel.org commit 6872fcac7158c3b3728a2ec1ea771ade0e61ddd5 Merge: f2906aa863381 6fac824f40987 Author: Thomas Gleixner Date: Mon Jun 13 09:10:49 2022 +0200 Merge tag 'irqchip-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip/genirq fixes from Marc Zyngier: - Invoke runtime PM for chained interrupts, aligning the behaviour with that of 'normal' interrupts - A flurry of of_node refcounting fixes - A fix for the recently merged loongarch that broke UP MIPS - A configuration fix for the Xilinx interrupt controller - Yet another new compat string for the Uniphier interrupt controller Link: https://lore.kernel.org/lkml/20220610083628.1205136-1-maz@kernel.org commit 3ddbe35d9a2ebd4924d458e0246b4ba6c13bb456 Author: Daniil Dementev Date: Fri Jun 10 19:57:32 2022 +0300 ALSA: usb-audio: US16x08: Move overflow check before array access Buffer overflow could occur in the loop "while", due to accessing an array element before checking the index. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Daniil Dementev Reviewed-by: Alexey Khoroshilov Link: https://lore.kernel.org/r/20220610165732.2904-1-d.dementev@ispras.ru Signed-off-by: Takashi Iwai commit b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3 Author: Linus Torvalds Date: Sun Jun 12 16:11:37 2022 -0700 Linux 5.19-rc2 commit 44dbdf3bb3f44bf08897ed5f22eb262edcf3d926 Author: Ludvig Pärsson Date: Fri Jun 10 16:00:55 2022 +0200 firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get scmi_voltage_descriptors_get() will incorrecly return an error code if the last iteration of the for loop that retrieves the descriptors is skipped due to an error. Skipping an iteration in the loop is not an error, but the `ret` value from the last iteration will be propagated when the function returns. Fix by not saving return values that should not be propagated. This solution also minimizes the risk of future patches accidentally re-introducing this bug. Link: https://lore.kernel.org/r/20220610140055.31491-1-ludvig.parsson@axis.com Reviewed-by: Cristian Marussi Signed-off-by: Ludvig Pärsson [sudeep.holla: Removed unneeded reset_rx_to_maxsz and check for return value from scmi_voltage_levels_get as suggested by Cristian] Signed-off-by: Sudeep Holla commit 5e757deddd918edb8cb2fdb56eb79656ffc6dade Author: Conor Dooley Date: Fri Jun 3 09:38:26 2022 +0100 riscv: dts: microchip: re-add pdma to mpfs device tree PolarFire SoC /does/ have a SiFive pdma, despite what I suggested as a conflict resolution to Zong. Somehow the entry fell through the cracks between versions of my dt patches, so re-add it with Zong's updated compatible & dma-channels property. Fixes: c5094f371008 ("riscv: dts: microchip: refactor icicle kit device tree") Signed-off-by: Conor Dooley commit 997952851843935024962b51fc36c61b3c2d1ed4 Merge: b0cb8db39636f d4fe9cc4ff865 Author: Linus Torvalds Date: Sun Jun 12 11:33:42 2022 -0700 Merge tag 'platform-drivers-x86-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Highlights: - Fix hp-wmi regression on HP Omen laptops introduced in 5.18 - Several hardware-id additions - A couple of other tiny fixes" * tag 'platform-drivers-x86-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel: hid: Add Surface Go to VGBS allow list platform/x86: hp-wmi: Use zero insize parameter only when supported platform/x86: hp-wmi: Resolve WMI query failures on some devices platform/x86: gigabyte-wmi: Add support for B450M DS3H-CF platform/x86: gigabyte-wmi: Add Z690M AORUS ELITE AX DDR4 support platform/x86: barco-p50-gpio: Add check for platform_driver_register platform/x86/intel: pmc: Support Intel Raptorlake P platform/x86/intel: Fix pmt_crashlog array reference platform/mellanox: Add static in struct declaration. platform/mellanox: Spelling s/platfom/platform/ commit b0cb8db39636f7d79caadf98a90e9367b4d9aabc Merge: e3b8e2de19e18 8bee9dd953b69 Author: Linus Torvalds Date: Sun Jun 12 11:16:00 2022 -0700 Merge tag 'wq-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue fixes from Tejun Heo: "Tetsuo's patch to trigger build warnings if system-wide wq's are flushed along with a TP type update and trivial comment update" * tag 'wq-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Switch to new kerneldoc syntax for named variable macro argument workqueue: Fix type of cpu in trace event workqueue: Wrap flush_workqueue() using a macro commit e3b8e2de19e18e4297c0dd747d56ecdc4ff96928 Merge: 2275c6babfa53 1f7a6cf6b07c7 Author: Linus Torvalds Date: Sun Jun 12 11:10:07 2022 -0700 Merge tag 'kbuild-fixes-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Make the *.mod build rule portable for POSIX awk - Fix regression of 'make nsdeps' - Make scripts/check-local-export working for older bash versions - Fix scripts/gdb to extract the .config data from vmlinux * tag 'kbuild-fixes-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: scripts/gdb: change kernel config dumping method scripts/check-local-export: avoid 'wait $!' for process substitution scripts/nsdeps: adjust to the format change of *.mod files kbuild: avoid regex RS for POSIX awk commit 2275c6babfa53278c90b7915441c61392dd687cc Merge: 3cae0d84756ae 4c14d7043fede Author: Linus Torvalds Date: Sun Jun 12 11:05:44 2022 -0700 Merge tag '5.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: "Three reconnect fixes, all for stable as well. One of these three reconnect fixes does address a problem with multichannel reconnect, but this does not include the additional fix (still being tested) for dynamically detecting multichannel adapter changes which will improve those reconnect scenarios even more" * tag '5.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: populate empty hostnames for extra channels cifs: return errors during session setup during reconnects cifs: fix reconnect on smb3 mount types commit 3cae0d84756aea1c563f0cf9f668cf13e281e8a5 Merge: 7a68065eb9cd1 17b0128a136d4 Author: Linus Torvalds Date: Sun Jun 12 10:33:38 2022 -0700 Merge tag 'random-5.19-rc2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - A fix for a 5.19 regression for a case in which early device tree initializes the RNG, which flips a static branch. On most plaforms, jump labels aren't initialized until much later, so this caused splats. On a few mailing list threads, we cooked up easy fixes for arm64, arm32, and risc-v. But then things looked slightly more involved for xtensa, powerpc, arc, and mips. And at that point, when we're patching 7 architectures in a place before the console is even available, it seems like the cost/risk just wasn't worth it. So random.c works around it now by checking the already exported `static_key_initialized` boolean, as though somebody already ran into this issue in the past. I'm not super jazzed about that; it'd be prettier to not have to complicate downstream code. But I suppose it's practical. - A few small code nits and adding a missing __init annotation. - A change to the default config values to use the cpu and bootloader's seeds for initializing the RNG earlier. This brings them into line with what all the distros do (Fedora/RHEL, Debian, Ubuntu, Gentoo, Arch, NixOS, Alpine, SUSE, and Void... at least), and moreover will now give us test coverage in various test beds that might have caught the above device tree bug earlier. - A change to WireGuard CI's configuration to increase test coverage around the RNG. - A documentation comment fix to unrelated maintainerless CRC code that I was asked to take, I guess because it has to do with polynomials (which the RNG thankfully no longer uses). * tag 'random-5.19-rc2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: wireguard: selftests: use maximum cpu features and allow rng seeding random: remove rng_has_arch_random() random: credit cpu and bootloader seeds by default random: do not use jump labels before they are initialized random: account for arch randomness in bits random: mark bootloader randomness code as __init random: avoid checking crng_ready() twice in random_init() crc-itu-t: fix typo in CRC ITU-T polynomial comment commit d4fe9cc4ff8656704b58cfd9363d7c3c9d65e519 Author: Duke Lee Date: Tue Jun 7 14:36:54 2022 -0700 platform/x86/intel: hid: Add Surface Go to VGBS allow list The Surface Go reports Chassis Type 9 (Laptop,) so the device needs to be added to dmi_vgbs_allow_list to enable tablet mode when an attached Type Cover is folded back. BugLink: https://github.com/linux-surface/linux-surface/issues/837 Signed-off-by: Duke Lee Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220607213654.5567-1-krnhotwings@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 65f936f3535950d2643eac5bf34a735a0e428cdd Author: Bedant Patnaik Date: Thu Jun 9 00:58:43 2022 +0530 platform/x86: hp-wmi: Use zero insize parameter only when supported commit be9d73e64957 ("platform/x86: hp-wmi: Fix 0x05 error code reported by several WMI calls") and commit 12b19f14a21a ("platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05)") cause ACPI BIOS Error (bug): Attempt to CreateField of length zero (20211217/dsopcode-133) because of the ACPI method HWMC, which unconditionally creates a Field of size (insize*8) bits: CreateField (Arg1, 0x80, (Local5 * 0x08), DAIN) In cases where args->insize = 0, the Field size is 0, resulting in an error. Fix this by using zero insize only if 0x5 error code is returned Tested on Omen 15 AMD (2020) board ID: 8786. Fixes: be9d73e64957 ("platform/x86: hp-wmi: Fix 0x05 error code reported by several WMI calls") Signed-off-by: Bedant Patnaik Tested-by: Jorge Lopez Link: https://lore.kernel.org/r/41be46743d21c78741232a47bbb5f1cdbcc3d21e.camel@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit dc6a6ab58379f25bf991d8e4a13b001ed806e881 Author: Jorge Lopez Date: Wed Jun 8 16:29:23 2022 -0500 platform/x86: hp-wmi: Resolve WMI query failures on some devices WMI queries fail on some devices where the ACPI method HWMC unconditionally attempts to create Fields beyond the buffer if the buffer is too small, this breaks essential features such as power profiles: CreateByteField (Arg1, 0x10, D008) CreateByteField (Arg1, 0x11, D009) CreateByteField (Arg1, 0x12, D010) CreateDWordField (Arg1, 0x10, D032) CreateField (Arg1, 0x80, 0x0400, D128) In cases where args->data had zero length, ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [D008] at bit offset/length 128/8 exceeds size of target Buffer (128 bits) (20211217/dsopcode-198) was obtained. ACPI BIOS Error (bug): AE_AML_BUFFER_LIMIT, Field [D009] at bit offset/length 136/8 exceeds size of target Buffer (136bits) (20211217/dsopcode-198) The original code created a buffer size of 128 bytes regardless if the WMI call required a smaller buffer or not. This particular behavior occurs in older BIOS and reproduced in OMEN laptops. Newer BIOS handles buffer sizes properly and meets the latest specification requirements. This is the reason why testing with a dynamically allocated buffer did not uncover any failures with the test systems at hand. This patch was tested on several OMEN, Elite, and Zbooks. It was confirmed the patch resolves HPWMI_FAN GET/SET calls in an OMEN Laptop 15-ek0xxx. No problems were reported when testing on several Elite and Zbooks notebooks. Fixes: 4b4967cbd268 ("platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated") Signed-off-by: Jorge Lopez Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220608212923.8585-2-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit abfed87e2a12bd246047d78c01d81eb9529f1d06 Author: Jason A. Donenfeld Date: Sat May 28 12:24:29 2022 +0200 crypto: memneq - move into lib/ This is used by code that doesn't need CONFIG_CRYPTO, so move this into lib/ with a Kconfig option so that it can be selected by whatever needs it. This fixes a linker error Zheng pointed out when CRYPTO_MANAGER_DISABLE_TESTS!=y and CRYPTO=m: lib/crypto/curve25519-selftest.o: In function `curve25519_selftest': curve25519-selftest.c:(.init.text+0x60): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0xec): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0x114): undefined reference to `__crypto_memneq' curve25519-selftest.c:(.init.text+0x154): undefined reference to `__crypto_memneq' Reported-by: Zheng Bin Cc: Eric Biggers Cc: stable@vger.kernel.org Fixes: aa127963f1ca ("crypto: lib/curve25519 - re-add selftests") Signed-off-by: Jason A. Donenfeld Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu commit 8bee9dd953b69c634d1c9a3241a8b357469ad4aa Author: Jonathan Neuschäfer Date: Fri Jun 10 01:41:10 2022 +0200 workqueue: Switch to new kerneldoc syntax for named variable macro argument The syntax without dots is available since commit 43756e347f21 ("scripts/kernel-doc: Add support for named variable macro arguments"). The same HTML output is produced with and without this patch. Signed-off-by: Jonathan Neuschäfer Acked-by: Tejun Heo Signed-off-by: Tejun Heo commit 7a68065eb9cd194cf03f135c9211eeb2d5c4c0a0 Merge: cecb3540b89ef 77006f6edc0e0 Author: Linus Torvalds Date: Sat Jun 11 16:56:41 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "A set of fixes. Most address the new warning we emit at build time when irq chips are not immutable with some additional tweaks to gpio-crystalcove from Andy and a small tweak to gpio-dwapd. - make irq_chip structs immutable in several Diolan and intel drivers to get rid of the new warning we emit when fiddling with irq chips - don't print error messages on probe deferral in gpio-dwapb" * tag 'gpio-fixes-for-v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: dwapb: Don't print error on -EPROBE_DEFER gpio: dln2: make irq_chip immutable gpio: sch: make irq_chip immutable gpio: merrifield: make irq_chip immutable gpio: wcove: make irq_chip immutable gpio: crystalcove: Join function declarations and long lines gpio: crystalcove: Use specific type and API for IRQ number gpio: crystalcove: make irq_chip immutable commit cecb3540b89ef2b586d07c1bd69408e251791b76 Merge: abe71eb32f305 ec1e8adcbdf66 Author: Linus Torvalds Date: Sat Jun 11 16:50:39 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Driver fixes and and one core patch. Nine of the driver patches are minor fixes and reworks to lpfc and the rest are trivial and minor fixes elsewhere" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: pmcraid: Fix missing resource cleanup in error case scsi: ipr: Fix missing/incorrect resource cleanup in error case scsi: mpt3sas: Fix out-of-bounds compiler warning scsi: lpfc: Update lpfc version to 14.2.0.4 scsi: lpfc: Allow reduced polling rate for nvme_admin_async_event cmd completion scsi: lpfc: Add more logging of cmd and cqe information for aborted NVMe cmds scsi: lpfc: Fix port stuck in bypassed state after LIP in PT2PT topology scsi: lpfc: Resolve NULL ptr dereference after an ELS LOGO is aborted scsi: lpfc: Address NULL pointer dereference after starget_to_rport() scsi: lpfc: Resolve some cleanup issues following SLI path refactoring scsi: lpfc: Resolve some cleanup issues following abort path refactoring scsi: lpfc: Correct BDE type for XMIT_SEQ64_WQE in lpfc_ct_reject_event() scsi: vmw_pvscsi: Expand vcpuHint to 16 bits scsi: sd: Fix interpretation of VPD B9h length commit abe71eb32f3051f461d2975c674c0857549d0b93 Merge: 0678afa6055d1 eacea844594ff Author: Linus Torvalds Date: Sat Jun 11 16:32:47 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Fixes all over the place, most notably fixes for latent bugs in drivers that got exposed by suppressing interrupts before DRIVER_OK, which in turn has been done by 8b4ec69d7e09 ("virtio: harden vring IRQ")" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: um: virt-pci: set device ready in probe() vdpa: make get_vq_group and set_group_asid optional virtio: Fix all occurences of the "the the" typo vduse: Fix NULL pointer dereference on sysfs access vringh: Fix loop descriptors check in the indirect cases vdpa/mlx5: clean up indenting in handle_ctrl_vlan() vdpa/mlx5: fix error code for deleting vlan virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed vdpa/mlx5: Fix syntax errors in comments virtio-rng: make device ready before making request commit 0678afa6055d14799c1dc1eee47c8025eba56cab Merge: 1c27f1fc1549f 5c95fe8b02011 Author: Linus Torvalds Date: Sat Jun 11 12:37:39 2022 -0700 Merge tag 'loongarch-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen. "Fix build errors and a stale comment" * tag 'loongarch-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Remove MIPS comment about cycle counter LoongArch: Fix copy_thread() build errors LoongArch: Fix the !CONFIG_SMP build commit 1c27f1fc1549f0e470429f5497a76ad28a37f21a Author: Linus Torvalds Date: Sat Jun 11 10:30:20 2022 -0700 iov_iter: fix build issue due to possible type mis-match Commit 6c77676645ad ("iov_iter: Fix iter_xarray_get_pages{,_alloc}()") introduced a problem on some 32-bit architectures (at least arm, xtensa, csky,sparc and mips), that have a 'size_t' that is 'unsigned int'. The reason is that we now do min(nr * PAGE_SIZE - offset, maxsize); where 'nr' and 'offset' and both 'unsigned int', and PAGE_SIZE is 'unsigned long'. As a result, the normal C type rules means that the first argument to 'min()' ends up being 'unsigned long'. In contrast, 'maxsize' is of type 'size_t'. Now, 'size_t' and 'unsigned long' are always the same physical type in the kernel, so you'd think this doesn't matter, and from an actual arithmetic standpoint it doesn't. But on 32-bit architectures 'size_t' is commonly 'unsigned int', even if it could also be 'unsigned long'. In that situation, both are unsigned 32-bit types, but they are not the *same* type. And as a result 'min()' will complain about the distinct types (ignore the "pointer types" part of the error message: that's an artifact of the way we have made 'min()' check types for being the same): lib/iov_iter.c: In function 'iter_xarray_get_pages': include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast [-Werror] 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ lib/iov_iter.c:1464:16: note: in expansion of macro 'min' 1464 | return min(nr * PAGE_SIZE - offset, maxsize); | ^~~ This was not visible on 64-bit architectures (where we always define 'size_t' to be 'unsigned long'). Force these cases to use 'min_t(size_t, x, y)' to make the type explicit and avoid the issue. [ Nit-picky note: technically 'size_t' doesn't have to match 'unsigned long' arithmetically. We've certainly historically seen environments with 16-bit address spaces and 32-bit 'unsigned long'. Similarly, even in 64-bit modern environments, 'size_t' could be its own type distinct from 'unsigned long', even if it were arithmetically identical. So the above type commentary is only really descriptive of the kernel environment, not some kind of universal truth for the kinds of wild and crazy situations that are allowed by the C standard ] Reported-by: Sudip Mukherjee Link: https://lore.kernel.org/all/YqRyL2sIqQNDfky2@debian/ Cc: Jeff Layton Cc: David Howells Cc: Al Viro Signed-off-by: Linus Torvalds commit 06ee1c0aebd5dfdf6bf237165b22415f64f38b7c Author: Christophe JAILLET Date: Sat Jun 11 10:32:44 2022 +0200 ksmbd: smbd: Remove useless license text when SPDX-License-Identifier is already used An SPDX-License-Identifier is already in place. There is no need to duplicate part of the corresponding license. Signed-off-by: Christophe JAILLET Acked-by: Namjae Jeon Signed-off-by: Steve French commit fe0fde09e1cb83effcf8fafa372533f438d93a1a Author: Namjae Jeon Date: Thu Jun 2 10:07:38 2022 +0900 ksmbd: use SOCK_NONBLOCK type for kernel_accept() I found that normally it is O_NONBLOCK but there are different value for some arch. /include/linux/net.h: #ifndef SOCK_NONBLOCK #define SOCK_NONBLOCK O_NONBLOCK #endif /arch/alpha/include/asm/socket.h: #define SOCK_NONBLOCK 0x40000000 Use SOCK_NONBLOCK instead of O_NONBLOCK for kernel_accept(). Suggested-by: David Howells Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French commit 2d56af33d4df94d2b76446ffc3e3654c42232f4b Author: Brian Norris Date: Tue Jun 7 14:15:36 2022 -0700 arm64: dts: rockchip: Assign RK3399 VDU clock rate Before commit 9998943f6dfc ("media: rkvdec: Stop overclocking the decoder"), the rkvdec driver was forcing the VDU clock rate. After that commit, we rely on the default clock rate. That rate works OK on many boards, with the default PLL settings (CPLL is 800MHz, VDU dividers leave it at 400MHz); but some boards change PLL settings. Assign the expected default clock rate explicitly, so that the rate is consistent, regardless of PLL configuration. This was particularly broken on RK3399 Gru Scarlet systems, where the rk3399-gru-scarlet.dtsi assigns PLL_CPLL to 1.6 GHz, and so the VDU clock ends up at 800 MHz (twice the expected rate), and causes video artifacts and other issues. Note: I assign the clock rate in the clock controller instead of the vdec node, because there are multiple nodes that use this clock, and per the clock.yaml specification: Configuring a clock's parent and rate through the device node that consumes the clock can be done only for clocks that have a single user. Specifying conflicting parent or rate configuration in multiple consumer nodes for a shared clock is forbidden. Configuration of common clocks, which affect multiple consumer devices can be similarly specified in the clock provider node. Fixes: 9998943f6dfc ("media: rkvdec: Stop overclocking the decoder") Cc: Signed-off-by: Brian Norris Reviewed-by: Nicolas Dufresne Link: https://lore.kernel.org/r/20220607141535.1.Idafe043ffc94756a69426ec68872db0645c5d6e2@changeid Signed-off-by: Heiko Stuebner commit 2881a4ab319918e775ec9c084da3d6cc15ad77ab Author: Peter Geis Date: Fri Jun 10 09:25:42 2022 -0400 arm64: dts: rockchip: Fix Quartz64-A dwc3 otg port behavior The otg_id line on the Quartz64 Model A is not connected to anything. This prevents automatic selection of the dual role usb port. In otg mode it defaults to device mode. Force it to host mode to retain previous behavior. Fixes: bc405bb3eeee ("arm64: dts: rockchip: enable otg/drd operation of usb_host0_xhci in rk356x") Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220610132542.159978-1-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 17b0128a136d43e5f8f268631f48bc267373ebff Author: Jason A. Donenfeld Date: Fri Jun 10 16:32:02 2022 +0200 wireguard: selftests: use maximum cpu features and allow rng seeding By forcing the maximum CPU that QEMU has available, we expose additional capabilities, such as the RNDR instruction, which increases test coverage. This then allows the CI to skip the fake seeding step in some cases. Also enable STRICT_KERNEL_RWX to catch issues related to early jump labels when the RNG is initialized at boot. Signed-off-by: Jason A. Donenfeld commit 1f7a6cf6b07c74a17343c2559cd5f5018a245961 Author: Kuan-Ying Lee Date: Fri Jun 10 15:14:57 2022 +0800 scripts/gdb: change kernel config dumping method MAGIC_START("IKCFG_ST") and MAGIC_END("IKCFG_ED") are moved out from the kernel_config_data variable. Thus, we parse kernel_config_data directly instead of considering offset of MAGIC_START and MAGIC_END. Fixes: 13610aa908dc ("kernel/configs: use .incbin directive to embed config_data.gz") Signed-off-by: Kuan-Ying Lee Signed-off-by: Masahiro Yamada commit 6f0e1efc880ae979df45aa85e3336aac5e58d97a Merge: 145684d9f9d36 249eddaf651fd Author: Jakub Kicinski Date: Fri Jun 10 22:18:22 2022 -0700 Merge branch 'documentation-add-description-for-a-couple-of-sctp-sysctl-options' Xin Long says: ==================== Documentation: add description for a couple of sctp sysctl options These are a couple of sysctl options I recently added, but missed adding documents for them. Especially for net.sctp.intl_enable, it's hard for users to setup stream interleaving, as it also needs to call some socket options. This patchset is to add documents for them. ==================== Link: https://lore.kernel.org/r/cover.1654787716.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 249eddaf651fda7cb32e9ebae4c6d5904b390d81 Author: Xin Long Date: Thu Jun 9 11:17:15 2022 -0400 Documentation: add description for net.sctp.ecn_enable Describe it in networking/ip-sysctl.rst like other SCTP options. Fixes: 2f5268a9249b ("sctp: allow users to set netns ecn flag with sysctl") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit e65775fdd389e4f47eb1972ef6372e20c6c2cc05 Author: Xin Long Date: Thu Jun 9 11:17:14 2022 -0400 Documentation: add description for net.sctp.intl_enable Describe it in networking/ip-sysctl.rst like other SCTP options. We need to document this especially as when using the feature of User Message Interleaving, some socket options also needs to be set. Fixes: 463118c34a35 ("sctp: support sysctl to allow users to use stream interleave") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit c349ae5f831cb9817a45e4e36705d2f7d47c7bc3 Author: Xin Long Date: Thu Jun 9 11:17:13 2022 -0400 Documentation: add description for net.sctp.reconf_enable Describe it in networking/ip-sysctl.rst like other SCTP options. Fixes: c0d8bab6ae51 ("sctp: add get and set sockopt for reconf_enable") Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: Jakub Kicinski commit 145684d9f9d363dce08b1f02cb2ccf9ecb8b2851 Merge: aa3398fb4b3f6 645603844270b Author: Jakub Kicinski Date: Fri Jun 10 22:10:30 2022 -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 2022-06-09 Grzegorz prevents addition of TC flower filters to TC0 and fixes queue iteration for VF ADQ to number of actual queues for i40e. Aleksandr prevents running of ethtool tests when device is being reset for i40e. Michal resolves an issue where iavf does not report its MAC address properly. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: Fix issue with MAC address of VF shown as zero i40e: Fix call trace in setup_tx_descriptors i40e: Fix calculating the number of queue pairs i40e: Fix adding ADQ filter to TC0 ==================== Link: https://lore.kernel.org/r/20220609162620.2619258-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit eacea844594ff338db06437806707313210d4865 Author: Vincent Whitchurch Date: Fri Jun 10 17:12:03 2022 +0200 um: virt-pci: set device ready in probe() Call virtio_device_ready() to make this driver work after commit b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the virtqueues in the probe function. (The virtio core sets the device ready when probe returns.) Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ") Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Vincent Whitchurch Message-Id: <20220610151203.3492541-1-vincent.whitchurch@axis.com> Signed-off-by: Michael S. Tsirkin Tested-by: Johannes Berg commit 0885eacdc81f920c3e0554d5615e69a66504a28d Merge: 90add6d418d02 da9e94fe000e1 Author: Linus Torvalds Date: Fri Jun 10 17:28:43 2022 -0700 Merge tag 'nfsd-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Notable changes: - There is now a backup maintainer for NFSD Notable fixes: - Prevent array overruns in svc_rdma_build_writes() - Prevent buffer overruns when encoding NFSv3 READDIR results - Fix a potential UAF in nfsd_file_put()" * tag 'nfsd-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer() SUNRPC: Clean up xdr_get_next_encode_buffer() SUNRPC: Clean up xdr_commit_encode() SUNRPC: Optimize xdr_reserve_space() SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer() SUNRPC: Trap RDMA segment overflows NFSD: Fix potential use-after-free in nfsd_file_put() MAINTAINERS: reciprocal co-maintainership for file locking and nfsd commit 4c14d7043fede258957d7b01da0cad2d9fe3a205 Author: Shyam Prasad N Date: Mon Jun 6 09:52:46 2022 +0000 cifs: populate empty hostnames for extra channels Currently, the secondary channels of a multichannel session also get hostname populated based on the info in primary channel. However, this will end up with a wrong resolution of hostname to IP address during reconnect. This change fixes this by not populating hostname info for all secondary channels. Fixes: 5112d80c162f ("cifs: populate server_hostname for extra channels") Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 90add6d418d02991380595bdbc307e05410af638 Merge: 045fb9c2f5f42 dddf305640547 Author: Linus Torvalds Date: Fri Jun 10 16:32:49 2022 -0700 Merge tag 'for-5.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix DM core's bioset initialization so that blk integrity pool is properly setup. Remove now unused bioset_init_from_src. - Fix DM zoned hang from locking imbalance due to needless check in clone_endio(). * tag 'for-5.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix zoned locking imbalance due to needless check in clone_endio block: remove bioset_init_from_src dm: fix bio_set allocation commit 045fb9c2f5f42ea922053e9c7bfc4d882fade436 Merge: b09891598557a 40a8110120230 Author: Linus Torvalds Date: Fri Jun 10 16:15:19 2022 -0700 Merge branch 'fscache-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull fscache cleanups from David Howells: - fix checker complaint in afs - two netfs cleanups: - netfs_inode calling convention cleanup plus the requisite documentation changes - replace the ->cleanup op with a ->free_request op. This is possible as the I/O request is now always available at the cleanup point as the stuff to be cleaned up is no longer passed into the API functions, but rather obtained by ->init_request. * 'fscache-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: netfs: Rename the netfs_io_request cleanup op and give it an op pointer netfs: Further cleanups after struct netfs_inode wrapper introduced afs: Fix some checker issues commit b09891598557a0ef408d9a7605e72ed3c67c8c15 Merge: a32e7ea362356 6c77676645ad4 Author: Linus Torvalds Date: Fri Jun 10 15:53:09 2022 -0700 Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull iov_iter fix from Al Viro: "ITER_XARRAY get_pages fix; now the return value is a lot saner (and more similar to logics for other flavours)" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: iov_iter: Fix iter_xarray_get_pages{,_alloc}() commit c6bc7e8ee90845556a90faf8b043cbefd77b8903 Author: August Wikerfors Date: Wed Jun 8 23:20:28 2022 +0200 platform/x86: gigabyte-wmi: Add support for B450M DS3H-CF Tested and works on my system. Signed-off-by: August Wikerfors Link: https://lore.kernel.org/r/20220608212028.28307-1-git@augustwikerfors.se Signed-off-by: Hans de Goede commit 8a041afe3e774bedd3e0a9b96f65e48a1299a595 Author: Piotr Chmura Date: Mon Jun 6 19:15:13 2022 +0200 platform/x86: gigabyte-wmi: Add Z690M AORUS ELITE AX DDR4 support Add dmi_system_id of Gigabyte Z690M AORUS ELITE AX DDR4 board. Tested on my PC. Signed-off-by: Piotr Chmura Link: https://lore.kernel.org/r/bd83567e-ebf5-0b31-074b-5f6dc7f7c147@gmail.com Signed-off-by: Hans de Goede commit 011881b80ebe773914b59905bce0f5e0ef93e7ba Author: Jiasheng Jiang Date: Thu May 26 17:03:45 2022 +0800 platform/x86: barco-p50-gpio: Add check for platform_driver_register As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 86af1d02d458 ("platform/x86: Support for EC-connected GPIOs for identify LED/button on Barco P50 board") Signed-off-by: Jiasheng Jiang Acked-by: Peter Korsgaard Link: https://lore.kernel.org/r/20220526090345.1444172-1-jiasheng@iscas.ac.cn Signed-off-by: Hans de Goede commit 552f3b801de6eb062b225a76e140995483a0609c Author: George D Sworo Date: Wed Jun 1 18:26:17 2022 -0700 platform/x86/intel: pmc: Support Intel Raptorlake P Add Raptorlake P to the list of the platforms that intel_pmc_core driver supports for pmc_core device. Raptorlake P PCH is based on Alderlake P PCH. Signed-off-by: George D Sworo Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220602012617.20100-1-george.d.sworo@intel.com Signed-off-by: Hans de Goede commit 66cb3a2d7ad0d0e9af4d3430a4f2a32ffb9ac098 Author: David Arcari Date: Thu May 26 16:31:40 2022 -0400 platform/x86/intel: Fix pmt_crashlog array reference The probe function pmt_crashlog_probe() may incorrectly reference the 'priv->entry array' as it uses 'i' to reference the array instead of 'priv->num_entries' as it should. This is similar to the problem that was addressed in pmt_telemetry_probe via commit 2cdfa0c20d58 ("platform/x86/intel: Fix 'rmmod pmt_telemetry' panic"). Cc: "David E. Box" Cc: Hans de Goede Cc: Mark Gross Cc: linux-kernel@vger.kernel.org Signed-off-by: David Arcari Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220526203140.339120-1-darcari@redhat.com Signed-off-by: Hans de Goede commit b9c29f391f4195a778620f3d2efd0d9746a414fe Author: Michael Shych Date: Thu Jun 2 17:51:03 2022 +0300 platform/mellanox: Add static in struct declaration. Fix problem of missing static in struct declaration. Fixes: 662f24826f954 ("platform/mellanox: Add support for new SN2201 system") Reported-by: kernel test robot Signed-off-by: Michael Shych Link: https://lore.kernel.org/r/20220602145103.11859-1-michaelsh@nvidia.com Signed-off-by: Hans de Goede commit 6c77676645ad42993e0a8bdb8dafa517851a352a Author: David Howells Date: Thu Jun 9 09:07:01 2022 +0100 iov_iter: Fix iter_xarray_get_pages{,_alloc}() The maths at the end of iter_xarray_get_pages() to calculate the actual size doesn't work under some circumstances, such as when it's been asked to extract a partial single page. Various terms of the equation cancel out and you end up with actual == offset. The same issue exists in iter_xarray_get_pages_alloc(). Fix these to just use min() to select the lesser amount from between the amount of page content transcribed into the buffer, minus the offset, and the size limit specified. This doesn't appear to have caused a problem yet upstream because network filesystems aren't getting the pages from an xarray iterator, but rather passing it directly to the socket, which just iterates over it. Cachefiles *does* do DIO from one to/from ext4/xfs/btrfs/etc. but it always asks for whole pages to be written or read. Fixes: 7ff5062079ef ("iov_iter: Add ITER_XARRAY") Reported-by: Jeff Layton Signed-off-by: David Howells cc: Alexander Viro cc: Dominique Martinet cc: Mike Marshall cc: Gao Xiang cc: linux-afs@lists.infradead.org cc: v9fs-developer@lists.sourceforge.net cc: devel@lists.orangefs.org cc: linux-erofs@lists.ozlabs.org cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro commit 40a81101202300df7db273f77dda9fbe6271b1d2 Author: David Howells Date: Fri Feb 25 11:19:14 2022 +0000 netfs: Rename the netfs_io_request cleanup op and give it an op pointer The netfs_io_request cleanup op is now always in a position to be given a pointer to a netfs_io_request struct, so this can be passed in instead of the mapping and private data arguments (both of which are included in the struct). So rename the ->cleanup op to ->free_request (to match ->init_request) and pass in the I/O pointer. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com commit e81fb4198e27925b151aad1450e0fd607d6733f8 Author: Linus Torvalds Date: Thu Jun 9 15:04:01 2022 -0700 netfs: Further cleanups after struct netfs_inode wrapper introduced Change the signature of netfs helper functions to take a struct netfs_inode pointer rather than a struct inode pointer where appropriate, thereby relieving the need for the network filesystem to convert its internal inode format down to the VFS inode only for netfslib to bounce it back up. For type safety, it's better not to do that (and it's less typing too). Give netfs_write_begin() an extra argument to pass in a pointer to the netfs_inode struct rather than deriving it internally from the file pointer. Note that the ->write_begin() and ->write_end() ops are intended to be replaced in the future by netfslib code that manages this without the need to call in twice for each page. netfs_readpage() and similar are intended to be pointed at directly by the address_space_operations table, so must stick to the signature dictated by the function pointers there. Changes ======= - Updated the kerneldoc comments and documentation [DH]. Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/CAHk-=wgkwKyNmNdKpQkqZ6DnmUL-x9hp0YBnUGjaPFEAdxDTbw@mail.gmail.com/ commit 102d841055be8e6e4e24d58917ffc04958262c4d Author: David Howells Date: Thu May 19 08:40:12 2022 +0100 afs: Fix some checker issues Remove an unused global variable and make another static as reported by make C=1. Signed-off-by: David Howells cc: linux-afs@lists.infradead.org commit a32e7ea362356af8e89e67600432bad83d2325da Merge: aa3398fb4b3f6 334f6f53abcf5 Author: Linus Torvalds Date: Fri Jun 10 12:41:48 2022 -0700 Merge tag 'folio-5.19a' of git://git.infradead.org/users/willy/pagecache Pull folio fixes from Matthew Wilcox: "Four folio-related fixes: - Don't release a folio while it's still locked - Fix a use-after-free after dropping the mmap_lock - Fix a memory leak when splitting a page - Fix a kernel-doc warning for struct folio" * tag 'folio-5.19a' of git://git.infradead.org/users/willy/pagecache: mm: Add kernel-doc for folio->mlock_count mm/huge_memory: Fix xarray node memory leak filemap: Cache the value of vm_flags filemap: Don't release a locked folio commit dddf30564054796696bcd4c462b232a5beacf72c Author: Mike Snitzer Date: Fri Jun 10 15:07:48 2022 -0400 dm: fix zoned locking imbalance due to needless check in clone_endio After the commit ca522482e3ea ("dm: pass NULL bdev to bio_alloc_clone"), clone_endio() only calls dm_zone_endio() when DM targets remap the clone bio's bdev to something other than the md->disk->part0 default. However, if a DM target (e.g. dm-crypt) stacked ontop of a dm-zoned does not remap the clone bio using bio_set_dev() then dm_zone_endio() is not called at completion of the bios and zone locks are not properly unlocked. This triggers a hang, in dm_zone_map_bio(), when blktests block/004 is run for dm-crypt on zoned block devices. To avoid the hang, simply remove the clone_endio() check that verifies the target remapped the clone bio to a device other than the default. Fixes: ca522482e3ea ("dm: pass NULL bdev to bio_alloc_clone") Reported-by: Shin'ichiro Kawasaki Signed-off-by: Mike Snitzer commit a4c934d74e408cb5ea5209b5fdf6184e3e250b1b Author: Geert Uytterhoeven Date: Tue May 24 09:15:44 2022 +0200 platform/mellanox: Spelling s/platfom/platform/ Fix a misspelling of the word "platform". Signed-off-by: Geert Uytterhoeven Acked-by: Michael Shych Link: https://lore.kernel.org/r/9c8edde31e271311b7832d7677fe84aba917da8d.1653376503.git.geert@linux-m68k.org Signed-off-by: Hans de Goede commit aa3398fb4b3f67d89688976098ad93721b6d7852 Merge: 1bc27dec7ea5a 0b9431c8221cf Author: Linus Torvalds Date: Fri Jun 10 11:57:36 2022 -0700 Merge tag 'devicetree-fixes-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull more devicetree fixes from Rob Herring: - More DT meta-schema check fixes from new bindings in merge window - Fix stale DT binding references from Mauro - Update various binding maintainers - Fix in arm,malidp properties to match reality - Add deprecated 'atheros' vendor prefix * tag 'devicetree-fixes-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: display: arm,malidp: remove bogus RQOS property dt-bindings: pinctrl: ralink: Fix 'enum' lists with duplicate entries dt-bindings: Drop more redundant 'maxItems/minItems' in if/then schemas dt-bindings: nvme: apple,nvme-ans: Drop 'maxItems' from 'apple,sart' MAINTAINERS: rectify entries for ARM DRM DRIVERS after dt conversion MAINTAINERS: update snps,axs10x-reset.yaml reference MAINTAINERS: update dongwoon,dw9807-vcm.yaml reference MAINTAINERS: update cortina,gemini-ethernet.yaml reference dt-bindings: mfd: rk808: update rockchip,rk808.yaml reference dt-bindings: reset: update st,stih407-powerdown.yaml references dt-bindings: arm: update vexpress-config.yaml references dt-bindings: interrupt-controller: update brcm,l2-intc.yaml reference dt-bindings: mfd: bd9571mwv: update rohm,bd9571mwv.yaml reference dt-bindings: update Luca Ceresoli's e-mail address dt-bindings: msm: update maintainers list with proper id dt-bindings: vendor-prefixes: document deprecated Atheros dt-bindings: Update QCOM USB subsystem maintainer information commit 1bc27dec7ea5ac01f126734b723acc5f3cbe5713 Merge: d56fd98612aef 67e59f8d019fb Author: Linus Torvalds Date: Fri Jun 10 11:49:27 2022 -0700 Merge tag 'pm-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix an intel_idle issue introduced during the 5.16 development cycle and two recent regressions in the system reboot/poweroff code. Specifics: - Fix CPUIDLE_FLAG_IRQ_ENABLE handling in intel_idle (Peter Zijlstra) - Allow all platforms to use the global poweroff handler and make non-syscall poweroff code paths work again (Dmitry Osipenko)" * tag 'pm-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE kernel/reboot: Fix powering off using a non-syscall code paths kernel/reboot: Use static handler for register_platform_power_off() commit d56fd98612aef73f85ec0c44e86fe04a9d3325ee Author: David Howells Date: Fri Jun 10 19:35:55 2022 +0100 certs: Convert spaces in certs/Makefile to a tab There's a rule in certs/Makefile for which the command begins with eight spaces. This results in: ../certs/Makefile:21: FORCE prerequisite is missing ../certs/Makefile:21: *** missing separator. Stop. Fix this by turning the spaces into a tab. Fixes: addf466389d9 ("certs: Check that builtin blacklist hashes are valid") Signed-off-by: David Howells Reviewed-by: Jarkko Sakkinen Reviewed-by: Mickaël Salaün cc: keyrings@vger.kernel.org Link: https://lore.kernel.org/r/486b1b80-9932-aab6-138d-434c541c934a@digikod.net/ # v1 Signed-off-by: Linus Torvalds commit 0b9431c8221cfe73d06f6b9cd37b813fa52be8ce Author: Andre Przywara Date: Thu Jun 9 17:27:29 2022 +0100 dt-bindings: display: arm,malidp: remove bogus RQOS property As Liviu pointed out, the arm,malidp-arqos-high-level property mentioned in the original .txt binding was a mistake, and arm,malidp-arqos-value needs to take its place. The binding commit ce6eb0253cba ("dt/bindings: display: Add optional property node define for Mali DP500") mentions the right name in the commit message, but has the wrong name in the diff. Commit d298e6a27a81 ("drm/arm/mali-dp: Add display QoS interface configuration for Mali DP500") uses the property in the driver, but uses the shorter name. Remove the wrong property from the binding, and use the proper name in the example. The actual property was already documented properly. Fixes: 2c8b082a3ab1 ("dt-bindings: display: convert Arm Mali-DP to DT schema") Link: https://lore.kernel.org/linux-arm-kernel/YnumGEilUblhBx8E@e110455-lin.cambridge.arm.com/ Signed-off-by: Andre Przywara Reported-by: Liviu Dudau Reviewed-by: Liviu Dudau Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220609162729.1441760-1-andre.przywara@arm.com commit 67e59f8d019fb097f35c82533cc9b27bb392e5b1 Merge: 32d4fd5751ead 2b8c612c6102f Author: Rafael J. Wysocki Date: Fri Jun 10 20:24:10 2022 +0200 Merge branch 'pm-sysoff' Merge fixes for regressions introduced by the recent rework of the system reboot/poweroff code. * pm-sysoff: kernel/reboot: Fix powering off using a non-syscall code paths kernel/reboot: Use static handler for register_platform_power_off() commit 01aa6cbf3dafadd955d6e55eaa001861e8d356ab Author: Rob Herring Date: Mon Jun 6 16:22:39 2022 -0500 dt-bindings: pinctrl: ralink: Fix 'enum' lists with duplicate entries There's no reason to list the same value twice in an 'enum'. This was fixed treewide in commit c3b006819426 ("dt-bindings: Fix 'enum' lists with duplicate entries"), but this one got added in the merge window. A meta-schema change will catch future cases. Signed-off-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220606212239.1360877-1-robh@kernel.org commit fe43c0188911885a70d0dd405f89ca4f1300e7db Merge: 36a2366379719 387c67afccbb2 Author: Linus Torvalds Date: Fri Jun 10 11:14:47 2022 -0700 Merge tag 'docs-5.19-3' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "A few documentation fixes for 5.19, including moving the new HTE docs to a more suitable location, adding loongarch to the features lists, and a couple of typo fixes" * tag 'docs-5.19-3' of git://git.lwn.net/linux: docs: arm: tcm: Fix typo in description of TCM and MMU usage docs: Move the HTE documentation to driver-api/ docs: usb: fix literal block marker in usbmon verification example Documentation/features: Update the arch support status files commit 36a236637971923c85dae45cb8638eb47ae62954 Merge: ad6e0764988a3 78cdaf3f4257a Author: Linus Torvalds Date: Fri Jun 10 11:03:51 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - SME save/restore for EFI fix - incorrect logic for detecting the need for saving/restoring the FFR state. - SME fix for a CPU ID field value. - Sysreg generation awk script fix (comparison operator). - Some typos in documentation or comments and silence a sparse warning (missing prototype). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Add kasan_hw_tags_enable() prototype to silence sparse arm64/sme: Fix EFI save/restore arm64/fpsimd: Fix typo in comment arm64/sysreg: Fix typo in Enum element regex arm64/sme: Fix SVE/SME typo in ABI documentation arm64/sme: Fix tests for 0b1111 value ID registers commit ad6e0764988a388a25323337c8d559fe14b2e6b2 Merge: f7a1d00e749f1 c1c1204c0d0c1 Author: Linus Torvalds Date: Fri Jun 10 10:56:28 2022 -0700 Merge tag 'zonefs-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fixes from Damien Le Moal: - Fix handling of the explicit-open mount option, and in particular the conditions under which this option can be ignored. - Fix a problem with zonefs iomap_begin method, causing a hang in iomap_readahead() when a readahead request reaches the end of a file. * tag 'zonefs-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: fix zonefs_iomap_begin() for reads zonefs: Do not ignore explicit_open with active zone limit zonefs: fix handling of explicit_open option on mount commit f7a1d00e749f1357b48c1e50abf605819c1e8404 Merge: 8f7ac50c97d30 481f7017c37a8 Author: Linus Torvalds Date: Fri Jun 10 10:30:43 2022 -0700 Merge tag 'ata-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fixes from Damien Le Moal: "Several small fixes for rc2: - Remove unused field in struct ata_port (Hannes) - Fix a potential (very unlikely) NULL pointer dereference in ata_host_alloc_pinfo() (Sergey) - Fix a device reference leak in the pata_octeon_cf driver (Miaoqian) - Fixes for handling access to the concurrent positioning ranges log page used with multi-actuator HDDs (Tyler) - Fix the values shown by the pio_mode and dma_mode sysfs device attributes (Sergey) - Update the MAINTAINERS file to add libata sysfs ABI documentation file (Sergey)" * tag 'ata-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: MAINTAINERS: add ATA sysfs file documentation to libata entry ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files libata: fix translation of concurrent positioning ranges libata: fix reading concurrent positioning ranges log ata: pata_octeon_cf: Fix refcount leak in octeon_cf_probe ata: libata-core: fix NULL pointer deref in ata_host_alloc_pinfo() ata: libata: drop 'sas_last_tag' commit 8f7ac50c97d30ae5ae48da3b516510d05a67b9e5 Merge: 8dd77d44795d7 5f3d696eea916 Author: Linus Torvalds Date: Fri Jun 10 10:20:57 2022 -0700 Merge tag 'sound-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of fixes; almost all changes are device-specific small fixes over ASoC, HD-audio and USB-audio. No sign of serious breakage, so far" * tag 'sound-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits) ALSA: hda/realtek: Add quirk for HP Dev One ALSA: hda/realtek - Add HW8326 support ALSA: hda/conexant - Fix loopback issue with CX20632 ALSA: hda: MTL: add HD Audio PCI ID and HDMI codec vendor ID ALSA: usb-audio: Set up (implicit) sync for Saffire 6 ALSA: usb-audio: Skip generic sync EP parse for secondary EP ASoC: wm_adsp: Fix event generation for wm_adsp_fw_put() ASoC: es8328: Fix event generation for deemphasis control ASoC: wm8962: Fix suspend while playing music ASoC: SOF: ipc-msg-injector: Fix reversed if statement ASoC: SOF: ipc-msg-injector: Propagate write errors correctly ASoC: fsl_sai: Add support for i.MX8MN ASoC: SOF: Fix potential NULL pointer dereference ALSA: hda/realtek: Fix for quirk to enable speaker output on the Lenovo Yoga DuetITL 2021 ASoC: cs42l51: Correct minimum value for SX volume control ASoC: cs42l56: Correct typo in minimum level for SX volume controls ASoC: cs42l52: Correct TLV for Bypass Volume ASoC: cs53l30: Correct number of volume levels on SX controls ASoC: cs35l36: Update digital volume TLV ASoC: cs42l52: Fix TLV scales for mixer controls ... commit 8dd77d44795d708f5f4f783b81c5197c5b994d74 Merge: 68171bbd1a9ad 1f192b9e8d8a5 Author: Linus Torvalds Date: Fri Jun 10 10:13:24 2022 -0700 Merge tag 'drm-fixes-2022-06-10' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Not a huge amount here, mainly a bunch of scattered amdgpu fixes, and then some misc panfrost, bridge/panel ones, and one ast fix for multi-monitors. Probably pick up a bit more next week like rc3 often does. amdgpu: - DCN 3.1 golden settings fix - eDP fixes - DMCUB fixes - GFX11 fixes and cleanups - VCN fix for yellow carp - GMC11 fixes - RAS fixes - GPUVM TLB flush fixes - SMU13 fixes - VCN3 AV1 regression fix - VCN2 JPEG fix - Other misc fixes amdkfd: - MMU notifier fix - Support for more GC 10.3.x families - Pinned BO handling fix - Partial migration bug fix panfrost: - fix a use after free ti-sn65dsi83: - fix invalid DT configuration panel: - two self refresh fixes ast: - multiple output fix" * tag 'drm-fixes-2022-06-10' of git://anongit.freedesktop.org/drm/drm: (37 commits) drm/ast: Support multiple outputs drm/amdgpu/mes: only invalid/prime icache when finish loading both pipe MES FWs. drm/amdgpu/jpeg2: Add jpeg vmid update under IB submit drm/amdgpu: always flush the TLB on gfx8 drm/amdgpu: fix limiting AV1 to the first instance on VCN3 drm/amdkfd:Fix fw version for 10.3.6 drm/amdgpu: Add MODE register to wave debug info in gfx11 Revert "drm/amd/display: Pass the new context into disable OTG WA" Revert "drm/amdgpu: Ensure the DMA engine is deactivated during set ups" drm/atomic: Force bridge self-refresh-exit on CRTC switch drm/bridge: analogix_dp: Support PSR-exit to disable transition drm/amdgpu: suppress the compile warning about 64 bit type drm/amd/pm: suppress compile warnings about possible unaligned accesses drm/amdkfd: Fix partial migration bugs drm/amdkfd: add pinned BOs to kfd_bo_list drm/amdgpu: Update PDEs flush TLB if PTB/PDB moved drm/amdgpu: enable tmz by default for GC 10.3.7 drm/amdkfd: Add GC 10.3.6 and 10.3.7 KFD definitions drm/amdkfd: Use mmget_not_zero in MMU notifier drm/amdgpu: Resolve RAS GFX error count issue after cold boot on Arcturus ... commit 68171bbd1a9adaadac0c6a85c8558eaf0b718387 Merge: f2ecc964b9414 bf56a0917fd32 Author: Linus Torvalds Date: Fri Jun 10 10:07:06 2022 -0700 Merge tag 'net-5.19-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Quick follow up, to cleanly fast-forward net again. Current release - new code bugs: - Revert "net/mlx5e: Allow relaxed ordering over VFs" Previous releases - regressions: - seg6: fix seg6_lookup_any_nexthop() to handle VRFs using flowi_l3mdev Misc: - rename TLS_INFO_ZC_SENDFILE to better express the meaning" * tag 'net-5.19-rc2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: net: seg6: fix seg6_lookup_any_nexthop() to handle VRFs using flowi_l3mdev nfp: flower: restructure flow-key for gre+vlan combination nfp: avoid unnecessary check warnings in nfp_app_get_vf_config tls: Rename TLS_INFO_ZC_SENDFILE to TLS_INFO_ZC_TX net/mlx5: fs, fail conflicting actions net/mlx5: Rearm the FW tracer after each tracer event net/mlx5: E-Switch, pair only capable devices net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules Revert "net/mlx5e: Allow relaxed ordering over VFs" MAINTAINERS: adjust MELLANOX ETHERNET INNOVA DRIVERS to TLS support removal commit 78cdaf3f4257ab10a6cec308ed774e7c7f7e5f72 Author: Catalin Marinas Date: Fri Jun 10 18:01:31 2022 +0100 arm64: Add kasan_hw_tags_enable() prototype to silence sparse This function is only called from assembly, no need for a prototype declaration in a header file. In addition, add #ifdef around the function since it is only used when CONFIG_KASAN_HW_TAGS. Signed-off-by: Catalin Marinas Reported-by: kernel test robot commit f2ecc964b9414a407828f9bef242b77483e95a6d Merge: 7d78b7ebdf7da dbac14a5a05ff Author: Linus Torvalds Date: Fri Jun 10 09:57:11 2022 -0700 Merge tag 'for-linus-5.19a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - a small cleanup removing "export" of an __init function - a small series adding a new infrastructure for platform flags - a series adding generic virtio support for Xen guests (frontend side) * tag 'for-linus-5.19a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: unexport __init-annotated xen_xlate_map_ballooned_pages() arm/xen: Assign xen-grant DMA ops for xen-grant DMA devices xen/grant-dma-ops: Retrieve the ID of backend's domain for DT devices xen/grant-dma-iommu: Introduce stub IOMMU driver dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops xen/virtio: Enable restricted memory access using Xen grant mappings xen/grant-dma-ops: Add option to restrict memory access under Xen xen/grants: support allocating consecutive grants arm/xen: Introduce xen_setup_dma_ops() virtio: replace arch_has_restricted_virtio_memory_access() kernel: add platform_has() infrastructure commit 4314f9f4f85832b5082f4e38b07b63b11baa538c Author: Cristian Marussi Date: Wed Jun 8 10:55:28 2022 +0100 firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary Commit b260fccaebdc2 ("firmware: arm_scmi: Add SCMI v3.1 protocol extended names support") moved all the name string buffers to use the extended buffer size of 64 instead of the required 16 bytes. While that should be fine if the firmware terminates the string before 16 bytes, there is possibility of copying random data if the name is not NULL terminated by the firmware. SCMI base protocol agent_name/vendor_id/sub_vendor_id are defined by the specification as NULL-terminated ASCII strings up to 16-bytes in length. The underlying buffers and message descriptors are currently bigger than needed; resize them to fit only the strictly needed 16 bytes to avoid any possible leaks when reading data from the firmware. Change the size argument of strlcpy to use SCMI_SHORT_NAME_MAX_SIZE always when dealing with short domain names, so as to limit the possibility that an ill-formed non-NULL terminated short reply from the SCMI platform firmware can leak stale content laying in the underlying transport shared memory area. While at that, convert all strings handling routines to use the preferred strscpy. Link: https://lore.kernel.org/r/20220608095530.497879-1-cristian.marussi@arm.com Fixes: b260fccaebdc2 ("firmware: arm_scmi: Add SCMI v3.1 protocol extended names support") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7d78b7ebdf7dac762c3807274182b7c582be7937 Merge: 874c8ca1e60b2 41e4564002128 Author: Linus Torvalds Date: Fri Jun 10 09:52:11 2022 -0700 Merge tag 'mips-fixes_5.19_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fix from Thomas Bogendoerfer: "Build fix for Loongson-3" * tag 'mips-fixes_5.19_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. commit 8e60294c8012fe4c66c3590376670998902fd822 Author: Cristian Marussi Date: Wed Jun 8 17:40:51 2022 +0100 firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported Avoid to invoke SENSOR_AXIS_NAME_GET on sensors that have not declared at least one of their axes as supporting extended names. Since the returned list of axes supporting extended names is not necessarily comprising all the existing axes of the specified sensor, take care also to properly pick the axis descriptor from the ID embedded in the response. Link: https://lore.kernel.org/r/20220608164051.2326087-1-cristian.marussi@arm.com Fixes: 802b0bed011e ("firmware: arm_scmi: Add SCMI v3.1 SENSOR_AXIS_NAME_GET support") Cc: Peter Hilber Cc: Sudeep Holla Reviewed-by: Peter Hilber Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 566d3c57eb526f32951af15866086e236ce1fc8a Author: Damien Le Moal Date: Wed Jun 8 10:13:02 2022 +0900 scsi: scsi_debug: Fix zone transition to full condition When a write command to a sequential write required or sequential write preferred zone result in the zone write pointer reaching the end of the zone, the zone condition must be set to full AND the number of implicitly or explicitly open zones updated to have a correct accounting for zone resources. However, the function zbc_inc_wp() only sets the zone condition to full without updating the open zone counters, resulting in a zone state machine breakage. Introduce the helper function zbc_set_zone_full() and use it in zbc_inc_wp() to correctly transition zones to the full condition. Link: https://lore.kernel.org/r/20220608011302.92061-1-damien.lemoal@opensource.wdc.com Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands") Reviewed-by: Niklas Cassel Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 2e990e63220bb01e2755b55b93878ce7c8cbe747 Author: Mark Brown Date: Thu Jun 2 14:41:32 2022 +0200 arm64/sme: Fix EFI save/restore The EFI save/restore code is confused. When saving the check for saving FFR is inverted due to confusion with the streaming mode check, and when restoring we check if we need to restore FFR by checking the percpu efi_sm_state without the required wrapper rather than based on the combination of FA64 support and streaming mode. Fixes: e0838f6373e5 ("arm64/sme: Save and restore streaming mode over EFI runtime calls") Reported-by: kernel test robot Reviewed-by: Catalin Marinas Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220602124132.3528951-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit bb314511b6dc0f863d6fb31ebae912ee96af7805 Author: Xiang wangx Date: Fri Jun 10 15:05:43 2022 +0800 arm64/fpsimd: Fix typo in comment Delete the redundant word 'in'. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20220610070543.59338-1-wangxiang@cdjrlc.com Signed-off-by: Catalin Marinas commit ce253b8573ce3de1278513395f07118650a49e39 Author: Alejandro Tafalla Date: Thu Jun 9 22:42:18 2022 +0200 arm64/sysreg: Fix typo in Enum element regex In the awk script, there was a typo with the comparison operator when checking if the matched pattern is inside an Enum block. This prevented the generation of the whole sysreg-defs.h header. Fixes: 66847e0618d7 ("arm64: Add sysreg header generation scripting") Signed-off-by: Alejandro Tafalla Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220609204220.12112-1-atafalla@dnyon.com Signed-off-by: Catalin Marinas commit 0a35780c755ccec097d15c6b4ff8b246a89f1689 Author: Brad Bishop Date: Tue May 24 16:51:42 2022 -0500 eeprom: at25: Split reads into chunks and cap write size Make use of spi_max_transfer_size to avoid requesting transfers that are too large for some spi controllers. Signed-off-by: Brad Bishop Signed-off-by: Eddie James Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20220524215142.60047-1-eajames@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 928ea98252ad75118950941683893cf904541da9 Author: Shin'ichiro Kawasaki Date: Wed Jun 1 19:51:59 2022 +0900 bus: fsl-mc-bus: fix KASAN use-after-free in fsl_mc_bus_remove() In fsl_mc_bus_remove(), mc->root_mc_bus_dev->mc_io is passed to fsl_destroy_mc_io(). However, mc->root_mc_bus_dev is already freed in fsl_mc_device_remove(). Then reference to mc->root_mc_bus_dev->mc_io triggers KASAN use-after-free. To avoid the use-after-free, keep the reference to mc->root_mc_bus_dev->mc_io in a local variable and pass to fsl_destroy_mc_io(). This patch needs rework to apply to kernels older than v5.15. Fixes: f93627146f0e ("staging: fsl-mc: fix asymmetry in destroy of mc_io") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20220601105159.87752-1-shinichiro.kawasaki@wdc.com Signed-off-by: Greg Kroah-Hartman commit 3ed8c7d39cfef831fe508fc1308f146912fa72e6 Author: Alexander Usyskin Date: Mon Jun 6 17:42:25 2022 +0300 mei: me: add raptor lake point S DID Add Raptor (Point) Lake S device id. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20220606144225.282375-3-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 68553650bc9c57c7e530c84e5b2945e9dfe1a560 Author: Alexander Usyskin Date: Mon Jun 6 17:42:24 2022 +0300 mei: hbm: drop capability response on early shutdown Drop HBM responses also in the early shutdown phase where the usual traffic is allowed. Extend the rule that drop HBM responses received during the shutdown phase by also in MEI_DEV_POWERING_DOWN state. This resolves the stall if the driver is stopping in the middle of the link initialization or link reset. Drop the capabilities response on early shutdown. Fixes: 6d7163f2c49f ("mei: hbm: drop hbm responses on early shutdown") Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20220606144225.282375-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 9f4639373e6756e1ccf0029f861f1061db3c3616 Author: Alexander Usyskin Date: Mon Jun 6 17:42:23 2022 +0300 mei: me: set internal pg flag to off on hardware reset Link reset flow is always performed in the runtime resumed state. The internal PG state may be left as ON after the suspend and will not be updated upon the resume if the D0i3 is not supported. Ensure that the internal PG state is set to the right value on the flow entrance in case the firmware does not support D0i3. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20220606144225.282375-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit cd756dafd86ee3a4969906086f3c2537e0c6d9d0 Author: Peter Robinson Date: Mon Jun 6 14:22:00 2022 +0100 staging: Also remove the Unisys visorbus.h The commit that removed the Unisys s-Par and visorbus drivers left around the include/linux/visorbus.h file mentioned in the MAINTAINERS entry, we can also remove that too. Fixes: e5f45b011e4a ("staging: Remove the drivers for the Unisys s-Par") Reviewed-by: Fabio M. De Francesco Signed-off-by: Peter Robinson Link: https://lore.kernel.org/r/20220606132200.2873243-1-pbrobinson@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1c245358ce0b13669f6d1625f7a4e05c41f28980 Author: Miaoqian Lin Date: Wed Jun 1 16:30:26 2022 +0400 misc: atmel-ssc: Fix IRQ check in ssc_probe platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91") Reviewed-by: Claudiu Beznea Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220601123026.7119-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6497e7776441e0567c02b9c12b133d2ba51918df Author: Shreenidhi Shedi Date: Fri Jun 3 18:30:40 2022 +0530 char: lp: remove redundant initialization of err err is getting assigned with an appropriate value before returning, hence this initialization is unnecessary. Signed-off-by: Shreenidhi Shedi Link: https://lore.kernel.org/r/20220603130040.601673-2-sshedi@vmware.com Signed-off-by: Greg Kroah-Hartman commit bd476c1306ea989d6d9eb65295572e98d93edeb6 Author: Nathan Chancellor Date: Mon May 23 08:05:22 2022 -0700 misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw() Clang warns: drivers/misc/cardreader/rts5261.c:406:13: error: variable 'setting_reg2' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] } else if (efuse_valid == 0) { ^~~~~~~~~~~~~~~~ drivers/misc/cardreader/rts5261.c:412:30: note: uninitialized use occurs here pci_read_config_dword(pdev, setting_reg2, &lval2); ^~~~~~~~~~~~ efuse_valid == 1 is not a valid value so just return early from the function to avoid using setting_reg2 uninitialized. Fixes: b1c5f3085149 ("misc: rtsx: add rts5261 efuse function") Reported-by: Dan Carpenter Reported-by: kernel test robot Reported-by: Tom Rix Suggested-by: Ricky WU Acked-by: Arnd Bergmann Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220523150521.2947108-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 242439f7e279d86b3f73b5de724bc67b2f8aeb07 Author: Ian Abbott Date: Tue Jun 7 18:18:19 2022 +0100 comedi: vmk80xx: fix expression for tx buffer size The expression for setting the size of the allocated bulk TX buffer (`devpriv->usb_tx_buf`) is calling `usb_endpoint_maxp(devpriv->ep_rx)`, which is using the wrong endpoint (should be `devpriv->ep_tx`). Fix it. Fixes: a23461c47482 ("comedi: vmk80xx: fix transfer-buffer overflow") Cc: Johan Hovold Cc: stable@vger.kernel.org # 4.9+ Reviewed-by: Johan Hovold Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20220607171819.4121-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 0698f0209d8032e8869525aeb68f65ee7fde12ad Author: Linyu Yuan Date: Fri Jun 10 20:17:58 2022 +0800 usb: gadget: f_fs: change ep->ep safe in ffs_epfile_io() In ffs_epfile_io(), when read/write data in blocking mode, it will wait the completion in interruptible mode, if task receive a signal, it will terminate the wait, at same time, if function unbind occurs, ffs_func_unbind() will kfree all eps, ffs_epfile_io() still try to dequeue request by dereferencing ep which may become invalid. Fix it by add ep spinlock and will not dereference ep if it is not valid. Cc: # 5.15 Reported-by: Michael Wu Tested-by: Michael Wu Reviewed-by: John Keeping Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1654863478-26228-3-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit fb1f16d74e263baa4ad11e31e28b68f144aa55ed Author: Linyu Yuan Date: Fri Jun 10 20:17:57 2022 +0800 usb: gadget: f_fs: change ep->status safe in ffs_epfile_io() If a task read/write data in blocking mode, it will wait the completion in ffs_epfile_io(), if function unbind occurs, ffs_func_unbind() will kfree ffs ep, once the task wake up, it still dereference the ffs ep to obtain the request status. Fix it by moving the request status to io_data which is stack-safe. Cc: # 5.15 Reported-by: Michael Wu Tested-by: Michael Wu Reviewed-by: John Keeping Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1654863478-26228-2-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 77006f6edc0e0f58617eb25e53731f78641e820d Author: Serge Semin Date: Fri Jun 10 13:45:00 2022 +0300 gpio: dwapb: Don't print error on -EPROBE_DEFER Currently if the APB or Debounce clocks aren't yet ready to be requested the DW GPIO driver will correctly handle that by deferring the probe procedure, but the error is still printed to the system log. It needlessly pollutes the log since there was no real error but a request to postpone the clock request procedure since the clocks subsystem hasn't been fully initialized yet. Let's fix that by using the dev_err_probe method to print the APB/clock request error status. It will correctly handle the deferred probe situation and print the error if it actually happens. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 802dcafc420af536fcde1b44ac51ca211f4ec673 Author: Mathias Nyman Date: Fri Jun 10 14:53:38 2022 +0300 xhci: Fix null pointer dereference in resume if xhci has only one roothub In the re-init path xhci_resume() passes 'hcd->primary_hcd' to hci_init(), however this field isn't initialized by __usb_create_hcd() for a HCD without secondary controller. xhci_resume() is called once per xHC device, not per hcd, so the extra checking for primary hcd can be removed. Fixes: e0fe986972f5 ("usb: host: xhci-plat: prepare operation w/o shared hcd") Reported-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220610115338.863152-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit be03b0651ffd8bab69dfd574c6818b446c0753ce Author: Ilpo Järvinen Date: Fri May 20 13:35:41 2022 +0300 serial: 8250: Store to lsr_save_flags after lsr read Not all LSR register flags are preserved across reads. Therefore, LSR readers must store the non-preserved bits into lsr_save_flags. This fix was initially mixed into feature commit f6f586102add ("serial: 8250: Handle UART without interrupt on TEMT using em485"). However, that feature change had a flaw and it was reverted to make room for simpler approach providing the same feature. The embedded fix got reverted with the feature change. Re-add the lsr_save_flags fix and properly mark it's a fix. Link: https://lore.kernel.org/all/1d6c31d-d194-9e6a-ddf9-5f29af829f3@linux.intel.com/T/#m1737eef986bd20cf19593e344cebd7b0244945fc Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Cc: stable Acked-by: Uwe Kleine-König Signed-off-by: Uwe Kleine-König Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/f4d774be-1437-a550-8334-19d8722ab98c@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 499e13aac6c762e1e828172b0f0f5275651d6512 Author: Vincent Whitchurch Date: Thu Jun 9 16:17:04 2022 +0200 tty: goldfish: Fix free_irq() on remove Pass the correct dev_id to free_irq() to fix this splat when the driver is unbound: WARNING: CPU: 0 PID: 30 at kernel/irq/manage.c:1895 free_irq Trying to free already-free IRQ 65 Call Trace: warn_slowpath_fmt free_irq goldfish_tty_remove platform_remove device_remove device_release_driver_internal device_driver_detach unbind_store drv_attr_store ... Fixes: 465893e18878e119 ("tty: goldfish: support platform_device with id -1") Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220609141704.1080024-1-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman commit 654a8d6c93e77ecff2256ca3ab2cd98967821f0a Author: Vijaya Krishna Nivarthi Date: Wed Jun 8 00:22:45 2022 +0530 tty: serial: qcom-geni-serial: Implement start_rx callback In suspend sequence stop_rx will be performed only if implementation for start_rx callback is present. Set qcom_geni_serial_start_rx as callback for start_rx so that stop_rx is performed. Fixes: c9d2325cdb92 ("serial: core: Do stop_rx in suspend path for console if console_suspend is disabled") Reviewed-by: Douglas Anderson Signed-off-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/1654627965-1461-3-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Greg Kroah-Hartman commit cfab87c2c2715763dc7e43d9968bdaa01cde4bc3 Author: Vijaya Krishna Nivarthi Date: Wed Jun 8 00:22:44 2022 +0530 serial: core: Introduce callback for start_rx and do stop_rx in suspend only if this callback implementation is present. In suspend sequence there is a need to perform stop_rx during suspend sequence to prevent any asynchronous data over rx line. However this can cause problem to drivers which dont do re-start_rx during set_termios. Add new callback start_rx and perform stop_rx only when implementation of start_rx is present. Also add call to start_rx in resume sequence so that drivers who come across this problem can make use of this framework. Fixes: c9d2325cdb92 ("serial: core: Do stop_rx in suspend path for console if console_suspend is disabled") Reviewed-by: Douglas Anderson Signed-off-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/1654627965-1461-2-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Greg Kroah-Hartman commit e74024b2eccbb784824a0f9feaeaaa3b47514b79 Author: Tony Lindgren Date: Mon May 23 18:50:52 2022 +0300 tty: n_gsm: Debug output allocation must use GFP_ATOMIC Dan Carpenter reported the following Smatch warning: drivers/tty/n_gsm.c:720 gsm_data_kick() warn: sleeping in atomic context This is because gsm_control_message() is holding a spin lock so gsm_hex_dump_bytes() needs to use GFP_ATOMIC instead of GFP_KERNEL. Fixes: 925ea0fa5277 ("tty: n_gsm: Fix packet data hex dump output") Cc: stable Reported-by: Dan Carpenter Reviewed-by: Gregory CLEMENT Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220523155052.57129-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 81b0d0e4f811553cbe2d58c8a495c124fb626432 Author: Christian König Date: Fri Jun 3 12:43:50 2022 +0200 drm/ttm: fix missing NULL check in ttm_device_swapout Resources about to be destructed are not tied to BOs any more. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Fixes: 6a9b02899402 ("drm/ttm: move the LRU into resource handling v4") Link: https://patchwork.freedesktop.org/patch/msgid/20220603104604.456991-1-christian.koenig@amd.com commit e052a478a7daeca67664f7addd308ff51dd40654 Author: Jason A. Donenfeld Date: Wed Jun 8 10:31:25 2022 +0200 random: remove rng_has_arch_random() With arch randomness being used by every distro and enabled in defconfigs, the distinction between rng_has_arch_random() and rng_is_initialized() is now rather small. In fact, the places where they differ are now places where paranoid users and system builders really don't want arch randomness to be used, in which case we should respect that choice, or places where arch randomness is known to be broken, in which case that choice is all the more important. So this commit just removes the function and its one user. Reviewed-by: Petr Mladek # for vsprintf.c Signed-off-by: Jason A. Donenfeld commit 846bb97e131d7938847963cca00657c995b1fce1 Author: Jason A. Donenfeld Date: Sun Jun 5 18:30:46 2022 +0200 random: credit cpu and bootloader seeds by default This commit changes the default Kconfig values of RANDOM_TRUST_CPU and RANDOM_TRUST_BOOTLOADER to be Y by default. It does not change any existing configs or change any kernel behavior. The reason for this is several fold. As background, I recently had an email thread with the kernel maintainers of Fedora/RHEL, Debian, Ubuntu, Gentoo, Arch, NixOS, Alpine, SUSE, and Void as recipients. I noted that some distros trust RDRAND, some trust EFI, and some trust both, and I asked why or why not. There wasn't really much of a "debate" but rather an interesting discussion of what the historical reasons have been for this, and it came up that some distros just missed the introduction of the bootloader Kconfig knob, while another didn't want to enable it until there was a boot time switch to turn it off for more concerned users (which has since been added). The result of the rather uneventful discussion is that every major Linux distro enables these two options by default. While I didn't have really too strong of an opinion going into this thread -- and I mostly wanted to learn what the distros' thinking was one way or another -- ultimately I think their choice was a decent enough one for a default option (which can be disabled at boot time). I'll try to summarize the pros and cons: Pros: - The RNG machinery gets initialized super quickly, and there's no messing around with subsequent blocking behavior. - The bootloader mechanism is used by kexec in order for the prior kernel to initialize the RNG of the next kernel, which increases the entropy available to early boot daemons of the next kernel. - Previous objections related to backdoors centered around Dual_EC_DRBG-like kleptographic systems, in which observing some amount of the output stream enables an adversary holding the right key to determine the entire output stream. This used to be a partially justified concern, because RDRAND output was mixed into the output stream in varying ways, some of which may have lacked pre-image resistance (e.g. XOR or an LFSR). But this is no longer the case. Now, all usage of RDRAND and bootloader seeds go through a cryptographic hash function. This means that the CPU would have to compute a hash pre-image, which is not considered to be feasible (otherwise the hash function would be terribly broken). - More generally, if the CPU is backdoored, the RNG is probably not the realistic vector of choice for an attacker. - These CPU or bootloader seeds are far from being the only source of entropy. Rather, there is generally a pretty huge amount of entropy, not all of which is credited, especially on CPUs that support instructions like RDRAND. In other words, assuming RDRAND outputs all zeros, an attacker would *still* have to accurately model every single other entropy source also in use. - The RNG now reseeds itself quite rapidly during boot, starting at 2 seconds, then 4, then 8, then 16, and so forth, so that other sources of entropy get used without much delay. - Paranoid users can set random.trust_{cpu,bootloader}=no in the kernel command line, and paranoid system builders can set the Kconfig options to N, so there's no reduction or restriction of optionality. - It's a practical default. - All the distros have it set this way. Microsoft and Apple trust it too. Bandwagon. Cons: - RDRAND *could* still be backdoored with something like a fixed key or limited space serial number seed or another indexable scheme like that. (However, it's hard to imagine threat models where the CPU is backdoored like this, yet people are still okay making *any* computations with it or connecting it to networks, etc.) - RDRAND *could* be defective, rather than backdoored, and produce garbage that is in one way or another insufficient for crypto. - Suggesting a *reduction* in paranoia, as this commit effectively does, may cause some to question my personal integrity as a "security person". - Bootloader seeds and RDRAND are generally very difficult if not all together impossible to audit. Keep in mind that this doesn't actually change any behavior. This is just a change in the default Kconfig value. The distros already are shipping kernels that set things this way. Ard made an additional argument in [1]: We're at the mercy of firmware and micro-architecture anyway, given that we are also relying on it to ensure that every instruction in the kernel's executable image has been faithfully copied to memory, and that the CPU implements those instructions as documented. So I don't think firmware or ISA bugs related to RNGs deserve special treatment - if they are broken, we should quirk around them like we usually do. So enabling these by default is a step in the right direction IMHO. In [2], Phil pointed out that having this disabled masked a bug that CI otherwise would have caught: A clean 5.15.45 boots cleanly, whereas a downstream kernel shows the static key warning (but it does go on to boot). The significant difference is that our defconfigs set CONFIG_RANDOM_TRUST_BOOTLOADER=y defining that on top of multi_v7_defconfig demonstrates the issue on a clean 5.15.45. Conversely, not setting that option in a downstream kernel build avoids the warning [1] https://lore.kernel.org/lkml/CAMj1kXGi+ieviFjXv9zQBSaGyyzeGW_VpMpTLJK8PJb2QHEQ-w@mail.gmail.com/ [2] https://lore.kernel.org/lkml/c47c42e3-1d56-5859-a6ad-976a1a3381c6@raspberrypi.com/ Cc: Theodore Ts'o Reviewed-by: Ard Biesheuvel Signed-off-by: Jason A. Donenfeld commit 60e5b2886b92afa9e7af56bba7f5fa5f057e1e97 Author: Jason A. Donenfeld Date: Tue Jun 7 17:28:06 2022 +0200 random: do not use jump labels before they are initialized Stephen reported that a static key warning splat appears during early boot on systems that credit randomness from device trees that contain an "rng-seed" property, because because setup_machine_fdt() is called before jump_label_init() during setup_arch(): static_key_enable_cpuslocked(): static key '0xffffffe51c6fcfc0' used before call to jump_label_init() WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:166 static_key_enable_cpuslocked+0xb0/0xb8 Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0+ #224 44b43e377bfc84bc99bb5ab885ff694984ee09ff pstate: 600001c9 (nZCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : static_key_enable_cpuslocked+0xb0/0xb8 lr : static_key_enable_cpuslocked+0xb0/0xb8 sp : ffffffe51c393cf0 x29: ffffffe51c393cf0 x28: 000000008185054c x27: 00000000f1042f10 x26: 0000000000000000 x25: 00000000f10302b2 x24: 0000002513200000 x23: 0000002513200000 x22: ffffffe51c1c9000 x21: fffffffdfdc00000 x20: ffffffe51c2f0831 x19: ffffffe51c6fcfc0 x18: 00000000ffff1020 x17: 00000000e1e2ac90 x16: 00000000000000e0 x15: ffffffe51b710708 x14: 0000000000000066 x13: 0000000000000018 x12: 0000000000000000 x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 x8 : 0000000000000000 x7 : 61632065726f6665 x6 : 6220646573752027 x5 : ffffffe51c641d25 x4 : ffffffe51c13142c x3 : ffff0a00ffffff05 x2 : 40000000ffffe003 x1 : 00000000000001c0 x0 : 0000000000000065 Call trace: static_key_enable_cpuslocked+0xb0/0xb8 static_key_enable+0x2c/0x40 crng_set_ready+0x24/0x30 execute_in_process_context+0x80/0x90 _credit_init_bits+0x100/0x154 add_bootloader_randomness+0x64/0x78 early_init_dt_scan_chosen+0x140/0x184 early_init_dt_scan_nodes+0x28/0x4c early_init_dt_scan+0x40/0x44 setup_machine_fdt+0x7c/0x120 setup_arch+0x74/0x1d8 start_kernel+0x84/0x44c __primary_switched+0xc0/0xc8 ---[ end trace 0000000000000000 ]--- random: crng init done Machine model: Google Lazor (rev1 - 2) with LTE A trivial fix went in to address this on arm64, 73e2d827a501 ("arm64: Initialize jump labels before setup_machine_fdt()"). I wrote patches as well for arm32 and risc-v. But still patches are needed on xtensa, powerpc, arc, and mips. So that's 7 platforms where things aren't quite right. This sort of points to larger issues that might need a larger solution. Instead, this commit just defers setting the static branch until later in the boot process. random_init() is called after jump_label_init() has been called, and so is always a safe place from which to adjust the static branch. Fixes: f5bda35fba61 ("random: use static branch for crng_ready()") Reported-by: Stephen Boyd Reported-by: Phil Elwell Tested-by: Phil Elwell Reviewed-by: Ard Biesheuvel Cc: Catalin Marinas Cc: Russell King Cc: Arnd Bergmann Signed-off-by: Jason A. Donenfeld commit 77fc95f8c0dc9e1f8e620ec14d2fb65028fb7adc Author: Jason A. Donenfeld Date: Tue Jun 7 17:04:38 2022 +0200 random: account for arch randomness in bits Rather than accounting in bytes and multiplying (shifting), we can just account in bits and avoid the shift. The main motivation for this is there are other patches in flux that expand this code a bit, and avoiding the duplication of "* 8" everywhere makes things a bit clearer. Cc: stable@vger.kernel.org Fixes: 12e45a2a6308 ("random: credit architectural init the exact amount") Signed-off-by: Jason A. Donenfeld commit 39e0f991a62ed5efabd20711a7b6e7da92603170 Author: Jason A. Donenfeld Date: Tue Jun 7 17:00:16 2022 +0200 random: mark bootloader randomness code as __init add_bootloader_randomness() and the variables it touches are only used during __init and not after, so mark these as __init. At the same time, unexport this, since it's only called by other __init code that's built-in. Cc: stable@vger.kernel.org Fixes: 428826f5358c ("fdt: add support for rng-seed") Signed-off-by: Jason A. Donenfeld commit 8bd6b8c4b1009d7d2662138d6bdc6fe58a9274c5 Author: Stephen Rothwell Date: Tue Apr 26 15:27:39 2022 +1000 USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present" Today's linux-next merge of the extcon tree got a conflict in: drivers/usb/dwc3/drd.c between commit: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") from the usb tree and commit: 88490c7f43c4 ("extcon: Fix extcon_get_extcon_dev() error handling") from the extcon tree. I fixed it up (the former moved the code modified by the latter, so I used the former version of this files and added the following merge fix patch) and can carry the fix as necessary. Signed-off-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220426152739.62f6836e@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman commit 5c7578c39c3fffe85b7d15ca1cf8cf7ac38ec0c1 Author: Jing Leng Date: Thu Jun 9 10:11:34 2022 +0800 usb: cdnsp: Fixed setting last_trb incorrectly When ZLP occurs in bulk transmission, currently cdnsp will set last_trb for the last two TRBs, it will trigger an error "ERROR Transfer event TRB DMA ptr not part of current TD ...". Fixes: e913aada0683 ("usb: cdnsp: Fixed issue with ZLP") Cc: stable Acked-by: Pawel Laszczak Signed-off-by: Jing Leng Link: https://lore.kernel.org/r/20220609021134.1606-1-3090101217@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit b337af3a4d6147000b7ca6b3438bf5c820849b37 Author: Marian Postevca Date: Fri Jun 3 18:34:59 2022 +0300 usb: gadget: u_ether: fix regression in setting fixed MAC address In systemd systems setting a fixed MAC address through the "dev_addr" module argument fails systematically. When checking the MAC address after the interface is created it always has the same but different MAC address to the one supplied as argument. This is partially caused by systemd which by default will set an internally generated permanent MAC address for interfaces that are marked as having a randomly generated address. Commit 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in setting MAC address in setup phase") didn't take into account the fact that the interface must be marked as having a set MAC address when it's set as module argument. Fixed by marking the interface with NET_ADDR_SET when the "dev_addr" module argument is supplied. Fixes: 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in setting MAC address in setup phase") Cc: stable@vger.kernel.org Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20220603153459.32722-1-posteuca@mutex.one Signed-off-by: Greg Kroah-Hartman commit 4757c9ade34178b351580133771f510b5ffcf9c8 Author: Miaoqian Lin Date: Fri Jun 3 18:02:44 2022 +0400 usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. of_node_put() will check NULL pointer. Fixes: 24a28e428351 ("USB: gadget driver for LPC32xx") Cc: stable Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220603140246.64529-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3755278f078460b021cd0384562977bf2039a57a Author: Miaoqian Lin Date: Mon May 30 12:54:12 2022 +0400 usb: dwc2: Fix memory leak in dwc2_hcd_init usb_create_hcd will alloc memory for hcd, and we should call usb_put_hcd to free it when platform_get_resource() fails to prevent memory leak. goto error2 label instead error1 to fix this. Fixes: 856e6e8e0f93 ("usb: dwc2: check return value after calling platform_get_resource()") Cc: stable Acked-by: Minas Harutyunyan Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220530085413.44068-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7ddda2614d62ef7fdef7fd85f5151cdf665b22d8 Author: Stephan Gerhold Date: Sat May 28 19:09:13 2022 +0200 usb: dwc3: pci: Restore line lost in merge conflict resolution Commit 582ab24e096f ("usb: dwc3: pci: Set "linux,phy_charger_detect" property on some Bay Trail boards") added a new swnode similar to the existing ones for boards where the PHY handles charger detection. Unfortunately, the "linux,sysdev_is_parent" property got lost in the merge conflict resolution of commit ca9400ef7f67 ("Merge 5.17-rc6 into usb-next"). Now dwc3_pci_intel_phy_charger_detect_properties is the only swnode in dwc3-pci that is missing "linux,sysdev_is_parent". It does not seem to cause any obvious functional issues, but it's certainly unintended so restore the line to make the properties consistent again. Fixes: ca9400ef7f67 ("Merge 5.17-rc6 into usb-next") Cc: stable@vger.kernel.org Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20220528170913.9240-1-stephan@gerhold.net Signed-off-by: Greg Kroah-Hartman commit 9c1e916960c1192e746bf615e4dae25423473a64 Author: Wesley Cheng Date: Mon May 23 14:39:48 2022 -0700 usb: dwc3: gadget: Fix IN endpoint max packet size allocation The current logic to assign the max packet limit for IN endpoints attempts to take the default HW value and apply the optimal endpoint settings based on it. However, if the default value reports a TxFIFO size large enough for only one max packet, it will divide the value and assign a smaller ep max packet limit. For example, if the default TxFIFO size fits 1024B, current logic will assign 1024/3 = 341B to ep max packet size. If function drivers attempt to request for an endpoint with a wMaxPacketSize of 1024B (SS BULK max packet size) then it will fail, as the gadget is unable to find an endpoint which can fit the requested size. Functionally, if the TxFIFO has enough space to fit one max packet, it will be sufficient, at least when initializing the endpoints. Fixes: d94ea5319813 ("usb: dwc3: gadget: Properly set maxpacket limit") Cc: stable Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220523213948.22142-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 9b29b6b20376ab64e1b043df6301d8a92378e631 Author: Jason A. Donenfeld Date: Tue Jun 7 09:44:07 2022 +0200 random: avoid checking crng_ready() twice in random_init() The current flow expands to: if (crng_ready()) ... else if (...) if (!crng_ready()) ... The second crng_ready() call is redundant, but can't so easily be optimized out by the compiler. This commit simplifies that to: if (crng_ready() ... else if (...) ... Fixes: 560181c27b58 ("random: move initialization functions out of hot pages") Cc: stable@vger.kernel.org Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 656c5ba50b7172a0ea25dc1b37606bd51d01fe8d Author: Saurabh Sengar Date: Thu Jun 9 10:16:36 2022 -0700 Drivers: hv: vmbus: Release cpu lock in error case In case of invalid sub channel, release cpu lock before returning. Fixes: a949e86c0d780 ("Drivers: hv: vmbus: Resolve race between init_vp_index() and CPU hotplug") Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1654794996-13244-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 552ca27929ab28b341ae9b2629f0de3a84c98ee8 Author: Alexander Stein Date: Tue May 10 07:46:12 2022 +0200 ARM: dts: imx7: Move hsic_phy power domain to HSIC PHY node Move the power domain to its actual user. This keeps the power domain enabled even when the USB host is runtime suspended. This is necessary to detect any downstream events, like device attach. Fixes: 02f8eb40ef7b ("ARM: dts: imx7s: Add power domain for imx7d HSIC") Suggested-by: Jun Li Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1d9e615f1ab34c690d25b8742abe423219e5d3af Merge: f2906aa863381 158f7585bfcea Author: Greg Kroah-Hartman Date: Fri Jun 10 10:27:30 2022 +0200 Merge tag 'usb-serial-5.19-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.19-rc2 Here are some new device ids for a modem and an Edgeport device. All have been in linux-next with no reported issues. * tag 'usb-serial-5.19-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add support for Cinterion MV31 with new baseline USB: serial: io_ti: add Agilent E5805A support commit b2e6b3d9bbb0a59ba7c710cc06e44cc548301f5f Author: Soham Sen Date: Thu Jun 9 23:49:20 2022 +0530 ALSA: hda/realtek: Add mute LED quirk for HP Omen laptop The HP Omen 15 laptop needs a quirk to toggle the mute LED. It already is implemented for a different variant of the HP Omen laptop so a fixup entry is needed for this variant. Signed-off-by: Soham Sen Cc: Link: https://lore.kernel.org/r/20220609181919.45535-1-contact@sohamsen.me Signed-off-by: Takashi Iwai commit 6fac824f40987a54a08dfbcc36145869d02e45b1 Author: Jiaxun Yang Date: Thu Jun 9 18:52:41 2022 +0100 irqchip/loongson-liointc: Use architecture register to get coreid fa84f89395e0 ("irqchip/loongson-liointc: Fix build error for LoongArch") replaced get_ebase_cpunum with physical processor id from SMP facilities. However that breaks MIPS non-SMP build and makes booting from other cores inpossible on non-SMP kernel. Thus we revert get_ebase_cpunum back and use get_csr_cpuid for LoongArch. Fixes: fa84f89395e0 ("irqchip/loongson-liointc: Fix build error for LoongArch") Signed-off-by: Jiaxun Yang Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609175242.977-1-jiaxun.yang@flygoat.com commit 90f4b5499cdd94be3c1e856375ecd7d5f9c4cecc Author: Ping-Ke Shih Date: Wed Jun 8 10:03:12 2022 +0800 rtw88: 8821c: fix access const table of channel parameters We would like to make chip_info table const, but 8821c uses one field as a variable, and causes core dump. To fix this, move the field to another struct that can be read and written. BUG: unable to handle page fault for address: ffffffffc09f52f4 PGD 5b5215067 P4D 5b5215067 PUD 5b5217067 PMD 111f61067 PTE 8000000111e07161 Oops: 0003 [#1] PREEMPT SMP NOPTI CPU: 6 PID: 436 Comm: NetworkManager Not tainted 5.18.0-rc7-debug-01822-g89d8f53ff6e7 #1 5cac31ca93432e53341863abfb3332fd98b144da Hardware name: HP HP Desktop M01-F1xxx/87D6, BIOS F.12 12/17/2020 RIP: 0010:rtw8821c_phy_set_param+0x262/0x380 [rtw88_8821c] Code: e8 53 f3 c0 d6 48 8b 43 10 4c 8b 63 38 be 24 0a 00 00 48 89 df 48 8b 40 68 e8 3a f3 c0 d6 89 e9 be 28 0a 00 00 48 89 df d3 e8 <41> 89 84 24 54 01 00 00 48 8b 43 10 4c 8b 63 38 48 8b 40 68 e8 15 RSP: 0018:ffffb08c417cb6f0 EFLAGS: 00010286 RAX: 0000000064b80c1c RBX: ffff93d15a0120e0 RCX: 0000000000000000 RDX: 0000000034028211 RSI: 0000000000000a28 RDI: ffff93d15a0120e0 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000006 R12: ffffffffc09f51a0 R13: ffff93d15a0156d0 R14: 0000000000000000 R15: 0000000000000001 FS: 00007f4e9b73d1c0(0000) GS:ffff93d83ab80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffc09f52f4 CR3: 0000000103b9e000 CR4: 0000000000350ee0 Call Trace: rtw_core_start+0xbd/0x190 [rtw88_core de79d6bdfd083d102030858972032e5706726279] rtw_ops_start+0x26/0x40 [rtw88_core de79d6bdfd083d102030858972032e5706726279] drv_start+0x42/0x100 [mac80211 21e803d0ad10691f64c6c81ecc24c0c6c36e5d58] ieee80211_do_open+0x2fb/0x900 [mac80211 21e803d0ad10691f64c6c81ecc24c0c6c36e5d58] ieee80211_open+0x67/0x80 [mac80211 21e803d0ad10691f64c6c81ecc24c0c6c36e5d58] __dev_open+0xdd/0x180 [...] Fixes: 89d8f53ff6e7 ("wifi: rtw88: Fix Sparse warning for rtw8821c_hw_spec") Reported-by: Nathan Chancellor Cc: Larry Finger Signed-off-by: Ping-Ke Shih Tested-by: Nathan Chancellor Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220608020312.9663-1-pkshih@realtek.com commit 67ea0a2adbf667cd6da4965fbcfd0da741035084 Author: Kees Cook Date: Wed Jun 8 14:55:12 2022 -0700 staging: rtl8723bs: Allocate full pwep structure The pwep allocation was always being allocated smaller than the true structure size. Avoid this by always allocating the full structure. Found with GCC 12 and -Warray-bounds: ../drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: In function 'rtw_set_encryption': ../drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:591:29: warning: array subscript 'struct ndis_802_11_wep[0]' is partly outside array bounds of 'void[25]' [-Warray-bounds] 591 | pwep->length = wep_total_len; | ^~ Cc: Greg Kroah-Hartman Cc: Fabio Aiuto Cc: Hans de Goede Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220608215512.1070847-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit de0952f267ffe9d4ecbfeab7c476f7e29e028b3e Author: Javier Martinez Canillas Date: Fri Jun 10 00:34:24 2022 +0200 staging: olpc_dcon: mark driver as broken The commit eecb3e4e5d9d ("staging: olpc_dcon: add OLPC display controller (DCON) support") added this driver in 2010, and has been in staging since then. It was marked as broken at some point because it didn't even build but that got removed once the build issues were addressed. But it seems that the work to move this driver out of staging has stalled, the last non-trivial change to fix one of the items mentioned in its todo file was commit e40219d5e4b2 ("staging: olpc_dcon: allow simultaneous XO-1 and XO-1.5 support") in 2019. And even if work to destage the driver is resumed, the fbdev subsystem has been deprecated for a long time and instead it should be ported to DRM. Now this driver is preventing to land a kernel wide change, that makes the num_registered_fb symbol to be private to the fbmem.c file. So let's just mark the driver as broken. Someone can then work on making it not depend on the num_registered_fb symbol, allowing to drop the broken dependency again. Suggested-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20220609223424.907174-1-javierm@redhat.com Signed-off-by: Greg Kroah-Hartman commit 34d2cd3fccced12b958b8848e3eff0ee4296764c Author: Miaoqian Lin Date: Thu May 12 06:16:10 2022 +0400 ARM: meson: Fix refcount leak in meson_smp_prepare_cpus of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: d850f3e5d296 ("ARM: meson: Add SMP bringup code for Meson8 and Meson8b") Signed-off-by: Miaoqian Lin Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220512021611.47921-1-linmq006@gmail.com commit bf56a0917fd329d5adecfd405e681ff7ba1abb52 Merge: a3bd2102e4642 8fa5e7b20e010 Author: Jakub Kicinski Date: Thu Jun 9 22:05:36 2022 -0700 Merge tag 'mlx5-fixes-2022-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-06-08 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-06-08' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: fs, fail conflicting actions net/mlx5: Rearm the FW tracer after each tracer event net/mlx5: E-Switch, pair only capable devices net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules Revert "net/mlx5e: Allow relaxed ordering over VFs" MAINTAINERS: adjust MELLANOX ETHERNET INNOVA DRIVERS to TLS support removal ==================== Link: https://lore.kernel.org/r/20220608185855.19818-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit a3bd2102e464202b58d57390a538d96f57ffc361 Author: Andrea Mayer Date: Wed Jun 8 11:19:17 2022 +0200 net: seg6: fix seg6_lookup_any_nexthop() to handle VRFs using flowi_l3mdev Commit 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") adds a new entry (flowi_l3mdev) in the common flow struct used for indicating the l3mdev index for later rule and table matching. The l3mdev_update_flow() has been adapted to properly set the flowi_l3mdev based on the flowi_oif/flowi_iif. In fact, when a valid flowi_iif is supplied to the l3mdev_update_flow(), this function can update the flowi_l3mdev entry only if it has not yet been set (i.e., the flowi_l3mdev entry is equal to 0). The SRv6 End.DT6 behavior in VRF mode leverages a VRF device in order to force the routing lookup into the associated routing table. This routing operation is performed by seg6_lookup_any_nextop() preparing a flowi6 data structure used by ip6_route_input_lookup() which, in turn, (indirectly) invokes l3mdev_update_flow(). However, seg6_lookup_any_nexthop() does not initialize the new flowi_l3mdev entry which is filled with random garbage data. This prevents l3mdev_update_flow() from properly updating the flowi_l3mdev with the VRF index, and thus SRv6 End.DT6 (VRF mode)/DT46 behaviors are broken. This patch correctly initializes the flowi6 instance allocated and used by seg6_lookup_any_nexhtop(). Specifically, the entire flowi6 instance is wiped out: in case new entries are added to flowi/flowi6 (as happened with the flowi_l3mdev entry), we should no longer have incorrectly initialized values. As a result of this operation, the value of flowi_l3mdev is also set to 0. The proposed fix can be tested easily. Starting from the commit referenced in the Fixes, selftests [1],[2] indicate that the SRv6 End.DT6 (VRF mode)/DT46 behaviors no longer work correctly. By applying this patch, those behaviors are back to work properly again. [1] - tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh [2] - tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") Reported-by: Anton Makarov Signed-off-by: Andrea Mayer Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220608091917.20345-1-andrea.mayer@uniroma2.it Signed-off-by: Jakub Kicinski commit cd3ff99b93f777ec9fd2844fbcd67ebc3350bb64 Merge: b489a6e587169 a0b843340dae7 Author: Jakub Kicinski Date: Thu Jun 9 22:02:42 2022 -0700 Merge branch 'nfp-fixes-for-v5-19' Simon Horman says: ==================== nfp: fixes for v5.19 this short series includes two fixes for the NFP driver. 1. Restructure GRE+VLAN flower offload to address a miss match between the NIC firmware and driver implementation which prevented these features from working in combination. 2. Prevent unnecessary warnings regarding rate limiting support.- It is expected that this feature to not _always_ be present but this was not taken into account when the code to check for this feature was added. ==================== Link: https://lore.kernel.org/r/20220608092901.124780-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit a0b843340dae704e17c1ddfad0f85c583c36757f Author: Etienne van der Linde Date: Wed Jun 8 11:29:01 2022 +0200 nfp: flower: restructure flow-key for gre+vlan combination Swap around the GRE and VLAN parts in the flow-key offloaded by the driver to fit in with other tunnel types and the firmware. Without this change used cases with GRE+VLAN on the outer header does not get offloaded as the flow-key mismatches what the firmware expect. Fixes: 0d630f58989a ("nfp: flower: add support to offload QinQ match") Fixes: 5a2b93041646 ("nfp: flower-ct: compile match sections of flow_payload") Signed-off-by: Etienne van der Linde Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 03d5005ff7356a9952a21da20a3d7828fd559fee Author: Fei Qin Date: Wed Jun 8 11:29:00 2022 +0200 nfp: avoid unnecessary check warnings in nfp_app_get_vf_config nfp_net_sriov_check is added in nfp_app_get_vf_config which intends to ensure ivi->vlan_proto and ivi->max_tx_rate/min_tx_rate can be read from VF config table only when firmware supports corresponding capability. However, "nfp_app_get_vf_config" can be called by commands like "ip a", "ip link set $DEV up" and "ip link set $DEV vf $NUM vlan $param" (with VF). When using commands above, many warnings "ndo_set_vf_ not supported" would appear if firmware doesn't support VF rate limit and 802.1ad VLAN assingment. If more VFs are created, things could get worse. Thus, this patch add an extra bool parameter for nfp_net_sriov_check to enable/disable the cap check warning report. Unnecessary warnings in nfp_app_get_vf_config can be avoided. Valid warnings in kinds of vf setting function can be reserved. Fixes: e0d0e1fdf1ed ("nfp: VF rate limit support") Fixes: 59359597b010 ("nfp: support 802.1ad VLAN assingment to VF") Signed-off-by: Fei Qin Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit b489a6e5871690735752f8875f411e4d0cd8e5df Author: Maxim Mikityanskiy Date: Wed Jun 8 18:34:25 2022 +0300 tls: Rename TLS_INFO_ZC_SENDFILE to TLS_INFO_ZC_TX To embrace possible future optimizations of TLS, rename zerocopy sendfile definitions to more generic ones: * setsockopt: TLS_TX_ZEROCOPY_SENDFILE- > TLS_TX_ZEROCOPY_RO * sock_diag: TLS_INFO_ZC_SENDFILE -> TLS_INFO_ZC_RO_TX RO stands for readonly and emphasizes that the application shouldn't modify the data being transmitted with zerocopy to avoid potential disconnection. Fixes: c1318b39c7d3 ("tls: Add opt-in zerocopy mode of sendfile()") Signed-off-by: Maxim Mikityanskiy Link: https://lore.kernel.org/r/20220608153425.3151146-1-maximmi@nvidia.com Signed-off-by: Jakub Kicinski commit 1f192b9e8d8a5c619b33a868fb1af063af65ce5d Merge: 88bfb6dbb61c5 477277c7fd43d Author: Dave Airlie Date: Fri Jun 10 13:29:15 2022 +1000 Merge tag 'drm-misc-fixes-2022-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes two fixes for panel self-refresh handling, and one to fix multiple output support on AST. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220609100754.kvrkjy67gqabjuee@houat commit 88bfb6dbb61c54008600c3cc6276610393a00d2b Merge: 0a178750647e4 6e516faf04317 Author: Dave Airlie Date: Fri Jun 10 13:09:19 2022 +1000 Merge tag 'drm-misc-fixes-2022-05-26' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes A use-after-free fix for panfrost, and a DT invalid configuration fix for ti-sn65dsi83 Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220526090532.nvhlmwev5qgln3nb@houat commit a1ea0857b59757733d58908dd55bf4b722ee574f Author: Wei Yongjun Date: Wed Jun 8 02:11:54 2022 +0000 clk: stm32: rcc_reset: Fix missing spin_lock_init() The driver allocates the spinlock but not initialize it. Use spin_lock_init() on it to initialize it correctly. Fixes: 637cee5ffc71 ("clk: stm32: Introduce STM32MP13 RCC drivers (Reset Clock Controller)") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220608021154.990347-1-weiyongjun1@huawei.com Tested-by: Gabriel Fernandez Reviewed-by: Gabriel Fernandez Signed-off-by: Stephen Boyd commit 874c8ca1e60b2c564a48f7e7acc40d328d5c8733 Author: David Howells Date: Thu Jun 9 21:46:04 2022 +0100 netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context While randstruct was satisfied with using an open-coded "void *" offset cast for the netfs_i_context <-> inode casting, __builtin_object_size() as used by FORTIFY_SOURCE was not as easily fooled. This was causing the following complaint[1] from gcc v12: In file included from include/linux/string.h:253, from include/linux/ceph/ceph_debug.h:7, from fs/ceph/inode.c:2: In function 'fortify_memset_chk', inlined from 'netfs_i_context_init' at include/linux/netfs.h:326:2, inlined from 'ceph_alloc_inode' at fs/ceph/inode.c:463:2: include/linux/fortify-string.h:242:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 242 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by embedding a struct inode into struct netfs_i_context (which should perhaps be renamed to struct netfs_inode). The struct inode vfs_inode fields are then removed from the 9p, afs, ceph and cifs inode structs and vfs_inode is then simply changed to "netfs.inode" in those filesystems. Further, rename netfs_i_context to netfs_inode, get rid of the netfs_inode() function that converted a netfs_i_context pointer to an inode pointer (that can now be done with &ctx->inode) and rename the netfs_i_context() function to netfs_inode() (which is now a wrapper around container_of()). Most of the changes were done with: perl -p -i -e 's/vfs_inode/netfs.inode/'g \ `git grep -l 'vfs_inode' -- fs/{9p,afs,ceph,cifs}/*.[ch]` Kees suggested doing it with a pair structure[2] and a special declarator to insert that into the network filesystem's inode wrapper[3], but I think it's cleaner to embed it - and then it doesn't matter if struct randomisation reorders things. Dave Chinner suggested using a filesystem-specific VFS_I() function in each filesystem to convert that filesystem's own inode wrapper struct into the VFS inode struct[4]. Version #2: - Fix a couple of missed name changes due to a disabled cifs option. - Rename nfs_i_context to nfs_inode - Use "netfs" instead of "nic" as the member name in per-fs inode wrapper structs. [ This also undoes commit 507160f46c55 ("netfs: gcc-12: temporarily disable '-Wattribute-warning' for now") that is no longer needed ] Fixes: bc899ee1c898 ("netfs: Add a netfs inode context") Reported-by: Jeff Layton Signed-off-by: David Howells Reviewed-by: Jeff Layton Reviewed-by: Kees Cook Reviewed-by: Xiubo Li cc: Jonathan Corbet cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Dominique Martinet cc: Christian Schoenebeck cc: Marc Dionne cc: Ilya Dryomov cc: Steve French cc: William Kucharski cc: "Matthew Wilcox (Oracle)" cc: Dave Chinner cc: linux-doc@vger.kernel.org cc: v9fs-developer@lists.sourceforge.net cc: linux-afs@lists.infradead.org cc: ceph-devel@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: samba-technical@lists.samba.org cc: linux-fsdevel@vger.kernel.org cc: linux-hardening@vger.kernel.org Link: https://lore.kernel.org/r/d2ad3a3d7bdd794c6efb562d2f2b655fb67756b9.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/20220517210230.864239-1-keescook@chromium.org/ [2] Link: https://lore.kernel.org/r/20220518202212.2322058-1-keescook@chromium.org/ [3] Link: https://lore.kernel.org/r/20220524101205.GI2306852@dread.disaster.area/ [4] Link: https://lore.kernel.org/r/165296786831.3591209.12111293034669289733.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/165305805651.4094995.7763502506786714216.stgit@warthog.procyon.org.uk # v2 Signed-off-by: Linus Torvalds commit 334f6f53abcf57782bd2fe81da1cbd893e4ef05c Author: Matthew Wilcox (Oracle) Date: Thu Jun 9 09:13:57 2022 -0400 mm: Add kernel-doc for folio->mlock_count Fix "./include/linux/mm_types.h:279: warning: Function parameter or member 'mlock_count' not described in 'folio'". Also neaten the html by hiding the anon struct. Signed-off-by: Matthew Wilcox (Oracle) commit 69a37a8ba1b408a1c7616494aa7018e4b3844cbe Author: Matthew Wilcox (Oracle) Date: Wed Jun 8 15:18:34 2022 -0400 mm/huge_memory: Fix xarray node memory leak If xas_split_alloc() fails to allocate the necessary nodes to complete the xarray entry split, it sets the xa_state to -ENOMEM, which xas_nomem() then interprets as "Please allocate more memory", not as "Please free any unnecessary memory" (which was the intended outcome). It's confusing to use xas_nomem() to free memory in this context, so call xas_destroy() instead. Reported-by: syzbot+9e27a75a8c24f3fe75c1@syzkaller.appspotmail.com Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Cc: stable@vger.kernel.org Signed-off-by: Matthew Wilcox (Oracle) commit dcfa24ba68991ab69a48254a18377b45180ae664 Author: Matthew Wilcox (Oracle) Date: Wed May 25 14:23:45 2022 -0400 filemap: Cache the value of vm_flags After we have unlocked the mmap_lock for I/O, the file is pinned, but the VMA is not. Checking this flag after that can be a use-after-free. It's not a terribly interesting use-after-free as it can only read one bit, and it's used to decide whether to read 2MB or 4MB. But it upsets the automated tools and it's generally bad practice anyway, so let's fix it. Reported-by: syzbot+5b96d55e5b54924c77ad@syzkaller.appspotmail.com Fixes: 4687fdbb805a ("mm/filemap: Support VM_HUGEPAGE for file mappings") Cc: stable@vger.kernel.org Signed-off-by: Matthew Wilcox (Oracle) commit 6bf74cddcffac0bc5ee0fad724aac778d2e53f75 Author: Matthew Wilcox (Oracle) Date: Tue Jun 7 15:45:53 2022 -0400 filemap: Don't release a locked folio We must hold a reference over the call to filemap_release_folio(), otherwise the page cache will put the last reference to the folio before we unlock it, leading to splats like this: BUG: Bad page state in process u8:5 pfn:1ab1f4 page:ffffea0006ac7d00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x28b1de pfn:0x1ab1f4 flags: 0x17ff80000040001(locked|reclaim|node=0|zone=2|lastcpupid=0xfff) raw: 017ff80000040001 dead000000000100 dead000000000122 0000000000000000 raw: 000000000028b1de 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set It's an error path, so it doesn't see much testing. Reported-by: Darrick J. Wong Fixes: a42634a6c07d ("readahead: Use a folio in read_pages()") Signed-off-by: Matthew Wilcox (Oracle) commit 41e456400212803704e82691716e1d7b0865114a Author: Yupeng Li Date: Wed Jun 8 09:12:29 2022 +0800 MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. set cpu_hwmon as a module build with loongson_sysconf, loongson_chiptemp undefined error,fix cpu_hwmon compile options to be bool.Some kernel compilation error information is as follows: Checking missing-syscalls for N32 CALL scripts/checksyscalls.sh Checking missing-syscalls for O32 CALL scripts/checksyscalls.sh CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC [M] drivers/platform/mips/cpu_hwmon.o Building modules, stage 2. MODPOST 200 modules ERROR: "loongson_sysconf" [drivers/platform/mips/cpu_hwmon.ko] undefined! ERROR: "loongson_chiptemp" [drivers/platform/mips/cpu_hwmon.ko] undefined! make[1]: *** [scripts/Makefile.modpost:92:__modpost] 错误 1 make: *** [Makefile:1261:modules] 错误 2 Signed-off-by: Yupeng Li Reviewed-by: Guenter Roeck Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 3d9f55c57bc3659f986acc421eac431ff6edcc83 Merge: 95fc76c81b927 537e11cdc7a6b Author: Linus Torvalds Date: Thu Jun 9 12:26:05 2022 -0700 Merge tag 'fs_for_v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2, writeback, and quota fixes and cleanups from Jan Kara: "A fix for race in writeback code and two cleanups in quota and ext2" * tag 'fs_for_v5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: Prevent memory allocation recursion while holding dq_lock writeback: Fix inode->i_io_list not be protected by inode->i_lock error fs: Fix syntax errors in comments commit 95fc76c81b9270a9ab38f4947fe5cb786c8c79cc Merge: 825464e79db4a 8e1278444446f Author: Linus Torvalds Date: Thu Jun 9 12:17:43 2022 -0700 Merge tag 'powerpc-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - On 32-bit fix overread/overwrite of thread_struct via ptrace PEEK/POKE. - Fix softirqs not switching to the softirq stack since we moved irq_exit(). - Force thread size increase when KASAN is enabled to avoid stack overflows. - On Book3s 64 mark more code as not to be instrumented by KASAN to avoid crashes. - Exempt __get_wchan() from KASAN checking, as it's inherently racy. - Fix a recently introduced crash in the papr_scm driver in some configurations. - Remove include of which is forbidden. Thanks to Ariel Miculas, Chen Jingwen, Christophe Leroy, Erhard Furtner, He Ying, Kees Cook, Masahiro Yamada, Nageswara R Sastry, Paul Mackerras, Sachin Sant, Vaibhav Jain, and Wanming Hu. * tag 'powerpc-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/32: Fix overread/overwrite of thread_struct via ptrace powerpc/book3e: get rid of #include powerpc/kasan: Force thread size increase with KASAN powerpc/papr_scm: don't requests stats with '0' sized stats buffer powerpc: Don't select HAVE_IRQ_EXIT_ON_IRQ_STACK powerpc/kasan: Silence KASAN warnings in __get_wchan() powerpc/kasan: Mark more real-mode code as not to be instrumented commit 093d27bb6f2d1963f927ef59c9a2d37059175426 Author: Dorian Rudolph Date: Sat May 14 17:23:40 2022 +0200 power: supply: core: Fix boundary conditions in interpolation The functions power_supply_temp2resist_simple and power_supply_ocv2cap_simple handle boundary conditions incorrectly. The change was introduced in a4585ba2050f460f749bbaf2b67bd56c41e30283 ("power: supply: core: Use library interpolation"). There are two issues: First, the lines "high = i - 1" and "high = i" in ocv2cap have the wrong order compared to temp2resist. As a consequence, ocv2cap sets high=-1 if ocv>table[0].ocv, which causes an out-of-bounds read. Second, the logic of temp2resist is also not correct. Consider the case table[] = {{20, 100}, {10, 80}, {0, 60}}. For temp=5, we expect a resistance of 70% by interpolation. However, temp2resist sets high=low=2 and returns 60. Cc: stable@vger.kernel.org Signed-off-by: Dorian Rudolph Reviewed-by: Linus Walleij Fixes: a4585ba2050f ("power: supply: core: Use library interpolation") Signed-off-by: Sebastian Reichel commit 80192eff64eee9b3bc0594a47381937b94b9d65a Author: Miaoqian Lin Date: Mon May 23 18:10:09 2022 +0400 power/reset: arm-versatile: Fix refcount leak in versatile_reboot_probe of_find_matching_node_and_match() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 0e545f57b708 ("power: reset: driver for the Versatile syscon reboot") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 0f5de2f0532229752d923c769a5b202ae437523b Author: Gao Chao Date: Wed Jun 8 10:42:49 2022 +0800 power: supply: ab8500_fg: add missing destroy_workqueue in ab8500_fg_probe In ab8500_fg_probe, misses destroy_workqueue in error path, this patch fixes that. Fixes: 010ddb813f35 ("power: supply: ab8500_fg: Allocate wq in probe") Signed-off-by: Gao Chao Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 825464e79db4aac936e0fdae62cdfb7546d0028f Merge: 507160f46c559 647df0d41b6bd Author: Linus Torvalds Date: Thu Jun 9 12:06:52 2022 -0700 Merge tag 'net-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf and netfilter. Current release - regressions: - eth: amt: fix possible null-ptr-deref in amt_rcv() Previous releases - regressions: - tcp: use alloc_large_system_hash() to allocate table_perturb - af_unix: fix a data-race in unix_dgram_peer_wake_me() - nfc: st21nfca: fix memory leaks in EVT_TRANSACTION handling - eth: ixgbe: fix unexpected VLAN rx in promisc mode on VF Previous releases - always broken: - ipv6: fix signed integer overflow in __ip6_append_data - netfilter: - nat: really support inet nat without l3 address - nf_tables: memleak flow rule from commit path - bpf: fix calling global functions from BPF_PROG_TYPE_EXT programs - openvswitch: fix misuse of the cached connection on tuple changes - nfc: nfcmrvl: fix memory leak in nfcmrvl_play_deferred - eth: altera: fix refcount leak in altera_tse_mdio_create Misc: - add Quentin Monnet to bpftool maintainers" * tag 'net-5.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (45 commits) net: amd-xgbe: fix clang -Wformat warning tcp: use alloc_large_system_hash() to allocate table_perturb net: dsa: realtek: rtl8365mb: fix GMII caps for ports with internal PHY net: dsa: mv88e6xxx: correctly report serdes link failure net: dsa: mv88e6xxx: fix BMSR error to be consistent with others net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete net: altera: Fix refcount leak in altera_tse_mdio_create net: openvswitch: fix misuse of the cached connection on tuple changes net: ethernet: mtk_eth_soc: fix misuse of mem alloc interface netdev[napi]_alloc_frag ip_gre: test csum_start instead of transport header au1000_eth: stop using virt_to_bus() ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg ipv6: Fix signed integer overflow in __ip6_append_data nfc: nfcmrvl: Fix memory leak in nfcmrvl_play_deferred nfc: st21nfca: fix incorrect sizing calculations in EVT_TRANSACTION nfc: st21nfca: fix memory leaks in EVT_TRANSACTION handling nfc: st21nfca: fix incorrect validating logic in EVT_TRANSACTION net: ipv6: unexport __init-annotated seg6_hmac_init() net: xfrm: unexport __init-annotated xfrm4_protocol_init() net: mdio: unexport __init-annotated mdio_bus_init() ... commit 387c67afccbb271707cbe6de2817f4e4c76287ad Author: Simon Horman Date: Thu Jun 9 20:42:30 2022 +0200 docs: arm: tcm: Fix typo in description of TCM and MMU usage Correct a typo in the description of interaction between the TCM and MMU. Found by inspection. Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220609184230.627958-1-simon.horman@corigine.com Signed-off-by: Jonathan Corbet commit da4288b95baa1c7c9aa8a476f58b37eb238745b0 Author: Masahiro Yamada Date: Wed Jun 8 10:11:00 2022 +0900 scripts/check-local-export: avoid 'wait $!' for process substitution Bash 4.4, released in 2016, supports 'wait $!' to check the exit status of a process substitution, but it seems too new. Some people using older bash versions (on CentOS 7, Ubuntu 16.04, etc.) reported an error like this: ./scripts/check-local-export: line 54: wait: pid 17328 is not a child of this shell I used the process substitution to avoid a pipeline, which executes each command in a subshell. If the while-loop is executed in the subshell context, variable changes within are lost after the subshell terminates. Fortunately, Bash 4.2, released in 2011, supports the 'lastpipe' option, which makes the last element of a pipeline run in the current shell process. Switch to the pipeline with 'lastpipe' solution, and also set 'pipefail' to catch errors from ${NM}. Add the bash requirement to Documentation/process/changes.rst. Fixes: 31cb50b5590f ("kbuild: check static EXPORT_SYMBOL* by script instead of modpost") Reported-by: Tetsuo Handa Reported-by: Michael Ellerman Reported-by: Wang Yugui Tested-by: Tetsuo Handa Tested-by: Jon Hunter Acked-by: Nick Desaulniers Tested-by: Sedat Dilek # LLVM-14 (x86-64) Signed-off-by: Masahiro Yamada commit 507160f46c55913955d272ebf559d63809a8e560 Author: Linus Torvalds Date: Thu Jun 9 11:29:36 2022 -0700 netfs: gcc-12: temporarily disable '-Wattribute-warning' for now This is a pure band-aid so that I can continue merging stuff from people while some of the gcc-12 fallout gets sorted out. In particular, gcc-12 is very unhappy about the kinds of pointer arithmetic tricks that netfs does, and that makes the fortify checks trigger in afs and ceph: In function ‘fortify_memset_chk’, inlined from ‘netfs_i_context_init’ at include/linux/netfs.h:327:2, inlined from ‘afs_set_netfs_context’ at fs/afs/inode.c:61:2, inlined from ‘afs_root_iget’ at fs/afs/inode.c:543:2: include/linux/fortify-string.h:258:25: warning: call to ‘__write_overflow_field’ declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 258 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and the reason is that netfs_i_context_init() is passed a 'struct inode' pointer, and then it does struct netfs_i_context *ctx = netfs_i_context(inode); memset(ctx, 0, sizeof(*ctx)); where that netfs_i_context() function just does pointer arithmetic on the inode pointer, knowing that the netfs_i_context is laid out immediately after it in memory. This is all truly disgusting, since the whole "netfs_i_context is laid out immediately after it in memory" is not actually remotely true in general, but is just made to be that way for afs and ceph. See for example fs/cifs/cifsglob.h: struct cifsInodeInfo { struct { /* These must be contiguous */ struct inode vfs_inode; /* the VFS's inode record */ struct netfs_i_context netfs_ctx; /* Netfslib context */ }; [...] and realize that this is all entirely wrong, and the pointer arithmetic that netfs_i_context() is doing is also very very wrong and wouldn't give the right answer if netfs_ctx had different alignment rules from a 'struct inode', for example). Anyway, that's just a long-winded way to say "the gcc-12 warning is actually quite reasonable, and our code happens to work but is pretty disgusting". This is getting fixed properly, but for now I made the mistake of thinking "the week right after the merge window tends to be calm for me as people take a breather" and I did a sustem upgrade. And I got gcc-12 as a result, so to continue merging fixes from people and not have the end result drown in warnings, I am fixing all these gcc-12 issues I hit. Including with these kinds of temporary fixes. Cc: Kees Cook Cc: David Howells Link: https://lore.kernel.org/all/AEEBCF5D-8402-441D-940B-105AA718C71F@chromium.org/ Signed-off-by: Linus Torvalds commit f0be87c42cbd341d436d06da4792e6b0c83c3aeb Author: Linus Torvalds Date: Thu Jun 9 10:11:12 2022 -0700 gcc-12: disable '-Warray-bounds' universally for now In commit 8b202ee21839 ("s390: disable -Warray-bounds") the s390 people disabled the '-Warray-bounds' warning for gcc-12, because the new logic in gcc would cause warnings for their use of the S390_lowcore macro, which accesses absolute pointers. It turns out gcc-12 has many other issues in this area, so this takes that s390 warning disable logic, and turns it into a kernel build config entry instead. Part of the intent is that we can make this all much more targeted, and use this conflig flag to disable it in only particular configurations that cause problems, with the s390 case as an example: select GCC12_NO_ARRAY_BOUNDS and we could do that for other configuration cases that cause issues. Or we could possibly use the CONFIG_CC_NO_ARRAY_BOUNDS thing in a more targeted way, and disable the warning only for particular uses: again the s390 case as an example: KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds) but this ends up just doing it globally in the top-level Makefile, since the current issues are spread fairly widely all over: KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds We'll try to limit this later, since the gcc-12 problems are rare enough that *much* of the kernel can be built with it without disabling this warning. Cc: Kees Cook Cc: Nathan Chancellor Signed-off-by: Linus Torvalds commit 842c3b3ddc5f4d17275edbaa09e23d712bf8b915 Author: Linus Torvalds Date: Thu Jun 9 10:03:28 2022 -0700 mellanox: mlx5: avoid uninitialized variable warning with gcc-12 gcc-12 started warning about 'tracker' being used uninitialized: drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c: In function ‘mlx5_do_bond’: drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:786:28: warning: ‘tracker’ is used uninitialized [-Wuninitialized] 786 | struct lag_tracker tracker; | ^~~~~~~ which seems to be because it doesn't track how the use (and initialization) is bound by the 'do_bond' flag. But admittedly that 'do_bond' usage is fairly complicated, and involves passing it around as an argument to helper functions, so it's somewhat understandable that gcc doesn't see how that all works. This function could be rewritten to make the use of that tracker variable more obviously safe, but for now I'm just adding the forced initialization of it. Signed-off-by: Linus Torvalds commit e3f056a7aafabe4ac3ad4b7465ba821b44a7e639 Author: Kunihiko Hayashi Date: Fri May 20 14:17:02 2022 +0900 irqchip/uniphier-aidet: Add compatible string for NX1 SoC Add the compatible string to support UniPhier NX1 SoC, which has the same kinds of controls as the other UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1653023822-19229-3-git-send-email-hayashi.kunihiko@socionext.com commit df089e6f07e3c94cb7a330dc74f5041db800009c Author: Kunihiko Hayashi Date: Fri May 20 14:17:01 2022 +0900 dt-bindings: interrupt-controller/uniphier-aidet: Add bindings for NX1 SoC Update uniphier-aidet binding document for UniPhier NX1 SoC. Signed-off-by: Kunihiko Hayashi Acked-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1653023822-19229-2-git-send-email-hayashi.kunihiko@socionext.com commit 49beadbd47c270a00754c107a837b4f29df4c822 Author: Linus Torvalds Date: Thu Jun 9 09:41:42 2022 -0700 gcc-12: disable '-Wdangling-pointer' warning for now While the concept of checking for dangling pointers to local variables at function exit is really interesting, the gcc-12 implementation is not compatible with reality, and results in false positives. For example, gcc sees us putting things on a local list head allocated on the stack, which involves exactly those kinds of pointers to the local stack entry: In function ‘__list_add’, inlined from ‘list_add_tail’ at include/linux/list.h:102:2, inlined from ‘rebuild_snap_realms’ at fs/ceph/snap.c:434:2: include/linux/list.h:74:19: warning: storing the address of local variable ‘realm_queue’ in ‘*&realm_27(D)->rebuild_item.prev’ [-Wdangling-pointer=] 74 | new->prev = prev; | ~~~~~~~~~~^~~~~~ But then gcc - understandably - doesn't really understand the big picture how the doubly linked list works, so doesn't see how we then end up emptying said list head in a loop and the pointer we added has been removed. Gcc also complains about us (intentionally) using this as a way to store a kind of fake stack trace, eg drivers/acpi/acpica/utdebug.c:40:38: warning: storing the address of local variable ‘current_sp’ in ‘acpi_gbl_entry_stack_pointer’ [-Wdangling-pointer=] 40 | acpi_gbl_entry_stack_pointer = ¤t_sp; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ which is entirely reasonable from a compiler standpoint, and we may want to change those kinds of patterns, but not not. So this is one of those "it would be lovely if the compiler were to complain about us leaving dangling pointers to the stack", but not this way. Signed-off-by: Linus Torvalds commit 7aefd8b53815274f3ef398d370a3c9b27dd9f00c Author: Linus Torvalds Date: Wed Jun 8 16:59:29 2022 -0700 drm: imx: fix compiler warning with gcc-12 Gcc-12 correctly warned about this code using a non-NULL pointer as a truth value: drivers/gpu/drm/imx/ipuv3-crtc.c: In function ‘ipu_crtc_disable_planes’: drivers/gpu/drm/imx/ipuv3-crtc.c:72:21: error: the comparison will always evaluate as ‘true’ for the address of ‘plane’ will never be NULL [-Werror=address] 72 | if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base) | ^ due to the extraneous '&' address-of operator. Philipp Zabel points out that The mistake had no adverse effect since the following condition doesn't actually dereference the NULL pointer, but the intent of the code was obviously to check for it, not to take the address of the member. Fixes: eb8c88808c83 ("drm/imx: add deferred plane disabling") Acked-by: Philipp Zabel Signed-off-by: Linus Torvalds commit eff4780f83d0ae3e5b6c02ff5d999dc4c1c5c8ce Author: Miaoqian Lin Date: Wed Jun 1 12:09:30 2022 +0400 irqchip/realtek-rtl: Fix refcount leak in map_interrupts of_find_node_by_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. This function doesn't call of_node_put() in error path. Call of_node_put() directly after of_property_read_u32() to cover both normal path and error path. Fixes: 9f3a0f34b84a ("irqchip: Add support for Realtek RTL838x/RTL839x interrupt controller") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-7-linmq006@gmail.com commit fa1ad9d4cc47ca2470cd904ad4519f05d7e43a2b Author: Miaoqian Lin Date: Wed Jun 1 12:09:29 2022 +0400 irqchip/gic-v3: Fix refcount leak in gic_populate_ppi_partitions of_find_node_by_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: e3825ba1af3a ("irqchip/gic-v3: Add support for partitioned PPIs") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-6-linmq006@gmail.com commit ec8401a429ffee34ccf38cebf3443f8d5ae6cb0d Author: Miaoqian Lin Date: Wed Jun 1 12:09:28 2022 +0400 irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. When kcalloc fails, it missing of_node_put() and results in refcount leak. Fix this by goto out_put_node label. Fixes: 52085d3f2028 ("irqchip/gic-v3: Dynamically allocate PPI partition descriptors") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-5-linmq006@gmail.com commit 3d45670fab3c25a7452721e4588cc95c51cda134 Author: Miaoqian Lin Date: Wed Jun 1 12:09:27 2022 +0400 irqchip/apple-aic: Fix refcount leak in aic_of_ic_init of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: a5e8801202b3 ("irqchip/apple-aic: Parse FIQ affinities from device-tree") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-4-linmq006@gmail.com commit b1ac803f47cb1615468f35cf1ccb553c52087301 Author: Miaoqian Lin Date: Wed Jun 1 12:09:26 2022 +0400 irqchip/apple-aic: Fix refcount leak in build_fiq_affinity of_find_node_by_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: a5e8801202b3 ("irqchip/apple-aic: Parse FIQ affinities from device-tree") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-3-linmq006@gmail.com commit f4b98e314888cc51486421bcf6d52852452ea48b Author: Miaoqian Lin Date: Wed Jun 1 12:09:25 2022 +0400 irqchip/gic/realview: Fix refcount leak in realview_gic_of_init of_find_matching_node_and_match() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 82b0a434b436 ("irqchip/gic/realview: Support more RealView DCC variants") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-2-linmq006@gmail.com commit b84dc7f0e3646d480b6972c5f25586215c5f33e2 Author: Jamie Iles Date: Mon Jun 6 22:39:52 2022 +0100 irqchip/xilinx: Remove microblaze+zynq dependency The Xilinx IRQ controller doesn't really have any architecture dependencies - it's a generic AXI component that can be used for any FPGA core from Zynq hard processor systems to microblaze+riscv soft cores and more. Signed-off-by: Jamie Iles Acked-by: Michal Simek Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220606213952.298686-1-jamie@jamieiles.com commit 9c73e1e06e0d6d72c445a1b1f50493da260b0c4e Author: Jonathan Corbet Date: Mon Jun 6 08:40:55 2022 -0600 docs: Move the HTE documentation to driver-api/ The hardware timestamp engine documentation is driver API material, and really belongs in the driver-API book; move it there. Cc: Thierry Reding Acked-by: Dipen Patel Signed-off-by: Jonathan Corbet commit 645603844270b69175899268be68b871295764fe Author: Michal Wilczynski Date: Fri May 20 13:19:27 2022 +0200 iavf: Fix issue with MAC address of VF shown as zero After reinitialization of iavf, ice driver gets VIRTCHNL_OP_ADD_ETH_ADDR message with incorrectly set type of MAC address. Hardware address should have is_primary flag set as true. This way ice driver knows what it has to set as a MAC address. Check if the address is primary in iavf_add_filter function and set flag accordingly. To test set all-zero MAC on a VF. This triggers iavf re-initialization and VIRTCHNL_OP_ADD_ETH_ADDR message gets sent to PF. For example: ip link set dev ens785 vf 0 mac 00:00:00:00:00:00 This triggers re-initialization of iavf. New MAC should be assigned. Now check if MAC is non-zero: ip link show dev ens785 Fixes: a3e839d539e0 ("iavf: Add usage of new virtchnl format to set default MAC") Signed-off-by: Michal Wilczynski Reviewed-by: Maciej Fijalkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit fd5855e6b1358e816710afee68a1d2bc685176ca Author: Aleksandr Loktionov Date: Thu May 19 16:01:45 2022 +0200 i40e: Fix call trace in setup_tx_descriptors After PF reset and ethtool -t there was call trace in dmesg sometimes leading to panic. When there was some time, around 5 seconds, between reset and test there were no errors. Problem was that pf reset calls i40e_vsi_close in prep_for_reset and ethtool -t calls i40e_vsi_close in diag_test. If there was not enough time between those commands the second i40e_vsi_close starts before previous i40e_vsi_close was done which leads to crash. Add check to diag_test if pf is in reset and don't start offline tests if it is true. Add netif_info("testing failed") into unhappy path of i40e_diag_test() Fixes: e17bc411aea8 ("i40e: Disable offline diagnostics if VFs are enabled") Fixes: 510efb2682b3 ("i40e: Fix ethtool offline diagnostic with netqueues") Signed-off-by: Michal Jaron Signed-off-by: Aleksandr Loktionov Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 0bb050670ac90a167ecfa3f9590f92966c9a3677 Author: Grzegorz Szczurek Date: Fri Apr 29 14:40:23 2022 +0200 i40e: Fix calculating the number of queue pairs If ADQ is enabled for a VF, then actual number of queue pair is a number of currently available traffic classes for this VF. Without this change the configuration of the Rx/Tx queues fails with error. Fixes: d29e0d233e0d ("i40e: missing input validation on VF message handling by the PF") Signed-off-by: Grzegorz Szczurek Signed-off-by: Jedrzej Jagielski Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit c3238d36c3a2be0a29a9d848d6c51e1b14be6692 Author: Grzegorz Szczurek Date: Fri Apr 29 14:27:08 2022 +0200 i40e: Fix adding ADQ filter to TC0 Procedure of configure tc flower filters erroneously allows to create filters on TC0 where unfiltered packets are also directed by default. Issue was caused by insufficient checks of hw_tc parameter specifying the hardware traffic class to pass matching packets to. Fix checking hw_tc parameter which blocks creation of filters on TC0. Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower") Signed-off-by: Grzegorz Szczurek Signed-off-by: Jedrzej Jagielski Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit 788183a6e8b098b90e15214e800ae5194591018a Author: Justin Swartz Date: Sat Jun 4 17:54:31 2022 +0200 docs: usb: fix literal block marker in usbmon verification example The "Verify that bus sockets are present" example was not properly formatted due to a typo in the literal block marker. Signed-off-by: Justin Swartz Link: https://lore.kernel.org/r/20220604155431.23246-1-justin.swartz@risingedge.co.za Signed-off-by: Jonathan Corbet commit 5860800e8696d2cbbd1a0dd60b433549d176e668 Author: Zheng Zengkai Date: Thu Jun 9 10:56:56 2022 +0800 Documentation/features: Update the arch support status files The arch support status files don't match reality as of v5.19-rc1, use the features-refresh.sh to refresh all the arch-support.txt files in place. The main effect is to add entries for the new loong architecture. Signed-off-by: Zheng Zengkai Link: https://lore.kernel.org/r/20220609025656.143460-1-zhengzengkai@huawei.com Signed-off-by: Jonathan Corbet commit 668a9fe5c6a1bcac6b65d5e9b91a9eca86f782a3 Author: Marc Zyngier Date: Wed Jun 8 14:45:35 2022 +0100 genirq: PM: Use runtime PM for chained interrupts When requesting an interrupt, we correctly call into the runtime PM framework to guarantee that the underlying interrupt controller is up and running. However, we fail to do so for chained interrupt controllers, as the mux interrupt is not requested along the same path. Augment __irq_do_set_handler() to call into the runtime PM code in this case, making sure the PM flow is the same for all interrupts. Reported-by: Lucas Stach Tested-by: Liu Ying Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/26973cddee5f527ea17184c0f3fccb70bc8969a0.camel@pengutronix.de commit e0f3f46e42064a51573914766897b4ab95d943e3 Author: David Matlack Date: Fri May 20 23:32:49 2022 +0000 KVM: selftests: Restrict test region to 48-bit physical addresses when using nested The selftests nested code only supports 4-level paging at the moment. This means it cannot map nested guest physical addresses with more than 48 bits. Allow perf_test_util nested mode to work on hosts with more than 48 physical addresses by restricting the guest test region to 48-bits. While here, opportunistically fix an off-by-one error when dealing with vm_get_max_gfn(). perf_test_util.c was treating this as the maximum number of GFNs, rather than the maximum allowed GFN. This didn't result in any correctness issues, but it did end up shifting the test region down slightly when using huge pages. Suggested-by: Sean Christopherson Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-12-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 71d489661904fcc3ec31b343acd5c0dac84b5410 Author: David Matlack Date: Fri May 20 23:32:48 2022 +0000 KVM: selftests: Add option to run dirty_log_perf_test vCPUs in L2 Add an option to dirty_log_perf_test that configures the vCPUs to run in L2 instead of L1. This makes it possible to benchmark the dirty logging performance of nested virtualization, which is particularly interesting because KVM must shadow L1's EPT/NPT tables. For now this support only works on x86_64 CPUs with VMX. Otherwise passing -n results in the test being skipped. Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-11-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit cf97d5e99f69f876dc310ea21b5f97c3a493a18a Author: David Matlack Date: Fri May 20 23:32:47 2022 +0000 KVM: selftests: Clean up LIBKVM files in Makefile Break up the long lines for LIBKVM and alphabetize each architecture. This makes reading the Makefile easier, and will make reading diffs to LIBKVM easier. No functional change intended. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-10-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit cdc979dae265cc77a035b736f78f58e4c7309bb2 Author: David Matlack Date: Fri May 20 23:32:46 2022 +0000 KVM: selftests: Link selftests directly with lib object files The linker does obey strong/weak symbols when linking static libraries, it simply resolves an undefined symbol to the first-encountered symbol. This means that defining __weak arch-generic functions and then defining arch-specific strong functions to override them in libkvm will not always work. More specifically, if we have: lib/generic.c: void __weak foo(void) { pr_info("weak\n"); } void bar(void) { foo(); } lib/x86_64/arch.c: void foo(void) { pr_info("strong\n"); } And a selftest that calls bar(), it will print "weak". Now if you make generic.o explicitly depend on arch.o (e.g. add function to arch.c that is called directly from generic.c) it will print "strong". In other words, it seems that the linker is free to throw out arch.o when linking because generic.o does not explicitly depend on it, which causes the linker to lose the strong symbol. One solution is to link libkvm.a with --whole-archive so that the linker doesn't throw away object files it thinks are unnecessary. However that is a bit difficult to plumb since we are using the common selftests makefile rules. An easier solution is to drop libkvm.a just link selftests with all the .o files that were originally in libkvm.a. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-9-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit acf57736e755ba5c467fc6fa85e4a0750cc36150 Author: David Matlack Date: Fri May 20 23:32:45 2022 +0000 KVM: selftests: Drop unnecessary rule for STATIC_LIBS Drop the "all: $(STATIC_LIBS)" rule. The KVM selftests already depend on $(STATIC_LIBS), so there is no reason to have an extra "all" rule. Suggested-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-8-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit c363d95986b1b930947305e2372665141721d15f Author: David Matlack Date: Fri May 20 23:32:44 2022 +0000 KVM: selftests: Add a helper to check EPT/VPID capabilities Create a small helper function to check if a given EPT/VPID capability is supported. This will be re-used in a follow-up commit to check for 1G page support. No functional change intended. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-7-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit b6c086d04c0a1ba356145cdba5b46bd6cea2b9bd Author: David Matlack Date: Fri May 20 23:32:43 2022 +0000 KVM: selftests: Move VMX_EPT_VPID_CAP_AD_BITS to vmx.h This is a VMX-related macro so move it to vmx.h. While here, open code the mask like the rest of the VMX bitmask macros. No functional change intended. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-6-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit ce690e9c17d27486af879defc506679cbbb14777 Author: David Matlack Date: Fri May 20 23:32:42 2022 +0000 KVM: selftests: Refactor nested_map() to specify target level Refactor nested_map() to specify that it explicityl wants 4K mappings (the existing behavior) and push the implementation down into __nested_map(), which can be used in subsequent commits to create huge page mappings. No function change intended. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-5-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit b8ca01ea19068b54938ebb4ebc06814a89dee8ea Author: David Matlack Date: Fri May 20 23:32:41 2022 +0000 KVM: selftests: Drop stale function parameter comment for nested_map() nested_map() does not take a parameter named eptp_memslot. Drop the comment referring to it. Reviewed-by: Peter Xu Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit c5a0ccec4cb4edde8e5b7e369dbe4d169b111e42 Author: David Matlack Date: Fri May 20 23:32:40 2022 +0000 KVM: selftests: Add option to create 2M and 1G EPT mappings The current EPT mapping code in the selftests only supports mapping 4K pages. This commit extends that support with an option to map at 2M or 1G. This will be used in a future commit to create large page mappings to test eager page splitting. No functional change intended. Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-3-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit 4ee602e78d706e740a48be9b6ddb239df4a113b5 Author: David Matlack Date: Fri May 20 23:32:39 2022 +0000 KVM: selftests: Replace x86_page_size with PG_LEVEL_XX x86_page_size is an enum used to communicate the desired page size with which to map a range of memory. Under the hood they just encode the desired level at which to map the page. This ends up being clunky in a few ways: - The name suggests it encodes the size of the page rather than the level. - In other places in x86_64/processor.c we just use a raw int to encode the level. Simplify this by adopting the kernel style of PG_LEVEL_XX enums and pass around raw ints when referring to the level. This makes the code easier to understand since these macros are very common in KVM MMU code. Signed-off-by: David Matlack Message-Id: <20220520233249.3776001-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit e3cdaab5ff022874e65df80ae8b8382ccc0a4fe0 Author: Paolo Bonzini Date: Tue May 31 13:57:32 2022 -0400 KVM: x86: SVM: fix nested PAUSE filtering when L0 intercepts PAUSE Commit 74fd41ed16fd ("KVM: x86: nSVM: support PAUSE filtering when L0 doesn't intercept PAUSE") introduced passthrough support for nested pause filtering, (when the host doesn't intercept PAUSE) (either disabled with kvm module param, or disabled with '-overcommit cpu-pm=on') Before this commit, L1 KVM didn't intercept PAUSE at all; afterwards, the feature was exposed as supported by KVM cpuid unconditionally, thus if L1 could try to use it even when the L0 KVM can't really support it. In this case the fallback caused KVM to intercept each PAUSE instruction; in some cases, such intercept can slow down the nested guest so much that it can fail to boot. Instead, before the problematic commit KVM was already setting both thresholds to 0 in vmcb02, but after the first userspace VM exit shrink_ple_window was called and would reset the pause_filter_count to the default value. To fix this, change the fallback strategy - ignore the guest threshold values, but use/update the host threshold values unless the guest specifically requests disabling PAUSE filtering (either simple or advanced). Also fix a minor bug: on nested VM exit, when PAUSE filter counter were copied back to vmcb01, a dirty bit was not set. Thanks a lot to Suravee Suthikulpanit for debugging this! Fixes: 74fd41ed16fd ("KVM: x86: nSVM: support PAUSE filtering when L0 doesn't intercept PAUSE") Reported-by: Suravee Suthikulpanit Tested-by: Suravee Suthikulpanit Co-developed-by: Maxim Levitsky Message-Id: <20220518072709.730031-1-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit ba8ec273240a7a67819b5957c8d06a267ec54db7 Author: Maxim Levitsky Date: Mon Jun 6 21:08:29 2022 +0300 KVM: x86: SVM: drop preempt-safe wrappers for avic_vcpu_load/put Now that these functions are always called with preemption disabled, remove the preempt_disable()/preempt_enable() pair inside them. No functional change intended. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 18869f26df1a11ed11031dfb7392bc7d774062e8 Author: Maxim Levitsky Date: Mon Jun 6 21:08:28 2022 +0300 KVM: x86: disable preemption around the call to kvm_arch_vcpu_{un|}blocking On SVM, if preemption happens right after the call to finish_rcuwait but before call to kvm_arch_vcpu_unblocking on SVM/AVIC, it itself will re-enable AVIC, and then we will try to re-enable it again in kvm_arch_vcpu_unblocking which will lead to a warning in __avic_vcpu_load. The same problem can happen if the vCPU is preempted right after the call to kvm_arch_vcpu_blocking but before the call to prepare_to_rcuwait and in this case, we will end up with AVIC enabled during sleep - Ooops. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 66c768d30e64e1280520f34dbef83419f55f3459 Author: Maxim Levitsky Date: Mon Jun 6 21:08:27 2022 +0300 KVM: x86: disable preemption while updating apicv inhibition Currently nothing prevents preemption in kvm_vcpu_update_apicv. On SVM, If the preemption happens after we update the vcpu->arch.apicv_active, the preemption itself will 'update' the inhibition since the AVIC will be first disabled on vCPU unload and then enabled, when the current task is loaded again. Then we will try to update it again, which will lead to a warning in __avic_vcpu_load, that the AVIC is already enabled. Fix this by disabling preemption in this code. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 603ccef42ce9f07840cf4c0448f3261413460b07 Author: Maxim Levitsky Date: Mon Jun 6 21:08:26 2022 +0300 KVM: x86: SVM: fix avic_kick_target_vcpus_fast There are two issues in avic_kick_target_vcpus_fast 1. It is legal to issue an IPI request with APIC_DEST_NOSHORT and a physical destination of 0xFF (or 0xFFFFFFFF in case of x2apic), which must be treated as a broadcast destination. Fix this by explicitly checking for it. Also don’t use ‘index’ in this case as it gives no new information. 2. It is legal to issue a logical IPI request to more than one target. Index field only provides index in physical id table of first such target and therefore can't be used before we are sure that only a single target was addressed. Instead, parse the ICRL/ICRH, double check that a unicast interrupt was requested, and use that info to figure out the physical id of the target vCPU. At that point there is no need to use the index field as well. In addition to fixing the above issues, also skip the call to kvm_apic_match_dest. It is possible to do this now, because now as long as AVIC is not inhibited, it is guaranteed that none of the vCPUs changed their apic id from its default value. This fixes boot of windows guest with AVIC enabled because it uses IPI with 0xFF destination and no destination shorthand. Fixes: 7223fd2d5338 ("KVM: SVM: Use target APIC ID to complete AVIC IRQs when possible") Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit f5f9089f76ddc882b915c5d78e4beeb48dcabd1b Author: Maxim Levitsky Date: Mon Jun 6 21:08:25 2022 +0300 KVM: x86: SVM: remove avic's broken code that updated APIC ID AVIC is now inhibited if the guest changes the apic id, and therefore this code is no longer needed. There are several ways this code was broken, including: 1. a vCPU was only allowed to change its apic id to an apic id of an existing vCPU. 2. After such change, the vCPU whose apic id entry was overwritten, could not correctly change its own apic id, because its own entry is already overwritten. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 3743c2f0251743b8ae968329708bbbeefff244cf Author: Maxim Levitsky Date: Mon Jun 6 21:08:24 2022 +0300 KVM: x86: inhibit APICv/AVIC on changes to APIC ID or APIC base Neither of these settings should be changed by the guest and it is a burden to support it in the acceleration code, so just inhibit this code instead. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit a9603ae0e4ee6e7de0184801d4abe5925f43b49c Author: Maxim Levitsky Date: Mon Jun 6 21:08:23 2022 +0300 KVM: x86: document AVIC/APICv inhibit reasons These days there are too many AVIC/APICv inhibit reasons, and it doesn't hurt to have some documentation for them. Signed-off-by: Maxim Levitsky Message-Id: <20220606180829.102503-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit d2263de1372a452cb64666990043b8be5c40b2a1 Author: Yuan Yao Date: Wed Jun 8 09:20:15 2022 +0800 KVM: x86/mmu: Set memory encryption "value", not "mask", in shadow PDPTRs Assign shadow_me_value, not shadow_me_mask, to PAE root entries, a.k.a. shadow PDPTRs, when host memory encryption is supported. The "mask" is the set of all possible memory encryption bits, e.g. MKTME KeyIDs, whereas "value" holds the actual value that needs to be stuffed into host page tables. Using shadow_me_mask results in a failed VM-Entry due to setting reserved PA bits in the PDPTRs, and ultimately causes an OOPS due to physical addresses with non-zero MKTME bits sending to_shadow_page() into the weeds: set kvm_intel.dump_invalid_vmcs=1 to dump internal KVM state. BUG: unable to handle page fault for address: ffd43f00063049e8 PGD 86dfd8067 P4D 0 Oops: 0000 [#1] PREEMPT SMP RIP: 0010:mmu_free_root_page+0x3c/0x90 [kvm] kvm_mmu_free_roots+0xd1/0x200 [kvm] __kvm_mmu_unload+0x29/0x70 [kvm] kvm_mmu_unload+0x13/0x20 [kvm] kvm_arch_destroy_vm+0x8a/0x190 [kvm] kvm_put_kvm+0x197/0x2d0 [kvm] kvm_vm_release+0x21/0x30 [kvm] __fput+0x8e/0x260 ____fput+0xe/0x10 task_work_run+0x6f/0xb0 do_exit+0x327/0xa90 do_group_exit+0x35/0xa0 get_signal+0x911/0x930 arch_do_signal_or_restart+0x37/0x720 exit_to_user_mode_prepare+0xb2/0x140 syscall_exit_to_user_mode+0x16/0x30 do_syscall_64+0x4e/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: e54f1ff244ac ("KVM: x86/mmu: Add shadow_me_value and repurpose shadow_me_mask") Signed-off-by: Yuan Yao Reviewed-by: Kai Huang Message-Id: <20220608012015.19566-1-yuan.yao@intel.com> Signed-off-by: Paolo Bonzini commit 76599a4761432a9f0a39f7d64f851b2deb57bdab Merge: 66da65005aa81 bcbfb588cf323 Author: Paolo Bonzini Date: Thu Jun 9 10:32:17 2022 -0400 Merge tag 'kvmarm-fixes-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.19, take #1 - Properly reset the SVE/SME flags on vcpu load - Fix a vgic-v2 regression regarding accessing the pending state of a HW interrupt from userspace (and make the code common with vgic-v3) - Fix access to the idreg range for protected guests - Ignore 'kvm-arm.mode=protected' when using VHE - Return an error from kvm_arch_init_vm() on allocation failure - A bunch of small cleanups (comments, annotations, indentation) commit 4527d47bb63a134c4483a1a478d0ff5874b466c7 Author: GONG, Ruiqi Date: Tue Jun 7 19:08:48 2022 +0800 drm/atomic: fix warning of unused variable Fix the `unused-but-set-variable` warning as how other iteration wrappers do. Link: https://lore.kernel.org/all/202206071049.pofHsRih-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: GONG, Ruiqi Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220607110848.941486-1-gongruiqi1@huawei.com commit 66da65005aa819e0b8d3a08f5ec1491b7690cb67 Merge: 6cd88243c7e03 1a12b25274b9e Author: Paolo Bonzini Date: Thu Jun 9 09:45:00 2022 -0400 Merge tag 'kvm-riscv-fixes-5.19-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.19, take #1 - Typo fix in arch/riscv/kvm/vmid.c - Remove broken reference pattern from MAINTAINERS entry commit 8e1278444446fc97778a5e5c99bca1ce0bbc5ec9 Author: Michael Ellerman Date: Tue Jun 7 00:34:56 2022 +1000 powerpc/32: Fix overread/overwrite of thread_struct via ptrace The ptrace PEEKUSR/POKEUSR (aka PEEKUSER/POKEUSER) API allows a process to read/write registers of another process. To get/set a register, the API takes an index into an imaginary address space called the "USER area", where the registers of the process are laid out in some fashion. The kernel then maps that index to a particular register in its own data structures and gets/sets the value. The API only allows a single machine-word to be read/written at a time. So 4 bytes on 32-bit kernels and 8 bytes on 64-bit kernels. The way floating point registers (FPRs) are addressed is somewhat complicated, because double precision float values are 64-bit even on 32-bit CPUs. That means on 32-bit kernels each FPR occupies two word-sized locations in the USER area. On 64-bit kernels each FPR occupies one word-sized location in the USER area. Internally the kernel stores the FPRs in an array of u64s, or if VSX is enabled, an array of pairs of u64s where one half of each pair stores the FPR. Which half of the pair stores the FPR depends on the kernel's endianness. To handle the different layouts of the FPRs depending on VSX/no-VSX and big/little endian, the TS_FPR() macro was introduced. Unfortunately the TS_FPR() macro does not take into account the fact that the addressing of each FPR differs between 32-bit and 64-bit kernels. It just takes the index into the "USER area" passed from userspace and indexes into the fp_state.fpr array. On 32-bit there are 64 indexes that address FPRs, but only 32 entries in the fp_state.fpr array, meaning the user can read/write 256 bytes past the end of the array. Because the fp_state sits in the middle of the thread_struct there are various fields than can be overwritten, including some pointers. As such it may be exploitable. It has also been observed to cause systems to hang or otherwise misbehave when using gdbserver, and is probably the root cause of this report which could not be easily reproduced: https://lore.kernel.org/linuxppc-dev/dc38afe9-6b78-f3f5-666b-986939e40fc6@keymile.com/ Rather than trying to make the TS_FPR() macro even more complicated to fix the bug, or add more macros, instead add a special-case for 32-bit kernels. This is more obvious and hopefully avoids a similar bug happening again in future. Note that because 32-bit kernels never have VSX enabled the code doesn't need to consider TS_FPRWIDTH/OFFSET at all. Add a BUILD_BUG_ON() to ensure that 32-bit && VSX is never enabled. Fixes: 87fec0514f61 ("powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds") Cc: stable@vger.kernel.org # v3.13+ Reported-by: Ariel Miculas Tested-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220609133245.573565-1-mpe@ellerman.id.au commit 2c5947cffd81ac8181346efacdca3c777ab330ba Author: Christian Lamparter Date: Tue Jun 7 20:59:18 2022 +0200 Revert "mtd: rawnand: add support for Toshiba TC58NVG0S3HTA00 NAND flash" This reverts commit 3380557fc7e28d9bce7607e16d98f123d36da4ca. It turned out this "4-byte" ID might have been an honest mistake. Regrettably, the chip Andreas has might be a counterfeit or is damaged in some other way and shouldn't have ended up in a router. Andreas reported his chip is returning just four bytes: "98 f1 80 15 00 00 00 00". However, according to Kioxia/Toshiba's datasheet, there should have been at least another byte that would have contained the correct OOB size that Andreas needed. Miquel and Andreas are both favoring reverting the patch over further, possibly hacky modifications: "[Reverting] is the safest option here. Apart from this device, we do not know how many devices have these damaged/counterfeit chips. If it is just a couple and only on Fritzboxes, as suggested in the Github issue the patch could be carried through OpenWrt[...]" Thanks to several users on the openwrt forum and github issue, who stayed along for the ride: - Peter-vdL for reporting the issue and testing patches. - neg2led and Hannu Nyman who did all the datasheet digging and debugging. Cc: Andreas Boehler Suggested-by: Andreas Boehler Suggested-by: Miquel Raynal Link: https://github.com/openwrt/openwrt/issues/9962 Signed-off-by: Christian Lamparter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220607185918.1048204-1-chunkeey@gmail.com commit 158f7585bfcea4aae0ad4128d032a80fec550df1 Author: Slark Xiao Date: Wed Jun 1 11:47:40 2022 +0800 USB: serial: option: add support for Cinterion MV31 with new baseline Adding support for Cinterion device MV31 with Qualcomm new baseline. Use different PIDs to separate it from previous base line products. All interfaces settings keep same as previous. Below is test evidence: T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1e2d ProdID=00b8 Rev=04.14 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00B8 USB Mobile Broadband S: SerialNumber=90418e79 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1e2d ProdID=00b9 Rev=04.14 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00B9 USB Mobile Broadband S: SerialNumber=90418e79 C: #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option For PID 00b8, interface 3 is GNSS port which don't use serial driver. Signed-off-by: Slark Xiao Link: https://lore.kernel.org/r/20220601034740.5438-1-slark_xiao@163.com [ johan: rename defines using a "2" infix ] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 204e6ceaa1035cb7b92b156517e88842ebb4c7ff Author: Sungjong Seo Date: Wed Jun 8 00:05:21 2022 +0900 exfat: use updated exfat_chain directly during renaming In order for a file to access its own directory entry set, exfat_inode_info(ei) has two copied values. One is ei->dir, which is a snapshot of exfat_chain of the parent directory, and the other is ei->entry, which is the offset of the start of the directory entry set in the parent directory. Since the parent directory can be updated after the snapshot point, it should be used only for accessing one's own directory entry set. However, as of now, during renaming, it could try to traverse or to allocate clusters via snapshot values, it does not make sense. This potential problem has been revealed when exfat_update_parent_info() was removed by commit d8dad2588add ("exfat: fix referencing wrong parent directory information after renaming"). However, I don't think it's good idea to bring exfat_update_parent_info() back. Instead, let's use the updated exfat_chain of parent directory diectly. Fixes: d8dad2588add ("exfat: fix referencing wrong parent directory information after renaming") Reported-by: Wang Yugui Signed-off-by: Sungjong Seo Tested-by: Wang Yugui Signed-off-by: Namjae Jeon commit bcbfb588cf323929ac46767dd14e392016bbce04 Author: Marc Zyngier Date: Thu Jun 9 13:12:23 2022 +0100 KVM: arm64: Drop stale comment The layout of 'struct kvm_vcpu_arch' has evolved significantly since the initial port of KVM/arm64, so remove the stale comment suggesting that a prefix of the structure is used exclusively from assembly code. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-7-will@kernel.org commit 5879c97f37022ff22a3f13174c24fcf2807fdbc0 Author: Will Deacon Date: Thu Jun 9 13:12:22 2022 +0100 KVM: arm64: Remove redundant hyp_assert_lock_held() assertions host_stage2_try() asserts that the KVM host lock is held, so there's no need to duplicate the assertion in its wrappers. Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-6-will@kernel.org commit 112f3bab41113dc53b4f35e9034b2208245bc002 Author: Will Deacon Date: Thu Jun 9 13:12:21 2022 +0100 KVM: arm64: Extend comment in has_vhe() has_vhe() expands to a compile-time constant when evaluated from the VHE or nVHE code, alternatively checking a static key when called from elsewhere in the kernel. On face value, this looks like a case of premature optimization, but in fact this allows symbol references on VHE-specific code paths to be dropped from the nVHE object. Expand the comment in has_vhe() to make this clearer, hopefully discouraging anybody from simplifying the code. Cc: David Brazdil Acked-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-5-will@kernel.org commit cde5042adf11b0a30a6ce0ec3d071afcf8d2efaf Author: Will Deacon Date: Thu Jun 9 13:12:20 2022 +0100 KVM: arm64: Ignore 'kvm-arm.mode=protected' when using VHE Ignore 'kvm-arm.mode=protected' when using VHE so that kvm_get_mode() only returns KVM_MODE_PROTECTED on systems where the feature is available. Cc: David Brazdil Acked-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-4-will@kernel.org commit fa7a17214488ef7df347dcd1a5594f69ea17f4dc Author: Marc Zyngier Date: Thu Jun 9 13:12:19 2022 +0100 KVM: arm64: Handle all ID registers trapped for a protected VM A protected VM accessing ID_AA64ISAR2_EL1 gets punished with an UNDEF, while it really should only get a zero back if the register is not handled by the hypervisor emulation (as mandated by the architecture). Introduce all the missing ID registers (including the unallocated ones), and have them to return 0. Reported-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-3-will@kernel.org commit ae187fec75aa670a551d9662f83e3947d3f02a69 Author: Will Deacon Date: Thu Jun 9 13:12:18 2022 +0100 KVM: arm64: Return error from kvm_arch_init_vm() on allocation failure If we fail to allocate the 'supported_cpus' cpumask in kvm_arch_init_vm() then be sure to return -ENOMEM instead of success (0) on the failure path. Reviewed-by: Alexandru Elisei Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220609121223.2551-2-will@kernel.org commit 908e698f2149c3d6a67d9ae15c75545a3f392559 Author: Robert Eckelmann Date: Sat May 21 23:08:08 2022 +0900 USB: serial: io_ti: add Agilent E5805A support Add support for Agilent E5805A (rebranded ION Edgeport/4) to io_ti. Signed-off-by: Robert Eckelmann Link: https://lore.kernel.org/r/20220521230808.30931eca@octoberrain Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit b6c8cd80ace30f308aeec0ecf946f55dec60cc68 Author: Guenter Roeck Date: Fri Jun 3 06:14:19 2022 -0700 watchdog: gxp: Add missing MODULE_LICENSE The build system says: ERROR: modpost: missing MODULE_LICENSE() in drivers/watchdog/gxp-wdt.o Add the missing MODULE_LICENSE. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/all/20220603131419.2948578-1-linux@roeck-us.net/ Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 7219b824e3bc56f9cf074c1929009c0c8690d899 Merge: f2906aa863381 b93a8b2c51616 Author: Bartosz Golaszewski Date: Thu Jun 9 11:07:54 2022 +0200 Merge tag 'intel-gpio-v5.19-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-current intel-gpio for v5.19-2 * Convert IRQ chips in Diolan and Intel GPIO drivers to be immutable commit 477277c7fd43d48ae68cbdcaa7c0f82024a87421 Author: Thomas Zimmermann Date: Tue Jun 7 11:20:04 2022 +0200 drm/ast: Support multiple outputs Systems with AST graphics can have multiple output; typically VGA plus some other port. Record detected output chips in a bitmask and initialize each output on its own. Assume a VGA output by default and use SIL164 and DP501 if available. For ASTDP assume that it can run in parallel with VGA. Tested on AST2100. v3: * define a macro for each BIT(ast_tx_chip) (Patrik) v2: * make VGA/SIL164/DP501 mutually exclusive Signed-off-by: Thomas Zimmermann Reviewed-by: Patrik Jakobsson Fixes: a59b026419f3 ("drm/ast: Initialize encoder and connector for VGA in helper function") Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220607092008.22123-2-tzimmermann@suse.de (cherry picked from commit 7f35680ada234ce00828b8ea841ba7ca1e00ff52) Signed-off-by: Thomas Zimmermann commit 0a178750647e47de1700edb2cbd9b0854122f4b9 Merge: f2906aa863381 431d071286524 Author: Dave Airlie Date: Thu Jun 9 17:22:48 2022 +1000 Merge tag 'amd-drm-fixes-5.19-2022-06-08' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.19-2022-06-08: amdgpu: - DCN 3.1 golden settings fix - eDP fixes - DMCUB fixes - GFX11 fixes and cleanups - VCN fix for yellow carp - GMC11 fixes - RAS fixes - GPUVM TLB flush fixes - SMU13 fixes - VCN3 AV1 regression fix - VCN2 JPEG fix - Other misc fixes amdkfd: - MMU notifier fix - Support for more GC 10.3.x families - Pinned BO handling fix - Partial migration bug fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220608203008.6187-1-alexander.deucher@amd.com commit a7cd3cf0b2e5aaacfe5e02c472bd28e98e640be7 Author: Peter Robinson Date: Mon Jun 6 17:10:34 2022 +0100 dmaengine: imx-sdma: Allow imx8m for imx7 FW revs The revision of the imx-sdma IP that is in the i.MX8M series is the same is that as that in the i.MX7 series but the imx7d MODULE_FIRMWARE directive is wrapped in a condiditional which means it's not defined when built for aarch64 SOC_IMX8M platforms and hence you get the following errors when the driver loads on imx8m devices: imx-sdma 302c0000.dma-controller: Direct firmware load for imx/sdma/sdma-imx7d.bin failed with error -2 imx-sdma 302c0000.dma-controller: external firmware not found, using ROM firmware Add the SOC_IMX8M into the check so the firmware can load on i.MX8. Fixes: 1474d48bd639 ("arm64: dts: imx8mq: Add SDMA nodes") Fixes: 941acd566b18 ("dmaengine: imx-sdma: Only check ratio on parts that support 1:1") Signed-off-by: Peter Robinson Cc: stable@vger.kernel.org # v5.2+ Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220606161034.3544803-1-pbrobinson@gmail.com Signed-off-by: Vinod Koul commit 646728dff254f8070da5d2f82494a065d4287e26 Author: Vinod Koul Date: Mon Jun 6 23:19:06 2022 +0530 dmaengine: Revert "dmaengine: add verification of DMA_INTERRUPT capability for dmatest" This reverts commit a8facc7b9885 ("dmaengine: add verification of DMA_INTERRUPT capability for dmatest") as it causes regression due to the fact that DMA_INTERRUPT in linked to dma_prep_interrupt() so checking that is incorrect here Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20220606174906.3979283-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 615a4bfc426e11dba05c2cf343f9ac752fb381d2 Author: Miaoqian Lin Date: Sun Jun 5 08:27:22 2022 +0400 dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Fixes: a074ae38f859 ("dmaengine: Add driver for TI DMA crossbar on DRA7x") Signed-off-by: Miaoqian Lin Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220605042723.17668-1-linmq006@gmail.com Signed-off-by: Vinod Koul commit c132fe78ad7b4ce8b5d49a501a15c29d08eeb23a Author: Miaoqian Lin Date: Sun Jun 5 08:27:23 2022 +0400 dmaengine: ti: Fix refcount leak in ti_dra7_xbar_route_allocate of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. Add missing of_node_put() in to fix this. Fixes: ec9bfa1e1a79 ("dmaengine: ti-dma-crossbar: dra7: Use bitops instead of idr") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220605042723.17668-2-linmq006@gmail.com Signed-off-by: Vinod Koul commit 00d1f546470d89e072dd3cda12b5c794341e7268 Author: Jason Wang Date: Thu Jun 9 12:19:01 2022 +0800 vdpa: make get_vq_group and set_group_asid optional This patch makes get_vq_group and set_group_asid optional. This is needed to unbreak the vDPA parent that doesn't support multiple address spaces. Cc: Gautam Dawar Fixes: aaca8373c4b1 ("vhost-vdpa: support ASID based IOTLB API") Signed-off-by: Jason Wang Message-Id: <20220609041901.2029-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit acb0055e187334554398a381a16de72f1a3d47bb Author: Bo Liu Date: Wed Jun 8 23:11:06 2022 -0400 virtio: Fix all occurences of the "the the" typo There are double "the" in message in file virtio_mmio.c and virtio_pci_modern_dev.c, fix it. Signed-off-by: Bo Liu Message-Id: <20220609031106.2161-1-liubo03@inspur.com> Signed-off-by: Michael S. Tsirkin commit 647df0d41b6bd8f4987dde6e8d8d0aba5b082985 Author: Justin Stitt Date: Tue Jun 7 12:11:19 2022 -0700 net: amd-xgbe: fix clang -Wformat warning see warning: | drivers/net/ethernet/amd/xgbe/xgbe-drv.c:2787:43: warning: format specifies | type 'unsigned short' but the argument has type 'int' [-Wformat] | netdev_dbg(netdev, "Protocol: %#06hx\n", ntohs(eth->h_proto)); | ~~~~~~ ^~~~~~~~~~~~~~~~~~~ Variadic functions (printf-like) undergo default argument promotion. Documentation/core-api/printk-formats.rst specifically recommends using the promoted-to-type's format flag. Also, as per C11 6.3.1.1: (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int can represent all values of the original type ..., the value is converted to an int; otherwise, it is converted to an unsigned int. These are called the integer promotions.` Since the argument is a u16 it will get promoted to an int and thus it is most accurate to use the %x format specifier here. It should be noted that the `#06` formatting sugar does not alter the promotion rules. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220607191119.20686-1-jstitt007@gmail.com Signed-off-by: Jakub Kicinski commit e67b72b90b7e19a4be4d9c29f3feea6f58ab43f8 Author: Muchun Song Date: Tue Jun 7 15:02:14 2022 +0800 tcp: use alloc_large_system_hash() to allocate table_perturb In our server, there may be no high order (>= 6) memory since we reserve lots of HugeTLB pages when booting. Then the system panic. So use alloc_large_system_hash() to allocate table_perturb. Fixes: e9261476184b ("tcp: dynamically allocate the perturb table used by source ports") Signed-off-by: Muchun Song Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220607070214.94443-1-songmuchun@bytedance.com Signed-off-by: Jakub Kicinski commit 487994ff75880569d32504d7e70da8b3328e0693 Author: Alvin Šipraga Date: Tue Jun 7 20:46:24 2022 +0200 net: dsa: realtek: rtl8365mb: fix GMII caps for ports with internal PHY Since commit a18e6521a7d9 ("net: phylink: handle NA interface mode in phylink_fwnode_phy_connect()"), phylib defaults to GMII when no phy-mode or phy-connection-type property is specified in a DSA port node of the device tree. The same commit caused a regression in rtl8365mb whereby phylink would fail to connect, because the driver did not advertise support for GMII for ports with internal PHY. It should be noted that the aforementioned regression is not because the blamed commit was incorrect: on the contrary, the blamed commit is correcting the previous behaviour whereby unspecified phy-mode would cause the internal interface mode to be PHY_INTERFACE_MODE_NA. The rtl8365mb driver only worked by accident before because it _did_ advertise support for PHY_INTERFACE_MODE_NA, despite NA being reserved for internal use by phylink. With one mistake fixed, the other was exposed. Commit a5dba0f207e5 ("net: dsa: rtl8365mb: add GMII as user port mode") then introduced implicit support for GMII mode on ports with internal PHY to allow a PHY connection for device trees where the phy-mode is not explicitly set to "internal". At this point everything was working OK again. Subsequently, commit 6ff6064605e9 ("net: dsa: realtek: convert to phylink_generic_validate()") broke this behaviour again by discarding the usage of rtl8365mb_phy_mode_supported() - where this GMII support was indicated - while switching to the new .phylink_get_caps API. With the new API, rtl8365mb_phy_mode_supported() is no longer needed. Remove it altogether and add back the GMII capability - this time to rtl8365mb_phylink_get_caps() - so that the above default behaviour works for ports with internal PHY again. Fixes: 6ff6064605e9 ("net: dsa: realtek: convert to phylink_generic_validate()") Signed-off-by: Alvin Šipraga Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220607184624.417641-1-alvin@pqrs.dk Signed-off-by: Jakub Kicinski commit 568a32f5653d3131374057589c2627b330d3a177 Merge: 5d4af9c1f04ab 7bb0fb7c63df9 Author: Jakub Kicinski Date: Wed Jun 8 21:02:22 2022 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-06-07 This series contains updates to ixgbe driver only. Olivier Matz resolves an issue so that broadcast packets can still be received when VF removes promiscuous settings and removes setting of VLAN promiscuous, in promiscuous mode, to prevent a loop when VFs are bridged. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ixgbe: fix unexpected VLAN Rx in promisc mode on VF ixgbe: fix bcast packets Rx on VF after promisc removal ==================== Link: https://lore.kernel.org/r/20220607181538.748786-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 5d4af9c1f04ab0411ba5818baad9a68e87f33099 Merge: 11ec18b1d8d92 b4d78731b34bd Author: Jakub Kicinski Date: Wed Jun 8 20:58:32 2022 -0700 Merge branch 'mv88e6xxx-fixes-for-reading-serdes-state' Russell King says: ==================== mv88e6xxx: fixes for reading serdes state These are some low-priority fixes to the mv88e6xxx serdes code. Patch 1 fixes the reporting of an_complete, which is used in the emulation of a conventional C22 PHY. Patch from Marek. Patch 2 makes one of the error messages in patch 2 to be consistent with the other error messages in this function. Patch 3 ensures that we do not miss a link-failure event. ==================== Link: https://lore.kernel.org/r/Yp82TyoLon9jz6k3@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit b4d78731b34bd6bfd1bfedce26a55e3582b0bc14 Author: Russell King (Oracle) Date: Tue Jun 7 12:28:52 2022 +0100 net: dsa: mv88e6xxx: correctly report serdes link failure Phylink wants to know if the link has dropped since the last time state was retrieved, and the BMSR gives us that. Read the BMSR and use it when deciding the link state. Fill in the an_complete member as well for the emulated PHY state. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 2b4bb9cd9bcdbe1f791fec18a7c8728cb6989bf8 Author: Russell King (Oracle) Date: Tue Jun 7 12:28:47 2022 +0100 net: dsa: mv88e6xxx: fix BMSR error to be consistent with others Other errors accessing the registers in mv88e6352_serdes_pcs_get_state() print "PHY " before the register name, except for the BMSR. Make this consistent with the other error messages. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 47e96930d6e6106d5252e85b868d3c7e29296de0 Author: Marek Behún Date: Tue Jun 7 12:28:42 2022 +0100 net: dsa: mv88e6xxx: use BMSR_ANEGCOMPLETE bit for filling an_complete Commit ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed") added the ability to link if AN was bypassed, and added filling of state->an_complete field, but set it to true if AN was enabled in BMCR, not when AN was reported complete in BMSR. This was done because for some reason, when I wanted to use BMSR value to infer an_complete, I was looking at BMSR_ANEGCAPABLE bit (which was always 1), instead of BMSR_ANEGCOMPLETE bit. Use BMSR_ANEGCOMPLETE for filling state->an_complete. Fixes: ede359d8843a ("net: dsa: mv88e6xxx: Link in pcs_get_state() if AN is bypassed") Signed-off-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 11ec18b1d8d92b9df307d31950dcba0b3dd7283c Author: Miaoqian Lin Date: Tue Jun 7 08:11:43 2022 +0400 net: altera: Fix refcount leak in altera_tse_mdio_create Every iteration of for_each_child_of_node() decrements the reference count of the previous node. When break from a for_each_child_of_node() loop, we need to explicitly call of_node_put() on the child node when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: bbd2190ce96d ("Altera TSE: Add main and header file for Altera Ethernet Driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220607041144.7553-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski commit 2061ecfdf2350994e5b61c43e50e98a7a70e95ee Author: Ilya Maximets Date: Tue Jun 7 00:11:40 2022 +0200 net: openvswitch: fix misuse of the cached connection on tuple changes If packet headers changed, the cached nfct is no longer relevant for the packet and attempt to re-use it leads to the incorrect packet classification. This issue is causing broken connectivity in OpenStack deployments with OVS/OVN due to hairpin traffic being unexpectedly dropped. The setup has datapath flows with several conntrack actions and tuple changes between them: actions:ct(commit,zone=8,mark=0/0x1,nat(src)), set(eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:06)), set(ipv4(src=172.18.2.10,dst=192.168.100.6,ttl=62)), ct(zone=8),recirc(0x4) After the first ct() action the packet headers are almost fully re-written. The next ct() tries to re-use the existing nfct entry and marks the packet as invalid, so it gets dropped later in the pipeline. Clearing the cached conntrack entry whenever packet tuple is changed to avoid the issue. The flow key should not be cleared though, because we should still be able to match on the ct_state if the recirculation happens after the tuple change but before the next ct() action. Cc: stable@vger.kernel.org Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action") Reported-by: Frode Nordahl Link: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-May/051829.html Link: https://bugs.launchpad.net/ubuntu/+source/ovn/+bug/1967856 Signed-off-by: Ilya Maximets Link: https://lore.kernel.org/r/20220606221140.488984-1-i.maximets@ovn.org Signed-off-by: Jakub Kicinski commit 1a12b25274b9e54b0d2d59e21620f8cf13b268cb Author: Lukas Bulwahn Date: Thu Jun 9 09:18:22 2022 +0530 MAINTAINERS: Limit KVM RISC-V entry to existing selftests Commit fed9b26b2501 ("MAINTAINERS: Update KVM RISC-V entry to cover selftests support") optimistically adds a file entry for tools/testing/selftests/kvm/riscv/, but this directory does not exist. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. The script is very useful to keep MAINTAINERS up to date and MAINTAINERS can be kept in a state where the script emits no warning. So, just drop the non-matching file entry rather than starting to collect exceptions of entries that may match in some close or distant future. Fixes: fed9b26b2501 ("MAINTAINERS: Update KVM RISC-V entry to cover selftests support") Signed-off-by: Lukas Bulwahn Signed-off-by: Anup Patel commit ea6c1213217dec65a8f9f396752b4d8bbcf226ea Author: Julia Lawall Date: Thu Jun 9 09:18:15 2022 +0530 RISC-V: KVM: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Anup Patel commit 2f2c0d2919a14002760f89f4e02960c735a316d2 Author: Chen Lin Date: Wed Jun 8 20:46:53 2022 +0800 net: ethernet: mtk_eth_soc: fix misuse of mem alloc interface netdev[napi]_alloc_frag When rx_flag == MTK_RX_FLAGS_HWLRO, rx_data_len = MTK_MAX_LRO_RX_LENGTH(4096 * 3) > PAGE_SIZE. netdev_alloc_frag is for alloction of page fragment only. Reference to other drivers and Documentation/vm/page_frags.rst Branch to use __get_free_pages when ring->frag_size > PAGE_SIZE. Signed-off-by: Chen Lin Link: https://lore.kernel.org/r/1654692413-2598-1-git-send-email-chen45464546@163.com Signed-off-by: Jakub Kicinski commit 8d21e9963bec1aad2280cdd034c8993033ef2948 Author: Willem de Bruijn Date: Mon Jun 6 09:21:07 2022 -0400 ip_gre: test csum_start instead of transport header GRE with TUNNEL_CSUM will apply local checksum offload on CHECKSUM_PARTIAL packets. ipgre_xmit must validate csum_start after an optional skb_pull, else lco_csum may trigger an overflow. The original check was if (csum && skb_checksum_start(skb) < skb->data) return -EINVAL; This had false positives when skb_checksum_start is undefined: when ip_summed is not CHECKSUM_PARTIAL. A discussed refinement was straightforward if (csum && skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_start(skb) < skb->data) return -EINVAL; But was eventually revised more thoroughly: - restrict the check to the only branch where needed, in an uncommon GRE path that uses header_ops and calls skb_pull. - test skb_transport_header, which is set along with csum_start in skb_partial_csum_set in the normal header_ops datapath. Turns out skbs can arrive in this branch without the transport header set, e.g., through BPF redirection. Revise the check back to check csum_start directly, and only if CHECKSUM_PARTIAL. Do leave the check in the updated location. Check field regardless of whether TUNNEL_CSUM is configured. Link: https://lore.kernel.org/netdev/YS+h%2FtqCJJiQei+W@shredder/ Link: https://lore.kernel.org/all/20210902193447.94039-2-willemdebruijn.kernel@gmail.com/T/#u Fixes: 8a0ed250f911 ("ip_gre: validate csum_start only on pull") Reported-by: syzbot Signed-off-by: Willem de Bruijn Reviewed-by: Eric Dumazet Reviewed-by: Alexander Duyck Link: https://lore.kernel.org/r/20220606132107.3582565-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit d5d4c36398ba66c033602b117b4be6174b7b8533 Merge: a6958951ebe7d 7c217aca85dd3 Author: Jakub Kicinski Date: Wed Jun 8 20:31:21 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-06-09 We've added 6 non-merge commits during the last 2 day(s) which contain a total of 8 files changed, 49 insertions(+), 15 deletions(-). The main changes are: 1) Fix an illegal copy_to_user() attempt seen by syzkaller through arm64 BPF JIT compiler, from Eric Dumazet. 2) Fix calling global functions from BPF_PROG_TYPE_EXT programs by using the correct program context type, from Toke Høiland-Jørgensen. 3) Fix XSK TX batching invalid descriptor handling, from Maciej Fijalkowski. 4) Fix potential integer overflows in multi-kprobe link code by using safer kvmalloc_array() allocation helpers, from Dan Carpenter. 5) Add Quentin as bpftool maintainer, from Quentin Monnet. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: MAINTAINERS: Add a maintainer for bpftool xsk: Fix handling of invalid descriptors in XSK TX batching API selftests/bpf: Add selftest for calling global functions from freplace bpf: Fix calling global functions from BPF_PROG_TYPE_EXT programs bpf: Use safer kvmalloc_array() where possible bpf, arm64: Clear prog->jited_len along prog->jited ==================== Link: https://lore.kernel.org/r/20220608234133.32265-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 481f7017c37a8c722a0b09985db1a35f15749d5d Author: Sergey Shtylyov Date: Wed Jun 8 23:37:09 2022 +0300 MAINTAINERS: add ATA sysfs file documentation to libata entry Add the (still missing!) ATA sysfs file documentation to the libata subsystem entry in the MAINTAINERS file. Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 72aad489f992871e908ff6d9055b26c6366fb864 Author: Sergey Shtylyov Date: Wed Jun 8 22:51:07 2022 +0300 ata: libata-transport: fix {dma|pio|xfer}_mode sysfs files The {dma|pio}_mode sysfs files are incorrectly documented as having a list of the supported DMA/PIO transfer modes, while the corresponding fields of the *struct* ata_device hold the transfer mode IDs, not masks. To match these docs, the {dma|pio}_mode (and even xfer_mode!) sysfs files are handled by the ata_bitfield_name_match() macro which leads to reading such kind of nonsense from them: $ cat /sys/class/ata_device/dev3.0/pio_mode XFER_UDMA_7, XFER_UDMA_6, XFER_UDMA_5, XFER_UDMA_4, XFER_MW_DMA_4, XFER_PIO_6, XFER_PIO_5, XFER_PIO_4, XFER_PIO_3, XFER_PIO_2, XFER_PIO_1, XFER_PIO_0 Using the correct ata_bitfield_name_search() macro fixes that: $ cat /sys/class/ata_device/dev3.0/pio_mode XFER_PIO_4 While fixing the file documentation, somewhat reword the {dma|pio}_mode file doc and add a note about being mostly useful for PATA devices to the xfer_mode file doc... Fixes: d9027470b886 ("[libata] Add ATA transport class") Signed-off-by: Sergey Shtylyov Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal commit 6bfb56e93bcef41859c2d5ab234ffd80b691be35 Author: Linus Torvalds Date: Wed Jun 8 13:18:39 2022 -0700 cert host tools: Stop complaining about deprecated OpenSSL functions OpenSSL 3.0 deprecated the OpenSSL's ENGINE API. That is as may be, but the kernel build host tools still use it. Disable the warning about deprecated declarations until somebody who cares fixes it. Signed-off-by: Linus Torvalds commit 6ba12b56b9b844b83ed54fb7ed59fb0eb41e4045 Author: Jiasheng Jiang Date: Thu May 26 17:41:00 2022 +0800 i2c: npcm7xx: Add check for platform_driver_register As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Jiasheng Jiang Acked-by: Tali Perry Signed-off-by: Wolfram Sang commit 8c4811e7a5a60443139369a623ca504bad9e3675 Author: Andy Shevchenko Date: Mon May 30 15:02:47 2022 +0300 MAINTAINERS: Update Synopsys DesignWare I2C to Supported The actual status of the code is Supported (from x86 perspective). Reported-by: dave.hansen@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula [wsa: fixed "DesignWare" spelling] Signed-off-by: Wolfram Sang commit 431d071286524bd4f9ba2e46b1be87b479220174 Author: Yifan Zhang Date: Fri Jun 3 10:24:31 2022 +0800 drm/amdgpu/mes: only invalid/prime icache when finish loading both pipe MES FWs. invalid/prime icahce operation takes effect both pipes cuconrrently, therefore CP_MES_IC_BASE_LO/HI and CP_MES_MDBASE_LO/HI both have to be set before prime icache. Otherwise MES hardware gets garbage data in above regsters and causes page fault [ 470.873200] amdgpu 0000:33:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:217 vmid:0 pasid:0, for process pid 0 thread pid 0) [ 470.873222] amdgpu 0000:33:00.0: amdgpu: in page starting at address 0x000092cb89b00000 from client 10 [ 470.873234] amdgpu 0000:33:00.0: amdgpu: GCVM_L2_PROTECTION_FAULT_STATUS:0x00000BB3 [ 470.873242] amdgpu 0000:33:00.0: amdgpu: Faulty UTCL2 client ID: CPC (0x5) [ 470.873247] amdgpu 0000:33:00.0: amdgpu: MORE_FAULTS: 0x1 [ 470.873251] amdgpu 0000:33:00.0: amdgpu: WALKER_ERROR: 0x1 [ 470.873256] amdgpu 0000:33:00.0: amdgpu: PERMISSION_FAULTS: 0xb [ 470.873260] amdgpu 0000:33:00.0: amdgpu: MAPPING_ERROR: 0x1 [ 470.873264] amdgpu 0000:33:00.0: amdgpu: RW: 0x0 Signed-off-by: Yifan Zhang Acked-by: Alex Deucher Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 8fa5e7b20e01042b14f8cd684d2da9b638460c74 Author: Mark Bloch Date: Mon May 30 10:46:59 2022 +0300 net/mlx5: fs, fail conflicting actions When combining two steering rules into one check not only do they share the same actions but those actions are also the same. This resolves an issue where when creating two different rules with the same match the actions are overwritten and one of the rules is deleted a FW syndrome can be seen in dmesg. mlx5_core 0000:03:00.0: mlx5_cmd_check:819:(pid 2105): DEALLOC_MODIFY_HEADER_CONTEXT(0x941) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0x1ab444) Fixes: 0d235c3fabb7 ("net/mlx5: Add hash table to search FTEs in a flow-group") Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 8bf94e6414c9481bfa28269022688ab445d0081d Author: Feras Daoud Date: Sat Mar 19 21:47:48 2022 +0200 net/mlx5: Rearm the FW tracer after each tracer event The current design does not arm the tracer if traces are available before the tracer string database is fully loaded, leading to an unfunctional tracer. This fix will rearm the tracer every time the FW triggers tracer event regardless of the tracer strings database status. Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling") Signed-off-by: Feras Daoud Signed-off-by: Roy Novich Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 3008e6a0049361e731b803c60fe8f3ab44e1d73f Author: Mark Bloch Date: Thu May 26 08:15:28 2022 +0300 net/mlx5: E-Switch, pair only capable devices OFFLOADS paring using devcom is possible only on devices that support LAG. Filter based on lag capabilities. This fixes an issue where mlx5_get_next_phys_dev() was called without holding the interface lock. This issue was found when commit bc4c2f2e0179 ("net/mlx5: Lag, filter non compatible devices") added an assert that verifies the interface lock is held. WARNING: CPU: 9 PID: 1706 at drivers/net/ethernet/mellanox/mlx5/core/dev.c:642 mlx5_get_next_phys_dev+0xd2/0x100 [mlx5_core] Modules linked in: mlx5_vdpa vringh vhost_iotlb vdpa mlx5_ib mlx5_core 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 iw_cm ib_umad ib_ipoib ib_cm ib_uverbs ib_core overlay fuse [last unloaded: mlx5_core] CPU: 9 PID: 1706 Comm: devlink Not tainted 5.18.0-rc7+ #11 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:mlx5_get_next_phys_dev+0xd2/0x100 [mlx5_core] Code: 02 00 75 48 48 8b 85 80 04 00 00 5d c3 31 c0 5d c3 be ff ff ff ff 48 c7 c7 08 41 5b a0 e8 36 87 28 e3 85 c0 0f 85 6f ff ff ff <0f> 0b e9 68 ff ff ff 48 c7 c7 0c 91 cc 84 e8 cb 36 6f e1 e9 4d ff RSP: 0018:ffff88811bf47458 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88811b398000 RCX: 0000000000000001 RDX: 0000000080000000 RSI: ffffffffa05b4108 RDI: ffff88812daaaa78 RBP: ffff88812d050380 R08: 0000000000000001 R09: ffff88811d6b3437 R10: 0000000000000001 R11: 00000000fddd3581 R12: ffff88815238c000 R13: ffff88812d050380 R14: ffff8881018aa7e0 R15: ffff88811d6b3428 FS: 00007fc82e18ae80(0000) GS:ffff88842e080000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f9630d1b421 CR3: 0000000149802004 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mlx5_esw_offloads_devcom_event+0x99/0x3b0 [mlx5_core] mlx5_devcom_send_event+0x167/0x1d0 [mlx5_core] esw_offloads_enable+0x1153/0x1500 [mlx5_core] ? mlx5_esw_offloads_controller_valid+0x170/0x170 [mlx5_core] ? wait_for_completion_io_timeout+0x20/0x20 ? mlx5_rescan_drivers_locked+0x318/0x810 [mlx5_core] mlx5_eswitch_enable_locked+0x586/0xc50 [mlx5_core] ? mlx5_eswitch_disable_pf_vf_vports+0x1d0/0x1d0 [mlx5_core] ? mlx5_esw_try_lock+0x1b/0xb0 [mlx5_core] ? mlx5_eswitch_enable+0x270/0x270 [mlx5_core] ? __debugfs_create_file+0x260/0x3e0 mlx5_devlink_eswitch_mode_set+0x27e/0x870 [mlx5_core] ? mutex_lock_io_nested+0x12c0/0x12c0 ? esw_offloads_disable+0x250/0x250 [mlx5_core] ? devlink_nl_cmd_trap_get_dumpit+0x470/0x470 ? rcu_read_lock_sched_held+0x3f/0x70 devlink_nl_cmd_eswitch_set_doit+0x217/0x620 Fixes: dd3fddb82780 ("net/mlx5: E-Switch, handle devcom events only for ports on the same device") Signed-off-by: Mark Bloch Reviewed-by: Roi Dayan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 15ef9efa855cf405fadd78272e1e5d04e09a1cf3 Author: Paul Blakey Date: Tue Mar 29 18:37:18 2022 +0300 net/mlx5e: CT: Fix cleanup of CT before cleanup of TC ct rules CT cleanup assumes that all tc rules were deleted first, and so is free to delete the CT shared resources (e.g the dr_action fwd_action which is shared for all tuples). But currently for uplink, this is happens in reverse, causing the below trace. CT cleanup is called from: mlx5e_cleanup_rep_tx()->mlx5e_cleanup_uplink_rep_tx()-> mlx5e_rep_tc_cleanup()->mlx5e_tc_esw_cleanup()-> mlx5_tc_ct_clean() Only afterwards, tc cleanup is called from: mlx5e_cleanup_rep_tx()->mlx5e_tc_ht_cleanup() which would have deleted all the tc ct rules, and so delete all the offloaded tuples. Fix this reversing the order of init and on cleanup, which will result in tc cleanup then ct cleanup. [ 9443.593347] WARNING: CPU: 2 PID: 206774 at drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c:1882 mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593349] Modules linked in: act_ct nf_flow_table rdma_ucm(O) rdma_cm(O) iw_cm(O) ib_ipoib(O) ib_cm(O) ib_umad(O) mlx5_core(O-) mlxfw(O) mlxdevm(O) auxiliary(O) ib_uverbs(O) psample ib_core(O) mlx_compat(O) ip_gre gre ip_tunnel act_vlan bonding geneve esp6_offload esp6 esp4_offload esp4 act_tunnel_key vxlan ip6_udp_tunnel udp_tunnel act_mirred act_skbedit act_gact cls_flower sch_ingress nfnetlink_cttimeout nfnetlink xfrm_user xfrm_algo 8021q garp stp ipmi_devintf mrp ipmi_msghandler llc openvswitch nsh nf_conncount nf_nat mst_pciconf(O) dm_multipath sbsa_gwdt uio_pdrv_genirq uio mlxbf_pmc mlxbf_pka mlx_trio mlx_bootctl(O) bluefield_edac sch_fq_codel ip_tables ipv6 crc_ccitt btrfs zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq raid1 raid0 crct10dif_ce i2c_mlxbf gpio_mlxbf2 mlxbf_gige aes_neon_bs aes_neon_blk [last unloaded: mlx5_ib] [ 9443.593419] CPU: 2 PID: 206774 Comm: modprobe Tainted: G O 5.4.0-1023.24.gc14613d-bluefield #1 [ 9443.593422] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:143ebaf Jan 11 2022 [ 9443.593424] pstate: 20000005 (nzCv daif -PAN -UAO) [ 9443.593489] pc : mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593545] lr : mlx5_ct_fs_smfs_destroy+0x24/0x30 [mlx5_core] [ 9443.593546] sp : ffff8000135dbab0 [ 9443.593548] x29: ffff8000135dbab0 x28: ffff0003a6ab8e80 [ 9443.593550] x27: 0000000000000000 x26: ffff0003e07d7000 [ 9443.593552] x25: ffff800009609de0 x24: ffff000397fb2120 [ 9443.593554] x23: ffff0003975c0000 x22: 0000000000000000 [ 9443.593556] x21: ffff0003975f08c0 x20: ffff800009609de0 [ 9443.593558] x19: ffff0003c8a13380 x18: 0000000000000014 [ 9443.593560] x17: 0000000067f5f125 x16: 000000006529c620 [ 9443.593561] x15: 000000000000000b x14: 0000000000000000 [ 9443.593563] x13: 0000000000000002 x12: 0000000000000001 [ 9443.593565] x11: ffff800011108868 x10: 0000000000000000 [ 9443.593567] x9 : 0000000000000000 x8 : ffff8000117fb270 [ 9443.593569] x7 : ffff0003ebc01288 x6 : 0000000000000000 [ 9443.593571] x5 : ffff800009591ab8 x4 : fffffe000f6d9a20 [ 9443.593572] x3 : 0000000080040001 x2 : fffffe000f6d9a20 [ 9443.593574] x1 : ffff8000095901d8 x0 : 0000000000000025 [ 9443.593577] Call trace: [ 9443.593634] mlx5dr_action_destroy+0x188/0x1a0 [mlx5_core] [ 9443.593688] mlx5_ct_fs_smfs_destroy+0x24/0x30 [mlx5_core] [ 9443.593743] mlx5_tc_ct_clean+0x34/0xa8 [mlx5_core] [ 9443.593797] mlx5e_tc_esw_cleanup+0x58/0x88 [mlx5_core] [ 9443.593851] mlx5e_rep_tc_cleanup+0x24/0x30 [mlx5_core] [ 9443.593905] mlx5e_cleanup_rep_tx+0x6c/0x78 [mlx5_core] [ 9443.593959] mlx5e_detach_netdev+0x74/0x98 [mlx5_core] [ 9443.594013] mlx5e_netdev_change_profile+0x70/0x180 [mlx5_core] [ 9443.594067] mlx5e_netdev_attach_nic_profile+0x34/0x40 [mlx5_core] [ 9443.594122] mlx5e_vport_rep_unload+0x15c/0x1a8 [mlx5_core] [ 9443.594177] mlx5_eswitch_unregister_vport_reps+0x228/0x298 [mlx5_core] [ 9443.594231] mlx5e_rep_remove+0x2c/0x38 [mlx5_core] [ 9443.594236] auxiliary_bus_remove+0x30/0x50 [auxiliary] [ 9443.594246] device_release_driver_internal+0x108/0x1d0 [ 9443.594248] driver_detach+0x5c/0xe8 [ 9443.594250] bus_remove_driver+0x64/0xd8 [ 9443.594253] driver_unregister+0x38/0x60 [ 9443.594255] auxiliary_driver_unregister+0x24/0x38 [auxiliary] [ 9443.594311] mlx5e_rep_cleanup+0x20/0x38 [mlx5_core] [ 9443.594365] mlx5e_cleanup+0x18/0x30 [mlx5_core] [ 9443.594419] cleanup+0xc/0x20cc [mlx5_core] [ 9443.594424] __arm64_sys_delete_module+0x154/0x2b0 [ 9443.594429] el0_svc_common.constprop.0+0xf4/0x200 [ 9443.594432] el0_svc_handler+0x38/0xa8 [ 9443.594435] el0_svc+0x10/0x26c Fixes: d1a3138f7913 ("net/mlx5e: TC, Move flow hashtable to be per rep") Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 4d995c1b9d49ee657e879745aa5e445f031c0dba Author: Saeed Mahameed Date: Fri Jun 3 14:33:03 2022 -0700 Revert "net/mlx5e: Allow relaxed ordering over VFs" FW is not ready, fix was sent too soon. This reverts commit f05ec8d9d0d62367b6e1f2cb50d7d2a45e7747cf. Fixes: f05ec8d9d0d6 ("net/mlx5e: Allow relaxed ordering over VFs") Signed-off-by: Saeed Mahameed commit ed872f92fd0946ba30f2acd05fc57e29cac29cd2 Author: Lukas Bulwahn Date: Wed Jun 1 06:57:38 2022 +0200 MAINTAINERS: adjust MELLANOX ETHERNET INNOVA DRIVERS to TLS support removal Commit 40379a0084c2 ("net/mlx5_fpga: Drop INNOVA TLS support") removes all files in the directory drivers/net/ethernet/mellanox/mlx5/core/accel/, but misses to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Remove the file entry to the removed directory in MELLANOX ETHERNET INNOVA DRIVERS. Signed-off-by: Lukas Bulwahn Signed-off-by: Saeed Mahameed commit a6958951ebe7db60e84b2437ee53aa4843028726 Author: Arnd Bergmann Date: Tue Jun 7 11:01:46 2022 +0200 au1000_eth: stop using virt_to_bus() The conversion to the dma-mapping API in linux-2.6.11 was incomplete and left a virt_to_bus() call around. There have been a number of fixes for DMA mapping API abuse in this driver, but this one always slipped through. Change it to just use the existing dma_addr_t pointer, and make it use the correct types throughout the driver to make it easier to understand the virtual vs dma address spaces. Signed-off-by: Arnd Bergmann Tested-by: Manuel Lauss Link: https://lore.kernel.org/r/20220607090206.19830-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit d5a37b19983725d2045588cfa3a4699f5b39ae26 Author: Christoph Hellwig Date: Wed Jun 8 08:34:07 2022 +0200 block: remove bioset_init_from_src Unused now, and the interface never really made a whole lot of sense to start with. Signed-off-by: Christoph Hellwig Signed-off-by: Mike Snitzer commit 29dec90a0f1d961b93f34f910e9319d8cb23edbd Author: Christoph Hellwig Date: Wed Jun 8 08:34:06 2022 +0200 dm: fix bio_set allocation The use of bioset_init_from_src mean that the pre-allocated pools weren't used for anything except parameter passing, and the integrity pool creation got completely lost for the actual live mapped_device. Fix that by assigning the actual preallocated dm_md_mempools to the mapped_device and using that for I/O instead of creating new mempools. Fixes: 2a2a4c510b76 ("dm: use bioset_init_from_src() to copy bio_set") Signed-off-by: Christoph Hellwig Signed-off-by: Mike Snitzer commit f638a84afef3dfe10554c51820c16e39a278c915 Author: Wang Yufen Date: Tue Jun 7 20:00:28 2022 +0800 ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg When len >= INT_MAX - transhdrlen, ulen = len + transhdrlen will be overflow. To fix, we can follow what udpv6 does and subtract the transhdrlen from the max. Signed-off-by: Wang Yufen Link: https://lore.kernel.org/r/20220607120028.845916-2-wangyufen@huawei.com Signed-off-by: Jakub Kicinski commit f93431c86b631bbca5614c66f966bf3ddb3c2803 Author: Wang Yufen Date: Tue Jun 7 20:00:27 2022 +0800 ipv6: Fix signed integer overflow in __ip6_append_data Resurrect ubsan overflow checks and ubsan report this warning, fix it by change the variable [length] type to size_t. UBSAN: signed-integer-overflow in net/ipv6/ip6_output.c:1489:19 2147479552 + 8567 cannot be represented in type 'int' CPU: 0 PID: 253 Comm: err Not tainted 5.16.0+ #1 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x214/0x230 show_stack+0x30/0x78 dump_stack_lvl+0xf8/0x118 dump_stack+0x18/0x30 ubsan_epilogue+0x18/0x60 handle_overflow+0xd0/0xf0 __ubsan_handle_add_overflow+0x34/0x44 __ip6_append_data.isra.48+0x1598/0x1688 ip6_append_data+0x128/0x260 udpv6_sendmsg+0x680/0xdd0 inet6_sendmsg+0x54/0x90 sock_sendmsg+0x70/0x88 ____sys_sendmsg+0xe8/0x368 ___sys_sendmsg+0x98/0xe0 __sys_sendmmsg+0xf4/0x3b8 __arm64_sys_sendmmsg+0x34/0x48 invoke_syscall+0x64/0x160 el0_svc_common.constprop.4+0x124/0x300 do_el0_svc+0x44/0xc8 el0_svc+0x3c/0x1e8 el0t_64_sync_handler+0x88/0xb0 el0t_64_sync+0x16c/0x170 Changes since v1: -Change the variable [length] type to unsigned, as Eric Dumazet suggested. Changes since v2: -Don't change exthdrlen type in ip6_make_skb, as Paolo Abeni suggested. Changes since v3: -Don't change ulen type in udpv6_sendmsg and l2tp_ip6_sendmsg, as Jakub Kicinski suggested. Reported-by: Hulk Robot Signed-off-by: Wang Yufen Link: https://lore.kernel.org/r/20220607120028.845916-1-wangyufen@huawei.com Signed-off-by: Jakub Kicinski commit f539316fe8106b4f4b4e95c1e70a31b545523b03 Author: Mark Brown Date: Wed Jun 8 12:59:15 2022 +0100 arm64/sme: Fix SVE/SME typo in ABI documentation Fix a cut'n'paste error. Reported-by: Luis Machado Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220608115915.251870-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit a3d52ac7750025b5a1f99eb1ccea0e31b58bf7bb Author: Mark Brown Date: Tue Jun 7 17:51:28 2022 +0100 arm64/sme: Fix tests for 0b1111 value ID registers For both ID_AA64SMFR0_EL1.I16I64 and ID_AA64SMFR0_EL1.I8I32 we check for the presence of the feature by looking for a specific ID value of 0x4 but should instead be checking for the value 0xf defined by the architecture. This had no practical effect since we are looking for values >= our define and the only valid values in the architecture are 0b0000 and 0b1111 so we would detect things appropriately with the architecture as it stands even with the incorrect defines. Signed-off-by: Mark Brown Fixes: b4adc83b0770 ("arm64/sme: System register and exception syndrome definitions") Link: https://lore.kernel.org/r/20220607165128.2833157-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8a4d480702b71184fabcf379b80bf7539716752e Author: Xiaohui Zhang Date: Tue Jun 7 16:32:30 2022 +0800 nfc: nfcmrvl: Fix memory leak in nfcmrvl_play_deferred Similar to the handling of play_deferred in commit 19cfe912c37b ("Bluetooth: btusb: Fix memory leak in play_deferred"), we thought a patch might be needed here as well. Currently usb_submit_urb is called directly to submit deferred tx urbs after unanchor them. So the usb_giveback_urb_bh would failed to unref it in usb_unanchor_urb and cause memory leak. Put those urbs in tx_anchor to avoid the leak, and also fix the error handling. Signed-off-by: Xiaohui Zhang Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220607083230.6182-1-xiaohuizhang@ruc.edu.cn Signed-off-by: Jakub Kicinski commit e44c8f4080ca264b5aac3183a321538662b0950b Merge: 653926f6938d0 f2e19b36593ca Author: Jakub Kicinski Date: Wed Jun 8 10:17:30 2022 -0700 Merge branch 'split-nfc-st21nfca-refactor-evt_transaction-into-3' Martin Faltesek says: ==================== Split "nfc: st21nfca: Refactor EVT_TRANSACTION" into 3 v2: https://lore.kernel.org/netdev/20220401180939.2025819-1-mfaltesek@google.com/ v1: https://lore.kernel.org/netdev/20220329175431.3175472-1-mfaltesek@google.com/ ==================== Link: https://lore.kernel.org/r/20220607025729.1673212-1-mfaltesek@google.com Signed-off-by: Jakub Kicinski commit f2e19b36593caed4c977c2f55aeba7408aeb2132 Author: Martin Faltesek Date: Mon Jun 6 21:57:29 2022 -0500 nfc: st21nfca: fix incorrect sizing calculations in EVT_TRANSACTION The transaction buffer is allocated by using the size of the packet buf, and subtracting two which seem intended to remove the two tags which are not present in the target structure. This calculation leads to under counting memory because of differences between the packet contents and the target structure. The aid_len field is a u8 in the packet, but a u32 in the structure, resulting in at least 3 bytes always being under counted. Further, the aid data is a variable length field in the packet, but fixed in the structure, so if this field is less than the max, the difference is added to the under counting. The last validation check for transaction->params_len is also incorrect since it employs the same accounting error. To fix, perform validation checks progressively to safely reach the next field, to determine the size of both buffers and verify both tags. Once all validation checks pass, allocate the buffer and copy the data. This eliminates freeing memory on the error path, as those checks are moved ahead of memory allocation. Fixes: 26fc6c7f02cb ("NFC: st21nfca: Add HCI transaction event support") Fixes: 4fbcc1a4cb20 ("nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION") Cc: stable@vger.kernel.org Signed-off-by: Martin Faltesek Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 996419e0594abb311fb958553809f24f38e7abbe Author: Martin Faltesek Date: Mon Jun 6 21:57:28 2022 -0500 nfc: st21nfca: fix memory leaks in EVT_TRANSACTION handling Error paths do not free previously allocated memory. Add devm_kfree() to those failure paths. Fixes: 26fc6c7f02cb ("NFC: st21nfca: Add HCI transaction event support") Fixes: 4fbcc1a4cb20 ("nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION") Cc: stable@vger.kernel.org Signed-off-by: Martin Faltesek Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 77e5fe8f176a525523ae091d6fd0fbb8834c156d Author: Martin Faltesek Date: Mon Jun 6 21:57:27 2022 -0500 nfc: st21nfca: fix incorrect validating logic in EVT_TRANSACTION The first validation check for EVT_TRANSACTION has two different checks tied together with logical AND. One is a check for minimum packet length, and the other is for a valid aid_tag. If either condition is true (fails), then an error should be triggered. The fix is to change && to ||. Fixes: 26fc6c7f02cb ("NFC: st21nfca: Add HCI transaction event support") Cc: stable@vger.kernel.org Signed-off-by: Martin Faltesek Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 6e2b347d42e54282e4c6cfa08272db462b178f7f Merge: e54a4424925a2 f2906aa863381 Author: Maxime Ripard Date: Wed Jun 8 19:11:27 2022 +0200 Merge v5.19-rc1 into drm-misc-fixes Let's kick-off the start of the 5.19 fix cycle Signed-off-by: Maxime Ripard commit 653926f6938d0dbfa44ee66c3d3cf0df3c08b583 Merge: f5826c8c9d572 5801f064e3518 Author: Jakub Kicinski Date: Wed Jun 8 10:10:17 2022 -0700 Merge branch 'net-unexport-some-symbols-that-are-annotated-__init' Masahiro Yamada says: ==================== net: unexport some symbols that are annotated __init This patch set fixes odd combinations of EXPORT_SYMBOL and __init. Checking this in modpost is a good thing and I really wanted to do it, but Linus Torvalds imposes a very strict rule, "No new warning". I'd like the maintainer to kindly pick this up and send a fixes pull request. Unless I eliminate all the sites of warnings beforehand, Linus refuses to re-enable the modpost check. [1] [1]: https://lore.kernel.org/linux-kbuild/CAK7LNATmd0bigp7HQ4fTzHw5ugZMkSb3UXG7L4fxpGbqkRKESA@mail.gmail.com/T/#m5e50cc2da17491ba210c72b5efdbc0ce76e0217f ==================== Link: https://lore.kernel.org/r/20220606045355.4160711-1-masahiroy@kernel.org Signed-off-by: Jakub Kicinski commit 5801f064e35181c71857a80ff18af4dbec3c5f5c Author: Masahiro Yamada Date: Mon Jun 6 13:53:55 2022 +0900 net: ipv6: unexport __init-annotated seg6_hmac_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the caller (net/ipv6/seg6.c) and the callee (net/ipv6/seg6_hmac.c) belong to the same module. It seems an internal function call in ipv6.ko. Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Signed-off-by: Jakub Kicinski commit 4a388f08d8784af48f352193d2b72aaf167a57a1 Author: Masahiro Yamada Date: Mon Jun 6 13:53:54 2022 +0900 net: xfrm: unexport __init-annotated xfrm4_protocol_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, net/ipv4/xfrm4_policy.c is never compiled as modular. (CONFIG_XFRM is boolean) Fixes: 2f32b51b609f ("xfrm: Introduce xfrm_input_afinfo to access the the callbacks properly") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Acked-by: Steffen Klassert Signed-off-by: Jakub Kicinski commit 35b42dce619701f1300fb8498dae82c9bb1f0263 Author: Masahiro Yamada Date: Mon Jun 6 13:53:53 2022 +0900 net: mdio: unexport __init-annotated mdio_bus_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, drivers/net/phy/phy_device.c is never compiled as modular. (CONFIG_PHYLIB is boolean) Fixes: 90eff9096c01 ("net: phy: Allow splitting MDIO bus/device support from PHYs") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Reviewed-by: Florian Fainelli Reviewed-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit da9e94fe000e11f21d3d6f66012fe5c6379bd93c Author: Chuck Lever Date: Tue Jun 7 16:48:18 2022 -0400 SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer() To make the code easier to read, remove visual clutter by changing the declared type of @p. Signed-off-by: Chuck Lever Reviewed-by: NeilBrown Reviewed-by: J. Bruce Fields commit bd07a64176a2be03f5195c64943063fd119f9f21 Author: Chuck Lever Date: Tue Jun 7 16:48:11 2022 -0400 SUNRPC: Clean up xdr_get_next_encode_buffer() The value of @p is not used until the "location of the next item" is computed. Help human readers by moving its initial assignment to the paragraph where that value is used and by clarifying the antecedents in the documenting comment. Signed-off-by: Chuck Lever Reviewed-by: NeilBrown Reviewed-by: J. Bruce Fields commit 90d871b3b9bb7ef8f835d6b53095f01b9c74b7b3 Author: Chuck Lever Date: Tue Jun 7 16:48:05 2022 -0400 SUNRPC: Clean up xdr_commit_encode() Both the kvec::iov_len field and the third parameter of memcpy() and memmove() are size_t. There's no reason for the implicit conversion from size_t to int and back. Change the type of @shift to make the code easier to read and understand. Signed-off-by: Chuck Lever Reviewed-by: NeilBrown Reviewed-by: J. Bruce Fields commit 62ed448cc53b654036f7d7f3c99f299d79ad14c3 Author: Chuck Lever Date: Tue Jun 7 16:47:58 2022 -0400 SUNRPC: Optimize xdr_reserve_space() Transitioning between encode buffers is quite infrequent. It happens about 1 time in 400 calls to xdr_reserve_space(), measured on NFSD with a typical build/test workload. Force the compiler to remove that code from xdr_reserve_space(), which is a hot path on both the server and the client. This change reduces the size of xdr_reserve_space() from 10 cache lines to 2 when compiled with -Os. Signed-off-by: Chuck Lever Reviewed-by: J. Bruce Fields commit 6c254bf3b637dd4ef4f78eb78c7447419c0161d7 Author: Chuck Lever Date: Tue Jun 7 16:47:52 2022 -0400 SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer() I found that NFSD's new NFSv3 READDIRPLUS XDR encoder was screwing up right at the end of the page array. xdr_get_next_encode_buffer() does not compute the value of xdr->end correctly: * The check to see if we're on the final available page in xdr->buf needs to account for the space consumed by @nbytes. * The new xdr->end value needs to account for the portion of @nbytes that is to be encoded into the previous buffer. Fixes: 2825a7f90753 ("nfsd4: allow encoding across page boundaries") Signed-off-by: Chuck Lever Reviewed-by: NeilBrown Reviewed-by: J. Bruce Fields commit 34f4335c16a5f4bb7da6c8d2d5e780b6a163846a Merge: 32d380a7ef025 6cd88243c7e03 Author: Linus Torvalds Date: Wed Jun 8 09:16:31 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM fixes from Paolo Bonzini: - syzkaller NULL pointer dereference - TDP MMU performance issue with disabling dirty logging - 5.14 regression with SVM TSC scaling - indefinite stall on applying live patches - unstable selftest - memory leak from wrong copy-and-paste - missed PV TLB flush when racing with emulation * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: do not report a vCPU as preempted outside instruction boundaries KVM: x86: do not set st->preempted when going back to user space KVM: SVM: fix tsc scaling cache logic KVM: selftests: Make hyperv_clock selftest more stable KVM: x86/MMU: Zap non-leaf SPTEs when disabling dirty logging x86: drop bogus "cc" clobber from __try_cmpxchg_user_asm() KVM: x86/mmu: Check every prev_roots in __kvm_mmu_free_obsolete_roots() entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set KVM: Don't null dereference ops->destroy commit 32d380a7ef0254d65763408b955a5aa6848ea49c Merge: 9886142c7a222 dda5384313a40 Author: Linus Torvalds Date: Wed Jun 8 09:10:11 2022 -0700 Merge tag 'tpmdd-next-v5.19-rc2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm fix from Jarkko Sakkinen: "A bug fix for migratable (whether or not a key is tied to the TPM chip soldered to the machine) handling for TPM2 trusted keys" * tag 'tpmdd-next-v5.19-rc2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: KEYS: trusted: tpm2: Fix migratable logic commit 32d4fd5751eadbe1823a37eb38df85ec5c8e6207 Author: Peter Zijlstra Date: Wed Jun 8 16:27:27 2022 +0200 cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE Commit c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") wrecked intel_idle in two ways: - must not have tracing in idle functions - must return with IRQs disabled Additionally, it added a branch for no good reason. Fixes: c227233ad64c ("intel_idle: enable interrupts before C1 on Xeons") Signed-off-by: Peter Zijlstra (Intel) [ rjw: Moved the intel_idle() kerneldoc comment next to the function ] Cc: 5.16+ # 5.16+ Signed-off-by: Rafael J. Wysocki commit 578eb31776df57c81307fb3f96ef0781332c3c7c Author: Mohammad Zafar Ziya Date: Tue Jun 7 11:38:16 2022 +0800 drm/amdgpu/jpeg2: Add jpeg vmid update under IB submit Add jpeg vmid update under IB submit Signed-off-by: Mohammad Zafar Ziya Acked-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 84205d00934394076552e2f597cf04a835df3364 Author: Christian König Date: Fri Jun 3 15:05:04 2022 +0200 drm/amdgpu: always flush the TLB on gfx8 The TLB on GFX8 stores each block of 8 PTEs where any of the valid bits are set. Fixes: 5255e146c99a ("drm/amdgpu: rework TLB flushing") Reviewed-by: Alex Deucher Tested-by: Michal Kubecek Signed-off-by: Christian König Signed-off-by: Alex Deucher commit 1d2afeb7983081ecf656c2338c7db6fd405c653c Author: Christian König Date: Fri Jun 3 12:21:06 2022 +0200 drm/amdgpu: fix limiting AV1 to the first instance on VCN3 The job is not yet initialized here. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2037 Reviewed-by: Alex Deucher Tested-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Christian König Fixes: cdc7893fc93f ("drm/amdgpu: use job and ib structures directly in CS parsers") Signed-off-by: Alex Deucher commit a956a11ee669d069047525c8ec897b4c21a9cda1 Author: Jesse Zhang Date: Tue Jun 7 10:44:57 2022 +0800 drm/amdkfd:Fix fw version for 10.3.6 fix fw error when loading fw for 10.3.6 Signed-off-by: Jesse Zhang Reviewed-by: Alex Deucher Reviewed-by: Mario Limonciello Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit 7c217aca85dd31dd2c8f45f6a7520767c9fae766 Author: Quentin Monnet Date: Wed Jun 8 13:14:28 2022 +0100 MAINTAINERS: Add a maintainer for bpftool I've been contributing and reviewing patches for bpftool for some time, and I'm taking care of its external mirror. On Alexei, KP, and Daniel's suggestion, I would like to step forwards and become a maintainer for the tool. This patch adds a dedicated entry to MAINTAINERS. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: Jakub Kicinski Acked-by: KP Singh Acked-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220608121428.69708-1-quentin@isovalent.com commit 5f3d696eea916693b2d4ed7e62794653fcdd6ec0 Author: Jeremy Soller Date: Wed Jun 8 08:01:11 2022 -0600 ALSA: hda/realtek: Add quirk for HP Dev One Enables the audio mute LEDs and limits the mic boost to avoid picking up noise. Signed-off-by: Jeremy Soller Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220608140111.23170-1-tcrawford@system76.com Signed-off-by: Takashi Iwai commit d678cbd2f867a564a3c5b276c454e873f43f02f8 Author: Maciej Fijalkowski Date: Tue Jun 7 16:22:00 2022 +0200 xsk: Fix handling of invalid descriptors in XSK TX batching API xdpxceiver run on a AF_XDP ZC enabled driver revealed a problem with XSK Tx batching API. There is a test that checks how invalid Tx descriptors are handled by AF_XDP. Each valid descriptor is followed by invalid one on Tx side whereas the Rx side expects only to receive a set of valid descriptors. In current xsk_tx_peek_release_desc_batch() function, the amount of available descriptors is hidden inside xskq_cons_peek_desc_batch(). This can be problematic in cases where invalid descriptors are present due to the fact that xskq_cons_peek_desc_batch() returns only a count of valid descriptors. This means that it is impossible to properly update XSK ring state when calling xskq_cons_release_n(). To address this issue, pull out the contents of xskq_cons_peek_desc_batch() so that callers (currently only xsk_tx_peek_release_desc_batch()) will always be able to update the state of ring properly, as total count of entries is now available and use this value as an argument in xskq_cons_release_n(). By doing so, xskq_cons_peek_desc_batch() can be dropped altogether. Fixes: 9349eb3a9d2a ("xsk: Introduce batched Tx descriptor interfaces") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220607142200.576735-1-maciej.fijalkowski@intel.com commit b27ee76c74dc831d6e092eaebc2dfc9c0beed1c9 Author: Xie Yongji Date: Tue Apr 26 15:36:56 2022 +0800 vduse: Fix NULL pointer dereference on sysfs access The control device has no drvdata. So we will get a NULL pointer dereference when accessing control device's msg_timeout attribute via sysfs: [ 132.841881][ T3644] BUG: kernel NULL pointer dereference, address: 00000000000000f8 [ 132.850619][ T3644] RIP: 0010:msg_timeout_show (drivers/vdpa/vdpa_user/vduse_dev.c:1271) [ 132.869447][ T3644] dev_attr_show (drivers/base/core.c:2094) [ 132.870215][ T3644] sysfs_kf_seq_show (fs/sysfs/file.c:59) [ 132.871164][ T3644] ? device_remove_bin_file (drivers/base/core.c:2088) [ 132.872082][ T3644] kernfs_seq_show (fs/kernfs/file.c:164) [ 132.872838][ T3644] seq_read_iter (fs/seq_file.c:230) [ 132.873578][ T3644] ? __vmalloc_area_node (mm/vmalloc.c:3041) [ 132.874532][ T3644] kernfs_fop_read_iter (fs/kernfs/file.c:238) [ 132.875513][ T3644] __kernel_read (fs/read_write.c:440 (discriminator 1)) [ 132.876319][ T3644] kernel_read (fs/read_write.c:459) [ 132.877129][ T3644] kernel_read_file (fs/kernel_read_file.c:94) [ 132.877978][ T3644] kernel_read_file_from_fd (include/linux/file.h:45 fs/kernel_read_file.c:186) [ 132.879019][ T3644] __do_sys_finit_module (kernel/module.c:4207) [ 132.879930][ T3644] __ia32_sys_finit_module (kernel/module.c:4189) [ 132.880930][ T3644] do_int80_syscall_32 (arch/x86/entry/common.c:112 arch/x86/entry/common.c:132) [ 132.881847][ T3644] entry_INT80_compat (arch/x86/entry/entry_64_compat.S:419) To fix it, don't create the unneeded attribute for control device anymore. Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Reported-by: kernel test robot Cc: stable@vger.kernel.org Signed-off-by: Xie Yongji Message-Id: <20220426073656.229-1-xieyongji@bytedance.com> Signed-off-by: Michael S. Tsirkin commit dbd29e0752286af74243cf891accf472b2f3edd8 Author: Xie Yongji Date: Thu May 5 18:09:10 2022 +0800 vringh: Fix loop descriptors check in the indirect cases We should use size of descriptor chain to test loop condition in the indirect case. And another statistical count is also introduced for indirect descriptors to avoid conflict with the statistical count of direct descriptors. Fixes: f87d0fbb5798 ("vringh: host-side implementation of virtio rings.") Signed-off-by: Xie Yongji Signed-off-by: Fam Zheng Message-Id: <20220505100910.137-1-xieyongji@bytedance.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit f38b3c6a788f75da151b46c7da61ff26649e1843 Author: Dan Carpenter Date: Tue Jun 7 09:50:09 2022 +0300 vdpa/mlx5: clean up indenting in handle_ctrl_vlan() These lines were supposed to be indented. Signed-off-by: Dan Carpenter Message-Id: Signed-off-by: Michael S. Tsirkin Acked-by: Eli Cohen Acked-by: Si-Wei Liu commit f766c409fcb33cfd0f511e8251831520e089eb89 Author: Dan Carpenter Date: Tue Jun 7 09:49:25 2022 +0300 vdpa/mlx5: fix error code for deleting vlan Return success if we were able to delete a vlan. The current code always returns failure. Fixes: baf2ad3f6a98 ("vdpa/mlx5: Add RX MAC VLAN filter support") Signed-off-by: Dan Carpenter Message-Id: Signed-off-by: Michael S. Tsirkin Acked-by: Eli Cohen Acked-by: Si-Wei Liu commit a58a7f97ba11391d2d0d408e0b24f38d86ae748e Author: chengkaitao Date: Thu Jun 2 08:55:42 2022 +0800 virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed The reference must be released when device_register(&vm_cmdline_parent) failed. Add the corresponding 'put_device()' in the error handling path. Signed-off-by: chengkaitao Message-Id: <20220602005542.16489-1-chengkaitao@didiglobal.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 2f72b2262d317093596c72bd5b27b9880be7611e Author: Xiang wangx Date: Sat Jun 4 22:38:58 2022 +0800 vdpa/mlx5: Fix syntax errors in comments Delete the redundant word 'is'. Signed-off-by: Xiang wangx Message-Id: <20220604143858.16073-1-wangxiang@cdjrlc.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 228432551bd8783211e494ab35f42a4344580502 Author: Jason Wang Date: Wed Jun 8 14:14:22 2022 +0800 virtio-rng: make device ready before making request Current virtio-rng does a entropy request before DRIVER_OK, this violates the spec: virtio spec requires that all drivers set DRIVER_OK before using devices. Further, kernel will ignore the interrupt after commit 8b4ec69d7e09 ("virtio: harden vring IRQ"). Fixing this by making device ready before the request. Cc: stable@vger.kernel.org Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ") Fixes: f7f510ec1957 ("virtio: An entropy device, as suggested by hpa.") Reported-and-tested-by: syzbot+5b59d6d459306a556f54@syzkaller.appspotmail.com Signed-off-by: Jason Wang Message-Id: <20220608061422.38437-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Laurent Vivier commit f5f93d7f5a5cbfef02609dead21e7056e83f4fab Author: Michael Kelley Date: Tue Jun 7 20:49:37 2022 -0700 HID: hyperv: Correctly access fields declared as __le16 Add the use of le16_to_cpu() for fields declared as __le16. Because Hyper-V only runs in Little Endian mode, there's no actual bug. The change is made in the interest of general correctness in addition to making sparse happy. No functional change. Reported-by: kernel test robot Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1654660177-115463-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 245b993d8f6c4e25f19191edfbd8080b645e12b1 Author: Masahiro Yamada Date: Mon Jun 6 14:02:38 2022 +0900 clocksource: hyper-v: unexport __init-annotated hv_init_clocksource() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, arch/x86/kernel/cpu/mshyperv.c is never compiled as modular. (CONFIG_HYPERVISOR_GUEST is boolean) Fixes: dd2cb348613b ("clocksource/drivers: Continue making Hyper-V clocksource ISA agnostic") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Reviewed-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220606050238.4162200-1-masahiroy@kernel.org Signed-off-by: Wei Liu commit 92ec746bcea0c51cd29fb46e510fb71fe15282df Author: Xiang wangx Date: Sun Jun 5 16:55:24 2022 +0800 Drivers: hv: Fix syntax errors in comments Delete the redundant word 'in'. Signed-off-by: Xiang wangx Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220605085524.11289-1-wangxiang@cdjrlc.com Signed-off-by: Wei Liu commit 6640b5df1a38801be6d0595c8cd2177d968d7ee0 Author: Saurabh Sengar Date: Fri May 27 00:43:59 2022 -0700 Drivers: hv: vmbus: Don't assign VMbus channel interrupts to isolated CPUs When initially assigning a VMbus channel interrupt to a CPU, don’t choose a managed IRQ isolated CPU (as specified on the kernel boot line with parameter 'isolcpus=managed_irq,<#cpu>'). Also, when using sysfs to change the CPU that a VMbus channel will interrupt, don't allow changing to a managed IRQ isolated CPU. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1653637439-23060-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 49c3ca34f7dbe5227c0163cba4deb5d29e145fae Author: Masahiro Yamada Date: Wed Jun 8 00:18:40 2022 +0900 scripts/nsdeps: adjust to the format change of *.mod files Commit 22f26f21774f ("kbuild: get rid of duplication in *.mod files") changed the format of *.mod files to put one object per line, but missed to adjust scripts/nsdeps. Fixes: 22f26f21774f ("kbuild: get rid of duplication in *.mod files") Signed-off-by: Masahiro Yamada commit dda5384313a40ecbaafd8a9a80f47483255e4c4d Author: David Safford Date: Tue Jun 7 14:07:57 2022 -0400 KEYS: trusted: tpm2: Fix migratable logic When creating (sealing) a new trusted key, migratable trusted keys have the FIXED_TPM and FIXED_PARENT attributes set, and non-migratable keys don't. This is backwards, and also causes creation to fail when creating a migratable key under a migratable parent. (The TPM thinks you are trying to seal a non-migratable blob under a migratable parent.) The following simple patch fixes the logic, and has been tested for all four combinations of migratable and non-migratable trusted keys and parent storage keys. With this logic, you will get a proper failure if you try to create a non-migratable trusted key under a migratable parent storage key, and all other combinations work correctly. Cc: stable@vger.kernel.org # v5.13+ Fixes: e5fb5d2c5a03 ("security: keys: trusted: Make sealed key properly interoperable") Signed-off-by: David Safford Reviewed-by: Ahmad Fatoum Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit b1fd94e704571f98b21027340eecf821b2bdffba Author: Florian Westphal Date: Wed May 18 20:15:31 2022 +0200 netfilter: use get_random_u32 instead of prandom bh might occur while updating per-cpu rnd_state from user context, ie. local_out path. BUG: using smp_processor_id() in preemptible [00000000] code: nginx/2725 caller is nft_ng_random_eval+0x24/0x54 [nft_numgen] Call Trace: check_preemption_disabled+0xde/0xe0 nft_ng_random_eval+0x24/0x54 [nft_numgen] Use the random driver instead, this also avoids need for local prandom state. Moreover, prandom now uses the random driver since d4150779e60f ("random32: use real rng for non-deterministic randomness"). Based on earlier patch from Pablo Neira. Fixes: 6b2faee0ca91 ("netfilter: nft_meta: place prandom handling in a helper") Fixes: 978d8f9055c3 ("netfilter: nft_numgen: add map lookups for numgen random operations") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c1c1204c0d0c1dccc1310b9277fb2bd8b663d8fe Author: Damien Le Moal Date: Mon May 23 16:29:10 2022 +0900 zonefs: fix zonefs_iomap_begin() for reads If a readahead is issued to a sequential zone file with an offset exactly equal to the current file size, the iomap type is set to IOMAP_UNWRITTEN, which will prevent an IO, but the iomap length is calculated as 0. This causes a WARN_ON() in iomap_iter(): [17309.548939] WARNING: CPU: 3 PID: 2137 at fs/iomap/iter.c:34 iomap_iter+0x9cf/0xe80 [...] [17309.650907] RIP: 0010:iomap_iter+0x9cf/0xe80 [...] [17309.754560] Call Trace: [17309.757078] [17309.759240] ? lock_is_held_type+0xd8/0x130 [17309.763531] iomap_readahead+0x1a8/0x870 [17309.767550] ? iomap_read_folio+0x4c0/0x4c0 [17309.771817] ? lockdep_hardirqs_on_prepare+0x400/0x400 [17309.778848] ? lock_release+0x370/0x750 [17309.784462] ? folio_add_lru+0x217/0x3f0 [17309.790220] ? reacquire_held_locks+0x4e0/0x4e0 [17309.796543] read_pages+0x17d/0xb60 [17309.801854] ? folio_add_lru+0x238/0x3f0 [17309.807573] ? readahead_expand+0x5f0/0x5f0 [17309.813554] ? policy_node+0xb5/0x140 [17309.819018] page_cache_ra_unbounded+0x27d/0x450 [17309.825439] filemap_get_pages+0x500/0x1450 [17309.831444] ? filemap_add_folio+0x140/0x140 [17309.837519] ? lock_is_held_type+0xd8/0x130 [17309.843509] filemap_read+0x28c/0x9f0 [17309.848953] ? zonefs_file_read_iter+0x1ea/0x4d0 [zonefs] [17309.856162] ? trace_contention_end+0xd6/0x130 [17309.862416] ? __mutex_lock+0x221/0x1480 [17309.868151] ? zonefs_file_read_iter+0x166/0x4d0 [zonefs] [17309.875364] ? filemap_get_pages+0x1450/0x1450 [17309.881647] ? __mutex_unlock_slowpath+0x15e/0x620 [17309.888248] ? wait_for_completion_io_timeout+0x20/0x20 [17309.895231] ? lock_is_held_type+0xd8/0x130 [17309.901115] ? lock_is_held_type+0xd8/0x130 [17309.906934] zonefs_file_read_iter+0x356/0x4d0 [zonefs] [17309.913750] new_sync_read+0x2d8/0x520 [17309.919035] ? __x64_sys_lseek+0x1d0/0x1d0 Furthermore, this causes iomap_readahead() to loop forever as iomap_readahead_iter() always returns 0, making no progress. Fix this by treating reads after the file size as access to holes, setting the iomap type to IOMAP_HOLE, the iomap addr to IOMAP_NULL_ADDR and using the length argument as is for the iomap length. To simplify the code with this change, zonefs_iomap_begin() is split into the read variant, zonefs_read_iomap_begin() and zonefs_read_iomap_ops, and the write variant, zonefs_write_iomap_begin() and zonefs_write_iomap_ops. Reported-by: Jorgen Hansen Fixes: 8dcc1a9d90c1 ("fs: New zonefs file system") Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Jorgen Hansen commit 37d838de369b07b596c19ff3662bf0293fdb09ee Author: Miaoqian Lin Date: Thu May 26 11:53:22 2022 +0400 soc: bcm: brcmstb: pm: pm-arm: Fix refcount leak in brcmstb_pm_probe of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. In brcmstb_init_sram, it pass dn to of_address_to_resource(), of_address_to_resource() will call of_find_device_by_node() to take reference, so we should release the reference returned by of_find_matching_node(). Fixes: 0b741b8234c8 ("soc: bcm: brcmstb: Add support for S2/S3/S5 suspend states (ARM)") Signed-off-by: Miaoqian Lin Reviewed-by: Andy Shevchenko Signed-off-by: Florian Fainelli commit efedd01de475e126e43a07d0b1221bb65e497163 Author: Marc Zyngier Date: Tue Jun 7 14:14:27 2022 +0100 KVM: arm64: Warn if accessing timer pending state outside of vcpu context A recurrent bug in the KVM/arm64 code base consists in trying to access the timer pending state outside of the vcpu context, which makes zero sense (the pending state only exists when the vcpu is loaded). In order to avoid more embarassing crashes and catch the offenders red-handed, add a warning to kvm_arch_timer_get_input_level() and return the state as non-pending. This avoids taking the system down, and still helps tracking down silly bugs. Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220607131427.1164881-4-maz@kernel.org commit 98432ccdec9f178ba041e1e5f9f32dbd71576504 Author: Marc Zyngier Date: Tue Jun 7 14:14:26 2022 +0100 KVM: arm64: Replace vgic_v3_uaccess_read_pending with vgic_uaccess_read_pending Now that GICv2 has a proper userspace accessor for the pending state, switch GICv3 over to it, dropping the local version, moving over the specific behaviours that CGIv3 requires (such as the distinction between pending latch and line level which were never enforced with GICv2). We also gain extra locking that isn't really necessary for userspace, but that's a small price to pay for getting rid of superfluous code. Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20220607131427.1164881-3-maz@kernel.org commit 527f4643e03c298c1e3321cfa27866b1374a55e1 Author: huangwenhui Date: Wed Jun 8 16:23:57 2022 +0800 ALSA: hda/realtek - Add HW8326 support Added the support of new Huawei codec HW8326. The HW8326 is developed by Huawei with Realtek's IP Core, and it's compatible with ALC256. Signed-off-by: huangwenhui Link: https://lore.kernel.org/r/20220608082357.26898-1-huangwenhuia@uniontech.com Signed-off-by: Takashi Iwai commit 6cd88243c7e03845a450795e134b488fc2afb736 Author: Paolo Bonzini Date: Tue Jun 7 10:09:03 2022 -0400 KVM: x86: do not report a vCPU as preempted outside instruction boundaries If a vCPU is outside guest mode and is scheduled out, it might be in the process of making a memory access. A problem occurs if another vCPU uses the PV TLB flush feature during the period when the vCPU is scheduled out, and a virtual address has already been translated but has not yet been accessed, because this is equivalent to using a stale TLB entry. To avoid this, only report a vCPU as preempted if sure that the guest is at an instruction boundary. A rescheduling request will be delivered to the host physical CPU as an external interrupt, so for simplicity consider any vmexit *not* instruction boundary except for external interrupts. It would in principle be okay to report the vCPU as preempted also if it is sleeping in kvm_vcpu_block(): a TLB flush IPI will incur the vmentry/vmexit overhead unnecessarily, and optimistic spinning is also unlikely to succeed. However, leave it for later because right now kvm_vcpu_check_block() is doing memory accesses. Even though the TLB flush issue only applies to virtual memory address, it's very much preferrable to be conservative. Reported-by: Jann Horn Signed-off-by: Paolo Bonzini commit 54aa83c90198e68eee8b0850c749bc70efb548da Author: Paolo Bonzini Date: Tue Jun 7 10:07:11 2022 -0400 KVM: x86: do not set st->preempted when going back to user space Similar to the Xen path, only change the vCPU's reported state if the vCPU was actually preempted. The reason for KVM's behavior is that for example optimistic spinning might not be a good idea if the guest is doing repeated exits to userspace; however, it is confusing and unlikely to make a difference, because well-tuned guests will hardly ever exit KVM_RUN in the first place. Suggested-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 46d6e11320d21dc40fce229ab3504125847de27e Author: Nicolas Saenz Julienne Date: Fri Jun 3 09:30:12 2022 +0200 MAINTAINERS: Update BCM2711/BCM2835 maintainer I haven't been able to find time to maintain BCM2711/BCM2835 these last months, so it's only fair to pass the baton to Florian who's been doing the work. Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Florian Fainelli commit 96eca145cb51f4e0132a3ea8066dfc6fdf75f24a Author: Damien Le Moal Date: Thu Jun 2 21:33:25 2022 +0900 zonefs: Do not ignore explicit_open with active zone limit A zoned device may have no limit on the number of open zones but may have a limit on the number of active zones it can support. In such case, the explicit_open mount option should not be ignored to ensure that the open() system call activates the zone with an explicit zone open command, thus guaranteeing that the zone can be written. Enforce this by ignoring the explicit_open mount option only for devices that have both the open and active zone limits equal to 0. Fixes: 87c9ce3ffec9 ("zonefs: Add active seq file accounting") Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig commit a2a513be7139b279f1b5b2cee59c6c4950c34346 Author: Damien Le Moal Date: Thu Jun 2 23:16:57 2022 +0900 zonefs: fix handling of explicit_open option on mount Ignoring the explicit_open mount option on mount for devices that do not have a limit on the number of open zones must be done after the mount options are parsed and set in s_mount_opts. Move the check to ignore the explicit_open option after the call to zonefs_parse_options() in zonefs_fill_super(). Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Cc: Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn commit f5826c8c9d57210a17031af5527056eefdc2b7eb Author: Gal Pressman Date: Mon Jun 6 14:57:18 2022 +0300 net/mlx4_en: Fix wrong return value on ioctl EEPROM query failure The ioctl EEPROM query wrongly returns success on read failures, fix that by returning the appropriate error code. Fixes: 7202da8b7f71 ("ethtool, net/mlx4_en: Cable info, get_module_info/eeprom ethtool support") Signed-off-by: Gal Pressman Signed-off-by: Tariq Toukan Link: https://lore.kernel.org/r/20220606115718.14233-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski commit 0737e018a05e2aa352828c52bdeed3b02cff2930 Author: Miaoqian Lin Date: Sun Jun 5 11:23:34 2022 +0400 net: dsa: lantiq_gswip: Fix refcount leak in gswip_gphy_fw_list Every iteration of for_each_available_child_of_node() decrements the reference count of the previous node. when breaking early from a for_each_available_child_of_node() loop, we need to explicitly call of_node_put() on the gphy_fw_np. Add missing of_node_put() to avoid refcount leak. Fixes: 14fceff4771e ("net: dsa: Add Lantiq / Intel DSA driver for vrx200") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220605072335.11257-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski commit 6d11acd452fd885ef6ace184c9c70bc863a8c72f Author: Tyler Erickson Date: Thu Jun 2 16:51:12 2022 -0600 libata: fix translation of concurrent positioning ranges Fixing the page length in the SCSI translation for the concurrent positioning ranges VPD page. It was writing starting in offset 3 rather than offset 2 where the MSB is supposed to start for the VPD page length. Cc: stable@vger.kernel.org Fixes: fe22e1c2f705 ("libata: support concurrent positioning ranges log") Signed-off-by: Tyler Erickson Reviewed-by: Muhammad Ahmad Tested-by: Michael English Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit c745dfc541e78428ba3986f1d17fe1dfdaca8184 Author: Tyler Erickson Date: Thu Jun 2 16:51:11 2022 -0600 libata: fix reading concurrent positioning ranges log The concurrent positioning ranges log is not a fixed size and may depend on how many ranges are supported by the device. This patch uses the size reported in the GPL directory to determine the number of pages supported by the device before attempting to read this log page. This resolves this error from the dmesg output: ata6.00: Read log 0x47 page 0x00 failed, Emask 0x1 Cc: stable@vger.kernel.org Fixes: fe22e1c2f705 ("libata: support concurrent positioning ranges log") Signed-off-by: Tyler Erickson Reviewed-by: Muhammad Ahmad Tested-by: Michael English Signed-off-by: Damien Le Moal commit 5c95fe8b02011c3b69173e0d86aff6d4c2798601 Author: Jason A. Donenfeld Date: Sun Jun 5 16:20:08 2022 +0800 LoongArch: Remove MIPS comment about cycle counter This comment block was taken originally from the MIPS architecture code, where indeed there are particular assumptions one can make regarding SMP and !SMP and cycle counters. On LoongArch, however, the rdtime family of functions is always available. As Xuerui wrote: The rdtime family of instructions is in fact guaranteed to be available on LoongArch; LoongArch's subsets all contain them, even the 32-bit "Primary" subset intended for university teaching -- they provide the rdtimeh.w and rdtimel.w pair of instructions that access the same 64-bit counter. So this commit simply removes the incorrect comment block. Link: https://lore.kernel.org/lkml/e78940bc-9be2-2fe7-026f-9e64a1416c9f@xen0n.name/ Fixes: b738c106f735 ("LoongArch: Add other common headers") Reviewed-by: WANG Xuerui Signed-off-by: Jason A. Donenfeld Signed-off-by: Huacai Chen commit 0626e1c9f3e5536545431538d12c762d5abf59c8 Author: Huacai Chen Date: Sun Jun 5 16:20:03 2022 +0800 LoongArch: Fix copy_thread() build errors Commit c5febea0956fd387 ("fork: Pass struct kernel_clone_args into copy_thread") change the prototype of copy_thread(), while commit 5bd2e97c868a8a44 ("fork: Generalize PF_IO_WORKER handling") change the structure of kernel_clone_args. They cause build errors, so fix it. Fixes: 5bd2e97c868a8a44 ("fork: Generalize PF_IO_WORKER handling") Fixes: c5febea0956fd387 ("fork: Pass struct kernel_clone_args into copy_thread") Signed-off-by: Huacai Chen commit 255b4658c809e194bc10236ac24a722ec14a83d6 Author: Huacai Chen Date: Sun Jun 5 16:19:53 2022 +0800 LoongArch: Fix the !CONFIG_SMP build 1, We assume arch/loongarch/include/asm/smp.h be included in include/ linux/smp.h is valid and the reverse inclusion isn't. So remove the in arch/loongarch/include/asm/smp.h. 2, arch/loongarch/include/asm/smp.h is only needed when CONFIG_SMP, and setup.c include it only because it need plat_smp_setup(). So, reorganize setup.c & smp.h, and then remove in setup.c. 3, Fix cacheinfo.c and percpu.h build error by adding the missing header files when !CONFIG_SMP. 4, Fix acpi.c build error by adding CONFIG_SMP guards. 5, Move irq_stat definition from smp.c to irq.c and fix its declaration. 6, Select CONFIG_SMP for CONFIG_NUMA, similar as other architectures do. Signed-off-by: Huacai Chen commit ec1e8adcbdf661c57c395bca342945f4f815add7 Author: Chengguang Xu Date: Sun May 29 23:34:55 2022 +0800 scsi: pmcraid: Fix missing resource cleanup in error case Fix missing resource cleanup (when '(--i) == 0') for error case in pmcraid_register_interrupt_handler(). Link: https://lore.kernel.org/r/20220529153456.4183738-6-cgxu519@mykernel.net Reviewed-by: Dan Carpenter Signed-off-by: Chengguang Xu Signed-off-by: Martin K. Petersen commit d64c491911322af1dcada98e5b9ee0d87e8c8fee Author: Chengguang Xu Date: Sun May 29 23:34:53 2022 +0800 scsi: ipr: Fix missing/incorrect resource cleanup in error case Fix missing resource cleanup (when '(--i) == 0') for error case in ipr_alloc_mem() and skip incorrect resource cleanup (when '(--i) == 0') for error case in ipr_request_other_msi_irqs() because variable i started from 1. Link: https://lore.kernel.org/r/20220529153456.4183738-4-cgxu519@mykernel.net Reviewed-by: Dan Carpenter Acked-by: Brian King Signed-off-by: Chengguang Xu Signed-off-by: Martin K. Petersen commit 120f1d95efb1cdb6fe023c84e38ba06d8f78cd03 Author: Helge Deller Date: Tue May 31 22:09:27 2022 +0200 scsi: mpt3sas: Fix out-of-bounds compiler warning I'm facing this warning when building for the parisc64 architecture: drivers/scsi/mpt3sas/mpt3sas_base.c: In function ‘_base_make_ioc_operational’: drivers/scsi/mpt3sas/mpt3sas_base.c:5396:40: warning: array subscript ‘Mpi2SasIOUnitPage1_t {aka struct _MPI2_CONFIG_PAGE_SASIOUNIT_1}[0]’ is partly outside array bounds of ‘unsigned char[20]’ [-Warray-bounds] 5396 | (le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth)) ? drivers/scsi/mpt3sas/mpt3sas_base.c:5382:26: note: referencing an object of size 20 allocated by ‘kzalloc’ 5382 | sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL); | ^~~~~~~~~~~~~~~~~~~~~~~ The problem is, that only 20 bytes are allocated with kmalloc(), which is sufficient to hold the bytes which are needed. Nevertheless, gcc complains because the whole Mpi2SasIOUnitPage1_t struct is 32 bytes in size and thus doesn't fit into those 20 bytes. This patch simply allocates all 32 bytes (instead of 20) and thus avoids the warning. There is no functional change introduced by this patch. While touching the code I cleaned up to calculation of max_wideport_qd, max_narrowport_qd and max_sata_qd to make it easier readable. Test successfully tested on a HP C8000 PA-RISC workstation with 64-bit kernel. Link: https://lore.kernel.org/r/YpZ197iZdDZSCzrT@p100 Signed-off-by: Helge Deller Signed-off-by: Martin K. Petersen commit 1af48fffd7ffe280e0c225659d826fd5ae802a08 Author: James Smart Date: Fri Jun 3 10:43:29 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.4 Update lpfc version to 14.2.0.4 Link: https://lore.kernel.org/r/20220603174329.63777-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2e7e9c0c1ec05f18d320ecc8a31eec59d2af1af9 Author: James Smart Date: Fri Jun 3 10:43:28 2022 -0700 scsi: lpfc: Allow reduced polling rate for nvme_admin_async_event cmd completion NVMe Asynchronous Event Request commands have no command timeout value per specifications. Set WQE option to allow a reduced FLUSH polling rate for I/O error detection specifically for nvme_admin_async_event commands. Link: https://lore.kernel.org/r/20220603174329.63777-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ea7bd1f393311e823716a232e9d8857fb64eb105 Author: James Smart Date: Fri Jun 3 10:43:27 2022 -0700 scsi: lpfc: Add more logging of cmd and cqe information for aborted NVMe cmds When an NVMe command is aborted or completes with an ERSP, log the opcode and command ID fields to help provide more detail on the failed command. Link: https://lore.kernel.org/r/20220603174329.63777-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 336d63615466b4c06b9401c987813fd19bdde39b Author: James Smart Date: Fri Jun 3 10:43:26 2022 -0700 scsi: lpfc: Fix port stuck in bypassed state after LIP in PT2PT topology After issuing a LIP, a specific target vendor does not ACC the FLOGI that lpfc sends. However, it does send its own FLOGI that lpfc ACCs. The target then establishes the port IDs by sending a PLOGI. lpfc PLOGI_ACCs and starts the RPI registration for DID 0x000001. The target then sends a LOGO to the fabric DID. lpfc is currently treating the LOGO from the fabric DID as a link down and cleans up all the ndlps. The ndlp for DID 0x000001 is put back into NPR and discovery stops, leaving the port in stuck in bypassed mode. Change lpfc behavior such that if a LOGO is received for the fabric DID in PT2PT topology skip the lpfc_linkdown_port() routine and just move the fabric DID back to NPR. Link: https://lore.kernel.org/r/20220603174329.63777-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b1b3440f437b75fb2a9b0cfe58df461e40eca474 Author: James Smart Date: Fri Jun 3 10:43:25 2022 -0700 scsi: lpfc: Resolve NULL ptr dereference after an ELS LOGO is aborted A use-after-free crash can occur after an ELS LOGO is aborted. Specifically, a nodelist structure is freed and then ndlp->vport->cfg_log_verbose is dereferenced in lpfc_nlp_get() when the discovery state machine is mistakenly called a second time with NLP_EVT_DEVICE_RM argument. Rework lpfc_cmpl_els_logo() to prevent the duplicate calls to release a nodelist structure. Link: https://lore.kernel.org/r/20220603174329.63777-6-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6f808bd78e8296b4ded813b7182988d57e1f6176 Author: James Smart Date: Fri Jun 3 10:43:24 2022 -0700 scsi: lpfc: Address NULL pointer dereference after starget_to_rport() Calls to starget_to_rport() may return NULL. Add check for NULL rport before dereference. Link: https://lore.kernel.org/r/20220603174329.63777-5-jsmart2021@gmail.com Fixes: bb21fc9911ee ("scsi: lpfc: Use fc_block_rport()") Cc: # v5.18 Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit e27f05147bff21408c1b8410ad8e90cd286e7952 Author: James Smart Date: Fri Jun 3 10:43:23 2022 -0700 scsi: lpfc: Resolve some cleanup issues following SLI path refactoring Following refactoring and consolidation in SLI processing, fix up some minor issues related to SLI path: - Correct the setting of LPFC_EXCHANGE_BUSY flag in response IOCB. - Fix some typographical errors. - Fix duplicate log messages. Link: https://lore.kernel.org/r/20220603174329.63777-4-jsmart2021@gmail.com Fixes: 1b64aa9eae28 ("scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4") Cc: # v5.18 Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 24e1f056677eefe834d5dcf61905cce857ca4b19 Author: James Smart Date: Fri Jun 3 10:43:22 2022 -0700 scsi: lpfc: Resolve some cleanup issues following abort path refactoring Refactoring and consolidation of abort paths: - lpfc_sli4_abort_fcp_cmpl() and lpfc_sli_abort_fcp_cmpl() are combined into a single generic lpfc_sli_abort_fcp_cmpl() routine. Thus, remove extraneous lpfc_sli4_abort_fcp_cmpl() prototype declaration. - lpfc_nvme_abort_fcreq_cmpl() abort completion routine is called with a mismatched argument type. This may result in misleading log message content. Update to the correct argument type of lpfc_iocbq instead of lpfc_wcqe_complete. The lpfc_wcqe_complete should be derived from the lpfc_iocbq structure. Link: https://lore.kernel.org/r/20220603174329.63777-3-jsmart2021@gmail.com Fixes: 31a59f75702f ("scsi: lpfc: SLI path split: Refactor Abort paths") Cc: # v5.18 Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 44ba9786b67345dc4e5eabe537c9ef2bfd889888 Author: James Smart Date: Fri Jun 3 10:43:21 2022 -0700 scsi: lpfc: Correct BDE type for XMIT_SEQ64_WQE in lpfc_ct_reject_event() A previous commit assumed all XMIT_SEQ64_WQEs are prepped with the correct BDE type in word 0-2. However, lpfc_ct_reject_event() routine was missed and is still filling out the incorrect BDE type. Fix lpfc_ct_reject_event() routine so that type BUFF_TYPE_BDE_64 is set instead of BUFF_TYPE_BLP_64. Link: https://lore.kernel.org/r/20220603174329.63777-2-jsmart2021@gmail.com Fixes: 596fc8adb171 ("scsi: lpfc: Fix dmabuf ptr assignment in lpfc_ct_reject_event()") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit cf71d59c2eceadfcde0fb52e237990a0909880d7 Author: Wentao Wang Date: Thu Jun 2 08:57:00 2022 +0000 scsi: vmw_pvscsi: Expand vcpuHint to 16 bits vcpuHint has been expanded to 16 bit on host to enable routing to more CPUs. Guest side should align with the change. This change has been tested with hosts with 8-bit and 16-bit vcpuHint, on both platforms host side can get correct value. Link: https://lore.kernel.org/r/EF35F4D5-5DCC-42C5-BCC4-29DF1729B24C@vmware.com Signed-off-by: Wentao Wang Signed-off-by: Martin K. Petersen commit f92de9d110429e39929a49240d823251c2fe903e Author: Tyler Erickson Date: Thu Jun 2 16:51:13 2022 -0600 scsi: sd: Fix interpretation of VPD B9h length Fixing the interpretation of the length of the B9h VPD page (Concurrent Positioning Ranges). Adding 4 is necessary as the first 4 bytes of the page is the header with page number and length information. Adding 3 was likely a misinterpretation of the SBC-5 specification which sets all offsets starting at zero. This fixes the error in dmesg: [ 9.014456] sd 1:0:0:0: [sda] Invalid Concurrent Positioning Ranges VPD page Link: https://lore.kernel.org/r/20220602225113.10218-4-tyler.erickson@seagate.com Fixes: e815d36548f0 ("scsi: sd: add concurrent positioning ranges support") Cc: stable@vger.kernel.org Tested-by: Michael English Reviewed-by: Muhammad Ahmad Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke Signed-off-by: Tyler Erickson Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 91ffb0893291ff80cb3695f87e397533abc26823 Merge: cf67838c4422e 3a41c64d9c118 Author: Jakub Kicinski Date: Tue Jun 7 17:49:47 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Fix NAT support for NFPROTO_INET without layer 3 address, from Florian Westphal. 2) Use kfree_rcu(ptr, rcu) variant in nf_tables clean_net path. 3) Use list to collect flowtable hooks to be deleted. 4) Initialize list of hook field in flowtable transaction. 5) Release hooks on error for flowtable updates. 6) Memleak in hardware offload rule commit and abort paths. 7) Early bail out in case device does not support for hardware offload. This adds a new interface to net/core/flow_offload.c to check if the flow indirect block list is empty. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: bail out early if hardware offload is not supported netfilter: nf_tables: memleak flow rule from commit path netfilter: nf_tables: release new hooks on unsupported flowtable flags netfilter: nf_tables: always initialize flowtable hook list in transaction netfilter: nf_tables: delete flowtable hooks via transaction list netfilter: nf_tables: use kfree_rcu(ptr, rcu) to release hooks in clean_net path netfilter: nat: really support inet nat without l3 address ==================== Link: https://lore.kernel.org/r/20220606212055.98300-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 9886142c7a2226439c1e3f7d9b69f9c7094c3ef6 Merge: f7a447eda2120 6ab2e51898cd4 Author: Linus Torvalds Date: Tue Jun 7 15:00:29 2022 -0700 Merge tag 'input-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - proper annotation of USB buffers in bcm5974 touchpad dirver - a quirk in SOC button driver to handle Lenovo Yoga Tablet2 1051F - a fix for missing dependency in raspberrypi-ts driver to avoid compile breakages with random configs. * tag 'input-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: soc_button_array - also add Lenovo Yoga Tablet2 1051F to dmi_use_low_level_irq Input: bcm5974 - set missing URB_NO_TRANSFER_DMA_MAP urb flag Input: raspberrypi-ts - add missing HAS_IOMEM dependency commit f7a447eda2120ab8988b0f8c708c1fd3bd4d3729 Merge: e71e60cd74df9 479260419fa4c Author: Linus Torvalds Date: Tue Jun 7 14:24:30 2022 -0700 Merge tag 'mmc-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix CQE recovery reset success for block I/O MMC host: - sdhci-pci-gli: Fix support for runtime resume - Fix unevaluatedProperties warnings in DT examples" * tag 'mmc-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: dt-bindings: mmc: Fix unevaluatedProperties warnings in examples mmc: block: Fix CQE recovery reset success mmc: sdhci-pci-gli: Fix GL9763E runtime PM when the system resumes from suspend commit 6ab2e51898cd4343bbdf8587af8ce8fbabddbcb5 Author: Marius Hoch Date: Tue Jun 7 12:10:52 2022 -0700 Input: soc_button_array - also add Lenovo Yoga Tablet2 1051F to dmi_use_low_level_irq Commit 223f61b8c5ad ("Input: soc_button_array - add Lenovo Yoga Tablet2 1051L to the dmi_use_low_level_irq list") added the 1051L to this list already, but the same problem applies to the 1051F. As there are no further 1051 variants (just the F/L), we can just DMI match 1051. Tested on a Lenovo Yoga Tablet2 1051F: Without this patch the home-button stops working after a wakeup from suspend. Signed-off-by: Marius Hoch Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20220603120246.3065-1-mail@mariushoch.de Signed-off-by: Dmitry Torokhov commit c42e65664390be7c1ef3838cd84956d3a2739d60 Author: Mathias Nyman Date: Tue Jun 7 12:11:33 2022 -0700 Input: bcm5974 - set missing URB_NO_TRANSFER_DMA_MAP urb flag The bcm5974 driver does the allocation and dma mapping of the usb urb data buffer, but driver does not set the URB_NO_TRANSFER_DMA_MAP flag to let usb core know the buffer is already mapped. usb core tries to map the already mapped buffer, causing a warning: "xhci_hcd 0000:00:14.0: rejecting DMA map of vmalloc memory" Fix this by setting the URB_NO_TRANSFER_DMA_MAP, letting usb core know buffer is already mapped by bcm5974 driver Signed-off-by: Mathias Nyman Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=215890 Link: https://lore.kernel.org/r/20220606113636.588955-1-mathias.nyman@linux.intel.com Signed-off-by: Dmitry Torokhov commit b3f9234e106c9ca4dd0fab3cebbdc8ac74504f97 Author: Joseph Greathouse Date: Mon Jun 6 16:09:25 2022 -0500 drm/amdgpu: Add MODE register to wave debug info in gfx11 All other chips, from gfx6-gfx10, now include the MODE register at the end of the wave debug state. This appears to have been missed in gfx11, so this patch adds in MODE to the debug state for gfx11. Signed-off-by: Joseph Greathouse Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8b8ce2b90af1bea3d7b24e250832fcc3c7e687ea Author: Nicholas Kazlauskas Date: Tue May 17 10:12:27 2022 -0400 Revert "drm/amd/display: Pass the new context into disable OTG WA" This reverts commit 8440f57532496d398a461887e56ca6f45089fbcf. Causes a hang when hotplugging DP, shutting down system, or enabling dual eDP. Reviewed-by: Dmytro Laktyushkin Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 41782d7056e2866ca40cb2d3f56c4c97fd5af337 Author: Guchun Chen Date: Mon Jun 6 10:09:48 2022 +0800 Revert "drm/amdgpu: Ensure the DMA engine is deactivated during set ups" This reverts commit b992a19085885c096b19625a85c674cb89829ca1. This causes regression in GPU reset related test. Cc: Alexander Deucher Cc: ricetons@gmail.com Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ce0db505bc0c51ef5e9ba446c660de7e26f78f29 Author: Maximilian Luz Date: Mon Jun 6 23:13:05 2022 +0200 drm/msm: Fix double pm_runtime_disable() call Following commit 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}"), any call to adreno_unbind() will disable runtime PM twice, as indicated by the call trees below: adreno_unbind() -> pm_runtime_force_suspend() -> pm_runtime_disable() adreno_unbind() -> gpu->funcs->destroy() [= aNxx_destroy()] -> adreno_gpu_cleanup() -> pm_runtime_disable() Note that pm_runtime_force_suspend() is called right before gpu->funcs->destroy() and both functions are called unconditionally. With recent addition of the eDP AUX bus code, this problem manifests itself when the eDP panel cannot be found yet and probing is deferred. On the first probe attempt, we disable runtime PM twice as described above. This then causes any later probe attempt to fail with [drm:adreno_load_gpu [msm]] *ERROR* Couldn't power up the GPU: -13 preventing the driver from loading. As there seem to be scenarios where the aNxx_destroy() functions are not called from adreno_unbind(), simply removing pm_runtime_disable() from inside adreno_unbind() does not seem to be the proper fix. This is what commit 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}") intended to fix. Therefore, instead check whether runtime PM is still enabled, and only disable it in that case. Fixes: 17e822f7591f ("drm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup}") Signed-off-by: Maximilian Luz Tested-by: Bjorn Andersson Reviewed-by: Rob Clark Link: https://lore.kernel.org/r/20220606211305.189585-1-luzmaximilian@gmail.com Signed-off-by: Rob Clark commit 122e951eb8045338089b086c8bd9b0b9afb04a92 Author: Robert Marko Date: Sat Jun 4 21:33:00 2022 +0200 regulator: qcom_smd: correct MP5496 ranges Currently set MP5496 Buck and LDO ranges dont match its datasheet[1]. According to the datasheet: Buck range is 0.6-2.1875V with a 12.5mV step LDO range is 0.8-3.975V with a 25mV step. So, correct the ranges according to the datasheet[1]. [1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP5496GR/document_id/6906/ Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20220604193300.125758-2-robimarko@gmail.com Signed-off-by: Mark Brown commit 5871321fb4558c55bf9567052b618ff0be6b975e Author: Mark Brown Date: Sat Jun 4 11:52:46 2022 +0100 ASoC: ops: Fix off by one in range control validation We currently report that range controls accept a range of 0..(max-min) but accept writes in the range 0..(max-min+1). Remove that extra +1. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220604105246.4055214-1-broonie@kernel.org Signed-off-by: Mark Brown commit 073350da0aa2aead9df7927a1c1046ebf5cdd816 Merge: 2abdf9f80019e f2906aa863381 Author: Mark Brown Date: Tue Jun 7 20:37:12 2022 +0100 Merge tag 'v5.19-rc1' into asoc-5.19 Linux 5.19-rc1 commit 7bb0fb7c63df95d6027dc50d6af3bc3bbbc25483 Author: Olivier Matz Date: Wed Apr 6 11:52:52 2022 +0200 ixgbe: fix unexpected VLAN Rx in promisc mode on VF When the promiscuous mode is enabled on a VF, the IXGBE_VMOLR_VPE bit (VLAN Promiscuous Enable) is set. This means that the VF will receive packets whose VLAN is not the same than the VLAN of the VF. For instance, in this situation: ┌────────┐ ┌────────┐ ┌────────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ VF0├────┤VF1 VF2├────┤VF3 │ │ │ │ │ │ │ └────────┘ └────────┘ └────────┘ VM1 VM2 VM3 vf 0: vlan 1000 vf 1: vlan 1000 vf 2: vlan 1001 vf 3: vlan 1001 If we tcpdump on VF3, we see all the packets, even those transmitted on vlan 1000. This behavior prevents to bridge VF1 and VF2 in VM2, because it will create a loop: packets transmitted on VF1 will be received by VF2 and vice-versa, and bridged again through the software bridge. This patch remove the activation of VLAN Promiscuous when a VF enables the promiscuous mode. However, the IXGBE_VMOLR_UPE bit (Unicast Promiscuous) is kept, so that a VF receives all packets that has the same VLAN, whatever the destination MAC address. Fixes: 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode") Cc: stable@vger.kernel.org Cc: Nicolas Dichtel Signed-off-by: Olivier Matz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 803e9895ea2b0fe80bc85980ae2d7a7e44037914 Author: Olivier Matz Date: Wed Apr 6 11:52:51 2022 +0200 ixgbe: fix bcast packets Rx on VF after promisc removal After a VF requested to remove the promiscuous flag on an interface, the broadcast packets are not received anymore. This breaks some protocols like ARP. In ixgbe_update_vf_xcast_mode(), we should keep the IXGBE_VMOLR_BAM bit (Broadcast Accept) on promiscuous removal. This flag is already set by default in ixgbe_set_vmolr() on VF reset. Fixes: 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode") Cc: stable@vger.kernel.org Cc: Nicolas Dichtel Signed-off-by: Olivier Matz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 2b8c612c6102f751e6e3e1bd425f64e9d3d3f638 Author: Dmitry Osipenko Date: Mon Jun 6 19:56:40 2022 +0300 kernel/reboot: Fix powering off using a non-syscall code paths There are other methods of powering off machine than the reboot syscall. Previously we missed to cover those methods and it created power-off regression for some machines, like the PowerPC e500. Fix this problem by moving the legacy sys-off handler registration to the latest phase of power-off process and making the kernel_can_power_off() check the legacy pm_power_off presence. Tested-by: Michael Ellerman # ppce500 Reported-by: Michael Ellerman # ppce500 Fixes: da007f171fc9 ("kernel/reboot: Change registration order of legacy power-off handler") Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 2cf7b7ffdae519b284f1406012b52e2282fa36bf Author: Toke Høiland-Jørgensen Date: Mon Jun 6 09:52:52 2022 +0200 selftests/bpf: Add selftest for calling global functions from freplace Add a selftest that calls a global function with a context object parameter from an freplace function to check that the program context type is correctly converted to the freplace target when fetching the context type from the kernel BTF. v2: - Trim includes - Get rid of global function - Use __noinline Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220606075253.28422-2-toke@redhat.com Signed-off-by: Alexei Starovoitov commit f858c2b2ca04fc7ead291821a793638ae120c11d Author: Toke Høiland-Jørgensen Date: Mon Jun 6 09:52:51 2022 +0200 bpf: Fix calling global functions from BPF_PROG_TYPE_EXT programs The verifier allows programs to call global functions as long as their argument types match, using BTF to check the function arguments. One of the allowed argument types to such global functions is PTR_TO_CTX; however the check for this fails on BPF_PROG_TYPE_EXT functions because the verifier uses the wrong type to fetch the vmlinux BTF ID for the program context type. This failure is seen when an XDP program is loaded using libxdp (which loads it as BPF_PROG_TYPE_EXT and attaches it to a global XDP type program). Fix the issue by passing in the target program type instead of the BPF_PROG_TYPE_EXT type to bpf_prog_get_ctx() when checking function argument compatibility. The first Fixes tag refers to the latest commit that touched the code in question, while the second one points to the code that first introduced the global function call verification. v2: - Use resolve_prog_type() Fixes: 3363bd0cfbb8 ("bpf: Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support") Fixes: 51c39bb1d5d1 ("bpf: Introduce function-by-function verification") Reported-by: Simon Sundberg Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220606075253.28422-1-toke@redhat.com Signed-off-by: Alexei Starovoitov commit fd58f7df2415ef747782e01f94880fefad1247cf Author: Dan Carpenter Date: Thu May 26 13:24:05 2022 +0300 bpf: Use safer kvmalloc_array() where possible The kvmalloc_array() function is safer because it has a check for integer overflows. These sizes come from the user and I was not able to see any bounds checking so an integer overflow seems like a realistic concern. Fixes: 0dcac2725406 ("bpf: Add multi kprobe link") Signed-off-by: Dan Carpenter Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/Yo9VRVMeHbALyjUH@kili Signed-off-by: Alexei Starovoitov commit 10f3b29c65bb2fe0d47c2945cd0b4087be1c5218 Author: Eric Dumazet Date: Tue May 31 14:51:13 2022 -0700 bpf, arm64: Clear prog->jited_len along prog->jited syzbot reported an illegal copy_to_user() attempt from bpf_prog_get_info_by_fd() [1] There was no repro yet on this bug, but I think that commit 0aef499f3172 ("mm/usercopy: Detect vmalloc overruns") is exposing a prior bug in bpf arm64. bpf_prog_get_info_by_fd() looks at prog->jited_len to determine if the JIT image can be copied out to user space. My theory is that syzbot managed to get a prog where prog->jited_len has been set to 43, while prog->bpf_func has ben cleared. It is not clear why copy_to_user(uinsns, NULL, ulen) is triggering this particular warning. I thought find_vma_area(NULL) would not find a vm_struct. As we do not hold vmap_area_lock spinlock, it might be possible that the found vm_struct was garbage. [1] usercopy: Kernel memory exposure attempt detected from vmalloc (offset 792633534417210172, size 43)! kernel BUG at mm/usercopy.c:101! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 25002 Comm: syz-executor.1 Not tainted 5.18.0-syzkaller-10139-g8291eaafed36 #0 Hardware name: linux,dummy-virt (DT) pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : usercopy_abort+0x90/0x94 mm/usercopy.c:101 lr : usercopy_abort+0x90/0x94 mm/usercopy.c:89 sp : ffff80000b773a20 x29: ffff80000b773a30 x28: faff80000b745000 x27: ffff80000b773b48 x26: 0000000000000000 x25: 000000000000002b x24: 0000000000000000 x23: 00000000000000e0 x22: ffff80000b75db67 x21: 0000000000000001 x20: 000000000000002b x19: ffff80000b75db3c x18: 00000000fffffffd x17: 2820636f6c6c616d x16: 76206d6f72662064 x15: 6574636574656420 x14: 74706d6574746120 x13: 2129333420657a69 x12: 73202c3237313031 x11: 3237313434333533 x10: 3336323937207465 x9 : 657275736f707865 x8 : ffff80000a30c550 x7 : ffff80000b773830 x6 : ffff80000b773830 x5 : 0000000000000000 x4 : ffff00007fbbaa10 x3 : 0000000000000000 x2 : 0000000000000000 x1 : f7ff000028fc0000 x0 : 0000000000000064 Call trace: usercopy_abort+0x90/0x94 mm/usercopy.c:89 check_heap_object mm/usercopy.c:186 [inline] __check_object_size mm/usercopy.c:252 [inline] __check_object_size+0x198/0x36c mm/usercopy.c:214 check_object_size include/linux/thread_info.h:199 [inline] check_copy_size include/linux/thread_info.h:235 [inline] copy_to_user include/linux/uaccess.h:159 [inline] bpf_prog_get_info_by_fd.isra.0+0xf14/0xfdc kernel/bpf/syscall.c:3993 bpf_obj_get_info_by_fd+0x12c/0x510 kernel/bpf/syscall.c:4253 __sys_bpf+0x900/0x2150 kernel/bpf/syscall.c:4956 __do_sys_bpf kernel/bpf/syscall.c:5021 [inline] __se_sys_bpf kernel/bpf/syscall.c:5019 [inline] __arm64_sys_bpf+0x28/0x40 kernel/bpf/syscall.c:5019 __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/0xec arch/arm64/kernel/syscall.c:142 do_el0_svc+0xa0/0xc0 arch/arm64/kernel/syscall.c:206 el0_svc+0x44/0xb0 arch/arm64/kernel/entry-common.c:624 el0t_64_sync_handler+0x1ac/0x1b0 arch/arm64/kernel/entry-common.c:642 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:581 Code: aa0003e3 d00038c0 91248000 97fff65f (d4210000) Fixes: db496944fdaa ("bpf: arm64: add JIT support for multi-function programs") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220531215113.1100754-1-eric.dumazet@gmail.com Signed-off-by: Alexei Starovoitov commit 873a400938b31a1e443c4d94b560b78300787540 Author: Wonhyuk Yang Date: Wed May 4 11:32:03 2022 +0900 workqueue: Fix type of cpu in trace event The trace event "workqueue_queue_work" use unsigned int type for req_cpu, cpu. This casue confusing cpu number like below log. $ cat /sys/kernel/debug/tracing/trace cat-317 [001] ...: workqueue_queue_work: ... req_cpu=8192 cpu=4294967295 So, change unsigned type to signed type in the trace event. After applying this patch, cpu number will be printed as -1 instead of 4294967295 as folllows. $ cat /sys/kernel/debug/tracing/trace cat-1338 [002] ...: workqueue_queue_work: ... req_cpu=8192 cpu=-1 Cc: Baik Song An Cc: Hong Yeon Kim Cc: Taeung Song Cc: linuxgeek@linuxgeek.io Signed-off-by: Wonhyuk Yang Signed-off-by: Tejun Heo commit c4f135d643823a869becfa87539f7820ef9d5bfa Author: Tetsuo Handa Date: Wed Jun 1 16:32:47 2022 +0900 workqueue: Wrap flush_workqueue() using a macro Since flush operation synchronously waits for completion, flushing system-wide WQs (e.g. system_wq) might introduce possibility of deadlock due to unexpected locking dependency. Tejun Heo commented at [1] that it makes no sense at all to call flush_workqueue() on the shared WQs as the caller has no idea what it's gonna end up waiting for. Although there is flush_scheduled_work() which flushes system_wq WQ with "Think twice before calling this function! It's very easy to get into trouble if you don't take great care." warning message, syzbot found a circular locking dependency caused by flushing system_wq WQ [2]. Therefore, let's change the direction to that developers had better use their local WQs if flush_scheduled_work()/flush_workqueue(system_*_wq) is inevitable. Steps for converting system-wide WQs into local WQs are explained at [3], and a conversion to stop flushing system-wide WQs is in progress. Now we want some mechanism for preventing developers who are not aware of this conversion from again start flushing system-wide WQs. Since I found that WARN_ON() is complete but awkward approach for teaching developers about this problem, let's use __compiletime_warning() for incomplete but handy approach. For completeness, we will also insert WARN_ON() into __flush_workqueue() after all in-tree users stopped calling flush_scheduled_work(). Link: https://lore.kernel.org/all/YgnQGZWT%2Fn3VAITX@slm.duckdns.org/ [1] Link: https://syzkaller.appspot.com/bug?extid=bde0f89deacca7c765b8 [2] Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp [3] Signed-off-by: Tetsuo Handa Signed-off-by: Tejun Heo commit 7bf179de5b2dfae54a6839eaf7caba44a888ee2e Author: Kevin Locke Date: Mon Jun 6 20:42:54 2022 -0600 kbuild: avoid regex RS for POSIX awk In 22f26f21774f8 awk was added to deduplicate *.mod files. The awk invocation passes -v RS='( |\n)' to match a space or newline character as the record separator. Unfortunately, POSIX states[1] > If RS contains more than one character, the results are unspecified. Some implementations (such as the One True Awk[2] used by the BSDs) do not treat RS as a regular expression. When awk does not support regex RS, build failures such as the following are produced (first error using allmodconfig): CC [M] arch/x86/events/intel/uncore.o CC [M] arch/x86/events/intel/uncore_nhmex.o CC [M] arch/x86/events/intel/uncore_snb.o CC [M] arch/x86/events/intel/uncore_snbep.o CC [M] arch/x86/events/intel/uncore_discovery.o LD [M] arch/x86/events/intel/intel-uncore.o ld: cannot find uncore_nhmex.o: No such file or directory ld: cannot find uncore_snb.o: No such file or directory ld: cannot find uncore_snbep.o: No such file or directory ld: cannot find uncore_discovery.o: No such file or directory make[3]: *** [scripts/Makefile.build:422: arch/x86/events/intel/intel-uncore.o] Error 1 make[2]: *** [scripts/Makefile.build:487: arch/x86/events/intel] Error 2 make[1]: *** [scripts/Makefile.build:487: arch/x86/events] Error 2 make: *** [Makefile:1839: arch/x86] Error 2 To avoid this, use printf(1) to produce a newline between each object path, instead of the space produced by echo(1), so that the default RS can be used by awk. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html [2]: https://github.com/onetrueawk/awk Fixes: 22f26f21774f ("kbuild: get rid of duplication in *.mod files") Signed-off-by: Kevin Locke Signed-off-by: Masahiro Yamada commit 927c63e07810fe41cc0428d767ea4b59db193b80 Author: Rob Herring Date: Mon Jun 6 17:51:36 2022 -0500 dt-bindings: Drop more redundant 'maxItems/minItems' in if/then schemas Another round from new cases in 5.19-rc of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case. If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems. Signed-off-by: Rob Herring Acked-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20220606225137.1536010-1-robh@kernel.org commit c3c09e393a5e25fb2fd30b62f3c689e92b4343c4 Author: Rob Herring Date: Mon Jun 6 16:22:30 2022 -0500 dt-bindings: nvme: apple,nvme-ans: Drop 'maxItems' from 'apple,sart' A 'phandle' type is always a single cell, so 'maxItems: 1' is redundant. Fixes: 82b96552f15a ("dt-bindings: nvme: Add Apple ANS NVMe") Signed-off-by: Rob Herring Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20220606212230.1360617-1-robh@kernel.org commit e3a4167c880cf889f66887a152799df4d609dd21 Author: David Sterba Date: Thu Jun 2 23:57:17 2022 +0200 btrfs: add error messages to all unrecognized mount options Almost none of the errors stemming from a valid mount option but wrong value prints a descriptive message which would help to identify why mount failed. Like in the linked report: $ uname -r v4.19 $ mount -o compress=zstd /dev/sdb /mnt mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error. $ dmesg ... BTRFS error (device sdb): open_ctree failed Errors caused by memory allocation failures are left out as it's not a user error so reporting that would be confusing. Link: https://lore.kernel.org/linux-btrfs/9c3fec36-fc61-3a33-4977-a7e207c3fa4e@gmx.de/ CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Qu Wenruo Reviewed-by: Nikolay Borisov Reviewed-by: Anand Jain Signed-off-by: David Sterba commit 11d39e8cc43e1c6737af19ca9372e590061b5ad2 Author: Maxim Levitsky Date: Mon Jun 6 21:11:49 2022 +0300 KVM: SVM: fix tsc scaling cache logic SVM uses a per-cpu variable to cache the current value of the tsc scaling multiplier msr on each cpu. Commit 1ab9287add5e2 ("KVM: X86: Add vendor callbacks for writing the TSC multiplier") broke this caching logic. Refactor the code so that all TSC scaling multiplier writes go through a single function which checks and updates the cache. This fixes the following scenario: 1. A CPU runs a guest with some tsc scaling ratio. 2. New guest with different tsc scaling ratio starts on this CPU and terminates almost immediately. This ensures that the short running guest had set the tsc scaling ratio just once when it was set via KVM_SET_TSC_KHZ. Due to the bug, the per-cpu cache is not updated. 3. The original guest continues to run, it doesn't restore the msr value back to its own value, because the cache matches, and thus continues to run with a wrong tsc scaling ratio. Fixes: 1ab9287add5e2 ("KVM: X86: Add vendor callbacks for writing the TSC multiplier") Signed-off-by: Maxim Levitsky Message-Id: <20220606181149.103072-1-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit eae260be3a0111a28fe95923e117a55dddec0384 Author: Vitaly Kuznetsov Date: Wed Jun 1 16:43:22 2022 +0200 KVM: selftests: Make hyperv_clock selftest more stable hyperv_clock doesn't always give a stable test result, especially with AMD CPUs. The test compares Hyper-V MSR clocksource (acquired either with rdmsr() from within the guest or KVM_GET_MSRS from the host) against rdtsc(). To increase the accuracy, increase the measured delay (done with nop loop) by two orders of magnitude and take the mean rdtsc() value before and after rdmsr()/KVM_GET_MSRS. Reported-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov Reviewed-by: Maxim Levitsky Tested-by: Maxim Levitsky Message-Id: <20220601144322.1968742-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 5ba7c4c6d1c7af47a916f728bb5940669684a087 Author: Ben Gardon Date: Wed May 25 23:09:04 2022 +0000 KVM: x86/MMU: Zap non-leaf SPTEs when disabling dirty logging Currently disabling dirty logging with the TDP MMU is extremely slow. On a 96 vCPU / 96G VM backed with gigabyte pages, it takes ~200 seconds to disable dirty logging with the TDP MMU, as opposed to ~4 seconds with the shadow MMU. When disabling dirty logging, zap non-leaf parent entries to allow replacement with huge pages instead of recursing and zapping all of the child, leaf entries. This reduces the number of TLB flushes required. and reduces the disable dirty log time with the TDP MMU to ~3 seconds. Opportunistically add a WARN() to catch GFNs that are mapped at a higher level than their max level. Signed-off-by: Ben Gardon Message-Id: <20220525230904.1584480-1-bgardon@google.com> Signed-off-by: Paolo Bonzini commit 1df931d95f4dc1c11db1123e85d4e08156e46ef9 Author: Jan Beulich Date: Tue Jun 7 17:00:53 2022 +0200 x86: drop bogus "cc" clobber from __try_cmpxchg_user_asm() As noted (and fixed) a couple of times in the past, "=@cc" outputs and clobbering of "cc" don't work well together. The compiler appears to mean to reject such, but doesn't - in its upstream form - quite manage to yet for "cc". Furthermore two similar macros don't clobber "cc", and clobbering "cc" is pointless in asm()-s for x86 anyway - the compiler always assumes status flags to be clobbered there. Fixes: 989b5db215a2 ("x86/uaccess: Implement macros for CMPXCHG on user addresses") Signed-off-by: Jan Beulich Message-Id: <485c0c0b-a3a7-0b7c-5264-7d00c01de032@suse.com> Signed-off-by: Paolo Bonzini commit cf4a8693d97a51dccf5a1557248d12d6d8be4b9e Author: Shaoqin Huang Date: Mon Jun 6 18:59:05 2022 -0600 KVM: x86/mmu: Check every prev_roots in __kvm_mmu_free_obsolete_roots() When freeing obsolete previous roots, check prev_roots as intended, not the current root. Signed-off-by: Shaoqin Huang Fixes: 527d5cd7eece ("KVM: x86/mmu: Zap only obsolete roots if a root shadow page is zapped") Message-Id: <20220607005905.2933378-1-shaoqin.huang@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 2cdea19a34c2340b3aa69508804efe4e3750fcec Author: Marc Zyngier Date: Tue Jun 7 14:14:25 2022 +0100 KVM: arm64: Don't read a HW interrupt pending state in user context Since 5bfa685e62e9 ("KVM: arm64: vgic: Read HW interrupt pending state from the HW"), we're able to source the pending bit for an interrupt that is stored either on the physical distributor or on a device. However, this state is only available when the vcpu is loaded, and is not intended to be accessed from userspace. Unfortunately, the GICv2 emulation doesn't provide specific userspace accessors, and we fallback with the ones that are intended for the guest, with fatal consequences. Add a new vgic_uaccess_read_pending() accessor for userspace to use, build on top of the existing vgic_mmio_read_pending(). Reported-by: Eric Auger Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Marc Zyngier Fixes: 5bfa685e62e9 ("KVM: arm64: vgic: Read HW interrupt pending state from the HW") Link: https://lore.kernel.org/r/20220607131427.1164881-2-maz@kernel.org Cc: stable@vger.kernel.org commit 3e684903a8574ffc9475fdf13c4780a7adb506ad Author: Seth Forshee Date: Wed May 4 13:08:40 2022 -0500 entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set A livepatch transition may stall indefinitely when a kvm vCPU is heavily loaded. To the host, the vCPU task is a user thread which is spending a very long time in the ioctl(KVM_RUN) syscall. During livepatch transition, set_notify_signal() will be called on such tasks to interrupt the syscall so that the task can be transitioned. This interrupts guest execution, but when xfer_to_guest_mode_work() sees that TIF_NOTIFY_SIGNAL is set but not TIF_SIGPENDING it concludes that an exit to user mode is unnecessary, and guest execution is resumed without transitioning the task for the livepatch. This handling of TIF_NOTIFY_SIGNAL is incorrect, as set_notify_signal() is expected to break tasks out of interruptible kernel loops and cause them to return to userspace. Change xfer_to_guest_mode_work() to handle TIF_NOTIFY_SIGNAL the same as TIF_SIGPENDING, signaling to the vCPU run loop that an exit to userpsace is needed. Any pending task_work will be run when get_signal() is called from exit_to_user_mode_loop(), so there is no longer any need to run task work from xfer_to_guest_mode_work(). Suggested-by: "Eric W. Biederman" Cc: Petr Mladek Signed-off-by: Seth Forshee Message-Id: <20220504180840.2907296-1-sforshee@digitalocean.com> Signed-off-by: Paolo Bonzini commit e8bc2427018826e02add7b0ed0fc625a60390ae5 Author: Alexey Kardashevskiy Date: Wed Jun 1 03:43:28 2022 +0200 KVM: Don't null dereference ops->destroy A KVM device cleanup happens in either of two callbacks: 1) destroy() which is called when the VM is being destroyed; 2) release() which is called when a device fd is closed. Most KVM devices use 1) but Book3s's interrupt controller KVM devices (XICS, XIVE, XIVE-native) use 2) as they need to close and reopen during the machine execution. The error handling in kvm_ioctl_create_device() assumes destroy() is always defined which leads to NULL dereference as discovered by Syzkaller. This adds a checks for destroy!=NULL and adds a missing release(). This is not changing kvm_destroy_devices() as devices with defined release() should have been removed from the KVM devices list by then. Suggested-by: Paolo Bonzini Signed-off-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini commit 304791255a2dc1c9be7e7c8a6cbdb31b6847b0e5 Author: Scott Mayhew Date: Wed Jun 1 13:34:49 2022 -0400 sunrpc: set cl_max_connect when cloning an rpc_clnt If the initial attempt at trunking detection using the krb5i auth flavor fails with -EACCES, -NFS4ERR_CLID_INUSE, or -NFS4ERR_WRONGSEC, then the NFS client tries again using auth_sys, cloning the rpc_clnt in the process. If this second attempt at trunking detection succeeds, then the resulting nfs_client->cl_rpcclient winds up having cl_max_connect=0 and subsequent attempts to add additional transport connections to the rpc_clnt will fail with a message similar to the following being logged: [502044.312640] SUNRPC: reached max allowed number (0) did not add transport to server: 192.168.122.3 Signed-off-by: Scott Mayhew Fixes: dc48e0abee24 ("SUNRPC enforce creation of no more than max_connect xprts") Signed-off-by: Anna Schumaker commit e3fe65e0d3671ee5ae8a2723e429ee4830a7c89c Author: sunliming Date: Thu Jun 2 10:48:05 2022 +0800 KVM: arm64: Fix inconsistent indenting Fix the following smatch warnings: arch/arm64/kvm/vmid.c:62 flush_context() warn: inconsistent indenting Reported-by: kernel test robot Signed-off-by: sunliming Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220602024805.511457-1-sunliming@kylinos.cn commit 039f49c4cafb785504c678f28664d088e0108d35 Author: Marc Zyngier Date: Sat May 28 12:38:12 2022 +0100 KVM: arm64: Always start with clearing SME flag on load On each vcpu load, we set the KVM_ARM64_HOST_SME_ENABLED flag if SME is enabled for EL0 on the host. This is used to restore the correct state on vpcu put. However, it appears that nothing ever clears this flag. Once set, it will stick until the vcpu is destroyed, which has the potential to spuriously enable SME for userspace. As it turns out, this is due to the SME code being more or less copied from SVE, and inheriting the same shortcomings. We never saw the issue because nothing uses SME, and the amount of testing is probably still pretty low. Fixes: 861262ab8627 ("KVM: arm64: Handle SME host state when running guests") Signed-off-by: Marc Zyngier Reviwed-by: Mark Brown Link: https://lore.kernel.org/r/20220528113829.1043361-3-maz@kernel.org commit d52d165d67c5aa26c8c89909003c94a66492d23d Author: Marc Zyngier Date: Sat May 28 12:38:11 2022 +0100 KVM: arm64: Always start with clearing SVE flag on load On each vcpu load, we set the KVM_ARM64_HOST_SVE_ENABLED flag if SVE is enabled for EL0 on the host. This is used to restore the correct state on vpcu put. However, it appears that nothing ever clears this flag. Once set, it will stick until the vcpu is destroyed, which has the potential to spuriously enable SVE for userspace. We probably never saw the issue because no VMM uses SVE, but that's still pretty bad. Unconditionally clearing the flag on vcpu load addresses the issue. Fixes: 8383741ab2e7 ("KVM: arm64: Get rid of host SVE tracking/saving") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220528113829.1043361-2-maz@kernel.org commit ac6888ac5a11c0a47d1f1da4b7809c0c595fdc5d Author: Eddie James Date: Mon Jun 6 13:54:55 2022 -0500 hwmon: (occ) Lock mutex in shutdown to prevent race with occ_active Unbinding the driver or removing the parent device at the same time as using the OCC active sysfs file can cause the driver to unregister the hwmon device twice. Prevent this by locking the occ mutex in the shutdown function. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220606185455.21126-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck commit 5e3f89ad8e0cbd75aa3479e9ceb96d9e1c5585b8 Author: Rob Herring Date: Mon Jun 6 16:22:22 2022 -0500 dt-bindings: hwmon: ti,tmp401: Drop 'items' from 'ti,n-factor' property 'ti,n-factor' is a scalar type, so 'items' should not be used as that is for arrays/matrix. A pending meta-schema change will catch future cases. Fixes: bd90c5b93950 ("dt-bindings: hwmon: Add TMP401, TMP411 and TMP43x") Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220606212223.1360395-1-robh@kernel.org Signed-off-by: Guenter Roeck commit 53ee5d7b4523019a1bc1f3d41235234d1f3f5ada Merge: d5ea7544c32ba 2abdf9f80019e Author: Takashi Iwai Date: Tue Jun 7 14:11:38 2022 +0200 Merge tag 'asoc-fix-v5.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.19 A few more fixes for v5.19 which came in during the second half of the merge window, again nothing that's really remarkable outside of the individual drivers. commit cf67838c4422eab826679b076dad99f96152b4de Author: Lina Wang Date: Mon Jun 6 14:45:17 2022 +0800 selftests net: fix bpf build error bpf_helpers.h has been moved to tools/lib/bpf since 5.10, so add more including path. Fixes: edae34a3ed92 ("selftests net: add UDP GRO fraglist + bpf self-tests") Reported-by: kernel test robot Signed-off-by: Lina Wang Acked-by: Song Liu Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220606064517.8175-1-lina.wang@mediatek.com Signed-off-by: Paolo Abeni commit 1d0811b03eb30b2f0793acaa96c6ce90b8b9c87a Author: Helge Deller Date: Tue Jun 7 12:57:58 2022 +0200 parisc/stifb: Fix fb_is_primary_device() only available with CONFIG_FB_STI Fix this build error noticed by the kernel test robot: drivers/video/console/sticore.c:1132:5: error: redefinition of 'fb_is_primary_device' arch/parisc/include/asm/fb.h:18:19: note: previous definition of 'fb_is_primary_device' Signed-off-by: Helge Deller Reported-by: kernel test robot Cc: stable@vger.kernel.org # v5.10+ commit 662a80946ce13633ae90a55379f1346c10f0c432 Author: Kuniyuki Iwashima Date: Sun Jun 5 16:23:25 2022 -0700 af_unix: Fix a data-race in unix_dgram_peer_wake_me(). unix_dgram_poll() calls unix_dgram_peer_wake_me() without `other`'s lock held and check if its receive queue is full. Here we need to use unix_recvq_full_lockless() instead of unix_recvq_full(), otherwise KCSAN will report a data-race. Fixes: 7d267278a9ec ("unix: avoid use-after-free in ep_remove_wait_queue") Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20220605232325.11804-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit 5e74a4b3ec1816e3bbfd715d46ae29d2508079cb Author: Christophe JAILLET Date: Sun Jun 5 22:50:48 2022 +0200 stmmac: intel: Fix an error handling path in intel_eth_pci_probe() When the managed API is used, there is no need to explicitly call pci_free_irq_vectors(). This looks to be a left-over from the commit in the Fixes tag. Only the .remove() function had been updated. So remove this unused function call and update goto label accordingly. Fixes: 8accc467758e ("stmmac: intel: use managed PCI function on probe and resume") Signed-off-by: Christophe JAILLET Reviewed-by: Wong Vee Khee Link: https://lore.kernel.org/r/1ac9b6787b0db83b0095711882c55c77c8ea8da0.1654462241.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit d5ea7544c32ba27c2c5826248e4ff58bd50a2518 Author: huangwenhui Date: Tue Jun 7 14:56:31 2022 +0800 ALSA: hda/conexant - Fix loopback issue with CX20632 On a machine with CX20632, Alsamixer doesn't have 'Loopback Mixing' and 'Line'. Signed-off-by: huangwenhui Cc: Link: https://lore.kernel.org/r/20220607065631.10708-1-huangwenhuia@uniontech.com Signed-off-by: Takashi Iwai commit 16bc4d196b2a8960cac3bdfd4c98d72c44ab043b Author: Peter Geis Date: Mon Jun 6 12:30:23 2022 -0400 arm64: dts: rockchip: Fix ethernet on production Quartz64-B The production Quartz64 Model B has compatibility issues when using rgmii-id mode. Switch to rgmii mode and use the SoC's delays to ensure full compatibility. Reported-by: Frank Mankel Fixes: dcc8c66bef79 ("arm64: dts: rockchip: add Pine64 Quartz64-B device tree") Signed-off-by: Peter Geis Tested-by: Frank Mankel Link: https://lore.kernel.org/r/20220606163023.3677147-1-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 118f767413ada4eef7825fbd4af7c0866f883441 Author: Kamal Heib Date: Wed May 25 16:20:29 2022 +0300 RDMA/qedr: Fix reporting QP timeout attribute Make sure to save the passed QP timeout attribute when the QP gets modified, so when calling query QP the right value is reported and not the converted value that is required by the firmware. This issue was found while running the pyverbs tests. Fixes: cecbcddf6461 ("qedr: Add support for QP verbs") Link: https://lore.kernel.org/r/20220525132029.84813-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Acked-by: Michal Kalderon  Signed-off-by: Leon Romanovsky commit 77991645952c21962a095910c51fe0f73d35bf91 Author: Roger Knecht Date: Sat May 21 14:47:45 2022 +0200 crc-itu-t: fix typo in CRC ITU-T polynomial comment The code comment says that the polynomial is x^16 + x^12 + x^15 + 1, but the correct polynomial is x^16 + x^12 + x^5 + 1. Quoting from page 2 in the ITU-T V.41 specification [1]: 2 Encoding and checking process The service bits and information bits, taken in conjunction, correspond to the coefficients of a message polynomial having terms from x^(n-1) (n = total number of bits in a block or sequence) down to x^16. This polynomial is divided, modulo 2, by the generating polynomial x^16 + x^12 + x^5 + 1. The hex (truncated) polynomial 0x1021 and CRC code implementation are correct, however. [1] https://www.itu.int/rec/T-REC-V.41-198811-I/en Signed-off-by: Roger Knecht Acked-by: Randy Dunlap Signed-off-by: Jason A. Donenfeld commit dbac14a5a05ff8e1ce7c0da0e1f520ce39ec62ea Author: Masahiro Yamada Date: Mon Jun 6 13:59:20 2022 +0900 xen: unexport __init-annotated xen_xlate_map_ballooned_pages() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because none of the in-tree call-sites (arch/arm/xen/enlighten.c, arch/x86/xen/grant-table.c) is compiled as modular. Fixes: 243848fc018c ("xen/grant-table: Move xlated_setup_gnttab_pages to common place") Reported-by: Stephen Rothwell Signed-off-by: Masahiro Yamada Reviewed-by: Oleksandr Tyshchenko Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/20220606045920.4161881-1-masahiroy@kernel.org Signed-off-by: Juergen Gross commit 2e45f2185283a2d927ef2cdbdc246cd65740c8df Author: Yong Zhi Date: Mon Jun 6 15:42:32 2022 -0500 ALSA: hda: MTL: add HD Audio PCI ID and HDMI codec vendor ID Add HD Audio PCI ID for Intel Meteorlake platform. [ corrected the hex number to lower letters by tiwai ] Signed-off-by: Kai Vehmanen Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220606204232.144296-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 680c0aee97690c3f595e074a5f677599aac5d26b Author: Chester Lin Date: Wed May 25 09:49:22 2022 +0800 MAINTAINERS: add a new reviewer for S32G Add the NXP S32 Linux team as a designated review group of s32g. Signed-off-by: Chester Lin Link: https://lore.kernel.org/r/20220525161422.14156-1-clin@suse.com commit 4266e2f70d4388b8c6a95056169954ff049ced94 Author: Fabio Estevam Date: Sat May 14 11:35:05 2022 -0300 arm64: s32g2: Pass unit name to soc node Pass unit name to soc node to fix the following W=1 build warning: arch/arm64/boot/dts/freescale/s32g2.dtsi:82.6-123.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Signed-off-by: Fabio Estevam Reviewed-by: Chester Lin Signed-off-by: Chester Lin Link: https://lore.kernel.org/r/20220514143505.1554813-1-festevam@gmail.com commit e71e60cd74df9386c3f684c54888f2367050b831 Merge: f2906aa863381 e15db62bc5648 Author: Linus Torvalds Date: Mon Jun 6 17:56:18 2022 -0700 Merge tag 'dma-mapping-5.19-2022-06-06' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - fix a regressin in setting swiotlb ->force_bounce (me) - make dma-debug less chatty (Rob Clark) * tag 'dma-mapping-5.19-2022-06-06' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: fix setting ->force_bounce dma-debug: make things less spammy under memory pressure commit 8ea21823aa584b55ba4b861307093b78054b0c1b Author: Shyam Prasad N Date: Tue May 31 12:31:05 2022 +0000 cifs: return errors during session setup during reconnects During reconnects, we check the return value from cifs_negotiate_protocol, and have handlers for both success and failures. But if that passes, and cifs_setup_session returns any errors other than -EACCES, we do not handle that. This fix adds a handler for that, so that we don't go ahead and try a tree_connect on a failed session. Signed-off-by: Shyam Prasad N Reviewed-by: Enzo Matsumiya Cc: stable@vger.kernel.org Signed-off-by: Steve French commit b8d91399775c55162073bb2aca061ec42e3d4bc1 Author: Miaoqian Lin Date: Fri Jun 3 17:32:38 2022 +0400 net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file") Signed-off-by: Miaoqian Lin Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220603133238.44114-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski commit 41bdb8a0cc4722d7e00606a49b35921652821cea Merge: c76acfb7e19dc d7970039d87c9 Author: Jakub Kicinski Date: Mon Jun 6 14:27:39 2022 -0700 Merge branch 'amt-fix-several-bugs-in-amt_rcv' Taehee Yoo says: ==================== amt: fix several bugs in amt_rcv() This series fixes bugs in amt_rcv(). First patch fixes pskb_may_pull() issue. Some functions missed to call pskb_may_pull() and uses wrong parameter of pskb_may_pull(). Second patch fixes possible null-ptr-deref in amt_rcv(). If there is no amt private data in sock, skb will be freed. And it increases stats. But in order to increase stats, amt private data is needed. So, uninitialised pointer will be used at that point. Third patch fixes wrong definition of type_str[] in amt.c ==================== Link: https://lore.kernel.org/r/20220602140108.18329-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski commit d7970039d87c926bb648982e920cb9851c19f3e1 Author: Taehee Yoo Date: Thu Jun 2 14:01:08 2022 +0000 amt: fix wrong type string definition amt message type definition starts from 1, not 0. But type_str[] starts from 0. So, it prints wrong type information. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit d16207f92a4a823c48b4ea953ad51f4483456768 Author: Taehee Yoo Date: Thu Jun 2 14:01:07 2022 +0000 amt: fix possible null-ptr-deref in amt_rcv() When amt interface receives amt message, it tries to obtain amt private data from sock. If there is no amt private data, it frees an skb immediately. After kfree_skb(), it increases the rx_dropped stats. But in order to use rx_dropped, amt private data is needed. So, it makes amt_rcv() to do not increase rx_dropped stats when it can not obtain amt private data. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 1a1a0e80e005 ("amt: fix possible memory leak in amt_rcv()") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit f55a07074fdd38cab8c097ac5bd397d68eff733c Author: Taehee Yoo Date: Thu Jun 2 14:01:06 2022 +0000 amt: fix wrong usage of pskb_may_pull() It adds missing pskb_may_pull() in amt_update_handler() and amt_multicast_data_handler(). And it fixes wrong parameter of pskb_may_pull() in amt_advertisement_handler() and amt_membership_query_handler(). Reported-by: Jakub Kicinski Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit e54a4424925a27ed94dff046db3ce5caf4b1e748 Author: Brian Norris Date: Mon Feb 28 12:25:32 2022 -0800 drm/atomic: Force bridge self-refresh-exit on CRTC switch It's possible to change which CRTC is in use for a given connector/encoder/bridge while we're in self-refresh without fully disabling the connector/encoder/bridge along the way. This can confuse the bridge encoder/bridge, because (a) it needs to track the SR state (trying to perform "active" operations while the panel is still in SR can be Bad(TM)); and (b) it tracks the SR state via the CRTC state (and after the switch, the previous SR state is lost). Thus, we need to either somehow carry the self-refresh state over to the new CRTC, or else force an encoder/bridge self-refresh transition during such a switch. I choose the latter, so we disable the encoder (and exit PSR) before attaching it to the new CRTC (where we can continue to assume a clean (non-self-refresh) state). This fixes PSR issues seen on Rockchip RK3399 systems with drivers/gpu/drm/bridge/analogix/analogix_dp_core.c. Change in v2: - Drop "->enable" condition; this could possibly be "->active" to reflect the intended hardware state, but it also is a little over-specific. We want to make a transition through "disabled" any time we're exiting PSR at the same time as a CRTC switch. (Thanks Liu Ying) Cc: Liu Ying Cc: Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh mode in drivers") Signed-off-by: Brian Norris Reviewed-by: Sean Paul Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220228122522.v2.2.Ic15a2ef69c540aee8732703103e2cff51fb9c399@changeid commit ca871659ec1606d33b1e76de8d4cf924cf627e34 Author: Brian Norris Date: Mon Feb 28 12:25:31 2022 -0800 drm/bridge: analogix_dp: Support PSR-exit to disable transition Most eDP panel functions only work correctly when the panel is not in self-refresh. In particular, analogix_dp_bridge_disable() tends to hit AUX channel errors if the panel is in self-refresh. Given the above, it appears that so far, this driver assumes that we are never in self-refresh when it comes time to fully disable the bridge. Prior to commit 846c7dfc1193 ("drm/atomic: Try to preserve the crtc enabled state in drm_atomic_remove_fb, v2."), this tended to be true, because we would automatically disable the pipe when framebuffers were removed, and so we'd typically disable the bridge shortly after the last display activity. However, that is not guaranteed: an idle (self-refresh) display pipe may be disabled, e.g., when switching CRTCs. We need to exit PSR first. Stable notes: this is definitely a bugfix, and the bug has likely existed in some form for quite a while. It may predate the "PSR helpers" refactor, but the code looked very different before that, and it's probably not worth rewriting the fix. Cc: Fixes: 6c836d965bad ("drm/rockchip: Use the helpers for PSR") Signed-off-by: Brian Norris Reviewed-by: Sean Paul Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220228122522.v2.1.I161904be17ba14526f78536ccd78b85818449b51@changeid commit 7b6c7a877cc616bc7dc9cd39646fe454acbed48b Author: Josh Poimboeuf Date: Fri Jun 3 08:04:44 2022 -0700 x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage The file-wide OBJECT_FILES_NON_STANDARD annotation is used with CONFIG_FRAME_POINTER to tell objtool to skip the entire file when frame pointers are enabled. However that annotation is now deprecated because it doesn't work with IBT, where objtool runs on vmlinux.o instead of individual translation units. Instead, use more fine-grained function-specific annotations: - The 'save_mcount_regs' macro does funny things with the frame pointer. Use STACK_FRAME_NON_STANDARD_FP to tell objtool to ignore the functions using it. - The return_to_handler() "function" isn't actually a callable function. Instead of being called, it's returned to. The real return address isn't on the stack, so unwinding is already doomed no matter which unwinder is used. So just remove the STT_FUNC annotation, telling objtool to ignore it. That also removes the implicit ANNOTATE_NOENDBR, which now needs to be made explicit. Fixes the following warning: vmlinux.o: warning: objtool: __fentry__+0x16: return with modified stack frame Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/b7a7a42fe306aca37826043dac89e113a1acdbac.1654268610.git.jpoimboe@kernel.org commit dcea997beed694cbd8705100ca1a6eb0d886de69 Author: Josh Poimboeuf Date: Wed Jun 1 17:42:22 2022 -0700 faddr2line: Fix overlapping text section failures, the sequel If a function lives in a section other than .text, but .text also exists in the object, faddr2line may wrongly assume .text. This can result in comically wrong output. For example: $ scripts/faddr2line vmlinux.o enter_from_user_mode+0x1c enter_from_user_mode+0x1c/0x30: find_next_bit at /home/jpoimboe/git/linux/./include/linux/find.h:40 (inlined by) perf_clear_dirty_counters at /home/jpoimboe/git/linux/arch/x86/events/core.c:2504 Fix it by passing the section name to addr2line, unless the object file is vmlinux, in which case the symbol table uses absolute addresses. Fixes: 1d1a0e7c5100 ("scripts/faddr2line: Fix overlapping text section failures") Reported-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/7d25bc1408bd3a750ac26e60d2f2815a5f4a8363.1654130536.git.jpoimboe@kernel.org commit c2f75a43f5ae48b9babeb5b82c9f23fe18d3d144 Author: Josh Poimboeuf Date: Wed Jun 1 09:42:12 2022 -0700 objtool: Fix obsolete reference to CONFIG_X86_SMAP CONFIG_X86_SMAP no longer exists. For objtool's purposes it has been replaced with CONFIG_HAVE_UACCESS_VALIDATION. Fixes: 03f16cd020eb ("objtool: Add CONFIG_OBJTOOL") Reported-by: Lukas Bulwahn Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/44c57668768c1ba1b4ba1ff541ec54781636e07c.1654101721.git.jpoimboe@kernel.org commit 3a41c64d9c1185a2f3a184015e2a9b78bfc99c71 Author: Pablo Neira Ayuso Date: Mon Jun 6 17:31:29 2022 +0200 netfilter: nf_tables: bail out early if hardware offload is not supported If user requests for NFT_CHAIN_HW_OFFLOAD, then check if either device provides the .ndo_setup_tc interface or there is an indirect flow block that has been registered. Otherwise, bail out early from the preparation phase. Moreover, validate that family == NFPROTO_NETDEV and hook is NF_NETDEV_INGRESS. Fixes: c9626a2cbdb2 ("netfilter: nf_tables: add hardware offload support") Signed-off-by: Pablo Neira Ayuso commit a2d2bfc9d56513684260b6aab26a2e0b56b09d92 Author: Lukas Bulwahn Date: Wed Jun 1 06:17:46 2022 +0200 MAINTAINERS: rectify entries for ARM DRM DRIVERS after dt conversion The three commits: 36fd2a65bcaf ("dt-bindings: display: convert Arm HDLCD to DT schema") 0f6983509ea1 ("dt-bindings: display: convert Arm Komeda to DT schema") 2c8b082a3ab1 ("dt-bindings: display: convert Arm Mali-DP to DT schema") convert the arm display dt-bindings, arm,*.txt to arm,*.yaml, but miss to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about broken references. Repair these file references in ARM HDLCD DRM DRIVER, ARM KOMEDA DRM-KMS DRIVER and ARM MALI-DP DRM DRIVER. Signed-off-by: Lukas Bulwahn Acked-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220601041746.22986-1-lukas.bulwahn@gmail.com commit 09fed02c20a659e15c9b47a52e8cf2dffa41cda9 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:42 2022 +0100 MAINTAINERS: update snps,axs10x-reset.yaml reference Changeset 820f722c05dd ("dt-bindings: reset: snps,axs10x-reset: Convert to yaml") renamed: Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt to: Documentation/devicetree/bindings/reset/snps,axs10x-reset.yaml. Update its cross-reference accordingly. Fixes: 820f722c05dd ("dt-bindings: reset: snps,axs10x-reset: Convert to yaml") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/56560a2bcc06af94d36a28ed2cfdb25de481eee5.1654529011.git.mchehab@kernel.org commit e5f580e72498ef634ae293c8d4ba7184f5191c74 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:40 2022 +0100 MAINTAINERS: update dongwoon,dw9807-vcm.yaml reference Changeset a1f4626b282d ("media: dt-bindings: Convert Dongwoon dw9807-vcm bindings to json-schema") renamed: Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.txt to: Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml. Update its cross-reference accordingly. Fixes: a1f4626b282d ("media: dt-bindings: Convert Dongwoon dw9807-vcm bindings to json-schema") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/89f11772dd4afe9700d6cbbb3da8749eb98b396a.1654529011.git.mchehab@kernel.org commit 7470ce60be24de8117b71614a3d610b8619f2108 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:39 2022 +0100 MAINTAINERS: update cortina,gemini-ethernet.yaml reference Changeset 208b65f7b5cc ("dt-bindings: net: convert net/cortina,gemini-ethernet to yaml") renamed: Documentation/devicetree/bindings/net/cortina,gemini-ethernet.txt to: Documentation/devicetree/bindings/net/cortina,gemini-ethernet.yaml. Update its cross-reference accordingly. Fixes: 208b65f7b5cc ("dt-bindings: net: convert net/cortina,gemini-ethernet to yaml") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/d27b5d508fb757147b720bf573ce5a2e3fc5920e.1654529011.git.mchehab@kernel.org commit 69c2533eb9dfc650baa5f0f624ee4e7cc57afd7a Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:27 2022 +0100 dt-bindings: mfd: rk808: update rockchip,rk808.yaml reference Changeset 6c38ca03406e ("dt-bindings: mfd: rk808: Convert bindings to yaml") renamed: Documentation/devicetree/bindings/mfd/rk808.txt to: Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml. Update its cross-reference accordingly. Fixes: 6c38ca03406e ("dt-bindings: mfd: rk808: Convert bindings to yaml") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/417281c270e098eefed763859480014bec75c883.1654529011.git.mchehab@kernel.org commit 47a22a251543f4710b954f4b36f3e6063017a82b Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:26 2022 +0100 dt-bindings: reset: update st,stih407-powerdown.yaml references Changeset 2ca065dc9468 ("dt-bindings: reset: st,sti-powerdown: Convert to yaml") renamed: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt to: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml. Update the cross-references accordingly. Fixes: 2ca065dc9468 ("dt-bindings: reset: st,sti-powerdown: Convert to yaml") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/debdd5a9a1bfa0cf1c7e9c45da32edbc2ac2d10a.1654529011.git.mchehab@kernel.org commit 71a834b7f744fab6ae83dc1bfc22030b5baa5dd5 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:25 2022 +0100 dt-bindings: arm: update vexpress-config.yaml references Changeset 7e8339b5162f ("dt-bindings: arm: convert vexpress-config to DT schema") renamed: Documentation/devicetree/bindings/arm/vexpress-sysreg.txt to: Documentation/devicetree/bindings/arm/vexpress-config.yaml. Update the cross-references accordingly. Fixes: 7e8339b5162f ("dt-bindings: arm: convert vexpress-config to DT schema") Signed-off-by: Mauro Carvalho Chehab Acked-by: Guenter Roeck Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/7020edd9e183652249fc95bf61a1055cc342a4dc.1654529011.git.mchehab@kernel.org commit 7e40381d8a33e41e347cea5bdd000091653000c6 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:24 2022 +0100 dt-bindings: interrupt-controller: update brcm,l2-intc.yaml reference Changeset 539d25b21fe8 ("dt-bindings: interrupt-controller: Convert Broadcom STB L2 to YAML") renamed: Documentation/devicetree/bindings/interrupt-controller/brcm,l2-intc.txt to: Documentation/devicetree/bindings/interrupt-controller/brcm,l2-intc.yaml. Update its cross-reference accordingly. Fixes: 539d25b21fe8 ("dt-bindings: interrupt-controller: Convert Broadcom STB L2 to YAML") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/a40c02a7aaea91ea7b6ce24b6bc574ae5bcf4cf6.1654529011.git.mchehab@kernel.org commit e0b5c5984d4810733b7c24a3d16c904fffc086d2 Author: Mauro Carvalho Chehab Date: Mon Jun 6 16:25:23 2022 +0100 dt-bindings: mfd: bd9571mwv: update rohm,bd9571mwv.yaml reference Changeset 983b62975e90 ("dt-bindings: mfd: bd9571mwv: Convert to json-schema") renamed: Documentation/devicetree/bindings/mfd/bd9571mwv.txt to: Documentation/devicetree/bindings/mfd/rohm,bd9571mwv.yaml. Update its cross-reference accordingly. Fixes: 983b62975e90 ("dt-bindings: mfd: bd9571mwv: Convert to json-schema") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1906a4d935eab57c10ce09358eae02175ce4abb7.1654529011.git.mchehab@kernel.org commit c76acfb7e19dcc3a0964e0563770b1d11b8d4540 Author: Tan Tee Min Date: Thu May 26 17:03:47 2022 +0800 net: phy: dp83867: retrigger SGMII AN when link change There is a limitation in TI DP83867 PHY device where SGMII AN is only triggered once after the device is booted up. Even after the PHY TPI is down and up again, SGMII AN is not triggered and hence no new in-band message from PHY to MAC side SGMII. This could cause an issue during power up, when PHY is up prior to MAC. At this condition, once MAC side SGMII is up, MAC side SGMII wouldn`t receive new in-band message from TI PHY with correct link status, speed and duplex info. As suggested by TI, implemented a SW solution here to retrigger SGMII Auto-Neg whenever there is a link change. v2: Add Fixes tag in commit message. Fixes: 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy") Cc: # 5.4.x Signed-off-by: Sit, Michael Wei Hong Reviewed-by: Voon Weifeng Signed-off-by: Tan Tee Min Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220526090347.128742-1-tee.min.tan@linux.intel.com Signed-off-by: Jakub Kicinski commit e0469d6581aecb0e34e2ec64f39f88e6985cc52f Author: Takashi Iwai Date: Mon Jun 6 18:09:10 2022 +0200 ALSA: usb-audio: Set up (implicit) sync for Saffire 6 Focusrite Saffire 6 has fixed audioformat quirks with multiple endpoints assigned to a single altsetting. Unfortunately the generic parser couldn't detect the sync endpoint correctly as the implicit sync due to the missing EP attribute bits. In the former kernels, it used to work somehow casually, but it's been broken for a while after the large code change in 5.11. This patch cures the regression by the following: - Allow the static quirk table to provide the sync EP information; we just need to fill the fields and let the generic parser skipping parsing if sync_ep is already set. - Add the sync endpoint information to the entry for Saffire 6. Fixes: 7b0efea4baf0 ("ALSA: usb-audio: Add missing ep_idx in fixed EP quirks") Reported-and-tested-by: André Kapelrud Cc: Link: https://lore.kernel.org/r/20220606160910.6926-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit efb75df105e82f076a85b9f2d81410428bcb55fc Author: Takashi Iwai Date: Mon Jun 6 18:09:09 2022 +0200 ALSA: usb-audio: Skip generic sync EP parse for secondary EP When ep_idx is already non-zero, it means usually a capture stream that is set up explicity by a fixed-format quirk, and applying the check for generic (non-implicit-fb) sync EPs might hit incorrectly, resulting in a bogus sync endpoint for the capture stream. This patch adds a check for the ep_idx and skip if it's a secondary endpoint. It's a part of the fixes for regressions on Saffire 6. Fixes: 7b0efea4baf0 ("ALSA: usb-audio: Add missing ep_idx in fixed EP quirks") Reported-and-tested-by: André Kapelrud Cc: Link: https://lore.kernel.org/r/20220606160910.6926-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 880265c77ac415090090d1fe72a188fee71cb458 Author: Trond Myklebust Date: Tue May 31 11:03:07 2022 -0400 pNFS: Avoid a live lock condition in pnfs_update_layout() If we're about to send the first layoutget for an empty layout, we want to make sure that we drain out the existing pending layoutget calls first. The reason is that these layouts may have been already implicitly returned to the server by a recall to which the client gave a NFS4ERR_NOMATCHING_LAYOUT response. The problem is that wait_var_event_killable() could in principle see the plh_outstanding count go back to '1' when the first process to wake up starts sending a new layoutget. If it fails to get a layout, then this loop can continue ad infinitum... Fixes: 0b77f97a7e42 ("NFSv4/pnfs: Fix layoutget behaviour after invalidation") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit fe44fb23d6ccde4c914c44ef74ab8d9d9ba02bea Author: Trond Myklebust Date: Tue May 31 11:03:06 2022 -0400 pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE If the server tells us that a pNFS layout is not available for a specific file, then we should not keep pounding it with further layoutget requests. Fixes: 183d9e7b112a ("pnfs: rework LAYOUTGET retry handling") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 9dd732e0bdf538b1b76dc7c157e2b5e560ff30d3 Author: Pablo Neira Ayuso Date: Mon Jun 6 17:15:57 2022 +0200 netfilter: nf_tables: memleak flow rule from commit path Abort path release flow rule object, however, commit path does not. Update code to destroy these objects before releasing the transaction. Fixes: c9626a2cbdb2 ("netfilter: nf_tables: add hardware offload support") Signed-off-by: Pablo Neira Ayuso commit c271cc9febaaa1bcbc0842d1ee30466aa6148ea8 Author: Pablo Neira Ayuso Date: Sun Jun 5 13:40:06 2022 +0200 netfilter: nf_tables: release new hooks on unsupported flowtable flags Release the list of new hooks that are pending to be registered in case that unsupported flowtable flags are provided. Fixes: 78d9f48f7f44 ("netfilter: nf_tables: add devices to existing flowtable") Signed-off-by: Pablo Neira Ayuso commit d0c94bef70e71e364c0a016b0e92307cd4d1d719 Author: Cristian Marussi Date: Mon May 30 12:52:36 2022 +0100 firmware: arm_scmi: Remove all the unused local variables While using SCMI iterators helpers a few local automatic variables are defined but then used only as input for sizeof operators. cppcheck is fooled to complain about this with: | drivers/firmware/arm_scmi/sensors.c:341:48: warning: Variable 'msg' is | not assigned a value. [unassignedVariable] | struct scmi_msg_sensor_list_update_intervals *msg; Even though this is an innocuos warning, since the uninitialized variable is at the end never used in the reported cases, fix these occurences all over SCMI stack to avoid keeping unneeded objects on the stack. Link: https://lore.kernel.org/r/20220530115237.277077-1-cristian.marussi@arm.com Cc: Dan Carpenter Cc: Sudeep Holla Reported-by: kernel test robot Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 122839b58a089ff7f231759e2c8f63790724cae2 Author: Cristian Marussi Date: Mon May 23 18:15:59 2022 +0100 firmware: arm_scmi: Relax base protocol sanity checks on the protocol list Even though malformed replies from firmware must be treated carefully to avoid memory corruption in the kernel, some out-of-spec SCMI replies can be tolerated to avoid breaking existing deployed system, as long as they won't cause memory issues. Relax the sanity checks on the recieved protocol list in the base protocol to avoid breaking one of the deployed platform whose firmware is not easily upgradable currently. Link: https://lore.kernel.org/r/20220523171559.472112-1-cristian.marussi@arm.com Cc: Etienne Carriere Cc: Sudeep Holla Reported-by: Nicolas Frattaroli Tested-By: Frank Wunderlich Acked-by: Michael Riesch Acked-by: Etienne Carriere Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 0591f04036218d572d54349ea8c7914ad9c82b2b Author: Qu Wenruo Date: Wed May 18 13:03:09 2022 +0800 btrfs: prevent remounting to v1 space cache for subpage mount Upstream commit 9f73f1aef98b ("btrfs: force v2 space cache usage for subpage mount") forces subpage mount to use v2 cache, to avoid deprecated v1 cache which doesn't support subpage properly. But there is a loophole that user can still remount to v1 cache. The existing check will only give users a warning, but does not really prevent to do the remount. Although remounting to v1 will not cause any problems since the v1 cache will always be marked invalid when mounted with a different page size, it's still better to prevent v1 cache at all for subpage mounts. Fixes: 9f73f1aef98b ("btrfs: force v2 space cache usage for subpage mount") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 31e70e527806c546a72262f2fc3d982ee23c42d3 Author: Filipe Manana Date: Wed May 18 10:41:48 2022 +0100 btrfs: fix hang during unmount when block group reclaim task is running When we start an unmount, at close_ctree(), if we have the reclaim task running and in the middle of a data block group relocation, we can trigger a deadlock when stopping an async reclaim task, producing a trace like the following: [629724.498185] task:kworker/u16:7 state:D stack: 0 pid:681170 ppid: 2 flags:0x00004000 [629724.499760] Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs] [629724.501267] Call Trace: [629724.501759] [629724.502174] __schedule+0x3cb/0xed0 [629724.502842] schedule+0x4e/0xb0 [629724.503447] btrfs_wait_on_delayed_iputs+0x7c/0xc0 [btrfs] [629724.504534] ? prepare_to_wait_exclusive+0xc0/0xc0 [629724.505442] flush_space+0x423/0x630 [btrfs] [629724.506296] ? rcu_read_unlock_trace_special+0x20/0x50 [629724.507259] ? lock_release+0x220/0x4a0 [629724.507932] ? btrfs_get_alloc_profile+0xb3/0x290 [btrfs] [629724.508940] ? do_raw_spin_unlock+0x4b/0xa0 [629724.509688] btrfs_async_reclaim_metadata_space+0x139/0x320 [btrfs] [629724.510922] process_one_work+0x252/0x5a0 [629724.511694] ? process_one_work+0x5a0/0x5a0 [629724.512508] worker_thread+0x52/0x3b0 [629724.513220] ? process_one_work+0x5a0/0x5a0 [629724.514021] kthread+0xf2/0x120 [629724.514627] ? kthread_complete_and_exit+0x20/0x20 [629724.515526] ret_from_fork+0x22/0x30 [629724.516236] [629724.516694] task:umount state:D stack: 0 pid:719055 ppid:695412 flags:0x00004000 [629724.518269] Call Trace: [629724.518746] [629724.519160] __schedule+0x3cb/0xed0 [629724.519835] schedule+0x4e/0xb0 [629724.520467] schedule_timeout+0xed/0x130 [629724.521221] ? lock_release+0x220/0x4a0 [629724.521946] ? lock_acquired+0x19c/0x420 [629724.522662] ? trace_hardirqs_on+0x1b/0xe0 [629724.523411] __wait_for_common+0xaf/0x1f0 [629724.524189] ? usleep_range_state+0xb0/0xb0 [629724.524997] __flush_work+0x26d/0x530 [629724.525698] ? flush_workqueue_prep_pwqs+0x140/0x140 [629724.526580] ? lock_acquire+0x1a0/0x310 [629724.527324] __cancel_work_timer+0x137/0x1c0 [629724.528190] close_ctree+0xfd/0x531 [btrfs] [629724.529000] ? evict_inodes+0x166/0x1c0 [629724.529510] generic_shutdown_super+0x74/0x120 [629724.530103] kill_anon_super+0x14/0x30 [629724.530611] btrfs_kill_super+0x12/0x20 [btrfs] [629724.531246] deactivate_locked_super+0x31/0xa0 [629724.531817] cleanup_mnt+0x147/0x1c0 [629724.532319] task_work_run+0x5c/0xa0 [629724.532984] exit_to_user_mode_prepare+0x1a6/0x1b0 [629724.533598] syscall_exit_to_user_mode+0x16/0x40 [629724.534200] do_syscall_64+0x48/0x90 [629724.534667] entry_SYSCALL_64_after_hwframe+0x44/0xae [629724.535318] RIP: 0033:0x7fa2b90437a7 [629724.535804] RSP: 002b:00007ffe0b7e4458 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [629724.536912] RAX: 0000000000000000 RBX: 00007fa2b9182264 RCX: 00007fa2b90437a7 [629724.538156] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000555d6cf20dd0 [629724.539053] RBP: 0000555d6cf20ba0 R08: 0000000000000000 R09: 00007ffe0b7e3200 [629724.539956] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [629724.540883] R13: 0000555d6cf20dd0 R14: 0000555d6cf20cb0 R15: 0000000000000000 [629724.541796] This happens because: 1) Before entering close_ctree() we have the async block group reclaim task running and relocating a data block group; 2) There's an async metadata (or data) space reclaim task running; 3) We enter close_ctree() and park the cleaner kthread; 4) The async space reclaim task is at flush_space() and runs all the existing delayed iputs; 5) Before the async space reclaim task calls btrfs_wait_on_delayed_iputs(), the block group reclaim task which is doing the data block group relocation, creates a delayed iput at replace_file_extents() (called when COWing leaves that have file extent items pointing to relocated data extents, during the merging phase of relocation roots); 6) The async reclaim space reclaim task blocks at btrfs_wait_on_delayed_iputs(), since we have a new delayed iput; 7) The task at close_ctree() then calls cancel_work_sync() to stop the async space reclaim task, but it blocks since that task is waiting for the delayed iput to be run; 8) The delayed iput is never run because the cleaner kthread is parked, and no one else runs delayed iputs, resulting in a hang. So fix this by stopping the async block group reclaim task before we park the cleaner kthread. Fixes: 18bb8bbf13c183 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit fea981610c25173e6e5d63ccd4fce49739663ab0 Author: Oleksandr Tyshchenko Date: Thu Jun 2 22:23:53 2022 +0300 arm/xen: Assign xen-grant DMA ops for xen-grant DMA devices By assigning xen-grant DMA ops we will restrict memory access for passed device using Xen grant mappings. This is needed for using any virtualized device (e.g. virtio) in Xen guests in a safe manner. Please note, for the virtio devices the XEN_VIRTIO config should be enabled (it forces ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS). Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1654197833-25362-9-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 625ab90ecdf7770bda7ae21c4d5c938aa9b43bb4 Author: Oleksandr Tyshchenko Date: Thu Jun 2 22:23:52 2022 +0300 xen/grant-dma-ops: Retrieve the ID of backend's domain for DT devices Use the presence of "iommus" property pointed to the IOMMU node with recently introduced "xen,grant-dma" compatible as a clear indicator of enabling Xen grant mappings scheme for that device and read the ID of Xen domain where the corresponding backend is running. The domid (domain ID) is used as an argument to the Xen grant mapping APIs. To avoid the deferred probe timeout which takes place after reusing generic IOMMU device tree bindings (because the IOMMU device never becomes available) enable recently introduced stub IOMMU driver by selecting XEN_GRANT_DMA_IOMMU. Also introduce xen_is_grant_dma_device() to check whether xen-grant DMA ops need to be set for a passed device. Remove the hardcoded domid 0 in xen_grant_setup_dma_ops(). Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1654197833-25362-8-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 1ca55d50e50c74747a7b8846dac306fbe5ac4cf5 Author: Oleksandr Tyshchenko Date: Thu Jun 2 22:23:51 2022 +0300 xen/grant-dma-iommu: Introduce stub IOMMU driver In order to reuse generic IOMMU device tree bindings by Xen grant DMA-mapping layer we need to add this stub driver from a fw_devlink perspective (grant-dma-ops cannot be converted into the proper IOMMU driver). Otherwise, just reusing IOMMU bindings (without having a corresponding driver) leads to the deferred probe timeout afterwards, because the IOMMU device never becomes available. This stub driver does nothing except registering empty iommu_ops, the upper layer "of_iommu" will treat this as NO_IOMMU condition and won't return -EPROBE_DEFER. As this driver is quite different from the most hardware IOMMU implementations and only needed in Xen guests, place it in drivers/xen directory. The subsequent commit will make use of it. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1654197833-25362-7-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit add413a1d966d8458571a2571881903d234a9f8e Author: Oleksandr Tyshchenko Date: Thu Jun 2 22:23:50 2022 +0300 dt-bindings: Add xen,grant-dma IOMMU description for xen-grant DMA ops The main purpose of this binding is to communicate Xen specific information using generic IOMMU device tree bindings (which is a good fit here) rather than introducing a custom property. Introduce Xen specific IOMMU for the virtualized device (e.g. virtio) to be used by Xen grant DMA-mapping layer in the subsequent commit. The reference to Xen specific IOMMU node using "iommus" property indicates that Xen grant mappings need to be enabled for the device, and it specifies the ID of the domain where the corresponding backend resides. The domid (domain ID) is used as an argument to the Xen grant mapping APIs. This is needed for the option to restrict memory access using Xen grant mappings to work which primary goal is to enable using virtio devices in Xen guests. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1654197833-25362-6-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit fa1f57421e0b1c57843902c89728f823abc32f02 Author: Juergen Gross Date: Thu Jun 2 22:23:49 2022 +0300 xen/virtio: Enable restricted memory access using Xen grant mappings In order to support virtio in Xen guests add a config option XEN_VIRTIO enabling the user to specify whether in all Xen guests virtio should be able to access memory via Xen grant mappings only on the host side. Also set PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS feature from the guest initialization code on Arm and x86 if CONFIG_XEN_VIRTIO is enabled. Signed-off-by: Juergen Gross Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1654197833-25362-5-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 216d1a8013433bacb2001d492a467e3a58db91bc Author: Luca Ceresoli Date: Fri Jun 3 17:57:23 2022 +0200 dt-bindings: update Luca Ceresoli's e-mail address My Bootlin address is preferred from now on. Signed-off-by: Luca Ceresoli Signed-off-by: Luca Ceresoli Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220603155727.1232061-2-luca@lucaceresoli.net commit cce65bb2c36dd32d7bb413636b89a80d85b94196 Author: Krishna Manikandan Date: Thu Jun 2 16:19:58 2022 +0530 dt-bindings: msm: update maintainers list with proper id Use quic id instead of codeaurora id in maintainers list for display devicetree bindings. Signed-off-by: Krishna Manikandan Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1654166998-14907-1-git-send-email-quic_mkrishn@quicinc.com commit 0a884eadc428b9e7070d86e8b22c278bdb52a422 Author: Krzysztof Kozlowski Date: Wed Jun 1 15:52:22 2022 +0200 dt-bindings: vendor-prefixes: document deprecated Atheros Two old boards use "atheros" prefix instead of already documented "qca". Document it as deprecated to fix warnings like: at91-gatwick.dtb: atheros@0: 'atheros,board-id' does not match any of the regexes Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220601135222.205035-1-krzysztof.kozlowski@linaro.org commit e059da384ffdc93778e69a5f212c2ac7357ec09a Author: Wesley Cheng Date: Thu Jun 2 19:14:32 2022 -0700 dt-bindings: Update QCOM USB subsystem maintainer information Update devicetree binding files with the proper maintainer, and updated contact email. Signed-off-by: Wesley Cheng Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220603021432.13365-1-quic_wcheng@quicinc.com commit 6aa27071e4354c351d98e345fc888b70f335f185 Author: Rob Herring Date: Wed May 25 20:41:41 2022 -0500 spi: dt-bindings: Fix unevaluatedProperties warnings in examples The 'unevaluatedProperties' schema checks is not fully working and doesn't catch some cases where there's a $ref to another schema. A fix is pending, but results in new warnings in examples. 'spi-max-frequency' is supposed to be a per SPI peripheral device property, not a SPI controller property, so drop it. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20220526014141.2872567-1-robh@kernel.org Signed-off-by: Mark Brown commit 2283679f4c468df367830b7eb8f22d48a6940e19 Author: Patrice Chotard Date: Thu Jun 2 11:10:22 2022 +0200 spi: spi-mem: Fix spi_mem_poll_status() In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op() callback can't be used. The same must be applied in spi_mem_poll_status(), poll_status() callback can't be used, we must use the legacy path using read_poll_timeout(). Tested on STM32mp257c-ev1 specific evaluation board on which a spi-nand was mounted instead of a spi-nor. Signed-off-by: Patrice Chotard Tested-by: Patrice Chotard Link: https://lore.kernel.org/r/20220602091022.358127-1-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit 7b40322f7183a92c4303457528ae7cda571c60b9 Author: Lars-Peter Clausen Date: Fri May 27 11:11:43 2022 +0200 spi: cadence: Detect transmit FIFO depth The depth of the transmit FIFO for the Cadence SPI controller is currently hardcoded to 128. But the depth is a synthesis configuration parameter of the core and can vary between different SoCs. If the configured FIFO size is less than 128 the driver will busy loop in the cdns_spi_fill_tx_fifo() function waiting for FIFO space to become available. Depending on the length and speed of the transfer it can spin for a significant amount of time. The cdns_spi_fill_tx_fifo() function is called from the drivers interrupt handler, so it can leave interrupts disabled for a prolonged amount of time. In addition the read FIFO will also overflow and data will be discarded. To avoid this detect the actual size of the FIFO and use that rather than the hardcoded value. To detect the FIFO size the FIFO threshold register is used. The register is sized so that it can hold FIFO size - 1 as its maximum value. Bits that are not needed to hold the threshold value will always read 0. By writing 0xffff to the register and then reading back the value in the register we get the FIFO size. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220527091143.3780378-1-lars@metafoo.de Signed-off-by: Mark Brown commit 21b511ddee09a78909035ec47a6a594349fe3296 Author: Sai Krishna Potthuri Date: Mon Jun 6 11:55:25 2022 +0530 spi: spi-cadence: Fix SPI CS gets toggling sporadically As part of unprepare_transfer_hardware, SPI controller will be disabled which will indirectly deassert the CS line. This will create a problem in some of the devices where message will be transferred with cs_change flag set(CS should not be deasserted). As per SPI controller implementation, if SPI controller is disabled then all output enables are inactive and all pins are set to input mode which means CS will go to default state high(deassert). This leads to an issue when core explicitly ask not to deassert the CS (cs_change = 1). This patch fix the above issue by checking the Slave select status bits from configuration register before disabling the SPI. Signed-off-by: Sai Krishna Potthuri Signed-off-by: Amit Kumar Mahapatra Link: https://lore.kernel.org/r/20220606062525.18447-1-amit.kumar-mahapatra@xilinx.com Signed-off-by: Mark Brown commit 2abdf9f80019e8244d3806ed0e1c9f725e50b452 Author: Mark Brown Date: Fri Jun 3 13:50:03 2022 +0200 ASoC: wm_adsp: Fix event generation for wm_adsp_fw_put() Currently wm_adsp_fw_put() returns 0 rather than 1 when updating the value of the control, meaning that no event is generated to userspace. Fix this by setting the default return value to 1, the code already exits early with a return value of 0 if the value is unchanged. Signed-off-by: Mark Brown Reviewed-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220603115003.3865834-1-broonie@kernel.org Signed-off-by: Mark Brown commit 8259610c2ec01c5cbfb61882ae176aabacac9c19 Author: Mark Brown Date: Fri Jun 3 14:39:37 2022 +0200 ASoC: es8328: Fix event generation for deemphasis control Currently the put() method for the deemphasis control returns 0 when a new value is written to the control even if the value changed, meaning events are not generated. Fix this, skip the work of updating the value when it is unchanged and then return 1 after having done so. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220603123937.4013603-1-broonie@kernel.org Signed-off-by: Mark Brown commit d1f5272c0f7d2e53c6f2480f46725442776f5f78 Author: Adam Ford Date: Thu May 26 13:21:28 2022 -0500 ASoC: wm8962: Fix suspend while playing music If the audio CODEC is playing sound when the system is suspended, it can be left in a state which throws the following error: wm8962 3-001a: ASoC: error at soc_component_read_no_lock on wm8962.3-001a: -16 Once this error has occurred, the audio will not work again until rebooted. Fix this by configuring SET_SYSTEM_SLEEP_PM_OPS. Signed-off-by: Adam Ford Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220526182129.538472-1-aford173@gmail.com Signed-off-by: Mark Brown commit bedc357217e6e09623f6209c891fa8d57a737ac1 Author: Dan Carpenter Date: Thu Jun 2 12:09:35 2022 +0300 ASoC: SOF: ipc-msg-injector: Fix reversed if statement This if statement is reversed. In fact, the condition can just be deleted because writing zero bytes is a no-op. Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Signed-off-by: Dan Carpenter Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/Yph+T3PpGCdPsEDj@kili Signed-off-by: Mark Brown commit d9a251a029f23e79c1ac394bc551ed5d536bc740 Author: Dan Carpenter Date: Thu Jun 2 12:08:25 2022 +0300 ASoC: SOF: ipc-msg-injector: Propagate write errors correctly This code is supposed to propagate errors from simple_write_to_buffer() or return -EFAULT if "size != count". However "size" needs to be signed for the code to work correctly and the case where "size == 0" is not handled correctly. Fixes: 066c67624d8c ("ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages") Fixes: 2f0b1b013bbc ("ASoC: SOF: debug: Add support for IPC message injection") Signed-off-by: Dan Carpenter Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/Yph+Cd+JrfOH0i7z@kili Signed-off-by: Mark Brown commit 9688073ee98cb2894d5434fe91dd256383727089 Author: Shengjiu Wang Date: Tue May 31 11:02:03 2022 +0800 ASoC: fsl_sai: Add support for i.MX8MN The SAI module on i.MX8MN is almost same as i.MX8MP, So reuse same soc data as i.MX8MP. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1653966123-28217-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 2fe08216fda33bbc1f80133b8fd560ffd094b987 Author: Amadeusz Sławiński Date: Thu Jun 2 15:57:57 2022 +0200 ASoC: SOF: Fix potential NULL pointer dereference Cleanup path for sof_prepare_widgets_in_path() should check if unprepare callback exists before calling it, instead it checks if it does not exist. Fix the check. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220602135757.3335351-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit b93a8b2c5161696e732185311d309e0aaf0575be Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 gpio: dln2: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko commit f1138dacb7ff5221c4a37b823e42fc0a34df8731 Author: Andy Shevchenko Date: Wed Jun 1 18:36:56 2022 +0300 gpio: sch: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski commit a80fed9fb643175832e2fb8481d38f5d92cbcd34 Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 gpio: merrifield: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko commit 41a18c4918dcd57a49b0d046d9f2d587878de739 Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 gpio: wcove: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko Reviewed-by: Kuppuswamy Sathyanarayanan commit 68a12c19e1cb0f3332d3f59e1d5447f2aff97cd7 Author: Andy Shevchenko Date: Wed Jun 1 17:22:04 2022 +0300 gpio: crystalcove: Join function declarations and long lines There is no more hard limit of 80 characters for long lines, so join a few of them for better readability. Signed-off-by: Andy Shevchenko commit b34d2ad73af3c58dbaf8aa71b7308f17d9863780 Author: Andy Shevchenko Date: Wed Jun 1 17:18:02 2022 +0300 gpio: crystalcove: Use specific type and API for IRQ number Use specific type and API for IRQ number in the callbacks. Signed-off-by: Andy Shevchenko commit 386cbe7f1b152c8476a7d322d39512b1b4259ed5 Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 gpio: crystalcove: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko commit ba79c5e45eecb9e009eca7f5da224f6e42bd4fcb Author: Andy Shevchenko Date: Mon May 30 14:57:50 2022 +0300 MAINTAINERS: Update Intel pin control to Supported The actual status of the code is Supported. Reported-by: dave.hansen@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 1332661e09304b7b8e84e5edc11811ba08d12abe Author: Miaoqian Lin Date: Thu Jun 2 08:17:21 2022 +0400 memory: samsung: exynos5422-dmc: Fix refcount leak in of_get_dram_timings of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. This function doesn't call of_node_put() in some error paths. To unify the structure, Add put_node label and goto it on errors. Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Signed-off-by: Miaoqian Lin Reviewed-by: Lukasz Luba Link: https://lore.kernel.org/r/20220602041721.64348-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski commit 038ae37c510fd57cbc543ac82db1e7b23b28557a Author: Miaoqian Lin Date: Wed Jun 1 16:01:18 2022 +0400 memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling paths. Fixes: 47404757702e ("memory: mtk-smi: Add device link for smi-sub-common") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220601120118.60225-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski commit 67c7fc6cd915d809be4de2eed323aa5f2205c52f Author: Geert Uytterhoeven Date: Tue May 10 11:29:13 2022 +0200 memory: omap-gpmc: OMAP_GPMC should depend on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 The Texas Instruments OMAP General Purpose Memory Controller (GPMC) is only present on TI OMAP2/3/4/5, Keystone, AM33xx, AM43x, DRA7xx, TI81xx, and K3 SoCs. Hence add a dependency on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3, to prevent asking the user about this driver when configuring a kernel without OMAP2+, Keystone, or K3 SoC family support. Fixes: be34f45f0d4aa91c ("memory: omap-gpmc: Make OMAP_GPMC config visible and selectable") Signed-off-by: Geert Uytterhoeven Acked-by: Roger Quadros Link: https://lore.kernel.org/r/f6780f572f882ed6ab5934321942cf2b412bf8d1.1652174849.git.geert+renesas@glider.be Signed-off-by: Krzysztof Kozlowski commit c4c79525042a4a7df96b73477feaf232fe44ae81 Author: Miaoqian Lin Date: Mon May 23 18:55:13 2022 +0400 ARM: exynos: Fix refcount leak in exynos_map_pmu of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. of_node_put() checks null pointer. Fixes: fce9e5bb2526 ("ARM: EXYNOS: Add support for mapping PMU base address via DT") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523145513.12341-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski commit f84d83d8165570380f55f4ce578bfb131a9266c5 Author: David Virag Date: Thu May 26 07:58:40 2022 +0200 arm64: dts: exynos: Correct UART clocks on Exynos7885 The clocks in the serial UART nodes were swapped by mistake on Exynos7885. This only worked correctly because of a mistake in the clock driver which has been fixed. With the fixed clock driver in place, the baudrate of the UARTs get miscalculated. Fix this by correcting the clocks in the dtsi. Fixes: 06874015327b ("arm64: dts: exynos: Add initial device tree support for Exynos7885 SoC") Signed-off-by: David Virag Link: https://lore.kernel.org/r/20220526055840.45209-3-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit 537e11cdc7a6b3ce94fa25ed41306193df9677b7 Author: Matthew Wilcox (Oracle) Date: Sun Jun 5 15:38:13 2022 +0100 quota: Prevent memory allocation recursion while holding dq_lock As described in commit 02117b8ae9c0 ("f2fs: Set GF_NOFS in read_cache_page_gfp while doing f2fs_quota_read"), we must not enter filesystem reclaim while holding the dq_lock. Prevent this more generally by using memalloc_nofs_save() while holding the lock. Link: https://lore.kernel.org/r/20220605143815.2330891-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara commit 85743a847caeab696dafc4ce1a7e1e2b7e29a0f6 Author: Cameron Berkenpas Date: Sun Jun 5 17:23:30 2022 -0700 ALSA: hda/realtek: Fix for quirk to enable speaker output on the Lenovo Yoga DuetITL 2021 Enables the ALC287_FIXUP_YOGA7_14ITL_SPEAKERS quirk for the Lenovo Yoga DuetITL 2021 laptop to fix speaker output. [ re-sorted in the SSID order by tiwai ] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=208555 Signed-off-by: Cameron Berkenpas Co-authored-by: Songine Cc: stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220606002329.215330-1-cam@neo-zeon.de Signed-off-by: Takashi Iwai commit 10e14073107dd0b6d97d9516a02845a8e501c2c9 Author: Jchao Sun Date: Tue May 24 08:05:40 2022 -0700 writeback: Fix inode->i_io_list not be protected by inode->i_lock error Commit b35250c0816c ("writeback: Protect inode->i_io_list with inode->i_lock") made inode->i_io_list not only protected by wb->list_lock but also inode->i_lock, but inode_io_list_move_locked() was missed. Add lock there and also update comment describing things protected by inode->i_lock. This also fixes a race where __mark_inode_dirty() could move inode under flush worker's hands and thus sync(2) could miss writing some inodes. Fixes: b35250c0816c ("writeback: Protect inode->i_io_list with inode->i_lock") Link: https://lore.kernel.org/r/20220524150540.12552-1-sunjunchao2870@gmail.com CC: stable@vger.kernel.org Signed-off-by: Jchao Sun Signed-off-by: Jan Kara commit 2aab03b86766a27f99a0b24f63e1730faac128d0 Author: Xiang wangx Date: Sun Jun 5 20:55:09 2022 +0800 fs: Fix syntax errors in comments Delete the redundant word 'not'. Link: https://lore.kernel.org/r/20220605125509.14837-1-wangxiang@cdjrlc.com Signed-off-by: Xiang wangx Signed-off-by: Jan Kara commit d6aca3504c7ded5f4f46957e3685b9344d9743dd Author: Juergen Gross Date: Thu Jun 2 22:23:48 2022 +0300 xen/grant-dma-ops: Add option to restrict memory access under Xen Introduce Xen grant DMA-mapping layer which contains special DMA-mapping routines for providing grant references as DMA addresses to be used by frontends (e.g. virtio) in Xen guests. Add the needed functionality by providing a special set of DMA ops handling the needed grant operations for the I/O pages. The subsequent commit will introduce the use case for xen-grant DMA ops layer to enable using virtio devices in Xen guests in a safe manner. Signed-off-by: Juergen Gross Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1654197833-25362-4-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 02a9e681a3f7998074f39ec265080bf934871530 Author: Juergen Gross Date: Thu Jun 2 22:23:47 2022 +0300 xen/grants: support allocating consecutive grants For support of virtio via grant mappings in rare cases larger mappings using consecutive grants are needed. Support those by adding a bitmap of free grants. As consecutive grants will be needed only in very rare cases (e.g. when configuring a virtio device with a multi-page ring), optimize for the normal case of non-consecutive allocations. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1654197833-25362-3-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 9bf22421dc8a69cade3c994771637e9693ff0216 Author: Oleksandr Tyshchenko Date: Thu Jun 2 22:23:46 2022 +0300 arm/xen: Introduce xen_setup_dma_ops() This patch introduces new helper and places it in new header. The helper's purpose is to assign any Xen specific DMA ops in a single place. For now, we deal with xen-swiotlb DMA ops only. The one of the subsequent commits in current series will add xen-grant DMA ops case. Also re-use the xen_swiotlb_detect() check on Arm32. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini [For arm64] Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/1654197833-25362-2-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 3f9dfbebdc48cebfbda738f6f3d1dbf6d7232f90 Author: Juergen Gross Date: Mon Jun 6 08:09:16 2022 +0200 virtio: replace arch_has_restricted_virtio_memory_access() Instead of using arch_has_restricted_virtio_memory_access() together with CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS, replace those with platform_has() and a new platform feature PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Reviewed-by: Christoph Hellwig Acked-by: Borislav Petkov commit 96f0a54e8e65a765b3a4ad4b53751581f23279f3 Author: Larry Finger Date: Mon May 30 20:31:03 2022 -0500 staging: r8188eu: Fix warning of array overflow in ioctl_linux.c Building with -Warray-bounds results in the following warning plus others related to the same problem: CC [M] drivers/staging/r8188eu/os_dep/ioctl_linux.o In function ‘wpa_set_encryption’, inlined from ‘rtw_wx_set_enc_ext’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:1868:9: drivers/staging/r8188eu/os_dep/ioctl_linux.c:412:41: warning: array subscript ‘struct ndis_802_11_wep[0]’ is partly outside array bounds of ‘void[25]’ [-Warray-bounds] 412 | pwep->KeyLength = wep_key_len; | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ In file included from drivers/staging/r8188eu/os_dep/../include/osdep_service.h:19, from drivers/staging/r8188eu/os_dep/ioctl_linux.c:4: In function ‘kmalloc’, inlined from ‘kzalloc’ at ./include/linux/slab.h:733:9, inlined from ‘wpa_set_encryption’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:408:11, inlined from ‘rtw_wx_set_enc_ext’ at drivers/staging/r8188eu/os_dep/ioctl_linux.c:1868:9: ./include/linux/slab.h:605:16: note: object of size [17, 25] allocated by ‘__kmalloc’ 605 | return __kmalloc(size, flags); | ^~~~~~~~~~~~~~~~~~~~~~ ./include/linux/slab.h:600:24: note: object of size [17, 25] allocated by ‘kmem_cache_alloc_trace’ 600 | return kmem_cache_alloc_trace( | ^~~~~~~~~~~~~~~~~~~~~~~ 601 | kmalloc_caches[kmalloc_type(flags)][index], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 602 | flags, size); | ~~~~~~~~~~~~ Although it is unlikely that anyone is still using WEP encryption, the size of the allocation needs to be increased just in case. Fixes commit 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Signed-off-by: Larry Finger Cc: Phillip Potter Cc: Dan Carpenter Link: https://lore.kernel.org/r/20220531013103.2175-3-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman commit 5b7419ae1d208cab1e2826d473d8dab045aa75c7 Author: Phillip Potter Date: Sat May 21 21:47:41 2022 +0100 staging: r8188eu: fix rtw_alloc_hwxmits error detection for now In _rtw_init_xmit_priv, we use the res variable to store the error return from the newly converted rtw_alloc_hwxmits function. Sadly, the calling function interprets res using _SUCCESS and _FAIL still, meaning we change the semantics of the variable, even in the success case. This leads to the following on boot: r8188eu 1-2:1.0: _rtw_init_xmit_priv failed In the long term, we should reverse these semantics, but for now, this fixes the driver. Also, inside rtw_alloc_hwxmits remove the if blocks, as HWXMIT_ENTRY is always 4. Fixes: f94b47c6bde6 ("staging: r8188eu: add check for kzalloc") Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220521204741.921-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 2130a790ca49763f724ec45cf93b9dd765e2023e Author: Juergen Gross Date: Thu Jun 2 15:05:26 2022 +0200 kernel: add platform_has() infrastructure Add a simple infrastructure for setting, resetting and querying platform feature flags. Flags can be either global or architecture specific. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Reviewed-by: Christoph Hellwig Acked-by: Borislav Petkov Signed-off-by: Juergen Gross commit c36ee7dab7749f7be21f7a72392744490b2a9a2b Author: Paulo Alcantara Date: Sun Jun 5 19:54:26 2022 -0300 cifs: fix reconnect on smb3 mount types cifs.ko defines two file system types: cifs & smb3, and __cifs_get_super() was not including smb3 file system type when looking up superblocks, therefore failing to reconnect tcons in cifs_tree_connect(). Fix this by calling iterate_supers_type() on both file system types. Link: https://lore.kernel.org/r/CAFrh3J9soC36+BVuwHB=g9z_KB5Og2+p2_W+BBoBOZveErz14w@mail.gmail.com Cc: stable@vger.kernel.org Tested-by: Satadru Pramanik Reported-by: Satadru Pramanik Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 10d6bdf532902be1d8aa5900b3c03c5671612aa2 Author: Miaoqian Lin Date: Wed Jun 1 12:59:26 2022 +0400 ata: pata_octeon_cf: Fix refcount leak in octeon_cf_probe of_find_device_by_node() takes reference, we should use put_device() to release it when not need anymore. Add missing put_device() to avoid refcount leak. Fixes: 43f01da0f279 ("MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.") Signed-off-by: Miaoqian Lin Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit bf476fe22aa1851bab4728e0c49025a6a0bea307 Author: Sergey Shtylyov Date: Sat May 21 23:34:10 2022 +0300 ata: libata-core: fix NULL pointer deref in ata_host_alloc_pinfo() In an unlikely (and probably wrong?) case that the 'ppi' parameter of ata_host_alloc_pinfo() points to an array starting with a NULL pointer, there's going to be a kernel oops as the 'pi' local variable won't get reassigned from the initial value of NULL. Initialize 'pi' instead to '&ata_dummy_port_info' to fix the possible kernel oops for good... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit a734510fa8b4e61e6a37176f0da01f4c55fa52de Author: Hannes Reinecke Date: Wed May 25 13:49:42 2022 +0200 ata: libata: drop 'sas_last_tag' Unused now. Fixes: 4f1a22ee7b57 ("libata: Improve ATA queued command allocation") Cc: John Garry Signed-off-by: Hannes Reinecke Reviewed-by: John Garry Signed-off-by: Damien Le Moal commit 7ad4bd887d27c6b6ffbef216f19c19f8fe2b8f52 Author: Masahiro Yamada Date: Sat Jun 4 17:50:50 2022 +0900 powerpc/book3e: get rid of #include You cannot include here because it is generated in init/Makefile but there is no guarantee that it happens before arch/powerpc/mm/nohash/kaslr_booke.c is compiled for parallel builds. The places where you can reliably include are: - init/ (because init/Makefile can specify the dependency) - arch/*/boot/ (because it is compiled after vmlinux) Commit f231e4333312 ("hexagon: get rid of #include ") fixed the last breakage at that time, but powerpc re-added this. was unneeded because 'build_str' is almost the same as 'linux_banner' defined in init/version.c Let's copy the solution from MIPS. (get_random_boot() in arch/mips/kernel/relocate.c) Fixes: 6a38ea1d7b94 ("powerpc/fsl_booke/32: randomize the kernel image offset") Signed-off-by: Masahiro Yamada Acked-by: Scott Wood Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220604085050.4078927-1-masahiroy@kernel.org commit f2906aa863381afb0015a9eb7fefad885d4e5a56 Author: Linus Torvalds Date: Sun Jun 5 17:18:54 2022 -0700 Linux 5.19-rc1 commit 6684cf42906ff5f44580e16a1f898e89c19aabd5 Merge: 815b196c70573 40a1926022d12 Author: Linus Torvalds Date: Sun Jun 5 17:14:03 2022 -0700 Merge tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull file descriptor fix from Al Viro: "Fix for breakage in #work.fd this window" * tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix the breakage in close_fd_get_file() calling conventions change commit 815b196c7057356e7ffa9ce97892cb5fd5de17e0 Merge: e17fee8976c3d a19cad0691597 Author: Linus Torvalds Date: Sun Jun 5 17:05:38 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull mm hotfixes from Andrew Morton: "Fixups for various recently-added and longer-term issues and a few minor tweaks: - fixes for material merged during this merge window - cc:stable fixes for more longstanding issues - minor mailmap and MAINTAINERS updates" * tag 'mm-hotfixes-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/oom_kill.c: fix vm_oom_kill_table[] ifdeffery x86/kexec: fix memory leak of elf header buffer mm/memremap: fix missing call to untrack_pfn() in pagemap_range() mm: page_isolation: use compound_nr() correctly in isolate_single_pageblock() mm: hugetlb_vmemmap: fix CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON MAINTAINERS: add maintainer information for z3fold mailmap: update Josh Poimboeuf's email commit e17fee8976c3d2ccf9add6d6c8912a37b025d840 Merge: e1cff7002b716 662ce1dc9caf4 Author: Linus Torvalds Date: Sun Jun 5 16:58:27 2022 -0700 Merge tag 'mm-nonmm-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull delay-accounting update from Andrew Morton: "A single featurette for delay accounting. Delayed a bit because, unusually, it had dependencies on both the mm-stable and mm-nonmm-stable queues" * tag 'mm-nonmm-stable-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: delayacct: track delays from write-protect copy commit e1cff7002b716bd0b5f5f4afd4273c99aa8644be Author: Linus Torvalds Date: Sun Jun 5 11:51:48 2022 -0700 bluetooth: don't use bitmaps for random flag accesses The bluetooth code uses our bitmap infrastructure for the two bits (!) of connection setup flags, and in the process causes odd problems when it converts between a bitmap and just the regular values of said bits. It's completely pointless to do things like bitmap_to_arr32() to convert a bitmap into a u32. It shoudln't have been a bitmap in the first place. The reason to use bitmaps is if you have arbitrary number of bits you want to manage (not two!), or if you rely on the atomicity guarantees of the bitmap setting and clearing. The code could use an "atomic_t" and use "atomic_or/andnot()" to set and clear the bit values, but considering that it then copies the bitmaps around with "bitmap_to_arr32()" and friends, there clearly cannot be a lot of atomicity requirements. So just use a regular integer. In the process, this avoids the warnings about erroneous use of bitmap_from_u64() which were triggered on 32-bit architectures when conversion from a u64 would access two words (and, surprise, surprise, only one word is needed - and indeed overkill - for a 2-bit bitmap). That was always problematic, but the compiler seems to notice it and warn about the invalid pattern only after commit 0a97953fd221 ("lib: add bitmap_{from,to}_arr64") changed the exact implementation details of 'bitmap_from_u64()', as reported by Sudip Mukherjee and Stephen Rothwell. Fixes: fe92ee6425a2 ("Bluetooth: hci_core: Rework hci_conn_params flags") Link: https://lore.kernel.org/all/YpyJ9qTNHJzz0FHY@debian/ Link: https://lore.kernel.org/all/20220606080631.0c3014f2@canb.auug.org.au/ Link: https://lore.kernel.org/all/20220605162537.1604762-1-yury.norov@gmail.com/ Reported-by: Stephen Rothwell Reported-by: Sudip Mukherjee Reviewed-by: Yury Norov Cc: Luiz Augusto von Dentz Cc: Marcel Holtmann Signed-off-by: Linus Torvalds commit 40a1926022d128057376d35167128a7c74e3dca4 Author: Al Viro Date: Sun Jun 5 14:01:42 2022 -0400 fix the breakage in close_fd_get_file() calling conventions change It used to grab an extra reference to struct file rather than just transferring to caller the one it had removed from descriptor table. New variant doesn't, and callers need to be adjusted. Reported-and-tested-by: syzbot+47dd250f527cb7bebf24@syzkaller.appspotmail.com Fixes: 6319194ec57b ("Unify the primitives for file descriptor closing") Signed-off-by: Al Viro commit d717180e7f9775d468f415c10a4a474640146001 Merge: 0b7da15c21c2d 0c9782e204d3c Author: Linus Torvalds Date: Sun Jun 5 11:00:43 2022 -0700 Merge tag 'x86-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX fix from Thomas Gleixner: "A single fix for x86/SGX to prevent that memory which is allocated for an SGX enclave is accounted to the wrong memory control group" * tag 'x86-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Set active memcg prior to shmem allocation commit 0b7da15c21c2d4a37495fafc0350acec18f67d87 Merge: 9784edd73a08e e19d11267f0e6 Author: Linus Torvalds Date: Sun Jun 5 10:57:35 2022 -0700 Merge tag 'x86-mm-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm cleanup from Thomas Gleixner: "Use PAGE_ALIGNED() instead of open coding it in the x86/mm code" * tag 'x86-mm-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE) commit 9784edd73a08ea08d0ce5606e1f0f729df688c59 Merge: a925128092d8d 0c0fe08c76485 Author: Linus Torvalds Date: Sun Jun 5 10:55:23 2022 -0700 Merge tag 'x86-microcode-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode updates from Thomas Gleixner: - Disable late microcode loading by default. Unless the HW people get their act together and provide a required minimum version in the microcode header for making a halfways informed decision its just lottery and broken. - Warn and taint the kernel when microcode is loaded late - Remove the old unused microcode loader interface - Remove a redundant perf callback from the microcode loader * tag 'x86-microcode-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode: Remove unnecessary perf callback x86/microcode: Taint and warn on late loading x86/microcode: Default-disable late loading x86/microcode: Rip out the OLD_INTERFACE commit a925128092d8dd5c2ea8644e1dddd510b7ebc9c7 Merge: 1fd9f4ce8442e f7081834b2d5b Author: Linus Torvalds Date: Sun Jun 5 10:53:41 2022 -0700 Merge tag 'x86-cleanups-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Thomas Gleixner: "A set of small x86 cleanups: - Remove unused headers in the IDT code - Kconfig indendation and comment fixes - Fix all 'the the' typos in one go instead of waiting for bots to fix one at a time" * tag 'x86-cleanups-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Fix all occurences of the "the the" typo x86/idt: Remove unused headers x86/Kconfig: Fix indentation of arch/x86/Kconfig.debug x86/Kconfig: Fix indentation and add endif comments to arch/x86/Kconfig commit 1fd9f4ce8442e34d4f817924d191d2855cdb80c5 Merge: c049ecc523171 8a33d96bd178d Author: Linus Torvalds Date: Sun Jun 5 10:49:42 2022 -0700 Merge tag 'x86-boot-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot update from Thomas Gleixner: "Use strlcpy() instead of strscpy() in arch_setup()" * tag 'x86-boot-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/setup: Use strscpy() to replace deprecated strlcpy() commit c049ecc523171481accd2c83f79ffeecbf53a915 Merge: bc1e02c3e500e 57963a92a70b0 Author: Linus Torvalds Date: Sun Jun 5 10:47:06 2022 -0700 Merge tag 'timers-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull clockevent/clocksource updates from Thomas Gleixner: - Device tree bindings for MT8186 - Tell the kernel that the RISC-V SBI timer stops in deeper power states - Make device tree parsing in sp804 more robust - Dead code removal and tiny fixes here and there - Add the missing SPDX identifiers * tag 'timers-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/oxnas-rps: Fix irq_of_parse_and_map() return value clocksource/drivers/timer-ti-dm: Remove unnecessary NULL check clocksource/drivers/timer-sun5i: Convert to SPDX identifier clocksource/drivers/timer-sun4i: Convert to SPDX identifier clocksource/drivers/pistachio: Convert to SPDX identifier clocksource/drivers/orion: Convert to SPDX identifier clocksource/drivers/lpc32xx: Convert to SPDX identifier clocksource/drivers/digicolor: Convert to SPDX identifier clocksource/drivers/armada-370-xp: Convert to SPDX identifier clocksource/drivers/mips-gic-timer: Convert to SPDX identifier clocksource/drivers/jcore: Convert to SPDX identifier clocksource/drivers/bcm_kona: Convert to SPDX identifier clocksource/drivers/sp804: Avoid error on multiple instances clocksource/drivers/riscv: Events are stopped during CPU suspend clocksource/drivers/ixp4xx: Drop boardfile probe path dt-bindings: timer: Add compatible for Mediatek MT8186 commit bc1e02c3e500e2eec5afd2fd3efc3b7f9637c35c Merge: fa11c28046528 82f586f923e3a Author: Linus Torvalds Date: Sun Jun 5 10:42:40 2022 -0700 Merge tag 'sched-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Thomas Gleixner: "Fix the fallout of sysctl code move which placed the init function wrong" * tag 'sched-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/autogroup: Fix sysctl move commit fa11c2804652809f93f79722e770890b07b3953e Merge: 5cc47d4a920c4 8b4dd2d8627e8 Author: Linus Torvalds Date: Sun Jun 5 10:40:31 2022 -0700 Merge tag 'perf-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Thomas Gleixner: - Make the ICL event constraints match reality - Remove a unused local variable * tag 'perf-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Remove unused local variable perf/x86/intel: Fix event constraints for ICL commit 5cc47d4a920c4766c5e6f4667d8e5194fccfc862 Merge: 44688ffd111af 108ea7eb3e754 Author: Linus Torvalds Date: Sun Jun 5 10:39:20 2022 -0700 Merge tag 'perf-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixlet from Thomas Gleixner: "Trivial indentation fix in Kconfig" * tag 'perf-core-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/Kconfig: Fix indentation in the Kconfig file commit 44688ffd111af31984237f0cba05f2e201eac530 Merge: b2c9a83d262a8 2028a255f4df3 Author: Linus Torvalds Date: Sun Jun 5 09:45:27 2022 -0700 Merge tag 'objtool-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Thomas Gleixner: - Handle __ubsan_handle_builtin_unreachable() correctly and treat it as noreturn - Allow architectures to select uaccess validation - Use the non-instrumented bit test for test_cpu_has() to prevent escape from non-instrumentable regions - Use arch_ prefixed atomics for JUMP_LABEL=n builds to prevent escape from non-instrumentable regions - Mark a few tiny inline as __always_inline to prevent GCC from bringing them out of line and instrumenting them - Mark the empty stub context_tracking_enabled() as always inline as GCC brings them out of line and instruments the empty shell - Annotate ex_handler_msr_mce() as dead end * tag 'objtool-urgent-2022-06-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/extable: Annotate ex_handler_msr_mce() as a dead end context_tracking: Always inline empty stubs x86: Always inline on_thread_stack() and current_top_of_stack() jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds x86/cpu: Elide KCSAN for cpu_has() and friends objtool: Mark __ubsan_handle_builtin_unreachable() as noreturn objtool: Add CONFIG_HAVE_UACCESS_VALIDATION commit b2c9a83d262a8feb022e24e9f9aadb66cb10a7a8 Merge: 2981436374177 aa2a4ded05058 Author: Linus Torvalds Date: Sun Jun 5 09:25:12 2022 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull more SCSI updates from James Bottomley: "Mostly small bug fixes plus other trivial updates. The major change of note is moving ufs out of scsi and a minor update to lpfc vmid handling" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits) scsi: qla2xxx: Remove unused 'ql_dm_tgt_ex_pct' parameter scsi: qla2xxx: Remove setting of 'req' and 'rsp' parameters scsi: mpi3mr: Fix kernel-doc scsi: lpfc: Add support for ATTO Fibre Channel devices scsi: core: Return BLK_STS_TRANSPORT for ALUA transitioning scsi: sd_zbc: Prevent zone information memory leak scsi: sd: Fix potential NULL pointer dereference scsi: mpi3mr: Rework mrioc->bsg_device model to fix warnings scsi: myrb: Fix up null pointer access on myrb_cleanup() scsi: core: Unexport scsi_bus_type scsi: sd: Don't call blk_cleanup_disk() in sd_probe() scsi: ufs: ufshcd: Delete unnecessary NULL check scsi: isci: Fix typo in comment scsi: pmcraid: Fix typo in comment scsi: smartpqi: Fix typo in comment scsi: qedf: Fix typo in comment scsi: esas2r: Fix typo in comment scsi: storvsc: Fix typo in comment scsi: ufs: Split the drivers/scsi/ufs directory scsi: qla1280: Remove redundant variable ... commit 2981436374177f78539b026ce5bcbab8c251818e Merge: 71e80720dbf0f 5dad4eccd2b43 Author: Linus Torvalds Date: Sun Jun 5 09:12:28 2022 -0700 Merge tag 'hte/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux Pull hardware timestamping subsystem from Thierry Reding: "This contains the new HTE (hardware timestamping engine) subsystem that has been in the works for a couple of months now. The infrastructure provided allows for drivers to register as hardware timestamp providers, while consumers will be able to request events that they are interested in (such as GPIOs and IRQs) to be timestamped by the hardware providers. Note that this currently supports only one provider, but there seems to be enough interest in this functionality and we expect to see more drivers added once this is merged" [ Linus Walleij mentions the Intel PMC in the Elkhart and Tiger Lake platforms as another future timestamp provider ] * tag 'hte/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: timestamp: Correct id path dt-bindings: Renamed hte directory to timestamp hte: Uninitialized variable in hte_ts_get() hte: Fix off by one in hte_push_ts_ns() hte: Fix possible use-after-free in tegra_hte_test_remove() hte: Remove unused including MAINTAINERS: Add HTE Subsystem hte: Add Tegra HTE test driver tools: gpio: Add new hardware clock type gpiolib: cdev: Add hardware timestamp clock type gpio: tegra186: Add HTE support gpiolib: Add HTE support dt-bindings: Add HTE bindings hte: Add Tegra194 HTE kernel provider drivers: Add hardware timestamp engine (HTE) subsystem Documentation: Add HTE subsystem guide commit 71e80720dbf0f08c6979e54f21ddaa5735ce742d Merge: 952923ddc0112 42ce60aa5aa46 Author: Linus Torvalds Date: Sun Jun 5 09:06:03 2022 -0700 Merge tag 'kbuild-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - Fix build regressions for parisc, csky, nios2, openrisc - Simplify module builds for CONFIG_LTO_CLANG and CONFIG_X86_KERNEL_IBT - Remove arch/parisc/nm, which was presumably a workaround for old tools - Check the odd combination of EXPORT_SYMBOL and 'static' precisely - Make external module builds robust against "too long argument error" - Support j, k keys for moving the cursor in nconfig * tag 'kbuild-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits) kbuild: Allow to select bash in a modified environment scripts: kconfig: nconf: make nconfig accept jk keybindings modpost: use fnmatch() to simplify match() modpost: simplify mod->name allocation kbuild: factor out the common objtool arguments kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o kbuild: clean .tmp_* pattern by make clean kbuild: remove redundant cleanups in scripts/link-vmlinux.sh kbuild: rebuild multi-object modules when objtool is updated kbuild: add cmd_and_savecmd macro kbuild: make *.mod rule robust against too long argument error kbuild: make built-in.a rule robust against too long argument error kbuild: check static EXPORT_SYMBOL* by script instead of modpost parisc: remove arch/parisc/nm kbuild: do not create *.prelink.o for Clang LTO or IBT kbuild: replace $(linked-object) with CONFIG options kbuild: do not try to parse *.cmd files for objects provided by compiler kbuild: replace $(if A,A,B) with $(or A,B) in scripts/Makefile.modpost modpost: squash if...else-if in find_elf_symbol2() modpost: reuse ARRAY_SIZE() macro for section_mismatch() ... commit 952923ddc01120190dcf671e7b354364ce1d1362 Merge: cbd76edeabd5e 30476f7e6dbcb Author: Linus Torvalds Date: Sat Jun 4 19:07:15 2022 -0700 Merge tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pathname updates from Al Viro: "Several cleanups in fs/namei.c" * tag 'pull-18-rc1-work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: namei: cleanup double word in comment get rid of dead code in legitimize_root() fs/namei.c:reserve_stack(): tidy up the call of try_to_unlazy() commit cbd76edeabd5ed078391abb2323b7aee790cdc04 Merge: dbe0ee4661401 70f8d9c5750bb Author: Linus Torvalds Date: Sat Jun 4 19:00:05 2022 -0700 Merge tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull mount handling updates from Al Viro: "Cleanups (and one fix) around struct mount handling. The fix is usermode_driver.c one - once you've done kern_mount(), you must kern_unmount(); simple mntput() will end up with a leak. Several failure exits in there messed up that way... In practice you won't hit those particular failure exits without fault injection, though" * tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: move mount-related externs from fs.h to mount.h blob_to_mnt(): kern_unmount() is needed to undo kern_mount() m->mnt_root->d_inode->i_sb is a weird way to spell m->mnt_sb... linux/mount.h: trim includes uninline may_mount() and don't opencode it in fspick(2)/fsopen(2) commit dbe0ee46614016146c1b3e1fc063b44333bb2401 Merge: d66016c5cd3d4 6319194ec57b0 Author: Linus Torvalds Date: Sat Jun 4 18:52:00 2022 -0700 Merge tag 'pull-18-rc1-work.fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull file descriptor updates from Al Viro. - Descriptor handling cleanups * tag 'pull-18-rc1-work.fd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: Unify the primitives for file descriptor closing fs: remove fget_many and fput_many interface io_uring_enter(): don't leave f.flags uninitialized commit d66016c5cd3d4c474cd24622c511dcd358645613 Merge: d0e60d46bc032 ee3c8019cce25 Author: Linus Torvalds Date: Sat Jun 4 17:42:33 2022 -0700 Merge tag '5.19-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: "Nine cifs/smb3 client fixes. Includes DFS fixes, some cleanup of leagcy SMB1 code, duplicated message cleanup and a double free and deadlock fix" * tag '5.19-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix uninitialized pointer in error case in dfs_cache_get_tgt_share cifs: skip trailing separators of prefix paths cifs: update internal module number cifs: version operations for smb20 unneeded when legacy support disabled cifs: do not build smb1ops if legacy support is disabled cifs: fix potential deadlock in direct reclaim cifs: when extending a file with falloc we should make files not-sparse cifs: remove repeated debug message on cifs_put_smb_ses() cifs: fix potential double free during failed mount commit 42ce60aa5aa46ae00f71aa806a11510b6db6d1a7 Author: Schspa Shi Date: Fri Jun 3 17:38:52 2022 +0800 kbuild: Allow to select bash in a modified environment This fixes the build error when the system has a default bash version which is too old to support associative array variables. The build error log as fellowing: linux/scripts/check-local-export: line 11: declare: -A: invalid option declare: usage: declare [-afFirtx] [-p] [name[=value] ...] Signed-off-by: Schspa Shi Signed-off-by: Masahiro Yamada commit 2bbb486162c4ace673ea423bbd7e7b40f020ad45 Author: Isak Ellmer Date: Wed Jun 1 15:08:19 2022 +0200 scripts: kconfig: nconf: make nconfig accept jk keybindings Make nconfig accept jk keybindings for movement in addition to arrow keys. Signed-off-by: Isak Ellmer Signed-off-by: Masahiro Yamada commit a89227d769845eb9e9ab113f9f83df34d3c91db5 Author: Masahiro Yamada Date: Mon May 30 18:01:39 2022 +0900 modpost: use fnmatch() to simplify match() Replace the own implementation for wildcard (glob) matching with a function call to fnmatch(). Also, change the return type to 'bool'. Signed-off-by: Masahiro Yamada commit 8c9ce89c5b63028dd3be43807f10b009cd2c6e51 Author: Masahiro Yamada Date: Mon May 30 18:01:38 2022 +0900 modpost: simplify mod->name allocation mod->name is set to the ELF filename with the suffix ".o" stripped. The current code calls strdup() and free() to manipulate the string, but a simpler approach is to pass new_module() with the name length subtracted by 2. Also, check if the passed filename ends with ".o" before stripping it. The current code blindly chops the suffix: tmp[strlen(tmp) - 2] = '\0' It will cause buffer under-run if strlen(tmp) < 2; Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b42d2306502419688190aa6dd4dab4a6def24b3d Author: Masahiro Yamada Date: Sun May 29 00:47:04 2022 +0900 kbuild: factor out the common objtool arguments scripts/Makefile.build and scripts/link-vmlinux.sh have similar setups for the objtool arguments. It was difficult to factor out them because all the vmlinux build rules were written in a shell script. It is somewhat tedious to touch the two files every time a new objtool option is supported. To reduce the code duplication, move the objtool for vmlinux.o into scripts/Makefile.vmlinux_o. Then, move the common macros to Makefile.lib so they are shared between Makefile.build and Makefile.vmlinux_o. Signed-off-by: Masahiro Yamada Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 5d45950dfbb1540bba3e3762a3497de8b4a715d3 Author: Masahiro Yamada Date: Sun May 29 00:47:03 2022 +0900 kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_o This is a preparation for moving the objtool rule in the next commit. Signed-off-by: Masahiro Yamada Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit b0d6207bad2cb5a6f2099ac4a6ea4e76864dd596 Author: Masahiro Yamada Date: Sun May 29 00:47:02 2022 +0900 kbuild: clean .tmp_* pattern by make clean Change the "make clean" rule to remove all the .tmp_* files. .tmp_objdiff is the only exception, which should be removed by "make mrproper". Rename the record directory of objdiff, .tmp_objdiff to .objdiff to avoid the removal by "make clean". Signed-off-by: Masahiro Yamada Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit d0e60d46bc03252b8d4ffaaaa0b371970ac16cda Merge: 23df9ba64bb9e 0dfe54071d7c8 Author: Linus Torvalds Date: Sat Jun 4 14:04:27 2022 -0700 Merge tag 'bitmap-for-5.19-rc1' of https://github.com/norov/linux Pull bitmap updates from Yury Norov: - bitmap: optimize bitmap_weight() usage, from me - lib/bitmap.c make bitmap_print_bitmask_to_buf parseable, from Mauro Carvalho Chehab - include/linux/find: Fix documentation, from Anna-Maria Behnsen - bitmap: fix conversion from/to fix-sized arrays, from me - bitmap: Fix return values to be unsigned, from Kees Cook It has been in linux-next for at least a week with no problems. * tag 'bitmap-for-5.19-rc1' of https://github.com/norov/linux: (31 commits) nodemask: Fix return values to be unsigned bitmap: Fix return values to be unsigned KVM: x86: hyper-v: replace bitmap_weight() with hweight64() KVM: x86: hyper-v: fix type of valid_bank_mask ia64: cleanup remove_siblinginfo() drm/amd/pm: use bitmap_{from,to}_arr32 where appropriate KVM: s390: replace bitmap_copy with bitmap_{from,to}_arr64 where appropriate lib/bitmap: add test for bitmap_{from,to}_arr64 lib: add bitmap_{from,to}_arr64 lib/bitmap: extend comment for bitmap_(from,to)_arr32() include/linux/find: Fix documentation lib/bitmap.c make bitmap_print_bitmask_to_buf parseable MAINTAINERS: add cpumask and nodemask files to BITMAP_API arch/x86: replace nodes_weight with nodes_empty where appropriate mm/vmstat: replace cpumask_weight with cpumask_empty where appropriate clocksource: replace cpumask_weight with cpumask_empty in clocksource.c genirq/affinity: replace cpumask_weight with cpumask_empty where appropriate irq: mips: replace cpumask_weight with cpumask_empty where appropriate drm/i915/pmu: replace cpumask_weight with cpumask_empty where appropriate arch/x86: replace cpumask_weight with cpumask_empty where appropriate ... commit 23df9ba64bb9e26cfee6b34f5c3ece49a8a61ee1 Merge: 4ccbe91de91a8 b046f984814af Author: Linus Torvalds Date: Sat Jun 4 13:50:23 2022 -0700 Merge tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull more parisc architecture updates from Helge Deller: "A fix to prevent crash at bootup if CONFIG_SCHED_MC is enabled, and add auto-detection of primary graphics card for framebuffer driver" * tag 'for-5.19/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc/stifb: Keep track of hardware path of graphics card parisc/stifb: Implement fb_is_primary_device() parisc: fix a crash with multicore scheduler commit 4ccbe91de91a8f9559052179d15c0229a8ac9f8a Merge: 45b2e5ad6837d 41925b105e345 Author: Linus Torvalds Date: Sat Jun 4 13:42:53 2022 -0700 Merge tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull more xen updates from Juergen Gross: "Two cleanup patches for Xen related code and (more important) an update of MAINTAINERS for Xen, as Boris Ostrovsky decided to step down" * tag 'for-linus-5.19-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: replace xen_remap() with memremap() MAINTAINERS: Update Xen maintainership xen: switch gnttab_end_foreign_access() to take a struct page pointer commit 45b2e5ad6837dfe4de6b9028c575bd57c132774c Merge: 032dcf09e2bf7 1bcca2b1bd67f Author: Linus Torvalds Date: Sat Jun 4 13:33:12 2022 -0700 Merge tag 'perf-tools-for-v5.19-2022-06-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Synthesize task events for pre-existing threads when using 'perf lock --threads', as we need to show task names. - Fix unwinding with ld.lld (>= version 10.0) linked objects, where .eh_frame_hdr and .text are in different PT_LOAD program headers, which makes perf record --call-graph dwarf fail with such obkects. - Check if 'perf record' hangs in the ARM SPE (Statistical Profiling Extensions) 'perf test' entry when recording a workload with forks. - Trace physical address for Arm SPE events, needed for 'perf c2c' to locate the memory node for samples. - Fix sorting in percent_rmt_hitm_cmp() in 'perf c2c'. - Further support for Intel hybrid systems in the evlist and 'perf record' code. - Update IBM s/390 vendor event JSON tables. - Add metrics (JSON) for Intel Sapphirerapids. - Update metrics for Intel Alderlake. - Correct typo of sysf 'event_source' directory in the documentation. * tag 'perf-tools-for-v5.19-2022-06-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf vendor events intel: Update metrics for Alderlake perf vendor events intel: Add metrics for Sapphirerapids perf c2c: Fix sorting in percent_rmt_hitm_cmp() perf mem: Trace physical address for Arm SPE events perf list: Update event description for IBM zEC12/zBC12 to latest level perf list: Update event description for IBM z196/z114 to latest level perf list: Update event description for IBM z15 to latest level perf list: Update event description for IBM z14 to latest level perf list: Update event description for IBM z13 to latest level perf list: Update event description for IBM z10 to latest level perf list: Add IBM z16 event description for s390 perf record: Support sample-read topdown metric group for hybrid platforms perf lock: Change to synthesize task events perf unwind: Fix segbase for ld.lld linked objects perf test arm-spe: Check if perf-record hangs when recording workload with forks perf docs: Correct typo of event_sources perf evlist: Extend arch_evsel__must_be_in_group to support hybrid systems commit ee3c8019cce254f586b7fc2c5b836c275b275527 Author: Steve French Date: Sat Jun 4 01:18:37 2022 -0500 cifs: fix uninitialized pointer in error case in dfs_cache_get_tgt_share Set default value of ppath to null. Reported-by: kernel test robot Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit b046f984814af7985f444150ec28716d42d00d9a Author: Helge Deller Date: Thu Jun 2 13:55:26 2022 +0200 parisc/stifb: Keep track of hardware path of graphics card Keep the pa_path (hardware path) of the graphics card in sti_struct and use this info to give more useful info which card is currently being used. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.10+ commit cf936af790a3ef5f41ff687ec91bfbffee141278 Author: Helge Deller Date: Thu Jun 2 13:50:44 2022 +0200 parisc/stifb: Implement fb_is_primary_device() Implement fb_is_primary_device() function, so that fbcon detects if this framebuffer belongs to the default graphics card which was used to start the system. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.10+ commit 032dcf09e2bf7c822be25b4abef7a6c913870d98 Merge: 77d4d3609cd2d 7bb8a0cf49d5f Author: Linus Torvalds Date: Fri Jun 3 20:01:25 2022 -0700 Merge tag 'gpio-fixes-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - use the correct register for regcache sync in gpio-pca953x - remove unused and potentially harmful code from gpio-adp5588 - MAINTAINERS update * tag 'gpio-fixes-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: adp5588: Remove support for platform setup and teardown callbacks gpio: pca953x: use the correct register address to do regcache sync MAINTAINERS: Update Intel GPIO (PMIC and PCH) to Supported MAINTAINERS: Update GPIO ACPI library to Supported commit 77d4d3609cd2dd613b6f4c3162616a944d3aeb0b Merge: 1f952675835bf 28cbc2d4c54c0 Author: Linus Torvalds Date: Fri Jun 3 19:57:25 2022 -0700 Merge tag 'regulator-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "One fix that came in during the merge window, fixing an error in the examples in the DT binding documentation for mt6315" * tag 'regulator-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: mt6315-regulator: fix invalid allowed mode commit 1f952675835bfe18d6ae494a5581724d68c52352 Merge: 67850b7bdcd28 724bbe49c5e42 Author: Linus Torvalds Date: Fri Jun 3 16:57:16 2022 -0700 Merge tag 'ntfs3_for_5.19' of https://github.com/Paragon-Software-Group/linux-ntfs3 Pull ntfs3 updates from Konstantin Komarov: - fix some memory leaks and panic - fixed xfstests (tested on x86_64): generic/092 generic/099 generic/228 generic/240 generic/307 generic/444 - fix some typos, dead code, etc * tag 'ntfs3_for_5.19' of https://github.com/Paragon-Software-Group/linux-ntfs3: fs/ntfs3: provide block_invalidate_folio to fix memory leak fs/ntfs3: Fix invalid free in log_replay fs/ntfs3: Update valid size if -EIOCBQUEUED fs/ntfs3: Check new size for limits fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space) fs/ntfs3: In function ntfs_set_acl_ex do not change inode->i_mode if called from function ntfs_init_acl fs/ntfs3: Optimize locking in ntfs_save_wsl_perm fs/ntfs3: Update i_ctime when xattr is added fs/ntfs3: Restore ntfs_xattr_get_acl and ntfs_xattr_set_acl functions fs/ntfs3: Keep preallocated only if option prealloc enabled fs/ntfs3: Fix some memory leaks in an error handling path of 'log_replay()' commit 67850b7bdcd2803e10d019f0da5673a92139b43a Merge: 1ec6574a3c0a2 31cae1eaae4fd Author: Linus Torvalds Date: Fri Jun 3 16:13:25 2022 -0700 Merge tag 'ptrace_stop-cleanup-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ptrace_stop cleanups from Eric Biederman: "While looking at the ptrace problems with PREEMPT_RT and the problems Peter Zijlstra was encountering with ptrace in his freezer rewrite I identified some cleanups to ptrace_stop that make sense on their own and move make resolving the other problems much simpler. The biggest issue is the habit of the ptrace code to change task->__state from the tracer to suppress TASK_WAKEKILL from waking up the tracee. No other code in the kernel does that and it is straight forward to update signal_wake_up and friends to make that unnecessary. Peter's task freezer sets frozen tasks to a new state TASK_FROZEN and then it stores them by calling "wake_up_state(t, TASK_FROZEN)" relying on the fact that all stopped states except the special stop states can tolerate spurious wake up and recover their state. The state of stopped and traced tasked is changed to be stored in task->jobctl as well as in task->__state. This makes it possible for the freezer to recover tasks in these special states, as well as serving as a general cleanup. With a little more work in that direction I believe TASK_STOPPED can learn to tolerate spurious wake ups and become an ordinary stop state. The TASK_TRACED state has to remain a special state as the registers for a process are only reliably available when the process is stopped in the scheduler. Fundamentally ptrace needs acess to the saved register values of a task. There are bunch of semi-random ptrace related cleanups that were found while looking at these issues. One cleanup that deserves to be called out is from commit 57b6de08b5f6 ("ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs"). This makes a change that is technically user space visible, in the handling of what happens to a tracee when a tracer dies unexpectedly. According to our testing and our understanding of userspace nothing cares that spurious SIGTRAPs can be generated in that case" * tag 'ptrace_stop-cleanup-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state ptrace: Always take siglock in ptrace_resume ptrace: Don't change __state ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs ptrace: Document that wait_task_inactive can't fail ptrace: Reimplement PTRACE_KILL by always sending SIGKILL signal: Use lockdep_assert_held instead of assert_spin_locked ptrace: Remove arch_ptrace_attach ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP signal: Replace __group_send_sig_info with send_signal_locked signal: Rename send_signal send_signal_locked commit 1ec6574a3c0a22c130c08e8c36c825cb87d68f8e Merge: 1888e9b4bb78c b3f9916d81e8f Author: Linus Torvalds Date: Fri Jun 3 16:03:05 2022 -0700 Merge tag 'kthread-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull kthread updates from Eric Biederman: "This updates init and user mode helper tasks to be ordinary user mode tasks. Commit 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads") caused init and the user mode helper threads that call kernel_execve to have struct kthread allocated for them. This struct kthread going away during execve in turned made a use after free of struct kthread possible. Here, commit 343f4c49f243 ("kthread: Don't allocate kthread_struct for init and umh") is enough to fix the use after free and is simple enough to be backportable. The rest of the changes pass struct kernel_clone_args to clean things up and cause the code to make sense. In making init and the user mode helpers tasks purely user mode tasks I ran into two complications. The function task_tick_numa was detecting tasks without an mm by testing for the presence of PF_KTHREAD. The initramfs code in populate_initrd_image was using flush_delayed_fput to ensuere the closing of all it's file descriptors was complete, and flush_delayed_fput does not work in a userspace thread. I have looked and looked and more complications and in my code review I have not found any, and neither has anyone else with the code sitting in linux-next" * tag 'kthread-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: sched: Update task_tick_numa to ignore tasks without an mm fork: Stop allowing kthreads to call execve fork: Explicitly set PF_KTHREAD init: Deal with the init process being a user mode process fork: Generalize PF_IO_WORKER handling fork: Explicity test for idle tasks in copy_thread fork: Pass struct kernel_clone_args into copy_thread kthread: Don't allocate kthread_struct for init and umh commit 1888e9b4bb78c88514b24ecafa9e4e4faf761747 Merge: 07953c54a1056 38cd5b12b7854 Author: Linus Torvalds Date: Fri Jun 3 15:54:57 2022 -0700 Merge tag 'per-namespace-ipc-sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ipc sysctl namespace updates from Eric Biederman: "This updates the ipc sysctls so that they are fundamentally per ipc namespace. Previously these sysctls depended upon a hack to simulate being per ipc namespace by looking up the ipc namespace in read or write. With this set of changes the ipc sysctls are registered per ipc namespace and open looks up the ipc namespace. Not only does this series of changes ensure the traditional binding at open time happens, but it sets a foundation for being able to relax the permission checks to allow a user namspace root to change the ipc sysctls for an ipc namespace that the user namespace root requires. To do this requires the ipc namespace to be known at open time" * tag 'per-namespace-ipc-sysctls-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ipc: Remove extra braces ipc: Check permissions for checkpoint_restart sysctls at open time ipc: Remove extra1 field abuse to pass ipc namespace ipc: Use the same namespace to modify and validate ipc: Store ipc sysctls in the ipc namespace ipc: Store mqueue sysctls in the ipc namespace commit 07953c54a10567e484cefd8f8c782025dc68b3b1 Author: Linus Torvalds Date: Fri Jun 3 15:46:03 2022 -0700 firmware_loader: enable XZ by default if compressed support is enabled Commit 23cfbc6ec44e ("firmware: Add the support for ZSTD-compressed firmware files") added support for ZSTD compression, but in the process also made the previously default XZ compression a config option. That means that anybody who upgrades their kernel and does a make oldconfig to update their configuration, will end up without the XZ compression that the configuration used to have. Add the 'default y' to make sure this doesn't happen. The whole compression question should probably be improved upon, since it is now possible to "enable" compression in the kernel config but not enable any actual compression algorithm, which makes it all very useless. It makes no sense to ask Kconfig questions that enable situations that are nonsensical like that. This at least fixes the immediate problem of a kernel update resulting in a nonbootable machine because of a missed option. Fixes: 23cfbc6ec44e ("firmware: Add the support for ZSTD-compressed firmware files") Cc: Takashi Iwai Cc: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit 744983d8784214c4f184be7448efb216315b48ae Merge: 4e583ff9df912 8c03a1c21d722 Author: Linus Torvalds Date: Fri Jun 3 14:42:24 2022 -0700 Merge tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull JFFS2, UBI and UBIFS updates from Richard Weinberger: "JFFS2: - Fixes for a memory leak UBI: - Fixes for fastmap (UAF, high CPU usage) UBIFS: - Minor cleanups" * tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubi: ubi_create_volume: Fix use-after-free when volume creation failed ubi: fastmap: Check wl_pool for free peb before wear leveling ubi: fastmap: Fix high cpu usage of ubi_bgt by making sure wl_pool not empty ubifs: Use NULL instead of using plain integer as pointer ubifs: Simplify the return expression of run_gc() jffs2: fix memory leak in jffs2_do_fill_super jffs2: Use kzalloc instead of kmalloc/memset commit 4e583ff9df9126e275c32c6ecff54b0316fe1dee Merge: a01fe7ec42b7f 2a4a62a14be19 Author: Linus Torvalds Date: Fri Jun 3 14:35:14 2022 -0700 Merge tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - Various cleanups and fixes: xterm, serial line, time travel - Set ARCH_HAS_GCOV_PROFILE_ALL * tag 'for-linus-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: Fix out-of-bounds read in LDT setup um: chan_user: Fix winch_tramp() return value um: virtio_uml: Fix broken device handling in time-travel um: line: Use separate IRQs per line um: Enable ARCH_HAS_GCOV_PROFILE_ALL um: Use asm-generic/dma-mapping.h um: daemon: Make default socket configurable um: xterm: Make default terminal emulator configurable commit a01fe7ec42b7fcd4201084dc56a2372f7b101f99 Merge: 9af13088ab139 987cf300e76d3 Author: Linus Torvalds Date: Fri Jun 3 14:24:44 2022 -0700 Merge tag 'devicetree-fixes-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fixes for unevaluatedProperties warnings. These were missed to due to a bug in dtschema which is now fixed. The changes involve either adding missing properties or removing spurious properties from examples. - Update several Qualcomm binding maintainer email addresses - Fix typo in imx8mp-media-blk-ctrl example - Fix fixed string pattern in qcom,smd - Correct the order of 'reg' entries in Xilinx PCI binding * tag 'devicetree-fixes-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: mtd: spi-nand: Add spi-peripheral-props.yaml reference dt-bindings: memory-controllers: ingenic: Split out child node properties dt-bindings: net/dsa: Add spi-peripheral-props.yaml references dt-bindings: PCI: apple: Add missing 'power-domains' property dt-bindings: Update Sibi Sankar's email address dt-bindings: clock: Update my email address dt-bindings: PCI: xilinx-cpm: Fix reg property order dt-bindings: net: Fix unevaluatedProperties warnings in examples dt-bindings: PCI: socionext,uniphier-pcie: Add missing child interrupt controller dt-bindings: usb: snps,dwc3: Add missing 'dma-coherent' property dt-bindings: soc: imx8mp-media-blk-ctrl: Fix DT example dt-bindings: soc: qcom,smd: do not use pattern for simple rpm-requests string commit 9af13088ab139ff1663e44e5746e152303cffbc7 Merge: c6f2f3e2c80e9 7036440eab3e2 Author: Linus Torvalds Date: Fri Jun 3 14:20:28 2022 -0700 Merge tag 'arm-multiplatform-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull yet more ARM multiplatform updates from Arnd Bergmann: "This is the third and final bit of the multiplatform conversion for ARMv5, finishing off OMAP1. One patch enables the common-clk interface, and the other ones does the Kconfig change. These were waiting on a few dependencies to trickle in for common-clk, and the last one of those was in the USB tree" * tag 'arm-multiplatform-5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: omap1: enable multiplatform ARM: OMAP1: clock: Convert to CCF commit c6f2f3e2c80e975804360665d973211e4d9390cb Merge: 21873bd66b6e6 8be4493119b0a Author: Linus Torvalds Date: Fri Jun 3 14:09:21 2022 -0700 Merge tag 'loongarch-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull initial Loongarch architecture code from Arnd Bergmann: "This is the majority of the loongarch architecture code, including the final system call interface and all core functionality. It still misses three sets of peripheral but vital patches to add support for other subsystems, which have yet to pass review: - The drivers/firmware/efi stub for booting from a standard UEFI firmware implementation. Both the original custom boot interface and a draft implementation of the EFI stub did not make it, so it is currently impossible to boot the kernel, until the loongarch specific portions get accepted into the UEFI subsystem - The drivers/irqchip/irq-loongson-*.c drivers are shared with the the MIPS port, but currently lack support for ACPI based booting, which will get merged through the irqchip subsystem. - Similarly, the drivers/pci/controller/pci-loongson.c needs to be modified for ACPI support, which will be merged through the PCI subsystem. While the port cannot actually be used before all the above are merged, having it in 5.19 helps to establish the user space ABI for the libc ports to build on, and to help any treewide changes in the mainline kernel get applied here as well. A gcc-12 based tool chains for build testing is now included in https://mirrors.edge.kernel.org/pub/tools/crosstool/" Original description from Huacai Chen: "LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V. LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S) and a 64-bit version (LA64). LoongArch use ACPI as its boot protocol LoongArch-specific interrupt controllers (similar to APIC) are already added in the next revision of ACPI Specification (current revision is 6.4). This patchset is adding basic LoongArch support in mainline kernel, we can see a complete snapshot here: https://github.com/loongson/linux/tree/loongarch-next https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next Cross-compile tool chain to build kernel: https://github.com/loongson/build-tools/releases/download/2021.12.21/loongarch64-clfs-2022-03-03-cross-tools-gcc-glibc.tar.xz A CLFS-based Linux distro: https://github.com/loongson/build-tools/releases/download/2021.12.21/loongarch64-clfs-system-2022-03-03.tar.bz2 Open-source tool chain which is under review (Binutils and Gcc are already upstream): https://github.com/loongson/binutils-gdb/tree/upstream_v3.1 https://github.com/loongson/gcc/tree/loongarch_upstream_v6.3 https://github.com/loongson/glibc/tree/loongarch_2_35_dev_v2.2 Loongson and LoongArch documentations: https://github.com/loongson/LoongArch-Documentation LoongArch-specific interrupt controllers: https://mantis.uefi.org/mantis/view.php?id=2203 https://mantis.uefi.org/mantis/view.php?id=2313" Link: https://lore.kernel.org/lkml/20220603072053.35005-1-chenhuacai@loongson.cn/ * tag 'loongarch-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: (24 commits) MAINTAINERS: Add maintainer information for LoongArch LoongArch: Add Loongson-3 default config file LoongArch: Add Non-Uniform Memory Access (NUMA) support LoongArch: Add multi-processor (SMP) support LoongArch: Add VDSO and VSYSCALL support LoongArch: Add some library functions LoongArch: Add misc common routines LoongArch: Add ELF and module support LoongArch: Add signal handling support LoongArch: Add system call support LoongArch: Add memory management LoongArch: Add process management LoongArch: Add exception/interrupt handling LoongArch: Add boot and setup routines LoongArch: Add other common headers LoongArch: Add atomic/locking headers LoongArch: Add CPU definition headers LoongArch: Add build infrastructure LoongArch: Add writecombine support for drm LoongArch: Add ELF-related definitions ... commit 21873bd66b6e6040d95d0a33525ea6933bdc6c71 Merge: f66e797b407bc 78c09c0f4df89 Author: Linus Torvalds Date: Fri Jun 3 14:05:34 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "Most of issues addressed were introduced during this merging window. - Initialise jump labels before setup_machine_fdt(), needed by commit f5bda35fba61 ("random: use static branch for crng_ready()"). - Sparse warnings: missing prototype, incorrect __user annotation. - Skip SVE kselftest if not sufficient vector lengths supported" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: kselftest/arm64: signal: Skip SVE signal test if not enough VLs supported arm64: Initialize jump labels before setup_machine_fdt() arm64: hibernate: Fix syntax errors in comments arm64: Remove the __user annotation for the restore_za_context() argument ftrace/fgraph: fix increased missing-prototypes warnings commit f66e797b407bc03a438d1f05057dc7918bab473f Merge: 4ab6cfc4ad9f8 61114e734ccb8 Author: Linus Torvalds Date: Fri Jun 3 14:01:43 2022 -0700 Merge tag 'riscv-for-linus-5.19-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: "This is mostly some DT updates, but also a handful of cleanups and some fixes. The most user-visible of those are: - A device tree for the Sundance Polarberry, along with a handful of fixes and clenups to the PolarFire SOC device trees and bindings. - The memfd_secret syscall number is now visible to userspace, - Some improvements to the vm layout dump, which really should have followed shortly after the sv48 patches but I missed" * tag 'riscv-for-linus-5.19-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Move alternative length validation into subsection riscv: mm: init: make pt_ops_set_[early|late|fixmap] static riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild RISC-V: Mark IORESOURCE_EXCLUSIVE for reserved mem instead of IORESOURCE_BUSY riscv: Wire up memfd_secret in UAPI header riscv: Fix irq_work when SMP is disabled riscv: Improve virtual kernel memory layout dump riscv: Initialize thread pointer before calling C functions Documentation: riscv: Add sv48 description to VM layout RISC-V: Only default to spinwait on SBI-0.1 and M-mode riscv: dts: icicle: sort nodes alphabetically riscv: microchip: icicle: readability fixes riscv: dts: microchip: add the sundance polarberry dt-bindings: riscv: microchip: add polarberry compatible string dt-bindings: vendor-prefixes: add Sundance DSP riscv: dts: microchip: make the fabric dtsi board specific dt-bindings: riscv: microchip: document icicle reference design riscv: dts: microchip: remove soc vendor from filenames riscv: dts: microchip: move sysctrlr out of soc bus riscv: dts: microchip: remove icicle memory clocks commit 4ab6cfc4ad9f867a107b0ef029088dd4c0a8f83c Merge: 93ce7948e38ff e0ffcf3fe18e0 Author: Linus Torvalds Date: Fri Jun 3 13:57:50 2022 -0700 Merge tag 's390-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Heiko Carstens: "Just a couple of small improvements, bug fixes and cleanups: - Add Eric Farman as maintainer for s390 virtio drivers. - Improve machine check handling, and avoid incorrectly injecting a machine check into a kvm guest. - Add cond_resched() call to gmap page table walker in order to avoid possible huge latencies. Also use non-quiesing sske instruction to speed up storage key handling. - Add __GFP_NORETRY to KEXEC_CONTROL_MEMORY_GFP so s390 behaves similar like common code. - Get sie control block address from correct stack slot in perf event code. This fixes potential random memory accesses. - Change uaccess code so that the exception handler sets the result of get_user() and __get_kernel_nofault() to zero in case of a fault. Until now this was done via input parameters for inline assemblies. Doing it via fault handling is what most or even all other architectures are doing. - Couple of other small cleanups and fixes" * tag 's390-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/stack: add union to reflect kvm stack slot usages s390/stack: merge empty stack frame slots s390/uaccess: whitespace cleanup s390/uaccess: use __noreturn instead of __attribute__((noreturn)) s390/uaccess: use exception handler to zero result on get_user() failure s390/uaccess: use symbolic names for inline assembler operands s390/mcck: isolate SIE instruction when setting CIF_MCCK_GUEST flag s390/mm: use non-quiescing sske for KVM switch to keyed guest s390/gmap: voluntarily schedule during key setting MAINTAINERS: Update s390 virtio-ccw s390/kexec: add __GFP_NORETRY to KEXEC_CONTROL_MEMORY_GFP s390/Kconfig.debug: fix indentation s390/Kconfig: fix indentation s390/perf: obtain sie_block from the right address s390: generate register offsets into pt_regs automatically s390: simplify early program check handler s390/crypto: fix scatterwalk_unmap() callers in AES-GCM commit 12d6c18cfa708e954a7de27dd76cf45054c8855a Author: Evan Quan Date: Mon May 30 14:58:08 2022 +0800 drm/amdgpu: suppress the compile warning about 64 bit type Suppress the compile warning below: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type? Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Evan Quan Reviewed-by: Guchun Chen Acked-by: Christian König Signed-off-by: Alex Deucher commit 4513edf74cc82c15bc1cefc2ab62ff25fe67028e Author: Evan Quan Date: Mon May 30 11:37:07 2022 +0800 drm/amd/pm: suppress compile warnings about possible unaligned accesses Suppress the following compile warnings: >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h:163:17: warning: field smc_pptable within 'struct smu_11_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h ^ 1 warning generated. -- >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_7_pptable.h:193:17: warning: field smc_pptable within 'struct smu_11_0_7_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_7_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h ^ 1 warning generated. -- >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0_pptable.h:161:12: warning: field smc_pptable within 'struct smu_13_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_13_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] Signed-off-by: Evan Quan Reported-by: kernel test robot Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 88467db6e2f46a2e79b1b67ce6873c284e4cf417 Author: Philip Yang Date: Fri Jun 3 09:19:34 2022 -0400 drm/amdkfd: Fix partial migration bugs Migration range from system memory to VRAM, if system page can not be locked or unmapped, we do partial migration and leave some pages in system memory. Several bugs found to copy pages and update GPU mapping for this situation: 1. copy to vram should use migrate->npage which is total pages of range as npages, not migrate->cpages which is number of pages can be migrated. 2. After partial copy, set VRAM res cursor as j + 1, j is number of system pages copied plus 1 page to skip copy. 3. copy to ram, should collect all continuous VRAM pages and copy together. 4. Call amdgpu_vm_update_range, should pass in offset as bytes, not as number of pages. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 93ce7948e38ffe6f9b4fd403c94c098bd892a5ff Merge: 9be4cbd09da82 75ed63d919400 Author: Linus Torvalds Date: Fri Jun 3 13:39:30 2022 -0700 Merge tag 'efi-next-for-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull more EFI updates from Ard Biesheuvel: "Follow-up tweaks for EFI changes - they mostly address issues introduced this merge window, except for Heinrich's patch: - fix new DXE service invocations for mixed mode - use correct Kconfig symbol when setting PE header flag - clean up the drivers/firmware/efi Kconfig dependencies so that features that depend on CONFIG_EFI are hidden from the UI when the symbol is not enabled. Also included is a RISC-V bugfix from Heinrich to avoid read-write mappings of read-only firmware regions in the EFI page tables" * tag 'efi-next-for-v5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: clean up Kconfig dependencies on CONFIG_EFI efi/x86: libstub: Make DXE calls mixed mode safe efi: x86: Fix config name for setting the NX-compatibility flag in the PE header riscv: read-only pages should not be writable commit 4fac4fcf4500bce515b0f32195e7bb86aa0246c6 Author: Lang Yu Date: Tue May 31 09:19:43 2022 +0800 drm/amdkfd: add pinned BOs to kfd_bo_list The kfd_bo_list is used to restore process BOs after evictions. As page tables could be destroyed during evictions, we should also update pinned BOs' page tables during restoring to make sure they are valid. So for pinned BOs, 1, Validate them and update their page tables. 2, Don't add eviction fence for them. v2: - Don't handle pinned ones specially in BO validation.(Felix) Signed-off-by: Lang Yu Acked-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4d1e5f12b7a0d2ade73003d2522a23b4559c7e02 Author: Philip Yang Date: Wed Jun 1 19:02:45 2022 -0400 drm/amdgpu: Update PDEs flush TLB if PTB/PDB moved Flush TLBs when existing PDEs are updated because a PTB or PDB moved, but avoids unnecessary TLB flushes when new PDBs or PTBs are added to the page table, which commonly happens when memory is mapped for the first time. Suggested-by: Christian König Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 371017309a9f1725bfd3283afe61efa4ac34d30c Author: Sunil Khatri Date: Mon May 30 23:24:09 2022 +0530 drm/amdgpu: enable tmz by default for GC 10.3.7 Add IP GC 10.3.7 in the list of target to have tmz enabled by default. Signed-off-by: Sunil Khatri Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit 7c4f4f197e0c5c93a70329627f17fcc5883f3593 Author: Mario Limonciello Date: Tue May 31 18:56:41 2022 -0500 drm/amdkfd: Add GC 10.3.6 and 10.3.7 KFD definitions Loading amdgpu on GC 10.3.7 shows an ERR level message: `kfd kfd: amdgpu: GC IP 0a0307 not supported in kfd` Add these targets to match yellow carp structures. Reported-by: David Chang Reviewed-by: Felix Kuehling Tested-by: Jesse(Jie) Zhang Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.18.x commit 1bcca2b1bd67f3c0e5c3a88ed16c6389f01a5b31 Author: Zhengjun Xing Date: Sat May 28 17:59:33 2022 +0800 perf vendor events intel: Update metrics for Alderlake Update JSON metrics for Alderlake to perf. It included both P-core and E-core metrics. P-core metrics based on TMA 4.4 (TMA_Metrics-full.csv) E-core metrics based on E-core TMA 2.0 (E-core_TMA_Metrics.csv) https://download.01.org/perfmon/ Signed-off-by: Zhengjun Xing Tested-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220528095933.1784141-2-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 122657820fe041e0917c04d53bbbc81aede53a5a Author: Zhengjun Xing Date: Sat May 28 17:59:32 2022 +0800 perf vendor events intel: Add metrics for Sapphirerapids Add JSON metrics for Sapphirerapids to perf. Based on TMA4.4 metrics. https://download.01.org/perfmon/TMA_Metrics-full.csv Signed-off-by: Zhengjun Xing Tested-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220528095933.1784141-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b24192a17337abbf3f44aaa75e15df14a2d0016e Author: Leo Yan Date: Mon May 30 16:42:53 2022 +0800 perf c2c: Fix sorting in percent_rmt_hitm_cmp() The function percent_rmt_hitm_cmp() wrongly uses local HITMs for sorting remote HITMs. Since this function is to sort cache lines for remote HITMs, this patch changes to use 'rmt_hitm' field for correct sorting. Fixes: 9cb3500afc0980c5 ("perf c2c report: Add hitm/store percent related sort keys") Signed-off-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joe Mario Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220530084253.750190-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 62e6eb8d5454401bc38b6eba35bab738b63a478b Author: Leo Yan Date: Mon May 30 16:36:45 2022 +0800 perf mem: Trace physical address for Arm SPE events Currently, Arm SPE events don't trace physical address, therefore, the field 'phys_addr' is always zero in synthesized memory samples. This leads to perf c2c tool cannot locate the memory node for samples. This patch enables configuration 'pa_enable' for Arm SPE events, so the physical address packet can be traced, finally this can allow perf c2c tool to locate properly for memory node. Signed-off-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mike Leach Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220530083645.253432-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 882f54243a45ed9cc539b6bfc2ea9df331c6c6b2 Author: Thomas Richter Date: Tue May 31 11:27:06 2022 +0200 perf list: Update event description for IBM zEC12/zBC12 to latest level Update IBM zEC12/zBC12 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-7-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit dfeab63acd977f8f86064f88d82860c2d79a0f6e Author: Thomas Richter Date: Tue May 31 11:27:05 2022 +0200 perf list: Update event description for IBM z196/z114 to latest level Update IBM z196/z114 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-6-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit d1833463dd132b3ff83dfab76c0249fcf46d1656 Author: Thomas Richter Date: Tue May 31 11:27:04 2022 +0200 perf list: Update event description for IBM z15 to latest level Update IBM z15 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-5-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit d786bdf2a70545a868cd0b06b5603cd5a5fec011 Author: Thomas Richter Date: Tue May 31 11:27:03 2022 +0200 perf list: Update event description for IBM z14 to latest level Update IBM z14 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-4-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit e9c26fd6401d9af297faaffd40f1c9fd75739df2 Author: Thomas Richter Date: Tue May 31 11:27:02 2022 +0200 perf list: Update event description for IBM z13 to latest level Update IBM z13 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-3-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit f71a261acd1d854391a3a972e9c2429e4f74ca01 Author: Thomas Richter Date: Tue May 31 11:27:01 2022 +0200 perf list: Update event description for IBM z10 to latest level Update IBM z10 event counter description to the latest level as described in the documents 1. SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities." released on May, 2022 for the following counter sets: * Basic counter set * Problem counter set * Crypto counter set 2. SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 for the following counter sets: * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-2-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit 7f76b31130680fb322b3c28563e50f1679140526 Author: Thomas Richter Date: Tue May 31 11:27:00 2022 +0200 perf list: Add IBM z16 event description for s390 Update IBM z16 counter description using document SA23-2260-07: "The Load-Program-Parameter and the CPU-Measurement Facilities" released in May, 2022, to include counter definitions for IBM z16 counter sets: * Basic counter set * Problem/user counter set * Crypto counter set Use document SA23-2261-07: "The CPU-Measurement Facility Extended Counters Definition for z10, z196/z114, zEC12/zBC12, z13/z13s, z14, z15 and z16" released on April 29, 2022 to include counter definitions for IBM z16 * Extended counter set * MT-Diagnostic counter set Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220531092706.1931503-1-tmricht@linux.ibm.com Cc: acme@kernel.org Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: svens@linux.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit 151e7d75036b4e2ac0f33730bc1a5b3ff424d9a7 Author: Zhengjun Xing Date: Thu Jun 2 23:36:03 2022 +0800 perf record: Support sample-read topdown metric group for hybrid platforms With the hardware TopDown metrics feature, the sample-read feature should be supported for a TopDown group, e.g., sample a non-topdown event and read a Topdown metric group. But the current perf record code errors are out. For a TopDown metric group,the slots event must be the leader of the group, but the leader slots event doesn't support sampling. To support sample-read the TopDown metric group, uses the 2nd event of the group as the "leader" for the purposes of sampling. Only the platform with the TopDown metric feature supports sample-read the topdown group. In commit acb65150a47c ("perf record: Support sample-read topdown metric group"), it adds arch_topdown_sample_read() to indicate whether the TopDown group supports sample-read, it should only work on the non-hybrid systems, this patch extends the support for hybrid platforms. Before: # ./perf record -e "{cpu_core/slots/,cpu_core/cycles/,cpu_core/topdown-retiring/}:S" -a sleep 1 Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cpu_core/topdown-retiring/). /bin/dmesg | grep -i perf may provide additional information. After: # ./perf record -e "{cpu_core/slots/,cpu_core/cycles/,cpu_core/topdown-retiring/}:S" -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.238 MB perf.data (369 samples) ] Fixes: acb65150a47c2bae ("perf record: Support sample-read topdown metric group") Reviewed-by: Kan Liang Signed-off-by: Zhengjun Xing Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220602153603.1884710-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2762c488cdc129aaddeb9a3b81aafd9023f1649d Author: Namhyung Kim Date: Tue May 31 23:58:42 2022 -0700 perf lock: Change to synthesize task events With -t/--threads option, it needs to display task names so synthesize task related events at the beginning. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Boqun Feng Cc: Davidlohr Bueso Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Fixes: 7c3bcbdf449f ("perf lock: Add -t/--thread option for report") Link: http://lore.kernel.org/lkml/20220601065846.456965-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dc2cf4ca866f571590b65f5e4de06b8c9a302808 Author: Fangrui Song Date: Fri May 27 11:20:39 2022 -0700 perf unwind: Fix segbase for ld.lld linked objects segbase is the address of .eh_frame_hdr and table_data is segbase plus the header size. find_proc_info computes segbase as `map->start + segbase - map->pgoff` which is wrong when * .eh_frame_hdr and .text are in different PT_LOAD program headers * and their p_vaddr difference does not equal their p_offset difference Since 10.0, ld.lld's default --rosegment -z noseparate-code layout has such R and RX PT_LOAD program headers. ld.lld (default) => perf report fails to unwind `perf record --call-graph dwarf` recorded data ld.lld --no-rosegment => ok (trivial, no R PT_LOAD) ld.lld -z separate-code => ok but by luck: there are two PT_LOAD but their p_vaddr difference equals p_offset difference ld.bfd -z noseparate-code => ok (trivial, no R PT_LOAD) ld.bfd -z separate-code (default for Linux/x86) => ok but by luck: there are two PT_LOAD but their p_vaddr difference equals p_offset difference To fix the issue, compute segbase as dso's base address plus PT_GNU_EH_FRAME's p_vaddr. The base address is computed by iterating over all dso-associated maps and then subtract the first PT_LOAD p_vaddr (the minimum guaranteed by generic ABI) from the minimum address. In libunwind, find_proc_info transitively called by unw_step is cached, so the iteration overhead is acceptable. Reported-by: Sebastian Ullrich Reviewed-by: Ian Rogers Signed-off-by: Fangrui Song Cc: Ingo Molnar Cc: Peter Zijlstra Cc: llvm@lists.linux.dev Link: https://github.com/ClangBuiltLinux/linux/issues/1646 Link: https://lore.kernel.org/r/20220527182039.673248-1-maskray@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4f52ca135861e92a271262eefc0f040513d266d4 Author: German Gomez Date: Mon Feb 28 16:56:54 2022 +0000 perf test arm-spe: Check if perf-record hangs when recording workload with forks Add shell test to check if perf-record hangs when recording an arm_spe event with forks. The test FAILS if the Kernel is not patched with Commit 961c391217 ("perf: Always wake the parent event"). Unpatched Kernel: $ perf test -v 90 90: Check Arm SPE doesn't hang when there are forks --- start --- test child forked, pid 14232 Recording workload with fork Log lines = 90 /tmp/__perf_test.stderr.0Nu0U Log lines after 1 second = 90 /tmp/__perf_test.stderr.0Nu0U SPE hang test: FAIL test child finished with -1 ---- end ---- Check Arm SPE trace data in workload with forks: FAILED! Patched Kernel: $ perf test -v 90 90: Check Arm SPE doesn't hang when there are forks --- start --- test child forked, pid 2930 Compiling test program... Recording workload... Log lines = 478 /tmp/__perf_test.log.026AI Log lines after 1 second = 557 /tmp/__perf_test.log.026AI SPE hang test: PASS Cleaning up files... test child finished with 0 ---- end ---- Check Arm SPE trace data in workload with forks: Ok Reviewed-by: James Clark Reviewed-by: Leo Yan Signed-off-by: German Gomez Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220228165655.3920-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ef605e86821253d16d47a02ce1f766a461614fef Author: Paulo Alcantara Date: Fri Jun 3 16:13:02 2022 -0300 cifs: skip trailing separators of prefix paths During DFS failover, prefix paths may change, so make sure to not leave trailing separators when parsing thew in dfs_cache_get_tgt_share(). The separators of prefix paths are already handled by build_path_from_dentry_optional_prefix(). Consider the following DFS link: //dom/dfs/link: [\srv1\share\dir1, \srv2\share\dir1] Before commit: mount.cifs //dom/dfs/link tree connect to \\srv1\share; prefix_path=dir1 disconnect srv1; failover to srv2 tree connect to \\srv2\share; prefix_path=dir1\ mv foo bar ... SMB2 430 Create Request File: dir1\\foo;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request SMB2 582 Create Response File: dir1\\foo;GetInfo Response;Close Response SMB2 430 Create Request File: dir1\\bar;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request SMB2 286 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;GetInfo Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;Close Response, Error: STATUS_OBJECT_NAME_NOT_FOUND SMB2 462 Create Request File: dir1\\foo;SetInfo Request FILE_INFO/SMB2_FILE_RENAME_INFO NewName:dir1\\bar;Close Request SMB2 478 Create Response File: dir1\\foo;SetInfo Response, Error: STATUS_OBJECT_NAME_INVALID;Close Response After commit: mount.cifs //dom/dfs/link tree connect to \\srv1\share; prefix_path=dir1 disconnect srv1; failover to srv2 tree connect to \\srv2\share; prefix_path=dir1 mv foo bar ... SMB2 430 Create Request File: dir1\foo;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request SMB2 582 Create Response File: dir1\foo;GetInfo Response;Close Response SMB2 430 Create Request File: dir1\bar;GetInfo Request FILE_INFO/SMB2_FILE_ALL_INFO;Close Request SMB2 286 Create Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;GetInfo Response, Error: STATUS_OBJECT_NAME_NOT_FOUND;Close Response, Error: STATUS_OBJECT_NAME_NOT_FOUND SMB2 462 Create Request File: dir1\foo;SetInfo Request FILE_INFO/SMB2_FILE_RENAME_INFO NewName:dir1\bar;Close Request SMB2 478 Create Response File: dir1\foo;SetInfo Response;Close Response Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 8db43088ef16007f5e5b285d8c78c225a88083d6 Author: Ian Rogers Date: Thu Jun 2 21:57:44 2022 -0700 perf docs: Correct typo of event_sources The sysfs directory is called event_source. Before: $ ls -la /sys/bus/event_sources/devices/cpu/format/ ls: cannot access '/sys/bus/event_sources/devices/cpu/format/': No such file or directory $ After: $ ls -la /sys/bus/event_source/devices/cpu/format/ total 0 drwxr-xr-x. 2 root root 0 Jun 2 15:36 . drwxr-xr-x. 6 root root 0 Jun 2 15:35 .. -r--r--r--. 1 root root 4096 Jun 2 15:36 any -r--r--r--. 1 root root 4096 Jun 2 15:36 cmask -r--r--r--. 1 root root 4096 Jun 2 15:36 edge -r--r--r--. 1 root root 4096 Jun 2 15:36 event -r--r--r--. 1 root root 4096 Jun 2 15:36 frontend -r--r--r--. 1 root root 4096 Jun 2 15:36 inv -r--r--r--. 1 root root 4096 Jun 2 15:36 ldlat -r--r--r--. 1 root root 4096 Jun 2 15:36 offcore_rsp -r--r--r--. 1 root root 4096 Jun 2 15:36 pc -r--r--r--. 1 root root 4096 Jun 2 15:36 umask $ Reviewed-by: Sandipan Das Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Alyssa Ross Cc: German Gomez Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Joshua Martinez Cc: Kan Liang Cc: Like Xu Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20220603045744.2815559-1-irogers@google.com Reported-by: Kevin Nomura Signed-off-by: Arnaldo Carvalho de Melo commit e69a5c010246ca6a87c4e6f13d0a291954bdece8 Author: Zhengjun Xing Date: Wed Jun 1 23:25:44 2022 +0800 perf evlist: Extend arch_evsel__must_be_in_group to support hybrid systems For the hybrid system, the "slots" event changes to "cpu_core/slots/", need extend API arch_evsel__must_be_in_group() to support hybrid systems. In the origin code, for hybrid system event "cpu_core/slots/", the output of the API arch_evsel__must_be_in_group() is "false" (in fact,it should be "true"). Currently only one API evsel__remove_from_group() calls it. In evsel__remove_from_group(), it adds the second condition to check, so the output of evsel__remove_from_group() still is correct. That's the reason why there isn't an instant error. I'd like to fix the issue found in API arch_evsel__must_be_in_group() in case someone else using the function in the other place. Fixes: d98079c05b5a ("perf evlist: Keep topdown counters in weak group") Signed-off-by: Zhengjun Xing Reviewed-by: Kan Liang Acked-by: Ian Rogers Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220601152544.1842447-1-zhengjun.xing@linux.intel.com Cc: peterz@infradead.org Cc: adrian.hunter@intel.com Cc: alexander.shishkin@intel.com Cc: acme@kernel.org Cc: ak@linux.intel.com Cc: jolsa@redhat.com Cc: mingo@redhat.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit 9be4cbd09da820a20d400670a45fc1571f6a13b8 Author: Saravana Kannan Date: Fri Jun 3 13:31:38 2022 +0200 driver core: Set default deferred_probe_timeout back to 0. Since we had to effectively reverted commit 35a672363ab3 ("driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires") in an earlier patch, a non-zero deferred_probe_timeout will break NFS rootfs mounting [1] again. So, set the default back to zero until we can fix that. [1] - https://lore.kernel.org/lkml/TYAPR01MB45443DF63B9EF29054F7C41FD8C60@TYAPR01MB4544.jpnprd01.prod.outlook.com/ Fixes: 2b28a1a84a0e ("driver core: Extend deferred probe timeout on driver registration") Cc: Mark Brown Cc: Rob Herring Reported-by: Nathan Chancellor Reported-by: Sebastian Andrzej Siewior Tested-by: Geert Uytterhoeven Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20220526034609.480766-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit 5ee76c256e928455212ab759c51d198fedbe7523 Author: Saravana Kannan Date: Fri Jun 3 13:31:37 2022 +0200 driver core: Fix wait_for_device_probe() & deferred_probe_timeout interaction Mounting NFS rootfs was timing out when deferred_probe_timeout was non-zero [1]. This was because ip_auto_config() initcall times out waiting for the network interfaces to show up when deferred_probe_timeout was non-zero. While ip_auto_config() calls wait_for_device_probe() to make sure any currently running deferred probe work or asynchronous probe finishes, that wasn't sufficient to account for devices being deferred until deferred_probe_timeout. Commit 35a672363ab3 ("driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires") tried to fix that by making sure wait_for_device_probe() waits for deferred_probe_timeout to expire before returning. However, if wait_for_device_probe() is called from the kernel_init() context: - Before deferred_probe_initcall() [2], it causes the boot process to hang due to a deadlock. - After deferred_probe_initcall() [3], it blocks kernel_init() from continuing till deferred_probe_timeout expires and beats the point of deferred_probe_timeout that's trying to wait for userspace to load modules. Neither of this is good. So revert the changes to wait_for_device_probe(). [1] - https://lore.kernel.org/lkml/TYAPR01MB45443DF63B9EF29054F7C41FD8C60@TYAPR01MB4544.jpnprd01.prod.outlook.com/ [2] - https://lore.kernel.org/lkml/YowHNo4sBjr9ijZr@dev-arch.thelio-3990X/ [3] - https://lore.kernel.org/lkml/Yo3WvGnNk3LvLb7R@linutronix.de/ Fixes: 35a672363ab3 ("driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires") Cc: John Stultz Cc: "David S. Miller" Cc: Alexey Kuznetsov Cc: Hideaki YOSHIFUJI Cc: Jakub Kicinski Cc: Rob Herring Cc: Geert Uytterhoeven Cc: Yoshihiro Shimoda Cc: Robin Murphy Cc: Andy Shevchenko Cc: Sudeep Holla Cc: Andy Shevchenko Cc: Naresh Kamboju Cc: Basil Eljuse Cc: Ferry Toth Cc: Arnd Bergmann Cc: Anders Roxell Cc: linux-pm@vger.kernel.org Reported-by: Nathan Chancellor Reported-by: Sebastian Andrzej Siewior Tested-by: Geert Uytterhoeven Acked-by: John Stultz Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20220526034609.480766-2-saravanak@google.com Signed-off-by: Greg Kroah-Hartman Reviewed-by: Rafael J. Wysocki Signed-off-by: Linus Torvalds commit 7036440eab3e2d47a775d4616909f8235488d714 Author: Arnd Bergmann Date: Mon May 30 14:46:17 2022 +0200 ARM: omap1: enable multiplatform With all the header files out of the way, and the clock driver converted to the common framework, nothing stops us from building OMAP together with the other platforms. As usual, the decompressor support is a victim here, and is only available when CONFIG_DEBUG_LL is configured for the particular board. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit c73b9099da4fb5703abaa804a0377850eea66cb5 Author: Janusz Krzysztofik Date: Sun Apr 10 15:07:57 2022 +0200 ARM: OMAP1: clock: Convert to CCF OMAP1 still uses its own implementation of standard clock API defined in include/linux/clk.h. Internals of that implementation are not visible outside OMAP1 directory. As a consequence, device drivers are not able to register clocks potentially provided by peripheral devices. Drop OMAP1 implementation of the clock API and enable common clock framework. Modify the remaining low level code to be compatible with clock provider API and register the clocks with CCF. Move initialisation of clocks to omap1_timer_init() to avoid memory allocation issues at early setup phase from where omap1_init_early() is called. Register the clocks after initialization of clock I/O registers, local clock pointers used by OMAP1 clock ops, and local .rate fields of clocks with no local implementation of .recalc ops, so CCF structures are populated with correct data during clock registration. Instead of enabling some of the registered clocks, flag them for CCF as critical. Introduce .is_enabled op using code that verifies hardware status of clock enablement, split out from implementation of .disable_unused op, so the latter is actually called by CCF for not requested but hardware enabled clocks. Add .round_rate ops where missing so .set_rate ops are called by CCF as expected. Since CCF allows parallel execution of .enable/.disable and .set_rate ops, protect registers shared among those groups of ops from concurrent access with spinlocks. Drop local debugfs support in favor of that provided by CCF. v2: flag tc2_ck as CLK_IS_CRITICAL (Aaro) v3: rebase on top of soc/omap1-multiplatform-5.18, - drop no longer needed includes from arch/arm/mach-omap1/io.c Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 500a434fc593f1fdb274c0e6fe09a0b9c0711a4b Merge: 6f9b5ed8caddf b232b02bf3c20 Author: Linus Torvalds Date: Fri Jun 3 11:48:47 2022 -0700 Merge tag 'driver-core-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of driver core changes for 5.19-rc1. Lots of tiny driver core changes and cleanups happened this cycle, but the two major things are: - firmware_loader reorganization and additions including the ability to have XZ compressed firmware images and the ability for userspace to initiate the firmware load when it needs to, instead of being always initiated by the kernel. FPGA devices specifically want this ability to have their firmware changed over the lifetime of the system boot, and this allows them to work without having to come up with yet-another-custom-uapi interface for loading firmware for them. - physical location support added to sysfs so that devices that know this information, can tell userspace where they are located in a common way. Some ACPI devices already support this today, and more bus types should support this in the future. Smaller changes include: - driver_override api cleanups and fixes - error path cleanups and fixes - get_abi script fixes - deferred probe timeout changes. It's that last change that I'm the most worried about. It has been reported to cause boot problems for a number of systems, and I have a tested patch series that resolves this issue. But I didn't get it merged into my tree before 5.18-final came out, so it has not gotten any linux-next testing. I'll send the fixup patches (there are 2) as a follow-on series to this pull request. All have been tested in linux-next for weeks, with no reported issues other than the above-mentioned boot time-outs" * tag 'driver-core-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (55 commits) driver core: fix deadlock in __device_attach kernfs: Separate kernfs_pr_cont_buf and rename_lock. topology: Remove unused cpu_cluster_mask() driver core: Extend deferred probe timeout on driver registration MAINTAINERS: add Russ Weight as a firmware loader maintainer driver: base: fix UAF when driver_attach failed test_firmware: fix end of loop test in upload_read_show() driver core: location: Add "back" as a possible output for panel driver core: location: Free struct acpi_pld_info *pld driver core: Add "*" wildcard support to driver_async_probe cmdline param driver core: location: Check for allocations failure arch_topology: Trace the update thermal pressure kernfs: Rename kernfs_put_open_node to kernfs_unlink_open_file. export: fix string handling of namespace in EXPORT_SYMBOL_NS rpmsg: use local 'dev' variable rpmsg: Fix calling device_lock() on non-initialized device firmware_loader: describe 'module' parameter of firmware_upload_register() firmware_loader: Move definitions from sysfs_upload.h to sysfs.h firmware_loader: Fix configs for sysfs split selftests: firmware: Add firmware upload selftests ... commit 6f9b5ed8caddfbc94af8307c557ed57a8ec5c65c Merge: 54c2cc79194c9 90de6805267f8 Author: Linus Torvalds Date: Fri Jun 3 11:36:34 2022 -0700 Merge tag 'char-misc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc / other smaller driver subsystem updates from Greg KH: "Here is the large set of char, misc, and other driver subsystem updates for 5.19-rc1. The merge request for this has been delayed as I wanted to get lots of linux-next testing due to some late arrivals of changes for the habannalabs driver. Highlights of this merge are: - habanalabs driver updates for new hardware types and fixes and other updates - IIO driver tree merge which includes loads of new IIO drivers and cleanups and additions - PHY driver tree merge with new drivers and small updates to existing ones - interconnect driver tree merge with fixes and updates - soundwire driver tree merge with some small fixes - coresight driver tree merge with small fixes and updates - mhi bus driver tree merge with lots of updates and new device support - firmware driver updates - fpga driver updates - lkdtm driver updates (with a merge conflict, more on that below) - extcon driver tree merge with small updates - lots of other tiny driver updates and fixes and cleanups, full details in the shortlog. All of these have been in linux-next for almost 2 weeks with no reported problems" * tag 'char-misc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (387 commits) habanalabs: use separate structure info for each error collect data habanalabs: fix missing handle shift during mmap habanalabs: remove hdev from hl_ctx_get args habanalabs: do MMU prefetch as deferred work habanalabs: order memory manager messages habanalabs: return -EFAULT on copy_to_user error habanalabs: use NULL for eventfd habanalabs: update firmware header habanalabs: add support for notification via eventfd habanalabs: add topic to memory manager buffer habanalabs: handle race in driver fini habanalabs: add device memory scrub ability through debugfs habanalabs: use unified memory manager for CB flow habanalabs: unified memory manager new code for CB flow habanalabs/gaudi: set arbitration timeout to a high value habanalabs: add put by handle method to memory manager habanalabs: hide memory manager page shift habanalabs: Add separate poll interval value for protocol habanalabs: use get_task_pid() to take PID habanalabs: add prefetch flag to the MAP operation ... commit 54c2cc79194c961a213c1d375fe3aa4165664cc4 Merge: 932c2989b5900 97fa5887cf283 Author: Linus Torvalds Date: Fri Jun 3 11:17:49 2022 -0700 Merge tag 'usb-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / Thunderbolt updates from Greg KH: "Here is the "big" set of USB and Thunderbolt driver changes for 5.18-rc1. For the most part it's been a quiet development cycle for the USB core, but there are the usual "hot spots" of development activity. Included in here are: - Thunderbolt driver updates: - fixes for devices without displayport adapters - lane bonding support and improvements - other minor changes based on device testing - dwc3 gadget driver changes. It seems this driver will never be finished given that the IP core is showing up in zillions of new devices and each implementation decides to do something different with it... - uvc gadget driver updates as more devices start to use and rely on this hardware as well - usb_maxpacket() api changes to remove an unneeded and unused parameter. - usb-serial driver device id updates and small cleanups - typec cleanups and fixes based on device testing - device tree updates for usb properties - lots of other small fixes and driver updates. All of these have been in linux-next for weeks with no reported problems" * tag 'usb-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (154 commits) USB: new quirk for Dell Gen 2 devices usb: dwc3: core: Add error log when core soft reset failed usb: dwc3: gadget: Move null pinter check to proper place usb: hub: Simplify error and success path in port_over_current_notify usb: cdns3: allocate TX FIFO size according to composite EP number usb: dwc3: Fix ep0 handling when getting reset while doing control transfer usb: Probe EHCI, OHCI controllers asynchronously usb: isp1760: Fix out-of-bounds array access xhci: Don't defer primary roothub registration if there is only one roothub USB: serial: option: add Quectel BG95 modem USB: serial: pl2303: fix type detection for odd device xhci: Allow host runtime PM as default for Intel Alder Lake N xHCI xhci: Remove quirk for over 10 year old evaluation hardware xhci: prevent U2 link power state if Intel tier policy prevented U1 xhci: use generic command timer for stop endpoint commands. usb: host: xhci-plat: omit shared hcd if either root hub has no ports usb: host: xhci-plat: prepare operation w/o shared hcd usb: host: xhci-plat: create shared hcd after having added main hcd xhci: prepare for operation w/o shared hcd xhci: factor out parts of xhci_gen_setup() ... commit 932c2989b59008e530ffcc7c7e6ef507a28b28ca Merge: 4ad680f083ec3 25e02ba60f0fb Author: Linus Torvalds Date: Fri Jun 3 11:08:40 2022 -0700 Merge tag 'tty-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial driver updates from Greg KH: "Here is the big set of tty and serial driver updates for 5.19-rc1. Lots of tiny cleanups in here, the major stuff is: - termbit cleanups and unification by Ilpo. A much needed change that goes a long way to making things simpler for all of the different arches - tty documentation cleanups and movements to their own place in the documentation tree - old tty driver cleanups and fixes from Jiri to bring some existing drivers into the modern world - RS485 cleanups and unifications to make it easier for individual drivers to support this mode instead of having to duplicate logic in each driver - Lots of 8250 driver updates and additions - new device id additions - n_gsm continued fixes and cleanups - other minor serial driver updates and cleanups All of these have been in linux-next for weeks with no reported issues" * tag 'tty-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (166 commits) tty: Rework receive flow control char logic pcmcia: synclink_cs: Don't allow CS5-6 serial: stm32-usart: Correct CSIZE, bits, and parity serial: st-asc: Sanitize CSIZE and correct PARENB for CS7 serial: sifive: Sanitize CSIZE and c_iflag serial: sh-sci: Don't allow CS5-6 serial: txx9: Don't allow CS5-6 serial: rda-uart: Don't allow CS5-6 serial: digicolor-usart: Don't allow CS5-6 serial: uartlite: Fix BRKINT clearing serial: cpm_uart: Fix build error without CONFIG_SERIAL_CPM_CONSOLE serial: core: Do stop_rx in suspend path for console if console_suspend is disabled tty: serial: qcom-geni-serial: Remove uart frequency table. Instead, find suitable frequency with call to clk_round_rate. dt-bindings: serial: renesas,em-uart: Add RZ/V2M clock to access the registers serial: 8250_fintek: Check SER_RS485_RTS_* only with RS485 Revert "serial: 8250_mtk: Make sure to select the right FEATURE_SEL" serial: msm_serial: disable interrupts in __msm_console_write() serial: meson: acquire port->lock in startup() serial: 8250_dw: Use dev_err_probe() serial: 8250_dw: Use devm_add_action_or_reset() ... commit 4ad680f083ec360e0991c453e18a38ed9ae500d7 Merge: 04d93b2b8bc7a 6a31a95135da0 Author: Linus Torvalds Date: Fri Jun 3 10:44:43 2022 -0700 Merge tag 'staging-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 5.19-rc1. Lots of forward progress happened this development cycle, one driver (wfx wireless driver) got merged into the real portion of the kernel, and another one (unisys) was removed as no one is around anymore to take care of it and no one has the hardware. Combined with loads of tiny driver cleanups overall we removed 13k lines of code from the tree, a nice improvement. Other than the wfx and unisys driver changes the major points of this merge is: - r8188eu driver cleanups. So many cleanups. It's amazing just how many things have been cleaned up here, and yet, how many remain to go. Lots of work happened here, and it doesn't look to slow down any time soon. - other wifi driver cleanups. Not as many as the r8188eu driver, but still pretty impressive from a janitorial point of view. - bcm2853 driver cleanups - other very minor driver cleanups All of these have been in the linux-next tree for weeks with no reported issues" * tag 'staging-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (363 commits) staging: r8188eu: remove include/rtw_debug.h staging: r8188eu: prevent ->Ssid overflow in rtw_wx_set_scan() staging: r8188eu: delete rtw_wx_read/write32() staging: r8188eu: Remove multiple assignments staging: r8188eu: add check for kzalloc staging: r8188eu: fix warnings in rtw_wlan_util staging: r8188eu: fix warnings in rtw_pwrctrl staging: r8188eu: fix warnings in rtw_p2p staging: rtl8712: fix uninit-value in r871xu_drv_init() staging: rtl8712: fix uninit-value in usb_read8() and friends staging: rtl8712: add error handler in r8712_usbctrl_vendorreq() staging: r8188eu: remove _drv_ defines from include/rtw_debug.h staging: vc04_services: remove unused macro staging: rtl8192u: remove null check after call container_of() staging: rtl8192e: remove null check after call container_of() staging: ks7010: remove null check after call container_of() staging: r8188eu: remove HW_VAR_AC_PARAM_BE from SetHwReg8188EU() staging: r8188eu: assoc_rsp and assoc_rsp_len are not used staging: r8188eu: last_rx_mgnt_pkts is set but not used staging: r8188eu: simplify error handling in recv_func_prehandle ... commit 04d93b2b8bc7a68ec45a6a156f34a611ede5aa60 Merge: 78c6499c92090 53c83d6d8e399 Author: Linus Torvalds Date: Fri Jun 3 10:34:34 2022 -0700 Merge tag 'spdx-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx Pull SPDX updates from Greg KH: "Here are some SPDX license marker changes. The SPDX-labeling effort has started to pick up again, so here are some changes for various parts of the tree that are related to this effort. Included in here are: - freevxfs license updates - spihash.c license cleanups - spdxcheck script updates to make things easier to work with going forward All of the license updates came from the original authors/copyright holders of the code involved. All of these have been in linux-next for weeks with no reported issues" * tag 'spdx-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: siphash: add SPDX tags as sole licensing authority scripts/spdxcheck: Exclude top-level README scripts/spdxcheck: Exclude MAINTAINERS/CREDITS scripts/spdxcheck: Exclude config directories scripts/spdxcheck: Put excluded files and directories into a separate file scripts/spdxcheck: Add option to display files without SPDX scripts/spdxcheck: Add [sub]directory statistics scripts/spdxcheck: Add directory statistics scripts/spdxcheck: Add percentage to statistics freevxfs: relicense to GPLv2 only commit 78c6499c92090d0fd1ddd1684fc3a5dc41d98c92 Merge: 72fbbc3d0e3e3 aacae8c469f9c Author: Linus Torvalds Date: Fri Jun 3 10:25:56 2022 -0700 Merge tag 'for-5.19/drivers-2022-06-02' of git://git.kernel.dk/linux-block Pull more block driver updates from Jens Axboe: "A collection of stragglers that were late on sending in their changes and just followup fixes. - NVMe fixes pull request via Christoph: - set controller enable bit in a separate write (Niklas Cassel) - disable namespace identifiers for the MAXIO MAP1001 (Christoph) - fix a comment typo (Julia Lawall)" - MD fixes pull request via Song: - Remove uses of bdevname (Christoph Hellwig) - Bug fixes (Guoqing Jiang, and Xiao Ni) - bcache fixes series (Coly) - null_blk zoned write fix (Damien) - nbd fixes (Yu, Zhang) - Fix for loop partition scanning (Christoph)" * tag 'for-5.19/drivers-2022-06-02' of git://git.kernel.dk/linux-block: (23 commits) block: null_blk: Fix null_zone_write() nvmet: fix typo in comment nvme: set controller enable bit in a separate write nvme-pci: disable namespace identifiers for the MAXIO MAP1001 bcache: avoid unnecessary soft lockup in kworker update_writeback_rate() nbd: use pr_err to output error message nbd: fix possible overflow on 'first_minor' in nbd_dev_add() nbd: fix io hung while disconnecting device nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed nbd: fix race between nbd_alloc_config() and module removal nbd: call genl_unregister_family() first in nbd_cleanup() md: bcache: check the return value of kzalloc() in detached_dev_do_request() bcache: memset on stack variables in bch_btree_check() and bch_sectors_dirty_init() block, loop: support partitions without scanning bcache: avoid journal no-space deadlock by reserving 1 journal bucket bcache: remove incremental dirty sector counting for bch_sectors_dirty_init() bcache: improve multithreaded bch_sectors_dirty_init() bcache: improve multithreaded bch_btree_check() md: fix double free of io_acct_set bioset md: Don't set mddev private to NULL in raid0 pers->free ... commit 72fbbc3d0e3e3117c29a73d0b4d928dc00ed99ce Merge: 34845d92bca52 e2e530867245d Author: Linus Torvalds Date: Fri Jun 3 10:21:43 2022 -0700 Merge tag 'for-5.19/block-exec-2022-06-02' of git://git.kernel.dk/linux-block Pull block request execute cleanups from Jens Axboe: "This change was advertised in the initial core block pull request, but didn't actually make that branch as we deferred it to a post-merge pull request to avoid a bunch of cross branch issues. This series cleans up the block execute path quite nicely" * tag 'for-5.19/block-exec-2022-06-02' of git://git.kernel.dk/linux-block: blk-mq: remove the done argument to blk_execute_rq_nowait blk-mq: avoid a mess of casts for blk_end_sync_rq blk-mq: remove __blk_execute_rq_nowait commit 34845d92bca527b5c2cf8b2293b71b9c746c79ca Merge: 5ac8bdb9ad473 41e46b3c2aa24 Author: Linus Torvalds Date: Fri Jun 3 10:14:48 2022 -0700 Merge tag 'for-5.19/block-2022-06-02' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Just a collection of fixes that have been queued up since the initial merge window pull request, the majority of which are targeted for stable as well. One bio_set fix that fixes an issue with the dm adoption of cached bio structs that got introduced in this merge window" * tag 'for-5.19/block-2022-06-02' of git://git.kernel.dk/linux-block: block: Fix potential deadlock in blk_ia_range_sysfs_show() block: fix bio_clone_blkg_association() to associate with proper blkcg_gq block: remove useless BUG_ON() in blk_mq_put_tag() blk-mq: do not update io_ticks with passthrough requests block: make bioset_exit() fully resilient against being called twice block: use bio_queue_enter instead of blk_queue_enter in bio_poll block: document BLK_STS_AGAIN usage block: take destination bvec offsets into account in bio_copy_data_iter blk-iolatency: Fix inflight count imbalances and IO hangs on offline blk-mq: don't touch ->tagset in blk_mq_get_sq_hctx commit 5ac8bdb9ad47334a9590e29daf7e4149b0a34729 Merge: 6e5f6a86915d6 9cae36a094e7e Author: Linus Torvalds Date: Fri Jun 3 10:10:38 2022 -0700 Merge tag 'io_uring-5.19-2022-06-02' of git://git.kernel.dk/linux-block Pull more io_uring updates from Jens Axboe: - A small series with some prep patches for the upcoming 5.20 split of the io_uring.c file. No functional changes here, just minor bits that are nice to get out of the way now (me) - Fix for a memory leak in high numbered provided buffer groups, introduced in the merge window (me) - Wire up the new socket opcode for allocated direct descriptors, making it consistent with the other opcodes that can instantiate a descriptor (me) - Fix for the inflight tracking, should go into 5.18-stable as well (me) - Fix for a deadlock for io-wq offloaded file slot allocations (Pavel) - Direct descriptor failure fput leak fix (Xiaoguang) - Fix for the direct descriptor allocation hinting in case of unsuccessful install (Xiaoguang) * tag 'io_uring-5.19-2022-06-02' of git://git.kernel.dk/linux-block: io_uring: reinstate the inflight tracking io_uring: fix deadlock on iowq file slot alloc io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots io_uring: defer alloc_hint update to io_file_bitmap_set() io_uring: ensure fput() called correspondingly when direct install fails io_uring: wire up allocated direct descriptors for socket io_uring: fix a memory leak of buffer group list on exit io_uring: move shutdown under the general net section io_uring: unify calling convention for async prep handling io_uring: add io_op_defs 'def' pointer in req init and issue io_uring: make prep and issue side of req handlers named consistently io_uring: make timeout prep handlers consistent with other prep handlers commit 6e5f6a86915d65210e90acac0402e6f37e21fc7b Merge: 6f6ebb9899861 bd8bb9aed56b1 Author: Linus Torvalds Date: Fri Jun 3 10:02:52 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: "vhost,virtio and vdpa features, fixes, and cleanups: - mac vlan filter and stats support in mlx5 vdpa - irq hardening in virtio - performance improvements in virtio crypto - polling i/o support in virtio blk - ASID support in vhost - fixes, cleanups all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (64 commits) vdpa: ifcvf: set pci driver data in probe vdpa/mlx5: Add RX MAC VLAN filter support vdpa/mlx5: Remove flow counter from steering vhost: rename vhost_work_dev_flush vhost-test: drop flush after vhost_dev_cleanup vhost-scsi: drop flush after vhost_dev_cleanup vhost_vsock: simplify vhost_vsock_flush() vhost_test: remove vhost_test_flush_vq() vhost_net: get rid of vhost_net_flush_vq() and extra flush calls vhost: flush dev once during vhost_dev_stop vhost: get rid of vhost_poll_flush() wrapper vhost-vdpa: return -EFAULT on copy_to_user() failure vdpasim: Off by one in vdpasim_set_group_asid() virtio: Directly use ida_alloc()/free() virtio: use WARN_ON() to warning illegal status value virtio: harden vring IRQ virtio: allow to unbreak virtqueue virtio-ccw: implement synchronize_cbs() virtio-mmio: implement synchronize_cbs() virtio-pci: implement synchronize_cbs() ... commit 6f6ebb9899861c8a4e49cc7d9796d024f731b512 Merge: ab18b7b36a82b 672362cbe6df0 Author: Linus Torvalds Date: Fri Jun 3 09:56:53 2022 -0700 Merge tag 'sound-fix-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes for 5.19 merge window. Nothing particular stands out, as most changes are device-specific fixes and quirks" * tag 'sound-fix-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: selftests: alsa: Handle pkg-config failure more gracefully ALSA: usb-audio: Optimize TEAC clock quirk ASoC: da7219: cancel AAD related work earlier for jack removal ASoC: da7219: Fix pole orientation detection on certain headsets ASoC: Intel: avs: Fix build error on arc, m68k and sparc ALSA: hda/realtek - Fix microphone noise on ASUS TUF B550M-PLUS ALSA: hda/via: Delete does not require return ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9520 laptop ASoC: Intel: common: fix typo for tplg naming ALSA: usb-audio: Cancel pending work at closing a MIDI substream ALSA: usb-audio: Add mixer mapping for Gigabyte B450/550 Mobos ASoC: rt5640: Do not manipulate pin "Platform Clock" if the "Platform Clock" is not in the DAPM ASoC: SOF: amd: Fixed Build error ASoC: fsl_sai: Fix FSL_SAI_xDR/xFR definition ASoC: soc-pcm: fix BE transition for TRIGGER_START commit 987cf300e76d30b1bdad88d2a662b948ead6fb21 Author: Rob Herring Date: Wed May 25 15:59:08 2022 -0500 dt-bindings: mtd: spi-nand: Add spi-peripheral-props.yaml reference SPI peripheral device bindings need to reference spi-peripheral-props.yaml in order to use various SPI controller specific properties. Otherwise, the unevaluatedProperties check will reject any controller specific properties. Signed-off-by: Rob Herring Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220525205909.2486153-1-robh@kernel.org commit ab18b7b36a82b1900687c5718f7d46f0d8e77d86 Merge: 50fd82b3a9a93 404204340c0dc Author: Linus Torvalds Date: Fri Jun 3 09:49:29 2022 -0700 Merge tag 'drm-next-2022-06-03-1' of git://anongit.freedesktop.org/drm/drm Pull more drm updates from Dave Airlie: "This is mostly regular fixes, msm and amdgpu. There is a tegra patch that is bit of prep work for a 5.20 feature to avoid some inter-tree syncs, and a couple of late addition amdgpu uAPI changes but best to get those in early, and the userspace pieces are ready. msm: - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a big-time hitter in the CI-runs. amdgpu: - Update fdinfo to the common drm format - uapi: - Add VM_NOALLOC GPUVM attribute to prevent buffers for going into the MALL - Add AMDGPU_GEM_CREATE_DISCARDABLE flag to create buffers that can be discarded on eviction - Mesa code which uses these: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16466 - Link training fixes - DPIA fixes - Misc code cleanups - Aux fixes - Hotplug fixes - More FP clean up - Misc GFX9/10 fixes - Fix a possible memory leak in SMU shutdown - SMU 13 updates - RAS fixes - TMZ fixes - GC 11 updates - SMU 11 metrics fixes - Fix coverage blend mode for overlay plane - Note DDR vs LPDDR memory - Fuzz fix for CS IOCTL - Add new PCI DID amdkfd: - Clean up hive setup - Misc fixes tegra: - add some prelim 5.20 work to avoid inter-tree mess" * tag 'drm-next-2022-06-03-1' of git://anongit.freedesktop.org/drm/drm: (57 commits) drm/msm/dpu: Move min BW request and full BW disable back to mdss drm/msm/dpu: Fix pointer dereferenced before checking drm/msm/dpu: Remove unused code drm/msm/disp/dpu1: remove superfluous init drm/msm/dp: Always clear mask bits to disable interrupts at dp_ctrl_reset_irq_ctrl() gpu: host1x: Add context bus drm/amdgpu: add drm-client-id to fdinfo v2 drm/amdgpu: Convert to common fdinfo format v5 drm/amdgpu: bump minor version number drm/amdgpu: add AMDGPU_VM_NOALLOC v2 drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE drm/amdgpu: add beige goby PCI ID drm/amd/pm: Return auto perf level, if unsupported drm/amdkfd: fix typo in comment drm/amdgpu/gfx: fix typos in comments drm/amdgpu/cs: make commands with 0 chunks illegal behaviour. drm/amdgpu: differentiate between LP and non-LP DDR memory drm/amdgpu: Resolve pcie_bif RAS recovery bug drm/amdgpu: clean up asd on the ta_firmware_header_v2_0 drm/amdgpu/discovery: validate VCN and SDMA instances ... commit e1dff7f133caffdba28531cddf272d0737c990bf Author: Rob Herring Date: Wed May 25 16:01:40 2022 -0500 dt-bindings: memory-controllers: ingenic: Split out child node properties Binding schemas which define child node properties such as memory controllers with timing properties need a separate schema which can be referenced from child device schemas. This is necessary for unevaluatedProperties checks to work properly. Move the ingenic,nemc child properties to its own file and reference from ingenic,nand.yaml which describes a child NAND controller. Signed-off-by: Rob Herring Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/20220525210140.2489866-1-robh@kernel.org commit bbba69ef4795c43fd28238be013588b7f7138bab Author: Rob Herring Date: Tue May 31 17:01:18 2022 -0500 dt-bindings: net/dsa: Add spi-peripheral-props.yaml references SPI peripheral device bindings need to reference spi-peripheral-props.yaml in order to use various SPI controller specific properties. Otherwise, the unevaluatedProperties check will reject any controller specific properties. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220531220122.2412711-1-robh@kernel.org commit 0dfe54071d7c828a02917b595456bfde1afdddc9 Author: Kees Cook Date: Wed May 18 13:52:23 2022 -0700 nodemask: Fix return values to be unsigned The nodemask routines had mixed return values that provided potentially signed return values that could never happen. This was leading to the compiler getting confusing about the range of possible return values (it was thinking things could be negative where they could not be). Fix all the nodemask routines that should be returning unsigned (or bool) values. Silences: mm/swapfile.c: In function ‘setup_swap_info’: mm/swapfile.c:2291:47: error: array subscript -1 is below array bounds of ‘struct plist_node[]’ [-Werror=array-bounds] 2291 | p->avail_lists[i].prio = 1; | ~~~~~~~~~~~~~~^~~ In file included from mm/swapfile.c:16: ./include/linux/swap.h:292:27: note: while referencing ‘avail_lists’ 292 | struct plist_node avail_lists[]; /* | ^~~~~~~~~~~ Reported-by: Christophe de Dinechin Link: https://lore.kernel.org/lkml/20220414150855.2407137-3-dinechin@redhat.com/ Cc: Alexey Dobriyan Cc: Yury Norov Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Andrew Morton Cc: Zhen Lei Signed-off-by: Kees Cook Signed-off-by: Yury Norov commit 005f17007f47495dbbb659aa5db7e581065d16e7 Author: Kees Cook Date: Wed May 18 13:52:22 2022 -0700 bitmap: Fix return values to be unsigned Both nodemask and bitmap routines had mixed return values that provided potentially signed return values that could never happen. This was leading to the compiler getting confusing about the range of possible return values (it was thinking things could be negative where they could not be). In preparation for fixing nodemask, fix all the bitmap routines that should be returning unsigned (or bool) values. Cc: Yury Norov Cc: Rasmus Villemoes Cc: Christophe de Dinechin Cc: Alexey Dobriyan Cc: Andy Shevchenko Cc: Andrew Morton Cc: Zhen Lei Signed-off-by: Kees Cook Signed-off-by: Yury Norov commit d603fd8dd35f6028bb09cd2e9ec6557c4bc0dd95 Author: Yury Norov Date: Mon May 9 18:54:23 2022 -0700 KVM: x86: hyper-v: replace bitmap_weight() with hweight64() kvm_hv_flush_tlb() applies bitmap API to a u64 variable valid_bank_mask. Since valid_bank_mask has a fixed size, we can use hweight64() and avoid excessive bloating. CC: Borislav Petkov CC: Dave Hansen CC: H. Peter Anvin CC: Ingo Molnar CC: Jim Mattson CC: Joerg Roedel CC: Paolo Bonzini CC: Sean Christopherson CC: Thomas Gleixner CC: Vitaly Kuznetsov CC: Wanpeng Li CC: kvm@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: x86@kernel.org Acked-by: Vitaly Kuznetsov Signed-off-by: Yury Norov commit a7ef9b455c7ca8f07a5b4bd967a3c39c7434d43f Author: Yury Norov Date: Thu May 19 10:15:04 2022 -0700 KVM: x86: hyper-v: fix type of valid_bank_mask In kvm_hv_flush_tlb(), valid_bank_mask is declared as unsigned long, but is used as u64, which is wrong for i386, and has been spotted by LKP after applying "KVM: x86: hyper-v: replace bitmap_weight() with hweight64()" https://lore.kernel.org/lkml/20220510154750.212913-12-yury.norov@gmail.com/ But it's wrong even without that patch because now bitmap_weight() dereferences a word after valid_bank_mask on i386. >> include/asm-generic/bitops/const_hweight.h:21:76: warning: right shift count >= width of type +[-Wshift-count-overflow] 21 | #define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32)) | ^~ include/asm-generic/bitops/const_hweight.h:10:16: note: in definition of macro '__const_hweight8' 10 | ((!!((w) & (1ULL << 0))) + \ | ^ include/asm-generic/bitops/const_hweight.h:20:31: note: in expansion of macro '__const_hweight16' 20 | #define __const_hweight32(w) (__const_hweight16(w) + __const_hweight16((w) >> 16)) | ^~~~~~~~~~~~~~~~~ include/asm-generic/bitops/const_hweight.h:21:54: note: in expansion of macro '__const_hweight32' 21 | #define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32)) | ^~~~~~~~~~~~~~~~~ include/asm-generic/bitops/const_hweight.h:29:49: note: in expansion of macro '__const_hweight64' 29 | #define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w)) | ^~~~~~~~~~~~~~~~~ arch/x86/kvm/hyperv.c:1983:36: note: in expansion of macro 'hweight64' 1983 | if (hc->var_cnt != hweight64(valid_bank_mask)) | ^~~~~~~~~ CC: Borislav Petkov CC: Dave Hansen CC: H. Peter Anvin CC: Ingo Molnar CC: Jim Mattson CC: Joerg Roedel CC: Paolo Bonzini CC: Sean Christopherson CC: Thomas Gleixner CC: Vitaly Kuznetsov CC: Wanpeng Li CC: kvm@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: x86@kernel.org Reported-by: kernel test robot Signed-off-by: Yury Norov Message-Id: <20220519171504.1238724-1-yury.norov@gmail.com> Signed-off-by: Paolo Bonzini commit a570e68fabec2f209d94abaabca8aab419437dab Author: Yury Norov Date: Fri May 6 21:08:10 2022 -0700 ia64: cleanup remove_siblinginfo() remove_siblinginfo() initialises variable 'last', but never uses it. Drop unneeded code. CC: Ingo Molnar CC: Peter Zijlstra CC: Valentin Schneider CC: linux-ia64@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov Acked-by: Andrew Morton commit 525d6515604eb1373ce5e6372a6b6640953b2d6a Author: Yury Norov Date: Thu Apr 28 13:51:16 2022 -0700 drm/amd/pm: use bitmap_{from,to}_arr32 where appropriate The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert bitmap to 32-bit array. This may be wrong due to endiannes issues. Fix it by switching to bitmap_{from,to}_arr32. CC: Alexander Gordeev CC: Andy Shevchenko CC: Christian Borntraeger CC: Claudio Imbrenda CC: David Hildenbrand CC: Heiko Carstens CC: Janosch Frank CC: Rasmus Villemoes CC: Sven Schnelle CC: Vasily Gorbik Signed-off-by: Yury Norov commit da0f8e957be95fbc50f751887f9250cbb8fba980 Author: Yury Norov Date: Thu Apr 28 13:51:15 2022 -0700 KVM: s390: replace bitmap_copy with bitmap_{from,to}_arr64 where appropriate Copying bitmaps from/to 64-bit arrays with bitmap_copy is not safe on 32-bit BE machines. Use designated functions instead. CC: Alexander Gordeev CC: Andy Shevchenko CC: Christian Borntraeger CC: Claudio Imbrenda CC: David Hildenbrand CC: Heiko Carstens CC: Janosch Frank CC: Rasmus Villemoes CC: Sven Schnelle CC: Vasily Gorbik Signed-off-by: Yury Norov Reviewed-by: David Hildenbrand commit 2c523550b9924f98299414253d8a1fef7c60ef2d Author: Yury Norov Date: Thu Apr 28 13:51:14 2022 -0700 lib/bitmap: add test for bitmap_{from,to}_arr64 Test newly added bitmap_{from,to}_arr64() functions similarly to already existing bitmap_{from,to}_arr32() tests. CC: Alexander Gordeev CC: Andy Shevchenko CC: Christian Borntraeger CC: Claudio Imbrenda CC: David Hildenbrand CC: Heiko Carstens CC: Janosch Frank CC: Rasmus Villemoes CC: Sven Schnelle CC: Vasily Gorbik Signed-off-by: Yury Norov commit 0a97953fd2210d0ac8eb5c76f8bd08fb53b6d3d6 Author: Yury Norov Date: Thu Apr 28 13:51:13 2022 -0700 lib: add bitmap_{from,to}_arr64 Manipulating 64-bit arrays with bitmap functions is potentially dangerous because on 32-bit BE machines the order of halfwords doesn't match. Another issue is that compiler may throw a warning about out-of-boundary access. This patch adds bitmap_{from,to}_arr64 functions in addition to existing bitmap_{from,to}_arr32. CC: Alexander Gordeev CC: Andy Shevchenko CC: Christian Borntraeger CC: Claudio Imbrenda CC: David Hildenbrand CC: Heiko Carstens CC: Janosch Frank CC: Rasmus Villemoes CC: Sven Schnelle CC: Vasily Gorbik Signed-off-by: Yury Norov commit e041e0ac53dd52d2d201aa87edc3adaca1085299 Author: Yury Norov Date: Thu Apr 28 13:51:12 2022 -0700 lib/bitmap: extend comment for bitmap_(from,to)_arr32() On LE systems bitmaps are naturally ordered, therefore we can potentially use bitmap_copy routines when converting from 32-bit arrays, even if host system is 64-bit. But it may lead to out-of-bond access due to unsafe typecast, and the bitmap_(from,to)_arr32 comment doesn't explain that clearly CC: Alexander Gordeev CC: Andy Shevchenko CC: Christian Borntraeger CC: Claudio Imbrenda CC: David Hildenbrand CC: Heiko Carstens CC: Janosch Frank CC: Rasmus Villemoes CC: Sven Schnelle CC: Vasily Gorbik Signed-off-by: Yury Norov commit 6d7131bd52b3e0dd068a0067e5584b3f36cf17eb Author: Anna-Maria Behnsen Date: Mon Apr 11 17:05:55 2022 +0200 include/linux/find: Fix documentation The order of the arguments in function documentation doesn't fit the implementation. Change the documentation so that it corresponds to the code. This prevent people to get confused when reading the documentation. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit 430cd4a28d7321d1e37b030a3793757077cc4f3c Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:41:46 2022 +0100 lib/bitmap.c make bitmap_print_bitmask_to_buf parseable The documentation of such function is not on a proper ReST format, as reported by Sphinx: Documentation/core-api/kernel-api:81: ./lib/bitmap.c:532: WARNING: Unexpected indentation. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:526: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:532: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:532: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:533: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:536: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:542: WARNING: Unexpected indentation. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:536: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:536: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:543: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:552: WARNING: Unexpected indentation. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:545: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:545: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:552: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:552: WARNING: Inline emphasis start-string without end-string. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:554: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:556: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:81: ./lib/bitmap.c:580: WARNING: Unexpected indentation. So, the produced output at: https://www.kernel.org/doc/html/latest/core-api/kernel-api.html?#c.bitmap_print_bitmask_to_buf is broken. Fix it by adding spaces and marking the literal blocks. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit c6bc5a3ce22c894b45f29d1b1fcf2daf287f10da Author: Yury Norov Date: Sun Jan 23 10:39:25 2022 -0800 MAINTAINERS: add cpumask and nodemask files to BITMAP_API cpumask and nodemask APIs are thin wrappers around basic bitmap API, and corresponding files are not formally maintained. This patch adds them to BITMAP_API section, so that bitmap folks would have closer look at it. Signed-off-by: Yury Norov commit dcf23cca930d1a60f7cd6b3a245a5081d77b8081 Author: Yury Norov Date: Sun Jan 23 10:38:57 2022 -0800 arch/x86: replace nodes_weight with nodes_empty where appropriate mm code calls nodes_weight() to check if any bit of a given nodemask is set. We can do it more efficiently with nodes_empty() because nodes_empty() stops traversing the nodemask as soon as it finds first set bit, while nodes_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit b55032f1067a02c7f80943dd118060952e8bd7ac Author: Yury Norov Date: Sun Jan 23 10:38:56 2022 -0800 mm/vmstat: replace cpumask_weight with cpumask_empty where appropriate mm/vmstat.c code calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Acked-by: Mike Rapoport commit 95e3a97387d6c396172f944b45bd515c7d1e8bc2 Author: Yury Norov Date: Sun Jan 23 10:38:55 2022 -0800 clocksource: replace cpumask_weight with cpumask_empty in clocksource.c clocksource_verify_percpu() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit 99248e351a2712154d1120ab003d89635c4e8e72 Author: Yury Norov Date: Sun Jan 23 10:38:51 2022 -0800 genirq/affinity: replace cpumask_weight with cpumask_empty where appropriate __irq_build_affinity_masks() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit d72002ae67adb1c665e43970685b16645023d639 Author: Yury Norov Date: Sun Jan 23 10:38:50 2022 -0800 irq: mips: replace cpumask_weight with cpumask_empty where appropriate bcm6345_l1_of_init() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Acked-by: Florian Fainelli commit a37e94fe7c428ff4663f22966e142e7610ed049d Author: Yury Norov Date: Sun Jan 23 10:38:48 2022 -0800 drm/i915/pmu: replace cpumask_weight with cpumask_empty where appropriate i915_pmu_cpu_online() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Reviewed-by: Tvrtko Ursulin commit 4aec74bccf5d047347bdfef3638e3031dd75c0a0 Author: Yury Norov Date: Sun Jan 23 10:38:46 2022 -0800 arch/x86: replace cpumask_weight with cpumask_empty where appropriate In some cases, arch/x86 code calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Reviewed-by: Steve Wahl commit b6dad11d9cb105681abbfc3d57aae4b21bd0c8c4 Author: Yury Norov Date: Sun Jan 23 10:38:45 2022 -0800 arch/ia64: replace cpumask_weight with cpumask_empty where appropriate setup_arch() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit 71c1a517e3da992fbbafb5c0b82a87c7eafc3383 Author: Yury Norov Date: Sun Jan 23 10:38:44 2022 -0800 arch/alpha: replace cpumask_weight with cpumask_empty where appropriate common_shutdown_1() calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit 8f51558e8015c1994aee2d8747a60cdcb47aeecd Author: Yury Norov Date: Sun May 8 07:49:50 2022 -0700 risc-v: replace bitmap_weight with bitmap_empty in riscv_fill_hwcap() bitmap_empty() is better than bitmap_weight() because it may return earlier, and improves on readability. CC: Albert Ou CC: Anup Patel CC: Atish Patra CC: Jisheng Zhang CC: Palmer Dabbelt CC: Paul Walmsley CC: Tsukasa OI CC: linux-riscv@lists.infradead.org CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov Reviewed-by: Anup Patel commit 8be4493119b0aedf7dd61e1ca520fb398537b53e Author: Huacai Chen Date: Tue May 31 18:04:12 2022 +0800 MAINTAINERS: Add maintainer information for LoongArch Add the maintainer information for the LoongArch (LA or LArch for short) architecture. Reviewed-by: Guo Ren Reviewed-by: Jiaxun Yang Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 9e8536e261165db0795bebaaa0aa92b8ba35f3e3 Author: Huacai Chen Date: Tue May 31 18:04:12 2022 +0800 LoongArch: Add Loongson-3 default config file Add a default config file for LoongArch-based Loongson-3 platform. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit d4b6f1562a3c3284adcef81d6e4f183d7d34b8a9 Author: Huacai Chen Date: Tue May 31 18:04:12 2022 +0800 LoongArch: Add Non-Uniform Memory Access (NUMA) support Add Non-Uniform Memory Access (NUMA) support for LoongArch. LoongArch has 48-bit physical address, but the HyperTransport I/O bus only support 40-bit address, so we need a custom phys_to_dma() and dma_to_phys() to extract the 4-bit node id (bit 44~47) from Loongson-3's 48-bit physical address space and embed it into 40-bit. In the 40-bit dma address, node id offset can be read from the LS7A_DMA_CFG register. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 46859ac8af52ae599e1b51992ddef3eb43f295fc Author: Huacai Chen Date: Tue May 31 18:04:12 2022 +0800 LoongArch: Add multi-processor (SMP) support LoongArch-based procesors have 4, 8 or 16 cores per package. This patch adds multi-processor (SMP) support for LoongArch. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit c6b99bed6b8f3255bd2f65a8e606352e0e638ad0 Author: Huacai Chen Date: Tue May 31 18:04:12 2022 +0800 LoongArch: Add VDSO and VSYSCALL support Add VDSO and VSYSCALL support (sigreturn, gettimeofday and its friends) for LoongArch. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 559671e04a33b183b6e65fd585ab2e2a0578208b Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add some library functions Add some library functions for LoongArch, including: delay, memset, memcpy, memmove, copy_user, strncpy_user, strnlen_user and tlb dump functions. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 7153c3cbb5b9b99755659b97861fd4fc909ed86f Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add misc common routines Add some misc common routines for LoongArch, including: asm-offsets routines, futex functions, i/o memory access functions, frame-buffer functions, procfs information display, etc. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit fcdfe9d22bed08409968a751e93112f742208be6 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add ELF and module support Add ELF-related definition and module relocation code for basic LoongArch support. Cc: Jessica Yu Reviewed-by: WANG Xuerui Reviewed-by: Luis Chamberlain Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit b74baf4ad05b5ebe3152592fb2fa80d51681392a Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add signal handling support Add ucontext/sigcontext definition and signal handling support for LoongArch. Cc: Eric Biederman Cc: Al Viro Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit be769645a2aef577f07afdcb4de8fad20b6d57c0 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add system call support Add system call support and related uaccess.h for LoongArch. Q: Why keep _ARCH_WANT_SYS_CLONE definition while there is clone3: A: The latest glibc release has some basic support for clone3 but it is not complete. E.g., pthread_create() and spawni() have converted to use clone3 but fork() will still use clone. Moreover, some seccomp related applications can still not work perfectly with clone3. E.g., Chromium sandbox cannot work at all and there is no solution for it, which is more terrible than the fork() story [1]. [1] https://chromium-review.googlesource.com/c/chromium/src/+/2936184 Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 09cfefb7fa70c3af011b0db0a513fd80b2f18abc Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add memory management Add memory management support for LoongArch, including: cache and tlb management, page fault handling and ioremap/mmap support. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 803b0fc5c3f2baa6e54978cd576407896f789b08 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add process management Add process management support for LoongArch, including: thread info definition, context switch and process tracing. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 0603839b18f4fb3bffa82515efcf5b02084505ef Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add exception/interrupt handling Add the exception and interrupt handling machanism for basic LoongArch support. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 628c3bb40e9a8cefc0a6fde28b7b66bfe46d1dc2 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add boot and setup routines Add basic boot, setup and reset routines for LoongArch. Now, LoongArch machines use UEFI-based firmware. The firmware passes configuration information to the kernel via ACPI and DMI/SMBIOS. Currently an existing interface between the kernel and the bootloader is implemented. Kernel gets 2 values from the bootloader, passed in registers a0 and a1; a0 is an "EFI boot flag" distinguishing UEFI and non-UEFI firmware, while a1 is a pointer to an FDT with systable, memmap, cmdline and initrd information. The standard UEFI boot protocol (EFISTUB) will be added later. Cc: linux-efi@vger.kernel.org Cc: Ard Biesheuvel Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Co-developed-by: Yun Liu Signed-off-by: Yun Liu Signed-off-by: Huacai Chen commit b738c106f7355e318ca47a3b981688efe1bc12fb Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add other common headers Add some other common headers for basic LoongArch support. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 5b0b14e550a006b4d093619e7517923872bcc218 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add atomic/locking headers Add common headers (atomic, bitops, barrier and locking) for basic LoongArch support. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit f2ac457a61389b7769aad8295027cbe0f91c5b80 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add CPU definition headers Add common headers (CPU definition and address space layout) for basic LoongArch support. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit fa96b57c149061f71a70bd6582d995f6424fbbf4 Author: Huacai Chen Date: Tue May 31 18:04:11 2022 +0800 LoongArch: Add build infrastructure Add Kbuild, Makefile, Kconfig and link script for LoongArch build infrastructure. Reviewed-by: Guo Ren Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 439057ec3b748b1ff61855d09859f369493e22d8 Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 LoongArch: Add writecombine support for drm LoongArch maintains cache coherency in hardware, but its WUC attribute (Weak-ordered UnCached, which is similar to WC) is out of the scope of cache coherency machanism. This means WUC can only used for write-only memory regions. Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 08145b087e4481458f6075f3af58021a3cf8a940 Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 LoongArch: Add ELF-related definitions Add ELF-related definitions for LoongArch, including: EM_LOONGARCH, KEXEC_ARCH_LOONGARCH, AUDIT_ARCH_LOONGARCH32, AUDIT_ARCH_LOONGARCH64 and NT_LOONGARCH_*. Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit f23b22599f8ec09460077418bca1e331bb715f63 Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 Documentation/zh_CN: Add basic LoongArch documentations Add some basic documentation (zh_CN version) for LoongArch. LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V. LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S) and a 64-bit version (LA64). Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Reviewed-by: Guo Ren Reviewed-by: Jiaxun Yang Co-developed-by: WANG Xuerui Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit 0ea8ce61cb2c487e818c515f91329fa9972a7155 Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 Documentation: LoongArch: Add basic documentations Add some basic documentation for LoongArch. LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V. LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S) and a 64-bit version (LA64). Tested-by: Bagas Sanjaya Reviewed-by: Jiaxun Yang Co-developed-by: WANG Xuerui Signed-off-by: WANG Xuerui Signed-off-by: Huacai Chen commit fa84f89395e0383b94ae2822003d8940fdb24d3c Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 irqchip/loongson-liointc: Fix build error for LoongArch liointc driver is shared by MIPS and LoongArch, this patch adjust the code to fix build error for LoongArch. Acked-by: Marc Zyngier Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 987a3e03c821366b7c62b41b1516138181e51764 Author: Huacai Chen Date: Tue May 31 18:04:10 2022 +0800 irqchip: Adjust Kconfig for Loongson HTVEC will be shared by both MIPS-based and LoongArch-based Loongson processors (not only Loongson-3), so we adjust its description. HTPIC is only used by MIPS-based Loongson, so we add a MIPS dependency. Acked-by: Marc Zyngier Reviewed-by: WANG Xuerui Reviewed-by: Jiaxun Yang Signed-off-by: Huacai Chen commit 07551992cdab1dcb7a17eeaf46b04913712535e8 Merge: d69a155555c9d fcb3b5a58926d Author: Mark Brown Date: Fri Jun 3 13:25:55 2022 +0200 ASoC: Fixup Cirrus SX control usage Merge series from Charles Keepax : Mostly the usage of the SX controls seems to match the lowest gain value + number of gain levels expected. The one notable exception there being cs53l30 as David noted. However, there are a couple of other places where the minimum value/TLVs are slightly incorrectly specified. commit fcb3b5a58926d16d9a338841b74af06d4c29be15 Author: Charles Keepax Date: Thu Jun 2 17:21:19 2022 +0100 ASoC: cs42l51: Correct minimum value for SX volume control The minimum value for the PGA Volume is given as 0x1A, however the values from there to 0x19 are all the same volume and this is not represented in the TLV structure. The number of volumes given is correct so this leads to all the volumes being shifted. Move the minimum value up to 0x19 to fix this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a8928ada9b96944cadd8b65d191e33199fd38782 Author: Charles Keepax Date: Thu Jun 2 17:21:18 2022 +0100 ASoC: cs42l56: Correct typo in minimum level for SX volume controls A couple of the SX volume controls specify 0x84 as the lowest volume value, however the correct value from the datasheet is 0x44. The datasheet don't include spaces in the value it displays as binary so this was almost certainly just a typo reading 1000100. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 91e90c712fade0b69cdff7cc6512f6099bd18ae5 Author: Charles Keepax Date: Thu Jun 2 17:21:17 2022 +0100 ASoC: cs42l52: Correct TLV for Bypass Volume The Bypass Volume is accidentally using a -6dB minimum TLV rather than the correct -60dB minimum. Add a new TLV to correct this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 7fbd6dd68127927e844912a16741016d432a0737 Author: Charles Keepax Date: Thu Jun 2 17:21:16 2022 +0100 ASoC: cs53l30: Correct number of volume levels on SX controls This driver specified the maximum value rather than the number of volume levels on the SX controls, this is incorrect, so correct them. Reported-by: David Rhodes Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 5005a2345825eb8346546d99bfe669f73111b5c5 Author: Charles Keepax Date: Thu Jun 2 17:21:15 2022 +0100 ASoC: cs35l36: Update digital volume TLV The digital volume TLV specifies the step as 0.25dB but the actual step of the control is 0.125dB. Update the TLV to correct this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8bf5aabf524eec61013e506f764a0b2652dc5665 Author: Charles Keepax Date: Thu Jun 2 17:21:14 2022 +0100 ASoC: cs42l52: Fix TLV scales for mixer controls The datasheet specifies the range of the mixer volumes as between -51.5dB and 12dB with a 0.5dB step. Update the TLVs for this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220602162119.3393857-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 6ba688364856ad083be537f08e86ba97f433d405 Author: Mikulas Patocka Date: Wed Jun 1 13:18:22 2022 -0400 parisc: fix a crash with multicore scheduler With the kernel 5.18, the system will hang on boot if it is compiled with CONFIG_SCHED_MC. The last printed message is "Brought up 1 node, 1 CPU". The crash happens in sd_init tl->mask (which is cpu_coregroup_mask) returns an empty mask. This happens because cpu_topology[0].core_sibling is empty. Consequently, sd_span is set to an empty mask sd_id = cpumask_first(sd_span) sets sd_id == NR_CPUS (because the mask is empty) sd->shared = *per_cpu_ptr(sdd->sds, sd_id); sets sd->shared to NULL because sd_id is out of range atomic_inc(&sd->shared->ref); crashes without printing anything We can fix it by calling reset_cpu_topology() from init_cpu_topology() - this will initialize the sibling masks on CPUs, so that they're not empty. This patch also removes the variable "dualcores_found", it is useless, because during boot, init_cpu_topology is called before store_cpu_topology. Thus, set_sched_topology(parisc_mc_topology) is never called. We don't need to call it at all because default_topology in kernel/sched/topology.c contains the same items as parisc_mc_topology. Note that we should not call store_cpu_topology() from init_per_cpu() because it is called too early in the kernel initialization process and it results in the message "Failure to register CPU0 device". Before this patch, store_cpu_topology() would exit immediatelly because cpuid_topo->core id was uninitialized and it was 0. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org # v5.18 Signed-off-by: Helge Deller commit 41e46b3c2aa24f755b2ae9ec4ce931ba5f0d8532 Author: Damien Le Moal Date: Fri Jun 3 11:19:05 2022 +0900 block: Fix potential deadlock in blk_ia_range_sysfs_show() When being read, a sysfs attribute is already protected against removal with the kobject node active reference counter. As a result, in blk_ia_range_sysfs_show(), there is no need to take the queue sysfs lock when reading the value of a range attribute. Using the queue sysfs lock in this function creates a potential deadlock situation with the disk removal, something that a lockdep signals with a splat when the device is removed: [ 760.703551] Possible unsafe locking scenario: [ 760.703551] [ 760.703554] CPU0 CPU1 [ 760.703556] ---- ---- [ 760.703558] lock(&q->sysfs_lock); [ 760.703565] lock(kn->active#385); [ 760.703573] lock(&q->sysfs_lock); [ 760.703579] lock(kn->active#385); [ 760.703587] [ 760.703587] *** DEADLOCK *** Solve this by removing the mutex_lock()/mutex_unlock() calls from blk_ia_range_sysfs_show(). Fixes: a2247f19ee1c ("block: Add independent access ranges support") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20220603021905.1441419-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit 404204340c0dc54e4b779737201044dcb231f0bf Merge: b8042ff4faa59 597b89d30b42d Author: Dave Airlie Date: Fri Jun 3 11:35:46 2022 +1000 Merge tag 'drm/tegra/for-5.19-prep-work' of https://gitlab.freedesktop.org/drm/tegra into drm-next drm/tegra: Preparatory work for v5.19 This contains a single patch from a series that's ready to go for v5.10 but is also a shared build-time dependency for an IOMMU series that is planned for v5.20. The idea is to take this into v5.19 to fulfill that dependency and remove the need for close coordination for the two series. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20220601100335.3841301-1-thierry.reding@gmail.com commit b8042ff4faa59ed3608beeeddc5d87ce55c62a98 Merge: bf23729c7a5f4 b9364eed9232f Author: Dave Airlie Date: Fri Jun 3 11:19:11 2022 +1000 Merge tag 'msm-next-5.19-fixes-06-01' of https://gitlab.freedesktop.org/abhinavk/msm into drm-next 5.19 fixes for msm-next - Fix to add minimum ICC vote in the msm_mdss pm_resume path to address bootup splats - Fix to avoid dereferencing without checking in WB encoder - Fix to avoid crash during suspend in DP driver by ensuring interrupt mask bits are updated - Remove unused code from dpu_encoder_virt_atomic_check() - Fix to remove redundant init of dsc variable Signed-off-by: Dave Airlie From: Abhinav Kumar Link: https://patchwork.freedesktop.org/patch/msgid/927b201e-a734-a29d-b9fb-b9889e1f7795@quicinc.com commit 61114e734ccb804bc12561ab4020745e02c468c2 Author: Nathan Chancellor Date: Mon May 16 14:45:21 2022 -0700 riscv: Move alternative length validation into subsection After commit 49b290e430d3 ("riscv: prevent compressed instructions in alternatives"), builds with LLVM's integrated assembler fail: In file included from arch/riscv/mm/init.c:10: In file included from ./include/linux/mm.h:29: In file included from ./include/linux/pgtable.h:6: In file included from ./arch/riscv/include/asm/pgtable.h:108: ./arch/riscv/include/asm/tlbflush.h:23:2: error: expected assembly-time absolute expression ALT_FLUSH_TLB_PAGE(__asm__ __volatile__ ("sfence.vma %0" : : "r" (addr) : "memory")); ^ ./arch/riscv/include/asm/errata_list.h:33:5: note: expanded from macro 'ALT_FLUSH_TLB_PAGE' asm(ALTERNATIVE("sfence.vma %0", "sfence.vma", SIFIVE_VENDOR_ID, \ ^ ./arch/riscv/include/asm/alternative-macros.h:187:2: note: expanded from macro 'ALTERNATIVE' _ALTERNATIVE_CFG(old_content, new_content, vendor_id, errata_id, CONFIG_k) ^ ./arch/riscv/include/asm/alternative-macros.h:113:2: note: expanded from macro '_ALTERNATIVE_CFG' __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) ^ ./arch/riscv/include/asm/alternative-macros.h:110:2: note: expanded from macro '__ALTERNATIVE_CFG' ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) ^ ./arch/riscv/include/asm/alternative-macros.h:99:3: note: expanded from macro 'ALT_NEW_CONTENT' ".org . - (889b - 888b) + (887b - 886b)\n" \ ^ :26:6: note: instantiated into assembly here .org . - (889b - 888b) + (887b - 886b) ^ This error happens because LLVM's integrated assembler has a one-pass design, which means it cannot figure out the instruction lengths when the .org directive is outside of the subsection that contains the instructions, which was changed by the .option directives added by the above change. Move the .org directives before the .previous directive so that these directives are always within the same subsection, which resolves the failures and does not introduce any new issues with GNU as. This was done for arm64 in commit 966a0acce2fc ("arm64/alternatives: move length validation inside the subsection") and commit 22315a2296f4 ("arm64: alternatives: Move length validation in alternative_{insn, endif}"). While there is no error from the assembly versions of the macro, they appear to have the same problem so just make the same change there as well so that there are no problems in the future. Link: https://github.com/ClangBuiltLinux/linux/issues/1640 Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220516214520.3252074-1-nathan@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 50fd82b3a9a9335df5d50c7ddcb81c81d358c4fc Merge: baf86ac1c9ccb a27e51b45e1bc Author: Linus Torvalds Date: Thu Jun 2 15:36:06 2022 -0700 Merge tag 'docs-5.19-2' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "A handful of late-arriving documentation fixes and the addition of an SVG tux logo which, I'm assured, we're going to want" * tag 'docs-5.19-2' of git://git.lwn.net/linux: documentation: Format button_dev as a pointer. docs: add SVG version of the Linux logo docs: move Linux logo into a new `images` folder docs: blockdev: change title to match section content docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 commit baf86ac1c9ccbde281df55a4daeefadec6d2e581 Merge: 09a018176ba24 8cc5b032240ae Author: Linus Torvalds Date: Thu Jun 2 15:32:26 2022 -0700 Merge tag 'asm-generic-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic fixes from Arnd Bergmann: "The header cleanup series from Masahiro Yamada ended up causing some regressions in the ABI because of an ambigous uid_t type. This was only caught after the original patches got merged, but at least the fixes are trivial and hopefully complete" * tag 'asm-generic-fixes-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: binder: fix sender_euid type in uapi header sparc: fix mis-use of __kernel_{uid,gid}_t in uapi/asm/stat.h powerpc: use __kernel_{uid,gid}32_t in uapi/asm/stat.h mips: use __kernel_{uid,gid}32_t in uapi/asm/stat.h commit 09a018176ba246f00d6b6b526047d38dcd2955d3 Merge: 96479c09803b2 9c76d723edd4f Author: Linus Torvalds Date: Thu Jun 2 15:27:44 2022 -0700 Merge tag 'arm-late-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull more ARM SoC updates from Arnd Bergmann: "This is the second part of the general SoC updates, containing everything that did not make it in the initial pull request, or that came in as a bugfix later. - Devicetree updates for SoCFPGA, ASPEED, AT91 and Rockchip, including a new machine using an ASPEED BMC. - More DT fixes from Krzysztof Kozlowski across platforms - A new SoC platform for the GXP baseboard management controller, used in current server products from HPE" * tag 'arm-late-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (56 commits) ARM: configs: Enable more audio support for i.MX tee: optee: Pass a pointer to virt_addr_valid() arm64: dts: rockchip: rename Quartz64-A bluetooth gpios arm64: dts: rockchip: add clocks property to cru node rk3368 arm64: dts: rockchip: add clocks property to cru node rk3308 arm64: dts: rockchip: add clocks to rk356x cru ARM: dts: rockchip: add clocks property to cru node rk3228 ARM: dts: rockchip: add clocks property to cru node rk3036 ARM: dts: rockchip: add clocks property to cru node rk3066a/rk3188 ARM: dts: rockchip: add clocks property to cru node rk3288 ARM: dts: rockchip: Remove "amba" bus nodes from rv1108 ARM: dts: rockchip: add clocks property to cru node rv1108 arm64: dts: sprd: use new 'dma-channels' property ARM: dts: da850: use new 'dma-channels' property ARM: dts: pxa: use new 'dma-channels/requests' properties soc: ixp4xx/qmgr: Fix unused match warning ARM: ep93xx: Make ts72xx_register_flash() static ARM: configs: enable support for Kontron KSwitch D10 ep93xx: clock: Do not return the address of the freed memory arm64: dts: intel: add device tree for n6000 ... commit 96479c09803b21d195c95fd4b145cd3a5a591ba0 Merge: 58f9d52ff689a 3d76c9f5e0ee8 Author: Linus Torvalds Date: Thu Jun 2 15:23:54 2022 -0700 Merge tag 'arm-multiplatform-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull more ARM multiplatform updates from Arnd Bergmann: "The second part of the multiplatform changes now converts the Intel/Marvell PXA platform along with the rest. The patches went through several rebases before the merge window as bugs were found, so they remained separate. This has to touch a lot of drivers, in particular the touchscreen, pcmcia, sound and clk bits, to detach the driver files from the platform and board specific header files" * tag 'arm-multiplatform-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (48 commits) ARM: pxa/mmp: remove traces of plat-pxa ARM: pxa: convert to multiplatform ARM: pxa/sa1100: move I/O space to PCI_IOBASE ARM: pxa: remove support for MTD_XIP ARM: pxa: move mach/*.h to mach-pxa/ ARM: PXA: fix multi-cpu build of xsc3 ARM: pxa: move plat-pxa to drivers/soc/ ARM: mmp: rename pxa_register_device ARM: mmp: remove tavorevb board support ARM: pxa: remove unused mach/bitfield.h ARM: pxa: move clk register definitions to driver ARM: pxa: move smemc register access from clk to platform cpufreq: pxa3: move clk register access to clk driver ARM: pxa: remove get_clk_frequency_khz() ARM: pxa: pcmcia: move smemc configuration back to arch ASoC: pxa: i2s: use normal MMIO accessors ASoC: pxa: ac97: use normal MMIO accessors ASoC: pxa: use pdev resource for FIFO regs Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops Input: wm97xx - switch to using threaded IRQ ... commit 9c375cfc7395bfed2c2790e3b97c32eefb7b726e Author: Jisheng Zhang Date: Mon May 16 22:32:04 2022 +0800 riscv: mm: init: make pt_ops_set_[early|late|fixmap] static These three functions are only used in init.c, so make them static. Fix W=1 warnings like below: arch/riscv/mm/init.c:721:13: warning: no previous prototype for function 'pt_ops_set_early' [-Wmissing-prototypes] void __init pt_ops_set_early(void) ^ Signed-off-by: Jisheng Zhang Reviewed-by: Anup Patel Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20220516143204.2603-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 2c9e4559773c261900c674a86b8e455911675d71 Author: Pablo Neira Ayuso Date: Wed Jun 1 17:49:36 2022 +0200 netfilter: nf_tables: always initialize flowtable hook list in transaction The hook list is used if nft_trans_flowtable_update(trans) == true. However, initialize this list for other cases for safety reasons. Fixes: 78d9f48f7f44 ("netfilter: nf_tables: add devices to existing flowtable") Signed-off-by: Pablo Neira Ayuso commit 58f9d52ff689a262bec7f5713c07f5a79e115168 Merge: 73503963b715a 638696efc1472 Author: Linus Torvalds Date: Thu Jun 2 12:50:16 2022 -0700 Merge tag 'net-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf and netfilter. Current release - new code bugs: - af_packet: make sure to pull the MAC header, avoid skb panic in GSO - ptp_clockmatrix: fix inverted logic in is_single_shot() - netfilter: flowtable: fix missing FLOWI_FLAG_ANYSRC flag - dt-bindings: net: adin: fix adi,phy-output-clock description syntax - wifi: iwlwifi: pcie: rename CAUSE macro, avoid MIPS build warning Previous releases - regressions: - Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" - tcp: fix tcp_mtup_probe_success vs wrong snd_cwnd - nf_tables: disallow non-stateful expression in sets earlier - nft_limit: clone packet limits' cost value - nf_tables: double hook unregistration in netns path - ping6: fix ping -6 with interface name Previous releases - always broken: - sched: fix memory barriers to prevent skbs from getting stuck in lockless qdiscs - neigh: set lower cap for neigh_managed_work rearming, avoid constantly scheduling the probe work - bpf: fix probe read error on big endian in ___bpf_prog_run() - amt: memory leak and error handling fixes Misc: - ipv6: expand & rename accept_unsolicited_na to accept_untracked_na" * tag 'net-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (80 commits) net/af_packet: make sure to pull mac header net: add debug info to __skb_pull() net: CONFIG_DEBUG_NET depends on CONFIG_NET stmmac: intel: Add RPL-P PCI ID net: stmmac: use dev_err_probe() for reporting mdio bus registration failure tipc: check attribute length for bearer name ice: fix access-beyond-end in the switch code nfp: remove padding in nfp_nfdk_tx_desc ax25: Fix ax25 session cleanup problems net: usb: qmi_wwan: Add support for Cinterion MV31 with new baseline sfc/siena: fix wrong tx channel offset with efx_separate_tx_channels sfc/siena: fix considering that all channels have TX queues socket: Don't use u8 type in uapi socket.h net/sched: act_api: fix error code in tcf_ct_flow_table_fill_tuple_ipv6() net: ping6: Fix ping -6 with interface name macsec: fix UAF bug for real_dev octeontx2-af: fix error code in is_valid_offset() wifi: mac80211: fix use-after-free in chanctx code bonding: guard ns_targets by CONFIG_IPV6 tcp: tcp_rtx_synack() can be called from process context ... commit 73503963b715a64a44aa2b1c486114b917a17c73 Author: Saravana Kannan Date: Wed Jun 1 20:56:52 2022 -0700 module: Fix prefix for module.sig_enforce module param Commit cfc1d277891e ("module: Move all into module/") changed the prefix of the module param by moving/renaming files. A later commit also moves the module_param() into a different file, thereby changing the prefix yet again. This would break kernel cmdline compatibility and also userspace compatibility at /sys/module/module/parameters/sig_enforce. So, set the prefix back to "module.". Fixes: cfc1d277891e ("module: Move all into module/") Link: https://lore.kernel.org/lkml/20220602034111.4163292-1-saravanak@google.com/ Cc: Christophe Leroy Cc: Aaron Tomlin Acked-by: Luis Chamberlain Signed-off-by: Saravana Kannan Signed-off-by: Linus Torvalds commit 78c09c0f4df89fabdcfb3e5e53d3196cf67f64ef Author: Cristian Marussi Date: Tue May 24 11:31:49 2022 +0100 kselftest/arm64: signal: Skip SVE signal test if not enough VLs supported On platform where SVE is supported but there are less than 2 VLs available the signal SVE change test should be skipped instead of failing. Reported-by: Andre Przywara Tested-by: Andre Przywara Cc: Mark Brown Signed-off-by: Cristian Marussi Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220524103149.2802-1-cristian.marussi@arm.com Signed-off-by: Catalin Marinas commit 73e2d827a501d48dceeb5b9b267a4cd283d6b1ae Author: Stephen Boyd Date: Wed Jun 1 19:21:09 2022 -0700 arm64: Initialize jump labels before setup_machine_fdt() A static key warning splat appears during early boot on arm64 systems that credit randomness from devicetrees that contain an "rng-seed" property. This is because setup_machine_fdt() is called before jump_label_init() during setup_arch(). Let's swap the order of these two calls so that jump labels are initialized before the devicetree is unflattened and the rng seed is credited. static_key_enable_cpuslocked(): static key '0xffffffe51c6fcfc0' used before call to jump_label_init() WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:166 static_key_enable_cpuslocked+0xb0/0xb8 Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0+ #224 44b43e377bfc84bc99bb5ab885ff694984ee09ff pstate: 600001c9 (nZCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : static_key_enable_cpuslocked+0xb0/0xb8 lr : static_key_enable_cpuslocked+0xb0/0xb8 sp : ffffffe51c393cf0 x29: ffffffe51c393cf0 x28: 000000008185054c x27: 00000000f1042f10 x26: 0000000000000000 x25: 00000000f10302b2 x24: 0000002513200000 x23: 0000002513200000 x22: ffffffe51c1c9000 x21: fffffffdfdc00000 x20: ffffffe51c2f0831 x19: ffffffe51c6fcfc0 x18: 00000000ffff1020 x17: 00000000e1e2ac90 x16: 00000000000000e0 x15: ffffffe51b710708 x14: 0000000000000066 x13: 0000000000000018 x12: 0000000000000000 x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000 x8 : 0000000000000000 x7 : 61632065726f6665 x6 : 6220646573752027 x5 : ffffffe51c641d25 x4 : ffffffe51c13142c x3 : ffff0a00ffffff05 x2 : 40000000ffffe003 x1 : 00000000000001c0 x0 : 0000000000000065 Call trace: static_key_enable_cpuslocked+0xb0/0xb8 static_key_enable+0x2c/0x40 crng_set_ready+0x24/0x30 execute_in_process_context+0x80/0x90 _credit_init_bits+0x100/0x154 add_bootloader_randomness+0x64/0x78 early_init_dt_scan_chosen+0x140/0x184 early_init_dt_scan_nodes+0x28/0x4c early_init_dt_scan+0x40/0x44 setup_machine_fdt+0x7c/0x120 setup_arch+0x74/0x1d8 start_kernel+0x84/0x44c __primary_switched+0xc0/0xc8 ---[ end trace 0000000000000000 ]--- random: crng init done Machine model: Google Lazor (rev1 - 2) with LTE Cc: Hsin-Yi Wang Cc: Douglas Anderson Cc: Ard Biesheuvel Cc: Steven Rostedt Cc: Jason A. Donenfeld Cc: Dominik Brodowski Fixes: f5bda35fba61 ("random: use static branch for crng_ready()") Signed-off-by: Stephen Boyd Reviewed-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220602022109.780348-1-swboyd@chromium.org Signed-off-by: Catalin Marinas commit 189129aecb5302ab65407e965f1037a201b58a07 Author: Xiang wangx Date: Fri Jun 3 02:02:28 2022 +0800 arm64: hibernate: Fix syntax errors in comments Delete the redundant word 'to'. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20220602180228.4259-1-wangxiang@cdjrlc.com Signed-off-by: Catalin Marinas commit c399c85d60a4295bd911d366399a97df2865fb86 Merge: 17d8e3d90b698 833e53a4ffe92 Author: Linus Torvalds Date: Thu Jun 2 12:11:25 2022 -0700 Merge tag 'pci-v5.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Revert brcmstb patches that broke booting on Raspberry Pi Compute Module 4 (Bjorn Helgaas) - Fix bridge_d3_blacklist[] error that overwrote the existing Gigabyte X299 entry instead of adding a new one (Bjorn Helgaas) - Update Lorenzo Pieralisi's email address in MAINTAINERS (Lorenzo Pieralisi) * tag 'pci-v5.19-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: MAINTAINERS: Update Lorenzo Pieralisi's email address PCI/PM: Fix bridge_d3_blacklist[] Elo i2 overwrite of Gigabyte X299 Revert "PCI: brcmstb: Split brcm_pcie_setup() into two funcs" Revert "PCI: brcmstb: Add mechanism to turn on subdev regulators" Revert "PCI: brcmstb: Add control of subdevice voltage regulators" Revert "PCI: brcmstb: Do not turn off WOL regulators on suspend" commit 587b9bfe0668bc997e51af9526a0c7c084d4660f Author: Dmitry Osipenko Date: Wed Jun 1 01:11:02 2022 +0300 kernel/reboot: Use static handler for register_platform_power_off() The register_platform_power_off() fails on m68k platform due to the memory allocation error that happens at a very early boot time when memory allocator isn't available yet. Fix it by using a static sys-off handler for the platform-level power-off handlers. Fixes: f0f7e5265b3b ("m68k: Switch to new sys-off handler API") Reported-by: Geert Uytterhoeven Signed-off-by: Dmitry Osipenko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki commit 0c9782e204d3cc5625b9e8bf4e8625d38dfe0139 Author: Kristen Carlson Accardi Date: Fri May 20 10:42:47 2022 -0700 x86/sgx: Set active memcg prior to shmem allocation When the system runs out of enclave memory, SGX can reclaim EPC pages by swapping to normal RAM. These backing pages are allocated via a per-enclave shared memory area. Since SGX allows unlimited over commit on EPC memory, the reclaimer thread can allocate a large number of backing RAM pages in response to EPC memory pressure. When the shared memory backing RAM allocation occurs during the reclaimer thread context, the shared memory is charged to the root memory control group, and the shmem usage of the enclave is not properly accounted for, making cgroups ineffective at limiting the amount of RAM an enclave can consume. For example, when using a cgroup to launch a set of test enclaves, the kernel does not properly account for 50% - 75% of shmem page allocations on average. In the worst case, when nearly all allocations occur during the reclaimer thread, the kernel accounts less than a percent of the amount of shmem used by the enclave's cgroup to the correct cgroup. SGX stores a list of mm_structs that are associated with an enclave. Pick one of them during reclaim and charge that mm's memcg with the shmem allocation. The one that gets picked is arbitrary, but this list almost always only has one mm. The cases where there is more than one mm with different memcg's are not worth considering. Create a new function - sgx_encl_alloc_backing(). This function is used whenever a new backing storage page needs to be allocated. Previously the same function was used for page allocation as well as retrieving a previously allocated page. Prior to backing page allocation, if there is a mm_struct associated with the enclave that is requesting the allocation, it is set as the active memory control group. [ dhansen: - fix merge conflict with ELDU fixes - check against actual ksgxd_tsk, not ->mm ] Cc: stable@vger.kernel.org Signed-off-by: Kristen Carlson Accardi Signed-off-by: Dave Hansen Reviewed-by: Shakeel Butt Acked-by: Roman Gushchin Link: https://lkml.kernel.org/r/20220520174248.4918-1-kristen@linux.intel.com commit 638696efc14729759c1d735e19e87606450b80a8 Merge: 83450bbafebda e9d3f80935b66 Author: Jakub Kicinski Date: Thu Jun 2 10:15:07 2022 -0700 Merge branch 'net-af_packet-be-careful-when-expanding-mac-header-size' Eric Dumazet says: ==================== net: af_packet: be careful when expanding mac header size A recent regression in af_packet needed a preliminary debug patch, which will presumably be useful for next bugs hunting. The af_packet fix is to make sure MAC headers are contained in skb linear part, as GSO stack requests. v2: CONFIG_DEBUG_NET depends on CONFIG_NET to avoid compile errors found by kernel bots. ==================== Link: https://lore.kernel.org/r/20220602161859.2546399-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit e9d3f80935b6607dcdc5682b00b1d4b28e0a0c5d Author: Eric Dumazet Date: Thu Jun 2 09:18:59 2022 -0700 net/af_packet: make sure to pull mac header GSO assumes skb->head contains link layer headers. tun device in some case can provide base 14 bytes, regardless of VLAN being used or not. After blamed commit, we can end up setting a network header offset of 18+, we better pull the missing bytes to avoid a posible crash in GSO. syzbot report was: kernel BUG at include/linux/skbuff.h:2699! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 3601 Comm: syz-executor210 Not tainted 5.18.0-syzkaller-11338-g2c5ca23f7414 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__skb_pull include/linux/skbuff.h:2699 [inline] RIP: 0010:skb_mac_gso_segment+0x48f/0x530 net/core/gro.c:136 Code: 00 48 c7 c7 00 96 d4 8a c6 05 cb d3 45 06 01 e8 26 bb d0 01 e9 2f fd ff ff 49 c7 c4 ea ff ff ff e9 f1 fe ff ff e8 91 84 19 fa <0f> 0b 48 89 df e8 97 44 66 fa e9 7f fd ff ff e8 ad 44 66 fa e9 48 RSP: 0018:ffffc90002e2f4b8 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000012 RCX: 0000000000000000 RDX: ffff88805bb58000 RSI: ffffffff8760ed0f RDI: 0000000000000004 RBP: 0000000000005dbc R08: 0000000000000004 R09: 0000000000000fe0 R10: 0000000000000fe4 R11: 0000000000000000 R12: 0000000000000fe0 R13: ffff88807194d780 R14: 1ffff920005c5e9b R15: 0000000000000012 FS: 000055555730f300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200015c0 CR3: 0000000071ff8000 CR4: 0000000000350ee0 Call Trace: __skb_gso_segment+0x327/0x6e0 net/core/dev.c:3411 skb_gso_segment include/linux/netdevice.h:4749 [inline] validate_xmit_skb+0x6bc/0xf10 net/core/dev.c:3669 validate_xmit_skb_list+0xbc/0x120 net/core/dev.c:3719 sch_direct_xmit+0x3d1/0xbe0 net/sched/sch_generic.c:327 __dev_xmit_skb net/core/dev.c:3815 [inline] __dev_queue_xmit+0x14a1/0x3a00 net/core/dev.c:4219 packet_snd net/packet/af_packet.c:3071 [inline] packet_sendmsg+0x21cb/0x5550 net/packet/af_packet.c:3102 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f4b95da06c9 Code: 28 c3 e8 4a 15 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:00007ffd7defc4c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007ffd7defc4f0 RCX: 00007f4b95da06c9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 0000000000000003 R08: bb1414ac00000050 R09: bb1414ac00000050 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd7defc4e0 R14: 00007ffd7defc4d8 R15: 00007ffd7defc4d4 Fixes: dfed913e8b55 ("net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Hangbin Liu Acked-by: Willem de Bruijn Cc: Michael S. Tsirkin Signed-off-by: Jakub Kicinski commit 22296a5c0cd35aaf62e1af3266f82cdf6b0b9b78 Author: Eric Dumazet Date: Thu Jun 2 09:18:58 2022 -0700 net: add debug info to __skb_pull() While analyzing yet another syzbot report, I found the following patch very useful. It allows to better understand what went wrong. This debug info is only enabled if CONFIG_DEBUG_NET=y, which is the case for syzbot builds. Signed-off-by: Eric Dumazet Acked-by: Willem de Bruijn Signed-off-by: Jakub Kicinski commit eb0b39efb7d908e3950f6f76ee6e3cecb86ec489 Author: Eric Dumazet Date: Thu Jun 2 09:18:57 2022 -0700 net: CONFIG_DEBUG_NET depends on CONFIG_NET It makes little sense to debug networking stacks if networking is not compiled in. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 83450bbafebdaf90818e77ee368202f03d056cd7 Author: Michael Sit Wei Hong Date: Thu Jun 2 15:35:07 2022 +0800 stmmac: intel: Add RPL-P PCI ID Add PCI ID for Ethernet TSN Controller on RPL-P. Signed-off-by: Michael Sit Wei Hong Link: https://lore.kernel.org/r/20220602073507.3955721-1-michael.wei.hong.sit@intel.com Signed-off-by: Jakub Kicinski commit 839612d23ffd933174db911ce56dc3f3ca883ec5 Author: Rasmus Villemoes Date: Thu Jun 2 09:48:40 2022 +0200 net: stmmac: use dev_err_probe() for reporting mdio bus registration failure I have a board where these two lines are always printed during boot: imx-dwmac 30bf0000.ethernet: Cannot register the MDIO bus imx-dwmac 30bf0000.ethernet: stmmac_dvr_probe: MDIO bus (id: 1) registration failed It's perfectly fine, and the device is successfully (and silently, as far as the console goes) probed later. Use dev_err_probe() instead, which will demote these messages to debug level (thus removing the alarming messages from the console) when the error is -EPROBE_DEFER, and also has the advantage of including the error code if/when it happens to be something other than -EPROBE_DEFER. While here, add the missing \n to one of the format strings. Signed-off-by: Rasmus Villemoes Link: https://lore.kernel.org/r/20220602074840.1143360-1-linux@rasmusvillemoes.dk Signed-off-by: Jakub Kicinski commit 7f36f798f89bf32c0164049cb0e3fd1af613d0bb Author: Hoang Le Date: Thu Jun 2 13:30:53 2022 +0700 tipc: check attribute length for bearer name syzbot reported uninit-value: ===================================================== BUG: KMSAN: uninit-value in string_nocheck lib/vsprintf.c:644 [inline] BUG: KMSAN: uninit-value in string+0x4f9/0x6f0 lib/vsprintf.c:725 string_nocheck lib/vsprintf.c:644 [inline] string+0x4f9/0x6f0 lib/vsprintf.c:725 vsnprintf+0x2222/0x3650 lib/vsprintf.c:2806 vprintk_store+0x537/0x2150 kernel/printk/printk.c:2158 vprintk_emit+0x28b/0xab0 kernel/printk/printk.c:2256 vprintk_default+0x86/0xa0 kernel/printk/printk.c:2283 vprintk+0x15f/0x180 kernel/printk/printk_safe.c:50 _printk+0x18d/0x1cf kernel/printk/printk.c:2293 tipc_enable_bearer net/tipc/bearer.c:371 [inline] __tipc_nl_bearer_enable+0x2022/0x22a0 net/tipc/bearer.c:1033 tipc_nl_bearer_enable+0x6c/0xb0 net/tipc/bearer.c:1042 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline] - Do sanity check the attribute length for TIPC_NLA_BEARER_NAME. - Do not use 'illegal name' in printing message. Reported-by: syzbot+e820fdc8ce362f2dea51@syzkaller.appspotmail.com Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()") Acked-by: Jon Maloy Signed-off-by: Hoang Le Link: https://lore.kernel.org/r/20220602063053.5892-1-hoang.h.le@dektech.com.au Signed-off-by: Jakub Kicinski commit f012e95b377c73c0283f009823c633104dedb337 Author: Chuck Lever Date: Wed Jun 1 12:46:52 2022 -0400 SUNRPC: Trap RDMA segment overflows Prevent svc_rdma_build_writes() from walking off the end of a Write chunk's segment array. Caught with KASAN. The test that this fix replaces is invalid, and might have been left over from an earlier prototype of the PCL work. Fixes: 7a1cbfa18059 ("svcrdma: Use parsed chunk lists to construct RDMA Writes") Signed-off-by: Chuck Lever commit b6c71c66b0ad8f2b59d9bc08c7a5079b110bec01 Author: Chuck Lever Date: Tue May 31 19:49:01 2022 -0400 NFSD: Fix potential use-after-free in nfsd_file_put() nfsd_file_put_noref() can free @nf, so don't dereference @nf immediately upon return from nfsd_file_put_noref(). Suggested-by: Trond Myklebust Fixes: 999397926ab3 ("nfsd: Clean up nfsd_file_put()") Signed-off-by: Chuck Lever commit 17d8e3d90b6989419806c1926b894d7d7483a25b Merge: 7c9e960c63630 af7dc8e5124da Author: Linus Torvalds Date: Thu Jun 2 08:59:39 2022 -0700 Merge tag 'ceph-for-5.19-rc1' of https://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "A big pile of assorted fixes and improvements for the filesystem with nothing in particular standing out, except perhaps that the fact that the MDS never really maintained atime was made official and thus it's no longer updated on the client either. We also have a MAINTAINERS update: Jeff is transitioning his filesystem maintainership duties to Xiubo" * tag 'ceph-for-5.19-rc1' of https://github.com/ceph/ceph-client: (23 commits) MAINTAINERS: move myself from ceph "Maintainer" to "Reviewer" ceph: fix decoding of client session messages flags ceph: switch TASK_INTERRUPTIBLE to TASK_KILLABLE ceph: remove redundant variable ino ceph: try to queue a writeback if revoking fails ceph: fix statfs for subdir mounts ceph: fix possible deadlock when holding Fwb to get inline_data ceph: redirty the page for writepage on failure ceph: try to choose the auth MDS if possible for getattr ceph: disable updating the atime since cephfs won't maintain it ceph: flush the mdlog for filesystem sync ceph: rename unsafe_request_wait() libceph: use swap() macro instead of taking tmp variable ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check ceph: no need to invalidate the fscache twice ceph: replace usage of found with dedicated list iterator variable ceph: use dedicated list iterator variable ceph: update the dlease for the hashed dentry when removing ceph: stop retrying the request when exceeding 256 times ceph: stop forwarding the request when exceeding 256 times ... commit 7c9e960c636306f632ccae623bf94b2b53d35cbd Merge: 12831f6486f9d 5d7c854593a46 Author: Linus Torvalds Date: Thu Jun 2 08:55:01 2022 -0700 Merge tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching cleanup from Petr Mladek: - Remove duplicated livepatch code [Christophe] * tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Remove klp_arch_set_pc() and asm/livepatch.h commit 12831f6486f9db5a8f2c87129f2b8f33349b1e04 Merge: ca1dcc6d0c569 809631e2bff5a Author: Linus Torvalds Date: Thu Jun 2 08:49:54 2022 -0700 Merge tag 'printk-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fixup from Petr Mladek: - Revert inappropriate use of wake_up_interruptible_all() in printk() * tag 'printk-for-5.19-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: Revert "printk: wake up all waiters" commit 8cc5b032240ae5220b62c689c20459d3e1825b2d Author: Carlos Llamas Date: Wed Jun 1 01:00:17 2022 +0000 binder: fix sender_euid type in uapi header The {pid,uid}_t fields of struct binder_transaction were recently replaced to use kernel types in commit 169adc2b6b3c ("android/binder.h: add linux/android/binder(fs).h to UAPI compile-test coverage"). However, using __kernel_uid_t here breaks backwards compatibility in architectures using 16-bits for this type, since glibc and some others still expect a 32-bit uid_t. Instead, let's use __kernel_uid32_t which avoids this compatibility problem. Fixes: 169adc2b6b3c ("android/binder.h: add linux/android/binder(fs).h to UAPI compile-test coverage") Reported-by: Christopher Ferris Signed-off-by: Carlos Llamas Acked-by: Todd Kjos Signed-off-by: Arnd Bergmann commit ca1dcc6d0c569e1e5f5b4a764329d9530760a416 Merge: 690b2549b1956 000605cd1b14f Author: Linus Torvalds Date: Thu Jun 2 08:46:30 2022 -0700 Merge tag 'memblock-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock test suite updates from Mike Rapoport: "Comment updates for memblock test suite Update comments in the memblock tests so that they will have consistent style" * tag 'memblock-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock tests: remove completed TODO item memblock tests: update style of comments for memblock_free_*() functions memblock tests: update style of comments for memblock_remove_*() functions memblock tests: update style of comments for memblock_reserve_*() functions memblock tests: update style of comments for memblock_add_*() functions commit 690b2549b19563ec5ad53e5c82f6a944d910086e Author: Dan Carpenter Date: Thu Jun 2 14:02:18 2022 +0300 i2c: ismt: prevent memory corruption in ismt_access() The "data->block[0]" variable comes from the user and is a number between 0-255. It needs to be capped to prevent writing beyond the end of dma_buffer[]. Fixes: 5e9a97b1f449 ("i2c: ismt: Adding support for I2C_SMBUS_BLOCK_PROC_CALL") Reported-and-tested-by: Zheyu Ma Signed-off-by: Dan Carpenter Reviewed-by: Mika Westerberg Signed-off-by: Linus Torvalds commit 3cbcff691173adf13c40ead37f2f628e2db52909 Author: Masahiro Yamada Date: Thu Jun 2 03:19:41 2022 +0900 sparc: fix mis-use of __kernel_{uid,gid}_t in uapi/asm/stat.h Commit 31a088b664d6 ("sparc: add asm/stat.h to UAPI compile-test coverage") converted as follows: uid_t --> __kernel_uid_t gid_t --> __kernel_gid_t It changed the field widths of struct stat because Sparc uses 16-bits for ___kernel_{uid,gid}_t as in arch/sparc/include/uapi/asm/posix_types.h. The safe replacements across all architectures are: uid_t --> __kernel_uid32_t gid_t --> __kernel_gid32_t as defined in include/linux/types.h. A similar issue was reported for the android binder. [1] [1]: https://lore.kernel.org/all/20220601010017.2639048-1-cmllamas@google.com/ Fixes: 31a088b664d6 ("sparc: add asm/stat.h to UAPI compile-test coverage") Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann commit d39e06154024b08a856767a70b7f8215e0af6ace Author: Masahiro Yamada Date: Thu Jun 2 03:19:40 2022 +0900 powerpc: use __kernel_{uid,gid}32_t in uapi/asm/stat.h Commit c01013a2f8dd ("powerpc: add asm/stat.h to UAPI compile-test coverage") converted as follows: uid_t --> __kernel_uid_t gid_t --> __kernel_gid_t The bit width of __kernel_{uid,gid}_t is 16 or 32-bits depending on architectures. PPC uses 32-bits for them as in include/uapi/asm-generic/posix_types.h, so the previous conversion is probably fine, but let's stick to the arch-independent conversion just in case. The safe replacements across all architectures are: uid_t --> __kernel_uid32_t gid_t --> __kernel_gid32_t as defined in include/linux/types.h. A similar issue was reported for the android binder. [1] [1]: https://lore.kernel.org/all/20220601010017.2639048-1-cmllamas@google.com/ Fixes: c01013a2f8dd ("powerpc: add asm/stat.h to UAPI compile-test coverage") Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann commit 6cd6356206605f283f82210918049465d0a08670 Author: Masahiro Yamada Date: Thu Jun 2 03:19:39 2022 +0900 mips: use __kernel_{uid,gid}32_t in uapi/asm/stat.h Commit 8c1a381a4fbb ("mips: add asm/stat.h to UAPI compile-test coverage") converted as follows: uid_t --> __kernel_uid_t gid_t --> __kernel_gid_t The bit width of __kernel_{uid,gid}_t is 16 or 32-bits depending on architectures. MIPS uses 32-bits for them as in include/uapi/asm-generic/posix_types.h, so the previous conversion is probably fine, but let's stick to the arch-independent conversion just in case. The safe replacements across all architectures are: uid_t --> __kernel_uid32_t gid_t --> __kernel_gid32_t as defined in include/linux/types.h. A similar issue was reported for the android binder. [1] [1]: https://lore.kernel.org/all/20220601010017.2639048-1-cmllamas@google.com/ Fixes: 8c1a381a4fbb ("mips: add asm/stat.h to UAPI compile-test coverage") Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann commit fe3f70eec425af77f3ea9818d8fe43a4b524bc7c Author: Rob Herring Date: Tue May 31 16:58:14 2022 -0500 dt-bindings: PCI: apple: Add missing 'power-domains' property The 'unevaluatedProperties' schema checks is not fully working and doesn't catch some cases where there's a $ref to another schema. A fix is pending, but results in new warnings in examples. The Apple PCIe host schema is missing 'power-domains' in the schema. The example has 3 power domains. However, this is wrong too as actual dts files have a single power domain and Sven confirmed 1 is correct. Cc: Sven Peter Signed-off-by: Rob Herring Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20220531215815.2408477-1-robh@kernel.org commit f5f1a977fe0b447ade38058dfbdbf540b53042b0 Author: Sibi Sankar Date: Thu Jun 2 06:18:41 2022 +0530 dt-bindings: Update Sibi Sankar's email address Update email address to the quicinc.com domain. Signed-off-by: Sibi Sankar Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1654130923-18722-1-git-send-email-quic_sibis@quicinc.com commit 304e4d53dd3268b2439932b620d246667ca960f1 Author: Jeffrey Hugo Date: Wed Jun 1 15:29:52 2022 -0600 dt-bindings: clock: Update my email address Update my email address from the defunct codeaurora.org domain to the current quicinc.com domain. Signed-off-by: Jeffrey Hugo Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1654118992-4026-1-git-send-email-quic_jhugo@quicinc.com commit d69a155555c9d57463b788c400f6b452d976bacd Author: xliu Date: Thu Jun 2 13:19:22 2022 +0800 ASoC: Intel: cirrus-common: fix incorrect channel mapping The default mapping of ASPRX1 (DAC source) is slot 0. Change the slot mapping of right amplifiers (WR and TR) to slot 1 to receive right channel data. Also update the ACPI instance ID mapping according to HW configuration. Signed-off-by: xliu Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220602051922.1232457-1-brent.lu@intel.com Signed-off-by: Mark Brown commit 5dad4eccd2b4316a84209603a28d34c6346392bb Author: Dipen Patel Date: Mon May 23 10:25:15 2022 -0700 dt-bindings: timestamp: Correct id path During the repository renaming from hte to timestamp, $id path was not updated accordingly. This patch corrects $id path. Fixes: af583852d2ef ("dt-bindings: Renamed hte directory to timestamp") Signed-off-by: Dipen Patel Acked-by: Rob Herring Signed-off-by: Thierry Reding commit aacae8c469f9ce4b303a2eb61593ff522c1420bc Author: Damien Le Moal Date: Thu Jun 2 21:03:44 2022 +0900 block: null_blk: Fix null_zone_write() The bio and rq fields of struct nullb_cmd are now overlapping in a union. So we cannot use a test on ->bio being non-NULL to detect the NULL_Q_BIO queue mode. null_zone_write() use such broken test to set the sector position of a zone append write in the command bio or request. When the null_blk device uses the NULL_Q_MQ queue mode, null_zone_write() wrongly end up setting the bio sector position, resulting in the command request to be broken and random crashes following. Fix this by testing the device queue mode directly. Fixes: 8ba816b23abd ("null-blk: save memory footprint for struct nullb_cmd") Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220602120344.1365329-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit 3e8635fb2e072672cbc650989ffedf8300ad67fb Author: Michael Ellerman Date: Thu Jun 2 00:31:14 2022 +1000 powerpc/kasan: Force thread size increase with KASAN KASAN causes increased stack usage, which can lead to stack overflows. The logic in Kconfig to suggest a larger default doesn't work if a user has CONFIG_EXPERT enabled and has an existing .config with a smaller value. Follow the lead of x86 and arm64, and force the thread size to be increased when KASAN is enabled. That also has the effect of enlarging the stack for 64-bit KASAN builds, which is also desirable. Fixes: edbadaf06710 ("powerpc/kasan: Fix stack overflow by increasing THREAD_SHIFT") Reported-by: Erhard Furtner Reported-by: Christophe Leroy [mpe: Use MIN_THREAD_SHIFT as suggested by Christophe] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220601143114.133524-1-mpe@ellerman.id.au commit 1bec877bdb763999112ad05d243bd538966938b4 Author: Catalin Marinas Date: Wed Jun 1 18:13:38 2022 +0100 arm64: Remove the __user annotation for the restore_za_context() argument The struct user_ctx *user pointer passed to restore_za_context() is not a user point but a structure containing several __user pointers. Remove the __user annotation. Signed-off-by: Catalin Marinas Fixes: 39782210eb7e ("arm64/sme: Implement ZA signal handling") Reported-by: kernel test robot Cc: Mark Brown Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220601171338.2143625-1-catalin.marinas@arm.com Signed-off-by: Catalin Marinas commit 6e1ff618737a2ffa12191dcd99f83ef07fac2e45 Author: Alexander Lobakin Date: Wed Jun 1 12:59:24 2022 +0200 ice: fix access-beyond-end in the switch code Global `-Warray-bounds` enablement revealed some problems, one of which is the way we define and use AQC rules messages. In fact, they have a shared header, followed by the actual message, which can be of one of several different formats. So it is straightforward enough to define that header as a separate struct and then embed it into message structures as needed, but currently all the formats reside in one union coupled with the header. Then, the code allocates only the memory needed for a particular message format, leaving the union potentially incomplete. There are no actual reads or writes beyond the end of an allocated chunk, but at the same time, the whole implementation is fragile and backed by an equilibrium rather than strong type and memory checks. Define the structures the other way around: one for the common header and the rest for the actual formats with the header embedded. There are no places where several union members would be used at the same time anyway. This allows to use proper struct_size() and let the compiler know what is going to be done. Finally, unsilence `-Warray-bounds` back for ice_switch.c. Other little things worth mentioning: * &ice_sw_rule_vsi_list_query is not used anywhere, remove it. It's weird anyway to talk to hardware with purely kernel types (bitmaps); * expand the ICE_SW_RULE_*_SIZE() macros to pass a structure variable name to struct_size() to let it do strict typechecking; * rename ice_sw_rule_lkup_rx_tx::hdr to ::hdr_data to keep ::hdr for the header structure to have the same name for it constistenly everywhere; * drop the duplicate of %ICE_SW_RULE_RX_TX_NO_HDR_SIZE residing in ice_switch.h. Fixes: 9daf8208dd4d ("ice: Add support for switch filter programming") Fixes: 66486d8943ba ("ice: replace single-element array used for C struct hack") Signed-off-by: Alexander Lobakin Reviewed-by: Marcin Szycik Acked-by: Tony Nguyen Link: https://lore.kernel.org/r/20220601105924.2841410-1-alexandr.lobakin@intel.com Signed-off-by: Paolo Abeni commit c6fbbf1eae8f35e10966826960e154c9596c86dc Author: Fei Qin Date: Wed Jun 1 10:34:49 2022 +0200 nfp: remove padding in nfp_nfdk_tx_desc NFDK firmware supports 48-bit dma addressing and parses 16 high bits of dma addresses. In nfp_nfdk_tx_desc, dma related structure and tso related structure are union. When "mss" be filled with nonzero value due to enable tso, the memory used by "padding" may be also filled. Then, firmware may parse wrong dma addresses which causes TX watchdog timeout problem. This patch removes padding and unifies the dma_addr_hi bits with the one in firmware. nfp_nfdk_tx_desc_set_dma_addr is also added to match this change. Fixes: c10d12e3dce8 ("nfp: add support for NFDK data path") Signed-off-by: Fei Qin Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220601083449.50556-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit f85daf0e725358be78dfd208dea5fd665d8cb901 Author: Hangyu Hua Date: Wed Jun 1 14:46:25 2022 +0800 xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup() xfrm_policy_lookup() will call xfrm_pol_hold_rcu() to get a refcount of pols[0]. This refcount can be dropped in xfrm_expand_policies() when xfrm_expand_policies() return error. pols[0]'s refcount is balanced in here. But xfrm_bundle_lookup() will also call xfrm_pols_put() with num_pols == 1 to drop this refcount when xfrm_expand_policies() return error. This patch also fix an illegal address access. pols[0] will save a error point when xfrm_policy_lookup fails. This lead to xfrm_pols_put to resolve an illegal address in xfrm_bundle_lookup's error path. Fix these by setting num_pols = 0 in xfrm_expand_policies()'s error path. Fixes: 80c802f3073e ("xfrm: cache bundles instead of policies for outgoing flows") Signed-off-by: Hangyu Hua Signed-off-by: Steffen Klassert commit 7d8a3a477b3e25ada8dc71d22048c2ea417209a0 Author: Duoming Zhou Date: Mon May 30 23:21:58 2022 +0800 ax25: Fix ax25 session cleanup problems There are session cleanup problems in ax25_release() and ax25_disconnect(). If we setup a session and then disconnect, the disconnected session is still in "LISTENING" state that is shown below. Active AX.25 sockets Dest Source Device State Vr/Vs Send-Q Recv-Q DL9SAU-4 DL9SAU-3 ??? LISTENING 000/000 0 0 DL9SAU-3 DL9SAU-4 ??? LISTENING 000/000 0 0 The first reason is caused by del_timer_sync() in ax25_release(). The timers of ax25 are used for correct session cleanup. If we use ax25_release() to close ax25 sessions and ax25_dev is not null, the del_timer_sync() functions in ax25_release() will execute. As a result, the sessions could not be cleaned up correctly, because the timers have stopped. In order to solve this problem, this patch adds a device_up flag in ax25_dev in order to judge whether the device is up. If there are sessions to be cleaned up, the del_timer_sync() in ax25_release() will not execute. What's more, we add ax25_cb_del() in ax25_kill_by_device(), because the timers have been stopped and there are no functions that could delete ax25_cb if we do not call ax25_release(). Finally, we reorder the position of ax25_list_lock in ax25_cb_del() in order to synchronize among different functions that call ax25_cb_del(). The second reason is caused by improper check in ax25_disconnect(). The incoming ax25 sessions which ax25->sk is null will close heartbeat timer, because the check "if(!ax25->sk || ..)" is satisfied. As a result, the session could not be cleaned up properly. In order to solve this problem, this patch changes the improper check to "if(ax25->sk && ..)" in ax25_disconnect(). What`s more, the ax25_disconnect() may be called twice, which is not necessary. For example, ax25_kill_by_device() calls ax25_disconnect() and sets ax25->state to AX25_STATE_0, but ax25_release() calls ax25_disconnect() again. In order to solve this problem, this patch add a check in ax25_release(). If the flag of ax25->sk equals to SOCK_DEAD, the ax25_disconnect() in ax25_release() should not be executed. Fixes: 82e31755e55f ("ax25: Fix UAF bugs in ax25 timers") Fixes: 8a367e74c012 ("ax25: Fix segfault after sock connection timeout") Reported-and-tested-by: Thomas Osterried Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220530152158.108619-1-duoming@zju.edu.cn Signed-off-by: Paolo Abeni commit 22b106e5355d6e7a9c3b5cb5ed4ef22ae585ea94 Author: Jan Kara Date: Thu Jun 2 10:12:42 2022 +0200 block: fix bio_clone_blkg_association() to associate with proper blkcg_gq Commit d92c370a16cb ("block: really clone the block cgroup in bio_clone_blkg_association") changed bio_clone_blkg_association() to just clone bio->bi_blkg reference from source to destination bio. This is however wrong if the source and destination bios are against different block devices because struct blkcg_gq is different for each bdev-blkcg pair. This will result in IOs being accounted (and throttled as a result) multiple times against the same device (src bdev) while throttling of the other device (dst bdev) is ignored. In case of BFQ the inconsistency can even result in crashes in bfq_bic_update_cgroup(). Fix the problem by looking up correct blkcg_gq for the cloned bio. Reported-by: Logan Gunthorpe Reported-and-tested-by: Donald Buczek Fixes: d92c370a16cb ("block: really clone the block cgroup in bio_clone_blkg_association") CC: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220602081242.7731-1-jack@suse.cz Signed-off-by: Jens Axboe commit ff47dbd18b8db251fe1fd013a8fa067d381ecd5b Author: Damien Le Moal Date: Thu Jun 2 16:51:59 2022 +0900 block: remove useless BUG_ON() in blk_mq_put_tag() Since the if condition in blk_mq_put_tag() checks that the tag to put is not a reserved one, the BUG_ON() check in the else branch checking if the tag is indeed a reserved one is useless. Remove it. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20220602075159.1273366-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit b6d9014a3335194590abdd2a2471ef5147a67645 Author: Pablo Neira Ayuso Date: Mon May 30 18:40:06 2022 +0200 netfilter: nf_tables: delete flowtable hooks via transaction list Remove inactive bool field in nft_hook object that was introduced in abadb2f865d7 ("netfilter: nf_tables: delete devices from flowtable"). Move stale flowtable hooks to transaction list instead. Deleting twice the same device does not result in ENOENT. Fixes: abadb2f865d7 ("netfilter: nf_tables: delete devices from flowtable") Signed-off-by: Pablo Neira Ayuso commit c9fdf7b453874e37ff4c499140ba2ab56fa0c7e5 Merge: a1a2d8f0162b2 cbf84dbf0600b Author: Jens Axboe Date: Thu Jun 2 01:48:35 2022 -0600 Merge tag 'nvme-5.19-2022-06-02' of git://git.infradead.org/nvme into for-5.19/drivers Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.19 - set controller enable bit in a separate write (Niklas Cassel) - disable namespace identifiers for the MAXIO MAP1001 (me) - fix a comment typo (Julia Lawall)" * tag 'nvme-5.19-2022-06-02' of git://git.infradead.org/nvme: nvmet: fix typo in comment nvme: set controller enable bit in a separate write nvme-pci: disable namespace identifiers for the MAXIO MAP1001 commit 7bb8a0cf49d5fede1104afdcb43bd2f8a1df3253 Author: Uwe Kleine-König Date: Mon May 23 10:39:47 2022 +0200 gpio: adp5588: Remove support for platform setup and teardown callbacks If the teardown callback failed in the gpio driver, it fails to free the irq (if there is one). The device is removed anyhow. If later on the irq triggers, all sorts of unpleasant things might happen (e.g. accessing the struct adp5588_gpio which is already freed in the meantime or starting i2c bus transfers for an unregistered device). Even before irq support was added to this driver, exiting early was wrong; back then it failed to unregister the gpiochip. Fortunately these callbacks aren't used any more since at least blackfin was removed in 2018. So just drop them. Note that they are not removed from struct adp5588_gpio_platform_data because the keyboard driver adp5588-keys.c also makes use of them. (I didn't check if the callbacks might have been called twice, maybe there is another reason hidden to better not call these functions.) This patch is a preparation for making i2c remove callbacks return void. Fixes: 80884094e344 ("gpio: adp5588-gpio: new driver for ADP5588 GPIO expanders") Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Acked-by: Michael Hennerich Signed-off-by: Bartosz Golaszewski commit 9cae36a094e7e9d6e5fe8b6dcd4642138b3eb0c7 Author: Jens Axboe Date: Wed Jun 1 23:57:02 2022 -0600 io_uring: reinstate the inflight tracking After some debugging, it was realized that we really do still need the old inflight tracking for any file type that has io_uring_fops assigned. If we don't, then trivial circular references will mean that we never get the ctx cleaned up and hence it'll leak. Just bring back the inflight tracking, which then also means we can eliminate the conditional dropping of the file when task_work is queued. Fixes: d5361233e9ab ("io_uring: drop the old style inflight file tracking") Signed-off-by: Jens Axboe commit 9eb2e45d097c0b951d76d9c6625f248f54e8c7ff Author: Masahiro Yamada Date: Thu May 12 03:44:08 2022 +0900 riscv: move errata/ and kvm/ builds to arch/riscv/Kbuild Commit 909548d6c578 ("riscv: add arch/riscv/Kbuild") intended that subdirectories in arch/riscv/ would be added in arch/riscv/Kbuild. Signed-off-by: Masahiro Yamada Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit e15db62bc5648ab459a570862f654e787c498faf Author: Christoph Hellwig Date: Wed Jun 1 20:49:39 2022 +0200 swiotlb: fix setting ->force_bounce The swiotlb_init refactor messed up assigning ->force_bounce by doing it in different places based on what caused the setting of the flag. Fix this by passing the SWIOTLB_* flags to swiotlb_init_io_tlb_mem and just setting it there. Fixes: c6af2aa9ffc9 ("swiotlb: make the swiotlb_init interface more useful") Reported-by: Nathan Chancellor Signed-off-by: Christoph Hellwig Tested-by: Nathan Chancellor commit e19f8fa6ce1ca9b8b934ba7d2e8f34c95abc6e60 Author: Rob Clark Date: Wed Jun 1 07:51:16 2022 -0700 dma-debug: make things less spammy under memory pressure Limit the error msg to avoid flooding the console. If you have a lot of threads hitting this at once, they could have already gotten passed the dma_debug_disabled() check before they get to the point of allocation failure, resulting in quite a lot of this error message spamming the log. Use pr_err_once() to limit that. Signed-off-by: Rob Clark Signed-off-by: Christoph Hellwig commit e61bf5c071148c80d091f8e7220b3b9130780ae3 Author: Xianting Tian Date: Wed May 18 09:34:28 2022 +0800 RISC-V: Mark IORESOURCE_EXCLUSIVE for reserved mem instead of IORESOURCE_BUSY Commit 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") marked IORESOURCE_BUSY for reserved memory, which caused resource map failed in subsequent operations of related driver, so remove the IORESOURCE_BUSY flag. In order to prohibit userland mapping reserved memory, mark IORESOURCE_EXCLUSIVE for it. The code to reproduce the issue, dts: mem0: memory@a0000000 { reg = <0x0 0xa0000000 0 0x1000000>; no-map; }; &test { status = "okay"; memory-region = <&mem0>; }; code: np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0); ret = of_address_to_resource(np, 0, &r); base = devm_ioremap_resource(&pdev->dev, &r); // base = -EBUSY Fixes: 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") Reported-by: Huaming Jiang Reviewed-by: Guo Ren Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Co-developed-by: Nick Kossifidis Signed-off-by: Xianting Tian Link: https://lore.kernel.org/r/20220518013428.1338983-1-xianting.tian@linux.alibaba.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 02d88b40cb2e9614e0117c3385afdce878f0d377 Author: Tobias Klauser Date: Thu May 5 10:18:15 2022 +0200 riscv: Wire up memfd_secret in UAPI header Move the __ARCH_WANT_MEMFD_SECRET define added in commit 7bb7f2ac24a0 ("arch, mm: wire up memfd_secret system call where relevant") to so __NR_memfd_secret is defined when including in userspace. This allows the memfd_secret selftest to pass on riscv. Signed-off-by: Tobias Klauser Link: https://lore.kernel.org/r/20220505081815.22808-1-tklauser@distanz.ch Fixes: 7bb7f2ac24a0 ("arch, mm: wire up memfd_secret system call where relevant") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 2273272823db6f67d57761df8116ae32e7f05bed Author: Samuel Holland Date: Fri Apr 29 22:00:23 2022 -0500 riscv: Fix irq_work when SMP is disabled irq_work is triggered via an IPI, but the IPI infrastructure is not included in uniprocessor kernels. As a result, irq_work never runs. Fall back to the tick-based irq_work implementation on uniprocessor configurations. Fixes: 298447928bb1 ("riscv: Support irq_work via self IPIs") Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220430030025.58405-1-samuel@sholland.org Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 26b8f69edda85a7942fa580360690c2d5c74f765 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:54 2021 +0100 riscv: Improve virtual kernel memory layout dump With the arrival of sv48 and its large address space, it would be cumbersome to statically define the unit size to use to print the different portions of the virtual memory layout: instead, determine it dynamically. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 35d33c76d68dfacc330a8eb477b51cc647c5a847 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:56 2021 +0100 riscv: Initialize thread pointer before calling C functions Because of the stack canary feature that reads from the current task structure the stack canary value, the thread pointer register "tp" must be set before calling any C function from head.S: by chance, setup_vm and all the functions that it calls does not seem to be part of the functions where the canary check is done, but in the following commits, some functions will. Fixes: f2c9699f65557a31 ("riscv: Add STACKPROTECTOR supported") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 096c956b0d7a4a51b31ffabc1a7398a479d59307 Author: Steve French Date: Wed Jun 1 23:23:09 2022 -0500 cifs: update internal module number To 2.37 Signed-off-by: Steve French commit 9d19f2b5256ef6cdd4947b48fab4032d0060e916 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:55 2021 +0100 Documentation: riscv: Add sv48 description to VM layout sv48 was just introduced, so add its virtual memory layout to the documentation. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 7ef93ffccd55fb0ba000ed16ef6a81cd7dee07b5 Author: Steve French Date: Wed Jun 1 22:08:46 2022 -0500 cifs: version operations for smb20 unneeded when legacy support disabled We should not be including unused smb20 specific code when legacy support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned off). For example smb2_operations and smb2_values aren't used in that case. Over time we can move more and more SMB1/CIFS and SMB2.0 code into the insecure legacy ifdefs Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 387ba9bf4cb80277fb01a7b753da611ab1260a1a Author: Steve French Date: Wed Jun 1 21:25:43 2022 -0500 cifs: do not build smb1ops if legacy support is disabled We should not be including unused SMB1/CIFS functions when legacy support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned off), but especially obvious is not needing to build smb1ops.c at all when legacy support is disabled. Over time we can move more SMB1/CIFS and SMB2.0 legacy functions into ifdefs but this is a good start (and shrinks the module size a few percent). Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit aa2a4ded05058f134a4dee1424f829d662e00cda Author: Gleb Chesnokov Date: Mon May 23 09:24:59 2022 +0000 scsi: qla2xxx: Remove unused 'ql_dm_tgt_ex_pct' parameter The ql_dm_tgt_ex_pct parameter was introduced in commit ead038556f64 ("qla2xxx: Add Dual mode support in the driver"). Then the use of this parameter was dropped in commit 99e1b683c4be ("scsi: qla2xxx: Add ql2xiniexchg parameter"). Thus, remove ql_dm_tgt_ex_pct since it is no longer used. Link: https://lore.kernel.org/r/AM9PR10MB41185ADE95B92B4E6926BE639DD49@AM9PR10MB4118.EURPRD10.PROD.OUTLOOK.COM Reviewed-by: Himanshu Madhani Signed-off-by: Gleb Chesnokov Signed-off-by: Martin K. Petersen commit e250bd2699e0e7418cd54ea2a762acfcfad43ffd Author: Tom Rix Date: Sat May 21 16:16:07 2022 -0400 scsi: qla2xxx: Remove setting of 'req' and 'rsp' parameters cppcheck reports [drivers/scsi/qla2xxx/qla_mid.c:594]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [drivers/scsi/qla2xxx/qla_mid.c:620]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? The functions qla25xx_free_req_que() and qla25xx_free_rsp_que() are similar. They free a 'req' and a 'rsp' parameter respectively. The last statement of both functions is setting the parameter to NULL. This has no effect and can be removed. Link: https://lore.kernel.org/r/20220521201607.4145298-1-trix@redhat.com Reviewed-by: Himanshu Madhani Signed-off-by: Tom Rix Signed-off-by: Martin K. Petersen commit 1fcbe4c490396c5a0d4588cfb84923ad6076b62a Author: Jiapeng Chong Date: Wed May 25 17:35:14 2022 +0800 scsi: mpi3mr: Fix kernel-doc Fix the following W=1 kernel warnings: drivers/scsi/mpi3mr/mpi3mr_app.c:1706: warning: expecting prototype for adapter_state_show(). Prototype was for adp_state_show() instead. Link: https://lore.kernel.org/r/20220525093514.55467-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Martin K. Petersen commit a5b168efba215229465d9a1a0e77b83073c7bfd0 Author: Bradley Grove Date: Tue May 24 08:56:21 2022 -0400 scsi: lpfc: Add support for ATTO Fibre Channel devices Update pci_device_id table and generate reporting strings for ATTO Celerity and ThunderLink Fibre Channel devices. Link: https://lore.kernel.org/r/20220524125621.47102-1-bgrove@attotech.com Reviewed-by: Hannes Reinecke Reviewed-by: James Smart Co-developed-by: Jason Seba Signed-off-by: Jason Seba Signed-off-by: Bradley Grove Signed-off-by: Martin K. Petersen commit b3bc1a88b534b3ef880a5124f3db45c149e601ee Author: Hannes Reinecke Date: Tue May 24 07:56:31 2022 +0200 scsi: core: Return BLK_STS_TRANSPORT for ALUA transitioning When the 'ALUA state transitioning' sense code is returned we cannot use BLK_STS_AGAIN, as this has a very specific use-case. So return BLK_STS_TRANSPORT here. Link: https://lore.kernel.org/r/20220524055631.85480-3-hare@suse.de Reviewed-by: Chaitanya Kulkarni Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 30c4fdc3dcdd1f08876300711778d8b680d54b36 Author: Damien Le Moal Date: Wed Jun 1 15:25:44 2022 +0900 scsi: sd_zbc: Prevent zone information memory leak Make sure to always free a scsi disk zone information, even for regular disks. This ensures that there is no memory leak, even in the case of a zoned disk changing type to a regular disk (e.g. with a reformat using the FORMAT WITH PRESET command or other vendor proprietary command). To do this, rename sd_zbc_clear_zone_info() to sd_zbc_free_zone_info() and remove sd_zbc_release_disk(). A call to sd_zbc_free_zone_info() is added to sd_zbc_read_zones() for drives for which sd_is_zoned() returns false. Furthermore, sd_zbc_free_zone_info() code make s sure that the sdkp rev_mutex is never used while not being initialized by gating the cleanup code with a a check on the zone_wp_update_buf field as it is never NULL when rev_mutex has been initialized. Link: https://lore.kernel.org/r/20220601062544.905141-3-damien.lemoal@opensource.wdc.com Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 05fbde3a77a4f1d62e4c4428f384288c1f1a0be5 Author: Damien Le Moal Date: Wed Jun 1 15:25:43 2022 +0900 scsi: sd: Fix potential NULL pointer dereference If sd_probe() sees an early error before sdkp->device is initialized, sd_zbc_release_disk() is called. This causes a NULL pointer dereference when sd_is_zoned() is called inside that function. Avoid this by removing the call to sd_zbc_release_disk() in sd_probe() error path. This change is safe and does not result in zone information memory leakage because the zone information for a zoned disk is allocated only when sd_revalidate_disk() is called, at which point sdkp->disk_dev is fully set, resulting in sd_disk_release() being called when needed to cleanup a disk zone information using sd_zbc_release_disk(). Link: https://lore.kernel.org/r/20220601062544.905141-2-damien.lemoal@opensource.wdc.com Fixes: 89d947561077 ("sd: Implement support for ZBC devices") Reported-by: Dongliang Mu Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 4094981db7b6ed6ebe3ebe398d8d9136ac5c44c8 Author: Sumit Saxena Date: Thu May 26 13:01:57 2022 -0400 scsi: mpi3mr: Rework mrioc->bsg_device model to fix warnings During driver unload, mrioc->bsg_device reference count becomes negative. Also, as reported in [1], the driver's bsg_device model had few more bugs. Fix all these up. [1] https://marc.info/?l=linux-scsi&m=165183971411991&w=2 Link: https://lore.kernel.org/r/20220526170157.58274-1-sumit.saxena@broadcom.com Fixes: 4268fa751365 ("scsi: mpi3mr: Add bsg device support") Reported-by: Dan Carpenter Tested-by: Tomas Henzl Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 77d707a310fa908d796d00e6c26b650cf2b4442f Author: Palmer Dabbelt Date: Thu Apr 21 10:03:55 2022 -0700 RISC-V: Only default to spinwait on SBI-0.1 and M-mode The spinwait boot method has been superseded by the SBI HSM extension for some time now, but it still enabled by default. This causes some issues on large hart count systems, which will hang if a physical hart exists that is larger than NR_CPUS. Users on modern SBI implementation don't need spinwait, and while it's probably possible to deal with some of the spinwait issues let's just restrict the default to systems that are likely to actually use it. Signed-off-by: Palmer Dabbelt Reviewed-by: Atish Patra Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20220421170354.10555-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 2981deb83de2b94947086a992b961b2339988a71 Merge: 35b51afd23c98 df403b7c95aaa Author: Palmer Dabbelt Date: Wed Jun 1 18:34:02 2022 -0700 RISC-V: PolarFire SoC Device Tree Updates This add a device tree for Sundance Polarberry, along with various cleanups to the PolarFire SOC device trees and bindings. Link: https://lore.kernel.org/r/20220509142610.128590-1-conor.dooley@microchip.com * 'riscv-pfsoc-dt' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/palmer/linux: riscv: dts: icicle: sort nodes alphabetically riscv: microchip: icicle: readability fixes riscv: dts: microchip: add the sundance polarberry dt-bindings: riscv: microchip: add polarberry compatible string dt-bindings: vendor-prefixes: add Sundance DSP riscv: dts: microchip: make the fabric dtsi board specific dt-bindings: riscv: microchip: document icicle reference design riscv: dts: microchip: remove soc vendor from filenames riscv: dts: microchip: move sysctrlr out of soc bus riscv: dts: microchip: remove icicle memory clocks commit d1dc87763f406d4e67caf16dbe438a5647692395 Author: Stephen Brennan Date: Thu May 19 09:50:30 2022 +0100 assoc_array: Fix BUG_ON during garbage collect A rare BUG_ON triggered in assoc_array_gc: [3430308.818153] kernel BUG at lib/assoc_array.c:1609! Which corresponded to the statement currently at line 1593 upstream: BUG_ON(assoc_array_ptr_is_meta(p)); Using the data from the core dump, I was able to generate a userspace reproducer[1] and determine the cause of the bug. [1]: https://github.com/brenns10/kernel_stuff/tree/master/assoc_array_gc After running the iterator on the entire branch, an internal tree node looked like the following: NODE (nr_leaves_on_branch: 3) SLOT [0] NODE (2 leaves) SLOT [1] NODE (1 leaf) SLOT [2..f] NODE (empty) In the userspace reproducer, the pr_devel output when compressing this node was: -- compress node 0x5607cc089380 -- free=0, leaves=0 [0] retain node 2/1 [nx 0] [1] fold node 1/1 [nx 0] [2] fold node 0/1 [nx 2] [3] fold node 0/2 [nx 2] [4] fold node 0/3 [nx 2] [5] fold node 0/4 [nx 2] [6] fold node 0/5 [nx 2] [7] fold node 0/6 [nx 2] [8] fold node 0/7 [nx 2] [9] fold node 0/8 [nx 2] [10] fold node 0/9 [nx 2] [11] fold node 0/10 [nx 2] [12] fold node 0/11 [nx 2] [13] fold node 0/12 [nx 2] [14] fold node 0/13 [nx 2] [15] fold node 0/14 [nx 2] after: 3 At slot 0, an internal node with 2 leaves could not be folded into the node, because there was only one available slot (slot 0). Thus, the internal node was retained. At slot 1, the node had one leaf, and was able to be folded in successfully. The remaining nodes had no leaves, and so were removed. By the end of the compression stage, there were 14 free slots, and only 3 leaf nodes. The tree was ascended and then its parent node was compressed. When this node was seen, it could not be folded, due to the internal node it contained. The invariant for compression in this function is: whenever nr_leaves_on_branch < ASSOC_ARRAY_FAN_OUT, the node should contain all leaf nodes. The compression step currently cannot guarantee this, given the corner case shown above. To fix this issue, retry compression whenever we have retained a node, and yet nr_leaves_on_branch < ASSOC_ARRAY_FAN_OUT. This second compression will then allow the node in slot 1 to be folded in, satisfying the invariant. Below is the output of the reproducer once the fix is applied: -- compress node 0x560e9c562380 -- free=0, leaves=0 [0] retain node 2/1 [nx 0] [1] fold node 1/1 [nx 0] [2] fold node 0/1 [nx 2] [3] fold node 0/2 [nx 2] [4] fold node 0/3 [nx 2] [5] fold node 0/4 [nx 2] [6] fold node 0/5 [nx 2] [7] fold node 0/6 [nx 2] [8] fold node 0/7 [nx 2] [9] fold node 0/8 [nx 2] [10] fold node 0/9 [nx 2] [11] fold node 0/10 [nx 2] [12] fold node 0/11 [nx 2] [13] fold node 0/12 [nx 2] [14] fold node 0/13 [nx 2] [15] fold node 0/14 [nx 2] internal nodes remain despite enough space, retrying -- compress node 0x560e9c562380 -- free=14, leaves=1 [0] fold node 2/15 [nx 0] after: 3 Changes ======= DH: - Use false instead of 0. - Reorder the inserted lines in a couple of places to put retained before next_slot. ver #2) - Fix typo in pr_devel, correct comparison to "<=" Fixes: 3cb989501c26 ("Add a generic associative array implementation.") Cc: Signed-off-by: Stephen Brennan Signed-off-by: David Howells cc: Andrew Morton cc: keyrings@vger.kernel.org Link: https://lore.kernel.org/r/20220511225517.407935-1-stephen.s.brennan@oracle.com/ # v1 Link: https://lore.kernel.org/r/20220512215045.489140-1-stephen.s.brennan@oracle.com/ # v2 Reviewed-by: Jarkko Sakkinen Signed-off-by: Linus Torvalds commit 9f4fc18bf285f20c1498f8fcfb586fa70a070fb5 Author: Slark Xiao Date: Wed Jun 1 12:05:31 2022 +0800 net: usb: qmi_wwan: Add support for Cinterion MV31 with new baseline Adding support for Cinterion device MV31 with Qualcomm new baseline. Use different PIDs to separate it from previous base line products. All interfaces settings keep same as previous. T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1e2d ProdID=00b9 Rev=04.14 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00B9 USB Mobile Broadband S: SerialNumber=90418e79 C: #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option Signed-off-by: Slark Xiao Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/20220601040531.6016-1-slark_xiao@163.com Signed-off-by: Jakub Kicinski commit c034ff2b53cf5add27c121d536864a00f0257700 Merge: 11049c9e71f38 1c5de097bea31 Author: Jakub Kicinski Date: Wed Jun 1 18:04:40 2022 -0700 Merge tag 'mlx5-fixes-2022-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-05-31 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. * tag 'mlx5-fixes-2022-05-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: Fix mlx5_get_next_dev() peer device matching net/mlx5e: Update netdev features after changing XDP state net/mlx5: correct ECE offset in query qp output net/mlx5e: Disable softirq in mlx5e_activate_rq to avoid race condition net/mlx5: CT: Fix header-rewrite re-use for tupels net/mlx5e: TC NIC mode, fix tc chains miss table net/mlx5: Don't use already freed action pointer ==================== Link: https://lore.kernel.org/r/20220531205447.99236-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 11049c9e71f38416f5b5d31ac2c51ac08c394698 Merge: 2440d2068a751 25bde571b4a83 Author: Jakub Kicinski Date: Wed Jun 1 17:47:19 2022 -0700 Merge branch 'sfc-siena-fix-some-efx_separate_tx_channels-errors' Íñigo Huguet says: ==================== sfc/siena: fix some efx_separate_tx_channels errors Trying to load sfc driver with modparam efx_separate_tx_channels=1 resulted in errors during initialization and not being able to use the NIC. This patches fix a few bugs and make it work again. This has been already done for sfc, do it also for sfc_siena. ==================== Link: https://lore.kernel.org/r/20220601063603.15362-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski commit 25bde571b4a83a73bb37beacb833bbd9c38b43c6 Author: Íñigo Huguet Date: Wed Jun 1 08:36:03 2022 +0200 sfc/siena: fix wrong tx channel offset with efx_separate_tx_channels tx_channel_offset is calculated in efx_allocate_msix_channels, but it is also calculated again in efx_set_channels because it was originally done there, and when efx_allocate_msix_channels was introduced it was forgotten to be removed from efx_set_channels. Moreover, the old calculation is wrong when using efx_separate_tx_channels because now we can have XDP channels after the TX channels, so n_channels - n_tx_channels doesn't point to the first TX channel. Remove the old calculation from efx_set_channels, and add the initialization of this variable if MSI or legacy interrupts are used, next to the initialization of the rest of the related variables, where it was missing. This has been already done for sfc, do it also for sfc_siena. Fixes: 3990a8fffbda ("sfc: allocate channels for XDP tx queues") Reported-by: Tianhao Zhao Signed-off-by: Íñigo Huguet Acked-by: Martin Habets Signed-off-by: Jakub Kicinski commit 183614bff5fc1682240ab7604201e18afb118092 Author: Martin Habets Date: Wed Jun 1 08:36:02 2022 +0200 sfc/siena: fix considering that all channels have TX queues Normally, all channels have RX and TX queues, but this is not true if modparam efx_separate_tx_channels=1 is used. In that cases, some channels only have RX queues and others only TX queues (or more preciselly, they have them allocated, but not initialized). Fix efx_channel_has_tx_queues to return the correct value for this case too. This has been already done for sfc, do it also for sfc_siena. Messages shown at probe time before the fix: sfc 0000:03:00.0 ens6f0np0: MC command 0x82 inlen 544 failed rc=-22 (raw=0) arg=0 ------------[ cut here ]------------ netdevice: ens6f0np0: failed to initialise TXQ -1 WARNING: CPU: 1 PID: 626 at drivers/net/ethernet/sfc/ef10.c:2393 efx_ef10_tx_init+0x201/0x300 [sfc] [...] stripped RIP: 0010:efx_ef10_tx_init+0x201/0x300 [sfc] [...] stripped Call Trace: efx_init_tx_queue+0xaa/0xf0 [sfc] efx_start_channels+0x49/0x120 [sfc] efx_start_all+0x1f8/0x430 [sfc] efx_net_open+0x5a/0xe0 [sfc] __dev_open+0xd0/0x190 __dev_change_flags+0x1b3/0x220 dev_change_flags+0x21/0x60 [...] stripped Messages shown at remove time before the fix: sfc 0000:03:00.0 ens6f0np0: failed to flush 10 queues sfc 0000:03:00.0 ens6f0np0: failed to flush queues Fixes: 8700aff08984 ("sfc: fix channel allocation with brute force") Reported-by: Tianhao Zhao Signed-off-by: Martin Habets Tested-by: Íñigo Huguet Signed-off-by: Jakub Kicinski commit 2440d2068a7517f60003b0e12e5fadcebd14cda3 Merge: 38a4762e4ba61 6821ad8770340 Author: Jakub Kicinski Date: Wed Jun 1 17:44:03 2022 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== ipsec 2022-06-01 1) Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" From Michal Kubecek. 2) Don't set IPv4 DF bit when encapsulating IPv6 frames below 1280 bytes. From Maciej Żenczykowski. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec: xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes. Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" ==================== Link: https://lore.kernel.org/r/20220601103349.2297361-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski commit 38a4762e4ba61e848c61a3b9eaa8f83cbed07b2d Merge: 8d3398ba2a0d1 2965c4cdf7ad9 Author: Jakub Kicinski Date: Wed Jun 1 17:34:22 2022 -0700 Merge tag 'wireless-2022-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v5.19 First set of fixes for v5.19. Build fixes for iwlwifi and libertas, a scheduling while atomic fix for rtw88 and use-after-free fix for mac80211. * tag 'wireless-2022-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: fix use-after-free in chanctx code wifi: rtw88: add a work to correct atomic scheduling warning of ::set_tim wifi: iwlwifi: pcie: rename CAUSE macro wifi: libertas: use variable-size data in assoc req/resp cmd ==================== Link: https://lore.kernel.org/r/20220601110741.90B28C385A5@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 0e5ab8dd87c29640a46aee9e38bc3ba7645b1db0 Merge: 54eb8462f21fb 7146bda743e6f Author: Linus Torvalds Date: Wed Jun 1 17:23:53 2022 -0700 Merge tag 'xfs-5.19-for-linus-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull more xfs updates from Dave Chinner: "This update is largely bug fixes and cleanups for all the code merged in the first pull request. The majority of them are to the new logged attribute code, but there are also a couple of fixes for other log recovery and memory leaks that have recently been found. Summary: - fix refcount leak in xfs_ifree() - fix xfs_buf_cancel structure leaks in log recovery - fix dquot leak after failed quota check - fix a couple of problematic ASSERTS - fix small aim7 perf regression in from new btree sibling validation - clean up log incompat feature marking for new logged attribute feature - disallow logged attributes on legacy V4 filesystem formats. - fix da state leak when freeing attr intents - improve validation of the attr log items in recovery - use slab caches for commonly used attr structures - fix leaks of attr name/value buffer and reduce copying overhead during intent logging - remove some dead debug code from log recovery" * tag 'xfs-5.19-for-linus-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (33 commits) xfs: fix xfs_ifree() error handling to not leak perag ref xfs: move xfs_attr_use_log_assist usage out of libxfs xfs: move xfs_attr_use_log_assist out of xfs_log.c xfs: warn about LARP once per mount xfs: implement per-mount warnings for scrub and shrink usage xfs: don't log every time we clear the log incompat flags xfs: convert buf_cancel_table allocation to kmalloc_array xfs: don't leak xfs_buf_cancel structures when recovery fails xfs: refactor buffer cancellation table allocation xfs: don't leak btree cursor when insrec fails after a split xfs: purge dquots after inode walk fails during quotacheck xfs: assert in xfs_btree_del_cursor should take into account error xfs: don't assert fail on perag references on teardown xfs: avoid unnecessary runtime sibling pointer endian conversions xfs: share xattr name and value buffers when logging xattr updates xfs: do not use logged xattr updates on V4 filesystems xfs: Remove duplicate include xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO xfs: Remove dead code xfs: fix typo in comment ... commit 036d20726c30267724416e966c9f92db07de8081 Author: Rob Clark Date: Tue May 31 13:08:56 2022 -0700 drm/msm: Ensure mmap offset is initialized If a GEM object is allocated, and then exported as a dma-buf fd which is mmap'd before or without the GEM buffer being directly mmap'd, the vma_node could be unitialized. This leads to a situation where the CPU mapping is not correctly torn down in drm_vma_node_unmap(). Fixes: e5516553999f ("drm: call drm_gem_object_funcs.mmap with fake offset") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220531200857.136547-1-robdclark@gmail.com commit af0f2a8cc3977e08e79a096f0c2c7a5be29b130b Merge: 1a5409facf9ce b9364eed9232f Author: Rob Clark Date: Wed Jun 1 17:12:50 2022 -0700 Merge tag 'msm-next-5.19-fixes-06-01' of https://gitlab.freedesktop.org/abhinavk/msm into msm-fixes-staging 5.19 fixes for msm-next - Fix to add minimum ICC vote in the msm_mdss pm_resume path to address bootup splats - Fix to avoid dereferencing without checking in WB encoder - Fix to avoid crash during suspend in DP driver by ensuring interrupt mask bits are updated - Remove unused code from dpu_encoder_virt_atomic_check() - Fix to remove redundant init of dsc variable Signed-off-by: Rob Clark commit 8d3398ba2a0d1e25690f830192b7834acab003ec Author: Tobias Klauser Date: Tue May 31 11:43:45 2022 +0200 socket: Don't use u8 type in uapi socket.h Use plain 255 instead, which also avoid introducing an additional header dependency on Fixes: 26859240e4ee ("txhash: Add socket option to control TX hash rethink behavior") Signed-off-by: Tobias Klauser Link: https://lore.kernel.org/r/20220531094345.13801-1-tklauser@distanz.ch Signed-off-by: Jakub Kicinski commit b9364eed9232f3d2a846f68c2307eb25c93cc2d0 Author: Douglas Anderson Date: Tue May 31 16:01:26 2022 -0700 drm/msm/dpu: Move min BW request and full BW disable back to mdss In commit a670ff578f1f ("drm/msm/dpu: always use mdp device to scale bandwidth") we fully moved interconnect stuff to the DPU driver. This had no change for sc7180 but _did_ have an impact for other SoCs. It made them match the sc7180 scheme. Unfortunately, the sc7180 scheme seems like it was a bit broken. Specifically the interconnect needs to be on for more than just the DPU driver's AXI bus. In the very least it also needs to be on for the DSI driver's AXI bus. This can be seen fairly easily by doing this on a ChromeOS sc7180-trogdor class device: set_power_policy --ac_screen_dim_delay=5 --ac_screen_off_delay=10 sleep 10 cd /sys/bus/platform/devices/ae94000.dsi/power echo on > control When you do that, you'll get a warning splat in the logs about "gcc_disp_hf_axi_clk status stuck at 'off'". One could argue that perhaps what I have done above is "illegal" and that it can't happen naturally in the system because in normal system usage the DPU is pretty much always on when DSI is on. That being said: * In official ChromeOS builds (admittedly a 5.4 kernel with backports) we have seen that splat at bootup. * Even though we don't use "autosuspend" for these components, we don't use the "put_sync" variants. Thus plausibly the DSI could stay "runtime enabled" past when the DPU is enabled. Techncially we shouldn't do that if the DPU's suspend ends up yanking our clock. Let's change things such that the "bare minimum" request for the interconnect happens in the mdss driver again. That means that all of the children can assume that the interconnect is on at the minimum bandwidth. We'll then let the DPU request the higher amount that it wants. It should be noted that this isn't as hacky of a solution as it might initially appear. Specifically: * Since MDSS and DPU individually get their own references to the interconnect then the framework will actually handle aggregating them. The two drivers are _not_ clobbering each other. * When the Qualcomm interconnect driver aggregates it takes the max of all the peaks. Thus having MDSS request a peak, as we're doing here, won't actually change the total interconnect bandwidth (it won't be added to the request for the DPU). This perhaps explains why the "average" requested in MDSS was historically 0 since that one _would_ be added in. NOTE also that in the downstream ChromeOS 5.4 and 5.15 kernels, we're also seeing some RPMH hangs that are addressed by this fix. These hangs are showing up in the field and on _some_ devices with enough stress testing of suspend/resume. Specifically right at suspend time with a stack crawl that looks like this (from chromeos-5.15 tree): rpmh_write_batch+0x19c/0x240 qcom_icc_bcm_voter_commit+0x210/0x420 qcom_icc_set+0x28/0x38 apply_constraints+0x70/0xa4 icc_set_bw+0x150/0x24c dpu_runtime_resume+0x50/0x1c4 pm_generic_runtime_resume+0x30/0x44 __genpd_runtime_resume+0x68/0x7c genpd_runtime_resume+0x12c/0x20c __rpm_callback+0x98/0x138 rpm_callback+0x30/0x88 rpm_resume+0x370/0x4a0 __pm_runtime_resume+0x80/0xb0 dpu_kms_enable_commit+0x24/0x30 msm_atomic_commit_tail+0x12c/0x630 commit_tail+0xac/0x150 drm_atomic_helper_commit+0x114/0x11c drm_atomic_commit+0x68/0x78 drm_atomic_helper_disable_all+0x158/0x1c8 drm_atomic_helper_suspend+0xc0/0x1c0 drm_mode_config_helper_suspend+0x2c/0x60 msm_pm_prepare+0x2c/0x40 pm_generic_prepare+0x30/0x44 genpd_prepare+0x80/0xd0 device_prepare+0x78/0x17c dpm_prepare+0xb0/0x384 dpm_suspend_start+0x34/0xc0 We don't completely understand all the mechanisms in play, but the hang seemed to come and go with random factors. It's not terribly surprising that the hang is gone after this patch since the line of code that was failing is no longer present in the kernel. Fixes: a670ff578f1f ("drm/msm/dpu: always use mdp device to scale bandwidth") Fixes: c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display") Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar Tested-by: Jessica Zhang # RB3 (sdm845) and Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/487884/ Link: https://lore.kernel.org/r/20220531160059.v2.1.Ie7f6d4bf8cce28131da31a43354727e417cae98d@changeid Signed-off-by: Abhinav Kumar commit 8caad14e722477807e9324fe0e85dd10151fb134 Author: Haowen Bai Date: Mon May 30 10:19:55 2022 +0800 drm/msm/dpu: Fix pointer dereferenced before checking The phys_enc->wb_idx is dereferencing before null checking, so move it after checking. Signed-off-by: Haowen Bai Reviewed-by: Dmitry Baryshkov Fixes: d7d0e73f7de33 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/487606/ Link: https://lore.kernel.org/r/1653877196-23114-1-git-send-email-baihaowen@meizu.com Signed-off-by: Abhinav Kumar commit fb0af2daaa04d69b9e66613b8721d23d41f387f6 Author: Jiapeng Chong Date: Tue May 24 16:14:13 2022 +0800 drm/msm/dpu: Remove unused code Eliminate the follow clang warning: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:544:33: warning: variable ‘mode’ set but not used [-Wunused-but-set-variable]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Fixes: 3177589c6e93("drm/msm/dpu: encoder: drop unused mode_fixup callback") Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/487136/ Link: https://lore.kernel.org/r/20220524081413.37895-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Abhinav Kumar commit 6daf7e4aa91e05b3e138805613686fb5c46d8196 Author: Vinod Koul Date: Wed May 25 13:09:12 2022 +0530 drm/msm/disp/dpu1: remove superfluous init Commit 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder") added dsc_common_mode variable which was set to zero but then again programmed, so drop the superfluous init. Fixes: 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder") Reported-by: kernel test robot Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/487208/ Link: https://lore.kernel.org/r/20220525073912.2706505-1-vkoul@kernel.org Signed-off-by: Abhinav Kumar commit 993a2adc6e2e94a0a7b5bfc054eda90ac95f62c3 Author: Kuogee Hsieh Date: Tue May 17 09:21:34 2022 -0700 drm/msm/dp: Always clear mask bits to disable interrupts at dp_ctrl_reset_irq_ctrl() dp_catalog_ctrl_reset() will software reset DP controller. But it will not reset programmable registers to default value. DP driver still have to clear mask bits to interrupt status registers to disable interrupts after software reset of controller. At current implementation, dp_ctrl_reset_irq_ctrl() will software reset dp controller but did not call dp_catalog_ctrl_enable_irq(false) to clear hpd related interrupt mask bits to disable hpd related interrupts due to it mistakenly think hpd related interrupt mask bits will be cleared by software reset of dp controller automatically. This mistake may cause system to crash during suspending procedure due to unexpected irq fired and trigger event thread to access dp controller registers with controller clocks are disabled. This patch fixes system crash during suspending problem by removing "enable" flag condition checking at dp_ctrl_reset_irq_ctrl() so that hpd related interrupt mask bits are cleared to prevent unexpected from happening. Changes in v2: -- add more details commit text Changes in v3: -- add synchrons_irq() -- add atomic_t suspended Changes in v4: -- correct Fixes's commit ID -- remove synchrons_irq() Changes in v5: -- revise commit text Changes in v6: -- add event_lock to protect "suspended" Changes in v7: -- delete "suspended" flag Fixes: 989ebe7bc446 ("drm/msm/dp: do not initialize phy until plugin interrupt received") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/486591/ Link: https://lore.kernel.org/r/1652804494-19650-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Abhinav Kumar commit a19cad0691597eb79c123b8a19a9faba5ab7d90e Author: Andrew Morton Date: Wed Jun 1 15:57:16 2022 -0700 mm/oom_kill.c: fix vm_oom_kill_table[] ifdeffery arm allnoconfig: mm/oom_kill.c:60:25: warning: 'vm_oom_kill_table' defined but not used [-Wunused-variable] 60 | static struct ctl_table vm_oom_kill_table[] = { | ^~~~~~~~~~~~~~~~~ Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit b3e34a47f98974d0844444c5121aaff123004e57 Author: Baoquan He Date: Wed Feb 23 19:32:24 2022 +0800 x86/kexec: fix memory leak of elf header buffer This is reported by kmemleak detector: unreferenced object 0xffffc900002a9000 (size 4096): comm "kexec", pid 14950, jiffies 4295110793 (age 373.951s) hex dump (first 32 bytes): 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 .ELF............ 04 00 3e 00 01 00 00 00 00 00 00 00 00 00 00 00 ..>............. backtrace: [<0000000016a8ef9f>] __vmalloc_node_range+0x101/0x170 [<000000002b66b6c0>] __vmalloc_node+0xb4/0x160 [<00000000ad40107d>] crash_prepare_elf64_headers+0x8e/0xcd0 [<0000000019afff23>] crash_load_segments+0x260/0x470 [<0000000019ebe95c>] bzImage64_load+0x814/0xad0 [<0000000093e16b05>] arch_kexec_kernel_image_load+0x1be/0x2a0 [<000000009ef2fc88>] kimage_file_alloc_init+0x2ec/0x5a0 [<0000000038f5a97a>] __do_sys_kexec_file_load+0x28d/0x530 [<0000000087c19992>] do_syscall_64+0x3b/0x90 [<0000000066e063a4>] entry_SYSCALL_64_after_hwframe+0x44/0xae In crash_prepare_elf64_headers(), a buffer is allocated via vmalloc() to store elf headers. While it's not freed back to system correctly when kdump kernel is reloaded or unloaded. Then memory leak is caused. Fix it by introducing x86 specific function arch_kimage_file_post_load_cleanup(), and freeing the buffer there. And also remove the incorrect elf header buffer freeing code. Before calling arch specific kexec_file loading function, the image instance has been initialized. So 'image->elf_headers' must be NULL. It doesn't make sense to free the elf header buffer in the place. Three different people have reported three bugs about the memory leak on x86_64 inside Redhat. Link: https://lkml.kernel.org/r/20220223113225.63106-2-bhe@redhat.com Signed-off-by: Baoquan He Acked-by: Dave Young Cc: Signed-off-by: Andrew Morton commit a04e1928e2ead144dc2f369768bc0a0f3110af89 Author: Miaohe Lin Date: Tue May 31 20:26:43 2022 +0800 mm/memremap: fix missing call to untrack_pfn() in pagemap_range() We forget to call untrack_pfn() to pair with track_pfn_remap() when range is not allowed to hotplug. Fix it by jump err_kasan. Link: https://lkml.kernel.org/r/20220531122643.25249-1-linmiaohe@huawei.com Fixes: bca3feaa0764 ("mm/memory_hotplug: prevalidate the address range being added with platform") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Acked-by: Muchun Song Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton commit 547be963c99f1e9ebc1cfabf630f64601a98dd00 Author: Zi Yan Date: Mon May 30 22:44:50 2022 -0400 mm: page_isolation: use compound_nr() correctly in isolate_single_pageblock() When compound_nr(page) was used, page was not guaranteed to be the head of the compound page and it could cause an infinite loop. Fix it by calling it on the head page. Link: https://lkml.kernel.org/r/20220531024450.2498431-1-zi.yan@sent.com Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity") Signed-off-by: Zi Yan Reported-by: Anshuman Khandual Link: https://lore.kernel.org/linux-mm/20220530115027.123341-1-anshuman.khandual@arm.com/ Reviewed-by: Anshuman Khandual Reviewed-by: Miaohe Lin Reviewed-by: Oscar Salvador Acked-by: Muchun Song Cc: David Hildenbrand Cc: Qian Cai Cc: Vlastimil Babka Cc: Mel Gorman Cc: Eric Ren Cc: Mike Rapoport Cc: Christophe Leroy Signed-off-by: Andrew Morton commit 0111def915b280c64c05f73f01b59ca404255aa3 Author: Muchun Song Date: Fri May 27 16:19:48 2022 +0800 mm: hugetlb_vmemmap: fix CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON The following: commit 47010c040dec ("mm: hugetlb_vmemmap: cleanup CONFIG_HUGETLB_PAGE_FREE_VMEMMAP*") forgot to update CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON used in vmemmap_optimize_mode to CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON. The result is we cannot enable hugetlb_optimize_vmemmap at boot time when we configure CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON. Fix it. Link: https://lkml.kernel.org/r/20220527081948.68832-1-songmuchun@bytedance.com Fixes: 47010c040dec ("mm: hugetlb_vmemmap: cleanup CONFIG_HUGETLB_PAGE_FREE_VMEMMAP*") Signed-off-by: Muchun Song Reported-by: Vlastimil Babka Acked-by: Vlastimil Babka Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 273aea955ece88a14664fa1cbff5542f05ab0a29 Author: Miaohe Lin Date: Mon May 30 19:45:05 2022 +0800 MAINTAINERS: add maintainer information for z3fold Add the maintainer information for the z3fold compressed page allocator. Also Add myself as a reviewer. Link: https://lkml.kernel.org/r/20220530114505.52367-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 1ff810c16d651547fd1781a0b8b29cab547152b2 Author: Josh Poimboeuf Date: Fri May 27 13:18:52 2022 -0700 mailmap: update Josh Poimboeuf's email I recently switched to my kernel.org email address. Add aliases for my previous Red Hat and IBM addresses. Link: https://lkml.kernel.org/r/0519dcfbb1ee2cb82cb32b0aff61410a62949aa5.1653682698.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf Suggested-by: Nick Desaulniers Signed-off-by: Andrew Morton commit 662ce1dc9caf493c309200edbe38d186f1ea20d0 Author: Yang Yang Date: Wed Jun 1 15:55:25 2022 -0700 delayacct: track delays from write-protect copy Delay accounting does not track the delay of write-protect copy. When tasks trigger many write-protect copys(include COW and unsharing of anonymous pages[1]), it may spend a amount of time waiting for them. To get the delay of tasks in write-protect copy, could help users to evaluate the impact of using KSM or fork() or GUP. Also update tools/accounting/getdelays.c: / # ./getdelays -dl -p 231 print delayacct stats ON listen forever PID 231 CPU count real total virtual total delay total delay average 6247 1859000000 2154070021 1674255063 0.268ms IO count delay total delay average 0 0 0ms SWAP count delay total delay average 0 0 0ms RECLAIM count delay total delay average 0 0 0ms THRASHING count delay total delay average 0 0 0ms COMPACT count delay total delay average 3 72758 0ms WPCOPY count delay total delay average 3635 271567604 0ms [1] commit 31cc5bc4af70("mm: support GUP-triggered unsharing of anonymous pages") Link: https://lkml.kernel.org/r/20220409014342.2505532-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reviewed-by: David Hildenbrand Reviewed-by: Jiang Xuexin Reviewed-by: Ran Xiaokai Reviewed-by: wangyong Cc: Jonathan Corbet Cc: Balbir Singh Cc: Mike Kravetz Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit df403b7c95aaaff3689ecb254c443967badca9ac Author: Conor Dooley Date: Mon May 9 15:26:11 2022 +0100 riscv: dts: icicle: sort nodes alphabetically The icicle device tree is in a "random" order, so clean it up and sort its elements alphabetically to match the newly added PolarBerry dts. Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220509142610.128590-11-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 1bcea0303ff32d0d1671226d77dc837eef1a93c9 Author: Conor Dooley Date: Mon May 9 15:26:10 2022 +0100 riscv: microchip: icicle: readability fixes Fix the sort order of the status properties, remove some extra whitespace in the mmc entry & add whitespace to the mac entry containing the phys so that the dt is easier to read. Signed-off-by: Conor Dooley Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220509142610.128590-10-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit bc47b2217f246ed0bf0305dd7572f76fc8a3b85c Author: Conor Dooley Date: Mon May 9 15:26:09 2022 +0100 riscv: dts: microchip: add the sundance polarberry Add a minimal device tree for the PolarFire SoC based Sundance PolarBerry. Reviewed-by: Heiko Stuebner Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-9-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit b847d32ae7c3c49111e98419ef2a5a65d9e1f51f Author: Conor Dooley Date: Mon May 9 15:26:08 2022 +0100 dt-bindings: riscv: microchip: add polarberry compatible string Add a binding for the Sundance Polarberry board. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-8-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 83b8b2a464965ef40d59c61229e6bdc1844d0706 Author: Conor Dooley Date: Mon May 9 15:26:07 2022 +0100 dt-bindings: vendor-prefixes: add Sundance DSP Sundance DSP Inc. (https://www.sundancedsp.com/) is a supplier of high-performance DSP and FPGA processor boards and I/O modules. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-7-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 1277b19506f8aa88a7b78f6b1ed66749c1ecc58a Author: Conor Dooley Date: Mon May 9 15:26:06 2022 +0100 riscv: dts: microchip: make the fabric dtsi board specific Currently mpfs-fabric.dtsi is included by mpfs.dtsi - which is fine currently since there is only one board with this SoC upstream. However if another board was added, it would include the fabric contents of the Icicle Kit's reference design. To avoid this, rename mpfs-fabric.dtsi to mpfs-icicle-kit-fabric.dtsi & include it in the dts rather than mpfs.dtsi. mpfs-icicle-kit-fabric.dtsi specifically matches the 22.03 reference design for the icicle kit's FPGA fabric & an older version of the design may not have the i2c or pwm devices - so add the compatible string to document this. Reviewed-by: Heiko Stuebner Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-6-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit e8c81d649abc3fa02a7063c27a42b6e214a67362 Author: Conor Dooley Date: Mon May 9 15:26:05 2022 +0100 dt-bindings: riscv: microchip: document icicle reference design Add a compatible for the icicle kit's reference design. This represents the FPGA fabric's contents & is versioned to denote which release of the reference design it applies to. Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220509142610.128590-5-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit da305fa8a9a6c44a0216d7ed30b2f8e91b6aa245 Author: Conor Dooley Date: Mon May 9 15:26:04 2022 +0100 riscv: dts: microchip: remove soc vendor from filenames Having the SoC vendor both as the directory and in the filename adds little. Remove microchip from the filenames so that the files will resemble the other directories in riscv (and arm64). The new names follow a soc-board.dts & soc{,-fabric}.dtsi pattern. Reviewed-by: Heiko Stuebner Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-4-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 9499e76de5d5ab46b246764f41090074f1c68cfe Author: Conor Dooley Date: Mon May 9 15:26:03 2022 +0100 riscv: dts: microchip: move sysctrlr out of soc bus The MPFS system controller has no registers of its own, so move it out of the soc node to avoid dtbs_check warnings: arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: soc: syscontroller: {'compatible': ['microchip,mpfs-sys-controller'], 'mboxes': [[15, 0]], 'status': ['okay']} should not be valid under {'type': 'object'} Reported-by: Palmer Dabbelt Suggested-by: Rob Herring Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree") Reviewed-by: Heiko Stuebner Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-3-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 8422d1110ad445afd2083547181ff1be3a56f165 Author: Conor Dooley Date: Mon May 9 15:26:02 2022 +0100 riscv: dts: microchip: remove icicle memory clocks The clock properties in the icicle kit's memory entries cause dtbs_check errors: arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dtb: /: memory@80000000: 'clocks' does not match any of the regexes: 'pinctrl-[0-9]+' Get rid of the clocks to avoid the errors. Reported-by: Palmer Dabbelt Fixes: 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board") Fixes: 5b28df37d311 ("riscv: dts: microchip: update peripherals in icicle kit device tree") Reviewed-by: Heiko Stuebner Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220509142610.128590-2-conor.dooley@microchip.com Signed-off-by: Palmer Dabbelt commit 54eb8462f21fb170a05ad64620f0d8d0cf2b7fb5 Merge: 55fe921790584 f78e3d407a339 Author: Linus Torvalds Date: Wed Jun 1 14:48:13 2022 -0700 Merge tag 'rtc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "A new driver represents the bulk of the changes and then we get the usual small fixes. New driver: - Renesas RZN1 rtc Drivers: - sun6i: Add nvmem support" * tag 'rtc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: mxc: Silence a clang warning rtc: rzn1: Fix a variable type rtc: rzn1: Fix error code in probe rtc: rzn1: Avoid mixing variables rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe rtc: mt6397: check return value after calling platform_get_resource() rtc: rzn1: fix platform_no_drv_owner.cocci warning rtc: gamecube: Add missing iounmap in gamecube_rtc_read_offset_from_sram rtc: meson: Fix email address in MODULE_AUTHOR rtc: simplify the return expression of rx8025_set_offset() rtc: pcf85063: Add a compatible entry for pca85073a dt-binding: pcf85063: Add an entry for pca85073a MAINTAINERS: Add myself as maintainer of the RZN1 RTC driver rtc: rzn1: Add oscillator offset support rtc: rzn1: Add alarm support rtc: rzn1: Add new RTC driver dt-bindings: rtc: rzn1: Describe the RZN1 RTC rtc: sun6i: Add NVMEM provider commit 55fe92179058406fe00bff2167c94443a7b2e07a Merge: fa78526accfd6 66ed42caf286a Author: Linus Torvalds Date: Wed Jun 1 14:44:01 2022 -0700 Merge tag 'i3c/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: "Only clean ups and no functional change this cycle. A couple of yaml conversions of the DT bindings, and a couple of code cleanups" * tag 'i3c/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: MAINTAINERS: rectify entries for some i3c drivers after dt conversion i3c: master: svc: fix returnvar.cocci warning i3c/master: simplify the return expression of i3c_hci_remove() dt-bindings: i3c: Convert snps,dw-i3c-master to DT schema dt-bindings: i3c: Convert cdns,i3c-master to DT schema commit fa78526accfd68966fb50a429439e9085f9c88d6 Merge: c7993147519ca 4caae58406f8c Author: Linus Torvalds Date: Wed Jun 1 14:25:04 2022 -0700 Merge tag 'for-5.19/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix DM core's dm_table_supports_poll to return false if target has no data devices. - Fix DM verity target so that it cannot be switched to a different DM target type (e.g. dm-linear) via DM table reload. * tag 'for-5.19/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm verity: set DM_TARGET_IMMUTABLE feature flag dm table: fix dm_table_supports_poll to return false if no data devices commit f78e3d407a339ffdd2620140300f821ea41118f4 Author: Fabio Estevam Date: Wed May 25 22:14:59 2022 -0300 rtc: mxc: Silence a clang warning Change the of_device_get_match_data() cast to (uintptr_t) to silence the following clang warning: drivers/rtc/rtc-mxc.c:315:19: warning: cast to smaller integer type 'enum imx_rtc_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] Reported-by: kernel test robot Fixes: ba7aa63000f2 ("rtc: mxc: use of_device_get_match_data") Signed-off-by: Fabio Estevam Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220526011459.1167197-1-festevam@gmail.com commit c7993147519ca970ad4af17e0eac9d683e7721b9 Merge: 96752be4d7b44 da50aad6d8671 Author: Linus Torvalds Date: Wed Jun 1 14:13:41 2022 -0700 Merge tag 'for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Not much from the power-supply subsystem this time around, since I was busy most of the cycle. This also contains some fixes that I originally planned to send for 5.18. Apart from this there is nothing noteworthy. Power-supply core: - init power_supply_info struct to zero Drivers: - bq27xxx: expose data for uncalibrated battery - bq24190-charger: use pm_runtime_resume_and_get - ab8500_fg: allocate wq in probe - axp288_fuel_gauge: drop BIOS version from 'T3 MRD' quirk - axp288_fuel_gauge: modify 'T3 MRD' quirk to also fix 'One Mix 1'" * tag 'for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: bq24190_charger: using pm_runtime_resume_and_get instead of pm_runtime_get_sync power: supply: bq27xxx: expose battery data when CI=1 power: supply: ab8500_fg: Allocate wq in probe power: supply: axp288_fuel_gauge: Drop BIOS version check from "T3 MRD" DMI quirk power: supply: axp288_fuel_gauge: Fix battery reporting on the One Mix 1 power: supply: core: Initialize struct to zero commit 96752be4d7b443e6f1e322428d61f777d7d8bd4d Merge: 176882156ae6d 5d24df3d69080 Author: Linus Torvalds Date: Wed Jun 1 14:05:16 2022 -0700 Merge tag 'linux-watchdog-5.19-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - Add MediaTek MT8186 support - Add Mediatek MT7986 reset-controller support - Add i.MX93 support - Add watchdog driver for Sunplus SP7021 - Add SC8180X and SC8280XP compatibles - Add Renesas RZ/N1 Watchdog driver and support for RZ/N1 - rzg2l_wdt improvements and fixes - Several other improvements and fixes * tag 'linux-watchdog-5.19-rc1' of git://www.linux-watchdog.org/linux-watchdog: (38 commits) watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe dt-bindings: watchdog: renesas,wdt: R-Car V3U is R-Car Gen4 watchdog: Add Renesas RZ/N1 Watchdog driver dt-bindings: watchdog: renesas,wdt: Add support for RZ/N1 watchdog: wdat_wdt: Stop watchdog when uninstalling module watchdog: wdat_wdt: Stop watchdog when rebooting the system watchdog: wdat_wdt: Using the existing function to check parameter timeout dt-bindings: watchdog: da9062: add watchdog timeout mode dt-bindings: watchdog: renesas,wdt: Document RZ/G2UL SoC watchdog: iTCO_wdt: Using existing macro define covers more scenarios watchdog: rti-wdt: Fix pm_runtime_get_sync() error checking dt-bindings: watchdog: Add SC8180X and SC8280XP compatibles watchdog: rti_wdt: Fix calculation and evaluation of preset heartbeat dt-bindings: watchdog: uniphier: Use unevaluatedProperties watchdog: sp805: disable watchdog on remove watchdog: da9063: optionally disable watchdog during suspend dt-bindings: mfd: da9063: watchdog: add suspend disable option dt-bindings: watchdog: sunxi: clarify clock support dt-bindings: watchdog: sunxi: fix F1C100s compatible watchdog: Add watchdog driver for Sunplus SP7021 ... commit 176882156ae6d63a81fe7f01ea6fe65ab6b52105 Merge: 8171acb8bc9b3 421cfe6596f6c Author: Linus Torvalds Date: Wed Jun 1 13:49:15 2022 -0700 Merge tag 'vfio-v5.19-rc1' of https://github.com/awilliam/linux-vfio Pull vfio updates from Alex Williamson: - Improvements to mlx5 vfio-pci variant driver, including support for parallel migration per PF (Yishai Hadas) - Remove redundant iommu_present() check (Robin Murphy) - Ongoing refactoring to consolidate the VFIO driver facing API to use vfio_device (Jason Gunthorpe) - Use drvdata to store vfio_device among all vfio-pci and variant drivers (Jason Gunthorpe) - Remove redundant code now that IOMMU core manages group DMA ownership (Jason Gunthorpe) - Remove vfio_group from external API handling struct file ownership (Jason Gunthorpe) - Correct typo in uapi comments (Thomas Huth) - Fix coccicheck detected deadlock (Wan Jiabing) - Use rwsem to remove races and simplify code around container and kvm association to groups (Jason Gunthorpe) - Harden access to devices in low power states and use runtime PM to enable d3cold support for unused devices (Abhishek Sahu) - Fix dma_owner handling of fake IOMMU groups (Jason Gunthorpe) - Set driver_managed_dma on vfio-pci variant drivers (Jason Gunthorpe) - Pass KVM pointer directly rather than via notifier (Matthew Rosato) * tag 'vfio-v5.19-rc1' of https://github.com/awilliam/linux-vfio: (38 commits) vfio: remove VFIO_GROUP_NOTIFY_SET_KVM vfio/pci: Add driver_managed_dma to the new vfio_pci drivers vfio: Do not manipulate iommu dma_owner for fake iommu groups vfio/pci: Move the unused device into low power state with runtime PM vfio/pci: Virtualize PME related registers bits and initialize to zero vfio/pci: Change the PF power state to D0 before enabling VFs vfio/pci: Invalidate mmaps and block the access in D3hot power state vfio: Change struct vfio_group::container_users to a non-atomic int vfio: Simplify the life cycle of the group FD vfio: Fully lock struct vfio_group::container vfio: Split up vfio_group_get_device_fd() vfio: Change struct vfio_group::opened from an atomic to bool vfio: Add missing locking for struct vfio_group::kvm kvm/vfio: Fix potential deadlock problem in vfio include/uapi/linux/vfio.h: Fix trivial typo - _IORW should be _IOWR instead vfio/pci: Use the struct file as the handle not the vfio_group kvm/vfio: Remove vfio_group from kvm vfio: Change vfio_group_set_kvm() to vfio_file_set_kvm() vfio: Change vfio_external_check_extension() to vfio_file_enforced_coherent() vfio: Remove vfio_external_group_match_file() ... commit 66ed42caf286a7aaeb6f1db4b2995dd9416226c2 Author: Lukas Bulwahn Date: Wed Jun 1 09:42:12 2022 +0200 MAINTAINERS: rectify entries for some i3c drivers after dt conversion Commit 4bd69ecfa672 ("dt-bindings: i3c: Convert cdns,i3c-master to DT schema") and commit 6742ca620bd9 ("dt-bindings: i3c: Convert snps,dw-i3c-master to DT schema") convert some i3c dt-bindings to yaml, but miss to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about broken references. Repair these file references in I3C DRIVER FOR CADENCE I3C MASTER IP and I3C DRIVER FOR SYNOPSYS DESIGNWARE. Signed-off-by: Lukas Bulwahn Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220601074212.19984-1-lukas.bulwahn@gmail.com commit fa582c6f3684ac0098a9d02ddf0ed52a02b37127 Author: Philip Yang Date: Thu May 26 16:15:38 2022 -0400 drm/amdkfd: Use mmget_not_zero in MMU notifier MMU notifier callback may pass in mm with mm->mm_users==0 when process is exiting, use mmget_no_zero to avoid accessing invalid mm in deferred list work after mm is gone. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2a460963350ec6b1534d28d7f943b5f84815aff2 Author: Candice Li Date: Wed Jun 1 17:10:44 2022 +0800 drm/amdgpu: Resolve RAS GFX error count issue after cold boot on Arcturus Adjust the sequence for ras late init and separate ras reset error status from query status. v2: squash in fix from Candice Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 28caf8c467e2cb98b90a760b65767fa9aaf52ffb Author: Stanley.Yang Date: Tue May 31 18:57:06 2022 +0800 drm/amdgpu: fix ras supported check Fix aldebaran ras supported check on SRIOV guest side, the previous check conditicon block all ras feature on baremetal Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fd843d03418ead2bba369159bb19b60e9d4b7b1e Author: Aurabindo Pillai Date: Thu Apr 14 15:48:30 2022 -0400 drm/amd/display: remove stale config guards This code should be executed. Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 8365ed22d00b5e5889425c8d96462ad88ae463bc Author: sunliming Date: Sun May 29 14:26:31 2022 +0800 drm/amdgpu: make gfx_v11_0_rlc_stop static This symbol is not used outside of gfx_v11_0.c, so marks it static. Fixes the following w1 warning: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1945:6: warning: no previous prototype for function 'gfx_v11_0_rlc_stop' [-Wmissing-prototypes]. Reported-by: kernel test robot Signed-off-by: sunliming Signed-off-by: Alex Deucher commit 418214ddcf6e79e4e572f8c7a18e1de7cab195b4 Author: sunliming Date: Sun May 29 15:26:31 2022 +0800 drm/amdgpu: fix a missing break in gfx_v11_0_handle_priv_fault Fixes the following w1 warning: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:5873:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]. Reported-by: kernel test robot Signed-off-by: sunliming Signed-off-by: Alex Deucher commit ae969b62e7a1e17affae24b815b217b9b87a62f4 Author: Roman Li Date: Wed May 25 17:20:21 2022 -0400 drm/amdgpu: fix aper_base for APU [Why] Wrong fb offset results in dmub f/w errors and white screen. [drm:dc_dmub_srv_wait_idle [amdgpu]] *ERROR* Error waiting for DMUB idle: status=3 [How] Read aper_base from mmhub because GC is off by default v2: use BAR for passthrough (Alex) Signed-off-by: Roman Li Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 97e50305542f384741a5b45699aba349fe9fca73 Author: Alex Deucher Date: Thu May 26 16:34:55 2022 -0400 drm/amdgpu: update VCN codec support for Yellow Carp Supports AV1. Mesa already has support for this and doesn't rely on the kernel caps for yellow carp, so this was already working from an application perspective. Fixes: 554398174d98 ("amdgpu/nv.c - Added video codec support for Yellow Carp") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2002 Reviewed-by: Leo Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 11594fa114276ed41b9fa3849f7eb79be10162d6 Author: Jiapeng Chong Date: Wed May 25 17:37:02 2022 +0800 drm/amdgpu: make program_imu_rlc_ram static This symbol is not used outside of imu_v11_0.c, so marks it static. Fixes the following w1 warning: drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:302:6: warning: no previous prototype for ‘program_imu_rlc_ram’ [-Wmissing-prototypes]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 067541847781b8e3abd7400ffdc0d402432613c8 Author: Aric Cyr Date: Sun May 15 21:52:38 2022 -0400 drm/amd/display: 3.2.187 This version brings along the following fixes: * Changes to DP LT fallback behavior to more closely match the DP standard * Added new interfaces for lut pipeline * Restore ref_dtblck value when clk struct is cleared in init_clocks * Fixes DMUB outbox trace in S4 * Fixes lingering DIO FIFO errors when DIO no longer enabled * Reads Golden Settings Table from VBIOS Acked-by: Jasdeep Dhillon Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 583ad88871b38dc39f05a316dcde909e444b09a6 Author: Ilya Date: Mon Feb 7 17:39:10 2022 -0500 drm/amd/display: Fix possible infinite loop in DP LT fallback [Why] It's possible for some fallback scenarios to result in infinite looping during link training. [How] This change modifies DP LT fallback behavior to more closely match the DP standard. Keep track of the link rate during the EQ_FAIL fallback, and use it as the maximum link rate for the CR sequence. Reviewed-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Ilya Signed-off-by: Alex Deucher commit f0ad66f42a3d914ac5f9972731ec5bc97f35002d Author: Alvin Date: Thu May 12 16:49:16 2022 -0400 drm/amd/display: Don't clear ref_dtbclk value [Description] ref_dtbclk value is assigned in clk_mgr_construct, but the clks struct is cleared in init_clocks. Make sure to restore the value or we will get 0 value for ref_dtbclk in DCN31. Reviewed-by: Chris Park Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 6ecf9773a5030aa4932096754bacff20e1b944b8 Author: Hung, Cruise Date: Fri May 13 09:16:42 2022 +0800 drm/amd/display: Fix DMUB outbox trace in S4 (#4465) [Why] DMUB Outbox0 read/write pointer not sync after resumed from S4. And that caused old traces were sent to outbox. [How] Disable DMUB Outbox0 interrupt and clear DMUB Outbox0 read/write pointer when resumes from S4. And then enable Outbox0 interrupt before starts DMCUB. Reviewed-by: Nicholas Kazlauskas Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Cruise Hung Signed-off-by: Alex Deucher commit 92909cde3235f894d7cdf59709d86e9b22f897ce Author: hengzhou Date: Sat May 7 09:43:08 2022 +0800 drm/amd/display: Wait DMCUB to idle state before reset. [WHY] Very low rate to cause memory access issue while resetting DMCUB after the halt command was sent to it. The process of stopping fw of DMCUB may be timeout, that means it is not in idle state, such as the window frames may still be kept in cache, so reset by force will cause MMHUB hang. [HOW] After the halt command was sent, keep checking the DMCUB state until it is idle. Reviewed-by: Eric Yang Reviewed-by: Nicholas Kazlauskas Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: hengzhou Signed-off-by: Alex Deucher commit 8440f57532496d398a461887e56ca6f45089fbcf Author: Nicholas Kazlauskas Date: Fri May 6 12:56:38 2022 -0400 drm/amd/display: Pass the new context into disable OTG WA [Why] When enabling an HPO stream for the first time after having previously enabled a DIO stream there may be lingering DIO FIFO errors even though the DIO is no longer enabled. These can cause display clock change to hang if we don't apply the OTG disable workaround since the ramping logic is tied to OTG on. [How] The workaround wasn't being applied in the sequence of: 1 DIO stream 0 streams 1 HPO stream because current_state has no stream or planes in its context - and it's only swapped after optimize has finished. We should be using the incoming context instead to determine whether this logic is needed or not. Reviewed-by: Dmytro Laktyushkin Reviewed-by: Dmytro Laktyushkin Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 0ec744084793db817990424cc3cc9da63f665f3f Author: Leung, Martin Date: Tue May 10 12:27:08 2022 -0400 drm/amd/display: revert Blank eDP on disable/enable drv why and how: Revert this change. It was causing a black screen with certain blocks Reviewed-by: George Shen Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Leung, Martin Signed-off-by: Alex Deucher commit 4b81dd2cc6f4f4e8cea0ed6ee8d5193a8ae14a72 Author: Sherry Wang Date: Tue May 10 18:42:18 2022 +0800 drm/amd/display: Read Golden Settings Table from VBIOS [Why] Dmub read AUX_DPHY_RX_CONTROL0 from Golden Setting Table, but driver will set it to default value 0x103d1110, which causes issue in some case [How] Remove the driver code, use the value set by dmub in dp_aux_init Reviewed-by: Nicholas Kazlauskas Acked-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Sherry Wang Signed-off-by: Alex Deucher commit e2c6170a55baefcbeb477e06e66f07659ea4f58d Author: Bharat Kumar Gogada Date: Mon May 16 15:52:17 2022 +0530 dt-bindings: PCI: xilinx-cpm: Fix reg property order All existing vendor DTSes are using "cpm_slcr" reg followed by "cfg" reg. This order is also suggested by node name which is pcie@fca10000 which suggests that cpm_slcr register should be the first. Driver itself is using devm_platform_ioremap_resource_byname() for both names that's why there is no functional change even on description which are using current order. But still prefer to change order to cover currently used description. Fixes: e22fadb1d014 ("PCI: xilinx-cpm: Add YAML schemas for Versal CPM Root Port") Signed-off-by: Bharat Kumar Gogada Reviewed-by: Michal Simek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220516102217.25960-1-bharat.kumar.gogada@xilinx.com commit 8171acb8bc9b33f3ed827f0615b24f7a06495cd0 Merge: e5b0208713326 4398d3c31b582 Author: Linus Torvalds Date: Wed Jun 1 11:54:29 2022 -0700 Merge tag 'erofs-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull more erofs updates from Gao Xiang: "This is a follow-up to the main updates, including some fixes of fscache mode related to compressed inodes and a cachefiles tracepoint. There is also a patch to fix an unexpected decompression strategy change due to a cleanup in the past. All the fixes are quite small. Apart from these, documentation is also updated for a better description of recent new features. In addition, this has some trivial cleanups without actual code logic changes, so I could have a more recent codebase to work on folios and avoiding the PG_error page flag for the next cycle. Summary: - Leave compressed inodes unsupported in fscache mode for now - Avoid crash when using tracepoint cachefiles_prep_read - Fix `backmost' behavior due to a recent cleanup - Update documentation for better description of recent new features - Several decompression cleanups w/o logical change" * tag 'erofs-for-5.19-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix 'backmost' member of z_erofs_decompress_frontend erofs: simplify z_erofs_pcluster_readmore() erofs: get rid of label `restart_now' erofs: get rid of `struct z_erofs_collection' erofs: update documentation erofs: fix crash when enable tracepoint cachefiles_prep_read erofs: leave compressed inodes unsupported in fscache mode for now commit e5b0208713326cdd3f0a83540e31f9b6f280da38 Merge: 17eabd42560f4 621433b7e25d6 Author: Linus Torvalds Date: Wed Jun 1 11:17:24 2022 -0700 Merge tag '5.19-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd server updates from Steve French: - rdma (smbdirect) fixes, cleanup and optimizations - crediting (flow control) fix for mounts from Windows client - ACL fix - Windows client query dir fix - write validation fix - cleanups * tag '5.19-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: smbd: relax the count of sges required ksmbd: fix outstanding credits related bugs ksmbd: smbd: fix connection dropped issue ksmbd: Fix some kernel-doc comments ksmbd: fix wrong smbd max read/write size check ksmbd: add smbd max io size parameter ksmbd: handle smb2 query dir request for OutputBufferLength that is too small ksmbd: smbd: handle multiple Buffer descriptors ksmbd: smbd: change the return value of get_sg_list ksmbd: smbd: simplify tracking pending packets ksmbd: smbd: introduce read/write credits for RDMA read/write ksmbd: smbd: change prototypes of RDMA read/write related functions ksmbd: validate length in smb2_write() ksmbd: fix reference count leak in smb_check_perm_dacl() commit 17eabd42560f4636648ad65ba5b20228071e2363 Author: David Howells Date: Tue May 31 09:30:40 2022 +0100 afs: Fix infinite loop found by xfstest generic/676 In AFS, a directory is handled as a file that the client downloads and parses locally for the purposes of performing lookup and getdents operations. The in-kernel afs filesystem has a number of functions that do this. A directory file is arranged as a series of 2K blocks divided into 32-byte slots, where a directory entry occupies one or more slots, plus each block starts with one or more metadata blocks. When parsing a block, if the last slots are occupied by a dirent that occupies more than a single slot and the file position points at a slot that's not the initial one, the logic in afs_dir_iterate_block() that skips over it won't advance the file pointer to the end of it. This will cause an infinite loop in getdents() as it will keep retrying that block and failing to advance beyond the final entry. Fix this by advancing the file pointer if the next entry will be beyond it when we skip a block. This was found by the generic/676 xfstest but can also be triggered with something like: ~/xfstests-dev/src/t_readdir_3 /xfstest.test/z 4000 1 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: http://lore.kernel.org/r/165391973497.110268.2939296942213894166.stgit@warthog.procyon.org.uk/ Signed-off-by: Linus Torvalds commit 8eca6b0a647aabea3d1d2907dd6245fc436f98e7 Merge: 68e6134bb70ab 3d593b6e80ad2 Author: Linus Torvalds Date: Wed Jun 1 10:49:11 2022 -0700 Merge tag 'pwm/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "Quite a large number of conversions this time around, courtesy of Uwe who has been working tirelessly on these. No drivers of the legacy API are left at this point, so as a next step the old API can be removed. Support is added for a few new devices such as the Xilinx AXI timer- based PWMs and the PWM IP found on Sunplus SoCs. Other than that, there's a number of fixes, cleanups and optimizations" * tag 'pwm/for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (43 commits) pwm: pwm-cros-ec: Add channel type support dt-bindings: google,cros-ec-pwm: Add the new -type compatible dt-bindings: Add mfd/cros_ec definitions pwm: Document that the pinstate of a disabled PWM isn't reliable pwm: twl-led: Implement .apply() callback pwm: lpc18xx: Implement .apply() callback pwm: mediatek: Implement .apply() callback pwm: lpc32xx: Implement .apply() callback pwm: tegra: Implement .apply() callback pwm: stmpe: Implement .apply() callback pwm: sti: Implement .apply() callback pwm: pwm-mediatek: Add support for MediaTek Helio X10 MT6795 dt-bindings: pwm: pwm-mediatek: Add documentation for MT6795 SoC pwm: tegra: Optimize period calculation pwm: renesas-tpu: Improve precision of period and duty_cycle calculation pwm: renesas-tpu: Improve maths to compute register settings pwm: renesas-tpu: Rename variables to match the usual naming pwm: renesas-tpu: Implement .apply() callback pwm: renesas-tpu: Make use of devm functions pwm: renesas-tpu: Make use of dev_err_probe() ... commit 68e6134bb70ab20e9f7c36c1ae7dc96b8ed778ae Merge: f634b63d43e1e 59d6f72f6f9c9 Author: Linus Torvalds Date: Wed Jun 1 10:39:58 2022 -0700 Merge tag 'rpmsg-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "This corrects the check for irq_of_parse_and_map() failures in the Qualcomm SMD driver and fixes unregistration and a couple of double free in the virtio rpmsg driver" * tag 'rpmsg-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: qcom_smd: Fix returning 0 if irq_of_parse_and_map() fails rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl rpmsg: virtio: Fix possible double free in rpmsg_virtio_add_ctrl_dev() rpmsg: virtio: Fix possible double free in rpmsg_probe() rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value commit f634b63d43e1ef4ccd68017687a8437d3c416918 Merge: 129bdb30fb054 bb489b9640610 Author: Linus Torvalds Date: Wed Jun 1 10:35:22 2022 -0700 Merge tag 'rproc-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "This fixes a race condition in the user space interface for starting and stopping remote processors, it makes the ELF loader properly skip zero memsz segments and it cleans up the debugfs tracefile code a bit by not checking for errors. It introduces support for controlling the audio DSP on Qualcomm MSM8226, as well as audio and compute DSPs on Qualcomm SC8280XP. It makes it possible to specify the firmware path for Mediatek's remote processors, fixes a double free in the SCP driver and addresses an issue with the SRAM initialization on MT8195. Lastly it deprecates the custom ELF loader in the iMX remoteproc driver, in favor of using the shared one" * tag 'rproc-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (21 commits) dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x dt-bindings: remoteproc: st,stm32-rproc: Fix phandle-array parameters description remoteproc: imx_rproc: Support i.MX93 dt-bindings: remoteproc: imx_rproc: Support i.MX93 remoteproc: qcom: pas: Add MSM8226 ADSP support dt-bindings: remoteproc: qcom: pas: Add MSM8226 adsp remoteproc: mediatek: Allow reading firmware-name from DT dt-bindings: remoteproc: mediatek: Add firmware-name property remoteproc: qcom: pas: Add sc8280xp remoteprocs dt-bindings: remoteproc: qcom: pas: Add sc8280xp adsp and nsp pair dt-bindings: remoteproc: mediatek: Add interrupts property to mtk,scp remoteproc: imx_rproc: Ignore create mem entry for resource table remoteproc: core: Move state checking to remoteproc_core remoteproc: core: Remove state checking before calling rproc_boot() remoteproc: imx_dsp_rproc: Make rsc_table optional remoteproc: imx_dsp_rproc: use common rproc_elf_load_segments remoteproc: elf_loader: skip segment with memsz as zero remoteproc: mtk_scp: Fix a potential double free remoteproc: Don't bother checking the return value of debugfs_create* ... commit 129bdb30fb054875f2068ccce376b865076d9934 Merge: 2380dd691e1fe ebf2a35217385 Author: Linus Torvalds Date: Wed Jun 1 10:30:18 2022 -0700 Merge tag 'spi-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A couple of fixes that came in during the merge window: a driver fix for spurious timeouts in the fsi driver and an improvement to make the core display error messages for transfer_one_message() to help people debug things" * tag 'spi-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: core: Display return code when failing to transfer message spi: fsi: Fix spurious timeout commit 2380dd691e1fe1ebe3f346d0ce54f8fc7eacc167 Merge: 700170bf6b4d7 2ef4bb24ff39a Author: Linus Torvalds Date: Wed Jun 1 10:25:06 2022 -0700 Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull pcmcia updates from Dominik Brodowski: "A few odd cleanups and fixes, including a Kconfig fix to add a required dependency on MIPS" * 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: Use platform_get_irq() to get the interrupt pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards drivers/pcmcia: Fix typo in comment commit 43624eda86c98b0de726d0b6f2516ccc3ef7313f Author: Haibo Chen Date: Mon May 30 18:48:48 2022 +0800 gpio: pca953x: use the correct register address to do regcache sync For regcache_sync_region, need to use pca953x_recalc_addr() to get the real register address. Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle") Signed-off-by: Haibo Chen Signed-off-by: Bartosz Golaszewski commit 8a172952fc597ab9a56d4511d5a72af7c4419c7a Author: Andy Shevchenko Date: Mon May 30 14:59:03 2022 +0300 MAINTAINERS: Update Intel GPIO (PMIC and PCH) to Supported The actual status of the code is Supported. Reported-by: dave.hansen@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 741d4514e96a3a6eef57522ba8df3646a1585441 Author: Andy Shevchenko Date: Mon May 30 14:56:53 2022 +0300 MAINTAINERS: Update GPIO ACPI library to Supported The actual status of the code is Supported. Reported-by: dave.hansen@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Bartosz Golaszewski commit ff979b2a9d9779382030023bfc4e3b1989c8c314 Author: Chengming Zhou Date: Fri May 6 11:27:37 2022 +0800 ftrace/fgraph: fix increased missing-prototypes warnings After commit e999995c84c3 ("ftrace: cleanup ftrace_graph_caller enable and disable") merged into the linux-next tree, the kernel test robot (lkp@intel.com) has send out report that there are increased missing-prototypes warnings caused by that commit. COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 \ O=build_dir ARCH=sh SHELL=/bin/bash kernel/trace/ warning: no previous prototype for 'ftrace_enable_ftrace_graph_caller' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_disable_ftrace_graph_caller' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes] warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes] BTW there are so many missing-prototypes warnings if build kernel with "W=1". The increased warnings for 'ftrace_[enable,disable]_ftrace_graph_caller' is caused by CONFIG_FUNCTION_GRAPH_TRACER && !CONFIG_DYNAMIC_FTRACE, so the declarations in can't be seen in fgraph.c. And this warning can't reproduce on x86_64 since x86_64 select HAVE_FUNCTION_GRAPH_TRACER only when DYNAMIC_FTRACE, so fgraph.c will always see the declarations in . This patch fix the increased warnings by put the definitions in CONFIG_DYNAMIC_FTRACE although there are no real problems exist. Signed-off-by: Chengming Zhou Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20220506032737.23375-1-zhouchengming@bytedance.com Signed-off-by: Catalin Marinas commit 61c1b44a21d70d4783db02198fbf68b132f4953c Author: Pavel Begunkov Date: Wed Jun 1 15:28:44 2022 +0100 io_uring: fix deadlock on iowq file slot alloc io_fixed_fd_install() can grab uring_lock in the slot allocation path when called from io-wq, and then call into io_install_fixed_file(), which will lock it again. Pull all locking out of io_install_fixed_file() into io_fixed_fd_install(). Fixes: 1339f24b336db ("io_uring: allow allocated fixed files for openat/openat2") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/64116172a9d0b85b85300346bb280f3657aafc26.1654087283.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a27e51b45e1bc57f15cffd6b9bfc38efef8cc419 Author: Nelson Penn Date: Sun May 22 19:50:38 2022 +0000 documentation: Format button_dev as a pointer. The docs on creating an input device driver have an example in which button_dev is a pointer to an input_dev struct. However, in two code snippets below, button_dev is used as if it is not a pointer. Make these occurrences of button_dev reflect that it is a pointer. Signed-off-by: Nelson Penn Link: https://lore.kernel.org/r/20220522194953.12097-1-nelsonapenn@protonmail.com Signed-off-by: Jonathan Corbet commit 6199e138fe3b7479f1c6980f8407a8e0b2ade1e8 Author: Miguel Ojeda Date: Sat May 28 17:31:32 2022 +0200 docs: add SVG version of the Linux logo In the Rust for Linux patch series, Jonathan Corbet requested [1] that we avoid binary assets (such as the logo), possibly by recreating them in SVG format. However, it turns out there is no SVG version of the Linux logo in the kernel tree yet, only a GIF one from the pre-v2.0.0 days. This patch fixes that by adding a SVG version of the Linux logo, which we could then use in the Rust for Linux documentation and other similar places. This is a vector re-illustration by Garrett LeSage of the original logo by Larry Ewing, plus cleanups by IFo Hancroft. The file was imported as-is from: https://github.com/garrett/Tux/blob/ecd40de64250ea2b24c849e901c3297ad01e54f6/tux.svg The stated license in the repository is: > Public domain http://creativecommons.org/publicdomain/zero/1.0/ > > ...but, if anyone asks: > > Tux was originally made by Larry Ewing in the Gimp, re-illustrated > in vector by Garrett LeSage, using Inkscape and refined and > cleaned up by IFo Hancroft. Here, the acknowledgement requirement has been made mandatory to match the wording of the existing GIF logo in `COPYING-logo`. Both Garrett LeSage and IFo Hancroft gave their permission [2,3] to use their re-illustration with the license as given in the `COPYING-logo` file. Link: https://lore.kernel.org/lkml/87fspk1xoc.fsf@meer.lwn.net/ [1] Link: https://lore.kernel.org/lkml/YgFsD7zBZyVqyF+F@battlestation/ [2] Link: https://lore.kernel.org/lkml/CAFfNkxV=DmRJL1Oqm3w9YzBYcNLSAG3Ss8pih9ZVwh_E-Fbw+Q@mail.gmail.com/ [3] Signed-off-by: Miguel Ojeda Link: https://lore.kernel.org/r/20220528153132.8636-2-ojeda@kernel.org Signed-off-by: Jonathan Corbet commit fae35da4ace3721dfba1b3986a9239fc85cf8c72 Author: Miguel Ojeda Date: Sat May 28 17:31:31 2022 +0200 docs: move Linux logo into a new `images` folder Having assets in the top-level `Documentation` directory can make it harder to find the documents one needs, especially if we want to add more of them later on. Instead, create a new `images` folder inside it that is used to hold assets such as logos. In addition, update the reference in `scripts/spdxcheck-test.sh`. Link: https://lore.kernel.org/lkml/8735hicoy7.fsf@meer.lwn.net/ Suggested-by: Jonathan Corbet Signed-off-by: Miguel Ojeda Link: https://lore.kernel.org/r/20220528153132.8636-1-ojeda@kernel.org Signed-off-by: Jonathan Corbet commit 938285a130ecafd9da71f6a28058722bb831b31d Author: Joel Colledge Date: Mon May 30 16:28:49 2022 +0200 docs: blockdev: change title to match section content This index.rst was added in commit 39443104c7d3 docs: blockdev: convert to ReST It appears that the title from the RapidIO index page was copied. This title does not match the content of this directory. Change it to match. Signed-off-by: Joel Colledge Link: https://lore.kernel.org/r/20220530142849.717-1-joel.colledge@linbit.com Signed-off-by: Jonathan Corbet commit 627f01eab93d8671d4e4afee9b148f9998d20e7c Author: Akira Yokosawa Date: Wed Jun 1 23:34:06 2022 +0900 docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 One of the changes in Sphinx 5.0.0 [1] says [sic]: 5.0.0 final - #10474: language does not accept None as it value. The default value of language becomes to 'en' now. [1]: https://www.sphinx-doc.org/en/master/changes.html#release-5-0-0-released-may-30-2022 It results in a new warning from Sphinx 5.0.0 [sic]: WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid langauge code. Falling back to 'en' (English). Silence the warning by using 'en'. It works with all the Sphinx versions required for building kernel documentation (1.7.9 or later). Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/bd0c2ddc-2401-03cb-4526-79ca664e1cbe@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Jonathan Corbet commit 479260419fa4cb30e3e5d935a857fbdf0ffdd854 Author: Rob Herring Date: Wed May 25 20:42:04 2022 -0500 dt-bindings: mmc: Fix unevaluatedProperties warnings in examples The 'unevaluatedProperties' schema checks is not fully working and doesn't catch some cases where there's a $ref to another schema. A fix is pending, but results in new warnings in examples. Fix the warnings by removing spurious properties or adding a missing property to the schema. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220526014204.2873107-1-robh@kernel.org Signed-off-by: Ulf Hansson commit a78b6afa9913890e92aede1c17e72dec7e528549 Author: Masahiro Yamada Date: Sun May 29 00:47:01 2022 +0900 kbuild: remove redundant cleanups in scripts/link-vmlinux.sh These are cleaned by the top Makefile. vmlinux.o and .vmlinux.d matches the '*.[aios]' and '.*.d' patterns respectively. Signed-off-by: Masahiro Yamada Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit f6b66ca4f38b1169313383aec7fa0a8446205ebb Author: Masahiro Yamada Date: Fri May 27 19:01:55 2022 +0900 kbuild: rebuild multi-object modules when objtool is updated When CONFIG_LTO_CLANG or CONFIG_X86_KERNEL_IBT is enabled, objtool for multi-object modules is postponed until the objects are linked together. Make sure to re-run objtool and re-link multi-object modules when objtool is updated. Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook Acked-by: Josh Poimboeuf Tested-by: Nathan Chancellor Reviewed-by: Nicolas Schier Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit ebd191b38c5ea177318543a08e544cf2f7df944d Author: Masahiro Yamada Date: Fri May 27 19:01:54 2022 +0900 kbuild: add cmd_and_savecmd macro Separate out the command execution part of if_changed, as we did for if_changed_dep. This allows us to reuse it in if_changed_rule. define rule_foo $(call cmd_and_savecmd,foo) $(call cmd,bar) endef Signed-off-by: Masahiro Yamada Reviewed-by: Kees Cook Tested-by: Nathan Chancellor Reviewed-by: Nicolas Schier Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit c6031b1dbbbfec03891bf1baefa2e0803d705601 Author: Masahiro Yamada Date: Fri May 27 19:01:53 2022 +0900 kbuild: make *.mod rule robust against too long argument error Like built-in.a, the command length of the *.mod rule scales with the depth of the directory times the number of objects in the Makefile. Add $(obj)/ by the shell command (awk) instead of by Make's builtin function. In-tree modules still have some room to the limit (ARG_MAX=2097152), but this is more future-proof for big modules in a deep directory. For example, you can build i915 as a module (CONFIG_DRM_I915=m) and compare drivers/gpu/drm/i915/.i915.mod.cmd with/without this commit. The issue is more critical for external modules because the M= path can be very long as Jeff Johnson reported before [1]. [1] https://lore.kernel.org/linux-kbuild/4c02050c4e95e4cb8cc04282695f8404@codeaurora.org/ Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit cd968b97c49214e6557381bddddacbd0e0fb696e Author: Masahiro Yamada Date: Fri May 27 19:01:52 2022 +0900 kbuild: make built-in.a rule robust against too long argument error Kbuild runs at the top of objtree instead of changing the working directory to subdirectories. I think this design is nice overall but some commands have a scalability issue. The build command of built-in.a is one of them whose length scales with: O(D * N) Here, D is the length of the directory path (i.e. $(obj)/ prefix), N is the number of objects in the Makefile, O() is the big O notation. The deeper directory the Makefile directory is located, the more easily it will hit the too long argument error. We can make it better. Trim the $(obj)/ by Make's builtin function, and restore it by a shell command (sed). With this, the command length scales with: O(D + N) In-tree modules still have some room to the limit (ARG_MAX=2097152), but this is more future-proof for big modules in a deep directory. For example, you can build i915 as builtin (CONFIG_DRM_I915=y) and compare drivers/gpu/drm/i915/.built-in.a.cmd with/without this commit. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 31cb50b5590fe911077b8463ad01144fac8fa4f3 Author: Masahiro Yamada Date: Fri May 27 19:01:51 2022 +0900 kbuild: check static EXPORT_SYMBOL* by script instead of modpost The 'static' specifier and EXPORT_SYMBOL() are an odd combination. Commit 15bfc2348d54 ("modpost: check for static EXPORT_SYMBOL* functions") tried to detect it, but this check has false negatives. Here is the sample code. Makefile: obj-y += foo1.o foo2.o foo1.c: #include static void foo(void) {} EXPORT_SYMBOL(foo); foo2.c: void foo(void) {} foo1.c exports the static symbol 'foo', but modpost cannot catch it because it is fooled by foo2.c, which has a global symbol with the same name. s->is_static is cleared if a global symbol with the same name is found somewhere, but EXPORT_SYMBOL() and the global symbol do not necessarily belong to the same compilation unit. This check should be done per compilation unit, but I do not know how to do it in modpost. modpost runs against vmlinux.o or modules, which merges multiple objects, then forgets their origin. modpost cannot parse individual objects because they may not be ELF but LLVM IR when CONFIG_LTO_CLANG=y. Add a simple bash script to parse the output from ${NM}. This works for CONFIG_LTO_CLANG=y because llvm-nm can dump symbols of LLVM IR files. Revert 15bfc2348d54. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit ab5e5c062f67c5ae8cd07f0632ffa62dc0e7d169 Author: Pablo Neira Ayuso Date: Wed Jun 1 16:00:00 2022 +0200 netfilter: nf_tables: use kfree_rcu(ptr, rcu) to release hooks in clean_net path Use kfree_rcu(ptr, rcu) variant instead as described by ae089831ff28 ("netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant"). Fixes: f9a43007d3f7 ("netfilter: nf_tables: double hook unregistration in netns path") Signed-off-by: Pablo Neira Ayuso commit 282e5f8fe907dc3f2fbf9f2103b0e62ffc3a68a5 Author: Florian Westphal Date: Wed Jun 1 10:47:35 2022 +0200 netfilter: nat: really support inet nat without l3 address When no l3 address is given, priv->family is set to NFPROTO_INET and the evaluation function isn't called. Call it too so l4-only rewrite can work. Also add a test case for this. Fixes: a33f387ecd5aa ("netfilter: nft_nat: allow to specify layer 4 protocol NAT only") Reported-by: Yi Chen Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit a051246b786af7e4a9d9219cc7038a6e8a411531 Author: Adrian Hunter Date: Tue May 31 20:19:22 2022 +0300 mmc: block: Fix CQE recovery reset success The intention of the use of mmc_blk_reset_success() in mmc_blk_cqe_recovery() was to prevent repeated resets when retrying and getting the same error. However, that may not be the case - any amount of time and I/O may pass before another recovery is needed, in which case there would be no reason to deny it the opportunity to recover via a reset if necessary. CQE recovery is expected seldom and failure to recover (if the clear tasks command fails), even more seldom, so it is better to allow the reset always, which can be done by calling mmc_blk_reset_success() always. Fixes: 1e8e55b67030c6 ("mmc: block: Add CQE support") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Link: https://lore.kernel.org/r/20220531171922.76080-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 75ed63d919400b803691a0c757ee23c6f767a625 Author: Ard Biesheuvel Date: Sat May 28 11:49:54 2022 +0200 efi: clean up Kconfig dependencies on CONFIG_EFI Geert reports that the new option CONFIG_EFI_DISABLE_RUNTIME is user visible even when EFI support is disabled, which is unnecessary and clutters the Kconfig interface. So let's move this option into the existing Kconfig submenu that already depends on CONFIG_EFI, and while at it, give some other options the same treatment. Also clean up a small wart where the efi/ subdirectory is listed twice. Let's just list it unconditionally so that both EFI and UEFI_CPER based pieces will be built independently (the latter only depends on the former on !X86) Signed-off-by: Ard Biesheuvel commit 31f1a0edff78c43e8a3bd3692af0db1b25c21b17 Author: Ard Biesheuvel Date: Fri May 20 12:07:58 2022 +0200 efi/x86: libstub: Make DXE calls mixed mode safe The newly added DXE calls use 64-bit quantities, which means we need to marshall them explicitly when running in mixed mode. Currently, we get away without it because we just bail when GetMemorySpaceDescriptor() fails, which is guaranteed to happen due to the function argument mixup. Let's fix this properly, though, by defining the macros that describe how to marshall the arguments. While at it, drop an incorrect cast on a status variable. Signed-off-by: Ard Biesheuvel commit ca209f8b5f61b74782dd4275ebc7173d92cb4905 Author: Lukas Bulwahn Date: Wed Jun 1 13:50:43 2022 +0200 efi: x86: Fix config name for setting the NX-compatibility flag in the PE header Commit 21b68da7bf4a ("efi: x86: Set the NX-compatibility flag in the PE header") intends to set the compatibility flag, i.e., IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, but this ifdef is actually dead as the CONFIG_DXE_MEM_ATTRIBUTES Kconfig option does not exist. The config is actually called EFI_DXE_MEM_ATTRIBUTES. Adjust the ifdef to use the intended config name. The issue was identified with ./scripts/checkkconfigsymbols.py. Fixes: 21b68da7bf4a ("efi: x86: Set the NX-compatibility flag in the PE header") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220601115043.7678-1-lukas.bulwahn@gmail.com Signed-off-by: Ard Biesheuvel commit 86360030cc5117596626bef1d937277cd2bebe05 Author: Dan Carpenter Date: Tue May 31 15:10:05 2022 +0300 net/sched: act_api: fix error code in tcf_ct_flow_table_fill_tuple_ipv6() The tcf_ct_flow_table_fill_tuple_ipv6() function is supposed to return false on failure. It should not return negatives because that means succes/true. Fixes: fcb6aa86532c ("act_ct: Support GRE offload") Signed-off-by: Dan Carpenter Acked-by: Toshiaki Makita Link: https://lore.kernel.org/r/YpYFnbDxFl6tQ3Bn@kili Signed-off-by: Paolo Abeni commit e6652a8ef3e64d953168a95878fe29b934ad78ac Author: Aya Levin Date: Tue May 31 11:45:44 2022 +0300 net: ping6: Fix ping -6 with interface name When passing interface parameter to ping -6: $ ping -6 ::11:141:84:9 -I eth2 Results in: PING ::11:141:84:10(::11:141:84:10) from ::11:141:84:9 eth2: 56 data bytes ping: sendmsg: Invalid argument ping: sendmsg: Invalid argument Initialize the fl6's outgoing interface (OIF) before triggering ip6_datagram_send_ctl. Don't wipe fl6 after ip6_datagram_send_ctl() as changes in fl6 that may happen in the function are overwritten explicitly. Update comment accordingly. Fixes: 13651224c00b ("net: ping6: support setting basic SOL_IPV6 options via cmsg") Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Reviewed-by: Saeed Mahameed Signed-off-by: Tariq Toukan Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220531084544.15126-1-tariqt@nvidia.com Signed-off-by: Paolo Abeni commit 28cbc2d4c54c09a427b18a1604740efb6b2cc2d6 Author: Fabien Parent Date: Sun May 29 17:46:13 2022 +0200 regulator: mt6315-regulator: fix invalid allowed mode In the binding example, the regulator mode 4 is shown as a valid mode, but the driver actually only support mode 0 to 2: This generates an error in dmesg when copy/pasting the binding example: [ 0.306080] vbuck1: invalid regulator-allowed-modes element 4 [ 0.307290] vbuck2: invalid regulator-allowed-modes element 4 This commit fixes this error by removing the invalid mode from the examples. Fixes: 977fb5b58469 ("regulator: document binding for MT6315 regulator") Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20220529154613.337559-1-fparent@baylibre.com Signed-off-by: Mark Brown commit ef8d89b83bf453ea9cc3c4873a84b50ff334f797 Author: Srinivasa Rao Mandadapu Date: Fri May 27 19:40:08 2022 +0530 ASoC: qcom: lpass-platform: Update VMA access permissions in mmap callback Replace page protection permissions from noncashed to writecombine, in lpass codec DMA path mmp callabck, to support 64 bit chromeOS. Avoid SIGBUS error in userspace caused by noncached permissions in 64 bit chromeOS. Signed-off-by: Srinivasa Rao Mandadapu Link: https://lore.kernel.org/r/1653660608-27245-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit aeca8a3295022bcec46697f16e098140423d8463 Author: Hui Wang Date: Mon May 30 12:01:50 2022 +0800 ASoC: nau8822: Add operation for internal PLL off and on We tried to enable the audio on an imx6sx EVB with the codec nau8822, after setting the internal PLL fractional parameters, the audio still couldn't work and the there was no sdma irq at all. After checking with the section "8.1.1 Phase Locked Loop (PLL) Design Example" of "NAU88C22 Datasheet Rev 0.6", we found we need to turn off the PLL before programming fractional parameters and turn on the PLL after programming. After this change, the audio driver could record and play sound and the sdma's irq is triggered when playing or recording. Cc: David Lin Cc: John Hsu Cc: Seven Li Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220530040151.95221-2-hui.wang@canonical.com Signed-off-by: Mark Brown commit 724bbe49c5e427cb077357d72d240a649f2e4054 Author: Mikulas Patocka Date: Mon May 30 13:36:45 2022 +0200 fs/ntfs3: provide block_invalidate_folio to fix memory leak The ntfs3 filesystem lacks the 'invalidate_folio' method and it causes memory leak. If you write to the filesystem and then unmount it, the cached written data are not freed and they are permanently leaked. Fixes: 7ba13abbd31e ("fs: Turn block_invalidatepage into block_invalidate_folio") Reported-by: José Luis Lara Carrascal Signed-off-by: Mikulas Patocka Acked-by: Matthew Wilcox (Oracle) Reviewed-by: Namjae Jeon Signed-off-by: Konstantin Komarov Cc: stable@vger.kernel.org # v5.18 commit e0ffcf3fe18e0310221461c08969edec2cc7628c Author: Heiko Carstens Date: Mon May 30 14:20:50 2022 +0200 s390/stack: add union to reflect kvm stack slot usages Add a union which describes how the empty stack slots are being used by kvm and perf. This should help to avoid another bug like the one which was fixed with commit c9bfb460c3e4 ("s390/perf: obtain sie_block from the right address"). Reviewed-by: Nico Boehr Tested-by: Nico Boehr Signed-off-by: Heiko Carstens commit f037acb41dc9fc0f00521685b3250226d6f9b437 Author: Heiko Carstens Date: Mon May 30 14:09:24 2022 +0200 s390/stack: merge empty stack frame slots Merge empty1 and empty2 arrays within the stack frame to one single array. This is possible since with commit 42b01a553a56 ("s390: always use the packed stack layout") the alternative stack frame layout is gone. Reviewed-by: Nico Boehr Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit d144182ed19af0bed4e4a73b51c7af9caccf6fa2 Author: Heiko Carstens Date: Sun May 29 21:36:16 2022 +0200 s390/uaccess: whitespace cleanup Whitespace cleanup to get rid if some checkpatch findings, but mainly to have consistent coding style within the header file again. Signed-off-by: Heiko Carstens commit a0e3a44bc2a01153fe4ff56fc1ec26832a869437 Author: Heiko Carstens Date: Sun May 29 21:27:48 2022 +0200 s390/uaccess: use __noreturn instead of __attribute__((noreturn)) Signed-off-by: Heiko Carstens commit 454ede3f1424c36bc124f8d7ed4b3ea654654be1 Author: Heiko Carstens Date: Sun May 1 21:26:06 2022 +0200 s390/uaccess: use exception handler to zero result on get_user() failure Historically the uaccess code pre-initializes the result of get_user() (and now also __get_kernel_nofault()) to zero and uses the result as input parameter for inline assemblies. This is different to what most, if not all, other architectures are doing, which set the result to zero within the exception handler in case of a fault. Use the new extable mechanism and handle zeroing of the result within the exception handler in case of a fault. Signed-off-by: Heiko Carstens commit 79a74dac447be957178e8596706b1db3d5c714f4 Author: Heiko Carstens Date: Sun May 29 18:55:06 2022 +0200 s390/uaccess: use symbolic names for inline assembler operands Make code easier to read by using symbolic names. Signed-off-by: Heiko Carstens commit 29ccaa4b35ea874ddd50518e5c2c746b9238a792 Author: Alexander Gordeev Date: Mon May 23 12:38:14 2022 +0200 s390/mcck: isolate SIE instruction when setting CIF_MCCK_GUEST flag Commit d768bd892fc8 ("s390: add options to change branch prediction behaviour for the kernel") introduced .Lsie_exit label - supposedly to fence off SIE instruction. However, the corresponding address range length .Lsie_crit_mcck_length was not updated, which led to BPON code potentionally marked with CIF_MCCK_GUEST flag. Both .Lsie_exit and .Lsie_crit_mcck_length were removed with commit 0b0ed657fe00 ("s390: remove critical section cleanup from entry.S"), but the issue persisted - currently BPOFF and BPENTER macros might get wrongly considered by the machine check handler as a guest. Fixes: d768bd892fc8 ("s390: add options to change branch prediction behaviour for the kernel") Reviewed-by: Sven Schnelle Reviewed-by: Christian Borntraeger Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 3ae11dbcfac906a8c3a480e98660a823130dc16a Author: Christian Borntraeger Date: Mon May 30 11:27:06 2022 +0200 s390/mm: use non-quiescing sske for KVM switch to keyed guest The switch to a keyed guest does not require a classic sske as the other guest CPUs are not accessing the key before the switch is complete. By using the NQ SSKE things are faster especially with multiple guests. Signed-off-by: Christian Borntraeger Suggested-by: Janis Schoetterl-Glausch Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit 6d5946274df1fff539a7eece458a43be733d1db8 Author: Christian Borntraeger Date: Mon May 30 11:27:05 2022 +0200 s390/gmap: voluntarily schedule during key setting With large and many guest with storage keys it is possible to create large latencies or stalls during initial key setting: rcu: INFO: rcu_sched self-detected stall on CPU rcu: 18-....: (2099 ticks this GP) idle=54e/1/0x4000000000000002 softirq=35598716/35598716 fqs=998 (t=2100 jiffies g=155867385 q=20879) Task dump for CPU 18: CPU 1/KVM R running task 0 1030947 256019 0x06000004 Call Trace: sched_show_task rcu_dump_cpu_stacks rcu_sched_clock_irq update_process_times tick_sched_handle tick_sched_timer __hrtimer_run_queues hrtimer_interrupt do_IRQ ext_int_handler ptep_zap_key The mmap lock is held during the page walking but since this is a semaphore scheduling is still possible. Same for the kvm srcu. To minimize overhead do this on every segment table entry or large page. Signed-off-by: Christian Borntraeger Reviewed-by: Alexander Gordeev Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20220530092706.11637-2-borntraeger@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit 315945a43e91c81ebfab0ef011d1dcab419c6d9b Author: Eric Farman Date: Wed May 25 16:40:28 2022 +0200 MAINTAINERS: Update s390 virtio-ccw Add myself to the kernel side of virtio-ccw Signed-off-by: Eric Farman Reviewed-by: Cornelia Huck Acked-by: Halil Pasic Link: https://lore.kernel.org/r/20220525144028.2714489-2-farman@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit 9dade1707fdb4fb6a1d498aa8811779556b7ffbc Author: Heiko Carstens Date: Mon May 30 11:37:48 2022 +0200 s390/kexec: add __GFP_NORETRY to KEXEC_CONTROL_MEMORY_GFP Avoid invoking the OOM-killer when allocating the control page. This is the s390 variant of commit dc5cccacf427 ("kexec: don't invoke OOM-killer for control page allocation"). Signed-off-by: Heiko Carstens commit 13e282cc92d7e4b96fad8b71adf48b7eab22f6b0 Author: Juerg Haefliger Date: Wed May 25 14:01:51 2022 +0200 s390/Kconfig.debug: fix indentation The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220525120151.39594-1-juerg.haefliger@canonical.com Signed-off-by: Heiko Carstens commit 4d1f2e4576af57f8d6b357198dcdda88d0431d5e Author: Juerg Haefliger Date: Wed May 25 14:01:40 2022 +0200 s390/Kconfig: fix indentation The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220525120140.39534-1-juerg.haefliger@canonical.com Signed-off-by: Heiko Carstens commit 196a888ca6571deb344468e1d7138e3273206335 Author: Ziyang Xuan Date: Tue May 31 15:45:00 2022 +0800 macsec: fix UAF bug for real_dev Create a new macsec device but not get reference to real_dev. That can not ensure that real_dev is freed after macsec. That will trigger the UAF bug for real_dev as following: ================================================================== BUG: KASAN: use-after-free in macsec_get_iflink+0x5f/0x70 drivers/net/macsec.c:3662 Call Trace: ... macsec_get_iflink+0x5f/0x70 drivers/net/macsec.c:3662 dev_get_iflink+0x73/0xe0 net/core/dev.c:637 default_operstate net/core/link_watch.c:42 [inline] rfc2863_policy+0x233/0x2d0 net/core/link_watch.c:54 linkwatch_do_dev+0x2a/0x150 net/core/link_watch.c:161 Allocated by task 22209: ... alloc_netdev_mqs+0x98/0x1100 net/core/dev.c:10549 rtnl_create_link+0x9d7/0xc00 net/core/rtnetlink.c:3235 veth_newlink+0x20e/0xa90 drivers/net/veth.c:1748 Freed by task 8: ... kfree+0xd6/0x4d0 mm/slub.c:4552 kvfree+0x42/0x50 mm/util.c:615 device_release+0x9f/0x240 drivers/base/core.c:2229 kobject_cleanup lib/kobject.c:673 [inline] kobject_release lib/kobject.c:704 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:721 netdev_run_todo+0x72e/0x10b0 net/core/dev.c:10327 After commit faab39f63c1f ("net: allow out-of-order netdev unregistration") and commit e5f80fcf869a ("ipv6: give an IPv6 dev to blackhole_netdev"), we can add dev_hold_track() in macsec_dev_init() and dev_put_track() in macsec_free_netdev() to fix the problem. Fixes: 2bce1ebed17d ("macsec: fix refcnt leak in module exit routine") Reported-by: syzbot+d0e94b65ac259c29ce7a@syzkaller.appspotmail.com Signed-off-by: Ziyang Xuan Link: https://lore.kernel.org/r/20220531074500.1272846-1-william.xuanziyang@huawei.com Signed-off-by: Paolo Abeni commit 597b89d30b42dcc8e6b262e6876b42dde66f97f0 Author: Mikko Perttunen Date: Mon May 16 11:52:51 2022 +0300 gpu: host1x: Add context bus The context bus is a "dummy" bus that contains struct devices that correspond to IOMMU contexts assigned through Host1x to processes. Even when host1x itself is built as a module, the bus is registered in built-in code so that the built-in ARM SMMU driver is able to reference it. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit f3d671c711097a133bc36bd2bde52f1fcca783a6 Author: Dan Carpenter Date: Tue May 31 10:28:45 2022 +0300 octeontx2-af: fix error code in is_valid_offset() The is_valid_offset() function returns success/true if the call to validate_and_get_cpt_blkaddr() fails. Fixes: ecad2ce8c48f ("octeontx2-af: cn10k: Add mailbox to configure reassembly timeout") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YpXDrTPb8qV01JSP@kili Signed-off-by: Paolo Abeni commit 2965c4cdf7ad9ce0796fac5e57debb9519ea721e Author: Johannes Berg Date: Wed Jun 1 09:19:36 2022 +0200 wifi: mac80211: fix use-after-free in chanctx code In ieee80211_vif_use_reserved_context(), when we have an old context and the new context's replace_state is set to IEEE80211_CHANCTX_REPLACE_NONE, we free the old context in ieee80211_vif_use_reserved_reassign(). Therefore, we cannot check the old_ctx anymore, so we should set it to NULL after this point. However, since the new_ctx replace state is clearly not IEEE80211_CHANCTX_REPLACES_OTHER, we're not going to do anything else in this function and can just return to avoid accessing the freed old_ctx. Cc: stable@vger.kernel.org Fixes: 5bcae31d9cb1 ("mac80211: implement multi-vif in-place reservations") Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220601091926.df419d91b165.I17a9b3894ff0b8323ce2afdb153b101124c821e5@changeid commit c4caa500ffebf64795d1c0f6f9d6f179b502c6b7 Author: Hangbin Liu Date: Tue May 31 14:37:27 2022 +0800 bonding: guard ns_targets by CONFIG_IPV6 Guard ns_targets in struct bond_params by CONFIG_IPV6, which could save 256 bytes if IPv6 not configed. Also add this protection for function bond_is_ip6_target_ok() and bond_get_targets_ip6(). Remove the IS_ENABLED() check for bond_opts[] as this will make BOND_OPT_NS_TARGETS uninitialized if CONFIG_IPV6 not enabled. Add a dummy bond_option_ns_ip6_targets_set() for this situation. Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets") Signed-off-by: Hangbin Liu Acked-by: Jonathan Toppins Link: https://lore.kernel.org/r/20220531063727.224043-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit 1dc6ff02c8bf77d71b9b5d11cbc9df77cfb28626 Author: Josh Poimboeuf Date: Mon May 23 09:11:49 2022 -0700 x86/speculation/mmio: Print SMT warning Similar to MDS and TAA, print a warning if SMT is enabled for the MMIO Stale Data vulnerability. Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner commit 672362cbe6df049299c8ed0a463d89daf66b081c Merge: 079d93b7dba83 ab0925ab72816 Author: Takashi Iwai Date: Wed Jun 1 10:23:35 2022 +0200 Merge tag 'asoc-fix-v5.19-rc0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.19 A few more fixes that came in during the merge window - nothing huge here, there is one core fix for DPCM from Pierre but mostly driver changes. commit bd8bb9aed56b1814784a975e2dfea12a9adcee92 Author: Jason Wang Date: Tue May 24 13:55:57 2022 +0800 vdpa: ifcvf: set pci driver data in probe We should set the pci driver data in probe instead of the vdpa device adding callback. Otherwise if no vDPA device is created we will lose the pointer to the management device. Fixes: 6b5df347c6482 ("vDPA/ifcvf: implement management netlink framework for ifcvf") Tested-by: Zheyu Ma Signed-off-by: Jason Wang Message-Id: <20220524055557.1938-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit baf2ad3f6a985354293e371b9ba12b162d639e29 Author: Eli Cohen Date: Mon Apr 11 15:29:42 2022 +0300 vdpa/mlx5: Add RX MAC VLAN filter support Support HW offloaded filtering of MAC/VLAN packets. To allow that, we add a handler to handle VLAN configurations coming through the control VQ. Two operations are supported. 1. Adding VLAN - in this case, an entry will be added to the RX flow table that will allow the combination of the MAC/VLAN to be forwarded to the TIR. 2. Removing VLAN - will remove the entry from the flow table, effectively blocking such packets from going through. Currently the control VQ does not propagate changes to the MAC of the VLAN device so we always use the MAC of the parent device. Examples: 1. Create vlan device: $ ip link add link ens1 name ens1.8 type vlan id 8 Signed-off-by: Eli Cohen Message-Id: <20220411122942.225717-4-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 7becdd13b640a6f91219ae3f201afa03ed67876b Author: Eli Cohen Date: Mon Apr 11 15:29:40 2022 +0300 vdpa/mlx5: Remove flow counter from steering The flow counter has been introduced in early versions of the driver to aid in debugging. It is no longer needed and can harm performance. Remove it. Signed-off-by: Eli Cohen Message-Id: <20220411122942.225717-2-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 41925b105e345ebc84cedb64f59d20cb14a62613 Author: Juergen Gross Date: Mon May 30 10:26:34 2022 +0200 xen: replace xen_remap() with memremap() xen_remap() is used to establish mappings for frames not under direct control of the kernel: for Xenstore and console ring pages, and for grant pages of non-PV guests. Today xen_remap() is defined to use ioremap() on x86 (doing uncached mappings), and ioremap_cache() on Arm (doing cached mappings). Uncached mappings for those use cases are bad for performance, so they should be avoided if possible. As all use cases of xen_remap() don't require uncached mappings (the mapped area is always physical RAM), a mapping using the standard WB cache mode is fine. As sparse is flagging some of the xen_remap() use cases to be not appropriate for iomem(), as the result is not annotated with the __iomem modifier, eliminate xen_remap() completely and replace all use cases with memremap() specifying the MEMREMAP_WB caching mode. xen_unmap() can be replaced with memunmap(). Reported-by: kernel test robot Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Acked-by: Stefano Stabellini Link: https://lore.kernel.org/r/20220530082634.6339-1-jgross@suse.com Signed-off-by: Juergen Gross commit cc391b694ff085f62f133e6b8f864d43a8e69dfd Author: Vincent Whitchurch Date: Wed Jun 1 00:03:18 2022 -0500 cifs: fix potential deadlock in direct reclaim The srv_mutex is used during writeback so cifs should ensure that allocations done when that mutex is held are done with GFP_NOFS, to avoid having direct reclaim ending up waiting for the same mutex and causing a deadlock. This is detected by lockdep with the splat below: ====================================================== WARNING: possible circular locking dependency detected 5.18.0 #70 Not tainted ------------------------------------------------------ kswapd0/49 is trying to acquire lock: ffff8880195782e0 (&tcp_ses->srv_mutex){+.+.}-{3:3}, at: compound_send_recv but task is already holding lock: ffffffffa98e66c0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: fs_reclaim_acquire kmem_cache_alloc_trace __request_module crypto_alg_mod_lookup crypto_alloc_tfm_node crypto_alloc_shash cifs_alloc_hash smb311_crypto_shash_allocate smb311_update_preauth_hash compound_send_recv cifs_send_recv SMB2_negotiate smb2_negotiate cifs_negotiate_protocol cifs_get_smb_ses cifs_mount cifs_smb3_do_mount smb3_get_tree vfs_get_tree path_mount __x64_sys_mount do_syscall_64 entry_SYSCALL_64_after_hwframe -> #0 (&tcp_ses->srv_mutex){+.+.}-{3:3}: __lock_acquire lock_acquire __mutex_lock mutex_lock_nested compound_send_recv cifs_send_recv SMB2_write smb2_sync_write cifs_write cifs_writepage_locked cifs_writepage shrink_page_list shrink_lruvec shrink_node balance_pgdat kswapd kthread ret_from_fork other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&tcp_ses->srv_mutex); lock(fs_reclaim); lock(&tcp_ses->srv_mutex); *** DEADLOCK *** 1 lock held by kswapd0/49: #0: ffffffffa98e66c0 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat stack backtrace: CPU: 2 PID: 49 Comm: kswapd0 Not tainted 5.18.0 #70 Call Trace: dump_stack_lvl dump_stack print_circular_bug.cold check_noncircular __lock_acquire lock_acquire __mutex_lock mutex_lock_nested compound_send_recv cifs_send_recv SMB2_write smb2_sync_write cifs_write cifs_writepage_locked cifs_writepage shrink_page_list shrink_lruvec shrink_node balance_pgdat kswapd kthread ret_from_fork Fix this by using the memalloc_nofs_save/restore APIs around the places where the srv_mutex is held. Do this in a wrapper function for the lock/unlock of the srv_mutex, and rename the srv_mutex to avoid missing call sites in the conversion. Note that there is another lockdep warning involving internal crypto locks, which was masked by this problem and is visible after this fix, see the discussion in this thread: https://lore.kernel.org/all/20220523123755.GA13668@axis.com/ Link: https://lore.kernel.org/r/CANT5p=rqcYfYMVHirqvdnnca4Mo+JQSw5Qu12v=kPfpk5yhhmg@mail.gmail.com/ Reported-by: Shyam Prasad N Suggested-by: Lars Persson Reviewed-by: Ronnie Sahlberg Reviewed-by: Enzo Matsumiya Signed-off-by: Vincent Whitchurch Signed-off-by: Steve French commit 0a375c822497ed6ad6b5da0792a12a6f1af10c0b Author: Eric Dumazet Date: Mon May 30 14:37:13 2022 -0700 tcp: tcp_rtx_synack() can be called from process context Laurent reported the enclosed report [1] This bug triggers with following coditions: 0) Kernel built with CONFIG_DEBUG_PREEMPT=y 1) A new passive FastOpen TCP socket is created. This FO socket waits for an ACK coming from client to be a complete ESTABLISHED one. 2) A socket operation on this socket goes through lock_sock() release_sock() dance. 3) While the socket is owned by the user in step 2), a retransmit of the SYN is received and stored in socket backlog. 4) At release_sock() time, the socket backlog is processed while in process context. 5) A SYNACK packet is cooked in response of the SYN retransmit. 6) -> tcp_rtx_synack() is called in process context. Before blamed commit, tcp_rtx_synack() was always called from BH handler, from a timer handler. Fix this by using TCP_INC_STATS() & NET_INC_STATS() which do not assume caller is in non preemptible context. [1] BUG: using __this_cpu_add() in preemptible [00000000] code: epollpep/2180 caller is tcp_rtx_synack.part.0+0x36/0xc0 CPU: 10 PID: 2180 Comm: epollpep Tainted: G OE 5.16.0-0.bpo.4-amd64 #1 Debian 5.16.12-1~bpo11+1 Hardware name: Supermicro SYS-5039MC-H8TRF/X11SCD-F, BIOS 1.7 11/23/2021 Call Trace: dump_stack_lvl+0x48/0x5e check_preemption_disabled+0xde/0xe0 tcp_rtx_synack.part.0+0x36/0xc0 tcp_rtx_synack+0x8d/0xa0 ? kmem_cache_alloc+0x2e0/0x3e0 ? apparmor_file_alloc_security+0x3b/0x1f0 inet_rtx_syn_ack+0x16/0x30 tcp_check_req+0x367/0x610 tcp_rcv_state_process+0x91/0xf60 ? get_nohz_timer_target+0x18/0x1a0 ? lock_timer_base+0x61/0x80 ? preempt_count_add+0x68/0xa0 tcp_v4_do_rcv+0xbd/0x270 __release_sock+0x6d/0xb0 release_sock+0x2b/0x90 sock_setsockopt+0x138/0x1140 ? __sys_getsockname+0x7e/0xc0 ? aa_sk_perm+0x3e/0x1a0 __sys_setsockopt+0x198/0x1e0 __x64_sys_setsockopt+0x21/0x30 do_syscall_64+0x38/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 168a8f58059a ("tcp: TCP Fast Open Server - main code path") Signed-off-by: Eric Dumazet Reported-by: Laurent Fasnacht Acked-by: Neal Cardwell Link: https://lore.kernel.org/r/20220530213713.601888-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit b3c0a9efbe0e9471afae2986201da09c046bbd77 Merge: 2e8728c955ce0 97629b237a8cb Author: Jakub Kicinski Date: Tue May 31 20:58:24 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Missing proper sanitization for nft_set_desc_concat_parse(). 2) Missing mutex in nf_tables pre_exit path. 3) Possible double hook unregistration from clean_net path. 4) Missing FLOWI_FLAG_ANYSRC flag in flowtable route lookup. Fix incorrect source and destination address in case of NAT. Patch from wenxu. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: flowtable: fix nft_flow_route source address for nat case netfilter: flowtable: fix missing FLOWI_FLAG_ANYSRC flag netfilter: nf_tables: double hook unregistration in netns path netfilter: nf_tables: hold mutex on netns pre_exit path netfilter: nf_tables: sanitize nft_set_desc_concat_parse() ==================== Link: https://lore.kernel.org/r/20220531215839.84765-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 2e8728c955ce0624b958eee6e030a37aca3a5d86 Author: Guoju Fang Date: Sat May 28 18:16:28 2022 +0800 net: sched: add barrier to fix packet stuck problem for lockless qdisc In qdisc_run_end(), the spin_unlock() only has store-release semantic, which guarantees all earlier memory access are visible before it. But the subsequent test_bit() has no barrier semantics so may be reordered ahead of the spin_unlock(). The store-load reordering may cause a packet stuck problem. The concurrent operations can be described as below, CPU 0 | CPU 1 qdisc_run_end() | qdisc_run_begin() . | . ----> /* may be reorderd here */ | . | . | . | spin_unlock() | set_bit() | . | smp_mb__after_atomic() ---- test_bit() | spin_trylock() . | . Consider the following sequence of events: CPU 0 reorder test_bit() ahead and see MISSED = 0 CPU 1 calls set_bit() CPU 1 calls spin_trylock() and return fail CPU 0 executes spin_unlock() At the end of the sequence, CPU 0 calls spin_unlock() and does nothing because it see MISSED = 0. The skb on CPU 1 has beed enqueued but no one take it, until the next cpu pushing to the qdisc (if ever ...) will notice and dequeue it. This patch fix this by adding one explicit barrier. As spin_unlock() and test_bit() ordering is a store-load ordering, a full memory barrier smp_mb() is needed here. Fixes: a90c57f2cedd ("net: sched: fix packet stuck problem for lockless qdisc") Signed-off-by: Guoju Fang Link: https://lore.kernel.org/r/20220528101628.120193-1-gjfang@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 0a1e19c8a639545ab5912913aba2dd3893cf72fa Author: Rob Herring Date: Wed May 25 20:41:48 2022 -0500 dt-bindings: net: Fix unevaluatedProperties warnings in examples The 'unevaluatedProperties' schema checks is not fully working and doesn't catch some cases where there's a $ref to another schema. A fix is pending, but results in new warnings in examples. Fix the warnings by removing spurious properties or adding missing properties to the schema. Signed-off-by: Rob Herring Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220526014149.2872762-1-robh@kernel.org commit bcd7ec2cd720d5034a95d42f7ba3276b5e917bda Author: Rob Herring Date: Wed May 25 16:01:16 2022 -0500 dt-bindings: PCI: socionext,uniphier-pcie: Add missing child interrupt controller The Socionext interrupt controller internal to the the PCI block isn't documented which causes warnings when unevaluatedProperties check is also fixed. Add the 'interrupt-controller' child node and properties and fixup the example so that interrupt properties can be parsed. Signed-off-by: Rob Herring Reviewed-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20220525210117.2489333-1-robh@kernel.org commit cdc46fa81cc00b8ae222f979320a14b902acc074 Author: Rob Herring Date: Wed May 25 20:41:18 2022 -0500 dt-bindings: usb: snps,dwc3: Add missing 'dma-coherent' property The 'unevaluatedProperties' schema checks is not fully working and doesn't catch some cases where there's a $ref to another schema. A fix is pending, but results in new warnings in examples. Some DWC3 implementations such as Xilinx are hooked up coherently and need to set the 'dma-coherent' property. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220526014118.2872057-1-robh@kernel.org commit 15e1a9bc41c9e263d1f925f4d5b7e91043470720 Author: Laurent Pinchart Date: Tue May 10 23:05:43 2022 +0300 dt-bindings: soc: imx8mp-media-blk-ctrl: Fix DT example The DT example incorrectly names the ISP power domain "isp1" instead of "isp". This causes a validation failure: Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.example.dtb: blk-ctl@32ec0000: power-domain-names:7: 'isp' was expected From schema: Documentation/devicetree/bindings/soc/imx/fsl,imx8mp-media-blk-ctrl.yaml Fix it. Fixes: 8b3dd27bfe47 ("dt-bindings: soc: Add i.MX8MP media block control DT bindings") Reported-by: Rob Herring Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Acked-by: Rob Herring Reviewed-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220510200543.13482-1-laurent.pinchart@ideasonboard.com commit bf23729c7a5f44f0e863666b9364a64741fd3241 Merge: e573a3cd56d10 9bdc1992c925a Author: Dave Airlie Date: Wed Jun 1 10:56:11 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-05-26-2' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-05-26-2: amdgpu: - Update fdinfo to the common drm format UAPI: - Add VM_NOALLOC GPUVM attribute to prevent buffers for going into the MALL Add AMDGPU_GEM_CREATE_DISCARDABLE flag to create buffers that can be discarded on eviction Mesa code which uses these: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16466 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220526202546.66860-1-alexander.deucher@amd.com commit e573a3cd56d10664a89f199606d3c827fd744fd5 Merge: c4955d9cd2fc5 62e9bd20035b5 Author: Dave Airlie Date: Wed Jun 1 10:37:20 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-05-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-05-26: amdgpu: - Link training fixes - DPIA fixes - Misc code cleanups - Aux fixes - Hotplug fixes - More FP clean up - Misc GFX9/10 fixes - Fix a possible memory leak in SMU shutdown - SMU 13 updates - RAS fixes - TMZ fixes - GC 11 updates - SMU 11 metrics fixes - Fix coverage blend mode for overlay plane - Note DDR vs LPDDR memory - Fuzz fix for CS IOCTL - Add new PCI DID amdkfd: - Clean up hive setup - Misc fixes radeon: - Fix a possible NULL pointer dereference Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220526200641.64097-1-alexander.deucher@amd.com commit 700170bf6b4d773e328fa54ebb70ba444007c702 Merge: 1501f707d2b24 118f09eda21d3 Author: Linus Torvalds Date: Tue May 31 16:58:24 2022 -0700 Merge tag 'nfs-for-5.19-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "New Features: - Add support for 'dacl' and 'sacl' attributes Bugfixes and Cleanups: - Fixes for reporting mapping errors - Fixes for memory allocation errors - Improve warning message when locks are lost - Update documentation for the nfs4_unique_id parameter - Add an explanation of NFSv4 client identifiers - Ensure the i_size attribute is written to the fscache storage - Fix freeing uninitialized nfs4_labels - Better handling when xprtrdma bc_serv is NULL - Mark qualified async operations as MOVEABLE tasks" * tag 'nfs-for-5.19-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFSv4.1 mark qualified async operations as MOVEABLE tasks xprtrdma: treat all calls not a bcall when bc_serv is NULL NFSv4: Fix free of uninitialized nfs4_label on referral lookup. NFS: Pass i_size to fscache_unuse_cookie() when a file is released Documentation: Add an explanation of NFSv4 client identifiers NFS: update documentation for the nfs4_unique_id parameter NFS: Improve warning message when locks are lost. NFSv4.1: Enable access to the NFSv4.1 'dacl' and 'sacl' attributes NFSv4: Add encoders/decoders for the NFSv4.1 dacl and sacl attributes NFSv4: Specify the type of ACL to cache NFSv4: Don't hold the layoutget locks across multiple RPC calls pNFS/files: Fall back to I/O through the MDS on non-fatal layout errors NFS: Further fixes to the writeback error handling NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout NFS: Memory allocation failures are not server fatal errors NFS: Don't report errors from nfs_pageio_complete() more than once NFS: Do not report flush errors in nfs_write_end() NFS: Don't report ENOSPC write errors twice NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS NFS: Do not report EINTR/ERESTARTSYS as mapping errors commit 1501f707d2b24316b41d45bdc95a73bc8cc8dd49 Merge: 2a5699b0de4ee 2d1fe8a86bf5e Author: Linus Torvalds Date: Tue May 31 16:52:59 2022 -0700 Merge tag 'f2fs-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this round, we've refactored the existing atomic write support implemented by in-memory operations to have storing data in disk temporarily, which can give us a benefit to accept more atomic writes. At the same time, we removed the existing volatile write support. We've also revisited the file pinning and GC flows and found some corner cases which contributeed abnormal system behaviours. As usual, there're several minor code refactoring for readability, sanity check, and clean ups. Enhancements: - allow compression for mmap files in compress_mode=user - kill volatile write support - change the current atomic write way - give priority to select unpinned section for foreground GC - introduce data read/write showing path info - remove unnecessary f2fs_lock_op in f2fs_new_inode Bug fixes: - fix the file pinning flow during checkpoint=disable and GCs - fix foreground and background GCs to select the right victims and get free sections on time - fix GC flags on defragmenting pages - avoid an infinite loop to flush node pages - fix fallocate to use file_modified to update permissions consistently" * tag 'f2fs-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (40 commits) f2fs: fix to tag gcing flag on page during file defragment f2fs: replace F2FS_I(inode) and sbi by the local variable f2fs: add f2fs_init_write_merge_io function f2fs: avoid unneeded error handling for revoke_entry_slab allocation f2fs: allow compression for mmap files in compress_mode=user f2fs: fix typo in comment f2fs: make f2fs_read_inline_data() more readable f2fs: fix to do sanity check for inline inode f2fs: fix fallocate to use file_modified to update permissions consistently f2fs: don't use casefolded comparison for "." and ".." f2fs: do not stop GC when requiring a free section f2fs: keep wait_ms if EAGAIN happens f2fs: introduce f2fs_gc_control to consolidate f2fs_gc parameters f2fs: reject test_dummy_encryption when !CONFIG_FS_ENCRYPTION f2fs: kill volatile write support f2fs: change the current atomic write way f2fs: don't need inode lock for system hidden quota f2fs: stop allocating pinned sections if EAGAIN happens f2fs: skip GC if possible when checkpoint disabling f2fs: give priority to select unpinned section for foreground GC ... commit f66f8b94e7f2f4ac9fffe710be231ca8f25c5057 Author: Ronnie Sahlberg Date: Wed Jun 1 08:48:38 2022 +1000 cifs: when extending a file with falloc we should make files not-sparse as this is the only way to make sure the region is allocated. Fix the conditional that was wrong and only tried to make already non-sparse files non-sparse. Cc: stable@vger.kernel.org Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 2a5699b0de4ee623d77f183c8e8e62691bd60a70 Merge: f8a52af9d00d5 e98a860f65428 Author: Linus Torvalds Date: Tue May 31 14:38:10 2022 -0700 Merge tag 'leds-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Most significant here is the driver for Qualcomm LPG. Apparently it drives backlight on some boards, so it is quite important for some people" * tag 'leds-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: qcom-lpg: Require pattern to follow documentation leds: lp50xx: Remove duplicated error reporting in .remove() leds: qcom-lpg: add missing PWM dependency leds: ktd2692: Make aux-gpios optional dt-bindings: leds: convert ktd2692 bindings to yaml leds: ktd2692: Avoid duplicate error messages on probe deferral leds: is31fl32xx: Improve error reporting in .remove() leds: Move pwm-multicolor driver into rgb directory leds: Add PWM multicolor driver dt-bindings: leds: Add multicolor PWM LED bindings dt-bindings: leds: Optional multi-led unit address leds: regulator: Make probeable from device tree leds: regulator: Add dev helper variable dt-bindings: leds: Add regulator-led binding leds: pca9532: Make pca9532_destroy_devices() return void leds: Add pm8350c support to Qualcomm LPG driver dt-bindings: leds: Add pm8350c pmic support leds: Add driver for Qualcomm LPG dt-bindings: leds: Add Qualcomm Light Pulse Generator binding commit f8a52af9d00d59fd887d8ad1fa0c2c88a5d775b9 Merge: 35b51afd23c98 3cd4030da3a9b Author: Linus Torvalds Date: Tue May 31 14:34:00 2022 -0700 Merge tag 'i2c-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "Only driver updates for 5.19. Bigger changes are for Meson, NPCM, and R-Car, but there are also changes all over the place" * tag 'i2c-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (34 commits) i2c: meson: fix typo in comment i2c: rcar: use flags instead of atomic_xfer i2c: rcar: REP_AFTER_RD is not a persistent flag i2c: rcar: use BIT macro consistently i2c: qcom-geni: remove unnecessary conditions i2c: mt7621: Use devm_platform_get_and_ioremap_resource() i2c: rcar: refactor handling of first message i2c: rcar: avoid race condition with SMIs i2c: xiic: Correct the datatype for rx_watermark i2c: rcar: fix PM ref counts in probe error paths i2c: npcm: Handle spurious interrupts i2c: npcm: Correct register access width i2c: npcm: Add tx complete counter i2c: npcm: Fix timeout calculation i2c: npcm: Remove unused variable clk_regmap i2c: npcm: Change the way of getting GCR regmap i2c: xiic: Fix Tx Interrupt path for grouped messages i2c: xiic: Fix coding style issues i2c: xiic: return value of xiic_reinit i2c: cadence: Increase timeout per message if necessary ... commit 97629b237a8cb7ac655c3969b8d5e57300ff6598 Author: wenxu Date: Wed May 25 21:25:46 2022 -0400 netfilter: flowtable: fix nft_flow_route source address for nat case For snat and dnat cases, the saddr should be taken from reverse tuple. Fixes: 3412e1641828 (netfilter: flowtable: nft_flow_route use more data for reverse route) Signed-off-by: wenxu Signed-off-by: Pablo Neira Ayuso commit f1896d45fee90a868dfd0b3cc119e4cc1bbd7ca2 Author: wenxu Date: Wed May 25 21:25:45 2022 -0400 netfilter: flowtable: fix missing FLOWI_FLAG_ANYSRC flag The nf_flow_table gets route through ip_route_output_key. If the saddr is not local one, then FLOWI_FLAG_ANYSRC flag should be set. Without this flag, the route lookup for other_dst will fail. Fixes: 3412e1641828 (netfilter: flowtable: nft_flow_route use more data for reverse route) Signed-off-by: wenxu Signed-off-by: Pablo Neira Ayuso commit f9a43007d3f7ba76d5e7f9421094f00f2ef202f8 Author: Pablo Neira Ayuso Date: Mon May 30 18:24:06 2022 +0200 netfilter: nf_tables: double hook unregistration in netns path __nft_release_hooks() is called from pre_netns exit path which unregisters the hooks, then the NETDEV_UNREGISTER event is triggered which unregisters the hooks again. [ 565.221461] WARNING: CPU: 18 PID: 193 at net/netfilter/core.c:495 __nf_unregister_net_hook+0x247/0x270 [...] [ 565.246890] CPU: 18 PID: 193 Comm: kworker/u64:1 Tainted: G E 5.18.0-rc7+ #27 [ 565.253682] Workqueue: netns cleanup_net [ 565.257059] RIP: 0010:__nf_unregister_net_hook+0x247/0x270 [...] [ 565.297120] Call Trace: [ 565.300900] [ 565.304683] nf_tables_flowtable_event+0x16a/0x220 [nf_tables] [ 565.308518] raw_notifier_call_chain+0x63/0x80 [ 565.312386] unregister_netdevice_many+0x54f/0xb50 Unregister and destroy netdev hook from netns pre_exit via kfree_rcu so the NETDEV_UNREGISTER path see unregistered hooks. Fixes: 767d1216bff8 ("netfilter: nftables: fix possible UAF over chains from packet path in netns") Signed-off-by: Pablo Neira Ayuso commit 3923b1e4406680d57da7e873da77b1683035d83f Author: Pablo Neira Ayuso Date: Mon May 30 18:24:05 2022 +0200 netfilter: nf_tables: hold mutex on netns pre_exit path clean_net() runs in workqueue while walking over the lists, grab mutex. Fixes: 767d1216bff8 ("netfilter: nftables: fix possible UAF over chains from packet path in netns") Signed-off-by: Pablo Neira Ayuso commit fecf31ee395b0295f2d7260aa29946b7605f7c85 Author: Pablo Neira Ayuso Date: Fri May 27 09:56:18 2022 +0200 netfilter: nf_tables: sanitize nft_set_desc_concat_parse() Add several sanity checks for nft_set_desc_concat_parse(): - validate desc->field_count not larger than desc->field_len array. - field length cannot be larger than desc->field_len (ie. U8_MAX) - total length of the concatenation cannot be larger than register array. Joint work with Florian Westphal. Fixes: f3a2181e16f1 ("netfilter: nf_tables: Support for sets with multiple ranged fields") Reported-by: Reviewed-by: Stefano Brivio Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 35b51afd23c98e2f055ac563aca36173a12588b9 Merge: e1cbc3b96a997 7699f7aacf3eb Author: Linus Torvalds Date: Tue May 31 14:10:54 2022 -0700 Merge tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Support for the Svpbmt extension, which allows memory attributes to be encoded in pages - Support for the Allwinner D1's implementation of page-based memory attributes - Support for running rv32 binaries on rv64 systems, via the compat subsystem - Support for kexec_file() - Support for the new generic ticket-based spinlocks, which allows us to also move to qrwlock. These should have already gone in through the asm-geneic tree as well - A handful of cleanups and fixes, include some larger ones around atomics and XIP * tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (51 commits) RISC-V: Prepare dropping week attribute from arch_kexec_apply_relocations[_add] riscv: compat: Using seperated vdso_maps for compat_vdso_info RISC-V: Fix the XIP build RISC-V: Split out the XIP fixups into their own file RISC-V: ignore xipImage RISC-V: Avoid empty create_*_mapping definitions riscv: Don't output a bogus mmu-type on a no MMU kernel riscv: atomic: Add custom conditional atomic operation implementation riscv: atomic: Optimize dec_if_positive functions riscv: atomic: Cleanup unnecessary definition RISC-V: Load purgatory in kexec_file RISC-V: Add purgatory RISC-V: Support for kexec_file on panic RISC-V: Add kexec_file support RISC-V: use memcpy for kexec_file mode kexec_file: Fix kexec_file.c build error for riscv platform riscv: compat: Add COMPAT Kbuild skeletal support riscv: compat: ptrace: Add compat_arch_ptrace implement riscv: compat: signal: Add rt_frame implementation riscv: add memory-type errata for T-Head ... commit 5f92df8ddacb4b97f6865a3bf687f240072f4f68 Author: Randy Dunlap Date: Tue May 31 08:54:02 2022 -0700 Input: raspberrypi-ts - add missing HAS_IOMEM dependency Since JOYSTICK_SENSEHAT selects MFD_SIMPLE_MFD_I2C and the latter depends on HAS_IOMEM, and since 'select' does not follow any dependency chains, JOYSTICK_SENSEHAT should also depend on HAS_IOMEM to prevent a kconfig warning and a build error: WARNING: unmet direct dependencies detected for MFD_SIMPLE_MFD_I2C Depends on [n]: HAS_IOMEM [=n] && I2C [=y] Selected by [y]: - JOYSTICK_SENSEHAT [=y] && INPUT_JOYSTICK [=y] && INPUT [=y] && I2C [=y] s390-linux-ld: drivers/mfd/simple-mfd-i2c.o: in function `simple_mfd_i2c_probe': simple-mfd-i2c.c:(.text+0xc8): undefined reference to `devm_mfd_add_devices' Fixes: 41657514c796 ("Input: add Raspberry Pi Sense HAT joystick driver") Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220531022942.16340-1-rdunlap@infradead.org Signed-off-by: Dmitry Torokhov commit 118f09eda21d392e1eeb9f8a4bee044958cccf20 Author: Olga Kornievskaia Date: Wed May 25 12:12:59 2022 -0400 NFSv4.1 mark qualified async operations as MOVEABLE tasks Mark async operations such as RENAME, REMOVE, COMMIT MOVEABLE for the nfsv4.1+ sessions. Fixes: 85e39feead948 ("NFSv4.1 identify and mark RPC tasks that can move between transports") Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 11270e7ca268e8d61b5d9e5c3a54bd1550642c9c Author: Kinglong Mee Date: Sun May 22 20:36:48 2022 +0800 xprtrdma: treat all calls not a bcall when bc_serv is NULL When a rdma server returns a fault format reply, nfs v3 client may treats it as a bcall when bc service is not exist. The debug message at rpcrdma_bc_receive_call are, [56579.837169] RPC: rpcrdma_bc_receive_call: callback XID 00000001, length=20 [56579.837174] RPC: rpcrdma_bc_receive_call: 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 After that, rpcrdma_bc_receive_call will meets NULL pointer as, [ 226.057890] BUG: unable to handle kernel NULL pointer dereference at 00000000000000c8 ... [ 226.058704] RIP: 0010:_raw_spin_lock+0xc/0x20 ... [ 226.059732] Call Trace: [ 226.059878] rpcrdma_bc_receive_call+0x138/0x327 [rpcrdma] [ 226.060011] __ib_process_cq+0x89/0x170 [ib_core] [ 226.060092] ib_cq_poll_work+0x26/0x80 [ib_core] [ 226.060257] process_one_work+0x1a7/0x360 [ 226.060367] ? create_worker+0x1a0/0x1a0 [ 226.060440] worker_thread+0x30/0x390 [ 226.060500] ? create_worker+0x1a0/0x1a0 [ 226.060574] kthread+0x116/0x130 [ 226.060661] ? kthread_flush_work_fn+0x10/0x10 [ 226.060724] ret_from_fork+0x35/0x40 ... Signed-off-by: Kinglong Mee Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker commit c3ed222745d9ad7b69299b349a64ba533c64a34f Author: Benjamin Coddington Date: Sat May 14 07:05:13 2022 -0400 NFSv4: Fix free of uninitialized nfs4_label on referral lookup. Send along the already-allocated fattr along with nfs4_fs_locations, and drop the memcpy of fattr. We end up growing two more allocations, but this fixes up a crash as: PID: 790 TASK: ffff88811b43c000 CPU: 0 COMMAND: "ls" #0 [ffffc90000857920] panic at ffffffff81b9bfde #1 [ffffc900008579c0] do_trap at ffffffff81023a9b #2 [ffffc90000857a10] do_error_trap at ffffffff81023b78 #3 [ffffc90000857a58] exc_stack_segment at ffffffff81be1f45 #4 [ffffc90000857a80] asm_exc_stack_segment at ffffffff81c009de #5 [ffffc90000857b08] nfs_lookup at ffffffffa0302322 [nfs] #6 [ffffc90000857b70] __lookup_slow at ffffffff813a4a5f #7 [ffffc90000857c60] walk_component at ffffffff813a86c4 #8 [ffffc90000857cb8] path_lookupat at ffffffff813a9553 #9 [ffffc90000857cf0] filename_lookup at ffffffff813ab86b Suggested-by: Trond Myklebust Fixes: 9558a007dbc3 ("NFS: Remove the label from the nfs4_lookup_res struct") Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker commit 1c5de097bea31760c3f0467ac0c84ba0dc3525d5 Author: Saeed Mahameed Date: Fri Feb 19 23:10:47 2021 -0800 net/mlx5: Fix mlx5_get_next_dev() peer device matching In some use-cases, mlx5 instances will need to search for their peer device (the other port on the same HCA). For that, mlx5 device matching mechanism relied on auxiliary_find_device() to search, and used a bad matching callback function. This approach has two issues: 1) next_phys_dev() the matching function, assumed all devices are of the type mlx5_adev (mlx5 auxiliary device) which is wrong and could lead to crashes, this worked for a while, since only lately other drivers started registering auxiliary devices. 2) using the auxiliary class bus (auxiliary_find_device) to search for mlx5_core_dev devices, who are actually PCIe device instances, is wrong. This works since mlx5_core always has at least one mlx5_adev instance hanging around in the aux bus. As suggested by others we can fix 1. by comparing device names prefixes if they have the string "mlx5_core" in them, which is not a best practice ! but even with that fixed, still 2. needs fixing, we are trying to match pcie device peers so we should look in the right bus (pci bus), hence this fix. The fix: 1) search the pci bus for mlx5 peer devices, instead of the aux bus 2) to validated devices are the same type "mlx5_core_dev" compare if they have the same driver, which is bulletproof. This wouldn't have worked with the aux bus since the various mlx5 aux device types don't share the same driver, even if they share the same device wrapper struct (mlx5_adev) "which helped to find the parent device" Fixes: a925b5e309c9 ("net/mlx5: Register mlx5 devices to auxiliary virtual bus") Reported-by: Alexander Lobakin Reported-by: Maher Sanalla Signed-off-by: Saeed Mahameed Reviewed-by: Leon Romanovsky Reviewed-by: Mark Bloch Reviewed-by: Maher Sanalla commit f6279f113ad593971999c877eb69dc3d36a75894 Author: Maxim Mikityanskiy Date: Mon May 23 15:39:13 2022 +0300 net/mlx5e: Update netdev features after changing XDP state Some features (LRO, HW GRO) conflict with XDP. If there is an attempt to enable such features while XDP is active, they will be set to `off [requested on]`. In order to activate these features after XDP is turned off, the driver needs to call netdev_update_features(). This commit adds this missing call after XDP state changes. Fixes: cf6e34c8c22f ("net/mlx5e: Properly block LRO when XDP is enabled") Fixes: b0617e7b3500 ("net/mlx5e: Properly block HW GRO when XDP is enabled") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 3fc2a9e89b3508a5cc0c324f26d7b4740ba8c456 Author: Changcheng Liu Date: Tue Apr 26 21:28:14 2022 +0800 net/mlx5: correct ECE offset in query qp output ECE field should be after opt_param_mask in query qp output. Fixes: 6b646a7e4af6 ("net/mlx5: Add ability to read and write ECE options") Signed-off-by: Changcheng Liu Signed-off-by: Saeed Mahameed commit 2e642afb61b24401a7ec819d27ddcd69c7c29784 Author: Maxim Mikityanskiy Date: Fri Apr 15 16:19:15 2022 +0300 net/mlx5e: Disable softirq in mlx5e_activate_rq to avoid race condition When the driver activates the channels, it assumes NAPI isn't running yet. mlx5e_activate_rq posts a NOP WQE to ICOSQ to trigger a hardware interrupt and start NAPI, which will run mlx5e_alloc_rx_mpwqe and post UMR WQEs to ICOSQ to be able to receive packets with striding RQ. Unfortunately, a race condition is possible if NAPI is triggered by something else (for example, TX) at a bad timing, before mlx5e_activate_rq finishes. In this case, mlx5e_alloc_rx_mpwqe may post UMR WQEs to ICOSQ, and with the bad timing, the wqe_info of the first UMR may be overwritten by the wqe_info of the NOP posted by mlx5e_activate_rq. The consequence is that icosq->db.wqe_info[0].num_wqebbs will be changed from MLX5E_UMR_WQEBBS to 1, disrupting the integrity of the array-based linked list in wqe_info[]. mlx5e_poll_ico_cq will hang in an infinite loop after processing wqe_info[0], because after the corruption, the next item to be processed will be wqe_info[1], which is filled with zeros, and `sqcc += wi->num_wqebbs` will never move further. This commit fixes this race condition by using async_icosq to post the NOP and trigger the interrupt. async_icosq is always protected with a spinlock, eliminating the race condition. Fixes: bc77b240b3c5 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE") Signed-off-by: Maxim Mikityanskiy Reported-by: Karsten Nielsen Reviewed-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 1f2856cde64baa78475e6d3c601fb7b7f693a161 Author: Paul Blakey Date: Mon May 23 19:12:21 2022 +0300 net/mlx5: CT: Fix header-rewrite re-use for tupels Tuple entries that don't have nat configured for them which are added to the ct nat table will always create a new modify header, as we don't check for possible re-use on them. The same for tuples that have nat configured for them but are added to ct table. Fix the above by only avoiding wasteful re-use lookup for actually natted entries in ct nat table. Fixes: 7fac5c2eced3 ("net/mlx5: CT: Avoid reusing modify header context for natted entries") Signed-off-by: Paul Blakey Reviewed-by: Ariel Levkovich Signed-off-by: Saeed Mahameed commit 66cb64e292d21588bdb831f08a7ec0ff04d6380d Author: Maor Dickman Date: Mon May 2 10:51:30 2022 +0300 net/mlx5e: TC NIC mode, fix tc chains miss table The cited commit changed promisc table to be created on demand with the highest priority in the NIC table replacing the vlan table, this caused tc NIC tables miss flow to skip the prmoisc table because it use vlan table as miss table. OVS offload in NIC mode use promisc by default so any unicast packet which will be handled by tc NIC tables miss flow will skip the promisc rule and will be dropped. Fix this by adding new empty table in new tc level with low priority and point the nic tc chain miss to it, the new table is managed so it will point to vlan table if promisc is disabled and to promisc table if enabled. Fixes: 1c46d7409f30 ("net/mlx5e: Optimize promiscuous mode") Signed-off-by: Maor Dickman Reviewed-by: Paul Blakey Reviewed-by: Ariel Levkovich Signed-off-by: Saeed Mahameed commit 80b2bd737d0e833e6a2b77e482e5a714a79c86a4 Author: Leon Romanovsky Date: Tue May 24 15:59:27 2022 +0300 net/mlx5: Don't use already freed action pointer The call to mlx5dr_action_destroy() releases "action" memory. That pointer is set to miss_action later and generates the following smatch error: drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c:53 set_miss_action() warn: 'action' was already freed. Make sure that the pointer is always valid by setting NULL after destroy. Fixes: 6a48faeeca10 ("net/mlx5: Add direct rule fs_cmd implementation") Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 4caae58406f8ceb741603eee460d79bacca9b1b5 Author: Sarthak Kukreti Date: Tue May 31 15:56:40 2022 -0400 dm verity: set DM_TARGET_IMMUTABLE feature flag The device-mapper framework provides a mechanism to mark targets as immutable (and hence fail table reloads that try to change the target type). Add the DM_TARGET_IMMUTABLE flag to the dm-verity target's feature flags to prevent switching the verity target with a different target type. Fixes: a4ffc152198e ("dm: add verity target") Cc: stable@vger.kernel.org Signed-off-by: Sarthak Kukreti Reviewed-by: Kees Cook Signed-off-by: Mike Snitzer commit 0d5106a80e08cbbb273f35dc373f4f19e5ec8b03 Author: Enzo Matsumiya Date: Tue May 31 14:27:18 2022 -0300 cifs: remove repeated debug message on cifs_put_smb_ses() Similar message is printed a few lines later in the same function Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French commit 833e53a4ffe92e742e99347c68d99dc33986598b Author: Lorenzo Pieralisi Date: Sat May 28 16:14:11 2022 +0100 MAINTAINERS: Update Lorenzo Pieralisi's email address I will soon lose my @arm.com email address, so to prevent any possible issue let's update all kernel references (inclusive of .mailmap) to my @kernel.org alias ahead of time. My @arm.com address is still working and will likely resume to work at some point in the future; nonetheless, it is safer to switch to the @kernel.org alias from now onwards so that continuity is guaranteed. Link: https://lore.kernel.org/r/20220528151411.29810-1-lorenzo.pieralisi@arm.com Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Cc: Will Deacon Cc: Catalin Marinas commit 12068bb346db5776d0ec9bb4cd073f8427a1ac92 Author: Bjorn Helgaas Date: Thu May 26 16:52:23 2022 -0500 PCI/PM: Fix bridge_d3_blacklist[] Elo i2 overwrite of Gigabyte X299 92597f97a40b ("PCI/PM: Avoid putting Elo i2 PCIe Ports in D3cold") omitted braces around the new Elo i2 entry, so it overwrote the existing Gigabyte X299 entry. Add the appropriate braces. Found by: $ make W=1 drivers/pci/pci.o CC drivers/pci/pci.o drivers/pci/pci.c:2974:12: error: initialized field overwritten [-Werror=override-init] 2974 | .ident = "Elo i2", | ^~~~~~~~ Link: https://lore.kernel.org/r/20220526221258.GA409855@bhelgaas Fixes: 92597f97a40b ("PCI/PM: Avoid putting Elo i2 PCIe Ports in D3cold") Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.15+ commit f4fd559de3434c44bed1d2912bd0c75cfa42898b Author: Bjorn Helgaas Date: Wed May 11 15:18:56 2022 -0500 Revert "PCI: brcmstb: Split brcm_pcie_setup() into two funcs" This reverts commit 830aa6f29f07a4e2f1a947dfa72b3ccddb46dd21. This is part of a revert of the following commits: 11ed8b8624b8 ("PCI: brcmstb: Do not turn off WOL regulators on suspend") 93e41f3fca3d ("PCI: brcmstb: Add control of subdevice voltage regulators") 67211aadcb4b ("PCI: brcmstb: Add mechanism to turn on subdev regulators") 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs") Cyril reported that 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs"), which appeared in v5.17-rc1, broke booting on the Raspberry Pi Compute Module 4. Apparently 830aa6f29f07 panics with an Asynchronous SError Interrupt, and after further commits here is a black screen on HDMI and no output on the serial console. This does not seem to affect the Raspberry Pi 4 B. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215925 Link: https://lore.kernel.org/r/20220511201856.808690-5-helgaas@kernel.org Reported-by: Cyril Brulebois Signed-off-by: Bjorn Helgaas commit 420be2f7ebe60c9ba3e332f5290017cd168e2bf8 Author: Bjorn Helgaas Date: Wed May 11 15:18:55 2022 -0500 Revert "PCI: brcmstb: Add mechanism to turn on subdev regulators" This reverts commit 67211aadcb4b968d0fdc57bc27240fa71500c2d4. This is part of a revert of the following commits: 11ed8b8624b8 ("PCI: brcmstb: Do not turn off WOL regulators on suspend") 93e41f3fca3d ("PCI: brcmstb: Add control of subdevice voltage regulators") 67211aadcb4b ("PCI: brcmstb: Add mechanism to turn on subdev regulators") 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs") Cyril reported that 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs"), which appeared in v5.17-rc1, broke booting on the Raspberry Pi Compute Module 4. Apparently 830aa6f29f07 panics with an Asynchronous SError Interrupt, and after further commits here is a black screen on HDMI and no output on the serial console. This does not seem to affect the Raspberry Pi 4 B. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215925 Link: https://lore.kernel.org/r/20220511201856.808690-4-helgaas@kernel.org Reported-by: Cyril Brulebois Signed-off-by: Bjorn Helgaas commit 212942609d83b591f5a2f2691df122d13aa3a87d Author: Bjorn Helgaas Date: Wed May 11 15:18:54 2022 -0500 Revert "PCI: brcmstb: Add control of subdevice voltage regulators" This reverts commit 93e41f3fca3d4a0f927b784012338c37f80a8a80. This is part of a revert of the following commits: 11ed8b8624b8 ("PCI: brcmstb: Do not turn off WOL regulators on suspend") 93e41f3fca3d ("PCI: brcmstb: Add control of subdevice voltage regulators") 67211aadcb4b ("PCI: brcmstb: Add mechanism to turn on subdev regulators") 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs") Cyril reported that 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs"), which appeared in v5.17-rc1, broke booting on the Raspberry Pi Compute Module 4. Apparently 830aa6f29f07 panics with an Asynchronous SError Interrupt, and after further commits here is a black screen on HDMI and no output on the serial console. This does not seem to affect the Raspberry Pi 4 B. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215925 Link: https://lore.kernel.org/r/20220511201856.808690-3-helgaas@kernel.org Reported-by: Cyril Brulebois Signed-off-by: Bjorn Helgaas commit 7894025c783ca36394d3afe49c8cfb4c830b82fe Author: Bjorn Helgaas Date: Wed May 11 15:18:53 2022 -0500 Revert "PCI: brcmstb: Do not turn off WOL regulators on suspend" This reverts commit 11ed8b8624b8085f706864b4addcd304b1e4fc38. This is part of a revert of the following commits: 11ed8b8624b8 ("PCI: brcmstb: Do not turn off WOL regulators on suspend") 93e41f3fca3d ("PCI: brcmstb: Add control of subdevice voltage regulators") 67211aadcb4b ("PCI: brcmstb: Add mechanism to turn on subdev regulators") 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs") Cyril reported that 830aa6f29f07 ("PCI: brcmstb: Split brcm_pcie_setup() into two funcs"), which appeared in v5.17-rc1, broke booting on the Raspberry Pi Compute Module 4. Apparently 830aa6f29f07 panics with an Asynchronous SError Interrupt, and after further commits here is a black screen on HDMI and no output on the serial console. This does not seem to affect the Raspberry Pi 4 B. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215925 Link: https://lore.kernel.org/r/20220511201856.808690-2-helgaas@kernel.org Reported-by: Cyril Brulebois Signed-off-by: Bjorn Helgaas commit 9571f829f30a89b888ec4c3a72f5a04573f0e058 Author: Mike Snitzer Date: Tue May 31 12:16:49 2022 -0400 dm table: fix dm_table_supports_poll to return false if no data devices It was reported that the "generic/250" test in xfstests (which uses the dm-error target) demonstrates a regression where the kernel crashes in bioset_exit(). Since commit cfc97abcbe0b ("dm: conditionally enable BIOSET_PERCPU_CACHE for dm_io bioset") the bioset_init() for the dm_io bioset will setup the bioset's per-cpu alloc cache if all devices have QUEUE_FLAG_POLL set. But there was an bug where a target that doesn't have any data devices (and that doesn't even set the .iterate_devices dm target callback) will incorrectly return true from dm_table_supports_poll(). Fix this by updating dm_table_supports_poll() to follow dm-table.c's well-worn pattern for testing that _all_ targets in a DM table do in fact have underlying devices that set QUEUE_FLAG_POLL. NOTE: An additional block fix is still needed so that bio_alloc_cache_destroy() clears the bioset's ->cache member. Otherwise, a DM device's table reload that transitions the DM device's bioset from using a per-cpu alloc cache to _not_ using one will result in bioset_exit() crashing in bio_alloc_cache_destroy() because dm's dm_io bioset ("io_bs") was left with a stale ->cache member. Fixes: cfc97abcbe0b ("dm: conditionally enable BIOSET_PERCPU_CACHE for dm_io bioset") Reported-by: Matthew Wilcox Reported-by: Dave Chinner Signed-off-by: Mike Snitzer commit e1cbc3b96a9974746b2a80c3a6c8a0f7eff7b1b5 Merge: 3335d55502562 b0dacee202efb Author: Linus Torvalds Date: Tue May 31 09:56:54 2022 -0700 Merge tag 'iommu-updates-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: - Intel VT-d driver updates: - Domain force snooping improvement. - Cleanups, no intentional functional changes. - ARM SMMU driver updates: - Add new Qualcomm device-tree compatible strings - Add new Nvidia device-tree compatible string for Tegra234 - Fix UAF in SMMUv3 shared virtual addressing code - Force identity-mapped domains for users of ye olde SMMU legacy binding - Minor cleanups - Fix a BUG_ON in the vfio_iommu_group_notifier: - Groundwork for upcoming iommufd framework - Introduction of DMA ownership so that an entire IOMMU group is either controlled by the kernel or by user-space - MT8195 and MT8186 support in the Mediatek IOMMU driver - Make forcing of cache-coherent DMA more coherent between IOMMU drivers - Fixes for thunderbolt device DMA protection - Various smaller fixes and cleanups * tag 'iommu-updates-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (88 commits) iommu/amd: Increase timeout waiting for GA log enablement iommu/s390: Tolerate repeat attach_dev calls iommu/vt-d: Remove hard coding PGSNP bit in PASID entries iommu/vt-d: Remove domain_update_iommu_snooping() iommu/vt-d: Check domain force_snooping against attached devices iommu/vt-d: Block force-snoop domain attaching if no SC support iommu/vt-d: Size Page Request Queue to avoid overflow condition iommu/vt-d: Fold dmar_insert_one_dev_info() into its caller iommu/vt-d: Change return type of dmar_insert_one_dev_info() iommu/vt-d: Remove unneeded validity check on dev iommu/dma: Explicitly sort PCI DMA windows iommu/dma: Fix iova map result check bug iommu/mediatek: Fix NULL pointer dereference when printing dev_name iommu: iommu_group_claim_dma_owner() must always assign a domain iommu/arm-smmu: Force identity domains for legacy binding iommu/arm-smmu: Support Tegra234 SMMU dt-bindings: arm-smmu: Add compatible for Tegra234 SOC dt-bindings: arm-smmu: Document nvidia,memory-controller property iommu/arm-smmu-qcom: Add SC8280XP support dt-bindings: arm-smmu: Add compatible for Qualcomm SC8280XP ... commit 3335d5550256210c9b213f67240221633d8f7b53 Merge: 8ab2afa23bd19 78b5f52ab6f60 Author: Linus Torvalds Date: Tue May 31 09:46:23 2022 -0700 Merge tag 'microblaze-v5.19' of git://git.monstr.eu/linux-2.6-microblaze Pull microblaze updates from Michal Simek: - Fix issues with freestanding - Wire memblock_dump_all() - Add support for memory reservation from DT * tag 'microblaze-v5.19' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: fix typos in comments microblaze: Add support for reserved memory defined by DT microblaze: Wire memblock_dump_all() microblaze: Use simple memmove/memcpy implementation from lib/string.c microblaze: Do loop unrolling for optimized memset implementation microblaze: Use simple memset implementation from lib/string.c commit b2ffa407ed5dd931d6b0657cc8824aa0f4e73a7a Author: Mike Christie Date: Tue May 17 13:08:50 2022 -0500 vhost: rename vhost_work_dev_flush This patch renames vhost_work_dev_flush to just vhost_dev_flush to relfect that it flushes everything on the device and that drivers don't know/care that polls are based on vhost_works. Drivers just flush the entire device and polls, and works for vhost-scsi management TMFs and IO net virtqueues, etc all are flushed. Signed-off-by: Mike Christie Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Message-Id: <20220517180850.198915-9-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit f3a1aad9a448e40d4833913cbd50aeec538a74fe Author: Mike Christie Date: Tue May 17 13:08:49 2022 -0500 vhost-test: drop flush after vhost_dev_cleanup The flush after vhost_dev_cleanup is not needed because: 1. It doesn't do anything. vhost_dev_cleanup will stop the worker thread so the flush call will just return since the worker has not device. 2. It's not needed. The comment about jobs re-queueing themselves does not look correct because handle_vq does not requeue work. Signed-off-by: Mike Christie Acked-by: Jason Wang Message-Id: <20220517180850.198915-8-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit c3d284cf789ddf7a99ed7f414092ed9ea75aa883 Author: Mike Christie Date: Tue May 17 13:08:48 2022 -0500 vhost-scsi: drop flush after vhost_dev_cleanup The flush after vhost_dev_cleanup is not needed because: 1. It doesn't do anything. vhost_dev_cleanup will stop the worker thread so the flush call will just return since the worker has not device. 2. It's not needed for the re-queue case. vhost_scsi_evt_handle_kick grabs the mutex and if the backend is NULL will return without queueing a work. vhost_scsi_clear_endpoint will set the backend to NULL under the vq->mutex then drops the mutex and does a flush. So we know when vhost_scsi_clear_endpoint has dropped the mutex after clearing the backend no evt related work will be able to requeue. The flush would then make sure any queued evts are run and return. Signed-off-by: Mike Christie Acked-by: Jason Wang Message-Id: <20220517180850.198915-7-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 15538ba5ffaa5cbdfd11161ded503b27f5c1f0af Author: Andrey Ryabinin Date: Tue May 17 13:08:47 2022 -0500 vhost_vsock: simplify vhost_vsock_flush() vhost_vsock_flush() calls vhost_work_dev_flush(vsock->vqs[i].poll.dev) before vhost_work_dev_flush(&vsock->dev). This seems pointless as vsock->vqs[i].poll.dev is the same as &vsock->dev and several flushes in a row doesn't do anything useful, one is just enough. Signed-off-by: Andrey Ryabinin Reviewed-by: Stefano Garzarella Signed-off-by: Mike Christie Acked-by: Jason Wang Message-Id: <20220517180850.198915-6-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit c5514758ddd9a774d879b098bf7364c45a76bed5 Author: Andrey Ryabinin Date: Tue May 17 13:08:46 2022 -0500 vhost_test: remove vhost_test_flush_vq() vhost_test_flush_vq() just a simple wrapper around vhost_work_dev_flush() which seems have no value. It's just easier to call vhost_work_dev_flush() directly. Besides there is no point in obtaining vhost_dev pointer via 'n->vqs[index].poll.dev' while we can just use &n->dev. It's the same pointers, see vhost_test_open()/vhost_dev_init(). Signed-off-by: Andrey Ryabinin Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Acked-by: Jason Wang Message-Id: <20220517180850.198915-5-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 2c029f3298594c5160ae1036f03db607fa891484 Author: Andrey Ryabinin Date: Tue May 17 13:08:45 2022 -0500 vhost_net: get rid of vhost_net_flush_vq() and extra flush calls vhost_net_flush_vq() calls vhost_work_dev_flush() twice passing vhost_dev pointer obtained via 'n->poll[index].dev' and 'n->vqs[index].vq.poll.dev'. This is actually the same pointer, initialized in vhost_net_open()/vhost_dev_init()/vhost_poll_init() Remove vhost_net_flush_vq() and call vhost_work_dev_flush() directly. Do the flushes only once instead of several flush calls in a row which seems rather useless. Signed-off-by: Andrey Ryabinin [drop vhost_dev forward declaration in vhost.h] Signed-off-by: Mike Christie Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Message-Id: <20220517180850.198915-4-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 6ca84326c283e2f5d4ea920dec6f9d4272e4d124 Author: Mike Christie Date: Tue May 17 13:08:44 2022 -0500 vhost: flush dev once during vhost_dev_stop When vhost_work_dev_flush returns all work queued at that time will have completed. There is then no need to flush after every vhost_poll_stop call, and we can move the flush call to after the loop that stops the pollers. Signed-off-by: Mike Christie Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Message-Id: <20220517180850.198915-3-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit 6fcf224c379f07c73fb972007c93db8c05d930d7 Author: Andrey Ryabinin Date: Tue May 17 13:08:43 2022 -0500 vhost: get rid of vhost_poll_flush() wrapper vhost_poll_flush() is a simple wrapper around vhost_work_dev_flush(). It gives wrong impression that we are doing some work over vhost_poll, while in fact it flushes vhost_poll->dev. It only complicate understanding of the code and leads to mistakes like flushing the same vhost_dev several times in a row. Just remove vhost_poll_flush() and call vhost_work_dev_flush() directly. Signed-off-by: Andrey Ryabinin [merge vhost_poll_flush removal from Stefano Garzarella] Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Acked-by: Jason Wang Reviewed-by: Stefano Garzarella Message-Id: <20220517180850.198915-2-michael.christie@oracle.com> Signed-off-by: Michael S. Tsirkin commit f4a8686ec7a34f940d36784872036fbacb1b4623 Author: Dan Carpenter Date: Mon May 23 11:33:26 2022 +0300 vhost-vdpa: return -EFAULT on copy_to_user() failure The copy_to_user() function returns the number of bytes remaining to be copied. However, we need to return a negative error code, -EFAULT, to the user. Fixes: 87f4c217413a ("vhost-vdpa: introduce uAPI to get the number of virtqueue groups") Fixes: e96ef636f154 ("vhost-vdpa: introduce uAPI to get the number of address spaces") Signed-off-by: Dan Carpenter Message-Id: Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 1f97b9785076d32fbabb8fa23889f9969c84118d Author: Dan Carpenter Date: Mon May 23 11:30:57 2022 +0300 vdpasim: Off by one in vdpasim_set_group_asid() The > comparison needs to be >= to prevent an out of bounds access of the vdpasim->iommu[] array. The vdpasim->iommu[] is allocated in vdpasim_create() and it has vdpasim->dev_attr.nas elements. Fixes: 87e5afeac247 ("vdpasim: control virtqueue support") Signed-off-by: Dan Carpenter Message-Id: Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 4f58afd6eb177a75dec61c65fdc72db31db93c82 Author: keliu Date: Fri May 27 07:33:02 2022 +0000 virtio: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu Message-Id: <20220527073302.2474073-1-liuke94@huawei.com> Signed-off-by: Michael S. Tsirkin commit 619e9e14ba3c97a80776c0b5a68a01caa41dd148 Author: Jason Wang Date: Fri May 27 14:01:20 2022 +0800 virtio: use WARN_ON() to warning illegal status value We used to use BUG_ON() in virtio_device_ready() to detect illegal status value, this seems sub-optimal since the value is under the control of the device. Switch to use WARN_ON() instead. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-10-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 8b4ec69d7e098a7ddf832e1e7840de53ed474c77 Author: Jason Wang Date: Fri May 27 14:01:19 2022 +0800 virtio: harden vring IRQ This is a rework on the previous IRQ hardening that is done for virtio-pci where several drawbacks were found and were reverted: 1) try to use IRQF_NO_AUTOEN which is not friendly to affinity managed IRQ that is used by some device such as virtio-blk 2) done only for PCI transport The vq->broken is re-used in this patch for implementing the IRQ hardening. The vq->broken is set to true during both initialization and reset. And the vq->broken is set to false in virtio_device_ready(). Then vring_interrupt() can check and return when vq->broken is true. And in this case, switch to return IRQ_NONE to let the interrupt core aware of such invalid interrupt to prevent IRQ storm. The reason of using a per queue variable instead of a per device one is that we may need it for per queue reset hardening in the future. Note that the hardening is only done for vring interrupt since the config interrupt hardening is already done in commit 22b7050a024d7 ("virtio: defer config changed notifications"). But the method that is used by config interrupt can't be reused by the vring interrupt handler because it uses spinlock to do the synchronization which is expensive. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-9-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit be83f04d2529e8dc4273efdd1ccf7b7502741071 Author: Jason Wang Date: Fri May 27 14:01:18 2022 +0800 virtio: allow to unbreak virtqueue This patch allows the new introduced __virtio_break_device() to unbreak the virtqueue. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-8-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 3a232277c1ac6df70552129a9722abc6ab250128 Author: Jason Wang Date: Fri May 27 14:01:17 2022 +0800 virtio-ccw: implement synchronize_cbs() This patch tries to implement the synchronize_cbs() for ccw. For the vring_interrupt() that is called via virtio_airq_handler(), the synchronization is simply done via the airq_info's lock. For the vring_interrupt() that is called via virtio_ccw_int_handler(), a per device rwlock is introduced and used in the synchronization method. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Halil Pasic Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-7-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin commit 9e9b2893284fa0681ab5c0632d02214385a174c3 Author: Jason Wang Date: Fri May 27 14:01:16 2022 +0800 virtio-mmio: implement synchronize_cbs() Simply synchronize the platform irq that is used by us. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-6-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 48b3dd24382139a239a43bca7c1c632438d1dfb2 Author: Jason Wang Date: Fri May 27 14:01:15 2022 +0800 virtio-pci: implement synchronize_cbs() We can simply reuse vp_synchronize_vectors() for .synchronize_cbs(). Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-5-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 48b69959a8559db5df78661d9c6d5138c2f20871 Author: Jason Wang Date: Fri May 27 14:01:14 2022 +0800 virtio: introduce config op to synchronize vring callbacks This patch introduces new virtio config op to vring callbacks. Transport specific method is required to make sure the write before this function is visible to the vring_interrupt() that is called after the return of this function. For the transport that doesn't provide synchronize_vqs(), use synchornize_rcu() which synchronize with IRQ implicitly as a fallback. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-4-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Reviewed-by: Stefano Garzarella commit 0aa96837c3ded5de58782a07b88176f2f1d01404 Author: Jason Wang Date: Fri May 27 14:01:13 2022 +0800 virtio: use virtio_reset_device() when possible This allows us to do common extension without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-3-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo Reviewed-by: Eugenio Pérez commit 2536b2ca15418c517e3629cc3dd757f811ce52b2 Author: Stefano Garzarella Date: Fri May 27 14:01:12 2022 +0800 virtio: use virtio_device_ready() in virtio_device_restore() It will allow us to do extension on virtio_device_ready() without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Stefano Garzarella Signed-off-by: Jason Wang Message-Id: <20220527060120.20964-2-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 242436973831aa97e8ce19533c6c912ea8def31b Author: Eugenio Pérez Date: Thu May 19 16:59:19 2022 +0200 vdpasim: allow to enable a vq repeatedly Code must be resilient to enable a queue many times. At the moment the queue is resetting so it's definitely not the expected behavior. v2: set vq->ready = 0 at disable. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Cc: stable@vger.kernel.org Signed-off-by: Eugenio Pérez Message-Id: <20220519145919.772896-1-eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit ac33f84ba5ffcc6c8a4c3ee98c92f722feb64f43 Author: Zhu Lingshan Date: Sun Apr 24 15:28:06 2022 +0800 vDPA/ifcvf: fix uninitialized config_vector warning Static checkers are not informed that config_vector is controlled by vf->msix_vector_status, which can only be MSIX_VECTOR_SHARED_VQ_AND_CONFIG, MSIX_VECTOR_SHARED_VQ_AND_CONFIG and MSIX_VECTOR_DEV_SHARED. This commit uses an "if...elseif...else" code block to tell the checkers that it is a complete set, and config_vector can be initialized anyway Signed-off-by: Zhu Lingshan Reviewed-by: Dan Carpenter Message-Id: <20220424072806.1083189-1-lingshan.zhu@intel.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit ffbda8e9df10d1784d5427ec199e7d8308e3763f Author: Cindy Lu Date: Fri Apr 29 17:10:30 2022 +0800 vdpa/vp_vdpa : add vdpa tool support in vp_vdpa this patch is to add the support for vdpa tool in vp_vdpa here is the example steps modprobe vp_vdpa modprobe vhost_vdpa echo 0000:00:06.0>/sys/bus/pci/drivers/virtio-pci/unbind echo 1af4 1041 > /sys/bus/pci/drivers/vp-vdpa/new_id vdpa dev add name vdpa1 mgmtdev pci/0000:00:06.0 Signed-off-by: Cindy Lu Message-Id: <20220429091030.547434-1-lulu@redhat.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 0619eda83d905a9e8eedfb5699d6f520f901281c Author: Solomon Tan Date: Mon Apr 18 02:56:24 2022 +0000 virtio: Replace long long int with long long This patch addresses the checkpatch.pl warning that long long is preferred over long long int. Signed-off-by: Solomon Tan Message-Id: Signed-off-by: Michael S. Tsirkin commit 3153234097f6a0d06981565eb3eec3cb37dea8f8 Author: Solomon Tan Date: Mon Apr 18 02:54:35 2022 +0000 virtio: Replace unsigned with unsigned int This patch addresses the checkpatch.pl warning where unsigned int is preferred over unsigned. Signed-off-by: Solomon Tan Message-Id: Signed-off-by: Michael S. Tsirkin commit 4e0d352af04cf4e019d3e45229eaaff9e8ffb33d Author: lei he Date: Fri May 6 21:16:27 2022 +0800 virtio-crypto: enable retry for virtio-crypto-dev Enable retry for virtio-crypto-dev, so that crypto-engine can process cipher-requests parallelly. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi Message-Id: <20220506131627.180784-6-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit a36bd0ad9fbf69d0d711b1c105954ce8d6cc144a Author: lei he Date: Fri May 6 21:16:26 2022 +0800 virtio-crypto: adjust dst_len at ops callback For some akcipher operations(eg, decryption of pkcs1pad(rsa)), the length of returned result maybe less than akcipher_req->dst_len, we need to recalculate the actual dst_len through the virt-queue protocol. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi Message-Id: <20220506131627.180784-5-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 977231e8d45657871a86fe3c7bed94921d04e447 Author: zhenwei pi Date: Fri May 6 21:16:25 2022 +0800 virtio-crypto: wait ctrl queue instead of busy polling Originally, after submitting request into virtio crypto control queue, the guest side polls the result from the virt queue. This works like following: CPU0 CPU1 ... CPUx CPUy | | | | \ \ / / \--------spin_lock(&vcrypto->ctrl_lock)-------/ | virtqueue add & kick | busy poll virtqueue | spin_unlock(&vcrypto->ctrl_lock) ... There are two problems: 1, The queue depth is always 1, the performance of a virtio crypto device gets limited. Multi user processes share a single control queue, and hit spin lock race from control queue. Test on Intel Platinum 8260, a single worker gets ~35K/s create/close session operations, and 8 workers get ~40K/s operations with 800% CPU utilization. 2, The control request is supposed to get handled immediately, but in the current implementation of QEMU(v6.2), the vCPU thread kicks another thread to do this work, the latency also gets unstable. Tracking latency of virtio_crypto_alg_akcipher_close_session in 5s: usecs : count distribution 0 -> 1 : 0 | | 2 -> 3 : 7 | | 4 -> 7 : 72 | | 8 -> 15 : 186485 |************************| 16 -> 31 : 687 | | 32 -> 63 : 5 | | 64 -> 127 : 3 | | 128 -> 255 : 1 | | 256 -> 511 : 0 | | 512 -> 1023 : 0 | | 1024 -> 2047 : 0 | | 2048 -> 4095 : 0 | | 4096 -> 8191 : 0 | | 8192 -> 16383 : 2 | | This means that a CPU may hold vcrypto->ctrl_lock as long as 8192~16383us. To improve the performance of control queue, a request on control queue waits completion instead of busy polling to reduce lock racing, and gets completed by control queue callback. CPU0 CPU1 ... CPUx CPUy | | | | \ \ / / \--------spin_lock(&vcrypto->ctrl_lock)-------/ | virtqueue add & kick | ---------spin_unlock(&vcrypto->ctrl_lock)------ / / \ \ | | | | wait wait wait wait Test this patch, the guest side get ~200K/s operations with 300% CPU utilization. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Reviewed-by: Gonglei Signed-off-by: zhenwei pi Message-Id: <20220506131627.180784-4-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 0756ad15b1fef287d4d8fa11bc36ea77a5c42e4a Author: zhenwei pi Date: Fri May 6 21:16:24 2022 +0800 virtio-crypto: use private buffer for control request Originally, all of the control requests share a single buffer( ctrl & input & ctrl_status fields in struct virtio_crypto), this allows queue depth 1 only, the performance of control queue gets limited by this design. In this patch, each request allocates request buffer dynamically, and free buffer after request, so the scope protected by ctrl_lock also get optimized here. It's possible to optimize control queue depth in the next step. A necessary comment is already in code, still describe it again: /* * Note: there are padding fields in request, clear them to zero before * sending to host to avoid to divulge any information. * Ex, virtio_crypto_ctrl_request::ctrl::u::destroy_session::padding[48] */ So use kzalloc to allocate buffer of struct virtio_crypto_ctrl_request. Potentially dereferencing uninitialized variables: Reported-by: kernel test robot Reported-by: Dan Carpenter Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Reviewed-by: Gonglei Signed-off-by: zhenwei pi Message-Id: <20220506131627.180784-3-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 6fd763d155860eb7ea3a93c8b3bf926940ffa3fb Author: zhenwei pi Date: Fri May 6 21:16:23 2022 +0800 virtio-crypto: change code style Use temporary variable to make code easy to read and maintain. /* Pad cipher's parameters */ vcrypto->ctrl.u.sym_create_session.op_type = cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER); vcrypto->ctrl.u.sym_create_session.u.cipher.para.algo = vcrypto->ctrl.header.algo; vcrypto->ctrl.u.sym_create_session.u.cipher.para.keylen = cpu_to_le32(keylen); vcrypto->ctrl.u.sym_create_session.u.cipher.para.op = cpu_to_le32(op); --> sym_create_session = &ctrl->u.sym_create_session; sym_create_session->op_type = cpu_to_le32(VIRTIO_CRYPTO_SYM_OP_CIPHER); sym_create_session->u.cipher.para.algo = ctrl->header.algo; sym_create_session->u.cipher.para.keylen = cpu_to_le32(keylen); sym_create_session->u.cipher.para.op = cpu_to_le32(op); The new style shows more obviously: - the variable we want to operate. - an assignment statement in a single line. Cc: Michael S. Tsirkin Cc: Jason Wang Cc: Gonglei Reviewed-by: Gonglei Signed-off-by: zhenwei pi Message-Id: <20220506131627.180784-2-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 7e415282b41bf0d15c6e0fe268f822d9b083f2f7 Author: Murilo Opsfelder Araujo Date: Thu Apr 14 23:30:02 2022 -0300 virtio-pci: Remove wrong address verification in vp_del_vqs() GCC 12 enhanced -Waddress when comparing array address to null [0], which warns: drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’: drivers/virtio/virtio_pci_common.c:257:29: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘vp_dev->msix_affinity_masks + (sizetype)((long unsigned int)i * 256)’ must not be NULL [-Waddress] 257 | if (vp_dev->msix_affinity_masks[i]) | ^~~~~~ In fact, the verification is comparing the result of a pointer arithmetic, the address "msix_affinity_masks + i", which will always evaluate to true. Under the hood, free_cpumask_var() calls kfree(), which is safe to pass NULL, not requiring non-null verification. So remove the verification to make compiler happy (happy compiler, happy life). [0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103 Signed-off-by: Murilo Opsfelder Araujo Message-Id: <20220415023002.49805-1-muriloo@linux.ibm.com> Signed-off-by: Michael S. Tsirkin Acked-by: Christophe de Dinechin commit 7a836a2aba09479c8e71fa43249eecc4af945f61 Author: Christophe JAILLET Date: Sun Apr 3 11:11:14 2022 +0200 virtio: pci: Fix an error handling path in vp_modern_probe() If an error occurs after a successful pci_request_selected_regions() call, it should be undone by a corresponding pci_release_selected_regions() call, as already done in vp_modern_remove(). Fixes: fd502729fbbf ("virtio-pci: introduce modern device module") Signed-off-by: Christophe JAILLET Message-Id: <237109725aad2c3c03d14549f777b1927c84b045.1648977064.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Michael S. Tsirkin commit bda324fd037a6b0d44da5699574ce741ca161bc4 Author: Gautam Dawar Date: Wed Mar 30 23:33:59 2022 +0530 vdpasim: control virtqueue support This patch introduces the control virtqueue support for vDPA simulator. This is a requirement for supporting advanced features like multiqueue. A requirement for control virtqueue is to isolate its memory access from the rx/tx virtqueues. This is because when using vDPA device for VM, the control virqueue is not directly assigned to VM. Userspace (Qemu) will present a shadow control virtqueue to control for recording the device states. The isolation is done via the virtqueue groups and ASID support in vDPA through vhost-vdpa. The simulator is extended to have: 1) three virtqueues: RXVQ, TXVQ and CVQ (control virtqueue) 2) two virtqueue groups: group 0 contains RXVQ and TXVQ; group 1 contains CVQ 3) two address spaces and the simulator simply implements the address spaces by mapping it 1:1 to IOTLB. For the VM use cases, userspace(Qemu) may set AS 0 to group 0 and AS 1 to group 1. So we have: 1) The IOTLB for virtqueue group 0 contains the mappings of guest, so RX and TX can be assigned to guest directly. 2) The IOTLB for virtqueue group 1 contains the mappings of CVQ which is the buffers that allocated and managed by VMM only. So CVQ of vhost-vdpa is visible to VMM only. And Guest can not access the CVQ of vhost-vdpa. For the other use cases, since AS 0 is associated to all virtqueue groups by default. All virtqueues share the same mapping by default. To demonstrate the function, VIRITO_NET_F_CTRL_MACADDR is implemented in the simulator for the driver to set mac address. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-20-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit cfe226892913a448e83e7a19db93862baa3cb99c Author: Gautam Dawar Date: Wed Mar 30 23:33:58 2022 +0530 vdpa_sim: filter destination mac address This patch implements a simple unicast filter for vDPA simulator. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-19-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit ec103d983bb56037a147dcdd9798cfa4fcdab126 Author: Gautam Dawar Date: Wed Mar 30 23:33:57 2022 +0530 vdpa_sim: factor out buffer completion logic Wrap up common buffer completion logic in to vdpasim_net_complete Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-18-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 05b6976212d4cffde60ff53716c40809ebdf4aee Author: Gautam Dawar Date: Wed Mar 30 23:33:56 2022 +0530 vdpa_sim: advertise VIRTIO_NET_F_MTU We've already reported maximum mtu via config space, so let's advertise the feature. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-17-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit aaca8373c4b1e010b8d748fc99d929de1bf860b8 Author: Gautam Dawar Date: Wed Mar 30 23:33:55 2022 +0530 vhost-vdpa: support ASID based IOTLB API This patch extends the vhost-vdpa to support ASID based IOTLB API. The vhost-vdpa device will allocated multiple IOTLBs for vDPA device that supports multiple address spaces. The IOTLBs and vDPA device memory mappings is determined and maintained through ASID. Note that we still don't support vDPA device with more than one address spaces that depends on platform IOMMU. This work will be done by moving the IOMMU logic from vhost-vDPA to vDPA device driver. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-16-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin Includes fixup: vhost-vdpa: Fix some error handling path in vhost_vdpa_process_iotlb_msg() In the error paths introduced by the original patch, a mutex may be left locked. Add the correct goto instead of a direct return. Signed-off-by: Christophe JAILLET Message-Id: <89ef0ae4c26ac3cfa440c71e97e392dcb328ac1b.1653227924.git.christophe.jaillet@wanadoo.fr> Acked-by: Jason Wang Signed-off-by: Michael S. Tsirkin commit 84d7c8fd3aade2fe79313003ed06ede431ec2a6d Author: Gautam Dawar Date: Wed Mar 30 23:33:54 2022 +0530 vhost-vdpa: introduce uAPI to set group ASID Follows the vDPA support for associating ASID to a specific virtqueue group. This patch adds a uAPI to support setting them from userspace. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-15-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 2d1fcb7758e49fd9caf150f3c70804b95b2ce80c Author: Gautam Dawar Date: Wed Mar 30 23:33:53 2022 +0530 vhost-vdpa: uAPI to get virtqueue group id Follows the support for virtqueue group in vDPA. This patches introduces uAPI to get the virtqueue group ID for a specific virtqueue in vhost-vdpa. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-14-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit a0c95f201170bd559737d3cdc8a950aea62f29c6 Author: Gautam Dawar Date: Wed Mar 30 23:33:52 2022 +0530 vhost-vdpa: introduce uAPI to get the number of address spaces This patch introduces the uAPI for getting the number of address spaces supported by this vDPA device. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-13-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 3ace88bd37436abc84906312146fe5158a469142 Author: Gautam Dawar Date: Wed Mar 30 23:33:51 2022 +0530 vhost-vdpa: introduce uAPI to get the number of virtqueue groups Follows the vDPA support for multiple address spaces, this patch introduce uAPI for the userspace to know the number of virtqueue groups supported by the vDPA device. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-12-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 3d5698793897a2b9c0060d899881d1a0591630d5 Author: Gautam Dawar Date: Wed Mar 30 23:33:50 2022 +0530 vhost-vdpa: introduce asid based IOTLB This patch converts the vhost-vDPA device to support multiple IOTLBs tagged via ASID via hlist. This will be used for supporting multiple address spaces in the following patches. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-11-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 91233ad711866f4e375742d84ef3ed6aab9daa96 Author: Gautam Dawar Date: Wed Mar 30 23:33:49 2022 +0530 vhost: support ASID in IOTLB API This patches allows userspace to send ASID based IOTLB message to vhost. This idea is to use the reserved u32 field in the existing V2 IOTLB message. Vhost device should advertise this capability via VHOST_BACKEND_F_IOTLB_ASID backend feature. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-10-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 1cb108994c6830cc6a6e066ad7d9a22ef59fa167 Author: Gautam Dawar Date: Wed Mar 30 23:33:48 2022 +0530 vhost_iotlb: split out IOTLB initialization This patch splits out IOTLB initialization to make sure it could be reused by external modules. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-9-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 46d554b1bcd19133401d2d5c0728b85e7bfd1358 Author: Gautam Dawar Date: Wed Mar 30 23:33:47 2022 +0530 vdpa: introduce config operations for associating ASID to a virtqueue group This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID to a virtqueue group. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-8-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit db9adcbf4286ad1c1fca091a870db6e49bb0df07 Author: Gautam Dawar Date: Wed Mar 30 23:33:46 2022 +0530 vdpa: multiple address spaces support This patches introduces the multiple address spaces support for vDPA device. This idea is to identify a specific address space via an dedicated identifier - ASID. During vDPA device allocation, vDPA device driver needs to report the number of address spaces supported by the device then the DMA mapping ops of the vDPA device needs to be extended to support ASID. This helps to isolate the environments for the virtqueue that will not be assigned directly. E.g in the case of virtio-net, the control virtqueue will not be assigned directly to guest. As a start, simply claim 1 virtqueue groups and 1 address spaces for all vDPA devices. And vhost-vDPA will simply reject the device with more than 1 virtqueue groups or address spaces. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-7-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit d4821902e43453b85b31329441a9f6ac071228a8 Author: Gautam Dawar Date: Wed Mar 30 23:33:45 2022 +0530 vdpa: introduce virtqueue groups This patch introduces virtqueue groups to vDPA device. The virtqueue group is the minimal set of virtqueues that must share an address space. And the address space identifier could only be attached to a specific virtqueue group. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-6-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 0b7ee47c5f36634926def0142a515eafedc8a779 Author: Gautam Dawar Date: Wed Mar 30 23:33:44 2022 +0530 vhost-vdpa: switch to use vhost-vdpa specific IOTLB To ease the implementation of per group ASID support for vDPA device. This patch switches to use a vhost-vdpa specific IOTLB to avoid the unnecessary refactoring of the vhost core. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-5-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit ae967246d0997a684093ffc06a14999292ad9276 Author: Gautam Dawar Date: Wed Mar 30 23:33:43 2022 +0530 vhost-vdpa: passing iotlb to IOMMU mapping helpers To prepare for the ASID support for vhost-vdpa, try to pass IOTLB object to dma helpers. No functional changes, it's just a preparation for support multiple IOTLBs. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-4-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit ea239a67461a34839e2172ead3043295a9173389 Author: Gautam Dawar Date: Wed Mar 30 23:33:42 2022 +0530 virtio-vdpa: don't set callback if virtio doesn't need it There's no need for setting callbacks for the driver that doesn't care about that. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-3-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit 175d493c3c3e09a3abaa843068fae0f0ad42c47e Author: Gautam Dawar Date: Wed Mar 30 23:33:41 2022 +0530 vhost: move the backend feature bits to vhost_types.h We should store feature bits in vhost_types.h as what has been done for e.g VHOST_F_LOG_ALL. Signed-off-by: Jason Wang Signed-off-by: Gautam Dawar Message-Id: <20220330180436.24644-2-gdawar@xilinx.com> Signed-off-by: Michael S. Tsirkin commit b4b4ff73ef047556e81694174bb8561457f25eeb Author: Xianting Tian Date: Mon Mar 28 18:58:17 2022 +0800 virtio_ring: add unlikely annotation for free descs check The 'if (vq->vq.num_free < descs_used)' check will almost always be false. Signed-off-by: Xianting Tian Message-Id: <20220328105817.1028065-2-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Stefano Garzarella commit 35c51e093d956f6d058e193711c8d424817a44a9 Author: Xianting Tian Date: Mon Mar 28 18:58:16 2022 +0800 virtio_ring: remove unnecessary to_vvq call in vring hot path It passes '_vq' to virtqueue_use_indirect(), which still calls to_vvq to get 'vq', let's directly pass 'vq'. It can avoid unnecessary call of to_vvq in hot path. Signed-off-by: Xianting Tian Message-Id: <20220328105817.1028065-1-xianting.tian@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Stefano Garzarella commit 0e9911fa768f32f30e5678512ea405d99a7a9fef Author: Suwan Kim Date: Thu Apr 7 00:32:07 2022 +0900 virtio-blk: support mq_ops->queue_rqs() This patch supports mq_ops->queue_rqs() hook. It has an advantage of batch submission to virtio-blk driver. It also helps polling I/O because polling uses batched completion of block layer. Batch submission in queue_rqs() can boost polling performance. In queue_rqs(), it iterates plug->mq_list, collects requests that belong to same HW queue until it encounters a request from other HW queue or sees the end of the list. Then, virtio-blk adds requests into virtqueue and kicks virtqueue to submit requests. If there is an error, it inserts error request to requeue_list and passes it to ordinary block layer path. For verification, I did fio test. (io_uring, randread, direct=1, bs=4K, iodepth=64 numjobs=N) I set 4 vcpu and 2 virtio-blk queues for VM and run fio test 5 times. It shows about 2% improvement. | numjobs=2 | numjobs=4 ----------------------------------------------------------- fio without queue_rqs() | 291K IOPS | 238K IOPS ----------------------------------------------------------- fio with queue_rqs() | 295K IOPS | 243K IOPS For polling I/O performance, I also did fio test as below. (io_uring, hipri, randread, direct=1, bs=512, iodepth=64 numjobs=4) I set 4 vcpu and 2 poll queues for VM. It shows about 2% improvement in polling I/O. | IOPS | avg latency ----------------------------------------------------------- fio poll without queue_rqs() | 424K | 613.05 usec ----------------------------------------------------------- fio poll with queue_rqs() | 435K | 601.01 usec Reviewed-by: Stefan Hajnoczi Reviewed-by: Christoph Hellwig Signed-off-by: Suwan Kim Message-Id: <20220406153207.163134-3-suwan.kim027@gmail.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Chaitanya Kulkarni commit 4e0400525691d0e676dbe002641f9a61261f1e1b Author: Suwan Kim Date: Thu Apr 7 00:32:06 2022 +0900 virtio-blk: support polling I/O This patch supports polling I/O via virtio-blk driver. Polling feature is enabled by module parameter "poll_queues" and it sets dedicated polling queues for virtio-blk. This patch improves the polling I/O throughput and latency. The virtio-blk driver doesn't not have a poll function and a poll queue and it has been operating in interrupt driven method even if the polling function is called in the upper layer. virtio-blk polling is implemented upon 'batched completion' of block layer. virtblk_poll() queues completed request to io_comp_batch->req_list and later, virtblk_complete_batch() calls unmap function and ends the requests in batch. virtio-blk reads the number of poll queues from module parameter "poll_queues". If VM sets queue parameter as below, ("num-queues=N" [QEMU property], "poll_queues=M" [module parameter]) It allocates N virtqueues to virtio_blk->vqs[N] and it uses [0..(N-M-1)] as default queues and [(N-M)..(N-1)] as poll queues. Unlike the default queues, the poll queues have no callback function. Regarding HW-SW queue mapping, the default queue mapping uses the existing method that condsiders MSI irq vector. But the poll queue doesn't have an irq, so it uses the regular blk-mq cpu mapping. For verifying the improvement, I did Fio polling I/O performance test with io_uring engine with the options below. (io_uring, hipri, randread, direct=1, bs=512, iodepth=64 numjobs=N) I set 4 vcpu and 4 virtio-blk queues - 2 default queues and 2 poll queues for VM. As a result, IOPS and average latency improved about 10%. Test result: - Fio io_uring poll without virtio-blk poll support -- numjobs=1 : IOPS = 339K, avg latency = 188.33us -- numjobs=2 : IOPS = 367K, avg latency = 347.33us -- numjobs=4 : IOPS = 383K, avg latency = 682.06us - Fio io_uring poll with virtio-blk poll support -- numjobs=1 : IOPS = 385K, avg latency = 165.94us -- numjobs=2 : IOPS = 408K, avg latency = 313.28us -- numjobs=4 : IOPS = 424K, avg latency = 613.05us Reviewed-by: Stefan Hajnoczi Reviewed-by: Christoph Hellwig Reviewed-by: Max Gurtovoy Signed-off-by: Suwan Kim Message-Id: <20220406153207.163134-2-suwan.kim027@gmail.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Chaitanya Kulkarni commit 759ae7f9bf1e6b7f5c9c197d7207e2be1dfd74b1 Author: Eli Cohen Date: Wed May 18 16:38:04 2022 +0300 vdpa/mlx5: Use readers/writers semaphore instead of mutex Reading statistics could be done intensively and by several processes concurrently. Reader's lock is sufficient in this case. Change reslock from mutex to a rwsem. Suggested-by: Si-Wei Liu Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-7-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 1892a3d425bf525ac98d6d3534035e6ed2bfab50 Author: Eli Cohen Date: Wed May 18 16:38:03 2022 +0300 vdpa/mlx5: Add support for reading descriptor statistics Implement the get_vq_stats calback of vdpa_config_ops to return the statistics for a virtqueue. The statistics are provided as vendor specific statistics where the driver provides a pair of attribute name and attribute value. Currently supported are received descriptors and completed descriptors. Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-6-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit a6a51adc6e8aafebfe0c4beb80e99694ea562b40 Author: Eli Cohen Date: Wed May 18 16:38:02 2022 +0300 net/vdpa: Use readers/writers semaphore instead of cf_mutex Replace cf_mutex with rw_semaphore to reflect the fact that some calls could be called concurrently but can suffice with read lock. Suggested-by: Si-Wei Liu Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-5-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 0078ad905dc8eada34461312a0060b0904c57e2d Author: Eli Cohen Date: Wed May 18 16:38:01 2022 +0300 net/vdpa: Use readers/writers semaphore instead of vdpa_dev_mutex Use rw_semaphore instead of mutex to control access to vdpa devices. This can be especially beneficial in case processes poll on statistics information. Suggested-by: Si-Wei Liu Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-4-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 13b00b135665c92065a27c0c39dd97e0f380bd4f Author: Eli Cohen Date: Wed May 18 16:38:00 2022 +0300 vdpa: Add support for querying vendor statistics Allows to read vendor statistics of a vdpa device. The specific statistics data are received from the upstream driver in the form of an (attribute name, attribute value) pairs. An example of statistics for mlx5_vdpa device are: received_desc - number of descriptors received by the virtqueue completed_desc - number of descriptors completed by the virtqueue A descriptor using indirect buffers is still counted as 1. In addition, N chained descriptors are counted correctly N times as one would expect. A new callback was added to vdpa_config_ops which provides the means for the vdpa driver to return statistics results. The interface allows for reading all the supported virtqueues, including the control virtqueue if it exists. Below are some examples taken from mlx5_vdpa which are introduced in the following patch: 1. Read statistics for the virtqueue at index 1 $ vdpa dev vstats show vdpa-a qidx 1 vdpa-a: queue_type tx queue_index 1 received_desc 3844836 completed_desc 3844836 2. Read statistics for the virtqueue at index 32 $ vdpa dev vstats show vdpa-a qidx 32 vdpa-a: queue_type control_vq queue_index 32 received_desc 62 completed_desc 62 3. Read statisitics for the virtqueue at index 0 with json output $ vdpa -j dev vstats show vdpa-a qidx 0 {"vstats":{"vdpa-a":{ "queue_type":"rx","queue_index":0,"name":"received_desc","value":417776,\ "name":"completed_desc","value":417548}}} 4. Read statistics for the virtqueue at index 0 with preety json output $ vdpa -jp dev vstats show vdpa-a qidx 0 { "vstats": { "vdpa-a": { "queue_type": "rx", "queue_index": 0, "name": "received_desc", "value": 417776, "name": "completed_desc", "value": 417548 } } } Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-3-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 7a6691f1f89784f775fa0c54be57533445726068 Author: Eli Cohen Date: Wed May 18 16:37:59 2022 +0300 vdpa: Fix error logic in vdpa_nl_cmd_dev_get_doit In vdpa_nl_cmd_dev_get_doit(), if the call to genlmsg_reply() fails we must not call nlmsg_free() since this is done inside genlmsg_reply(). Fix it. Fixes: bc0d90ee021f ("vdpa: Enable user to query vdpa device info") Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Message-Id: <20220518133804.1075129-2-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 079d93b7dba8373920ad8b50e01616ce8ab3c927 Author: Mark Brown Date: Tue May 31 17:13:37 2022 +0200 selftests: alsa: Handle pkg-config failure more gracefully Follow the pattern used by other selftests like memfd and fall back on the standard toolchain options to build with a system installed alsa-lib if we don't get anything from pkg-config. This reduces our build dependencies a bit in the common case while still allowing use of pkg-config in case there is a need for it. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220531151337.2933810-1-broonie@kernel.org Signed-off-by: Takashi Iwai commit 4398d3c31b582db0d640b23434bf344a6c8df57c Author: Weizhao Ouyang Date: Mon May 30 15:51:14 2022 +0800 erofs: fix 'backmost' member of z_erofs_decompress_frontend Initialize 'backmost' to true in DECOMPRESS_FRONTEND_INIT. Fixes: 5c6dcc57e2e5 ("erofs: get rid of `struct z_erofs_collector'") Signed-off-by: Weizhao Ouyang Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220530075114.918874-1-o451686892@gmail.com Signed-off-by: Gao Xiang commit aa793b46bb9342ae3c6152fc21654b8ade8dd125 Author: Gao Xiang Date: Sun May 29 13:54:25 2022 +0800 erofs: simplify z_erofs_pcluster_readmore() Get rid of unnecessary label `skip'. No logic changes. Link: https://lore.kernel.org/r/20220529055425.226363-4-xiang@kernel.org Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 39397a46cff3d7b7d3b45b3283491af05bdfb64b Author: Gao Xiang Date: Sun May 29 13:54:24 2022 +0800 erofs: get rid of label `restart_now' Simplify this part of code. No logic changes. Link: https://lore.kernel.org/r/20220529055425.226363-3-xiang@kernel.org Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 87ca34a7065db66adbbe882a2be6b04127c26a87 Author: Gao Xiang Date: Sun May 29 13:54:23 2022 +0800 erofs: get rid of `struct z_erofs_collection' It was incompletely introduced for deduplication between different logical extents backed with the same pcluster. We will have a better in-memory representation in the next release cycle for this, as well as partial memory folios support. So get rid of it instead. No logic changes. Link: https://lore.kernel.org/r/20220529055425.226363-2-xiang@kernel.org Acked-by: Chao Yu Signed-off-by: Gao Xiang commit f26967b9f7a830e228bb13fb41bd516ddd9d789d Author: Namjae Jeon Date: Mon May 30 18:43:01 2022 +0300 fs/ntfs3: Fix invalid free in log_replay log_read_rst() returns ENOMEM error when there is not enough memory. In this case, if info is returned without initialization, it attempts to kfree the uninitialized info->r_page pointer. This patch moves the memset initialization code to before log_read_rst() is called. Reported-by: Gerald Lee Signed-off-by: Namjae Jeon Signed-off-by: Konstantin Komarov commit 3d76c9f5e0ee842ad42e482669d7fd63d4b67867 Author: Arnd Bergmann Date: Tue May 24 14:20:06 2022 +0200 ARM: pxa/mmp: remove traces of plat-pxa The missing include directory caused a W=1 warning that can be trivially fixed. I also noticed references in the marvell.rst documentation that can be removed at the same time. Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit 9171c484dffd82ef20942ea6adbbc8f765691c69 Author: Krzysztof Kozlowski Date: Tue May 24 09:04:08 2022 +0200 dt-bindings: soc: qcom,smd: do not use pattern for simple rpm-requests string patternProperties should not be used for properties with a simple string as name: Documentation/devicetree/bindings/soc/qcom/qcom,smd.yaml: patternProperties:^(.*-edge|rpm)$:patternProperties: '^rpm-requests$' should not be valid under {'pattern': '^\\^[a-zA-Z0-9,\\-._#]+\\$$'} Fixes: 375eed5f51a8 ("dt-bindings: soc: qcom,smd: convert to dtschema") Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220524070408.39505-1-krzysztof.kozlowski@linaro.org commit 291e7d52d19f114cad6cbf802f3f19ef12a011f8 Author: Ben Chuang Date: Fri May 20 19:42:42 2022 +0800 mmc: sdhci-pci-gli: Fix GL9763E runtime PM when the system resumes from suspend When the system resumes from suspend (S3 or S4), the power mode is MMC_POWER_OFF. In this status, gl9763e_runtime_resume() should not enable PLL. Add a condition to this function to enable PLL only when the power mode is MMC_POWER_ON. Fixes: d607667bb8fa (mmc: sdhci-pci-gli: Add runtime PM for GL9763E) Signed-off-by: Ben Chuang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220520114242.150235-1-benchuanggli@gmail.com Signed-off-by: Ulf Hansson commit 03ab8e6297acd1bc0eedaa050e2a1635c576fd11 Merge: 52e00ea6b26e4 4b0986a3613c9 Author: Konstantin Komarov Date: Tue May 31 16:13:23 2022 +0300 Merge tag 'v5.18' Linux 5.18 commit 3753fcc22974affa26160ce1c46a6ebaaaa86758 Author: Takashi Iwai Date: Tue May 31 15:07:49 2022 +0200 ALSA: usb-audio: Optimize TEAC clock quirk Maris found out that the quirk for TEAC devices to work around the clock setup is needed to apply only when the base clock is changed, e.g. from 48000-based clocks (48000, 96000, 192000, 384000) to 44100-based clocks (44100, 88200, 176400, 352800), or vice versa, while switching to another clock with the same base clock doesn't need the (forcible) interface setup. This patch implements the optimization for the TEAC clock quirk to avoid the unnecessary interface re-setup. Fixes: 5ce0b06ae5e6 ("ALSA: usb-audio: Workaround for clock setup on TEAC devices") Reported-by: Maris Abele Cc: Link: https://lore.kernel.org/r/20220531130749.30357-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 09e545f7381459c015b6fa0cd0ac6f010ef8cc25 Author: Juergen Gross Date: Mon May 30 13:34:59 2022 +0200 xen/netback: fix incorrect usage of RING_HAS_UNCONSUMED_REQUESTS() Commit 6fac592cca60 ("xen: update ring.h") missed to fix one use case of RING_HAS_UNCONSUMED_REQUESTS(). Reported-by: Jan Beulich Fixes: 6fac592cca60 ("xen: update ring.h") Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Acked-by: Wei Liu Link: https://lore.kernel.org/r/20220530113459.20124-1-jgross@suse.com Signed-off-by: Paolo Abeni commit 3e0b8f529c10037ae0b369fc892e524eae5a5485 Author: Arun Ajith S Date: Mon May 30 10:14:14 2022 +0000 net/ipv6: Expand and rename accept_unsolicited_na to accept_untracked_na RFC 9131 changes default behaviour of handling RX of NA messages when the corresponding entry is absent in the neighbour cache. The current implementation is limited to accept just unsolicited NAs. However, the RFC is more generic where it also accepts solicited NAs. Both types should result in adding a STALE entry for this case. Expand accept_untracked_na behaviour to also accept solicited NAs to be compliant with the RFC and rename the sysctl knob to accept_untracked_na. Fixes: f9a2fb73318e ("net/ipv6: Introduce accept_unsolicited_na knob to implement router-side changes for RFC9131") Signed-off-by: Arun Ajith S Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220530101414.65439-1-aajith@arista.com Signed-off-by: Paolo Abeni commit a7c41b4687f5902af70cd559806990930c8a307b Author: Xiaoguang Wang Date: Mon May 30 21:15:20 2022 +0800 io_uring: let IORING_OP_FILES_UPDATE support choosing fixed file slots One big issue with the file registration feature is that it needs user space apps to maintain free slot info about io_uring's fixed file table, which really is a burden for development. io_uring now supports choosing free file slot for user space apps by using IORING_FILE_INDEX_ALLOC flag in accept, open, and socket operations, but they need the app to use direct accept or direct open, which not all apps are prepared to use yet. To support apps that still need real fds, make use of the registration feature easier. Let IORING_OP_FILES_UPDATE support choosing fixed file slots, which will store picked fixed files slots in fd array and let cqe return the number of slots allocated. Suggested-by: Hao Xu Signed-off-by: Xiaoguang Wang [axboe: move flag to uapi io_uring header, change goto to break, init] Signed-off-by: Jens Axboe commit 4278a0deb1f6cac40ded3362fe2a9827d7efee3d Author: Xiaoguang Wang Date: Sat May 28 09:51:09 2022 +0800 io_uring: defer alloc_hint update to io_file_bitmap_set() io_file_bitmap_get() returns a free bitmap slot, but if it isn't used later, such as io_queue_rsrc_removal() returns error, in this case, we should not update alloc_hint at all, which still should be considered as a valid candidate for next io_file_bitmap_get() calls. To fix this issue, only update alloc_hint in io_file_bitmap_set(). Signed-off-by: Xiaoguang Wang Link: https://lore.kernel.org/r/20220528015109.48039-1-xiaoguang.wang@linux.alibaba.com Signed-off-by: Jens Axboe commit 8c71fe750215e688df9c7477e7bf448380d4ce9e Author: Xiaoguang Wang Date: Fri May 27 10:54:00 2022 +0800 io_uring: ensure fput() called correspondingly when direct install fails io_fixed_fd_install() may fail for short of free fixed file bitmap, in this case, need to call fput() correspondingly. Signed-off-by: Xiaoguang Wang Link: https://lore.kernel.org/r/20220527025400.51048-1-xiaoguang.wang@linux.alibaba.com Signed-off-by: Jens Axboe commit fa82dd105bed389f37d919fd783ce459bb92facb Author: Jens Axboe Date: Thu May 26 16:58:18 2022 -0600 io_uring: wire up allocated direct descriptors for socket The socket support was merged in an earlier branch that didn't yet have support for allocating direct descriptors, hence only open and accept got support for that. Do the one-liner to enable it now, so we have consistent support for any request that can instantiate a file/direct descriptor. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 21870e02fcd385c39fe635e6531ce78302f3cd71 Author: Jens Axboe Date: Thu May 26 11:34:33 2022 -0600 io_uring: fix a memory leak of buffer group list on exit If we use a buffer group ID that is large enough to require io_uring to allocate it, then we don't correctly free it if the cleanup is deferred to the ring exit. The explicit removal paths are fine. Fixes: 9cfc7e94e42b ("io_uring: get rid of hashed provided buffer groups") Signed-off-by: Jens Axboe commit 1151a7cccbd2cfd5a552805c92c92fb264a957d5 Author: Jens Axboe Date: Mon May 23 18:43:13 2022 -0600 io_uring: move shutdown under the general net section Gets rid of some ifdefs and enables use of the net defines for when CONFIG_NET isn't set. Signed-off-by: Jens Axboe commit 157dc813b47ab2adb4bc8a08491887bc161284c2 Author: Jens Axboe Date: Mon May 23 17:16:21 2022 -0600 io_uring: unify calling convention for async prep handling Make them consistent in preparation for defining a req async prep handler. The readv/writev requests share a prep handler, move it one level down so the initial one is consistent with the others. Signed-off-by: Jens Axboe commit 4a1f14df55d1e9ecdfa797a87a80131207cbd66f Author: Hangbin Liu Date: Mon May 30 14:26:39 2022 +0800 bonding: show NS IPv6 targets in proc master info When adding bond new parameter ns_targets. I forgot to print this in bond master proc info. After updating, the bond master info will look like: ARP IP target/s (n.n.n.n form): 192.168.1.254 NS IPv6 target/s (XX::XX form): 2022::1, 2022::2 Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets") Reported-by: Li Liang Signed-off-by: Hangbin Liu Link: https://lore.kernel.org/r/20220530062639.37179-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit fcde59feb1affb6d56aecadc3868df4631480da5 Author: Jens Axboe Date: Mon May 23 16:53:15 2022 -0600 io_uring: add io_op_defs 'def' pointer in req init and issue Define and set it when appropriate, and use it consistently in the function rather than using io_op_defs[opcode]. Reviewed-by: Kanchan Joshi Signed-off-by: Jens Axboe commit ab0925ab728163b854ea17da09e299254a86076e Merge: d6f8168e4345c 2d969e8f35b18 Author: Mark Brown Date: Tue May 31 10:16:59 2022 +0200 ASoC: da7219: Small fixes for jack detection and removal Merge series from Adam Thomson : This series contains 2 small fixes around the AAD part of DA7219, particularly in relation to jack pole detection on certain active headsets, and tidy up when a jack is removed. commit 0c0fe08c76485fe0178ebb0fa1a2052c727abe94 Author: Borislav Petkov Date: Wed May 25 18:12:32 2022 +0200 x86/microcode: Remove unnecessary perf callback c93dc84cbe32 ("perf/x86: Add a microcode revision check for SNB-PEBS") checks whether the microcode revision has fixed PEBS issues. This can happen either: 1. At PEBS init time, where the early microcode has been loaded already 2. During late loading, in the microcode_check() callback. So remove the unnecessary call in the microcode loader init routine. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220525161232.14924-5-bp@alien8.de commit d23d33ea0fcdc4bbb484990bf53867f99c63ccab Author: Borislav Petkov Date: Wed May 25 18:12:31 2022 +0200 x86/microcode: Taint and warn on late loading Warn before it is attempted and taint the kernel. Late loading microcode can lead to malfunction of the kernel when the microcode update changes behaviour. There is no way for the kernel to determine whether its safe or not. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220525161232.14924-4-bp@alien8.de commit a77a94f86273ce42a39cb479217dd8d68acfe0ff Author: Borislav Petkov Date: Wed May 25 18:12:30 2022 +0200 x86/microcode: Default-disable late loading It is dangerous and it should not be used anyway - there's a nice early loading already. Requested-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220525161232.14924-3-bp@alien8.de commit 181b6f40e9ea80c76756d4d0cdeed396016c487e Author: Borislav Petkov Date: Wed May 25 18:12:29 2022 +0200 x86/microcode: Rip out the OLD_INTERFACE Everything should be using the early initrd loading by now. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220525161232.14924-2-bp@alien8.de commit cbf84dbf0600b0efe1134cc3f98ae29c523a3a23 Author: Julia Lawall Date: Sat May 21 13:10:36 2022 +0200 nvmet: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit aa41d2fe60ee2e4452b0f9ca9f0f6d80a4ff9f9d Author: Niklas Cassel Date: Thu May 26 15:57:21 2022 +0200 nvme: set controller enable bit in a separate write The NVM Express Base Specification 2.0 specifies in the description of the CC – Controller Configuration register: "Host software shall set the Arbitration Mechanism Selected (CC.AMS), the Memory Page Size (CC.MPS), and the I/O Command Set Selected (CC.CSS) to valid values prior to enabling the controller by setting CC.EN to ‘1’. While we haven't seen any controller misbehaving while setting all bits in a single write, let's do it in the order that it is written in the spec, as there could potentially be controllers that are implemented to rely on the configuration bits being set before enabling the controller. Signed-off-by: Niklas Cassel Signed-off-by: Christoph Hellwig commit 70ce3455345d056b5fc427c3bb4a3ff4d126b6d5 Author: Christoph Hellwig Date: Fri May 27 07:32:08 2022 +0200 nvme-pci: disable namespace identifiers for the MAXIO MAP1001 The MAXIO MAP1001 controllers reports completely bogus Namespace identifiers that even change after suspend cycles. Disable using the Identifiers entirely. Reported-by: Arman Hajishafieha Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Tested-by: Arman Hajishafieha commit d7cd5e06c9dd70a82f1461c7b5f676bc03f5cd61 Author: Viorel Suman Date: Fri May 27 11:49:34 2022 +0300 net: phy: at803x: disable WOL at probe Before 7beecaf7d507b ("net: phy: at803x: improve the WOL feature") patch "at803x_get_wol" implementation used AT803X_INTR_ENABLE_WOL value to set WAKE_MAGIC flag, and now AT803X_WOL_EN value is used for the same purpose. The problem here is that the values of these two bits are different after hardware reset: AT803X_INTR_ENABLE_WOL=0 after hardware reset, but AT803X_WOL_EN=1. So now, if called right after boot, "at803x_get_wol" will set WAKE_MAGIC flag, even if WOL function is not enabled by calling "at803x_set_wol" function. The patch disables WOL function on probe thus the behavior is consistent. Fixes: 7beecaf7d507b ("net: phy: at803x: improve the WOL feature") Signed-off-by: Viorel Suman Link: https://lore.kernel.org/r/20220527084935.235274-1-viorel.suman@oss.nxp.com Signed-off-by: Jakub Kicinski commit 3a2cd89bfbeb10012eb90857ce641d34f0151c4c Author: huhai Date: Thu May 26 18:12:13 2022 +0800 net: ipv4: Avoid bounds check warning Fix the following build warning when CONFIG_IPV6 is not set: In function ‘fortify_memcpy_chk’, inlined from ‘tcp_md5_do_add’ at net/ipv4/tcp_ipv4.c:1210:2: ./include/linux/fortify-string.h:328: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] 328 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suggested-by: Paolo Abeni Signed-off-by: huhai Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220526101213.2392980-1-zhanggenjian@kylinos.cn Signed-off-by: Jakub Kicinski commit 8378a51e3f8140f60901fb27208cc7a6e47047b5 Author: Ronnie Sahlberg Date: Tue May 31 13:01:17 2022 +1000 cifs: fix potential double free during failed mount RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2088799 Cc: stable@vger.kernel.org Signed-off-by: Roberto Bergantinos Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 07bf9431b1590d1cd7a8d62075d0b50b073f0495 Author: Vaibhav Jain Date: Tue May 24 16:53:53 2022 +0530 powerpc/papr_scm: don't requests stats with '0' sized stats buffer Sachin reported [1] that on a POWER-10 lpar he is seeing a kernel panic being reported with vPMEM when papr_scm probe is being called. The panic is of the form below and is observed only with following option disabled(profile) for the said LPAR 'Enable Performance Information Collection' in the HMC: Kernel attempted to write user page (1c) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on write at 0x0000001c Faulting instruction address: 0xc008000001b90844 Oops: Kernel access of bad area, sig: 11 [#1] NIP [c008000001b90844] drc_pmem_query_stats+0x5c/0x270 [papr_scm] LR [c008000001b92794] papr_scm_probe+0x2ac/0x6ec [papr_scm] Call Trace: 0xc00000000941bca0 (unreliable) papr_scm_probe+0x2ac/0x6ec [papr_scm] platform_probe+0x98/0x150 really_probe+0xfc/0x510 __driver_probe_device+0x17c/0x230 ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Fatal exception On investigation looks like this panic was caused due to a 'stat_buffer' of size==0 being provided to drc_pmem_query_stats() to fetch all performance stats-ids of an NVDIMM. However drc_pmem_query_stats() shouldn't have been called since the vPMEM NVDIMM doesn't support and performance stat-id's. This was caused due to missing check for 'p->stat_buffer_len' at the beginning of papr_scm_pmu_check_events() which indicates that the NVDIMM doesn't support performance-stats. Fix this by introducing the check for 'p->stat_buffer_len' at the beginning of papr_scm_pmu_check_events(). [1] https://lore.kernel.org/all/6B3A522A-6A5F-4CC9-B268-0C63AA6E07D3@linux.ibm.com Fixes: 0e0946e22f3665d2732 ("powerpc/papr_scm: Fix leaking nvdimm_events_map elements") Reported-by: Sachin Sant Signed-off-by: Vaibhav Jain Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220524112353.1718454-1-vaibhav@linux.ibm.com commit 7699f7aacf3ebfee51c670b6f796b2797f0f7487 Author: Uwe Kleine-König Date: Mon May 30 09:42:02 2022 +0200 RISC-V: Prepare dropping week attribute from arch_kexec_apply_relocations[_add] Without this change arch/riscv/kernel/elf_kexec.c fails to compile once commit 233c1e6c319c ("kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add]") is also contained in the tree. This currently happens in next-20220527. Prepare the RISC-V similar to the s390 adaption done in 233c1e6c319c. This is safe to do on top of the riscv change even without the change to arch_kexec_apply_relocations. Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file") Looks-good-to: liaochang (A) Signed-off-by: Uwe Kleine-König Signed-off-by: Palmer Dabbelt commit 8ab2afa23bd197df47819a87f0265c0ac95c5b6a Merge: e11a93567d3f1 79b66128f13f5 Author: Linus Torvalds Date: Mon May 30 12:46:49 2022 -0700 Merge tag 'for-5.19/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes and updates from Helge Deller: "A buch of small fixes and cleanups, including: - vesafb: Fix a use-after-free due early fb_info cleanup - clcdfb: Fix refcount leak in clcdfb_of_vram_setup - hyperv_fb: Allow resolutions with size > 64 MB for Gen1 - pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() - omapfb: Prevent compiler warning regarding hwa742_update_window_async()" * tag 'for-5.19/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: video: fbdev: omap: Add prototype for hwa742_update_window_async() video: fbdev: vesafb: Fix a use-after-free due early fb_info cleanup video: fbdev: radeon: Fix spelling typo in comment video: fbdev: xen: remove setting of 'transp' parameter video: fbdev: pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() video: fbdev: omapfb: simplify the return expression of nec_8048_connect() video: fbdev: omapfb: simplify the return expression of dsi_init_pll_data() video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1 commit e11a93567d3f1e843300ed98ff049a4335db8015 Merge: 1ff7bc3ba71d3 72acadfeb3789 Author: Linus Torvalds Date: Mon May 30 11:52:18 2022 -0700 Merge tag 'for-5.19/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture updates from Helge Deller: "Minor cleanups and code optimizations, e.g.: - improvements in assembly statements in the tmpalias code path - added some additionals compile time checks - drop some unneccesary assembler DMA syncs" * tag 'for-5.19/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Drop __ARCH_WANT_OLD_READDIR and __ARCH_WANT_SYS_OLDUMOUNT parisc: Optimize tmpalias function calls parisc: Add dep_safe() macro to deposit a register in 32- and 64-kernels parisc: Fix wrong comment for shr macro parisc: Prevent ldil() to sign-extend into upper 32 bits parisc: Don't hardcode assembler bit definitions in tmpalias code parisc: Don't enforce DMA completion order in cache flushes parisc: video: fbdev: stifb: Add sti_dump_font() to dump STI font commit 1ff7bc3ba71d398d349c49103a3da34bb4ea02d1 Merge: 32665a9e5432f 9f9c1f6844bda Author: Linus Torvalds Date: Mon May 30 11:37:26 2022 -0700 Merge tag 'pm-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These update the ARM cpufreq drivers and fix up the CPPC cpufreq driver after recent changes, update the OPP code and PM documentation and add power sequences support to the system reboot and power off code. Specifics: - Add Tegra234 cpufreq support (Sumit Gupta) - Clean up and enhance the Mediatek cpufreq driver (Wan Jiabing, Rex-BC Chen, and Jia-Wei Chang) - Fix up the CPPC cpufreq driver after recent changes (Zheng Bin, Pierre Gondois) - Minor update to dt-binding for Qcom's opp-v2-kryo-cpu (Yassine Oudjana) - Use list iterator only inside the list_for_each_entry loop (Xiaomeng Tong, and Jakob Koschel) - New APIs related to finding OPP based on interconnect bandwidth (Krzysztof Kozlowski) - Fix the missing of_node_put() in _bandwidth_supported() (Dan Carpenter) - Cleanups (Krzysztof Kozlowski, and Viresh Kumar) - Add Out of Band mode description to the intel-speed-select utility documentation (Srinivas Pandruvada) - Add power sequences support to the system reboot and power off code and make related platform-specific changes for multiple platforms (Dmitry Osipenko, Geert Uytterhoeven)" * tag 'pm-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (60 commits) cpufreq: CPPC: Fix unused-function warning cpufreq: CPPC: Fix build error without CONFIG_ACPI_CPPC_CPUFREQ_FIE Documentation: admin-guide: PM: Add Out of Band mode kernel/reboot: Change registration order of legacy power-off handler m68k: virt: Switch to new sys-off handler API kernel/reboot: Add devm_register_restart_handler() kernel/reboot: Add devm_register_power_off_handler() soc/tegra: pmc: Use sys-off handler API to power off Nexus 7 properly reboot: Remove pm_power_off_prepare() regulator: pfuze100: Use devm_register_sys_off_handler() ACPI: power: Switch to sys-off handler API memory: emif: Use kernel_can_power_off() mips: Use do_kernel_power_off() ia64: Use do_kernel_power_off() x86: Use do_kernel_power_off() sh: Use do_kernel_power_off() m68k: Switch to new sys-off handler API powerpc: Use do_kernel_power_off() xen/x86: Use do_kernel_power_off() parisc: Use do_kernel_power_off() ... commit 32665a9e5432fd88fe20f4affa8986833bbbabe7 Merge: 527953ef71250 3c1d004bdb4e1 Author: Linus Torvalds Date: Mon May 30 11:34:13 2022 -0700 Merge tag 'thermal-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull additional thermal control update from Rafael Wysocki: "Add Meteor Lake PCI device ID to the int340x thermal control driver (Sumeet Pawnikar)" * tag 'thermal-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: int340x: Add Meteor Lake PCI device ID commit 527953ef7125078cd43ccfbed042d60199842b31 Merge: 2c5ca23f7414e 4a577fca503a6 Author: Linus Torvalds Date: Mon May 30 11:30:16 2022 -0700 Merge tag 'acpi-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These add some new device IDs, update a few drivers (processor, battery, backlight) and clean up code in a few places. Specifics: - Add Meteor Lake ACPI IDs for DPTF devices (Sumeet Pawnikar) - Rearrange find_child_checks() to simplify code (Rafael Wysocki) - Use memremap() to map the UCSI mailbox that is always in main memory and drop acpi_release_memory() that has no more users (Heikki Krogerus, Dan Carpenter) - Make max_cstate/nocst/bm_check_disable processor module parameters visible in sysfs (Yajun Deng) - Fix typo in the CPPC driver (Julia Lawall) - Make the ACPI battery driver show the "not-charging" status by default unless "charging" or "full" is directly indicated (Werner Sembach) - Improve the PM notifier in the ACPI backlight driver (Zhang Rui) - Clean up some white space in the ACPI code (Ian Cowan)" * tag 'acpi-5.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe ACPI: DPTF: Support Meteor Lake ACPI: CPPC: fix typo in comment ACPI: video: improve PM notifer callback ACPI: clean up white space in a few places for consistency ACPI: glue: Rearrange find_child_checks() ACPI: processor: idle: Expose max_cstate/nocst/bm_check_disable read-only in sysfs ACPI: battery: Make "not-charging" the default on no charging or full info ACPI: OSL: Remove the helper for deactivating memory region usb: typec: ucsi: acpi: Map the mailbox with memremap() commit 2c5ca23f7414eb2c782f945aa417cfab7b5c88dd Merge: 73d15ba6ba390 bc70682a497c4 Author: Linus Torvalds Date: Mon May 30 11:19:16 2022 -0700 Merge tag 'ovl-update-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs updates from Miklos Szeredi: - Support idmapped layers in overlayfs (Christian Brauner) - Add a fix to exportfs that is relevant to open_by_handle_at(2) as well - Introduce new lookup helpers that allow passing mnt_userns into inode_permission() * tag 'ovl-update-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: support idmapped layers ovl: handle idmappings in ovl_xattr_{g,s}et() ovl: handle idmappings in layer open helpers ovl: handle idmappings in ovl_permission() ovl: use ovl_copy_{real,upper}attr() wrappers ovl: store lower path in ovl_inode ovl: handle idmappings for layer lookup ovl: handle idmappings for layer fileattrs ovl: use ovl_path_getxattr() wrapper ovl: use ovl_lookup_upper() wrapper ovl: use ovl_do_notify_change() wrapper ovl: pass layer mnt to ovl_open_realfile() ovl: pass ofs to setattr operations ovl: handle idmappings in creation operations ovl: add ovl_upper_mnt_userns() wrapper ovl: pass ofs to creation operations ovl: use wrappers to all vfs_*xattr() calls exportfs: support idmapped mounts fs: add two trivial lookup helpers commit 73d15ba6ba390caed47aa8885811d1cd7b4477f3 Merge: 2d2da475ac0ee 7e4fd16b38923 Author: Linus Torvalds Date: Mon May 30 11:01:50 2022 -0700 Merge tag 'mips_5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: "Cleanups and fixes" * tag 'mips_5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (38 commits) MIPS: RALINK: Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA MIPS: Return -EINVAL if mem parameter is empty in early_parse_mem() MIPS: Kconfig: Fix indentation and add endif comment MIPS: bmips: Fix compiler warning observed on W=1 build MIPS: Rewrite `csum_tcpudp_nofold' in plain C mips: setup: use strscpy to replace strlcpy MIPS: Octeon: add SNIC10E board MIPS: Ingenic: Refresh defconfig for CU1000-Neo and CU1830-Neo. MIPS: Ingenic: Refresh device tree for Ingenic SoCs and boards. MIPS: Ingenic: Add PWM nodes for X1830. MIPS: Octeon: fix typo in comment MIPS: loongson32: Kconfig: Remove extra space MIPS: Sibyte: remove unnecessary return variable MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation selftests/ftrace: Save kprobe_events to test log MIPS: tools: no need to initialise statics to 0 MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon MIPS: VR41xx: Drop redundant spinlock initialization MIPS: smp: optimization for flush_tlb_mm when exiting ... commit 2d2da475ac0eebfbf40e5c5ca8c0409d62d23424 Merge: b00ed48bb0a7c 6b8be804ff376 Author: Linus Torvalds Date: Mon May 30 10:56:18 2022 -0700 Merge tag 'm68knommu-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "A collection of changes to add elf-fdpic loader support for m68k. Also a collection of various fixes. They include typo corrections, undefined symbol compilation fixes, removal of the ISA_DMA_API support and removal of unused code. Summary: - correctly set up ZERO_PAGE pointer - drop ISA_DMA_API support - fix comment typos - fixes for undefined symbols - remove unused code and variables - elf-fdpic loader support for m68k" * tag 'm68knommu-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68knommu: fix 68000 CPU link with no platform selected m68k: removed unused "mach_get_ss" m68knommu: fix undefined reference to `mach_get_rtc_pll' m68knommu: fix undefined reference to `_init_sp' m68knommu: allow elf_fdpic loader to be selected m68knommu: add definitions to support elf_fdpic program loader m68knommu: implement minimal regset support m68knommu: use asm-generic/mmu.h for nommu setups m68k: fix typos in comments m68k: coldfire: drop ISA_DMA_API support m68knommu: set ZERO_PAGE() to the allocated zeroed page commit 4a577fca503a63442928ff4cec06c1136ea9b53e Merge: 15f4bb9aac620 185d20694a8ac 1934fee67593c 4c19851c70bae Author: Rafael J. Wysocki Date: Mon May 30 18:07:05 2022 +0200 Merge branches 'acpi-battery', 'acpi-video' and 'acpi-misc' Merge ACPI battery and backlight driver update and miscellaneous cleanup for 5.19-rc1: - Make the ACPI battery driver show the "not-charging" status by default unless "charging" or "full" is directly indicated (Werner Sembach). - Improve the PM notifier in the ACPI backlight driver (Zhang Rui). - Clean up some white space in the ACPI code (Ian Cowan). * acpi-battery: ACPI: battery: Make "not-charging" the default on no charging or full info * acpi-video: ACPI: video: improve PM notifer callback * acpi-misc: ACPI: clean up white space in a few places for consistency commit 15f4bb9aac620f7ca1e50c859731e7d990f807ed Merge: 657b95d34ba3c b7fbf4cebd7c6 a9face899413f 27263b3428f5b 9e12eb8231496 Author: Rafael J. Wysocki Date: Mon May 30 18:04:57 2022 +0200 Merge branches 'acpi-glue', 'acpi-osl', 'acpi-processor' and 'acpi-cppc' Merge general ACPI cleanups and processor support updates for 5.19-rc1: - Rearrange find_child_checks() to simplify code (Rafael Wysocki). - Use memremap() to map the UCSI mailbox that is always in main memory and drop acpi_release_memory() that has no more users (Heikki Krogerus, Dan Carpenter). - Make max_cstate/nocst/bm_check_disable processor module parameters visible in sysfs (Yajun Deng). - Fix typo in the CPPC driver (Julia Lawall). * acpi-glue: ACPI: glue: Rearrange find_child_checks() * acpi-osl: usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe ACPI: OSL: Remove the helper for deactivating memory region usb: typec: ucsi: acpi: Map the mailbox with memremap() * acpi-processor: ACPI: processor: idle: Expose max_cstate/nocst/bm_check_disable read-only in sysfs * acpi-cppc: ACPI: CPPC: fix typo in comment commit a9face899413f468460219c79503c091c4d362cb Author: Dan Carpenter Date: Mon May 9 12:08:28 2022 +0300 usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe The devm_memremap() function never returns NULL. It returns error pointers. Fixes: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()") Signed-off-by: Dan Carpenter Reviewed-by: Heikki Krogerus Acked-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit 72acadfeb378915a3c4990f4252ab33ce8225491 Author: Helge Deller Date: Mon May 30 15:51:08 2022 +0200 parisc: Drop __ARCH_WANT_OLD_READDIR and __ARCH_WANT_SYS_OLDUMOUNT Those old syscalls aren't exported via our syscall table, so just drop them. Signed-off-by: Helge Deller commit 2d969e8f35b1849a43156029a7a6e2943b89d0c0 Author: Adam Thomson Date: Mon May 30 13:22:23 2022 +0000 ASoC: da7219: cancel AAD related work earlier for jack removal To avoid the unlikely possibility of register misalignment for headphones being ungrounded/driven after a jack has been removed, move the cancel_work_sync() call to the start of the jack removal handling in the IRQ thread. Signed-off-by: Adam Thomson Link: https://lore.kernel.org/r/b3f9a679f1e27a9359dcecb496953c4af30acbaa.1653916368.git.DLG-Adam.Thomson.Opensource@dm.renesas.com Signed-off-by: Mark Brown commit 06f5882122e3faa183d76c4ec2c92f4c38e2c7bb Author: Adam Thomson Date: Mon May 30 13:22:22 2022 +0000 ASoC: da7219: Fix pole orientation detection on certain headsets It has been recently found that certain 'active' headsets can be mis-detected as OMTP instead of CTIA, causing obvious issus with audio quality. This relates to increased resistances which negatively impacts the pole detection circuitry within the device. To counter this, ground switches on both headphone channels are available to enable/disable and these allow for the detection process to operate as intended, even with active headsets. This commit adds control of the ground switches to the AAD logic. Signed-off-by: Adam Thomson Link: https://lore.kernel.org/r/e0a627725c189dd50d6ce24571aed87fe2597395.1653916368.git.DLG-Adam.Thomson.Opensource@dm.renesas.com Signed-off-by: Mark Brown commit d6f8168e4345cb00156743c19dc1a409126936e1 Author: Uwe Kleine-König Date: Sun May 29 16:12:50 2022 +0200 ASoC: Intel: avs: Fix build error on arc, m68k and sparc On some platforms (i.e. arc, m68k and sparc) __fls returns an int (while on most platforms it returns an unsigned long). This triggers a format warning on these few platforms as the driver uses %ld to print a warning. So explicitly cast the return value to unsigned long to make the warning go away (and so fix allmodconfig build on the affected architectures). Fixes: beed983621fb ("ASoC: Intel: avs: Machine board registration") Reviewed-by: Cezary Rojewski Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220529141250.1979827-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 9f9c1f6844bdacb4a011cc69e19b929997038f4f Merge: 1cdc5ba06dcea da007f171fc9d Author: Rafael J. Wysocki Date: Mon May 30 15:41:11 2022 +0200 Merge branch 'pm-sysoff' Merge system power off handling rework from Dmitry Osipenko for 5.19-rc1. This introduces a mechanism allowing power sequences to be used for powering off the system and makes related changes in platform-specific code for multiple platforms. * pm-sysoff: (29 commits) kernel/reboot: Change registration order of legacy power-off handler m68k: virt: Switch to new sys-off handler API kernel/reboot: Add devm_register_restart_handler() kernel/reboot: Add devm_register_power_off_handler() soc/tegra: pmc: Use sys-off handler API to power off Nexus 7 properly reboot: Remove pm_power_off_prepare() regulator: pfuze100: Use devm_register_sys_off_handler() ACPI: power: Switch to sys-off handler API memory: emif: Use kernel_can_power_off() mips: Use do_kernel_power_off() ia64: Use do_kernel_power_off() x86: Use do_kernel_power_off() sh: Use do_kernel_power_off() m68k: Switch to new sys-off handler API powerpc: Use do_kernel_power_off() xen/x86: Use do_kernel_power_off() parisc: Use do_kernel_power_off() arm64: Use do_kernel_power_off() riscv: Use do_kernel_power_off() csky: Use do_kernel_power_off() ... commit 1cdc5ba06dcea1f1008c497fca34c42be9bc6a1d Merge: 22ffff6d21ebf 4fe4f1552394d Author: Rafael J. Wysocki Date: Mon May 30 15:40:37 2022 +0200 Merge branch 'pm-docs' Merge PM documentation update for 5.19-rc1. * pm-docs: Documentation: admin-guide: PM: Add Out of Band mode commit 22ffff6d21ebfcd6e722af5f6954ab97c726c3c8 Merge: da4363457f777 e04314082c319 Author: Rafael J. Wysocki Date: Mon May 30 15:38:34 2022 +0200 Merge branch 'pm-opp' Merge OPP (Operating Performance Points) changes for 5.19-rc1: - Minor update to dt-binding for Qcom's opp-v2-kryo-cpu (Yassine Oudjana). - Use list iterator only inside the list_for_each_entry loop (Xiaomeng Tong, and Jakob Koschel). - New APIs related to finding OPP based on interconnect bandwidth (Krzysztof Kozlowski). - Fix the missing of_node_put() in _bandwidth_supported() (Dan Carpenter). - Cleanups (Krzysztof Kozlowski, and Viresh Kumar). * pm-opp: opp: Reorder definition of ceil/floor helpers opp: Add apis to retrieve opps with interconnect bandwidth dt-bindings: opp: opp-v2-kryo-cpu: Remove SMEM opp: use list iterator only inside the loop opp: replace usage of found with dedicated list iterator variable PM: opp: simplify with dev_err_probe() OPP: call of_node_put() on error path in _bandwidth_supported() commit da4363457f777906d49d765398f5227657c82ef9 Author: Pierre Gondois Date: Mon May 30 12:04:24 2022 +0200 cpufreq: CPPC: Fix unused-function warning Building the cppc_cpufreq driver with for arm64 with CONFIG_ENERGY_MODEL=n triggers the following warnings: drivers/cpufreq/cppc_cpufreq.c:550:12: error: ‘cppc_get_cpu_cost’ defined but not used [-Werror=unused-function] 550 | static int cppc_get_cpu_cost(struct device *cpu_dev, unsigned long KHz, | ^~~~~~~~~~~~~~~~~ drivers/cpufreq/cppc_cpufreq.c:481:12: error: ‘cppc_get_cpu_power’ defined but not used [-Werror=unused-function] 481 | static int cppc_get_cpu_power(struct device *cpu_dev, | ^~~~~~~~~~~~~~~~~~ Move the Energy Model related functions into specific guards. This allows to fix the warning and prevent doing extra work when the Energy Model is not present. Fixes: 740fcdc2c20e ("cpufreq: CPPC: Register EM based on efficiency class information") Reported-by: Shaokun Zhang Signed-off-by: Pierre Gondois Tested-by: Shaokun Zhang Signed-off-by: Rafael J. Wysocki commit a3f083e04a87662559bbadddc02f4739b78e743a Author: Zheng Bin Date: Sat May 21 11:24:38 2022 +0800 cpufreq: CPPC: Fix build error without CONFIG_ACPI_CPPC_CPUFREQ_FIE If CONFIG_ACPI_CPPC_CPUFREQ_FIE is not set, building fails: drivers/cpufreq/cppc_cpufreq.c: In function ‘populate_efficiency_class’: drivers/cpufreq/cppc_cpufreq.c:584:2: error: ‘cppc_cpufreq_driver’ undeclared (first use in this function); did you mean ‘cpufreq_driver’? cppc_cpufreq_driver.register_em = cppc_cpufreq_register_em; ^~~~~~~~~~~~~~~~~~~ cpufreq_driver Make declare of cppc_cpufreq_driver out of CONFIG_ACPI_CPPC_CPUFREQ_FIE to fix this. Fixes: 740fcdc2c20e ("cpufreq: CPPC: Register EM based on efficiency class information") Signed-off-by: Zheng Bin Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit b81c14ca14b631aa1abae32fb5ae75b5e9251012 Author: Haisu Wang Date: Mon May 30 14:40:59 2022 +0800 blk-mq: do not update io_ticks with passthrough requests Flush or passthrough requests are not accounted as normal IO in completion. To reflect iostat for slow IO, io_ticks is updated when stat show called based on inflight numbers. It may cause inconsistent io_ticks calculation result. So do not account non-passthrough request when check inflight. Fixes: 86d7331299fd ("block: update io_ticks when io hang") Signed-off-by: Haisu Wang Reviewed-by: samuelliao Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220530064059.1120058-1-haisuwang@tencent.com Signed-off-by: Jens Axboe commit 9c76d723edd4f4d7d10b33e7e56f72ecbe6cee34 Merge: 212e3b6b87346 a3b9ecc805e91 Author: Arnd Bergmann Date: Mon May 30 14:44:25 2022 +0200 Merge tag 'optee-warning-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/late Fix a compiler warning in OP-TEE driver * tag 'optee-warning-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: Pass a pointer to virt_addr_valid() Link: https://lore.kernel.org/r/20220530112612.GA1511426@jade Signed-off-by: Arnd Bergmann commit 9bfa7b36343c7d84370bc61c9ed774635b05e4eb Author: Marios Levogiannis Date: Mon May 30 10:41:31 2022 +0300 ALSA: hda/realtek - Fix microphone noise on ASUS TUF B550M-PLUS Set microphone pins 0x18 (rear) and 0x19 (front) to VREF_50 to fix the microphone noise on ASUS TUF B550M-PLUS which uses the ALCS1200A codec. The initial value was VREF_80. The same issue is also present on Windows using both the default Windows driver and all tested Realtek drivers before version 6.0.9049.1. Comparing Realtek driver 6.0.9049.1 (the first one without the microphone noise) to Realtek driver 6.0.9047.1 (the last one with the microphone noise) revealed that the fix is the result of setting pins 0x18 and 0x19 to VREF_50. This fix may also work for other boards that have been reported to have the same microphone issue and use the ALC1150 and ALCS1200A codecs, since these codecs are similar and the fix in the Realtek driver on Windows is common for both. However, it is currently enabled only for ASUS TUF B550M-PLUS as this is the only board that could be tested. Signed-off-by: Marios Levogiannis Cc: Link: https://lore.kernel.org/r/20220530074131.12258-1-marios.levogiannis@gmail.com Signed-off-by: Takashi Iwai commit 82f586f923e3ac6062bc7867717a7f8afc09e0ff Author: Peter Zijlstra Date: Mon May 30 09:45:38 2022 +0200 sched/autogroup: Fix sysctl move Ivan reported /proc/sys/kernel/sched_autogroup_enabled went walk-about and using the noautogroup command line parameter would result in a boot error message. Turns out the sysctl move placed the init function wrong. Fixes: c8eaf6ac76f4 ("sched: move autogroup sysctls into its own file") Reported-by: Ivan Kozik Signed-off-by: Peter Zijlstra (Intel) Tested-by: Ivan Kozik Link: https://lkml.kernel.org/r/YpR2IqndgsyMzN00@worktop.programming.kicks-ass.net commit 212e3b6b8734655ac4edca979915d002b16f915c Author: Mark Brown Date: Fri May 13 13:12:58 2022 +0100 ARM: configs: Enable more audio support for i.MX The generic audio card for Freescale platforms is used by a wide range of i.MX systems and also has selects for the various audio controllers used on them so will help with systems that don't use that specific card too. Signed-off-by: Mark Brown Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220513121258.168364-1-broonie@kernel.org' Signed-off-by: Arnd Bergmann commit 7711fe713a4987695ac6c68c9f175cb2d1d06e83 Author: Ping-Ke Shih Date: Thu May 26 13:12:51 2022 +0800 wifi: rtw88: add a work to correct atomic scheduling warning of ::set_tim The set_tim is supposed to be atomic, but we should download beacon context to firmware with a mutex lock. To avoid warning, do the thing in another work. BUG: scheduling while atomic: swapper/1/0/0x00000700 Modules linked in: CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W 5.18.0-rc7-00703-g33b5ee09a0c1 #4 Hardware name: Pine64 RK3566 Quartz64-A Board (DT) Call trace: dump_backtrace.part.0+0xc4/0xd0 show_stack+0x14/0x60 dump_stack_lvl+0x60/0x78 dump_stack+0x14/0x2c __schedule_bug+0x5c/0x70 __schedule+0x5c4/0x630 schedule+0x44/0xb0 schedule_preempt_disabled+0xc/0x14 __mutex_lock.constprop.0+0x538/0x56c __mutex_lock_slowpath+0x10/0x20 mutex_lock+0x54/0x60 rtw_ops_set_tim+0x20/0x40 __sta_info_recalc_tim+0x150/0x250 sta_info_recalc_tim+0x10/0x20 invoke_tx_handlers_early+0x4e4/0x5c0 ieee80211_tx+0x78/0x110 ieee80211_xmit+0x94/0xc0 __ieee80211_subif_start_xmit+0x818/0xd20 ieee80211_subif_start_xmit+0x44/0x2d0 dev_hard_start_xmit+0xd0/0x150 __dev_queue_xmit+0x250/0xb30 dev_queue_xmit+0x10/0x20 br_dev_queue_push_xmit+0x94/0x174 br_forward_finish+0x90/0xa0 __br_forward+0xc0/0x13c br_forward+0x108/0x134 br_dev_xmit+0x1cc/0x3a4 dev_hard_start_xmit+0xd0/0x150 __dev_queue_xmit+0x250/0xb30 dev_queue_xmit+0x10/0x20 arp_xmit+0x6c/0x7c arp_send_dst+0x8c/0xc0 arp_solicit+0xd4/0x1e0 neigh_probe+0x58/0xa0 neigh_timer_handler+0x27c/0x380 call_timer_fn.constprop.0+0x20/0x80 __run_timers.part.0+0x230/0x280 run_timer_softirq+0x38/0x70 _stext+0x104/0x278 __irq_exit_rcu+0xa4/0xdc irq_exit_rcu+0xc/0x14 el1_interrupt+0x34/0x50 el1h_64_irq_handler+0x14/0x20 el1h_64_irq+0x64/0x68 arch_cpu_idle+0x14/0x20 do_idle+0x208/0x290 cpu_startup_entry+0x20/0x30 secondary_start_kernel+0x130/0x144 __secondary_switched+0x54/0x58 Fixes: f2217968ffda ("rtw88: Add update beacon flow for AP mode") Reported-by: Ondřej Jirman Signed-off-by: Ping-Ke Shih Tested-by: Ondřej Jirman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220526051251.281905-1-pkshih@realtek.com commit 9c6837311f437701b398bfaed963458aa292e9d7 Author: Johannes Berg Date: Mon May 23 22:03:01 2022 +0200 wifi: iwlwifi: pcie: rename CAUSE macro At least mips64 has ist own CAUSE macro, so rename ours to IWL_CAUSE to fix build issues. Reported-by: Jakub Kicinski Fixes: c1918196427b ("iwlwifi: pcie: simplify MSI-X cause mapping") Signed-off-by: Johannes Berg Acked-by: Gregory Greenman Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220523220300.682be2029361.I283200b18da589a975a284073dca8ed001ee107a@changeid commit d944e09ea839033476e43fe03db0121b7be5154e Author: Johannes Berg Date: Mon May 23 18:02:01 2022 +0200 wifi: libertas: use variable-size data in assoc req/resp cmd The firmware has a 512 limit here, but we use less, so gcc starts complaining about it: drivers/net/wireless/marvell/libertas/cfg.c:1198:63: warning: array subscript ‘struct cmd_ds_802_11_associate_response[0]’ is partly outside array bounds of ‘unsigned char[203]’ [-Warray-bounds] 1198 | "aid 0x%04x\n", status, le16_to_cpu(resp->statuscode), | ^~ Since we size the command and response buffer per our needs and not per the firmware maximum, change to a variable size data array and put the 512 only into a comment. In the end, that's actually what the code always wanted, and it simplifies the code that used to subtract the fixed size buffer size in two places. Reported-by: Jakub Kicinski Signed-off-by: Johannes Berg Acked-by: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220523180200.115fa27fbece.Ie66d874b047e7afad63900aa2df70f031711147e@changeid commit 8eecf1c9929aef24e9e75280a39ed1ba3c64fb71 Merge: 725523dd3634f 22511e665eadc Author: Arnd Bergmann Date: Mon May 30 11:00:01 2022 +0200 Merge tag 'socfpga_dts_updates_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/late SoCFPGA dts updates for v5.19 - dtschema fix SPI NOR node - correct dt-bindings doc for Altera gpio driver - add support for n6000 Agilex platform and dt-bindings documentation * tag 'socfpga_dts_updates_for_v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: intel: add device tree for n6000 dt-bindings: intel: add binding for Intel n6000 dt-bindings: soc: add bindings for Intel HPS Copy Engine dt-bindings: gpio: altera: correct interrupt-cells ARM: dts: socfpga: align SPI NOR node name with dtschema Link: https://lore.kernel.org/r/20220519232317.16079-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 725523dd3634f960c504ed3b64b00687734f8c3d Merge: 8a1e75c53c7a5 8dc7aa0a7246a Author: Arnd Bergmann Date: Mon May 30 10:59:41 2022 +0200 Merge tag 'aspeed-5.19-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/late ASPEED device tree updates for 5.19 - New machine: * Nuvia's DC-SCM BMC - Enable AST2600 GFX, the BMC-driven graphics device - Add a bunch of devices for the AST2600 EVB - Updates to the AST2600 Bletchley machine - Backwards compatible changes to support the new spi-mem based SPI NOR driver * tag 'aspeed-5.19-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: dts: aspeed: ast2600-evb: Enable GFX device ARM: dts: aspeed: Add GFX node to AST2600 ARM: dts: aspeed: ast2600-evb: Enable virtual hub ARM: dts: aspeed: ast2600-evb: Enable video engine ARM: dts: aspeed: everest, rainier: Add power-ffs-sync-history GPIO ARM: dts: aspeed: Add Nuvia DC-SCM BMC ARM: dts: aspeed: bletchley: add sample averaging for ADM1278 ARM: dts: aspeed: bletchley: add eeprom node on each sled ARM: dts: aspeed: bletchley: add pca9536 node on each sled ARM: dts: aspeed: bletchley: update gpio0 line names ARM: dts: aspeed: bletchley: Enable mdio0 bus ARM: dts: aspeed: bletchley: switch spi2 driver to aspeed-smc ARM: dts: aspeed: bletchley: enable ehci0 device node ARM: dts: aspeed: Add USB2.0 device controller node ARM: dts: aspeed-g4: Set spi-max-frequency for all flashes ARM: dts: aspeed: Enable Dual SPI RX transfers ARM: dts: aspeed: Adjust "reg" property of FMC/SPI controllers ARM: dts: aspeed: ast2600-evb: Enable RX delay for MAC0/MAC1 Link: https://lore.kernel.org/r/CACPK8XfUmFxU8Y6C+aZ2+=dT7=fCfs2=2_aYqyRjoXCoeQaUWQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit a3b9ecc805e9131476c719111fe347c7dbc0d1d1 Author: Linus Walleij Date: Thu May 19 23:46:35 2022 +0200 tee: optee: Pass a pointer to virt_addr_valid() A pointer into virtual memory is represented by a (void *) not an u32, so the compiler warns: drivers/tee/optee/call.c:365:29: warning: passing argument 1 of 'virt_to_pfn' makes pointer from integer without a cast [-Wint-conversion] Fix this with an explicit cast. Cc: Sumit Garg Signed-off-by: Linus Walleij Reviewed-by: Sumit Garg [jw: fixed merge conflict] Signed-off-by: Jens Wiklander commit 7146bda743e6f543af60584fad2cfbb6ce83d8ac Merge: 621dc801df4c2 efc2efeba169f Author: Dave Chinner Date: Mon May 30 10:58:59 2022 +1000 Merge branch 'guilt/xfs-5.19-larp-cleanups' into xfs-5.19-for-next This series contains a two key cleanups for the new LARP code. Most of it is refactoring and tweaking the code that creates kernel log messages about enabling and disabling features -- we should be warning about LARP being turned on once per mount, instead of once per insmod cycle; we shouldn't be spamming the logs so aggressively about turning *off* log incompat features. The second part of the series refactors the LARP code responsible for getting (and releasing) permission to use xattr log items. The implementation code doesn't belong in xfs_log.c, and calls to logging functions don't belong in libxfs -- they really should be done by the VFS implementation functions before they start calling into libraries. Signed-off-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 621dc801df4c2e523a66c96b250e0133ed7da90e Merge: 6f5097e3367a7 910bbdf2f4d7d Author: Dave Chinner Date: Mon May 30 10:58:13 2022 +1000 Merge branch 'guilt/xfs-5.19-recovery-buf-cancel' into xfs-5.19-for-next As part of solving the memory leaks and UAF problems in the new LARP code, kmemleak also reported that log recovery will leak the table used to hash buffer cancellations if the recovery fails. Fix this problem by creating alloc/free helpers that initialize and free the hashtable contents correctly. Signed-off-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 6f5097e3367a7c0751e165e4c15bc30511a4ba38 Author: Brian Foster Date: Mon May 30 10:56:33 2022 +1000 xfs: fix xfs_ifree() error handling to not leak perag ref For some reason commit 9a5280b312e2e ("xfs: reorder iunlink remove operation in xfs_ifree") replaced a jump to the exit path in the event of an xfs_difree() error with a direct return, which skips releasing the perag reference acquired at the top of the function. Restore the original code to drop the reference on error. Fixes: 9a5280b312e2e ("xfs: reorder iunlink remove operation in xfs_ifree") Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit b00ed48bb0a7c295facf9036135a573a5cdbe7de Merge: c3a9a3c5f5590 d1a2859780826 Author: Linus Torvalds Date: Sun May 29 11:38:27 2022 -0700 Merge tag 'dmaengine-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "Nothing special, this includes a couple of new device support and new driver support and bunch of driver updates. New support: - Tegra gpcdma driver support - Qualcomm SM8350, Sm8450 and SC7280 device support - Renesas RZN1 dma and platform support Updates: - stm32 device pause/resume support and updates - DMA memset ops Documentation and usage clarification - deprecate '#dma-channels' & '#dma-requests' bindings - driver updates for stm32, ptdma idsx etc" * tag 'dmaengine-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (87 commits) dmaengine: idxd: make idxd_wq_enable() return 0 if wq is already enabled dmaengine: sun6i: Add support for the D1 variant dmaengine: sun6i: Add support for 34-bit physical addresses dmaengine: sun6i: Do not use virt_to_phys dt-bindings: dma: sun50i-a64: Add compatible for D1 dmaengine: tegra: Remove unused switch case dmaengine: tegra: Fix uninitialized variable usage dmaengine: stm32-dma: add device_pause/device_resume support dmaengine: stm32-dma: rename pm ops before dma pause/resume introduction dmaengine: stm32-dma: pass DMA_SxSCR value to stm32_dma_handle_chan_done() dmaengine: stm32-dma: introduce stm32_dma_sg_inc to manage chan->next_sg dmaengine: stm32-dmamux: avoid reset of dmamux if used by coprocessor dmaengine: qcom: gpi: Add support for sc7280 dt-bindings: dma: pl330: Add power-domains dmaengine: stm32-mdma: use dev_dbg on non-busy channel spurious it dmaengine: stm32-mdma: fix chan initialization in stm32_mdma_irq_handler() dmaengine: stm32-mdma: remove GISR1 register dmaengine: ti: deprecate '#dma-channels' dmaengine: mmp: deprecate '#dma-channels' dmaengine: pxa: deprecate '#dma-channels' and '#dma-requests' ... commit 9ff9f77f34e44a0054eadb9041e459548c955ccb Author: Jeff Layton Date: Tue May 24 06:31:54 2022 -0400 MAINTAINERS: reciprocal co-maintainership for file locking and nfsd Chuck has agreed to backstop me as maintainer of the file locking code, and I'll do the same for him on knfsd. Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit c3a9a3c5f5590e85da15d6201e415ff636fe5670 Merge: 76bfd3de34783 dada03db9bb19 Author: Linus Torvalds Date: Sun May 29 10:48:58 2022 -0700 Merge tag 'trace-tools-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing tool updates from Steven Rostedt: - Various clean ups and fixes to rtla (Real Time Linux Analysis) * tag 'trace-tools-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: rtla: Remove procps-ng dependency rtla: Fix __set_sched_attr error message rtla: Minor grammar fix for rtla README rtla: Don't overwrite existing directory mode rtla: Avoid record NULL pointer dereference rtla/Makefile: Properly handle dependencies commit 76bfd3de34783ceda1fc1d73d0db87361de07ecb Merge: 09f73a1ab8207 b39181f7c6907 Author: Linus Torvalds Date: Sun May 29 10:31:36 2022 -0700 Merge tag 'trace-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: "The majority of the changes are for fixes and clean ups. Notable changes: - Rework trace event triggers code to be easier to interact with. - Support for embedding bootconfig with the kernel (as suppose to having it embedded in initram). This is useful for embedded boards without initram disks. - Speed up boot by parallelizing the creation of tracefs files. - Allow absolute ring buffer timestamps handle timestamps that use more than 59 bits. - Added new tracing clock "TAI" (International Atomic Time) - Have weak functions show up in available_filter_function list as: __ftrace_invalid_address___ instead of using the name of the function before it" * tag 'trace-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (52 commits) ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function tracing: Fix comments for event_trigger_separate_filter() x86/traceponit: Fix comment about irq vector tracepoints x86,tracing: Remove unused headers ftrace: Clean up hash direct_functions on register failures tracing: Fix comments of create_filter() tracing: Disable kcov on trace_preemptirq.c tracing: Initialize integer variable to prevent garbage return value ftrace: Fix typo in comment ftrace: Remove return value of ftrace_arch_modify_*() tracing: Cleanup code by removing init "char *name" tracing: Change "char *" string form to "char []" tracing/timerlat: Do not wakeup the thread if the trace stops at the IRQ tracing/timerlat: Print stacktrace in the IRQ handler if needed tracing/timerlat: Notify IRQ new max latency only if stop tracing is set kprobes: Fix build errors with CONFIG_KRETPROBES=n tracing: Fix return value of trace_pid_write() tracing: Fix potential double free in create_var_ref() tracing: Use strim() to remove whitespace instead of doing it manually ftrace: Deal with error return code of the ftrace_process_locs() function ... commit 09f73a1ab8207481d1d6bd91ab7d0125c6722005 Merge: 664a393a2663a 9dde6cadb92b5 Author: Linus Torvalds Date: Sun May 29 10:10:15 2022 -0700 Merge tag 'perf-tools-for-v5.19-2022-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Add BPF based off-CPU profiling - Improvements for system wide recording, specially for Intel PT - Improve DWARF unwinding on arm64 - Support Arm CoreSight trace data disassembly in 'perf script' python - Fix build with new libbpf version, related to supporting older versions of distro released libbpf packages - Fix event syntax error caused by ExtSel in the JSON events infra - Use stdio interface if slang is not supported in 'perf c2c' - Add 'perf test' checking for perf stat CSV output - Sync the msr-index.h copy with the kernel sources * tag 'perf-tools-for-v5.19-2022-05-28' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (38 commits) tools arch x86: Sync the msr-index.h copy with the kernel sources perf scripts python: Support Arm CoreSight trace data disassembly perf scripting python: Expose dso and map information perf jevents: Fix event syntax error caused by ExtSel perf tools arm64: Add support for VG register perf unwind arm64: Decouple Libunwind register names from Perf perf unwind: Use dynamic register set for DWARF unwind perf tools arm64: Copy perf_regs.h from the kernel perf unwind arm64: Use perf's copy of kernel headers perf c2c: Use stdio interface if slang is not supported perf test: Add a basic offcpu profiling test perf record: Add cgroup support for off-cpu profiling perf record: Handle argument change in sched_switch perf record: Implement basic filtering for off-cpu perf record: Enable off-cpu analysis with BPF perf report: Do not extend sample type of bpf-output event perf test: Add checking for perf stat CSV output. perf tools: Allow system-wide events to keep their own threads perf tools: Allow system-wide events to keep their own CPUs libperf evsel: Add comments for booleans ... commit 605f7415ecfb426610195dd6c7577b30592b3369 Author: Jens Axboe Date: Sun May 29 07:13:09 2022 -0600 block: make bioset_exit() fully resilient against being called twice Most of bioset_exit() is fine being called twice, as it clears the various allocations etc when they are freed. The exception is bio_alloc_cache_destroy(), which does not clear ->cache when it has freed it. This isn't necessarily a bug, but can be if buggy users does call the exit path more then once, or with just a memset() bioset which has never been initialized. dm appears to be one such user. Fixes: be4d234d7aeb ("bio: add allocation cache abstraction") Link: https://lore.kernel.org/linux-block/YpK7m+14A+pZKs5k@casper.infradead.org/ Reported-by: Matthew Wilcox Signed-off-by: Jens Axboe commit 90343f573252f5ebf13b3aa3b9a0b7e60ca7f503 Merge: 18eeb4dea65cb c308dfd1b43ef Author: David S. Miller Date: Sun May 29 12:12:53 2022 +0100 Merge branch 'sfc-fixes' Íñigo Huguet says: ==================== sfc: fix some efx_separate_tx_channels errors Trying to load sfc driver with modparam efx_separate_tx_channels=1 resulted in errors during initialization and not being able to use the NIC. This patches fix a few bugs and make it work again. v2: * added Martin's patch instead of a previous mine. Mine one solved some of the initialization errors, but Martin's solves them also in all possible cases. * removed whitespaces cleanup, as requested by Jakub ==================== Signed-off-by: David S. Miller commit c308dfd1b43ef0d4c3e57b741bb3462eb7a7f4a2 Author: Íñigo Huguet Date: Fri May 27 10:05:29 2022 +0200 sfc: fix wrong tx channel offset with efx_separate_tx_channels tx_channel_offset is calculated in efx_allocate_msix_channels, but it is also calculated again in efx_set_channels because it was originally done there, and when efx_allocate_msix_channels was introduced it was forgotten to be removed from efx_set_channels. Moreover, the old calculation is wrong when using efx_separate_tx_channels because now we can have XDP channels after the TX channels, so n_channels - n_tx_channels doesn't point to the first TX channel. Remove the old calculation from efx_set_channels, and add the initialization of this variable if MSI or legacy interrupts are used, next to the initialization of the rest of the related variables, where it was missing. Fixes: 3990a8fffbda ("sfc: allocate channels for XDP tx queues") Reported-by: Tianhao Zhao Signed-off-by: Íñigo Huguet Signed-off-by: David S. Miller commit 2e102b53f8a778f872dc137f4c7ac548705817aa Author: Martin Habets Date: Fri May 27 10:05:28 2022 +0200 sfc: fix considering that all channels have TX queues Normally, all channels have RX and TX queues, but this is not true if modparam efx_separate_tx_channels=1 is used. In that cases, some channels only have RX queues and others only TX queues (or more preciselly, they have them allocated, but not initialized). Fix efx_channel_has_tx_queues to return the correct value for this case too. Messages shown at probe time before the fix: sfc 0000:03:00.0 ens6f0np0: MC command 0x82 inlen 544 failed rc=-22 (raw=0) arg=0 ------------[ cut here ]------------ netdevice: ens6f0np0: failed to initialise TXQ -1 WARNING: CPU: 1 PID: 626 at drivers/net/ethernet/sfc/ef10.c:2393 efx_ef10_tx_init+0x201/0x300 [sfc] [...] stripped RIP: 0010:efx_ef10_tx_init+0x201/0x300 [sfc] [...] stripped Call Trace: efx_init_tx_queue+0xaa/0xf0 [sfc] efx_start_channels+0x49/0x120 [sfc] efx_start_all+0x1f8/0x430 [sfc] efx_net_open+0x5a/0xe0 [sfc] __dev_open+0xd0/0x190 __dev_change_flags+0x1b3/0x220 dev_change_flags+0x21/0x60 [...] stripped Messages shown at remove time before the fix: sfc 0000:03:00.0 ens6f0np0: failed to flush 10 queues sfc 0000:03:00.0 ens6f0np0: failed to flush queues Fixes: 8700aff08984 ("sfc: fix channel allocation with brute force") Reported-by: Tianhao Zhao Signed-off-by: Martin Habets Tested-by: Íñigo Huguet Signed-off-by: David S. Miller commit 534671e0ef5b652d6a983bc1c85c339f7dbfe6ce Author: Masahiro Yamada Date: Fri May 27 23:39:31 2022 +0900 parisc: remove arch/parisc/nm Parisc overrides 'nm' with a shell script. I was hit by a false-positive error of $(NM) because this script returns the exit status of grep instead of ${CROSS_COMPILE}nm. (grep returns 1 if no lines were selected) I tried to fix it, but in the code review, Helge suggested to remove it entirely. [1] This script was added in 2003. [2] Presumably, it was a workaround for old toolchains (but even the parisc maintainer does not know the detail any more). Hopefully, recent tools should work fine. [1]: https://lore.kernel.org/all/1c12cd26-d8aa-4498-f4c0-29478b9578fe@gmx.de/ [2]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=36eaa6e4c0e0b6950136b956b72fd08155b92ca3 Suggested-by: Helge Deller Signed-off-by: Masahiro Yamada Acked-by: Helge Deller commit c25e1c55822f9b3b53ccbf88b85644317a525752 Author: Masahiro Yamada Date: Fri May 27 19:01:49 2022 +0900 kbuild: do not create *.prelink.o for Clang LTO or IBT When CONFIG_LTO_CLANG=y, additional intermediate *.prelink.o is created for each module. Also, objtool is postponed until LLVM IR is converted to ELF. CONFIG_X86_KERNEL_IBT works in a similar way to postpone objtool until objects are merged together. This commit stops generating *.prelink.o, so the build flow will look similar with/without LTO. The following figures show how the LTO build currently works, and how this commit is changing it. Current build flow ================== [1] single-object module $(LD) $(CC) +objtool $(LD) foo.c --------------------> foo.o -----> foo.prelink.o -----> foo.ko (LLVM IR) (ELF) | (ELF) | foo.mod.o --/ (LLVM IR) [2] multi-object module $(LD) $(CC) $(AR) +objtool $(LD) foo1.c -----> foo1.o -----> foo.o -----> foo.prelink.o -----> foo.ko | (archive) (ELF) | (ELF) foo2.c -----> foo2.o --/ | (LLVM IR) foo.mod.o --/ (LLVM IR) One confusion is that foo.o in multi-object module is an archive despite of its suffix. New build flow ============== [1] single-object module Since there is only one object, there is no need to keep the LLVM IR. Use $(CC)+$(LD) to generate an ELF object in one build rule. When LTO is disabled, $(LD) is unneeded because $(CC) produces an ELF object. $(CC)+$(LD)+objtool $(LD) foo.c ----------------------------> foo.o ---------> foo.ko (ELF) | (ELF) | foo.mod.o --/ (LLVM IR) [2] multi-object module Previously, $(AR) was used to combine LLVM IR files into an archive, but there was no technical reason to do so. Use $(LD) to merge them into a single ELF object. $(LD) $(CC) +objtool $(LD) foo1.c ---------> foo1.o ---------> foo.o ---------> foo.ko | (ELF) | (ELF) foo2.c ---------> foo2.o ----/ | (LLVM IR) foo.mod.o --/ (LLVM IR) Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Reviewed-by: Sami Tolvanen Tested-by: Sedat Dilek # LLVM-14 (x86-64) Acked-by: Josh Poimboeuf commit 0cfd90060d714e3d1e0d1b30cfd1c46b71f4e721 Author: Masahiro Yamada Date: Fri May 27 19:01:48 2022 +0900 kbuild: replace $(linked-object) with CONFIG options *.prelink.o is created when CONFIG_LTO_CLANG or CONFIG_X86_KERNEL_IBT is enabled. Replace $(linked-object) with $(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT) so you will get a quick idea of when the --link option is passed. No functional change is intended. Signed-off-by: Masahiro Yamada Acked-by: Josh Poimboeuf Reviewed-by: Nick Desaulniers Tested-by: Sedat Dilek # LLVM-14 commit 0aa24a79ee3b603f6e6cd470c364edc2d746f613 Author: Masahiro Yamada Date: Sun May 29 13:23:18 2022 +0900 kbuild: do not try to parse *.cmd files for objects provided by compiler Guenter Roeck reported the build breakage for parisc and csky. I confirmed nios2 and openrisc are broken as well. The reason is that they borrow libgcc.a from the toolchains. For example, see this line in arch/parisc/Makefile: LIBGCC := $(shell $(CC) -print-libgcc-file-name) Some objects in libgcc.a are linked to vmlinux.o, but they do not have .*.cmd files. Obviously, there is no EXPORT_SYMBOL in external objects. Ignore them. (Most of the architectures import library code into the kernel tree. Perhaps those 4 architectures can do similar, but I do not know how challenging it is.) Fixes: f292d875d0dc ("modpost: extract symbol versions from *.cmd files") Link: https://lore.kernel.org/linux-kbuild/20220528224745.GA2501857@roeck-us.net/T/#mac65c20c71c3e272db0350ecfba53fcd8905b0a0 Reported-by: Guenter Roeck Signed-off-by: Masahiro Yamada Tested-by: Guenter Roeck commit 79b66128f13f5c22dea03a2197495c4b96ab31f5 Author: Helge Deller Date: Sun May 29 08:35:52 2022 +0200 video: fbdev: omap: Add prototype for hwa742_update_window_async() The symbol hwa742_update_window_async() is exported, but there is no prototype defined for it. That's why gcc complains: drivers-video-fbdev-omap-hwa742.c:warning:no-previous-prototype-for-hwa742_update_window_async Add the prototype, but I wonder if we couldn't drop exporting the symbol instead. Since omapfb_update_window_async() is exported the same way, are there any users outside of the tree? Signed-off-by: Helge Deller commit 6e95d0a01899ed176b3450db057c3c0a9609cf47 Author: Gao Xiang Date: Fri May 27 15:01:33 2022 +0800 erofs: update documentation - refine the filesystem overview for better description of recent new features like FSDAX and Fscache; - add the new `fsid' mount option; - fix some typos. Link: https://lore.kernel.org/r/20220527070133.77962-1-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit b5cb79dcfd03e7bb8054d38eaaa557d07966a811 Author: Xin Yin Date: Fri May 27 18:18:00 2022 +0800 erofs: fix crash when enable tracepoint cachefiles_prep_read RIP: 0010:trace_event_raw_event_cachefiles_prep_read+0x88/0xe0 [cachefiles] Call Trace: cachefiles_prepare_read+0x1d7/0x3a0 [cachefiles] erofs_fscache_read_folios+0x188/0x220 [erofs] erofs_fscache_meta_readpage+0x106/0x160 [erofs] do_read_cache_folio+0x42a/0x590 ? bdi_register_va.part.14+0x1a7/0x210 ? super_setup_bdi_name+0x76/0xe0 erofs_bread+0x5b/0x170 [erofs] erofs_fc_fill_super+0x12b/0xc50 [erofs] This tracepoint uses rreq->inode, should set it when allocating. Fixes: d435d53228dd ("erofs: change to use asynchronous io for fscache readpage/readahead") Signed-off-by: Xin Yin Reviewed-by: Jeffle Xu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220527101800.22360-1-yinxin.x@bytedance.com Signed-off-by: Gao Xiang commit 0130e4e8e49f9bd0342d3fc14102470ea9e7230e Author: Jeffle Xu Date: Thu May 26 09:03:44 2022 +0800 erofs: leave compressed inodes unsupported in fscache mode for now erofs over fscache doesn't support the compressed layout yet. It will cause NULL crash if there are compressed inodes contained when working in fscache mode. So far in the erofs based container image distribution scenarios (RAFS v6), the compressed RAFS v6 images are downloaded and then decompressed on demand as an uncompressed erofs image. Then the erofs image is mounted in fscache mode for containers to use. IOWs, currently compressed data is decompressed on the userspace side instead and uncompressed erofs images will be finally cached. The fscache support for the compressed layout is still under development and it will be used for runtime decompression feature. Anyway, to avoid the potential crash, let's leave the compressed inodes unsupported in fscache mode until we support it later. Fixes: 1442b02b66ad ("erofs: implement fscache-based data read for non-inline layout") Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220526010344.118493-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 1346d00e1bdfd4067f92bc14e8a6131a01de4190 Author: Michael Ellerman Date: Wed May 25 13:26:39 2022 +1000 powerpc: Don't select HAVE_IRQ_EXIT_ON_IRQ_STACK The HAVE_IRQ_EXIT_ON_IRQ_STACK option tells generic code that irq_exit() is called while still running on the hard irq stack (hardirq_ctx[] in the powerpc code). Selecting the option means the generic code will *not* switch to the softirq stack before running softirqs, because the code is already running on the (mostly empty) hard irq stack. But since commit 1b1b6a6f4cc0 ("powerpc: handle irq_enter/irq_exit in interrupt handler wrappers"), irq_exit() is now called on the regular task stack, not the hard irq stack. That's because previously irq_exit() was called in __do_irq() which is run on the hard irq stack, but now it is called in interrupt_async_exit_prepare() which is called from do_irq() constructed by the wrapper macro, which is after the switch back to the task stack. So drop HAVE_IRQ_EXIT_ON_IRQ_STACK from the Kconfig. This will mean an extra stack switch when processing some interrupts, but should significantly reduce the likelihood of stack overflow. It also means the softirq stack will be used for running softirqs from other interrupts that don't use the hard irq stack, eg. timer interrupts. Fixes: 1b1b6a6f4cc0 ("powerpc: handle irq_enter/irq_exit in interrupt handler wrappers") Cc: stable@vger.kernel.org # v5.12+ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220525032639.1947280-1-mpe@ellerman.id.au commit a1b29ba2f2c171b9bea73be993bfdf0a62d37d15 Author: He Ying Date: Thu Jan 20 20:44:18 2022 -0500 powerpc/kasan: Silence KASAN warnings in __get_wchan() The following KASAN warning was reported in our kernel. BUG: KASAN: stack-out-of-bounds in get_wchan+0x188/0x250 Read of size 4 at addr d216f958 by task ps/14437 CPU: 3 PID: 14437 Comm: ps Tainted: G O 5.10.0 #1 Call Trace: [daa63858] [c0654348] dump_stack+0x9c/0xe4 (unreliable) [daa63888] [c035cf0c] print_address_description.constprop.3+0x8c/0x570 [daa63908] [c035d6bc] kasan_report+0x1ac/0x218 [daa63948] [c00496e8] get_wchan+0x188/0x250 [daa63978] [c0461ec8] do_task_stat+0xce8/0xe60 [daa63b98] [c0455ac8] proc_single_show+0x98/0x170 [daa63bc8] [c03cab8c] seq_read_iter+0x1ec/0x900 [daa63c38] [c03cb47c] seq_read+0x1dc/0x290 [daa63d68] [c037fc94] vfs_read+0x164/0x510 [daa63ea8] [c03808e4] ksys_read+0x144/0x1d0 [daa63f38] [c005b1dc] ret_from_syscall+0x0/0x38 --- interrupt: c00 at 0x8fa8f4 LR = 0x8fa8cc The buggy address belongs to the page: page:98ebcdd2 refcount:0 mapcount:0 mapping:00000000 index:0x2 pfn:0x1216f flags: 0x0() raw: 00000000 00000000 01010122 00000000 00000002 00000000 ffffffff 00000000 raw: 00000000 page dumped because: kasan: bad access detected Memory state around the buggy address: d216f800: 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 d216f880: f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >d216f900: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 ^ d216f980: f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 d216fa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 After looking into this issue, I find the buggy address belongs to the task stack region. It seems KASAN has something wrong. I look into the code of __get_wchan in x86 architecture and find the same issue has been resolved by the commit f7d27c35ddff ("x86/mm, kasan: Silence KASAN warnings in get_wchan()"). The solution could be applied to powerpc architecture too. As Andrey Ryabinin said, get_wchan() is racy by design, it may access volatile stack of running task, thus it may access redzone in a stack frame and cause KASAN to warn about this. Use READ_ONCE_NOCHECK() to silence these warnings. Reported-by: Wanming Hu Signed-off-by: He Ying Signed-off-by: Chen Jingwen Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220121014418.155675-1-heying24@huawei.com commit 743cdb7bd0f1cb32c03680c8b38257957db2e692 Author: Paul Mackerras Date: Thu May 19 17:45:21 2022 +1000 powerpc/kasan: Mark more real-mode code as not to be instrumented This marks more files and functions that can possibly be called in real mode as not to be instrumented by KASAN. Most were found by inspection, except for get_pseries_errorlog() which was reported as causing a crash in testing. Reported-by: Nageswara R Sastry Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoX1kZPnmUX4RZEK@cleo commit 664a393a2663a0f62fc1b18157ccae33dcdbb8c8 Merge: 47f15561b69e2 1e90e2628cec1 Author: Linus Torvalds Date: Sat May 28 14:05:54 2022 -0700 Merge tag 'input-for-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a new driver for the Azoteq IQS7222A/B/C capacitive touch controller - a new driver for Raspberry Pi Sense HAT joystick - sun4i-lradc-keys gained support of R329 and D1 variants, plus it can be now used as a wakeup source - pm8941-pwrkey can now properly handle PON GEN3 variants; the driver also implements software debouncing and has a workaround for missing key press events - assorted driver fixes and cleanups * tag 'input-for-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (29 commits) Input: stmfts - do not leave device disabled in stmfts_input_open Input: gpio-keys - cancel delayed work only in case of GPIO Input: cypress_ps2 - fix typo in comment Input: vmmouse - disable vmmouse before entering suspend mode dt-bindings: google,cros-ec-keyb: Fixup bad compatible match Input: cros-ec-keyb - allow skipping keyboard registration dt-bindings: google,cros-ec-keyb: Introduce switches only compatible Input: psmouse-smbus - avoid flush_scheduled_work() usage Input: bcm-keypad - remove unneeded NULL check before clk_disable_unprepare Input: sparcspkr - fix refcount leak in bbc_beep_probe Input: sun4i-lradc-keys - add support for R329 and D1 Input: sun4i-lradc-keys - add optional clock/reset support dt-bindings: input: sun4i-lradc-keys: Add R329 and D1 compatibles Input: sun4i-lradc-keys - add wakeup support Input: pm8941-pwrkey - simulate missed key press events Input: pm8941-pwrkey - add software key press debouncing support Input: pm8941-pwrkey - add support for PON GEN3 base addresses Input: pm8941-pwrkey - fix error message Input: synaptics-rmi4 - remove unnecessary flush_workqueue() Input: ep93xx_keypad - use devm_platform_ioremap_resource() helper ... commit 47f15561b69e226bfc034e94ff6dbec51a4662af Author: Linus Torvalds Date: Sat May 28 11:08:48 2022 -0700 drm: fix EDID struct for old ARM OABI format When building the kernel for arm with the "-mabi=apcs-gnu" option, gcc will force alignment of all structures and unions to a word boundary (see also STRUCTURE_SIZE_BOUNDARY and the "-mstructure-size-boundary=XX" option if you're a gcc person), even when the members of said structures do not want or need said alignment. This completely messes up the structure alignment of 'struct edid' on those targets, because even though all the embedded structures are marked with "__attribute__((packed))", the unions that contain them are not. This was exposed by commit f1e4c916f97f ("drm/edid: add EDID block count and size helpers"), but the bug is pre-existing. That commit just made the structure layout problem cause a build failure due to the addition of the BUILD_BUG_ON(sizeof(*edid) != EDID_LENGTH); sanity check in drivers/gpu/drm/drm_edid.c:edid_block_data(). This legacy union alignment should probably not be used in the first place, but we can fix the layout by adding the packed attribute to the union entries even when each member is already packed and it shouldn't matter in a sane build environment. You can see this issue with a trivial test program: union { struct { char c[5]; }; struct { char d; unsigned e; } __attribute__((packed)); } a = { "1234" }; where building this with a normal "gcc -S" will result in the expected 5-byte size of said union: .type a, @object .size a, 5 but with an ARM compiler and the old ABI: arm-linux-gnu-gcc -mabi=apcs-gnu -mfloat-abi=soft -S t.c you get .type a, %object .size a, 8 instead, because even though each member of the union is packed, the union itself still gets aligned. This was reported by Sudip for the spear3xx_defconfig target. Link: https://lore.kernel.org/lkml/YpCUzStDnSgQLNFN@debian/ Reported-by: Sudip Mukherjee Acked-by: Arnd Bergmann Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Linus Torvalds commit 18eeb4dea65cb587057740d6b7b71a13bcfececd Author: Christophe JAILLET Date: Fri May 27 11:25:47 2022 +0200 net: enetc: Use pci_release_region() to release some resources Some resources are allocated using pci_request_region(). It is more straightforward to release them with pci_release_region(). Fixes: 231ece36f50d ("enetc: Add mdio bus driver for the PCIe MDIO endpoint") Signed-off-by: Christophe JAILLET Reviewed-by: Claudiu Manoil Signed-off-by: David S. Miller commit f56dbdda4322d33d485f3d30f3aabba71de9098c Merge: 6112bd00e84e5 d27423bf048dc Author: Linus Torvalds Date: Sat May 28 11:39:01 2022 -0700 Merge tag 'hyperv-next-signed-20220528' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: - Harden hv_sock driver (Andrea Parri) - Harden Hyper-V PCI driver (Andrea Parri) - Fix multi-MSI for Hyper-V PCI driver (Jeffrey Hugo) - Fix Hyper-V PCI to reduce boot time (Dexuan Cui) - Remove code for long EOL'ed Hyper-V versions (Michael Kelley, Saurabh Sengar) - Fix balloon driver error handling (Shradha Gupta) - Fix a typo in vmbus driver (Julia Lawall) - Ignore vmbus IMC device (Michael Kelley) - Add a new error message to Hyper-V DRM driver (Saurabh Sengar) * tag 'hyperv-next-signed-20220528' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (28 commits) hv_balloon: Fix balloon_probe() and balloon_remove() error handling scsi: storvsc: Removing Pre Win8 related logic Drivers: hv: vmbus: fix typo in comment PCI: hv: Fix synchronization between channel callback and hv_pci_bus_exit() PCI: hv: Add validation for untrusted Hyper-V values PCI: hv: Fix interrupt mapping for multi-MSI PCI: hv: Reuse existing IRTE allocation in compose_msi_msg() drm/hyperv: Remove support for Hyper-V 2008 and 2008R2/Win7 video: hyperv_fb: Remove support for Hyper-V 2008 and 2008R2/Win7 scsi: storvsc: Remove support for Hyper-V 2008 and 2008R2/Win7 Drivers: hv: vmbus: Remove support for Hyper-V 2008 and Hyper-V 2008R2/Win7 x86/hyperv: Disable hardlockup detector by default in Hyper-V guests drm/hyperv: Add error message for fb size greater than allocated PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI Drivers: hv: vmbus: Refactor the ring-buffer iterator functions Drivers: hv: vmbus: Accept hv_sock offers in isolated guests hv_sock: Add validation for untrusted Hyper-V values hv_sock: Copy packets sent by Hyper-V out of the ring buffer hv_sock: Check hv_pkt_iter_first_raw()'s return value ... commit 6112bd00e84e5dbffebc3c1e908cbe914ca772ee Merge: 907bb57aa7b47 dcf280e6f80be Author: Linus Torvalds Date: Sat May 28 11:27:17 2022 -0700 Merge tag 'powerpc-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Convert to the generic mmap support (ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) - Add support for outline-only KASAN with 64-bit Radix MMU (P9 or later) - Increase SIGSTKSZ and MINSIGSTKSZ and add support for AT_MINSIGSTKSZ - Enable the DAWR (Data Address Watchpoint) on POWER9 DD2.3 or later - Drop support for system call instruction emulation - Many other small features and fixes Thanks to Alexey Kardashevskiy, Alistair Popple, Andy Shevchenko, Bagas Sanjaya, Bjorn Helgaas, Bo Liu, Chen Huang, Christophe Leroy, Colin Ian King, Daniel Axtens, Dwaipayan Ray, Fabiano Rosas, Finn Thain, Frank Rowand, Fuqian Huang, Guilherme G. Piccoli, Hangyu Hua, Haowen Bai, Haren Myneni, Hari Bathini, He Ying, Jason Wang, Jiapeng Chong, Jing Yangyang, Joel Stanley, Julia Lawall, Kajol Jain, Kevin Hao, Krzysztof Kozlowski, Laurent Dufour, Lv Ruyi, Madhavan Srinivasan, Magali Lemes, Miaoqian Lin, Minghao Chi, Nathan Chancellor, Naveen N. Rao, Nicholas Piggin, Oliver O'Halloran, Oscar Salvador, Pali Rohár, Paul Mackerras, Peng Wu, Qing Wang, Randy Dunlap, Reza Arbab, Russell Currey, Sohaib Mohamed, Vaibhav Jain, Vasant Hegde, Wang Qing, Wang Wensheng, Xiang wangx, Xiaomeng Tong, Xu Wang, Yang Guang, Yang Li, Ye Bin, YueHaibing, Yu Kuai, Zheng Bin, Zou Wei, and Zucheng Zheng. * tag 'powerpc-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (200 commits) powerpc/64: Include cache.h directly in paca.h powerpc/64s: Only set HAVE_ARCH_UNMAPPED_AREA when CONFIG_PPC_64S_HASH_MMU is set powerpc/xics: Include missing header powerpc/powernv/pci: Drop VF MPS fixup powerpc/fsl_book3e: Don't set rodata RO too early powerpc/microwatt: Add mmu bits to device tree powerpc/powernv/flash: Check OPAL flash calls exist before using powerpc/powermac: constify device_node in of_irq_parse_oldworld() powerpc/powermac: add missing g5_phy_disable_cpu1() declaration selftests/powerpc/pmu: fix spelling mistake "mis-match" -> "mismatch" powerpc: Enable the DAWR on POWER9 DD2.3 and above powerpc/64s: Add CPU_FTRS_POWER10 to ALWAYS mask powerpc/64s: Add CPU_FTRS_POWER9_DD2_2 to CPU_FTRS_ALWAYS mask powerpc: Fix all occurences of "the the" selftests/powerpc/pmu/ebb: remove fixed_instruction.S powerpc/platforms/83xx: Use of_device_get_match_data() powerpc/eeh: Drop redundant spinlock initialization powerpc/iommu: Add missing of_node_put in iommu_init_early_dart powerpc/pseries/vas: Call misc_deregister if sysfs init fails powerpc/papr_scm: Fix leaking nvdimm_events_map elements ... commit 907bb57aa7b471872aab2f2e83e9713a145673f9 Merge: ca7984dff94c0 83969805cc716 Author: Linus Torvalds Date: Sat May 28 11:15:54 2022 -0700 Merge tag 'pinctrl-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "Pretty big this time. Mostly due to (nice) Renesas refactorings. Core changes: - New helpers from Andy such as for_each_gpiochip_node() affecting both GPIO and pin control, improving a bunch of drivers in the process. - Pulled in Marc Zyngiers work to make IRQ chips immutable, and started to apply fixups on top. New drivers: - New driver for Marvell MVEBU 98DX2530. - New driver for Mediatek MT8195. - Support Qualcomm PMX65 and PM6125. - New driver for Qualcomm SC7280 LPASS pin control. - New driver for Rockchip RK3588. - New driver for NXP Freescale i.MXRT1170. - New driver for Mediatek MT6795 Helio X10. Improvements: - Several Aspeed G6 cleanups and non-critical fixes. - Thorought refactoring of some of the ever improving Renesas drivers. - Clean up Mediatek MT8192 bindings a bit. - PWM output and clock monitoring in the Ocelot LAN966x driver. - Thorough refactoring and cleanup of the Ralink drivers such as RT2880, RT3883, RT305X, MT7620, MT7621, MT7628 splitting these into proper sub-drivers" * tag 'pinctrl-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (161 commits) pinctrl: apple: Use a raw spinlock for the regmap pinctrl: berlin: bg4ct: Use devm_platform_*ioremap_resource() APIs pinctrl: intel: Fix kernel doc format, i.e. add return sections dt-bindings: pinctrl: qcom: Drop 'maxItems' on 'wakeup-parent' pinctrl: starfive: Make the irqchip immutable pinctrl: mediatek: Add pinctrl driver for MT6795 Helio X10 dt-bindings: pinctrl: Add MediaTek MT6795 pinctrl bindings pinctrl: freescale: Add i.MXRT1170 pinctrl driver support dt-bindings: pinctrl: add i.MXRT1170 pinctrl Documentation dt-bindings: pinctrl: rockchip: increase max amount of device functions dt-bindings: pinctrl: qcom,pmic-gpio: add 'gpio-reserved-ranges' dt-bindings: pinctrl: qcom,pmic-gpio: add 'input-disable' dt-bindings: pinctrl: qcom,pmic-gpio: describe gpio-line-names dt-bindings: pinctrl: qcom,pmic-gpio: fix matching pin config dt-bindings: pinctrl: qcom,pmic-gpio: document PM8150L and PMM8155AU pinctrl: qcom: spmi-gpio: Add pm6125 compatible dt-bindings: pinctrl: qcom-pmic-gpio: Add pm6125 compatible pinctrl: intel: Drop unused irqchip member in struct intel_pinctrl pinctrl: intel: make irq_chip immutable pinctrl: cherryview: Use GPIO chip pointer in chv_gpio_irq_mask_unmask() ... commit acde4003efc16480375543638484d8f13f2e99a3 Author: Javier Martinez Canillas Date: Thu May 26 21:47:52 2022 +0200 video: fbdev: vesafb: Fix a use-after-free due early fb_info cleanup Commit b3c9a924aab6 ("fbdev: vesafb: Cleanup fb_info in .fb_destroy rather than .remove") fixed a use-after-free error due the vesafb driver freeing the fb_info in the .remove handler instead of doing it in .fb_destroy. This can happen if the .fb_destroy callback is executed after the .remove callback, since the former tries to access a pointer freed by the latter. But that change didn't take into account that another possible scenario is that .fb_destroy is called before the .remove callback. For example, if no process has the fbdev chardev opened by the time the driver is removed. If that's the case, fb_info will be freed when unregister_framebuffer() is called, making the fb_info pointer accessed in vesafb_remove() after that to no longer be valid. To prevent that, move the expression containing the info->par to happen before the unregister_framebuffer() function call. Fixes: b3c9a924aab6 ("fbdev: vesafb: Cleanup fb_info in .fb_destroy rather than .remove") Reported-by: Pascal Ernster Signed-off-by: Javier Martinez Canillas Tested-by: Pascal Ernster Signed-off-by: Helge Deller commit ca7984dff94c091a68454b61eb754ec9d4b782a6 Author: Jason A. Donenfeld Date: Sat May 28 13:09:18 2022 +0200 Revert "crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE" This reverts commit 8bdc2a190105e862dfe7a4033f2fd385b7e58ae8. It got merged a bit prematurely and shortly after the kernel test robot and Sudip pointed out build failures: arm: imx_v6_v7_defconfig and multi_v7_defconfig mips: decstation_64_defconfig, decstation_defconfig, decstation_r4k_defconfig In file included from crypto/chacha20poly1305.c:13: include/crypto/poly1305.h:56:46: error: 'CONFIG_CRYPTO_LIB_POLY1305_RSIZE' undeclared here (not in a function); did you mean 'CONFIG_CRYPTO_POLY1305_MODULE'? 56 | struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We could attempt to fix this by listing the dependencies piecemeal, but it's not as obvious as it looks: drivers like caam use this macro in headers even if there's no .o compiled in that makes use of it. So actually fixing this might require a bit more of a comprehensive approach, rather than whack-a-mole with hunting down which drivers use which headers which use this macro. Therefore, this commit just reverts the change, and maybe the problem can be visited on the next rainy day. Reported-by: Sudip Mukherjee Reported-by: kernel test robot Fixes: 8bdc2a190105 ("crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE") Signed-off-by: Jason A. Donenfeld Signed-off-by: Linus Torvalds commit 5e1eeef69c0fef6249b794bda5d68f95a65d062f Author: Hangbin Liu Date: Fri May 27 14:44:39 2022 +0800 bonding: NS target should accept link local address When setting bond NS target, we use bond_is_ip6_target_ok() to check if the address valid. The link local address was wrongly rejected in bond_changelink(), as most time the user just set the ARP/NS target to gateway, while the IPv6 gateway is always a link local address when user set up interface via SLAAC. So remove the link local addr check when setting bond NS target. Fixes: 129e3c1bab24 ("bonding: add new option ns_ip6_target") Reported-by: Li Liang Signed-off-by: Hangbin Liu Reviewed-by: Jonathan Toppins Acked-by: Jay Vosburgh Signed-off-by: David S. Miller commit 911799172d2f703cc14e9000c55d124d5e0a91a2 Author: keliu Date: Fri May 27 06:42:25 2022 +0000 net: nfc: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu Signed-off-by: David S. Miller commit b39181f7c6907dc66ff937b74758671fa6ba430c Author: Steven Rostedt (Google) Date: Thu May 26 14:19:12 2022 -0400 ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function If an unused weak function was traced, it's call to fentry will still exist, which gets added into the __mcount_loc table. Ftrace will use kallsyms to retrieve the name for each location in __mcount_loc to display it in the available_filter_functions and used to enable functions via the name matching in set_ftrace_filter/notrace. Enabling these functions do nothing but enable an unused call to ftrace_caller. If a traced weak function is overridden, the symbol of the function would be used for it, which will either created duplicate names, or if the previous function was not traced, it would be incorrectly be listed in available_filter_functions as a function that can be traced. This became an issue with BPF[1] as there are tooling that enables the direct callers via ftrace but then checks to see if the functions were actually enabled. The case of one function that was marked notrace, but was followed by an unused weak function that was traced. The unused function's call to fentry was added to the __mcount_loc section, and kallsyms retrieved the untraced function's symbol as the weak function was overridden. Since the untraced function would not get traced, the BPF check would detect this and fail. The real fix would be to fix kallsyms to not show addresses of weak functions as the function before it. But that would require adding code in the build to add function size to kallsyms so that it can know when the function ends instead of just using the start of the next known symbol. In the mean time, this is a work around. Add a FTRACE_MCOUNT_MAX_OFFSET macro that if defined, ftrace will ignore any function that has its call to fentry/mcount that has an offset from the symbol that is greater than FTRACE_MCOUNT_MAX_OFFSET. If CONFIG_HAVE_FENTRY is defined for x86, define FTRACE_MCOUNT_MAX_OFFSET to zero (unless IBT is enabled), which will have ftrace ignore all locations that are not at the start of the function (or one after the ENDBR instruction). A worker thread is added at boot up to scan all the ftrace record entries, and will mark any that fail the FTRACE_MCOUNT_MAX_OFFSET test as disabled. They will still appear in the available_filter_functions file as: __ftrace_invalid_address___ (showing the offset that caused it to be invalid). This is required for tools that use libtracefs (like trace-cmd does) that scan the available_filter_functions and enable set_ftrace_filter and set_ftrace_notrace using indexes of the function listed in the file (this is a speedup, as enabling thousands of files via names is an O(n^2) operation and can take minutes to complete, where the indexing takes less than a second). The invalid functions cannot be removed from available_filter_functions as the names there correspond to the ftrace records in the array that manages them (and the indexing depends on this). [1] https://lore.kernel.org/all/20220412094923.0abe90955e5db486b7bca279@kernel.org/ Link: https://lkml.kernel.org/r/20220526141912.794c2786@gandalf.local.home Signed-off-by: Steven Rostedt (Google) commit a1a2d8f0162b27e85e7ce0ae6a35c96a490e0559 Author: Coly Li Date: Sat May 28 20:45:50 2022 +0800 bcache: avoid unnecessary soft lockup in kworker update_writeback_rate() The kworker routine update_writeback_rate() is schedued to update the writeback rate in every 5 seconds by default. Before calling __update_writeback_rate() to do real job, semaphore dc->writeback_lock should be held by the kworker routine. At the same time, bcache writeback thread routine bch_writeback_thread() also needs to hold dc->writeback_lock before flushing dirty data back into the backing device. If the dirty data set is large, it might be very long time for bch_writeback_thread() to scan all dirty buckets and releases dc->writeback_lock. In such case update_writeback_rate() can be starved for long enough time so that kernel reports a soft lockup warn- ing started like: watchdog: BUG: soft lockup - CPU#246 stuck for 23s! [kworker/246:31:179713] Such soft lockup condition is unnecessary, because after the writeback thread finishes its job and releases dc->writeback_lock, the kworker update_writeback_rate() may continue to work and everything is fine indeed. This patch avoids the unnecessary soft lockup by the following method, - Add new member to struct cached_dev - dc->rate_update_retry (0 by default) - In update_writeback_rate() call down_read_trylock(&dc->writeback_lock) firstly, if it fails then lock contention happens. - If dc->rate_update_retry <= BCH_WBRATE_UPDATE_MAX_SKIPS (15), doesn't acquire the lock and reschedules the kworker for next try. - If dc->rate_update_retry > BCH_WBRATE_UPDATE_MAX_SKIPS, no retry anymore and call down_read(&dc->writeback_lock) to wait for the lock. By the above method, at worst case update_writeback_rate() may retry for 1+ minutes before blocking on dc->writeback_lock by calling down_read(). For a 4TB cache device with 1TB dirty data, 90%+ of the unnecessary soft lockup warning message can be avoided. When retrying to acquire dc->writeback_lock in update_writeback_rate(), of course the writeback rate cannot be updated. It is fair, because when the kworker is blocked on the lock contention of dc->writeback_lock, the writeback rate cannot be updated neither. This change follows Jens Axboe's suggestion to a more clear and simple version. Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220528124550.32834-2-colyli@suse.de Signed-off-by: Jens Axboe commit e2e530867245d051dc7800b0d07193b3e581f5b9 Author: Christoph Hellwig Date: Tue May 24 14:15:30 2022 +0200 blk-mq: remove the done argument to blk_execute_rq_nowait Let the caller set it together with the end_io_data instead of passing a pointless argument. Note the the target code did in fact already set it and then just overrode it again by calling blk_execute_rq_nowait. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Kanchan Joshi Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220524121530.943123-4-hch@lst.de Signed-off-by: Jens Axboe commit 32ac5a9b8bc511edcd81f03c3e21753789475709 Author: Christoph Hellwig Date: Tue May 24 14:15:29 2022 +0200 blk-mq: avoid a mess of casts for blk_end_sync_rq Instead of trying to cast a __bitwise 32-bit integer to a larger integer and then a pointer, just allow a struct with the blk_status_t and the completion on stack and set the end_io_data to that. Use the opportunity to move the code to where it belongs and drop rather confusing comments. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220524121530.943123-3-hch@lst.de Signed-off-by: Jens Axboe commit ae948fd6d02930a7e8e7c492d9627dfef18e7d7f Author: Christoph Hellwig Date: Tue May 24 14:15:28 2022 +0200 blk-mq: remove __blk_execute_rq_nowait We don't want to plug for synchronous execution that where we immediately wait for the request. Once that is done not a whole lot of code is shared, so just remove __blk_execute_rq_nowait. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220524121530.943123-2-hch@lst.de Signed-off-by: Jens Axboe commit ebd076bf7d5deef488ec7ebc3fdbf781eafae269 Author: Christoph Hellwig Date: Mon May 23 14:43:02 2022 +0200 block: use bio_queue_enter instead of blk_queue_enter in bio_poll We want to have a valid live gendisk to call ->poll and not just a request_queue, so call the right helper. Fixes: 3e08773c3841 ("block: switch polling to be bio based") Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220523124302.526186-1-hch@lst.de Signed-off-by: Jens Axboe commit 0649e4d63420ebc8cbebef3e9d39e12ffc5eb9fa Author: Yu Xiao Date: Fri May 27 20:24:24 2022 +0200 nfp: only report pause frame configuration for physical device Only report pause frame configuration for physical device. Logical port of both PCI PF and PCI VF do not support it. Fixes: 9fdc5d85a8fe ("nfp: update ethtool reporting of pauseframe control") Signed-off-by: Yu Xiao Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit d8064c10560d53a841b08ab2e11dbd5d28873955 Author: Sean Anderson Date: Fri May 27 16:37:47 2022 -0400 net: dpaa: Convert to SPDX identifiers This converts these files to use SPDX idenfifiers instead of license text. Signed-off-by: Sean Anderson Reviewed-by: Madalin Bucur Signed-off-by: David S. Miller commit 11825765291a93d8e7f44230da67b9f607c777bf Author: Eric Dumazet Date: Fri May 27 14:28:29 2022 -0700 tcp: fix tcp_mtup_probe_success vs wrong snd_cwnd syzbot got a new report [1] finally pointing to a very old bug, added in initial support for MTU probing. tcp_mtu_probe() has checks about starting an MTU probe if tcp_snd_cwnd(tp) >= 11. But nothing prevents tcp_snd_cwnd(tp) to be reduced later and before the MTU probe succeeds. This bug would lead to potential zero-divides. Debugging added in commit 40570375356c ("tcp: add accessors to read/set tp->snd_cwnd") has paid off :) While we are at it, address potential overflows in this code. [1] WARNING: CPU: 1 PID: 14132 at include/net/tcp.h:1219 tcp_mtup_probe_success+0x366/0x570 net/ipv4/tcp_input.c:2712 Modules linked in: CPU: 1 PID: 14132 Comm: syz-executor.2 Not tainted 5.18.0-syzkaller-07857-gbabf0bb978e3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:tcp_snd_cwnd_set include/net/tcp.h:1219 [inline] RIP: 0010:tcp_mtup_probe_success+0x366/0x570 net/ipv4/tcp_input.c:2712 Code: 74 08 48 89 ef e8 da 80 17 f9 48 8b 45 00 65 48 ff 80 80 03 00 00 48 83 c4 30 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 aa b0 c5 f8 <0f> 0b e9 16 fe ff ff 48 8b 4c 24 08 80 e1 07 38 c1 0f 8c c7 fc ff RSP: 0018:ffffc900079e70f8 EFLAGS: 00010287 RAX: ffffffff88c0f7f6 RBX: ffff8880756e7a80 RCX: 0000000000040000 RDX: ffffc9000c6c4000 RSI: 0000000000031f9e RDI: 0000000000031f9f RBP: 0000000000000000 R08: ffffffff88c0f606 R09: ffffc900079e7520 R10: ffffed101011226d R11: 1ffff1101011226c R12: 1ffff1100eadcf50 R13: ffff8880756e72c0 R14: 1ffff1100eadcf89 R15: dffffc0000000000 FS: 00007f643236e700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1ab3f1e2a0 CR3: 0000000064fe7000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tcp_clean_rtx_queue+0x223a/0x2da0 net/ipv4/tcp_input.c:3356 tcp_ack+0x1962/0x3c90 net/ipv4/tcp_input.c:3861 tcp_rcv_established+0x7c8/0x1ac0 net/ipv4/tcp_input.c:5973 tcp_v6_do_rcv+0x57b/0x1210 net/ipv6/tcp_ipv6.c:1476 sk_backlog_rcv include/net/sock.h:1061 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2849 release_sock+0x5d/0x1c0 net/core/sock.c:3404 sk_stream_wait_memory+0x700/0xdc0 net/core/stream.c:145 tcp_sendmsg_locked+0x111d/0x3fc0 net/ipv4/tcp.c:1410 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1448 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x439/0x5c0 net/socket.c:2119 __do_sys_sendto net/socket.c:2131 [inline] __se_sys_sendto net/socket.c:2127 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f6431289109 Code: ff ff 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 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:00007f643236e168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f643139c100 RCX: 00007f6431289109 RDX: 00000000d0d0c2ac RSI: 0000000020000080 RDI: 000000000000000a RBP: 00007f64312e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff372533af R14: 00007f643236e300 R15: 0000000000022000 Fixes: 5d424d5a674f ("[TCP]: MTU probing") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Yuchung Cheng Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 2f1de254a25bee55600287e2eb2cc12ea389c129 Author: Ke Liu Date: Sat May 28 04:54:37 2022 +0000 net: phy: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove(). Signed-off-by: Ke Liu Signed-off-by: David S. Miller commit e225c9a5a74b12e9ef8516f30a3db2c7eb866ee1 Author: Guangguan Wang Date: Sat May 28 14:54:57 2022 +0800 net/smc: fixes for converting from "struct smc_cdc_tx_pend **" to "struct smc_wr_tx_pend_priv *" "struct smc_cdc_tx_pend **" can not directly convert to "struct smc_wr_tx_pend_priv *". Fixes: 2bced6aefa3d ("net/smc: put slot when connection is killed") Signed-off-by: Guangguan Wang Signed-off-by: David S. Miller commit 630f972d76d6460235e84e1aa034ee06f9c8c3a9 Author: Heinrich Schuchardt Date: Sat May 28 03:41:32 2022 +0200 riscv: read-only pages should not be writable If EFI pages are marked as read-only, we should remove the _PAGE_WRITE flag. The current code overwrites an unused value. Fixes: b91540d52a08b ("RISC-V: Add EFI runtime services") Signed-off-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20220528014132.91052-1-heinrich.schuchardt@canonical.com Signed-off-by: Ard Biesheuvel commit 2ef4bb24ff39ae4af89b80bcc5d516f55368e8ae Author: Minghao Chi Date: Wed Mar 9 05:37:32 2022 +0000 pcmcia: Use platform_get_irq() to get the interrupt It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Dominik Brodowski commit 0a19bab54ef44348aa5edfc2b8ff47f63a45ae15 Author: Boris Ostrovsky Date: Fri May 27 13:57:05 2022 -0400 MAINTAINERS: Update Xen maintainership Due to time constraints I am stepping down as maintainter. I will stay as reviewer for x86 code (for which create a separate category). Stefano is now maintainer for Xen hypervisor interface and Oleksandr has graciously agreed to become a reviewer. Signed-off-by: Boris Ostrovsky Acked-by: Stefano Stabellini Acked-by: Juergen Gross Acked-by: Oleksandr Tyshchenko Link: https://lore.kernel.org/r/1653674225-10447-1-git-send-email-boris.ostrovsky@oracle.com Signed-off-by: Juergen Gross commit 9d004b2f4fea97cde123e7f1939b80e77bf2e695 Merge: a9f94826e4bb6 34e37b4c432cd Author: Linus Torvalds Date: Fri May 27 21:24:19 2022 -0700 Merge tag 'cxl-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull cxl updates from Dan Williams: "Compute Express Link (CXL) updates for this cycle. The highlight is new driver-core infrastructure and CXL subsystem changes for allowing lockdep to validate device_lock() usage. Thanks to PeterZ for setting me straight on the current capabilities of the lockdep API, and Greg acked it as well. On the CXL ACPI side this update adds support for CXL _OSC so that platform firmware knows that it is safe to still grant Linux native control of PCIe hotplug and error handling in the presence of CXL devices. A circular dependency problem was discovered between suspend and CXL memory for cases where the suspend image might be stored in CXL memory where that image also contains the PCI register state to restore to re-enable the device. Disable suspend for now until an architecture is defined to clarify that conflict. Lastly a collection of reworks, fixes, and cleanups to the CXL subsystem where support for snooping mailbox commands and properly handling the "mem_enable" flow are the highlights. Summary: - Add driver-core infrastructure for lockdep validation of device_lock(), and fixup a deadlock report that was previously hidden behind the 'lockdep no validate' policy. - Add CXL _OSC support for claiming native control of CXL hotplug and error handling. - Disable suspend in the presence of CXL memory unless and until a protocol is identified for restoring PCI device context from memory hosted on CXL PCI devices. - Add support for snooping CXL mailbox commands to protect against inopportune changes, like set-partition with the 'immediate' flag set. - Rework how the driver detects legacy CXL 1.1 configurations (CXL DVSEC / 'mem_enable') before enabling new CXL 2.0 decode configurations (CXL HDM Capability). - Miscellaneous cleanups and fixes from -next exposure" * tag 'cxl-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (47 commits) cxl/port: Enable HDM Capability after validating DVSEC Ranges cxl/port: Reuse 'struct cxl_hdm' context for hdm init cxl/port: Move endpoint HDM Decoder Capability init to port driver cxl/pci: Drop @info argument to cxl_hdm_decode_init() cxl/mem: Merge cxl_dvsec_ranges() and cxl_hdm_decode_init() cxl/mem: Skip range enumeration if mem_enable clear cxl/mem: Consolidate CXL DVSEC Range enumeration in the core cxl/pci: Move cxl_await_media_ready() to the core cxl/mem: Validate port connectivity before dvsec ranges cxl/mem: Fix cxl_mem_probe() error exit cxl/pci: Drop wait_for_valid() from cxl_await_media_ready() cxl/pci: Consolidate wait_for_media() and wait_for_media_ready() cxl/mem: Drop mem_enabled check from wait_for_media() nvdimm: Fix firmware activation deadlock scenarios device-core: Kill the lockdep_mutex nvdimm: Drop nd_device_lock() ACPI: NFIT: Drop nfit_device_lock() nvdimm: Replace lockdep_mutex with local lock classes cxl: Drop cxl_device_lock() cxl/acpi: Add root device lockdep validation ... commit 1243172d5894e2d8f277ee3c278180792de5c521 Author: Yu Kuai Date: Sat May 21 15:37:49 2022 +0800 nbd: use pr_err to output error message Instead of using the long printk(KERN_ERR "nbd: ...") to output error message, defining pr_fmt and using the short pr_err("") to do that. The replacemen is done by using the following command: sed -i 's/printk(KERN_ERR "nbd: /pr_err("/g' \ drivers/block/nbd.c This patch also rewrap to 80 columns where possible. Signed-off-by: Hou Tao Signed-off-by: Yu Kuai Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220521073749.3146892-7-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 858f1bf65d3d9c00b5e2d8ca87dc79ed88267c98 Author: Zhang Wensheng Date: Sat May 21 15:37:48 2022 +0800 nbd: fix possible overflow on 'first_minor' in nbd_dev_add() When 'index' is a big numbers, it may become negative which forced to 'int'. then 'index << part_shift' might overflow to a positive value that is not greater than '0xfffff', then sysfs might complains about duplicate creation. Because of this, move the 'index' judgment to the front will fix it and be better. Fixes: b0d9111a2d53 ("nbd: use an idr to keep track of nbd devices") Fixes: 940c264984fd ("nbd: fix possible overflow for 'first_minor' in nbd_dev_add()") Signed-off-by: Zhang Wensheng Signed-off-by: Yu Kuai Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220521073749.3146892-6-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 09dadb5985023e27d4740ebd17e6fea4640110e5 Author: Yu Kuai Date: Sat May 21 15:37:47 2022 +0800 nbd: fix io hung while disconnecting device In our tests, "qemu-nbd" triggers a io hung: INFO: task qemu-nbd:11445 blocked for more than 368 seconds. Not tainted 5.18.0-rc3-next-20220422-00003-g2176915513ca #884 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:qemu-nbd state:D stack: 0 pid:11445 ppid: 1 flags:0x00000000 Call Trace: __schedule+0x480/0x1050 ? _raw_spin_lock_irqsave+0x3e/0xb0 schedule+0x9c/0x1b0 blk_mq_freeze_queue_wait+0x9d/0xf0 ? ipi_rseq+0x70/0x70 blk_mq_freeze_queue+0x2b/0x40 nbd_add_socket+0x6b/0x270 [nbd] nbd_ioctl+0x383/0x510 [nbd] blkdev_ioctl+0x18e/0x3e0 __x64_sys_ioctl+0xac/0x120 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd8ff706577 RSP: 002b:00007fd8fcdfebf8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000040000000 RCX: 00007fd8ff706577 RDX: 000000000000000d RSI: 000000000000ab00 RDI: 000000000000000f RBP: 000000000000000f R08: 000000000000fbe8 R09: 000055fe497c62b0 R10: 00000002aff20000 R11: 0000000000000246 R12: 000000000000006d R13: 0000000000000000 R14: 00007ffe82dc5e70 R15: 00007fd8fcdff9c0 "qemu-ndb -d" will call ioctl 'NBD_DISCONNECT' first, however, following message was found: block nbd0: Send disconnect failed -32 Which indicate that something is wrong with the server. Then, "qemu-nbd -d" will call ioctl 'NBD_CLEAR_SOCK', however ioctl can't clear requests after commit 2516ab1543fd("nbd: only clear the queue on device teardown"). And in the meantime, request can't complete through timeout because nbd_xmit_timeout() will always return 'BLK_EH_RESET_TIMER', which means such request will never be completed in this situation. Now that the flag 'NBD_CMD_INFLIGHT' can make sure requests won't complete multiple times, switch back to call nbd_clear_sock() in nbd_clear_sock_ioctl(), so that inflight requests can be cleared. Signed-off-by: Yu Kuai Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220521073749.3146892-5-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 2895f1831e911ca87d4efdf43e35eb72a0c7e66e Author: Yu Kuai Date: Sat May 21 15:37:46 2022 +0800 nbd: don't clear 'NBD_CMD_INFLIGHT' flag if request is not completed Otherwise io will hung because request will only be completed if the cmd has the flag 'NBD_CMD_INFLIGHT'. Fixes: 07175cb1baf4 ("nbd: make sure request completion won't concurrent") Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20220521073749.3146892-4-yukuai3@huawei.com Signed-off-by: Jens Axboe commit c55b2b983b0fa012942c3eb16384b2b722caa810 Author: Yu Kuai Date: Sat May 21 15:37:45 2022 +0800 nbd: fix race between nbd_alloc_config() and module removal When nbd module is being removing, nbd_alloc_config() may be called concurrently by nbd_genl_connect(), although try_module_get() will return false, but nbd_alloc_config() doesn't handle it. The race may lead to the leak of nbd_config and its related resources (e.g, recv_workq) and oops in nbd_read_stat() due to the unload of nbd module as shown below: BUG: kernel NULL pointer dereference, address: 0000000000000040 Oops: 0000 [#1] SMP PTI CPU: 5 PID: 13840 Comm: kworker/u17:33 Not tainted 5.14.0+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: knbd16-recv recv_work [nbd] RIP: 0010:nbd_read_stat.cold+0x130/0x1a4 [nbd] Call Trace: recv_work+0x3b/0xb0 [nbd] process_one_work+0x1ed/0x390 worker_thread+0x4a/0x3d0 kthread+0x12a/0x150 ret_from_fork+0x22/0x30 Fixing it by checking the return value of try_module_get() in nbd_alloc_config(). As nbd_alloc_config() may return ERR_PTR(-ENODEV), assign nbd->config only when nbd_alloc_config() succeeds to ensure the value of nbd->config is binary (valid or NULL). Also adding a debug message to check the reference counter of nbd_config during module removal. Signed-off-by: Hou Tao Signed-off-by: Yu Kuai Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220521073749.3146892-3-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 06c4da89c24e7023ea448cadf8e9daf06a0aae6e Author: Yu Kuai Date: Sat May 21 15:37:44 2022 +0800 nbd: call genl_unregister_family() first in nbd_cleanup() Otherwise there may be race between module removal and the handling of netlink command, which can lead to the oops as shown below: BUG: kernel NULL pointer dereference, address: 0000000000000098 Oops: 0002 [#1] SMP PTI CPU: 1 PID: 31299 Comm: nbd-client Tainted: G E 5.14.0-rc4 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:down_write+0x1a/0x50 Call Trace: start_creating+0x89/0x130 debugfs_create_dir+0x1b/0x130 nbd_start_device+0x13d/0x390 [nbd] nbd_genl_connect+0x42f/0x748 [nbd] genl_family_rcv_msg_doit.isra.0+0xec/0x150 genl_rcv_msg+0xe5/0x1e0 netlink_rcv_skb+0x55/0x100 genl_rcv+0x29/0x40 netlink_unicast+0x1a8/0x250 netlink_sendmsg+0x21b/0x430 ____sys_sendmsg+0x2a4/0x2d0 ___sys_sendmsg+0x81/0xc0 __sys_sendmsg+0x62/0xb0 __x64_sys_sendmsg+0x1f/0x30 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Modules linked in: nbd(E-) Signed-off-by: Hou Tao Signed-off-by: Yu Kuai Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220521073749.3146892-2-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 98d40e76652e9aeb3aec4065f600d633ed335e94 Author: Hannes Reinecke Date: Tue May 24 07:56:30 2022 +0200 block: document BLK_STS_AGAIN usage BLK_STS_AGAIN should only be used if RQF_NOWAIT is set and the bio would block. So we'd better document that to avoid accidental misuse. Signed-off-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220524055631.85480-2-hare@suse.de Signed-off-by: Jens Axboe commit 403d50341cce6b5481a92eb481e6df60b1f49b55 Author: Christoph Hellwig Date: Tue May 24 16:39:19 2022 +0200 block: take destination bvec offsets into account in bio_copy_data_iter Appartly bcache can copy into bios that do not just contain fresh pages but can have offsets into the bio_vecs. Restore support for tht in bio_copy_data_iter. Fixes: f8b679a070c5 ("block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec") Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220524143919.1155501-1-hch@lst.de Signed-off-by: Jens Axboe commit 621433b7e25d6d42e5f75bd8c4a62d6c7251511b Author: Hyunchul Lee Date: Fri May 27 08:50:54 2022 +0900 ksmbd: smbd: relax the count of sges required Remove the condition that the count of sges must be greater than or equal to SMB_DIRECT_MAX_SEND_SGES(8). Because ksmbd needs sges only for SMB direct header, SMB2 transform header, SMB2 response, and optional payload. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Reviewed-by: Tom Talpey Signed-off-by: Steve French commit 9bae058ab57f88c7c1ad61797ee16a5abeda42c2 Merge: 4dc160a52da13 70132763d5d2e Author: Jakub Kicinski Date: Fri May 27 18:29:53 2022 -0700 Merge branch 'net-ipa-fix-page-free-in-two-spots' Alex Elder says: ==================== net: ipa: fix page free in two spots When a receive buffer is not wrapped in an SKB and passed to the network stack, the (compound) page gets freed within the IPA driver. This is currently quite rare. The pages are freed using __free_pages(), but they should instead be freed using page_put(). This series fixes this, in two spots. These patches work for the current linus/master branch, but won't apply cleanly to earlier stable branches. (Nevertheless, the fix is a trivial substitution everwhere __free_pages() is called.) ==================== Link: https://lore.kernel.org/r/20220526152314.1405629-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 70132763d5d2e94cd185e3aa92ac6a3ba89068fa Author: Alex Elder Date: Thu May 26 10:23:14 2022 -0500 net: ipa: fix page free in ipa_endpoint_replenish_one() Currently the (possibly compound) pages used for receive buffers are freed using __free_pages(). But according to this comment above the definition of that function, that's wrong: If you want to use the page's reference count to decide when to free the allocation, you should allocate a compound page, and use put_page() instead of __free_pages(). Convert the call to __free_pages() in ipa_endpoint_replenish_one() to use put_page() instead. Fixes: 6a606b90153b8 ("net: ipa: allocate transaction in replenish loop") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 155c0c90bca918de6e4327275dfc1d97fd604115 Author: Alex Elder Date: Thu May 26 10:23:13 2022 -0500 net: ipa: fix page free in ipa_endpoint_trans_release() Currently the (possibly compound) page used for receive buffers are freed using __free_pages(). But according to this comment above the definition of that function, that's wrong: If you want to use the page's reference count to decide when to free the allocation, you should allocate a compound page, and use put_page() instead of __free_pages(). Convert the call to __free_pages() in ipa_endpoint_trans_release() to use put_page() instead. Fixes: ed23f02680caa ("net: ipa: define per-endpoint receive buffer size") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 4dc160a52da1330d54d561f9dac8a9e0ef333895 Author: Alexandru Tachici Date: Thu May 26 17:13:18 2022 +0300 dt-bindings: net: Update ADIN PHY maintainers Update the dt-bindings maintainers section. Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220526141318.77146-1-alexandru.tachici@analog.com Signed-off-by: Jakub Kicinski commit a9f94826e4bb6402e67f3eb849dee0811f1de6da Merge: d075c0c1be279 781121a7f6d11 Author: Linus Torvalds Date: Fri May 27 18:17:03 2022 -0700 Merge tag 'clang-format-for-linus-v5.19-rc1' of https://github.com/ojeda/linux Pull clang-format updates from Miguel Ojeda: "clang-format modernization and cleanups. A few changes from Brian Norris and Mickaël Salaün to start taking advantage of some clang-format 11 features, plus a few cleanups and the usual update of the macro list" * tag 'clang-format-for-linus-v5.19-rc1' of https://github.com/ojeda/linux: clang-format: Fix space after for_each macros clang-format: Fix goto labels indentation clang-format: Update to clang-format >= 6 clang-format: Extend the for_each list with tools/ clang-format: Simplify command with `sort -u` clang-format: Use POSIX locale for `sort` clang-format: Update with v5.18-rc7's `for_each` macro list commit d075c0c1be279c5f4c6688ac0442fff6494e56bc Merge: bf272460d7441 e4e62bbc6aba4 Author: Linus Torvalds Date: Fri May 27 18:06:49 2022 -0700 Merge tag 'v5.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Test in-place en/decryption with two sglists in testmgr - Fix process vs softirq race in cryptd Algorithms: - Add arm64 acceleration for sm4 - Add s390 acceleration for chacha20 Drivers: - Add polarfire soc hwrng support in mpsf - Add support for TI SoC AM62x in sa2ul - Add support for ATSHA204 cryptochip in atmel-sha204a - Add support for PRNG in caam - Restore support for storage encryption in qat - Restore support for storage encryption in hisilicon/sec" * tag 'v5.19-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits) hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() crypto: hisilicon/sec - delete the flag CRYPTO_ALG_ALLOCATES_MEMORY crypto: qat - add support for 401xx devices crypto: qat - re-enable registration of algorithms crypto: qat - honor CRYPTO_TFM_REQ_MAY_SLEEP flag crypto: qat - add param check for DH crypto: qat - add param check for RSA crypto: qat - remove dma_free_coherent() for DH crypto: qat - remove dma_free_coherent() for RSA crypto: qat - fix memory leak in RSA crypto: qat - add backlog mechanism crypto: qat - refactor submission logic crypto: qat - use pre-allocated buffers in datapath crypto: qat - set to zero DH parameters before free crypto: s390 - add crypto library interface for ChaCha20 crypto: talitos - Uniform coding style with defined variable crypto: octeontx2 - simplify the return expression of otx2_cpt_aead_cbc_aes_sha_setkey() crypto: cryptd - Protect per-CPU resource by disabling BH. crypto: sun8i-ce - do not fallback if cryptlen is less than sg length crypto: sun8i-ce - rework debugging ... commit 6b51935a26518baa8370c192d5a5520dfefec183 Merge: 2c262b21de6dc caff1fa4118ce Author: Jakub Kicinski Date: Fri May 27 17:17:52 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-05-28 We've added 2 non-merge commits during the last 1 day(s) which contain a total of 2 files changed, 6 insertions(+), 10 deletions(-). The main changes are: 1) Fix ldx_probe_mem instruction in interpreter by properly zero-extending the bpf_probe_read_kernel() read content, from Menglong Dong. 2) Fix stacktrace_build_id BPF selftest given urandom_read has been renamed into urandom_read_iter in random driver, from Song Liu. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Fix probe read error in ___bpf_prog_run() selftests/bpf: fix stacktrace_build_id with missing kprobe/urandom_read ==================== Link: https://lore.kernel.org/r/20220527235042.8526-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit caff1fa4118cec4dfd4336521ebd22a6408a1e3e Author: Menglong Dong Date: Tue May 24 10:12:27 2022 +0800 bpf: Fix probe read error in ___bpf_prog_run() I think there is something wrong with BPF_PROBE_MEM in ___bpf_prog_run() in big-endian machine. Let's make a test and see what will happen if we want to load a 'u16' with BPF_PROBE_MEM. Let's make the src value '0x0001', the value of dest register will become 0x0001000000000000, as the value will be loaded to the first 2 byte of DST with following code: bpf_probe_read_kernel(&DST, SIZE, (const void *)(long) (SRC + insn->off)); Obviously, the value in DST is not correct. In fact, we can compare BPF_PROBE_MEM with LDX_MEM_H: DST = *(SIZE *)(unsigned long) (SRC + insn->off); If the memory load is done by LDX_MEM_H, the value in DST will be 0x1 now. And I think this error results in the test case 'test_bpf_sk_storage_map' failing: test_bpf_sk_storage_map:PASS:bpf_iter_bpf_sk_storage_map__open_and_load 0 nsec test_bpf_sk_storage_map:PASS:socket 0 nsec test_bpf_sk_storage_map:PASS:map_update 0 nsec test_bpf_sk_storage_map:PASS:socket 0 nsec test_bpf_sk_storage_map:PASS:map_update 0 nsec test_bpf_sk_storage_map:PASS:socket 0 nsec test_bpf_sk_storage_map:PASS:map_update 0 nsec test_bpf_sk_storage_map:PASS:attach_iter 0 nsec test_bpf_sk_storage_map:PASS:create_iter 0 nsec test_bpf_sk_storage_map:PASS:read 0 nsec test_bpf_sk_storage_map:FAIL:ipv6_sk_count got 0 expected 3 $10/26 bpf_iter/bpf_sk_storage_map:FAIL The code of the test case is simply, it will load sk->sk_family to the register with BPF_PROBE_MEM and check if it is AF_INET6. With this patch, now the test case 'bpf_iter' can pass: $10 bpf_iter:OK Fixes: 2a02759ef5f8 ("bpf: Add support for BTF pointers to interpreter") Signed-off-by: Menglong Dong Signed-off-by: Daniel Borkmann Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Cc: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/20220524021228.533216-1-imagedong@tencent.com commit bf272460d744112bacd4c4d562592decbf0edf64 Merge: aef1ff1592742 44a48081fc031 Author: Linus Torvalds Date: Fri May 27 16:05:57 2022 -0700 Merge tag '5.19-rc-smb3-client-fixes-updated' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client updates from Steve French: - multichannel fixes to improve reconnect after network failure - improved caching of root directory contents (extending benefit of directory leases) - two DFS fixes - three fixes for improved debugging - an NTLMSSP fix for mounts t0 older servers - new mount parm to allow disabling creating sparse files - various cleanup fixes and minor fixes pointed out by coverity * tag '5.19-rc-smb3-client-fixes-updated' of git://git.samba.org/sfrench/cifs-2.6: (24 commits) smb3: remove unneeded null check in cifs_readdir cifs: fix ntlmssp on old servers cifs: cache the dirents for entries in a cached directory cifs: avoid parallel session setups on same channel cifs: use new enum for ses_status cifs: do not use tcpStatus after negotiate completes smb3: add mount parm nosparse smb3: don't set rc when used and unneeded in query_info_compound smb3: check for null tcon cifs: fix minor compile warning Add various fsctl structs Add defines for various newer FSCTLs smb3: add trace point for oplock not found cifs: return the more nuanced writeback error on close() smb3: add trace point for lease not found issue cifs: smbd: fix typo in comment cifs: set the CREATE_NOT_FILE when opening the directory in use_cached_dir() cifs: check for smb1 in open_cached_dir() cifs: move definition of cifs_fattr earlier in cifsglob.h cifs: print TIDs as hex ... commit aef1ff15927421a55312b4b9b2881a89a344bd80 Merge: 35cdd8656eac4 e471e5942c006 Author: Linus Torvalds Date: Fri May 27 15:59:21 2022 -0700 Merge tag 'jfs-5.19' of https://github.com/kleikamp/linux-shaggy Pull jfs updates from David Kleikamp: "One bug fix and some code cleanup" * tag 'jfs-5.19' of https://github.com/kleikamp/linux-shaggy: fs/jfs: Remove dead code fs: jfs: fix possible NULL pointer dereference in dbFree() commit 35cdd8656eac470b9abc9de8d4bd268fbc0fb34b Merge: ea6c3bc6ed93d f42e8e5088b9e Author: Linus Torvalds Date: Fri May 27 15:49:30 2022 -0700 Merge tag 'libnvdimm-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm and DAX updates from Dan Williams: "New support for clearing memory errors when a file is in DAX mode, alongside with some other fixes and cleanups. Previously it was only possible to clear these errors using a truncate or hole-punch operation to trigger the filesystem to reallocate the block, now, any page aligned write can opportunistically clear errors as well. This change spans x86/mm, nvdimm, and fs/dax, and has received the appropriate sign-offs. Thanks to Jane for her work on this. Summary: - Add support for clearing memory error via pwrite(2) on DAX - Fix 'security overwrite' support in the presence of media errors - Miscellaneous cleanups and fixes for nfit_test (nvdimm unit tests)" * tag 'libnvdimm-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: pmem: implement pmem_recovery_write() pmem: refactor pmem_clear_poison() dax: add .recovery_write dax_operation dax: introduce DAX_RECOVERY_WRITE dax access mode mce: fix set_mce_nospec to always unmap the whole page x86/mce: relocate set{clear}_mce_nospec() functions acpi/nfit: rely on mce->misc to determine poison granularity testing: nvdimm: asm/mce.h is not needed in nfit.c testing: nvdimm: iomap: make __nfit_test_ioremap a macro nvdimm: Allow overwrite in the presence of disabled dimms tools/testing/nvdimm: remove unneeded flush_workqueue commit 1e90e2628cec11c080db3260833f515cc32fc27c Merge: b26ff91371833 5f76955ab1e43 Author: Dmitry Torokhov Date: Fri May 27 15:48:45 2022 -0700 Merge branch 'next' into for-linus Prepare input updates for 5.19 merge window. commit ea6c3bc6ed93dd032568427e92424f6d33deb99b Merge: 6b0e34a0307e0 f93afd8e7567f Author: Linus Torvalds Date: Fri May 27 15:39:47 2022 -0700 Merge tag 'mfd-next-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Device Support - Add support for {Power,Home} Keys to MediaTek MT6359 - Add support for SC2730 to Spreadtrum SPRD SC27XX SPI - Add support for additional Alder Lake-P I2C Controllers to Intel LPSS PCI Fix-ups: - Convert GPIO to GPIOD (hi655x-pmic) - Only register devices that exist (cros_ec_dev) - Remove unused code (syscon, reg-mux) - Rework .remove() API to return void (twl-core, rt4831) - Trivial - whitespace, spelling, coding style (tps65218, sprd-sc27xx-spi, google,cros-ec) - DT binding changes (samsung,exynos5433-lpass, rockchip,rk805, rockchip,rk808, rockchip,rk809, rockchip,rk817, rockchip,rk818, wlf,arizona) Bug Fixes: - Fix error handling bugs (ipaq-micro, davinci_voicecodec)" * tag 'mfd-next-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: dt-bindings: cros-ec: Fix a typo in description dt-bindings: mfd: wlf,arizona: Add spi-max-frequency mfd: rt4831: Improve error reporting for problems during .remove() mfd: davinci_voicecodec: Fix possible null-ptr-deref davinci_vc_probe() mfd: intel-lpss: Add support for ADL-P i2c6 and i2c7 dt-bindings: mfd: rk808: Convert bindings to yaml mfd: twl4030: Make twl4030_exit_irq() return void mfd: twl6030: Make twl6030_exit_irq() return void dt-bindings: mfd: samsung,exynos5433-lpass: Fix 'dma-channels/requests' properties mfd: sprd: Jugle {of,spi}_device_id tables into numerical order mfd: sprd: Add SC2730 PMIC to SPI device ID table dt-bindings: Drop undocumented i.MX iomuxc-gpr bindings in examples mfd: cros_ec_dev: Only register PCHG device if present mfd: mt6397-core: Add resources for PMIC keys for MT6359 mfd: mt6359: Add missing defines necessary for mtk-pmic-keys support mfd: ipaq-micro: Fix error check return value of platform_get_irq() mfd: hi655x-pmic: Replace legacy gpio interface for gpiod interface mfd: tps65218: Fix trivial typo in comment commit 6b0e34a0307e046c0662d7dcaba2a2c9993c4339 Merge: 3cc30140dbe2d 71cc785d29552 Author: Linus Torvalds Date: Fri May 27 15:33:24 2022 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "Mainly driver updates this time around. There's a single patch to the core clk framework that simplifies a runtime PM call. Otherwise the majority of the diff falls to a few SoC drivers: Qualcomm, STM32 and MediaTek. Those SoCs gain some new hardware support and what comes along with that is quite a few lines of data and some clk_ops code. Beyond the new hardware support we have the usual pile of driver updates that add missing clks on already supported SoCs or fix up problems like bad clk tree descriptions. It's nice to see that more drivers are moving to clk_hw based APIs too. New Drivers: - Add STM32MP13 RCC driver (Reset Clock Controller) - MediaTek MT8186 SoC clk support - Airoha EN7523 SoC system clocks - Clock driver for exynosautov9 SoC - Renesas R-Car V4H and RZ/V2M SoCs - Renesas RZ/G2UL SoC - LPASS clk driver for Qualcomm sc7280 SoC - GCC clk driver for Qualcomm SC8280XP SoC Updates: - SDCC uses floor clk ops on Qualcomm MSM8976 - Add modem reset and fix RPM clks on Qualcomm MSM8976 - Add the two missing CLKOUT clocks for U8500/DB8500 SoC - Mark some clks critical on Ingenic X1000 - Convert ux500 to clk_hw - Move MediaTek driver to clk_hw provider APIs - Use i2c driver probe_new to avoid id scans - Convert a number of Rockchip dt bindings to YAML - Mark hclk_vo critical on Rockchip rk3568 - Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage - Various cleanups like memory allocation error checks and plugged leaks - Allwinner H6 RTC clock support - Allwinner H616 32 kHz clock support - Add the Universal Flash Storage clock on Renesas R-Car S4-8 - Add I2C, SSIF-2 (sound), USB, CANFD, OSTM (timer), WDT, SPI Multi I/O Bus, RSPI, TSU (thermal), and ADC clocks and resets on Renesas RZ/G2UL - Add display clock support on Renesas RZ/G2L - Add RPC (QSPI/HyperFlash) clocks on Renesas R-Car E3 and D3 - Add 27 MHz phy PLL ref clock on i.MX - Add mcore_booted module parameter to tell kernel M core has already booted for i.MX - Remove snvs clock on i.MX because it was for secure world only - Add dt bindings for i.MX8MN GPT - Add DISP2 pixel clock for i.MX8MP - Add clkout1/2 for i.MX8MP - Fix parent clock of ubs_root_clk for i.MX8MP - Implement better RCG parking on Qualcomm SoCs using the shared RCG clk ops - Kerneldoc fixes - Switch Tegra BPMP to determine_rate clk op - Add a pointer to dt schema for generic clock bindings" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (168 commits) Revert "clk: qcom: regmap-mux: add pipe clk implementation" Revert "clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" Revert "clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc() clk: stm32mp13: add safe mux management clk: stm32mp13: add multi mux function clk: stm32mp13: add all STM32MP13 kernel clocks clk: stm32mp13: add all STM32MP13 peripheral clocks clk: stm32mp13: manage secured clocks clk: stm32mp13: add composite clock clk: stm32mp13: add stm32 divider clock clk: stm32mp13: add stm32_gate management clk: stm32mp13: add stm32_mux clock management clk: stm32: Introduce STM32MP13 RCC drivers (Reset Clock Controller) dt-bindings: rcc: stm32: add new compatible for STM32MP13 SoC clk: ti: clkctrl: replace usage of found with dedicated list iterator variable clk: ti: composite: Prefer kcalloc over open coded arithmetic dt-bindings: clock: exynosautov9: correct count of NR_CLK clk: mediatek: mt8173: Switch to clk_hw provider APIs clk: mediatek: Switch to clk_hw provider APIs ... commit 3cc30140dbe2df9b5ac000898e0ae3d1df980f2c Merge: 8291eaafed36f 32f479d05a445 Author: Linus Torvalds Date: Fri May 27 15:25:10 2022 -0700 Merge tag 'pci-v5.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci updates from Bjorn Helgaas: "Resource management: - Restrict E820 clipping to PCI host bridge windows (Bjorn Helgaas) - Log E820 clipping better (Bjorn Helgaas) - Add kernel cmdline options to enable/disable E820 clipping (Hans de Goede) - Disable E820 reserved region clipping for IdeaPads, Yoga, Yoga Slip, Acer Spin 5, Clevo Barebone systems where clipping leaves no usable address space for touchpads, Thunderbolt devices, etc (Hans de Goede) - Disable E820 clipping by default starting in 2023 (Hans de Goede) PCI device hotplug: - Include files to remove implicit dependencies (Christophe Leroy) - Only put Root Ports in D3 if they can signal and wake from D3 so AMD Yellow Carp doesn't miss hotplug events (Mario Limonciello) Power management: - Define pci_restore_standard_config() only for CONFIG_PM_SLEEP since it's unused otherwise (Krzysztof Kozlowski) - Power up devices completely, including anything platform firmware needs to do, during runtime resume (Rafael J. Wysocki) - Move pci_resume_bus() to PM callbacks so we observe the required bridge power-up delays (Rafael J. Wysocki) - Drop unneeded runtime_d3cold device flag (Rafael J. Wysocki) - Split pci_raw_set_power_state() between pci_power_up() and a new pci_set_low_power_state() (Rafael J. Wysocki) - Set current_state to D3cold if config read returns ~0, indicating the device is not accessible (Rafael J. Wysocki) - Do not call pci_update_current_state() from pci_power_up() so BARs and ASPM config are restored correctly (Rafael J. Wysocki) - Write 0 to PMCSR in pci_power_up() in all cases (Rafael J. Wysocki) - Split pci_power_up() to pci_set_full_power_state() to avoid some redundant operations (Rafael J. Wysocki) - Skip restoring BARs if device is not in D0 (Rafael J. Wysocki) - Rearrange and clarify pci_set_power_state() (Rafael J. Wysocki) - Remove redundant BAR restores from pci_pm_thaw_noirq() (Rafael J. Wysocki) Virtualization: - Acquire device lock before config space access lock to avoid AB/BA deadlock with sriov_numvfs_store() (Yicong Yang) Error handling: - Clear MULTI_ERR_COR/UNCOR_RCV bits, which a race could previously leave permanently set (Kuppuswamy Sathyanarayanan) Peer-to-peer DMA: - Whitelist Intel Skylake-E Root Ports regardless of which devfn they are (Shlomo Pongratz) ASPM: - Override L1 acceptable latency advertised by Intel DG2 so ASPM L1 can be enabled (Mika Westerberg) Cadence PCIe controller driver: - Set up device-specific register to allow PTM Responder to be enabled by the normal architected bit (Christian Gmeiner) - Override advertised FLR support since the controller doesn't implement FLR correctly (Parshuram Thombare) Cadence PCIe endpoint driver: - Correct bitmap size for the ob_region_map of outbound window usage (Dan Carpenter) Freescale i.MX6 PCIe controller driver: - Fix PERST# assertion/deassertion so we observe the required delays before accessing device (Francesco Dolcini) Freescale Layerscape PCIe controller driver: - Add "big-endian" DT property (Hou Zhiqiang) - Update SCFG DT property (Hou Zhiqiang) - Add "aer", "pme", "intr" DT properties (Li Yang) - Add DT compatible strings for ls1028a (Xiaowei Bao) Intel VMD host bridge driver: - Assign VMD IRQ domain before enumeration to avoid IOMMU interrupt remapping errors when MSI-X remapping is disabled (Nirmal Patel) - Revert VMD workaround that kept MSI-X remapping enabled when IOMMU remapping was enabled (Nirmal Patel) Marvell MVEBU PCIe controller driver: - Add of_pci_get_slot_power_limit() to parse the 'slot-power-limit-milliwatt' DT property (Pali Rohár) - Add mvebu support for sending Set_Slot_Power_Limit message (Pali Rohár) MediaTek PCIe controller driver: - Fix refcount leak in mtk_pcie_subsys_powerup() (Miaoqian Lin) MediaTek PCIe Gen3 controller driver: - Reset PHY and MAC at probe time (AngeloGioacchino Del Regno) Microchip PolarFlare PCIe controller driver: - Add chained_irq_enter()/chained_irq_exit() calls to mc_handle_msi() and mc_handle_intx() to avoid lost interrupts (Conor Dooley) - Fix interrupt handling race (Daire McNamara) NVIDIA Tegra194 PCIe controller driver: - Drop tegra194 MSI register save/restore, which is unnecessary since the DWC core does it (Jisheng Zhang) Qualcomm PCIe controller driver: - Add SM8150 SoC DT binding and support (Bhupesh Sharma) - Fix pipe clock imbalance (Johan Hovold) - Fix runtime PM imbalance on probe errors (Johan Hovold) - Fix PHY init imbalance on probe errors (Johan Hovold) - Convert DT binding to YAML (Dmitry Baryshkov) - Update DT binding to show that resets aren't required for MSM8996/APQ8096 platforms (Dmitry Baryshkov) - Add explicit register names per chipset in DT binding (Dmitry Baryshkov) - Add sc7280-specific clock and reset definitions to DT binding (Dmitry Baryshkov) Rockchip PCIe controller driver: - Fix bitmap size when searching for free outbound region (Dan Carpenter) Rockchip DesignWare PCIe controller driver: - Remove "snps,dw-pcie" from rockchip-dwc DT "compatible" property because it's not fully compatible with rockchip (Peter Geis) - Reset rockchip-dwc controller at probe (Peter Geis) - Add rockchip-dwc INTx support (Peter Geis) Synopsys DesignWare PCIe controller driver: - Return error instead of success if DMA mapping of MSI area fails (Jiantao Zhang) Miscellaneous: - Change pci_set_dma_mask() documentation references to dma_set_mask() (Alex Williamson)" * tag 'pci-v5.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (64 commits) dt-bindings: PCI: qcom: Add schema for sc7280 chipset dt-bindings: PCI: qcom: Specify reg-names explicitly dt-bindings: PCI: qcom: Do not require resets on msm8996 platforms dt-bindings: PCI: qcom: Convert to YAML PCI: qcom: Fix unbalanced PHY init on probe errors PCI: qcom: Fix runtime PM imbalance on probe errors PCI: qcom: Fix pipe clock imbalance PCI: qcom: Add SM8150 SoC support dt-bindings: pci: qcom: Document PCIe bindings for SM8150 SoC x86/PCI: Disable E820 reserved region clipping starting in 2023 x86/PCI: Disable E820 reserved region clipping via quirks x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions PCI: microchip: Fix potential race in interrupt handling PCI/AER: Clear MULTI_ERR_COR/UNCOR_RCV bits PCI: cadence: Clear FLR in device capabilities register PCI: cadence: Allow PTM Responder to be enabled PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") PCI: vmd: Assign VMD IRQ domain before enumeration PCI: Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() PCI: rockchip-dwc: Add legacy interrupt support ... commit 2d1fe8a86bf5e0663866fd0da83c2af1e1b0e362 Author: Chao Yu Date: Fri May 27 12:13:30 2022 +0800 f2fs: fix to tag gcing flag on page during file defragment In order to garantee migrated data be persisted during checkpoint, otherwise out-of-order persistency between data and node may cause data corruption after SPOR. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 054cb2891b9cc21bf08fb6380e638c056748098f Author: Yufen Yu Date: Thu May 26 10:21:06 2022 +0800 f2fs: replace F2FS_I(inode) and sbi by the local variable We have define 'fi' at the begin of the functions, just use it, rather than use F2FS_I(inode) again. Signed-off-by: Yufen Yu Reviewed-by: Chao Yu [Jaegeuk Kim: replace sbi] Signed-off-by: Jaegeuk Kim commit 8a1e75c53c7a514dbd4f3c61ceb6f6d7d11dfd6d Merge: 440517772bec2 cd414d5ac1fde Author: Arnd Bergmann Date: Fri May 27 22:21:08 2022 +0200 Merge tag 'v5.19-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/late Clock properties for cru nodes to match the yaml-converted bindings and renaming of Quartz-A bluetooth pin nodename to not conflict with Yaml constraints. * tag 'v5.19-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: rename Quartz64-A bluetooth gpios arm64: dts: rockchip: add clocks property to cru node rk3368 arm64: dts: rockchip: add clocks property to cru node rk3308 arm64: dts: rockchip: add clocks to rk356x cru Link: https://lore.kernel.org/r/7695907.Sb9uPGUboI@phil Signed-off-by: Arnd Bergmann commit 440517772bec24f618ec98bc608024ad1b37e80f Merge: 4a4e81ddb8b0e 840fc447d78e3 Author: Arnd Bergmann Date: Fri May 27 22:20:31 2022 +0200 Merge tag 'v5.19-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/late Amba and clock fixes to conform better to actual dt-bindings. * tag 'v5.19-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: add clocks property to cru node rk3228 ARM: dts: rockchip: add clocks property to cru node rk3036 ARM: dts: rockchip: add clocks property to cru node rk3066a/rk3188 ARM: dts: rockchip: add clocks property to cru node rk3288 ARM: dts: rockchip: Remove "amba" bus nodes from rv1108 ARM: dts: rockchip: add clocks property to cru node rv1108 Link: https://lore.kernel.org/r/4798587.jE0xQCEvom@phil Signed-off-by: Arnd Bergmann commit 4a4e81ddb8b0eb412bcfb90c24ba0d5d0d913483 Merge: 6fe1953e008d0 9b59588d8be91 Author: Arnd Bergmann Date: Fri May 27 22:19:46 2022 +0200 Merge tag 'v5.19-rockchip-drivers2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/late Refcount leak for a used of-node in the grf-init. * tag 'v5.19-rockchip-drivers2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc: rockchip: Fix refcount leak in rockchip_grf_init Link: https://lore.kernel.org/r/4541398.Icojqenx9y@phil Signed-off-by: Arnd Bergmann commit 8291eaafed36f575f23951f3ce18407f480e9ecf Merge: 77fb622de1393 fa020a2b87d24 Author: Linus Torvalds Date: Fri May 27 11:40:49 2022 -0700 Merge tag 'mm-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull more MM updates from Andrew Morton: - Two follow-on fixes for the post-5.19 series "Use pageblock_order for cma and alloc_contig_range alignment", from Zi Yan. - A series of z3fold cleanups and fixes from Miaohe Lin. - Some memcg selftests work from Michal Koutný - Some swap fixes and cleanups from Miaohe Lin - Several individual minor fixups * tag 'mm-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (25 commits) mm/shmem.c: suppress shift warning mm: Kconfig: reorganize misplaced mm options mm: kasan: fix input of vmalloc_to_page() mm: fix is_pinnable_page against a cma page mm: filter out swapin error entry in shmem mapping mm/shmem: fix infinite loop when swap in shmem error at swapoff time mm/madvise: free hwpoison and swapin error entry in madvise_free_pte_range mm/swapfile: fix lost swap bits in unuse_pte() mm/swapfile: unuse_pte can map random data if swap read fails selftests: memcg: factor out common parts of memory.{low,min} tests selftests: memcg: remove protection from top level memcg selftests: memcg: adjust expected reclaim values of protected cgroups selftests: memcg: expect no low events in unprotected sibling selftests: memcg: fix compilation mm/z3fold: fix z3fold_page_migrate races with z3fold_map mm/z3fold: fix z3fold_reclaim_page races with z3fold_free mm/z3fold: always clear PAGE_CLAIMED under z3fold page lock mm/z3fold: put z3fold page back into unbuddied list when reclaim or migration fails revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc" mm/z3fold: throw warning on failure of trylock_page in z3fold_alloc ... commit 77fb622de1393b1d54f24f4f7ed98f84feeda502 Merge: 6f664045c8688 24c8e27e63224 Author: Linus Torvalds Date: Fri May 27 11:29:35 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull hotfixes from Andrew Morton: "Six hotfixes. The page_table_check one from Miaohe Lin is considered a minor thing so it isn't marked for -stable. The remainder address pre-5.19 issues and are cc:stable" * tag 'mm-hotfixes-stable-2022-05-27' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/page_table_check: fix accessing unmapped ptep kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] mm/page_alloc: always attempt to allocate at least one page during bulk allocation hugetlb: fix huge_pmd_unshare address update zsmalloc: fix races between asynchronous zspage free and page migration Revert "mm/cma.c: remove redundant cma_mutex lock" commit 6f664045c8688c40ad0591abd6ab89db9ecd7945 Merge: 8bdc2a190105e 3159d79b56c15 Author: Linus Torvalds Date: Fri May 27 11:22:03 2022 -0700 Merge tag 'mm-nonmm-stable-2022-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc updates from Andrew Morton: "The non-MM patch queue for this merge window. Not a lot of material this cycle. Many singleton patches against various subsystems. Most notably some maintenance work in ocfs2 and initramfs" * tag 'mm-nonmm-stable-2022-05-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (65 commits) kcov: update pos before writing pc in trace function ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock ocfs2: dlmfs: don't clear USER_LOCK_ATTACHED when destroying lock fs/ntfs: remove redundant variable idx fat: remove time truncations in vfat_create/vfat_mkdir fat: report creation time in statx fat: ignore ctime updates, and keep ctime identical to mtime in memory fat: split fat_truncate_time() into separate functions MAINTAINERS: add Muchun as a memcg reviewer proc/sysctl: make protected_* world readable ia64: mca: drop redundant spinlock initialization tty: fix deadlock caused by calling printk() under tty_port->lock relay: remove redundant assignment to pointer buf fs/ntfs3: validate BOOT sectors_per_clusters lib/string_helpers: fix not adding strarray to device's resource list kernel/crash_core.c: remove redundant check of ck_cmdline ELF, uapi: fixup ELF_ST_TYPE definition ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() ipc: update semtimedop() to use hrtimer ipc/sem: remove redundant assignments ... commit 8bdc2a190105e862dfe7a4033f2fd385b7e58ae8 Author: Jason A. Donenfeld Date: Thu May 26 11:35:47 2022 +0200 crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE When CRYPTO_LIB_POLY1305 is unset, CRYPTO_LIB_POLY1305_RSIZE is still set in the Kconfig, cluttering things. Fix this by making CRYPTO_LIB_POLY1305_RSIZE depend on CRYPTO_LIB_POLY1305. Suggested-by: Linus Torvalds Signed-off-by: Jason A. Donenfeld Signed-off-by: Linus Torvalds commit e68b823ab0ba03323805e54743d16200ba0224d4 Author: Baolin Wang Date: Fri May 27 12:51:38 2022 +0800 arm64/hugetlb: Fix building errors in huge_ptep_clear_flush() Fix the arm64 build error which was caused by commit ae07562909f3 ("mm: change huge_ptep_clear_flush() to return the original pte") interacting with commit fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"): arch/arm64/mm/hugetlbpage.c: In function ‘huge_ptep_clear_flush’: arch/arm64/mm/hugetlbpage.c:515:9: error: implicit declaration of function ‘get_clear_flush’; did you mean ‘ptep_clear_flush’? [-Werror=implicit-function-declaration] 515 | return get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig); | ^~~~~~~~~~~~~~~ | ptep_clear_flush Due to the new get_clear_contig() has dropped TLB flush, we should add an explicit TLB flush in huge_ptep_clear_flush() to keep original semantics when changing to use new get_clear_contig(). Fixes: fb396bb459c1 ("arm64/hugetlb: Drop TLB flush from get_clear_flush()"). Fixes: ae07562909f3 ("mm: change huge_ptep_clear_flush() to return the original pte") Reported-and-tested-by: Linux Kernel Functional Testing Reported-by: Sudip Mukherjee Suggested-by: Catalin Marinas Signed-off-by: Baolin Wang Reviewed-by: Gavin Shan Reviewed-by: Anshuman Khandual Cc: Catalin Marinas Cc: Anshuman Khandual Cc: Andrew Morton Signed-off-by: Linus Torvalds commit 189b0ddc245139af81198d1a3637cac74f96e13a Author: David Howells Date: Thu May 26 07:34:52 2022 +0100 pipe: Fix missing lock in pipe_resize_ring() pipe_resize_ring() needs to take the pipe->rd_wait.lock spinlock to prevent post_one_notification() from trying to insert into the ring whilst the ring is being replaced. The occupancy check must be done after the lock is taken, and the lock must be taken after the new ring is allocated. The bug can lead to an oops looking something like: BUG: KASAN: use-after-free in post_one_notification.isra.0+0x62e/0x840 Read of size 4 at addr ffff88801cc72a70 by task poc/27196 ... Call Trace: post_one_notification.isra.0+0x62e/0x840 __post_watch_notification+0x3b7/0x650 key_create_or_update+0xb8b/0xd20 __do_sys_add_key+0x175/0x340 __x64_sys_add_key+0xbe/0x140 do_syscall_64+0x5c/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Reported by Selim Enes Karaduman @Enesdex working with Trend Micro Zero Day Initiative. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-17291 Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit cd414d5ac1fdeecf0617737e688a1af00858253a Author: Peter Geis Date: Wed May 11 11:01:14 2022 -0400 arm64: dts: rockchip: rename Quartz64-A bluetooth gpios The bluetooth binding for the Quartz64 Model A has incorrectly named host-wakeup and device-wakeup gpios. Rename them to clear some dtbs_check warnings. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220511150117.113070-4-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 3d65818cd6cf2edc8fc742f982731c54be14e5b8 Author: Johan Jonker Date: Tue Mar 29 20:05:50 2022 +0200 arm64: dts: rockchip: add clocks property to cru node rk3368 Add clocks and clock-names because the device has to have at least one input clock. Also in case someone wants to add properties that start with assign-xxx to fix warnings like: 'clocks' is a dependency of 'assigned-clocks' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329180550.31043-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 2d363912168fe4b2786de7a6ced12b53bc7f4a00 Author: Johan Jonker Date: Tue Mar 29 20:43:39 2022 +0200 arm64: dts: rockchip: add clocks property to cru node rk3308 Add clocks and clock-names to the rk3308 cru node, because the device has to have at least one input clock. Also in case someone wants to add properties that start with assign-xxx to fix warnings like: 'clocks' is a dependency of 'assigned-clocks' With the addition of new properties also sort the node properties a little bit. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329184339.1134-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit cd2d081d18de396cb45636c215dc589a330b3f4e Author: Peter Geis Date: Wed May 11 11:01:13 2022 -0400 arm64: dts: rockchip: add clocks to rk356x cru The rk356x cru requires a 24m clock input to function. Add the clocks properties to the cru to clear some dtbs_check warnings. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220511150117.113070-3-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 840fc447d78e3d4e4048c307ec8f6649d2abb9e7 Author: Johan Jonker Date: Wed Mar 30 14:19:22 2022 +0200 ARM: dts: rockchip: add clocks property to cru node rk3228 Add clocks and clock-names to the rk3228 cru node, because the device has to have at least one input clock. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220330121923.24240-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 8dd85bffc577c90bd29428215494fa68413ffa1f Author: Johan Jonker Date: Wed Mar 30 13:48:46 2022 +0200 ARM: dts: rockchip: add clocks property to cru node rk3036 Add clocks and clock-names to the rk3036 cru node, because the device has to have at least one input clock. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220330114847.18633-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 25f417b56384a3a3f65b7c7439a9797966b926e9 Author: Johan Jonker Date: Tue Mar 29 13:13:23 2022 +0200 ARM: dts: rockchip: add clocks property to cru node rk3066a/rk3188 Add clocks property to rk3066a/rk3188 cru node to fix warnings like: 'clocks' is a dependency of 'assigned-clocks' Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329111323.3569-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 9d66847be3f8290e3142184af0b1806aae6269e2 Author: Johan Jonker Date: Tue Mar 29 13:36:57 2022 +0200 ARM: dts: rockchip: add clocks property to cru node rk3288 Add clocks property to rk3288 cru node to fix warnings like: 'clocks' is a dependency of 'assigned-clocks'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329113657.4567-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit e8cead54a6c73415d99f9feea3c38f892df786b8 Author: Johan Jonker Date: Wed Mar 30 15:16:08 2022 +0200 ARM: dts: rockchip: Remove "amba" bus nodes from rv1108 The "amba" bus nodes wrapping all the DMA-330 nodes serve no useful purpose, and certainly bear no relation at all to the actual underlying interconnect topology. They appear to be cargo-cult copying from a design misstep in the very early days of FDT adoption on ARM, which was righted with the "arm,primecell" compatible, and the last trace of the idea finally purged by commit 2ef7d5f342c1 ("ARM, ARM64: dts: drop "arm,amba-bus" in favor of "simple-bus""). As such, they can simply be removed and the DMA-330 nodes fitted into the normal sort order. The node names should be generic, so rename it to "dma-controller". Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220330131608.30040-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit f7230dcfb44e80fadfa67efe94071cb2542433b6 Author: Johan Jonker Date: Wed Mar 30 15:16:07 2022 +0200 ARM: dts: rockchip: add clocks property to cru node rv1108 Add clocks and clock-names to the rv1108 cru node, because the device has to have at least one input clock. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220330131608.30040-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 44a48081fc03187d3c047077f3ad3eb3a3eaf8fb Author: Steve French Date: Wed May 25 23:56:07 2022 -0500 smb3: remove unneeded null check in cifs_readdir Coverity pointed out an unneeded check. Addresses-Coverity: 1518030 ("Null pointer dereferences") Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit fa020a2b87d24016723fff4a4237deb612478a32 Author: Andrew Morton Date: Wed May 25 15:17:09 2022 -0700 mm/shmem.c: suppress shift warning mm/shmem.c:1948 shmem_getpage_gfp() warn: should '(((1) << 12) / 512) << folio_order(folio)' be a 64 bit type? On i386, so an unsigned long is 32-bit, but i_blocks is a 64-bit blkcnt_t. Reported-by: kernel test robot Reported-by: Jessica Clarke Signed-off-by: Andrew Morton commit 0710d0122abc93adcb9a70a78f1625c491f6ad91 Author: Vlastimil Babka Date: Wed May 25 13:25:59 2022 +0200 mm: Kconfig: reorganize misplaced mm options After commits 7b42f1041c98 ("mm: Kconfig: move swap and slab config options to the MM section") and 519bcb797907 ("mm: Kconfig: group swap, slab, hotplug and thp options into submenus") we now have nicely organized mm related config options. I have noticed some that were still misplaced, so this moves them from various places into the new structure: VM_EVENT_COUNTERS, COMPAT_BRK, MMAP_ALLOW_UNINITIALIZED to mm/Kconfig and general MM section. SLUB_STATS to mm/Kconfig and the slab submenu. DEBUG_SLAB, SLUB_DEBUG, SLUB_DEBUG_ON to mm/Kconfig.debug and the Kernel hacking / Memory Debugging submenu. Link: https://lkml.kernel.org/r/20220525112559.1139-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Signed-off-by: Andrew Morton commit fbf4df0699926cf620b2f722ddc213826e248962 Author: Kefeng Wang Date: Wed May 25 20:08:04 2022 +0800 mm: kasan: fix input of vmalloc_to_page() When print virtual mapping info for vmalloc address, it should pass the addr not page, fix it. Link: https://lkml.kernel.org/r/20220525120804.38155-1-wangkefeng.wang@huawei.com Fixes: c056a364e954 ("kasan: print virtual mapping info in reports") Signed-off-by: Kefeng Wang Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Vincenzo Frascino Signed-off-by: Andrew Morton commit 1c563432588dbffa71e67ca6e37c826f9fa86e04 Author: Minchan Kim Date: Tue May 24 10:15:25 2022 -0700 mm: fix is_pinnable_page against a cma page Pages in the CMA area could have MIGRATE_ISOLATE as well as MIGRATE_CMA so the current is_pinnable_page() could miss CMA pages which have MIGRATE_ISOLATE. It ends up pinning CMA pages as longterm for the pin_user_pages() API so CMA allocations keep failing until the pin is released. CPU 0 CPU 1 - Task B cma_alloc alloc_contig_range pin_user_pages_fast(FOLL_LONGTERM) change pageblock as MIGRATE_ISOLATE internal_get_user_pages_fast lockless_pages_from_mm gup_pte_range try_grab_folio is_pinnable_page return true; So, pinned the page successfully. page migration failure with pinned page .. .. After 30 sec unpin_user_page(page) CMA allocation succeeded after 30 sec. The CMA allocation path protects the migration type change race using zone->lock but what GUP path need to know is just whether the page is on CMA area or not rather than exact migration type. Thus, we don't need zone->lock but just checks migration type in either of (MIGRATE_ISOLATE and MIGRATE_CMA). Adding the MIGRATE_ISOLATE check in is_pinnable_page could cause rejecting of pinning pages on MIGRATE_ISOLATE pageblocks even though it's neither CMA nor movable zone if the page is temporarily unmovable. However, such a migration failure by unexpected temporal refcount holding is general issue, not only come from MIGRATE_ISOLATE and the MIGRATE_ISOLATE is also transient state like other temporal elevated refcount problem. Link: https://lkml.kernel.org/r/20220524171525.976723-1-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: John Hubbard Acked-by: Paul E. McKenney Cc: David Hildenbrand Signed-off-by: Andrew Morton commit ba6851b45d2d5b07436d8fc43451bad354dc4884 Author: Miaohe Lin Date: Thu May 19 20:50:30 2022 +0800 mm: filter out swapin error entry in shmem mapping There might be swapin error entries in shmem mapping. Filter them out to avoid "Bad swap file entry" complaint. Link: https://lkml.kernel.org/r/20220519125030.21486-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Naoya Horiguchi Cc: Alistair Popple Cc: David Hildenbrand Cc: David Howells Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: NeilBrown Cc: Peter Xu Cc: Ralph Campbell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6cec2b95dadf77cdc1256fae1c5dfd4a2b467e61 Author: Miaohe Lin Date: Thu May 19 20:50:29 2022 +0800 mm/shmem: fix infinite loop when swap in shmem error at swapoff time When swap in shmem error at swapoff time, there would be a infinite loop in the while loop in shmem_unuse_inode(). It's because swapin error is deliberately ignored now and thus info->swapped will never reach 0. So we can't escape the loop in shmem_unuse(). In order to fix the issue, swapin_error entry is stored in the mapping when swapin error occurs. So the swapcache page can be freed and the user won't end up with a permanently mounted swap because a sector is bad. If the page is accessed later, the user process will be killed so that corrupted data is never consumed. On the other hand, if the page is never accessed, the user won't even notice it. Link: https://lkml.kernel.org/r/20220519125030.21486-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reported-by: Naoya Horiguchi Reviewed-by: Naoya Horiguchi Cc: Alistair Popple Cc: David Hildenbrand Cc: David Howells Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: NeilBrown Cc: Peter Xu Cc: Ralph Campbell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 7b49514fa1dbe05813f099179ebe3d982f45e87e Author: Miaohe Lin Date: Thu May 19 20:50:28 2022 +0800 mm/madvise: free hwpoison and swapin error entry in madvise_free_pte_range Once the MADV_FREE operation has succeeded, callers can expect they might get zero-fill pages if accessing the memory again. Therefore it should be safe to delete the hwpoison entry and swapin error entry. There is no reason to kill the process if it has called MADV_FREE on the range. Link: https://lkml.kernel.org/r/20220519125030.21486-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Suggested-by: Alistair Popple Acked-by: David Hildenbrand Reviewed-by: Naoya Horiguchi Cc: David Howells Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: NeilBrown Cc: Peter Xu Cc: Ralph Campbell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 14a762dd1977cf811516fd97b0262b747cac88f7 Author: Miaohe Lin Date: Thu May 19 20:50:27 2022 +0800 mm/swapfile: fix lost swap bits in unuse_pte() This is observed by code review only but not any real report. When we turn off swapping we could have lost the bits stored in the swap ptes. The new rmap-exclusive bit is fine since that turned into a page flag, but not for soft-dirty and uffd-wp. Add them. Link: https://lkml.kernel.org/r/20220519125030.21486-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Suggested-by: Peter Xu Reviewed-by: David Hildenbrand Cc: Alistair Popple Cc: David Howells Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Naoya Horiguchi Cc: NeilBrown Cc: Ralph Campbell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 9f186f9e5fa9ebdaef909fd45f825a6ce281f13c Author: Miaohe Lin Date: Thu May 19 20:50:26 2022 +0800 mm/swapfile: unuse_pte can map random data if swap read fails Patch series "A few fixup patches for mm", v4. This series contains a few patches to avoid mapping random data if swap read fails and fix lost swap bits in unuse_pte. Also we free hwpoison and swapin error entry in madvise_free_pte_range and so on. More details can be found in the respective changelogs. This patch (of 5): There is a bug in unuse_pte(): when swap page happens to be unreadable, page filled with random data is mapped into user address space. In case of error, a special swap entry indicating swap read fails is set to the page table. So the swapcache page can be freed and the user won't end up with a permanently mounted swap because a sector is bad. And if the page is accessed later, the user process will be killed so that corrupted data is never consumed. On the other hand, if the page is never accessed, the user won't even notice it. Link: https://lkml.kernel.org/r/20220519125030.21486-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220519125030.21486-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Vlastimil Babka Cc: David Howells Cc: NeilBrown Cc: Alistair Popple Cc: Suren Baghdasaryan Cc: Peter Xu Cc: Ralph Campbell Cc: Naoya Horiguchi Signed-off-by: Andrew Morton commit f079a020ba95b568329806aa13c62e6103cade3c Author: Michal Koutný Date: Wed May 18 18:18:59 2022 +0200 selftests: memcg: factor out common parts of memory.{low,min} tests The memory protection test setup and runtime is almost equal for memory.low and memory.min cases. It makes modification of the common parts prone to mistakes, since the protections are similar not only in setup but also in principle, factor the common part out. Past exceptions between the tests: - missing memory.min is fine (kept), - test_memcg_low protected orphaned pagecache (adapted like test_memcg_min and we keep the processes of protected memory running). The evaluation in two tests is different (OOM of allocator vs low events of protégés), this is kept different. Link: https://lkml.kernel.org/r/20220518161859.21565-6-mkoutny@suse.com Signed-off-by: Michal Koutný Acked-by: Roman Gushchin CC: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Richard Palethorpe Cc: David Vernet Signed-off-by: Andrew Morton commit 6a35919005d4146aee14339a6cd52286465e5023 Author: Michal Koutný Date: Wed May 18 18:18:58 2022 +0200 selftests: memcg: remove protection from top level memcg The reclaim is triggered by memory limit in a subtree, therefore the testcase does not need configured protection against external reclaim. Also, correct respective comments. Link: https://lkml.kernel.org/r/20220518161859.21565-5-mkoutny@suse.com Signed-off-by: Michal Koutný Acked-by: Roman Gushchin Cc: David Vernet Cc: Johannes Weiner Cc: Michal Hocko Cc: Richard Palethorpe Cc: Shakeel Butt Signed-off-by: Andrew Morton commit f10b6e9a8e6621f6db2acfbf722a6331f3afaa84 Author: Michal Koutný Date: Wed May 18 18:18:57 2022 +0200 selftests: memcg: adjust expected reclaim values of protected cgroups The numbers are not easy to derive in a closed form (certainly mere protections ratios do not apply), therefore use a simulation to obtain expected numbers. Link: https://lkml.kernel.org/r/20220518161859.21565-4-mkoutny@suse.com Signed-off-by: Michal Koutný Acked-by: Roman Gushchin Cc: David Vernet Cc: Johannes Weiner Cc: Michal Hocko Cc: Richard Palethorpe Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 1d09069f5313f7c35655dc6d405896f748ddc53f Author: Michal Koutný Date: Wed May 18 18:18:56 2022 +0200 selftests: memcg: expect no low events in unprotected sibling This is effectively a revert of commit cdc69458a5f3 ("cgroup: account for memory_recursiveprot in test_memcg_low()"). The case test_memcg_low will fail with memory_recursiveprot until resolved in reclaim code. However, this patch preserves the existing helpers and variables for later uses. Link: https://lkml.kernel.org/r/20220518161859.21565-3-mkoutny@suse.com Signed-off-by: Michal Koutný Reviewed-by: David Vernet Cc: Johannes Weiner Cc: Michal Hocko Cc: Richard Palethorpe Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit ff3b72a5d614702ec119f107bddd99cdad622b44 Author: Michal Koutný Date: Wed May 18 18:18:55 2022 +0200 selftests: memcg: fix compilation Patch series "memcontrol selftests fixups", v2. Flushing the patches to make memcontrol selftests check the events behavior we had consensus about (test_memcg_low fails). (test_memcg_reclaim, test_memcg_swap_max fail for me now but it's present even before the refactoring.) The two bigger changes are: - adjustment of the protected values to make tests succeed with the given tolerance, - both test_memcg_low and test_memcg_min check protection of memory in populated cgroups (actually as per Documentation/admin-guide/cgroup-v2.rst memory.min should not apply to empty cgroups, which is not the case currently. Therefore I unified tests with the populated case in order to to bring more broken tests). This patch (of 5): This fixes mis-applied changes from commit 72b1e03aa725 ("cgroup: account for memory_localevents in test_memcg_oom_group_leaf_events()"). Link: https://lkml.kernel.org/r/20220518161859.21565-1-mkoutny@suse.com Link: https://lkml.kernel.org/r/20220518161859.21565-2-mkoutny@suse.com Signed-off-by: Michal Koutný Reviewed-by: David Vernet Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Richard Palethorpe Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 943fb61dd66f475c25b1ef5dddb647070f2e89a1 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: fix z3fold_page_migrate races with z3fold_map Think about the below scenario: CPU1 CPU2 z3fold_page_migrate z3fold_map z3fold_page_trylock ... z3fold_page_unlock /* slots still points to old zhdr*/ get_z3fold_header get slots from handle get old zhdr from slots z3fold_page_trylock return *old* zhdr encode_handle(new_zhdr, FIRST|LAST|MIDDLE) put_page(page) /* zhdr is freed! */ but zhdr is still used by caller! z3fold_map can map freed z3fold page and lead to use-after-free bug. To fix it, we add PAGE_MIGRATED to indicate z3fold page is migrated and soon to be released. So get_z3fold_header won't return such page. Link: https://lkml.kernel.org/r/20220429064051.61552-10-linmiaohe@huawei.com Fixes: 1f862989b04a ("mm/z3fold.c: support page migration") Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 04094226d6ce8c0cb590891e13872109aa6722f1 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: fix z3fold_reclaim_page races with z3fold_free Think about the below scenario: CPU1 CPU2 z3fold_reclaim_page z3fold_free spin_lock(&pool->lock) get_z3fold_header -- hold page_lock kref_get_unless_zero kref_put--zhdr->refcount can be 1 now !z3fold_page_trylock kref_put -- zhdr->refcount is 0 now release_z3fold_page WARN_ON(!list_empty(&zhdr->buddy)); -- we're on buddy now! spin_lock(&pool->lock); -- deadlock here! z3fold_reclaim_page might race with z3fold_free and will lead to pool lock deadlock and zhdr buddy non-empty warning. To fix this, defer getting the refcount until page_lock is held just like what __z3fold_alloc does. Note this has the side effect that we won't break the reclaim if we meet a soon to be released z3fold page now. Link: https://lkml.kernel.org/r/20220429064051.61552-9-linmiaohe@huawei.com Fixes: dcf5aedb24f8 ("z3fold: stricter locking and more careful reclaim") Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 4a1c3839108afcfec02f4d62d6862b2451b442ab Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: always clear PAGE_CLAIMED under z3fold page lock Think about the below race window: CPU1 CPU2 z3fold_reclaim_page z3fold_free test_and_set_bit PAGE_CLAIMED failed to reclaim page z3fold_page_lock(zhdr); add back to the lru list; z3fold_page_unlock(zhdr); get_z3fold_header page_claimed=test_and_set_bit PAGE_CLAIMED clear_bit(PAGE_CLAIMED, &page->private); if (!page_claimed) /* it's false true */ free_handle is not called free_handle won't be called in this case. So z3fold_buddy_slots will leak. Fix it by always clear PAGE_CLAIMED under z3fold page lock. Link: https://lkml.kernel.org/r/20220429064051.61552-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 6cf9a34967ed544ca4c0949e9928dc78fca57ef3 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: put z3fold page back into unbuddied list when reclaim or migration fails When doing z3fold page reclaim or migration, the page is removed from unbuddied list. If reclaim or migration succeeds, it's fine as page is released. But in case it fails, the page is not put back into unbuddied list now. The page will be leaked until next compaction work, reclaim or migration is done. Link: https://lkml.kernel.org/r/20220429064051.61552-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit f4bad643c1d602f7154cf0d8eeb509136a55dccb Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 revert "mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc" Revert commit f1549cb5ab2b ("mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc"). z3fold can't support GFP_HIGHMEM page now. page_address is used directly at all places. Moreover, z3fold_header is on per cpu unbuddied list which could be accessed anytime. So we should remove the support of GFP_HIGHMEM allocation for z3fold. Link: https://lkml.kernel.org/r/20220429064051.61552-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 2c0f351434785626beb5cb49962b4e873459fd38 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: throw warning on failure of trylock_page in z3fold_alloc If trylock_page fails, the page won't be non-lru movable page. When this page is freed via free_z3fold_page, it will trigger bug on PageMovable check in __ClearPageMovable. Throw warning on failure of trylock_page to guard against such rare case just as what zsmalloc does. Link: https://lkml.kernel.org/r/20220429064051.61552-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Vitaly Wool Signed-off-by: Andrew Morton commit df6f0f1d0cf091947bb621cfdada4c82c1f05c4b Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: remove buggy use of stale list for allocation Currently if z3fold couldn't find an unbuddied page it would first try to pull a page off the stale list. But this approach is problematic. If init z3fold page fails later, the page should be freed via free_z3fold_page to clean up the relevant resource instead of using __free_page directly. And if page is successfully reused, it will BUG_ON later in __SetPageMovable because it's already non-lru movable page, i.e. PAGE_MAPPING_MOVABLE is already set in page->mapping. In order to fix all of these issues, we can simply remove the buggy use of stale list for allocation because can_sleep should always be false and we never really hit the reusing code path now. Link: https://lkml.kernel.org/r/20220429064051.61552-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 7c61c35bbd6a888416e5a6de8ff8782a70d013d4 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: fix possible null pointer dereferencing alloc_slots could fail to allocate memory under heavy memory pressure. So we should check zhdr->slots against NULL to avoid future null pointer dereferencing. Link: https://lkml.kernel.org/r/20220429064051.61552-3-linmiaohe@huawei.com Fixes: fc5488651c7d ("z3fold: simplify freeing slots") Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 4c6bdb36408fbe4697eb9f1d95a3ddc1d2348448 Author: Miaohe Lin Date: Fri Apr 29 14:40:43 2022 +0800 mm/z3fold: fix sheduling while atomic Patch series "A few fixup patches for z3fold". This series contains a few fixup patches to fix sheduling while atomic, fix possible null pointer dereferencing, fix various race conditions and so on. More details can be found in the respective changelogs. This patch (of 9): z3fold's page_lock is always held when calling alloc_slots. So gfp should be GFP_ATOMIC to avoid "scheduling while atomic" bug. Link: https://lkml.kernel.org/r/20220429064051.61552-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220429064051.61552-2-linmiaohe@huawei.com Fixes: fc5488651c7d ("z3fold: simplify freeing slots") Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 86d28b0709279ccc636ef9ba267b7f3bcef79a4b Author: Zi Yan Date: Thu May 26 19:15:31 2022 -0400 mm: split free page with properly free memory accounting and without race In isolate_single_pageblock(), free pages are checked without holding zone lock, but they can go away in split_free_page() when zone lock is held. Check the free page and its order again in split_free_page() when zone lock is held. Recheck the page if the free page is gone under zone lock. In addition, in split_free_page(), the free page was deleted from the page list without changing free page accounting. Add the missing free page accounting code. Fix the type of order parameter in split_free_page(). Link: https://lore.kernel.org/lkml/20220525103621.987185e2ca0079f7b97b856d@linux-foundation.org/ Link: https://lkml.kernel.org/r/20220526231531.2404977-2-zi.yan@sent.com Fixes: b2c9e2fbba32 ("mm: make alloc_contig_range work at pageblock granularity") Signed-off-by: Zi Yan Reported-by: Doug Berger Link: https://lore.kernel.org/linux-mm/c3932a6f-77fe-29f7-0c29-fe6b1c67ab7b@gmail.com/ Cc: David Hildenbrand Cc: Qian Cai Cc: Vlastimil Babka Cc: Mel Gorman Cc: Eric Ren Cc: Mike Rapoport Cc: Oscar Salvador Cc: Christophe Leroy Cc: Marek Szyprowski Cc: Michael Walle Signed-off-by: Andrew Morton commit 9b209e557d698f24317d2619d8628b98b6728e4f Author: Zi Yan Date: Thu May 26 19:15:30 2022 -0400 mm: page-isolation: skip isolated pageblock in start_isolate_page_range() start_isolate_page_range() first isolates the first and the last pageblocks in the range and ensure pages across range boundaries are split during isolation. But it missed the case when the range is <= a pageblock and the first and the last pageblocks are the same one, so the second isolate_single_pageblock() will always fail. To fix it, skip the pageblock isolation in second isolate_single_pageblock(). Link: https://lkml.kernel.org/r/20220526231531.2404977-1-zi.yan@sent.com Fixes: 88ee134320b8 ("mm: fix a potential infinite loop in start_isolate_page_range()") Signed-off-by: Zi Yan Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Link: https://lore.kernel.org/linux-mm/ac65adc0-a7e4-cdfe-a0d8-757195b86293@samsung.com/ Reported-by: Michael Walle Tested-by: Michael Walle Link: https://lore.kernel.org/linux-mm/8ca048ca8b547e0dd1c95387ee05c23d@walle.cc/ Cc: Christophe Leroy Cc: David Hildenbrand Cc: Doug Berger Cc: Eric Ren Cc: Mel Gorman Cc: Mike Rapoport Cc: Oscar Salvador Cc: Qian Cai Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 9dde6cadb92b5670b23b97ec53091df0530ec38b Author: Arnaldo Carvalho de Melo Date: Fri Aug 7 08:45:47 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: db1af12929c99d15 ("x86/msr-index: Define INTEGRITY_CAPABILITIES MSR") 089be16d5992dd0b ("x86/msr: Add PerfCntrGlobal* registers") f52ba93190457aa2 ("tools/power turbostat: Add Power Limit4 support") Addressing these tools/perf build warnings: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' That makes the beautification scripts to pick some new entries: $ 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 --- before 2022-05-26 12:50:01.228612839 -0300 +++ after 2022-05-26 12:50:07.699776166 -0300 @@ -116,6 +116,7 @@ [0x0000026f] = "MTRRfix4K_F8000", [0x00000277] = "IA32_CR_PAT", [0x00000280] = "IA32_MC0_CTL2", + [0x000002d9] = "INTEGRITY_CAPS", [0x000002ff] = "MTRRdefType", [0x00000309] = "CORE_PERF_FIXED_CTR0", [0x0000030a] = "CORE_PERF_FIXED_CTR1", @@ -176,6 +177,7 @@ [0x00000586] = "IA32_RTIT_ADDR3_A", [0x00000587] = "IA32_RTIT_ADDR3_B", [0x00000600] = "IA32_DS_AREA", + [0x00000601] = "VR_CURRENT_CONFIG", [0x00000606] = "RAPL_POWER_UNIT", [0x0000060a] = "PKGC3_IRTL", [0x0000060b] = "PKGC6_IRTL", @@ -260,6 +262,10 @@ [0xc0000102 - x86_64_specific_MSRs_offset] = "KERNEL_GS_BASE", [0xc0000103 - x86_64_specific_MSRs_offset] = "TSC_AUX", [0xc0000104 - x86_64_specific_MSRs_offset] = "AMD64_TSC_RATIO", + [0xc000010f - x86_64_specific_MSRs_offset] = "AMD_DBG_EXTN_CFG", + [0xc0000300 - x86_64_specific_MSRs_offset] = "AMD64_PERF_CNTR_GLOBAL_STATUS", + [0xc0000301 - x86_64_specific_MSRs_offset] = "AMD64_PERF_CNTR_GLOBAL_CTL", + [0xc0000302 - x86_64_specific_MSRs_offset] = "AMD64_PERF_CNTR_GLOBAL_STATUS_CLR", }; #define x86_AMD_V_KVM_MSRs_offset 0xc0010000 @@ -318,4 +324,5 @@ [0xc00102b4 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_STATUS", [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL", [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN", + [0xc0010300 - x86_AMD_V_KVM_MSRs_offset] = "AMD_SAMP_BR_FROM", }; $ Now one can trace systemwide asking to see backtraces to where those MSRs are being read/written, see this example with a previous update: # perf trace -e msr:*_msr/max-stack=32/ --filter="msr>=IA32_U_CET && msr<=IA32_INT_SSP_TAB" ^C# If we use -v (verbose mode) we can see what it does behind the scenes: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr>=IA32_U_CET && msr<=IA32_INT_SSP_TAB" Using CPUID AuthenticAMD-25-21-0 0x6a0 0x6a8 New filter for msr:read_msr: (msr>=0x6a0 && msr<=0x6a8) && (common_pid != 597499 && common_pid != 3313) 0x6a0 0x6a8 New filter for msr:write_msr: (msr>=0x6a0 && msr<=0x6a8) && (common_pid != 597499 && common_pid != 3313) mmap size 528384B ^C# Example with a frequent msr: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2 Using CPUID AuthenticAMD-25-21-0 0x48 New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) 0x48 New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) mmap size 528384B Looking at the vmlinux_path (8 entries long) symsrc__init: build id mismatch for vmlinux. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols 0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule ([kernel.kallsyms]) futex_wait_queue_me ([kernel.kallsyms]) futex_wait ([kernel.kallsyms]) do_futex ([kernel.kallsyms]) __x64_sys_futex ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64_after_hwframe ([kernel.kallsyms]) __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so) 0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule_idle ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) secondary_startup_64_no_verify ([kernel.kallsyms]) # Cc: Adrian Hunter Cc: Hans de Goede Cc: Ian Rogers Cc: Jiri Olsa Cc: Len Brown Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Sumeet Pawnikar Cc: Tony Luck Link: https://lore.kernel.org/lkml/Yo+i%252Fj5+UtE9dcix@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 12fdd6c009da0d029ae54cff67242be02ea42a7a Author: Leo Yan Date: Sat May 21 21:04:46 2022 +0800 perf scripts python: Support Arm CoreSight trace data disassembly This commit adds python script to parse CoreSight tracing event and print out source line and disassembly, it generates readable program execution flow for easier humans inspecting. The script receives CoreSight tracing packet with below format: +------------+------------+------------+ packet(n): | addr | ip | cpu | +------------+------------+------------+ packet(n+1): | addr | ip | cpu | +------------+------------+------------+ packet::addr presents the start address of the coming branch sample, and packet::ip is the last address of the branch smple. Therefore, a code section between branches starts from packet(n)::addr and it stops at packet(n+1)::ip. As results we combines the two continuous packets to generate the address range for instructions: [ sample(n)::addr .. sample(n+1)::ip ] The script supports both objdump or llvm-objdump for disassembly with specifying option '-d'. If doesn't specify option '-d', the script simply outputs source lines and symbols. Below shows usages with llvm-objdump or objdump to output disassembly. # perf script -s scripts/python/arm-cs-trace-disasm.py -- -d llvm-objdump-11 -k ./vmlinux ARM CoreSight Trace Data Assembler Dump ffff800008eb3198 : ffff800008eb3310: c0 38 00 35 cbnz w0, 0xffff800008eb3a28 ffff800008eb3314: 9f 3f 03 d5 dsb sy ffff800008eb3318: df 3f 03 d5 isb ffff800008eb331c: f5 5b 42 a9 ldp x21, x22, [sp, #32] ffff800008eb3320: fb 73 45 a9 ldp x27, x28, [sp, #80] ffff800008eb3324: e0 82 40 39 ldrb w0, [x23, #32] ffff800008eb3328: 60 00 00 34 cbz w0, 0xffff800008eb3334 ffff800008eb332c: e0 03 19 aa mov x0, x25 ffff800008eb3330: 8c fe ff 97 bl 0xffff800008eb2d60 main 6728/6728 [0004] 0.000000000 etm4_enable_hw+0x198 [kernel.kallsyms] ffff800008eb2d60 : ffff800008eb2d60: 1f 20 03 d5 nop ffff800008eb2d64: 1f 20 03 d5 nop ffff800008eb2d68: 3f 23 03 d5 hint #25 ffff800008eb2d6c: 00 00 40 f9 ldr x0, [x0] ffff800008eb2d70: 9f 3f 03 d5 dsb sy ffff800008eb2d74: 00 c0 3e 91 add x0, x0, #4016 ffff800008eb2d78: 1f 00 00 b9 str wzr, [x0] ffff800008eb2d7c: bf 23 03 d5 hint #29 ffff800008eb2d80: c0 03 5f d6 ret main 6728/6728 [0004] 0.000000000 etm4_cs_lock.isra.0.part.0+0x20 # perf script -s scripts/python/arm-cs-trace-disasm.py -- -d objdump -k ./vmlinux ARM CoreSight Trace Data Assembler Dump ffff800008eb3310 : ffff800008eb3310: 350038c0 cbnz w0, ffff800008eb3a28 ffff800008eb3314: d5033f9f dsb sy ffff800008eb3318: d5033fdf isb ffff800008eb331c: a9425bf5 ldp x21, x22, [sp, #32] ffff800008eb3320: a94573fb ldp x27, x28, [sp, #80] ffff800008eb3324: 394082e0 ldrb w0, [x23, #32] ffff800008eb3328: 34000060 cbz w0, ffff800008eb3334 ffff800008eb332c: aa1903e0 mov x0, x25 ffff800008eb3330: 97fffe8c bl ffff800008eb2d60 main 6728/6728 [0004] 0.000000000 etm4_enable_hw+0x198 [kernel.kallsyms] ffff800008eb2d60 : ffff800008eb2d60: d503201f nop ffff800008eb2d64: d503201f nop ffff800008eb2d68: d503233f paciasp ffff800008eb2d6c: f9400000 ldr x0, [x0] ffff800008eb2d70: d5033f9f dsb sy ffff800008eb2d74: 913ec000 add x0, x0, #0xfb0 ffff800008eb2d78: b900001f str wzr, [x0] ffff800008eb2d7c: d50323bf autiasp ffff800008eb2d80: d65f03c0 ret main 6728/6728 [0004] 0.000000000 etm4_cs_lock.isra.0.part.0+0x20 Signed-off-by: Leo Yan Co-authored-by: Al Grant Co-authored-by: Mathieu Poirier Co-authored-by: Tor Jeremiassen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Eelco Chaudron Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephen Brennan Cc: Tanmay Jagdale Cc: coresight@lists.linaro.org Cc: zengshun . wu Link: https://lore.kernel.org/r/20220521130446.4163597-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit c4f462235c0f61a0eff2ca0f965a3fdceb80347d Author: Leo Yan Date: Sat May 21 21:04:45 2022 +0800 perf scripting python: Expose dso and map information This change adds dso build_id and corresponding map's start and end address. The info of dso build_id can be used to find dso file path, and we can validate if a branch address falls into the range of map's start and end addresses. In addition, the map's start address can be used as an offset for disassembly. Signed-off-by: Leo Yan Acked-by: Adrian Hunter Cc: Al Grant Cc: Alexander Shishkin Cc: Eelco Chaudron Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephen Brennan Cc: Tanmay Jagdale Cc: coresight@lists.linaro.org Cc: zengshun . wu Link: https://lore.kernel.org/r/20220521130446.4163597-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit f4df0dbbe62ee8e4405a57b27ccd54393971c773 Author: Zhengjun Xing Date: Wed May 25 22:04:10 2022 +0800 perf jevents: Fix event syntax error caused by ExtSel In the origin code, when "ExtSel" is 1, the eventcode will change to "eventcode |= 1 << 21”. For event “UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS", its "ExtSel" is "1", its eventcode will change from 0x1E to 0x20001E, but in fact the eventcode should <=0x1FF, so this will cause the parse fail: # perf stat -e "UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS" -a sleep 0.1 event syntax error: '.._RxL_CREDITS_CONSUMED_VN0.DRS' \___ value too big for format, maximum is 511 On the perf kernel side, the kernel assumes the valid bits are continuous. It will adjust the 0x100 (bit 8 for perf tool) to bit 21 in HW. DEFINE_UNCORE_FORMAT_ATTR(event_ext, event, "config:0-7,21"); So the perf tool follows the kernel side and just set bit8 other than bit21. Fixes: fedb2b518239cbc0 ("perf jevents: Add support for parsing uncore json files") Reviewed-by: Kan Liang Signed-off-by: Xing Zhengjun Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220525140410.1706851-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2be00431c576f7fc2299673301134b0d190699a9 Author: James Clark Date: Wed May 25 16:41:14 2022 +0100 perf tools arm64: Add support for VG register Add the name of the VG register so it can be used in --user-regs The event will fail to open if the register is requested but not available so only add it to the mask if the kernel supports sve and also if it supports that specific register. Committer notes: Add conditional definition of HWCAP_SVE, as suggested by Leo Yan, to build on older systems where this is not available in the system headers. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Brown Cc: Mark Rutland Cc: Mathieu Poirier 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/20220525154114.718321-6-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 24c8e27e63224ce832b4723cb60632d3eddb55de Author: Miaohe Lin Date: Thu May 26 19:33:50 2022 +0800 mm/page_table_check: fix accessing unmapped ptep ptep is unmapped too early, so ptep could theoretically be accessed while it's unmapped. This might become a problem if/when CONFIG_HIGHPTE becomes available on riscv. Fix it by deferring pte_unmap() until page table checking is done. [akpm@linux-foundation.org: account for ptep alteration, per Matthew] Link: https://lkml.kernel.org/r/20220526113350.30806-1-linmiaohe@huawei.com Fixes: 80110bbfbba6 ("mm/page_table_check: check entries at pmd levels") Signed-off-by: Miaohe Lin Acked-by: Pasha Tatashin Cc: Qi Zheng Cc: Matthew Wilcox Cc: David Rientjes Signed-off-by: Andrew Morton commit 3e35142ef99fe6b4fe5d834ad43ee13cca10a2dc Author: Naveen N. Rao Date: Thu May 19 14:42:37 2022 +0530 kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] Since commit d1bcae833b32f1 ("ELF: Don't generate unused section symbols") [1], binutils (v2.36+) started dropping section symbols that it thought were unused. This isn't an issue in general, but with kexec_file.c, gcc is placing kexec_arch_apply_relocations[_add] into a separate .text.unlikely section and the section symbol ".text.unlikely" is being dropped. Due to this, recordmcount is unable to find a non-weak symbol in .text.unlikely to generate a relocation record against. Address this by dropping the weak attribute from these functions. Instead, follow the existing pattern of having architectures #define the name of the function they want to override in their headers. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d1bcae833b32f1 [akpm@linux-foundation.org: arch/s390/include/asm/kexec.h needs linux/module.h] Link: https://lkml.kernel.org/r/20220519091237.676736-1-naveen.n.rao@linux.vnet.ibm.com Signed-off-by: Michael Ellerman Signed-off-by: Naveen N. Rao Cc: "Eric W. Biederman" Cc: Signed-off-by: Andrew Morton commit c572e4888ad1be123c1516ec577ad30a700bbec4 Author: Mel Gorman Date: Thu May 26 10:12:10 2022 +0100 mm/page_alloc: always attempt to allocate at least one page during bulk allocation Peter Pavlisko reported the following problem on kernel bugzilla 216007. When I try to extract an uncompressed tar archive (2.6 milion files, 760.3 GiB in size) on newly created (empty) XFS file system, after first low tens of gigabytes extracted the process hangs in iowait indefinitely. One CPU core is 100% occupied with iowait, the other CPU core is idle (on 2-core Intel Celeron G1610T). It was bisected to c9fa563072e1 ("xfs: use alloc_pages_bulk_array() for buffers") but XFS is only the messenger. The problem is that nothing is waking kswapd to reclaim some pages at a time the PCP lists cannot be refilled until some reclaim happens. The bulk allocator checks that there are some pages in the array and the original intent was that a bulk allocator did not necessarily need all the requested pages and it was best to return as quickly as possible. This was fine for the first user of the API but both NFS and XFS require the requested number of pages be available before making progress. Both could be adjusted to call the page allocator directly if a bulk allocation fails but it puts a burden on users of the API. Adjust the semantics to attempt at least one allocation via __alloc_pages() before returning so kswapd is woken if necessary. It was reported via bugzilla that the patch addressed the problem and that the tar extraction completed successfully. This may also address bug 215975 but has yet to be confirmed. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216007 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215975 Link: https://lkml.kernel.org/r/20220526091210.GC3441@techsingularity.net Fixes: 387ba26fb1cb ("mm/page_alloc: add a bulk page allocator") Signed-off-by: Mel Gorman Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Jan Kara Cc: Vlastimil Babka Cc: Jesper Dangaard Brouer Cc: Chuck Lever Cc: [5.13+] Signed-off-by: Andrew Morton commit 48381273f8734d28ef56a5bdf1966dd8530111bc Author: Mike Kravetz Date: Tue May 24 13:50:03 2022 -0700 hugetlb: fix huge_pmd_unshare address update The routine huge_pmd_unshare() is passed a pointer to an address associated with an area which may be unshared. If unshare is successful this address is updated to 'optimize' callers iterating over huge page addresses. For the optimization to work correctly, address should be updated to the last huge page in the unmapped/unshared area. However, in the common case where the passed address is PUD_SIZE aligned, the address is incorrectly updated to the address of the preceding huge page. That wastes CPU cycles as the unmapped/unshared range is scanned twice. Link: https://lkml.kernel.org/r/20220524205003.126184-1-mike.kravetz@oracle.com Fixes: 39dde65c9940 ("shared page table for hugetlb page") Signed-off-by: Mike Kravetz Acked-by: Muchun Song Cc: Signed-off-by: Andrew Morton commit 40f567bbb3b0639d2ec7d1c6ad4b1b018f80cf19 Author: Jia-Ju Bai Date: Fri May 27 23:28:18 2022 +0800 md: bcache: check the return value of kzalloc() in detached_dev_do_request() The function kzalloc() in detached_dev_do_request() can fail, so its return value should be checked. Fixes: bc082a55d25c ("bcache: fix inaccurate io state for detached bcache devices") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220527152818.27545-4-colyli@suse.de Signed-off-by: Jens Axboe commit 7d6b902ea0e02b2a25c480edf471cbaa4ebe6b3c Author: Coly Li Date: Fri May 27 23:28:16 2022 +0800 bcache: memset on stack variables in bch_btree_check() and bch_sectors_dirty_init() The local variables check_state (in bch_btree_check()) and state (in bch_sectors_dirty_init()) should be fully filled by 0, because before allocating them on stack, they were dynamically allocated by kzalloc(). Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20220527152818.27545-2-colyli@suse.de Signed-off-by: Jens Axboe commit 59ed76fe2f981bccde37bdddb465f260a96a2404 Author: Song Liu Date: Thu May 26 12:16:08 2022 -0700 selftests/bpf: fix stacktrace_build_id with missing kprobe/urandom_read Kernel function urandom_read is replaced with urandom_read_iter. Therefore, kprobe on urandom_read is not working any more: [root@eth50-1 bpf]# ./test_progs -n 161 test_stacktrace_build_id:PASS:skel_open_and_load 0 nsec libbpf: kprobe perf_event_open() failed: No such file or directory libbpf: prog 'oncpu': failed to create kprobe 'urandom_read+0x0' \ perf event: No such file or directory libbpf: prog 'oncpu': failed to auto-attach: -2 test_stacktrace_build_id:FAIL:attach_tp err -2 161 stacktrace_build_id:FAIL Fix this by replacing urandom_read with urandom_read_iter in the test. Fixes: 1b388e7765f2 ("random: convert to using fops->read_iter()") Reported-by: Mykola Lysenko Signed-off-by: Song Liu Acked-by: David Vernet Link: https://lore.kernel.org/r/20220526191608.2364049-1-song@kernel.org Signed-off-by: Alexei Starovoitov commit 4dd99891649ea5248e6a60113df0e0d04967eef7 Author: Xiang wangx Date: Fri May 27 20:10:59 2022 +0800 ALSA: hda/via: Delete does not require return Void function return statements are not generally useful. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20220527121059.25221-1-wangxiang@cdjrlc.com Signed-off-by: Takashi Iwai commit 15dad62f4bdb5dc0f0efde8181d680db9963544c Author: Rik van der Kemp Date: Fri May 27 14:07:26 2022 +0200 ALSA: hda/realtek: Enable 4-speaker output for Dell XPS 15 9520 laptop The 2022-model XPS 15 appears to use the same 4-speakers-on-ALC289 audio setup as the Dell XPS 15 9510, so requires the same quirk to enable woofer output. Tested on my own 9520. [ Move the entry to the right position in the SSID order -- tiwai ] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216035 Cc: Signed-off-by: Rik van der Kemp Link: https://lore.kernel.org/r/181056a137b.d14baf90133058.8425453735588429828@upto11.nl Signed-off-by: Takashi Iwai commit 8c03a1c21d72210f81cb369cc528e3fde4b45411 Author: Zhihao Cheng Date: Tue May 10 20:31:26 2022 +0800 ubi: ubi_create_volume: Fix use-after-free when volume creation failed There is an use-after-free problem for 'eba_tbl' in ubi_create_volume()'s error handling path: ubi_eba_replace_table(vol, eba_tbl) vol->eba_tbl = tbl out_mapping: ubi_eba_destroy_table(eba_tbl) // Free 'eba_tbl' out_unlock: put_device(&vol->dev) vol_release kfree(tbl->entries) // UAF Fix it by removing redundant 'eba_tbl' releasing. Fetch a reproducer in [Link]. Fixes: 493cfaeaa0c9b ("mtd: utilize new cdev_device_add helper function") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215965 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 14072ee33d5a2a07d735b667205f99d0a95de9f2 Author: Zhihao Cheng Date: Tue May 10 20:31:25 2022 +0800 ubi: fastmap: Check wl_pool for free peb before wear leveling UBI fetches free peb from wl_pool during wear leveling, so UBI should check wl_pool's empty status before wear leveling. Otherwise, UBI will miss wear leveling chances when free pebs are run out. Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit d09e9a2bddba6c48e0fddb16c4383172ac593251 Author: Zhihao Cheng Date: Tue May 10 20:31:24 2022 +0800 ubi: fastmap: Fix high cpu usage of ubi_bgt by making sure wl_pool not empty There at least 6 PEBs reserved on UBI device: 1. EBA_RESERVED_PEBS[1] 2. WL_RESERVED_PEBS[1] 3. UBI_LAYOUT_VOLUME_EBS[2] 4. MIN_FASTMAP_RESERVED_PEBS[2] When all ubi volumes take all their PEBs, there are 3 (EBA_RESERVED_PEBS + WL_RESERVED_PEBS + MIN_FASTMAP_RESERVED_PEBS - MIN_FASTMAP_TAKEN_PEBS[1]) free PEBs. Since commit f9c34bb529975fe ("ubi: Fix producing anchor PEBs") and commit 4b68bf9a69d22dd ("ubi: Select fastmap anchor PEBs considering wear level rules") applied, there is only 1 (3 - FASTMAP_ANCHOR_PEBS[1] - FASTMAP_NEXT_ANCHOR_PEBS[1]) free PEB to fill pool and wl_pool, after filling pool, wl_pool is always empty. So, UBI could be stuck in an infinite loop: ubi_thread system_wq wear_leveling_worker <-------------------------------------------------- get_peb_for_wl | // fm_wl_pool, used = size = 0 | schedule_work(&ubi->fm_work) | | update_fastmap_work_fn | ubi_update_fastmap | ubi_refill_pools | // ubi->free_count - ubi->beb_rsvd_pebs < 5 | // wl_pool is not filled with any PEBs | schedule_erase(old_fm_anchor) | ubi_ensure_anchor_pebs | __schedule_ubi_work(wear_leveling_worker) | | __erase_worker | ensure_wear_leveling | __schedule_ubi_work(wear_leveling_worker) -------------------------- , which cause high cpu usage of ubi_bgt: top - 12:10:42 up 5 min, 2 users, load average: 1.76, 0.68, 0.27 Tasks: 123 total, 3 running, 54 sleeping, 0 stopped, 0 zombie PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1589 root 20 0 0 0 0 R 45.0 0.0 0:38.86 ubi_bgt0d 319 root 20 0 0 0 0 I 15.2 0.0 0:15.29 kworker/0:3-eve 371 root 20 0 0 0 0 I 14.9 0.0 0:12.85 kworker/3:3-eve 20 root 20 0 0 0 0 I 11.3 0.0 0:05.33 kworker/1:0-eve 202 root 20 0 0 0 0 I 11.3 0.0 0:04.93 kworker/2:3-eve In commit 4b68bf9a69d22dd ("ubi: Select fastmap anchor PEBs considering wear level rules"), there are three key changes: 1) Choose the fastmap anchor when the most free PEBs are available. 2) Enable anchor move within the anchor area again as it is useful for distributing wear. 3) Import a candidate fm anchor and check this PEB's erase count during wear leveling. If the wear leveling limit is exceeded, use the used anchor area PEB with the lowest erase count to replace it. The anchor candidate can be removed, we can check fm_anchor PEB's erase count during wear leveling. Fix it by: 1) Removing 'fm_next_anchor' and check 'fm_anchor' during wear leveling. 2) Preferentially filling one free peb into fm_wl_pool in condition of ubi->free_count > ubi->beb_rsvd_pebs, then try to reserve enough free count for fastmap non anchor pebs after the above prerequisites are met. Then, there are at least 1 PEB in pool and 1 PEB in wl_pool after calling ubi_refill_pools() with all erase works done. Fetch a reproducer in [Link]. Fixes: 4b68bf9a69d22dd ("ubi: Select fastmap anchor PEBs ... rules") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215407 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 532aef5912c2c2add9ae725bcb1d0924e609dd87 Author: Haowen Bai Date: Tue Mar 22 18:13:04 2022 +0800 ubifs: Use NULL instead of using plain integer as pointer This fixes the following sparse warnings: fs/ubifs/xattr.c:680:58: warning: Using plain integer as NULL pointer Signed-off-by: Haowen Bai Signed-off-by: Richard Weinberger commit 5bff56edab7f11bda31cfc708634a025bb265836 Author: Minghao Chi Date: Fri Apr 29 05:45:56 2022 +0000 ubifs: Simplify the return expression of run_gc() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Tudor Ambarus Signed-off-by: Richard Weinberger commit c14adb1cf70a984ed081c67e9d27bc3caad9537c Author: Baokun Li Date: Tue Apr 12 17:38:16 2022 +0800 jffs2: fix memory leak in jffs2_do_fill_super If jffs2_iget() or d_make_root() in jffs2_do_fill_super() returns an error, we can observe the following kmemleak report: -------------------------------------------- unreferenced object 0xffff888105a65340 (size 64): comm "mount", pid 710, jiffies 4302851558 (age 58.239s) 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: [] kmem_cache_alloc_trace+0x475/0x8a0 [] jffs2_sum_init+0x96/0x1a0 [] jffs2_do_mount_fs+0x745/0x2120 [] jffs2_do_fill_super+0x35c/0x810 [] jffs2_fill_super+0x2b9/0x3b0 [...] unreferenced object 0xffff8881bd7f0000 (size 65536): comm "mount", pid 710, jiffies 4302851558 (age 58.239s) hex dump (first 32 bytes): bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ backtrace: [] kmalloc_order+0xda/0x110 [] kmalloc_order_trace+0x21/0x130 [] __kmalloc+0x711/0x8a0 [] jffs2_sum_init+0xd9/0x1a0 [] jffs2_do_mount_fs+0x745/0x2120 [] jffs2_do_fill_super+0x35c/0x810 [] jffs2_fill_super+0x2b9/0x3b0 [...] -------------------------------------------- This is because the resources allocated in jffs2_sum_init() are not released. Call jffs2_sum_exit() to release these resources to solve the problem. Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)") Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger commit 22abf318c35bcf642625e4eff56cfec1df361f3b Author: Haowen Bai Date: Mon Apr 18 18:18:07 2022 +0800 jffs2: Use kzalloc instead of kmalloc/memset Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai [rw: Fixed printk string] Signed-off-by: Richard Weinberger commit 6fe1953e008d0225fea9ad14ab52bd5faaea6c95 Author: Krzysztof Kozlowski Date: Mon May 16 16:28:57 2022 +0200 arm64: dts: sprd: use new 'dma-channels' property The '#dma-channels' property was deprecated in favor of one defined by generic dma-common DT bindings. Add new property while keeping old one for backwards compatibility. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220516142857.6419-4-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann commit 22a798d7b234c651f05cd37b487ac8071d0f4936 Author: Krzysztof Kozlowski Date: Mon May 16 16:28:56 2022 +0200 ARM: dts: da850: use new 'dma-channels' property The '#dma-channels' property was deprecated in favor of one defined by generic dma-common DT bindings. Add new property while keeping old one for backwards compatibility. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220516142857.6419-3-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann commit 286b8073541ba8a295620c64ab9827f5153ad19b Author: Krzysztof Kozlowski Date: Mon May 16 16:28:55 2022 +0200 ARM: dts: pxa: use new 'dma-channels/requests' properties The '#dma-channels' and '#dma-requests' properties were deprecated in favor of these defined by generic dma-common DT bindings. Add new properties while keeping old ones for backwards compatibility. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220516142857.6419-2-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann commit 526f3f3b102f05e97d5e51fb0dcf5037c7be9722 Author: Linus Walleij Date: Mon May 23 10:55:20 2022 +0200 soc: ixp4xx/qmgr: Fix unused match warning The kernel test robot found this inconsistency: >> drivers/soc/ixp4xx/ixp4xx-npe.c:737:34: warning: 'ixp4xx_npe_of_match' defined but not used [-Wunused-const-variable=] 737 | static const struct of_device_id ixp4xx_npe_of_match[] = { This is because the match is enclosed in the of_match_ptr() which compiles into NULL when OF is disabled and this is unnecessary. Fix it by dropping of_match_ptr() around the match. Reported-by: kernel test robot Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220523085520.913217-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 75577fbecb2e6e5f633445f01006886c51dc7e76 Author: Alexander Sverdlin Date: Mon May 23 08:56:16 2022 +0200 ARM: ep93xx: Make ts72xx_register_flash() static ... and fix the warning/error: arch/arm/mach-ep93xx/ts72xx.c:154:13: error: no previous prototype for function 'ts72xx_register_flash' [-Werror,-Wmissing-prototypes] void __init ts72xx_register_flash(struct mtd_partition *parts, int n, ^ arch/arm/mach-ep93xx/ts72xx.c:154:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init ts72xx_register_flash(struct mtd_partition *parts, int n, ^ static Reported-by: kernel test robot Signed-off-by: Alexander Sverdlin Link: https://lore.kernel.org/lkml/202202140141.HRZ3WZwi-lkp@intel.com/T/ Link: https://lore.kernel.org/r/20220523065616.325052-1-alexander.sverdlin@gmail.com' Signed-off-by: Arnd Bergmann commit 01ba87a4b792e36254b19b2bcfeb935356294f95 Author: Michael Walle Date: Wed May 18 16:15:42 2022 +0200 ARM: configs: enable support for Kontron KSwitch D10 The Kontron KSwitch D10 is based on a Microchip LAN9668 SoC. It is a managed ethernet network switch with either 8 copper ports or 6 copper ports and 2 SFP cages. Enable all required kconfig symbols, either as module where possible or compiled-in where it is not possible. Signed-off-by: Michael Walle Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220518141542.531148-1-michael@walle.cc' Signed-off-by: Arnd Bergmann commit 2ef306e16e7b60b614707272cff4276f7732b25a Merge: fd82d925f206c 821cb05f6b4b0 Author: Arnd Bergmann Date: Fri May 27 15:56:48 2022 +0200 Merge tag 'at91-dt-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/late AT91 DT #2 for 5.19: - at91: more DT compliance updates for RTC and RTT nodes - at91: sama7g5: add microphone support * tag 'at91-dt-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama7g5ek: add node for PDMC0 ARM: dts: at91: sama7g5: add nodes for PDMC ARM: dts: at91: Use the generic "rtc" node name for the rtt IPs ARM: dts: at91: Add the required 'atmel, rtt-rtc-time-reg' property Link: https://lore.kernel.org/r/20220517153252.92393-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit fd82d925f206c5f4db72b1d2da62a2f8086096c5 Merge: 8a7322a3a05f7 46a65cd376f9f Author: Arnd Bergmann Date: Fri May 27 15:56:29 2022 +0200 Merge tag 'at91-soc-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/late AT91 SoC #2 for 5.19: - One Kconfig fix for random build error * tag 'at91-soc-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: pm: Fix rand build error Link: https://lore.kernel.org/r/20220517150832.89451-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 8a7322a3a05f75e8a4902bdf8129aecd37d54fe9 Author: Genjian Zhang Date: Tue May 17 15:39:46 2022 +0800 ep93xx: clock: Do not return the address of the freed memory Avoid return freed memory addresses,Modified to the actual error return value of clk_register(). Fixes: 9645ccc7bd7a ("ep93xx: clock: convert in-place to COMMON_CLK") Signed-off-by: Genjian Zhang Acked-by: Alexander Sverdlin Signed-off-by: Arnd Bergmann commit 3e11194631275937bc40da49b98aa1a74dd1ee67 Merge: 16477cdfefdb4 2fa1533f79d3f Author: Arnd Bergmann Date: Fri May 27 15:52:46 2022 +0200 Merge branch 'hpe/gxp-soc' into arm/late Patch series from Nick Hawkins: "The GXP is the HPE BMC SoC that is used in the majority of HPE current generation servers. Traditionally the asic will last multiple generations of server before being replaced. Info about SoC: HPE GXP is the name of the HPE Soc. This SoC is used to implement many BMC features at HPE. It supports ARMv7 architecture based on the Cortex A9 core. It is capable of using an AXI bus to which a memory controller is attached. It has multiple SPI interfaces to connect boot flash and BIOS flash. It uses a 10/100/1000 MAC for network connectivity. It has multiple i2c engines to drive connectivity with a host infrastructure. The initial patches enable the watchdog and timer enabling the host to be able to boot." * hpe/gxp-soc: MAINTAINERS: Introduce HPE GXP Architecture ARM: dts: Introduce HPE GXP Device tree dt-bindings: arm: hpe: add GXP Support dt-bindings: timer: hpe,gxp-timer: Add HPE GXP Timer and Watchdog clocksource/drivers/timer-gxp: Add HPE GXP Timer watchdog: hpe-wdt: Introduce HPE GXP Watchdog ARM: configs: multi_v7_defconfig: Add HPE GXP ARCH ARM: hpe: Introduce the HPE GXP architecture Signed-off-by: Arnd Bergmann commit b9684a71fca793213378dd410cd11675d973eaa1 Author: Christoph Hellwig Date: Fri May 27 07:58:06 2022 +0200 block, loop: support partitions without scanning Historically we did distinguish between a flag that surpressed partition scanning, and a combinations of the minors variable and another flag if any partitions were supported. This was generally confusing and doesn't make much sense, but some corner case uses of the loop driver actually do want to support manually added partitions on a device that does not actively scan for partitions. To make things worsee the loop driver also wants to dynamically toggle the scanning for partitions on a live gendisk, which makes the disk->flags updates non-atomic. Introduce a new GD_SUPPRESS_PART_SCAN bit in disk->state that disables just scanning for partitions, and toggle that instead of GENHD_FL_NO_PART in the loop driver. Fixes: 1ebe2e5f9d68 ("block: remove GENHD_FL_EXT_DEVT") Reported-by: Ming Lei Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220527055806.1972352-1-hch@lst.de Signed-off-by: Jens Axboe commit dcf280e6f80be280ca7dd1b058f038654e4a18dd Author: Michael Ellerman Date: Fri May 27 21:15:41 2022 +1000 powerpc/64: Include cache.h directly in paca.h paca.h uses ____cacheline_aligned without directly including cache.h, where it's defined. For Book3S builds that's OK because paca.h includes lppaca.h, and it does include cache.h. But Book3E builds have been getting cache.h indirectly via printk.h, which is dicey, and in fact that include was recently removed, leading to build errors such as: ld: fs/isofs/dir.o:(.bss+0x0): multiple definition of `____cacheline_aligned'; fs/isofs/namei.o:(.bss+0x0): first defined here So include cache.h directly to fix the build error. Fixes: 534aa1dc975a ("printk: stop including cache.h from printk.h") Reported-by: Guenter Roeck Signed-off-by: Michael Ellerman commit 2c262b21de6dc93ac4d8c7a4cea0da4226b451fb Author: Carlo Lobrano Date: Fri May 27 10:29:06 2022 +0200 net: usb: qmi_wwan: add Telit 0x1250 composition Add support for Telit LN910Cx 0x1250 composition 0x1250: rmnet, tty, tty, tty, tty Signed-off-by: Carlo Lobrano Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit 79dfeb2916d7deb7ed11e2fb782d109d445a0cd4 Author: Raju Lakkaraju Date: Fri May 27 09:47:28 2022 +0530 net: lan743x: PCI11010 / PCI11414 fix Fix the MDIO interface declarations to reflect what is currently supported by the PCI11010 / PCI11414 devices (C22 for RGMII and C22_C45 for SGMII) Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller commit 809631e2bff5aba056df75cc4e43127dbd0278c9 Author: John Ogness Date: Thu May 26 22:36:56 2022 +0206 Revert "printk: wake up all waiters" This reverts commit 938ba4084abcf6fdd21d9078513c52f8fb9b00d0. The wait queue @log_wait never has exclusive waiters, so there is no need to use wake_up_interruptible_all(). Using wake_up_interruptible() was the correct function to wake all waiters. Since there are no exclusive waiters, erroneously changing wake_up_interruptible() to wake_up_interruptible_all() did not result in any behavior change. However, using wake_up_interruptible_all() on a wait queue without exclusive waiters is fundamentally wrong. Go back to using wake_up_interruptible() to wake all waiters. Signed-off-by: John Ogness Acked-by: Steven Rostedt (Google) Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220526203056.81123-1-john.ogness@linutronix.de commit 2028a255f4df3af9e759f01f958d3237f825f256 Author: Borislav Petkov Date: Fri May 20 21:27:29 2022 +0200 x86/extable: Annotate ex_handler_msr_mce() as a dead end Fix vmlinux.o: warning: objtool: fixup_exception+0x2d6: unreachable instruction Signed-off-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220520192729.23969-1-bp@alien8.de commit 620f8d3bd3d5e82dff8cc591c831827d4beeae2e Author: Peter Zijlstra Date: Sat May 7 13:35:37 2022 +0200 context_tracking: Always inline empty stubs Because GCC is seriously challenged.. vmlinux.o: warning: objtool: enter_from_user_mode+0x85: call to context_tracking_enabled() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x8f: call to context_tracking_enabled() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x85: call to context_tracking_enabled() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x85: call to context_tracking_enabled() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Link: https://lkml.kernel.org/r/20220526105958.134113388@infradead.org commit 1894a4030582472336c2873cb07911ce67e0d14e Author: Peter Zijlstra Date: Sat May 7 13:37:45 2022 +0200 x86: Always inline on_thread_stack() and current_top_of_stack() Becaues GCC clearly lost it's marbles again... vmlinux.o: warning: objtool: enter_from_user_mode+0x4e: call to on_thread_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x53: call to on_thread_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x4e: call to on_thread_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x4e: call to on_thread_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: enter_from_user_mode+0x4e: call to current_top_of_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x53: call to current_top_of_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x4e: call to current_top_of_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x4e: call to current_top_of_stack() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220526105958.071435483@infradead.org commit 656d054e0a15ec327bd82801ccd58201e59f6896 Author: Peter Zijlstra Date: Mon May 2 12:30:20 2022 +0200 jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds When building x86_64 with JUMP_LABEL=n it's possible for instrumentation to sneak into noinstr: vmlinux.o: warning: objtool: exit_to_user_mode+0x14: call to static_key_count.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_exit_to_user_mode+0x2d: call to static_key_count.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_exit_to_user_mode+0x1b: call to static_key_count.constprop.0() leaves .noinstr.text section Switch to arch_ prefixed atomic to avoid the explicit instrumentation. Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) commit a6a5eb269f6f3a2fe392f725a8d9052190c731e2 Author: Peter Zijlstra Date: Mon May 2 12:15:23 2022 +0200 x86/cpu: Elide KCSAN for cpu_has() and friends As x86 uses the headers, the regular forms of all bitops are instrumented with explicit calls to KASAN and KCSAN checks. As these are explicit calls, these are not suppressed by the noinstr function attribute. This can result in calls to those check functions in noinstr code, which objtool warns about: vmlinux.o: warning: objtool: enter_from_user_mode+0x24: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0x28: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0x24: call to __kcsan_check_access() leaves .noinstr.text section vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0x24: call to __kcsan_check_access() leaves .noinstr.text section Prevent this by using the arch_*() bitops, which are the underlying bitops without explciit instrumentation. [null: Changelog] Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220502111216.290518605@infradead.org commit 385bd430c011a8cb8278e61c32d602d11e06f414 Author: Peter Zijlstra Date: Mon May 2 11:15:14 2022 +0200 objtool: Mark __ubsan_handle_builtin_unreachable() as noreturn fs/ntfs3/ntfs3.prelink.o: warning: objtool: ni_read_frame() falls through to next function ni_readpage_cmpr.cold() That is in fact: 000000000000124a : 124a: 44 89 e0 mov %r12d,%eax 124d: 0f b6 55 98 movzbl -0x68(%rbp),%edx 1251: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 1254: R_X86_64_32S .data+0x1380 1258: 48 89 c6 mov %rax,%rsi 125b: e8 00 00 00 00 call 1260 125c: R_X86_64_PLT32 __ubsan_handle_shift_out_of_bounds-0x4 1260: 48 8d 7d cc lea -0x34(%rbp),%rdi 1264: e8 00 00 00 00 call 1269 1265: R_X86_64_PLT32 __tsan_read4-0x4 1269: 8b 45 cc mov -0x34(%rbp),%eax 126c: e9 00 00 00 00 jmp 1271 126d: R_X86_64_PC32 .text+0x19109 1271: 48 8b 75 a0 mov -0x60(%rbp),%rsi 1275: 48 63 d0 movslq %eax,%rdx 1278: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 127b: R_X86_64_32S .data+0x13a0 127f: 89 45 88 mov %eax,-0x78(%rbp) 1282: e8 00 00 00 00 call 1287 1283: R_X86_64_PLT32 __ubsan_handle_shift_out_of_bounds-0x4 1287: 8b 45 88 mov -0x78(%rbp),%eax 128a: e9 00 00 00 00 jmp 128f 128b: R_X86_64_PC32 .text+0x19098 128f: 48 c7 c7 00 00 00 00 mov $0x0,%rdi 1292: R_X86_64_32S .data+0x11f0 1296: e8 00 00 00 00 call 129b 1297: R_X86_64_PLT32 __ubsan_handle_builtin_unreachable-0x4 000000000000129b : Tell objtool that __ubsan_handle_builtin_unreachable() is a noreturn. Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220502091514.GB479834@worktop.programming.kicks-ass.net commit 5f3da8c08508df82823566c32f753071c8ad36af Author: Josh Poimboeuf Date: Tue Apr 19 09:05:09 2022 -0700 objtool: Add CONFIG_HAVE_UACCESS_VALIDATION Allow an arch specify that it has objtool uaccess validation with CONFIG_HAVE_UACCESS_VALIDATION. For now, doing so unconditionally selects CONFIG_OBJTOOL. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/d393d5e2fe73aec6e8e41d5c24f4b6fe8583f2d8.1650384225.git.jpoimboe@redhat.com commit e19d11267f0e6c8aff2d15d2dfed12365b4c9184 Author: Fanjun Kong Date: Thu May 26 22:20:39 2022 +0800 x86/mm: Use PAGE_ALIGNED(x) instead of IS_ALIGNED(x, PAGE_SIZE) The already provides the PAGE_ALIGNED() macro. Let's use this macro instead of IS_ALIGNED() and passing PAGE_SIZE directly. No change in functionality. [ mingo: Tweak changelog. ] Signed-off-by: Fanjun Kong Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220526142038.1582839-1-bh1scw@gmail.com commit f7081834b2d5bbc77d67073d8ab490bfeaf3c13b Author: Bo Liu Date: Fri May 27 02:14:00 2022 -0400 x86: Fix all occurences of the "the the" typo Rather than waiting for the bots to fix these one-by-one, fix all occurences of "the the" throughout arch/x86. Signed-off-by: Bo Liu Signed-off-by: Ingo Molnar Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20220527061400.5694-1-liubo03@inspur.com commit 8b4dd2d8627e88dc3bd71bf29c48aaae2b69572b Author: Haowen Bai Date: Fri May 27 18:03:54 2022 +0800 perf/core: Remove unused local variable Drop LIST_HEAD() where the variable it declares is never used. Compiler probably never warned us, because the LIST_HEAD() initializer is technically 'usage'. [ mingo: Tweak changelog. ] Signed-off-by: Haowen Bai Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/1653645835-29206-1-git-send-email-baihaowen@meizu.com commit 55919b32d14bfa8e47d0fe44f73ba069d1a2b3df Merge: 02ded5a173619 b53c116642502 Author: David S. Miller Date: Fri May 27 11:08:12 2022 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following contain more Netfilter fixes for net: 1) syzbot warning in nfnetlink bind, from Florian. 2) Refetch conntrack after __nf_conntrack_confirm(), from Florian Westphal. 3) Move struct nf_ct_timeout back at the bottom of the ctnl_time, to where it before recent update, also from Florian. 4) Add NL_SET_BAD_ATTR() to nf_tables netlink for proper set element commands error reporting. ==================== Signed-off-by: David S. Miller commit b53c116642502b0c85ecef78bff4f826a7dd4145 Author: Pablo Neira Ayuso Date: Fri May 20 00:02:06 2022 +0200 netfilter: nf_tables: set element extended ACK reporting support Report the element that causes problems via netlink extended ACK for set element commands. Signed-off-by: Pablo Neira Ayuso commit aeed55a08d0b2bf2e3986b110b04d2a5aca192a6 Author: Florian Westphal Date: Fri May 20 00:02:05 2022 +0200 netfilter: cttimeout: fix slab-out-of-bounds read in cttimeout_net_exit syzbot reports: BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid+0xcc/0xf0 lib/list_debug.c:42 [..] list_del include/linux/list.h:148 [inline] cttimeout_net_exit+0x211/0x540 net/netfilter/nfnetlink_cttimeout.c:617 No reproducer so far. Looking at recent changes in this area its clear that the free_head must not be at the end of the structure because nf_ct_timeout structure has variable size. Reported-by: Fixes: 78222bacfca9 ("netfilter: cttimeout: decouple unlink and free on netns destruction") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 56b14ecec97f39118bf85c9ac2438c5a949509ed Author: Florian Westphal Date: Fri May 20 00:02:04 2022 +0200 netfilter: conntrack: re-fetch conntrack after insertion In case the conntrack is clashing, insertion can free skb->_nfct and set skb->_nfct to the already-confirmed entry. This wasn't found before because the conntrack entry and the extension space used to free'd after an rcu grace period, plus the race needs events enabled to trigger. Reported-by: Fixes: 71d8c47fc653 ("netfilter: conntrack: introduce clash resolution on insertion race") Fixes: 2ad9d7747c10 ("netfilter: conntrack: free extension area immediately") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ffd219efd9ee1ceccc7ccfa9361fd40705680fc3 Author: Florian Westphal Date: Fri May 20 00:02:03 2022 +0200 netfilter: nfnetlink: fix warn in nfnetlink_unbind syzbot reports following warn: WARNING: CPU: 0 PID: 3600 at net/netfilter/nfnetlink.c:703 nfnetlink_unbind+0x357/0x3b0 net/netfilter/nfnetlink.c:694 The syzbot generated program does this: socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER) = 3 setsockopt(3, SOL_NETLINK, NETLINK_DROP_MEMBERSHIP, [1], 4) = 0 ... which triggers 'WARN_ON_ONCE(nfnlnet->ctnetlink_listeners == 0)' check. Instead of counting, just enable reporting for every bind request and check if we still have listeners on unbind. While at it, also add the needed bounds check on nfnl_group2type[] access. Reported-by: Reported-by: Fixes: 2794cdb0b97b ("netfilter: nfnetlink: allow to detect if ctnetlink listeners exist") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 49f8b459fc1de5e3712b57c8ccefae9ec45270f8 Author: Juergen Gross Date: Tue May 24 13:46:30 2022 +0200 xen: switch gnttab_end_foreign_access() to take a struct page pointer Instead of a virtual kernel address use a pointer of the associated struct page as second parameter of gnttab_end_foreign_access(). Most users have that pointer available already and are creating the virtual address from it, risking problems in case the memory is located in highmem. gnttab_end_foreign_access() itself won't need to get the struct page from the address again. Suggested-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich Signed-off-by: Juergen Gross commit 57963a92a70b037aa22544fbc34742e5be689c04 Merge: 317f29c14d0cc 9c04a8ff03def Author: Thomas Gleixner Date: Fri May 27 10:32:08 2022 +0200 Merge tag 'timers-v5.19-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clockevent/clocksource driver updates from Daniel Lezcano: - Add Mediatek MT8186 DT bindings (Allen-KH Cheng) - Remove dead code corresponding of the IXP4xx board removal (Linus Walleij) - Add CLOCK_EVT_FEAT_C3STOP flag for the RISC-V SBI timer (Samuel Holland) - Do not return an error if there are multiple definitions of the sp804 timers in the DT (Andre Przywara) - Add the missing SPDX identifier (Thomas Gleixner) - Remove an unncessary NULL check as it is done right before at probe time for the timer-ti-dm (Dan Carpenter) - Fix the irq_of_parse_and_map() return code check on onexas-nps (Krzysztof Kozlowski) Link: https://lore.kernel.org/lkml/b5a83e54-1ee1-f910-4be4-bc3bf1015243@linaro.org commit c9db1884050fa6524ae851347731ba2ff9c8d734 Author: Masahiro Yamada Date: Tue May 24 03:15:03 2022 +0900 kbuild: replace $(if A,A,B) with $(or A,B) in scripts/Makefile.modpost Similar cleanup to commit 5c8166419acf ("kbuild: replace $(if A,A,B) with $(or A,B)"). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 68fef6704e38581f7462cb7aac349978fd4ca5cc Author: Masahiro Yamada Date: Tue May 24 01:46:26 2022 +0900 modpost: squash if...else-if in find_elf_symbol2() if ((addr - sym->st_value) < distance) { distance = addr - sym->st_value; near = sym; } else if ((addr - sym->st_value) == distance) { near = sym; } is equivalent to: if (addr - sym->st_value <= distance) { distance = addr - sym->st_value; near = sym; } (The else-if block can overwrite 'distance' with the same value). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit c5c468dcc25efc0095361bb63b6255622e22f695 Author: Masahiro Yamada Date: Tue May 24 01:46:25 2022 +0900 modpost: reuse ARRAY_SIZE() macro for section_mismatch() Move ARRAY_SIZE() from file2alias.c to modpost.h to reuse it in section_mismatch(). Also, move the variable 'check' inside the for-loop. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 76954527fe05354add150737aa1b9a6baa4a6ee5 Author: Masahiro Yamada Date: Tue May 24 01:46:23 2022 +0900 modpost: remove the unused argument of check_sec_ref() check_sec_ref() does not use the first parameter 'mod'. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit d6b732666a1bae0df3c3ae06925043bba34502b1 Author: Masahiro Yamada Date: Tue May 24 01:46:22 2022 +0900 modpost: fix undefined behavior of is_arm_mapping_symbol() The return value of is_arm_mapping_symbol() is unpredictable when "$" is passed in. strchr(3) says: The strchr() and strrchr() functions return a pointer to the matched character or NULL if the character is not found. The terminating null byte is considered part of the string, so that if c is specified as '\0', these functions return a pointer to the terminator. When str[1] is '\0', strchr("axtd", str[1]) is not NULL, and str[2] is referenced (i.e. buffer overrun). Test code --------- char str1[] = "abc"; char str2[] = "ab"; strcpy(str1, "$"); strcpy(str2, "$"); printf("test1: %d\n", is_arm_mapping_symbol(str1)); printf("test2: %d\n", is_arm_mapping_symbol(str2)); Result ------ test1: 0 test2: 1 Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b5beffa20d83c4e15306c991ffd00de0d8628338 Author: Alexander Lobakin Date: Tue May 24 17:27:18 2022 +0200 modpost: fix removing numeric suffixes With the `-z unique-symbol` linker flag or any similar mechanism, it is possible to trigger the following: ERROR: modpost: "param_set_uint.0" [vmlinux] is a static EXPORT_SYMBOL The reason is that for now the condition from remove_dot(): if (m && (s[n + m] == '.' || s[n + m] == 0)) which was designed to test if it's a dot or a '\0' after the suffix is never satisfied. This is due to that `s[n + m]` always points to the last digit of a numeric suffix, not on the symbol next to it (from a custom debug print added to modpost): param_set_uint.0, s[n + m] is '0', s[n + m + 1] is '\0' So it's off-by-one and was like that since 2014. Fix this for the sake of any potential upcoming features, but don't bother stable-backporting, as it's well hidden -- apart from that LD flag, it can be triggered only with GCC LTO which never landed upstream. Fixes: fcd38ed0ff26 ("scripts: modpost: fix compilation warning") Signed-off-by: Alexander Lobakin Reviewed-by: Petr Mladek Signed-off-by: Masahiro Yamada commit 2a4a62a14be1947fa945c5c11ebf67326381a568 Author: Vincent Whitchurch Date: Mon May 23 16:04:03 2022 +0200 um: Fix out-of-bounds read in LDT setup syscall_stub_data() expects the data_count parameter to be the number of longs, not bytes. ================================================================== BUG: KASAN: stack-out-of-bounds in syscall_stub_data+0x70/0xe0 Read of size 128 at addr 000000006411f6f0 by task swapper/1 CPU: 0 PID: 1 Comm: swapper Not tainted 5.18.0+ #18 Call Trace: show_stack.cold+0x166/0x2a7 __dump_stack+0x3a/0x43 dump_stack_lvl+0x1f/0x27 print_report.cold+0xdb/0xf81 kasan_report+0x119/0x1f0 kasan_check_range+0x3a3/0x440 memcpy+0x52/0x140 syscall_stub_data+0x70/0xe0 write_ldt_entry+0xac/0x190 init_new_ldt+0x515/0x960 init_new_context+0x2c4/0x4d0 mm_init.constprop.0+0x5ed/0x760 mm_alloc+0x118/0x170 0x60033f48 do_one_initcall+0x1d7/0x860 0x60003e7b kernel_init+0x6e/0x3d4 new_thread_handler+0x1e7/0x2c0 The buggy address belongs to stack of task swapper/1 and is located at offset 64 in frame: init_new_ldt+0x0/0x960 This frame has 2 objects: [32, 40) 'addr' [64, 80) 'desc' ================================================================== Fixes: 858259cf7d1c443c83 ("uml: maintain own LDT entries") Signed-off-by: Vincent Whitchurch Cc: stable@vger.kernel.org Signed-off-by: Richard Weinberger commit 57ae0b67b747031bc41fb44643aa5344ab58607e Author: Johannes Berg Date: Fri May 20 19:45:36 2022 +0200 um: chan_user: Fix winch_tramp() return value The previous fix here was only partially correct, it did result in returning a proper error value in case of error, but it also clobbered the pid that we need to return from this function (not just zero for success). As a result, it returned 0 here, but later this is treated as a pid and used to kill the process, but since it's now 0 we kill(0, SIGKILL), which makes UML kill itself rather than just the helper thread. Fix that and make it more obvious by using a separate variable for the pid. Fixes: ccf1236ecac4 ("um: fix error return code in winch_tramp()") Reported-and-tested-by: Nathan Chancellor Signed-off-by: Johannes Berg Cc: stable@vger.kernel.org Signed-off-by: Richard Weinberger commit af9fb41ed315ce95f659f0b10b4d59a71975381d Author: Johannes Berg Date: Tue May 17 22:52:50 2022 +0200 um: virtio_uml: Fix broken device handling in time-travel If a device implementation crashes, virtio_uml will mark it as dead by calling virtio_break_device() and scheduling the work that will remove it. This still seems like the right thing to do, but it's done directly while reading the message, and if time-travel is used, this is in the time-travel handler, outside of the normal Linux machinery. Therefore, we cannot acquire locks or do normal "linux-y" things because e.g. lockdep will be confused about the context. Move handling this situation out of the read function and into the actual IRQ handler and response handling instead, so that in the case of time-travel we don't call it in the wrong context. Chances are the system will still crash immediately, since the device implementation crashing may also cause the time- travel controller to go down, but at least all of that now happens without strange warnings from lockdep. Fixes: c8177aba37ca ("um: time-travel: rework interrupt handling in ext mode") Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit d5a9597d6916a76663085db984cb8fe97f0a5c56 Author: Johannes Berg Date: Fri May 6 15:46:12 2022 +0200 um: line: Use separate IRQs per line Today, all possible serial lines (ssl*=) as well as all possible consoles (con*=) each share a single interrupt (with a fixed number) with others of the same type. Now, if you have two lines, say ssl0 and ssl1, and one of them is connected to an fd you cannot read (e.g. a file), but the other gets a read interrupt, then both of them get the interrupt since it's shared. Then, the read() call will return EOF, since it's a file being written and there's nothing to read (at least not at the current offset, at the end). Unfortunately, this is treated as a read error, and we close this line, losing all the possible output. It might be possible to work around this and make the IRQ sharing work, however, now that we have dynamically allocated IRQs that are easy to use, simply use that to achieve separating between the events; then there's no interrupt for that line and we never attempt the read in the first place, thus not closing the line. This manifested itself in the wifi hostap/hwsim tests where the parallel script communicates via one serial console and the kernel messages go to another (a file) and sending data on the communication console caused the kernel messages to stop flowing into the file. Reported-by: Jouni Malinen Signed-off-by: Johannes Berg Acked-By: anton ivanov Signed-off-by: Richard Weinberger commit 02ded5a173619b11728b8bf75a3fd995a2c1ff28 Author: Miaoqian Lin Date: Thu May 26 18:52:08 2022 +0400 net: dsa: mv88e6xxx: Fix refcount leak in mv88e6xxx_mdios_register of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. mv88e6xxx_mdio_register() pass the device node to of_mdiobus_register(). We don't need the device node after it. Add missing of_node_put() to avoid refcount leak. Fixes: a3c53be55c95 ("net: dsa: mv88e6xxx: Support multiple MDIO busses") Signed-off-by: Miaoqian Lin Reviewed-by: Marek Behún Signed-off-by: David S. Miller commit 2419ac3272669240e70c967bacaa49be943b6344 Author: Vincent Whitchurch Date: Thu Apr 14 12:34:51 2022 +0200 um: Enable ARCH_HAS_GCOV_PROFILE_ALL Enable ARCH_HAS_GCOV_PROFILE_ALL so that CONFIG_GCOV_PROFILE_ALL can be selected on UML. I didn't need to explicitly disable GCOV on anything to get this to work on the configs I tested. Signed-off-by: Vincent Whitchurch Signed-off-by: Richard Weinberger commit 365719035526e8eda214a1cedb2e1c96e969a0d7 Author: Johannes Berg Date: Mon Mar 28 09:46:25 2022 +0200 um: Use asm-generic/dma-mapping.h If DMA (PCI over virtio) is enabled, then some drivers may enable CONFIG_DMA_OPS as well, and then we pull in the x86 definition of get_arch_dma_ops(), which uses the dma_ops symbol, which isn't defined. Since we don't have real DMA ops nor any kind of IOMMU fix this in the simplest possible way: pull in the asm-generic file instead of inheriting the x86 one. It's not clear why those drivers that do (e.g. VDPA) "select DMA_OPS", and if they'd even work with this, but chances are nobody will be wanting to do that anyway, so fixing the build failure is good enough. Reported-by: Randy Dunlap Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Johannes Berg Tested-by: Randy Dunlap Acked-by: Randy Dunlap Cc: stable@vger.kernel.org Signed-off-by: Richard Weinberger commit 5dd89d2fc438457811cbbec07999ce0d80051ff5 Author: Miaoqian Lin Date: Thu May 26 12:52:08 2022 +0400 net: ethernet: ti: am65-cpsw-nuss: Fix some refcount leaks of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. am65_cpsw_init_cpts() and am65_cpsw_nuss_probe() don't release the refcount in error case. Add missing of_node_put() to avoid refcount leak. Fixes: b1f66a5bee07 ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support") Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller commit b0cbccf4480bd251d7911e7fa1913e47769dc724 Author: Johannes Berg Date: Thu Mar 24 13:13:44 2022 +0100 um: daemon: Make default socket configurable Even if daemon network is deprecated, some configurations may still use it (e.g. Debian), and not want to default to the /tmp/uml.ctl socket location. Allow configuring the default socket location. Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Tested-by: Ritesh Raj Sarraf Signed-off-by: Richard Weinberger commit e7e7104e2d5ddf3806a28695670f21bef471f1e1 Author: Dan Carpenter Date: Thu May 26 11:02:42 2022 +0300 net: ethernet: mtk_eth_soc: out of bounds read in mtk_hwlro_get_fdir_entry() The "fsp->location" variable comes from user via ethtool_get_rxnfc(). Check that it is valid to prevent an out of bounds read. Fixes: 7aab747e5563 ("net: ethernet: mediatek: add ethtool functions to configure RX flows of HW LRO") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 8d3a75078c83a26d2e637da4e8f95058a406f5e7 Author: Yuntao Wang Date: Sun May 22 22:12:40 2022 +0800 scripts/kallsyms: update usage message of the kallsyms program The kallsyms program supports --absolute-percpu option but does not display it in the usage message, fix it. Signed-off-by: Yuntao Wang Signed-off-by: Masahiro Yamada commit 23a0cb8e3225122496bfa79172005c587c2d64bf Author: Jing Leng Date: Tue May 17 18:51:28 2022 +0800 kbuild: Fix include path in scripts/Makefile.modpost When building an external module, if users don't need to separate the compilation output and source code, they run the following command: "make -C $(LINUX_SRC_DIR) M=$(PWD)". At this point, "$(KBUILD_EXTMOD)" and "$(src)" are the same. If they need to separate them, they run "make -C $(KERNEL_SRC_DIR) O=$(KERNEL_OUT_DIR) M=$(OUT_DIR) src=$(PWD)". Before running the command, they need to copy "Kbuild" or "Makefile" to "$(OUT_DIR)" to prevent compilation failure. So the kernel should change the included path to avoid the copy operation. Signed-off-by: Jing Leng [masahiro: I do not think "M=$(OUT_DIR) src=$(PWD)" is the official way, but this patch is a nice clean up anyway.] Signed-off-by: Masahiro Yamada commit 16aa835a25243114331fe816b3508120c5a88042 Author: Johannes Berg Date: Thu Mar 24 13:13:43 2022 +0100 um: xterm: Make default terminal emulator configurable Make the default terminal emulator configurable so e.g. Debian can set it to x-terminal-emulator instead of the current default of xterm. Signed-off-by: Johannes Berg Acked-By: Anton Ivanov Tested-by: Ritesh Raj Sarraf Signed-off-by: Richard Weinberger commit 7e284070abe53d448517b80493863595af4ab5f0 Merge: 780d8ce716281 ca522482e3eaf Author: Linus Torvalds Date: Thu May 26 21:13:45 2022 -0700 Merge tag 'for-5.19/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Enable DM core bioset's per-cpu bio cache if QUEUE_FLAG_POLL set. This change improves DM's hipri bio polling (REQ_POLLED) performance by 7 - 20% depending on the system. - Update DM core to use jump_labels to further reduce cost of unlikely branches for zoned block devices, dm-stats and swap_bios throttling. - Various DM core changes to reduce bio-based DM overhead and simplify IO accounting. - Fundamental DM core improvements to dm_io reference counting and the elimination of using bio_split()+bio_chain() -- instead DM's bio-based IO accounting is updated to account that a split occurred. - Improve DM core's abnormal bio processing to do less work. - Improve DM core's hipri polling support to use a single list rather than an hlist. - Update DM core to pass NULL bdev to bio_alloc_clone() so that initialization that isn't useful for DM can be elided. - Add cond_resched to DM stats' various loops that loop over all entries. - Fix incorrect error code return from DM integrity's constructor. - Make DM crypt's printing of the key constant-time. - Update bio-based DM multipath to provide high-resolution timer to the Historical Service Time (HST) path selector. * tag 'for-5.19/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (26 commits) dm: pass NULL bdev to bio_alloc_clone dm cache metadata: remove unnecessary variable in __dump_mapping dm mpath: provide high-resolution timer to HST for bio-based dm crypt: make printing of the key constant-time dm integrity: fix error code in dm_integrity_ctr() dm stats: add cond_resched when looping over entries dm: improve abnormal bio processing dm: simplify bio-based IO accounting further dm: put all polled dm_io instances into a single list dm: improve dm_io reference counting dm: don't grab target io reference in dm_zone_map_bio dm: improve bio splitting and associated IO accounting dm: switch to bdev based IO accounting interfaces dm: pass dm_io instance to dm_io_acct directly dm: don't pass bio to __dm_start_io_acct and dm_end_io_acct dm: use bio_sectors in dm_aceept_partial_bio dm: simplify basic targets dm: conditionally enable branching for less used features dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio dm: move hot dm_io members to same cacheline as dm_target_io ... commit 780d8ce7162818cfe03e9a5e23b3af192a1d37bc Merge: 090b39af591cd 9c477178a0a18 Author: Linus Torvalds Date: Thu May 26 21:08:40 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "Small collection of incremental improvement patches: - Minor code cleanup patches, comment improvements, etc from static tools - Clean the some of the kernel caps, reducing the historical stealth uAPI leftovers - Bug fixes and minor changes for rdmavt, hns, rxe, irdma - Remove unimplemented cruft from rxe - Reorganize UMR QP code in mlx5 to avoid going through the IB verbs layer - flush_workqueue(system_unbound_wq) removal - Ensure rxe waits for objects to be unused before allowing the core to free them - Several rc quality bug fixes for hfi1" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (67 commits) RDMA/rtrs-clt: Fix one kernel-doc comment RDMA/hfi1: Remove all traces of diagpkt support RDMA/hfi1: Consolidate software versions RDMA/hfi1: Remove pointless driver version RDMA/hfi1: Fix potential integer multiplication overflow errors RDMA/hfi1: Prevent panic when SDMA is disabled RDMA/hfi1: Prevent use of lock before it is initialized RDMA/rxe: Fix an error handling path in rxe_get_mcg() IB/core: Fix typo in comment RDMA/core: Fix typo in comment IB/hf1: Fix typo in comment IB/qib: Fix typo in comment IB/iser: Fix typo in comment RDMA/mlx4: Avoid flush_scheduled_work() usage IB/isert: Avoid flush_scheduled_work() usage RDMA/mlx5: Remove duplicate pointer assignment in mlx5_ib_alloc_implicit_mr() RDMA/qedr: Remove unnecessary synchronize_irq() before free_irq() RDMA/hns: Use hr_reg_read() instead of remaining roce_get_xxx() RDMA/hns: Use hr_reg_xxx() instead of remaining roce_set_xxx() RDMA/irdma: Add SW mechanism to generate completions on error ... commit 090b39af591cdde897664dfa5d3d5b0c78a197fb Merge: 6d29d7fe4f0c1 d37aa2efc89b3 Author: Linus Torvalds Date: Thu May 26 21:03:56 2022 -0700 Merge tag 'hardening-v5.19-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kernel hardening fix from Kees Cook: "This fixes an unlucky build race condition when using the GCC plugins, noticed by a few folks. - Avoid GCC plugins needing utsrelease.h build target (Masahiro Yamada)" * tag 'hardening-v5.19-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: use KERNELVERSION for plugin version commit 6d29d7fe4f0c1e81c39622cce45cd397b23dc48f Merge: 7f50d4dfe816d 08af54b3e5729 Author: Linus Torvalds Date: Thu May 26 20:52:24 2022 -0700 Merge tag 'nfsd-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "We introduce 'courteous server' in this release. Previously NFSD would purge open and lock state for an unresponsive client after one lease period (typically 90 seconds). Now, after one lease period, another client can open and lock those files and the unresponsive client's lease is purged; otherwise if the unresponsive client's open and lock state is uncontended, the server retains that open and lock state for up to 24 hours, allowing the client's workload to resume after a lengthy network partition. A longstanding issue with NFSv4 file creation is also addressed. Previously a file creation can fail internally, returning an error to the client, but leave the newly created file in place as an artifact. The file creation code path has been reorganized so that internal failures and race conditions are less likely to result in an unwanted file creation. A fault injector has been added to help exercise paths that are run during kernel metadata cache invalidation. These caches contain information maintained by user space about exported filesystems. Many of our test workloads do not trigger cache invalidation. There is one patch that is needed to support PREEMPT_RT and a fix for an ancient 'sleep while spin-locked' splat that seems to have become easier to hit since v5.18-rc3" * tag 'nfsd-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (36 commits) NFSD: nfsd_file_put() can sleep NFSD: Add documenting comment for nfsd4_release_lockowner() NFSD: Modernize nfsd4_release_lockowner() NFSD: Fix possible sleep during nfsd4_release_lockowner() nfsd: destroy percpu stats counters after reply cache shutdown nfsd: Fix null-ptr-deref in nfsd_fill_super() nfsd: Unregister the cld notifier when laundry_wq create failed SUNRPC: Use RMW bitops in single-threaded hot paths NFSD: Clean up the show_nf_flags() macro NFSD: Trace filecache opens NFSD: Move documenting comment for nfsd4_process_open2() NFSD: Fix whitespace NFSD: Remove dprintk call sites from tail of nfsd4_open() NFSD: Instantiate a struct file when creating a regular NFSv4 file NFSD: Clean up nfsd_open_verified() NFSD: Remove do_nfsd_create() NFSD: Refactor NFSv4 OPEN(CREATE) NFSD: Refactor NFSv3 CREATE NFSD: Refactor nfsd_create_setattr() NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create() ... commit a54ce3703613e41fe1d98060b62ec09a3984dc28 Author: Vincent Ray Date: Wed May 25 17:17:46 2022 -0700 net: sched: fixed barrier to prevent skbuff sticking in qdisc backlog In qdisc_run_begin(), smp_mb__before_atomic() used before test_bit() does not provide any ordering guarantee as test_bit() is not an atomic operation. This, added to the fact that the spin_trylock() call at the beginning of qdisc_run_begin() does not guarantee acquire semantics if it does not grab the lock, makes it possible for the following statement : if (test_bit(__QDISC_STATE_MISSED, &qdisc->state)) to be executed before an enqueue operation called before qdisc_run_begin(). As a result the following race can happen : CPU 1 CPU 2 qdisc_run_begin() qdisc_run_begin() /* true */ set(MISSED) . /* returns false */ . . /* sees MISSED = 1 */ . /* so qdisc not empty */ . __qdisc_run() . . . pfifo_fast_dequeue() ----> /* may be done here */ . | . clear(MISSED) | . . | . smp_mb __after_atomic(); | . . | . /* recheck the queue */ | . /* nothing => exit */ | enqueue(skb1) | . | qdisc_run_begin() | . | spin_trylock() /* fail */ | . | smp_mb__before_atomic() /* not enough */ | . ---- if (test_bit(MISSED)) return false; /* exit */ In the above scenario, CPU 1 and CPU 2 both try to grab the qdisc->seqlock at the same time. Only CPU 2 succeeds and enters the bypass code path, where it emits its skb then calls __qdisc_run(). CPU1 fails, sets MISSED and goes down the traditionnal enqueue() + dequeue() code path. But when executing qdisc_run_begin() for the second time, after enqueuing its skbuff, it sees the MISSED bit still set (by itself) and consequently chooses to exit early without setting it again nor trying to grab the spinlock again. Meanwhile CPU2 has seen MISSED = 1, cleared it, checked the queue and found it empty, so it returned. At the end of the sequence, we end up with skb1 enqueued in the backlog, both CPUs out of __dev_xmit_skb(), the MISSED bit not set, and no __netif_schedule() called made. skb1 will now linger in the qdisc until somebody later performs a full __qdisc_run(). Associated to the bypass capacity of the qdisc, and the ability of the TCP layer to avoid resending packets which it knows are still in the qdisc, this can lead to serious traffic "holes" in a TCP connection. We fix this by replacing the smp_mb__before_atomic() / test_bit() / set_bit() / smp_mb__after_atomic() sequence inside qdisc_run_begin() by a single test_and_set_bit() call, which is more concise and enforces the needed memory barriers. Fixes: 89837eb4b246 ("net: sched: add barrier to ensure correct ordering for lockless qdisc") Signed-off-by: Vincent Ray Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220526001746.2437669-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit b58cdd4388b1d8f5bee9f5a3897a7e780d1eaa48 Author: Michael Walle Date: Thu May 26 01:12:39 2022 +0200 net: lan966x: check devm_of_phy_get() for -EDEFER_PROBE At the moment, if devm_of_phy_get() returns an error the serdes simply isn't set. While it is bad to ignore an error in general, there is a particular bug that network isn't working if the serdes driver is compiled as a module. In that case, devm_of_phy_get() returns -EDEFER_PROBE and the error is silently ignored. The serdes is optional, it is not there if the port is using RGMII, in which case devm_of_phy_get() returns -ENODEV. Rearrange the error handling so that -ENODEV will be handled but other error codes will abort the probing. Fixes: d28d6d2e37d1 ("net: lan966x: add port module support") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220525231239.1307298-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 4548ad7287c45047b2c1d536e110e0cfaccde1c9 Merge: 6c465408a7709 558254b0b602b Author: Jakub Kicinski Date: Thu May 26 20:43:05 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Fix UAF when creating non-stateful expression in set. 2) Set limit cost when cloning expression accordingly, from Phil Sutter. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_limit: Clone packet limits' cost value netfilter: nf_tables: disallow non-stateful expression in sets earlier ==================== Link: https://lore.kernel.org/r/20220526205411.315136-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 8d4a21b5ac9dad5d5221c60060b3ac28d22f57ca Author: sunliming Date: Thu May 26 15:29:57 2022 +0800 tracing: Fix comments for event_trigger_separate_filter() The parameter name in comments of event_trigger_separate_filter() is inconsistent with actual parameter name, fix it. Link: https://lkml.kernel.org/r/20220526072957.165655-1-sunliming@kylinos.cn Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit aef54851bf1d3e31f9c15e8134e859c2f343ceab Author: sunliming Date: Thu May 26 19:08:31 2022 +0800 x86/traceponit: Fix comment about irq vector tracepoints Commit: 4b9a8dca0e58 ("x86/idt: Remove the tracing IDT completely") removed the 'tracing IDT' from arch/x86/kernel/tracepoint.c, but left related comment. So that the comment become anachronistic. Just remove the comment. Link: https://lkml.kernel.org/r/20220526110831.175743-1-sunliming@kylinos.cn Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit feccde2a49ff88e3e197adf1f16ea852dd05d059 Author: sunliming Date: Wed May 25 09:28:27 2022 +0800 x86,tracing: Remove unused headers Commit 4b9a8dca0e58 ("x86/idt: Remove the tracing IDT completely") removed the tracing IDT from the file arch/x86/kernel/tracepoint.c, but left the related headers unused, remove it. Link: https://lkml.kernel.org/r/20220525012827.93464-1-sunliming@kylinos.cn Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1 Author: Song Liu Date: Tue May 24 10:08:39 2022 -0700 ftrace: Clean up hash direct_functions on register failures We see the following GPF when register_ftrace_direct fails: [ ] general protection fault, probably for non-canonical address \ 0x200000000000010: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI [...] [ ] RIP: 0010:ftrace_find_rec_direct+0x53/0x70 [ ] Code: 48 c1 e0 03 48 03 42 08 48 8b 10 31 c0 48 85 d2 74 [...] [ ] RSP: 0018:ffffc9000138bc10 EFLAGS: 00010206 [ ] RAX: 0000000000000000 RBX: ffffffff813e0df0 RCX: 000000000000003b [ ] RDX: 0200000000000000 RSI: 000000000000000c RDI: ffffffff813e0df0 [ ] RBP: ffffffffa00a3000 R08: ffffffff81180ce0 R09: 0000000000000001 [ ] R10: ffffc9000138bc18 R11: 0000000000000001 R12: ffffffff813e0df0 [ ] R13: ffffffff813e0df0 R14: ffff888171b56400 R15: 0000000000000000 [ ] FS: 00007fa9420c7780(0000) GS:ffff888ff6a00000(0000) knlGS:000000000 [ ] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ ] CR2: 000000000770d000 CR3: 0000000107d50003 CR4: 0000000000370ee0 [ ] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ ] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ ] Call Trace: [ ] [ ] register_ftrace_direct+0x54/0x290 [ ] ? render_sigset_t+0xa0/0xa0 [ ] bpf_trampoline_update+0x3f5/0x4a0 [ ] ? 0xffffffffa00a3000 [ ] bpf_trampoline_link_prog+0xa9/0x140 [ ] bpf_tracing_prog_attach+0x1dc/0x450 [ ] bpf_raw_tracepoint_open+0x9a/0x1e0 [ ] ? find_held_lock+0x2d/0x90 [ ] ? lock_release+0x150/0x430 [ ] __sys_bpf+0xbd6/0x2700 [ ] ? lock_is_held_type+0xd8/0x130 [ ] __x64_sys_bpf+0x1c/0x20 [ ] do_syscall_64+0x3a/0x80 [ ] entry_SYSCALL_64_after_hwframe+0x44/0xae [ ] RIP: 0033:0x7fa9421defa9 [ ] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 9 f8 [...] [ ] RSP: 002b:00007ffed743bd78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 [ ] RAX: ffffffffffffffda RBX: 00000000069d2480 RCX: 00007fa9421defa9 [ ] RDX: 0000000000000078 RSI: 00007ffed743bd80 RDI: 0000000000000011 [ ] RBP: 00007ffed743be00 R08: 0000000000bb7270 R09: 0000000000000000 [ ] R10: 00000000069da210 R11: 0000000000000246 R12: 0000000000000001 [ ] R13: 00007ffed743c4b0 R14: 00000000069d2480 R15: 0000000000000001 [ ] [ ] Modules linked in: klp_vm(OK) [ ] ---[ end trace 0000000000000000 ]--- One way to trigger this is: 1. load a livepatch that patches kernel function xxx; 2. run bpftrace -e 'kfunc:xxx {}', this will fail (expected for now); 3. repeat #2 => gpf. This is because the entry is added to direct_functions, but not removed. Fix this by remove the entry from direct_functions when register_ftrace_direct fails. Also remove the last trailing space from ftrace.c, so we don't have to worry about it anymore. Link: https://lkml.kernel.org/r/20220524170839.900849-1-song@kernel.org Cc: stable@vger.kernel.org Fixes: 763e34e74bb7 ("ftrace: Add register_ftrace_direct()") Signed-off-by: Song Liu Signed-off-by: Steven Rostedt (Google) commit 0a54f556b035e5217e21724d82dd98ce695bd6d6 Author: sunliming Date: Tue May 24 14:39:37 2022 +0800 tracing: Fix comments of create_filter() The name in comments of parameter "filter_string" in function create_filter is annotated as "filter_str", just fix it. Link: https://lkml.kernel.org/r/20220524063937.52873-1-sunliming@kylinos.cn Signed-off-by: sunliming Signed-off-by: Steven Rostedt (Google) commit bb5eb8f3b329789fbf22c85328dcf696a3e97ffb Author: Congyu Liu Date: Mon May 23 06:30:33 2022 +0000 tracing: Disable kcov on trace_preemptirq.c Functions in trace_preemptirq.c could be invoked from early interrupt code that bypasses kcov trace function's in_task() check. Disable kcov on this file to reduce random code coverage. Link: https://lkml.kernel.org/r/20220523063033.1778974-1-liu3101@purdue.edu Acked-by: Dmitry Vyukov Signed-off-by: Congyu Liu Signed-off-by: Steven Rostedt (Google) commit 154827f8e53d8c492b3fb0cb757fbcadb5d516b5 Author: Gautam Menghani Date: Sat May 21 23:18:26 2022 -0700 tracing: Initialize integer variable to prevent garbage return value Initialize the integer variable to 0 to fix the clang scan warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn] return ret; Link: https://lkml.kernel.org/r/20220522061826.1751-1-gautammenghani201@gmail.com Cc: stable@vger.kernel.org Fixes: 8993665abcce ("tracing/boot: Support multiple handlers for per-event histogram") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Gautam Menghani Signed-off-by: Steven Rostedt (Google) commit 50c697819d59c5013a66728940015348919a0c0c Author: Julia Lawall Date: Sat May 21 13:11:31 2022 +0200 ftrace: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20220521111145.81697-81-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Steven Rostedt (Google) commit 3a2bfec0b02f2226ff3376a5d2ff604d799bd7ea Author: Li kunyu Date: Wed May 18 10:36:40 2022 +0800 ftrace: Remove return value of ftrace_arch_modify_*() All instances of the function ftrace_arch_modify_prepare() and ftrace_arch_modify_post_process() return zero. There's no point in checking their return value. Just have them be void functions. Link: https://lkml.kernel.org/r/20220518023639.4065-1-kunyu@nfschina.com Signed-off-by: Li kunyu Signed-off-by: Steven Rostedt (Google) commit 2decd16f47e3df3234b5486fe89a9aa5a1102af1 Author: liqiong Date: Fri May 13 15:52:21 2022 +0800 tracing: Cleanup code by removing init "char *name" The pointer is assigned to "type->name" anyway. no need to initialize with "preemption". Link: https://lkml.kernel.org/r/20220513075221.26275-1-liqiong@nfschina.com Signed-off-by: liqiong Signed-off-by: Steven Rostedt (Google) commit 2d601b98643dd2846e2958d931826e7b7af44969 Author: liqiong Date: Thu May 12 22:32:30 2022 +0800 tracing: Change "char *" string form to "char []" The "char []" string form declares a single variable. It is better than "char *" which creates two variables in the final assembly. Link: https://lkml.kernel.org/r/20220512143230.28796-1-liqiong@nfschina.com Signed-off-by: liqiong Signed-off-by: Steven Rostedt (Google) commit 9c556e5a4dd5cfc0939a0575577d0517118f98af Author: Daniel Bristot de Oliveira Date: Tue May 10 11:45:25 2022 +0200 tracing/timerlat: Do not wakeup the thread if the trace stops at the IRQ There is no need to wakeup the timerlat/ thread if stop tracing is hit at the timerlat's IRQ handler. Return before waking up timerlat's thread. Link: https://lkml.kernel.org/r/b392356c91b56aedd2b289513cc56a84cf87e60d.1652175637.git.bristot@kernel.org Cc: Juri Lelli Cc: Clark Williams Cc: Ingo Molnar Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 4dd2aea24ed7613735664feadc9879d37f718c23 Author: Daniel Bristot de Oliveira Date: Tue May 10 11:45:24 2022 +0200 tracing/timerlat: Print stacktrace in the IRQ handler if needed If print_stack and stop_tracing_us are set, and stop_tracing_us is hit with latency higher than or equal to print_stack, print the stack at the IRQ handler as it is useful to define the root cause for the IRQ latency. Link: https://lkml.kernel.org/r/fd04530ce98ae9270e41bb124ee5bf67b05ecfed.1652175637.git.bristot@kernel.org Cc: Juri Lelli Cc: Clark Williams Cc: Ingo Molnar Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit aa748949b4e665f473bc5abdc5f66029cb5f5522 Author: Daniel Bristot de Oliveira Date: Tue May 10 11:45:23 2022 +0200 tracing/timerlat: Notify IRQ new max latency only if stop tracing is set Currently, the notification of a new max latency is sent from timerlat's IRQ handler anytime a new max latency is found. While this behavior is not wrong, the send IPI overhead itself will increase the thread latency and that is not the desired effect (tracing overhead). Moreover, the thread will notify a new max latency again because the thread latency as it is always higher than the IRQ latency that woke it up. The only case in which it is helpful to notify a new max latency from IRQ is when stop tracing (for the IRQ) is set, as in this case, the thread will not be dispatched. Notify a new max latency from the IRQ handler only if stop tracing is set for the IRQ handler. Link: https://lkml.kernel.org/r/2c2d9a56c0886c8402ba320de32856cbbb10c2bb.1652175637.git.bristot@kernel.org Cc: Juri Lelli Cc: Ingo Molnar Reported-by: Clark Williams Fixes: a955d7eac177 ("trace: Add timerlat tracer") Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 43994049180704fd1faf78623fabd9a5cd443708 Author: Masami Hiramatsu Date: Wed May 4 12:36:31 2022 +0900 kprobes: Fix build errors with CONFIG_KRETPROBES=n Max Filippov reported: When building kernel with CONFIG_KRETPROBES=n kernel/kprobes.c compilation fails with the following messages: kernel/kprobes.c: In function ‘recycle_rp_inst’: kernel/kprobes.c:1273:32: error: implicit declaration of function ‘get_kretprobe’ kernel/kprobes.c: In function ‘kprobe_flush_task’: kernel/kprobes.c:1299:35: error: ‘struct task_struct’ has no member named ‘kretprobe_instances’ This came from the commit d741bf41d7c7 ("kprobes: Remove kretprobe hash") which introduced get_kretprobe() and kretprobe_instances member in task_struct when CONFIG_KRETPROBES=y, but did not make recycle_rp_inst() and kprobe_flush_task() depending on CONFIG_KRETPORBES. Since those functions are only used for kretprobe, move those functions into #ifdef CONFIG_KRETPROBE area. Link: https://lkml.kernel.org/r/165163539094.74407.3838114721073251225.stgit@devnote2 Reported-by: Max Filippov Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash") Cc: "Naveen N . Rao" Cc: Anil S Keshavamurthy Cc: "David S . Miller" Cc: Peter Zijlstra Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu Tested-by: Max Filippov Signed-off-by: Steven Rostedt (Google) commit b27f266f74fbda4ee36c2b2b04d15992860cf23b Author: Wonhyuk Yang Date: Tue May 3 14:05:46 2022 +0900 tracing: Fix return value of trace_pid_write() Setting set_event_pid with trailing whitespace lead to endless write system calls like below. $ strace echo "123 " > /sys/kernel/debug/tracing/set_event_pid execve("/usr/bin/echo", ["echo", "123 "], ...) = 0 ... write(1, "123 \n", 5) = 4 write(1, "\n", 1) = 0 write(1, "\n", 1) = 0 write(1, "\n", 1) = 0 write(1, "\n", 1) = 0 write(1, "\n", 1) = 0 .... This is because, the result of trace_get_user's are not returned when it read at least one pid. To fix it, update read variable even if parser->idx == 0. The result of applied patch is below. $ strace echo "123 " > /sys/kernel/debug/tracing/set_event_pid execve("/usr/bin/echo", ["echo", "123 "], ...) = 0 ... write(1, "123 \n", 5) = 5 close(1) = 0 Link: https://lkml.kernel.org/r/20220503050546.288911-1-vvghjk1234@gmail.com Cc: Ingo Molnar Cc: Baik Song An Cc: Hong Yeon Kim Cc: Taeung Song Cc: linuxgeek@linuxgeek.io Cc: stable@vger.kernel.org Fixes: 4909010788640 ("tracing: Add set_event_pid directory for future use") Signed-off-by: Wonhyuk Yang Signed-off-by: Steven Rostedt (Google) commit 99696a2592bca641eb88cc9a80c90e591afebd0f Author: Keita Suzuki Date: Mon Apr 25 06:37:38 2022 +0000 tracing: Fix potential double free in create_var_ref() In create_var_ref(), init_var_ref() is called to initialize the fields of variable ref_field, which is allocated in the previous function call to create_hist_field(). Function init_var_ref() allocates the corresponding fields such as ref_field->system, but frees these fields when the function encounters an error. The caller later calls destroy_hist_field() to conduct error handling, which frees the fields and the variable itself. This results in double free of the fields which are already freed in the previous function. Fix this by storing NULL to the corresponding fields when they are freed in init_var_ref(). Link: https://lkml.kernel.org/r/20220425063739.3859998-1-keitasuzuki.park@sslab.ics.keio.ac.jp Fixes: 067fe038e70f ("tracing: Add variable reference handling to hist triggers") CC: stable@vger.kernel.org Reviewed-by: Masami Hiramatsu Reviewed-by: Tom Zanussi Signed-off-by: Keita Suzuki Signed-off-by: Steven Rostedt (Google) commit cb24693d94ceaf658944ad2e922203c0503775d2 Author: Yuntao Wang Date: Fri Jan 21 09:56:23 2022 +0000 tracing: Use strim() to remove whitespace instead of doing it manually The tracing_set_trace_write() function just removes the trailing whitespace from the user supplied tracer name, but the leading whitespace should also be removed. In addition, if the user supplied tracer name contains only a few whitespace characters, the first one will not be removed using the current method, which results it a single whitespace character left in the buf. To fix all of these issues, we use strim() to correctly remove both the leading and trailing whitespace. Link: https://lkml.kernel.org/r/20220121095623.1826679-1-ytcoode@gmail.com Signed-off-by: Yuntao Wang Signed-off-by: Steven Rostedt (Google) commit 2889c658b2fbc7ad4c5d541734fdc1d97b130753 Author: Yuntao Wang Date: Thu Jan 20 06:59:49 2022 +0000 ftrace: Deal with error return code of the ftrace_process_locs() function The ftrace_process_locs() function may return -ENOMEM error code, which should be handled by the callers. Link: https://lkml.kernel.org/r/20220120065949.1813231-1-ytcoode@gmail.com Signed-off-by: Yuntao Wang Signed-off-by: Steven Rostedt (Google) commit e4931b824a6f36cae9cc5632709f015cfa748a25 Author: Yuntao Wang Date: Fri Jan 14 21:10:52 2022 +0800 tracing: Use trace_create_file() to simplify creation of tracefs entries Creating tracefs entries with tracefs_create_file() followed by pr_warn() is tedious and repetitive, we can use trace_create_file() to simplify this process and make the code more readable. Link: https://lkml.kernel.org/r/20220114131052.534382-1-ytcoode@gmail.com Acked-by: Masami Hiramatsu (Google) Signed-off-by: Yuntao Wang Signed-off-by: Steven Rostedt (Google) commit efc2efeba169ff37bbd425631985064365c614e0 Author: Darrick J. Wong Date: Fri May 27 10:34:04 2022 +1000 xfs: move xfs_attr_use_log_assist usage out of libxfs The LARP patchset added an awkward coupling point between libxfs and what would be libxlog, if the XFS log were actually its own library. Move the code that sets up logged xattr updates out of libxfs and into xfs_xattr.c so that libxfs no longer has to know about xlog_* functions. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit d9c61ccb3b09d8f892cccbf662ce0c870f8e4ade Author: Darrick J. Wong Date: Fri May 27 10:33:29 2022 +1000 xfs: move xfs_attr_use_log_assist out of xfs_log.c The LARP patchset added an awkward coupling point between libxfs and what would be libxlog, if the XFS log were actually its own library. Move the code that enables logged xattr updates out of "lib"xlog and into xfs_xattr.c so that it no longer has to know about xlog_* functions. While we're at it, give xfs_xattr.c its own header file. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 202865cc215d135762ea99abda7d87925b1cfc7a Author: Darrick J. Wong Date: Fri May 27 10:32:07 2022 +1000 xfs: warn about LARP once per mount Since LARP is an experimental debug-only feature, we should try to warn about it being in use once per mount, not once per reboot. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit df5660cf63bbafb5a1250954b91d9ec26558536f Author: Darrick J. Wong Date: Fri May 27 10:31:34 2022 +1000 xfs: implement per-mount warnings for scrub and shrink usage Currently, we don't have a consistent story around logging when an EXPERIMENTAL feature gets turned on at runtime -- online fsck and shrink log a message once per day across all mounts, and the recently merged LARP mode only ever does it once per insmod cycle or reboot. Because EXPERIMENTAL tags are supposed to go away eventually, convert the existing daily warnings into state flags that travel with the mount, and warn once per mount. Making this an opstate flag means that we'll be able to capture the experimental usage in the ftrace output too. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 374037966d661d62139a8b6fd33f42fc2038a1e6 Author: Darrick J. Wong Date: Fri May 27 10:29:51 2022 +1000 xfs: don't log every time we clear the log incompat flags There's no need to spam the logs every time we clear the log incompat flags -- if someone is periodically using one of these features, they'll be cleared every time the log tries to clean itself, which can get pretty chatty: $ dmesg | grep -i clear [ 5363.894711] XFS (sdd): Clearing log incompat feature flags. [ 5365.157516] XFS (sdd): Clearing log incompat feature flags. [ 5369.388543] XFS (sdd): Clearing log incompat feature flags. [ 5371.281246] XFS (sdd): Clearing log incompat feature flags. These aren't high value messages either -- nothing's gone wrong, and nobody's trying anything tricky. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 7f50d4dfe816dd916a7cbf39039674825c2b388b Merge: ba62a537b48d7 83da38d82b2f7 Author: Linus Torvalds Date: Thu May 26 17:27:49 2022 -0700 Merge tag 'for-linus' of https://github.com/openrisc/linux Pull OpenRISC updates from Stafford Horne: - A few sparse warning fixups and other cleanups I noticed when working on a recent TLB bug found on a new OpenRISC core bring up. - A few fixup's from me and Jason A Donenfeld to help shutdown OpenRISC platforms when running CI tests * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Allow power off handler overriding openrisc: Remove unused IMMU tlb workardound openrisc/fault: Fix symbol scope warnings openrisc/delay: Add include to fix symbol not declared warning openrisc/time: Fix symbol scope warnings openrisc/traps: Declare unhandled_exception for asmlinkage openrisc/traps: Remove die_if_kernel function openrisc/traps: Declare file scope symbols as static openrisc: Update litex defconfig to support glibc userland openrisc: Pretty print show_registers memory dumps openrisc: Add syscall details to emergency syscall debugging openrisc: Add support for liteuart emergency printing openrisc: Cleanup emergency print handling openrisc: Add gcc machine instruction flag configuration openrisc: define nop command for simulator reboot openrisc: remove bogus nops and shutdowns openrisc: fix typos in comments commit 910bbdf2f4d7df46781bc9b723048f5ebed3d0d7 Author: Darrick J. Wong Date: Fri May 27 10:27:19 2022 +1000 xfs: convert buf_cancel_table allocation to kmalloc_array While we're messing around with how recovery allocates and frees the buffer cancellation table, convert the allocation to use kmalloc_array instead of the old kmem_alloc APIs, and make it handle a null return, even though that's not likely. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 8db074bd84df5ccc88bff3f8f900f66f4b8349fa Author: Darrick J. Wong Date: Fri May 27 10:26:38 2022 +1000 xfs: don't leak xfs_buf_cancel structures when recovery fails If log recovery fails, we free the memory used by the buffer cancellation buckets, but we don't actually traverse each bucket list to free the individual xfs_buf_cancel objects. This leads to a memory leak, as reported by kmemleak in xfs/051: unreferenced object 0xffff888103629560 (size 32): comm "mount", pid 687045, jiffies 4296935916 (age 10.752s) hex dump (first 32 bytes): 08 d3 0a 01 00 00 00 00 08 00 00 00 01 00 00 00 ................ d0 f5 0b 92 81 88 ff ff 80 64 64 25 81 88 ff ff .........dd%.... backtrace: [] kmem_alloc+0x73/0x140 [xfs] [] xlog_recover_buf_commit_pass1+0x139/0x200 [xfs] [] xlog_recover_commit_trans+0x307/0x350 [xfs] [] xlog_recovery_process_trans+0xa5/0xe0 [xfs] [] xlog_recover_process_data+0x8d/0x140 [xfs] [] xlog_do_recovery_pass+0x19d/0x740 [xfs] [] xlog_do_log_recovery+0x6d/0x150 [xfs] [] xlog_do_recover+0x33/0x1d0 [xfs] [] xlog_recover+0xda/0x190 [xfs] [] xfs_log_mount+0x14c/0x360 [xfs] [] xfs_mountfs+0x50d/0xa60 [xfs] [] xfs_fs_fill_super+0x6a5/0x950 [xfs] [] get_tree_bdev+0x175/0x280 [] vfs_get_tree+0x1a/0x80 [] path_mount+0x6ff/0xaa0 [] __x64_sys_mount+0x103/0x140 Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 2723234923b3294dbcf6019c288c87465e927ed4 Author: Darrick J. Wong Date: Fri May 27 10:26:17 2022 +1000 xfs: refactor buffer cancellation table allocation Move the code that allocates and frees the buffer cancellation tables used by log recovery into the file that actually uses the tables. This is a precursor to some cleanups and a memory leak fix. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit ba62a537b48d7ae60524000efe01c9e76e2a5b2d Merge: ef98f9cfe20d8 6aa98f6217861 Author: Linus Torvalds Date: Thu May 26 17:24:32 2022 -0700 Merge tag 'arc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC updates from Vineet Gupta: - Basic eBPF support (Sergey) * tag 'arc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type ARC: disasm: handle ARCv2 case in kprobe get/set functions ARC: implement syscall tracepoints ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature commit a54f78def73d847cb060b18c4e4a3d1d26c9ca6d Author: Darrick J. Wong Date: Fri May 27 10:22:56 2022 +1000 xfs: don't leak btree cursor when insrec fails after a split The recent patch to improve btree cycle checking caused a regression when I rebased the in-memory btree branch atop the 5.19 for-next branch, because in-memory short-pointer btrees do not have AG numbers. This produced the following complaint from kmemleak: unreferenced object 0xffff88803d47dde8 (size 264): comm "xfs_io", pid 4889, jiffies 4294906764 (age 24.072s) hex dump (first 32 bytes): 90 4d 0b 0f 80 88 ff ff 00 a0 bd 05 80 88 ff ff .M.............. e0 44 3a a0 ff ff ff ff 00 df 08 06 80 88 ff ff .D:............. backtrace: [] xfbtree_dup_cursor+0x49/0xc0 [xfs] [] xfs_btree_dup_cursor+0x3b/0x200 [xfs] [] __xfs_btree_split+0x6ad/0x820 [xfs] [] xfs_btree_split+0x60/0x110 [xfs] [] xfs_btree_make_block_unfull+0x19a/0x1f0 [xfs] [] xfs_btree_insrec+0x3aa/0x810 [xfs] [] xfs_btree_insert+0xb3/0x240 [xfs] [] xfs_rmap_insert+0x99/0x200 [xfs] [] xfs_rmap_map_shared+0x192/0x5f0 [xfs] [] xfs_rmap_map_raw+0x6b/0x90 [xfs] [] xrep_rmap_stash+0xd5/0x1d0 [xfs] [] xrep_rmap_visit_bmbt+0xa0/0xf0 [xfs] [] xrep_rmap_scan_iext+0x56/0xa0 [xfs] [] xrep_rmap_scan_ifork+0xd8/0x160 [xfs] [] xrep_rmap_scan_inode+0x35/0x80 [xfs] [] xrep_rmap_find_rmaps+0x10e/0x270 [xfs] I noticed that xfs_btree_insrec has a bunch of debug code that return out of the function immediately, without freeing the "new" btree cursor that can be returned when _make_block_unfull calls xfs_btree_split. Fix the error return in this function to free the btree cursor. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 86d40f1e49e9a909d25c35ba01bea80dbcd758cb Author: Darrick J. Wong Date: Fri May 27 10:21:43 2022 +1000 xfs: purge dquots after inode walk fails during quotacheck xfs/434 and xfs/436 have been reporting occasional memory leaks of xfs_dquot objects. These tests themselves were the messenger, not the culprit, since they unload the xfs module, which trips the slub debugging code while tearing down all the xfs slab caches: ============================================================================= BUG xfs_dquot (Tainted: G W ): Objects remaining in xfs_dquot on __kmem_cache_shutdown() ----------------------------------------------------------------------------- Slab 0xffffea000606de00 objects=30 used=5 fp=0xffff888181b78a78 flags=0x17ff80000010200(slab|head|node=0|zone=2|lastcpupid=0xfff) CPU: 0 PID: 3953166 Comm: modprobe Tainted: G W 5.18.0-rc6-djwx #rc6 d5824be9e46a2393677bda868f9b154d917ca6a7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20171121_152543-x86-ol7-builder-01.us.oracle.com-4.el7.1 04/01/2014 Since we don't generally rmmod the xfs module between fstests, this means that xfs/434 is really just the canary in the coal mine -- something leaked a dquot, but we don't know who. After days of pounding on fstests with kmemleak enabled, I finally got it to spit this out: unreferenced object 0xffff8880465654c0 (size 536): comm "u10:4", pid 88, jiffies 4294935810 (age 29.512s) hex dump (first 32 bytes): 60 4a 56 46 80 88 ff ff 58 ea e4 5c 80 88 ff ff `JVF....X..\.... 00 e0 52 49 80 88 ff ff 01 00 01 00 00 00 00 00 ..RI............ backtrace: [] xfs_dquot_alloc+0x2c/0x530 [xfs] [] xfs_qm_dqread+0x6f/0x330 [xfs] [] xfs_qm_dqget+0x132/0x4e0 [xfs] [] xfs_qm_quotacheck_dqadjust+0xa0/0x3e0 [xfs] [] xfs_qm_dqusage_adjust+0x35d/0x4f0 [xfs] [] xfs_iwalk_ag_recs+0x348/0x5d0 [xfs] [] xfs_iwalk_run_callbacks+0x273/0x540 [xfs] [] xfs_iwalk_ag+0x5ed/0x890 [xfs] [] xfs_iwalk_ag_work+0xff/0x170 [xfs] [] xfs_pwork_work+0x79/0x130 [xfs] [] process_one_work+0x672/0x1040 [] worker_thread+0x59b/0xec0 [] kthread+0x29e/0x340 [] ret_from_fork+0x1f/0x30 Now we know that quotacheck is at fault, but even this report was canaryish -- it was triggered by xfs/494, which doesn't actually mount any filesystems. (kmemleak can be a little slow to notice leaks, even with fstests repeatedly whacking it to look for them.) Looking at the *previous* fstest, however, showed that the test run before xfs/494 was xfs/117. The tipoff to the problem is in this excerpt from dmesg: XFS (sda4): Quotacheck needed: Please wait. XFS (sda4): Metadata corruption detected at xfs_dinode_verify.part.0+0xdb/0x7b0 [xfs], inode 0x119 dinode XFS (sda4): Unmount and run xfs_repair XFS (sda4): First 128 bytes of corrupted metadata buffer: 00000000: 49 4e 81 a4 03 02 00 00 00 00 00 00 00 00 00 00 IN.............. 00000010: 00 00 00 01 00 00 00 00 00 90 57 54 54 1a 4c 68 ..........WTT.Lh 00000020: 81 f9 7d e1 6d ee 16 00 34 bd 7d e1 6d ee 16 00 ..}.m...4.}.m... 00000030: 34 bd 7d e1 6d ee 16 00 00 00 00 00 00 00 00 00 4.}.m........... 00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000050: 00 00 00 02 00 00 00 00 00 00 00 00 96 80 f3 ab ................ 00000060: ff ff ff ff da 57 7b 11 00 00 00 00 00 00 00 03 .....W{......... 00000070: 00 00 00 01 00 00 00 10 00 00 00 00 00 00 00 08 ................ XFS (sda4): Quotacheck: Unsuccessful (Error -117): Disabling quotas. The dinode verifier decided that the inode was corrupt, which causes iget to return with EFSCORRUPTED. Since this happened during quotacheck, it is obvious that the kernel aborted the inode walk on account of the corruption error and disabled quotas. Unfortunately, we neglect to purge the dquot cache before doing that, which is how the dquots leaked. The problems started 10 years ago in commit b84a3a, when the dquot lists were converted to a radix tree, but the error handling behavior was not correctly preserved -- in that commit, if the bulkstat failed and usrquota was enabled, the bulkstat failure code would be overwritten by the result of flushing all the dquots to disk. As long as that succeeds, we'd continue the quota mount as if everything were ok, but instead we're now operating with a corrupt inode and incorrect quota usage counts. I didn't notice this bug in 2019 when I wrote commit ebd126a, which changed quotacheck to skip the dqflush when the scan doesn't complete due to inode walk failures. Introduced-by: b84a3a96751f ("xfs: remove the per-filesystem list of dquots") Fixes: ebd126a651f8 ("xfs: convert quotacheck to use the new iwalk functions") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 56486f307100e8fc66efa2ebd8a71941fa10bf6f Author: Dave Chinner Date: Fri May 27 10:21:09 2022 +1000 xfs: assert in xfs_btree_del_cursor should take into account error xfs/538 on a 1kB block filesystem failed with this assert: XFS: Assertion failed: cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_ino.allocated == 0 || xfs_is_shutdown(cur->bc_mp), file: fs/xfs/libxfs/xfs_btree.c, line: 448 The problem was that an allocation failed unexpectedly in xfs_bmbt_alloc_block() after roughly 150,000 minlen allocation error injections, resulting in an EFSCORRUPTED error being returned to xfs_bmapi_write(). The error occurred on extent-to-btree format conversion allocating the new root block: RIP: 0010:xfs_bmbt_alloc_block+0x177/0x210 Call Trace: xfs_btree_new_iroot+0xdf/0x520 xfs_btree_make_block_unfull+0x10d/0x1c0 xfs_btree_insrec+0x364/0x790 xfs_btree_insert+0xaa/0x210 xfs_bmap_add_extent_hole_real+0x1fe/0x9a0 xfs_bmapi_allocate+0x34c/0x420 xfs_bmapi_write+0x53c/0x9c0 xfs_alloc_file_space+0xee/0x320 xfs_file_fallocate+0x36b/0x450 vfs_fallocate+0x148/0x340 __x64_sys_fallocate+0x3c/0x70 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xa Why the allocation failed at this point is unknown, but is likely that we ran the transaction out of reserved space and filesystem out of space with bmbt blocks because of all the minlen allocations being done causing worst case fragmentation of a large allocation. Regardless of the cause, we've then called xfs_bmapi_finish() which calls xfs_btree_del_cursor(cur, error) to tear down the cursor. So we have a failed operation, error != 0, cur->bc_ino.allocated > 0 and the filesystem is still up. The assert fails to take into account that allocation can fail with an error and the transaction teardown will shut the filesystem down if necessary. i.e. the assert needs to check "|| error != 0" as well, because at this point shutdown is pending because the current transaction is dirty.... Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit 5b55cbc2d72632e874e50d2e36bce608e55aaaea Author: Dave Chinner Date: Fri May 27 10:21:04 2022 +1000 xfs: don't assert fail on perag references on teardown Not fatal, the assert is there to catch developer attention. I'm seeing this occasionally during recoveryloop testing after a shutdown, and I don't want this to stop an overnight recoveryloop run as it is currently doing. Convert the ASSERT to a XFS_IS_CORRUPT() check so it will dump a corruption report into the log and cause a test failure that way, but it won't stop the machine dead. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit 5672225e8f2a872a22b0cecedba7a6644af1fb84 Author: Dave Chinner Date: Fri May 27 10:20:45 2022 +1000 xfs: avoid unnecessary runtime sibling pointer endian conversions Commit dc04db2aa7c9 has caused a small aim7 regression, showing a small increase in CPU usage in __xfs_btree_check_sblock() as a result of the extra checking. This is likely due to the endian conversion of the sibling poitners being unconditional instead of relying on the compiler to endian convert the NULL pointer at compile time and avoiding the runtime conversion for this common case. Rework the checks so that endian conversion of the sibling pointers is only done if they are not null as the original code did. .... and these need to be "inline" because the compiler completely fails to inline them automatically like it should be doing. $ size fs/xfs/libxfs/xfs_btree.o* text data bss dec hex filename 51874 240 0 52114 cb92 fs/xfs/libxfs/xfs_btree.o.orig 51562 240 0 51802 ca5a fs/xfs/libxfs/xfs_btree.o.inline Just when you think the tools have advanced sufficiently we don't have to care about stuff like this anymore, along comes a reminder that *our tools still suck*. Fixes: dc04db2aa7c9 ("xfs: detect self referencing btree sibling pointers") Reported-by: kernel test robot Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit ef98f9cfe20d8ca063365d46d4ab2b85eeeb324f Merge: 44d35720c9a66 7390b94a3c2d9 Author: Linus Torvalds Date: Thu May 26 17:13:43 2022 -0700 Merge tag 'modules-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull modules updates from Luis Chamberlain: - It was time to tidy up kernel/module.c and one way of starting with that effort was to split it up into files. At my request Aaron Tomlin spearheaded that effort with the goal to not introduce any functional at all during that endeavour. The penalty for the split is +1322 bytes total, +112 bytes in data, +1210 bytes in text while bss is unchanged. One of the benefits of this other than helping make the code easier to read and review is summoning more help on review for changes with livepatching so kernel/module/livepatch.c is now pegged as maintained by the live patching folks. The before and after with just the move on a defconfig on x86-64: $ size kernel/module.o text data bss dec hex filename 38434 4540 104 43078 a846 kernel/module.o $ size -t kernel/module/*.o text data bss dec hex filename 4785 120 0 4905 1329 kernel/module/kallsyms.o 28577 4416 104 33097 8149 kernel/module/main.o 1158 8 0 1166 48e kernel/module/procfs.o 902 108 0 1010 3f2 kernel/module/strict_rwx.o 3390 0 0 3390 d3e kernel/module/sysfs.o 832 0 0 832 340 kernel/module/tree_lookup.o 39644 4652 104 44400 ad70 (TOTALS) - Aaron added module unload taint tracking (MODULE_UNLOAD_TAINT_TRACKING), to enable tracking unloaded modules which did taint the kernel. - Christophe Leroy added CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC which lets architectures to request having modules data in vmalloc area instead of module area. There are three reasons why an architecture might want this: a) On some architectures (like book3s/32) it is not possible to protect against execution on a page basis. The exec stuff can be mapped by different arch segment sizes (on book3s/32 that is 256M segments). By default the module area is in an Exec segment while vmalloc area is in a NoExec segment. Using vmalloc lets you muck with module data as NoExec on those architectures whereas before you could not. b) By pushing more module data to vmalloc you also increase the probability of module text to remain within a closer distance from kernel core text and this reduces trampolines, this has been reported on arm first and powerpc folks are following that lead. c) Free'ing module_alloc() (Exec by default) area leaves this exposed as Exec by default, some architectures have some security enhancements to set this as NoExec on free, and splitting module data with text let's future generic special allocators be added to the kernel without having developers try to grok the tribal knowledge per arch. Work like Rick Edgecombe's permission vmalloc interface [0] becomes easier to address over time. [0] https://lore.kernel.org/lkml/20201120202426.18009-1-rick.p.edgecombe@intel.com/#r - Masahiro Yamada's symbol search enhancements * tag 'modules-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (33 commits) module: merge check_exported_symbol() into find_exported_symbol_in_section() module: do not binary-search in __ksymtab_gpl if fsa->gplok is false module: do not pass opaque pointer for symbol search module: show disallowed symbol name for inherit_taint() module: fix [e_shstrndx].sh_size=0 OOB access module: Introduce module unload taint tracking module: Move module_assert_mutex_or_preempt() to internal.h module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code module.h: simplify MODULE_IMPORT_NS powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx module: Remove module_addr_min and module_addr_max module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC module: Introduce data_layout module: Prepare for handling several RB trees module: Always have struct mod_tree_root module: Rename debug_align() as strict_align() module: Rework layout alignment to avoid BUG_ON()s module: Move module_enable_x() and frob_text() in strict_rwx.c module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX module: Move version support into a separate file ... commit 44d35720c9a660074b77ab9de37abf2c01c5b44f Merge: cdeffe87f790d 494dcdf46e5cd Author: Linus Torvalds Date: Thu May 26 16:57:20 2022 -0700 Merge tag 'sysctl-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull sysctl updates from Luis Chamberlain: "For two kernel releases now kernel/sysctl.c has been being cleaned up slowly, since the tables were grossly long, sprinkled with tons of #ifdefs and all this caused merge conflicts with one susbystem or another. This tree was put together to help try to avoid conflicts with these cleanups going on different trees at time. So nothing exciting on this pull request, just cleanups. Thanks a lot to the Uniontech and Huawei folks for doing some of this nasty work" * tag 'sysctl-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (28 commits) sched: Fix build warning without CONFIG_SYSCTL reboot: Fix build warning without CONFIG_SYSCTL kernel/kexec_core: move kexec_core sysctls into its own file sysctl: minor cleanup in new_dir() ftrace: fix building with SYSCTL=y but DYNAMIC_FTRACE=n fs/proc: Introduce list_for_each_table_entry for proc sysctl mm: fix unused variable kernel warning when SYSCTL=n latencytop: move sysctl to its own file ftrace: fix building with SYSCTL=n but DYNAMIC_FTRACE=y ftrace: Fix build warning ftrace: move sysctl_ftrace_enabled to ftrace.c kernel/do_mount_initrd: move real_root_dev sysctls to its own file kernel/delayacct: move delayacct sysctls to its own file kernel/acct: move acct sysctls to its own file kernel/panic: move panic sysctls to its own file kernel/lockdep: move lockdep sysctls to its own file mm: move page-writeback sysctls to their own file mm: move oom_kill sysctls to their own file kernel/reboot: move reboot sysctls to its own file sched: Move energy_aware sysctls to topology.c ... commit cdeffe87f790dfd1baa193020411ce9a538446d7 Merge: 7182e897695d5 79f9fbe303520 Author: Linus Torvalds Date: Thu May 26 14:57:25 2022 -0700 Merge tag 'mailbox-v5.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: "api: - hrtimer fix qcom: - log pending irq during resume - minor cosmetic changes omap: - use pm_runtime_resume_and_get imx: - use pm_runtime_resume_and_get - remove redundant initializer mtk: - added GCE header for MT8186 - enable support for MT8186 tegra: - remove redundant NULL check - added hsp_sm_ops for send/recv api - support shared mailboxes stm: - remove unsupported "wakeup" irq pcc: - sanitize mbox allocated memory before use misc: - documentation fixes for arm_mhu and qcom-ipcc" * tag 'mailbox-v5.19' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: qcom-ipcc: Fix -Wunused-function with CONFIG_PM_SLEEP=n mailbox: forward the hrtimer if not queued and under a lock mailbox: qcom-ipcc: Log the pending interrupt during resume mailbox: pcc: Fix an invalid-load caught by the address sanitizer dt-bindings: mailbox: remove the IPCC "wakeup" IRQ mailbox: correct kerneldoc mailbox: omap: using pm_runtime_resume_and_get to simplify the code mailbox:imx: using pm_runtime_resume_and_get mailbox: mediatek: support mt8186 adsp mailbox dt-bindings: mailbox: mtk,adsp-mbox: add mt8186 compatible name mailbox: tegra-hsp: Add 128-bit shared mailbox support dt-bindings: tegra186-hsp: add type for shared mailboxes mailbox: tegra-hsp: Add tegra_hsp_sm_ops dt-bindings: gce: add the GCE header file for MT8186 mailbox: remove an unneeded NULL check on list iterator mailbox: imx: remove redundant initializer dt-bindings: mailbox: qcom-ipcc: simplify the example commit 7182e897695d5b70fb772736f1f08639ca0fff78 Merge: f1f88bb51f1ae 5a7cb9f3978d1 Author: Linus Torvalds Date: Thu May 26 14:51:38 2022 -0700 Merge tag 'gpio-updates-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have lots of small changes all over the place, but no huge reworks or new drivers: - use ioread()/iowrite() interfaces instead of raw inb()/outb() in drivers - make irqchips immutable due to the new warning popping up when drivers try to modify the irqchip structures - add new compatibles to dt-bindings for realtek-otto, renesas-rcar and pca95xx - add support for new models to gpio-rcar, gpio-pca953x & gpio-realtek-otto - allow parsing of GPIO hogs represented as children nodes of gpio-uniphier - define a set of common GPIO consumer strings in dt-bindings - shrink code in gpio-ml-ioh by using more devres interfaces - pass arguments to devm_kcalloc() in correct order in gpio-sim - add new helpers for iterating over GPIO firmware nodes and descriptors to gpiolib core and use it in several drivers - drop unused syscon_regmap_lookup_by_compatible() function - correct format specifiers and signedness of variables in GPIO ACPI - drop unneeded error checks in gpio-ftgpio - stop using the deprecated of_gpio.h header in gpio-zevio - drop platform_data support in gpio-max732x - simplify Kconfig dependencies in gpio-vf610 - use raw spinlocks where needed to make PREEMPT_RT happy - fix return values in board files using gpio-pcf857x - convert more drivers to using fwnode instead of of_node - minor fixes and improvements in gpiolib core" * tag 'gpio-updates-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (55 commits) gpio: sifive: Make the irqchip immutable gpio: rcar: Make the irqchip immutable gpio: pcf857x: Make the irqchip immutable gpio: pca953x: Make the irqchip immutable gpio: dwapb: Make the irqchip immutable gpio: sim: Use correct order for the parameters of devm_kcalloc() gpio: ml-ioh: Convert to use managed functions pcim* and devm_* gpio: ftgpio: Remove unneeded ERROR check before clk_disable_unprepare gpio: ws16c48: Utilize iomap interface gpio: gpio-mm: Utilize iomap interface gpio: 104-idio-16: Utilize iomap interface gpio: 104-idi-48: Utilize iomap interface gpio: 104-dio-48e: Utilize iomap interface gpio: zevio: drop of_gpio.h header gpio: max77620: Make the irqchip immutable dt-bindings: gpio: pca95xx: add entry for pca6408 gpio: pca953xx: Add support for pca6408 gpio: max732x: Drop unused support for irq and setup code via platform data gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610 gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible ... commit f1f88bb51f1ae9d7eec9ef871355dea033bac02d Merge: b1c8312c6bd70 abd4fd43f2af0 Author: Linus Torvalds Date: Thu May 26 14:46:01 2022 -0700 Merge tag 'tag-chrome-platform-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Tzung-Bi Shih: "cros_ec: - Fix wrong error handling path - Clean-up patches cros_ec_chardev: - Re-introduce cros_ec_cmd_xfer to fix ABI broken cros_ec_lpcs: - Support the Framework Laptop cros_ec_typec: - Fix NULL dereference chromeos_acpi: - Add ChromeOS ACPI device driver - Fix Sphinx errors when `make htmldocs` misc: - Drop BUG_ON()s" * tag 'tag-chrome-platform-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: Use imperative mood for ChromeOS ACPI sysfs ABI descriptions platform/chrome: Use tables for values lists of ChromeOS ACPI sysfs ABI platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough platform/chrome: cros_ec_spi: drop unneeded BUG_ON() platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c() platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_get_host_event() platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_prepare_tx() platform/chrome: correct cros_ec_prepare_tx() usage platform/chrome: cros_ec_proto: drop unneeded BUG_ON() in prepare_packet() platform/chrome: Add ChromeOS ACPI device driver platform/chrome: cros_ec_typec: Check for EC driver platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first platform/chrome: cros_ec_lpcs: detect the Framework Laptop platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls platform/chrome: cros_ec: append newline to all logs platform/chrome: cros_ec: sort header inclusion alphabetically platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend() platform/chrome: cros_ec: remove unused variable `was_wake_device` platform/chrome: cros_ec: fix error handling in cros_ec_register() commit 4e2bbecd71d9c01e70ec184791b9594978735b5d Merge: 324373f476936 d9e418d0ca1c4 Author: Palmer Dabbelt Date: Thu May 26 14:35:07 2022 -0700 RISC-V: Various XIP fixes This fixes a handful of issues with the XIP support, which has bit rotted some lately. * palmer/riscv-xip: RISC-V: Fix the XIP build RISC-V: Split out the XIP fixups into their own file RISC-V: ignore xipImage RISC-V: Avoid empty create_*_mapping definitions commit b1c8312c6bd70e2c41f96183936fdb6f4f07cc0e Author: Sean Young Date: Thu May 26 08:59:40 2022 +0100 media: lirc: add missing exceptions for lirc uapi header file Commit e5499dd7253c ("media: lirc: revert removal of unused feature flags") reintroduced unused feature flags in the lirc uapi header, but failed to reintroduce the necessary exceptions for the docs. Fixes: e5499dd7253c ("media: lirc: revert removal of unused feature flags") Signed-off-by: Sean Young Signed-off-by: Linus Torvalds commit bf9095424d027e942e1d1ee74977e17b7df8e455 Merge: 98931dd95fd48 ffd1925a596ce Author: Linus Torvalds Date: Thu May 26 14:20:14 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "S390: - ultravisor communication device driver - fix TEID on terminating storage key ops RISC-V: - Added Sv57x4 support for G-stage page table - Added range based local HFENCE functions - Added remote HFENCE functions based on VCPU requests - Added ISA extension registers in ONE_REG interface - Updated KVM RISC-V maintainers entry to cover selftests support ARM: - Add support for the ARMv8.6 WFxT extension - Guard pages for the EL2 stacks - Trap and emulate AArch32 ID registers to hide unsupported features - Ability to select and save/restore the set of hypercalls exposed to the guest - Support for PSCI-initiated suspend in collaboration with userspace - GICv3 register-based LPI invalidation support - Move host PMU event merging into the vcpu data structure - GICv3 ITS save/restore fixes - The usual set of small-scale cleanups and fixes x86: - New ioctls to get/set TSC frequency for a whole VM - Allow userspace to opt out of hypercall patching - Only do MSR filtering for MSRs accessed by rdmsr/wrmsr AMD SEV improvements: - Add KVM_EXIT_SHUTDOWN metadata for SEV-ES - V_TSC_AUX support Nested virtualization improvements for AMD: - Support for "nested nested" optimizations (nested vVMLOAD/VMSAVE, nested vGIF) - Allow AVIC to co-exist with a nested guest running - Fixes for LBR virtualizations when a nested guest is running, and nested LBR virtualization support - PAUSE filtering for nested hypervisors Guest support: - Decoupling of vcpu_is_preempted from PV spinlocks" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (199 commits) KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest KVM: selftests: x86: Sync the new name of the test case to .gitignore Documentation: kvm: reorder ARM-specific section about KVM_SYSTEM_EVENT_SUSPEND x86, kvm: use correct GFP flags for preemption disabled KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer x86/kvm: Alloc dummy async #PF token outside of raw spinlock KVM: x86: avoid calling x86 emulator without a decoded instruction KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel data leak x86/fpu: KVM: Set the base guest FPU uABI size to sizeof(struct kvm_xsave) s390/uv_uapi: depend on CONFIG_S390 KVM: selftests: x86: Fix test failure on arch lbr capable platforms KVM: LAPIC: Trace LAPIC timer expiration on every vmentry KVM: s390: selftest: Test suppression indication on key prot exception KVM: s390: Don't indicate suppression on dirtying, failing memop selftests: drivers/s390x: Add uvdevice tests drivers/s390/char: Add Ultravisor io device MAINTAINERS: Update KVM RISC-V entry to cover selftests support RISC-V: KVM: Introduce ISA extension register RISC-V: KVM: Cleanup stale TLB entries when host CPU changes RISC-V: KVM: Add remote HFENCE functions based on VCPU requests ... commit 558254b0b602b8605d7246a10cfeb584b1fcabfc Author: Phil Sutter Date: Tue May 24 14:50:01 2022 +0200 netfilter: nft_limit: Clone packet limits' cost value When cloning a packet-based limit expression, copy the cost value as well. Otherwise the new limit is not functional anymore. Fixes: 3b9e2ea6c11bf ("netfilter: nft_limit: move stateful fields out of expression data") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 520778042ccca019f3ffa136dd0ca565c486cedd Author: Pablo Neira Ayuso Date: Wed May 25 10:36:38 2022 +0200 netfilter: nf_tables: disallow non-stateful expression in sets earlier Since 3e135cd499bf ("netfilter: nft_dynset: dynamic stateful expression instantiation"), it is possible to attach stateful expressions to set elements. cd5125d8f518 ("netfilter: nf_tables: split set destruction in deactivate and destroy phase") introduces conditional destruction on the object to accomodate transaction semantics. nft_expr_init() calls expr->ops->init() first, then check for NFT_STATEFUL_EXPR, this stills allows to initialize a non-stateful lookup expressions which points to a set, which might lead to UAF since the set is not properly detached from the set->binding for this case. Anyway, this combination is non-sense from nf_tables perspective. This patch fixes this problem by checking for NFT_STATEFUL_EXPR before expr->ops->init() is called. The reporter provides a KASAN splat and a poc reproducer (similar to those autogenerated by syzbot to report use-after-free errors). It is unknown to me if they are using syzbot or if they use similar automated tool to locate the bug that they are reporting. For the record, this is the KASAN splat. [ 85.431824] ================================================================== [ 85.432901] BUG: KASAN: use-after-free in nf_tables_bind_set+0x81b/0xa20 [ 85.433825] Write of size 8 at addr ffff8880286f0e98 by task poc/776 [ 85.434756] [ 85.434999] CPU: 1 PID: 776 Comm: poc Tainted: G W 5.18.0+ #2 [ 85.436023] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Fixes: 0b2d8a7b638b ("netfilter: nf_tables: add helper functions for expression handling") Reported-and-tested-by: Aaron Adams Signed-off-by: Pablo Neira Ayuso commit 98931dd95fd489fcbfa97da563505a6f071d7c77 Merge: df202b452fe6c f403f22f8ccb1 Author: Linus Torvalds Date: Thu May 26 12:32:41 2022 -0700 Merge tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull MM updates from Andrew Morton: "Almost all of MM here. A few things are still getting finished off, reviewed, etc. - Yang Shi has improved the behaviour of khugepaged collapsing of readonly file-backed transparent hugepages. - Johannes Weiner has arranged for zswap memory use to be tracked and managed on a per-cgroup basis. - Munchun Song adds a /proc knob ("hugetlb_optimize_vmemmap") for runtime enablement of the recent huge page vmemmap optimization feature. - Baolin Wang contributes a series to fix some issues around hugetlb pagetable invalidation. - Zhenwei Pi has fixed some interactions between hwpoisoned pages and virtualization. - Tong Tiangen has enabled the use of the presently x86-only page_table_check debugging feature on arm64 and riscv. - David Vernet has done some fixup work on the memcg selftests. - Peter Xu has taught userfaultfd to handle write protection faults against shmem- and hugetlbfs-backed files. - More DAMON development from SeongJae Park - adding online tuning of the feature and support for monitoring of fixed virtual address ranges. Also easier discovery of which monitoring operations are available. - Nadav Amit has done some optimization of TLB flushing during mprotect(). - Neil Brown continues to labor away at improving our swap-over-NFS support. - David Hildenbrand has some fixes to anon page COWing versus get_user_pages(). - Peng Liu fixed some errors in the core hugetlb code. - Joao Martins has reduced the amount of memory consumed by device-dax's compound devmaps. - Some cleanups of the arch-specific pagemap code from Anshuman Khandual. - Muchun Song has found and fixed some errors in the TLB flushing of transparent hugepages. - Roman Gushchin has done more work on the memcg selftests. ... and, of course, many smaller fixes and cleanups. Notably, the customary million cleanup serieses from Miaohe Lin" * tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (381 commits) mm: kfence: use PAGE_ALIGNED helper selftests: vm: add the "settings" file with timeout variable selftests: vm: add "test_hmm.sh" to TEST_FILES selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests selftests: vm: add migration to the .gitignore selftests/vm/pkeys: fix typo in comment ksm: fix typo in comment selftests: vm: add process_mrelease tests Revert "mm/vmscan: never demote for memcg reclaim" mm/kfence: print disabling or re-enabling message include/trace/events/percpu.h: cleanup for "percpu: improve percpu_alloc_percpu event trace" include/trace/events/mmflags.h: cleanup for "tracing: incorrect gfp_t conversion" mm: fix a potential infinite loop in start_isolate_page_range() MAINTAINERS: add Muchun as co-maintainer for HugeTLB zram: fix Kconfig dependency warning mm/shmem: fix shmem folio swapoff hang cgroup: fix an error handling path in alloc_pagecache_max_30M() mm: damon: use HPAGE_PMD_SIZE tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate nodemask.h: fix compilation error with GCC12 ... commit dada03db9bb1984826e61cfcf1418ac73848324d Author: Daniel Bristot de Oliveira Date: Fri May 13 08:45:53 2022 +0200 rtla: Remove procps-ng dependency Daniel Wagner reported to me that readproc.h got deprecated. Also, while the procps-ng library was available on Fedora, it was not available on RHEL, which is a piece of evidence that it was not that used. rtla uses procps-ng only to find the PID of the tracers' workload. I used the procps-ng library to avoid reinventing the wheel. But in this case, reinventing the wheel took me less time than the time we already took trying to work around problems. Implement a function that reads /proc/ entries, checking if: - the entry is a directory - the directory name is composed only of digits (PID) - the directory contains the comm file - the comm file contains a comm that matches the tracers' workload prefix. - then return true; otherwise, return false. And use it instead of procps-ng. Link: https://lkml.kernel.org/r/e8276e122ee9eb2c5a0ba8e673fb6488b924b825.1652423574.git.bristot@kernel.org Cc: John Kacur Cc: Steven Rostedt Cc: Tao Zhou Fixes: b1696371d865 ("rtla: Helper functions for rtla") Reported-by: Daniel Wagner Reviewed-by: Daniel Wagner Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 941a53c39a151e9aceef153cdfaed0f166ba01b7 Author: Daniel Bristot de Oliveira Date: Fri Apr 29 18:28:13 2022 +0200 rtla: Fix __set_sched_attr error message rtla's function __set_sched_attr() was borrowed from stalld, but I forgot to update the error message to something meaningful for rtla. Update the error message from: boost_with_deadline failed to boost pid PID: STRERROR to a proper one: Failed to set sched attributes to the pid PID: STRERROR Link: https://lkml.kernel.org/r/a2d19b2c53f6512aefd1ee7f8c1bd19d4fc8b99d.1651247710.git.bristot@kernel.org Link: https://lore.kernel.org/r/eeded730413e7feaa13f946924bcf2cbf7dd9561.1650617571.git.bristot@kernel.org/ Fixes: b1696371d865 ("rtla: Helper functions for rtla") Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 22d146f7c1e97f4870e4497c0202939a031f740c Author: John Kacur Date: Fri Apr 29 18:28:12 2022 +0200 rtla: Minor grammar fix for rtla README - Change to "The rtla meta-tool includes" - Remove an unnecessary "But, " - Adjust the formatting of the paragraph resulting from the changes. - Simplify the wording for the libraries and tools. Link: https://lkml.kernel.org/r/437f0accdde53713ab3cce46f3564be00487e031.1651247710.git.bristot@kernel.org Link: https://lore.kernel.org/r/20220408161012.10544-1-jkacur@redhat.com/ Cc: Daniel Bristot de Oliveria Fixes: 79ce8f43ac5a ("rtla: Real-Time Linux Analysis tool") Acked-by: Daniel Bristot de Oliveira Signed-off-by: John Kacur Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 39c3d84cb5b52792a7323a338334d8d65b2dbe3f Author: John Kacur Date: Fri Apr 29 18:28:11 2022 +0200 rtla: Don't overwrite existing directory mode The mode on /usr/bin is often 555 these days, but make install on rtla overwrites this with 755 Fix this by preserving the current directory if it exists. Link: https://lkml.kernel.org/r/8c294a6961080a1970fd8b73f7bcf1e3984579e2.1651247710.git.bristot@kernel.org Link: https://lore.kernel.org/r/20220402043939.6962-1-jkacur@redhat.com Cc: Daniel Bristot de Oliveria Fixes: 79ce8f43ac5a ("rtla: Real-Time Linux Analysis tool") Acked-by: Daniel Bristot de Oliveira Signed-off-by: John Kacur Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 2a6b52ed72c822b5ee146a6a00ea66614fe02653 Author: Wan Jiabing Date: Fri Apr 29 18:28:10 2022 +0200 rtla: Avoid record NULL pointer dereference Fix the following null/deref_null.cocci errors: ./tools/tracing/rtla/src/osnoise_hist.c:870:31-36: ERROR: record is NULL but dereferenced. ./tools/tracing/rtla/src/osnoise_top.c:650:31-36: ERROR: record is NULL but dereferenced. ./tools/tracing/rtla/src/timerlat_hist.c:905:31-36: ERROR: record is NULL but dereferenced. ./tools/tracing/rtla/src/timerlat_top.c:700:31-36: ERROR: record is NULL but dereferenced. "record" is NULL before calling osnoise_init_trace_tool. Add a tag "out_free" to avoid dereferring a NULL pointer. Link: https://lkml.kernel.org/r/ae0e4500d383db0884eb2820286afe34ca303778.1651247710.git.bristot@kernel.org Link: https://lore.kernel.org/r/20220408151406.34823-1-wanjiabing@vivo.com/ Cc: kael_w@yeah.net Cc: Daniel Bristot de Oliveira Fixes: 51d64c3a1819 ("rtla: Add -e/--event support") Acked-by: Daniel Bristot de Oliveira Signed-off-by: Wan Jiabing Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit fe4d0d5dde457bb5832b866418b5036f4f0c8d13 Author: Daniel Bristot de Oliveira Date: Fri Apr 29 16:54:58 2022 +0200 rtla/Makefile: Properly handle dependencies Linus had a problem compiling RTLA, saying: "[...] I wish the tracing tools would do a bit more package checking and helpful error messages too, rather than just fail with: fatal error: tracefs.h: No such file or directory" Which is indeed not a helpful message. Update the Makefile, adding proper checks for the dependencies, with useful information about how to resolve possible problems. For example, the previous error is now reported as: $ make ******************************************** ** NOTICE: libtracefs version 1.3 or higher not found ** ** Consider installing the latest libtracefs from your ** distribution, e.g., 'dnf install libtracefs' on Fedora, ** or from source: ** ** https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ ** ******************************************** These messages are inspired by the ones used on trace-cmd, as suggested by Stevel Rostedt. Link: https://lore.kernel.org/r/CAHk-=whxmA86E=csNv76DuxX_wYsg8mW15oUs3XTabu2Yc80yw@mail.gmail.com/ Changes from V1: - Moved the rst2man check to the install phase (when it is used). - Removed the procps-ng lib check [1] as it is being removed. [1] a0f9f8c1030c66305c9b921057c3d483064d5529.1651220820.git.bristot@kernel.org Link: https://lkml.kernel.org/r/3f1fac776c37e4b67c876a94e5a0e45ed022ff3d.1651238057.git.bristot@kernel.org Cc: Ingo Molnar Cc: Andrew Morton Reported-by: Linus Torvalds Suggested-by: Steven Rostedt Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit df202b452fe6c6d6f1351bad485e2367ef1e644e Merge: 16477cdfefdb4 5ce2176b81f77 Author: Linus Torvalds Date: Thu May 26 12:09:50 2022 -0700 Merge tag 'kbuild-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Add HOSTPKG_CONFIG env variable to allow users to override pkg-config - Support W=e as a shorthand for KCFLAGS=-Werror - Fix CONFIG_IKHEADERS build to support toybox cpio - Add scripts/dummy-tools/pahole to ease distro packagers' life - Suppress false-positive warnings from checksyscalls.sh for W=2 build - Factor out the common code of arch/*/boot/install.sh into scripts/install.sh - Support 'kernel-install' tool in scripts/prune-kernel - Refactor module-versioning to link the symbol versions at the final link of vmlinux and modules - Remove CONFIG_MODULE_REL_CRCS because module-versioning now works in an arch-agnostic way - Refactor modpost, Makefiles * tag 'kbuild-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (56 commits) genksyms: adjust the output format to modpost kbuild: stop merging *.symversions kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS modpost: extract symbol versions from *.cmd files modpost: add sym_find_with_module() helper modpost: change the license of EXPORT_SYMBOL to bool type modpost: remove left-over cross_compile declaration kbuild: record symbol versions in *.cmd files kbuild: generate a list of objects in vmlinux modpost: move *.mod.c generation to write_mod_c_files() modpost: merge add_{intree_flag,retpoline,staging_flag} to add_header scripts/prune-kernel: Use kernel-install if available kbuild: factor out the common installation code into scripts/install.sh modpost: split new_symbol() to symbol allocation and hash table addition modpost: make sym_add_exported() always allocate a new symbol modpost: make multiple export error modpost: dump Module.symvers in the same order of modules.order modpost: traverse the namespace_list in order modpost: use doubly linked list for dump_lists modpost: traverse unresolved symbols in order ... commit 9bdc1992c925a35c6f7200e8abe54e3f00ce7719 Author: Christian König Date: Tue May 10 18:29:35 2022 +0200 drm/amdgpu: add drm-client-id to fdinfo v2 This is enough to get gputop working :) v2: rebase and some addition cleanup Signed-off-by: Christian König Reviewed-by: Shashank Sharma (v1) Signed-off-by: Alex Deucher commit af0b541670090e87996e0894bd0e457edf617541 Author: Christian König Date: Wed May 11 11:06:26 2022 +0200 drm/amdgpu: Convert to common fdinfo format v5 Convert fdinfo format to one documented in drm-usage-stats.rst. It turned out that the existing implementation was actually completely nonsense. The calculated percentages indeed represented the usage of the engine, but with varying time slices. So 10% usage for application A could mean something completely different than 10% usage for application B. Completely nuke that and just use the now standardized nanosecond interface. v2: drop the documentation change for now, nuke percentage calculation v3: only account for each hw_ip, move the time_spend to the ctx mgr. v4: move general ctx changes into separate patch, rework the fdinfo to ctx_mgr interface so that all usages are calculated at once, drop some unecessary and dangerous refcount dance. v5: add one more comment how we calculate the time spend Signed-off-by: Tvrtko Ursulin Signed-off-by: Christian König Reviewed-by: Shashank Sharma Cc: Daniel Vetter Signed-off-by: Alex Deucher commit 08cffb3eb731fefd0dea12424cedbfa63c356ee0 Author: Christian König Date: Fri May 6 13:21:28 2022 +0200 drm/amdgpu: bump minor version number Increase the minor version number to indicate that the new flags are available. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher commit b6c65a2c92aa880e8050a91ca83288b85fc32575 Author: Christian König Date: Fri May 6 13:11:41 2022 +0200 drm/amdgpu: add AMDGPU_VM_NOALLOC v2 Add the AMDGPU_VM_NOALLOC flag to let userspace control MALL allocation. v2: also add the flag to the allowed flags. Signed-off-by: Christian König Reviewed-by: Alex Deucher (v1) Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher commit fab2cc8335839867a3db38f195441b9c7c6460f6 Author: Christian König Date: Fri May 6 13:08:34 2022 +0200 drm/amdgpu: add AMDGPU_GEM_CREATE_DISCARDABLE Add a AMDGPU_GEM_CREATE_DISCARDABLE flag to note that the content of a BO doesn't needs to be preserved during eviction. KFD was already using a similar functionality for SVM BOs so replace the internal flag with the new UAPI. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Marek Olšák Signed-off-by: Alex Deucher commit 62e9bd20035b53ff6c679499c08546d96c6c60a7 Author: Alex Deucher Date: Tue May 24 23:23:59 2022 -0400 drm/amdgpu: add beige goby PCI ID Add a beige goby PCI ID. Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 39dbde650f9377f97ad985bfa16af93381766232 Author: Lijo Lazar Date: Tue May 24 17:35:55 2022 +0530 drm/amd/pm: Return auto perf level, if unsupported When powerplay is not enabled, return AUTO as default level. Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6bd8d4b7d511f00a9e02f89b250fba3013200843 Author: Julia Lawall Date: Sat May 21 13:11:24 2022 +0200 drm/amdkfd: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Alex Deucher commit ab5a7fb6d2296b9486d17d1e24f4bde90822e644 Author: Julia Lawall Date: Sat May 21 13:11:14 2022 +0200 drm/amdgpu/gfx: fix typos in comments Spelling mistakes (triple letters) in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Alex Deucher commit 31ab27b14daaa75541a415c6794d6f3567fea44a Author: Dave Airlie Date: Mon May 23 10:24:18 2022 +1000 drm/amdgpu/cs: make commands with 0 chunks illegal behaviour. Submitting a cs with 0 chunks, causes an oops later, found trying to execute the wrong userspace driver. MESA_LOADER_DRIVER_OVERRIDE=v3d glxinfo [172536.665184] BUG: kernel NULL pointer dereference, address: 00000000000001d8 [172536.665188] #PF: supervisor read access in kernel mode [172536.665189] #PF: error_code(0x0000) - not-present page [172536.665191] PGD 6712a0067 P4D 6712a0067 PUD 5af9ff067 PMD 0 [172536.665195] Oops: 0000 [#1] SMP NOPTI [172536.665197] CPU: 7 PID: 2769838 Comm: glxinfo Tainted: P O 5.10.81 #1-NixOS [172536.665199] Hardware name: To be filled by O.E.M. To be filled by O.E.M./CROSSHAIR V FORMULA-Z, BIOS 2201 03/23/2015 [172536.665272] RIP: 0010:amdgpu_cs_ioctl+0x96/0x1ce0 [amdgpu] [172536.665274] Code: 75 18 00 00 4c 8b b2 88 00 00 00 8b 46 08 48 89 54 24 68 49 89 f7 4c 89 5c 24 60 31 d2 4c 89 74 24 30 85 c0 0f 85 c0 01 00 00 <48> 83 ba d8 01 00 00 00 48 8b b4 24 90 00 00 00 74 16 48 8b 46 10 [172536.665276] RSP: 0018:ffffb47c0e81bbe0 EFLAGS: 00010246 [172536.665277] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [172536.665278] RDX: 0000000000000000 RSI: ffffb47c0e81be28 RDI: ffffb47c0e81bd68 [172536.665279] RBP: ffff936524080010 R08: 0000000000000000 R09: ffffb47c0e81be38 [172536.665281] R10: ffff936524080010 R11: ffff936524080000 R12: ffffb47c0e81bc40 [172536.665282] R13: ffffb47c0e81be28 R14: ffff9367bc410000 R15: ffffb47c0e81be28 [172536.665283] FS: 00007fe35e05d740(0000) GS:ffff936c1edc0000(0000) knlGS:0000000000000000 [172536.665284] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [172536.665286] CR2: 00000000000001d8 CR3: 0000000532e46000 CR4: 00000000000406e0 [172536.665287] Call Trace: [172536.665322] ? amdgpu_cs_find_mapping+0x110/0x110 [amdgpu] [172536.665332] drm_ioctl_kernel+0xaa/0xf0 [drm] [172536.665338] drm_ioctl+0x201/0x3b0 [drm] [172536.665369] ? amdgpu_cs_find_mapping+0x110/0x110 [amdgpu] [172536.665372] ? selinux_file_ioctl+0x135/0x230 [172536.665399] amdgpu_drm_ioctl+0x49/0x80 [amdgpu] [172536.665403] __x64_sys_ioctl+0x83/0xb0 [172536.665406] do_syscall_64+0x33/0x40 [172536.665409] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2018 Signed-off-by: Dave Airlie Cc: stable@vger.kernel.org Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d534ca7128d7bf681ed6d462c09b9d6ffb3bed91 Author: Alex Deucher Date: Mon May 23 11:24:31 2022 -0400 drm/amdgpu: differentiate between LP and non-LP DDR memory Some applications want to know whether the memory is LP or not. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a5457087eb10322864dedb7768b7a95332393efe Author: Candice Li Date: Fri May 20 20:51:53 2022 +0800 drm/amdgpu: Resolve pcie_bif RAS recovery bug Check shared buf instead of init flag for xgmi ta shared buf init during xgmi ta initialization. Signed-off-by: Candice Li Reviewed-by: John Clements Signed-off-by: Alex Deucher commit 1c755241463bab5d90404a782abf3baf7b7a3217 Author: Prike Liang Date: Fri May 20 11:04:35 2022 +0800 drm/amdgpu: clean up asd on the ta_firmware_header_v2_0 On the psp13 series use ta_firmware_header_v2_0 and the asd firmware was buildin ta, so needn't request asd firmware separately. Signed-off-by: Prike Liang Reviewed-by: Yifan Zhang Acked-by: Huang Rui Signed-off-by: Alex Deucher commit a0ccc717c4ab3ef572f023fdceffb4b6df496a0d Author: Alex Deucher Date: Mon May 16 14:12:33 2022 -0400 drm/amdgpu/discovery: validate VCN and SDMA instances Validate the VCN and SDMA instances against the driver structure sizes to make sure we don't get into a situation where the firmware reports more instances than the driver supports. Reviewed-by: Guchun Chen Acked-by: Christian König Signed-off-by: Alex Deucher commit 76818cdd11a25ac6cb1d98875719935d8d0e2e51 Author: Sung Joon Kim Date: Thu May 19 17:46:36 2022 -0400 drm/amd/display: add Coverage blend mode for overlay plane According to the KMS man page, there is a "Coverage" alpha blend mode that assumes the pixel color values have NOT been pre-multiplied and will be done when the actual blending to the background color values happens. Previously, this mode hasn't been enabled in our driver and it was assumed that all normal overlay planes are pre-multiplied by default. When a 3rd party app is used to input a image in a specific format, e.g. PNG, as a source of a overlay plane to blend with the background primary plane, the pixel color values are not pre-multiplied. So by adding "Coverage" blend mode, our driver will support those cases. Issue fixed: Overlay plane alpha channel blending is incorrect Issue tracker: https://gitlab.freedesktop.org/drm/amd/-/issues/1769 Reference: https://dri.freedesktop.org/docs/drm/gpu/drm-kms.html#plane-composition-properties Adding Coverage support also enables IGT kms_plane_alpha_blend Coverage subtests: 1. coverage-7efc 2. coverage-vs-premult-vs-constant Changes 1. Add DRM_MODE_BLEND_COVERAGE blend mode capability 2. Add "pre_multiplied_alpha" flag for Coverage case 3. Read the correct flag and set the DCN MPCC pre_multiplied register bit (only on overlay plane) Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1769 Signed-off-by: Sung Joon Kim Reviewed-by: Melissa Wen Signed-off-by: Alex Deucher commit a35faec3db0e13aac8ea720bc1a3503081dd5a3d Author: Dan Carpenter Date: Mon May 16 10:05:48 2022 +0300 drm/amdgpu: Off by one in dm_dmub_outbox1_low_irq() The > ARRAY_SIZE() should be >= ARRAY_SIZE() to prevent an out of bounds access. Fixes: e27c41d5b068 ("drm/amd/display: Support for DMUB HPD interrupt handling") Reviewed-by: Harry Wentland Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit caa5eadc140ca3748b2ae187da36383edc779300 Author: Evan Quan Date: Thu May 19 17:28:12 2022 +0800 drm/amdgpu: suppress some compile warnings Suppress two compile warnings about "no previous prototype". Reported-by: kernel test robot Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 396beb91a9eb86cbfa404e4220cca8f3ada70777 Author: Evan Quan Date: Wed Apr 6 14:14:50 2022 +0800 drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13 Correct the metrics version used for SMU 11.0.11/12/13. Fixes misreported GPU metrics (e.g., fan speed, etc.) depending on which version of SMU firmware is loaded. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1925 Signed-off-by: Evan Quan Signed-off-by: Alex Deucher commit 6a8170383c7acdf6fb8da1f3774fa2bc9191d628 Author: Jay Cornwall Date: Thu Dec 30 21:32:06 2021 +0800 drm/amdkfd: Add gfx11 trap handler Based on gfx10 with following changes: - GPR_ALLOC.VGPR_SIZE field moved (and size corrected in gfx10) - s_sendmsg_rtn_b64 replaces some s_sendmsg/s_getreg - Buffer instructions no longer have direct-to-LDS modifier Signed-off-by: Jay Cornwall Reviewed-by: Laurent Morichetti Signed-off-by: Eric Huang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 5e613723f804658feb689be1b3cb88ceeed234d3 Author: Eric Huang Date: Mon May 16 14:22:38 2022 -0400 drm/amdkfd: port cwsr trap handler from dkms branch Most of changes are for debugger feature, and it is to simplify trap handler support for new asics in the future. Signed-off-by: Eric Huang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6880ed280edf292c542aa87567547ffb9c222597 Author: Alan Liu Date: Tue May 17 22:30:00 2022 +0800 drm/amd/display: Add HDMI_ACP_SEND register Define HDMI_ACP_SEND register shift/mask. Signed-off-by: Alan Liu Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b0f4d663fce6a4232d3c20ce820f919111b1c60b Author: Lijo Lazar Date: Thu May 19 10:50:25 2022 +0530 drm/amd/pm: Fix missing thermal throttler status On aldebaran, when thermal throttling happens due to excessive GPU temperature, the reason for throttling event is missed in warning message. This patch fixes it. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 49b74d12d1e02fc67b2854a593e589372d894e62 Author: Sunil Khatri Date: Tue May 17 11:33:45 2022 +0530 drm/amdgpu: add support of tmz for GC 10.3.7 Add support of IP GC 10.3.7 in amdgpu_gmc_tmz_set. Signed-off-by: Sunil Khatri Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 0ef3dc7e97884a861db4cb3dfd721db71edb0236 Author: Sunil Khatri Date: Tue May 17 11:28:46 2022 +0530 drm/amdgpu: change code name to ip version for tmz set Use IP version rather then code name of IPs for tmz set. Signed-off-by: Sunil Khatri Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 4d33e7040d70b50f1fb564f7020644ec5b45d6b7 Author: Sunil Khatri Date: Tue May 17 11:27:11 2022 +0530 drm/amdgpu: move amdgpu_gmc_tmz_set after ip_version populated To enable TMZ feature based on IP version needs adev->ip_version populated but its empty. Move amdgpu_gmc_tmz_set to a place where ip_version is populated. Signed-off-by: Sunil Khatri Reviewed-by: Alexander Deucher Signed-off-by: Alex Deucher commit 950d64250fba5fbb8c290f692de8ffdee380726c Author: Stanley.Yang Date: Wed Apr 27 12:16:51 2022 +0800 drm/amdgpu: support ras on SRIOV support umc/gfx/sdma ras on guest side Changed from V1: move sriov judgment in amdgpu_ras_interrupt_fatal_error_handler Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 2c270d3e71ed0b68b2f75c0b15645fb023b4032c Author: Dan Carpenter Date: Wed May 18 20:38:36 2022 +0300 drm/amdgpu/pm: smu_v13_0_4: delete duplicate condition There is no need to check if "clock_ranges' is non-NULL. It is checked already on the line before. Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 3670c46f07d13ba42bb66948fde68495078457ec Author: Evan Quan Date: Fri May 13 11:03:07 2022 +0800 drm/amd/pm: enable memory temp reading for SMU 13.0.0 With the latest vbios, the memory temp reading is working. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0aceb728f4e4790d80ce64e83bb8fad40693db13 Author: Evan Quan Date: Tue May 10 15:00:43 2022 +0800 drm/amd/pm: enable more dpm features for SMU 13.0.0 Enable OOB Monitor and SOC CG which are ready since 78.38.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6fd693817dcf07aed021b4196993822fad225664 Author: Evan Quan Date: Tue May 10 11:04:06 2022 +0800 drm/amd/pm: correct the softpptable ids used for SMU 13.0.0 To better match with the pptable_id settings from VBIOS. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 1c65e54881f3a56f16783b0b772501a8ddeb8c10 Author: Evan Quan Date: Mon May 9 11:42:23 2022 +0800 drm/amd/pm: update SMU 13.0.0 driver_if header To align with 78.37.0 and later PMFWs. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 704d6bf605faf65555438c2fa0282c02dca1a7b6 Author: Evan Quan Date: Fri May 6 17:36:06 2022 +0800 drm/amd/pm: skip dpm disablement on suspend for SMU 13.0.0 Since PMFW will handle this properly. Driver involvement is unnecessary. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 72063c71c39162d897c7c6f47fdc26425cfba03b Author: Evan Quan Date: Thu May 5 11:49:14 2022 +0800 drm/amd/pm: enable more dpm features for SMU 13.0.0 Enable MP0CLK DPM and FW Dstate since they are already supported by latest 78.36.0 PMFW. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d2f4460a3d9502513419f06cc376c7ade49d5753 Author: Gong Yuanjun Date: Tue May 17 17:57:46 2022 +0800 drm/amd/pm: fix a potential gpu_metrics_table memory leak gpu_metrics_table is allocated in yellow_carp_init_smc_tables() but not freed in yellow_carp_fini_smc_tables(). Signed-off-by: Gong Yuanjun Signed-off-by: Alex Deucher commit a2b28708b645c5632dc93669ab06e97874c8244f Author: Gong Yuanjun Date: Tue May 17 17:57:00 2022 +0800 drm/radeon: fix a possible null pointer dereference In radeon_fp_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. The failure status of drm_cvt_mode() on the other path is checked too. Signed-off-by: Gong Yuanjun Signed-off-by: Alex Deucher commit 10784fec9cbddad2ca6031b28c1ca1d041444dc5 Author: Haohui Mai Date: Tue May 17 04:24:38 2022 -0700 drm/amdgpu/gfx10: rework KIQ programming Make sure the queue is not longer active before programming the kiq EOP registers. Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit 842035543c0bfa35b1471e74094a107673815b01 Author: Haohui Mai Date: Mon May 16 23:06:35 2022 -0700 drm/amdgpu: Set CP_HQD_PQ_CONTROL.RPTR_BLOCK_SIZE correctly Remove the accidental shifts on the values of RPTR_BLOCK_SIZE in gfx_v8-v11. The bug essentially always programs the corresponding fields to zero instead of the correct value. The hardware clamps the min value to 5 so this resulted in a value of 5 being programmed. Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit 69493c034d2455204dfcd370de8c4dc204374a94 Author: Christian König Date: Fri May 13 13:54:02 2022 +0200 drm/amdgpu: cleanup ctx implementation Let each context have a pointer to the ctx manager and properly initialize the adev pointer inside the context manager. Reduce the BUG_ON() in amdgpu_ctx_add_fence() into a WARN_ON() and directly return the sequence number instead of writing into a parmeter. Signed-off-by: Christian König Reviewed-by: Shashank Sharma Signed-off-by: Alex Deucher commit a0af5dbdc914eae667fba8322cb02afc4ce3967b Author: Jonathan Kim Date: Thu May 12 20:38:18 2022 -0400 drm/amdkfd: simplify cpu hive assignment CPU hive assignment currently assumes when a GPU hive is connected_to_cpu, there is only one hive in the system. Only assign CPUs to the hive if they are explicitly directly connected to the GPU hive to get rid of the need for this assumption. It's more efficient to do this when querying IO links since other non-CRAT info has to be filled in anyways. Also, stop re-assigning the same CPU to the same GPU hive if it has already been done before. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2c2dd0555fd6bcea6d43ab3224c6af718b910e22 Author: Haohui Mai Date: Mon May 16 05:00:53 2022 -0700 drm/amdgpu: Clean up of initializing doorbells for gfx_v9 and gfx_v10 Clean up redundant, copy-paste code blocks during the initialization of the doorbells in mqd_init(). Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit c51bdd1a9c34936c1a6b2f6eb79703c730cc0e6e Author: Aric Cyr Date: Sun May 8 23:31:34 2022 -0400 drm/amd/display: 3.2.186 This version brings along the following: - Improvements in link training fallback - Adding individual edp hotplug support - Fixes in DPIA HPD status, display clock change hang, etc. - FPU isolation work for DCN30 Acked-by: Qingqing Zhuo Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4d1d699f479dc8e01fbb6b7b5a8f2116de3a3883 Author: Michael Strauss Date: Fri May 6 17:17:55 2022 -0400 Revert "drm/amd/display: Refactor LTTPR cap retrieval" This reverts commit 3b90318d44f87a3582f876802253a7748d270385. [WHY] Regressions unintentionally caused by change, reverting until this can be resolved. Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a32cc8177eabcd3497721836241f3d456342be62 Author: Bhawanpreet Lakha Date: Thu May 5 16:16:47 2022 -0400 drm/amd/display: Fic incorrect pipe being used for clk update [Why] we save the prev_dppclk value using "dpp_inst" but when reading this value we use the index "i". In a case where a pipe is fused off we can end up reading the incorrect instance because i != dpp_inst in this case. [How] read the prev_dppclk using dpp_inst instead of i Reviewed-by: Dmytro Laktyushkin Acked-by: Qingqing Zhuo Signed-off-by: Bhawanpreet Lakha Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e4b0eac3e6242abf5f5ebcffdeb852e7ffa1c3d0 Author: Jasdeep Dhillon Date: Fri May 6 13:03:45 2022 -0400 drm/amd/display: Move FPU associated DCN30 code to DML folder [why & how] As part of the FPU isolation work documented in https://patchwork.freedesktop.org/series/93042/, isolate code that uses FPU in DCN30 to DML, where all FPU code should locate. Reviewed-by: Rodrigo Siqueira Acked-by: Qingqing Zhuo Signed-off-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 66a197203794339b028eedfa880bff9367fce783 Author: Nicholas Kazlauskas Date: Thu May 5 16:50:42 2022 -0400 drm/amd/display: Check zero planes for OTG disable W/A on clock change [Why] A display clock change hang can occur when switching between DIO and HPO enabled modes during the optimize_bandwidth in dc_commit_state_no_check call. This happens when going from 4k120 8bpc 420 to 4k144 10bpc 444. Display clock in the DIO case is 1200MHz, but pixel rate is 600MHz because the pixel format is 420. Display clock in the HPO case is less (800MHz?) because of ODM combine which results in a smaller divider. The DIO is still active in prepare but not active in the optimize which results in the hang occuring. During this change there are no planes on the stream so it's safe to apply the workaround, but dpms_off = false and signal type is not virtual. [How] Check for plane_count == 0, no planes on the stream. It's easiest to check pipe->plane_state == NULL as an equivalent check rather than trying to search for the stream status in the context associated with the stream, so let's do that. The primary, non MPO pipe should not have a NULL plane state. Reviewed-by: Dmytro Laktyushkin Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ab144f0b4ad615b86934ce9cbdd27b23f65ba3a4 Author: Derek Lai Date: Thu May 5 17:59:49 2022 +0800 drm/amd/display: Allow individual control of eDP hotplug support [Why] Second eDP can send display off notification through HPD but DC isn't hooked up to handle. Some primary eDP panels will toggle on/off incorrectly if it's enabled generically. [How] Extend the debug option to allow individually enabling hotplug either the first eDP or the second eDP in a dual eDP system. Reviewed-by: Nicholas Kazlauskas Acked-by: Qingqing Zhuo Signed-off-by: Derek Lai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 49947b906a6bd9668eaf4f9cf691973c25c26955 Author: David Galiffi Date: Tue May 3 18:30:25 2022 -0400 drm/amd/display: Check if modulo is 0 before dividing. [How & Why] If a value of 0 is read, then this will cause a divide-by-0 panic. Reviewed-by: Martin Leung Acked-by: Qingqing Zhuo Signed-off-by: David Galiffi Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3f69ee66f507a9e1180fd3a67b43807fae9b0e37 Author: Paul Hsieh Date: Tue May 3 14:26:41 2022 +0800 drm/amd/display: clear request when release aux engine [Why] when driver and dmub request aux engine at the same time, dmub grant the aux engine but driver fail. Then driver release aux engine but doesn't clear the request bit. Then aux engine will be occupied by driver forever. [How] When driver release aux engine, clear request bit as well. Reviewed-by: Anthony Koo Acked-by: Qingqing Zhuo Signed-off-by: Paul Hsieh Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 903940b0b7c7f48e9743c65ae7cd65267083539f Author: Alvin Lee Date: Mon May 2 15:04:31 2022 -0400 drm/amd/display: Clean up code in dc [Why & How] Code clean up in dc. Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fc0b067df7ed973addbba8e136d9a729df86ccdc Author: Jimmy Kizito Date: Fri Apr 1 15:24:47 2022 -0400 drm/amd/display: Query DPIA HPD status. [Why] Driver needs up to date DPIA HPD status. [How] Use HPD query command to get DPIA HPD status. Reviewed-by: Meenakshikumar Somasundaram Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d84c4d194ebad0f5d327da72404c37c7de2c1714 Author: Jimmy Kizito Date: Thu Apr 14 09:49:37 2022 -0400 drm/amd/display: Update link training fallback behaviour. [Why] Some displays may need several link training attempts before link training succeeds. [How] If training succeeds after falling back to lower link bandwidth, retry at original link bandwidth instead of abandoning link training whenever link bandwidth is less than stream bandwidth. Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 16477cdfefdb494235a675cc80563d736991d833 Merge: ecf0aa5317b0a b2441b3bdce6c Author: Linus Torvalds Date: Thu May 26 10:50:30 2022 -0700 Merge tag 'asm-generic-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic updates from Arnd Bergmann: "The asm-generic tree contains three separate changes for linux-5.19: - The h8300 architecture is retired after it has been effectively unmaintained for a number of years. This is the last architecture we supported that has no MMU implementation, but there are still a few architectures (arm, m68k, riscv, sh and xtensa) that support CPUs with and without an MMU. - A series to add a generic ticket spinlock that can be shared by most architectures with a working cmpxchg or ll/sc type atomic, including the conversion of riscv, csky and openrisc. This series is also a prerequisite for the loongarch64 architecture port that will come as a separate pull request. - A cleanup of some exported uapi header files to ensure they can be included from user space without relying on other kernel headers" * tag 'asm-generic-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: h8300: remove stale bindings and symlink sparc: add asm/stat.h to UAPI compile-test coverage powerpc: add asm/stat.h to UAPI compile-test coverage mips: add asm/stat.h to UAPI compile-test coverage riscv: add linux/bpf_perf_event.h to UAPI compile-test coverage kbuild: prevent exported headers from including , agpgart.h: do not include from exported header csky: Move to generic ticket-spinlock RISC-V: Move to queued RW locks RISC-V: Move to generic spinlocks openrisc: Move to ticket-spinlock asm-generic: qrwlock: Document the spinlock fairness requirements asm-generic: qspinlock: Indicate the use of mixed-size atomics asm-generic: ticket-lock: New generic ticket-based spinlock remove the h8300 architecture commit ecf0aa5317b0ad6bb015128a5b763c954fd58708 Merge: a0439cf4eca05 1a23accae82d7 Author: Linus Torvalds Date: Thu May 26 10:43:09 2022 -0700 Merge tag 'arm-multiplatform-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARMv4T/v5 multiplatform support from Arnd Bergmann: "This series has been 12 years in the making, it mostly finishes the work that was started with the founding of Linaro to clean up platform support in the kernel. The largest change here is a cleanup of the omap1 platform, which is the final ARM machine type to get converted to the common-clk subsystem. All the omap1 specific drivers are now made independent of the mach/*.h headers to allow the platform to be part of a generic ARMv4/v5 multiplatform kernel. The last bit that enables this support is still missing here while we wait for some last dependencies to make it into the mainline kernel through other subsystems. The s3c24xx, ixp4xx, iop32x, ep93xx and dove platforms were all almost at the point of allowing multiplatform kernels, this work gets completed here along with a few additional cleanup. At the same time, the s3c24xx and s3c64xx are now deprecated and expected to get removed in the future. The PXA and OMAP1 bits are in a separate branch because of dependencies. Once both branches are merged, only the three Intel StrongARM platforms (RiscPC, Footbridge/NetWinder and StrongARM1100) need separate kernels, and there are no plans to include these" * tag 'arm-multiplatform-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (61 commits) ARM: ixp4xx: Consolidate Kconfig fixing issue ARM: versatile: Add missing of_node_put in dcscb_init ARM: config: Refresh IXP4xx config after multiplatform ARM: omap1: add back omap_set_dma_priority() stub ARM: omap: fix missing declaration warnings ARM: omap: fix address space warnings from sparse ARM: spear: remove include/mach/ subdirectory ARM: davinci: remove include/mach/ subdirectory ARM: omap2: remove include/mach/ subdirectory integrator: remove empty ap_init_early() ARM: s3c: fix include path MAINTAINERS: omap1: Add Janusz as an additional maintainer ARM: omap1: htc_herald: fix typos in comments ARM: OMAP1: fix typos in comments ARM: OMAP1: clock: Remove noop code ARM: OMAP1: clock: Remove unused code ARM: OMAP1: clock: Fix UART rate reporting algorithm ARM: OMAP1: clock: Fix early UART rate issues ARM: OMAP1: Prepare for conversion of OMAP1 clocks to CCF ARM: omap1: fix build with no SoC selected ... commit 8a177a36da6c54c98b8685d4f914cb3637d53c0d Author: Tejun Heo Date: Fri May 13 20:55:45 2022 -1000 blk-iolatency: Fix inflight count imbalances and IO hangs on offline iolatency needs to track the number of inflight IOs per cgroup. As this tracking can be expensive, it is disabled when no cgroup has iolatency configured for the device. To ensure that the inflight counters stay balanced, iolatency_set_limit() freezes the request_queue while manipulating the enabled counter, which ensures that no IO is in flight and thus all counters are zero. Unfortunately, iolatency_set_limit() isn't the only place where the enabled counter is manipulated. iolatency_pd_offline() can also dec the counter and trigger disabling. As this disabling happens without freezing the q, this can easily happen while some IOs are in flight and thus leak the counts. This can be easily demonstrated by turning on iolatency on an one empty cgroup while IOs are in flight in other cgroups and then removing the cgroup. Note that iolatency shouldn't have been enabled elsewhere in the system to ensure that removing the cgroup disables iolatency for the whole device. The following keeps flipping on and off iolatency on sda: echo +io > /sys/fs/cgroup/cgroup.subtree_control while true; do mkdir -p /sys/fs/cgroup/test echo '8:0 target=100000' > /sys/fs/cgroup/test/io.latency sleep 1 rmdir /sys/fs/cgroup/test sleep 1 done and there's concurrent fio generating direct rand reads: fio --name test --filename=/dev/sda --direct=1 --rw=randread \ --runtime=600 --time_based --iodepth=256 --numjobs=4 --bs=4k while monitoring with the following drgn script: while True: for css in css_for_each_descendant_pre(prog['blkcg_root'].css.address_of_()): for pos in hlist_for_each(container_of(css, 'struct blkcg', 'css').blkg_list): blkg = container_of(pos, 'struct blkcg_gq', 'blkcg_node') pd = blkg.pd[prog['blkcg_policy_iolatency'].plid] if pd.value_() == 0: continue iolat = container_of(pd, 'struct iolatency_grp', 'pd') inflight = iolat.rq_wait.inflight.counter.value_() if inflight: print(f'inflight={inflight} {disk_name(blkg.q.disk).decode("utf-8")} ' f'{cgroup_path(css.cgroup).decode("utf-8")}') time.sleep(1) The monitoring output looks like the following: inflight=1 sda /user.slice inflight=1 sda /user.slice ... inflight=14 sda /user.slice inflight=13 sda /user.slice inflight=17 sda /user.slice inflight=15 sda /user.slice inflight=18 sda /user.slice inflight=17 sda /user.slice inflight=20 sda /user.slice inflight=19 sda /user.slice <- fio stopped, inflight stuck at 19 inflight=19 sda /user.slice inflight=19 sda /user.slice If a cgroup with stuck inflight ends up getting throttled, the throttled IOs will never get issued as there's no completion event to wake it up leading to an indefinite hang. This patch fixes the bug by unifying enable handling into a work item which is automatically kicked off from iolatency_set_min_lat_nsec() which is called from both iolatency_set_limit() and iolatency_pd_offline() paths. Punting to a work item is necessary as iolatency_pd_offline() is called under spinlocks while freezing a request_queue requires a sleepable context. This also simplifies the code reducing LOC sans the comments and avoids the unnecessary freezes which were happening whenever a cgroup's latency target is newly set or cleared. Signed-off-by: Tejun Heo Cc: Josef Bacik Cc: Liu Bo Fixes: 8c772a9bfc7c ("blk-iolatency: fix IO hang due to negative inflight counter") Cc: stable@vger.kernel.org # v5.0+ Link: https://lore.kernel.org/r/Yn9ScX6Nx2qIiQQi@slm.duckdns.org Signed-off-by: Jens Axboe commit a0439cf4eca05fe562f19ece4b6761852d911adb Merge: cc3c470ae4ad7 2cc1cd26e9138 Author: Linus Torvalds Date: Thu May 26 10:37:02 2022 -0700 Merge tag 'arm-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "Lots of smaller additions to the defconfig files for both 32-bit and 64-bit arm platforms, enabling drivers that are now usable on common hardware, and a few options to make it possible to boot a file system image using systemd" * tag 'arm-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (39 commits) ARM: configs: Enable ASoC AC'97 glue ARM: configs: Enable audio on BeagleBone Black in multi_v7_defconfig ARM: configs: at91: Enable AUTOFS_FS required by systemd ARM: configs: at91: Enable options required for systemd ARM: configs: at91: sama7: enable CONFIG_RESET_CONTROLLER ARM: configs: at91: sama7: add MCHP PDMC and DMIC drivers ARM: configs: at91: sama7: Enable MTD_UBI_BLOCK ARM: configs: at91: sama7: Enable MTD_UBI_FASTMAP ARM: configs: at91: sama7: add xisc and csi2dc ARM: multi_v7_defconfig: add atmel video pipeline modules ARM: configs: at91: Remove MTD_BLOCK and use MTD_UBI_BLOCK for read only block FS arm64: defconfig: Enable the WM8524 codec driver arm64: defconfig: Enable modules for arm displays arm: nomadik: drop selecting obsolete CLKSRC_NOMADIK_MTU_SCHED_CLOCK arm64: defconfig: Enable Renesas RZ/V2M SoC arm64: defconfig: Enable ARCH_R9A07G043 arm64: defconfig: Enable configs for DisplayPort on J721e arm64: defconfig: Build Tegra ASRC module ARM: multi_v7_defconfig: enable CONFIG_ARCH_BCMBCA in armv7 defconfig arm: mediatek: select arch timer for mt7629 ... commit cc3c470ae4ad758b8ddad825ab199f7eaa8b0a9e Merge: ae862183285cb d4a3b442335b0 Author: Linus Torvalds Date: Thu May 26 10:32:47 2022 -0700 Merge tag 'arm-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM driver updates from Arnd Bergmann: "There are minor updates to SoC specific drivers for chips by Rockchip, Samsung, NVIDIA, TI, NXP, i.MX, Qualcomm, and Broadcom. Noteworthy driver changes include: - Several conversions of DT bindings to yaml format. - Renesas adds driver support for R-Car V4H, RZ/V2M and RZ/G2UL SoCs. - Qualcomm adds a bus driver for the SSC (Snapdragon Sensor Core), and support for more chips in the RPMh power domains and the soc-id. - NXP has a new driver for the HDMI blk-ctrl on i.MX8MP. - Apple M1 gains support for the on-chip NVMe controller, making it possible to finally use the internal disks. This also includes SoC drivers for their RTKit IPC and for the SART DMA address filter. For other subsystems that merge their drivers through the SoC tree, we have - Firmware drivers for the ARM firmware stack including TEE, OP-TEE, SCMI and FF-A get a number of smaller updates and cleanups. OP-TEE now has a cache for firmware argument structures as an optimization, and SCMI now supports the 3.1 version of the specification. - Reset controller updates to Amlogic, ASpeed, Renesas and ACPI drivers - Memory controller updates for Tegra, and a few updates for other platforms" * tag 'arm-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (159 commits) memory: tegra: Add MC error logging on Tegra186 onward memory: tegra: Add memory controller channels support memory: tegra: Add APE memory clients for Tegra234 memory: tegra: Add Tegra234 support nvme-apple: fix sparse endianess warnings soc/tegra: pmc: Document core domain fields soc: qcom: pdr: use static for servreg_* variables soc: imx: fix semicolon.cocci warnings soc: renesas: R-Car V3U is R-Car Gen4 soc: imx: add i.MX8MP HDMI blk-ctrl soc: imx: imx8m-blk-ctrl: Add i.MX8MP media blk-ctrl soc: imx: add i.MX8MP HSIO blk-ctrl soc: imx: imx8m-blk-ctrl: set power device name soc: qcom: llcc: Add sc8180x and sc8280xp configurations dt-bindings: arm: msm: Add sc8180x and sc8280xp LLCC compatibles soc/tegra: pmc: Select REGMAP dt-bindings: reset: st,sti-powerdown: Convert to yaml dt-bindings: reset: st,sti-picophyreset: Convert to yaml dt-bindings: reset: socfpga: Convert to yaml dt-bindings: reset: snps,axs10x-reset: Convert to yaml ... commit ae862183285cbb2ef9032770d98ffa9becffe9d5 Merge: c011dd537ffe4 82706d6fb19d0 Author: Linus Torvalds Date: Thu May 26 10:28:12 2022 -0700 Merge tag 'arm-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM DT updates from Arnd Bergmann: "There are 40 branches this time, adding a lot of new hardware support, and cleanups. Krzysztof Kozlowski continues his treewide cleanups. There are a number of new SoCs, all of them as part of existing families, and typically added along with a reference board: - Renesas RZ/G2UL (R9A07G043) is the single-core version of the RZ/G2L general-purpose MPU. - Renesas RZ/V2M (R9A09G011) is a smart camera SoC - Renesas R-Car V4H (R8A779G0) is an automotive chip with Cortex-A76 cores and deep learning accerlation. - Broadcom BCM47622 is a new broadband SoC based on a quad Cortex-A7 and dual Wifi-6. - Corstone1000 is a generic platform from Arm that is used for designing custom SoCs, the support for now is for the Fixed Virtual Platform emulation for it. - Mediatek MT8195 (Kompanio 1200) is a high-end consumer chip used in upcoming Chromebooks. - NXP i.MXRT1050 is a Cortex-M7 based microcontroller, the first MMU-less SoC to be added in a while New machines based on already supported SoCs this time are mainly for 32-bit platforms and include: - Two wireless routers based on Broadcom bcm4708 - 30 new boards based on NXP i.MX6, i.MX7 and i.MX8 families, mostly for the industrial embedded market, and on NXP LS1021A based IOT board. - Two ethernet switches based on Microchip LAN966 - Eight Qualcomm Snapdragon based machines, including a smartwatch, a Chromebook board and some phones - Another phone based on the old ST-Ericsson Ux500 platform - Seven STM32MP1 based boards - Four single-board computers based on Rockchip RK3566/RK3568" * tag 'arm-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (791 commits) ARM: dts: kswitch-d10: enable networking ARM: dts: lan966x: add switch node ARM: dts: lan966x: add serdes node ARM: dts: lan966x: add reset switch reset node ARM: dts: lan966x: add MIIM nodes ARM: dts: lan966x: add hwmon node ARM: dts: lan966x: add basic Kontron KSwitch D10 support ARM: dts: lan966x: add flexcom I2C nodes ARM: dts: lan966x: add flexcom SPI nodes ARM: dts: lan966x: add all flexcom usart nodes ARM: dts: lan966x: add missing uart DMA channel ARM: dts: lan966x: add sgpio node ARM: dts: lan966x: swap dma channels for crypto node ARM: dts: lan966x: rename pinctrl nodes ARM: dts: at91: sama7g5: remove interrupt-parent from gic node ARM: dts: at91: use generic node name for dataflash ARM: dts: turris-omnia: Add atsha204a node arm64: dts: mt8192: Follow binding order for SCP registers arm64: dts: mediatek: add mtk-snfi for mt7622 arm64: dts: mediatek: mt8195-demo: enable uart1 ... commit c011dd537ffe47462051930413fed07dbdc80313 Merge: 3378323bbb9e7 426ecc5851021 Author: Linus Torvalds Date: Thu May 26 10:25:22 2022 -0700 Merge tag 'arm-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull 32-bit ARM SoC updates from Arnd Bergmann: "These updates are for platform specific code in arch/arm/, mostly fixing minor issues. The at91 platform gains support for better power management on the lan966 platform and new firmware on the sama5 platform. The mediatek soc drivers in turn are enabled for the new mt8195 SoC" * tag 'arm-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (34 commits) ARM: at91: debug: add lan966 support ARM: at91: pm: add support for sama5d2 secure suspend ARM: at91: add code to handle secure calls ARM: at91: Kconfig: implement PIT64B selection ARM: at91: pm: add quirks for pm ARM: at91: pm: use kernel documentation style ARM: at91: pm: introduce macros for pm mode replacement ARM: at91: pm: keep documentation inline with structure members orion5x: fix typos in comments ARM: hisi: Add missing of_node_put after of_find_compatible_node ARM: shmobile: rcar-gen2: Drop comma after OF match table sentinel ARM: shmobile: Drop commas after dt_compat sentinels soc: mediatek: mutex: remove mt8195 MOD0 and SOF0 definition MAINTAINERS: Add Broadcom BCMBCA entry arm: bcmbca: add arch bcmbca machine entry MAINTAINERS: Broadcom internal lists aren't maintainers dt-bindings: pwrap: mediatek: Update pwrap document for mt8195 soc: mediatek: add DDP_DOMPONENT_DITHER0 enum for mt8195 vdosys0 soc: mediatek: add mtk-mutex support for mt8195 vdosys0 soc: mediatek: add mtk-mmsys support for mt8195 vdosys0 ... commit 5f76955ab1e43e5795a9631b22ca4f918a0ae986 Author: Dmitry Torokhov Date: Wed May 25 09:51:08 2022 -0700 Input: stmfts - do not leave device disabled in stmfts_input_open The commit 26623eea0da3 attempted to deal with potential leak of runtime PM counter when opening the touchscreen device, however it ended up erroneously dropping the counter in the case of successfully enabling the device. Let's address this by using pm_runtime_resume_and_get() and then executing pm_runtime_put_sync() only when we fail to send "sense on" command to the device. Fixes: 26623eea0da3 ("Input: stmfts - fix reference leak in stmfts_input_open") Reported-by: Pavel Machek Signed-off-by: Dmitry Torokhov commit cee409bbba0d1bd3fb73064fb480ff365f453b5d Author: Lad Prabhakar Date: Wed May 25 14:39:28 2022 -0700 Input: gpio-keys - cancel delayed work only in case of GPIO gpio_keys module can either accept gpios or interrupts. The module initializes delayed work in case of gpios only and is only used if debounce timer is not used, so make sure cancel_delayed_work_sync() is called only when its gpio-backed and debounce_use_hrtimer is false. This fixes the issue seen below when the gpio_keys module is unloaded and an interrupt pin is used instead of GPIO: [ 360.297569] ------------[ cut here ]------------ [ 360.302303] WARNING: CPU: 0 PID: 237 at kernel/workqueue.c:3066 __flush_work+0x414/0x470 [ 360.310531] Modules linked in: gpio_keys(-) [ 360.314797] CPU: 0 PID: 237 Comm: rmmod Not tainted 5.18.0-rc5-arm64-renesas-00116-g73636105874d-dirty #166 [ 360.324662] Hardware name: Renesas SMARC EVK based on r9a07g054l2 (DT) [ 360.331270] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 360.338318] pc : __flush_work+0x414/0x470 [ 360.342385] lr : __cancel_work_timer+0x140/0x1b0 [ 360.347065] sp : ffff80000a7fba00 [ 360.350423] x29: ffff80000a7fba00 x28: ffff000012b9c5c0 x27: 0000000000000000 [ 360.357664] x26: ffff80000a7fbb80 x25: ffff80000954d0a8 x24: 0000000000000001 [ 360.364904] x23: ffff800009757000 x22: 0000000000000000 x21: ffff80000919b000 [ 360.372143] x20: ffff00000f5974e0 x19: ffff00000f5974e0 x18: ffff8000097fcf48 [ 360.379382] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000053f40 [ 360.386622] x14: ffff800009850e88 x13: 0000000000000002 x12: 000000000000a60c [ 360.393861] x11: 000000000000a610 x10: 0000000000000000 x9 : 0000000000000008 [ 360.401100] x8 : 0101010101010101 x7 : 00000000a473c394 x6 : 0080808080808080 [ 360.408339] x5 : 0000000000000001 x4 : 0000000000000000 x3 : ffff80000919b458 [ 360.415578] x2 : ffff8000097577f0 x1 : 0000000000000001 x0 : 0000000000000000 [ 360.422818] Call trace: [ 360.425299] __flush_work+0x414/0x470 [ 360.429012] __cancel_work_timer+0x140/0x1b0 [ 360.433340] cancel_delayed_work_sync+0x10/0x18 [ 360.437931] gpio_keys_quiesce_key+0x28/0x58 [gpio_keys] [ 360.443327] devm_action_release+0x10/0x18 [ 360.447481] release_nodes+0x8c/0x1a0 [ 360.451194] devres_release_all+0x90/0x100 [ 360.455346] device_unbind_cleanup+0x14/0x60 [ 360.459677] device_release_driver_internal+0xe8/0x168 [ 360.464883] driver_detach+0x4c/0x90 [ 360.468509] bus_remove_driver+0x54/0xb0 [ 360.472485] driver_unregister+0x2c/0x58 [ 360.476462] platform_driver_unregister+0x10/0x18 [ 360.481230] gpio_keys_exit+0x14/0x828 [gpio_keys] [ 360.486088] __arm64_sys_delete_module+0x1e0/0x270 [ 360.490945] invoke_syscall+0x40/0xf8 [ 360.494661] el0_svc_common.constprop.3+0xf0/0x110 [ 360.499515] do_el0_svc+0x20/0x78 [ 360.502877] el0_svc+0x48/0xf8 [ 360.505977] el0t_64_sync_handler+0x88/0xb0 [ 360.510216] el0t_64_sync+0x148/0x14c [ 360.513930] irq event stamp: 4306 [ 360.517288] hardirqs last enabled at (4305): [] __cancel_work_timer+0x130/0x1b0 [ 360.526359] hardirqs last disabled at (4306): [] el1_dbg+0x24/0x88 [ 360.534204] softirqs last enabled at (4278): [] _stext+0x4a0/0x5e0 [ 360.542133] softirqs last disabled at (4267): [] irq_exit_rcu+0x18c/0x1b0 [ 360.550591] ---[ end trace 0000000000000000 ]--- Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220524135822.14764-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Dmitry Torokhov commit 3378323bbb9e77643a645f6b1ff10f7bdb9d61e4 Author: Uros Bizjak Date: Wed May 25 16:40:12 2022 +0200 locking/lockref: Use try_cmpxchg64 in CMPXCHG_LOOP macro Use try_cmpxchg64 instead of cmpxchg64 in CMPXCHG_LOOP macro. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). The main loop of lockref_get improves from: 13: 48 89 c1 mov %rax,%rcx 16: 48 c1 f9 20 sar $0x20,%rcx 1a: 83 c1 01 add $0x1,%ecx 1d: 48 89 ce mov %rcx,%rsi 20: 89 c1 mov %eax,%ecx 22: 48 89 d0 mov %rdx,%rax 25: 48 c1 e6 20 shl $0x20,%rsi 29: 48 09 f1 or %rsi,%rcx 2c: f0 48 0f b1 4d 00 lock cmpxchg %rcx,0x0(%rbp) 32: 48 39 d0 cmp %rdx,%rax 35: 75 17 jne 4e to: 13: 48 89 ca mov %rcx,%rdx 16: 48 c1 fa 20 sar $0x20,%rdx 1a: 83 c2 01 add $0x1,%edx 1d: 48 89 d6 mov %rdx,%rsi 20: 89 ca mov %ecx,%edx 22: 48 c1 e6 20 shl $0x20,%rsi 26: 48 09 f2 or %rsi,%rdx 29: f0 48 0f b1 55 00 lock cmpxchg %rdx,0x0(%rbp) 2f: 75 02 jne 33 [ Michael Ellerman and Mark Rutland confirm that code generation on powerpc and arm64 respectively is also ok, even though they do not have a native arch_try_cmpxchg() implementation, and rely on the default fallback case - Linus ] Signed-off-by: Uros Bizjak Tested-by: Michael Ellerman Tested-by: Mark Rutland Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Waiman.Long@hp.com Cc: paulmck@linux.vnet.ibm.com Signed-off-by: Linus Torvalds commit d511578b9d215e2ff27e10c1b9d5d414383018dc Author: James Clark Date: Wed May 25 16:41:13 2022 +0100 perf unwind arm64: Decouple Libunwind register names from Perf DWARF register numbers and real register numbers on aarch64 are equivalent. Remove the references to the register names from Libunwind so that new registers are supported without having to add build time feature checks for each new register. The unwinder won't ask for a register that it doesn't know about and Perf will already report an error for an unknown or unrecorded register in the perf_reg_value() function so extra validation isn't needed. After this change the new VG register can be read by libunwind. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Brown Cc: Mark Rutland Cc: Mathieu Poirier 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/20220525154114.718321-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 721052048bba2c8df1928d013963e12eca84f58c Author: James Clark Date: Wed May 25 16:41:12 2022 +0100 perf unwind: Use dynamic register set for DWARF unwind Architectures can detect availability of extra registers at runtime so use this more complete set for unwinding. This will include the VG register on arm64 in a later commit. If the function isn't implemented then PERF_REGS_MASK is returned and there is no change. Committer notes: Added util/perf_regs.c to tools/perf/util/python-ext-sources so that 'perf test python' passes, i.e. the perf python binding has all the symbols it needs, addressing: $ perf test -v python 19: 'import perf' in python : --- start --- test child forked, pid 2037817 python usage test: "echo "import sys ; sys.path.append('/tmp/build/perf/python'); import perf" | '/usr/bin/python3' " Traceback (most recent call last): File "", line 1, in ImportError: /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so: undefined symbol: arch__user_reg_mask test child finished with -1 ---- end ---- 'import perf' in python: FAILED! $ Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Brown Cc: Mark Rutland Cc: Mathieu Poirier 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/20220525154114.718321-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f450f11b2d3f48e7eb0c9ca34ee5c873521e0b7b Author: James Clark Date: Wed May 25 16:41:11 2022 +0100 perf tools arm64: Copy perf_regs.h from the kernel Get the updated header for the newly added VG register. Reviewed-by: Leo Yan Signed-off-by: James Clark Cc: Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier 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/20220525154114.718321-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 8803880f7d1cf85cbc110e47400165a6b85e13df Author: James Clark Date: Wed May 25 16:41:10 2022 +0100 perf unwind arm64: Use perf's copy of kernel headers Fix this include path to use perf's copy of the kernel header rather than the one from the root of the repo. This fixes build errors when only applying the perf tools part of a patchset rather than both sides. Reported-by: German Gomez Signed-off-by: James Clark Tested-by: German Gomez Cc: Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier 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/20220525154114.718321-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit c4040212bc97d16040712a410335f93bc94d2262 Author: Leo Yan Date: Thu May 26 22:54:00 2022 +0800 perf c2c: Use stdio interface if slang is not supported If the slang lib is not installed on the system, perf c2c tool disables TUI mode and roll back to use stdio mode; but the flag 'c2c.use_stdio' is missed to set true and thus it wrongly applies UI quirks in the function ui_quirks(). This commit forces to use stdio interface if slang is not supported, and it can avoid to apply the UI quirks and show the correct metric header. Before: ================================================= Shared Cache Line Distribution Pareto ================================================= ------------------------------------------------------------------------------- 0 0 0 99 0 0 0 0xaaaac17d6000 ------------------------------------------------------------------------------- 0.00% 0.00% 6.06% 0.00% 0.00% 0.00% 0x20 N/A 0 0xaaaac17c25ac 0 0 43 375 18469 2 [.] 0x00000000000025ac memstress memstress[25ac] 0 0.00% 0.00% 93.94% 0.00% 0.00% 0.00% 0x29 N/A 0 0xaaaac17c3e88 0 0 173 180 135 2 [.] 0x0000000000003e88 memstress memstress[3e88] 0 After: ================================================= Shared Cache Line Distribution Pareto ================================================= ------------------------------------------------------------------------------- 0 0 0 99 0 0 0 0xaaaac17d6000 ------------------------------------------------------------------------------- 0.00% 0.00% 6.06% 0.00% 0.00% 0.00% 0x20 N/A 0 0xaaaac17c25ac 0 0 43 375 18469 2 [.] 0x00000000000025ac memstress memstress[25ac] 0 0.00% 0.00% 93.94% 0.00% 0.00% 0.00% 0x29 N/A 0 0xaaaac17c3e88 0 0 173 180 135 2 [.] 0x0000000000003e88 memstress memstress[3e88] 0 Fixes: 5a1a99cd2e4e1557 ("perf c2c report: Add main TUI browser") Reported-by: Joe Mario Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220526145400.611249-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 831d06c8d1b37b722d110579d52b1c661e618302 Author: Namhyung Kim Date: Wed May 18 15:47:25 2022 -0700 perf test: Add a basic offcpu profiling test $ sudo ./perf test -v offcpu 88: perf record offcpu profiling tests : --- start --- test child forked, pid 685966 Basic off-cpu test Basic off-cpu test [Success] test child finished with 0 ---- end ---- perf record offcpu profiling tests: Ok Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-7-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 685439a7a037d8677e3d1acf0302624002ee6a6d Author: Namhyung Kim Date: Wed May 18 15:47:24 2022 -0700 perf record: Add cgroup support for off-cpu profiling This covers two different use cases. The first one is cgroup filtering given by -G/--cgroup option which controls the off-cpu profiling for tasks in the given cgroups only. The other use case is cgroup sampling which is enabled by --all-cgroups option and it adds PERF_SAMPLE_CGROUP to the sample_type to set the cgroup id of the task in the sample data. Example output. $ sudo perf record -a --off-cpu --all-cgroups sleep 1 $ sudo perf report --stdio -s comm,cgroup --call-graph=no ... # Samples: 144 of event 'offcpu-time' # Event count (approx.): 48452045427 # # Children Self Command Cgroup # ........ ........ ............... .......................................... # 61.57% 5.60% Chrome_ChildIOT /user.slice/user-657345.slice/user@657345.service/app.slice/... 29.51% 7.38% Web Content /user.slice/user-657345.slice/user@657345.service/app.slice/... 17.48% 1.59% Chrome_IOThread /user.slice/user-657345.slice/user@657345.service/app.slice/... 16.48% 4.12% pipewire-pulse /user.slice/user-657345.slice/user@657345.service/session.slice/... 14.48% 2.07% perf /user.slice/user-657345.slice/user@657345.service/app.slice/... 14.30% 7.15% CompositorTileW /user.slice/user-657345.slice/user@657345.service/app.slice/... 13.33% 6.67% Timer /user.slice/user-657345.slice/user@657345.service/app.slice/... ... Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b36888f71c8542cd49ecaf29cd1ba874c733b5fe Author: Namhyung Kim Date: Wed May 18 15:47:23 2022 -0700 perf record: Handle argument change in sched_switch Recently sched_switch tracepoint added a new argument for prev_state, but it's hard to handle the change in a BPF program. Instead, we can check the function prototype in BTF before loading the program. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 10742d0c0771d9fb0329d03bb7c7620c8738f065 Author: Namhyung Kim Date: Wed May 18 15:47:22 2022 -0700 perf record: Implement basic filtering for off-cpu It should honor cpu and task filtering with -a, -C or -p, -t options. Committer testing: # perf record --off-cpu --cpu 1 perf bench sched messaging -l 1000 # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 1.722 [sec] [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 1.446 MB perf.data (7248 samples) ] # # perf script | head -20 perf 97164 [001] 38287.696761: 1 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97164 [001] 38287.696764: 1 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97164 [001] 38287.696765: 9 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97164 [001] 38287.696767: 212 cycles: ffffffffb6070176 native_write_msr+0x6 (vmlinux) perf 97164 [001] 38287.696768: 5130 cycles: ffffffffb6070176 native_write_msr+0x6 (vmlinux) perf 97164 [001] 38287.696770: 123063 cycles: ffffffffb6e0011e syscall_return_via_sysret+0x38 (vmlinux) perf 97164 [001] 38287.696803: 2292748 cycles: ffffffffb636c82d __fput+0xad (vmlinux) swapper 0 [001] 38287.702852: 1927474 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) :97513 97513 [001] 38287.767207: 1172536 cycles: ffffffffb612ff65 newidle_balance+0x5 (vmlinux) swapper 0 [001] 38287.769567: 1073081 cycles: ffffffffb618216d ktime_get_mono_fast_ns+0xd (vmlinux) :97533 97533 [001] 38287.770962: 984460 cycles: ffffffffb65b2900 selinux_socket_sendmsg+0x0 (vmlinux) :97540 97540 [001] 38287.772242: 883462 cycles: ffffffffb6d0bf59 irqentry_exit_to_user_mode+0x9 (vmlinux) swapper 0 [001] 38287.773633: 741963 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) :97552 97552 [001] 38287.774539: 606680 cycles: ffffffffb62eda0a page_add_file_rmap+0x7a (vmlinux) :97556 97556 [001] 38287.775333: 502254 cycles: ffffffffb634f964 get_obj_cgroup_from_current+0xc4 (vmlinux) :97561 97561 [001] 38287.776163: 427891 cycles: ffffffffb61b1522 cgroup_rstat_updated+0x22 (vmlinux) swapper 0 [001] 38287.776854: 359030 cycles: ffffffffb612fc5e load_balance+0x9ce (vmlinux) :97567 97567 [001] 38287.777312: 330371 cycles: ffffffffb6a8d8d0 skb_set_owner_w+0x0 (vmlinux) :97566 97566 [001] 38287.777589: 311622 cycles: ffffffffb614a7a8 native_queued_spin_lock_slowpath+0x148 (vmlinux) :97512 97512 [001] 38287.777671: 307851 cycles: ffffffffb62e0f35 find_vma+0x55 (vmlinux) # # perf record --off-cpu --cpu 4 perf bench sched messaging -l 1000 # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 1.613 [sec] [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 1.415 MB perf.data (6729 samples) ] # perf script | head -20 perf 97650 [004] 38323.728036: 1 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97650 [004] 38323.728040: 1 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97650 [004] 38323.728041: 9 cycles: ffffffffb6070174 native_write_msr+0x4 (vmlinux) perf 97650 [004] 38323.728042: 208 cycles: ffffffffb6070176 native_write_msr+0x6 (vmlinux) perf 97650 [004] 38323.728044: 5026 cycles: ffffffffb6070176 native_write_msr+0x6 (vmlinux) perf 97650 [004] 38323.728046: 119970 cycles: ffffffffb6d0bebc syscall_exit_to_user_mode+0x1c (vmlinux) perf 97650 [004] 38323.728078: 2190103 cycles: 54b756 perf_tool__process_synth_event+0x16 (/home/acme/bin/perf) swapper 0 [004] 38323.783357: 1593139 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) swapper 0 [004] 38323.785352: 1593139 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) swapper 0 [004] 38323.797330: 1418936 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) swapper 0 [004] 38323.802350: 1418936 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) swapper 0 [004] 38323.806333: 1418936 cycles: ffffffffb6761378 mwait_idle_with_hints.constprop.0+0x48 (vmlinux) :97996 97996 [004] 38323.807145: 1418936 cycles: 7f5db9be6917 [unknown] ([unknown]) :97959 97959 [004] 38323.807730: 1445074 cycles: ffffffffb6329d36 memcg_slab_post_alloc_hook+0x146 (vmlinux) :97959 97959 [004] 38323.808103: 1341584 cycles: ffffffffb62fd90f get_page_from_freelist+0x112f (vmlinux) :97959 97959 [004] 38323.808451: 1227537 cycles: ffffffffb65b2905 selinux_socket_sendmsg+0x5 (vmlinux) :97959 97959 [004] 38323.808768: 1184321 cycles: ffffffffb6d1ba35 _raw_spin_lock_irqsave+0x15 (vmlinux) :97959 97959 [004] 38323.809073: 1153017 cycles: ffffffffb6a8d92d skb_set_owner_w+0x5d (vmlinux) :97959 97959 [004] 38323.809402: 1126875 cycles: ffffffffb6329c64 memcg_slab_post_alloc_hook+0x74 (vmlinux) :97959 97959 [004] 38323.809695: 1073248 cycles: ffffffffb6e0001d entry_SYSCALL_64+0x1d (vmlinux) # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit edc41a1099c2d08ccfd4ed7d59688501e3749015 Author: Namhyung Kim Date: Wed May 18 15:47:21 2022 -0700 perf record: Enable off-cpu analysis with BPF Add --off-cpu option to enable the off-cpu profiling with BPF. It'd use a bpf_output event and rename it to "offcpu-time". Samples will be synthesized at the end of the record session using data from a BPF map which contains the aggregated off-cpu time at context switches. So it needs root privilege to get the off-cpu profiling. Each sample will have a separate user stacktrace so it will skip kernel threads. The sample ip will be set from the stacktrace and other sample data will be updated accordingly. Currently it only handles some basic sample types. The sample timestamp is set to a dummy value just not to bother with other events during the sorting. So it has a very big initial value and increase it on processing each samples. Good thing is that it can be used together with regular profiling like cpu cycles. If you don't want to that, you can use a dummy event to enable off-cpu profiling only. Example output: $ sudo perf record --off-cpu perf bench sched messaging -l 1000 $ sudo perf report --stdio --call-graph=no # Total Lost Samples: 0 # # Samples: 41K of event 'cycles' # Event count (approx.): 42137343851 ... # Samples: 1K of event 'offcpu-time' # Event count (approx.): 587990831640 # # Children Self Command Shared Object Symbol # ........ ........ ............... .................. ......................... # 81.66% 0.00% sched-messaging libc-2.33.so [.] __libc_start_main 81.66% 0.00% sched-messaging perf [.] cmd_bench 81.66% 0.00% sched-messaging perf [.] main 81.66% 0.00% sched-messaging perf [.] run_builtin 81.43% 0.00% sched-messaging perf [.] bench_sched_messaging 40.86% 40.86% sched-messaging libpthread-2.33.so [.] __read 37.66% 37.66% sched-messaging libpthread-2.33.so [.] __write 2.91% 2.91% sched-messaging libc-2.33.so [.] __poll ... As you can see it spent most of off-cpu time in read and write in bench_sched_messaging(). The --call-graph=no was added just to make the output concise here. It uses perf hooks facility to control BPF program during the record session rather than adding new BPF/off-cpu specific calls. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 303ead45c4459df9e38d4f2bd38ef6238c5898de Author: Namhyung Kim Date: Wed May 18 15:47:20 2022 -0700 perf report: Do not extend sample type of bpf-output event Currently evsel__new_idx() sets more sample_type bits when it finds a BPF-output event. But it should honor what's recorded in the perf data file rather than blindly sets the bits. Otherwise it could lead to a parse error when it recorded with a modified sample_type. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Blake Jones Cc: Hao Luo Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20220518224725.742882-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7473ee56dbc91c9803e7a80768e71de02ab0b54d Author: Claire Jensen Date: Tue May 24 22:38:12 2022 -0700 perf test: Add checking for perf stat CSV output. Counts expected fields for various commands. No testing added for summary mode since it is broken. An example of the summary output is: summary,263831,,instructions:u,1435072,100.0,0.46,insn per cycle ,,,,,1.37,stalled cycles per insn This should be: summary,263831,,instructions:u,1435072,100.0,0.46,insn per cycle summary,,,,,,1.37,stalled cycles per insn The output has 7 fields when it should have 8. Additionally, the newline spacing is wrong, so it was excluded from testing until a fix is made. Committer testing: $ perf test "perf stat CSV output" 88: perf stat CSV output linter : Ok $ $ perf test -v "perf stat CSV output" Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc 88: perf stat CSV output linter : --- start --- test child forked, pid 2622839 Checking CSV output: no args [Success] Checking CSV output: system wide [Skip] paranoid and not root Checking CSV output: system wide [Skip] paranoid and not root Checking CSV output: interval [Success] Checking CSV output: event [Success] Checking CSV output: per core [Skip] paranoid and not root Checking CSV output: per thread [Skip] paranoid and not root Checking CSV output: per die [Skip] paranoid and not root Checking CSV output: per node [Skip] paranoid and not root Checking CSV output: per socket [Skip] paranoid and not root test child finished with 0 ---- end ---- perf stat CSV output linter: Ok $ I did a s/parnoia/paranoid/g on the [Skip] lines. Signed-off-by: Claire Jensen Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Alyssa Ross Cc: Claire Jensen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Like Xu Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sandipan Das Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220525053814.3265216-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a41e24f6c3ffdd001f976f9bd76634f2163715f5 Author: Adrian Hunter Date: Tue May 24 10:54:36 2022 +0300 perf tools: Allow system-wide events to keep their own threads System-wide events do not have threads, so do not propagate threads to them. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-16-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 298613b8e3f68a1aef2370cd6a9dad462b6c0457 Author: Adrian Hunter Date: Tue May 24 10:54:35 2022 +0300 perf tools: Allow system-wide events to keep their own CPUs Currently, user_requested_cpus supplants system-wide CPUs when the evlist has_user_cpus. Change that so that system-wide events retain their own CPUs and they are added to all_cpus. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-15-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f5fb6d4efe15a2f0d2c0c175c3827ac594023996 Author: Adrian Hunter Date: Tue May 24 10:54:34 2022 +0300 libperf evsel: Add comments for booleans Add comments for 'system_wide' and 'requires_cpu' booleans Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-14-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d3345fecf9e5f63be7946a1e5bf1f5695c67b445 Author: Adrian Hunter Date: Tue May 24 10:54:33 2022 +0300 perf stat: Add requires_cpu flag for uncore Uncore events require a CPU i.e. it cannot be -1. The evsel system_wide flag is intended for events that should be on every CPU, which does not make sense for uncore events because uncore events do not map one-to-one with CPUs. These 2 requirements are not exactly the same, so introduce a new flag 'requires_cpu' for the uncore case. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-13-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 4ce47d842d4c16c07b135b8a7975b8f0672bcc0e Author: Adrian Hunter Date: Tue May 24 10:54:32 2022 +0300 libperf evlist: Check nr_mmaps is correct Print an error message if the predetermined number of mmaps is incorrect. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-12-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ae4f8ae16a07896403c90305d4b9be27f657c1fc Author: Adrian Hunter Date: Tue May 24 10:54:31 2022 +0300 libperf evlist: Allow mixing per-thread and per-cpu mmaps mmap_per_evsel() will skip events that do not match the CPU, so all CPUs can be iterated in any case. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-11-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7be1fedd2a0a5b8f20952a675c611815254b74b6 Author: Adrian Hunter Date: Tue May 24 10:54:30 2022 +0300 perf tools: Allow all_cpus to be a superset of user_requested_cpus To support collection of system-wide events with user requested CPUs, all_cpus must be a superset of user_requested_cpus. In order to support all_cpus to be a superset of user_requested_cpus, all_cpus must be used instead of user_requested_cpus when dealing with CPUs of all events instead of CPUs of requested events. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 7d189cadbeebc778fe19c245447d155458e6f1e3 Author: Adrian Hunter Date: Tue May 24 10:54:29 2022 +0300 perf intel-pt: Track sideband system-wide when needed User space tasks can migrate between CPUs, so when tracing selected CPUs, sideband for all CPUs is still needed. This is in preparation for allowing system-wide events on all CPUs while the user requested events are on only user requested CPUs. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e665c82a769164a976add4d793e91079ec3d1bae Author: Adrian Hunter Date: Tue May 24 10:54:28 2022 +0300 perf intel-pt: Use evlist__add_dummy_on_all_cpus() for switch tracking Use evlist__add_dummy_on_all_cpus() for switch tracking in preparation for allowing system-wide events on all CPUs while the user requested events are on only user requested CPUs. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 921e3be5a5648f483f80c9ba21ca2942d82d581c Author: Adrian Hunter Date: Tue May 24 10:54:27 2022 +0300 perf record: Use evlist__add_dummy_on_all_cpus() in record__config_text_poke() Use evlist__add_dummy_on_all_cpus() in record__config_text_poke() in preparation for allowing system-wide events on all CPUs while the user requested events are on only user requested CPUs. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 126d68fdcabed8c2ca5ffaba785add93ef722da8 Author: Adrian Hunter Date: Tue May 24 10:54:26 2022 +0300 perf evlist: Add evlist__add_dummy_on_all_cpus() Add evlist__add_dummy_on_all_cpus() to enable creating a system-wide dummy event that sets up the system-wide maps before map propagation. For convenience, add evlist__add_aux_dummy() so that the logic can be used whether or not the event needs to be system-wide. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 82944899149d2ea77c920333364dd0a6de0015ba Author: Adrian Hunter Date: Tue May 24 10:54:25 2022 +0300 perf evlist: Factor out evlist__dummy_event() Factor out evlist__dummy_event() so it can be reused. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 84bd5aba88af7b6ec46ea88e01588f93c6aa782f Author: Adrian Hunter Date: Tue May 24 10:54:24 2022 +0300 perf auxtrace: Remove auxtrace_mmap_params__set_idx() per_cpu parameter Remove auxtrace_mmap_params__set_idx() per_cpu parameter because it isn't needed. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d01508f2df21d6793f1642b20d4c1fe2f1c7fcba Author: Adrian Hunter Date: Tue May 24 10:54:23 2022 +0300 perf auxtrace: Add mmap_needed to auxtrace_mmap_params Add mmap_needed to auxtrace_mmap_params. Currently an auxtrace mmap is always attempted even if the event is not an auxtrace event. That works because, when AUX area tracing, there is always an auxtrace event first for every mmap. Prepare for that not being the case, which it won't be when sideband tracking events are allowed on all CPUs even when auxtrace is limited to selected CPUs. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1097b38fb7583789ac5e33f3fefb1404bd087f99 Author: Adrian Hunter Date: Tue May 24 10:54:22 2022 +0300 perf intel-pt: Add a test for system-wide side band Add a test for system-wide side band even when tracing selected CPUs. The test fails before the patches up to "perf tools: Allow system-wide events to keep their own CPUs" are applied, passes afterwards. Signed-off-by: Adrian Hunter Tested-by: Ian Rogers Acked-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Link: https://lore.kernel.org/r/20220524075436.29144-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit df76e0038370d364d4b2154fa7ddbbccc29f629f Author: Arnaldo Carvalho de Melo Date: Thu May 26 11:48:58 2022 -0300 perf build: Stop using __weak bpf_map_create() to handle older libbpf versions By adding a feature test for bpf_map_create() and providing a fallback if it isn't present in older versions of libbpf. This also fixes the build with torvalds/master at this point: $ git log --oneline -5 torvalds/master babf0bb978e3c9fc (torvalds/master) Merge tag 'xfs-5.19-for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux e375780b631a5fc2 Merge tag 'fsnotify_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 8b728edc5be16179 Merge tag 'fs_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 3f306ea2e18568f6 Merge tag 'dma-mapping-5.19-2022-05-25' of git://git.infradead.org/users/hch/dma-mapping fbe86daca0ba878b Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi $ Coping with: $ git log --oneline -2 d16495a982324f75 d16495a982324f75 libbpf: remove bpf_create_map*() APIs e2371b1632b1c61c libbpf: start 1.0 development cycle $ As the __weak function fails to build as it calls the now removed bpf_create_map() API. Testing: $ rpm -q libbpf-devel libbpf-devel-0.4.0-2.fc35.x86_64 $ $ make -C tools/perf BUILD_BPF_SKEL=1 LIBBPF_DYNAMIC=1 O=/tmp/build/perf install-bin $ cat /tmp/build/perf/feature/test-libbpf-bpf_map_create.make.output test-libbpf-bpf_map_create.c: In function ‘main’: test-libbpf-bpf_map_create.c:6:16: error: implicit declaration of function ‘bpf_map_create’; did you mean ‘bpf_map_freeze’? [-Werror=implicit-function-declaration] 6 | return bpf_map_create(0 /* map_type */, NULL /* map_name */, 0, /* key_size */, | ^~~~~~~~~~~~~~ | bpf_map_freeze test-libbpf-bpf_map_create.c:6:87: error: expected expression before ‘,’ token 6 | return bpf_map_create(0 /* map_type */, NULL /* map_name */, 0, /* key_size */, | ^ cc1: all warnings being treated as errors $ $ objdump -dS /tmp/build/perf/perf | grep ':' -A20 000000000058b290 : { 58b290: 55 push %rbp 58b291: 48 89 e5 mov %rsp,%rbp 58b294: 48 83 ec 10 sub $0x10,%rsp 58b298: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 58b29f: 00 00 58b2a1: 48 89 45 f8 mov %rax,-0x8(%rbp) 58b2a5: 31 c0 xor %eax,%eax return bpf_create_map(map_type, key_size, value_size, max_entries, 0); 58b2a7: 48 8b 45 f8 mov -0x8(%rbp),%rax 58b2ab: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax 58b2b2: 00 00 58b2b4: 75 10 jne 58b2c6 } 58b2b6: c9 leave 58b2b7: 89 d6 mov %edx,%esi 58b2b9: 89 ca mov %ecx,%edx 58b2bb: 44 89 c1 mov %r8d,%ecx return bpf_create_map(map_type, key_size, value_size, max_entries, 0); 58b2be: 45 31 c0 xor %r8d,%r8d $ Cc: Andrii Nakryiko Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Jiri Olsa Cc: Song Liu Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/Yo+XvQNKL4K5khl2@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 08af54b3e5729bc1d56ad3190af811301bdc37a1 Author: Chuck Lever Date: Wed May 11 13:02:21 2022 -0400 NFSD: nfsd_file_put() can sleep Now that there are no more callers of nfsd_file_put() that might hold a spin lock, ensure the lockdep infrastructure can catch newly introduced calls to nfsd_file_put() made while a spinlock is held. Link: https://lore.kernel.org/linux-nfs/ece7fd1d-5fb3-5155-54ba-347cfc19bd9a@oracle.com/T/#mf1855552570cf9a9c80d1e49d91438cd9085aada Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 043862b09cc00273e35e6c3a6389957953a34207 Author: Chuck Lever Date: Sun May 22 12:34:38 2022 -0400 NFSD: Add documenting comment for nfsd4_release_lockowner() And return explicit nfserr values that match what is documented in the new comment / API contract. Signed-off-by: Chuck Lever commit bd8fdb6e545f950f4654a9a10d7e819ad48146e5 Author: Chuck Lever Date: Sun May 22 12:07:18 2022 -0400 NFSD: Modernize nfsd4_release_lockowner() Refactor: Use existing helpers that other lock operations use. This change removes several automatic variables, so re-organize the variable declarations for readability. Signed-off-by: Chuck Lever commit ce3c4ad7f4ce5db7b4f08a1e237d8dd94b39180b Author: Chuck Lever Date: Sat May 21 19:06:13 2022 -0400 NFSD: Fix possible sleep during nfsd4_release_lockowner() nfsd4_release_lockowner() holds clp->cl_lock when it calls check_for_locks(). However, check_for_locks() calls nfsd_file_get() / nfsd_file_put() to access the backing inode's flc_posix list, and nfsd_file_put() can sleep if the inode was recently removed. Let's instead rely on the stateowner's reference count to gate whether the release is permitted. This should be a reliable indication of locks-in-use since file lock operations and ->lm_get_owner take appropriate references, which are released appropriately when file locks are removed. Reported-by: Dai Ngo Signed-off-by: Chuck Lever Cc: stable@vger.kernel.org commit 982be4775164d4780d9c6a2f38b365f5b5bd16d4 Author: Jiri Olsa Date: Tue May 24 13:16:20 2022 +0200 perf build: Stop using __weak btf__raw_data() to handle older libbpf versions By adding a feature test for btf__raw_data() and providing a fallback if it isn't present in older versions of libbpf. Committer testing: $ rpm -q libbpf-devel libbpf-devel-0.4.0-2.fc35.x86_64 $ make -C tools/perf LIBBPF_DYNAMIC=1 O=/tmp/build/perf install-bin $ cat /tmp/build/perf/feature/test-libbpf-btf__raw_data.make.output test-libbpf-btf__raw_data.c: In function ‘main’: test-libbpf-btf__raw_data.c:6:9: error: implicit declaration of function ‘btf__raw_data’; did you mean ‘btf__get_raw_data’? [-Werror=implicit-function-declaration] 6 | btf__raw_data(NULL /* btf_ro */, NULL /* size */); | ^~~~~~~~~~~~~ | btf__get_raw_data cc1: all warnings being treated as errors $ objdump -dS /tmp/build/perf/perf | grep ':' -A20 00000000005b3050 : { 5b3050: 55 push %rbp 5b3051: 48 89 e5 mov %rsp,%rbp 5b3054: 48 83 ec 10 sub $0x10,%rsp 5b3058: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 5b305f: 00 00 5b3061: 48 89 45 f8 mov %rax,-0x8(%rbp) 5b3065: 31 c0 xor %eax,%eax return btf__get_raw_data(btf_ro, size); 5b3067: 48 8b 45 f8 mov -0x8(%rbp),%rax 5b306b: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax 5b3072: 00 00 5b3074: 75 06 jne 5b307c } 5b3076: c9 leave return btf__get_raw_data(btf_ro, size); 5b3077: e9 14 99 e5 ff jmp 40c990 5b307c: e8 af a7 e5 ff call 40d830 <__stack_chk_fail@plt> 5b3081: 66 66 2e 0f 1f 84 00 data16 cs nopw 0x0(%rax,%rax,1) 5b3088: 00 00 00 00 $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava Signed-off-by: Arnaldo Carvalho de Melo commit 739c9180cfa487cc92e2721e224564e4672c578e Author: Jiri Olsa Date: Tue May 24 13:13:17 2022 +0200 perf build: Stop using __weak bpf_object__next_map() to handle older libbpf versions By adding a feature test for bpf_object__next_map() and providing a fallback if it isn't present in older versions of libbpf. Committer testing: $ rpm -q libbpf-devel libbpf-devel-0.4.0-2.fc35.x86_64 $ make -C tools/perf LIBBPF_DYNAMIC=1 O=/tmp/build/perf install-bin $ cat /tmp/build/perf/feature/test-libbpf-bpf_object__next_map.make.output test-libbpf-bpf_object__next_map.c: In function ‘main’: test-libbpf-bpf_object__next_map.c:6:9: error: implicit declaration of function ‘bpf_object__next_map’; did you mean ‘bpf_object__next’? [-Werror=implicit-function-declaration] 6 | bpf_object__next_map(NULL /* obj */, NULL /* prev */); | ^~~~~~~~~~~~~~~~~~~~ | bpf_object__next cc1: all warnings being treated as errors $ $ objdump -dS /tmp/build/perf/perf | grep ':' -A20 00000000005b2e00 : { 5b2e00: 55 push %rbp 5b2e01: 48 89 e5 mov %rsp,%rbp 5b2e04: 48 83 ec 10 sub $0x10,%rsp 5b2e08: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 5b2e0f: 00 00 5b2e11: 48 89 45 f8 mov %rax,-0x8(%rbp) 5b2e15: 31 c0 xor %eax,%eax return bpf_map__next(prev, obj); 5b2e17: 48 8b 45 f8 mov -0x8(%rbp),%rax 5b2e1b: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax 5b2e22: 00 00 5b2e24: 75 0f jne 5b2e35 } 5b2e26: c9 leave 5b2e27: 49 89 f8 mov %rdi,%r8 5b2e2a: 48 89 f7 mov %rsi,%rdi return bpf_map__next(prev, obj); 5b2e2d: 4c 89 c6 mov %r8,%rsi 5b2e30: e9 cb b1 e5 ff jmp 40e000 $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava Signed-off-by: Arnaldo Carvalho de Melo commit 8916d72554e5f06df5ba17bfabc87c7977294ba4 Author: Jiri Olsa Date: Tue May 24 13:09:42 2022 +0200 perf build: Stop using __weak bpf_object__next_program() to handle older libbpf versions By adding a feature test for bpf_object__next_program() and providing a fallback if it isn't present in older versions of libbpf. Committer testing: $ rpm -q libbpf-devel libbpf-devel-0.4.0-2.fc35.x86_64 $ make -C tools/perf LIBBPF_DYNAMIC=1 O=/tmp/build/perf install-bin $ cat /tmp/build/perf/feature/test-libbpf-bpf_object__next_program.make.output test-libbpf-bpf_object__next_program.c: In function ‘main’: test-libbpf-bpf_object__next_program.c:6:9: error: implicit declaration of function ‘bpf_object__next_program’; did you mean ‘bpf_object__unpin_programs’? [-Werror=implicit-function-declaration] 6 | bpf_object__next_program(NULL /* obj */, NULL /* prev */); | ^~~~~~~~~~~~~~~~~~~~~~~~ | bpf_object__unpin_programs cc1: all warnings being treated as errors $ $ objdump -dS /tmp/build/perf/perf | grep ':' -A20 00000000005b2dc0 : { 5b2dc0: 55 push %rbp 5b2dc1: 48 89 e5 mov %rsp,%rbp 5b2dc4: 48 83 ec 10 sub $0x10,%rsp 5b2dc8: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax 5b2dcf: 00 00 5b2dd1: 48 89 45 f8 mov %rax,-0x8(%rbp) 5b2dd5: 31 c0 xor %eax,%eax return bpf_program__next(prev, obj); 5b2dd7: 48 8b 45 f8 mov -0x8(%rbp),%rax 5b2ddb: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax 5b2de2: 00 00 5b2de4: 75 0f jne 5b2df5 } 5b2de6: c9 leave 5b2de7: 49 89 f8 mov %rdi,%r8 5b2dea: 48 89 f7 mov %rsi,%rdi return bpf_program__next(prev, obj); 5b2ded: 4c 89 c6 mov %r8,%rsi 5b2df0: e9 3b b4 e5 ff jmp 40e230 $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava Signed-off-by: Arnaldo Carvalho de Melo commit 5c83eff38194ab2c69a7dc1a64a0a3683f0a3c3a Author: Jiri Olsa Date: Tue May 24 13:04:43 2022 +0200 perf build: Stop using __weak bpf_prog_load() to handle older libbpf versions By adding a feature test for bpf_prog_load() and providing a fallback if it isn't present in older versions of libbpf. Committer testing: $ rpm -q libbpf-devel libbpf-devel-0.4.0-2.fc35.x86_64 $ make -C tools/perf LIBBPF_DYNAMIC=1 O=/tmp/build/perf install-bin $ cat /tmp/build/perf/feature/test-libbpf-bpf_prog_load.make.output test-libbpf-bpf_prog_load.c: In function ‘main’: test-libbpf-bpf_prog_load.c:6:16: error: implicit declaration of function ‘bpf_prog_load’ [-Werror=implicit-function-declaration] 6 | return bpf_prog_load(0 /* prog_type */, NULL /* prog_name */, | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors $ $ objdump -dS /tmp/build/perf/perf | grep ':' -A20 00000000005b2d70 : { 5b2d70: 55 push %rbp 5b2d71: 48 89 ce mov %rcx,%rsi 5b2d74: 4c 89 c8 mov %r9,%rax 5b2d77: 49 89 d2 mov %rdx,%r10 5b2d7a: 4c 89 c2 mov %r8,%rdx 5b2d7d: 48 89 e5 mov %rsp,%rbp 5b2d80: 48 83 ec 18 sub $0x18,%rsp 5b2d84: 64 48 8b 0c 25 28 00 mov %fs:0x28,%rcx 5b2d8b: 00 00 5b2d8d: 48 89 4d f8 mov %rcx,-0x8(%rbp) 5b2d91: 31 c9 xor %ecx,%ecx return bpf_load_program(prog_type, insns, insn_cnt, license, 5b2d93: 41 8b 49 5c mov 0x5c(%r9),%ecx 5b2d97: 51 push %rcx 5b2d98: 4d 8b 49 60 mov 0x60(%r9),%r9 5b2d9c: 4c 89 d1 mov %r10,%rcx 5b2d9f: 44 8b 40 1c mov 0x1c(%rax),%r8d 5b2da3: e8 f8 aa e5 ff call 40d8a0 } $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava Signed-off-by: Arnaldo Carvalho de Melo commit 73534617dfa3c4cd95fe5ffaeff5315e9ffc2de6 Author: Jiri Olsa Date: Tue May 24 14:06:12 2022 +0200 perf build: Fix btf__load_from_kernel_by_id() feature check The btf__load_from_kernel_by_id() only takes one arg, not two. Committer notes: I tested it just with an older libbpf, one where btf__load_from_kernel_by_id() wasn't introduced yet. A test with a newer dynamic libbpf would fail because the btf__load_from_kernel_by_id() is there, but takes just one arg. Fixes: 0ae065a5d265bc5a ("perf build: Fix check for btf__load_from_kernel_by_id() in libbpf") Signed-off-by: Jiri Olsa Cc: Heiko Carstens Cc: Ian Rogers Cc: Ilya Leoshkevich Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Thomas Richter Cc: Vasily Gorbik Link: http://lore.kernel.org/linux-perf-users/YozLKby7ITEtchC9@krava Signed-off-by: Arnaldo Carvalho de Melo commit 9c477178a0a187c4718c228cc6e0692564811441 Author: Yang Li Date: Thu May 26 21:09:45 2022 +0800 RDMA/rtrs-clt: Fix one kernel-doc comment Add the description of @pathname and remove @sessname in rtrs_clt_open() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/infiniband/ulp/rtrs/rtrs-clt.c:2809: warning: Function parameter or member 'pathname' not described in 'rtrs_clt_open' drivers/infiniband/ulp/rtrs/rtrs-clt.c:2809: warning: Excess function parameter 'sessname' description in 'rtrs_clt_open' Link: https://lore.kernel.org/r/20220526130945.98601-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Md Haris Iqbal Signed-off-by: Jason Gunthorpe commit ebf2a3521738520e12849b221fea24928b3f61ff Author: Eddie James Date: Wed May 25 11:58:52 2022 -0500 spi: core: Display return code when failing to transfer message All the other calls to the controller driver display the error return code. The return code is helpful to understand what went wrong, so include it when failing to transfer one message. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220525165852.33167-3-eajames@linux.ibm.com Signed-off-by: Mark Brown commit 61bf40ef51aa73f6216b33563271b6acf7ea8d70 Author: Eddie James Date: Wed May 25 11:58:51 2022 -0500 spi: fsi: Fix spurious timeout The driver may return a timeout error even if the status register indicates that the transfer may proceed. Fix this by restructuring the polling loop. Fixes: 89b35e3f2851 ("spi: fsi: Implement a timeout for polling status") Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220525165852.33167-2-eajames@linux.ibm.com Signed-off-by: Mark Brown commit 5fa66f29937eb806997a4d1d3edd360ef4e93db9 Author: David Lin Date: Thu May 26 20:13:02 2022 +0800 ASoC: Intel: common: fix typo for tplg naming Correct typo form sof-adl-mx98360a-nau8825.tplg to sof-adl-max98360a-nau8825.tplg. The reason is tplg naming without naming limitaion of length. It will be consistency with sof topology generation. Signed-off-by: David Lin Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220526121301.1819541-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit 50e35bd57c02a584442c0aa917787c858eabe80b Author: pengfuyuan Date: Thu May 26 14:27:57 2022 +0800 video: fbdev: radeon: Fix spelling typo in comment Fix spelling typo in comment. Signed-off-by: pengfuyuan Signed-off-by: Helge Deller commit d27423bf048dcb5e15f04286d001c66685e30c29 Author: Shradha Gupta Date: Sun May 15 21:50:58 2022 -0700 hv_balloon: Fix balloon_probe() and balloon_remove() error handling Add missing cleanup in balloon_probe() if the call to balloon_connect_vsp() fails. Also correctly handle cleanup in balloon_remove() when dm_state is DM_INIT_ERROR because balloon_resume() failed. Signed-off-by: Shradha Gupta Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220516045058.GA7933@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net Signed-off-by: Wei Liu commit 86c8fb4d228ed8dbe17b1abd664888bc7ee0052a Author: Saurabh Sengar Date: Wed May 25 04:27:02 2022 -0700 scsi: storvsc: Removing Pre Win8 related logic The latest storvsc code has already removed the support for windows 7 and earlier. There is still some code logic remaining which is there to support pre Windows 8 OS. This patch removes these stale logic. This patch majorly does three things : 1. Removes vmscsi_size_delta and its logic, as the vmscsi_request struct is same for all the OS post windows 8 there is no need of delta. 2. Simplify sense_buffer_size logic, as there is single buffer size for all the post windows 8 OS. 3. Embed the vmscsi_win8_extension structure inside the vmscsi_request, as there is no separate handling required for different OS. Signed-off-by: Saurabh Sengar Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1653478022-26621-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit 1940f9f81d4523b261617cf10e926b4a2485168c Author: Julia Lawall Date: Sat May 21 13:11:10 2022 +0200 Drivers: hv: vmbus: 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-60-Julia.Lawall@inria.fr Signed-off-by: Wei Liu commit 7e4fd16b38923028b01d3dbadf4ca973d885c53e Author: Tiezhu Yang Date: Wed May 25 19:29:55 2022 +0800 MIPS: RALINK: Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC kernel test robot reports a build error used with clang compiler and mips-randconfig [1]: ld.lld: error: undefined symbol: pci_remap_iospace we can see the following configs in the mips-randconfig file: CONFIG_RALINK=y CONFIG_SOC_MT7620=y CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PCI=y CONFIG_RALINK is set, so pci_remap_iospace is defined in the related arch/mips/include/asm/mach-ralink/spaces.h header file: #define pci_remap_iospace pci_remap_iospace CONFIG_PCI is set, so pci_remap_iospace() in drivers/pci/pci.c is not built due to pci_remap_iospace is defined under CONFIG_RALINK. #ifndef pci_remap_iospace int pci_remap_iospace(const struct resource *res, ...) $ objdump -d drivers/pci/pci.o | grep pci_remap_iospace 00004cc8 : 4d18: 10400008 beqz v0,4d3c 4d2c: 1040000c beqz v0,4d60 4d70: 1000fff3 b 4d40 In addition, CONFIG_PCI_DRIVERS_GENERIC is not set, so pci_remap_iospace() in arch/mips/pci/pci-generic.c is not built too. #ifdef pci_remap_iospace int pci_remap_iospace(const struct resource *res, ...) For the above reasons, undefined reference pci_remap_iospace() looks like reasonable. Here are simple steps to reproduce used with gcc and defconfig: cd mips.git make vocore2_defconfig # set RALINK, SOC_MT7620, PCI_DRIVERS_LEGACY make menuconfig # set PCI make there exists the following build error: LD vmlinux.o MODPOST vmlinux.symvers MODINFO modules.builtin.modinfo GEN modules.builtin LD .tmp_vmlinux.kallsyms1 drivers/pci/pci.o: In function `devm_pci_remap_iospace': pci.c:(.text+0x4d24): undefined reference to `pci_remap_iospace' Makefile:1158: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC can fix the build error, with this patch, no build error remains. This patch is similar with commit e538e8649892 ("MIPS: asm: pci: define arch-specific 'pci_remap_iospace()' dependent on 'CONFIG_PCI_DRIVERS_GENERIC'"). [1] https://lore.kernel.org/lkml/202205251247.nQ5cxSV6-lkp@intel.com/ Fixes: 09d97da660ff ("MIPS: Only define pci_remap_iospace() for Ralink") Reported-by: kernel test robot Signed-off-by: Tiezhu Yang Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 6c465408a7709cf180cde7569e141191b67a175c Author: Geert Uytterhoeven Date: Tue May 24 16:11:53 2022 +0200 dt-bindings: net: adin: Fix adi,phy-output-clock description syntax "make dt_binding_check": Documentation/devicetree/bindings/net/adi,adin.yaml:40:77: [error] syntax error: mapping values are not allowed here (syntax) The first line of the description ends with a colon, hence the block needs to be marked with a "|". Fixes: 1f77204e11f8b9e5 ("dt-bindings: net: adin: document phy clock output properties") Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/r/6fcef2665a6cd86a021509a84c5956ec2efd93ed.1653401420.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit ed6cd6a17896561b9f51ab4c0d9bbb29e762b597 Author: Daniel Borkmann Date: Wed May 25 00:56:18 2022 +0200 net, neigh: Set lower cap for neigh_managed_work rearming Yuwei reported that plain reuse of DELAY_PROBE_TIME to rearm work queue in neigh_managed_work is problematic if user explicitly configures the DELAY_PROBE_TIME to 0 for a neighbor table. Such misconfig can then hog CPU to 100% processing the system work queue. Instead, set lower interval bound to HZ which is totally sufficient. Yuwei is additionally looking into making the interval separately configurable from DELAY_PROBE_TIME. Reported-by: Yuwei Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/netdev/797c3c53-ce1b-9f60-e253-cda615788f4a@iogearbox.net Reviewed-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/3b8c5aa906c52c3a8c995d1b2e8ccf650ea7c716.1653432794.git.daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit b3b1a17538d3ef6a9667b2271216fd16d7678ab5 Author: liuyacan Date: Wed May 25 16:54:08 2022 +0800 net/smc: set ini->smcrv2.ib_dev_v2 to NULL if SMC-Rv2 is unavailable In the process of checking whether RDMAv2 is available, the current implementation first sets ini->smcrv2.ib_dev_v2, and then allocates smc buf desc and register rmb, but the latter may fail. In this case, the pointer should be reset. Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2") Signed-off-by: liuyacan Reviewed-by: Karsten Graul Link: https://lore.kernel.org/r/20220525085408.812273-1-liuyacan@corp.netease.com Signed-off-by: Jakub Kicinski commit 215cd9897afbce9a964d4afbeec58c086d6cb170 Author: luyun Date: Wed May 25 11:18:19 2022 +0800 selftests/net: enable lo.accept_local in psock_snd test The psock_snd test sends and receives packets over loopback, and the test results depend on parameter settings: Set rp_filter=0, or set rp_filter=1 and accept_local=1 so that the test will pass. Otherwise, this test will fail with Resource temporarily unavailable: sudo ./psock_snd.sh dgram tx: 128 rx: 142 ./psock_snd: recv: Resource temporarily unavailable For most distro kernel releases(like Ubuntu or Centos), the parameter rp_filter is enabled by default, so it's necessary to enable the parameter lo.accept_local in psock_snd test. And this test runs inside a netns, changing a sysctl is fine. Signed-off-by: luyun Reviewed-by: Jackie Liu Tested-by: Hangbin Liu Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20220525031819.866684-1-luyun_611@163.com Signed-off-by: Jakub Kicinski commit d0bbe0328fe552ff3211b3cbbf6117a885a3d5b2 Author: Min Li Date: Tue May 24 10:45:01 2022 -0400 ptp: ptp_clockmatrix: fix is_single_shot is_single_shot should return false for the power_of_2 mask Fixes: bec67592521e ("ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support") Signed-off-by: Min Li Link: https://lore.kernel.org/r/1653403501-12621-1-git-send-email-min.li.xe@renesas.com Signed-off-by: Jakub Kicinski commit 0b7180072a9df5e18af5b58410fec38230848a8d Author: Siddharth Vadapalli Date: Tue May 24 11:55:58 2022 +0530 net: ethernet: ti: am65-cpsw: Fix fwnode passed to phylink_create() am65-cpsw-nuss driver incorrectly uses fwnode member of common ethernet device's "struct device_node" instead of using fwnode member of the port's "struct device_node" in phylink_create(). This results in all ports having the same phy data when there are multiple ports with their phy properties populated in their respective nodes rather than the common ethernet device node. Fix it here by using fwnode member of the port's node. Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK") Signed-off-by: Siddharth Vadapalli Link: https://lore.kernel.org/r/20220524062558.19296-1-s-vadapalli@ti.com Signed-off-by: Jakub Kicinski commit 1679ea99bcfa8c68518b04c87992b2b2fc096513 Merge: 7e062cda7d905 1a1a0e80e005c Author: Jakub Kicinski Date: Wed May 25 21:36:19 2022 -0700 Merge branch 'amt-fix-several-bugs' Taehee Yoo says: ==================== amt: fix several bugs This patchset fixes several bugs in amt module First patch fixes typo. Second patch fixes wrong return value of amt_update_handler(). A relay finds a tunnel if it receives an update message from the gateway. If it can't find a tunnel, amt_update_handler() should return an error, not success. But it always returns success. Third patch fixes a possible memory leak in amt_rcv(). A skb would not be freed if an amt interface doesn't have a socket. ==================== Link: https://lore.kernel.org/r/20220523161708.29518-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski commit 1a1a0e80e005cbdc2c250fc858e1d8570f4e4acb Author: Taehee Yoo Date: Mon May 23 16:17:08 2022 +0000 amt: fix possible memory leak in amt_rcv() If an amt receives packets and it finds socket. If it can't find a socket, it should free a received skb. But it doesn't. So, a memory leak would possibly occur. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit ac1dbf55981b88d64312858ea06e3e63001f085d Author: Taehee Yoo Date: Mon May 23 16:17:07 2022 +0000 amt: fix return value of amt_update_handler() If a relay receives an update message, it lookup a tunnel. and if there is no tunnel for that message, it should be treated as an error, not a success. But amt_update_handler() returns false, which means success. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit 4934609dda03ec90ca5052deecbe455b09a44e21 Author: Taehee Yoo Date: Mon May 23 16:17:06 2022 +0000 amt: fix typo in amt AMT_MSG_TEARDOWM is defined, But it should be AMT_MSG_TEARDOWN. Fixes: b9022b53adad ("amt: add control plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit babf0bb978e3c9fce6c4eba6b744c8754fd43d8e Merge: e375780b631a5 efd409a4329f6 Author: Linus Torvalds Date: Wed May 25 19:34:40 2022 -0700 Merge tag 'xfs-5.19-for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Dave Chinner: "This is a big update with lots of new code. The summary below them all, so I'll just touch on teh higlights. The two main new features are Large Extent Counts and Logged Attribute Replay - these are two new foundational features that we are building more complex future features on top of. For upcoming functionality, we need to be able to store hundreds of millions of xattrs per inode. The Large Extent Count feature removes the limits that prevent this scale of xattr storage, and while we were modifying the on disk extent count format we also increased the number of data extents we support per inode from 2^32 to 2^47. We also need to be able to modify xattrs as part of larger atomic transactions rather than as standalone transactions. The Logged Attribute Replay feature introduces the infrastructure that allows us to use intents to record the attribute modifications in the journal before we start them, hence allowing other atomic transactions to log attribute modification intents and then defer the actual modification to later. If we then crash, log recovery then guarantees that the attribute is replayed in the context of the atomic transaction that logged the intent. A significant chunk of the commits in this merge are for the base attribute replay functionality along with fixes, improvements and cleanups related to this new functioanlity. Allison deserves a big round of thanks for her ongoing work to get this functionality into XFS. There are also many other smaller changes and improvements, so overall this is one of the bigger XFS merge requests in some time. I will be following up next week with another smaller pull request - we already have another round of fixes and improvements to the logged attribute replay functionality just about ready to go. They'll soak and test over the next week, and I'll send a pull request for them near the end of the merge window. Summary: - support for printk message indexing. - large extent counts to provide support for up to 2^47 data extents and 2^32 attribute extents, allowing us to scale beyond 4 billion data extents to billions of xattrs per inode. - conversion of various flags fields to be consistently declared as unsigned bit fields. - improvements to realtime extent accounting and converts them to per-cpu counters to match all the other block and inode accounting. - reworks core log formatting code to reduce iterations, have a shorter, cleaner fast path and generally be easier to understand and maintain. - improvements to rmap btree searches that reduce overhead by up to 30% resulting in xfs_scrub runtime reductions of 15%. - improvements to reflink that remove the size limitations in remapping operations and greatly reduce the size of transaction reservations. - reworks the minimum log size calculations to allow us to change transaction reservations without changing the minimum supported log size. - removal of quota warning support as it has never been used on Linux. - intent whiteouts to allow us to cancel intents that are completed entirely in memory rather than having use CPU and disk bandwidth formatting and writing them into the journal when it is not necessary. This makes rmap, reflink and extent freeing slightly more efficient, but provides massive improvements for.... - Logged Attribute Replay feature support. This is a fundamental change to the way we modify attributes, laying the foundation for future integration of attribute modifications as part of other atomic transactional operations the filesystem performs. - Lots of cleanups and fixes for the logged attribute replay functionality" * tag 'xfs-5.19-for-linus' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (124 commits) xfs: can't use kmem_zalloc() for attribute buffers xfs: detect empty attr leaf blocks in xfs_attr3_leaf_verify xfs: ATTR_REPLACE algorithm with LARP enabled needs rework xfs: use XFS_DA_OP flags in deferred attr ops xfs: remove xfs_attri_remove_iter xfs: switch attr remove to xfs_attri_set_iter xfs: introduce attr remove initial states into xfs_attr_set_iter xfs: xfs_attr_set_iter() does not need to return EAGAIN xfs: clean up final attr removal in xfs_attr_set_iter xfs: remote xattr removal in xfs_attr_set_iter() is conditional xfs: XFS_DAS_LEAF_REPLACE state only needed if !LARP xfs: split remote attr setting out from replace path xfs: consolidate leaf/node states in xfs_attr_set_iter xfs: kill XFS_DAC_LEAF_ADDNAME_INIT xfs: separate out initial attr_set states xfs: don't set quota warning values xfs: remove warning counters from struct xfs_dquot_res xfs: remove quota warning limit from struct xfs_quota_limits xfs: rework deferred attribute operation setup xfs: make xattri_leaf_bp more useful ... commit e375780b631a5fc2a61a3b4fa12429255361a31e Merge: 8b728edc5be16 dccd855771b37 Author: Linus Torvalds Date: Wed May 25 19:29:54 2022 -0700 Merge tag 'fsnotify_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "The biggest part of this is support for fsnotify inode marks that don't pin inodes in memory but rather get evicted together with the inode (they are useful if userspace needs to exclude receipt of events from potentially large subtrees using fanotify ignore marks). There is also a fix for more consistent handling of events sent to parent and a fix of sparse(1) complaints" * tag 'fsnotify_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: fix incorrect fmode_t casts fsnotify: consistent behavior for parent not watching children fsnotify: introduce mark type iterator fanotify: enable "evictable" inode marks fanotify: use fsnotify group lock helpers fanotify: implement "evictable" inode marks fanotify: factor out helper fanotify_mark_update_flags() fanotify: create helper fanotify_mark_user_flags() fsnotify: allow adding an inode mark without pinning inode dnotify: use fsnotify group lock helpers nfsd: use fsnotify group lock helpers audit: use fsnotify group lock helpers inotify: use fsnotify group lock helpers fsnotify: create helpers for group mark_mutex lock fsnotify: make allow_dups a property of the group fsnotify: pass flags argument to fsnotify_alloc_group() fsnotify: fix wrong lockdep annotations inotify: move control flags from mask to mark flags inotify: show inotify mask flags in proc fdinfo commit 8b728edc5be161799434cc17e1279db2f8eabe29 Merge: 3f306ea2e1856 2999e1e387271 Author: Linus Torvalds Date: Wed May 25 19:24:06 2022 -0700 Merge tag 'fs_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull writeback and ext2 cleanups from Jan Kara: "One small ext2 cleanup and one writeback spelling fix" * tag 'fs_for_v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: writeback: fix typo in comment fs: ext2: Fix duplicate included linux/dax.h commit 3f306ea2e18568f693f7763d1c2178f349ae8f31 Merge: fbe86daca0ba8 4a37f3dd9a831 Author: Linus Torvalds Date: Wed May 25 19:18:36 2022 -0700 Merge tag 'dma-mapping-5.19-2022-05-25' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - don't over-decrypt memory (Robin Murphy) - takes min align mask into account for the swiotlb max mapping size (Tianyu Lan) - use GFP_ATOMIC in dma-debug (Mikulas Patocka) - fix DMA_ATTR_NO_KERNEL_MAPPING on xen/arm (me) - don't fail on highmem CMA pages in dma_direct_alloc_pages (me) - cleanup swiotlb initialization and share more code with swiotlb-xen (me, Stefano Stabellini) * tag 'dma-mapping-5.19-2022-05-25' of git://git.infradead.org/users/hch/dma-mapping: (23 commits) dma-direct: don't over-decrypt memory swiotlb: max mapping size takes min align mask into account swiotlb: use the right nslabs-derived sizes in swiotlb_init_late swiotlb: use the right nslabs value in swiotlb_init_remap swiotlb: don't panic when the swiotlb buffer can't be allocated dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC dma-direct: don't fail on highmem CMA pages in dma_direct_alloc_pages swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm x86: remove cruft from swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl swiotlb: merge swiotlb-xen initialization into swiotlb swiotlb: provide swiotlb_init variants that remap the buffer swiotlb: pass a gfp_mask argument to swiotlb_init_late swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction swiotlb: make the swiotlb_init interface more useful x86: centralize setting SWIOTLB_FORCE when guest memory encryption is enabled x86: remove the IOMMU table infrastructure MIPS/octeon: use swiotlb_init instead of open coding it arm/xen: don't check for xen_initial_domain() in xen_create_contiguous_region swiotlb: rename swiotlb_late_init_with_default_size ... commit fbe86daca0ba878b04fa241b85e26e54d17d4229 Merge: d7227785e384d 325d5c5fb2166 Author: Linus Torvalds Date: Wed May 25 19:09:48 2022 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This consists of a small set of driver updates (lpfc, ufs, mpt3sas mpi3mr, iscsi target). Apart from that this is mostly small fixes with very few core changes (the biggest one being VPD caching)" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (177 commits) scsi: target: tcmu: Avoid holding XArray lock when calling lock_page scsi: elx: efct: Remove NULL check after calling container_of() scsi: dpt_i2o: Drop redundant spinlock initialization scsi: qedf: Remove redundant variable op scsi: hisi_sas: Fix memory ordering in hisi_sas_task_deliver() scsi: fnic: Replace DMA mask of 64 bits with 47 bits scsi: mpi3mr: Add target device related sysfs attributes scsi: mpi3mr: Add shost related sysfs attributes scsi: elx: efct: Remove redundant memset() statement scsi: megaraid_sas: Remove redundant memset() statement scsi: mpi3mr: Return error if dma_alloc_coherent() fails scsi: hisi_sas: Fix rescan after deleting a disk scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset scsi: libsas: Refactor sas_ata_hard_reset() scsi: mpt3sas: Update driver version to 42.100.00.00 scsi: mpt3sas: Fix junk chars displayed while printing ChipName scsi: ipr: Use kobj_to_dev() scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init() scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc() scsi: libfc: Remove get_cpu() semantics in fc_exch_em_alloc() ... commit 324373f476936b6c8d6a83086a8025a818c1b9e6 Author: Guo Ren Date: Wed May 25 12:04:04 2022 -0400 riscv: compat: Using seperated vdso_maps for compat_vdso_info This is a fixup for vdso implementation which caused musl to fail. [ 11.600082] Run /sbin/init as init process [ 11.628561] init[1]: unhandled signal 11 code 0x1 at 0x0000000000000000 in libc.so[ffffff8ad39000+a4000] [ 11.629398] CPU: 0 PID: 1 Comm: init Not tainted 5.18.0-rc7-next-20220520 #1 [ 11.629462] Hardware name: riscv-virtio,qemu (DT) [ 11.629546] epc : 00ffffff8ada1100 ra : 00ffffff8ada13c8 sp : 00ffffffc58199f0 [ 11.629586] gp : 00ffffff8ad39000 tp : 00ffffff8ade0998 t0 : ffffffffffffffff [ 11.629598] t1 : 00ffffffc5819fd0 t2 : 0000000000000000 s0 : 00ffffff8ade0cc0 [ 11.629610] s1 : 00ffffff8ade0cc0 a0 : 0000000000000000 a1 : 00ffffffc5819a00 [ 11.629622] a2 : 0000000000000001 a3 : 000000000000001e a4 : 00ffffffc5819b00 [ 11.629634] a5 : 00ffffffc5819b00 a6 : 0000000000000000 a7 : 0000000000000000 [ 11.629645] s2 : 00ffffff8ade0ac8 s3 : 00ffffff8ade0ec8 s4 : 00ffffff8ade0728 [ 11.629656] s5 : 00ffffff8ade0a90 s6 : 0000000000000000 s7 : 00ffffffc5819e40 [ 11.629667] s8 : 00ffffff8ade0ca0 s9 : 00ffffff8addba50 s10: 0000000000000000 [ 11.629678] s11: 0000000000000000 t3 : 0000000000000002 t4 : 0000000000000001 [ 11.629688] t5 : 0000000000020000 t6 : ffffffffffffffff [ 11.629699] status: 0000000000004020 badaddr: 0000000000000000 cause: 000000000000000d The last __vdso_init(&compat_vdso_info) replaces the data in normal vdso_info. This is an obvious bug. Reported-by: Guenter Roeck Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Tested-by: Guenter Roeck Link: https://lore.kernel.org/r/20220525160404.2930984-1-guoren@kernel.org Fixes: 3092eb456375 ("riscv: compat: vdso: Add setup additional pages implementation") Signed-off-by: Palmer Dabbelt commit d7227785e384d4422b3ca189aa5bf19f462337cc Merge: 2518f226c60d8 60571929d06b0 Author: Linus Torvalds Date: Wed May 25 16:55:16 2022 -0700 Merge tag 'sound-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "Not much dramatic changes at this time, but we've received quite a lot of changes for ASoC, while there are still a few fixes and quirks for usual HD- and USB-auido. Here are some highlights. ASoC: - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs - Initial stages of Intel AVS driver merge - Introduction of v4 IPC mechanism for SOF - TDM mode support for AK4613 - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780 Others: - A few regression fixes after the USB-audio endpoint management refactoring - More enhancements for Cirrus HD-audio codec support (still ongoing) - Addition of generic serial MIDI driver" * tag 'sound-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (504 commits) ALSA: hda/realtek - Add new type for ALC245 ALSA: usb-audio: Configure sync endpoints before data ALSA: ctxfi: fix typo in comment ALSA: cs5535audio: fix typo in comment ALSA: ctxfi: Add SB046x PCI ID ALSA: usb-audio: Add missing ep_idx in fixed EP quirks ALSA: usb-audio: Workaround for clock setup on TEAC devices ALSA: lola: Bounds check loop iterator against streams array size ASoC: max98090: Move check for invalid values before casting in max98090_put_enab_tlv() ASoC: rt1308-sdw: add the default value of register 0xc320 ASoC: rt9120: Use pm_runtime and regcache to optimize 'pwdnn' logic ASoC: rt9120: Fix 3byte read, valule offset typo ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver. ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver ASoC: wm2000: fix missing clk_disable_unprepare() on error in wm2000_anc_transition() ASoC: codecs: lpass: Fix passing zero to 'PTR_ERR' ASoC: SOF: sof-client-ipc-flood-test: use pm_runtime_resume_and_get() ASoC: SOF: mediatek: remove duplicate include in mt8195.c ASoC: SOF: mediatek: Add mt8195 debug dump ASoC: SOF: mediatek: Add mediatek common debug dump ... commit 2518f226c60d8e04d18ba4295500a5b0b8ac7659 Merge: 86c87bea6b421 c4955d9cd2fc5 Author: Linus Torvalds Date: Wed May 25 16:18:27 2022 -0700 Merge tag 'drm-next-2022-05-25' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Intel have enabled DG2 on certain SKUs for laptops, AMD has started some new GPU support, msm has user allocated VA controls dma-buf: - add dma_resv_replace_fences - add dma_resv_get_singleton - make dma_excl_fence private core: - EDID parser refactorings - switch drivers to drm_mode_copy/duplicate - DRM managed mutex initialization display-helper: - put HDMI, SCDC, HDCP, DSC and DP into new module gem: - rework fence handling ttm: - rework bulk move handling - add common debugfs for resource managers - convert to kvcalloc format helpers: - support monochrome formats - RGB888, RGB565 to XRGB8888 conversions fbdev: - cfb/sys_imageblit fixes - pagelist corruption fix - create offb platform device - deferred io improvements sysfb: - Kconfig rework - support for VESA mode selection bridge: - conversions to devm_drm_of_get_bridge - conversions to panel_bridge - analogix_dp - autosuspend support - it66121 - audio support - tc358767 - DSI to DPI support - icn6211 - PLL/I2C fixes, DT property - adv7611 - enable DRM_BRIDGE_OP_HPD - anx7625 - fill ELD if no monitor - dw_hdmi - add audio support - lontium LT9211 support, i.MXMP LDB - it6505: Kconfig fix, DPCD set power fix - adv7511 - CEC support for ADV7535 panel: - ltk035c5444t, B133UAN01, NV3052C panel support - DataImage FG040346DSSWBG04 support - st7735r - DT bindings fix - ssd130x - fixes i915: - DG2 laptop PCI-IDs ("motherboard down") - Initial RPL-P PCI IDs - compute engine ABI - DG2 Tile4 support - DG2 CCS clear color compression support - DG2 render/media compression formats support - ATS-M platform info - RPL-S PCI IDs added - Bump ADL-P DMC version to v2.16 - Support static DRRS - Support multiple eDP/LVDS native mode refresh rates - DP HDR support for HSW+ - Lots of display refactoring + fixes - GuC hwconfig support and query - sysfs support for multi-tile - fdinfo per-client gpu utilisation - add geometry subslices query - fix prime mmap with LMEM - fix vm open count and remove vma refcounts - contiguous allocation fixes - steered register write support - small PCI BAR enablement - GuC error capture support - sunset igpu legacy mmap support for newer devices - GuC version 70.1.1 support amdgpu: - Initial SoC21 support - SMU 13.x enablement - SMU 13.0.4 support - ttm_eu cleanups - USB-C, GPUVM updates - TMZ fixes for RV - RAS support for VCN - PM sysfs code cleanup - DC FP rework - extend CG/PG flags to 64-bit - SI dpm lockdep fix - runtime PM fixes amdkfd: - RAS/SVM fixes - TLB flush fixes - CRIU GWS support - ignore bogus MEC signals more efficiently msm: - Fourcc modifier for tiled but not compressed layouts - Support for userspace allocated IOVA (GPU virtual address) - DPU: DSC (Display Stream Compression) support - DP: eDP support - DP: conversion to use drm_bridge and drm_bridge_connector - Merge DPU1 and MDP5 MDSS driver - DPU: writeback support nouveau: - make some structures static - make some variables static - switch to drm_gem_plane_helper_prepare_fb radeon: - misc fixes/cleanups mxsfb: - rework crtc mode setting - LCDIF CRC support etnaviv: - fencing improvements - fix address space collisions - cleanup MMU reference handling gma500: - GEM/GTT improvements - connector handling fixes komeda: - switch to plane reset helper mediatek: - MIPI DSI improvements omapdrm: - GEM improvements qxl: - aarch64 support vc4: - add a CL submission tracepoint - HDMI YUV support - HDMI/clock improvements - drop is_hdmi caching virtio: - remove restriction of non-zero blob types vmwgfx: - support for cursormob and cursorbypass 4 - fence improvements tidss: - reset DISPC on startup solomon: - SPI support - DT improvements sun4i: - allwinner D1 support - drop is_hdmi caching imx: - use swap() instead of open-coding - use devm_platform_ioremap_resource - remove redunant initializations ast: - Displayport support rockchip: - Refactor IOMMU initialisation - make some structures static - replace drm_detect_hdmi_monitor with drm_display_info.is_hdmi - support swapped YUV formats, - clock improvements - rk3568 support - VOP2 support mediatek: - MT8186 support tegra: - debugabillity improvements" * tag 'drm-next-2022-05-25' of git://anongit.freedesktop.org/drm/drm: (1740 commits) drm/i915/dsi: fix VBT send packet port selection for ICL+ drm/i915/uc: Fix undefined behavior due to shift overflowing the constant drm/i915/reg: fix undefined behavior due to shift overflowing the constant drm/i915/gt: Fix use of static in macro mismatch drm/i915/audio: fix audio code enable/disable pipe logging drm/i915: Fix CFI violation with show_dynamic_id() drm/i915: Fix 'mixing different enum types' warnings in intel_display_power.c drm/i915/gt: Fix build error without CONFIG_PM drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path drm/msm/dpu: add DRM_MODE_ROTATE_180 back to supported rotations drm/msm: don't free the IRQ if it was not requested drm/msm/dpu: limit writeback modes according to max_linewidth drm/amd: Don't reset dGPUs if the system is going to s2idle drm/amdgpu: Unmap legacy queue when MES is enabled drm: msm: fix possible memory leak in mdp5_crtc_cursor_set() drm/msm: Fix fb plane offset calculation drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init drm/msm/dsi: don't powerup at modeset time for parade-ps8640 drm/rockchip: Change register space names in vop2 dt-bindings: display: rockchip: make reg-names mandatory for VOP2 ... commit 86c87bea6b42100c67418af690919c44de6ede6e Merge: d223575e50f8d d036d915b61f2 Author: Linus Torvalds Date: Wed May 25 14:56:06 2022 -0700 Merge tag 'devicetree-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "Bindings: - Convert smsc,lan91c111, qcom,spi-qup, qcom,msm-uartdm, qcom,i2c-qup, qcom,gsbi, i2c-mt65xx, TI wkup_m3_ipc (and new props), qcom,smp2p, TI timer, Mediatek gnss, Mediatek topckgen, Mediatek apmixedsys, Mediatek infracfg, fsl,ls-extirq, fsl,layerscape-dcfg, QCom PMIC SPMI, rda,8810pl-timer, Xilinx zynqmp_ipi, uniphier-pcie, and Ilitek touchscreen controllers - Convert various Arm Ltd peripheral IP bindings to schemas - New bindings for Menlo board CPLD, DH electronics board CPLD, Qualcomm Geni based QUP I2C, Renesas RZ/G2UL OSTM, Broafcom BCM4751 GNSS, MT6360 PMIC, ASIX USB Ethernet controllers, and Microchip/SMSC LAN95xx USB Ethernet controllers - Add vendor prefix for Enclustra - Add various compatible string additions - Various example fixes and cleanups - Remove unused hisilicon,hi6220-reset binding - Treewide fix properties missing type definition - Drop some empty and unreferenced .txt bindings - Documentation improvements for writing schemas DT driver core: - Drop static IRQ resources for DT platform devices as IRQ setup is dynamic and drivers have all been converted to use platform_get_irq() and friends - Rework memory allocations and frees for overlays - Continue overlay notifier callbacks on successful calls and add unittests - Handle 'interrupts-extended' in early DT IRQ setup - Fix of_property_read_string() errors to match documentation - Ignore disabled nodes in FDT API calls" * tag 'devicetree-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (86 commits) of/irq: fix typo in comment dt-bindings: Fix properties without any type Revert "dt-bindings: mailbox: qcom-ipcc: add missing properties into example" dt-bindings: input: touchscreen: ilitek_ts_i2c: Absorb ili2xxx bindings dt-bindings: timer: samsung,exynos4210-mct: define strict clock order dt-bindings: timer: samsung,exynos4210-mct: drop unneeded minItems dt-bindings: timer: cdns,ttc: drop unneeded minItems dt-bindings: mailbox: zynqmp_ipi: convert to yaml dt-bindings: usb: ci-hdrc-usb2: fix node node for ethernet controller dt-bindings: net: add schema for Microchip/SMSC LAN95xx USB Ethernet controllers dt-bindings: net: add schema for ASIX USB Ethernet controllers of/fdt: Ignore disabled memory nodes dt-bindings: arm: fix typos in compatible dt-bindings: mfd: Add bindings child nodes for the Mediatek MT6360 dt-bindings: display: convert Arm Komeda to DT schema dt-bindings: display: convert Arm Mali-DP to DT schema dt-bindings: display: convert Arm HDLCD to DT schema dt-bindings: display: convert PL110/PL111 to DT schema dt-bindings: arm: convert vexpress-config to DT schema dt-bindings: arm: convert vexpress-sysregs to DT schema ... commit d223575e50f8da0de358c0098defd560069ecf66 Merge: e908305fb2625 5d2b6bc3a6a27 Author: Linus Torvalds Date: Wed May 25 14:46:09 2022 -0700 Merge tag 'perf-tools-for-v5.19-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tool updates from Arnaldo Carvalho de Melo: "Intel PT: - Allow hardware tracing on KVM test programs. In this case, the VM is not running an OS, but only the functions loaded into it by the hypervisor test program, and conveniently, loaded at the same virtual addresses. - Improve documentation: - Add link to perf wiki's page - Cleanups: - Delete now unused perf-with-kcore.sh script - Remove unused machines__find_host() ARM SPE (Statistical Profile Extensions): - Add man page entry. Vendor Events: - Update various Intel event topics - Update various microarch events - Fix various cstate metrics - Fix Alderlake metric groups - Add sapphirerapids events - Add JSON files for ARM Cortex A34, A35, A55, A510, A65, A73, A75, A77, A78, A710, X1, X2 and Neoverse E1 - Update Cortex A57/A72 perf stat: - Introduce stats for the user and system rusage times perf c2c: - Prep work to support ARM systems perf annotate: - Add --percent-limit option perf lock: - Add -t/--thread option for report - Do not discard broken lock stats perf bench: - Add breakpoint benchmarks perf test: - Limit to only run executable scripts in tests - Add basic perf record tests - Add stat record+report test - Add basic stat and topdown group test - Skip several tests when the user hasn't permission to perform them - Fix test case 81 ("perf record tests") on s390x perf version: - debuginfod support improvements perf scripting python: - Expose symbol offset and source information perf build: - Error for BPF skeletons without LIBBPF - Use Python devtools for version autodetection rather than runtime Miscellaneous: - Add riscv64 support to 'perf jitdump' - Various fixes/tidy ups related to cpu_map - Fixes for handling Intel hybrid systems" * tag 'perf-tools-for-v5.19-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (122 commits) perf intel-pt: Add guest_code support perf kvm report: Add guest_code support perf script: Add guest_code support perf tools: Add guest_code support perf tools: Factor out thread__set_guest_comm() perf tools: Add machine to machines back pointer perf vendors events arm64: Update Cortex A57/A72 perf vendors events arm64: Arm Neoverse E1 perf vendors events arm64: Arm Cortex-X2 perf vendors events arm64: Arm Cortex-X1 perf vendors events arm64: Arm Cortex-A710 perf vendors events arm64: Arm Cortex-A78 perf vendors events arm64: Arm Cortex-A77 perf vendors events arm64: Arm Cortex-A75 perf vendors events arm64: Arm Cortex-A73 perf vendors events arm64: Arm Cortex-A65 perf vendors events arm64: Arm Cortex-A510 perf vendors events arm64: Arm Cortex-A55 perf vendors events arm64: Arm Cortex-A35 perf vendors events arm64: Arm Cortex-A34 ... commit d9e418d0ca1c464fe361468b772d4aa870d54e63 Author: Palmer Dabbelt Date: Tue Apr 19 20:13:27 2022 -0700 RISC-V: Fix the XIP build A handful of functions unused functions were enabled during XIP builds, which themselves didn't build correctly. This just disables the functions entirely. Fixes: e8a62cc26ddf ("riscv: Implement sv48 support") Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220420184056.7886-5-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit e7681beba992d5a196476d5d79dfcb48f2a2c477 Author: Palmer Dabbelt Date: Tue Apr 19 20:02:16 2022 -0700 RISC-V: Split out the XIP fixups into their own file This was broken by the original refactoring (as the XIP definitions depend on ) and then more broken by the merge (as I accidentally took the old version). This fixes both breakages, while also pulling this out of to avoid polluting most assembly files with the XIP fixups. Fixes: bee7fbc38579 ("RISC-V CPU Idle Support") Fixes: 63b13e64a829 ("RISC-V: Add arch functions for non-retentive suspend entry/exit") Link: https://lore.kernel.org/r/20220420184056.7886-4-palmer@rivosinc.com Reviewed-by: Guo Ren Signed-off-by: Palmer Dabbelt commit e908305fb262588471958f560eb3c6c18cc683a1 Merge: 62e5873ec96bc 73f1d07e5f8a1 Author: Linus Torvalds Date: Wed May 25 14:37:00 2022 -0700 Merge tag 'checkpatch-new-alloc-check-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull checkpatch update from Gustavo Silva: "kvmalloc() and kvzalloc() functions have now 2-factor multiplication argument forms kvmalloc_array() and kvcalloc(). Add alloc-with-multiplies checks for these new functions" * tag 'checkpatch-new-alloc-check-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: checkpatch: add new alloc functions to alloc with multiplies check commit e35c2d8e22745751cf304ec3fe39616643db2e0a Author: Li Huafei Date: Wed Apr 27 11:41:19 2022 +0800 tracing: Reset the function filter after completing trampoline/graph selftest The direct trampoline and graph coexistence test sets global_ops to trace only 'trace_selftest_dynamic_test_func', but does not reset it after the test is completed, resulting in the function filter being set already after the system starts. Although it can be reset through the tracefs interface, it is more or less confusing to the user, and we should reset it to trace all functions after the trampoline/graph test completes. Link: https://lkml.kernel.org/r/20220427034119.24668-1-lihuafei1@huawei.com Link: https://lore.kernel.org/all/20220418073958.104029-1-lihuafei1@huawei.com/ Fixes: 130c08065848 ("tracing: Add trampoline/graph selftest") Signed-off-by: Li Huafei Signed-off-by: Steven Rostedt (Google) commit 499f12168aebd6da8fa32c9b7d6203ca9b5eb88d Author: Steven Rostedt (Google) Date: Thu Apr 7 14:56:32 2022 -0400 tracing: Have event format check not flag %p* on __get_dynamic_array() The print fmt check against trace events to make sure that the format does not use pointers that may be freed from the time of the trace to the time the event is read, gives a false positive on %pISpc when reading data that was saved in __get_dynamic_array() when it is perfectly fine to do so, as the data being read is on the ring buffer. Link: https://lore.kernel.org/all/20220407144524.2a592ed6@canb.auug.org.au/ Cc: stable@vger.kernel.org Fixes: 5013f454a352c ("tracing: Add check of trace event print fmts for dereferencing pointers") Reported-by: Stephen Rothwell Signed-off-by: Steven Rostedt (Google) commit 62e5873ec96bc2cfe809a1bc123af8101989ef5f Merge: a3a8b54b4f1a2 746f1b0ac5bf6 Author: Linus Torvalds Date: Wed May 25 13:56:57 2022 -0700 Merge tag 'size_t-saturating-helpers-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull misc hardening updates from Gustavo Silva: "Replace a few open-coded instances with size_t saturating arithmetic helpers" * tag 'size_t-saturating-helpers-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: virt: acrn: Prefer array_size and struct_size over open coded arithmetic afs: Prefer struct_size over open coded arithmetic commit a3a8b54b4f1a261656eb6c9a517e68e1204cef39 Merge: 7e062cda7d905 336feb502a715 Author: Linus Torvalds Date: Wed May 25 13:52:24 2022 -0700 Merge tag 'Wstringop-overflow-fixes-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull Wstringop-overflow fixes from Gustavo Silva: "Fix some -Wstringop-overflow warnings when building with GCC-11. All the patches have been in linux-next during the last development cycle. This is part of the ongoing efforts to globally enable -Wstringop-overflow" * tag 'Wstringop-overflow-fixes-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency() drm/amd/display: Fix Wstringop-overflow warnings in dc_link_dp.c scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac() commit 3159d79b56c15068aeb7e4630cd5f6dacd20fda4 Author: Congyu Liu Date: Mon May 23 05:35:31 2022 +0000 kcov: update pos before writing pc in trace function In __sanitizer_cov_trace_pc(), previously we write pc before updating pos. However, some early interrupt code could bypass check_kcov_mode() check and invoke __sanitizer_cov_trace_pc(). If such interrupt is raised between writing pc and updating pos, the pc could be overitten by the recursive __sanitizer_cov_trace_pc(). As suggested by Dmitry, we cold update pos before writing pc to avoid such interleaving. Apply the same change to write_comp_data(). Link: https://lkml.kernel.org/r/20220523053531.1572793-1-liu3101@purdue.edu Signed-off-by: Congyu Liu Reviewed-by: Dmitry Vyukov Cc: Andrey Konovalov Signed-off-by: Andrew Morton commit 863e0d81b6683c4cbc588ad831f560c90e494bef Author: Junxiao Bi via Ocfs2-devel Date: Wed May 18 16:52:24 2022 -0700 ocfs2: dlmfs: fix error handling of user_dlm_destroy_lock When user_dlm_destroy_lock failed, it didn't clean up the flags it set before exit. For USER_LOCK_IN_TEARDOWN, if this function fails because of lock is still in used, next time when unlink invokes this function, it will return succeed, and then unlink will remove inode and dentry if lock is not in used(file closed), but the dlm lock is still linked in dlm lock resource, then when bast come in, it will trigger a panic due to user-after-free. See the following panic call trace. To fix this, USER_LOCK_IN_TEARDOWN should be reverted if fail. And also error should be returned if USER_LOCK_IN_TEARDOWN is set to let user know that unlink fail. For the case of ocfs2_dlm_unlock failure, besides USER_LOCK_IN_TEARDOWN, USER_LOCK_BUSY is also required to be cleared. Even though spin lock is released in between, but USER_LOCK_IN_TEARDOWN is still set, for USER_LOCK_BUSY, if before every place that waits on this flag, USER_LOCK_IN_TEARDOWN is checked to bail out, that will make sure no flow waits on the busy flag set by user_dlm_destroy_lock(), then we can simplely revert USER_LOCK_BUSY when ocfs2_dlm_unlock fails. Fix user_dlm_cluster_lock() which is the only function not following this. [ 941.336392] (python,26174,16):dlmfs_unlink:562 ERROR: unlink 004fb0000060000b5a90b8c847b72e1, error -16 from destroy [ 989.757536] ------------[ cut here ]------------ [ 989.757709] kernel BUG at fs/ocfs2/dlmfs/userdlm.c:173! [ 989.757876] invalid opcode: 0000 [#1] SMP [ 989.758027] Modules linked in: ksplice_2zhuk2jr_ib_ipoib_new(O) ksplice_2zhuk2jr(O) mptctl mptbase xen_netback xen_blkback xen_gntalloc xen_gntdev xen_evtchn cdc_ether usbnet mii ocfs2 jbd2 rpcsec_gss_krb5 auth_rpcgss nfsv4 nfsv3 nfs_acl nfs fscache lockd grace ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs bnx2fc fcoe libfcoe libfc scsi_transport_fc sunrpc ipmi_devintf bridge stp llc rds_rdma rds bonding ib_sdp ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm falcon_lsm_serviceable(PE) falcon_nf_netcontain(PE) mlx4_vnic falcon_kal(E) falcon_lsm_pinned_13402(E) mlx4_ib ib_sa ib_mad ib_core ib_addr xenfs xen_privcmd dm_multipath iTCO_wdt iTCO_vendor_support pcspkr sb_edac edac_core i2c_i801 lpc_ich mfd_core ipmi_ssif i2c_core ipmi_si ipmi_msghandler [ 989.760686] ioatdma sg ext3 jbd mbcache sd_mod ahci libahci ixgbe dca ptp pps_core vxlan udp_tunnel ip6_udp_tunnel megaraid_sas mlx4_core crc32c_intel be2iscsi bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi ipv6 cxgb3 mdio libiscsi_tcp qla4xxx iscsi_boot_sysfs libiscsi scsi_transport_iscsi wmi dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ksplice_2zhuk2jr_ib_ipoib_old] [ 989.761987] CPU: 10 PID: 19102 Comm: dlm_thread Tainted: P OE 4.1.12-124.57.1.el6uek.x86_64 #2 [ 989.762290] Hardware name: Oracle Corporation ORACLE SERVER X5-2/ASM,MOTHERBOARD,1U, BIOS 30350100 06/17/2021 [ 989.762599] task: ffff880178af6200 ti: ffff88017f7c8000 task.ti: ffff88017f7c8000 [ 989.762848] RIP: e030:[] [] __user_dlm_queue_lockres.part.4+0x76/0x80 [ocfs2_dlmfs] [ 989.763185] RSP: e02b:ffff88017f7cbcb8 EFLAGS: 00010246 [ 989.763353] RAX: 0000000000000000 RBX: ffff880174d48008 RCX: 0000000000000003 [ 989.763565] RDX: 0000000000120012 RSI: 0000000000000003 RDI: ffff880174d48170 [ 989.763778] RBP: ffff88017f7cbcc8 R08: ffff88021f4293b0 R09: 0000000000000000 [ 989.763991] R10: ffff880179c8c000 R11: 0000000000000003 R12: ffff880174d48008 [ 989.764204] R13: 0000000000000003 R14: ffff880179c8c000 R15: ffff88021db7a000 [ 989.764422] FS: 0000000000000000(0000) GS:ffff880247480000(0000) knlGS:ffff880247480000 [ 989.764685] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 989.764865] CR2: ffff8000007f6800 CR3: 0000000001ae0000 CR4: 0000000000042660 [ 989.765081] Stack: [ 989.765167] 0000000000000003 ffff880174d48040 ffff88017f7cbd18 ffffffffc07d455f [ 989.765442] ffff88017f7cbd88 ffffffff816fb639 ffff88017f7cbd38 ffff8800361b5600 [ 989.765717] ffff88021db7a000 ffff88021f429380 0000000000000003 ffffffffc0453020 [ 989.765991] Call Trace: [ 989.766093] [] user_bast+0x5f/0xf0 [ocfs2_dlmfs] [ 989.766287] [] ? schedule_timeout+0x169/0x2d0 [ 989.766475] [] ? o2dlm_lock_ast_wrapper+0x20/0x20 [ocfs2_stack_o2cb] [ 989.766738] [] o2dlm_blocking_ast_wrapper+0x1a/0x20 [ocfs2_stack_o2cb] [ 989.767010] [] dlm_do_local_bast+0x46/0xe0 [ocfs2_dlm] [ 989.767217] [] ? dlm_lockres_calc_usage+0x4c/0x60 [ocfs2_dlm] [ 989.767466] [] dlm_thread+0xa31/0x1140 [ocfs2_dlm] [ 989.767662] [] ? __schedule+0x24a/0x810 [ 989.767834] [] ? __schedule+0x23e/0x810 [ 989.768006] [] ? __schedule+0x24a/0x810 [ 989.768178] [] ? __schedule+0x23e/0x810 [ 989.768349] [] ? __schedule+0x24a/0x810 [ 989.768521] [] ? __schedule+0x23e/0x810 [ 989.768693] [] ? __schedule+0x24a/0x810 [ 989.768893] [] ? __schedule+0x23e/0x810 [ 989.769067] [] ? __schedule+0x24a/0x810 [ 989.769241] [] ? wait_woken+0x90/0x90 [ 989.769411] [] ? dlm_kick_thread+0x80/0x80 [ocfs2_dlm] [ 989.769617] [] kthread+0xcb/0xf0 [ 989.769774] [] ? __schedule+0x24a/0x810 [ 989.769945] [] ? __schedule+0x24a/0x810 [ 989.770117] [] ? kthread_create_on_node+0x180/0x180 [ 989.770321] [] ret_from_fork+0x61/0x90 [ 989.770492] [] ? kthread_create_on_node+0x180/0x180 [ 989.770689] Code: d0 00 00 00 f0 45 7d c0 bf 00 20 00 00 48 89 83 c0 00 00 00 48 89 83 c8 00 00 00 e8 55 c1 8c c0 83 4b 04 10 48 83 c4 08 5b 5d c3 <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 55 41 54 53 48 83 [ 989.771892] RIP [] __user_dlm_queue_lockres.part.4+0x76/0x80 [ocfs2_dlmfs] [ 989.772174] RSP [ 989.772704] ---[ end trace ebd1e38cebcc93a8 ]--- [ 989.772907] Kernel panic - not syncing: Fatal exception [ 989.773173] Kernel Offset: disabled Link: https://lkml.kernel.org/r/20220518235224.87100-2-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Signed-off-by: Andrew Morton commit 0b6d14e3dbde9de158263ce5e4a27112693e71ac Author: Junxiao Bi Date: Wed May 18 16:52:23 2022 -0700 ocfs2: dlmfs: don't clear USER_LOCK_ATTACHED when destroying lock The following function is the only place that checks USER_LOCK_ATTACHED. This flag is set when lock request is granted through user_ast() and only the following function will clear it. Checking of this flag here is to make sure ocfs2_dlm_unlock is not issued if this lock is never granted. For example, lock file is created and then get removed, open file never happens. Clearing the flag here is not necessary because this is the only function that checks it, if another flow is executing user_dlm_destroy_lock(), it will bail out at the beginning because of USER_LOCK_IN_TEARDOWN and never check USER_LOCK_ATTACHED. Drop the clear, so we don't need take care of it for the following error handling patch. int user_dlm_destroy_lock(struct user_lock_res *lockres) { ... status = 0; if (!(lockres->l_flags & USER_LOCK_ATTACHED)) { spin_unlock(&lockres->l_lock); goto bail; } lockres->l_flags &= ~USER_LOCK_ATTACHED; lockres->l_flags |= USER_LOCK_BUSY; spin_unlock(&lockres->l_lock); status = ocfs2_dlm_unlock(conn, &lockres->l_lksb, DLM_LKF_VALBLK); if (status) { user_log_dlm_error("ocfs2_dlm_unlock", status, lockres); goto bail; } ... } V1 discussion with Joseph: https://lore.kernel.org/all/7b620c53-0c45-da2c-829e-26195cbe7d4e@linux.alibaba.com/T/ Link: https://lkml.kernel.org/r/20220518235224.87100-1-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi 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 7e062cda7d90543ac8c7700fc7c5527d0c0f22ad Merge: 5d1772b1739b0 57d7becda9c9e Author: Linus Torvalds Date: Wed May 25 12:22:58 2022 -0700 Merge tag 'net-next-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "Core ---- - Support TCPv6 segmentation offload with super-segments larger than 64k bytes using the IPv6 Jumbogram extension header (AKA BIG TCP). - Generalize skb freeing deferral to per-cpu lists, instead of per-socket lists. - Add a netdev statistic for packets dropped due to L2 address mismatch (rx_otherhost_dropped). - Continue work annotating skb drop reasons. - Accept alternative netdev names (ALT_IFNAME) in more netlink requests. - Add VLAN support for AF_PACKET SOCK_RAW GSO. - Allow receiving skb mark from the socket as a cmsg. - Enable memcg accounting for veth queues, sysctl tables and IPv6. BPF --- - Add libbpf support for User Statically-Defined Tracing (USDTs). - Speed up symbol resolution for kprobes multi-link attachments. - Support storing typed pointers to referenced and unreferenced objects in BPF maps. - Add support for BPF link iterator. - Introduce access to remote CPU map elements in BPF per-cpu map. - Allow middle-of-the-road settings for the kernel.unprivileged_bpf_disabled sysctl. - Implement basic types of dynamic pointers e.g. to allow for dynamically sized ringbuf reservations without extra memory copies. Protocols --------- - Retire port only listening_hash table, add a second bind table hashed by port and address. Avoid linear list walk when binding to very popular ports (e.g. 443). - Add bridge FDB bulk flush filtering support allowing user space to remove all FDB entries matching a condition. - Introduce accept_unsolicited_na sysctl for IPv6 to implement router-side changes for RFC9131. - Support for MPTCP path manager in user space. - Add MPTCP support for fallback to regular TCP for connections that have never connected additional subflows or transmitted out-of-sequence data (partial support for RFC8684 fallback). - Avoid races in MPTCP-level window tracking, stabilize and improve throughput. - Support lockless operation of GRE tunnels with seq numbers enabled. - WiFi support for host based BSS color collision detection. - Add support for SO_TXTIME/SCM_TXTIME on CAN sockets. - Support transmission w/o flow control in CAN ISOTP (ISO 15765-2). - Support zero-copy Tx with TLS 1.2 crypto offload (sendfile). - Allow matching on the number of VLAN tags via tc-flower. - Add tracepoint for tcp_set_ca_state(). Driver API ---------- - Improve error reporting from classifier and action offload. - Add support for listing line cards in switches (devlink). - Add helpers for reporting page pool statistics with ethtool -S. - Add support for reading clock cycles when using PTP virtual clocks, instead of having the driver convert to time before reporting. This makes it possible to report time from different vclocks. - Support configuring low-latency Tx descriptor push via ethtool. - Separate Clause 22 and Clause 45 MDIO accesses more explicitly. New hardware / drivers ---------------------- - Ethernet: - Marvell's Octeon NIC PCI Endpoint support (octeon_ep) - Sunplus SP7021 SoC (sp7021_emac) - Add support for Renesas RZ/V2M (in ravb) - Add support for MediaTek mt7986 switches (in mtk_eth_soc) - Ethernet PHYs: - ADIN1100 industrial PHYs (w/ 10BASE-T1L and SQI reporting) - TI DP83TD510 PHY - Microchip LAN8742/LAN88xx PHYs - WiFi: - Driver for pureLiFi X, XL, XC devices (plfxlc) - Driver for Silicon Labs devices (wfx) - Support for WCN6750 (in ath11k) - Support Realtek 8852ce devices (in rtw89) - Mobile: - MediaTek T700 modems (Intel 5G 5000 M.2 cards) - CAN: - ctucanfd: add support for CTU CAN FD open-source IP core from Czech Technical University in Prague Drivers ------- - Delete a number of old drivers still using virt_to_bus(). - Ethernet NICs: - intel: support TSO on tunnels MPLS - broadcom: support multi-buffer XDP - nfp: support VF rate limiting - sfc: use hardware tx timestamps for more than PTP - mlx5: multi-port eswitch support - hyper-v: add support for XDP_REDIRECT - atlantic: XDP support (including multi-buffer) - macb: improve real-time perf by deferring Tx processing to NAPI - High-speed Ethernet switches: - mlxsw: implement basic line card information querying - prestera: add support for traffic policing on ingress and egress - Embedded Ethernet switches: - lan966x: add support for packet DMA (FDMA) - lan966x: add support for PTP programmable pins - ti: cpsw_new: enable bc/mc storm prevention - Qualcomm 802.11ax WiFi (ath11k): - Wake-on-WLAN support for QCA6390 and WCN6855 - device recovery (firmware restart) support - support setting Specific Absorption Rate (SAR) for WCN6855 - read country code from SMBIOS for WCN6855/QCA6390 - enable keep-alive during WoWLAN suspend - implement remain-on-channel support - MediaTek WiFi (mt76): - support Wireless Ethernet Dispatch offloading packet movement between the Ethernet switch and WiFi interfaces - non-standard VHT MCS10-11 support - mt7921 AP mode support - mt7921 IPv6 NS offload support - Ethernet PHYs: - micrel: ksz9031/ksz9131: cabletest support - lan87xx: SQI support for T1 PHYs - lan937x: add interrupt support for link detection" * tag 'net-next-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1809 commits) ptp: ocp: Add firmware header checks ptp: ocp: fix PPS source selector debugfs reporting ptp: ocp: add .init function for sma_op vector ptp: ocp: vectorize the sma accessor functions ptp: ocp: constify selectors ptp: ocp: parameterize input/output sma selectors ptp: ocp: revise firmware display ptp: ocp: add Celestica timecard PCI ids ptp: ocp: Remove #ifdefs around PCI IDs ptp: ocp: 32-bit fixups for pci start address Revert "net/smc: fix listen processing for SMC-Rv2" ath6kl: Use cc-disable-warning to disable -Wdangling-pointer selftests/bpf: Dynptr tests bpf: Add dynptr data slices bpf: Add bpf_dynptr_read and bpf_dynptr_write bpf: Dynptr support for ring buffers bpf: Add bpf_dynptr_from_mem for local dynptrs bpf: Add verifier support for dynptrs bpf: Suppress 'passing zero to PTR_ERR' warning bpf: Introduce bpf_arch_text_invalidate for bpf_prog_pack ... commit 5d1772b1739b085721431eef0c0400f3aff01abf Merge: 8b49c4b1b6f63 10a5a651e3afc Author: Linus Torvalds Date: Wed May 25 11:59:19 2022 -0700 Merge branch 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue update from Tejun Heo: "A lone commit fixing CPU offline handling for per-cpu wq workers so that they don't bother isolated CPUs" * 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs commit 8b49c4b1b6f6397aca3eaee4c79295b74350b7b4 Merge: 64e34b50d7aee b154a017c9201 Author: Linus Torvalds Date: Wed May 25 11:47:25 2022 -0700 Merge branch 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Nothing too interesting. This adds cpu controller selftests and there are a couple code cleanup patches" * 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: remove the superfluous judgment cgroup: Make cgroup_debug static kseltest/cgroup: Make test_stress.sh work if run interactively kselftest/cgroup: fix test_stress.sh to use OUTPUT dir cgroup: Add config file to cgroup selftest suite cgroup: Add test_cpucg_max_nested() testcase cgroup: Add test_cpucg_max() testcase cgroup: Add test_cpucg_nested_weight_underprovisioned() testcase cgroup: Adding test_cpucg_nested_weight_overprovisioned() testcase cgroup: Add test_cpucg_weight_underprovisioned() testcase cgroup: Add test_cpucg_weight_overprovisioned() testcase cgroup: Add test_cpucg_stats() testcase to cgroup cpu selftests cgroup: Add new test_cpu.c test suite in cgroup selftests commit af7dc8e5124daf017ebc85c8ea97212e1e2e62fe Author: Jeff Layton Date: Mon May 23 13:22:09 2022 -0400 MAINTAINERS: move myself from ceph "Maintainer" to "Reviewer" Xiubo has graciously volunteered to take over for me as the Linux cephfs client maintainer. Make it official by changing myself to be a "Reviewer" for libceph and ceph. Signed-off-by: Jeff Layton Acked-by: Xiubo Li Signed-off-by: Ilya Dryomov commit ea16567f11018e2f58e72b667b0c803ff92b8153 Author: Luís Henriques Date: Mon May 23 17:09:51 2022 +0100 ceph: fix decoding of client session messages flags The cephfs kernel client started to show the message: ceph: mds0 session blocklisted when mounting a filesystem. This is due to the fact that the session messages are being incorrectly decoded: the skip needs to take into account the 'len'. While there, fixed some whitespaces too. Cc: stable@vger.kernel.org Fixes: e1c9788cb397 ("ceph: don't rely on error_string to validate blocklisted session.") Signed-off-by: Luís Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 5e56776d5215ab5ab886006fc749346bad8473c8 Author: Xiubo Li Date: Wed May 18 22:49:26 2022 +0800 ceph: switch TASK_INTERRUPTIBLE to TASK_KILLABLE If the task is placed in the TASK_INTERRUPTIBLE state it will sleep until either something explicitly wakes it up, or a non-masked signal is received. Switch to TASK_KILLABLE to avoid the noises. Cc: Matthew Wilcox Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 2ecd0edd13a8bed87c3588bcd4a048113eff18f6 Author: Colin Ian King Date: Wed May 18 09:55:08 2022 +0100 ceph: remove redundant variable ino Variable ino is being assigned a value that is never read. The variable and assignment are redundant, remove it. Cleans up clang scan build warning: warning: Although the value stored to 'ino' is used in the enclosing expression, the value is never actually read from 'ino' [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit a74379543d229a3fb1af8cd44cbd19844a7bb1bc Author: Xiubo Li Date: Wed Apr 27 14:14:41 2022 +0800 ceph: try to queue a writeback if revoking fails If the pagecaches writeback just finished and the i_wrbuffer_ref reaches zero it will try to trigger ceph_check_caps(). But if just before ceph_check_caps() the i_wrbuffer_ref could be increased again by mmap/cache write, then the Fwb revoke will fail. We need to try to queue a writeback in this case instead of triggering the writeback by BDI's delayed work per 5 seconds. URL: https://tracker.ceph.com/issues/46904 URL: https://tracker.ceph.com/issues/55377 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 55ab5520802016b13098e0ea3794480289659aab Author: Luís Henriques Date: Wed Apr 27 16:57:04 2022 +0100 ceph: fix statfs for subdir mounts When doing a mount using as base a directory that has 'max_bytes' quotas statfs uses that value as the total; if a subdirectory is used instead, the same 'max_bytes' too in statfs, unless there is another quota set. Unfortunately, if this subdirectory only has the 'max_files' quota set, then statfs uses the filesystem total. Fix this by making sure we only lookup realms that contain the 'max_bytes' quota. Cc: Ryan Taylor URL: https://tracker.ceph.com/issues/55090 Signed-off-by: Luís Henriques Reviewed-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 825978fd6a0defc3c29d8a38b6cea76a0938d21e Author: Xiubo Li Date: Mon Apr 25 16:08:24 2022 +0800 ceph: fix possible deadlock when holding Fwb to get inline_data 1, mount with wsync. 2, create a file with O_RDWR, and the request was sent to mds.0: ceph_atomic_open()--> ceph_mdsc_do_request(openc) finish_open(file, dentry, ceph_open)--> ceph_open()--> ceph_init_file()--> ceph_init_file_info()--> ceph_uninline_data()--> { ... if (inline_version == 1 || /* initial version, no data */ inline_version == CEPH_INLINE_NONE) goto out_unlock; ... } The inline_version will be 1, which is the initial version for the new create file. And here the ci->i_inline_version will keep with 1, it's buggy. 3, buffer write to the file immediately: ceph_write_iter()--> ceph_get_caps(file, need=Fw, want=Fb, ...); generic_perform_write()--> a_ops->write_begin()--> ceph_write_begin()--> netfs_write_begin()--> netfs_begin_read()--> netfs_rreq_submit_slice()--> netfs_read_from_server()--> rreq->netfs_ops->issue_read()--> ceph_netfs_issue_read()--> { ... if (ci->i_inline_version != CEPH_INLINE_NONE && ceph_netfs_issue_op_inline(subreq)) return; ... } ceph_put_cap_refs(ci, Fwb); The ceph_netfs_issue_op_inline() will send a getattr(Fsr) request to mds.1. 4, then the mds.1 will request the rd lock for CInode::filelock from the auth mds.0, the mds.0 will do the CInode::filelock state transation from excl --> sync, but it need to revoke the Fxwb caps back from the clients. While the kernel client has aleady held the Fwb caps and waiting for the getattr(Fsr). It's deadlock! URL: https://tracker.ceph.com/issues/55377 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 3459bd0c55ed28f86a1fd2e01e376492cb6d4f91 Author: Xiubo Li Date: Sun Apr 24 17:35:53 2022 +0800 ceph: redirty the page for writepage on failure When run out of memories we should redirty the page before failing the writepage. Or we will hit BUG_ON(folio_get_private(folio)) in ceph_dirty_folio(). URL: https://tracker.ceph.com/issues/55421 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 5eed80fba65cd707075892450bc5d6bd464862a0 Author: Xiubo Li Date: Thu Apr 21 11:26:40 2022 +0800 ceph: try to choose the auth MDS if possible for getattr If any 'x' caps is issued we can just choose the auth MDS instead of the random replica MDSes. Because only when the Locker is in LOCK_EXEC state will the loner client could get the 'x' caps. And if we send the getattr requests to any replica MDS it must auth pin and tries to rdlock from the auth MDS, and then the auth MDS need to do the Locker state transition to LOCK_SYNC. And after that the lock state will change back. This cost much when doing the Locker state transition and usually will need to revoke caps from clients. URL: https://tracker.ceph.com/issues/55240 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit f7a2d0688a3b2bb4769402b4c962f54f7b0fc23c Author: Xiubo Li Date: Wed Apr 20 13:13:02 2022 +0800 ceph: disable updating the atime since cephfs won't maintain it Since CephFS makes no attempt to maintain atime, we shouldn't try to update it in mmap and generic read cases and ignore updating it in direct and sync read cases. And even we update it in mmap and generic read cases we will drop it and won't sync it to MDS. And we are seeing the atime will be updated and then dropped to the floor again and again. URL: https://lists.ceph.io/hyperkitty/list/ceph-users@ceph.io/thread/VSJM7T4CS5TDRFF6XFPIYMHP75K73PZ6/ Signed-off-by: Xiubo Li Acked-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 1b2ba3c5616e17ff951359e25c658a1c3f146f1e Author: Xiubo Li Date: Tue Apr 19 08:58:49 2022 +0800 ceph: flush the mdlog for filesystem sync Before waiting for a request's safe reply, we will send the mdlog flush request to the relevant MDS. And this will also flush the mdlog for all the other unsafe requests in the same session, so we can record the last session and no need to flush mdlog again in the next loop. But there still have cases that it may send the mdlog flush requst twice or more, but that should be not often. Rename wait_unsafe_requests() to flush_mdlog_and_wait_mdsc_unsafe_requests() to make it more descriptive. [xiubli: fold in MDS request refcount leak fix from Jeff] URL: https://tracker.ceph.com/issues/55284 URL: https://tracker.ceph.com/issues/55411 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit ae0670633014d172fab3772fff2da99269d17874 Author: Xiubo Li Date: Mon Apr 18 20:04:51 2022 +0800 ceph: rename unsafe_request_wait() Rename it to flush_mdlog_and_wait_inode_unsafe_requests() to make it more descriptive. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit d9d58f0402a8bd14b980e6f41a5aa28aa0ca0e04 Author: Guo Zhengkui Date: Tue Apr 12 14:46:20 2022 +0800 libceph: use swap() macro instead of taking tmp variable Fix the following coccicheck warning: net/ceph/crush/mapper.c:1077:8-9: WARNING opportunity for swap() by using swap() for the swapping of variable values and drop the tmp variable that is not needed any more. Signed-off-by: Guo Zhengkui Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 261998c30004f0e6eeddd24b1eb5e504cfacee18 Author: Xiubo Li Date: Mon Apr 11 09:59:09 2022 +0800 ceph: fix statx AT_STATX_DONT_SYNC vs AT_STATX_FORCE_SYNC check From the posix and the initial statx supporting commit comments, the AT_STATX_DONT_SYNC is a lightweight stat and the AT_STATX_FORCE_SYNC is a heaverweight one. And also checked all the other current usage about these two flags they are all doing the same, that is only when the AT_STATX_FORCE_SYNC is not set and the AT_STATX_DONT_SYNC is set will they skip sync retriving the attributes from storage. Signed-off-by: Xiubo Li Reviewed-by: David Howells Signed-off-by: Ilya Dryomov commit 68e5ec2ec94576bee4d5280d512ed47e6f876baf Author: Xiubo Li Date: Thu Apr 7 13:12:42 2022 +0800 ceph: no need to invalidate the fscache twice Fixes: 400e1286c0ec3 ("ceph: conversion to new fscache API") Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 3ffa9d6f991facd370fe35fd7fcbdbf5d1063afd Author: Jakob Koschel Date: Thu Mar 31 23:53:29 2022 +0200 ceph: 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. 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/ Signed-off-by: Jakob Koschel Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 57a5df0e8653a4ae4fa8f8fbfed8f1f0d734ebc0 Author: Jakob Koschel Date: Thu Mar 31 23:53:28 2022 +0200 ceph: use 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. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 7ffe4fcea789552fac47216188f30559c329c847 Author: Xiubo Li Date: Wed Mar 30 12:21:12 2022 +0800 ceph: update the dlease for the hashed dentry when removing The MDS will always refresh the dentry lease when removing the files or directories. And if the dentry is still hashed, we can update the dentry lease and no need to do the lookup from the MDS later. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 546a5d6122faae161cb59159e8af8518130efeab Author: Xiubo Li Date: Wed Mar 30 14:39:33 2022 +0800 ceph: stop retrying the request when exceeding 256 times The type of 'r_attempts' in kernel 'ceph_mds_request' is 'int', while in 'ceph_mds_request_head' the type of 'num_retry' is '__u8'. So in case the request retries exceeding 256 times, the MDS will receive a incorrect retry seq. In this case it's ususally a bug in MDS and continue retrying the request makes no sense. For now let's limit it to 256. In future this could be fixed in ceph code, so avoid using the hardcode here. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 1980b1bf17a4975fee5ee42df167f50f7f67b3d9 Author: Xiubo Li Date: Tue Mar 29 12:48:01 2022 +0800 ceph: stop forwarding the request when exceeding 256 times The type of 'num_fwd' in ceph 'MClientRequestForward' is 'int32_t', while in 'ceph_mds_request_head' the type is '__u8'. So in case the request bounces between MDSes exceeding 256 times, the client will get stuck. In this case it's ususally a bug in MDS and continue bouncing the request makes no sense. URL: https://tracker.ceph.com/issues/55130 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Reviewed-by: Luís Henriques Signed-off-by: Ilya Dryomov commit 6c1dc50284c4dab9f1e563efba6f9c4a47af894a Author: Xiubo Li Date: Mon Mar 28 10:25:35 2022 +0800 ceph: remove unused CEPH_MDS_LEASE_RELEASE related code The ceph_mdsc_lease_release() has been removed by commit 8aa152c77890 (ceph: remove ceph_mdsc_lease_release). ceph_mdsc_lease_send_msg will never be called with CEPH_MDS_LEASE_RELEASE. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 3302ffd44c3d70e77ad5764d15f5028a6ade540a Author: Jakob Koschel Date: Thu Mar 24 08:20:50 2022 +0100 rbd: 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. 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/ Signed-off-by: Jakob Koschel Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit d7a2dc523085f8b8c60548ceedc696934aefeb0e Author: Venky Shankar Date: Thu Mar 10 09:34:19 2022 -0500 ceph: allow ceph.dir.rctime xattr to be updatable `rctime' has been a pain point in cephfs due to its buggy nature - inconsistent values reported and those sorts. Fixing rctime is non-trivial needing an overall redesign of the entire nested statistics infrastructure. As a workaround, PR http://github.com/ceph/ceph/pull/37938 allows this extended attribute to be manually set. This allows users to "fixup" inconsistent rctime values. While this sounds messy, its probably the wisest approach allowing users/scripts to workaround buggy rctime values. The above PR enables Ceph MDS to allow manually setting rctime extended attribute with the corresponding user-land changes. We may as well allow the same to be done via kclient for parity. Signed-off-by: Venky Shankar Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 64e34b50d7aeee7082287ec39f9d34d4e60f3a04 Merge: 1c6d2ead87e94 e7eaffce47b7d Author: Linus Torvalds Date: Wed May 25 11:32:53 2022 -0700 Merge tag 'linux-kselftest-kunit-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: "Several fixes, cleanups, and enhancements to tests and framework: - introduce _NULL and _NOT_NULL macros to pointer error checks - rework kunit_resource allocation policy to fix memory leaks when caller doesn't specify free() function to be used when allocating memory using kunit_add_resource() and kunit_alloc_resource() funcs. - add ability to specify suite-level init and exit functions" * tag 'linux-kselftest-kunit-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (41 commits) kunit: tool: Use qemu-system-i386 for i386 runs kunit: fix executor OOM error handling logic on non-UML kunit: tool: update riscv QEMU config with new serial dependency kcsan: test: use new suite_{init,exit} support kunit: tool: Add list of all valid test configs on UML kunit: take `kunit_assert` as `const` kunit: tool: misc cleanups kunit: tool: minor cosmetic cleanups in kunit_parser.py kunit: tool: make parser stop overwriting status of suites w/ no_tests kunit: tool: remove dead parse_crash_in_log() logic kunit: tool: print clearer error message when there's no TAP output kunit: tool: stop using a shell to run kernel under QEMU kunit: tool: update test counts summary line format kunit: bail out of test filtering logic quicker if OOM lib/Kconfig.debug: change KUnit tests to default to KUNIT_ALL_TESTS kunit: Rework kunit_resource allocation policy kunit: fix debugfs code to use enum kunit_status, not bool kfence: test: use new suite_{init/exit} support, add .kunitconfig kunit: add ability to specify suite-level init and exit functions kunit: rename print_subtest_{start,end} for clarity (s/subtest/suite) ... commit 1c6d2ead87e94f3d2bacb0c4539686ea7a92d50b Merge: 88a618920e9ba 15477b31db104 Author: Linus Torvalds Date: Wed May 25 11:30:21 2022 -0700 Merge tag 'linux-kselftest-next-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest updates from Shuah Khan: "Several fixes, cleanups, and enhancements to tests: - add mips support for kprobe args string and syntax tests - updates to resctrl test to use kselftest framework - fixes, cleanups, and enhancements to tests" * tag 'linux-kselftest-next-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kselftests/ir : Improve readability of modprobe error message selftests/resctrl: Fix null pointer dereference on open failed selftests/resctrl: Add missing SPDX license to Makefile selftests/resctrl: Update README about using kselftest framework to build/run resctrl_tests selftests/resctrl: Make resctrl_tests run using kselftest framework selftests/resctrl: Fix resctrl_tests' return code to work with selftest framework selftests/resctrl: Change the default limited time to 120 seconds selftests/resctrl: Kill child process before parent process terminates if SIGTERM is received selftests/resctrl: Print a message if the result of MBM&CMT tests is failed on Intel CPU selftests/resctrl: Extend CPU vendor detection selftests/x86/corrupt_xstate_header: Use provided __cpuid_count() macro selftests/x86/amx: Use provided __cpuid_count() macro selftests/vm/pkeys: Use provided __cpuid_count() macro selftests: Provide local define of __cpuid_count() selftests/damon: add damon to selftests root Makefile selftests/binderfs: Improve message to provide more info selftests: mqueue: drop duplicate min definition selftests/ftrace: add mips support for kprobe args syntax tests selftests/ftrace: add mips support for kprobe args string tests commit 88a618920e9baabc1780479e2fbb68e5551d0563 Merge: 537e62c865dcb b86f46d5ce3e7 Author: Linus Torvalds Date: Wed May 25 11:17:41 2022 -0700 Merge tag 'docs-5.19' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "It was a moderately busy cycle for documentation; highlights include: - After a long period of inactivity, the Japanese translations are seeing some much-needed maintenance and updating. - Reworked IOMMU documentation - Some new documentation for static-analysis tools - A new overall structure for the memory-management documentation. This is an LSFMM outcome that, it is hoped, will help encourage developers to fill in the many gaps. Optimism is eternal...but hopefully it will work. - More Chinese translations. Plus the usual typo fixes, updates, etc" * tag 'docs-5.19' of git://git.lwn.net/linux: (70 commits) docs: pdfdocs: Add space for chapter counts >= 100 in TOC docs/zh_CN: Add dev-tools/gdb-kernel-debugging.rst Chinese translation input: Docs: correct ntrig.rst typo input: Docs: correct atarikbd.rst typos MAINTAINERS: Become the docs/zh_CN maintainer docs/zh_CN: fix devicetree usage-model translation mm,doc: Add new documentation structure Documentation: drop more IDE boot options and ide-cd.rst Documentation/process: use scripts/get_maintainer.pl on patches MAINTAINERS: Add entry for DOCUMENTATION/JAPANESE docs/trans/ja_JP/howto: Don't mention specific kernel versions docs/ja_JP/SubmittingPatches: Request summaries for commit references docs/ja_JP/SubmittingPatches: Add Suggested-by as a standard signature docs/ja_JP/SubmittingPatches: Randy has moved docs/ja_JP/SubmittingPatches: Suggest the use of scripts/get_maintainer.pl docs/ja_JP/SubmittingPatches: Update GregKH links Documentation/sysctl: document max_rcu_stall_to_panic Documentation: add missing angle bracket in cgroup-v2 doc Documentation: dev-tools: use literal block instead of code-block docs/zh_CN: add vm numa translation ... commit 908ea6541661d72c6852650f91adebba88b0de0b Author: Yufen Yu Date: Wed May 25 17:43:36 2022 +0800 f2fs: add f2fs_init_write_merge_io function Almost all other initialization of variables in f2fs_fill_super are extraced to a single function. Also do it for write_io[], which can make code more clean. This patch just refactors the code, theres no functional change. Signed-off-by: Yufen Yu Reviewed-by: Chao Yu [Jaegeuk Kim: clean up] Signed-off-by: Jaegeuk Kim commit f403f22f8ccb12860b2b62fec3173c6ccd45938b Author: Kefeng Wang Date: Fri May 20 10:18:33 2022 +0800 mm: kfence: use PAGE_ALIGNED helper Use PAGE_ALIGNED macro instead of IS_ALIGNED and passing PAGE_SIZE. Link: https://lkml.kernel.org/r/20220520021833.121405-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Muchun Song Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 0598739900071feff82b89f1515f963a6889b330 Author: Patrick Wang Date: Sat May 21 16:38:25 2022 +0800 selftests: vm: add the "settings" file with timeout variable The default "timeout" for one kselftest is 45 seconds, while some cases in run_vmtests.sh require more time. This will cause testing timeout like: not ok 4 selftests: vm: run_vmtests.sh # TIMEOUT 45 seconds Therefore, add the "settings" file with timeout variable so users can set the "timeout" value. Link: https://lkml.kernel.org/r/20220521083825.319654-4-patrick.wang.shcn@gmail.com Signed-off-by: Patrick Wang Cc: Shuah Khan Signed-off-by: Andrew Morton commit ccd2a1201d267bf6f1950bf31cfd55fb4e17a231 Author: Patrick Wang Date: Sat May 21 16:38:24 2022 +0800 selftests: vm: add "test_hmm.sh" to TEST_FILES The "test_hmm.sh" file used by run_vmtests.sh dose not be installed into INSTALL_PATH. Thus run_vmtests.sh can not call it in INSTALL_PATH: --------------------------- running ./test_hmm.sh smoke --------------------------- ./run_vmtests.sh: line 74: ./test_hmm.sh: No such file or directory [FAIL] ----------------------- Add "test_hmm.sh" to TEST_FILES so that it will be installed. Link: https://lkml.kernel.org/r/20220521083825.319654-3-patrick.wang.shcn@gmail.com Signed-off-by: Patrick Wang Cc: Shuah Khan Signed-off-by: Andrew Morton commit 9aa1af954db02a3228763015356684a169503c68 Author: Patrick Wang Date: Sat May 21 16:38:23 2022 +0800 selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests Patch series "selftests: vm: a few fixup patches". This series contains three fixup patches for vm selftests. They are independent. Please see the patches. This patch (of 3): Currently, ksm_tests operates "merge_across_nodes" with NUMA either enabled or disabled. In a system with NUMA disabled, these operations will fail and output a misleading report given "merge_across_nodes" does not exist in sysfs: ---------------------------- running ./ksm_tests -M -p 10 ---------------------------- f /sys/kernel/mm/ksm/merge_across_nodes fopen: No such file or directory Cannot save default tunables [FAIL] ---------------------- So check numa_available() before those operations to skip them if NUMA is disabled. Link: https://lkml.kernel.org/r/20220521083825.319654-1-patrick.wang.shcn@gmail.com Link: https://lkml.kernel.org/r/20220521083825.319654-2-patrick.wang.shcn@gmail.com Signed-off-by: Patrick Wang Cc: Shuah Khan Signed-off-by: Andrew Morton commit 3d3921ed271b0e23d60c91fcad089f2f5e71af98 Author: Muhammad Usama Anjum Date: Sat May 21 14:43:13 2022 +0500 selftests: vm: add migration to the .gitignore Add newly added migration test object to .gitignore file. Link: https://lkml.kernel.org/r/20220521094313.166505-1-usama.anjum@collabora.com Fixes: 0c2d08728470 ("mm: add selftests for migration entries") Signed-off-by: Muhammad Usama Anjum Reviewed-by: Alistair Popple Signed-off-by: Andrew Morton commit 75c96ccea2e1de1342996722ee505d2cadedc0dd Author: Julia Lawall Date: Sat May 21 13:11:30 2022 +0200 selftests/vm/pkeys: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20220521111145.81697-80-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit 3413b2c872c3fe5cf3b11d4e73de55098c81c7a3 Author: Julia Lawall Date: Sat May 21 13:11:44 2022 +0200 ksm: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20220521111145.81697-94-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit 33776141b81296e604a39a8065b28b89c61c7f74 Author: Suren Baghdasaryan Date: Wed May 18 13:43:16 2022 -0700 selftests: vm: add process_mrelease tests Introduce process_mrelease syscall sanity tests which include tests which expect to fail: - process_mrelease with invalid pidfd and flags inputs - process_mrelease on a live process with no pending signals and valid process_mrelease usage which is expected to succeed. Because process_mrelease has to be used against a process with a pending SIGKILL, it's possible that the process exits before process_mrelease gets called. In such cases we retry the test with a victim that allocates twice more memory up to 1GB. This would require the victim process to spend more time during exit and process_mrelease has a better chance of catching the process before it exits and succeeding. On success the test reports the amount of memory the child had to allocate for reaping to succeed. Sample output: $ mrelease_test Success reaping a child with 1MB of memory allocations On failure the test reports the failure. Sample outputs: $ mrelease_test All process_mrelease attempts failed! $ mrelease_test process_mrelease: Invalid argument Link: https://lkml.kernel.org/r/20220518204316.13131-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Shuah Khan Acked-by: Christian Brauner (Microsoft) Reviewed-by: Muhammad Usama Anjum Cc: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox (Oracle) Cc: Johannes Weiner Cc: Roman Gushchin Cc: Minchan Kim Cc: "Kirill A . Shutemov" Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: David Hildenbrand Cc: Jann Horn Cc: Shakeel Butt Cc: Peter Xu Cc: John Hubbard Signed-off-by: Andrew Morton commit 3f1509c57b1ba5646de0fb8d81bd7107aec22257 Author: Johannes Weiner Date: Wed May 18 15:09:11 2022 -0400 Revert "mm/vmscan: never demote for memcg reclaim" This reverts commit 3a235693d3930e1276c8d9cc0ca5807ef292cf0a. Its premise was that cgroup reclaim cares about freeing memory inside the cgroup, and demotion just moves them around within the cgroup limit. Hence, pages from toptier nodes should be reclaimed directly. However, with NUMA balancing now doing tier promotions, demotion is part of the page aging process. Global reclaim demotes the coldest toptier pages to secondary memory, where their life continues and from which they have a chance to get promoted back. Essentially, tiered memory systems have an LRU order that spans multiple nodes. When cgroup reclaims pages coming off the toptier directly, there can be colder pages on lower tier nodes that were demoted by global reclaim. This is an aging inversion, not unlike if cgroups were to reclaim directly from the active lists while there are inactive pages. Proactive reclaim is another factor. The goal of that it is to offload colder pages from expensive RAM to cheaper storage. When lower tier memory is available as an intermediate layer, we want offloading to take advantage of it instead of bypassing to storage. Revert the patch so that cgroups respect the LRU order spanning the memory hierarchy. Of note is a specific undercommit scenario, where all cgroup limits in the system add up to <= available toptier memory. In that case, shuffling pages out to lower tiers first to reclaim them from there is inefficient. This is something could be optimized/short-circuited later on (although care must be taken not to accidentally recreate the aging inversion). Let's ensure correctness first. Link: https://lkml.kernel.org/r/20220518190911.82400-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Dave Hansen Reviewed-by: Yang Shi Acked-by: Roman Gushchin Reviewed-by: "Huang, Ying" Reviewed-by: Muchun Song Acked-by: Michal Hocko Acked-by: Shakeel Butt Acked-by: Tim Chen Cc: Zi Yan Signed-off-by: Andrew Morton commit 83d7d04f9d2ef354858b2a8444aee38e41ec1699 Author: Jackie Liu Date: Wed May 18 15:31:05 2022 +0800 mm/kfence: print disabling or re-enabling message By printing information, we can friendly prompt the status change information of kfence by dmesg and record by syslog. Also, set kfence_enabled to false only when needed. Link: https://lkml.kernel.org/r/20220518073105.3160335-1-liu.yun@linux.dev Signed-off-by: Jackie Liu Co-developed-by: Marco Elver Signed-off-by: Marco Elver Reviewed-by: Marco Elver Signed-off-by: Andrew Morton commit e5c3f619a04d9e191de66d5f8e069367f73a6487 Author: Vasily Averin Date: Tue May 17 09:55:51 2022 +0300 include/trace/events/percpu.h: cleanup for "percpu: improve percpu_alloc_percpu event trace" Fix sparse warning about incorrect gfp_t cast. Link: https://lkml.kernel.org/r/001979f3-e978-0998-cbed-61a4a2ac87b8@openvz.org Fixes: f67bed134a05 ("percpu: improve percpu_alloc_percpu event trace") Signed-off-by: Vasily Averin Signed-off-by: Andrew Morton commit 185194f19134716f32b2ab04ac76cf93ea85706a Author: Vasily Averin Date: Tue May 17 09:58:14 2022 +0300 include/trace/events/mmflags.h: cleanup for "tracing: incorrect gfp_t conversion" Redefines __def_gfpflag_names array according to akpm@, willy@ and Joe Perches recommendations. Link: https://lkml.kernel.org/r/6f811e19-41c6-f3e8-fca6-23a19a62e313@openvz.org Fixes: fe573327ffb1 ("tracing: incorrect gfp_t conversion") Signed-off-by: Vasily Averin Cc: Matthew Wilcox Cc: Joe Perches Cc: Steven Rostedt Signed-off-by: Andrew Morton commit 88ee134320b8311ca7a00630e5ba013cd0239350 Author: Zi Yan Date: Tue May 24 15:47:56 2022 -0400 mm: fix a potential infinite loop in start_isolate_page_range() In isolate_single_pageblock() called by start_isolate_page_range(), there are some pageblock isolation issues causing a potential infinite loop when isolating a page range. This is reported by Qian Cai. 1. the pageblock was isolated by just changing pageblock migratetype without checking unmovable pages. Calling set_migratetype_isolate() to isolate pageblock properly. 2. an off-by-one error caused migrating pages unnecessarily, since the page is not crossing pageblock boundary. 3. migrating a compound page across pageblock boundary then splitting the free page later has a small race window that the free page might be allocated again, so that the code will try again, causing an potential infinite loop. Temporarily set the to-be-migrated page's pageblock to MIGRATE_ISOLATE to prevent that and bail out early if no free page is found after page migration. An additional fix to split_free_page() aims to avoid crashing in __free_one_page(). When the free page is split at the specified split_pfn_offset, free_page_order should check both the first bit of free_page_pfn and the last bit of split_pfn_offset and use the smaller one. For example, if free_page_pfn=0x10000, split_pfn_offset=0xc000, free_page_order should first be 0x8000 then 0x4000, instead of 0x4000 then 0x8000, which the original algorithm did. [akpm@linux-foundation.org: suppress min() warning] Link: https://lkml.kernel.org/r/20220524194756.1698351-1-zi.yan@sent.com Fixes: b2c9e2fbba3253 ("mm: make alloc_contig_range work at pageblock granularity") Signed-off-by: Zi Yan Reported-by: Qian Cai Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit bb5ced41a658e51bb72d3dc651b28e344e001ac9 Author: Muchun Song Date: Sat May 21 15:41:03 2022 +0800 MAINTAINERS: add Muchun as co-maintainer for HugeTLB I have been focusing on mm for the past two years. e.g. developing, fixing bugs, reviewing related to HugeTLB system. I would like to help Mike and other people working on HugeTLB by reviewing their work. When I first introduced the vmemmmap reduction, I forgot to update MAINTAINERS file. Let's update it as well. And rename "HUGETLB FILESYSTEM" to "HUGETLB SUBSYSTEM" since some files are not only related to filesystem but also memory management (the name of FILESYSTEM cannot cover this area). Link: https://lkml.kernel.org/r/20220521074103.79468-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Mike Kravetz Signed-off-by: Andrew Morton commit 6140ae41effe0fff80ff3d6f1bfdff64aa06e9b4 Author: Randy Dunlap Date: Sun May 22 13:40:27 2022 -0700 zram: fix Kconfig dependency warning ZSMALLOC depends on MMU so ZRAM should also depend on MMU since 'select' does not follow any dependency chains. Fixes this Kconfig warning: WARNING: unmet direct dependencies detected for ZSMALLOC Depends on [n]: MMU [=n] Selected by [y]: - ZRAM [=y] && BLK_DEV [=y] && BLOCK [=y] && SYSFS [=y] && (CRYPTO_LZO [=y] || CRYPTO_ZSTD [=m] || CRYPTO_LZ4 [=m] || CRYPTO_LZ4HC [=n] || CRYPTO_842 [=n]) Link: https://lkml.kernel.org/r/20220522204027.22964-1-rdunlap@infradead.org Fixes: b3fbd58fcbb10 ("mm: Kconfig: simplify zswap configuration") Signed-off-by: Randy Dunlap Acked-by: Johannes Weiner Cc: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Cc: Jens Axboe Signed-off-by: Andrew Morton commit e384200e70664cd690cdadb72b2a1bc9dfcdec1a Author: Hugh Dickins Date: Sat May 21 19:53:04 2022 -0700 mm/shmem: fix shmem folio swapoff hang Shmem swapoff makes no progress: the index to indices is not incremented. But "ret" is no longer a return value, so use folio_batch_count() instead. Link: https://lkml.kernel.org/r/c32bee8a-f0aa-245-f94e-24dd271924fa@google.com Fixes: da08e9b79323 ("mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio()") Signed-off-by: Hugh Dickins Reviewed-by: Miaohe Lin Tested-by: Miaohe Lin Cc: Matthew Wilcox Cc: Christoph Hellwig Signed-off-by: Andrew Morton commit 7fb6378701dc0d8f19c1ac4623b55f5125f0e286 Author: Christophe JAILLET Date: Sun May 22 16:18:51 2022 +0200 cgroup: fix an error handling path in alloc_pagecache_max_30M() If the first goto is taken, 'fd' is not opened yet (and is un-initialized). So a direct return is safer. Link: https://lkml.kernel.org/r/628312312eb40e0e39463a2c06415fde5295c716.1653229120.git.christophe.jaillet@wanadoo.fr Fixes: c1a31a2f7a9c ("cgroup: fix racy check in alloc_pagecache_max_30M() helper function") Signed-off-by: Christophe JAILLET Reviewed-by: Andrew Morton Cc: Dan Carpenter Cc: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Muchun Song Cc: Tejun Heo Cc: Zefan Li Cc: Shuah Khan Cc: David Vernet Signed-off-by: Andrew Morton commit 537e62c865dcb9b91d07ed83f8615b71fa0b51bb Merge: 2e17ce1106e04 1c6fd59943a63 Author: Linus Torvalds Date: Wed May 25 10:32:08 2022 -0700 Merge tag 'printk-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Offload writing printk() messages on consoles to per-console kthreads. It prevents soft-lockups when an extensive amount of messages is printed. It was observed, for example, during boot of large systems with a lot of peripherals like disks or network interfaces. It prevents live-lockups that were observed, for example, when messages about allocation failures were reported and a CPU handled consoles instead of reclaiming the memory. It was hard to solve even with rate limiting because it would need to take into account the amount of messages and the speed of all consoles. It is a must to have for real time. Otherwise, any printk() might break latency guarantees. The per-console kthreads allow to handle each console on its own speed. Slow consoles do not longer slow down faster ones. And printk() does not longer unpredictably slows down various code paths. There are situations when the kthreads are either not available or not reliable, for example, early boot, suspend, or panic. In these situations, printk() uses the legacy mode and tries to handle consoles immediately. - Add documentation for the printk index. * tag 'printk-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk, tracing: fix console tracepoint printk: remove @console_locked printk: extend console_lock for per-console locking printk: add kthread console printers printk: add functions to prefer direct printing printk: add pr_flush() printk: move buffer definitions into console_emit_next_record() caller printk: refactor and rework printing logic printk: add con_printk() macro for console details printk: call boot_delay_msec() in printk_delay() printk: get caller_id/timestamp after migration disable printk: wake waiters for safe and NMI contexts printk: wake up all waiters printk: add missing memory barrier to wake_up_klogd() printk: cpu sync always disable interrupts printk: rename cpulock functions printk/index: Printk index feature documentation MAINTAINERS: Add printk indexing maintainers on mention of printk_index commit 2e17ce1106e04a7f3a83796ec623881487f75dd3 Merge: caa28984163cb e001897da62eb Author: Linus Torvalds Date: Wed May 25 10:24:04 2022 -0700 Merge tag 'slab-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab updates from Vlastimil Babka: - Conversion of slub_debug stack traces to stackdepot, allowing more useful debugfs-based inspection for e.g. memory leak debugging. Allocation and free debugfs info now includes full traces and is sorted by the unique trace frequency. The stackdepot conversion was already attempted last year but reverted by ae14c63a9f20. The memory overhead (while not actually enabled on boot) has been meanwhile solved by making the large stackdepot allocation dynamic. The xfstest issues haven't been reproduced on current kernel locally nor in -next, so the slab cache layout changes that originally made that bug manifest were probably not the root cause. - Refactoring of dma-kmalloc caches creation. - Trivial cleanups such as removal of unused parameters, fixes and clarifications of comments. - Hyeonggon Yoo joins as a reviewer. * tag 'slab-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: MAINTAINERS: add myself as reviewer for slab mm/slub: remove unused kmem_cache_order_objects max mm: slab: fix comment for __assume_kmalloc_alignment mm: slab: fix comment for ARCH_KMALLOC_MINALIGN mm/slub: remove unneeded return value of slab_pad_check mm/slab_common: move dma-kmalloc caches creation into new_kmalloc_cache() mm/slub: remove meaningless node check in ___slab_alloc() mm/slub: remove duplicate flag in allocate_slab() mm/slub: remove unused parameter in setup_object*() mm/slab.c: fix comments slab, documentation: add description of debugfs files for SLUB caches mm/slub: sort debugfs output by frequency of stack traces mm/slub: distinguish and print stack traces in debugfs files mm/slub: use stackdepot to save stack trace in objects mm/slub: move struct track init out of set_track() lib/stackdepot: allow requesting early initialization dynamically mm/slub, kunit: Make slub_kunit unaffected by user specified flags mm/slab: remove some unused functions commit caa28984163cb63ea0be4cb8dbf05defdc7303f9 Author: Linus Torvalds Date: Wed May 25 09:02:19 2022 -0700 linux/types.h: reinstate "__bitwise__" macro for user space use Commit c724c866bb70 ("linux/types.h: remove unnecessary __bitwise__") was right that there are no users of __bitwise__ in the kernel, but it turns out there are user space users of it that do expect it. It is, after all, in the uapi directory, so user space usage is to be expected. Instead of reverting the commit completely, let's just clarify the situation so that it doesn't happen again, and have some in-code explanations for why that "__bitwise__" still exists. Reported-by: Jiri Slaby Cc: Bjorn Helgaas Link: https://lore.kernel.org/all/b5c0a68d-8387-4909-beea-f70ab9e6e3d5@kernel.org/ Signed-off-by: Linus Torvalds commit e5499dd7253c8382d03f687f19a854adcc688357 Author: Sean Young Date: Wed May 25 14:08:30 2022 +0100 media: lirc: revert removal of unused feature flags Commit b2a90f4fcb14 ("media: lirc: remove unused lirc features") removed feature flags which were never implemented, but they are still used by the lirc daemon went built from source. Reinstate these symbols in order not to break the lirc build. Fixes: b2a90f4fcb14 ("media: lirc: remove unused lirc features") Link: https://lore.kernel.org/all/a0470450-ecfd-2918-e04a-7b57c1fd7694@kernel.org/ Reported-by: Jiri Slaby Cc: Mauro Carvalho Chehab Signed-off-by: Sean Young Signed-off-by: Linus Torvalds commit 86dca369075b3e310c3c0adb0f81e513c562b5e4 Author: Kan Liang Date: Wed May 25 06:39:52 2022 -0700 perf/x86/intel: Fix event constraints for ICL According to the latest event list, the event encoding 0x55 INST_DECODED.DECODERS and 0x56 UOPS_DECODED.DEC0 are only available on the first 4 counters. Add them into the event constraints table. Fixes: 6017608936c1 ("perf/x86/intel: Add Icelake support") Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220525133952.1660658-1-kan.liang@linux.intel.com commit 108ea7eb3e754be735a1c33d2713a19527fb2065 Author: Juerg Haefliger Date: Wed May 25 15:39:49 2022 +0200 perf/x86/Kconfig: Fix indentation in the Kconfig file The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220525133949.53730-1-juerg.haefliger@canonical.com commit 1a23accae82d780b5d5de6254d32c270aeb7f664 Author: Linus Walleij Date: Sun May 22 09:23:56 2022 +0200 ARM: ixp4xx: Consolidate Kconfig fixing issue The IXP4xx Kconfig we ended up with for mach-ixp4xx creates as kismet warning: WARNING: unmet direct dependencies detected for GPIO_IXP4XX Depends on [n]: GPIOLIB [=y] && HAS_IOMEM [=y] && ARCH_IXP4XX [=y] && OF [=n] Selected by [y]: - ARCH_IXP4XX [=y] && This is because it is possible to select ARCH_IXP4XX witout OF while that selects the GPIO driver that now depends on OF. Fix this by creating a single ARCH_IXP4XX kconfig that selects USE_OF. Reported-by: kernel test robot Signed-off-by: Linus Walleij Cc: Arnd Bergmann Cc: Imre Kaloz Cc: Krzysztof Halasa Link: https://lore.kernel.org/r/20220522072356.34062-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 4fe4f1552394d41442205f9cde93af00eda59435 Author: Srinivas Pandruvada Date: Mon May 23 11:16:55 2022 -0700 Documentation: admin-guide: PM: Add Out of Band mode Update documentation for using the tool to support performance level change via OOB (Out of Band) interface. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 20eb48885b62d5de4ab6be7e08f9f55aa33333fd Author: sunliming Date: Wed May 25 09:28:27 2022 +0800 x86/idt: Remove unused headers Commit: 4b9a8dca0e58 ("x86/idt: Remove the tracing IDT completely") removed the 'tracing IDT' from arch/x86/kernel/tracepoint.c, but left related headers included - remove them. [ mingo: Tweak changelog. ] Signed-off-by: sunliming Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220525012827.93464-1-sunliming@kylinos.cn commit 3c1d004bdb4e12b4b1dfbdd6a9167ea5003e48cd Author: Sumeet Pawnikar Date: Mon May 23 23:18:52 2022 +0530 thermal: int340x: Add Meteor Lake PCI device ID Add Meteor Lake PCI ID for processor thermal device. Signed-off-by: Sumeet Pawnikar Reviewed-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 0ecfacb4c50ae2fd32ee1898562fe55f045b56d2 Author: Juerg Haefliger Date: Wed May 25 15:32:03 2022 +0200 x86/Kconfig: Fix indentation of arch/x86/Kconfig.debug The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220525133203.52463-3-juerg.haefliger@canonical.com commit 758cd94a0e16ddbc5607428f28170897f67c2964 Author: Juerg Haefliger Date: Wed May 25 15:32:02 2022 +0200 x86/Kconfig: Fix indentation and add endif comments to arch/x86/Kconfig The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. While add it, add missing trailing endif comments and squeeze multiple empty lines. Signed-off-by: Juerg Haefliger Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220525133203.52463-2-juerg.haefliger@canonical.com commit 657b95d34ba3cecc62993817a21896475110603d Author: Sumeet Pawnikar Date: Mon May 23 23:16:30 2022 +0530 ACPI: DPTF: Support Meteor Lake Add Meteor Lake ACPI IDs for DPTF devices. Signed-off-by: Sumeet Pawnikar Reviewed-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 8a33d96bd178d5f49cc5c1898e4cda08e221d2db Author: XueBing Chen Date: Wed May 25 16:51:01 2022 +0800 x86/setup: Use strscpy() to replace deprecated strlcpy() strlcpy() is marked deprecated and should not be used, because it doesn't limit the source length. The preferred interface for when strlcpy()'s return value is not checked (truncation) is strscpy(). [ mingo: Tweaked the changelog ] Signed-off-by: XueBing Chen Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/730f0fef.a33.180fa69880f.Coremail.chenxuebing@jari.cn commit 9e12eb8231496682525b6f9ba04131132d139759 Author: Julia Lawall Date: Sat May 21 13:10:13 2022 +0200 ACPI: CPPC: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Rafael J. Wysocki commit 0125de38122f0f66bf61336158d12a1aabfe6425 Author: Takashi Iwai Date: Wed May 25 15:12:03 2022 +0200 ALSA: usb-audio: Cancel pending work at closing a MIDI substream At closing a USB MIDI output substream, there might be still a pending work, which would eventually access the rawmidi runtime object that is being released. For fixing the race, make sure to cancel the pending work at closing. Reported-by: syzbot+6912c9592caca7ca0e7d@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/000000000000e7e75005dfd07cf6@google.com Link: https://lore.kernel.org/r/20220525131203.11299-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4c691a287d4ee0c308708c1d6f9e0cc7513463f8 Author: Takashi Iwai Date: Wed May 25 14:20:18 2022 +0200 ALSA: usb-audio: Add mixer mapping for Gigabyte B450/550 Mobos This patch implements a static mapping for Gigabyte B450/550 Mobos so that the mixer elements appear reasonably and jack detections work properly. Reported-and-tested-by: Brock Szuszczewicz BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215988 Link: https://lore.kernel.org/r/20220525122018.3299-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit e04314082c3197874f0cb3f4031219e811741a49 Merge: 09583dfed2cb9 22079af7df5a5 Author: Rafael J. Wysocki Date: Wed May 25 15:02:26 2022 +0200 Merge tag 'opp-updates-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull OPP (Operating Performance Points) updates for 5.19-rc1 from Viresh Kumar: - Minor update to dt-binding for Qcom's opp-v2-kryo-cpu (Yassine Oudjana). - Use list iterator only inside the list_for_each_entry loop (Xiaomeng Tong, and Jakob Koschel). - New APIs related to finding OPP based on interconnect bandwidth (Krzysztof Kozlowski). - Fix the missing of_node_put() in _bandwidth_supported() (Dan Carpenter). - Cleanups (Krzysztof Kozlowski, and Viresh Kumar). * tag 'opp-updates-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: opp: Reorder definition of ceil/floor helpers opp: Add apis to retrieve opps with interconnect bandwidth dt-bindings: opp: opp-v2-kryo-cpu: Remove SMEM opp: use list iterator only inside the loop opp: replace usage of found with dedicated list iterator variable PM: opp: simplify with dev_err_probe() OPP: call of_node_put() on error path in _bandwidth_supported() commit 990247af7cf59190271da405458aefaed985e831 Merge: 09583dfed2cb9 39b360102f3ac Author: Rafael J. Wysocki Date: Wed May 25 15:01:30 2022 +0200 Merge tag 'cpufreq-arm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for 5.19-rc1 from Viresh Kumar: - Tegra234 cpufreq support (Sumit Gupta). - Mediatek cleanups and enhancements (Wan Jiabing, Rex-BC Chen, and Jia-Wei Chang). * tag 'cpufreq-arm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: (21 commits) cpufreq: mediatek: Add support for MT8186 cpufreq: mediatek: Link CCI device to CPU dt-bindings: cpufreq: mediatek: Add MediaTek CCI property cpufreq: mediatek: Fix potential deadlock problem in mtk_cpufreq_set_target cpufreq: mediatek: Add opp notification support cpufreq: mediatek: Refine mtk_cpufreq_voltage_tracking() cpufreq: mediatek: Move voltage limits to platform data cpufreq: mediatek: Unregister platform device on exit cpufreq: mediatek: Fix NULL pointer dereference in mediatek-cpufreq cpufreq: mediatek: Make sram regulator optional cpufreq: mediatek: Record previous target vproc value cpufreq: mediatek: Replace old_* with pre_* cpufreq: mediatek: Use device print to show logs cpufreq: mediatek: Enable clocks and regulators cpufreq: mediatek: Remove unused headers cpufreq: mediatek: Cleanup variables and error handling in mtk_cpu_dvfs_info_init() cpufreq: mediatek: Use module_init and add module_exit arm64: tegra: add node for tegra234 cpufreq cpufreq: tegra194: Add support for Tegra234 cpufreq: tegra194: add soc data to support multiple soc ... commit da007f171fc9dd993d03a360b515cac1c87921bb Author: Dmitry Osipenko Date: Wed May 25 00:21:18 2022 +0300 kernel/reboot: Change registration order of legacy power-off handler We're unconditionally registering sys-off handler for the legacy pm_power_off() callback, this causes problem for platforms that don't use power-off handlers at all and should be halted. Now reboot syscall assumes that there is a power-off handler installed and tries to power off system instead of halting it. To fix the trouble, move the handler's registration to the reboot syscall and check the pm_power_off() presence. Fixes: 0e2110d2e910 ("kernel/reboot: Add kernel_can_power_off()") Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit de3a9e943ddecba8d2ac1dde4cfff538e5c6a7b9 Author: Paulo Alcantara Date: Wed May 25 07:37:04 2022 -0500 cifs: fix ntlmssp on old servers Some older servers seem to require the workstation name during ntlmssp to be at most 15 chars (RFC1001 name length), so truncate it before sending when using insecure dialects. Link: https://lore.kernel.org/r/e6837098-15d9-acb6-7e34-1923cf8c6fe1@winds.org Reported-by: Byron Stanoszek Tested-by: Byron Stanoszek Fixes: 49bd49f983b5 ("cifs: send workstation name during ntlmssp session setup") Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit cfd6d63e596552e1a5bf38bb889997b656475032 Author: Geert Uytterhoeven Date: Mon May 23 19:55:20 2022 +0200 m68k: virt: Switch to new sys-off handler API On m68k with CONFIG_VIRT=y (e.g. virt_defconfig or allmodconfig): arch/m68k/virt/config.c: In function ‘config_virt’: arch/m68k/virt/config.c:129:2: error: ‘mach_power_off’ undeclared (first use in this function); did you mean ‘pm_power_off’? 129 | mach_power_off = virt_halt; | ^~~~~~~~~~~~~~ | pm_power_off Commit 05d51e42df06f021 ("m68k: Introduce a virtual m68k machine") introduced a new user of mach_power_off. Convert it to the new sys-off handler API, too. Reported-by: noreply@ellerman.id.au Fixes: f0f7e5265b3b37b0 ("m68k: Switch to new sys-off handler API") Signed-off-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki commit 14c03a4a757f4be3e81c5004ca72f809ab04e0b1 Merge: 09583dfed2cb9 6779db970bd28 Author: Rafael J. Wysocki Date: Wed May 25 14:38:29 2022 +0200 Merge back reboot/poweroff notifiers rework for 5.19-rc1. commit 9f56390f8c49a1e2f38f049673dcbb407a742302 Author: Tom Rix Date: Sat May 21 15:59:42 2022 -0400 video: fbdev: xen: remove setting of 'transp' parameter cppcheck reports [drivers/video/fbdev/xen-fbfront.c:226]: (style) Assignment of function parameter has no effect outside the function. The value parameter 'transp' is not used, so setting it can be removed. Signed-off-by: Tom Rix Reviewed-by: Geert Uytterhoeven Reviewed-by: Juergen Gross Signed-off-by: Helge Deller commit 54739cc6b4e12b8bf3802536634b8e896eb796b1 Author: Jens Axboe Date: Mon May 23 16:49:31 2022 -0600 io_uring: make prep and issue side of req handlers named consistently Almost all of them are, the odd ones out are the poll remove and the files update request. Name them like the others, which is: io_#cmdname_prep for request preparation io_#cmdname for request issue Reviewed-by: Kanchan Joshi Signed-off-by: Jens Axboe commit ecddc25d1355d0ce2b486a4991b826b6e87875a9 Author: Jens Axboe Date: Mon May 23 16:13:56 2022 -0600 io_uring: make timeout prep handlers consistent with other prep handlers All other opcodes take a {req, sqe} set for prep handling, split out a timeout prep handler so that timeout and linked timeouts can use the same one. Reviewed-by: Kanchan Joshi Signed-off-by: Jens Axboe commit c9bfb460c3e4da2462e16b0f0b200990b36b1dd2 Author: Nico Boehr Date: Tue May 24 15:43:20 2022 +0200 s390/perf: obtain sie_block from the right address Since commit 1179f170b6f0 ("s390: fix fpu restore in entry.S"), the sie_block pointer is located at empty1[1], but in sie_block() it was taken from empty1[0]. This leads to a random pointer being dereferenced, possibly causing system crash. This problem can be observed when running a simple guest with an endless loop and recording the cpu-clock event: sudo perf kvm --guestvmlinux= --guest top -e cpu-clock With this fix, the correct guest address is shown. Fixes: 1179f170b6f0 ("s390: fix fpu restore in entry.S") Cc: stable@vger.kernel.org Acked-by: Christian Borntraeger Acked-by: Claudio Imbrenda Reviewed-by: Heiko Carstens Signed-off-by: Nico Boehr Signed-off-by: Heiko Carstens commit 3384f135e90f96a7697a85c33081e46c0a0f415d Author: Heiko Carstens Date: Mon May 23 14:42:40 2022 +0200 s390: generate register offsets into pt_regs automatically Use asm offsets method to generate register offsets into pt_regs, instead of open-coding at several places. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 85806016acb0610e47ffcd5415d1575f18f58a33 Author: Heiko Carstens Date: Fri May 20 19:23:48 2022 +0200 s390: simplify early program check handler Due to historic reasons the base program check handler calls a configurable function. Given that there is only the early program check handler left, simplify the code by directly calling that function. The only other user was removed with commit d485235b0054 ("s390: assume diag308 set always works"). Also rename all functions and the asm file to reflect this. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens commit bd52cd5e23f134019b23f0c389db0f9a436e4576 Author: Jann Horn Date: Tue May 17 16:30:47 2022 +0200 s390/crypto: fix scatterwalk_unmap() callers in AES-GCM The argument of scatterwalk_unmap() is supposed to be the void* that was returned by the previous scatterwalk_map() call. The s390 AES-GCM implementation was instead passing the pointer to the struct scatter_walk. This doesn't actually break anything because scatterwalk_unmap() only uses its argument under CONFIG_HIGHMEM and ARCH_HAS_FLUSH_ON_KUNMAP. Fixes: bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm support.") Signed-off-by: Jann Horn Acked-by: Harald Freudenberger Link: https://lore.kernel.org/r/20220517143047.3054498-1-jannh@google.com Signed-off-by: Heiko Carstens commit 6821ad8770340825f17962cf5ef64ebaffee7fd7 Author: Maciej Żenczykowski Date: Wed May 18 14:05:48 2022 -0700 xfrm: do not set IPv4 DF flag when encapsulating IPv6 frames <= 1280 bytes. One may want to have DF set on large packets to support discovering path mtu and limiting the size of generated packets (hence not setting the XFRM_STATE_NOPMTUDISC tunnel flag), while still supporting networks that are incapable of carrying even minimal sized IPv6 frames (post encapsulation). Having IPv4 Don't Frag bit set on encapsulated IPv6 frames that are not larger than the minimum IPv6 mtu of 1280 isn't useful, because the resulting ICMP Fragmentation Required error isn't actionable (even assuming you receive it) because IPv6 will not drop it's path mtu below 1280 anyway. While the IPv4 stack could prefrag the packets post encap, this requires the ICMP error to be successfully delivered and causes a loss of the original IPv6 frame (thus requiring a retransmit and latency hit). Luckily with IPv4 if we simply don't set the DF flag, we'll just make further fragmenting the packets some other router's problems. We'll still learn the correct IPv4 path mtu through encapsulation of larger IPv6 frames. I'm still not convinced this patch is entirely sufficient to make everything happy... but I don't see how it could possibly make things worse. See also recent: 4ff2980b6bd2 'xfrm: fix tunnel model fragmentation behavior' and friends Cc: Lorenzo Colitti Cc: Eric Dumazet Cc: Lina Wang Cc: Steffen Klassert Signed-off-by: Maciej Zenczykowski Signed-off-by: Steffen Klassert commit 9c90c9b3e50e16d03c7f87d63e9db373974781e0 Author: Michal Kubecek Date: Mon May 23 22:05:24 2022 +0200 Revert "net: af_key: add check for pfkey_broadcast in function pfkey_process" This reverts commit 4dc2a5a8f6754492180741facf2a8787f2c415d7. A non-zero return value from pfkey_broadcast() does not necessarily mean an error occurred as this function returns -ESRCH when no registered listener received the message. In particular, a call with BROADCAST_PROMISC_ONLY flag and null one_sk argument can never return zero so that this commit in fact prevents processing any PF_KEY message. One visible effect is that racoon daemon fails to find encryption algorithms like aes and refuses to start. Excluding -ESRCH return value would fix this but it's not obvious that we really want to bail out here and most other callers of pfkey_broadcast() also ignore the return value. Also, as pointed out by Steffen Klassert, PF_KEY is kind of deprecated and newer userspace code should use netlink instead so that we should only disturb the code for really important fixes. v2: add a comment explaining why is the return value ignored Signed-off-by: Michal Kubecek Signed-off-by: Steffen Klassert commit ffd1925a596ce68bed7d81c61cb64bc35f788a9d Author: Yanfei Xu Date: Mon May 23 22:08:21 2022 +0800 KVM: x86: Fix the intel_pt PMI handling wrongly considered from guest When kernel handles the vm-exit caused by external interrupts and NMI, it always sets kvm_intr_type to tell if it's dealing an IRQ or NMI. For the PMI scenario, it could be IRQ or NMI. However, intel_pt PMIs are only generated for HARDWARE perf events, and HARDWARE events are always configured to generate NMIs. Use kvm_handling_nmi_from_guest() to precisely identify if the intel_pt PMI came from the guest; this avoids false positives if an intel_pt PMI/NMI arrives while the host is handling an unrelated IRQ VM-Exit. Fixes: db215756ae59 ("KVM: x86: More precisely identify NMI from guest when handling PMI") Signed-off-by: Yanfei Xu Message-Id: <20220523140821.1345605-1-yanfei.xu@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 366d4a12cdcf3d83c8162ff6e0046c123567c754 Author: Like Xu Date: Thu May 19 01:01:17 2022 +0800 KVM: selftests: x86: Sync the new name of the test case to .gitignore Fixing side effect of the so-called opportunistic change in the commit. Fixes: dc8a9febbab0 ("KVM: selftests: x86: Fix test failure on arch lbr capable platforms") Signed-off-by: Like Xu Message-Id: <20220518170118.66263-2-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 186af6bb40c4fd2048bb81253c1109d8b3011e42 Author: Paolo Bonzini Date: Fri May 20 07:22:46 2022 -0400 Documentation: kvm: reorder ARM-specific section about KVM_SYSTEM_EVENT_SUSPEND Signed-off-by: Paolo Bonzini commit baec4f5a018fe2d708fc1022330dba04b38b5fe3 Author: Paolo Bonzini Date: Tue May 24 09:43:31 2022 -0400 x86, kvm: use correct GFP flags for preemption disabled Commit ddd7ed842627 ("x86/kvm: Alloc dummy async #PF token outside of raw spinlock") leads to the following Smatch static checker warning: arch/x86/kernel/kvm.c:212 kvm_async_pf_task_wake() warn: sleeping in atomic context arch/x86/kernel/kvm.c 202 raw_spin_lock(&b->lock); 203 n = _find_apf_task(b, token); 204 if (!n) { 205 /* 206 * Async #PF not yet handled, add a dummy entry for the token. 207 * Allocating the token must be down outside of the raw lock 208 * as the allocator is preemptible on PREEMPT_RT kernels. 209 */ 210 if (!dummy) { 211 raw_spin_unlock(&b->lock); --> 212 dummy = kzalloc(sizeof(*dummy), GFP_KERNEL); ^^^^^^^^^^ Smatch thinks the caller has preempt disabled. The `smdb.py preempt kvm_async_pf_task_wake` output call tree is: sysvec_kvm_asyncpf_interrupt() <- disables preempt -> __sysvec_kvm_asyncpf_interrupt() -> kvm_async_pf_task_wake() The caller is this: arch/x86/kernel/kvm.c 290 DEFINE_IDTENTRY_SYSVEC(sysvec_kvm_asyncpf_interrupt) 291 { 292 struct pt_regs *old_regs = set_irq_regs(regs); 293 u32 token; 294 295 ack_APIC_irq(); 296 297 inc_irq_stat(irq_hv_callback_count); 298 299 if (__this_cpu_read(apf_reason.enabled)) { 300 token = __this_cpu_read(apf_reason.token); 301 kvm_async_pf_task_wake(token); 302 __this_cpu_write(apf_reason.token, 0); 303 wrmsrl(MSR_KVM_ASYNC_PF_ACK, 1); 304 } 305 306 set_irq_regs(old_regs); 307 } The DEFINE_IDTENTRY_SYSVEC() is a wrapper that calls this function from the call_on_irqstack_cond(). It's inside the call_on_irqstack_cond() where preempt is disabled (unless it's already disabled). The irq_enter/exit_rcu() functions disable/enable preempt. Reported-by: Dan Carpenter Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 619f51da097952194a5d4d6a6c5f9ef3b9d1b25a Author: Wanpeng Li Date: Fri May 20 10:15:18 2022 -0400 KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer The timer is disarmed when switching between TSC deadline and other modes; however, the pending timer is still in-flight, so let's accurately remove any traces of the previous mode. Fixes: 4427593258 ("KVM: x86: thoroughly disarm LAPIC timer around TSC deadline switch") Signed-off-by: Wanpeng Li Signed-off-by: Paolo Bonzini commit 0547758a6de3cc71a0cfdd031a3621a30db6a68b Author: Sean Christopherson Date: Thu May 19 07:57:11 2022 -0700 x86/kvm: Alloc dummy async #PF token outside of raw spinlock Drop the raw spinlock in kvm_async_pf_task_wake() before allocating the the dummy async #PF token, the allocator is preemptible on PREEMPT_RT kernels and must not be called from truly atomic contexts. Opportunistically document why it's ok to loop on allocation failure, i.e. why the function won't get stuck in an infinite loop. Reported-by: Yajun Deng Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit fee060cd52d69c114b62d1a2948ea9648b5131f9 Author: Sean Christopherson Date: Fri Mar 11 03:27:41 2022 +0000 KVM: x86: avoid calling x86 emulator without a decoded instruction Whenever x86_decode_emulated_instruction() detects a breakpoint, it returns the value that kvm_vcpu_check_breakpoint() writes into its pass-by-reference second argument. Unfortunately this is completely bogus because the expected outcome of x86_decode_emulated_instruction is an EMULATION_* value. Then, if kvm_vcpu_check_breakpoint() does "*r = 0" (corresponding to a KVM_EXIT_DEBUG userspace exit), it is misunderstood as EMULATION_OK and x86_emulate_instruction() is called without having decoded the instruction. This causes various havoc from running with a stale emulation context. The fix is to move the call to kvm_vcpu_check_breakpoint() where it was before commit 4aa2691dcbd3 ("KVM: x86: Factor out x86 instruction emulation with decoding") introduced x86_decode_emulated_instruction(). The other caller of the function does not need breakpoint checks, because it is invoked as part of a vmexit and the processor has already checked those before executing the instruction that #GP'd. This fixes CVE-2022-1852. Reported-by: Qiuhao Li Reported-by: Gaoning Pan Reported-by: Yongkang Jia Fixes: 4aa2691dcbd3 ("KVM: x86: Factor out x86 instruction emulation with decoding") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220311032801.3467418-2-seanjc@google.com> [Rewrote commit message according to Qiuhao's report, since a patch already existed to fix the bug. - Paolo] Signed-off-by: Paolo Bonzini commit d22d2474e3953996f03528b84b7f52cc26a39403 Author: Ashish Kalra Date: Mon May 16 15:43:10 2022 +0000 KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel data leak For some sev ioctl interfaces, the length parameter that is passed maybe less than or equal to SEV_FW_BLOB_MAX_SIZE, but larger than the data that PSP firmware returns. In this case, kmalloc will allocate memory that is the size of the input rather than the size of the data. Since PSP firmware doesn't fully overwrite the allocated buffer, these sev ioctl interface may return uninitialized kernel slab memory. Reported-by: Andy Nguyen Suggested-by: David Rientjes Suggested-by: Peter Gonda Cc: kvm@vger.kernel.org Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Fixes: eaf78265a4ab3 ("KVM: SVM: Move SEV code to separate file") Fixes: 2c07ded06427d ("KVM: SVM: add support for SEV attestation command") Fixes: 4cfdd47d6d95a ("KVM: SVM: Add KVM_SEV SEND_START command") Fixes: d3d1af85e2c75 ("KVM: SVM: Add KVM_SEND_UPDATE_DATA command") Fixes: eba04b20e4861 ("KVM: x86: Account a variety of miscellaneous allocations") Signed-off-by: Ashish Kalra Reviewed-by: Peter Gonda Message-Id: <20220516154310.3685678-1-Ashish.Kalra@amd.com> Signed-off-by: Paolo Bonzini commit d187ba5312307d51818beafaad87d28a7d939adf Author: Sean Christopherson Date: Wed May 4 00:12:19 2022 +0000 x86/fpu: KVM: Set the base guest FPU uABI size to sizeof(struct kvm_xsave) Set the starting uABI size of KVM's guest FPU to 'struct kvm_xsave', i.e. to KVM's historical uABI size. When saving FPU state for usersapce, KVM (well, now the FPU) sets the FP+SSE bits in the XSAVE header even if the host doesn't support XSAVE. Setting the XSAVE header allows the VM to be migrated to a host that does support XSAVE without the new host having to handle FPU state that may or may not be compatible with XSAVE. Setting the uABI size to the host's default size results in out-of-bounds writes (setting the FP+SSE bits) and data corruption (that is thankfully caught by KASAN) when running on hosts without XSAVE, e.g. on Core2 CPUs. WARN if the default size is larger than KVM's historical uABI size; all features that can push the FPU size beyond the historical size must be opt-in. ================================================================== BUG: KASAN: slab-out-of-bounds in fpu_copy_uabi_to_guest_fpstate+0x86/0x130 Read of size 8 at addr ffff888011e33a00 by task qemu-build/681 CPU: 1 PID: 681 Comm: qemu-build Not tainted 5.18.0-rc5-KASAN-amd64 #1 Hardware name: /DG35EC, BIOS ECG3510M.86A.0118.2010.0113.1426 01/13/2010 Call Trace: dump_stack_lvl+0x34/0x45 print_report.cold+0x45/0x575 kasan_report+0x9b/0xd0 fpu_copy_uabi_to_guest_fpstate+0x86/0x130 kvm_arch_vcpu_ioctl+0x72a/0x1c50 [kvm] kvm_vcpu_ioctl+0x47f/0x7b0 [kvm] __x64_sys_ioctl+0x5de/0xc90 do_syscall_64+0x31/0x50 entry_SYSCALL_64_after_hwframe+0x44/0xae Allocated by task 0: (stack is not available) The buggy address belongs to the object at ffff888011e33800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes to the right of 512-byte region [ffff888011e33800, ffff888011e33a00) The buggy address belongs to the physical page: page:0000000089cd4adb refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e30 head:0000000089cd4adb order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888001041c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888011e33900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011e33980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888011e33a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888011e33a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888011e33b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Disabling lock debugging due to kernel taint Fixes: be50b2065dfa ("kvm: x86: Add support for getting/setting expanded xstate buffer") Fixes: c60427dd50ba ("x86/fpu: Add uabi_size to guest_fpu") Reported-by: Zdenek Kaspar Cc: Maciej S. Szmigiero Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Tested-by: Zdenek Kaspar Message-Id: <20220504001219.983513-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit eb3de2d8f78d893303891d879f941c47f2f2d13d Author: Paolo Bonzini Date: Mon May 23 15:23:21 2022 -0400 s390/uv_uapi: depend on CONFIG_S390 Signed-off-by: Paolo Bonzini commit 1644e270592001f47572c70106d618283ece1ef6 Merge: b699da3dc2795 c71159648c3cf Author: Paolo Bonzini Date: Wed May 25 05:11:21 2022 -0400 Merge tag 'kvm-s390-next-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fix and feature for 5.19 - ultravisor communication device driver - fix TEID on terminating storage key ops commit b699da3dc27959091fafbd906853a38cfc2887a7 Merge: 47e8eec832620 fed9b26b2501e Author: Paolo Bonzini Date: Wed May 25 05:09:49 2022 -0400 Merge tag 'kvm-riscv-5.19-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 5.19 - Added Sv57x4 support for G-stage page table - Added range based local HFENCE functions - Added remote HFENCE functions based on VCPU requests - Added ISA extension registers in ONE_REG interface - Updated KVM RISC-V maintainers entry to cover selftests support commit 47e8eec83262083c7da220446551eaad614218ea Merge: 825be3b5abae1 5c0ad551e9aa6 Author: Paolo Bonzini Date: Fri May 20 07:16:27 2022 -0400 Merge tag 'kvmarm-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for 5.19 - Add support for the ARMv8.6 WFxT extension - Guard pages for the EL2 stacks - Trap and emulate AArch32 ID registers to hide unsupported features - Ability to select and save/restore the set of hypercalls exposed to the guest - Support for PSCI-initiated suspend in collaboration with userspace - GICv3 register-based LPI invalidation support - Move host PMU event merging into the vcpu data structure - GICv3 ITS save/restore fixes - The usual set of small-scale cleanups and fixes [Due to the conflict, KVM_SYSTEM_EVENT_SEV_TERM is relocated from 4 to 6. - Paolo] commit 825be3b5abae1e67db45ff7d4b9a7764a2419bd9 Author: Yang Weijiang Date: Thu May 12 04:40:46 2022 -0400 KVM: selftests: x86: Fix test failure on arch lbr capable platforms On Arch LBR capable platforms, LBR_FMT in perf capability msr is 0x3f, so the last format test will fail. Use a true invalid format(0x30) for the test if it's running on these platforms. Opportunistically change the file name to reflect the tests actually carried out. Suggested-by: Paolo Bonzini Signed-off-by: Yang Weijiang Message-Id: <20220512084046.105479-1-weijiang.yang@intel.com> Signed-off-by: Paolo Bonzini commit e0ac535178ad32c2a4898e2309dcc49ad546e96e Author: Wanpeng Li Date: Tue Apr 26 01:25:51 2022 -0700 KVM: LAPIC: Trace LAPIC timer expiration on every vmentry In commit ec0671d5684a ("KVM: LAPIC: Delay trace_kvm_wait_lapic_expire tracepoint to after vmexit", 2019-06-04), trace_kvm_wait_lapic_expire was moved after guest_exit_irqoff() because invoking tracepoints within kvm_guest_enter/kvm_guest_exit caused a lockdep splat. These days this is not necessary, because commit 87fa7f3e98a1 ("x86/kvm: Move context tracking where it belongs", 2020-07-09) restricted the RCU extended quiescent state to be closer to vmentry/vmexit. Moving the tracepoint back to __kvm_wait_lapic_expire is more accurate, because it will be reported even if vcpu_enter_guest causes multiple vmentries via the IPI/Timer fast paths, and it allows the removal of advance_expire_delta. Signed-off-by: Wanpeng Li Message-Id: <1650961551-38390-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 6e516faf04317db2c46cbec4e3b78b4653a5b109 Author: Steven Price Date: Thu May 19 16:20:03 2022 +0100 drm/panfrost: Job should reference MMU not file_priv For a while now it's been allowed for a MMU context to outlive it's corresponding panfrost_priv, however the job structure still references panfrost_priv to get hold of the MMU context. If panfrost_priv has been freed this is a use-after-free which I've been able to trigger resulting in a splat. To fix this, drop the reference to panfrost_priv in the job structure and add a direct reference to the MMU structure which is what's actually needed. Fixes: 7fdc48cc63a3 ("drm/panfrost: Make sure MMU context lifetime is not bound to panfrost_priv") Signed-off-by: Steven Price Acked-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20220519152003.81081-1-steven.price@arm.com commit 83969805cc716a7dc6b296c3fb1bc7e5cd7ca321 Author: Hector Martin Date: Tue May 24 23:22:06 2022 +0900 pinctrl: apple: Use a raw spinlock for the regmap The irqchip ops are called with a raw spinlock held, so the subsequent regmap usage cannot use a plain spinlock. spi-hid-apple-of spi0.0: spihid_apple_of_probe:74 ============================= [ BUG: Invalid wait context ] 5.18.0-asahi-00176-g0fa3ab03bdea #1337 Not tainted ----------------------------- kworker/u20:3/86 is trying to lock: ffff8000166b5018 (pinctrl_apple_gpio:462:(®map_config)->lock){....}-{3:3}, at: regmap_lock_spinlock+0x18/0x30 other info that might help us debug this: context-{5:5} 7 locks held by kworker/u20:3/86: #0: ffff800017725d48 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670 #1: ffff80001e33bdd0 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x1c8/0x670 #2: ffff800017d629a0 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c #3: ffff80002414e618 (&ctlr->add_lock){+.+.}-{4:4}, at: spi_add_device+0x40/0x80 #4: ffff800024116990 (&dev->mutex){....}-{4:4}, at: __device_attach+0x30/0x17c #5: ffff800022d4be58 (request_class){+.+.}-{4:4}, at: __setup_irq+0xa8/0x720 #6: ffff800022d4bcc8 (lock_class){....}-{2:2}, at: __setup_irq+0xcc/0x720 Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20220524142206.18833-1-marcan@marcan.st Signed-off-by: Linus Walleij commit 71cc785d295527587faa8e3d825ef7c0e1cb2d12 Merge: d75c26a9266e1 c17f8fd3f2184 Author: Stephen Boyd Date: Wed May 25 00:27:32 2022 -0700 Merge branch 'clk-qcom' into clk-next * clk-qcom: Revert "clk: qcom: regmap-mux: add pipe clk implementation" Revert "clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" Revert "clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" clk: qcom: rcg2: Cache CFG register updates for parked RCGs clk: qcom: add sc8280xp GCC driver dt-bindings: clock: Add Qualcomm SC8280XP GCC bindings clk: qcom: gcc-msm8976: Add modem reset dt-bindings: clk: qcom: gcc-msm8976: Add modem reset clk: qcom: gcc-msm8976: Set floor ops for SDCC dt-bindings: clock: qcom,gcc-apq8064: Fix typo in compatible and split apq8084 clk: qcom: smd: Update MSM8976 RPM clocks. clk: qcom: gcc-msm8998: add SSC-related clocks dt-bindings: clock: gcc-msm8998: Add definitions of SSC-related clocks dt-bindings: clock: qcom,rpmcc: add clocks property dt-bindings: clock: qcom,rpmcc: convert to dtschema clk: qcom: lpass: Add support for LPASS clock controller for SC7280 dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280 clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks clk: qcom: regmap-mux: add pipe clk implementation commit d75c26a9266e11e423ec4c69d6c56d8df4911f42 Merge: d3d88716a6ce8 7337342b354b5 e98839fb56ea2 f538ce1123856 538101dd7ce36 83ce0357dcb7f Author: Stephen Boyd Date: Wed May 25 00:27:09 2022 -0700 Merge branches 'clk-rockchip', 'clk-ingenic', 'clk-bindings', 'clk-samsung' and 'clk-stm' into clk-next - Mark some clks critical on Ingenic X1000 - Add STM32MP13 RCC driver (Reset Clock Controller) * clk-rockchip: dt-bindings: clock: convert rockchip,rk3368-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3228-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3036-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3308-cru.txt to YAML dt-bindings: clock: convert rockchip,px30-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3188-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3288-cru.txt to YAML dt-bindings: clock: convert rockchip,rv1108-cru.txt to YAML dt-binding: clock: Add missing rk3568 cru bindings clk: rockchip: Mark hclk_vo as critical on rk3568 dt-bindings: clock: fix rk3399 cru clock issues dt-bindings: clock: use generic node name for pmucru example in rockchip,rk3399-cru.yaml dt-bindings: clock: replace a maintainer for rockchip,rk3399-cru.yaml dt-bindings: clock: fix some conversion style issues for rockchip,rk3399-cru.yaml * clk-ingenic: clk: ingenic-tcu: Fix missing TCU clock for X1000 SoCs mips: ingenic: Do not manually reference the CPU clock clk: ingenic: Mark critical clocks in Ingenic SoCs clk: ingenic: Allow specifying common clock flags * clk-bindings: dt-bindings: clock: Replace common binding with link to schema * clk-samsung: dt-bindings: clock: exynosautov9: correct count of NR_CLK clk: samsung: exynosautov9: add cmu_peric1 clock support clk: samsung: exynosautov9: add cmu_peric0 clock support clk: samsung: exynosautov9: add cmu_fsys2 clock support clk: samsung: exynosautov9: add cmu_busmc clock support clk: samsung: exynosautov9: add cmu_peris clock support clk: samsung: exynosautov9: add cmu_core clock support clk: samsung: add top clock support for Exynos Auto v9 SoC dt-bindings: clock: add Exynos Auto v9 SoC CMU bindings dt-bindings: clock: add clock binding definitions for Exynos Auto v9 * clk-stm: clk: stm32mp13: add safe mux management clk: stm32mp13: add multi mux function clk: stm32mp13: add all STM32MP13 kernel clocks clk: stm32mp13: add all STM32MP13 peripheral clocks clk: stm32mp13: manage secured clocks clk: stm32mp13: add composite clock clk: stm32mp13: add stm32 divider clock clk: stm32mp13: add stm32_gate management clk: stm32mp13: add stm32_mux clock management clk: stm32: Introduce STM32MP13 RCC drivers (Reset Clock Controller) dt-bindings: rcc: stm32: add new compatible for STM32MP13 SoC commit d3d88716a6ce892d3a1fd90d602dded36830ca8d Merge: 2c29798c5d6f5 bea0b66efa654 5876ee756c816 8b9d9e9f8e605 0594058b723b9 3972b152e3da5 Author: Stephen Boyd Date: Wed May 25 00:26:52 2022 -0700 Merge branches 'clk-ux500', 'clk-mtk', 'clk-tegra', 'clk-allwinner' and 'clk-imx' into clk-next - Convert ux500 to clk_hw - Add the two missing CLKOUT clocks for U8500/DB8500 SoC - MediaTek MT8186 SoC clk support - Move MediaTek driver to clk_hw provider APIs * clk-ux500: clk: ux500: fix a possible off-by-one in u8500_prcc_reset_base() clk: ux500: Implement the missing CLKOUT clocks clk: ux500: Rewrite PRCMU clocks to use clk_hw_* clk: ux500: Drop .is_prepared state from PRCMU clocks clk: ux500: Drop .is_enabled state from PRCMU clocks dt-bindings: clock: u8500: Add clkout clock bindings * clk-mtk: (22 commits) clk: mediatek: mt8173: Switch to clk_hw provider APIs clk: mediatek: Switch to clk_hw provider APIs clk: mediatek: Replace 'struct clk' with 'struct clk_hw' clk: mediatek: apmixed: Drop error message from clk_register() failure clk: mediatek: Make mtk_clk_register_composite() static clk: mediatek: use en_mask as a pure div_en_mask clk: mediatek: update compatible string for MT7986 ethsys clk: mediatek: Add MT8186 ipesys clock support clk: mediatek: Add MT8186 mdpsys clock support clk: mediatek: Add MT8186 camsys clock support clk: mediatek: Add MT8186 vencsys clock support clk: mediatek: Add MT8186 vdecsys clock support clk: mediatek: Add MT8186 imgsys clock support clk: mediatek: Add MT8186 wpesys clock support clk: mediatek: Add MT8186 mmsys clock support clk: mediatek: Add MT8186 mfgsys clock support clk: mediatek: Add MT8186 imp i2c wrapper clock support clk: mediatek: Add MT8186 apmixedsys clock support clk: mediatek: Add MT8186 infrastructure clock support clk: mediatek: Add MT8186 topckgen clock support ... * clk-tegra: clk: tegra: Update kerneldoc to match prototypes clk: tegra: Replace .round_rate() with .determine_rate() clk: tegra: Register clocks from root to leaf clk: tegra: Add missing reset deassertion * clk-allwinner: clk: sunxi-ng: h616: Add PLL derived 32KHz clock clk: sunxi-ng: h6-r: Add RTC gate clock * clk-imx: clk: imx8mp: fix usb_root_clk parent clk: imx8mp: add clkout1/2 support clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage clk: imx8mp: Add DISP2 pixel clock clk: imx: scu: fix a potential memory leak in __imx_clk_gpr_scu() clk: imx: Add check for kcalloc clk: imx8mn: add GPT support dt-bindings: imx: add clock bindings for i.MX8MN GPT clk: imx: Remove the snvs clock clk: imx8m: check mcore_booted before register clk clk: imx: add mcore_booted module paratemter clk: imx8mq: add 27m phy pll ref clock commit 2c29798c5d6f5756516881cb45eae9d6ca3d2a80 Merge: 560a3164c9a3a b7fa6242f3e03 c6b61d48b369f 5baa12cfc433f 13982e866c74b Author: Stephen Boyd Date: Wed May 25 00:26:38 2022 -0700 Merge branches 'clk-ti', 'clk-cleanup', 'clk-airoha', 'clk-i2c-simple' and 'clk-renesas' into clk-next - Airoha EN7523 SoC system clocks - Use i2c driver probe_new to avoid id scans * clk-ti: clk: ti: clkctrl: replace usage of found with dedicated list iterator variable clk: ti: composite: Prefer kcalloc over open coded arithmetic clk: keystone: syscon-clk: Add support for AM62 epwm-tbclk dt-bindings: clock: ehrpwm: Add AM62 specific compatible * clk-cleanup: clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc() clk: fixed-rate: Remove redundant if statement clk: mux: remove redundant initialization of variable width clk: using pm_runtime_resume_and_get instead of pm_runtime_get_sync clk: actions: remove redundant assignment after a mask operation * clk-airoha: clk: en7523: fix wrong pointer check in en7523_clk_probe() clk: en7523: Add clock driver for Airoha EN7523 SoC dt-bindings: Add en7523-scu device tree binding documentation * clk-i2c-simple: clk: renesas-pcie: use simple i2c probe function clk: si570: use i2c_match_id and simple i2c probe clk: si544: use i2c_match_id and simple i2c probe clk: si5351: use i2c_match_id and simple i2c probe clk: si5341: use simple i2c probe function clk: si514: use simple i2c probe function clk: max9485: use simple i2c probe function clk: cs2000-cp: use simple i2c probe function clk: cdce925: use i2c_match_id and simple i2c probe clk: cdce706: use simple i2c probe function * clk-renesas: (48 commits) clk: renesas: r9a09g011: Add eth clock and reset entries clk: renesas: Add RZ/V2M support using the rzg2l driver clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg clk: renesas: rzg2l: Make use of CLK_MON registers optional clk: renesas: rzg2l: Set HIWORD mask for all mux and dividers clk: renesas: rzg2l: Add read only versions of the clk macros clk: renesas: rzg2l: Move the DEF_MUX array size calc into the macro dt-bindings: clock: renesas,rzg2l: Document RZ/V2M SoC clk: renesas: r9a07g044: Fix OSTM1 module clock name clk: renesas: r9a07g043: Add clock and reset entries for ADC clk: renesas: r9a07g043: Add TSU clock and reset entry clk: renesas: r9a07g043: Add RSPI clock and reset entries clk: renesas: r9a07g043: Add clock and reset entries for SPI Multi I/O Bus Controller clk: renesas: r9a07g044: Add DSI clock and reset entries clk: renesas: r9a07g044: Add LCDC clock and reset entries clk: renesas: r9a07g044: Add M4 Clock support clk: renesas: r9a07g044: Add M3 Clock support clk: renesas: r9a07g044: Add {M2, M2_DIV2} Clocks support clk: renesas: r9a07g044: Add M1 clock support clk: renesas: rzg2l: Add DSI divider clk support ... commit c17f8fd3f2184cf0f56626d1691dce417c450ca0 Merge: 856c7986d29dd 03e053b4f717c Author: Stephen Boyd Date: Wed May 25 00:08:38 2022 -0700 Merge tag 'qcom-clk-for-5.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull some Qualcomm clock driver reverts from Bjorn Andersson: After concerns were raised about the new PCIe pipe_clk mux implementation an updated implementation has evolved, but has not yet been accepted. This reverts the merged changes to avoid these concerns in the current release. * tag 'qcom-clk-for-5.19-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: Revert "clk: qcom: regmap-mux: add pipe clk implementation" Revert "clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" Revert "clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" commit 856c7986d29dd74aa37aceedba7ffebcf2c7b24e Merge: 3123109284176 703db1f5da1e3 Author: Stephen Boyd Date: Wed May 25 00:07:54 2022 -0700 Merge tag 'qcom-clk-for-5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull Qualcomm clock driver updates from Bjorn Andersson: This introduces the LPASS clock controller driver for sc7280 and the global clock controller for SC8280XP. It adds modem reset, corrects RPM clocks and moves to floor ops for SDCC on MSM8976. It introduces clocks needed to operate the Sensor Subsystem in MSM8998. It enhances the logic for parked shared RCG2s, to avoid problems on recent platforms. And lastly it introduces a new mechanism for handling the PCIe pipe_clk, which also needs to be parked on a safe source when the PHY is turned off. * tag 'qcom-clk-for-5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: clk: qcom: rcg2: Cache CFG register updates for parked RCGs clk: qcom: add sc8280xp GCC driver dt-bindings: clock: Add Qualcomm SC8280XP GCC bindings clk: qcom: gcc-msm8976: Add modem reset dt-bindings: clk: qcom: gcc-msm8976: Add modem reset clk: qcom: gcc-msm8976: Set floor ops for SDCC dt-bindings: clock: qcom,gcc-apq8064: Fix typo in compatible and split apq8084 clk: qcom: smd: Update MSM8976 RPM clocks. clk: qcom: gcc-msm8998: add SSC-related clocks dt-bindings: clock: gcc-msm8998: Add definitions of SSC-related clocks dt-bindings: clock: qcom,rpmcc: add clocks property dt-bindings: clock: qcom,rpmcc: convert to dtschema clk: qcom: lpass: Add support for LPASS clock controller for SC7280 dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280 clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks clk: qcom: regmap-mux: add pipe clk implementation commit 78901cfa44981d170fb5caae0d5421c97782b0d0 Author: Chao Yu Date: Wed May 25 09:56:34 2022 +0800 f2fs: avoid unneeded error handling for revoke_entry_slab allocation In __f2fs_commit_atomic_write(), we will guarantee success of revoke_entry_slab allocation, so let's avoid unneeded error handling. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 66d34fcbbe63ebd8584b792e0d741f6648100894 Author: Sungjong Seo Date: Tue May 24 10:29:11 2022 +0900 f2fs: allow compression for mmap files in compress_mode=user Since commit e3c548323d32 ("f2fs: let's allow compression for mmap files"), it has been allowed to compress mmap files. However, in compress_mode=user, it is not allowed yet. To keep the same concept in both compress_modes, f2fs_ioc_(de)compress_file() should also allow it. Let's remove checking mmap files in f2fs_ioc_(de)compress_file() so that the compression for mmap files is also allowed in compress_mode=user. Signed-off-by: Sungjong Seo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fdaf9a5840acaab18694a19e0eb0aa51162eeeed Merge: 8642174b52214 516edb456f121 Author: Linus Torvalds Date: Tue May 24 19:55:07 2022 -0700 Merge tag 'folio-5.19' of git://git.infradead.org/users/willy/pagecache Pull page cache updates from Matthew Wilcox: - Appoint myself page cache maintainer - Fix how scsicam uses the page cache - Use the memalloc_nofs_save() API to replace AOP_FLAG_NOFS - Remove the AOP flags entirely - Remove pagecache_write_begin() and pagecache_write_end() - Documentation updates - Convert several address_space operations to use folios: - is_dirty_writeback - readpage becomes read_folio - releasepage becomes release_folio - freepage becomes free_folio - Change filler_t to require a struct file pointer be the first argument like ->read_folio * tag 'folio-5.19' of git://git.infradead.org/users/willy/pagecache: (107 commits) nilfs2: Fix some kernel-doc comments Appoint myself page cache maintainer fs: Remove aops->freepage secretmem: Convert to free_folio nfs: Convert to free_folio orangefs: Convert to free_folio fs: Add free_folio address space operation fs: Convert drop_buffers() to use a folio fs: Change try_to_free_buffers() to take a folio jbd2: Convert release_buffer_page() to use a folio jbd2: Convert jbd2_journal_try_to_free_buffers to take a folio reiserfs: Convert release_buffer_page() to use a folio fs: Remove last vestiges of releasepage ubifs: Convert to release_folio reiserfs: Convert to release_folio orangefs: Convert to release_folio ocfs2: Convert to release_folio nilfs2: Remove comment about releasepage nfs: Convert to release_folio jfs: Convert to release_folio ... commit 8642174b52214dde4d8113f28fb4c9be5a432126 Merge: f289811258552 e9c3a8e820ed0 Author: Linus Torvalds Date: Tue May 24 19:21:30 2022 -0700 Merge tag 'iomap-5.19-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap updates from Darrick Wong: "There's a couple of corrections sent in by Andreas for some accounting errors. The biggest change this time around is that writeback errors longer clear pageuptodate nor does XFS invalidate the page cache anymore. This brings XFS (and gfs2/zonefs) behavior in line with every other Linux filesystem driver, and fixes some UAF bugs that only cropped up after willy turned on multipage folios for XFS in 5.18-rc1. Regrettably, it took all the way to the end of the 5.18 cycle to find the source of these bugs and reach a consensus that XFS' writeback failure behavior from 20 years ago is no longer necessary. Summary: - Fix a couple of accounting errors in the buffered io code. - Discontinue the practice of marking folios !uptodate and invalidating them when writeback fails. This fixes some UAF bugs when multipage folios are enabled, and brings the behavior of XFS/gfs/zonefs into alignment with the behavior of all the other Linux filesystems" * tag 'iomap-5.19-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: don't invalidate folios after writeback errors iomap: iomap_write_end cleanup iomap: iomap_write_failed fix commit f289811258552a8a8c15d2446f9ead1d567357f2 Merge: fea3043314f30 8e51ec6146fde Author: Linus Torvalds Date: Tue May 24 19:09:16 2022 -0700 Merge tag 'dlm-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This includes several large patches to improve endian handling and remove sparse warnings. The code previously used in/out, in-place endianness conversion functions. Other code cleanup includes the list iterator changes. Finally, a long standing bug was found and fixed, caused by missed decrement on an lock struct ref count" * tag 'dlm-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: (28 commits) dlm: use kref_put_lock in __put_lkb dlm: use kref_put_lock in put_rsb dlm: remove unnecessary error assign dlm: fix missing lkb refcount handling fs: dlm: cast resource pointer to uintptr_t dlm: replace usage of found with dedicated list iterator variable dlm: remove usage of list iterator for list_add() after the loop body dlm: fix pending remove if msg allocation fails dlm: fix wake_up() calls for pending remove dlm: check required context while close dlm: cleanup lock handling in dlm_master_lookup dlm: remove found label in dlm_master_lookup dlm: remove __user conversion warnings dlm: move conversion to compile time dlm: use __le types for dlm messages dlm: use __le types for rcom messages dlm: use __le types for dlm header dlm: use __le types for options header dlm: add __CHECKER__ for false positives dlm: move global to static inits ... commit fea3043314f30a87ca04fd1219661810600e256f Merge: 7208c9842c50f 5f41fdaea63dd Author: Linus Torvalds Date: Tue May 24 19:04:46 2022 -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 bug fixes and cleanups for ext4. In particular, move the crypto related fucntions from fs/ext4/super.c into a new fs/ext4/crypto.c, and fix a number of bugs found by fuzzers and error injection tools" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (25 commits) ext4: only allow test_dummy_encryption when supported ext4: fix bug_on in __es_tree_search ext4: avoid cycles in directory h-tree ext4: verify dir block before splitting it ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state ext4: fix bug_on in ext4_writepages ext4: refactor and move ext4_ioctl_get_encryption_pwsalt() ext4: cleanup function defs from ext4.h into crypto.c ext4: move ext4 crypto code to its own file crypto.c ext4: fix memory leak in parse_apply_sb_mount_options() ext4: reject the 'commit' option on ext2 filesystems ext4: remove duplicated #include of dax.h in inode.c ext4: fix race condition between ext4_write and ext4_convert_inline_data ext4: convert symlink external data block mapping to bdev ext4: add nowait mode for ext4_getblk() ext4: fix journal_ioprio mount option handling ext4: mark group as trimmed only if it was fully scanned ext4: fix use-after-free in ext4_rename_dir_prepare ext4: add unmount filesystem message ext4: remove unnecessary conditionals ... commit c4955d9cd2fc56c43e78c908dad4e2cac7cc9073 Merge: 03536823589a5 0ea917819d12f Author: Dave Airlie Date: Wed May 25 12:03:40 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-05-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 fixes for v5.19 merge window: - Build, sparse, UB, and CFI fixes - Variable scope fix - Audio pipe logging fix - ICL+ DSI NULL dereference fix Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87sfozuj44.fsf@intel.com commit 7208c9842c50f97327aac20be62edc8ad230f05c Merge: bd1b7c1384ec1 c360abbb9db29 Author: Linus Torvalds Date: Tue May 24 19:00:41 2022 -0700 Merge tag 'gfs2-v5.18-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - Clean up the allocation of glocks that have an address space attached - Quota locking fix and quota iomap conversion - Fix the FITRIM error reporting - Some list iterator cleanups * tag 'gfs2-v5.18-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Convert function bh_get to use iomap gfs2: use i_lock spin_lock for inode qadata gfs2: Return more useful errors from gfs2_rgrp_send_discards() gfs2: Use container_of() for gfs2_glock(aspace) gfs2: Explain some direct I/O oddities gfs2: replace 'found' with dedicated list iterator variable commit bd1b7c1384ec15294ee45bf3add7b7036e146dad Merge: 3842007b1a335 0a05fafe9def0 Author: Linus Torvalds Date: Tue May 24 18:52:35 2022 -0700 Merge tag 'for-5.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "Features: - subpage: - support for PAGE_SIZE > 4K (previously only 64K) - make it work with raid56 - repair super block num_devices automatically if it does not match the number of device items - defrag can convert inline extents to regular extents, up to now inline files were skipped but the setting of mount option max_inline could affect the decision logic - zoned: - minimal accepted zone size is explicitly set to 4MiB - make zone reclaim less aggressive and don't reclaim if there are enough free zones - add per-profile sysfs tunable of the reclaim threshold - allow automatic block group reclaim for non-zoned filesystems, with sysfs tunables - tree-checker: new check, compare extent buffer owner against owner rootid Performance: - avoid blocking on space reservation when doing nowait direct io writes (+7% throughput for reads and writes) - NOCOW write throughput improvement due to refined locking (+3%) - send: reduce pressure to page cache by dropping extent pages right after they're processed Core: - convert all radix trees to xarray - add iterators for b-tree node items - support printk message index - user bulk page allocation for extent buffers - switch to bio_alloc API, use on-stack bios where convenient, other bio cleanups - use rw lock for block groups to favor concurrent reads - simplify workques, don't allocate high priority threads for all normal queues as we need only one - refactor scrub, process chunks based on their constraints and similarity - allocate direct io structures on stack and pass around only pointers, avoids allocation and reduces potential error handling Fixes: - fix count of reserved transaction items for various inode operations - fix deadlock between concurrent dio writes when low on free data space - fix a few cases when zones need to be finished VFS, iomap: - add helper to check if sb write has started (usable for assertions) - new helper iomap_dio_alloc_bio, export iomap_dio_bio_end_io" * tag 'for-5.19-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (173 commits) btrfs: zoned: introduce a minimal zone size 4M and reject mount btrfs: allow defrag to convert inline extents to regular extents btrfs: add "0x" prefix for unsupported optional features btrfs: do not account twice for inode ref when reserving metadata units btrfs: zoned: fix comparison of alloc_offset vs meta_write_pointer btrfs: send: avoid trashing the page cache btrfs: send: keep the current inode open while processing it btrfs: allocate the btrfs_dio_private as part of the iomap dio bio btrfs: move struct btrfs_dio_private to inode.c btrfs: remove the disk_bytenr in struct btrfs_dio_private btrfs: allocate dio_data on stack iomap: add per-iomap_iter private data iomap: allow the file system to provide a bio_set for direct I/O btrfs: add a btrfs_dio_rw wrapper btrfs: zoned: zone finish unused block group btrfs: zoned: properly finish block group on metadata write btrfs: zoned: finish block group when there are no more allocatable bytes left btrfs: zoned: consolidate zone finish functions btrfs: zoned: introduce btrfs_zoned_bg_is_full btrfs: improve error reporting in lookup_inline_extent_backref ... commit 3842007b1a33589d57f67eac479b132b77767514 Merge: 65965d9530b0c 14bdb047a54d7 Author: Linus Torvalds Date: Tue May 24 18:48:36 2022 -0700 Merge tag 'zonefs-5.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fix from Damien Le Moal: "A single patch to fix zonefs_init_file_inode() return value" * tag 'zonefs-5.19-rc1-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: Fix zonefs_init_file_inode() return value commit 65965d9530b0c320759cd18a9a5975fb2e098462 Merge: 850f6033cd2bf ba73eadd23d1c Author: Linus Torvalds Date: Tue May 24 18:42:04 2022 -0700 Merge tag 'erofs-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs (and fscache) updates from Gao Xiang: "After working on it on the mailing list for more than half a year, we finally form 'erofs over fscache' feature into shape. Hopefully it could bring more possibility to the communities. The story mainly started from a new project what we called "RAFS v6" [1] for Nydus image service almost a year ago, which enhances EROFS to be a new form of one bootstrap (which includes metadata representing the whole fs tree) + several data-deduplicated content addressable blobs (actually treated as multiple devices). Each blob can represent one container image layer but not quite exactly since all new data can be fully existed in the previous blobs so no need to introduce another new blob. It is actually not a new idea (at least on my side it's much like a simpilied casync [2] for now) and has many benefits over per-file blobs or some other exist ways since typically each RAFS v6 image only has dozens of device blobs instead of thousands of per-file blobs. It's easy to be signed with user keys as a golden image, transfered untouchedly with minimal overhead over the network, kept in some type of storage conveniently, and run with (optional) runtime verification but without involving too many irrelevant features crossing the system beyond EROFS itself. At least it's our final goal and we're keeping working on it. There was also a good summary of this approach from the casync author [3]. Regardless further optimizations, this work is almost done in the previous Linux release cycles. In this round, we'd like to introduce on-demand load for EROFS with the fscache/cachefiles infrastructure, considering the following advantages: - Introduce new file-based backend to EROFS. Although each image only contains dozens of blobs but in densely-deployed runC host for example, there could still be massive blobs on a machine, which is messy if each blob is treated as a device. In contrast, fscache and cachefiles are really great interfaces for us to make them work. - Introduce on-demand load to fscache and EROFS. Previously, fscache is mainly used to caching network-likewise filesystems, now it can support on-demand downloading for local fses too with the exact localfs on-disk format. It has many advantages which we're been described in the latest patchset cover letter [4]. In addition to that, most importantly, the cached data is still stored in the original local fs on-disk format so that it's still the one signed with private keys but only could be partially available. Users can fully trust it during running. Later, users can also back up cachefiles easily to another machine. - More reliable on-demand approach in principle. After data is all available locally, user daemon can be no longer online in some use cases, which helps daemon crash recovery (filesystems can still in service) and hot-upgrade (user daemon can be upgraded more frequently due to new features or protocols introduced.) - Other format can also be converted to EROFS filesystem format over the internet on the fly with the new on-demand load feature and mounted. That is entirely possible with on-demand load feature as long as such archive format metadata can be fetched in advance like stargz. In addition, although currently our target user is Nydus image service [5], but laterly, it can be used for other use cases like on-demand system booting, etc. As for the fscache on-demand load feature itself, strictly it can be used for other local fses too. Laterly we could promote most code to the iomap infrastructure and also enhance it in the read-write way if other local fses are interested. Thanks David Howells for taking so much time and patience on this these months, many thanks with great respect here again! Thanks Jeffle for working on this feature and Xin Yin from Bytedance for asynchronous I/O implementation as well as Zichen Tian, Jia Zhu, and Yan Song for testing, much appeciated. We're also exploring more possibly over fscache cache management over FSDAX for secure containers and working on more improvements and useful features for fscache, cachefiles, and on-demand load. In addition to "erofs over fscache", NFS export and idmapped mount are also completed in this cycle for container use cases as well. Summary: - Add erofs on-demand load support over fscache - Support NFS export for erofs - Support idmapped mounts for erofs - Don't prompt for risk any more when using big pcluster - Fix buffer copy overflow of ztailpacking feature - Several minor cleanups" [1] https://lore.kernel.org/r/20210730194625.93856-1-hsiangkao@linux.alibaba.com [2] https://github.com/systemd/casync [3] http://0pointer.net/blog/casync-a-tool-for-distributing-file-system-images.html [4] https://lore.kernel.org/r/20220509074028.74954-1-jefflexu@linux.alibaba.com [5] https://github.com/dragonflyoss/image-service * tag 'erofs-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: (29 commits) erofs: scan devices from device table erofs: change to use asynchronous io for fscache readpage/readahead erofs: add 'fsid' mount option erofs: implement fscache-based data readahead erofs: implement fscache-based data read for inline layout erofs: implement fscache-based data read for non-inline layout erofs: implement fscache-based metadata read erofs: register fscache context for extra data blobs erofs: register fscache context for primary data blob erofs: add erofs_fscache_read_folios() helper erofs: add anonymous inode caching metadata for data blobs erofs: add fscache context helper functions erofs: register fscache volume erofs: add fscache mode check helper erofs: make erofs_map_blocks() generally available cachefiles: document on-demand read mode cachefiles: add tracepoints for on-demand read mode cachefiles: enable on-demand read mode cachefiles: implement on-demand read cachefiles: notify the user daemon when withdrawing cookie ... commit 850f6033cd2bf3b1fcbf9a20d078edab7e7c67b4 Merge: f30fabe78acb3 64ba4b15e5c04 Author: Linus Torvalds Date: Tue May 24 18:30:27 2022 -0700 Merge tag 'exfat-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat updates from Namjae Jeon: - fix referencing wrong parent directory information during rename - introduce a sys_tz mount option to use system timezone - improve performance while zeroing a cluster with dirsync mount option - fix slab-out-bounds in exat_clear_bitmap() reported from syzbot * tag 'exfat-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: check if cluster num is valid exfat: reduce block requests when zeroing a cluster block: add sync_blockdev_range() exfat: introduce mount option 'sys_tz' exfat: fix referencing wrong parent directory information after renaming commit f30fabe78acb31cd309f2fdfdb0be54df4cad68f Merge: 827060261cf3c e1bbcd277a53e Author: Linus Torvalds Date: Tue May 24 18:19:06 2022 -0700 Merge tag 'fs.idmapped.v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull fs idmapping updates from Christian Brauner: "This contains two minor updates: - An update to the idmapping documentation by Rodrigo making it easier to understand that we first introduce several use-cases that fail without idmapped mounts simply to explain how they can be handled with idmapped mounts. - When changing a mount's idmapping we now hold writers to make it more robust. This is similar to turning a mount ro with the difference that in contrast to turning a mount ro changing the idmapping can only ever be done once while a mount can transition between ro and rw as much as it wants. The vfs layer itself takes care to retrieve the idmapping of a mount once ensuring that the idmapping used for vfs permission checking is identical to the idmapping passed down to the filesystem. All filesystems with FS_ALLOW_IDMAP raised take the same precautions as the vfs in code-paths that are outside of direct control of the vfs such as ioctl()s. However, holding writers makes this more robust and predictable for both the kernel and userspace. This is a minor user-visible change. But it is extremely unlikely to matter. The caller must've created a detached mount via OPEN_TREE_CLONE and then handed that O_PATH fd to another process or thread which then must've gotten a writable fd for that mount and started creating files in there while the caller is still changing mount properties. While not impossible it will be an extremely rare corner-case and should in general be considered a bug in the application. Consider making a mount MOUNT_ATTR_NOEXEC or MOUNT_ATTR_NODEV while allowing someone else to perform lookups or exec'ing in parallel by handing them a copy of the OPEN_TREE_CLONE fd or another fd beneath that mount. I've pinged all major users of idmapped mounts pointing out this change and none of them have active writers on a mount while still changing mount properties. It would've been strange if they did. The rest and majority of the work will be coming through the overlayfs tree this cycle. In addition to overlayfs this cycle should also see support for idmapped mounts on erofs as I've acked a patch to this effect a little while ago" * tag 'fs.idmapped.v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs: hold writers when changing mount's idmapping docs: Add small intro to idmap examples commit 827060261cf3c7b79ee7185d5aa61c851beb9403 Merge: 268db333b561c 340ce50f75a6b Author: Linus Torvalds Date: Tue May 24 18:09:16 2022 -0700 Merge tag 'media/v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - dvb-usb drivers entries got reworked to avoid usage of magic numbers to refer to data position inside tables - vcodec driver has gained support for MT8186 and for vp8 and vp9 stateless codecs - hantro has gained support for Hantro G1 on RK366x - Added more h264 levels on coda960 - ccs gained support for MIPI CSI-2 28 bits per pixel raw data type - venus driver gained support for Qualcomm custom compressed pixel formats - lots of driver fixes and updates * tag 'media/v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (308 commits) media: hantro: Enable HOLD_CAPTURE_BUF for H.264 media: hantro: Add H.264 field decoding support media: hantro: h264: Make dpb entry management more robust media: hantro: Stop using H.264 parameter pic_num media: rkvdec: Enable capture buffer holding for H264 media: rkvdec-h264: Add field decoding support media: rkvdec: Ensure decoded resolution fit coded resolution media: rkvdec: h264: Fix reference frame_num wrap for second field media: rkvdec: h264: Validate and use pic width and height in mbs media: rkvdec: Move H264 SPS validation in rkvdec-h264 media: rkvdec: h264: Fix bit depth wrap in pps packet media: rkvdec: h264: Fix dpb_valid implementation media: rkvdec: Stop overclocking the decoder media: v4l2: Reorder field reflist media: h264: Sort p/b reflist using frame_num media: v4l2: Trace calculated p/b0/b1 initial reflist media: h264: Store all fields into the unordered list media: h264: Store current picture fields media: h264: Increase reference lists size to 32 media: h264: Use v4l2_h264_reference for reflist ... commit 1ae41598f482616449f869daf53eebe37973dc27 Author: Palmer Dabbelt Date: Tue Apr 19 20:01:30 2022 -0700 RISC-V: ignore xipImage This built file shows up in "git status" without an explicit ignore. Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220420184056.7886-3-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit f83050a82d4f0b1cbf48ed458752bb913633d7ee Author: Palmer Dabbelt Date: Tue Apr 19 18:12:01 2022 -0700 RISC-V: Avoid empty create_*_mapping definitions These trigger a handful of build warnings. Reported-by: kernel test robot Fixes: 677b9eb8810e ("riscv: mm: Prepare pt_ops helper functions for sv57") Link: https://lore.kernel.org/r/20220420184056.7886-2-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 268db333b561c77dee3feb6831806412293b4a7e Merge: f4fb8596657c9 f6e109a0afede Author: Linus Torvalds Date: Tue May 24 16:34:14 2022 -0700 Merge tag 'devprop-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework updates from Rafael Wysocki: "These mostly extend the device property API and make it easier to use in some cases. Specifics: - Allow error pointer to be passed to fwnode APIs (Andy Shevchenko). - Introduce fwnode_for_each_parent_node() (Andy Shevchenko, Douglas Anderson). - Advertise fwnode and device property count API calls (Andy Shevchenko). - Clean up fwnode_is_ancestor_of() (Andy Shevchenko). - Convert device_{dma_supported,get_dma_attr} to fwnode (Sakari Ailus). - Release subnode properties with data nodes (Sakari Ailus). - Add ->iomap() and ->irq_get() to fwnode operations (Sakari Ailus)" * tag 'devprop-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Advertise fwnode and device property count API calls device property: Fix recent breakage of fwnode_get_next_parent_dev() device property: Drop 'test' prefix in parameters of fwnode_is_ancestor_of() device property: Introduce fwnode_for_each_parent_node() device property: Allow error pointer to be passed to fwnode APIs ACPI: property: Release subnode properties with data nodes device property: Add irq_get to fwnode operation device property: Add iomap to fwnode operations ACPI: property: Move acpi_fwnode_device_get_match_data() up device property: Convert device_{dma_supported,get_dma_attr} to fwnode commit 3f3489248927a53fcfec571ff603163f6b676a46 Author: Miquel Raynal Date: Fri May 20 10:25:00 2022 +0200 rtc: rzn1: Fix a variable type The calculation in ->set_offset() handles both negative and positive offsets. The 'steps' variable will be checked to be in a specific [-x; +x] range, which means it must be a signed integer rather than unsigned. This also fixes the following smatch warning: warn: 'steps' 'true' implies 'steps > 0' is 'true' Fixes: be4a11cf98af ("rtc: rzn1: Add oscillator offset support") Reported-by: Dan Carpenter Signed-off-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220520082500.489248-1-miquel.raynal@bootlin.com commit 0b6da785130d9e8cf33d001a7bf08a979c87d019 Author: Dan Carpenter Date: Thu May 19 16:56:19 2022 +0300 rtc: rzn1: Fix error code in probe There is a copy and paste error so this code returns the wrong variable. Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver") Signed-off-by: Dan Carpenter Reviewed-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/YoZMg1dmHHSJEfE9@kili commit f4fb8596657c998ca4cdb833bc0f509533a38ddd Merge: 09583dfed2cb9 bbb544f334919 Author: Linus Torvalds Date: Tue May 24 16:19:30 2022 -0700 Merge tag 'thermal-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "These add a thermal library and thermal tools to wrap the netlink interface into event-based callbacks, improve overheat condition handling during suspend-to-idle on Intel SoCs, add some new hardware support, fix bugs and clean up code. Specifics: - Add thermal library and thermal tools to encapsulate the netlink into event based callbacks (Daniel Lezcano, Jiapeng Chong). - Improve overheat condition handling during suspend-to-idle in the Intel PCH thermal driver (Zhang Rui). - Use local ops instead of global ops in devfreq_cooling (Kant Fan). - Clean up _OSC handling in int340x (Davidlohr Bueso). - Switch hisi_termal from CONFIG_PM_SLEEP guards to pm_sleep_ptr() (Hesham Almatary). - Add new k3 j72xx bangdap driver and the corresponding bindings (Keerthy). - Fix missing of_node_put() in the SC iMX driver at probe time (Miaoqian Lin). - Fix memory leak in __thermal_cooling_device_register() when device_register() fails by calling thermal_cooling_device_destroy_sysfs() (Yang Yingliang). - Add sc8180x and sc8280xp compatible string in the DT bindings and lMH support for QCom tsens driver (Bjorn Andersson). - Fix OTP Calibration Register values conforming to the documentation on RZ/G2L and bindings documentation for RZ/G2UL (Biju Das). - Fix type in kerneldoc description for __thermal_bind_params (Corentin Labbe). - Fix potential NULL dereference in sr_thermal_probe() on Broadcom platform (Zheng Yongjun). - Add change mode ops to the thermal-of sensor (Manaf Meethalavalappu Pallikunhi). - Fix non-negative value support by preventing the value to be clamp to zero (Stefan Wahren). - Add compatible string and DT bindings for MSM8960 tsens driver (Dmitry Baryshkov). - Add hwmon support for K3 driver (Massimiliano Minella). - Refactor and add multiple generations support for QCom ADC driver (Jishnu Prakash). - Use platform_get_irq_optional() to get the interrupt on RCar driver and document Document RZ/V2L bindings (Lad Prabhakar). - Remove NULL check after container_of() call from the Intel HFI thermal driver (Haowen Bai)" * tag 'thermal-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (38 commits) thermal: intel: pch: improve the cooling delay log thermal: intel: pch: enhance overheat handling thermal: intel: pch: move cooling delay to suspend_noirq phase PM: wakeup: expose pm_wakeup_pending to modules thermal: k3_j72xx_bandgap: Add the bandgap driver support dt-bindings: thermal: k3-j72xx: Add VTM bindings documentation thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe thermal/core: Fix memory leak in __thermal_cooling_device_register() dt-bindings: thermal: tsens: Add sc8280xp compatible dt-bindings: thermal: lmh: Add Qualcomm sc8180x compatible thermal/drivers/qcom/lmh: Add sc8180x compatible thermal/drivers/rz2gl: Fix OTP Calibration Register values dt-bindings: thermal: rzg2l-thermal: Document RZ/G2UL bindings thermal: thermal_of: fix typo on __thermal_bind_params tools/thermal: remove unneeded semicolon tools/lib/thermal: remove unneeded semicolon thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe tools/thermal: Add thermal daemon skeleton tools/thermal: Add a temperature capture tool tools/thermal: Add util library ... commit 64d69b5daf6fe9b86236d34e57ba8ebf7d84f245 Author: Miquel Raynal Date: Fri May 20 10:22:21 2022 +0200 rtc: rzn1: Avoid mixing variables In the ->set_offset() callback, the 'val' variable is used for two different purposes at the same time, which is oviously wrong: - It contains the intermediate value of the SUBU register that must be written at the end of ->set_offset(). - It is used in the middle of the above calculations to poll the CTL2 register for a specific value. Let's introduce a 'ctl2' variable just for the readl_poll_timeout() call and use it there in place of 'var'. In order to avoid mixing those two variables again, let's rename the remaining occurences of 'val' into 'subu' and initialize it to 0 to avoid the uninitialized variable situation reported by Tom Rix and Colin Ian King already. Fixes: be4a11cf98af ("rtc: rzn1: Add oscillator offset support") Reported-by: Tom Rix Reported-by: Colin Ian King Signed-off-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220520082221.488849-1-miquel.raynal@bootlin.com commit 09583dfed2cb9723da31601cb7080490c2e2e2d7 Merge: 1961b06c9126e 0d64482bf2991 Author: Linus Torvalds Date: Tue May 24 16:04:25 2022 -0700 Merge tag 'pm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add support for 'artificial' Energy Models in which power numbers for different entities may be in different scales, add support for some new hardware, fix bugs and clean up code in multiple places. Specifics: - Update the Energy Model support code to allow the Energy Model to be artificial, which means that the power values may not be on a uniform scale with other devices providing power information, and update the cpufreq_cooling and devfreq_cooling thermal drivers to support artificial Energy Models (Lukasz Luba). - Make DTPM check the Energy Model type (Lukasz Luba). - Fix policy counter decrementation in cpufreq if Energy Model is in use (Pierre Gondois). - Add CPU-based scaling support to passive devfreq governor (Saravana Kannan, Chanwoo Choi). - Update the rk3399_dmc devfreq driver (Brian Norris). - Export dev_pm_ops instead of suspend() and resume() in the IIO chemical scd30 driver (Jonathan Cameron). - Add namespace variants of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and PM-runtime counterparts (Jonathan Cameron). - Move symbol exports in the IIO chemical scd30 driver into the IIO_SCD30 namespace (Jonathan Cameron). - Avoid device PM-runtime usage count underflows (Rafael Wysocki). - Allow dynamic debug to control printing of PM messages (David Cohen). - Fix some kernel-doc comments in hibernation code (Yang Li, Haowen Bai). - Preserve ACPI-table override during hibernation (Amadeusz Sławiński). - Improve support for suspend-to-RAM for PSCI OSI mode (Ulf Hansson). - Make Intel RAPL power capping driver support the RaptorLake and AlderLake N processors (Zhang Rui, Sumeet Pawnikar). - Remove redundant store to value after multiply in the RAPL power capping driver (Colin Ian King). - Add AlderLake processor support to the intel_idle driver (Zhang Rui). - Fix regression leading to no genpd governor in the PSCI cpuidle driver and fix the riscv-sbi cpuidle driver to allow a genpd governor to be used (Ulf Hansson). - Fix cpufreq governor clean up code to avoid using kfree() directly to free kobject-based items (Kevin Hao). - Prepare cpufreq for powerpc's asm/prom.h cleanup (Christophe Leroy). - Make intel_pstate notify frequency invariance code when no_turbo is turned on and off (Chen Yu). - Add Sapphire Rapids OOB mode support to intel_pstate (Srinivas Pandruvada). - Make cpufreq avoid unnecessary frequency updates due to mismatch between hardware and the frequency table (Viresh Kumar). - Make remove_cpu_dev_symlink() clear the real_cpus mask to simplify code (Viresh Kumar). - Rearrange cpufreq_offline() and cpufreq_remove_dev() to make the calling convention for some driver callbacks consistent (Rafael Wysocki). - Avoid accessing half-initialized cpufreq policies from the show() and store() sysfs functions (Schspa Shi). - Rearrange cpufreq_offline() to make the calling convention for some driver callbacks consistent (Schspa Shi). - Update CPPC handling in cpufreq (Pierre Gondois). - Extend dev_pm_domain_detach() doc (Krzysztof Kozlowski). - Move genpd's time-accounting to ktime_get_mono_fast_ns() (Ulf Hansson). - Improve the way genpd deals with its governors (Ulf Hansson). - Update the turbostat utility to version 2022.04.16 (Len Brown, Dan Merillat, Sumeet Pawnikar, Zephaniah E. Loss-Cutler-Hull, Chen Yu)" * tag 'pm-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (94 commits) PM: domains: Trust domain-idle-states from DT to be correct by genpd PM: domains: Measure power-on/off latencies in genpd based on a governor PM: domains: Allocate governor data dynamically based on a genpd governor PM: domains: Clean up some code in pm_genpd_init() and genpd_remove() PM: domains: Fix initialization of genpd's next_wakeup PM: domains: Fixup QoS latency measurements for IRQ safe devices in genpd PM: domains: Measure suspend/resume latencies in genpd based on governor PM: domains: Move the next_wakeup variable into the struct gpd_timing_data PM: domains: Allocate gpd_timing_data dynamically based on governor PM: domains: Skip another warning in irq_safe_dev_in_sleep_domain() PM: domains: Rename irq_safe_dev_in_no_sleep_domain() in genpd PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd PM: domains: Drop redundant code for genpd always-on governor PM: domains: Add GENPD_FLAG_RPM_ALWAYS_ON for the always-on governor powercap: intel_rapl: remove redundant store to value after multiply cpufreq: CPPC: Enable dvfs_possible_from_any_cpu cpufreq: CPPC: Enable fast_switch ACPI: CPPC: Assume no transition latency if no PCCT ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported ACPI: CPPC: Check _OSC for flexible address space ... commit 1961b06c9126e5b2b949fab806c4e4304d1eae8b Merge: aa051d36ce4ae 5db9ce20951c8 Author: Linus Torvalds Date: Tue May 24 15:46:55 2022 -0700 Merge tag 'acpi-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These update the ACPICA kernel code to upstream revision 20220331, improve handling of PCI devices that are in D3cold during system initialization, add support for a few features, fix bugs and clean up code. Specifics: - Update ACPICA code in the kernel to upstream revision 20220331 including the following changes: - Add support for the Windows 11 _OSI string (Mario Limonciello) - Add the CFMWS subtable to the CEDT table (Lawrence Hileman). - iASL: NHLT: Treat Terminator as specific_config (Piotr Maziarz). - iASL: NHLT: Fix parsing undocumented bytes at the end of Endpoint Descriptor (Piotr Maziarz). - iASL: NHLT: Rename linux specific strucures to device_info (Piotr Maziarz). - Add new ACPI 6.4 semantics to Load() and LoadTable() (Bob Moore). - Clean up double word in comment (Tom Rix). - Update copyright notices to the year 2022 (Bob Moore). - Remove some tabs and // comments - automated cleanup (Bob Moore). - Replace zero-length array with flexible-array member (Gustavo A. R. Silva). - Interpreter: Add units to time variable names (Paul Menzel). - Add support for ARM Performance Monitoring Unit Table (Besar Wicaksono). - Inform users about ACPI spec violation related to sleep length (Paul Menzel). - iASL/MADT: Add OEM-defined subtable (Bob Moore). - Interpreter: Fix some typo mistakes (Selvarasu Ganesan). - Updates for revision E.d of IORT (Shameer Kolothum). - Use ACPI_FORMAT_UINT64 for 64-bit output (Bob Moore). - Improve debug messages in the ACPI device PM code (Rafael Wysocki). - Block ASUS B1400CEAE from suspend to idle by default (Mario Limonciello). - Improve handling of PCI devices that are in D3cold during system initialization (Rafael Wysocki). - Fix BERT error region memory mapping (Lorenzo Pieralisi). - Add support for NVIDIA 16550-compatible port subtype to the SPCR parsing code (Jeff Brasen). - Use static for BGRT_SHOW kobj_attribute defines (Tom Rix). - Fix missing prototype warning for acpi_agdi_init() (Ilkka Koskinen). - Fix missing ERST record ID in the APEI code (Liu Xinpeng). - Make APEI error injection to refuse to inject into the zero page (Tony Luck). - Correct description of INT3407 / INT3532 DPTF attributes in sysfs (Sumeet Pawnikar). - Add support for high frequency impedance notification to the DPTF driver (Sumeet Pawnikar). - Make mp_config_acpi_gsi() a void function (Li kunyu). - Unify Package () representation for properties in the ACPI device properties documentation (Andy Shevchenko). - Include UUID in _DSM evaluation warning (Michael Niewöhner)" * tag 'acpi-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (41 commits) Revert "ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms" ACPI: utils: include UUID in _DSM evaluation warning ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default x86: ACPI: Make mp_config_acpi_gsi() a void function ACPI: DPTF: Add support for high frequency impedance notification ACPI: AGDI: Fix missing prototype warning for acpi_agdi_init() ACPI: bus: Avoid non-ACPI device objects in walks over children ACPI: DPTF: Correct description of INT3407 / INT3532 attributes ACPI: BGRT: use static for BGRT_SHOW kobj_attribute defines ACPI, APEI, EINJ: Refuse to inject into the zero page ACPI: PM: Always print final debug message in acpi_device_set_power() ACPI: SPCR: Add support for NVIDIA 16550-compatible port subtype ACPI: docs: enumeration: Unify Package () for properties (part 2) ACPI: APEI: Fix missing ERST record id ACPICA: Update version to 20220331 ACPICA: exsystem.c: Use ACPI_FORMAT_UINT64 for 64-bit output ACPICA: IORT: Updates for revision E.d ACPICA: executer/exsystem: Fix some typo mistakes ACPICA: iASL/MADT: Add OEM-defined subtable ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms ... commit aa051d36ce4ae23b488489f6b15abad68b59ca23 Merge: d8e0f976f104a 07d17217c668d Author: Linus Torvalds Date: Tue May 24 15:21:15 2022 -0700 Merge tag 'for-linus-2022052401' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - support for pens with 3 buttons with Wacom driver (Joshua Dickens) - support for HID_DG_SCANTIME to report the timestamp for pen and touch events in Wacom driver (Joshua Dickens) - support for sensor discovery in amd-sfh driver (Basavaraj Natikar) - support for wider variety of Huion tablets ported from DIGImend project (José Expósito, Nikolai Kondrashov) - new device IDs and other assorted small code cleanups * tag 'for-linus-2022052401' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (44 commits) HID: apple: Properly handle function keys on Keychron keyboards HID: uclogic: Switch to Digitizer usage for styluses HID: uclogic: Add pen support for XP-PEN Star 06 HID: uclogic: Differentiate touch ring and touch strip HID: uclogic: Always shift touch reports to zero HID: uclogic: Do not focus on touch ring only HID: uclogic: Return raw parameters from v2 pen init HID: uclogic: Move param printing to a function HID: core: Display "SENSOR HUB" for sensor hub bus string in hid_info HID: amd_sfh: Move bus declaration outside of amd-sfh HID: amd_sfh: Add physical location to HID device HID: amd_sfh: Modify the hid name HID: amd_sfh: Modify the bus name HID: amd_sfh: Add sensor name by index for debug info HID: amd_sfh: Add support for sensor discovery HID: bigben: fix slab-out-of-bounds Write in bigben_probe Hid: wacom: Fix kernel test robot warning HID: uclogic: Disable pen usage for Huion keyboard interfaces HID: uclogic: Support disabling pen usage HID: uclogic: Pass keyboard reports as is ... commit d8e0f976f104a0258c0426b3805b057411cd0bd2 Merge: 9b18d07ba3ae7 9c63b846e6df4 Author: Linus Torvalds Date: Tue May 24 15:13:30 2022 -0700 Merge tag 'spi-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "This is quite a quiet release but some new drivers mean that the diffstat is fairly large. The new drivers include the aspeed driver which is migrated from MTD as part of the ongoing move of controllers with specialised support for SPI flashes into the SPI subsystem. - Support for devices which flip CPHA during recieve only transfers (eg, if MOSI and MISO have inverted polarity). - Overhaul of the i.MX driver, including the addition of PIO support for better performance on small transfers. - Migration of the Aspeed driver from MTD. - Support for Aspeed AST2400, Ingenic JZ4775 and X1/2000 and MediaTek IPM and SFI" * tag 'spi-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (84 commits) spi: spi-au1550: replace ternary operator with min() mtd: spi-nor: aspeed: set the decoding size to at least 2MB for AST2600 spi: aspeed: Calibrate read timings spi: aspeed: Add support for the AST2400 SPI controller spi: aspeed: Workaround AST2500 limitations spi: aspeed: Adjust direct mapping to device size spi: aspeed: Add support for direct mapping spi: spi-mem: Convert Aspeed SMC driver to spi-mem spi: Convert the Aspeed SMC controllers device tree binding spi: spi-cadence: Update ISR status variable type to irqreturn_t spi: Doc fix - Describe add_lock and dma_map_dev in spi_controller spi: cadence-quadspi: Handle spi_unregister_master() in remove() spi: stm32-qspi: Remove SR_BUSY bit check before sending command spi: stm32-qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd() spi: stm32-qspi: Fix wait_cmd timeout in APM mode spi: cadence-quadspi: remove unnecessary (void *) casts spi: cadence-quadspi: Add missing blank line in cqspi_request_mmap_dma() spi: spi-imx: mx51_ecspi_prepare_message(): skip writing MX51_ECSPI_CONFIG register if unchanged spi: spi-imx: add PIO polling support spi: spi-imx: replace struct spi_imx_data::bitbang by pointer to struct spi_controller ... commit 9b18d07ba3ae75fcb7a191fafe4e2954f07271be Merge: 5d23bb5f25ed9 a5b8e4a5ceec0 Author: Linus Torvalds Date: Tue May 24 15:09:47 2022 -0700 Merge tag 'regulator-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "This is mostly a drivers update including a couple of new drivers but we do have some fixes and improvements to the core as well. - Make sure we don't log spuriously about uncontrollable regulators. - Don't use delays when we should use sleeps for regulators with larger ramp times. - Support for MediaTek MT6358 and MT6366, Richtek RT5759 and Silicon Mitus SM5703" * tag 'regulator-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (36 commits) regulator: scmi: Fix refcount leak in scmi_regulator_probe regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt regulator: qcom_smd: Fix up PM8950 regulator configuration regulator: core: Fix enable_count imbalance with EXCLUSIVE_GET regulator: core: Add error flags to sysfs attributes regulator: dt-bindings: qcom,rpmh: document vdd-l7-bob-supply on PMR735A regulator: dt-bindings: qcom,rpmh: document supplies per variant regulator: dt-bindings: qcom,rpmh: update maintainers regulator: mt6315: Enforce regulator-compatible, not name regulator: pca9450: Enable DVS control via PMIC_STBY_REQ regulator: pca9450: Make warm reset on WDOG_B assertion regulator: Add property for WDOG_B warm reset regulator: pca9450: Make I2C Level Translator configurable regulator: Add property for I2C level shifter regulator: sm5703: Correct reference to the common regulator schema regulator: sm5703-regulator: Add regulators support for SM5703 MFD dt-bindings: regulator: Add bindings for Silicon Mitus SM5703 regulators regulator: richtek,rt4801: parse GPIOs per regulator regulator: dt-bindings: richtek,rt4801: use existing ena_gpiod feature regulator: core: Sleep (not delay) in set_voltage() ... commit 5d23bb5f25ed9cbf530b99640f4f17f59b79de9e Merge: 638971b77f1c4 5c422f0b970d2 Author: Linus Torvalds Date: Tue May 24 15:02:58 2022 -0700 Merge tag 'regmap-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "The main change here is Marek's addition of bulk read/write callbacks for individual regmaps, we've supported single register operations for a while but there's enough hardware out there which can use bulk equivalents to make it worthwhile" * tag 'regmap-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Add missing map->bus check regmap: Add bulk read/write callbacks into regmap_config regmap: cache: set max_register with reg_stride regmap: Constify static regmap_bus structs commit 638971b77f1c4fb9997c674ad66d1b96f7931c2b Merge: b1b5bf1640165 ded2c4c345001 Author: Linus Torvalds Date: Tue May 24 14:56:38 2022 -0700 Merge tag 'mmc-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Support zero-out using TRIM for eMMC - Allow to override the busy-timeout for the ioctl-cmds MMC host: - Continued the conversion of DT bindings into the JSON schema - jz4740: Apply DMA engine limits to maximum segment size - mmci_stm32: Use a buffer for unaligned DMA requests - mmc_spi: Enabled high-speed modes via parsing of DT - omap: Make clock management to be compliant with CCF - renesas_sdhi: - Support eMMC HS400 mode for R-Car V3H ES2.0 - Don't allow support for eMMC HS400 for R-Car V3M/D3 - sdhci_am654: Fix problem when SD card slot lacks the card detect line - sdhci-esdhc-imx: Add support for the imx8dxl variant - sdhci-brcmstb: Enable support for clock gating to save power - sdhci-msm: - Add support for the sdx65 variant - Add support for the sm8150 variant - sdhci-of-dwcmshc: Add support for the Rockchip rk3588 variant - sdhci-pci-gli: Add workaround to allow GL9755 to enter ASPM L1.2" * tag 'mmc-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (52 commits) mmc: sdhci-of-arasan: Add NULL check for data field mmc: core: Support zeroout using TRIM for eMMC mmc: sdhci-brcmstb: Fix compiler warning mmc: sdhci-msm: Add compatible string check for sdx65 dt-bindings: mmc: sdhci-msm: Document the SDX65 compatible mmc: sdhci-msm: Add compatible string check for sm8150 dt-bindings: mmc: sdhci-msm: Add compatible string for sm8150 mmc: sdhci-msm: Add SoC specific compatibles dt-bindings: mmc: sdhci-msm: Convert bindings to yaml dt-bindings: mmc: brcm,sdhci-brcmstb: cleanup example dt-bindings: mmc: brcm,sdhci-brcmstb: correct number of reg entries mmc: sdhci-brcmstb: Enable Clock Gating to save power mmc: sdhci-brcmstb: Re-organize flags mmc: mmci: Remove custom ios handler mmc: atmel-mci: Simplify if(chan) and if(!chan) mmc: core: use kobj_to_dev() dt-bindings: mmc: sdhci-of-dwcmhsc: Add rk3588 mmc: core: Add CIDs for cards to the entropy pool mmc: core: Allows to override the timeout value for ioctl() path mmc: sdhci-omap: Use of_device_get_match_data() helper ... commit b1b5bf1640165063fd9b7c6aeb5c7d63c4cb3c1d Merge: d335371940179 a508e33956b53 Author: Linus Torvalds Date: Tue May 24 14:50:54 2022 -0700 Merge tag 'for-linus-4.19-1' of https://github.com/cminyard/linux-ipmi Pull IPMI update from Corey Minyard: "Add limits on the number of users and messages, plus sysfs interfaces to control those limits. Other than that, little cleanups, use dev_xxx() insted of pr_xxx(), create initializers for structures, fix a refcount leak, etc" * tag 'for-linus-4.19-1' of https://github.com/cminyard/linux-ipmi: ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe ipmi: remove unnecessary type castings ipmi: Make two logs unique ipmi:si: Convert pr_debug() to dev_dbg() ipmi: Convert pr_debug() to dev_dbg() ipmi: Fix pr_fmt to avoid compilation issues ipmi: Add an intializer for ipmi_recv_msg struct ipmi: Add an intializer for ipmi_smi_msg struct ipmi:ssif: Check for NULL msg when handling events and messages ipmi: use simple i2c probe function ipmi: Add a sysfs count of total outstanding messages for an interface ipmi: Add a sysfs interface to view the number of users ipmi: Limit the number of message a user may have outstanding ipmi: Add a limit on the number of users that may use IPMI commit 32f479d05a445b52cb7fcbe6e06f579fb852be71 Merge: efa315818337c c94f732e8001a Author: Bjorn Helgaas Date: Tue May 24 16:42:28 2022 -0500 Merge branch 'remotes/lorenzo/pci/vmd' - Assign VMD IRQ domain before enumeration to avoid IOMMU interrupt remapping errors when MSI-X remapping is disabled (Nirmal Patel) - Revert VMD workaround that kept MSI-X remapping enabled when IOMMU remapping was enabled (Nirmal Patel) * remotes/lorenzo/pci/vmd: PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") PCI: vmd: Assign VMD IRQ domain before enumeration commit efa315818337ce00d7452546e4966e2692acd9d9 Merge: 647b52ecabb47 6086987bdeb59 Author: Bjorn Helgaas Date: Tue May 24 16:42:27 2022 -0500 Merge branch 'remotes/lorenzo/pci/versatile' - Drop unnecessary "retval" variable, since it's never read (Colin Ian King) * remotes/lorenzo/pci/versatile: PCI: versatile: Remove redundant variable retval commit 647b52ecabb47ad72741861b604a18e38f156d0a Merge: ba3527d8ff7f6 096950e230b8d Author: Bjorn Helgaas Date: Tue May 24 16:42:27 2022 -0500 Merge branch 'remotes/lorenzo/pci/rockchip' - Fix bitmap size when searching for free outbound region (Dan Carpenter) * remotes/lorenzo/pci/rockchip: PCI: rockchip: Fix find_first_zero_bit() limit commit ba3527d8ff7f60b04c7b1495d4bd98edd8ecc3fa Merge: b0266c42894a1 3f467d122f27f Author: Bjorn Helgaas Date: Tue May 24 16:42:26 2022 -0500 Merge branch 'pci/host/qcom' - Add SM8150 SoC DT binding and support (Bhupesh Sharma) - Fix pipe clock imbalance (Johan Hovold) - Fix runtime PM imbalance on probe errors (Johan Hovold) - Fix PHY init imbalance on probe errors (Johan Hovold) - Convert DT binding to YAML (Dmitry Baryshkov) - Update DT binding to show that resets aren't required for MSM8996/APQ8096 platforms (Dmitry Baryshkov) - Add explicit register names per chipset in DT binding (Dmitry Baryshkov) - Add sc7280-specific clock and reset definitions to DT binding (Dmitry Baryshkov) * pci/host/qcom: dt-bindings: PCI: qcom: Add schema for sc7280 chipset dt-bindings: PCI: qcom: Specify reg-names explicitly dt-bindings: PCI: qcom: Do not require resets on msm8996 platforms dt-bindings: PCI: qcom: Convert to YAML PCI: qcom: Fix unbalanced PHY init on probe errors PCI: qcom: Fix runtime PM imbalance on probe errors PCI: qcom: Fix pipe clock imbalance PCI: qcom: Add SM8150 SoC support dt-bindings: pci: qcom: Document PCIe bindings for SM8150 SoC commit b0266c42894a1c706d9bb760a36335b29cae7f20 Merge: 5ae34e8f9e9aa 0d5b8c298545c Author: Bjorn Helgaas Date: Tue May 24 16:42:26 2022 -0500 Merge branch 'remotes/lorenzo/pci/power-slot' - Add of_pci_get_slot_power_limit() to parse the 'slot-power-limit-milliwatt' DT property (Pali Rohár) - Add mvebu support for sending Set_Slot_Power_Limit message (Pali Rohár) * remotes/lorenzo/pci/power-slot: PCI: mvebu: Add support for sending Set_Slot_Power_Limit message PCI: Add function for parsing 'slot-power-limit-milliwatt' DT property PCI: Add PCI_EXP_SLTCTL_ASPL_DISABLE macro commit 5ae34e8f9e9aaf11baff6ef828109fea214f0ad7 Merge: 979db15b4a712 7013654af694f Author: Bjorn Helgaas Date: Tue May 24 16:42:25 2022 -0500 Merge branch 'remotes/lorenzo/pci/microchip' - Add missing semicolon after MODULE_DEVICE_TABLE() (Uwe Kleine-König) - Add chained_irq_enter()/chained_irq_exit() calls to mc_handle_msi() and mc_handle_intx() to avoid lost interrupts (Conor Dooley) - Fix interrupt handling race (Daire McNamara) * remotes/lorenzo/pci/microchip: PCI: microchip: Fix potential race in interrupt handling PCI: microchip: Add missing chained_irq_enter()/exit() calls PCI: microchip: Add a missing semicolon commit 979db15b4a7124a8a2c5198426d5aa9176b1fdc6 Merge: 8d8270069cfb3 1d565935e3b9c Author: Bjorn Helgaas Date: Tue May 24 16:42:25 2022 -0500 Merge branch 'remotes/lorenzo/pci/mediatek' - Fix refcount leak in mtk_pcie_subsys_powerup() (Miaoqian Lin) - Reset PHY and MAC at probe time (AngeloGioacchino Del Regno) * remotes/lorenzo/pci/mediatek: PCI: mediatek-gen3: Assert resets to ensure expected init state PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup() commit 8d8270069cfb3118076f9a49e60bed4daff29558 Merge: b8dc34460ceca a3b18f5f1d42e Author: Bjorn Helgaas Date: Tue May 24 16:42:24 2022 -0500 Merge branch 'remotes/lorenzo/pci/layerscape' - Add a "big-endian" DT property to indicate that the PEX_LUT and PF register blocks are implemented in big-endian (Hou Zhiqiang) - Add EP mode compatible strings for ls1028a (Xiaowei Bao) - Define DT properties for AER/PME interrupts (Li Yang) * remotes/lorenzo/pci/layerscape: dt-bindings: pci: layerscape-pci: define AER/PME interrupts dt-bindings: pci: layerscape-pci: Add EP mode compatible strings for ls1028a dt-bindings: pci: layerscape-pci: Update the description of SCFG property dt-bindings: pci: layerscape-pci: Add a optional property big-endian commit b8dc34460ceca2e09edd9a1cfde3ba5fac5ebdac Merge: 39348d2eb2f5b a6809941c1f17 Author: Bjorn Helgaas Date: Tue May 24 16:42:24 2022 -0500 Merge branch 'remotes/lorenzo/pci/imx6' - Fix PERST# start-up sequence (Francesco Dolcini) * remotes/lorenzo/pci/imx6: PCI: imx6: Fix PERST# start-up sequence commit 39348d2eb2f5b4ffe47b708240ed243d05c563c4 Merge: 086ab94321f48 e8aae154df612 Author: Bjorn Helgaas Date: Tue May 24 16:42:24 2022 -0500 Merge branch 'remotes/lorenzo/pci/dwc' - Return error instead of success if DMA mapping of MSI area fails (Jiantao Zhang) - Drop tegra194 MSI register save/restore, which is unnecessary since the DWC core does it (Jisheng Zhang) - Factor out qcom enable/disable resources code (Dmitry Baryshkov) - Remove "snps,dw-pcie" from rockchip-dwc DT "compatible" property because it's not fully compatible with rockchip (Peter Geis) - Reset rockchip-dwc controller at probe (Peter Geis) - Add rockchip-dwc INTx support (Peter Geis) * remotes/lorenzo/pci/dwc: PCI: rockchip-dwc: Add legacy interrupt support PCI: rockchip-dwc: Reset core at driver probe dt-bindings: PCI: Remove fallback from Rockchip DesignWare binding PCI: qcom-ep: Move enable/disable resources code to common functions PCI: tegra194: Remove unnecessary MSI enable reg save and restore PCI: dwc: Fix setting error return on MSI DMA mapping failure commit 086ab94321f48b4b7d37d12c78e6e1274f082eb7 Merge: 8d8b2669f98e8 95b00f68209e2 Author: Bjorn Helgaas Date: Tue May 24 16:42:23 2022 -0500 Merge branch 'remotes/lorenzo/pci/cadence' - Fix bitmap size when searching for free outbound region (Dan Carpenter) - Do device-specific setup to allow PTM Responder to be enabled (Christian Gmeiner) - Don't advertise FLR in Device Capabilities register because the controller incorrectly resets Margining Lane Status and Margining Lane Control on FLR (Parshuram Thombare) * remotes/lorenzo/pci/cadence: PCI: cadence: Clear FLR in device capabilities register PCI: cadence: Allow PTM Responder to be enabled PCI: cadence: Fix find_first_zero_bit() limit commit 8d8b2669f98e8276ce0c26f5d9562a8ace2f9744 Merge: f1bde2786d8e1 a91ee0e9fca9d Author: Bjorn Helgaas Date: Tue May 24 16:42:23 2022 -0500 Merge branch 'pci/virtualization' - Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() (Yicong Yang, Jay Zhou) * pci/virtualization: PCI: Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() commit f1bde2786d8e1218e40b47788f3a4929c2a3ece0 Merge: 6b5e9bdce6cf6 0ae084d5a6744 Author: Bjorn Helgaas Date: Tue May 24 16:42:22 2022 -0500 Merge branch 'pci/resource' - Clip only host bridge windows for E820 regions and log what is clipped (Bjorn Helgaas) - Add kernel cmdline options to use/ignore E820 reserved regions (Hans de Goede) - Disable E820 reserved region clipping for IdeaPads, Yoga, Yoga Slip, Acer Spin 5, Clevo Barebone systems where clipping leaves no usable address space for touchpads, Thunderbolt devices, etc (Hans de Goede) - Disable E820 reserved region clipping by default starting in 2023 (Hans de Goede) * pci/resource: x86/PCI: Disable E820 reserved region clipping starting in 2023 x86/PCI: Disable E820 reserved region clipping via quirks x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions x86/PCI: Clip only host bridge windows for E820 regions x86: Log resource clipping for E820 regions x86/PCI: Eliminate remove_e820_regions() common subexpressions commit 6b5e9bdce6cf6e2e88b50e85aec0a2193dc69890 Merge: 4f5bc91ce1be9 0f40ac35e4ecb Author: Bjorn Helgaas Date: Tue May 24 16:42:22 2022 -0500 Merge branch 'pci/pm' - Define pci_restore_standard_config() only for CONFIG_PM_SLEEP, since it's not used otherwise (Krzysztof Kozlowski) - Power up all devices during runtime resume (Rafael J. Wysocki) - Resume subordinate bus in bus type callbacks (Rafael J. Wysocki) - Drop pci_dev runtime_d3cold flag since no uses remain (Rafael J. Wysocki) - Move power-up to D0 code to pci_power_up() and rename pci_raw_set_power_state() to pci_set_low_power_state() (Rafael J. Wysocki) - Set current_state to D3cold if the device is not accessible (Rafael J. Wysocki) - Do not call pci_update_current_state() from pci_power_up() (Rafael J. Wysocki) - Write 0 to PMCSR in pci_power_up() in all cases (Rafael J. Wysocki) - Split part of pci_power_up() off to pci_set_full_power_state() (Rafael J. Wysocki) - Do not restore BARs if device is not in D0 (Rafael J. Wysocki) * pci/pm: PCI/PM: Replace pci_set_power_state() in pci_pm_thaw_noirq() PCI/PM: Rearrange pci_set_power_state() PCI/PM: Clean up pci_set_low_power_state() PCI/PM: Do not restore BARs if device is not in D0 PCI/PM: Split pci_power_up() PCI/PM: Write 0 to PMCSR in pci_power_up() in all cases PCI/PM: Do not call pci_update_current_state() from pci_power_up() PCI/PM: Unfold pci_platform_power_transition() in pci_power_up() PCI/PM: Set current_state to D3cold if the device is not accessible PCI/PM: Relocate pci_set_low_power_state() PCI/PM: Split pci_raw_set_power_state() PCI/PM: Rearrange pci_update_current_state() PCI/PM: Drop the runtime_d3cold device flag PCI/PM: Resume subordinate bus in bus type callbacks PCI/PM: Power up all devices during runtime resume PCI/PM: Define pci_restore_standard_config() only for CONFIG_PM_SLEEP commit 4f5bc91ce1be9c0b5ad99cf2d3b97f8d28ac13e7 Merge: e840e475397ed 1af7c26c59ebc Author: Bjorn Helgaas Date: Tue May 24 16:42:22 2022 -0500 Merge branch 'pci/p2pdma' - Update pci_p2pdma_whitelist[] checking so we accept Skylake-E Root Ports even if they're not at devfn 00.0 (Shlomo Pongratz) * pci/p2pdma: PCI/P2PDMA: Whitelist Intel Skylake-E Root Ports at any devfn commit e840e475397ed81f3885af563b1a725debf2a3ac Merge: 85ae3970a0e39 f21949c149680 Author: Bjorn Helgaas Date: Tue May 24 16:42:21 2022 -0500 Merge branch 'pci/misc' - Change pci_set_dma_mask() documentation references to dma_set_mask() (Alex Williamson) * pci/misc: PCI/doc: Update obsolete pci_set_dma_mask() references commit 85ae3970a0e393cbb07ec30ac99d82cfd6c3f922 Merge: 55fd033bae79a b2851926c6d9d Author: Bjorn Helgaas Date: Tue May 24 16:42:21 2022 -0500 Merge branch 'pci/hotplug' - Allow D3 only if Root Port can signal and wake from D3 so we don't miss hotplug events on AMD Yellow Carp (Mario Limonciello) - Clean up hotplug include files to enable future powerpc cleanup (Christophe Leroy) * pci/hotplug: PCI: hotplug: Clean up include files PCI/ACPI: Allow D3 only if Root Port can signal and wake from D3 commit 55fd033bae79a2d51a1804f10dc54b1182a8aa32 Merge: ae0d0d18a8056 203926da2bff8 Author: Bjorn Helgaas Date: Tue May 24 16:42:21 2022 -0500 Merge branch 'pci/error' - Clear AER "multiple errors" bits to avoid race that left them set forever (Kuppuswamy Sathyanarayanan) * pci/error: PCI/AER: Clear MULTI_ERR_COR/UNCOR_RCV bits commit ae0d0d18a8056b59a84384d617eeca3e6c43ccc4 Merge: 3123109284176 03038d84ace72 Author: Bjorn Helgaas Date: Tue May 24 16:42:20 2022 -0500 Merge branch 'pci/aspm' - Quirk Intel DG2 ASPM L1 acceptable latency to be unlimited. The device advertises that it can only tolerate 1us, which means L1 is rarely if ever used (Mika Westerberg) * pci/aspm: PCI/ASPM: Make Intel DG2 L1 acceptable latency unlimited commit 3f467d122f27f3a0be7fa7f2f60c7dd9475c4a81 Author: Dmitry Baryshkov Date: Fri May 6 18:21:03 2022 +0300 dt-bindings: PCI: qcom: Add schema for sc7280 chipset Add support for sc7280-specific clock and reset definitions. Link: https://lore.kernel.org/r/20220506152107.1527552-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring commit c6523c4a301d3adff7ddcf57515b9c847beb7566 Author: Dmitry Baryshkov Date: Fri May 6 18:21:02 2022 +0300 dt-bindings: PCI: qcom: Specify reg-names explicitly Instead of specifying the enum of possible reg-names, specify them explicitly. This allows us to specify which chipsets need the "atu" regions and which do not. Also it clearly describes which platforms enumerate PCIe cores using the dbi region and which use parf region for that. Link: https://lore.kernel.org/r/20220506152107.1527552-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring commit 6700a9b00f0aad206903b6ff216db56faf964654 Author: Dmitry Baryshkov Date: Fri May 6 18:21:01 2022 +0300 dt-bindings: PCI: qcom: Do not require resets on msm8996 platforms On MSM8996/APQ8096 platforms the PCIe controller doesn't have any resets. So move the requirement stanza under the corresponding if condition. Link: https://lore.kernel.org/r/20220506152107.1527552-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring commit 075a9d55932edc8bddf85c6f8c0764928691cde4 Author: Dmitry Baryshkov Date: Fri May 6 18:21:00 2022 +0300 dt-bindings: PCI: qcom: Convert to YAML Changes to the schema: - Fixed the ordering of clock-names/reset-names according to the dtsi files. - Mark vdda-supply as required only for apq/ipq8064 (as it was marked as generally required in the txt file). Changes to examples: - Inline clock and reset numbers rather than including dt-bindings files because of conflicts between the headers - Split ranges and reg properties to follow current practice - Change -gpio to -gpios - Update IRQ flags to LEVEL_HIGH rater than NONE - Removed extra "snps,dw-pcie" compatibility. Note: while it was not clearly described in text schema, the majority of Qualcomm platforms follow the snps,dw-pcie schema and use two compatibility strings in the DT files: platform-specific one and a fallback to the generic snps,dw-pcie one. However the platform itself is not compatible with the snps,dw-pcie interface, so we are going to remove it. Link: https://lore.kernel.org/r/20220506152107.1527552-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring commit 83013631f0f9961416abd812e228c8efbc2f6069 Author: Johan Hovold Date: Fri Apr 1 15:38:54 2022 +0200 PCI: qcom: Fix unbalanced PHY init on probe errors Undo the PHY initialisation (e.g. balance runtime PM) if host initialisation fails during probe. Link: https://lore.kernel.org/r/20220401133854.10421-3-johan+linaro@kernel.org Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # 4.5 commit 87d83b96c8d6c6c2d2096bd0bdba73bcf42b8ef0 Author: Johan Hovold Date: Fri Apr 1 15:38:53 2022 +0200 PCI: qcom: Fix runtime PM imbalance on probe errors Drop the leftover pm_runtime_disable() calls from the late probe error paths that would, for example, prevent runtime PM from being reenabled after a probe deferral. Link: https://lore.kernel.org/r/20220401133854.10421-2-johan+linaro@kernel.org Fixes: 6e5da6f7d824 ("PCI: qcom: Fix error handling in runtime PM support") Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # 4.20 Cc: Bjorn Andersson commit fdf6a2f533115ec5d4d9629178f8196331f1ac50 Author: Johan Hovold Date: Fri Apr 1 15:33:51 2022 +0200 PCI: qcom: Fix pipe clock imbalance Fix a clock imbalance introduced by ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe controller"), which enables the pipe clock both in init() and in post_init() but only disables in post_deinit(). Note that the pipe clock was also never disabled in the init() error paths and that enabling the clock before powering up the PHY looks questionable. Link: https://lore.kernel.org/r/20220401133351.10113-1-johan+linaro@kernel.org Fixes: ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe controller") Signed-off-by: Johan Hovold Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Bjorn Andersson Cc: stable@vger.kernel.org # 5.6 commit a935601eed18d739c11da5504b551c7c4754f2ec Author: Bhupesh Sharma Date: Sat Mar 26 11:38:10 2022 +0530 PCI: qcom: Add SM8150 SoC support The PCIe IP (rev 1.5.0) on SM8150 SoC is similar to the one used on SM8250. Add SM8150 support, reusing the members of ops_1_9_0. Link: https://lore.kernel.org/r/20220326060810.1797516-3-bhupesh.sharma@linaro.org Signed-off-by: Bhupesh Sharma Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Dmitry Baryshkov Reviewed-by: Rob Herring Cc: Vinod Koul commit a6e25b39adc3f68b9bc46f8e100345ee9bf62f8c Author: Bhupesh Sharma Date: Sat Mar 26 11:38:09 2022 +0530 dt-bindings: pci: qcom: Document PCIe bindings for SM8150 SoC Document the PCIe DT bindings for SM8150 SoC. The PCIe IP is similar to the one used on SM8250. Link: https://lore.kernel.org/r/20220326060810.1797516-2-bhupesh.sharma@linaro.org Signed-off-by: Bhupesh Sharma Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Rob Herring Cc: Lorenzo Pieralisi Cc: Bjorn Andersson commit d335371940179318df97d66baef13987ee6e796b Merge: 076f222a690e1 2c51d0d88020b Author: Linus Torvalds Date: Tue May 24 14:31:29 2022 -0700 Merge tag 'mtd/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd updates from Miquel Raynal: "MTD core changes: - Call of_platform_populate() for MTD partitions - Check devicetree alias for index - mtdoops: - Add a timestamp to the mtdoops header. - Create a header structure for the saved mtdoops. - Fix the size of the header read buffer. - mtdblock: Warn if opened on NAND - Bindings: - reserved-memory: Support MTD/block device - jedec,spi-nor: remove unneeded properties - Extend fixed-partitions binding - Add Sercomm (Suzhou) Corporation vendor prefix MTD driver changes: - st_spi_fsm: add missing clk_disable_unprepare() in stfsm_remove() - phram: - Allow cached mappings - Allow probing via reserved-memory - maps: ixp4xx: Drop driver - bcm47xxpart: Print correct offset on read error CFI driver changes: - Rename chip_ready variables - Add S29GL064N ID definition - Use chip_ready() for write on S29GL064N - Move and rename chip_check/chip_ready/chip_good_for_write NAND core changes: - Print offset instead of page number for bad blocks Raw NAND controller drivers: - Cadence: Fix possible null-ptr-deref in cadence_nand_dt_probe() - CS553X: simplify the return expression of cs553x_write_ctrl_byte() - Davinci: Remove redundant unsigned comparison to zero - Denali: Use managed device resources - GPMI: - Add large oob bch setting support - Rename the variable ecc_chunk_size - Uninline the gpmi_check_ecc function - Add strict ecc strength check - Refactor BCH geometry settings function - Intel: Fix possible null-ptr-deref in ebu_nand_probe() - MPC5121: Check before clk_disable_unprepare() not needed - Mtk: - MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK - Also parse the default nand-ecc-engine property if available - Make mtk_ecc.c a separated module - OMAP ELM: - Convert the bindings to yaml - Describe the bindings for AM64 ELM - Add support for its compatible - Renesas: Use runtime PM instead of the raw clock API and update the bindings accordingly - Rockchip: Check before clk_disable_unprepare() not needed - TMIO: Check return value after calling platform_get_resource() Raw NAND chip driver: - Kioxia: Add support for TH58NVG3S0HBAI4 and TC58NVG0S3HTA00 SPI-NAND chip drivers: - Gigadevice: - Add support for: - GD5FxGM7xExxG - GD5F{2,4}GQ5xExxG - GD5F1GQ5RExxG - GD5FxGQ4xExxG - Fix Quad IO for GD5F1GQ5UExxG - XTX: Add support for XT26G0xA SPI NOR core changes: - Read back written SR value to make sure the write was done correctly. - Introduce a common function for Read ID that manufacturer drivers can use to verify the Octal DTR switch worked correctly. - Add helpers for read/write any register commands so manufacturer drivers don't open code it every time. - Clarify rdsr dummy cycles documentation. - Add debugfs entry to expose internal flash parameters and state. SPI NOR manufacturer drivers changes: - Add support for Winbond W25Q512NW-IM, and Eon EN25QH256A. - Move spi_nor_write_ear() to Winbond module since only Winbond flashes use it. - Rework Micron and Cypress Octal DTR enable methods to improve readability. - Use the common Read ID function to verify switch to Octal DTR mode for Micron and Cypress flashes. - Skip polling status on volatile register writes for Micron and Cypress flashes since the operation is instant" * tag 'mtd/for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (68 commits) mtd: st_spi_fsm: add missing clk_disable_unprepare() in stfsm_remove() dt-bindings: mtd: partitions: Extend fixed-partitions binding dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix mtd: phram: Allow cached mappings mtd: call of_platform_populate() for MTD partitions mtd: rawnand: renesas: Use runtime PM instead of the raw clock API dt-bindings: mtd: renesas: Fix the NAND controller description mtd: rawnand: mpc5121: Check before clk_disable_unprepare() not needed mtd: rawnand: rockchip: Check before clk_disable_unprepare() not needed mtd: nand: MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK mtd: rawnand: cs553x: simplify the return expression of cs553x_write_ctrl_byte() mtd: rawnand: kioxia: Add support for TH58NVG3S0HBAI4 mtd: spi-nor: debugfs: fix format specifier mtd: spi-nor: support eon en25qh256a variant mtd: spi-nor: winbond: add support for W25Q512NW-IM mtd: spi-nor: expose internal parameters via debugfs mtd: spi-nor: export spi_nor_hwcaps_pp2cmd() mtd: spi-nor: move spi_nor_write_ear() to winbond module mtd: spi-nor: amend the rdsr dummy cycles documentation mtd: cfi_cmdset_0002: Rename chip_ready variables ... commit 076f222a690e11b433d2b1e218dbd9bdb08fb190 Merge: 0350785b0a092 8877ecb0fc8d7 Author: Linus Torvalds Date: Tue May 24 14:23:10 2022 -0700 Merge tag 'hwmon-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for the Microchip LAN966x SoC - PMBus driver for Infineon Digital Multi-phase xdp152 family controllers Chip support added to existing drivers: - asus-ec-sensors: - Support for ROG STRIX X570-E GAMING WIFI II, PRIME X470-PRO, and ProArt X570 Creator WIFI - External temperature sensor support for ASUS WS X570-ACE - nct6775: - Support for I2C driver - Support for ASUS PRO H410T / PRIME H410M-R / ROG X570-E GAMING WIFI II - lm75: - Support for - Atmel AT30TS74 - pmbus/max16601: - Support for MAX16602 - aquacomputer_d5next: - Support for Aquacomputer Farbwerk - Support for Aquacomputer Octo - jc42: - Support for S-34TS04A Kernel API changes / clarifications: - The chip parameter of with_info API is now mandatory - New hwmon_device_register_for_thermal API call for use by the thermal subsystem Improvements: - PMBus and JC42 drivers now register with thermal subsystem - PMBus drivers now support get_voltage/set_voltage power operations - The adt7475 driver now supports pin configuration - The lm90 driver now supports setting extended range temperatures configuration with a devicetree property - The dell-smm driver now registers as cooling device - The OCC driver delays hwmon registration until requested by userspace ... and various other minor fixes and improvements" * tag 'hwmon-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (71 commits) hwmon: (aquacomputer_d5next) Fix an error handling path in aqc_probe() hwmon: (sl28cpld) Fix typo in comment hwmon: (pmbus) Check PEC support before reading other registers hwmon: (dimmtemp) Fix bitmap handling hwmon: (lm90) enable extended range according to DTS node dt-bindings: hwmon: lm90: add ti,extended-range-enable property dt-bindings: hwmon: lm90: add missing ti,tmp461 hwmon: (ibmaem) Directly use ida_alloc()/free() hwmon: Directly use ida_alloc()/free() hwmon: (asus-ec-sensors) fix Formula VIII definition dt-bindings: trivial-devices: Add xdp152 hwmon: (sl28cpld-hwmon) Use HWMON_CHANNEL_INFO macro hwmon: (pwm-fan) Use HWMON_CHANNEL_INFO macro hwmon: (peci/dimmtemp) Use HWMON_CHANNEL_INFO macro hwmon: (peci/cputemp) Use HWMON_CHANNEL_INFO macro hwmon: (mr75203) Use HWMON_CHANNEL_INFO macro hwmon: (ltc2992) Use HWMON_CHANNEL_INFO macro hwmon: (as370-hwmon) Use HWMON_CHANNEL_INFO macro hwmon: Make chip parameter for with_info API mandatory thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal() ... commit 0350785b0a092c99c5ddd2ace0260dbe7b3f919f Merge: 7cf6a8a17f5b1 048ae41bb0806 Author: Linus Torvalds Date: Tue May 24 13:50:39 2022 -0700 Merge tag 'integrity-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull IMA updates from Mimi Zohar: "New is IMA support for including fs-verity file digests and signatures in the IMA measurement list as well as verifying the fs-verity file digest based signatures, both based on policy. In addition, are two bug fixes: - avoid reading UEFI variables, which cause a page fault, on Apple Macs with T2 chips. - remove the original "ima" template Kconfig option to address a boot command line ordering issue. The rest is a mixture of code/documentation cleanup" * tag 'integrity-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: integrity: Fix sparse warnings in keyring_handler evm: Clean up some variables evm: Return INTEGRITY_PASS for enum integrity_status value '0' efi: Do not import certificates from UEFI Secure Boot for T2 Macs fsverity: update the documentation ima: support fs-verity file digest based version 3 signatures ima: permit fsverity's file digests in the IMA measurement list ima: define a new template field named 'd-ngv2' and templates fs-verity: define a function to return the integrity protected file digest ima: use IMA default hash algorithm for integrity violations ima: fix 'd-ng' comments and documentation ima: remove the IMA_TEMPLATE Kconfig option ima: remove redundant initialization of pointer 'file'. commit 7cf6a8a17f5b134b7e783c2d45c53298faef82a7 Merge: a9d1046a84657 7f3113e3b9f72 Author: Linus Torvalds Date: Tue May 24 13:16:50 2022 -0700 Merge tag 'tpmdd-next-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm updates from Jarkko Sakkinen: - Tightened validation of key hashes for SYSTEM_BLACKLIST_HASH_LIST. An invalid hash format causes a compilation error. Previously, they got included to the kernel binary but were silently ignored at run-time. - Allow root user to append new hashes to the blacklist keyring. - Trusted keys backed with Cryptographic Acceleration and Assurance Module (CAAM), which part of some of the new NXP's SoC's. Now there is total three hardware backends for trusted keys: TPM, ARM TEE and CAAM. - A scattered set of fixes and small improvements for the TPM driver. * tag 'tpmdd-next-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: MAINTAINERS: add KEYS-TRUSTED-CAAM doc: trusted-encrypted: describe new CAAM trust source KEYS: trusted: Introduce support for NXP CAAM-based trusted keys crypto: caam - add in-kernel interface for blob generator crypto: caam - determine whether CAAM supports blob encap/decap KEYS: trusted: allow use of kernel RNG for key material KEYS: trusted: allow use of TEE as backend without TCG_TPM support tpm: Add field upgrade mode support for Infineon TPM2 modules tpm: Fix buffer access in tpm2_get_tpm_pt() char: tpm: cr50_i2c: Suppress duplicated error message in .remove() tpm: cr50: Add new device/vendor ID 0x504a6666 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe() tpm/tpm_ftpm_tee: Return true/false (not 1/0) from bool functions certs: Explain the rationale to call panic() certs: Allow root user to append signed hashes to the blacklist keyring certs: Check that builtin blacklist hashes are valid certs: Make blacklist_vet_description() more strict certs: Factor out the blacklist hash creation tools/certs: Add print-cert-tbs-hash.sh commit a9d1046a846571422a92d2b8fbf8a8b24221b9a3 Merge: cb44e4f061e16 eaff451d4b7c8 Author: Linus Torvalds Date: Tue May 24 13:13:50 2022 -0700 Merge tag 'Smack-for-5.19' of https://github.com/cschaufler/smack-next Pull smack update from Casey Schaufler: "A single change to remove a pointless assignment" * tag 'Smack-for-5.19' of https://github.com/cschaufler/smack-next: smack: Remove redundant assignments commit cb44e4f061e16be65b8a16505e121490c66d30d0 Merge: efd1df1982e92 5e469829baa1b Author: Linus Torvalds Date: Tue May 24 13:09:13 2022 -0700 Merge tag 'landlock-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull Landlock updates from Mickaël Salaün: - improve the path_rename LSM hook implementations for RENAME_EXCHANGE; - fix a too-restrictive filesystem control for a rare corner case; - set the nested sandbox limitation to 16 layers; - add a new LANDLOCK_ACCESS_FS_REFER access right to properly handle file reparenting (i.e. full rename and link support); - add new tests and documentation; - format code with clang-format to make it easier to maintain and contribute. * tag 'landlock-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: (30 commits) landlock: Explain how to support Landlock landlock: Add design choices documentation for filesystem access rights landlock: Document good practices about filesystem policies landlock: Document LANDLOCK_ACCESS_FS_REFER and ABI versioning samples/landlock: Add support for file reparenting selftests/landlock: Add 11 new test suites dedicated to file reparenting landlock: Add support for file reparenting with LANDLOCK_ACCESS_FS_REFER LSM: Remove double path_rename hook calls for RENAME_EXCHANGE landlock: Move filesystem helpers and add a new one landlock: Fix same-layer rule unions landlock: Create find_rule() from unmask_layers() landlock: Reduce the maximum number of layers to 16 landlock: Define access_mask_t to enforce a consistent access mask size selftests/landlock: Test landlock_create_ruleset(2) argument check ordering landlock: Change landlock_restrict_self(2) check ordering landlock: Change landlock_add_rule(2) argument check ordering selftests/landlock: Add tests for O_PATH selftests/landlock: Fully test file rename with "remove" access selftests/landlock: Extend access right tests to directories selftests/landlock: Add tests for unknown access rights ... commit e98a860f65428a3cae7ed7b3e8ebcf6320d7fc5e Author: Bjorn Andersson Date: Mon May 23 16:37:19 2022 -0700 leds: qcom-lpg: Require pattern to follow documentation The leds-trigger-pattern documentation describes how the brightness of the LED should transition linearly from one brightness value to the next, over the given delta_t. But the pattern engine in the Qualcomm LPG hardware only supports holding the brightness for each entry for the period. This subset of patterns can be represented in the leds-trigger-pattern by injecting zero-time transitions after each entry in the pattern, resulting in a pattern that pattern that can be rendered by the LPG. Rework LPG pattern interface to require these zero-time transitions, to make it comply with this subset of patterns and reject the patterns it can't render. Fixes: 24e2d05d1b68 ("leds: Add driver for Qualcomm LPG") Signed-off-by: Bjorn Andersson Signed-off-by: Pavel Machek commit efd1df1982e9203b4f56cb0d5946a24885260ce5 Merge: a6b450573b912 1af0e4a0233fe Author: Linus Torvalds Date: Tue May 24 13:06:32 2022 -0700 Merge tag 'selinux-pr-20220523' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: "We've got twelve patches queued for v5.19, with most being fairly minor. The highlights are below: - The checkreqprot and runtime disable knobs have been deprecated for some time with no active users that we can find. In an effort to move things along we are adding a pause when the knobs are used to help make the deprecation more noticeable in case anyone is still using these hacks in the shadows. - We've added the anonymous inode class name to the AVC audit records when anonymous inodes are involved. This should make writing policy easier when anonymous inodes are involved. - More constification work. This is fairly straightforward and the source of most of the diffstat. - The usual minor cleanups: remove unnecessary assignments, assorted style/checkpatch fixes, kdoc fixes, macro while-loop encapsulations, #include tweaks, etc" * tag 'selinux-pr-20220523' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: security: declare member holding string literal const selinux: log anon inode class name selinux: declare data arrays const selinux: fix indentation level of mls_ops block selinux: include necessary headers in headers selinux: avoid extra semicolon selinux: update parameter documentation selinux: resolve checkpatch errors selinux: don't sleep when CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE is true selinux: checkreqprot is deprecated, add some ssleep() discomfort selinux: runtime disable is deprecated, add some ssleep() discomfort selinux: Remove redundant assignments commit a6b450573b912316ad36262bfc70e7c3870c56d1 Merge: dc8af1ffd657c 70578ff3367dd Author: Linus Torvalds Date: Tue May 24 12:49:48 2022 -0700 Merge tag 'execve-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: - Fix binfmt_flat GOT handling for riscv (Niklas Cassel) - Remove unused/broken binfmt_flat shared library and coredump code (Eric W. Biederman) * tag 'execve-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_flat: Remove shared library support binfmt_flat: Drop vestiges of coredump support binfmt_flat: do not stop relocating GOT entries prematurely on riscv commit dc8af1ffd657c90733088e0093c7990305b2b4e9 Merge: 0bf13a84362e7 5e91d2a414694 Author: Linus Torvalds Date: Tue May 24 12:37:24 2022 -0700 Merge tag 'seccomp-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull seccomp updates from Kees Cook: - Rework USER_NOTIF notification ordering and kill logic (Sargun Dhillon) - Improved PTRACE_O_SUSPEND_SECCOMP selftest (Jann Horn) - Gracefully handle failed unshare() in selftests (Yang Guang) - Spelling fix (Colin Ian King) * tag 'seccomp-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: selftests/seccomp: Fix spelling mistake "Coud" -> "Could" selftests/seccomp: Add test for wait killable notifier selftests/seccomp: Refactor get_proc_stat to split out file reading code seccomp: Add wait_killable semantic to seccomp user notifier selftests/seccomp: Ensure that notifications come in FIFO order seccomp: Use FIFO semantics to order notifications selftests/seccomp: Add SKIP for failed unshare() selftests/seccomp: Test PTRACE_O_SUSPEND_SECCOMP without CAP_SYS_ADMIN commit 5f41fdaea63ddf96d921ab36b2af4a90ccdb5744 Author: Eric Biggers Date: Thu May 19 13:44:37 2022 -0700 ext4: only allow test_dummy_encryption when supported Make the test_dummy_encryption mount option require that the encrypt feature flag be already enabled on the filesystem, rather than automatically enabling it. Practically, this means that "-O encrypt" will need to be included in MKFS_OPTIONS when running xfstests with the test_dummy_encryption mount option. (ext4/053 also needs an update.) Moreover, as long as the preconditions for test_dummy_encryption are being tightened anyway, take the opportunity to start rejecting it when !CONFIG_FS_ENCRYPTION rather than ignoring it. The motivation for requiring the encrypt feature flag is that: - Having the filesystem auto-enable feature flags is problematic, as it bypasses the usual sanity checks. The specific issue which came up recently is that in kernel versions where ext4 supports casefold but not encrypt+casefold (v5.1 through v5.10), the kernel will happily add the encrypt flag to a filesystem that has the casefold flag, making it unmountable -- but only for subsequent mounts, not the initial one. This confused the casefold support detection in xfstests, causing generic/556 to fail rather than be skipped. - The xfstests-bld test runners (kvm-xfstests et al.) already use the required mkfs flag, so they will not be affected by this change. Only users of test_dummy_encryption alone will be affected. But, this option has always been for testing only, so it should be fine to require that the few users of this option update their test scripts. - f2fs already requires it (for its equivalent feature flag). Signed-off-by: Eric Biggers Reviewed-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20220519204437.61645-1-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit d36f6ed761b53933b0b4126486c10d3da7751e7f Author: Baokun Li Date: Wed May 18 20:08:16 2022 +0800 ext4: fix bug_on in __es_tree_search Hulk Robot reported a BUG_ON: ================================================================== kernel BUG at fs/ext4/extents_status.c:199! [...] RIP: 0010:ext4_es_end fs/ext4/extents_status.c:199 [inline] RIP: 0010:__es_tree_search+0x1e0/0x260 fs/ext4/extents_status.c:217 [...] Call Trace: ext4_es_cache_extent+0x109/0x340 fs/ext4/extents_status.c:766 ext4_cache_extents+0x239/0x2e0 fs/ext4/extents.c:561 ext4_find_extent+0x6b7/0xa20 fs/ext4/extents.c:964 ext4_ext_map_blocks+0x16b/0x4b70 fs/ext4/extents.c:4384 ext4_map_blocks+0xe26/0x19f0 fs/ext4/inode.c:567 ext4_getblk+0x320/0x4c0 fs/ext4/inode.c:980 ext4_bread+0x2d/0x170 fs/ext4/inode.c:1031 ext4_quota_read+0x248/0x320 fs/ext4/super.c:6257 v2_read_header+0x78/0x110 fs/quota/quota_v2.c:63 v2_check_quota_file+0x76/0x230 fs/quota/quota_v2.c:82 vfs_load_quota_inode+0x5d1/0x1530 fs/quota/dquot.c:2368 dquot_enable+0x28a/0x330 fs/quota/dquot.c:2490 ext4_quota_enable fs/ext4/super.c:6137 [inline] ext4_enable_quotas+0x5d7/0x960 fs/ext4/super.c:6163 ext4_fill_super+0xa7c9/0xdc00 fs/ext4/super.c:4754 mount_bdev+0x2e9/0x3b0 fs/super.c:1158 mount_fs+0x4b/0x1e4 fs/super.c:1261 [...] ================================================================== Above issue may happen as follows: ------------------------------------- ext4_fill_super ext4_enable_quotas ext4_quota_enable ext4_iget __ext4_iget ext4_ext_check_inode ext4_ext_check __ext4_ext_check ext4_valid_extent_entries Check for overlapping extents does't take effect dquot_enable vfs_load_quota_inode v2_check_quota_file v2_read_header ext4_quota_read ext4_bread ext4_getblk ext4_map_blocks ext4_ext_map_blocks ext4_find_extent ext4_cache_extents ext4_es_cache_extent ext4_es_cache_extent __es_tree_search ext4_es_end BUG_ON(es->es_lblk + es->es_len < es->es_lblk) The error ext4 extents is as follows: 0af3 0300 0400 0000 00000000 extent_header 00000000 0100 0000 12000000 extent1 00000000 0100 0000 18000000 extent2 02000000 0400 0000 14000000 extent3 In the ext4_valid_extent_entries function, if prev is 0, no error is returned even if lblock<=prev. This was intended to skip the check on the first extent, but in the error image above, prev=0+1-1=0 when checking the second extent, so even though lblock<=prev, the function does not return an error. As a result, bug_ON occurs in __es_tree_search and the system panics. To solve this problem, we only need to check that: 1. The lblock of the first extent is not less than 0. 2. The lblock of the next extent is not less than the next block of the previous extent. The same applies to extent_idx. Cc: stable@kernel.org Fixes: 5946d089379a ("ext4: check for overlapping extents in ext4_valid_extent_entries()") Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220518120816.1541863-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 3ba733f879c2a88910744647e41edeefbc0d92b2 Author: Jan Kara Date: Wed May 18 11:33:29 2022 +0200 ext4: avoid cycles in directory h-tree A maliciously corrupted filesystem can contain cycles in the h-tree stored inside a directory. That can easily lead to the kernel corrupting tree nodes that were already verified under its hands while doing a node split and consequently accessing unallocated memory. Fix the problem by verifying traversed block numbers are unique. Cc: stable@vger.kernel.org Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220518093332.13986-2-jack@suse.cz Signed-off-by: Theodore Ts'o commit 46c116b920ebec58031f0a78c5ea9599b0d2a371 Author: Jan Kara Date: Wed May 18 11:33:28 2022 +0200 ext4: verify dir block before splitting it Before splitting a directory block verify its directory entries are sane so that the splitting code does not access memory it should not. Cc: stable@vger.kernel.org Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220518093332.13986-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit c878bea3c9d724ddfa05a813f30de3d25a0ba83f Author: Theodore Ts'o Date: Tue May 17 13:27:55 2022 -0400 ext4: filter out EXT4_FC_REPLAY from on-disk superblock field s_state The EXT4_FC_REPLAY bit in sbi->s_mount_state is used to indicate that we are in the middle of replay the fast commit journal. This was actually a mistake, since the sbi->s_mount_info is initialized from es->s_state. Arguably s_mount_state is misleadingly named, but the name is historical --- s_mount_state and s_state dates back to ext2. What should have been used is the ext4_{set,clear,test}_mount_flag() inline functions, which sets EXT4_MF_* bits in sbi->s_mount_flags. The problem with using EXT4_FC_REPLAY is that a maliciously corrupted superblock could result in EXT4_FC_REPLAY getting set in s_mount_state. This bypasses some sanity checks, and this can trigger a BUG() in ext4_es_cache_extent(). As a easy-to-backport-fix, filter out the EXT4_FC_REPLAY bit for now. We should eventually transition away from EXT4_FC_REPLAY to something like EXT4_MF_REPLAY. Cc: stable@kernel.org Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/20220420192312.1655305-1-phind.uet@gmail.com Link: https://lore.kernel.org/r/20220517174028.942119-1-tytso@mit.edu Reported-by: syzbot+c7358a3cd05ee786eb31@syzkaller.appspotmail.com commit d87c48ce4d8951f46d21f17ea86bba8853049862 Author: Ronnie Sahlberg Date: Tue May 10 09:42:07 2022 +1000 cifs: cache the dirents for entries in a cached directory This adds caching of the directory entries for a cached directory while we keep a lease on the directory. Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit c360abbb9db298d0548b31e1a86a48ebb157d7cd Author: Bob Peterson Date: Fri Feb 11 10:50:36 2022 -0500 gfs2: Convert function bh_get to use iomap Before this patch, function bh_get used block_map to figure out the block it needed to read in from the quota_change file. This patch changes it to use iomap directly to make it more efficient. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 5fcff61eea9efd1f4b60e89d2d686b5feaea100f Author: Bob Peterson Date: Fri Feb 11 10:50:08 2022 -0500 gfs2: use i_lock spin_lock for inode qadata Before this patch, functions gfs2_qa_get and _put used the i_rw_mutex to prevent simultaneous access to its i_qadata. But i_rw_mutex is now used for many other things, including iomap_begin and end, which causes a conflict according to lockdep. We cannot just remove the lock since simultaneous opens (gfs2_open -> gfs2_open_common -> gfs2_qa_get) can then stomp on each others values for i_qadata. This patch solves the conflict by using the i_lock spin_lock in the inode to prevent simultaneous access. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit f4a47561fcc1494ee3f273163189cf4462b6a245 Author: Andrew Price Date: Tue Mar 22 18:49:19 2022 +0000 gfs2: Return more useful errors from gfs2_rgrp_send_discards() The bug that 27ca8273f ("gfs2: Make sure FITRIM minlen is rounded up to fs block size") fixes was a little confusing as the user saw "Input/output error" which masked the -EINVAL that sb_issue_discard() returned. sb_issue_discard() can fail for various reasons, so we should return its return value from gfs2_rgrp_send_discards() to avoid all errors being reported as IO errors. This improves error reporting for FITRIM and makes no difference to the -o discard code path because the return value from gfs2_rgrp_send_discards() gets thrown away in that case (and the option switches off). Presumably that's why it was ok to just return -EIO in the past, before FITRIM was implemented. Tested with xfstests. Signed-off-by: Andrew Price Signed-off-by: Andreas Gruenbacher commit 11d8b79e849db099b04584913880a799549aaad5 Author: Kees Cook Date: Sun May 8 03:06:30 2022 -0700 gfs2: Use container_of() for gfs2_glock(aspace) Clang's structure layout randomization feature gets upset when it sees struct address_space (which is randomized) cast to struct gfs2_glock. This is due to seeing the mapping pointer as being treated as an array of gfs2_glock, rather than "something else, before struct address_space": In file included from fs/gfs2/acl.c:23: fs/gfs2/meta_io.h:44:12: error: casting from randomized structure pointer type 'struct address_space *' to 'struct gfs2_glock *' return (((struct gfs2_glock *)mapping) - 1)->gl_name.ln_sbd; ^ Replace the instances of open-coded pointer math with container_of() usage, and update the allocator to match. Some cleanups and conversion of gfs2_glock_get() and gfs2_glock_dealloc() by Andreas. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202205041550.naKxwCBj-lkp@intel.com Cc: Bob Peterson Cc: Andreas Gruenbacher Cc: Bill Wendling Cc: cluster-devel@redhat.com Signed-off-by: Kees Cook Signed-off-by: Andreas Gruenbacher commit 53bb540fd591f6fdd4cb5c9a785d9790ac33862d Author: Andreas Gruenbacher Date: Tue Apr 26 23:31:06 2022 +0200 gfs2: Explain some direct I/O oddities Add some comments explaining the oddities of partial direct I/O reads and writes. Signed-off-by: Andreas Gruenbacher commit 0bf13a84362e750a90008af259b098d7c0e0755b Merge: 51518aa68c1ff ed5edd5a70b95 Author: Linus Torvalds Date: Tue May 24 12:27:09 2022 -0700 Merge tag 'kernel-hardening-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kernel hardening updates from Kees Cook: - usercopy hardening expanded to check other allocation types (Matthew Wilcox, Yuanzheng Song) - arm64 stackleak behavioral improvements (Mark Rutland) - arm64 CFI code gen improvement (Sami Tolvanen) - LoadPin LSM block dev API adjustment (Christoph Hellwig) - Clang randstruct support (Bill Wendling, Kees Cook) * tag 'kernel-hardening-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (34 commits) loadpin: stop using bdevname mm: usercopy: move the virt_addr_valid() below the is_vmalloc_addr() gcc-plugins: randstruct: Remove cast exception handling af_unix: Silence randstruct GCC plugin warning niu: Silence randstruct warnings big_keys: Use struct for internal payload gcc-plugins: Change all version strings match kernel randomize_kstack: Improve docs on requirements/rationale lkdtm/stackleak: fix CONFIG_GCC_PLUGIN_STACKLEAK=n arm64: entry: use stackleak_erase_on_task_stack() stackleak: add on/off stack variants lkdtm/stackleak: check stack boundaries lkdtm/stackleak: prevent unexpected stack usage lkdtm/stackleak: rework boundary management lkdtm/stackleak: avoid spurious failure stackleak: rework poison scanning stackleak: rework stack high bound handling stackleak: clarify variable names stackleak: rework stack low bound handling stackleak: remove redundant check ... commit 51518aa68c1ffb54f2fdfed5324af30325529b32 Merge: c1f4cfdbef409 e6af1bb07704b Author: Linus Torvalds Date: Tue May 24 12:22:56 2022 -0700 Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fsverity updates from Eric Biggers: "A couple small cleanups for fs/verity/" * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fs-verity: Use struct_size() helper in enable_verity() fs-verity: remove unused parameter desc_size in fsverity_create_info() commit c1f4cfdbef409971fd9d6b1faae4d7cc72af3e20 Merge: ac2ab99072cce 218d921b581ea Author: Linus Torvalds Date: Tue May 24 12:17:45 2022 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt updates from Eric Biggers: "Some cleanups for fs/crypto/: - Split up the misleadingly-named FS_CRYPTO_BLOCK_SIZE constant. - Consistently report the encryption implementation that is being used. - Add helper functions for the test_dummy_encryption mount option that work properly with the new mount API. ext4 and f2fs will use these" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: add new helper functions for test_dummy_encryption fscrypt: factor out fscrypt_policy_to_key_spec() fscrypt: log when starting to use inline encryption fscrypt: split up FS_CRYPTO_BLOCK_SIZE commit 5752bf645f9dd7db600651f726eb04a97c9f597f Author: Shyam Prasad N Date: Fri Apr 8 13:31:37 2022 +0000 cifs: avoid parallel session setups on same channel After allowing channels to reconnect in parallel, it now becomes important to take care that multiple processes do not call negotiate/session setup in parallel on the same channel. This change avoids that by marking a channel as "in_reconnect". During session setup if the channel in question has this flag set, we return immediately. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit dd3cd8709ed5f4ae8998e0cd44c05bd26bc879e8 Author: Shyam Prasad N Date: Thu Apr 7 13:15:49 2022 +0000 cifs: use new enum for ses_status ses->status today shares statusEnum with server->tcpStatus. This has been confusing, and tcon->status has deviated to use a new enum. Follow suit and use new enum for ses_status as well. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 1a6a41d4cedd9b302e2200e6f0e3c44dbbe13689 Author: Shyam Prasad N Date: Wed Mar 30 09:22:20 2022 +0000 cifs: do not use tcpStatus after negotiate completes Recent changes to multichannel to allow channel reconnects to work in parallel and independent of each other did so by making use of tcpStatus for the connection, and status for the session. However, this did not take into account the multiuser scenario, where same connection is used by multiple connections. However, tcpStatus should be tracked only till the end of negotiate exchange, and not used for session setup. This change fixes this. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit ac2ab99072cce553c78f326ea22d72856f570d88 Merge: eadb2f47a3ced 1ce6c8d68f8ac Author: Linus Torvalds Date: Tue May 24 11:58:10 2022 -0700 Merge tag 'random-5.19-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator updates from Jason Donenfeld: "These updates continue to refine the work began in 5.17 and 5.18 of modernizing the RNG's crypto and streamlining and documenting its code. New for 5.19, the updates aim to improve entropy collection methods and make some initial decisions regarding the "premature next" problem and our threat model. The cloc utility now reports that random.c is 931 lines of code and 466 lines of comments, not that basic metrics like that mean all that much, but at the very least it tells you that this is very much a manageable driver now. Here's a summary of the various updates: - The random_get_entropy() function now always returns something at least minimally useful. This is the primary entropy source in most collectors, which in the best case expands to something like RDTSC, but prior to this change, in the worst case it would just return 0, contributing nothing. For 5.19, additional architectures are wired up, and architectures that are entirely missing a cycle counter now have a generic fallback path, which uses the highest resolution clock available from the timekeeping subsystem. Some of those clocks can actually be quite good, despite the CPU not having a cycle counter of its own, and going off-core for a stamp is generally thought to increase jitter, something positive from the perspective of entropy gathering. Done very early on in the development cycle, this has been sitting in next getting some testing for a while now and has relevant acks from the archs, so it should be pretty well tested and fine, but is nonetheless the thing I'll be keeping my eye on most closely. - Of particular note with the random_get_entropy() improvements is MIPS, which, on CPUs that lack the c0 count register, will now combine the high-speed but short-cycle c0 random register with the lower-speed but long-cycle generic fallback path. - With random_get_entropy() now always returning something useful, the interrupt handler now collects entropy in a consistent construction. - Rather than comparing two samples of random_get_entropy() for the jitter dance, the algorithm now tests many samples, and uses the amount of differing ones to determine whether or not jitter entropy is usable and how laborious it must be. The problem with comparing only two samples was that if the cycle counter was extremely slow, but just so happened to be on the cusp of a change, the slowness wouldn't be detected. Taking many samples fixes that to some degree. This, combined with the other improvements to random_get_entropy(), should make future unification of /dev/random and /dev/urandom maybe more possible. At the very least, were we to attempt it again today (we're not), it wouldn't break any of Guenter's test rigs that broke when we tried it with 5.18. So, not today, but perhaps down the road, that's something we can revisit. - We attempt to reseed the RNG immediately upon waking up from system suspend or hibernation, making use of the various timestamps about suspend time and such available, as well as the usual inputs such as RDRAND when available. - Batched randomness now falls back to ordinary randomness before the RNG is initialized. This provides more consistent guarantees to the types of random numbers being returned by the various accessors. - The "pre-init injection" code is now gone for good. I suspect you in particular will be happy to read that, as I recall you expressing your distaste for it a few months ago. Instead, to avoid a "premature first" issue, while still allowing for maximal amount of entropy availability during system boot, the first 128 bits of estimated entropy are used immediately as it arrives, with the next 128 bits being buffered. And, as before, after the RNG has been fully initialized, it winds up reseeding anyway a few seconds later in most cases. This resulted in a pretty big simplification of the initialization code and let us remove various ad-hoc mechanisms like the ugly crng_pre_init_inject(). - The RNG no longer pretends to handle the "premature next" security model, something that various academics and other RNG designs have tried to care about in the past. After an interesting mailing list thread, these issues are thought to be a) mainly academic and not practical at all, and b) actively harming the real security of the RNG by delaying new entropy additions after a potential compromise, making a potentially bad situation even worse. As well, in the first place, our RNG never even properly handled the premature next issue, so removing an incomplete solution to a fake problem was particularly nice. This allowed for numerous other simplifications in the code, which is a lot cleaner as a consequence. If you didn't see it before, https://lore.kernel.org/lkml/YmlMGx6+uigkGiZ0@zx2c4.com/ may be a thread worth skimming through. - While the interrupt handler received a separate code path years ago that avoids locks by using per-cpu data structures and a faster mixing algorithm, in order to reduce interrupt latency, input and disk events that are triggered in hardirq handlers were still hitting locks and more expensive algorithms. Those are now redirected to use the faster per-cpu data structures. - Rather than having the fake-crypto almost-siphash-based random32 implementation be used right and left, and in many places where cryptographically secure randomness is desirable, the batched entropy code is now fast enough to replace that. - As usual, numerous code quality and documentation cleanups. For example, the initialization state machine now uses enum symbolic constants instead of just hard coding numbers everywhere. - Since the RNG initializes once, and then is always initialized thereafter, a pretty heavy amount of code used during that initialization is never used again. It is now completely cordoned off using static branches and it winds up in the .text.unlikely section so that it doesn't reduce cache compactness after the RNG is ready. - A variety of functions meant for waiting on the RNG to be initialized were only used by vsprintf, and in not a particularly optimal way. Replacing that usage with a more ordinary setup made it possible to remove those functions. - A cleanup of how we warn userspace about the use of uninitialized /dev/urandom and uninitialized get_random_bytes() usage. Interestingly, with the change you merged for 5.18 that attempts to use jitter (but does not block if it can't), the majority of users should never see those warnings for /dev/urandom at all now, and the one for in-kernel usage is mainly a debug thing. - The file_operations struct for /dev/[u]random now implements .read_iter and .write_iter instead of .read and .write, allowing it to also implement .splice_read and .splice_write, which makes splice(2) work again after it was broken here (and in many other places in the tree) during the set_fs() removal. This was a bit of a last minute arrival from Jens that hasn't had as much time to bake, so I'll be keeping my eye on this as well, but it seems fairly ordinary. Unfortunately, read_iter() is around 3% slower than read() in my tests, which I'm not thrilled about. But Jens and Al, spurred by this observation, seem to be making progress in removing the bottlenecks on the iter paths in the VFS layer in general, which should remove the performance gap for all drivers. - Assorted other bug fixes, cleanups, and optimizations. - A small SipHash cleanup" * tag 'random-5.19-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: (49 commits) random: check for signals after page of pool writes random: wire up fops->splice_{read,write}_iter() random: convert to using fops->write_iter() random: convert to using fops->read_iter() random: unify batched entropy implementations random: move randomize_page() into mm where it belongs random: remove mostly unused async readiness notifier random: remove get_random_bytes_arch() and add rng_has_arch_random() random: move initialization functions out of hot pages random: make consistent use of buf and len random: use proper return types on get_random_{int,long}_wait() random: remove extern from functions in header random: use static branch for crng_ready() random: credit architectural init the exact amount random: handle latent entropy and command line from random_init() random: use proper jiffies comparison macro random: remove ratelimiting for in-kernel unseeded randomness random: move initialization out of reseeding hot path random: avoid initializing twice in credit race random: use symbolic constants for crng_init states ... commit 57d7becda9c9e612e6b00676f2eecfac3e719e88 Merge: 9029ac03f20a5 3c3673bde50c3 Author: Jakub Kicinski Date: Tue May 24 11:40:00 2022 -0700 Merge branch 'ptp-ocp-various-updates' Jonathan Lemon says: ==================== ptp: ocp: various updates Collection of cleanups and updates to the timecard. ==================== Link: https://lore.kernel.org/r/20220519212153.450437-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski commit 3c3673bde50c31d1f5ab0b39e9eeb555285786bb Author: Vadim Fedorenko Date: Thu May 19 14:21:53 2022 -0700 ptp: ocp: Add firmware header checks Right now it's possible to flash any kind of binary via devlink and break the card easily. This diff adds an optional header check when installing the firmware. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit b88fdbba931e9c79772120cb60a6ea8adaf0b451 Author: Jonathan Lemon Date: Thu May 19 14:21:52 2022 -0700 ptp: ocp: fix PPS source selector debugfs reporting The NTL timecard design has a PPS1 selector which selects the the PPS source automatically, according to Section 1.9 of the documentation. If there is a SMA PPS input detected: - send signal to MAC and PPS slave selector. If there is a MAC PPS input detected: - send GNSS1 to the MAC - send MAC to the PPS slave If there is a GNSS1 input detected: - send GNSS1 to the MAC - send GNSS1 to the PPS slave.MAC Change the debugfs summary so it reflects the correct mapping, for assistance in debugging. No functional change. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit ee4cd7250c8f5fd47b77b2235057f4b52c1576a6 Author: Jonathan Lemon Date: Thu May 19 14:21:51 2022 -0700 ptp: ocp: add .init function for sma_op vector Create an .init function for the op vector, and a corresponding wrapper function, for different sma mapping setups. Add a default_fcn to the sma information, and use it when displaying information for pins which have fixed functions. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit caab82cdbfe449c1597ab455c09d0fa514ef6947 Author: Jonathan Lemon Date: Thu May 19 14:21:50 2022 -0700 ptp: ocp: vectorize the sma accessor functions Move the SMA get and set functions into an operations vector for different boards. Create wrappers for the accessor functions. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 3f3fe41c0bdfe541aa7aa9a8625efe3bd3ef60cc Author: Jonathan Lemon Date: Thu May 19 14:21:49 2022 -0700 ptp: ocp: constify selectors The ocp selectors are all constant, so label them as such. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit aa56a7ffc0fb9ad5f754af79ee91ebe9ec96f28d Author: Jonathan Lemon Date: Thu May 19 14:21:48 2022 -0700 ptp: ocp: parameterize input/output sma selectors Group the sma input/output tables together and select the correct group from the bp information. This allows adding new groups with different sma mappings. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 5a728ac578c07f29d8b36bbd907cdea132c1607d Author: Jonathan Lemon Date: Thu May 19 14:21:47 2022 -0700 ptp: ocp: revise firmware display Preparse the firmware image information into loader/tag/version, and set the fw capabilities based on the tag/version. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 81fa652e168558fa35bd81d6c2427319b7b8589f Author: Vadim Fedorenko Date: Thu May 19 14:21:46 2022 -0700 ptp: ocp: add Celestica timecard PCI ids Celestica is producing card with their own vendor id and device id. Add these ids to driver to support this card. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 3a35e53a11bcde88ea89cbf839771e6af4681daf Author: Jonathan Lemon Date: Thu May 19 14:21:45 2022 -0700 ptp: ocp: Remove #ifdefs around PCI IDs These #ifdefs are not required, so remove them. Suggested-by: Jakub Kicinski Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 8119c9ee7854033c8aba11059bec4ddd146fd63e Author: Jonathan Lemon Date: Thu May 19 14:21:44 2022 -0700 ptp: ocp: 32-bit fixups for pci start address Use 'resource_size_t' instead of 'unsigned long' when computing the pci start address, for the benefit of 32-bit platforms. Signed-off-by: Jonathan Lemon Signed-off-by: Jakub Kicinski commit 9029ac03f20a5999bc5627277c6cf008ab8e23ed Author: liuyacan Date: Tue May 24 17:02:30 2022 +0800 Revert "net/smc: fix listen processing for SMC-Rv2" This reverts commit 8c3b8dc5cc9bf6d273ebe18b16e2d6882bcfb36d. Some rollback issue will be fixed in other patches in the future. Link: https://lore.kernel.org/all/20220523055056.2078994-1-liuyacan@corp.netease.com/ Fixes: 8c3b8dc5cc9b ("net/smc: fix listen processing for SMC-Rv2") Signed-off-by: liuyacan Link: https://lore.kernel.org/r/20220524090230.2140302-1-liuyacan@corp.netease.com Signed-off-by: Jakub Kicinski commit eadb2f47a3ced5c64b23b90fd2a3463f63726066 Author: Daniel Thompson Date: Mon May 23 19:11:02 2022 +0100 lockdown: also lock down previous kgdb use KGDB and KDB allow read and write access to kernel memory, and thus should be restricted during lockdown. An attacker with access to a serial port (for example, via a hypervisor console, which some cloud vendors provide over the network) could trigger the debugger so it is important that the debugger respect the lockdown mode when/if it is triggered. Fix this by integrating lockdown into kdb's existing permissions mechanism. Unfortunately kgdb does not have any permissions mechanism (although it certainly could be added later) so, for now, kgdb is simply and brutally disabled by immediately exiting the gdb stub without taking any action. For lockdowns established early in the boot (e.g. the normal case) then this should be fine but on systems where kgdb has set breakpoints before the lockdown is enacted than "bad things" will happen. CVE: CVE-2022-21499 Co-developed-by: Stephen Brennan Signed-off-by: Stephen Brennan Reviewed-by: Douglas Anderson Signed-off-by: Daniel Thompson Signed-off-by: Linus Torvalds commit 48a75b979940f8aa838143e976455aa0e629e638 Author: Nathan Chancellor Date: Tue May 24 07:56:55 2022 -0700 ath6kl: Use cc-disable-warning to disable -Wdangling-pointer Clang does not support this option so the build fails: error: unknown warning option '-Wno-dangling-pointer' [-Werror,-Wunknown-warning-option] Use cc-disable-warning so that the option is only added when it is supported. Fixes: bd1d129daa3e ("wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12") Reported-by: "kernelci.org bot" Signed-off-by: Nathan Chancellor Reviewed-by: Tom Rix Link: https://lore.kernel.org/r/20220524145655.869822-1-nathan@kernel.org Signed-off-by: Jakub Kicinski commit 6f3f04c19074972ea12edeed23b07a32894e9e03 Merge: cfeb2522c3777 991d8d8142cad Author: Linus Torvalds Date: Tue May 24 11:11:13 2022 -0700 Merge tag 'sched-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: - Updates to scheduler metrics: - PELT fixes & enhancements - PSI fixes & enhancements - Refactor cpu_util_without() - Updates to instrumentation/debugging: - Remove sched_trace_*() helper functions - can be done via debug info - Fix double update_rq_clock() warnings - Introduce & use "preemption model accessors" to simplify some of the Kconfig complexity. - Make softirq handling RT-safe. - Misc smaller fixes & cleanups. * tag 'sched-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: topology: Remove unused cpu_cluster_mask() sched: Reverse sched_class layout sched/deadline: Remove superfluous rq clock update in push_dl_task() sched/core: Avoid obvious double update_rq_clock warning smp: Make softirq handling RT safe in flush_smp_call_function_queue() smp: Rename flush_smp_call_function_from_idle() sched: Fix missing prototype warnings sched/fair: Remove cfs_rq_tg_path() sched/fair: Remove sched_trace_*() helper functions sched/fair: Refactor cpu_util_without() sched/fair: Revise comment about lb decision matrix sched/psi: report zeroes for CPU full at the system level sched/fair: Delete useless condition in tg_unthrottle_up() sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq sched/fair: Move calculate of avg_load to a better location mailmap: Update my email address to @redhat.com MAINTAINERS: Add myself as scheduler topology reviewer psi: Fix trigger being fired unexpectedly at initial ftrace: Use preemption model accessors for trace header printout kcsan: Use preemption model accessors commit b90c7e97c48bb1a94cd49cc32a4d2a62a06cbf1c Author: Dennis Dalessandro Date: Fri May 20 14:37:27 2022 -0400 RDMA/hfi1: Remove all traces of diagpkt support One of the concessions we made to get our driver upstream was to remove the diagnostic packet support. There is however still some cruft that was left over. Remove it. Link: https://lore.kernel.org/r/20220520183727.48973.93587.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 1994c3134068aee50a7c3805f9d01f8736604ac2 Author: Dennis Dalessandro Date: Fri May 20 14:37:22 2022 -0400 RDMA/hfi1: Consolidate software versions There is no need to have separate user and kernel software versions. There is a single software that the kernel is compatible with. Also remove the notion of a "kernel type" that is long since deprecated. Link: https://lore.kernel.org/r/20220520183722.48973.60262.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 676bffa02e4a511bcc32051ca9a7d544dc6bc6e5 Author: Dennis Dalessandro Date: Fri May 20 14:37:17 2022 -0400 RDMA/hfi1: Remove pointless driver version Driver versions have long been forbidden in the RDMA subsystem. We removed most of the code relating to them and have been very strict about not allowing. However there is some leftover versioning that we do not need. Get rid of that. Link: https://lore.kernel.org/r/20220520183717.48973.17418.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit f93e91a0372c922c20d5bee260b0f43b4b8a1bee Author: Dennis Dalessandro Date: Fri May 20 14:37:12 2022 -0400 RDMA/hfi1: Fix potential integer multiplication overflow errors When multiplying of different types, an overflow is possible even when storing the result in a larger type. This is because the conversion is done after the multiplication. So arithmetic overflow and thus in incorrect value is possible. Correct an instance of this in the inter packet delay calculation. Fix by ensuring one of the operands is u64 which will promote the other to u64 as well ensuring no overflow. Cc: stable@vger.kernel.org Fixes: 7724105686e7 ("IB/hfi1: add driver files") Link: https://lore.kernel.org/r/20220520183712.48973.29855.stgit@awfm-01.cornelisnetworks.com Reviewed-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 629e052d0c98e46dde9f0824f0aa437f678d9b8f Author: Douglas Miller Date: Fri May 20 14:37:06 2022 -0400 RDMA/hfi1: Prevent panic when SDMA is disabled If the hfi1 module is loaded with HFI1_CAP_SDMA off, a call to hfi1_write_iter() will dereference a NULL pointer and panic. A typical stack frame is: sdma_select_user_engine [hfi1] hfi1_user_sdma_process_request [hfi1] hfi1_write_iter [hfi1] do_iter_readv_writev do_iter_write vfs_writev do_writev do_syscall_64 The fix is to test for SDMA in hfi1_write_iter() and fail the I/O with EINVAL. Link: https://lore.kernel.org/r/20220520183706.48973.79803.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit cfeb2522c3777923c2bd24772b914195dc93c86b Merge: 22922deae13fc bae19fdd7e9e7 Author: Linus Torvalds Date: Tue May 24 10:59:38 2022 -0700 Merge tag 'perf-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf events updates from Ingo Molnar: "Platform PMU changes: - x86/intel: - Add new Intel Alder Lake and Raptor Lake support - x86/amd: - AMD Zen4 IBS extensions support - Add AMD PerfMonV2 support - Add AMD Fam19h Branch Sampling support Generic changes: - signal: Deliver SIGTRAP on perf event asynchronously if blocked Perf instrumentation can be driven via SIGTRAP, but this causes a problem when SIGTRAP is blocked by a task & terminate the task. Allow user-space to request these signals asynchronously (after they get unblocked) & also give the information to the signal handler when this happens: "To give user space the ability to clearly distinguish synchronous from asynchronous signals, introduce siginfo_t::si_perf_flags and TRAP_PERF_FLAG_ASYNC (opted for flags in case more binary information is required in future). The resolution to the problem is then to (a) no longer force the signal (avoiding the terminations), but (b) tell user space via si_perf_flags if the signal was synchronous or not, so that such signals can be handled differently (e.g. let user space decide to ignore or consider the data imprecise). " - Unify/standardize the /sys/devices/cpu/events/* output format. - Misc fixes & cleanups" * tag 'perf-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) perf/x86/amd/core: Fix reloading events for SVM perf/x86/amd: Run AMD BRS code only on supported hw perf/x86/amd: Fix AMD BRS period adjustment perf/x86/amd: Remove unused variable 'hwc' perf/ibs: Fix comment perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute perf/amd/ibs: Add support for L3 miss filtering perf/amd/ibs: Use ->is_visible callback for dynamic attributes perf/amd/ibs: Cascade pmu init functions' return value perf/x86/uncore: Add new Alder Lake and Raptor Lake support perf/x86/uncore: Clean up uncore_pci_ids[] perf/x86/cstate: Add new Alder Lake and Raptor Lake support perf/x86/msr: Add new Alder Lake and Raptor Lake support perf/x86: Add new Alder Lake and Raptor Lake support perf/amd/ibs: Use interrupt regs ip for stack unwinding perf/x86/amd/core: Add PerfMonV2 overflow handling perf/x86/amd/core: Add PerfMonV2 counter control perf/x86/amd/core: Detect available counters perf/x86/amd/core: Detect PerfMonV2 support x86/msr: Add PerfCntrGlobal* registers ... commit 05c03dfd09c069c4ffd783b47b2da5dcc9421f2c Author: Douglas Miller Date: Fri May 20 14:37:01 2022 -0400 RDMA/hfi1: Prevent use of lock before it is initialized If there is a failure during probe of hfi1 before the sdma_map_lock is initialized, the call to hfi1_free_devdata() will attempt to use a lock that has not been initialized. If the locking correctness validator is on then an INFO message and stack trace resembling the following may be seen: INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. Call Trace: register_lock_class+0x11b/0x880 __lock_acquire+0xf3/0x7930 lock_acquire+0xff/0x2d0 _raw_spin_lock_irq+0x46/0x60 sdma_clean+0x42a/0x660 [hfi1] hfi1_free_devdata+0x3a7/0x420 [hfi1] init_one+0x867/0x11a0 [hfi1] pci_device_probe+0x40e/0x8d0 The use of sdma_map_lock in sdma_clean() is for freeing the sdma_map memory, and sdma_map is not allocated/initialized until after sdma_map_lock has been initialized. This code only needs to be run if sdma_map is not NULL, and so checking for that condition will avoid trying to use the lock before it is initialized. Fixes: 473291b3ea0e ("IB/hfi1: Fix for early release of sdma context") Fixes: 7724105686e7 ("IB/hfi1: add driver files") Link: https://lore.kernel.org/r/20220520183701.48973.72434.stgit@awfm-01.cornelisnetworks.com Reported-by: Zheyu Ma Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 22922deae13fc8d3769790c2eb388e9afce9771d Merge: 2319be135672f 22682a07acc30 Author: Linus Torvalds Date: Tue May 24 10:36:38 2022 -0700 Merge tag 'objtool-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool updates from Ingo Molnar: - Comprehensive interface overhaul: ================================= Objtool's interface has some issues: - Several features are done unconditionally, without any way to turn them off. Some of them might be surprising. This makes objtool tricky to use, and prevents porting individual features to other arches. - The config dependencies are too coarse-grained. Objtool enablement is tied to CONFIG_STACK_VALIDATION, but it has several other features independent of that. - The objtool subcmds ("check" and "orc") are clumsy: "check" is really a subset of "orc", so it has all the same options. The subcmd model has never really worked for objtool, as it only has a single purpose: "do some combination of things on an object file". - The '--lto' and '--vmlinux' options are nonsensical and have surprising behavior. Overhaul the interface: - get rid of subcmds - make all features individually selectable - remove and/or clarify confusing/obsolete options - update the documentation - fix some bugs found along the way - Fix x32 regression - Fix Kbuild cleanup bugs - Add scripts/objdump-func helper script to disassemble a single function from an object file. - Rewrite scripts/faddr2line to be section-aware, by basing it on 'readelf', moving it away from 'nm', which doesn't handle multiple sections well, which can result in decoding failure. - Rewrite & fix symbol handling - which had a number of bugs wrt. object files that don't have global symbols - which is rare but possible. Also fix a bunch of symbol handling bugs found along the way. * tag 'objtool-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) objtool: Fix objtool regression on x32 systems objtool: Fix symbol creation scripts/faddr2line: Fix overlapping text section failures scripts: Create objdump-func helper script objtool: Remove libsubcmd.a when make clean objtool: Remove inat-tables.c when make clean objtool: Update documentation objtool: Remove --lto and --vmlinux in favor of --link objtool: Add HAVE_NOINSTR_VALIDATION objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION" objtool: Make noinstr hacks optional objtool: Make jump label hack optional objtool: Make static call annotation optional objtool: Make stack validation frame-pointer-specific objtool: Add CONFIG_OBJTOOL objtool: Extricate sls from stack validation objtool: Rework ibt and extricate from stack validation objtool: Make stack validation optional objtool: Add option to print section addresses objtool: Don't print parentheses in function addresses ... commit 2319be135672f6e45aa937bceaae6c2668c7867c Merge: 143a6252e1b8a 8491d1bdf5de1 Author: Linus Torvalds Date: Tue May 24 10:18:23 2022 -0700 Merge tag 'locking-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: - rwsem cleanups & optimizations/fixes: - Conditionally wake waiters in reader/writer slowpaths - Always try to wake waiters in out_nolock path - Add try_cmpxchg64() implementation, with arch optimizations - and use it to micro-optimize sched_clock_{local,remote}() - Various force-inlining fixes to address objdump instrumentation-check warnings - Add lock contention tracepoints: lock:contention_begin lock:contention_end - Misc smaller fixes & cleanups * tag 'locking-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/clock: Use try_cmpxchg64 in sched_clock_{local,remote} locking/atomic/x86: Introduce arch_try_cmpxchg64 locking/atomic: Add generic try_cmpxchg64 support futex: Remove a PREEMPT_RT_FULL reference. locking/qrwlock: Change "queue rwlock" to "queued rwlock" lockdep: Delete local_irq_enable_in_hardirq() locking/mutex: Make contention tracepoints more consistent wrt adaptive spinning locking: Apply contention tracepoints in the slow path locking: Add lock contention tracepoints locking/rwsem: Always try to wake waiters in out_nolock path locking/rwsem: Conditionally wake waiters in reader/writer slowpaths locking/rwsem: No need to check for handoff bit if wait queue empty lockdep: Fix -Wunused-parameter for _THIS_IP_ x86/mm: Force-inline __phys_addr_nodebug() x86/kvm/svm: Force-inline GHCB accessors task_stack, x86/cea: Force-inline stack helpers commit 7f60951ff4d1664dfa2c304d144d195989199ef3 Author: Christophe JAILLET Date: Sun May 22 15:25:08 2022 +0200 RDMA/rxe: Fix an error handling path in rxe_get_mcg() The commit in the Fixes tag has shuffled some code. Now 'mcg_num' is incremented before the kzalloc(). So if the memory allocation fails, this increment must be undone. Fixes: a926a903b7dc ("RDMA/rxe: Do not call dev_mc_add/del() under a spinlock") Link: https://lore.kernel.org/r/fe137cd8b1f17593243aa73d59c18ea71ab9ee36.1653225896.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit a6f844da39af8046798ba5cadf92a0c54da80b26 Merge: b599b31033aa6 4b0986a3613c9 Author: Jason Gunthorpe Date: Tue May 24 12:40:28 2022 -0300 Merge tag 'v5.18' into rdma.git for-next Following patches have dependencies. Resolve the merge conflict in drivers/net/ethernet/mellanox/mlx5/core/main.c by keeping the new names for the fs functions following linux-next: https://lore.kernel.org/r/20220519113529.226bc3e2@canb.auug.org.au/ Signed-off-by: Jason Gunthorpe commit d37aa2efc89b387cda93bf15317883519683d435 Author: Masahiro Yamada Date: Tue May 24 22:55:41 2022 +0900 gcc-plugins: use KERNELVERSION for plugin version Commit 61f60bac8c05 ("gcc-plugins: Change all version strings match kernel") broke parallel builds. Instead of adding the dependency between GCC plugins and utsrelease.h, let's use KERNELVERSION, which does not require any build artifact. Another reason why I want to avoid utsrelease.h is because it depends on CONFIG_LOCALVERSION(_AUTO) and localversion* files. (include/generated/utsrelease.h depends on include/config/kernel.release, which is generated by scripts/setlocalversion) I want to keep host tools independent of the kernel configuration. There is no good reason to rebuild GCC plugins just because of CONFIG_LOCALVERSION being changed. We just want to associate the plugin versions with the kernel source version. KERNELVERSION should be enough for our purpose. Fixes: 61f60bac8c05 ("gcc-plugins: Change all version strings match kernel") Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202205230239.EZxeZ3Fv-lkp@intel.com Reported-by: Guenter Roeck Signed-off-by: Masahiro Yamada Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220524135541.1453693-1-masahiroy@kernel.org commit 421cfe6596f6cb316991c02bf30a93bd81092853 Author: Matthew Rosato Date: Thu May 19 14:33:11 2022 -0400 vfio: remove VFIO_GROUP_NOTIFY_SET_KVM Rather than relying on a notifier for associating the KVM with the group, let's assume that the association has already been made prior to device_open. The first time a device is opened associate the group KVM with the device. This fixes a user-triggerable oops in GVT. Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Signed-off-by: Matthew Rosato Reviewed-by: Jason Gunthorpe Acked-by: Zhi Wang Link: https://lore.kernel.org/r/20220519183311.582380-2-mjrosato@linux.ibm.com Signed-off-by: Alex Williamson commit 5a7cb9f3978d1fe8cfba798b4c9c054ce226e8fd Author: Geert Uytterhoeven Date: Fri May 20 12:24:16 2022 +0200 gpio: sifive: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the sifive driver: gpio gpiochip1: (38001000.gpio-controller): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the sifive driver immutable. Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Reviewed-by: Damien Le Moal Signed-off-by: Bartosz Golaszewski commit 718b972d32da093ac4358c0abb099c65292dc536 Author: Geert Uytterhoeven Date: Fri May 20 12:18:56 2022 +0200 gpio: rcar: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the gpio-rcar driver: gpio gpiochip0: (e6050000.gpio): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the gpio-rcar driver immutable. Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 61550be779dcb82cb96852721bac652144a0d0b9 Author: Geert Uytterhoeven Date: Fri May 20 12:20:57 2022 +0200 gpio: pcf857x: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the pcf857x driver: gpio gpiochip1: (pcf8575): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the pcf857x driver immutable. Signed-off-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit ac2f6f9385aa27b9a73156885be9765299b8e11f Author: Geert Uytterhoeven Date: Fri May 20 12:21:54 2022 +0200 gpio: pca953x: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the pca953x driver: gpio gpiochip7: (0-0020): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the pca953x driver immutable. Signed-off-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit cfc2b00ebed6660a10d1be09f2dd6957556ce6a5 Author: Geert Uytterhoeven Date: Fri May 20 12:23:18 2022 +0200 gpio: dwapb: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the dwapb driver: gpio gpiochip0: (50200000.gpio): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the dwapb driver immutable. Signed-off-by: Geert Uytterhoeven Reviewed-by: Damien Le Moal Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit b599b31033aa6928309d1cf8180c3daf260574e1 Author: Julia Lawall Date: Sat May 21 13:11:37 2022 +0200 IB/core: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-87-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jason Gunthorpe commit 83567cee0472fb7b57cc6e931ab002aeb69a26d4 Author: Julia Lawall Date: Sat May 21 13:11:36 2022 +0200 RDMA/core: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-86-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jason Gunthorpe commit 684b916b3028507b99756ad29e9b57c5b74e8be2 Author: Julia Lawall Date: Sat May 21 13:11:33 2022 +0200 IB/hf1: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-83-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jason Gunthorpe commit 25ec8b35b37488789885decf58f7d57fadce7d15 Author: Julia Lawall Date: Sat May 21 13:11:06 2022 +0200 IB/qib: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-56-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jason Gunthorpe commit d0d4df06cca5a844f15bb17102259ac0d0bae480 Author: Julia Lawall Date: Sat May 21 13:10:14 2022 +0200 IB/iser: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-4-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Reviewed-by: Sagi Grimberg Acked-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 6b8be804ff376f6657ccdf6b29974e7c793d88c4 Author: Greg Ungerer Date: Wed May 18 16:14:05 2022 +1000 m68knommu: fix 68000 CPU link with no platform selected If building for a nommu m68k classic CPU and no platform (board) is selected then the final link fails with: LD vmlinux.o m68k-linux-ld: cannot find arch/m68k/kernel/head.o: No such file or directory make: *** [Makefile:1158: vmlinux] Error 1 Not selecting a platform is ok, that is a generic 68000 system build. All of the platform selections are for 68328 variants. The underlying problem is that the CPU config option (CONFIG_M68000) ends up not being set, it is currently only selected by one of the platform choices. Change CONFIG_M68000 so that it is always enabled for the nommu m68k classic configuration. Signed-off-by: Greg Ungerer commit 348cce32cc324507a9db265b9ff454d141a57add Author: Greg Ungerer Date: Mon May 16 16:46:07 2022 +1000 m68k: removed unused "mach_get_ss" The m68k machine helper function "mach_get_ss" function pointer is set for some machines, but ultimately never used anywhere. Remove it. Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Signed-off-by: Greg Ungerer commit 1300eec9e51f23c34c4487d2b06f58ca22e1ad3d Author: Greg Ungerer Date: Mon May 16 16:36:07 2022 +1000 m68knommu: fix undefined reference to `mach_get_rtc_pll' Configuring for a nommu classic m68k target and enabling the generic rtc driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile error: m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl': time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll' m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll' m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll' There are no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the nommu code paths. Move these definitions and the associated "mach_hwclk", so that they are around their use case in time.c. This means they will always be defined on the builds that require them, and not on those that cannot use them - such as ColdFire (both with and without MMU enabled). Reported-by: kernel test robot Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Reviewed-by: Arnd Bergmann Signed-off-by: Greg Ungerer commit 79f9fbe303520d2c32b70f04f2bb02cc2baaa4c3 Author: Nathan Chancellor Date: Mon May 23 15:47:02 2022 -0700 mailbox: qcom-ipcc: Fix -Wunused-function with CONFIG_PM_SLEEP=n When CONFIG_PM_SLEEP is not set, there is a warning that qcom_ipcc_pm_resume() is unused: drivers/mailbox/qcom-ipcc.c:258:12: error: 'qcom_ipcc_pm_resume' defined but not used [-Werror=unused-function] 258 | static int qcom_ipcc_pm_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") reworked the PM_OPS macros to avoid this problem. Use NOIRQ_SYSTEM_SLEEP_PM_OPS directly so that qcom_ipcc_pm_resume() always appears to be used to the compiler, even though it will be dead code eliminated in the !CONFIG_PM_SLEEP case. Fixes: c25f77899753 ("mailbox: qcom-ipcc: Log the pending interrupt during resume") Signed-off-by: Nathan Chancellor Reviewed-by: Sibi Sankar Signed-off-by: Jassi Brar commit 32feee36c30ea06e38ccb8ae6e5c44c6eec790a6 Author: Coly Li Date: Tue May 24 18:23:36 2022 +0800 bcache: avoid journal no-space deadlock by reserving 1 journal bucket The journal no-space deadlock was reported time to time. Such deadlock can happen in the following situation. When all journal buckets are fully filled by active jset with heavy write I/O load, the cache set registration (after a reboot) will load all active jsets and inserting them into the btree again (which is called journal replay). If a journaled bkey is inserted into a btree node and results btree node split, new journal request might be triggered. For example, the btree grows one more level after the node split, then the root node record in cache device super block will be upgrade by bch_journal_meta() from bch_btree_set_root(). But there is no space in journal buckets, the journal replay has to wait for new journal bucket to be reclaimed after at least one journal bucket replayed. This is one example that how the journal no-space deadlock happens. The solution to avoid the deadlock is to reserve 1 journal bucket in run time, and only permit the reserved journal bucket to be used during cache set registration procedure for things like journal replay. Then the journal space will never be fully filled, there is no chance for journal no-space deadlock to happen anymore. This patch adds a new member "bool do_reserve" in struct journal, it is inititalized to 0 (false) when struct journal is allocated, and set to 1 (true) by bch_journal_space_reserve() when all initialization done in run_cache_set(). In the run time when journal_reclaim() tries to allocate a new journal bucket, free_journal_buckets() is called to check whether there are enough free journal buckets to use. If there is only 1 free journal bucket and journal->do_reserve is 1 (true), the last bucket is reserved and free_journal_buckets() will return 0 to indicate no free journal bucket. Then journal_reclaim() will give up, and try next time to see whetheer there is free journal bucket to allocate. By this method, there is always 1 jouranl bucket reserved in run time. During the cache set registration, journal->do_reserve is 0 (false), so the reserved journal bucket can be used to avoid the no-space deadlock. Reported-by: Nikhil Kshirsagar Signed-off-by: Coly Li Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220524102336.10684-5-colyli@suse.de Signed-off-by: Jens Axboe commit 80db4e4707e78cb22287da7d058d7274bd4cb370 Author: Coly Li Date: Tue May 24 18:23:35 2022 +0800 bcache: remove incremental dirty sector counting for bch_sectors_dirty_init() After making bch_sectors_dirty_init() being multithreaded, the existing incremental dirty sector counting in bch_root_node_dirty_init() doesn't release btree occupation after iterating 500000 (INIT_KEYS_EACH_TIME) bkeys. Because a read lock is added on btree root node to prevent the btree to be split during the dirty sectors counting, other I/O requester has no chance to gain the write lock even restart bcache_btree(). That is to say, the incremental dirty sectors counting is incompatible to the multhreaded bch_sectors_dirty_init(). We have to choose one and drop another one. In my testing, with 512 bytes random writes, I generate 1.2T dirty data and a btree with 400K nodes. With single thread and incremental dirty sectors counting, it takes 30+ minites to register the backing device. And with multithreaded dirty sectors counting, the backing device registration can be accomplished within 2 minutes. The 30+ minutes V.S. 2- minutes difference makes me decide to keep multithreaded bch_sectors_dirty_init() and drop the incremental dirty sectors counting. This is what this patch does. But INIT_KEYS_EACH_TIME is kept, in sectors_dirty_init_fn() the CPU will be released by cond_resched() after every INIT_KEYS_EACH_TIME keys iterated. This is to avoid the watchdog reports a bogus soft lockup warning. Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Signed-off-by: Coly Li Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220524102336.10684-4-colyli@suse.de Signed-off-by: Jens Axboe commit 4dc34ae1b45fe26e772a44379f936c72623dd407 Author: Coly Li Date: Tue May 24 18:23:34 2022 +0800 bcache: improve multithreaded bch_sectors_dirty_init() Commit b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") makes bch_sectors_dirty_init() to be much faster when counting dirty sectors by iterating all dirty keys in the btree. But it isn't in ideal shape yet, still can be improved. This patch does the following changes to improve current parallel dirty keys iteration on the btree, - Add read lock to root node when multiple threads iterating the btree, to prevent the root node gets split by I/Os from other registered bcache devices. - Remove local variable "char name[32]" and generate kernel thread name string directly when calling kthread_run(). - Allocate "struct bch_dirty_init_state state" directly on stack and avoid the unnecessary dynamic memory allocation for it. - Decrease BCH_DIRTY_INIT_THRD_MAX from 64 to 12 which is enough indeed. - Increase &state->started to count created kernel thread after it succeeds to create. - When wait for all dirty key counting threads to finish, use wait_event() to replace wait_event_interruptible(). With the above changes, the code is more clear, and some potential error conditions are avoided. Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Signed-off-by: Coly Li Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220524102336.10684-3-colyli@suse.de Signed-off-by: Jens Axboe commit 622536443b6731ec82c563aae7807165adbe9178 Author: Coly Li Date: Tue May 24 18:23:33 2022 +0800 bcache: improve multithreaded bch_btree_check() Commit 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded") makes bch_btree_check() to be much faster when checking all btree nodes during cache device registration. But it isn't in ideal shap yet, still can be improved. This patch does the following thing to improve current parallel btree nodes check by multiple threads in bch_btree_check(), - Add read lock to root node while checking all the btree nodes with multiple threads. Although currently it is not mandatory but it is good to have a read lock in code logic. - Remove local variable 'char name[32]', and generate kernel thread name string directly when calling kthread_run(). - Allocate local variable "struct btree_check_state check_state" on the stack and avoid unnecessary dynamic memory allocation for it. - Reduce BCH_BTR_CHKTHREAD_MAX from 64 to 12 which is enough indeed. - Increase check_state->started to count created kernel thread after it succeeds to create. - When wait for all checking kernel threads to finish, use wait_event() to replace wait_event_interruptible(). With this change, the code is more clear, and some potential error conditions are avoided. Fixes: 8e7102273f59 ("bcache: make bch_btree_check() to be multithreaded") Signed-off-by: Coly Li Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220524102336.10684-2-colyli@suse.de Signed-off-by: Jens Axboe commit 832296804bc7171730884e78c761c29f6d258e13 Author: Oder Chiou Date: Mon May 16 18:30:55 2022 +0800 ASoC: rt5640: Do not manipulate pin "Platform Clock" if the "Platform Clock" is not in the DAPM The pin "Platform Clock" was only used by the Intel Byt CR platform. In the others, the error log will be informed. The patch will set the flag to avoid the pin "Platform Clock" manipulated by the other platforms. Signed-off-by: Oder Chiou Reported-by: Sameer Pujar Link: https://lore.kernel.org/r/20220516103055.20003-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 795d82ed389b0592aefa49c4b1c498351da65a63 Author: Tiezhu Yang Date: Tue May 24 10:27:50 2022 +0800 MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Use memblock_add_node to add new memblock region within a NUMA node in early_parse_mem() under CONFIG_NUMA, otherwise the mem parameter can not work well. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit fb3d6967d508a59b2e8df8358aad1c35579a2833 Author: Tiezhu Yang Date: Tue May 24 10:27:49 2022 +0800 MIPS: Return -EINVAL if mem parameter is empty in early_parse_mem() In the current code, the users usually need to make sure the value of mem parameter is correct, but it is better to do some check to avoid potential boot hangs. This commit checks whether mem parameter is empty, if yes, return -EINVAL before call memblock_remove() and memblock_add(). Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 31f12fdc2f1ed59f1a919f57b8b31af614b8c5ee Author: Juerg Haefliger Date: Tue May 24 10:03:11 2022 +0200 MIPS: Kconfig: Fix indentation and add endif comment The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. While add it, add a missing trailing endif comment. Signed-off-by: Juerg Haefliger Signed-off-by: Thomas Bogendoerfer commit c85ab4fe33065ca1fdcac26f0c00c837fe727ba7 Author: Christophe Leroy Date: Tue May 24 07:42:05 2022 +0200 powerpc/64s: Only set HAVE_ARCH_UNMAPPED_AREA when CONFIG_PPC_64S_HASH_MMU is set When CONFIG_PPC_64S_HASH_MMU is not set, slice.c is not built and arch_get_unmapped_area() and arch_get_unmapped_area_topdown() are not provided because RADIX uses the generic ones. Therefore, neither set HAVE_ARCH_UNMAPPED_AREA nor HAVE_ARCH_UNMAPPED_AREA_TOPDOWN. Fixes: ab57bd7570d4 ("powerpc/mm: Move get_unmapped_area functions to slice.c") Reported-by: Laurent Dufour Signed-off-by: Christophe Leroy Tested-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e438c6cc09f94085e56733ed2d6e84333c35292a.1653370913.git.christophe.leroy@csgroup.eu commit 14554d92c1c5a127dd0dab8fce8f08bf70d8b39b Author: Christophe Leroy Date: Tue May 24 07:35:10 2022 +0200 powerpc/xics: Include missing header Include of_adresses.h to get of_iomap() prototype. Fixes: 86c38fec69a4 ("powerpc: Remove asm/prom.h from all files that don't need it") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f20a14be1a29fa0a9ebcfc5ebf05eb69c5120d10.1653370502.git.christophe.leroy@csgroup.eu commit 60571929d06b028800f27b51a7c81de1144944cf Author: Kailang Yang Date: Tue May 24 16:14:04 2022 +0800 ALSA: hda/realtek - Add new type for ALC245 Add new type for ALC245. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/cef26a7cd3d146eb96a3994ce79e34d2@realtek.com Signed-off-by: Takashi Iwai commit 07d17217c668d5b9974572b2d69c6736f60b9925 Merge: 2e688e654f48d d88591a555325 Author: Jiri Kosina Date: Tue May 24 10:59:51 2022 +0200 Merge branch 'for-5.19/wacom' into for-linus - support for pens with 3 buttons (Joshua Dickens) - support for HID_DG_SCANTIME to report the timestamp for pen and touch events (Joshua Dickens) commit 2e688e654f48dde6e5899ff62cdf7b2d87f4ad89 Merge: fa4c7c64360e4 f7d8e387d9aef Author: Jiri Kosina Date: Tue May 24 10:58:06 2022 +0200 Merge branch 'for-5.19/uclogic' into for-linus - support for wider variety of Huion tablets ported from DIGImend project (José Expósito, Nikolai Kondrashov) commit fa4c7c64360e41bddc53273e185e4b5712c9d534 Merge: 35b4e60e0c5a7 06be0d6442a07 Author: Jiri Kosina Date: Tue May 24 10:57:06 2022 +0200 Merge branch 'for-5.19/megaworld' into for-linus commit 35b4e60e0c5a7ad885e5d95da71ed66d77736893 Merge: cf620bdad825f 5c9b8fae88bc2 Author: Jiri Kosina Date: Tue May 24 10:56:46 2022 +0200 Merge branch 'for-5.19/lenovo' into for-linus commit cf620bdad825f8d824a5f2896c82734dfd81a0b4 Merge: 8959f00799a17 fa33382c7f74a Author: Jiri Kosina Date: Tue May 24 10:55:37 2022 +0200 Merge branch 'for-5.19/apple' into for-linus - Support for Keychron keyboards (Bryan Cain) commit 8959f00799a174af300f88bf8360b903976363c9 Merge: fc4ef9d572497 806fc359a3945 Author: Jiri Kosina Date: Tue May 24 10:54:42 2022 +0200 Merge branch 'for-5.19/amd-sfh' into for-linus - support for sensor discovery and code cleanups (Basavaraj Natikar) commit 14bdb047a54d7a44af8633848ad097bbaf1b2cb6 Author: Damien Le Moal Date: Tue May 24 08:29:39 2022 +0900 zonefs: Fix zonefs_init_file_inode() return value Commit 87c9ce3ffec9 ("zonefs: Add active seq file accounting") wrongly changed zonefs_init_file_inode() to always return 0 even if the call to zonefs_zone_mgmt() fails. Fix this by propagating zonefs_zone_mgmt() return value as the return value for zonefs_init_file_inode(). Fixes: 87c9ce3ffec9 ("zonefs: Add active seq file accounting") Signed-off-by: Damien Le Moal commit 5ce2176b81f77366bd02c27509b83049f0020544 Author: Masahiro Yamada Date: Fri May 13 20:39:24 2022 +0900 genksyms: adjust the output format to modpost Make genksyms output symbol versions in the format modpost expects, so the 'sed' is unneeded. This commit makes *.symversions completely unneeded. I will keep *.symversions in .gitignore and 'make clean' for a while. Otherwise, 'git status' might be surprising. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 7375cbcf2343a9337b19846e76dfd94c3af98a27 Author: Masahiro Yamada Date: Fri May 13 20:39:23 2022 +0900 kbuild: stop merging *.symversions Now modpost reads symbol versions from .*.cmd files. The merged *.symversions are no longer needed. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 7b4537199a4a8480b8c3ba37a2d44765ce76cd9b Author: Masahiro Yamada Date: Fri May 13 20:39:22 2022 +0900 kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS include/{linux,asm-generic}/export.h defines a weak symbol, __crc_* as a placeholder. Genksyms writes the version CRCs into the linker script, which will be used for filling the __crc_* symbols. The linker script format depends on CONFIG_MODULE_REL_CRCS. If it is enabled, __crc_* holds the offset to the reference of CRC. It is time to get rid of this complexity. Now that modpost parses text files (.*.cmd) to collect all the CRCs, it can generate C code that will be linked to the vmlinux or modules. Generate a new C file, .vmlinux.export.c, which contains the CRCs of symbols exported by vmlinux. It is compiled and linked to vmlinux in scripts/link-vmlinux.sh. Put the CRCs of symbols exported by modules into the existing *.mod.c files. No additional build step is needed for modules. As before, *.mod.c are compiled and linked to *.ko in scripts/Makefile.modfinal. No linker magic is used here. The new C implementation works in the same way, whether CONFIG_RELOCATABLE is enabled or not. CONFIG_MODULE_REL_CRCS is no longer needed. Previously, Kbuild invoked additional $(LD) to update the CRCs in objects, but this step is unneeded too. Signed-off-by: Masahiro Yamada Tested-by: Nathan Chancellor Tested-by: Nicolas Schier Reviewed-by: Nicolas Schier Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 9c04a8ff03def4df3f81219ffbe1ec9b44ff5348 Author: Krzysztof Kozlowski Date: Fri Apr 22 12:41:01 2022 +0200 clocksource/drivers/oxnas-rps: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: 89355274e1f7 ("clocksource/drivers/oxnas-rps: Add Oxford Semiconductor RPS Dual Timer") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220422104101.55754-1-krzysztof.kozlowski@linaro.org Signed-off-by: Daniel Lezcano commit 8c0d9461ab760439b09ae321803ee85df1136e08 Author: Dan Carpenter Date: Thu May 19 16:58:23 2022 +0300 clocksource/drivers/timer-ti-dm: Remove unnecessary NULL check The "pdata" pointer cannot be NULL because it's checked at the start of the function. Delete the check. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YoZM65RFDQAfqV6J@kili Signed-off-by: Daniel Lezcano commit 0e85a22d01dfe9ad9a9d9e87cd4a88acce1aad65 Author: Craig McLure Date: Tue May 24 08:21:15 2022 +0200 ALSA: usb-audio: Configure sync endpoints before data Devices such as the TC-Helicon GoXLR require the sync endpoint to be configured in advance of the data endpoint in order for sound output to work. This patch simply changes the ordering of EP configuration to resolve this. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215079 Signed-off-by: Craig McLure Reviewed-by: Jaroslav Kysela Cc: Link: https://lore.kernel.org/r/20220524062115.25968-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5d7c854593a460706dacf8e1b16c9bdcb1c2d7bb Author: Christophe Leroy Date: Mon Mar 28 08:26:48 2022 +0200 livepatch: Remove klp_arch_set_pc() and asm/livepatch.h All three versions of klp_arch_set_pc() do exactly the same: they call ftrace_instruction_pointer_set(). Call ftrace_instruction_pointer_set() directly and remove klp_arch_set_pc(). As klp_arch_set_pc() was the only thing remaining in asm/livepatch.h on x86 and s390, remove asm/livepatch.h livepatch.h remains on powerpc but its content is exclusively used by powerpc specific code. Signed-off-by: Christophe Leroy Acked-by: Petr Mladek Acked-by: Peter Zijlstra (Intel) Acked-by: Miroslav Benes Signed-off-by: Petr Mladek commit 52832252dded19e291a7b8842542ea61d1765f2f Author: Steve French Date: Mon May 23 23:17:12 2022 -0500 smb3: add mount parm nosparse To reduce risk of applications breaking that mount to servers with only partial sparse file support, add optional mount parm "nosparse" which disables setting files sparse (and thus will return EOPNOTSUPP on certain fallocate operations). Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 677fb7525331375ba2f90f4bc94a80b9b6e697a3 Merge: 1ef0736c0711e 7fb0269720d7d Author: Jakub Kicinski Date: Mon May 23 21:19:17 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/cadence/macb_main.c 5cebb40bc955 ("net: macb: Fix PTP one step sync support") 138badbc21a0 ("net: macb: use NAPI for TX completion path") https://lore.kernel.org/all/20220523111021.31489367@canb.auug.org.au/ net/smc/af_smc.c 75c1edf23b95 ("net/smc: postpone sk_refcnt increment in connect()") 3aba103006bc ("net/smc: align the connect behaviour with TCP") https://lore.kernel.org/all/20220524114408.4bf1af38@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit 143a6252e1b8ab424b4b293512a97cca7295c182 Merge: d6edf95109661 0616ea3f1b93a Author: Linus Torvalds Date: Mon May 23 21:06:11 2022 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: - Initial support for the ARMv9 Scalable Matrix Extension (SME). SME takes the approach used for vectors in SVE and extends this to provide architectural support for matrix operations. No KVM support yet, SME is disabled in guests. - Support for crashkernel reservations above ZONE_DMA via the 'crashkernel=X,high' command line option. - btrfs search_ioctl() fix for live-lock with sub-page faults. - arm64 perf updates: support for the Hisilicon "CPA" PMU for monitoring coherent I/O traffic, support for Arm's CMN-650 and CMN-700 interconnect PMUs, minor driver fixes, kerneldoc cleanup. - Kselftest updates for SME, BTI, MTE. - Automatic generation of the system register macros from a 'sysreg' file describing the register bitfields. - Update the type of the function argument holding the ESR_ELx register value to unsigned long to match the architecture register size (originally 32-bit but extended since ARMv8.0). - stacktrace cleanups. - ftrace cleanups. - Miscellaneous updates, most notably: arm64-specific huge_ptep_get(), avoid executable mappings in kexec/hibernate code, drop TLB flushing from get_clear_flush() (and rename it to get_clear_contig()), ARCH_NR_GPIO bumped to 2048 for ARCH_APPLE. * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (145 commits) arm64/sysreg: Generate definitions for FAR_ELx arm64/sysreg: Generate definitions for DACR32_EL2 arm64/sysreg: Generate definitions for CSSELR_EL1 arm64/sysreg: Generate definitions for CPACR_ELx arm64/sysreg: Generate definitions for CONTEXTIDR_ELx arm64/sysreg: Generate definitions for CLIDR_EL1 arm64/sve: Move sve_free() into SVE code section arm64: Kconfig.platforms: Add comments arm64: Kconfig: Fix indentation and add comments arm64: mm: avoid writable executable mappings in kexec/hibernate code arm64: lds: move special code sections out of kernel exec segment arm64/hugetlb: Implement arm64 specific huge_ptep_get() arm64/hugetlb: Use ptep_get() to get the pte value of a huge page arm64: kdump: Do not allocate crash low memory if not needed arm64/sve: Generate ZCR definitions arm64/sme: Generate defintions for SVCR arm64/sme: Generate SMPRI_EL1 definitions arm64/sme: Automatically generate SMPRIMAP_EL2 definitions arm64/sme: Automatically generate SMIDR_EL1 defines arm64/sme: Automatically generate defines for SMCR ... commit d6edf95109661e5fb9b20613478470d2e8fa4455 Merge: 95fbef17e8253 b6f21d14f1ac1 Author: Linus Torvalds Date: Mon May 23 21:04:25 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - amba bus updates - simplify ldr_this_cpu assembler macro for uniprocessor builds - avoid explicit assembler literal loads - more spectre-bhb improvements - add Cortex-A9 Errata 764319 workaround - add all unwind tables for modules * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9204/2: module: Add all unwind tables when load module ARM: 9206/1: A9: Add ARM ERRATA 764319 workaround (Updated) ARM: 9201/1: spectre-bhb: rely on linker to emit cross-section literal loads ARM: 9200/1: spectre-bhb: avoid cross-subsection jump using a numbered label ARM: 9199/1: spectre-bhb: use local DSB and elide ISB in loop8 sequence ARM: 9198/1: spectre-bhb: simplify BPIALL vector macro ARM: 9195/1: entry: avoid explicit literal loads ARM: 9194/1: assembler: simplify ldr_this_cpu for !SMP builds ARM: 9192/1: amba: fix memory leak in amba_device_try_add() ARM: 9193/1: amba: Add amba_read_periphid() helper commit 95fbef17e8253775876a08ec2011d3665b86a55f Merge: 67c642e0d9aa9 94d3477897481 Author: Linus Torvalds Date: Mon May 23 21:01:30 2022 -0700 Merge tag 's390-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Heiko Carstens: - Make use of the IBM z16 processor activity instrumentation facility to count cryptography operations: add a new PMU device driver so that perf can make use of this. - Add new IBM z16 extended counter set to cpumf support. - Add vdso randomization support. - Add missing KCSAN instrumentation to barriers and spinlocks, which should make s390's KCSAN support complete. - Add support for IPL-complete-control facility: notify the hypervisor that kexec finished work and the kernel starts. - Improve error logging for PCI. - Various small changes to workaround llvm's integrated assembler limitations, and one bug, to make it finally possible to compile the kernel with llvm's integrated assembler. This also requires to raise the minimum clang version to 14.0.0. - Various other small enhancements, bug fixes, and cleanups all over the place. * tag 's390-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (48 commits) s390/head: get rid of 31 bit leftovers scripts/min-tool-version.sh: raise minimum clang version to 14.0.0 for s390 s390/boot: do not emit debug info for assembly with llvm's IAS s390/boot: workaround llvm IAS bug s390/purgatory: workaround llvm's IAS limitations s390/entry: workaround llvm's IAS limitations s390/alternatives: remove padding generation code s390/alternatives: provide identical sized orginal/alternative sequences s390/cpumf: add new extended counter set for IBM z16 s390/preempt: disable __preempt_count_add() optimization for PROFILE_ALL_BRANCHES s390/stp: clock_delta should be signed s390/stp: fix todoff size s390/pai: add support for cryptography counters entry: Rename arch_check_user_regs() to arch_enter_from_user_mode() s390/compat: cleanup compat_linux.h header file s390/entry: remove broken and not needed code s390/boot: convert parmarea to C s390/boot: convert initial lowcore to C s390/ptrace: move short psw definitions to ptrace header file s390/head: initialize all new psws ... commit 67c642e0d9aa927c1340638e472f2467fefd1dbf Merge: fdd8f6585cef1 64d83f0677466 Author: Linus Torvalds Date: Mon May 23 20:59:19 2022 -0700 Merge tag 'csky-for-linus-5.19-rc1' of https://github.com/c-sky/csky-linux Pull arch/csky updates from Guo Ren: - Three atomic optimizations - memcpy/memcpy_io optimization - Some coding conventions for Kbuild, removing warnings * tag 'csky-for-linus-5.19-rc1' of https://github.com/c-sky/csky-linux: csky: Move $(core-y) into arch/csky/Kbuild csky: Remove unused core-y for dts csky: Remove unused $(dtb-y) from boot/Makefile csky: atomic: Add conditional atomic operations' optimization csky: atomic: Add custom atomic.h implementation csky: atomic: Optimize cmpxchg with acquire & release csky: optimize memcpy_{from,to}io() and memset_io() csky: Add C based string functions csky: Fix versioncheck warnings csky: patch_text: Fixup last cpu should be master csky: fix typos in comments commit fdd8f6585cef1c8c0fac745c1baa687301d55a90 Merge: 17a05c8f1e18b 30b5e6ef4a32e Author: Linus Torvalds Date: Mon May 23 20:56:17 2022 -0700 Merge tag 'm68k-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Introduce virtual m68k machine based on Android Goldfish devices - defconfig updates - Minor fixes and improvements * tag 'm68k-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: atari: Make Atari ROM port I/O write macros return void m68k: math-emu: Fix dependencies of math emulation support m68k: math-emu: Fix typos in comments m68k: Wire up syscall_trace_enter/leave for m68k m68k: defconfig: Update defconfigs for v5.18-rc1 m68k: Introduce a virtual m68k machine clocksource/drivers: Add a goldfish-timer clocksource rtc: goldfish: Use gf_ioread32()/gf_iowrite32() tty: goldfish: Introduce gf_ioread32()/gf_iowrite32() commit 17a05c8f1e18b3ef846d0032a19002568282ac29 Merge: d61306047533e dc60001e1a305 Author: Linus Torvalds Date: Mon May 23 20:54:17 2022 -0700 Merge tag 'xtensa-20220523' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa architecture updates from Max Filippov: - support coprocessors on SMP - support KCSAN - support handling protection faults in noMMU configurations - support using coprocessors in the kernel mode - support hibernation - enable context tracking - enable HAVE_VIRT_CPU_ACCOUNTING_GEN - support division by 0 exception on cores without HW division option - clean up locking in the ISS network driver - clean up kernel entry assemly code - various minor fixes * tag 'xtensa-20220523' of https://github.com/jcmvbkbc/linux-xtensa: (36 commits) xtensa: Return true/false (not 1/0) from bool function xtensa: improve call0 ABI probing xtensa: support artificial division by 0 exception xtensa: add trap handler for division by zero xtensa/simdisk: fix proc_read_simdisk() xtensa: no need to initialise statics to 0 xtensa: clean up labels in the kernel entry assembly xtensa: don't leave invalid TLB entry in fast_store_prohibited xtensa: fix declaration of _SecondaryResetVector_text_* irqchip: irq-xtensa-mx: fix initial IRQ affinity xtensa: enable ARCH_HAS_DEBUG_VM_PGTABLE xtensa: add hibernation support xtensa: support coprocessors on SMP xtensa: get rid of stack frame in coprocessor_flush xtensa: merge SAVE_CP_REGS_TAB and LOAD_CP_REGS_TAB xtensa: add xtensa_xsr macro xtensa: handle coprocessor exceptions in kernel mode xtensa: use callx0 opcode in fast_coprocessor xtensa: clean up excsave1 initialization xtensa: clean up declarations in coprocessor.h ... commit d61306047533eb6f63a7bd51dfa7f868503bf0ba Merge: 8443516da676b 5b3353949e89d Author: Linus Torvalds Date: Mon May 23 20:49:45 2022 -0700 Merge tag 'for-linus-5.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - decouple the PV interface from kernel internals in the Xen scsifront/scsiback pv drivers - harden the Xen scsifront PV driver against a malicious backend driver - simplify Xen PV frontend driver ring page setup - support Xen setups with multiple domains created at boot time to tolerate Xenstore coming up late - two small cleanup patches * tag 'for-linus-5.19-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (29 commits) xen: add support for initializing xenstore later as HVM domain xen: sync xs_wire.h header with upstream xen x86: xen: remove STACK_FRAME_NON_STANDARD from xen_cpuid xen-blk{back,front}: Update contact points for buffer_squeeze_duration_ms and feature_persistent xen/xenbus: eliminate xenbus_grant_ring() xen/sndfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/usbfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/scsifront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/pcifront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/drmfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/tpmfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/netfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/blkfront: use xenbus_setup_ring() and xenbus_teardown_ring() xen/xenbus: add xenbus_setup_ring() service function xen: update ring.h xen/shbuf: switch xen-front-pgdir-shbuf to use INVALID_GRANT_REF xen/dmabuf: switch gntdev-dmabuf to use INVALID_GRANT_REF xen/sound: switch xen_snd_front to use INVALID_GRANT_REF xen/drm: switch xen_drm_front to use INVALID_GRANT_REF xen/usb: switch xen-hcd to use INVALID_GRANT_REF ... commit 8443516da676be839b54ee11350baa2605f0a445 Merge: cfe1cb014bf94 badb81a58b9e6 Author: Linus Torvalds Date: Mon May 23 20:38:39 2022 -0700 Merge tag 'platform-drivers-x86-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "This includes some small changes to kernel/stop_machine.c and arch/x86 which are deps of the new Intel IFS support. Highlights: - New drivers: - Intel "In Field Scan" (IFS) support - Winmate FM07/FM07P buttons - Mellanox SN2201 support - AMD PMC driver enhancements - Lots of various other small fixes and hardware-id additions" * tag 'platform-drivers-x86-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (54 commits) platform/x86/intel/ifs: Add CPU_SUP_INTEL dependency platform/x86: intel_cht_int33fe: Set driver data platform/x86: intel-hid: fix _DSM function index handling platform/x86: toshiba_acpi: use kobj_to_dev() platform/x86: samsung-laptop: use kobj_to_dev() platform/x86: gigabyte-wmi: Add support for Z490 AORUS ELITE AC and X570 AORUS ELITE WIFI tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu tools/power/x86/intel-speed-select: Display error on turbo mode disabled Documentation: In-Field Scan platform/x86/intel/ifs: add ABI documentation for IFS trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations platform/x86/intel/ifs: Add IFS sysfs interface platform/x86/intel/ifs: Add scan test support platform/x86/intel/ifs: Authenticate and copy to secured memory platform/x86/intel/ifs: Check IFS Image sanity platform/x86/intel/ifs: Read IFS firmware image platform/x86/intel/ifs: Add stub driver for In-Field Scan stop_machine: Add stop_core_cpuslocked() for per-core operations x86/msr-index: Define INTEGRITY_CAPABILITIES MSR x86/microcode/intel: Expose collect_cpu_info_early() for IFS ... commit cfe1cb014bf947c8a85e542ab0f7a417adca7059 Merge: d6ecaa0024485 e3a3bbe3e99de Author: Linus Torvalds Date: Mon May 23 20:34:58 2022 -0700 Merge tag 'x86_sgx_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX updates from Dave Hansen: "A set of patches to prevent crashes in SGX enclaves under heavy memory pressure: SGX uses normal RAM allocated from special shmem files as backing storage when it runs out of SGX memory (EPC). The code was overly aggressive when freeing shmem pages and was inadvertently freeing perfectly good data. This resulted in failures in the SGX instructions used to swap data back into SGX memory. This turned out to be really hard to trigger in mainline. It was originally encountered testing the out-of-tree "SGX2" patches, but later reproduced on mainline. Fix the data loss by being more careful about truncating pages out of the backing storage and more judiciously setting pages dirty" * tag 'x86_sgx_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Ensure no data in PCMD page after truncate x86/sgx: Fix race between reclaimer and page fault handler x86/sgx: Obtain backing storage page with enclave mutex held x86/sgx: Mark PCMD page as dirty when modifying contents x86/sgx: Disconnect backing page references from dirty status commit f9f0a46141e2e39bedb4779c88380d1b5f018c14 Author: Hannes Reinecke Date: Mon May 23 14:02:44 2022 +0200 scsi: myrb: Fix up null pointer access on myrb_cleanup() When myrb_probe() fails the callback might not be set, so we need to validate the 'disable_intr' callback in myrb_cleanup() to not cause a null pointer exception. And while at it do not call myrb_cleanup() if we cannot enable the PCI device at all. Link: https://lore.kernel.org/r/20220523120244.99515-1-hare@suse.de Reported-by: Zheyu Ma Tested-by: Zheyu Ma Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 7ad36c8b2b80c8d296478f9854135d379cc63551 Author: Christoph Hellwig Date: Mon May 23 10:38:38 2022 +0200 scsi: core: Unexport scsi_bus_type scsi_bus_type is not used by any code outside of scsi_mod.ko. Link: https://lore.kernel.org/r/20220523083838.227987-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7274ce0558adb4b9b1f5c5b613fb4fe331c18911 Author: Christoph Hellwig Date: Mon May 23 10:38:13 2022 +0200 scsi: sd: Don't call blk_cleanup_disk() in sd_probe() In SCSI the midlayer has ownership of the request_queue, so on probe failure we must only put the gendisk, but leave the request_queue alone. Link: https://lore.kernel.org/r/20220523083813.227935-1-hch@lst.de Fixes: 03252259e18e ("scsi: sd: Clean up gendisk if device_add_disk() failed") Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 476e45923b5df19534178d0ed5c87c517dd6f669 Author: Dan Carpenter Date: Mon May 23 11:28:18 2022 +0300 scsi: ufs: ufshcd: Delete unnecessary NULL check The 'info' pointer points to somewhere in the middle of the 'hba' struct. It can't possibly be NULL. Delete the NULL check. Link: https://lore.kernel.org/r/YotFotj43TkB8Rid@kili Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 823ae99e09f7ada9e72c76cb2a9cc6a75a09971e Author: Julia Lawall Date: Sat May 21 13:11:41 2022 +0200 scsi: isci: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-91-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit f6e2694ebb2534f81bdc94501df3db589ba0aea9 Author: Julia Lawall Date: Sat May 21 13:11:39 2022 +0200 scsi: pmcraid: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-89-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit 8946ea283808d0905b11d12649976a227762d7e7 Author: Julia Lawall Date: Sat May 21 13:11:08 2022 +0200 scsi: smartpqi: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-58-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit 379ad771bb941dfcaa00d8c03667216eb74b8390 Author: Julia Lawall Date: Sat May 21 13:11:25 2022 +0200 scsi: qedf: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-75-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit 0676f275837ccab6c75a49bb0533ed519a0a9d7f Author: Julia Lawall Date: Sat May 21 13:10:50 2022 +0200 scsi: esas2r: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-40-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit 5445e08e115906163a39917c747b00083f88f270 Author: Julia Lawall Date: Sat May 21 13:10:22 2022 +0200 scsi: storvsc: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-12-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen commit d6ecaa0024485effd065124fe774de2e22095f2d Merge: 88699f8fbfd48 bf00745e7791f Author: Linus Torvalds Date: Mon May 23 19:46:50 2022 -0700 Merge tag 'x86_vdso_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 vdso update from Borislav Petkov: - Get rid of CONFIG_LEGACY_VSYSCALL_EMULATE as nothing should be using it anymore * tag 'x86_vdso_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/vsyscall: Remove CONFIG_LEGACY_VSYSCALL_EMULATE commit 88699f8fbfd482167362a881d37156cc3e2b0475 Merge: abc8babefbc1f 9c55d99e099bd Author: Linus Torvalds Date: Mon May 23 19:40:33 2022 -0700 Merge tag 'x86_microcode_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode loader update from Borislav Petkov: - Make CPU vendor dependency explicit against random config build failures * tag 'x86_microcode_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode: Add explicit CPU vendor dependency commit abc8babefbc1fc6f013573bc933d66bc906cf726 Merge: 3e2cbc016b1d0 1ef64b1e89e6d Author: Linus Torvalds Date: Mon May 23 19:32:59 2022 -0700 Merge tag 'x86_misc_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Borislav Petkov: "A variety of fixes which don't fit any other tip bucket: - Remove unnecessary function export - Correct asm constraint - Fix __setup handlers retval" * tag 'x86_misc_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Cleanup the control_va_addr_alignment() __setup handler x86: Fix return value of __setup handlers x86/delay: Fix the wrong asm constraint in delay_loop() x86/amd_nb: Unexport amd_cache_northbridges() commit 3e2cbc016b1d08463925db9b9bd3bd253f64b8b0 Merge: 916654201008d 0180a1e823d7c Author: Linus Torvalds Date: Mon May 23 19:24:47 2022 -0700 Merge tag 'x86_splitlock_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 splitlock updates from Borislav Petkov: - Add Raptor Lake to the set of CPU models which support splitlock - Make life miserable for apps using split locks by slowing them down considerably while the rest of the system remains responsive. The hope is it will hurt more and people will really fix their misaligned locks apps. As a result, free a TIF bit. * tag 'x86_splitlock_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/split_lock: Enable the split lock feature on Raptor Lake x86/split-lock: Remove unused TIF_SLD bit x86/split_lock: Make life miserable for split lockers commit 916654201008d5fb4d5f5dcf0b373d291da615ac Merge: e3228a86a33ba 7a116a2dd32d9 Author: Linus Torvalds Date: Mon May 23 19:16:09 2022 -0700 Merge tag 'x86_apic_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 APIC updates from Borislav Petkov: - Always do default APIC routing setup so that cpumasks are properly allocated and are present when later accessed ("nosmp" and x2APIC) - Clarify the bit overlap between an old APIC and a modern, integrated one * tag 'x86_apic_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Do apic driver probe for "nosmp" use case x86/apic: Clarify i82489DX bit overlap in APIC_LVT0 commit e3228a86a33ba7e2f4205c1a06fdd05cc5c4eeb5 Merge: 1abcb10d6edf5 b57a7c9dd732c Author: Linus Torvalds Date: Mon May 23 19:14:17 2022 -0700 Merge tag 'x86_kdump_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 kdump fixlet from Borislav Petkov: - A single debug message fix * tag 'x86_kdump_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/crash: Fix minor typo/bug in debug message commit 1abcb10d6edf5c4c53d29e9ab5488c7734183828 Merge: c415b53ad00d2 327c348988c6f Author: Linus Torvalds Date: Mon May 23 19:11:08 2022 -0700 Merge tag 'x86_platform_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform updates from Borislav Petkov: - A couple of changes enabling SGI UV5 support * tag 'x86_platform_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/uv: Log gap hole end size x86/platform/uv: Update TSC sync state for UV5 x86/platform/uv: Update NMI Handler for UV5 commit 9ccfc23a72b669678e4c9ccba98d3d91db1c04cf Author: Steve French Date: Mon May 23 20:54:04 2022 -0500 smb3: don't set rc when used and unneeded in query_info_compound rc is not checked so should not be set coming back from open_cached_dir (the cfid pointer is checked instead to see if open_cached_dir failed) Addresses-Coverity: 1518021 ("Code maintainability issues (UNUSED_VALUE)") Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit c415b53ad00d27a0655bbe7691dc005787da4f8d Merge: e36ae2290fd1f 944fad4583bc8 Author: Linus Torvalds Date: Mon May 23 18:59:24 2022 -0700 Merge tag 'x86_mm_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm fixlet from Borislav Petkov: - A sparse address space annotation fix * tag 'x86_mm_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fault: Cast an argument to the proper address space in prefetch() commit bbdf6cf56c88845fb0b713cbf5c6623c53fe40d8 Author: Steve French Date: Mon May 23 20:42:03 2022 -0500 smb3: check for null tcon Although unlikely to be null, it is confusing to use a pointer before checking for it to be null so move the use down after null check. Addresses-Coverity: 1517586 ("Null pointer dereferences (REVERSE_INULL)") Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit e36ae2290fd1ff3768c3688627e442cd11d4ca1e Merge: de8ac81747fca b91c0922bf1ed Author: Linus Torvalds Date: Mon May 23 18:49:16 2022 -0700 Merge tag 'x86_fpu_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fpu updates from Borislav Petkov: - Add support for XSAVEC - the Compacted XSTATE saving variant - and thus allow for guests to use this compacted XSTATE variant when the hypervisor exports that support - A variable shadowing cleanup * tag 'x86_fpu_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Cleanup variable shadowing x86/fpu/xsave: Support XSAVEC in the kernel commit de8ac81747fca15925f3488ead7804560cdea532 Merge: a13dc4d409387 69505e3d9a39a Author: Linus Torvalds Date: Mon May 23 18:42:07 2022 -0700 Merge tag 'x86_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core x86 updates from Borislav Petkov: - Remove all the code around GS switching on 32-bit now that it is not needed anymore - Other misc improvements * tag 'x86_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: bug: Use normal relative pointers in 'struct bug_entry' x86/nmi: Make register_nmi_handler() more robust x86/asm: Merge load_gs_index() x86/32: Remove lazy GS macros ELF: Remove elf_core_copy_kernel_regs() x86/32: Simplify ELF_CORE_COPY_REGS commit 93ed91c020aa4f021600a633f1f87790a5e50b91 Author: Steve French Date: Sun May 22 21:25:24 2022 -0500 cifs: fix minor compile warning Add ifdef around nodfs variable from patch: "cifs: don't call cifs_dfs_query_info_nonascii_quirk() if nodfs was set" which is unused when CONFIG_DFS_UPCALL is not set. Signed-off-by: Steve French commit a42078b9e8983c7e2dc9a6e86239735e3a558083 Author: Steve French Date: Sun May 22 21:14:42 2022 -0500 Add various fsctl structs Add missing structure definition for various newer fsctl operations - duplicate_extents_ex - get_integrity_information - query_file_regions - query_on_disk_volume_info And move some fsctl defintions to smbfs_common Signed-off-by: Steve French commit 22c5b91336546000020fb47f4b80f4cbae47e78b Author: Steve French Date: Sun May 22 18:30:38 2022 -0500 Add defines for various newer FSCTLs Checking MS-FSCC section 2.3 found six FSCTL defines that were missing Reviewed-by: David Disseldorp Signed-off-by: Steve French commit a13dc4d40938787cfc9e520ed426df4ebf48b1aa Merge: 1de564b8c1a6f d936411dc9cae Author: Linus Torvalds Date: Mon May 23 18:17:09 2022 -0700 Merge tag 'x86_cleanups_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Borislav Petkov: - Serious sanitization and cleanup of the whole APERF/MPERF and frequency invariance code along with removing the need for unnecessary IPIs - Finally remove a.out support - The usual trivial cleanups and fixes all over x86 * tag 'x86_cleanups_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits) x86: Remove empty files x86/speculation: Add missing srbds=off to the mitigations= help text x86/prctl: Remove pointless task argument x86/aperfperf: Make it correct on 32bit and UP kernels x86/aperfmperf: Integrate the fallback code from show_cpuinfo() x86/aperfmperf: Replace arch_freq_get_on_cpu() x86/aperfmperf: Replace aperfmperf_get_khz() x86/aperfmperf: Store aperf/mperf data for cpu frequency reads x86/aperfmperf: Make parts of the frequency invariance code unconditional x86/aperfmperf: Restructure arch_scale_freq_tick() x86/aperfmperf: Put frequency invariance aperf/mperf data into a struct x86/aperfmperf: Untangle Intel and AMD frequency invariance init x86/aperfmperf: Separate AP/BP frequency invariance init x86/smp: Move APERF/MPERF code where it belongs x86/aperfmperf: Dont wake idle CPUs in arch_freq_get_on_cpu() x86/process: Fix kernel-doc warning due to a changed function name x86: Remove a.out support x86/mm: Replace nodes_weight() with nodes_empty() where appropriate x86: Replace cpumask_weight() with cpumask_empty() where appropriate x86/pkeys: Remove __arch_set_user_pkey_access() declaration ... commit 1de564b8c1a6f9f8bf3a106daa0be9f2cba7d045 Merge: 42b682a30f86e aeb84412037b8 Author: Linus Torvalds Date: Mon May 23 18:15:44 2022 -0700 Merge tag 'x86_build_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build updates from Borislav Petkov: - Add a "make x86_debug.config" target which enables a bunch of useful config debug options when trying to debug an issue - A gcc-12 build warnings fix * tag 'x86_build_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Wrap literal addresses in absolute_pointer() x86/configs: Add x86 debugging Kconfig fragment plus docs commit 42b682a30f86e0ab10557dbfa437f01befb5a8ec Merge: c5a3d3c01e90e 036c07c0c3b8a Author: Linus Torvalds Date: Mon May 23 18:08:46 2022 -0700 Merge tag 'x86_asm_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 asm updates from Borislav Petkov: - A bunch of changes towards streamlining low level asm helpers' calling conventions so that former can be converted to C eventually - Simplify PUSH_AND_CLEAR_REGS so that it can be used at the system call entry paths instead of having opencoded, slightly different variants of it everywhere - Misc other fixes * tag 'x86_asm_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry: Fix register corruption in compat syscall objtool: Fix STACK_FRAME_NON_STANDARD reloc type linkage: Fix issue with missing symbol size x86/entry: Remove skip_r11rcx x86/entry: Use PUSH_AND_CLEAR_REGS for compat x86/entry: Simplify entry_INT80_compat() x86/mm: Simplify RESERVE_BRK() x86/entry: Convert SWAPGS to swapgs and remove the definition of SWAPGS x86/entry: Don't call error_entry() for XENPV x86/entry: Move CLD to the start of the idtentry macro x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry() x86/entry: Switch the stack after error_entry() returns x86/traps: Use pt_regs directly in fixup_bad_iret() commit c5a3d3c01e90e74166f95eec9db6fcc3ba72a9d6 Merge: 3a755ebcc2557 2147c438fde13 Author: Linus Torvalds Date: Mon May 23 18:01:31 2022 -0700 Merge tag 'x86_cpu_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 CPU feature updates from Borislav Petkov: - Remove a bunch of chicken bit options to turn off CPU features which are not really needed anymore - Misc fixes and cleanups * tag 'x86_cpu_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Add missing prototype for unpriv_ebpf_notify() x86/pm: Fix false positive kmemleak report in msr_build_context() x86/speculation/srbds: Do not try to turn mitigation off when not supported x86/cpu: Remove "noclflush" x86/cpu: Remove "noexec" x86/cpu: Remove "nosmep" x86/cpu: Remove CONFIG_X86_SMAP and "nosmap" x86/cpu: Remove "nosep" x86/cpu: Allow feature bit names from /proc/cpuinfo in clearcpuid= commit 3a755ebcc2557e22b895b8976257f682c653db1d Merge: 5b828263b180c c796f02162e42 Author: Linus Torvalds Date: Mon May 23 17:51:12 2022 -0700 Merge tag 'x86_tdx_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull Intel TDX support from Borislav Petkov: "Intel Trust Domain Extensions (TDX) support. This is the Intel version of a confidential computing solution called Trust Domain Extensions (TDX). This series adds support to run the kernel as part of a TDX guest. It provides similar guest protections to AMD's SEV-SNP like guest memory and register state encryption, memory integrity protection and a lot more. Design-wise, it differs from AMD's solution considerably: it uses a software module which runs in a special CPU mode called (Secure Arbitration Mode) SEAM. As the name suggests, this module serves as sort of an arbiter which the confidential guest calls for services it needs during its lifetime. Just like AMD's SNP set, this series reworks and streamlines certain parts of x86 arch code so that this feature can be properly accomodated" * tag 'x86_tdx_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (34 commits) x86/tdx: Fix RETs in TDX asm x86/tdx: Annotate a noreturn function x86/mm: Fix spacing within memory encryption features message x86/kaslr: Fix build warning in KASLR code in boot stub Documentation/x86: Document TDX kernel architecture ACPICA: Avoid cache flush inside virtual machines x86/tdx/ioapic: Add shared bit for IOAPIC base address x86/mm: Make DMA memory shared for TD guest x86/mm/cpa: Add support for TDX shared memory x86/tdx: Make pages shared in ioremap() x86/topology: Disable CPU online/offline control for TDX guests x86/boot: Avoid #VE during boot for TDX platforms x86/boot: Set CR0.NE early and keep it set during the boot x86/acpi/x86/boot: Add multiprocessor wake-up support x86/boot: Add a trampoline for booting APs via firmware handoff x86/tdx: Wire up KVM hypercalls x86/tdx: Port I/O: Add early boot support x86/tdx: Port I/O: Add runtime hypercalls x86/boot: Port I/O: Add decompression-time support for TDX x86/boot: Port I/O: Allow to hook up alternative helpers ... commit 5b828263b180c16037382e8ffddd0611a363aabe Merge: eb39e37d5cebd fa619f5156cf1 Author: Linus Torvalds Date: Mon May 23 17:47:19 2022 -0700 Merge tag 'ras_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Borislav Petkov: - Simplification of the AMD MCE error severity grading logic along with supplying critical panic MCEs with accompanying error messages for more human-friendly diagnostics. - Misc fixes * tag 'ras_core_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Add messages for panic errors in AMD's MCE grading x86/mce: Simplify AMD severity grading logic x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails x86/mce: Avoid unnecessary padding in struct mce_bank commit abd4fd43f2af03e2e852e6b1b98faeee9e3eae55 Author: Bagas Sanjaya Date: Wed May 18 15:35:24 2022 +0700 platform/chrome: Use imperative mood for ChromeOS ACPI sysfs ABI descriptions The current descriptions all begin with ("This file shows something") clause, which is incorrect wording since these mean return value from sysfs. Use imperative mood ("Returns something") instead, in line with corresponding ACPI documentation at firmware-guide/. Cc: Benson Leung Cc: Guenter Roeck Cc: Andy Shevchenko Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: Dmitry Torokhov Cc: Enric Balletbo i Serra Cc: Muhammad Usama Anjum Cc: Tzung-Bi Shih Cc: Linux Kernel Mailing List Cc: Linux Next Mailing List Signed-off-by: Bagas Sanjaya Reviewed-by: Muhammad Usama Anjum Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220518083524.37380-3-bagasdotme@gmail.com commit a6c13d87b4b7ae7f7f4574014f5478f7fe92540c Author: Bagas Sanjaya Date: Wed May 18 15:35:23 2022 +0700 platform/chrome: Use tables for values lists of ChromeOS ACPI sysfs ABI Stephen Rothwell reported htmldocs warning when merging chrome-platform tree: Documentation/ABI/testing/sysfs-driver-chromeos-acpi:2: WARNING: Unexpected indentation. Documentation/ABI/testing/sysfs-driver-chromeos-acpi:11: WARNING: Unexpected indentation. Documentation/ABI/testing/sysfs-driver-chromeos-acpi:22: WARNING: Unexpected indentation. Documentation/ABI/testing/sysfs-driver-chromeos-acpi:56: WARNING: Unexpected indentation. The warning is due to missing blank line separator surrounding values lists. Instead of using lists, use tables to be consistent with rest of sysfs ABI documentation. Link: https://lore.kernel.org/linux-next/20220516213832.19127535@canb.auug.org.au/ Fixes: 0a4cad9c11ad ("platform/chrome: Add ChromeOS ACPI device driver") Reported-by: Stephen Rothwell Cc: Benson Leung Cc: Guenter Roeck Cc: Andy Shevchenko Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: Dmitry Torokhov Cc: Enric Balletbo i Serra Cc: Muhammad Usama Anjum Cc: Tzung-Bi Shih Cc: Linux Kernel Mailing List Cc: Linux Next Mailing List Signed-off-by: Bagas Sanjaya Reviewed-by: Muhammad Usama Anjum Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220518083524.37380-2-bagasdotme@gmail.com [tzungbi: fix the Fixes tag to 12-chars hash.] Signed-off-by: Tzung-Bi Shih commit eb39e37d5cebdf0f63ee2a315fc23b035d81b4b0 Merge: 0be3ff0ccbfac ce6565282b3b1 Author: Linus Torvalds Date: Mon May 23 17:38:01 2022 -0700 Merge tag 'x86_sev_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull AMD SEV-SNP support from Borislav Petkov: "The third AMD confidential computing feature called Secure Nested Paging. Add to confidential guests the necessary memory integrity protection against malicious hypervisor-based attacks like data replay, memory remapping and others, thus achieving a stronger isolation from the hypervisor. At the core of the functionality is a new structure called a reverse map table (RMP) with which the guest has a say in which pages get assigned to it and gets notified when a page which it owns, gets accessed/modified under the covers so that the guest can take an appropriate action. In addition, add support for the whole machinery needed to launch a SNP guest, details of which is properly explained in each patch. And last but not least, the series refactors and improves parts of the previous SEV support so that the new code is accomodated properly and not just bolted on" * tag 'x86_sev_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (60 commits) x86/entry: Fixup objtool/ibt validation x86/sev: Mark the code returning to user space as syscall gap x86/sev: Annotate stack change in the #VC handler x86/sev: Remove duplicated assignment to variable info x86/sev: Fix address space sparse warning x86/sev: Get the AP jump table address from secrets page x86/sev: Add missing __init annotations to SEV init routines virt: sevguest: Rename the sevguest dir and files to sev-guest virt: sevguest: Change driver name to reflect generic SEV support x86/boot: Put globals that are accessed early into the .data section x86/boot: Add an efi.h header for the decompressor virt: sevguest: Fix bool function returning negative value virt: sevguest: Fix return value check in alloc_shared_pages() x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() virt: sevguest: Add documentation for SEV-SNP CPUID Enforcement virt: sevguest: Add support to get extended report virt: sevguest: Add support to derive key virt: Add SEV-SNP guest driver x86/sev: Register SEV-SNP guest request platform device x86/sev: Provide support for SNP guest request NAEs ... commit 0be3ff0ccbfacb1bcc56e2ec9c1c5d92cf9a64d3 Merge: 03e1ccd45fa70 be80a1ca5119c Author: Linus Torvalds Date: Mon May 23 17:34:20 2022 -0700 Merge tag 'edac_updates_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - Switch ghes_edac to use the CPER error reporting routines and simplify the code considerably this way - Rip out the silly edac_align_ptr() contraption which was computing the size of the private structures of each driver and thus allowing for a one-shot memory allocation. This was clearly unnecessary and confusing so switch to simple and boring kmalloc* calls. - Last but not least, the usual garden variety of fixes, cleanups and improvements all over EDAC land * tag 'edac_updates_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/xgene: Fix typo processsors -> processors EDAC/i5100: Remove unused inline function i5100_nrecmema_dm_buf_id() EDAC: Use kcalloc() EDAC/ghes: Change ghes_hw from global to static EDAC/armada_xp: Use devm_platform_ioremap_resource() EDAC/synopsys: Add a SPDX identifier EDAC/synopsys: Add driver support for i.MX platforms EDAC/dmc520: Don't print an error for each unconfigured interrupt line EDAC/mc: Get rid of edac_align_ptr() EDAC/device: Sanitize edac_device_alloc_ctl_info() definition EDAC/device: Get rid of the silly one-shot memory allocation in edac_device_alloc_ctl_info() EDAC/pci: Get rid of the silly one-shot memory allocation in edac_pci_alloc_ctl_info() EDAC/mc: Get rid of silly one-shot struct allocation in edac_mc_alloc() efi/cper: Reformat CPER memory error location to more readable EDAC/ghes: Unify CPER memory error location reporting efi/cper: Add a cper_mem_err_status_str() to decode error description powerpc/85xx: Remove fsl,85... bindings commit 03e1ccd45fa70904e43ddceda140854d22b7e871 Merge: 6e01f86fb2025 c25f23459c117 Author: Linus Torvalds Date: Mon May 23 17:18:25 2022 -0700 Merge tag 'x86-irq-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 PCI irq routing updates from Thomas Gleixner: - Cleanup and robustify the PCI interrupt routing table handling including proper range checks - Add support for Intel 82378ZB/82379AB, SiS85C497 PIRQ routers - Fix the ALi M1487 router handling - Handle the IRT routing table format in AMI BIOSes correctly * tag 'x86-irq-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/PCI: Fix coding style in PIRQ table verification x86/PCI: Fix ALi M1487 (IBC) PIRQ router link value interpretation x86/PCI: Add $IRT PIRQ routing table support x86/PCI: Handle PIRQ routing tables with no router device given x86/PCI: Add PIRQ routing table range checks x86/PCI: Add support for the SiS85C497 PIRQ router x86/PCI: Disambiguate SiS85C503 PIRQ router code entities x86/PCI: Handle IRQ swizzling with PIRQ routers x86/PCI: Also match function number in $PIR table x86/PCI: Include function number in $PIR table dump x86/PCI: Show the physical address of the $PIR table commit 6e01f86fb2025111c77101254f1442ac137089cd Merge: fcfde8a7cf6d5 317f29c14d0cc Author: Linus Torvalds Date: Mon May 23 17:05:55 2022 -0700 Merge tag 'timers-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer and timekeeping updates from Thomas Gleixner: - Expose CLOCK_TAI to instrumentation to aid with TSN debugging. - Ensure that the clockevent is stopped when there is no timer armed to avoid pointless wakeups. - Make the sched clock frequency handling and rounding consistent. - Provide a better debugobject hint for delayed works. The timer callback is always the same, which makes it difficult to identify the underlying work. Use the work function as a hint instead. - Move the timer specific sysctl code into the timer subsystem. - The usual set of improvements and cleanups * tag 'timers-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timers: Provide a better debugobjects hint for delayed works time/sched_clock: Fix formatting of frequency reporting code time/sched_clock: Use Hz as the unit for clock rate reporting below 4kHz time/sched_clock: Round the frequency reported to nearest rather than down timekeeping: Consolidate fast timekeeper timekeeping: Annotate ktime_get_boot_fast_ns() with data_race() timers/nohz: Switch to ONESHOT_STOPPED in the low-res handler when the tick is stopped timekeeping: Introduce fast accessor to clock tai tracing/timer: Add missing argument documentation of trace points clocksource: Replace cpumask_weight() with cpumask_empty() timers: Move timer sysctl into the timer code clockevents: Use dedicated list iterator variable timers: Simplify calc_index() timers: Initialize base::next_expiry_recalc in timers_prepare_cpu() commit fcfde8a7cf6d5e347ce61d8e5c0aee52926ef8e9 Merge: 28c8f9fe94c4e cdb4913293897 Author: Linus Torvalds Date: Mon May 23 16:58:49 2022 -0700 Merge tag 'irq-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull interrupt handling updates from Thomas Gleixner: "Core code: - Make the managed interrupts more robust by shutting them down in the core code when the assigned affinity mask does not contain online CPUs. - Make the irq simulator chip work on RT - A small set of cpumask and power manageent cleanups Drivers: - A set of changes which mark GPIO interrupt chips immutable to prevent the GPIO subsystem from modifying it under the hood. This provides the necessary infrastructure and converts a set of GPIO and pinctrl drivers over. - A set of changes to make the pseudo-NMI handling for GICv3 more robust: a missing barrier and consistent handling of the priority mask. - Another set of GICv3 improvements and fixes, but nothing outstanding - The usual set of improvements and cleanups all over the place - No new irqchip drivers and not even a new device tree binding! 100+ interrupt chips are truly enough" * tag 'irq-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) irqchip: Add Kconfig symbols for sunxi drivers irqchip/gic-v3: Fix priority mask handling irqchip/gic-v3: Refactor ISB + EOIR at ack time irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling genirq/irq_sim: Make the irq_work always run in hard irq context irqchip/armada-370-xp: Do not touch Performance Counter Overflow on A375, A38x, A39x irqchip/gic: Improved warning about incorrect type irqchip/csky: Return true/false (not 1/0) from bool functions irqchip/imx-irqsteer: Add runtime PM support irqchip/imx-irqsteer: Constify irq_chip struct irqchip/armada-370-xp: Enable MSI affinity configuration irqchip/aspeed-scu-ic: Fix irq_of_parse_and_map() return value irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value irqchip/sun6i-r: Use NULL for chip_data irqchip/xtensa-mx: Fix initial IRQ affinity in non-SMP setup irqchip/exiu: Fix acknowledgment of edge triggered interrupts irqchip/gic-v3: Claim iomem resources dt-bindings: interrupt-controller: arm,gic-v3: Make the v2 compat requirements explicit irqchip/gic-v3: Relax polling of GIC{R,D}_CTLR.RWP irqchip/gic-v3: Detect LPI invalidation MMIO registers ... commit 28c8f9fe94c4e0b0c27383d48da3c85b0dc17081 Merge: 985564eb3e3c2 d308077e5e4dc Author: Linus Torvalds Date: Mon May 23 16:55:36 2022 -0700 Merge tag 'smp-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull CPU hotplug updates from Thomas Gleixner: - Initialize the per-CPU structures during early boot so that the state is consistent from the very beginning. - Make the virtualization hotplug state handling more robust and let the core bringup CPUs which timed out in an earlier attempt again. - Make the x86/xen CPU state tracking consistent on a failed online attempt, so a consecutive bringup does not fall over the inconsistent state. * tag 'smp-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier cpu/hotplug: Allow the CPU in CPU_UP_PREPARE state to be brought up again. x86/xen: Allow to retry if cpu_initialize_context() failed. commit 985564eb3e3c2024af222525e8e052b3336a6775 Merge: 4b57dccc42a79 9e4a51ad8eee1 Author: Linus Torvalds Date: Mon May 23 16:40:12 2022 -0700 Merge tag 'core-debugobjects-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull debugobjects fixlet from Thomas Gleixner: "Trivial licensing cleanup in debugobjects" * tag 'core-debugobjects-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Convert to SPDX license identifier commit 4b57dccc42a790cdf2a8cad110143feb8b35e563 Merge: 140e40e39a29c 75d8cce128c51 Author: Linus Torvalds Date: Mon May 23 16:37:35 2022 -0700 Merge tag 'core-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irqpoll update from Thomas Gleixner: "A single update for irqpoll: Ensure that a raised soft interrupt is handled after pulling the blk_cpu_iopoll backlog from a unplugged CPU. This prevents that the CPU which runs that code reaches idle with soft interrupts pending" * tag 'core-core-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lib/irq_poll: Prevent softirq pending leak in irq_poll_cpu_dead() commit 1ef0736c0711e2633a59b540931406de626f2836 Merge: 9fa87dd232515 608b638ebf368 Author: Jakub Kicinski Date: Mon May 23 16:07:13 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-05-23 We've added 113 non-merge commits during the last 26 day(s) which contain a total of 121 files changed, 7425 insertions(+), 1586 deletions(-). The main changes are: 1) Speed up symbol resolution for kprobes multi-link attachments, from Jiri Olsa. 2) Add BPF dynamic pointer infrastructure e.g. to allow for dynamically sized ringbuf reservations without extra memory copies, from Joanne Koong. 3) Big batch of libbpf improvements towards libbpf 1.0 release, from Andrii Nakryiko. 4) Add BPF link iterator to traverse links via seq_file ops, from Dmitrii Dolgov. 5) Add source IP address to BPF tunnel key infrastructure, from Kaixi Fan. 6) Refine unprivileged BPF to disable only object-creating commands, from Alan Maguire. 7) Fix JIT blinding of ld_imm64 when they point to subprogs, from Alexei Starovoitov. 8) Add BPF access to mptcp_sock structures and their meta data, from Geliang Tang. 9) Add new BPF helper for access to remote CPU's BPF map elements, from Feng Zhou. 10) Allow attaching 64-bit cookie to BPF link of fentry/fexit/fmod_ret, from Kui-Feng Lee. 11) Follow-ups to typed pointer support in BPF maps, from Kumar Kartikeya Dwivedi. 12) Add busy-poll test cases to the XSK selftest suite, from Magnus Karlsson. 13) Improvements in BPF selftest test_progs subtest output, from Mykola Lysenko. 14) Fill bpf_prog_pack allocator areas with illegal instructions, from Song Liu. 15) Add generic batch operations for BPF map-in-map cases, from Takshak Chahande. 16) Make bpf_jit_enable more user friendly when permanently on 1, from Tiezhu Yang. 17) Fix an array overflow in bpf_trampoline_get_progs(), from Yuntao Wang. ==================== Link: https://lore.kernel.org/r/20220523223805.27931-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 9fa87dd23251574a29cf948fd16cf39075762f3e Merge: b1e6738a2185f 8f445a3ec3fd3 Author: Jakub Kicinski Date: Mon May 23 15:59:41 2022 -0700 Merge tag 'linux-can-next-for-5.19-20220523' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-05-23 this is a pull request of 3 patches for net-next/master. The first patch is by Julia Lawall and fixes a typo in the peak_usb driver. Jakub Kicinski contributes a patch for the kvaser_usb driver to silence a GCC 12 -Warray-bounds warning. The last patch is by me, target the ctucanfd platform driver and adds a missing dependency to HAS_IOMEM. * tag 'linux-can-next-for-5.19-20220523' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: ctucanfd: platform: add missing dependency to HAS_IOMEM can: kvaser_usb: silence a GCC 12 -Warray-bounds warning can: peak_usb: fix typo in comment ==================== Link: https://lore.kernel.org/r/20220523201045.1708855-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit d036d915b61f23b9e80d93f8a606eebf3bfab73f Author: Julia Lawall Date: Sat May 21 13:11:09 2022 +0200 of/irq: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220521111145.81697-59-Julia.Lawall@inria.fr commit 140e40e39a29c7dbc188d9b43831c3d5e089c960 Merge: 8a32f81a89cf3 31a644b3c2ae6 Author: Linus Torvalds Date: Mon May 23 14:36:45 2022 -0700 Merge tag 'zonefs-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs updates from Damien Le Moal: "This improves zonefs open sequential file accounting and adds accounting for active sequential files to allow the user to handle the maximum number of active zones of an NVMe ZNS drive. sysfs attributes for both open and active sequential files are also added to facilitate access to this information from applications without resorting to inspecting the block device limits" * tag 'zonefs-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: documentation: zonefs: Document sysfs attributes documentation: zonefs: Cleanup the mount options section zonefs: Add active seq file accounting zonefs: Export open zone resource information through sysfs zonefs: Always do seq file write open accounting zonefs: Rename super block information fields zonefs: Fix management of open zones zonefs: Clear inode information flags on inode creation commit b1e6738a2185fd7626a6187050a3edf9c38c2afe Merge: fe7324b932222 edcb185fa9c4f Author: Jakub Kicinski Date: Mon May 23 14:36:36 2022 -0700 Merge tag 'for-net-next-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Luiz Augusto von Dentz says: ==================== bluetooth-next pull request for net-next: - Add support for Realtek 8761BUV - Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk - Add support for RTL8852C - Add a new PID/VID 0489/e0c8 for MT7921 - Add support for Qualcomm WCN785x * tag 'for-net-next-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (26 commits) Bluetooth: hci_sync: use hci_skb_event() helper Bluetooth: eir: Add helpers for managing service data Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan Bluetooth: MGMT: Add conditions for setting HCI_CONN_FLAG_REMOTE_WAKEUP Bluetooth: btmtksdio: fix the reset takes too long Bluetooth: btmtksdio: fix possible FW initialization failure Bluetooth: btmtksdio: fix use-after-free at btmtksdio_recv_event Bluetooth: btbcm: Add entry for BCM4373A0 UART Bluetooth Bluetooth: btusb: Add a new PID/VID 0489/e0c8 for MT7921 Bluetooth: btusb: Add 0x0bda:0x8771 Realtek 8761BUV devices Bluetooth: btusb: Set HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for QCA Bluetooth: core: Fix missing power_on work cancel on HCI close Bluetooth: btusb: add support for Qualcomm WCN785x Bluetooth: protect le accept and resolv lists with hdev->lock Bluetooth: use hdev lock for accept_list and reject_list in conn req Bluetooth: use hdev lock in activate_scan for hci_is_adv_monitoring Bluetooth: btrtl: Add support for RTL8852C Bluetooth: btusb: Set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for QCA Bluetooth: Print broken quirks Bluetooth: HCI: Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk ... ==================== Link: https://lore.kernel.org/r/20220523204151.3327345-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 7fb0269720d7d5359bc8349eef908a1c96866b65 Merge: 8c3b8dc5cc9bf c9f73a2178c12 Author: Jakub Kicinski Date: Mon May 23 14:33:38 2022 -0700 Merge tag 'for-net-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix crash when an LE Connection fails to be established. * tag 'for-net-2022-05-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: hci_conn: Fix hci_connect_le_sync ==================== Link: https://lore.kernel.org/r/20220523200349.3322806-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 608b638ebf368f18431f47bbbd0d93828cbbdf83 Merge: 1ec5ee8c8a5a6 0cf7052a55128 Author: Andrii Nakryiko Date: Mon May 23 14:30:18 2022 -0700 Merge branch 'Dynamic pointers' Joanne Koong says: ==================== This patchset implements the basics of dynamic pointers in bpf. A dynamic pointer (struct bpf_dynptr) is a pointer that stores extra metadata alongside the address it points to. This abstraction is useful in bpf given that every memory access in a bpf program must be safe. The verifier and bpf helper functions can use the metadata to enforce safety guarantees for things such as dynamically sized strings and kernel heap allocations. From the program side, the bpf_dynptr is an opaque struct and the verifier will enforce that its contents are never written to by the program. It can only be written to through specific bpf helper functions. There are several uses cases for dynamic pointers in bpf programs. Some examples include: dynamically sized ringbuf reservations without extra memcpys, dynamic string parsing and memory comparisons, dynamic memory allocations that can be persisted in maps, and dynamic + ergonomic parsing of sk_buff and xdp_md packet data. At a high-level, the patches are as follows: 1/6 - Adds verifier support for dynptrs 2/6 - Adds bpf_dynptr_from_mem (local dynptr) 3/6 - Adds dynptr support for ring buffers 4/6 - Adds bpf_dynptr_read and bpf_dynptr_write 5/6 - Adds dynptr data slices (ptr to the dynptr data) 6/6 - Tests to check that the verifier rejects invalid cases and passes valid ones This is the first dynptr patchset in a larger series. The next series of patches will add dynptrs that support dynamic memory allocations that can also be persisted in maps, support for parsing packet data through dynptrs, convenience helpers for using dynptrs as iterators, and more helper functions for interacting with strings and memory dynamically. Changelog: ---------- v5 -> v6: v5: https://lore.kernel.org/bpf/20220520044245.3305025-1-joannelkoong@gmail.com/ * enforce PTR_TO_MAP_VALUE for bpf_dynptr_from_mem data in check_helper_call instead of using DYNPTR_TYPE_LOCAL when checking func arg compatiblity * remove MEM_DYNPTR modifier v4 -> v5: v4: https://lore.kernel.org/bpf/20220509224257.3222614-1-joannelkoong@gmail.com/ * Remove malloc dynptr; this will be part of the 2nd patchset while we figure out memory accounting * For data slices, only set the register's ref_obj_id to dynptr_id (Alexei) * Tidying (eg remove "inline", move offset checking to "check_func_arg_reg_off") (David) * Add a few new test cases, remove malloc-only ones. v3 -> v4: v3: https://lore.kernel.org/bpf/20220428211059.4065379-1-joannelkoong@gmail.com/ 1/6 - Change mem ptr + size check to use more concise inequality expression (David + Andrii) 2/6 - Add check for meta->uninit_dynptr_regno not already set (Andrii) Move DYNPTR_TYPE_FLAG_MASK to include/linux/bpf.h (Andrii) 3/6 - Remove four underscores for invoking BPF_CALL (Andrii) Add __BPF_TYPE_FLAG_MAX and use it for __BPF_TYPE_LAST_FLAG (Andrii) 4/6 - Fix capacity to be bpf_dynptr size value in check_off_len (Andrii) Change -EINVAL to -E2BIG if len + offset is out of bounds (Andrii) 5/6 - Add check for only 1 dynptr arg for dynptr data function (Andrii) 6/6 - For ringbuf map, set max_entries from userspace (Andrii) Use err ?: ... for interactring with dynptr APIs (Andrii) Define array_map2 for add_dynptr_to_map2 test where value is a struct with an embedded dynptr Remove ref id from missing_put_callback message, since on different environments, ref id is not always = 1 v2 -> v3: v2: https://lore.kernel.org/bpf/20220416063429.3314021-1-joannelkoong@gmail.com/ * Reorder patches (move ringbuffer patch to be right after the verifier + * malloc dynptr patchset) * Remove local type dynptrs (Andrii + Alexei) * Mark stack slot as STACK_MISC after any writes into a dynptr instead of * explicitly prohibiting writes (Alexei) * Pass number of slots, not memory size to is_spi_bounds_valid (Kumar) * Check reference leaks by adding dynptr id to state->refs instead of checking stack slots (Alexei) v1 -> v2: v1: https://lore.kernel.org/bpf/20220402015826.3941317-1-joannekoong@fb.com/ 1/7 - * Remove ARG_PTR_TO_MAP_VALUE_UNINIT alias and use ARG_PTR_TO_MAP_VALUE | MEM_UNINIT directly (Andrii) * Drop arg_type_is_mem_ptr() wrapper function (Andrii) 2/7 - * Change name from MEM_RELEASE to OBJ_RELEASE (Andrii) * Use meta.release_ref instead of ref_obj_id != 0 to determine whether to release reference (Kumar) * Drop type_is_release_mem() wrapper function (Andrii) 3/7 - * Add checks for nested dynptrs edge-cases, which could lead to corrupt * writes of the dynptr stack variable. * Add u64 flags to bpf_dynptr_from_mem() and bpf_dynptr_alloc() (Andrii) * Rename from bpf_malloc/bpf_free to bpf_dynptr_alloc/bpf_dynptr_put (Alexei) * Support alloc flag __GFP_ZERO (Andrii) * Reserve upper 8 bits in dynptr size and offset fields instead of reserving just the upper 4 bits (Andrii) * Allow dynptr zero-slices (Andrii) * Use the highest bit for is_rdonly instead of the 28th bit (Andrii) * Rename check_* functions to is_* functions for better readability (Andrii) * Add comment for code that checks the spi bounds (Andrii) 4/7 - * Fix doc description for bpf_dynpt_read (Toke) * Move bpf_dynptr_check_off_len() from function patch 1 to here (Andrii) 5/7 - * When finding the id for the dynptr to associate the data slice with, look for dynptr arg instead of assuming it is BPF_REG_1. 6/7 - * Add __force when casting from unsigned long to void * (kernel test * robot) * Expand on docs for ringbuf dynptr APIs (Andrii) 7/7 - * Use table approach for defining test programs and error messages * (Andrii) * Print out full log if there’s an error (Andrii) * Use bpf_object__find_program_by_name() instead of specifying program name as a string (Andrii) * Add 6 extra cases: invalid_nested_dynptrs1, invalid_nested_dynptrs2, invalid_ref_mem1, invalid_ref_mem2, zero_slice_access, and test_alloc_zero_bytes * Add checking for edge cases (eg allocing with invalid flags) ==================== Signed-off-by: Andrii Nakryiko commit 0cf7052a55128f7fd7905f6ae6eb995d6db76b52 Author: Joanne Koong Date: Mon May 23 14:07:12 2022 -0700 selftests/bpf: Dynptr tests This patch adds tests for dynptrs, which include cases that the verifier needs to reject (for example, a bpf_ringbuf_reserve_dynptr without a corresponding bpf_ringbuf_submit/discard_dynptr) as well as cases that should successfully pass. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220523210712.3641569-7-joannelkoong@gmail.com commit 34d4ef5775f776ec4b0d53a02d588bf3195cada6 Author: Joanne Koong Date: Mon May 23 14:07:11 2022 -0700 bpf: Add dynptr data slices This patch adds a new helper function void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len); which returns a pointer to the underlying data of a dynptr. *len* must be a statically known value. The bpf program may access the returned data slice as a normal buffer (eg can do direct reads and writes), since the verifier associates the length with the returned pointer, and enforces that no out of bounds accesses occur. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220523210712.3641569-6-joannelkoong@gmail.com commit 13bbbfbea7598ea9f8d9c3d73bf053bb57f9c4b2 Author: Joanne Koong Date: Mon May 23 14:07:10 2022 -0700 bpf: Add bpf_dynptr_read and bpf_dynptr_write This patch adds two helper functions, bpf_dynptr_read and bpf_dynptr_write: long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset); long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len); The dynptr passed into these functions must be valid dynptrs that have been initialized. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220523210712.3641569-5-joannelkoong@gmail.com commit bc34dee65a65e9c920c420005b8a43f2a721a458 Author: Joanne Koong Date: Mon May 23 14:07:09 2022 -0700 bpf: Dynptr support for ring buffers Currently, our only way of writing dynamically-sized data into a ring buffer is through bpf_ringbuf_output but this incurs an extra memcpy cost. bpf_ringbuf_reserve + bpf_ringbuf_commit avoids this extra memcpy, but it can only safely support reservation sizes that are statically known since the verifier cannot guarantee that the bpf program won’t access memory outside the reserved space. The bpf_dynptr abstraction allows for dynamically-sized ring buffer reservations without the extra memcpy. There are 3 new APIs: long bpf_ringbuf_reserve_dynptr(void *ringbuf, u32 size, u64 flags, struct bpf_dynptr *ptr); void bpf_ringbuf_submit_dynptr(struct bpf_dynptr *ptr, u64 flags); void bpf_ringbuf_discard_dynptr(struct bpf_dynptr *ptr, u64 flags); These closely follow the functionalities of the original ringbuf APIs. For example, all ringbuffer dynptrs that have been reserved must be either submitted or discarded before the program exits. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Acked-by: David Vernet Link: https://lore.kernel.org/bpf/20220523210712.3641569-4-joannelkoong@gmail.com commit 263ae152e96253f40c2c276faad8629e096b3bad Author: Joanne Koong Date: Mon May 23 14:07:08 2022 -0700 bpf: Add bpf_dynptr_from_mem for local dynptrs This patch adds a new api bpf_dynptr_from_mem: long bpf_dynptr_from_mem(void *data, u32 size, u64 flags, struct bpf_dynptr *ptr); which initializes a dynptr to point to a bpf program's local memory. For now only local memory that is of reg type PTR_TO_MAP_VALUE is supported. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220523210712.3641569-3-joannelkoong@gmail.com commit 97e03f521050c092919591e668107b3d69c5f426 Author: Joanne Koong Date: Mon May 23 14:07:07 2022 -0700 bpf: Add verifier support for dynptrs This patch adds the bulk of the verifier work for supporting dynamic pointers (dynptrs) in bpf. A bpf_dynptr is opaque to the bpf program. It is a 16-byte structure defined internally as: struct bpf_dynptr_kern { void *data; u32 size; u32 offset; } __aligned(8); The upper 8 bits of *size* is reserved (it contains extra metadata about read-only status and dynptr type). Consequently, a dynptr only supports memory less than 16 MB. There are different types of dynptrs (eg malloc, ringbuf, ...). In this patchset, the most basic one, dynptrs to a bpf program's local memory, is added. For now only local memory that is of reg type PTR_TO_MAP_VALUE is supported. In the verifier, dynptr state information will be tracked in stack slots. When the program passes in an uninitialized dynptr (ARG_PTR_TO_DYNPTR | MEM_UNINIT), the stack slots corresponding to the frame pointer where the dynptr resides at are marked STACK_DYNPTR. For helper functions that take in initialized dynptrs (eg bpf_dynptr_read + bpf_dynptr_write which are added later in this patchset), the verifier enforces that the dynptr has been initialized properly by checking that their corresponding stack slots have been marked as STACK_DYNPTR. The 6th patch in this patchset adds test cases that the verifier should successfully reject, such as for example attempting to use a dynptr after doing a direct write into it inside the bpf program. Signed-off-by: Joanne Koong Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Acked-by: David Vernet Link: https://lore.kernel.org/bpf/20220523210712.3641569-2-joannelkoong@gmail.com commit 1ec5ee8c8a5a65ea377f8bea64bf4d5b743f6f79 Author: Kumar Kartikeya Dwivedi Date: Sat May 21 18:56:20 2022 +0530 bpf: Suppress 'passing zero to PTR_ERR' warning Kernel Test Robot complains about passing zero to PTR_ERR for the said line, suppress it by using PTR_ERR_OR_ZERO. Fixes: c0a5a21c25f3 ("bpf: Allow storing referenced kptr in map") Reported-by: kernel test robot Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220521132620.1976921-1-memxor@gmail.com commit 8a32f81a89cf3b0b0e1cc626f7f7777f62adf99d Merge: 5dc921868c507 71abb4df29815 Author: Linus Torvalds Date: Mon May 23 14:14:50 2022 -0700 Merge tag 'ata-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata updates from Damien Le Moal: "For this cycle, the libata.force kernel parameter changes stand out. Beside that, some small cleanups in various drivers. In more detail: - Changes to the pata_mpc52xx driver in preparation for powerpc's asm/prom.h cleanup, from Christophe. - Improved ATA command allocation, from John. - Various small cleanups to the pata_via, pata_sil680, pata_ftide010, sata_gemini, ahci_brcm drivers and to libata-core, from Sergey, Diego, Ruyi, Mighao and Jiabing. - Add support for the RZ/G2H SoC to the rcar-sata driver, from Lad. - AHCI RAID ID cleanup, from Dan. - Improvement to the libata.force kernel parameter to allow most horkage flags to be manually forced for debugging drive issues in the field without needing recompiling a kernel, from me" * tag 'ata-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_ftide010: Remove unneeded ERROR check before clk_disable_unprepare doc: admin-guide: Update libata kernel parameters ata: libata-core: Allow forcing most horkage flags ata: libata-core: Improve link flags forced settings ata: libata-core: Refactor force_tbl definition ata: libata-core: cleanup ata_device_blacklist ata: simplify the return expression of brcm_ahci_remove ata: Make use of the helper function devm_platform_ioremap_resource() ata: libata-core: replace "its" with "it is" ahci: Add a generic 'controller2' RAID id dt-bindings: ata: renesas,rcar-sata: Add r8a774e1 support ata: pata_via: fix sloppy typing in via_do_set_mode() ata: pata_sil680: fix result type of sil680_sel{dev|reg}() ata: libata-core: fix parameter type in ata_xfer_mode2shift() libata: Improve ATA queued command allocation ata: pata_mpc52xx: Prepare cleanup of powerpc's asm/prom.h commit fe736565efb775620dbcf3c459c1cd80d3e868da Author: Song Liu Date: Fri May 20 16:57:53 2022 -0700 bpf: Introduce bpf_arch_text_invalidate for bpf_prog_pack Introduce bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with illegal instructions when a BPF program is freed. Fixes: 57631054fae6 ("bpf: Introduce bpf_prog_pack allocator") Fixes: 33c9805860e5 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]") Reported-by: Linus Torvalds Signed-off-by: Song Liu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220520235758.1858153-4-song@kernel.org commit aadd1b678ebef81cc3ed23663253ae3749cdc673 Author: Song Liu Date: Fri May 20 16:57:52 2022 -0700 x86/alternative: Introduce text_poke_set Introduce a memset like API for text_poke. This will be used to fill the unused RX memory with illegal instructions. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Song Liu Signed-off-by: Daniel Borkmann Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/bpf/20220520235758.1858153-3-song@kernel.org commit d88bb5eed04ce50cc20e7f9282977841728be798 Author: Song Liu Date: Fri May 20 16:57:51 2022 -0700 bpf: Fill new bpf_prog_pack with illegal instructions bpf_prog_pack enables sharing huge pages among multiple BPF programs. These pages are marked as executable before the JIT engine fill it with BPF programs. To make these pages safe, fill the hole bpf_prog_pack with illegal instructions before making it executable. Fixes: 57631054fae6 ("bpf: Introduce bpf_prog_pack allocator") Fixes: 33c9805860e5 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]") Reported-by: Linus Torvalds Signed-off-by: Song Liu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220520235758.1858153-2-song@kernel.org commit 5dc921868c507c1f0835932d3f255cf1b7415618 Merge: 115cd47132d71 537b9f2bf60f4 Author: Linus Torvalds Date: Mon May 23 14:04:14 2022 -0700 Merge tag 'for-5.19/drivers-2022-05-22' of git://git.kernel.dk/linux-block Pull block driver updates from Jens Axboe: "Here are the driver updates queued up for 5.19. This contains: - NVMe pull requests via Christoph: - tighten the PCI presence check (Stefan Roese) - fix a potential NULL pointer dereference in an error path (Kyle Miller Smith) - fix interpretation of the DMRSL field (Tom Yan) - relax the data transfer alignment (Keith Busch) - verbose error logging improvements (Max Gurtovoy, Chaitanya Kulkarni) - misc cleanups (Chaitanya Kulkarni, Christoph) - set non-mdts limits in nvme_scan_work (Chaitanya Kulkarni) - add support for TP4084 - Time-to-Ready Enhancements (Christoph) - MD pull request via Song: - Improve annotation in raid5 code, by Logan Gunthorpe - Support MD_BROKEN flag in raid-1/5/10, by Mariusz Tkaczyk - Other small fixes/cleanups - null_blk series making the configfs side much saner (Damien) - Various minor drbd cleanups and fixes (Haowen, Uladzislau, Jiapeng, Arnd, Cai) - Avoid using the system workqueue (and hence flushing it) in rnbd (Jack) - Avoid using the system workqueue (and hence flushing it) in aoe (Tetsuo) - Series fixing discard_alignment issues in drivers (Christoph) - Small series fixing drivers poking at disk->part0 for openers information (Christoph) - Series fixing deadlocks in loop (Christoph, Tetsuo) - Remove loop.h and add SPDX headers (Christoph) - Various fixes and cleanups (Julia, Xie, Yu)" * tag 'for-5.19/drivers-2022-05-22' of git://git.kernel.dk/linux-block: (72 commits) mtip32xx: fix typo in comment nvme: set non-mdts limits in nvme_scan_work nvme: add support for TP4084 - Time-to-Ready Enhancements nvme: split the enum used for various register constants nbd: Fix hung on disconnect request if socket is closed before nvme-fabrics: add a request timeout helper nvme-pci: harden drive presence detect in nvme_dev_disable() nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags nvme: mark internal passthru request RQF_QUIET nvme: remove unneeded include from constants file nvme: add missing status values to verbose logging nvme: set dma alignment to dword nvme: fix interpretation of DMRSL loop: remove most the top-of-file boilerplate comment from the UAPI header loop: remove most the top-of-file boilerplate comment loop: add a SPDX header loop: remove loop.h block: null_blk: Improve device creation with configfs block: null_blk: Cleanup messages block: null_blk: Cleanup device creation and deletion ... commit 115cd47132d71bd7e4aa1093e15d861a59e73a94 Merge: f6792c877a1ca 2aaf516084184 Author: Linus Torvalds Date: Mon May 23 13:56:39 2022 -0700 Merge tag 'for-5.19/block-2022-05-22' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: "Here are the core block changes for 5.19. This contains: - blk-throttle accounting fix (Laibin) - Series removing redundant assignments (Michal) - Expose bio cache via the bio_set, so that DM can use it (Mike) - Finish off the bio allocation interface cleanups by dealing with the weirdest member of the family. bio_kmalloc combines a kmalloc for the bio and bio_vecs with a hidden bio_init call and magic cleanup semantics (Christoph) - Clean up the block layer API so that APIs consumed by file systems are (almost) only struct block_device based, so that file systems don't have to poke into block layer internals like the request_queue (Christoph) - Clean up the blk_execute_rq* API (Christoph) - Clean up various lose end in the blk-cgroup code to make it easier to follow in preparation of reworking the blkcg assignment for bios (Christoph) - Fix use-after-free issues in BFQ when processes with merged queues get moved to different cgroups (Jan) - BFQ fixes (Jan) - Various fixes and cleanups (Bart, Chengming, Fanjun, Julia, Ming, Wolfgang, me)" * tag 'for-5.19/block-2022-05-22' of git://git.kernel.dk/linux-block: (83 commits) blk-mq: fix typo in comment bfq: Remove bfq_requeue_request_body() bfq: Remove superfluous conversion from RQ_BIC() bfq: Allow current waker to defend against a tentative one bfq: Relax waker detection for shared queues blk-cgroup: delete rcu_read_lock_held() WARN_ON_ONCE() blk-throttle: Set BIO_THROTTLED when bio has been throttled blk-cgroup: Remove unnecessary rcu_read_lock/unlock() blk-cgroup: always terminate io.stat lines block, bfq: make bfq_has_work() more accurate block, bfq: protect 'bfqd->queued' by 'bfqd->lock' block: cleanup the VM accounting in submit_bio block: Fix the bio.bi_opf comment block: reorder the REQ_ flags blk-iocost: combine local_stat and desc_stat to stat block: improve the error message from bio_check_eod block: allow passing a NULL bdev to bio_alloc_clone/bio_init_clone block: remove superfluous calls to blkcg_bio_issue_init kthread: unexport kthread_blkcg blk-cgroup: cleanup blkcg_maybe_throttle_current ... commit f6792c877a1cacc3b3eea7cb5b45857b3c484c51 Merge: df1c5d73d2856 2e10a1d693b9f Author: Linus Torvalds Date: Mon May 23 13:52:14 2022 -0700 Merge tag 'for-5.19/cdrom-2022-05-22' of git://git.kernel.dk/linux-block Pull cdrom updates from Jens Axboe: "Removal of unused code and documentation updates" * tag 'for-5.19/cdrom-2022-05-22' of git://git.kernel.dk/linux-block: cdrom: remove obsolete TODO list block: remove last remaining traces of IDE documentation cdrom: mark CDROMGETSPINDOWN/CDROMSETSPINDOWN obsolete cdrom: remove the unused driver specific disc change ioctl cdrom: make EXPORT_SYMBOL follow exported function commit df1c5d73d2856af0425bdf6f023202e957bd7435 Merge: 9836e93c0a7e0 68f4c6eba70df Author: Linus Torvalds Date: Mon May 23 13:48:23 2022 -0700 Merge tag 'for-5.19/writeback-2022-05-22' of git://git.kernel.dk/linux-block Pull writeback fix from Jens Axboe: "A single writeback fix that didn't belong in any other branch, correcting the number of skipped pages" * tag 'for-5.19/writeback-2022-05-22' of git://git.kernel.dk/linux-block: fs-writeback: writeback_sb_inodes:Recalculate 'wrote' according skipped pages commit 9836e93c0a7e031ac6a71c56171c229de1eea7cf Merge: e1a8fde7203fa 3fe07bcd800d6 Author: Linus Torvalds Date: Mon May 23 13:06:15 2022 -0700 Merge tag 'for-5.19/io_uring-passthrough-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring NVMe command passthrough from Jens Axboe: "On top of everything else, this adds support for passthrough for io_uring. The initial feature for this is NVMe passthrough support, which allows non-filesystem based IO commands and admin commands. To support this, io_uring grows support for SQE and CQE members that are twice as big, allowing to pass in a full NVMe command without having to copy data around. And to complete with more than just a single 32-bit value as the output" * tag 'for-5.19/io_uring-passthrough-2022-05-22' of git://git.kernel.dk/linux-block: (22 commits) io_uring: cleanup handling of the two task_work lists nvme: enable uring-passthrough for admin commands nvme: helper for uring-passthrough checks blk-mq: fix passthrough plugging nvme: add vectored-io support for uring-cmd nvme: wire-up uring-cmd support for io-passthru on char-device. nvme: refactor nvme_submit_user_cmd() block: wire-up support for passthrough plugging fs,io_uring: add infrastructure for uring-cmd io_uring: support CQE32 for nop operation io_uring: enable CQE32 io_uring: support CQE32 in /proc info io_uring: add tracing for additional CQE32 fields io_uring: overflow processing for CQE32 io_uring: flush completions for CQE32 io_uring: modify io_get_cqe for CQE32 io_uring: add CQE32 completion processing io_uring: add CQE32 setup processing io_uring: change ring size calculation for CQE32 io_uring: store add. return values for CQE32 ... commit 8f445a3ec3fd36feb90c5b2ef8d21e2492819cdc Author: Marc Kleine-Budde Date: Mon May 23 14:33:44 2022 +0200 can: ctucanfd: platform: add missing dependency to HAS_IOMEM The kernel test robot noticed that the ctucanfd platform driver fails during modpost on platforms that don't support IOMEM. | ERROR: modpost: "devm_ioremap_resource" [drivers/net/can/ctucanfd/ctucanfd_platform.ko] undefined! This patch adds the missing HAS_IOMEM dependency. Link: https://lore.kernel.org/all/20220523123720.1656611-1-mkl@pengutronix.de Fixes: e8f0c23a2415 ("can: ctucanfd: CTU CAN FD open-source IP core - platform/SoC support.") Reported-by: kernel test robot Acked-by: Pavel Pisa Cc: Ondrej Ille Signed-off-by: Marc Kleine-Budde commit 3e88445a3a5afc65929c578fe2ffc03420588993 Author: Jakub Kicinski Date: Fri May 20 12:46:59 2022 -0700 can: kvaser_usb: silence a GCC 12 -Warray-bounds warning This driver does a lot of casting of smaller buffers to struct kvaser_cmd_ext, GCC 12 does not like that: | drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:489:65: warning: array subscript ‘struct kvaser_cmd_ext[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Warray-bounds] | drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c:489:23: note: in expansion of macro ‘le16_to_cpu’ | 489 | ret = le16_to_cpu(((struct kvaser_cmd_ext *)cmd)->len); | | ^~~~~~~~~~~ Temporarily silence this warning (move it to W=1 builds). Link: https://lore.kernel.org/all/20220520194659.2356903-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Tested-by: Marc Kleine-Budde Signed-off-by: Marc Kleine-Budde commit a682d18433005f9609be95c46924ddca827122de Author: Julia Lawall Date: Sat May 21 13:10:34 2022 +0200 can: peak_usb: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/all/20220521111145.81697-24-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Marc Kleine-Budde commit f9a3eca4bc0452a7079282d1ad87d65cb3463f0a Author: Colin Ian King Date: Mon May 23 12:56:04 2022 +0100 selftests/bpf: Fix spelling mistake: "unpriviliged" -> "unprivileged" There are spelling mistakes in ASSERT messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220523115604.49942-1-colin.i.king@gmail.com commit 4050764cbaa25760aab40857f723393c07898474 Author: Yonghong Song Date: Mon May 23 08:20:44 2022 -0700 selftests/bpf: fix btf_dump/btf_dump due to recent clang change Latest llvm-project upstream had a change of behavior related to qualifiers on function return type ([1]). This caused selftests btf_dump/btf_dump failure. The following example shows what changed. $ cat t.c typedef const char * const (* const (* const fn_ptr_arr2_t[5])())(char * (*)(int)); struct t { int a; fn_ptr_arr2_t l; }; int foo(struct t *arg) { return arg->a; } Compiled with latest upstream llvm15, $ clang -O2 -g -target bpf -S -emit-llvm t.c The related generated debuginfo IR looks like: !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "fn_ptr_arr2_t", file: !1, line: 1, baseType: !17) !17 = !DICompositeType(tag: DW_TAG_array_type, baseType: !18, size: 320, elements: !32) !18 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !19) !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !20, size: 64) !20 = !DISubroutineType(types: !21) !21 = !{!22, null} !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 64) !23 = !DISubroutineType(types: !24) !24 = !{!25, !28} !25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64) !26 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !27) !27 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) You can see two intermediate const qualifier to pointer are dropped in debuginfo IR. With llvm14, we have following debuginfo IR: !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "fn_ptr_arr2_t", file: !1, line: 1, baseType: !17) !17 = !DICompositeType(tag: DW_TAG_array_type, baseType: !18, size: 320, elements: !34) !18 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !19) !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !20, size: 64) !20 = !DISubroutineType(types: !21) !21 = !{!22, null} !22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !23) !23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !24, size: 64) !24 = !DISubroutineType(types: !25) !25 = !{!26, !30} !26 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !27) !27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64) !28 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !29) !29 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) All const qualifiers are preserved. To adapt the selftest to both old and new llvm, this patch removed the intermediate const qualifier in const-to-ptr types, to make the test succeed again. [1] https://reviews.llvm.org/D125919 Reported-by: Mykola Lysenko Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20220523152044.3905809-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit c9f73a2178c12fb24d2807634209559d6a836e08 Author: Luiz Augusto von Dentz Date: Fri May 20 11:37:13 2022 -0700 Bluetooth: hci_conn: Fix hci_connect_le_sync The handling of connection failures shall be handled by the request completion callback as already done by hci_cs_le_create_conn, also make sure to use hci_conn_failed instead of hci_le_conn_failed as the later don't actually call hci_conn_del to cleanup. Link: https://github.com/bluez/bluez/issues/340 Fixes: 8e8b92ee60de5 ("Bluetooth: hci_sync: Add hci_le_create_conn_sync") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit e1a8fde7203fa8a3e3f35d4f9df47477d23529c1 Merge: 368da430d04db f548a12efd5ab Author: Linus Torvalds Date: Mon May 23 12:51:04 2022 -0700 Merge tag 'for-5.19/io_uring-net-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring 'more data in socket' support from Jens Axboe: "To be able to fully utilize the 'poll first' support in the core io_uring branch, it's advantageous knowing if the socket was empty after a receive. This adds support for that" * tag 'for-5.19/io_uring-net-2022-05-22' of git://git.kernel.dk/linux-block: io_uring: return hint on whether more data is available after receive tcp: pass back data left in socket after receive commit bca1a1004615efe141fd78f360ecc48c60bc4ad5 Author: Björn Ardö Date: Thu Mar 31 09:01:15 2022 +0200 mailbox: forward the hrtimer if not queued and under a lock This reverts commit c7dacf5b0f32957b24ef29df1207dc2cd8307743, "mailbox: avoid timer start from callback" The previous commit was reverted since it lead to a race that caused the hrtimer to not be started at all. The check for hrtimer_active() in msg_submit() will return true if the callback function txdone_hrtimer() is currently running. This function could return HRTIMER_NORESTART and then the timer will not be restarted, and also msg_submit() will not start the timer. This will lead to a message actually being submitted but no timer will start to check for its compleation. The original fix that added checking hrtimer_active() was added to avoid a warning with hrtimer_forward. Looking in the kernel another solution to avoid this warning is to check hrtimer_is_queued() before calling hrtimer_forward_now() instead. This however requires a lock so the timer is not started by msg_submit() inbetween this check and the hrtimer_forward() call. Fixes: c7dacf5b0f32 ("mailbox: avoid timer start from callback") Signed-off-by: Björn Ardö Signed-off-by: Jassi Brar commit 368da430d04dbe31aded44e5f5c255ff0899ad1d Merge: 09beaff75e4c4 033b87d24f725 Author: Linus Torvalds Date: Mon May 23 12:42:33 2022 -0700 Merge tag 'for-5.19/io_uring-socket-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring socket() support from Jens Axboe: "This adds support for socket(2) for io_uring. This is handy when using direct / registered file descriptors with io_uring. Outside of those two patches, a small series from Dylan on top that improves the tracing by providing a text representation of the opcode rather than needing to decode this by reading the header file every time. That sits in this branch as it was the last opcode added (until it wasn't...)" * tag 'for-5.19/io_uring-socket-2022-05-22' of git://git.kernel.dk/linux-block: io_uring: use the text representation of ops in trace io_uring: rename op -> opcode io_uring: add io_uring_get_opcode io_uring: add type to op enum io_uring: add socket(2) support net: add __sys_socket_file() commit 09beaff75e4c4cee590b0e547c7587ff6cadb5db Merge: 3a166bdbf3abc 4ffaa94b9c047 Author: Linus Torvalds Date: Mon May 23 12:30:30 2022 -0700 Merge tag 'for-5.19/io_uring-xattr-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring xattr support from Jens Axboe: "Support for the xattr variants" * tag 'for-5.19/io_uring-xattr-2022-05-22' of git://git.kernel.dk/linux-block: io_uring: cleanup error-handling around io_req_complete io_uring: fix trace for reduced sqe padding io_uring: add fgetxattr and getxattr support io_uring: add fsetxattr and setxattr support fs: split off do_getxattr from getxattr fs: split off setxattr_copy and do_setxattr function from setxattr commit 3a166bdbf3abc8ca2d7ffe7cffc5c7a65f260e62 Merge: 1e57930e9f408 0e7579ca732a3 Author: Linus Torvalds Date: Mon May 23 12:22:49 2022 -0700 Merge tag 'for-5.19/io_uring-2022-05-22' of git://git.kernel.dk/linux-block Pull io_uring updates from Jens Axboe: "Here are the main io_uring changes for 5.19. This contains: - Fixes for sparse type warnings (Christoph, Vasily) - Support for multi-shot accept (Hao) - Support for io_uring managed fixed files, rather than always needing the applicationt o manage the indices (me) - Fix for a spurious poll wakeup (Dylan) - CQE overflow fixes (Dylan) - Support more types of cancelations (me) - Support for co-operative task_work signaling, rather than always forcing an IPI (me) - Support for doing poll first when appropriate, rather than always attempting a transfer first (me) - Provided buffer cleanups and support for mapped buffers (me) - Improve how io_uring handles inflight SCM files (Pavel) - Speedups for registered files (Pavel, me) - Organize the completion data in a struct in io_kiocb rather than keep it in separate spots (Pavel) - task_work improvements (Pavel) - Cleanup and optimize the submission path, in general and for handling links (Pavel) - Speedups for registered resource handling (Pavel) - Support sparse buffers and file maps (Pavel, me) - Various fixes and cleanups (Almog, Pavel, me)" * tag 'for-5.19/io_uring-2022-05-22' of git://git.kernel.dk/linux-block: (111 commits) io_uring: fix incorrect __kernel_rwf_t cast io_uring: disallow mixed provided buffer group registrations io_uring: initialize io_buffer_list head when shared ring is unregistered io_uring: add fully sparse buffer registration io_uring: use rcu_dereference in io_close io_uring: consistently use the EPOLL* defines io_uring: make apoll_events a __poll_t io_uring: drop a spurious inline on a forward declaration io_uring: don't use ERR_PTR for user pointers io_uring: use a rwf_t for io_rw.flags io_uring: add support for ring mapped supplied buffers io_uring: add io_pin_pages() helper io_uring: add buffer selection support to IORING_OP_NOP io_uring: fix locking state for empty buffer group io_uring: implement multishot mode for accept io_uring: let fast poll support multishot io_uring: add REQ_F_APOLL_MULTISHOT for requests io_uring: add IORING_ACCEPT_MULTISHOT for accept io_uring: only wake when the correct events are set io_uring: avoid io-wq -EAGAIN looping for !IOPOLL ... commit fd5e363eac77ef81542db77ddad0559fa0f9204e Author: Julian Schroeder Date: Mon May 23 18:52:26 2022 +0000 nfsd: destroy percpu stats counters after reply cache shutdown Upon nfsd shutdown any pending DRC cache is freed. DRC cache use is tracked via a percpu counter. In the current code the percpu counter is destroyed before. If any pending cache is still present, percpu_counter_add is called with a percpu counter==NULL. This causes a kernel crash. The solution is to destroy the percpu counter after the cache is freed. Fixes: e567b98ce9a4b (“nfsd: protect concurrent access to nfsd stats counters”) Signed-off-by: Julian Schroeder Signed-off-by: Chuck Lever commit 1e57930e9f4083ad5854ab6eadffe790a8167fb4 Merge: b2f02e9cdaade ce13389053a34 Author: Linus Torvalds Date: Mon May 23 11:46:51 2022 -0700 Merge tag 'rcu.2022.05.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU update from Paul McKenney: - Documentation updates - Miscellaneous fixes - Callback-offloading updates, mainly simplifications - RCU-tasks updates, including some -rt fixups, handling of systems with sparse CPU numbering, and a fix for a boot-time race-condition failure - Put SRCU on a memory diet in order to reduce the size of the srcu_struct structure - Torture-test updates fixing some bugs in tests and closing some testing holes - Torture-test updates for the RCU tasks flavors, most notably ensuring that building rcutorture and friends does not change the RCU-tasks-related Kconfig options - Torture-test scripting updates - Expedited grace-period updates, most notably providing milliseconds-scale (not all that) soft real-time response from synchronize_rcu_expedited(). This is also the first time in almost 30 years of RCU that someone other than me has pushed for a reduction in the RCU CPU stall-warning timeout, in this case by more than three orders of magnitude from 21 seconds to 20 milliseconds. This tighter timeout applies only to expedited grace periods * tag 'rcu.2022.05.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (80 commits) rcu: Move expedited grace period (GP) work to RT kthread_worker rcu: Introduce CONFIG_RCU_EXP_CPU_STALL_TIMEOUT srcu: Drop needless initialization of sdp in srcu_gp_start() srcu: Prevent expedited GPs and blocking readers from consuming CPU srcu: Add contention check to call_srcu() srcu_data ->lock acquisition srcu: Automatically determine size-transition strategy at boot rcutorture: Make torture.sh allow for --kasan rcutorture: Make torture.sh refscale and rcuscale specify Tasks Trace RCU rcutorture: Make kvm.sh allow more memory for --kasan runs torture: Save "make allmodconfig" .config file scftorture: Remove extraneous "scf" from per_version_boot_params rcutorture: Adjust scenarios' Kconfig options for CONFIG_PREEMPT_DYNAMIC torture: Enable CSD-lock stall reports for scftorture torture: Skip vmlinux check for kvm-again.sh runs scftorture: Adjust for TASKS_RCU Kconfig option being selected rcuscale: Allow rcuscale without RCU Tasks Rude/Trace rcuscale: Allow rcuscale without RCU Tasks refscale: Allow refscale without RCU Tasks Rude/Trace refscale: Allow refscale without RCU Tasks rcutorture: Allow specifying per-scenario stat_interval ... commit b2f02e9cdaade3ce565e6973ac313d2f814447f2 Merge: f814957b018c8 5b759db44195b Author: Linus Torvalds Date: Mon May 23 11:43:44 2022 -0700 Merge tag 'lkmm.2022.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull LKMM update from Paul McKenney: "This updates the klitmus7 compatibility table to indicate that herdtools7 7.56.1 or better is required for Linux kernel v5.17 or later" * tag 'lkmm.2022.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/memory-model/README: Update klitmus7 compat table commit f814957b018c867a2397bdd3c1816de7502d2c7f Merge: bf2431021c8cf 11dbdaeff41d9 Author: Linus Torvalds Date: Mon May 23 11:33:25 2022 -0700 Merge tag 'nolibc.2022.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull nolibc library updates from Paul McKenney: "This adds a number of library functions and splits this library into multiple files" * tag 'nolibc.2022.05.20a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (61 commits) tools/nolibc/string: Implement `strdup()` and `strndup()` tools/nolibc/string: Implement `strnlen()` tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()` tools/nolibc/types: Implement `offsetof()` and `container_of()` macro tools/nolibc/sys: Implement `mmap()` and `munmap()` tools/nolibc: i386: Implement syscall with 6 arguments tools/nolibc: Remove .global _start from the entry point code tools/nolibc: Replace `asm` with `__asm__` tools/nolibc: x86-64: Update System V ABI document link tools/nolibc/stdlib: only reference the external environ when inlined tools/nolibc/string: do not use __builtin_strlen() at -O0 tools/nolibc: add the nolibc subdir to the common Makefile tools/nolibc: add a makefile to install headers tools/nolibc/types: add poll() and waitpid() flag definitions tools/nolibc/sys: add syscall definition for getppid() tools/nolibc/string: add strcmp() and strncmp() tools/nolibc/stdio: add support for '%p' to vfprintf() tools/nolibc/stdlib: add a simple getenv() implementation tools/nolibc/stdio: make printf(%s) accept NULL tools/nolibc/stdlib: implement abort() ... commit bbb544f3349197d1e7f4f9b921b75e919cd45f39 Merge: 388292df27810 7acc8a2ac0c0a bd30d075eedce b947769b8f778 Author: Rafael J. Wysocki Date: Mon May 23 20:32:58 2022 +0200 Merge branches 'thermal-int340x', 'thermal-pch' and 'thermal-misc' Merge int340x thermal driver updates, PCH thermal driver updates and miscellaneous thermal control updates for 5.19-rc1: - Clean up _OSC handling in int340x (Davidlohr Bueso). - Improve overheat condition handling during suspend-to-idle in the Intel PCH thermal driver (Zhang Rui). - Use local ops instead of global ops in devfreq_cooling (Kant Fan). - Switch hisi_termal from CONFIG_PM_SLEEP guards to pm_sleep_ptr() (Hesham Almatary) * thermal-int340x: thermal: int340x: Clean up _OSC context init thermal: int340x: Consolidate freeing of acpi_buffer pointer thermal: int340x: Clean up unnecessary acpi_buffer pointer freeing * thermal-pch: thermal: intel: pch: improve the cooling delay log thermal: intel: pch: enhance overheat handling thermal: intel: pch: move cooling delay to suspend_noirq phase PM: wakeup: expose pm_wakeup_pending to modules * thermal-misc: thermal: devfreq_cooling: use local ops instead of global ops thermal: hisi_termal: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() commit 388292df27810a01c3f459533578255bbba4a4de Merge: 5a66bfb27748d c23b7517fe623 Author: Rafael J. Wysocki Date: Mon May 23 20:31:57 2022 +0200 Merge back earlier thermal control updates for 5.19-rc1. commit bf2431021c8cfe52c866d7bf640ced03a35ebe91 Merge: 4b0986a3613c9 3f68e69520d3d Author: Linus Torvalds Date: Mon May 23 11:27:24 2022 -0700 Merge tag 'efi-next-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI updates from Ard Biesheuvel: - Allow runtime services to be re-enabled at boot on RT kernels. - Provide access to secrets injected into the boot image by CoCo hypervisors (COnfidential COmputing) - Use DXE services on x86 to make the boot image executable after relocation, if needed. - Prefer mirrored memory for randomized allocations. - Only randomize the placement of the kernel image on arm64 if the loader has not already done so. - Add support for obtaining the boot hartid from EFI on RISC-V. * tag 'efi-next-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: riscv/efi_stub: Add support for RISCV_EFI_BOOT_PROTOCOL efi: stub: prefer mirrored memory for randomized allocations efi/arm64: libstub: run image in place if randomized by the loader efi: libstub: pass image handle to handle_kernel_image() efi: x86: Set the NX-compatibility flag in the PE header efi: libstub: ensure allocated memory to be executable efi: libstub: declare DXE services table efi: Add missing prototype for efi_capsule_setup_info docs: security: Add secrets/coco documentation efi: Register efi_secret platform device if EFI secret area is declared virt: Add efi_secret module to expose confidential computing secrets efi: Save location of EFI confidential computing area efi: Allow to enable EFI runtime services by default on RT commit ff2095976ca83d01f4297417fec89f6a1549a5a9 Author: Julia Lawall Date: Sat May 21 13:11:34 2022 +0200 s390/bpf: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Andrii Nakryiko Acked-by: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/20220521111145.81697-84-Julia.Lawall@inria.fr commit bb412cf1d712656f27b2a08c492ed9d7591485aa Author: Julia Lawall Date: Sat May 21 13:11:21 2022 +0200 libbpf: Fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Andrii Nakryiko Acked-by: Daniel Müller Link: https://lore.kernel.org/bpf/20220521111145.81697-71-Julia.Lawall@inria.fr commit df7e7f2ba0781528e63f04b108819a4ab9889c72 Merge: 537b9f2bf60f4 42b805af10247 Author: Jens Axboe Date: Mon May 23 12:18:55 2022 -0600 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.19/drivers Pull MD updates from Song: "- Remove uses of bdevname, by Christoph Hellwig; - Bug fixes by Guoqing Jiang, and Xiao Ni." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix double free of io_acct_set bioset md: Don't set mddev private to NULL in raid0 pers->free md: remove most calls to bdevname md: protect md_unregister_thread from reentrancy md: don't unregister sync_thread with reconfig_mutex held commit eaff451d4b7c86e3db3c03611426f5ce1d3826fd Author: Michal Orzel Date: Thu Mar 31 19:33:58 2022 +0200 smack: Remove redundant assignments Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Signed-off-by: Casey Schaufler commit 0d64482bf29917e659c556aa36cea241b17c33df Merge: cd8198a2c15c5 9765fa25662ae Author: Rafael J. Wysocki Date: Mon May 23 19:59:06 2022 +0200 Merge branch 'pm-tools' Merge power management tools updates for 5.19-rc1: - Update turbostat to version 2022.04.16 including the following changes: * No build warnings with -Wextra (Len Brown). * Tweak --show and --hide capability (Len Brown). * Be more useful as non-root (Len Brown). * Fix ICX DRAM power numbers (Len Brown). * Fix dump for AMD cpus (Dan Merillat). * Add Power Limit4 support (Sumeet Pawnikar). * Print power values upto three decimal (Sumeet Pawnikar). * Allow -e for all names (Zephaniah E. Loss-Cutler-Hull). * Allow printing header every N iterations (Zephaniah E. Loss-Cutler-Hull). * Support thermal throttle count print (Chen Yu). * pm-tools: tools/power turbostat: version 2022.04.16 tools/power turbostat: No build warnings with -Wextra tools/power turbostat: be more useful as non-root tools/power turbostat: fix ICX DRAM power numbers tools/power turbostat: Support thermal throttle count print tools/power turbostat: Allow printing header every N iterations tools/power turbostat: Allow -e for all names. tools/power turbostat: print power values upto three decimal tools/power turbostat: Add Power Limit4 support tools/power turbostat: fix dump for AMD cpus tools/power turbostat: tweak --show and --hide capability commit cd8198a2c15c58d0e526e4106cbea3f8095fbb71 Merge: d988c9134221a b2a92f354c5a9 Author: Rafael J. Wysocki Date: Mon May 23 19:51:31 2022 +0200 Merge branch 'pm-domains' Merge generlic power domains update for 5.19-rc1: - Extend dev_pm_domain_detach() doc (Krzysztof Kozlowski). - Move genpd's time-accounting to ktime_get_mono_fast_ns() (Ulf Hansson). - Improve the way genpd deals with its governors (Ulf Hansson). * pm-domains: PM: domains: Trust domain-idle-states from DT to be correct by genpd PM: domains: Measure power-on/off latencies in genpd based on a governor PM: domains: Allocate governor data dynamically based on a genpd governor PM: domains: Clean up some code in pm_genpd_init() and genpd_remove() PM: domains: Fix initialization of genpd's next_wakeup PM: domains: Fixup QoS latency measurements for IRQ safe devices in genpd PM: domains: Measure suspend/resume latencies in genpd based on governor PM: domains: Move the next_wakeup variable into the struct gpd_timing_data PM: domains: Allocate gpd_timing_data dynamically based on governor PM: domains: Skip another warning in irq_safe_dev_in_sleep_domain() PM: domains: Rename irq_safe_dev_in_no_sleep_domain() in genpd PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd PM: domains: Drop redundant code for genpd always-on governor PM: domains: Add GENPD_FLAG_RPM_ALWAYS_ON for the always-on governor PM: domains: Move genpd's time-accounting to ktime_get_mono_fast_ns() PM: domains: Extend dev_pm_domain_detach() doc commit 803a1f7272797faa15a7879cdc70f9adaf3fdcba Author: Syed Saba kareem Date: Mon May 23 16:59:53 2022 +0530 ASoC: SOF: amd: Fixed Build error Add linux/module.h in acp-pci.c to solve the below dependency All error/warnings (new ones prefixed by >>): >> sound/soc/amd/acp/acp-pci.c:148:1: warning: data definition has no type or storage class 148 | MODULE_DEVICE_TABLE(pci, acp_pci_ids); | ^~~~~~~~~~~~~~~~~~~ >> sound/soc/amd/acp/acp-pci.c:148:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int] ... Reported-by: kernel test robot Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20220523112956.3087604-1-ssabakar@amd.com Signed-off-by: Mark Brown commit 759820c92a346dd18daaa8873f5cabe731d8a31c Author: Julia Lawall Date: Sat May 21 13:11:43 2022 +0200 f2fs: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d988c9134221af08908e4e3941952259b4207ce8 Merge: 16a23f394dd92 2d41dc23804d0 Author: Rafael J. Wysocki Date: Mon May 23 19:28:41 2022 +0200 Merge branch 'pm-cpufreq' Merge cpufreq updates for 5.19-rc1: - Fix cpufreq governor clean up code to avoid using kfree() directly to free kobject-based items (Kevin Hao). - Prepare cpufreq for powerpc's asm/prom.h cleanup (Christophe Leroy). - Make intel_pstate notify frequency invariance code when no_turbo is turned on and off (Chen Yu). - Add Sapphire Rapids OOB mode support to intel_pstate (Srinivas Pandruvada). - Make cpufreq avoid unnecessary frequency updates due to mismatch between hardware and the frequency table (Viresh Kumar). - Make remove_cpu_dev_symlink() clear the real_cpus mask to simplify code (Viresh Kumar). - Rearrange cpufreq_offline() and cpufreq_remove_dev() to make the calling convention for some driver callbacks consistent (Rafael Wysocki). - Avoid accessing half-initialized cpufreq policies from the show() and store() sysfs functions (Schspa Shi). - Rearrange cpufreq_offline() to make the calling convention for some driver callbacks consistent (Schspa Shi). - Update CPPC handling in cpufreq (Pierre Gondois): * Add per_cpu efficiency_class to the CPPC driver. * Make the CPPC driver Register EM based on efficiency class information. * Adjust _OSC for flexible address space in the ACPI platform initialization code and always set CPPC _OSC bits if CPPC_LIB is supported. * Assume no transition latency if no PCCT in the CPPC driver. * Add fast_switch and dvfs_possible_from_any_cpu support to the CPPC driver. * pm-cpufreq: cpufreq: CPPC: Enable dvfs_possible_from_any_cpu cpufreq: CPPC: Enable fast_switch ACPI: CPPC: Assume no transition latency if no PCCT ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported ACPI: CPPC: Check _OSC for flexible address space cpufreq: make interface functions and lock holding state clear cpufreq: Abort show()/store() for half-initialized policies cpufreq: Rearrange locking in cpufreq_remove_dev() cpufreq: Split cpufreq_offline() cpufreq: Reorganize checks in cpufreq_offline() cpufreq: Clear real_cpus mask from remove_cpu_dev_symlink() cpufreq: intel_pstate: Support Sapphire Rapids OOB mode Revert "cpufreq: Fix possible race in cpufreq online error path" cpufreq: CPPC: Register EM based on efficiency class information cpufreq: CPPC: Add per_cpu efficiency_class cpufreq: Avoid unnecessary frequency updates due to mismatch cpufreq: Fix possible race in cpufreq online error path cpufreq: intel_pstate: Handle no_turbo in frequency invariance cpufreq: Prepare cleanup of powerpc's asm/prom.h cpufreq: governor: Use kobject release() method to free dbs_data commit 03e053b4f717c0d893881fe8e4ca8d9ae2f035f2 Author: Dmitry Baryshkov Date: Sat May 21 03:53:38 2022 +0300 Revert "clk: qcom: regmap-mux: add pipe clk implementation" Johan Hovold has pointed out that there are several deficiencies and a race condition in the regmap_mux_safe ops that were merged. Pipe clocks has been updated to use newer and simpler clk_regmap_phy_mux_ops. Drop the regmap-mux-safe clock ops now. Signed-off-by: Dmitry Baryshkov Reviewed-by: Johan Hovold Tested-by: Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220521005343.1429642-4-dmitry.baryshkov@linaro.org commit 720e14f3281731e3f606f65bbee32f95d2cd3f64 Author: Dmitry Baryshkov Date: Sat May 21 03:53:37 2022 +0300 Revert "clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" Johan Hovold has pointed out that there are several deficiencies and a race condition in the regmap_mux_safe ops that were merged. Revert the commit that switches gcc-sc7280 driver to use regmap_mux_safe. Signed-off-by: Dmitry Baryshkov Reviewed-by: Johan Hovold Tested-by: Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220521005343.1429642-3-dmitry.baryshkov@linaro.org commit dd6456e6c4d8e384226a2f6d87801db15eeb24b0 Author: Dmitry Baryshkov Date: Sat May 21 03:53:36 2022 +0300 Revert "clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks" Johan Hovold has pointed out that there are several deficiencies and a race condition in the regmap_mux_safe ops that were merged. Revert the commit that switches gcc-sm8450 driver to use regmap_mux_safe. Signed-off-by: Dmitry Baryshkov Reviewed-by: Johan Hovold Tested-by: Reviewed-by: Johan Hovold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220521005343.1429642-2-dmitry.baryshkov@linaro.org commit 16a23f394dd926c35d44ae420a76ac12c9203f96 Merge: 95f2ce548a2d0 c9d8923bfbcb6 a6653fb584b5f Author: Rafael J. Wysocki Date: Mon May 23 19:18:51 2022 +0200 Merge branches 'pm-em' and 'pm-cpuidle' Marge Energy Model support updates and cpuidle updates for 5.19-rc1: - Update the Energy Model support code to allow the Energy Model to be artificial, which means that the power values may not be on a uniform scale with other devices providing power information, and update the cpufreq_cooling and devfreq_cooling thermal drivers to support artificial Energy Models (Lukasz Luba). - Make DTPM check the Energy Model type (Lukasz Luba). - Fix policy counter decrementation in cpufreq if Energy Model is in use (Pierre Gondois). - Add AlderLake processor support to the intel_idle driver (Zhang Rui). - Fix regression leading to no genpd governor in the PSCI cpuidle driver and fix the riscv-sbi cpuidle driver to allow a genpd governor to be used (Ulf Hansson). * pm-em: PM: EM: Decrement policy counter powercap: DTPM: Check for Energy Model type thermal: cooling: Check Energy Model type in cpufreq_cooling and devfreq_cooling Documentation: EM: Add artificial EM registration description PM: EM: Remove old debugfs files and print all 'flags' PM: EM: Change the order of arguments in the .active_power() callback PM: EM: Use the new .get_cost() callback while registering EM PM: EM: Add artificial EM flag PM: EM: Add .get_cost() callback * pm-cpuidle: cpuidle: riscv-sbi: Fix code to allow a genpd governor to be used cpuidle: psci: Fix regression leading to no genpd governor intel_idle: Add AlderLake support commit 95f2ce548a2d0ad7add02394814136f52ba14b06 Merge: 42d2607d91c4e 82586a721595f 171b66e2e2e9d 59cafa728c373 Author: Rafael J. Wysocki Date: Mon May 23 19:06:33 2022 +0200 Merge branches 'pm-core', 'pm-sleep' and 'powercap' Merge PM core changes, updates related to system sleep and power capping updates for 5.19-rc1: - Export dev_pm_ops instead of suspend() and resume() in the IIO chemical scd30 driver (Jonathan Cameron). - Add namespace variants of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and PM-runtime counterparts (Jonathan Cameron). - Move symbol exports in the IIO chemical scd30 driver into the IIO_SCD30 namespace (Jonathan Cameron). - Avoid device PM-runtime usage count underflows (Rafael Wysocki). - Allow dynamic debug to control printing of PM messages (David Cohen). - Fix some kernel-doc comments in hibernation code (Yang Li, Haowen Bai). - Preserve ACPI-table override during hibernation (Amadeusz Sławiński). - Improve support for suspend-to-RAM for PSCI OSI mode (Ulf Hansson). - Make Intel RAPL power capping driver support the RaptorLake and AlderLake N processors (Zhang Rui, Sumeet Pawnikar). - Remove redundant store to value after multiply in the RAPL power capping driver (Colin Ian King). * pm-core: PM: runtime: Avoid device usage count underflows iio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace PM: core: Add NS varients of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and runtime pm equiv iio: chemical: scd30: Export dev_pm_ops instead of suspend() and resume() * pm-sleep: cpuidle: PSCI: Improve support for suspend-to-RAM for PSCI OSI mode PM: runtime: Allow to call __pm_runtime_set_status() from atomic context PM: hibernate: Don't mark comment as kernel-doc x86/ACPI: Preserve ACPI-table override during hibernation PM: hibernate: Fix some kernel-doc comments PM: sleep: enable dynamic debug support within pm_pr_dbg() PM: sleep: Narrow down -DDEBUG on kernel/power/ files * powercap: powercap: intel_rapl: remove redundant store to value after multiply powercap: intel_rapl: add support for ALDERLAKE_N powercap: RAPL: Add Power Limit4 support for RaptorLake powercap: intel_rapl: add support for RaptorLake commit 4e71ed985389ce213003927cfa65c1352e70396c Author: Rob Herring Date: Thu May 19 16:14:11 2022 -0500 dt-bindings: Fix properties without any type Now that the schema tools can extract type information for all properties (in order to decode dtb files), finding properties missing any type definition is fairly trivial though not yet automated. Fix the various property schemas which are missing a type. Most of these tend to be device specific properties which don't have a vendor prefix. A vendor prefix is how we normally ensure a type is defined. Signed-off-by: Rob Herring Acked-by: Sam Ravnborg # for everything in .../bindings/display/ Acked-by: Mark Brown Acked-by: Peter Rosin Acked-by: Bartosz Golaszewski Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220519211411.2200720-1-robh@kernel.org commit c490513c818d1ec61aff1614f5d0e38de680665f Author: Jason Gunthorpe Date: Thu May 19 20:14:01 2022 -0300 vfio/pci: Add driver_managed_dma to the new vfio_pci drivers When the iommu series adding driver_managed_dma was rebased it missed that new VFIO drivers were added and did not update them too. Without this vfio will claim the groups are not viable. Add driver_managed_dma to mlx5 and hisi. Fixes: 70693f470848 ("vfio: Set DMA ownership for VFIO devices") Reported-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Tested-by: Shameer Kolothum Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/0-v1-f9dfa642fab0+2b3-vfio_managed_dma_jgg@nvidia.com Signed-off-by: Alex Williamson commit 5db9ce20951c8163ee3d505b81d458c83155e311 Merge: 4aa8c70cb076f ab59c89396c00 42e5ed0618030 24773e6c7a27b e802ca757b29e Author: Rafael J. Wysocki Date: Mon May 23 18:44:27 2022 +0200 Merge branches 'acpi-apei', 'acpi-dptf', 'acpi-x86' and 'acpi-docs' Merge APEI material, changes related to DPTF, ACPI-related x86 cleanup and documentation improvement for 5.19-rc1: - Fix missing ERST record ID in the APEI code (Liu Xinpeng). - Make APEI error injection to refuse to inject into the zero page (Tony Luck). - Correct description of INT3407 / INT3532 DPTF attributes in sysfs (Sumeet Pawnikar). - Add support for high frequency impedance notification to the DPTF driver (Sumeet Pawnikar). - Make mp_config_acpi_gsi() a void function (Li kunyu). - Unify Package () representation for properties in the ACPI device properties documentation (Andy Shevchenko). * acpi-apei: ACPI, APEI, EINJ: Refuse to inject into the zero page ACPI: APEI: Fix missing ERST record id * acpi-dptf: ACPI: DPTF: Add support for high frequency impedance notification ACPI: DPTF: Correct description of INT3407 / INT3532 attributes * acpi-x86: x86: ACPI: Make mp_config_acpi_gsi() a void function * acpi-docs: ACPI: docs: enumeration: Unify Package () for properties (part 2) commit 4aa8c70cb076f7126d8ad755943361e78ac752fc Merge: ec1ff61ee266c d52848620de00 10fa1b2cdc899 1bbc21785b733 988d7a14408db Author: Rafael J. Wysocki Date: Mon May 23 18:29:20 2022 +0200 Merge branches 'acpi-pm', 'acpi-pci', 'acpi-sysfs' and 'acpi-tables' Merge power management, PCI and sysfs-related material and changes related to handling ACPI tables for 5.19-rc1: - Improve debug messages in the ACPI device PM code (Rafael Wysocki). - Block ASUS B1400CEAE from suspend to idle by default (Mario Limonciello). - Improve handling of PCI devices that are in D3cold during system initialization (Rafael Wysocki). - Fix BERT error region memory mapping (Lorenzo Pieralisi). - Add support for NVIDIA 16550-compatible port subtype to the SPCR parsing code (Jeff Brasen). - Use static for BGRT_SHOW kobj_attribute defines (Tom Rix). - Fix missing prototype warning for acpi_agdi_init() (Ilkka Koskinen). * acpi-pm: ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default ACPI: PM: Always print final debug message in acpi_device_set_power() ACPI: PM: Unify debug messages in acpi_device_set_power() ACPI: PM: Change pr_fmt() in device_pm.c ACPI: PM: Convert debug message in acpi_device_get_power() * acpi-pci: ACPI: bus: Avoid non-ACPI device objects in walks over children PCI: ACPI: PM: Power up devices in D3cold before scanning them ACPI: PM: Introduce acpi_dev_power_up_children_with_adr() ACPI: bus: Introduce acpi_dev_for_each_child() * acpi-sysfs: ACPI: sysfs: Fix BERT error region memory mapping * acpi-tables: ACPI: AGDI: Fix missing prototype warning for acpi_agdi_init() ACPI: BGRT: use static for BGRT_SHOW kobj_attribute defines ACPI: SPCR: Add support for NVIDIA 16550-compatible port subtype commit e205a9945cf9dbcec79d8271caba355916ea0943 Author: Jim Quinlan Date: Mon May 23 08:16:39 2022 -0400 MIPS: bmips: Fix compiler warning observed on W=1 build The function arch_sync_dma_for_cpu_all() was used but was missing a prototype declaration. Signed-off-by: Jim Quinlan Reported-by: kernel test robot Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit a3da1ab6fbea7d5cbcb796f62c8771d8ebd7282a Author: Jason Gunthorpe Date: Thu May 19 14:03:48 2022 -0300 vfio: Do not manipulate iommu dma_owner for fake iommu groups Since asserting dma ownership now causes the group to have its DMA blocked the iommu layer requires a working iommu. This means the dma_owner APIs cannot be used on the fake groups that VFIO creates. Test for this and avoid calling them. Otherwise asserting dma ownership will fail for VFIO mdev devices as a BLOCKING iommu_domain cannot be allocated due to the NULL iommu ops. Fixes: 0286300e6045 ("iommu: iommu_group_claim_dma_owner() must always assign a domain") Reported-by: Eric Farman Tested-by: Eric Farman Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/0-v1-9cfc47edbcd4+13546-vfio_dma_owner_fix_jgg@nvidia.com Signed-off-by: Alex Williamson commit a56672f2027eb0fcf81300cfdab1037be8cda404 Author: Magnus Karlsson Date: Mon May 23 10:32:54 2022 +0200 MAINTAINERS: Add maintainer to AF_XDP Maciej Fijalkowski has gracefully accepted to become the third maintainer for the AF_XDP code. Thank you Maciej! Signed-off-by: Magnus Karlsson Signed-off-by: Daniel Borkmann Acked-by: Björn Töpel Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20220523083254.32285-1-magnus.karlsson@gmail.com commit ec1ff61ee266cecb79e754983bbd4570aa108cfd Merge: 06eb8dc097b3f c244dc1bc92e9 Author: Rafael J. Wysocki Date: Mon May 23 18:16:42 2022 +0200 Merge branch 'acpica' Merge ACPICA material for 5.19-rc1: - Add support for the Windows 11 _OSI string (Mario Limonciello) - Add the CFMWS subtable to the CEDT table (Lawrence Hileman). - iASL: NHLT: Treat Terminator as specific_config (Piotr Maziarz). - iASL: NHLT: Fix parsing undocumented bytes at the end of Endpoint Descriptor (Piotr Maziarz). - iASL: NHLT: Rename linux specific strucures to device_info (Piotr Maziarz). - Add new ACPI 6.4 semantics to Load() and LoadTable() (Bob Moore). - Clean up double word in comment (Tom Rix). - Update copyright notices to the year 2022 (Bob Moore). - Remove some tabs and // comments - automated cleanup (Bob Moore). - Replace zero-length array with flexible-array member (Gustavo A. R. Silva). - Interpreter: Add units to time variable names (Paul Menzel). - Add support for ARM Performance Monitoring Unit Table (Besar Wicaksono). - Inform users about ACPI spec violation related to sleep length (Paul Menzel). - iASL/MADT: Add OEM-defined subtable (Bob Moore). - Interpreter: Fix some typo mistakes (Selvarasu Ganesan). - Updates for revision E.d of IORT (Shameer Kolothum). - Use ACPI_FORMAT_UINT64 for 64-bit output (Bob Moore). - Update version to 20220331 (Bob Moore). * acpica: (21 commits) Revert "ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms" ACPICA: Update version to 20220331 ACPICA: exsystem.c: Use ACPI_FORMAT_UINT64 for 64-bit output ACPICA: IORT: Updates for revision E.d ACPICA: executer/exsystem: Fix some typo mistakes ACPICA: iASL/MADT: Add OEM-defined subtable ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms ACPICA: executer/exsystem: Inform users about ACPI spec violation ACPICA: Add support for ARM Performance Monitoring Unit Table. ACPICA: executer/exsystem: Add units to time variable names ACPICA: Headers: Replace zero-length array with flexible-array member ACPICA: Removed some tabs and // comments ACPICA: Update copyright notices to the year 2022 ACPICA: Clean up double word in comment ACPICA: Add new ACPI 6.4 semantics for LoadTable() operator ACPICA: Add new ACPI 6.4 semantics to the Load() operator ACPICA: iASL: NHLT: Rename linux specific strucures to device_info ACPICA: iASL: NHLT: Fix parsing undocumented bytes at the end of Endpoint Descriptor ACPICA: iASL: NHLT: Treat Terminator as specific_config ACPICA: Add the subtable CFMWS to the CEDT table ... commit 028818e374c8424641f42d09a03d3d9c88aa9cab Author: Rob Herring Date: Mon May 23 09:37:55 2022 -0500 Revert "dt-bindings: mailbox: qcom-ipcc: add missing properties into example" This reverts commit b20eee62ee89aba03261a1abac80f29abea5bdf5. The example has just been removed altogether in the mailbox tree. Reported-by: Krzysztof Kozlowski Signed-off-by: Rob Herring commit f292d875d0dc700b3af0bef04c5abc1dc7b3b62c Author: Masahiro Yamada Date: Fri May 13 20:39:21 2022 +0900 modpost: extract symbol versions from *.cmd files Currently, CONFIG_MODVERSIONS needs extra link to embed the symbol versions into ELF objects. Then, modpost extracts the version CRCs from them. The following figures show how it currently works, and how I am trying to change it. Current implementation ====================== |----------| embed CRC -------------------------->| final | $(CC) $(LD) / |---------| | link for | -----> *.o -------> *.o -->| modpost | | vmlinux | / / | |-- *.mod.c -->| or | / genksyms / |---------| | module | *.c ------> *.symversions |----------| Genksyms outputs the calculated CRCs in the form of linker script (*.symversions), which is used by $(LD) to update the object. If CONFIG_LTO_CLANG=y, the build process is much more complex. Embedding the CRCs is postponed until the LLVM bitcode is converted into ELF, creating another intermediate *.prelink.o. However, this complexity is unneeded. There is no reason why we must embed version CRCs in objects so early. There is final link stage for vmlinux (scripts/link-vmlinux.sh) and modules (scripts/Makefile.modfinal). We can link CRCs at the very last moment. New implementation ================== |----------| --------------------------------------->| final | $(CC) / |---------| | link for | -----> *.o ---->| | | vmlinux | / | modpost |--- .vmlinux.export.c -->| or | / genksyms | |--- *.mod.c ------------>| module | *.c ------> *.cmd -->|---------| |----------| Pass the symbol versions to modpost as separate text data, which are available in *.cmd files. This commit changes modpost to extract CRCs from *.cmd files instead of from ELF objects. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Reviewed-by: Sami Tolvanen Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 69c4cc99bbcbf3ef2e1901b569954e9226180840 Author: Masahiro Yamada Date: Thu May 12 01:45:04 2022 +0900 modpost: add sym_find_with_module() helper find_symbol() returns the first symbol found in the hash table. This table is global, so it may return a symbol from an unexpected module. There is a case where we want to search for a symbol with a given name in a specified module. Add sym_find_with_module(), which receives the module pointer as the second argument. It is equivalent to find_module() if NULL is passed as the module pointer. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM-14 (x86-64) commit 7f3113e3b9f7207f0bd57b5fdae1a1b9c8215e08 Author: Ahmad Fatoum Date: Fri May 13 16:57:05 2022 +0200 MAINTAINERS: add KEYS-TRUSTED-CAAM Create a maintainer entry for CAAM trusted keys in the Linux keyring. Reviewed-by: Pankaj Gupta Acked-by: Jarkko Sakkinen Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit 5002426e426166f57e1636b936666b275e6b3d2f Author: Ahmad Fatoum Date: Fri May 13 16:57:04 2022 +0200 doc: trusted-encrypted: describe new CAAM trust source Update documentation for trusted key use with the Cryptographic Acceleration and Assurance Module (CAAM), an IP on NXP SoCs. Reviewed-by: Pankaj Gupta Reviewed-by: Jarkko Sakkinen Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit e9c5048c2de1913d0bcd589bc1487810c2e24bc1 Author: Ahmad Fatoum Date: Fri May 13 16:57:03 2022 +0200 KEYS: trusted: Introduce support for NXP CAAM-based trusted keys The Cryptographic Acceleration and Assurance Module (CAAM) is an IP core built into many newer i.MX and QorIQ SoCs by NXP. The CAAM does crypto acceleration, hardware number generation and has a blob mechanism for encapsulation/decapsulation of sensitive material. This blob mechanism depends on a device specific random 256-bit One Time Programmable Master Key that is fused in each SoC at manufacturing time. This key is unreadable and can only be used by the CAAM for AES encryption/decryption of user data. This makes it a suitable backend (source) for kernel trusted keys. Previous commits generalized trusted keys to support multiple backends and added an API to access the CAAM blob mechanism. Based on these, provide the necessary glue to use the CAAM for trusted keys. Reviewed-by: David Gstir Reviewed-by: Pankaj Gupta Reviewed-by: Jarkko Sakkinen Tested-by: Tim Harvey Tested-by: Matthias Schiffer Tested-by: Pankaj Gupta Tested-by: Michael Walle # on ls1028a (non-E and E) Tested-by: John Ernberg # iMX8QXP Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit 007c3ff11f38d83cc95b0f402e432cbf484e3c31 Author: Ahmad Fatoum Date: Fri May 13 16:57:02 2022 +0200 crypto: caam - add in-kernel interface for blob generator The NXP Cryptographic Acceleration and Assurance Module (CAAM) can be used to protect user-defined data across system reboot: - When the system is fused and boots into secure state, the master key is a unique never-disclosed device-specific key - random key is encrypted by key derived from master key - data is encrypted using the random key - encrypted data and its encrypted random key are stored alongside - This blob can now be safely stored in non-volatile memory On next power-on: - blob is loaded into CAAM - CAAM writes decrypted data either into memory or key register Add functions to realize encrypting and decrypting into memory alongside the CAAM driver. They will be used in a later commit as a source for the trusted key seal/unseal mechanism. Reviewed-by: David Gstir Reviewed-by: Pankaj Gupta Tested-by: Tim Harvey Tested-by: Matthias Schiffer Tested-by: Pankaj Gupta Tested-by: Michael Walle # on ls1028a (non-E and E) Tested-by: John Ernberg # iMX8QXP Signed-off-by: Steffen Trumtrar Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit 7a0e7d5265f58eab5983f6560817d4fe9943743b Author: Ahmad Fatoum Date: Fri May 13 16:57:01 2022 +0200 crypto: caam - determine whether CAAM supports blob encap/decap Depending on SoC variant, a CAAM may be available, but with some futures fused out. The LS1028A (non-E) SoC is one such SoC and while it indicates BLOB support, BLOB operations will ultimately fail, because there is no AES support. Add a new blob_present member to reflect whether both BLOB support and the AES support it depends on is available. These will be used in a follow-up commit to allow blob driver initialization to error out on SoCs without the necessary hardware support instead of failing at runtime with a cryptic caam_jr 8020000.jr: 20000b0f: CCB: desc idx 11: : Invalid CHA selected. Co-developed-by: Michael Walle Signed-off-by: Michael Walle Tested-by: Michael Walle # on ls1028a (non-E and E) Signed-off-by: Ahmad Fatoum Reviewed-by: Pankaj Gupta Signed-off-by: Jarkko Sakkinen commit fcd7c26901c83681532c6daac599e53d4df11738 Author: Ahmad Fatoum Date: Fri May 13 16:57:00 2022 +0200 KEYS: trusted: allow use of kernel RNG for key material The two existing trusted key sources don't make use of the kernel RNG, but instead let the hardware doing the sealing/unsealing also generate the random key material. However, both users and future backends may want to place less trust into the quality of the trust source's random number generator and instead reuse the kernel entropy pool, which can be seeded from multiple entropy sources. Make this possible by adding a new trusted.rng parameter, that will force use of the kernel RNG. In its absence, it's up to the trust source to decide, which random numbers to use, maintaining the existing behavior. Suggested-by: Jarkko Sakkinen Acked-by: Sumit Garg Acked-by: Pankaj Gupta Reviewed-by: David Gstir Reviewed-by: Pankaj Gupta Reviewed-by: Jarkko Sakkinen Tested-by: Pankaj Gupta Tested-by: Michael Walle # on ls1028a (non-E and E) Tested-by: John Ernberg # iMX8QXP Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit be07858fbf8115fc74528292c2ee8775fe49116f Author: Ahmad Fatoum Date: Fri May 13 16:56:59 2022 +0200 KEYS: trusted: allow use of TEE as backend without TCG_TPM support With recent rework, trusted keys are no longer limited to TPM as trust source. The Kconfig symbol is unchanged however leading to a few issues: - TCG_TPM is required, even if only TEE is to be used - Enabling TCG_TPM, but excluding it from available trusted sources is not possible - TEE=m && TRUSTED_KEYS=y will lead to TEE support being silently dropped, which is not the best user experience Remedy these issues by introducing two new boolean Kconfig symbols: TRUSTED_KEYS_TPM and TRUSTED_KEYS_TEE with the appropriate dependencies. Any new code depending on the TPM trusted key backend in particular or symbols exported by it will now need to explicitly state that it depends on TRUSTED_KEYS && TRUSTED_KEYS_TPM The latter to ensure the dependency is built and the former to ensure it's reachable for module builds. There are no such users yet. Reviewed-by: Sumit Garg Reviewed-by: Jarkko Sakkinen Reviewed-by: Pankaj Gupta Tested-by: Pankaj Gupta Tested-by: Andreas Rammhold Tested-by: Tim Harvey Tested-by: Michael Walle # on ls1028a (non-E and E) Tested-by: John Ernberg # iMX8QXP Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen commit af402ee3c045b0cbd10b7e66d2431304ac9e69bb Author: Stefan Mahnke-Hartmann Date: Fri May 13 15:41:53 2022 +0200 tpm: Add field upgrade mode support for Infineon TPM2 modules TPM2_GetCapability with a capability that has the property type value of TPM_PT_TOTAL_COMMANDS returns a zero length list, when an Infineon TPM2 is in field upgrade mode. Since an Infineon TPM2.0 in field upgrade mode returns RC_SUCCESS on TPM2_Startup, the field upgrade mode has to be detected by TPM2_GetCapability. Signed-off-by: Stefan Mahnke-Hartmann Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit e57b2523bd37e6434f4e64c7a685e3715ad21e9a Author: Stefan Mahnke-Hartmann Date: Fri May 13 15:41:51 2022 +0200 tpm: Fix buffer access in tpm2_get_tpm_pt() Under certain conditions uninitialized memory will be accessed. As described by TCG Trusted Platform Module Library Specification, rev. 1.59 (Part 3: Commands), if a TPM2_GetCapability is received, requesting a capability, the TPM in field upgrade mode may return a zero length list. Check the property count in tpm2_get_tpm_pt(). Fixes: 2ab3241161b3 ("tpm: migrate tpm2_get_tpm_pt() to use struct tpm_buf") Cc: stable@vger.kernel.org Signed-off-by: Stefan Mahnke-Hartmann Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit e0687fe958f763f1790f22ed5483025b7624e744 Author: Uwe Kleine-König Date: Tue Apr 26 10:06:02 2022 +0200 char: tpm: cr50_i2c: Suppress duplicated error message in .remove() Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As tpm_cr50_i2c_remove() emits an error message already and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this error message. Note that if i2c_clientdata is NULL, there is something really fishy. Assuming no memory corruption happened (then all bets are lost anyhow), tpm_cr50_i2c_remove() is only called after tpm_cr50_i2c_probe() returned successfully. So there was a tpm chip registered before and after tpm_cr50_i2c_remove() its privdata is freed but the associated character device isn't removed. If after that happened userspace accesses the character device it's likely that the freed memory is accessed. For that reason the warning message is made a bit more frightening. Signed-off-by: Uwe Kleine-König Signed-off-by: Jarkko Sakkinen commit 9c438fdef8906fe9c025e0106cef6fe491728790 Author: Jes B. Klinke Date: Tue Apr 19 16:37:57 2022 -0700 tpm: cr50: Add new device/vendor ID 0x504a6666 Accept one additional numerical value of DID:VID for next generation Google TPM with new firmware, to be used in future Chromebooks. The TPM with the new firmware has the code name TI50, and is going to use the same interfaces. Signed-off-by: Jes B. Klinke Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 6422cbd3c52deb1d53a0e60c271f34d882ca8a9d Author: Johannes Holland Date: Mon Mar 21 10:09:24 2022 +0100 tpm: Remove read16/read32/write32 calls from tpm_tis_phy_ops Only tpm_tis and tpm_tis_synquacer have a dedicated way to access multiple bytes at once, every other driver will just fall back to read_bytes/write_bytes. Therefore, remove the read16/read32/write32 calls and move their logic to read_bytes/write_bytes. Suggested-by: Jarkko Sakkinen Signed-off-by: Johannes Holland Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit d0dc1a7100f19121f6e7450f9cdda11926aa3838 Author: Xiu Jianfeng Date: Fri Mar 18 14:02:01 2022 +0800 tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe() Currently it returns zero when CRQ response timed out, it should return an error code instead. Fixes: d8d74ea3c002 ("tpm: ibmvtpm: Wait for buffer to be set before proceeding") Signed-off-by: Xiu Jianfeng Reviewed-by: Stefan Berger Acked-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 80b8a39777a9161d77608ac702c7eeafce5ddce7 Author: Haowen Bai Date: Fri Mar 18 11:35:25 2022 +0800 tpm/tpm_ftpm_tee: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. Signed-off-by: Haowen Bai Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 4d99750106adbaecee587232f2589f65170d5ce4 Author: Mickaël Salaün Date: Tue Mar 22 12:13:23 2022 +0100 certs: Explain the rationale to call panic() The blacklist_init() function calls panic() for memory allocation errors. This change documents the reason why we don't return -ENODEV. Link: https://lore.kernel.org/r/20220322111323.542184-2-mic@digikod.net Link: https://lore.kernel.org/r/YjeW2r6Wv55Du0bJ@iki.fi Suggested-by: Paul Moore Reviewed-by: Paul Moore Reviewed-by: Jarkko Sakkinen Signed-off-by: Mickaël Salaün Signed-off-by: Jarkko Sakkinen commit 6364d106e0417e00eb5f223d8a90287d1c421ce0 Author: Mickaël Salaün Date: Mon Jul 12 19:03:13 2021 +0200 certs: Allow root user to append signed hashes to the blacklist keyring Add a kernel option SYSTEM_BLACKLIST_AUTH_UPDATE to enable the root user to dynamically add new keys to the blacklist keyring. This enables to invalidate new certificates, either from being loaded in a keyring, or from being trusted in a PKCS#7 certificate chain. This also enables to add new file hashes to be denied by the integrity infrastructure. Being able to untrust a certificate which could have normaly been trusted is a sensitive operation. This is why adding new hashes to the blacklist keyring is only allowed when these hashes are signed and vouched by the builtin trusted keyring. A blacklist hash is stored as a key description. The PKCS#7 signature of this description must be provided as the key payload. Marking a certificate as untrusted should be enforced while the system is running. It is then forbiden to remove such blacklist keys. Update blacklist keyring, blacklist key and revoked certificate access rights: * allows the root user to search for a specific blacklisted hash, which make sense because the descriptions are already viewable; * forbids key update (blacklist and asymmetric ones); * restricts kernel rights on the blacklist keyring to align with the root user rights. See help in tools/certs/print-cert-tbs-hash.sh . Cc: David Howells Cc: David Woodhouse Cc: Eric Snowberg Cc: Jarkko Sakkinen Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20210712170313.884724-6-mic@digikod.net Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit addf466389d9d78f255e8b15ac44ab4791029852 Author: Mickaël Salaün Date: Mon Jul 12 19:03:10 2021 +0200 certs: Check that builtin blacklist hashes are valid Add and use a check-blacklist-hashes.awk script to make sure that the builtin blacklist hashes set with CONFIG_SYSTEM_BLACKLIST_HASH_LIST will effectively be taken into account as blacklisted hashes. This is useful to debug invalid hash formats, and it make sure that previous hashes which could have been loaded in the kernel, but silently ignored, are now noticed and deal with by the user at kernel build time. This also prevent stricter blacklist key description checking (provided by following commits) to failed for builtin hashes. Update CONFIG_SYSTEM_BLACKLIST_HASH_LIST help to explain the content of a hash string and how to generate certificate ones. Cc: David Howells Cc: David Woodhouse Cc: Eric Snowberg Cc: Jarkko Sakkinen Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20210712170313.884724-3-mic@digikod.net Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit bf21dc591bb5f17ba4b29b84d4866e0adc39f57f Author: Mickaël Salaün Date: Mon Jul 12 19:03:11 2021 +0200 certs: Make blacklist_vet_description() more strict Before exposing this new key type to user space, make sure that only meaningful blacklisted hashes are accepted. This is also checked for builtin blacklisted hashes, but a following commit make sure that the user will notice (at built time) and will fix the configuration if it already included errors. Check that a blacklist key description starts with a valid prefix and then a valid hexadecimal string. Cc: David Howells Cc: David Woodhouse Cc: Eric Snowberg Signed-off-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20210712170313.884724-4-mic@digikod.net Signed-off-by: Jarkko Sakkinen commit 141e523914f72575915dd334fce3cef4fb0f1e91 Author: Mickaël Salaün Date: Mon Jul 12 19:03:12 2021 +0200 certs: Factor out the blacklist hash creation Factor out the blacklist hash creation with the get_raw_hash() helper. This also centralize the "tbs" and "bin" prefixes and make them private, which help to manage them consistently. Cc: David Howells Cc: David S. Miller Cc: David Woodhouse Cc: Eric Snowberg Cc: Herbert Xu Cc: Jarkko Sakkinen Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20210712170313.884724-5-mic@digikod.net Signed-off-by: Jarkko Sakkinen commit 58d416351e6df1a41d415958ccdd8eb9c2173fed Author: Mickaël Salaün Date: Mon Jul 12 19:03:09 2021 +0200 tools/certs: Add print-cert-tbs-hash.sh Add a new helper print-cert-tbs-hash.sh to generate a TBSCertificate hash from a given certificate. This is useful to generate a blacklist key description used to forbid loading a specific certificate in a keyring, or to invalidate a certificate provided by a PKCS#7 file. This kind of hash formatting is required to populate the file pointed out by CONFIG_SYSTEM_BLACKLIST_HASH_LIST, but only the kernel code was available to understand how to effectively create such hash. Cc: David Howells Cc: David Woodhouse Cc: Eric Snowberg Signed-off-by: Mickaël Salaün Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20210712170313.884724-2-mic@digikod.net Signed-off-by: Jarkko Sakkinen commit 2999e1e387271b3216c44168b0c5cc69f647f155 Author: Julia Lawall Date: Sat May 21 13:10:42 2022 +0200 writeback: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220521111145.81697-32-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jan Kara commit edcb185fa9c4f8fa1301f032fb503d2597a92b1e Author: Ahmad Fatoum Date: Sat May 21 22:10:50 2022 +0200 Bluetooth: hci_sync: use hci_skb_event() helper This instance is the only opencoded version of the macro, so have it follow suit. Signed-off-by: Ahmad Fatoum Signed-off-by: Marcel Holtmann commit f93afd8e7567fa9dcf0089ff4ce5a713bfb5dae7 Author: Stephen Boyd Date: Wed May 11 18:39:19 2022 -0700 dt-bindings: cros-ec: Fix a typo in description A 's/pf/of/' on rpmsg-name description. Signed-off-by: Stephen Boyd Acked-by: Rob Herring Reviewed-by: Guenter Roeck Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220512013921.164637-2-swboyd@chromium.org commit 6f6f84aa215f7b6665ccbb937db50860f9ec2989 Author: Zhang Xiaoxu Date: Sat May 21 12:08:45 2022 +0800 nfsd: Fix null-ptr-deref in nfsd_fill_super() KASAN report null-ptr-deref as follows: BUG: KASAN: null-ptr-deref in nfsd_fill_super+0xc6/0xe0 [nfsd] Write of size 8 at addr 000000000000005d by task a.out/852 CPU: 7 PID: 852 Comm: a.out Not tainted 5.18.0-rc7-dirty #66 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014 Call Trace: dump_stack_lvl+0x34/0x44 kasan_report+0xab/0x120 ? nfsd_mkdir+0x71/0x1c0 [nfsd] ? nfsd_fill_super+0xc6/0xe0 [nfsd] nfsd_fill_super+0xc6/0xe0 [nfsd] ? nfsd_mkdir+0x1c0/0x1c0 [nfsd] get_tree_keyed+0x8e/0x100 vfs_get_tree+0x41/0xf0 __do_sys_fsconfig+0x590/0x670 ? fscontext_read+0x180/0x180 ? anon_inode_getfd+0x4f/0x70 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae This can be reproduce by concurrent operations: 1. fsopen(nfsd)/fsconfig 2. insmod/rmmod nfsd Since the nfsd file system is registered before than nfsd_net allocated, the caller may get the file_system_type and use the nfsd_net before it allocated, then null-ptr-deref occurred. So init_nfsd() should call register_filesystem() last. Fixes: bd5ae9288d64 ("nfsd: register pernet ops last, unregister first") Signed-off-by: Zhang Xiaoxu Signed-off-by: Chuck Lever commit 62fdb65edb6c43306c774939001f3a00974832aa Author: Zhang Xiaoxu Date: Sat May 21 12:08:44 2022 +0800 nfsd: Unregister the cld notifier when laundry_wq create failed If laundry_wq create failed, the cld notifier should be unregistered. Signed-off-by: Zhang Xiaoxu Signed-off-by: Chuck Lever commit 28df0988815f63e2af5e6718193c9f68681ad7ff Author: Chuck Lever Date: Fri Apr 29 10:06:21 2022 -0400 SUNRPC: Use RMW bitops in single-threaded hot paths I noticed CPU pipeline stalls while using perf. Once an svc thread is scheduled and executing an RPC, no other processes will touch svc_rqst::rq_flags. Thus bus-locked atomics are not needed outside the svc thread scheduler. Signed-off-by: Chuck Lever commit bb283ca18d1e67c82d22a329c96c9d6036a74790 Author: Chuck Lever Date: Sun Mar 27 16:43:03 2022 -0400 NFSD: Clean up the show_nf_flags() macro The flags are defined using C macros, so TRACE_DEFINE_ENUM is unnecessary. Signed-off-by: Chuck Lever commit 0122e882119ddbd9efa6edfeeac3f5c704a7aeea Author: Chuck Lever Date: Sun Mar 27 16:42:20 2022 -0400 NFSD: Trace filecache opens Instrument calls to nfsd_open_verified() to get a sense of the filecache hit rate. Signed-off-by: Chuck Lever commit 7e2ce0cc15a509b859199235a2bad9cece00f67a Author: Chuck Lever Date: Wed Mar 23 13:55:37 2022 -0400 NFSD: Move documenting comment for nfsd4_process_open2() Clean up nfsd4_open() by converting a large comment at the only call site for nfsd4_process_open2() to a kerneldoc comment in front of that function. Signed-off-by: Chuck Lever commit 26320d7e317c37404c811603d50d811132aef78c Author: Chuck Lever Date: Mon Mar 21 16:41:32 2022 -0400 NFSD: Fix whitespace Clean up: Pull case arms back one tab stop to conform every other switch statement in fs/nfsd/nfs4proc.c. Signed-off-by: Chuck Lever commit f67a16b147045815b6aaafeef8663e5faeb6d569 Author: Chuck Lever Date: Wed Mar 30 14:28:51 2022 -0400 NFSD: Remove dprintk call sites from tail of nfsd4_open() Clean up: These relics are not likely to benefit server administrators. Signed-off-by: Chuck Lever commit fb70bf124b051d4ded4ce57511dfec6d3ebf2b43 Author: Chuck Lever Date: Wed Mar 30 10:30:54 2022 -0400 NFSD: Instantiate a struct file when creating a regular NFSv4 file There have been reports of races that cause NFSv4 OPEN(CREATE) to return an error even though the requested file was created. NFSv4 does not provide a status code for this case. To mitigate some of these problems, reorganize the NFSv4 OPEN(CREATE) logic to allocate resources before the file is actually created, and open the new file while the parent directory is still locked. Two new APIs are added: + Add an API that works like nfsd_file_acquire() but does not open the underlying file. The OPEN(CREATE) path can use this API when it already has an open file. + Add an API that is kin to dentry_open(). NFSD needs to create a file and grab an open "struct file *" atomically. The alloc_empty_file() has to be done before the inode create. If it fails (for example, because the NFS server has exceeded its max_files limit), we avoid creating the file and can still return an error to the NFS client. BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=382 Signed-off-by: Chuck Lever Tested-by: JianHong Yin commit 21a486c4a9b8cfcb5f11c854287f4b5d3f6af28c Author: Krzysztof Kozlowski Date: Wed May 4 10:43:04 2022 +0200 dt-bindings: mfd: wlf,arizona: Add spi-max-frequency The Wolfson Microelectronics Arizona audio can be connected via SPI bus (e.g. WM5110 on Exynos5433 TM2 board), so allow SPI peripheral properties. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220504084304.46173-1-krzysztof.kozlowski@linaro.org commit ade0642d7dcaff67fa5794770d5bec484c26cdfc Author: Uwe Kleine-König Date: Mon May 2 21:10:12 2022 +0200 mfd: rt4831: Improve error reporting for problems during .remove() Returning an error value in an i2c remove callback results in a generic error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. So instead of triggering the generic i2c error message, emit a more helpful message if a problem occurs and return 0 to suppress the generic message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220502191012.53259-1-u.kleine-koenig@pengutronix.de commit 0163717ed5dec4fc3aaf937baa9f66f21ca11c1d Merge: 1693e265e0a5d e5cd20e0d6713 Author: Takashi Iwai Date: Mon May 23 16:03:04 2022 +0200 Merge tag 'asoc-v5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.19 This is quite a big update, partly due to the addition of some larger drivers (more of which is to follow since at least the AVS driver is still a work in progress) and partly due to Charles' work sorting out our handling of endianness. As has been the case recently it's much more about drivers than the core. - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs. - Initial stages of Intel AVS driver merge. - Introduction of v4 IPC mechanism for SOF. - TDM mode support for AK4613. - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780 commit e4dd748dc87cf431af7b3954963be0d9f6150217 Author: Shengjiu Wang Date: Mon May 23 13:44:21 2022 +0800 ASoC: fsl_sai: Fix FSL_SAI_xDR/xFR definition There are multiple xDR and xFR registers, the index is from 0 to 7. FSL_SAI_xDR and FSL_SAI_xFR is abandoned, replace them with FSL_SAI_xDR0 and FSL_SAI_xFR0. Fixes: 4f7a0728b530 ("ASoC: fsl_sai: Add support for SAI new version") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1653284661-18964-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit f4d6aca0c80f09f4c780136a64ee039560a2c39b Author: Pierre-Louis Bossart Date: Fri May 20 16:06:15 2022 -0500 ASoC: soc-pcm: fix BE transition for TRIGGER_START A obvious editing mistake caught with a cppcheck warning sound/soc/soc-pcm.c:2132:8: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = soc_pcm_trigger(be_substream, cmd); ^ sound/soc/soc-pcm.c:2126:9: note: ret is assigned ret = soc_pcm_trigger(be_substream, ^ sound/soc/soc-pcm.c:2129:9: note: ret is assigned ret = soc_pcm_trigger(be_substream, ^ Fixes: 374b50e234a3e ('ASoC: soc-pcm: improve BE transition for TRIGGER_START') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220520210615.607229-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 311242c7703df0da14c206260b7e855f69cb0264 Author: Yang Yingliang Date: Tue Apr 26 11:08:57 2022 +0800 mfd: davinci_voicecodec: Fix possible null-ptr-deref davinci_vc_probe() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: b5e29aa880be ("mfd: davinci_voicecodec: Remove pointless #include") Signed-off-by: Yang Yingliang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220426030857.3539336-1-yangyingliang@huawei.com commit 4a37f3dd9a83186cb88d44808ab35b78375082c9 Author: Robin Murphy Date: Fri May 20 18:10:13 2022 +0100 dma-direct: don't over-decrypt memory The original x86 sev_alloc() only called set_memory_decrypted() on memory returned by alloc_pages_node(), so the page order calculation fell out of that logic. However, the common dma-direct code has several potential allocators, not all of which are guaranteed to round up the underlying allocation to a power-of-two size, so carrying over that calculation for the encryption/decryption size was a mistake. Fix it by rounding to a *number* of pages, rather than an order. Until recently there was an even worse interaction with DMA_DIRECT_REMAP where we could have ended up decrypting part of the next adjacent vmalloc area, only averted by no architecture actually supporting both configs at once. Don't ask how I found that one out... Fixes: c10f07aa27da ("dma/direct: Handle force decryption for DMA coherent buffers in common code") Signed-off-by: Robin Murphy Signed-off-by: Christoph Hellwig Acked-by: David Rientjes commit 5d2b6bc3a6a27ad265d2ec0d53dd7ef33bd314fc Author: Adrian Hunter Date: Tue May 17 16:10:11 2022 +0300 perf intel-pt: Add guest_code support A common case for KVM test programs is that the test program acts as the hypervisor, creating, running and destroying the virtual machine, and providing the guest object code from its own object code. In this case, the VM is not running an OS, but only the functions loaded into it by the hypervisor test program, and conveniently, loaded at the same virtual addresses. To support that, a new option "--guest-code" has been added in previous patches. In this patch, add support also to Intel PT. In particular, ensure guest_code thread is set up before attempting to walk object code or synthesize samples. Example: # perf record --kcore -e intel_pt/cyc/ -- tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.280 MB perf.data ] # perf script --guest-code --itrace=bep --ns -F-period,+addr,+flags [SNIP] tsc_msrs_test 18436 [007] 10897.962087733: branches: call ffffffffc13b2ff5 __vmx_vcpu_run+0x15 (vmlinux) => ffffffffc13b2f50 vmx_update_host_rsp+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962087733: branches: return ffffffffc13b2f5d vmx_update_host_rsp+0xd (vmlinux) => ffffffffc13b2ffa __vmx_vcpu_run+0x1a (vmlinux) tsc_msrs_test 18436 [007] 10897.962087733: branches: call ffffffffc13b303b __vmx_vcpu_run+0x5b (vmlinux) => ffffffffc13b2f80 vmx_vmenter+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962087836: branches: vmentry ffffffffc13b2f82 vmx_vmenter+0x2 (vmlinux) => 0 [unknown] ([unknown]) [guest/18436] 18436 [007] 10897.962087836: branches: vmentry 0 [unknown] ([unknown]) => 402c81 guest_code+0x131 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962087836: branches: call 402c81 guest_code+0x131 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 40dba0 ucall+0x0 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962088248: branches: vmexit 40dba0 ucall+0x0 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 0 [unknown] ([unknown]) tsc_msrs_test 18436 [007] 10897.962088248: branches: vmexit 0 [unknown] ([unknown]) => ffffffffc13b2fa0 vmx_vmexit+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962088248: branches: jmp ffffffffc13b2fa0 vmx_vmexit+0x0 (vmlinux) => ffffffffc13b2fd2 vmx_vmexit+0x32 (vmlinux) tsc_msrs_test 18436 [007] 10897.962088256: branches: return ffffffffc13b2fd2 vmx_vmexit+0x32 (vmlinux) => ffffffffc13b3040 __vmx_vcpu_run+0x60 (vmlinux) tsc_msrs_test 18436 [007] 10897.962088270: branches: return ffffffffc13b30b6 __vmx_vcpu_run+0xd6 (vmlinux) => ffffffffc13b2f2e vmx_vcpu_enter_exit+0x4e (vmlinux) [SNIP] tsc_msrs_test 18436 [007] 10897.962089321: branches: call ffffffffc13b2ff5 __vmx_vcpu_run+0x15 (vmlinux) => ffffffffc13b2f50 vmx_update_host_rsp+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962089321: branches: return ffffffffc13b2f5d vmx_update_host_rsp+0xd (vmlinux) => ffffffffc13b2ffa __vmx_vcpu_run+0x1a (vmlinux) tsc_msrs_test 18436 [007] 10897.962089321: branches: call ffffffffc13b303b __vmx_vcpu_run+0x5b (vmlinux) => ffffffffc13b2f80 vmx_vmenter+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962089424: branches: vmentry ffffffffc13b2f82 vmx_vmenter+0x2 (vmlinux) => 0 [unknown] ([unknown]) [guest/18436] 18436 [007] 10897.962089424: branches: vmentry 0 [unknown] ([unknown]) => 40dba0 ucall+0x0 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962089701: branches: jmp 40dc1b ucall+0x7b (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 40dc39 ucall+0x99 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962089701: branches: jcc 40dc3c ucall+0x9c (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 40dc20 ucall+0x80 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962089701: branches: jcc 40dc3c ucall+0x9c (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 40dc20 ucall+0x80 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962089701: branches: jcc 40dc37 ucall+0x97 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 40dc50 ucall+0xb0 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) [guest/18436] 18436 [007] 10897.962089878: branches: vmexit 40dc55 ucall+0xb5 (/home/ahunter/git/work/tools/testing/selftests/kselftest_install/kvm/tsc_msrs_test) => 0 [unknown] ([unknown]) tsc_msrs_test 18436 [007] 10897.962089878: branches: vmexit 0 [unknown] ([unknown]) => ffffffffc13b2fa0 vmx_vmexit+0x0 (vmlinux) tsc_msrs_test 18436 [007] 10897.962089878: branches: jmp ffffffffc13b2fa0 vmx_vmexit+0x0 (vmlinux) => ffffffffc13b2fd2 vmx_vmexit+0x32 (vmlinux) tsc_msrs_test 18436 [007] 10897.962089887: branches: return ffffffffc13b2fd2 vmx_vmexit+0x32 (vmlinux) => ffffffffc13b3040 __vmx_vcpu_run+0x60 (vmlinux) tsc_msrs_test 18436 [007] 10897.962089901: branches: return ffffffffc13b30b6 __vmx_vcpu_run+0xd6 (vmlinux) => ffffffffc13b2f2e vmx_vcpu_enter_exit+0x4e (vmlinux) [SNIP] # perf kvm --guest-code --guest --host report -i perf.data --stdio | head -20 # To display the perf.data header info, please use --header/--header-only options. # # # Total Lost Samples: 0 # # Samples: 12 of event 'instructions' # Event count (approx.): 2274583 # # Children Self Command Shared Object Symbol # ........ ........ ............. .................... ........................................... # 54.70% 0.00% tsc_msrs_test [kernel.vmlinux] [k] entry_SYSCALL_64_after_hwframe | ---entry_SYSCALL_64_after_hwframe do_syscall_64 | |--29.44%--syscall_exit_to_user_mode | exit_to_user_mode_prepare | task_work_run | __fput For more information about Perf tools support for Intel® Processor Trace refer: https://perf.wiki.kernel.org/index.php/Perf_tools_support_for_Intel%C2%AE_Processor_Trace Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 512a09fb96563b848e4a089e9a86f21052a2db5b Author: Adrian Hunter Date: Tue May 17 16:10:10 2022 +0300 perf kvm report: Add guest_code support Add an option to indicate that guest code can be found in the hypervisor process. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5b208144602f7557f569a26b907da2283cc9b4ac Author: Adrian Hunter Date: Tue May 17 16:10:09 2022 +0300 perf script: Add guest_code support Add an option to indicate that guest code can be found in the hypervisor process. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 096fc361800db54d8e4cf4bb58c11e31146fcedd Author: Adrian Hunter Date: Tue May 17 16:10:08 2022 +0300 perf tools: Add guest_code support A common case for KVM test programs is that the test program acts as the hypervisor, creating, running and destroying the virtual machine, and providing the guest object code from its own object code. In this case, the VM is not running an OS, but only the functions loaded into it by the hypervisor test program, and conveniently, loaded at the same virtual addresses. Normally to resolve addresses, MMAP events are needed to map addresses back to the object code and debug symbols for that object code. Currently, there is no way to get such mapping information from guests but, in the scenario described above, the guest has the same mappings as the hypervisor, so support for that scenario can be achieved. To support that, copy the host thread's maps to the guest thread's maps. Note, we do not discover the guest until we encounter a guest event, which works well because it is not until then that we know that the host thread's maps have been set up. Typically the main function for the guest object code is called "guest_code", hence the name chosen for this feature. Note, that is just a convention, the function could be named anything, and the tools do not care. This is primarily aimed at supporting Intel PT, or similar, where trace data can be recorded for a guest. Refer to the final patch in this series "perf intel-pt: Add guest_code support" for an example. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c98e064d540cf88ccd7f9d20b0e1c1bbe5f82810 Author: Adrian Hunter Date: Tue May 17 16:10:07 2022 +0300 perf tools: Factor out thread__set_guest_comm() Factor out thread__set_guest_comm() so it can be reused. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a088031c4998297c86a06d925cc0f38508205950 Author: Adrian Hunter Date: Tue May 17 16:10:06 2022 +0300 perf tools: Add machine to machines back pointer When dealing with guest machines, it can be necessary to get a reference to the host machine. Add a machines pointer to struct machine to make that possible. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220517131011.6117-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 67322d13fe3043c81b54b7efa919b800e3d4374a Author: Nick Forrington Date: Tue May 17 14:58:05 2022 +0100 perf vendors events arm64: Update Cortex A57/A72 Categorise and add missing PMU events for Cortex-A57/A72, based on: https://github.com/ARM-software/data/blob/master/pmu/cortex-a57.json https://github.com/ARM-software/data/blob/master/pmu/cortex-a72.json These contain the same events, and are based on the Arm Technical Reference Manuals for Cortex-A57 and Cortex-A72. Reviewed-by: John Garry Signed-off-by: Nick Forrington Acked-by: Florian Fainelli Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220517135805.313184-2-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 2531169eeaae8eb187762f843a3d5c3ae66b83d0 Author: Nick Forrington Date: Fri May 20 19:14:55 2022 +0100 perf vendors events arm64: Arm Neoverse E1 Add PMU events for Arm Neoverse E1 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/neoverse-e1.json which is based on PMU event descriptions from the Arm Neoverse E1 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-14-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 7227fed42533e218d9ac97c3a4daec3e64365fed Author: Nick Forrington Date: Fri May 20 19:14:54 2022 +0100 perf vendors events arm64: Arm Cortex-X2 Add PMU events for Arm Cortex-X2 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-x2.json which is based on PMU event descriptions from the Arm Cortex-X2 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-13-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 30bb078aa0a9559e0b1d024f6f6ed7eaa6431a75 Author: Nick Forrington Date: Fri May 20 19:14:53 2022 +0100 perf vendors events arm64: Arm Cortex-X1 Add PMU events for Arm Cortex-X1 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-x1.json which is based on PMU event descriptions from the Arm Cortex-X1 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-12-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit cceb5f9713a955ea23235133b1cf1f83eb1e9015 Author: Nick Forrington Date: Fri May 20 19:14:52 2022 +0100 perf vendors events arm64: Arm Cortex-A710 Add PMU events for Arm Cortex-A710 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a710.json which is based on PMU event descriptions from the Arm Cortex-A710 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-11-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit cf57baf0078fe327c2b168a8ca63a5984b23e991 Author: Nick Forrington Date: Fri May 20 19:14:51 2022 +0100 perf vendors events arm64: Arm Cortex-A78 Add PMU events for Arm Cortex-A78 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a78.json which is based on PMU event descriptions from the Arm Cortex-A78 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-10-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 45bd52fae0e18ba268ec5995a665edcd95b3118a Author: Nick Forrington Date: Fri May 20 19:14:50 2022 +0100 perf vendors events arm64: Arm Cortex-A77 Add PMU events for Arm Cortex-A77 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a77.json which is based on PMU event descriptions from the Arm Cortex-A77 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-9-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 387b5a8db3e206682838486609c58d2c39f2c7c3 Author: Nick Forrington Date: Fri May 20 19:14:49 2022 +0100 perf vendors events arm64: Arm Cortex-A75 Add PMU events for Arm Cortex-A75 Add corresponding common events Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a75.json which is based on PMU event descriptions from the Arm Cortex-A75 Technical Reference Manual. Common event data based on: https://github.com/ARM-software/data/blob/master/pmu/common_armv9.json which is based on PMU event descriptions found in the Arm Architecture Reference Manual: https://developer.arm.com/documentation/ddi0487/ Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-8-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 64a091c67aa8437cb233bfe67c32ae8c29b0c53a Author: Nick Forrington Date: Fri May 20 19:14:48 2022 +0100 perf vendors events arm64: Arm Cortex-A73 Add PMU events for Arm Cortex-A73 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a73.json which is based on PMU event descriptions from the Arm Cortex-A73 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-7-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6951dee81215f3238c1df5dd1ce6cb35863b11d5 Author: Nick Forrington Date: Fri May 20 19:14:47 2022 +0100 perf vendors events arm64: Arm Cortex-A65 Add PMU events for Arm Cortex-A65 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a65.json which is based on PMU event descriptions from the Arm Cortex-A65 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-6-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3935c302c2eed16b477f6964e4ca5741242ab844 Author: Nick Forrington Date: Fri May 20 19:14:46 2022 +0100 perf vendors events arm64: Arm Cortex-A510 Add PMU events for Arm Cortex-A510 Add corresponding common events Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a510.json which is based on PMU event descriptions from the Arm Cortex-A510 Technical Reference Manual. Common event data based on: https://github.com/ARM-software/data/blob/master/pmu/common_armv9.json which is based on PMU event descriptions found in the Arm Architecture Reference Manual: https://developer.arm.com/documentation/ddi0487/ Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-5-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit fbb6b31aa80c804729812abb3159dbf729f6596f Author: Nick Forrington Date: Fri May 20 19:14:45 2022 +0100 perf vendors events arm64: Arm Cortex-A55 Add PMU events for Arm Cortex-A55 Add corresponding common events Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a55.json which is based on PMU event descriptions from the Arm Cortex-A55 Technical Reference Manual. Common event data based on: https://github.com/ARM-software/data/blob/master/pmu/common_armv9.json which is based on PMU event descriptions found in the Arm Architecture Reference Manual: https://developer.arm.com/documentation/ddi0487/ Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-4-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b5d03547f6a49b4053c4fa366e5a0695d2dc3daa Author: Nick Forrington Date: Fri May 20 19:14:44 2022 +0100 perf vendors events arm64: Arm Cortex-A35 Add PMU events for Arm Cortex-A35 Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a35.json which is based on PMU event descriptions from the Arm Cortex-A35 Technical Reference Manual. Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-3-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ee2409510cf41556bd5d108711e08d0c6e9e8c23 Author: Nick Forrington Date: Fri May 20 19:14:43 2022 +0100 perf vendors events arm64: Arm Cortex-A34 Add PMU events for Arm Cortex-A34 Add corresponding common events Update mapfile.csv Event data based on: https://github.com/ARM-software/data/tree/master/pmu/cortex-a34.json which is based on PMU event descriptions from the Arm Cortex-A34 Technical Reference Manual. Common event data based on: https://github.com/ARM-software/data/blob/master/pmu/common_armv9.json which is based on PMU event descriptions found in the Arm Architecture Reference Manual: https://developer.arm.com/documentation/ddi0487/ Mapping data (for mapfile.csv) based on: https://github.com/ARM-software/data/blob/master/cpus.json which is based on Main ID Register (MIDR) information found in the Arm Technical Reference Manuals for individual CPUs. Reviewed-by: John Garry Signed-off-by: Nick Forrington Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrew Kilroy Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain 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/20220520181455.340344-2-nick.forrington@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d8fc08550929bb845c13cfefcc632a69fcf79b2c Author: Adrian Hunter Date: Fri May 20 16:24:04 2022 +0300 perf inject: Keep a copy of kcore_dir If the input perf.data has a kcore_dir, copy it into the output, since at least the kallsyms in the kcore_dir will be useful to the output. Example: Before: $ ls -lR perf.data-from-desktop perf.data-from-desktop: total 916 -rw------- 1 user user 931756 May 19 09:55 data drwx------ 2 user user 4096 May 19 09:55 kcore_dir perf.data-from-desktop/kcore_dir: total 42952 -r-------- 1 user user 7582467 May 19 09:55 kallsyms -r-------- 1 user user 36388864 May 19 09:55 kcore -r-------- 1 user user 4828 May 19 09:55 modules $ perf inject -i perf.data-from-desktop -o injected-perf.data $ ls -lR injected-perf.data -rw------- 1 user user 931320 May 20 15:08 injected-perf.data After: $ perf inject -i perf.data-from-desktop -o injected-perf.data $ ls -lR injected-perf.data injected-perf.data: total 916 -rw------- 1 user user 931320 May 20 15:21 data drwx------ 2 user user 4096 May 20 15:21 kcore_dir injected-perf.data/kcore_dir: total 42952 -r-------- 1 user user 7582467 May 20 15:21 kallsyms -r-------- 1 user user 36388864 May 20 15:21 kcore -r-------- 1 user user 4828 May 20 15:21 modules Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220520132404.25853-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a4455e0053aacf4ae088530dc045d50f4ea471e3 Author: Adrian Hunter Date: Fri May 20 16:24:03 2022 +0300 perf data: Add has_kcore_dir() Add a helper function has_kcore_dir(), so that perf inject can determine if it needs to keep the kcore_dir. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220520132404.25853-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 180b3d06263ce70dd0622681237cf5c0555d9ca0 Author: Adrian Hunter Date: Fri May 20 16:24:02 2022 +0300 perf inject: Keep some features sections from input file perf inject overwrites feature sections with information from the current machine. It makes more sense to keep original information that describes the machine or software when perf record was run. Example: perf.data from "Desktop" injected on "nuc11" Before: $ perf script --header-only -i perf.data-from-desktop | head -15 # ======== # captured on : Thu May 19 09:55:50 2022 # header version : 1 # data offset : 1208 # data size : 837480 # feat offset : 838688 # hostname : Desktop # os release : 5.13.0-41-generic # perf version : 5.18.rc5.gac837f7ca7ed # arch : x86_64 # nrcpus online : 28 # nrcpus avail : 28 # cpudesc : Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz # cpuid : GenuineIntel,6,85,4 # total memory : 65548656 kB $ perf inject -i perf.data-from-desktop -o injected-perf.data $ perf script --header-only -i injected-perf.data | head -15 # ======== # captured on : Fri May 20 15:06:55 2022 # header version : 1 # data offset : 1208 # data size : 837480 # feat offset : 838688 # hostname : nuc11 # os release : 5.17.5-local # perf version : 5.18.rc5.g0f828fdeb9af # arch : x86_64 # nrcpus online : 8 # nrcpus avail : 8 # cpudesc : 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz # cpuid : GenuineIntel,6,140,1 # total memory : 16012124 kB After: $ perf inject -i perf.data-from-desktop -o injected-perf.data $ perf script --header-only -i injected-perf.data | head -15 # ======== # captured on : Fri May 20 15:08:54 2022 # header version : 1 # data offset : 1208 # data size : 837480 # feat offset : 838688 # hostname : Desktop # os release : 5.13.0-41-generic # perf version : 5.18.rc5.gac837f7ca7ed # arch : x86_64 # nrcpus online : 28 # nrcpus avail : 28 # cpudesc : Intel(R) Core(TM) i9-9940X CPU @ 3.30GHz # cpuid : GenuineIntel,6,85,4 # total memory : 65548656 kB Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220520132404.25853-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 618ee7838e409513635320ca9c4c8d52c44f2dd0 Author: Adrian Hunter Date: Fri May 20 18:56:04 2022 +0300 libperf: Add preadn() Add preadn() to provide pread() and readn() semantics. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/ab8918a4-7ac8-a37e-2e2c-28438c422d87@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 237c96b8c1584d4c28d3593e5f52508fbec9ff06 Author: Adrian Hunter Date: Fri May 20 16:24:00 2022 +0300 perf header: Add ability to keep feature sections Many feature sections should not be re-written during perf inject. In preparation to support that, add callbacks that a tool can use to copy a feature section from elsewhere. perf inject will use this facility to copy features sections from the input file. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220520132404.25853-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit eeb0a442da2fbf9617e9f934026958f782b1beef Author: Gaggery Tsai Date: Fri May 20 12:35:37 2022 -0700 mfd: intel-lpss: Add support for ADL-P i2c6 and i2c7 Added 8086:51d8 and 8086:51d9 to the intel_lpss_pci driver. They are Intel Alder Lake-P i2c controllers. Signed-off-by: Gaggery Tsai Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220520193537.26090-1-gaggery.tsai@intel.com commit 1634b5a1f11cf407255d42fcc1d6bf257d16adab Author: Ian Rogers Date: Wed May 11 14:15:23 2022 -0700 perf jevents: Modify match field The match_field function looks for json values to append to the event string. As the C code processes these in order the output order matches that in the json dictionary. Python json readers read the entire dictionary and lose the ordering. To make the python and C output comparable make the C code first read the extra fields then append them to the event in an order not determined by their order in the file. Modify the pmu-events test so that test expectations match the new order. Reviewed-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Andi Kleen Cc: Andrew Kilroy Cc: Caleb Biggers Cc: Felix Fietkau Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Like Xu Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Forrington Cc: Paul Clarke Cc: Perry Taylor Cc: Peter Zijlstra Cc: Qi Liu Cc: Ravi Bangoria Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Will Deacon Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220511211526.1021908-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit afba2b08e12392c690b5962dacb73726457a1f6e Author: Ian Rogers Date: Wed May 11 14:15:22 2022 -0700 perf vendor events: Fix Ivytown UNC_M_ACT_COUNT.RD umask The event had two umasks with the umask of 3 being correct. Note: this change wasn't automatically generated as there is no CSV for Ivytown uncore events at: https://github.com/intel/event-converter-for-linux-perf Reviewed-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Andi Kleen Cc: Andrew Kilroy Cc: Caleb Biggers Cc: Felix Fietkau Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Like Xu Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Forrington Cc: Paul Clarke Cc: Perry Taylor Cc: Peter Zijlstra Cc: Qi Liu Cc: Ravi Bangoria Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Will Deacon Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220511211526.1021908-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a583bf18784a854cffaa3dc7ee23d286b04b1cd3 Author: Ian Rogers Date: Wed May 11 14:15:21 2022 -0700 perf vendor events: Fix Alderlake metric groups Remove unnecessary empty groups. Reviewed-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Andi Kleen Cc: Andrew Kilroy Cc: Caleb Biggers Cc: Felix Fietkau Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Like Xu Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Forrington Cc: Paul Clarke Cc: Perry Taylor Cc: Peter Zijlstra Cc: Qi Liu Cc: Ravi Bangoria Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Will Deacon Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220511211526.1021908-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fcb120d50c944fc2a02103d6a1f093a5b665a924 Author: Ian Rogers Date: Wed May 11 14:15:20 2022 -0700 perf jevents: Append PMU description later Append the PMU information from "Unit" to the description later. This avoids a problem when "Unit" appears early in a json event and the information prepends the description rather than being the expected suffix. Update the pmu-events test so that expectations now match the improved output. Reviewed-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Ananth Narayan Cc: Andi Kleen Cc: Andrew Kilroy Cc: Caleb Biggers Cc: Felix Fietkau Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Like Xu Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick Forrington Cc: Paul Clarke Cc: Perry Taylor Cc: Peter Zijlstra Cc: Qi Liu Cc: Ravi Bangoria Cc: Sandipan Das Cc: Santosh Shukla Cc: Stephane Eranian Cc: Will Deacon Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220511211526.1021908-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2cf88f4614c996e563adad75c501802d86c29324 Author: Ian Rogers Date: Tue May 17 21:20:27 2022 -0700 perf test: Use skip in PERF_RECORD_* Check if the error code is EACCES and make the test a skip with a "permissions" skip reason if so. Committer testing: Before: $ perf test PERF_RECORD 8: PERF_RECORD_* events & perf_sample fields : FAILED! $ After: $ perf test PERF_RECORD 8: PERF_RECORD_* events & perf_sample fields : Skip (permissions) $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7741e03e808a85acdcc12dcfb79d9df519439c83 Author: Ian Rogers Date: Tue May 17 21:20:26 2022 -0700 perf test: Parse events break apart tests Break multiple tests in the main test into individual test cases. Make better use of skip and add reasons. Skip also for parse event permission issues (detected by searching the error string). Rather than break out of tests on the first failure, keep going and logging to pr_debug. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8252e7917ea21d60ae1bbd919d65c4ca98085831 Author: Ian Rogers Date: Tue May 17 21:20:25 2022 -0700 perf test: Parse events tidy evlist_test Remove two unused variables. Make structs const. Also fix the array index (aka id) for the event software/r0x1a/. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b58eca408c15f2945e60232bc76d600426a8ad4c Author: Ian Rogers Date: Tue May 17 21:20:24 2022 -0700 perf test: Parse events tidy terms_test Remove an unused variables. Make structs const. Fix checkpatch issue wrt unsigned not being with an int. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7312c36ce6cdd307e10a8f223a1e05447e39cfc5 Author: Ian Rogers Date: Tue May 17 21:20:23 2022 -0700 perf test: Basic mmap use skip If opening the event fails for basic mmap with EACCES it is more likely permission related that a true error. Mark the test as skip in this case and add a skip reason. Committer testing: Before: $ perf test "mmap interface" 4: Read samples using the mmap interface : FAILED! $ After: $ perf test "mmap interface" 4: Read samples using the mmap interface : Skip (permissions) $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f9b10c82faf5859262de10ea30261391e117b9bd Author: Ian Rogers Date: Tue May 17 21:20:22 2022 -0700 perf test: Use skip in openat syscall Failures to open the tracepoint cause this test to fail, however, typically such failures are permission related. Lower the failure to just skipping the test in those cases and add a skip reason. Committer testing: Before: $ perf test "openat syscall" 2: Detect openat syscall event : FAILED! 3: Detect openat syscall event on all cpus : FAILED! $ After: $ perf test "openat syscall" 2: Detect openat syscall event : Skip (permissions) 3: Detect openat syscall event on all cpus : Skip (permissions) $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 740f8a82410bf36650d9efa179cc84d6c8a5c89a Author: Ian Rogers Date: Tue May 17 21:20:21 2022 -0700 perf test: Use skip in vmlinux kallsyms Currently failures in reading vmlinux or kallsyms result in a test failure. However, the failure is typically permission related. Prefer to flag these failures as skip. Committer testing: Before: $ perf test vmlinux 1: vmlinux symtab matches kallsyms : FAILED! $ After: $ perf test vmlinux 1: vmlinux symtab matches kallsyms : Skip $ Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cfa5013a41fa1a07f22a8c300453cf2f0037bc81 Author: Ian Rogers Date: Tue May 17 21:20:20 2022 -0700 perf test: Skip reason for suites with 1 test When a suite has just 1 subtest, the subtest number is given as -1 to avoid indented printing. When this subtest number is seen for the skip reason, use the reason of the first test. Reviewed-by: John Garry Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Carsten Haitzler Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Michael Petlan Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Sohaib Mohamed Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220518042027.836799-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0b9462d0ac10627368cf47cd4125714004d99b7f Author: Ian Rogers Date: Wed May 18 20:20:05 2022 -0700 perf stat: Make use of index clearer with perf_counts Try to disambiguate further when perf_counts is being accessed it is with a cpu map index rather than a CPU. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Dave Marchevsky Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Kan Liang Cc: Lv Ruyi Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stephane Eranian Cc: Xing Zhengjun Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220519032005.1273691-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 54668a4ea03e317049b801c419c78e3ec4f366e6 Author: Ian Rogers Date: Wed May 18 20:20:04 2022 -0700 perf bpf_counter: Tidy use of CPU map index BPF counters are typically running across all CPUs and so the CPU map index and CPU number are the same. There may be cases with offline CPUs where this isn't the case and so ensure the cpu map index for perf_counts is going to be a valid index by explicitly iterating over the CPU map. This also makes it clearer that users of perf_counts are using an index. Collapse some multiple uses of perf_counts into single uses. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Dave Marchevsky Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Kan Liang Cc: Lv Ruyi Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stephane Eranian Cc: Xing Zhengjun Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220519032005.1273691-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e696f6dbbf9d5c88922a4e2c9ee2ed9b495285ca Author: Ian Rogers Date: Wed May 18 20:20:03 2022 -0700 perf cpumap: Add perf_cpu_map__for_each_idx() A variant of perf_cpu_map__for_each_cpu() that just iterates index values without the corresponding load of the CPU. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Dave Marchevsky Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Kan Liang Cc: Lv Ruyi Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stephane Eranian Cc: Xing Zhengjun Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220519032005.1273691-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0dd9769f0cb0da5a7a3987942b479398f343ef30 Author: Ian Rogers Date: Wed May 18 20:20:02 2022 -0700 perf stat: Add stat record+report test This would have caught: "Subject: Re: perf stat report segfaults" https://lore.kernel.org/linux-perf-users/CAP-5=fWQR=sCuiSMktvUtcbOLidEpUJLCybVF6=BRvORcDOq+g@mail.gmail.com/ Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Dave Marchevsky Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Kan Liang Cc: Lv Ruyi Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Song Liu Cc: Stephane Eranian Cc: Xing Zhengjun Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220519032005.1273691-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7c3bcbdf449fe591c9b68521b45869669ec76010 Author: Namhyung Kim Date: Fri May 20 18:08:11 2022 -0700 perf lock: Add -t/--thread option for report The -t option is to show per-thread lock stat like below: $ perf lock report -t -F acquired,contended,avg_wait Name acquired contended avg wait (ns) perf 240569 9 5784 swapper 106610 19 543 :15789 17370 2 14538 ContainerMgr 8981 6 874 sleep 5275 1 11281 ContainerThread 4416 4 944 RootPressureThr 3215 5 1215 rcu_preempt 2954 0 0 ContainerMgr 2560 0 0 unnamed 1873 0 0 EventManager_De 1845 1 636 futex-default-S 1609 0 0 ... Committer notes: Add that option to the 'perf lock report' man page. Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220521010811.932703-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 79d9333b85910a73e39233d6190e60f903d120b6 Author: Namhyung Kim Date: Fri May 20 18:08:10 2022 -0700 perf lock: Do not discard broken lock stats Currently it discards a lock_stat for a lock instance when there's a broken lock_seq_stat in a single task for the lock. But it also means that the existing (and later) valid lock stat info for that lock will be discarded as well. This is not ideal since we can lose many valuable info because of a single failure. Actually those failures are indepent to the existing stat. So we can only discard the broken lock_seq_stat but keep the valid lock_stat. The discarded lock_seq_stat will be reallocated in a subsequent event with SEQ_STATE_UNINITIALIZED which will be ignored until it see the start of the next sequence. So it should be ok just free it. Before: $ perf lock report -F acquired,contended,avg_wait Warning: Processed 1401603 events and lost 18 chunks! Check IO/CPU overload! Name acquired contended avg wait (ns) rcu_read_lock 251225 0 0 &(ei->i_block_re... 8731 0 0 &sb->s_type->i_l... 8731 0 0 hrtimer_bases.lock 5261 0 0 hrtimer_bases.lock 2626 0 0 hrtimer_bases.lock 1953 0 0 hrtimer_bases.lock 1382 0 0 cpu_hotplug_lock 1350 0 0 hrtimer_bases.lock 1273 0 0 hrtimer_bases.lock 1269 0 0 hrtimer_bases.lock 1198 0 0 ... New: Name acquired contended avg wait (ns) rcu_read_lock 251225 0 0 tk_core.seq.seqc... 54074 0 0 &xa->xa_lock 17470 0 0 &ei->i_es_lock 17464 0 0 &ei->i_raw_lock 9391 0 0 &mapping->privat... 8734 0 0 &ei->i_data_sem 8731 0 0 &(ei->i_block_re... 8731 0 0 &sb->s_type->i_l... 8731 0 0 jiffies_seq.seqc... 6953 0 0 &mm->mmap_lock 6889 0 0 balancing 5768 0 0 hrtimer_bases.lock 5261 0 0 ... Signed-off-by: Namhyung Kim Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220521010811.932703-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 12aeaaba087d6d922423e88b0de7d145bc5d8de7 Author: Leo Yan Date: Wed May 18 13:57:21 2022 +0800 perf c2c: Update documentation for store metric 'N/A' The 'N/A' metric is added for store operations, update documentation to reflect changes in the report table. Signed-off-by: Leo Yan Acked-by: Jiri Olsa Cc: Adam Li Cc: Alexander Shishkin Cc: Ali Saidi Cc: Alyssa Ross Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Li Huafei Cc: Like Xu Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220518055729.1869566-4-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 550b4d6f9a7e5ddc99d7d13652ba9e859d0e5361 Author: Leo Yan Date: Wed May 18 13:57:20 2022 +0800 perf c2c: Add dimensions for 'N/A' metrics of store operation Since now we have the statistics 'st_na' for store operations, add dimensions for the 'N/A' (no available memory level) metrics and the associated percentage calculation for the single cache line view. Signed-off-by: Leo Yan Acked-by: Jiri Olsa Cc: Adam Li Cc: Alexander Shishkin Cc: Ali Saidi Cc: Alyssa Ross Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Li Huafei Cc: Like Xu Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220518055729.1869566-3-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 98450637107254242dc71675b0ce98d582d5fcb9 Author: Leo Yan Date: Wed May 18 13:57:19 2022 +0800 perf mem: Add stats for store operation with no available memory level Sometimes we don't know memory store operations happen on exactly which memory (or cache) level, the memory level flag is set to PERF_MEM_LVL_NA in this case; a practical example is Arm SPE AUX trace sets this flag for all store operations due to absent info for cache level. This patch is to add a new item "st_na" in structure c2c_stats to add statistics for store operations with no available cache level. Signed-off-by: Leo Yan Acked-by: Jiri Olsa Cc: Adam Li Cc: Alexander Shishkin Cc: Ali Saidi Cc: Alyssa Ross Cc: German Gomez Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Joe Mario Cc: Kajol Jain Cc: Kan Liang Cc: Li Huafei Cc: Like Xu Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220518055729.1869566-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 508c9fbce0d30da3cdfe699ae5530aed82a09399 Author: Ian Rogers Date: Fri May 20 14:18:26 2022 -0700 perf build: Error for BPF skeletons without LIBBPF LIBBPF requires LIBELF so doing "make BUILD_BPF_SKEL=1 NO_LIBELF=1" fails with compiler errors about missing declarations. Similar could happen if libbpf feature detection fails. Prefer to error when BUILD_BPF_SKEL is enabled but LIBBPF isn't. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Ingo Molnar Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220520211826.1828180-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0869331fbaa2c11c9e94e45305d17ce447189a0a Merge: e0e14cdff31d3 4b0986a3613c9 Author: Arnaldo Carvalho de Melo Date: Mon May 23 09:32:49 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To get the rest of 5.18. Signed-off-by: Arnaldo Carvalho de Melo commit 5d05426e2d5fd7df8afc866b78c36b37b00188b7 Author: Ming Lei Date: Sun May 22 20:23:50 2022 +0800 blk-mq: don't touch ->tagset in blk_mq_get_sq_hctx blk_mq_run_hw_queues() could be run when there isn't queued request and after queue is cleaned up, at that time tagset is freed, because tagset lifetime is covered by driver, and often freed after blk_cleanup_queue() returns. So don't touch ->tagset for figuring out current default hctx by the mapping built in request queue, so use-after-free on tagset can be avoided. Meantime this way should be fast than retrieving mapping from tagset. Cc: "yukuai (C)" Cc: Jan Kara Fixes: b6e68ee82585 ("blk-mq: Improve performance of non-mq IO schedulers with multiple HW queues") Signed-off-by: Ming Lei Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220522122350.743103-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit c1770918492414e8dc103d996f3f3860ee0bfd6c Author: Helge Deller Date: Tue May 17 17:14:03 2022 +0200 parisc: Optimize tmpalias function calls Instead of converting the physical address of the tmpalias mapping to the tlb insert format inside all the various tmpalias functions, move this conversion over to the DTLB miss handler. The physical address is already in %r26 (or will be calculated into %r23), so there are no additional steps needed in the functions themselves. Additionally use the dep_safe() and depi_safe() macros to avoid differentiating between 32- and 64-bit builds and as such make the code much more readable. The check if "ldil L%(TMPALIAS_MAP_START)" will sign extend into the upper 32 bits can be dropped, because we added a compile time check in an earlier patch. Signed-off-by: Helge Deller commit cdd00fe6aa52870b54797e1386aac6202d916763 Author: Helge Deller Date: Tue May 17 17:03:01 2022 +0200 parisc: Add dep_safe() macro to deposit a register in 32- and 64-kernels Signed-off-by: Helge Deller commit be6aee1392c46cd6f537aea75b1ce7ec427d36f4 Author: Helge Deller Date: Tue May 17 17:01:12 2022 +0200 parisc: Fix wrong comment for shr macro The comment that the source and target register can not be the same is wrong. Instead on PA2.0 usage of extru can clobber upper 32-bits. This patch fixes the comment. Signed-off-by: Helge Deller commit 44eeb9b56774c6f87155132a92252410e4610384 Author: Helge Deller Date: Tue May 17 16:57:06 2022 +0200 parisc: Prevent ldil() to sign-extend into upper 32 bits Add some build time checks to prevent that the various usages of "ldil L%(TMPALIAS_MAP_START), %reg" sign-extends into the upper 32 bits when building a 64-bit kernel. Signed-off-by: Helge Deller commit c64c782e58ac5bb3601aa77b860ca4e93a489b7a Author: John David Anglin Date: Sun May 15 22:47:04 2022 +0000 parisc: Don't hardcode assembler bit definitions in tmpalias code Remove the hardcoded bit definitions in the tmpalias assembly code. This makes it easy to change the size of the tmpalias region. The alignment of the tmpalias region is reduced from 16 MB to 8 MB. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 1fc7db2401d62df5a0b19250ddf3bb89d430dd86 Author: John David Anglin Date: Wed Mar 30 14:42:30 2022 +0000 parisc: Don't enforce DMA completion order in cache flushes The only place we need to ensure all outstanding cache coherence operations are complete is in invalidate_kernel_vmap_range. All parisc drivers synchronize DMA operations internally and do not call invalidate_kernel_vmap_range. We only need this for non-coherent I/O operations. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 41dc0b53bcb1be3840bd616aea67f5b73400c169 Author: Helge Deller Date: Tue Apr 5 12:16:15 2022 +0200 parisc: video: fbdev: stifb: Add sti_dump_font() to dump STI font Add a function to dump the STI ROM fonts. Signed-off-by: Helge Deller commit 5e469829baa1b1320e843adf3631edef1d6d2cf2 Author: Mickaël Salaün Date: Fri May 13 13:27:43 2022 +0200 landlock: Explain how to support Landlock Let's help users by documenting how to enable and check for Landlock in the kernel and the running system. The userspace-api section may not be the best place for this but it still makes sense to put all the user documentation at the same place. Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220513112743.156414-1-mic@digikod.net Reviewed-by: Paul Moore commit 9e0c76b9f1faac0a8ea4b42e2f844ea26106f140 Author: Mickaël Salaün Date: Fri May 6 18:11:02 2022 +0200 landlock: Add design choices documentation for filesystem access rights Summarize the rationale of filesystem access rights according to the file type. Update the document date. Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-13-mic@digikod.net commit 09340cf4135f942d56742b36aaa3c37738aba000 Author: Mickaël Salaün Date: Fri May 6 18:11:01 2022 +0200 landlock: Document good practices about filesystem policies Explain how to set access rights per hierarchy in an efficient and safe way, especially with the LANDLOCK_ACCESS_FS_REFER side effect (i.e. partial ordering and constraints for access rights per hierarchy). Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-12-mic@digikod.net commit 6f59abfae35fbbe688ff790ff9638576956d760c Author: Mickaël Salaün Date: Fri May 6 18:11:00 2022 +0200 landlock: Document LANDLOCK_ACCESS_FS_REFER and ABI versioning Add LANDLOCK_ACCESS_FS_REFER in the example and properly check to only use it if the current kernel support it thanks to the Landlock ABI version. Move the file renaming and linking limitation to a new "Previous limitations" section. Improve documentation about the backward and forward compatibility, including the rational for ruleset's handled_access_fs. Update the document date. Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-11-mic@digikod.net commit 76b902f874ff4de9c1078489d4c7678a64105ea6 Author: Mickaël Salaün Date: Fri May 6 18:10:59 2022 +0200 samples/landlock: Add support for file reparenting Add LANDLOCK_ACCESS_FS_REFER to the "roughly write" access rights and leverage the Landlock ABI version to only try to enforce it if it is supported by the running kernel. Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-10-mic@digikod.net commit f4056b9266b571c63f30cda70c2d89f7b7e8bb7b Author: Mickaël Salaün Date: Fri May 6 18:10:58 2022 +0200 selftests/landlock: Add 11 new test suites dedicated to file reparenting These test suites try to check all edge cases for directory and file renaming or linking involving a new parent directory, with and without LANDLOCK_ACCESS_FS_REFER and other access rights. layout1: * reparent_refer: Tests simple FS_REFER usage. * reparent_link: Tests a mix of FS_MAKE_REG and FS_REFER with links. * reparent_rename: Tests a mix of FS_MAKE_REG and FS_REFER with renames and RENAME_EXCHANGE. * reparent_exdev_layers_rename1/2: Tests renames with two layers. * reparent_exdev_layers_exchange1/2/3: Tests exchanges with two layers. * reparent_remove: Tests file and directory removal with rename. * reparent_dom_superset: Tests access partial ordering. layout1_bind: * reparent_cross_mount: Tests FS_REFER propagation across mount points. Test coverage for security/landlock is 95.4% of 604 lines according to gcc/gcov-11. Cc: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-9-mic@digikod.net commit b91c3e4ea756b12b7d992529226edce1cfd854d7 Author: Mickaël Salaün Date: Fri May 6 18:10:57 2022 +0200 landlock: Add support for file reparenting with LANDLOCK_ACCESS_FS_REFER Add a new LANDLOCK_ACCESS_FS_REFER access right to enable policy writers to allow sandboxed processes to link and rename files from and to a specific set of file hierarchies. This access right should be composed with LANDLOCK_ACCESS_FS_MAKE_* for the destination of a link or rename, and with LANDLOCK_ACCESS_FS_REMOVE_* for a source of a rename. This lift a Landlock limitation that always denied changing the parent of an inode. Renaming or linking to the same directory is still always allowed, whatever LANDLOCK_ACCESS_FS_REFER is used or not, because it is not considered a threat to user data. However, creating multiple links or renaming to a different parent directory may lead to privilege escalations if not handled properly. Indeed, we must be sure that the source doesn't gain more privileges by being accessible from the destination. This is handled by making sure that the source hierarchy (including the referenced file or directory itself) restricts at least as much the destination hierarchy. If it is not the case, an EXDEV error is returned, making it potentially possible for user space to copy the file hierarchy instead of moving or linking it. Instead of creating different access rights for the source and the destination, we choose to make it simple and consistent for users. Indeed, considering the previous constraint, it would be weird to require such destination access right to be also granted to the source (to make it a superset). Moreover, RENAME_EXCHANGE would also add to the confusion because of paths being both a source and a destination. See the provided documentation for additional details. New tests are provided with a following commit. Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-8-mic@digikod.net commit 100f59d964050020285f0c8264ce520f0c406c13 Author: Mickaël Salaün Date: Fri May 6 18:10:56 2022 +0200 LSM: Remove double path_rename hook calls for RENAME_EXCHANGE In order to be able to identify a file exchange with renameat2(2) and RENAME_EXCHANGE, which will be useful for Landlock [1], propagate the rename flags to LSMs. This may also improve performance because of the switch from two set of LSM hook calls to only one, and because LSMs using this hook may optimize the double check (e.g. only one lock, reduce the number of path walks). AppArmor, Landlock and Tomoyo are updated to leverage this change. This should not change the current behavior (same check order), except (different level of) speed boosts. [1] https://lore.kernel.org/r/20220221212522.320243-1-mic@digikod.net Cc: James Morris Cc: Kentaro Takeda Cc: Serge E. Hallyn Acked-by: John Johansen Acked-by: Tetsuo Handa Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-7-mic@digikod.net commit 9da82b20fde95814af721a2a7b1796a5b4a3d78e Author: Mickaël Salaün Date: Fri May 6 18:10:55 2022 +0200 landlock: Move filesystem helpers and add a new one Move the SB_NOUSER and IS_PRIVATE dentry check to a standalone is_nouser_or_private() helper. This will be useful for a following commit. Move get_mode_access() and maybe_remove() to make them usable by new code provided by a following commit. Reviewed-by: Paul Moore Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506161102.525323-6-mic@digikod.net commit 8ba0005ff418ec356e176b26eaa04a6ac755d05b Author: Mickaël Salaün Date: Fri May 6 18:10:54 2022 +0200 landlock: Fix same-layer rule unions The original behavior was to check if the full set of requested accesses was allowed by at least a rule of every relevant layer. This didn't take into account requests for multiple accesses and same-layer rules allowing the union of these accesses in a complementary way. As a result, multiple accesses requested on a file hierarchy matching rules that, together, allowed these accesses, but without a unique rule allowing all of them, was illegitimately denied. This case should be rare in practice and it can only be triggered by the path_rename or file_open hook implementations. For instance, if, for the same layer, a rule allows execution beneath /a/b and another rule allows read beneath /a, requesting access to read and execute at the same time for /a/b should be allowed for this layer. This was an inconsistency because the union of same-layer rule accesses was already allowed if requested once at a time anyway. This fix changes the way allowed accesses are gathered over a path walk. To take into account all these rule accesses, we store in a matrix all layer granting the set of requested accesses, according to the handled accesses. To avoid heap allocation, we use an array on the stack which is 2*13 bytes. A following commit bringing the LANDLOCK_ACCESS_FS_REFER access right will increase this size to reach 112 bytes (2*14*4) in case of link or rename actions. Add a new layout1.layer_rule_unions test to check that accesses from different rules pertaining to the same layer are ORed in a file hierarchy. Also test that it is not the case for rules from different layers. Reviewed-by: Paul Moore Link: https://lore.kernel.org/r/20220506161102.525323-5-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 2cd7cd6eed88b8383cfddce589afe9c0ae1d19b4 Author: Mickaël Salaün Date: Fri May 6 18:10:53 2022 +0200 landlock: Create find_rule() from unmask_layers() This refactoring will be useful in a following commit. Reviewed-by: Paul Moore Link: https://lore.kernel.org/r/20220506161102.525323-4-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 75c542d6c6cc48720376862d5496d51509160dfd Author: Mickaël Salaün Date: Fri May 6 18:10:52 2022 +0200 landlock: Reduce the maximum number of layers to 16 The maximum number of nested Landlock domains is currently 64. Because of the following fix and to help reduce the stack size, let's reduce it to 16. This seems large enough for a lot of use cases (e.g. sandboxed init service, spawning a sandboxed SSH service, in nested sandboxed containers). Reducing the number of nested domains may also help to discover misuse of Landlock (e.g. creating a domain per rule). Add and use a dedicated layer_mask_t typedef to fit with the number of layers. This might be useful when changing it and to keep it consistent with the maximum number of layers. Reviewed-by: Paul Moore Link: https://lore.kernel.org/r/20220506161102.525323-3-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 5f2ff33e10843ef51275c8611bdb7b49537aba5d Author: Mickaël Salaün Date: Fri May 6 18:10:51 2022 +0200 landlock: Define access_mask_t to enforce a consistent access mask size Create and use the access_mask_t typedef to enforce a consistent access mask size and uniformly use a 16-bits type. This will helps transition to a 32-bits value one day. Add a build check to make sure all (filesystem) access rights fit in. This will be extended with a following commit. Reviewed-by: Paul Moore Link: https://lore.kernel.org/r/20220506161102.525323-2-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 6533d0c3a86ee1cc74ff37ac92ca597deb87015c Author: Mickaël Salaün Date: Fri May 6 18:08:20 2022 +0200 selftests/landlock: Test landlock_create_ruleset(2) argument check ordering Add inval_create_ruleset_arguments, extension of inval_create_ruleset_flags, to also check error ordering for landlock_create_ruleset(2). This is similar to the previous commit checking landlock_add_rule(2). Test coverage for security/landlock is 94.4% of 504 lines accorging to gcc/gcov-11. Link: https://lore.kernel.org/r/20220506160820.524344-11-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit fe7324b932222574a0721b80e72c6c5fe57960d1 Author: Luiz Angelo Daros de Luca Date: Sun May 22 22:32:34 2022 -0300 net: dsa: OF-ware slave_mii_bus If found, register the DSA internally allocated slave_mii_bus with an OF "mdio" child object. It can save some drivers from creating their custom internal MDIO bus. Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit eba39ca4b155c54adf471a69e91799cc1727873f Author: Mickaël Salaün Date: Fri May 6 18:08:19 2022 +0200 landlock: Change landlock_restrict_self(2) check ordering According to the Landlock goal to be a security feature available to unprivileges processes, it makes more sense to first check for no_new_privs before checking anything else (i.e. syscall arguments). Merge inval_fd_enforce and unpriv_enforce_without_no_new_privs tests into the new restrict_self_checks_ordering. This is similar to the previous commit checking other syscalls. Link: https://lore.kernel.org/r/20220506160820.524344-10-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 589172e5636c4d16c40b90e87543d43defe2d968 Author: Mickaël Salaün Date: Fri May 6 18:08:18 2022 +0200 landlock: Change landlock_add_rule(2) argument check ordering This makes more sense to first check the ruleset FD and then the rule attribute. It will be useful to factor out code for other rule types. Add inval_add_rule_arguments tests, extension of empty_path_beneath_attr tests, to also check error ordering for landlock_add_rule(2). Link: https://lore.kernel.org/r/20220506160820.524344-9-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit d1788ad990874734341b05ab8ccb6448c09c6422 Author: Mickaël Salaün Date: Fri May 6 18:08:17 2022 +0200 selftests/landlock: Add tests for O_PATH The O_PATH flag is currently not handled by Landlock. Let's make sure this behavior will remain consistent with the same ruleset over time. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-8-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 6a1bdd4a0bfc30fa4fa2b3a979e6525f28996db9 Author: Mickaël Salaün Date: Fri May 6 18:08:16 2022 +0200 selftests/landlock: Fully test file rename with "remove" access These tests were missing to check the check_access_path() call with all combinations of maybe_remove(old_dentry) and maybe_remove(new_dentry). Extend layout1.link with a new complementary test and check that REMOVE_FILE is not required to link a file. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-7-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit d18955d094d09a220cf8f533f5e896a2fe31575a Author: Mickaël Salaün Date: Fri May 6 18:08:15 2022 +0200 selftests/landlock: Extend access right tests to directories Make sure that all filesystem access rights can be tied to directories. Rename layout1.file_access_rights to layout1.file_and_dir_access_rights to reflect this change. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-6-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit c56b3bf566da5a0dd3b58ad97a614b0928b06ebf Author: Mickaël Salaün Date: Fri May 6 18:08:14 2022 +0200 selftests/landlock: Add tests for unknown access rights Make sure that trying to use unknown access rights returns an error. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-5-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 291865bd7e8bb4b4033d341fa02dafa728e6378c Author: Mickaël Salaün Date: Fri May 6 18:08:13 2022 +0200 selftests/landlock: Extend tests for minimal valid attribute size This might be useful when the struct landlock_ruleset_attr will get more fields. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-4-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 87129ef13603ae46c82bcd09eed948acf0506dbb Author: Mickaël Salaün Date: Fri May 6 18:08:12 2022 +0200 selftests/landlock: Make tests build with old libc Replace SYS_ with __NR_. Using the __NR_ notation, provided by UAPI, is useful to build tests on systems without the SYS_ definitions. Replace SYS_pivot_root with __NR_pivot_root, and SYS_move_mount with __NR_move_mount. Define renameat2() and RENAME_EXCHANGE if they are unknown to old build systems. Cc: Shuah Khan Link: https://lore.kernel.org/r/20220506160820.524344-3-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit a13e248ff90e81e9322406c0e618cf2168702f4e Author: Mickaël Salaün Date: Fri May 6 18:08:11 2022 +0200 landlock: Fix landlock_add_rule(2) documentation It is not mandatory to pass a file descriptor obtained with the O_PATH flag. Also, replace rule's accesses with ruleset's accesses. Link: https://lore.kernel.org/r/20220506160820.524344-2-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 81709f3dccacf4104a4bc2daa80bdd767a9c4c54 Author: Mickaël Salaün Date: Fri May 6 18:05:13 2022 +0200 samples/landlock: Format with clang-format Let's follow a consistent and documented coding style. Everything may not be to our liking but it is better than tacit knowledge. Moreover, this will help maintain style consistency between different developers. This contains only whitespace changes. Automatically formatted with: clang-format-14 -i samples/landlock/*.[ch] Link: https://lore.kernel.org/r/20220506160513.523257-8-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 9805a722db071e1772b80e6e0ff33f35355639ac Author: Mickaël Salaün Date: Fri May 6 18:05:12 2022 +0200 samples/landlock: Add clang-format exceptions In preparation to a following commit, add clang-format on and clang-format off stanzas around constant definitions. This enables to keep aligned values, which is much more readable than packed definitions. Link: https://lore.kernel.org/r/20220506160513.523257-7-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 371183fa578a4cf56b3ae12e54b7f01a4249add1 Author: Mickaël Salaün Date: Fri May 6 18:05:11 2022 +0200 selftests/landlock: Format with clang-format Let's follow a consistent and documented coding style. Everything may not be to our liking but it is better than tacit knowledge. Moreover, this will help maintain style consistency between different developers. This contains only whitespace changes. Automatically formatted with: clang-format-14 -i tools/testing/selftests/landlock/*.[ch] Link: https://lore.kernel.org/r/20220506160513.523257-6-mic@digikod.net Cc: stable@vger.kernel.org [mic: Update style according to https://lore.kernel.org/r/02494cb8-2aa5-1769-f28d-d7206f284e5a@digikod.net] Signed-off-by: Mickaël Salaün commit 32c53420d2a0c2c3a691edb895d90d9d028ca3e0 Author: Jakub Kicinski Date: Wed May 18 20:13:45 2022 -0700 eth: de4x5: remove support for Generic DECchip & DIGITAL EtherWORKS PCI/EISA Looks like almost all changes to this driver had been tree-wide refactoring since git era begun. There is one commit from Al 15 years ago which could potentially be fixing a real bug. The driver is using virt_to_bus() and is a real magnet for pointless cleanups. It seems unlikely to have real users. Let's try to shed this maintenance burden. Signed-off-by: Jakub Kicinski Acked-by: Michael Ellerman (powerpc) Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 0097e86c8ec5a68f20bc1ae19f5c21fb0e751f83 Author: Dan Carpenter Date: Thu May 19 17:08:00 2022 +0300 net: ethernet: mtk_eth_soc: fix error code in mtk_flow_offload_replace() Preserve the error code from mtk_foe_entry_commit(). Do not return success. Fixes: c4f033d9e03e ("net: ethernet: mtk_eth_soc: rework hardware flow table management") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit dccd855771b37820b6d976a99729c88259549f85 Author: Vasily Averin Date: Sun May 22 15:08:02 2022 +0300 fanotify: fix incorrect fmode_t casts Fixes sparce warnings: fs/notify/fanotify/fanotify_user.c:267:63: sparse: warning: restricted fmode_t degrades to integer fs/notify/fanotify/fanotify_user.c:1351:28: sparse: warning: restricted fmode_t degrades to integer FMODE_NONTIFY have bitwise fmode_t type and requires __force attribute for any casts. Signed-off-by: Vasily Averin Reviewed-by: Christian Brauner (Microsoft) Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/9adfd6ac-1b89-791e-796b-49ada3293985@openvz.org commit 682a8c633fc32933a73fd0379c62d37d1346055d Merge: 1e39b27bd9d12 a4e044dc4c5b1 Author: David S. Miller Date: Mon May 23 10:40:10 2022 +0100 Merge branch 'dsa-multi-cpu-port-part-two' Vladimir Oltean says: ==================== DSA changes for multiple CPU ports (part 2) As explained in part 1: https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/ I am trying to enable the second internal port pair from the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q". This series represents part 2 (of an unknown number) of that effort. This series deals only with a minor bug fix (first patch) and with code reorganization in the Felix DSA driver and in the Ocelot switch library. Hopefully this will lay the ground for a clean introduction of new UAPI for changing the DSA master of a user port in part 3. ==================== Signed-off-by: David S. Miller commit a4e044dc4c5b1e03f4195224c47108dc44122917 Author: Vladimir Oltean Date: Sun May 22 00:37:43 2022 +0300 net: dsa: felix: tag_8021q preparation for multiple CPU ports Update the VCAP filters to support multiple tag_8021q CPU ports. TX works using a filter for VLAN ID on the ingress of the CPU port, with a redirect and a VLAN pop action. This can be updated trivially by amending the ingress port mask of this rule to match on all tag_8021q CPU ports. RX works using a filter for ingress port on the egress of the CPU port, with a VLAN push action. Here we need to replicate these filters for each tag_8021q CPU port, and let them all have the same action. This means that the OCELOT_VCAP_ES0_TAG_8021Q_RXVLAN() cookie needs to encode a unique value for every {user port, CPU port} pair it's given. Do this by encoding the CPU port in the upper 16 bits of the cookie, and the user port in the lower 16 bits. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c295f9831f1db12330d6a28a1cb2bd2562535e37 Author: Vladimir Oltean Date: Sun May 22 00:37:42 2022 +0300 net: mscc: ocelot: switch from {,un}set to {,un}assign for tag_8021q CPU ports There is a desire for the felix driver to gain support for multiple tag_8021q CPU ports, but the current model prevents it. This is because ocelot_apply_bridge_fwd_mask() only takes into consideration whether a port is a tag_8021q CPU port, but not whose CPU port it is. We need a model where we can have a direct affinity between an ocelot port and a tag_8021q CPU port. This serves as the basis for multiple CPU ports. Declare a "dsa_8021q_cpu" backpointer in struct ocelot_port which encodes that affinity. Repurpose the "ocelot_set_dsa_8021q_cpu" API to "ocelot_assign_dsa_8021q_cpu" to express the change of paradigm. Note that this change makes the first practical use of the new ocelot_port->index field in ocelot_port_unassign_dsa_8021q_cpu(), where we need to remove the old tag_8021q CPU port from the reserved VLAN range. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8c166acb60f8284470db673b6dccd43e6fedfae2 Author: Vladimir Oltean Date: Sun May 22 00:37:41 2022 +0300 net: dsa: felix: directly call ocelot_port_{set,unset}_dsa_8021q_cpu Absorb the final details of calling ocelot_port_{,un}set_dsa_8021q_cpu(), i.e. the need to lock &ocelot->fwd_domain_lock, into the callee, to simplify the caller and permit easier code reuse later. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a72e23dd679c632bcf6ab47a3a1a58c1e777713a Author: Vladimir Oltean Date: Sun May 22 00:37:40 2022 +0300 net: dsa: felix: update bridge fwd mask from ocelot lib when changing tag_8021q CPU Add more logic to ocelot_port_{,un}set_dsa_8021q_cpu() from the ocelot switch lib by encapsulating the ocelot_apply_bridge_fwd_mask() call that felix used to have. This is necessary because the CPU port change procedure will also need to do this, and it's good to reduce code duplication by having an entry point in the ocelot switch lib that does all that is needed. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 61be79ba2d90162b0b213384f35eb8db7eb183b8 Author: Vladimir Oltean Date: Sun May 22 00:37:39 2022 +0300 net: dsa: felix: move the updating of PGID_CPU to the ocelot lib PGID_CPU must be updated every time a port is configured or unconfigured as a tag_8021q CPU port. The ocelot switch lib already has a hook for that operation, so move the updating of PGID_CPU to those hooks. These bits are pretty specific to DSA, so normally I would keep them out of the common switch lib, but when tag_8021q is in use, this has implications upon the forwarding mask determined by ocelot_apply_bridge_fwd_mask() and called extensively by the switch lib. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 129b7532a0edc3f381a6c5f3bb1a155e743d141b Author: Vladimir Oltean Date: Sun May 22 00:37:38 2022 +0300 net: dsa: fix missing adjustment of host broadcast flooding PGID_BC is configured statically by ocelot_init() to flood towards the CPU port module, and dynamically by ocelot_port_set_bcast_flood() towards all user ports. When the tagging protocol changes, the intention is to turn off flooding towards the old pipe towards the host, and to turn it on towards the new pipe. Due to a recent change which removed the adjustment of PGID_BC from felix_set_host_flood(), 3 things happen. - when we change from NPI to tag_8021q mode: in this mode, the CPU port module is accessed via registers, and used to read PTP packets with timestamps. We fail to disable broadcast flooding towards the CPU port module, and to enable broadcast flooding towards the physical port that serves as a DSA tag_8021q CPU port. - from tag_8021q to NPI mode: in this mode, the CPU port module is redirected to a physical port. We fail to disable broadcast flooding towards the physical tag_8021q CPU port, and to enable it towards the CPU port module at ocelot->num_phys_ports. - when the ports are put in promiscuous mode, we also fail to update PGID_BC towards the host pipe of the current protocol. First issue means that felix_check_xtr_pkt() has to do extra work, because it will not see only PTP packets, but also broadcasts. It needs to dequeue these packets just to drop them. Third issue is inconsequential, since PGID_BC is allocated from the nonreserved multicast PGID space, and these PGIDs are conveniently initialized to 0x7f (i.e. flood towards all ports except the CPU port module). Broadcasts reach the NPI port via ocelot_init(), and reach the tag_8021q CPU port via the hardware defaults. Second issue is also inconsequential, because we fail both at disabling and at enabling broadcast flooding on a port, so the defaults mentioned above are preserved, and they are fine except for the performance impact. Fixes: 7a29d220f4c0 ("net: dsa: felix: reimplement tagging protocol change with function pointers") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 84aa85108b1b8af0d1d310e76975f421c5975e66 Author: Maciej W. Rozycki Date: Sun May 22 21:48:14 2022 +0100 MIPS: Rewrite `csum_tcpudp_nofold' in plain C Recent commit 198688edbf77 ("MIPS: Fix inline asm input/output type mismatch in checksum.h used with Clang") introduced a code size and performance regression with 64-bit code emitted for `csum_tcpudp_nofold' by GCC, caused by a redundant truncation operation produced due to a data type change made to the variable associated with the inline assembly's output operand. The intent previously expressed here with operands and constraints for optimal code was to have the output operand share a register with one inputs, both of a different integer type each. This is perfectly valid with the MIPS psABI where a register can hold integer data of different types and the assembly code used here makes data stored in the output register match the data type used with the output operand, however it has turned out impossible to express this arrangement in source code such as to satisfy LLVM, apparently due to the compiler's internal limitations. There is nothing peculiar about the inline assembly `csum_tcpudp_nofold' includes however, though it does choose assembly instructions carefully. Rewrite this piece of assembly in plain C then, using corresponding C language operations, making GCC produce the same assembly instructions, possibly shuffled, in the general case and sometimes actually fewer of them where an input is constant, because the compiler does not have to reload it to a register (operand constraints could be adjusted for that, but the plain C approach is cleaner anyway). Example code size changes are as follows, for a 32-bit configuration: text data bss total filename 5920480 1347236 126592 7394308 vmlinux-old 5920480 1347236 126592 7394308 vmlinux-now 5919728 1347236 126592 7393556 vmlinux-c and for a 64-bit configuration: text data bss total filename 6024112 1790828 225728 8040668 vmlinux-old 6024128 1790828 225728 8040684 vmlinux-now 6023760 1790828 225728 8040316 vmlinux-c respectively, where "old" is with the commit referred reverted, "now" is with no change, and "c" is with this change applied. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer commit 88ca100c885f967c37f3d60d5225a639ed6bd6f1 Author: 陈学兵 Date: Sun May 22 15:46:18 2022 +0800 mips: setup: use strscpy to replace strlcpy The strlcpy should not be used because it doesn't limit the source length. Preferred is strscpy. Signed-off-by: XueBing Chen Signed-off-by: Thomas Bogendoerfer commit e001897da62eb543ef79bf173f145c2c9677f66c Merge: f8d9f46e87e51 9f04b55f003cc 23587f7c5daa9 Author: Vlastimil Babka Date: Mon May 23 11:14:32 2022 +0200 Merge branches 'slab/for-5.19/stackdepot' and 'slab/for-5.19/refactor' into slab/for-linus commit 07bdec3cdc92a1f8ede0b904d54f440f69c26704 Author: Stijn Tintel Date: Wed May 18 19:48:10 2022 +0300 MIPS: Octeon: add SNIC10E board The CN6640-SNIC10E-G and CN6640-SNIC10E-1.1-G PCIe NICs are based on this board. Signed-off-by: Stijn Tintel Signed-off-by: Thomas Bogendoerfer commit f74b057352a063317ecd8cf44c42d86304632eec Author: 周琰杰 (Zhou Yanjie) Date: Fri May 13 03:33:41 2022 +0800 MIPS: Ingenic: Refresh defconfig for CU1000-Neo and CU1830-Neo. Refresh the defconfig files of CU1000-Neo board and CU1830-Neo board, remove the selection of SPI-GPIO, and add the selection of SSI. Signed-off-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Thomas Bogendoerfer commit 562dc4c9c2c1662bcfedf7026860ff306c969d70 Author: 周琰杰 (Zhou Yanjie) Date: Fri May 13 03:33:40 2022 +0800 MIPS: Ingenic: Refresh device tree for Ingenic SoCs and boards. 1.Add SSI nodes for X1000 SoC and X1830 SoC from Ingenic. 2.Refresh SSI related nodes in CU1000-Neo and CU1830-Neo. 3.The X1830 SoC used by the CU1830-Neo and the X1000 SoC used by the CU1000-Neo are both single-core processors, therefore the "OST_CLK_PERCPU_TIMER" ABI should not be used in the OST nodes of the CU1830-Neo and CU1000-Neo, it is just a coincidence that there is no problem now. So replace the misused "OST_CLK_PERCPU_TIMER" ABI with the correct "OST_CLK_EVENT_TIMER" ABI. Signed-off-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Thomas Bogendoerfer commit b2a5df71345c0aad3b06600722edb5364220ee65 Author: 周琰杰 (Zhou Yanjie) Date: Fri May 13 03:33:39 2022 +0800 MIPS: Ingenic: Add PWM nodes for X1830. Add PWM node for X1830 SoC from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Thomas Bogendoerfer commit 0ea917819d12fed41ea4662cc26ffa0060a5c354 Author: Jani Nikula Date: Fri May 20 12:46:00 2022 +0300 drm/i915/dsi: fix VBT send packet port selection for ICL+ The VBT send packet port selection was never updated for ICL+ where the 2nd link is on port B instead of port C as in VLV+ DSI. First, single link DSI needs to use the configured port instead of relying on the VBT sequence block port. Remove the hard-coded port C check here and make it generic. For reference, see commit f915084edc5a ("drm/i915: Changes related to the sequence port no for") for the original VLV specific fix. Second, the sequence block port number is either 0 or 1, where 1 indicates the 2nd link. Remove the hard-coded port C here for 2nd link. (This could be a "find second set bit" on DSI ports, but just check the two possible options.) Third, sanity check the result with a warning to avoid a NULL pointer dereference. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5984 Cc: stable@vger.kernel.org # v4.19+ Cc: Ville Syrjala Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220520094600.2066945-1-jani.nikula@intel.com (cherry picked from commit 08c59dde71b73a0ac94e3ed2d431345b01f20485) commit f998c204a19a3d49a49adfd7172fb15c3f0484ea Author: Julia Lawall Date: Sat May 21 13:11:15 2022 +0200 MIPS: Octeon: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Thomas Bogendoerfer commit 6ad5ec543211805d4a32370e06cafee44104484c Author: Juerg Haefliger Date: Fri May 20 13:51:13 2022 +0200 MIPS: loongson32: Kconfig: Remove extra space Remove extra space between 'prompt' keyword and string. Signed-off-by: Juerg Haefliger Signed-off-by: Thomas Bogendoerfer commit 8c3b8dc5cc9bf6d273ebe18b16e2d6882bcfb36d Author: liuyacan Date: Mon May 23 13:50:56 2022 +0800 net/smc: fix listen processing for SMC-Rv2 In the process of checking whether RDMAv2 is available, the current implementation first sets ini->smcrv2.ib_dev_v2, and then allocates smc buf desc, but the latter may fail. Unfortunately, the caller will only check the former. In this case, a NULL pointer reference will occur in smc_clc_send_confirm_accept() when accessing conn->rmb_desc. This patch does two things: 1. Use the return code to determine whether V2 is available. 2. If the return code is NODEV, continue to check whether V1 is available. Fixes: e49300a6bf62 ("net/smc: add listen processing for SMC-Rv2") Signed-off-by: liuyacan Signed-off-by: David S. Miller commit 75c1edf23b95a9c66923d9269d8e86e4dbde151f Author: liuyacan Date: Mon May 23 12:57:07 2022 +0800 net/smc: postpone sk_refcnt increment in connect() Same trigger condition as commit 86434744. When setsockopt runs in parallel to a connect(), and switch the socket into fallback mode. Then the sk_refcnt is incremented in smc_connect(), but its state stay in SMC_INIT (NOT SMC_ACTIVE). This cause the corresponding sk_refcnt decrement in __smc_release() will not be performed. Fixes: 86434744fedf ("net/smc: add fallback check to connect()") Signed-off-by: liuyacan Signed-off-by: David S. Miller commit 1c6fd59943a630f087b4b3089aefdcb0bf43cca0 Merge: a5c7a39f508ae 701850dc0c31b Author: Petr Mladek Date: Mon May 23 10:55:39 2022 +0200 Merge branch 'rework/kthreads' into for-linus commit be80a1ca5119c5d31b6019d5e6dc6d9123bda959 Merge: 2aeb1f5fbbacb 13088b65d93a1 Author: Borislav Petkov Date: Mon May 23 10:19:30 2022 +0200 Merge branches 'edac-misc' and 'edac-alloc-cleanup' into edac-updates-for-v5.19 Combine all collected EDAC changes for submission into v5.19: * edac-misc: EDAC/xgene: Fix typo processsors -> processors EDAC/i5100: Remove unused inline function i5100_nrecmema_dm_buf_id() EDAC/ghes: Change ghes_hw from global to static EDAC/armada_xp: Use devm_platform_ioremap_resource() EDAC/synopsys: Add a SPDX identifier EDAC/synopsys: Add driver support for i.MX platforms EDAC/dmc520: Don't print an error for each unconfigured interrupt line efi/cper: Reformat CPER memory error location to more readable EDAC/ghes: Unify CPER memory error location reporting efi/cper: Add a cper_mem_err_status_str() to decode error description powerpc/85xx: Remove fsl,85... bindings * edac-alloc-cleanup: EDAC: Use kcalloc() EDAC/mc: Get rid of edac_align_ptr() EDAC/device: Sanitize edac_device_alloc_ctl_info() definition EDAC/device: Get rid of the silly one-shot memory allocation in edac_device_alloc_ctl_info() EDAC/pci: Get rid of the silly one-shot memory allocation in edac_pci_alloc_ctl_info() EDAC/mc: Get rid of silly one-shot struct allocation in edac_mc_alloc() Signed-off-by: Borislav Petkov commit 83da38d82b2f7ac207646e55be94e8bd642e2c39 Author: Stafford Horne Date: Sat May 21 10:39:30 2022 +0900 openrisc: Allow power off handler overriding The OpenRISC platform always defines a default pm_power_off hanlder which is only useful for simulators. Having this set also means power management drivers like syscon-power are not able to wire in their own pm_power_off handlers. Fix this by not setting the pm_power_off handler by default and fallback to the simulator power off handler if no handler is set. This has been tested with a new OpenRISC virt platform I am working on for QEMU. https://github.com/stffrdhrn/qemu/commits/or1k-virt Cc: Jason A. Donenfeld Signed-off-by: Stafford Horne commit ed3a88d7dbbb924312a707d5f295b7a31e2f8d2d Author: Stafford Horne Date: Thu May 12 06:11:21 2022 +0900 openrisc: Remove unused IMMU tlb workardound This looks to be some historical code that was used to convert TLB misses on branches from l.bf, l.jal, l.j etc all to a trampoline using l.jr (jump register). I don't see this being used and I don't know the history of it so remove it. Signed-off-by: Stafford Horne commit d8fee3f6fa5a49b338d9149cf498d58e024e27f9 Author: Stafford Horne Date: Sun Feb 6 07:55:12 2022 +0900 openrisc/fault: Fix symbol scope warnings Sparse reported the following warning: arch/openrisc/mm/fault.c:27:15: warning: symbol 'pte_misses' was not declared. Should it be static? arch/openrisc/mm/fault.c:28:15: warning: symbol 'pte_errors' was not declared. Should it be static? arch/openrisc/mm/fault.c:33:16: warning: symbol 'current_pgd' was not declared. Should it be static? This patch fixes these by: - Remove unused pte_misses and pte_errors counters which are no longer used. - Add asm/mmu_context.h include to provide the current_pgd declaration. Signed-off-by: Stafford Horne commit 2f51d67e42a2b6e69d66a1b71cf06fac976177b5 Author: Stafford Horne Date: Sun Feb 6 07:52:24 2022 +0900 openrisc/delay: Add include to fix symbol not declared warning Add asm/timex.h include for read_current_timer prototype. Sparse reporting the following warning: arch/openrisc/lib/delay.c:23:5: warning: symbol 'read_current_timer' was not declared. Should it be static? Signed-off-by: Stafford Horne commit 5a344bbe88bf435bf40e22543b4595d6e6cb6556 Author: Stafford Horne Date: Sun Feb 6 07:45:59 2022 +0900 openrisc/time: Fix symbol scope warnings Spare reported the following warnings: arch/openrisc/kernel/time.c:64:1: warning: symbol 'clockevent_openrisc_timer' was not declared. Should it be static? arch/openrisc/kernel/time.c:66:6: warning: symbol 'openrisc_clockevent_init' was not declared. Should it be static? This patch fixes by: - Add static declaration to clockevent_openrisc_timer as it's used only in this file. - Add include for asm/time.h for openrisc_clockevent_init declaration. Signed-off-by: Stafford Horne commit 024b58f3d92de2d19e2222f841c103127ee54684 Author: Stafford Horne Date: Sat Feb 5 22:44:28 2022 +0900 openrisc/traps: Declare unhandled_exception for asmlinkage Noticed this when workin on warnings. As unhandled_exception is used in entry.S we should attribute it with asmlinkage. Signed-off-by: Stafford Horne commit de901d12df896ffab7f08b26a5abcbc5e720b455 Author: Stafford Horne Date: Sat Feb 5 22:41:41 2022 +0900 openrisc/traps: Remove die_if_kernel function This was noticed when I saw this warning: arch/openrisc/kernel/traps.c:234:6: warning: no previous prototype for 'die_if_kernel' [-Wmissing-prototypes] 234 | void die_if_kernel(const char *str, struct pt_regs *regs, long err) | ^~~~~~~~~~~~~ The die_if_kernel function is not used in the OpenRISC port so remove it. Signed-off-by: Stafford Horne commit f4b26b1a7b3e10b6e26078d80d035574b0975185 Author: Stafford Horne Date: Sat Feb 5 22:37:49 2022 +0900 openrisc/traps: Declare file scope symbols as static Sparse was reporting the following warnings: arch/openrisc/kernel/traps.c:37:5: warning: symbol 'kstack_depth_to_print' was not declared. Should it be static? arch/openrisc/kernel/traps.c:39:22: warning: symbol 'lwa_addr' was not declared. Should it be static? arch/openrisc/kernel/traps.c:41:6: warning: symbol 'print_trace' was not declared. Should it be static? The function print_trace and local variables kstack_depth_to_print and lwa_addr are not used outside of this file. This patch marks them as static. Signed-off-by: Stafford Horne commit fe47623a798b34ee38d02bfe4dbc529cccc78ad7 Author: Stafford Horne Date: Sat Feb 5 19:00:33 2022 +0900 openrisc: Update litex defconfig to support glibc userland I have been using a litex SoC for glibc verification. Update the default litex config to support required userspace API's needed for the full glibc testsuite to pass. This includes enabling the litex mmc driver and filesystems used in a typical litex environment. Signed-off-by: Stafford Horne commit 7d2ae3decda0bb7a9ce0fe4f728630d617c04dd9 Author: Stafford Horne Date: Sat Feb 5 17:54:13 2022 +0900 openrisc: Pretty print show_registers memory dumps Currently show registers, print memory dumps character by character and there is no address information, so its a bit difficult to use. For example before a stack dump looks as follows. [ 13.650000] Stack: [ 13.650000] Call trace [ 13.690000] [<(ptrval)>] ? put_timespec64+0x44/0x60 [ 13.690000] [<(ptrval)>] ? _data_page_fault_handler+0x104/0x10c [ 13.700000] [ 13.700000] Code: [ 13.700000] 13 [ 13.700000] ff [ 13.700000] ff [ 13.700000] f9 [ 13.710000] 84 [ 13.710000] 82 [ 13.710000] ff [ 13.710000] bc [ 13.710000] 07 [ 13.710000] fd [ 13.720000] 4e [ 13.720000] 67 [ 13.720000] 84 [ 13.720000] 62 [ 13.720000] ff ... This change updates this to print the address and data a word at time. [ 0.830000] Stack: [ 0.830000] Call trace: [ 0.830000] [<(ptrval)>] load_elf_binary+0x744/0xf5c [ 0.830000] [<(ptrval)>] ? __kernel_read+0x144/0x184 [ 0.830000] [<(ptrval)>] bprm_execve+0x27c/0x3e4 [ 0.830000] [<(ptrval)>] kernel_execve+0x16c/0x1a0 [ 0.830000] [<(ptrval)>] run_init_process+0xa0/0xec [ 0.830000] [<(ptrval)>] ? kernel_init+0x0/0x14c [ 0.830000] [<(ptrval)>] kernel_init+0x7c/0x14c [ 0.830000] [<(ptrval)>] ? calculate_sigpending+0x30/0x40 [ 0.830000] [<(ptrval)>] ret_from_fork+0x1c/0x84 [ 0.830000] [ 0.830000] c1033dbc: c1033dec [ 0.830000] c1033dc0: c015258c [ 0.830000] c1033dc4: c129da00 [ 0.830000] c1033dc8: 00000002 [ 0.830000] c1033dcc: 00000000 [ 0.830000] c1033dd0: c129da00 [ 0.830000] c1033dd4: 00000000 [ 0.830000] c1033dd8: 00000000 [ 0.830000] (c1033ddc:) 00001e04 [ 0.830000] c1033de0: 001501fc [ 0.830000] c1033de4: c1033e68 [ 0.830000] c1033de8: c0152e60 [ 0.830000] c1033dec: c129da5c [ 0.830000] c1033df0: c0674a20 [ 0.830000] c1033df4: c1033e50 [ 0.830000] c1033df8: c00e3d6c [ 0.830000] c1033dfc: c129da5c [ 0.830000] c1033e00: 00000003 [ 0.830000] c1033e04: 00150000 [ 0.830000] c1033e08: 00002034 [ 0.830000] c1033e0c: 001501fc [ 0.830000] c1033e10: 00000000 [ 0.830000] c1033e14: 00150000 [ 0.830000] c1033e18: 0014ebbc [ 0.830000] c1033e1c: 00002000 [ 0.830000] c1033e20: 00000003 [ 0.830000] c1033e24: c12a07e0 [ 0.830000] c1033e28: 00000000 [ 0.830000] c1033e2c: 00000000 [ 0.830000] c1033e30: 00000000 [ 0.830000] c1033e34: 40040000 [ 0.830000] c1033e38: 00000000 [ 0.830000] [ 0.830000] Code: [ 0.830000] c00047a4: 9c21fff8 [ 0.830000] c00047a8: d4012000 [ 0.830000] c00047ac: d4011804 [ 0.830000] c00047b0: e4040000 [ 0.830000] c00047b4: 10000005 [ 0.830000] c00047b8: 9c84ffff [ 0.830000] (c00047bc:) d8030000 [ 0.830000] c00047c0: 03fffffc [ 0.830000] c00047c4: 9c630001 [ 0.830000] c00047c8: 9d640001 [ 0.830000] c00047cc: 84810000 [ 0.830000] c00047d0: 84610004 Now we are also printing a bit of the stack as well as the code. The stack is output to help with debugging. There may be concern about exposing sensitive information on the stack, but we are already dumping all register content which would have similar sensitive information. So I am going ahead as this proves useful in investigation. Signed-off-by: Stafford Horne commit a0a94bc9a68ffad0cecae6dbff53e5486cdb8eb0 Author: Stafford Horne Date: Sun Jan 30 17:38:51 2022 +0900 openrisc: Add syscall details to emergency syscall debugging When bringing linux on the or1k Marocchino we ran into issues starting init. This patch adds the syscall number and return address to assist tracing syscalls even before strace is able to be used. By default this is all disabled but a developer could adjust the ifdef to enable debugging. Cc: Andrey Bacherov Signed-off-by: Stafford Horne commit 29bbb2a90fcdd46d9f12746deac4718082df325a Author: Stafford Horne Date: Sun May 15 13:33:14 2022 +0900 openrisc: Add support for liteuart emergency printing This patch adds support for sending emergency print output, such as unhandled exception details, to a liteuart serial device. This is the default device available on litex platforms. If a developer want to use this they should update UART_BASE_ADD to the address of liteuart. Signed-off-by: Stafford Horne commit e449759c246e1594307760f7203debf6038a42ea Author: Stafford Horne Date: Sun May 15 13:21:31 2022 +0900 openrisc: Cleanup emergency print handling The emergency print support only works for 8250 compatible serial ports. Now that OpenRISC platforms may be configured with different serial port hardware we don't want emergency print to try to print to non-existent hardware which will cause lockups. This patch contains several fixes to get emergency print working again: - Update symbol loading to not assume the location of symbols - Split the putc print operation out to its own function to allow for different future implementations. - Update _emergency_print_nr and _emergency_print to use the putc function. - Guard serial 8250 specific sequences by CONFIG_SERIAL_8250 - Update string line feed from lf,cr to cr,lf. Signed-off-by: Stafford Horne commit 87e387acd8eba5021a8e5d6b54e0c5ef5c28ada2 Author: Stafford Horne Date: Sat Jan 22 13:32:38 2022 +0900 openrisc: Add gcc machine instruction flag configuration OpenRISC GCC supports flags to enable the backend to output instructions if they are supported by a target processor. This patch adds configuration flags to enable configuring these flags to tune the kernel for a particular CPU configuration. In the future we could also enable all of these flags by default and provide instruction emulation in the kernel to make these choices easier for users but this is what we provide for now. Signed-off-by: Stafford Horne commit 635267b7a8f1746d72d6b23030863f8779618584 Author: Jason A. Donenfeld Date: Thu Apr 28 13:11:39 2022 +0200 openrisc: define nop command for simulator reboot The simulator defines `l.nop 1` for shutdown, but doesn't have anything for reboot. Use 13 for this, which is currently unused, dubbed `NOP_REBOOT`. Cc: Stafford Horne Cc: Peter Maydell Link: https://lore.kernel.org/all/YmnaDUpVI5ihgvg6@zx2c4.com/ Signed-off-by: Jason A. Donenfeld Signed-off-by: Stafford Horne commit 1693e265e0a5dbe11fba21b48272dd15dbb71ec0 Author: Julia Lawall Date: Sat May 21 13:10:54 2022 +0200 ALSA: ctxfi: 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-44-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai commit e9ff88c327359d6819aa8a61c5ac552722e92379 Author: Julia Lawall Date: Sat May 21 13:10:11 2022 +0200 ALSA: cs5535audio: 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-1-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai commit 1b073ebb174d0c7109b438e0a5eb4495137803ec Author: Edward Matijevic Date: Fri May 20 23:45:15 2022 -0500 ALSA: ctxfi: Add SB046x PCI ID Adds the PCI ID for X-Fi cards sold under the Platnum and XtremeMusic names Before: snd_ctxfi 0000:05:05.0: chip 20K1 model Unknown (1102:0021) is found After: snd_ctxfi 0000:05:05.0: chip 20K1 model SB046x (1102:0021) is found [ This is only about defining the model name string, and the rest is handled just like before, as a default unknown device. Edward confirmed that the stuff has been working fine -- tiwai ] Signed-off-by: Edward Matijevic Cc: Link: https://lore.kernel.org/r/cae7d1a4-8bd9-7dfe-7427-db7e766f7272@gmail.com Signed-off-by: Takashi Iwai commit dc60001e1a305ad8bba1ddaf09484e0e150aba60 Author: Yang Li Date: Thu May 19 07:09:53 2022 +0800 xtensa: Return true/false (not 1/0) from bool function Return boolean values ("true" or "false") instead of 1 or 0 from bool function. This fixes the following warnings from coccicheck: ./arch/xtensa/kernel/traps.c:304:10-11: WARNING: return of 0/1 in function 'check_div0' with return type bool Reported-by: Abaci Robot Signed-off-by: Yang Li Message-Id: <20220518230953.112266-1-yang.lee@linux.alibaba.com> Signed-off-by: Max Filippov commit 42b805af102471f53e3c7867b8c2b502ea4eef7e Author: Xiao Ni Date: Thu May 12 17:21:09 2022 +0800 md: fix double free of io_acct_set bioset Now io_acct_set is alloc and free in personality. Remove the codes that free io_acct_set in md_free and md_stop. Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality) Signed-off-by: Xiao Ni Signed-off-by: Song Liu commit 0f2571ad7a30ff6b33cde142439f9378669f8b4f Author: Xiao Ni Date: Thu May 12 17:21:08 2022 +0800 md: Don't set mddev private to NULL in raid0 pers->free In normal stop process, it does like this: do_md_stop | __md_stop (pers->free(); mddev->private=NULL) | md_free (free mddev) __md_stop sets mddev->private to NULL after pers->free. The raid device will be stopped and mddev memory is free. But in reshape, it doesn't free the mddev and mddev will still be used in new raid. In reshape, it first sets mddev->private to new_pers and then runs old_pers->free(). Now raid0 sets mddev->private to NULL in raid0_free. The new raid can't work anymore. It will panic when dereference mddev->private because of NULL pointer dereference. It can panic like this: [63010.814972] kernel BUG at drivers/md/raid10.c:928! [63010.819778] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [63010.825011] CPU: 3 PID: 44437 Comm: md0_resync Kdump: loaded Not tainted 5.14.0-86.el9.x86_64 #1 [63010.833789] Hardware name: Dell Inc. PowerEdge R6415/07YXFK, BIOS 1.15.0 09/11/2020 [63010.841440] RIP: 0010:raise_barrier+0x161/0x170 [raid10] [63010.865508] RSP: 0018:ffffc312408bbc10 EFLAGS: 00010246 [63010.870734] RAX: 0000000000000000 RBX: ffffa00bf7d39800 RCX: 0000000000000000 [63010.877866] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffa00bf7d39800 [63010.884999] RBP: 0000000000000000 R08: fffffa4945e74400 R09: 0000000000000000 [63010.892132] R10: ffffa00eed02f798 R11: 0000000000000000 R12: ffffa00bbc435200 [63010.899266] R13: ffffa00bf7d39800 R14: 0000000000000400 R15: 0000000000000003 [63010.906399] FS: 0000000000000000(0000) GS:ffffa00eed000000(0000) knlGS:0000000000000000 [63010.914485] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [63010.920229] CR2: 00007f5cfbe99828 CR3: 0000000105efe000 CR4: 00000000003506e0 [63010.927363] Call Trace: [63010.929822] ? bio_reset+0xe/0x40 [63010.933144] ? raid10_alloc_init_r10buf+0x60/0xa0 [raid10] [63010.938629] raid10_sync_request+0x756/0x1610 [raid10] [63010.943770] md_do_sync.cold+0x3e4/0x94c [63010.947698] md_thread+0xab/0x160 [63010.951024] ? md_write_inc+0x50/0x50 [63010.954688] kthread+0x149/0x170 [63010.957923] ? set_kthread_struct+0x40/0x40 [63010.962107] ret_from_fork+0x22/0x30 Removing the code that sets mddev->private to NULL in raid0 can fix problem. Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality) Reported-by: Fine Fan Signed-off-by: Xiao Ni Signed-off-by: Song Liu commit 913cce5a1e588e3470ea064fe4ea336037d3a454 Author: Christoph Hellwig Date: Thu May 12 08:19:13 2022 +0200 md: remove most calls to bdevname Use the %pg format specifier to save on stack consumption and code size. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu commit 1e267742283a4b5a8ca65755c44166be27e9aa0f Author: Guoqing Jiang Date: Fri Apr 29 16:49:09 2022 +0800 md: protect md_unregister_thread from reentrancy Generally, the md_unregister_thread is called with reconfig_mutex, but raid_message in dm-raid doesn't hold reconfig_mutex to unregister thread, so md_unregister_thread can be called simulitaneously from two call sites in theory. Then after previous commit which remove the protection of reconfig_mutex for md_unregister_thread completely, the potential issue could be worse than before. Let's take pers_lock at the beginning of function to ensure reentrancy. Reported-by: Donald Buczek Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 8b48ec23cc51a4e7c8dbaef5f34ebe67e1a80934 Author: Guoqing Jiang Date: Sat Feb 13 01:49:59 2021 +0100 md: don't unregister sync_thread with reconfig_mutex held Unregister sync_thread doesn't need to hold reconfig_mutex since it doesn't reconfigure array. And it could cause deadlock problem for raid5 as follows: 1. process A tried to reap sync thread with reconfig_mutex held after echo idle to sync_action. 2. raid5 sync thread was blocked if there were too many active stripes. 3. SB_CHANGE_PENDING was set (because of write IO comes from upper layer) which causes the number of active stripes can't be decreased. 4. SB_CHANGE_PENDING can't be cleared since md_check_recovery was not able to hold reconfig_mutex. More details in the link: https://lore.kernel.org/linux-raid/5ed54ffc-ce82-bf66-4eff-390cb23bc1ac@molgen.mpg.de/T/#t And add one parameter to md_reap_sync_thread since it could be called by dm-raid which doesn't hold reconfig_mutex. Reported-and-tested-by: Donald Buczek Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu commit 1212fa1b482ea09c19aed29001465799e85ea6c3 Merge: 03a8b0df757f1 7b0efea4baf02 Author: Takashi Iwai Date: Mon May 23 07:48:16 2022 +0200 Merge branch 'for-linus' into for-next Merge for 5.18-rc1 Signed-off-by: Takashi Iwai commit 64ba4b15e5c045f8b746c6da5fc9be9a6b00b61d Author: Tadeusz Struk Date: Tue May 17 08:13:08 2022 +0900 exfat: check if cluster num is valid Syzbot reported slab-out-of-bounds read in exfat_clear_bitmap. This was triggered by reproducer calling truncute with size 0, which causes the following trace: BUG: KASAN: slab-out-of-bounds in exfat_clear_bitmap+0x147/0x490 fs/exfat/balloc.c:174 Read of size 8 at addr ffff888115aa9508 by task syz-executor251/365 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3c0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 exfat_clear_bitmap+0x147/0x490 fs/exfat/balloc.c:174 exfat_free_cluster+0x25a/0x4a0 fs/exfat/fatent.c:181 __exfat_truncate+0x99e/0xe00 fs/exfat/file.c:217 exfat_truncate+0x11b/0x4f0 fs/exfat/file.c:243 exfat_setattr+0xa03/0xd40 fs/exfat/file.c:339 notify_change+0xb76/0xe10 fs/attr.c:336 do_truncate+0x1ea/0x2d0 fs/open.c:65 Move the is_valid_cluster() helper from fatent.c to a common header to make it reusable in other *.c files. And add is_valid_cluster() to validate if cluster number is within valid range in exfat_clear_bitmap() and exfat_set_bitmap(). Link: https://syzkaller.appspot.com/bug?id=50381fc73821ecae743b8cf24b4c9a04776f767c Reported-by: syzbot+a4087e40b9c13aad7892@syzkaller.appspotmail.com Fixes: 1e49a94cf707 ("exfat: add bitmap operations") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Tadeusz Struk Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 1b6138385499507147e8f654840f4c39afe6adbf Author: Yuezhang Mo Date: Tue Apr 12 12:26:47 2022 +0900 exfat: reduce block requests when zeroing a cluster If 'dirsync' is enabled, when zeroing a cluster, submitting sector by sector will generate many block requests, will cause the block device to not fully perform its performance. This commit makes the sectors in a cluster to be submitted in once, it will reduce the number of block requests. This will make the block device to give full play to its performance. Test create 1000 directories on SD card with: $ time (for ((i=0;i<1000;i++)); do mkdir dir${i}; done) Performance has been improved by more than 73% on imx6q-sabrelite. Cluster size Before After Improvement 64 KBytes 3m34.036s 0m56.052s 73.8% 128 KBytes 6m2.644s 1m13.354s 79.8% 256 KBytes 11m22.202s 1m39.451s 85.4% imx6q-sabrelite: - CPU: 792 MHz x4 - Memory: 1GB DDR3 - SD Card: SanDisk 8GB Class 4 Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Christoph Hellwig Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 97d6fb1b48f5e6f6d58028593defe8a23641b0b4 Author: Yuezhang Mo Date: Tue Apr 12 12:23:10 2022 +0900 block: add sync_blockdev_range() sync_blockdev_range() is to support syncing multiple sectors with as few block device requests as possible, it is helpful to make the block device to give full play to its performance. Signed-off-by: Yuezhang Mo Suggested-by: Christoph Hellwig Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Christoph Hellwig Reviewed-by: Jens Axboe Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 9b002894b4c252169abc26720452bf3746114b20 Author: Chung-Chiang Cheng Date: Wed Apr 6 17:55:52 2022 +0800 exfat: introduce mount option 'sys_tz' EXFAT_TZ_VALID bit in {create,modify,access}_tz is corresponding to OffsetValid field in exfat specification [1]. When this bit isn't set, timestamps should be treated as having the same UTC offset as the current local time. Currently, there is an option 'time_offset' for users to specify the UTC offset for this issue. This patch introduces a new mount option 'sys_tz' to use system timezone as time offset. Link: [1] https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification#74102-offsetvalid-field Signed-off-by: Chung-Chiang Cheng Acked-by: Sungjong Seo Signed-off-by: Namjae Jeon commit d8dad2588addd1d861ce19e7df3b702330f0c7e3 Author: Yuezhang Mo Date: Mon Apr 4 11:58:06 2022 +0900 exfat: fix referencing wrong parent directory information after renaming During renaming, the parent directory information maybe updated. But the file/directory still references to the old parent directory information. This bug will cause 2 problems. (1) The renamed file can not be written. [10768.175172] exFAT-fs (sda1): error, failed to bmap (inode : 7afd50e4 iblock : 0, err : -5) [10768.184285] exFAT-fs (sda1): Filesystem has been set read-only ash: write error: Input/output error (2) Some dentries of the renamed file/directory are not set to deleted after removing the file/directory. exfat_update_parent_info() is a workaround for the wrong parent directory information being used after renaming. Now that bug is fixed, this is no longer needed, so remove it. Fixes: 5f2aa075070c ("exfat: add inode operations") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Daniel Palmer Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 1e39b27bd9d12d615973c3aacefb936466512cae Merge: 17155d5db7eec 1318252617367 Author: Jakub Kicinski Date: Sun May 22 17:23:15 2022 -0700 Merge branch 'fix-silence-gcc-12-warnings-in-drivers-net-wireless' Jakub Kicinski says: ==================== Fix/silence GCC 12 warnings in drivers/net/wireless/ as mentioned off list we'd like to get GCC 12 warnings quashed. This set takes care of the warnings we have in drivers/net/wireless/ mostly by relegating them to W=1/W=2 builds. ==================== Link: https://lore.kernel.org/r/20220520194320.2356236-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 13182526173679c3be794c8149226fc258fdfdbe Author: Jakub Kicinski Date: Fri May 20 12:43:20 2022 -0700 wifi: carl9170: silence a GCC 12 -Warray-bounds warning carl9170 has a big union (struct carl9170_cmd) with all the command types in it. But it allocates buffers only large enough for a given command. This upsets GCC 12: drivers/net/wireless/ath/carl9170/cmd.c:125:30: warning: array subscript ‘struct carl9170_cmd[0]’ is partly outside array bounds of ‘unsigned char[8]’ [-Warray-bounds] 125 | tmp->hdr.cmd = cmd; | ~~~~~~~~~~~~~^~~~~ Punt the warning to W=1 for now. Hopefully GCC will learn to recognize which fields are in-bounds. Acked-by: Christian Lamparter Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit 84f23fb192ef62cef438fdae932ce9d96d131b0c Author: Jakub Kicinski Date: Fri May 20 12:43:18 2022 -0700 wifi: brcmfmac: work around a GCC 12 -Warray-bounds warning GCC 12 really doesn't like partial struct allocations: drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2202:32: warning: array subscript ‘struct brcmf_ext_join_params_le[0]’ is partly outside array bounds of ‘void[70]’ [-Warray-bounds] 2202 | ext_join_params->scan_le.passive_time = | ^~ brcmfmac is trying to save 2 bytes at the end by either allocating or not allocating a channel member. Let's keep @join_params_size the "right" size but kmalloc() the full structure. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit af3cdfd30c631dd6bb56933d67a0f0df2980b7d1 Author: Jakub Kicinski Date: Fri May 20 12:43:17 2022 -0700 wifi: iwlwifi: use unsigned to silence a GCC 12 warning GCC 12 says: drivers/net/wireless/intel/iwlwifi/mvm/sta.c:1076:37: warning: array subscript -1 is below array bounds of ‘struct iwl_mvm_tid_data[9]’ [-Warray-bounds] 1076 | if (mvmsta->tid_data[tid].state != IWL_AGG_OFF) | ~~~~~~~~~~~~~~~~^~~~~ Whatever, tid is a bit from for_each_set_bit(), it's clearly unsigned. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit bd1d129daa3ede265a880e2c6a7f91eab0f4dc62 Author: Jakub Kicinski Date: Fri May 20 12:43:16 2022 -0700 wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12 For some reason GCC 12 decided to complain about the common pattern of queuing an object onto a list on the stack in ath6k: inlined from ‘ath6kl_htc_mbox_tx’ at drivers/net/wireless/ath/ath6kl/htc_mbox.c:1142:3: include/linux/list.h:74:19: warning: storing the address of local variable ‘queue’ in ‘*&packet_15(D)->list.prev’ [-Wdangling-pointer=] 74 | new->prev = prev; | ~~~~~~~~~~^~~~~~ Move the warning to W=1, hopefully it goes away with a compiler update. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit ee3db469dd317e82f57b13aa3bc61be5cb60c2b4 Author: Jakub Kicinski Date: Fri May 20 12:43:15 2022 -0700 wifi: rtlwifi: remove always-true condition pointed out by GCC 12 The .value is a two-dim array, not a pointer. struct iqk_matrix_regs { bool iqk_done; long value[1][IQK_MATRIX_REG_NUM]; }; Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit e95032988053c17baf6c7e27024f5103a19a5f4a Author: Jakub Kicinski Date: Fri May 20 12:43:14 2022 -0700 wifi: ath9k: silence array-bounds warning on GCC 12 GCC 12 says: drivers/net/wireless/ath/ath9k/mac.c: In function ‘ath9k_hw_resettxqueue’: drivers/net/wireless/ath/ath9k/mac.c:373:22: warning: array subscript 32 is above array bounds of ‘struct ath9k_tx_queue_info[10]’ [-Warray-bounds] 373 | qi = &ah->txq[q]; | ~~~~~~~^~~ I don't know where it got the 32 from, relegate the warning to W=1+. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit 0c7ab953d1f2358cce5bcddf96877b16966bbabc Author: Jakub Kicinski Date: Fri May 20 12:43:13 2022 -0700 wifi: plfxlc: remove redundant NULL-check for GCC 12 GCC is upset that we check the return value of plfxlc_usb_dev() even tho it can't be NULL: drivers/net/wireless/purelifi/plfxlc/usb.c: In function ‘resume’: drivers/net/wireless/purelifi/plfxlc/usb.c:840:20: warning: the comparison will always evaluate as ‘true’ for the address of ‘dev’ will never be NULL [-Waddress] 840 | if (!pl || !plfxlc_usb_dev(pl)) | ^ plfxlc_usb_dev() returns an address of one of the members of pl, so it's safe to drop these checks. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski commit ab6a8d3f1a2a85dea5b300fd63b7033cb1040a95 Merge: 4183e4f27f402 73c348d4ab5c3 Author: Dave Chinner Date: Mon May 23 08:55:09 2022 +1000 Merge branch 'guilt/xfs-5.19-misc-3' into xfs-5.19-for-next commit 4183e4f27f402d712bccab30588a6fe7575963c0 Author: Darrick J. Wong Date: Mon May 23 08:43:46 2022 +1000 xfs: share xattr name and value buffers when logging xattr updates While running xfs/297 and generic/642, I noticed a crash in xfs_attri_item_relog when it tries to copy the attr name to the new xattri log item. I think what happened here was that we called ->iop_commit on the old attri item (which nulls out the pointers) as part of a log force at the same time that a chained attr operation was ongoing. The system was busy enough that at some later point, the defer ops operation decided it was necessary to relog the attri log item, but as we've detached the name buffer from the old attri log item, we can't copy it to the new one, and kaboom. I think there's a broader refcounting problem with LARP mode -- the setxattr code can return to userspace before the CIL actually formats and commits the log item, which results in a UAF bug. Therefore, the xattr log item needs to be able to retain a reference to the name and value buffers until the log items have completely cleared the log. Furthermore, each time we create an intent log item, we allocate new memory and (re)copy the contents; sharing here would be very useful. Solve the UAF and the unnecessary memory allocations by having the log code create a single refcounted buffer to contain the name and value contents. This buffer can be passed from old to new during a relog operation, and the logging code can (optionally) attach it to the xfs_attr_item for reuse when LARP mode is enabled. This also fixes a problem where the xfs_attri_log_item objects weren't being freed back to the same cache where they came from. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 22a68ba724232ba675166c307ddef3749ae4c37c Author: Darrick J. Wong Date: Mon May 23 08:41:03 2022 +1000 xfs: do not use logged xattr updates on V4 filesystems V4 superblocks do not contain the log_incompat feature bit, which means that we cannot protect xattr log items against kernels that are too old to know how to recover them. Turn off the log items for such filesystems and adjust the "delayed" name to reflect what it's really controlling. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 17155d5db7eecf512404b894266b77797ac127ce Author: Nobuhiro Iwamatsu Date: Fri May 20 17:48:23 2022 +0900 dt-bindings: net: toshiba,visconti-dwmac: Update the common clock properties The clock for this driver switched to the common clock controller driver. Therefore, update common clock properties for ethernet device in the binding document. Signed-off-by: Nobuhiro Iwamatsu Acked-by: Rob Herring Signed-off-by: David S. Miller commit 0a3ad7d323686fbaae8688326cc5ea0d185c6fca Author: Randy Dunlap Date: Thu May 19 22:15:23 2022 -0700 net: dsa: restrict SMSC_LAN9303_I2C kconfig Since kconfig 'select' does not follow dependency chains, if symbol KSA selects KSB, then KSA should also depend on the same symbols that KSB depends on, in order to prevent Kconfig warnings and possible build errors. Change NET_DSA_SMSC_LAN9303_I2C and NET_DSA_SMSC_LAN9303_MDIO so that they are limited to VLAN_8021Q if the latter is enabled. This prevents the Kconfig warning: WARNING: unmet direct dependencies detected for NET_DSA_SMSC_LAN9303 Depends on [m]: NETDEVICES [=y] && NET_DSA [=y] && (VLAN_8021Q [=m] || VLAN_8021Q [=m]=n) Selected by [y]: - NET_DSA_SMSC_LAN9303_I2C [=y] && NETDEVICES [=y] && NET_DSA [=y] && I2C [=y] Fixes: 430065e26719 ("net: dsa: lan9303: add VLAN IDs to master device") Signed-off-by: Randy Dunlap Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Cc: Vladimir Oltean Cc: Juergen Borleis Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Mans Rullgard Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 2a11fb1d1b8501c430472c66ea5390cb719bbd8f Author: Tom Rix Date: Sun May 22 09:36:27 2022 -0400 net: fddi: skfp: smt: Remove extra parameters to vararg macro cppcheck reports [drivers/net/fddi/skfp/smt.c:750]: (warning) printf format string requires 0 parameters but 2 are given. DB_SBAN is a vararg macro, like DB_ESSN. Remove the extra args and the nl. Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit 265f58f60a29c2e9d471a928556622e2a4aa8b89 Merge: cf0005d2b07b6 197c9e9b17b11 Author: David S. Miller Date: Sun May 22 22:24:33 2022 +0100 Merge branch 'mt7986-support' Jakub Kicinski says: ==================== introduce mt7986 ethernet support Add support for mt7986-eth driver available on mt7986 soc. Changes since v2: - rely on GFP_KERNEL whenever possible - define mtk_reg_map struct to introduce soc register map and avoid macros - improve comments Changes since v1: - drop SRAM option - convert ring->dma to void - convert scratch_ring to void - enable port4 - fix irq dts bindings - drop gmac1 support from mt7986a-rfb dts for the moment ==================== Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 197c9e9b17b115e04c30d9e185ced582b1fee2a8 Author: Lorenzo Bianconi Date: Fri May 20 20:11:39 2022 +0200 net: ethernet: mtk_eth_soc: introduce support for mt7986 chipset Add support for mt7986-eth driver available on mt7986 soc. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 4d6426904f13bdb5ab20a2dddfb3427dc518f1f8 Author: Lorenzo Bianconi Date: Fri May 20 20:11:38 2022 +0200 net: ethernet: mtk_eth_soc: convert scratch_ring pointer to void Simplify the code converting scratch_ring pointer to void Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 7173eca8eeb7d58f885f7506f808f17851f934ce Author: Lorenzo Bianconi Date: Fri May 20 20:11:37 2022 +0200 net: ethernet: mtk_eth_soc: convert ring dma pointer to void Simplify the code converting {tx,rx} ring dma pointer to void Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 160d3a9b192985b1cea7f394ab745de762d89165 Author: Lorenzo Bianconi Date: Fri May 20 20:11:36 2022 +0200 net: ethernet: mtk_eth_soc: introduce MTK_NETSYS_V2 support Introduce MTK_NETSYS_V2 support. MTK_NETSYS_V2 defines 32B TX/RX DMA descriptors. This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 8cb42714cdc1fc1d91f0a67aa710b794280b7af0 Author: Lorenzo Bianconi Date: Fri May 20 20:11:35 2022 +0200 net: ethernet: mtk_eth_soc: introduce device register map Introduce reg_map structure to add the capability to support different register definitions. Move register definitions in mtk_regmap structure. This is a preliminary patch to introduce mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 72e27d3718ba24e75bef7a17d1acd8fbfe37c623 Author: Lorenzo Bianconi Date: Fri May 20 20:11:34 2022 +0200 net: ethernet: mtk_eth_soc: rely on rxd_size field in mtk_rx_alloc/mtk_rx_clean Remove mtk_rx_dma structure layout dependency in mtk_rx_alloc/mtk_rx_clean. Initialize to 0 rxd3 and rxd4 in mtk_rx_alloc. This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 649a752775c26bb9f9d163aa1102ab9cc5941496 Author: Lorenzo Bianconi Date: Fri May 20 20:11:33 2022 +0200 net: ethernet: mtk_eth_soc: rely on txd_size field in mtk_poll_tx/mtk_poll_rx This is a preliminary to ad mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 670ff7dabbb0f317305fa8ccdc87ac88d0c87809 Author: Lorenzo Bianconi Date: Fri May 20 20:11:32 2022 +0200 net: ethernet: mtk_eth_soc: add rxd_size to mtk_soc_data Similar to tx counterpart, introduce rxd_size in mtk_soc_data data structure. This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit e70a5634c1f58a352aea3dbf2a50e98a0cadd68c Author: Lorenzo Bianconi Date: Fri May 20 20:11:31 2022 +0200 net: ethernet: mtk_eth_soc: rely on txd_size in txd_to_idx This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit c4fd06c2bb82c8167e69ca655ea2ed217ec3ca89 Author: Lorenzo Bianconi Date: Fri May 20 20:11:30 2022 +0200 net: ethernet: mtk_eth_soc: rely on txd_size in mtk_desc_to_tx_buf This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 0e05744beda4ae2d65100ed217e4bd50130b4078 Author: Lorenzo Bianconi Date: Fri May 20 20:11:29 2022 +0200 net: ethernet: mtk_eth_soc: rely on txd_size in mtk_tx_alloc/mtk_tx_clean This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit eb067347aa87eaf8a42d945d3e877b1e8333f5ea Author: Lorenzo Bianconi Date: Fri May 20 20:11:28 2022 +0200 net: ethernet: mtk_eth_soc: add txd_size to mtk_soc_data In order to remove mtk_tx_dma size dependency, introduce txd_size in mtk_soc_data data structure. Rely on txd_size in mtk_init_fq_dma() and mtk_dma_free() routines. This is a preliminary patch to add mt7986 ethernet support. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 731f3fd6bc879fcf11e99a2576747a33d3958cef Author: Lorenzo Bianconi Date: Fri May 20 20:11:27 2022 +0200 net: ethernet: mtk_eth_soc: move tx dma desc configuration in mtk_tx_set_dma_desc Move tx dma descriptor configuration in mtk_tx_set_dma_desc routine. This is a preliminary patch to introduce mt7986 ethernet support since it relies on a different tx dma descriptor layout. Tested-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 62dfb4cc444649b3f841ddb4f472a12ed6422714 Author: Lorenzo Bianconi Date: Fri May 20 20:11:26 2022 +0200 net: ethernet: mtk_eth_soc: rely on GFP_KERNEL for dma_alloc_coherent whenever possible Rely on GFP_KERNEL for dma descriptors mappings in mtk_tx_alloc(), mtk_rx_alloc() and mtk_init_fq_dma() since they are run in non-irq context. Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 4b139b75cc9590136ab5eb015ebfd84568543e8c Author: Lorenzo Bianconi Date: Fri May 20 20:11:25 2022 +0200 dt-bindings: net: mediatek,net: add mt7986-eth binding Introduce dts bindings for mt7986 soc in mediatek,net.yaml. Reviewed-by: Rob Herring Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 082ff36bd5c010f77227d881a199c7548f0a6aaf Author: Lorenzo Bianconi Date: Fri May 20 20:11:24 2022 +0200 arm64: dts: mediatek: mt7986: introduce ethernet nodes Introduce ethernet nodes in mt7986 bindings in order to enable mt7986a/mt7986b ethernet support. Co-developed-by: Sam Shih Signed-off-by: Sam Shih Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit cf0005d2b07b6eccc8d4f3f3c4faee59e7409a95 Merge: 4149af28318a1 9dec850fd7c21 Author: David S. Miller Date: Sun May 22 22:21:11 2022 +0100 Merge branch 'net-gcc12-warnings' Jakub Kicinski says: ==================== eth: silence the GCC 12 array-bounds warnings Silence the array-bounds warnings in Ethernet drivers. v2 uses -Wno-array-bounds directly. ==================== Signed-off-by: David S. Miller commit 9dec850fd7c210a04b4707df8e6c95bfafdd6a4b Author: Jakub Kicinski Date: Fri May 20 12:56:05 2022 -0700 eth: tg3: silence the GCC 12 array-bounds warning GCC 12 currently generates a rather inconsistent warning: drivers/net/ethernet/broadcom/tg3.c:17795:51: warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’ [-Warray-bounds] 17795 | struct tg3_napi *tnapi = &tp->napi[i]; | ~~~~~~~~^~~ i is guaranteed < tp->irq_max which in turn is either 1 or 5. There are more loops like this one in the driver, but strangely GCC 12 dislikes only this single one. Silence this silliness for now. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 385bc51b41ea74a91545600cb3d731754372f75e Author: Jakub Kicinski Date: Fri May 20 12:56:04 2022 -0700 eth: ice: silence the GCC 12 array-bounds warning GCC 12 gets upset because driver allocates partial struct ice_aqc_sw_rules_elem buffers. The writes are within bounds. Silence these warnings for now, our build bot runs GCC 12 so we won't allow any new instances. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 06da3e8f390aba135ae8808e9424e8a68e53d261 Author: Jakub Kicinski Date: Fri May 20 12:56:03 2022 -0700 eth: mtk_eth_soc: silence the GCC 12 array-bounds warning GCC 12 gets upset because in mtk_foe_entry_commit_subflow() this driver allocates a partial structure. The writes are within bounds. Silence these warnings for now, our build bot runs GCC 12 so we won't allow any new instances. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7e4d1c23759257ea62c418c8fb25ddbde1059547 Merge: 15d221d0c345b 0a09c5b8cb8f7 Author: David S. Miller Date: Sun May 22 22:18:05 2022 +0100 Merge branch 'dpaa2-swtso-fixes' Ioana Ciornei says: ==================== dpaa2-eth: software TSO fixes This patch fixes the software TSO feature in dpaa2-eth. There are multiple errors that I made in the initial submission of the code, which I didn't caught since I was always running with passthough IOMMU. The bug report came in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215886 The bugs are in the Tx confirmation path, where I was trying to retrieve a virtual address after DMA unmapping the area. Besides that, another dma_unmap call was made with the wrong size. ==================== Signed-off-by: David S. Miller commit 0a09c5b8cb8f75344da7d90c771b84f7cdeaea04 Author: Ioana Ciornei Date: Sun May 22 15:52:51 2022 +0300 dpaa2-eth: unmap the SGT buffer before accessing its contents DMA unmap the Scatter/Gather table before going through the array to unmap and free each of the header and data chunks. This is so we do not touch the data between the dma_map and dma_unmap calls. Fixes: 3dc709e0cd47 ("dpaa2-eth: add support for software TSO") Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit d5f4e19a85670b4e5697654f4a4e086e064f8a47 Author: Ioana Ciornei Date: Sun May 22 15:52:50 2022 +0300 dpaa2-eth: use the correct software annotation field The incorrect software annotation field was being used, swa->sg.sgt_size instead of swa->tso.sgt_size, which meant that the SGT buffer was unmapped with a wrong size. This is also confirmed by the DMA API debug prints which showed the following: [ 38.962434] DMA-API: fsl_dpaa2_eth dpni.2: device driver frees DMA memory with different size [device address=0x0000fffffafba740] [map size=224 bytes] [unmap size=0 bytes] [ 38.980496] WARNING: CPU: 11 PID: 1131 at kernel/dma/debug.c:973 check_unmap+0x58c/0x9b0 [ 38.988586] Modules linked in: [ 38.991631] CPU: 11 PID: 1131 Comm: iperf3 Not tainted 5.18.0-rc7-00117-g59130eeb2b8f #1972 [ 38.999970] Hardware name: NXP Layerscape LX2160ARDB (DT) Fixes: 3dc709e0cd47 ("dpaa2-eth: add support for software TSO") Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 06d129946a71f3159b3b40ee95549183edf2c79d Author: Ioana Ciornei Date: Sun May 22 15:52:49 2022 +0300 dpaa2-eth: retrieve the virtual address before dma_unmap The TSO header was DMA unmapped before the virtual address was retrieved and then used to free the buffer. This meant that we were actually removing the DMA map and then trying to search for it to help in retrieving the virtual address. This lead to a invalid virtual address being used in the kfree call. Fix this by calling dpaa2_iova_to_virt() prior to the dma_unmap call. [ 487.231819] Unable to handle kernel paging request at virtual address fffffd9807000008 (...) [ 487.354061] Hardware name: SolidRun LX2160A Honeycomb (DT) [ 487.359535] pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 487.366485] pc : kfree+0xac/0x304 [ 487.369799] lr : kfree+0x204/0x304 [ 487.373191] sp : ffff80000c4eb120 [ 487.376493] x29: ffff80000c4eb120 x28: ffff662240c46400 x27: 0000000000000001 [ 487.383621] x26: 0000000000000001 x25: ffff662246da0cc0 x24: ffff66224af78000 [ 487.390748] x23: ffffad184f4ce008 x22: ffffad1850185000 x21: ffffad1838d13cec [ 487.397874] x20: ffff6601c0000000 x19: fffffd9807000000 x18: 0000000000000000 [ 487.405000] x17: ffffb910cdc49000 x16: ffffad184d7d9080 x15: 0000000000004000 [ 487.412126] x14: 0000000000000008 x13: 000000000000ffff x12: 0000000000000000 [ 487.419252] x11: 0000000000000004 x10: 0000000000000001 x9 : ffffad184d7d927c [ 487.426379] x8 : 0000000000000000 x7 : 0000000ffffffd1d x6 : ffff662240a94900 [ 487.433505] x5 : 0000000000000003 x4 : 0000000000000009 x3 : ffffad184f4ce008 [ 487.440632] x2 : ffff662243eec000 x1 : 0000000100000100 x0 : fffffc0000000000 [ 487.447758] Call trace: [ 487.450194] kfree+0xac/0x304 [ 487.453151] dpaa2_eth_free_tx_fd.isra.0+0x33c/0x3e0 [fsl_dpaa2_eth] [ 487.459507] dpaa2_eth_tx_conf+0x100/0x2e0 [fsl_dpaa2_eth] [ 487.464989] dpaa2_eth_poll+0xdc/0x380 [fsl_dpaa2_eth] Fixes: 3dc709e0cd47 ("dpaa2-eth: add support for software TSO") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215886 Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 4149af28318a1335f844a778d67d1fd27d05a505 Author: Vladimir Oltean Date: Sun May 22 12:27:01 2022 +0300 net: mscc: ocelot: offload tc action "ok" using an empty action vector The "ok" tc action is useful when placed in front of a more generic filter to exclude some more specific rules from matching it. The ocelot switches can offload this tc action by creating an empty action vector (no _ENA fields set to 1). This makes sense for all of VCAP IS1, IS2 and ES0 (but not for PSFP). Add support for this action. Note that this makes the gact_drop_and_ok_test() selftest pass, where "action ok" is used in front of an "action drop" rule, both offloaded to VCAP IS2. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit cb7f2d05da8ff973444d7e44b9c48e7c90d63915 Merge: c304eddcecfe2 4ea1396a8bd5b Author: David S. Miller Date: Sun May 22 22:14:13 2022 +0100 Merge branch 'ocelot-selftests' Vladimir Oltean says: ==================== Streamline Ocelot tc-chains selftest This series changes the output and the argument format of the Ocelot switch selftest so that it is more similar to what can be found in tools/testing/selftests/net/forwarding/. ==================== Signed-off-by: David S. Miller commit 4ea1396a8bd5b7af4df15c52396c640a92b05b30 Author: Vladimir Oltean Date: Sun May 22 12:50:40 2022 +0300 selftests: ocelot: tc_flower_chains: reorder interfaces Use the standard interface order h1, swp1, swp2, h2 that is used by the forwarding selftest framework. The previous order was confusing even with the ASCII drawing. That isn't needed anymore. This also drops the fixed MAC addresses and uses STABLE_MAC_ADDRS, which ensures the MAC addresses are unique. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 93196ef911bac57f43034317c50e9ca42acf55c4 Author: Vladimir Oltean Date: Sun May 22 12:50:39 2022 +0300 selftests: ocelot: tc_flower_chains: use conventional interface names This is a robotic rename as follows: eth0 -> swp1 eth1 -> swp2 eth2 -> h2 eth3 -> h1 This brings the selftest more in line with the other forwarding selftests, where h1 is connected to swp1, and h2 to swp2. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 980e74cac800881b30d8984a43ead421487eb3a3 Author: Vladimir Oltean Date: Sun May 22 12:50:38 2022 +0300 selftests: ocelot: tc_flower_chains: streamline test output Bring this driver-specific selftest output in line with the other selftests. Before: Testing VLAN pop.. OK Testing VLAN push.. OK Testing ingress VLAN modification.. OK Testing egress VLAN modification.. OK Testing frame prioritization.. OK After: TEST: VLAN pop [ OK ] TEST: VLAN push [ OK ] TEST: Ingress VLAN modification [ OK ] TEST: Egress VLAN modification [ OK ] TEST: Frame prioritization [ OK ] Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit da50aad6d86716aa48a2b8463c85caea77c0355f Merge: d96a89407e5f6 010ddb813f355 Author: Sebastian Reichel Date: Sun May 22 23:03:29 2022 +0200 Merge power-supply 'fixes' branch Merge power-supply fixes, that missed the v5.18 merge window into power-supply's for-next branch. Signed-off-by: Sebastian Reichel commit 374e72d721d1b0c545d98d8767a346b9007278ef Merge: 80a504669c93b 7b923e67a4a76 Author: Linus Walleij Date: Sun May 22 22:54:23 2022 +0200 Merge tag 'intel-pinctrl-v5.19-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v5.19-2 * Fix immutable IRQ chip examples in the GPIO documentation * Make use of immutable IRQ chip in Intel pin control drivers * Add module alias for Intel Apollo Lake The following is an automated git shortlog grouped by driver: baytrail: - make irq_chip immutable broxton: - Add module alias for Intel Apollo Lake cherryview: - Use GPIO chip pointer in chv_gpio_irq_mask_unmask() - make irq_chip immutable Documentation: - gpio: Advertise irqd_to_hwirq() helper in the examples - gpio: Fix IRQ mask and unmask examples intel: - Fix kernel doc format, i.e. add return sections - Drop unused irqchip member in struct intel_pinctrl - make irq_chip immutable lynxpoint: - make irq_chip immutable commit c304eddcecfe2513ff98ce3ae97d1c196d82ba08 Author: Jakub Kicinski Date: Thu May 19 13:20:54 2022 -0700 net: wrap the wireless pointers in struct net_device in an ifdef Most protocol-specific pointers in struct net_device are under a respective ifdef. Wireless is the notable exception. Since there's a sizable number of custom-built kernels for datacenter workloads which don't build wireless it seems reasonable to ifdefy those pointers as well. While at it move IPv4 and IPv6 pointers up, those are special for obvious reasons. Acked-by: Johannes Berg Acked-by: Stefan Schmidt # ieee802154 Acked-by: Sven Eckelmann Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5ff851b7be752a6d607c289b489c40f96f9dc489 Author: Uwe Kleine-König Date: Fri May 20 08:26:50 2022 +0200 net: fec: Do proper error checking for enet_out clk An error code returned by devm_clk_get() might have other meanings than "This clock doesn't exist". So use devm_clk_get_optional() and handle all remaining errors as fatal. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 15d221d0c345b76947911a3ac91897ffe2f1cc4e Author: Christophe JAILLET Date: Sat May 21 08:33:01 2022 +0200 hinic: Avoid some over memory allocation 'prod_idx' (atomic_t) is larger than 'shadow_idx' (u16), so some memory is over-allocated. Fixes: b15a9f37be2b ("net-next/hinic: Add wq") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 43252ed15f46658cec64edecfe610e40f6a12d85 Author: Uwe Kleine-König Date: Sat May 21 10:34:25 2022 +0200 net: fec: Do proper error checking for optional clks An error code returned by devm_clk_get() might have other meanings than "This clock doesn't exist". So use devm_clk_get_optional() and handle all remaining errors as fatal. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 621427fbdada788f18f77238e1c36f463c2cb9d1 Author: Tommaso Merciai Date: Sat May 21 01:58:46 2022 +0200 net: phy: DP83822: enable rgmii mode if phy_interface_is_rgmii RGMII mode can be enable from dp83822 straps, and also writing bit 9 of register 0x17 - RMII and Status Register (RCSR). When phy_interface_is_rgmii rgmii mode must be enabled, same for contrary, this prevents malconfigurations of hw straps References: - https://www.ti.com/lit/gpn/dp83822i p66 Signed-off-by: Tommaso Merciai Co-developed-by: Michael Trimarchi Suggested-by: Alberto Bianchi Tested-by: Tommaso Merciai Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 80a504669c93b3c25e8f705d876bf9fd92ddab47 Author: zhaoxiao Date: Fri May 20 13:20:21 2022 +0800 pinctrl: berlin: bg4ct: Use devm_platform_*ioremap_resource() APIs Use devm_platform_get_and_ioremap_resource() and devm_platform_ioremap_resource() APIs instead of their open coded analogues. Signed-off-by: zhaoxiao Link: https://lore.kernel.org/r/20220520052021.25631-1-zhaoxiao@uniontech.com Signed-off-by: Linus Walleij commit a3f7404c0befe336108094b3141169abd1fb1561 Author: Muhammad Usama Anjum Date: Sat May 21 14:37:06 2022 +0500 net: selftests: Add stress_reuseport_listen to .gitignore Add newly added stress_reuseport_listen object to .gitignore file. Fixes: ec8cb4f617a2 ("net: selftests: Stress reuseport listen") Signed-off-by: Muhammad Usama Anjum Signed-off-by: David S. Miller commit 1ce6c8d68f8ac587f54d0a271ac594d3d51f3efb Author: Jason A. Donenfeld Date: Sun May 22 22:25:41 2022 +0200 random: check for signals after page of pool writes get_random_bytes_user() checks for signals after producing a PAGE_SIZE worth of output, just like /dev/zero does. write_pool() is doing basically the same work (actually, slightly more expensive), and so should stop to check for signals in the same way. Let's also name it write_pool_user() to match get_random_bytes_user(), so this won't be misused in the future. Before this patch, massive writes to /dev/urandom would tie up the process for an extremely long time and make it unterminatable. After, it can be successfully interrupted. The following test program can be used to see this works as intended: #include #include #include #include static unsigned char x[~0U]; static void handle(int) { } int main(int argc, char *argv[]) { pid_t pid = getpid(), child; int fd; signal(SIGUSR1, handle); if (!(child = fork())) { for (;;) kill(pid, SIGUSR1); } fd = open("/dev/urandom", O_WRONLY); pause(); printf("interrupted after writing %zd bytes\n", write(fd, x, sizeof(x))); close(fd); kill(child, SIGTERM); return 0; } Result before: "interrupted after writing 2147479552 bytes" Result after: "interrupted after writing 4096 bytes" Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit c12b95885ab2d318fdad9b395acd53df42fd7b0e Merge: eb4c078896473 9a3dedcf18096 Author: David S. Miller Date: Sun May 22 21:30:53 2022 +0100 Merge branch 'rxrpc-fixes' David Howells says: ==================== rxrpc: Miscellaneous fixes Here are some fixes for AF_RXRPC: (1) Fix listen() allowing preallocation to overrun the prealloc buffer. (2) Prevent resending the request if we've seen the reply starting to arrive. (3) Fix accidental sharing of ACK state between transmission and reception. (4) Ignore ACKs in which ack.previousPacket regresses. This indicates the highest DATA number so far seen, so should not be seen to go backwards. (5) Fix the determination of when to generate an IDLE-type ACK, simplifying it so that we generate one if we have more than two DATA packets that aren't hard-acked (consumed) or soft-acked (in the rx buffer, but could be discarded and re-requested). ==================== Signed-off-by: David S. Miller commit 9a3dedcf18096e8f7f22b8777d78c4acfdea1651 Author: David Howells Date: Sat May 21 09:03:31 2022 +0100 rxrpc: Fix decision on when to generate an IDLE ACK Fix the decision on when to generate an IDLE ACK by keeping a count of the number of packets we've received, but not yet soft-ACK'd, and the number of packets we've processed, but not yet hard-ACK'd, rather than trying to keep track of which DATA sequence numbers correspond to those points. We then generate an ACK when either counter exceeds 2. The counters are both cleared when we transcribe the information into any sort of ACK packet for transmission. IDLE and DELAY ACKs are skipped if both counters are 0 (ie. no change). Fixes: 805b21b929e2 ("rxrpc: Send an ACK after every few DATA packets we receive") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 81524b6312535897707f2942695da1d359a5e56b Author: David Howells Date: Sat May 21 09:03:24 2022 +0100 rxrpc: Don't let ack.previousPacket regress The previousPacket field in the rx ACK packet should never go backwards - it's now the highest DATA sequence number received, not the last on received (it used to be used for out of sequence detection). Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 8940ba3cfe4841928777fd45eaa92051522c7f0c Author: David Howells Date: Sat May 21 09:03:18 2022 +0100 rxrpc: Fix overlapping ACK accounting Fix accidental overlapping of Rx-phase ACK accounting with Tx-phase ACK accounting through variables shared between the two. call->acks_* members refer to ACKs received in the Tx phase and call->ackr_* members to ACKs sent/to be sent during the Rx phase. Fixes: 1a2391c30c0b ("rxrpc: Fix detection of out of order acks") Signed-off-by: David Howells cc: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 114af61f88fbe34d641b13922d098ffec4c1be1b Author: David Howells Date: Sat May 21 09:03:11 2022 +0100 rxrpc: Don't try to resend the request if we're receiving the reply rxrpc has a timer to trigger resending of unacked data packets in a call. This is not cancelled when a client call switches to the receive phase on the basis that most calls don't last long enough for it to ever expire. However, if it *does* expire after we've started to receive the reply, we shouldn't then go into trying to retransmit or pinging the server to find out if an ack got lost. Fix this by skipping the resend code if we're into receiving the reply to a client call. Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 88e22159750b0d55793302eeed8ee603f5c1a95c Author: David Howells Date: Sat May 21 09:03:04 2022 +0100 rxrpc: Fix listen() setting the bar too high for the prealloc rings AF_RXRPC's listen() handler lets you set the backlog up to 32 (if you bump up the sysctl), but whilst the preallocation circular buffers have 32 slots in them, one of them has to be a dead slot because we're using CIRC_CNT(). This means that listen(rxrpc_sock, 32) will cause an oops when the socket is closed because rxrpc_service_prealloc_one() allocated one too many calls and rxrpc_discard_prealloc() won't then be able to get rid of them because it'll think the ring is empty. rxrpc_release_calls_on_socket() then tries to abort them, but oopses because call->peer isn't yet set. Fix this by setting the maximum backlog to RXRPC_BACKLOG_MAX - 1 to match the ring capacity. BUG: kernel NULL pointer dereference, address: 0000000000000086 ... RIP: 0010:rxrpc_send_abort_packet+0x73/0x240 [rxrpc] Call Trace: ? __wake_up_common_lock+0x7a/0x90 ? rxrpc_notify_socket+0x8e/0x140 [rxrpc] ? rxrpc_abort_call+0x4c/0x60 [rxrpc] rxrpc_release_calls_on_socket+0x107/0x1a0 [rxrpc] rxrpc_release+0xc9/0x1c0 [rxrpc] __sock_release+0x37/0xa0 sock_close+0x11/0x20 __fput+0x89/0x240 task_work_run+0x59/0x90 do_exit+0x319/0xaa0 Fixes: 00e907127e6f ("rxrpc: Preallocate peers, conns and calls for incoming service requests") Reported-by: Marc Dionne Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Link: https://lists.infradead.org/pipermail/linux-afs/2022-March/005079.html Signed-off-by: David S. Miller commit c680c6a814a2269427fad9ac417ab16756bceae9 Author: Christophe JAILLET Date: Fri May 20 21:21:56 2022 +0200 gpio: sim: Use correct order for the parameters of devm_kcalloc() We should have 'n', then 'size', not the opposite. This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski commit baea40de321b35c7eefb6afbe34ac49caece76cf Merge: 0598cec957abb adc9613ff66c2 Author: David S. Miller Date: Sun May 22 21:03:02 2022 +0100 Merge branch 'rxrpc-misc' David Howells says: ==================== rxrpc: Miscellaneous changes Here are some miscellaneous changes for AF_RXRPC: (1) Allow the list of local endpoints to be viewed through /proc. (2) Switch to using refcount_t for refcounting. (3) Fix a locking issue found by lockdep. (4) Autogenerate tracing symbol enums from symbol->string maps to make it easier to keep them in sync. (5) Return an error to sendmsg() if a call it tried to set up failed. Because it failed at this point, no notification will be generated for recvmsg to pick up - but userspace still needs to know about the failure. (6) Fix the selection of abort codes generated by internal events. In particular, rxrpc and kafs shouldn't be generating RX_USER_ABORT unless it's because userspace did something to cancel a call. (7) Adjust the interpretation and handling of certain ACK types to try and detect NAT changes causing a call to seem to start mid-flow from a different peer. ==================== Signed-off-by: David S. Miller commit adc9613ff66c26ebaff9814973181ac178beb90b Author: David Howells Date: Sat May 21 08:45:55 2022 +0100 afs: Adjust ACK interpretation to try and cope with NAT If a client's address changes, say if it is NAT'd, this can disrupt an in progress operation. For most operations, this is not much of a problem, but StoreData can be different as some servers modify the target file as the data comes in, so if a store request is disrupted, the file can get corrupted on the server. The problem is that the server doesn't recognise packets that come after the change of address as belonging to the original client and will bounce them, either by sending an OUT_OF_SEQUENCE ACK to the apparent new call if the packet number falls within the initial sequence number window of a call or by sending an EXCEEDS_WINDOW ACK if it falls outside and then aborting it. In both cases, firstPacket will be 1 and previousPacket will be 0 in the ACK information. Fix this by the following means: (1) If a client call receives an EXCEEDS_WINDOW ACK with firstPacket as 1 and previousPacket as 0, assume this indicates that the server saw the incoming packets from a different peer and thus as a different call. Fail the call with error -ENETRESET. (2) Also fail the call if a similar OUT_OF_SEQUENCE ACK occurs if the first packet has been hard-ACK'd. If it hasn't been hard-ACK'd, the ACK packet will cause it to get retransmitted, so the call will just be repeated. (3) Make afs_select_fileserver() treat -ENETRESET as a straight fail of the operation. (4) Prioritise the error code over things like -ECONNRESET as the server did actually respond. (5) Make writeback treat -ENETRESET as a retryable error and make it redirty all the pages involved in a write so that the VM will retry. Note that there is still a circumstance that I can't easily deal with: if the operation is fully received and processed by the server, but the reply is lost due to address change. There's no way to know if the op happened. We can examine the server, but a conflicting change could have been made by a third party - and we can't tell the difference. In such a case, a message like: kAFS: vnode modified {100058:146266} b7->b8 YFS.StoreData64 (op=2646a) will be logged to dmesg on the next op to touch the file and the client will reset the inode state, including invalidating clean parts of the pagecache. Reported-by: Marc Dionne Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Link: http://lists.infradead.org/pipermail/linux-afs/2021-December/004811.html # v1 Signed-off-by: David S. Miller commit de696c4784f0706884458893c5a6c39b3a3ff65c Author: David Howells Date: Sat May 21 08:45:48 2022 +0100 rxrpc, afs: Fix selection of abort codes The RX_USER_ABORT code should really only be used to indicate that the user of the rxrpc service (ie. userspace) implicitly caused a call to be aborted - for instance if the AF_RXRPC socket is closed whilst the call was in progress. (The user may also explicitly abort a call and specify the abort code to use). Change some of the points of generation to use other abort codes instead: (1) Abort the call with RXGEN_SS_UNMARSHAL or RXGEN_CC_UNMARSHAL if we see ENOMEM and EFAULT during received data delivery and abort with RX_CALL_DEAD in the default case. (2) Abort with RXGEN_SS_MARSHAL if we get ENOMEM whilst trying to send a reply. (3) Abort with RX_CALL_DEAD if we stop hearing from the peer if we had heard from the peer and abort with RX_CALL_TIMEOUT if we hadn't. (4) Abort with RX_CALL_DEAD if we try to disconnect a call that's not completed successfully or been aborted. Reported-by: Jeffrey Altman Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 4ba68c5192554876bd8c3afd904e3064d2915341 Author: David Howells Date: Sat May 21 08:45:41 2022 +0100 rxrpc: Return an error to sendmsg if call failed If at the end of rxrpc sendmsg() or rxrpc_kernel_send_data() the call that was being given data was aborted remotely or otherwise failed, return an error rather than returning the amount of data buffered for transmission. The call (presumably) did not complete, so there's not much point continuing with it. AF_RXRPC considers it "complete" and so will be unwilling to do anything else with it - and won't send a notification for it, deeming the return from sendmsg sufficient. Not returning an error causes afs to incorrectly handle a StoreData operation that gets interrupted by a change of address due to NAT reconfiguration. This doesn't normally affect most operations since their request parameters tend to fit into a single UDP packet and afs_make_call() returns before the server responds; StoreData is different as it involves transmission of a lot of data. This can be triggered on a client by doing something like: dd if=/dev/zero of=/afs/example.com/foo bs=1M count=512 at one prompt, and then changing the network address at another prompt, e.g.: ifconfig enp6s0 inet 192.168.6.2 && route add 192.168.6.1 dev enp6s0 Tracing packets on an Auristor fileserver looks something like: 192.168.6.1 -> 192.168.6.3 RX 107 ACK Idle Seq: 0 Call: 4 Source Port: 7000 Destination Port: 7001 192.168.6.3 -> 192.168.6.1 AFS (RX) 1482 FS Request: Unknown(64538) (64538) 192.168.6.3 -> 192.168.6.1 AFS (RX) 1482 FS Request: Unknown(64538) (64538) 192.168.6.1 -> 192.168.6.3 RX 107 ACK Idle Seq: 0 Call: 4 Source Port: 7000 Destination Port: 7001 192.168.6.2 -> 192.168.6.1 AFS (RX) 1482 FS Request: Unknown(0) (0) 192.168.6.2 -> 192.168.6.1 AFS (RX) 1482 FS Request: Unknown(0) (0) 192.168.6.1 -> 192.168.6.2 RX 107 ACK Exceeds Window Seq: 0 Call: 4 Source Port: 7000 Destination Port: 7001 192.168.6.1 -> 192.168.6.2 RX 74 ABORT Seq: 0 Call: 4 Source Port: 7000 Destination Port: 7001 192.168.6.1 -> 192.168.6.2 RX 74 ABORT Seq: 29321 Call: 4 Source Port: 7000 Destination Port: 7001 The Auristor fileserver logs code -453 (RXGEN_SS_UNMARSHAL), but the abort code received by kafs is -5 (RX_PROTOCOL_ERROR) as the rx layer sees the condition and generates an abort first and the unmarshal error is a consequence of that at the application layer. Reported-by: Marc Dionne Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Link: http://lists.infradead.org/pipermail/linux-afs/2021-December/004810.html # v1 Signed-off-by: David S. Miller commit dc9fd093b2ebabc25a5d7d0dd5bdfdd6c878e0bf Author: David Howells Date: Sat May 21 08:45:35 2022 +0100 rxrpc: Automatically generate trace tag enums Automatically generate trace tag enums from the symbol -> string mapping tables rather than having the enums as well, thereby reducing duplicated data. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit ad25f5cb39872ca14bcbe00816ae65c22fe04b89 Author: David Howells Date: Sat May 21 08:45:28 2022 +0100 rxrpc: Fix locking issue There's a locking issue with the per-netns list of calls in rxrpc. The pieces of code that add and remove a call from the list use write_lock() and the calls procfile uses read_lock() to access it. However, the timer callback function may trigger a removal by trying to queue a call for processing and finding that it's already queued - at which point it has a spare refcount that it has to do something with. Unfortunately, if it puts the call and this reduces the refcount to 0, the call will be removed from the list. Unfortunately, since the _bh variants of the locking functions aren't used, this can deadlock. ================================ WARNING: inconsistent lock state 5.18.0-rc3-build4+ #10 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. ksoftirqd/2/25 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff888107ac4038 (&rxnet->call_lock){+.?.}-{2:2}, at: rxrpc_put_call+0x103/0x14b {SOFTIRQ-ON-W} state was registered at: ... Possible unsafe locking scenario: CPU0 ---- lock(&rxnet->call_lock); lock(&rxnet->call_lock); *** DEADLOCK *** 1 lock held by ksoftirqd/2/25: #0: ffff8881008ffdb0 ((&call->timer)){+.-.}-{0:0}, at: call_timer_fn+0x5/0x23d Changes ======= ver #2) - Changed to using list_next_rcu() rather than rcu_dereference() directly. Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit a05754295e01f006a651eec759c5dbe682ef6cef Author: David Howells Date: Sat May 21 08:45:22 2022 +0100 rxrpc: Use refcount_t rather than atomic_t Move to using refcount_t rather than atomic_t for refcounts in rxrpc. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 33912c2639ad76660988c8ca97e4d18fca89b668 Author: David Howells Date: Sat May 21 08:45:15 2022 +0100 rxrpc: Allow list of in-use local UDP endpoints to be viewed in /proc Allow the list of in-use local UDP endpoints in the current network namespace to be viewed in /proc. To aid with this, the endpoint list is converted to an hlist and RCU-safe manipulation is used so that the list can be read with only the RCU read lock held. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller commit 0598cec957abbdd47b8eb7dceb51d54ac465417d Merge: 60f243ad1426b a224bd4b88caa Author: David S. Miller Date: Sun May 22 20:46:13 2022 +0100 Merge branch 'ipa-next' Alex Elder says: ==================== net: ipa: a few more small items This series consists of three small sets of changes. Version 2 adds a patch that avoids a warning that occurs when handling a modem crash (I unfortunately didn't notice it earlier). All other patches are the same--just rebased. The first three patches allow a few endpoint features to be specified. At this time, currently-defined endpoints retain the same configuration, but when the monitor functionality is added in the next cycle these options will be required. The fourth patch simply removes an unused function, explaining also why it would likely never be used. The fifth patch is new. It counts the number of modem TX endpoints and uses it to determine how many TREs a transaction needs when when handling a modem crash. It is needed to avoid exceeding the limited number of commands imposed by the last four patches. And the last four patches refactor code related to IPA immediate commands, eliminating an unused field and then simplifying and removing some unneeded code. ==================== Signed-off-by: David S. Miller commit a224bd4b88caa3ac62a4b541a07fae7ea26cab7a Author: Alex Elder Date: Sat May 21 19:32:23 2022 -0500 net: ipa: use data space for command opcodes The 64-bit data field in a transaction is not used for commands. And the opcode array is *only* used for commands. They're (currently) the same size; save a little space in the transaction structure by enclosing the two fields in a union. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 8797972afff3d462711758acec68be11172e2d01 Author: Alex Elder Date: Sat May 21 19:32:22 2022 -0500 net: ipa: remove command info pool The ipa_cmd_info structure now contains only one field, and it's an enumerated type whose values all fit in 8 bits. Currently we'll never use more than 8 TREs in a command transaction, and we can represent that number of command opcodes in the same space as a 64 bit pointer to an ipa_cmd_info structure. Define IPA_COMMAND_TRANS_TRE_MAX as the maximum number of TREs that can be in a command transaction. Replace the info pointer in a transaction with a fixed-size array named cmd_opcode[] of that many bytes. Store the opcode in this array when adding a command TRE to a transaction, as was done previously for the info array. This makes the ipa_cmd_info unused, so get rid of it. When committing an immediate command transaction, use the channel's Boolean command flag to determine whether to fill in the opcode, which will be taken (as before) from the array in the transaction. This makes the command info pool unnecessary, so get rid of it. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 4de284b72e59e1006a6b6358c060265a9f1be100 Author: Alex Elder Date: Sat May 21 19:32:21 2022 -0500 net: ipa: remove command direction argument We no longer use the direction argument for gsi_trans_cmd_add(), so get rid of it in its definition, and in its seven callers. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 7ffba3bdf76a7bf93ec2dc56369ea563dea92b7c Author: Alex Elder Date: Sat May 21 19:32:20 2022 -0500 net: ipa: get rid of ipa_cmd_info->direction The direction field of the ipa_cmd_info structure is set, but never used. It seems it might have been used for the DMA_SHARED_MEM immediate command, but the DIRECTION flag is set based on the value of the passed-in direction flag there. Anyway, remove this unused field from the ipa_cmd_info structure. This is done as a separate patch to make it very obvious that it's not required. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 2091c79ac4deb4f4dd6c5b223d50f4536e3265a2 Author: Alex Elder Date: Sat May 21 19:32:19 2022 -0500 net: ipa: count the number of modem TX endpoints In ipa_endpoint_modem_exception_reset_all(), a high estimate was made of the number of endpoints that need their status register updated. We only used what was needed, so the high estimate didn't matter much. However the next few patches are going to limit the number of commands in a single transaction, and the overestimate would exceed that. So count the number of modem TX endpoints at initialization time, and use it in ipa_endpoint_modem_exception_reset_all(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit d15180b4eadbdee782d97afcbf3c56e2f246c40a Author: Alex Elder Date: Sat May 21 19:32:18 2022 -0500 net: ipa: kill gsi_trans_commit_wait_timeout() Since the beginning gsi_trans_commit_wait_timeout() has existed to provide a way to allow waiting a limited time for a transaction to complete. But that function has never been used. In fact, there is no use for this function, because a transaction committed to hardware should *always* complete. The only reason it might not complete is if there were a hardware failure, or perhaps a system configuration error. Furthermore, if a timeout ever did occur, the IPA hardware would be in an indeterminate state, from which there is no recovery. It would require some sort of complete IPA reset, and would require the participation of the modem, and at this time there is no such sequence defined. So get rid of the definition of gsi_trans_commit_wait_timeout(), and update a few comments accordingly. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit beb90cba607ff060c325e6717d2d5e7ff58abf11 Author: Alex Elder Date: Sat May 21 19:32:17 2022 -0500 net: ipa: specify RX aggregation time limit in config data Don't assume that a 500 microsecond time limit should be used for all receive endpoints that support aggregation. Instead, specify the time limit to use in the configuration data. Set a 500 microsecond limit for all existing RX endpoints, as before. Checking for overflow for the time limit field is a bit complicated. Rather than duplicate a lot of code in ipa_endpoint_data_valid_one(), call WARN() if any value is found to be too large when encoding it. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 3cebb7c2ed2d76f6f8df67b030c34ffe27867766 Author: Alex Elder Date: Sat May 21 19:32:16 2022 -0500 net: ipa: support hard aggregation limits Add a new flag for AP receive endpoints that indicates whether a "hard limit" is used as a criterion for closing aggregation. Add comments explaining the difference between "hard" and "soft" aggregation limits. Pass a flag to ipa_aggr_size_kb() so it computes the proper aggregation size value whether using hard or soft limits. Move that function earlier in "ipa_endpoint.c" so it can be used without a forward-reference. Update ipa_endpoint_data_valid_one() so it validates endpoints whose data indicate a hard aggregation limit is used, and so it reports set aggregation flags for endpoints without aggregation enabled. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 153213f0554d5053d5f9385ae6b4f116c4dc1fb8 Author: Alex Elder Date: Sat May 21 19:32:15 2022 -0500 net: ipa: make endpoint HOLB drop configurable Add a new Boolean flag for RX endpoints defining whether HOLB drop is initially enabled or disabled for the endpoint. All existing AP endpoints should have HOLB drop disabled. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 60f243ad1426b796efed750937733b0e410f9257 Author: Julia Lawall Date: Sat May 21 13:11:28 2022 +0200 qed: fix typos in comments Spelling mistakes (triple letters) in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit b993e72cdd44345b12ed160dfb823bc9bd027108 Author: Julia Lawall Date: Sat May 21 13:11:23 2022 +0200 nfp: flower: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Niklas Söderlund Signed-off-by: David S. Miller commit 878e2eb29ac130c1a2dec6a3c3bb8706f5dd1476 Author: Julia Lawall Date: Sat May 21 13:11:16 2022 +0200 net: marvell: prestera: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit 3f660c1820f7aae10f841ac05aa6f804566ca2cb Author: Julia Lawall Date: Sat May 21 13:10:57 2022 +0200 cirrus: cs89x0: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit cc4e7fa549cb69c18bc2ba7209df373ca06749e3 Author: Julia Lawall Date: Sat May 21 13:10:53 2022 +0200 net: qed: fix typos in comments Spelling mistakes (triple letters) in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit b0ea505ba0d74dd9b5a2e40e872253b13e5c5671 Author: Julia Lawall Date: Sat May 21 13:10:31 2022 +0200 net/mlx5: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit e34be16bee65dc4eee4e4f9398e6acf26d69379e Author: Julia Lawall Date: Sat May 21 13:10:29 2022 +0200 net: mvpp2: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit 1f36a72ae347bc922bddf9382b608afa47a25a28 Author: Julia Lawall Date: Sat May 21 13:10:20 2022 +0200 net: sparx5: switchdev: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit 8877ecb0fc8d7662218a8e7ebb0650f320467935 Author: Christophe JAILLET Date: Sun May 22 15:14:23 2022 +0200 hwmon: (aquacomputer_d5next) Fix an error handling path in aqc_probe() If no memory can be allocated, some resources still need to be released as already done in the other error handling paths. Fixes: 752b927951ea ("hwmon: (aquacomputer_d5next) Add support for Aquacomputer Octo") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/be6b955d50de140fcc96bd116150b435021bf567.1653225250.git.christophe.jaillet@wanadoo.fr Reviewed-by: Aleksa Savic Signed-off-by: Guenter Roeck commit 90de6805267f8c79cd2b1a36805071e257c39b5c Author: Tal Cohen Date: Wed May 11 16:50:30 2022 +0300 habanalabs: use separate structure info for each error collect data Create separate info structure for each error type. The structures shall be used inside the large structure that contains the last session error. This is more scalable for adding more errors in the future. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit f873a27fd50d161111d0e52087af0f5b2111c5c4 Author: Yuri Nudelman Date: Sun May 15 13:46:37 2022 +0300 habanalabs: fix missing handle shift during mmap During mmap operation on the unified memory manager buffer, the vma page offset is shifted to extract the handle value. Due to a typo, it was not shifted back at the end. That could cause the offset to be modified after mmap operation, that may affect subsequent operations. In addition, in allocation flow, in case of out of memory error, idr would not be correctly destroyed, again because of a missing shift. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit e31dd9362f01682192d80221cc4339e4f7140f30 Author: Ohad Sharabi Date: Wed May 11 13:28:39 2022 +0300 habanalabs: remove hdev from hl_ctx_get args This argument is unused by the function. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 9e495e24003eec491141c80a9bd8fb4ea5edc171 Author: Ohad Sharabi Date: Mon Apr 11 09:31:32 2022 +0300 habanalabs: do MMU prefetch as deferred work When user requests to prefetch the MMU translations, the driver will not block the user until prefetch is done. Instead, the prefetch work will be delegated to a WQ which will do it in the background. This way, the prefetch may progress without blocking the user at all. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 83617f5a87f4ad8403bf1177708fedc98b0a1059 Author: Yuri Nudelman Date: Wed May 11 14:50:02 2022 +0300 habanalabs: order memory manager messages Changing format of memory manager messages to make it more readable. In addition, reducing the priority of a warning on missing handle during put. This scenario is not an indication of a problem and may happen in a legal flow, when handle is put from multiple flows. For example, in timeout and completion. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 804d514d7977adbdacb3d4b23bc7d35914fe8930 Author: Oded Gabbay Date: Wed May 11 12:55:30 2022 +0300 habanalabs: return -EFAULT on copy_to_user error If copy_to_user failed in info ioctl, we always return -EFAULT so the user will know there was an error. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 49d2a8af97a20d65d09ac85b57e525b32fdaa0e4 Author: Oded Gabbay Date: Wed May 11 10:06:39 2022 +0300 habanalabs: use NULL for eventfd eventfd is pointer. As such, it should be initialized to NULL, not to 0. In addition, no need to initialize it after creation because the entire structure is zeroed-out. Also, no need to initialize it before release because the entire structure is freed. Reported-by: kernel test robot Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 368b0b4fd6971b63ab9eb0a969b5847755d09493 Author: Oded Gabbay Date: Mon May 9 14:20:13 2022 +0300 habanalabs: update firmware header Update cpucp_if.h to latest version. Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 422ef171038d4855ffe938137039a8f3b3e84293 Author: Tal Cohen Date: Thu Apr 28 13:45:18 2022 +0300 habanalabs: add support for notification via eventfd The driver will be able to send notification events towards a user process, using user's registered event file descriptor. The driver uses the notification mechanism to inform the user about an occurred event. A user thread can wait until a notification is received from the driver. The driver stores the occurred event until the user reads it, using HL_INFO_GET_EVENTS - new ioctl opcode in the INFO ioctl. Gaudi specific implementation includes sending a notification on a TPC assertion event that is received from f/w. Signed-off-by: Tal Cohen Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit f2daa2d97ec16766bc36fc2b6218d0acb47885ed Author: Yuri Nudelman Date: Mon May 2 13:41:11 2022 +0300 habanalabs: add topic to memory manager buffer Currently, buffers from multiple flows pass through the same infra. This way, in logs, we are unable to distinguish between buffers that came from separate flows. To address this problem, add a "topic" to buffer behavior descriptor - a string identifier that will be used to identify in logs the flow this buffer relates to. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit c37803388c95833c4728b089e6c94996dc457d95 Author: Dani Liberman Date: Wed Apr 27 14:14:17 2022 +0300 habanalabs: handle race in driver fini Scenario: 1. During hard reset, driver executes device_kill_open_processes. 2. Drivers file descriptor is not closed yet (user process is alive), hence we are starting loop on all open file descriptors. 3. Just before getting task struct of user process, according to pid, SIGKILL is sent to the user process, hence get_pid_task fails, driver prints a warning and device_kill_open_processes returns an error. 4. Returned error causing driver fini do disable the device object of the process which causes a kernel crash. The fix is to handle this case not as an error and continue fini flow as normal, since the killed process (by the SIGKILL) will release its resources just like it will do when the driver sends him the sigkill. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 0688474eda80ba8a87c38c138aa00b4fea90d8cc Author: Dafna Hirschfeld Date: Mon Apr 11 17:11:23 2022 +0300 habanalabs: add device memory scrub ability through debugfs Add the ability to scrub the device memory with a given value. Add file 'dram_mem_scrub_val' to set the value and a file 'dram_mem_scrub' to scrub the dram. This is very important to help during automated tests, when you want the CI system to randomize the memory before training certain DL topologies. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 829ec038c967d04032d6922b34abff0713660638 Author: Yuri Nudelman Date: Tue Mar 29 14:16:04 2022 +0300 habanalabs: use unified memory manager for CB flow With the new code required for the flow added, we can now switch to using the new memory manager infrastructure, removing the old code. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit dc653c36c98e559575644aaa7c5989301d98f7ed Author: Yuri Nudelman Date: Tue Mar 29 14:08:31 2022 +0300 habanalabs: unified memory manager new code for CB flow This commit adds the new code needed for command buffer flow using the new unified memory manager, without changing the actual functionality. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 2db04a68265519f6d3783f4cb99175fb6923aa2d Author: Ofir Bitton Date: Mon Apr 25 19:58:37 2022 +0300 habanalabs/gaudi: set arbitration timeout to a high value In certain workloads, arbitration timeout might expire although no actual issue present. Hence, we set timeout to a very high value. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit ff086c186bf2b2237410ce9145c16d2141a881ff Author: Yuri Nudelman Date: Thu Mar 31 14:15:16 2022 +0300 habanalabs: add put by handle method to memory manager Putting object by its handle and not by object pointer is useful in some finalization flows that do not have object pointer available. It eliminates the need to first get the object and then perform put twice. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 4e63ce6af63f3db7f922e3c564f23ac606218a3d Author: Yuri Nudelman Date: Wed Mar 23 15:08:22 2022 +0200 habanalabs: hide memory manager page shift The new unified memory manager uses page offset to pass buffer handle during the mmap operation. One problem with this approach is that it requires the handle to always be divisible by the page size, else, the user would not be able to pass it correctly as an argument to the mmap system call. Previously, this was achieved by shifting the handle left after alloc operation, and shifting it right before get operation. This was done in the user code. This creates code duplication, and, what's worse, requires some knowledge from the user regarding the handle internal structure, hurting the encapsulation. This patch encloses all the page shifts inside memory manager functions. This way, the user can take the handle as a black box, and simply use it, without any concert about how it actually works. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit de3484dfaa04a97cd0a11e5367635d36f5b49fee Author: farah kassabri Date: Wed Apr 13 18:16:34 2022 +0300 habanalabs: Add separate poll interval value for protocol Currently we're using the same poll interval value for both COMMs protocol(for sending a command and waits for an ACK) and the device CPU boot phases status waits. On COMMs protocol this interval should be much lower than the device CPU boot which may take long time to change status. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit b0b09b7a8b7d2a015adeb0c66d41f7a28cfc40f2 Author: Dani Liberman Date: Wed Apr 13 21:32:02 2022 +0300 habanalabs: use get_task_pid() to take PID find_get_pid() isn't good in case the user process was run inside docker. As a result, we didn't had the PID and we couldn't kill the user process in case the device got stuck and we needed to reset the device. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 5d1a0de2c778f369970dd50f6713e95068926a8b Author: Ohad Sharabi Date: Sun Apr 10 11:19:42 2022 +0300 habanalabs: add prefetch flag to the MAP operation This patch let the user decide whether the translations done in the page tables will be fetched directly to the STLB right after the map. We want to let the user control whether to perform prefetch upon map operation. To do so a memory flag was added, to be used in the MAP ioctl, called HL_MEM_PREFETCH and if set- the mappings will be fetched directly to the STLB after map operation. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 77c97a7ea85f3a1f8d2c3bf54869c0b6638519c7 Author: Robin Murphy Date: Mon Apr 11 13:36:32 2022 +0100 habanalabs: Stop using iommu_present() Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. Signed-off-by: Robin Murphy Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 0ff1d6f8f55eafadea0a5ca25d0eaf3571813c70 Author: Moti Haimovski Date: Tue Apr 5 11:45:51 2022 +0300 habanalabs: support debugfs Byte access to device DRAM The habanalabs HW requires memory resources to be used by its internal hardware structures. These structures are allocated and initialized by the driver. We would like to use the device HBM for that purpose. This memory is io-remapped and accessed using the writel()/writeb()/writew() commands. Since some of the HW structures are one byte in size we need to add support for the writeb() and readb() functions in the driver. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit ab4ea5872842766b0155b2517db61a4ae99d98e0 Author: Ohad Sharabi Date: Thu Mar 24 16:34:49 2022 +0200 habanalabs: use for_each_sgtable_dma_sg for dma sgt Instead of using for_each_sg when iterating sgt that contains dma entries, use the more proper for_each_sgtable_dma_sg macro. In addition, both Goya and Gaudi have the exact same implementation of the asic function that encapsulate the usage of this macro, so it is better to move that implementation to the common code. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit b8d852add6ea50d1395522e31a2330b9e567d1a0 Author: Rajaravi Krishna Katta Date: Sun Apr 3 18:04:43 2022 +0300 habanalabs/gaudi: use lower_32_bits() for casting Use standard kernel macro to take lower 32 bits of 64-bits variable. Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 2ba75d31198d2242fbce7a8082e44011bd4f2048 Author: Ohad Sharabi Date: Sun Apr 3 11:22:34 2022 +0300 habanalabs: refactor HOP functions in MMU V1 Take advantage of the HOPs shift/masks now defined as arrays. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit b31848430f49d070c2dd07fbcd719930c35fe1ec Author: Rajaravi Krishna Katta Date: Fri Apr 1 14:06:19 2022 +0300 habanalabs: fix comments according to kernel-doc Incorrect/Missing doxygen tag Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 658591ec32f8038bb1c2cd692cb29c3c47161b81 Author: Oded Gabbay Date: Mon Apr 4 19:22:11 2022 +0300 habanalabs: remove user interrupt debug print As user interrupts are a common use case, this dump pollutes the dmesg log, hence removing it. Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit c82b025f2b8cf3c1e0f6dcca52ece71fba4f8b12 Author: Oded Gabbay Date: Sat Apr 2 22:09:16 2022 +0300 habanalabs: don't print normal reset operations Only a hard-reset is an unexpected event which should be notify in the kernel log. Other resets are normal operations and therefore we should not pollute the log with them. Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 738607f005dc07e59424837e0ab286cdc65ccfdf Author: Oded Gabbay Date: Wed Mar 30 10:02:06 2022 +0300 habanalabs: change a reset print to debug level Currently we have two reset prints per reset. One is in the common code and one in each asic-specific file. We can change the asic-specific message to be debug only as we can know the type of reset being done according to the print in the common code, which is also easier to maintain. Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit fcadbf56883eb36fa2186478cb7007b88cd3f068 Author: Oded Gabbay Date: Wed Mar 30 09:16:16 2022 +0300 habanalabs: remove redundant info print Halting compute engines is a print that doesn't add us any information because it is always done in the reset process and not used elsewhere. Even if it was, we don't use prints to mark functions we passed through. Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit cd92c3678ab3158f11319ea08b81ac58beb519c7 Author: Yuri Nudelman Date: Sun Mar 27 11:41:51 2022 +0300 habanalabs: wrong handle removal in memory manager During the unified memory manager release, a wrong id was used to remove an entry from the idr. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 799b9eb01a643ba5b6ad80aa89cd4a425c17971e Author: Dafna Hirschfeld Date: Wed Mar 16 16:38:17 2022 +0200 habanalabs: remove debugfs read/write callbacks The debugfs memory access now uses the callback 'access_dev_mem' so there is no use of the callbacks 'debugfs_{read32,read64,write32,write6}'. Remove them. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 9248aa90d2fa0a03955f0813d17accde9e1f0751 Author: Dafna Hirschfeld Date: Wed Mar 16 19:45:24 2022 +0200 habanalabs: enforce alignment upon registers access through debugfs When accessing the configuration registers through debugfs, it is only allowed to access aligned address. Fail if address is not aligned. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit ee8a10c833c4a49720055f23eeb215352b969bda Author: Dafna Hirschfeld Date: Wed Mar 23 17:21:56 2022 +0200 habanalabs: unify code for memory access from debugfs Currently each asic version implements 4 callbacks: 'debugfs_{read32/write32/read64/write64}' There is a lot of code duplication among the different callbacks of all asic versions. This patch unify the code in order to avoid the code duplication by iterating the pci_mem_region array in hl_device and use its fields instead of macros. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 234366d3b6dac33dc6f78abf0fbc4abe9bae986b Author: Dafna Hirschfeld Date: Wed Mar 23 17:11:45 2022 +0200 habanalabs: add callback and field to be used for debugfs refactor This is a preparation for unifying the code of accessing device memory through debugfs. Add struct fields and callbacks that will later be used in debugfs code and will reduce code duplication among the different read{32,64}/write{32,64} callbacks of every asic. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 116a28ac1f0802dc306392746c3dde272ee55c47 Author: kernel test robot Date: Fri Mar 25 05:23:11 2022 +0800 habanalabs: hl_ts_behavior can be static drivers/misc/habanalabs/common/memory.c:2137:28: warning: symbol 'hl_ts_behavior' was not declared. Should it be static? Fixes: 4d530e7d121a ("habanalabs: convert ts to use unified memory manager") Reported-by: kernel test robot Signed-off-by: kernel test robot Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit d0b59cf68cecf48cc3e7ab817046a221967fbf8c Author: Ohad Sharabi Date: Tue Mar 22 14:32:40 2022 +0200 habanalabs/gaudi: add debugfs to fetch internal sync status When Gaudi device is secured the monitors data in the configuration space is blocked from PCI access. As we need to enable user to get sync-manager monitors registers when debugging, this patch adds a debugfs that dumps the information to a binary file (blob). When a root user will trigger the dump, the driver will send request to the f/w to fill a data structure containing dump of all monitors registers. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit f5d85fe05a943920aed8e2911fe2a13f53b14bce Author: Ohad Sharabi Date: Tue Mar 22 09:21:29 2022 +0200 habanalabs: rephrase device out-of-memory message The out of memory message is rephrased to more subtle expression as out of memory may be caused by the user in case of, for example, greedy allocation. In addition the user is also being notified by an error code. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit c3712c1d7d3dc313527a7ff7c29726e091bc8f43 Author: Dafna Hirschfeld Date: Sun Mar 13 15:33:52 2022 +0200 habanalabs/gaudi: Use correct sram size macro for debugfs We currently allow accessing the whole SRAM bar size with the macro SRAM_BAR_SIZE, but the actual size of the sram region is the macro SRAM_SIZE which is only a portion of the whole bar size. So when accessing the sram through debugfs, use the macro SRAM_SIZE for the sram size which is the correct macro. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit acbabe63efa78012eb3702486e1cfe7b485f70a0 Author: Ohad Sharabi Date: Mon Mar 21 14:39:19 2022 +0200 habanalabs: add MMU prefetch to ASIC-specific code This is necessary pre-requisite for future ASIC support, where MMU TLB prefetch is supported. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 4d530e7d121a2b4fc703c4c2145ae761140bc18f Author: Yuri Nudelman Date: Sun Mar 20 16:15:01 2022 +0200 habanalabs: convert ts to use unified memory manager With the introduction of the unified memory manager infrastructure, the timestamp buffers can be converted to use it. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit babe8e7c04b5d3b7298b77acdd1de922c97442bc Author: Yuri Nudelman Date: Sun Mar 20 16:08:12 2022 +0200 habanalabs: unified memory manager infrastructure This is a part of overall refactoring attempt to separate nic and the core drivers. Currently, there are 4 different flows, that contain very similar code. These are the ts, nic, hwblocks and cb alloc/map flows. The similar aspect of all these flows is that they all contain a central store, with memory buffers inside, supporting the following set of operations: - Allocate buffer and return handle - Get buffer from the store with handle - Put the buffer (last put releases the buffer) - Map the buffer to the user This patch contains a generic data structure used to implement the above memory buffer store interface. Conversion of the existing code to use the new data structure will follow. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit b75cce27d0bc18b69471469fddf06fc9ac00bb8f Author: Ofir Bitton Date: Mon Mar 7 19:53:36 2022 +0200 habanalabs: save f/w preboot major version We need this property for doing backward compatibility hacks against the f/w. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 9138c24244a71bf90cd36123247b768e83433347 Author: Jakob Koschel Date: Thu Mar 24 08:10:48 2022 +0100 habanalabs: 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/ Signed-off-by: Jakob Koschel Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 687c6b535e4cb7ef501ed0d67d6e6e478ee9040c Author: Tomer Tayar Date: Wed Mar 9 19:44:47 2022 +0200 habanalabs: modify dma_mask to be ASIC specific property The required DMA mask is no longer based on input from the F/W, but it is fixed per ASIC according to its address space. As such, the per-ASIC function to get this value can be replaced with a property variable. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit c41cb902b22f3e8eb5d491d26957941db31e8345 Author: Ofir Bitton Date: Tue Mar 15 08:57:22 2022 +0200 habanalabs: parse full firmware versions When parsing firmware versions strings, driver should not assume a specific length and parse up to the maximum supported version length. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 9d92689ca26e98e3fc24239934e24ea79ed5680a Author: Tomer Tayar Date: Wed Jan 26 19:55:53 2022 +0200 habanalabs/gaudi: avoid resetting max power in hard reset The default max power is deduced from the card type value in the CPU-CP info. This value is then set in the max power variable of the device structure. Getting the CPU-CP info is done as part of the late init phase which is called also during reset. This means that a max power value which is modified via sysfs will be reset during hard reset back to the default value. As the max power is updated in any case during device init in hl_sysfs_init(), this setting in late init can be removed, and the overriding during reset is thus avoided. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit b19768d81a6bd1591872952075ff9d960bd4e8d8 Author: Ofir Bitton Date: Tue Mar 1 10:14:14 2022 +0200 habanalabs/gaudi: increase submission resources In order to allow user to have larger amount of submissions, we increase the DMA and NIC queue depth to 4K. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit fdec56c1a416c6947b1db22617da15cb89f46c6c Author: Ofir Bitton Date: Thu Mar 3 09:43:10 2022 +0200 habanalabs: expose compute ctx status through info ioctl In order for the user to know if he can try and open device, we expose the compute ctx state. The user can now know if the context is used by another process or whether the device is still ongoing through cleanup or reset and will be available soon. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 4c3b9f6e3bd0480474666f9e016ff57ea0c5ecaa Author: Ofir Bitton Date: Mon Feb 28 16:08:20 2022 +0200 habanalabs: add new return code to device fd open In order to be more informative during device open, we are adding a new return code -EAGAIN that indicates device is still going through resource reclaiming and hence it cannot be used yet. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 050a6f349a09d3cefb14f4114bfa047b2c5b2a65 Author: Ohad Sharabi Date: Wed Feb 23 13:37:08 2022 +0200 habanalabs: add user API to get valid DRAM page sizes Future devices will support multiple device memory page sizes. In addition, an API for the user was added for it to be able to control the device memory allocation page size. This patch is a complementary patch to inform the user of the available page size supported by the device. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 06926dbed215ac98d253b151ae5ad3b0cabac2bf Author: Ohad Sharabi Date: Tue Mar 1 14:29:41 2022 +0200 habanalabs: convert all MMU masks/shifts to arrays There is no need to hold each MMU mask/shift as a denoted structure member (e.g. hop0_mask). Instead converting it to array will result in smaller and more readable code. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 2f8f0de878e0f25984befd5a1f8f001e7c5ff9fd Author: Ohad Sharabi Date: Sun Feb 27 14:48:56 2022 +0200 habanalabs: change mmu_get_real_page_size to be ASIC-specific This patch breaks the cumbersome implementation of "get real page size" along with it's multiple inner conditions and implement each case (according to the real complexity) inside an ASIC function. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 1359fcbe0f4aa2cd6ea684727a5a111eebeeed3a Author: Ohad Sharabi Date: Wed Feb 23 11:47:05 2022 +0200 habanalabs: add DRAM default page size to HW info When using the device memory allocation API the user ought to know what is the default allocation page size. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 378b02dc017777e1dea304b472f2e2db836b6706 Author: Ohad Sharabi Date: Wed Feb 23 11:27:36 2022 +0200 habanalabs: set non-0 value in dram default page size Looking forward we will need to report to the user what is the default page size used. This will be done more conveniently by explicitly updating the property rather than to rely on a "0 meaning default" value. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Greg Kroah-Hartman commit 5ab312b3a8fef467e807e8d7672e65cabe2376fd Author: Julia Lawall Date: Sat May 21 13:10:47 2022 +0200 hwmon: (sl28cpld) 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-37-Julia.Lawall@inria.fr Signed-off-by: Guenter Roeck commit d1baf7a3a3177d46a7149858beddb88a9eca7a54 Author: Adam Wujek Date: Thu May 19 23:34:01 2022 +0000 hwmon: (pmbus) Check PEC support before reading other registers Make sure that the support of PEC is determined before the read of other registers. Otherwise the validation of PEC can trigger an error on the read of STATUS_BYTE or STATUS_WORD registers. The problematic scenario is the following. A device with enabled PEC support is up and running and a kernel driver is loaded. Then the driver is unloaded (or device unbound), the HW device is reconfigured externally (e.g. by i2cset) to advertise itself as not supporting PEC. Without the move of the code, at the second load of the driver (or bind) the STATUS_BYTE or STATUS_WORD register is always read with PEC enabled, which is likely to cause a read error resulting with fail of a driver load (or bind). Signed-off-by: Adam Wujek Link: https://lore.kernel.org/r/20220519233334.438621-1-dev_public@wujek.eu Fixes: 75d2b2b06bd84 ("hwmon: (pmbus) disable PEC if not enabled") Fixes: 4e5418f787ec5 ("hwmon: (pmbus_core) Check adapter PEC support") [groeck: Added Fixes: tags, dropped continuation line] Signed-off-by: Guenter Roeck commit 9baabde04de64137e86b39112c6259f3da512bd6 Author: Guenter Roeck Date: Tue May 17 13:08:25 2022 -0700 hwmon: (dimmtemp) Fix bitmap handling Building arm:allmodconfig may fail with the following error. In function 'fortify_memcpy_chk', inlined from 'bitmap_copy' at include/linux/bitmap.h:261:2, inlined from 'bitmap_copy_clear_tail' at include/linux/bitmap.h:270:2, inlined from 'bitmap_from_u64' at include/linux/bitmap.h:622:2, inlined from 'check_populated_dimms' at drivers/hwmon/peci/dimmtemp.c:284:2: include/linux/fortify-string.h:344:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter) The problematic code is bitmap_from_u64(priv->dimm_mask, dimm_mask); dimm_mask is declared as u64, but the bitmap in priv->dimm_mask is only 24 bit wide. On 32-bit systems, this results in writes over the end of the bitmap. Fix the problem by using u32 instead of u64 for dimm_mask. This is currently sufficient, and a compile time check to ensure that the number of dimms does not exceed the bit map size is already in place. Fixes: 73bc1b885dae ("hwmon: peci: Add dimmtemp driver") Cc: Iwona Winiarska Reviewed-by: Iwona Winiarska Signed-off-by: Guenter Roeck commit 45988d907859b8e6c620c7b8742f65f5b1fbb565 Author: Holger Brunck Date: Tue May 17 15:56:14 2022 +0200 hwmon: (lm90) enable extended range according to DTS node Some lm90 compatible devices can operate in an extended temperature mode. This feature is now enabled if the property is set in the corresponding device tree node. Signed-off-by: Holger Brunck Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220517135614.8185-2-holger.brunck@hitachienergy.com Signed-off-by: Guenter Roeck commit 8dd248fa00db2b0145de95a7ef2b50b8fa71e1b0 Author: Holger Brunck Date: Tue May 17 15:56:13 2022 +0200 dt-bindings: hwmon: lm90: add ti,extended-range-enable property Some devices can operate in an extended temperature mode. Therefore add a boolean ti,extended-range-enable to be able to select this feature in the device tree node. Also make sure that this feature can only be enabled for the devices supporting this feature. Signed-off-by: Holger Brunck Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220517135614.8185-1-holger.brunck@hitachienergy.com Signed-off-by: Guenter Roeck commit 67f6abceab228d5f589435db2d99df6cbf43aa02 Author: Holger Brunck Date: Tue May 17 09:56:26 2022 +0200 dt-bindings: hwmon: lm90: add missing ti,tmp461 This sensor is already supported from the driver, but is missing in the list of compatible devices in the yaml file. Signed-off-by: Holger Brunck Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220517075626.16809-1-holger.brunck@hitachienergy.com Signed-off-by: Guenter Roeck commit be1ca367e7b6dcf0fe47fe577c65cabc305bbf87 Author: keliu Date: Tue May 17 06:31:26 2022 +0000 hwmon: (ibmaem) Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu Link: https://lore.kernel.org/r/20220517063126.2142637-2-liuke94@huawei.com [groeck: Updated subject to include driver name] Signed-off-by: Guenter Roeck commit 718fbfa5da5da0b4d030e14ed737c228ca6a7cbf Author: keliu Date: Tue May 17 06:31:25 2022 +0000 hwmon: Directly use ida_alloc()/free() Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu Link: https://lore.kernel.org/r/20220517063126.2142637-1-liuke94@huawei.com Signed-off-by: Guenter Roeck commit 5b4285c57b6f9b41f6c1def6b624da3a9b000dc6 Author: Eugene Shalygin Date: Tue May 17 10:05:08 2022 +0200 hwmon: (asus-ec-sensors) fix Formula VIII definition The ROG CROSSHAIR VIII FORMULA board has the same sensors as the CROSSHAIR VIII HERO [1] thus let's join their definitions which adds missing sensors for Formula. [1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/740 Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220517080508.1910953-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 3a3aad68621967561f20c6ace4bdbc910d01bc7d Author: Greg.Schwendimann@infineon.com Date: Mon May 16 14:03:43 2022 +0000 dt-bindings: trivial-devices: Add xdp152 Add Infineon Digital Multi-phase xdp152 family controllers. Signed-off-by: Greg Schwendimann Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1a600fd51db942389a5078a72c3bf411@infineon.com Signed-off-by: Guenter Roeck commit ca538531c0deaeff352f1aa8caa216794cb14bc9 Author: Guenter Roeck Date: Thu May 12 12:06:00 2022 -0700 hwmon: (sl28cpld-hwmon) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Cc: Michael Walle Signed-off-by: Guenter Roeck commit 7282d2aefcc6cc3ab093968df108f399f93e69e8 Author: Guenter Roeck Date: Thu May 12 12:05:59 2022 -0700 hwmon: (pwm-fan) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Signed-off-by: Guenter Roeck commit 7c399d6a5bdf844fb02842e9db3d19d2df911c6a Author: Guenter Roeck Date: Thu May 12 12:05:59 2022 -0700 hwmon: (peci/dimmtemp) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Cc: Iwona Winiarska Signed-off-by: Guenter Roeck commit 09e02c8e632a1717e6ffaf352cfeb2840bc861d2 Author: Guenter Roeck Date: Thu May 12 12:05:59 2022 -0700 hwmon: (peci/cputemp) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Cc: Iwona Winiarska Reviewed-by: Iwona Winiarska Signed-off-by: Guenter Roeck commit 9070d8618eb2c6b7bfecc20a374f98bda4836026 Author: Guenter Roeck Date: Thu May 12 12:05:58 2022 -0700 hwmon: (mr75203) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Cc: Philipp Zabel Signed-off-by: Guenter Roeck commit c2e813438ef562eee81a42a7fe8f15fd7d9d29b9 Author: Guenter Roeck Date: Thu May 12 12:05:58 2022 -0700 hwmon: (ltc2992) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Signed-off-by: Guenter Roeck commit 6b767ccd3b7ef8a17313ec8d07d5c4c7623d1e67 Author: Guenter Roeck Date: Thu May 12 12:05:57 2022 -0700 hwmon: (as370-hwmon) Use HWMON_CHANNEL_INFO macro The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the coccinelle script. Signed-off-by: Guenter Roeck commit ddaefa209c4ac791c1262e97c9b2d0440c8ef1d5 Author: Guenter Roeck Date: Wed May 11 06:22:51 2022 -0700 hwmon: Make chip parameter for with_info API mandatory Various attempts were made recently to "convert" the old hwmon_device_register() API to devm_hwmon_device_register_with_info() by just changing the function name without actually converting the driver. Prevent this from happening by making the 'chip' parameter of devm_hwmon_device_register_with_info() mandatory. Signed-off-by: Guenter Roeck commit 87743bcf08072b3e1952a0bf5524b2833e667b4c Author: Guenter Roeck Date: Wed May 11 06:36:29 2022 -0700 thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal() The thermal subsystem registers a hwmon device without providing chip information or sysfs attribute groups. While undesirable, it would be difficult to change. On the other side, it abuses the hwmon_device_register_with_info API by not providing that information. Use new API specifically created for the thermal subsystem instead to let us enforce the 'chip' parameter for other callers of hwmon_device_register_with_info(). Acked-by: Rafael J . Wysocki Signed-off-by: Guenter Roeck commit e5d21072054fbadf41cd56062a3a14e447e8c22b Author: Guenter Roeck Date: Wed May 11 06:29:59 2022 -0700 hwmon: Introduce hwmon_device_register_for_thermal The thermal subsystem registers a hwmon driver without providing chip or sysfs group information. This is for legacy reasons and would be difficult to change. At the same time, we want to enforce that chip information is provided when registering a hwmon device using hwmon_device_register_with_info(). To enable this, introduce a special API for use only by the thermal subsystem. Acked-by: Rafael J . Wysocki Signed-off-by: Guenter Roeck commit 59e746ca86ff4f73183f6ff0e6b046705b00e081 Author: Corentin Labbe Date: Mon May 9 06:30:09 2022 +0000 hwmon: (acpi_power_meter) Fix style issues Fix style issues found by checkpatch. Signed-off-by: Corentin Labbe Link: https://lore.kernel.org/r/20220509063010.3878134-2-clabbe@baylibre.com Signed-off-by: Guenter Roeck commit 9ccafe466c3242a17ae7d2ea1b02986bb94fd587 Author: Debabrata Banerjee Date: Thu May 5 09:33:51 2022 +0200 hwmon: (asus-ec-sensors) add ROG STRIX X570-E GAMING WIFI II Adds support for the ROG STRIX X570-E GAMING WIFI II board and simplifies formatting for the list of supported models. Signed-off-by: Debabrata Banerjee Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220505073351.123753-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 6bb77c55b05fccea588fdc069008fa81e7359679 Author: Zev Weiss Date: Wed Apr 27 18:27:07 2022 -0700 hwmon: (nct6775) Add i2c driver This driver provides an i2c I/O mechanism for the core nct6775 driver, as might be used by a BMC. Because the Super I/O chip is shared with the host CPU in such a scenario (and the host should ultimately be in control of it), the i2c driver is strictly read-only to avoid interfering with any usage by the host (aside from the bank-select register, which seems to be replicated for the i2c interface). Signed-off-by: Zev Weiss Tested-by: Renze Nicolai Link: https://lore.kernel.org/r/20220428012707.24921-3-zev@bewilderbeest.net Signed-off-by: Guenter Roeck commit 801549da5d71254198328ffb2c610dd86fe62803 Author: Zev Weiss Date: Wed Apr 27 18:27:06 2022 -0700 dt-bindings: hwmon: Add nuvoton,nct6775 These Super I/O chips have an i2c interface that some systems expose to a BMC; the BMC's device tree can now describe that via this binding. Signed-off-by: Zev Weiss Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220428012707.24921-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck commit 764124082805b41f2f203c37f80657f41f139aaf Author: Denis Pauk Date: Sat May 7 10:29:33 2022 +0300 hwmon: (nct6775) add ASUS PRO H410T / PRIME H410M-R / ROG X570-E GAMING WIFI II Boards such as * PRO H410T * PRIME H410M-R * ROG STRIX X570-E GAMING WIFI II have got a nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. This commit adds such boards to the WMI monitoring list. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk Reported-by: renedis Reported-by: Dmitrii Levchenko Reported-by: Hubert Banas Link: https://lore.kernel.org/r/20220507072933.3013-1-pauk.denis@gmail.com Signed-off-by: Guenter Roeck commit 512a4da1d9f55d9e3be87b2ea6d0a51ef342e764 Author: Karl Mehltretter Date: Sun May 8 16:46:01 2022 +0200 hwmon: (lm83) Remove unused include directives Some include directives are no longer necessary due to previous driver changes. Remove them now to further improve driver code clarity. Mutex usage has ceased since commit 719af4f1a40b ("hwmon: (lm83) Use regmap"). Ever since commit a0ac840d99fa ("hwmon: (lm83) Convert to use devm_hwmon_device_register_with_groups") functions sysfs_create_group and sysfs_remove_group are no longer used by the driver. Signed-off-by: Karl Mehltretter Link: https://lore.kernel.org/r/20220508144601.22796-1-kmehltretter@gmail.com Signed-off-by: Guenter Roeck commit 28bf22ef93eceb42c7583f0909bc9dedc07770e3 Author: Mårten Lindahl Date: Tue May 3 12:46:31 2022 +0200 hwmon: (pmbus) Add get_voltage/set_voltage ops The pmbus core does not have operations for getting or setting voltage. Add functions get/set voltage for the dynamic regulator framework. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20220503104631.3515715-5-marten.lindahl@axis.com [groeck: cosmetic alignment / empty line fixes] Signed-off-by: Guenter Roeck commit 3aa74796cfd038310f68c7e67c804224e5b43809 Author: Eduardo Valentin Date: Thu Apr 28 10:49:26 2022 -0700 hwmon: (pmbus) Register with thermal for PSC_TEMPERATURE Some pmbus device drivers have device tree support and may want to use of-thermal to register a thermal zone OF sensor for those device drivers. This way we allow describing device tree thermal zones for pmbus device drivers with device tree support. This patch achieves this by registering pmbus sensors with thermal subsystem if they are PSC_TEMPERATURE and are providing _input hwmon interface. Cc: Guenter Roeck (maintainer:PMBUS HARDWARE MONITORING DRIVERS) Cc: Jean Delvare (maintainer:HARDWARE MONITORING) Cc: linux-hwmon@vger.kernel.org (open list:PMBUS HARDWARE MONITORING DRIVERS) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin Signed-off-by: Eduardo Valentin Link: https://lore.kernel.org/r/20220428174926.2150-1-eduval@amazon.com Signed-off-by: Guenter Roeck commit d45cd804280d5cf43d539f49f671ea26552cedc3 Author: Chris Packham Date: Wed Mar 23 16:40:56 2022 +1300 hwmon: (adt7475) Use enum chips when loading attenuator settings Make use of enum chips and use a switch statement in load_attenuators() so that the compiler can tell us if we've failed to cater for a supported chip. Signed-off-by: Chris Packham Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220323034056.260455-4-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 7b8664f126e90d1d2129b8653c587bf230dd800c Author: Chris Packham Date: Wed Mar 23 16:40:55 2022 +1300 hwmon: (adt7475) Add support for pin configuration The adt7473, adt7475, adt7476 and adt7490 have pins that can be used for different functions. On the adt7473 and adt7475 this is pins 5 and 9. On the adt7476 and adt7490 this is pins 10 and 14. The first pin can either be PWM2(default) or SMBALERT#. The second pin can be TACH4(default), THERM#, SMBALERT# or GPIO. The adt7475 driver has always been able to detect the configuration if it had been done by an earlier boot stage. Add support for configuring the pins based on the hardware description in the device tree. Signed-off-by: Chris Packham Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220323034056.260455-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit 4fc1b113624784cf1a3b5b1ea813afca2a0b9dcc Author: Chris Packham Date: Wed Mar 23 16:40:54 2022 +1300 dt-bindings: hwmon: Document adt7475 pin-function properties The adt7473, adt7475, adt7476 and adt7490 have pins that can be used for different functions. Add bindings so that it is possible to describe what pin functions are intended by the hardware design. Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220323034056.260455-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck commit c8f55be4a1c7b4f64ecac1369e55f366b7f03bd2 Author: Michael Walle Date: Fri Apr 1 23:40:32 2022 +0200 hwmon: add driver for the Microchip LAN966x SoC Add support for the temperatur sensor and the fan controller on the Microchip LAN966x SoC. Apparently, an Analog Bits PVT sensor is used which can measure temperature and process voltages. But only a forumlae for the temperature sensor is known. Additionally, the SoC support a fan tacho input as well as a PWM signal to control the fan. Signed-off-by: Michael Walle Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220401214032.3738095-5-michael@walle.cc [groeck: Added missing reference in Documentation/hwmon/index.rst] Signed-off-by: Guenter Roeck commit ede7e1c20b7533d89259027595fe4e0096b827c9 Author: Michael Walle Date: Fri Apr 1 23:40:31 2022 +0200 dt-bindings: hwmon: add Microchip LAN966x bindings Add a binding for the temperature sensor and the fan controller on the Microchip LAN966x family. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220401214032.3738095-4-michael@walle.cc Signed-off-by: Guenter Roeck commit e0daf1a60ed47828cc3563c5d036692cc7a702e9 Author: Michael Walle Date: Fri Apr 1 23:40:30 2022 +0200 hwmon: (bt1-pvt) use generic polynomial functions The polynomial calculation function was moved into lib/ to be able to reuse it. Move over to this one. Signed-off-by: Michael Walle Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220401214032.3738095-3-michael@walle.cc Signed-off-by: Guenter Roeck commit cd705ea857fdd859a9df09e8adda4cb4c906e8a2 Author: Michael Walle Date: Fri Apr 1 23:40:29 2022 +0200 lib: add generic polynomial calculation Some temperature and voltage sensors use a polynomial to convert between raw data points and actual temperature or voltage. The polynomial is usually the result of a curve fitting of the diode characteristic. The BT1 PVT hwmon driver already uses such a polynonmial calculation which is rather generic. Move it to lib/ so other drivers can reuse it. Signed-off-by: Michael Walle Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220401214032.3738095-2-michael@walle.cc Signed-off-by: Guenter Roeck commit 9054416afcb443933c16f9e8c4531086e62eb689 Author: Greg.Schwendimann@infineon.com Date: Wed Apr 27 18:40:12 2022 +0000 hwmon: (pmbus) Add support for Infineon Digital Multi-phase xdp152 family controllers Add support for devices XDPE152C4, XDPE12584. Signed-off-by: Greg Schwendimann Link: https://lore.kernel.org/r/5e6d50e9b28140158f339b0de343eea4@infineon.com Signed-off-by: Guenter Roeck commit 30b5e6ef4a32ea4985b99200e06d6660a69f9246 Author: Geert Uytterhoeven Date: Fri May 20 16:32:30 2022 +0200 m68k: atari: Make Atari ROM port I/O write macros return void The macros implementing Atari ROM port I/O writes do not cast away their output, unlike similar implementations for other I/O buses. When they are combined using conditional expressions in the definitions of outb() and friends, this triggers sparse warnings like: drivers/net/appletalk/cops.c:382:17: error: incompatible types in conditional expression (different base types): drivers/net/appletalk/cops.c:382:17: unsigned char drivers/net/appletalk/cops.c:382:17: void Fix this by adding casts to "void". Reported-by: kernel test robot Reported-by: Guenter Roeck Signed-off-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Reviewed-by: Michael Schmitz Link: https://lore.kernel.org/r/c15bedc83d90a14fffcd5b1b6bfb32b8a80282c5.1653057096.git.geert@linux-m68k.org commit 73c348d4ab5c34aa2186071e66eaa5700d35e104 Author: Jiapeng Chong Date: Sun May 22 16:47:17 2022 +1000 xfs: Remove duplicate include Clean up the following includecheck warning: ./fs/xfs/xfs_attr_item.c: xfs_inode.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 93e6aa4329d07fa01e1016446464c666c5b49b5c Author: Kaixu Xia Date: Sun May 22 16:47:11 2022 +1000 xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO Retry unaligned DIO with exclusive blocking semantics only when the IOCB_NOWAIT flag is not set. If we are doing nonblocking user I/O, propagate the error directly. Signed-off-by: Kaixu Xia Reviewed-by: Chaitanya Kulkarni Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit e62c720817597f259b81f1ff004eb042293bf046 Author: Jiapeng Chong Date: Sun May 22 16:46:57 2022 +1000 xfs: Remove dead code Remove tht entire xlog_recover_check_summary() function, this entire function is dead code and has been for 12 years. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 41bc61c02a5a3aa4f8ba5f9e9c54668468925c72 Author: Julia Lawall Date: Sun May 22 16:46:38 2022 +1000 xfs: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit e3c5de22026fda01674c400b97f96857dfb58aab Author: Darrick J. Wong Date: Sun May 22 16:00:26 2022 +1000 xfs: rename struct xfs_attr_item to xfs_attr_intent Everywhere else in XFS, structures that capture the state of an ongoing deferred work item all have names that end with "_intent". The new extended attribute deferred work items are not named as such, so fix it to follow the naming convention used elsewhere. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit a5d28039ecb288f4788ae98c8291e092961e8742 Author: Oliver O'Halloran Date: Wed Sep 2 13:51:59 2020 +1000 powerpc/powernv/pci: Drop VF MPS fixup The MPS field in the VF config space is marked as reserved in current versions of the SR-IOV spec. In other words, this fixup doesn't do anything. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200902035159.1762596-1-oohall@gmail.com commit ad91f66f5fa7c6f9346e721c3159ce818568028b Author: Christophe Leroy Date: Thu May 19 19:24:15 2022 +0200 powerpc/fsl_book3e: Don't set rodata RO too early On fsl_book3e, rodata is set read-only at the same time as init text is set NX at the end of init. That's too early. As both action are performed at the same time, delay both actions to the time rodata is expected to be made read-only. It means we will have a small window with init mem freed but still executable. It shouldn't be an issue though, especially because the said memory gets poisoned and should therefore result to a bad instruction fault in case it gets executed. mmu_mark_initmem_nx() is bailing out before doing anything when CONFIG_STRICT_KERNEL_RWX is not selected or rodata_enabled is false. mmu_mark_rodata_ro() is called only when CONFIG_STRICT_KERNEL_RWX is selected and rodata_enabled is true so this is equivalent. Move code from mmu_mark_initmem_nx() into mmu_mark_rodata_ro() and remove the call to strict_kernel_rwx_enabled() which is not needed anymore. Fixes: d5970045cf9e ("powerpc/fsl_booke: Update of TLBCAMs after init") Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2e35f0fd649c83c5add17a99514ac040767be93a.1652981047.git.christophe.leroy@csgroup.eu commit 0ef1ffc7189521e293b4c5532659385dfddf8939 Author: Joel Stanley Date: Thu May 19 22:27:06 2022 +0930 powerpc/microwatt: Add mmu bits to device tree In commit 5402e239d09f ("powerpc/64s: Get LPID bit width from device tree") the kernel tried to determine the pid and lpid bits from the device tree. If they are not found, there is a fallback, but Microwatt wasn't covered as it has the unusual configuration of being both !HV and bare metal. Set the values in the device tree to avoid having to add a special case. The lpid value is the only one required, but add both for completeness. Fixes: 5402e239d09f ("powerpc/64s: Get LPID bit width from device tree") Signed-off-by: Joel Stanley Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220519125706.593532-1-joel@jms.id.au commit 25e69962efdbbbd8bf52e6b4d7852c49717923a2 Author: Vasant Hegde Date: Tue Sep 14 15:46:30 2021 +0530 powerpc/powernv/flash: Check OPAL flash calls exist before using Currently only FSP based powernv systems supports firmware update interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists before initalising the flash driver. Signed-off-by: Vasant Hegde Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210914101630.30613-1-hegdevasant@linux.vnet.ibm.com commit bb12dd42d20f5513a8d1da225232af0a0743fd79 Author: Krzysztof Kozlowski Date: Fri Sep 24 12:56:53 2021 +0200 powerpc/powermac: constify device_node in of_irq_parse_oldworld() The of_irq_parse_oldworld() does not modify passed device_node so make it a pointer to const for safety. Drop the extern while modifying the line. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210924105653.46963-2-krzysztof.kozlowski@canonical.com commit cc025916b12a452df7932da528d25b2ef2b05072 Author: Krzysztof Kozlowski Date: Fri Sep 24 12:56:52 2021 +0200 powerpc/powermac: add missing g5_phy_disable_cpu1() declaration g5_phy_disable_cpu1() is used outside of platforms/powermac/feature.c, so it should have a declaration to fix W=1 warning: arch/powerpc/platforms/powermac/feature.c:1533:6: error: no previous prototype for ‘g5_phy_disable_cpu1’ [-Werror=missing-prototypes] Signed-off-by: Krzysztof Kozlowski Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210924105653.46963-1-krzysztof.kozlowski@canonical.com commit 7801cb1dc60f7348687ca1c3aa03a944687563f0 Author: Colin Ian King Date: Sat Mar 19 23:20:25 2022 +0000 selftests/powerpc/pmu: fix spelling mistake "mis-match" -> "mismatch" There are a few spelling mistakes in error messages. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220319232025.22067-1-colin.i.king@gmail.com commit 26b78c81e84c5133b299fb11bf17ec1a3d2ad217 Author: Reza Arbab Date: Tue May 3 12:01:52 2022 -0500 powerpc: Enable the DAWR on POWER9 DD2.3 and above The hardware bug in POWER9 preventing use of the DAWR was fixed in DD2.3. Set the CPU_FTR_DAWR feature bit on these newer systems to start using it again, and update the documentation accordingly. The CPU features for DD2.3 are currently determined by "DD2.2 or later" logic. In adding DD2.3 as a discrete case for the first time here, I'm carrying the quirks of DD2.2 forward to keep all behavior outside of this DAWR change the same. This leaves the assessment and potential removal of those quirks on DD2.3 for later. Signed-off-by: Reza Arbab Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220503170152.23412-1-arbab@linux.ibm.com commit b4d9cc75721bdbceba0d71aa5accf6aa09ee26c1 Author: Michael Ellerman Date: Thu May 19 15:03:57 2022 +1000 powerpc/64s: Add CPU_FTRS_POWER10 to ALWAYS mask CPU_FTRS_POWER10 is missing from the CPU_FTRS_ALWAYS mask. Currently that doesn't cause any bug, because it is a superset of the POWER9 mask, which the exception of CPU_FTR_TM, but POWER7 doesn't have CPU_FTR_TM, so CPU_FTR_TM is not in the ALWAYS mask to begin with. However for consistency, and to be robust against future changes, it should be included in the ALWAYS mask. Fixes: a3ea40d5c736 ("powerpc: Add POWER10 architected mode") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220519122205.746276-2-mpe@ellerman.id.au commit 3e36960a27fec30f16bace1521dc852105522f5e Author: Michael Ellerman Date: Thu May 19 14:30:56 2022 +1000 powerpc/64s: Add CPU_FTRS_POWER9_DD2_2 to CPU_FTRS_ALWAYS mask CPU_FTRS_POWER9_DD2_2 is missing from CPU_FTRS_ALWAYS. That doesn't cause any bug, because CPU_FTRS_POWER9_DD2_2 adds new bits that don't appear in other values, so when anded with the other masks the result is the same. But for consistency we should have all values in the CPU_FTRS_ALWAYS mask, so that the logic is robust against the values being changed in future. Fixes: b5af4f279323 ("powerpc: Add CPU feature bits for TM bug workarounds on POWER9 v2.2") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220519122205.746276-1-mpe@ellerman.id.au commit 3768f6985700106e90eca87d814dc08e609a9969 Author: Darrick J. Wong Date: Sun May 22 15:59:48 2022 +1000 xfs: clean up state variable usage in xfs_attr_node_remove_attr The state variable is now a local variable pointing to a heap allocation, so we don't need to zero-initialize it, nor do we need the conditional to decide if we should free it. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 4136e38af728eddcab2e51aecde28e94d0782b9b Author: Darrick J. Wong Date: Sun May 22 15:59:48 2022 +1000 xfs: put attr[id] log item cache init with the others Initialize and destroy the xattr log item caches in the same places that we do all the other log item caches. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 500a512c60d132dbffc0233ba22ad067756c0ccd Author: Darrick J. Wong Date: Sun May 22 15:59:48 2022 +1000 xfs: remove struct xfs_attr_item.xattri_flags Nobody uses this field, so get rid of it and the unused flag definition. Rearrange the structure layout to reduce its size from 104 to 96 bytes. This gets us from 39 to 42 objects per page. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit e2c78949b641d34cb4051b32c2fa5e03a4bfef35 Author: Darrick J. Wong Date: Sun May 22 15:59:48 2022 +1000 xfs: use a separate slab cache for deferred xattr work state Create a separate slab cache for struct xfs_attr_item objects, since we can pack the (104-byte) intent items more tightly than we can with the general slab cache objects. On x86, this means 39 intents per memory page instead of 32. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit b53d212b4b5c29ab16edb7eca2b0e05927b7aa34 Author: Darrick J. Wong Date: Sun May 22 15:59:48 2022 +1000 xfs: put the xattr intent item op flags in their own namespace The flags that are stored in the extended attr intent log item really should have a separate namespace from the rest of the XFS_ATTR_* flags. Give them one to make it a little more obvious that they're intent item flags. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 87c78b612f4feccdcf4019351206ebe0e3dfe828 Author: Michael Ellerman Date: Thu May 19 00:26:29 2022 +1000 powerpc: Fix all occurences of "the the" Rather than waiting for the bots to fix these one-by-one, fix all occurences of "the the" throughout arch/powerpc. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220518142629.513007-1-mpe@ellerman.id.au commit 4d0cdd2bb8f0bf1a30d361f14bafc428794551e0 Author: Darrick J. Wong Date: Sun May 22 15:59:34 2022 +1000 xfs: clean up xfs_attr_node_hasname The calling conventions of this function are a mess -- callers /can/ provide a pointer to a pointer to a state structure, but it's not required, and as evidenced by the last two patches, the callers that do weren't be careful enough about how to deal with an existing da state. Push the allocation and freeing responsibilty to the callers, which means that callers from the xattr node state machine steps now have the visibility to allocate or free the da state structure as they please. As a bonus, the node remove/add paths for larp-mode replaces can reset the da state structure instead of freeing and immediately reallocating it. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 079e5fd3a1e41c186c1bc4166d409d22e70729bf Author: Madhavan Srinivasan Date: Tue Mar 22 10:26:38 2022 +0530 selftests/powerpc/pmu/ebb: remove fixed_instruction.S Commit 3752e453f6ba ("selftests/powerpc: Add tests of PMU EBBs") added selftest testcases to verify EBB interface. instruction_count_test.c testcase needs a fixed loop function to count overhead. Instead of using the thirty_two_instruction_loop() in fixed_instruction_loop.S in ebb folder, file is linked with thirty_two_instruction_loop() in loop.S from top folder. Since fixed_instruction_loop.S not used, patch removes the file. Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220322045638.10443-1-maddy@linux.ibm.com commit 8a57c3cc2bcb8df98c239d6804fd01834960b7d2 Author: Minghao Chi (CGEL ZTE) Date: Fri Feb 25 01:07:37 2022 +0000 powerpc/platforms/83xx: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220225010737.2038781-1-chi.minghao@zte.com.cn commit 3def164a5cedad9117859dd4610cae2cc59cb6d2 Author: Haowen Bai Date: Wed May 11 09:27:56 2022 +0800 powerpc/eeh: Drop redundant spinlock initialization slot_errbuf_lock has declared and initialized by DEFINE_SPINLOCK, so we don't need to spin_lock_init again, drop it. Signed-off-by: Haowen Bai Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1652232476-9696-1-git-send-email-baihaowen@meizu.com commit 57b742a5b8945118022973e6416b71351df512fb Author: Peng Wu Date: Mon Apr 25 08:12:45 2022 +0000 powerpc/iommu: Add missing of_node_put in iommu_init_early_dart The device_node pointer is returned by of_find_compatible_node with refcount incremented. We should use of_node_put() to avoid the refcount leak. Signed-off-by: Peng Wu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220425081245.21705-1-wupeng58@huawei.com commit 426e5805226358dbe9af233347c5bf3c81f2125c Author: Zheng Bin Date: Wed May 11 11:35:07 2022 +0800 powerpc/pseries/vas: Call misc_deregister if sysfs init fails Undo effects of misc_register if sysfs init fails after misc_register. Signed-off-by: Zheng Bin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220511033507.2745992-1-zhengbin13@huawei.com commit 0e0946e22f3665d27325d389ff45ade6e93f3678 Author: Vaibhav Jain Date: Wed May 11 13:56:36 2022 +0530 powerpc/papr_scm: Fix leaking nvdimm_events_map elements Right now 'char *' elements allocated for individual 'stat_id' in 'papr_scm_priv.nvdimm_events_map[]' during papr_scm_pmu_check_events(), get leaked in papr_scm_remove() and papr_scm_pmu_register(), papr_scm_pmu_check_events() error paths. Also individual 'stat_id' arent NULL terminated 'char *' instead they are fixed 8-byte sized identifiers. However papr_scm_pmu_register() assumes it to be a NULL terminated 'char *' and at other places it assumes it to be a 'papr_scm_perf_stat.stat_id' sized string which is 8-byes in size. Fix this by allocating the memory for papr_scm_priv.nvdimm_events_map to also include space for 'stat_id' entries. This is possible since number of available events/stat_ids are known upfront. This saves some memory and one extra level of indirection from 'nvdimm_events_map' to 'stat_id'. Also rest of the code can continue to call 'kfree(papr_scm_priv.nvdimm_events_map)' without needing to iterate over the array and free up individual elements. Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") Signed-off-by: Vaibhav Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220511082637.646714-1-vaibhav@linux.ibm.com commit fcee96924ba1596ca80a6770b2567ca546f9a482 Author: Miaoqian Lin Date: Thu May 12 16:37:18 2022 +0400 powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: abc3aeae3aaa ("fsl-rio: Add two ports and rapidio message units support") Signed-off-by: Miaoqian Lin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220512123724.62931-1-linmq006@gmail.com commit 1d1fb9618bdd5a5fbf9a9eb75133da301d33721c Author: Miaoqian Lin Date: Thu May 12 13:05:33 2022 +0400 powerpc/xive: Fix refcount leak in xive_spapr_init of_find_compatible_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller") Signed-off-by: Miaoqian Lin Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220512090535.33397-1-linmq006@gmail.com commit 48b63961c84671df4c4a4451c40057e34b26df1a Author: Oscar Salvador Date: Mon Apr 11 09:49:34 2022 +0200 powerpc/numa: Associate numa node to its cpu earlier powerpc is the only platform that do not rely on cpu_up()->try_online_node() to bring up a numa node, and special cases it, instead, deep in its own machinery: dlpar_online_cpu find_and_online_cpu_nid try_online_node This should not be needed, but the thing is that the try_online_node() from cpu_up() will not apply on the right node, because cpu_to_node() will return the old mapping numa<->cpu that gets set on boot stage for all possible cpus. That can be seen easily if we try to print out the numa node passed to try_online_node() in cpu_up(). The thing is that the numa<->cpu mapping does not get updated till a much later stage in start_secondary: start_secondary: set_numa_node(numa_cpu_lookup_table[cpu]) But we do not really care, as we already now the CPU <-> NUMA associativity back in find_and_online_cpu_nid(), so let us make use of that and set the proper numa<->cpu mapping, so cpu_to_node() in cpu_up() returns the right node and try_online_node() can do its work. Signed-off-by: Oscar Salvador Tested-by: Geetika Moolchandani Reviewed-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220411074934.4632-1-osalvador@suse.de commit 9a9c5ff5fff87eb1a43db0d899473554e408fd7b Author: Randy Dunlap Date: Sun Apr 10 09:10:35 2022 -0700 macintosh: via-pmu and via-cuda need RTC_LIB Fix build when RTC_LIB is not set/enabled. Eliminates these build errors: m68k-linux-ld: drivers/macintosh/via-pmu.o: in function `pmu_set_rtc_time': drivers/macintosh/via-pmu.c:1769: undefined reference to `rtc_tm_to_time64' m68k-linux-ld: drivers/macintosh/via-cuda.o: in function `cuda_set_rtc_time': drivers/macintosh/via-cuda.c:797: undefined reference to `rtc_tm_to_time64' Fixes: 0792a2c8e0bb ("macintosh: Use common code to access RTC") Reported-by: kernel test robot Suggested-by: Christophe Leroy Signed-off-by: Randy Dunlap Acked-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220410161035.592-1-rdunlap@infradead.org commit 86ce436e30d86327c9f5260f718104ae7b21f506 Author: Finn Thain Date: Thu Apr 7 20:11:32 2022 +1000 macintosh/via-pmu: Fix build failure when CONFIG_INPUT is disabled drivers/macintosh/via-pmu-event.o: In function `via_pmu_event': via-pmu-event.c:(.text+0x44): undefined reference to `input_event' via-pmu-event.c:(.text+0x68): undefined reference to `input_event' via-pmu-event.c:(.text+0x94): undefined reference to `input_event' via-pmu-event.c:(.text+0xb8): undefined reference to `input_event' drivers/macintosh/via-pmu-event.o: In function `via_pmu_event_init': via-pmu-event.c:(.init.text+0x20): undefined reference to `input_allocate_device' via-pmu-event.c:(.init.text+0xc4): undefined reference to `input_register_device' via-pmu-event.c:(.init.text+0xd4): undefined reference to `input_free_device' make[1]: *** [Makefile:1155: vmlinux] Error 1 make: *** [Makefile:350: __build_one_by_one] Error 2 Don't call into the input subsystem unless CONFIG_INPUT is built-in. Reported-by: kernel test robot Signed-off-by: Finn Thain Tested-by: Randy Dunlap Reviewed-by: Christophe Leroy Acked-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5edbe76ce68227f71e09af4614cc4c1bd61c7ec8.1649326292.git.fthain@linux-m68k.org commit 3ffa9fd471f57f365bc54fc87824c530422f64a5 Author: Lv Ruyi Date: Thu Apr 7 09:00:43 2022 +0000 powerpc/powernv: fix missing of_node_put in uv_init() of_find_compatible_node() returns node pointer with refcount incremented, use of_node_put() on it when done. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220407090043.2491854-1-lv.ruyi@zte.com.cn commit dc21ed2aef4150fc2fcf58227a4ff24502015c03 Author: Christophe Leroy Date: Thu Mar 31 12:03:06 2022 +0200 powerpc/85xx: Remove FSL_85XX_CACHE_SRAM CONFIG_FSL_85XX_CACHE_SRAM is an option that is not user selectable and which is not selected by any driver nor any defconfig. Remove it and all associated code. Signed-off-by: Christophe Leroy Acked-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9949813a6b758903b7bee910f798ba2ca82ff8ee.1648720908.git.christophe.leroy@csgroup.eu commit 5dd9e27ea4a39f7edd4bf81e9e70208e7ac0b7c9 Author: Lv Ruyi Date: Sat Apr 2 01:34:19 2022 +0000 powerpc/xics: fix refcount leak in icp_opal_init() The of_find_compatible_node() function returns a node pointer with refcount incremented, use of_node_put() on it when done. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220402013419.2410298-1-lv.ruyi@zte.com.cn commit ab0cc6bbf0c812731c703ec757fcc3fc3a457a34 Author: Kajol Jain Date: Fri May 6 11:40:15 2022 +0530 powerpc/perf: Fix the threshold compare group constraint for power9 Thresh compare bits for a event is used to program thresh compare field in Monitor Mode Control Register A (MMCRA: 9-18 bits for power9). When scheduling events as a group, all events in that group should match value in threshold bits (like thresh compare, thresh control, thresh select). Otherwise event open for the sibling events should fail. But in the current code, incase thresh compare bits are not valid, we are not failing in group_constraint function which can result in invalid group schduling. Fix the issue by returning -1 incase event is threshold and threshold compare value is not valid. Thresh control bits in the event code is used to program thresh_ctl field in Monitor Mode Control Register A (MMCRA: 48-55). In below example, the scheduling of group events PM_MRK_INST_CMPL (873534401e0) and PM_THRESH_MET (8734340101ec) is expected to fail as both event request different thresh control bits and invalid thresh compare value. Result before the patch changes: [command]# perf stat -e "{r8735340401e0,r8734340101ec}" sleep 1 Performance counter stats for 'sleep 1': 11,048 r8735340401e0 1,967 r8734340101ec 1.001354036 seconds time elapsed 0.001421000 seconds user 0.000000000 seconds sys Result after the patch changes: [command]# perf stat -e "{r8735340401e0,r8734340101ec}" sleep 1 Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (r8735340401e0). /bin/dmesg | grep -i perf may provide additional information. Fixes: 78a16d9fc1206 ("powerpc/perf: Avoid FAB_*_MATCH checks for power9") Signed-off-by: Kajol Jain Reviewed-by: Athira Rajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220506061015.43916-2-kjain@linux.ibm.com commit 505d31650ba96d6032313480fdb566d289a4698c Author: Kajol Jain Date: Fri May 6 11:40:14 2022 +0530 powerpc/perf: Fix the threshold compare group constraint for power10 Thresh compare bits for a event is used to program thresh compare field in Monitor Mode Control Register A (MMCRA: 8-18 bits for power10). When scheduling events as a group, all events in that group should match value in threshold bits. Otherwise event open for the sibling events should fail. But in the current code, incase thresh compare bits are not valid, we are not failing in group_constraint function which can result in invalid group schduling. Fix the issue by returning -1 incase event is threshold and threshold compare value is not valid in group_constraint function. Patch also fixes the p10_thresh_cmp_val function to return -1, incase threshold bits are not valid and changes corresponding check in is_thresh_cmp_valid function to return false only when the thresh_cmp value is less then 0. Thresh control bits in the event code is used to program thresh_ctl field in Monitor Mode Control Register A (MMCRA: 48-55). In below example, the scheduling of group events PM_MRK_INST_CMPL (3534401e0) and PM_THRESH_MET (34340101ec) is expected to fail as both event request different thresh control bits. Result before the patch changes: [command]# perf stat -e "{r35340401e0,r34340101ec}" sleep 1 Performance counter stats for 'sleep 1': 8,482 r35340401e0 0 r34340101ec 1.001474838 seconds time elapsed 0.001145000 seconds user 0.000000000 seconds sys Result after the patch changes: [command]# perf stat -e "{r35340401e0,r34340101ec}" sleep 1 Performance counter stats for 'sleep 1': r35340401e0 r34340101ec 1.001499607 seconds time elapsed 0.000204000 seconds user 0.000760000 seconds sys Fixes: 82d2c16b350f7 ("powerpc/perf: Adds support for programming of Thresholding in P10") Signed-off-by: Kajol Jain Reviewed-by: Athira Rajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220506061015.43916-1-kjain@linux.ibm.com commit cdf87d2bd12cf3ea760a1fa35907a31e5177f425 Author: YueHaibing Date: Tue May 17 17:49:00 2022 +0800 powerpc/kaslr_booke: Fix build error arch/powerpc/mm/nohash/kaslr_booke.c: In function ‘kaslr_get_cmdline’: arch/powerpc/mm/nohash/kaslr_booke.c:46:2: error: implicit declaration of function ‘early_init_dt_scan_chosen’ early_init_dt_scan_chosen(boot_command_line); ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/mm/nohash/kaslr_booke.c: In function ‘get_initrd_range’: arch/powerpc/mm/nohash/kaslr_booke.c:210:10: error: implicit declaration of function ‘of_read_number’ start = of_read_number(prop, len / 4); ^~~~~~~~~~~~~~ Add missing include files to fix this. Fixes: 86c38fec69a4 ("powerpc: Remove asm/prom.h from all files that don't need it") Signed-off-by: YueHaibing Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220517094900.14900-1-yuehaibing@huawei.com commit 7574dd080ee0a1e8a9c6312dc7c8fe97f73415ff Author: YueHaibing Date: Tue May 17 17:48:30 2022 +0800 powerpc/book3e: Fix build error arch/powerpc/mm/nohash/fsl_book3e.c: In function ‘relocate_init’: arch/powerpc/mm/nohash/fsl_book3e.c:348:2: error: implicit declaration of function ‘early_get_first_memblock_info’ early_get_first_memblock_info(__va(dt_ptr), &size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add missing include file linux/of_fdt.h to fix this. Fixes: 86c38fec69a4 ("powerpc: Remove asm/prom.h from all files that don't need it") Signed-off-by: YueHaibing Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220517094830.27560-1-yuehaibing@huawei.com commit 41b7a347bf1491e7300563bb224432608b41f62a Author: Daniel Axtens Date: Wed May 18 20:05:31 2022 +1000 powerpc: Book3S 64-bit outline-only KASAN support Implement a limited form of KASAN for Book3S 64-bit machines running under the Radix MMU, supporting only outline mode. - Enable the compiler instrumentation to check addresses and maintain the shadow region. (This is the guts of KASAN which we can easily reuse.) - Require kasan-vmalloc support to handle modules and anything else in vmalloc space. - KASAN needs to be able to validate all pointer accesses, but we can't instrument all kernel addresses - only linear map and vmalloc. On boot, set up a single page of read-only shadow that marks all iomap and vmemmap accesses as valid. - Document KASAN in powerpc docs. Background ---------- KASAN support on Book3S is a bit tricky to get right: - It would be good to support inline instrumentation so as to be able to catch stack issues that cannot be caught with outline mode. - Inline instrumentation requires a fixed offset. - Book3S runs code with translations off ("real mode") during boot, including a lot of generic device-tree parsing code which is used to determine MMU features. [ppc64 mm note: The kernel installs a linear mapping at effective address c000...-c008.... This is a one-to-one mapping with physical memory from 0000... onward. Because of how memory accesses work on powerpc 64-bit Book3S, a kernel pointer in the linear map accesses the same memory both with translations on (accessing as an 'effective address'), and with translations off (accessing as a 'real address'). This works in both guests and the hypervisor. For more details, see s5.7 of Book III of version 3 of the ISA, in particular the Storage Control Overview, s5.7.3, and s5.7.5 - noting that this KASAN implementation currently only supports Radix.] - Some code - most notably a lot of KVM code - also runs with translations off after boot. - Therefore any offset has to point to memory that is valid with translations on or off. One approach is just to give up on inline instrumentation. This way boot-time checks can be delayed until after the MMU is set is up, and we can just not instrument any code that runs with translations off after booting. Take this approach for now and require outline instrumentation. Previous attempts allowed inline instrumentation. However, they came with some unfortunate restrictions: only physically contiguous memory could be used and it had to be specified at compile time. Maybe we can do better in the future. [paulus@ozlabs.org - Rebased onto 5.17. Note that a kernel with CONFIG_KASAN=y will crash during boot on a machine using HPT translation because not all the entry points to the generic KASAN code are protected with a call to kasan_arch_is_ready().] Originally-by: Balbir Singh # ppc64 out-of-line radix version Signed-off-by: Daniel Axtens Signed-off-by: Paul Mackerras [mpe: Update copyright year and comment formatting] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoTE69OQwiG7z+Gu@cleo commit 2ab2d5794f14c08676690bf0859f16cc768bb3a4 Author: Daniel Axtens Date: Wed May 18 20:07:05 2022 +1000 powerpc/kasan: Disable address sanitization in kexec paths The kexec code paths involve code that necessarily run in real mode, as CPUs are disabled and control is transferred to the new kernel. Disable address sanitization for the kexec code and the functions called in real mode on CPUs being disabled. [paulus@ozlabs.org: combined a few work-in-progress commits of Daniel's and wrote the commit message.] Signed-off-by: Daniel Axtens Signed-off-by: Paul Mackerras [mpe: Move pseries_machine_kexec() into kexec.c so setup.c can be instrumented] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoTFSQ2TUSEaDdVC@cleo commit 5352090a999570c6e8a701bcb755fd91e8c5a2cd Author: Daniel Axtens Date: Wed May 18 20:06:17 2022 +1000 powerpc/kasan: Don't instrument non-maskable or raw interrupts Disable address sanitization for raw and non-maskable interrupt handlers, because they can run in real mode, where we cannot access the shadow memory. (Note that kasan_arch_is_ready() doesn't test for real mode, since it is a static branch for speed, and in any case not all the entry points to the generic KASAN code are protected by kasan_arch_is_ready guards.) The changes to interrupt_nmi_enter/exit_prepare() look larger than they actually are. The changes are equivalent to adding !IS_ENABLED(CONFIG_KASAN) to the conditions for calling nmi_enter() or nmi_exit() in real mode. That is, the code is equivalent to using the following condition for calling nmi_enter/exit: if (((!IS_ENABLED(CONFIG_PPC_BOOK3S_64) || !firmware_has_feature(FW_FEATURE_LPAR) || radix_enabled()) && !IS_ENABLED(CONFIG_KASAN) || (mfmsr() & MSR_DR)) That unwieldy condition has been split into several statements with comments, for easier reading. The nmi_ipi_lock functions that call atomic functions (i.e., nmi_ipi_lock_start(), nmi_ipi_lock() and nmi_ipi_unlock()), besides being marked noinstr, now call arch_atomic_* functions instead of atomic_* functions because with KASAN enabled, the atomic_* functions are wrappers which explicitly do address sanitization on their arguments. Since we are trying to avoid address sanitization, we have to use the lower-level arch_atomic_* versions. In hv_nmi_check_nonrecoverable(), the regs_set_unrecoverable() call has been open-coded so as to avoid having to either trust the inlining or mark regs_set_unrecoverable() as noinstr. [paulus@ozlabs.org: combined a few work-in-progress commits of Daniel's and wrote the commit message.] Signed-off-by: Daniel Axtens Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoTFGaKM8Pd46PIK@cleo commit f08aed52412c860f68e30da148da58ad8e40a43b Author: Daniel Axtens Date: Wed May 18 20:04:58 2022 +1000 powerpc/mm/kasan: rename kasan_init_32.c to init_32.c kasan is already implied by the directory name, we don't need to repeat it. Suggested-by: Christophe Leroy Signed-off-by: Daniel Axtens Signed-off-by: Paul Mackerras Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoTEyoi+xu9brJYe@cleo commit 60e832def18de7a0753393034c6ae459b3bee70a Author: Daniel Axtens Date: Wed May 18 20:04:12 2022 +1000 kasan: Document support on 32-bit powerpc KASAN is supported on 32-bit powerpc and the docs should reflect this. Suggested-by: Christophe Leroy Signed-off-by: Daniel Axtens Signed-off-by: Paul Mackerras Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/YoTEnMLrnd64j0w5@cleo commit 84ade0a6655bee803d176525ef457175cbf4df22 Author: Naveen N. Rao Date: Mon May 16 12:44:22 2022 +0530 powerpc/ftrace: Remove ftrace init tramp once kernel init is complete Stop using the ftrace trampoline for init section once kernel init is complete. Fixes: 67361cf8071286 ("powerpc/ftrace: Handle large kernel configs") Cc: stable@vger.kernel.org # v4.20+ Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220516071422.463738-1-naveen.n.rao@linux.vnet.ibm.com commit 5fe855169f9782c669f640b66242662209ffb72a Author: Christophe Leroy Date: Mon May 16 17:36:04 2022 +0200 powerpc/irq: Remove arch_local_irq_restore() for !CONFIG_CC_HAS_ASM_GOTO All supported versions of GCC & clang support asm goto. Remove the !CONFIG_CC_HAS_ASM_GOTO version of arch_local_irq_restore() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/58df50c9e77e2ed945bacdead30412770578886b.1652715336.git.christophe.leroy@csgroup.eu commit 48482f4dd3432e5e62873bf0f2e254cfb8ce2ac2 Author: Russell Currey Date: Tue Jun 8 16:48:09 2021 +1000 selftests/powerpc: Better reporting in spectre_v2 In commit f3054ffd71b5 ("selftests/powerpc: Return skip code for spectre_v2"), the spectre_v2 selftest is updated to be aware of cases where the vulnerability status reported in sysfs is incorrect, skipping the test instead. This happens because qemu can misrepresent the mitigation status of the host to the guest. If the count cache is disabled in the host, and this is correctly reported to the guest, then the guest won't apply mitigations. If the guest is then migrated to a new host where mitigations are necessary, it is now vulnerable because it has not applied mitigations. Update the selftest to report when we see excessive misses, indicative of the count cache being disabled. If software flushing is enabled, also warn that these flushes are just wasting performance. Signed-off-by: Russell Currey [mpe: Rebase and update change log appropriately] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210608064809.199116-1-ruscur@russell.cc commit d2a3c131981d4498571908df95c3c9393a00adf5 Author: Russell Currey Date: Mon Apr 4 20:15:36 2022 +1000 powerpc/powernv: Get STF barrier requirements from device-tree The device-tree property no-need-store-drain-on-priv-state-switch is equivalent to H_CPU_BEHAV_NO_STF_BARRIER from the H_CPU_GET_CHARACTERISTICS hcall on pseries. Since commit 84ed26fd00c5 ("powerpc/security: Add a security feature for STF barrier") powernv systems with this device-tree property have been enabling the STF barrier when they have no need for it. This patch fixes this by clearing the STF barrier feature on those systems. Fixes: 84ed26fd00c5 ("powerpc/security: Add a security feature for STF barrier") Reported-by: Joel Stanley Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220404101536.104794-2-ruscur@russell.cc commit 2efee6adb56159288bce9d1ab51fc9056d7007d4 Author: Russell Currey Date: Mon Apr 4 20:15:35 2022 +1000 powerpc/powernv: Get L1D flush requirements from device-tree The device-tree properties no-need-l1d-flush-msr-pr-1-to-0 and no-need-l1d-flush-kernel-on-user-access are the equivalents of H_CPU_BEHAV_NO_L1D_FLUSH_ENTRY and H_CPU_BEHAV_NO_L1D_FLUSH_UACCESS from the H_GET_CPU_CHARACTERISTICS hcall on pseries respectively. In commit d02fa40d759f ("powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes") the condition for disabling the L1D flush on kernel entry and user access was changed from any non-P9 CPU to only checking P7 and P8. Without the appropriate device-tree checks for newer processors on powernv, these flushes are unnecessarily enabled on those systems. This patch corrects this. Fixes: d02fa40d759f ("powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes") Reported-by: Joel Stanley Signed-off-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220404101536.104794-1-ruscur@russell.cc commit 294299b3d39e8b4ae10c12ef1ed71405ef7b1e43 Author: Pali Rohár Date: Fri May 6 22:36:21 2022 +0200 powerpc/85xx/p2020: Add fsl,mpc8548-pmc node P2020 also contains Power Management Controller and their registers at offset 0xe0070 compatible with mpc8548. So add PMC node into DTS include file fsl/p2020si-post.dtsi Signed-off-by: Pali Rohár Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220506203621.26314-1-pali@kernel.org commit c4bce84d0bd3f396f702d69be2e92bbd8af97583 Author: Michael Ellerman Date: Thu Apr 7 00:58:01 2022 +1000 powerpc/64: Only WARN if __pa()/__va() called with bad addresses We added checks to __pa() / __va() to ensure they're only called with appropriate addresses. But using BUG_ON() is too strong, it means virt_addr_valid() will BUG when DEBUG_VIRTUAL is enabled. Instead switch them to warnings, arm64 does the same. Fixes: 4dd7554a6456 ("powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406145802.538416-5-mpe@ellerman.id.au commit aa06530a535ffe8ba8b68054003b6fb262a8ec6f Author: Michael Ellerman Date: Thu May 5 22:51:23 2022 +1000 arch/Kconfig: Drop references to powerpc PAGE_SIZE symbols In the previous commit powerpc added PAGE_SIZE related config symbols using the generic names. So there's no need to refer to them in the definition of PAGE_SIZE_LESS_THAN_64KB etc, the negative dependency on the generic symbol is sufficient (in this case !PAGE_SIZE_64KB). Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220505125123.2088143-2-mpe@ellerman.id.au commit d036dc79cccd748e2a101c80c31efada7be8bb7c Author: Michael Ellerman Date: Thu May 5 22:51:22 2022 +1000 powerpc: Add generic PAGE_SIZE config symbols Other arches (sh, mips, hexagon) use standard names for PAGE_SIZE related config symbols. Add matching symbols for powerpc, which are enabled by default but depend on our architecture specific PAGE_SIZE symbols. This allows generic/driver code to express dependencies on the PAGE_SIZE without needing to refer to architecture specific config symbols. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220505125123.2088143-1-mpe@ellerman.id.au commit 657ac633302b9d694958a82654363cb559277759 Author: Haren Myneni Date: Sat Apr 9 01:46:15 2022 -0700 powerpc/pseries/vas: sysfs comments with the correct entries VAS entry is created as a misc device and the sysfs comments should list the proper entries Reported-by: Matheus Castanho Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6dee950c7b72a4965c102208041f14a063cf5a8c.camel@linux.ibm.com commit c127d130f6d59fa81701f6b04023cf7cd1972fb3 Author: Haren Myneni Date: Sat Apr 9 01:44:16 2022 -0700 powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr In init_winctx_regs(), __pa() is called on winctx->rx_fifo and this function is called to initialize registers for receive and fault windows. But the real address is passed in winctx->rx_fifo for receive windows and the virtual address for fault windows which causes errors with DEBUG_VIRTUAL enabled. Fixes this issue by assigning only real address to rx_fifo in vas_rx_win_attr struct for both receive and fault windows. Reported-by: Michael Ellerman Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/338e958c7ab8f3b266fa794a1f80f99b9671829e.camel@linux.ibm.com commit 6bdc81eca9519a85d36b3915136640ef9cba1a23 Author: Christophe Leroy Date: Mon May 9 07:36:23 2022 +0200 powerpc/opcodes: Remove unused PPC_INST_XXX macros The following PPC_INST_XXX macros are not used anymore outside ppc-opcode.h: - PPC_INST_LD - PPC_INST_STD - PPC_INST_ADDIS - PPC_INST_ADD - PPC_INST_DIVD Remove them. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8c28636126f69141419953b5638b4a908c184dc1.1652074503.git.christophe.leroy@csgroup.eu commit ae2c760fa10ba2475aa46fffa6be42050586c604 Author: Christophe Leroy Date: Mon May 9 07:36:22 2022 +0200 powerpc/inst: Remove PPC_INST_BL Convert last users of PPC_INST_BL to PPC_RAW_BL() And remove PPC_INST_BL. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d9eacb758e7ae7cf224211ebe3f6f7d409a333be.1652074503.git.christophe.leroy@csgroup.eu commit e0c2ef43210b023ed9a58c520c2fbede7010c592 Author: Christophe Leroy Date: Mon May 9 07:36:21 2022 +0200 powerpc/modules: Use PPC_LI macros instead of opencoding Use PPC_LI_MASK and PPC_LI() instead of opencoding. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3d56d7bc3200403773d54e62659d0e01292a055d.1652074503.git.christophe.leroy@csgroup.eu commit 4390a58ee1c37dc915dcf44fabe925b160f5bcf0 Author: Christophe Leroy Date: Mon May 9 07:36:20 2022 +0200 powerpc/inst: Remove PPC_INST_BRANCH Convert last users of PPC_INST_BRANCH to PPC_RAW_BRANCH() And remove PPC_INST_BRANCH. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fa8807108a2ef2287a2c9651d6e1ff7c051923d9.1652074503.git.christophe.leroy@csgroup.eu commit 8052d043a48f733905e8ea8f900bf58b441a317f Author: Christophe Leroy Date: Mon May 9 07:36:19 2022 +0200 powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target() module_trampoline_target() is quite a hot path used when activating/deactivating function tracer. Avoid the heavy copy_from_kernel_nofault() by doing four calls to copy_inst_from_kernel_nofault(). Use __copy_inst_from_kernel_nofault() for the 3 last calls. First call is done to copy_from_kernel_nofault() to check address is within kernel space. No risk to wrap out the top of kernel space because the last page is never mapped so if address is in last page the first copy will fails and the other ones will never be performed. And also make it notrace just like all functions that call it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c55559103e014b7863161559d340e8e9484eaaa6.1652074503.git.christophe.leroy@csgroup.eu commit 8dfdbe4368c09d9eeae2df8968ee6c345ec8c1b5 Author: Christophe Leroy Date: Mon May 9 07:36:18 2022 +0200 powerpc/inst: Add __copy_inst_from_kernel_nofault() On the same model as get_user() versus __get_user(), introduce __copy_inst_from_kernel_nofault() which doesn't check address. To be used by callers that have already checked that the adress is a kernel address. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1f3702890d6dbd64702b61834753bcc96851c18c.1652074503.git.christophe.leroy@csgroup.eu commit af8b9f352ffd435734ab8f94f99ccb922da916b4 Author: Christophe Leroy Date: Mon May 9 07:36:17 2022 +0200 powerpc/ftrace: Minimise number of #ifdefs A lot of #ifdefs can be replaced by IS_ENABLED() Do so. Signed-off-by: Christophe Leroy [mpe: Fold in changes suggested by Naveen and Christophe on list] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/18ce6708d6f8c71d87436f9c6019f04df4125128.1652074503.git.christophe.leroy@csgroup.eu commit b97d0e3dcfba07590ec3d2ca2b95b2f029962d16 Author: Christophe Leroy Date: Mon May 9 07:36:16 2022 +0200 powerpc/ftrace: Simplify expected_nop_sequence() Avoid ifdefs around expected_nop_sequence(). While at it make it a bool. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/305d22472f1f92127fba09692df6bb5d079a8cd0.1652074503.git.christophe.leroy@csgroup.eu commit c8deb28095f9cd2ee2f4d16e948c9e816a22811b Author: Christophe Leroy Date: Mon May 9 07:36:15 2022 +0200 powerpc/ftrace: Use size macro instead of opencoding 0x80000000 is SZ_2G. Use it. Signed-off-by: Christophe Leroy [mpe: Fix comparison against unsigned -SZ_2G] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bb6626e884acffe87b58736291df57db3deaa9b9.1652074503.git.christophe.leroy@csgroup.eu commit 35a2b533a261e2e43542df902bd9757a1deebfd5 Author: Steve French Date: Sun May 22 00:41:41 2022 -0500 smb3: add trace point for oplock not found In order to debug problems with server potentially sending us an oplock that we don't recognize (or a race with close and oplock break) it would be helpful to have a dynamic trace point for this case. New tracepoint is called trace_smb3_oplock_not_found Signed-off-by: Steve French commit 2b058acecf56f6b8fac781911a683219b9ca3b7b Author: ChenXiaoSong Date: Wed May 18 22:56:49 2022 +0800 cifs: return the more nuanced writeback error on close() As filemap_check_errors() only report -EIO or -ENOSPC, we return more nuanced writeback error -(file->f_mapping->wb_err & MAX_ERRNO). filemap_write_and_wait filemap_write_and_wait_range filemap_check_errors -ENOSPC or -EIO filemap_check_wb_err errseq_check return -(file->f_mapping->wb_err & MAX_ERRNO) Signed-off-by: ChenXiaoSong Signed-off-by: Steve French commit fb253d5ba3fcbd3b4216bcc37d019926f5e32ebb Author: Steve French Date: Sat May 21 23:56:16 2022 -0500 smb3: add trace point for lease not found issue When trying to debug problems with server sending us a lease we don't recognize, it would be helpful to have a dynamic trace point for this case. New tracepoint is called trace_smb3_lease_not_found Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit fb64f7f1057e5eb6fbf3b06f92d1cd80ad7f9998 Author: Julia Lawall Date: Sat May 21 13:11:19 2022 +0200 cifs: smbd: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Steve French commit ef09ed5d37b84d18562b30cf7253e57062d0db05 Author: Ye Bin Date: Mon May 16 20:26:34 2022 +0800 ext4: fix bug_on in ext4_writepages we got issue as follows: EXT4-fs error (device loop0): ext4_mb_generate_buddy:1141: group 0, block bitmap and bg descriptor inconsistent: 25 vs 31513 free cls ------------[ cut here ]------------ kernel BUG at fs/ext4/inode.c:2708! invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 2 PID: 2147 Comm: rep Not tainted 5.18.0-rc2-next-20220413+ #155 RIP: 0010:ext4_writepages+0x1977/0x1c10 RSP: 0018:ffff88811d3e7880 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffff88811c098000 RDX: 0000000000000000 RSI: ffff88811c098000 RDI: 0000000000000002 RBP: ffff888128140f50 R08: ffffffffb1ff6387 R09: 0000000000000000 R10: 0000000000000007 R11: ffffed10250281ea R12: 0000000000000001 R13: 00000000000000a4 R14: ffff88811d3e7bb8 R15: ffff888128141028 FS: 00007f443aed9740(0000) GS:ffff8883aef00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020007200 CR3: 000000011c2a4000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_writepages+0x130/0x3a0 filemap_fdatawrite_wbc+0x83/0xa0 filemap_flush+0xab/0xe0 ext4_alloc_da_blocks+0x51/0x120 __ext4_ioctl+0x1534/0x3210 __x64_sys_ioctl+0x12c/0x170 do_syscall_64+0x3b/0x90 It may happen as follows: 1. write inline_data inode vfs_write new_sync_write ext4_file_write_iter ext4_buffered_write_iter generic_perform_write ext4_da_write_begin ext4_da_write_inline_data_begin -> If inline data size too small will allocate block to write, then mapping will has dirty page ext4_da_convert_inline_data_to_extent ->clear EXT4_STATE_MAY_INLINE_DATA 2. fallocate do_vfs_ioctl ioctl_preallocate vfs_fallocate ext4_fallocate ext4_convert_inline_data ext4_convert_inline_data_nolock ext4_map_blocks -> fail will goto restore data ext4_restore_inline_data ext4_create_inline_data ext4_write_inline_data ext4_set_inode_state -> set inode EXT4_STATE_MAY_INLINE_DATA 3. writepages __ext4_ioctl ext4_alloc_da_blocks filemap_flush filemap_fdatawrite_wbc do_writepages ext4_writepages if (ext4_has_inline_data(inode)) BUG_ON(ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) The root cause of this issue is we destory inline data until call ext4_writepages under delay allocation mode. But there maybe already convert from inline to extent. To solve this issue, we call filemap_flush first.. Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220516122634.1690462-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 72f63f4a770310233dba3bff8fc6e41660ebaa27 Author: Ritesh Harjani Date: Sun May 15 12:07:48 2022 +0530 ext4: refactor and move ext4_ioctl_get_encryption_pwsalt() This patch move code for FS_IOC_GET_ENCRYPTION_PWSALT case into ext4's crypto.c file, i.e. ext4_ioctl_get_encryption_pwsalt() and uuid_is_zero(). This is mostly refactoring logic and should not affect any functionality change. Suggested-by: Eric Biggers Reviewed-by: Eric Biggers Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/5af98b17152a96b245b4f7d2dfb8607fc93e36aa.1652595565.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 3030b59c8533835f4e8b5e6d7047f80dcf7e40b9 Author: Ritesh Harjani Date: Sun May 15 12:07:47 2022 +0530 ext4: cleanup function defs from ext4.h into crypto.c Some of these functions when CONFIG_FS_ENCRYPTION is enabled are not really inline (let compiler be the best judge of it). Remove inline and move them into crypto.c where they should be present. Reviewed-by: Eric Biggers Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/b7b9de2c7226298663fb5a0c28909135e2ab220f.1652595565.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit b1241c8eb977826cf9b1588514ab8896aa23896b Author: Ritesh Harjani Date: Sun May 15 12:07:46 2022 +0530 ext4: move ext4 crypto code to its own file crypto.c This is to cleanup super.c file which has grown quite large. So, start moving ext4 crypto related code to where it should be in the first place i.e. fs/ext4/crypto.c Reviewed-by: Eric Biggers Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/7d637e093cbc34d727397e8d41a53a1b9ca7d7a4.1652595565.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o commit 376b9133826865568167b4091ef92a68c4622b87 Author: Hyunchul Lee Date: Fri May 20 14:35:47 2022 +0900 ksmbd: fix outstanding credits related bugs outstanding credits must be initialized to 0, because it means the sum of credits consumed by in-flight requests. And outstanding credits must be compared with total credits in smb2_validate_credit_charge(), because total credits are the sum of credits granted by ksmbd. This patch fix the following error, while frametest with Windows clients: Limits exceeding the maximum allowable outstanding requests, given : 128, pending : 8065 Fixes: b589f5db6d4a ("ksmbd: limits exceeding the maximum allowable outstanding requests") Cc: stable@vger.kernel.org Signed-off-by: Hyunchul Lee Reported-by: Yufan Chen Tested-by: Yufan Chen Acked-by: Namjae Jeon Signed-off-by: Steve French commit 5366afc4065075a4456941fbd51c33604d631ee5 Author: Hyunchul Lee Date: Wed May 18 06:46:08 2022 +0900 ksmbd: smbd: fix connection dropped issue When there are bursty connection requests, RDMA connection event handler is deferred and Negotiation requests are received even if connection status is NEW. To handle it, set the status to CONNECTED if Negotiation requests are received. Reported-by: Yufan Chen Signed-off-by: Hyunchul Lee Tested-by: Yufan Chen Acked-by: Namjae Jeon Signed-off-by: Steve French commit 7820c6ee029548290b318e522eb2578516d05393 Author: Yang Li Date: Thu May 12 15:56:05 2022 +0800 ksmbd: Fix some kernel-doc comments Remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ksmbd/misc.c:30: warning: Function parameter or member 'str' not described in 'match_pattern' fs/ksmbd/misc.c:30: warning: Excess function parameter 'string' description in 'match_pattern' fs/ksmbd/misc.c:163: warning: Function parameter or member 'share' not described in 'convert_to_nt_pathname' fs/ksmbd/misc.c:163: warning: Function parameter or member 'path' not described in 'convert_to_nt_pathname' fs/ksmbd/misc.c:163: warning: Excess function parameter 'filename' description in 'convert_to_nt_pathname' fs/ksmbd/misc.c:163: warning: Excess function parameter 'sharepath' description in 'convert_to_nt_pathname' fs/ksmbd/misc.c:259: warning: Function parameter or member 'share' not described in 'convert_to_unix_name' fs/ksmbd/misc.c:259: warning: Function parameter or member 'name' not described in 'convert_to_unix_name' fs/ksmbd/misc.c:259: warning: Excess function parameter 'path' description in 'convert_to_unix_name' fs/ksmbd/misc.c:259: warning: Excess function parameter 'tid' description in 'convert_to_unix_name' Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Namjae Jeon Signed-off-by: Steve French commit 7a84399e1ce3f5f2fbec3e7dd93459ba25badc2f Author: Namjae Jeon Date: Mon May 16 16:23:28 2022 +0900 ksmbd: fix wrong smbd max read/write size check smb-direct max read/write size can be different with smb2 max read/write size. So smb2_read() can return error by wrong max read/write size check. This patch use smb_direct_max_read_write_size for this check in smb-direct read/write(). Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French commit 65bb45b97b578c8eed1ffa80caec84708df49729 Author: Namjae Jeon Date: Mon May 16 16:22:43 2022 +0900 ksmbd: add smbd max io size parameter Add 'smbd max io size' parameter to adjust smbd-direct max read/write size. Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French commit 65ca7a3ffff811d6c0d4342d467c381257d566d4 Author: Namjae Jeon Date: Mon May 16 16:22:09 2022 +0900 ksmbd: handle smb2 query dir request for OutputBufferLength that is too small We found the issue that ksmbd return STATUS_NO_MORE_FILES response even though there are still dentries that needs to be read while file read/write test using framtest utils. windows client send smb2 query dir request included OutputBufferLength(128) that is too small to contain even one entry. This patch make ksmbd immediately returns OutputBufferLength of response as zero to client. Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French commit ee1b0558965909872775183dc237cdf9f8eddaba Author: Hyunchul Lee Date: Sat Apr 30 08:30:29 2022 +0900 ksmbd: smbd: handle multiple Buffer descriptors Make ksmbd handle multiple buffer descriptors when reading and writing files using SMB direct: Post the work requests of rdma_rw_ctx for RDMA read/write in smb_direct_rdma_xmit(), and the work request for the READ/WRITE response with a remote invalidation in smb_direct_writev(). Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit 4e3edd0092704b25626a0fe60a974f6f382ff93d Author: Hyunchul Lee Date: Sat Apr 30 08:30:28 2022 +0900 ksmbd: smbd: change the return value of get_sg_list Make get_sg_list return EINVAL if there aren't mapped scatterlists. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit 11659a8ddbd9c4c1ab6f3b8f52837178ef121b20 Author: Hyunchul Lee Date: Sat Apr 30 08:30:27 2022 +0900 ksmbd: smbd: simplify tracking pending packets Because we don't have to tracking pending packets by dividing these into packets with payload and packets without payload, merge the tracking code. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit ddbdc861e37c168cf2fb8a7b7477f5d18b4daf76 Author: Hyunchul Lee Date: Sat Apr 30 08:30:26 2022 +0900 ksmbd: smbd: introduce read/write credits for RDMA read/write SMB2_READ/SMB2_WRITE request has to be granted the number of rw credits, the pages the request wants to transfer / the maximum pages which can be registered with one MR to read and write a file. And allocate enough RDMA resources for the maximum number of rw credits allowed by ksmbd. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit 1807abcf8778bcbbf584fe54da9ccbe9029c49bb Author: Hyunchul Lee Date: Sat Apr 30 08:30:25 2022 +0900 ksmbd: smbd: change prototypes of RDMA read/write related functions Change the prototypes of RDMA read/write operations to accept a pointer and length of buffer descriptors. Signed-off-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French commit fabcf4d8696839a8da8a3f90d1fd30ae923ddde7 Author: Julia Lawall Date: Sat May 21 12:48:06 2022 -0700 Input: cypress_ps2 - 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-27-Julia.Lawall@inria.fr Signed-off-by: Dmitry Torokhov commit 8810d7feee5a0cf88d7854f4ad4930a4fab8dd70 Author: Niklas Cassel Date: Thu Apr 14 19:30:36 2022 +0200 riscv: Don't output a bogus mmu-type on a no MMU kernel Currently on a 64-bit kernel built without CONFIG_MMU, /proc/cpuinfo will show the current MMU mode as sv57. While the device tree property "mmu-type" does have a value "riscv,none" to describe a CPU without a MMU, since commit 73c7c8f68e72 ("riscv: Use pgtable_l4_enabled to output mmu_type in cpuinfo"), we no longer rely on device tree to output the MMU mode. (Not even for CONFIG_32BIT.) Therefore, instead of readding code to look at the "mmu-type" device tree property, let's continue with the existing convention to use fixed values for configurations where we don't determine the MMU mode at runtime. Add a new fixed value for !CONFIG_MMU in order to output the correct MMU mode in cpuinfo. Signed-off-by: Niklas Cassel Link: https://lore.kernel.org/r/20220414173037.1381927-1-niklas.cassel@wdc.com Signed-off-by: Palmer Dabbelt commit 4420658a4a7b03e3f4afb925bdd3ab9e06c2c46f Author: Guo Ren Date: Thu May 5 11:55:24 2022 +0800 riscv: atomic: Add custom conditional atomic operation implementation Add conditional atomic operations' custom implementation (similar to dec_if_positive), here is the list: - arch_atomic_inc_unless_negative - arch_atomic_dec_unless_positive - arch_atomic64_inc_unless_negative - arch_atomic64_dec_unless_positive Signed-off-by: Guo Ren Signed-off-by: Guo Ren Link: https://lore.kernel.org/r/20220505035526.2974382-4-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 1d7f6932c522ea95668e14265175ce3d753d0c24 Author: Guo Ren Date: Thu May 5 11:55:23 2022 +0800 riscv: atomic: Optimize dec_if_positive functions Current implementation wastes another register to pass the argument, but we only need addi to calculate the result. Optimize the code with minimize the usage of registers. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Link: https://lore.kernel.org/r/20220505035526.2974382-3-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit dd8437cd4249e367f747a37b6a19d4cd04bf8796 Author: Guo Ren Date: Thu May 5 11:55:22 2022 +0800 riscv: atomic: Cleanup unnecessary definition The cmpxchg32 & cmpxchg32_local are not used in Linux anymore. So clean up asm/cmpxchg.h. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Link: https://lore.kernel.org/r/20220505035526.2974382-2-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit c9fc5ca454b3f0606589bff306793a3d2f0d9f13 Author: Ronnie Sahlberg Date: Tue May 10 09:42:06 2022 +1000 cifs: set the CREATE_NOT_FILE when opening the directory in use_cached_dir() This enforces that we can only do this for directories and not normal files or else the server will return an error. This means that we will have conditionally check IF the path refers to a directory or not in all the call-sites where we are unsure. Right now this check is for "" i.e. root. Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 198bf836dfb9c76105c93e6a3138ed1a33841fad Author: Ronnie Sahlberg Date: Tue May 10 09:42:05 2022 +1000 cifs: check for smb1 in open_cached_dir() Check protocol version in open_cached_dir() and return not supported for SMB1. This allows us to call open_cached_dir() from code that is common to both smb1 and smb2/3 in future patches without having to do this check in the call-site. At the same time, add a check if tcon is valid or not for the same reason. Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit f695b2893505a5ac812f32167b48b028a4e41494 Author: Ronnie Sahlberg Date: Tue May 10 09:42:04 2022 +1000 cifs: move definition of cifs_fattr earlier in cifsglob.h This only moves these definitions to come earlier in the file but not change the definition itself. This is done to reduce the amount of changes in future patches. Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit c25f77899753fdd6f43fa6999abd53fd0059496e Author: Prasad Sodagudi Date: Tue May 17 16:13:00 2022 +0530 mailbox: qcom-ipcc: Log the pending interrupt during resume Enable logging of the pending interrupt that triggered device wakeup. This logging information helps to debug IRQs that cause periodic device wakeups by printing the detailed information of pending IPCC interrupts. Scenario: Device wakeup caused by Modem crash Logs: qcom-ipcc mailbox: virq: 182 triggered client-id: 2; signal-id: 2 From the IPCC bindings it can further be understood that the client here is IPCC_CLIENT_MPSS and the signal was IPCC_MPROC_SIGNAL_SMP2P. Reviewed-by: Manivannan Sadhasivam Signed-off-by: Prasad Sodagudi Signed-off-by: Sibi Sankar Signed-off-by: Jassi Brar commit 369e4ef87a8f5da7c348ec2c61ec5cd726e8337a Author: Mario Limonciello Date: Mon May 9 09:17:16 2022 -0500 mailbox: pcc: Fix an invalid-load caught by the address sanitizer `pcc_mailbox_probe` doesn't initialize all memory that has been allocated before the first time that one of it's members `txdone_irq` may be accessed. This leads to a an invalid load any time that this member is accessed: [ 2.429769] UBSAN: invalid-load in drivers/mailbox/pcc.c:684:22 [ 2.430324] UBSAN: invalid-load in drivers/mailbox/mailbox.c:486:12 [ 4.276782] UBSAN: invalid-load in drivers/acpi/cppc_acpi.c:314:45 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215587 Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Signed-off-by: Mario Limonciello Reviewed-by: Sudeep Holla Signed-off-by: Jassi Brar commit 9accf46b7fb893a46eff3a57407b02ac227a7cd7 Author: Fabien Dessenne Date: Tue May 3 16:55:59 2022 +0200 dt-bindings: mailbox: remove the IPCC "wakeup" IRQ The stm32 ipcc mailbox driver supports only two interrupts (rx and tx), so remove the unsupported "wakeup" one. Signed-off-by: Fabien Dessenne Reviewed-by: Rob Herring Signed-off-by: Jassi Brar commit a022c7c96ca1c7d8b4d2702973bf4b1a7cff5958 Author: Krzysztof Kozlowski Date: Sun May 1 12:34:27 2022 +0200 mailbox: correct kerneldoc Correct kerneldoc warnings like: drivers/mailbox/arm_mhu_db.c:47: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/mailbox/qcom-ipcc.c:58: warning: Function parameter or member 'num_chans' not described in 'qcom_ipcc' Signed-off-by: Krzysztof Kozlowski Acked-by: Viresh Kumar Acked-by: Sudeep Holla Signed-off-by: Jassi Brar commit d9512696082bcfd068ce65476c85c5b17511d4df Author: ran jianping Date: Thu Apr 28 06:42:09 2022 +0000 mailbox: omap: using pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Jassi Brar commit 504ff5b00853b05133c9cddfc351548b48cc5bdc Author: ran jianping Date: Wed Apr 27 05:41:00 2022 +0000 mailbox:imx: using pm_runtime_resume_and_get Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Jassi Brar commit 02b5c35a617137ccad8d6988805ab54c3a9efc81 Author: Tinghan Shen Date: Fri Apr 22 10:39:09 2022 +0800 mailbox: mediatek: support mt8186 adsp mailbox Add support of mt8186 adsp mailbox. Signed-off-by: Tinghan Shen Signed-off-by: Jassi Brar commit dea27cda46116afea45fdaade52adedb732d77ab Author: Tinghan Shen Date: Fri Apr 22 10:39:08 2022 +0800 dt-bindings: mailbox: mtk,adsp-mbox: add mt8186 compatible name Add compatible name for MediaTek MT8186 SoC ADSP mailbox. Signed-off-by: Tinghan Shen Acked-by: Rob Herring Signed-off-by: Jassi Brar commit 74c20dd0f89238068de5bb6ecd4e968eddab339d Author: Kartik Date: Thu Apr 14 13:05:57 2022 +0530 mailbox: tegra-hsp: Add 128-bit shared mailbox support Add support for 128-bit shared mailboxes found on Tegra234 chips. Signed-off-by: Kartik Signed-off-by: Jassi Brar commit 58919326e72f63c380dc3271dd1cc8bdf1bbe3e4 Author: Kartik Date: Thu Apr 14 13:05:56 2022 +0530 dt-bindings: tegra186-hsp: add type for shared mailboxes Tegra234 supports sending/receiving 32-bit and 128-bit data over a shared mailbox. Based on the data size to be used, clients need to specify the type of shared mailbox in the device tree. Add a macro for 128-bit shared mailbox. Mailbox clients can use this macro as a flag in device tree to enable 128-bit data support for a shared mailbox. Signed-off-by: Kartik Acked-by: Rob Herring Signed-off-by: Jassi Brar commit 8f585d14030dcf8fbec2f864d189515e8be37a80 Author: Kartik Date: Thu Apr 14 13:05:55 2022 +0530 mailbox: tegra-hsp: Add tegra_hsp_sm_ops This patch introduces tegra_hsp_sm_ops to abstract send & receive API's for shared mailboxes. Signed-off-by: Kartik Signed-off-by: Jassi Brar commit 1b3418ac6451b771b677e049b8a48d96e258e922 Author: Yongqiang Niu Date: Wed Apr 6 17:12:13 2022 +0800 dt-bindings: gce: add the GCE header file for MT8186 Add the GCE header file to define GCE subsys ids, hardware event ids and constants for MT8186. Signed-off-by: Yongqiang Niu Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Jassi Brar commit 1b0070aca35ed70f9cc6f97b5d9f7f98cb4771fd Author: Xiaomeng Tong Date: Tue Apr 5 16:05:56 2022 +0800 mailbox: remove an unneeded NULL check on list iterator The list iterator is always non-NULL so it doesn't need to be checked. Thus just remove the unnecessary NULL check. Signed-off-by: Xiaomeng Tong Signed-off-by: Jassi Brar commit 262190a8ca2b1e1ec75b8a4f1c7f07e585facd6f Author: Tom Rix Date: Sun Apr 3 10:53:04 2022 -0400 mailbox: imx: remove redundant initializer Smatch reports this issue imx-mailbox.c:887:10: warning: Initializer entry defined twice imx-mailbox.c:889:10: also defined here .rxdb = imx_mu_generic_rxdb, Is listed twice, so remove one. Signed-off-by: Tom Rix Signed-off-by: Jassi Brar commit cd285535b8eeed314813783ba9b5a851bdf6bca8 Author: Krzysztof Kozlowski Date: Sat Apr 2 17:55:50 2022 +0200 dt-bindings: mailbox: qcom-ipcc: simplify the example Consumer examples in the bindings of resource providers are trivial, useless and duplicating code. Additionally the incomplete qcom,smp2p example triggers DT schema warnings. Cleanup the example by removing the consumer part and fixing the indentation to DT schema convention. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Jassi Brar commit c244dc1bc92e94c625325a654337490bb1da871a Author: Rafael J. Wysocki Date: Sat May 21 18:02:26 2022 +0200 Revert "ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms" Commit 6eaf08770ee8 ("ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms") made acpi_ex_system_do_sleep() log a warning for sleep times greater than 10 ms, but such sleep times are used in power management AML because of the PCI specification requirements. This results with logging warnings that cannot really be acted on in any useful way which is annoying and these warnings show up in the logs on many production systems, so revert commit 6eaf08770ee8. Signed-off-by: Rafael J. Wysocki commit edbc7960bef7fd71ef1e44d0df15b864784b14c8 Author: Marek Vasut Date: Thu May 19 01:38:44 2022 +0200 drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid. Fixes: ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver") Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Marek Vasut Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg Reviewed-by: Andrzej Hajda Reviewed-by: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20220518233844.248504-1-marex@denx.de commit 3fe07bcd800d6e5e4e4263ca2564d69095c157bf Author: Jens Axboe Date: Sat May 21 09:17:05 2022 -0600 io_uring: cleanup handling of the two task_work lists Rather than pass in a bool for whether or not this work item needs to go into the priority list or not, provide separate helpers for it. For most use cases, this also then gets rid of the branch for non-priority task work. While at it, rename the prior_task_list to prio_task_list. Prior is a confusing name for it, as it would seem to indicate that this is the previous task_work list. prio makes it clear that this is a priority task_work list. Signed-off-by: Jens Axboe commit 2aeb1f5fbbacbe159690ef7338503f323b0d4f46 Author: Julia Lawall Date: Sat May 21 13:10:49 2022 +0200 EDAC/xgene: Fix typo processsors -> processors Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220521111145.81697-39-Julia.Lawall@inria.fr commit 537b9f2bf60f4bbd8ab89cea16aaab70f0c1560d Author: Julia Lawall Date: Sat May 21 13:10:38 2022 +0200 mtip32xx: 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-28-Julia.Lawall@inria.fr Signed-off-by: Jens Axboe commit 2aaf516084184e4e6f80da01b2b3ed882fd20a79 Author: Julia Lawall Date: Sat May 21 13:10:39 2022 +0200 blk-mq: 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-29-Julia.Lawall@inria.fr Signed-off-by: Jens Axboe commit 3cd4030da3a9b54ee1ffb8397aba857397c703e4 Author: Julia Lawall Date: Sat May 21 13:11:03 2022 +0200 i2c: meson: fix typo in comment Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Wolfram Sang commit e35fb4188942a7338588536cf9e9756c34c103fb Author: Kuninori Morimoto Date: Fri May 20 22:29:18 2022 +0200 i2c: rcar: use flags instead of atomic_xfer i2c-rcar already has priv->flags. This patch adds a new persistent flag ID_P_NOT_ATOMIC and uses it to save the extra variable. The negation of the logic was done to make the code more readable. Signed-off-by: Kuninori Morimoto [wsa: negated the logic, rebased, updated the commit message] Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit f0f0e07685609c84ef5e0a3b1725bb666c95fbc4 Author: Wolfram Sang Date: Fri May 20 22:29:17 2022 +0200 i2c: rcar: REP_AFTER_RD is not a persistent flag Previous refactoring makes it easy now to convert the above flag to a non-persistent one. This is more appropriate and easier to maintain. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 4c278db7be94ab5e147f5bf409a7b5571cdd4a5a Author: Wolfram Sang Date: Fri May 20 22:29:16 2022 +0200 i2c: rcar: use BIT macro consistently Easier to read and ensures proper types. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 027bbb884be006b05d9c577d6401686053aa789e Author: Pawan Gupta Date: Thu May 19 20:35:15 2022 -0700 KVM: x86/speculation: Disable Fill buffer clear within guests The enumeration of MD_CLEAR in CPUID(EAX=7,ECX=0).EDX{bit 10} is not an accurate indicator on all CPUs of whether the VERW instruction will overwrite fill buffers. FB_CLEAR enumeration in IA32_ARCH_CAPABILITIES{bit 17} covers the case of CPUs that are not vulnerable to MDS/TAA, indicating that microcode does overwrite fill buffers. Guests running in VMM environments may not be aware of all the capabilities/vulnerabilities of the host CPU. Specifically, a guest may apply MDS/TAA mitigations when a virtual CPU is enumerated as vulnerable to MDS/TAA even when the physical CPU is not. On CPUs that enumerate FB_CLEAR_CTRL the VMM may set FB_CLEAR_DIS to skip overwriting of fill buffers by the VERW instruction. This is done by setting FB_CLEAR_DIS during VMENTER and resetting on VMEXIT. For guests that enumerate FB_CLEAR (explicitly asking for fill buffer clear capability) the VMM will not use FB_CLEAR_DIS. Irrespective of guest state, host overwrites CPU buffers before VMENTER to protect itself from an MMIO capable guest, as part of mitigation for MMIO Stale Data vulnerabilities. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit a992b8a4682f119ae035a01b40d4d0665c4a2875 Author: Pawan Gupta Date: Thu May 19 20:34:14 2022 -0700 x86/speculation/mmio: Reuse SRBDS mitigation for SBDS The Shared Buffers Data Sampling (SBDS) variant of Processor MMIO Stale Data vulnerabilities may expose RDRAND, RDSEED and SGX EGETKEY data. Mitigation for this is added by a microcode update. As some of the implications of SBDS are similar to SRBDS, SRBDS mitigation infrastructure can be leveraged by SBDS. Set X86_BUG_SRBDS and use SRBDS mitigation. Mitigation is enabled by default; use srbds=off to opt-out. Mitigation status can be checked from below file: /sys/devices/system/cpu/vulnerabilities/srbds Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 22cac9c677c95f3ac5c9244f8ca0afdc7c8afb19 Author: Pawan Gupta Date: Thu May 19 20:33:13 2022 -0700 x86/speculation/srbds: Update SRBDS mitigation selection Currently, Linux disables SRBDS mitigation on CPUs not affected by MDS and have the TSX feature disabled. On such CPUs, secrets cannot be extracted from CPU fill buffers using MDS or TAA. Without SRBDS mitigation, Processor MMIO Stale Data vulnerabilities can be used to extract RDRAND, RDSEED, and EGETKEY data. Do not disable SRBDS mitigation by default when CPU is also affected by Processor MMIO Stale Data vulnerabilities. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 2a250d4508597c6dd719db4be7af68575e828f7d Author: Dan Carpenter Date: Mon Mar 7 15:56:03 2022 +0300 i2c: qcom-geni: remove unnecessary conditions We know that "ret" is a negative error code at this point so there is no need to check. Signed-off-by: Dan Carpenter Signed-off-by: Wolfram Sang commit 8d50cdf8b8341770bc6367bce40c0c1bb0e1d5b3 Author: Pawan Gupta Date: Thu May 19 20:32:13 2022 -0700 x86/speculation/mmio: Add sysfs reporting for Processor MMIO Stale Data Add the sysfs reporting file for Processor MMIO Stale Data vulnerability. It exposes the vulnerability and mitigation state similar to the existing files for the other hardware vulnerabilities. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 99a83db5a605137424e1efe29dc0573d6a5b6316 Author: Pawan Gupta Date: Thu May 19 20:31:12 2022 -0700 x86/speculation/mmio: Enable CPU Fill buffer clearing on idle When the CPU is affected by Processor MMIO Stale Data vulnerabilities, Fill Buffer Stale Data Propagator (FBSDP) can propagate stale data out of Fill buffer to uncore buffer when CPU goes idle. Stale data can then be exploited with other variants using MMIO operations. Mitigate it by clearing the Fill buffer before entering idle state. Signed-off-by: Pawan Gupta Co-developed-by: Josh Poimboeuf Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit e5925fb867290ee924fcf2fe3ca887b792714366 Author: Pawan Gupta Date: Thu May 19 20:30:12 2022 -0700 x86/bugs: Group MDS, TAA & Processor MMIO Stale Data mitigations MDS, TAA and Processor MMIO Stale Data mitigations rely on clearing CPU buffers. Moreover, status of these mitigations affects each other. During boot, it is important to maintain the order in which these mitigations are selected. This is especially true for md_clear_update_mitigation() that needs to be called after MDS, TAA and Processor MMIO Stale Data mitigation selection is done. Introduce md_clear_select_mitigation(), and select all these mitigations from there. This reflects relationships between these mitigations and ensures proper ordering. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 8cb861e9e3c9a55099ad3d08e1a3b653d29c33ca Author: Pawan Gupta Date: Thu May 19 20:29:11 2022 -0700 x86/speculation/mmio: Add mitigation for Processor MMIO Stale Data Processor MMIO Stale Data is a class of vulnerabilities that may expose data after an MMIO operation. For details please refer to Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst. These vulnerabilities are broadly categorized as: Device Register Partial Write (DRPW): Some endpoint MMIO registers incorrectly handle writes that are smaller than the register size. Instead of aborting the write or only copying the correct subset of bytes (for example, 2 bytes for a 2-byte write), more bytes than specified by the write transaction may be written to the register. On some processors, this may expose stale data from the fill buffers of the core that created the write transaction. Shared Buffers Data Sampling (SBDS): After propagators may have moved data around the uncore and copied stale data into client core fill buffers, processors affected by MFBDS can leak data from the fill buffer. Shared Buffers Data Read (SBDR): It is similar to Shared Buffer Data Sampling (SBDS) except that the data is directly read into the architectural software-visible state. An attacker can use these vulnerabilities to extract data from CPU fill buffers using MDS and TAA methods. Mitigate it by clearing the CPU fill buffers using the VERW instruction before returning to a user or a guest. On CPUs not affected by MDS and TAA, user application cannot sample data from CPU fill buffers using MDS or TAA. A guest with MMIO access can still use DRPW or SBDR to extract data architecturally. Mitigate it with VERW instruction to clear fill buffers before VMENTER for MMIO capable guests. Add a kernel parameter mmio_stale_data={off|full|full,nosmt} to control the mitigation. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit f52ea6c26953fed339aa4eae717ee5c2133c7ff2 Author: Pawan Gupta Date: Thu May 19 20:28:10 2022 -0700 x86/speculation: Add a common function for MD_CLEAR mitigation update Processor MMIO Stale Data mitigation uses similar mitigation as MDS and TAA. In preparation for adding its mitigation, add a common function to update all mitigations that depend on MD_CLEAR. [ bp: Add a newline in md_clear_update_mitigation() to separate statements better. ] Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 51802186158c74a0304f51ab963e7c2b3a2b046f Author: Pawan Gupta Date: Thu May 19 20:27:08 2022 -0700 x86/speculation/mmio: Enumerate Processor MMIO Stale Data bug Processor MMIO Stale Data is a class of vulnerabilities that may expose data after an MMIO operation. For more details please refer to Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst Add the Processor MMIO Stale Data bug enumeration. A microcode update adds new bits to the MSR IA32_ARCH_CAPABILITIES, define them. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 4419470191386456e0b8ed4eb06a70b0021798a6 Author: Pawan Gupta Date: Thu May 19 20:26:07 2022 -0700 Documentation: Add documentation for Processor MMIO Stale Data Add the admin guide for Processor MMIO stale data vulnerabilities. Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov commit 550b11395805060f5d61b2a367daf2d14c0d1d08 Author: Yang Yingliang Date: Sat May 14 10:31:48 2022 +0800 i2c: mt7621: Use devm_platform_get_and_ioremap_resource() Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang Reviewed-by: Stefan Roese Signed-off-by: Wolfram Sang commit 5d24df3d690809952528e7a19a43d84bc5b99d44 Author: Miaoqian Lin Date: Wed May 11 15:42:03 2022 +0400 watchdog: ts4800_wdt: Fix refcount leak in ts4800_wdt_probe of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() in some error paths. Fixes: bf9006399939 ("watchdog: ts4800: add driver for TS-4800 watchdog") Signed-off-by: Miaoqian Lin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220511114203.47420-1-linmq006@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9215a90dd56e008999dbaa228c8eb2c7df98a418 Author: Geert Uytterhoeven Date: Mon May 2 15:34:59 2022 +0200 dt-bindings: watchdog: renesas,wdt: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/2882a6de3905a57ae62d91060d27521af43c4068.1651497024.git.geert+renesas@glider.be Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit d65112f58464fd0ab62b8e4fb6c66cbf29b24b43 Author: Phil Edworthy Date: Wed Apr 27 15:55:31 2022 +0200 watchdog: Add Renesas RZ/N1 Watchdog driver This is a driver for the standard WDT on the RZ/N1 devices. This WDT has very limited timeout capabilities. However, it can reset the device. To do so, the corresponding bits in the SysCtrl RSTEN register need to be enabled. This is not done by this driver. Signed-off-by: Phil Edworthy Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220427135531.708279-3-jjhiblot@traphandler.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9dc731bbb455eeaff6e90abef7a8d05dfa6ccc9a Author: Jean-Jacques Hiblot Date: Wed Apr 27 15:55:30 2022 +0200 dt-bindings: watchdog: renesas,wdt: Add support for RZ/N1 Describe the WDT hardware in the RZ/N1 series. Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220427135531.708279-2-jjhiblot@traphandler.com [groeck: Rebased, fixed conflicts] Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 330415ebea81b65842e4cc6d2fd985c1b369e650 Author: Liu Xinpeng Date: Tue Apr 26 22:53:30 2022 +0800 watchdog: wdat_wdt: Stop watchdog when uninstalling module Test shows that wachdog still reboots machine after the module is removed. Use watchdog_stop_on_unregister to stop the watchdog on removing. Signed-off-by: Liu Xinpeng eviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1650984810-6247-4-git-send-email-liuxp11@chinatelecom.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 27fdf84510a1374748904db43f6755f912736d92 Author: Liu Xinpeng Date: Tue Apr 26 22:53:29 2022 +0800 watchdog: wdat_wdt: Stop watchdog when rebooting the system Executing reboot command several times on the machine "Dell PowerEdge R740", UEFI security detection stopped machine with the following prompt: UEFI0082: The system was reset due to a timeout from the watchdog timer. Check the System Event Log (SEL) or crash dumps from Operating Sysstem to identify the source that triggered the watchdog timer reset. Update the firmware or driver for the identified device. iDRAC has warning event: "The watchdog timer reset the system". This patch fixes this issue by adding the reboot notifier. Signed-off-by: Liu Xinpeng Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1650984810-6247-3-git-send-email-liuxp11@chinatelecom.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6d72c7ac9fbe26a77800676507da980436b40b2f Author: Liu Xinpeng Date: Tue Apr 26 22:53:28 2022 +0800 watchdog: wdat_wdt: Using the existing function to check parameter timeout If max_hw_heartbeat_ms is provided, the configured maximum timeout is not limited by it. The limit check in this driver therefore doesn't make much sense. Similar, the watchdog core ensures that minimum timeout limits are met if min_hw_heartbeat_ms is set. Using watchdog_timeout_invalid() makes more sense because it takes this into account. Signed-off-by: Liu Xinpeng Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1650984810-6247-2-git-send-email-liuxp11@chinatelecom.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 382256b219fbc901a69481e5b60812556f53152e Author: Andrej Picej Date: Mon Dec 6 07:47:31 2021 +0100 dt-bindings: watchdog: da9062: add watchdog timeout mode Document the watchdog timeout mode property. If this property is used the user can select what happens on watchdog timeout. Set this property to 1 to enable SHUTDOWN (the device resets), set it to 0 and the device will go to POWERDOWN on watchdog timeout. If this property is not set, don't touch the WATCHDOG_SD bit and leave the configuration to OTP. This way backward compatibility is not broken. Signed-off-by: Andrej Picej Reviewed-by: Adam Thomson Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211206064732.280375-4-andrej.picej@norik.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit af84a5a75344871c44ddbf4ab901c3427909f893 Author: Biju Das Date: Sun Apr 24 08:13:23 2022 +0100 dt-bindings: watchdog: renesas,wdt: Document RZ/G2UL SoC Document RZ/G2UL WDT bindings. RZ/G2UL WDT is similar to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-wdt" will be used as a fallback. Signed-off-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220424071323.151757-1-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9ef958929fc288a85146d18368f4d2aaac80cdbc Author: Liu Xinpeng Date: Tue Apr 26 18:11:45 2022 +0800 watchdog: iTCO_wdt: Using existing macro define covers more scenarios For power management, SET_NOIRQ_SYSTEM_SLEEP_PM_OPS defined for CONFIG_PM_SLEEP, will point ->suspend_noirq, ->freeze_noirq and ->poweroff_noirq to the same function. Vice versa happens for ->resume_noirq, ->thaw_noirq and ->restore_noirq. Signed-off-by: Liu Xinpeng Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1650967905-3199-1-git-send-email-liuxp11@chinatelecom.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b3ac0c58fa8934926360268f3d89ec7680644d7b Author: Miaoqian Lin Date: Tue Apr 12 07:08:23 2022 +0000 watchdog: rti-wdt: Fix pm_runtime_get_sync() error checking If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support") Signed-off-by: Miaoqian Lin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220412070824.23708-1-linmq006@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 26d14b9fc341893e862f17ab7db4543d5a530327 Author: Bjorn Andersson Date: Fri Apr 8 14:28:54 2022 -0700 dt-bindings: watchdog: Add SC8180X and SC8280XP compatibles Add compatibles for the SC8180X and SC8280XP platforms to the Qualcomm watchdog binding. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220408212854.581481-1-bjorn.andersson@linaro.org [groeck: Rebased and resolved conflicts] Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c83f643878388d468e0a674ac9502d4080499646 Author: Jan Kiszka Date: Mon Feb 21 17:22:38 2022 +0100 watchdog: rti_wdt: Fix calculation and evaluation of preset heartbeat This ensures that the same value is read back as was eventually programmed when using seconds as accuracy. Even then, comparing the more precise heartbeat_ms against heartbeat in seconds will almost never provide a match and will needlessly raise a warning. Fix by comparing apples to apples. Tested in combination with U-Boot as watchdog starter. Signed-off-by: Jan Kiszka Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/6a4b54ac-9588-e172-c4c7-b91d524a851e@siemens.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 95d0eee9718a21ed35fb80a68d3a71759b136f77 Author: Kunihiko Hayashi Date: Thu Apr 7 16:46:46 2022 +0900 dt-bindings: watchdog: uniphier: Use unevaluatedProperties This refers common bindings, so this is preferred for unevaluatedProperties instead of additionalProperties. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/1649317606-21267-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ac97c9374d3cdfa42611a32a653ac75db423cac4 Author: Eliav Farber Date: Thu Apr 14 05:42:33 2022 +0000 watchdog: sp805: disable watchdog on remove Disable the watchdog if it is active while removing the module. It is necessary in order to prevent a reset in case watchdog hw was running before the removal. Signed-off-by: Eliav Farber Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220414054233.1357-2-farbere@amazon.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a7ceca4398bc835c6ad29d10e1106de4cf0332e1 Author: Primoz Fiser Date: Fri Apr 22 09:27:12 2022 +0200 watchdog: da9063: optionally disable watchdog during suspend Optionally disable watchdog during suspend (if enabled) and re-enable it upon resume. This enables boards to sleep without being interrupted by the watchdog. This patch is based on commit f6c98b08381c ("watchdog: da9062: add power management ops") and commit 8541673d2a5f ("watchdog: da9062: fix power management ops") and brings the same functionality to DA9063. Signed-off-by: Primoz Fiser Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220422072713.3172345-2-primoz.fiser@norik.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b1912875a548cf32eebc77eec85034052909bba8 Author: Primoz Fiser Date: Fri Apr 22 09:27:11 2022 +0200 dt-bindings: mfd: da9063: watchdog: add suspend disable option Document the watchdog disable option which can be used if the hardware automatic suspend option is broken. Based on commit c514430c51ee8 ("dt-bindings: watchdog: da9062: add suspend disable option"). Signed-off-by: Primoz Fiser Reviewed-by: Rob Herring Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220422072713.3172345-1-primoz.fiser@norik.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 7b0efea4baf02f5e2f89e5f9b75ef891571b45f1 Author: Takashi Iwai Date: Sat May 21 08:53:25 2022 +0200 ALSA: usb-audio: Add missing ep_idx in fixed EP quirks The quirk entry for Focusrite Saffire 6 had no proper ep_idx for the capture endpoint, and this confused the driver, resulting in the broken sound. This patch adds the missing ep_idx in the entry. While we are at it, a couple of other entries (for Digidesign MBox and MOTU MicroBook II) seem to have the same problem, and those are covered as well. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Reported-by: André Kapelrud Cc: Link: https://lore.kernel.org/r/20220521065325.426-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5ce0b06ae5e69e23142e73c5c3c0260e9f2ccb4b Author: Takashi Iwai Date: Sat May 21 08:46:27 2022 +0200 ALSA: usb-audio: Workaround for clock setup on TEAC devices Maris reported that TEAC UD-501 (0644:8043) doesn't work with the typical "clock source 41 is not valid, cannot use" errors on the recent kernels. The currently known workaround so far is to restore (partially) what we've done unconditionally at the clock setup; namely, re-setup the USB interface immediately after the clock is changed. This patch re-introduces the behavior conditionally for TEAC devices. Further notes: - The USB interface shall be set later in snd_usb_endpoint_configure(), but this seems to be too late. - Even calling usb_set_interface() right after sne_usb_init_sample_rate() doesn't help; so this must be related with the clock validation, too. - The device may still spew the "clock source 41 is not valid" error at the first clock setup. This seems happening at the very first try of clock setup, but it disappears at later attempts. The error is likely harmless because the driver retries the clock setup (such an error is more or less expected on some devices). Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Reported-and-tested-by: Maris Abele Cc: Link: https://lore.kernel.org/r/20220521064627.29292-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 12626530de84d2b00ff6480142f7f4374662c0c3 Author: Kees Cook Date: Fri May 20 09:55:37 2022 -0700 ALSA: lola: Bounds check loop iterator against streams array size GCC 12 sees that it's technically possible for num_streams to be larger than ARRAY_SIZE(pcm->streams). Bounds-check the iterator. ../sound/pci/lola/lola_pcm.c: In function 'lola_pcm_update': ../sound/pci/lola/lola_pcm.c:567:64: warning: array subscript [0, 31] is outside array bounds of 'struct lola_stream[16]' [-Warray-bounds] 567 | struct lola_stream *str = &pcm->streams[i]; | ~~~~~~~~~~~~^~~ In file included from ../sound/pci/lola/lola_pcm.c:15: ../sound/pci/lola/lola.h:307:28: note: while referencing 'streams' 307 | struct lola_stream streams[MAX_STREAM_COUNT]; | ^~~~~~~ Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220520165537.2139826-1-keescook@chromium.org Signed-off-by: Takashi Iwai commit 15ad333269a390b25e61677f18c8461850defcde Merge: 5c62383c06837 353bb6a5f2ac4 Author: Takashi Iwai Date: Sat May 21 08:47:40 2022 +0200 Merge tag 'asoc-fix-v5.18-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fix for v5.17 This is rather late and at this point I'm expecting it to get merged in the merge window rather than as a fix but if we get a -rc8 it's a small, driver specific fix which should be fine to send. commit 238904dd646c60017d75144760510454062bcc8a Author: Wolfram Sang Date: Fri May 20 12:33:25 2022 +0200 i2c: rcar: refactor handling of first message After moving ICMSR handling to interrupt handlers previously to fix a race condition, we can now also move ICMSR handling for the first message out of the function to prepare a message. By introducing a seperate function to initialize the first message, we can not only remove some code duplication but the remaining code is also easier to follow. The function to prepare a message is much simpler without ICMSR handling. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit a0fb48c9bd7e99c1cad6a5d592c0686fbe0d1803 Author: Wolfram Sang Date: Fri May 20 12:33:24 2022 +0200 i2c: rcar: avoid race condition with SMIs A customer experienced a race condition with 'repeated starts' when a System Management Interrupt took over for 30us and more. The problem was that during the SMI a new MAT interrupt came in because we set up the 'repeated start' condition. But the old one was not acknowledged yet. So, when it was acknowledged after the SMI, the new MAT interrupt was lost, confusing the state machine of the driver. The fix consists of two parts. First, we do not clear the status register for 'repeated starts' when preparing the next message anymore. The interrupt handlers for sending and receiving data is now solely responsible for that and it makes the code easier to follow, in fact. Secondly, clearing the status register is now split up to handle MAT interrupts independently. This avoids the race condition because the old MAT interrupt will be now cleared before we initiate the "repeated start" condition. Reported-by: Yoshihiro Shimoda Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 3c9fedf9903108430d36c20ed640069eef032f68 Author: Shubhrajyoti Datta Date: Tue May 17 11:04:52 2022 +0530 i2c: xiic: Correct the datatype for rx_watermark The message length data type should be u16 as per the i2c_msg structure. Signed-off-by: Shubhrajyoti Datta Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 3fe2ec59db1a7569e18594b9c0cf1f4f1afd498e Author: Kuninori Morimoto Date: Fri May 20 11:54:21 2022 +0200 i2c: rcar: fix PM ref counts in probe error paths We have to take care of ID_P_PM_BLOCKED when bailing out during probe. Fixes: 7ee24eb508d6 ("i2c: rcar: disable PM in multi-master mode") Signed-off-by: Kuninori Morimoto Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit e5222d408de2a88e6b206c38217b48d092184553 Author: Tali Perry Date: Tue May 17 18:11:39 2022 +0800 i2c: npcm: Handle spurious interrupts On some platforms in rare cases (1 to 100,000 transactions), the i2c gets a spurious interrupt which means that we enter an interrupt but in the interrupt handler we don't find any status bit that points to the reason we got this interrupt. This may be a case of a rare HW issue or signal integrity issue that is still under investigation. In order to overcome this we are doing the following: 1. Disable incoming interrupts in master mode only when slave mode is not enabled. 2. Clear end of busy (EOB) after every interrupt. 3. Clear other status bits (just in case since we found them cleared) 4. Return correct status during the interrupt that will finish the transaction. On next xmit transaction if the bus is still busy the master will issue a recovery process before issuing the new transaction. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting Signed-off-by: Wolfram Sang commit ea9f8426d17620214ee345ffb77ee6cc196ff14f Author: Tyrone Ting Date: Tue May 17 18:11:38 2022 +0800 i2c: npcm: Correct register access width The SMBnCTL3 register is 8-bit wide and the 32-bit access was always incorrect, but simply didn't cause a visible error on the 32-bit machine. On the 64-bit machine, the kernel message reports that ESR value is 0x96000021. Checking Arm Architecture Reference Manual Armv8 suggests that it's the alignment fault. SMBnCTL3's address is 0xE. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tyrone Ting Reviewed-by: Jonathan Neuschäfer Signed-off-by: Wolfram Sang commit 0bf58eb12f05e2f2ae693977206fef868d9c5dce Author: Tali Perry Date: Tue May 17 18:11:37 2022 +0800 i2c: npcm: Add tx complete counter tx_complete counter is used to indicate successful transaction count. Similar counters for failed tx were previously added. Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting Signed-off-by: Wolfram Sang commit 288b204492fddf28889cea6dc95a23976632c7a0 Author: Tali Perry Date: Tue May 17 18:11:36 2022 +0800 i2c: npcm: Fix timeout calculation Use adap.timeout for timeout calculation instead of hard-coded value of 35ms. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting Signed-off-by: Wolfram Sang commit 94acda59adb91ce6bbd500be5bcb240e4f3bea27 Author: Tali Perry Date: Tue May 17 18:11:35 2022 +0800 i2c: npcm: Remove unused variable clk_regmap Remove unused variable clk_regmap. Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting Reviewed-by: Jonathan Neuschäfer Signed-off-by: Wolfram Sang commit 0585c1d20fc382bab6f1b50919d637d200e4701b Author: Tali Perry Date: Tue May 17 18:11:34 2022 +0800 i2c: npcm: Change the way of getting GCR regmap Change the way of getting NPCM system manager reigster (GCR) and still maintain the old mechanism as a fallback if getting nuvoton,sys-mgr fails while working with the legacy devicetree file. Signed-off-by: Tali Perry Signed-off-by: Tyrone Ting Acked-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit b7fa6242f3e035308a76284560e4f918dad9b017 Author: Christophe JAILLET Date: Fri May 20 23:20:58 2022 +0200 clk: bcm: rpi: Use correct order for the parameters of devm_kcalloc() We should have 'n', then 'size', not the opposite. This is harmless because the 2 values are just multiplied, but having the correct order silence a (unpublished yet) smatch warning. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/49d726d11964ca0e3757bdb5659e3b3eaa1572b5.1653081643.git.christophe.jaillet@wanadoo.fr Signed-off-by: Stephen Boyd commit 83ce0357dcb7fc7270fcb2c5cfea420085b8770e Author: Gabriel Fernandez Date: Mon May 16 09:05:57 2022 +0200 clk: stm32mp13: add safe mux management Some muxes need to set a the safe position when clock is off. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-12-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit ffa2d04d859e99d69d0c89d3dc50067022544354 Author: Gabriel Fernandez Date: Mon May 16 09:05:56 2022 +0200 clk: stm32mp13: add multi mux function Some RCC muxes can manages two output clocks with same register. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-11-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit bfad377983565358c8259e48693331b327535335 Author: Gabriel Fernandez Date: Mon May 16 09:05:55 2022 +0200 clk: stm32mp13: add all STM32MP13 kernel clocks Complete all kernel clocks of stm32mp13. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-10-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit ae0da9a6db8a85f6eed811b2e54df5057df8b343 Author: Gabriel Fernandez Date: Mon May 16 09:05:54 2022 +0200 clk: stm32mp13: add all STM32MP13 peripheral clocks All peripheral clocks are mainly based on stm32_gate clock. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-9-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 93e336c2d6d11c37c22823c7219866e06fd0276b Author: Gabriel Fernandez Date: Mon May 16 09:05:53 2022 +0200 clk: stm32mp13: manage secured clocks Don't register a clock if this clock is secured. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-8-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 5f0d47213f52c0623b3ce662c924575b2ba718ae Author: Gabriel Fernandez Date: Mon May 16 09:05:52 2022 +0200 clk: stm32mp13: add composite clock Just to introduce management of stm32 composite clock. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-7-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 720e34ab3e57e19dba70c384e30494f047999c43 Author: Gabriel Fernandez Date: Mon May 16 09:05:51 2022 +0200 clk: stm32mp13: add stm32 divider clock Just to introduce management of a stm32 divider clock Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-6-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 95f5e0a4c5fc654c9fdfe044e4c692bfead01352 Author: Gabriel Fernandez Date: Mon May 16 09:05:50 2022 +0200 clk: stm32mp13: add stm32_gate management Just to introduce management of a stm32 gate clock. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-5-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit f95cea8308de5ef4075ae4f1f8a72ec275b0d5b5 Author: Gabriel Fernandez Date: Mon May 16 09:05:49 2022 +0200 clk: stm32mp13: add stm32_mux clock management Just to introduce management of a stm32 mux clock. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-4-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 637cee5ffc71698eecf014a794e8d24a213b3c07 Author: Gabriel Fernandez Date: Mon May 16 09:05:48 2022 +0200 clk: stm32: Introduce STM32MP13 RCC drivers (Reset Clock Controller) This driver manages Reset and Clock of STM32MP13 soc. It uses a clk-stm32-core module to manage stm32 gate, mux and divider for STM32MP13 and for new future soc. All gates, muxes, dividers are identify by an index and information are stored in array (register address, shift, with, flags...) This is useful when we have two clocks with the same gate or when one mux manages two output clocks. Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-3-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 722dc8a1d5c8691ab9923b723db4354537206f97 Author: Gabriel Fernandez Date: Mon May 16 09:05:47 2022 +0200 dt-bindings: rcc: stm32: add new compatible for STM32MP13 SoC New compatible to manage clock and reset of STM32MP13 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Gabriel Fernandez Link: https://lore.kernel.org/r/20220516070600.7692-2-gabriel.fernandez@foss.st.com Signed-off-by: Stephen Boyd commit 560a3164c9a3ad0f9c71660f548171e04d89c7fa Author: Jakob Koschel Date: Thu Mar 24 08:10:19 2022 +0100 clk: ti: clkctrl: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324071019.59483-1-jakobkoschel@gmail.com Tested-by: Tony Lindgren Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd commit 37004db2a560d7f0641bc81f0d405b8b9849e797 Author: Len Baker Date: Sat Sep 4 15:17:14 2021 +0200 clk: ti: composite: Prefer kcalloc over open coded arithmetic As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20210904131714.2312-1-len.baker@gmx.com Signed-off-by: Stephen Boyd commit 538101dd7ce360f29effeb45aecb1953bc0fd01b Author: Chanho Park Date: Fri May 20 12:06:25 2022 +0900 dt-bindings: clock: exynosautov9: correct count of NR_CLK _NR_CLKS which can be used to register clocks via nr_clk_ids. The clock IDs are started from 1. So, _NR_CLKS should be defined to "the last clock id + 1" Fixes: 680e1c8370a2 ("dt-bindings: clock: add clock binding definitions for Exynos Auto v9") Signed-off-by: Chanho Park Link: https://lore.kernel.org/r/20220520030625.145324-1-chanho61.park@samsung.com Reviewed-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit c272e259116973b4c2d5c5ae7b6a4181aeeb38c7 Merge: 979497674e636 90a039fd19fc3 Author: Alexei Starovoitov Date: Fri May 20 19:48:29 2022 -0700 Merge branch 'bpf: refine kernel.unprivileged_bpf_disabled behaviour' Alan Maguire says: ==================== Unprivileged BPF disabled (kernel.unprivileged_bpf_disabled >= 1) is the default in most cases now; when set, the BPF system call is blocked for users without CAP_BPF/CAP_SYS_ADMIN. In some cases however, it makes sense to split activities between capability-requiring ones - such as program load/attach - and those that might not require capabilities such as reading perf/ringbuf events, reading or updating BPF map configuration etc. One example of this sort of approach is a service that loads a BPF program, and a user-space program that interacts with it. Here - rather than blocking all BPF syscall commands - unprivileged BPF disabled blocks the key object-creating commands (prog load, map load). Discussion has alluded to this idea in the past [1], and Alexei mentioned it was also discussed at LSF/MM/BPF this year. Changes since v3 [2]: - added acks to patch 1 - CI was failing on Ubuntu; I suspect the issue was an old capability.h file which specified CAP_LAST_CAP as < CAP_BPF, leading to the logic disabling all caps not disabling CAP_BPF. Use CAP_BPF as basis for "all caps" bitmap instead as we explicitly define it in cap_helpers.h if not already found in capabilities.h - made global variables arguments to subtests instead (Andrii, patch 2) Changes since v2 [3]: - added acks from Yonghong - clang compilation issue in selftest with bpf_prog_query() (Alexei, patch 2) - disable all capabilities for test (Yonghong, patch 2) - add assertions that size of perf/ringbuf data matches expectations (Yonghong, patch 2) - add map array size definition, remove unneeded whitespace (Yonghong, patch 2) Changes since RFC [4]: - widened scope of commands unprivileged BPF disabled allows (Alexei, patch 1) - removed restrictions on map types for lookup, update, delete (Alexei, patch 1) - removed kernel CONFIG parameter controlling unprivileged bpf disabled change (Alexei, patch 1) - widened test scope to cover most BPF syscall commands, with positive and negative subtests [1] https://lore.kernel.org/bpf/CAADnVQLTBhCTAx1a_nev7CgMZxv1Bb7ecz1AFRin8tHmjPREJA@mail.gmail.com/ [2] https://lore.kernel.org/bpf/1652880861-27373-1-git-send-email-alan.maguire@oracle.com/T/ [3] https://lore.kernel.org/bpf/1652788780-25520-1-git-send-email-alan.maguire@oracle.com/T/#t [4] https://lore.kernel.org/bpf/20220511163604.5kuczj6jx3ec5qv6@MBP-98dd607d3435.dhcp.thefacebook.com/T/#mae65f35a193279e718f37686da636094d69b96ee ==================== Signed-off-by: Alexei Starovoitov commit 90a039fd19fc35d03a74ce2973992c878546cb20 Author: Alan Maguire Date: Thu May 19 15:25:34 2022 +0100 selftests/bpf: add tests verifying unprivileged bpf behaviour tests load/attach bpf prog with maps, perfbuf and ringbuf, pinning them. Then effective caps are dropped and we verify we can - pick up the pin - create ringbuf/perfbuf - get ringbuf/perfbuf events, carry out map update, lookup and delete - create a link Negative testing also ensures - BPF prog load fails - BPF map create fails - get fd by id fails - get next id fails - query fails - BTF load fails Signed-off-by: Alan Maguire Acked-by: Yonghong Song Link: https://lore.kernel.org/r/1652970334-30510-3-git-send-email-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov commit c8644cd0efe719608ddcb341bcf087d4bc0bf6b8 Author: Alan Maguire Date: Thu May 19 15:25:33 2022 +0100 bpf: refine kernel.unprivileged_bpf_disabled behaviour With unprivileged BPF disabled, all cmds associated with the BPF syscall are blocked to users without CAP_BPF/CAP_SYS_ADMIN. However there are use cases where we may wish to allow interactions with BPF programs without being able to load and attach them. So for example, a process with required capabilities loads/attaches a BPF program, and a process with less capabilities interacts with it; retrieving perf/ring buffer events, modifying map-specified config etc. With all BPF syscall commands blocked as a result of unprivileged BPF being disabled, this mode of interaction becomes impossible for processes without CAP_BPF. As Alexei notes "The bpf ACL model is the same as traditional file's ACL. The creds and ACLs are checked at open(). Then during file's write/read additional checks might be performed. BPF has such functionality already. Different map_creates have capability checks while map_lookup has: map_get_sys_perms(map, f) & FMODE_CAN_READ. In other words it's enough to gate FD-receiving parts of bpf with unprivileged_bpf_disabled sysctl. The rest is handled by availability of FD and access to files in bpffs." So key fd creation syscall commands BPF_PROG_LOAD and BPF_MAP_CREATE are blocked with unprivileged BPF disabled and no CAP_BPF. And as Alexei notes, map creation with unprivileged BPF disabled off blocks creation of maps aside from array, hash and ringbuf maps. Programs responsible for loading and attaching the BPF program can still control access to its pinned representation by restricting permissions on the pin path, as with normal files. Signed-off-by: Alan Maguire Acked-by: Yonghong Song Acked-by: Shung-Hsi Yu Acked-by: KP Singh Link: https://lore.kernel.org/r/1652970334-30510-2-git-send-email-alan.maguire@oracle.com Signed-off-by: Alexei Starovoitov commit 979497674e63666a99fd7d242dba53a5ca5d628b Author: Benjamin Tissoires Date: Wed May 18 22:59:08 2022 +0200 bpf: Allow kfunc in tracing and syscall programs. Tracing and syscall BPF program types are very convenient to add BPF capabilities to subsystem otherwise not BPF capable. When we add kfuncs capabilities to those program types, we can add BPF features to subsystems without having to touch BPF core. Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220518205924.399291-2-benjamin.tissoires@redhat.com Signed-off-by: Alexei Starovoitov commit aa5334b1f96801cd09775217a72ff252ef614d7a Merge: eac67d83bf255 538aaf9b23837 Author: Jakub Kicinski Date: Fri May 20 18:16:31 2022 -0700 Merge branch 'add-a-bhash2-table-hashed-by-port-address' Joanne Koong says: ==================== Add a bhash2 table hashed by port + address This patchset proposes adding a bhash2 table that hashes by port and address. The motivation behind bhash2 is to expedite bind requests in situations where the port has many sockets in its bhash table entry, which makes checking bind conflicts costly especially given that we acquire the table entry spinlock while doing so, which can cause softirq cpu lockups and can prevent new tcp connections. We ran into this problem at Meta where the traffic team binds a large number of IPs to port 443 and the bind() call took a significant amount of time which led to cpu softirq lockups, which caused packet drops and other failures on the machine The patches are as follows: 1/2 - Adds a second bhash table (bhash2) hashed by port and address 2/2 - Adds a test for timing how long an additional bind request takes when the bhash entry is populated When experimentally testing this on a local server for ~24k sockets bound to the port, the results seen were: ipv4: before - 0.002317 seconds with bhash2 - 0.000018 seconds ipv6: before - 0.002431 seconds with bhash2 - 0.000021 seconds ==================== Link: https://lore.kernel.org/r/20220520001834.2247810-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 538aaf9b2383701094a47797b4554c6a21c83eed Author: Joanne Koong Date: Thu May 19 17:18:34 2022 -0700 selftests: Add test for timing a bind request to a port with a populated bhash entry This test populates the bhash table for a given port with MAX_THREADS * MAX_CONNECTIONS sockets, and then times how long a bind request on the port takes. When populating the bhash table, we create the sockets and then bind the sockets to the same address and port (SO_REUSEADDR and SO_REUSEPORT are set). When timing how long a bind on the port takes, we bind on a different address without SO_REUSEPORT set. We do not set SO_REUSEPORT because we are interested in the case where the bind request does not go through the tb->fastreuseport path, which is fragile (eg tb->fastreuseport path does not work if binding with a different uid). To run the test locally, I did: * ulimit -n 65535000 * ip addr add 2001:0db8:0:f101::1 dev eth0 * ./bind_bhash_test 443 Signed-off-by: Joanne Koong Signed-off-by: Jakub Kicinski commit d5a42de8bdbe25081f07b801d8b35f4d75a791f4 Author: Joanne Koong Date: Thu May 19 17:18:33 2022 -0700 net: Add a second bind table hashed by port and address We currently have one tcp bind table (bhash) which hashes by port number only. In the socket bind path, we check for bind conflicts by traversing the specified port's inet_bind2_bucket while holding the bucket's spinlock (see inet_csk_get_port() and inet_csk_bind_conflict()). In instances where there are tons of sockets hashed to the same port at different addresses, checking for a bind conflict is time-intensive and can cause softirq cpu lockups, as well as stops new tcp connections since __inet_inherit_port() also contests for the spinlock. This patch proposes adding a second bind table, bhash2, that hashes by port and ip address. Searching the bhash2 table leads to significantly faster conflict resolution and less time holding the spinlock. Signed-off-by: Joanne Koong Reviewed-by: Eric Dumazet Acked-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit eac67d83bf2553f98cfddd42cfbcfd6f9ccfc287 Author: Jakub Kicinski Date: Thu May 19 23:00:13 2022 -0700 wwan: iosm: use a flexible array rather than allocate short objects GCC array-bounds warns that ipc_coredump_get_list() under-allocates the size of struct iosm_cd_table *cd_table. This is avoidable - we just need a flexible array. Nothing calls sizeof() on struct iosm_cd_list or anything that contains it. Reviewed-by: M Chetan Kumar Link: https://lore.kernel.org/r/20220520060013.2309497-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit eb4c0788964730d12e8dd520bd8f5217ca48321c Author: Yongzhi Liu Date: Thu May 19 05:09:48 2022 -0700 hv_netvsc: Fix potential dereference of NULL pointer The return value of netvsc_devinfo_get() needs to be checked to avoid use of NULL pointer in case of an allocation failure. Fixes: 0efeea5fb153 ("hv_netvsc: Add the support of hibernation") Signed-off-by: Yongzhi Liu Reviewed-by: Haiyang Zhang Link: https://lore.kernel.org/r/1652962188-129281-1-git-send-email-lyz_cs@pku.edu.cn Signed-off-by: Jakub Kicinski commit 29849a486a85f7ab1f3b389db5e3d4948119bef2 Author: Xiu Jianfeng Date: Thu May 19 14:29:32 2022 +0800 stcp: Use memset_after() to zero sctp_stream_out_ext Use memset_after() helper to simplify the code, there is no functional change in this patch. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220519062932.249926-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski commit f7b5a89c66defe87d11240cfdaa8b6cbee5784eb Author: Alaa Mohamed Date: Fri May 20 02:20:40 2022 +0200 net: mscc: fix the alignment in ocelot_port_fdb_del() align the extack argument of the ocelot_port_fdb_del() function. Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220520002040.4442-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Jakub Kicinski commit c2e10f53455c898050738d6a5f8c237f27aec225 Author: Alaa Mohamed Date: Fri May 20 02:36:14 2022 +0200 net: vxlan: Fix kernel coding style The continuation line does not align with the opening bracket and this patch fix it. Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220520003614.6073-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Jakub Kicinski commit dbb2f362c7835660a4e39eadd7481563e2e176b7 Author: Jakub Kicinski Date: Thu May 19 23:19:55 2022 -0700 eth: bnxt: make ulp_id unsigned to make GCC 12 happy GCC array bounds checking complains that ulp_id is validated only against upper bound. Make it unsigned. Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220520061955.2312968-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 5feba47273952918e6563d692d9c5ce35a2165b3 Author: Amit Cohen Date: Thu May 19 10:09:21 2022 +0300 selftests: fib_nexthops: Make ping timeout configurable Commit 49bb39bddad2 ("selftests: fib_nexthops: Make the test more robust") increased the timeout of ping commands to 5 seconds, to make the test more robust. Make the timeout configurable using '-w' argument to allow user to change it depending on the system that runs the test. Some systems suffer from slow forwarding performance, so they may need to change the timeout. Signed-off-by: Amit Cohen Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220519070921.3559701-1-amcohen@nvidia.com Signed-off-by: Jakub Kicinski commit 9ee152ee3ee3568b1a3302f2bb816d5440e6f5f1 Author: Yang Yingliang Date: Thu May 19 11:21:08 2022 +0800 net: wwan: t7xx: use GFP_ATOMIC under spin lock in t7xx_cldma_gpd_set_next_ptr() Sometimes t7xx_cldma_gpd_set_next_ptr() is called under spin lock, so add 'gfp_mask' parameter in t7xx_cldma_gpd_set_next_ptr() to pass the flag. Fixes: 39d439047f1d ("net: wwan: t7xx: Add control DMA interface") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Loic Poulain Link: https://lore.kernel.org/r/20220519032108.2996400-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit ed46b3e1272d6e5c79c8333a60115003035cfbd4 Merge: fe5c5fc145edc fe29794c3585d Author: Jakub Kicinski Date: Fri May 20 17:16:09 2022 -0700 Merge branch 'amt-fix-several-bugs-in-gateway-mode' Taehee Yoo says: ==================== amt: fix several bugs in gateway mode This patchset fixes bugs in amt module. First patch fixes amt gateway mode's status stuck. amt gateway and relay established so these two mode manage status. But gateway stuck to change its own status if a relay doesn't send responses. Second patch fixes a memory leak. amt gateway skips some handling of advertisement message. So, a memory leak would occur. ==================== Link: https://lore.kernel.org/r/20220519031555.3192-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski commit dc2df00af951569689ec39ce0a41b1dff7e3595e Author: Rolf Eike Beer Date: Fri May 20 15:28:21 2022 +0200 net: tulip: fix build with CONFIG_GSC Fix typo which breaks build for parisc. Fixes: 3daebfbeb455 ("net: tulip: convert to devres") Reported-by: Linux Kernel Functional Testing Link: https://lore.kernel.org/all/CA+G9fYuCzU5VZ_nc+6NEdBXJdVCH=J2SB1Na1G_NS_0BNdGYtg@mail.gmail.com/ Reported-by: kernel test robot Signed-off-by: Rolf Eike Beer Link: https://lore.kernel.org/r/4719560.GXAFRqVoOG@eto.sf-tec.de Signed-off-by: Jakub Kicinski commit fe29794c3585d039fefebaa2b5a4932a627ad4fd Author: Taehee Yoo Date: Thu May 19 03:15:55 2022 +0000 amt: fix memory leak for advertisement message When a gateway receives an advertisement message, it extracts relay information and then it should be freed. But the advertisement handler doesn't free it. So, memory leak would occur. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit 937956ba404e70a765ca5aa39d3d7564d86a8872 Author: Taehee Yoo Date: Thu May 19 03:15:54 2022 +0000 amt: fix gateway mode stuck If a gateway can not receive any response to requests from a relay, gateway resets status from SENT_REQUEST to INIT and variable about a relay as well. And then it should start the full establish step from sending a discovery message and receiving advertisement message. But, after failure in amt_req_work() it continues sending a request message step with flushed(invalid) relay information and sets SENT_REQUEST. So, a gateway can't be established with a relay. In order to avoid this situation, it stops sending the request message step if it fails. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Signed-off-by: Taehee Yoo Signed-off-by: Jakub Kicinski commit c09b0cd2cc6c3f91988a20d45fa45c889f72c56c Author: Jakub Kicinski Date: Wed May 18 11:55:22 2022 -0700 net: avoid strange behavior with skb_defer_max == 1 When user sets skb_defer_max to 1 the kick threshold is 0 (half of 1). If we increment queue length before the check the kick will never happen, and the skb may get stranded. This is likely harmless but can be avoided by moving the increment after the check. This way skb_defer_max == 1 will always kick. Still a silly config to have, but somehow that feels more correct. While at it drop a comment which seems to be outdated or confusing, and wrap the defer_count write with a WRITE_ONCE() since it's read on the fast path that avoids taking the lock. Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220518185522.2038683-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fe5c5fc145edcf98a759b895f52b646730eeb7be Author: Jakub Kicinski Date: Wed May 18 17:43:05 2022 -0700 net: stmmac: fix out-of-bounds access in a selftest GCC 12 points out that struct tc_action is smaller than struct tcf_action: drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c: In function ‘stmmac_test_rxp’: drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c:1132:21: warning: array subscript ‘struct tcf_gact[0]’ is partly outside array bounds of ‘unsigned char[272]’ [-Warray-bounds] 1132 | gact->tcf_action = TC_ACT_SHOT; | ^~ Fixes: ccfc639a94f2 ("net: stmmac: selftests: Add a selftest for Flexible RX Parser") Link: https://lore.kernel.org/r/20220519004305.2109708-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit cc398a34d16fd90a2dcc59b1105c634f038ea53b Author: Martin Habets Date: Thu May 19 08:17:15 2022 +0100 sfc/siena: Remove duplicate check on segments Siena only supports software TSO. This means more code can be deleted, as pointed out by the Smatch static checker warning: drivers/net/ethernet/sfc/siena/tx.c:184 __efx_siena_enqueue_skb() warn: duplicate check 'segments' (previous on line 158) Fixes: 956f2d86cb37 ("sfc/siena: Remove build references to missing functionality") Reported-by: Dan Carpenter Link: https://lore.kernel.org/kernel-janitors/YoH5tJMnwuGTrn1Z@kili/ Signed-off-by: Martin Habets Link: https://lore.kernel.org/r/165294463549.23865.4557617334650441347.stgit@palantir17.mph.net Signed-off-by: Jakub Kicinski commit 2dc323b1c4cb8ab7db9f8286a9c3267ce66419ab Author: Mykola Lysenko Date: Thu May 19 23:13:03 2022 -0700 selftests/bpf: Remove filtered subtests from output Currently filtered subtests show up in the output as skipped. Before: $ sudo ./test_progs -t log_fixup/missing_map #94 /1 log_fixup/bad_core_relo_trunc_none:SKIP #94 /2 log_fixup/bad_core_relo_trunc_partial:SKIP #94 /3 log_fixup/bad_core_relo_trunc_full:SKIP #94 /4 log_fixup/bad_core_relo_subprog:SKIP #94 /5 log_fixup/missing_map:OK #94 log_fixup:OK Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED After: $ sudo ./test_progs -t log_fixup/missing_map #94 /5 log_fixup/missing_map:OK #94 log_fixup:OK Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220520061303.4004808-1-mykolal@fb.com commit fa376860658252a4559026496528c5d3a36b52e3 Author: Mykola Lysenko Date: Fri May 20 00:01:44 2022 -0700 selftests/bpf: Fix subtest number formatting in test_progs Remove weird spaces around / while preserving proper indentation Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Acked-by: Daniel Müller Link: https://lore.kernel.org/bpf/20220520070144.10312-1-mykolal@fb.com commit b23316aabffa835ecc516cb81daeef5b9155e8a5 Author: Yuntao Wang Date: Thu May 19 23:06:10 2022 +0800 selftests/bpf: Add missing trampoline program type to trampoline_count test Currently the trampoline_count test doesn't include any fmod_ret bpf programs, fix it to make the test cover all possible trampoline program types. Since fmod_ret bpf programs can't be attached to __set_task_comm function, as it's neither whitelisted for error injection nor a security hook, change it to bpf_modify_return_test. This patch also does some other cleanups such as removing duplicate code, dropping inconsistent comments, etc. Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220519150610.601313-1-ytcoode@gmail.com commit 71081e7ac16c93acdd18afa65daa468620bb1b64 Author: Enzo Matsumiya Date: Wed May 18 11:41:04 2022 -0300 cifs: print TIDs as hex Makes these debug messages easier to read Signed-off-by: Enzo Matsumiya Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 337b8b0e4343567221ef8d88aac5e418208d4ac1 Author: Enzo Matsumiya Date: Wed May 18 11:41:05 2022 -0300 cifs: return ENOENT for DFS lookup_cache_entry() EEXIST didn't make sense to use when dfs_cache_find() couldn't find a cache entry nor retrieve a referral target. It also doesn't make sense cifs_dfs_query_info_nonascii_quirk() to emulate ENOENT anymore. Signed-off-by: Enzo Matsumiya Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 421ef3d56513b2ff02e563623688cb6ab4977c4f Author: Enzo Matsumiya Date: Wed May 18 13:31:55 2022 -0300 cifs: don't call cifs_dfs_query_info_nonascii_quirk() if nodfs was set Also return EOPNOTSUPP if path is remote but nodfs was set. Fixes: a2809d0e1696 ("cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs") Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French commit 96af42c50adb6cee517c355bfd50060ef27bfa87 Merge: 7aa424e02a04b 4f90d034bba9b Author: Andrii Nakryiko Date: Fri May 20 15:29:01 2022 -0700 Merge branch 'bpf: mptcp: Support for mptcp_sock' Mat Martineau says: ==================== This patch set adds BPF access to mptcp_sock structures, along with associated self tests. You may recognize some of the code from earlier (https://lore.kernel.org/bpf/20200918121046.190240-6-nicolas.rybowski@tessares.net/) but it has been reworked quite a bit. v1 -> v2: Emit BTF type, add func_id checks in verifier.c and bpf_trace.c, remove build check for CONFIG_BPF_JIT, add selftest check for CONFIG_MPTCP, and add a patch to include CONFIG_IKCONFIG/CONFIG_IKCONFIG_PROC for the BPF self tests. v2 -> v3: Access sysctl through the filesystem to work around CI use of the more limited busybox sysctl command. v3 -> v4: Dropped special case kernel code for tcp_sock is_mptcp, use existing bpf_tcp_helpers.h, and add check for 'ip mptcp monitor' support. v4 -> v5: Use BPF test skeleton, more consistent use of ASSERT macros, drop some unnecessary parameters / checks, and use tracing to acquire MPTCP token. Geliang Tang (6): bpf: add bpf_skc_to_mptcp_sock_proto selftests/bpf: Enable CONFIG_IKCONFIG_PROC in config selftests/bpf: test bpf_skc_to_mptcp_sock selftests/bpf: verify token of struct mptcp_sock selftests/bpf: verify ca_name of struct mptcp_sock selftests/bpf: verify first of struct mptcp_sock ==================== Signed-off-by: Andrii Nakryiko commit 4f90d034bba9bdcb06a3cb53c43012351c1b39ff Author: Geliang Tang Date: Thu May 19 16:30:16 2022 -0700 selftests/bpf: Verify first of struct mptcp_sock This patch verifies the 'first' struct member of struct mptcp_sock, which points to the first subflow of msk. Save 'sk' in mptcp_storage, and verify it with 'first' in verify_msk(). v5: - Use ASSERT_EQ() instead of a manual comparison + log (Andrii). Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Matthieu Baerts Link: https://lore.kernel.org/bpf/20220519233016.105670-8-mathew.j.martineau@linux.intel.com commit ccc090f469000fd757049028eeb0dff43013f7c1 Author: Geliang Tang Date: Thu May 19 16:30:15 2022 -0700 selftests/bpf: Verify ca_name of struct mptcp_sock This patch verifies another member of struct mptcp_sock, ca_name. Add a new function get_msk_ca_name() to read the sysctl tcp_congestion_control and verify it in verify_msk(). v3: Access the sysctl through the filesystem to avoid compatibility issues with the busybox sysctl command. v4: use ASSERT_* instead of CHECK_FAIL (Andrii) v5: use ASSERT_STRNEQ() instead of strncmp() (Andrii) Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Matthieu Baerts Link: https://lore.kernel.org/bpf/20220519233016.105670-7-mathew.j.martineau@linux.intel.com commit 0266223467728d553b99adea769d9ff3b6e41372 Author: Geliang Tang Date: Thu May 19 16:30:14 2022 -0700 selftests/bpf: Verify token of struct mptcp_sock This patch verifies the struct member token of struct mptcp_sock. Add a new member token in struct mptcp_storage to store the token value of the msk socket got by bpf_skc_to_mptcp_sock(). Trace the kernel function mptcp_pm_new_connection() by using bpf fentry prog to obtain the msk token and save it in a global bpf variable. Pass the variable to verify_msk() to verify it with the token saved in socket_storage_map. v4: - use ASSERT_* instead of CHECK_FAIL (Andrii) - skip the test if 'ip mptcp monitor' is not supported (Mat) v5: - Drop 'ip mptcp monitor', trace mptcp_pm_new_connection instead (Martin) - Use ASSERT_EQ (Andrii) Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Matthieu Baerts Link: https://lore.kernel.org/bpf/20220519233016.105670-6-mathew.j.martineau@linux.intel.com commit 3bc48b56e345e2ed83841dd08a00c6a9f112be6c Author: Geliang Tang Date: Thu May 19 16:30:13 2022 -0700 selftests/bpf: Test bpf_skc_to_mptcp_sock This patch extends the MPTCP test base, to test the new helper bpf_skc_to_mptcp_sock(). Define struct mptcp_sock in bpf_tcp_helpers.h, use bpf_skc_to_mptcp_sock to get the msk socket in progs/mptcp_sock.c and store the infos in socket_storage_map. Get the infos from socket_storage_map in prog_tests/mptcp.c. Add a new function verify_msk() to verify the infos of MPTCP socket, and rename verify_sk() to verify_tsk() to verify TCP socket only. v2: Add CONFIG_MPTCP check for clearer error messages v4: - use ASSERT_* instead of CHECK_FAIL (Andrii) - drop bpf_mptcp_helpers.h (Andrii) v5: - some 'ASSERT_*' were replaced in the next commit by mistake. - Drop CONFIG_MPTCP (Martin) - Use ASSERT_EQ (Andrii) Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Matthieu Baerts Link: https://lore.kernel.org/bpf/20220519233016.105670-5-mathew.j.martineau@linux.intel.com commit 8039d353217c1d9dae921f131cfe4153bc23e960 Author: Nicolas Rybowski Date: Thu May 19 16:30:12 2022 -0700 selftests/bpf: Add MPTCP test base This patch adds a base for MPTCP specific tests. It is currently limited to the is_mptcp field in case of plain TCP connection because there is no easy way to get the subflow sk from a msk in userspace. This implies that we cannot lookup the sk_storage attached to the subflow sk in the sockops program. v4: - add copyright 2022 (Andrii) - use ASSERT_* instead of CHECK_FAIL (Andrii) - drop SEC("version") (Andrii) - use is_mptcp in tcp_sock, instead of bpf_tcp_sock (Martin & Andrii) v5: - Drop connect_to_mptcp_fd (Martin) - Use BPF test skeleton (Andrii) - Use ASSERT_EQ (Andrii) - Drop the 'msg' parameter of verify_sk Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Signed-off-by: Nicolas Rybowski Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Matthieu Baerts Link: https://lore.kernel.org/bpf/20220519233016.105670-4-mathew.j.martineau@linux.intel.com commit d3294cb1e06d70a689924792c2acb897eac7d781 Author: Geliang Tang Date: Thu May 19 16:30:11 2022 -0700 selftests/bpf: Enable CONFIG_IKCONFIG_PROC in config CONFIG_IKCONFIG_PROC is required by BPF selftests, otherwise we get errors like this: libbpf: failed to open system Kconfig libbpf: failed to load object 'kprobe_multi' libbpf: failed to load BPF skeleton 'kprobe_multi': -22 It's because /proc/config.gz is opened in bpf_object__read_kconfig_file() in tools/lib/bpf/libbpf.c: file = gzopen("/proc/config.gz", "r"); So this patch enables CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC in tools/testing/selftests/bpf/config. Suggested-by: Mat Martineau Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220519233016.105670-3-mathew.j.martineau@linux.intel.com commit 3bc253c2e652cf5f12cd8c00d80d8ec55d67d1a7 Author: Geliang Tang Date: Thu May 19 16:30:10 2022 -0700 bpf: Add bpf_skc_to_mptcp_sock_proto This patch implements a new struct bpf_func_proto, named bpf_skc_to_mptcp_sock_proto. Define a new bpf_id BTF_SOCK_TYPE_MPTCP, and a new helper bpf_skc_to_mptcp_sock(), which invokes another new helper bpf_mptcp_sock_from_subflow() in net/mptcp/bpf.c to get struct mptcp_sock from a given subflow socket. v2: Emit BTF type, add func_id checks in verifier.c and bpf_trace.c, remove build check for CONFIG_BPF_JIT v5: Drop EXPORT_SYMBOL (Martin) Co-developed-by: Nicolas Rybowski Co-developed-by: Matthieu Baerts Signed-off-by: Nicolas Rybowski Signed-off-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220519233016.105670-2-mathew.j.martineau@linux.intel.com commit 7aa424e02a04bba5ecc84afe9b58b16e9e0b34f8 Author: Feng Zhou Date: Wed May 18 10:50:53 2022 +0800 selftests/bpf: Fix some bugs in map_lookup_percpu_elem testcase comments from Andrii Nakryiko, details in here: https://lore.kernel.org/lkml/20220511093854.411-1-zhoufeng.zf@bytedance.com/T/ use /* */ instead of // use libbpf_num_possible_cpus() instead of sysconf(_SC_NPROCESSORS_ONLN) use 8 bytes for value size fix memory leak use ASSERT_EQ instead of ASSERT_OK add bpf_loop to fetch values on each possible CPU Fixes: ed7c13776e20c74486b0939a3c1de984c5efb6aa ("selftests/bpf: add test case for bpf_map_lookup_percpu_elem") Signed-off-by: Feng Zhou Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220518025053.20492-1-zhoufeng.zf@bytedance.com commit b2441b3bdce6c02cb96278d98c620d7ba1d41b7b Author: Arnd Bergmann Date: Fri May 20 22:40:56 2022 +0200 h8300: remove stale bindings and symlink These four files are left over from the h8300 removal. Reported-by: Geert Uytterhoeven Reported-by: Uwe Kleine-König Signed-off-by: Arnd Bergmann commit 34e37b4c432cd0f1842b352fde4b8878b4166888 Author: Dan Williams Date: Fri May 20 11:30:15 2022 -0700 cxl/port: Enable HDM Capability after validating DVSEC Ranges CXL memory expanders that support the CXL 2.0 memory device class code include an "HDM Decoder Capability" mechanism to supplant the "CXL DVSEC Range" mechanism originally defined in CXL 1.1. Both mechanisms depend on a "mem_enable" bit being set in configuration space before either mechanism activates. When the HDM Decoder Capability is enabled the CXL DVSEC Range settings are ignored. Previously, the cxl_mem driver was relying on platform-firmware to set "mem_enable". That is an invalid assumption as there is no requirement that platform-firmware sets the bit before the driver sees a device, especially in hot-plug scenarios. Additionally, ACPI-platforms that support CXL 2.0 devices also support the ACPI CEDT (CXL Early Discovery Table). That table outlines the platform permissible address ranges for CXL operation. So, there is a need for the driver to set "mem_enable", and there is information available to determine the validity of the CXL DVSEC Ranges. Arrange for the driver to optionally enable the HDM Decoder Capability if "mem_enable" was not set by platform firmware, or the CXL DVSEC Range configuration was invalid. Be careful to only disable memory decode if the kernel was the one to enable it. In other words, if CXL is backing all of kernel memory at boot the device needs to maintain "mem_enable" and "HDM Decoder enable" all the way up to handoff back to platform firmware (e.g. ACPI S5 state entry may require CXL memory to stay active). Fixes: 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info") Cc: Dan Carpenter [dan: fix early terminiation of range-allowed loop] Cc: Ariel Sibley [ariel: Memory_size must be non-zero] Cc: Jonathan Cameron Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165307136375.2499769.861793697156744166.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 97fa5887cf283bb75ffff5f6b2c0e71794c02400 Author: Monish Kumar R Date: Fri May 20 18:30:44 2022 +0530 USB: new quirk for Dell Gen 2 devices Add USB_QUIRK_NO_LPM and USB_QUIRK_RESET_RESUME quirks for Dell usb gen 2 device to not fail during enumeration. Found this bug on own testing Signed-off-by: Monish Kumar R Cc: stable Link: https://lore.kernel.org/r/20220520130044.17303-1-monish.kumar.r@intel.com Signed-off-by: Greg Kroah-Hartman commit 8cfd16f7223264d3fbaa4737ef67ff2d2621ec9f Merge: 859bdc359567f 33b7af2f459df Author: Greg Kroah-Hartman Date: Fri May 20 21:14:44 2022 +0200 Merge tag 'usb-serial-5.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.19-rc1 Here are the USB-serial updates for 5.19-rc1, including: - a workaround for pl2303 devices with unexpected bcdUSB - a new modem device id Included is also a printk clean up. All but the modem-id commit have been in linux-next with no reported issues. * tag 'usb-serial-5.19-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Quectel BG95 modem USB: serial: pl2303: fix type detection for odd device USB: serial: ftdi_sio: clean up printk format specifier commit cafada1fe932ce761d6c0bc1d56967e27abe4cff Author: Greg Kroah-Hartman Date: Fri May 20 21:07:05 2022 +0200 Revert "speakup: Generate speakupmap.h automatically" This reverts commit 6646b95aab5f62c049f1416a3801dec5432c348b. Stephen reports that it breaks the build for him so revert it for now. Cc: Samuel Thibault Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220520194637.03824f7f@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman commit b90f994a37cc1fc028807007fbf5f1df7d6bf141 Author: Mårten Lindahl Date: Thu Apr 28 16:40:38 2022 +0200 hwmon: (pmbus/ltc2978) Add chip specific write_byte_data Several of the manuals for devices supported by this driver describes the need for a minimum wait time before the chip is ready to receive next command. This wait time is already implemented in the driver as a ltc_wait_ready function with a driver defined wait time of 100 ms, and is considered for specific devices before reading/writing data on the pmbus. Since this driver uses the default pmbus_regulator_ops for the enable/ disable/is_enabled functions we should add a driver specific callback for write_byte_data to prevent bypassing the wait time recommendations for the following devices: ltc3880/ltc3882/ltc3883/ltc3884/ltc3886/ ltc3887/ltc3889/ltm4664/ltm4675/ltm4676/ltm4677/ltm4678/ltm4680/ltm4686/ ltm4700/ltc7880. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20220428144039.2464667-4-marten.lindahl@axis.com Signed-off-by: Guenter Roeck commit f0a5c839766334b09e0f280fa10ff5555f71f825 Author: Mårten Lindahl Date: Thu Apr 28 16:40:37 2022 +0200 hwmon: (pmbus) Use _pmbus_read_byte_data with callback Some of the pmbus core functions uses pmbus_read_byte_data, which does not support driver callbacks for chip specific write operations. This could potentially influence some specific regulator chips that for example need a time delay before each data access. Lets use _pmbus_read_byte_data with callback check. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20220428144039.2464667-3-marten.lindahl@axis.com Signed-off-by: Guenter Roeck commit 5de3e13f7f6b496bd7bd9ff4d2b915b7d3e67cda Author: Mårten Lindahl Date: Thu Apr 28 16:40:36 2022 +0200 hwmon: (pmbus) Introduce and use write_byte_data callback Some of the pmbus core functions uses pmbus_write_byte_data, which does not support driver callbacks for chip specific write operations. This could potentially influence some specific regulator chips that for example need a time delay before each data access. Lets add support for driver callback with _pmbus_write_byte_data. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20220428144039.2464667-2-marten.lindahl@axis.com Signed-off-by: Guenter Roeck commit edd969aa9a268b0c70d2787f258a2b4e271a5fe0 Author: Eugene Shalygin Date: Wed Apr 27 20:02:36 2022 +0200 hwmon: (asus-ec-sensors) add doc entry for PRIME X470-PRO Add PRIME X470-PRO to the list of supported boards. Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220427180237.1475954-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 7cc44e5a45a69274071297579d3e6afeef24cc65 Author: Eugene Shalygin Date: Wed Apr 27 16:30:01 2022 +0200 hwmon: (asus-ec-sensors) add PRIME X470-PRO board This board is supposed to be handled by the asus-wmi-sensors driver, but due to a buggy WMI implementation the driver and the official ASUS software make the BIOS hang together with fan controls [1, 2]. This driver complements values provided by the SIO chip and does not freeze the BIOS, as tested by a user [2]. [1] https://github.com/electrified/asus-wmi-sensors/blob/master/README.md [2] https://github.com/zeule/asus-ec-sensors/issues/12 Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220427143001.1443605-5-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 45934e4af6736dc14c5641e25666b6a6a9d009d9 Author: Eugene Shalygin Date: Wed Apr 27 16:30:00 2022 +0200 hwmon: (asus-ec-sensors) add support for board families DSDT code for AMD 400-series chipset shows that sensor addresses differ for this generation from those for the AMD 500-series boards. Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220427143001.1443605-4-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit de8fbac5e59e239b00cdac611784b1bc1ff53d14 Author: Eugene Shalygin Date: Wed Apr 27 16:29:59 2022 +0200 hwmon: (asus-ec-sensors) implement locking via the ACPI global lock For some board models ASUS uses the global ACPI lock to guard access to the hardware, so do we. Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220427143001.1443605-3-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 5cd29012028d997f46518dae0a8133e0985713f3 Author: Eugene Shalygin Date: Wed Apr 27 16:29:58 2022 +0200 hwmon: (asus-ec-sensors) introduce ec_board_info struct for board data We need to keep some more information about the current board than just the sensors set, and with more boards to add the dmi id array grows quickly. Our probe code is always the same so let's switch to a custom test code and a custom board info array. That allows us to omit board vendor string (ASUS uses two strings that differ in case) in the board info and use case-insensitive comparison, and also do not duplicate sensor definitions for such board variants as " (WI-FI)" when sensors are identical to the base variant. Also saves a quarter of the module size by replacing big dmi_system_id structs with smaller ones. Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220427143001.1443605-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 849b0156d9960da628a06756bb920d9571c15e66 Author: Eddie James Date: Wed Apr 27 09:04:43 2022 -0500 hwmon: (occ) Delay hwmon registration until user request Instead of registering the hwmon device at probe time, use the existing "occ_active" sysfs file to control when the driver polls the OCC for sensor data and registers with hwmon. The reason for this change is that the SBE, which is the device by which the driver communicates with the OCC, cannot handle communications during certain system state transitions, resulting in unrecoverable system errors. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220427140443.11428-1-eajames@linux.ibm.com Signed-off-by: Guenter Roeck commit c3963bc0a0cf9ecb205a9d4976eb92b6df2fa3fd Author: Zev Weiss Date: Tue Apr 26 18:01:53 2022 -0700 hwmon: (nct6775) Split core and platform driver This splits the nct6775 driver into an interface-independent core and a separate platform driver that wraps inb/outb port I/O (or asuswmi methods) around that core. Signed-off-by: Zev Weiss Tested-by: Renze Nicolai Link: https://lore.kernel.org/r/20220427010154.29749-7-zev@bewilderbeest.net Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit ae0d7227741f6791f056f906625ffbd5fe95fb2c Author: Zev Weiss Date: Tue Apr 26 18:01:52 2022 -0700 hwmon: (nct6775) Convert S_I* permissions macros to octal Checkpatch has been warning about these for a while; the octal versions are both more comprehensible and more concise. Signed-off-by: Zev Weiss Link: https://lore.kernel.org/r/20220427010154.29749-6-zev@bewilderbeest.net Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit bd2e82bd4f4839f70c00a480e0133dc9650d7211 Author: Zev Weiss Date: Tue Apr 26 18:01:51 2022 -0700 hwmon: (nct6775) Add read-only mode When enabled, all write bits are removed from the modes of all sysfs attribute files. This provides a bit of infrastructure for the upcoming i2c version of this driver, which should generally avoid writes to device registers so as not to interfere with simultaneous use of the device via the LPC interface. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220427010154.29749-5-zev@bewilderbeest.net Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit 3c7e4935d46803f009e344546e41e777df7537b1 Author: Zev Weiss Date: Tue Apr 26 18:01:50 2022 -0700 hwmon: (nct6775) Rearrange attr-group initialization We now track the number of attribute groups in nct6775_data, as a measure to simplify handling differences in the set of enabled attribute groups between nct6775 drivers (platform & i2c). As a side effect, we also reduce the amount of IS_ERR()/PTR_ERR() boilerplate a bit. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220427010154.29749-4-zev@bewilderbeest.net Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit 4ef2774511dc6e552228bd6c3fefa2e7d41f38b7 Author: Zev Weiss Date: Tue Apr 26 18:01:49 2022 -0700 hwmon: (nct6775) Convert register access to regmap API This replaces the nct6775_data->{read,write}_value function pointers with a regmap. The major difference is that the regmap access functions may fail, and hence require checking at each call site. While the existing WMI register-access code had potential failure paths, they were masked by the fact that the read_value() function returned the register value directly, and hence squashed errors undetectably by simply returning zero, and while the write_value() functions were capable of reporting errors, all callers ignored them. This improves the robustness of the existing code, and also prepares the driver for an i2c version to be added soon, for which register accesses are much more likely to actually fail. The conversion of the register-access call sites is largely mechanical (reading a register now returns the value via an out-param pointer, and returned errors must be checked for and propagated to callers), though the nct6775_write_fan_div() function is refactored slightly to avoid duplicating nearly identical (and now lengthier) code in each switch case. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220427010154.29749-3-zev@bewilderbeest.net Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit 981c5f3c744bbe2e6420a8a834d52c7ed2a75b7f Author: Armin Wolf Date: Tue Apr 26 23:31:54 2022 +0200 hwmon: (dell-smm) Warn if SMM call took a very long time to execute If a particular SMM call takes a very long time to execute, the user might experience audio problems. Print a warning if a particular SMM call took over 0.250 seconds to execute, so the user can check whether or not possible audio problems are caused by this driver. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220426213154.724708-4-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit f44aa665ee9647a204066b287c8fc8c604440425 Author: Armin Wolf Date: Tue Apr 26 23:31:53 2022 +0200 hwmon: (dell-smm) Cleanup init code The default values for i8k_fan_mult and i8k_fan_max should be assigend only if the values specified as module params or in DMI are invalid/missing. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220426213154.724708-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 4fc1a51c8572179abb767f56cbfc433e00e310c1 Author: Armin Wolf Date: Tue Apr 26 23:31:52 2022 +0200 hwmon: (dell-smm) Avoid unnecessary SMM calls during init When the driver tries to detect the fan multiplier during module initialisation, it issues one SMM call for each fan. Those SMM calls are however redundant and also try to query fans which may not be present. Fix that by detecting the fan multiplier during hwmon initialisation when no extra SMM calls are needed. Also dont assume the last nominal speed entry to be the biggest and instead check all entries. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220426213154.724708-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit c851b715d38de0c262a63de16ad954ed39b47aca Author: Peter Rosin Date: Mon Apr 25 22:35:50 2022 +0200 hwmon: (lm75) Add Atmel AT30TS74 support Atmel (now Microchip) AT30TS74 is an LM75 compatible sensor. Add it. Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/9494dfbc-f506-3e94-501d-6760c487c93d@axentia.se Signed-off-by: Guenter Roeck commit be754099e5d400e01b2dc12119208be052e87b1b Author: Peter Rosin Date: Mon Apr 25 22:35:41 2022 +0200 dt-bindings: hwmon: Add Atmel AT30TS74 Document the Atmel (now Microchip) AT30TS74 which is an LM75 based temperature sensor. Acked-by: Rob Herring Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/9c01b1b5-871a-2b34-9f98-766d043e0759@axentia.se Signed-off-by: Guenter Roeck commit 8c099cd381aa36373593d4efc92493c1345c73da Author: Camel Guo Date: Mon Apr 25 12:00:19 2022 +0200 hwmon: (tmp401) Fix incorrect return value of tmp401_init_client When ti,n-factor, ti,beta-compentation are not defined in devicetree, of_property_read_u32|s32 returns -EINVAL. In this case, tmp401_init_client should return 0 instead of simply pass ret to its caller. Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220425100019.562781-1-camel.guo@axis.com Signed-off-by: Guenter Roeck commit e5c498ccc90c87155d1f6980cac050d48b8a84b4 Author: Atif Ofluoglu Date: Fri Apr 15 16:34:29 2022 +0300 hwmon: (pmbus/max16601) Add MAX16602 support Adding another MAX16602 chip support to MAX16601 driver Tested with MAX16602 works as expected. Signed-off-by: Atif Ofluoglu Signed-off-by: Guenter Roeck commit 229b159c505a7ee5da86f952db1e644b213ccb61 Author: Jack Doan Date: Sun Apr 24 00:14:22 2022 -0500 hwmon: (aquacomputer_d5next) Add support for Aquacomputer Farbwerk Extend aquacomputer_d5next driver to expose hardware temperature sensors of the Aquacomputer Farbwerk RGB controller, which communicates through a proprietary USB HID protocol. Four temperature sensors are available. Additionally, serial number and firmware version are exposed through debugfs. Also, add Jack Doan to MAINTAINERS for this driver. Signed-off-by: Jack Doan Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/YmTcrq8Gzel0zYYD@jackdesk Signed-off-by: Guenter Roeck commit c8e5e37a609da0779d601835972a62ebac057e2e Author: Armin Wolf Date: Sun Apr 24 17:48:24 2022 +0200 hwmon: (dell-smm) Update Documentation regarding firmware bugs When adding the Inspiron 3505 to the fan type blacklist, the Documentation was not updated to mention the firmware bug on this machine. Fix that. Fixes: 6ba463edccb9 (hwmon: (dell-smm) Add Inspiron 3505 to fan type blacklist) Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220424154824.9396-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit c7250b5d553cae39bdfcac95ef5bdac6f6a5b022 Author: Oleksandr Shamray Date: Mon Apr 18 15:12:59 2022 +0300 hwmon: (jc42) Add support for S-34TS04A S-34TS04A is a JC42 compatible 2-wire serial EEPROM with temperature sensor from Seiko Instruments/ABLIC. Signed-off-by: Oleksandr Shamray Reviewed-by: Vadim Pasternak Signed-off-by: Guenter Roeck commit bd79021072ac841e73ec5300a4dbfbdeff431582 Author: Camel Guo Date: Thu Apr 14 09:58:23 2022 +0200 hwmon: (tmp401) Add support of three advanced features tmp401 driver supports TMP401, TMP411 and TMP43X temperature sensors. According to their datasheet: - all of them support extended temperature range feature; - TMP411 and TPM43X support n-factor correction feature; - TMP43X support beta compensation feature. In order to support setting them during bootup, this commit reads ti,extended-range-enable, ti,n-factor and ti,beta-compensation and set the corresponding registers during probing. Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220414075824.2634839-3-camel.guo@axis.com Signed-off-by: Guenter Roeck commit bd90c5b939502136ae95005e470914e935a548bc Author: Camel Guo Date: Thu Apr 14 09:58:22 2022 +0200 dt-bindings: hwmon: Add TMP401, TMP411 and TMP43x Document the TMP401, TMP411 and TMP43x device devicetree bindings Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220414075824.2634839-2-camel.guo@axis.com Signed-off-by: Guenter Roeck commit 0616ea3f1b93a99264d84f3d002ae117f6526b62 Merge: d6fc5db0f8282 18f3976fdb5da Author: Catalin Marinas Date: Fri May 20 18:51:54 2022 +0100 Merge branch 'for-next/esr-elx-64-bit' into for-next/core * for-next/esr-elx-64-bit: : Treat ESR_ELx as a 64-bit register. KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high KVM: arm64: Treat ESR_EL2 as a 64-bit register arm64: Treat ESR_ELx as a 64-bit register arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall arm64: Make ESR_ELx_xVC_IMM_MASK compatible with assembly commit d6fc5db0f82828c74742319cb6c988c4a8aac535 Merge: e003d5335c387 9f93c2e0cda49 Author: Catalin Marinas Date: Fri May 20 18:51:15 2022 +0100 Merge branch 'for-next/kselftest' into for-next/core * for-next/kselftest: (32 commits) : arm64 kselftest updates. kselftest/arm64: Explicitly build no BTI tests with BTI disabled kselftest/arm64: bti: force static linking selftests/arm64: Use switch statements in mte_common_util.c selftests/arm64: Remove casts to/from void in check_tags_inclusion selftests/arm64: Check failures to set tags in check_tags_inclusion selftests/arm64: Allow zero tags in mte_switch_mode() selftests/arm64: Log errors in verify_mte_pointer_validity() kselftest/arm64: Fix ABI header directory location selftests/arm64: Fix O= builds for the floating point tests selftests/arm64: Clean the fp helper libraries selftests/arm64: Define top_srcdir for the fp tests selftests/arm64: Use TEST_GEN_PROGS_EXTENDED in the FP Makefile kselftest/arm64: fix array_size.cocci warning selftests/arm64: Add a testcase for handling of ZA on clone() kselftest/arm64: Add SME support to syscall ABI test kselftest/arm64: Add coverage for the ZA ptrace interface kselftest/arm64: Add streaming SVE to SVE ptrace tests kselftest/arm64: signal: Add SME signal handling tests kselftest/arm64: Add stress test for SME ZA context switching kselftest/arm64: signal: Handle ZA signal context in core code ... commit e003d5335c3877bcbee8d0c347d3c3ee36cdd8b7 Merge: 201729d53a349 dffdeade18432 Author: Catalin Marinas Date: Fri May 20 18:50:57 2022 +0100 Merge branch 'for-next/sysreg-gen' into for-next/core * for-next/sysreg-gen: (32 commits) : Automatic system register definition generation. arm64/sysreg: Generate definitions for FAR_ELx arm64/sysreg: Generate definitions for DACR32_EL2 arm64/sysreg: Generate definitions for CSSELR_EL1 arm64/sysreg: Generate definitions for CPACR_ELx arm64/sysreg: Generate definitions for CONTEXTIDR_ELx arm64/sysreg: Generate definitions for CLIDR_EL1 arm64/sve: Generate ZCR definitions arm64/sme: Generate defintions for SVCR arm64/sme: Generate SMPRI_EL1 definitions arm64/sme: Automatically generate SMPRIMAP_EL2 definitions arm64/sme: Automatically generate SMIDR_EL1 defines arm64/sme: Automatically generate defines for SMCR arm64/sysreg: Support generation of RAZ fields arm64/sme: Remove _EL0 from name of SVCR - FIXME sysreg.h arm64/sme: Standardise bitfield names for SVCR arm64/sme: Drop SYS_ from SMIDR_EL1 defines arm64/fp: Rename SVE and SME LEN field name to _WIDTH arm64/fp: Make SVE and SME length register definition match architecture arm64/sysreg: fix odd line spacing arm64/sysreg: improve comment for regs without fields ... commit 201729d53a34924cfcd011f71e49de9bb2902bd8 Merge: c5781212985a7 8e1f78a92101e bd5552bc4807a 18788e34642e2 aea3cb356c964 c4a0ebf87cebb 8f0f104e2ab6e Author: Catalin Marinas Date: Fri May 20 18:50:35 2022 +0100 Merge branches 'for-next/sme', 'for-next/stacktrace', 'for-next/fault-in-subpage', 'for-next/misc', 'for-next/ftrace' and 'for-next/crashkernel', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: perf/arm-cmn: Decode CAL devices properly in debugfs perf/arm-cmn: Fix filter_sel lookup perf/marvell_cn10k: Fix tad_pmu_event_init() to check pmu type first drivers/perf: hisi: Add Support for CPA PMU drivers/perf: hisi: Associate PMUs in SICL with CPUs online drivers/perf: arm_spe: Expose saturating counter to 16-bit perf/arm-cmn: Add CMN-700 support perf/arm-cmn: Refactor occupancy filter selector perf/arm-cmn: Add CMN-650 support dt-bindings: perf: arm-cmn: Add CMN-650 and CMN-700 perf: check return value of armpmu_request_irq() perf: RISC-V: Remove non-kernel-doc ** comments * for-next/sme: (30 commits) : Scalable Matrix Extensions support. arm64/sve: Move sve_free() into SVE code section arm64/sve: Make kernel FPU protection RT friendly arm64/sve: Delay freeing memory in fpsimd_flush_thread() arm64/sme: More sensibly define the size for the ZA register set arm64/sme: Fix NULL check after kzalloc arm64/sme: Add ID_AA64SMFR0_EL1 to __read_sysreg_by_encoding() arm64/sme: Provide Kconfig for SME KVM: arm64: Handle SME host state when running guests KVM: arm64: Trap SME usage in guest KVM: arm64: Hide SME system registers from guests arm64/sme: Save and restore streaming mode over EFI runtime calls arm64/sme: Disable streaming mode and ZA when flushing CPU state arm64/sme: Add ptrace support for ZA arm64/sme: Implement ptrace support for streaming mode SVE registers arm64/sme: Implement ZA signal handling arm64/sme: Implement streaming SVE signal handling arm64/sme: Disable ZA and streaming mode when handling signals arm64/sme: Implement traps and syscall handling for SME arm64/sme: Implement ZA context switching arm64/sme: Implement streaming SVE context switching ... * for-next/stacktrace: : Stacktrace cleanups. arm64: stacktrace: align with common naming arm64: stacktrace: rename stackframe to unwind_state arm64: stacktrace: rename unwinder functions arm64: stacktrace: make struct stackframe private to stacktrace.c arm64: stacktrace: delete PCS comment arm64: stacktrace: remove NULL task check from unwind_frame() * for-next/fault-in-subpage: : btrfs search_ioctl() live-lock fix using fault_in_subpage_writeable(). btrfs: Avoid live-lock in search_ioctl() on hardware with sub-page faults arm64: Add support for user sub-page fault probing mm: Add fault_in_subpage_writeable() to probe at sub-page granularity * for-next/misc: : Miscellaneous patches. arm64: Kconfig.platforms: Add comments arm64: Kconfig: Fix indentation and add comments arm64: mm: avoid writable executable mappings in kexec/hibernate code arm64: lds: move special code sections out of kernel exec segment arm64/hugetlb: Implement arm64 specific huge_ptep_get() arm64/hugetlb: Use ptep_get() to get the pte value of a huge page arm64: mm: Make arch_faults_on_old_pte() check for migratability arm64: mte: Clean up user tag accessors arm64/hugetlb: Drop TLB flush from get_clear_flush() arm64: Declare non global symbols as static arm64: mm: Cleanup useless parameters in zone_sizes_init() arm64: fix types in copy_highpage() arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE arm64: cputype: Avoid overflow using MIDR_IMPLEMENTOR_MASK arm64: document the boot requirements for MTE arm64/mm: Compute PTRS_PER_[PMD|PUD] independently of PTRS_PER_PTE * for-next/ftrace: : ftrace cleanups. arm64/ftrace: Make function graph use ftrace directly ftrace: cleanup ftrace_graph_caller enable and disable * for-next/crashkernel: : Support for crashkernel reservations above ZONE_DMA. arm64: kdump: Do not allocate crash low memory if not needed docs: kdump: Update the crashkernel description for arm64 of: Support more than one crash kernel regions for kexec -s of: fdt: Add memory for devices by DT property "linux,usable-memory-range" arm64: kdump: Reimplement crashkernel=X arm64: Use insert_resource() to simplify code kdump: return -ENOENT if required cmdline option does not exist commit dffdeade18432d257e0c1845dc4e694f414a9721 Author: Mark Brown Date: Fri May 20 17:16:38 2022 +0100 arm64/sysreg: Generate definitions for FAR_ELx Convert FAR_ELx to automatic register generation as per DDI0487H.a. In the architecture these registers have a single field "named" as "Faulting Virtual Address for synchronous exceptions taken to ELx" occupying the entire register, in order to fit in with the requirement to describe the contents of the register I have created a single field named ADDR. No functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit 01baa57ad6865bf60d5fcd77b31b2bd8bb155176 Author: Mark Brown Date: Fri May 20 17:16:37 2022 +0100 arm64/sysreg: Generate definitions for DACR32_EL2 Convert DACR32_EL2 to automatic register generation as per DDI0487H.a, no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8bd354b30533632396627291c4a3792f9c2947b2 Author: Mark Brown Date: Fri May 20 17:16:36 2022 +0100 arm64/sysreg: Generate definitions for CSSELR_EL1 Convert CSSELR_EL1 to automatic generation as per DDI0487H.a, no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit b5c0f1051dc3ba4a4c53fccb6604ecc56b0a2982 Author: Mark Brown Date: Fri May 20 17:16:35 2022 +0100 arm64/sysreg: Generate definitions for CPACR_ELx Convert the CPACR system register definitions to be automatically generated using the definitions in DDI0487H.a. The kernel does have some additional definitions for subfields of SMEN, FPEN and ZEN which are not identified as distinct subfields in the architecture so the definitions are not updated as part of this patch. No functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8c12e22c9f88142630bfadc3685b640aea94a9d5 Author: Mark Brown Date: Fri May 20 17:16:34 2022 +0100 arm64/sysreg: Generate definitions for CONTEXTIDR_ELx Convert the various CONTEXTIDR_ELx register definitions to be automatically generated following the definitions in DDI0487H.a. No functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit af65ea977bb8056b4e12b7057ababf19ab086f67 Author: Mark Brown Date: Fri May 20 17:16:33 2022 +0100 arm64/sysreg: Generate definitions for CLIDR_EL1 Convert CLIDR_EL1 to be automatically generated with definition as per DDI0487H.a. No functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220520161639.324236-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 781121a7f6d11d7cae44982f174ea82adeec7db0 Author: Brian Norris Date: Fri May 6 18:01:06 2022 +0200 clang-format: Fix space after for_each macros Set SpaceBeforeParens to ControlStatementsExceptForEachMacros to not add space between a for_each macro and the following parenthesis. This option is available since clang-format-11 [1] and is in line with the checkpatch.pl rules [2]. I found that this patch has also been sent by Brian Norris some weeks ago [3]. Link: https://clang.llvm.org/docs/ClangFormatStyleOptions.html [1] Link: https://lore.kernel.org/r/8b6b252b-47a6-9d52-f0bd-10d3bc4ad244@digikod.net [2] Link: https://lore.kernel.org/lkml/YmHuZjmP9MxkgJ0R@google.com/ [3] Cc: Miguel Ojeda Cc: Tom Rix Signed-off-by: Brian Norris Co-developed-by: Mickaël Salaün Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506160106.522341-6-mic@digikod.net [Adjusted authorship as agreed] Signed-off-by: Miguel Ojeda commit d7f6604341c748f803810664d5603af22b84a8cc Author: Mickaël Salaün Date: Fri May 6 18:01:04 2022 +0200 clang-format: Fix goto labels indentation Thanks to IndentGotoLabels introduced with clang-format-10 [1], we can avoid goto labels identation. This follows the current coding style and it is then in line with the checkpatch.pl rules [2]. Link: https://clang.llvm.org/docs/ClangFormatStyleOptions.html [1] Link: https://lore.kernel.org/r/8b6b252b-47a6-9d52-f0bd-10d3bc4ad244@digikod.net [2] Cc: Miguel Ojeda Cc: Tom Rix Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506160106.522341-4-mic@digikod.net [Updated header comment to >= 10] Signed-off-by: Miguel Ojeda commit 7869b481025c048ec6ea5b99acb14d057547de80 Author: Zheyu Ma Date: Fri May 20 10:56:24 2022 +0800 gpio: ml-ioh: Convert to use managed functions pcim* and devm_* When removing the module, we will get the following flaw: [ 14.204955] remove_proc_entry: removing non-empty directory 'irq/21', leaking at least 'gpio_ml_ioh' [ 14.205827] WARNING: CPU: 0 PID: 305 at fs/proc/generic.c:717 remove_proc_entry+0x389/0x3f0 ... [ 14.220613] ioh_gpio_remove+0xc5/0xe0 [gpio_ml_ioh] [ 14.221075] pci_device_remove+0x92/0x240 Fix this by using managed functions, this makes the error handling more simpler. Fixes: e971ac9a564a ("gpio: ml-ioh: use resource management for irqs") Signed-off-by: Zheyu Ma Signed-off-by: Bartosz Golaszewski commit f4d84c52643ae1d63a8e73e2585464470e7944d1 Author: Chuck Lever Date: Sun Mar 27 16:46:47 2022 -0400 NFSD: Clean up nfsd_open_verified() Its only caller always passes S_IFREG as the @type parameter. As an additional clean-up, add a kerneldoc comment. Signed-off-by: Chuck Lever commit 1c388f27759c5d9271d4fca081f7ee138986eb7d Author: Chuck Lever Date: Mon Mar 28 15:36:58 2022 -0400 NFSD: Remove do_nfsd_create() Now that its two callers have their own version-specific instance of this function, do_nfsd_create() is no longer used. Signed-off-by: Chuck Lever commit 254454a5aa4a9f696d6bae080c08d5863e650f49 Author: Chuck Lever Date: Mon Mar 28 14:47:34 2022 -0400 NFSD: Refactor NFSv4 OPEN(CREATE) Copy do_nfsd_create() to nfs4proc.c and remove NFSv3-specific logic. Signed-off-by: Chuck Lever commit df9606abddfb01090d5ece7dcc2441d848f690f0 Author: Chuck Lever Date: Mon Mar 28 13:29:23 2022 -0400 NFSD: Refactor NFSv3 CREATE The NFSv3 CREATE and NFSv4 OPEN(CREATE) use cases are about to diverge such that it makes sense to split do_nfsd_create() into one version for NFSv3 and one for NFSv4. As a first step, copy do_nfsd_create() to nfs3proc.c and remove NFSv4-specific logic. One immediate legibility benefit is that the logic for handling NFSv3 createhow is now quite straightforward. NFSv4 createhow has some subtleties that IMO do not belong in generic code. Signed-off-by: Chuck Lever commit 5f46e950c395b9c14c282b53ba78c5fd46d6c256 Author: Chuck Lever Date: Mon Mar 28 16:10:17 2022 -0400 NFSD: Refactor nfsd_create_setattr() I'd like to move do_nfsd_create() out of vfs.c. Therefore nfsd_create_setattr() needs to be made publicly visible. Note that both call sites in vfs.c commit both the new object and its parent directory, so just combine those common metadata commits into nfsd_create_setattr(). Signed-off-by: Chuck Lever commit 14ee45b70dd0d9ae76fb066cd8c0652d657353f6 Author: Chuck Lever Date: Mon Mar 28 10:16:42 2022 -0400 NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create() Clean up: The "out" label already invokes fh_drop_write(). Note that fh_drop_write() is already careful not to invoke mnt_drop_write() if either it has already been done or there is nothing to drop. Therefore no change in behavior is expected. Signed-off-by: Chuck Lever commit e61568599c9ad638fdaba150fee07d7065e31851 Author: Chuck Lever Date: Fri Mar 25 14:47:54 2022 -0400 NFSD: Clean up nfsd3_proc_create() As near as I can tell, mode bit masking and setting S_IFREG is already done by do_nfsd_create() and vfs_create(). The NFSv4 path (do_open_lookup), for example, does not bother with this special processing. Signed-off-by: Chuck Lever commit 19bc59bbeddf07360ef8bceb420f95712977a32f Merge: 83a7a614ce584 9282d0996936c Author: Palmer Dabbelt Date: Fri May 20 10:14:08 2022 -0700 Merge tag 'generic-ticket-spinlocks-v6' into for-next asm-generic: New generic ticket-based spinlock This contains a new ticket-based spinlock that uses only generic atomics and doesn't require as much from the memory system as qspinlock does in order to be fair. It also includes a bit of documentation about the qspinlock and qrwlock fairness requirements. This will soon be used by a handful of architectures that don't meet the qspinlock requirements. * tag 'generic-ticket-spinlocks-v6': csky: Move to generic ticket-spinlock RISC-V: Move to queued RW locks RISC-V: Move to generic spinlocks openrisc: Move to ticket-spinlock asm-generic: qrwlock: Document the spinlock fairness requirements asm-generic: qspinlock: Indicate the use of mixed-size atomics asm-generic: ticket-lock: New generic ticket-based spinlock commit cdb4913293897dde0df522ed5789ba016f3b9157 Merge: 21673fcb2532d 492449ae4f0ad Author: Thomas Gleixner Date: Fri May 20 18:48:54 2022 +0200 Merge tag 'irqchip-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - Add new infrastructure to stop gpiolib from rewriting irq_chip structures behind our back. Convert a few of them, but this will obviously be a long effort. - A bunch of GICv3 improvements, such as using MMIO-based invalidations when possible, and reducing the amount of polling we perform when reconfiguring interrupts. - Another set of GICv3 improvements for the Pseudo-NMI functionality, with a nice cleanup making it easy to reason about the various states we can be in when an NMI fires. - The usual bunch of misc fixes and minor improvements. Link: https://lore.kernel.org/all/20220519165308.998315-1-maz@kernel.org commit dc7769244e03e932262a4f10eeab11657cb601c7 Author: Jakub Kicinski Date: Thu May 19 19:13:47 2022 -0700 tcp_ipv6: set the drop_reason in the right place Looks like the IPv6 version of the patch under Fixes was a copy/paste of the IPv4 but hit the wrong spot. It is tcp_v6_rcv() which uses drop_reason as a boolean, and needs to be protected against reason == 0 before calling free. tcp_v6_do_rcv() has a pretty straightforward flow. The resulting warning looks like this: WARNING: CPU: 1 PID: 0 at net/core/skbuff.c:775 Call Trace: tcp_v6_rcv (net/ipv6/tcp_ipv6.c:1767) ip6_protocol_deliver_rcu (net/ipv6/ip6_input.c:438) ip6_input_finish (include/linux/rcupdate.h:726) ip6_input (include/linux/netfilter.h:307) Fixes: f8319dfd1b3b ("net: tcp: reset 'drop_reason' to NOT_SPCIFIED in tcp_v{4,6}_rcv()") Tested-by: Matthieu Baerts Link: https://lore.kernel.org/r/20220520021347.2270207-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 79025e727a846be6fd215ae9cdb654368ac3f9a6 Author: Jens Axboe Date: Thu May 19 17:31:37 2022 -0600 random: wire up fops->splice_{read,write}_iter() Now that random/urandom is using {read,write}_iter, we can wire it up to using the generic splice handlers. Fixes: 36e2c7421f02 ("fs: don't allow splice read/write without explicit ops") Signed-off-by: Jens Axboe [Jason: added the splice_write path. Note that sendfile() and such still does not work for read, though it does for write, because of a file type restriction in splice_direct_to_actor(), which I'll address separately.] Cc: Al Viro Signed-off-by: Jason A. Donenfeld commit 22b0a222af4df8ee9bb8e07013ab44da9511b047 Author: Jens Axboe Date: Thu May 19 17:43:15 2022 -0600 random: convert to using fops->write_iter() Now that the read side has been converted to fix a regression with splice, convert the write side as well to have some symmetry in the interface used (and help deprecate ->write()). Signed-off-by: Jens Axboe [Jason: cleaned up random_ioctl a bit, require full writes in RNDADDENTROPY since it's crediting entropy, simplify control flow of write_pool(), and incorporate suggestions from Al.] Cc: Al Viro Signed-off-by: Jason A. Donenfeld commit 1b388e7765f2eaa137cf5d92b47ef5925ad83ced Author: Jens Axboe Date: Thu May 19 17:31:36 2022 -0600 random: convert to using fops->read_iter() This is a pre-requisite to wiring up splice() again for the random and urandom drivers. It also allows us to remove the INT_MAX check in getrandom(), because import_single_range() applies capping internally. Signed-off-by: Jens Axboe [Jason: rewrote get_random_bytes_user() to simplify and also incorporate additional suggestions from Al.] Cc: Al Viro Signed-off-by: Jason A. Donenfeld commit 3d593b6e80ad2c911b5645af28d83eabb96e7c1b Author: Fabio Baltieri Date: Thu Apr 28 10:04:19 2022 +0000 pwm: pwm-cros-ec: Add channel type support Add support for EC_PWM_TYPE_DISPLAY_LIGHT and EC_PWM_TYPE_KB_LIGHT pwm types to the PWM cros_ec_pwm driver. This allows specifying one of these PWM channel by functionality, and let the EC firmware pick the correct channel, thus abstracting the hardware implementation from the kernel driver. To use it, define the node with the "google,cros-ec-pwm-type" compatible. Signed-off-by: Fabio Baltieri Reviewed-by: Tzung-Bi Shih Signed-off-by: Thierry Reding commit a48d66d87274b7ec538cdf82abc8d3ebf4bf0363 Author: Fabio Baltieri Date: Thu Apr 28 10:04:20 2022 +0000 dt-bindings: google,cros-ec-pwm: Add the new -type compatible Update google,cros-ec-pwm node documentation to mention the google,cros-ec-pwm-type compatible as a valid alternative. Signed-off-by: Fabio Baltieri Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 84d0940454a3bca6c7c59cf16b6de2f173e81a11 Author: Fabio Baltieri Date: Thu Apr 28 10:04:18 2022 +0000 dt-bindings: Add mfd/cros_ec definitions Add a dt-bindings include file for cros_ec devicetree definition, define a pair of special purpose PWM channels in it. Signed-off-by: Fabio Baltieri Acked-by: Rob Herring Signed-off-by: Thierry Reding commit c71159648c3cf0f7127ddc0bdf3eb4d7885210df Author: Janis Schoetterl-Glausch Date: Thu May 12 15:10:18 2022 +0200 KVM: s390: selftest: Test suppression indication on key prot exception Check that suppression is not indicated on injection of a key checked protection exception caused by a memop after it already modified guest memory, as that violates the definition of suppression. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Christian Borntraeger Link: https://lore.kernel.org/r/20220512131019.2594948-3-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Janosch Frank commit c783631b0bffe6060113ff0aafe5fdbd71bea793 Author: Janis Schoetterl-Glausch Date: Thu May 12 15:10:17 2022 +0200 KVM: s390: Don't indicate suppression on dirtying, failing memop If user space uses a memop to emulate an instruction and that memop fails, the execution of the instruction ends. Instruction execution can end in different ways, one of which is suppression, which requires that the instruction execute like a no-op. A writing memop that spans multiple pages and fails due to key protection may have modified guest memory, as a result, the likely correct ending is termination. Therefore, do not indicate a suppressing instruction ending in this case. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Christian Borntraeger Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20220512131019.2594948-2-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Janosch Frank commit cbac924200b838cfb8d8b1415113d788089dc50b Author: Steffen Eiden Date: Tue May 10 14:47:24 2022 +0000 selftests: drivers/s390x: Add uvdevice tests Adds some selftests to test ioctl error paths of the uv-uapi. The Kconfig S390_UV_UAPI must be selected and the Ultravisor facility must be available. The test can be executed by non-root, however, the uvdevice special file /dev/uv must be accessible for reading and writing which may imply root privileges. ./test-uv-device TAP version 13 1..6 # Starting 6 tests from 3 test cases. # RUN uvio_fixture.att.fault_ioctl_arg ... # OK uvio_fixture.att.fault_ioctl_arg ok 1 uvio_fixture.att.fault_ioctl_arg # RUN uvio_fixture.att.fault_uvio_arg ... # OK uvio_fixture.att.fault_uvio_arg ok 2 uvio_fixture.att.fault_uvio_arg # RUN uvio_fixture.att.inval_ioctl_cb ... # OK uvio_fixture.att.inval_ioctl_cb ok 3 uvio_fixture.att.inval_ioctl_cb # RUN uvio_fixture.att.inval_ioctl_cmd ... # OK uvio_fixture.att.inval_ioctl_cmd ok 4 uvio_fixture.att.inval_ioctl_cmd # RUN attest_fixture.att_inval_request ... # OK attest_fixture.att_inval_request ok 5 attest_fixture.att_inval_request # RUN attest_fixture.att_inval_addr ... # OK attest_fixture.att_inval_addr ok 6 attest_fixture.att_inval_addr # PASSED: 6 / 6 tests passed. # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Steffen Eiden Acked-by: Janosch Frank Message-Id: <20220510144724.3321985-3-seiden@linux.ibm.com> Link: https://lore.kernel.org/kvm/20220510144724.3321985-3-seiden@linux.ibm.com/ Signed-off-by: Janosch Frank commit 4689752c79fa30e91b49b39a9fba93c4d1f3e20c Author: Steffen Eiden Date: Mon May 16 11:33:35 2022 +0000 drivers/s390/char: Add Ultravisor io device This patch adds a new miscdevice to expose some Ultravisor functions to userspace. Userspace can send IOCTLs to the uvdevice that will then emit a corresponding Ultravisor Call and hands the result over to userspace. The uvdevice is available if the Ultravisor Call facility is present. Userspace can call the Retrieve Attestation Measurement Ultravisor Call using IOCTLs on the uvdevice. The uvdevice will do some sanity checks first. Then, copy the request data to kernel space, build the UVCB, perform the UV call, and copy the result back to userspace. Signed-off-by: Steffen Eiden Reviewed-by: Janosch Frank Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/kvm/20220516113335.338212-1-seiden@linux.ibm.com/ Message-Id: <20220516113335.338212-1-seiden@linux.ibm.com> Signed-off-by: Janosch Frank (whitespace and tristate fixes, pick) commit 80a22fde803af6f390be49ee5ced6ee75595ba05 Author: Uwe Kleine-König Date: Tue May 17 17:05:55 2022 +0200 pwm: Document that the pinstate of a disabled PWM isn't reliable Some (most?) drivers emit the inactive state when the PWM is disabled. However there are exceptions, so document that a consumer better doesn't depend on this behaviour. Some known exceptions: - imx27 emits 0 independent of the configured polarity - mxs just drives the output to the last emitted state. - iqs620a makes the output tristated on disable, so an external pull-down would be required. Signed-off-by: Uwe Kleine-König Acked-by: Alexander Stein Signed-off-by: Thierry Reding commit a1bbf823e5e9178ec2f70dd52345fd1a57efe145 Author: Uwe Kleine-König Date: Tue May 17 22:07:09 2022 +0200 pwm: twl-led: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c449a8ca5ea4da2465e7b399ce18e5c5bc824c4f Author: Uwe Kleine-König Date: Sun May 8 11:40:32 2022 +0200 pwm: lpc18xx: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This pushes a variant of pwm_apply_legacy into the driver that was slightly simplified because the .set_polarity callback was a noop. There is no change in behavior. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 758de66f4bd2cac2b1d71db917c65c3d611d4e74 Author: Uwe Kleine-König Date: Sat May 7 10:43:37 2022 +0200 pwm: mediatek: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Thierry Reding commit 5fa3b87fe8fb1ce941c6418539f7b8062c0dea9c Author: Uwe Kleine-König Date: Sat May 7 10:29:01 2022 +0200 pwm: lpc32xx: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit fd3ddd4355c0e5388b40d48321e2e834393a4912 Author: Uwe Kleine-König Date: Fri May 6 18:48:06 2022 +0200 pwm: tegra: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 57c95faabf094192049bffa5599ae6ab5ff88edf Author: Uwe Kleine-König Date: Fri May 6 16:15:35 2022 +0200 pwm: stmpe: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b2e60b32b4fe5da4cf7fedd976416b5f47f62332 Author: Uwe Kleine-König Date: Fri May 6 16:09:52 2022 +0200 pwm: sti: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushed a variant of pwm_apply_legacy() into the driver that was slightly simplified because the driver doesn't provide a .set_polarity() callback. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit cb696e74892b266bd7e03137b5e5c1c4e92bf2ea Author: AngeloGioacchino Del Regno Date: Tue May 3 12:54:04 2022 +0200 pwm: pwm-mediatek: Add support for MediaTek Helio X10 MT6795 The MediaTek Helio X10 MT6795 SoC has 7 PWMs: add a compatible string to use the right match data. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b76160954cb0fc8b4a389e54daf22a87d4f44fbe Author: AngeloGioacchino Del Regno Date: Tue May 3 12:54:05 2022 +0200 dt-bindings: pwm: pwm-mediatek: Add documentation for MT6795 SoC Add binding documentation for the MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 9cf62d91e4b78d8165e68aab3f8041b6bc3a0874 Author: Tetsuo Handa Date: Fri May 6 22:50:13 2022 +0900 RDMA/mlx4: Avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local cm_wq. Link: https://lore.kernel.org/r/22f7183b-cc16-5a34-e879-7605f5efc6e6@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Signed-off-by: Jason Gunthorpe commit 8c193f4714df136a6747fb66f4218134771092be Author: Uwe Kleine-König Date: Mon Apr 25 15:22:44 2022 +0200 pwm: tegra: Optimize period calculation Dividing by the result of a division looses precision because the result is rounded twice. E.g. with clk_rate = 48000000 and period = 32760033 the following numbers result: rate = pc->clk_rate >> PWM_DUTY_WIDTH = 187500 hz = DIV_ROUND_CLOSEST_ULL(100ULL * NSEC_PER_SEC, period_ns) = 3052 rate = DIV_ROUND_CLOSEST_ULL(100ULL * rate, hz) = 6144 The exact result would be 6142.5061875 and (apart from rounding) this is found by using a single division. As a side effect is also a tad cheaper to calculate. Also using clk_rate >> PWM_DUTY_WIDTH looses precision. Consider for example clk_rate = 47999999 and period = 106667: mul_u64_u64_div_u64(pc->clk_rate >> PWM_DUTY_WIDTH, period_ns, NSEC_PER_SEC) = 19 mul_u64_u64_div_u64(pc->clk_rate, period_ns, NSEC_PER_SEC << PWM_DUTY_WIDTH) = 20 (The exact result is 20.000062083332033.) With this optimizations also switch from round-closest to round-down for the period calculation. Given that the calculations were non-optimal for quite some time now with variations in both directions which nobody reported as a problem, this is the opportunity to align the driver's behavior to the requirements of new drivers. This has several upsides: - Implementation is easier as there are no round-nearest variants of mul_u64_u64_div_u64(). - Requests for too small periods are now consistently refused. This was kind of arbitrary before, where period_ns < min_period_ns was refused, but in some cases min_period_ns isn't actually implementable and then values between min_period_ns and the actual minimum were rounded up to the actual minimum. Note that the duty_cycle calculation isn't using the usual round-down approach yet. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 615f4e84461b71e5fed01d9f6d9d98ef3dd1d452 Author: Uwe Kleine-König Date: Wed Apr 20 14:12:40 2022 +0200 pwm: renesas-tpu: Improve precision of period and duty_cycle calculation Dividing by the result of a division looses precision. Consider for example clk_rate = 33000000 and period_ns = 500001. Then clk_rate / (NSEC_PER_SEC / period_ns) has the exact value 16500.033, but in C this evaluates to 16508. It gets worse for even bigger values of period_ns, so with period_ns = 500000001, the exact result is 16500000.033 while in C we get 33000000. For that reason use clk_rate * period_ns / NSEC_PER_SEC instead which doesn't suffer from this problem. To ensure this doesn't overflow add a safeguard check for clk_rate. Note that duty > period can never happen, so the respective check can be dropped. Incidentally this fixes a division by zero if period_ns > NSEC_PER_SEC. Another side effect is that values bigger than INT_MAX for period and duty_cyle are not wrongly discarded any more. Fixes: 99b82abb0a35 ("pwm: Add Renesas TPU PWM driver") Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit 3c173376efc461dc670b02ba2846c2a533491104 Author: Uwe Kleine-König Date: Wed Apr 20 14:12:39 2022 +0200 pwm: renesas-tpu: Improve maths to compute register settings The newly computed register values are intended to exactly match the previously computed values. The main improvement is that the prescaler is computed without a loop that involves two divisions in each step. This uses the fact, that prescalers[i] = 1 << (2 * i). Assuming a moderately smart compiler, the needed number of divisions for the case where the requested period is too big, is reduced from 5 to 2. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit 208ab8676b9c787b4285364fcb52a159f94b861d Author: Uwe Kleine-König Date: Wed Apr 20 14:12:38 2022 +0200 pwm: renesas-tpu: Rename variables to match the usual naming The driver used "pwm" for struct tpu_pwm_device pointers. This name is usually only used for struct pwm_device pointers which this driver calls "_pwm". So rename to the driver data pointers to "tpd" which then allows to drop the underscore from "_pwm". Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit ec00cd5e63f05461ab48128775c73c851c3c2b18 Author: Uwe Kleine-König Date: Wed Apr 20 14:12:37 2022 +0200 pwm: renesas-tpu: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). As pwm->state might not be updated in tpu_pwm_apply() before calling tpu_pwm_config(), an additional parameter is needed for tpu_pwm_config() to not change the implemented logic. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Thierry Reding commit ff4bcd56c0495dd37f9e843a6aa0682abd7fae37 Author: Uwe Kleine-König Date: Wed Apr 20 14:12:36 2022 +0200 pwm: renesas-tpu: Make use of devm functions This simplifies an error path in .probe() and allows to drop the .remove() function. Reviewed-by: Geert Uytterhoeven Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 6eb3af76ade388329a6c87ba41d38000184ae4e8 Author: Uwe Kleine-König Date: Wed Apr 20 14:12:35 2022 +0200 pwm: renesas-tpu: Make use of dev_err_probe() The added benefit is that the error code is mentioned in the error message and its usage is a bit more compact than open coding it. This also improves behaviour in case devm_clk_get() returns -EPROBE_DEFER. While touching this code, consistently start error messages with upper case. Reviewed-by: Geert Uytterhoeven Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e0e14cdff31d326f81e0edbd5140f788c870756c Author: Kan Liang Date: Wed May 18 07:39:00 2022 -0700 perf parse-events: Move slots event for the hybrid platform too The commit 94dbfd6781a0e87b ("perf parse-events: Architecture specific leader override") introduced a feature to reorder the slots event to fulfill the restriction of the perf metrics topdown group. But the feature doesn't work on the hybrid machine. $ perf stat -e "{cpu_core/instructions/,cpu_core/slots/,cpu_core/topdown-retiring/}" -a sleep 1 Performance counter stats for 'system wide': cpu_core/instructions/ cpu_core/slots/ cpu_core/topdown-retiring/ 1.002871801 seconds time elapsed A hybrid platform has a different PMU name for the core PMUs, while current perf hard code the PMU name "cpu". Introduce a new function to check whether the system supports the perf metrics feature. The result is cached for the future usage. For X86, the core PMU name always has "cpu" prefix. With the patch: $ perf stat -e "{cpu_core/instructions/,cpu_core/slots/,cpu_core/topdown-retiring/}" -a sleep 1 Performance counter stats for 'system wide': 76,337,010 cpu_core/slots/ 10,416,809 cpu_core/instructions/ 11,692,372 cpu_core/topdown-retiring/ 1.002805453 seconds time elapsed Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220518143900.1493980-5-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e7d1374ed5cb346efd9b3df03814dbc0767adb4e Author: Kan Liang Date: Wed May 18 07:38:59 2022 -0700 perf parse-events: Support different format of the topdown event name The evsel->name may have a different format for a topdown event, a pure topdown name (e.g., topdown-fe-bound), or a PMU name + a topdown name (e.g., cpu/topdown-fe-bound/). The cpu/topdown-fe-bound/ kind format isn't supported by the arch_evlist__leader(). This format is a very common format for a hybrid platform, which requires specifying the PMU name for each event. Without the patch, $ perf stat -e '{instructions,slots,cpu/topdown-fe-bound/}' -a sleep 1 Performance counter stats for 'system wide': instructions slots cpu/topdown-fe-bound/ 1.003482041 seconds time elapsed Some events weren't counted. Try disabling the NMI watchdog: echo 0 > /proc/sys/kernel/nmi_watchdog perf stat ... echo 1 > /proc/sys/kernel/nmi_watchdog The events in group usually have to be from the same PMU. Try reorganizing the group. With the patch, $ perf stat -e '{instructions,slots,cpu/topdown-fe-bound/}' -a sleep 1 Performance counter stats for 'system wide': 157,383,996 slots 25,011,711 instructions 27,441,686 cpu/topdown-fe-bound/ 1.003530890 seconds time elapsed Fixes: bc355822f0d9623b ("perf parse-events: Move slots only with topdown") Reviewed-by: Ian Rogers Signed-off-by: Kan Liang Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220518143900.1493980-4-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit e8f4f794d7047dd36f090f44f12cd645fba204d2 Author: Kan Liang Date: Wed May 18 07:38:58 2022 -0700 perf stat: Always keep perf metrics topdown events in a group If any member in a group has a different cpu mask than the other members, the current perf stat disables group. when the perf metrics topdown events are part of the group, the below error will be triggered. $ perf stat -e "{slots,topdown-retiring,uncore_imc_free_running_0/dclk/}" -a sleep 1 WARNING: grouped events cpus do not match, disabling group: anon group { slots, topdown-retiring, uncore_imc_free_running_0/dclk/ } Performance counter stats for 'system wide': 141,465,174 slots topdown-retiring 1,605,330,334 uncore_imc_free_running_0/dclk/ The perf metrics topdown events must always be grouped with a slots event as leader. Factor out evsel__remove_from_group() to only remove the regular events from the group. Remove evsel__must_be_in_group(), since no one use it anymore. With the patch, the topdown events aren't broken from the group for the splitting. $ perf stat -e "{slots,topdown-retiring,uncore_imc_free_running_0/dclk/}" -a sleep 1 WARNING: grouped events cpus do not match, disabling group: anon group { slots, topdown-retiring, uncore_imc_free_running_0/dclk/ } Performance counter stats for 'system wide': 346,110,588 slots 124,608,256 topdown-retiring 1,606,869,976 uncore_imc_free_running_0/dclk/ 1.003877592 seconds time elapsed Fixes: a9a1790247bdcf3b ("perf stat: Ensure group is defined on top of the same cpu mask") Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220518143900.1493980-3-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 39d5f412da84784bcc7f39ed49e55376be526fc7 Author: Kan Liang Date: Wed May 18 07:38:57 2022 -0700 perf evsel: Fixes topdown events in a weak group for the hybrid platform The patch ("perf evlist: Keep topdown counters in weak group") fixes the perf metrics topdown event issue when the topdown events are in a weak group on a non-hybrid platform. However, it doesn't work for the hybrid platform. $./perf stat -e '{cpu_core/slots/,cpu_core/topdown-bad-spec/, cpu_core/topdown-be-bound/,cpu_core/topdown-fe-bound/, cpu_core/topdown-retiring/,cpu_core/branch-instructions/, cpu_core/branch-misses/,cpu_core/bus-cycles/,cpu_core/cache-misses/, cpu_core/cache-references/,cpu_core/cpu-cycles/,cpu_core/instructions/, cpu_core/mem-loads/,cpu_core/mem-stores/,cpu_core/ref-cycles/, cpu_core/cache-misses/,cpu_core/cache-references/}:W' -a sleep 1 Performance counter stats for 'system wide': 751,765,068 cpu_core/slots/ (84.07%) cpu_core/topdown-bad-spec/ cpu_core/topdown-be-bound/ cpu_core/topdown-fe-bound/ cpu_core/topdown-retiring/ 12,398,197 cpu_core/branch-instructions/ (84.07%) 1,054,218 cpu_core/branch-misses/ (84.24%) 539,764,637 cpu_core/bus-cycles/ (84.64%) 14,683 cpu_core/cache-misses/ (84.87%) 7,277,809 cpu_core/cache-references/ (77.30%) 222,299,439 cpu_core/cpu-cycles/ (77.28%) 63,661,714 cpu_core/instructions/ (84.85%) 0 cpu_core/mem-loads/ (77.29%) 12,271,725 cpu_core/mem-stores/ (77.30%) 542,241,102 cpu_core/ref-cycles/ (84.85%) 8,854 cpu_core/cache-misses/ (76.71%) 7,179,013 cpu_core/cache-references/ (76.31%) 1.003245250 seconds time elapsed A hybrid platform has a different PMU name for the core PMUs, while the current perf hard code the PMU name "cpu". The evsel->pmu_name can be used to replace the "cpu" to fix the issue. For a hybrid platform, the pmu_name must be non-NULL. Because there are at least two core PMUs. The PMU has to be specified. For a non-hybrid platform, the pmu_name may be NULL. Because there is only one core PMU, "cpu". For a NULL pmu_name, we can safely assume that it is a "cpu" PMU. In case other PMUs also define the "slots" event, checking the PMU type as well. With the patch, $ perf stat -e '{cpu_core/slots/,cpu_core/topdown-bad-spec/, cpu_core/topdown-be-bound/,cpu_core/topdown-fe-bound/, cpu_core/topdown-retiring/,cpu_core/branch-instructions/, cpu_core/branch-misses/,cpu_core/bus-cycles/,cpu_core/cache-misses/, cpu_core/cache-references/,cpu_core/cpu-cycles/,cpu_core/instructions/, cpu_core/mem-loads/,cpu_core/mem-stores/,cpu_core/ref-cycles/, cpu_core/cache-misses/,cpu_core/cache-references/}:W' -a sleep 1 Performance counter stats for 'system wide': 766,620,266 cpu_core/slots/ (84.06%) 73,172,129 cpu_core/topdown-bad-spec/ # 9.5% bad speculation (84.06%) 193,443,341 cpu_core/topdown-be-bound/ # 25.0% backend bound (84.06%) 403,940,929 cpu_core/topdown-fe-bound/ # 52.3% frontend bound (84.06%) 102,070,237 cpu_core/topdown-retiring/ # 13.2% retiring (84.06%) 12,364,429 cpu_core/branch-instructions/ (84.03%) 1,080,124 cpu_core/branch-misses/ (84.24%) 564,120,383 cpu_core/bus-cycles/ (84.65%) 36,979 cpu_core/cache-misses/ (84.86%) 7,298,094 cpu_core/cache-references/ (77.30%) 227,174,372 cpu_core/cpu-cycles/ (77.31%) 63,886,523 cpu_core/instructions/ (84.87%) 0 cpu_core/mem-loads/ (77.31%) 12,208,782 cpu_core/mem-stores/ (77.31%) 566,409,738 cpu_core/ref-cycles/ (84.87%) 23,118 cpu_core/cache-misses/ (76.71%) 7,212,602 cpu_core/cache-references/ (76.29%) 1.003228667 seconds time elapsed Signed-off-by: Kan Liang Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220518143900.1493980-2-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 549f39a58acfe4752c02dc3151df79292de1f3df Author: Tetsuo Handa Date: Thu May 5 15:07:25 2022 +0900 IB/isert: Avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local isert_login_wq. Link: https://lore.kernel.org/r/fbe5e9a8-0110-0c22-b7d6-74d53948d042@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Reviewed-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe commit 7b923e67a4a76b8e0d7f5eb7688e4546fd9954bc Author: Andy Shevchenko Date: Fri May 20 00:26:45 2022 +0300 pinctrl: intel: Fix kernel doc format, i.e. add return sections Kernel doc validator is not happy: pinctrl-intel.c:865: warning: No description found for return value of 'intel_gpio_to_pin' pinctrl-intel.c:904: warning: No description found for return value of 'intel_pin_to_gpio' 2 warnings Add return sections to the kernel documentation of the above mentioned functions. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit daa986d5f8d8871e6691b0fe54375f263c754d04 Author: Uwe Kleine-König Date: Mon Mar 28 09:34:34 2022 +0200 pwm: samsung: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). The size check for state->period is moved to .apply() to make sure that the values of state->duty_cycle and state->period are passed to pwm_samsung_config without change while they are discarded to int. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 762c4e7fce551fbd617ae79e55fc8d9850627b8f Author: Wan Jiabing Date: Fri Apr 8 16:30:07 2022 +0800 pwm: sifive: Simplify if-if to if-else Use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing Signed-off-by: Thierry Reding commit e5cd20e0d6713138444cc3f3f982712cf9a36143 Merge: f7a344468105e 0683532999ab3 Author: Mark Brown Date: Fri May 20 14:56:35 2022 +0100 ASoC: SOF: Introduce generic (in)firmware tracing infrastructure Merge series from Peter Ujfalusi From the kernel point of view there are only few ops that needs to be exposed: Hi, SOF is using dma-trace (or dtrace) as a firmware tracing method, which is only supported with IPC3 and it is not applicable for IPC4. Currently the dtrace is 'open managed' regardless of IPC version (we do force disable it for IPC4, but the dtrace calls remain in place). From the kernel point of view there are only few ops that needs to be exposed by the firmware tracing support and everything else is IPC private, should not be known by the core. This series converts the current dma-trace as ipc3 specific firmware tracing sub-component and moves all private data out from generic code. Regards, Peter --- Peter Ujfalusi (8): ASoC: SOF: Introduce IPC independent ops for firmware tracing support ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation ASoC: SOF: Switch to IPC generic firmware tracing ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to private ASoC: SOF: Modify the host trace_init parameter list to include dmab ASoC: SOF: Introduce opaque storage of private data for firmware tracing ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from sof_dev sound/soc/sof/Makefile | 1 + sound/soc/sof/amd/acp-trace.c | 4 +- sound/soc/sof/amd/acp.h | 2 +- sound/soc/sof/core.c | 13 +- sound/soc/sof/debug.c | 2 +- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-trace.c | 4 +- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/ipc.c | 6 + sound/soc/sof/ipc3-dtrace.c | 649 ++++++++++++++++++++++++++++++++ sound/soc/sof/ipc3-priv.h | 38 ++ sound/soc/sof/ipc3.c | 3 +- sound/soc/sof/ops.c | 2 +- sound/soc/sof/ops.h | 26 -- sound/soc/sof/pm.c | 8 +- sound/soc/sof/sof-priv.h | 53 +-- sound/soc/sof/trace.c | 621 ++---------------------------- 17 files changed, 767 insertions(+), 669 deletions(-) create mode 100644 sound/soc/sof/ipc3-dtrace.c -- 2.36.1 commit af583852d2efcbc76ce68ac8d65126d4b0c65067 Author: Dipen Patel Date: Thu May 12 10:50:11 2022 -0700 dt-bindings: Renamed hte directory to timestamp Renamed hte dt binding directory to timestamp according review comment. Addressed minor comment about having HTE acronym first in the common dt binding document. The change reflects above renaming in MAINTAINERS files too. Signed-off-by: Dipen Patel Reviewed-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 348b10b075f35828a21bf928edf7f6b1737b1840 Author: Dan Carpenter Date: Fri May 6 17:54:31 2022 +0300 hte: Uninitialized variable in hte_ts_get() The "free_name" variable is sometimes used without being initialized. Fixes: 31ab09b42188 ("drivers: Add hardware timestamp engine (HTE) subsystem") Signed-off-by: Dan Carpenter Acked-by: Dipen Patel Signed-off-by: Thierry Reding commit 8ad9f577551f5d5cfbac1ac6b4e85c026ceb024e Merge: da14f237ceef0 78288665b5d01 Author: Jens Axboe Date: Fri May 20 06:56:32 2022 -0600 Merge tag 'nvme-5.19-2022-05-19' of git://git.infradead.org/nvme into for-5.19/drivers Pull NVMe updates from Christoph: "nvme updates for Linux 5.19 - set non-mdts limits in nvme_scan_work (Chaitanya Kulkarni) - add support for TP4084 - Time-to-Ready Enhancements (me)" * tag 'nvme-5.19-2022-05-19' of git://git.infradead.org/nvme: nvme: set non-mdts limits in nvme_scan_work nvme: add support for TP4084 - Time-to-Ready Enhancements commit f7a344468105ef8c54086dfdc800e6f5a8417d3e Author: Alexey Khoroshilov Date: Fri May 20 01:31:26 2022 +0300 ASoC: max98090: Move check for invalid values before casting in max98090_put_enab_tlv() Validation of signed input should be done before casting to unsigned int. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Suggested-by: Mark Brown Fixes: 2fbe467bcbfc ("ASoC: max98090: Reject invalid values in custom control put()") Link: https://lore.kernel.org/r/1652999486-29653-1-git-send-email-khoroshilov@ispras.ru Signed-off-by: Mark Brown commit affa9983e7cbac8cbe2596975efacdbdf0eb18e9 Author: Shuming Fan Date: Fri May 20 17:02:05 2022 +0800 ASoC: rt1308-sdw: add the default value of register 0xc320 The driver missed the default value of register 0xc320. This patch adds that default value to avoid the error messages when the driver went to suspend mode already. BugLink: https://github.com/thesofproject/linux/issues/3651 Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20220520090205.25857-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 58e5bdeb9c2b06895e723c0b1e670f54510ff782 Author: Kanchan Joshi Date: Fri May 20 14:36:30 2022 +0530 nvme: enable uring-passthrough for admin commands Add two new opcodes that userspace can use for admin commands: NVME_URING_CMD_ADMIN : non-vectroed NVME_URING_CMD_ADMIN_VEC : vectored variant Wire up support when these are issued on controller node(/dev/nvmeX). Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220520090630.70394-3-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 00fc2eeb15acc7f7e8713edc6d4d9855936226cb Author: Kanchan Joshi Date: Fri May 20 14:36:29 2022 +0530 nvme: helper for uring-passthrough checks Factor out a helper consolidating the error checks, and fix typo in a comment too. This is in preparation to support admin commands on this path. Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220520090630.70394-2-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 96232c7d4f847a5e597177236159e6b32ccf60e4 Author: Mickaël Salaün Date: Fri May 6 18:01:03 2022 +0200 clang-format: Update to clang-format >= 6 We get new interesting formating with clang-format greater or equal to 6 as stated in the removed comments. Miguel Ojeda suggested to even move the minimal clang-format version to 11, which is the minimum LLVM supported at the moment [1]. Automatically updated with: sed -i 's/^\(\s*\)#\(\S*\s\+\S*\) # Unknown to clang-format.*/\1\2/' .clang-format Link: https://lore.kernel.org/r/CANiq72nLOfmEt-CZBmm2ouEB_x6Jm9ggDVFCVJxYxKw7O0LTzQ@mail.gmail.com [1] Cc: Miguel Ojeda Cc: Tom Rix Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506160106.522341-3-mic@digikod.net Signed-off-by: Miguel Ojeda commit 49bb63a2616a54eac998c1e7e2dc6679a8c2e772 Author: Mickaël Salaün Date: Fri May 6 18:01:02 2022 +0200 clang-format: Extend the for_each list with tools/ Add tools/ to the shell fragment generating the for_each list and update it. This is useful to format files in the tools directory (e.g. selftests) with the same coding style as the kernel. Cc: Miguel Ojeda Cc: Tom Rix Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220506160106.522341-2-mic@digikod.net [Reworded and rebased on top of previous commits] Signed-off-by: Miguel Ojeda commit 6c38ca03406edf905c7b66ffdc8e9ea6d09b2b44 Author: Chris Morgan Date: Thu May 19 11:17:31 2022 -0500 dt-bindings: mfd: rk808: Convert bindings to yaml Convert the rk808 bindings into yaml format. clock-output-names varies in maxItems depending on whether or not the clock-cells is 0 or 1. For the rk805, rk809, and rk817. This preserves behavior with the existing driver handling setting the clock for these specific PMICs. When this driver is corrected and the devicetrees updated this logic can be removed (since the rk805, rk808, and rk817 only have one actual clock). Note this patch was previously sent as a series, all of the patches in the series except this one have been committed to mainline. Signed-off-by: Chris Morgan Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220519161731.1168-1-macroalpha82@gmail.com commit 72e14aa9f884807e7059254a0373929b09ab56ad Author: Miguel Ojeda Date: Fri May 20 14:06:51 2022 +0200 clang-format: Simplify command with `sort -u` Signed-off-by: Miguel Ojeda commit 43120879191cb3b13e30e3fadd424bc5bbcf7846 Author: Miguel Ojeda Date: Fri May 20 13:53:07 2022 +0200 clang-format: Use POSIX locale for `sort` This avoids differences when different people run the command, which is relevant for our use case, e.g.: $ LC_ALL=en_US.UTF-8 sort test ata_for_each_link __ata_qc_for_each ata_qc_for_each $ LC_ALL=C sort test __ata_qc_for_each ata_for_each_link ata_qc_for_each Link: https://lore.kernel.org/lkml/CANiq72=7=ZpAObWRmposOmnyZ8XR_eNHCBtA3bu3fusmcPUwDA@mail.gmail.com/ Signed-off-by: Miguel Ojeda commit 2c51d0d88020b4d3c9bbe7d9df2796b2c2ce05b8 Merge: e6828be5edcfe 6a2277a0ebe71 Author: Miquel Raynal Date: Fri May 20 13:59:25 2022 +0200 Merge tag 'nand/for-5.19' into mtd/next NAND core: * Print offset instead of page number for bad blocks Raw NAND controller drivers: * Cadence: Fix possible null-ptr-deref in cadence_nand_dt_probe() * CS553X: simplify the return expression of cs553x_write_ctrl_byte() * Davinci: Remove redundant unsigned comparison to zero * Denali: Use managed device resources * GPMI: - Add large oob bch setting support - Rename the variable ecc_chunk_size - Uninline the gpmi_check_ecc function - Add strict ecc strength check - Refactor BCH geometry settings function * Intel: Fix possible null-ptr-deref in ebu_nand_probe() * MPC5121: Check before clk_disable_unprepare() not needed * Mtk: - MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK - Also parse the default nand-ecc-engine property if available - Make mtk_ecc.c a separated module * OMAP ELM: - Convert the bindings to yaml - Describe the bindings for AM64 ELM - Add support for its compatible * Renesas: Use runtime PM instead of the raw clock API and update the bindings accordingly * Rockchip: Check before clk_disable_unprepare() not needed * TMIO: Check return value after calling platform_get_resource() Raw NAND chip driver: * Kioxia: Add support for TH58NVG3S0HBAI4 and TC58NVG0S3HTA00 SPI-NAND chip drivers: * Gigadevice: - Add support for: - GD5FxGM7xExxG - GD5F{2,4}GQ5xExxG - GD5F1GQ5RExxG - GD5FxGQ4xExxG - Fix Quad IO for GD5F1GQ5UExxG * XTX: Add support for XT26G0xA Signed-off-by: Miquel Raynal commit e6828be5edcfea25cd70a2d1de41085c67ef9fa5 Merge: 1fefc8ecb834c c47452194641b Author: Miquel Raynal Date: Fri May 20 13:58:54 2022 +0200 Merge tag 'spi-nor/for-5.19' into mtd/next SPI NOR core changes: - Read back written SR value to make sure the write was done correctly. - Introduce a common function for Read ID that manufacturer drivers can use to verify the Octal DTR switch worked correctly. - Add helpers for read/write any register commands so manufacturer drivers don't open code it every time. - Clarify rdsr dummy cycles documentation. - Add debugfs entry to expose internal flash parameters and state. SPI NOR manufacturer drivers changes: - Add support for Winbond W25Q512NW-IM, and Eon EN25QH256A. - Move spi_nor_write_ear() to Winbond module since only Winbond flashes use it. - Rework Micron and Cypress Octal DTR enable methods to improve readability. - Use the common Read ID function to verify switch to Octal DTR mode for Micron and Cypress flashes. - Skip polling status on volatile register writes for Micron and Cypress flashes since the operation is instant. Signed-off-by: Miquel Raynal commit 882178947bcae5b5b3a1782fe80095c60276c399 Author: Miguel Ojeda Date: Fri May 20 13:47:23 2022 +0200 clang-format: Update with v5.18-rc7's `for_each` macro list Re-run the shell fragment that generated the original list. This brings it up to date, so that the next patches that tweak it further are more clear on what they change. Signed-off-by: Miguel Ojeda commit b6f21d14f1ac1261579b691673a0c823275cbaf8 Author: Chen Zhongjin Date: Fri May 20 08:49:55 2022 +0100 ARM: 9204/2: module: Add all unwind tables when load module For EABI stack unwinding, when loading .ko module the EXIDX sections will be added to a unwind_table list. However not all EXIDX sections are added because EXIDX sections are searched by hardcoded section names. For functions in other sections such as .ref.text or .kprobes.text, gcc generates seprated EXIDX sections (such as .ARM.exidx.ref.text or .ARM.exidx.kprobes.text). These extra EXIDX sections are not loaded, so when unwinding functions in these sections, we will failed with: unwind: Index not found xxx To fix that, I refactor the code for searching and adding EXIDX sections: - Check section type to search EXIDX tables (0x70000001) instead of strcmp() the hardcoded names. Then find the corresponding text sections by their section names. - Add a unwind_table list in module->arch to save their own unwind_table instead of the fixed-lenth array. - Save .ARM.exidx.init.text section ptr, because it should be cleaned after module init. Now all EXIDX sections of .ko can be added correctly. Signed-off-by: Chen Zhongjin Acked-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 8294fec1cab7ae6153525eb68401ed5905921371 Author: Nick Hawkins Date: Wed May 18 14:38:37 2022 +0100 ARM: 9206/1: A9: Add ARM ERRATA 764319 workaround (Updated) Enable the workaround for the 764319 Cortex A-9 erratum. CP14 read accesses to the DBGPRSR and DBGOSLSR registers generate an unexpected Undefined Instruction exception when the DBGSWENABLE external pin is set to 0, even when the CP14 accesses are performed from a privileged mode. The work around catches the exception in a way the kernel does not stop execution with the use of undef_hook. This has been found to effect the HPE GXP SoC. Signed-off-by: Nick Hawkins Reviewed-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit ad12c2f1587c6ec9b52ff226f438955bfae6ad89 Author: Ard Biesheuvel Date: Wed Apr 20 10:06:50 2022 +0100 ARM: 9201/1: spectre-bhb: rely on linker to emit cross-section literal loads The assembler does not permit 'LDR PC, ' when the symbol lives in a different section, which is why we have been relying on rather fragile open-coded arithmetic to load the address of the vector_swi routine into the program counter using a single LDR instruction in the SWI slot in the vector table. The literal was moved to a different section to in commit 19accfd373847 ("ARM: move vector stubs") to ensure that the vector stubs page does not need to be mapped readable for user space, which is the case for the vector page itself, as it carries the kuser helpers as well. So the cross-section literal load is open-coded, and this relies on the address of vector_swi to be at the very start of the vector stubs page, and we won't notice if we got it wrong until booting the kernel and see it break. Fortunately, it was guaranteed to break, so this was fragile but not problematic. Now that we have added two other variants of the vector table, we have 3 occurrences of the same trick, and so the size of our ISA/compiler/CPU validation space has tripled, in a way that may cause regressions to only be observed once booting the image in question on a CPU that exercises a particular vector table. So let's switch to true cross section references, and let the linker fix them up like it fixes up all the other cross section references in the vector page. Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 1290c70d72b2959ba0a4e029edfcb7afa62a5c73 Author: Ard Biesheuvel Date: Wed Apr 20 10:02:43 2022 +0100 ARM: 9200/1: spectre-bhb: avoid cross-subsection jump using a numbered label In order to minimize potential confusion regarding numbered labels appearing in a different order in the assembler output due to the use of subsections, use a named local label to jump back into the vector handler code from the associated loop8 mitigation sequence. Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 892c608a7d7380b9a7c8f0d6aab99b763fd6fd3f Author: Ard Biesheuvel Date: Wed Apr 20 09:57:45 2022 +0100 ARM: 9199/1: spectre-bhb: use local DSB and elide ISB in loop8 sequence The loop8 mitigation for Spectre-BHB only requires a CPU local DSB rather than a systemwide one, which is much more costly. And by the same reasoning as why it is justified to omit the ISB after BPIALL, we can also elide the ISB and rely on the exception return for the context synchronization. Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit c4f486f1e7b34b27ec578494a236061b337d50ae Author: Ard Biesheuvel Date: Wed Apr 20 09:55:35 2022 +0100 ARM: 9198/1: spectre-bhb: simplify BPIALL vector macro The BPIALL mitigation for Spectre-BHB adds a single instruction to the handler sequence that doesn't clobber any registers. Given that these sequences are 10 instructions long, they don't fit neatly into a cacheline anyway, so we can simply move that single instruction to the start of the unmitigated one, and rearrange the symbol names accordingly. Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 508074607c7b95b24f0adf633fdf606761bb7824 Author: Ard Biesheuvel Date: Wed Apr 20 09:41:31 2022 +0100 ARM: 9195/1: entry: avoid explicit literal loads ARMv7 has MOVW/MOVT instruction pairs to load symbol addresses into registers without having to rely on literal loads that go via the D-cache. For older cores, we now support a similar arrangement, based on PC-relative group relocations. This means we can elide most literal loads entirely from the entry path, by switching to the ldr_va macro to emit the appropriate sequence depending on the target architecture revision. While at it, switch to the bl_r macro for invoking the right PABT/DABT helpers instead of setting the LR register explicitly, which does not play well with cores that speculate across function returns. Signed-off-by: Ard Biesheuvel Reviewed-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 952f03316352c606bebef56ba8f9642edbb8e348 Author: Ard Biesheuvel Date: Wed Apr 20 09:38:27 2022 +0100 ARM: 9194/1: assembler: simplify ldr_this_cpu for !SMP builds When CONFIG_SMP is not defined, the CPU offset is always zero, and so we can simplify the sequence to load a per-CPU variable. Signed-off-by: Ard Biesheuvel Reviewed-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 7719a68b2fa404fa8af6b0b7119a38c406c74858 Author: Wang Kefeng Date: Mon Apr 18 07:07:14 2022 +0100 ARM: 9192/1: amba: fix memory leak in amba_device_try_add() If amba_device_try_add() return error code (not EPROBE_DEFER), memory leak occurred when amba device fails to read periphid. unreferenced object 0xc1c60800 (size 1024): comm "swapper/0", pid 1, jiffies 4294937333 (age 75.200s) hex dump (first 32 bytes): 40 40 db c1 04 08 c6 c1 04 08 c6 c1 00 00 00 00 @@.............. 00 d9 c1 c1 84 6f 38 c1 00 00 00 00 01 00 00 00 .....o8......... backtrace: [<(ptrval)>] kmem_cache_alloc_trace+0x168/0x2b4 [<(ptrval)>] amba_device_alloc+0x38/0x7c [<(ptrval)>] of_platform_bus_create+0x2f4/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_populate+0x70/0xc4 [<(ptrval)>] of_platform_default_populate_init+0xb4/0xcc [<(ptrval)>] do_one_initcall+0x58/0x218 [<(ptrval)>] kernel_init_freeable+0x250/0x29c [<(ptrval)>] kernel_init+0x24/0x148 [<(ptrval)>] ret_from_fork+0x14/0x1c [<00000000>] 0x0 unreferenced object 0xc1db4040 (size 64): comm "swapper/0", pid 1, jiffies 4294937333 (age 75.200s) hex dump (first 32 bytes): 31 63 30 66 30 30 30 30 2e 77 64 74 00 00 00 00 1c0f0000.wdt.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<(ptrval)>] __kmalloc_track_caller+0x19c/0x2f8 [<(ptrval)>] kvasprintf+0x60/0xcc [<(ptrval)>] kvasprintf_const+0x54/0x78 [<(ptrval)>] kobject_set_name_vargs+0x34/0xa8 [<(ptrval)>] dev_set_name+0x40/0x5c [<(ptrval)>] of_device_make_bus_id+0x128/0x1f8 [<(ptrval)>] of_platform_bus_create+0x4dc/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_bus_create+0x380/0x4e8 [<(ptrval)>] of_platform_populate+0x70/0xc4 [<(ptrval)>] of_platform_default_populate_init+0xb4/0xcc [<(ptrval)>] do_one_initcall+0x58/0x218 [<(ptrval)>] kernel_init_freeable+0x250/0x29c [<(ptrval)>] kernel_init+0x24/0x148 [<(ptrval)>] ret_from_fork+0x14/0x1c Fix them by adding amba_device_put() to release device name and amba device. Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 1f44de0f5e309e8699b569b49a8e89ef4e7527c7 Author: Wang Kefeng Date: Mon Apr 18 07:07:13 2022 +0100 ARM: 9193/1: amba: Add amba_read_periphid() helper Add new amba_read_periphid() helper to simplify error handling. Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit b4ce6dd4de3f75f6ee1751148198beaf4e37bedb Merge: bb94bb86286b3 3a054f90e9550 Author: Mark Brown Date: Fri May 20 12:17:53 2022 +0100 ASoC: SOF: mediatek: add debug dump Merge series from Pierre-Louis Bossart : Add the ability to generate debug dumps on MediaTek SOF implementations. commit bb94bb86286b3560ebb539a84b299ca03141940f Merge: 80b949f332e33 b390c25c6757b Author: Mark Brown Date: Fri May 20 12:17:51 2022 +0100 ASoC: remove two unnecessary gpiolib dependencies Merge series from Pierre-Louis Bossart : Remove two dependencies - issues reported by Intel kernel test bot. commit c796f02162e428b595ff70196dca161ee46b163b Author: Peter Zijlstra Date: Fri May 20 10:38:39 2022 +0200 x86/tdx: Fix RETs in TDX asm Because build-testing is over-rated, fix a few trivial objtool complaints: vmlinux.o: warning: objtool: __tdx_module_call+0x3e: missing int3 after ret vmlinux.o: warning: objtool: __tdx_hypercall+0x6e: missing int3 after ret Fixes: eb94f1b6a70a ("x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220520083839.GR2578@worktop.programming.kicks-ass.net commit 22682a07acc308ef78681572e19502ce8893c4d4 Author: Mikulas Patocka Date: Mon May 16 11:06:36 2022 -0400 objtool: Fix objtool regression on x32 systems Commit c087c6e7b551 ("objtool: Fix type of reloc::addend") failed to appreciate cross building from ILP32 hosts, where 'int' == 'long' and the issue persists. As such, use s64/int64_t/Elf64_Sxword for this field and suffer the pain that is ISO C99 printf formats for it. Fixes: c087c6e7b551 ("objtool: Fix type of reloc::addend") Signed-off-by: Mikulas Patocka [peterz: reword changelog, s/long long/s64/] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Cc: Link: https://lkml.kernel.org/r/alpine.LRH.2.02.2205161041260.11556@file01.intranet.prod.int.rdu2.redhat.com commit ead165fa1042247b033afad7be4be9b815d04ade Author: Peter Zijlstra Date: Tue May 17 17:42:04 2022 +0200 objtool: Fix symbol creation Nathan reported objtool failing with the following messages: warning: objtool: no non-local symbols !? warning: objtool: gelf_update_symshndx: invalid section index The problem is due to commit 4abff6d48dbc ("objtool: Fix code relocs vs weak symbols") failing to consider the case where an object would have no non-local symbols. The problem that commit tries to address is adding a STB_LOCAL symbol to the symbol table in light of the ELF spec's requirement that: In each symbol table, all symbols with STB_LOCAL binding preced the weak and global symbols. As ``Sections'' above describes, a symbol table section's sh_info section header member holds the symbol table index for the first non-local symbol. The approach taken is to find this first non-local symbol, move that to the end and then re-use the freed spot to insert a new local symbol and increment sh_info. Except it never considered the case of object files without global symbols and got a whole bunch of details wrong -- so many in fact that it is a wonder it ever worked :/ Specifically: - It failed to re-hash the symbol on the new index, so a subsequent find_symbol_by_index() would not find it at the new location and a query for the old location would now return a non-deterministic choice between the old and new symbol. - It failed to appreciate that the GElf wrappers are not a valid disk format (it works because GElf is basically Elf64 and we only support x86_64 atm.) - It failed to fully appreciate how horrible the libelf API really is and got the gelf_update_symshndx() call pretty much completely wrong; with the direct consequence that if inserting a second STB_LOCAL symbol would require moving the same STB_GLOBAL symbol again it would completely come unstuck. Write a new elf_update_symbol() function that wraps all the magic required to update or create a new symbol at a given index. Specifically, gelf_update_sym*() require an @ndx argument that is relative to the @data argument; this means you have to manually iterate the section data descriptor list and update @ndx. Fixes: 4abff6d48dbc ("objtool: Fix code relocs vs weak symbols") Reported-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Acked-by: Josh Poimboeuf Tested-by: Nathan Chancellor Cc: Link: https://lkml.kernel.org/r/YoPCTEYjoPqE4ZxB@hirez.programming.kicks-ass.net commit d936411dc9caeb3edb992e39c33d4d1d81ca8c08 Author: Borislav Petkov Date: Fri May 20 12:12:30 2022 +0200 x86: Remove empty files Remove empty files which were supposed to get removed with the respective commits removing the functionality in them: $ find arch/x86/ -empty arch/x86/lib/mmx_32.c arch/x86/include/asm/fpu/internal.h arch/x86/include/asm/mmx.h Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220520101723.12006-1-bp@alien8.de commit b0dacee202efbf1a5d9f5cdfd82049e8b5b085d2 Merge: ee5354345242c de78657e16f41 8b9ad480bd1dd b11deb2f250fb cae8d1f5e34e5 0d647b33e74f7 42bb5aa043382 fa7e9ecc5e1c1 Author: Joerg Roedel Date: Fri May 20 12:27:17 2022 +0200 Merge branches 'apple/dart', 'arm/mediatek', 'arm/msm', 'arm/smmu', 'ppc/pamu', 'x86/vt-d', 'x86/amd' and 'vfio-notifier-fix' into next commit b11deb2f250fbf841e578e0f3bea3993fdedd0f7 Merge: e3b9bf145cb6a 42226c989789d Author: Joerg Roedel Date: Fri May 20 12:26:49 2022 +0200 Merge tag 'v5.18-rc7' into arm/smmu Linux 5.18-rc7 commit 42bb5aa043382f09bef2cc33b8431be867c70f8e Author: Joerg Roedel Date: Fri May 20 12:22:14 2022 +0200 iommu/amd: Increase timeout waiting for GA log enablement On some systems it can take a long time for the hardware to enable the GA log of the AMD IOMMU. The current wait time is only 0.1ms, but testing showed that it can take up to 14ms for the GA log to enter running state after it has been enabled. Sometimes the long delay happens when booting the system, sometimes only on resume. Adjust the timeout accordingly to not print a warning when hardware takes a longer than usual. There has already been an attempt to fix this with commit 9b45a7738eec ("iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()") But that commit was based on some wrong math and did not fix the issue in all cases. Cc: "D. Ziegfeld" Cc: Jörg-Volker Peetz Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220520102214.12563-1-joro@8bytes.org commit b6d261449e6e4ed69ae654e3b4b41c0c416cf2a9 Merge: 805cb5aadc2a8 660e52d651ab7 Author: David S. Miller Date: Fri May 20 11:12:24 2022 +0100 Merge branch 'net-ipa-next' Alex Elder says: ==================== net: ipa: a mix of patches This series includes a mix of things things that are generally minor. The first four are sort of unrelated fixes, and summarizing them here wouldn't be that helpful. The last three together make it so only the "configuration data" we need after initialization is saved for later use. Most such data is used only during driver initialization. But endpoint configuration is needed later, so the last patch saves a copy of that. Eventually we'll want to support reconfiguring endpoints at runtime as well, and this will facilitate that. ==================== Signed-off-by: David S. Miller commit 660e52d651ab7faa20d1ba08ae90a306b023e395 Author: Alex Elder Date: Thu May 19 10:12:17 2022 -0500 net: ipa: save a copy of endpoint default config All elements of the default endpoint configuration are used in the code when programming an endpoint for use. But none of the other configuration data is ever needed once things are initialized. So rather than saving a pointer to *all* of the configuration data, save a copy of only the endpoint configuration portion. This will eventually allow endpoint configuration to be modifiable at runtime. But even before that it means we won't keep a pointer to configuration data after when no longer needed. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit cf4e73a1667e620ef703ff1f86ae96471ffa80f6 Author: Alex Elder Date: Thu May 19 10:12:16 2022 -0500 net: ipa: rename a few endpoint config data types Rename the just-moved data structure types to drop the "_data" suffix, to make it more obvious they are no longer meant to be used just as read-only initialization data. Rename the fields and variables of these types to use "config" instead of "data" in the name. This is another small step meant to facilitate review. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit f0488c540e8a36e515c744a531f27a6e994888d6 Author: Alex Elder Date: Thu May 19 10:12:15 2022 -0500 net: ipa: move endpoint configuration data definitions Move the definitions of the structures defining endpoint-specific configuration data out of "ipa_data.h" and into "ipa_endpoint.h". This is a trivial movement of code without any other change, to prepare for the next few patches. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 75944b040bbcce0fc1d1432787efe8a96b51b595 Author: Alex Elder Date: Thu May 19 10:12:14 2022 -0500 net: ipa: open-code ether_setup() About half of the fields set by the call in ipa_modem_netdev_setup() are overwritten after the call. Instead, just skip the call, and open-code the (other) assignments it makes to the net_device structure fields. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 332ef7c814bdd60f08d0d9013d0e1104798b2d23 Author: Alex Elder Date: Thu May 19 10:12:13 2022 -0500 net: ipa: ignore endianness if there is no header If we program an RX endpoint to have no header (header length is 0), header-related endpoint configuration values are meaningless and are ignored. The only case we support that defines a header is QMAP endpoints. In ipa_endpoint_init_hdr_ext() we set the endianness mask value unconditionally, but it should not be done if there is no header (meaning it is not configured for QMAP). Set the endianness conditionally, and rearrange the logic in that function slightly to avoid testing the qmap flag twice. Delete an incorrect comment in ipa_endpoint_init_aggr(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c9d92cf28c0cda6e3bd76b75e6e343b86075cd2d Author: Alex Elder Date: Thu May 19 10:12:12 2022 -0500 net: ipa: rename a GSI error code The CHANNEL_NOT_RUNNING error condition has been generalized, so rename it to be INCORRECT_CHANNEL_STATE. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c15f950d149564989aa5a134b42e83e57511e628 Author: Alex Elder Date: Thu May 19 10:12:11 2022 -0500 net: ipa: drop an unneeded transaction reference In gsi_channel_update(), a reference count is taken on the last completed transaction "to keep it from completing" before we give the event back to the hardware. Completion processing for that transaction (and any other "new" ones) will not occur until after this function returns, so there's no risk it completing early. So there's no need to take and drop the additional transaction reference. Use local variables in the call to gsi_evt_ring_doorbell(). Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit ce6565282b3b16fd850c6a676f78c6bc76d0c235 Author: Peter Zijlstra Date: Fri May 20 10:26:04 2022 +0200 x86/entry: Fixup objtool/ibt validation Commit 47f33de4aafb ("x86/sev: Mark the code returning to user space as syscall gap") added a bunch of text references without annotating them, resulting in a spree of objtool complaints: vmlinux.o: warning: objtool: vc_switch_off_ist+0x77: relocation to !ENDBR: entry_SYSCALL_64+0x15c vmlinux.o: warning: objtool: vc_switch_off_ist+0x8f: relocation to !ENDBR: entry_SYSCALL_compat+0xa5 vmlinux.o: warning: objtool: vc_switch_off_ist+0x97: relocation to !ENDBR: .entry.text+0x21ea vmlinux.o: warning: objtool: vc_switch_off_ist+0xef: relocation to !ENDBR: .entry.text+0x162 vmlinux.o: warning: objtool: __sev_es_ist_enter+0x60: relocation to !ENDBR: entry_SYSCALL_64+0x15c vmlinux.o: warning: objtool: __sev_es_ist_enter+0x6c: relocation to !ENDBR: .entry.text+0x162 vmlinux.o: warning: objtool: __sev_es_ist_enter+0x8a: relocation to !ENDBR: entry_SYSCALL_compat+0xa5 vmlinux.o: warning: objtool: __sev_es_ist_enter+0xc1: relocation to !ENDBR: .entry.text+0x21ea Since these text references are used to compare against IP, and are not an indirect call target, they don't need ENDBR so annotate them away. Fixes: 47f33de4aafb ("x86/sev: Mark the code returning to user space as syscall gap") Reported-by: Stephen Rothwell Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220520082604.GQ2578@worktop.programming.kicks-ass.net commit 9c55d99e099bd7aa6b91fce8718505c35d5dfc65 Author: Borislav Petkov Date: Thu May 19 16:59:13 2022 +0200 x86/microcode: Add explicit CPU vendor dependency Add an explicit dependency to the respective CPU vendor so that the respective microcode support for it gets built only when that support is enabled. Reported-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/8ead0da9-9545-b10d-e3db-7df1a1f219e4@infradead.org commit fa7e9ecc5e1c1a1e8aa7014b2749b22edc801dd2 Author: Matthew Rosato Date: Thu May 19 14:29:29 2022 -0400 iommu/s390: Tolerate repeat attach_dev calls Since commit 0286300e6045 ("iommu: iommu_group_claim_dma_owner() must always assign a domain") s390-iommu will get called to allocate multiple unmanaged iommu domains for a vfio-pci device -- however the current s390-iommu logic tolerates only one. Recognize that multiple domains can be allocated and handle switching between DMA or different iommu domain tables during attach_dev. Signed-off-by: Matthew Rosato Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220519182929.581898-1-mjrosato@linux.ibm.com Signed-off-by: Joerg Roedel commit b154a017c92011d8f71ce804583e5f9c3d90bb9a Author: Shida Zhang Date: Wed May 18 09:36:47 2022 +0800 cgroup: remove the superfluous judgment Remove the superfluous judgment since the function is never called for a root cgroup, as suggested by Tejun. Suggested-by: Tejun Heo Signed-off-by: Shida Zhang Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit 03536823589a501eb6601a7d09d77f8e1cbbcdd6 Merge: 66ccd1d16e03e 64b22a0da12ad Author: Dave Airlie Date: Fri May 20 16:34:29 2022 +1000 Merge tag 'msm-next-5.19-fixes' of https://gitlab.freedesktop.org/abhinavk/msm into drm-next 5.19 fixes for msm-next - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a big-time hitter in the CI-runs. Signed-off-by: Abhinav Kumar Signed-off-by: Dave Airlie From: Abhinav Kumar Link: https://patchwork.freedesktop.org/patch/msgid/b011d51d-d634-123e-bf5f-27219ee33151@quicinc.com commit 66ccd1d16e03e7308629de3c6713930a94729c6e Merge: 00df0514ab138 5ee8c8f930ba7 Author: Dave Airlie Date: Fri May 20 16:33:18 2022 +1000 Merge tag 'drm-misc-next-fixes-2022-05-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-next A device tree binding change for Rockchip VOP2 Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220519080556.42p52cya4u6y3kps@houat commit e4e62bbc6aba49a5edb3156ec65f6698ff37d228 Author: Yang Yingliang Date: Sat May 14 16:42:41 2022 +0800 hwrng: omap3-rom - fix using wrong clk_disable() in omap_rom_rng_runtime_resume() 'ddata->clk' is enabled by clk_prepare_enable(), it should be disabled by clk_disable_unprepare(). Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions") Signed-off-by: Yang Yingliang Signed-off-by: Herbert Xu commit 2d33f5771b513f7dfb819563d4b38b687f2a4982 Author: Kai Ye Date: Fri May 13 16:02:44 2022 +0800 crypto: hisilicon/sec - delete the flag CRYPTO_ALG_ALLOCATES_MEMORY Should not to uses the CRYPTO_ALG_ALLOCATES_MEMORY in SEC2. The SEC2 driver uses the pre-allocated buffers, including the src sgl pool, dst sgl pool and other qp ctx resources. (e.g. IV buffer, mac buffer, key buffer). The SEC2 driver doesn't allocate memory during request processing. The driver only maps software sgl to allocated hardware sgl during I/O. So here is fix it. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit fbdab61af2d02ebf9c015458c95e34b54dea9027 Author: Giovanni Cabiddu Date: Tue May 10 17:54:19 2022 +0100 crypto: qat - add support for 401xx devices QAT_401xx is a derivative of 4xxx. Add support for that device in the qat_4xxx driver by including the DIDs (both PF and VF), extending the probe and the firmware loader. Signed-off-by: Giovanni Cabiddu Reviewed-by: Srinivas Kerekare Signed-off-by: Herbert Xu commit d09144745959bf7852ccafd73243dd7d1eaeb163 Author: Giovanni Cabiddu Date: Mon May 9 14:34:17 2022 +0100 crypto: qat - re-enable registration of algorithms Re-enable the registration of algorithms after fixes to (1) use pre-allocated buffers in the datapath and (2) support the CRYPTO_TFM_REQ_MAY_BACKLOG flag. This reverts commit 8893d27ffcaf6ec6267038a177cb87bcde4dd3de. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 8fb203c65a795b96faa1836b5086a5d6eb5c5e99 Author: Giovanni Cabiddu Date: Mon May 9 14:34:16 2022 +0100 crypto: qat - honor CRYPTO_TFM_REQ_MAY_SLEEP flag If a request has the flag CRYPTO_TFM_REQ_MAY_SLEEP set, allocate memory using the flag GFP_KERNEL otherwise use GFP_ATOMIC. Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 2acbb8771f6ac82422886e63832ee7a0f4b1635b Author: Giovanni Cabiddu Date: Mon May 9 14:34:15 2022 +0100 crypto: qat - add param check for DH Reject requests with a source buffer that is bigger than the size of the key. This is to prevent a possible integer underflow that might happen when copying the source scatterlist into a linear buffer. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 9714061423b8b24b8afb31b8eb4df977c63f19c4 Author: Giovanni Cabiddu Date: Mon May 9 14:34:14 2022 +0100 crypto: qat - add param check for RSA Reject requests with a source buffer that is bigger than the size of the key. This is to prevent a possible integer underflow that might happen when copying the source scatterlist into a linear buffer. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 029aa4624a7fe35233bdd3d1354dc7be260380bf Author: Giovanni Cabiddu Date: Mon May 9 14:34:13 2022 +0100 crypto: qat - remove dma_free_coherent() for DH The functions qat_dh_compute_value() allocates memory with dma_alloc_coherent() if the source or the destination buffers are made of multiple flat buffers or of a size that is not compatible with the hardware. This memory is then freed with dma_free_coherent() in the context of a tasklet invoked to handle the response for the corresponding request. According to Documentation/core-api/dma-api-howto.rst, the function dma_free_coherent() cannot be called in an interrupt context. Replace allocations with dma_alloc_coherent() in the function qat_dh_compute_value() with kmalloc() + dma_map_single(). Cc: stable@vger.kernel.org Fixes: c9839143ebbf ("crypto: qat - Add DH support") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 3dfaf0071ed74d7a9c6b3c9ea4df7a6f8e423c2a Author: Giovanni Cabiddu Date: Mon May 9 14:34:12 2022 +0100 crypto: qat - remove dma_free_coherent() for RSA After commit f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP"), if the algorithms are enabled, the driver crashes with a BUG_ON while executing vunmap() in the context of a tasklet. This is due to the fact that the function dma_free_coherent() cannot be called in an interrupt context (see Documentation/core-api/dma-api-howto.rst). The functions qat_rsa_enc() and qat_rsa_dec() allocate memory with dma_alloc_coherent() if the source or the destination buffers are made of multiple flat buffers or of a size that is not compatible with the hardware. This memory is then freed with dma_free_coherent() in the context of a tasklet invoked to handle the response for the corresponding request. Replace allocations with dma_alloc_coherent() in the functions qat_rsa_enc() and qat_rsa_dec() with kmalloc() + dma_map_single(). Cc: stable@vger.kernel.org Fixes: a990532023b9 ("crypto: qat - Add support for RSA algorithm") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 80a52e1ee7757b742f96bfb0d58f0c14eb6583d0 Author: Giovanni Cabiddu Date: Mon May 9 14:34:11 2022 +0100 crypto: qat - fix memory leak in RSA When an RSA key represented in form 2 (as defined in PKCS #1 V2.1) is used, some components of the private key persist even after the TFM is released. Replace the explicit calls to free the buffers in qat_rsa_exit_tfm() with a call to qat_rsa_clear_ctx() which frees all buffers referenced in the TFM context. Cc: stable@vger.kernel.org Fixes: 879f77e9071f ("crypto: qat - Add RSA CRT mode") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 38682383973280e5be2802ba8a8d4a636d36cb19 Author: Giovanni Cabiddu Date: Mon May 9 14:34:10 2022 +0100 crypto: qat - add backlog mechanism The implementations of the crypto algorithms (aead, skcipher, etc) in the QAT driver do not properly support requests with the CRYPTO_TFM_REQ_MAY_BACKLOG flag set. If the HW queue is full, the driver returns -EBUSY but does not enqueue the request. This can result in applications like dm-crypt waiting indefinitely for the completion of a request that was never submitted to the hardware. Fix this by adding a software backlog queue: if the ring buffer is more than eighty percent full, then the request is enqueued to a backlog list and the error code -EBUSY is returned back to the caller. Requests in the backlog queue are resubmitted at a later time, in the context of the callback of a previously submitted request. The request for which -EBUSY is returned is then marked as -EINPROGRESS once submitted to the HW queues. The submission loop inside the function qat_alg_send_message() has been modified to decide which submission policy to use based on the request flags. If the request does not have the CRYPTO_TFM_REQ_MAY_BACKLOG set, the previous behaviour has been preserved. Based on a patch by Vishnu Das Ramachandran Cc: stable@vger.kernel.org Fixes: d370cec32194 ("crypto: qat - Intel(R) QAT crypto interface") Reported-by: Mikulas Patocka Reported-by: Kyle Sanderson Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit af88d3c109aa5edfaa11c9a26d9c0ff21ddf501c Author: Giovanni Cabiddu Date: Mon May 9 14:34:09 2022 +0100 crypto: qat - refactor submission logic All the algorithms in qat_algs.c and qat_asym_algs.c use the same pattern to submit messages to the HW queues. Move the submission loop to a new function, qat_alg_send_message(), and share it between the symmetric and the asymmetric algorithms. As part of this rework, since the number of retries before returning an error is inconsistent between the symmetric and asymmetric implementations, set it to a value that works for both (i.e. 20, was 10 in qat_algs.c and 100 in qat_asym_algs.c) In addition fix the return code reported when the HW queues are full. In that case return -ENOSPC instead of -EBUSY. Including stable in CC since (1) the error code returned if the HW queues are full is incorrect and (2) to facilitate the backport of the next fix "crypto: qat - add backlog mechanism". Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit e0831e7af4e03f2715de102e18e9179ec0a81562 Author: Giovanni Cabiddu Date: Mon May 9 14:34:08 2022 +0100 crypto: qat - use pre-allocated buffers in datapath In order to do DMAs, the QAT device requires that the scatterlist structures are mapped and translated into a format that the firmware can understand. This is defined as the composition of a scatter gather list (SGL) descriptor header, the struct qat_alg_buf_list, plus a variable number of flat buffer descriptors, the struct qat_alg_buf. The allocation and mapping of these data structures is done each time a request is received from the skcipher and aead APIs. In an OOM situation, this behaviour might lead to a dead-lock if an allocation fails. Based on the conversation in [1], increase the size of the aead and skcipher request contexts to include an SGL descriptor that can handle a maximum of 4 flat buffers. If requests exceed 4 entries buffers, memory is allocated dynamically. [1] https://lore.kernel.org/linux-crypto/20200722072932.GA27544@gondor.apana.org.au/ Cc: stable@vger.kernel.org Fixes: d370cec32194 ("crypto: qat - Intel(R) QAT crypto interface") Reported-by: Mikulas Patocka Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 1731160ff7c7bbb11bb1aacb14dd25e18d522779 Author: Giovanni Cabiddu Date: Mon May 9 14:19:27 2022 +0100 crypto: qat - set to zero DH parameters before free Set to zero the context buffers containing the DH key before they are freed. This is a defense in depth measure that avoids keys to be recovered from memory in case the system is compromised between the free of the buffer and when that area of memory (containing keys) gets overwritten. Cc: stable@vger.kernel.org Fixes: c9839143ebbf ("crypto: qat - Add DH support") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Reviewed-by: Wojciech Ziemba Signed-off-by: Herbert Xu commit 805cb5aadc2a88c453cfe620b28e12ff2fac27a6 Merge: 16ea52c44e7a5 58a94a62a53ff Author: Jakub Kicinski Date: Thu May 19 16:06:33 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next, misc updates and fallout fixes from recent Florian's code rewritting (from last pull request): 1) Use new flowi4_l3mdev field in ip_route_me_harder(), from Martin Willi. 2) Avoid unnecessary GC with a timestamp in conncount, from William Tu and Yifeng Sun. 3) Remove TCP conntrack debugging, from Florian Westphal. 4) Fix compilation warning in ctnetlink, from Florian. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: ctnetlink: fix up for "netfilter: conntrack: remove unconfirmed list" netfilter: conntrack: remove pr_debug callsites from tcp tracker netfilter: nf_conncount: reduce unnecessary GC netfilter: Use l3mdev flow key when re-routing mangled packets ==================== Link: https://lore.kernel.org/r/20220519220206.722153-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 16ea52c44e7a56c983a2a49e218af5a9dbbd8965 Author: Jakub Kicinski Date: Thu May 19 18:25:55 2022 -0700 eth: mtk_ppe: fix up after merge I missed this in the barrage of GCC 12 warnings. Commit cf2df74e202d ("net: fix dev_fill_forward_path with pppoe + bridge") changed the pointer into an array. Fixes: d7e6f5836038 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net") Link: https://lore.kernel.org/r/20220520012555.2262461-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 2fe3ffcf5592f24a9f9131a91727673d19f2b2d9 Author: Darrick J. Wong Date: Fri May 20 14:42:49 2022 +1000 xfs: free xfs_attrd_log_items correctly Technically speaking, objects allocated out of a specific slab cache are supposed to be freed to that slab cache. The popular slab backends will take care of this for us, but SLOB famously doesn't. Fix this, even if slob + xfs are not that common of a combination. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 25b1e9dc32299b98257835910f8e532d805b824f Author: Darrick J. Wong Date: Fri May 20 14:42:36 2022 +1000 xfs: validate xattr name earlier in recovery When we're validating a recovered xattr log item during log recovery, we should check the name before starting to allocate resources. This isn't strictly necessary on its own, but it means that we won't bother with huge memory allocations during recovery if the attr name is garbage, which will simplify the changes in the next patch. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 85d76aec6bbb3dd0131511e73d48b2816e7ab8de Author: Darrick J. Wong Date: Fri May 20 14:42:15 2022 +1000 xfs: reject unknown xattri log item filter flags during recovery Make sure we screen the "attr flags" field of recovered xattr intent log items to reject flag bits that we don't know about. This is really the attr *filter* field from xfs_da_args, so rename the field and create a mask to make checking for invalid bits easier. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 356cb708ea1886d1f7734cc1a8c4708b35ce5d77 Author: Darrick J. Wong Date: Fri May 20 14:41:47 2022 +1000 xfs: reject unknown xattri log item operation flags during recovery Make sure we screen the op flags field of recovered xattr intent log items to reject flag bits that we don't know about. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit a618acab136b1b01a4c10957ce8bae70cc9f7ca4 Author: Darrick J. Wong Date: Fri May 20 14:41:42 2022 +1000 xfs: don't leak the retained da state when doing a leaf to node conversion If a setxattr operation finds an xattr structure in leaf format, adding the attr can fail due to lack of space and hence requires an upgrade to node format. After this happens, we'll roll the transaction and re-enter the state machine, at which time we need to perform a second lookup of the attribute name to find its new location. This lookup attaches a new da state structure to the xfs_attr_item but doesn't free the old one (from the leaf lookup) and leaks it. Fix that. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 309001c22cdd75c62e6c3a217bf6967e178f929a Author: Darrick J. Wong Date: Fri May 20 14:41:34 2022 +1000 xfs: don't leak da state when freeing the attr intent item kmemleak reported that we lost an xfs_da_state while removing xattrs in generic/020: unreferenced object 0xffff88801c0e4b40 (size 480): comm "attr", pid 30515, jiffies 4294931061 (age 5.960s) hex dump (first 32 bytes): 78 bc 65 07 00 c9 ff ff 00 30 60 1c 80 88 ff ff x.e......0`..... 02 00 00 00 00 00 00 00 80 18 83 4e 80 88 ff ff ...........N.... backtrace: [] xfs_da_state_alloc+0x1a/0x30 [xfs] [] xfs_attr_node_hasname+0x23/0x90 [xfs] [] xfs_attr_set_iter+0x441/0xa30 [xfs] [] xfs_xattri_finish_update+0x44/0x80 [xfs] [] xfs_attr_finish_item+0x1e/0x40 [xfs] [] xfs_defer_finish_noroll+0x184/0x740 [xfs] [] __xfs_trans_commit+0x153/0x3e0 [xfs] [] xfs_attr_set+0x469/0x7e0 [xfs] [] xfs_xattr_set+0x89/0xd0 [xfs] [] __vfs_removexattr+0x52/0x70 [] __vfs_removexattr_locked+0xb8/0x150 [] vfs_removexattr+0x56/0x100 [] removexattr+0x58/0x90 [] path_removexattr+0x9e/0xc0 [] __x64_sys_lremovexattr+0x14/0x20 [] do_syscall_64+0x35/0x80 I think this is a consequence of xfs_attr_node_removename_setup attaching a new da(btree) state to xfs_attr_item and never freeing it. I /think/ it's the case that the remove paths could detach the da state earlier in the remove state machine since nothing else accesses the state. However, let's future-proof the new xattr code by adding a catch-all when we free the xfs_attr_item to make sure we never leak the da state. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit fed9b26b2501ea0ce41ae3a788bcc498440589c6 Author: Anup Patel Date: Mon May 9 11:23:16 2022 +0530 MAINTAINERS: Update KVM RISC-V entry to cover selftests support We update KVM RISC-V maintainers entry to include appropriate KVM selftests directories so that RISC-V related KVM selftests patches are CC'ed to KVM RISC-V mailing list. Signed-off-by: Anup Patel commit affa28e4d094b48a7b27dd0c5b8258288b6c4a24 Author: Atish Patra Date: Mon May 9 11:29:37 2022 -0700 RISC-V: KVM: Introduce ISA extension register Currently, there is no provision for vmm (qemu-kvm or kvmtool) to query about multiple-letter ISA extensions. The config register is only used for base single letter ISA extensions. A new ISA extension register is added that will allow the vmm to query about any ISA extension one at a time. It is enabled for both single letter or multi-letter ISA extensions. The ISA extension register is useful to if the vmm requires to retrieve/set single extension while the config register should be used if all the base ISA extension required to retrieve or set. For any multi-letter ISA extensions, the new register interface must be used. Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit 92e450507d5612d399d0abee8447305a43a412cc Author: Anup Patel Date: Mon May 9 10:44:11 2022 +0530 RISC-V: KVM: Cleanup stale TLB entries when host CPU changes On RISC-V platforms with hardware VMID support, we share same VMID for all VCPUs of a particular Guest/VM. This means we might have stale G-stage TLB entries on the current Host CPU due to some other VCPU of the same Guest which ran previously on the current Host CPU. To cleanup stale TLB entries, we simply flush all G-stage TLB entries by VMID whenever underlying Host CPU changes for a VCPU. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 13acfec2dbccfafff3331a3810cd7dde2fb16891 Author: Anup Patel Date: Mon May 9 10:44:05 2022 +0530 RISC-V: KVM: Add remote HFENCE functions based on VCPU requests The generic KVM has support for VCPU requests which can be used to do arch-specific work in the run-loop. We introduce remote HFENCE functions which will internally use VCPU requests instead of host SBI calls. Advantages of doing remote HFENCEs as VCPU requests are: 1) Multiple VCPUs of a Guest may be running on different Host CPUs so it is not always possible to determine the Host CPU mask for doing Host SBI call. For example, when VCPU X wants to do HFENCE on VCPU Y, it is possible that VCPU Y is blocked or in user-space (i.e. vcpu->cpu < 0). 2) To support nested virtualization, we will be having a separate shadow G-stage for each VCPU and a common host G-stage for the entire Guest/VM. The VCPU requests based remote HFENCEs helps us easily synchronize the common host G-stage and shadow G-stage of each VCPU without any additional IPI calls. This is also a preparatory patch for upcoming nested virtualization support where we will be having a shadow G-stage page table for each Guest VCPU. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 486a38429498eef5acac90aeab68a1c3fa653a21 Author: Anup Patel Date: Mon May 9 10:44:00 2022 +0530 RISC-V: KVM: Reduce KVM_MAX_VCPUS value Currently, the KVM_MAX_VCPUS value is 16384 for RV64 and 128 for RV32. The KVM_MAX_VCPUS value is too high for RV64 and too low for RV32 compared to other architectures (e.g. x86 sets it to 1024 and ARM64 sets it to 512). The too high value of KVM_MAX_VCPUS on RV64 also leads to VCPU mask on stack consuming 2KB. We set KVM_MAX_VCPUS to 1024 for both RV64 and RV32 to be aligned other architectures. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 2415e46e3a9a22c80eddc41dc9cb0b06fe0cd5e9 Author: Anup Patel Date: Mon May 9 10:43:52 2022 +0530 RISC-V: KVM: Introduce range based local HFENCE functions Various __kvm_riscv_hfence_xyz() functions implemented in the kvm/tlb.S are equivalent to corresponding HFENCE.GVMA instructions and we don't have range based local HFENCE functions. This patch provides complete set of local HFENCE functions which supports range based TLB invalidation and supports HFENCE.VVMA based functions. This is also a preparatory patch for upcoming Svinval support in KVM RISC-V. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit c7fa3c48de86053b0f1949fa5532082544e30fce Author: Anup Patel Date: Mon May 9 10:43:46 2022 +0530 RISC-V: KVM: Treat SBI HFENCE calls as NOPs We should treat SBI HFENCE calls as NOPs until nested virtualization is supported by KVM RISC-V. This will help us test booting a hypervisor under KVM RISC-V. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit b4bbb95ea6c41a616385902df81a66293f4b744c Author: Anup Patel Date: Mon May 9 10:43:39 2022 +0530 RISC-V: KVM: Add Sv57x4 mode support for G-stage Latest QEMU supports G-stage Sv57x4 mode so this patch extends KVM RISC-V G-stage handling to detect and use Sv57x4 mode when available. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit 26708234eb12e73a2a475296f562ba351fb39894 Author: Anup Patel Date: Mon May 9 10:43:30 2022 +0530 RISC-V: KVM: Use G-stage name for hypervisor page table The two-stage address translation defined by the RISC-V privileged specification defines: VS-stage (guest virtual address to guest physical address) programmed by the Guest OS and G-stage (guest physical addree to host physical address) programmed by the hypervisor. To align with above terminology, we replace "stage2" with "gstage" and "Stage2" with "G-stage" name everywhere in KVM RISC-V sources. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit dba90d6fb8b0657d45516bfe1eb8fe83d9e425f8 Author: Jiapeng Chong Date: Fri May 6 17:45:12 2022 +0800 KVM: selftests: riscv: Remove unneeded semicolon Fix the following coccicheck warnings: ./tools/testing/selftests/kvm/lib/riscv/processor.c:353:3-4: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Anup Patel commit ac6c85e962d4c009c499d93657f25f46fd8212b9 Author: Anup Patel Date: Sat Apr 9 10:02:36 2022 +0530 KVM: selftests: riscv: Improve unexpected guest trap handling Currently, we simply hang using "while (1) ;" upon any unexpected guest traps because the default guest trap handler is guest_hang(). The above approach is not useful to anyone because KVM selftests users will only see a hung application upon any unexpected guest trap. This patch improves unexpected guest trap handling for KVM RISC-V selftests by doing the following: 1) Return to host user-space 2) Dump VCPU registers 3) Die using TEST_ASSERT(0, ...) Signed-off-by: Anup Patel Tested-by: Mayuresh Chitale Signed-off-by: Anup Patel commit 30476f7e6dbcb075850c6e33b15460dd4868c985 Author: Tom Rix Date: Tue Jan 25 05:13:40 2022 -0800 namei: cleanup double word in comment Remove the second 'to'. Signed-off-by: Tom Rix Signed-off-by: Al Viro commit 52dba645ca3a2e8695f14fefb608a3b82a7c8a4e Author: Al Viro Date: Fri Jan 7 12:24:41 2022 -0500 get rid of dead code in legitimize_root() Combination of LOOKUP_IS_SCOPED and NULL nd->root.mnt is impossible after successful path_init(). All places where ->root.mnt might become NULL do that only if LOOKUP_IS_SCOPED is not there and path_init() itself can return success without setting nd->root only if ND_ROOT_PRESET had been set (in which case nd->root had been set by caller and never changed) or if the name had been a relative one *and* none of the bits in LOOKUP_IS_SCOPED had been present. Since all calls of legitimize_root() must be downstream of successful path_init(), the check for !nd->root.mnt && (nd->flags & LOOKUP_IS_SCOPED) is pure paranoia. FWIW, it had been discussed (and agreed upon) with Aleksa back when scoped lookups had been merged; looks like that had fallen through the cracks back then. Signed-off-by: Al Viro commit e5ca024e165d952b12da5ea86c36ea70d70bfc98 Author: Al Viro Date: Fri Jan 7 12:20:37 2022 -0500 fs/namei.c:reserve_stack(): tidy up the call of try_to_unlazy() !foo() != 0 is a strange way to spell !foo(); fallout from "fs: make unlazy_walk() error handling consistent"... Signed-off-by: Al Viro commit 70f8d9c5750bbb0ca4ef7e23d6abcb05e6061138 Author: Al Viro Date: Wed Mar 2 17:49:09 2022 -0500 move mount-related externs from fs.h to mount.h Signed-off-by: Al Viro commit 279b192c23d2fc9cb9e8c3851d6cad968f51789f Author: Al Viro Date: Wed Mar 2 16:11:23 2022 -0500 blob_to_mnt(): kern_unmount() is needed to undo kern_mount() plain mntput() won't do. Signed-off-by: Al Viro commit f6957b7191ed8b55c1d2a28fa23c6a7d327b4408 Author: Al Viro Date: Tue Mar 1 20:35:41 2022 -0500 m->mnt_root->d_inode->i_sb is a weird way to spell m->mnt_sb... Signed-off-by: Al Viro commit 59df85d5fbae17175c391d89ad03e9e7a01b7a55 Author: Al Viro Date: Tue Mar 1 19:56:53 2022 -0500 linux/mount.h: trim includes Signed-off-by: Al Viro commit a5f85d7834f7e1456e799c79a2a83fc11b90cfe2 Author: Al Viro Date: Tue Mar 1 00:05:29 2022 -0500 uninline may_mount() and don't opencode it in fspick(2)/fsopen(2) It's done once per (mount-related) syscall and there's no point whatsoever making it inline. Signed-off-by: Al Viro commit 0784c25d21cfe14c128ea5ed3c9ab843fdfac737 Merge: 9ad084d666194 2ba18161d407c Author: Jakub Kicinski Date: Thu May 19 20:05:10 2022 -0700 Merge branch 'mptcp-miscellaneous-fixes-and-a-new-test-case' Mat Martineau says: ==================== mptcp: Miscellaneous fixes and a new test case Patches 1 and 3 remove helpers that were iterating over the subflow connection list without proper locking. Iteration was not needed in either case. Patch 2 fixes handling of MP_FAIL timeout, checking for orphaned subflows instead of using the MPTCP socket data lock and connection state. Patch 4 adds a test for MP_FAIL timeout using tc pedit to induce checksum failures. ==================== Link: https://lore.kernel.org/r/20220518220446.209750-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 2ba18161d407c596f256f7c4a6447b8588b9eb55 Author: Geliang Tang Date: Wed May 18 15:04:46 2022 -0700 selftests: mptcp: add MP_FAIL reset testcase Add the multiple subflows test case for MP_FAIL, to test the MP_FAIL reset case. Use the test_linkfail value to make 1024KB test files. Invoke reset_with_fail() to use 'iptables' and 'tc action pedit' rules to produce the bit flips to trigger the checksum failures on ns2eth2. Add delays on ns2eth1 to make sure more data can translate on ns2eth2. The check_invert flag is enabled in reset_with_fail(), so this test prints out the inverted bytes, instead of the file mismatch errors. Invoke pedit_action_pkts() to get the numbers of the packets edited by the tc pedit actions, and print this numbers to the output. Co-developed-by: Paolo Abeni Signed-off-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d9fb797046c596187b97a08ea88b954964cc2d33 Author: Mat Martineau Date: Wed May 18 15:04:45 2022 -0700 mptcp: Do not traverse the subflow connection list without lock The MPTCP socket's conn_list (list of subflows) requires the socket lock to access. The MP_FAIL timeout code added such an access, where it would check the list of subflows both in timer context and (later) in workqueue context where the socket lock is held. Rather than check the list twice, remove the check in the timeout handler and only depend on the check in the workqueue. Also remove the MPTCP_FAIL_NO_RESPONSE flag, since mptcp_mp_fail_no_response() has insignificant overhead and can be checked on each worker run. Fixes: 49fa1919d6bc ("mptcp: reset subflow when MP_FAIL doesn't respond") Reported-by: Paolo Abeni Reviewed-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d42f9e4e2384febf9cb2d19ffa0cfac96189517a Author: Mat Martineau Date: Wed May 18 15:04:44 2022 -0700 mptcp: Check for orphaned subflow before handling MP_FAIL timer MP_FAIL timeout (waiting for a peer to respond to an MP_FAIL with another MP_FAIL) is implemented using the MPTCP socket's sk_timer. That timer is also used at MPTCP socket close, so it's important to not have the two timer users interfere with each other. At MPTCP socket close, all subflows are orphaned before sk_timer is manipulated. By checking the SOCK_DEAD flag on the subflows, each subflow can determine if the timer is safe to alter without acquiring any MPTCP-level lock. This replaces code that was using the mptcp_data_lock and MPTCP-level socket state checks that did not correctly protect the timer. Fixes: 49fa1919d6bc ("mptcp: reset subflow when MP_FAIL doesn't respond") Reviewed-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 7b16871f9932d8a371488d2967b033387870a747 Author: Paolo Abeni Date: Wed May 18 15:04:43 2022 -0700 mptcp: stop using the mptcp_has_another_subflow() helper The mentioned helper requires the msk socket lock, and the current callers don't own it nor can't acquire it, so the access is racy. All the current callers are really checking for infinite mapping fallback, and the latter condition is explicitly tracked by the relevant msk variable: we can safely remove the caller usage - and the caller itself. The issue is present since MP_FAIL implementation, but the fix only applies since the infinite fallback support, ence the somewhat unexpected fixes tag. Fixes: 0530020a7c8f ("mptcp: track and update contiguous data status") Acked-and-tested-by: Geliang Tang Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 9ad084d666194c20a30e3589cbfaf971dae55c24 Author: Yuchung Cheng Date: Wed May 18 17:34:10 2022 -0700 tcp: improve PRR loss recovery This patch improves TCP PRR loss recovery behavior for a corner case. Previously during PRR conservation-bound mode, it strictly sends the amount equals to the amount newly acked or s/acked. The patch changes s.t. PRR may send additional amount that was banked previously (e.g. application-limited) in the conservation-bound mode, similar to the slow-start mode. This unifies and simplifies the algorithm further and may improve the recovery latency. This change still follow the general packet conservation design principle and always keep inflight/cwnd below the slow start threshold set by the congestion control module. PRR is described in RFC 6937. We'll include this change in the latest revision rfc6937-bis as well. Reported-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220519003410.2531936-1-ycheng@google.com Signed-off-by: Jakub Kicinski commit 9b80ccda233fa6c59de411bf889cc4d0e028f2c7 Author: Hangbin Liu Date: Thu May 19 10:01:48 2022 +0800 bonding: fix missed rcu protection When removing the rcu_read_lock in bond_ethtool_get_ts_info() as discussed [1], I didn't notice it could be called via setsockopt, which doesn't hold rcu lock, as syzbot pointed: stack backtrace: CPU: 0 PID: 3599 Comm: syz-executor317 Not tainted 5.18.0-rc5-syzkaller-01392-g01f4685797a5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 bond_option_active_slave_get_rcu include/net/bonding.h:353 [inline] bond_ethtool_get_ts_info+0x32c/0x3a0 drivers/net/bonding/bond_main.c:5595 __ethtool_get_ts_info+0x173/0x240 net/ethtool/common.c:554 ethtool_get_phc_vclocks+0x99/0x110 net/ethtool/common.c:568 sock_timestamping_bind_phc net/core/sock.c:869 [inline] sock_set_timestamping+0x3a3/0x7e0 net/core/sock.c:916 sock_setsockopt+0x543/0x2ec0 net/core/sock.c:1221 __sys_setsockopt+0x55e/0x6a0 net/socket.c:2223 __do_sys_setsockopt net/socket.c:2238 [inline] __se_sys_setsockopt net/socket.c:2235 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2235 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f8902c8eb39 Fix it by adding rcu_read_lock and take a ref on the real_dev. Since dev_hold() and dev_put() can take NULL these days, we can skip checking if real_dev exist. [1] https://lore.kernel.org/netdev/27565.1642742439@famine/ Reported-by: syzbot+92beb3d46aab498710fa@syzkaller.appspotmail.com Fixes: aa6034678e87 ("bonding: use rcu_dereference_rtnl when get bonding active slave") Suggested-by: Vladimir Oltean Suggested-by: Jakub Kicinski Signed-off-by: Hangbin Liu Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220519020148.1058344-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit 7ebe52f555de21a1f239b963aa49972a6916a49a Author: Jakub Kicinski Date: Wed May 18 16:43:46 2022 -0700 docs: change the title of networking docs The current title of our section of the documentation is Linux Networking Documentation. Since we're describing a section of Linux Documentation repeating those two words seems redundant. Link: https://lore.kernel.org/r/20220518234346.2088436-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 1172aa6e4a195aaf5941ae89a93068cb9dd07b47 Author: Jakub Kicinski Date: Wed May 18 17:44:17 2022 -0700 net: ipa: don't proceed to out-of-bound write GCC 12 seems upset that we check ipa_irq against array bound but then proceed, anyway: drivers/net/ipa/ipa_interrupt.c: In function ‘ipa_interrupt_add’: drivers/net/ipa/ipa_interrupt.c:196:27: warning: array subscript 30 is above array bounds of ‘void (*[30])(struct ipa *, enum ipa_irq_id)’ [-Warray-bounds] 196 | interrupt->handler[ipa_irq] = handler; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~ drivers/net/ipa/ipa_interrupt.c:42:27: note: while referencing ‘handler’ 42 | ipa_irq_handler_t handler[IPA_IRQ_COUNT]; | ^~~~~~~ Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20220519004417.2109886-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit dbbc7d04c549a43ad343c69e17b27a57e2102041 Author: Jakub Kicinski Date: Wed May 18 17:43:42 2022 -0700 net: wwan: iosm: remove pointless null check GCC 12 warns: drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c: In function ‘ipc_protocol_dl_td_process’: drivers/net/wwan/iosm/iosm_ipc_protocol_ops.c:406:13: warning: the comparison will always evaluate as ‘true’ for the address of ‘cb’ will never be NULL [-Waddress] 406 | if (!IPC_CB(skb)) { | ^ Indeed the check seems entirely pointless. Hopefully the other validation checks will catch if the cb is bad, but it can't be NULL. Reviewed-by: M Chetan Kumar Link: https://lore.kernel.org/r/20220519004342.2109832-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 53332f845194b8dedf213c5bf51c2d4af88364ee Merge: 86afd5a0e78eb 4951995dbe9dd Author: Jakub Kicinski Date: Thu May 19 18:40:56 2022 -0700 Merge branch 'lantiq_gswip-two-small-fixes' Martin Blumenstingl says: ==================== lantiq_gswip: Two small fixes While updating the Lantiq target in OpenWrt to Linux 5.15 I came across an FDB related error message. While that still needs to be solved I found two other small issues on the way. This series fixes the two minor issues found while revisiting the FDB code in the lantiq_gswip driver: - The first patch fixes the start index used in gswip_port_fdb() to find the entry with the matching bridge. The updated logic is now consistent with the rest of the driver. - The second patch fixes a typo in a dev_err() message. [0] https://lore.kernel.org/netdev/20220517194015.1081632-1-martin.blumenstingl@googlemail.com/ ==================== Link: https://lore.kernel.org/r/20220518220051.1520023-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski commit 4951995dbe9dd0c3fbe1fbfdb760b05a797700f1 Author: Martin Blumenstingl Date: Thu May 19 00:00:51 2022 +0200 net: dsa: lantiq_gswip: Fix typo in gswip_port_fdb_dump() error print gswip_port_fdb_dump() reads the MAC bridge entries. The error message should say "failed to read mac bridge entry". While here, also add the index to the error print so humans can get to the cause of the problem easier. Acked-by: Hauke Mehrtens Reviewed-by: Vladimir Oltean Signed-off-by: Martin Blumenstingl Signed-off-by: Jakub Kicinski commit 7b4149bdee6a6363cb4eca3599296d41a7b3700d Author: Martin Blumenstingl Date: Thu May 19 00:00:50 2022 +0200 net: dsa: lantiq_gswip: Fix start index in gswip_port_fdb() The first N entries in priv->vlans are reserved for managing ports which are not part of a bridge. Use priv->hw_info->max_ports to consistently access per-bridge entries at index 7. Starting at priv->hw_info->cpu_port (6) is harmless in this case because priv->vlan[6].bridge is always NULL so the comparison result is always false (which results in this entry being skipped). Acked-by: Hauke Mehrtens Signed-off-by: Martin Blumenstingl Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 86afd5a0e78eb9b84b158b33d85f711c5f748fd1 Author: Ricardo Martinez Date: Wed May 18 12:55:29 2022 -0700 net: wwan: t7xx: Fix smatch errors t7xx_request_irq() error: uninitialized symbol 'ret'. t7xx_core_hk_handler() error: potentially dereferencing uninitialized 'event'. If the condition to enter the loop that waits for the handshake event is false on the first iteration then the uninitialized 'event' will be dereferenced, fix this by initializing 'event' to NULL. t7xx_port_proxy_recv_skb() warn: variable dereferenced before check 'skb'. No need to check skb at t7xx_port_proxy_recv_skb() since we know it is always called with a valid skb by t7xx_cldma_gpd_rx_from_q(). Reported-by: Dan Carpenter Signed-off-by: Ricardo Martinez Link: https://lore.kernel.org/r/20220518195529.126246-1-ricardo.martinez@linux.intel.com Signed-off-by: Jakub Kicinski commit cb89580ed8965fe317025d1da1a05b6b5aae1646 Merge: 1c2133114d2d1 14a44ab0330d2 Author: Jakub Kicinski Date: Thu May 19 18:14:34 2022 -0700 Merge branch 'mtk_eth_soc-phylink-updates' Russell King says: ==================== mtk_eth_soc phylink updates This series ultimately updates mtk_eth_soc to use phylink_pcs, with some fixes along the way. Previous attempts to update this driver (which is now marked as legacy) have failed due to lack of testing. I am hoping that this time will be different; Marek can test RGMII modes, but not SGMII. So all that we know is that this patch series probably doesn't break RGMII. 1) remove unused mac_mode and sgmii flags members from structures. 2) remove unnecessary interpretation of speed when configuring 1000 and 2500 Base-X 3) move configuration of SGMII duplex setting from mac_config() to link_up() 4) only pass in interface mode to mtk_sgmii_setup_mode_force() 5) move decision about which mtk_sgmii_setup_mode_*() function to call into mtk_sgmii.c 6) add a fixme comment for RGMII explaning why the call to mtk_gmac0_rgmii_adjust() is completely wrong - this needs to be addressed by someone who has the hardware and can test an appropriate fix. This fixme means that the driver still can't become non-legacy. 7) move gmac setup from mac_config() to mac_finish() - this preserves the order that we write to the hardware when we eventually convert to phylink_pcs() 8) move configuration of syscfg0 in SGMII/802.3z mode to mac_finish() for the same reasons as (7). 9) convert mtk_sgmii.c code structure and the mtk_sgmii structure to suit conversion to phylink_pcs 10) finally convert to phylink_pcs As there has been no feedback from mtk_eth_soc maintainers to my RFC on April 6th, not my reminder on April 11th, so it's now time to merge this anyway. Mediatek code seems to be submitted to the kernel and then the maintainers scarper... ==================== Link: https://lore.kernel.org/r/YoUIX+BN/ZbyXzTT@shell.armlinux.org.uk Tested-by: Marek Behún Signed-off-by: Jakub Kicinski commit 14a44ab0330d290fade1403a920e299cc56d7300 Author: Russell King (Oracle) Date: Wed May 18 15:55:28 2022 +0100 net: mtk_eth_soc: partially convert to phylink_pcs Partially convert mtk_eth_soc to phylink_pcs, moving the configuration, link up and AN restart over. However, it seems mac_pcs_get_state() doesn't actually get the state from the PCS, so we can't convert that over without a better understanding of the hardware. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 901f3fbe13c3e56f0742e02717ccbfabbc95c463 Author: Russell King (Oracle) Date: Wed May 18 15:55:22 2022 +0100 net: mtk_eth_soc: convert code structure to suit split PCS support Provide a mtk_pcs structure which encapsulates everything that the PCS functions need (the regmap and ana_rgc3 offset), and use this in the PCS functions. Provide shim functions to convert from the existing "mtk_sgmii_*" interface to the converted PCS functions. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 21089867278deb2a110b685e3cd33f64f9ce41e2 Author: Russell King (Oracle) Date: Wed May 18 15:55:17 2022 +0100 net: mtk_eth_soc: move restoration of SYSCFG0 to mac_finish() The SGMIISYS configuration is performed while ETHSYS_SYSCFG0 is in a disabled state. In order to preserve this when we switch to phylink_pcs we need to move the restoration of this register to the mac_finish() callback. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 0e37ad71b2ff772009595002da2860999e98e14e Author: Russell King (Oracle) Date: Wed May 18 15:55:12 2022 +0100 net: mtk_eth_soc: move MAC_MCR setting to mac_finish() Move the setting of the MTK_MAC_MCR register from the end of mac_config into the phylink mac_finish() method, to keep it as the very last write that is done during configuration. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 650a49bc65df6b0e0051a8f62d7c22d95a8f350d Author: Russell King (Oracle) Date: Wed May 18 15:55:07 2022 +0100 net: mtk_eth_soc: add fixme comment for state->speed use Add a fixme comment for the last remaining incorrect usage of state->speed in the mac_config() method, which is strangely in a code path which is only run when the PHY interface mode changes. This means if we are in RGMII mode, changes in state->speed will not cause the INTF_MODE, TRGMII_RCK_CTRL and TRGMII_TCK_CTRL registers to be set according to the speed, nor will the TRGPLL clock be set to the correct value. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1ec619ee4a052fb9ac48b57554ac2722a0bfe73c Author: Russell King (Oracle) Date: Wed May 18 15:55:02 2022 +0100 net: mtk_eth_soc: provide mtk_sgmii_config() Provide mtk_sgmii_config() to wrap up the decisions about which SGMII configuration will be called. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 4ce5a0bd3958ed248f0325bfcb95339f7c74feb2 Author: Russell King (Oracle) Date: Wed May 18 15:54:57 2022 +0100 net: mtk_eth_soc: stop passing phylink state to sgmii setup Now that mtk_sgmii_setup_mode_force() only uses the interface mode from the phylink state, pass just the interface mode into this function. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit a459187390bb221827f9c07866c3a5ffbdf9622b Author: Russell King Date: Wed May 18 15:54:52 2022 +0100 net: mtk_eth_soc: correct 802.3z duplex setting Phylink does not guarantee that state->duplex will be set correctly in the mac_config() call, so it's a bug that the driver makes use of it. Move the 802.3z PCS duplex configuration to mac_link_up(). Signed-off-by: Russell King Signed-off-by: Jakub Kicinski commit 7da3f901f8ecb425105fad39a0f5de73306abe52 Author: Russell King (Oracle) Date: Wed May 18 15:54:47 2022 +0100 net: mtk_eth_soc: correct 802.3z speed setting Phylink does not guarantee that state->speed will be set correctly in the mac_config() call, so it's a bug that the driver makes use of it. Moreover, it is making use of it in a function that is only ever called for 1000BASE-X and 2500BASE-X which operate at a fixed speed which happens to be the same setting irrespective of the interface mode. We can simply remove the switch statement and just set the SGMII interface speed. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit bc5e93e0cd22e360eda23859b939280205567580 Author: Russell King (Oracle) Date: Wed May 18 15:54:42 2022 +0100 net: mtk_eth_soc: add mask and update PCS speed definitions The PCS speed setting is a two bit field, but it is defined as two separate bits. Add a bitfield mask for the speed definitions, an use the FIELD_PREP() macro to define each PCS speed. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 5a7a2f4b29d7546244da7d8bbc1962fce5b230f2 Author: Russell King (Oracle) Date: Wed May 18 15:54:36 2022 +0100 net: mtk_eth_soc: remove unused sgmii flags The "flags" member of struct mtk_sgmii appears to be unused, as are the MTK_SGMII_PHYSPEED_* and MTK_HAS_FLAGS() macros. Remove them. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 0600bdde1fae75fb9bad72033d28edddc72b44b2 Author: Russell King (Oracle) Date: Wed May 18 15:54:31 2022 +0100 net: mtk_eth_soc: remove unused mac->mode mac->mode is only ever written to in one location, and is thus superflous. Remove it. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1c2133114d2d11c10ffb0da4e12904bde0478beb Author: Jakub Kicinski Date: Wed May 18 13:56:44 2022 -0700 net: tls: fix messing up lists when bpf enabled Artem points out that skb may try to take over the skb and queue it to its own list. Unlink the skb before calling out. Fixes: b1a2c1786330 ("tls: rx: clear ctx->recv_pkt earlier") Reported-by: Artem Savkov Tested-by: Artem Savkov Link: https://lore.kernel.org/r/20220518205644.2059468-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit b413b0cb008646e9f24ce5253cb3cf7ee217aff6 Author: Duoming Zhou Date: Wed May 18 19:57:33 2022 +0800 NFC: hci: fix sleep in atomic context bugs in nfc_hci_hcp_message_tx There are sleep in atomic context bugs when the request to secure element of st21nfca is timeout. The root cause is that kzalloc and alloc_skb with GFP_KERNEL parameter and mutex_lock are called in st21nfca_se_wt_timeout which is a timer handler. The call tree shows the execution paths that could lead to bugs: (Interrupt context) st21nfca_se_wt_timeout nfc_hci_send_event nfc_hci_hcp_message_tx kzalloc(..., GFP_KERNEL) //may sleep alloc_skb(..., GFP_KERNEL) //may sleep mutex_lock() //may sleep This patch moves the operations that may sleep into a work item. The work item will run in another kernel thread which is in process context to execute the bottom half of the interrupt. So it could prevent atomic context from sleeping. Fixes: 2130fb97fecf ("NFC: st21nfca: Adding support for secure element") Signed-off-by: Duoming Zhou Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220518115733.62111-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski commit df98714e432abf5cbdac3e4c1a13f94c65ddb8d3 Author: Dan Carpenter Date: Wed May 18 20:37:15 2022 +0300 net: ethernet: SP7021: fix a use after free of skb->len The netif_receive_skb() function frees "skb" so store skb->len before it is freed. Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YoUuy4iTjFAcSn03@kili Signed-off-by: Jakub Kicinski commit 582a2dbc72ac5dd2b3ae4f75bccd4b4c73bb0e1f Author: Xin Long Date: Wed May 18 12:09:15 2022 -0400 Documentation: add description for net.core.gro_normal_batch Describe it in admin-guide/sysctl/net.rst like other Network core options. Users need to know gro_normal_batch for performance tuning. Fixes: 323ebb61e32b ("net: use listified RX for handling GRO_NORMAL skbs") Reported-by: Prijesh Patel Signed-off-by: Xin Long Reviewed-by: Edward Cree Link: https://lore.kernel.org/r/acf8a2c03b91bcde11f67ff89b6050089c0712a3.1652888963.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit dd11376b9f1b73aca3f8c6eb541486bbb6996f05 Author: Bart Van Assche Date: Wed May 11 14:25:52 2022 -0700 scsi: ufs: Split the drivers/scsi/ufs directory Split the drivers/scsi/ufs directory into 'core' and 'host' directories under the drivers/ufs/ directory. Move shared header files into the include/ufs/ directory. This separation makes it clear which header files UFS drivers are allowed to include (include/ufs/*.h) and which header files UFS drivers are not allowed to include (drivers/ufs/core/*.h). Update the MAINTAINERS file. Add myself as a UFS reviewer. Link: https://lore.kernel.org/r/20220511212552.655341-1-bvanassche@acm.org Cc: Adrian Hunter Cc: Avri Altman Cc: Bean Huo Cc: Bjorn Andersson Cc: Keoseong Park Tested-by: Bean Huo Tested-by: Adrian Hunter Reviewed-by: Bean Huo Acked-by: Avri Altman Acked-by: Adrian Hunter Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c10ba0c961d3e3c05c0e13bb15a9e630fd208579 Author: Colin Ian King Date: Wed May 18 11:21:03 2022 +0100 scsi: qla1280: Remove redundant variable Variable toke is being assigned a value that is never read. The variable is redundant, remove it. Cleans up clang scan build warning: warning: Although the value stored to 'toke' is used in the enclosing expression, the value is never actually read from 'toke' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220518102103.514701-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 896325a8b1650e45e7626079170c56313057eefa Author: James Smart Date: Thu May 19 05:31:10 2022 -0700 scsi: lpfc: Add support for VMID tagging of NVMe I/Os Modify the NVMe I/O path to look for VMID support and call the transport to obtain the I/O's appid value. Link: https://lore.kernel.org/r/20220519123110.17361-5-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Gaurav Srivastava Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 348efeca74878dc6af688486267b862460a96040 Author: James Smart Date: Thu May 19 05:31:09 2022 -0700 scsi: lpfc: Rework lpfc_vmid_get_appid() to be protocol independent Rework lpfc_vmid_get_appid() arguments to remove scsi_cmnd dependency. The function is now callable by the NVMe I/O path. Fix up SCSI call path to accommodate the arg change. Link: https://lore.kernel.org/r/20220519123110.17361-4-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Gaurav Srivastava Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ed913cf4a5334427f40d1a09450368b2af6edd89 Author: James Smart Date: Thu May 19 05:31:08 2022 -0700 scsi: lpfc: Commonize VMID code location Remove VMID code from its SCSI-specific location and move to a new file solely for VMID code. Link: https://lore.kernel.org/r/20220519123110.17361-3-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Co-developed-by: Gaurav Srivastava Signed-off-by: Gaurav Srivastava Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 827fc630e4c8087df5a8e8ee013b686bd6f13736 Author: Muneendra Kumar Date: Thu May 19 05:31:07 2022 -0700 scsi: nvme-fc: Add new routine nvme_fc_io_getuuid() Add nvme_fc_io_getuuid() to the nvme-fc transport. The routine is invoked by the FC LLDD on a per-I/O request basis. The routine translates from the FC-specific request structure to the bio and the cgroup structure in order to obtain the FC appid stored in the cgroup structure. If a value is not set or a bio is not found, a NULL appid (aka uuid) will be returned to the LLDD. Link: https://lore.kernel.org/r/20220519123110.17361-2-jsmart2021@gmail.com Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Acked-by: Christoph Hellwig Signed-off-by: Muneendra Kumar Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d9c454ab2293f6b143d3d1be2bf54d766ed8bfc5 Author: Chao Liu Date: Thu May 19 18:40:10 2022 +0800 f2fs: make f2fs_read_inline_data() more readable In f2fs_read_inline_data(), it is confused with checking of inline_data flag, as we checked it before calling. So this patch add some comments for f2fs_has_inline_data(). Signed-off-by: Chao Liu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f01cdcf891a569dee187a5de0c25cd5766151524 Author: David Ober Date: Tue May 17 14:05:39 2022 -0400 net: usb: r8152: Add in new Devices that are supported for Mac-Passthru Lenovo Thunderbolt 4 Dock, and other Lenovo USB Docks are using the original Realtek USB ethernet Vendor and Product IDs If the Network device is Realtek verify that it is on a Lenovo USB hub before enabling the passthru feature This also adds in the device IDs for the Lenovo USB Dongle and one other USB-C dock V2 fix formating of code V3 remove Generic define for Device ID 0x8153 and change it to use value V4 rearrange defines and case statement to put them in better order v5 create helper function to do the testing work as suggested Signed-off-by: David Ober Link: https://lore.kernel.org/r/20220517180539.25839-1-dober6023@gmail.com Signed-off-by: Jakub Kicinski commit 325d5c5fb216674296f3902a8902b942da3adc5b Author: Bodo Stroesser Date: Tue May 17 21:29:13 2022 +0200 scsi: target: tcmu: Avoid holding XArray lock when calling lock_page In tcmu_blocks_release(), lock_page() is called to prevent a race causing possible data corruption. Since lock_page() might sleep, calling it while holding XArray lock is a bug. To fix this, replace the xas_for_each() call with xa_for_each_range(). Since the latter does its own handling of XArray locking, the xas_lock() and xas_unlock() calls around the original loop are no longer necessary. The switch to xa_for_each_range() slows down the loop slightly. This is acceptable since tcmu_blocks_release() is not relevant for performance. Link: https://lore.kernel.org/r/20220517192913.21405-1-bostroesser@gmail.com Fixes: bb9b9eb0ae2e ("scsi: target: tcmu: Fix possible data corruption") Reported-by: Dan Carpenter Signed-off-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit d627660c22b51121262c03dfa1a51bf54361f5a9 Author: Haowen Bai Date: Tue May 17 09:25:36 2022 +0800 scsi: elx: efct: Remove NULL check after calling container_of() container_of() will never return NULL. Link: https://lore.kernel.org/r/1652750737-22673-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 91fdd0788878862581128c86025c8a6262aeb868 Author: Haowen Bai Date: Tue May 10 17:47:03 2022 +0800 scsi: dpt_i2o: Drop redundant spinlock initialization adpt_post_wait_lock was declared and initialized by DEFINE_SPINLOCK so we don't need to call spin_lock_init(). Drop the call. Link: https://lore.kernel.org/r/1652176024-3981-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit fc65df48c88ea0b7d4bcbccdc59ffeedc64222c2 Author: Colin Ian King Date: Tue May 17 10:25:18 2022 +0100 scsi: qedf: Remove redundant variable op The variable 'op' is assigned a value and is never read. The variable is not used and is redundant, remove it. Link: https://lore.kernel.org/r/20220517092518.93159-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 6c6ac8b7773f05f93dc4e4044686e059d1f78dea Author: John Garry Date: Tue May 17 16:04:21 2022 +0800 scsi: hisi_sas: Fix memory ordering in hisi_sas_task_deliver() The memories for the slot should be observed to be written prior to observing the slot as ready. Prior to commit 26fc0ea74fcb ("scsi: libsas: Drop SAS_TASK_AT_INITIATOR"), we had a spin_lock() + spin_unlock() immediately before marking the slot as ready. The spin_unlock() - with release semantics - caused the slot memory to be observed to be written. Now that the spin_lock() + spin_unlock() is gone, use a smp_wmb(). Link: https://lore.kernel.org/r/1652774661-12935-1-git-send-email-john.garry@huawei.com Fixes: 26fc0ea74fcb ("scsi: libsas: Drop SAS_TASK_AT_INITIATOR") Reported-by: Yihang Li Tested-by: Yihang Li Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit b559b99a5c08194c14dc271e69ca786771b353dc Author: Karan Tilak Kumar Date: Fri May 13 13:56:05 2022 -0700 scsi: fnic: Replace DMA mask of 64 bits with 47 bits Cisco VIC supports only 47 bits. If the host sends DMA addresses that are greater than 47 bits, it causes work queue (WQ) errors in the VIC. Link: https://lore.kernel.org/r/20220513205605.81788-1-kartilak@cisco.com Tested-by: Karan Tilak Kumar Co-developed-by: Dhanraj Jhawar Signed-off-by: Dhanraj Jhawar Co-developed-by: Sesidhar Baddela Signed-off-by: Sesidhar Baddela Signed-off-by: Arulprabhu Ponnusamy Signed-off-by: Karan Tilak Kumar Signed-off-by: Martin K. Petersen commit 9feb5c4c3f95ec42fc12dc92f7216c2603b1a571 Author: Sreekanth Reddy Date: Tue May 17 17:23:10 2022 +0530 scsi: mpi3mr: Add target device related sysfs attributes Add sysfs attributes for exposing target device details such as SAS address, firmware device handle, and persistent ID for the controller-attached devices and RAID volumes. Link: https://lore.kernel.org/r/20220517115310.13062-3-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit e51e76edddb10867f95df0c24a9769d6d97afeb0 Author: Sreekanth Reddy Date: Tue May 17 17:23:09 2022 +0530 scsi: mpi3mr: Add shost related sysfs attributes Add shost related sysfs attributes to display the controller's firmware version, queue depth, number of requests, and number of reply queues. Also add an attribute to set & get the logging_level. Link: https://lore.kernel.org/r/20220517115310.13062-2-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit e79aaa9cc02dd39061eb4e2c7d156532a31da975 Author: Harshit Mogalapalli Date: Thu May 5 07:36:57 2022 -0700 scsi: elx: efct: Remove redundant memset() statement As memset() of bmbx is immediately followed by a memcpy() where bmbx is the destination, the memset() is redundant. Link: https://lore.kernel.org/r/20220505143703.45441-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Harshit Mogalapalli Signed-off-by: Martin K. Petersen commit 2f9e9a7b0ce38471c6f22a762adca6a977edfa7d Author: Harshit Mogalapalli Date: Thu May 5 07:32:13 2022 -0700 scsi: megaraid_sas: Remove redundant memset() statement As memset() of scmd->sense_buffer is immediately followed by a memcpy() where scmd->sense_buffer is the destination. The memset() is redundant. Link: https://lore.kernel.org/r/20220505143214.44908-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Harshit Mogalapalli Signed-off-by: Martin K. Petersen commit bc7896d31a922ee9caabb10dc07509f65d41dc0e Author: Dan Carpenter Date: Thu May 5 13:25:52 2022 +0300 scsi: mpi3mr: Return error if dma_alloc_coherent() fails Return -ENOMEM instead of success if dma_alloc_coherent() fails. Link: https://lore.kernel.org/r/YnOmMGHqCOtUCYQ1@kili Fixes: 43ca11005098 ("scsi: mpi3mr: Add support for PEL commands") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit e9dedc13bb11bc553754abecb322e5e41d1b4fef Author: John Garry Date: Thu May 12 19:15:34 2022 +0800 scsi: hisi_sas: Fix rescan after deleting a disk Removing an ATA device via sysfs means that the device may not be found through re-scanning: root@ubuntu:/home/john# lsscsi [0:0:0:0] disk SanDisk LT0200MO P404 /dev/sda [0:0:1:0] disk ATA HGST HUS724040AL A8B0 /dev/sdb [0:0:8:0] enclosu 12G SAS Expander RevB - root@ubuntu:/home/john# echo 1 > /sys/block/sdb/device/delete root@ubuntu:/home/john# echo "- - -" > /sys/class/scsi_host/host0/scan root@ubuntu:/home/john# lsscsi [0:0:0:0] disk SanDisk LT0200MO P404 /dev/sda [0:0:8:0] enclosu 12G SAS Expander RevB - root@ubuntu:/home/john# The problem is that the rescan of the device may conflict with the device in being re-initialized, as follows: - In the rescan we call hisi_sas_slave_alloc() in store_scan() -> sas_user_scan() -> [__]scsi_scan_target() -> scsi_probe_and_add_lunc() -> scsi_alloc_sdev() -> hisi_sas_slave_alloc() -> hisi_sas_init_device() In hisi_sas_init_device() we issue an IT nexus reset for ATA devices - That IT nexus causes the remote PHY to go down and this triggers a bcast event - In parallel libsas processes the bcast event, finds that the phy is down and marks the device as gone The hard reset issued in hisi_sas_init_device() is unncessary - as described in the code comment - so remove it. Also set dev status as HISI_SAS_DEV_NORMAL as the hisi_sas_init_device() call. Link: https://lore.kernel.org/r/1652354134-171343-4-git-send-email-john.garry@huawei.com Fixes: 36c6b7613ef1 ("scsi: hisi_sas: Initialise devices in .slave_alloc callback") Tested-by: Yihang Li Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 71453bd9d1bfa2a75f742ac8ad75c084097e9a50 Author: John Garry Date: Thu May 12 19:15:33 2022 +0800 scsi: hisi_sas: Use sas_ata_wait_after_reset() in IT nexus reset We have seen errors like this when a SATA device is probed: [524.566298] hisi_sas_v3_hw 0000L74:02.0: erroneous completion iptt=4096 ... [524.582827] sas: TMF task open reject failed 500e004aaaaaaaa00 Since commit 21c7e972475e ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure"), we issue an ATA softreset to disks after a phy reset to ensure that they are in sound working order. If the softreset is issued before the remote phy has come back up then the softreset will fail (errors as above). Remedy this by waiting for the phy to come back up after the reset. Link: https://lore.kernel.org/r/1652354134-171343-3-git-send-email-john.garry@huawei.com Tested-by: Yihang Li Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 057e5fc03369f8f2ed9b2ca884754b1d80b83620 Author: John Garry Date: Thu May 12 19:15:32 2022 +0800 scsi: libsas: Refactor sas_ata_hard_reset() Create function sas_ata_wait_after_reset() from sas_ata_hard_reset() as some LLDDs may want to check for a remote ATA phy is up after reset. Link: https://lore.kernel.org/r/1652354134-171343-2-git-send-email-john.garry@huawei.com Tested-by: Yihang Li Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 53d5088deff64c526ac52b39ce1244ce10372367 Author: Sreekanth Reddy Date: Wed May 11 12:56:21 2022 +0530 scsi: mpt3sas: Update driver version to 42.100.00.00 Update driver version to 42.100.00.00. Link: https://lore.kernel.org/r/20220511072621.30657-2-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 8e129add48e0c35a8f1bf5df91f50a438dd75ba6 Author: Sreekanth Reddy Date: Wed May 11 12:56:20 2022 +0530 scsi: mpt3sas: Fix junk chars displayed while printing ChipName Terminate string after copying 16 bytes of ChipName data from Manufacturing Page0 to prevent %s from printing junk characters. Link: https://lore.kernel.org/r/20220511072621.30657-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 5cebb40bc9554aafcc492431181f43c6231b0459 Author: Harini Katakam Date: Wed May 18 22:37:56 2022 +0530 net: macb: Fix PTP one step sync support PTP one step sync packets cannot have CSUM padding and insertion in SW since time stamp is inserted on the fly by HW. In addition, ptp4l version 3.0 and above report an error when skb timestamps are reported for packets that not processed for TX TS after transmission. Add a helper to identify PTP one step sync and fix the above two errors. Add a common mask for PTP header flag field "twoStepflag". Also reset ptp OSS bit when one step is not selected. Fixes: ab91f0a9b5f4 ("net: macb: Add hardware PTP support") Fixes: 653e92a9175e ("net: macb: add support for padding and fcs computation") Signed-off-by: Harini Katakam Reviewed-by: Radhey Shyam Pandey Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220518170756.7752-1-harini.katakam@xilinx.com Signed-off-by: Jakub Kicinski commit 5876ee756c8169241d43f6bf769ac1e2fc186094 Author: Chen-Yu Tsai Date: Thu May 19 15:16:10 2022 +0800 clk: mediatek: mt8173: Switch to clk_hw provider APIs As part of the effort to improve the MediaTek clk drivers, the next step is to switch from the old 'struct clk' clk prodivder APIs to the new 'struct clk_hw' ones. The MT8173 clk driver has one clk that is registered directly with the clk provider APIs, instead of going through the MediaTek clk library. Switch this instance to use the clk_hw provider API. Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Tested-by: Miles Chen Link: https://lore.kernel.org/r/20220519071610.423372-6-wenst@chromium.org Signed-off-by: Stephen Boyd commit 6f691a58629659577d98f0364b573c3dd11a3356 Author: Chen-Yu Tsai Date: Thu May 19 15:16:09 2022 +0800 clk: mediatek: Switch to clk_hw provider APIs As part of the effort to improve the MediaTek clk drivers, the next step is to switch from the old 'struct clk' clk prodivder APIs to the new 'struct clk_hw' ones. In a previous patch, 'struct clk_onecell_data' was replaced with 'struct clk_hw_onecell_data', with (struct clk_hw *)->clk and __clk_get_hw() bridging the new data structures and old code. Now switch from the old 'clk_(un)?register*()' APIs to the new 'clk_hw_(un)?register*()' ones. This is done with the coccinelle script below. Unfortunately this also leaves clk-mt8173.c with a compile error that would need a coccinelle script longer than the actual diff to fix. This last part is fixed up by hand. // Fix prototypes @@ identifier F =~ "^mtk_clk_register_"; @@ - struct clk * + struct clk_hw * F(...); // Fix calls to mtk_clk_register_ @ reg @ identifier F =~ "^mtk_clk_register_"; identifier FS =~ "^mtk_clk_register_[a-z_]*s"; identifier I; expression clk_data; expression E; @@ FS(...) { ... - struct clk *I; + struct clk_hw *hw; ... for (...;...;...) { ... ( - I + hw = - clk_register_fixed_rate( + clk_hw_register_fixed_rate( ... ); | - I + hw = - clk_register_fixed_factor( + clk_hw_register_fixed_factor( ... ); | - I + hw = - clk_register_divider( + clk_hw_register_divider( ... ); | - I + hw = F(...); ) ... if ( - IS_ERR(I) + IS_ERR(hw) ) { pr_err(..., - I + hw ,...); ... } - clk_data->hws[E] = __clk_get_hw(I); + clk_data->hws[E] = hw; } ... } @ depends on reg @ identifier reg.I; @@ return PTR_ERR( - I + hw ); // Fix mtk_clk_register_composite to return clk_hw instead of clk @@ identifier I, R; expression E; @@ - struct clk * + struct clk_hw * mtk_clk_register_composite(...) { ... - struct clk *I; + struct clk_hw *hw; ... - I = clk_register_composite( + hw = clk_hw_register_composite( ...); if (IS_ERR( - I + hw )) { ... R = PTR_ERR( - I + hw ); ... } return - I + hw ; ... } // Fix other mtk_clk_register_ to return clk_hw instead of clk @@ identifier F =~ "^mtk_clk_register_"; identifier I, D, C; expression E; @@ - struct clk * + struct clk_hw * F(...) { ... - struct clk *I; + int ret; ... - I = clk_register(D, E); + ret = clk_hw_register(D, E); ... ( - if (IS_ERR(I)) + if (ret) { kfree(C); + return ERR_PTR(ret); + } | - if (IS_ERR(I)) + if (ret) { kfree(C); - return I; + return ERR_PTR(ret); } ) - return I; + return E; } // Fix mtk_clk_unregister_ to take clk_hw instead of clk @@ identifier F =~ "^mtk_clk_unregister_"; identifier I, I2; @@ static void F( - struct clk *I + struct clk_hw *I2 ) { ... - struct clk_hw *I2; ... - I2 = __clk_get_hw(I); ... ( - clk_unregister(I); + clk_hw_unregister(I2); | - clk_unregister_composite(I); + clk_hw_unregister_composite(I2); ) ... } // Fix calls to mtk_clk_unregister_*() @@ identifier F =~ "^mtk_clk_unregister_"; expression I; expression E; @@ - F(I->hws[E]->clk); + F(I->hws[E]); Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Tested-by: Miles Chen Link: https://lore.kernel.org/r/20220519071610.423372-5-wenst@chromium.org Signed-off-by: Stephen Boyd commit 609cc5e1a82394e0b704fd41439fa751f8a9edf2 Author: Chen-Yu Tsai Date: Thu May 19 15:16:08 2022 +0800 clk: mediatek: Replace 'struct clk' with 'struct clk_hw' As part of the effort to improve the MediaTek clk drivers, the next step is to switch from the old 'struct clk' clk prodivder APIs to the new 'struct clk_hw' ones. Instead of adding new APIs to the MediaTek clk driver library mirroring the existing ones, moving all drivers to the new APIs, and then removing the old ones, just migrate everything at the same time. This involves replacing 'struct clk' with 'struct clk_hw', and 'struct clk_onecell_data' with 'struct clk_hw_onecell_data', and fixing up all usages. For now, the clk_register() and co. usage is retained, with __clk_get_hw() and (struct clk_hw *)->clk used to bridge the difference between the APIs. These will be replaced in subsequent patches. Fix up mtk_{alloc,free}_clk_data to use 'struct clk_hw' by hand. Fix up all other affected call sites with the following coccinelle script. // Replace type @@ @@ - struct clk_onecell_data + struct clk_hw_onecell_data // Replace of_clk_add_provider() & of_clk_src_simple_get() @@ expression NP, DATA; symbol of_clk_src_onecell_get; @@ - of_clk_add_provider( + of_clk_add_hw_provider( NP, - of_clk_src_onecell_get, + of_clk_hw_onecell_get, DATA ) // Fix register/unregister @@ identifier CD; expression E; identifier fn =~ "unregister"; @@ fn(..., - CD->clks[E] + CD->hws[E]->clk ,... ); // Fix calls to clk_prepare_enable() @@ identifier CD; expression E; @@ clk_prepare_enable( - CD->clks[E] + CD->hws[E]->clk ); // Fix pointer assignment @@ identifier CD; identifier CLK; expression E; @@ - CD->clks[E] + CD->hws[E] = ( - CLK + __clk_get_hw(CLK) | ERR_PTR(...) ) ; // Fix pointer usage @@ identifier CD; expression E; @@ - CD->clks[E] + CD->hws[E] // Fix mtk_clk_pll_get_base() @@ symbol clk, hw, data; @@ mtk_clk_pll_get_base( - struct clk *clk, + struct clk_hw *hw, const struct mtk_pll_data *data ) { - struct clk_hw *hw = __clk_get_hw(clk); ... } // Fix mtk_clk_pll_get_base() usage @@ identifier CD; expression E; @@ mtk_clk_pll_get_base( - CD->clks[E] + CD->hws[E]->clk ,... ); Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Tested-by: AngeloGioacchino Del Regno Tested-by: Miles Chen Link: https://lore.kernel.org/r/20220519071610.423372-4-wenst@chromium.org Signed-off-by: Stephen Boyd commit 012715ad7cc44b70d29a8dfa87448ecddba608d0 Author: Chen-Yu Tsai Date: Thu May 19 15:16:07 2022 +0800 clk: mediatek: apmixed: Drop error message from clk_register() failure mtk_clk_register_ref2usb_tx() prints an error message if clk_register() fails. It doesn't if kzalloc() fails though. The caller would then tack on its own error message to handle this. Also, All other clk registration functions in the MediaTek clk library leave the error message printing to the bulk registration functions, while the helpers that register individual clks just return error codes. Drop the error message that is printed when clk_register() fails in mtk_clk_register_ref2usb_tx() to make its behavior consistent both across its failure modes, and with the rest of the driver library. Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Tested-by: Miles Chen Link: https://lore.kernel.org/r/20220519071610.423372-3-wenst@chromium.org Signed-off-by: Stephen Boyd commit f247c17d03e476c47c3de9dab41f0e89391a1e0b Author: Chen-Yu Tsai Date: Thu May 19 15:16:06 2022 +0800 clk: mediatek: Make mtk_clk_register_composite() static mtk_clk_register_composite() is not used anywhere outside of the file it is defined. Make it static. Fixes: 9741b1a68035 ("clk: mediatek: Add initial common clock support for Mediatek SoCs.") Signed-off-by: Chen-Yu Tsai Reviewed-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Tested-by: Miles Chen Link: https://lore.kernel.org/r/20220519071610.423372-2-wenst@chromium.org Signed-off-by: Stephen Boyd commit af629ec8ec31fa250251f940f2d21a742b3d9e0a Merge: 3123109284176 b35f27fe73d8c Author: Stephen Boyd Date: Thu May 19 16:54:31 2022 -0700 Merge tag 'clk-v5.19-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into clk-samsung Pull Samsung clk driver updates from Sylwester Nawrocki: - clock driver for exynosautov9 SoC * tag 'clk-v5.19-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk: clk: samsung: exynosautov9: add cmu_peric1 clock support clk: samsung: exynosautov9: add cmu_peric0 clock support clk: samsung: exynosautov9: add cmu_fsys2 clock support clk: samsung: exynosautov9: add cmu_busmc clock support clk: samsung: exynosautov9: add cmu_peris clock support clk: samsung: exynosautov9: add cmu_core clock support clk: samsung: add top clock support for Exynos Auto v9 SoC dt-bindings: clock: add Exynos Auto v9 SoC CMU bindings dt-bindings: clock: add clock binding definitions for Exynos Auto v9 commit fcf8962827b4fb224a10c786b0f048f444b76384 Merge: d353e1a3bafd4 1a6dd99966998 Author: Jakub Kicinski Date: Thu May 19 16:49:05 2022 -0700 Merge tag 'linux-can-next-for-5.19-20220519' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-05-19 Oliver Hartkopp contributes a patch for the ISO-TP CAN protocol to update the validation of address information during bind. The next patch is by Jakub Kicinski and converts the CAN network drivers from netif_napi_add() to the netif_napi_add_weight() function. Another patch by Oliver Hartkopp removes obsolete CAN specific LED support. Vincent Mailhol's patch for the mcp251xfd driver fixes a -Wunaligned-access warning by clang-14. * tag 'linux-can-next-for-5.19-20220519' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: mcp251xfd: silence clang's -Wunaligned-access warning can: can-dev: remove obsolete CAN LED support can: can-dev: move to netif_napi_add_weight() can: isotp: isotp_bind(): do not validate unused address information ==================== Link: https://lore.kernel.org/r/20220519202308.1435903-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 83a7a614ce584c469bf8abfc2cd539701bd7d4e9 Merge: 7eb6369d7acfe 838b3e28488f7 Author: Palmer Dabbelt Date: Thu May 19 15:18:47 2022 -0700 riscv: kexec: add kexec_file_load() support This patch set implements kexec_file_load() for RISC-V, which is currently only allowed on rv64 due to some minor build issues on 32-bit platforms in the generic code. This allows users to kexec() using an FD as opposed to a buffer. Link: https://lore.kernel.org/all/20220408100914.150110-1-lizhengyu3@huawei.com/ * palmer/riscv-kexec_file: RISC-V: Load purgatory in kexec_file RISC-V: Add purgatory RISC-V: Support for kexec_file on panic RISC-V: Add kexec_file support RISC-V: use memcpy for kexec_file mode kexec_file: Fix kexec_file.c build error for riscv platform commit 6a31a95135da0bb2c5349e49e37d76e9909ab7ea Author: Phillip Potter Date: Thu May 19 23:10:47 2022 +0100 staging: r8188eu: remove include/rtw_debug.h Remove include/rtw_debug.h, as all it now has are: (1) A load of unused preprocessor definitions that expand to BIT(x) variants. (2) A preprocessor definition that expands to the name of the driver and is only used in one place inside a pr_info_once call in core/rtw_fw.c. It is now surplus to requirements after fixing up the few places that include the file. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220519221047.6940-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit f538ce1123856422be2e2f2bad9b51cf39ca94c1 Author: Rob Herring Date: Thu Apr 28 10:41:54 2022 -0500 dt-bindings: clock: Replace common binding with link to schema The contents of the clock binding have been moved to the clock binding schema in the dtschema repository. The desire is for common bindings to be hosted in the dtschema repository. Replace the contents with a link to the clock binding schema as there are still many references to clock-bindings.txt in the tree. This will prevent additions without a schema. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220428154154.2284317-1-robh@kernel.org Signed-off-by: Stephen Boyd commit 22511e665eadc2c49021886d07aaef39db90ca82 Author: Matthew Gerlach Date: Sun May 8 07:26:24 2022 -0700 arm64: dts: intel: add device tree for n6000 Add a device tree for the n6000 instantiation of Agilex Hard Processor System (HPS). Signed-off-by: Matthew Gerlach Signed-off-by: Dinh Nguyen commit af657d7f40423bac0c898e0d89a3539ea0d1043a Author: Matthew Gerlach Date: Sun May 8 07:26:23 2022 -0700 dt-bindings: intel: add binding for Intel n6000 Add the binding string for the Agilex based Intel n6000 board. Signed-off-by: Matthew Gerlach Acked-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit 79af73b31ab281277cec8f5d102364b9c64588c1 Author: Matthew Gerlach Date: Sun May 8 07:26:22 2022 -0700 dt-bindings: soc: add bindings for Intel HPS Copy Engine Add device tree bindings documentation for the Intel Hard Processor System (HPS) Copy Engine. Signed-off-by: Matthew Gerlach Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit 0ae084d5a6744b1318407d8e20fb88ac0fd85d47 Author: Hans de Goede Date: Thu May 19 17:21:50 2022 +0200 x86/PCI: Disable E820 reserved region clipping starting in 2023 Some firmware includes unusable space (host bridge registers, hidden PCI device BARs, etc) in PCI host bridge _CRS. As far as we know, there's nothing in the ACPI, UEFI, or PCI Firmware spec that requires the OS to remove E820 reserved regions from _CRS, so this seems like a firmware defect. As a workaround, 4dc2287c1805 ("x86: avoid E820 regions when allocating address space") has clipped out the unusable space in the past. This is required for machines like the following: - Dell Precision T3500 (the original motivator for 4dc2287c1805); see https://bugzilla.kernel.org/show_bug.cgi?id=16228 - Asus C523NA (Coral) Chromebook; see https://lore.kernel.org/all/4e9fca2f-0af1-3684-6c97-4c35befd5019@redhat.com/ - Lenovo ThinkPad X1 Gen 2; see: https://bugzilla.redhat.com/show_bug.cgi?id=2029207 But other firmware supplies E820 reserved regions that cover entire _CRS windows, and clipping throws away the entire window, leaving none for hot-added or uninitialized devices. This clipping breaks a whole range of Lenovo IdeaPads, Yogas, Yoga Slims, and notebooks, as well as Acer Spin 5 and Clevo X170KM-G Barebone machines. E820 reserved entries that cover a memory-mapped PCI host bridge, including its registers and memory/IO windows, are probably *not* a firmware defect. Per ACPI v5.4, sec 15.2, the E820 memory map may include: Address ranges defined for baseboard memory-mapped I/O devices, such as APICs, are returned as reserved. Disable the E820 clipping by default for all post-2022 machines. We already have quirks to disable clipping for pre-2023 machines, and we'll likely need quirks to *enable* clipping for post-2022 machines that incorrectly include unusable space in _CRS, including Chromebooks and Lenovo ThinkPads. Here's the rationale for doing this. If we do nothing, and continue clipping by default: - Future systems like the Lenovo IdeaPads, Yogas, etc, Acer Spin, and Clevo Barebones will require new quirks to disable clipping. - The problem here is E820 entries that cover entire _CRS windows that should not be clipped out. - I think these E820 entries are legal per spec, and it would be hard to get BIOS vendors to change them. - We will discover new systems that need clipping disabled piecemeal as they are released. - Future systems like Lenovo X1 Carbon and the Chromebooks (probably anything using coreboot) will just work, even though their _CRS is incorrect, so we will not notice new ones that rely on the clipping. - BIOS updates will not require new quirks unless they change the DMI model string. If we add the date check in this commit that disables clipping, e.g., "no clipping when date >= 2023": - Future systems like Lenovo *IIL*, Acer Spin, and Clevo Barebones will just work without new quirks. - Future systems like Lenovo X1 Carbon and the Chromebooks will require new quirks to *enable* clipping. - The problem here is that _CRS contains regions that are not usable by PCI devices, and we rely on the E820 kludge to clip them out. - I think this use of E820 is clearly a firmware bug, so we have a fighting chance of getting it changed eventually. - BIOS updates after the cutoff date *will* require quirks, but only for systems like Lenovo X1 Carbon and Chromebooks that we already think have broken firmware. It seems to me like it's better to add quirks for firmware that we think is broken than for firmware that seems unusual but correct. [bhelgaas: comment and commit log] Link: https://lore.kernel.org/linux-pci/20220518220754.GA7911@bhelgaas/ Link: https://lore.kernel.org/r/20220519152150.6135-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki Cc: Benoit Grégoire Cc: Hui Wang commit d341838d776abadb3ac48abdd2f1f40df5a4fc10 Author: Hans de Goede Date: Thu May 19 17:21:49 2022 +0200 x86/PCI: Disable E820 reserved region clipping via quirks To avoid unusable space that some firmware includes in PCI host bridge _CRS, Linux currently excludes E820 reserved regions from _CRS windows; see 4dc2287c1805 ("x86: avoid E820 regions when allocating address space"). However, some systems supply E820 reserved regions that cover the entire memory window from _CRS, so clipping them out leaves no space for hot-added or uninitialized PCI devices. For example, from a Lenovo IdeaPad 3 15IIL 81WE: BIOS-e820: [mem 0x4bc50000-0xcfffffff] reserved pci_bus 0000:00: root bus resource [mem 0x65400000-0xbfffffff window] pci 0000:00:15.0: BAR 0: [mem 0x00000000-0x00000fff 64bit] pci 0000:00:15.0: BAR 0: no space for [mem size 0x00001000 64bit] Add quirks to disable the E820 clipping for machines known to do this. A single DMI_PRODUCT_VERSION "IIL" quirk matches all the below: Lenovo IdeaPad 3 14IIL05 Lenovo IdeaPad 3 15IIL05 Lenovo IdeaPad 3 17IIL05 Lenovo IdeaPad 5 14IIL05 Lenovo IdeaPad 5 15IIL05 Lenovo IdeaPad Slim 7 14IIL05 Lenovo IdeaPad Slim 7 15IIL05 Lenovo IdeaPad S145-15IIL Lenovo IdeaPad S340-14IIL Lenovo IdeaPad S340-15IIL Lenovo IdeaPad C340-15IIL Lenovo BS145-15IIL Lenovo V14-IIL Lenovo V15-IIL Lenovo V17-IIL Lenovo Yoga C940-14IIL Lenovo Yoga S740-14IIL Lenovo Yoga Slim 7 14IIL05 Lenovo Yoga Slim 7 15IIL05 in addition to the following that don't actually need it because they have no E820 reserved regions that overlap _CRS windows: Lenovo IdeaPad Flex 5 14IIL05 Lenovo IdeaPad Flex 5 15IIL05 Lenovo ThinkBook 14-IIL Lenovo ThinkBook 15-IIL Lenovo Yoga S940-14IIL Other quirks match these: Acer Spin 5 (SP513-54N) Clevo X170KM-G Barebone Link: https://bugzilla.kernel.org/show_bug.cgi?id=206459 Lenovo Yoga C940-14IIL Link: https://bugzilla.kernel.org/show_bug.cgi?id=214259 Clevo X170KM Barebone Link: https://bugzilla.redhat.com/show_bug.cgi?id=1868899 Lenovo IdeaPad 3 15IIL05 Link: https://bugzilla.redhat.com/show_bug.cgi?id=1871793 Lenovo IdeaPad 5 14IIL05 Link: https://bugs.launchpad.net/bugs/1878279 Lenovo IdeaPad 5 14IIL05 Link: https://bugs.launchpad.net/bugs/1880172 Lenovo IdeaPad 3 14IIL05 Link: https://bugs.launchpad.net/bugs/1884232 Acer Spin SP513-54N Link: https://bugs.launchpad.net/bugs/1921649 Lenovo IdeaPad S145 Link: https://bugs.launchpad.net/bugs/1931715 Lenovo IdeaPad S145 Link: https://bugs.launchpad.net/bugs/1932069 Lenovo BS145-15IIL Link: https://lore.kernel.org/r/20220519152150.6135-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki Cc: Benoit Grégoire Cc: Hui Wang commit bae19fdd7e9e759580ac4693d2df3bc23ab415d7 Author: Sandipan Das Date: Wed May 18 14:13:27 2022 +0530 perf/x86/amd/core: Fix reloading events for SVM Commit 1018faa6cf23 ("perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled") addresses an issue in which the Host-Only bit in the counter control registers needs to be masked off when SVM is not enabled. The events need to be reloaded whenever SVM is enabled or disabled for a CPU and this requires the PERF_CTL registers to be reprogrammed using {enable,disable}_all(). However, PerfMonV2 variants of these functions do not reprogram the PERF_CTL registers. Hence, the legacy enable_all() function should also be called. Fixes: 9622e67e3980 ("perf/x86/amd/core: Add PerfMonV2 counter control") Reported-by: Like Xu Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220518084327.464005-1-sandipan.das@amd.com commit 991d8d8142cad94f9c5c05db25e67fa83d6f772a Author: Dietmar Eggemann Date: Fri May 13 11:34:33 2022 +0200 topology: Remove unused cpu_cluster_mask() default_topology[] uses cpu_clustergroup_mask() for the CLS level (guarded by CONFIG_SCHED_CLUSTER) which is currently provided by x86 (arch/x86/kernel/smpboot.c) and arm64 (drivers/base/arch_topology.c). Fixes: 778c558f49a2c ("sched: Add cluster scheduler level in core and related Kconfig for ARM64") Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Barry Song Link: https://lore.kernel.org/r/20220513093433.425163-1-dietmar.eggemann@arm.com commit 546a3fee174969ff323d70ff27b1ef181f0d7ceb Author: Peter Zijlstra Date: Tue May 17 13:46:54 2022 +0200 sched: Reverse sched_class layout Because GCC-12 is fully stupid about array bounds and it's just really hard to get a solid array definition from a linker script, flip the array order to avoid needing negative offsets :-/ This makes the whole relational pointer magic a little less obvious, but alas. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/YoOLLmLG7HRTXeEm@hirez.programming.kicks-ass.net commit 69505e3d9a39a988aaed9b58aa6b3482238f6516 Author: Josh Poimboeuf Date: Thu May 12 06:56:23 2022 -0700 bug: Use normal relative pointers in 'struct bug_entry' With CONFIG_GENERIC_BUG_RELATIVE_POINTERS, the addr/file relative pointers are calculated weirdly: based on the beginning of the bug_entry struct address, rather than their respective pointer addresses. Make the relative pointers less surprising to both humans and tools by calculating them the normal way. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Acked-by: Peter Zijlstra (Intel) Acked-by: Sven Schnelle # s390 Acked-by: Michael Ellerman (powerpc) Acked-by: Catalin Marinas Tested-by: Mark Rutland [arm64] Link: https://lkml.kernel.org/r/f0e05be797a16f4fc2401eeb88c8450dcbe61df6.1652362951.git.jpoimboe@kernel.org commit 8491d1bdf5de152f27fc941e2dcdc4e66c950542 Author: Uros Bizjak Date: Wed May 18 20:49:53 2022 +0200 sched/clock: Use try_cmpxchg64 in sched_clock_{local,remote} Use try_cmpxchg64 instead of cmpxchg64 (*ptr, old, new) != old in sched_clock_{local,remote}. x86 cmpxchg returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Signed-off-by: Uros Bizjak Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220518184953.3446778-1-ubizjak@gmail.com commit 036c07c0c3b8a57d5c96e1f2aab62da0056f8f21 Author: Josh Poimboeuf Date: Thu May 19 11:46:58 2022 -0700 x86/entry: Fix register corruption in compat syscall A panic was reported in the init process on AMD: Run /sbin/init as init process init[1]: segfault at f7fd5ca0 ip 00000000f7f5bbc7 sp 00000000ffa06aa0 error 7 in libc.so[f7f51000+4e000] Code: 8a 44 24 10 88 41 ff 8b 44 24 10 83 c4 2c 5b 5e 5f 5d c3 53 83 ec 08 8b 5c 24 10 81 fb 00 f0 ff ff 76 0c e8 ba dc ff ff f7 db <89> 18 83 cb ff 83 c4 08 89 d8 5b c3 e8 81 60 ff ff 05 28 84 07 00 Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b CPU: 1 PID: 1 Comm: init Tainted: G W 5.18.0-rc7-next-20220519 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x57/0x7d panic+0x10f/0x28d do_exit.cold+0x18/0x48 do_group_exit+0x2e/0xb0 get_signal+0xb6d/0xb80 arch_do_signal_or_restart+0x31/0x760 ? show_opcodes.cold+0x1c/0x21 ? force_sig_fault+0x49/0x70 exit_to_user_mode_prepare+0x131/0x1a0 irqentry_exit_to_user_mode+0x5/0x30 asm_exc_page_fault+0x27/0x30 RIP: 0023:0xf7f5bbc7 Code: 8a 44 24 10 88 41 ff 8b 44 24 10 83 c4 2c 5b 5e 5f 5d c3 53 83 ec 08 8b 5c 24 10 81 fb 00 f0 ff ff 76 0c e8 ba dc ff ff f7 db <89> 18 83 cb ff 83 c4 08 89 d8 5b c3 e8 81 60 ff ff 05 28 84 07 00 RSP: 002b:00000000ffa06aa0 EFLAGS: 00000217 RAX: 00000000f7fd5ca0 RBX: 000000000000000c RCX: 0000000000001000 RDX: 0000000000000001 RSI: 00000000f7fd5b60 RDI: 00000000f7fd5b60 RBP: 00000000f7fd1c1c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The task's CX register got corrupted by commit 8c42819b61b8 ("x86/entry: Use PUSH_AND_CLEAR_REGS for compat"), which overlooked the fact that compat SYSCALL apparently stores the user's CX value in BP. Before that commit, CX was saved from its stashed value in BP: pushq %rbp /* pt_regs->cx (stashed in bp) */ But then it got changed to: pushq %rcx /* pt_regs->cx */ So the wrong value got saved and later restored back to the user. Fix it by pushing the correct value again (BP) for regs->cx. Fixes: 8c42819b61b8 ("x86/entry: Use PUSH_AND_CLEAR_REGS for compat") Reported-by: Guenter Roeck Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Tested-by: Guenter Roeck Link: https://lkml.kernel.org/r/b5a26592c9dd60bbacdf97974a7433fd802a5593.1652985970.git.jpoimboe@kernel.org commit 703db1f5da1e3a62b84356a29c150efa24a2377d Author: Bjorn Andersson Date: Tue Apr 26 14:21:36 2022 -0700 clk: qcom: rcg2: Cache CFG register updates for parked RCGs As GDSCs are turned on and off some associated clocks are momentarily enabled for house keeping purposes. For this, and similar, purposes the "shared RCGs" will park the RCG on a source clock which is known to be available. When the RCG is parked, a safe clock source will be selected and committed, then the original source would be written back and upon enable the change back to the unparked source would be committed. But starting with SM8350 this fails, as the value in CFG is committed by the GDSC handshake and without a ticking parent the GDSC enablement will time out. This becomes a concrete problem if the runtime supended state of a device includes disabling such rcg's parent clock. As the device attempts to power up the domain again the rcg will fail to enable and hence the GDSC enablement will fail, preventing the device from returning from the suspended state. This can be seen in e.g. the display stack during probe on SM8350. To avoid this problem, the software needs to ensure that the RCG is configured to a active parent clock while it is disabled. This is done by caching the CFG register content while the shared RCG is parked on this safe source. Writes to M, N and D registers are committed as they are requested. New helpers for get_parent() and recalc_rate() are extracted from their previous implementations and __clk_rcg2_configure() is modified to allow it to operate on the cached value. Fixes: 7ef6f11887bd ("clk: qcom: Configure the RCGs to a safe source as needed") Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20220426212136.1543984-1-bjorn.andersson@linaro.org commit d65d005f9a6cffb1efb205f3af4d0de8f1e3b352 Author: Bjorn Andersson Date: Wed May 4 19:54:57 2022 -0700 clk: qcom: add sc8280xp GCC driver Add support for the Global Clock Controller found in the Qualcomm SC8280XP platform. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20220505025457.1693716-3-bjorn.andersson@linaro.org commit a66a82f2a55ef1f47daeb45e0b4074d88ce5ca99 Author: Bjorn Andersson Date: Wed May 4 19:54:56 2022 -0700 dt-bindings: clock: Add Qualcomm SC8280XP GCC bindings Add binding for the Qualcomm SC8280XP Global Clock controller. The clock-names property is purposefully omitted, to clearly communicate to the writer (and reader) of the DeviceTree source based on this binding that the order of "clocks" is significant, in contrast to previous GCC bindings. Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220505025457.1693716-2-bjorn.andersson@linaro.org commit 69bc169ec33f101fe6d296976aaa34f51edbaa9e Author: Colin Ian King Date: Tue May 17 10:36:46 2022 +0100 fs/ntfs: remove redundant variable idx The variable idx is assigned a value and is never read. The variable is not used and is redundant, remove it. Cleans up clang scan build warning: warning: Although the value stored to 'idx' is used in the enclosing expression, the value is never actually read from 'idx' [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20220517093646.93628-2-colin.i.king@gmail.com Signed-off-by: Colin Ian King Reviewed-by: Anton Altaparmakov Signed-off-by: Andrew Morton commit 1213375077451337c2381a8b5b88502a3fc394a2 Author: Chung-Chiang Cheng Date: Tue May 3 23:25:36 2022 +0800 fat: remove time truncations in vfat_create/vfat_mkdir All the timestamps in vfat_create() and vfat_mkdir() come from fat_time_fat2unix() which ensures time granularity. We don't need to truncate them to fit FAT's format. Moreover, fat_truncate_crtime() and fat_timespec64_trunc_10ms() are also removed because there is no caller anymore. Link: https://lkml.kernel.org/r/20220503152536.2503003-4-cccheng@synology.com Signed-off-by: Chung-Chiang Cheng Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton commit 30abce053f811f52688a5b739c3e4ba98d34070d Author: Chung-Chiang Cheng Date: Tue May 3 23:25:35 2022 +0800 fat: report creation time in statx creation time is no longer mixed with change time. Add an in-memory field for it, and report it in statx if supported. Link: https://lkml.kernel.org/r/20220503152536.2503003-3-cccheng@synology.com Signed-off-by: Chung-Chiang Cheng Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton commit 0f9d148167c53a7029aba29cdc45072027033b72 Author: Chung-Chiang Cheng Date: Tue May 3 23:25:34 2022 +0800 fat: ignore ctime updates, and keep ctime identical to mtime in memory FAT supports creation time but not change time, and there was no corresponding timestamp for creation time in previous VFS. The original implementation took the compromise of saving the in-memory change time into the on-disk creation time field, but this would lead to compatibility issues with non-linux systems. To address this issue, this patch changes the behavior of ctime. It will no longer be loaded and stored from the creation time on disk. Instead of that, it'll be consistent with the in-memory mtime and share the same on-disk field. All updates to mtime will also be applied to ctime in memory, while all updates to ctime will be ignored. Link: https://lkml.kernel.org/r/20220503152536.2503003-2-cccheng@synology.com Signed-off-by: Chung-Chiang Cheng Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton commit 4dcc3f96e7439f9a3a6e47d7fc147aad1338ddc4 Author: Chung-Chiang Cheng Date: Tue May 3 23:25:33 2022 +0800 fat: split fat_truncate_time() into separate functions Separate fat_truncate_time() to each timestamps for later creation time work. This patch does not introduce any functional changes, it's merely refactoring change. Link: https://lkml.kernel.org/r/20220503152536.2503003-1-cccheng@synology.com Signed-off-by: Chung-Chiang Cheng Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton commit 504ed164d7cd858d25ed5e3413928e1397f4c567 Author: Muchun Song Date: Tue May 17 22:33:20 2022 +0800 MAINTAINERS: add Muchun as a memcg reviewer I have been focusing on mm for the past two years. e.g. developing, fixing bugs, reviewing. I have fixed lots of races (including memcg). I would like to help people working on memcg or related by reviewing their work. Let me be Cc'd on patches related to memcg. Link: https://lkml.kernel.org/r/20220517143320.99649-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Shakeel Butt Acked-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: Roman Gushchin Acked-by: FanJun Kong Signed-off-by: Andrew Morton commit 02e34fff195d3a5f67cbb553795dc109a37d1dcf Author: Kefeng Wang Date: Tue May 17 22:51:20 2022 +0800 mm: damon: use HPAGE_PMD_SIZE Use HPAGE_PMD_SIZE instead of open coding. Link: https://lkml.kernel.org/r/20220517145120.118523-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 2b132903de7124dd9a758be0c27562e91a510848 Author: Vasily Averin Date: Wed May 11 12:46:53 2022 +0300 tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate Fixes following sparse warnings: CHECK mm/vmscan.c mm/vmscan.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/vmscan.h): ./include/trace/events/vmscan.h:281:1: sparse: warning: cast to restricted isolate_mode_t ./include/trace/events/vmscan.h:281:1: sparse: warning: restricted isolate_mode_t degrades to integer Link: https://lkml.kernel.org/r/e85d7ff2-fd10-53f8-c24e-ba0458439c1b@openvz.org Signed-off-by: Vasily Averin Acked-by: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 37462a920392cb86541650a6f4121155f11f1199 Author: Christophe de Dinechin Date: Thu Apr 14 17:08:54 2022 +0200 nodemask.h: fix compilation error with GCC12 With gcc version 12.0.1 20220401 (Red Hat 12.0.1-0), building with defconfig results in the following compilation error: | CC mm/swapfile.o | mm/swapfile.c: In function `setup_swap_info': | mm/swapfile.c:2291:47: error: array subscript -1 is below array bounds | of `struct plist_node[]' [-Werror=array-bounds] | 2291 | p->avail_lists[i].prio = 1; | | ~~~~~~~~~~~~~~^~~ | In file included from mm/swapfile.c:16: | ./include/linux/swap.h:292:27: note: while referencing `avail_lists' | 292 | struct plist_node avail_lists[]; /* | | ^~~~~~~~~~~ This is due to the compiler detecting that the mask in node_states[__state] could theoretically be zero, which would lead to first_node() returning -1 through find_first_bit. I believe that the warning/error is legitimate. I first tried adding a test to check that the node mask is not emtpy, since a similar test exists in the case where MAX_NUMNODES == 1. However, adding the if statement causes other warnings to appear in for_each_cpu_node_but, because it introduces a dangling else ambiguity. And unfortunately, GCC is not smart enough to detect that the added test makes the case where (node) == -1 impossible, so it still complains with the same message. This is why I settled on replacing that with a harmless, but relatively useless (node) >= 0 test. Based on the warning for the dangling else, I also decided to fix the case where MAX_NUMNODES == 1 by moving the condition inside the for loop. It will still only be tested once. This ensures that the meaning of an else following for_each_node_mask or derivatives would not silently have a different meaning depending on the configuration. Link: https://lkml.kernel.org/r/20220414150855.2407137-3-dinechin@redhat.com Signed-off-by: Christophe de Dinechin Signed-off-by: Christophe de Dinechin Reviewed-by: Andrew Morton Cc: Ben Segall Cc: "Michael S. Tsirkin" Cc: Steven Rostedt Cc: Ingo Molnar Cc: Mel Gorman Cc: Dietmar Eggemann Cc: Vincent Guittot Cc: Paolo Bonzini Cc: Daniel Bristot de Oliveira Cc: Jason Wang Cc: Zhen Lei Cc: Juri Lelli Cc: Peter Zijlstra Cc: Signed-off-by: Andrew Morton commit 3f913fc5f9745613088d3c569778c9813ab9c129 Author: Qi Zheng Date: Thu May 19 14:08:55 2022 -0700 mm: fix missing handler for __GFP_NOWARN We expect no warnings to be issued when we specify __GFP_NOWARN, but currently in paths like alloc_pages() and kmalloc(), there are still some warnings printed, fix it. But for some warnings that report usage problems, we don't deal with them. If such warnings are printed, then we should fix the usage problems. Such as the following case: WARN_ON_ONCE((gfp_flags & __GFP_NOFAIL) && (order > 1)); [zhengqi.arch@bytedance.com: v2] Link: https://lkml.kernel.org/r/20220511061951.1114-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20220510113809.80626-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Akinobu Mita Cc: Vlastimil Babka Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 10e0f7530205799e7e971aba699a7cb3a47456de Author: Wonhyuk Yang Date: Thu May 19 14:08:54 2022 -0700 mm/page_alloc: fix tracepoint mm_page_alloc_zone_locked() Currently, trace point mm_page_alloc_zone_locked() doesn't show correct information. First, when alloc_flag has ALLOC_HARDER/ALLOC_CMA, page can be allocated from MIGRATE_HIGHATOMIC/MIGRATE_CMA. Nevertheless, tracepoint use requested migration type not MIGRATE_HIGHATOMIC and MIGRATE_CMA. Second, after commit 44042b4498728 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") percpu-list can store high order pages. But trace point determine whether it is a refiil of percpu-list by comparing requested order and 0. To handle these problems, make mm_page_alloc_zone_locked() only be called by __rmqueue_smallest with correct migration type. With a new argument called percpu_refill, it can show roughly whether it is a refill of percpu-list. Link: https://lkml.kernel.org/r/20220512025307.57924-1-vvghjk1234@gmail.com Signed-off-by: Wonhyuk Yang Acked-by: Mel Gorman Cc: Baik Song An Cc: Hong Yeon Kim Cc: Taeung Song Cc: Cc: Steven Rostedt Cc: Ingo Molnar Signed-off-by: Andrew Morton commit 3645b5ec0ad644942e363c9a695a6f4c783c0a43 Author: Fanjun Kong Date: Mon May 16 11:00:42 2022 +0800 mm/page_owner.c: add missing __initdata attribute This patch fixes two issues: 1. Add __initdata attribute according to include/linux/init.h: For initialized data: You should insert __initdata between the variable name and equal sign followed by value 2. Fix below error reported by checkpatch.pl: ERROR: do not initialise statics to false Special thanks to Muchun Song :) Link: https://lkml.kernel.org/r/20220516030039.1487005-1-bh1scw@gmail.com Signed-off-by: Fanjun Kong Suggested-by: Muchun Song Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit d14f5efadd846dbde561bd734318de6a9e6b26e6 Author: Luo Meng Date: Fri May 13 10:52:25 2022 +0800 tmpfs: fix undefined-behaviour in shmem_reconfigure() When shmem_reconfigure() calls __percpu_counter_compare(), the second parameter is unsigned long long. But in the definition of __percpu_counter_compare(), the second parameter is s64. So when __percpu_counter_compare() executes abs(count - rhs), UBSAN shows the following warning: ================================================================================ UBSAN: Undefined behaviour in lib/percpu_counter.c:209:6 signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long long int' CPU: 1 PID: 9636 Comm: syz-executor.2 Tainted: G ---------r- - 4.18.0 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack home/install/linux-rh-3-10/lib/dump_stack.c:77 [inline] dump_stack+0x125/0x1ae home/install/linux-rh-3-10/lib/dump_stack.c:117 ubsan_epilogue+0xe/0x81 home/install/linux-rh-3-10/lib/ubsan.c:159 handle_overflow+0x19d/0x1ec home/install/linux-rh-3-10/lib/ubsan.c:190 __percpu_counter_compare+0x124/0x140 home/install/linux-rh-3-10/lib/percpu_counter.c:209 percpu_counter_compare home/install/linux-rh-3-10/./include/linux/percpu_counter.h:50 [inline] shmem_remount_fs+0x1ce/0x6b0 home/install/linux-rh-3-10/mm/shmem.c:3530 do_remount_sb+0x11b/0x530 home/install/linux-rh-3-10/fs/super.c:888 do_remount home/install/linux-rh-3-10/fs/namespace.c:2344 [inline] do_mount+0xf8d/0x26b0 home/install/linux-rh-3-10/fs/namespace.c:2844 ksys_mount+0xad/0x120 home/install/linux-rh-3-10/fs/namespace.c:3075 __do_sys_mount home/install/linux-rh-3-10/fs/namespace.c:3089 [inline] __se_sys_mount home/install/linux-rh-3-10/fs/namespace.c:3086 [inline] __x64_sys_mount+0xbf/0x160 home/install/linux-rh-3-10/fs/namespace.c:3086 do_syscall_64+0xca/0x5c0 home/install/linux-rh-3-10/arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x6a/0xdf RIP: 0033:0x46b5e9 Code: 5d db fa ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 2b db fa ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f54d5f22c68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 000000000077bf60 RCX: 000000000046b5e9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000000 RBP: 000000000077bf60 R08: 0000000020000140 R09: 0000000000000000 R10: 00000000026740a4 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd1fb1592f R14: 00007f54d5f239c0 R15: 000000000077bf6c ================================================================================ [akpm@linux-foundation.org: tweak error message text] Link: https://lkml.kernel.org/r/20220513025225.2678727-1-luomeng12@huawei.com Signed-off-by: Luo Meng Cc: Hugh Dickins Cc: Yu Kuai Signed-off-by: Andrew Morton commit 018160ad314d75b1409129b2247b614a9f35894c Author: Wang Cheng Date: Thu May 19 14:08:54 2022 -0700 mm/mempolicy: fix uninit-value in mpol_rebind_policy() mpol_set_nodemask()(mm/mempolicy.c) does not set up nodemask when pol->mode is MPOL_LOCAL. Check pol->mode before access pol->w.cpuset_mems_allowed in mpol_rebind_policy()(mm/mempolicy.c). BUG: KMSAN: uninit-value in mpol_rebind_policy mm/mempolicy.c:352 [inline] BUG: KMSAN: uninit-value in mpol_rebind_task+0x2ac/0x2c0 mm/mempolicy.c:368 mpol_rebind_policy mm/mempolicy.c:352 [inline] mpol_rebind_task+0x2ac/0x2c0 mm/mempolicy.c:368 cpuset_change_task_nodemask kernel/cgroup/cpuset.c:1711 [inline] cpuset_attach+0x787/0x15e0 kernel/cgroup/cpuset.c:2278 cgroup_migrate_execute+0x1023/0x1d20 kernel/cgroup/cgroup.c:2515 cgroup_migrate kernel/cgroup/cgroup.c:2771 [inline] cgroup_attach_task+0x540/0x8b0 kernel/cgroup/cgroup.c:2804 __cgroup1_procs_write+0x5cc/0x7a0 kernel/cgroup/cgroup-v1.c:520 cgroup1_tasks_write+0x94/0xb0 kernel/cgroup/cgroup-v1.c:539 cgroup_file_write+0x4c2/0x9e0 kernel/cgroup/cgroup.c:3852 kernfs_fop_write_iter+0x66a/0x9f0 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2162 [inline] new_sync_write fs/read_write.c:503 [inline] vfs_write+0x1318/0x2030 fs/read_write.c:590 ksys_write+0x28b/0x510 fs/read_write.c:643 __do_sys_write fs/read_write.c:655 [inline] __se_sys_write fs/read_write.c:652 [inline] __x64_sys_write+0xdb/0x120 fs/read_write.c:652 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae Uninit was created at: slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:3251 [inline] slab_alloc mm/slub.c:3259 [inline] kmem_cache_alloc+0x902/0x11c0 mm/slub.c:3264 mpol_new mm/mempolicy.c:293 [inline] do_set_mempolicy+0x421/0xb70 mm/mempolicy.c:853 kernel_set_mempolicy mm/mempolicy.c:1504 [inline] __do_sys_set_mempolicy mm/mempolicy.c:1510 [inline] __se_sys_set_mempolicy+0x44c/0xb60 mm/mempolicy.c:1507 __x64_sys_set_mempolicy+0xd8/0x110 mm/mempolicy.c:1507 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae KMSAN: uninit-value in mpol_rebind_task (2) https://syzkaller.appspot.com/bug?id=d6eb90f952c2a5de9ea718a1b873c55cb13b59dc This patch seems to fix below bug too. KMSAN: uninit-value in mpol_rebind_mm (2) https://syzkaller.appspot.com/bug?id=f2fecd0d7013f54ec4162f60743a2b28df40926b The uninit-value is pol->w.cpuset_mems_allowed in mpol_rebind_policy(). When syzkaller reproducer runs to the beginning of mpol_new(), mpol_new() mm/mempolicy.c do_mbind() mm/mempolicy.c kernel_mbind() mm/mempolicy.c `mode` is 1(MPOL_PREFERRED), nodes_empty(*nodes) is `true` and `flags` is 0. Then mode = MPOL_LOCAL; ... policy->mode = mode; policy->flags = flags; will be executed. So in mpol_set_nodemask(), mpol_set_nodemask() mm/mempolicy.c do_mbind() kernel_mbind() pol->mode is 4 (MPOL_LOCAL), that `nodemask` in `pol` is not initialized, which will be accessed in mpol_rebind_policy(). Link: https://lkml.kernel.org/r/20220512123428.fq3wofedp6oiotd4@ppc.localdomain Signed-off-by: Wang Cheng Reported-by: Tested-by: Cc: David Rientjes Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6d4675e601357834dadd2ba1d803f6484596015c Author: Minchan Kim Date: Thu May 19 14:08:54 2022 -0700 mm: don't be stuck to rmap lock on reclaim path The rmap locks(i_mmap_rwsem and anon_vma->root->rwsem) could be contended under memory pressure if processes keep working on their vmas(e.g., fork, mmap, munmap). It makes reclaim path stuck. In our real workload traces, we see kswapd is waiting the lock for 300ms+(worst case, a sec) and it makes other processes entering direct reclaim, which were also stuck on the lock. This patch makes lru aging path try_lock mode like shink_page_list so the reclaim context will keep working with next lru pages without being stuck. if it found the rmap lock contended, it rotates the page back to head of lru in both active/inactive lrus to make them consistent behavior, which is basic starting point rather than adding more heristic. Since this patch introduces a new "contended" field as out-param along with try_lock in-param in rmap_walk_control, it's not immutable any longer if the try_lock is set so remove const keywords on rmap related functions. Since rmap walking is already expensive operation, I doubt the const would help sizable benefit( And we didn't have it until 5.17). In a heavy app workload in Android, trace shows following statistics. It almost removes rmap lock contention from reclaim path. Martin Liu reported: Before: max_dur(ms) min_dur(ms) max-min(dur)ms avg_dur(ms) sum_dur(ms) count blocked_function 1632 0 1631 151.542173 31672 209 page_lock_anon_vma_read 601 0 601 145.544681 28817 198 rmap_walk_file After: max_dur(ms) min_dur(ms) max-min(dur)ms avg_dur(ms) sum_dur(ms) count blocked_function NaN NaN NaN NaN NaN 0.0 NaN 0 0 0 0.127645 1 12 rmap_walk_file [minchan@kernel.org: add comment, per Matthew] Link: https://lkml.kernel.org/r/YnNqeB5tUf6LZ57b@google.com Link: https://lkml.kernel.org/r/20220510215423.164547-1-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Johannes Weiner Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: John Dias Cc: Tim Murray Cc: Matthew Wilcox Cc: Vladimir Davydov Cc: Martin Liu Cc: Minchan Kim Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit f4840ccfca25db225b3371a8f7b5770febee87c5 Author: Johannes Weiner Date: Thu May 19 14:08:53 2022 -0700 zswap: memcg accounting Applications can currently escape their cgroup memory containment when zswap is enabled. This patch adds per-cgroup tracking and limiting of zswap backend memory to rectify this. The existing cgroup2 memory.stat file is extended to show zswap statistics analogous to what's in meminfo and vmstat. Furthermore, two new control files, memory.zswap.current and memory.zswap.max, are added to allow tuning zswap usage on a per-workload basis. This is important since not all workloads benefit from zswap equally; some even suffer compared to disk swap when memory contents don't compress well. The optimal size of the zswap pool, and the threshold for writeback, also depends on the size of the workload's warm set. The implementation doesn't use a traditional page_counter transaction. zswap is unconventional as a memory consumer in that we only know the amount of memory to charge once expensive compression has occurred. If zwap is disabled or the limit is already exceeded we obviously don't want to compress page upon page only to reject them all. Instead, the limit is checked against current usage, then we compress and charge. This allows some limit overrun, but not enough to matter in practice. [hannes@cmpxchg.org: fix for CONFIG_SLOB builds] Link: https://lkml.kernel.org/r/YnwD14zxYjUJPc2w@cmpxchg.org [hannes@cmpxchg.org: opt out of cgroups v1] Link: https://lkml.kernel.org/r/Yn6it9mBYFA+/lTb@cmpxchg.org Link: https://lkml.kernel.org/r/20220510152847.230957-7-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Seth Jennings Cc: Dan Streetman Cc: Minchan Kim Signed-off-by: Andrew Morton commit f6498b776d280b30a4614d8261840961e993c2c8 Author: Johannes Weiner Date: Thu May 19 14:08:53 2022 -0700 mm: zswap: add basic meminfo and vmstat coverage Currently it requires poking at debugfs to figure out the size and population of the zswap cache on a host. There are no counters for reads and writes against the cache. As a result, it's difficult to understand zswap behavior on production systems. Print zswap memory consumption and how many pages are zswapped out in /proc/meminfo. Count zswapouts and zswapins in /proc/vmstat. Link: https://lkml.kernel.org/r/20220510152847.230957-6-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: David Hildenbrand Cc: Dan Streetman Cc: Michal Hocko Cc: Minchan Kim Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Signed-off-by: Andrew Morton commit b3fbd58fcbb10725a1314688e03b1af6827c42f9 Author: Johannes Weiner Date: Thu May 19 14:08:53 2022 -0700 mm: Kconfig: simplify zswap configuration - CONFIG_ZRAM: Zram is a user-facing feature, whereas zsmalloc is not. Don't make the user chase down a technical dependency like that, just select it in automatically when zram is requested. The CONFIG_CRYPTO dependency is redundant due to more specific deps. - CONFIG_ZPOOL: This is not a user-facing feature. Hide the symbol and have it selected in as needed. - CONFIG_ZSWAP: Select CRYPTO instead of depend. Common pattern. - Make the ZSWAP suboptions and their descriptions (compression, allocation backend) a bit more straight-forward for the user. Link: https://lkml.kernel.org/r/20220510152847.230957-5-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Cc: Dan Streetman Cc: Michal Hocko Cc: Minchan Kim Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 519bcb797907dd0d1db4e71adb6f610aee80941e Author: Johannes Weiner Date: Thu May 19 14:08:53 2022 -0700 mm: Kconfig: group swap, slab, hotplug and thp options into submenus There are several clusters of related config options spread throughout the mostly flat MM submenu. Group them together and put specialization options into further subdirectories to make the MM submenu a bit more organized and easier to navigate. [hannes@cmpxchg.org: fix kbuild warnings] Link: https://lkml.kernel.org/r/YnvkSVivfnT57Vwh@cmpxchg.org [hannes@cmpxchg.org: fix more kbuild warnings] Link: https://lkml.kernel.org/r/Ynz8NusTdEGcCnJN@cmpxchg.org Link: https://lkml.kernel.org/r/20220510152847.230957-4-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Cc: Dan Streetman Cc: Michal Hocko Cc: Minchan Kim Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 7b42f1041c98f5d7da74da8d1653a4b2c380e49d Author: Johannes Weiner Date: Thu May 19 14:08:53 2022 -0700 mm: Kconfig: move swap and slab config options to the MM section These are currently under General Setup. MM seems like a better fit. Link: https://lkml.kernel.org/r/20220510152847.230957-3-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Cc: Dan Streetman Cc: Michal Hocko Cc: Minchan Kim Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 39799b6409febf628337bd7804c3861a9f7f7e8a Author: Johannes Weiner Date: Thu May 19 14:08:52 2022 -0700 Documentation: filesystems: proc: update meminfo section Patch series "zswap: accounting & cgroup control", v2. Zswap can consume nearly a quarter of RAM in the default configuration, yet it's neither listed in /proc/meminfo, nor is it accounted and manageable on a per-cgroup basis. This makes reasoning about the memory situation on a host in general rather difficult. On shared/cgrouped hosts, the consequences are worse. First, workloads can escape memory containment and cause resource priority inversions: a lo-pri group can fill the global zswap pool and force a hi-pri group out to disk. Second, not all workloads benefit from zswap equally. Some even suffer when memory contents compress poorly, and are better off going to disk swap directly. On a host with mixed workloads, it's currently not possible to enable zswap for one workload but not for the other. This series implements the missing global accounting as well as cgroup tracking & control for zswap backing memory: - Patch 1 refreshes the very out-of-date meminfo documentation in Documentation/filesystems/proc.rst. - Patches 2-4 clean up related and adjacent options in Kconfig. Not actual dependencies, just things I noticed during development. - Patch 5 adds meminfo and vmstat coverage for zswap consumption and activity. - Patch 6 implements per-cgroup tracking & control of zswap memory. This patch (of 6): Add new entries. Minor corrections and cleanups. [hannes@cmpxchg.org: fix htmldocs warnings] Link: https://lkml.kernel.org/r/Ynve8dg4zJyhH2gW@cmpxchg.org [hannes@cmpxchg.org: change `Unevictable' wording, per David] Link: https://lkml.kernel.org/r/YnwFraZlVWQoCjz3@cmpxchg.org Link: https://lkml.kernel.org/r/20220510152847.230957-1-hannes@cmpxchg.org Link: https://lkml.kernel.org/r/20220510152847.230957-2-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: David Hildenbrand Cc: Dan Streetman Cc: Michal Hocko Cc: Minchan Kim Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Signed-off-by: Andrew Morton commit ff351f4bb9606a6c9a1f3fcdd918635b51514779 Author: Miaohe Lin Date: Thu May 19 14:08:52 2022 -0700 mm/swap: fix comment about swap extent Since commit 4efaceb1c5f8 ("mm, swap: use rbtree for swap_extent"), rbtree is used for swap extent. Also curr_swap_extent is removed at that time. Update the corresponding comment. Link: https://lkml.kernel.org/r/20220509131416.17553-16-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: David Hildenbrand Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 133d2743ef93ea8a979832d2ac72fb9d331045f3 Author: Miaohe Lin Date: Thu May 19 14:08:52 2022 -0700 mm/swap: fix the comment of get_kernel_pages If no pages were pinned, 0 is returned in fact. Fix the corresponding comment. [akpm@linux-foundation.org: s/nr_pages/nr_segs/ also, per David, reflow comment] Link: https://lkml.kernel.org/r/20220509131416.17553-15-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 3c3115ad6baddbf526521231ea43d9fff34dfa11 Author: Miaohe Lin Date: Thu May 19 14:08:52 2022 -0700 mm/swap: clean up the comment of find_next_to_unuse Since commit 10a9c496789f ("mm: simplify try_to_unuse"), frontswap parameter is removed. Update the corresponding comment. Link: https://lkml.kernel.org/r/20220509131416.17553-14-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit a930c210c42dec32b031ad7645bd6904701b5297 Author: Miaohe Lin Date: Thu May 19 14:08:52 2022 -0700 mm/swap: fix the obsolete comment for SWP_TYPE_SHIFT Since commit 3159f943aafd ("xarray: Replace exceptional entries"), there is only one bit of 'type' can be shifted up. Update the corresponding comment. Link: https://lkml.kernel.org/r/20220509131416.17553-13-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 4b9ae8426cb4a9160ae41bc968391f499feece7e Author: Miaohe Lin Date: Thu May 19 14:08:52 2022 -0700 mm/swap: add helper swap_offset_available() Add helper swap_offset_available() to remove some duplicated codes. Minor readability improvement. [akpm@linux-foundation.org: s/swap_offset_available/swap_offset_available_and_locked/, per Neil] Link: https://lkml.kernel.org/r/20220509131416.17553-12-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: David Hildenbrand Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit eacde32757c7566d3aa760609585c78909532e40 Author: Miaohe Lin Date: Thu May 19 14:08:51 2022 -0700 mm/swap: avoid calling swp_swap_info when try to check SWP_STABLE_WRITES Use flags of si directly to check SWP_STABLE_WRITES to avoid possible READ_ONCE and thus save some cpu cycles. [akpm@linux-foundation.org: use data_race() on si->flags, per Neil] Link: https://lkml.kernel.org/r/20220509131416.17553-10-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: David Hildenbrand Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 3db3264d8a5f4816c022eb9052694ce51e657bfc Author: Miaohe Lin Date: Thu May 19 14:08:51 2022 -0700 mm/swap: make page_swapcount and __lru_add_drain_all static Make page_swapcount and __lru_add_drain_all static. They are only used within the file now. Link: https://lkml.kernel.org/r/20220509131416.17553-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Oscar Salvador Signed-off-by: Andrew Morton commit dab8dfff49a673a4b070ad3f44534b3c0e88a189 Author: Miaohe Lin Date: Thu May 19 14:08:51 2022 -0700 mm/swap: remove unneeded p != NULL check in __swap_duplicate If p is NULL, __swap_duplicate will already return -EINVAL. So if we reach here, p must be non-NULL. Link: https://lkml.kernel.org/r/20220509131416.17553-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit f19c25684c3e19b329e0498dd6d601df13c33223 Author: Miaohe Lin Date: Thu May 19 14:08:51 2022 -0700 mm/swap: remove buggy cache->nr check in refill_swap_slots_cache refill_swap_slots_cache is always called when cache->nr is 0. So remove such buggy and confusing check. Link: https://lkml.kernel.org/r/20220509131416.17553-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 23b230ba8ac30d334afd249c9763e0d0ca583e43 Author: Miaohe Lin Date: Thu May 19 14:08:51 2022 -0700 mm/swap: print bad swap offset entry in get_swap_device If offset exceeds the si->max, print bad swap offset entry to help debug the unexpected case. Link: https://lkml.kernel.org/r/20220509131416.17553-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit bc4a68adb151f08b50822158c7767f5726346370 Author: Miaohe Lin Date: Thu May 19 14:08:50 2022 -0700 mm/swap: remove unneeded return value of free_swap_slot The return value of free_swap_slot is always 0 and also ignored now. Remove it to clean up the code. Link: https://lkml.kernel.org/r/20220509131416.17553-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit afba72b17139057aedf7eb2dfe5f6ea6700ab998 Author: Miaohe Lin Date: Thu May 19 14:08:50 2022 -0700 mm/swap: fold __swap_info_get() into its sole caller Fold __swap_info_get() into its sole caller to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220509131416.17553-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6106b93efad1ea14d428558c2e4efc5f76874c23 Author: Miaohe Lin Date: Thu May 19 14:08:50 2022 -0700 mm/swap: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define vma_ra_enabled_attr to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220509131416.17553-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alistair Popple Cc: David Howells Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: NeilBrown Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 92bafb20b2edd1ab5022a9bce6fb73ed9a749453 Author: Miaohe Lin Date: Thu May 19 14:08:50 2022 -0700 mm/swap: use helper is_swap_pte() in swap_vma_readahead Patch series "A few cleanup patches for swap". This series contains a few patches to fix the comment, remove unneeded return value, use some helpers and so on. More details can be found in the respective changelogs. This patch (of 14): Use helper is_swap_pte() to check whether pte is swap entry to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220509131416.17553-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220509131416.17553-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: David Howells Cc: NeilBrown Cc: Alistair Popple Cc: Suren Baghdasaryan Cc: Peter Xu Cc: Naoya Horiguchi Signed-off-by: Andrew Morton commit 613bec092fe78307a8b130353ce1ef340915587f Author: Yang Shi Date: Thu May 19 14:08:50 2022 -0700 mm: mmap: register suitable readonly file vmas for khugepaged The readonly FS THP relies on khugepaged to collapse THP for suitable vmas. But the behavior is inconsistent for "always" mode (https://lore.kernel.org/linux-mm/00f195d4-d039-3cf2-d3a1-a2c88de397a0@suse.cz/). The "always" mode means THP allocation should be tried all the time and khugepaged should try to collapse THP all the time. Of course the allocation and collapse may fail due to other factors and conditions. Currently file THP may not be collapsed by khugepaged even though all the conditions are met. That does break the semantics of "always" mode. So make sure readonly FS vmas are registered to khugepaged to fix the break. Register suitable vmas in common mmap path, that could cover both readonly FS vmas and shmem vmas, so remove the khugepaged calls in shmem.c. Still need to keep the khugepaged call in vma_merge() since vma_merge() is called in a lot of places, for example, madvise, mprotect, etc. Link: https://lkml.kernel.org/r/20220510203222.24246-9-shy828301@gmail.com Signed-off-by: Yang Shi Reported-by: Vlastimil Babka Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Miaohe Lin Cc: Song Liu Cc: Rik van Riel Cc: Matthew Wilcox (Oracle) Cc: Zi Yan Cc: Theodore Ts'o Cc: Song Liu Signed-off-by: Andrew Morton commit c791576c60288c89b351ea2d2098f6a872d78fa7 Author: Yang Shi Date: Thu May 19 14:08:50 2022 -0700 mm: khugepaged: introduce khugepaged_enter_vma() helper The khugepaged_enter_vma_merge() actually does as the same thing as the khugepaged_enter() section called by shmem_mmap(), so consolidate them into one helper and rename it to khugepaged_enter_vma(). Link: https://lkml.kernel.org/r/20220510203222.24246-8-shy828301@gmail.com Signed-off-by: Yang Shi Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Rik van Riel Cc: Song Liu Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit 2647d11b9e71d495b2d4985ebaf7a734373a4b80 Author: Yang Shi Date: Thu May 19 14:08:49 2022 -0700 mm: khugepaged: make hugepage_vma_check() non-static The hugepage_vma_check() could be reused by khugepaged_enter() and khugepaged_enter_vma_merge(), but it is static in khugepaged.c. Make it non-static and declare it in khugepaged.h. Link: https://lkml.kernel.org/r/20220510203222.24246-7-shy828301@gmail.com Signed-off-by: Yang Shi Suggested-by: Vlastimil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Rik van Riel Cc: Song Liu Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit d2081b2bf8195b8239c67fdd61518e077da7cbec Author: Yang Shi Date: Thu May 19 14:08:49 2022 -0700 mm: khugepaged: make khugepaged_enter() void function The most callers of khugepaged_enter() don't care about the return value. Only dup_mmap(), anonymous THP page fault and MADV_HUGEPAGE handle the error by returning -ENOMEM. Actually it is not harmful for them to ignore the error case either. It also sounds overkilling to fail fork() and page fault early due to khugepaged_enter() error, and MADV_HUGEPAGE does set VM_HUGEPAGE flag regardless of the error. Link: https://lkml.kernel.org/r/20220510203222.24246-6-shy828301@gmail.com Signed-off-by: Yang Shi Acked-by: Song Liu Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Rik van Riel Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit 78d12c19e02d8151b1c82228ae6bb10f174a68e2 Author: Yang Shi Date: Thu May 19 14:08:49 2022 -0700 mm: thp: only regular file could be THP eligible Since commit a4aeaa06d45e ("mm: khugepaged: skip huge page collapse for special files"), khugepaged just collapses THP for regular file which is the intended usecase for readonly fs THP. Only show regular file as THP eligible accordingly. And make file_thp_enabled() available for khugepaged too in order to remove duplicate code. Link: https://lkml.kernel.org/r/20220510203222.24246-5-shy828301@gmail.com Signed-off-by: Yang Shi Acked-by: Song Liu Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Rik van Riel Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit 52b52bf15b67213c631dc8bee2a1854dd8811110 Author: Yang Shi Date: Thu May 19 14:08:49 2022 -0700 mm: khugepaged: skip DAX vma The DAX vma may be seen by khugepaged when the mm has other khugepaged suitable vmas. So khugepaged may try to collapse THP for DAX vma, but it will fail due to page sanity check, for example, page is not on LRU. So it is not harmful, but it is definitely pointless to run khugepaged against DAX vma, so skip it in early check. Link: https://lkml.kernel.org/r/20220510203222.24246-4-shy828301@gmail.com Signed-off-by: Yang Shi Reviewed-by: Miaohe Lin Acked-by: Song Liu Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Rik van Riel Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit cb648754a1d0dbac7cbcfe8d42cb27fa6063547d Author: Yang Shi Date: Thu May 19 14:08:49 2022 -0700 mm: khugepaged: remove redundant check for VM_NO_KHUGEPAGED The hugepage_vma_check() called by khugepaged_enter_vma_merge() does check VM_NO_KHUGEPAGED. Remove the check from caller and move the check in hugepage_vma_check() up. More checks may be run for VM_NO_KHUGEPAGED vmas, but MADV_HUGEPAGE is definitely not a hot path, so cleaner code does outweigh. Link: https://lkml.kernel.org/r/20220510203222.24246-3-shy828301@gmail.com Signed-off-by: Yang Shi Reviewed-by: Miaohe Lin Acked-by: Song Liu Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Rik van Riel Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit b265cdebdfefbee4ef1ae2972af36f7a7cac5148 Author: Yang Shi Date: Thu May 19 14:08:48 2022 -0700 sched: coredump.h: clarify the use of MMF_VM_HUGEPAGE Patch series "Make khugepaged collapse readonly FS THP more consistent", v4. The readonly FS THP relies on khugepaged to collapse THP for suitable vmas. But the behavior is inconsistent for "always" mode (https://lore.kernel.org/linux-mm/00f195d4-d039-3cf2-d3a1-a2c88de397a0@suse.cz/). The "always" mode means THP allocation should be tried all the time and khugepaged should try to collapse THP all the time. Of course the allocation and collapse may fail due to other factors and conditions. Currently file THP may not be collapsed by khugepaged even though all the conditions are met. That does break the semantics of "always" mode. So make sure readonly FS vmas are registered to khugepaged to fix the break. Register suitable vmas in common mmap path, that could cover both readonly FS vmas and shmem vmas, so remove the khugepaged calls in shmem.c. The patch 1-7 are minor bug fixes, clean up and preparation patches. Patch 8 is the real meat. Tested with khugepaged test in selftests and the testcase provided by Vlastimil Babka in https://lore.kernel.org/lkml/df3b5d1c-a36b-2c73-3e27-99e74983de3a@suse.cz/ by commenting out MADV_HUGEPAGE call. This patch (of 8): MMF_VM_HUGEPAGE is set as long as the mm is available for khugepaged by khugepaged_enter(), not only when VM_HUGEPAGE is set on vma. Correct the comment to avoid confusion. Link: https://lkml.kernel.org/r/20220510203222.24246-1-shy828301@gmail.com Link: https://lkml.kernel.org/r/20220510203222.24246-2-shy828301@gmail.com Signed-off-by: Yang Shi Reviewed-by: Miaohe Lin Acked-by: Song Liu Acked-by: Vlastmil Babka Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: Rik van Riel Cc: Song Liu Cc: Theodore Ts'o Cc: Zi Yan Signed-off-by: Andrew Morton commit ed928a3402d8a24a70c242c63109c069a7b1f3ab Author: Tong Tiangen Date: Tue May 17 07:45:48 2022 +0000 arm64/mm: fix page table check compile error for CONFIG_PGTABLE_LEVELS=2 If CONFIG_PGTABLE_LEVELS=2 and CONFIG_ARCH_SUPPORTS_PAGE_TABLE_CHECK=y, then we trigger a compile error: error: implicit declaration of function 'pte_user_accessible_page' Move the definition of page table check helper out of branch CONFIG_PGTABLE_LEVELS > 2 Link: https://lkml.kernel.org/r/20220517074548.2227779-3-tongtiangen@huawei.com Fixes: daf214c14dbe ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Tong Tiangen Acked-by: Catalin Marinas Cc: Anshuman Khandual Cc: Pasha Tatashin Cc: Anshuman Khandual Cc: Will Deacon Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Arnd Bergmann Cc: Guohanjun Cc: Xie XiuQi Cc: kernel test robot Signed-off-by: Andrew Morton commit 2c8a81dc0cc533c666c64f4139a608b0ae55d96f Author: Tong Tiangen Date: Tue May 17 07:45:47 2022 +0000 riscv/mm: fix two page table check related issues Two page table check related issues have been fixed here. 1. Open CONFIG_PAGE_TABLE_CHECK in riscv32, we got a compile error[1]: error: implicit declaration of function 'pud_leaf' Add pud_leaf() definition to incluce/asm-generic/pgtable-nopmd.h to fix this issue. 2. Keep consistent with other pud_xxx() helpers, move pud_user() to pgtable-64.h and add pud_user() to pgtable-nopmd.h. [1]https://lore.kernel.org/linux-mm/202205161811.2nLxmN2O-lkp@intel.com/T/ Link: https://lkml.kernel.org/r/20220517074548.2227779-2-tongtiangen@huawei.com Fixes: 856eed79f8d3 ("riscv/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Tong Tiangen Reported-by: kernel test robot Cc: Anshuman Khandual Cc: Pasha Tatashin Cc: Anshuman Khandual Cc: Albert Ou Cc: Arnd Bergmann Cc: Catalin Marinas Cc: Guohanjun Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Cc: Xie XiuQi Signed-off-by: Andrew Morton commit 644291ebecd1355363f4b7a39dc115828643b901 Author: Geert Uytterhoeven Date: Fri Dec 3 14:58:26 2021 +0100 dt-bindings: input: touchscreen: ilitek_ts_i2c: Absorb ili2xxx bindings While Linux uses a different driver, the Ilitek ILI210x/ILI2117/ILI2120/ILI251x touchscreen controller Device Tree binding documentation is very similar. - Drop the fixed reg value, as some controllers use a different address, - Make reset-gpios optional, as it is not always wired. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/0c5f06c9d262c1720b40d068b6eefe58ca406601.1638539806.git.geert+renesas@glider.be commit ee77ef0d09e3ca0509833f6fbd49d925630a27f4 Author: Krzysztof Kozlowski Date: Sun Apr 24 17:03:33 2022 +0200 dt-bindings: timer: samsung,exynos4210-mct: define strict clock order The DTS should always have fixed clock order, even if it comes with clock-names property. Drop the pattern to make the order strict. Existing DTS already match this. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424150333.75172-3-krzysztof.kozlowski@linaro.org commit 60854ba8e338228f8a8296e812e4b8f0dd42191a Author: Krzysztof Kozlowski Date: Sun Apr 24 17:03:32 2022 +0200 dt-bindings: timer: samsung,exynos4210-mct: drop unneeded minItems There is no need to add minItems when it is equal to maxItems. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Alim Akhtar Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424150333.75172-2-krzysztof.kozlowski@linaro.org commit 1084ab9e3bf0e291f97fc8f11bf9ab548ce6bb64 Author: Krzysztof Kozlowski Date: Sun Apr 24 17:03:31 2022 +0200 dt-bindings: timer: cdns,ttc: drop unneeded minItems There is no need to add minItems when it is equal to maxItems. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Alim Akhtar Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424150333.75172-1-krzysztof.kozlowski@linaro.org commit 1a6dd9996699889313327be03981716a8337656b Author: Vincent Mailhol Date: Wed May 18 20:43:57 2022 +0900 can: mcp251xfd: silence clang's -Wunaligned-access warning clang emits a -Wunaligned-access warning on union mcp251xfd_tx_ojb_load_buf. The reason is that field hw_tx_obj (not declared as packed) is being packed right after a 16 bits field inside a packed struct: | union mcp251xfd_tx_obj_load_buf { | struct __packed { | struct mcp251xfd_buf_cmd cmd; | /* ^ 16 bits fields */ | struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; | /* ^ not declared as packed */ | } nocrc; | struct __packed { | struct mcp251xfd_buf_cmd_crc cmd; | struct mcp251xfd_hw_tx_obj_raw hw_tx_obj; | __be16 crc; | } crc; | } ____cacheline_aligned; Starting from LLVM 14, having an unpacked struct nested in a packed struct triggers a warning. c.f. [1]. This is a false positive because the field is always being accessed with the relevant put_unaligned_*() function. Adding __packed to the structure declaration silences the warning. [1] https://github.com/llvm/llvm-project/issues/55520 Link: https://lore.kernel.org/all/20220518114357.55452-1-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Reported-by: kernel test robot Tested-by: Nathan Chancellor # build Signed-off-by: Marc Kleine-Budde commit 6c1e423a3c84953edcf91ff03ab97829b287184a Author: Oliver Hartkopp Date: Wed May 18 17:45:27 2022 +0200 can: can-dev: remove obsolete CAN LED support Since commit 30f3b42147ba6f ("can: mark led trigger as broken") the CAN specific LED support was disabled and marked as BROKEN. As the common LED support with CONFIG_LEDS_TRIGGER_NETDEV should do this work now the code can be removed as preparation for a CAN netdevice Kconfig rework. Link: https://lore.kernel.org/all/20220518154527.29046-1-socketcan@hartkopp.net Suggested-by: Vincent Mailhol Signed-off-by: Oliver Hartkopp [mkl: remove led.h from MAINTAINERS] Signed-off-by: Marc Kleine-Budde commit caf6b7f81e053dfdc5f16e943b355bc954e0de34 Author: Jakub Kicinski Date: Mon May 16 17:23:45 2022 -0700 can: can-dev: move to netif_napi_add_weight() We want to remove the weight argument from the basic version of the netif_napi_add() call. Move all the callers in drivers/net/can that pass a custom weight (i.e. not NAPI_POLL_WEIGHT or 64) to the netif_napi_add_weight() API. Link: https://lore.kernel.org/all/20220517002345.1812104-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Marc Kleine-Budde commit b76b163f46b661499921a0049982764a6659bfe7 Author: Oliver Hartkopp Date: Tue May 17 16:56:53 2022 +0200 can: isotp: isotp_bind(): do not validate unused address information With commit 2aa39889c463 ("can: isotp: isotp_bind(): return -EINVAL on incorrect CAN ID formatting") the bind() syscall returns -EINVAL when the given CAN ID needed to be sanitized. But in the case of an unconfirmed broadcast mode the rx CAN ID is not needed and may be uninitialized from the caller - which is ok. This patch makes sure the result of an inproper CAN ID format is only provided when the address information is needed. Link: https://lore.kernel.org/all/20220517145653.2556-1-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit d353e1a3bafd468941d42f6aa59bbd8ac42959b6 Merge: d7e6f5836038e 78488a64aea94 Author: Jakub Kicinski Date: Thu May 19 13:01:07 2022 -0700 Merge tag 'wireless-next-2022-05-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v5.19 Second set of patches for v5.19 and most likely the last one. rtw89 got support for 8852ce devices and mt76 now supports Wireless Ethernet Dispatch. Major changes: cfg80211/mac80211 - support disabling EHT mode rtw89 - add support for Realtek 8852ce devices mt76 - Wireless Ethernet Dispatch support for flow offload - non-standard VHT MCS10-11 support - mt7921 AP mode support - mt7921 ipv6 NS offload support ath11k - enable keepalive during WoWLAN suspend - implement remain-on-channel support * tag 'wireless-next-2022-05-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (135 commits) iwlwifi: mei: fix potential NULL-ptr deref iwlwifi: mei: clear the sap data header before sending iwlwifi: mvm: remove vif_count iwlwifi: mvm: always tell the firmware to accept MCAST frames in BSS iwlwifi: mvm: add OTP info in case of init failure iwlwifi: mvm: fix assert 1F04 upon reconfig iwlwifi: fw: init SAR GEO table only if data is present iwlwifi: mvm: clean up authorized condition iwlwifi: mvm: use NULL instead of ERR_PTR when parsing wowlan status iwlwifi: pcie: simplify MSI-X cause mapping rtw89: pci: only mask out INT indicator register for disable interrupt v1 rtw89: convert rtw89_band to nl80211_band precisely rtw89: 8852c: update txpwr tables to HALRF_027_00_052 rtw89: cfo: check mac_id to avoid out-of-bounds rtw89: 8852c: set TX antenna path rtw89: add ieee80211::sta_rc_update ops wireless: Fix Makefile to be in alphabetical order mac80211: refactor freeing the next_beacon cfg80211: fix kernel-doc for cfg80211_beacon_data mac80211: minstrel_ht: support ieee80211_rate_status ... ==================== Link: https://lore.kernel.org/r/20220519153334.8D051C385AA@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 78288665b5d0154978fed431985310cb4f166836 Author: Chaitanya Kulkarni Date: Wed May 18 08:51:38 2022 -0700 nvme: set non-mdts limits in nvme_scan_work In current implementation we set the non-mdts limits by calling nvme_init_non_mdts_limits() from nvme_init_ctrl_finish(). This also tries to set the limits for the discovery controller which has no I/O queues resulting in the warning message reported by the nvme_log_error() when running blktest nvme/002: - [ 2005.155946] run blktests nvme/002 at 2022-04-09 16:57:47 [ 2005.192223] loop: module loaded [ 2005.196429] nvmet: adding nsid 1 to subsystem blktests-subsystem-0 [ 2005.200334] nvmet: adding nsid 1 to subsystem blktests-subsystem-1 <------------------------------SNIP----------------------------------> [ 2008.958108] nvmet: adding nsid 1 to subsystem blktests-subsystem-997 [ 2008.962082] nvmet: adding nsid 1 to subsystem blktests-subsystem-998 [ 2008.966102] nvmet: adding nsid 1 to subsystem blktests-subsystem-999 [ 2008.973132] nvmet: creating discovery controller 1 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN testhostnqn. *[ 2008.973196] nvme1: Identify(0x6), Invalid Field in Command (sct 0x0 / sc 0x2) MORE DNR* [ 2008.974595] nvme nvme1: new ctrl: "nqn.2014-08.org.nvmexpress.discovery" [ 2009.103248] nvme nvme1: Removing ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery" Move the call of nvme_init_non_mdts_limits() to nvme_scan_work() after we verify that I/O queues are created since that is a converging point for each transport where these limits are actually used. 1. FC : nvme_fc_create_association() ... nvme_fc_create_io_queues(ctrl); ... nvme_start_ctrl() nvme_scan_queue() nvme_scan_work() 2. PCIe:- nvme_reset_work() ... nvme_setup_io_queues() nvme_create_io_queues() nvme_alloc_queue() ... nvme_start_ctrl() nvme_scan_queue() nvme_scan_work() 3. RDMA :- nvme_rdma_setup_ctrl ... nvme_rdma_configure_io_queues ... nvme_start_ctrl() nvme_scan_queue() nvme_scan_work() 4. TCP :- nvme_tcp_setup_ctrl ... nvme_tcp_configure_io_queues ... nvme_start_ctrl() nvme_scan_queue() nvme_scan_work() * nvme_scan_work() ... nvme_validate_or_alloc_ns() nvme_alloc_ns() nvme_update_ns_info() nvme_update_disk_info() nvme_config_discard() <--- blk_queue_max_write_zeroes_sectors() <--- Signed-off-by: Chaitanya Kulkarni Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit fa6dae5d82081e8d9f8e6a2baf7149442a6c1ba5 Author: Hans de Goede Date: Thu May 19 17:21:48 2022 +0200 x86/PCI: Add kernel cmdline options to use/ignore E820 reserved regions Some firmware supplies PCI host bridge _CRS that includes address space unusable by PCI devices, e.g., space occupied by host bridge registers or used by hidden PCI devices. To avoid this unusable space, Linux currently excludes E820 reserved regions from _CRS windows; see 4dc2287c1805 ("x86: avoid E820 regions when allocating address space"). However, this use of E820 reserved regions to clip things out of _CRS is not supported by ACPI, UEFI, or PCI Firmware specs, and some systems have E820 reserved regions that cover the entire memory window from _CRS. 4dc2287c1805 clips the entire window, leaving no space for hot-added or uninitialized PCI devices. For example, from a Lenovo IdeaPad 3 15IIL 81WE: BIOS-e820: [mem 0x4bc50000-0xcfffffff] reserved pci_bus 0000:00: root bus resource [mem 0x65400000-0xbfffffff window] pci 0000:00:15.0: BAR 0: [mem 0x00000000-0x00000fff 64bit] pci 0000:00:15.0: BAR 0: no space for [mem size 0x00001000 64bit] Future patches will add quirks to enable/disable E820 clipping automatically. Add a "pci=no_e820" kernel command line option to disable clipping with E820 reserved regions. Also add a matching "pci=use_e820" option to enable clipping with E820 reserved regions if that has been disabled by default by further patches in this patch-set. Both options taint the kernel because they are intended for debugging and workaround purposes until a quirk can set them automatically. [bhelgaas: commit log, add printk] Link: https://bugzilla.redhat.com/show_bug.cgi?id=1868899 Lenovo IdeaPad 3 Link: https://lore.kernel.org/r/20220519152150.6135-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki Cc: Benoit Grégoire Cc: Hui Wang commit 838b3e28488f702e2b5477b393f009b2639d2b1a Author: Li Zhengyu Date: Fri Apr 8 18:09:14 2022 +0800 RISC-V: Load purgatory in kexec_file This patch supports kexec_file to load and relocate purgatory. It works well on riscv64 QEMU, being tested with devmem. Signed-off-by: Li Zhengyu Link: https://lore.kernel.org/r/20220408100914.150110-7-lizhengyu3@huawei.com Signed-off-by: Palmer Dabbelt commit 736e30af583fb6e0e2b8211b894ff99dea0f1ee7 Author: Li Zhengyu Date: Fri Apr 8 18:09:13 2022 +0800 RISC-V: Add purgatory This patch adds purgatory, the name and concept have been taken from kexec-tools. Purgatory runs between two kernels, and do verify sha256 hash to ensure the kernel to jump to is fine and has not been corrupted after loading. Makefile is modified based on x86 platform. Signed-off-by: Li Zhengyu Link: https://lore.kernel.org/r/20220408100914.150110-6-lizhengyu3@huawei.com Signed-off-by: Palmer Dabbelt commit 8acea455fafaf2620b247de6c00774828b618a82 Author: Li Zhengyu Date: Fri Apr 8 18:09:12 2022 +0800 RISC-V: Support for kexec_file on panic This patch adds support for loading a kexec on panic (kdump) kernel. It has been tested with vmcore-dmesg on riscv64 QEMU on both an smp and a non-smp system. Signed-off-by: Li Zhengyu Link: https://lore.kernel.org/r/20220408100914.150110-5-lizhengyu3@huawei.com Signed-off-by: Palmer Dabbelt commit 6261586e0c91db14c34f894f4bc48f2300cff1d4 Author: Liao Chang Date: Fri Apr 8 18:09:11 2022 +0800 RISC-V: Add kexec_file support This patch adds support for kexec_file on RISC-V. I tested it on riscv64 QEMU with busybear-linux and single core along with the OpenSBI firmware fw_jump.bin for generic platform. On SMP system, it depends on CONFIG_{HOTPLUG_CPU, RISCV_SBI} to resume/stop hart through OpenSBI firmware, it also needs a OpenSBI that support the HSM extension. Signed-off-by: Liao Chang Signed-off-by: Li Zhengyu Link: https://lore.kernel.org/r/20220408100914.150110-4-lizhengyu3@huawei.com [Palmer: Make 64-bit only] Signed-off-by: Palmer Dabbelt commit 988d74deaa46a9c63d2061c270692d6e6192c6c1 Author: Daisuke Matsuda Date: Wed May 18 04:49:14 2022 +0000 RDMA/mlx5: Remove duplicate pointer assignment in mlx5_ib_alloc_implicit_mr() The pointer imr->umem is assigned twice. Fix this by removing the redundant one. Link: https://lore.kernel.org/r/20220518044914.1903125-1-matsuda-daisuke@fujitsu.com Signed-off-by: Daisuke Matsuda Signed-off-by: Jason Gunthorpe commit b7fb4d78a6ade6026d9e5cf438c2a46ab962e032 Author: Liao Chang Date: Fri Apr 8 18:09:10 2022 +0800 RISC-V: use memcpy for kexec_file mode The pointer to buffer loading kernel binaries is in kernel space for kexec_fil mode, When copy_from_user copies data from pointer to a block of memory, it checkes that the pointer is in the user space range, on RISCV-V that is: static inline bool __access_ok(unsigned long addr, unsigned long size) { return size <= TASK_SIZE && addr <= TASK_SIZE - size; } and TASK_SIZE is 0x4000000000 for 64-bits, which now causes copy_from_user to reject the access of the field 'buf' of struct kexec_segment that is in range [CONFIG_PAGE_OFFSET - VMALLOC_SIZE, CONFIG_PAGE_OFFSET), is invalid user space pointer. This patch fixes this issue by skipping access_ok(), use mempcy() instead. Signed-off-by: Liao Chang Link: https://lore.kernel.org/r/20220408100914.150110-3-lizhengyu3@huawei.com Signed-off-by: Palmer Dabbelt commit 4853f68d158ac59b05985a6af5b7da7ccdbc14c8 Author: Liao Chang Date: Fri Apr 8 18:09:09 2022 +0800 kexec_file: Fix kexec_file.c build error for riscv platform When CONFIG_KEXEC_FILE is set for riscv platform, the compilation of kernel/kexec_file.c generate build error: kernel/kexec_file.c: In function 'crash_prepare_elf64_headers': ./arch/riscv/include/asm/page.h:110:71: error: request for member 'virt_addr' in something not a structure or union 110 | ((x) >= PAGE_OFFSET && (!IS_ENABLED(CONFIG_64BIT) || (x) < kernel_map.virt_addr)) | ^ ./arch/riscv/include/asm/page.h:131:2: note: in expansion of macro 'is_linear_mapping' 131 | is_linear_mapping(_x) ? \ | ^~~~~~~~~~~~~~~~~ ./arch/riscv/include/asm/page.h:140:31: note: in expansion of macro '__va_to_pa_nodebug' 140 | #define __phys_addr_symbol(x) __va_to_pa_nodebug(x) | ^~~~~~~~~~~~~~~~~~ ./arch/riscv/include/asm/page.h:143:24: note: in expansion of macro '__phys_addr_symbol' 143 | #define __pa_symbol(x) __phys_addr_symbol(RELOC_HIDE((unsigned long)(x), 0)) | ^~~~~~~~~~~~~~~~~~ kernel/kexec_file.c:1327:36: note: in expansion of macro '__pa_symbol' 1327 | phdr->p_offset = phdr->p_paddr = __pa_symbol(_text); This occurs is because the "kernel_map" referenced in macro is_linear_mapping() is suppose to be the one of struct kernel_mapping defined in arch/riscv/mm/init.c, but the 2nd argument of crash_prepare_elf64_header() has same symbol name, in expansion of macro is_linear_mapping in function crash_prepare_elf64_header(), "kernel_map" actually is the local variable. Signed-off-by: Liao Chang Link: https://lore.kernel.org/r/20220408100914.150110-2-lizhengyu3@huawei.com Signed-off-by: Palmer Dabbelt commit 0e7579ca732a39cc377e17509dda9bfc4f6ba78e Author: Vasily Averin Date: Thu May 19 17:30:49 2022 +0300 io_uring: fix incorrect __kernel_rwf_t cast Currently 'make C=1 fs/io_uring.o' generates sparse warning: CHECK fs/io_uring.c fs/io_uring.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, i nclude/trace/events/io_uring.h): ./include/trace/events/io_uring.h:488:1: warning: incorrect type in assignment (different base types) expected unsigned int [usertype] op_flags got restricted __kernel_rwf_t const [usertype] rw_flags This happen on cast of sqe->rw_flags which is defined as __kernel_rwf_t, this type is bitwise and requires __force attribute for any casts. However rw_flags is a member of the union, and its access can be safely replaced by using of its neighbours, so let's use poll32_events to fix the sparse warning. Signed-off-by: Vasily Averin Link: https://lore.kernel.org/r/6f009241-a63f-ae43-a04b-62841aaef293@openvz.org Signed-off-by: Jens Axboe commit d7e6f5836038eeac561411ed7a74e2a225a6c138 Merge: c1318b39c7d36 d904c8cc03023 Author: Jakub Kicinski Date: Thu May 19 11:23:59 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/mellanox/mlx5/core/main.c b33886971dbc ("net/mlx5: Initialize flow steering during driver probe") 40379a0084c2 ("net/mlx5_fpga: Drop INNOVA TLS support") f2b41b32cde8 ("net/mlx5: Remove ipsec_ops function table") https://lore.kernel.org/all/20220519040345.6yrjromcdistu7vh@sx1/ 16d42d313350 ("net/mlx5: Drain fw_reset when removing device") 8324a02c342a ("net/mlx5: Add exit route when waiting for FW") https://lore.kernel.org/all/20220519114119.060ce014@canb.auug.org.au/ tools/testing/selftests/net/mptcp/mptcp_join.sh e274f7154008 ("selftests: mptcp: add subflow limits test-cases") b6e074e171bc ("selftests: mptcp: add infinite map testcase") 5ac1d2d63451 ("selftests: mptcp: Add tests for userspace PM type") https://lore.kernel.org/all/20220516111918.366d747f@canb.auug.org.au/ net/mptcp/options.c ba2c89e0ea74 ("mptcp: fix checksum byte order") 1e39e5a32ad7 ("mptcp: infinite mapping sending") ea66758c1795 ("tcp: allow MPTCP to update the announced window") https://lore.kernel.org/all/20220519115146.751c3a37@canb.auug.org.au/ net/mptcp/pm.c 95d686517884 ("mptcp: fix subflow accounting on close") 4d25247d3ae4 ("mptcp: bypass in-kernel PM restrictions for non-kernel PMs") https://lore.kernel.org/all/20220516111435.72f35dca@canb.auug.org.au/ net/mptcp/subflow.c ae66fb2ba6c3 ("mptcp: Do TCP fallback on early DSS checksum failure") 0348c690ed37 ("mptcp: add the fallback check") f8d4bcacff3b ("mptcp: infinite mapping receiving") https://lore.kernel.org/all/20220519115837.380bb8d4@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit 1a5409facf9ceba401f83925c6d15bae2121d29c Merge: 947a844bb3ebf 64b22a0da12ad Author: Rob Clark Date: Thu May 19 11:19:30 2022 -0700 Merge tag 'msm-next-5.19-fixes' of https://gitlab.freedesktop.org/abhinavk/msm into msm-fixes-staging 5.19 fixes for msm-next - Limiting WB modes to max sspp linewidth - Fixing the supported rotations to add 180 back for IGT - Fix to handle pm_runtime_get_sync() errors to avoid unclocked access in the bind() path for dpu driver - Fix the irq_free() without request issue which was a big-time hitter in the CI-runs. Signed-off-by: Abhinav Kumar Signed-off-by: Rob Clark commit b2a92f354c5a9436f1f4ac8f6485a3ce1c941b29 Author: Ulf Hansson Date: Wed May 11 16:57:04 2022 +0200 PM: domains: Trust domain-idle-states from DT to be correct by genpd If genpd has parsed the domain-idle-states from DT, it's reasonable to believe that the parsed data should be correct for the HW in question. Based upon this, it seem superfluous to let genpd measure the corresponding power-on/off latencies for these states. Therefore, let's improve the behaviour in genpd by avoiding the measurements for the domain-idle-states that have been parsed from DT. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 6961795f0d0a9c424915b3d73198c18b3dbd5e85 Author: Ulf Hansson Date: Wed May 11 16:57:03 2022 +0200 PM: domains: Measure power-on/off latencies in genpd based on a governor The measurements of the power-on|off latencies in genpd for a PM domain are superfluous, unless the corresponding genpd has a governor assigned to it, which would make use of the data. Therefore, let's improve the behaviour in genpd by making the measurements conditional, based upon if there's a governor assigned. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit f38d1a6d002526a4e8840e9bb19733e9d4ce1a67 Author: Ulf Hansson Date: Wed May 11 16:57:02 2022 +0200 PM: domains: Allocate governor data dynamically based on a genpd governor If a genpd doesn't have an associated governor assigned, several variables in the struct generic_pm_domain becomes superfluous. Rather than wasting memory in allocated genpds, let's move the variables from the struct generic_pm_domain into a new separate struct. In this way, we can instead dynamically decide when we need to allocate the corresponding data for it. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit ba43d6db6e5c6d0b5f58d6487285ed58ba94c5df Author: Ulf Hansson Date: Wed May 11 16:57:01 2022 +0200 PM: domains: Clean up some code in pm_genpd_init() and genpd_remove() To improve the readability of the code, let's move the parts that deals with allocation/freeing of data, into two separate functions. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 622d9b5577f19a6472db21df042fea8f5fefe244 Author: Ulf Hansson Date: Wed May 11 16:57:00 2022 +0200 PM: domains: Fix initialization of genpd's next_wakeup In the genpd governor we walk the list of child-domains to take into account their next_wakeup. If the child-domain itself, doesn't have a governor assigned to it, we can end up using the next_wakeup value before it has been properly initialized. To prevent a possible incorrect behaviour in the governor, let's initialize next_wakeup to KTIME_MAX. Fixes: c79aa080fb0f ("PM: domains: use device's next wakeup to determine domain idle state") Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit a294237aea122daa646f02e461877d553439c529 Author: Ulf Hansson Date: Wed May 11 16:56:59 2022 +0200 PM: domains: Fixup QoS latency measurements for IRQ safe devices in genpd When an IRQ safe device is attached to a non-IRQ safe PM domain, genpd needs to prevent the PM domain from being powered off. However, genpd still allows the device to be runtime suspended/resumed, hence it's also reasonable to think that a governor may be used to validate the QoS latency constraints. Unfortunately, genpd_runtime_resume() treats the configuration above, as a reason to skip measuring the QoS resume latency for the device. This is a legacy behaviour that was earlier correct, but should have been changed when genpd was transformed into its current behaviour around how it manages IRQ safe devices. Luckily, there's no report about problems, so let's just fixup the behaviour. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 3b84bf3ce94dea82a9451a4c9c2cda37e334333c Author: Ulf Hansson Date: Wed May 11 16:56:58 2022 +0200 PM: domains: Measure suspend/resume latencies in genpd based on governor The QoS latency measurements for devices in genpd_runtime_suspend|resume() are superfluous, unless the corresponding genpd has a governor assigned to it, which would make use of the data. Therefore, let's improve the behaviour in genpd by making the measurements conditional, based upon if there's a governor assigned. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 9c74f2ac4801473d03b0e29fab74eb94a9944521 Author: Ulf Hansson Date: Wed May 11 16:56:57 2022 +0200 PM: domains: Move the next_wakeup variable into the struct gpd_timing_data If the corresponding genpd for the device doesn't use a governor, the variable next_wakeup within the struct generic_pm_domain_data becomes superfluous. To avoid wasting memory, let's move it into the struct gpd_timing_data, which is already being allocated based upon if there is governor assigned. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 66d29d802ef3bf55a49b07568b0048823d4a72a6 Author: Ulf Hansson Date: Wed May 11 16:56:56 2022 +0200 PM: domains: Allocate gpd_timing_data dynamically based on governor If a genpd doesn't have an associated governor assigned, there's really no point to allocate the per device gpd_timing_data, as the data isn't being used by a governor anyway. To avoid wasting memory, let's therefore convert the corresponding td variable in the struct generic_pm_domain_data into a pointer and manage the allocation of its data dynamically. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit bcc19f69f72ab7e3db581b993d6a9fc1bad5ddf4 Author: Ulf Hansson Date: Wed May 11 16:56:55 2022 +0200 PM: domains: Skip another warning in irq_safe_dev_in_sleep_domain() In irq_safe_dev_in_sleep_domain() we correctly skip the dev_warn_once() if the corresponding genpd for the device, has the GENPD_FLAG_ALWAYS_ON flag being set. For the same reason (the genpd is always-on in runtime), let's also skip the warning if the GENPD_FLAG_RPM_ALWAYS_ON flag is set for the genpd. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 7a02444b8fc25ac16f90c1e498aeb672651d6f4b Author: Ulf Hansson Date: Wed May 11 16:56:54 2022 +0200 PM: domains: Rename irq_safe_dev_in_no_sleep_domain() in genpd The name "irq_safe_dev_in_no_sleep_domain", doesn't really match the conditions that are being checked in the function, hence the code becomes a bit confusing to read. Let's clarify this by renaming it into "irq_safe_dev_in_sleep_domain" and let's also take the opportunity to clarify a corresponding comment in the code. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 3f9ee7da724a57d808b52e6e9f53517ef3b00db6 Author: Ulf Hansson Date: Wed May 11 16:56:53 2022 +0200 PM: domains: Don't check PM_QOS_FLAG_NO_POWER_OFF in genpd Back in the days when genpd supported intermediate power states of its devices, it made sense to check the PM_QOS_FLAG_NO_POWER_OFF in genpd_power_off(). This because the attached devices were all being put into low power state together when the PM domain was also being powered off. At this point, the flag PM_QOS_FLAG_NO_POWER_OFF is better checked by drivers from their ->runtime_suspend() callbacks, like in the usb_port_runtime_suspend(), for example. Or perhaps an even better option is to set the QoS resume latency constraint for the device to zero, which informs the runtime PM core to prevent the device from being runtime suspended. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit fabb1c20b96217e8d0ebb1307985da5599885d6c Author: Ulf Hansson Date: Wed May 11 16:56:52 2022 +0200 PM: domains: Drop redundant code for genpd always-on governor Due to recent changes, the always-on governor is always used with a genpd that has the GENPD_FLAG_RPM_ALWAYS_ON flag being set. This means genpd, doesn't invoke the governor's ->power_down_ok() callback, which makes the code in the governor redundant, so let's drop it. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 27656dcd55f8065aa80dd1f9d948d7d39866a65a Author: Ulf Hansson Date: Wed May 11 16:56:51 2022 +0200 PM: domains: Add GENPD_FLAG_RPM_ALWAYS_ON for the always-on governor Rather than relying on the genpd provider to set the corresponding flag, GENPD_FLAG_RPM_ALWAYS_ON, when the always-on governor is being used, let's add it in pm_genpd_init(). In this way, it starts to benefits all genpd providers immediately. Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit d1a28597808268b87f156138aad3104aa255e62b Author: Dave Jiang Date: Mon Apr 25 11:03:29 2022 -0700 dmaengine: idxd: make idxd_wq_enable() return 0 if wq is already enabled When calling idxd_wq_enable() and wq is already enabled, code should return 0 and indicate function is successful instead of return error code and fail. This should also put idxd_wq_enable() in sync with idxd_wq_disable() where it returns 0 if wq is already disabled. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165090980906.1378449.1939401700832432886.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 8292a15597db6f97dddd2afff98095a4722d0303 Author: Samuel Holland Date: Sun Apr 24 12:27:58 2022 -0500 dmaengine: sun6i: Add support for the D1 variant So far it appears to match the configuration of the A100 variant. Since D1 is a RISC-V chip, it does not meet any of the existing dependencies for this driver, so relax the dependency somewhat. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220424172759.33383-5-samuel@sholland.org Signed-off-by: Vinod Koul commit ec31c5c594927556ae74f6617fe4969568d8dcc5 Author: Samuel Holland Date: Sun Apr 24 12:27:57 2022 -0500 dmaengine: sun6i: Add support for 34-bit physical addresses Recent Allwinner SoCs support >4 GiB of DRAM, so those variants of the DMA engine support >32 bit physical addresses. This is accomplished by placing the high bits in the "para" word in the DMA descriptor. DMA descriptors themselves can be located at >32 bit addresses by putting the high bits in the LSBs of the descriptor address register, taking advantage of the required DMA descriptor alignment. However, support for this is not really necessary, so we can avoid the complication by allocating them from the DMA_32 zone. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220424172759.33383-4-samuel@sholland.org Signed-off-by: Vinod Koul commit 9aa48806edb8c37e82532dbc6098b03f6bd4245e Author: Samuel Holland Date: Sun Apr 24 12:27:56 2022 -0500 dmaengine: sun6i: Do not use virt_to_phys This breaks on RISC-V, because dma_pool_alloc returns addresses which are not in the linear map. Instead, plumb through the physical address which is already known anyway. Acked-by: Maxime Ripard Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220424172759.33383-3-samuel@sholland.org Signed-off-by: Vinod Koul commit 59e477763d092923f567051e1bbfbb4e04d0dfbf Author: Samuel Holland Date: Sun Apr 24 12:27:55 2022 -0500 dt-bindings: dma: sun50i-a64: Add compatible for D1 D1 has a DMA controller similar to the one in other Allwinner SoCs. Add its compatible, and include it in the list of variants with a separate MBUS clock gate. Acked-by: Rob Herring Acked-by: Maxime Ripard Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220424172759.33383-2-samuel@sholland.org Signed-off-by: Vinod Koul commit 360e4f4e3fcceb9c24ee509f9eb4ed48759b3918 Author: Akhil R Date: Tue Apr 26 15:49:13 2022 +0530 dmaengine: tegra: Remove unused switch case Remove unused switch case in get_transfer_param() function. The function is not called for MEM_TO_MEM transfers. Signed-off-by: Akhil R Link: https://lore.kernel.org/r/20220426101913.43335-3-akhilrajeev@nvidia.com Signed-off-by: Vinod Koul commit 39b930bec80e7af4faae4caf4a36464a6d003bed Author: Akhil R Date: Tue Apr 26 15:49:12 2022 +0530 dmaengine: tegra: Fix uninitialized variable usage Initialize slave_bw in dma_prep*() functions as the parameter is not set for DMA_MEM_TO_MEM case in get_transfer_param(). Though the case may never occur, initializing it avoids warning from certain static checkers Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver") Reported-by: Dan Carpenter Signed-off-by: Akhil R Link: https://lore.kernel.org/r/20220426101913.43335-2-akhilrajeev@nvidia.com Signed-off-by: Vinod Koul commit 099a9a94be0e1c7fa45410deb2bff640320c3819 Author: Amelie Delaunay Date: Thu May 5 13:56:11 2022 +0200 dmaengine: stm32-dma: add device_pause/device_resume support At any time, a DMA transfer can be suspended to be restarted later before the end of the DMA transfer. In order to restart from the point where the transfer was stopped, DMA_SxNDTR has to be read after disabling the channel by clearing the EN bit in DMA_SxCR register, to know the number of data items already collected. Peripheral and/or memory addresses have to be updated in order to adjust the address pointers. SxNDTR register has to be updated with the remaining number of data items to be transferred (the value read when the channel was disabled). Then the channel can be re-enabled to resume the transfer from the point it was suspended. If the channel was configured in circular or double-buffer mode, the circular or double-buffer mode must be disabled before re-enabling the channel to be able to reconfigure SxNDTR register and re-activate circular or double-buffer mode on next Transfer Complete interrupt where channel will be disabled by HW. This is due to the fact that on resume, re-writing SxNDTR register value updates internal HW auto-reload data counter, and then it truncates all next transfers after a pause/resume sequence. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220505115611.38845-5-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit baa1424314f8e4bb5b266aaf9cc7fb7a9e65901b Author: Amelie Delaunay Date: Thu May 5 13:56:10 2022 +0200 dmaengine: stm32-dma: rename pm ops before dma pause/resume introduction dmaengine framework offers device_pause and device_resume ops to pause an on-going transfer and resume it later. To avoid any misunderstanding with system sleep pm ops, rename pm ops into stm32_dma_pm_suspend and stm32_dma_pm_resume. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220505115611.38845-4-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit ded6230691e00b0f31afc8aa18f26c57072ff58f Author: Amelie Delaunay Date: Thu May 5 13:56:09 2022 +0200 dmaengine: stm32-dma: pass DMA_SxSCR value to stm32_dma_handle_chan_done() stm32_dma_handle_chan_done() is called on Transfer Complete interrupt. As DMA_SxSCR register is read in interrupt handler, pass the value as parameter of stm32_dma_handle_chan_done(). Also return directly if chan->desc is null to remove one ident level. Then, stm32_dma_configure_next_sg() is doing something only if Double-Buffer Mode (DBM) is enabled, so, check it is enabled prior calling stm32_dma_configure_next_sg(), to remove one ident level in stm32_dma_configure_next_sg(). Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220505115611.38845-3-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit db60a63eb6850fce081c1a22e7318e5d37f4dcf5 Author: Amelie Delaunay Date: Thu May 5 13:56:08 2022 +0200 dmaengine: stm32-dma: introduce stm32_dma_sg_inc to manage chan->next_sg chan->next_sg is used to know which transfer will start after the ongoing one. It is incremented for each new transfer, either on transfer start for non-cyclic transfers, or on transfer complete interrupt for cyclic transfers. For cyclic transfer, when the last item is reached, chan->next_sg must be reinitialized to the first item. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220505115611.38845-2-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit d0b360e3c164be7ccc8eb2bfc341287959e27040 Author: Amelie Delaunay Date: Wed May 4 18:17:24 2022 +0200 dmaengine: stm32-dmamux: avoid reset of dmamux if used by coprocessor One of the two DMA controllers managed by the DMAMUX can be used by the coprocessor. It is defined in the device tree with dma-masters. When the two DMA controllers are used by the main CPU, dma-masters = <&dma1, &dma2>; is specified in the device tree. When one of the controllers is used by coprocessor (so not managed by Linux), dma-masters = <&dma1>; is specified in the device tree. In this case, Linux driver must not reset the DMAMUX, because it could have been configured by the coprocessor to use the second DMA controller. count is the number of DMA controllers defined in dma-masters property. Reset only if resets property is found and valid in device tree, and if the two DMA controllers are under Linux control. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220504161724.123180-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit c7399e6d3b18dc17974bc44e2e178664f1bd1bec Author: Vinod Koul Date: Thu Apr 21 17:47:33 2022 +0530 dmaengine: qcom: gpi: Add support for sc7280 Add compatible and driver_data for GPI DMA engines found in Qualcomm SC7280. The driver_data contains ee_offset of 0x10000. Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20220421121733.1829350-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 8f9ae5b3ae80f168a6224529e3787f4fb27f299a Author: Luiz Augusto von Dentz Date: Wed May 4 17:06:28 2022 -0700 Bluetooth: eir: Add helpers for managing service data This adds helpers for accessing and appending service data (0x16) ad type. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 1934fee67593c561ef883761bf2ddee82f908ed9 Author: Zhang Rui Date: Thu May 19 22:37:32 2022 +0800 ACPI: video: improve PM notifer callback PM notifier callbacks should check for supported events rather than filter out the unsupported events. So that it won't break when a new event is introduced. No functional change in this patch. Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 06eb8dc097b3fcb2d02eb553b17af5fcc2952f96 Author: Michael Niewöhner Date: Tue May 17 20:40:06 2022 +0200 ACPI: utils: include UUID in _DSM evaluation warning The _DSM evaluation warning in its current form is not very helpful, as it lacks any specific information: ACPI: \: failed to evaluate _DSM (0x1001) Thus, include the UUID of the missing _DSM: ACPI: \: failed to evaluate _DSM bf0212f2-... (0x1001) Signed-off-by: Michael Niewöhner Signed-off-by: Rafael J. Wysocki commit 6c3c2066d6dc317fd05893d4ce07b2f3633e3e2a Author: Krzysztof Kozlowski Date: Wed Apr 27 08:40:48 2022 +0200 dt-bindings: dma: pl330: Add power-domains The pl330 DMA controller on Exynos SoC (e.g. dma-controller@3880000 in Exynos5420) belongs to power domain, so allow such property. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220427064048.86635-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 2763826966808800beeda5db406b3b704edc8137 Author: Amelie Delaunay Date: Wed May 4 17:53:22 2022 +0200 dmaengine: stm32-mdma: use dev_dbg on non-busy channel spurious it If interrupt occurs while !chan->busy, it means channel has been disabled between the raise of the interruption and the read of status and ien, so, spurious interrupt can be silently discarded. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220504155322.121431-4-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit da3b8ddb464bd49b6248d00ca888ad751c9e44fd Author: Amelie Delaunay Date: Wed May 4 17:53:21 2022 +0200 dmaengine: stm32-mdma: fix chan initialization in stm32_mdma_irq_handler() The parameter to pass back to the handler function when irq has been requested is a struct stm32_mdma_device pointer, not a struct stm32_mdma_chan pointer. Even if chan is reinit later in the function, remove this wrong initialization. Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220504155322.121431-3-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 9d6a2d92e450926c483e45eaf426080a19219f4e Author: Amelie Delaunay Date: Wed May 4 17:53:20 2022 +0200 dmaengine: stm32-mdma: remove GISR1 register GISR1 was described in a not up-to-date documentation when the stm32-mdma driver has been developed. This register has not been added in reference manual of STM32 SoC with MDMA, which have only 32 MDMA channels. So remove it from stm32-mdma driver. Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220504155322.121431-2-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 59cafa728c373551423d67a1369289a717006a4b Author: Colin Ian King Date: Wed May 18 09:45:36 2022 +0100 powercap: intel_rapl: remove redundant store to value after multiply There is no need to store the result of the multiply back to variable value after the multiplication. The store is redundant, replace *= with just *. Cleans up clang scan build warning: warning: Although the value stored to 'value' is used in the enclosing expression, the value is never actually read from 'value' [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki commit badb81a58b9e66ca8c15405476f5134e45b57dee Author: Borislav Petkov Date: Thu May 19 16:57:15 2022 +0200 platform/x86/intel/ifs: Add CPU_SUP_INTEL dependency The driver is using functions from a compilation unit which is enabled by CONFIG_CPU_SUP_INTEL. Add that dependency to Kconfig explicitly otherwise: drivers/platform/x86/intel/ifs/load.o: in function `ifs_load_firmware': load.c:(.text+0x3b8): undefined reference to `intel_cpu_collect_info' Reported-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/YoZay8YR0zRGyVu+@zn.tnic Signed-off-by: Hans de Goede commit 2d41dc23804d075e248ff01d16d9d424bcbc1180 Author: Pierre Gondois Date: Wed May 18 11:09:01 2022 +0200 cpufreq: CPPC: Enable dvfs_possible_from_any_cpu The communication mean of the _CPC desired performance can be PCC, System Memory, System IO, or Functional Fixed Hardware (FFH). PCC, SystemMemory and SystemIo address spaces are available from any CPU. Thus, dvfs_possible_from_any_cpu should be enabled in such case. For FFH, let the FFH implementation do smp_call_function_*() calls. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 3cc30dd00a580ca0c9c0b01639841cfd72d10129 Author: Pierre Gondois Date: Wed May 18 11:09:00 2022 +0200 cpufreq: CPPC: Enable fast_switch The communication mean of the _CPC desired performance can be PCC, System Memory, System IO, or Functional Fixed Hardware. commit b7898fda5bc7 ("cpufreq: Support for fast frequency switching") fast_switching is 'for switching CPU frequencies from interrupt context'. Writes to SystemMemory and SystemIo are fast and suitable this. This is not the case for PCC and might not be the case for FFH. Enable fast_switching for the cppc_cpufreq driver in above cases. Add cppc_allow_fast_switch() to check the desired performance register address space and set fast_switching accordingly. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 6380b7b2b29da9d9c5ab2d4a265901cd93ba3696 Author: Pierre Gondois Date: Wed May 18 11:08:59 2022 +0200 ACPI: CPPC: Assume no transition latency if no PCCT The transition_delay_us (struct cpufreq_policy) is currently defined as: Preferred average time interval between consecutive invocations of the driver to set the frequency for this policy. To be set by the scaling driver (0, which is the default, means no preference). The transition_latency represents the amount of time necessary for a CPU to change its frequency. A PCCT table advertises mutliple values: - pcc_nominal: Expected latency to process a command, in microseconds - pcc_mpar: The maximum number of periodic requests that the subspace channel can support, reported in commands per minute. 0 indicates no limitation. - pcc_mrtt: The minimum amount of time that OSPM must wait after the completion of a command before issuing the next command, in microseconds. cppc_get_transition_latency() allows to get the max of them. commit d4f3388afd48 ("cpufreq / CPPC: Set platform specific transition_delay_us") allows to select transition_delay_us based on the platform, and fallbacks to cppc_get_transition_latency() otherwise. If _CPC objects are not using PCC channels (no PPCT table), the transition_delay_us is set to CPUFREQ_ETERNAL, leading to really long periods between frequency updates (~4s). If the desired_reg, where performance requests are written, is in SystemMemory or SystemIo ACPI address space, there is no delay in requests. So return 0 instead of CPUFREQ_ETERNAL, leading to transition_delay_us being set to LATENCY_MULTIPLIER us (1000 us). This patch also adds two macros to check the address spaces. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 72f2ecb7ece7c1d89758d4929d98e95d95fe7199 Author: Pierre Gondois Date: Wed May 18 11:08:58 2022 +0200 ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported The _OSC method allows the OS and firmware to communicate about supported features/capabitlities. It also allows the OS to take control of some features. In ACPI 6.4, s6.2.11.2 Platform-Wide OSPM Capabilities, the CPPC (resp. v2) bit should be set by the OS if it 'supports controlling processor performance via the interfaces described in the _CPC object'. The OS supports CPPC and parses the _CPC object only if CONFIG_ACPI_CPPC_LIB is set. Replace the x86 specific boot_cpu_has(X86_FEATURE_HWP) dynamic check with an arch generic CONFIG_ACPI_CPPC_LIB build-time check. Note: CONFIG_X86_INTEL_PSTATE selects CONFIG_ACPI_CPPC_LIB. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 0651ab90e4ade17f1d4f4367b70f6120480410f3 Author: Pierre Gondois Date: Wed May 18 11:08:57 2022 +0200 ACPI: CPPC: Check _OSC for flexible address space ACPI 6.2 Section 6.2.11.2 'Platform-Wide OSPM Capabilities': Starting with ACPI Specification 6.2, all _CPC registers can be in PCC, System Memory, System IO, or Functional Fixed Hardware address spaces. OSPM support for this more flexible register space scheme is indicated by the “Flexible Address Space for CPPC Registers” _OSC bit Otherwise (cf ACPI 6.1, s8.4.7.1.1.X), _CPC registers must be in: - PCC or Functional Fixed Hardware address space if defined - SystemMemory address space (NULL register) if not defined Add the corresponding _OSC bit and check it when parsing _CPC objects. Signed-off-by: Pierre Gondois Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 3ce827bf9cfecaf2cbfd9a9d44f0db9f40882780 Author: Heikki Krogerus Date: Thu May 19 15:21:03 2022 +0300 platform/x86: intel_cht_int33fe: Set driver data Module removal fails because cht_int33fe_typec_remove() tries to access driver data that does not exist. Fixing by assigning the data at the end of probe. Fixes: 915623a80b5a ("platform/x86: intel_cht_int33fe: Switch to DMI modalias based loading") Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220519122103.78546-1-heikki.krogerus@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit bd30d075eedce159fd5a42e772b903facaa3c47c Author: Zhang Rui Date: Thu May 19 22:35:08 2022 +0800 thermal: intel: pch: improve the cooling delay log Previously, during suspend, intel_pch_thermal driver logs for every cooling iteration, about the current PCH temperature and number of cooling iterations that have been tried, like below [ 100.955526] intel_pch_thermal 0000:00:14.2: CPU-PCH current temp [53C] higher than the threshold temp [50C], sleep 1 times for 100 ms duration [ 101.064156] intel_pch_thermal 0000:00:14.2: CPU-PCH current temp [53C] higher than the threshold temp [50C], sleep 2 times for 100 ms duration After changing the default delay_cnt to 600, in practice, it is common to see tens of the above messages if the system is suspended when PCH overheats. Thus, change this log message from dev_warn to dev_dbg because it is only useful when we want to check the temperature trend. At the same time, there is always a one-line message given by the driver with the patch applied, with below four possibilities. 1. PCH is cool, no cooling delay needed [ 1791.902853] intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [48C] 2. PCH overheats and becomes cool after the cooling delays [ 1475.511617] intel_pch_thermal 0000:00:12.0: CPU-PCH is cool [49C] after 30700 ms delay 3. PCH still overheats after the overall cooling timeout [ 2250.157487] intel_pch_thermal 0000:00:12.0: CPU-PCH is hot [60C] after 60000 ms delay. S0ix might fail 4. PCH aborts cooling because of wakeup event detected during the delay [ 1933.639509] intel_pch_thermal 0000:00:12.0: Wakeup event detected, abort cooling Signed-off-by: Zhang Rui Tested-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit 92923028e9795055debc460243cc246cc9284cd1 Author: Zhang Rui Date: Thu May 19 22:35:07 2022 +0800 thermal: intel: pch: enhance overheat handling Commit ef63b043ac86 ("thermal: intel: pch: fix S0ix failure due to PCH temperature above threshold") introduces delay loop mechanism that allows PCH temperature to go down below threshold during suspend so it won't block S0ix. And the default overall delay timeout is 1 second. However, in practice, we found that the time it takes to cool the PCH down below threshold highly depends on the initial PCH temperature when the delay starts, as well as the ambient temperature. And in some cases, the 1 second delay is not sufficient. As a result, the system stays in a shallower power state like PCx instead of S0ix, and drains the battery power, without user' notice. To make sure S0ix is not blocked by the PCH overheating, we 1. expand the default overall timeout to 60 seconds. 2. make sure the temperature is below threshold rather than equal to it. At the same time, as the cooling delay can be much longer and many wakeup events (ACPI Power Button press, USB mouse move, etc) becomes valid in the suspend_noirq phase, add detection of wakeup event so that the driver does not delay blindly when the system suspend is likely to abort soon. This patch may introduce longer suspend time, but only in the cases when the system overheats and Linux used to enter a shallower S2idle state, say, PCx instead of S0ix. Signed-off-by: Zhang Rui Tested-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit 28708e19370013d819a511e76a0a85ae10f1be15 Author: Zhang Rui Date: Thu May 19 22:35:06 2022 +0800 thermal: intel: pch: move cooling delay to suspend_noirq phase Move the PCH Thermal driver suspend callback to suspend_noirq to do cooling while the system is more quiescent. Signed-off-by: Zhang Rui Tested-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit 55266546f45dcc9284ca93f4fa3f6693d30ea8ce Author: Zhang Rui Date: Thu May 19 22:35:05 2022 +0800 PM: wakeup: expose pm_wakeup_pending to modules intel_pch_thermal driver needs a long delay to cool itself (60 seconds in maximum) during suspend. When a wakeup event occures during the delay, it is better for the intel_pch_thermal driver to detect this and quit cooling because the suspend is likely to abort anyway. Thus expose pm_wakeup_pending to modules so that intel_pch_thermal driver can be aware of the wakeup events. Signed-off-by: Zhang Rui Tested-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit 1620c80bba53af8c547bab34a1d3bc58319fe608 Author: Michael Niewöhner Date: Tue May 17 20:31:30 2022 +0200 platform/x86: intel-hid: fix _DSM function index handling intel_hid_dsm_fn_mask is a bit mask containing one bit for each function index. Fix the function index check in intel_hid_evaluate_method accordingly, which was missed in commit 97ab4516205e ("platform/x86: intel-hid: fix _DSM function index handling"). Fixes: 97ab4516205e ("platform/x86: intel-hid: fix _DSM function index handling") Cc: stable@vger.kernel.org Signed-off-by: Michael Niewöhner Link: https://lore.kernel.org/r/66f813f5bcc724a0f6dd5adefe6a9728dbe509e3.camel@mniewoehner.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 9dcff75d39f246f3bb39b2816f35f54d6add8545 Merge: 6646b95aab5f6 3be0ec65fd17b Author: Greg Kroah-Hartman Date: Thu May 19 19:37:39 2022 +0200 Merge tag 'icc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 5.19 These are the interconnect changes for the 5.19-rc1 merge window consisting of driver updates. Driver changes: - New driver for SC8280XP - New driver for SDX65 - SC8180X driver fixes - Constify various data structures in that are never modified - Fix clock rate caching in RPM drivers. - Misc fixes and clean-ups Signed-off-by: Georgi Djakov * tag 'icc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: dt-bindings: interconnect: Remove sc7180/sdx55 ipa compatibles interconnect: qcom: sc8180x: Reformat node and bcm definitions interconnect: qcom: sc8180x: Mark some BCMs keepalive interconnect: qcom: sc8180x: Fix QUP0 nodes interconnect: qcom: sc8180x: Modernize sc8180x probe dt-bindings: interconnect: Add SC8180X QUP0 virt provider interconnect: qcom: icc-rpm: Cache every clock rate interconnect: qcom: icc-rpm: Fix for cached clock rate interconnect: qcom: sc8280xp: constify qcom_icc_bcm pointers interconnect: qcom: sc8280xp: constify icc_node pointers interconnect: qcom: sc8280xp: constify qcom_icc_desc interconnect: qcom: Add SDX65 interconnect provider driver dt-bindings: interconnect: Add Qualcomm SDX65 DT bindings interconnect: qcom: constify qcom_icc_bcm pointers interconnect: qcom: constify icc_node pointers interconnect: qcom: constify qcom_icc_desc interconnect: qcom: Add SC8280XP interconnect provider dt-bindings: interconnect: qcom: Add sc8280xp binding commit b232b02bf3c205b13a26dcec08e53baddd8e59ed Author: Zhang Wensheng Date: Wed May 18 15:45:16 2022 +0800 driver core: fix deadlock in __device_attach In __device_attach function, The lock holding logic is as follows: ... __device_attach device_lock(dev) // get lock dev async_schedule_dev(__device_attach_async_helper, dev); // func async_schedule_node async_schedule_node_domain(func) entry = kzalloc(sizeof(struct async_entry), GFP_ATOMIC); /* when fail or work limit, sync to execute func, but __device_attach_async_helper will get lock dev as well, which will lead to A-A deadlock. */ if (!entry || atomic_read(&entry_count) > MAX_WORK) { func; else queue_work_node(node, system_unbound_wq, &entry->work) device_unlock(dev) As shown above, when it is allowed to do async probes, because of out of memory or work limit, async work is not allowed, to do sync execute instead. it will lead to A-A deadlock because of __device_attach_async_helper getting lock dev. To fix the deadlock, move the async_schedule_dev outside device_lock, as we can see, in async_schedule_node_domain, the parameter of queue_work_node is system_unbound_wq, so it can accept concurrent operations. which will also not change the code logic, and will not lead to deadlock. Fixes: 765230b5f084 ("driver-core: add asynchronous probing support for drivers") Signed-off-by: Zhang Wensheng Link: https://lore.kernel.org/r/20220518074516.1225580-1-zhangwensheng5@huawei.com Signed-off-by: Greg Kroah-Hartman commit 1a702dc88e150487c9c173a249b3d236498b9183 Author: Hao Luo Date: Mon May 16 12:09:51 2022 -0700 kernfs: Separate kernfs_pr_cont_buf and rename_lock. Previously the protection of kernfs_pr_cont_buf was piggy backed by rename_lock, which means that pr_cont() needs to be protected under rename_lock. This can cause potential circular lock dependencies. If there is an OOM, we have the following call hierarchy: -> cpuset_print_current_mems_allowed() -> pr_cont_cgroup_name() -> pr_cont_kernfs_name() pr_cont_kernfs_name() will grab rename_lock and call printk. So we have the following lock dependencies: kernfs_rename_lock -> console_sem Sometimes, printk does a wakeup before releasing console_sem, which has the dependence chain: console_sem -> p->pi_lock -> rq->lock Now, imagine one wants to read cgroup_name under rq->lock, for example, printing cgroup_name in a tracepoint in the scheduler code. They will be holding rq->lock and take rename_lock: rq->lock -> kernfs_rename_lock Now they will deadlock. A prevention to this circular lock dependency is to separate the protection of pr_cont_buf from rename_lock. In principle, rename_lock is to protect the integrity of cgroup name when copying to buf. Once pr_cont_buf has got its content, rename_lock can be dropped. So it's safe to drop rename_lock after kernfs_name_locked (and kernfs_path_from_node_locked) and rely on a dedicated pr_cont_lock to protect pr_cont_buf. Acked-by: Tejun Heo Signed-off-by: Hao Luo Link: https://lore.kernel.org/r/20220516190951.3144144-1-haoluo@google.com Signed-off-by: Greg Kroah-Hartman commit a6653fb584b5f6ac60ddd5d86ddd49a1f3945a04 Author: Ulf Hansson Date: Sat May 14 17:20:44 2022 +0200 cpuidle: riscv-sbi: Fix code to allow a genpd governor to be used The intent is to use a genpd governor when there are some states that needs to be managed. Although, the current code ends up to never assign a governor, let's fix this. Fixes: 6abf32f1d9c50 ("cpuidle: Add RISC-V SBI CPU idle driver") Signed-off-by: Ulf Hansson Reviewed-by: Anup Patel Tested-by: Anup Patel Signed-off-by: Rafael J. Wysocki commit 34be27517cb763ea367da21e3cdee5d1bc40f47f Author: Ulf Hansson Date: Sat May 14 17:20:32 2022 +0200 cpuidle: psci: Fix regression leading to no genpd governor While factoring out the PM domain related code from PSCI domain driver into a set of library functions, a regression when initializing the genpds got introduced. More precisely, we fail to assign a genpd governor, so let's fix this. Fixes: 9d976d6721df ("cpuidle: Factor-out power domain related code from PSCI domain driver") Signed-off-by: Ulf Hansson Reviewed-by: Anup Patel Signed-off-by: Rafael J. Wysocki commit bc10916e890948d8927a5c8c40fb5dc44be5e1b8 Author: Denis Efremov Date: Wed May 18 11:00:52 2022 +0400 staging: r8188eu: prevent ->Ssid overflow in rtw_wx_set_scan() This code has a check to prevent read overflow but it needs another check to prevent writing beyond the end of the ->Ssid[] array. Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Cc: stable Signed-off-by: Denis Efremov Link: https://lore.kernel.org/r/20220518070052.108287-1-denis.e.efremov@oracle.com Signed-off-by: Greg Kroah-Hartman commit 15f214f9bdb7c1f560b4bf863c5a72ff53b442a4 Author: Dietmar Eggemann Date: Fri May 13 11:34:33 2022 +0200 topology: Remove unused cpu_cluster_mask() default_topology[] uses cpu_clustergroup_mask() for the CLS level (guarded by CONFIG_SCHED_CLUSTER) which is currently provided by x86 (arch/x86/kernel/smpboot.c) and arm64 (drivers/base/arch_topology.c). Fixes: 778c558f49a2 ("sched: Add cluster scheduler level in core and related Kconfig for ARM64") Acked-by: Barry Song Signed-off-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20220513093433.425163-1-dietmar.eggemann@arm.com Signed-off-by: Greg Kroah-Hartman commit 2b28a1a84a0eb3412bad1a2d5cce2bb4addec626 Author: Saravana Kannan Date: Fri Apr 29 15:09:32 2022 -0700 driver core: Extend deferred probe timeout on driver registration The deferred probe timer that's used for this currently starts at late_initcall and runs for driver_deferred_probe_timeout seconds. The assumption being that all available drivers would be loaded and registered before the timer expires. This means, the driver_deferred_probe_timeout has to be pretty large for it to cover the worst case. But if we set the default value for it to cover the worst case, it would significantly slow down the average case. For this reason, the default value is set to 0. Also, with CONFIG_MODULES=y and the current default values of driver_deferred_probe_timeout=0 and fw_devlink=on, devices with missing drivers will cause their consumer devices to always defer their probes. This is because device links created by fw_devlink defer the probe even before the consumer driver's probe() is called. Instead of a fixed timeout, if we extend an unexpired deferred probe timer on every successful driver registration, with the expectation more modules would be loaded in the near future, then the default value of driver_deferred_probe_timeout only needs to be as long as the worst case time difference between two consecutive module loads. So let's implement that and set the default value to 10 seconds when CONFIG_MODULES=y. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Rob Herring Cc: Linus Walleij Cc: Will Deacon Cc: Ulf Hansson Cc: Kevin Hilman Cc: Thierry Reding Cc: Mark Brown Cc: Pavel Machek Cc: Geert Uytterhoeven Cc: Yoshihiro Shimoda Cc: Paul Kocialkowski Cc: linux-gpio@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: iommu@lists.linux-foundation.org Reviewed-by: Mark Brown Acked-by: Rob Herring Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20220429220933.1350374-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 42d2607d91c4ec37ea1970899c2d614824f3014b Author: Chanwoo Choi Date: Thu May 19 10:07:53 2022 +0900 PM / devfreq: passive: Return non-error when not-supported event is required Each devfreq governor specifies the supported governor event such as GOV_START and GOV_STOP. When not-supported event is required, just return non-error. But, commit ce9a0d88d97a ("PM / devfreq: Add cpu based scaling support to passive governor") returned the error value. So that return non-error value when not-supported event is required. Fixes: ce9a0d88d97a ("PM / devfreq: Add cpu based scaling support to passive governor") Reported-by: Marek Szyprowski Signed-off-by: Chanwoo Choi Signed-off-by: Rafael J. Wysocki commit 6779db970bd287bb35b28bd5dc256fd7aef19d1c Author: Dmitry Osipenko Date: Tue May 10 02:32:35 2022 +0300 kernel/reboot: Add devm_register_restart_handler() Add devm_register_restart_handler() helper that registers sys-off handler using restart mode and with a default priority. Most drivers will want to register restart handler with a default priority, so this helper will reduce the boilerplate code and make code easier to read and follow. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit d2c5415327171e6c1bca2dc4d8a77f450ecf7150 Author: Dmitry Osipenko Date: Tue May 10 02:32:34 2022 +0300 kernel/reboot: Add devm_register_power_off_handler() Add devm_register_power_off_handler() helper that registers sys-off handler using power-off mode and with a default priority. Most drivers will want to register power-off handler with a default priority, so this helper will reduce the boilerplate code and make code easier to read and follow. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit eae813b755c46c74d65f52fa6b0b1a5476e13551 Author: Dmitry Osipenko Date: Tue May 10 02:32:33 2022 +0300 soc/tegra: pmc: Use sys-off handler API to power off Nexus 7 properly Nexus 7 Android tablet can be turned off using a special bootloader command which is conveyed to bootloader by putting magic value into the special scratch register and then rebooting normally. This power-off method should be invoked if USB cable is connected. Bootloader then will display battery status and power off the device. This behaviour is borrowed from downstream kernel and matches user expectations, otherwise it looks like device got hung during power-off and it may wake up on USB disconnect. Switch PMC driver to sys-off handler API, which provides drivers with chained power-off callbacks functionality that is required for powering-off devices properly. It also brings resource-managed API for the restart handler registration that makes PMC driver code cleaner. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 5b71808eb7c97815fc3b9c386ca0ef6daf2dc053 Author: Dmitry Osipenko Date: Tue May 10 02:32:32 2022 +0300 reboot: Remove pm_power_off_prepare() All pm_power_off_prepare() users were converted to sys-off handler API. Remove the obsolete global callback variable. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 02a1124defc2571b81c054ae4c5481f1ac7ccf20 Author: Dmitry Osipenko Date: Tue May 10 02:32:31 2022 +0300 regulator: pfuze100: Use devm_register_sys_off_handler() Use devm_register_sys_off_handler() that replaces global pm_power_off_prepare variable and allows to register multiple power-off handlers. Acked-by: Mark Brown Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 98f30d0ecf79da8cf17a171fa4cf6eda7ba4dd71 Author: Dmitry Osipenko Date: Tue May 10 02:32:30 2022 +0300 ACPI: power: Switch to sys-off handler API Switch to sys-off API that replaces legacy pm_power_off callbacks, allowing us to remove global pm_* variables and support chaining of all restart and power-off modes consistently. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit bf8d73b934df8aa485dc4650d6d5dfe5a640af4b Author: Dmitry Osipenko Date: Tue May 10 02:32:29 2022 +0300 memory: emif: Use kernel_can_power_off() Replace legacy pm_power_off with kernel_can_power_off() helper that is aware about chained power-off handlers. Acked-by: Krzysztof Kozlowski Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 2dfb34edfebf8a881914ffc80551fd37d1b632c2 Author: Dmitry Osipenko Date: Tue May 10 02:32:28 2022 +0300 mips: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Thomas Bogendoerfer Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit d3ad437e68712ad82177e5ae481688a06661f797 Author: Dmitry Osipenko Date: Tue May 10 02:32:27 2022 +0300 ia64: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit d35773499329300d837818417f6d1b5a7987317d Author: Dmitry Osipenko Date: Tue May 10 02:32:26 2022 +0300 x86: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 9b0d0af145195cfd79210b805448a4bcc69f0e04 Author: Dmitry Osipenko Date: Tue May 10 02:32:25 2022 +0300 sh: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit f0f7e5265b3b37b0aea3d7601607e2e46ea6a9c1 Author: Dmitry Osipenko Date: Tue May 10 02:32:24 2022 +0300 m68k: Switch to new sys-off handler API Kernel now supports chained power-off handlers. Use register_power_off_handler() that registers power-off handlers and do_kernel_power_off() that invokes chained power-off handlers. Legacy pm_power_off() will be removed once all drivers will be converted to the new sys-off API. Normally arch code should adopt only the do_kernel_power_off() at first, but m68k is a special case because it uses pm_power_off() "inside out", i.e. pm_power_off() invokes machine_power_off() [in fact it does nothing], while it's machine_power_off() that should invoke the pm_power_off(), and thus, we can't convert platforms to the new API separately. There are only two platforms changed here, so it's not a big deal. Acked-by: Geert Uytterhoeven Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit c33fd0b17eab643e13cb8555a0588ae6eee8f657 Author: Dmitry Osipenko Date: Tue May 10 02:32:23 2022 +0300 powerpc: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Michael Ellerman Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit f089ab674cea43561fee8e3de8d15d864e486286 Author: Dmitry Osipenko Date: Tue May 10 02:32:22 2022 +0300 xen/x86: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Juergen Gross Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit f4622fe42484209fe2050b5461d14b6a1dd212ad Author: Dmitry Osipenko Date: Tue May 10 02:32:21 2022 +0300 parisc: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Helge Deller # parisc Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 0c6499149ebdb2ea7dd3507bb2263e5848c94ad7 Author: Dmitry Osipenko Date: Tue May 10 02:32:20 2022 +0300 arm64: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Catalin Marinas Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 6b22c7365962a80c4e8fb7dea19247cef260e725 Author: Dmitry Osipenko Date: Tue May 10 02:32:19 2022 +0300 riscv: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Palmer Dabbelt Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit cf7e5bf0c68fa4a057ad3297ebdafa1189208236 Author: Dmitry Osipenko Date: Tue May 10 02:32:18 2022 +0300 csky: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Acked-by: Guo Ren Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 856c288b0039791f64bdeb16e2a73ae1c8e5e575 Author: Dmitry Osipenko Date: Tue May 10 02:32:17 2022 +0300 ARM: Use do_kernel_power_off() Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new sys-off API. Reviewed-by: Russell King (Oracle) Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit fb61375ecfba49e153af561402f49f6fe3bebd39 Author: Dmitry Osipenko Date: Tue May 10 02:32:16 2022 +0300 kernel/reboot: Add register_platform_power_off() Add platform-level registration helpers that will ease transition of the arch/platform power-off callbacks to the new sys-off based API, allowing us to remove the global pm_power_off variable in the future. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 0e2110d2e910e44cc7cf23fce14613e232602602 Author: Dmitry Osipenko Date: Tue May 10 02:32:15 2022 +0300 kernel/reboot: Add kernel_can_power_off() Add kernel_can_power_off() helper that replaces open-coded checks of the global pm_power_off variable. This is a necessary step towards supporting chained power-off handlers. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 5d34b41aa420c3908793b43419a1097362ca2668 Author: Dmitry Osipenko Date: Tue May 10 02:32:14 2022 +0300 kernel/reboot: Add stub for pm_power_off Add weak stub for the global pm_power_off callback variable. This will allow us to remove pm_power_off definitions from arch/ code and transition to the new sys-off based API that will replace the global variable. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 2b6aa7332f8020dfdaffe340ff038aac4df35238 Author: Dmitry Osipenko Date: Tue May 10 02:32:13 2022 +0300 kernel/reboot: Add do_kernel_power_off() Add do_kernel_power_off() helper that will remove open-coded pm_power_off invocations from the architecture code. This is the first step on the way to remove the global pm_power_off variable, which will allow us to implement consistent power-off chaining support. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 7b9a3de9ffe76e4a965bafe26c91d9c6351e1e18 Author: Dmitry Osipenko Date: Tue May 10 02:32:12 2022 +0300 kernel/reboot: Wrap legacy power-off callbacks into sys-off handlers Wrap legacy power-off callbacks into sys-off handlers in order to support co-existence of both legacy and new callbacks while we're in process of upgrading legacy callbacks to the new API. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 232edc2f72f5beda3586360de6254d443820050a Author: Dmitry Osipenko Date: Tue May 10 02:32:11 2022 +0300 kernel/reboot: Introduce sys-off handler API In order to support power-off chaining we need to get rid of the global pm_* variables, replacing them with the new kernel API functions that support chaining. Introduce new generic sys-off handler API that brings the following features: 1. Power-off and restart handlers are registered using same API function that supports chaining, hence all power-off and restart modes will support chaining using this unified function. 2. Prevents notifier priority collisions by disallowing registration of multiple handlers at the non-default priority level. 3. Supports passing opaque user argument to callback, which allows us to remove global variables from drivers. This patch adds support of the following sys-off modes: - SYS_OFF_MODE_POWER_OFF_PREPARE that replaces global pm_power_off_prepare variable and provides chaining support for power-off-prepare handlers. - SYS_OFF_MODE_POWER_OFF that replaces global pm_power_off variable and provides chaining support for power-off handlers. - SYS_OFF_MODE_RESTART that provides a better restart API, removing a need from drivers to have a global scratch variable by utilizing the opaque callback argument. Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit c82f898d873ce10d88f8d60b38c8dd19f1ed7c66 Author: Dmitry Osipenko Date: Tue May 10 02:32:10 2022 +0300 notifier: Add blocking/atomic_notifier_chain_register_unique_prio() Add variant of blocking/atomic_notifier_chain_register() functions that allow registration of a notifier only if it has unique priority, otherwise -EBUSY error code is returned by the new functions. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 6ee60e9c9f2f83ad218159af6a175c57a395ae69 Author: Luis Chamberlain Date: Thu May 12 11:55:29 2022 -0700 MAINTAINERS: add Russ Weight as a firmware loader maintainer Russ has done extensive rework on the usermode helper interface for the firmware loader. He's also exressed recent interest with maintenance and has kindly agreed to help review generic patches for the firmware loader. So add him as a new maintainer! Signed-off-by: Luis Chamberlain Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220512185529.3138310-1-mcgrof@kernel.org Signed-off-by: Greg Kroah-Hartman commit 310862e574001a97ad02272bac0fd13f75f42a27 Author: Schspa Shi Date: Fri May 13 19:24:44 2022 +0800 driver: base: fix UAF when driver_attach failed When driver_attach(drv); failed, the driver_private will be freed. But it has been added to the bus, which caused a UAF. To fix it, we need to delete it from the bus when failed. Fixes: 190888ac01d0 ("driver core: fix possible missing of device probe") Signed-off-by: Schspa Shi Link: https://lore.kernel.org/r/20220513112444.45112-1-schspa@gmail.com Signed-off-by: Greg Kroah-Hartman commit 185b29c6151cf3a5c387ca5904c51c6af3292a0c Author: Dan Carpenter Date: Fri May 6 09:55:15 2022 +0300 test_firmware: fix end of loop test in upload_read_show() If a list_for_each_entry() loop exits without hitting a break statement then the iterator points to invalid memory. So in this code the "tst->name" dereference is an out bounds read. It's an offset from the &test_upload_list pointer and it will likely work fine most of the time but it's not correct. One alternative is to fix this this by changing the test to: if (list_entry_is_head(tst, &test_upload_list, node)) { But the simpler, trendy new way is just create a new variable and test for NULL. Fixes: a31ad463b72d ("test_firmware: Add test support for firmware upload") Reviewed-by: Russ Weight Acked-by: Luis Chamberlain Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YnTGU3UJOIA09I7e@kili Signed-off-by: Greg Kroah-Hartman commit 1f7ff11ca68f464b6a9a71b8fbe9e5219e7cac57 Author: Won Chung Date: Mon May 9 21:49:30 2022 +0000 driver core: location: Add "back" as a possible output for panel Add "back" as a possible panel output when _PLD output from ACPI indicates back panel. Fixes: 6423d2951087 ("driver core: Add sysfs support for physical location of a device") Signed-off-by: Won Chung Link: https://lore.kernel.org/r/20220509214930.3573518-1-wonchung@google.com Signed-off-by: Greg Kroah-Hartman commit 28330dcc94152433c4bbc3d4d7a26755d4211874 Author: Won Chung Date: Mon May 9 17:31:35 2022 +0000 driver core: location: Free struct acpi_pld_info *pld After struct acpi_pld_info *pld is used to fill in physical location values, it should be freed to prevent memleak. Suggested-by: Yu Watanabe Signed-off-by: Won Chung Link: https://lore.kernel.org/r/20220509173135.3515126-1-wonchung@google.com Signed-off-by: Greg Kroah-Hartman commit f79f662e4cd56f6fd3436dd68057d2ec1f7d2025 Author: Saravana Kannan Date: Tue May 3 17:53:43 2022 -0700 driver core: Add "*" wildcard support to driver_async_probe cmdline param There's currently no way to use driver_async_probe kernel cmdline param to enable default async probe for all drivers. So, add support for "*" to match with all driver names. When "*" is used, all other drivers listed in driver_async_probe are drivers that will NOT match the "*". For example: * driver_async_probe=drvA,drvB,drvC drvA, drvB and drvC do asynchronous probing. * driver_async_probe=* All drivers do asynchronous probing except those that have set PROBE_FORCE_SYNCHRONOUS flag. * driver_async_probe=*,drvA,drvB,drvC All drivers do asynchronous probing except drvA, drvB, drvC and those that have set PROBE_FORCE_SYNCHRONOUS flag. Cc: Alexander Duyck Cc: Randy Dunlap Cc: Feng Tang Signed-off-by: Saravana Kannan Link: https://lore.kernel.org/r/20220504005344.117803-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit a725e582d720066e49034f8980af57a720d75127 Author: Krzysztof Kozlowski Date: Wed Apr 27 18:11:23 2022 +0200 dmaengine: ti: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Switch to new property while keeping backward compatibility. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20220427161126.647073-4-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 13dfd97a341a5cf9d15f415dd469f45e971ef12a Author: Dmitry Osipenko Date: Thu May 19 14:02:32 2022 +0300 notifier: Add atomic_notifier_call_chain_is_empty() Add atomic_notifier_call_chain_is_empty() that returns true if given atomic call chain is empty. The first user of this new notifier API function will be the kernel power-off core code that will support power-off call chains. The core code will need to check whether there is a power-off handler registered at all in order to decide whether to halt machine or power it off. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Signed-off-by: Rafael J. Wysocki commit 607c04a0441ff477666dca4744e94f555aa8fd65 Author: Krzysztof Kozlowski Date: Tue May 3 08:54:06 2022 +0200 dmaengine: mmp: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Switch to new property while keeping backward compatibility. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220503065407.52188-4-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit d9cb0a4c0be595b55e30cf8774d3e92ab38bca5b Author: Krzysztof Kozlowski Date: Tue May 3 08:54:05 2022 +0200 dmaengine: pxa: deprecate '#dma-channels' and '#dma-requests' The generic properties, used in most of the drivers and defined in generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'. Switch to new properties while keeping backward compatibility. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220503065407.52188-3-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit bd1eca7b2c66c53873a0eab84f9f301aca41f33a Author: Krzysztof Kozlowski Date: Tue May 3 08:54:04 2022 +0200 dt-bindings: dmaengine: mmp: deprecate '#dma-channels' and '#dma-requests' The generic properties, used in most of the drivers and defined in generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220503065407.52188-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 2cdd3ca67aeabf4d6274af2d1c7e22f17a33dd64 Author: YueHaibing Date: Thu May 5 17:32:36 2022 +0800 dmaengine: tegra: Fix build error without IOMMU_API drivers/dma/tegra186-gpc-dma.c: In function ‘tegra_dma_probe’: drivers/dma/tegra186-gpc-dma.c:1364:24: error: ‘struct iommu_fwspec’ has no member named ‘ids’ stream_id = iommu_spec->ids[0] & 0xffff; ^~ Make TEGRA186_GPC_DMA depends on IOMMU_API to fix this. Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220505093236.15076-1-yuehaibing@huawei.com Signed-off-by: Vinod Koul commit c23b7517fe623d5812436682937a79ca0cc4cd39 Merge: 7b145802ba545 ffcb2fc86eb7e Author: Rafael J. Wysocki Date: Thu May 19 19:15:34 2022 +0200 Merge tag 'thermal-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal control material for 5.19-rc1 from Daniel Lezcano: - Add the new k3 j72xx bangdap driver and the corresponding bindings (Keerthy) - Fix the missing of_node_put() in the SC iMX driver at probe timer (Miaoqian Lin) - Fix memory leak in __thermal_cooling_device_register() when device_register() fails by calling thermal_cooling_device_destroy_sysfs() (Yang Yingliang) - Add sc8180x and sc8280xp compatible string in the DT bindings and lMH support for QCom tsens driver (Bjorn Andersson) - Fix OTP Calibration Register values conforming to the documentation on RZ/G2L and bindings documentation for RZ/G2UL (Biju Das) - Fix type in kerneldoc description for __thermal_bind_params (Corentin Labbe) - Remove unneeded semi colon in libthermal and tools thermal as reported by cocci (Jiapeng Chong) - Fix potential NULL dereference in sr_thermal_probe() on Broadcom platform (Zheng Yongjun) - Add thermal library and thermal tools to encapsulate the netlink into event based callbacks (Daniel Lezcano) - Add change mode ops for the thermal-of sensor (Manaf Meethalavalappu Pallikunhi) - Fix non negative value support by preventing the value to be clamp to zero (Stefan Wahren) - Add compatible string and DT bindings for MSM8960 tsens driver (Dmitry Baryshkov) - Add hwmon support for K3 driver (Massimiliano Minella) - Refactor and add multiple generations support for QCom ADC driver (Jishnu Prakash) - Use platform_get_irq_optional() to get the interrupt on RCar driver and document Document RZ/V2L bindings (Lad Prabhakar) * tag 'thermal-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (28 commits) thermal: k3_j72xx_bandgap: Add the bandgap driver support dt-bindings: thermal: k3-j72xx: Add VTM bindings documentation thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe thermal/core: Fix memory leak in __thermal_cooling_device_register() dt-bindings: thermal: tsens: Add sc8280xp compatible dt-bindings: thermal: lmh: Add Qualcomm sc8180x compatible thermal/drivers/qcom/lmh: Add sc8180x compatible thermal/drivers/rz2gl: Fix OTP Calibration Register values dt-bindings: thermal: rzg2l-thermal: Document RZ/G2UL bindings thermal: thermal_of: fix typo on __thermal_bind_params tools/thermal: remove unneeded semicolon tools/lib/thermal: remove unneeded semicolon thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe tools/thermal: Add thermal daemon skeleton tools/thermal: Add a temperature capture tool tools/thermal: Add util library tools/lib/thermal: Add a thermal library thermal/drivers/thermal_of: Add change_mode ops support for thermal_of sensor thermal/drivers/bcm2711: Don't clamp temperature at zero thermal/drivers/tsens: Add compat string for the qcom,msm8960 ... commit d5a8fe0fee54d830c47959f625ffc41d080ee526 Author: Miquel Raynal Date: Wed Apr 27 11:56:51 2022 +0200 dmaengine: dw: Add RZN1 compatible The Renesas RZN1 DMA IP is very close to the original DW DMA IP, a DMA router has been introduced to handle the wiring options that have been added. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Acked-by: Andy Shevchenko Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220427095653.91804-8-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 2182066d95c33dfb4cb7400952a92cfd12265873 Author: Miquel Raynal Date: Wed Apr 27 11:56:50 2022 +0200 clk: renesas: r9a06g032: Probe possible children The clock controller device on r9a06g032 takes all the memory range that is described as being a system controller. This range contains many different (unrelated?) registers besides the ones belonging to the clock controller, that can necessitate to be accessed from other peripherals. For instance, the dmamux registers are there. The dmamux "device" will be described as a child node of the clock/system controller node, which means we need the top device driver (the clock controller driver in this case) to populate its children manually. In case of error when populating the children, we do not fail the probe on purpose to keep the clk driver up and running. Signed-off-by: Miquel Raynal Acked-by: Stephen Boyd Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220427095653.91804-7-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 134d9c52fca26d2d199516e915da00f0cc6adc73 Author: Miquel Raynal Date: Wed Apr 27 11:56:49 2022 +0200 dmaengine: dw: dmamux: Introduce RZN1 DMA router support The Renesas RZN1 DMA IP is based on a DW core, with eg. an additional dmamux register located in the system control area which can take up to 32 requests (16 per DMA controller). Each DMA channel can be wired to two different peripherals. We need two additional information from the 'dmas' property: the channel (bit in the dmamux register) that must be accessed and the value of the mux for this channel. Signed-off-by: Miquel Raynal Reviewed-by: Andy Shevchenko Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220427095653.91804-6-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 885525c1e7e27ea6207d648a8db20dfbbd9e4238 Author: Miquel Raynal Date: Wed Apr 27 11:56:48 2022 +0200 clk: renesas: r9a06g032: Export function to set dmamux The dmamux register is located within the system controller. Without syscon, we need an extra helper in order to give write access to this register to a dmamux driver. Signed-off-by: Miquel Raynal Acked-by: Stephen Boyd Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220427095653.91804-5-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 7ac92262e1fb574ee4da2944b83e412aa0ae2ab4 Author: Miquel Raynal Date: Wed Apr 27 11:56:47 2022 +0200 dt-bindings: dmaengine: Introduce RZN1 DMA compatible Just like for the NAND controller that is also on this SoC, let's provide a SoC generic and a more specific couple of compatibles for the DMA controller. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20220427095653.91804-4-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit ad73c629b591c73baac67cb388ea342d076f6b1b Author: Miquel Raynal Date: Wed Apr 27 11:56:46 2022 +0200 dt-bindings: clock: r9a06g032-sysctrl: Reference the DMAMUX subnode This system controller contains several registers that have nothing to do with the clock handling, like the DMA mux register. Describe this part of the system controller as a subnode. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Acked-by: Stephen Boyd Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220427095653.91804-3-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 6cd4154a266584ca3908305ce64e14a5f0f3e81f Author: Miquel Raynal Date: Wed Apr 27 11:56:45 2022 +0200 dt-bindings: dmaengine: Introduce RZN1 dmamux bindings The Renesas RZN1 DMA IP is based on a DW core, with eg. an additional dmamux register located in the system control area which can take up to 32 requests (16 per DMA controller). Each DMA channel can be wired to two different peripherals. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20220427095653.91804-2-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 6646b95aab5f62c049f1416a3801dec5432c348b Author: Samuel Thibault Date: Mon May 16 01:03:58 2022 +0200 speakup: Generate speakupmap.h automatically speakupmap.h was not actually intended to be source code, speakupmap.map is. This resurrects the makemapdata.c and genmap.c tools to generate speakupmap.h automatically from the input and speakup headers, and the speakupmap.map keyboard mapping source file. Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20220515230358.ikwt2kspiwvv5cf4@begin Signed-off-by: Greg Kroah-Hartman commit e6d3c99adf54fc1dcd07729990dc32acd3be874b Author: Abhyuday Godhasara Date: Wed Apr 27 00:48:03 2022 -0700 driver: soc: xilinx: Update function prototype for xlnx_unregister_event As per the current implementation only single callback data gets saved per event, driver is throwing an error if try to register multiple callback for same event. So at time of unregistration of any event required things are event details and callback handler as parameter of xlnx_unregister_event(). As part of adding support of multiple callbacks for same event also require change in prototype of xlnx_unregister_event(). During unregistration of any events, now required things are event details, callback handler and agent's private data as parameter of xlnx_unregister_event(). Also modify the usage of xlnx_unregister_event() in xilinx/zynqmp_power.c driver as per new implementation. Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20220427074803.19009-3-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 05e5ba40ea7ab6a99bb8d6117c899d0e13ca8700 Author: Abhyuday Godhasara Date: Wed Apr 27 00:48:02 2022 -0700 driver: soc: xilinx: Add support of multiple callbacks for same event in event management driver As per the current implementation of only single callback data gets saved per event, driver is throwing an error if try to register multiple callback for same event. Add support of multiple callbacks data for same event. So agent can register for same event with multiple callbacks. Here event management driver will store the callbacks as list in Hash table entry for that event. Here each callback data contain 2 element as callback handler and private data of agent driver. Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20220427074803.19009-2-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit c5c07c5958cf0c9af6e76813e6de15d42ee49822 Author: Srinivas Kandagatla Date: Wed May 18 16:23:53 2022 +0100 misc: fastrpc: fix list iterator in fastrpc_req_mem_unmap_impl This is another instance of incorrect use of list iterator and checking it for NULL. The list iterator value 'map' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty (in this case, the check 'if (!map) {' will always be false and never exit as expected). To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'map' as a dedicated pointer to point to the found element. Without this patch, Kernel crashes with below trace: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000ffff7fb03750 ... Call trace: fastrpc_map_create+0x70/0x290 [fastrpc] fastrpc_req_mem_map+0xf0/0x2dc [fastrpc] fastrpc_device_ioctl+0x138/0xc60 [fastrpc] __arm64_sys_ioctl+0xa8/0xec invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0xd4/0xfc do_el0_svc+0x28/0x90 el0_svc+0x3c/0x130 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x18c/0x190 Code: 14000016 f94000a5 eb05029f 54000260 (b94018a6) ---[ end trace 0000000000000000 ]--- Fixes: 5c1b97c7d7b7 ("misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP") Cc: stable@vger.kernel.org Reported-by: Jan Jablonsky Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220518152353.13058-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8e04a7afce3d796c0c25219e30e16543e3fde2d2 Author: Shuah Khan Date: Tue May 17 14:36:30 2022 -0600 misc: alcor_pci: set NULL intfdata and clear pci master alcor_pci doesn't set driver data to NULL and clear pci master when probe fails. Doesn't clear pci master from remove interface. Clearing pci master is necessary to disable bus mastering and prevent DMAs after driver removal. Fix alcor_pci_probe() to set driver data to NULL and clear pci master from its error path. Fix alcor_pci_remove() to clear pci master. Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220517203630.45232-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 5621a0bcb4b4dffc87d74330a9a31b868572f763 Author: Yang Yingliang Date: Wed May 11 14:46:22 2022 +0800 edd: simplify the check of 'attr->test' in edd_populate_dir() attr->test check is not needed when !attr->test is false. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220511064622.3399164-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit c337125b8834f9719dfda0e40b25eaa266f1b8cf Author: Tony Lindgren Date: Thu May 12 08:30:21 2022 +0300 bus: ti-sysc: Fix warnings for unbind for serial We can get "failed to disable" clock_unprepare warnings on unbind at least for the serial console device if the unbind is done before the device has been idled. As some devices are using deferred idle, we must check the status for pending idle work to idle the device. Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init") Cc: Romain Naour Reviewed-by: Romain Naour Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220512053021.61650-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 660ba678f9998aca6db74f2dd912fa5124f0fa31 Author: Miaoqian Lin Date: Wed May 11 11:14:19 2022 +0400 firmware: dmi-sysfs: Fix memory leak in dmi_sysfs_register_handle kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add() If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Fix this issue by calling kobject_put(). Fixes: 948af1f0bbc8 ("firmware: Basic dmi-sysfs support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511071421.9769-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 077f5d900f62a817b155e614e7eb79220b1405de Author: Yang Yingliang Date: Wed May 11 14:45:06 2022 +0800 drivers: dio: add missing iounmap() in dio_init() If kzalloc() fails, iounmap() need be called in error path. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220511064506.3398512-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 106101303eda8f93c65158e5d72b2cc6088ed034 Author: Zheng Bin Date: Wed May 11 11:29:37 2022 +0800 accessiblity: speakup: Add missing misc_deregister in softsynth_probe softsynth_probe misses a call misc_deregister() in an error path, this patch fixes that. Signed-off-by: Zheng Bin Link: https://lore.kernel.org/r/20220511032937.2736738-1-zhengbin13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 8cc6b422fc4b32a91810e16548353fc3eba39b13 Author: Yang Li Date: Tue May 10 10:52:05 2022 +0100 slimbus: qcom: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. Eliminate the follow coccicheck warning: ./drivers/slimbus/qcom-ctrl.c:514:2-9: line 514 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220510095205.337-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 225baab0aeb6e999754a2d43e9c2b954ec9a75ab Author: Miaoqian Lin Date: Tue May 10 10:52:04 2022 +0100 slimbus: qcom: Fix IRQ check in qcom_slim_probe platform_get_irq() returns non-zero IRQ number on success, negative error number on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver") Cc: stable@vger.kernel.org Signed-off-by: Miaoqian Lin Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220510095205.337-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 80ad54a63af3a3e2eb701fbf30242a922c4fac47 Author: Guo Zhengkui Date: Fri May 13 15:16:06 2022 +0800 drivers: comedi: replace ternary operator with min() Fix the following coccicheck warning: drivers/comedi/drivers.c:857:12-13: WARNING opportunity for min(). min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Reviewed-by: Ian Abbott Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220513071608.49047-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman commit 7394d2ebb651a9f62e08c6ab864aac015d27c64d Author: Cristian Ciocaltea Date: Tue May 17 02:46:46 2022 +0300 scripts/tags.sh: Invoke 'realpath' via 'xargs' When COMPILED_SOURCE is set, running make ARCH=x86_64 COMPILED_SOURCE=1 cscope tags could throw the following errors: scripts/tags.sh: line 98: /usr/bin/realpath: Argument list too long cscope: no source files found scripts/tags.sh: line 98: /usr/bin/realpath: Argument list too long ctags: No files specified. Try "ctags --help". This is most likely to happen when the kernel is configured to build a large number of modules, which has the consequence of passing too many arguments when calling 'realpath' in 'all_compiled_sources()'. Let's improve this by invoking 'realpath' through 'xargs', which takes care of properly limiting the argument list. Signed-off-by: Cristian Ciocaltea Link: https://lore.kernel.org/r/20220516234646.531208-1-cristian.ciocaltea@collabora.com Signed-off-by: Greg Kroah-Hartman commit 53c83d6d8e399fad3d3d25df0ea0d54eb0f94f88 Author: Jason A. Donenfeld Date: Wed May 18 15:23:45 2022 +0200 siphash: add SPDX tags as sole licensing authority The text "dual BSD/GPLv2 license" is somewhat ambiguous, and moving this over to SPDX is overdue. This commit adds SPDX tags to the relevant files and clarifies that it's GPLv2 only and 3-clause BSD. It also removes the old text, so that the SPDX tags are the only source of the information. Suggested-by: Thomas Gleixner Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman commit e6af1bb07704b53bad7771db1b05ee17abad11cb Author: Zhang Jianhua Date: Thu May 19 10:24:50 2022 +0800 fs-verity: Use struct_size() helper in enable_verity() Follow the best practice for allocating a variable-sized structure. Signed-off-by: Zhang Jianhua [ebiggers: adjusted commit message] Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220519022450.2434483-1-chris.zjh@huawei.com commit 7eb6369d7acfe87df73848b3757c648e8f352b86 Merge: 93c0651617a62 9be8459298ead Author: Palmer Dabbelt Date: Thu May 19 09:51:59 2022 -0700 RISC-V: Add support for rv32 userspace via COMPAT The RISC-V port supports the rv32i and rv64i base ISAs, but provides no mechanism to run 32-bit userspace on 64-bit systems. This adds that support, via the COMPAT framework. As the RISC-V ISAs (and uABIs) were developed concurrently, the resulting compat support is mostly generic. This includes a handful of cleanups to the generic compat infrastructure to more cleanly support RISC-V, followed by the RISC-V implementation. * palmer/riscv-compat: riscv: compat: Add COMPAT Kbuild skeletal support riscv: compat: ptrace: Add compat_arch_ptrace implement riscv: compat: signal: Add rt_frame implementation riscv: compat: vdso: Add setup additional pages implementation riscv: compat: vdso: Add COMPAT_VDSO base code implementation riscv: compat: Add hw capability check for elf riscv: compat: Add elf.h implementation riscv: compat: process: Add UXL_32 support in start_thread riscv: compat: syscall: Add entry.S implementation riscv: compat: syscall: Add compat_sys_call_table implementation riscv: compat: Support TASK_SIZE for compat mode riscv: compat: Add basic compat data type implementation riscv: Fixup difference with defconfig syscalls: compat: Fix the missing part for __SYSCALL_COMPAT asm-generic: compat: Cleanup duplicate definitions fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT arch: Add SYSVIPC_COMPAT for all architectures compat: consolidate the compat_flock{,64} definition uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h uapi: simplify __ARCH_FLOCK{,64}_PAD a little commit aed86f8add0e3f63a033861f247c9ae956b72c92 Author: Schspa Shi Date: Wed May 18 09:17:54 2022 +0800 binder: fix atomic sleep when get extended error binder_inner_proc_lock(thread->proc) is a spin lock, copy_to_user can't be called with in this lock. Copy it as a local variable to fix it. Fixes: bd32889e841c ("binder: add BINDER_GET_EXTENDED_ERROR ioctl") Reported-by: syzbot+46fff6434a7f968ecb39@syzkaller.appspotmail.com Reviewed-by: Carlos Llamas Signed-off-by: Schspa Shi Link: https://lore.kernel.org/r/20220518011754.49348-1-schspa@gmail.com Signed-off-by: Greg Kroah-Hartman commit dafa5e9ab8b5b31d64c0ded188d95f8bb6be9746 Author: Carlos Llamas Date: Tue May 17 18:58:17 2022 +0000 binder: fix potential UAF of target_{proc,thread} Commit 9474be34a727 ("binder: add failed transaction logging info") dereferences target_{proc,thread} after they have been potentially freed by binder_proc_dec_tmpref() and binder_thread_dec_tmpref(). This patch delays the release of the two references after their last usage. Fixes the following two errors reported by smatch: drivers/android/binder.c:3562 binder_transaction() error: dereferencing freed memory 'target_proc' drivers/android/binder.c:3563 binder_transaction() error: dereferencing freed memory 'target_thread' Fixes: 9474be34a727 ("binder: add failed transaction logging info") Reported-by: Dan Carpenter Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220517185817.598872-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit da4864962d768b33e3bc31cd233270af6226686d Author: Carlos Llamas Date: Mon May 9 23:19:01 2022 +0000 binder: fix printk format for commands Make sure we use unsigned format specifier %u for binder commands as most of them are encoded above INT_MAX. This prevents negative values when logging them as in the following case: [ 211.895781] binder: 8668:8668 BR_REPLY 258949 0:0, cmd -2143260157 size 0-0 ptr 0000006e766a8000-0000006e766a8000 Acked-by: Todd Kjos Acked-by: Christian Brauner (Microsoft) Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220509231901.3852573-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 25e02ba60f0fbe65ba07553b5b2b8867726273c4 Author: Ilpo Järvinen Date: Tue Apr 26 17:49:33 2022 +0300 tty: Rework receive flow control char logic Add a helper to check if the character is a flow control one. This rework prepares for adding lookahead done check cleanly to n_tty_receive_char_flow_ctrl() between n_tty_is_char_flow_ctrl() and the actions taken on the flow control characters. No functional changes intended. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220426144935.54893-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit ef44c6c1e86fa89f20d27713d7268d7c7689af5c Author: Ilpo Järvinen Date: Thu May 19 11:18:08 2022 +0300 pcmcia: synclink_cs: Don't allow CS5-6 Only CS7 and CS8 seem supported but CSIZE was not sanitized in termios c_cflag. The driver sets 7 bits whenever data_bits is not 8 so default to CS7 when CSIZE is not CS8. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-10-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 1deeda8d2877c18bc2b9eeee10dd6d2628852848 Author: Ilpo Järvinen Date: Thu May 19 11:18:07 2022 +0300 serial: stm32-usart: Correct CSIZE, bits, and parity Add CSIZE sanitization for unsupported CSIZE configurations. In addition, if parity is asked for but CSx was unsupported, the sensible result is CS8+parity which requires setting USART_CR1_M0 like with 9 bits. Incorrect CSIZE results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: c8a9d043947b (serial: stm32: fix word length configuration) Cc: Erwan Le Ray Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-9-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 52bb1cb7118564166b04d52387bd8403632f5190 Author: Ilpo Järvinen Date: Thu May 19 11:18:06 2022 +0300 serial: st-asc: Sanitize CSIZE and correct PARENB for CS7 Only CS7 and CS8 seem supported but CSIZE is not sanitized from CS5 or CS6 to CS8. In addition, ASC_CTL_MODE_7BIT_PAR suggests that CS7 has to have parity, thus add PARENB. Incorrect CSIZE results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: c4b058560762 (serial:st-asc: Add ST ASC driver.) Cc: Srinivas Kandagatla Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-8-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c069d2756c01ed36121fae6a42c14fdf1325c71d Author: Ilpo Järvinen Date: Thu May 19 11:18:05 2022 +0300 serial: sifive: Sanitize CSIZE and c_iflag Only CS8 is supported but CSIZE was not sanitized to CS8. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Similarly, INPCK, PARMRK, and BRKINT are reported textually unsupported but were not cleared in termios c_iflag which is the machine-readable format. Fixes: 45c054d0815b (tty: serial: add driver for the SiFive UART) Cc: Paul Walmsley Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9b87162de8be26bf3156460b37deee6399fd0fcb Author: Ilpo Järvinen Date: Thu May 19 11:18:04 2022 +0300 serial: sh-sci: Don't allow CS5-6 Only CS7 and CS8 seem supported but CSIZE is not sanitized from CS5 or CS6 to CS8. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: 1da177e4c3f4 (Linux-2.6.12-rc2) Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 79ac88655dc0551e3571ad16bdabdbe65d61553e Author: Ilpo Järvinen Date: Thu May 19 11:18:03 2022 +0300 serial: txx9: Don't allow CS5-6 Only CS7 and CS8 are supported but CSIZE is not sanitized with CS5 or CS6 to CS8. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: 1da177e4c3f4 (Linux-2.6.12-rc2) Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 098333a9c7d12bb3ce44c82f08b4d810c44d31b0 Author: Ilpo Järvinen Date: Thu May 19 11:18:02 2022 +0300 serial: rda-uart: Don't allow CS5-6 Only CS7 and CS8 are supported but CSIZE is not sanitized after fallthrough from CS5 or CS6 to CS7. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: c10b13325ced (tty: serial: Add RDA8810PL UART driver) Cc: Manivannan Sadhasivam Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fd63031b8c0763addcecdefe0e0c59d49646204e Author: Ilpo Järvinen Date: Thu May 19 11:18:01 2022 +0300 serial: digicolor-usart: Don't allow CS5-6 Only CS7 and CS8 seem supported but CSIZE is not sanitized to CS8 in the default: block. Set CSIZE correctly so that userspace knows the effective value. Incorrect CSIZE also results in miscalculation of the frame bits in tty_get_char_size() or in its predecessor where the roughly the same code is directly within uart_update_timeout(). Fixes: 5930cb3511df (serial: driver for Conexant Digicolor USART) Acked-by: Baruch Siach Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3f7fed405c118607d4d42255f2572072db728399 Author: Ilpo Järvinen Date: Thu May 19 11:18:00 2022 +0300 serial: uartlite: Fix BRKINT clearing BRKINT is within c_iflag rather than c_cflag. Fixes: ea017f5853e9 (tty: serial: uartlite: Prevent changing fixed parameters) Reviewed-by: Sean Anderson Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220519081808.3776-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0258502f11a4f6036b5f8b34b09027c8a92def3a Author: YueHaibing Date: Wed May 18 21:54:52 2022 +0800 serial: cpm_uart: Fix build error without CONFIG_SERIAL_CPM_CONSOLE drivers/tty/serial/cpm_uart/cpm_uart_core.c: In function ‘cpm_uart_init_port’: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1251:7: error: ‘udbg_port’ undeclared (first use in this function); did you mean ‘uart_port’? if (!udbg_port) ^~~~~~~~~ uart_port commit d142585bceb3 leave this corner, wrap it with #ifdef block Fixes: d142585bceb3 ("serial: cpm_uart: Protect udbg definitions by CONFIG_SERIAL_CPM_CONSOLE") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220518135452.39480-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman commit c9d2325cdb92fd4a6362ea792d93571195741675 Author: Vijaya Krishna Nivarthi Date: Mon May 16 14:50:10 2022 +0530 serial: core: Do stop_rx in suspend path for console if console_suspend is disabled For the case of console_suspend disabled, if back to back suspend/resume test is executed, at the end of test, sometimes console would appear to be frozen not responding to input. This would happen because, during resume, rx transactions can come in before system is ready, malfunction of rx happens in turn resulting in console appearing to be stuck. Do a stop_rx in suspend sequence to prevent this. Signed-off-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/1652692810-31148-1-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Greg Kroah-Hartman commit c2194bc999d41eff69301ee723b0c2979b6eb7bd Author: Vijaya Krishna Nivarthi Date: Mon May 16 16:08:30 2022 +0530 tty: serial: qcom-geni-serial: Remove uart frequency table. Instead, find suitable frequency with call to clk_round_rate. Replace the UART frequency table 'root_freq[]' with logic around clk_round_rate() so that SoC details like the available clk frequencies can change and this driver still works. This reduces tight coupling between this UART driver and the SoC clk driver because we no longer have to update the 'root_freq[]' array for new SoCs. Instead the driver determines the available frequencies at runtime. Signed-off-by: Vijaya Krishna Nivarthi Link: https://lore.kernel.org/r/1652697510-30543-1-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 4ed26f87c71f97d6551caeb2e9e533f8980e764e Author: Phil Edworthy Date: Thu May 12 08:26:49 2022 +0100 dt-bindings: serial: renesas,em-uart: Add RZ/V2M clock to access the registers The RZ/V2M SoC has an additional clock to access the registers. The HW manual says this clock should not be touched as it is used by the "ISP Firmware". Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220512072649.7879-1-phil.edworthy@renesas.com Signed-off-by: Greg Kroah-Hartman commit af0179270977508df6986b51242825d7edd59caf Author: Ilpo Järvinen Date: Fri May 13 16:46:43 2022 +0300 serial: 8250_fintek: Check SER_RS485_RTS_* only with RS485 SER_RS485_RTS_ON_SEND and SER_RS485_RTS_AFTER_SEND relate to behavior within RS485 operation. The driver checks if they have the same value which is not possible to realize with the hardware. The check is taken regardless of SER_RS485_ENABLED flag and -EINVAL is returned when the check fails, which creates problems. This check makes it unnecessarily complicated to turn RS485 mode off as simple zeroed serial_rs485 struct will trigger that equal values check. In addition, the driver itself memsets its rs485 structure to zero when RS485 is disabled but if userspace would try to make an TIOCSRS485 ioctl() call with the very same struct, it would end up failing with -EINVAL which doesn't make much sense. Resolve the problem by moving the check inside SER_RS485_ENABLED block. Fixes: 7ecc77011c6f ("serial: 8250_fintek: Return -EINVAL on invalid configuration") Cc: Ricardo Ribalda Delgado Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/035c738-8ea5-8b17-b1d7-84a7b3aeaa51@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f0136f65285bcfb7e8f90d1013723076a35acd51 Author: AngeloGioacchino Del Regno Date: Tue May 10 14:26:20 2022 +0200 Revert "serial: 8250_mtk: Make sure to select the right FEATURE_SEL" It was found that some MediaTek SoCs are incompatible with this change. Also, this register was mistakenly understood as it was related to the 16550A register layout selection but, at least on some IPs, if not all, it's related to something else unknown. This reverts commit 6f81fdded0d024c7d4084d434764f30bca1cd6b1. Signed-off-by: AngeloGioacchino Del Regno Fixes: 6f81fdded0d0 ("serial: 8250_mtk: Make sure to select the right FEATURE_SEL") Reported-by: "kernelci.org bot" Link: https://lore.kernel.org/r/20220510122620.150342-1-angelogioacchino.delregno@collabora.com Signed-off-by: Greg Kroah-Hartman commit aabdbb1b7a5819e18c403334a31fb0cc2c06ad41 Author: John Ogness Date: Fri May 6 23:39:24 2022 +0206 serial: msm_serial: disable interrupts in __msm_console_write() __msm_console_write() assumes that interrupts are disabled, but with threaded console printers it is possible that the write() callback of the console is called with interrupts enabled. Explicitly disable interrupts using local_irq_save() to preserve the assumed context. Reported-by: Marek Szyprowski Reviewed-by: Petr Mladek Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20220506213324.470461-1-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 589f892ac8ef244e47c5a00ffd8605daa1eaef8e Author: John Ogness Date: Sun May 8 12:41:47 2022 +0206 serial: meson: acquire port->lock in startup() The 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. Since the startup() callback is reading/writing registers used by the console write() callback (AML_UART_CONTROL), its access must be synchronized using the port->lock. Currently it is not. The startup() callback is the only function that explicitly enables interrupts. Without the synchronization, it is possible that interrupts become accidentally permanently disabled. CPU0 CPU1 meson_serial_console_write meson_uart_startup -------------------------- ------------------ spin_lock(port->lock) val = readl(AML_UART_CONTROL) uart_console_write() writel(INT_EN, AML_UART_CONTROL) writel(val, AML_UART_CONTROL) spin_unlock(port->lock) Add port->lock synchronization to meson_uart_startup() to avoid racing with meson_serial_console_write(). Also add detailed comments to meson_uart_reset() explaining why it is *not* using port->lock synchronization. Link: https://lore.kernel.org/lkml/2a82eae7-a256-f70c-fd82-4e510750906e@samsung.com Fixes: ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver") Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Petr Mladek Reviewed-by: Jiri Slaby Acked-by: Neil Armstrong Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20220508103547.626355-1-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 57f83e5dd6a33c4696699954784f8fee789b1d0c Author: Andy Shevchenko Date: Mon May 9 20:21:29 2022 +0300 serial: 8250_dw: Use dev_err_probe() Simplify the error path in ->probe() a bit by using dev_err_probe(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220509172129.37770-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 295b09128d12fb1a7a67f771cc0ae0df869eafaf Author: Andy Shevchenko Date: Mon May 9 20:21:28 2022 +0300 serial: 8250_dw: Use devm_add_action_or_reset() Slightly simplify ->probe() and drop a few goto labels by using devm_add_action_or_reset() for clock and reset cleanup. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220509172129.37770-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4088ca3edca80c19cd190fba75af7e7a3194adcf Author: Andy Shevchenko Date: Mon May 9 19:19:11 2022 +0300 serial: 8250_dw: Update the list of OF headers used by driver The of_irq.h and of_platform.h are not used by the driver. On the other hand, the mod_devicetable.h missed. Drop the former two and add the latter one. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220509161911.37164-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2da6f1e5f72a3ea8a5aed85a8473a710d2e41ffb Author: Ilpo Järvinen Date: Fri May 13 11:29:06 2022 +0300 serial: jsm: Use B0 instead of 0 Use B0 to check zero baudrate rather than literal 0. While at it, remove extra parenthesis around CBAUD. Reviewed-by: Johan Hovold Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220513082906.11096-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 503f418b10040b9b1044734b21ab2a3bea810aad Author: Ilpo Järvinen Date: Fri May 13 11:29:05 2022 +0300 serial: fsl_lpuart: Remove unnecessary clearing for CRTSCTS if (termios->c_cflag & CRTSCTS) guarantees that CRTSCTS is not ever set in the else block so clearing it is unnecessary. While at it, remove also one pair of extra parenthesis. Reviewed-by: Johan Hovold Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220513082906.11096-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9cca25e2762f0436834695225a38bc90ae3ebdfc Author: Ilpo Järvinen Date: Fri May 13 11:29:04 2022 +0300 tty: remove IBSHIFT ifdefs IBSHIFT is defined by all architectures since commit d0ffb805b729 ("arch/alpha, termios: implement BOTHER, IBSHIFT and termios2"). Reviewed-by: Johan Hovold Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220513082906.11096-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 69648d7bda8636088db8bce742c1bb1c99a11cdd Author: Ilpo Järvinen Date: Fri May 13 11:29:03 2022 +0300 tty: remove BOTHER ifdefs BOTHER is defined by all architectures since commit d0ffb805b729 ("arch/alpha, termios: implement BOTHER, IBSHIFT and termios2"). Reviewed-by: Johan Hovold Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220513082906.11096-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9fafe733514b7c3eb51e46d8f494d32cbeb0924b Author: Ilpo Järvinen Date: Fri May 13 11:29:02 2022 +0300 tty: remove CMSPAR ifdefs CMSPAR is defined by all architectures since commit 6bf08cb246b5 ("[PATCH] Add CMSPAR to termbits.h for powerpc and alpha"). Reviewed-by: Johan Hovold Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220513082906.11096-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2059b698a2efcce3c67b0e61eab7d7680bbe10bd Author: Chuck Lever Date: Tue May 10 11:45:53 2022 -0400 SUNRPC: Simplify synopsis of svc_pool_for_cpu() Clean up: There is one caller. The @cpu argument can be made implicit now that a get_cpu/put_cpu pair is no longer needed. Signed-off-by: Chuck Lever commit 586095d339b1b46f4283863e6e8e15de662a3f93 Author: Sebastian Andrzej Siewior Date: Tue May 10 16:38:33 2022 +0200 SUNRPC: Don't disable preemption while calling svc_pool_for_cpu(). svc_xprt_enqueue() disables preemption via get_cpu() and then asks for a pool of a specific CPU (current) via svc_pool_for_cpu(). While preemption is disabled, svc_xprt_enqueue() acquires svc_pool::sp_lock with bottom-halfs disabled, which can sleep on PREEMPT_RT. Disabling preemption is not required here. The pool is protected with a lock so the following list access is safe even cross-CPU. The following iteration through svc_pool::sp_all_threads is under RCU-readlock and remaining operations within the loop are atomic and do not rely on disabled-preemption. Use raw_smp_processor_id() as the argument for the requested CPU in svc_pool_for_cpu(). Reported-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Chuck Lever commit e9488d5ae13c0a72223c507e2508dc2ac66cad4f Author: Dai Ngo Date: Mon May 2 14:19:27 2022 -0700 NFSD: Show state of courtesy client in client info Update client_info_show to show state of courtesy client and seconds since last renew. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 27431affb0dbc259ac6ffe6071243a576c8f38f1 Author: Dai Ngo Date: Mon May 2 14:19:26 2022 -0700 NFSD: add support for lock conflict to courteous server This patch allows expired client with lock state to be in COURTESY state. Lock conflict with COURTESY client is resolved by the fs/lock code using the lm_lock_expirable and lm_expire_lock callback in the struct lock_manager_operations. If conflict client is in COURTESY state, set it to EXPIRABLE and schedule the laundromat to run immediately to expire the client. The callback lm_expire_lock waits for the laundromat to flush its work queue before returning to caller. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 2443da2259e97688f93d64d17ab69b15f466078a Author: Dai Ngo Date: Mon May 2 14:19:25 2022 -0700 fs/lock: add 2 callbacks to lock_manager_operations to resolve conflict Add 2 new callbacks, lm_lock_expirable and lm_expire_lock, to lock_manager_operations to allow the lock manager to take appropriate action to resolve the lock conflict if possible. A new field, lm_mod_owner, is also added to lock_manager_operations. The lm_mod_owner is used by the fs/lock code to make sure the lock manager module such as nfsd, is not freed while lock conflict is being resolved. lm_lock_expirable checks and returns true to indicate that the lock conflict can be resolved else return false. This callback must be called with the flc_lock held so it can not block. lm_expire_lock is called to resolve the lock conflict if the returned value from lm_lock_expirable is true. This callback is called without the flc_lock held since it's allowed to block. Upon returning from this callback, the lock conflict should be resolved and the caller is expected to restart the conflict check from the beginnning of the list. Lock manager, such as NFSv4 courteous server, uses this callback to resolve conflict by destroying lock owner, or the NFSv4 courtesy client (client that has expired but allowed to maintains its states) that owns the lock. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit 591502c5cb325b1c6ec59ab161927d606b918aa0 Author: Dai Ngo Date: Mon May 2 14:19:24 2022 -0700 fs/lock: add helper locks_owner_has_blockers to check for blockers Add helper locks_owner_has_blockers to check if there is any blockers for a given lockowner. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton commit d76cc46b37e123e8d245cc3490978dbda56f979d Author: Dai Ngo Date: Mon May 2 14:19:23 2022 -0700 NFSD: move create/destroy of laundry_wq to init_nfsd and exit_nfsd This patch moves create/destroy of laundry_wq from nfs4_state_start and nfs4_state_shutdown_net to init_nfsd and exit_nfsd to prevent the laundromat from being freed while a thread is processing a conflicting lock. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 3d69427151806656abf129342028f3f4e5e1fee0 Author: Dai Ngo Date: Mon May 2 14:19:22 2022 -0700 NFSD: add support for share reservation conflict to courteous server This patch allows expired client with open state to be in COURTESY state. Share/access conflict with COURTESY client is resolved by setting COURTESY client to EXPIRABLE state, schedule laundromat to run and returning nfserr_jukebox to the request client. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 66af25799940b26efd41ea6e648f75c41a48a2c2 Author: Dai Ngo Date: Mon May 2 14:19:21 2022 -0700 NFSD: add courteous server support for thread with only delegation This patch provides courteous server support for delegation only. Only expired client with delegation but no conflict and no open or lock state is allowed to be in COURTESY state. Delegation conflict with COURTESY/EXPIRABLE client is resolved by setting it to EXPIRABLE, queue work for the laundromat and return delay to the caller. Conflict is resolved when the laudromat runs and expires the EXIRABLE client while the NFS client retries the OPEN request. Local thread request that gets conflict is doing the retry in _break_lease. Client in COURTESY or EXPIRABLE state is allowed to reconnect and continues to have access to its state. Access to the nfs4_client by the reconnecting thread and the laundromat is serialized via the client_lock. Reviewed-by: J. Bruce Fields Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever commit 983084b2672c593959e3148d6a17c8b920797dde Author: Chuck Lever Date: Wed Apr 6 14:38:59 2022 -0400 SUNRPC: Remove svc_rqst::rq_xprt_hlen Clean up: This field is now always set to zero. Signed-off-by: Chuck Lever commit 4af8b42e5629b97bdde287d5d6c250535d324676 Author: Chuck Lever Date: Sun Apr 3 12:25:55 2022 -0400 SUNRPC: Remove dead code in svc_tcp_release_rqst() Clean up: svc_tcp_sendto() always sets rq_xprt_ctxt to NULL. Signed-off-by: Chuck Lever commit 0b6c14bdd908879078ec85d65cfb78472a97e4e7 Author: Chuck Lever Date: Fri Apr 1 13:10:31 2022 -0400 SUNRPC: Make cache_req::thread_wait an unsigned long The second parameter of wait_for_completion_interruptible_timeout() is a jiffies value whose type is "unsigned long". Avoid an unnecessary and potentially fraught implicit type conversion at the wait_for_completion_interruptible_timeout() call site in cache_wait_req(). Signed-off-by: Chuck Lever commit 37324e6bb120bc3cb7cbaa87512ff3a93dbcf5c4 Author: Chuck Lever Date: Thu Mar 31 15:30:10 2022 -0400 SUNRPC: Cache deferral injection Cache deferral injection stress-tests the cache deferral logic as well as upper layer protocol deferred request handlers. This facility is for developers and professional testers to ensure coverage of the rqst deferral code paths. To date, we haven't had an adequate way to ensure these code paths are covered during testing, short of temporary code changes to force their use. A file called /sys/kernel/debug/fail_sunrpc/ignore-cache-wait enables administrators to disable cache deferral injection while allowing other types of sunrpc errors to be injected. The default setting is that cache deferral injection is enabled (ignore=false). To enable support for cache deferral injection, CONFIG_FAULT_INJECTION, CONFIG_FAULT_INJECTION_DEBUG_FS, and CONFIG_SUNRPC_DEBUG must all be set to "Y". Signed-off-by: Chuck Lever commit 45cb7955c180a2a34d291e68938250c4f9bd294f Author: Chuck Lever Date: Thu Apr 14 15:50:12 2022 -0400 SUNRPC: Clean up svc_deferred_class trace events Replace the temporary fix from commit 4d5004451ab2 ("SUNRPC: Fix the svc_deferred_event trace class") with the use of __sockaddr and friends, which is the preferred solution (but only available in 5.18 and newer). Signed-off-by: Chuck Lever commit 91e23b1c39820bfed642119ff6b6ef9f43cf09ce Author: Chuck Lever Date: Thu Apr 7 16:48:24 2022 -0400 NFSD: Clean up nfsd_splice_actor() nfsd_splice_actor() checks that the page being spliced does not match the previous element in the svc_rqst::rq_pages array. We believe this is to prevent a double put_page() in cases where the READ payload is partially contained in the xdr_buf's head buffer. However, the NFSD READ proc functions no longer place any part of the READ payload in the head buffer, in order to properly support NFS/RDMA READ with Write chunks. Therefore, simplify the logic in nfsd_splice_actor() to remove this unnecessary check. Signed-off-by: Chuck Lever commit 44e0b165b6c078b84767da4ba06ffa27af562c96 Author: Ilpo Järvinen Date: Mon May 9 12:34:46 2022 +0300 termbits.h: Remove posix_types.h include Nothing in termbits seems to require anything from linux/posix_types.h. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220509093446.6677-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c9b34088e80efe30459517fa3834cf78532c9a02 Author: Ilpo Järvinen Date: Mon May 9 12:34:45 2022 +0300 termbits.h: Align lines & format - Align c_cc defines. - Remove extra newlines. - Realign & adjust number of leading zeros. - Reorder c_cflag defines to ascending order - Make comment ending shorted (=remove period and one extra space from the comments in mips). Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220509093446.6677-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0b46ac44f2673be2ee51bb52149cab3546ff1696 Author: Ilpo Järvinen Date: Mon May 9 12:34:44 2022 +0300 termbits.h: create termbits-common.h for identical bits Some defines are the same across all archs. Move the most obvious intersection to termbits-common.h. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220509093446.6677-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 135c579d77d066aece83609329150b87fe81e454 Author: Hector Martin Date: Mon May 2 18:25:05 2022 +0900 tty: serial: samsung_tty: Fix suspend/resume on S5L We were restoring the IRQ masks then clearing them again, because ucon_mask wasn't set properly. Adding that makes suspend/resume work as intended. Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20220502092505.30934-1-marcan@marcan.st Signed-off-by: Greg Kroah-Hartman commit 91ca09ca7f310aaefb2d56d57421e02cc44a7eb4 Author: Maciej W. Rozycki Date: Fri May 13 23:42:13 2022 +0100 Documentation: Wire Oxford Semiconductor PCIe (Tornado) 950 Wire Oxford Semiconductor PCIe (Tornado) 950 description as a chapter into the misc-devices document. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2205131727070.10656@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 421bdf5385dc551f2b35d17db3cfc150550d5434 Author: Maciej W. Rozycki Date: Fri May 13 23:42:08 2022 +0100 Documentation: Reformat Oxford Semiconductor PCIe (Tornado) 950 Reformat Oxford Semiconductor PCIe (Tornado) 950 description in terms of reStructuredText markup, fixing warnings with `make htmldocs'. While at it remove typos: s/the the/the/ and s/the/then/ in lines changed anyway. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2205131721110.10656@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 7b0364eacb8f5177b6747a1c524b4bfd04011a2a Author: Maciej W. Rozycki Date: Fri May 13 23:42:03 2022 +0100 Documentation: Move Oxford Semiconductor PCIe (Tornado) 950 to misc-devices Documentation/tty has been moved to driver-api, which is not suitable for user documentation, so move the Oxford Semiconductor PCIe (Tornado) 950 description to misc-devices instead. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2205131823430.10656@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit b693a8a6160f8c2237b593020ed2f70c011ebd38 Author: Jiri Slaby Date: Thu May 19 09:56:53 2022 +0200 serial: pmac_zilog: remove initial print Don't report about the driver when loaded. It's unneeded and frowned upon nowadays. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220519075653.31356-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit c83a34a5304a295795e049c1729a1ee86f33d648 Author: Jiri Slaby Date: Thu May 19 09:56:52 2022 +0200 serial: pmac_zilog: remove tracing prints Remove debug printouts upon function enter/exit. This can be achieved better by tracing. Remove also the one protected by DEBUG_HARD which is not defined anyway. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220519075653.31356-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit ae1de09341d9becf0e68d3dcd0710f2cac4a5d01 Author: Jiri Slaby Date: Thu May 19 09:56:51 2022 +0200 serial: pmac_zilog: remove unused uart_pmac_port::termios_cache struct uart_pmac_port contains termios_cache. It is only written and never read. Remove it as it only occupies space. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220519075653.31356-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit a5ddc498e792df250346caf3081f6f12fcb7086c Author: Jiri Slaby Date: Thu May 19 09:56:50 2022 +0200 serial: pmac_zilog: remove unfinished DBDMA support The support for DBDMA was never completed. Remove the the code that only maps spaces without real work. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220519075653.31356-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9bb13b2f77819d868902753fc73f6a03200fad80 Author: Jiri Slaby Date: Thu May 19 09:57:20 2022 +0200 serial: amba-pl011: move header content to .c There is no point keeping the header content separated. In this case, it is only an enum. So move the enum to the appropriate source file. Cc: Russell King Reviewed-by: Ilpo Järvinen Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220519075720.31402-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 925ea0fa5277c1e6bb9e51955ef34eea9736c3d7 Author: Tony Lindgren Date: Thu May 12 16:15:06 2022 +0300 tty: n_gsm: Fix packet data hex dump output The module param debug for n_gsm uses KERN_INFO level, but the hexdump now uses KERN_DEBUG level. This started after commit 091cb0994edd ("lib/hexdump: make print_hex_dump_bytes() a nop on !DEBUG builds"). We now use dynamic_hex_dump() unless DEBUG is set. This causes no packets to be seen with modprobe n_gsm debug=0x1f unlike earlier. Let's fix this by adding gsm_hex_dump_bytes() that calls print_hex_dump() with KERN_INFO to match what n_gsm is doing with the other debug related output. Fixes: 091cb0994edd ("lib/hexdump: make print_hex_dump_bytes() a nop on !DEBUG builds") Cc: Stephen Boyd Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220512131506.1216-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 859bdc359567f5fa8e8dc780d7b5e53ea43d9ce9 Author: Mayank Rana Date: Wed May 18 11:12:52 2022 -0700 usb: dwc3: core: Add error log when core soft reset failed DWC3 controller soft reset is important operation for USB functionality. In case when it fails, currently there is no failure log. Hence add error log when core soft reset failed. Signed-off-by: Mayank Rana Link: https://lore.kernel.org/r/1652897572-14461-1-git-send-email-quic_mrana@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 3c5880745b4439ac64eccdb040e37fc1cc4c5406 Author: Albert Wang Date: Wed May 18 14:13:15 2022 +0800 usb: dwc3: gadget: Move null pinter check to proper place When dwc3_gadget_ep_cleanup_completed_requests() called to dwc3_gadget_giveback() where the dwc3 lock is released, other thread is able to execute. In this situation, usb_ep_disable() gets the chance to clear endpoint descriptor pointer which leds to the null pointer dereference problem. So needs to move the null pointer check to a proper place. Example call stack: Thread#1: dwc3_thread_interrupt() spin_lock -> dwc3_process_event_buf() -> dwc3_process_event_entry() -> dwc3_endpoint_interrupt() -> dwc3_gadget_endpoint_trbs_complete() -> dwc3_gadget_ep_cleanup_completed_requests() ... -> dwc3_giveback() spin_unlock Thread#2 executes Thread#2: configfs_composite_disconnect() -> __composite_disconnect() -> ffs_func_disable() -> ffs_func_set_alt() -> ffs_func_eps_disable() -> usb_ep_disable() wait for dwc3 spin_lock Thread#1 released lock clear endpoint.desc Fixes: 26288448120b ("usb: dwc3: gadget: Fix null pointer exception") Cc: stable Signed-off-by: Albert Wang Link: https://lore.kernel.org/r/20220518061315.3359198-1-albertccwang@google.com Signed-off-by: Greg Kroah-Hartman commit 6c5ba7395b1badce5e0b8e597907751e952646cb Author: Bhuvanesh Surachari Date: Thu May 12 17:37:14 2022 +0200 usb: hub: Simplify error and success path in port_over_current_notify kasprintf() returns NULL or valid pointer. Since kfree() can handle NULL pointer condition, simplify error and success paths in function port_over_current_notify() by removing multiple error path labels. Signed-off-by: Bhuvanesh Surachari Signed-off-by: Eugeniu Rosca Link: https://lore.kernel.org/r/1652369834-4480-1-git-send-email-erosca@de.adit-jv.com Signed-off-by: Greg Kroah-Hartman commit dce49449e04ff150838a31386ee65917beb9ebb5 Author: Frank Li Date: Mon May 9 11:40:55 2022 -0500 usb: cdns3: allocate TX FIFO size according to composite EP number Some devices have USB compositions which may require multiple endpoints. To get better performance, need bigger CDNS3_EP_BUF_SIZE. But bigger CDNS3_EP_BUF_SIZE may exceed total hardware FIFO size when multiple endpoints. By introducing the check_config() callback, calculate CDNS3_EP_BUF_SIZE. Move CDNS3_EP_BUF_SIZE into cnds3_device: ep_buf_size Combine CDNS3_EP_ISO_SS_BURST and CDNS3_EP_ISO_HS_MULT into cnds3_device:ep_iso_burst Using a simple algorithm to calculate ep_buf_size. ep_buf_size = ep_iso_burst = (onchip_buffers - 2k) / (number of IN EP + 1). Test at 8qxp: Gadget ep_buf_size RNDIS: 5 RNDIS+ACM: 3 Mass Storage + NCM + ACM 2 Previous CDNS3_EP_BUF_SIZE is 4, RNDIS + ACM will be failure because exceed FIFO memory. Acked-by: Peter Chen Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20220509164055.1815081-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 9d778f0c5f95ca5aa2ff628ea281978697e8d89b Author: Mayank Rana Date: Wed May 4 12:36:41 2022 -0700 usb: dwc3: Fix ep0 handling when getting reset while doing control transfer According to the databook ep0 should be in setup phase during reset. If host issues reset between control transfers, ep0 will be in an invalid state. Fix this by issuing stall and restart on ep0 if it is not in setup phase. Also SW needs to complete pending control transfer and setup core for next setup stage as per data book. Hence check ep0 state during reset interrupt handling and make sure active transfers on ep0 out/in endpoint are stopped by queuing ENDXFER command for that endpoint and restart ep0 out again to receive next setup packet. Signed-off-by: Mayank Rana Link: https://lore.kernel.org/r/1651693001-29891-1-git-send-email-quic_mrana@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 69a1c9a9b273271f2a2674bcc117336a9bb0a4b4 Author: Dmitry Torokhov Date: Wed May 18 15:02:51 2022 -0700 usb: Probe EHCI, OHCI controllers asynchronously initcall_debug shows that OHCI controllers take ~60ms to probe on Rockchip RK3399 systems: probe of fe3a0000.usb returned 1 after 58941 usecs A few of these can add up to waste non-trivial amounts of time at boot. These host controllers don't provide resources to other drivers, so this shouldn't contribute to exposing race conditions. Chrome OS kernels have carried this patch on some systems for a while without issues. Similar patches have been merged for a variety of (e)MMC host controllers for similar reasons. [Brian: rewrote commit message, refreshed, but retained dtor's original authorship ] Acked-by: Alan Stern Signed-off-by: Dmitry Torokhov Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220518150150.1.Ie8ea0e945a9c15066237014be219eed60066d493@changeid Signed-off-by: Greg Kroah-Hartman commit 26ae2c942b5702f2e43d36b2a4389cfb7d616b6a Author: Linus Walleij Date: Mon May 16 11:14:24 2022 +0200 usb: isp1760: Fix out-of-bounds array access Running the driver through kasan gives an interesting splat: BUG: KASAN: global-out-of-bounds in isp1760_register+0x180/0x70c Read of size 20 at addr f1db2e64 by task swapper/0/1 (...) isp1760_register from isp1760_plat_probe+0x1d8/0x220 (...) This happens because the loop reading the regmap fields for the different ISP1760 variants look like this: for (i = 0; i < HC_FIELD_MAX; i++) { ... } Meaning it expects the arrays to be at least HC_FIELD_MAX - 1 long. However the arrays isp1760_hc_reg_fields[], isp1763_hc_reg_fields[], isp1763_hc_volatile_ranges[] and isp1763_dc_volatile_ranges[] are dynamically sized during compilation. Fix this by putting an empty assignment to the [HC_FIELD_MAX] and [DC_FIELD_MAX] array member at the end of each array. This will make the array one member longer than it needs to be, but avoids the risk of overwriting whatever is inside [HC_FIELD_MAX - 1] and is simple and intuitive to read. Also add comments explaining what is going on. Fixes: 1da9e1c06873 ("usb: isp1760: move to regmap for register access") Cc: stable@vger.kernel.org Cc: Rui Miguel Silva Cc: Dietmar Eggemann Reviewed-by: Rui Miguel Silva Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220516091424.391209-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1bd8bb7d2dfc44509acf729e636523c3c2b729df Author: Mathias Nyman Date: Mon May 16 12:48:50 2022 +0300 xhci: Don't defer primary roothub registration if there is only one roothub The support for xHCI controllers with only one roothub, and the code to defer primary roothub registation until second roothub got merged to usb-next for 5.19 at the same time. commit 873f323618c2 ("xhci: prepare for operation w/o shared hcd") commit b7a4f9b5d0e4 ("xhci: Set HCD flag to defer primary roothub registration") These got merged in such a way that the flag to defer primary roothub registration is set even for xHC controllers with just one roothub. Fix this by setting the defer flag in a codepath taken only if we have two roothubs Fixes: 873f323618c2 ("xhci: prepare for operation w/o shared hcd") Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220516094850.19788-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 834650b50ed283d9d34a32b425d668256bf2e487 Merge: 70a1b25326dd7 d16495a982324 Author: Alexei Starovoitov Date: Thu May 19 09:03:31 2022 -0700 Merge branch 'Start libbpf 1.0 dev cycle' Andrii Nakryiko says: ==================== Start preparations for libbpf 1.0 release and as a first test remove bpf_create_map*() APIs. ==================== Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit d16495a982324f75e8e65de01475f9533de1db7a Author: Andrii Nakryiko Date: Wed May 18 11:59:15 2022 -0700 libbpf: remove bpf_create_map*() APIs To test API removal, get rid of bpf_create_map*() APIs. Perf defines __weak implementation of bpf_map_create() that redirects to old bpf_create_map() and that seems to compile and run fine. Cc: Jiri Olsa Cc: Arnaldo Carvalho de Melo Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220518185915.3529475-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit e2371b1632b1c61c1fa726a17b82e6833a9e4d85 Author: Andrii Nakryiko Date: Wed May 18 11:59:14 2022 -0700 libbpf: start 1.0 development cycle Start libbpf 1.0 development cycle by adding LIBBPF_1.0.0 section to libbpf.map file and marking all current symbols as local. As we remove all the deprecated APIs we'll populate global list before the final 1.0 release. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220518185915.3529475-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 056431ae4d790efd0372c1daf93569fdd2814190 Author: Andrii Nakryiko Date: Wed May 18 11:59:13 2022 -0700 libbpf: fix up global symbol counting logic Add the same negative ABS filter that we use in VERSIONED_SYM_COUNT to filter out ABS symbols like LIBBPF_0.8.0. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220518185915.3529475-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 376d6b02cb08021c0d3679bb53a6d6bf0dac181c Merge: 74f55a62c4c35 c7c99a09ef0e2 Author: Greg Kroah-Hartman Date: Thu May 19 18:00:01 2022 +0200 Merge tag 'thunderbolt-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.19 merge window This includes following Thunderbolt/USB4 changes for the v5.19 merge window: * Improvements for Thunderbolt 1 DisplayPort tunneling * Link USB4 ports to their USB Type-C connectors * Lane bonding support for host-to-host (XDomain) connections * Buffer allocation improvement for devices with no DisplayPort adapters * Few cleanups and minor fixes. All these have been in linux-next with no reported issues except that there is a minor merge conflict with the kunit-next tree because one of the commits touches the driver KUnit tests. * tag 'thunderbolt-for-v5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Add KUnit test for devices with no DisplayPort adapters thunderbolt: Fix buffer allocation of devices with no DisplayPort adapters thunderbolt: Add support for XDomain lane bonding thunderbolt: Ignore port locked error in tb_port_wait_for_link_width() thunderbolt: Split setting link width and lane bonding into own functions thunderbolt: Move tb_port_state() prototype to correct place thunderbolt: Add debug logging when lane is enabled/disabled thunderbolt: Link USB4 ports to their USB Type-C connectors misc/mei: Add NULL check to component match callback functions thunderbolt: Use different lane for second DisplayPort tunnel thunderbolt: Dump path config space entries during discovery thunderbolt: Use decimal number with port numbers thunderbolt: Fix typo in comment thunderbolt: Replace usage of found with dedicated list iterator variable commit d80c69846ddfddf437167b31ab4cd0de12f61001 Author: Paulo Alcantara Date: Thu May 19 12:18:37 2022 -0300 cifs: fix signed integer overflow when fl_end is OFFSET_MAX This fixes the following when running xfstests generic/504: [ 134.394698] CIFS: Attempting to mount \\win16.vm.test\Share [ 134.420905] CIFS: VFS: generate_smb3signingkey: dumping generated AES session keys [ 134.420911] CIFS: VFS: Session Id 05 00 00 00 00 c4 00 00 [ 134.420914] CIFS: VFS: Cipher type 1 [ 134.420917] CIFS: VFS: Session Key ea 0b d9 22 2e af 01 69 30 1b 15 74 bf 87 41 11 [ 134.420920] CIFS: VFS: Signing Key 59 28 43 5c f0 b6 b1 6f f5 7b 65 f2 9f 9e 58 7d [ 134.420923] CIFS: VFS: ServerIn Key eb aa 58 c8 95 01 9a f7 91 98 e4 fa bc d8 74 f1 [ 134.420926] CIFS: VFS: ServerOut Key 08 5b 21 e5 2e 4e 86 f6 05 c2 58 e0 af 53 83 e7 [ 134.771946] ================================================================================ [ 134.771953] UBSAN: signed-integer-overflow in fs/cifs/file.c:1706:19 [ 134.771957] 9223372036854775807 + 1 cannot be represented in type 'long long int' [ 134.771960] CPU: 4 PID: 2773 Comm: flock Not tainted 5.11.22 #1 [ 134.771964] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 [ 134.771966] Call Trace: [ 134.771970] dump_stack+0x8d/0xb5 [ 134.771981] ubsan_epilogue+0x5/0x50 [ 134.771988] handle_overflow+0xa3/0xb0 [ 134.771997] ? lockdep_hardirqs_on_prepare+0xe8/0x1b0 [ 134.772006] cifs_setlk+0x63c/0x680 [cifs] [ 134.772085] ? _get_xid+0x5f/0xa0 [cifs] [ 134.772085] cifs_flock+0x131/0x400 [cifs] [ 134.772085] __x64_sys_flock+0xfc/0x120 [ 134.772085] do_syscall_64+0x33/0x40 [ 134.772085] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 134.772085] RIP: 0033:0x7fea4f83b3fb [ 134.772085] Code: ff 48 8b 15 8f 1a 0d 00 f7 d8 64 89 02 b8 ff ff ff ff eb da e8 16 0b 02 00 66 0f 1f 44 00 00 f3 0f 1e fa b8 49 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 5d 1a 0d 00 f7 d8 64 89 01 48 Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit fcfbc93cc33ec601f00f113eca6fc484b930532d Author: Dan Williams Date: Wed May 18 16:35:17 2022 -0700 cxl/port: Reuse 'struct cxl_hdm' context for hdm init The port driver maps component registers for port operations. Reuse that mapping for HDM Decoder Capability setup / enable. Move devm_cxl_setup_hdm() before cxl_hdm_decode_init() and plumb @cxlhdm through the hdm init helpers. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291691712.1426646.14336397551571515480.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 5e5f4ad52f33c125af9b91d4c3b7cad59c13772e Author: Dan Williams Date: Wed May 18 16:35:11 2022 -0700 cxl/port: Move endpoint HDM Decoder Capability init to port driver The responsibility for establishing HDM Decoder Capability based operation is more closely tied to port enabling than memdev enabling which is concerned with port enumeration. This later enables reusing @cxlhdm for probing / controlling "global enable" for the HDM Decoder Capability. For now, just do the nominal move. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291691167.1426646.7936109077255288258.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 92804edb11f065aadb3a4f398bed8a846a035cd3 Author: Dan Williams Date: Wed May 18 16:35:06 2022 -0700 cxl/pci: Drop @info argument to cxl_hdm_decode_init() Now that nothing external to cxl_hdm_decode_init() considers 'struct cxl_endpoint_dvec_info' move it internal to cxl_hdm_decode_init(). Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291690612.1426646.7866084245521113414.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit a12562bb70776093b270f79a4b6ef18f4bcead2b Author: Dan Williams Date: Wed May 18 16:35:00 2022 -0700 cxl/mem: Merge cxl_dvsec_ranges() and cxl_hdm_decode_init() In preparation for changing how the driver handles 'mem_enable' in the CXL DVSEC control register. Merge the contents of cxl_hdm_decode_init() into cxl_dvsec_ranges() and rename the combined function cxl_hdm_decode_init(). The possible cleanups and fixes that result from this merge are saved for a follow-on change. Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165291690027.1426646.10249756632415633752.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit dd2d42ad6f422076d1bd49b132bec74376c26f5c Author: Dan Williams Date: Wed May 18 16:34:54 2022 -0700 cxl/mem: Skip range enumeration if mem_enable clear When a device does not have mem_enable set then the current range settings are moot. Skip the enumeration and cause cxl_hdm_decode_init() to proceed directly to enable the HDM Decoder Capability. Fixes: 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info") Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291689442.1426646.18012291761753694336.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 14d78874077442d1d0f08129f5a0ea5070984b4b Author: Dan Williams Date: Wed May 18 16:34:48 2022 -0700 cxl/mem: Consolidate CXL DVSEC Range enumeration in the core In preparation for fixing the setting of the 'mem_enabled' bit in CXL DVSEC Control register, move all CXL DVSEC range enumeration into the same source file. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291688886.1426646.15046138604010482084.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 2e4ba0ec978335b4b550bbed95cb198ac3a00745 Author: Dan Williams Date: Wed May 18 16:34:43 2022 -0700 cxl/pci: Move cxl_await_media_ready() to the core Allow cxl_await_media_ready() to be mocked for testing purposes rather than carrying the maintenance burden of an indirect function call in the mainline driver. With the move cxl_await_media_ready() can no longer reuse the mailbox timeout override, so add a media_ready_timeout module parameter to the core to backfill. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291688340.1426646.4755627801983775011.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 75b7ae29991f945b69c10d75b861d7d5e90bd541 Author: Dan Williams Date: Wed May 18 16:34:37 2022 -0700 cxl/mem: Validate port connectivity before dvsec ranges In preparation for validating DVSEC ranges against the platform declared CXL memory ranges (ACPI CFMWS) move port enumeration before the endpoint's decoder validation. Ultimately this logic will move to the port driver, but create a bisect point before that larger move. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291687749.1426646.18091538443879226995.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 76a4121e86649bf381aa32cb69ede913def57202 Author: Dan Williams Date: Wed May 18 16:34:31 2022 -0700 cxl/mem: Fix cxl_mem_probe() error exit The addition of cxl_mem_active() broke error exit scenarios for cxl_mem_probe(). Return early rather than proceed with disabling suspend, and update the label name since it is no longer a terminal "out" label that exits the function. Fixes: 9ea4dcf49878 ("PM: CXL: Disable suspend") Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291687176.1426646.15449254938752532784.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 194d5edadf0b403f6de2be89c484a01c83ee269f Author: Dan Williams Date: Wed May 18 16:34:26 2022 -0700 cxl/pci: Drop wait_for_valid() from cxl_await_media_ready() A check mem_info_valid already happens in __cxl_dvsec_ranges(). Rely on that instead of calling wait_for_valid again. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291686632.1426646.7479581732894574486.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 1e14c9fbb55fbc48eb88b55d1736c994b1deb631 Author: Dan Williams Date: Wed May 18 16:34:20 2022 -0700 cxl/pci: Consolidate wait_for_media() and wait_for_media_ready() Now that wait_for_media() does nothing supplemental to wait_for_media_ready() just promote wait_for_media_ready() to a common helper and drop wait_for_media(). Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291686046.1426646.4390664747934592185.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 2bcf3bbd348fc10260aa6243ff6a22a1882b5b35 Author: Dan Williams Date: Wed May 18 16:34:15 2022 -0700 cxl/mem: Drop mem_enabled check from wait_for_media() Media ready is asserted by the device independent of whether mem_enabled was ever set. Drop this check to allow for dropping wait_for_media() in favor of ->wait_media_ready(). Fixes: 8dd2bc0f8e02 ("cxl/mem: Add the cxl_mem driver") Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/165291685501.1426646.10372821863672431074.stgit@dwillia2-xfh Signed-off-by: Dan Williams commit 80b949f332e331b67c3ae4f323daf2cb91e743e5 Author: ChiYuan Huang Date: Thu May 19 10:13:38 2022 +0800 ASoC: rt9120: Use pm_runtime and regcache to optimize 'pwdnn' logic From the datasheet, the only way to meet the lowest power consumption is to pull low the 'pwdnn' gpio. But if it is low, IC will keep in reset state, all registers reset to default. And the power consumption is listed below 1. amp off and 'pwdnn' high => idle state, PVDD = 1mA, DVDD = 7mA 2. amp off and 'pwdnn' low => shutdown state, PVDD < 20uA, DVDD < 15uA It's the large difference for the consumption current This fix is to use pm_runtime and regcache to handle 'pwdnn' gpio control. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1652926418-8519-3-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 57f68f2168988e574133fb5abcd73949bf1d1df2 Author: ChiYuan Huang Date: Thu May 19 10:13:37 2022 +0800 ASoC: rt9120: Fix 3byte read, valule offset typo For RG 3byte read, the value order is offset [0], [1], and [2]. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1652926418-8519-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 17572892e3beefe68d0875ecfd015eef521c244d Author: V sujith kumar Reddy Date: Mon May 16 21:36:10 2022 +0530 ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver. RT1019 codec has two ways of controlling the en_spkr. one way is controlling through gpio pin method the another way is through codec register update through driver. Now Speaker enable/disable is controlled through codec register updated by codec driver. This patch reverts gpio logic. This reverts commit 5c5f08f7fc0bee9a1bc3fbdcb7a21cfd0648ab14 ("ASoC: amd: acp: Power on/off the speaker enable gpio pin based on DAPM callback.") Signed-off-by: V sujith kumar Reddy Link: https://lore.kernel.org/r/20220516160619.17832-2-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit 4d0cc9e0e53e9946d7b8dc58279c62dfa7a2191b Author: Dan Carpenter Date: Thu May 19 08:17:20 2022 +0300 staging: r8188eu: delete rtw_wx_read/write32() These debugging tools let you call: status = usb_control_msg_recv/send(udev, 0, REALTEK_USB_VENQT_CMD_REQ, REALTEK_USB_VENQT_READ/WRITE, value, REALTEK_USB_VENQT_CMD_IDX, io_buf, size, RTW_USB_CONTROL_MSG_TIMEOUT, GFP_KERNEL); with a user controlled "value" in the 0-0xffff range. It's not a valid API. Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YoXS4OaD1oauPvmj@kili Signed-off-by: Greg Kroah-Hartman commit 464725a95d8a1cc4bb8d28e2d55f2af3ff3368d5 Author: Soumya Negi Date: Thu May 19 02:50:11 2022 -0700 staging: r8188eu: Remove multiple assignments Conform to Linux coding style. Issue found by checkpatch:- CHECK: multiple assignments should be avoided Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/20220519095012.5619-1-soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit f94b47c6bde624d6c07f43054087607c52054a95 Author: Jiasheng Jiang Date: Wed May 18 15:59:57 2022 +0800 staging: r8188eu: add check for kzalloc As kzalloc() may return null pointer, it should be better to check the return value and return error if fails in order to avoid dereference of null pointer. Moreover, the return value of rtw_alloc_hwxmits() should also be dealt with. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reviewed-by: Dan Carpenter Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220518075957.514603-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit 6107fb660749507d5e02988151e45884b5423cdc Author: V sujith kumar Reddy Date: Mon May 16 21:36:09 2022 +0530 ASoC: amd: acp: Set Speaker enable/disable pin through rt1019 codec driver RT1019 codec has two ways of controlling the en_spkr. one way is controlling through gpio pin method the another way is through codec register update through driver. Now Speaker enable/disable is controlled through codec register updated by codec driver. This patch reverts gpio logic. This reverts commit 7fa5c33d043160eba3be9fb8e21588dff2a467c7 ("ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver"). Signed-off-by: V sujith kumar Reddy Link: https://lore.kernel.org/r/20220516160619.17832-1-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown commit 455d5f02dc23f4e7a298b1f4acb5dc5457e08801 Author: Vihas Makwana Date: Tue May 17 19:36:26 2022 +0530 staging: r8188eu: fix warnings in rtw_wlan_util Refactor the code to fix following warnings: WARNING: Comparisons should place the constant on the right side of the test CHECK: Comparison to NULL could be written "p" Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220517140626.3716-4-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 43ea9201795fb47dd48beaf64b3184bdfd481260 Author: Vihas Makwana Date: Tue May 17 19:36:25 2022 +0530 staging: r8188eu: fix warnings in rtw_pwrctrl Refactor the code to fix following warnings: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220517140626.3716-3-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 801626f71d6f822e0becbfaa8b26a41addea693a Author: Vihas Makwana Date: Tue May 17 19:36:24 2022 +0530 staging: r8188eu: fix warnings in rtw_p2p Refactor the code to fix following warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220517140626.3716-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit be2af740e2a9c7134f2d8ab4f104006e110b13de Author: Yang Yingliang Date: Sat May 14 17:10:53 2022 +0800 ASoC: wm2000: fix missing clk_disable_unprepare() on error in wm2000_anc_transition() Fix the missing clk_disable_unprepare() before return from wm2000_anc_transition() in the error handling case. Fixes: 514cfd6dd725 ("ASoC: wm2000: Integrate with clock API") Signed-off-by: Yang Yingliang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220514091053.686416-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 81e7b165c45e94188ae8f1134b57f27d1f35452f Author: YueHaibing Date: Mon May 16 20:09:09 2022 +0800 ASoC: codecs: lpass: Fix passing zero to 'PTR_ERR' sound/soc/codecs/lpass-macro-common.c:28 lpass_macro_pds_init() warn: passing zero to 'PTR_ERR' sound/soc/codecs/lpass-macro-common.c:38 lpass_macro_pds_init() warn: passing zero to 'PTR_ERR' sound/soc/codecs/lpass-macro-common.c:54 lpass_macro_pds_init() warn: passing zero to 'ERR_PTR' dev_pm_domain_attach_by_name() may return NULL, set 'ret' as -ENODATA to fix this warning. Fixes: 1a8ee4cf8418 ("ASoC: codecs: Fix error handling in power domain init and exit handlers") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220516120909.36356-1-yuehaibing@huawei.com Signed-off-by: Mark Brown commit b1378b259c0c0300cf62dd7117bf550edce0f9cc Author: Pierre-Louis Bossart Date: Tue May 17 12:37:15 2022 -0500 ASoC: SOF: sof-client-ipc-flood-test: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220517173715.468894-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0f653c95c4f4b6b623ce8bd995002daf8032bfc3 Author: Wan Jiabing Date: Wed May 18 20:58:57 2022 +0800 ASoC: SOF: mediatek: remove duplicate include in mt8195.c Fix following checkincludes.pl warning: sound/soc/sof/mediatek/mt8195/mt8195.c: linux/of_platform.h is included more than once. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220518125902.13407-1-wanjiabing@vivo.com Signed-off-by: Mark Brown commit 3a054f90e95500387cc871f5a04ad91def1664ed Author: YC Hung Date: Tue May 17 12:31:09 2022 -0500 ASoC: SOF: mediatek: Add mt8195 debug dump Add mt8195_adsp_dump in mt8195.c for debug_dump callback to dump mt8195 debug registers and call mtk_adsp_dump. Reviewed-by: Ranjani Sridharan Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220517173109.468568-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0458e5428e5e959d201a40ffe71d762a79ecedc4 Author: Wang Cheng Date: Mon May 16 17:22:41 2022 +0800 staging: rtl8712: fix uninit-value in r871xu_drv_init() When 'tmpU1b' returns from r8712_read8(padapter, EE_9346CR) is 0, 'mac[6]' will not be initialized. BUG: KMSAN: uninit-value in r871xu_drv_init+0x2d54/0x3070 drivers/staging/rtl8712/usb_intf.c:541 r871xu_drv_init+0x2d54/0x3070 drivers/staging/rtl8712/usb_intf.c:541 usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396 really_probe+0x653/0x14b0 drivers/base/dd.c:596 __driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752 driver_probe_device drivers/base/dd.c:782 [inline] __device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899 bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427 __device_attach+0x593/0x8e0 drivers/base/dd.c:970 device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017 bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487 device_add+0x1fff/0x26e0 drivers/base/core.c:3405 usb_set_configuration+0x37e9/0x3ed0 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0x13c/0x300 drivers/usb/core/generic.c:238 usb_probe_device+0x309/0x570 drivers/usb/core/driver.c:293 really_probe+0x653/0x14b0 drivers/base/dd.c:596 __driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752 driver_probe_device drivers/base/dd.c:782 [inline] __device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899 bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427 __device_attach+0x593/0x8e0 drivers/base/dd.c:970 device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017 bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487 device_add+0x1fff/0x26e0 drivers/base/core.c:3405 usb_new_device+0x1b8e/0x2950 drivers/usb/core/hub.c:2566 hub_port_connect drivers/usb/core/hub.c:5358 [inline] hub_port_connect_change drivers/usb/core/hub.c:5502 [inline] port_event drivers/usb/core/hub.c:5660 [inline] hub_event+0x58e3/0x89e0 drivers/usb/core/hub.c:5742 process_one_work+0xdb6/0x1820 kernel/workqueue.c:2307 worker_thread+0x10b3/0x21e0 kernel/workqueue.c:2454 kthread+0x3c7/0x500 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 Local variable mac created at: r871xu_drv_init+0x1771/0x3070 drivers/staging/rtl8712/usb_intf.c:394 usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396 KMSAN: uninit-value in r871xu_drv_init https://syzkaller.appspot.com/bug?id=3cd92b1d85428b128503bfa7a250294c9ae00bd8 Reported-by: Tested-by: Reviewed-by: Dan Carpenter Signed-off-by: Wang Cheng Link: https://lore.kernel.org/r/14c3886173dfa4597f0704547c414cfdbcd11d16.1652618244.git.wanngchenng@gmail.com Signed-off-by: Greg Kroah-Hartman commit 698c1e99a0a3b883a629159ae47fa41778209258 Author: YC Hung Date: Tue May 17 12:31:08 2022 -0500 ASoC: SOF: mediatek: Add mediatek common debug dump 1.Add mtk-adsp-common.c file for mediatek platforms common usage. 2.Add mtk_adsp_dump implementation in mtk-adsp-common.c for general debug dump. Reviewed-by: Ranjani Sridharan Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220517173109.468568-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d1b57669732d09da7e13ef86d058dab0cd57f6e0 Author: Wang Cheng Date: Mon May 16 17:22:23 2022 +0800 staging: rtl8712: fix uninit-value in usb_read8() and friends When r8712_usbctrl_vendorreq() returns negative, 'data' in usb_read{8,16,32} will not be initialized. BUG: KMSAN: uninit-value in string_nocheck lib/vsprintf.c:643 [inline] BUG: KMSAN: uninit-value in string+0x4ec/0x6f0 lib/vsprintf.c:725 string_nocheck lib/vsprintf.c:643 [inline] string+0x4ec/0x6f0 lib/vsprintf.c:725 vsnprintf+0x2222/0x3650 lib/vsprintf.c:2806 va_format lib/vsprintf.c:1704 [inline] pointer+0x18e6/0x1f70 lib/vsprintf.c:2443 vsnprintf+0x1a9b/0x3650 lib/vsprintf.c:2810 vprintk_store+0x537/0x2150 kernel/printk/printk.c:2158 vprintk_emit+0x28b/0xab0 kernel/printk/printk.c:2256 dev_vprintk_emit+0x5ef/0x6d0 drivers/base/core.c:4604 dev_printk_emit+0x1dd/0x21f drivers/base/core.c:4615 __dev_printk+0x3be/0x440 drivers/base/core.c:4627 _dev_info+0x1ea/0x22f drivers/base/core.c:4673 r871xu_drv_init+0x1929/0x3070 drivers/staging/rtl8712/usb_intf.c:401 usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396 really_probe+0x6c7/0x1350 drivers/base/dd.c:621 __driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752 driver_probe_device drivers/base/dd.c:782 [inline] __device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899 bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427 __device_attach+0x593/0x8e0 drivers/base/dd.c:970 device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017 bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487 device_add+0x1fff/0x26e0 drivers/base/core.c:3405 usb_set_configuration+0x37e9/0x3ed0 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0x13c/0x300 drivers/usb/core/generic.c:238 usb_probe_device+0x309/0x570 drivers/usb/core/driver.c:293 really_probe+0x6c7/0x1350 drivers/base/dd.c:621 __driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752 driver_probe_device drivers/base/dd.c:782 [inline] __device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899 bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427 __device_attach+0x593/0x8e0 drivers/base/dd.c:970 device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017 bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487 device_add+0x1fff/0x26e0 drivers/base/core.c:3405 usb_new_device+0x1b91/0x2950 drivers/usb/core/hub.c:2566 hub_port_connect drivers/usb/core/hub.c:5363 [inline] hub_port_connect_change drivers/usb/core/hub.c:5507 [inline] port_event drivers/usb/core/hub.c:5665 [inline] hub_event+0x58e3/0x89e0 drivers/usb/core/hub.c:5747 process_one_work+0xdb6/0x1820 kernel/workqueue.c:2289 worker_thread+0x10d0/0x2240 kernel/workqueue.c:2436 kthread+0x3c7/0x500 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Local variable data created at: usb_read8+0x5d/0x130 drivers/staging/rtl8712/usb_ops.c:33 r8712_read8+0xa5/0xd0 drivers/staging/rtl8712/rtl8712_io.c:29 KMSAN: uninit-value in r871xu_drv_init https://syzkaller.appspot.com/bug?id=3cd92b1d85428b128503bfa7a250294c9ae00bd8 Reported-by: Tested-by: Reviewed-by: Dan Carpenter Signed-off-by: Wang Cheng Link: https://lore.kernel.org/r/b9b7a6ee02c02aa28054f5cf16129977775f3cd9.1652618244.git.wanngchenng@gmail.com Signed-off-by: Greg Kroah-Hartman commit 644ee3bff4ae56db4c4c92b4331f7f4ea4b2147e Author: Wang Cheng Date: Mon May 16 17:23:05 2022 +0800 staging: rtl8712: add error handler in r8712_usbctrl_vendorreq() When 'status' returned from usb_control_msg() is not equal to 'len', that usb_control_msg() is on partial failure, r8712_usbctrl_vendorreq() will treat partial reads as success. Reviewed-by: Dan Carpenter Signed-off-by: Wang Cheng Link: https://lore.kernel.org/r/e33ea53d36c422fbe7eabec5bd9eecb0ebce1bc5.1652618244.git.wanngchenng@gmail.com Signed-off-by: Greg Kroah-Hartman commit b390c25c6757b9d56cecdfbf6d55f15fc89a6386 Author: Pierre-Louis Bossart Date: Tue May 17 12:26:47 2022 -0500 ASoC: rt1015p: remove dependency on GPIOLIB commit dcc2c012c7691 ("ASoC: Fix gpiolib dependencies") removed a series of unnecessary dependencies on GPIOLIB when the gpio was optional. A similar simplification seems valid for rt1015p, so remove the dependency as well. This will avoid the following warning WARNING: unmet direct dependencies detected for SND_SOC_RT1015P Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n] Selected by [y]: - SND_SOC_INTEL_SOF_RT5682_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] && (SND_SOC_SOF_HDA_LINK [=y] || SND_SOC_SOF_BAYTRAIL [=n]) && I2C [=y] && ACPI [=y] && (SND_HDA_CODEC_HDMI [=y] && SND_SOC_SOF_HDA_AUDIO_CODEC [=y] && (MFD_INTEL_LPSS [=y] || COMPILE_TEST [=y]) || SND_SOC_SOF_BAYTRAIL [=n] && (X86_INTEL_LPSS [=n] || COMPILE_TEST [=y])) Reported-by: kernel test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220517172647.468244-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 21ca3274333f5c1cbbf9d91e5b33f4f2463859b2 Author: Pierre-Louis Bossart Date: Tue May 17 12:26:46 2022 -0500 ASoC: max98357a: remove dependency on GPIOLIB commit dcc2c012c7691 ("ASoC: Fix gpiolib dependencies") removed a series of unnecessary dependencies on GPIOLIB when the gpio was optional. A similar simplification seems valid for max98357a, so remove the dependency as well. This will avoid the following warning WARNING: unmet direct dependencies detected for SND_SOC_MAX98357A Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n] Selected by [y]: - SND_SOC_INTEL_SOF_CS42L42_MACH [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_INTEL_MACH [=y] && (SND_SOC_SOF_HDA_LINK [=y] || SND_SOC_SOF_BAYTRAIL [=n]) && I2C [=y] && ACPI [=y] && SND_HDA_CODEC_HDMI [=y] && SND_SOC_SOF_HDA_AUDIO_CODEC [=y] && (MFD_INTEL_LPSS [=y] || COMPILE_TEST [=n]) Reported-by: kernel test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220517172647.468244-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0683532999ab3890f44f832cd47feee9e2374c22 Author: Peter Ujfalusi Date: Mon May 16 13:47:11 2022 +0300 ASoC: SOF: ipc3-dtrace: Move dtrace related variables local from sof_dev The variables and structs for DMA trace can be moved local to ipc3-dtrace.c and the storage can be allocated dynamically, stored behind the fw_trace_data pointer. Signed-off-by: Peter Ujfalusi Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220516104711.26115-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 08341b27bd2ee3c79265ef7925b3bc68a1790ab9 Author: Peter Ujfalusi Date: Mon May 16 13:47:10 2022 +0300 ASoC: SOF: Introduce opaque storage of private data for firmware tracing Firmware tracing implementations can allocate and store their privately used data behind the fw_trace_pdata pointer instead of adding more members to struct snd_sof_dev. Signed-off-by: Peter Ujfalusi Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220516104711.26115-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4b49cbd1e7ebe4b000a7eedc4f910488da62c055 Author: Peter Ujfalusi Date: Mon May 16 13:47:09 2022 +0300 ASoC: SOF: Modify the host trace_init parameter list to include dmab Stop host code (AMD, Intel) to access sdev->dmatb directly. Modify the trace_init prototype to include the pointer to a struct snd_dma_buffer. The ipc3-dtrace passes for now the pointer to sdev->dmatb, but the aim is to move all tracing related runtime information local to a trace implementation. Signed-off-by: Peter Ujfalusi Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220516104711.26115-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b69979a1ec2d9347a43bf0ebdad2c1eb23447ca6 Author: Peter Ujfalusi Date: Mon May 16 13:47:08 2022 +0300 ASoC: SOF: ipc3-dtrace: Move host ops wrappers from generic header to private Move the snd_sof_dma_trace_* ops wrappers from ops.h to ipc3-priv.h since they are not used outside of IPC3 code. While moving, rename them to sof_dtrace_host_* Signed-off-by: Peter Ujfalusi Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220516104711.26115-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 1dedbe4f223cac603e871d91133b9aa3136fbc21 Author: Peter Ujfalusi Date: Mon May 16 13:47:07 2022 +0300 ASoC: SOF: Switch to IPC generic firmware tracing Introduce new, generic API for firmware tracing with sof_fw_trace_ prefix and switch to use it. At the same time the old IPC3 code can be dropped from trace.c, which is now a generic wrapper for the firmware tracing ops. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220516104711.26115-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 671e0b90051ec19e83c12501905734fb808b944e Author: Peter Ujfalusi Date: Mon May 16 13:47:06 2022 +0300 ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation The existing trace.c file is implementing the IPC3 dma-trace support. Clone the existing code with prefix fixes as ipc3 fw_tracing implementation to be used when the core is converted to use generic ops for firmware tracing. Drop the dual licensing of the content as the implementation is based on debugfs. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220516104711.26115-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 25b17da691f3c1a7cc433f864fd4845998a5a37a Author: Peter Ujfalusi Date: Mon May 16 13:47:05 2022 +0300 ASoC: SOF: Rename dtrace_is_supported flag to fw_trace_is_supported Rename the internal flag to not limit it's use for dma-trace, but to be used for generic firmware tracing functionality. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220516104711.26115-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0cfbaee21fcbf131f02c475dbc15f8a18ee621bc Author: Peter Ujfalusi Date: Mon May 16 13:47:04 2022 +0300 ASoC: SOF: Introduce IPC independent ops for firmware tracing support The current (dma-)trace is only supported with IPC3, it is not available when IPC4 is used. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220516104711.26115-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ea32366a8fc98cbabaf8ef1b9cc7618498cb34d4 Author: Phillip Potter Date: Mon May 16 23:46:40 2022 +0100 staging: r8188eu: remove _drv_ defines from include/rtw_debug.h Remove the following defines: _drv_always_ _drv_emerg_ _drv_alert_ _drv_crit_ _drv_err_ _drv_warning_ _drv_notice_ _drv_info_ _drv_debug_ from include/rtw_debug.h, as they are no longer used anywhere in the driver, and are unlikely to be ever again with the removal of the old debugging/logging code. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220516224640.90973-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 63ab906069cd417791f4e15c5eea63699a31b4e3 Author: Gaston Gonzalez Date: Mon May 16 19:17:41 2022 -0300 staging: vc04_services: remove unused macro BITSET_CLR is not used. Remove the define. Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/20220516221741.1015814-1-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 902d75058129aa33c899e08c97d4f5cda8d047eb Author: Haowen Bai Date: Mon May 16 18:22:12 2022 +0800 staging: rtl8192u: remove null check after call container_of() container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1652696533-18011-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 37a3929feba82d71f3d3519fb57c25bef8ed281a Author: Haowen Bai Date: Mon May 16 18:20:03 2022 +0800 staging: rtl8192e: remove null check after call container_of() container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1652696403-17852-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 3baab4bc2f5a1eb083a4c4d25d393a4fec87fd48 Author: Haowen Bai Date: Mon May 16 18:18:41 2022 +0800 staging: ks7010: remove null check after call container_of() container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1652696322-17685-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 14afedb488c61fecf5118030dcdd0a1eaeeca3a7 Author: Michael Straube Date: Mon May 16 07:48:30 2022 +0200 staging: r8188eu: remove HW_VAR_AC_PARAM_BE from SetHwReg8188EU() Remove the HW_VAR_AC_PARAM_BE case from SetHwReg8188EU() and move the functionality to the place where SetHwReg8188EU() is called. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220516054830.8702-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 381b6d7b9c26a1e5f01ef53e236f8768834c1ada Author: Martin Kaiser Date: Sun May 15 17:54:01 2022 +0200 staging: r8188eu: assoc_rsp and assoc_rsp_len are not used The assoc_rsp buffer in struct mlme_priv is not used. There's no need to store an incoming association response after receiving an processing it. Remove the buffer pointer and its length from struct mlme_priv. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515155401.352742-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c8bff2118e68d630e11479481078894b0fde0b34 Author: Martin Kaiser Date: Sun May 15 17:54:00 2022 +0200 staging: r8188eu: last_rx_mgnt_pkts is set but not used last_rx_mgnt_pkts in struct stainfo_stats is set but not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515155401.352742-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4f44756e4fe03aa28894c243548955d2a3420942 Author: Martin Kaiser Date: Sun May 15 17:53:59 2022 +0200 staging: r8188eu: simplify error handling in recv_func_prehandle Simplify the error handling in recv_func_prehandle. There's no need to goto exit, this would be the next statement anyway. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515155401.352742-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 619916037480b1f40c9a1a0456c2f960f9686128 Author: Martin Kaiser Date: Sun May 15 17:53:58 2022 +0200 staging: r8188eu: remove obsolete comments Remove some comments in HalPwrSeqCmd.c that contain no useful information. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515155401.352742-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c7711f1fa7edb59f52fdf478b7f714ebc6315a80 Author: Martin Kaiser Date: Sun May 15 17:53:57 2022 +0200 staging: r8188eu: use ieee80211 helper to check for beacon Use the ieee80211_is_beacon helper to check if the incoming frame is a beacon frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515155401.352742-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3194f684aca1a9da04614472bdfbdfe9ac0c831f Author: Martin Kaiser Date: Sun May 15 17:27:59 2022 +0200 staging: r8188eu: use defines for addba response status Replace the numeric values with defines from ieee80211.h. Suggested-by: Joe Perches Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220515152759.335889-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit fed6328357225837cba278162f1b0f48ad30f9e0 Author: Martin Kaiser Date: Sat May 14 18:47:40 2022 +0200 staging: r8188eu: use the tid in delba processing Extract the tid from the delba frame regardless of the recipient/initiator setting. Use the extracted tid when we process the delba frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 32668668126f516665b08f9d453482c614723436 Author: Martin Kaiser Date: Sat May 14 18:47:39 2022 +0200 staging: r8188eu: check for initiator vs recipient For an incoming delba message, the code checks if the delba was sent by the data initiator or by the data recipient. Rewrite this check using the ieee80211 helpers, making the code easier to understand. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 813586def1590e714af9eb3712fb61b2642eb981 Author: Martin Kaiser Date: Sat May 14 18:47:38 2022 +0200 staging: r8188eu: use BIT(tid) instead of manual shift Use BIT(tid) instead of 1 << tid when we process an addba response. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9465d2d91551854f7f65b24f07656eb5c096e2f4 Author: Martin Kaiser Date: Sat May 14 18:47:37 2022 +0200 staging: r8188eu: replace if with ternary operator Replace an if statement with a ternary operator, making the code a tiny bit shorter. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d4170582c8b0e4f9c68a6caf5decc77424ef844b Author: Martin Kaiser Date: Sat May 14 18:47:36 2022 +0200 staging: r8188eu: merge process_addba_req into OnAction_back The process_addba_req function is called only by OnAction_back. Merge the two functions. OnAction_back has already checked that psta != NULL, we can drop the check in process_addba_req before merging the functions. We can also simplify the parsing of the tid by using struct ieee80211. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cfed805f8217b078935c2cc6d55368cf143b8c12 Author: Martin Kaiser Date: Sat May 14 18:47:35 2022 +0200 staging: r8188eu: read addba resp tid from ieee80211_mgmt Use the same code as ieee80211_process_addba_resp to calculate the tid from the capability field of an addba response message. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 571cc06877c211458aecfe4cdcad30fcb0fa134a Author: Martin Kaiser Date: Sat May 14 18:47:34 2022 +0200 staging: r8188eu: get addba resp status from ieee80211_mgmt Read the addba response status from struct ieee80211_mgmt instead of parsing the incoming frame ourselves. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220514164740.282552-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1ebea4231634207486f3e2d6a10ea14a27bd33d7 Author: Soumya Negi Date: Fri May 13 00:51:07 2022 -0700 staging: r8188eu: Fix block comment format Adhere to Linux coding style. Fix the below checkpatch warning: WARNING: Block comments should align the * on each line Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/20220513075107.23285-1-soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit f722d67fad290b0c960f27062adc8cf59488d0a7 Author: Soumya Negi Date: Thu May 12 19:55:53 2022 -0700 staging: rtl8723bs: Fix alignment to match open parenthesis Adhere to Linux coding style. Fixes checkpatch warnings: CHECK: Alignment should match open parenthesis CHECK: line length of 101 exceeds 100 columns Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/20220513025553.13634-1-soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 404079e7b4810f45a51d83f1b8dd2d3187ad0dc1 Author: Philipp Hortmann Date: Sun May 8 21:30:03 2022 +0200 staging: vt6655: Replace VNSvOutPortB with iowrite8 Replace macro VNSvOutPortB with iowrite8 because it replaces just one line. The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/38611512677a18f63d9266cde1d20758c0feeb6e.1651957741.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b3e5e492ad698e7bc1c6ea957a8c89f9db38ef01 Author: Philipp Hortmann Date: Sun May 8 21:29:58 2022 +0200 staging: vt6655: Replace MACvTransmitBCN with VNSvOutPortB Replace macro MACvTransmitBCN with VNSvOutPortB and as it was the only user, it can now be removed. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/698ce973d92065846a9db4339f017cd9e094706e.1651957741.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7436b3ea277cdc1136e6822b53150cb396ad9236 Author: Philipp Hortmann Date: Sun May 8 21:29:53 2022 +0200 staging: vt6655: Replace MACvStart with VNSvOutPortB Replace macro MACvStart with VNSvOutPortB and as it was the only user, it can now be removed. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/d998305b4dec2827b0e13e49938e68a32517c487.1651957741.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit c0235e384e8d036bc1c990e7f465c03967a96252 Author: Vihas Makwana Date: Sun May 8 23:54:01 2022 +0530 staging: r8188eu: drop redundant if check The check for ETH_P_IP is already performed in the outer if block and inner if check is redundant. So drop the check. Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220508182400.22433-1-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 073d44eaccf07ffbc48e941c62ccd95324df93bf Author: Martin Kaiser Date: Sun May 8 18:14:51 2022 +0200 staging: r8188eu: read back action code from ieee80211_mgmt Read the back action code from struct ieee80211_mgmt. struct ieee80211_mgmt contains an "action" union. Each of its members starts with an 8-bit action code. Treat the union as addba_req when we read the action code although we do not yet know if it is an addba_req. This approach is similar to ieee80211_iface_process_skb. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220508161451.115847-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e2b1711fb54436b681257ee75e0b1a230f5cbb1c Author: Martin Kaiser Date: Sun May 8 18:14:50 2022 +0200 staging: r8188eu: use back action codes from ieee80211.h Use the defines from ieee80211.h for the back action codes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220508161451.115847-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 81900cf8a6045283691afa05994bc012de411020 Author: Martin Kaiser Date: Sun May 8 18:14:49 2022 +0200 staging: r8188eu: read destination address from ieee80211_mgmt For management frames, addr1 is the destination address (da). Read this address from struct ieee80211_mgmt instead of calling a driver-specific macro. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220508161451.115847-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5b3903d555d4ed45277883012325173c96b7dc2f Author: Martin Kaiser Date: Sun May 8 18:14:48 2022 +0200 staging: r8188eu: don't check the category in OnAction_back Do not check the category in OnAction_back. OnAction has already checked the category before calling OnAction_back. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220508161451.115847-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5108b9838a76a9c5cee07b4c4a1bc4bb4024ceeb Author: Martin Kaiser Date: Sun May 8 18:14:47 2022 +0200 staging: r8188eu: read addr2 from ieee80211_mgmt Define a struct ieee80211_mgmt variable in the OnAction_back function. Use it to read addr2. For management frames, addr2 is the source address (sa). Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220508161451.115847-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 20e7ac6f74bc1142f9f9ca0fa46a13d6c3b4cebb Author: Colin Ian King Date: Sat May 7 19:34:14 2022 +0100 staging: rtl8192u: make const array queuetopipe const, reduces object code size Don't populate the const array queuetopipe on the stack, instead make it static. Also makes the object code smaller. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220507183414.26633-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit dc6a7effb48e7267c9f1314e3aa8cfe539bd6096 Merge: bab6ffa233b96 f260fd59e3f38 Author: Greg Kroah-Hartman Date: Thu May 19 17:18:55 2022 +0200 Merge tag 'lkdtm-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into char-misc-next Kees writes: lkdtm updates for -next - Test for new usercopy memory regions - avoid GCC 12 warnings - update expected CONFIGs for selftests * tag 'lkdtm-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lkdtm/heap: Hide allocation size from -Warray-bounds selftests/lkdtm: Add configs for stackleak and "after free" tests lkdtm/usercopy: Check vmalloc and >0-order folios lkdtm/usercopy: Rename "heap" to "slab" lkdtm: cfi: Fix type width for masking PAC bits commit bab6ffa233b960181feb3bdaa51e93ec35f3eb01 Merge: 9c518db6407d4 ae23f746d7442 Author: Greg Kroah-Hartman Date: Thu May 19 17:17:58 2022 +0200 Merge tag 'fpga-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next Moritz writes: FPGA Manager changes for 5.19-rc1 FPGA Manager - My change moves the linux-fpga repository to a shared location w/ shared responsibilities between maintainers - Nava's changes fix coding style and kernel-docs DFL - Matthew's change allows ports to be linked to FMEs. - Tianfei's changes clean up some documentation and ensure the feature type is checked before parsing IRQs 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: Moritz Fischer * tag 'fpga-for-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: dfl: Allow Port to be linked to FME's DFL Documentation: fpga: dfl: add link address of feature id table fpga: dfl: check feature type before parse irq info fpga: fpga-region: fix kernel-doc formatting issues fpga: Use tab instead of space indentation fpga: fpga-mgr: fix kernel-doc warnings fpga: fix for coding style issues MAINTAINERS: Update linux-fpga repository location commit 9c518db6407d45cede53469bdc2ef1d69cbecbac Merge: e727efee8c5ad 1adff542d67a2 Author: Greg Kroah-Hartman Date: Thu May 19 17:16:37 2022 +0200 Merge tag 'coresight-next-v5.19' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux into char-misc-next Mathieu writes: Coresight changes for v5.19 This pull request includes: - Work to uniformise access to the ETMv4 registers, making it easier to look for and change register accesses. - A correction to a probing failure when looking for links between devices. - The replacement of a call to mutex_lock() with a mutex_trylock() in the panic notifier of the cpu-debug infrastructure to avoid a possible deadlock. Signed-off-by: Mathieu Poirier * tag 'coresight-next-v5.19' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux: coresight: cpu-debug: Replace mutex with mutex_trylock on panic notifier coresight: core: Fix coresight device probe failure issue coresight: etm4x: Cleanup TRCRSCTLRn register accesses coresight: etm4x: Cleanup TRCBBCTLR register accesses coresight: etm4x: Cleanup TRCSSPCICRn register accesses coresight: etm4x: Cleanup TRCSSCCRn and TRCSSCSRn register accesses coresight: etm4x: Cleanup TRCACATRn register accesses coresight: etm3x: Cleanup ETMTECR1 register accesses coresight: etm4x: Cleanup TRCVICTLR register accesses coresight: etm4x: Cleanup TRCSTALLCTLR register accesses coresight: etm4x: Cleanup TRCEVENTCTL1R register accesses coresight: etm4x: Cleanup TRCCONFIGR register accesses coresight: etm4x: Cleanup TRCIDR5 register accesses coresight: etm4x: Cleanup TRCIDR4 register accesses coresight: etm4x: Cleanup TRCIDR3 register accesses coresight: etm4x: Cleanup TRCIDR2 register accesses coresight: etm4x: Cleanup TRCIDR0 register accesses commit e727efee8c5add759d0c596b011ab033bf0f0ed1 Merge: fa5602c62544e 5dcc2afe716d6 Author: Greg Kroah-Hartman Date: Thu May 19 17:14:34 2022 +0200 Merge tag 'extcon-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon next for v5.19 Detailed description for this pull request: 1. update extcon core driver - extcon_get_extcon_dev() has been almost used to get the extcon device on booting time. If extcon provider driver is probed at late time, the extcon consumer driver get the -EPROBE_DEFER return value. It requires the inefficient handling code of -EPROBE_DEFER. Instead, extcon_get_extcon_dev() will return -EPROBE_DEFER if the required extcon device is none. It makes the extcon consumer driver to be simplified when getting extcon device. - Register device after dev_set_drvdata because of accessing the sysfs attributes at timing of between drv_set_data and device_register. - Fix some kernel-doc comments of extcon functions. 2. update extcon provider driver - Update extcon-intel-int3496.c : Add support for controlling vbus power via regulator and support to the extcon-intel-int3496.c driver to bind to devices without an ACPi companion. And fix the minor clean-up. - Use struct_size() helper on extcon-usbc-cros-ec.c - Remove the disable irq operation in system sleep for using vbus/id gpio as the wakeup source on extcon-usb-gpio.c - Add support of SM5703 device by using existing extcon-sm5502.c and rename i2c_devic_id from sm5703 to sm5703-muic to reduce confusion between SM5703 MFD device and extcon device. - Add usb role class support and add queue work sync before driver release on extcon-ptn5150.c * tag 'extcon-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: Modify extcon device to be created after driver data is set extcon: sm5502: Clarify SM5703's i2c device ID extcon: ptn5150: Add usb role class support extcon: ptn5150: Add queue work sync before driver release extcon: sm5502: Add support for SM5703 dt-bindings: extcon: bindings for SM5703 extcon: usb-gpio: Remove disable irq operation in system sleep extcon: Fix some kernel-doc comments extcon: usbc-cros-ec: Use struct_size() helper in kzalloc() extcon: int3496: Add support for controlling Vbus through a regulator extcon: int3496: Add support for binding to plain platform devices extcon: int3496: Request non-exclusive access to the ID GPIO extcon: int3496: Make the driver a bit less verbose extcon: Fix extcon_get_extcon_dev() error handling commit fa5602c62544ea5303ce870a9a3318fa7695ffc2 Merge: 46509e7578a28 74da272400b46 Author: Greg Kroah-Hartman Date: Thu May 19 16:57:16 2022 +0200 Merge tag 'soundwire-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 5.19-rc1 - Support for v1.6.0 Qualcomm controllers - Bunch of pm updates by Intel for peripheral attachment and system pm etc * tag 'soundwire-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: qcom: adjust autoenumeration timeout soundwire: qcom: use pm_runtime_resume_and_get() soundwire: intel: use pm_runtime_resume_and_get() soundwire: cadence: use pm_runtime_resume_and_get() soundwire: bus: use pm_runtime_resume_and_get() soundwire: qcom: return error when pm_runtime_get_sync fails soundwire: bus: pm_runtime_request_resume on peripheral attachment soundwire: intel: disable WAKEEN in pm_runtime resume soundwire: intel: prevent pm_runtime resume prior to system suspend soundwire: cadence: recheck device0 attachment after status change dt-bindings: soundwire: qcom: Add bindings for audio clock reset control property soundwire: qcom: Add compatible name for v1.6.0 soundwire: stream: Fix error return code in do_bank_switch() soundwire: qcom: fix an error message in swrm_wait_for_frame_gen_enabled() commit 46509e7578a28b0f87329d2c7e5e363879266c12 Merge: 46ee6bcac9838 d413a34932f98 Author: Greg Kroah-Hartman Date: Thu May 19 16:56:17 2022 +0200 Merge tag 'phy-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-work-next Vinod writes: phy-for-5.19 - New support: - LVDS configuration support and implementation in fsl driver - Qualcomm UFS phy support for SM6350 and USB PHY for SDX65 - Allwinner D-PHY Rx mode support - Yamilfy Mixel mipi-dsi-phy - Updates: - Documentation for phy ops order - Can transceiver mux support - Qualcomm QMP phy updates - Uniphier phy updates * tag 'phy-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (40 commits) phy: qcom-qmp: rename error labels phy: qcom-qmp: fix pipe-clock imbalance on power-on failure phy: qcom-qmp: switch to explicit reset helpers phy: qcom-qmp: fix reset-controller leak on probe errors phy: qcom-qmp: fix struct clk leak on probe errors dt-bindings: phy: renesas,usb2-phy: Document RZ/G2UL phy bindings dt-bindings: phy: marvell,armada-3700-utmi-host-phy: Fix incorrect compatible in example phy: qcom-qmp: fix phy-descriptor kernel-doc typo phy: rockchip-inno-usb2: Clean up some inconsistent indenting phy: freescale: imx8m-pcie: Handle IMX8_PCIE_REFCLK_PAD_UNUSED phy: core: Warn when phy_power_on is called before phy_init phy: core: Update documentation syntax phy: core: Add documentation of phy operation order phy: rockchip-inno-usb2: Handle ID IRQ phy: rockchip-inno-usb2: Handle bvalid falling phy: rockchip-inno-usb2: Support multi-bit mask properties phy: rockchip-inno-usb2: Do not lock in bvalid IRQ handler phy: rockchip-inno-usb2: Do not check bvalid twice phy: rockchip-inno-usb2: Fix muxed interrupt support phy: allwinner: phy-sun6i-mipi-dphy: Support D-PHY Rx mode for MIPI CSI-2 ... commit 46ee6bcac9838b7f74ff91f9cf38511c901ea9c5 Merge: bcfa9546500a4 13b9b814da2de Author: Greg Kroah-Hartman Date: Thu May 19 16:55:13 2022 +0200 Merge tag 'mhi-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-work-next Manivannan writes: MHI changes for v5.19 MHI Host -------- Support for new modems: - Foxconn Cinterion MV32-WA/MV32-WB based on SDX62/SDX65 - Telit FN980 v1 based on SDX55 - Telit FN990 based on SDX65 - Foxconn T99W373/T99W368 based on SDX62/SDX65 Core changes: - During the recycle of event ring elements, compute the ctxt_wp based on the local cached value instead of reading from shared memory. This is to prevent the possible corruption of the ctxt_wp as some of the endpoint devices could modify the value in shared memory. - Add sysfs support for resetting the endpoint based on the MHI spec. The MHI spec allows the host to hard reset the device in the case of an unrecoverable error and all other reset mechanisms have failed. - During MHI shutdown, wait for the endpoint device to enter the ready state post reset before proceeding. This is to avoid a possible race where host would remove the interrupt handler and device will send ready state interrupt, resulting in IOMMU fault. - Bail out updating the MHI register if the read has failed during read/modify/write. - Use mhi_write_reg() instead of mhi_write_reg_field() for writing the whole register fields in mhi_init_mmio(). MAINTAINERS change: - Since Qualcomm has moved the email domain for its employess from codeaurora domain to quicinc, update the same for Hemant. * tag 'mhi-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi: (29 commits) bus: mhi: host: Add support for Foxconn T99W373 and T99W368 bus: mhi: host: pci_generic: add Telit FN990 bus: mhi: host: pci_generic: add Telit FN980 v1 hardware revision bus: mhi: host: Add support for Cinterion MV32-WA/MV32-WB bus: mhi: host: Optimize and update MMIO register write method bus: mhi: host: Bail on writing register fields if read fails bus: mhi: host: Wait for ready state after reset bus: mhi: host: Add soc_reset sysfs bus: mhi: host: pci_generic: Sort mhi_pci_id_table based on the PID bus: mhi: host: Use cached values for calculating the shared write pointer MAINTAINERS: Update Hemant's email id bus: mhi: ep: Add uevent support for module autoloading bus: mhi: ep: Add support for suspending and resuming channels bus: mhi: ep: Add support for queueing SKBs to the host bus: mhi: ep: Add support for processing channel rings bus: mhi: ep: Add support for reading from the host bus: mhi: ep: Add support for processing command rings bus: mhi: ep: Add support for handling SYS_ERR condition bus: mhi: ep: Add support for handling MHI_RESET bus: mhi: ep: Add support for powering down the MHI endpoint stack ... commit 3092adcef3ffd2ef59634998297ca8358461ebce Author: Jason A. Donenfeld Date: Sun May 15 00:22:05 2022 +0200 random: unify batched entropy implementations There are currently two separate batched entropy implementations, for u32 and u64, with nearly identical code, with the goal of avoiding unaligned memory accesses and letting the buffers be used more efficiently. Having to maintain these two functions independently is a bit of a hassle though, considering that they always need to be kept in sync. This commit factors them out into a type-generic macro, so that the expansion produces the same code as before, such that diffing the assembly shows no differences. This will also make it easier in the future to add u16 and u8 batches. This was initially tested using an always_inline function and letting gcc constant fold the type size in, but the code gen was less efficient, and in general it was more verbose and harder to follow. So this patch goes with the boring macro solution, similar to what's already done for the _wait functions in random.h. Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 5ad7dd882e45d7fe432c32e896e2aaa0b21746ea Author: Jason A. Donenfeld Date: Sat May 14 13:59:30 2022 +0200 random: move randomize_page() into mm where it belongs randomize_page is an mm function. It is documented like one. It contains the history of one. It has the naming convention of one. It looks just like another very similar function in mm, randomize_stack_top(). And it has always been maintained and updated by mm people. There is no need for it to be in random.c. In the "which shape does not look like the other ones" test, pointing to randomize_page() is correct. So move randomize_page() into mm/util.c, right next to the similar randomize_stack_top() function. This commit contains no actual code changes. Cc: Andrew Morton Signed-off-by: Jason A. Donenfeld commit 6701de6c51c172b5de5633374479503c81fefc0b Author: Jason A. Donenfeld Date: Sun May 15 15:06:18 2022 +0200 random: remove mostly unused async readiness notifier The register_random_ready_notifier() notifier is somewhat complicated, and was already recently rewritten to use notifier blocks. It is only used now by one consumer in the kernel, vsprintf.c, for which the async mechanism is really overly complex for what it actually needs. This commit removes register_random_ready_notifier() and unregister_random_ ready_notifier(), because it just adds complication with little utility, and changes vsprintf.c to just check on `!rng_is_initialized() && !rng_has_arch_random()`, which will eventually be true. Performance- wise, that code was already using a static branch, so there's basically no overhead at all to this change. Cc: Steven Rostedt Cc: Sergey Senozhatsky Acked-by: Petr Mladek # for vsprintf.c Reviewed-by: Petr Mladek Signed-off-by: Jason A. Donenfeld commit 248561ad25a8ba4ecbc7df42f9a5a82fd5fbb4f6 Author: Jason A. Donenfeld Date: Sat May 14 13:09:17 2022 +0200 random: remove get_random_bytes_arch() and add rng_has_arch_random() The RNG incorporates RDRAND into its state at boot and every time it reseeds, so there's no reason for callers to use it directly. The hashing that the RNG does on it is preferable to using the bytes raw. The only current use case of get_random_bytes_arch() is vsprintf's siphash key for pointer hashing, which uses it to initialize the pointer secret earlier than usual if RDRAND is available. In order to replace this narrow use case, just expose whether RDRAND is mixed into the RNG, with a new function called rng_has_arch_random(). With that taken care of, there are no users of get_random_bytes_arch() left, so it can be removed. Later, if trust_cpu gets turned on by default (as most distros are doing), this one use of rng_has_arch_random() can probably go away as well. Cc: Steven Rostedt Cc: Sergey Senozhatsky Acked-by: Petr Mladek # for vsprintf.c Signed-off-by: Jason A. Donenfeld commit 560181c27b582557d633ecb608110075433383af Author: Jason A. Donenfeld Date: Fri May 13 16:17:12 2022 +0200 random: move initialization functions out of hot pages Much of random.c is devoted to initializing the rng and accounting for when a sufficient amount of entropy has been added. In a perfect world, this would all happen during init, and so we could mark these functions as __init. But in reality, this isn't the case: sometimes the rng only finishes initializing some seconds after system init is finished. For this reason, at the moment, a whole host of functions that are only used relatively close to system init and then never again are intermixed with functions that are used in hot code all the time. This creates more cache misses than necessary. In order to pack the hot code closer together, this commit moves the initialization functions that can't be marked as __init into .text.unlikely by way of the __cold attribute. Of particular note is moving credit_init_bits() into a macro wrapper that inlines the crng_ready() static branch check. This avoids a function call to a nop+ret, and most notably prevents extra entropy arithmetic from being computed in mix_interrupt_randomness(). Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit a19402634c435a4eae226df53c141cdbb9922e7b Author: Jason A. Donenfeld Date: Fri May 13 13:18:46 2022 +0200 random: make consistent use of buf and len The current code was a mix of "nbytes", "count", "size", "buffer", "in", and so forth. Instead, let's clean this up by naming input parameters "buf" (or "ubuf") and "len", so that you always understand that you're reading this variety of function argument. Signed-off-by: Jason A. Donenfeld commit 7c3a8a1db5e03d02cc0abb3357a84b8b326dfac3 Author: Jason A. Donenfeld Date: Fri May 13 12:32:23 2022 +0200 random: use proper return types on get_random_{int,long}_wait() Before these were returning signed values, but the API is intended to be used with unsigned values. Signed-off-by: Jason A. Donenfeld commit 7782cfeca7d420e8bb707613d4cfb0f7ff29bb3a Author: Jason A. Donenfeld Date: Fri May 13 12:29:38 2022 +0200 random: remove extern from functions in header Accoriding to the kernel style guide, having `extern` on functions in headers is old school and deprecated, and doesn't add anything. So remove them from random.h, and tidy up the file a little bit too. Signed-off-by: Jason A. Donenfeld commit f5bda35fba615ace70a656d4700423fa6c9bebee Author: Jason A. Donenfeld Date: Tue May 3 15:30:45 2022 +0200 random: use static branch for crng_ready() Since crng_ready() is only false briefly during initialization and then forever after becomes true, we don't need to evaluate it after, making it a prime candidate for a static branch. One complication, however, is that it changes state in a particular call to credit_init_bits(), which might be made from atomic context, which means we must kick off a workqueue to change the static key. Further complicating things, credit_init_bits() may be called sufficiently early on in system initialization such that system_wq is NULL. Fortunately, there exists the nice function execute_in_process_context(), which will immediately execute the function if !in_interrupt(), and otherwise defer it to a workqueue. During early init, before workqueues are available, in_interrupt() is always false, because interrupts haven't even been enabled yet, which means the function in that case executes immediately. Later on, after workqueues are available, in_interrupt() might be true, but in that case, the work is queued in system_wq and all goes well. Cc: Theodore Ts'o Cc: Sultan Alsawaf Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit bcfa9546500a41fa448816a3c6df2fb798ba9130 Merge: 33a1c6618677f eda75f8238b07 Author: Greg Kroah-Hartman Date: Thu May 19 16:53:08 2022 +0200 Merge tag 'iio-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: First set of IIO new device support, features and cleanup for 5.19 Usual mixed bag. Stand out this time is Andy Shevchenko's continuing effort to move drivers over the generic firmware interfaces. Device support * sprd,sc2720 - upm9620 binding addition. - Refactor and support for sc2720, sc2721 and sc2730. * ti,ads1015 - Refactor driver and add support for TLA2024. Device support (IDs only) * invensense,mpu6050 - Add ID for ICM-20608-D. * st,accel: - Add ID for lis302dl. * st,lsm6dsx - Add support for ASM330LHHX (can fallback to LSM6DSR.) Features * convert drivers to device properties - IIO core - adi,ad7266 - adi,adis16480 - adi,adxl355 - bosch,bmi160 - domintech,dmard06 - fsl,fxas21002c - invensense,mpu3050 - linear,ltc2983 - linear,ltc2632 - maxbotix,mb1232 - maxim,max31856 - maxim,max31865 - multiplexer - ping - rescale - taos,tsl2772 * core - Add runtime check on whether realbits fit in storagebits for each channel. * adi,ad_sigma_delta - Add sequencer support and relevant update_scan_mode callbacks for adi,ad7192 and adi,ad7124. Cleanup and minor fixes * MAINTAINERS - Update Lorenzo Bianconi's email address for IIO drivers. - Add entry for ad3552r and update maintainer in dt-binding doc. * tree-wide - Replace strtobool() with kstrtobool(). - Drop false OF dependencies. * core - Tidy up and document IIO modes. - Take iio_buffer_enabled() out of header allowing current_mode to be moved to the opaque structure. - As all kfifo buffers use the same mode value, drop that parameter and set it unconditionally. - White space fixes and similar. - Drop use of list iterator variable for list_for_each_entry_continue_reverse and use list_prepare_entry to restart. * sysfs-trigger - Replace use of 'found' variable with dedicate list iterator variable. * adi,ad7124 - Drop misleading shift. * adi,ad2s1210 - Remove redundant local variable assignment. * adi,adis16480 - Use local device pointer to reduce repetition. - Improve handling of clocks. * domintech,dmard09 - White space. * dummy driver - Improve error handling. * fsl,mma8452 - Add missing documentation of name element. * invensense,mpu3050 - Stop remove() returning non 0. * kionix,kxsd9 - White space. * linear,ltc2688 - Use local variable for struct device. - Combine of_node_put() error handling paths. * linear,ltc2983 - Avoid use of constants in messages where a define is available. * microchip,mcp4131 - Fix compatible in dt example. * pni,rm3100 - Stop directly accessing iio_dev->current_mode just to find out if the buffer is enabled. * renesas,rzg2l - Relax kconfig constraint to include newer devices. * sprd,sc27xx - Fix wrong scaling mask. - Improve the calibration values. * samsung,ssp - Replace a 'found' variable in favor of an explicit value that was found. * sensortek,stk3xx - Add proximity-near-level binding and driver support. * st,st_sensors: - Drop unused accel_type enum. - Return early in *_write_raw() - Drop unnecessary locking in _avail functions. - Add local lock to protect odr against concurrent updates allowing mlock to no longer be used outside of the core. - Use iio_device_claim_direct_mode() rather than racy checking of the current mode. * st,stmpe-adc - Fix checks on wait_for_completion_timeout(). - Allow use of of_device_id for matching. * st,stm32-dfsdm - Stop accessing iio_dev->current_mode to find out if the buffer is enabled (so we can hide that variable in the opaque structure) * st,vl53l0x - Fix checks on wait_for_completion_timeout. * ti,ads1015 - Add missing ID for ti,ads1115 in binding doc. - Convert from repeated chip ID look up to selecting static const data. - Switch to read_avail() callback. * ti,ads8688 - Use of_device_id for driver matching. * ti,palmas-adc - Drop a warning on minor calibration mismatch leading to slightly negative values after applying the calibration. * tag 'iio-for-5.19a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (95 commits) iio: ti-ads8688: use of_device_id for OF matching iio: stmpe-adc: use of_device_id for OF matching dt-bindings: iio: Fix incorrect compatible strings in examples iio: gyro: mpu3050: Make mpu3050_common_remove() return void iio: dac: ltc2632: Make use of device properties iio: temperature: max31865: Make use of device properties iio: proximity: mb1232: Switch to use fwnode_irq_get() iio: imu: adis16480: Improve getting the optional clocks iio: imu: adis16480: Use temporary variable for struct device iio: imu: adis16480: Make use of device properties staging: iio: ad2s1210: remove redundant assignment to variable negative iio: adc: sc27xx: add support for PMIC sc2730 iio: adc: sc27xx: add support for PMIC sc2720 and sc2721 iio: adc: sc27xx: refactor some functions for support more PMiCs iio: adc: sc27xx: structure adjustment and optimization iio: adc: sc27xx: Fine tune the scale calibration values iio: adc: sc27xx: fix read big scale voltage not right dt-bindings:iio:adc: add sprd,ump9620-adc dt-binding iio: proximity: stk3310: Export near level property for proximity sensor dt-bindings: iio: light: stk33xx: Add proximity-near-level ... commit 933adebbbd2f3160451b55f915133cd4d1c4d8fd Author: Rob Herring Date: Wed May 18 20:12:09 2022 -0500 dt-bindings: pinctrl: qcom: Drop 'maxItems' on 'wakeup-parent' 'wakeup-parent' is a single phandle and not an array, so 'maxItems' is wrong. Drop it. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220519011210.170022-1-robh@kernel.org Signed-off-by: Linus Walleij commit 48bd5c381c4a750bf486360536f4274c10b9ca35 Author: Geert Uytterhoeven Date: Wed May 18 16:41:42 2022 +0200 pinctrl: starfive: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the starfive driver: gpio gpiochip0: (11910000.pinctrl): not an immutable chip, please consider fixing it! Fix this by making the irqchip in the starfive driver immutable. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5eb66be34356afd5eb0ea9027329e0939d03d3a0.1652884852.git.geert+renesas@glider.be Signed-off-by: Linus Walleij commit e89aa642be21b14e53bab40a37b8c6b0cf05143d Author: Christophe Leroy Date: Mon May 9 07:36:14 2022 +0200 powerpc/ftrace: Use PPC_RAW_xxx() macros instead of opencoding. PPC_RAW_xxx() macros are self explanatory and less error prone than open coding. Use them in ftrace.c Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9292094c9a69cef6d29ee83f435a557b59c45065.1652074503.git.christophe.leroy@csgroup.eu commit cf9df92a823ce24c19c4c64b334dc5cadd74fa98 Author: Christophe Leroy Date: Mon May 9 07:36:13 2022 +0200 powerpc/ftrace: Use BRANCH_SET_LINK instead of value 1 To make it explicit, use BRANCH_SET_LINK instead of value 1 when calling create_branch(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d57847063ac93660a5af620d4df1847f10edf61a.1652074503.git.christophe.leroy@csgroup.eu commit ccf6607e45aaf5e0ceabfe018aeb01818a936697 Author: Christophe Leroy Date: Mon May 9 07:36:12 2022 +0200 powerpc/ftrace: Remove ftrace_plt_tramps[] ftrace_plt_tramps table is never filled so it is useless. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/daeeb618a6619e3a7e3f82f1bd83ca7c25af6330.1652074503.git.christophe.leroy@csgroup.eu commit c2cba93d1a5e2475a636b5cb974da6b73d7a72df Author: Christophe Leroy Date: Mon May 9 07:36:11 2022 +0200 powerpc/ftrace: Use CONFIG_FUNCTION_TRACER instead of CONFIG_DYNAMIC_FTRACE Since commit 0c0c52306f47 ("powerpc: Only support DYNAMIC_FTRACE not static"), CONFIG_DYNAMIC_FTRACE is always selected when CONFIG_FUNCTION_TRACER is selected. To avoid confusion and have the reader wonder what's happen when CONFIG_FUNCTION_TRACER is selected and CONFIG_DYNAMIC_FTRACE is not, use CONFIG_FUNCTION_TRACER in ifdefs instead of CONFIG_DYNAMIC_FTRACE. As CONFIG_FUNCTION_GRAPH_TRACER depends on CONFIG_FUNCTION_TRACER, ftrace.o doesn't need to appear for both symbols in Makefile. Then as ftrace.o is built only when CONFIG_FUNCTION_TRACER is selected ifdef CONFIG_FUNCTION_TRACER is not needed in ftrace.c, and since it implies CONFIG_DYNAMIC_FTRACE, CONFIG_DYNAMIC_FTRACE is not needed in ftrace.c Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/628d357503eb90b4a034f99b7df516caaff4d279.1652074503.git.christophe.leroy@csgroup.eu commit a3d0f5b4b7e425b8abeadda1e76496bda88989bd Author: Christophe Leroy Date: Mon May 9 07:36:10 2022 +0200 powerpc/ftrace: Don't include ftrace.o for CONFIG_FTRACE_SYSCALLS Since commit 7bea7ac0ca01 ("powerpc/syscalls: Fix syscall tracing") ftrace.o is not needed anymore for CONFIG_FTRACE_SYSCALLS. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/275932a5d61543b825ff9a64f61abed6da5d4a2a.1652074503.git.christophe.leroy@csgroup.eu commit 23b44fc248f420bbcd0dcd290c3399885360984d Author: Christophe Leroy Date: Mon May 9 07:36:09 2022 +0200 powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64 Since c93d4f6ecf4b ("powerpc/ftrace: Add module_trampoline_target() for PPC32"), __ftrace_make_nop() for PPC32 is very similar to the one for PPC64. Same for __ftrace_make_call(). Make them common. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/96f53c237316dab4b1b8c682685266faa92da816.1652074503.git.christophe.leroy@csgroup.eu commit 5b89492c03e5c0a2c259b97d7d4c1bb9b02860aa Author: Christophe Leroy Date: Mon May 9 07:36:08 2022 +0200 powerpc: Finalise cleanup around ABI use Now that we have CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2, get rid of all indirect detection of ABI version. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/709d9d69523c14c8a9fba4486395dca0f2d675b1.1652074503.git.christophe.leroy@csgroup.eu commit 7d40aff8213c92e64a1576ba9dfebcd201c0564d Author: Christophe Leroy Date: Mon May 9 07:36:07 2022 +0200 powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2} Replace all uses of PPC64_ELF_ABI_v1 and PPC64_ELF_ABI_v2 by resp CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ba13d59e8c50bc9aa6328f1c7f0c0d0278e0a3a7.1652074503.git.christophe.leroy@csgroup.eu commit 661aa880398add5c27943cb077c451a45cc112a1 Author: Christophe Leroy Date: Mon May 9 07:36:06 2022 +0200 powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2 At the time being, we use CONFIG_CPU_LITTLE_ENDIAN and CONFIG_CPU_BIG_ENDIAN to pass -mabi=elfv1 or elfv2 to compiler, then define a PPC64_ELF_ABI_v1 or PPC64_ELF_ABI_v2 macro in asm/types.h based on _CALL_ELF define set by the compiler. Make it more straight forward with a CONFIG option that is directly usable. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1eca1addbc550167da9841c7340a010d0c4b2200.1652074503.git.christophe.leroy@csgroup.eu commit bbffdd2fc743bdc529f9a8264bdb5d3491f58c95 Author: Christophe Leroy Date: Mon May 9 07:36:05 2022 +0200 powerpc/ftrace: Use patch_instruction() return directly Instead of returning -EPERM when patch_instruction() fails, just return what patch_instruction returns. That simplifies ftrace_modify_code(): 0: 94 21 ff c0 stwu r1,-64(r1) 4: 93 e1 00 3c stw r31,60(r1) 8: 7c 7f 1b 79 mr. r31,r3 c: 40 80 00 30 bge 3c 10: 93 c1 00 38 stw r30,56(r1) 14: 7c 9e 23 78 mr r30,r4 18: 7c a4 2b 78 mr r4,r5 1c: 80 bf 00 00 lwz r5,0(r31) 20: 7c 1e 28 40 cmplw r30,r5 24: 40 82 00 34 bne 58 28: 83 c1 00 38 lwz r30,56(r1) 2c: 7f e3 fb 78 mr r3,r31 30: 83 e1 00 3c lwz r31,60(r1) 34: 38 21 00 40 addi r1,r1,64 38: 48 00 00 00 b 38 38: R_PPC_REL24 patch_instruction Before: 0: 94 21 ff c0 stwu r1,-64(r1) 4: 93 e1 00 3c stw r31,60(r1) 8: 7c 7f 1b 79 mr. r31,r3 c: 40 80 00 4c bge 58 10: 93 c1 00 38 stw r30,56(r1) 14: 7c 9e 23 78 mr r30,r4 18: 7c a4 2b 78 mr r4,r5 1c: 80 bf 00 00 lwz r5,0(r31) 20: 7c 08 02 a6 mflr r0 24: 90 01 00 44 stw r0,68(r1) 28: 7c 1e 28 40 cmplw r30,r5 2c: 40 82 00 48 bne 74 30: 7f e3 fb 78 mr r3,r31 34: 48 00 00 01 bl 34 34: R_PPC_REL24 patch_instruction 38: 80 01 00 44 lwz r0,68(r1) 3c: 20 63 00 00 subfic r3,r3,0 40: 83 c1 00 38 lwz r30,56(r1) 44: 7c 63 19 10 subfe r3,r3,r3 48: 7c 08 03 a6 mtlr r0 4c: 83 e1 00 3c lwz r31,60(r1) 50: 38 21 00 40 addi r1,r1,64 54: 4e 80 00 20 blr It improves ftrace activation/deactivation duration by about 3%. Modify patch_instruction() return on failure to -EPERM in order to match with ftrace expectations. Other users of patch_instruction() do not care about the exact error value returned. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/49a8597230713e2633e7d9d7b56140787c4a7e20.1652074503.git.christophe.leroy@csgroup.eu commit 2c920fca8c70287c4448f2653a388ecca7b32e83 Author: Christophe Leroy Date: Mon May 9 07:36:04 2022 +0200 powerpc/ftrace: Inline ftrace_modify_code() Inlining ftrace_modify_code(), it increases a bit the size of ftrace code but brings 5% improvment on ftrace activation. Usually in C files we let gcc decide what to do but here it really help to 'help' gcc to decide to inline, thought we don't want to force it with an __always_inline that would be too much for CONFIG_CC_OPTIMIZE_FOR_SIZE. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1597a06d57cfc80e6853838c4066e799bf6c7977.1652074503.git.christophe.leroy@csgroup.eu commit d2f47dabf1252520a88d257133e6bdec474fd935 Author: Christophe Leroy Date: Mon May 9 07:36:03 2022 +0200 powerpc/code-patching: Inline create_branch() create_branch() is a good candidate for inlining because: - Flags can be folded in. - Range tests are likely to be already done. Hence reducing the create_branch() to only a set of instructions. So inline it. It improves ftrace activation by 10%. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/69851cc9a7bf8f03d025e6d29e165f2d0bd3bb6e.1652074503.git.christophe.leroy@csgroup.eu commit a1facd2578b312770aaea384adc7de0ed3f543d1 Author: Christophe Leroy Date: Mon May 9 07:36:02 2022 +0200 powerpc/ftrace: Use is_offset_in_branch_range() Use is_offset_in_branch_range() instead of create_branch() to check if a target is within branch range. This patch together with the previous one improves ftrace activation time by 7% Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/912ae51782f5a53c44e435497c8c3fb5cc632387.1652074503.git.christophe.leroy@csgroup.eu commit 1acbf27e8a5843911d122ad0008e79ec5f7b6382 Author: Christophe Leroy Date: Mon May 9 07:36:01 2022 +0200 powerpc/code-patching: Inline is_offset_in_{cond}_branch_range() Test in is_offset_in_branch_range() and is_offset_in_cond_branch_range() are simple tests that are worth inlining. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a05be0ccb7373e6a9789a1988fcd0c810f5f9269.1652074503.git.christophe.leroy@csgroup.eu commit ae3a2a2188214adc355a5bdf6deb29120886c96f Author: Christophe Leroy Date: Mon May 9 07:36:00 2022 +0200 powerpc/ftrace: Remove redundant create_branch() calls Since commit d5937db114e4 ("powerpc/code-patching: Fix patch_branch() return on out-of-range failure") patch_branch() fails with -ERANGE when trying to branch out of range. No need to perform the test twice. Remove redundant create_branch() calls. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aa45fbad0b4b7493080835d8276c0cb4ce146503.1652074503.git.christophe.leroy@csgroup.eu commit d996d5053eb5c0abc0358e5670014a62ada6967e Author: Christophe Leroy Date: Mon May 9 07:35:59 2022 +0200 powerpc/ftrace: Refactor prepare_ftrace_return() When we have CONFIG_DYNAMIC_FTRACE_WITH_ARGS, prepare_ftrace_return() is called by ftrace_graph_func() otherwise prepare_ftrace_return() is called from assembly. Refactor prepare_ftrace_return() into a static __prepare_ftrace_return() that will be called by both prepare_ftrace_return() and ftrace_graph_func(). It will allow GCC to fold __prepare_ftrace_return() inside ftrace_graph_func(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0d42deafe353980c66cf19d3132638c05ba9f4a9.1652074503.git.christophe.leroy@csgroup.eu commit 804c0a166ffea628eb7ef72b9fd710883cb1fa8f Author: Nicholas Piggin Date: Tue Mar 8 23:50:46 2022 +1000 powerpc/rtas: enture rtas_call is called with MMU enabled rtas_call must not be called with the MMU disabled because in case of rtas error, log_error is called which requires MMU enabled. Add a test and warning for this. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-14-npiggin@gmail.com commit 014b2e896cc8445fcc04636e69bf5f9e24281daa Author: Nicholas Piggin Date: Tue Mar 8 23:50:42 2022 +1000 powerpc/rtas: Leave MSR[RI] enabled over RTAS call PAPR specifies that RTAS may be called with MSR[RI] enabled if the calling context is recoverable, and RTAS will manage RI as necessary. Call the rtas entry point with RI enabled, and add a check to ensure the caller has RI enabled. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-10-npiggin@gmail.com commit 5c86bd02b3c3ef68a109fa7e690ad62d3091f6d4 Author: Nicholas Piggin Date: Tue Mar 8 23:50:40 2022 +1000 powerpc/rtas: PACA can be restored directly from SPRG On 64-bit, PACA is saved in a SPRG so it does not need to be saved on stack. We also don't need to mask off the top bits for real mode addresses because the architecture does this for us. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-8-npiggin@gmail.com commit c5a65e0a420d50655bf692fc7386813683c0cd81 Author: Nicholas Piggin Date: Tue Mar 8 23:50:37 2022 +1000 powerpc/rtas: Call enter_rtas with MSR[EE] disabled Disable MSR[EE] in C code rather than asm. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-5-npiggin@gmail.com commit 4e949faae2bd42783a2b2b732b7bf17557d94cfb Author: Nicholas Piggin Date: Tue Mar 8 23:50:36 2022 +1000 powerpc/rtas: Fix whitespace in rtas_entry.S The code was moved verbatim including whitespace cruft. Fix that. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-4-npiggin@gmail.com commit 07940b4b61cf0cbcfb9e4226c07318f737157c42 Author: Nicholas Piggin Date: Tue Mar 8 23:50:35 2022 +1000 powerpc/rtas: Make enter_rtas a nokprobe symbol on 64-bit This symbol is marked nokprobe on 32-bit but not 64-bit, add it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-3-npiggin@gmail.com commit 838ee286ecc9a3c76e6bd8f5aaad0c8c5c66b9ca Author: Nicholas Piggin Date: Tue Mar 8 23:50:34 2022 +1000 powerpc/rtas: Move rtas entry assembly into its own file This makes working on the code a bit easier. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308135047.478297-2-npiggin@gmail.com commit 2896b2dff49d0377e4372f470dcddbcb26f2be59 Author: Nicholas Piggin Date: Tue Mar 8 04:27:34 2022 +1000 powerpc/signal: Report minimum signal frame size to userspace via AT_MINSIGSTKSZ Implement the AT_MINSIGSTKSZ AUXV entry, allowing userspace to dynamically size stack allocations in a manner forward-compatible with new processor state saved in the signal frame For now these statically find the maximum signal frame size rather than doing any runtime testing of features to minimise the size. glibc 2.34 will take advantage of this, as will applications that use use _SC_MINSIGSTKSZ and _SC_SIGSTKSZ. Reviewed-by: Tulio Magno Quites Machado Filho Signed-off-by: Nicholas Piggin References: 94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220307182734.289289-2-npiggin@gmail.com commit 2f82ec19757f58549467db568c56e7dfff8af283 Author: Nicholas Piggin Date: Tue Mar 8 04:27:33 2022 +1000 powerpc/64: Bump SIGSTKSZ and MINSIGSTKSZ The sad tale of SIGSTKSZ and MINSIGSTKSZ is documented in glibc.git commit f7c399cff5bd ("PowerPC SIGSTKSZ"), which explains why glibc does not use the kernel defines for these constants. Since then in fact there has been a further expansion of the signal stack frame size on little-endian with linux commit 573ebfa6601f ("powerpc: Increase stack redzone for 64-bit userspace to 512 bytes"), which has caused it to exceed even the glibc defines. See kernel commit 63dee5df43a3 ("powerpc: Allow 4224 bytes of stack expansion for the signal frame") for more details of the history of the expansion. Increase MINSIGSTKSZ to 8192 which is double the current glibc value and fits the current stack frame with room to grow. SIGSTKSZ is set to 4x the minimum as convention. glibc will have to be updated as well. Reviewed-by: Tulio Magno Quites Machado Filho Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220307182734.289289-1-npiggin@gmail.com commit 4406b12214f6592909b63dabdea86d69f1b5ba2e Author: Nathan Chancellor Date: Wed May 11 11:50:01 2022 -0700 powerpc/vdso: Link with ld.lld when requested The PowerPC vDSO uses $(CC) to link, which differs from the rest of the kernel, which uses $(LD) directly. As a result, the default linker of the compiler is used, which may differ from the linker requested by the builder. For example: $ make ARCH=powerpc LLVM=1 mrproper defconfig arch/powerpc/kernel/vdso/ ... $ llvm-readelf -p .comment arch/powerpc/kernel/vdso/vdso{32,64}.so.dbg File: arch/powerpc/kernel/vdso/vdso32.so.dbg String dump of section '.comment': [ 0] clang version 14.0.0 (Fedora 14.0.0-1.fc37) File: arch/powerpc/kernel/vdso/vdso64.so.dbg String dump of section '.comment': [ 0] clang version 14.0.0 (Fedora 14.0.0-1.fc37) LLVM=1 sets LD=ld.lld but ld.lld is not used to link the vDSO; GNU ld is because "ld" is the default linker for clang on most Linux platforms. This is a problem for Clang's Link Time Optimization as implemented in the kernel because use of GNU ld with LTO requires the LLVMgold plugin, which is not technically supported for ld.bfd per https://llvm.org/docs/GoldPlugin.html. Furthermore, if LLVMgold.so is missing from a user's system, the build will fail, even though LTO as it is implemented in the kernel requires ld.lld to avoid this dependency in the first place. Ultimately, the PowerPC vDSO should be converted to compiling and linking with $(CC) and $(LD) respectively but there were issues last time this was tried, potentially due to older but supported tool versions. To avoid regressing GCC + binutils, use the compiler option '-fuse-ld', which tells the compiler which linker to use when it is invoked as both the compiler and linker. Use '-fuse-ld=lld' when LD=ld.lld has been specified (CONFIG_LD_IS_LLD) so that the vDSO is linked with the same linker as the rest of the kernel. $ llvm-readelf -p .comment arch/powerpc/kernel/vdso/vdso{32,64}.so.dbg File: arch/powerpc/kernel/vdso/vdso32.so.dbg String dump of section '.comment': [ 0] Linker: LLD 14.0.0 [ 14] clang version 14.0.0 (Fedora 14.0.0-1.fc37) File: arch/powerpc/kernel/vdso/vdso64.so.dbg String dump of section '.comment': [ 0] Linker: LLD 14.0.0 [ 14] clang version 14.0.0 (Fedora 14.0.0-1.fc37) LD can be a full path to ld.lld, which will not be handled properly by '-fuse-ld=lld' if the full path to ld.lld is outside of the compiler's search path. '-fuse-ld' can take a path to the linker but it is deprecated in clang 12.0.0; '--ld-path' is preferred for this scenario. Use '--ld-path' if it is supported, as it will handle a full path or just 'ld.lld' properly. See the LLVM commit below for the full details of '--ld-path'. Signed-off-by: Nathan Chancellor Tested-by: Alexey Kardashevskiy Reviewed-by: Nick Desaulniers Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://github.com/ClangBuiltLinux/linux/issues/774 Link: https://github.com/llvm/llvm-project/commit/1bc5c84710a8c73ef21295e63c19d10a8c71f2f5 Link: https://lore.kernel.org/r/20220511185001.3269404-3-nathan@kernel.org commit e247172854a57d1a7213bb835ecb4a40ce9bb2b9 Author: Nathan Chancellor Date: Wed May 11 11:50:00 2022 -0700 powerpc/vdso: Remove unused ENTRY in linker scripts When linking vdso{32,64}.so.dbg with ld.lld, there is a warning about not finding _start for the starting address: ld.lld: warning: cannot find entry symbol _start; not setting start address ld.lld: warning: cannot find entry symbol _start; not setting start address Looking at GCC + GNU ld, the entry point address is 0x0: $ llvm-readelf -h vdso{32,64}.so.dbg &| rg "(File|Entry point address):" File: vdso32.so.dbg Entry point address: 0x0 File: vdso64.so.dbg Entry point address: 0x0 This matches what ld.lld emits: $ powerpc64le-linux-gnu-readelf -p .comment vdso{32,64}.so.dbg File: vdso32.so.dbg String dump of section '.comment': [ 0] Linker: LLD 14.0.0 [ 14] clang version 14.0.0 (Fedora 14.0.0-1.fc37) File: vdso64.so.dbg String dump of section '.comment': [ 0] Linker: LLD 14.0.0 [ 14] clang version 14.0.0 (Fedora 14.0.0-1.fc37) $ llvm-readelf -h vdso{32,64}.so.dbg &| rg "(File|Entry point address):" File: vdso32.so.dbg Entry point address: 0x0 File: vdso64.so.dbg Entry point address: 0x0 Remove ENTRY to remove the warning, as it is unnecessary for the vDSO to function correctly. Signed-off-by: Nathan Chancellor Tested-by: Alexey Kardashevskiy Reviewed-by: Nick Desaulniers Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220511185001.3269404-2-nathan@kernel.org commit d9e5c3e9e75162f845880535957b7fd0b4637d23 Author: Kevin Hao Date: Tue Mar 29 16:57:09 2022 +0800 powerpc: Export mmu_feature_keys[] as non-GPL When the mmu_feature_keys[] was introduced in the commit c12e6f24d413 ("powerpc: Add option to use jump label for mmu_has_feature()"), it is unlikely that it would be used either directly or indirectly in the out of tree modules. So we exported it as GPL only. But with the evolution of the codes, especially the PPC_KUAP support, it may be indirectly referenced by some primitive macro or inline functions such as get_user() or __copy_from_user_inatomic(), this will make it impossible to build many non GPL modules (such as ZFS) on ppc architecture. Fix this by exposing the mmu_feature_keys[] to the non-GPL modules too. Fixes: 7613f5a66bec ("powerpc/64s/kuap: Use mmu_has_feature()") Reported-by: Nathaniel Filardo Signed-off-by: Kevin Hao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220329085709.4132729-1-haokexin@gmail.com commit e2aa34ce80a26d24a0333da9402d533885f239c9 Author: Guilherme G. Piccoli Date: Wed Apr 27 19:49:02 2022 -0300 powerpc/setup: Refactor/untangle panic notifiers The panic notifiers infrastructure is a bit limited in the scope of the callbacks - basically every kind of functionality is dropped in a list that runs in the same point during the kernel panic path. This is not really on par with the complexities and particularities of architecture / hypervisors' needs, and a refactor is ongoing. As part of this refactor, it was observed that powerpc has 2 notifiers, with mixed goals: one is just a KASLR offset dumper, whereas the other aims to hard-disable IRQs (necessary on panic path), warn firmware of the panic event (fadump) and run low-level platform-specific machinery that might stop kernel execution and never come back. Clearly, the 2nd notifier has opposed goals: disable IRQs / fadump should run earlier while low-level platform actions should run late since it might not even return. Hence, this patch decouples the notifiers splitting them in three: - First one is responsible for hard-disable IRQs and fadump, should run early; - The kernel KASLR offset dumper is really an informative notifier, harmless and may run at any moment in the panic path; - The last notifier should run last, since it aims to perform low-level actions for specific platforms, and might never return. It is also only registered for 2 platforms, pseries and ps3. The patch better documents the notifiers and clears the code too, also removing a useless header. Currently no functionality change should be observed, but after the planned panic refactor we should expect more panic reliability with this patch. Signed-off-by: Guilherme G. Piccoli Reviewed-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220427224924.592546-9-gpiccoli@igalia.com commit 2e1ccc6a75cc67ee00a79263442667709030ed28 Author: AngeloGioacchino Del Regno Date: Tue May 17 10:39:57 2022 +0200 pinctrl: mediatek: Add pinctrl driver for MT6795 Helio X10 Add support for the MediaTek Helio X10 (MT6795) SoC's GPIO/pinmux controller. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220517083957.11816-3-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij commit 81557a71564a8c44ee5b9262d08438b0170a25f3 Author: AngeloGioacchino Del Regno Date: Tue May 17 10:39:56 2022 +0200 dt-bindings: pinctrl: Add MediaTek MT6795 pinctrl bindings Add devicetree and pinfunc bindings for MediaTek Helio X10 MT6795. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220517083957.11816-2-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij commit b104e41cda1ef9c5e851a7de3f30b53535e7d528 Merge: a5fc286f69fc9 ad55bae7dc364 Author: Michael Ellerman Date: Thu May 19 23:10:42 2022 +1000 Merge branch 'topic/ppc-kvm' into next Merge our KVM topic branch. commit fff65226b229a8c1155936cef781ade56ebbb902 Author: Jesse Taube Date: Mon May 16 23:27:59 2022 -0400 pinctrl: freescale: Add i.MXRT1170 pinctrl driver support Add the pinctrl driver support for i.MXRT1170. Cc: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Dong Aisheng Link: https://lore.kernel.org/r/20220517032802.451743-11-Mr.Bossman075@gmail.com Signed-off-by: Linus Walleij commit 0dfd7fc0e1d517581d4b157a5439265dcc249fd9 Author: Jesse Taube Date: Mon May 16 23:27:53 2022 -0400 dt-bindings: pinctrl: add i.MXRT1170 pinctrl Documentation Add i.MXRT1170 pinctrl binding Documentation Cc: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220517032802.451743-5-Mr.Bossman075@gmail.com Signed-off-by: Linus Walleij commit ed1f77b78322e22421935ff93e5d6dbf19e50c39 Author: Sebastian Reichel Date: Wed May 4 23:32:48 2022 +0200 dt-bindings: pinctrl: rockchip: increase max amount of device functions RK3588 can have 10 different device functions, so increase the maximum amount appropriately. Considering rockchip uses auto-generated pinmux files, adding a quite complex if construct to increase the limit just for rk3588 does not seem to be worth the effort. Signed-off-by: Sebastian Reichel Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220504213251.264819-19-sebastian.reichel@collabora.com Signed-off-by: Linus Walleij commit d31dcf1f008c8c1ce2e872b1cdb9ffec9e370a95 Author: Krzysztof Kozlowski Date: Sun May 8 15:59:29 2022 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: add 'gpio-reserved-ranges' 'gpio-reserved-ranges' property is already used and supported by common pinctrl bindings, so add it also here to fix warnings like: qrb5165-rb5.dtb: gpio@c000: 'gpio-reserved-ranges' does not match any of the regexes: '-state$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220508135932.132378-2-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 58819949b8ec7322d0f67d14e5cb993ce8cd989b Author: Krzysztof Kozlowski Date: Sat May 7 21:49:06 2022 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: add 'input-disable' 'input-disable' is already used and supported by common pinctrl bindings, so add it also here to fix warnings like: arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb: gpio@c000: lt9611-rst-state: 'oneOf' conditional failed, one must be fixed: 'input-disable' does not match any of the regexes: 'pinctrl-[0-9]+' 'function', 'input-disable', 'output-high', 'pins', 'power-source' do not match any of the regexes: '(pinconf|-pins)$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220507194913.261121-5-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 04bed6407ee67f720660ea55fca7927e21d735d8 Author: Krzysztof Kozlowski Date: Sat May 7 21:49:05 2022 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: describe gpio-line-names Add missing 'gpio-line-names' property and describe its constraints for all models except PM8226 (which seems not really used). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220507194913.261121-4-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 06367559766b7c9bd96d2baef8bfc5a9bb451e25 Author: Krzysztof Kozlowski Date: Sat May 7 21:49:04 2022 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: fix matching pin config Matching PMIC GPIOs config nodes within a '-state' node by '.*' pattern does not work as expected because of linux,phandle in the DTB: arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon-cityman.dtb: gpios@c000: divclk4-state: 'oneOf' conditional failed, one must be fixed: 'pins' is a required property 'function' is a required property 'pinconf' does not match any of the regexes: 'pinctrl-[0-9]+' [[2]] is not of type 'object' Make the schema stricter and expect such nodes to be either named 'pinconfig' or followed with '-pins' prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220507194913.261121-3-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 2313623dd15b845968c99fb00ac6246609a4ea53 Author: Krzysztof Kozlowski Date: Sat May 7 21:49:03 2022 +0200 dt-bindings: pinctrl: qcom,pmic-gpio: document PM8150L and PMM8155AU Add missing compatibles for devices: PM8150L and PMM8155AU. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220507194913.261121-2-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit a249ca7dfbce1eb82bcd3a5a6bb21daeade20469 Author: Jan Kara Date: Thu May 19 12:52:32 2022 +0200 bfq: Remove bfq_requeue_request_body() The function has only a single caller and two lines. Just remove it since it is pointless and just harming readability. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220519105235.31397-4-jack@suse.cz Signed-off-by: Jens Axboe commit e79cf8892e332b9dafc99aef02189a2897eced24 Author: Jan Kara Date: Thu May 19 12:52:31 2022 +0200 bfq: Remove superfluous conversion from RQ_BIC() We store struct bfq_io_cq pointer in rq->elv.priv[0] in bfq_init_rq(). Thus a call to icq_to_bic() in RQ_BIC() is wrong. Luckily it does no harm currently because struct io_iq is the first one in struct bfq_io_cq. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220519105235.31397-3-jack@suse.cz Signed-off-by: Jens Axboe commit c5ac56bb6110e42e79d3106866658376b2e48ab9 Author: Jan Kara Date: Thu May 19 12:52:30 2022 +0200 bfq: Allow current waker to defend against a tentative one The code in bfq_check_waker() ignores wake up events from the current waker. This makes it more likely we select a new tentative waker although the current one is generating more wake up events. Treat current waker the same way as any other process and allow it to reset the waker detection logic. Fixes: 71217df39dc6 ("block, bfq: make waker-queue detection more robust") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220519105235.31397-2-jack@suse.cz Signed-off-by: Jens Axboe commit f950667356ce90a41b446b726d4595a10cb65415 Author: Jan Kara Date: Thu May 19 12:52:29 2022 +0200 bfq: Relax waker detection for shared queues Currently we look for waker only if current queue has no requests. This makes sense for bfq queues with a single process however for shared queues when there is a larger number of processes the condition that queue has no requests is difficult to meet because often at least one process has some request in flight although all the others are waiting for the waker to do the work and this harms throughput. Relax the "no queued request for bfq queue" condition to "the current task has no queued requests yet". For this, we also need to start tracking number of requests in flight for each task. This patch (together with the following one) restores the performance for dbench with 128 clients that regressed with commit c65e6fd460b4 ("bfq: Do not let waker requests skip proper accounting") because this commit makes requests of wakers properly enter BFQ queues and thus these queues become ineligible for the old waker detection logic. Dbench results: Vanilla 5.18-rc3 5.18-rc3 + revert 5.18-rc3 patched Mean 1237.36 ( 0.00%) 950.16 * 23.21%* 988.35 * 20.12%* Numbers are time to complete workload so lower is better. Fixes: c65e6fd460b4 ("bfq: Do not let waker requests skip proper accounting") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220519105235.31397-1-jack@suse.cz Signed-off-by: Jens Axboe commit 4d8a768ef4ed80112ffaa13a677196faa9d651c3 Author: Marijn Suijten Date: Thu May 12 00:06:09 2022 +0200 pinctrl: qcom: spmi-gpio: Add pm6125 compatible The pm6125 has 9 GPIOs with no holes inbetween. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220511220613.1015472-4-marijn.suijten@somainline.org Signed-off-by: Linus Walleij commit f82a2c212d6ce1e776a3fc8af6ce951ed00842b0 Author: Marijn Suijten Date: Thu May 12 00:06:08 2022 +0200 dt-bindings: pinctrl: qcom-pmic-gpio: Add pm6125 compatible The pm6125 comes with 9 GPIOs, without holes. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220511220613.1015472-3-marijn.suijten@somainline.org Signed-off-by: Linus Walleij commit 5b3353949e89d48b4faf54a9cc241ee5d70df615 Author: Luca Miccio Date: Fri May 13 14:19:38 2022 -0700 xen: add support for initializing xenstore later as HVM domain When running as dom0less guest (HVM domain on ARM) the xenstore event channel is available at domain creation but the shared xenstore interface page only becomes available later on. In that case, wait for a notification on the xenstore event channel, then complete the xenstore initialization later, when the shared page is actually available. The xenstore page has few extra field. Add them to the shared struct. One of the field is "connection", when the connection is ready, it is zero. If the connection is not-zero, wait for a notification. Signed-off-by: Luca Miccio Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220513211938.719341-2-sstabellini@kernel.org Signed-off-by: Juergen Gross commit 62db0fafa8fc0f6c9f901e7eefdfc6bbd9731ec9 Author: Stefano Stabellini Date: Fri May 13 14:19:37 2022 -0700 xen: sync xs_wire.h header with upstream xen Sync the xs_wire.h header file in Linux with the one in Xen. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220513211938.719341-1-sstabellini@kernel.org Signed-off-by: Juergen Gross commit 1591a65f55bca5f7e14f9fbca4bd082dc8f4680f Author: Maximilian Heyne Date: Tue May 17 16:24:25 2022 +0000 x86: xen: remove STACK_FRAME_NON_STANDARD from xen_cpuid Since commit 4d65adfcd119 ("x86: xen: insn: Decode Xen and KVM emulate-prefix signature"), objtool is able to correctly parse the prefixed instruction in xen_cpuid and emit correct orc unwind information. Hence, marking the function as STACKFRAME_NON_STANDARD is no longer needed. This commit is basically a revert of commit 983bb6d254c7 ("x86/xen: Mark xen_cpuid() stack frame as non-standard"). Signed-off-by: Maximilian Heyne Reviewed-by: Juergen Gross CC: Josh Poimboeuf Link: https://lore.kernel.org/r/20220517162425.100567-1-mheyne@amazon.de Signed-off-by: Juergen Gross commit 12f112c3e3e573a833010ef2e4469295ac7b6e82 Author: SeongJae Park Date: Wed Apr 20 07:27:34 2022 +0000 xen-blk{back,front}: Update contact points for buffer_squeeze_duration_ms and feature_persistent SeongJae is currently listed as a contact point for some blk{back,front} features, but he will not work for XEN for a while. This commit therefore updates the contact point to his colleague, Maximilian, who is understanding the context and actively working with the features now. Signed-off-by: SeongJae Park Signed-off-by: Maximilian Heyne Acked-by: Roger Pau Monné Link: https://lore.kernel.org/r/20220420072734.1692-1-sj@kernel.org Signed-off-by: Juergen Gross commit 68f4c6eba70df70a720188bce95c85570ddfcc87 Author: Zhihao Cheng Date: Tue May 10 21:38:05 2022 +0800 fs-writeback: writeback_sb_inodes:Recalculate 'wrote' according skipped pages Commit 505a666ee3fc ("writeback: plug writeback in wb_writeback() and writeback_inodes_wb()") has us holding a plug during wb_writeback, which may cause a potential ABBA dead lock: wb_writeback fat_file_fsync blk_start_plug(&plug) for (;;) { iter i-1: some reqs have been added into plug->mq_list // LOCK A iter i: progress = __writeback_inodes_wb(wb, work) . writeback_sb_inodes // fat's bdev . __writeback_single_inode . . generic_writepages . . __block_write_full_page . . . . __generic_file_fsync . . . . sync_inode_metadata . . . . writeback_single_inode . . . . __writeback_single_inode . . . . fat_write_inode . . . . __fat_write_inode . . . . sync_dirty_buffer // fat's bdev . . . . lock_buffer(bh) // LOCK B . . . . submit_bh . . . . blk_mq_get_tag // LOCK A . . . trylock_buffer(bh) // LOCK B . . . redirty_page_for_writepage . . . wbc->pages_skipped++ . . --wbc->nr_to_write . wrote += write_chunk - wbc.nr_to_write // wrote > 0 . requeue_inode . redirty_tail_locked if (progress) // progress > 0 continue; iter i+1: queue_io // similar process with iter i, infinite for-loop ! } blk_finish_plug(&plug) // flush plug won't be called Above process triggers a hungtask like: [ 399.044861] INFO: task bb:2607 blocked for more than 30 seconds. [ 399.046824] Not tainted 5.18.0-rc1-00005-gefae4d9eb6a2-dirty [ 399.051539] task:bb state:D stack: 0 pid: 2607 ppid: 2426 flags:0x00004000 [ 399.051556] Call Trace: [ 399.051570] __schedule+0x480/0x1050 [ 399.051592] schedule+0x92/0x1a0 [ 399.051602] io_schedule+0x22/0x50 [ 399.051613] blk_mq_get_tag+0x1d3/0x3c0 [ 399.051640] __blk_mq_alloc_requests+0x21d/0x3f0 [ 399.051657] blk_mq_submit_bio+0x68d/0xca0 [ 399.051674] __submit_bio+0x1b5/0x2d0 [ 399.051708] submit_bio_noacct+0x34e/0x720 [ 399.051718] submit_bio+0x3b/0x150 [ 399.051725] submit_bh_wbc+0x161/0x230 [ 399.051734] __sync_dirty_buffer+0xd1/0x420 [ 399.051744] sync_dirty_buffer+0x17/0x20 [ 399.051750] __fat_write_inode+0x289/0x310 [ 399.051766] fat_write_inode+0x2a/0xa0 [ 399.051783] __writeback_single_inode+0x53c/0x6f0 [ 399.051795] writeback_single_inode+0x145/0x200 [ 399.051803] sync_inode_metadata+0x45/0x70 [ 399.051856] __generic_file_fsync+0xa3/0x150 [ 399.051880] fat_file_fsync+0x1d/0x80 [ 399.051895] vfs_fsync_range+0x40/0xb0 [ 399.051929] __x64_sys_fsync+0x18/0x30 In my test, 'need_resched()' (which is imported by 590dca3a71 "fs-writeback: unplug before cond_resched in writeback_sb_inodes") in function 'writeback_sb_inodes()' seldom comes true, unless cond_resched() is deleted from write_cache_pages(). Fix it by correcting wrote number according number of skipped pages in writeback_sb_inodes(). Goto Link to find a reproducer. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215837 Cc: stable@vger.kernel.org # v4.3 Signed-off-by: Zhihao Cheng Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220510133805.1988292-1-chengzhihao1@huawei.com Signed-off-by: Jens Axboe commit 4573240f0764ee79d7558d74fc535baa1e110d20 Author: Juergen Gross Date: Thu Apr 28 09:01:05 2022 +0200 xen/xenbus: eliminate xenbus_grant_ring() There is no external user of xenbus_grant_ring() left, so merge it into the only caller xenbus_setup_ring(). Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 360dc89d12404384519b43e4a5ad5e94f2c8394f Author: Juergen Gross Date: Thu Apr 28 09:01:05 2022 +0200 xen/sndfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify sndfront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Signed-off-by: Juergen Gross commit 2b3daf083aa8297c737c8cd8f896596d509ead35 Author: Juergen Gross Date: Thu Apr 28 09:01:05 2022 +0200 xen/usbfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify xen-hcd's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Acked-by: Greg Kroah-Hartman Signed-off-by: Juergen Gross commit caa427d252031e2f97228a474ff320fdc54171af Author: Juergen Gross Date: Thu Apr 28 09:01:04 2022 +0200 xen/scsifront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify scsifront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 0e6b139dbda9e11fefa84c3e4a3e24dd9dc55bcb Author: Juergen Gross Date: Thu Apr 28 09:01:04 2022 +0200 xen/pcifront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify pcifront's shared page creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit ae19265ca3eeb6cd8098773da2514ed53a6bd350 Author: Juergen Gross Date: Thu Apr 28 09:01:04 2022 +0200 xen/drmfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify drmfront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Signed-off-by: Juergen Gross commit 5e0afd8eab96486c13194fa9cbcf5fe320ac8d6b Author: Juergen Gross Date: Thu Apr 28 09:01:04 2022 +0200 xen/tpmfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify tpmfront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(), which are provided exactly for the use pattern as seen in this driver. Signed-off-by: Juergen Gross commit 46e20d43f579f39677835bf8e72c95182b3b4016 Author: Juergen Gross Date: Thu Apr 28 09:01:03 2022 +0200 xen/netfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify netfront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 47cbd5983347d41b1c41a632b1e45a660a351c68 Author: Juergen Gross Date: Thu Apr 28 09:01:03 2022 +0200 xen/blkfront: use xenbus_setup_ring() and xenbus_teardown_ring() Simplify blkfront's ring creation and removal via xenbus_setup_ring() and xenbus_teardown_ring(). Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Acked-by: Roger Pau Monné Signed-off-by: Juergen Gross commit 7050096d07755c53f71e486af18475050cc4e04b Author: Juergen Gross Date: Thu Apr 28 09:01:03 2022 +0200 xen/xenbus: add xenbus_setup_ring() service function Most PV device frontends share very similar code for setting up shared ring buffers: - allocate page(s) - init the ring admin data - give the backend access to the ring via grants Tearing down the ring requires similar actions in all frontends again: - remove grants - free the page(s) Provide service functions xenbus_setup_ring() and xenbus_teardown_ring() for that purpose. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 6fac592cca60dca0b2a524c303c83e958c2003bb Author: Juergen Gross Date: Thu Apr 28 09:59:01 2022 +0200 xen: update ring.h Update include/xen/interface/io/ring.h to its newest version. Switch the two improper use cases of RING_HAS_UNCONSUMED_RESPONSES() to XEN_RING_NR_UNCONSUMED_RESPONSES() in order to avoid the nasty XEN_RING_HAS_UNCONSUMED_IS_BOOL #define. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 888fd787f30dfe959fdd685c422187a428d2cf17 Author: Juergen Gross Date: Thu Apr 28 09:01:03 2022 +0200 xen/shbuf: switch xen-front-pgdir-shbuf to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Signed-off-by: Juergen Gross commit bd506c781207a52b0e212818d312d22e64db5cff Author: Juergen Gross Date: Thu Apr 28 09:01:03 2022 +0200 xen/dmabuf: switch gntdev-dmabuf to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 297ce02669676517d2bfaa57995007b989d88524 Author: Juergen Gross Date: Thu Apr 28 09:01:02 2022 +0200 xen/sound: switch xen_snd_front to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Signed-off-by: Juergen Gross commit cb5216319be122c671f2c86633b6fc47f4d7fa02 Author: Juergen Gross Date: Thu Apr 28 09:01:02 2022 +0200 xen/drm: switch xen_drm_front to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Tested-by: Oleksandr Tyshchenko # Arm64 only Signed-off-by: Juergen Gross commit edd81e7caa77a2772bb9ddb8562e2d45aeed2cc1 Author: Juergen Gross Date: Thu Apr 28 09:01:02 2022 +0200 xen/usb: switch xen-hcd to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Acked-by: Greg Kroah-Hartman Signed-off-by: Juergen Gross commit 70920be6ff0d7abe92311a678cb6c84fcec658ca Author: Juergen Gross Date: Thu Apr 28 09:01:02 2022 +0200 xen/scsifront: remove unused GRANT_INVALID_REF definition GRANT_INVALID_REF isn't used in scsifront, so remove it. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 145daab239a1a8e3fe4d7ed0f5d2ad651219d54d Author: Juergen Gross Date: Thu Apr 28 09:01:01 2022 +0200 xen/netfront: switch netfront to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 21b539711a404da1b23d6ebddd9c3c321ccdfe49 Author: Juergen Gross Date: Thu Apr 28 09:01:01 2022 +0200 xen/blkfront: switch blkfront to use INVALID_GRANT_REF Instead of using a private macro for an invalid grant reference use the common one. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Acked-by: Roger Pau Monné Signed-off-by: Juergen Gross commit 8c9eb0e3731d7140abc77cd80aeeeea8c2ff325e Author: Juergen Gross Date: Thu May 5 08:35:31 2022 +0200 xen/grant-table: never put a reserved grant on the free list Make sure a reserved grant is never put on the free list, as this could cause hard to debug errors. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 79c22318f89f3e6cafeabddd5894cad13c7e5957 Author: Juergen Gross Date: Thu May 5 08:49:52 2022 +0200 xen: update grant_table.h Update include/xen/interface/grant_table.h to its newest version. This allows to drop some private definitions in grant-table.c and include/xen/grant_table.h. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross commit 6d1c2f48f3fcf5f42967938c8ba6b42ac6b44b43 Author: Juergen Gross Date: Thu Apr 28 09:53:23 2022 +0200 xen/scsifront: harden driver against malicious backend Instead of relying on a well behaved PV scsi backend verify all meta data received from the backend and avoid multiple reads of the same data from the shared ring page. In case any illegal data from the backend is detected switch the PV device to a new "error" state and deactivate it for further use. Use the "lateeoi" variant for the event channel in order to avoid event storms blocking the guest. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220428075323.12853-5-jgross@suse.com Signed-off-by: Juergen Gross commit a2f6751d5af44d8c1cab93c2c410fd334c460339 Author: Juergen Gross Date: Thu Apr 28 09:53:22 2022 +0200 xen/scsifront: use new command result macros Add a translation layer for the command result values. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220428075323.12853-4-jgross@suse.com Signed-off-by: Juergen Gross commit 54aee68bb656ab0daf46c88423948dadd903a68e Author: Juergen Gross Date: Thu Apr 28 09:53:21 2022 +0200 xen/scsiback: use new command result macros Instead of using the kernel's values for the result of PV scsi operations use the values of the interface definition. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220428075323.12853-3-jgross@suse.com Signed-off-by: Juergen Gross commit 5ce9231c5b961596ebf948777c9c5a6981f067d9 Author: Juergen Gross Date: Thu Apr 28 09:53:20 2022 +0200 xen: update vscsiif.h Update include/xen/interface/io/vscsiif.h to its newest version. Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220428075323.12853-2-jgross@suse.com Signed-off-by: Juergen Gross commit aeb84412037b89e06f45e382f044da6f200e12f8 Author: Kees Cook Date: Sun Feb 27 11:59:18 2022 -0800 x86/boot: Wrap literal addresses in absolute_pointer() GCC 11 (incorrectly[1]) assumes that literal values cast to (void *) should be treated like a NULL pointer with an offset, and raises diagnostics when doing bounds checking under -Warray-bounds. GCC 12 got "smarter" about finding these: In function 'rdfs8', inlined from 'vga_recalc_vertical' at /srv/code/arch/x86/boot/video-mode.c:124:29, inlined from 'set_mode' at /srv/code/arch/x86/boot/video-mode.c:163:3: /srv/code/arch/x86/boot/boot.h:114:9: warning: array subscript 0 is outside array bounds of 'u8[0]' {aka 'unsigned char[]'} [-Warray-bounds] 114 | asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr)); | ^~~ This has been solved in other places[2] already by using the recently added absolute_pointer() macro. Do the same here. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 [2] https://lore.kernel.org/all/20210912160149.2227137-1-linux@roeck-us.net/ Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220227195918.705219-1-keescook@chromium.org commit c1318b39c7d36bd5139a9c71044ff2b2d3c6f9d8 Author: Boris Pismenny Date: Wed May 18 12:27:31 2022 +0300 tls: Add opt-in zerocopy mode of sendfile() TLS device offload copies sendfile data to a bounce buffer before transmitting. It allows to maintain the valid MAC on TLS records when the file contents change and a part of TLS record has to be retransmitted on TCP level. In many common use cases (like serving static files over HTTPS) the file contents are not changed on the fly. In many use cases breaking the connection is totally acceptable if the file is changed during transmission, because it would be received corrupted in any case. This commit allows to optimize performance for such use cases to providing a new optional mode of TLS sendfile(), in which the extra copy is skipped. Removing this copy improves performance significantly, as TLS and TCP sendfile perform the same operations, and the only overhead is TLS header/trailer insertion. The new mode can only be enabled with the new socket option named TLS_TX_ZEROCOPY_SENDFILE on per-socket basis. It preserves backwards compatibility with existing applications that rely on the copying behavior. The new mode is safe, meaning that unsolicited modifications of the file being sent can't break integrity of the kernel. The worst thing that can happen is sending a corrupted TLS record, which is in any case not forbidden when using regular TCP sockets. Sockets other than TLS device offload are not affected by the new socket option. The actual status of zerocopy sendfile can be queried with sock_diag. Performance numbers in a single-core test with 24 HTTPS streams on nginx, under 100% CPU load: * non-zerocopy: 33.6 Gbit/s * zerocopy: 79.92 Gbit/s CPU: Intel(R) Xeon(R) Platinum 8380 CPU @ 2.30GHz Signed-off-by: Boris Pismenny Signed-off-by: Tariq Toukan Signed-off-by: Maxim Mikityanskiy Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220518092731.1243494-1-maximmi@nvidia.com Signed-off-by: Paolo Abeni commit ffcb2fc86eb7ebc9f5524525fb57e1cccfbd1fc0 Author: Keerthy Date: Tue May 17 22:59:20 2022 +0530 thermal: k3_j72xx_bandgap: Add the bandgap driver support Add VTM thermal support. In the Voltage Thermal Management Module(VTM), K3 J72XX supplies a voltage reference and a temperature sensor feature that are gathered in the band gap voltage and temperature sensor (VBGAPTS) module. The band gap provides current and voltage reference for its internal circuits and other analog IP blocks. The analog-to-digital converter (ADC) produces an output value that is proportional to the silicon temperature. Currently reading temperatures only is supported. There are no active/passive cooling agent supported. J721e SoCs have errata i2128: https://www.ti.com/lit/pdf/sprz455 The VTM Temperature Monitors (TEMPSENSORs) are trimmed during production, with the resulting values stored in software-readable registers. Software should use these register values when translating the Temperature Monitor output codes to temperature values. It has an involved workaround. Software needs to read the error codes for -40C, 30C, 125C from the efuse for each device & derive a new look up table for adc to temperature conversion. Involved calculating slopes & constants using 3 different straight line equations with adc refernce codes as the y-axis & error codes in the x-axis. -40C to 30C 30C to 125C 125C to 150C With the above 2 line equations we derive the full look-up table to workaround the errata i2128 for j721e SoC. Tested temperature reading on J721e SoC & J7200 SoC. [daniel.lezcano@linaro.org: Generate look-up tables run-time] Signed-off-by: Daniel Lezcano Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20220517172920.10857-3-j-keerthy@ti.com Signed-off-by: Daniel Lezcano commit 031c2952d1588d47829da3639eaaa5e35ffe4e6e Author: Keerthy Date: Tue May 17 22:59:19 2022 +0530 dt-bindings: thermal: k3-j72xx: Add VTM bindings documentation Add VTM bindings documentation. In the Voltage Thermal Management Module(VTM), K3 J72XX supplies a voltage reference and a temperature sensor feature that are gathered in the band gap voltage and temperature sensor (VBGAPTS) module. The band gap provides current and voltage reference for its internal circuits and other analog IP blocks. The analog-to-digital converter (ADC) produces an output value that is proportional to the silicon temperature. Signed-off-by: Keerthy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220517172920.10857-2-j-keerthy@ti.com Signed-off-by: Daniel Lezcano commit 09700c504d8e63faffd2a2235074e8c5d130cb8f Author: Miaoqian Lin Date: Tue May 17 09:51:21 2022 +0400 thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe of_find_node_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: e20db70dba1c ("thermal: imx_sc: add i.MX system controller thermal support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220517055121.18092-1-linmq006@gmail.com Signed-off-by: Daniel Lezcano commit 98a160e898c0f4a979af9de3ab48b4b1d42d1dbb Author: Yang Yingliang Date: Wed May 11 10:06:05 2022 +0800 thermal/core: Fix memory leak in __thermal_cooling_device_register() I got memory leak as follows when doing fault injection test: unreferenced object 0xffff888010080000 (size 264312): comm "182", pid 102533, jiffies 4296434960 (age 10.100s) hex dump (first 32 bytes): 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... ff ff ff ff ff ff ff ff 40 7f 1f b9 ff ff ff ff ........@....... backtrace: [<0000000038b2f4fc>] kmalloc_order_trace+0x1d/0x110 mm/slab_common.c:969 [<00000000ebcb8da5>] __kmalloc+0x373/0x420 include/linux/slab.h:510 [<0000000084137f13>] thermal_cooling_device_setup_sysfs+0x15d/0x2d0 include/linux/slab.h:586 [<00000000352b8755>] __thermal_cooling_device_register+0x332/0xa60 drivers/thermal/thermal_core.c:927 [<00000000fb9f331b>] devm_thermal_of_cooling_device_register+0x6b/0xf0 drivers/thermal/thermal_core.c:1041 [<000000009b8012d2>] max6650_probe.cold+0x557/0x6aa drivers/hwmon/max6650.c:211 [<00000000da0b7e04>] i2c_device_probe+0x472/0xac0 drivers/i2c/i2c-core-base.c:561 If device_register() fails, thermal_cooling_device_destroy_sysfs() need be called to free the memory allocated in thermal_cooling_device_setup_sysfs(). Fixes: 8ea229511e06 ("thermal: Add cooling device's statistics in sysfs") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220511020605.3096734-1-yangyingliang@huawei.com Signed-off-by: Daniel Lezcano commit 30988d3b31b1e8972f202e93574978927b5c9d06 Author: Bjorn Andersson Date: Tue May 3 08:34:36 2022 -0700 dt-bindings: thermal: tsens: Add sc8280xp compatible The Qualcomm SC8280XP platform has three instances of the tsens block, add a compatible for these instances. Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503153436.960184-1-bjorn.andersson@linaro.org Signed-off-by: Daniel Lezcano commit b54d4dafc9fd97f1739eb06dd5a397ce69bbe00c Author: Bjorn Andersson Date: Mon May 2 09:45:04 2022 -0700 dt-bindings: thermal: lmh: Add Qualcomm sc8180x compatible Add compatible for the LMh blocks found in the Qualcomm sc8180x platform. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220502164504.3972938-2-bjorn.andersson@linaro.org Signed-off-by: Daniel Lezcano commit ef6673e8363a61ef941bae05c7913a32a104e20b Author: Bjorn Andersson Date: Mon May 2 09:45:03 2022 -0700 thermal/drivers/qcom/lmh: Add sc8180x compatible The LMh instances in the Qualcomm SC8180X platform looks to behave similar to those in SM8150, add additional compatibles to allow platform specific behavior to be added if needed. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220502164504.3972938-1-bjorn.andersson@linaro.org Signed-off-by: Daniel Lezcano commit 2d37f5c90bdc659b329dac7cf6d165a4bbf34cb6 Author: Biju Das Date: Thu Apr 28 10:33:46 2022 +0100 thermal/drivers/rz2gl: Fix OTP Calibration Register values As per the latest RZ/G2L Hardware User's Manual (Rev.1.10 Apr, 2022), the bit 31 of TSU OTP Calibration Register(OTPTSUTRIM) indicates whether bit [11:0] of OTPTSUTRIM is valid or invalid. This patch updates the code to reflect this change. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220428093346.7552-1-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit e126ce0bcc082382497219c323e1b941583c9036 Author: Biju Das Date: Sun May 1 09:19:30 2022 +0100 dt-bindings: thermal: rzg2l-thermal: Document RZ/G2UL bindings Document RZ/G2UL TSU bindings. The TSU block on RZ/G2UL is identical to one found on RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-tsu" will be used as a fallback. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220501081930.23743-1-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 44b965d8c44e8e86a43e11fc46adfc60da540c77 Author: Corentin Labbe Date: Tue Apr 26 06:41:13 2022 +0000 thermal: thermal_of: fix typo on __thermal_bind_params Add a missing s to __thermal_bind_param kernel doc comment. This fixes the following sparse warnings: drivers/thermal/thermal_of.c:50: warning: expecting prototype for struct __thermal_bind_param. Prototype was for struct __thermal_bind_params instead Signed-off-by: Corentin Labbe Link: https://lore.kernel.org/r/20220426064113.3787826-1-clabbe@baylibre.com Signed-off-by: Daniel Lezcano commit cb4487d2b4043bbe98f60f2628387b40fa4896f8 Author: Jiapeng Chong Date: Wed Apr 27 11:06:19 2022 +0800 tools/thermal: remove unneeded semicolon Fix the following coccicheck warnings: ./tools/thermal/thermometer/thermometer.c:147:3-4: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220427030619.81556-2-jiapeng.chong@linux.alibaba.com Signed-off-by: Daniel Lezcano commit f21b57eb12bfe0d38794145f976ca8127d8846db Author: Jiapeng Chong Date: Wed Apr 27 11:06:18 2022 +0800 tools/lib/thermal: remove unneeded semicolon Fix the following coccicheck warnings: ./tools/lib/thermal/commands.c:215:2-3: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220427030619.81556-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Daniel Lezcano commit e20d136ec7d6f309989c447638365840d3424c8e Author: Zheng Yongjun Date: Mon Apr 25 09:29:29 2022 +0000 thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe platform_get_resource() may return NULL, add proper check to avoid potential NULL dereferencing. Fixes: 250e211057c72 ("thermal: broadcom: Add Stingray thermal driver") Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220425092929.90412-1-zhengyongjun3@huawei.com Signed-off-by: Daniel Lezcano commit 077df623c8344e4b50a7ba6c433f9d6857a94d6b Author: Daniel Lezcano Date: Wed Apr 20 18:09:32 2022 +0200 tools/thermal: Add thermal daemon skeleton This change provides a simple daemon skeleton. It is an example of how to use the thermal library which wraps all the complex code related to the netlink and transforms it into a callback oriented code. The goal of this skeleton is to give a base brick for anyone interested in writing its own thermal engine or as an example to rely on to write its own thermal monitoring implementation. In the future, it will evolve with more features and hopefully more logic. Signed-off-by: Daniel Lezcano Tested-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220420160933.347088-5-daniel.lezcano@linaro.org commit 110acbc6a4518145db3a1a9c0686d730bb258bf1 Author: Daniel Lezcano Date: Wed Apr 20 18:09:31 2022 +0200 tools/thermal: Add a temperature capture tool The 'thermometer' tool allows to capture the temperature of a set of thermal zones defined in a configuration file at a specified rate. It is designed to have the lowest possible overhead. It will write the captured temperature per thermal zone per file so making easier to write a gnuplot script. Signed-off-by: Daniel Lezcano Tested-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220420160933.347088-4-daniel.lezcano@linaro.org commit 3b7c5e8adf9ca64f8dd70279076de085ea6369d7 Author: Daniel Lezcano Date: Wed Apr 20 18:09:30 2022 +0200 tools/thermal: Add util library The next changes will provide a couple of tools using some common functions provided by this library. It provides basic wrappers for: - mainloop - logging - timestamp Signed-off-by: Daniel Lezcano Tested-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220420160933.347088-3-daniel.lezcano@linaro.org commit 47c4b0de080adc125526aa80221c4e3ffbf97b6d Author: Daniel Lezcano Date: Wed Apr 20 18:09:29 2022 +0200 tools/lib/thermal: Add a thermal library The thermal framework implements a netlink notification mechanism to be used by the userspace to have a thermal configuration discovery, trip point changes or violation, cooling device changes notifications, etc... This library provides a level of abstraction for the thermal netlink notification allowing the userspace to connect to the notification mechanism more easily. The library is callback oriented. Signed-off-by: Daniel Lezcano Tested-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220420160933.347088-2-daniel.lezcano@linaro.org commit bf70c577516b8d9fbe703371aa98bbea13661cec Author: Manaf Meethalavalappu Pallikunhi Date: Wed Mar 9 00:56:26 2022 +0530 thermal/drivers/thermal_of: Add change_mode ops support for thermal_of sensor The sensor driver which register through thermal_of interface doesn't have an option to get thermal zone mode change notification from thermal core. Add support for change_mode ops in thermal_of interface so that sensor driver can use this ops for mode change notification. Signed-off-by: Manaf Meethalavalappu Pallikunhi Link: https://lore.kernel.org/r/1646767586-31908-1-git-send-email-quic_manafm@quicinc.com Signed-off-by: Daniel Lezcano commit 106e0121e243de4da7d634338089a68a8da2abe9 Author: Stefan Wahren Date: Tue Apr 12 21:54:23 2022 +0200 thermal/drivers/bcm2711: Don't clamp temperature at zero The thermal sensor on BCM2711 is capable of negative temperatures, so don't clamp the measurements at zero. Since this was the only use for variable t, drop it. This change based on a patch by Dom Cobley, who also tested the fix. Fixes: 59b781352dc4 ("thermal: Add BCM2711 thermal driver") Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220412195423.104511-1-stefan.wahren@i2se.com Signed-off-by: Daniel Lezcano commit 2caf73969de6675318a711d0622406c8c66afc03 Author: Dmitry Baryshkov Date: Wed Apr 6 03:26:46 2022 +0300 thermal/drivers/tsens: Add compat string for the qcom,msm8960 On apq8064 (msm8960) platforms the tsens device is created manually by the gcc driver. Prepare the tsens driver for the qcom,msm8960-tsens device instantiated from the device tree. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220406002648.393486-3-dmitry.baryshkov@linaro.org Signed-off-by: Daniel Lezcano commit a63fa2b601f10fe6a393504a4959ddb04acdc91b Author: Dmitry Baryshkov Date: Wed Apr 6 03:26:45 2022 +0300 dt-bindings: thermal: qcom-tsens.yaml: add msm8960 compat string Add compatibility string for the thermal sensors on MSM8960/APQ8064 platforms. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220406002648.393486-2-dmitry.baryshkov@linaro.org Signed-off-by: Daniel Lezcano commit 9e5f5f15fef5efd6847b8802e509b67fce72e2fb Author: Massimiliano Minella Date: Fri Apr 1 17:13:51 2022 +0200 thermal/drivers/k3: Add hwmon support Expose the thermal sensors on K3 AM654 as hwmon devices, so that temperatures could be read using lm-sensors. Signed-off-by: Massimiliano Minella Link: https://lore.kernel.org/r/20220401151656.913166-1-massimiliano.minella@se.com Signed-off-by: Daniel Lezcano commit 96f6f333bcf082756a01a7dc5cc7d4898e11b31b Author: Jishnu Prakash Date: Sun Apr 3 18:47:49 2022 +0530 thermal/drivers/qcom: Add support for PMIC5 Gen2 ADCTM Add support for PMIC5 Gen2 ADC_TM, used on PMIC7 chips. It is a close counterpart of PMIC7 ADC and has the same functionality as PMIC5 ADC_TM, for threshold monitoring and interrupt generation. It is present on PMK8350 alone, like PMIC7 ADC and can be used to monitor up to 8 ADC channels, from any of the PMIC7 PMICs having ADC on a target, through PBS(Programmable Boot Sequence). Signed-off-by: Jishnu Prakash Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/1648991869-20899-5-git-send-email-quic_jprakash@quicinc.com Signed-off-by: Daniel Lezcano commit 7e70a89a3a08c515fe7e64ef3200d31faaf8d5ac Author: Jishnu Prakash Date: Sun Apr 3 18:47:48 2022 +0530 thermal/drivers/qcom: Add support for multiple generations of devices Refactor code to support multiple generations of ADC_TM devices by defining gen number, irq name and disable, configure, isr and init APIs in the individual data structs. Signed-off-by: Jishnu Prakash Reviewed-by: Jonathan Cameron Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1648991869-20899-4-git-send-email-quic_jprakash@quicinc.com Signed-off-by: Daniel Lezcano commit 238e34ad7d5ce36939ac1442c98c7cbb7771f4de Author: Jishnu Prakash Date: Sun Apr 3 18:47:47 2022 +0530 iio: adc: qcom-vadc-common: add reverse scaling for PMIC5 Gen2 ADC_TM Add reverse scaling function for PMIC5 Gen2 ADC_TM, to convert temperature to raw ADC code, for setting thresholds for thermistor channels. Signed-off-by: Jishnu Prakash Acked-by: Jonathan Cameron Link: https://lore.kernel.org/r/1648991869-20899-3-git-send-email-quic_jprakash@quicinc.com Signed-off-by: Daniel Lezcano commit e46e003a4897385886f932013673ecfd317c8156 Author: Jishnu Prakash Date: Sun Apr 3 18:47:46 2022 +0530 dt-bindings: thermal: qcom: add PMIC5 Gen2 ADC_TM bindings Add documentation for PMIC5 Gen2 ADC_TM peripheral. It is used for monitoring ADC channel thresholds for PMIC7-type PMICs. It is present on PMK8350, like PMIC7 ADC and can be used to monitor up to 8 ADC channels, from any of the PMIC7 PMICs on a target, through PBS(Programmable Boot Sequence). Signed-off-by: Jishnu Prakash Reviewed-by: Jonathan Cameron Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1648991869-20899-2-git-send-email-quic_jprakash@quicinc.com Signed-off-by: Daniel Lezcano commit 3277e022a1c31f5041753942b3d9006174ca7aa2 Author: Lad Prabhakar Date: Mon Jan 10 14:40:39 2022 +0000 thermal/drivers/rcar_thermal: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220110144039.5810-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit feef7f32521eb169d7bcbb80291fc78bd39edb97 Author: Lad Prabhakar Date: Tue Mar 8 21:23:15 2022 +0000 dt-bindings: thermal: rzg2l-thermal: Document RZ/V2L bindings Document RZ/V2L TSU bindings. The TSU block on RZ/V2L is identical to one found on RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-tsu" will be used as a fallback. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220308212315.4551-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Daniel Lezcano commit b520cbe5be37b1b9b401c0b6ecbdae32575273db Author: Miaoqian Lin Date: Sun Apr 3 05:49:12 2022 +0000 rtc: ftrtc010: Fix error handling in ftrtc010_rtc_probe In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call , as already done in the remove function. clk_disable_unprepare calls clk_disable() and clk_unprepare(). They will use IS_ERR_OR_NULL to check the argument. Fixes: ac05fba39cc5 ("rtc: gemini: Add optional clock handling") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220403054912.31739-1-linmq006@gmail.com commit d3b43eb505bffb8e4cdf6800c15660c001553fe6 Author: Yang Yingliang Date: Thu May 5 20:50:43 2022 +0800 rtc: mt6397: check return value after calling platform_get_resource() It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver") Signed-off-by: Yang Yingliang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220505125043.1594771-1-yangyingliang@huawei.com commit 069617295650ec2ba27a8f22da10056d3e1160b3 Author: Borislav Petkov Date: Wed May 18 14:33:15 2022 +0300 drm/i915/uc: Fix undefined behavior due to shift overflowing the constant Fix: In file included from :0:0: drivers/gpu/drm/i915/gt/uc/intel_guc.c: In function ‘intel_guc_send_mmio’: ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_1047’ \ declared with attribute error: FIELD_PREP: mask is not constant _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) and other build errors due to shift overflowing values. See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. v2 by Jani: - Drop the i915_reg.h changes Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Ruiqi GONG Cc: Randy Dunlap Signed-off-by: Borislav Petkov Signed-off-by: Jani Nikula Reviewed-by: Michal Wajdeczko Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-2-jani.nikula@intel.com (cherry picked from commit 962bd34bb457f6353f333ce234c3fd34cad1c00a) commit 416e07a84f6ed883e0abd68c2fb868c80eea887b Author: Jani Nikula Date: Wed May 18 14:33:14 2022 +0300 drm/i915/reg: fix undefined behavior due to shift overflowing the constant Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to -fsanitize=shift. References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de Reported-by: Borislav Petkov Reported-by: Ruiqi GONG Cc: Randy Dunlap Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-1-jani.nikula@intel.com (cherry picked from commit 230fb39ff7e07bd0324c87acf08dd2c9b0bbcea8) commit 183f815d426b22c4424958403b096aebf3b060ca Author: Andi Shyti Date: Tue May 10 16:04:47 2022 +0200 drm/i915/gt: Fix use of static in macro mismatch The INTEL_GT_RPS_SYSFS_ATTR was creating to different structures but. When called with the "static" keyword this is affecting only the first structure, while the second is created as non static. Move the static keyword inside the macros to affect both the structures. Reported-by: Jani Nikula Fixes: 56a709cf77468 ("drm/i915/gt: Create per-tile RPS sysfs interfaces") Signed-off-by: Andi Shyti Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220510140447.80200-1-andi.shyti@linux.intel.com (cherry picked from commit 1ade30812abfdd1c161a155fd54b0dd594c217ee) Signed-off-by: Jani Nikula commit d91e9be0f0b05fd4df783d18d090c78ebd99f153 Author: Jani Nikula Date: Thu May 12 19:16:38 2022 +0300 drm/i915/audio: fix audio code enable/disable pipe logging Need to use pipe_name(pipe) instead of pipe directly. Fixes: 1f31e35f2e88 ("drm/i915/audio: unify audio codec enable/disable debug logging") Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220512161638.272601-1-jani.nikula@intel.com (cherry picked from commit 945ae909aa76f55ac8c9e95feb3683512d39134a) commit e43d940f480b69ab98dd5d14e9fefdef8851db1a Author: Yinjun Zhang Date: Wed May 18 09:50:55 2022 +0200 nfp: flower: support ct merging when mangle action exists Current implementation of ct merging doesn't support the case that the fields mangling in pre_ct rules are matched in post_ct rules. This change is to support merging when mangling mac address, ip address, tos, ttl and l4 port. VLAN and MPLS mangling is not involved yet. Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220518075055.130649-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit b885aab3d39d1c81709e957324c7fb9aeac02c38 Author: Michael Trimarchi Date: Wed May 18 08:20:07 2022 +0200 net: fec: Avoid allocating rx buffer using ATOMIC in ndo_open Make ndo_open less sensitive to memory pressure. Signed-off-by: Michael Trimarchi Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220518062007.10056-1-michael@amarulasolutions.com Signed-off-by: Paolo Abeni commit d87ad457f7e1b8d2492ca5b1531eb35030a1cc8f Author: Yang Yingliang Date: Fri May 13 18:05:41 2022 +0800 video: fbdev: pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() In pxa3xx_gcu_probe(), the sequence of error lable is wrong, it will leads some resource leaked, so adjust the sequence to handle the error correctly, and if pxa3xx_gcu_add_buffer() fails, pxa3xx_gcu_free_buffers() need be called. In pxa3xx_gcu_remove(), add missing clk_disable_unpreprare(). Signed-off-by: Yang Yingliang Signed-off-by: Helge Deller commit e60e8a73235ce5d42a2891c6989e8df1c8888c4a Author: Yang Li Date: Thu May 19 07:24:45 2022 +0800 rtc: rzn1: fix platform_no_drv_owner.cocci warning Remove .owner field if calls are used which set it automatically. ./drivers/rtc/rtc-rzn1.c:411:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220518232445.79156-1-yang.lee@linux.alibaba.com commit 40189b7368e509b21cf68f8a6c1aa6c6cdb01561 Author: Minghao Chi Date: Fri Apr 29 05:51:12 2022 +0000 video: fbdev: omapfb: simplify the return expression of nec_8048_connect() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Helge Deller commit b93a85c145d9c745ae74ad43046e75bbf98adc12 Author: Minghao Chi Date: Fri Apr 29 05:47:51 2022 +0000 video: fbdev: omapfb: simplify the return expression of dsi_init_pll_data() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Helge Deller commit b23789a59fa6f00e98a319291819f91fbba0deb8 Author: Miaoqian Lin Date: Thu May 12 15:59:08 2022 +0400 video: fbdev: clcdfb: Fix refcount leak in clcdfb_of_vram_setup of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: d10715be03bd ("video: ARM CLCD: Add DT support") Signed-off-by: Miaoqian Lin Signed-off-by: Helge Deller commit 58606220a2f1407a7516c547f09a1ba7b4350a73 Author: Nathan Chancellor Date: Fri May 13 08:51:36 2022 +0100 drm/i915: Fix CFI violation with show_dynamic_id() When an attribute group is created with sysfs_create_group(), the ->sysfs_ops() callback is set to kobj_sysfs_ops, which sets the ->show() callback to kobj_attr_show(). kobj_attr_show() uses container_of() to get the ->show() callback from the attribute it was passed, meaning the ->show() callback needs to be the same type as the ->show() callback in 'struct kobj_attribute'. However, show_dynamic_id() has the type of the ->show() callback in 'struct device_attribute', which causes a CFI violation when opening the 'id' sysfs node under drm/card0/metrics. This happens to work because the layout of 'struct kobj_attribute' and 'struct device_attribute' are the same, so the container_of() cast happens to allow the ->show() callback to still work. Change the type of show_dynamic_id() to match the ->show() callback in 'struct kobj_attributes' and update the type of sysfs_metric_id to match, which resolves the CFI violation. Fixes: f89823c21224 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface") Signed-off-by: Nathan Chancellor Reviewed-by: Kees Cook Reviewed-by: Sami Tolvanen Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220513075136.1027007-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 18fb42db05a0b93ab5dd5eab5315e50eaa3ca620) Signed-off-by: Jani Nikula commit 61e00044c674ef6831b366750c8516665cf0e810 Author: Imre Deak Date: Tue May 10 14:49:57 2022 +0300 drm/i915: Fix 'mixing different enum types' warnings in intel_display_power.c Fix the following sparse warnings: drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: warning: mixing different enum types: drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: unsigned int enum intel_display_power_domain drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: int enum port drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: warning: mixing different enum types: drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: unsigned int enum intel_display_power_domain drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: int enum port drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: warning: mixing different enum types: drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum intel_display_power_domain drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum aux_ch drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: warning: mixing different enum types: drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum intel_display_power_domain drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum aux_ch Fixes: 979e1b32e0e2 ("drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform") Reported-by: Jani Nikula Cc: Jouni Högander Signed-off-by: Imre Deak Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220510114957.406070-1-imre.deak@intel.com (cherry picked from commit 7ecc3cc8a7b39f08eee9aea7b718187583342a70) Signed-off-by: Jani Nikula commit 43ab20c599f4dc4c3972a8386ef4ca3943b5f9cd Author: YueHaibing Date: Fri May 6 11:26:52 2022 +0800 drm/i915/gt: Fix build error without CONFIG_PM drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c: In function ‘act_freq_mhz_show’: drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c:276:20: error: implicit declaration of function ‘sysfs_gt_attribute_r_max_func’ [-Werror=implicit-function-declaration] 276 | u32 actual_freq = sysfs_gt_attribute_r_max_func(dev, attr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Move sysfs_gt_attribute_* macros out of #ifdef block to fix this. Fixes: 56a709cf7746 ("drm/i915/gt: Create per-tile RPS sysfs interfaces") Signed-off-by: YueHaibing Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220506032652.1856-1-yuehaibing@huawei.com (cherry picked from commit 09708b6d82ef473de91c49d90f35e38b0db463f5) Signed-off-by: Jani Nikula commit c4b4d7047f16a8d138ce76da65faefb7165736f2 Author: Saurabh Sengar Date: Wed Apr 27 06:47:53 2022 -0700 video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1 This patch fixes a bug where GEN1 VMs doesn't allow resolutions greater than 64 MB size (eg 7680x4320). Unnecessary PCI check limits Gen1 VRAM to legacy PCI BAR size only (ie 64MB). Thus any, resolution requesting greater then 64MB (eg 7680x4320) would fail. MMIO region assigning this memory shouldn't be limited by PCI bar size. Signed-off-by: Saurabh Sengar Reviewed-by: Dexuan Cui Signed-off-by: Helge Deller commit 47f33de4aafb2f5e43d480d590a939d0f1d566a9 Author: Lai Jiangshan Date: Tue Apr 12 20:49:08 2022 +0800 x86/sev: Mark the code returning to user space as syscall gap When returning to user space, %rsp is user-controlled value. If it is a SNP-guest and the hypervisor decides to mess with the code-page for this path while a CPU is executing it, a potential #VC could hit in the syscall return path and mislead the #VC handler. So make ip_within_syscall_gap() return true in this case. Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Acked-by: Joerg Roedel Link: https://lore.kernel.org/r/20220412124909.10467-1-jiangshanlai@gmail.com commit 3f68e69520d3d52d66a6ad872a75b7d8f2ea7665 Author: Sunil V L Date: Thu May 19 10:45:12 2022 +0530 riscv/efi_stub: Add support for RISCV_EFI_BOOT_PROTOCOL Add support for getting the boot hart ID from the Linux EFI stub using RISCV_EFI_BOOT_PROTOCOL. This method is preferred over the existing DT based approach since it works irrespective of DT or ACPI. The specification of the protocol is hosted at: https://github.com/riscv-non-isa/riscv-uefi Signed-off-by: Sunil V L Acked-by: Palmer Dabbelt Reviewed-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20220519051512.136724-2-sunilvl@ventanamicro.com [ardb: minor tweaks for coding style and whitespace] Signed-off-by: Ard Biesheuvel commit 8dc7aa0a7246ad0f718d91d09b4d48460508627b Author: Joel Stanley Date: Wed Mar 2 10:49:27 2022 +0800 ARM: dts: aspeed: ast2600-evb: Enable GFX device Enable the GFX device with a framebuffer memory region. Signed-off-by: Joel Stanley Signed-off-by: Tommy Haung Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220302024930.18758-3-tommy_huang@aspeedtech.com Signed-off-by: Joel Stanley commit 4fa40bfa255df35f8ea5e4e03d05a8e8b221a117 Author: Joel Stanley Date: Wed Mar 2 10:49:26 2022 +0800 ARM: dts: aspeed: Add GFX node to AST2600 The GFX device is present in the AST2600 SoC. Signed-off-by: Joel Stanley Signed-off-by: Tommy Haung Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220302024930.18758-2-tommy_huang@aspeedtech.com Signed-off-by: Joel Stanley commit 0ef77237c5243aa620528daeaad0ba92094b5720 Author: Howard Chiu Date: Tue Mar 29 03:24:10 2022 +0000 ARM: dts: aspeed: ast2600-evb: Enable virtual hub Enable Aspeed VHub for HID emulation Signed-off-by: Howard Chiu Link: https://lore.kernel.org/r/SG2PR06MB23155E8A6193118544A7DBF3E61E9@SG2PR06MB2315.apcprd06.prod.outlook.com Signed-off-by: Joel Stanley commit 08daf2c89186452b4986b8a5f014f6478fe7e769 Author: Howard Chiu Date: Tue Mar 29 03:24:03 2022 +0000 ARM: dts: aspeed: ast2600-evb: Enable video engine Enable video engine and reserve memory for it. Signed-off-by: Howard Chiu Link: https://lore.kernel.org/r/SG2PR06MB23159B914BF7EF937FEDD2B5E61E9@SG2PR06MB2315.apcprd06.prod.outlook.com Signed-off-by: Joel Stanley commit f6b67950047bc34f08c33132f5614525459fbe8e Author: Brandon Wyman Date: Thu Apr 21 21:36:38 2022 +0000 ARM: dts: aspeed: everest, rainier: Add power-ffs-sync-history GPIO The IBM Everest and Rainier systems have a GPIO line that goes to the power supplies. It has a dual function: 1) Fans Full Speed, and 2) Sync input history. Signed-off-by: Brandon Wyman Link: https://lore.kernel.org/r/20220421213638.1151193-1-bjwyman@gmail.com Signed-off-by: Joel Stanley commit 7b46aa7c008d2becd5df46c174d8cb4239e24659 Author: Graeme Gregory Date: Fri Mar 25 12:02:47 2022 -0700 ARM: dts: aspeed: Add Nuvia DC-SCM BMC Add initial version of device tree for Nuvia DC-SCM BMC which is equipped with Aspeed AST2600 BMC SoC. Signed-off-by: Graeme Gregory Signed-off-by: Jae Hyun Yoo Link: https://lore.kernel.org/r/20220325190247.468079-1-quic_jaehyoo@quicinc.com Signed-off-by: Joel Stanley commit 244839d0fe6f9d1317ae4f415447e86baf943e9c Author: Potin Lai Date: Mon Apr 18 17:48:27 2022 +0800 ARM: dts: aspeed: bletchley: add sample averaging for ADM1278 set number of sample averaging to 128 for both PWR_AVG and VI_AVG Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Link: https://lore.kernel.org/r/20220418094827.6185-1-potin.lai@quantatw.com Signed-off-by: Joel Stanley commit 8c9e3743877812b7721a506fac056e4a71e11b66 Author: Potin Lai Date: Mon May 9 23:11:18 2022 +0800 ARM: dts: aspeed: bletchley: add eeprom node on each sled Add eeprom (24c26) on each sled for storing sled fru information. Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-7-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit 9495c6d570600e275253036aa993735db8bd2451 Author: Potin Lai Date: Mon May 9 23:11:17 2022 +0800 ARM: dts: aspeed: bletchley: add pca9536 node on each sled Add an ioexp node on each sled baseed on DVT schematic, address at 0x41. P0: SLEDX_SWD_MUX P1: SLEDX_XRES_SWD_N P2: SLEDX_CLKREQ_N P3: SLEDX_PCIE_PWR_EN Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-6-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit 60280a214a41d896093daf162e7273338ebd396c Author: Potin Lai Date: Mon May 9 23:11:16 2022 +0800 ARM: dts: aspeed: bletchley: update gpio0 line names Update GPIO line names based on DVT schematic Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-5-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit 86ec3af52d91292a457247f3e48bacd5d587a9d6 Author: Potin Lai Date: Mon May 9 23:11:15 2022 +0800 ARM: dts: aspeed: bletchley: Enable mdio0 bus Enable mdio0 bus based on DVT schematic. TODO: Add Marvell 88E6191 Switch Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-4-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit cc82dc2673e5ba6065732bbead74a9cb8e19e6c9 Author: Potin Lai Date: Mon May 9 23:11:14 2022 +0800 ARM: dts: aspeed: bletchley: switch spi2 driver to aspeed-smc Due to DVT schematic has stable spi signal, switch back to aspeed-smc driver for improving performance. Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-3-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit ad0e053b5b97282f241b32f0896e6090efe0cacb Author: Potin Lai Date: Mon May 9 23:11:13 2022 +0800 ARM: dts: aspeed: bletchley: enable ehci0 device node Enable ehci0 node for USB2 host feature Signed-off-by: Potin Lai Reviewed-by: Patrick Williams Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220509151118.4899-2-potin.lai.pt@gmail.com Signed-off-by: Joel Stanley commit c9cb67c3a650ef880ddbfc5906e2b9f51726dd5c Author: Neal Liu Date: Wed May 18 14:20:42 2022 +0800 ARM: dts: aspeed: Add USB2.0 device controller node Add USB2.0 device controller(udc) node to device tree for AST2600. Signed-off-by: Neal Liu Link: https://lore.kernel.org/r/20220518062043.1075360-3-neal_liu@aspeedtech.com Signed-off-by: Joel Stanley commit 33b7af2f459df453feb0d44628d820c47fefe7a8 Author: Carl Yin(殷张成) Date: Thu May 19 02:34:43 2022 +0000 USB: serial: option: add Quectel BG95 modem The BG95 modem has 3 USB configurations that are configurable via the AT command AT+QCFGEXT="usbnet",["ecm"|"modem"|"rmnet"] which make the modem enumerate with the following interfaces, respectively: "modem": Diag + GNSS + Modem + Modem "ecm" : Diag + GNSS + Modem + ECM "rmnet": Diag + GNSS + Modem + QMI Don't support Full QMI messages (e.g WDS_START_NETWORK_INTERFACE) A detailed description of the USB configuration for each mode follows: +QCFGEXT: "usbnet","modem" -------------------------- T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0700 Rev= 0.00 S: Manufacturer=Quectel, Incorporated S: Product=Quectel LPWA Module S: SerialNumber=884328a2 C:* #Ifs= 4 Cfg#= 1 Atr=e0 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= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option 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=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +QCFGEXT: "usbnet","ecm" ------------------------ T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0700 Rev= 0.00 S: Manufacturer=Quectel, Incorporated S: Product=Quectel LPWA Module S: SerialNumber=884328a2 C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 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= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option 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=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms 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= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +QCFGEXT: "usbnet","rmnet" -------------------------- T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0700 Rev= 0.00 S: Manufacturer=Quectel, Incorporated S: Product=Quectel LPWA Module S: SerialNumber=884328a2 C:* #Ifs= 4 Cfg#= 1 Atr=e0 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= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option 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=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms 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=ff Prot=ff Driver=qmi_wwan E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Carl Yin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit d935053a62fa11d06c757c1725782e46e7e823db Author: Jakub Kicinski Date: Wed May 18 11:30:22 2022 -0700 net/mlx5: fix multiple definitions of mlx5_lag_mpesw_init / mlx5_lag_mpesw_cleanup static inline is needed in the header. Fixes: 94db33177819 ("net/mlx5: Support multiport eswitch mode") Acked-by: Saeed Mahameed Link: https://lore.kernel.org/r/20220518183022.2034373-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 00df0514ab13813655a6fbaba85425f8f4780be2 Merge: f8122500a039a 0223e516470aa Author: Dave Airlie Date: Thu May 19 14:09:46 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-05-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-05-18: amdgpu: - Misc code cleanups - Additional SMU 13.x enablement - Smartshift fixes - GFX11 fixes - Support for SMU 13.0.4 - SMU mutex fix - Suspend/resume fix amdkfd: - static checker fix - Doorbell/MMIO resource handling fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220518205621.5741-1-alexander.deucher@amd.com commit f3e5996218b6d81be5a503922793900dac3b1f99 Author: Tao Ren Date: Mon May 9 19:56:15 2022 +0200 ARM: dts: aspeed-g4: Set spi-max-frequency for all flashes Set "spi-max-frequency" to 50 MHz for all the flashes under the FMC controller to ensure the clock frequency is calculated correctly. Suggested-by: Cédric Le Goater Tested-by: Jae Hyun Yoo Signed-off-by: Tao Ren Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-11-clg@kaod.org Signed-off-by: Joel Stanley commit 4a92d02fce73af8e9932126dabd82a0c07e78290 Author: Cédric Le Goater Date: Mon May 9 19:56:14 2022 +0200 ARM: dts: aspeed: Enable Dual SPI RX transfers All these controllers support at least Dual SPI. Update the DTs. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-10-clg@kaod.org Signed-off-by: Joel Stanley commit 651b79e8c9e208e84e2cfb4291e262f87b97c333 Author: Cédric Le Goater Date: Mon May 9 19:56:06 2022 +0200 ARM: dts: aspeed: Adjust "reg" property of FMC/SPI controllers This is compatible with the current driver and addresses issues when running 'make dt_binding_check'. Cc: Chin-Ting Kuo Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-2-clg@kaod.org Signed-off-by: Joel Stanley commit 4d338ee40ba89e508c5d3e1b4af956af7cb5e12e Author: Howard Chiu Date: Fri Apr 1 06:59:06 2022 +0000 ARM: dts: aspeed: ast2600-evb: Enable RX delay for MAC0/MAC1 Since mac0/1 and mac2/3 are physically located on different die, they have different properties by nature, which is mac0/1 has smaller delay step. The property 'phy-mode' on ast2600 mac0 and mac1 is recommended to set to 'rgmii-rxid' which enables the RX interface delay from the PHY chip. Refer page 45 of SDK User Guide v08.00 https://github.com/AspeedTech-BMC/openbmc/releases/download/v08.00/SDK_User_Guide_v08.00.pdf Fixes: 2ca5646b5c2f ("ARM: dts: aspeed: Add AST2600 and EVB") Signed-off-by: Howard Chiu Link: https://lore.kernel.org/r/SG2PR06MB23152A548AAE81140B57DD69E6E09@SG2PR06MB2315.apcprd06.prod.outlook.com Signed-off-by: Joel Stanley commit 309ec443079b0c6fcfb93a62c2554a164ade3f3e Author: Saeed Mahameed Date: Tue May 17 23:58:20 2022 -0700 sfc: siena: Have a unique wrapper ifndef for efx channels header Both sfc/efx_channels.h and sfc/siena/efx_channels.h used the same wrapper #ifndef EFX_CHANNELS_H, this patch changes the siena define to be EFX_SIENA_CHANNELS_H to avoid build system confusion. This fixes the following build break: drivers/net/ethernet/sfc/ptp.c:2191:28: error: ‘efx_copy_channel’ undeclared here (not in a function); did you mean ‘efx_ptp_channel’? 2191 | .copy = efx_copy_channel, Fixes: 6e173d3b4af9 ("sfc: Copy shared files needed for Siena (part 1)") Signed-off-by: Saeed Mahameed Cc: Edward Cree Acked-by: Martin Habets Link: https://lore.kernel.org/r/20220518065820.131611-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit b465131b80540cfaa83ba11e775bc48a4b056836 Merge: 638c1152d50fa 3588c189e45aa Author: Jakub Kicinski Date: Wed May 18 20:04:21 2022 -0700 Merge branch 'octeon_ep-fix-the-error-handling-path-of-octep_request_irqs' Christophe says: ==================== octeon_ep: Fix the error handling path of octep_request_irqs() I send a small serie to ease review and because I'm sighly less confident with the 2nd patch. ==================== Link: https://lore.kernel.org/r/cover.1652819974.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 3588c189e45aac69aa0deeedfd0d5de364030f37 Author: Christophe JAILLET Date: Tue May 17 22:59:59 2022 +0200 octeon_ep: Fix irq releasing in the error handling path of octep_request_irqs() When taken, the error handling path does not undo correctly what has already been allocated. Introduce a new loop index, 'j', in order to simplify the error handling path and rewrite part of it. It is now written with the same logic and intermediate variables used when resources are allocated. This is much more straightforward. Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support") Signed-off-by: Christophe JAILLET Reviewed-by: Dan Carpenter Signed-off-by: Jakub Kicinski commit 4d3bf6fb533461227ea532024b050cc31461e025 Author: Christophe JAILLET Date: Tue May 17 22:59:51 2022 +0200 octeon_ep: Fix a memory leak in the error handling path of octep_request_irqs() 'oct->non_ioq_irq_names' is not freed in the error handling path of octep_request_irqs(). Add the missing kfree(). Fixes: 37d79d059606 ("octeon_ep: add Tx/Rx processing and interrupt support") Signed-off-by: Christophe JAILLET Acked-by: Veerasenareddy Burru Reviewed-by: Dan Carpenter Signed-off-by: Jakub Kicinski commit 638c1152d50facbf00b447037f62bb58577233e3 Merge: a3641ca416a3d 654cd22227e63 Author: Jakub Kicinski Date: Wed May 18 19:58:36 2022 -0700 Merge branch 'adin-add-support-for-clock-output' Josua Mayer says: ==================== adin: add support for clock output This patch series adds support for configuring the two clock outputs of adin 1200 and 1300 PHYs. Certain network controllers require an external reference clock which can be provided by the PHY. One of the replies to v1 was asking why the common clock framework isn't used. Currently no PHY driver has implemented providing a clock to the network controller. Instead they rely on vendor extensions to make the appropriate configuration. For example ar8035 uses qca,clk-out-frequency - this patchset aimed to replicate the same functionality. Finally the 125MHz free-running clock is enabled in the device-tree for SolidRun i.MX6 SoMs, to support revisions 1.9 and later, where the original phy has been replaced with an adin 1300. To avoid introducing new warning messages during boot for SoMs before rev 1.9, the status field of the new phy node is disabled by default, and will be enabled by U-Boot on demand. ==================== Link: https://lore.kernel.org/r/20220517085143.3749-1-josua@solid-run.com Signed-off-by: Jakub Kicinski commit 654cd22227e6394f17b2f7c10d9fa9130db193fe Author: Josua Mayer Date: Tue May 17 11:54:31 2022 +0300 ARM: dts: imx6qdl-sr-som: update phy configuration for som revision 1.9 Since SoM revision 1.9 the PHY has been replaced with an ADIN1300, add an entry for it next to the original. As Russell King pointed out, additional phy nodes cause warnings like: mdio_bus 2188000.ethernet-1: MDIO device at address 1 is missing To avoid this the new node has its status set to disabled. U-Boot will be modified to enable the appropriate phy node after probing. The existing ar8035 nodes have to stay enabled by default to avoid breaking existing systems when they update Linux only. Co-developed-by: Alvaro Karsz Signed-off-by: Alvaro Karsz Signed-off-by: Josua Mayer Signed-off-by: Jakub Kicinski commit ce3342161edcb9ccac60ed6964652d37de8788c8 Author: Josua Mayer Date: Tue May 17 11:54:30 2022 +0300 net: phy: adin: add support for clock output The ADIN1300 supports generating certain clocks on its GP_CLK pin, as well as providing the reference clock on CLK25_REF. Add support for selecting the clock via device-tree properties. Technically the phy also supports a recovered 125MHz clock for synchronous ethernet. SyncE should be configured dynamically at runtime, however Linux does not currently have a toggle for this, so support is explicitly omitted. Co-developed-by: Alvaro Karsz Signed-off-by: Alvaro Karsz Signed-off-by: Josua Mayer Signed-off-by: Jakub Kicinski commit 1f77204e11f8b9e5d77d65197a03b702c50ea29b Author: Josua Mayer Date: Tue May 17 11:54:29 2022 +0300 dt-bindings: net: adin: document phy clock output properties The ADIN1300 supports generating certain clocks on its GP_CLK pin, as well as providing the reference clock on CLK25_REF. Add DT properties to configure both pins. Technically the phy also supports a recovered 125MHz clock for synchronous ethernet. However SyncE should be configured dynamically at runtime, so it is explicitly omitted in this binding. Signed-off-by: Josua Mayer Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakub Kicinski commit 64b22a0da12adb571c01edd671ee43634ebd7e41 Author: Abhinav Kumar Date: Wed May 18 15:34:07 2022 -0700 drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path If there are errors while trying to enable the pm in the bind path, it will lead to unclocked access of hw revision register thereby crashing the device. This will not address why the pm_runtime_get_sync() fails but at the very least we should be able to prevent the crash by handling the error and bailing out earlier. changes in v2: - use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Abhinav Kumar Reviewed-by: Rob Clark Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/486721/ Link: https://lore.kernel.org/r/20220518223407.26147-1-quic_abhinavk@quicinc.com Signed-off-by: Abhinav Kumar commit e1fd35f5cdffea714f7a285a1eb68863c72acb4e Author: Chun-Jie Chen Date: Fri May 13 15:36:21 2022 +0800 clk: mediatek: use en_mask as a pure div_en_mask We no longer allow en_mask to be a combination of pll_en_bit and div_en_mask, so remove pll_en_bit(bit0) from en_mask to make en_mask a pure en_mask that only used for pll dividers. This commit continues the work done in commit 7cc4e1bbe300 ("clk: mediatek: Fix asymmetrical PLL enable and disable control") and commit f384c44754b7 ("clk: mediatek: Add configurable enable control to mtk_pll_data") to clean up en_mask(bit0) default setting. Signed-off-by: Chun-Jie Chen Reviewed-by: Chen-Yu Tsai Signed-off-by: Mandy Liu Link: https://lore.kernel.org/r/20220513073621.12923-1-mandyjh.liu@mediatek.com Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit e98839fb56ea2b5bdcea47128871df4a587fc181 Author: Aidan MacDonald Date: Tue Apr 12 13:27:50 2022 +0100 clk: ingenic-tcu: Fix missing TCU clock for X1000 SoCs The TCU clock gate on X1000 wasn't requested by the driver and could be gated automatically later on in boot, which prevents timers from running and breaks PWM. Add a workaround to support old device trees that don't specify the "tcu" clock gate. In this case the kernel will print a warning and attempt to continue without the clock, which is wrong, but it could work if "clk_ignore_unused" is in the kernel arguments. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220412122750.279058-3-aidanmacdonald.0x0@gmail.com Reviewed-by: Paul Cercueil Signed-off-by: Stephen Boyd commit 544e9ec70f9335b07498319a2dacc6732a73850b Author: Sam Shih Date: Mon May 9 17:09:39 2022 +0800 clk: mediatek: update compatible string for MT7986 ethsys Update compatible string of mt7986 ethsys clock driver to fit the devicetree bindings document. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20220509090939.845-2-sam.shih@mediatek.com Fixes: ec97d23c8e22 ("clk: mediatek: add mt7986 clock support") Signed-off-by: Stephen Boyd commit 70a1b25326dd77e145157ccf1a31c1948032eec4 Author: Hangbin Liu Date: Mon May 16 12:00:20 2022 +0800 selftests/bpf: Add missed ima_setup.sh in Makefile When build bpf test and install it to another folder, e.g. make -j10 install -C tools/testing/selftests/ TARGETS="bpf" \ SKIP_TARGETS="" INSTALL_PATH=/tmp/kselftests The ima_setup.sh is missed in target folder, which makes test_ima failed. Fix it by adding ima_setup.sh to TEST_PROGS_EXTENDED. Fixes: 34b82d3ac105 ("bpf: Add a selftest for bpf_ima_inode_hash") Signed-off-by: Hangbin Liu Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220516040020.653291-1-liuhangbin@gmail.com commit e7eaffce47b7db72b077630dbe836f0c4132496d Author: David Gow Date: Fri May 13 16:51:08 2022 +0800 kunit: tool: Use qemu-system-i386 for i386 runs We're currently using the x86_64 qemu for i386 builds. While this is not incorrect, it's probably more sensible to use the i386 one, which will at least fail properly if we accidentally were to build a 64-bit kernel. Signed-off-by: David Gow Tested-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit cf961a5e673223486daa5f958521f4049dce194b Author: Abhinav Kumar Date: Wed May 11 15:27:10 2022 -0700 drm/msm/dpu: add DRM_MODE_ROTATE_180 back to supported rotations DRM_MODE_ROTATE_180 was previously marked as supported even for devices not supporting inline rotation. This is true because the SSPPs can always flip the image. After inline rotation support changes, this bit was removed and kms_rotation_crc IGT test starts skipping now whereas it was previously passing. Restore DRM_MODE_ROTATE_180 bit to the supported rotations list. Fixes: dabfdd89eaa92 ("add inline rotation support for sc7280") Signed-off-by: Abhinav Kumar Tested-by: Jessica Zhang # Trogdor (SC8170) Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/485928/ Link: https://lore.kernel.org/r/20220511222710.22394-1-quic_abhinavk@quicinc.com Signed-off-by: Abhinav Kumar commit 577e2a9dfc8fba7938aaf75db63fae7e328cc3cb Author: Dmitry Baryshkov Date: Sat May 7 04:00:20 2022 +0300 drm/msm: don't free the IRQ if it was not requested As msm_drm_uninit() is called from the msm_drm_init() error path, additional care should be necessary as not to call the free_irq() for the IRQ that was not requested before (because an error occured earlier than the request_irq() call). This fixed the issue reported with the following backtrace: [ 8.571329] Trying to free already-free IRQ 187 [ 8.571339] WARNING: CPU: 0 PID: 76 at kernel/irq/manage.c:1895 free_irq+0x1e0/0x35c [ 8.588746] Modules linked in: pmic_glink pdr_interface fastrpc qrtr_smd snd_soc_hdmi_codec msm fsa4480 gpu_sched drm_dp_aux_bus qrtr i2c_qcom_geni crct10dif_ce qcom_stats qcom_q6v5_pas drm_display_helper gpi qcom_pil_info drm_kms_helper qcom_q6v5 qcom_sysmon qcom_common qcom_glink_smem qcom_rng mdt_loader qmi_helpers phy_qcom_qmp ufs_qcom typec qnoc_sm8350 socinfo rmtfs_mem fuse drm ipv6 [ 8.624154] CPU: 0 PID: 76 Comm: kworker/u16:2 Not tainted 5.18.0-rc5-next-20220506-00033-g6cee8cab6089-dirty #419 [ 8.624161] Hardware name: Qualcomm Technologies, Inc. SM8350 HDK (DT) [ 8.641496] Workqueue: events_unbound deferred_probe_work_func [ 8.647510] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 8.654681] pc : free_irq+0x1e0/0x35c [ 8.658454] lr : free_irq+0x1e0/0x35c [ 8.662228] sp : ffff800008ab3950 [ 8.665642] x29: ffff800008ab3950 x28: 0000000000000000 x27: ffff16350f56a700 [ 8.672994] x26: ffff1635025df080 x25: ffff16350251badc x24: ffff16350251bb90 [ 8.680343] x23: 0000000000000000 x22: 00000000000000bb x21: ffff16350e8f9800 [ 8.687690] x20: ffff16350251ba00 x19: ffff16350cbd5880 x18: ffffffffffffffff [ 8.695039] x17: 0000000000000000 x16: ffffa2dd12179434 x15: ffffa2dd1431d02d [ 8.702391] x14: 0000000000000000 x13: ffffa2dd1431d028 x12: 662d79646165726c [ 8.709740] x11: ffffa2dd13fd2438 x10: 000000000000000a x9 : 00000000000000bb [ 8.717111] x8 : ffffa2dd13fd23f0 x7 : ffff800008ab3750 x6 : 00000000fffff202 [ 8.724487] x5 : ffff16377e870a18 x4 : 00000000fffff202 x3 : ffff735a6ae1b000 [ 8.731851] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff1635015f8000 [ 8.739217] Call trace: [ 8.741755] free_irq+0x1e0/0x35c [ 8.745198] msm_drm_uninit.isra.0+0x14c/0x294 [msm] [ 8.750548] msm_drm_bind+0x28c/0x5d0 [msm] [ 8.755081] try_to_bring_up_aggregate_device+0x164/0x1d0 [ 8.760657] __component_add+0xa0/0x170 [ 8.764626] component_add+0x14/0x20 [ 8.768337] dp_display_probe+0x2a4/0x464 [msm] [ 8.773242] platform_probe+0x68/0xe0 [ 8.777043] really_probe.part.0+0x9c/0x28c [ 8.781368] __driver_probe_device+0x98/0x144 [ 8.785871] driver_probe_device+0x40/0x140 [ 8.790191] __device_attach_driver+0xb4/0x120 [ 8.794788] bus_for_each_drv+0x78/0xd0 [ 8.798751] __device_attach+0xdc/0x184 [ 8.802713] device_initial_probe+0x14/0x20 [ 8.807031] bus_probe_device+0x9c/0xa4 [ 8.810991] deferred_probe_work_func+0x88/0xc0 [ 8.815667] process_one_work+0x1d0/0x320 [ 8.819809] worker_thread+0x14c/0x444 [ 8.823688] kthread+0x10c/0x110 [ 8.827036] ret_from_fork+0x10/0x20 Reported-by: Bjorn Andersson Fixes: f026e431cf86 ("drm/msm: Convert to Linux IRQ interfaces") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/485422/ Link: https://lore.kernel.org/r/20220507010021.1667700-1-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit e67dcecda06f279cf40b2ab696ca70305b3ba6df Author: Abhinav Kumar Date: Fri May 13 15:59:59 2022 -0700 drm/msm/dpu: limit writeback modes according to max_linewidth Writeback modes were being added according to mode_config.max_width but this is assigned to double of max_mixer_width. For compositors/clients using a single SSPP, this will fail the dpu_plane's atomic check as it checks for max_linewidth. Limit writeback modes according to max_linewidth to allow even compositors/clients which use only a single SSPP to use writeback. Fixes: 77b001acdcfeb ("drm/msm/dpu: add the writeback connector layer") Reported-by: Jessica Zhang Signed-off-by: Abhinav Kumar Tested-by: Jessica Zhang # Trogdor (SC8170) Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/486176/ Link: https://lore.kernel.org/r/20220513225959.19004-1-quic_abhinavk@quicinc.com Signed-off-by: Abhinav Kumar commit 677a82b44ebf263d4f9a0cfbd576a6ade797a07b Author: Chao Yu Date: Wed May 18 20:28:41 2022 +0800 f2fs: fix to do sanity check for inline inode Yanming reported a kernel bug in Bugzilla kernel [1], which can be reproduced. The bug message is: The kernel message is shown below: kernel BUG at fs/inode.c:611! Call Trace: evict+0x282/0x4e0 __dentry_kill+0x2b2/0x4d0 dput+0x2dd/0x720 do_renameat2+0x596/0x970 __x64_sys_rename+0x78/0x90 do_syscall_64+0x3b/0x90 [1] https://bugzilla.kernel.org/show_bug.cgi?id=215895 The bug is due to fuzzed inode has both inline_data and encrypted flags. During f2fs_evict_inode(), as the inode was deleted by rename(), it will cause inline data conversion due to conflicting flags. The page cache will be polluted and the panic will be triggered in clear_inode(). Try fixing the bug by doing more sanity checks for inline data inode in sanity_check_inode(). Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 958ed92922028ec67f504dcdc72bfdfd0f43936a Author: Chao Yu Date: Tue May 17 11:37:23 2022 +0800 f2fs: fix fallocate to use file_modified to update permissions consistently This patch tries to fix permission consistency issue as all other mainline filesystems. Since the initial introduction of (posix) fallocate back at the turn of the century, it has been possible to use this syscall to change the user-visible contents of files. This can happen by extending the file size during a preallocation, or through any of the newer modes (punch, zero, collapse, insert range). Because the call can be used to change file contents, we should treat it like we do any other modification to a file -- update the mtime, and drop set[ug]id privileges/capabilities. The VFS function file_modified() does all this for us if pass it a locked inode, so let's make fallocate drop permissions correctly. Cc: stable@kernel.org Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1305e2c9d91a9f64c0eb5d4e1b5bc29930f3b834 Author: Jens Axboe Date: Wed May 18 16:32:00 2022 -0600 blk-cgroup: delete rcu_read_lock_held() WARN_ON_ONCE() A previous commit got rid of unnecessary rcu_read_lock() inside the IRQ disabling queue_lock, but this debug statement was left. It's now firing since we are indeed not inside a RCU read lock, but we don't need to be as we're still preempt safe. Get rid of the check, as we have a lockdep assert for holding the queue lock right after it anyway. Link: https://lore.kernel.org/linux-block/46253c48-81cb-0787-20ad-9133afdd9e21@samsung.com/ Reported-by: Marek Szyprowski Fixes: 77c570a1ea85 ("blk-cgroup: Remove unnecessary rcu_read_lock/unlock()") Signed-off-by: Jens Axboe commit 2fcabce2d7d34f69a888146dab15b36a917f09d4 Author: Jens Axboe Date: Wed May 18 15:34:37 2022 -0600 io_uring: disallow mixed provided buffer group registrations It's nonsensical to register a provided buffer ring, if a classic provided buffer group with the same ID exists. Depending on the order of which we decide what type to pick, the other type will never get used. Explicitly disallow it and return an error if this is attempted. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Jens Axboe commit 1d0dbbfa282d9be57792e3b5827dc57b010181ee Author: Jens Axboe Date: Wed May 18 14:36:18 2022 -0600 io_uring: initialize io_buffer_list head when shared ring is unregistered We use ->buf_pages != 0 to tell if this is a shared buffer ring or a classic provided buffer group. If we unregister the shared ring and then attempt to use it, buf_pages is zero yet the classic list head isn't properly initialized. This causes io_buffer_select() to think that we have classic buffers available, but then we crash when we try and get one from the list. Just initialize the list if we unregister a shared buffer ring, leaving it in a sane state for either re-registration or for attempting to use it. And do the same for the initial setup from the classic path. Fixes: c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers") Signed-off-by: Jens Axboe commit 038c4bf85ba2bca715db3ca4d190de3e5299c6c3 Merge: c853246539f37 d95bca4fbde0a Author: Dmitry Torokhov Date: Wed May 18 15:02:27 2022 -0700 Merge branch 'ib/5.17-cros-ec-keyb' into next Merge changes to ChromeOS EC Keyboard driver. commit c853246539f37936f20a38c12e55d54fe72f1c2a Author: Zongmin Zhou Date: Tue May 17 21:50:03 2022 -0700 Input: vmmouse - disable vmmouse before entering suspend mode Currently, when trying to suspend and resume with VirtualPS/2 VMMouse there is an error message after resuming: psmouse serio1: vmmouse: Unable to re-enable mouse when reconnecting, err: -6 and the mouse will no longer be operable, requiring full rescan to find a another driver to use for the port. This error is due to QEMU still generating PS2 events which the kernel is not consuming until resume time, where they interfere with mouse identification and ultimately resulting in an error getting VMMOUSE_VERSION_ID. Test scenario: 1) start virtual machine with qemu command "vmport=on" 2) click suspend botton to enter suspend mode 3) resume and observe the error message in the kernel logs Let's fix this by disabling the vmmouse in its reset handler. This will notify qemu to stop vmmouse and remove the handler. Signed-off-by: Zongmin Zhou Reviewed-by: Zack Rusin Link: https://lore.kernel.org/r/20220322021046.1087954-1-zhouzongmin@kylinos.cn Signed-off-by: Dmitry Torokhov commit d95bca4fbde0a29a3d987c39fd17e414f1ed5ec6 Author: Stephen Boyd Date: Wed May 18 15:00:08 2022 -0700 dt-bindings: google,cros-ec-keyb: Fixup bad compatible match This uses anyOf which is wrong. Use oneOf and move the items under the description. Also drop allOf for $ref. Reported-by: Douglas Anderson Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/CAE-0n50KE9bkqZvCOLtCGiq3g1jYhK7zpVcVFBzinaguNhNaPw@mail.gmail.com Signed-off-by: Dmitry Torokhov commit 2b0f3d70ce7ca68c10b3a5beaf2da6a03c5b3c11 Author: Aidan MacDonald Date: Thu Apr 28 17:44:54 2022 +0100 mips: ingenic: Do not manually reference the CPU clock It isn't necessary to manually walk the device tree and enable the CPU clock anymore. The CPU and other necessary clocks are now flagged as critical in the clock driver, which accomplishes the same thing in a more declarative fashion. Signed-off-by: Aidan MacDonald Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20220428164454.17908-4-aidanmacdonald.0x0@gmail.com Tested-by: 周琰杰 (Zhou Yanjie) # On X1000 and X1830 Signed-off-by: Stephen Boyd commit ca54d06fcacfdeb0b07acb4c6469a96fb02a9b44 Author: Aidan MacDonald Date: Thu Apr 28 17:44:53 2022 +0100 clk: ingenic: Mark critical clocks in Ingenic SoCs Consider CPU, L2 cache, and memory clocks as critical to prevent them -- and the parent clocks -- from being automatically gated, since nothing calls clk_get() on these clocks. Gating the CPU clock hangs the processor, and gating memory makes external DRAM inaccessible. Normal kernel code can't hope to deal with either situation so those clocks have to be critical. The L2 cache is required only if caches are running, and could be gated if the kernel takes care to flush and disable caches before gating the clock. There's no mechanism to do this, and probably no reason to do it, so it's simpler to mark the L2 cache as critical. Signed-off-by: Aidan MacDonald Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20220428164454.17908-3-aidanmacdonald.0x0@gmail.com Tested-by: 周琰杰 (Zhou Yanjie) # On X1000 and X1830 Signed-off-by: Stephen Boyd commit bacf743e925d10076c0ba9b9289d0e827c3db7f1 Author: Aidan MacDonald Date: Thu Apr 28 17:44:52 2022 +0100 clk: ingenic: Allow specifying common clock flags Provide a flags field for clocks under the ingenic-cgu driver, which can be used to set generic common clock framework flags on the created clocks. For example, the CLK_IS_CRITICAL flag is needed for some clocks (such as CPU or memory) to stop them being automatically disabled. Signed-off-by: Aidan MacDonald Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20220428164454.17908-2-aidanmacdonald.0x0@gmail.com Tested-by: 周琰杰 (Zhou Yanjie) # On X1000 and X1830 Signed-off-by: Stephen Boyd commit bea0b66efa654aee810d0f1791e8f3264bbc2eb9 Author: Hangyu Hua Date: Wed May 18 14:25:37 2022 +0800 clk: ux500: fix a possible off-by-one in u8500_prcc_reset_base() Off-by-one will happen when index == ARRAY_SIZE(ur->base). Fixes: b14cbdfd467d ("clk: ux500: Add driver for the reset portions of PRCC") Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220518062537.17933-1-hbh25y@gmail.com Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd commit 0223e516470aa0589da6c03e6d177c10594cabbd Author: Mario Limonciello Date: Tue May 17 12:00:37 2022 -0500 drm/amd: Don't reset dGPUs if the system is going to s2idle An A+A configuration on ASUS ROG Strix G513QY proves that the ASIC reset for handling aborted suspend can't work with s2idle. This functionality was introduced in commit daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)"). A few other commits have gone on top of the ASIC reset, but this still doesn't work on the A+A configuration in s2idle. Avoid doing the reset on dGPUs specifically when using s2idle. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2008 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 5ad25ace7c9fc76b53657b0a2cc441379b4ab17d Author: Luben Tuikov Date: Mon May 16 14:36:36 2022 -0400 drm/amdgpu: Unmap legacy queue when MES is enabled This fixes a kernel oops when MES is not enabled. Reported-by: Kenny Ho Suggested-by: Jack Xiao Reviewed-by: Alex Deucher Signed-off-by: Luben Tuikov Fixes: 18ee4ce63e0f32 ("drm/amdgpu: add mes unmap legacy queue routine") Fixes: 3d879e81f0f9ed ("drm/amdgpu: add init support for GFX11 (v2)") Signed-off-by: Alex Deucher commit d44d6c4a3a5d79410fa2003f0b2e3e773978927f Merge: 42226c989789d 26984d9d581e5 Author: Rafael J. Wysocki Date: Wed May 18 20:55:34 2022 +0200 Merge tag 'devfreq-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull devfreq changes for 5.19-rc1 from Chanwoo Choi: "1. Update devfreq core - Add cpu based scaling support to passive governor. Some device like cache might require the dynamic frequency scaling. But, it has very tightly to cpu frequency. So that use passive governor to scale the frequency according to current cpu frequency. To decide the frequency of the device, the governor does one of the following: : Derives the optimal devfreq device opp from required-opps property of the parent cpu opp_table. : Scales the device frequency in proportion to the CPU frequency. So, if the CPUs are running at their max frequency, the device runs at its max frequency. If the CPUs are running at their min frequency, the device runs at its min frequency. It is interpolated for frequencies in between. 2. Update devfreq drivers - Update rk3399_dmc.c as following: : Convert dt-binding document to YAML and deprecate unused properties. : Use Hz units for the device-tree properties of rk3399_dmc. : rk3399_dmc is able to set the idle time before changing the dmc clock. Specify idle time parameters by using nano-second unit on dt bidning. : Add new disable-freq properties to optimize the power-saving feature of rk3399_dmc. : Disable devfreq-event device on remove() to fix unbalanced enable-disable count. : Use devm_pm_opp_of_add_table() : Block PMU (Power-Management Unit) transitions when scaling frequency by ARM Trust Firmware in order to fix the conflict between PMU and DMC (Dynamic Memory Controller)." * tag 'devfreq-next-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: passive: Keep cpufreq_policy for possible cpus PM / devfreq: passive: Reduce duplicate code when passive_devfreq case PM / devfreq: Add cpu based scaling support to passive governor PM / devfreq: Export devfreq_get_freq_range symbol within devfreq PM / devfreq: rk3399_dmc: Block PMU during transitions soc: rockchip: power-domain: Manage resource conflicts with firmware PM / devfreq: rk3399_dmc: Avoid static (reused) profile PM / devfreq: rk3399_dmc: Use devm_pm_opp_of_add_table() PM / devfreq: rk3399_dmc: Disable edev on remove() PM / devfreq: rk3399_dmc: Support new *-ns properties PM / devfreq: rk3399_dmc: Support new disable-freq properties PM / devfreq: rk3399_dmc: Use bitfield macro definitions for ODT_PD PM / devfreq: rk3399_dmc: Drop excess timing properties PM / devfreq: rk3399_dmc: Drop undocumented ondemand DT props dt-bindings: devfreq: rk3399_dmc: Add more disable-freq properties dt-bindings: devfreq: rk3399_dmc: Specify idle params in nanoseconds dt-bindings: devfreq: rk3399_dmc: Fix Hz units dt-bindings: devfreq: rk3399_dmc: Deprecate unused/redundant properties dt-bindings: devfreq: rk3399_dmc: Convert to YAML commit 5a66bfb27748d4fd284997dea060c76cdc245375 Author: Haowen Bai Date: Tue May 17 09:31:01 2022 +0800 thermal: intel: hfi: remove NULL check after container_of() call container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai Signed-off-by: Rafael J. Wysocki commit 0184f08e65348f39aa4e8a71927e4538515f4ac0 Author: Pavel Begunkov Date: Wed May 18 19:13:49 2022 +0100 io_uring: add fully sparse buffer registration Honour IORING_RSRC_REGISTER_SPARSE not only for direct files but fixed buffers as well. It makes the rsrc API more consistent. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/66f429e4912fe39fb3318217ff33a2853d4544be.1652879898.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f125bdbdd6bd4a88f3697e5850359d3ffe43a3f2 Author: Zhang Rui Date: Fri May 13 13:00:40 2022 +0800 powercap: intel_rapl: add support for ALDERLAKE_N Add ALDERLAKE_N to the list of supported processor models in the Intel RAPL power capping driver. Signed-off-by: Zhang Rui [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit c42b145181aafd59ed31ccd879493389e3ea5a08 Author: Lai Jiangshan Date: Wed Mar 16 12:16:12 2022 +0800 x86/sev: Annotate stack change in the #VC handler In idtentry_vc(), vc_switch_off_ist() determines a safe stack to switch to, off of the IST stack. Annotate the new stack switch with ENCODE_FRAME_POINTER in case UNWINDER_FRAME_POINTER is used. A stack walk before looks like this: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack_lvl dump_stack kernel_exc_vmm_communication asm_exc_vmm_communication ? native_read_msr ? __x2apic_disable.part.0 ? x2apic_setup ? cpu_init ? trap_init ? start_kernel ? x86_64_start_reservations ? x86_64_start_kernel ? secondary_startup_64_no_verify and with the fix, the stack dump is exact: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #3 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack_lvl dump_stack kernel_exc_vmm_communication asm_exc_vmm_communication RIP: 0010:native_read_msr Code: ... < snipped regs > ? __x2apic_disable.part.0 x2apic_setup cpu_init trap_init start_kernel x86_64_start_reservations x86_64_start_kernel secondary_startup_64_no_verify [ bp: Test in a SEV-ES guest and rewrite the commit message to explain what exactly this does. ] Fixes: a13644f3a53d ("x86/entry/64: Add entry code for #VC handler") Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220316041612.71357-1-jiangshanlai@gmail.com commit 947a844bb3ebff0f4736d244d792ce129f6700d7 Author: Hangyu Hua Date: Mon May 9 14:11:25 2022 +0800 drm: msm: fix possible memory leak in mdp5_crtc_cursor_set() drm_gem_object_lookup will call drm_gem_object_get inside. So cursor_bo needs to be put when msm_gem_get_and_pin_iova fails. Fixes: e172d10a9c4a ("drm/msm/mdp5: Add hardware cursor support") Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220509061125.18585-1-hbh25y@gmail.com Signed-off-by: Rob Clark commit b0487ede1f7a1e7ee231c110af8a8bec3f6c0be2 Author: Zhang Jianhua Date: Wed May 18 21:22:56 2022 +0800 fs-verity: remove unused parameter desc_size in fsverity_create_info() The parameter desc_size in fsverity_create_info() is useless and it is not referenced anywhere. The greatest meaning of desc_size here is to indecate the size of struct fsverity_descriptor and futher calculate the size of signature. However, the desc->sig_size can do it also and it is indeed, so remove it. Therefore, it is no need to acquire desc_size by fsverity_get_descriptor() in ensure_verity_info(), so remove the parameter desc_ret in fsverity_get_descriptor() too. Signed-off-by: Zhang Jianhua Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220518132256.2297655-1-chris.zjh@huawei.com commit cec4e5cbb91bf3d6e238e4983398ba443b6ffdfa Author: Rob Clark Date: Tue May 10 09:52:16 2022 -0700 drm/msm: Fix fb plane offset calculation The offset got dropped by accident. Fixes: d413e6f97134 ("drm/msm: Drop msm_gem_iova()") Signed-off-by: Rob Clark Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Tested-by: Stephen Boyd # CoachZ Link: https://lore.kernel.org/r/20220510165216.3577068-1-robdclark@gmail.com Signed-off-by: Rob Clark commit c56de483093d7ad0782327f95dda7da97bc4c315 Author: Miaoqian Lin Date: Thu May 12 16:19:50 2022 +0400 drm/msm/a6xx: Fix refcount leak in a6xx_gpu_init of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. a6xx_gmu_init() passes the node to of_find_device_by_node() and of_dma_configure(), of_find_device_by_node() will takes its reference, of_dma_configure() doesn't need the node after usage. Add missing of_node_put() to avoid refcount leak. Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support") Signed-off-by: Miaoqian Lin Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20220512121955.56937-1-linmq006@gmail.com Signed-off-by: Rob Clark commit ec7981e6c614254937b37ce0af9eac09901c05c5 Author: Douglas Anderson Date: Fri May 13 13:15:13 2022 -0700 drm/msm/dsi: don't powerup at modeset time for parade-ps8640 Commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time") caused sc7180 Chromebooks that use the parade-ps8640 bridge chip to fail to turn the display back on after it turns off. Unfortunately, it doesn't look easy to fix the parade-ps8640 driver to handle the new power sequence. The Linux driver has almost nothing in it and most of the logic for this bridge chip is in black-box firmware that the bridge chip uses. Also unfortunately, reverting the patch will break "tc358762". The long term solution here is probably Dave Stevenson's series [1] that would give more flexibility. However, that is likely not a quick fix. For the short term, we'll look at the compatible of the next bridge in the chain and go back to the old way for the Parade PS8640 bridge chip. If it's found that other bridge chips also need this workaround then we can add them to the list or consider inverting the condition. However, the hope is that the framework will not take too much longer to land and we won't have to add anything other than ps8640 here. [1] https://lore.kernel.org/r/cover.1646406653.git.dave.stevenson@raspberrypi.com Fixes: 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset time") Suggested-by: Rob Clark Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20220513131504.v5.1.Ia196e35ad985059e77b038a41662faae9e26f411@changeid Signed-off-by: Rob Clark commit 29ed17389c4dcd09c5be8d88ddf6f4f60241567d Author: Xiu Jianfeng Date: Tue May 17 19:25:23 2022 +0800 cgroup: Make cgroup_debug static Make cgroup_debug static since it's only used in cgroup.c Signed-off-by: Xiu Jianfeng Signed-off-by: Tejun Heo commit 354201c53e61e493017b15327294b0c8ab522d69 Author: Christoph Hellwig Date: Mon May 16 15:09:21 2022 +0200 nvme: add support for TP4084 - Time-to-Ready Enhancements Add support for using longer timeouts during controller initialization and letting the controller come up with namespaces that are not ready for I/O yet. We skip these not ready namespaces during scanning and only bring them online once anoter scan is kicked off by the AEN that is set when the NRDY bit gets set in the I/O Command Set Independent Identify Namespace Data Structure. This asynchronous probing avoids blocking the kernel boot when controllers take a very long time to recover after unclean shutdowns (up to minutes). Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke commit 7013654af694f6e1a2e699a6450ea50d309dd0e5 Author: Daire McNamara Date: Tue May 17 15:16:22 2022 +0100 PCI: microchip: Fix potential race in interrupt handling Clear the MSI bit in ISTATUS_LOCAL register after reading it, but before reading and handling individual MSI bits from the ISTATUS_MSI register. This avoids a potential race where new MSI bits may be set on the ISTATUS_MSI register after it was read and be missed when the MSI bit in the ISTATUS_LOCAL register is cleared. ISTATUS_LOCAL is a read/write/clear register; the register's bits are set when the corresponding interrupt source is activated. Each source is independent and thus multiple sources may be active simultaneously. The processor can monitor and clear status bits. If one or more ISTATUS_LOCAL interrupt sources are active, the RootPort issues an interrupt towards the processor (on the AXI domain). Bit 28 of this register reports an MSI has been received by the RootPort. ISTATUS_MSI is a read/write/clear register. Bits 31-0 are asserted when an MSI with message number 31-0 is received by the RootPort. The processor must monitor and clear these bits. Effectively, Bit 28 of ISTATUS_LOCAL informs the processor that an MSI has arrived at the RootPort and ISTATUS_MSI informs the processor which MSI (in the range 0 - 31) needs handling. Reported by: Bjorn Helgaas Link: https://lore.kernel.org/linux-pci/20220127202000.GA126335@bhelgaas/ Link: https://lore.kernel.org/r/20220517141622.145581-1-daire.mcnamara@microchip.com Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver") Signed-off-by: Daire McNamara Signed-off-by: Lorenzo Pieralisi commit 7ab5e10eda02da1d9562ffde562c51055d368e9c Author: Abhishek Sahu Date: Wed May 18 16:46:12 2022 +0530 vfio/pci: Move the unused device into low power state with runtime PM Currently, there is very limited power management support available in the upstream vfio_pci_core based drivers. If there are no users of the device, then the PCI device will be moved into D3hot state by writing directly into PCI PM registers. This D3hot state help in saving power but we can achieve zero power consumption if we go into the D3cold state. The D3cold state cannot be possible with native PCI PM. It requires interaction with platform firmware which is system-specific. To go into low power states (including D3cold), the runtime PM framework can be used which internally interacts with PCI and platform firmware and puts the device into the lowest possible D-States. This patch registers vfio_pci_core based drivers with the runtime PM framework. 1. The PCI core framework takes care of most of the runtime PM related things. For enabling the runtime PM, the PCI driver needs to decrement the usage count and needs to provide 'struct dev_pm_ops' at least. The runtime suspend/resume callbacks are optional and needed only if we need to do any extra handling. Now there are multiple vfio_pci_core based drivers. Instead of assigning the 'struct dev_pm_ops' in individual parent driver, the vfio_pci_core itself assigns the 'struct dev_pm_ops'. There are other drivers where the 'struct dev_pm_ops' is being assigned inside core layer (For example, wlcore_probe() and some sound based driver, etc.). 2. This patch provides the stub implementation of 'struct dev_pm_ops'. The subsequent patch will provide the runtime suspend/resume callbacks. All the config state saving, and PCI power management related things will be done by PCI core framework itself inside its runtime suspend/resume callbacks (pci_pm_runtime_suspend() and pci_pm_runtime_resume()). 3. Inside pci_reset_bus(), all the devices in dev_set needs to be runtime resumed. vfio_pci_dev_set_pm_runtime_get() will take care of the runtime resume and its error handling. 4. Inside vfio_pci_core_disable(), the device usage count always needs to be decremented which was incremented in vfio_pci_core_enable(). 5. Since the runtime PM framework will provide the same functionality, so directly writing into PCI PM config register can be replaced with the use of runtime PM routines. Also, the use of runtime PM can help us in more power saving. In the systems which do not support D3cold, With the existing implementation: // PCI device # cat /sys/bus/pci/devices/0000\:01\:00.0/power_state D3hot // upstream bridge # cat /sys/bus/pci/devices/0000\:00\:01.0/power_state D0 With runtime PM: // PCI device # cat /sys/bus/pci/devices/0000\:01\:00.0/power_state D3hot // upstream bridge # cat /sys/bus/pci/devices/0000\:00\:01.0/power_state D3hot So, with runtime PM, the upstream bridge or root port will also go into lower power state which is not possible with existing implementation. In the systems which support D3cold, // PCI device # cat /sys/bus/pci/devices/0000\:01\:00.0/power_state D3hot // upstream bridge # cat /sys/bus/pci/devices/0000\:00\:01.0/power_state D0 With runtime PM: // PCI device # cat /sys/bus/pci/devices/0000\:01\:00.0/power_state D3cold // upstream bridge # cat /sys/bus/pci/devices/0000\:00\:01.0/power_state D3cold So, with runtime PM, both the PCI device and upstream bridge will go into D3cold state. 6. If 'disable_idle_d3' module parameter is set, then also the runtime PM will be enabled, but in this case, the usage count should not be decremented. 7. vfio_pci_dev_set_try_reset() return value is unused now, so this function return type can be changed to void. 8. Use the runtime PM API's in vfio_pci_core_sriov_configure(). The device can be in low power state either with runtime power management (when there is no user) or PCI_PM_CTRL register write by the user. In both the cases, the PF should be moved to D0 state. For preventing any runtime usage mismatch, pci_num_vf() has been called explicitly during disable. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220518111612.16985-5-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 54918c28740109e4ef4feca22d38e5fe41712b1a Author: Abhishek Sahu Date: Wed May 18 16:46:11 2022 +0530 vfio/pci: Virtualize PME related registers bits and initialize to zero If any PME event will be generated by PCI, then it will be mostly handled in the host by the root port PME code. For example, in the case of PCIe, the PME event will be sent to the root port and then the PME interrupt will be generated. This will be handled in drivers/pci/pcie/pme.c at the host side. Inside this, the pci_check_pme_status() will be called where PME_Status and PME_En bits will be cleared. So, the guest OS which is using vfio-pci device will not come to know about this PME event. To handle these PME events inside guests, we need some framework so that if any PME events will happen, then it needs to be forwarded to virtual machine monitor. We can virtualize PME related registers bits and initialize these bits to zero so vfio-pci device user will assume that it is not capable of asserting the PME# signal from any power state. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220518111612.16985-4-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit f4162eb1e2fc9b423dfb8f3a7b2b55a337efcc60 Author: Abhishek Sahu Date: Wed May 18 16:46:10 2022 +0530 vfio/pci: Change the PF power state to D0 before enabling VFs According to [PCIe v5 9.6.2] for PF Device Power Management States "The PF's power management state (D-state) has global impact on its associated VFs. If a VF does not implement the Power Management Capability, then it behaves as if it is in an equivalent power state of its associated PF. If a VF implements the Power Management Capability, the Device behavior is undefined if the PF is placed in a lower power state than the VF. Software should avoid this situation by placing all VFs in lower power state before lowering their associated PF's power state." From the vfio driver side, user can enable SR-IOV when the PF is in D3hot state. If VF does not implement the Power Management Capability, then the VF will be actually in D3hot state and then the VF BAR access will fail. If VF implements the Power Management Capability, then VF will assume that its current power state is D0 when the PF is D3hot and in this case, the behavior is undefined. To support PF power management, we need to create power management dependency between PF and its VF's. The runtime power management support may help with this where power management dependencies are supported through device links. But till we have such support in place, we can disallow the PF to go into low power state, if PF has VF enabled. There can be a case, where user first enables the VF's and then disables the VF's. If there is no user of PF, then the PF can put into D3hot state again. But with this patch, the PF will still be in D0 state after disabling VF's since detecting this case inside vfio_pci_core_sriov_configure() requires access to struct vfio_device::open_count along with its locks. But the subsequent patches related to runtime PM will handle this case since runtime PM maintains its own usage count. Also, vfio_pci_core_sriov_configure() can be called at any time (with and without vfio pci device user), so the power state change and SR-IOV enablement need to be protected with the required locks. Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220518111612.16985-3-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit 2b2c651baf1c24414be4f76b152de80fae7c7786 Author: Abhishek Sahu Date: Wed May 18 16:46:09 2022 +0530 vfio/pci: Invalidate mmaps and block the access in D3hot power state According to [PCIe v5 5.3.1.4.1] for D3hot state "Configuration and Message requests are the only TLPs accepted by a Function in the D3Hot state. All other received Requests must be handled as Unsupported Requests, and all received Completions may optionally be handled as Unexpected Completions." Currently, if the vfio PCI device has been put into D3hot state and if user makes non-config related read/write request in D3hot state, these requests will be forwarded to the host and this access may cause issues on a few systems. This patch leverages the memory-disable support added in commit 'abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO access on disabled memory")' to generate page fault on mmap access and return error for the direct read/write. If the device is D3hot state, then the error will be returned for MMIO access. The IO access generally does not make the system unresponsive so the IO access can still happen in D3hot state. The default value should be returned in this case without bringing down the complete system. Also, the power related structure fields need to be protected so we can use the same 'memory_lock' to protect these fields also. This protection is mainly needed when user changes the PCI power state by writing into PCI_PM_CTRL register. vfio_lock_and_set_power_state() wrapper function will take the required locks and then it will invoke the vfio_pci_set_power_state(). Signed-off-by: Abhishek Sahu Link: https://lore.kernel.org/r/20220518111612.16985-2-abhsahu@nvidia.com Signed-off-by: Alex Williamson commit c069db76ed7b681c69159f44be96d2137e9ca989 Author: Eric Biggers Date: Fri May 13 16:16:01 2022 -0700 ext4: fix memory leak in parse_apply_sb_mount_options() If processing the on-disk mount options fails after any memory was allocated in the ext4_fs_context, e.g. s_qf_names, then this memory is leaked. Fix this by calling ext4_fc_free() instead of kfree() directly. Reproducer: mkfs.ext4 -F /dev/vdc tune2fs /dev/vdc -E mount_opts=usrjquota=file echo clear > /sys/kernel/debug/kmemleak mount /dev/vdc /vdc echo scan > /sys/kernel/debug/kmemleak sleep 5 echo scan > /sys/kernel/debug/kmemleak cat /sys/kernel/debug/kmemleak Fixes: 7edfd85b1ffd ("ext4: Completely separate options parsing and sb setup") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Tested-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220513231605.175121-2-ebiggers@kernel.org Signed-off-by: Theodore Ts'o commit cb8435dc8ba33bcafa41cf2aa253794320a3b8df Author: Eric Biggers Date: Tue May 10 11:32:32 2022 -0700 ext4: reject the 'commit' option on ext2 filesystems The 'commit' option is only applicable for ext3 and ext4 filesystems, and has never been accepted by the ext2 filesystem driver, so the ext4 driver shouldn't allow it on ext2 filesystems. This fixes a failure in xfstest ext4/053. Fixes: 8dc0aa8cf0f7 ("ext4: check incompatible mount options while mounting ext2/3") Signed-off-by: Eric Biggers Reviewed-by: Ritesh Harjani Reviewed-by: Lukas Czerner Link: https://lore.kernel.org/r/20220510183232.172615-1-ebiggers@kernel.org commit b10b6278ae17366fec058219623c757b3302baae Author: Yang Li Date: Thu May 5 06:50:25 2022 +0800 ext4: remove duplicated #include of dax.h in inode.c Fix following includecheck warning: ./fs/ext4/inode.c: linux/dax.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220504225025.44753-1-yang.lee@linux.alibaba.com Signed-off-by: Theodore Ts'o commit ad55bae7dc364417434b69dd6c30104f20d0f84d Author: Fabiano Rosas Date: Mon Mar 28 18:58:31 2022 -0300 KVM: PPC: Book3S HV: Fix vcore_blocked tracepoint We removed most of the vcore logic from the P9 path but there's still a tracepoint that tried to dereference vc->runner. Fixes: ecb6a7207f92 ("KVM: PPC: Book3S HV P9: Remove most of the vcore logic") Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220328215831.320409-1-farosas@linux.ibm.com commit b22af9041927075b82bcaf4b6c7a354688198d47 Author: Alexey Kardashevskiy Date: Mon May 9 17:11:50 2022 +1000 KVM: PPC: Book3s: Remove real mode interrupt controller hcalls handlers Currently we have 2 sets of interrupt controller hypercalls handlers for real and virtual modes, this is from POWER8 times when switching MMU on was considered an expensive operation. POWER9 however does not have dependent threads and MMU is enabled for handling hcalls so the XIVE native or XICS-on-XIVE real mode handlers never execute on real P9 and later CPUs. This untemplate the handlers and only keeps the real mode handlers for XICS native (up to POWER8) and remove the rest of dead code. Changes in functions are mechanical except few missing empty lines to make checkpatch.pl happy. The default implemented hcalls list already contains XICS hcalls so no change there. This should not cause any behavioral change. Reported-by: kernel test robot Signed-off-by: Alexey Kardashevskiy Acked-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220509071150.181250-1-aik@ozlabs.ru commit 29592181c5496d93697a23e6dbb9d7cc317ff5ee Author: Alexey Kardashevskiy Date: Fri May 6 17:37:37 2022 +1000 KVM: PPC: Book3s: PR: Enable default TCE hypercalls When KVM_CAP_PPC_ENABLE_HCALL was introduced, H_GET_TCE and H_PUT_TCE were already implemented and enabled by default; however H_GET_TCE was missed out on PR KVM (probably because the handler was in the real mode code at the time). This enables H_GET_TCE by default. While at this, this wraps the checks in ifdef CONFIG_SPAPR_TCE_IOMMU just like HV KVM. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220506073737.3823347-1-aik@ozlabs.ru commit cad32d9d42e8e6a659786f8a730b221a9fbee227 Author: Alexey Kardashevskiy Date: Fri May 6 15:37:55 2022 +1000 KVM: PPC: Book3s: Retire H_PUT_TCE/etc real mode handlers LoPAPR defines guest visible IOMMU with hypercalls to use it - H_PUT_TCE/etc. Implemented first on POWER7 where hypercalls would trap in the KVM in the real mode (with MMU off). The problem with the real mode is some memory is not available and some API usage crashed the host but enabling MMU was an expensive operation. The problems with the real mode handlers are: 1. Occasionally these cannot complete the request so the code is copied+modified to work in the virtual mode, very little is shared; 2. The real mode handlers have to be linked into vmlinux to work; 3. An exception in real mode immediately reboots the machine. If the small DMA window is used, the real mode handlers bring better performance. However since POWER8, there has always been a bigger DMA window which VMs use to map the entire VM memory to avoid calling H_PUT_TCE. Such 1:1 mapping happens once and uses H_PUT_TCE_INDIRECT (a bulk version of H_PUT_TCE) which virtual mode handler is even closer to its real mode version. On POWER9 hypercalls trap straight to the virtual mode so the real mode handlers never execute on POWER9 and later CPUs. So with the current use of the DMA windows and MMU improvements in POWER9 and later, there is no point in duplicating the code. The 32bit passed through devices may slow down but we do not have many of these in practice. For example, with this applied, a 1Gbit ethernet adapter still demostrates above 800Mbit/s of actual throughput. This removes the real mode handlers from KVM and related code from the powernv platform. This updates the list of implemented hcalls in KVM-HV as the realmode handlers are removed. This changes ABI - kvmppc_h_get_tce() moves to the KVM module and kvmppc_find_table() is static now. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220506053755.3820702-1-aik@ozlabs.ru commit 750137ec6c1c7808d121234c212d30701ec32b22 Merge: 1d1cd0f12a3ab ee8348496c77e Author: Michael Ellerman Date: Thu May 19 00:43:04 2022 +1000 Merge branch 'fixes' into topic/ppc-kvm Merge our fixes branch. In parciular this brings in the KVM TCE handling fix, which is a prerequisite for a subsequent patch. commit 1d1cd0f12a3ab5d7f79ae6cca28e7d23dd351ce3 Author: Fabiano Rosas Date: Mon Apr 25 11:21:51 2022 -0300 KVM: PPC: Book3S HV: Initialize AMOR in nested entry The hypervisor always sets AMOR to ~0, but let's ensure we're not passing stale values around. Signed-off-by: Fabiano Rosas Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220425142151.1495142-1-farosas@linux.ibm.com commit a5fc286f69fc9590c22995fe05dca461fd6295b1 Merge: b6b1c3ce06ca4 ee8348496c77e Author: Michael Ellerman Date: Thu May 19 00:11:51 2022 +1000 Merge branch 'fixes' into next Merge our fixes branch from this cycle. In particular this brings in a papr_scm.c change which a subsequent patch has a dependency on. commit 12e45a2a6308105469968951e6d563e8f4fea187 Author: Jason A. Donenfeld Date: Thu May 12 15:32:26 2022 +0200 random: credit architectural init the exact amount RDRAND and RDSEED can fail sometimes, which is fine. We currently initialize the RNG with 512 bits of RDRAND/RDSEED. We only need 256 bits of those to succeed in order to initialize the RNG. Instead of the current "all or nothing" approach, actually credit these contributions the amount that is actually contributed. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 2f14062bb14b0fcfcc21e6dc7d5b5c0d25966164 Author: Jason A. Donenfeld Date: Thu May 5 02:20:22 2022 +0200 random: handle latent entropy and command line from random_init() Currently, start_kernel() adds latent entropy and the command line to the entropy bool *after* the RNG has been initialized, deferring when it's actually used by things like stack canaries until the next time the pool is seeded. This surely is not intended. Rather than splitting up which entropy gets added where and when between start_kernel() and random_init(), just do everything in random_init(), which should eliminate these kinds of bugs in the future. While we're at it, rename the awkwardly titled "rand_initialize()" to the more standard "random_init()" nomenclature. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 8a5b8a4a4ceb353b4dd5bafd09e2b15751bcdb51 Author: Jason A. Donenfeld Date: Tue May 10 15:20:42 2022 +0200 random: use proper jiffies comparison macro This expands to exactly the same code that it replaces, but makes things consistent by using the same macro for jiffy comparisons throughout. Signed-off-by: Jason A. Donenfeld commit cc1e127bfa95b5fb2f9307e7168bf8b2b45b4c5e Author: Jason A. Donenfeld Date: Mon May 9 16:13:18 2022 +0200 random: remove ratelimiting for in-kernel unseeded randomness The CONFIG_WARN_ALL_UNSEEDED_RANDOM debug option controls whether the kernel warns about all unseeded randomness or just the first instance. There's some complicated rate limiting and comparison to the previous caller, such that even with CONFIG_WARN_ALL_UNSEEDED_RANDOM enabled, developers still don't see all the messages or even an accurate count of how many were missed. This is the result of basically parallel mechanisms aimed at accomplishing more or less the same thing, added at different points in random.c history, which sort of compete with the first-instance-only limiting we have now. It turns out, however, that nobody cares about the first unseeded randomness instance of in-kernel users. The same first user has been there for ages now, and nobody is doing anything about it. It isn't even clear that anybody _can_ do anything about it. Most places that can do something about it have switched over to using get_random_bytes_wait() or wait_for_random_bytes(), which is the right thing to do, but there is still much code that needs randomness sometimes during init, and as a geeneral rule, if you're not using one of the _wait functions or the readiness notifier callback, you're bound to be doing it wrong just based on that fact alone. So warning about this same first user that can't easily change is simply not an effective mechanism for anything at all. Users can't do anything about it, as the Kconfig text points out -- the problem isn't in userspace code -- and kernel developers don't or more often can't react to it. Instead, show the warning for all instances when CONFIG_WARN_ALL_UNSEEDED_RANDOM is set, so that developers can debug things need be, or if it isn't set, don't show a warning at all. At the same time, CONFIG_WARN_ALL_UNSEEDED_RANDOM now implies setting random.ratelimit_disable=1 on by default, since if you care about one you probably care about the other too. And we can clean up usage around the related urandom_warning ratelimiter as well (whose behavior isn't changing), so that it properly counts missed messages after the 10 message threshold is reached. Cc: Theodore Ts'o Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 68c9c8b192c6dae9be6278e98ee44029d5da2d31 Author: Jason A. Donenfeld Date: Mon May 9 13:53:24 2022 +0200 random: move initialization out of reseeding hot path Initialization happens once -- by way of credit_init_bits() -- and then it never happens again. Therefore, it doesn't need to be in crng_reseed(), which is a hot path that is called multiple times. It also doesn't make sense to have there, as initialization activity is better associated with initialization routines. After the prior commit, crng_reseed() now won't be called by multiple concurrent callers, which means that we can safely move the "finialize_init" logic into crng_init_bits() unconditionally. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit fed7ef061686cc813b1f3d8d0edc6c35b4d3537b Author: Jason A. Donenfeld Date: Mon May 9 13:40:55 2022 +0200 random: avoid initializing twice in credit race Since all changes of crng_init now go through credit_init_bits(), we can fix a long standing race in which two concurrent callers of credit_init_bits() have the new bit count >= some threshold, but are doing so with crng_init as a lower threshold, checked outside of a lock, resulting in crng_reseed() or similar being called twice. In order to fix this, we can use the original cmpxchg value of the bit count, and only change crng_init when the bit count transitions from below a threshold to meeting the threshold. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit e3d2c5e79a999aa4e7d6f0127e16d3da5a4ff70d Author: Jason A. Donenfeld Date: Sun May 8 13:20:30 2022 +0200 random: use symbolic constants for crng_init states crng_init represents a state machine, with three states, and various rules for transitions. For the longest time, we've been managing these with "0", "1", and "2", and expecting people to figure it out. To make the code more obvious, replace these with proper enum values representing the transition, and then redocument what each of these states mean. Reviewed-by: Dominik Brodowski Cc: Joe Perches Signed-off-by: Jason A. Donenfeld commit d4150779e60fb6c49be25572596b2cdfc5d46a09 Author: Jason A. Donenfeld Date: Wed May 11 16:11:29 2022 +0200 random32: use real rng for non-deterministic randomness random32.c has two random number generators in it: one that is meant to be used deterministically, with some predefined seed, and one that does the same exact thing as random.c, except does it poorly. The first one has some use cases. The second one no longer does and can be replaced with calls to random.c's proper random number generator. The relatively recent siphash-based bad random32.c code was added in response to concerns that the prior random32.c was too deterministic. Out of fears that random.c was (at the time) too slow, this code was anonymously contributed. Then out of that emerged a kind of shadow entropy gathering system, with its own tentacles throughout various net code, added willy nilly. Stop👏making👏bespoke👏random👏number👏generators👏. Fortunately, recent advances in random.c mean that we can stop playing with this sketchiness, and just use get_random_u32(), which is now fast enough. In micro benchmarks using RDPMC, I'm seeing the same median cycle count between the two functions, with the mean being _slightly_ higher due to batches refilling (which we can optimize further need be). However, when doing *real* benchmarks of the net functions that actually use these random numbers, the mean cycles actually *decreased* slightly (with the median still staying the same), likely because the additional prandom code means icache misses and complexity, whereas random.c is generally already being used by something else nearby. The biggest benefit of this is that there are many users of prandom who probably should be using cryptographically secure random numbers. This makes all of those accidental cases become secure by just flipping a switch. Later on, we can do a tree-wide cleanup to remove the static inline wrapper functions that this commit adds. There are also some low-ish hanging fruits for making this even faster in the future: a get_random_u16() function for use in the networking stack will give a 2x performance boost there, using SIMD for ChaCha20 will let us compute 4 or 8 or 16 blocks of output in parallel, instead of just one, giving us large buffers for cheap, and introducing a get_random_*_bh() function that assumes irqs are already disabled will shave off a few cycles for ordinary calls. These are things we can chip away at down the road. Acked-by: Jakub Kicinski Acked-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld commit e73aaae2fa9024832e1f42e30c787c7baf61d014 Author: Jason A. Donenfeld Date: Sat May 7 14:03:46 2022 +0200 siphash: use one source of truth for siphash permutations The SipHash family of permutations is currently used in three places: - siphash.c itself, used in the ordinary way it was intended. - random32.c, in a construction from an anonymous contributor. - random.c, as part of its fast_mix function. Each one of these places reinvents the wheel with the same C code, same rotation constants, and same symmetry-breaking constants. This commit tidies things up a bit by placing macros for the permutations and constants into siphash.h, where each of the three .c users can access them. It also leaves a note dissuading more users of them from emerging. Signed-off-by: Jason A. Donenfeld commit 791332b3cbb080510954a4c152ce02af8832eac9 Author: Jason A. Donenfeld Date: Fri May 6 23:19:43 2022 +0200 random: help compiler out with fast_mix() by using simpler arguments Now that fast_mix() has more than one caller, gcc no longer inlines it. That's fine. But it also doesn't handle the compound literal argument we pass it very efficiently, nor does it handle the loop as well as it could. So just expand the code to spell out this function so that it generates the same code as it did before. Performance-wise, this now behaves as it did before the last commit. The difference in actual code size on x86 is 45 bytes, which is less than a cache line. Signed-off-by: Jason A. Donenfeld commit e3e33fc2ea7fcefd0d761db9d6219f83b4248f5c Author: Jason A. Donenfeld Date: Fri May 6 18:30:51 2022 +0200 random: do not use input pool from hard IRQs Years ago, a separate fast pool was added for interrupts, so that the cost associated with taking the input pool spinlocks and mixing into it would be avoided in places where latency is critical. However, one oversight was that add_input_randomness() and add_disk_randomness() still sometimes are called directly from the interrupt handler, rather than being deferred to a thread. This means that some unlucky interrupts will be caught doing a blake2s_compress() call and potentially spinning on input_pool.lock, which can also be taken by unprivileged users by writing into /dev/urandom. In order to fix this, add_timer_randomness() now checks whether it is being called from a hard IRQ and if so, just mixes into the per-cpu IRQ fast pool using fast_mix(), which is much faster and can be done lock-free. A nice consequence of this, as well, is that it means hard IRQ context FPU support is likely no longer useful. The entropy estimation algorithm used by add_timer_randomness() is also somewhat different than the one used for add_interrupt_randomness(). The former looks at deltas of deltas of deltas, while the latter just waits for 64 interrupts for one bit or for one second since the last bit. In order to bridge these, and since add_interrupt_randomness() runs after an add_timer_randomness() that's called from hard IRQ, we add to the fast pool credit the related amount, and then subtract one to account for add_interrupt_randomness()'s contribution. A downside of this, however, is that the num argument is potentially attacker controlled, which puts a bit more pressure on the fast_mix() sponge to do more than it's really intended to do. As a mitigating factor, the first 96 bits of input aren't attacker controlled (a cycle counter followed by zeros), which means it's essentially two rounds of siphash rather than one, which is somewhat better. It's also not that much different from add_interrupt_randomness()'s use of the irq stack instruction pointer register. Cc: Thomas Gleixner Cc: Filipe Manana Cc: Peter Zijlstra Cc: Borislav Petkov Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld commit 8e1f78a92101e327740ea0dac903bff9ad37a59a Author: Geert Uytterhoeven Date: Tue May 17 16:52:03 2022 +0200 arm64/sve: Move sve_free() into SVE code section If CONFIG_ARM64_SVE is not set: arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function] Fix this by moving sve_free() and __sve_free() into the existing section protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that section has been removed. Fixes: a1259dd80719 ("arm64/sve: Delay freeing memory in fpsimd_flush_thread()") Signed-off-by: Geert Uytterhoeven Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/cd633284683c24cb9469f8ff429915aedf67f868.1652798894.git.geert+renesas@glider.be Signed-off-by: Catalin Marinas commit aea3cb356c9643b0936cb7c898e23edcd7c8f6c9 Author: Juerg Haefliger Date: Tue May 17 16:16:48 2022 +0200 arm64: Kconfig.platforms: Add comments Add trailing comments to endmenu statements for better readability. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220517141648.331976-3-juergh@canonical.com Signed-off-by: Catalin Marinas commit 3cb7e662a9309e1d54d3d3aba530616a20ea9a10 Author: Juerg Haefliger Date: Tue May 17 16:16:47 2022 +0200 arm64: Kconfig: Fix indentation and add comments The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. While add it, add trailing comments to endif and endmenu statements for better readability. Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220517141648.331976-2-juergh@canonical.com Signed-off-by: Catalin Marinas commit e0208351383c19e62f5f04209ce4ecf24db64eaf Author: Thomas Gleixner Date: Mon May 16 12:27:35 2022 +0200 scripts/spdxcheck: Exclude top-level README Nothing copyrightable to see here. Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 2ab99ce9780d3c3505db4b83669869627010307e Author: Thomas Gleixner Date: Mon May 16 12:27:32 2022 +0200 scripts/spdxcheck: Exclude MAINTAINERS/CREDITS Listings of maintainers and people who deserve credits are not really interesting in terms of copyright. The usage of these files outside of the kernel is pointless and the file format is trivial. No point in chasing them or slapping a SPDX identifier into them just because. Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 2fb977133684bb74d301bd86a9bb1bd2762362fc Author: Thomas Gleixner Date: Mon May 16 12:27:30 2022 +0200 scripts/spdxcheck: Exclude config directories Kernel configuration files like default configs are machine generated and pretty useless outside of the kernel context. Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 15eb1b6afc3c73bcd44b5d265d43db666950b5af Author: Bo Liu Date: Fri Apr 1 02:52:52 2022 -0400 KVM: PPC: Book3S HV: Use consistent type for return value of kvm_age_rmapp() The return value type defined in the function kvm_age_rmapp() is "bool", but the return value type defined in the implementation of the function kvm_age_rmapp() is "int". Change the return value type to "bool". Signed-off-by: Bo Liu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220401065252.36472-1-liubo03@inspur.com commit 0509b270a358fa563946368418f8e832d9b63452 Author: Thomas Gleixner Date: Mon May 16 12:27:29 2022 +0200 scripts/spdxcheck: Put excluded files and directories into a separate file The files and directories which are excluded from scanning are currently hard coded in the script. That's not maintainable and not accessible for external tools. Move the files and directories which should be excluded into a file. The default file is scripts/spdxexclude. This can be overridden with the '-e $FILE' command line option. The file format and syntax is similar to the .gitignore file. Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 67924b71412cd965e0d1c55c0cddb0014c8a725b Author: Thomas Gleixner Date: Mon May 16 12:27:27 2022 +0200 scripts/spdxcheck: Add option to display files without SPDX Makes life easier when chasing the missing ones. Is activated with '-f' on the command line. # scripts/spdxcheck.py -f kernel/ Files without SPDX: ./kernel/cpu.c ./kernel/kmod.c ./kernel/relay.c ./kernel/bpf/offload.c ./kernel/bpf/preload/.gitignore ./kernel/bpf/preload/iterators/README ./kernel/bpf/ringbuf.c ./kernel/cgroup/cgroup.c ./kernel/cgroup/cpuset.c ./kernel/cgroup/legacy_freezer.c ./kernel/debug/debug_core.h ./kernel/debug/kdb/Makefile ./kernel/debug/kdb/kdb_bp.c ./kernel/debug/kdb/kdb_bt.c ./kernel/debug/kdb/kdb_cmds ./kernel/debug/kdb/kdb_debugger.c ./kernel/debug/kdb/kdb_io.c ./kernel/debug/kdb/kdb_keyboard.c ./kernel/debug/kdb/kdb_main.c ./kernel/debug/kdb/kdb_private.h ./kernel/debug/kdb/kdb_support.c ./kernel/locking/lockdep_states.h ./kernel/locking/mutex-debug.c ./kernel/locking/spinlock_debug.c ./kernel/sched/pelt.h With the optional -D parameter the directory depth can be limited: # scripts/spdxcheck.py -f -D 0 kernel/ Files without SPDX: ./kernel/cpu.c ./kernel/kmod.c ./kernel/relay.c Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 0e7f030687efb7a6f8dddd0e967ca4377aee3001 Author: Thomas Gleixner Date: Mon May 16 12:27:26 2022 +0200 scripts/spdxcheck: Add [sub]directory statistics Add functionality to display [sub]directory statistics. This is enabled by adding '-d' to the command line. The optional -D parameter allows to limit the directory depth. If supplied the subdirectories are accumulated # scripts/spdxcheck.py -d kernel/ Incomplete directories: SPDX in Files ./kernel : 111 of 114 97% ./kernel/bpf : 43 of 45 95% ./kernel/bpf/preload : 4 of 5 80% ./kernel/bpf/preload/iterators : 4 of 5 80% ./kernel/cgroup : 10 of 13 76% ./kernel/configs : 0 of 9 0% ./kernel/debug : 3 of 4 75% ./kernel/debug/kdb : 1 of 11 9% ./kernel/locking : 29 of 32 90% ./kernel/sched : 38 of 39 97% The result can be accumulated by restricting the depth via the new command line option '-d $DEPTH': # scripts/spdxcheck.py -d -D1 Incomplete directories: SPDX in Files ./ : 6 of 13 46% ./Documentation : 4096 of 8451 48% ./arch : 13476 of 16402 82% ./block : 100 of 101 99% ./certs : 11 of 14 78% ./crypto : 145 of 176 82% ./drivers : 24682 of 30745 80% ./fs : 1876 of 2110 88% ./include : 5175 of 5757 89% ./ipc : 12 of 13 92% ./kernel : 493 of 527 93% ./lib : 393 of 524 75% ./mm : 151 of 159 94% ./net : 1713 of 1900 90% ./samples : 211 of 273 77% ./scripts : 341 of 435 78% ./security : 241 of 250 96% ./sound : 2438 of 2503 97% ./tools : 3810 of 5462 69% ./usr : 9 of 10 90% Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 300981abddcb13f8f06ad58f52358b53a8096775 Author: Xiaomeng Tong Date: Thu Apr 14 14:21:03 2022 +0800 KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator The bug is here: if (!p) return ret; The list iterator value 'p' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found. To fix the bug, Use a new value 'iter' as the list iterator, while use the old value 'p' as a dedicated variable to point to the found element. Fixes: dfaa973ae960 ("KVM: PPC: Book3S HV: In H_SVM_INIT_DONE, migrate remaining normal-GFNs to secure-GFNs") Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Xiaomeng Tong Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220414062103.8153-1-xiam0nd.tong@gmail.com commit a377ce75e4916da5dbb84672218a7e61e51da3ce Author: Thomas Gleixner Date: Mon May 16 12:27:24 2022 +0200 scripts/spdxcheck: Add directory statistics For better insights. Directories accounted: 4646 Directories complete: 2565 55% Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 149d623fbefe67b4c3cfbaae3246f559478aff4c Author: Thomas Gleixner Date: Mon May 16 12:27:22 2022 +0200 scripts/spdxcheck: Add percentage to statistics Files checked: 75856 Lines checked: 294516 Files with SPDX: 59410 78% Files with errors: 0 Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman commit 0b1e987c56640f6b3e2e39db973e823ce1d01417 Author: Christoph Hellwig Date: Mon May 16 15:38:25 2022 +0200 freevxfs: relicense to GPLv2 only When I wrote the freevxfs driver I had some odd choice of licensing statements, the options are either GPL (without version) or an odd BSD-ish licensense with advertising clause. The GPL vs always meant to be the same as the kernel, that is version 2 only, and the odd BSD-ish license doesn't make much sense. Add a GPL2.0-only SPDX tag to make the GPL intentions clear and drop the bogus BSD license. Acked-by: Krzysztof Błaszkowski Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman commit d53c36e6c83863fde4a2748411c31bc4853a0936 Author: Bagas Sanjaya Date: Fri May 6 14:07:47 2022 +0700 KVM: PPC: Book3S HV: remove extraneous asterisk from rm_host_ipi_action() comment kernel test robot reported kernel-doc warning for rm_host_ipi_action(): arch/powerpc/kvm/book3s_hv_rm_xics.c:887: warning: This comment starts with '/**', but isn't a kernel-doc comment. * Host Operations poked by RM KVM Since the function is static, remove the extraneous (second) asterisk at the head of function comment. Fixes: 0c2a66062470cd ("KVM: PPC: Book3S HV: Host side kick VCPU when poked by real-mode KVM") Reported-by: kernel test robot Signed-off-by: Bagas Sanjaya Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/linux-doc/202204252334.Cd2IsiII-lkp@intel.com/ Link: https://lore.kernel.org/r/20220506070747.16309-1-bagasdotme@gmail.com commit a3641ca416a3da7cbeae5bcf1fc26ba9797a1438 Author: Geert Uytterhoeven Date: Wed May 18 11:04:19 2022 +0200 net: smc911x: Fix min() use in debug code If ENABLE_SMC_DEBUG_PKTS=1: drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_hardware_send_pkt’: include/linux/minmax.h:20:28: error: comparison of distinct pointer types lacks a cast [-Werror] 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ drivers/net/ethernet/smsc/smc911x.c:483:17: note: in expansion of macro ‘min’ 483 | PRINT_PKT(buf, min(len, 64)); Fix this by making the constant unsigned, to match the type of "len". While at it, replace the other missed ternary operator by min(), too. Convert the dummy PRINT_PKT() from a macro to a static inline function, to catch mistakes like this without having to enable debug options manually. Fixes: 5ff0348b7f755aac ("net: smc911x: replace ternary operator with min()") Signed-off-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit 223153ea6c79a0d78dc2a04e3300de1deb336f14 Author: Yang Yingliang Date: Wed May 18 10:08:12 2022 +0800 net: ethernet: sunplus: add missing of_node_put() in spl2sw_mdio_init() of_get_child_by_name() returns device node pointer with refcount incremented. The refcount should be decremented before returning from spl2sw_mdio_init(). Fixes: fd3040b9394c ("net: ethernet: Add driver for Sunplus SP7021") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Wells Lu Signed-off-by: David S. Miller commit e730558adffb88a52e562db089e969ee9510184a Author: Amir Goldstein Date: Wed May 11 22:02:13 2022 +0300 fsnotify: consistent behavior for parent not watching children The logic for handling events on child in groups that have a mark on the parent inode, but without FS_EVENT_ON_CHILD flag in the mask is duplicated in several places and inconsistent. Move the logic into the preparation of mark type iterator, so that the parent mark type will be excluded from all mark type iterations in that case. This results in several subtle changes of behavior, hopefully all desired changes of behavior, for example: - Group A has a mount mark with FS_MODIFY in mask - Group A has a mark with ignore mask that does not survive FS_MODIFY and does not watch children on directory D. - Group B has a mark with FS_MODIFY in mask that does watch children on directory D. - FS_MODIFY event on file D/foo should not clear the ignore mask of group A, but before this change it does And if group A ignore mask was set to survive FS_MODIFY: - FS_MODIFY event on file D/foo should be reported to group A on account of the mount mark, but before this change it is wrongly ignored Fixes: 2f02fd3fa13e ("fanotify: fix ignore mask logic for events on child and on dir") Reported-by: Jan Kara Link: https://lore.kernel.org/linux-fsdevel/20220314113337.j7slrb5srxukztje@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220511190213.831646-3-amir73il@gmail.com commit 14362a2541797cf9df0e86fb12dcd7950baf566e Author: Amir Goldstein Date: Wed May 11 22:02:12 2022 +0300 fsnotify: introduce mark type iterator fsnotify_foreach_iter_mark_type() is used to reduce boilerplate code of iterating all marks of a specific group interested in an event by consulting the iterator report_mask. Use an open coded version of that iterator in fsnotify_iter_next() that collects all marks of the current iteration group without consulting the iterator report_mask. At the moment, the two iterator variants are the same, but this decoupling will allow us to exclude some of the group's marks from reporting the event, for example for event on child and inode marks on parent did not request to watch events on children. Fixes: 2f02fd3fa13e ("fanotify: fix ignore mask logic for events on child and on dir") Reported-by: Jan Kara Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220511190213.831646-2-amir73il@gmail.com commit 7ba106fcd4b441c5d6e3d1219104e022ca470d00 Author: Danielle Ratson Date: Wed May 18 10:27:26 2022 +0300 selftests: netdevsim: Increase sleep time in hw_stats_l3.sh test hw_stats_l3.sh test is failing often for l3 stats shows less than 20 packets after 2 seconds sleep. This is happening since there is a race between the 2 seconds sleep and the netdevsim actually delivering the packets. Increase the sleep time so the packets will be delivered successfully on time. Signed-off-by: Danielle Ratson Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 32329216ca1d6ee29c41215f18b3053bb6158541 Author: Martin Liška Date: Wed May 18 09:18:53 2022 +0200 eth: sun: cassini: remove dead code Fixes the following GCC warning: drivers/net/ethernet/sun/cassini.c:1316:29: error: comparison between two arrays [-Werror=array-compare] drivers/net/ethernet/sun/cassini.c:3783:34: error: comparison between two arrays [-Werror=array-compare] Note that 2 arrays should be compared by comparing of their addresses: note: use ‘&cas_prog_workaroundtab[0] == &cas_prog_null[0]’ to compare the addresses Signed-off-by: Martin Liska Signed-off-by: David S. Miller commit e991d0ed0b7a4c135236ec41ba7df7ea99ea9247 Author: Vincent Whitchurch Date: Tue May 17 10:16:01 2022 +0200 net: stmmac: remove unused get_addr() callback The last caller of the stmmac_desc_ops::get_addr() callback was removed a while ago, so remove the unused callback. Note that the callback also only gets half the descriptor address on systems with 64-bit descriptor addresses, so that should be fixed if it needs to be resurrected later. Fixes: ec222003bd948de8f3 ("net: stmmac: Prepare to add Split Header support") Signed-off-by: Vincent Whitchurch Signed-off-by: David S. Miller commit 6ddabcb106280db0f7344850adfce3dd6b171cbd Author: Yuan Can Date: Wed May 11 07:13:54 2022 +0000 rtc: gamecube: Add missing iounmap in gamecube_rtc_read_offset_from_sram The hw_srnprot needs to be unmapped when gamecube_rtc_read_offset_from_sram returns. Fixs: 86559400b3ef9d (rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U) Signed-off-by: Yuan Can Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220511071354.46202-1-yuancan@huawei.com commit 56da7dc5eb6770f1a30737165a1a69dd0363ba09 Author: Andy Shevchenko Date: Mon May 16 21:05:41 2022 +0300 pinctrl: intel: Drop unused irqchip member in struct intel_pinctrl There is no users of irqchip member in struct intel_pinctrl. Drop it. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 6fb6f8bf888edca56e2a86781de798cca4d7b832 Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 pinctrl: intel: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit da14f237ceef059ff1a9ee14de283905c2dac11c Merge: 491bf8f236fde e626f37e657ad Author: Jens Axboe Date: Wed May 18 06:28:04 2022 -0600 Merge tag 'nvme-5.19-2022-05-18' of git://git.infradead.org/nvme into for-5.19/drivers Pull NVMe updates from Christoph: "nvme updates for Linux 5.19 - tighten the PCI presence check (Stefan Roese): - fix a potential NULL pointer dereference in an error path (Kyle Miller Smith) - fix interpretation of the DMRSL field (Tom Yan) - relax the data transfer alignment (Keith Busch) - verbose error logging improvements (Max Gurtovoy, Chaitanya Kulkarni) - misc cleanups (Chaitanya Kulkarni, me)" * tag 'nvme-5.19-2022-05-18' of git://git.infradead.org/nvme: nvme: split the enum used for various register constants nvme-fabrics: add a request timeout helper nvme-pci: harden drive presence detect in nvme_dev_disable() nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags nvme: mark internal passthru request RQF_QUIET nvme: remove unneeded include from constants file nvme: add missing status values to verbose logging nvme: set dma alignment to dword nvme: fix interpretation of DMRSL commit 0bf1dbee9baf3e78bff297245178f8c9a8ef8670 Author: Christoph Hellwig Date: Wed May 18 10:40:05 2022 +0200 io_uring: use rcu_dereference in io_close Accessing the file table needs a rcu_dereference_protected(). Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-7-hch@lst.de Signed-off-by: Jens Axboe commit a294bef57c55a45aef51d31e71d6892e8eba1483 Author: Christoph Hellwig Date: Wed May 18 10:40:04 2022 +0200 io_uring: consistently use the EPOLL* defines POLL* are unannotated values for the userspace ABI, while everything in-kernel should use EPOLL* and the __poll_t type. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-6-hch@lst.de Signed-off-by: Jens Axboe commit 58f5c8d39e0ea07fdaaea6a85c49000da83dc0cc Author: Christoph Hellwig Date: Wed May 18 10:40:03 2022 +0200 io_uring: make apoll_events a __poll_t apoll_events is fed to vfs_poll and the poll tables, so it should be a __poll_t. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-5-hch@lst.de Signed-off-by: Jens Axboe commit ee67ba3b20f7dcd001b7743eb8e46880cb27fdc6 Author: Christoph Hellwig Date: Wed May 18 10:40:02 2022 +0200 io_uring: drop a spurious inline on a forward declaration io_file_get_normal isn't marked inline, so don't claim it as such in the forward declaration. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-4-hch@lst.de Signed-off-by: Jens Axboe commit 984824db844a9bd6e9e15ee469241982526a6ccd Author: Christoph Hellwig Date: Wed May 18 10:40:01 2022 +0200 io_uring: don't use ERR_PTR for user pointers ERR_PTR abuses the high bits of a pointer to transport error information. This is only safe for kernel pointers and not user pointers. Fix io_buffer_select and its helpers to just return NULL for failure and get rid of this abuse. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-3-hch@lst.de Signed-off-by: Jens Axboe commit 20cbd21d899b72765e38481a926c7b2008c64350 Author: Christoph Hellwig Date: Wed May 18 10:40:00 2022 +0200 io_uring: use a rwf_t for io_rw.flags Use the proper type. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220518084005.3255380-2-hch@lst.de Signed-off-by: Jens Axboe commit c7fb19428d67dd0a2a78a4f237af01d39c78dc5a Author: Jens Axboe Date: Sat Apr 30 14:38:53 2022 -0600 io_uring: add support for ring mapped supplied buffers Provided buffers allow an application to supply io_uring with buffers that can then be grabbed for a read/receive request, when the data source is ready to deliver data. The existing scheme relies on using IORING_OP_PROVIDE_BUFFERS to do that, but it can be difficult to use in real world applications. It's pretty efficient if the application is able to supply back batches of provided buffers when they have been consumed and the application is ready to recycle them, but if fragmentation occurs in the buffer space, it can become difficult to supply enough buffers at the time. This hurts efficiency. Add a register op, IORING_REGISTER_PBUF_RING, which allows an application to setup a shared queue for each buffer group of provided buffers. The application can then supply buffers simply by adding them to this ring, and the kernel can consume then just as easily. The ring shares the head with the application, the tail remains private in the kernel. Provided buffers setup with IORING_REGISTER_PBUF_RING cannot use IORING_OP_{PROVIDE,REMOVE}_BUFFERS for adding or removing entries to the ring, they must use the mapped ring. Mapped provided buffer rings can co-exist with normal provided buffers, just not within the same group ID. To gauge overhead of the existing scheme and evaluate the mapped ring approach, a simple NOP benchmark was written. It uses a ring of 128 entries, and submits/completes 32 at the time. 'Replenish' is how many buffers are provided back at the time after they have been consumed: Test Replenish NOPs/sec ================================================================ No provided buffers NA ~30M Provided buffers 32 ~16M Provided buffers 1 ~10M Ring buffers 32 ~27M Ring buffers 1 ~27M The ring mapped buffers perform almost as well as not using provided buffers at all, and they don't care if you provided 1 or more back at the same time. This means application can just replenish as they go, rather than need to batch and compact, further reducing overhead in the application. The NOP benchmark above doesn't need to do any compaction, so that overhead isn't even reflected in the above test. Co-developed-by: Dylan Yudaken Signed-off-by: Jens Axboe commit d8c2237d0aa9c04b867ce1e281e2a30a86a68e3b Author: Jens Axboe Date: Thu Apr 28 13:02:27 2022 -0600 io_uring: add io_pin_pages() helper Abstract this out from io_sqe_buffer_register() so we can use it elsewhere too without duplicating this code. No intended functional changes in this patch. Signed-off-by: Jens Axboe commit 3d200242a6c968af321913b635fc4014b238cba4 Author: Jens Axboe Date: Thu May 5 21:47:55 2022 -0600 io_uring: add buffer selection support to IORING_OP_NOP Obviously not really useful since it's not transferring data, but it is helpful in benchmarking overhead of provided buffers. Signed-off-by: Jens Axboe commit e7637a492b9f1ae6b7cfcecf0aed5e4c76efa3bd Author: Jens Axboe Date: Sun May 15 11:19:43 2022 -0600 io_uring: fix locking state for empty buffer group io_provided_buffer_select() must drop the submit lock, if needed, even in the error handling case. Failure to do so will leave us with the ctx->uring_lock held, causing spew like: ==================================== WARNING: iou-wrk-366/368 still has locks held! 5.18.0-rc6-00294-gdf8dc7004331 #994 Not tainted ------------------------------------ 1 lock held by iou-wrk-366/368: #0: ffff0000c72598a8 (&ctx->uring_lock){+.+.}-{3:3}, at: io_ring_submit_lock+0x20/0x48 stack backtrace: CPU: 4 PID: 368 Comm: iou-wrk-366 Not tainted 5.18.0-rc6-00294-gdf8dc7004331 #994 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace.part.0+0xa4/0xd4 show_stack+0x14/0x5c dump_stack_lvl+0x88/0xb0 dump_stack+0x14/0x2c debug_check_no_locks_held+0x84/0x90 try_to_freeze.isra.0+0x18/0x44 get_signal+0x94/0x6ec io_wqe_worker+0x1d8/0x2b4 ret_from_fork+0x10/0x20 and triggering later hangs off get_signal() because we attempt to re-grab the lock. Reported-by: syzbot+987d7bb19195ae45208c@syzkaller.appspotmail.com Fixes: 149c69b04a90 ("io_uring: abstract out provided buffer list selection") Signed-off-by: Jens Axboe commit 2fa1533f79d3fa69cbd65605f6d57adbb2633079 Author: Nick Hawkins Date: Mon May 16 11:33:46 2022 -0500 MAINTAINERS: Introduce HPE GXP Architecture Create a section in MAINTAINERS for the GXP HPE architecture. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann commit 53658de4fadb3a329bf20bba72e7064292d1ee34 Author: Nick Hawkins Date: Mon May 16 11:33:45 2022 -0500 ARM: dts: Introduce HPE GXP Device tree The HPE SoC is new to linux. A basic device tree layout with minimum required for linux to boot including a timer and watchdog support has been created. The dts file is empty at this point but will be updated in subsequent updates as board specific features are enabled. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann Acked-by: Krzysztof Kozlowski commit b1d81dca096fb12799ce3b3e900b6a7fb4ce5149 Author: Nick Hawkins Date: Mon May 16 11:33:44 2022 -0500 dt-bindings: arm: hpe: add GXP Support Add support for HPE GXP. The GXP is based on the cortex a9 processor and supports arm7. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski commit ea526e21a87add839f7a6e453a4f1029aa0a6ca5 Author: Nick Hawkins Date: Mon May 16 11:33:43 2022 -0500 dt-bindings: timer: hpe,gxp-timer: Add HPE GXP Timer and Watchdog Add support for the HPE GXP Timer and Watchdog. There are multiple timers on the SoC but only one is enabled at this time. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring commit 5184f4bf151bb4f4ab2f0f10a66b96acdf35da1a Author: Nick Hawkins Date: Mon May 16 11:33:42 2022 -0500 clocksource/drivers/timer-gxp: Add HPE GXP Timer Add support for the HPE GXP SOC timer. The GXP supports several different kinds of timers but for the purpose of this driver there is only support for the General Timer. The timer has a 1us resolution and is 32 bits. The timer also creates a child watchdog device as the register region is the same. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann commit 6b47441bed490d0bd39fdafaa95ac7acdcd0c11a Author: Nick Hawkins Date: Mon May 16 11:33:41 2022 -0500 watchdog: hpe-wdt: Introduce HPE GXP Watchdog Add support for the HPE GXP Watchdog. The GXP asic contains a full complement of timers one of which is the watchdog timer. The watchdog timer is 16 bit and has 10ms resolution. The watchdog is created as a child device of timer since the same register range is used. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann Acked-by: Guenter Roeck commit 1219ce9d9f2efa01b59f1e1298458b73fb88f02f Author: Nick Hawkins Date: Mon May 16 11:33:40 2022 -0500 ARM: configs: multi_v7_defconfig: Add HPE GXP ARCH Enable HPE GXP Architecture and its watchdog for base support for HPE GXP SoCs. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann commit 11d894405d0cbce0235831d302b1ff0c0142670d Author: Nick Hawkins Date: Mon May 16 11:33:39 2022 -0500 ARM: hpe: Introduce the HPE GXP architecture The GXP is the HPE BMC SoC that is used in the majority of current generation HPE servers. Traditionally the asic will last multiple generations of server before being replaced. Info about SoC: HPE GXP is the name of the HPE Soc. This SoC is used to implement many BMC features at HPE. It supports ARMv7 architecture based on the Cortex A9 core. It is capable of using an AXI bus to whicha memory controller is attached. It has multiple SPI interfaces to connect boot flash and BIOS flash. It uses a 10/100/1000 MAC for network connectivity. It has multiple i2c engines to drive connectivity with a host infrastructure. There currently are no public specifications but this process is being worked. Previously there was a requirement to reset the EHCI controller for the asic to boot. This functionality has been moved to the u-boot bootloader. Signed-off-by: Nick Hawkins Signed-off-by: Arnd Bergmann commit 86d282aca8944adba55e7b7104df84d3dc7c891b Merge: e8bacf408fa81 32d0efabeec09 Author: David S. Miller Date: Wed May 18 13:03:43 2022 +0100 Merge branch 'armada-3720-turris-mox-and-orion-mdio' Chris Packham says: ==================== armada-3720-turris-mox and orion-mdio This is a follow up to the change that converted the orion-mdio dt-binding from txt to DT schema format. At the time I thought the binding needed 'unevaluatedProperties: false' because the core mdio.yaml binding didn't handle the DSA switches. In reality it was simply the invalid reg property causing the downstream nodes to be unevaluated. Fixing the reg nodes means we can set 'unevaluatedProperties: true' Marek, I don't know if you had a change for the reg properties in flight. I didn't see anything on lore/lkml so sorry if this crosses with something you've done. ==================== Signed-off-by: David S. Miller commit 32d0efabeec09bca0320f4136628699026dfba2f Author: Chris Packham Date: Tue May 17 10:48:01 2022 +1200 dt-bindings: net: marvell,orion-mdio: Set unevaluatedProperties to false When the binding was converted it appeared necessary to set 'unevaluatedProperties: true' because of the switch devices on the turris-mox board. Actually the error was because of the reg property being incorrect causing the rest of the properties to be unevaluated. After the reg properties are fixed for turris-mox we can set 'unevaluatedProperties: false' as is generally expected. Signed-off-by: Chris Packham Acked-by: Rob Herring Signed-off-by: David S. Miller commit 9fd914bb05c24a779bba7b53d89516016c30dfbe Author: Chris Packham Date: Tue May 17 10:48:00 2022 +1200 arm64: dts: armada-3720-turris-mox: Correct reg property for mdio devices MDIO devices have #address-cells = <1>, #size-cells = <0>. Now that we have a schema enforcing this for marvell,orion-mdio we can see that the turris-mox has a unnecessary 2nd cell for the switch nodes reg property of it's switch devices. Remove the unnecessary 2nd cell from the switches reg property. Signed-off-by: Chris Packham Reviewed-by: Marek Behún Signed-off-by: David S. Miller commit e82e7c6dde91acd6748d672a44dc1980ce239f86 Author: Johan Hovold Date: Tue May 17 18:17:36 2022 +0200 USB: serial: pl2303: fix type detection for odd device At least one pl2303 device has a bcdUSB of 1.0.1 which most likely was was intended as 1.1. Allow bcdDevice 1.0.1 but interpret it as 1.1. Fixes: 1e9faef4d26d ("USB: serial: pl2303: fix HX type detection") Cc: stable@vger.kernel.org # 5.13 Link: https://lore.kernel.org/linux-usb/CAJixRzqf4a9-ZKZDgWxicc_BpfdZVE9qqGmkiO7xEstOXUbGvQ@mail.gmail.com Reported-by: Gary van der Merwe Link: https://lore.kernel.org/r/20220517161736.13313-1-johan@kernel.org Signed-off-by: Johan Hovold commit e8bacf408fa816fc01c25ce7203e41601e98a027 Merge: 6431ce6cd3bb2 008db08b64f44 Author: David S. Miller Date: Wed May 18 12:51:00 2022 +0100 Merge branch 'dsa-microchip-ksz_switch-refactor' Arun Ramadoss says: ==================== net: dsa: microchip: refactor the ksz switch init function During the ksz_switch_register function, it calls the individual switches init functions (ksz8795.c and ksz9477.c). Both these functions have few things in common like, copying the chip specific data to struct ksz_dev, allocating ksz_port memory and mib_names memory & cnt. And to add the new LAN937x series switch, these allocations has to be replicated. Based on the review feedback of LAN937x part support patch, refactored the switch init function to move allocations to switch register. Link:https://patchwork.kernel.org/project/netdevbpf/patch/20220504151755.11737-8-arun.ramadoss@microchip.com/ ==================== Signed-off-by: David S. Miller commit 008db08b64f44dfc69efb788e8b4bfa43ba91700 Author: Arun Ramadoss Date: Tue May 17 15:13:33 2022 +0530 net: dsa: microchip: remove unused members in ksz_device The name, regs_size and overrides members in struct ksz_device are unused. Hence remove it. And host_mask is used in only place of ksz8795.c file, which can be replaced by dev->info->cpu_ports Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 65ac79e1812016d7c5760872736802f985ec7455 Author: Arun Ramadoss Date: Tue May 17 15:13:32 2022 +0530 net: dsa: microchip: add the phylink get_caps This patch add the support for phylink_get_caps for ksz8795 and ksz9477 series switch. It updates the struct ksz_switch_chip with the details of the internal phys and xmii interface. Then during the get_caps based on the bits set in the structure, corresponding phy mode is set. Signed-off-by: Arun Ramadoss Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b094c679662c0125f763d996a46c687c437b42a0 Author: Prasanna Vengateshan Date: Tue May 17 15:13:31 2022 +0530 net: dsa: move mib->cnt_ptr reset code to ksz_common.c mib->cnt_ptr resetting is handled in multiple places as part of port_init_cnt(). Hence moved mib->cnt_ptr code to ksz common layer and removed from individual product files. Signed-off-by: Prasanna Vengateshan Signed-off-by: Arun Ramadoss Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 997d2126ac61128360f024ab4b7d72a006cf6094 Author: Arun Ramadoss Date: Tue May 17 15:13:30 2022 +0530 net: dsa: microchip: move get_strings to ksz_common ksz8795 and ksz9477 uses the same algorithm for copying the ethtool strings. Hence moved to ksz_common to remove the redundant code. Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 198b34783ab10d0c58bf2ae2574e7fc704129058 Author: Arun Ramadoss Date: Tue May 17 15:13:29 2022 +0530 net: dsa: microchip: move port memory allocation to ksz_common ksz8795 and ksz9477 init function initializes the memory to dev->ports, mib counters and assigns the ds real number of ports. Since both the routines are same, moved the allocation of port memory to ksz_switch_register after init. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit a530e6f2204afe28d745adc5ecbba77e3d6a78b0 Author: Arun Ramadoss Date: Tue May 17 15:13:28 2022 +0530 net: dsa: microchip: move struct mib_names to ksz_chip_data The ksz88xx family has one set of mib_names. The ksz87xx, ksz9477, LAN937x based switches has one set of mib_names. In order to remove redundant declaration, moved the struct mib_names to ksz_chip_data structure. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit eee16b147121cec77db51455ef30f4ad5102b270 Author: Arun Ramadoss Date: Tue May 17 15:13:27 2022 +0530 net: dsa: microchip: perform the compatibility check for dev probed This patch perform the compatibility check for the device after the chip detect is done. It is to prevent the mismatch between the device compatible specified in the device tree and actual device found during the detect. The ksz9477 device doesn't use any .data in the of_device_id. But the ksz8795_spi uses .data for assigning the regmap between 8830 family and 87xx family switch. Changed the regmap assignment based on the chip_id from the .data. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller commit 462d525018f068338a4d0b571aa515e26a8320e7 Author: Arun Ramadoss Date: Tue May 17 15:13:26 2022 +0530 net: dsa: microchip: move ksz_chip_data to ksz_common This patch moves the ksz_chip_data in ksz8795 and ksz9477 to ksz_common. At present, the dev->chip_id is iterated with the ksz_chip_data and then copy its value to the ksz_dev structure. These values are declared as constant. Instead of copying the values and referencing it, this patch update the dev->info to the ksz_chip_data based on the chip_id in the init function. And also update the ksz_chip_data values for the LAN937x based switches. Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit a30bf805592ed56af7a9482b4339d9c9bb092784 Author: Arun Ramadoss Date: Tue May 17 15:13:25 2022 +0530 net: dsa: microchip: ksz8795: update the port_cnt value in ksz_chip_data The port_cnt value in the structure is not used in the switch_init. Instead it uses the fls(chip->cpu_port), this is due to one of port in the ksz8794 unavailable. The cpu_port for the 8794 is 0x10, fls(0x10) = 5, hence updating it directly in the ksz_chip_data structure in order to same with all the other switches in ksz8795.c and ksz9477.c files. Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 94d3477897481b92874654455e263e0b1728acb5 Author: Heiko Carstens Date: Mon May 16 14:37:47 2022 +0200 s390/head: get rid of 31 bit leftovers Get rid of old 31 bit leftovers within ipl code: - convert everything to pc relative code - use 64 bit addressing mode as early as possible - use 64 bit arithmetics wherever possible This way the code doesn't look as odd as before anymore. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens commit 7acc8a2ac0c0a87a94950f802a292aa40e866d9d Merge: 7b145802ba545 be60348a82f53 Author: Rafael J. Wysocki Date: Wed May 18 13:11:19 2022 +0200 Merge back earlier int340x driver changes for 5.19. commit 78488a64aea94a3336ee97f345c1496e9bc5ebdf Author: Johannes Berg Date: Tue May 17 12:05:14 2022 +0300 iwlwifi: mei: fix potential NULL-ptr deref If SKB allocation fails, continue rather than using the NULL pointer. Coverity CID: 1497650 Cc: stable@vger.kernel.org Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.90c1b1fd534e.Ibb42463e74d0ec7d36ec81df22e171ae1f6268b0@changeid Signed-off-by: Johannes Berg commit 55cf10488d7a9fa1b1b473a5e44a80666932e094 Author: Avraham Stern Date: Tue May 17 12:05:13 2022 +0300 iwlwifi: mei: clear the sap data header before sending The SAP data header has some fields that are marked as reserved but are actually in use by CSME. Clear those fields before sending the data to avoid having random values in those fields. Cc: stable@vger.kernel.org Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.8dd3423cf683.I02976028eaa6aab395cb2e701fa7127212762eb7@changeid Signed-off-by: Johannes Berg commit 98c0de7b26a1872f000ffae5661d2709b1d01932 Author: Miri Korenblit Date: Tue May 17 12:05:12 2022 +0300 iwlwifi: mvm: remove vif_count We used to count the number of ieee80211_vifs in mvm. This was needed for the legacy PM API, which is no longer supported. Remove it. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.8c91ae023b15.Ia6145e4930b1d28f3fcedc316b4f177295b00557@changeid Signed-off-by: Johannes Berg commit 147eb05f24e6f603dc2dc7f2e0675ba1707c538f Author: Emmanuel Grumbach Date: Tue May 17 12:05:11 2022 +0300 iwlwifi: mvm: always tell the firmware to accept MCAST frames in BSS Make the firmware's life easier and always accept MCAST frames. If needed, drop them in the driver. We need to filter out MCAST frames in order not to have false positives in the decryption check. If we accept MCAST frames before we have the GKT installed, we'll end up complaining that we can't decrypt the frame. Implement the same filtering, but in the driver. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.479956a46317.I21fac7ede9eca85a662671d694872898df884f0b@changeid Signed-off-by: Johannes Berg commit 184f10db5f8f15902ac8687b26507b558ac3204d Author: Mordechay Goodstein Date: Tue May 17 12:05:10 2022 +0300 iwlwifi: mvm: add OTP info in case of init failure This helps to understand HW issues that can happen while initializing the nic. Signed-off-by: Mordechay Goodstein Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.48464938b27a.I9b381f0da5e0636ad6a5f6c13f98edb9031b50fb@changeid Signed-off-by: Johannes Berg commit 9d096e3d3061dbf4ee10e2b59fc2c06e05bdb997 Author: Emmanuel Grumbach Date: Tue May 17 12:05:09 2022 +0300 iwlwifi: mvm: fix assert 1F04 upon reconfig When we reconfig we must not send the MAC_POWER command that relates to a MAC that was not yet added to the firmware. Ignore those in the iterator. Cc: stable@vger.kernel.org Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120044.ed2ffc8ce732.If786e19512d0da4334a6382ea6148703422c7d7b@changeid Signed-off-by: Johannes Berg commit d1f6530c3e373ddd7c76b05646052a27eead14ad Author: Johannes Berg Date: Tue May 17 12:05:08 2022 +0300 iwlwifi: fw: init SAR GEO table only if data is present When no table data was read from ACPI, then filling the data and returning success here will fill zero values, which means transmit power will be limited to 0 dBm. This is clearly not intended. Return an error from iwl_sar_geo_init() if there's no data to fill into the command structure. Cc: stable@vger.kernel.org Signed-off-by: Johannes Berg Fixes: 78a19d5285d9 ("iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage") Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120044.bc45923b74e9.Id2b4362234b7f8ced82c591b95d4075dd2ec12f4@changeid Signed-off-by: Johannes Berg commit 51e073c23b46236d8dfbc1cbf7d95b0a5ff6e6e7 Author: Johannes Berg Date: Tue May 17 12:05:07 2022 +0300 iwlwifi: mvm: clean up authorized condition We track in mvmvif->authorized when the AP STA becomes authorized and no longer authorized, so we don't need the complex condition with station lookup. Simplify the code. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120044.41f528383a6b.I1cdf165581b781c53c8e6ac8779a2282b1f67c59@changeid Signed-off-by: Johannes Berg commit 537b76d26cbbeb696ec7b47536fc9ce58f5ea22b Author: Haim Dreyfuss Date: Tue May 17 12:05:06 2022 +0300 iwlwifi: mvm: use NULL instead of ERR_PTR when parsing wowlan status We anyway don't differentiate between the errors so it is pointless, returning NULL will be simpler in this case. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120044.78a7651327bb.I77480de7c26db850680f96a3440fb6a1b45dd9d2@changeid Signed-off-by: Johannes Berg commit c1918196427b917d1fbf064b07538410807f8b03 Author: Johannes Berg Date: Tue May 17 12:05:05 2022 +0300 iwlwifi: pcie: simplify MSI-X cause mapping We're currently manually encoding a calculation here since the HW just maps all the bits of specific registers to specific offsets, which led to the bug fixed here previously with the Bz SW_ERROR interrupt. Clean up the code to only know about the mapping offset (-16 or 16 depending on the register) to avoid such issues in the future. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120044.19abe9a4d171.I934356911277f9b2a955808763f317986f69a461@changeid Signed-off-by: Johannes Berg commit 6431ce6cd3bb2ccf55acab0ccaae33208e9a0ab3 Merge: 6e144b47f560e 94db331778192 Author: David S. Miller Date: Wed May 18 11:35:27 2022 +0100 Merge tag 'mlx5-updates-2022-05-17' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-05-17 MISC updates to mlx5 dirver 1) Aya Levin allows relaxed ordering over VFs 2) Gal Pressman Adds support XDP SQs for uplink representors in switchdev mode 3) Add debugfs TC stats and command failure syndrome for debuggability 4) Tariq uses variants of vzalloc where it could help 5) Multiport eswitch support from Elic Cohen: Eli Cohen Says: =============== The multiport eswitch feature allows to forward traffic from a representor net device to the uplink port of an associated eswitch's uplink port. This feature requires creating a LAG object. Since LAG can be created only once for a function, the feature is mutual exclusive with either bonding or multipath. Multipath eswitch mode is entered automatically these conditions are met: 1. No other LAG related mode is active. 2. A rule that explicitly forwards to an uplink port is inserted. The implementation maintains a reference count on such rules. When the reference count reaches zero, the LAG is released and other modes may be used. When an explicit rule that explicitly forwards to an uplink port is inserted while another LAG mode is active, that rule will not be offloaded by the hardware since the hardware cannot guarantee that the rule will actually be forwarded to that port. Example rules that forwards to an uplink port is: $ tc filter add dev rep0 root flower action mirred egress \ redirect dev uplinkrep0 $ tc filter add dev rep0 root flower action mirred egress \ redirect dev uplinkrep1 This feature is supported only if LAG_RESOURCE_ALLOCATION firmware configuration parameter is set to true. The series consists of three patches: 1. Lag state machine refactor This patch does not add new functionality but rather changes the way the state of the LAG is maintained. 2. Small fix to remove unused argument. 3. The actual implementation of the feature. =============== ==================== Signed-off-by: David S. Miller commit a74dfa434f98a4fedf3ae2cd8dbeae1e08c1765f Author: Thomas Gleixner Date: Tue May 10 19:24:51 2022 +0200 clocksource/drivers/timer-sun5i: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Daniel Lezcano Cc: Chen-Yu Tsai Cc: Samuel Holland Cc: Philipp Zabel Cc: linux-sunxi@lists.linux.dev Link: https://lore.kernel.org/r/20220510171254.970933294@linutronix.de Signed-off-by: Daniel Lezcano commit 60bff9f8ef4bdd1eb24769deb66084dcfd3888d2 Author: Thomas Gleixner Date: Tue May 10 19:24:49 2022 +0200 clocksource/drivers/timer-sun4i: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Daniel Lezcano Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: linux-sunxi@lists.linux.dev Link: https://lore.kernel.org/r/20220510171254.908144392@linutronix.de Signed-off-by: Daniel Lezcano commit 6bd8643736cb4e9b5ed744f955318037c7fefee8 Author: Thomas Gleixner Date: Tue May 10 19:24:48 2022 +0200 clocksource/drivers/pistachio: Convert to SPDX identifier The licensing text references explicitely the COPYING file in the kernel base directory, which is clearly GPL version 2 only. Signed-off-by: Thomas Gleixner Cc: Ezequiel Garcia Cc: Daniel Lezcano Link: https://lore.kernel.org/r/20220510171254.843410802@linutronix.de Signed-off-by: Daniel Lezcano commit 029aede7774c7997f14364ac4aa8c5503e5624e9 Author: Thomas Gleixner Date: Tue May 10 19:24:46 2022 +0200 clocksource/drivers/orion: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Sebastian Hesselbarth Cc: Daniel Lezcano Link: https://lore.kernel.org/r/20220510171254.780389240@linutronix.de Signed-off-by: Daniel Lezcano commit 85c5aafd8e6a2476d27715b57dbcf26805eb3ab7 Author: Thomas Gleixner Date: Tue May 10 19:24:45 2022 +0200 clocksource/drivers/lpc32xx: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Joachim Eastwood Cc: Vladimir Zapolskiy Cc: Daniel Lezcano Cc: linux-arm-kernel@lists.infradead.org Acked-by: Vladimir Zapolskiy Link: https://lore.kernel.org/r/20220510171254.717233312@linutronix.de Signed-off-by: Daniel Lezcano commit b3a9ce9d24ffc3e8018dc35a5f4e8f3406cf497f Author: Thomas Gleixner Date: Tue May 10 19:24:43 2022 +0200 clocksource/drivers/digicolor: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Daniel Lezcano Cc: Baruch Siach Cc: linux-arm-kernel@lists.infradead.org Acked-by: Baruch Siach Link: https://lore.kernel.org/r/20220510171254.655035023@linutronix.de Signed-off-by: Daniel Lezcano commit 7160d9c4cce94612d5f42a5db392cd606a38737a Author: Thomas Gleixner Date: Tue May 10 19:24:41 2022 +0200 clocksource/drivers/armada-370-xp: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is an excerpt of the corresponding GPLv2 clause 11. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Gregory Clement Cc: Daniel Lezcano Acked-by: Gregory CLEMENT Link: https://lore.kernel.org/r/20220510171254.592781786@linutronix.de Signed-off-by: Daniel Lezcano commit dcfa47d4720f91e278a81d0f64d2e74e3c59018b Author: Thomas Gleixner Date: Tue May 10 19:24:40 2022 +0200 clocksource/drivers/mips-gic-timer: Convert to SPDX identifier The licensing text references explicitely the COPYING file in the kernel base directory, which is clearly GPL version 2 only. Signed-off-by: Thomas Gleixner Cc: Thomas Bogendoerfer Cc: Serge Semin Cc: Daniel Lezcano Cc: linux-mips@vger.kernel.org Acked-by: Serge Semin Link: https://lore.kernel.org/r/20220510171254.529249404@linutronix.de Signed-off-by: Daniel Lezcano commit eb988ba4afbf821e8877810221e6bc00af161014 Author: Thomas Gleixner Date: Tue May 10 19:24:38 2022 +0200 clocksource/drivers/jcore: Convert to SPDX identifier The licensing text references explicitely the COPYING file in the kernel base directory, which is clearly GPL version 2 only. Signed-off-by: Thomas Gleixner Cc: Rich Felker Cc: Daniel Lezcano Link: https://lore.kernel.org/r/20220510171254.467236056@linutronix.de Signed-off-by: Daniel Lezcano commit b89e96917dba49d9fda30f2e0c5a8effdf02cca5 Author: Thomas Gleixner Date: Tue May 10 19:24:37 2022 +0200 clocksource/drivers/bcm_kona: Convert to SPDX identifier The license information clearly states GPL version 2 only. The extra text which excludes warranties is a transcript of the corresponding GPLv2 clause 11, which is explicitely referenced for details. So the SPDX identifier covers it completely. Signed-off-by: Thomas Gleixner Cc: Daniel Lezcano Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: Broadcom Kernel Team Cc: linux-spdx@vger.kernel.org Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220510171254.404209482@linutronix.de Signed-off-by: Daniel Lezcano commit a98399cbc1e05f7b977419f03905501d566cf54e Author: Andre Przywara Date: Fri May 6 17:25:22 2022 +0100 clocksource/drivers/sp804: Avoid error on multiple instances When a machine sports more than one SP804 timer instance, we only bring up the first one, since multiple timers of the same kind are not useful to Linux. As this is intentional behaviour, we should not return an error message, as we do today: =============== [ 0.000800] Failed to initialize '/bus@8000000/motherboard-bus@8000000/iofpga-bus@300000000/timer@120000': -22 =============== Replace the -EINVAL return with a debug message and return 0 instead. Also we do not reach the init function anymore if the DT node is disabled (as this is now handled by OF_DECLARE), so remove the explicit check for that case. This fixes a long standing bogus error when booting ARM's fastmodels. Signed-off-by: Andre Przywara Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220506162522.3675399-1-andre.przywara@arm.com Signed-off-by: Daniel Lezcano commit 232ccac1bd9b5bfe73895f527c08623e7fa0752d Author: Samuel Holland Date: Sun May 8 20:21:21 2022 -0500 clocksource/drivers/riscv: Events are stopped during CPU suspend Some implementations of the SBI time extension depend on hart-local state (for example, CSRs) that are lost or hardware that is powered down when a CPU is suspended. To be safe, the clockevents driver cannot assume that timer IRQs will be received during CPU suspend. Fixes: 62b019436814 ("clocksource: new RISC-V SBI timer driver") Signed-off-by: Samuel Holland Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20220509012121.40031-1-samuel@sholland.org Signed-off-by: Daniel Lezcano commit 41929c9f628b9990d33a200c54bb0c919e089aa8 Author: Linus Walleij Date: Wed Apr 6 22:55:05 2022 +0200 clocksource/drivers/ixp4xx: Drop boardfile probe path The boardfiles for IXP4xx have been deleted. Delete all the quirks and code dealing with that boot path and rely solely on device tree boot. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220406205505.2332821-1-linus.walleij@linaro.org Signed-off-by: Daniel Lezcano commit b8b1ab133e593f0dbfa47b174a54b852af6f856e Author: Allen-KH Cheng Date: Fri Mar 11 21:07:29 2022 +0800 dt-bindings: timer: Add compatible for Mediatek MT8186 This commit adds dt-binding documentation of timer for Mediatek MT8186 SoC Platform. Signed-off-by: Allen-KH Cheng Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220311130732.22706-2-allen-kh.cheng@mediatek.com Signed-off-by: Daniel Lezcano commit 58a94a62a53ff76085f8b3face7d9b929b6a34ee Author: Stephen Rothwell Date: Tue May 17 18:58:43 2022 +1000 netfilter: ctnetlink: fix up for "netfilter: conntrack: remove unconfirmed list" After merging the net-next tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning: nf_conntrack_netlink.c:1717 warning: 'ctnetlink_dump_one_entry' defined but not used Fixes: 8a75a2c17410 ("netfilter: conntrack: remove unconfirmed list") Signed-off-by: Stephen Rothwell Signed-off-by: Florian Westphal commit 94db3317781922ba52722c58061e0e8517d4d80d Author: Eli Cohen Date: Mon Jan 31 07:49:51 2022 +0200 net/mlx5: Support multiport eswitch mode Multiport eswitch mode is a LAG mode that allows to add rules that forward traffic to a specific physical port without being affected by LAG affinity configuration. This mode of operation is mutual exclusive with the other LAG modes used by multipath and bonding. To make the transition between the modes, we maintain a counter on the number of rules specifying one of the uplink representors as the target of mirred egress redirect action. An example of such rule would be: $ tc filter add dev enp8s0f0_0 prot all root flower dst_mac \ 00:11:22:33:44:55 action mirred egress redirect dev enp8s0f0 If the reference count just grows to one and LAG is not in use, we create the LAG in multiport eswitch mode. Other mode changes are not allowed while in this mode. When the reference count reaches zero, we destroy the LAG and let other modes be used if needed. logic also changed such that if forwarding to some uplink destination cannot be guaranteed, we fail the operation so the rule will eventually be in software and not in hardware. Signed-off-by: Eli Cohen Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit a4a9c87ebb689c8c5e6609b8b4dda0b6da5b1ebe Author: Eli Cohen Date: Sun Feb 6 14:57:42 2022 +0200 net/mlx5: Remove unused argument Argument ndev is not used in mlx5_handle_changeupper_event() Remove it. Signed-off-by: Eli Cohen Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit ef9a3a4a813ac0debfd2d64b71db0a55dbc3efd7 Author: Eli Cohen Date: Mon Jan 24 11:30:46 2022 +0200 net/mlx5: Lag, refactor lag state machine LAG state machine is implemented using bit flags. However, all these bit flags, except for MLX5_LAG_FLAG_HASH_BASED, are really mutual exclusive. In addition, MLX5_LAG_FLAG_READY is used by bonding to mark if we have our netdevices successfully added to lag and does not really belong in the same flags variable as the other flags. Rename MLX5_LAG_FLAG_READY to MLX5_LAG_FLAG_NDEVS_READY to better reflect its purpose and put it in a new flags variable. For the rest of the flags, we introduce a mode enum to hold the state of the LAG. Remove the shared fdb boolean flag from struct mlx5_lag and store this configuration as a mode flag. Change all flag related operations to use standard Linux APIs. Signed-off-by: Eli Cohen Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 65810a2d2ab3c2a640e14a3e249c87e50675e6ce Author: Gal Pressman Date: Wed Mar 2 10:02:59 2022 +0200 net/mlx5e: Add XDP SQs to uplink representors steering tables This patch adds the XDP SQs to the uplink representors steering tables in swichdev mode and enables XDP usage on them. Signed-off-by: Gal Pressman Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 6d0ba49321a40a8dada22c223bbe91c063b08db4 Author: Moshe Tal Date: Wed Apr 27 18:26:52 2022 +0300 net/mlx5e: Correct the calculation of max channels for rep Correct the calculation of maximum channels of rep to better utilize the hardware resources and allow a larger scale of reps. This will allow creation of all virtual ports configured. Fixes: 473baf2e9e8c ("net/mlx5e: Allow profile-specific limitation on max num of channels") Signed-off-by: Moshe Tal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 77422a8f6f61be1ef64978e9a94f40fed0d1634e Author: Saeed Mahameed Date: Tue May 17 20:13:09 2022 -0700 net/mlx5e: CT: Add ct driver counters Connection offload is translated to multiple rules over several hardware flow tables. Unhandled end-cases may cause a hardware resource leak causing multiple system symptoms such as a host memory leak, decreased performance and other scale related issues. Export the current number of firmware FTEs related to the CT table as a debugfs counter. Also add a dropped packets counter to help debug packets dropped on restore failure. To show the offloaded count: cat /sys/kernel/debug/mlx5//ct_nic/offloaded To show the dropped count: cat /sys/kernel/debug/mlx5//ct_nic/rx_dropped Signed-off-by: Paul Blakey Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed Reviewed-by: Oz Shlomo Reviewed-by: Paul Blakey commit f05ec8d9d0d62367b6e1f2cb50d7d2a45e7747cf Author: Aya Levin Date: Mon Apr 11 09:27:39 2022 +0300 net/mlx5e: Allow relaxed ordering over VFs By PCI spec, the config space of the VF always report relaxed ordering not supported while it inherits this property from its PF. Hence using pcie_relaxed_ordering_enable(), always disables the relaxed ordering on all VFs. Remove this check and rely on the firmware which queries the config space of the PF and set the capability bit accordingly. Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Reviewed-by: Marina Varshaver Reviewed-by: Gal Shalom Signed-off-by: Saeed Mahameed commit 682adfa6ca80f86dcdc5cebe85b11d30d15944d9 Author: Gal Pressman Date: Thu Mar 31 09:26:00 2022 +0300 net/mlx5e: Support partial GSO for tunnels over vlans Offloading outer checksum on tunnels requires GSO partial, add it to 'vlan_features' to allow offloading tunnels over vlans. For example, running GENEVE over vlan & ipv6 (mandatory UDP checksum) now allows for hardware TSO instead of software segmentation in GSO only. Signed-off-by: Gal Pressman Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 675b9d51d6fbc8d08842bdce84e4d38a400e357d Author: Gal Pressman Date: Mon Apr 11 15:44:01 2022 +0300 net/mlx5e: IPoIB, Improve ethtool rxnfc callback structure in IPoIB Followup commit 79ce39be1d63 ("net/mlx5e: Improve ethtool rxnfc callback structure") and handle CONFIG_MLX5_EN_RXNFC enabled/disabled inside the fs layer so the ethtool callbacks are always available. The fs layer will provide stubs when CONFIG_MLX5_EN_RXNFC is compiled out. Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 597c112326197786abcc3a38090b08856bf860af Author: Tariq Toukan Date: Tue Apr 27 16:41:42 2021 +0300 net/mlx5e: Allocate virtually contiguous memory for reps structures Physical continuity is not necessary, and requested allocation size might be larger than PAGE_SIZE. Hence, use v-alloc/free API. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 035e0dd573929306994a1856061e95998699cd69 Author: Tariq Toukan Date: Tue Apr 27 16:11:12 2021 +0300 net/mlx5e: Allocate virtually contiguous memory for VLANs list Physical continuity is not necessary, and requested allocation size might be larger than PAGE_SIZE. Hence, use v-alloc/free API. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 88468311c07a8bb34321166341f93981f7337a7d Author: Tariq Toukan Date: Tue Apr 27 17:23:16 2021 +0300 net/mlx5: Allocate virtually contiguous memory in pci_irq.c Physical continuity is not necessary, and requested allocation size might be larger than PAGE_SIZE. Hence, use v-alloc/free API. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 773c104d5333aed1c7966e79ee3c75c4c5ac5515 Author: Tariq Toukan Date: Tue Apr 27 16:25:56 2021 +0300 net/mlx5: Allocate virtually contiguous memory in vport.c Physical continuity is not necessary, and requested allocation size might be larger than PAGE_SIZE. Hence, use v-alloc/free API. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 9b45bde82c229fda94618896ff530dcba9d66fe0 Author: Tariq Toukan Date: Tue Jan 25 14:47:36 2022 +0200 net/mlx5: Inline db alloc API function Take the wrapper version which picks default node into a header file. This reduces the number of exported functions. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 1d2c717bc7f7fd3c9cf38d4a0d5d7ede06adf05b Author: Moshe Shemesh Date: Fri May 13 06:19:31 2022 +0300 net/mlx5: Add last command failure syndrome to debugfs Add syndrome of last command failure per command type to debugfs to ease debugging of such failure. last_failed_syndrome - last command failed syndrome returned by FW. Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 4c7c8a6d87a83d5e7ffb9bc166ebf865b9360040 Author: Saeed Mahameed Date: Mon Apr 18 12:32:15 2022 -0700 net/mlx5: sparse: error: context imbalance in 'mlx5_vf_get_core_dev' Removing the annotation resolves the issue for some reason. Signed-off-by: Saeed Mahameed commit 03a8b0df757f1beb21ba1626e23ca7412e48b525 Author: Wan Jiabing Date: Wed May 18 10:16:16 2022 +0800 ALSA: usb-audio: Fix wrong kfree issue in snd_usb_endpoint_free_all Fix following coccicheck error: ./sound/usb/endpoint.c:1671:8-10: ERROR: reference preceded by free on line 1671. Here should be 'cp' rather than 'ip'. Fixes: c11117b634f4 ("ALSA: usb-audio: Refcount multiple accesses on the single clock") Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220518021617.10114-1-wanjiabing@vivo.com Signed-off-by: Takashi Iwai commit 4a855a957936c7b01069f6c6fc84e46729e0f2ad Author: Shubhrajyoti Datta Date: Tue May 17 22:25:36 2022 +0530 dt-bindings: mailbox: zynqmp_ipi: convert to yaml Convert the ipi doc to yaml. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220517165536.8637-1-shubhrajyoti.datta@xilinx.com commit 5a011f889b4832aa80c2a872a5aade5c48d2756f Author: Laibin Qiu Date: Tue Mar 1 20:39:19 2022 +0800 blk-throttle: Set BIO_THROTTLED when bio has been throttled 1.In current process, all bio will set the BIO_THROTTLED flag after __blk_throtl_bio(). 2.If bio needs to be throttled, it will start the timer and stop submit bio directly. Bio will submit in blk_throtl_dispatch_work_fn() when the timer expires.But in the current process, if bio is throttled. The BIO_THROTTLED will be set to bio after timer start. If the bio has been completed, it may cause use-after-free blow. BUG: KASAN: use-after-free in blk_throtl_bio+0x12f0/0x2c70 Read of size 2 at addr ffff88801b8902d4 by task fio/26380 dump_stack+0x9b/0xce print_address_description.constprop.6+0x3e/0x60 kasan_report.cold.9+0x22/0x3a blk_throtl_bio+0x12f0/0x2c70 submit_bio_checks+0x701/0x1550 submit_bio_noacct+0x83/0xc80 submit_bio+0xa7/0x330 mpage_readahead+0x380/0x500 read_pages+0x1c1/0xbf0 page_cache_ra_unbounded+0x471/0x6f0 do_page_cache_ra+0xda/0x110 ondemand_readahead+0x442/0xae0 page_cache_async_ra+0x210/0x300 generic_file_buffered_read+0x4d9/0x2130 generic_file_read_iter+0x315/0x490 blkdev_read_iter+0x113/0x1b0 aio_read+0x2ad/0x450 io_submit_one+0xc8e/0x1d60 __se_sys_io_submit+0x125/0x350 do_syscall_64+0x2d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Allocated by task 26380: kasan_save_stack+0x19/0x40 __kasan_kmalloc.constprop.2+0xc1/0xd0 kmem_cache_alloc+0x146/0x440 mempool_alloc+0x125/0x2f0 bio_alloc_bioset+0x353/0x590 mpage_alloc+0x3b/0x240 do_mpage_readpage+0xddf/0x1ef0 mpage_readahead+0x264/0x500 read_pages+0x1c1/0xbf0 page_cache_ra_unbounded+0x471/0x6f0 do_page_cache_ra+0xda/0x110 ondemand_readahead+0x442/0xae0 page_cache_async_ra+0x210/0x300 generic_file_buffered_read+0x4d9/0x2130 generic_file_read_iter+0x315/0x490 blkdev_read_iter+0x113/0x1b0 aio_read+0x2ad/0x450 io_submit_one+0xc8e/0x1d60 __se_sys_io_submit+0x125/0x350 do_syscall_64+0x2d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 0: kasan_save_stack+0x19/0x40 kasan_set_track+0x1c/0x30 kasan_set_free_info+0x1b/0x30 __kasan_slab_free+0x111/0x160 kmem_cache_free+0x94/0x460 mempool_free+0xd6/0x320 bio_free+0xe0/0x130 bio_put+0xab/0xe0 bio_endio+0x3a6/0x5d0 blk_update_request+0x590/0x1370 scsi_end_request+0x7d/0x400 scsi_io_completion+0x1aa/0xe50 scsi_softirq_done+0x11b/0x240 blk_mq_complete_request+0xd4/0x120 scsi_mq_done+0xf0/0x200 virtscsi_vq_done+0xbc/0x150 vring_interrupt+0x179/0x390 __handle_irq_event_percpu+0xf7/0x490 handle_irq_event_percpu+0x7b/0x160 handle_irq_event+0xcc/0x170 handle_edge_irq+0x215/0xb20 common_interrupt+0x60/0x120 asm_common_interrupt+0x1e/0x40 Fix this by move BIO_THROTTLED set into the queue_lock. Signed-off-by: Laibin Qiu Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20220301123919.2381579-1-qiulaibin@huawei.com Signed-off-by: Jens Axboe commit 6e144b47f560edc25744498f360835b1042b73dd Author: Suman Ghosh Date: Tue May 17 10:10:55 2022 +0530 octeontx2-pf: Add support for adaptive interrupt coalescing Added support for adaptive IRQ coalescing. It uses net_dim algorithm to find the suitable delay/IRQ count based on the current packet rate. Signed-off-by: Suman Ghosh Link: https://lore.kernel.org/r/20220517044055.876158-1-sumang@marvell.com Signed-off-by: Jakub Kicinski commit 9cc341286e99a268e63efc6e937d4c467bcf386c Author: Xin Long Date: Mon May 16 21:30:29 2022 -0400 dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown Like other places in ipv4/6 dst ifdown, change to use blackhole_netdev instead of pernet loopback_dev in dn dst ifdown. Signed-off-by: Xin Long Link: https://lore.kernel.org/r/0cdf10e5a4af509024f08644919121fb71645bc2.1652751029.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 7c7dcd66c5e0537b33b4e217ddb347d768a4b294 Author: Min Li Date: Mon May 16 10:47:07 2022 -0400 ptp: ptp_clockmatrix: return -EBUSY if phase pull-in is in progress Also removes PEROUT_ENABLE_OUTPUT_MASK Signed-off-by: Min Li Acked-by: Richard Cochran Link: https://lore.kernel.org/r/1652712427-14703-2-git-send-email-min.li.xe@renesas.com Signed-off-by: Jakub Kicinski commit bec67592521ec816371f5f072b1a340e1c2ad434 Author: Min Li Date: Mon May 16 10:47:06 2022 -0400 ptp: ptp_clockmatrix: Add PTP_CLK_REQ_EXTTS support Use TOD_READ_SECONDARY for extts to keep TOD_READ_PRIMARY for gettime and settime exclusively. Before this change, TOD_READ_PRIMARY was used for both extts and gettime/settime, which would result in changing TOD read/write triggers between operations. Using TOD_READ_SECONDARY would make extts independent of gettime/settime operation Signed-off-by: Min Li Acked-by: Richard Cochran Link: https://lore.kernel.org/r/1652712427-14703-1-git-send-email-min.li.xe@renesas.com Signed-off-by: Jakub Kicinski commit 5ff0348b7f755aac2770bbfc244f5371e4e55224 Author: Guo Zhengkui Date: Mon May 16 19:56:25 2022 +0800 net: smc911x: replace ternary operator with min() Fix the following coccicheck warning: drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min() Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220516115627.66363-1-guozhengkui@vivo.com Signed-off-by: Jakub Kicinski commit ab4d6357c95f5aa6473cc39382271916091378e3 Author: Haowen Bai Date: Mon May 16 18:16:52 2022 +0800 net: thunderx: remove null check after call container_of() container_of() will never return NULL, so remove useless code. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1652696212-17516-1-git-send-email-baihaowen@meizu.com Signed-off-by: Jakub Kicinski commit 76e1e5df4b7cb8a87ca8b0242aabf06c8dc0d09d Author: Xiu Jianfeng Date: Mon May 16 17:23:37 2022 +0800 octeontx2-pf: Use memset_startat() helper in otx2_stop() Use memset_startat() helper to simplify the code, there is no functional change in this patch. Signed-off-by: Xiu Jianfeng Link: https://lore.kernel.org/r/20220516092337.131653-1-xiujianfeng@huawei.com Signed-off-by: Jakub Kicinski commit 68a0bd6790495b8a65c68279f041cbb16e87ca42 Merge: 65a9dedc11d61 793a7df63071e Author: Jakub Kicinski Date: Tue May 17 17:34:59 2022 -0700 Merge branch 'net-smc-send-and-write-inline-optimization-for-smc' Guangguan Wang says: ==================== net/smc: send and write inline optimization for smc Send cdc msgs and write data inline if qp has sufficent inline space, helps latency reducing. In my test environment, which are 2 VMs running on the same physical host and whose NICs(ConnectX-4Lx) are working on SR-IOV mode, qperf shows 0.4us-1.3us improvement in latency. Test command: server: smc_run taskset -c 1 qperf client: smc_run taskset -c 1 qperf -oo \ msg_size:1:2K:*2 -t 30 -vu tcp_lat The results shown below: msgsize before after 1B 11.9 us 10.6 us (-1.3 us) 2B 11.7 us 10.7 us (-1.0 us) 4B 11.7 us 10.7 us (-1.0 us) 8B 11.6 us 10.6 us (-1.0 us) 16B 11.7 us 10.7 us (-1.0 us) 32B 11.7 us 10.6 us (-1.1 us) 64B 11.7 us 11.2 us (-0.5 us) 128B 11.6 us 11.2 us (-0.4 us) 256B 11.8 us 11.2 us (-0.6 us) 512B 11.8 us 11.3 us (-0.5 us) 1KB 11.9 us 11.5 us (-0.4 us) 2KB 12.1 us 11.5 us (-0.6 us) ==================== Link: https://lore.kernel.org/r/20220516055137.51873-1-guangguan.wang@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 793a7df63071eb09e5b88addf2a569d7bfd3c973 Author: Guangguan Wang Date: Mon May 16 13:51:37 2022 +0800 net/smc: rdma write inline if qp has sufficient inline space Rdma write with inline flag when sending small packages, whose length is shorter than the qp's max_inline_data, can help reducing latency. In my test environment, which are 2 VMs running on the same physical host and whose NICs(ConnectX-4Lx) are working on SR-IOV mode, qperf shows 0.5us-0.7us improvement in latency. Test command: server: smc_run taskset -c 1 qperf client: smc_run taskset -c 1 qperf -oo \ msg_size:1:2K:*2 -t 30 -vu tcp_lat The results shown below: msgsize before after 1B 11.2 us 10.6 us (-0.6 us) 2B 11.2 us 10.7 us (-0.5 us) 4B 11.3 us 10.7 us (-0.6 us) 8B 11.2 us 10.6 us (-0.6 us) 16B 11.3 us 10.7 us (-0.6 us) 32B 11.3 us 10.6 us (-0.7 us) 64B 11.2 us 11.2 us (0 us) 128B 11.2 us 11.2 us (0 us) 256B 11.2 us 11.2 us (0 us) 512B 11.4 us 11.3 us (-0.1 us) 1KB 11.4 us 11.5 us (0.1 us) 2KB 11.5 us 11.5 us (0 us) Signed-off-by: Guangguan Wang Reviewed-by: Tony Lu Tested-by: kernel test robot Acked-by: Karsten Graul Signed-off-by: Jakub Kicinski commit b632eb06973209dfac1eba3a9fbd13f0041f3e45 Author: Guangguan Wang Date: Mon May 16 13:51:36 2022 +0800 net/smc: send cdc msg inline if qp has sufficient inline space As cdc msg's length is 44B, cdc msgs can be sent inline in most rdma devices, which can help reducing sending latency. In my test environment, which are 2 VMs running on the same physical host and whose NICs(ConnectX-4Lx) are working on SR-IOV mode, qperf shows 0.4us-0.7us improvement in latency. Test command: server: smc_run taskset -c 1 qperf client: smc_run taskset -c 1 qperf -oo \ msg_size:1:2K:*2 -t 30 -vu tcp_lat The results shown below: msgsize before after 1B 11.9 us 11.2 us (-0.7 us) 2B 11.7 us 11.2 us (-0.5 us) 4B 11.7 us 11.3 us (-0.4 us) 8B 11.6 us 11.2 us (-0.4 us) 16B 11.7 us 11.3 us (-0.4 us) 32B 11.7 us 11.3 us (-0.4 us) 64B 11.7 us 11.2 us (-0.5 us) 128B 11.6 us 11.2 us (-0.4 us) 256B 11.8 us 11.2 us (-0.6 us) 512B 11.8 us 11.4 us (-0.4 us) 1KB 11.9 us 11.4 us (-0.5 us) 2KB 12.1 us 11.5 us (-0.6 us) Signed-off-by: Guangguan Wang Reviewed-by: Tony Lu Tested-by: kernel test robot Acked-by: Karsten Graul Signed-off-by: Jakub Kicinski commit 3be0ec65fd17b9677d0a4c8913ee359bd941da5d Author: Stephen Boyd Date: Thu Apr 14 17:58:28 2022 -0700 dt-bindings: interconnect: Remove sc7180/sdx55 ipa compatibles These interconnects are modeled as clks, not interconnects, therefore remove the compatibles from the binding as they're unused. Cc: Alex Elder Cc: Taniya Das Cc: Mike Tipton Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220415005828.1980055-3-swboyd@chromium.org Signed-off-by: Georgi Djakov commit 3a4c63f5d904d83852a2e4df13fcb89cce977405 Merge: 314cf651fa83b 97f7d384ac4fc Author: Georgi Djakov Date: Wed May 18 03:03:30 2022 +0300 Merge branch 'icc-rpm' into icc-next This patch set is to address two clock rate setting issues. The first patch is to fix a potential cached clock rate mismatching issue, the issue can lead to the clock rate is missed to be set. Note, since this potential issue requires specific time window and certain condition (consumers need to request the same bandwidth) to produce, the patch is based on analysis but not a real trace log. The second patch is an extension to cache clock rates for active and sleep clocks separately, with this change it gives us possibility to set active and sleep clock with different clock rates. * icc-rpm interconnect: qcom: icc-rpm: Fix for cached clock rate interconnect: qcom: icc-rpm: Cache every clock rate Link: https://lore.kernel.org/r/20220416031029.693211-1-leo.yan@linaro.org Signed-off-by: Georgi Djakov commit 314cf651fa83b83aa487299cdfe95fe1e8fb8fbe Merge: 016fca59f95f6 04548d4e2798d Author: Georgi Djakov Date: Wed May 18 03:02:55 2022 +0300 Merge branch 'icc-sc8180x' into icc-next This contains a few fixes for the sc8180x interconnect provider driver to make it functional. * icc-sc8180x dt-bindings: interconnect: Add SC8180X QUP0 virt provider interconnect: qcom: sc8180x: Modernize sc8180x probe interconnect: qcom: sc8180x: Fix QUP0 nodes interconnect: qcom: sc8180x: Mark some BCMs keepalive Link: https://lore.kernel.org/r/20220503211925.1022169-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 016fca59f95f6a327595b8f3f3c39979c177d676 Merge: 828ff75c44f47 7123f8836392f Author: Georgi Djakov Date: Wed May 18 02:42:42 2022 +0300 Merge branch 'icc-const' into icc-next Constify structs that are not modified. Link: https://lore.kernel.org/r/20220412102623.227607-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 04548d4e2798d4b90f8270b8bb708038dd33d7fa Author: Bjorn Andersson Date: Tue May 3 15:53:00 2022 -0700 interconnect: qcom: sc8180x: Reformat node and bcm definitions The Qualcomm interconnect providers started off defining nodes and BCMs using the DEFINE_QNODE() and DEFINE_QBCM() macros. Unfortunately this results in a block of long lines that are hard to read, a transition to explicitly stated definition has been made for newly introduced platforms. Transition the SC8180X interconnect provider driver to this style as well, to make it easier to read while debugging interconnect related issues. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503225300.1141814-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit ce83211c87caaf3a19e24225809db53b8051264c Author: Bjorn Andersson Date: Tue May 3 14:19:25 2022 -0700 interconnect: qcom: sc8180x: Mark some BCMs keepalive In line with other platforms, mark BCMs controlling paths between the CPU, AOSS, GIC and memory as keepalive. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503211925.1022169-5-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 42c4e3f670b97df0c9e23ca2f7080ff7cd591837 Author: Bjorn Andersson Date: Tue May 3 14:19:24 2022 -0700 interconnect: qcom: sc8180x: Fix QUP0 nodes The QUP0 BCM relates to some internal property of the QUPs, and should be configured independently of the path to the QUP. In line with other platforms expose QUP_CORE endpoints in order allow this configuration. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503211925.1022169-4-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit a3e45cf838c8eb91628b03862595861c6d426c1a Author: Bjorn Andersson Date: Tue May 3 14:19:23 2022 -0700 interconnect: qcom: sc8180x: Modernize sc8180x probe The introduction of the Qualcomm SC8180X provider raced with the refactoring of the RPMh common code and SC8180X was left with the old style of duplicating the probe function in each provider driver. Transition the driver to the "new" design. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503211925.1022169-3-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit b9e2a1d50e36688d9e515cd981bf3e501a300451 Author: Bjorn Andersson Date: Tue May 3 14:19:22 2022 -0700 dt-bindings: interconnect: Add SC8180X QUP0 virt provider Add compatible for the QUP0 BCM provider found in SC8180X. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220503211925.1022169-2-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 828ff75c44f47fb049d53a63fa92782680ba5c27 Merge: bb4b905b738cb 39a5392889c0d Author: Georgi Djakov Date: Wed May 18 02:40:50 2022 +0300 Merge branch 'icc-sdx65' into icc-next This adds interconnect driver support for SDX65 platform for scaling the bandwidth requirements over RPMh. Link: https://lore.kernel.org/r/1649854415-11174-1-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov commit bb4b905b738cbc230873fd0ff0e62cd7499c1b11 Merge: 672c0c5173427 01c3f0387c638 Author: Georgi Djakov Date: Wed May 18 02:40:00 2022 +0300 Merge branch 'icc-sc8280xp' into icc-next Add interconnect driver support for Qualcomm SC8280XP platform. * icc-sc8280xp dt-bindings: interconnect: qcom: Add sc8280xp binding interconnect: qcom: Add SC8280XP interconnect provider interconnect: qcom: sc8280xp: constify qcom_icc_desc interconnect: qcom: sc8280xp: constify icc_node pointers interconnect: qcom: sc8280xp: constify qcom_icc_bcm pointers Link: https://lore.kernel.org/r/20220408214835.624494-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit 9be8459298eadb39b9fe9974b890239e9c123107 Author: Guo Ren Date: Tue Apr 5 15:13:14 2022 +0800 riscv: compat: Add COMPAT Kbuild skeletal support Adds initial skeletal COMPAT Kbuild (Running 32bit U-mode on 64bit S-mode) support. - Setup kconfig & dummy functions for compiling. - Implement compat_start_thread by the way. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-21-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 4608c159594fb40a5101357d4f614fdde9ce1fdb Author: Guo Ren Date: Tue Apr 5 15:13:13 2022 +0800 riscv: compat: ptrace: Add compat_arch_ptrace implement Now, you can use native gdb on riscv64 for rv32 app debugging. $ uname -a Linux buildroot 5.16.0-rc4-00036-gbef6b82fdf23-dirty #53 SMP Mon Dec 20 23:06:53 CST 2021 riscv64 GNU/Linux $ cat /proc/cpuinfo processor : 0 hart : 0 isa : rv64imafdcsuh mmu : sv48 $ file /bin/busybox /bin/busybox: setuid ELF 32-bit LSB shared object, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv32-ilp32d.so.1, for GNU/Linux 5.15.0, stripped $ file /usr/bin/gdb /usr/bin/gdb: ELF 32-bit LSB shared object, UCB RISC-V, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-riscv32-ilp32d.so.1, for GNU/Linux 5.15.0, stripped $ /usr/bin/gdb /bin/busybox GNU gdb (GDB) 10.2 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later ... Reading symbols from /bin/busybox... (No debugging symbols found in /bin/busybox) (gdb) b main Breakpoint 1 at 0x8ddc (gdb) r Starting program: /bin/busybox Failed to read a valid object file image from memory. Breakpoint 1, 0x555a8ddc in main () (gdb) i r ra 0x77df0b74 0x77df0b74 sp 0x7fdd3d10 0x7fdd3d10 gp 0x5567e800 0x5567e800 tp 0x77f64280 0x77f64280 t0 0x0 0 t1 0x555a6fac 1431990188 t2 0x77dd8db4 2011008436 fp 0x7fdd3e34 0x7fdd3e34 s1 0x7fdd3e34 2145205812 a0 0xffffffff -1 a1 0x2000 8192 a2 0x7fdd3e3c 2145205820 a3 0x0 0 a4 0x7fdd3d30 2145205552 a5 0x555a8dc0 1431997888 a6 0x77f2c170 2012397936 a7 0x6a7c7a2f 1786542639 s2 0x0 0 s3 0x0 0 s4 0x555a8dc0 1431997888 s5 0x77f8a3a8 2012783528 s6 0x7fdd3e3c 2145205820 s7 0x5567cecc 1432866508 --Type for more, q to quit, c to continue without paging-- s8 0x1 1 s9 0x0 0 s10 0x55634448 1432568904 s11 0x0 0 t3 0x77df0bb8 2011106232 t4 0x42fc 17148 t5 0x0 0 t6 0x40 64 pc 0x555a8ddc 0x555a8ddc (gdb) si 0x555a78f0 in mallopt@plt () (gdb) c Continuing. BusyBox v1.34.1 (2021-12-19 22:39:48 CST) multi-call binary. BusyBox is copyrighted by many authors between 1998-2015. Licensed under GPLv2. See source distribution for detailed copyright notices. Usage: busybox [function [arguments]...] or: busybox --list[-full] ... [Inferior 1 (process 107) exited normally] (gdb) q Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-20-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 7383ee05314be58f8f9f018ee0ac53bef3808aea Author: Guo Ren Date: Tue Apr 5 15:13:12 2022 +0800 riscv: compat: signal: Add rt_frame implementation Implement compat_setup_rt_frame for sigcontext save & restore. The main process is the same with signal, but the rv32 pt_regs' size is different from rv64's, so we needs convert them. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-19-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit a37bdde620c2eb89505ee42ff60ed7030b50f71a Author: Nobuhiro Iwamatsu Date: Sat May 7 08:28:50 2022 +0900 rtc: meson: Fix email address in MODULE_AUTHOR Ben Dooks's email address is . Fix Ben Dooks's email address in MODULE_AUTHOR. Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Martin Blumenstingl Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220506232850.220582-1-nobuhiro1.iwamatsu@toshiba.co.jp commit bce7a01ada6456d00c69cd816357ded268ad780c Author: Minghao Chi Date: Thu May 5 02:23:14 2022 +0000 rtc: simplify the return expression of rx8025_set_offset() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Nobuhiro Iwamatsu Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220505022314.59822-1-chi.minghao@zte.com.cn commit 7337342b354b540b0df51cec5ee6b9c0614e837b Merge: 3123109284176 32a214cd8ccbc Author: Stephen Boyd Date: Tue May 17 15:16:22 2022 -0700 Merge tag 'v5.19-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull Rockchip clk driver updates from Heiko Stuebner: Conversion from txt to Yaml for a number of Rockchip clock bindings. Some fixes for recent yaml conversion of clock bindinds and making the hclk_vo critical for rk3568. * tag 'v5.19-rockchip-clk2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: dt-bindings: clock: convert rockchip,rk3368-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3228-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3036-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3308-cru.txt to YAML dt-bindings: clock: convert rockchip,px30-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3188-cru.txt to YAML dt-bindings: clock: convert rockchip,rk3288-cru.txt to YAML dt-bindings: clock: convert rockchip,rv1108-cru.txt to YAML dt-binding: clock: Add missing rk3568 cru bindings clk: rockchip: Mark hclk_vo as critical on rk3568 dt-bindings: clock: fix rk3399 cru clock issues dt-bindings: clock: use generic node name for pmucru example in rockchip,rk3399-cru.yaml dt-bindings: clock: replace a maintainer for rockchip,rk3399-cru.yaml dt-bindings: clock: fix some conversion style issues for rockchip,rk3399-cru.yaml commit aabfe05a824585f64a0620f131841f12ee259a20 Author: Fabio Estevam Date: Mon Apr 18 22:44:45 2022 -0300 rtc: pcf85063: Add a compatible entry for pca85073a The PCA85073A RTC has the same programming model as the PCF85063A. Add a compatible entry for it. Tested on a custom i.MX6SX based board. Signed-off-by: Fabio Estevam Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220419014445.341444-2-festevam@gmail.com commit bb9b98071eacc5f195fe3e7cb0c7664df4cff60f Author: Fabio Estevam Date: Mon Apr 18 22:44:44 2022 -0300 dt-binding: pcf85063: Add an entry for pca85073a The PCA85073A RTC has the same programming model as the PCF85063A. Add a compatible entry for it. Signed-off-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220419014445.341444-1-festevam@gmail.com commit c2df0a6af177b6c06a859806a876f92b072dc624 Author: Uros Bizjak Date: Sun May 15 20:42:04 2022 +0200 locking/atomic/x86: Introduce arch_try_cmpxchg64 Introduce arch_try_cmpxchg64 for 64-bit and 32-bit targets to improve code using cmpxchg64. On 64-bit targets, the generated assembly improves from: ab: 89 c8 mov %ecx,%eax ad: 48 89 4c 24 60 mov %rcx,0x60(%rsp) b2: 83 e0 fd and $0xfffffffd,%eax b5: 89 54 24 64 mov %edx,0x64(%rsp) b9: 88 44 24 60 mov %al,0x60(%rsp) bd: 48 89 c8 mov %rcx,%rax c0: c6 44 24 62 f2 movb $0xf2,0x62(%rsp) c5: 48 8b 74 24 60 mov 0x60(%rsp),%rsi ca: f0 49 0f b1 34 24 lock cmpxchg %rsi,(%r12) d0: 48 39 c1 cmp %rax,%rcx d3: 75 cf jne a4 to: b3: 89 c2 mov %eax,%edx b5: 48 89 44 24 60 mov %rax,0x60(%rsp) ba: 83 e2 fd and $0xfffffffd,%edx bd: 89 4c 24 64 mov %ecx,0x64(%rsp) c1: 88 54 24 60 mov %dl,0x60(%rsp) c5: c6 44 24 62 f2 movb $0xf2,0x62(%rsp) ca: 48 8b 54 24 60 mov 0x60(%rsp),%rdx cf: f0 48 0f b1 13 lock cmpxchg %rdx,(%rbx) d4: 75 d5 jne ab where a move and a compare after cmpxchg is saved. The improvements for 32-bit targets are even more noticeable, because dual-word compare after cmpxchg8b gets eliminated. Signed-off-by: Uros Bizjak Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220515184205.103089-3-ubizjak@gmail.com commit 0aa7be05d83cc584da0782405e8007e351dfb6cc Author: Uros Bizjak Date: Sun May 15 20:42:03 2022 +0200 locking/atomic: Add generic try_cmpxchg64 support Add generic support for try_cmpxchg64{,_acquire,_release,_relaxed} and their falbacks involving cmpxchg64. Signed-off-by: Uros Bizjak Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220515184205.103089-2-ubizjak@gmail.com commit 841b51e4a3590866d17fa2663c64688c25b891b1 Author: Borislav Petkov Date: Mon May 16 17:48:38 2022 +0200 perf/x86/amd: Run AMD BRS code only on supported hw This fires on a Fam16h machine here: unchecked MSR access error: WRMSR to 0xc000010f (tried to write 0x0000000000000018) \ at rIP: 0xffffffff81007db1 (amd_brs_reset+0x11/0x50) Call Trace: amd_pmu_cpu_starting ? x86_pmu_dead_cpu x86_pmu_starting_cpu cpuhp_invoke_callback ? x86_pmu_starting_cpu ? x86_pmu_dead_cpu cpuhp_issue_call ? x86_pmu_starting_cpu __cpuhp_setup_state_cpuslocked ? x86_pmu_dead_cpu ? x86_pmu_starting_cpu __cpuhp_setup_state ? map_vsyscall init_hw_perf_events ? map_vsyscall do_one_initcall ? _raw_spin_unlock_irqrestore ? try_to_wake_up kernel_init_freeable ? rest_init kernel_init ret_from_fork because that CPU hotplug callback gets executed on any AMD CPU - not only on the BRS-enabled ones. Check the BRS feature bit properly. Signed-off-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Acked-By: Stephane Eranian Link: https://lkml.kernel.org/r/20220516154838.7044-1-bp@alien8.de commit 3c27b0c6ea48bc61492a138c410e262735d660ab Author: Peter Zijlstra Date: Tue May 10 21:22:04 2022 +0200 perf/x86/amd: Fix AMD BRS period adjustment There's two problems with the current amd_brs_adjust_period() code: - it isn't in fact AMD specific and wil always adjust the period; - it adjusts the period, while it should only adjust the event count, resulting in repoting a short period. Fix this by using x86_pmu.limit_period, this makes it specific to the AMD BRS case and ensures only the event count is adjusted while the reported period is unmodified. Fixes: ba2fe7500845 ("perf/x86/amd: Add AMD branch sampling period adjustment") Signed-off-by: Peter Zijlstra (Intel) commit f260fd59e3f387432bda51072fff4494fba10b91 Author: Kees Cook Date: Tue May 17 14:44:20 2022 -0700 lkdtm/heap: Hide allocation size from -Warray-bounds With the kmalloc() size annotations, GCC is smart enough to realize that LKDTM is intentionally writing past the end of the buffer. This is on purpose, of course, so hide the buffer from the optimizer. Silences: ../drivers/misc/lkdtm/heap.c: In function 'lkdtm_SLAB_LINEAR_OVERFLOW': ../drivers/misc/lkdtm/heap.c:59:13: warning: array subscript 256 is outside array bounds of 'void[1020]' [-Warray-bounds] 59 | data[1024 / sizeof(u32)] = 0x12345678; | ~~~~^~~~~~~~~~~~~~~~~~~~ In file included from ../drivers/misc/lkdtm/heap.c:7: In function 'kmalloc', inlined from 'lkdtm_SLAB_LINEAR_OVERFLOW' at ../drivers/misc/lkdtm/heap.c:54:14: ../include/linux/slab.h:581:24: note: at offset 1024 into object of size 1020 allocated by 'kmem_cache_alloc_trace' 581 | return kmem_cache_alloc_trace( | ^~~~~~~~~~~~~~~~~~~~~~~ 582 | kmalloc_caches[kmalloc_type(flags)][index], | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 583 | flags, size); | ~~~~~~~~~~~~ Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Signed-off-by: Kees Cook commit 38c84c997d40f56273077af5f8ff3e6317d772b7 Author: Muhammad Usama Anjum Date: Tue May 17 18:29:31 2022 +0500 selftests/lkdtm: Add configs for stackleak and "after free" tests Add config options which are needed for LKDTM sub-tests: STACKLEAK_ERASING test needs GCC_PLUGIN_STACKLEAK config. READ_AFTER_FREE and READ_BUDDY_AFTER_FREE tests need INIT_ON_FREE_DEFAULT_ON config. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220517132932.1484719-1-usama.anjum@collabora.com commit fc34eec6869a5882fd339f4e200fad21eb284093 Author: Kees Cook Date: Thu May 12 10:19:41 2022 -0700 lkdtm/usercopy: Check vmalloc and >0-order folios Add coverage for the recently added usercopy checks for vmalloc and folios, via USERCOPY_VMALLOC and USERCOPY_FOLIO respectively. Cc: Greg Kroah-Hartman Cc: Matthew Wilcox (Oracle) Cc: Arnd Bergmann Signed-off-by: Kees Cook commit 203926da2bff8e172200a2f11c758987af112d4a Author: Kuppuswamy Sathyanarayanan Date: Mon Apr 18 15:02:37 2022 +0000 PCI/AER: Clear MULTI_ERR_COR/UNCOR_RCV bits When a Root Port or Root Complex Event Collector receives an error Message e.g., ERR_COR, it sets PCI_ERR_ROOT_COR_RCV in the Root Error Status register and logs the Requester ID in the Error Source Identification register. If it receives a second ERR_COR Message before software clears PCI_ERR_ROOT_COR_RCV, hardware sets PCI_ERR_ROOT_MULTI_COR_RCV and the Requester ID is lost. In the following scenario, PCI_ERR_ROOT_MULTI_COR_RCV was never cleared: - hardware receives ERR_COR message - hardware sets PCI_ERR_ROOT_COR_RCV - aer_irq() entered - aer_irq(): status = pci_read_config_dword(PCI_ERR_ROOT_STATUS) - aer_irq(): now status == PCI_ERR_ROOT_COR_RCV - hardware receives second ERR_COR message - hardware sets PCI_ERR_ROOT_MULTI_COR_RCV - aer_irq(): pci_write_config_dword(PCI_ERR_ROOT_STATUS, status) - PCI_ERR_ROOT_COR_RCV is cleared; PCI_ERR_ROOT_MULTI_COR_RCV is set - aer_irq() entered again - aer_irq(): status = pci_read_config_dword(PCI_ERR_ROOT_STATUS) - aer_irq(): now status == PCI_ERR_ROOT_MULTI_COR_RCV - aer_irq() exits because PCI_ERR_ROOT_COR_RCV not set - PCI_ERR_ROOT_MULTI_COR_RCV is still set The same problem occurred with ERR_NONFATAL/ERR_FATAL Messages and PCI_ERR_ROOT_UNCOR_RCV and PCI_ERR_ROOT_MULTI_UNCOR_RCV. Fix the problem by queueing an AER event and clearing the Root Error Status bits when any of these bits are set: PCI_ERR_ROOT_COR_RCV PCI_ERR_ROOT_UNCOR_RCV PCI_ERR_ROOT_MULTI_COR_RCV PCI_ERR_ROOT_MULTI_UNCOR_RCV See the bugzilla link for details from Eric about how to reproduce this problem. [bhelgaas: commit log, move repro details to bugzilla] Fixes: e167bfcaa4cd ("PCI: aerdrv: remove magical ROOT_ERR_STATUS_MASKS") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215992 Link: https://lore.kernel.org/r/20220418150237.1021519-1-sathyanarayanan.kuppuswamy@linux.intel.com Reported-by: Eric Badger Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Bjorn Helgaas Reviewed-by: Ashok Raj commit 060eceb739e5b30db684666592c2a33d09426651 Author: Miquel Raynal Date: Mon May 16 10:25:04 2022 +0200 MAINTAINERS: Add myself as maintainer of the RZN1 RTC driver After contributing it, I'll volunteer to maintain it. Signed-off-by: Miquel Raynal Acked-by: Geert Uytterhoeven Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220516082504.33913-6-miquel.raynal@bootlin.com commit be4a11cf98aff5d456eae947a49b6163393d9420 Author: Miquel Raynal Date: Mon May 16 10:25:03 2022 +0200 rtc: rzn1: Add oscillator offset support The RZN1 RTC can compensate the imprecision of the oscillator up to approximately 190ppm. Seconds can last slightly shorter or longer depending on the configuration. Below ~65ppm of correction, we can change the time spent in a second every minute, which is the most accurate compensation that the RTC can offer. Above, the compensation will be active every 20s. Signed-off-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220516082504.33913-5-miquel.raynal@bootlin.com commit b5ad1bf00d2c4bf96bf9318f44a929f0b22dd29c Author: Miquel Raynal Date: Mon May 16 10:25:02 2022 +0200 rtc: rzn1: Add alarm support The RZN1 RTC can trigger an interrupt when reaching a particular date up to 7 days ahead. Bring support for this alarm. One drawback though, the granularity is about a minute. Signed-off-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220516082504.33913-4-miquel.raynal@bootlin.com commit deeb4b5393e106b990607df06261fba0ebb7ebde Author: Michel Pollet Date: Mon May 16 10:25:01 2022 +0200 rtc: rzn1: Add new RTC driver Add a basic RTC driver for the RZ/N1. Signed-off-by: Michel Pollet Co-developed-by: Miquel Raynal Signed-off-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220516082504.33913-3-miquel.raynal@bootlin.com commit 4c4d145a65e5a7faac440081bc1eac860930cd24 Author: Miquel Raynal Date: Mon May 16 10:25:00 2022 +0200 dt-bindings: rtc: rzn1: Describe the RZN1 RTC Add new binding file for this RTC. Signed-off-by: Miquel Raynal Reviewed-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220516082504.33913-2-miquel.raynal@bootlin.com commit 581d6d8f483696ff164f52a71beb43a87b718592 Author: Samuel Holland Date: Wed Apr 13 18:17:30 2022 -0500 rtc: sun6i: Add NVMEM provider The sun6i RTC provides 32 bytes of general-purpose data registers. They can be used to save data in the always-on RTC power domain. The registers are writable via 32-bit MMIO accesses only. Expose them with a NVMEM provider so they can be used by other drivers. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220413231731.56709-1-samuel@sholland.org commit 227fab1ee7ca70c9b4b0915898e81327aeb70414 Author: Guo Zhengkui Date: Thu May 5 00:49:01 2022 +0800 i3c: master: svc: fix returnvar.cocci warning Fix the following coccicheck warning: drivers/i3c/master/svc-i3c-master.c:1600:5-8: Unneeded variable: "ret". Return "0" on line 1605. Signed-off-by: Guo Zhengkui Reviewed-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220504164901.9622-1-guozhengkui@vivo.com commit c157a606e7525409208a51bd6663d6da3757d69e Author: Minghao Chi Date: Thu May 5 02:19:54 2022 +0000 i3c/master: simplify the return expression of i3c_hci_remove() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220505021954.54524-1-chi.minghao@zte.com.cn commit 3972b152e3da53d46eb3ae5d76c1a2c3856ca1af Merge: 3123109284176 cf7f3f4fa9e57 Author: Stephen Boyd Date: Tue May 17 12:44:46 2022 -0700 Merge tag 'clk-imx-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Add 27 MHz phy PLL ref clock - Add mcore_booted module parameter to tell kernel M core has already booted - Remove snvs clock - Add bindings for i.MX8MN GPT - Add check for kcalloc - Fix for a potential memory leak in __imx_clk_gpr_sync - Add DISP2 pixel clock for i.MX8MP - Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage - Add clkout1/2 for i.MX8MP - Fix parent clock of ubs_root_clk for i.MX8MP * tag 'clk-imx-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx8mp: fix usb_root_clk parent clk: imx8mp: add clkout1/2 support clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage clk: imx8mp: Add DISP2 pixel clock clk: imx: scu: fix a potential memory leak in __imx_clk_gpr_scu() clk: imx: Add check for kcalloc clk: imx8mn: add GPT support dt-bindings: imx: add clock bindings for i.MX8MN GPT clk: imx: Remove the snvs clock clk: imx8m: check mcore_booted before register clk clk: imx: add mcore_booted module paratemter clk: imx8mq: add 27m phy pll ref clock commit b86f46d5ce3e7497930be931a9a9e57480f0baff Author: Akira Yokosawa Date: Thu May 12 11:54:12 2022 +0900 docs: pdfdocs: Add space for chapter counts >= 100 in TOC It turns out that networking.pdf has exceeded 100 chapters and titles of chapters >= 100 collide with their counts in its table of contents (TOC). Increase relevant params by 0.6em in the preamble to avoid such ugly collisions. While at it, fix a typo in comment (subsection). Signed-off-by: Akira Yokosawa Link: https://lore.kernel.org/r/bdb60ba3-7813-47d0-74f9-7c31dd912d95@gmail.com Signed-off-by: Jonathan Corbet commit 9c4a5c75a62e83963083efd4eea5d5bd1583193c Author: Dave Wysochanski Date: Wed May 4 09:21:06 2022 -0400 NFS: Pass i_size to fscache_unuse_cookie() when a file is released Pass updated i_size in fscache_unuse_cookie() when called from nfs_fscache_release_file(), which ensures the size of an fscache object gets written to the cache storage. Failing to do so results in unnessary reads from the NFS server, even when the data is cached, due to a cachefiles object coherency check failing with a trace similar to the following: cachefiles_coherency: o=0000000e BAD osiz B=afbb3 c=0 This problem can be reproduced as follows: #!/bin/bash v=4.2; NFS_SERVER=127.0.0.1 set -e; trap cleanup EXIT; rc=1 function cleanup { umount /mnt/nfs > /dev/null 2>&1 RC_STR="TEST PASS" [ $rc -eq 1 ] && RC_STR="TEST FAIL" echo "$RC_STR on $(uname -r) with NFSv$v and server $NFS_SERVER" } mount -o vers=$v,fsc $NFS_SERVER:/export /mnt/nfs rm -f /mnt/nfs/file1.bin > /dev/null 2>&1 dd if=/dev/zero of=/mnt/nfs/file1.bin bs=4096 count=1 > /dev/null 2>&1 echo 3 > /proc/sys/vm/drop_caches echo Read file 1st time from NFS server into fscache dd if=/mnt/nfs/file1.bin of=/dev/null > /dev/null 2>&1 umount /mnt/nfs && mount -o vers=$v,fsc $NFS_SERVER:/export /mnt/nfs echo 3 > /proc/sys/vm/drop_caches echo Read file 2nd time from fscache dd if=/mnt/nfs/file1.bin of=/dev/null > /dev/null 2>&1 echo Check mountstats for NFS read grep -q "READ: 0" /proc/self/mountstats # (1st number) == 0 [ $? -eq 0 ] && rc=0 Fixes: a6b5a28eb56c "nfs: Convert to new fscache volume/cookie API" Signed-off-by: Dave Wysochanski Tested-by: Daire Byrne Signed-off-by: Anna Schumaker commit 514ff1bcd98d7f57361025e2200b803d3ddde6c8 Author: Schspa Shi Date: Mon May 16 11:02:51 2022 +0800 cpufreq: make interface functions and lock holding state clear cpufreq_offline() calls offline() and exit() under the policy rwsem But they are called outside the rwsem in cpufreq_online(). Make cpufreq_online() call offline() and exit() as well as online() and init() under the policy rwsem to achieve a clear lock relationship. All of the init() and online() implementations in the tree only initialize the policy object without attempting to acquire the policy rwsem and they won't call cpufreq APIs attempting to acquire it. Signed-off-by: Schspa Shi Acked-by: Viresh Kumar [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit d4627a287e251efed59f2b4bda82c5950768c963 Author: Schspa Shi Date: Mon May 16 11:02:50 2022 +0800 cpufreq: Abort show()/store() for half-initialized policies If policy initialization fails after the sysfs files are created, there is a possibility to end up running show()/store() callbacks for half-initialized policies, which may have unpredictable outcomes. Abort show()/store() in such a case by making sure the policy is active. Also dectivate the policy on such failures. Signed-off-by: Schspa Shi Acked-by: Viresh Kumar [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit e315b831f0d6ec8072fed26502caba5108ddfc48 Author: gaochao Date: Sat May 14 18:00:46 2022 +0800 docs/zh_CN: Add dev-tools/gdb-kernel-debugging.rst Chinese translation Translate dev-tools/gdb-kernel-debugging.rst into Chinese. Signed-off-by: gaochao Reviewed-by: Yanteng Si Reviewed-by: Wu XiangCheng Link: https://lore.kernel.org/r/20220514100046.1683-1-gaochao49@huawei.com Signed-off-by: Jonathan Corbet commit a28faaddb2be19659701602fc7c9934ff5fc3fa5 Author: Chuck Lever Date: Mon Apr 18 11:58:50 2022 -0400 Documentation: Add an explanation of NFSv4 client identifiers To enable NFSv4 to work correctly, NFSv4 client identifiers have to be globally unique and persistent over client reboots. We believe that in many cases, a good default identifier can be chosen and set when a client system is imaged. Because there are many different ways a system can be imaged, provide an explanation of how NFSv4 client identifiers and principals can be set by install scripts and imaging tools. Additional cases, such as NFSv4 clients running in containers, also need unique and persistent identifiers. The Linux NFS community sets forth this explanation to aid those who create and manage container environments. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5e12f172db9536df4720a50e8aa70c5e212c2037 Author: NeilBrown Date: Mon Mar 21 16:20:43 2022 +1100 NFS: update documentation for the nfs4_unique_id parameter The documentation for nfs4_unique_id is out-of-date. In particular it claim that when nfs4_unique_id is set, the host name is not used. since Commit 55b592933b7d ("NFSv4: Fix nfs4_init_uniform_client_string for net namespaces") both the unique_id AND the host name are used. Update the documentation to match the code. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 206bc4348603866bf42a6690f26e152522a057dc Author: Randy Dunlap Date: Sun May 15 17:20:47 2022 -0700 input: Docs: correct ntrig.rst typo Fix a typo in ntrig.rst (found with 'codespell'). Signed-off-by: Randy Dunlap Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Cc: Jonathan Corbet Link: https://lore.kernel.org/r/20220516002047.11395-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 27ff6839485125b78fe58fd89b1b17fe974f610d Author: Randy Dunlap Date: Sun May 15 17:20:55 2022 -0700 input: Docs: correct atarikbd.rst typos Fix 2 "MOSE" typos in atarikbd.rst (found with 'codespell'). a. s/MOSE/MODE/ b. s/MOSE/MOUSE/ Signed-off-by: Randy Dunlap Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Cc: Jonathan Corbet Link: https://lore.kernel.org/r/20220516002055.12000-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 3e2910c7e23b55f6452b7130f97217ee0551a71a Author: NeilBrown Date: Mon Mar 21 10:59:51 2022 +1100 NFS: Improve warning message when locks are lost. NFSv4 can lose locks if, for example there is a network partition for longer than the lease period. When this happens a warning message NFS: __nfs4_reclaim_open_state: Lock reclaim failed! is generated, possibly once for each lock (though rate limited). This is potentially misleading as is can be read as suggesting that lock reclaim was attempted. However the default behaviour is to not attempt to recover locks (except due to server report). This patch changes the reporting to produce at most one message for each attempt to recover all state from a given server. The message reports the server name and the number of locks lost if that number is non-zero. It reports that locks were lost and give no suggestion as to whether there was an attempt or not. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 01a2fa188325d1a2ff8dcd2b07add37c27e6eff6 Author: Yanteng Si Date: Mon May 16 23:57:48 2022 +0800 MAINTAINERS: Become the docs/zh_CN maintainer It's time to become a maintainer of Chinese documentation, and Yanteng's plan is to help everyone with the utmost enthusiasm and patience. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/b0c1324d1d63846d700ab354446a6deaf30754c0.1652712771.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 3ca5470878ebe9e31d3292391ae5fd63ab625a0b Author: Jason Gunthorpe Date: Mon May 16 20:41:22 2022 -0300 vfio: Change struct vfio_group::container_users to a non-atomic int Now that everything is fully locked there is no need for container_users to remain as an atomic, change it to an unsigned int. Use 'if (group->container)' as the test to determine if the container is present or not instead of using container_users. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/6-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit b76c0eed748605afe8cddcc45c574f7f8536551a Author: Jason Gunthorpe Date: Mon May 16 20:41:21 2022 -0300 vfio: Simplify the life cycle of the group FD Once userspace opens a group FD it is prevented from opening another instance of that same group FD until all the prior group FDs and users of the container are done. The first is done trivially by checking the group->opened during group FD open. However, things get a little weird if userspace creates a device FD and then closes the group FD. The group FD still cannot be re-opened, but this time it is because the group->container is still set and container_users is elevated by the device FD. Due to this mismatched lifecycle we have the vfio_group_try_dissolve_container() which tries to auto-free a container after the group FD is closed but the device FD remains open. Instead have the device FD hold onto a reference to the single group FD. This directly prevents vfio_group_fops_release() from being called when any device FD exists and makes the lifecycle model more understandable. vfio_group_try_dissolve_container() is removed as the only place a container is auto-deleted is during vfio_group_fops_release(). At this point the container_users is either 1 or 0 since all device FDs must be closed. Change group->opened to group->opened_file which points to the single struct file * that is open for the group. If the group->open_file is NULL then group->container == NULL. If all device FDs have closed then the group's notifier list must be empty. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/5-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit e0e29bdb594adf472eeff475539ee39708b2b07b Author: Jason Gunthorpe Date: Mon May 16 20:41:20 2022 -0300 vfio: Fully lock struct vfio_group::container This is necessary to avoid various user triggerable races, for instance racing SET_CONTAINER/UNSET_CONTAINER: ioctl(VFIO_GROUP_SET_CONTAINER) ioctl(VFIO_GROUP_UNSET_CONTAINER) vfio_group_unset_container int users = atomic_cmpxchg(&group->container_users, 1, 0); // users == 1 container_users == 0 __vfio_group_unset_container(group); container = group->container; vfio_group_set_container() if (!atomic_read(&group->container_users)) down_write(&container->group_lock); group->container = container; up_write(&container->group_lock); down_write(&container->group_lock); group->container = NULL; up_write(&container->group_lock); vfio_container_put(container); /* woops we lost/leaked the new container */ This can then go on to NULL pointer deref since container == 0 and container_users == 1. Wrap all touches of container, except those on a performance path with a known open device, with the group_rwsem. The only user of vfio_group_add_container_user() holds the user count for a simple operation, change it to just hold the group_lock over the operation and delete vfio_group_add_container_user(). Containers now only gain a user when a device FD is opened. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/4-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit 805bb6c1bd9009e389f884fa30ec5f5e5079376d Author: Jason Gunthorpe Date: Mon May 16 20:41:19 2022 -0300 vfio: Split up vfio_group_get_device_fd() The split follows the pairing with the destroy functions: - vfio_group_get_device_fd() destroyed by close() - vfio_device_open() destroyed by vfio_device_fops_release() - vfio_device_assign_container() destroyed by vfio_group_try_dissolve_container() The next patch will put a lock around vfio_device_assign_container(). Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/3-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit c6f4860ef938606117961fac11d8d67497ab299b Author: Jason Gunthorpe Date: Mon May 16 20:41:18 2022 -0300 vfio: Change struct vfio_group::opened from an atomic to bool This is not a performance path, just use the group_rwsem to protect the value. Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/2-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit be8d3adae65cd44b6c299b796a5e1a0c24c54454 Author: Jason Gunthorpe Date: Mon May 16 20:41:17 2022 -0300 vfio: Add missing locking for struct vfio_group::kvm Without locking userspace can trigger a UAF by racing KVM_DEV_VFIO_GROUP_DEL with VFIO_GROUP_GET_DEVICE_FD: CPU1 CPU2 ioctl(KVM_DEV_VFIO_GROUP_DEL) ioctl(VFIO_GROUP_GET_DEVICE_FD) vfio_group_get_device_fd open_device() intel_vgpu_open_device() vfio_register_notifier() vfio_register_group_notifier() blocking_notifier_call_chain(&group->notifier, VFIO_GROUP_NOTIFY_SET_KVM, group->kvm); set_kvm() group->kvm = NULL close() kfree(kvm) intel_vgpu_group_notifier() vdev->kvm = data [..] kvm_get_kvm(vgpu->kvm); // UAF! Add a simple rwsem in the group to protect the kvm while the notifier is using it. Note this doesn't fix the race internal to i915 where userspace can trigger two VFIO_GROUP_NOTIFY_SET_KVM's before we reach a consumer of vgpu->kvm and trigger this same UAF, it just makes the notifier self-consistent. Fixes: ccd46dbae77d ("vfio: support notifier chain in vfio_group") Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Tested-by: Nicolin Chen Tested-by: Matthew Rosato Link: https://lore.kernel.org/r/1-v2-d035a1842d81+1bf-vfio_group_locking_jgg@nvidia.com Signed-off-by: Alex Williamson commit 6b17ca8e5e7a7b10689867dff5e22d7da368ba76 Author: Wan Jiabing Date: Tue May 17 10:34:41 2022 +0800 kvm/vfio: Fix potential deadlock problem in vfio Fix following coccicheck warning: ./virt/kvm/vfio.c:258:1-7: preceding lock on line 236 If kvm_vfio_file_iommu_group() failed, code would goto err_fdput with mutex_lock acquired and then return ret. It might cause potential deadlock. Move mutex_unlock bellow err_fdput tag to fix it. Fixes: d55d9e7a45721 ("kvm/vfio: Store the struct file in the kvm_vfio_group") Signed-off-by: Wan Jiabing Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220517023441.4258-1-wanjiabing@vivo.com Signed-off-by: Alex Williamson commit 32a214cd8ccbc361319bcd00b0b1b05a6b53bc61 Author: Johan Jonker Date: Tue Mar 29 20:05:49 2022 +0200 dt-bindings: clock: convert rockchip,rk3368-cru.txt to YAML Convert rockchip,rk3368-cru.txt to YAML. Changes against original bindings: - Add clocks and clock-names because the device has to have at least one input clock. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329180550.31043-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 5b0c9b98e836724ad826c02f59f7350ddf6466a0 Author: Johan Jonker Date: Wed Mar 30 14:19:21 2022 +0200 dt-bindings: clock: convert rockchip,rk3228-cru.txt to YAML Convert rockchip,rk3228-cru.txt to YAML. Changes against original bindings: Add clocks and clock-names because the device has to have at least one input clock. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330121923.24240-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit de55d1639067b9dd4986bb4885c41867d085defa Author: Johan Jonker Date: Wed Mar 30 13:48:45 2022 +0200 dt-bindings: clock: convert rockchip,rk3036-cru.txt to YAML Convert rockchip,rk3036-cru.txt to YAML. Changes against original bindings: Add clocks and clock-names because the device has to have at least one input clock. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330114847.18633-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit d87642d72e2921517a01139f33652dbb819a8115 Author: Johan Jonker Date: Tue Mar 29 20:43:38 2022 +0200 dt-bindings: clock: convert rockchip,rk3308-cru.txt to YAML Convert rockchip,rk3308-cru.txt to YAML. Changes against original bindings: - Add clocks and clock-names because the device has to have at least one input clock. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329184339.1134-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit ca1eadbfcd36bec73f2a2111c28e8c7e9e8ae6c0 Author: Stephen Boyd Date: Mon May 16 13:29:58 2022 -0700 Input: cros-ec-keyb - allow skipping keyboard registration If the device is a detachable (and therefore lacks full keyboard), we may still want to load this driver because the device might have some other buttons or switches (e.g. volume and power buttons or a tablet mode switch). In such case we do not want to register the "main" keyboard device to allow userspace detect when the detachable keyboard is disconnected and adjust the system behavior for the tablet mode. Originally it was suggested to simply skip keyboard registration if row and columns properties didn't exist, but that approach did not convey the intent strongly enough and also had a slight problem for migrating existing DTBs without updating the kernel first, so it was decided to introduce new google,cros-ec-keyb-switches to explicitly mark devices that only have axillary buttons and switches. Reviewed-by: Douglas Anderson Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220516183452.942008-3-swboyd@chromium.org Signed-off-by: Dmitry Torokhov commit 52dc6d3bea3b8509c2ec1f2ae413d0dc646e0b8a Author: Stephen Boyd Date: Mon May 16 11:55:31 2022 -0700 dt-bindings: google,cros-ec-keyb: Introduce switches only compatible If the ChromeOS board is a detachable, this cros-ec-keyb device won't have a matrix keyboard but it may have some button switches, e.g. volume buttons and power buttons. The driver still registers a keyboard though and that leads to userspace confusion around where the keyboard is. We tried to work around this by only registering the keyboard device when rows/columns properties were specified for the device, but that led to another problem where removing the rows/columns properties breaks the existing binding. Technically before that commit the rows/columns properties were required, otherwise the driver would fail to probe. Removing the properties from devicetrees makes the driver fail to probe unless the corresponding driver patch is present. Furthermore, this makes requiring matrix keyboard properties for devices that really have a keyboard impossible because the compatible drives the schema and now the properties are optional. Add a more specific compatible for this type of device that indicates to the OS that there are only switches and no matrix keyboard present. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220516183452.942008-2-swboyd@chromium.org Signed-off-by: Dmitry Torokhov commit 2ab8e11852a70af41770027eeb99b3d6fcbef44b Author: Johan Jonker Date: Wed Mar 30 12:39:23 2022 +0200 dt-bindings: clock: convert rockchip,px30-cru.txt to YAML Convert rockchip,px30-cru.txt to YAML. Changes against original bindings: Use compatible string: "rockchip,px30-pmucru" Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330103923.11063-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 43434c6681daa89c4c96b6c5ab82cdf894960ee0 Author: Johan Jonker Date: Tue Mar 29 13:13:22 2022 +0200 dt-bindings: clock: convert rockchip,rk3188-cru.txt to YAML Current dts files with RK3188/RK3066 'cru' nodes are manually verified. In order to automate this process rockchip,rk3188-cru.txt has to be converted to YAML. Changed: Add properties to fix notifications by clocks.yaml for example: clocks clock-names Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329111323.3569-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 03339ecc41201218eb2e9fa191bfa84b86cf26fd Author: Johan Jonker Date: Tue Mar 29 13:36:56 2022 +0200 dt-bindings: clock: convert rockchip,rk3288-cru.txt to YAML Current dts files with RK3288 'cru' nodes are manually verified. In order to automate this process rockchip,rk3288-cru.txt has to be converted to YAML. Changed: Add properties to fix notifications by clocks.yaml for example: clocks clock-names Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329113657.4567-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 0a55cf74ffb5d004b93647e4389096880ce37d6b Author: Steve French Date: Thu May 12 10:18:00 2022 -0500 SMB3: EBADF/EIO errors in rename/open caused by race condition in smb2_compound_op There is a race condition in smb2_compound_op: after_close: num_rqst++; if (cfile) { cifsFileInfo_put(cfile); // sends SMB2_CLOSE to the server cfile = NULL; This is triggered by smb2_query_path_info operation that happens during revalidate_dentry. In smb2_query_path_info, get_readable_path is called to load the cfile, increasing the reference counter. If in the meantime, this reference becomes the very last, this call to cifsFileInfo_put(cfile) will trigger a SMB2_CLOSE request sent to the server just before sending this compound request – and so then the compound request fails either with EBADF/EIO depending on the timing at the server, because the handle is already closed. In the first scenario, the race seems to be happening between smb2_query_path_info triggered by the rename operation, and between “cleanup” of asynchronous writes – while fsync(fd) likely waits for the asynchronous writes to complete, releasing the writeback structures can happen after the close(fd) call. So the EBADF/EIO errors will pop up if the timing is such that: 1) There are still outstanding references after close(fd) in the writeback structures 2) smb2_query_path_info successfully fetches the cfile, increasing the refcounter by 1 3) All writeback structures release the same cfile, reducing refcounter to 1 4) smb2_compound_op is called with that cfile In the second scenario, the race seems to be similar – here open triggers the smb2_query_path_info operation, and if all other threads in the meantime decrease the refcounter to 1 similarly to the first scenario, again SMB2_CLOSE will be sent to the server just before issuing the compound request. This case is harder to reproduce. See https://bugzilla.samba.org/show_bug.cgi?id=15051 Cc: stable@vger.kernel.org Fixes: 8de9e86c67ba ("cifs: create a helper to find a writeable handle by path name") Signed-off-by: Ondrej Hubsch Reviewed-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit b5639bb4313b9d455fc9fc4768d23a5e4ca8cb9d Author: Eric Biggers Date: Sat May 14 10:59:29 2022 -0700 f2fs: don't use casefolded comparison for "." and ".." Tryng to rename a directory that has all following properties fails with EINVAL and triggers the 'WARN_ON_ONCE(!fscrypt_has_encryption_key(dir))' in f2fs_match_ci_name(): - The directory is casefolded - The directory is encrypted - The directory's encryption key is not yet set up - The parent directory is *not* encrypted The problem is incorrect handling of the lookup of ".." to get the parent reference to update. fscrypt_setup_filename() treats ".." (and ".") specially, as it's never encrypted. It's passed through as-is, and setting up the directory's key is not attempted. As the name isn't a no-key name, f2fs treats it as a "normal" name and attempts a casefolded comparison. That breaks the assumption of the WARN_ON_ONCE() in f2fs_match_ci_name() which assumes that for encrypted directories, casefolded comparisons only happen when the directory's key is set up. We could just remove this WARN_ON_ONCE(). However, since casefolding is always a no-op on "." and ".." anyway, let's instead just not casefold these names. This results in the standard bytewise comparison. Fixes: 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption") Cc: # v5.11+ Signed-off-by: Eric Biggers Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Jaegeuk Kim commit c81d5bae404abc6b257667e84d39b9b50c7063d4 Author: Jaegeuk Kim Date: Fri May 6 13:34:41 2022 -0700 f2fs: do not stop GC when requiring a free section The f2fs_gc uses a bitmap to indicate pinned sections, but when disabling chckpoint, we call f2fs_gc() with NULL_SEGNO which selects the same dirty segment as a victim all the time, resulting in checkpoint=disable failure, for example. Let's pick another one, if we fail to collect it. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f87c7a4b084afc13190cbb263538e444cb2b392a Author: Baokun Li Date: Thu Apr 28 21:40:31 2022 +0800 ext4: fix race condition between ext4_write and ext4_convert_inline_data Hulk Robot reported a BUG_ON: ================================================================== EXT4-fs error (device loop3): ext4_mb_generate_buddy:805: group 0, block bitmap and bg descriptor inconsistent: 25 vs 31513 free clusters kernel BUG at fs/ext4/ext4_jbd2.c:53! invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 0 PID: 25371 Comm: syz-executor.3 Not tainted 5.10.0+ #1 RIP: 0010:ext4_put_nojournal fs/ext4/ext4_jbd2.c:53 [inline] RIP: 0010:__ext4_journal_stop+0x10e/0x110 fs/ext4/ext4_jbd2.c:116 [...] Call Trace: ext4_write_inline_data_end+0x59a/0x730 fs/ext4/inline.c:795 generic_perform_write+0x279/0x3c0 mm/filemap.c:3344 ext4_buffered_write_iter+0x2e3/0x3d0 fs/ext4/file.c:270 ext4_file_write_iter+0x30a/0x11c0 fs/ext4/file.c:520 do_iter_readv_writev+0x339/0x3c0 fs/read_write.c:732 do_iter_write+0x107/0x430 fs/read_write.c:861 vfs_writev fs/read_write.c:934 [inline] do_pwritev+0x1e5/0x380 fs/read_write.c:1031 [...] ================================================================== Above issue may happen as follows: cpu1 cpu2 __________________________|__________________________ do_pwritev vfs_writev do_iter_write ext4_file_write_iter ext4_buffered_write_iter generic_perform_write ext4_da_write_begin vfs_fallocate ext4_fallocate ext4_convert_inline_data ext4_convert_inline_data_nolock ext4_destroy_inline_data_nolock clear EXT4_STATE_MAY_INLINE_DATA ext4_map_blocks ext4_ext_map_blocks ext4_mb_new_blocks ext4_mb_regular_allocator ext4_mb_good_group_nolock ext4_mb_init_group ext4_mb_init_cache ext4_mb_generate_buddy --> error ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) ext4_restore_inline_data set EXT4_STATE_MAY_INLINE_DATA ext4_block_write_begin ext4_da_write_end ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) ext4_write_inline_data_end handle=NULL ext4_journal_stop(handle) __ext4_journal_stop ext4_put_nojournal(handle) ref_cnt = (unsigned long)handle BUG_ON(ref_cnt == 0) ---> BUG_ON The lock held by ext4_convert_inline_data is xattr_sem, but the lock held by generic_perform_write is i_rwsem. Therefore, the two locks can be concurrent. To solve above issue, we add inode_lock() for ext4_convert_inline_data(). At the same time, move ext4_convert_inline_data() in front of ext4_punch_hole(), remove similar handling from ext4_punch_hole(). Fixes: 0c8d414f163f ("ext4: let fallocate handle inline data correctly") Cc: stable@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220428134031.4153381-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 6493792d3299b3e33f887ef8a150099d271faf9c Author: Zhang Yi Date: Sun Apr 24 22:09:36 2022 +0800 ext4: convert symlink external data block mapping to bdev Symlink's external data block is one kind of metadata block, and now that almost all ext4 metadata block's page cache (e.g. directory blocks, quota blocks...) belongs to bdev backing inode except the symlink. It is essentially worked in data=journal mode like other regular file's data block because probably in order to make it simple for generic VFS code handling symlinks or some other historical reasons, but the logic of creating external data block in ext4_symlink() is complicated. and it also make things confused if user do not want to let the filesystem worked in data=journal mode. This patch convert the final exceptional case and make things clean, move the mapping of the symlink's external data block to bdev like any other metadata block does. Signed-off-by: Zhang Yi Link: https://lore.kernel.org/r/20220424140936.1898920-3-yi.zhang@huawei.com commit 9558cf14e8d2149a8df402b74041a99835801932 Author: Zhang Yi Date: Sun Apr 24 22:09:35 2022 +0800 ext4: add nowait mode for ext4_getblk() Current ext4_getblk() might sleep if some resources are not valid or could be race with a concurrent extents modifing procedure. So we cannot call ext4_getblk() and ext4_map_blocks() to get map blocks in the atomic context in some fast path (e.g. the upcoming procedure of getting symlink external block in the RCU context), even if the map extents have already been check and cached. Signed-off-by: Zhang Yi Link: https://lore.kernel.org/r/20220424140936.1898920-2-yi.zhang@huawei.com commit e4e58e5df309d695799c494958962100a4c25039 Author: Ojaswin Mujoo Date: Mon Apr 18 14:05:45 2022 +0530 ext4: fix journal_ioprio mount option handling In __ext4_super() we always overwrote the user specified journal_ioprio value with a default value, expecting parse_apply_sb_mount_options() to later correctly set ctx->journal_ioprio to the user specified value. However, if parse_apply_sb_mount_options() returned early because of empty sbi->es_s->s_mount_opts, the correct journal_ioprio value was never set. This patch fixes __ext4_super() to only use the default value if the user has not specified any value for journal_ioprio. Similarly, the remount behavior was to either use journal_ioprio value specified during initial mount, or use the default value irrespective of the journal_ioprio value specified during remount. This patch modifies this to first check if a new value for ioprio has been passed during remount and apply it. If no new value is passed, use the value specified during initial mount. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani Tested-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220418083545.45778-1-ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit d63c00ea435a5352f486c259665a4ced60399421 Author: Dmitry Monakhov Date: Sun Apr 17 20:03:15 2022 +0300 ext4: mark group as trimmed only if it was fully scanned Otherwise nonaligned fstrim calls will works inconveniently for iterative scanners, for example: // trim [0,16MB] for group-1, but mark full group as trimmed fstrim -o $((1024*1024*128)) -l $((1024*1024*16)) ./m // handle [16MB,16MB] for group-1, do nothing because group already has the flag. fstrim -o $((1024*1024*144)) -l $((1024*1024*16)) ./m [ Update function documentation for ext4_trim_all_free -- TYT ] Signed-off-by: Dmitry Monakhov Link: https://lore.kernel.org/r/1650214995-860245-1-git-send-email-dmtrmonakhov@yandex-team.ru Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 0be698ecbe4471fcad80e81ec6a05001421041b3 Author: Ye Bin Date: Thu Apr 14 10:52:23 2022 +0800 ext4: fix use-after-free in ext4_rename_dir_prepare We got issue as follows: EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue ext4_get_first_dir_block: bh->b_data=0xffff88810bee6000 len=34478 ext4_get_first_dir_block: *parent_de=0xffff88810beee6ae bh->b_data=0xffff88810bee6000 ext4_rename_dir_prepare: [1] parent_de=0xffff88810beee6ae ================================================================== BUG: KASAN: use-after-free in ext4_rename_dir_prepare+0x152/0x220 Read of size 4 at addr ffff88810beee6ae by task rep/1895 CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ #241 Call Trace: dump_stack+0xbe/0xf9 print_address_description.constprop.0+0x1e/0x220 kasan_report.cold+0x37/0x7f ext4_rename_dir_prepare+0x152/0x220 ext4_rename+0xf44/0x1ad0 ext4_rename2+0x11c/0x170 vfs_rename+0xa84/0x1440 do_renameat2+0x683/0x8f0 __x64_sys_renameat+0x53/0x60 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f45a6fc41c9 RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG_RAX: 0000000000000108 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9 RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005 RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080 R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0 R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee flags: 0x200000000000000() raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== Disabling lock debugging due to kernel taint ext4_rename_dir_prepare: [2] parent_de->inode=3537895424 ext4_rename_dir_prepare: [3] dir=0xffff888124170140 ext4_rename_dir_prepare: [4] ino=2 ext4_rename_dir_prepare: ent->dir->i_ino=2 parent=-757071872 Reason is first directory entry which 'rec_len' is 34478, then will get illegal parent entry. Now, we do not check directory entry after read directory block in 'ext4_get_first_dir_block'. To solve this issue, check directory entry in 'ext4_get_first_dir_block'. [ Trigger an ext4_error() instead of just warning if the directory is missing a '.' or '..' entry. Also make sure we return an error code if the file system is corrupted. -TYT ] Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220414025223.4113128-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 0a05fafe9def0d9f0fbef3dfc8094925af9e3185 Author: Johannes Thumshirn Date: Fri May 13 08:52:52 2022 -0700 btrfs: zoned: introduce a minimal zone size 4M and reject mount Zoned devices are expected to have zone sizes in the range of 1-2GB for ZNS SSDs and SMR HDDs have zone sizes of 256MB, so there is no need to allow arbitrarily small zone sizes on btrfs. But for testing purposes with emulated devices it is sometimes desirable to create devices with as small as 4MB zone size to uncover errors. So use 4MB as the smallest possible zone size and reject mounts of devices with a smaller zone size. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8101a0c8a318d1c25f333f44523571806b3fb05 Author: Qu Wenruo Date: Mon May 9 20:00:53 2022 +0800 btrfs: allow defrag to convert inline extents to regular extents Btrfs defaults to max_inline=2K to make small writes inlined into metadata. The default value is always a win, as even DUP/RAID1/RAID10 doubles the metadata usage, it should still cause less physical space used compared to a 4K regular extents. But since the introduction of RAID1C3 and RAID1C4 it's no longer the case, users may find inlined extents causing too much space wasted, and want to convert those inlined extents back to regular extents. Unfortunately defrag will unconditionally skip all inline extents, no matter if the user is trying to converting them back to regular extents. So this patch will add a small exception for defrag_collect_targets() to allow defragging inline extents, if and only if the inlined extents are larger than max_inline, allowing users to convert them to regular ones. This also allows us to defrag extents like the following: item 6 key (257 EXTENT_DATA 0) itemoff 15794 itemsize 69 generation 7 type 0 (inline) inline extent data size 48 ram_bytes 4096 compression 1 (zlib) item 7 key (257 EXTENT_DATA 4096) itemoff 15741 itemsize 53 generation 7 type 1 (regular) extent data disk byte 13631488 nr 4096 extent data offset 0 nr 16384 ram 16384 extent compression 1 (zlib) Previously we're unable to do any defrag, since the first extent is inlined, and the second one has no extent to merge. Now we can defrag it to just one single extent, saving 48 bytes metadata space. item 6 key (257 EXTENT_DATA 0) itemoff 15810 itemsize 53 generation 8 type 1 (regular) extent data disk byte 13635584 nr 4096 extent data offset 0 nr 20480 ram 20480 extent compression 1 (zlib) Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit d5321a0fa8bc49f11bea0b470800962c17d92d8f Author: Qu Wenruo Date: Tue May 10 15:10:18 2022 +0800 btrfs: add "0x" prefix for unsupported optional features The following error message lack the "0x" obviously: cannot mount because of unsupported optional features (4000) Add the prefix to make it less confusing. This can happen on older kernels that try to mount a filesystem with newer features so it makes sense to backport to older trees. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 97bdf1a903c51bd773b5828af233f639957a92b7 Author: Filipe Manana Date: Mon May 9 16:29:14 2022 +0100 btrfs: do not account twice for inode ref when reserving metadata units When reserving metadata units for creating an inode, we don't need to reserve one extra unit for the inode ref item because when creating the inode, at btrfs_create_new_inode(), we always insert the inode item and the inode ref item in a single batch (a single btree insert operation, and both ending up in the same leaf). As we have accounted already one unit for the inode item, the extra unit for the inode ref item is superfluous, it only makes us reserve more metadata than necessary and often adding more reclaim pressure if we are low on available metadata space. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit aa9ffadfcae33e611d8c2d476bcc2aa0d273b587 Author: Naohiro Aota Date: Wed May 4 16:12:48 2022 -0700 btrfs: zoned: fix comparison of alloc_offset vs meta_write_pointer The block_group->alloc_offset is an offset from the start of the block group. OTOH, the ->meta_write_pointer is an address in the logical space. So, we should compare the alloc_offset shifted with the block_group->start. Fixes: afba2bc036b0 ("btrfs: zoned: implement active zone tracking") CC: stable@vger.kernel.org # 5.16+ Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 152555b39cebda84a02e2553fde3a5ab5c51e741 Author: Filipe Manana Date: Tue May 17 11:47:30 2022 +0100 btrfs: send: avoid trashing the page cache A send operation reads extent data using the buffered IO path for getting extent data to send in write commands and this is both because it's simple and to make use of the generic readahead infrastructure, which results in a massive speedup. However this fills the page cache with data that, most of the time, is really only used by the send operation - once the write commands are sent, it's not useful to have the data in the page cache anymore. For large snapshots, bringing all data into the page cache eventually leads to the need to evict other data from the page cache that may be more useful for applications (and kernel subsystems). Even if extents are shared with the subvolume on which a snapshot is based on and the data is currently on the page cache due to being read through the subvolume, attempting to read the data through the snapshot will always result in bringing a new copy of the data into another location in the page cache (there's currently no shared memory for shared extents). So make send evict the data it has read before if when it first opened the inode, its mapping had no pages currently loaded: when inode->i_mapping->nr_pages has a value of 0. Do this instead of deciding based on the return value of filemap_range_has_page() before reading an extent because the generic readahead mechanism may read pages beyond the range we request (and it very often does it), which means a call to filemap_range_has_page() will return true due to the readahead that was triggered when processing a previous extent - we don't have a simple way to distinguish this case from the case where the data was brought into the page cache through someone else. So checking for the mapping number of pages being 0 when we first open the inode is simple, cheap and it generally accomplishes the goal of not trashing the page cache - the only exception is if part of data was previously loaded into the page cache through the snapshot by some other process, in that case we end up not evicting any data send brings into the page cache, just like before this change - but that however is not the common case. Example scenario, on a box with 32G of RAM: $ btrfs subvolume create /mnt/sv1 $ xfs_io -f -c "pwrite 0 4G" /mnt/sv1/file1 $ btrfs subvolume snapshot -r /mnt/sv1 /mnt/snap1 $ free -m total used free shared buff/cache available Mem: 31937 186 26866 0 4883 31297 Swap: 8188 0 8188 # After this we get less 4G of free memory. $ btrfs send /mnt/snap1 >/dev/null $ free -m total used free shared buff/cache available Mem: 31937 186 22814 0 8935 31297 Swap: 8188 0 8188 The same, obviously, applies to an incremental send. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6177531020c7a774cba68f92fc242d695b059aad Author: Oleksij Rempel Date: Tue May 17 13:15:05 2022 +0200 dt-bindings: usb: ci-hdrc-usb2: fix node node for ethernet controller This documentation provides wrong node name for the Ethernet controller. It should be "ethernet" instead of "smsc" as required by Ethernet controller devicetree schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220517111505.929722-4-o.rempel@pengutronix.de commit c0c155fc7e76073acd2cb05275071af239b315b0 Author: Oleksij Rempel Date: Tue May 17 13:15:04 2022 +0200 dt-bindings: net: add schema for Microchip/SMSC LAN95xx USB Ethernet controllers Create initial schema for Microchip/SMSC LAN95xx USB Ethernet controllers and import some of currently supported USB IDs form drivers/net/usb/smsc95xx.c These devices are already used in some of DTs. So, this schema makes it official. NOTE: there was no previously documented txt based DT binding for this controllers. Signed-off-by: Oleksij Rempel Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220517111505.929722-3-o.rempel@pengutronix.de commit 2e3026134104006c72a9204645efc216ab086de3 Author: Oleksij Rempel Date: Tue May 17 13:15:03 2022 +0200 dt-bindings: net: add schema for ASIX USB Ethernet controllers Create schema for ASIX USB Ethernet controllers and import some of currently supported USB IDs form drivers/net/usb/asix_devices.c These devices are already used in some of DTs. So, this schema makes it official. NOTE: there was no previously documented txt based DT binding for this controllers. Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220517111505.929722-2-o.rempel@pengutronix.de commit df5cd369876114f91f9ae60658fea80acfb15890 Author: Andre Przywara Date: Tue May 17 11:14:10 2022 +0100 of/fdt: Ignore disabled memory nodes When we boot a machine using a devicetree, the generic DT code goes through all nodes with a 'device_type = "memory"' property, and collects all memory banks mentioned there. However it does not check for the status property, so any nodes which are explicitly "disabled" will still be added as a memblock. This ends up badly for QEMU, when booting with secure firmware on arm/arm64 machines, because QEMU adds a node describing secure-only memory: =================== secram@e000000 { secure-status = "okay"; status = "disabled"; reg = <0x00 0xe000000 0x00 0x1000000>; device_type = "memory"; }; =================== The kernel will eventually use that memory block (which is located below the main DRAM bank), but accesses to that will be answered with an SError: =================== [ 0.000000] Internal error: synchronous external abort: 96000050 [#1] PREEMPT SMP [ 0.000000] Modules linked in: [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc6-00014-g10c8acb8b679 #524 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.000000] pc : new_slab+0x190/0x340 [ 0.000000] lr : new_slab+0x184/0x340 [ 0.000000] sp : ffff80000a4b3d10 .... ================== The actual crash location and call stack will be somewhat random, and depend on the specific allocation of that physical memory range. As the DT spec[1] explicitly mentions standard properties, add a simple check to skip over disabled memory nodes, so that we only use memory that is meant for non-secure code to use. That fixes booting a QEMU arm64 VM with EL3 enabled ("secure=on"), when not using UEFI. In this case the QEMU generated DT will be handed on to the kernel, which will see the secram node. This issue is reproducible when using TF-A together with U-Boot as firmware, then booting with the "booti" command. When using U-Boot as an UEFI provider, the code there [2] explicitly filters for disabled nodes when generating the UEFI memory map, so we are safe. EDK/2 only reads the first bank of the first DT memory node [3] to learn about memory, so we got lucky there. [1] https://github.com/devicetree-org/devicetree-specification/blob/main/source/chapter3-devicenodes.rst#memory-node (after the table) [2] https://source.denx.de/u-boot/u-boot/-/blob/master/lib/fdtdec.c#L1061-1063 [3] https://github.com/tianocore/edk2/blob/master/ArmVirtPkg/PrePi/FdtParser.c Reported-by: Ross Burton Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220517101410.3493781-1-andre.przywara@arm.com commit 9c270040b901db63fcfb2694891404d75202bb68 Author: Ken Kurematsu Date: Wed May 11 07:01:56 2022 +0000 dt-bindings: arm: fix typos in compatible Fix typo "cortex" Signed-off-by: Ken Kurematsu Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/OSBPR01MB32880CB4C49E50DAB7C6B664DBC89@OSBPR01MB3288.jpnprd01.prod.outlook.com commit 572744390a66b1b6f3d2235fbae27dea3dc4ef2c Author: Gene Chen Date: Mon May 16 14:21:27 2022 +0800 dt-bindings: mfd: Add bindings child nodes for the Mediatek MT6360 Add bindings child nodes for the Mediatek MT6360 Signed-off-by: Gene Chen Link: https://lore.kernel.org/all/YmqTzlrVL5KaVPuz@robh.at.kernel.org/ Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220516062127.99647-1-gene.chen.richtek@gmail.com commit 71342db05722907f30505afa4d845cae0f276d23 Author: Trond Myklebust Date: Sat May 14 10:37:00 2022 -0400 NFSv4.1: Enable access to the NFSv4.1 'dacl' and 'sacl' attributes Enable access to the NFSv4 acl via the NFSv4.1 'dacl' and 'sacl' attributes. This allows the server to authenticate the DACL and the SACL operations separately, since reading and/or editing the SACL is usually considered to be a privileged operation. It also allows the propagation of automatic inheritance information that was not supported by the NFSv4.0 'acl' attribute. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit db145db021abf75aa1a5810e631425055cfbed47 Author: Trond Myklebust Date: Sat May 14 10:36:59 2022 -0400 NFSv4: Add encoders/decoders for the NFSv4.1 dacl and sacl attributes Add the ability to set or retrieve the acl using the NFSv4.1 'dacl' and 'sacl' attributes to the NFSv4 xdr encoders/decoders. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 7b8b44eb7710e34a1ea5278392417993a549fabf Author: Trond Myklebust Date: Sat May 14 10:36:58 2022 -0400 NFSv4: Specify the type of ACL to cache When caching a NFSv4 ACL, we want to specify whether we are caching an NFSv4.0 type acl, the NFSv4.1 dacl or the NFSv4.1 sacl. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit ec432e2a51412bde3d2d9fa785d3812f55ccd696 Merge: 37a86b32bf0e5 c8c960c109716 Author: Mark Brown Date: Tue May 17 18:19:35 2022 +0100 ASoC: Intel: avs: Driver core and PCM operations Merge series from Cezary Rojewski : Part three of main AVS driver series. This series was originally part of the initial series which was later divided [1] into smaller, easier-to-review chunks. Thus, many patches found here were already present on the list. This series consists of code typical to many drivers - PCI driver operations, trace ability, PM operations - as well as PCM handlers for all standard audio interfaces, that is, HDA, I2S and DMIC are found here. Series starts with updating firmware boot flow - libraries are no longer ignored. This change is dependent on already merged topology code [2] and because of that could not be part of the initial series [1]. PCM operations are split into four changes. First component operations alone i.e. operations which are usually agnostic towards path position (FE/BE). Then it continues with "generic" FE operations - there is no interface split here as from Intel ADSP point of view, FE, or HOST side as it's called in the specs, involves HD-Audio operations only. BE (also known as LINK) side on the other hand is divided into "non-HD-Audio" and HD-Audio part. The former represents transfer over DMIC and I2S interfaces both. While patches implementing standard PCI driver operations along (again standard) HD-Audio initialization routines followed up by power management handlers are two major ones, series covers also other important subjects such as: While patches implementing standard PCI driver operations along (again standard) HD-Audio initialization routines followed up by power management handlers are two major ones, series covers also other important subjects such as: - event tracing - preparation for firmware tracing (debugability) - coredump (debugability) - recovery flow (attempt recovery after IPC timeout or exception) - D0ix (D0 device substate, complements standard power management) Series is finalized by actual addition of supported platforms: SKL and APL-based. Platform-specific files are limited to firmware-specific bits, that is, bits that are specific to given firmware generation. Everything else is shared and is part of already upstream messaging code found in ipc.c, messages.c and messages.h files. Changes in v3: - addressed (hopefully) trace-code compilation under .configs with CONFIG_FTRACE dropped Changes in v2: - usage of avs_releast_last_firmware() dropped in error path for library loading procedure as suggested by Pierre - 'link_mask' usage replaced with 'i2s_link_mask' as requested by Pierre. Existing code addressed with new patch: "ASoC: Intel: avs: Replace link_mask usage with i2s_link_mask" - fixed possible race during recovery flow (->recovering flag is now atomic and tested in single location only). - dropped platform prefixes for basically all i2s board descriptors - 'ssp_test' renamed to 'i2s_test' to match naming convention of other boards - simplified PM implementation for current series, 'low_power' bits moved to future series - replaced SND_INTEL_DSP_DRIVER_SST with _AVS as suggested by Mark. Required changes to intel-dspcfg will be added in future series - number of typos across commit messages addressed [1]: https://lore.kernel.org/all/20220311153544.136854-1-cezary.rojewski@intel.com/ [2]: https://lore.kernel.org/all/20220331135246.993089-1-cezary.rojewski@intel.com/ Cezary Rojewski (14): ASoC: Intel: avs: Account for libraries when booting basefw ASoC: Intel: avs: Generic soc component driver ASoC: Intel: avs: Generic PCM FE operations ASoC: Intel: avs: non-HDA PCM BE operations ASoC: Intel: avs: HDA PCM BE operations ASoC: Intel: avs: Coredump and recovery flow ASoC: Intel: avs: Prepare for firmware tracing ASoC: Intel: avs: D0ix power state support ASoC: Intel: avs: Event tracing ASoC: Intel: avs: Machine board registration ASoC: Intel: avs: PCI driver implementation ASoC: Intel: avs: Power management ASoC: Intel: avs: SKL-based platforms support ASoC: Intel: avs: APL-based platforms support Piotr Maziarz (1): ASoC: Intel: avs: Replace link_mask usage with i2s_link_mask include/sound/intel-dsp-config.h | 3 +- include/sound/soc-acpi.h | 2 + sound/soc/intel/Kconfig | 2 + sound/soc/intel/avs/Makefile | 7 +- sound/soc/intel/avs/apl.c | 250 ++++++ sound/soc/intel/avs/avs.h | 79 ++ sound/soc/intel/avs/board_selection.c | 501 +++++++++++ sound/soc/intel/avs/core.c | 631 +++++++++++++ sound/soc/intel/avs/dsp.c | 27 +- sound/soc/intel/avs/ipc.c | 253 +++++- sound/soc/intel/avs/loader.c | 84 ++ sound/soc/intel/avs/messages.c | 35 +- sound/soc/intel/avs/messages.h | 51 ++ sound/soc/intel/avs/pcm.c | 1182 +++++++++++++++++++++++++ sound/soc/intel/avs/registers.h | 8 + sound/soc/intel/avs/skl.c | 125 +++ sound/soc/intel/avs/topology.c | 14 +- sound/soc/intel/avs/trace.c | 33 + sound/soc/intel/avs/trace.h | 154 ++++ sound/soc/intel/avs/utils.c | 23 + 20 files changed, 3443 insertions(+), 21 deletions(-) create mode 100644 sound/soc/intel/avs/apl.c create mode 100644 sound/soc/intel/avs/board_selection.c create mode 100644 sound/soc/intel/avs/pcm.c create mode 100644 sound/soc/intel/avs/skl.c create mode 100644 sound/soc/intel/avs/trace.c create mode 100644 sound/soc/intel/avs/trace.h -- 2.25.1 commit 6949493884fe88500de4af182588e071cf1544ee Author: Trond Myklebust Date: Sat May 14 10:08:14 2022 -0400 NFSv4: Don't hold the layoutget locks across multiple RPC calls When doing layoutget as part of the open() compound, we have to be careful to release the layout locks before we can call any further RPC calls, such as setattr(). The reason is that those calls could trigger a recall, which could deadlock. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 126966ddedb60bb7bf9f3b341e26ca8ef1019efc Author: Trond Myklebust Date: Sat May 14 10:08:13 2022 -0400 pNFS/files: Fall back to I/O through the MDS on non-fatal layout errors Only report the error when the server is returning a fatal error, such as ESTALE, EIO, etc... Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit c6fd3511c3397dd9cbc6dc5d105bbedb69bf4061 Author: Trond Myklebust Date: Sat May 14 10:08:12 2022 -0400 NFS: Further fixes to the writeback error handling When we handle an error by redirtying the page, we're not corrupting the mapping, so we don't want the error to be recorded in the mapping. If the caller has specified a sync_mode of WB_SYNC_NONE, we can just return AOP_WRITEPAGE_ACTIVATE. However if we're dealing with WB_SYNC_ALL, we need to ensure that retries happen when the errors are non-fatal. Reported-by: Olga Kornievskaia Fixes: 8fc75bed96bb ("NFS: Fix up return value on fatal errors in nfs_page_async_flush()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 3764a17e31d579cf9b4bd0a69894b577e8d75702 Author: Trond Myklebust Date: Sat May 14 10:08:11 2022 -0400 NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout Commit 587f03deb69b caused pnfs_update_layout() to stop returning ENOMEM when the memory allocation fails, and hence causes it to fall back to trying to do I/O through the MDS. There is no guarantee that this will fare any better. If we're failing the pNFS layout allocation, then we should just redirty the page and retry later. Reported-by: Olga Kornievskaia Fixes: 587f03deb69b ("pnfs: refactor send_layoutget") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 452284407c18d8a522c3039339b1860afa0025a8 Author: Trond Myklebust Date: Sat May 14 10:08:10 2022 -0400 NFS: Memory allocation failures are not server fatal errors We need to filter out ENOMEM in nfs_error_is_fatal_on_server(), because running out of memory on our client is not a server error. Reported-by: Olga Kornievskaia Fixes: 2dc23afffbca ("NFS: ENOMEM should also be a fatal error.") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1fefc8ecb834c88edfc27e712d683872d0c541dd Author: Yang Yingliang Date: Mon May 16 17:29:11 2022 +0800 mtd: st_spi_fsm: add missing clk_disable_unprepare() in stfsm_remove() Clock source is prepared and enabled by clk_prepare_enable() in probe function, but not disabled or unprepared in remove function. Signed-off-by: Yang Yingliang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220516092911.953066-1-yangyingliang@huawei.com commit 68aa84ff28ba5f5dfcb290b260600b0d61558703 Author: Andy Shevchenko Date: Mon May 16 21:55:00 2022 +0300 pinctrl: cherryview: Use GPIO chip pointer in chv_gpio_irq_mask_unmask() The callers already have dereferenced pointer to GPIO chip, no need to do it again in chv_gpio_irq_mask_unmask(). Hence, replace IRQ data pointer by GPIO chip pointer. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit ba73eadd23d1c2dc5c8dc0c0ae2eeca2b9b709a7 Author: Jeffle Xu Date: Thu May 12 13:56:01 2022 +0800 erofs: scan devices from device table When "-o device" mount option is not specified, scan the device table and instantiate the devices if there's any in the device table. In this case, the tag field of each device slot uniquely specifies a device. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220512055601.106109-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit d435d53228dd039fffecae123b8c138af6f96f99 Author: Xin Yin Date: Mon May 9 15:40:28 2022 +0800 erofs: change to use asynchronous io for fscache readpage/readahead Use asynchronous io to read data from fscache may greatly improve IO bandwidth for sequential buffered read scenario. Change erofs_fscache_read_folios to erofs_fscache_read_folios_async, and read data from fscache asynchronously. Make .readpage()/.readahead() to use this new helper. Signed-off-by: Xin Yin Reviewed-by: Jeffle Xu Signed-off-by: Jeffle Xu Link: https://lore.kernel.org/r/20220509074028.74954-23-jefflexu@linux.alibaba.com Acked-by: Chao Yu [ Gao Xiang: minor styling changes. ] Signed-off-by: Gao Xiang commit 9c0cc9c729657446ed001a99488a9d82f5124af4 Author: Jeffle Xu Date: Mon Apr 25 20:21:43 2022 +0800 erofs: add 'fsid' mount option Introduce 'fsid' mount option to enable on-demand read sementics, in which case, erofs will be mounted from data blobs. Users could specify the name of primary data blob by this mount option. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-22-jefflexu@linux.alibaba.com Acked-by: Chao Yu Tested-by: Zichen Tian Tested-by: Jia Zhu Tested-by: Yan Song Signed-off-by: Gao Xiang commit c665b394b9e8c534e220da876adbd4db990b4c1b Author: Jeffle Xu Date: Mon Apr 25 20:21:42 2022 +0800 erofs: implement fscache-based data readahead Implement fscache-based data readahead. Also registers an individual bdi for each erofs instance to enable readahead. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-21-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit bd735bdaa62fb64980c07f5443f24aefd0081569 Author: Jeffle Xu Date: Mon Apr 25 20:21:41 2022 +0800 erofs: implement fscache-based data read for inline layout Implement the data plane of reading data from data blobs over fscache for inline layout. For the heading non-inline part, the data plane for non-inline layout is reused, while only the tail packing part needs special handling. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-20-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 1442b02b66ad2c568f9d5178b7c3c1287b37e438 Author: Jeffle Xu Date: Mon Apr 25 20:21:40 2022 +0800 erofs: implement fscache-based data read for non-inline layout Implement the data plane of reading data from data blobs over fscache for non-inline layout. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-19-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 5375e7c8b0fef11645657384fe1f2cfed1e0baa7 Author: Jeffle Xu Date: Mon Apr 25 20:21:39 2022 +0800 erofs: implement fscache-based metadata read Implement the data plane of reading metadata from primary data blob over fscache. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-18-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 955b478e1b4ad5530cd10395d56d45119d3a3ff4 Author: Jeffle Xu Date: Mon Apr 25 20:21:38 2022 +0800 erofs: register fscache context for extra data blobs Similar to the multi-device mode, erofs could be mounted from one primary data blob (mandatory) and multiple extra data blobs (optional). Register fscache context for each extra data blob. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-17-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 37c90c5fae701983e21cc80396649e3aca7f4fa1 Author: Jeffle Xu Date: Mon Apr 25 20:21:37 2022 +0800 erofs: register fscache context for primary data blob Registers fscache context for primary data blob. Also move the initialization of s_op and related fields forward, since anonymous inode will be allocated under the super block when registering the fscache context. Something worth mentioning about the cleanup routine. 1. The fscache context will instantiate anonymous inodes under the super block. Release these anonymous inodes when .put_super() is called, or we'll get "VFS: Busy inodes after unmount." warning. 2. The fscache context is initialized prior to the root inode. If .kill_sb() is called when mount failed, .put_super() won't be called when root inode has not been initialized yet. Thus .kill_sb() shall also contain the cleanup routine. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-16-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit ec00b5e29ce3a2493616a03b56593690574a8c86 Author: Jeffle Xu Date: Mon Apr 25 20:21:36 2022 +0800 erofs: add erofs_fscache_read_folios() helper Add erofs_fscache_read_folios() helper reading from fscache. It supports on-demand read semantics. That is, it will make the backend prepare for the data when cache miss. Once data ready, it will read from the cache. This helper can then be used to implement .readpage()/.readahead() of on-demand read semantics. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-15-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 3c265d7dcefab21a58ca5454c0f778412bde0870 Author: Jeffle Xu Date: Mon Apr 25 20:21:35 2022 +0800 erofs: add anonymous inode caching metadata for data blobs Introduce one anonymous inode for data blobs so that erofs can cache metadata directly within such anonymous inode. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-14-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit b02c602f065f7a09d7678dd1d8bf3d3fd10ed228 Author: Jeffle Xu Date: Mon Apr 25 20:21:34 2022 +0800 erofs: add fscache context helper functions Introduce a context structure for managing data blobs, and helper functions for initializing and cleaning up this context structure. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-13-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit c6be2bd0a5dd91f98d6b5d2df2c79bc32993352c Author: Jeffle Xu Date: Mon Apr 25 20:21:33 2022 +0800 erofs: register fscache volume A new fscache based mode is going to be introduced for erofs, in which case on-demand read semantics is implemented through fscache. As the first step, register fscache volume for each erofs filesystem. That means, data blobs can not be shared among erofs filesystems. In the following iteration, we are going to introduce the domain semantics, in which case several erofs filesystems can belong to one domain, and data blobs can be shared among these erofs filesystems of one domain. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-12-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 93b856bb5f66ae149ed91876b17c8c3fca576615 Author: Jeffle Xu Date: Mon Apr 25 20:21:32 2022 +0800 erofs: add fscache mode check helper Until then erofs is exactly blockdev based filesystem. A new fscache-based mode is going to be introduced for erofs to support scenarios where on-demand read semantics is needed, e.g. container image distribution. In this case, erofs could be mounted from data blobs through fscache. Add a helper checking which mode erofs works in, and twist the code in preparation for the upcoming fscache mode. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-11-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 94d78946704f7facd010b9dee5e158921ab37398 Author: Jeffle Xu Date: Mon Apr 25 20:21:31 2022 +0800 erofs: make erofs_map_blocks() generally available ... so that it can be used in the following introduced fscache mode. Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20220425122143.56815-10-jefflexu@linux.alibaba.com Acked-by: Chao Yu Signed-off-by: Gao Xiang commit 99302ebd3af7895cb5312e80e65d4db5aed5a72d Author: Jeffle Xu Date: Mon Apr 25 20:21:30 2022 +0800 cachefiles: document on-demand read mode Document new user interface introduced by on-demand read mode. Signed-off-by: Jeffle Xu Link: https://lore.kernel.org/r/20220509074028.74954-9-jefflexu@linux.alibaba.com Acked-by: David Howells Signed-off-by: Gao Xiang commit 1519670e4fecc6063fa2f0c10f0666d3331f219b Author: Jeffle Xu Date: Mon Apr 25 20:21:29 2022 +0800 cachefiles: add tracepoints for on-demand read mode Add tracepoints for on-demand read mode. Currently following tracepoints are added: OPEN request / COPEN reply CLOSE request READ request / CREAD reply write through anonymous fd release of anonymous fd Signed-off-by: Jeffle Xu Acked-by: David Howells Link: https://lore.kernel.org/r/20220425122143.56815-8-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 4e4f1788af0e477bca079e5b1ffc42846b3bafee Author: Jeffle Xu Date: Mon Apr 25 20:21:28 2022 +0800 cachefiles: enable on-demand read mode Enable on-demand read mode by adding an optional parameter to the "bind" command. On-demand mode will be turned on when this parameter is "ondemand", i.e. "bind ondemand". Otherwise cachefiles will work in the original mode. Signed-off-by: Jeffle Xu Link: https://lore.kernel.org/r/20220509074028.74954-7-jefflexu@linux.alibaba.com Acked-by: David Howells Signed-off-by: Gao Xiang commit 9032b6e8589f269743984aac53e82e4835be16dc Author: Jeffle Xu Date: Mon Apr 25 20:21:27 2022 +0800 cachefiles: implement on-demand read Implement the data plane of on-demand read mode. The early implementation [1] place the entry to cachefiles_ondemand_read() in fscache_read(). However, fscache_read() can only detect if the requested file range is fully cache miss, whilst we need to notify the user daemon as long as there's a hole inside the requested file range. Thus the entry is now placed in cachefiles_prepare_read(). When working in on-demand read mode, once a hole detected, the read routine will send a READ request to the user daemon. The user daemon needs to fetch the data and write it to the cache file. After sending the READ request, the read routine will hang there, until the READ request is handled by the user daemon. Then it will retry to read from the same file range. If no progress encountered, the read routine will fail then. A new NETFS_SREQ_ONDEMAND flag is introduced to indicate that on-demand read should be done when a cache miss encountered. [1] https://lore.kernel.org/all/20220406075612.60298-6-jefflexu@linux.alibaba.com/ #v8 Signed-off-by: Jeffle Xu Acked-by: David Howells Link: https://lore.kernel.org/r/20220425122143.56815-6-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 324b954ac80cff0d11ddb6bde9b6631e45e98620 Author: Jeffle Xu Date: Mon Apr 25 20:21:26 2022 +0800 cachefiles: notify the user daemon when withdrawing cookie Notify the user daemon that cookie is going to be withdrawn, providing a hint that the associated anonymous fd can be closed. Be noted that this is only a hint. The user daemon may close the associated anonymous fd when receiving the CLOSE request, then it will receive another anonymous fd when the cookie gets looked up. Or it may ignore the CLOSE request, and keep writing data through the anonymous fd. However the next time the cookie gets looked up, the user daemon will still receive another new anonymous fd. Signed-off-by: Jeffle Xu Acked-by: David Howells Link: https://lore.kernel.org/r/20220425122143.56815-5-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit d11b0b043b4008d64abaf1a26eea3dbcd906ee59 Author: Jeffle Xu Date: Mon Apr 25 20:21:25 2022 +0800 cachefiles: unbind cachefiles gracefully in on-demand mode Add a refcount to avoid the deadlock in on-demand read mode. The on-demand read mode will pin the corresponding cachefiles object for each anonymous fd. The cachefiles object is unpinned when the anonymous fd gets closed. When the user daemon exits and the fd of "/dev/cachefiles" device node gets closed, it will wait for all cahcefiles objects getting withdrawn. Then if there's any anonymous fd getting closed after the fd of the device node, the user daemon will hang forever, waiting for all objects getting withdrawn. To fix this, add a refcount indicating if there's any object pinned by anonymous fds. The cachefiles cache gets unbound and withdrawn when the refcount is decreased to 0. It won't change the behaviour of the original mode, in which case the cachefiles cache gets unbound and withdrawn as long as the fd of the device node gets closed. Signed-off-by: Jeffle Xu Link: https://lore.kernel.org/r/20220509074028.74954-4-jefflexu@linux.alibaba.com Acked-by: David Howells Signed-off-by: Gao Xiang commit c8383054506c77b814489c09877b5db83fd4abf2 Author: Jeffle Xu Date: Mon Apr 25 20:21:24 2022 +0800 cachefiles: notify the user daemon when looking up cookie Fscache/CacheFiles used to serve as a local cache for a remote networking fs. A new on-demand read mode will be introduced for CacheFiles, which can boost the scenario where on-demand read semantics are needed, e.g. container image distribution. The essential difference between these two modes is seen when a cache miss occurs: In the original mode, the netfs will fetch the data from the remote server and then write it to the cache file; in on-demand read mode, fetching the data and writing it into the cache is delegated to a user daemon. As the first step, notify the user daemon when looking up cookie. In this case, an anonymous fd is sent to the user daemon, through which the user daemon can write the fetched data to the cache file. Since the user daemon may move the anonymous fd around, e.g. through dup(), an object ID uniquely identifying the cache file is also attached. Also add one advisory flag (FSCACHE_ADV_WANT_CACHE_SIZE) suggesting that the cache file size shall be retrieved at runtime. This helps the scenario where one cache file contains multiple netfs files, e.g. for the purpose of deduplication. In this case, netfs itself has no idea the size of the cache file, whilst the user daemon should give the hint on it. Signed-off-by: Jeffle Xu Link: https://lore.kernel.org/r/20220509074028.74954-3-jefflexu@linux.alibaba.com Acked-by: David Howells Signed-off-by: Gao Xiang commit a06fac1599c179853639491974fd72aefd46d030 Author: Jeffle Xu Date: Mon Apr 25 20:21:23 2022 +0800 cachefiles: extract write routine Extract the generic routine of writing data to cache files, and make it generally available. This will be used by the following patch implementing on-demand read mode. Since it's called inside CacheFiles module, make the interface generic and unrelated to netfs_cache_resources. It is worth noting that, ki->inval_counter is not initialized after this cleanup. It shall not make any visible difference, since inval_counter is no longer used in the write completion routine, i.e. cachefiles_write_complete(). Signed-off-by: Jeffle Xu Acked-by: David Howells Link: https://lore.kernel.org/r/20220425122143.56815-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit c5e483b77cc2edb318da152abe07e33006b975fd Author: Trond Myklebust Date: Sat May 14 10:27:04 2022 -0400 NFS: Don't report errors from nfs_pageio_complete() more than once Since errors from nfs_pageio_complete() are already being reported through nfs_async_write_error(), we should not be returning them to the callers of do_writepages() as well. They will end up being reported through the generic mechanism instead. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit d95b26650e86175e4a97698d89bc1626cd1df0c6 Author: Trond Myklebust Date: Sat May 14 10:27:03 2022 -0400 NFS: Do not report flush errors in nfs_write_end() If we do flush cached writebacks in nfs_write_end() due to the imminent expiration of an RPCSEC_GSS session, then we should defer reporting any resulting errors until the calls to file_check_and_advance_wb_err() in nfs_file_write() and nfs_file_fsync(). Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit e6005436f6cc9ed13288f936903f0151e5543485 Author: Trond Myklebust Date: Sat May 14 10:27:02 2022 -0400 NFS: Don't report ENOSPC write errors twice Any errors reported by the write() system call need to be cleared from the file descriptor's error tracking. The current call to nfs_wb_all() causes the error to be reported, but since it doesn't call file_check_and_advance_wb_err(), we can end up reporting the same error a second time when the application calls fsync(). Note that since Linux 4.13, the rule is that EIO may be reported for write(), but it must be reported by a subsequent fsync(), so let's just drop reporting it in write. The check for nfs_ctx_key_to_expire() is just a duplicate to the one already in nfs_write_end(), so let's drop that too. Reported-by: ChenXiaoSong Fixes: ce368536dd61 ("nfs: nfs_file_write() should check for writeback errors") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 9641d9bc9b75f11f70646f5c6ee9f5f519a1012e Author: Trond Myklebust Date: Sat May 14 10:27:01 2022 -0400 NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS If the commit to disk is interrupted, we should still first check for filesystem errors so that we can report them in preference to the error due to the signal. Fixes: 2197e9b06c22 ("NFS: Fix up fsync() when the server rebooted") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit cea9ba7239dcc84175041174304c6cdeae3226e5 Author: Trond Myklebust Date: Sat May 14 10:27:00 2022 -0400 NFS: Do not report EINTR/ERESTARTSYS as mapping errors If the attempt to flush data was interrupted due to a local signal, then just requeue the writes back for I/O. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1b11063d32d7e11366e48be64215ff517ce32217 Author: Daniel Latypov Date: Fri May 13 11:37:07 2022 -0700 kunit: fix executor OOM error handling logic on non-UML The existing logic happens to work fine on UML, but is not correct when running on other arches. 1. We didn't initialize `int err`, and kunit_filter_suites() doesn't explicitly set it to 0 on success. So we had false "failures". Note: it doesn't happen on UML, causing this to get overlooked. 2. If we error out, we do not call kunit_handle_shutdown(). This makes kunit.py timeout when using a non-UML arch, since the QEMU process doesn't ever exit. Fixes: a02353f49162 ("kunit: bail out of test filtering logic quicker if OOM") Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit a5b8e4a5ceec0ab6453176bc7f5eceafa78bf8a9 Merge: b11b3d21a94d6 68d6c8476fd4f Author: Mark Brown Date: Tue May 17 16:59:05 2022 +0100 Merge remote-tracking branch 'regulator/for-5.19' into regulator-next commit 6c459b78d4793afbba6d864c466cc5cd2932459d Author: Chao Yu Date: Tue May 17 18:41:03 2022 +0800 erofs: support idmapped mounts This patch enables idmapped mounts for erofs, since all dedicated helpers for this functionality existsm, so, in this patch we just pass down the user_namespace argument from the VFS methods to the relevant helpers. Simple idmap example on erofs image: 1. mkdir dir 2. touch dir/file 3. mkfs.erofs erofs.img dir 4. mount -t erofs -o loop erofs.img /mnt/erofs/ 5. ls -ln /mnt/erofs/ total 0 -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file 6. mount-idmapped --map-mount b:1000:1001:1 /mnt/erofs/ /mnt/scratch_erofs/ 7. ls -ln /mnt/scratch_erofs/ total 0 -rw-rw-r-- 1 1001 1001 0 May 17 15:26 file Reviewed-by: Christian Brauner (Microsoft) Reviewed-by: Gao Xiang Signed-off-by: Chao Yu Link: https://lore.kernel.org/r/20220517104103.3570721-1-chao@kernel.org Signed-off-by: Gao Xiang commit 3e917cc305c6df350af5ad5c40d56e3e48b42281 Author: Hongnan Li Date: Mon Apr 25 12:07:12 2022 +0800 erofs: make filesystem exportable Implement export operations in order to make EROFS support accessing inodes with filehandles so that it can be exported via NFS and used by overlayfs. Without this patch, 'exportfs -rv' will report: exportfs: /root/erofs_mp does not support NFS export Also tested with unionmount-testsuite and the testcase below passes now: ./run --ov --erofs --verify hard-link For more details about the testcase, see: https://github.com/amir73il/unionmount-testsuite/pull/6 Signed-off-by: Hongnan Li Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220425040712.91685-1-hongnan.li@linux.alibaba.com Signed-off-by: Gao Xiang commit 2edb9863e12566259503b2695d1c252c775b0ee7 Author: YueHaibing Date: Sat May 14 16:04:33 2022 +0800 EDAC/i5100: Remove unused inline function i5100_nrecmema_dm_buf_id() Commit a4972b1b9a04 ("edac: i5100_edac: Remove unused i5100_recmema_dm_buf_id") left this function unused. Remove it. Signed-off-by: YueHaibing Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220514080433.29944-1-yuehaibing@huawei.com commit dcbe6803fffd387f72b48c2373b5f5ed12a5804b Author: Gao Xiang Date: Thu May 12 19:58:33 2022 +0800 erofs: fix buffer copy overflow of ztailpacking feature I got some KASAN report as below: [ 46.959738] ================================================================== [ 46.960430] BUG: KASAN: use-after-free in z_erofs_shifted_transform+0x2bd/0x370 [ 46.960430] Read of size 4074 at addr ffff8880300c2f8e by task fssum/188 ... [ 46.960430] Call Trace: [ 46.960430] [ 46.960430] dump_stack_lvl+0x41/0x5e [ 46.960430] print_report.cold+0xb2/0x6b7 [ 46.960430] ? z_erofs_shifted_transform+0x2bd/0x370 [ 46.960430] kasan_report+0x8a/0x140 [ 46.960430] ? z_erofs_shifted_transform+0x2bd/0x370 [ 46.960430] kasan_check_range+0x14d/0x1d0 [ 46.960430] memcpy+0x20/0x60 [ 46.960430] z_erofs_shifted_transform+0x2bd/0x370 [ 46.960430] z_erofs_decompress_pcluster+0xaae/0x1080 The root cause is that the tail pcluster won't be a complete filesystem block anymore. So if ztailpacking is used, the second part of an uncompressed tail pcluster may not be ``rq->pageofs_out``. Fixes: ab749badf9f4 ("erofs: support unaligned data decompression") Fixes: cecf864d3d76 ("erofs: support inline data decompression") Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220512115833.24175-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang commit 2833f4bb46f418678297ec7c535a164aa631d4c4 Author: Gao Xiang Date: Sat May 7 03:46:12 2022 +0800 erofs: refine on-disk definition comments Fix some outdated comments and typos, hopefully helpful. Link: https://lore.kernel.org/r/20220506194612.117120-3-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 1f7aa6caefce17337a5563f5bedc437dc85c5b1c Author: Gao Xiang Date: Sat May 7 03:46:11 2022 +0800 erofs: remove obsoleted comments Some comments haven't been useful anymore since the code updated. Let's drop them instead. Link: https://lore.kernel.org/r/20220506194612.117120-2-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 1e59af07c7f361bbe64779ea93546f88f433b912 Author: Yue Hu Date: Thu Apr 7 13:05:43 2022 +0800 erofs: do not prompt for risk any more when using big pcluster The big pcluster feature has been merged for a year, it has been mostly stable now. Signed-off-by: Yue Hu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220407050505.12683-1-huyue2@coolpad.com Signed-off-by: Gao Xiang commit a456021c6f1482b94dce77ebaeef77412cd37dba Author: Ping-Ke Shih Date: Mon May 16 08:52:15 2022 +0800 rtw89: pci: only mask out INT indicator register for disable interrupt v1 The design of INT indicator register (R_AX_PCIE_HIMR00_V1) is to reduce IO during frequent interrupts, because it can stop chip sending interrupt to host if we just set this indicator to 0, not all IMR(s). This indicator register looks like a root interrupt controller of wifi chip. However, we can't set all other IMR(s) to 0 during we are running on interrupt service routine, or the indicator register can't reflect the status of certain interrupt happened during this period, and then miss some interrupts especially SER interrupt events. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-7-pkshih@realtek.com commit a06d2dd7e22f93f98beb15c5ae919f6a58fd2635 Author: Zong-Zhe Yang Date: Mon May 16 08:52:14 2022 +0800 rtw89: convert rtw89_band to nl80211_band precisely Before 6 GHz band was supported, i.e. only 2 GHz and 5 GHz, they were the same from the numerical point of view. However, after 6 GHz band support, we need to do this conversion logically. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-6-pkshih@realtek.com commit aebc048d100073f8f16543ed0c4eefc11b3c0b06 Author: Zong-Zhe Yang Date: Mon May 16 08:52:13 2022 +0800 rtw89: 8852c: update txpwr tables to HALRF_027_00_052 Update notes: update the following to HALRF_027_00_052 TX power by rate table TX power limit table TX power limit RU table TX shape table doesn't seem to be changed on HALRF_027_00_052 Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-5-pkshih@realtek.com commit 97df85871a5b187609d30fca6d85b912d9e02f29 Author: Ping-Ke Shih Date: Mon May 16 08:52:12 2022 +0800 rtw89: cfo: check mac_id to avoid out-of-bounds Somehow, hardware reports incorrect mac_id and pollute memory. Check index before we access the array. UBSAN: array-index-out-of-bounds in rtw89/phy.c:2517:23 index 188 is out of range for type 's32 [64]' CPU: 1 PID: 51550 Comm: irq/35-rtw89_pc Tainted: G OE Call Trace: show_stack+0x52/0x58 dump_stack_lvl+0x4c/0x63 dump_stack+0x10/0x12 ubsan_epilogue+0x9/0x45 __ubsan_handle_out_of_bounds.cold+0x44/0x49 ? __alloc_skb+0x92/0x1d0 rtw89_phy_cfo_parse+0x44/0x7f [rtw89_core] rtw89_core_rx+0x261/0x871 [rtw89_core] ? __alloc_skb+0xee/0x1d0 rtw89_pci_napi_poll+0x3fa/0x4ea [rtw89_pci] __napi_poll+0x33/0x1a0 net_rx_action+0x126/0x260 ? __queue_work+0x217/0x4c0 __do_softirq+0xd9/0x315 ? disable_irq_nosync+0x10/0x10 do_softirq.part.0+0x6d/0x90 __local_bh_enable_ip+0x62/0x70 rtw89_pci_interrupt_threadfn+0x182/0x1a6 [rtw89_pci] irq_thread_fn+0x28/0x60 irq_thread+0xc8/0x190 ? irq_thread_fn+0x60/0x60 kthread+0x16b/0x190 ? irq_thread_check_affinity+0xe0/0xe0 ? set_kthread_struct+0x50/0x50 ret_from_fork+0x22/0x30 Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-4-pkshih@realtek.com commit d3efeee240f8dce123eb8569dc953f6cb3af3f17 Author: Ping-Ke Shih Date: Mon May 16 08:52:11 2022 +0800 rtw89: 8852c: set TX antenna path To make user space can set TX antenna via iw command. Then, we can diagnose antenna is connected properly or not, and measure TX power in single path. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-3-pkshih@realtek.com commit 9d9a9edcf8edab4a151b7d4bad8cfa68e8d675ff Author: Ping-Ke Shih Date: Mon May 16 08:52:10 2022 +0800 rtw89: add ieee80211::sta_rc_update ops When peer's NSS, rate or bandwidth is changed, we update RA(rate adaptive) mask to ensure transmitting packets properly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220516005215.5878-2-pkshih@realtek.com commit 8762246c7b232d280b545b0acc97d75a9c518db2 Author: Srinivasan R Date: Fri May 13 19:42:20 2022 +0100 wireless: Fix Makefile to be in alphabetical order Fix quantenna to be in the right order Signed-off-by: Srinivasan R Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/MA1PR01MB26992E104B006B340C3C3A84C1CA9@MA1PR01MB2699.INDPRD01.PROD.OUTLOOK.COM commit 821cb05f6b4b024847624de0d0e5765c7b09b947 Author: Codrin Ciubotariu Date: Mon Mar 7 14:22:01 2022 +0200 ARM: dts: at91: sama7g5ek: add node for PDMC0 SAMA7G5-EK has 4 PDM microphones connected to PDMC0. PDMC0 pinmux is in conflict with gmac1, gmac1 being enabled by default. Signed-off-by: Codrin Ciubotariu Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/all/20220307122202.2251639-6-codrin.ciubotariu@microchip.com Signed-off-by: Nicolas Ferre commit 0c91107be3aba0de82fedc0298273b70d28e4cbc Author: Codrin Ciubotariu Date: Mon Mar 7 14:22:00 2022 +0200 ARM: dts: at91: sama7g5: add nodes for PDMC Microchip's SAMA7G5 embeds two PDMCs. The PDMCs can be used to connect 2x4 PDM microphones. Signed-off-by: Codrin Ciubotariu Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/all/20220307122202.2251639-5-codrin.ciubotariu@microchip.com Signed-off-by: Nicolas Ferre commit 6a743ea387e639aaee7202e56c94bee8969009b9 Author: Sergiu Moga Date: Fri Mar 4 18:11:57 2022 +0200 ARM: dts: at91: Use the generic "rtc" node name for the rtt IPs As the DT specification recommends, the node names should be of a generic nature. Thus, the most appropriate generic node name for the at91 rtt IPs is the "rtc" node name. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/all/20220304161159.147784-3-sergiu.moga@microchip.com Signed-off-by: Nicolas Ferre commit 52e0d230865b3e3b2d1484c3362eaee36e48bf46 Author: Sergiu Moga Date: Fri Mar 4 18:11:56 2022 +0200 ARM: dts: at91: Add the required 'atmel, rtt-rtc-time-reg' property Add the required 'atmel,rtt-rtc-time-reg' property to the "rtt" nodes of the board files that were missing it. Signed-off-by: Sergiu Moga Reviewed-by: Tudor Ambarus Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/all/20220304161159.147784-2-sergiu.moga@microchip.com Signed-off-by: Nicolas Ferre commit 6a973e291978bfd1ff8bb3184e337309acc16d69 Author: Ian Rogers Date: Mon May 16 22:27:24 2022 -0700 perf test: Add basic stat and topdown group test Add a basic stat test. Add two tests of grouping behavior for topdown events. Topdown events are special as they must be grouped with the slots event first. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220517052724.283874-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d98079c05b5a5411c6030c47b6256cbeeeff77d0 Author: Ian Rogers Date: Mon May 16 22:27:23 2022 -0700 perf evlist: Keep topdown counters in weak group On Intel Icelake, topdown events must always be grouped with a slots event as leader. When a metric is parsed a weak group is formed and retried if perf_event_open fails. The retried events aren't grouped breaking the slots leader requirement. This change modifies the weak group "reset" behavior so that topdown events aren't broken from the group for the retry. $ perf stat -e '{slots,topdown-bad-spec,topdown-be-bound,topdown-fe-bound,topdown-retiring,branch-instructions,branch-misses,bus-cycles,cache-misses,cache-references,cpu-cycles,instructions,mem-loads,mem-stores,ref-cycles,baclears.any,ARITH.DIVIDER_ACTIVE}:W' -a sleep 1 Performance counter stats for 'system wide': 47,867,188,483 slots (92.27%) topdown-bad-spec topdown-be-bound topdown-fe-bound topdown-retiring 2,173,346,937 branch-instructions (92.27%) 10,540,253 branch-misses # 0.48% of all branches (92.29%) 96,291,140 bus-cycles (92.29%) 6,214,202 cache-misses # 20.120 % of all cache refs (92.29%) 30,886,082 cache-references (76.91%) 11,773,726,641 cpu-cycles (84.62%) 11,807,585,307 instructions # 1.00 insn per cycle (92.31%) 0 mem-loads (92.32%) 2,212,928,573 mem-stores (84.69%) 10,024,403,118 ref-cycles (92.35%) 16,232,978 baclears.any (92.35%) 23,832,633 ARITH.DIVIDER_ACTIVE (84.59%) 0.981070734 seconds time elapsed After: $ perf stat -e '{slots,topdown-bad-spec,topdown-be-bound,topdown-fe-bound,topdown-retiring,branch-instructions,branch-misses,bus-cycles,cache-misses,cache-references,cpu-cycles,instructions,mem-loads,mem-stores,ref-cycles,baclears.any,ARITH.DIVIDER_ACTIVE}:W' -a sleep 1 Performance counter stats for 'system wide': 31040189283 slots (92.27%) 8997514811 topdown-bad-spec # 28.2% bad speculation (92.27%) 10997536028 topdown-be-bound # 34.5% backend bound (92.27%) 4778060526 topdown-fe-bound # 15.0% frontend bound (92.27%) 7086628768 topdown-retiring # 22.2% retiring (92.27%) 1417611942 branch-instructions (92.26%) 5285529 branch-misses # 0.37% of all branches (92.28%) 62922469 bus-cycles (92.29%) 1440708 cache-misses # 8.292 % of all cache refs (92.30%) 17374098 cache-references (76.94%) 8040889520 cpu-cycles (84.63%) 7709992319 instructions # 0.96 insn per cycle (92.32%) 0 mem-loads (92.32%) 1515669558 mem-stores (84.68%) 6542411177 ref-cycles (92.35%) 4154149 baclears.any (92.35%) 20556152 ARITH.DIVIDER_ACTIVE (84.59%) 1.010799593 seconds time elapsed Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220517052724.283874-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 75659c6fb5afdbcdbcac9a852031e20377b51a7a Author: Adrian Hunter Date: Mon May 9 18:24:00 2022 +0300 perf scripts python: intel-pt-events.py: Print ptwrite value as a string if it is ASCII It can be convenient to put a string value into a ptwrite payload as a quick and easy way to identify what is being printed. To make that useful, if the Intel ptwrite payload value contains only printable ASCII characters padded with NULLs, then print it also as a string. Using the example program from the "Emulated PTWRITE" section of tools/perf/Documentation/perf-intel-pt.txt: $ echo -n "Hello" | od -t x8 0000000 0000006f6c6c6548 0000005 $ perf record -e intel_pt//u ./eg_ptw 0x0000006f6c6c6548 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.016 MB perf.data ] $ perf script --itrace=ew intel-pt-events.py Intel PT Branch Trace, Power Events, Event Trace and PTWRITE Switch In 38524/38524 [001] 24166.044995916 0/0 eg_ptw 38524/38524 [001] 24166.045380004 ptwrite jmp IP: 0 payload: 0x6f6c6c6548 Hello 56532c7ce196 perf_emulate_ptwrite+0x16 (/home/ahunter/git/work/eg_ptw) End Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220509152400.376613-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a5014310f7a9b6486daa8e8852e3d1f2ba323328 Author: Adrian Hunter Date: Mon May 9 18:23:59 2022 +0300 perf script: Print Intel ptwrite value as a string if it is ASCII It can be convenient to put a string value into a ptwrite payload as a quick and easy way to identify what is being printed. To make that useful, if the Intel ptwrite payload value contains only printable ASCII characters padded with NULLs, then print it also as a string. Using the example program from the "Emulated PTWRITE" section of tools/perf/Documentation/perf-intel-pt.txt: $ echo -n "Hello" | od -t x8 0000000 0000006f6c6c6548 0000005 $ perf record -e intel_pt//u ./eg_ptw 0x0000006f6c6c6548 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.016 MB perf.data ] $ perf script --itrace=ew eg_ptw 35563 [005] 18256.087338: ptwrite: IP: 0 payload: 0x6f6c6c6548 Hello 55e764db5196 perf_emulate_ptwrite+0x16 (/home/user/eg_ptw) $ Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220509152400.376613-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d7015e50a9ed180dcc3947635bb2b5711c37f48b Author: Adrian Hunter Date: Mon May 9 18:23:58 2022 +0300 perf intel-pt: Add support for emulated ptwrite ptwrite is an Intel x86 instruction that writes arbitrary values into an Intel PT trace. It is not supported on all hardware, so provide an alternative that makes use of TNT packets to convey the payload data. TNT packets encode Taken/Not-taken conditional branch information, so taking branches based on the payload value will encode the value into the TNT packet. Refer to the changes to the documentation file perf-intel-pt.txt in this patch for an example. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220509152400.376613-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 46a65cd376f9f754149be33b32244cabcf376982 Author: YueHaibing Date: Tue May 17 11:16:06 2022 +0800 ARM: at91: pm: Fix rand build error If ATMEL_PM is y but PM is n, build fails: arch/arm/mach-at91/pm.c:1435:13: error: redefinition of 'at91rm9200_pm_init' void __init at91rm9200_pm_init(void) ^~~~~~~~~~~~~~~~~~ In file included from arch/arm/mach-at91/pm.c:29:0: arch/arm/mach-at91/generic.h:19:27: note: previous definition of 'at91rm9200_pm_init' was here static inline void __init at91rm9200_pm_init(void) { } ^~~~~~~~~~~~~~~~~~ ATMEL_PM should not be enabled independently, it is only selected by Soc. Fixes: f2f5cf78a333 ("ARM: at91: pm: add support for sama5d2 secure suspend") Signed-off-by: YueHaibing Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220517031606.11628-1-yuehaibing@huawei.com Signed-off-by: Nicolas Ferre commit 8218827b73c6e41029438a2d3cc573286beee914 Author: Heiko Carstens Date: Wed May 11 14:05:32 2022 +0200 scripts/min-tool-version.sh: raise minimum clang version to 14.0.0 for s390 Before version 14.0.0 llvm's integrated assembler fails to handle some displacement variants: arch/s390/purgatory/head.S:108:10: error: invalid operand for instruction lg %r11,kernel_type-.base_crash(%r13) Instead of working around this and given that this is already fixed raise the minimum clang version from 13.0.0 to 14.0.0. Acked-by: Nick Desaulniers Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://reviews.llvm.org/D113341 Link: https://lore.kernel.org/r/20220511120532.2228616-9-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit bb31074db95f735004203b307e63e2e0d4ef9c26 Author: Heiko Carstens Date: Wed May 11 14:05:31 2022 +0200 s390/boot: do not emit debug info for assembly with llvm's IAS Commit ee6d777d3e93 ("s390/decompressor: support extra debug flags") added extra debug flags, in particular debug info is created, depending on config options. With llvm's IAS this causes this compile warning: arch/s390/boot/head.S:38:1: warning: DWARF2 only supports one section per compilation unit .section ".head.text","ax" ^ This is a known problem and was addressed with commit b8a9092330da ("Kbuild: do not emit debug info for assembly with LLVM_IAS=1"). Just do the same for s390 to get rid of this warning. Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220511120532.2228616-8-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit e9953b729b789c0e2984859e3b2170b7fa8520d5 Author: Heiko Carstens Date: Wed May 11 14:05:30 2022 +0200 s390/boot: workaround llvm IAS bug For at least the mvc and clc instructions llvm's integrated assembler can generate incorrect code. In particular this happens with decompressor boot code. The reason seems to be that relocations for the second displacement of each instruction are at incorrect locations (-/+: gas vs llvm IAS): mvc __LC_IO_NEW_PSW(16),.Lnewpsw results in 4: d2 0f 01 f0 00 00 mvc 496(16,%r0),0 - 8: R_390_12 .head.text+0x10 + 6: R_390_12 .head.text+0x10 and clc 0(3,%r4),.L_hdr results in 258: d5 02 40 00 00 00 clc 0(3,%r4),0 - 25c: R_390_12 .head.text+0x324 + 25a: R_390_12 .head.text+0x324 Workaround this by writing the code in a different way. Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://github.com/llvm/llvm-project/issues/55411 Link: https://lore.kernel.org/r/20220511120532.2228616-7-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit adda746629b4a3950f313bc645fa0e54daee871c Author: Heiko Carstens Date: Wed May 11 14:05:29 2022 +0200 s390/purgatory: workaround llvm's IAS limitations llvm's integrated assembler cannot handle immediate values which are calculated with two local labels: arch/s390/purgatory/head.S:139:11: error: invalid operand for instruction aghi %r8,-(.base_crash-purgatory_start) Workaround this by partially rewriting the code. Link: https://lore.kernel.org/r/20220511120532.2228616-6-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit 4c25f0ff6336738fcb03216ae103c3c17908304a Author: Heiko Carstens Date: Wed May 11 14:05:27 2022 +0200 s390/entry: workaround llvm's IAS limitations llvm's integrated assembler cannot handle immediate values which are calculated with two local labels: :3:13: error: invalid operand for instruction clgfi %r14,.Lsie_done - .Lsie_gmap Workaround this by adding clang specific code which reads the specific value from memory. Since this code is within the hot paths of the kernel and adds an additional memory reference, keep the original code, and add ifdef'ed code. Acked-by: Alexander Gordeev Link: https://lore.kernel.org/r/20220511120532.2228616-5-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit e6ed91fd0768b914558dad5eeda2407a7d871f52 Author: Heiko Carstens Date: Wed May 11 14:05:26 2022 +0200 s390/alternatives: remove padding generation code clang fails to handle ".if" statements in inline assembly which are heavily used in the alternatives code. To work around this remove this code, and enforce that users of alternatives must specify original and alternative instruction sequences which have identical sizes. Add a compile time check with two ".org" statements similar to arm64. In result not only clang can handle this, but also quite a lot of code can be removed. Acked-by: Vasily Gorbik Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://github.com/ClangBuiltLinux/linux/issues/1356 Link: https://lore.kernel.org/r/20220511120532.2228616-3-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit fad442d3abde47aef97d0d822807ab6e2555784a Author: Heiko Carstens Date: Wed May 11 14:05:25 2022 +0200 s390/alternatives: provide identical sized orginal/alternative sequences Explicitly provide identical sized original/alternative instruction sequences. This way there is no need for the s390 specific alternatives infrastructure to generate padding sequences. The code which generates such sequences will be removed with a follow on patch. Acked-by: Vasily Gorbik Tested-by: Nathan Chancellor Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220511120532.2228616-2-hca@linux.ibm.com Signed-off-by: Heiko Carstens commit e0d3f7cb26063898a14fee2fea7d38fc8ceeb89a Author: Armin Wolf Date: Sun Apr 10 18:39:35 2022 +0200 hwmon: (dell-smm) Add cooling device support Until now, only the temperature sensors where exported thru the thermal subsystem. Export the fans as "dell-smm-fan[1-3]" too to make them available as cooling devices. Also update Documentation and fix a minor issue with the alphabetic ordering of the includes. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220410163935.7840-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit d7cc063ff09b86daaeca691b254cea9526a9a5f7 Author: Eugene Shalygin Date: Fri Apr 22 13:17:37 2022 +0200 hwmon: (asus-ec-sensors) add ProArt X570 Creator WIFI board Basing on information and testing provided by users [1] add support for another board, ASUS ProArt X570 Creator WiFi. [1] https://github.com/zeule/asus-ec-sensors/issues/17 Signed-off-by: Eugene Shalygin Link: https://lore.kernel.org/r/20220422111737.1352610-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck commit 340b3b6aa47ae13e1d46ecb5e03ec2c260603f63 Author: Michael Walle Date: Tue Apr 5 11:24:52 2022 +0200 hwmon: (intel-m10-bmc-hwmon) use devm_hwmon_sanitize_name() Instead of open-coding the bad characters replacement in the hwmon name, use the new devm_hwmon_sanitize_name(). Signed-off-by: Michael Walle Acked-by: Xu Yilun Reviewed-by: Tom Rix Link: https://lore.kernel.org/r/20220405092452.4033674-3-michael@walle.cc Signed-off-by: Guenter Roeck commit 1ad6c3b7ef132e1d8c5d606008069724625c8daf Author: Michael Walle Date: Tue Apr 5 11:24:51 2022 +0200 hwmon: introduce hwmon_sanitize_name() More and more drivers will check for bad characters in the hwmon name and all are using the same code snippet. Consolidate that code by adding a new hwmon_sanitize_name() function. Signed-off-by: Michael Walle Reviewed-by: Tom Rix Link: https://lore.kernel.org/r/20220405092452.4033674-2-michael@walle.cc Signed-off-by: Guenter Roeck commit 752b927951eaa6297bffc12efe603df10496566e Author: Aleksa Savic Date: Mon Apr 4 15:42:11 2022 +0200 hwmon: (aquacomputer_d5next) Add support for Aquacomputer Octo Extend aquacomputer_d5next driver to expose hardware temperature sensors and fans of the Aquacomputer Octo fan controller, which communicates through a proprietary USB HID protocol. Four temperature sensors and eight PWM controllable fans are available. Additionally, serial number, firmware version and power-on count are exposed through debugfs. This driver has been tested on x86_64. Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20220404134212.9690-1-savicaleksa83@gmail.com [groeck: Add missing "select CRC16"] Signed-off-by: Guenter Roeck commit c0c45238fcf44b05c86f2f7d1dda136df7a83ff9 Author: Christophe JAILLET Date: Sun Feb 13 20:48:53 2022 +0100 hwmon: (peci) Use devm_delayed_work_autocancel() to simplify code Use devm_delayed_work_autocancel() instead of hand writing it. This is less verbose and saves a few lines of code. devm_delayed_work_autocancel() uses devm_add_action() instead of devm_add_action_or_reset(). This is fine, because if the underlying memory allocation fails, no work has been scheduled yet. So there is nothing to undo. Signed-off-by: Christophe JAILLET Reviewed-by: Iwona Winiarska Link: https://lore.kernel.org/r/fd277a708ede3882d7df6831f02d2e3c0cb813b8.1644781718.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck commit ab9ac6df22527b22fcceb6a16f5035ee778c9688 Author: Wei Shuyu Date: Sat Mar 26 18:24:05 2022 +0800 hwmon: (asus-ec-sensors) Add T_Sensor for ASUS WS X570-ACE WS X570-ACE has a T_Sensor header on board according to manual[1]. I'm using a 10kΩ B=3435K thermsistor attached to the header of WS X570-ACE. EC byte at 0x3d matches readings from BIOS sensor page and environment temperature. [1]https://www.asus.com/Motherboards-Components/Motherboards/All-series/Pro-WS-X570-ACE/HelpDesk_Manual/ Signed-off-by: Wei Shuyu Link: https://lore.kernel.org/r/E1nY43Q-000rAm-9a@dogben.com Signed-off-by: Guenter Roeck commit 032c1623c9de51705d0a1c577ffdae746967e88d Author: Eduardo Valentin Date: Fri Mar 18 16:30:11 2022 -0700 hwmon: (jc42) add HWMON_C_TZ_REGISTER Add a thermal zone interface to the devices added under jc42 driver. This way, thermal zones described in device tree can make use of the of nodes of these devices. Cc: Guenter Roeck (maintainer:JC42.4 TEMPERATURE SENSOR DRIVER) Cc: Jean Delvare (maintainer:HARDWARE MONITORING) Cc: linux-hwmon@vger.kernel.org (open list:JC42.4 TEMPERATURE SENSOR DRIVER) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin Signed-off-by: Eduardo Valentin Link: https://lore.kernel.org/r/20220318233011.13980-1-eduval@amazon.com Signed-off-by: Guenter Roeck commit 77c570a1ea85ba4ab135c61a028420a6e9fe77f3 Author: Fanjun Kong Date: Tue May 17 01:39:30 2022 +0800 blk-cgroup: Remove unnecessary rcu_read_lock/unlock() spin_lock_irq/spin_unlock_irq contains preempt_disable/enable(). Which can serve as RCU read-side critical region, so remove rcu_read_lock/unlock(). Signed-off-by: Fanjun Kong Reviewed-by: Muchun Song Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220516173930.159535-1-bh1scw@gmail.com Signed-off-by: Jens Axboe commit 3607849df47822151b05df440759e2dc70160755 Author: Wolfgang Bumiller Date: Tue Jan 11 09:31:59 2022 +0100 blk-cgroup: always terminate io.stat lines With the removal of seq_get_buf in blkcg_print_one_stat, we cannot make adding the newline conditional on there being relevant stats because the name was already written out unconditionally. Otherwise we may end up with multiple device names in one line which is confusing and doesn't follow the nested-keyed file format. Signed-off-by: Wolfgang Bumiller Fixes: 252c651a4c85 ("blk-cgroup: stop using seq_get_buf") Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220111083159.42340-1-w.bumiller@proxmox.com Signed-off-by: Jens Axboe commit 845517ed04aec32065febd2e2afa3902ebabaf54 Author: Minghao Chi Date: Fri May 13 08:16:47 2022 +0000 RDMA/qedr: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Link: https://lore.kernel.org/r/20220513081647.1631141-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Michal Kalderon  Signed-off-by: Jason Gunthorpe commit 65a9dedc11d615d8f104a48d38b4fa226967b4ed Author: Leszek Polak Date: Mon May 16 09:08:59 2022 +0200 net: phy: marvell: Add errata section 5.1 for Alaska PHY As per Errata Section 5.1, if EEE is intended to be used, some register writes must be done once after every hardware reset. This patch now adds the necessary register writes as listed in the Marvell errata. Without this fix we experience ethernet problems on some of our boards equipped with a new version of this ethernet PHY (different supplier). The fix applies to Marvell Alaska 88E1510/88E1518/88E1512/88E1514 Rev. A0. Signed-off-by: Leszek Polak Signed-off-by: Stefan Roese Cc: Marek Behún Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Russell King Cc: David S. Miller Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220516070859.549170-1-sr@denx.de Signed-off-by: Paolo Abeni commit d1e7f009bfff8b739599c7ff89fb794ef6d4a44d Author: Minghao Chi Date: Mon May 16 08:22:51 2022 +0000 net: qede: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220516082251.1651350-1-chi.minghao@zte.com.cn Signed-off-by: Paolo Abeni commit 0baef28460311a43327e8a5729ecd0ab662b8ab8 Author: Johannes Berg Date: Mon May 16 12:57:32 2022 +0200 mac80211: refactor freeing the next_beacon We have this code seven times, refactor it into a separate function. Signed-off-by: Johannes Berg commit bd81bfb5a1d1aa811ccb370aa5d118d0f87877bc Author: Minghao Chi Date: Mon May 16 08:19:14 2022 +0000 net: vxge: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220516081914.1651281-1-chi.minghao@zte.com.cn Signed-off-by: Paolo Abeni commit 29fd3ca1779f6997d15c6d8f1ab119128e4bab61 Author: Minghao Chi Date: Mon May 16 07:26:46 2022 +0000 qed: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220516072646.1651109-1-chi.minghao@zte.com.cn Signed-off-by: Paolo Abeni commit 37a86b32bf0e5c5ca23567d7b120306b9ac8497d Author: Yihao Han Date: Mon May 16 20:30:46 2022 -0700 ASoC: ux500: mop500: Check before clk_put() not needed clk_put() already checks the clk ptr using !clk and IS_ERR() so there is no need to check it again before calling it. Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220517033050.5191-1-hanyihao@vivo.com Signed-off-by: Mark Brown commit 68d6c8476fd4f448e70e0ab31ff972838ac41dae Author: Miaoqian Lin Date: Mon May 16 11:44:33 2022 +0400 regulator: scmi: Fix refcount leak in scmi_regulator_probe of_find_node_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 0fbeae70ee7c ("regulator: add SCMI driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516074433.32433-1-linmq006@gmail.com Signed-off-by: Mark Brown commit c5003f08fe671fb1f18bca07e589c5cffeccbc9b Author: Peter Ujfalusi Date: Mon May 16 12:24:42 2022 +0300 ASoC: SOF: ipc-msg-injector: Cap the rmaining to count in IPC4 mode If user space provides smaller buffer than the IPC4 reply then it is possible that we corrupt user space memory since the IPC4 dfs_read function is not using the count directly in copy_to_user() due to the nature of an IPC4 message. Cap the remaining counter to make sure that we are not writing too much to the user space provided buffer. Add a check also to make sure that the buffer is at least the size of the IPC4 header. Fixes: 066c67624d8c: "ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages" Reported-by: Dan Carpenter Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220516092442.17027-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c8c960c109716d96cfd1de65396fb8021eed4202 Author: Cezary Rojewski Date: Mon May 16 12:11:16 2022 +0200 ASoC: Intel: avs: APL-based platforms support Define handlers specific to cAVS 1.5+ platforms, that is, APL and similar platforms. These differ from SKL-alike ones in terms of AudioDSP firmware generation and thus the '+' suffix. Introduciton of IMR, removal of CLDMA, D0IX support and monolithic-ation of library/module code are most impactful but are not the only changes brought with this newer generation. Some generic and 1.5 operations are being re-used to reduce code size. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-16-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit b3e29075b2346564f1bef7f8e19a1a7fcbcf7ed8 Author: Cezary Rojewski Date: Mon May 16 12:11:15 2022 +0200 ASoC: Intel: avs: SKL-based platforms support Define handlers specific to cAVS 1.5 platforms, that is SKL, KBL, AML and all other variants based on this very version of AudioDSP architecture. Most are specific to SKL-alike platforms with only skl_log_buffer_offset() being exposed and used later by younger equivalents. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit cfbc100e6bbfd01a56bb83fe796318a02dc18ce4 Author: Cezary Rojewski Date: Mon May 16 12:11:14 2022 +0200 ASoC: Intel: avs: Power management To preserve power during sleep operations, handle suspend (S3), hibernation (S4) and runtime (RTD3) transitions. As flow for all of is shared, define common handlers to reduce code size. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 1affc44ea5dd554c103e0ce1e809f3aa5d942349 Author: Cezary Rojewski Date: Mon May 16 12:11:13 2022 +0200 ASoC: Intel: avs: PCI driver implementation HD-Audio bus is a PCI device. Add all functions necessary to probe such device along with its removal sequence. Behaviour implemented for all standard operations is similar to existing solutions: sound/pci/hda and sound/soc/intel/skylake. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit beed983621fbdfd291e6e3a0cdc4d10517e60af8 Author: Cezary Rojewski Date: Mon May 16 12:11:12 2022 +0200 ASoC: Intel: avs: Machine board registration AVS driver operates with granular audio card division in mind. Super-card approach (e.g.: I2S, DMIC and HDA DAIs combined) is deprecated in favour of individual cards - one per each device. This provides necessary dynamism, especially for configurations with number of codecs present and makes it easier to survive auxiliary devices failures - one card failing to probe does not prevent others from succeeding. All boards spawned by AVS are unregistered on ->remove(). This includes dummy codecs such as DMIC. As all machine boards found in sound/soc/intel/boards are irreversibly tied to 'super-card' approach, new boards are going to be introduced. This temporarily increases number of boards available under /intel directory until skylake-driver becomes deprecated and removed. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 25b552f192877bec5aea44a6b060a36f78de9675 Author: Piotr Maziarz Date: Mon May 16 12:11:11 2022 +0200 ASoC: Intel: avs: Replace link_mask usage with i2s_link_mask 'link_mask' field is intended for SoundWire, I2S should use 'i2s_link_mask' instead. Signed-off-by: Piotr Maziarz Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 69b23b3937a1a1019f3d34696897d89f2d987edf Author: Cezary Rojewski Date: Mon May 16 12:11:10 2022 +0200 ASoC: Intel: avs: Event tracing Define tracing macros for easy avs debug. These cover all IPC message types: requests, replies and notifications as well as DSP-core operations and d0ix toggling. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 335c4cbd201d4b74942ff37e6c644d56b9247df3 Author: Cezary Rojewski Date: Mon May 16 12:11:09 2022 +0200 ASoC: Intel: avs: D0ix power state support Audio DSP device supports D0 substates in form of D0ix, allowing for preserving more power even when device is still considered active (D0). When entered, certain domains which are not being currently used become power gated. Entering and leaving D0ix is a complex process and differs between firmware generations. Conditions that disallow D0i3 and require immediate D0i0 transition include but may not be limited to: IPC traffic, firmware tracing and SRAM I/O. To make D0ix toggling sane, delay D0i3 transition and refresh the timer each time an IPC is requested. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 4b86115cb91a3d34ce7da87b734572ce6063babc Author: Cezary Rojewski Date: Mon May 16 12:11:08 2022 +0200 ASoC: Intel: avs: Prepare for firmware tracing Firmware provides its own debug functionality. While coredump is one of these, traces are the main area of interest. kfifo is enlisted to cache log data that is being pumped to driver through SRAM. Separate DSP operations are declared as actual feature implementation differs between firmware generations. As log gathering involves usage of IPCs, add all necessary: ENABLE_LOGS and SYSTEM_TIME. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 2f1f570cd730c81807ae143a83766068dd82d577 Author: Cezary Rojewski Date: Mon May 16 12:11:07 2022 +0200 ASoC: Intel: avs: Coredump and recovery flow In rare occasions, under stress conditions or hardware malfunction, DSP firmware may fail. Software is notified about such situation with EXCEPTION_CAUGHT notification. IPC timeout is also counted as critical device failure. More often than not, driver can recover from such situations by performing full reset: killing and restarting ADSP. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit d070002a20fc071c6f14c2fd8ff5ebeabead8d2a Author: Cezary Rojewski Date: Mon May 16 12:11:06 2022 +0200 ASoC: Intel: avs: HDA PCM BE operations HDA streaming in DSP world means enlisting HDAudio links as BE interfaces. Another difference when compared to its DMIC and I2S friends is lack of NHLT blob usage - no additional hardware configuration is needed. Similarly to I2S component, HDA populates its DAIs dynamically, here by the means of codec->pcm_list_head. Allows for cutting the number of soc components required to support the interface. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit b9062f9867f0e601c64e973e2eecda37ccac2ee8 Author: Cezary Rojewski Date: Mon May 16 12:11:05 2022 +0200 ASoC: Intel: avs: non-HDA PCM BE operations DMIC and I2S interfaces differ in DMA operations from the HDAudio interface. With that in mind, implement all DAI operations to handle non-HDA BE interfaces. To prevent code duplication in newly added code, I2S platform registering is dynamic - makes use of specified port_mask and TDMs array to populate as many DAIs as required. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 9114700b496c6ce16ad6fc0073f0502cd0f46991 Author: Cezary Rojewski Date: Mon May 16 12:11:04 2022 +0200 ASoC: Intel: avs: Generic PCM FE operations Each stream in AVS is represented by FE and BE domain. FE path stands for HOST part of the stream while BE stands for LINK (hardware) one. While BE portion is interface specific, FE is not. Handle all standard DAI operations to implement FE part of the stream. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit f1b3b320bd6519b16e3480f74f2926d106e3bcba Author: Cezary Rojewski Date: Mon May 16 12:11:03 2022 +0200 ASoC: Intel: avs: Generic soc component driver Prepare for concrete PCM operations over HDA, DMIC and I2S interfaces by providing generic soc component implementation. Interface-specific components re-use this code as majority of flow is shared. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 81a299105d69344233e6aed8565522da9beec99e Author: Cezary Rojewski Date: Mon May 16 12:11:02 2022 +0200 ASoC: Intel: avs: Account for libraries when booting basefw Not all modules are part of base firmware. Some are part of loadable libraries. These need to be loaded after base firmware reports ready status through FW_READY notification. Their loading process is similar to the base firmware's one. Request the binary file, verify and strip the manifest and load the actual code into DSP memory with help of CLDMA or HD-Audio render stream, depending on audio device generation. List of libraries needed for loading is obtained through the topology - vendor sections specifying the name of firmware files to request. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220516101116.190192-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 0621210ab7693e6d50585ca689d95d57df617455 Author: Colin Ian King Date: Mon May 16 19:42:15 2022 +0100 x86/sev: Remove duplicated assignment to variable info Variable info is being assigned the same value twice, remove the redundant assignment. Also assign variable v in the declaration. Cleans up clang scan warning: warning: Value stored to 'info' during its initialization is never read [deadcode.DeadStores] No code changed: # arch/x86/kernel/sev.o: text data bss dec hex filename 19878 4487 4112 28477 6f3d sev.o.before 19878 4487 4112 28477 6f3d sev.o.after md5: bfbaa515af818615fd01fea91e7eba1b sev.o.before.asm bfbaa515af818615fd01fea91e7eba1b sev.o.after.asm [ bp: Running the before/after check on sev.c because sev-shared.c gets included into it. ] Fixes: 597cfe48212a ("x86/boot/compressed/64: Setup a GHCB-based VC Exception handler") Signed-off-by: Colin Ian King Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220516184215.51841-1-colin.i.king@gmail.com commit ee0e2f51e2115c2578d40e5a8ac33737984fe477 Author: Johannes Berg Date: Tue May 17 12:43:46 2022 +0200 cfg80211: fix kernel-doc for cfg80211_beacon_data The kernel-doc comment is formatted badly, resulting in a warning: include/net/cfg80211.h:1188: warning: bad line: [...] Fix that. Reported-by: Stephen Rothwell Signed-off-by: Johannes Berg commit 5cc5f19f884a75f0bf96b95b4292fcc81effd755 Author: Max Filippov Date: Fri May 13 08:11:14 2022 -0700 xtensa: improve call0 ABI probing When call0 userspace ABI support by probing is enabled instructions that cause illegal instruction exception when PS.WOE is clear are retried with PS.WOE set before calling c-level exception handler. Record user pc at which PS.WOE was set in the fast exception handler and clear PS.WOE in the c-level exception handler if we get there from the same address. Signed-off-by: Max Filippov commit d74862007e0849fad8ba86447e6f05928f920640 Author: Max Filippov Date: Fri May 13 08:11:14 2022 -0700 xtensa: support artificial division by 0 exception On xtensa cores wihout hardware division option division support functions from libgcc react to division by 0 attempt by executing illegal instruction followed by the characters 'DIV0'. Recognize this pattern in illegal instruction exception handler and convert it to division by 0. Signed-off-by: Max Filippov commit a968c799eb1da3e27fc107cfdc228bf87ff27e22 Author: Lu Wei Date: Mon May 16 14:28:04 2022 +0800 ax25: merge repeat codes in ax25_dev_device_down() Merge repeat codes to reduce the duplication. Signed-off-by: Lu Wei Link: https://lore.kernel.org/r/20220516062804.254742-1-luwei32@huawei.com Signed-off-by: Paolo Abeni commit 492449ae4f0ad96948c3e029ca00736a7f1b3d77 Merge: 61299e1838b70 614ab80c96474 Author: Marc Zyngier Date: Tue May 17 10:37:06 2022 +0100 Merge branch irq/gic-v3-nmi-fixes-5.19 into irq/irqchip-next * irq/gic-v3-nmi-fixes-5.19: : . : GICv3 pseudo-NMI fixes from Mark Rutland: : : "These patches fix a couple of issues with the way GICv3 pseudo-NMIs are : handled: : : * The first patch adds a barrier we missed from NMI handling due to an : oversight. : : * The second patch refactors some logic around reads from ICC_IAR1_EL1 : and adds commentary to explain what's going on. : : * The third patch descends into madness, reworking gic_handle_irq() to : consistently manage ICC_PMR_EL1 + DAIF and avoid cases where these can : be left in an inconsistent state while softirqs are processed." : . irqchip/gic-v3: Fix priority mask handling irqchip/gic-v3: Refactor ISB + EOIR at ack time irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling Signed-off-by: Marc Zyngier commit 61299e1838b70045ab3ddd9c439a3f3966c9f52a Merge: a6ad8551b8613 d421fd6d1fbf0 Author: Marc Zyngier Date: Tue May 17 10:36:56 2022 +0100 Merge branch irq/misc-5.19 into irq/irqchip-next * irq/misc-5.19: : . : Misc fixes and minor improvements: : : - GIC: Improve warning when the firmware tables are inconsistent : : - csky: Use true/false as boolean litterals : : - imx-irqsteer: Add runtime PM support : : - armada-370-xp: Enable CPU affinity for MSIs, avoid messing with : PMU interrupts on some variants : : - aspeed: Fix handling of irq_of_parse_and_map() errors : : - sun6i: Fix sparse warnings : : - xtensa-mx: Fix initial IRQ affinity in non-SMP setup : : - exiu: Fix acknowledgment of edge-triggered interrupts : : - sunxi: Generalise configuration for further reuse : . irqchip: Add Kconfig symbols for sunxi drivers irqchip/armada-370-xp: Do not touch Performance Counter Overflow on A375, A38x, A39x irqchip/gic: Improved warning about incorrect type irqchip/csky: Return true/false (not 1/0) from bool functions irqchip/imx-irqsteer: Add runtime PM support irqchip/imx-irqsteer: Constify irq_chip struct irqchip/armada-370-xp: Enable MSI affinity configuration irqchip/aspeed-scu-ic: Fix irq_of_parse_and_map() return value irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value irqchip/sun6i-r: Use NULL for chip_data irqchip/xtensa-mx: Fix initial IRQ affinity in non-SMP setup irqchip/exiu: Fix acknowledgment of edge triggered interrupts Signed-off-by: Marc Zyngier commit 26984d9d581e5049bd75091d2e789b9cc3ea12e0 Author: Chanwoo Choi Date: Wed Apr 27 03:49:19 2022 +0900 PM / devfreq: passive: Keep cpufreq_policy for possible cpus The passive governor requires the cpu data to get the next target frequency of devfreq device if depending on cpu. In order to reduce the unnecessary memory data, keep cpufreq_policy data for possible cpus instead of NR_CPU. Tested-by: Chen-Yu Tsai Tested-by: Johnson Wang Signed-off-by: Chanwoo Choi commit 05723e71234b60a1a47313ea1a889797ec648f1c Author: Chanwoo Choi Date: Tue Mar 2 17:22:50 2021 +0900 PM / devfreq: passive: Reduce duplicate code when passive_devfreq case In order to keep the consistent coding style between passive_devfreq and passive_cpufreq, use common code for handling required opp property. Also remove the unneed conditional statement and unify the comment of both passive_devfreq and passive_cpufreq when getting the target frequency. Tested-by: Chen-Yu Tsai Tested-by: Johnson Wang Signed-off-by: Chanwoo Choi commit a03dacb0316f74400846aaf144d6c73f4217ca08 Author: Saravana Kannan Date: Tue Mar 2 15:58:21 2021 +0900 PM / devfreq: Add cpu based scaling support to passive governor Many CPU architectures have caches that can scale independent of the CPUs. Frequency scaling of the caches is necessary to make sure that the cache is not a performance bottleneck that leads to poor performance and power. The same idea applies for RAM/DDR. To achieve this, this patch adds support for cpu based scaling to the passive governor. This is accomplished by taking the current frequency of each CPU frequency domain and then adjust the frequency of the cache (or any devfreq device) based on the frequency of the CPUs. It listens to CPU frequency transition notifiers to keep itself up to date on the current CPU frequency. To decide the frequency of the device, the governor does one of the following: * Derives the optimal devfreq device opp from required-opps property of the parent cpu opp_table. * Scales the device frequency in proportion to the CPU frequency. So, if the CPUs are running at their max frequency, the device runs at its max frequency. If the CPUs are running at their min frequency, the device runs at its min frequency. It is interpolated for frequencies in between. Tested-by: Chen-Yu Tsai Tested-by: Johnson Wang Signed-off-by: Saravana Kannan [Sibi: Integrated cpu-freqmap governor into passive_governor] Signed-off-by: Sibi Sankar [Chanwoo: Fix conflict with latest code and cleanup code] Signed-off-by: Chanwoo Choi commit 713472e53e6e53c985e283782b0fd76b8ecfd47e Author: Chanwoo Choi Date: Mon Mar 1 02:07:29 2021 +0900 PM / devfreq: Export devfreq_get_freq_range symbol within devfreq In order to get frequency range within devfreq governors, export devfreq_get_freq_range symbol within devfreq. Reviewed-by: Matthias Kaehlcke Tested-by: Chen-Yu Tsai Tested-by: Johnson Wang Signed-off-by: Chanwoo Choi commit bcdcf2c466d30d69be822420bdb3f880651b2e55 Author: Lu Wei Date: Mon May 16 11:33:43 2022 +0800 net/mlxbf_gige: use eth_zero_addr() to clear mac address Use eth_zero_addr() to clear mac address instead of memset(). Signed-off-by: Lu Wei Link: https://lore.kernel.org/r/20220516033343.329178-1-luwei32@huawei.com Signed-off-by: Paolo Abeni commit 82806744fd7dde603b64c151eeddaa4ee62193fd Author: Tianyu Lan Date: Tue May 10 10:21:09 2022 -0400 swiotlb: max mapping size takes min align mask into account swiotlb_find_slots() skips slots according to io tlb aligned mask calculated from min aligned mask and original physical address offset. This affects max mapping size. The mapping size can't achieve the IO_TLB_SEGSIZE * IO_TLB_SIZE when original offset is non-zero. This will cause system boot up failure in Hyper-V Isolation VM where swiotlb force is enabled. Scsi layer use return value of dma_max_mapping_size() to set max segment size and it finally calls swiotlb_max_mapping_size(). Hyper-V storage driver sets min align mask to 4k - 1. Scsi layer may pass 256k length of request buffer with 0~4k offset and Hyper-V storage driver can't get swiotlb bounce buffer via DMA API. Swiotlb_find_slots() can't find 256k length bounce buffer with offset. Make swiotlb_max_mapping _size() take min align mask into account. Signed-off-by: Tianyu Lan Signed-off-by: Christoph Hellwig commit 1588f5a91b169b5252f5d2ccee3f0dd7c13affda Author: Bernard Zhao Date: Sun May 15 18:52:05 2022 -0700 ethernet/ti: delete if NULL check befort devm_kfree devm_kfree check the pointer, there is no need to check before devm_kfree call. This change is to cleanup the code a bit. Signed-off-by: Bernard Zhao Link: https://lore.kernel.org/r/20220516015208.6526-1-bernard@vivo.com Signed-off-by: Paolo Abeni commit d421fd6d1fbf00b6481d836e65bad07d6bad61ed Author: Samuel Holland Date: Sun May 8 22:49:41 2022 -0500 irqchip: Add Kconfig symbols for sunxi drivers Not all of these drivers are needed on every ARCH_SUNXI platform. In particular, the ARCH_SUNXI symbol will be reused for the Allwinner D1, a RISC-V SoC which contains none of these irqchips. Introduce Kconfig symbols so we can select only the drivers actually used by a particular set of platforms. This also lets us move the irqchip driver dependencies to a more appropriate location. Signed-off-by: Samuel Holland Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220509034941.30704-1-samuel@sholland.org commit 9b59588d8be91c96bfb0371e912ceb4f16315dbf Author: Miaoqian Lin Date: Mon May 16 11:20:10 2022 +0400 soc: rockchip: Fix refcount leak in rockchip_grf_init of_find_matching_node_and_match returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 4c58063d4258 ("soc: rockchip: add driver handling grf setup") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516072013.19731-1-linmq006@gmail.com Signed-off-by: Heiko Stuebner commit cf7f3f4fa9e57b8e9f594823e77e6cbb0ce2b254 Author: Peng Fan Date: Sat May 7 20:54:30 2022 +0800 clk: imx8mp: fix usb_root_clk parent According to reference mannual CCGR77(usb) sources from hsio_axi, fix it. Fixes: 9c140d9926761 ("clk: imx: Add support for i.MX8MP clock driver") Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220507125430.793287-1-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 01142791b0d11f20becccd0b30ed5e8fbb3822b6 Author: Ard Biesheuvel Date: Fri Apr 29 15:13:47 2022 +0200 arm64: mm: avoid writable executable mappings in kexec/hibernate code The temporary mappings of the low-level kexec and hibernate helpers are created with both writable and executable attributes, which is not necessary here, and generally best avoided. So use read-only, executable attributes instead. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220429131347.3621090-3-ardb@kernel.org Signed-off-by: Catalin Marinas commit 6ee3cf6a209fc76d8ae51fba357a62841ec6124c Author: Ard Biesheuvel Date: Fri Apr 29 15:13:46 2022 +0200 arm64: lds: move special code sections out of kernel exec segment There are a few code sections that are emitted into the kernel's executable .text segment simply because they contain code, but are actually never executed via this mapping, so they can happily live in a region that gets mapped without executable permissions, reducing the risk of being gadgetized. Note that the kexec and hibernate region contents are always copied into a fresh page, and so there is no need to align them as long as the overall size of each is below 4 KiB. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220429131347.3621090-2-ardb@kernel.org Signed-off-by: Catalin Marinas commit 340ce50f75a6bdfe6d1850ca49ef37a8e2765dd1 Author: Nicolas Dufresne Date: Fri May 13 22:29:22 2022 +0200 media: hantro: Enable HOLD_CAPTURE_BUF for H.264 This is needed to optimize field decoding. Each field will be decoded into the same capture buffer. To be able to queue multiple buffers, we need to be able to ask the driver to hold the capture buffer. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 11442b7c937544dcb2e3525b17dc8f3425e8d9a2 Author: Nicolas Dufresne Date: Fri May 13 22:29:21 2022 +0200 media: hantro: Add H.264 field decoding support This adds the required code to support field decoding. While most of the code is derived from Rockchip and VSI reference code, the reduction of the reference list to 16 entries was found by trial and errors. The list consists of all the references with the opposite field parity. The strategy is to deduplicate the reference picture that points to the same storage (same index). The choice of opposite parity has been made to keep the other field of the current field pair in the list. This method may not be robust if a field was lost. [hverkuil: fix typos in the comment before deduplicate_reflist()] [hverkuil: document new cur_poc field] Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3630e4933d40af53f698555d88e6143dc2d140b3 Author: Jonas Karlman Date: Fri May 13 22:29:20 2022 +0200 media: hantro: h264: Make dpb entry management more robust The driver maintains stable slot locations for reference pictures. This change makes the code more robust by using the reference_ts as key and by marking all entries invalid right from the start. Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 831410700909f4e29d5af1ef26b8c59fc2d1988e Author: Nicolas Dufresne Date: Fri May 13 22:29:19 2022 +0200 media: hantro: Stop using H.264 parameter pic_num The hardware expects FrameNumWrap or long_term_frame_idx. Picture numbers are per field, and are mostly used during the memory management process, which is done in userland. This fixes two ITU conformance tests: - MR6_BT_B - MR8_BT_B Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ed7bb87d3d035db3ae7ea50a6007a7429ff216b5 Author: Nicolas Dufresne Date: Fri May 13 22:29:18 2022 +0200 media: rkvdec: Enable capture buffer holding for H264 In order to support interlaced video decoding, the driver must allow holding the capture buffer so that the second field can be decoded into it. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6f32ea37c15e4960252937f1504738ccff56e2ea Author: Nicolas Dufresne Date: Fri May 13 22:29:17 2022 +0200 media: rkvdec-h264: Add field decoding support This makes use of the new feature in the reference builder to program up to 32 references when doing field decoding. It also signals the parity (top or bottom) of the field to the hardware. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5e57a860df6cb5ee2b2502a0d4aceb23c35471c9 Author: Jonas Karlman Date: Fri May 13 22:29:16 2022 +0200 media: rkvdec: Ensure decoded resolution fit coded resolution Ensure decoded CAPTURE buffer resolution is larger or equal to the coded OUTPUT buffer resolution. Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f942d10dab5afba301fc215954f62e1761a7225a Author: Jonas Karlman Date: Fri May 13 22:29:15 2022 +0200 media: rkvdec: h264: Fix reference frame_num wrap for second field When decoding the second field in a complementary field pair the second field is sharing the same frame_num with the first field. Currently the frame_num for the first field is wrapped when it matches the field being decoded, this caused issues decoding the second field in a complementary field pair. Fix this by using inclusive comparison: 'less than or equal'. Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 77e74be83083194f949f4979a35dec9012348d3b Author: Jonas Karlman Date: Fri May 13 22:29:14 2022 +0200 media: rkvdec: h264: Validate and use pic width and height in mbs The width and height in macroblocks is currently configured based on OUTPUT buffer resolution, this works for frame pictures but can cause issues for field pictures. When frame_mbs_only_flag is 0 the height in mbs should be height of the field instead of height of frame. Validate pic_width_in_mbs_minus1 and pic_height_in_map_units_minus1 against OUTPUT buffer resolution and use these values to configure HW. The validation is happening in both try_ctrt() and start() since it is otherwise possible to trick the driver during initialization by changing the OUTPUT format after having set a valid control. [hverkuil: when -> When (first word in a comment block)] Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cf76bb4d5e74ac4211f1fa47052b30fa7dd6443f Author: Nicolas Dufresne Date: Fri May 13 22:29:13 2022 +0200 media: rkvdec: Move H264 SPS validation in rkvdec-h264 No functional change, this moves H264 specific validation into the H264 specific code. This is in preparation of improving this validation and reusing it when VIDIOC_STREAMON is called. Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a074aa4760d1dad0bd565c0f66e7250f5f219ab0 Author: Jonas Karlman Date: Fri May 13 22:29:12 2022 +0200 media: rkvdec: h264: Fix bit depth wrap in pps packet The luma and chroma bit depth fields in the pps packet are 3 bits wide. 8 is wrongly added to the bit depth values written to these 3 bit fields. Because only the 3 LSB are written, the hardware was configured correctly. Correct this by not adding 8 to the luma and chroma bit depth value. Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Jonas Karlman Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7ab889f09dfa70e8097ec1b9186fd228124112cb Author: Nicolas Dufresne Date: Fri May 13 22:29:11 2022 +0200 media: rkvdec: h264: Fix dpb_valid implementation The ref builder only provided references that are marked as valid in the dpb. Thus the current implementation of dpb_valid would always set the flag to 1. This is not representing missing frames (this is called 'non-existing' pictures in the spec). In some context, these non-existing pictures still need to occupy a slot in the reference list according to the spec. Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9998943f6dfc5d5472bfab2e38527fb6ba5e9da7 Author: Nicolas Dufresne Date: Fri May 13 22:29:10 2022 +0200 media: rkvdec: Stop overclocking the decoder While this overclock hack seems to work on some implementations (some ChromeBooks, RockPi4) it also causes instability on other implementations (notably LibreComputer Renegade, but there were more reports in the LibreELEC project, where this has been removed). While performance is indeed affected (tested with GStreamer), 4K playback still works as long as you don't operate in lock step and keep at least 1 frame ahead of time in the decode queue. After discussion with ChromeOS members, it would seem that their implementation indeed used to synchronously decode each frame, so this hack was simply compensating for their code being less efficient. In my opinion, this hack should not have been included upstream. Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1b729998633d6ad944d60c9bd9b1c48cd3bd9cf7 Author: Nicolas Dufresne Date: Fri May 13 22:29:09 2022 +0200 media: v4l2: Reorder field reflist As per spec, the field reflist requires interleaving top and bottom field in a specific way that does not fit inside the sort operation. The process consist of alternating references parity, starting with a reference of the same parity as the current picture. This processs is done twice, once for short term references and a second time for the long term references. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6cafdc8cc0da0ddffad25ca9c70bab990ab9130f Author: Nicolas Dufresne Date: Fri May 13 22:29:08 2022 +0200 media: h264: Sort p/b reflist using frame_num In the reference list builder, frame_num refers to FrameNumWrap in the spec, which is the same as the pic_num for frame decoding. The same applies for long_term_pic_num and long_term_frame_idx. Sort all type of references by frame_num so the sort can be reused for fields reflist were the sorting is done using frame_num instead. In short, pic_num is never actually used for building reference lists. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d3f756ad629b39888e4ed860762ca2f06b1b0c81 Author: Nicolas Dufresne Date: Fri May 13 22:29:07 2022 +0200 media: v4l2: Trace calculated p/b0/b1 initial reflist Add debug print statements to print the content of P & B reference lists, to verify that the ordering of the generated reference lists is correct. This is especially important for the field decoding mode, where sorting is more complex. Signed-off-by: Nicolas Dufresne Tested-by: Sebastian Fricke Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e5991e1fd90295b1eb8326a4a6c09012d6c5fc8d Author: Nicolas Dufresne Date: Fri May 13 22:29:06 2022 +0200 media: h264: Store all fields into the unordered list When the current picture is a field, store each field into the unordered_list and preserve both top and bottom picture order count. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit adc8a8d6c98a5c996aad41bf1625d87829bd76ba Author: Nicolas Dufresne Date: Fri May 13 22:29:05 2022 +0200 media: h264: Store current picture fields This information, also called picture structure, is required in field decoding mode to construct reference lists. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 26e4520509ffa4bec3d679f7cb3de9adfabef4b3 Author: Nicolas Dufresne Date: Fri May 13 22:29:04 2022 +0200 media: h264: Increase reference lists size to 32 This is to accommodate support for field decoding, which splits the top and the bottom references into the reference list. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2e2c3d6c0ef88ffac0d6b5079ee88cf8408f5f3b Author: Nicolas Dufresne Date: Fri May 13 22:29:03 2022 +0200 media: h264: Use v4l2_h264_reference for reflist In preparation for adding field decoding support, convert the byte arrays for reflist into array of struct v4l2_h264_reference. That struct will allow us to mark which field of the reference picture is being referenced. [hverkuil: top_field_order_cnt -> pic_order_count] Signed-off-by: Nicolas Dufresne Reviewed-by: Ezequiel Garcia Tested-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4d52db40c76fb2afa687feefcf765458bb2c9cae Author: Mauro Carvalho Chehab Date: Fri May 13 18:06:40 2022 +0200 media: ov7251: fix mutex lock unbalance As reported by smatch/sparse: drivers/media/i2c/ov7251.c:1381 ov7251_s_stream() warn: inconsistent returns '&ov7251->lock'. Locked on : 1381 Unlocked on: 1377 There's a lock unbalance at this routine, as it keeps the lock on certain errors. Fix it. Signed-off-by: Mauro Carvalho Chehab commit 1b598f413c7aaa2126c261c5024eeb7a7f9531e9 Author: Daniel Scally Date: Fri May 6 01:04:02 2022 +0200 media: i2c: Add vblank control to ov7251 driver Add a vblank control to the ov7251 driver. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 26066ae6b9fd66ef2ac4d4bc26cdd8b2b2ce41af Author: Daniel Scally Date: Fri May 6 01:04:01 2022 +0200 media: i2c: Add hblank control to ov7251 Add a hblank control to the ov7251 driver. This necessitates setting a default mode, for which I am simply picking the first available. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5aaef13dd5594578d4e10facab6758988713a455 Author: Daniel Scally Date: Fri May 6 01:04:00 2022 +0200 media: i2c: add ov7251_init_ctrls() V4L2 controls initialisation takes up a sizeable portion of the driver's .probe() function. To keep things neat, move it to a dedicated function. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 77ec83cdc8dd69b095096a435d38064bb031befe Author: Daniel Scally Date: Fri May 6 01:03:59 2022 +0200 media: i2c: Extend .get_selection() for ov7251 Extend the .get_selection() callback to support other values for sel->target, primarily to satisfy libcamera's requirements. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ad1ea3aa08723ac46144449d04e19b06ffbe0586 Author: Daniel Scally Date: Fri May 6 01:03:58 2022 +0200 media: ipu3-cio2: Add INT347E to cio2-bridge The OVTI7251 sensor can be found on x86 laptops with an IPU3, and so needs to be supported by the cio2-bridge. Add it to the table of supported sensors. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9e1d3012cc10e53fe0ca389d0d22d3ed68e8d63a Author: Daniel Scally Date: Fri May 6 01:03:57 2022 +0200 media: i2c: Remove .s_power() from ov7251 The .s_power() callback is deprecated, and now that we have pm_runtime functionality in the driver there's no further use for it. Delete the function. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 207f4162f1c9e1c513a16e12847c94f591d9de54 Author: Daniel Scally Date: Fri May 6 01:03:56 2022 +0200 media: i2c: Add pm_runtime support to ov7251 Add pm_runtime support to the ov7251 driver. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e92932c3e56f10da83c555bb37aef4b1e7b8d30c Author: Daniel Scally Date: Fri May 6 01:03:55 2022 +0200 media: i2c: Add ov7251_detect_chip() .probe() is quite busy for this driver; make it cleaner by moving the chip verification to a dedicated function. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ed9566ce1946f89f016fbec0d409b69082436ad9 Author: Daniel Scally Date: Fri May 6 01:03:54 2022 +0200 media: i2c: Add support for new frequencies to ov7251 The OV7251 sensor is used as the IR camera sensor on the Microsoft Surface line of tablets; this provides a 19.2MHz external clock, and the Windows driver for this sensor configures a 319.2MHz link freq to the CSI-2 receiver. Add the ability to support those rate to the driver by defining a new set of PLL configs. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit df057b0dd99b965c93cdf4c2d032a9c9254b6118 Author: Daniel Scally Date: Fri May 6 01:03:53 2022 +0200 media: i2c: Add ov7251_pll_configure() Rather than having the pll settings hidden inside mode blobs, define them in structs and use a dedicated function to set them. This makes it simpler to extend the driver to support other frequencies for both the external clock and desired link frequency. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1757b44eb6bb298221f0dd8c8fa517ad6e19c72d Author: Daniel Scally Date: Fri May 6 01:03:52 2022 +0200 media: i2c: Remove per-mode frequencies from ov7251 Each of the defined modes in the ov7251 driver uses the same link frequency and pixel rate; just drop those members of the modes and set the controls to read only during initialisation. Add a new table defining the supported pixel rates to substitue for the values hardcoded in the modes. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit cc125aaa5a78cd88bf6728e5e02450f0ccfadb94 Author: Daniel Scally Date: Fri May 6 01:03:51 2022 +0200 media: i2c: Provide ov7251_check_hwcfg() Move the endpoint checking from .probe() to a dedicated function, and additionally check that the firmware provided link frequencies are a match for those supported by the driver. Store the index to the matching link frequency so it can be easily identified later. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6766cff6154e799460ec07150049d839de23064b Author: Daniel Scally Date: Fri May 6 01:03:50 2022 +0200 media: i2c: Add acpi support to ov7251 Add support for enumeration through ACPI to the ov7251 driver Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ffec200e6423c6d1dd2d363da182916a7dfcae5e Author: Daniel Scally Date: Fri May 6 01:03:49 2022 +0200 media: ipu3-cio2: Add support for V4L2_PIX_FMT_IPU3_Y10 We have platforms where a camera sensor transmits Y10 data to the CIO2 device - add support for that (packed) format to the ipu3-cio2 driver. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b87f5e25b2f9deb503a61c6957c7b1680d91cfea Author: Daniel Scally Date: Fri May 6 01:03:48 2022 +0200 media: uapi: Add IPU3 packed Y10 format Some platforms with an Intel IPU3 have an IR sensor producing 10 bit greyscale format data that is transmitted over a CSI-2 bus to a CIO2 device - this packs the data into 32 bytes per 25 pixels. Add an entry to the uAPI header defining that format. Signed-off-by: Daniel Scally Acked-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 92beb5559915a6a19de97e56c9600cac88a49836 Author: Moses Christopher Bollavarapu Date: Sat Apr 30 00:27:54 2022 +0200 media: i2c: ov5645: Remove unneeded of_match_ptr macro of_match_ptr isn't required as CONFIG_OF is already a dependency in Kconfig Signed-off-by: Moses Christopher Bollavarapu Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a7fed5c0431dbfa707037848830f980e0f93cfb3 Author: Thomas Gleixner Date: Sun May 15 13:39:34 2022 +0200 x86/nmi: Make register_nmi_handler() more robust register_nmi_handler() has no sanity check whether a handler has been registered already. Such an unintended double-add leads to list corruption and hard to diagnose problems during the next NMI handling. Init the list head in the static NMI action struct and check it for being empty in register_nmi_handler(). [ bp: Fixups. ] Reported-by: Sean Christopherson Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/lkml/20220511234332.3654455-1-seanjc@google.com commit ba43392e5240975fe75401747610e2d44595ea9e Author: Bingbu Cao Date: Wed Dec 29 04:15:15 2021 +0100 media: ov8856: apply digital gain by setting global gain control register MWB gain register are used to set gain for each mwb channel mannually. However, it will involve some artifacts if gain cannot be applied to each channel synchronously. Enable global gain control to set digital global gain instead of setting AWB gain separately to fix this issue. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a6dd5265c21c28d0a782befe41a97c347e78f22f Author: Yang Yingliang Date: Tue Mar 30 15:04:46 2021 +0200 media: i2c: ov5648: fix wrong pointer passed to IS_ERR() and PTR_ERR() IS_ERR() and PTR_ERR() use wrong pointer, it should be sensor->dovdd, fix it. Fixes: e43ccb0a045f ("media: i2c: Add support for the OV5648 image sensor") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1d1d8669e5ca669267e87ffc94f6d26e62fcd867 Author: Sakari Ailus Date: Wed Mar 9 18:10:06 2022 +0100 media: Documentation: mc: Add media_device_{init,cleanup} Document that drivers must first initialise a media device before registering it, and clean up once the media device is unregistered. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e74e476834f810d99261988e501d460235269158 Author: Sakari Ailus Date: Fri Apr 29 00:52:06 2022 +0200 media: Add MIPI CSI-2 28 bits per pixel raw data type Add CSI-2 data type for 28 bits per pixel data. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8429b358975f11574f747ca8ef20d524d8247682 Author: Mike Pagano Date: Wed Apr 27 23:59:23 2022 +0200 media: i2c: ov2640: Depend on V4L2_ASYNC Add V4L2_ASYNC as a dependency to match other drivers and prevent failures when compile testing. Fixes: ff3cc65cadb5 ("media: v4l: async, fwnode: Improve module organisation") Signed-off-by: Mike Pagano Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 786dc07be9e50039482de73bc48484ad9604e246 Author: Moses Christopher Bollavarapu Date: Tue Apr 19 22:20:51 2022 +0200 media: i2c: video-i2c: Use GENMASK for masking bits Replace 0x0380 with GENMASK(9, 7) to obtain 0b0000_0011_1000_0000 Signed-off-by: Moses Christopher Bollavarapu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f0de79f6b78a233b39cc90ede59d829df350d735 Author: Moses Christopher Bollavarapu Date: Tue Apr 19 22:20:50 2022 +0200 media: i2c: video-i2c: Replace constants with proper names Acc to MLX90640 datasheet: - 0x0400 represents the start of RAM address - 0x2400 represents the start of EEPROM address Reference: https://www.melexis.com/-/media/files/documents\ /datasheets/mlx90640-datasheet-melexis.pdf Signed-off-by: Moses Christopher Bollavarapu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 35fd92b28e6693548d8598917cf7c521419e290d Author: Moses Christopher Bollavarapu Date: Tue Apr 19 22:20:49 2022 +0200 media: i2c: video-i2c: Move defines to the top of the file Currently, the defines in this driver are after some structs and functions, it makes more sense to move them up to the top of the file, so that the constants can be named together with other defines. Signed-off-by: Moses Christopher Bollavarapu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e080f5c1f2b6d02c02ee5d674e0e392ccf63bbaf Author: Kwanghoon Son Date: Wed Apr 27 03:16:45 2022 +0200 media: exynos4-is: Fix compile warning Declare static on function 'fimc_isp_video_device_unregister'. When VIDEO_EXYNOS4_ISP_DMA_CAPTURE=n, compiler warns about warning: no previous prototype for function [-Wmissing-prototypes] Reported-by: kernel test robot Signed-off-by: Kwanghoon Son Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a76c86f4274e224ea8e85f284d0371442f78b13a Author: Fabio Estevam Date: Wed Apr 27 15:50:25 2022 +0200 media: i2c: adv7180: Add support for the test patterns ADV7180 has a built-in mechanism to generate some video patterns, which is very useful for debug/bring-up activities. Add support for it. The test_pattern parameter can be one of the following values: 0: "Single color" 1: "Color bars" 2: "Luma ramp" 3: "Boundary box" 4: "Disable" Tested on a imx6q board with an ADV7280. Signed-off-by: Fabio Estevam Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7a12903182c8c0e3ba61eb9c5bdf160f337686c5 Author: Tomi Valkeinen Date: Tue Apr 26 09:02:40 2022 +0200 media: ti: cal: use frame desc to get vc and dt Use get_frame_desc() to get the frame desc from the connected source, and use the provided virtual channel and datatype instead of hardcoded ones. get_frame_desc() can contain multiple streams, but as we don't support multiple streams yet, we will just always use the first stream. If the source doesn't support get_frame_desc(), fall back to the previous method of always capturing virtual channel 0 and any datatype. Signed-off-by: Tomi Valkeinen Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 897c45df291ff063d6a0acb20b3a0c276c6adf6a Author: Sakari Ailus Date: Tue Apr 26 09:02:39 2022 +0200 media: Add CSI-2 bus configuration to frame descriptors Add CSI-2 bus specific configuration to the frame descriptors. This allows obtaining the virtual channel and data type information for each stream the transmitter is sending. Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit a34cc79c9623ea2c12eca22c16e70047fbd7c26e Author: Sakari Ailus Date: Tue Apr 26 09:02:38 2022 +0200 media: Add bus type to frame descriptors Add the media bus type to the frame descriptor. CSI-2 specific information will be added in next patch to the frame descriptor. - Make the bus type a named enum Signed-off-by: Sakari Ailus Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 18860529a59925b4018690a44895cebf836a867c Author: Xin Ji Date: Fri Apr 22 10:47:16 2022 +0200 media: dt-bindings: media: video-interfaces: Add new bus-type No properly bus-type for DPI video bus, add bus-type 7 for it. Acked-by: Rob Herring Signed-off-by: Xin Ji Reviewed-by: Robert Foss Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5e052a4d2a47eec3ac1e707ed415b2948bba54ef Author: Xin Ji Date: Fri Apr 22 10:47:15 2022 +0200 media: media/v4l2-core: Add enum V4L2_FWNODE_BUS_TYPE_DPI As V4L2_FWNODE_BUS_TYPE_PARALLEL is not used for DPI interface, this patch add V4L2_FWNODE_BUS_TYPE_DPI for video DPI interface. Signed-off-by: Xin Ji Reviewed-by: Robert Foss Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5bf19572e31375368f19edd2dbb2e0789518bb99 Author: Dongliang Mu Date: Fri Apr 22 10:54:05 2022 +0200 media: ov7670: remove ov7670_power_off from ov7670_remove In ov7670_probe, it always invokes ov7670_power_off() no matter the execution is successful or failed. So we cannot invoke it agiain in ov7670_remove(). Fix this by removing ov7670_power_off from ov7670_remove. Fixes: 030f9f682e66 ("media: ov7670: control clock along with power") Signed-off-by: Dongliang Mu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit c1b77f25247fa19aa738cfda14f4525583a1f32a Author: Sakari Ailus Date: Tue Aug 17 08:52:29 2021 +0200 media: dw9807-vcm: Add "dongwoon,dw9807" compatible string There is firmware out there that uses "dongwoon,dw9807" compatible string that never made it to upstream as-is. Add it to the driver to make it load on such systems. The chip also has an EEPROM part which is AT24 compatible (for reading purposes) on a separate I²C address. Adding possible support for this in the future is not affected by this change. Signed-off-by: Sakari Ailus Acked-by: Krzysztof Kozlowski Signed-off-by: Mauro Carvalho Chehab commit a1f4626b282d4e419047d47c1b0b1055f3c12a19 Author: Sakari Ailus Date: Tue Aug 17 08:51:34 2021 +0200 media: dt-bindings: Convert Dongwoon dw9807-vcm bindings to json-schema Convert the old text based dw9807-vcm chip DT bindings to json-schema. Signed-off-by: Sakari Ailus Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mauro Carvalho Chehab commit 3de9dc7f677312c717eebcee5c4535b4c6be7662 Author: Bryan O'Donoghue Date: Fri Apr 15 13:59:54 2022 +0200 media: i2c: imx412: Add bulk regulator support Depending on the platform we may need to enable and disable three separate regulators for the imx412. - DOVDD Digital I/O power - AVDD Analog power - DVDD Digital core power The addition of these regulators shouldn't affect existing users using fixed-on/firmware-controlled regulators. Signed-off-by: Bryan O'Donoghue Reviewed-by: Jacopo Mondi Acked-by: Daniele Alessandrelli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2aab3abfda2bbb2c758e4b2a1df04ee04d3bab22 Author: Bryan O'Donoghue Date: Fri Apr 15 13:59:53 2022 +0200 media: dt-bindings: imx412: Add regulator descriptions The imx412 like many I2C camera sensors has three voltage rails which depending on platform may be necessary to switch power onto directly. Add in as optional rails so as not to break anything for existing users. Cc: Rob Herring Cc: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Signed-off-by: Bryan O'Donoghue Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9a199694c6a1519522ec73a4571f68abe9f13d5d Author: Bryan O'Donoghue Date: Fri Apr 15 13:59:52 2022 +0200 media: i2c: imx412: Fix power_off ordering The enable path does - gpio - clock The disable path does - gpio - clock Fix the order on the power-off path so that power-off and power-on have the same ordering for clock and gpio. Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Jacopo Mondi Reviewed-by: Daniele Alessandrelli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit bb25f071fc92d3d227178a45853347c7b3b45a6b Author: Bryan O'Donoghue Date: Fri Apr 15 13:59:51 2022 +0200 media: i2c: imx412: Fix reset GPIO polarity The imx412/imx577 sensor has a reset line that is active low not active high. Currently the logic for this is inverted. The right way to define the reset line is to declare it active low in the DTS and invert the logic currently contained in the driver. The DTS should represent the hardware does i.e. reset is active low. So: + reset-gpios = <&tlmm 78 GPIO_ACTIVE_LOW>; not: - reset-gpios = <&tlmm 78 GPIO_ACTIVE_HIGH>; I was a bit reticent about changing this logic since I thought it might negatively impact @intel.com users. Googling a bit though I believe this sensor is used on "Keem Bay" which is clearly a DTS based system and is not upstream yet. Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Jacopo Mondi Reviewed-by: Daniele Alessandrelli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0594058b723b9b47eb840519dcf1735aa7612172 Merge: 3123109284176 31ab5169803eb Author: Stephen Boyd Date: Mon May 16 23:56:23 2022 -0700 Merge tag 'sunxi-clk-for-5.19-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull Allwinner clk driver updates from Jernej Skrabec: - Allwinner H6 RTC clock - Allwinner H616 32 kHz clock * tag 'sunxi-clk-for-5.19-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: h616: Add PLL derived 32KHz clock clk: sunxi-ng: h6-r: Add RTC gate clock commit 8b9d9e9f8e60571648a6eebd15ce6d370e7c852a Merge: 3123109284176 6f6baf690c3b8 Author: Stephen Boyd Date: Mon May 16 23:53:06 2022 -0700 Merge tag 'for-5.19-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-tegra Pull Tegra clk driver updates from Thierry Reding: This contains a boot time optimization for Tegra chips with BPMP and a switch from .round_rate() to .determine_rate() to take into account any maximum rate that might have been set. Other than that this contains a fix for a DFLL regression on Tegra210 and kerneldoc fixups to avoid build warnings. * tag 'for-5.19-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: clk: tegra: Update kerneldoc to match prototypes clk: tegra: Replace .round_rate() with .determine_rate() clk: tegra: Register clocks from root to leaf clk: tegra: Add missing reset deassertion commit 44d30762cde76fe0a5b2e955ec34b369815679d6 Author: Guo Zhengkui Date: Tue May 17 14:25:17 2022 +0800 ALSA: seq: replace ternary operator with max() Fix the following coccicheck warning: sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220517062518.123292-1-guozhengkui@vivo.com Signed-off-by: Takashi Iwai commit 13982e866c74b7e1180f7ff0ef41d8fd8d4ebc21 Merge: 9f4f53efa986e 23426d1be3c20 Author: Stephen Boyd Date: Mon May 16 23:46:45 2022 -0700 Merge tag 'renesas-clk-for-v5.19-tag2' 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 support for the R-Car V4H and RZ/V2M SoCs - Add the Universal Flash Storage clock on R-Car S4-8 - Add I2C, SSIF-2 (sound), USB, CANFD, OSTM (timer), WDT, SPI Multi I/O Bus, RSPI, TSU (thermal), and ADC clocks and resets on RZ/G2UL - Add display clock support on RZ/G2L - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: (36 commits) clk: renesas: r9a09g011: Add eth clock and reset entries clk: renesas: Add RZ/V2M support using the rzg2l driver clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg clk: renesas: rzg2l: Make use of CLK_MON registers optional clk: renesas: rzg2l: Set HIWORD mask for all mux and dividers clk: renesas: rzg2l: Add read only versions of the clk macros clk: renesas: rzg2l: Move the DEF_MUX array size calc into the macro dt-bindings: clock: renesas,rzg2l: Document RZ/V2M SoC clk: renesas: r9a07g044: Fix OSTM1 module clock name clk: renesas: r9a07g043: Add clock and reset entries for ADC clk: renesas: r9a07g043: Add TSU clock and reset entry clk: renesas: r9a07g043: Add RSPI clock and reset entries clk: renesas: r9a07g043: Add clock and reset entries for SPI Multi I/O Bus Controller clk: renesas: r9a07g044: Add DSI clock and reset entries clk: renesas: r9a07g044: Add LCDC clock and reset entries clk: renesas: r9a07g044: Add M4 Clock support clk: renesas: r9a07g044: Add M3 Clock support clk: renesas: r9a07g044: Add {M2, M2_DIV2} Clocks support clk: renesas: r9a07g044: Add M1 clock support clk: renesas: rzg2l: Add DSI divider clk support ... commit b69b0adc71637d436883c5ed9bfadbfbb7e02fda Author: Li Zhengyu Date: Mon May 9 17:21:02 2022 +0800 clk: fixed-rate: Remove redundant if statement (np) is always true when (dev || !np) is false, so just remove the check. Signed-off-by: Li Zhengyu Link: https://lore.kernel.org/r/20220509092102.140520-1-lizhengyu3@huawei.com Signed-off-by: Stephen Boyd commit e626f37e657adbab2a7abe51480925891662a5f3 Author: Christoph Hellwig Date: Mon May 16 14:29:43 2022 +0200 nvme: split the enum used for various register constants Instead of having one big enum add one for each register or field. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni commit 1b3ce51dde3652960ba74e20d1990e5c23d25105 Author: Tetsuo Handa Date: Mon May 16 21:04:59 2022 -0700 Input: psmouse-smbus - avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local psmouse_wq. Signed-off-by: Tetsuo Handa Link: https://lore.kernel.org/r/25e2b787-cb2c-fb0d-d62c-6577ad1cd9df@I-love.SAKURA.ne.jp Signed-off-by: Dmitry Torokhov commit 1922cc9c20a38a12ca1d8e44d3ccede62b59d5e8 Author: Wan Jiabing Date: Mon May 16 15:24:31 2022 -0700 Input: bcm-keypad - remove unneeded NULL check before clk_disable_unprepare clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL. Remove unneeded NULL check for kp->clk. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220516085511.10679-1-wanjiabing@vivo.com Signed-off-by: Dmitry Torokhov commit c8994b30d71d64d5dcc9bc0edbfdf367171aa96f Author: Miaoqian Lin Date: Mon May 16 14:55:55 2022 -0700 Input: sparcspkr - fix refcount leak in bbc_beep_probe of_find_node_by_path() calls of_find_node_opts_by_path(), which returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 9c1a5077fdca ("input: Rewrite sparcspkr device probing.") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516081018.42728-1-linmq006@gmail.com Signed-off-by: Dmitry Torokhov commit f8122500a039abeabfff41b0ad8b6a2c94c1107d Merge: 5756c29bfa816 2829a9fcb738f Author: Dave Airlie Date: Tue May 17 12:19:24 2022 +1000 Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next fix address space collisions in some edge cases when userspace is using softpin and cleans up the MMU reference handling a bit. Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/ffae9f7d03ca7a9e00da16d5910ae810befd3c5a.camel@pengutronix.de commit bb489b96406104070c1fbe364c441cffae8a2ae4 Author: Nícolas F. R. A. Prado Date: Wed May 11 15:54:52 2022 -0400 dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp The SCP co-processor can optionally be passed a reserved memory region to use. Add this property in the dt-binding. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220511195452.871897-3-nfraprado@collabora.com Signed-off-by: Mathieu Poirier commit 6bbe1065121b8cd3b3e734ef8cd99f142bdab241 Author: Nícolas F. R. A. Prado Date: Wed May 11 15:54:51 2022 -0400 dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Commit ca23ecfdbd44 ("remoteproc/mediatek: support L1TCM") added support for the l1tcm memory region on the MT8192 SCP, adding a new da_to_va callback that handles l1tcm while keeping the old one for back-compatibility with MT8183. However, since the mt8192 compatible was missing from the dt-binding, the accompanying dt-binding commit 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region") mistakenly added this reg as if it were for mt8183. And later it became common to all platforms as their compatibles were added. Fix the dt-binding so that the l1tcm reg can be present only on the supported platforms: mt8192 and mt8195. Fixes: 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220511195452.871897-2-nfraprado@collabora.com Signed-off-by: Mathieu Poirier commit aabd5fea49461c7b3a70d7aaa965e8cb3f19b7e7 Author: Minghao Chi Date: Tue May 10 10:51:13 2022 +0000 scsi: ipr: Use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Link: https://lore.kernel.org/r/20220510105113.1351891-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Acked-by: Brian King Signed-off-by: Minghao Chi Signed-off-by: Martin K. Petersen commit a25eafd13e5f79d9bbada5a4a4a4224cc5f6d14c Author: Dan Carpenter Date: Fri May 6 16:17:33 2022 +0300 scsi: mpi3mr: Fix a NULL vs IS_ERR() bug in mpi3mr_bsg_init() The bsg_setup_queue() function does not return NULL. It returns error pointers. Fix the check accordingly. Link: https://lore.kernel.org/r/YnUf7RQl+A3tigWh@kili Fixes: 4268fa751365 ("scsi: mpi3mr: Add bsg device support") Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 20f8932f979e7377a625f6e711bd4e84ec025d0b Author: Sebastian Andrzej Siewior Date: Fri May 6 12:57:58 2022 +0200 scsi: bnx2fc: Avoid using get_cpu() in bnx2fc_cmd_alloc() Using get_cpu() leads to disabling preemption and in this context it is not possible to acquire the following spinlock_t on PREEMPT_RT because it becomes a sleeping lock. Commit 0ea5c27583e1 ("[SCSI] bnx2fc: common free list for cleanup commands") says that it is using get_cpu() as a fix in case the CPU is preempted. While this might be true, the important part is that it is now using the same CPU for locking and unlocking while previously it always relied on smp_processor_id(). The date structure itself is protected with a lock so it does not rely on CPU-local access. Replace get_cpu() with raw_smp_processor_id() to obtain the current CPU number which is used as an index for the per-CPU resource. Link: https://lore.kernel.org/r/20220506105758.283887-5-bigeasy@linutronix.de Reviewed-by: Davidlohr Bueso Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit a0548edf852a8776dade1e511694b2980c674e2a Author: Davidlohr Bueso Date: Fri May 6 12:57:57 2022 +0200 scsi: libfc: Remove get_cpu() semantics in fc_exch_em_alloc() The get_cpu() in fc_exch_em_alloc() was introduced in commit f018b73af6db ("[SCSI] libfc, libfcoe, fcoe: use smp_processor_id() only when preempt disabled") for no other reason than to simply use smp_processor_id() without getting a warning, because everything is done with the pool->lock held anyway. However, get_cpu(), by disabling preemption, does not play well with PREEMPT_RT, particularly when acquiring a regular (and thus sleepable) spinlock. Therefore remove the get_cpu() and just use the unstable value as we will have CPU locality guarantees next by taking the lock. The window of migration, as noted by Sebastian, is small and even if it happens the result is correct. Link: https://lore.kernel.org/r/20211117025956.79616-2-dave@stgolabs.net Link: https://lore.kernel.org/r/20220506105758.283887-4-bigeasy@linutronix.de Acked-by: Sebastian Andrzej Siewior Signed-off-by: Davidlohr Bueso Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit a912460efafea8ba763717b083347d5b33495bfa Author: Sebastian Andrzej Siewior Date: Fri May 6 12:57:56 2022 +0200 scsi: fcoe: Use per-CPU API to update per-CPU statistics The per-CPU statistics (struct fc_stats) is updated by getting a stable per-CPU pointer via get_cpu() + per_cpu_ptr() and then performing the increment. This can be optimized by using this_cpu_*() which will do whatever is needed on the architecture to perform the update safe and efficient. The read out of the individual value (fc_get_host_stats()) should be done by using READ_ONCE() instead of a plain-C access. The difference is that READ_ONCE() will always perform a single access while the plain-C access can be split by the compiler into two loads if it appears beneficial. The usage of u64 has the side-effect that it is also 64bit wide on 32bit architectures and the read is always split into two loads. The can lead to strange values if the read happens during an update which alters both 32bit parts of the 64bit value. This can be circumvented by either using a 32bit variables on 32bit architecures or extending the statistics with a sequence counter. Use this_cpu_*() API to update the statistics and READ_ONCE() to read it. Link: https://lore.kernel.org/r/20220506105758.283887-3-bigeasy@linutronix.de Reviewed-by: Davidlohr Bueso Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit 848b89778ed53e6c9f9e3ed01c90109ee970b3d1 Author: Davidlohr Bueso Date: Fri May 6 12:57:55 2022 +0200 scsi: fcoe: Add a local_lock to fcoe_percpu fcoe_get_paged_crc_eof() relies on the caller having preemption disabled to ensure the per-CPU fcoe_percpu context remains valid throughout the call. This is done by either holding spinlocks (such as bnx2fc_global_lock or qedf_global_lock) or the get_cpu() from fcoe_alloc_paged_crc_eof(). This last one breaks PREEMPT_RT semantics as there can be memory allocation and end up sleeping in atomic contexts. Introduce a local_lock_t to struct fcoe_percpu that will keep the non-RT case the same, mapping to preempt_disable/enable, while RT will use a per-CPU spinlock allowing the region to be preemptible but still maintain CPU locality. The other users of fcoe_percpu are already safe in this regard and do not require local_lock()ing. Link: https://lore.kernel.org/r/20211117025956.79616-3-dave@stgolabs.net Link: https://lore.kernel.org/r/20220506105758.283887-2-bigeasy@linutronix.de Acked-by: Sebastian Andrzej Siewior Signed-off-by: Davidlohr Bueso Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit 6251264fedde83ade6f0f1f7049037469dd4de0b Author: Wells Lu Date: Fri May 13 19:57:16 2022 +0800 net: ethernet: Fix unmet direct dependencies detected for NVMEM_SUNPLUS_OCOTP Removed unnecessary: select COMMON_CLK_SP7021 select RESET_SUNPLUS select NVMEM_SUNPLUS_OCOTP from Kconfig. Reported-by: kernel test robot Signed-off-by: Wells Lu Link: https://lore.kernel.org/r/1652443036-24731-1-git-send-email-wellslutw@gmail.com Signed-off-by: Jakub Kicinski commit df36d2572e0515dc190459489c159b78bb3a21fc Author: Arnaldo Carvalho de Melo Date: Mon May 16 21:18:11 2022 -0300 perf bench breakpoint: Fix build on 32-bit arches Cast pointers to unsigned long instead of to uint64_t to avoid this problem on 32-bit arches: 31 6.89 debian:experimental-x-mips : FAIL gcc version 11.2.0 (Debian 11.2.0-18) bench/breakpoint.c: In function 'breakpoint_setup': bench/breakpoint.c:56:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 56 | attr.bp_addr = (uint64_t)addr; | ^ cc1: all warnings being treated as errors make[3]: *** [/git/perf-5.18.0-rc7/tools/build/Makefile.build:139: bench] Error 2 Fixes: 68a6772f11dbb1ed ("perf bench: Add breakpoint benchmarks") Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Dmitriy Vyukov Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/YoLq1nHx1doi+VWl@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f7b88d9ae91e6cc52f9a5c21e0eb3eef36bdd5d4 Merge: 7fb18c0a781b4 ba3e2eaef1ae5 Author: Jakub Kicinski Date: Mon May 16 17:06:20 2022 -0700 Merge tag 'linux-can-next-for-5.19-20220516' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-05-16 the first 2 patches are by me and target the CAN raw protocol. The 1st removes an unneeded assignment, the other one adds support for SO_TXTIME/SCM_TXTIME. Oliver Hartkopp contributes 2 patches for the ISOTP protocol. The 1st adds support for transmission without flow control, the other let's bind() return an error on incorrect CAN ID formatting. Geert Uytterhoeven contributes a patch to clean up ctucanfd's Kconfig file. Vincent Mailhol's patch for the slcan driver uses the proper function to check for invalid CAN frames in the xmit callback. The next patch is by Geert Uytterhoeven and makes the interrupt-names of the renesas,rcar-canfd dt bindings mandatory. A patch by my update the ctucanfd dt bindings to include the common CAN controller bindings. The last patch is by Akira Yokosawa and fixes a breakage the ctucanfd's documentation. * tag 'linux-can-next-for-5.19-20220516' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: docs: ctucanfd: Use 'kernel-figure' directive instead of 'figure' dt-bindings: can: ctucanfd: include common CAN controller bindings dt-bindings: can: renesas,rcar-canfd: Make interrupt-names required can: slcan: slc_xmit(): use can_dropped_invalid_skb() instead of manual check can: ctucanfd: Let users select instead of depend on CAN_CTUCANFD can: isotp: isotp_bind(): return -EINVAL on incorrect CAN ID formatting can: isotp: add support for transmission without flow control can: raw: add support for SO_TXTIME/SCM_TXTIME can: raw: raw_sendmsg(): remove not needed setting of skb->sk ==================== Link: https://lore.kernel.org/r/20220516202625.1129281-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit ed5edd5a70b9525085403f193786395179ea303d Author: Christoph Hellwig Date: Thu May 12 08:20:14 2022 +0200 loadpin: stop using bdevname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220512062014.1826835-1-hch@lst.de commit a5f4d9df1f7beaaebbaa5943ceb789c34f10b8d5 Author: Yuanzheng Song Date: Thu May 5 07:10:37 2022 +0000 mm: usercopy: move the virt_addr_valid() below the is_vmalloc_addr() The is_kmap_addr() and the is_vmalloc_addr() in the check_heap_object() will not work, because the virt_addr_valid() will exclude the kmap and vmalloc regions. So let's move the virt_addr_valid() below the is_vmalloc_addr(). Signed-off-by: Yuanzheng Song Fixes: 4e140f59d285 ("mm/usercopy: Check kmap addresses properly") Fixes: 0aef499f3172 ("mm/usercopy: Detect vmalloc overruns") Cc: Matthew Wilcox (Oracle) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220505071037.4121100-1-songyuanzheng@huawei.com commit 710e4ebfbacac53b05c86a01e6d636c69f6eca9f Author: Kees Cook Date: Tue May 10 16:22:45 2022 -0700 gcc-plugins: randstruct: Remove cast exception handling With all randstruct exceptions removed, remove all the exception handling code. Any future warnings are likely to be shared between this plugin and Clang randstruct, and will need to be addressed in a more wholistic fashion. Cc: Christoph Hellwig Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook commit b146cbf2e32f01f56244d670aef2f43d44fcf120 Author: Kees Cook Date: Tue May 10 15:46:26 2022 -0700 af_unix: Silence randstruct GCC plugin warning While preparing for Clang randstruct support (which duplicated many of the warnings the randstruct GCC plugin warned about), one strange one remained only for the randstruct GCC plugin. Eliminating this rids the plugin of the last exception. It seems the plugin is happy to dereference individual members of a cross-struct cast, but it is upset about casting to a whole object pointer. This only manifests in one place in the kernel, so just replace the variable with individual member accesses. There is no change in executable instruction output. Drop the last exception from the randstruct GCC plugin. Cc: "David S. Miller" Cc: Christoph Hellwig Cc: Paolo Abeni Cc: Alexei Starovoitov Cc: Cong Wang Cc: Al Viro Cc: netdev@vger.kernel.org Cc: linux-hardening@vger.kernel.org Acked-by: Kuniyuki Iwashima Link: https://lore.kernel.org/lkml/20220511022217.58586-1-kuniyu@amazon.co.jp Acked-by: Jakub Kicinski Link: https://lore.kernel.org/lkml/20220511151542.4cb3ff17@kernel.org Signed-off-by: Kees Cook commit 2dcfe9e2d370f6643486e327c6ae17af8887756c Author: Kees Cook Date: Mon May 9 15:11:54 2022 -0700 niu: Silence randstruct warnings Clang randstruct gets upset when it sees struct addresspace (which is randomized) being assigned to a struct page (which is not randomized): drivers/net/ethernet/sun/niu.c:3385:12: error: casting from randomized structure pointer type 'struct address_space *' to 'struct page *' *link = (struct page *) page->mapping; ^ It looks like niu.c is looking for an in-line place to chain its allocated pages together and is overloading the "mapping" member, as it is unused. This is very non-standard, and is expected to be cleaned up in the future[1], but there is no "correct" way to handle it today. No meaningful machine code changes result after this change, and source readability is improved. Drop the randstruct exception now that there is no "confusing" cross-type assignment. [1] https://lore.kernel.org/lkml/YnqgjVoMDu5v9PNG@casper.infradead.org/ Cc: "Matthew Wilcox (Oracle)" Cc: Christoph Hellwig Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Du Cheng Cc: Christophe JAILLET Cc: Vlastimil Babka Cc: William Kucharski Cc: Arnd Bergmann Cc: Nathan Chancellor Cc: netdev@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-hardening@vger.kernel.org Acked-by: Jakub Kicinski Link: https://lore.kernel.org/lkml/20220511151647.7290adbe@kernel.org Signed-off-by: Kees Cook commit c1298a3a1139c9a73a188fbb153b6eb83dbd4d7d Author: Kees Cook Date: Sun May 8 09:15:53 2022 -0700 big_keys: Use struct for internal payload The randstruct GCC plugin gets upset when it sees struct path (which is randomized) being assigned from a "void *" (which it cannot type-check). There's no need for these casts, as the entire internal payload use is following a normal struct layout. Convert the enum-based void * offset dereferencing to the new big_key_payload struct. No meaningful machine code changes result after this change, and source readability is improved. Drop the randstruct exception now that there is no "confusing" cross-type assignment. Cc: David Howells Cc: Eric Biggers Cc: Christoph Hellwig Cc: Jarkko Sakkinen Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-hardening@vger.kernel.org Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Signed-off-by: Kees Cook commit 68084a13642001b73aade05819584f18945f3297 Author: Yosry Ahmed Date: Sat May 14 00:21:15 2022 +0000 selftests/bpf: Fix building bpf selftests statically bpf selftests can no longer be built with CFLAGS=-static with liburandom_read.so and its dependent target. Filter out -static for liburandom_read.so and its dependent target. When building statically, this leaves urandom_read relying on system-wide shared libraries. Signed-off-by: Yosry Ahmed Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220514002115.1376033-1-yosryahmed@google.com commit bc5dfb4fd7bd471c77ea48143159eb5e1308d636 Author: Baolin Wang Date: Mon May 16 08:55:58 2022 +0800 arm64/hugetlb: Implement arm64 specific huge_ptep_get() Now we use huge_ptep_get() to get the pte value of a hugetlb page, however it will only return one specific pte value for the CONT-PTE or CONT-PMD size hugetlb on ARM64 system, which can contain several continuous pte or pmd entries with same page table attributes. And it will not take into account the subpages' dirty or young bits of a CONT-PTE/PMD size hugetlb page. So the huge_ptep_get() is inconsistent with huge_ptep_get_and_clear(), which already takes account the dirty or young bits for any subpages in this CONT-PTE/PMD size hugetlb [1]. Meanwhile we can miss dirty or young flags statistics for hugetlb pages with current huge_ptep_get(), such as the gather_hugetlb_stats() function, and CONT-PTE/PMD hugetlb monitoring with DAMON. Thus define an ARM64 specific huge_ptep_get() implementation as well as enabling __HAVE_ARCH_HUGE_PTEP_GET, that will take into account any subpages' dirty or young bits for CONT-PTE/PMD size hugetlb page, for those functions that want to check the dirty and young flags of a hugetlb page. [1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/ Suggested-by: Muchun Song Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/624109a80ac4bbdf1e462dfa0b49e9f7c31a7c0d.1652496622.git.baolin.wang@linux.alibaba.com Signed-off-by: Catalin Marinas commit f0d9d79ec793ec66271e80ff2f9bf7a10458a584 Author: Baolin Wang Date: Mon May 16 08:55:57 2022 +0800 arm64/hugetlb: Use ptep_get() to get the pte value of a huge page The original huge_ptep_get() on ARM64 is just a wrapper of ptep_get(), which will not take into account any contig-PTEs dirty and access bits. Meanwhile we will implement a new ARM64-specific huge_ptep_get() interface in following patch, which will take into account any contig-PTEs dirty and access bits. To keep the same efficient logic to get the pte value, change to use ptep_get() as a preparation. Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/5113ed6e103f995e1d0f0c9fda0373b761bbcad2.1652496622.git.baolin.wang@linux.alibaba.com Signed-off-by: Catalin Marinas commit e9c3a8e820ed0eeb2be05072f29f80d1b79f053b Author: Darrick J. Wong Date: Mon May 16 15:27:38 2022 -0700 iomap: don't invalidate folios after writeback errors XFS has the unique behavior (as compared to the other Linux filesystems) that on writeback errors it will completely invalidate the affected folio and force the page cache to reread the contents from disk. All other filesystems leave the page mapped and up to date. This is a rude awakening for user programs, since (in the case where write fails but reread doesn't) file contents will appear to revert to old disk contents with no notification other than an EIO on fsync. This might have been annoying back in the days when iomap dealt with one page at a time, but with multipage folios, we can now throw away *megabytes* worth of data for a single write error. On *most* Linux filesystems, a program can respond to an EIO on write by redirtying the entire file and scheduling it for writeback. This isn't foolproof, since the page that failed writeback is no longer dirty and could be evicted, but programs that want to recover properly *also* have to detect XFS and regenerate every write they've made to the file. When running xfs/314 on arm64, I noticed a UAF when xfs_discard_folio invalidates multipage folios that could be undergoing writeback. If, say, we have a 256K folio caching a mix of written and unwritten extents, it's possible that we could start writeback of the first (say) 64K of the folio and then hit a writeback error on the next 64K. We then free the iop attached to the folio, which is really bad because writeback completion on the first 64k will trip over the "blocks per folio > 1 && !iop" assertion. This can't be fixed by only invalidating the folio if writeback fails at the start of the folio, since the folio is marked !uptodate, which trips other assertions elsewhere. Get rid of the whole behavior entirely. Signed-off-by: Darrick J. Wong Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton Reviewed-by: Christoph Hellwig commit e3a3bbe3e99de73043a1d32d36cf4d211dc58c7e Author: Reinette Chatre Date: Thu May 12 14:51:01 2022 -0700 x86/sgx: Ensure no data in PCMD page after truncate A PCMD (Paging Crypto MetaData) page contains the PCMD structures of enclave pages that have been encrypted and moved to the shmem backing store. When all enclave pages sharing a PCMD page are loaded in the enclave, there is no need for the PCMD page and it can be truncated from the backing store. A few issues appeared around the truncation of PCMD pages. The known issues have been addressed but the PCMD handling code could be made more robust by loudly complaining if any new issue appears in this area. Add a check that will complain with a warning if the PCMD page is not actually empty after it has been truncated. There should never be data in the PCMD page at this point since it is was just checked to be empty and truncated with enclave mutex held and is updated with the enclave mutex held. Suggested-by: Dave Hansen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Haitao Huang Link: https://lkml.kernel.org/r/6495120fed43fafc1496d09dd23df922b9a32709.1652389823.git.reinette.chatre@intel.com commit af117837ceb9a78e995804ade4726ad2c2c8981f Author: Reinette Chatre Date: Thu May 12 14:51:00 2022 -0700 x86/sgx: Fix race between reclaimer and page fault handler Haitao reported encountering a WARN triggered by the ENCLS[ELDU] instruction faulting with a #GP. The WARN is encountered when the reclaimer evicts a range of pages from the enclave when the same pages are faulted back right away. Consider two enclave pages (ENCLAVE_A and ENCLAVE_B) sharing a PCMD page (PCMD_AB). ENCLAVE_A is in the enclave memory and ENCLAVE_B is in the backing store. PCMD_AB contains just one entry, that of ENCLAVE_B. Scenario proceeds where ENCLAVE_A is being evicted from the enclave while ENCLAVE_B is faulted in. sgx_reclaim_pages() { ... /* * Reclaim ENCLAVE_A */ mutex_lock(&encl->lock); /* * Get a reference to ENCLAVE_A's * shmem page where enclave page * encrypted data will be stored * as well as a reference to the * enclave page's PCMD data page, * PCMD_AB. * Release mutex before writing * any data to the shmem pages. */ sgx_encl_get_backing(...); encl_page->desc |= SGX_ENCL_PAGE_BEING_RECLAIMED; mutex_unlock(&encl->lock); /* * Fault ENCLAVE_B */ sgx_vma_fault() { mutex_lock(&encl->lock); /* * Get reference to * ENCLAVE_B's shmem page * as well as PCMD_AB. */ sgx_encl_get_backing(...) /* * Load page back into * enclave via ELDU. */ /* * Release reference to * ENCLAVE_B' shmem page and * PCMD_AB. */ sgx_encl_put_backing(...); /* * PCMD_AB is found empty so * it and ENCLAVE_B's shmem page * are truncated. */ /* Truncate ENCLAVE_B backing page */ sgx_encl_truncate_backing_page(); /* Truncate PCMD_AB */ sgx_encl_truncate_backing_page(); mutex_unlock(&encl->lock); ... } mutex_lock(&encl->lock); encl_page->desc &= ~SGX_ENCL_PAGE_BEING_RECLAIMED; /* * Write encrypted contents of * ENCLAVE_A to ENCLAVE_A shmem * page and its PCMD data to * PCMD_AB. */ sgx_encl_put_backing(...) /* * Reference to PCMD_AB is * dropped and it is truncated. * ENCLAVE_A's PCMD data is lost. */ mutex_unlock(&encl->lock); } What happens next depends on whether it is ENCLAVE_A being faulted in or ENCLAVE_B being evicted - but both end up with ENCLS[ELDU] faulting with a #GP. If ENCLAVE_A is faulted then at the time sgx_encl_get_backing() is called a new PCMD page is allocated and providing the empty PCMD data for ENCLAVE_A would cause ENCLS[ELDU] to #GP If ENCLAVE_B is evicted first then a new PCMD_AB would be allocated by the reclaimer but later when ENCLAVE_A is faulted the ENCLS[ELDU] instruction would #GP during its checks of the PCMD value and the WARN would be encountered. Noting that the reclaimer sets SGX_ENCL_PAGE_BEING_RECLAIMED at the time it obtains a reference to the backing store pages of an enclave page it is in the process of reclaiming, fix the race by only truncating the PCMD page after ensuring that no page sharing the PCMD page is in the process of being reclaimed. Cc: stable@vger.kernel.org Fixes: 08999b2489b4 ("x86/sgx: Free backing memory after faulting the enclave page") Reported-by: Haitao Huang Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Haitao Huang Link: https://lkml.kernel.org/r/ed20a5db516aa813873268e125680041ae11dfcf.1652389823.git.reinette.chatre@intel.com commit 0e4e729a830c1e7f31d3b3fbf8feb355a402b117 Author: Reinette Chatre Date: Thu May 12 14:50:59 2022 -0700 x86/sgx: Obtain backing storage page with enclave mutex held Haitao reported encountering a WARN triggered by the ENCLS[ELDU] instruction faulting with a #GP. The WARN is encountered when the reclaimer evicts a range of pages from the enclave when the same pages are faulted back right away. The SGX backing storage is accessed on two paths: when there are insufficient free pages in the EPC the reclaimer works to move enclave pages to the backing storage and as enclaves access pages that have been moved to the backing storage they are retrieved from there as part of page fault handling. An oversubscribed SGX system will often run the reclaimer and page fault handler concurrently and needs to ensure that the backing store is accessed safely between the reclaimer and the page fault handler. This is not the case because the reclaimer accesses the backing store without the enclave mutex while the page fault handler accesses the backing store with the enclave mutex. Consider the scenario where a page is faulted while a page sharing a PCMD page with the faulted page is being reclaimed. The consequence is a race between the reclaimer and page fault handler, the reclaimer attempting to access a PCMD at the same time it is truncated by the page fault handler. This could result in lost PCMD data. Data may still be lost if the reclaimer wins the race, this is addressed in the following patch. The reclaimer accesses pages from the backing storage without holding the enclave mutex and runs the risk of concurrently accessing the backing storage with the page fault handler that does access the backing storage with the enclave mutex held. In the scenario below a PCMD page is truncated from the backing store after all its pages have been loaded in to the enclave at the same time the PCMD page is loaded from the backing store when one of its pages are reclaimed: sgx_reclaim_pages() { sgx_vma_fault() { ... mutex_lock(&encl->lock); ... __sgx_encl_eldu() { ... if (pcmd_page_empty) { /* * EPC page being reclaimed /* * shares a PCMD page with an * PCMD page truncated * enclave page that is being * while requested from * faulted in. * reclaimer. */ */ sgx_encl_get_backing() <----------> sgx_encl_truncate_backing_page() } mutex_unlock(&encl->lock); } } In this scenario there is a race between the reclaimer and the page fault handler when the reclaimer attempts to get access to the same PCMD page that is being truncated. This could result in the reclaimer writing to the PCMD page that is then truncated, causing the PCMD data to be lost, or in a new PCMD page being allocated. The lost PCMD data may still occur after protecting the backing store access with the mutex - this is fixed in the next patch. By ensuring the backing store is accessed with the mutex held the enclave page state can be made accurate with the SGX_ENCL_PAGE_BEING_RECLAIMED flag accurately reflecting that a page is in the process of being reclaimed. Consistently protect the reclaimer's backing store access with the enclave's mutex to ensure that it can safely run concurrently with the page fault handler. Cc: stable@vger.kernel.org Fixes: 1728ab54b4be ("x86/sgx: Add a page reclaimer") Reported-by: Haitao Huang Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Tested-by: Haitao Huang Link: https://lkml.kernel.org/r/fa2e04c561a8555bfe1f4e7adc37d60efc77387b.1652389823.git.reinette.chatre@intel.com commit 2154e1c11b7080aa19f47160bd26b6f39bbd7824 Author: Reinette Chatre Date: Thu May 12 14:50:58 2022 -0700 x86/sgx: Mark PCMD page as dirty when modifying contents Recent commit 08999b2489b4 ("x86/sgx: Free backing memory after faulting the enclave page") expanded __sgx_encl_eldu() to clear an enclave page's PCMD (Paging Crypto MetaData) from the PCMD page in the backing store after the enclave page is restored to the enclave. Since the PCMD page in the backing store is modified the page should be marked as dirty to ensure the modified data is retained. Cc: stable@vger.kernel.org Fixes: 08999b2489b4 ("x86/sgx: Free backing memory after faulting the enclave page") Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Haitao Huang Link: https://lkml.kernel.org/r/00cd2ac480db01058d112e347b32599c1a806bc4.1652389823.git.reinette.chatre@intel.com commit 5ee8c8f930ba7d20717c4fc2d9f1ce0e757d1155 Author: Sascha Hauer Date: Wed May 11 10:21:08 2022 +0200 drm/rockchip: Change register space names in vop2 "regs" seems to generic when there are multiple register spaces, so rename that one to "vop". Also change "gamma_lut" to better looking "gamma-lut". Signed-off-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220511082109.1110043-3-s.hauer@pengutronix.de commit 54eb8d446e710b5f77969bd34f0a162cf86b8d29 Author: Sascha Hauer Date: Wed May 11 10:21:07 2022 +0200 dt-bindings: display: rockchip: make reg-names mandatory for VOP2 The VOP2 driver relies on reg-names properties, but these are not documented. Add the missing documentation and make reg-names mandatory. Signed-off-by: Sascha Hauer Reviewed-by: Rob Herring Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220511082109.1110043-2-s.hauer@pengutronix.de commit 6bd429643cc265e94a9d19839c771bcc5d008fa8 Author: Reinette Chatre Date: Thu May 12 14:50:57 2022 -0700 x86/sgx: Disconnect backing page references from dirty status SGX uses shmem backing storage to store encrypted enclave pages and their crypto metadata when enclave pages are moved out of enclave memory. Two shmem backing storage pages are associated with each enclave page - one backing page to contain the encrypted enclave page data and one backing page (shared by a few enclave pages) to contain the crypto metadata used by the processor to verify the enclave page when it is loaded back into the enclave. sgx_encl_put_backing() is used to release references to the backing storage and, optionally, mark both backing store pages as dirty. Managing references and dirty status together in this way results in both backing store pages marked as dirty, even if only one of the backing store pages are changed. Additionally, waiting until the page reference is dropped to set the page dirty risks a race with the page fault handler that may load outdated data into the enclave when a page is faulted right after it is reclaimed. Consider what happens if the reclaimer writes a page to the backing store and the page is immediately faulted back, before the reclaimer is able to set the dirty bit of the page: sgx_reclaim_pages() { sgx_vma_fault() { ... sgx_encl_get_backing(); ... ... sgx_reclaimer_write() { mutex_lock(&encl->lock); /* Write data to backing store */ mutex_unlock(&encl->lock); } mutex_lock(&encl->lock); __sgx_encl_eldu() { ... /* * Enclave backing store * page not released * nor marked dirty - * contents may not be * up to date. */ sgx_encl_get_backing(); ... /* * Enclave data restored * from backing store * and PCMD pages that * are not up to date. * ENCLS[ELDU] faults * because of MAC or PCMD * checking failure. */ sgx_encl_put_backing(); } ... /* set page dirty */ sgx_encl_put_backing(); ... mutex_unlock(&encl->lock); } } Remove the option to sgx_encl_put_backing() to set the backing pages as dirty and set the needed pages as dirty right after receiving important data while enclave mutex is held. This ensures that the page fault handler can get up to date data from a page and prepares the code for a following change where only one of the backing pages need to be marked as dirty. Cc: stable@vger.kernel.org Fixes: 1728ab54b4be ("x86/sgx: Add a page reclaimer") Suggested-by: Dave Hansen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Haitao Huang Link: https://lore.kernel.org/linux-sgx/8922e48f-6646-c7cc-6393-7c78dcf23d23@intel.com/ Link: https://lkml.kernel.org/r/fa9f98986923f43e72ef4c6702a50b2a0b3c42e3.1652389823.git.reinette.chatre@intel.com commit 048ae41bb0806cde340f4e5d5030398037ab0be8 Author: Stefan Berger Date: Thu Apr 21 13:52:05 2022 -0400 integrity: Fix sparse warnings in keyring_handler Fix the following sparse warnings: CHECK security/integrity/platform_certs/keyring_handler.c security/integrity/platform_certs/keyring_handler.c:76:16: warning: Using plain integer as NULL pointer security/integrity/platform_certs/keyring_handler.c:91:16: warning: Using plain integer as NULL pointer security/integrity/platform_certs/keyring_handler.c:106:16: warning: Using plain integer as NULL pointer Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar commit 7fb18c0a781b454f699c220a441779b7f15c0965 Merge: 2ba5c8163038b 89af2ce2d95c8 Author: Jakub Kicinski Date: Mon May 16 13:45:41 2022 -0700 Merge branch 'net-skb-remove-skb_data_area_size' Ricardo Martinez says: ==================== net: skb: Remove skb_data_area_size() This patch series removes the skb_data_area_size() helper, replacing it in t7xx driver with the size used during skb allocation. https://lore.kernel.org/netdev/CAHNKnsTmH-rGgWi3jtyC=ktM1DW2W1VJkYoTMJV2Z_Bt498bsg@mail.gmail.com/ ==================== Link: https://lore.kernel.org/r/20220513173400.3848271-1-ricardo.martinez@linux.intel.com Signed-off-by: Jakub Kicinski commit 89af2ce2d95c80f6da9388d9da2e35c84c2573b1 Author: Ricardo Martinez Date: Fri May 13 10:34:00 2022 -0700 net: skb: Remove skb_data_area_size() skb_data_area_size() is not needed. As Jakub pointed out [1]: For Rx, drivers can use the size passed during skb allocation or use skb_tailroom(). For Tx, drivers should use skb_headlen(). [1] https://lore.kernel.org/netdev/CAHNKnsTmH-rGgWi3jtyC=ktM1DW2W1VJkYoTMJV2Z_Bt498bsg@mail.gmail.com/ Signed-off-by: Ricardo Martinez Reviewed-by: Andy Shevchenko Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit 262d98b1193fec68c66f3d57772b72240fc4b9da Author: Ricardo Martinez Date: Fri May 13 10:33:59 2022 -0700 net: wwan: t7xx: Avoid calls to skb_data_area_size() skb_data_area_size() helper was used to calculate the size of the DMA mapped buffer passed to the HW. Instead of doing this, use the size passed to allocate the skbs. Signed-off-by: Ricardo Martinez Reviewed-by: Andy Shevchenko Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit ac6a65868a5a45db49d5ee8524df3b701110d844 Author: Andrii Nakryiko Date: Mon May 16 11:45:47 2022 -0700 libbpf: fix memory leak in attach_tp for target-less tracepoint program Fix sec_name memory leak if user defines target-less SEC("tp"). Fixes: 9af8efc45eb1 ("libbpf: Allow "incomplete" basic tracing SEC() definitions") Signed-off-by: Andrii Nakryiko Acked-by: David Vernet Link: https://lore.kernel.org/r/20220516184547.3204674-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit f42e8e5088b9e791c8f7ac661f68e29a4996a4e3 Author: Jane Chu Date: Fri May 13 15:13:20 2022 -0700 pmem: implement pmem_recovery_write() The recovery write thread started out as a normal pwrite thread and when the filesystem was told about potential media error in the range, filesystem turns the normal pwrite to a dax_recovery_write. The recovery write consists of clearing media poison, clearing page HWPoison bit, reenable page-wide read-write permission, flush the caches and finally write. A competing pread thread will be held off during the recovery process since data read back might not be valid, and this is achieved by clearing the badblock records after the recovery write is complete. Competing recovery write threads are already serialized by writer lock held by dax_iomap_rw(). Signed-off-by: Jane Chu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/165247997655.53156.8381418704988035976.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 9409c9b6709e59866ed3540b5d7f5291439e4833 Author: Jane Chu Date: Fri Apr 22 16:45:07 2022 -0600 pmem: refactor pmem_clear_poison() Refactor the pmem_clear_poison() function such that the common shared code between the typical write path and the recovery write path is factored out. Reviewed-by: Christoph Hellwig Reviewed-by: Dan Williams Signed-off-by: Jane Chu Link: https://lore.kernel.org/r/20220422224508.440670-7-jane.chu@oracle.com Signed-off-by: Dan Williams commit 047218ec904da19c45c4a70274fc3f818a1fcba1 Author: Jane Chu Date: Fri Apr 22 16:45:06 2022 -0600 dax: add .recovery_write dax_operation Introduce dax_recovery_write() operation. The function is used to recover a dax range that contains poison. Typical use case is when a user process receives a SIGBUS with si_code BUS_MCEERR_AR indicating poison(s) in a dax range, in response, the user process issues a pwrite() to the page-aligned dax range, thus clears the poison and puts valid data in the range. Reviewed-by: Christoph Hellwig Signed-off-by: Jane Chu Link: https://lore.kernel.org/r/20220422224508.440670-6-jane.chu@oracle.com Signed-off-by: Dan Williams commit e511c4a3d2a1f64aafc1f5df37a2ffcf7ef91b55 Author: Jane Chu Date: Fri May 13 15:10:58 2022 -0700 dax: introduce DAX_RECOVERY_WRITE dax access mode Up till now, dax_direct_access() is used implicitly for normal access, but for the purpose of recovery write, dax range with poison is requested. To make the interface clear, introduce enum dax_access_mode { DAX_ACCESS, DAX_RECOVERY_WRITE, } where DAX_ACCESS is used for normal dax access, and DAX_RECOVERY_WRITE is used for dax recovery write. Suggested-by: Dan Williams Signed-off-by: Jane Chu Reviewed-by: Christoph Hellwig Cc: Mike Snitzer Reviewed-by: Vivek Goyal Link: https://lore.kernel.org/r/165247982851.52965.11024212198889762949.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit a998ec3d7bae4f996bb9dcf6d0c76b6c812f267b Author: Wan Jiabing Date: Mon May 16 16:50:00 2022 +0800 gpio: ftgpio: Remove unneeded ERROR check before clk_disable_unprepare clk_disable_unprepare() already checks ERROR by using IS_ERR_OR_NULL. Remove unneeded ERROR check for g->clk. Signed-off-by: Wan Jiabing Signed-off-by: Bartosz Golaszewski commit 2ba5c8163038bcbac34540d9ecae574d390a031f Merge: f008f8d0305cd ea1e301d04b7d Author: Jakub Kicinski Date: Mon May 16 13:11:33 2022 -0700 Merge branch 'mptcp-updates-for-net-next' Mat Martineau says: ==================== mptcp: Updates for net-next Three independent fixes/features from the MPTCP tree: Patch 1 is a selftest workaround for older iproute2 packages. Patch 2 removes superfluous locks that were added with recent MP_FAIL patches. Patch 3 adds support for the TCP_DEFER_ACCEPT sockopt. ==================== Link: https://lore.kernel.org/r/20220514002115.725976-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit ea1e301d04b7dc47e9e25ebba461c397f4d4e767 Author: Florian Westphal Date: Fri May 13 17:21:15 2022 -0700 mptcp: sockopt: add TCP_DEFER_ACCEPT support Support this via passthrough to the underlying tcp listener socket. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/271 Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 0ea5374255a93eee517b76df066a02e301c43fe6 Author: Paolo Abeni Date: Fri May 13 17:21:14 2022 -0700 Revert "mptcp: add data lock for sk timers" This reverts commit 4293248c6704b854bf816aa1967e433402bee11c. Additional locks are not needed, all the touched sections are already under mptcp socket lock protection. Fixes: 4293248c6704 ("mptcp: add data lock for sk timers") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit c43ce39870b3cff3cefb1faf78c577153edc2dde Author: Geliang Tang Date: Fri May 13 17:21:13 2022 -0700 selftests: mptcp: fix a mp_fail test warning Old tc versions (iproute2 5.3) show actions in multiple lines, not a single line. Then the following unexpected MP_FAIL selftest output occurs: file received by server has inverted byte at 169 ./mptcp_join.sh: line 1277: [: [{"total acts":1},{"actions":[{"order":0 pedit ,"control_action":{"type":"pipe"}keys 1 index 1 ref 1 bind 1,"installed":0,"last_used":0 key #0 at 148: val ff000000 mask ffffffff 5: integer expression expected 001 Infinite map syn[ ok ] - synack[ ok ] - ack[ ok ] sum[ ok ] - csum [ ok ] ftx[ ok ] - failrx[ ok ] rtx[ ok ] - rstrx [ ok ] itx[ ok ] - infirx[ ok ] ftx[ ok ] - failrx[ ok ] invert This patch adds a 'grep' before 'sed' to fix this. Fixes: b6e074e171bc ("selftests: mptcp: add infinite map testcase") Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit ba3e2eaef1ae5019775989aeec3be8e9df83baa5 Author: Akira Yokosawa Date: Wed May 11 08:45:43 2022 +0900 docs: ctucanfd: Use 'kernel-figure' directive instead of 'figure' Two issues were observed in the ReST doc added by commit c3a0addefbde ("docs: ctucanfd: CTU CAN FD open-source IP core documentation.") with Sphinx versions 2.4.4 and 4.5.0. The plain "figure" directive broke "make pdfdocs" due to a missing PDF figure. For conversion of SVG -> PDF to work, the "kernel-figure" directive, which is an extension for kernel documentation, should be used instead. The directive of "code:: raw" causes a warning from both "make htmldocs" and "make pdfdocs", which reads: [...]/can/ctu/ctucanfd-driver.rst:75: WARNING: Pygments lexer name 'raw' is not known A plain literal-block marker should suffice where no syntax highlighting is intended. Fix the issues by using suitable directive and marker. Fixes: c3a0addefbde ("docs: ctucanfd: CTU CAN FD open-source IP core documentation.") Link: https://lore.kernel.org/all/5986752a-1c2a-5d64-f91d-58b1e6decd17@gmail.com Signed-off-by: Akira Yokosawa Acked-by: Pavel Pisa Cc: Martin Jerabek Cc: Ondrej Ille Cc: Marc Kleine-Budde Signed-off-by: Marc Kleine-Budde commit 14e1e9338c08a56454afa982d2880846d0a1609f Author: Marc Kleine-Budde Date: Wed May 4 08:21:16 2022 +0200 dt-bindings: can: ctucanfd: include common CAN controller bindings Since commit | 1f9234401ce0 ("dt-bindings: can: add can-controller.yaml") there is a common CAN controller binding. Add this to the ctucanfd binding. Cc: Ondrej Ille Acked-by: Pavel Pisa Acked-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit f008f8d0305cdf930de97d4f746f2a6bc9338385 Author: Alvin Šipraga Date: Fri May 13 23:36:18 2022 +0200 net: dsa: realtek: rtl8366rb: Serialize indirect PHY register access Lock the regmap during the whole PHY register access routines in rtl8366rb. Signed-off-by: Alvin Šipraga Tested-by: Linus Walleij Signed-off-by: Linus Walleij Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220513213618.2742895-1-linus.walleij@linaro.org Signed-off-by: Jakub Kicinski commit 48b171dbf7b65c188b533c9e19dce88d028cc26a Author: Geert Uytterhoeven Date: Mon May 2 19:33:53 2022 +0200 dt-bindings: can: renesas,rcar-canfd: Make interrupt-names required The Renesas R-Car CAN FD Controller always uses two or more interrupts. Make the interrupt-names properties a required property, to make it easier to identify the individual interrupts. Update the example accordingly. Link: https://lore.kernel.org/all/a68e65955e0df4db60233d468f348203c2e7b940.1651512451.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Signed-off-by: Marc Kleine-Budde commit 30abc929132929b52fa7203c35e60335c500bd17 Author: Vincent Mailhol Date: Sat May 14 23:16:47 2022 +0900 can: slcan: slc_xmit(): use can_dropped_invalid_skb() instead of manual check slcan does a manual check in slc_xmit() to verify if the skb is valid. This check is incomplete, use instead can_dropped_invalid_skb(). Link: https://lore.kernel.org/all/20220514141650.1109542-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 94737ef56b610d94a24fadfb8386fc17dbd79ddd Author: Geert Uytterhoeven Date: Mon May 9 16:02:59 2022 +0200 can: ctucanfd: Let users select instead of depend on CAN_CTUCANFD The CTU CAN-FD IP core is only useful when used with one of the corresponding PCI/PCIe or platform (FPGA, SoC) drivers, which depend on PCI resp. OF. Hence make the users select the core driver code, instead of letting then depend on it. Keep the core code config option visible when compile-testing, to maintain compile-coverage. Link: https://lore.kernel.org/all/887b7440446b6244a20a503cc6e8dc9258846706.1652104941.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Acked-by: Pavel Pisa Signed-off-by: Marc Kleine-Budde commit 2aa39889c463195a0dfe2aff9fad413139c32a4f Author: Oliver Hartkopp Date: Sun May 15 20:16:33 2022 +0200 can: isotp: isotp_bind(): return -EINVAL on incorrect CAN ID formatting Commit 3ea566422cbd ("can: isotp: sanitize CAN ID checks in isotp_bind()") checks the given CAN ID address information by sanitizing the input values. This check (silently) removes obsolete bits by masking the given CAN IDs. Derek Will suggested to give a feedback to the application programmer when the 'sanitizing' was actually needed which means the programmer provided CAN ID content in a wrong format (e.g. SFF CAN IDs with a CAN ID > 0x7FF). Link: https://lore.kernel.org/all/20220515181633.76671-1-socketcan@hartkopp.net Suggested-by: Derek Will Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 9f39d36530e5678d092d53c5c2c60d82b4dcc169 Author: Oliver Hartkopp Date: Sat May 7 13:55:58 2022 +0200 can: isotp: add support for transmission without flow control Usually the ISO 15765-2 protocol is a point-to-point protocol to transfer segmented PDUs to a dedicated receiver. This receiver sends a flow control message to specify protocol options and timings (e.g. block size / STmin). The so called functional addressing communication allows a 1:N communication but is limited to a single frame length. This new CAN_ISOTP_CF_BROADCAST allows an unconfirmed 1:N communication with PDU length that would not fit into a single frame. This feature is not covered by the ISO 15765-2 standard. Link: https://lore.kernel.org/all/20220507115558.19065-1-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 51a0d5e51178fcd147c1b8fdab2ed16b561326db Author: Marc Kleine-Budde Date: Thu Apr 21 12:31:52 2022 +0200 can: raw: add support for SO_TXTIME/SCM_TXTIME This patch calls into sock_cmsg_send() to parse the user supplied control information into a struct sockcm_cookie. Then assign the requested transmit time to the skb. This makes it possible to use the Earliest TXTIME First (ETF) packet scheduler with the CAN_RAW protocol. The user can send a CAN_RAW frame with a TXTIME and the kernel (with the ETF scheduler) will take care of sending it to the network interface. Link: https://lore.kernel.org/all/20220502091946.1916211-3-mkl@pengutronix.de Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 2af84932b3a1db29e37b10ef7f268da47489eb16 Author: Marc Kleine-Budde Date: Thu Apr 21 10:29:03 2022 +0200 can: raw: raw_sendmsg(): remove not needed setting of skb->sk The skb in raw_sendmsg() is allocated with sock_alloc_send_skb(), which subsequently calls sock_alloc_send_pskb() -> skb_set_owner_w(), which assigns "skb->sk = sk". This patch removes the not needed setting of skb->sk. Link: https://lore.kernel.org/all/20220502091946.1916211-2-mkl@pengutronix.de Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 8e6004dfecb7bab0d8945989917fbcae5d3b50bd Author: Fabio Estevam Date: Fri May 13 08:46:13 2022 -0300 net: phy: micrel: Use the kszphy probe/suspend/resume Now that it is possible to use .probe without having .driver_data, let KSZ8061 use the kszphy specific hooks for probe,suspend and resume, which is preferred. Switch to using the dedicated kszphy probe/suspend/resume functions. Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220513114613.762810-2-festevam@gmail.com Signed-off-by: Jakub Kicinski commit f2ef6f7539c68c6bd6c32323d8845ee102b7c450 Author: Fabio Estevam Date: Fri May 13 08:46:12 2022 -0300 net: phy: micrel: Allow probing without .driver_data Currently, if the .probe element is present in the phy_driver structure and the .driver_data is not, a NULL pointer dereference happens. Allow passing .probe without .driver_data by inserting NULL checks for priv->type. Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220513114613.762810-1-festevam@gmail.com Signed-off-by: Jakub Kicinski commit 15477b31db104bc795dd1acccb3e9b89465fff01 Author: Gautam Menghani Date: Sat May 14 00:37:20 2022 +0530 kselftests/ir : Improve readability of modprobe error message Improve the readability of error message which says module not found. The new behaviour is consistent with the modprobe command. Signed-off-by: Gautam Menghani Signed-off-by: Shuah Khan commit 8a7ccad38f8b25c8202efd69371a022357286400 Author: Brendan Higgins Date: Wed May 11 17:30:26 2022 -0700 kunit: tool: update riscv QEMU config with new serial dependency The config for the serial console for riscv, CONFIG_SERIAL_EARLYCON_RISCV_SBI, added a dependency, CONFIG_RISCV_SBI_V01, at some point, so add that in to the base arch config. Signed-off-by: Brendan Higgins Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 2434031c7cb4906be2d380981caa1f87d8899288 Author: Marco Elver Date: Wed May 4 09:09:41 2022 +0200 kcsan: test: use new suite_{init,exit} support Use the newly added suite_{init,exit} support for suite-wide init and cleanup. This avoids the unsupported method by which the test used to do suite-wide init and cleanup (avoiding issues such as missing TAP headers, and possible future conflicts). Signed-off-by: Marco Elver Signed-off-by: Shuah Khan commit b18d28475264f5a4f193f047df6618b78127211e Author: David Gow Date: Sat Apr 30 12:56:40 2022 +0800 kunit: tool: Add list of all valid test configs on UML It's often desirable (particularly in test automation) to run as many tests as possible. This config enables all the tests which work as builtins under UML at present, increasing the total tests run from 156 to 342 (not counting 36 'skipped' tests). They can be run with: ./tools/testing/kunit/kunit.py run --kunitconfig=./tools/testing/kunit/configs/all_tests_uml.config This acts as an in-between point between the KUNIT_ALL_TESTS config (which enables only tests whose dependencies are already enabled), and the kunit_tool --alltests option, which tries to use allyesconfig, taking a very long time to build and breaking very often. Signed-off-by: David Gow Tested-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 7466886b400b1904ce30fa311904849e314a2cf4 Author: Miguel Ojeda Date: Mon May 2 11:36:25 2022 +0200 kunit: take `kunit_assert` as `const` The `kunit_do_failed_assertion` function passes its `struct kunit_assert` argument to `kunit_fail`. This one, in turn, calls its `format` field passing the assert again as a `const` pointer. Therefore, the whole chain may be made `const`. Signed-off-by: Miguel Ojeda Reviewed-by: Daniel Latypov Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 0453f984a7b9458f0e469afb039f2841308b1bef Author: Daniel Latypov Date: Mon May 9 13:49:09 2022 -0700 kunit: tool: misc cleanups This primarily comes from running pylint over kunit tool code and ignoring some warnings we don't care about. If we ever got a fully clean setup, we could add this to run_checks.py, but we're not there yet. Fix things like * Drop unused imports * check `is None`, not `== None` (see PEP 8) * remove redundant parens around returns * remove redundant `else` / convert `elif` to `if` where appropriate * rename make_arch_qemuconfig() param to base_kunitconfig (this is the name used in the subclass, and it's a better one) * kunit_tool_test: check the exit code for SystemExit (could be 0) Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 94507ee3e9aeafc5fcc429947b84016eabea6e64 Author: Daniel Latypov Date: Thu May 12 11:35:38 2022 -0700 kunit: tool: minor cosmetic cleanups in kunit_parser.py There should be no behavioral changes from this patch. This patch removes redundant comment text, inlines a function used in only one place, and other such minor tweaks. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit dbf0b0d53a2b5afa6ef7372dcedf52302669fc2c Author: Daniel Latypov Date: Thu May 12 11:35:37 2022 -0700 kunit: tool: make parser stop overwriting status of suites w/ no_tests Consider this invocation $ ./tools/testing/kunit/kunit.py parse < parent_test = parse_test_header(lines, test) where we have special handling when we see "# Subtest" and we ignore the explicit reported "not ok 1" status! Also, NO_TESTS at a suite-level only results in a non-zero status code where then there's only one suite atm. This change is the minimal one to make sure we don't overwrite it. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 33d4a933e9273bb9b33db8dcd0e564881319443c Author: Daniel Latypov Date: Thu May 12 11:35:36 2022 -0700 kunit: tool: remove dead parse_crash_in_log() logic This logic depends on the kernel logging a message containing 'kunit test case crashed', but there is no corresponding logic to do so. This is likely a relic of the revision process KUnit initially went through when being upstreamed. Delete it given 1) it's been missing for years and likely won't get implemented 2) the parser has been moving to be a more general KTAP parser, kunit-only magic like this isn't how we'd want to implement it. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 8f0f104e2ab6eed4cad3b111dc206f843bda43ea Author: Zhen Lei Date: Wed May 11 11:20:32 2022 +0800 arm64: kdump: Do not allocate crash low memory if not needed When "crashkernel=X,high" is specified, the specified "crashkernel=Y,low" memory is not required in the following corner cases: 1. If both CONFIG_ZONE_DMA and CONFIG_ZONE_DMA32 are disabled, it means that the devices can access any memory. 2. If the system memory is small, the crash high memory may be allocated from the DMA zones. If that happens, there's no need to allocate another crash low memory because there's already one. Add condition '(crash_base >= CRASH_ADDR_LOW_MAX)' to determine whether the 'high' memory is allocated above DMA zones. Note: when both CONFIG_ZONE_DMA and CONFIG_ZONE_DMA32 are disabled, the entire physical memory is DMA accessible, CRASH_ADDR_LOW_MAX equals 'PHYS_MASK + 1'. Signed-off-by: Zhen Lei Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220511032033.426-1-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit dba2d5ae4cb03ef4ca8a82ce8d81e54b75cf4165 Merge: 0af9de0ea86dd af0bd3c0ffae8 Author: Mark Brown Date: Mon May 16 19:50:53 2022 +0100 ASoC: fsl_sai: Add support for i.MX8MM, MP, ULP Merge series from Shengjiu Wang : ASoC: fsl_sai: Add support for i.MX8MM, MP, ULP platforms commit 0af9de0ea86dd42bf2beb46602a9397d811bc2b2 Merge: 2def44d3aec59 e0100bfd383c7 Author: Mark Brown Date: Mon May 16 19:50:51 2022 +0100 firmware: mtk: add adsp ipc protocol for SOF Merge series from Tinghan Shen : This patch provides mediatek adsp ipc support for SOF. ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs. This patch was tested and confirmed to work with SOF fw on MT8195 cherry board and MT8186 krabby board. changes since v8: - fix patchset 2 and 3. move "depends on MTK_ADSP_IPC" from SND_SOC_SOF_MTK_COMMON to SND_SOC_SOF_MT8195/MT8186 to prevent generating wrong config. changes since v7: - rebase to linux-next/next-22020504 - use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL in mtk-adsp-ipc.c - move mtk-adsp-ipc.c out from driver/firmware/mediatek - add user of mtk-adsp-ipc.h in patchset 2 and 3. changes since v6: - rebase to matthias.bgg/linux.git, v5.18-next/soc - Prefer "GPL" over "GPL v2" for MODULE_LICENSE changes since v5: - fix WARNING: modpost: missing MODULE_LICENSE() in drivers/mailbox /mtk-adsp-mailbox.o. Add MODULE_LICENSE in the last line. - Due to WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 in checkpatch, we don't remove SPDX-License in line 1. changes since v4: - add error message for wrong mbox chan changes since v3: - rebase on v5.16-rc8 - update reviewers changes since v2: - add out tag for two memory free phases changes since v1: - add comments for mtk_adsp_ipc_send and mtk_adsp_ipc_recv - remove useless MODULE_LICENSE - change label name to out_free Allen-KH Cheng (1): ASoC: SOF: mediatek: Add ipc support for mt8195 TingHan Shen (1): firmware: mediatek: add adsp ipc protocol interface Tinghan Shen (1): ASoC: SOF: mediatek: Add mt8186 ipc support drivers/firmware/Kconfig | 9 + drivers/firmware/Makefile | 1 + drivers/firmware/mtk-adsp-ipc.c | 157 ++++++++++++++++++ .../linux/firmware/mediatek/mtk-adsp-ipc.h | 65 ++++++++ sound/soc/sof/mediatek/Kconfig | 2 + sound/soc/sof/mediatek/adsp_helper.h | 12 +- sound/soc/sof/mediatek/mt8186/mt8186-loader.c | 5 + sound/soc/sof/mediatek/mt8186/mt8186.c | 141 ++++++++++++++++ sound/soc/sof/mediatek/mt8195/mt8195.c | 138 ++++++++++++++- 9 files changed, 519 insertions(+), 11 deletions(-) create mode 100644 drivers/firmware/mtk-adsp-ipc.c create mode 100644 include/linux/firmware/mediatek/mtk-adsp-ipc.h -- 2.18.0 commit 89e9fb327421081166c1d1682b6601ac93dd610c Author: Mark Brown Date: Tue May 10 17:12:08 2022 +0100 arm64/sve: Generate ZCR definitions Convert the various ZCR instances to automatic generation, no functional changes expected. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-13-broonie@kernel.org Signed-off-by: Catalin Marinas commit 11e12a91c118780b76ecae3610efd49b7ff7d39e Author: Mark Brown Date: Tue May 10 17:12:07 2022 +0100 arm64/sme: Generate defintions for SVCR Convert SVCR to automatic generation, no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-12-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9321f0492b89c8d8286d8c5e06f45c984a8221a4 Author: Mark Brown Date: Tue May 10 17:12:06 2022 +0100 arm64/sme: Generate SMPRI_EL1 definitions Convert SMPRI_EL1 to be generated. No functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-11-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8e053810e6ce90bd45f97370708b7803f6957651 Author: Mark Brown Date: Tue May 10 17:12:05 2022 +0100 arm64/sme: Automatically generate SMPRIMAP_EL2 definitions No functional change should be seen from converting SMPRIMAP_EL2 to be generated. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-10-broonie@kernel.org Signed-off-by: Catalin Marinas commit c37b8700b7234c91e38c3a6c8dcddb6bffdfb218 Author: Mark Brown Date: Tue May 10 17:12:04 2022 +0100 arm64/sme: Automatically generate SMIDR_EL1 defines Automatically generate the defines for SMIDR_EL1, no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-9-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0d1322e7ea755b9de4819aa246ebab924b4cefec Author: Mark Brown Date: Tue May 10 17:12:03 2022 +0100 arm64/sme: Automatically generate defines for SMCR Convert SMCR to use the register definition code, no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-8-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9e2c0819ac853d94c927d5d2f59e2ca2b48500b4 Author: Mark Brown Date: Tue May 10 17:12:02 2022 +0100 arm64/sysreg: Support generation of RAZ fields Add a statement for RAZ bitfields to the automatic register generation script. Nothing is emitted to the header for these fields. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220510161208.631259-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit ec0067a63e5a37de74025d46095cfe7a7af3114a Author: Mark Brown Date: Tue May 10 17:12:01 2022 +0100 arm64/sme: Remove _EL0 from name of SVCR - FIXME sysreg.h The defines for SVCR call it SVCR_EL0 however the architecture calls the register SVCR with no _EL0 suffix. In preparation for generating the sysreg definitions rename to match the architecture, no functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510161208.631259-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit e65fc01bf271cefa6269b7ab1badcf7cddae5d40 Author: Mark Brown Date: Tue May 10 17:12:00 2022 +0100 arm64/sme: Standardise bitfield names for SVCR The bitfield definitions for SVCR have a SYS_ added to the names of the constant which will be a problem for automatic generation. Remove the prefixes, no functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510161208.631259-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit a6dab6cc0f4cd0b341f002ce7d0683701612f527 Author: Mark Brown Date: Tue May 10 17:11:59 2022 +0100 arm64/sme: Drop SYS_ from SMIDR_EL1 defines We currently have a non-standard SYS_ prefix in the constants generated for SMIDR_EL1 bitfields. Drop this in preparation for automatic register definition generation, no functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510161208.631259-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5b06dcfd9e0a5dd63ecadf9169ee92a80b063322 Author: Mark Brown Date: Tue May 10 17:11:58 2022 +0100 arm64/fp: Rename SVE and SME LEN field name to _WIDTH The SVE and SVE length configuration field LEN have constants specifying their width called _SIZE rather than the more normal _WIDTH, in preparation for automatic generation rename to _WIDTH. No functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510161208.631259-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit f171f9e4097d29db88a99ea96bb6c08e819a52a4 Author: Mark Brown Date: Tue May 10 17:11:57 2022 +0100 arm64/fp: Make SVE and SME length register definition match architecture Currently (as of DDI0487H.a) the architecture defines the vector length control field in ZCR and SMCR as being 4 bits wide with an additional 5 bits reserved above it marked as RAZ/WI for future expansion. The kernel currently attempts to anticipate such expansion by treating these extra bits as part of the LEN field but this will be inconvenient when we start generating the defines and would cause problems in the event that the architecture goes a different direction with these fields. Let's instead change the defines to reflect the currently defined architecture, we can update in future as needed. No change in behaviour should be seen in any system, even emulated systems using the maximum allowed vector length for the current architecture. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510161208.631259-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8c00c8f02fcf53e82fc7f54134744d24d6994f21 Merge: 5005d1dbbb382 696207d4258b2 Author: Catalin Marinas Date: Mon May 16 19:49:58 2022 +0100 Merge branch 'for-next/sme' into for-next/sysreg-gen * for-next/sme: (29 commits) : Scalable Matrix Extensions support. arm64/sve: Make kernel FPU protection RT friendly arm64/sve: Delay freeing memory in fpsimd_flush_thread() arm64/sme: More sensibly define the size for the ZA register set arm64/sme: Fix NULL check after kzalloc arm64/sme: Add ID_AA64SMFR0_EL1 to __read_sysreg_by_encoding() arm64/sme: Provide Kconfig for SME KVM: arm64: Handle SME host state when running guests KVM: arm64: Trap SME usage in guest KVM: arm64: Hide SME system registers from guests arm64/sme: Save and restore streaming mode over EFI runtime calls arm64/sme: Disable streaming mode and ZA when flushing CPU state arm64/sme: Add ptrace support for ZA arm64/sme: Implement ptrace support for streaming mode SVE registers arm64/sme: Implement ZA signal handling arm64/sme: Implement streaming SVE signal handling arm64/sme: Disable ZA and streaming mode when handling signals arm64/sme: Implement traps and syscall handling for SME arm64/sme: Implement ZA context switching arm64/sme: Implement streaming SVE context switching arm64/sme: Implement SVCR context switching ... commit 5898b43af954b83c4a4ee4ab85c4dbafa395822a Author: Jane Chu Date: Mon May 16 11:38:10 2022 -0700 mce: fix set_mce_nospec to always unmap the whole page The set_memory_uc() approach doesn't work well in all cases. As Dan pointed out when "The VMM unmapped the bad page from guest physical space and passed the machine check to the guest." "The guest gets virtual #MC on an access to that page. When the guest tries to do set_memory_uc() and instructs cpa_flush() to do clean caches that results in taking another fault / exception perhaps because the VMM unmapped the page from the guest." Since the driver has special knowledge to handle NP or UC, mark the poisoned page with NP and let driver handle it when it comes down to repair. Please refer to discussions here for more details. https://lore.kernel.org/all/CAPcyv4hrXPb1tASBZUg-GgdVs0OOFKXMXLiHmktg_kFi7YBMyQ@mail.gmail.com/ Now since poisoned page is marked as not-present, in order to avoid writing to a not-present page and trigger kernel Oops, also fix pmem_do_write(). Fixes: 284ce4011ba6 ("x86/memory_failure: Introduce {set, clear}_mce_nospec()") Reviewed-by: Christoph Hellwig Reviewed-by: Dan Williams Signed-off-by: Jane Chu Acked-by: Tony Luck Link: https://lore.kernel.org/r/165272615484.103830.2563950688772226611.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit b3fdf9398a16f01dc013967a4ab25e99c3f4fc12 Author: Jane Chu Date: Mon May 16 11:21:46 2022 -0700 x86/mce: relocate set{clear}_mce_nospec() functions Relocate the twin mce functions to arch/x86/mm/pat/set_memory.c file where they belong. While at it, fixup a function name in a comment. Reviewed-by: Christoph Hellwig Reviewed-by: Dan Williams Signed-off-by: Jane Chu Acked-by: Borislav Petkov Cc: Stephen Rothwell [sfr: gate {set,clear}_mce_nospec() by CONFIG_X86_64] Link: https://lore.kernel.org/r/165272527328.90175.8336008202048685278.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 7917f9cdb5032ac065ac6a5415f5722f215b2608 Author: Jane Chu Date: Fri Apr 22 16:45:02 2022 -0600 acpi/nfit: rely on mce->misc to determine poison granularity nfit_handle_mec() hardcode poison granularity at L1_CACHE_BYTES. Instead, let the driver rely on mce->misc register to determine the poison granularity. Suggested-by: Dan Williams Reviewed-by: Dan Williams Signed-off-by: Jane Chu Link: https://lore.kernel.org/r/20220422224508.440670-2-jane.chu@oracle.com Signed-off-by: Dan Williams commit 9f93c2e0cda49a558c981a57fc4a7f8d143ced93 Author: Mark Brown Date: Mon May 16 19:22:13 2022 +0100 kselftest/arm64: Explicitly build no BTI tests with BTI disabled In case a distribution enables branch protection by default do as we do for the main kernel and explicitly disable branch protection when building the test case for having BTI disabled to ensure it doesn't get turned on by the toolchain defaults. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220516182213.727589-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 1c05bb947f6464756174830b778aabf8f9d6ed0e Author: Thomas Huth Date: Mon May 16 12:12:02 2022 +0200 include/uapi/linux/vfio.h: Fix trivial typo - _IORW should be _IOWR instead There is no macro called _IORW, so use _IOWR in the comment instead. Signed-off-by: Thomas Huth Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/r/20220516101202.88373-1-thuth@redhat.com Signed-off-by: Alex Williamson commit 9c63b846e6df43e5b3d31263f7db545f32deeda3 Merge: b1849f505f87f 73ae97e3cabb5 Author: Mark Brown Date: Mon May 16 19:38:40 2022 +0100 spi: spi-mem: Convert Aspeed SMC driver to spi-mem Merge series from Cédric Le Goater : This series adds a new SPI driver using the spi-mem interface for the Aspeed static memory controllers of the AST2600, AST2500 and AST2400 SoCs. * AST2600 Firmware SPI Memory Controller (FMC) * AST2600 SPI Flash Controller (SPI1 and SPI2) * AST2500 Firmware SPI Memory Controller (FMC) * AST2500 SPI Flash Controller (SPI1 and SPI2) * AST2400 New Static Memory Controller (also referred as FMC) * AST2400 SPI Flash Controller (SPI) It is based on the current OpenBMC kernel driver [1], using directly the MTD SPI-NOR interface and on a patchset [2] previously proposed adding support for the AST2600 only. This driver takes a slightly different approach to cover all 6 controllers. It does not make use of the controller register disabling Address and Data byte lanes because is not available on the AST2400 SoC. We could introduce a specific handler for new features available on recent SoCs if needed. As there is not much difference on performance, the driver chooses the common denominator: "User mode" which has been heavily tested in [1]. "User mode" is also used as a fall back method when flash device mapping window is too small. Problems to address with spi-mem were the configuration of the mapping windows and the calibration of the read timings. The driver handles them in the direct mapping handler when some knowledge on the size of the flash device is know. It is not perfect but not incorrect either. The algorithm is one from [1] because it doesn't require the DMA registers which are not available on all controllers. Direct mapping for writes is not supported (yet). I have seen some corruption with writes and I preferred to use the safer and proven method of the initial driver [1]. We can improve that later. The driver supports Quad SPI RX transfers on the AST2600 SoC but it didn't have the expected results. Therefore it is not activated yet. There are some issues on the pinctrl to investigate first. Tested on: * OpenPOWER Palmetto (AST2400) * Facebook Wedge 100 BMC (AST2400) by Tao Ren * Evaluation board (AST2500) * Inspur FP5280G2 BMC (AST2500) by John Wang * Facebook Backpack CMM BMC (AST2500) by Tao Ren * OpenPOWER Witherspoon (AST2500) * Evaluation board (AST2600 A0 and A3) * Rainier board (AST2600) [1] https://github.com/openbmc/linux/blob/dev-5.15/drivers/mtd/spi-nor/controllers/aspeed-smc.c [2] https://patchwork.ozlabs.org/project/linux-aspeed/list/?series=212394 commit 494c1432542b33f8577bd59e5b084fd50bade6d0 Author: Sathishkumar S Date: Wed May 11 17:18:31 2022 +0530 drm/amd/pm: consistent approach for smartshift create smartshift sysfs attributes from dGPU device even on smartshift 1.0 platform to be consistent. Do not populate the attributes on platforms that have APU only but not dGPU or vice versa. V2: avoid checking for the number of VGA/DISPLAY devices (Lijo) move code to read from dGPU or APU into a function and reuse (Lijo) Suggested-by: Alex Deucher Signed-off-by: Sathishkumar S Acked-by: Alex Deucher Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f3106c9424138ffd33bf0b491707c8722b57c18d Author: Jiapeng Chong Date: Thu May 12 15:19:34 2022 +0800 drm/amd/display: clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9687 amdgpu_dm_atomic_commit_tail() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 696207d4258b2ab66dbd1655a7cfb3e978889085 Author: Sebastian Andrzej Siewior Date: Thu May 5 18:32:06 2022 +0200 arm64/sve: Make kernel FPU protection RT friendly Non RT kernels need to protect FPU against preemption and bottom half processing. This is achieved by disabling bottom halves via local_bh_disable() which implictly disables preemption. On RT kernels this protection mechanism is not sufficient because local_bh_disable() does not disable preemption. It serializes bottom half related processing via a CPU local lock. As bottom halves are running always in thread context on RT kernels disabling preemption is the proper choice as it implicitly prevents bottom half processing. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220505163207.85751-3-bigeasy@linutronix.de Signed-off-by: Catalin Marinas commit a1259dd807192917eb98603f8bc7b43f70cea5b9 Author: Sebastian Andrzej Siewior Date: Thu May 5 18:32:05 2022 +0200 arm64/sve: Delay freeing memory in fpsimd_flush_thread() fpsimd_flush_thread() invokes kfree() via sve_free()+sme_free() within a preempt disabled section which is not working on -RT. Delay freeing of memory until preemption is enabled again. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220505163207.85751-2-bigeasy@linutronix.de Signed-off-by: Catalin Marinas commit c733812dd77350ba0da18cd6e474e5a2e6461b49 Author: Valentin Schneider Date: Thu May 5 18:32:07 2022 +0200 arm64: mm: Make arch_faults_on_old_pte() check for migratability arch_faults_on_old_pte() relies on the calling context being non-preemptible. CONFIG_PREEMPT_RT turns the PTE lock into a sleepable spinlock, which doesn't disable preemption once acquired, triggering the warning in arch_faults_on_old_pte(). It does however disable migration, ensuring the task remains on the same CPU during the entirety of the critical section, making the read of cpu_has_hw_af() safe and stable. Make arch_faults_on_old_pte() check cant_migrate() instead of preemptible(). Cc: Valentin Schneider Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Valentin Schneider Link: https://lore.kernel.org/r/20220127192437.1192957-1-valentin.schneider@arm.com Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220505163207.85751-4-bigeasy@linutronix.de Signed-off-by: Catalin Marinas commit b4d6bb38f9dc7cd8ccb117c247a41ec12578929c Author: Robin Murphy Date: Wed Apr 20 03:04:16 2022 +0000 arm64: mte: Clean up user tag accessors Invoking user_ldst to explicitly add a post-increment of 0 is silly. Just use a normal USER() annotation and save the redundant instruction. Signed-off-by: Robin Murphy Reviewed-by: Tong Tiangen Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220420030418.3189040-6-tongtiangen@huawei.com Signed-off-by: Catalin Marinas commit d7a49291d786b4400996afe3afcc3ef5eeb6f0ef Author: Andre Przywara Date: Wed May 11 18:21:29 2022 +0100 kselftest/arm64: bti: force static linking The "bti" selftests are built with -nostdlib, which apparently automatically creates a statically linked binary, which is what we want and need for BTI (to avoid interactions with the dynamic linker). However this is not true when building a PIE binary, which some toolchains (Ubuntu) configure as the default. When compiling btitest with such a toolchain, it will create a dynamically linked binary, which will probably fail some tests, as the dynamic linker might not support BTI: =================== TAP version 13 1..18 not ok 1 nohint_func/call_using_br_x0 not ok 2 nohint_func/call_using_br_x16 not ok 3 nohint_func/call_using_blr .... =================== To make sure we create static binaries, add an explicit -static on the linker command line. This forces static linking even if the toolchain defaults to PIE builds, and fixes btitest runs on BTI enabled machines. Signed-off-by: Andre Przywara Reviewed-by: Mark Brown Fixes: 314bcbf09f14 ("kselftest: arm64: Add BTI tests") Link: https://lore.kernel.org/r/20220511172129.2078337-1-andre.przywara@arm.com Signed-off-by: Catalin Marinas commit 411dccf9d271e49f37471c73ebedb18719d6b608 Author: Minghao Chi Date: Mon May 16 11:54:12 2022 +0000 dmaengine: idxd: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220516115412.1651772-1-chi.minghao@zte.com.cn Acked-by: Dave Jiang Signed-off-by: Vinod Koul commit 2112b8f4fb5cc35d1c384324763765953186b81f Author: Dave Jiang Date: Tue Apr 26 15:32:06 2022 -0700 dmaengine: idxd: add missing callback function to support DMA_INTERRUPT When setting DMA_INTERRUPT capability, a callback function dma->device_prep_dma_interrupt() is needed to support this capability. Without setting the callback, dma_async_device_register() will fail dma capability check. Fixes: 4e5a4eb20393 ("dmaengine: idxd: set DMA_INTERRUPT cap bit") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165101232637.3951447.15765792791591763119.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit ddc25c86b466d2359b57bc7798f167baa1735a44 Author: Yu Kuai Date: Fri May 13 10:35:07 2022 +0800 block, bfq: make bfq_has_work() more accurate bfq_has_work() is using busy_queues currently, which is not accurate because bfq_queue is busy doesn't represent that it has requests. Since bfqd aready has a counter 'queued' to record how many requests are in bfq, use it instead of busy_queues. Noted that bfq_has_work() can be called with 'bfqd->lock' held, thus the lock can't be held in bfq_has_work() to protect 'bfqd->queued'. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220513023507.2625717-3-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 181490d5321806e537dc5386db5ea640b826bf78 Author: Yu Kuai Date: Fri May 13 10:35:06 2022 +0800 block, bfq: protect 'bfqd->queued' by 'bfqd->lock' If bfq_schedule_dispatch() is called from bfq_idle_slice_timer_body(), then 'bfqd->queued' is read without holding 'bfqd->lock'. This is wrong since it can be wrote concurrently. Fix the problem by holding 'bfqd->lock' in such case. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220513023507.2625717-2-yukuai3@huawei.com Signed-off-by: Jens Axboe commit a3e7689bfaae031177ebbb257d5a704b47236044 Author: Christoph Hellwig Date: Mon May 16 08:36:54 2022 +0200 block: cleanup the VM accounting in submit_bio submit_bio uses some extremely convoluted checks and confusing comments to only account REQ_OP_READ/REQ_OP_WRITE comments. Just switch to the plain obvious checks instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220516063654.2782792-1-hch@lst.de [axboe: fixup WRITE -> REQ_OP_WRITE] Signed-off-by: Jens Axboe commit 180f9db7754539f16a0de4a145d33ce713302a9a Author: Andy Shevchenko Date: Thu May 12 20:39:21 2022 +0300 pinctrl: lynxpoint: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. While at it, switch hwirq variable to use the correct type for the sake of consistency. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit df38990dec1e1d1e09c60bcd4713e01fe975ba88 Author: Andy Shevchenko Date: Thu May 12 20:39:20 2022 +0300 pinctrl: cherryview: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. While at it, switch to use hwirq variable instead of pin for the sake of consistency. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit 6d209b42947ae5d15b86ab220dbac52f13748c6c Author: Andy Shevchenko Date: Thu May 12 20:39:19 2022 +0300 pinctrl: baytrail: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: "not an immutable chip, please consider fixing it!" Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. While at it, switch to use hwirq variable instead of offset for the sake of consistency. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit e9fdcc2d8376d15ea22c0e985eeca20330f8ff17 Author: Andy Shevchenko Date: Thu May 12 20:39:18 2022 +0300 Documentation: gpio: Advertise irqd_to_hwirq() helper in the examples Instead of direct dereferencing the IRQ data in order to get HW IRQ number use the irqd_to_hwirq() helper. Fixes: 5644b66a9c63 ("Documentation: Update the recommended pattern for GPIO irqchips") Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit bdb6528ec5504ccc5a9da768a406579e7670dd2b Author: Andy Shevchenko Date: Thu May 12 20:39:17 2022 +0300 Documentation: gpio: Fix IRQ mask and unmask examples After switching to immutable IRQ chips for GPIO drivers the examples become uncompilable due to wrong IRQ API, i.e. irq_desc_get_handler_data() in use. Replace it with proper irq_data_get_irq_chip_data() call where it applies. Fixes: 5644b66a9c63 ("Documentation: Update the recommended pattern for GPIO irqchips") Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit b1849f505f87f11815d55e03b67e97aa87ea9b5d Author: Guo Zhengkui Date: Fri May 13 21:03:33 2022 +0800 spi: spi-au1550: replace ternary operator with min() Fix the following coccicheck warnings: drivers/spi/spi-au1550.c:408:21-22: WARNING opportunity for min() drivers/spi/spi-au1550.c:542:21-22: WARNING opportunity for min() min() macro is defined in include/linux/minmax.h. It avoids multiple evaluations of the arguments when non-constant and performs strict type-checking. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220513130333.58379-1-guozhengkui@vivo.com Signed-off-by: Mark Brown commit 5c0ad551e9aa6188f2bda0977c1cb6768a2b74ef Merge: 822ca7f82b218 8c5e74c90bb52 Author: Marc Zyngier Date: Mon May 16 17:48:36 2022 +0100 Merge branch kvm-arm64/its-save-restore-fixes-5.19 into kvmarm-master/next * kvm-arm64/its-save-restore-fixes-5.19: : . : Tighten the ITS save/restore infrastructure to fail early rather : than late. Patches courtesy of Rocardo Koller. : . KVM: arm64: vgic: Undo work in failed ITS restores KVM: arm64: vgic: Do not ignore vgic_its_restore_cte failures KVM: arm64: vgic: Add more checks when restoring ITS tables KVM: arm64: vgic: Check that new ITEs could be saved in guest memory Signed-off-by: Marc Zyngier commit 822ca7f82b21822bb7435a6d76feffe60a86ec40 Merge: 8794b4f510f72 cae889302ebf5 Author: Marc Zyngier Date: Mon May 16 17:48:36 2022 +0100 Merge branch kvm-arm64/misc-5.19 into kvmarm-master/next * kvm-arm64/misc-5.19: : . : Misc fixes and general improvements for KVMM/arm64: : : - Better handle out of sequence sysregs in the global tables : : - Remove a couple of unnecessary loads from constant pool : : - Drop unnecessary pKVM checks : : - Add all known M1 implementations to the SEIS workaround : : - Cleanup kerneldoc warnings : . KVM: arm64: vgic-v3: List M1 Pro/Max as requiring the SEIS workaround KVM: arm64: pkvm: Don't mask already zeroed FEAT_SVE KVM: arm64: pkvm: Drop unnecessary FP/SIMD trap handler KVM: arm64: nvhe: Eliminate kernel-doc warnings KVM: arm64: Avoid unnecessary absolute addressing via literals KVM: arm64: Print emulated register table name when it is unsorted KVM: arm64: Don't BUG_ON() if emulated register table is unsorted Signed-off-by: Marc Zyngier commit 8794b4f510f722f37ae6b583e4b12b1af2fb692a Merge: ec2cff6cbdbec 20492a62b99bd Author: Marc Zyngier Date: Mon May 16 17:48:36 2022 +0100 Merge branch kvm-arm64/per-vcpu-host-pmu-data into kvmarm-master/next * kvm-arm64/per-vcpu-host-pmu-data: : . : Pass the host PMU state in the vcpu to avoid the use of additional : shared memory between EL1 and EL2 (this obviously only applies : to nVHE and Protected setups). : : Patches courtesy of Fuad Tabba. : . KVM: arm64: pmu: Restore compilation when HW_PERF_EVENTS isn't selected KVM: arm64: Reenable pmu in Protected Mode KVM: arm64: Pass pmu events to hyp via vcpu KVM: arm64: Repack struct kvm_pmu to reduce size KVM: arm64: Wrapper for getting pmu_events Signed-off-by: Marc Zyngier commit ec2cff6cbdbecc4897f97b01992efc0ab86aa492 Merge: 3b8e21e3c3b7d 49a1a2c70a7fd Author: Marc Zyngier Date: Mon May 16 17:48:35 2022 +0100 Merge branch kvm-arm64/vgic-invlpir into kvmarm-master/next * kvm-arm64/vgic-invlpir: : . : Implement MMIO-based LPI invalidation for vGICv3. : . KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision KVM: arm64: vgic-v3: Implement MMIO-based LPI invalidation KVM: arm64: vgic-v3: Expose GICR_CTLR.RWP when disabling LPIs irqchip/gic-v3: Exposes bit values for GICR_CTLR.{IR, CES} Signed-off-by: Marc Zyngier commit 3b8e21e3c3b7d3fb5bdfe09ba3dfa9b828b1ca96 Merge: 0586e28aaa32a 582eb04e05ddd Author: Marc Zyngier Date: Mon May 16 17:48:20 2022 +0100 Merge branch kvm-arm64/psci-suspend into kvmarm-master/next * kvm-arm64/psci-suspend: : . : Add support for PSCI SYSTEM_SUSPEND and allow userspace to : filter the wake-up events. : : Patches courtesy of Oliver. : . Documentation: KVM: Fix title level for PSCI_SUSPEND selftests: KVM: Test SYSTEM_SUSPEND PSCI call selftests: KVM: Refactor psci_test to make it amenable to new tests selftests: KVM: Use KVM_SET_MP_STATE to power off vCPU in psci_test selftests: KVM: Create helper for making SMCCC calls selftests: KVM: Rename psci_cpu_on_test to psci_test KVM: arm64: Implement PSCI SYSTEM_SUSPEND KVM: arm64: Add support for userspace to suspend a vCPU KVM: arm64: Return a value from check_vcpu_requests() KVM: arm64: Rename the KVM_REQ_SLEEP handler KVM: arm64: Track vCPU power state using MP state values KVM: arm64: Dedupe vCPU power off helpers KVM: arm64: Don't depend on fallthrough to hide SYSTEM_RESET2 Signed-off-by: Marc Zyngier commit 0586e28aaa32ad8eb49b3556eb2f73ae3ca34bd3 Merge: d25f30fe41ee7 528ada2811ba0 Author: Marc Zyngier Date: Mon May 16 17:47:03 2022 +0100 Merge branch kvm-arm64/hcall-selection into kvmarm-master/next * kvm-arm64/hcall-selection: : . : Introduce a new set of virtual sysregs for userspace to : select the hypercalls it wants to see exposed to the guest. : : Patches courtesy of Raghavendra and Oliver. : . KVM: arm64: Fix hypercall bitmap writeback when vcpus have already run KVM: arm64: Hide KVM_REG_ARM_*_BMAP_BIT_COUNT from userspace Documentation: Fix index.rst after psci.rst renaming selftests: KVM: aarch64: Add the bitmap firmware registers to get-reg-list selftests: KVM: aarch64: Introduce hypercall ABI test selftests: KVM: Create helper for making SMCCC calls selftests: KVM: Rename psci_cpu_on_test to psci_test tools: Import ARM SMCCC definitions Docs: KVM: Add doc for the bitmap firmware registers Docs: KVM: Rename psci.rst to hypercalls.rst KVM: arm64: Add vendor hypervisor firmware register KVM: arm64: Add standard hypervisor firmware register KVM: arm64: Setup a framework for hypercall bitmap firmware registers KVM: arm64: Factor out firmware register handling from psci.c Signed-off-by: Marc Zyngier commit 528ada2811ba0bb2b2db5bf0f829b48c50f3c13c Author: Marc Zyngier Date: Mon May 16 17:32:54 2022 +0100 KVM: arm64: Fix hypercall bitmap writeback when vcpus have already run We generally want to disallow hypercall bitmaps being changed once vcpus have already run. But we must allow the write if the written value is unchanged so that userspace can rewrite the register file on reboot, for example. Without this, a QEMU-based VM will fail to reboot correctly. The original code was correct, and it is me that introduced the regression. Fixes: 05714cab7d63 ("KVM: arm64: Setup a framework for hypercall bitmap firmware registers") Signed-off-by: Marc Zyngier commit d55ce491377688192c4a78b61893d36cfcfce557 Author: Mikhail Zhilkin Date: Mon May 16 15:17:25 2022 +0000 dt-bindings: mtd: partitions: Extend fixed-partitions binding Extend fixed-partitions binding for support of Sercomm partition parser (add "sercomm,sc-partitions" compatible). Signed-off-by: Mikhail Zhilkin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220516151725.885427-1-csharper2005@gmail.com commit d217c4d968bb590e5aa1ff7d02f680c9ba5c1cec Author: Mikhail Zhilkin Date: Mon May 16 15:16:37 2022 +0000 dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix Add "sercomm" vendor prefix for "Sercomm (Suzhou) Corporation". Company website: Link: https://www.sercomm.com/ Signed-off-by: Mikhail Zhilkin Acked-by: Krzysztof Kozlowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220516151637.885324-1-csharper2005@gmail.com commit 9401911f2d9f89035f7acebab16e72d43d1282fb Author: Vincent Whitchurch Date: Tue May 10 17:18:22 2022 +0200 mtd: phram: Allow cached mappings Currently phram always uses ioremap(), but this is unnecessary when normal memory is used. If the reserved-memory node does not specify the no-map property, indicating it should be mapped as system RAM and ioremap() cannot be used on it, use a cached mapping using memremap(MEMREMAP_WB) instead. On one of my systems this improves read performance by ~70%. (Note that this driver has always used normal memcpy/memset functions on memory obtained from ioremap(), which sparse doesn't like. There is no memremap() variant which maps exactly to ioremap() on all architectures, so that behaviour of the driver is not changed to avoid affecting existing users, but the sparse warnings are suppressed in the moved code with __force.) Signed-off-by: Vincent Whitchurch Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220510151822.1809278-1-vincent.whitchurch@axis.com commit bcdf0315a61a29eb753a607d3a85a4032de72d94 Author: Rafał Miłecki Date: Tue May 10 15:12:59 2022 +0200 mtd: call of_platform_populate() for MTD partitions Until this change MTD subsystem supported handling partitions only with MTD partitions parsers. That's a specific / limited API designed around partitions. Some MTD partitions may however require different handling. They may contain specific data that needs to be parsed and somehow extracted. For that purpose MTD subsystem should allow binding of standard platform drivers. An example can be U-Boot (sub)partition with environment variables. There exist a "u-boot,env" DT binding for MTD (sub)partition that requires an NVMEM driver. Ref: 5db1c2dbc04c ("dt-bindings: nvmem: add U-Boot environment variables binding") Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220510131259.555-1-zajec5@gmail.com commit 6a2277a0ebe71b45e1d5508a2d7aecd28c98e3d3 Author: Miquel Raynal Date: Fri May 13 12:49:57 2022 +0200 mtd: rawnand: renesas: Use runtime PM instead of the raw clock API This NAND controller is part of a well defined power domain handled by the runtime PM core. Let's keep the harmony with the other RZ/N1 drivers and exclusively use the runtime PM API to enable/disable the clocks. We still need to retrieve the external clock rate in order to derive the NAND timings, but that is not a big deal, we can still do that in the probe and just save this value to reuse it later. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/linux-mtd/20220513104957.257721-3-miquel.raynal@bootlin.com commit 431cbce8495551ff433c9a4225afbf8ea5270d23 Author: Miquel Raynal Date: Fri May 13 12:49:56 2022 +0200 dt-bindings: mtd: renesas: Fix the NAND controller description Add the missing power-domain property which is needed on all the RZ/N1 SoC IPs. Suggested-by: Geert Uytterhoeven Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Link: https://lore.kernel.org/linux-mtd/20220513104957.257721-2-miquel.raynal@bootlin.com commit 5794465b6fcfbaed304c8ebe8990f858eb2ed9a2 Author: Phil Edworthy Date: Thu May 12 19:50:33 2022 +0100 mtd: rawnand: mpc5121: Check before clk_disable_unprepare() not needed All code in clk_disable_unprepare() already checks the clk ptr using IS_ERR_OR_NULL so there is no need to check it again before calling it. A lot of other drivers already rely on this behaviour, so it's safe to do so here. Signed-off-by: Phil Edworthy Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220512185033.46901-1-phil.edworthy@renesas.com commit 6879854d16341ab67d61580fa988ad1b7e7cc040 Author: Phil Edworthy Date: Thu May 12 19:45:58 2022 +0100 mtd: rawnand: rockchip: Check before clk_disable_unprepare() not needed All code in clk_disable_unprepare() already checks the clk ptr using IS_ERR_OR_NULL so there is no need to check it again before calling it. A lot of other drivers already rely on this behaviour, so it's safe to do so here. Signed-off-by: Phil Edworthy Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220512184558.45966-1-phil.edworthy@renesas.com commit 521b6803f22e7f773caffbb214276079c13134ef Author: Filipe Manana Date: Thu May 5 18:16:14 2022 +0100 btrfs: send: keep the current inode open while processing it Every time we send a write command, we open the inode, read some data to a buffer and then close the inode. The amount of data we read for each write command is at most 48K, returned by max_send_read_size(), and that corresponds to: BTRFS_SEND_BUF_SIZE - 16K = 48K. In practice this does not add any significant overhead, because the time elapsed between every close (iput()) and open (btrfs_iget()) is very short, so the inode is kept in the VFS's cache after the iput() and it's still there by the time we do the next btrfs_iget(). As between processing extents of the current inode we don't do anything else, it makes sense to keep the inode open after we process its first extent that needs to be sent and keep it open until we start processing the next inode. This serves to facilitate the next change, which aims to avoid having send operations trash the page cache with data extents. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 642c5d34da53d8e9d4cdaee3cc48e9d85bca5b67 Author: Christoph Hellwig Date: Thu May 5 15:11:15 2022 -0500 btrfs: allocate the btrfs_dio_private as part of the iomap dio bio Create a new bio_set that contains all the per-bio private data needed by btrfs for direct I/O and tell the iomap code to use that instead of separately allocation the btrfs_dio_private structure. Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a3e171a09cd4f67bb4c7ea93b552b543f19a308e Author: Christoph Hellwig Date: Thu May 5 15:11:14 2022 -0500 btrfs: move struct btrfs_dio_private to inode.c The btrfs_dio_private structure is only used in inode.c, so move the definition there. Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit acb8b52a158ae5610a1378f62de5ea061a12be3d Author: Christoph Hellwig Date: Thu May 5 15:11:13 2022 -0500 btrfs: remove the disk_bytenr in struct btrfs_dio_private This field is never used, so remove it. Last use was probably in 23ea8e5a0767 ("Btrfs: load checksum data once when submitting a direct read io"). Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 491a6d01183dee9e95d55098752b5561ef93542e Author: Christoph Hellwig Date: Thu May 5 15:11:12 2022 -0500 btrfs: allocate dio_data on stack Make use of the new iomap_iter->private field to avoid a memory allocation per iomap range. Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 786f847f43a54e63161474fe85a4f1764d871a35 Author: Christoph Hellwig Date: Thu May 5 15:11:11 2022 -0500 iomap: add per-iomap_iter private data Allow the file system to keep state for all iterations. For now only wire it up for direct I/O as there is an immediate need for it there. Reviewed-by: Darrick J. Wong Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 908c54909ae72dcbf1d7e1440f7297187d06c275 Author: Christoph Hellwig Date: Thu May 5 15:11:10 2022 -0500 iomap: allow the file system to provide a bio_set for direct I/O Allow the file system to provide a specific bio_set for allocating direct I/O bios. This will allow file systems that use the ->submit_io hook to stash away additional information for file system use. To make use of this additional space for information in the completion path, the file system needs to override the ->bi_end_io callback and then call back into iomap, so export iomap_dio_bio_end_io for that. Reviewed-by: Darrick J. Wong Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 36e8c62273aaa1cb72919212356f2e75e04bcf3c Author: Christoph Hellwig Date: Thu May 5 15:11:09 2022 -0500 btrfs: add a btrfs_dio_rw wrapper Add a wrapper around iomap_dio_rw that keeps the direct I/O internals isolated in inode.c. Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 74e91b12b11560f01d120751d99d91d54b265d3d Author: Naohiro Aota Date: Tue May 3 17:48:54 2022 -0700 btrfs: zoned: zone finish unused block group While the active zones within an active block group are reset, and their active resource is released, the block group itself is kept in the active block group list and marked as active. As a result, the list will contain more than max_active_zones block groups. That itself is not fatal for the device as the zones are properly reset. However, that inflated list is, of course, strange. Also, a to-appear patch series, which deactivates an active block group on demand, gets confused with the wrong list. So, fix the issue by finishing the unused block group once it gets read-only, so that we can release the active resource in an early stage. Fixes: be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 56fbb0a4e8b3e929e41cc846e6ef89eb01152201 Author: Naohiro Aota Date: Tue May 3 17:48:53 2022 -0700 btrfs: zoned: properly finish block group on metadata write Commit be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") introduced zone finishing code both for data and metadata end_io path. However, the metadata side is not working as it should. First, it compares logical address (eb->start + eb->len) with offset within a block group (cache->zone_capacity) in submit_eb_page(). That essentially disabled zone finishing on metadata end_io path. Furthermore, fixing the issue above revealed we cannot call btrfs_zone_finish_endio() in end_extent_buffer_writeback(). We cannot call btrfs_lookup_block_group() which require spin lock inside end_io context. Introduce btrfs_schedule_zone_finish_bg() to wait for the extent buffer writeback and do the zone finish IO in a workqueue. Also, drop EXTENT_BUFFER_ZONE_FINISH as it is no longer used. Fixes: be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 8b8a53998caefebfe5c8da7a74c2b601caf5dd48 Author: Naohiro Aota Date: Tue May 3 17:48:52 2022 -0700 btrfs: zoned: finish block group when there are no more allocatable bytes left Currently, btrfs_zone_finish_endio() finishes a block group only when the written region reaches the end of the block group. We can also finish the block group when no more allocation is possible. Fixes: be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Pankaj Raghav Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit d70cbdda75da3f258118a558c087157e073229fb Author: Naohiro Aota Date: Tue May 3 17:48:51 2022 -0700 btrfs: zoned: consolidate zone finish functions btrfs_zone_finish() and btrfs_zone_finish_endio() have similar code. Introduce do_zone_finish() to factor out the common code. Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1bfd476754a2d63f899ef9c3e253b17766b8fb73 Author: Naohiro Aota Date: Tue May 3 17:48:50 2022 -0700 btrfs: zoned: introduce btrfs_zoned_bg_is_full Introduce a wrapper to check if all the space in a block group is allocated or not. Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit cf4f03c3be4a2a08be5d3a40d25ef577be2db061 Author: Nikolay Borisov Date: Fri Apr 29 17:17:34 2022 +0300 btrfs: improve error reporting in lookup_inline_extent_backref When iterating the backrefs in an extent item if the ptr to the 'current' backref record goes beyond the extent item a warning is generated and -ENOENT is returned. However what's more appropriate to debug such cases would be to return EUCLEAN and also print identifying information about the performed search as well as the current content of the leaf containing the possibly corrupted extent item. Reviewed-by: Filipe Manana Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0f07003b0fb4e00403c76101b3758c3549c2d788 Author: David Sterba Date: Tue Jul 27 15:11:53 2021 +0200 btrfs: rename bio_ctrl::bio_flags to compress_type The bio_ctrl is the last use of bio_flags that has been converted to compress type everywhere else. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit cb3a12d9885974a5f2afe0c3e9a752195401828f Author: David Sterba Date: Tue Jul 27 14:59:41 2021 +0200 btrfs: rename bio_flags in parameters and switch type Several functions take parameter bio_flags that was simplified to just compress type, unify it and change the type accordingly. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 0ff400135b2a11b4a565f4d631f7f4ea55a25a99 Author: David Sterba Date: Tue Jul 27 14:53:55 2021 +0200 btrfs: rename io_failure_record::bio_flags to compress_type The bio_flags is now used to store unchanged compress type, so unify that. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 7f6ca7f21de235ad79173445fc4d58a4afff41f6 Author: David Sterba Date: Tue Jul 27 14:49:32 2021 +0200 btrfs: open code extent_set_compress_type helpers The helpers extent_set_compress_type and extent_compress_type have become trivial after previous cleanups and can be removed. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 2a5232a8cef299a28536b4bb32eb5f75d0002293 Author: David Sterba Date: Tue Jul 27 14:47:09 2021 +0200 btrfs: simplify handling of bio_ctrl::bio_flags The bio_flags are used only to encode the compression and there are no other EXTENT_BIO_* flags, so the compress type can be stored directly. The struct member name is left unchanged and will be cleaned in later patches. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 572f3dad5221c98d8c8507f2b6373780751b90d9 Author: David Sterba Date: Tue Jul 27 12:45:11 2021 +0200 btrfs: remove trivial helper update_nr_written The helper used to do more with the wbc state but now it's just one subtraction, no need to have a special helper. It became trivial in a91326679f2a ("Btrfs: make mapping->writeback_index point to the last written page"). Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit a6f5e39ee77aa54a367627caae8e47a678582a17 Author: David Sterba Date: Tue Jul 27 14:19:02 2021 +0200 btrfs: remove unused parameter bio_flags from btrfs_wq_submit_bio Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 0e3696f80faab95e465e5f5fc8d80f36c46872ab Author: David Sterba Date: Wed Mar 20 11:49:40 2019 +0100 btrfs: remove btrfs_delayed_extent_op::is_data The value of btrfs_delayed_extent_op::is_data is always false, we can cascade the change and simplify code that depends on it, removing the structure member eventually. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 2fe6a5a1d23dceeb93e76ea16cc51be916ee9f15 Author: David Sterba Date: Wed Mar 20 11:45:48 2019 +0100 btrfs: sink parameter is_data to btrfs_set_disk_extent_flags The parameter has been added in 2009 in the infamous monster commit 5d4f98a28c7d ("Btrfs: Mixed back reference (FORWARD ROLLING FORMAT CHANGE)") but not used ever since. We can sink it and allow further simplifications. Reviewed-by: Johannes Thumshirn Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit f5585f4f0ef5b17026bbd60fbff6fcc91b99d5bf Author: Filipe Manana Date: Thu Apr 28 14:59:46 2022 +0100 btrfs: fix deadlock between concurrent dio writes when low on free data space When reserving data space for a direct IO write we can end up deadlocking if we have multiple tasks attempting a write to the same file range, there are multiple extents covered by that file range, we are low on available space for data and the writes don't expand the inode's i_size. The deadlock can happen like this: 1) We have a file with an i_size of 1M, at offset 0 it has an extent with a size of 128K and at offset 128K it has another extent also with a size of 128K; 2) Task A does a direct IO write against file range [0, 256K), and because the write is within the i_size boundary, it takes the inode's lock (VFS level) in shared mode; 3) Task A locks the file range [0, 256K) at btrfs_dio_iomap_begin(), and then gets the extent map for the extent covering the range [0, 128K). At btrfs_get_blocks_direct_write(), it creates an ordered extent for that file range ([0, 128K)); 4) Before returning from btrfs_dio_iomap_begin(), it unlocks the file range [0, 256K); 5) Task A executes btrfs_dio_iomap_begin() again, this time for the file range [128K, 256K), and locks the file range [128K, 256K); 6) Task B starts a direct IO write against file range [0, 256K) as well. It also locks the inode in shared mode, as it's within the i_size limit, and then tries to lock file range [0, 256K). It is able to lock the subrange [0, 128K) but then blocks waiting for the range [128K, 256K), as it is currently locked by task A; 7) Task A enters btrfs_get_blocks_direct_write() and tries to reserve data space. Because we are low on available free space, it triggers the async data reclaim task, and waits for it to reserve data space; 8) The async reclaim task decides to wait for all existing ordered extents to complete (through btrfs_wait_ordered_roots()). It finds the ordered extent previously created by task A for the file range [0, 128K) and waits for it to complete; 9) The ordered extent for the file range [0, 128K) can not complete because it blocks at btrfs_finish_ordered_io() when trying to lock the file range [0, 128K). This results in a deadlock, because: - task B is holding the file range [0, 128K) locked, waiting for the range [128K, 256K) to be unlocked by task A; - task A is holding the file range [128K, 256K) locked and it's waiting for the async data reclaim task to satisfy its space reservation request; - the async data reclaim task is waiting for ordered extent [0, 128K) to complete, but the ordered extent can not complete because the file range [0, 128K) is currently locked by task B, which is waiting on task A to unlock file range [128K, 256K) and task A waiting on the async data reclaim task. This results in a deadlock between 4 task: task A, task B, the async data reclaim task and the task doing ordered extent completion (a work queue task). This type of deadlock can sporadically be triggered by the test case generic/300 from fstests, and results in a stack trace like the following: [12084.033689] INFO: task kworker/u16:7:123749 blocked for more than 241 seconds. [12084.034877] Not tainted 5.18.0-rc2-btrfs-next-115 #1 [12084.035562] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [12084.036548] task:kworker/u16:7 state:D stack: 0 pid:123749 ppid: 2 flags:0x00004000 [12084.036554] Workqueue: btrfs-flush_delalloc btrfs_work_helper [btrfs] [12084.036599] Call Trace: [12084.036601] [12084.036606] __schedule+0x3cb/0xed0 [12084.036616] schedule+0x4e/0xb0 [12084.036620] btrfs_start_ordered_extent+0x109/0x1c0 [btrfs] [12084.036651] ? prepare_to_wait_exclusive+0xc0/0xc0 [12084.036659] btrfs_run_ordered_extent_work+0x1a/0x30 [btrfs] [12084.036688] btrfs_work_helper+0xf8/0x400 [btrfs] [12084.036719] ? lock_is_held_type+0xe8/0x140 [12084.036727] process_one_work+0x252/0x5a0 [12084.036736] ? process_one_work+0x5a0/0x5a0 [12084.036738] worker_thread+0x52/0x3b0 [12084.036743] ? process_one_work+0x5a0/0x5a0 [12084.036745] kthread+0xf2/0x120 [12084.036747] ? kthread_complete_and_exit+0x20/0x20 [12084.036751] ret_from_fork+0x22/0x30 [12084.036765] [12084.036769] INFO: task kworker/u16:11:153787 blocked for more than 241 seconds. [12084.037702] Not tainted 5.18.0-rc2-btrfs-next-115 #1 [12084.038540] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [12084.039506] task:kworker/u16:11 state:D stack: 0 pid:153787 ppid: 2 flags:0x00004000 [12084.039511] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs] [12084.039551] Call Trace: [12084.039553] [12084.039557] __schedule+0x3cb/0xed0 [12084.039566] schedule+0x4e/0xb0 [12084.039569] schedule_timeout+0xed/0x130 [12084.039573] ? mark_held_locks+0x50/0x80 [12084.039578] ? _raw_spin_unlock_irq+0x24/0x50 [12084.039580] ? lockdep_hardirqs_on+0x7d/0x100 [12084.039585] __wait_for_common+0xaf/0x1f0 [12084.039587] ? usleep_range_state+0xb0/0xb0 [12084.039596] btrfs_wait_ordered_extents+0x3d6/0x470 [btrfs] [12084.039636] btrfs_wait_ordered_roots+0x175/0x240 [btrfs] [12084.039670] flush_space+0x25b/0x630 [btrfs] [12084.039712] btrfs_async_reclaim_data_space+0x108/0x1b0 [btrfs] [12084.039747] process_one_work+0x252/0x5a0 [12084.039756] ? process_one_work+0x5a0/0x5a0 [12084.039758] worker_thread+0x52/0x3b0 [12084.039762] ? process_one_work+0x5a0/0x5a0 [12084.039765] kthread+0xf2/0x120 [12084.039766] ? kthread_complete_and_exit+0x20/0x20 [12084.039770] ret_from_fork+0x22/0x30 [12084.039783] [12084.039800] INFO: task kworker/u16:17:217907 blocked for more than 241 seconds. [12084.040709] Not tainted 5.18.0-rc2-btrfs-next-115 #1 [12084.041398] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [12084.042404] task:kworker/u16:17 state:D stack: 0 pid:217907 ppid: 2 flags:0x00004000 [12084.042411] Workqueue: btrfs-endio-write btrfs_work_helper [btrfs] [12084.042461] Call Trace: [12084.042463] [12084.042471] __schedule+0x3cb/0xed0 [12084.042485] schedule+0x4e/0xb0 [12084.042490] wait_extent_bit.constprop.0+0x1eb/0x260 [btrfs] [12084.042539] ? prepare_to_wait_exclusive+0xc0/0xc0 [12084.042551] lock_extent_bits+0x37/0x90 [btrfs] [12084.042601] btrfs_finish_ordered_io.isra.0+0x3fd/0x960 [btrfs] [12084.042656] ? lock_is_held_type+0xe8/0x140 [12084.042667] btrfs_work_helper+0xf8/0x400 [btrfs] [12084.042716] ? lock_is_held_type+0xe8/0x140 [12084.042727] process_one_work+0x252/0x5a0 [12084.042742] worker_thread+0x52/0x3b0 [12084.042750] ? process_one_work+0x5a0/0x5a0 [12084.042754] kthread+0xf2/0x120 [12084.042757] ? kthread_complete_and_exit+0x20/0x20 [12084.042763] ret_from_fork+0x22/0x30 [12084.042783] [12084.042798] INFO: task fio:234517 blocked for more than 241 seconds. [12084.043598] Not tainted 5.18.0-rc2-btrfs-next-115 #1 [12084.044282] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [12084.045244] task:fio state:D stack: 0 pid:234517 ppid:234515 flags:0x00004000 [12084.045248] Call Trace: [12084.045250] [12084.045254] __schedule+0x3cb/0xed0 [12084.045263] schedule+0x4e/0xb0 [12084.045266] wait_extent_bit.constprop.0+0x1eb/0x260 [btrfs] [12084.045298] ? prepare_to_wait_exclusive+0xc0/0xc0 [12084.045306] lock_extent_bits+0x37/0x90 [btrfs] [12084.045336] btrfs_dio_iomap_begin+0x336/0xc60 [btrfs] [12084.045370] ? lock_is_held_type+0xe8/0x140 [12084.045378] iomap_iter+0x184/0x4c0 [12084.045383] __iomap_dio_rw+0x2c6/0x8a0 [12084.045406] iomap_dio_rw+0xa/0x30 [12084.045408] btrfs_do_write_iter+0x370/0x5e0 [btrfs] [12084.045440] aio_write+0xfa/0x2c0 [12084.045448] ? __might_fault+0x2a/0x70 [12084.045451] ? kvm_sched_clock_read+0x14/0x40 [12084.045455] ? lock_release+0x153/0x4a0 [12084.045463] io_submit_one+0x615/0x9f0 [12084.045467] ? __might_fault+0x2a/0x70 [12084.045469] ? kvm_sched_clock_read+0x14/0x40 [12084.045478] __x64_sys_io_submit+0x83/0x160 [12084.045483] ? syscall_enter_from_user_mode+0x1d/0x50 [12084.045489] do_syscall_64+0x3b/0x90 [12084.045517] entry_SYSCALL_64_after_hwframe+0x44/0xae [12084.045521] RIP: 0033:0x7fa76511af79 [12084.045525] RSP: 002b:00007ffd6d6b9058 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 [12084.045530] RAX: ffffffffffffffda RBX: 00007fa75ba6e760 RCX: 00007fa76511af79 [12084.045532] RDX: 0000557b304ff3f0 RSI: 0000000000000001 RDI: 00007fa75ba4c000 [12084.045535] RBP: 00007fa75ba4c000 R08: 00007fa751b76000 R09: 0000000000000330 [12084.045537] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 [12084.045540] R13: 0000000000000000 R14: 0000557b304ff3f0 R15: 0000557b30521eb0 [12084.045561] Fix this issue by always reserving data space before locking a file range at btrfs_dio_iomap_begin(). If we can't reserve the space, then we don't error out immediately - instead after locking the file range, check if we can do a NOCOW write, and if we can we don't error out since we don't need to allocate a data extent, however if we can't NOCOW then error out with -ENOSPC. This also implies that we may end up reserving space when it's not needed because the write will end up being done in NOCOW mode - in that case we just release the space after we noticed we did a NOCOW write - this is the same type of logic that is done in the path for buffered IO writes. Fixes: f0bfa76a11e93d ("btrfs: fix ENOSPC failure when attempting direct IO write into NOCOW range") CC: stable@vger.kernel.org # 5.17+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 1d8fa2e29bc851ca66f680040fc74294df961bd4 Author: Goldwyn Rodrigues Date: Tue Apr 26 08:47:34 2022 -0500 btrfs: derive compression type from extent map during reads Derive the compression type from extent map as opposed to the bio flags passed. This makes it more precise and not reliant on function parameters. Reviewed-by: Nikolay Borisov Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit a13467ee7ae3742f23f0bef0cafa168312a94cb4 Author: Qu Wenruo Date: Fri Mar 11 15:38:49 2022 +0800 btrfs: scrub: move scrub_remap_extent() call into scrub_extent() [SUSPICIOUS CODE] When refactoring scrub code, I noticed a very strange behavior around scrub_remap_extent(): if (sctx->is_dev_replace) scrub_remap_extent(fs_info, cur_logical, scrub_len, &cur_physical, &target_dev, &cur_mirror); As replace target is a 1:1 copy of the source device, thus physical offset inside the target should be the same as physical inside source, thus this remap call makes no sense to me. [REAL FUNCTIONALITY] After more investigation, the function name scrub_remap_extent() doesn't tell anything of the truth, nor does its if () condition. The real story behind this function is that, for scrub_pages() we never expect missing device, even for replacing missing device. What scrub_remap_extent() is really doing is to find a live mirror, and make later scrub_pages() to read data from the good copy, other than from the missing device and increase error counters unnecessarily. [IMPROVEMENT] We have no need to bother scrub_remap_extent() in scrub_simple_mirror() at all, we only need to call it before we call scrub_pages(). And rename the function to scrub_find_live_copy(), add extra comments on them. By this we can remove one parameter from scrub_extent(), and reduce the unnecessary calls to scrub_remap_extent() for regular replace. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit d483bfd27ad0919e10eb7a9baf3cac5bcd17fc92 Author: Qu Wenruo Date: Fri Mar 11 15:38:48 2022 +0800 btrfs: scrub: use find_first_extent_item to for extent item search Since we have find_first_extent_item() to iterate the extent items of a certain range, there is no need to use the open-coded version. Replace the final scrub call site with find_first_extent_item(). Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 9ae53bf9097c8649ce7c49484888608fb15fdfea Author: Qu Wenruo Date: Fri Mar 11 15:38:47 2022 +0800 btrfs: scrub: refactor scrub_raid56_parity() Currently scrub_raid56_parity() has a large double loop, handling the following things at the same time: - Iterate each data stripe - Iterate each extent item in one data stripe Refactor this by: - Introduce a new helper to handle data stripe iteration The new helper is scrub_raid56_data_stripe_for_parity(), which only has one while() loop handling the extent items inside the data stripe. The code is still mostly the same as the old code. - Call cond_resched() for each extent Previously we only call cond_resched() under a complex if () check. I see no special reason to do that, and for other scrub functions, like scrub_simple_mirror() we're already doing the same cond_resched() after scrubbing one extent. - Add more comments Please note that, this patch is only to address the double loop, there are incoming patches to do extra cleanup. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 18d30ab961497f2934dad5cb502e3e377e6ae61c Author: Qu Wenruo Date: Fri Mar 11 15:38:46 2022 +0800 btrfs: scrub: use scrub_simple_mirror() to handle RAID56 data stripe scrub Although RAID56 has complex repair mechanism, which involves reading the whole full stripe, but inside one data stripe, it's in fact no different than SINGLE/RAID1. The point here is, for data stripe we just check the csum for each extent we hit. Only for csum mismatch case, our repair paths divide. So we can still reuse scrub_simple_mirror() for RAID56 data stripes, which saves quite some code. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit e430c4287ebdafef961948c31c0b8c18dae7ee5e Author: Qu Wenruo Date: Fri Mar 11 15:38:45 2022 +0800 btrfs: scrub: cleanup the non-RAID56 branches in scrub_stripe() Since we have moved all other profiles handling into their own functions, now the main body of scrub_stripe() is just handling RAID56 profiles. There is no need to address other profiles in the main loop of scrub_stripe(), so we can remove those dead branches. Since we're here, also slightly change the timing of initialization of variables like @offset, @increment and @logical. Especially for @logical, we don't really need to initialize it for btrfs_extent_root()/btrfs_csum_root(), we can use bg->start for that purpose. Now those variables are only initialize for RAID56 branches. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 8557635ed2b04bd54c26b203a3ae43c0e5d6f5af Author: Qu Wenruo Date: Fri Mar 11 15:38:44 2022 +0800 btrfs: scrub: introduce dedicated helper to scrub simple-stripe based range The new entrance will iterate through each data stripe which belongs to the target device. And since inside each data stripe, RAID0 is just SINGLE, while RAID10 is just RAID1, we can reuse scrub_simple_mirror() to do the scrub properly. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 09022b14fafc86904f237b0463877d5d36f8cc17 Author: Qu Wenruo Date: Fri Mar 11 15:38:43 2022 +0800 btrfs: scrub: introduce dedicated helper to scrub simple-mirror based range The new helper, scrub_simple_mirror(), will scrub all extents inside a range which only has simple mirror based duplication. This covers every range of SINGLE/DUP/RAID1/RAID1C*, and inside each data stripe for RAID0/RAID10. Currently we will use this function to scrub SINGLE/DUP/RAID1/RAID1C* profiles. As one can see, the new entrance for those simple-mirror based profiles can be small enough (with comments, just reach 100 lines). This function will be the basis for the incoming scrub refactor. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 416bd7e7af602a14c41d87a94bec36a052d87181 Author: Qu Wenruo Date: Fri Mar 11 15:38:42 2022 +0800 btrfs: scrub: introduce a helper to locate an extent item The new helper, find_first_extent_item(), will locate an extent item (either EXTENT_ITEM or METADATA_ITEM) which covers any byte of the search range. This helper will later be used to refactor scrub code. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 1194a82481d8f37892e0362b7e77d3627f51d017 Author: Qu Wenruo Date: Fri Mar 11 15:38:41 2022 +0800 btrfs: calculate physical_end using dev_extent_len directly in scrub_stripe() The variable @physical_end is the exclusive stripe end, currently it's calculated using @physical + @dev_extent_len / map->stripe_len * map->stripe_len. And since at allocation time we ensured dev_extent_len is stripe_len aligned, the result is the same as @physical + @dev_extent_len. So this patch will just assign @physical and @physical_end early, without using @nstripes. This is especially helpful for any possible out: label user, as now we only need to initialize @offset before going to out: label. Since we're here, also make @physical_end constant. Reviewed-by: Christoph Hellwig Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 48b36a602a335c184505346b5b37077840660634 Author: Gabriel Niebler Date: Tue May 3 12:44:43 2022 +0200 btrfs: turn fs_roots_radix in btrfs_fs_info into an XArray … rename it to simply fs_roots and adjust all usages of this object to use the XArray API, because it is notionally easier to use and understand, as it provides array semantics, and also takes care of locking for us, further simplifying the code. Also do some refactoring, esp. where the API change requires largely rewriting some functions, anyway. Reviewed-by: Nikolay Borisov Signed-off-by: Gabriel Niebler Signed-off-by: David Sterba commit 8ee922689d67b7cfa6acbe2aa1ee76ac72e6fc8a Author: Gabriel Niebler Date: Thu Apr 21 17:45:38 2022 +0200 btrfs: turn fs_info member buffer_radix into XArray … named 'extent_buffers'. Also adjust all usages of this object to use the XArray API, which greatly simplifies the code as it takes care of locking and is generally easier to use and understand, providing notionally simpler array semantics. Also perform some light refactoring. Reviewed-by: Nikolay Borisov Signed-off-by: Gabriel Niebler Signed-off-by: David Sterba commit 4076942021fe14efecae33bf98566df6dd5ae6f7 Author: Gabriel Niebler Date: Tue Apr 26 11:51:01 2022 +0200 btrfs: turn name_cache radix tree into XArray in send_ctx … and adjust all usages of this object to use the XArray API for the sake of consistency. XArray API provides array semantics, so it is notionally easier to use and understand, and it also takes care of locking for us. None of this makes a real difference in this particular patch, but it does in other places where similar replacements are or have been made and we want to be consistent in our usage of data structures in btrfs. Signed-off-by: Gabriel Niebler Signed-off-by: David Sterba commit 253bf57555e451dec5a7f09dc95d380ce8b10e5b Author: Gabriel Niebler Date: Tue Apr 26 11:43:04 2022 +0200 btrfs: turn delayed_nodes_tree into an XArray … in the btrfs_root struct and adjust all usages of this object to use the XArray API, because it is notionally easier to use and understand, as it provides array semantics, and also takes care of locking for us, further simplifying the code. Also use the opportunity to do some light refactoring. Reviewed-by: Nikolay Borisov Signed-off-by: Gabriel Niebler Signed-off-by: David Sterba commit 719fae8920e4f42643ea306b95addb40bec87a25 Author: Qu Wenruo Date: Wed Apr 20 16:08:28 2022 +0800 btrfs: use ilog2() to replace if () branches for btrfs_bg_flags_to_raid_index() In function btrfs_bg_flags_to_raid_index(), we use quite some if () to convert the BTRFS_BLOCK_GROUP_* bits to a index number. But the truth is, there is really no such need for so many branches at all. Since all BTRFS_BLOCK_GROUP_* flags are just one single bit set inside BTRFS_BLOCK_GROUP_PROFILES_MASK, we can easily use ilog2() to calculate their values. This calculation has an anchor point, the lowest PROFILE bit, which is RAID0. Even it's fixed on-disk format and should never change, here I added extra compile time checks to make it super safe: 1. Make sure RAID0 is always the lowest bit in PROFILE_MASK This is done by finding the first (least significant) bit set of RAID0 and PROFILE_MASK & ~RAID0. 2. Make sure RAID0 bit set beyond the highest bit of TYPE_MASK Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f04fbcc64e4be16185151f9fca44ea1b3d074bd0 Author: Qu Wenruo Date: Wed Apr 20 16:08:27 2022 +0800 btrfs: move definition of btrfs_raid_types to volumes.h It's only internally used as another way to represent btrfs profiles, it's not exposed through any on-disk format, in fact this btrfs_raid_types is diverted from the on-disk format values. Furthermore, since it's internal structure, its definition can change in the future. Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 385de0ef387dc7f33fc5b828136cbc9516b3ec1a Author: Christoph Hellwig Date: Mon Apr 18 06:43:11 2022 +0200 btrfs: use a normal workqueue for rmw_workers rmw_workers doesn't need ordered execution or thread disabling threshold (as the thresh parameter is less than DFT_THRESHOLD). Just switch to the normal workqueues that use a lot less resources, especially in the work_struct vs btrfs_work structures. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit be539518262774ed04336e7c68354b823dc6c5e4 Author: Christoph Hellwig Date: Mon Apr 18 06:43:10 2022 +0200 btrfs: use normal workqueues for scrub All three scrub workqueues don't need ordered execution or thread disabling threshold (as the thresh parameter is less than DFT_THRESHOLD). Just switch to the normal workqueues that use a lot less resources, especially in the work_struct vs btrfs_work structures. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a31b4a4368d28c5e780f0906588fbd1dcfe4ad54 Author: Christoph Hellwig Date: Mon Apr 18 06:43:09 2022 +0200 btrfs: simplify WQ_HIGHPRI handling in struct btrfs_workqueue Just let the one caller that wants optional WQ_HIGHPRI handling allocate a separate btrfs_workqueue for that. This allows to rename struct __btrfs_workqueue to btrfs_workqueue, remove a pointer indirection and separate allocation for all btrfs_workqueue users and generally simplify the code. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit a7b8e39c922b894753a1edd305eedee0d4b3930f Author: Qu Wenruo Date: Fri Apr 1 19:23:31 2022 +0800 btrfs: raid56: enable subpage support for RAID56 Now the btrfs RAID56 infrastructure has migrated to use sector_ptr interface, it should be safe to enable subpage support for RAID56. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3907ce293d68c614ce64a77fad6fca04aac30d83 Author: Qu Wenruo Date: Fri Apr 1 19:23:30 2022 +0800 btrfs: raid56: make alloc_rbio_essential_pages() subpage compatible The non-compatible part is only the bitmap iteration part, now the bitmap size is extended to rbio::stripe_nsectors, not the old rbio::stripe_npages. Since we're here, also slightly improve the function by: - Rename @i to @stripe - Rename @bit to @sectornr - Move @page and @index into the inner loop Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d4e28d9b5f04d8d8d26fb5e81f0681db109e8b93 Author: Qu Wenruo Date: Fri Apr 1 19:23:29 2022 +0800 btrfs: raid56: make steal_rbio() subpage compatible Function steal_rbio() will take all the uptodate pages from the source rbio to destination rbio. With the new stripe_sectors[] array, we also need to do the extra check: - Check sector::flags to make sure the full page is uptodate Now we don't use PageUptodate flag for subpage cases to indicate if the page is uptodate. Instead we need to check all the sectors belong to the page to be sure about whether it's full page uptodate. So here we introduce a new helper, full_page_sectors_uptodate() to do the check. - Update rbio::stripe_sectors[] to use the new page pointer We only need to change the page pointer, no need to change anything else. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5fdb7afc6f94d5da88edc58910a42615fb1ca5ab Author: Qu Wenruo Date: Fri Apr 1 19:23:28 2022 +0800 btrfs: raid56: make set_bio_pages_uptodate() subpage compatible Unlike previous code, we can not directly set PageUptodate for stripe pages now. Instead we have to iterate through all the sectors and set SECTOR_UPTODATE flag there. Introduce a new helper find_stripe_sector(), to do the work. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ac26df8b3b02101056ca868109d2f24ed396bba8 Author: Qu Wenruo Date: Fri Apr 1 19:23:27 2022 +0800 btrfs: raid56: remove btrfs_raid_bio::bio_pages array The functionality is completely replaced by the new bio_sectors member, now it's time to remove the old member. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6346f6bf16a0fd76f5f50077c469fa8e88724996 Author: Qu Wenruo Date: Fri Apr 1 19:23:26 2022 +0800 btrfs: raid56: make raid56_add_scrub_pages() subpage compatible This requires one extra parameter @pgoff for the function. In the current code base, scrub is still one page per sector, thus the new parameter will always be 0. It needs the extra subpage scrub optimization code to fully take advantage. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f77183dc1f53b2f924e9ba3bd1602b585097ec3d Author: Qu Wenruo Date: Fri Apr 1 19:23:25 2022 +0800 btrfs: raid56: open code rbio_stripe_page_index() There is only one caller for that helper now, and we're definitely fine to open-code it. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1145059ae55f7dc1cc04a986ec770b0945236699 Author: Qu Wenruo Date: Fri Apr 1 19:23:24 2022 +0800 btrfs: raid56: make finish_rmw() subpage compatible With this function converted to subpage compatible sector interfaces, the following helper functions can be removed: - rbio_stripe_page() - rbio_pstripe_page() - rbio_qstripe_page() - page_in_rbio() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 07e4d3808047adf209ba59812eba96740c81c8ca Author: Qu Wenruo Date: Fri Apr 1 19:23:23 2022 +0800 btrfs: raid56: make __raid_recover_endio_io() subpage compatible This involves: - Use sector_ptr interface to grab the pointers - Add sector->pgoff to pointers[] - Rebuild data using sectorsize instead of PAGE_SIZE - Use memcpy() to replace copy_page() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 46900662d02f416fc49d21a4fe816df4b6507db1 Author: Qu Wenruo Date: Fri Apr 1 19:23:22 2022 +0800 btrfs: raid56: make finish_parity_scrub() subpage compatible The core is to convert direct page usage into sector_ptr usage, and use memcpy() to replace copy_page(). For pointers usage, we need to convert it to kmap_local_page() + sector->pgoff. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3e77605d6a81efd39278a5ca2ee57737eb2659d2 Author: Qu Wenruo Date: Fri Apr 1 19:23:21 2022 +0800 btrfs: raid56: make rbio_add_io_page() subpage compatible Make rbio_add_io_page() subpage compatible, which involves: - Rename rbio_add_io_page() to rbio_add_io_sector() Although we still rely on PAGE_SIZE == sectorsize, so add a new ASSERT() inside rbio_add_io_sector() to make sure all pgoff is 0. - Introduce rbio_stripe_sector() helper The equivalent of rbio_stripe_page(). This new helper has extra ASSERT()s to validate the stripe and sector number. - Introduce sector_in_rbio() helper The equivalent of page_in_rbio(). - Rename @pagenr variables to @sectornr - Use rbio::stripe_nsectors when iterating the bitmap Please note that, this only changes the interface, the bios are still using full page for IO. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 00425dd976d310484e8ad8b4e7c8720a606d4d78 Author: Qu Wenruo Date: Fri Apr 1 19:23:20 2022 +0800 btrfs: raid56: introduce btrfs_raid_bio::bio_sectors This new member is going to fully replace bio_pages in the future, but for now let's keep them co-exist, until the full switch is done. Currently cache_rbio_pages() and index_rbio_pages() will also populate the new array. And cache_rbio_pages() need to record which sectors are uptodate, so we also need to introduce sector_ptr::uptodate bit. To avoid extra memory usage, we let the new @uptodate bit to share bits with @pgoff. Now pgoff only has at most 31 bits, which is already more than enough, as even for 256K page size, we only need 18 bits. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit eb3570607c8c7c9263005c47c71edeb12fc9fbcd Author: Qu Wenruo Date: Fri Apr 1 19:23:19 2022 +0800 btrfs: raid56: introduce btrfs_raid_bio::stripe_sectors The new member is an array of sector_ptr pointers, they will represent all sectors inside a full stripe (including P/Q). They co-operate with btrfs_raid_bio::stripe_pages: stripe_pages: | Page 0, range [0, 64K) | Page 1 ... stripe_sectors: | | | ... | | | | \- sector 15, page 0, pgoff=60K | \- sector 1, page 0, pgoff=4K \---- sector 0, page 0, pfoff=0 With such structure, we can represent subpage sectors without using extra pages. Here we introduce a new helper, index_stripe_sectors(), to update stripe_sectors[] to point to correct page and pgoff. So every time rbio::stripe_pages[] pointer gets updated, the new helper should be called. The following functions have to call the new helper: - steal_rbio() - alloc_rbio_pages() - alloc_rbio_parity_pages() - alloc_rbio_essential_pages() Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 94efbe19b9f121e68625ac0edf0317075acc302e Author: Qu Wenruo Date: Fri Apr 1 19:23:18 2022 +0800 btrfs: raid56: introduce new cached members for btrfs_raid_bio The new members are all related to number of sectors, but the existing number of pages members are kept as is: - nr_sectors Total sectors of the full stripe including P/Q. - stripe_nsectors The sectors of a single stripe. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 29b068382c6fbc9abc0299783d64162d886e601b Author: Qu Wenruo Date: Fri Apr 1 19:23:17 2022 +0800 btrfs: raid56: make btrfs_raid_bio more compact There are a lot of members using much larger type in btrfs_raid_bio than necessary, like nr_pages which represents the total number of a full stripe. Instead of int (which is at least 32bits), u16 is already enough (max stripe length will be 256MiB, already beyond current RAID56 device number limit). So this patch will reduce the width of the following members: - stripe_len to u32 - nr_pages to u16 - nr_data to u8 - real_stripes to u8 - scrubp to u8 - faila/b to s8 As -1 is used to indicate no corruption This will slightly reduce the size of btrfs_raid_bio from 272 bytes to 256 bytes, reducing 16 bytes usage. But please note that, when using btrfs_raid_bio, we allocate extra space for it to cover various pointer array, so the reduce memory is not really a big saving overall. As we're here modifying the comments already, update existing comments to current code standard. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 843de58b3e317fc51d4a1643f3641401ecf1d941 Author: Qu Wenruo Date: Fri Apr 1 19:23:16 2022 +0800 btrfs: raid56: open code rbio_nr_pages() The function rbio_nr_pages() is only called once inside alloc_rbio(), there is no reason to make it dedicated helper. Furthermore, the return type doesn't match, the function return "unsigned long" which may not be necessary, while the only caller only uses "int". Since we're doing cleaning up here, also fix the type to "const unsigned int" for all involved local variables. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit cc353a8be2fd3e585c09f0eba23fa3ca1905f253 Author: Qu Wenruo Date: Tue Apr 12 17:32:51 2022 +0800 btrfs: reduce width for stripe_len from u64 to u32 Currently btrfs uses fixed stripe length (64K), thus u32 is wide enough for the usage. Furthermore, even in the future we choose to enlarge stripe length to larger values, I don't believe we would want stripe as large as 4G or larger. So this patch will reduce the width for all in-memory structures and parameters, this involves: - RAID56 related function argument lists This allows us to do direct division related to stripe_len. Although we will use bits shift to replace the division anyway. - btrfs_io_geometry structure This involves one change to simplify the calculation of both @stripe_nr and @stripe_offset, using div64_u64_rem(). And add extra sanity check to make sure @stripe_offset is always small enough for u32. This saves 8 bytes for the structure. - map_lookup structure This convert @stripe_len to u32, which saves 8 bytes. (saved 4 bytes, and removed a 4-bytes hole) Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit ad357938c6b4802c6f1f87c9a7811a33e240fa22 Author: Christoph Hellwig Date: Fri Apr 15 16:33:28 2022 +0200 btrfs: do not return errors from submit_bio_hook_t instances Both btrfs_repair_one_sector and submit_bio_one as the direct caller of one of the instances ignore errors as they expect the methods themselves to call ->bi_end_io on error. Remove the unused and dangerous return value. Reviewed-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit cb4411dd571c855fa593e308fc8348554831d078 Author: Christoph Hellwig Date: Fri Apr 15 16:33:27 2022 +0200 btrfs: do not return errors from btrfs_submit_compressed_read btrfs_submit_compressed_read already calls ->bi_end_io on error and the caller must ignore the return value, so remove it. Reviewed-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 94d9e11b27954de649ff8802b216b1ff20d845f7 Author: Christoph Hellwig Date: Fri Apr 15 16:33:26 2022 +0200 btrfs: do not return errors from btrfs_submit_metadata_bio btrfs_submit_metadata_bio already calls ->bi_end_io on error and the caller must ignore the return value, so remove it. Reviewed-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit abf48d5871b6935fcc5f23ea4997cd63a9046961 Author: Christoph Hellwig Date: Fri Apr 15 16:33:25 2022 +0200 btrfs: remove unused bio_flags argument to btrfs_submit_metadata_bio This argument is unused since commit 953651eb308f ("btrfs: factor out helper adding a page to bio") and commit 1b36294a6cd5 ("btrfs: call submit_bio_hook directly for metadata pages") reworked the way metadata bio submission is handled. Reviewed-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7aab8b32825eecd36ce8eef72dffd331724185da Author: Christoph Hellwig Date: Fri Apr 15 16:33:24 2022 +0200 btrfs: move btrfs_readpage to extent_io.c Keep btrfs_readpage next to btrfs_do_readpage and the other address space operations. This allows to keep submit_one_bio and struct btrfs_bio_ctrl file local in extent_io.c. Reviewed-by: Nikolay Borisov Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit d201238ccd2f30b9bfcfadaeae0972e3a486a176 Author: Qu Wenruo Date: Mon Feb 28 15:05:53 2022 +0800 btrfs: repair super block num_devices automatically [BUG] There is a report that a btrfs has a bad super block num devices. This makes btrfs to reject the fs completely. BTRFS error (device sdd3): super_num_devices 3 mismatch with num_devices 2 found here BTRFS error (device sdd3): failed to read chunk tree: -22 BTRFS error (device sdd3): open_ctree failed [CAUSE] During btrfs device removal, chunk tree and super block num devs are updated in two different transactions: btrfs_rm_device() |- btrfs_rm_dev_item(device) | |- trans = btrfs_start_transaction() | | Now we got transaction X | | | |- btrfs_del_item() | | Now device item is removed from chunk tree | | | |- btrfs_commit_transaction() | Transaction X got committed, super num devs untouched, | but device item removed from chunk tree. | (AKA, super num devs is already incorrect) | |- cur_devices->num_devices--; |- cur_devices->total_devices--; |- btrfs_set_super_num_devices() All those operations are not in transaction X, thus it will only be written back to disk in next transaction. So after the transaction X in btrfs_rm_dev_item() committed, but before transaction X+1 (which can be minutes away), a power loss happen, then we got the super num mismatch. This has been fixed by commit bbac58698a55 ("btrfs: remove device item and update super block in the same transaction"). [FIX] Make the super_num_devices check less strict, converting it from a hard error to a warning, and reset the value to a correct one for the current or next transaction commit. As the number of device items is the critical information where the super block num_devices is only a cached value (and also useful for cross checking), it's safe to automatically update it. Other device related problems like missing device are handled after that and may require other means to resolve, like degraded mount. With this fix, potentially affected filesystems won't fail mount and require the manual repair by btrfs check. Reported-by: Luca Béla Palkovics Link: https://lore.kernel.org/linux-btrfs/CA+8xDSpvdm_U0QLBAnrH=zqDq_cWCOH5TiV46CKmp3igr44okQ@mail.gmail.com/ CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 46fbd18e78fb2daec43b974f63bd1a9e771f3866 Author: Goldwyn Rodrigues Date: Wed Apr 13 21:11:07 2022 -0500 btrfs: do not pass compressed_bio to submit_compressed_bio() Parameter struct compressed_bio is not used by the function submit_compressed_bio(). Remove it. Signed-off-by: Goldwyn Rodrigues Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2306e83e730a86fbf6855d4611438d8632ad2e73 Author: Filipe Manana Date: Wed Apr 13 16:20:43 2022 +0100 btrfs: avoid double search for block group during NOCOW writes When doing a NOCOW write, either through direct IO or buffered IO, we do two lookups for the block group that contains the target extent: once when we call btrfs_inc_nocow_writers() and then later again when we call btrfs_dec_nocow_writers() after creating the ordered extent. The lookups require taking a lock and navigating the red black tree used to track all block groups, which can take a non-negligible amount of time for a large filesystem with thousands of block groups, as well as lock contention and cache line bouncing. Improve on this by having a single block group search: making btrfs_inc_nocow_writers() return the block group to its caller and then have the caller pass that block group to btrfs_dec_nocow_writers(). This is part of a patchset comprised of the following patches: btrfs: remove search start argument from first_logical_byte() btrfs: use rbtree with leftmost node cached for tracking lowest block group btrfs: use a read/write lock for protecting the block groups tree btrfs: return block group directly at btrfs_next_block_group() btrfs: avoid double search for block group during NOCOW writes The following test was used to test these changes from a performance perspective: $ cat test.sh #!/bin/bash modprobe null_blk nr_devices=0 NULL_DEV_PATH=/sys/kernel/config/nullb/nullb0 mkdir $NULL_DEV_PATH if [ $? -ne 0 ]; then echo "Failed to create nullb0 directory." exit 1 fi echo 2 > $NULL_DEV_PATH/submit_queues echo 16384 > $NULL_DEV_PATH/size # 16G echo 1 > $NULL_DEV_PATH/memory_backed echo 1 > $NULL_DEV_PATH/power DEV=/dev/nullb0 MNT=/mnt/nullb0 LOOP_MNT="$MNT/loop" MOUNT_OPTIONS="-o ssd -o nodatacow" MKFS_OPTIONS="-R free-space-tree -O no-holes" cat < /tmp/fio-job.ini [io_uring_writes] rw=randwrite fsync=0 fallocate=posix group_reporting=1 direct=1 ioengine=io_uring iodepth=64 bs=64k filesize=1g runtime=300 time_based directory=$LOOP_MNT numjobs=8 thread EOF echo performance | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor echo echo "Using config:" echo cat /tmp/fio-job.ini echo umount $MNT &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV &> /dev/null mount $MOUNT_OPTIONS $DEV $MNT mkdir $LOOP_MNT truncate -s 4T $MNT/loopfile mkfs.btrfs -f $MKFS_OPTIONS $MNT/loopfile &> /dev/null mount $MOUNT_OPTIONS $MNT/loopfile $LOOP_MNT # Trigger the allocation of about 3500 data block groups, without # actually consuming space on underlying filesystem, just to make # the tree of block group large. fallocate -l 3500G $LOOP_MNT/filler fio /tmp/fio-job.ini umount $LOOP_MNT umount $MNT echo 0 > $NULL_DEV_PATH/power rmdir $NULL_DEV_PATH The test was run on a non-debug kernel (Debian's default kernel config), the result were the following. Before patchset: WRITE: bw=1455MiB/s (1526MB/s), 1455MiB/s-1455MiB/s (1526MB/s-1526MB/s), io=426GiB (458GB), run=300006-300006msec After patchset: WRITE: bw=1503MiB/s (1577MB/s), 1503MiB/s-1503MiB/s (1577MB/s-1577MB/s), io=440GiB (473GB), run=300006-300006msec +3.3% write throughput and +3.3% IO done in the same time period. The test has somewhat limited coverage scope, as with only NOCOW writes we get less contention on the red black tree of block groups, since we don't have the extra contention caused by COW writes, namely when allocating data extents, pinning and unpinning data extents, but on the hand there's access to tree in the NOCOW path, when incrementing a block group's number of NOCOW writers. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 8b01f931c140a943e837d86a9b82f0910629492e Author: Filipe Manana Date: Wed Apr 13 16:20:42 2022 +0100 btrfs: return block group directly at btrfs_next_block_group() At btrfs_next_block_group(), we have this long line with two statements: cache = btrfs_lookup_first_block_group(...); return cache; This makes it a bit harder to read due to two statements on the same line, so change that to directly return the result of the call to btrfs_lookup_first_block_group(). Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 16b0c2581e3a81e88872ff054fca8d8f5a92ca5e Author: Filipe Manana Date: Wed Apr 13 16:20:41 2022 +0100 btrfs: use a read/write lock for protecting the block groups tree Currently we use a spin lock to protect the red black tree that we use to track block groups. Most accesses to that tree are actually read only and for large filesystems, with thousands of block groups, it actually has a bad impact on performance, as concurrent read only searches on the tree are serialized. Read only searches on the tree are very frequent and done when: 1) Pinning and unpinning extents, as we need to lookup the respective block group from the tree; 2) Freeing the last reference of a tree block, regardless if we pin the underlying extent or add it back to free space cache/tree; 3) During NOCOW writes, both buffered IO and direct IO, we need to check if the block group that contains an extent is read only or not and to increment the number of NOCOW writers in the block group. For those operations we need to search for the block group in the tree. Similarly, after creating the ordered extent for the NOCOW write, we need to decrement the number of NOCOW writers from the same block group, which requires searching for it in the tree; 4) Decreasing the number of extent reservations in a block group; 5) When allocating extents and freeing reserved extents; 6) Adding and removing free space to the free space tree; 7) When releasing delalloc bytes during ordered extent completion; 8) When relocating a block group; 9) During fitrim, to iterate over the block groups; 10) etc; Write accesses to the tree, to add or remove block groups, are much less frequent as they happen only when allocating a new block group or when deleting a block group. We also use the same spin lock to protect the list of currently caching block groups. Additions to this list are made when we need to cache a block group, because we don't have a free space cache for it (or we have but it's invalid), and removals from this list are done when caching of the block group's free space finishes. These cases are also not very common, but when they happen, they happen only once when the filesystem is mounted. So switch the lock that protects the tree of block groups from a spinning lock to a read/write lock. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 08dddb2951c96b53413cf1982e9358fa4c123183 Author: Filipe Manana Date: Wed Apr 13 16:20:40 2022 +0100 btrfs: use rbtree with leftmost node cached for tracking lowest block group We keep track of the start offset of the block group with the lowest start offset at fs_info->first_logical_byte. This requires explicitly updating that field every time we add, delete or lookup a block group to/from the red black tree at fs_info->block_group_cache_tree. Since the block group with the lowest start address happens to always be the one that is the leftmost node of the tree, we can use a red black tree that caches the left most node. Then when we need the start address of that block group, we can just quickly get the leftmost node in the tree and extract the start offset of that node's block group. This avoids the need to explicitly keep track of that address in the dedicated member fs_info->first_logical_byte, and it also allows the next patch in the series to switch the lock that protects the red black tree from a spin lock to a read/write lock - without this change it would be tricky because block group searches also update fs_info->first_logical_byte. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0eb997bff001ef53cd4d920762d0ed753b36fecd Author: Filipe Manana Date: Wed Apr 13 16:20:39 2022 +0100 btrfs: remove search start argument from first_logical_byte() The search start argument passed to first_logical_byte() is always 0, as we always want to get the logical start address of the block group with the lowest logical start address. So remove it, as not only it is not necessary, it also makes the following patches that change the lock that protects the red black tree of block groups from a spin lock to a read/write lock. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 44e5801fada6925d2bba1987c7b59cbcc9d0d592 Author: Qu Wenruo Date: Tue Apr 12 20:30:15 2022 +0800 btrfs: return correct error number for __extent_writepage_io() [BUG] If we hit an error from submit_extent_page() inside __extent_writepage_io(), we could still return 0 to the caller, and even trigger the warning in btrfs_page_assert_not_dirty(). [CAUSE] In __extent_writepage_io(), if we hit an error from submit_extent_page(), we will just clean up the range and continue. This is completely fine for regular PAGE_SIZE == sectorsize, as we can only hit one sector in one page, thus after the error we're ensured to exit and @ret will be saved. But for subpage case, we may have other dirty subpage range in the page, and in the next loop, we may succeeded submitting the next range. In that case, @ret will be overwritten, and we return 0 to the caller, while we have hit some error. [FIX] Introduce @has_error and @saved_ret to record the first error we hit, so we will never forget what error we hit. CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 10f7f6f879c28f8368d6516ab1ccf3517a1f5d3d Author: Qu Wenruo Date: Tue Apr 12 20:30:14 2022 +0800 btrfs: fix the error handling for submit_extent_page() for btrfs_do_readpage() [BUG] Test case generic/475 have a very high chance (almost 100%) to hit a fs hang, where a data page will never be unlocked and hang all later operations. [CAUSE] In btrfs_do_readpage(), if we hit an error from submit_extent_page() we will try to do the cleanup for our current io range, and exit. This works fine for PAGE_SIZE == sectorsize cases, but not for subpage. For subpage btrfs_do_readpage() will lock the full page first, which can contain several different sectors and extents: btrfs_do_readpage() |- begin_page_read() | |- btrfs_subpage_start_reader(); | Now the page will have PAGE_SIZE / sectorsize reader pending, | and the page is locked. | |- end_page_read() for different branches | This function will reduce subpage readers, and when readers | reach 0, it will unlock the page. But when submit_extent_page() failed, we only cleanup the current io range, while the remaining io range will never be cleaned up, and the page remains locked forever. [FIX] Update the error handling of submit_extent_page() to cleanup all the remaining subpage range before exiting the loop. Please note that, now submit_extent_page() can only fail due to sanity check in alloc_new_bio(). Thus regular IO errors are impossible to trigger the error path. CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit c9583ada8cc421c12d23c83c6f8c958e4dd3dd2b Author: Qu Wenruo Date: Tue Apr 12 20:30:13 2022 +0800 btrfs: avoid double clean up when submit_one_bio() failed [BUG] When running generic/475 with 64K page size and 4K sector size, it has a very high chance (almost 100%) to hang, with mostly data page locked but no one is going to unlock it. [CAUSE] With commit 1784b7d502a9 ("btrfs: handle csum lookup errors properly on reads"), if we failed to lookup checksum due to metadata IO error, we will return error for btrfs_submit_data_bio(). This will cause the page to be unlocked twice in btrfs_do_readpage(): btrfs_do_readpage() |- submit_extent_page() | |- submit_one_bio() | |- btrfs_submit_data_bio() | |- if (ret) { | |- bio->bi_status = ret; | |- bio_endio(bio); } | In the endio function, we will call end_page_read() | and unlock_extent() to cleanup the subpage range. | |- if (ret) { |- unlock_extent(); end_page_read() } Here we unlock the extent and cleanup the subpage range again. For unlock_extent(), it's mostly double unlock safe. But for end_page_read(), it's not, especially for subpage case, as for subpage case we will call btrfs_subpage_end_reader() to reduce the reader number, and use that to number to determine if we need to unlock the full page. If double accounted, it can underflow the number and leave the page locked without anyone to unlock it. [FIX] The commit 1784b7d502a9 ("btrfs: handle csum lookup errors properly on reads") itself is completely fine, it's our existing code not properly handling the error from bio submission hook properly. This patch will make submit_one_bio() to return void so that the callers will never be able to do cleanup when bio submission hook fails. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit dd7382a2a7da91a475703810a87a80d6eae14645 Author: Schspa Shi Date: Mon Apr 11 23:55:41 2022 +0800 btrfs: use non-bh spin_lock in zstd timer callback This is an optimization for fix fee13fe96529 ("btrfs: correct zstd workspace manager lock to use spin_lock_bh()") The critical region for wsm.lock is only accessed by the process context and the softirq context. Because in the soft interrupt, the critical section will not be preempted by the soft interrupt again, there is no need to call spin_lock_bh(&wsm.lock) to turn off the soft interrupt, spin_lock(&wsm.lock) is enough for this situation. Signed-off-by: Schspa Shi [ minor comment update ] Signed-off-by: David Sterba commit 490243884e02676dfd875382cfb58077d71a3b4e Author: Filipe Manana Date: Wed Apr 13 16:20:21 2022 +0100 btrfs: use BTRFS_DIR_START_INDEX at btrfs_create_new_inode() We are still using the magic value of 2 at btrfs_create_new_inode(), but there's now a constant for that, named BTRFS_DIR_START_INDEX, which was introduced in commit 528ee697126fd ("btrfs: put initial index value of a directory in a constant"). So change that to use the constant. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit c0111c44174a82f81c89ea79e70f2e95ba42c73f Author: Qu Wenruo Date: Mon Mar 21 13:48:42 2022 +0800 btrfs: simplify parameters of submit_read_repair() and rename Cleanup the function submit_read_repair() by: - Remove the fixed argument submit_bio_hook() The function is only called on buffered data read path, so the @submit_bio_hook argument is always btrfs_submit_data_bio(). Since it's fixed, then there is no need to pass that argument at all. - Rename the function to submit_data_read_repair() Just to be more explicit on all the 3 things, data, read and repair. Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8e010b3d7043e61fc0bbfe27a57dad674eef7340 Author: Christoph Hellwig Date: Thu Mar 24 17:52:09 2022 +0100 btrfs: remove the zoned/zone_size union in struct btrfs_fs_info Reading a value from a different member of a union is not just a great way to obfuscate code, but also creates an aliasing violation. Switch btrfs_is_zoned to look at ->zone_size and remove the union. Note: union was to simplify the detection of zoned filesystem but now this is wrapped behind btrfs_is_zoned so we can drop the union. Reviewed-by: Johannes Thumshirn Reviewed-by: Naohiro Aota Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba [ add note ] Signed-off-by: David Sterba commit 8aa1e49ea1fdcc585be4bcfe8c62684a087cc7c6 Author: Lv Ruyi Date: Mon Apr 11 03:22:52 2022 +0000 btrfs: remove unnecessary check of iput argument iput() already handles NULL and non-NULL parameter, so it is not needed to check that. This unifies all iput calls. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: David Sterba Signed-off-by: David Sterba commit b027669449390ed549579f0a838c2de6a037dea6 Author: Christoph Hellwig Date: Mon Apr 4 06:45:28 2022 +0200 btrfs: stop using the btrfs_bio saved iter in index_rbio_pages The bios added to ->bio_list are the original bios fed into btrfs_map_bio, which are never advanced. Just use the iter in the bio itself. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 75c17e6666c577d01aef8dffdf0231140abdd6c4 Author: Christoph Hellwig Date: Mon Apr 4 06:45:27 2022 +0200 btrfs: don't allocate a btrfs_bio for scrub bios All the scrub bios go straight to the block device or the raid56 code, none of which looks at the btrfs_bio. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e1b4b44e005e2eeef63081fe0a79a6271f81fce4 Author: Christoph Hellwig Date: Mon Apr 4 06:45:26 2022 +0200 btrfs: don't allocate a btrfs_bio for raid56 per-stripe bios Except for the spurious initialization of ->device just after allocation nothing uses the btrfs_bio, so just allocate a normal bio without extra data. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e01bf588f8bc0ba1e4c53b1240e97a12782a906a Author: Christoph Hellwig Date: Mon Apr 4 06:45:25 2022 +0200 btrfs: pass bio opf to rbio_add_io_page Prepare for further refactoring by moving this initialization to a single place instead of setting it in the callers. Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 110ac0e5433425752c0a0d6423489023e6ba7a6d Author: Christoph Hellwig Date: Mon Apr 4 06:45:24 2022 +0200 btrfs: pass a block_device to btrfs_bio_clone Pass the block_device to bio_alloc_clone instead of setting it later. Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit fce3f24ada5527a5266b7c878ae82a24e6f730e3 Author: Christoph Hellwig Date: Mon Apr 4 06:45:23 2022 +0200 btrfs: move the call to bio_set_dev out of submit_stripe_bio Prepare for additional refactoring, btrfs_map_bio is direct caller of submit_stripe_bio. Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit f77dcc0d64d6b2a6cca81933fec1c17241ea572b Author: Christoph Hellwig Date: Mon Apr 4 06:45:22 2022 +0200 btrfs: use on-stack bio in scrub_repair_page_from_good_copy The I/O in repair_io_failue is synchronous and doesn't need a btrfs_bio, so just use an on-stack bio. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit f3b8a7f3fbc8e1ab27dfc5c47ebe3327b92fe2ed Author: Christoph Hellwig Date: Mon Apr 4 06:45:21 2022 +0200 btrfs: use on-stack bio in scrub_recheck_block The I/O in repair_io_failue is synchronous and doesn't need a btrfs_bio, so just use an on-stack bio. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit e9458bfe5fff9588096a9f4e8975be762e313af4 Author: Christoph Hellwig Date: Mon Apr 4 06:45:20 2022 +0200 btrfs: use on-stack bio in repair_io_failure The I/O in repair_io_failue is synchronous and doesn't need a btrfs_bio, so just use an on-stack bio. Also cleanup the error handling to use goto labels and not discard the actual return values. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 91e3b5f1e293a2e617313a85bafd80d5eb4810f1 Author: Christoph Hellwig Date: Mon Apr 4 06:45:19 2022 +0200 btrfs: check-integrity: simplify bio allocation in btrfsic_read_block btrfsic_read_block does not need the btrfs_bio structure, so switch to plain bio_alloc (that also does not fail as it's backed by a bioset). Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 58ff51f148ec498758d66c226cb2f7a065b36478 Author: Christoph Hellwig Date: Mon Apr 4 06:45:18 2022 +0200 btrfs: check-integrity: split submit_bio from btrfsic checking Require a separate call to the integrity checking helpers from the actual bio submission. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 57906d58e2b5a109d30be8e27c88c2648caea2a9 Author: Christoph Hellwig Date: Mon Apr 4 06:45:17 2022 +0200 btrfs: factor check and flush helpers from __btrfsic_submit_bio Split out two helpers to make __btrfsic_submit_bio more readable. Reviewed-by: Qu Wenruo Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3687fcb0752ac9c4630b4aeb5362c6e6f81c528e Author: Johannes Thumshirn Date: Tue Mar 29 01:56:09 2022 -0700 btrfs: zoned: make auto-reclaim less aggressive The current auto-reclaim algorithm starts reclaiming all block groups with a zone_unusable value above a configured threshold. This is causing a lot of reclaim IO even if there would be enough free zones on the device. Instead of only accounting a block groups zone_unusable value, also take the ratio of free and not usable (written as well as zone_unusable) bytes a device has into account. Tested-by: Pankaj Raghav Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit ef972e7b5edeec9ed5213476186ceae5798b01e8 Author: Josef Bacik Date: Tue Mar 29 01:56:08 2022 -0700 btrfs: change the bg_reclaim_threshold valid region from 0 to 100 For the non-zoned case we may want to set the threshold for reclaim to something below 50%. Change the acceptable threshold from 50-100 to 0-100. Tested-by: Pankaj Raghav Signed-off-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit ac2f1e63c65c695b6134f40a078cf82df627e188 Author: Josef Bacik Date: Tue Mar 29 01:56:07 2022 -0700 btrfs: allow block group background reclaim for non-zoned filesystems This will allow us to set a threshold for block groups to be automatically relocated even if we don't have zoned devices. We have found this feature invaluable at Facebook due to how our workload interacts with the allocator. We have been using this in production for months with only a single problem that has already been fixed. Tested-by: Pankaj Raghav Signed-off-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit bb5a098d9791f184899499531ff4411089e2a5e0 Author: Josef Bacik Date: Tue Mar 29 01:56:06 2022 -0700 btrfs: make the bg_reclaim_threshold per-space info For non-zoned file systems it's useful to have the auto reclaim feature, however there are different use cases for non-zoned, for example we may not want to reclaim metadata chunks ever, only data chunks. Move this sysfs flag to per-space_info. This won't affect current users because this tunable only ever did anything for zoned, and that is currently hidden behind BTRFS_CONFIG_DEBUG. Tested-by: Pankaj Raghav Signed-off-by: Josef Bacik [ jth restore global bg_reclaim_threshold ] Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit a7bb6bd4bd7ff0440f238deb3510a1037a26f7bc Author: Filipe Manana Date: Wed Mar 30 15:31:07 2022 +0100 btrfs: do not test for free space inode during NOCOW check against file extent When checking if we can do a NOCOW write against a range covered by a file extent item, we do a quick a check to determine if the inode's root was snapshotted in a generation older than the generation of the file extent item or not. This is to quickly determine if the extent is likely shared and avoid the expensive check for cross references (this was added in commit 78d4295b1eeed4 ("btrfs: lift some btrfs_cross_ref_exist checks in nocow path"). We restrict that check to the case where the inode is not a free space inode (since commit 27a7ff554e8d34 ("btrfs: skip file_extent generation check for free_space_inode in run_delalloc_nocow")). That is because when we had the inode cache feature, inode caches were backed by a free space inode that belonged to the inode's root. However we don't have support for the inode cache feature since kernel 5.11, so we don't need this check anymore since free space inodes are now always related to free space caches, which are always associated to the root tree (which can't be snapshotted, and its last_snapshot field is always 0). So remove that condition. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 619104ba453ad0965660d643f64ffbeb721906f5 Author: Filipe Manana Date: Wed Mar 30 15:31:06 2022 +0100 btrfs: move common NOCOW checks against a file extent into a helper Verifying if we can do a NOCOW write against a range fully or partially covered by a file extent item requires verifying several constraints, and these are currently duplicated at two different places: can_nocow_extent() and run_delalloc_nocow(). This change moves those checks into a common helper function to avoid duplication. It adds some comments and also preserves all existing behaviour like for example can_nocow_extent() treating errors from the calls to btrfs_cross_ref_exist() and csum_exist_in_range() as meaning we can not NOCOW, instead of propagating the error back to the caller. That specific behaviour is questionable but also reasonable to some degree. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 395cb57e85604715110bc28bd51bdf532394b68d Author: Sweet Tea Dorminy Date: Wed Apr 6 14:24:18 2022 -0400 btrfs: wait between incomplete batch memory allocations When allocating memory in a loop, each iteration should call memalloc_retry_wait() in order to prevent starving memory-freeing processes (and to mark where allocation loops are). Other filesystems do that as well. The bulk page allocation is the only place in btrfs with an allocation retry loop, so add an appropriate call to it. Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba commit 91d6ac1d62c3dc0f102986318f4027ccfa22c638 Author: Sweet Tea Dorminy Date: Wed Mar 30 16:11:23 2022 -0400 btrfs: allocate page arrays using bulk page allocator While calling alloc_page() in a loop is an effective way to populate an array of pages, the MM subsystem provides a method to allocate pages in bulk. alloc_pages_bulk_array() populates the NULL slots in a page array, trying to grab more than one page at a time. Unfortunately, it doesn't guarantee allocating all slots in the array, but it's easy to call it in a loop and return an error if no progress occurs. Reviewed-by: Nikolay Borisov Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba commit dd137dd1f2d719682b522d4eabe6dec461b7d6fa Author: Sweet Tea Dorminy Date: Wed Mar 30 16:11:22 2022 -0400 btrfs: factor out allocating an array of pages Several functions currently populate an array of page pointers one allocated page at a time. Factor out the common code so as to allow improvements to all of the sites at once. Reviewed-by: Nikolay Borisov Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0d031dc4aa05819beb8b9188f4306a3f2bc17f55 Author: Yu Zhe Date: Thu Mar 31 03:34:08 2022 -0700 btrfs: remove unnecessary type casts Explicit type casts are not necessary when it's void* to another pointer type. Signed-off-by: Yu Zhe Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1a42daab11d39f567bb2c6b2b7e551e73abb3512 Author: Qu Wenruo Date: Thu Jan 13 13:22:10 2022 +0800 btrfs: expand subpage support to any PAGE_SIZE > 4K With the recent change in metadata handling, we can handle metadata in the following cases: - nodesize < PAGE_SIZE and sectorsize < PAGE_SIZE Go subpage routine for both metadata and data. - nodesize < PAGE_SIZE and sectorsize >= PAGE_SIZE Invalid case for now. As we require nodesize >= sectorsize. - nodesize >= PAGE_SIZE and sectorsize < PAGE_SIZE Go subpage routine for data, but regular page routine for metadata. - nodesize >= PAGE_SIZE and sectorsize >= PAGE_SIZE Go regular page routine for both metadata and data. Now we can handle any sectorsize < PAGE_SIZE, plus the existing sectorsize == PAGE_SIZE support. But here we introduce an artificial limit, any PAGE_SIZE > 4K case, we will only support 4K and PAGE_SIZE as sector size. The idea here is to reduce the test combinations, and push 4K as the default standard in the future. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit fbca46eb46ecc4443137e58cf9802a888c9ca136 Author: Qu Wenruo Date: Thu Jan 13 13:22:09 2022 +0800 btrfs: make nodesize >= PAGE_SIZE case to reuse the non-subpage routine The reason why we only support 64K page size for subpage is, for 64K page size we can ensure no matter what the nodesize is, we can fit it into one page. When other page size come, especially like 16K, the limitation is a bit limiting. To remove such limitation, we allow nodesize >= PAGE_SIZE case to go the non-subpage routine. By this, we can allow 4K sectorsize on 16K page size. Although this introduces another smaller limitation, the metadata can not cross page boundary, which is already met by most recent mkfs. Another small improvement is, we can avoid the overhead for metadata if nodesize >= PAGE_SIZE. For 4K sector size and 64K page size/node size, or 4K sector size and 16K page size/node size, we don't need to allocate extra memory for the metadata pages. Please note that, this patch will not yet enable other page size support yet. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit e959d3c1df3aad22d6904719162ac5668b18541c Author: Qu Wenruo Date: Thu Jan 13 13:22:08 2022 +0800 btrfs: use dummy extent buffer for super block sys chunk array read In function btrfs_read_sys_array(), we allocate a real extent buffer using btrfs_find_create_tree_block(). Such extent buffer will be even cached into buffer_radix tree, and using btree inode address space. However we only use such extent buffer to enable the accessors, thus we don't even need to bother using real extent buffer, a dummy one is what we really need. And for dummy extent buffer, we no longer need to do any special handling for the first page, as subpage helper is already doing it properly. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0320b3538b2b819c24daa699a26aa184f3d3cc6c Author: Naohiro Aota Date: Tue Mar 29 15:56:00 2022 +0900 btrfs: assert that relocation is protected with sb_start_write() Relocation of a data block group creates ordered extents. They can cause a hang when a process is trying to thaw the filesystem. We should have called sb_start_write(), so the filesystem is not being frozen. Add an ASSERT to check it is protected. Reviewed-by: Filipe Manana Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7f8d12ea96352275c2850c24a1367166179392d2 Author: Naohiro Aota Date: Tue Mar 29 15:55:59 2022 +0900 fs: add a lockdep check function for sb_start_write() Add a function sb_write_started() to allow callers to verify if sb_start_write() is properly called. It will be used for assertion in btrfs. Reviewed-by: Filipe Manana Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba commit d864546231e051e33e200025e4a6988b996f2654 Author: Nikolay Borisov Date: Wed Mar 30 12:14:07 2022 +0300 btrfs: simplify code flow in btrfs_ioctl_balance Move code in btrfs_ioctl_balance to simplify its flow. This is possible thanks to the removal of balance v1 ioctl and ensuring 'arg' argument is always present. First move the code duplicating the userspace arg to the kernel 'barg'. This makes the out_unlock label redundant. Secondly, check the validity of bargs::flags before copying to the dynamically allocated 'bctl'. This removes the need for the out_bctl label. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 398646011e3ce53409afda64bc2024d967e83880 Author: Nikolay Borisov Date: Wed Mar 30 12:14:06 2022 +0300 btrfs: remove checks for arg argument in btrfs_ioctl_balance With the removal of balance v1 ioctl the 'arg' argument is guaranteed to be present so simply remove all conditional code which checks for its presence. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit b06660b59545f5c2a5c7f12fabaad73f9c6e2e33 Author: Qu Wenruo Date: Fri Mar 25 17:37:59 2022 +0800 btrfs: replace memset with memzero_page in data checksum verification The original code resets the page to 0x1 for not apparent reason, it's been like that since the initial 2007 code added in commit 07157aacb1ec ("Btrfs: Add file data csums back in via hooks in the extent map code"). It could mean that a failed buffer can be detected from the data but that's just a guess and any value is good. Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit d4135134ab8feb994369d44884733e8031b0f800 Author: Filipe Manana Date: Wed Mar 23 16:19:30 2022 +0000 btrfs: avoid blocking on space revervation when doing nowait dio writes When doing a NOWAIT direct IO write, if we can NOCOW then it means we can proceed with the non-blocking, NOWAIT path. However reserving the metadata space and qgroup meta space can often result in blocking - flushing delalloc, wait for ordered extents to complete, trigger transaction commits, etc, going against the semantics of a NOWAIT write. So make the NOWAIT write path to try to reserve all the metadata it needs without resulting in a blocking behaviour - if we get -ENOSPC or -EDQUOT then return -EAGAIN to make the caller fallback to a blocking direct IO write. This is part of a patchset comprised of the following patches: btrfs: avoid blocking on page locks with nowait dio on compressed range btrfs: avoid blocking nowait dio when locking file range btrfs: avoid double nocow check when doing nowait dio writes btrfs: stop allocating a path when checking if cross reference exists btrfs: free path at can_nocow_extent() before checking for checksum items btrfs: release path earlier at can_nocow_extent() btrfs: avoid blocking when allocating context for nowait dio read/write btrfs: avoid blocking on space revervation when doing nowait dio writes The following test was run before and after applying this patchset: $ cat io-uring-nodatacow-test.sh #!/bin/bash DEV=/dev/sdc MNT=/mnt/sdc MOUNT_OPTIONS="-o ssd -o nodatacow" MKFS_OPTIONS="-R free-space-tree -O no-holes" NUM_JOBS=4 FILE_SIZE=8G RUN_TIME=300 cat < /tmp/fio-job.ini [io_uring_rw] rw=randrw fsync=0 fallocate=posix group_reporting=1 direct=1 ioengine=io_uring iodepth=64 bssplit=4k/20:8k/20:16k/20:32k/10:64k/10:128k/5:256k/5:512k/5:1m/5 filesize=$FILE_SIZE runtime=$RUN_TIME time_based filename=foobar directory=$MNT numjobs=$NUM_JOBS thread EOF echo performance | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor umount $MNT &> /dev/null mkfs.btrfs -f $MKFS_OPTIONS $DEV &> /dev/null mount $MOUNT_OPTIONS $DEV $MNT fio /tmp/fio-job.ini umount $MNT The test was run a 12 cores box with 64G of ram, using a non-debug kernel config (Debian's default config) and a spinning disk. Result before the patchset: READ: bw=407MiB/s (427MB/s), 407MiB/s-407MiB/s (427MB/s-427MB/s), io=119GiB (128GB), run=300175-300175msec WRITE: bw=407MiB/s (427MB/s), 407MiB/s-407MiB/s (427MB/s-427MB/s), io=119GiB (128GB), run=300175-300175msec Result after the patchset: READ: bw=436MiB/s (457MB/s), 436MiB/s-436MiB/s (457MB/s-457MB/s), io=128GiB (137GB), run=300044-300044msec WRITE: bw=435MiB/s (456MB/s), 435MiB/s-435MiB/s (456MB/s-456MB/s), io=128GiB (137GB), run=300044-300044msec That's about +7.2% throughput for reads and +6.9% for writes. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 4f208dcc6bf572fbe8178cfea703f139803863ba Author: Filipe Manana Date: Wed Mar 23 16:19:29 2022 +0000 btrfs: avoid blocking when allocating context for nowait dio read/write When doing a NOWAIT direct IO read/write, we allocate a context object (struct btrfs_dio_data) with GFP_NOFS, which can result in blocking waiting for memory allocation (GFP_NOFS is __GFP_RECLAIM | __GFP_IO). This is undesirable for the NOWAIT semantics, so do the allocation with GFP_NOWAIT if we are serving a NOWAIT request and if the allocation fails return -EAGAIN, so that the caller can fallback to a blocking context and retry with a non-blocking write. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 59d35c5171e65f3a208b6f44d028278f129bdeab Author: Filipe Manana Date: Wed Mar 23 16:19:28 2022 +0000 btrfs: release path earlier at can_nocow_extent() At can_nocow_extent(), we are releasing the path only after checking if the block group that has the target extent is read only, and after checking if there's delalloc in the range in case our extent is a preallocated extent. The read only extent check can be expensive if we have a very large filesystem with many block groups, as well as the check for delalloc in the inode's io_tree in case the io_tree is big due to IO on other file ranges. Our path is holding a read lock on a leaf and there's no need to keep the lock while doing those two checks, so release the path before doing them, immediately after the last use of the leaf. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit c1a548db25c3bafed0b8519cf2f41c6e44bc5dc4 Author: Filipe Manana Date: Wed Mar 23 16:19:27 2022 +0000 btrfs: free path at can_nocow_extent() before checking for checksum items When we look for checksum items, through csum_exist_in_range(), at can_nocow_extent(), we no longer need the path that we have previously allocated. Through csum_exist_in_range() -> btrfs_lookup_csums_range(), we also end up allocating a path, so we are adding unnecessary extra memory usage. So free the path before calling csum_exist_in_range(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1a89f1738684cac05b4bbea80dd77e8f15176d3a Author: Filipe Manana Date: Wed Mar 23 16:19:26 2022 +0000 btrfs: stop allocating a path when checking if cross reference exists At btrfs_cross_ref_exist() we always allocate a path, but we really don't need to because all its callers (only 2) already have an allocated path that is not being used when they call btrfs_cross_ref_exist(). So change btrfs_cross_ref_exist() to take a path as an argument and update both its callers to pass in the unused path they have when they call btrfs_cross_ref_exist(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit d7a8ab4e9b889de6daddbb674460e42b86d5dccf Author: Filipe Manana Date: Wed Mar 23 16:19:25 2022 +0000 btrfs: avoid double nocow check when doing nowait dio writes When doing a NOWAIT direct IO write we are checking twice if we can COW into the target file range using can_nocow_extent() - once at the very beginning of the write path, at btrfs_write_check() via check_nocow_nolock(), and later again at btrfs_get_blocks_direct_write(). The can_nocow_extent() function does a lot of expensive things - searching for the file extent item in the inode's subvolume tree, searching for the extent item in the extent tree, checking delayed references, etc, so it isn't a very cheap call. We can remove the first check at btrfs_write_check(), and add there a quick check to verify if the inode has the NODATACOW or PREALLOC flags, and quickly bail out if it doesn't have neither of those flags, as that means we have to COW and therefore can't comply with the NOWAIT semantics. After this we do only one call to can_nocow_extent(), while we are at btrfs_get_blocks_direct_write(), where we have already locked the file range and we did a try lock on the range before, at btrfs_dio_iomap_begin() (since the previous patch in the series). Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 59094403444089343dd21ac32b30a936518b7e1a Author: Filipe Manana Date: Wed Mar 23 16:19:24 2022 +0000 btrfs: avoid blocking nowait dio when locking file range If we are doing a NOWAIT direct IO read/write, we can block when locking the file range at btrfs_dio_iomap_begin(), as it's possible the range (or a part of it) is already locked by another task (mmap writes, another direct IO read/write racing with us, fiemap, etc). We are also waiting for completion of any ordered extent we find in the range, which also can block us for a significant amount of time. There's also the incorrect fallback to buffered IO (returning -ENOTBLK) when we are dealing with a NOWAIT request and we can't proceed. In this case we should be returning -EAGAIN, as falling back to buffered IO can result in blocking for many different reasons, so that the caller can delegate a retry to a context where blocking is more acceptable. Fix these cases by: 1) Doing a try lock on the file range and failing with -EAGAIN if we can not lock right away; 2) Fail with -EAGAIN if we find an ordered extent; 3) Return -EAGAIN instead of -ENOTBLK when we need to fallback to buffered IO and we have a NOWAIT request. This will also allow us to avoid a duplicated check that verifies if we are able to do a NOCOW write for NOWAIT direct IO writes, done in the next patch. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b023e67512accd01d6daadb0244b3b430f3b2b6e Author: Filipe Manana Date: Wed Mar 23 16:19:23 2022 +0000 btrfs: avoid blocking on page locks with nowait dio on compressed range If we are doing NOWAIT direct IO read/write and our inode has compressed extents, we call filemap_fdatawrite_range() against the range in order to wait for compressed writeback to complete, since the generic code at iomap_dio_rw() calls filemap_write_and_wait_range() once, which is not enough to wait for compressed writeback to complete. This call to filemap_fdatawrite_range() can block on page locks, since the first writepages() on a range that we will try to compress results only in queuing a work to compress the data while holding the pages locked. Even though the generic code at iomap_dio_rw() will do the right thing and return -EAGAIN for NOWAIT requests in case there are pages in the range, we can still end up at btrfs_dio_iomap_begin() with pages in the range because either of the following can happen: 1) Memory mapped writes, as we haven't locked the range yet; 2) Buffered reads might have started, which lock the pages, and we do the filemap_fdatawrite_range() call before locking the file range. So don't call filemap_fdatawrite_range() at btrfs_dio_iomap_begin() if we are doing a NOWAIT read/write. Instead call filemap_range_needs_writeback() to check if there are any locked, dirty, or under writeback pages, and return -EAGAIN if that's the case. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b0a66a3137bde6e011e2b14b135e8ea18facb68c Author: Jonathan Lassoff Date: Thu Mar 17 10:45:08 2022 -0700 btrfs: add messages to printk index In order for end users to quickly react to new issues that come up in production, it is proving useful to leverage this printk indexing system. This printk index enables kernel developers to use calls to printk() with changeable ad-hoc format strings, while still enabling end users to detect changes and develop a semi-stable interface for detecting and parsing these messages. So that detailed Btrfs messages are captured by this printk index, this patch wraps btrfs_printk and btrfs_handle_fs_error with macros. Example of the generated list: https://lore.kernel.org/lkml/12588e13d51a9c3bf59467d3fc1ac2162f1275c1.1647539056.git.jof@thejof.com Signed-off-by: Jonathan Lassoff Reviewed-by: David Sterba Signed-off-by: David Sterba commit 88c602ab44604a9474b3d5ec1d631830f928ce51 Author: Qu Wenruo Date: Wed Mar 16 08:05:58 2022 +0800 btrfs: tree-checker: check extent buffer owner against owner rootid Btrfs doesn't check whether the tree block respects the root owner. This means, if a tree block referred by a parent in extent tree, but has owner of 5, btrfs can still continue reading the tree block, as long as it doesn't trigger other sanity checks. Normally this is fine, but combined with the empty tree check in check_leaf(), if we hit an empty extent tree, but the root node has csum tree owner, we can let such extent buffer to sneak in. Shrink the hole by: - Do extra eb owner check at tree read time - Make sure the root owner extent buffer exactly matches the root id. Unfortunately we can't yet completely patch the hole, there are several call sites can't pass all info we need: - For reloc/log trees Their owner is key::offset, not key::objectid. We need the full root key to do that accurate check. For now, we just skip the ownership check for those trees. - For add_data_references() of relocation That call site doesn't have any parent/ownership info, as all the bytenrs are all from btrfs_find_all_leafs(). - For direct backref items walk Direct backref items records the parent bytenr directly, thus unlike indirect backref item, we don't do a full tree search. Thus in that case, we don't have full parent owner to check. For the later two cases, they all pass 0 as @owner_root, thus we can skip those cases if @owner_root is 0. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 63c34cb4c6dddd7899a14ed0a11b208a41e9c85c Author: Filipe Manana Date: Tue Mar 15 15:22:41 2022 +0000 btrfs: add and use helper to assert an inode range is clean We have four different scenarios where we don't expect to find ordered extents after locking a file range: 1) During plain fallocate; 2) During hole punching; 3) During zero range; 4) During reflinks (both cloning and deduplication). This is because in all these cases we follow the pattern: 1) Lock the inode's VFS lock in exclusive mode; 2) Lock the inode's i_mmap_lock in exclusive node, to serialize with mmap writes; 3) Flush delalloc in a file range and wait for all ordered extents to complete - both done through btrfs_wait_ordered_range(); 4) Lock the file range in the inode's io_tree. So add a helper that asserts that we don't have ordered extents for a given range. Make the four scenarios listed above use this helper after locking the respective file range. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 55961c8abfdcb1f0c8420c5c6bdff86170cf43fc Author: Filipe Manana Date: Tue Mar 15 15:22:40 2022 +0000 btrfs: remove ordered extent check and wait during hole punching and zero range For hole punching and zero range we have this loop that checks if we have ordered extents after locking the file range, and if so unlock the range, wait for ordered extents, and retry until we don't find more ordered extents. This logic was needed in the past because: 1) Direct IO writes within the i_size boundary did not take the inode's VFS lock. This was because that lock used to be a mutex, then some years ago it was switched to a rw semaphore (commit 9902af79c01a8e ("parallel lookups: actual switch to rwsem")), and then btrfs was changed to take the VFS inode's lock in shared mode for writes that don't cross the i_size boundary (commit e9adabb9712ef9 ("btrfs: use shared lock for direct writes within EOF")); 2) We could race with memory mapped writes, because memory mapped writes don't acquire the inode's VFS lock. We don't have that race anymore, as we have a rw semaphore to synchronize memory mapped writes with fallocate (and reflinking too). That change happened with commit 8d9b4a162a37ce ("btrfs: exclude mmap from happening during all fallocate operations"). So stop looking for ordered extents after locking the file range when doing hole punching and zero range operations. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit bd6526d0df0f6be6426118f5f67f24273377a567 Author: Filipe Manana Date: Tue Mar 15 15:22:39 2022 +0000 btrfs: lock the inode first before flushing range when punching hole When doing hole punching we are flushing delalloc and waiting for ordered extents to complete before locking the inode (VFS lock and the btrfs specific i_mmap_lock). This is fine because even if a write happens after we call btrfs_wait_ordered_range() and before we lock the inode (call btrfs_inode_lock()), we will notice the write at btrfs_punch_hole_lock_range() and flush delalloc and wait for its ordered extent. We can however make this simpler by locking first the inode an then call btrfs_wait_ordered_range(), which will allow us to remove the ordered extent lookup logic from btrfs_punch_hole_lock_range() in the next patch. It also makes the behaviour the same as plain fallocate, hole punching and reflinks. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit ffa8fc603d2774ab2b22b18301a12f9d4d2be954 Author: Filipe Manana Date: Tue Mar 15 15:22:38 2022 +0000 btrfs: remove ordered extent check and wait during fallocate For fallocate() we have this loop that checks if we have ordered extents after locking the file range, and if so unlock the range, wait for ordered extents, and retry until we don't find more ordered extents. This logic was needed in the past because: 1) Direct IO writes within the i_size boundary did not take the inode's VFS lock. This was because that lock used to be a mutex, then some years ago it was switched to a rw semaphore (commit 9902af79c01a8e ("parallel lookups: actual switch to rwsem")), and then btrfs was changed to take the VFS inode's lock in shared mode for writes that don't cross the i_size boundary (commit e9adabb9712ef9 ("btrfs: use shared lock for direct writes within EOF")); 2) We could race with memory mapped writes, because memory mapped writes don't acquire the inode's VFS lock. We don't have that race anymore, as we have a rw semaphore to synchronize memory mapped writes with fallocate (and reflinking too). That change happened with commit 8d9b4a162a37ce ("btrfs: exclude mmap from happening during all fallocate operations"). So stop looking for ordered extents after locking the file range when doing a plain fallocate. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 1c6cbbbeeeca5702c115f4547fd0f75a7fc0f911 Author: Filipe Manana Date: Tue Mar 15 15:22:37 2022 +0000 btrfs: remove inode_dio_wait() calls when starting reflink operations When starting a reflink operation we have these calls to inode_dio_wait() which used to be needed because direct IO writes that don't cross the i_size boundary did not take the inode's VFS lock, so we could race with them and end up with ordered extents in target range after calling btrfs_wait_ordered_range(). However that is not the case anymore, because the inode's VFS lock was changed from a mutex to a rw semaphore, by commit 9902af79c01a8e ("parallel lookups: actual switch to rwsem"), and several years later we started to lock the inode's VFS lock in shared mode for direct IO writes that don't cross the i_size boundary (commit e9adabb9712ef9 ("btrfs: use shared lock for direct writes within EOF")). So remove those inode_dio_wait() calls. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 831e1ee60216534c54f2e240f9586d6cfe29b1c2 Author: Filipe Manana Date: Tue Mar 15 15:22:36 2022 +0000 btrfs: remove useless dio wait call when doing fallocate zero range When starting a fallocate zero range operation, before getting the first extent map for the range, we make a call to inode_dio_wait(). This logic was needed in the past because direct IO writes within the i_size boundary did not take the inode's VFS lock. This was because that lock used to be a mutex, then some years ago it was switched to a rw semaphore (by commit 9902af79c01a8e ("parallel lookups: actual switch to rwsem")), and then btrfs was changed to take the VFS inode's lock in shared mode for writes that don't cross the i_size boundary (done in commit e9adabb9712ef9 ("btrfs: use shared lock for direct writes within EOF")). The lockless direct IO writes could result in a race with the zero range operation, resulting in the later getting a stale extent map for the range. So remove this no longer needed call to inode_dio_wait(), as fallocate takes the inode's VFS lock in exclusive mode and direct IO writes within i_size take that same lock in shared mode. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 47e1d1c7bb35ccf1d327ddcfaf59b268c8770159 Author: Filipe Manana Date: Tue Mar 15 15:22:35 2022 +0000 btrfs: only reserve the needed data space amount during fallocate During a plain fallocate, we always start by reserving an amount of data space that matches the length of the range passed to fallocate. When we already have extents allocated in that range, we may end up trying to reserve a lot more data space then we need, which can result in several undesired behaviours: 1) We fail with -ENOSPC. For example the passed range has a length of 1G, but there's only one hole with a size of 1M in that range; 2) We temporarily reserve excessive data space that could be used by other operations happening concurrently; 3) By reserving much more data space then we need, we can end up doing expensive things like triggering dellaloc for other inodes, waiting for the ordered extents to complete, trigger transaction commits, allocate new block groups, etc. Example: $ cat test.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f -b 1g $DEV mount $DEV $MNT # Create a file with a size of 600M and two holes, one at [200M, 201M[ # and another at [401M, 402M[ xfs_io -f -c "pwrite -S 0xab 0 200M" \ -c "pwrite -S 0xcd 201M 200M" \ -c "pwrite -S 0xef 402M 198M" \ $MNT/foobar # Now call fallocate against the whole file range, see if it fails # with -ENOSPC or not - it shouldn't since we only need to allocate # 2M of data space. xfs_io -c "falloc 0 600M" $MNT/foobar umount $MNT $ ./test.sh (...) wrote 209715200/209715200 bytes at offset 0 200 MiB, 51200 ops; 0.8063 sec (248.026 MiB/sec and 63494.5831 ops/sec) wrote 209715200/209715200 bytes at offset 210763776 200 MiB, 51200 ops; 0.8053 sec (248.329 MiB/sec and 63572.3172 ops/sec) wrote 207618048/207618048 bytes at offset 421527552 198 MiB, 50688 ops; 0.7925 sec (249.830 MiB/sec and 63956.5548 ops/sec) fallocate: No space left on device $ So fix this by not allocating an amount of data space that matches the length of the range passed to fallocate. Instead allocate an amount of data space that corresponds to the sum of the sizes of each hole found in the range. This reservation now happens after we have locked the file range, which is safe since we know at this point there's no delalloc in the range because we've taken the inode's VFS lock in exclusive mode, we have taken the inode's i_mmap_lock in exclusive mode, we have flushed delalloc and waited for all ordered extents in the range to complete. This type of failure actually seems to happen in practice with systemd, and we had at least one report about this in a very long thread which is referenced by the Link tag below. Link: https://lore.kernel.org/linux-btrfs/bdJVxLiFr_PyQSXRUbZJfFW_jAjsGgoMetqPHJMbg-hdy54Xt_ZHhRetmnJ6cJ99eBlcX76wy-AvWwV715c3YndkxneSlod11P1hlaADx0s=@protonmail.com/ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6c3636ebe39270b85ba8ad75435be4f563d9b1b7 Author: Sweet Tea Dorminy Date: Fri Apr 8 13:15:07 2022 -0400 btrfs: restore inode creation before xattr setting According to the tree checker, "all xattrs with a given objectid follow the inode with that objectid in the tree" is an invariant. This was broken by the recent change "btrfs: move common inode creation code into btrfs_create_new_inode()", which moved acl creation and property inheritance (stored in xattrs) to before inode insertion into the tree. As a result, under certain timings, the xattrs could be written to the tree before the inode, causing the tree checker to report violation of the invariant. Move property inheritance and acl creation back to their old ordering after the inode insertion. Suggested-by: Omar Sandoval Reported-by: Naohiro Aota Signed-off-by: Sweet Tea Dorminy Signed-off-by: David Sterba commit caae78e032343df525b8d05c58b462827f10b2a3 Author: Omar Sandoval Date: Mon Mar 14 18:12:35 2022 -0700 btrfs: move common inode creation code into btrfs_create_new_inode() All of our inode creation code paths duplicate the calls to btrfs_init_inode_security() and btrfs_add_link(). Subvolume creation additionally duplicates property inheritance and the call to btrfs_set_inode_index(). Fix this by moving the common code into btrfs_create_new_inode(). This accomplishes a few things at once: 1. It reduces code duplication. 2. It allows us to set up the inode completely before inserting the inode item, removing calls to btrfs_update_inode(). 3. It fixes a leak of an inode on disk in some error cases. For example, in btrfs_create(), if btrfs_new_inode() succeeds, then we have inserted an inode item and its inode ref. However, if something after that fails (e.g., btrfs_init_inode_security()), then we end the transaction and then decrement the link count on the inode. If the transaction is committed and the system crashes before the failed inode is deleted, then we leak that inode on disk. Instead, this refactoring aborts the transaction when we can't recover more gracefully. 4. It exposes various ways that subvolume creation diverges from mkdir in terms of inheriting flags, properties, permissions, and POSIX ACLs, a lot of which appears to be accidental. This patch explicitly does _not_ change the existing non-standard behavior, but it makes those differences more clear in the code and documents them so that we can discuss whether they should be changed. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 3538d68dbd97a2f5599bf39aeee47f027417fc39 Author: Omar Sandoval Date: Mon Mar 14 18:12:34 2022 -0700 btrfs: reserve correct number of items for inode creation The various inode creation code paths do not account for the compression property, POSIX ACLs, or the parent inode item when starting a transaction. Fix it by refactoring all of these code paths to use a new function, btrfs_new_inode_prepare(), which computes the correct number of items. To do so, it needs to know whether POSIX ACLs will be created, so move the ACL creation into that function. To reduce the number of arguments that need to be passed around for inode creation, define struct btrfs_new_inode_args containing all of the relevant information. btrfs_new_inode_prepare() will also be a good place to set up the fscrypt context and encrypted filename in the future. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 5f465bf1f15aec52bed8d3e17738b303ae8e1a3c Author: Omar Sandoval Date: Mon Mar 14 18:12:33 2022 -0700 btrfs: factor out common part of btrfs_{mknod,create,mkdir}() btrfs_{mknod,create,mkdir}() are now identical other than the inode initialization and some inconsequential function call order differences. Factor out the common code to reduce code duplication. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit a1fd0c35ffe349a7bbca27dae362932895ee8c4d Author: Omar Sandoval Date: Mon Mar 14 18:12:32 2022 -0700 btrfs: allocate inode outside of btrfs_new_inode() Instead of calling new_inode() and inode_init_owner() inside of btrfs_new_inode(), do it in the callers. This allows us to pass in just the inode instead of the mnt_userns and mode and removes the need for memalloc_nofs_{save,restores}() since we do it before starting a transaction. In create_subvol(), it also means we no longer have to look up the inode again to instantiate it. This also paves the way for some more cleanups in later patches. This also removes the comments about Smack checking i_op, which are no longer true since commit 5d6c31910bc0 ("xattr: Add __vfs_{get,set,remove}xattr helpers"). Now it checks inode->i_opflags & IOP_XATTR, which is set based on sb->s_xattr. Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit b95b78e628d56c6d3d7912e264d9745777b2d800 Author: Qu Wenruo Date: Tue Mar 15 18:01:33 2022 +0800 btrfs: warn when extent buffer leak test fails Although we have btrfs_extent_buffer_leak_debug_check() (enabled by CONFIG_BTRFS_DEBUG option) to detect and warn QA testers that we have some extent buffer leakage, it's just pr_err(), not noisy enough for fstests to cache. So here we trigger a WARN_ON() if the allocated_ebs list is not empty. Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b67d73c1ff252bbb3e28c4d3eb734a4db74b9399 Author: Anand Jain Date: Mon Mar 14 10:09:29 2022 +0800 btrfs: use a local variable for fs_devices pointer in btrfs_dev_replace_finishing In the function btrfs_dev_replace_finishing, we dereferenced fs_info->fs_devices 6 times. Use keep local variable for that. Reviewed-by: Johannes Thumshirn Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 184b3d1900872da37ad84c0b0fae90f288ae8158 Author: Gabriel Niebler Date: Wed Mar 9 14:50:51 2022 +0100 btrfs: use btrfs_for_each_slot in btrfs_listxattr This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 43cb1478de68ccc1656b6f0ea70ffc4825fd2803 Author: Gabriel Niebler Date: Wed Mar 9 14:50:50 2022 +0100 btrfs: use btrfs_for_each_slot in btrfs_read_chunk_tree This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3d64f060a72a464a5bdf340a2723cd404c7f42d4 Author: Gabriel Niebler Date: Wed Mar 9 14:50:49 2022 +0100 btrfs: use btrfs_for_each_slot in btrfs_unlink_all_paths This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9930e9d4adf05c0f2c1da1dfceb6f2fff6d8ce0b Author: Gabriel Niebler Date: Wed Mar 9 14:50:48 2022 +0100 btrfs: use btrfs_for_each_slot in process_all_extents This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 69e4317759f5bc48daf3db3b2cabe31d751f9513 Author: Gabriel Niebler Date: Wed Mar 9 14:50:47 2022 +0100 btrfs: use btrfs_for_each_slot in process_all_new_xattrs This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 649b96355d4b243bc9a186e733b0486678dad039 Author: Gabriel Niebler Date: Wed Mar 9 14:50:46 2022 +0100 btrfs: use btrfs_for_each_slot in process_all_refs This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 35a68080ff86c74f9921b5048e444eff3b92e84e Author: Gabriel Niebler Date: Wed Mar 9 14:50:45 2022 +0100 btrfs: use btrfs_for_each_slot in is_ancestor This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 18f80f1fa4d41af09fc2739bb15d6a98a6feed2f Author: Gabriel Niebler Date: Wed Mar 9 14:50:44 2022 +0100 btrfs: use btrfs_for_each_slot in can_rmdir This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6dcee260874ed765c4e3f9425f46dc1a10853108 Author: Gabriel Niebler Date: Wed Mar 9 14:50:43 2022 +0100 btrfs: use btrfs_for_each_slot in did_create_dir This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit a8ce68fd04cc0ed7435f03027fd379799ddad699 Author: Gabriel Niebler Date: Wed Mar 9 14:50:42 2022 +0100 btrfs: use btrfs_for_each_slot in btrfs_real_readdir This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9dcbe16fccbb6186e6ef0c429b699bc09c126338 Author: Gabriel Niebler Date: Wed Mar 9 14:50:41 2022 +0100 btrfs: use btrfs_for_each_slot in btrfs_search_dir_index_item This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9bc5fc0417c8c3dff4205052e93650c62aa2d70e Author: Gabriel Niebler Date: Wed Mar 9 14:50:40 2022 +0100 btrfs: use btrfs_for_each_slot in mark_block_group_to_copy This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 36dfbbe25ec016a812b9fd78e6dfdafc5397ab3a Author: Gabriel Niebler Date: Wed Mar 9 14:50:39 2022 +0100 btrfs: use btrfs_for_each_slot in find_first_block_group This function can be simplified by refactoring to use the new iterator macro. No functional changes. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit 62142be363ae902c948729eeb35851ddf34b317d Author: Gabriel Niebler Date: Wed Mar 9 14:50:38 2022 +0100 btrfs: introduce btrfs_for_each_slot iterator macro There is a common pattern when searching for a key in btrfs: * Call btrfs_search_slot to find the slot for the key * Enter an endless loop: * If the found slot is larger than the no. of items in the current leaf, check the next leaf * If it's still not found in the next leaf, terminate the loop * Otherwise do something with the found key * Increment the current slot and continue To reduce code duplication, we can replace this code pattern with an iterator macro, similar to the existing for_each_X macros found elsewhere in the kernel. This also makes the code easier to understand for newcomers by putting a name to the encapsulated functionality. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Gabriel Niebler Reviewed-by: David Sterba Signed-off-by: David Sterba commit e360d2f5810434d44ee61b47437ecd5e66528a5a Author: Qu Wenruo Date: Sun Mar 13 18:40:02 2022 +0800 btrfs: scrub: rename scrub_bio::pagev and related members Since the subpage support for scrub, one page no longer always represents one sector, thus scrub_bio::pagev and scrub_bio::sector_count are no longer accurate. Rename them to scrub_bio::sectors and scrub_bio::sector_count respectively. This also involves scrub_ctx::pages_per_bio and other macros involved. Now the renaming of pages involved in scrub is be finished. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 463435017219296e9dbca102961eef55c76e5a72 Author: Qu Wenruo Date: Sun Mar 13 18:40:01 2022 +0800 btrfs: scrub: rename scrub_page to scrub_sector Since the subpage support of scrub, scrub_sector is in fact just representing one sector. Thus the name scrub_page is no longer correct, rename it to scrub_sector. This also involves the following renames: - spage -> sector Normally we would just replace "page" with "sector" and result something like "ssector". But the repeating 's' is not really eye friendly. So here we just simple use "sector", as there is nothing from MM layer called "sector" to cause any confusion. - scrub_parity::spages -> sectors_list Normally we use plural to indicate an array, not a list. Rename it to @sectors_list to be more explicit on the list part. - Also reformat and update comments that get changed Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7e737cbca63331943a75d472e66bca2634966239 Author: Qu Wenruo Date: Sun Mar 13 18:40:00 2022 +0800 btrfs: scrub: rename members related to scrub_block::pagev The following will be renamed in this patch: - scrub_block::pagev -> sectors - scrub_block::page_count -> sector_count - SCRUB_MAX_PAGES_PER_BLOCK -> SCRUB_MAX_SECTORS_PER_BLOCK - page_num -> sector_num to iterate scrub_block::sectors For now scrub_page is not yet renamed to keep the patch reasonable and it will be updated in a followup. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6a2e9dc46f15dc8e0eb8c8986a49c36f4b2d23a4 Author: Filipe Manana Date: Fri Mar 11 11:35:34 2022 +0000 btrfs: remove trivial wrapper btrfs_read_buffer() The function btrfs_read_buffer() is useless, it just calls btree_read_extent_buffer_pages() with exactly the same arguments. So remove it and rename btree_read_extent_buffer_pages() to btrfs_read_extent_buffer(), which is a shorter name, has the "btrfs_" prefix (since it's used outside disk-io.c) and the name is clear enough about what it does. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 376a21d752552b0a2770dc1bdae738be39851b5c Author: Filipe Manana Date: Fri Mar 11 11:35:33 2022 +0000 btrfs: update outdated comment for read_block_for_search() The comment at the top of read_block_for_search() is very outdated, as it refers to the blocking versus spinning path locking modes. We no longer have these two locking modes after we switched the btree locks from custom code to rw semaphores. So update the comment to stop referring to the blocking mode and put it more up to date. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit b246666ef792add7d5af09043297e2315b2e918a Author: Filipe Manana Date: Fri Mar 11 11:35:32 2022 +0000 btrfs: release upper nodes when reading stale btree node from disk When reading a btree node (or leaf), at read_block_for_search(), if we can't find its extent buffer in the cache (the fs_info->buffer_radix radix tree), then we unlock all upper level nodes before reading the btree node/leaf from disk, to prevent blocking other tasks for too long. However if we find that the extent buffer is in the cache but it is not up to date, we don't unlock upper level nodes before reading it from disk, potentially blocking other tasks on upper level nodes for too long. Fix this inconsistent behaviour by unlocking upper level nodes if we need to read a node/leaf from disk because its in-memory extent buffer is not up to date. If we unlocked upper level nodes then we must return -EAGAIN to the caller, just like the case where the extent buffer is not cached in memory. And like that case, we determine if upper level nodes are locked by checking only if the parent node is locked - if it isn't, then no other upper level nodes are locked. This is actually a rare case, as if we have an extent buffer in memory, it typically has the uptodate flag set and passes all the checks done by btrfs_buffer_uptodate(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4bb59055bcde678601848d16969fb2d53b6a2148 Author: Filipe Manana Date: Fri Mar 11 11:35:31 2022 +0000 btrfs: avoid unnecessary btree search restarts when reading node When reading a btree node, at read_block_for_search(), if we don't find the node's (or leaf) extent buffer in the cache, we will read it from disk. Since that requires waiting on IO, we release all upper level nodes from our path before reading the target node/leaf, and then return -EAGAIN to the caller, which will make the caller restart the while btree search. However we are causing the restart of btree search even for cases where it is not necessary: 1) We have a path with ->skip_locking set to true, typically when doing a search on a commit root, so we are never holding locks on any node; 2) We are doing a read search (the "ins_len" argument passed to btrfs_search_slot() is 0), or we are doing a search to modify an existing key (the "cow" argument passed to btrfs_search_slot() has a value of 1 and "ins_len" is 0), in which case we never hold locks for upper level nodes; 3) We are doing a search to insert or delete a key, in which case we may or may not have upper level nodes locked. That depends on the current minimum write lock levels at btrfs_search_slot(), if we had to split or merge parent nodes, if we had to COW upper level nodes and if we ever visited slot 0 of an upper level node. It's still common to not have upper level nodes locked, but our current node must be at least at level 1, for insertions, or at least at level 2 for deletions. In these cases when we have locks on upper level nodes, they are always write locks. These cases where we are not holding locks on upper level nodes far outweigh the cases where we are holding locks, so it's completely wasteful to retry the whole search when we have no upper nodes locked. So change the logic to not return -EAGAIN, and make the caller retry the search, when we don't have the parent node locked - when it's not locked it means no other upper level nodes are locked as well. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 305eaac009113d1d082147b522a92eed01fec263 Author: Omar Sandoval Date: Wed Mar 9 17:31:42 2022 -0800 btrfs: set inode flags earlier in btrfs_new_inode() btrfs_new_inode() inherits the inode flags from the parent directory and the mount options _after_ we fill the inode item. This works because all of the callers of btrfs_new_inode() make further changes to the inode and then call btrfs_update_inode(). It'd be better to fully initialize the inode once to avoid the extra update, so as a first step, set the inode flags _before_ filling the inode item. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6437d45835315a36cde09609314da1768a71c299 Author: Omar Sandoval Date: Wed Mar 9 17:31:41 2022 -0800 btrfs: move btrfs_get_free_objectid() call into btrfs_new_inode() Every call of btrfs_new_inode() is immediately preceded by a call to btrfs_get_free_objectid(). Since getting an inode number is part of creating a new inode, this is better off being moved into btrfs_new_inode(). While we're here, get rid of the comment about reclaiming inode numbers, since we only did that when using the ino cache, which was removed by commit 5297199a8bca ("btrfs: remove inode number cache feature"). Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 23c24ef8e4181ba5cb56316a17b920deedbbb109 Author: Omar Sandoval Date: Wed Mar 9 17:31:40 2022 -0800 btrfs: don't pass parent objectid to btrfs_new_inode() explicitly For everything other than a subvolume root inode, we get the parent objectid from the parent directory. For the subvolume root inode, the parent objectid is the same as the inode's objectid. We can find this within btrfs_new_inode() instead of passing it. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 70dc55f428dd3bf10421ec65f9a30aef01ea5007 Author: Omar Sandoval Date: Wed Mar 9 17:31:39 2022 -0800 btrfs: remove redundant name and name_len parameters to create_subvol The passed dentry already contains the name. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 75b993cf43052c76d067628d67ae2746400b504f Author: Omar Sandoval Date: Wed Mar 9 17:31:38 2022 -0800 btrfs: remove unused mnt_userns parameter from __btrfs_set_acl Commit 4a8b34afa9c9 ("btrfs: handle ACLs on idmapped mounts") added this parameter but didn't use it. __btrfs_set_acl() is the low-level helper that writes an ACL to disk. The higher-level btrfs_set_acl() is the one that translates the ACL based on the user namespace. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit c51fa51190f9909c5cb9bbdddb1ad845d6e71a33 Author: Omar Sandoval Date: Wed Mar 9 17:31:37 2022 -0800 btrfs: remove unnecessary set_nlink() in btrfs_create_subvol_root() btrfs_new_inode() already returns an inode with nlink set to 1 (via inode_init_always()). Get rid of the unnecessary set. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6d831f7ef9f0cecef7ae1f6f55c5739d6f3b9143 Author: Omar Sandoval Date: Wed Mar 9 17:31:36 2022 -0800 btrfs: remove unnecessary inode_set_bytes(0) call new_inode() always returns an inode with i_blocks and i_bytes set to 0 (via inode_init_always()). Remove the unnecessary call to inode_set_bytes() in btrfs_new_inode(). Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9124e15f2798662d65cac9c8bb3abaced38af36d Author: Omar Sandoval Date: Wed Mar 9 17:31:35 2022 -0800 btrfs: remove unnecessary btrfs_i_size_write(0) calls btrfs_new_inode() always returns an inode with i_size and disk_i_size set to 0 (via inode_init_always() and btrfs_alloc_inode(), respectively). Remove the unnecessary calls to btrfs_i_size_write() in btrfs_mkdir() and btrfs_create_subvol_root(). Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 81512e89f2b79a5c965a436dc58fd9f0aeee8690 Author: Omar Sandoval Date: Wed Mar 9 17:31:34 2022 -0800 btrfs: get rid of btrfs_add_nondir() This is a trivial wrapper around btrfs_add_link(). The only thing it does other than moving arguments around is translating a > 0 return value to -EEXIST. As far as I can tell, btrfs_add_link() won't return > 0 (and if it did, the existing callsites in, e.g., btrfs_mkdir() would be broken). The check itself dates back to commit 2c90e5d65842 ("Btrfs: still corruption hunting"), so it's probably left over from debugging. Let's just get rid of btrfs_add_nondir(). Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2256e901f5bddc56e24089c96f27b77da932dfcc Author: Omar Sandoval Date: Wed Mar 9 17:31:33 2022 -0800 btrfs: fix anon_dev leak in create_subvol() When btrfs_qgroup_inherit(), btrfs_alloc_tree_block, or btrfs_insert_root() fail in create_subvol(), we return without freeing anon_dev. Reorganize the error handling in create_subvol() to fix this. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit c16218714307849a949f83cbad00b1b4ec166bb6 Author: Omar Sandoval Date: Wed Mar 9 17:31:32 2022 -0800 btrfs: reserve correct number of items for rename btrfs_rename() and btrfs_rename_exchange() don't account for enough items. Replace the incorrect explanations with a specific breakdown of the number of items and account them accurately. Note that this glosses over RENAME_WHITEOUT because the next commit is going to rework that, too. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit bca4ad7c0b547b01ed4bd244dc54be18ba6cc708 Author: Omar Sandoval Date: Wed Mar 9 17:31:31 2022 -0800 btrfs: reserve correct number of items for unlink and rmdir __btrfs_unlink_inode() calls btrfs_update_inode() on the parent directory in order to update its size and sequence number. Make sure we account for it. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit 04fd07397efda804977778629f5fa408dcb78369 Author: Graham Sider Date: Thu May 12 14:34:22 2022 -0400 drm/amdkfd: Fix static checker warning on MES queue type convert_to_mes_queue_type return can be negative, but queue_input.queue_type is uint32_t. Put return in integer var and cast to unsigned after negative check. Reported-by: Dan Carpenter Signed-off-by: Graham Sider Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4b9caaa0281972ca5ea4e1cdac2e12b9df1ae00b Author: Hans de Goede Date: Thu May 12 22:45:33 2022 +0200 drm/amdgpu: Move mutex_init(&smu->message_lock) to smu_early_init() Lockdep complains about the smu->message_lock mutex being used before it is initialized through the following call path: amdgpu_device_init() amdgpu_dpm_mode2_reset() smu_mode2_reset() smu_v12_0_mode2_reset() smu_cmn_send_smc_msg_with_param() Move the mutex_init() call to smu_early_init() to fix the mutex being used before it is initialized. This fixes the following lockdep splat: [ 3.867331] ------------[ cut here ]------------ [ 3.867335] fbcon: Taking over console [ 3.867338] DEBUG_LOCKS_WARN_ON(lock->magic != lock) [ 3.867340] WARNING: CPU: 14 PID: 491 at kernel/locking/mutex.c:579 __mutex_lock+0x44c/0x830 [ 3.867349] Modules linked in: amdgpu(+) crct10dif_pclmul drm_ttm_helper crc32_pclmul ttm crc32c_intel ghash_clmulni_intel hid_lg_g15 iommu_v2 sp5100_tco nvme gpu_sched drm_dp_helper nvme_core ccp wmi video hid_logitech_dj ip6_tables ip_tables ipmi_devintf ipmi_msghandler fuse i2c_dev [ 3.867363] CPU: 14 PID: 491 Comm: systemd-udevd Tainted: G I 5.18.0-rc5+ #33 [ 3.867366] Hardware name: Micro-Star International Co., Ltd. MS-7C95/B550M PRO-VDH WIFI (MS-7C95), BIOS 2.90 12/23/2021 [ 3.867369] RIP: 0010:__mutex_lock+0x44c/0x830 [ 3.867372] Code: ff 85 c0 0f 84 33 fc ff ff 8b 0d b7 50 25 01 85 c9 0f 85 25 fc ff ff 48 c7 c6 fb 41 82 99 48 c7 c7 6b 63 80 99 e8 88 2a f8 ff <0f> 0b e9 0b fc ff ff f6 83 b9 0c 00 00 01 0f 85 64 ff ff ff 4c 89 [ 3.867377] RSP: 0018:ffffaef8c0fc79f0 EFLAGS: 00010286 [ 3.867380] RAX: 0000000000000028 RBX: 0000000000000000 RCX: 0000000000000027 [ 3.867382] RDX: ffff9ccc0dda0928 RSI: 0000000000000001 RDI: ffff9ccc0dda0920 [ 3.867384] RBP: ffffaef8c0fc7a80 R08: 0000000000000000 R09: ffffaef8c0fc7820 [ 3.867386] R10: 0000000000000003 R11: ffff9ccc2a2fffe8 R12: 0000000000000002 [ 3.867388] R13: ffff9cc990808058 R14: 0000000000000000 R15: ffff9cc98bfc0000 [ 3.867390] FS: 00007fc4d830f580(0000) GS:ffff9ccc0dd80000(0000) knlGS:0000000000000000 [ 3.867394] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3.867396] CR2: 0000560a77031410 CR3: 000000010f522000 CR4: 0000000000750ee0 [ 3.867398] PKRU: 55555554 [ 3.867399] Call Trace: [ 3.867401] [ 3.867403] ? smu_cmn_send_smc_msg_with_param+0x98/0x240 [amdgpu] [ 3.867533] ? __mutex_lock+0x90/0x830 [ 3.867535] ? amdgpu_dpm_mode2_reset+0x37/0x60 [amdgpu] [ 3.867653] ? smu_cmn_send_smc_msg_with_param+0x98/0x240 [amdgpu] [ 3.867758] smu_cmn_send_smc_msg_with_param+0x98/0x240 [amdgpu] [ 3.867857] smu_mode2_reset+0x2b/0x50 [amdgpu] [ 3.867953] amdgpu_dpm_mode2_reset+0x46/0x60 [amdgpu] [ 3.868096] amdgpu_device_init.cold+0x1069/0x1e78 [amdgpu] [ 3.868219] ? _raw_spin_unlock_irqrestore+0x30/0x50 [ 3.868222] ? pci_conf1_read+0x9b/0xf0 [ 3.868226] amdgpu_driver_load_kms+0x15/0x110 [amdgpu] [ 3.868314] amdgpu_pci_probe+0x1a9/0x3c0 [amdgpu] [ 3.868398] local_pci_probe+0x41/0x80 [ 3.868401] pci_device_probe+0xab/0x200 [ 3.868404] really_probe+0x1a1/0x370 [ 3.868407] __driver_probe_device+0xfc/0x170 [ 3.868410] driver_probe_device+0x1f/0x90 [ 3.868412] __driver_attach+0xbf/0x1a0 [ 3.868414] ? __device_attach_driver+0xe0/0xe0 [ 3.868416] bus_for_each_dev+0x65/0x90 [ 3.868419] bus_add_driver+0x151/0x1f0 [ 3.868421] driver_register+0x89/0xd0 [ 3.868423] ? 0xffffffffc0bd4000 [ 3.868425] do_one_initcall+0x5d/0x300 [ 3.868428] ? do_init_module+0x22/0x240 [ 3.868431] ? rcu_read_lock_sched_held+0x3c/0x70 [ 3.868434] ? trace_kmalloc+0x30/0xe0 [ 3.868437] ? kmem_cache_alloc_trace+0x1e6/0x3a0 [ 3.868440] do_init_module+0x4a/0x240 [ 3.868442] __do_sys_finit_module+0x93/0xf0 [ 3.868446] do_syscall_64+0x5b/0x80 [ 3.868449] ? rcu_read_lock_sched_held+0x3c/0x70 [ 3.868451] ? lockdep_hardirqs_on_prepare+0xd9/0x180 [ 3.868454] ? do_syscall_64+0x67/0x80 [ 3.868456] ? do_syscall_64+0x67/0x80 [ 3.868458] ? do_syscall_64+0x67/0x80 [ 3.868460] ? do_syscall_64+0x67/0x80 [ 3.868462] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 3.868465] RIP: 0033:0x7fc4d8ec1ced [ 3.868467] Code: 5d 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 fb 70 0e 00 f7 d8 64 89 01 48 [ 3.868472] RSP: 002b:00007fff687ae6b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 3.868475] RAX: ffffffffffffffda RBX: 0000560a76fbca60 RCX: 00007fc4d8ec1ced [ 3.868477] RDX: 0000000000000000 RSI: 00007fc4d902343c RDI: 0000000000000011 [ 3.868479] RBP: 00007fc4d902343c R08: 0000000000000000 R09: 0000560a76fb59c0 [ 3.868481] R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000020000 [ 3.868484] R13: 0000560a76f8bfd0 R14: 0000000000000000 R15: 0000560a76fc2d10 [ 3.868487] [ 3.868489] irq event stamp: 120617 [ 3.868490] hardirqs last enabled at (120617): [] __up_console_sem+0x5e/0x70 [ 3.868494] hardirqs last disabled at (120616): [] __up_console_sem+0x43/0x70 [ 3.868497] softirqs last enabled at (119684): [] __irq_exit_rcu+0xca/0x100 [ 3.868501] softirqs last disabled at (119679): [] __irq_exit_rcu+0xca/0x100 [ 3.868504] ---[ end trace 0000000000000000 ]--- Signed-off-by: Hans de Goede Signed-off-by: Alex Deucher commit 0d6ec07a9555759fa9e1bb88661f282435ea13de Author: Xiaojian Du Date: Tue Jan 11 15:48:45 2022 +0800 drm/amdgpu/discovery: add SMU v13.0.4 into the IP discovery list This patch will add SMU v13.0.4 into the IP discovery list. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 33ef11cd7cbac0e02257c43c70c48beeab51beae Author: Tim Huang Date: Wed May 11 12:09:36 2022 +0800 drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.4 Enable the SMU IP v13.0.4 GFXOFF control Signed-off-by: Tim Huang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 17f78bb4093f819344aa4a4ed3f363aa2a5f0342 Author: Tim Huang Date: Fri May 6 22:13:18 2022 +0800 drm/amdgpu/pm: enable swsmu for SMU IP v13.0.4 Add the entry to set the ppt functions for SMU IP v13.0.4. Signed-off-by: Tim Huang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 55c894945bda8cbf8a57d97c0514b282e3960cc0 Author: Tim Huang Date: Fri May 6 22:09:01 2022 +0800 drm/amdgpu/pm: add swsmu ppt implementation for SMU IP v13.0.4 Add swsmu ppt files for SMU IP v13.0.4. Signed-off-by: Tim Huang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit a0219175b3afacc5cf2fdeb1dade7dabbed29e75 Author: Tim Huang Date: Fri May 6 21:33:01 2022 +0800 drm/amdgpu/pm: add some common ppt functions for SMU IP v13.0.x Add some common ppt functions that will be used by SMU IP v13.0.x and drop the not used function smu_v13_0_mode2_reset. Signed-off-by: Tim Huang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 563cb2d82f3792075b43753d6589061d5d60edcc Author: Tim Huang Date: Fri May 6 21:25:40 2022 +0800 drm/amdgpu/pm: add EnableGfxImu message dummy map for SMU IP v13.0.4 The SMU needs this message to trigger IMU initialization. Signed-off-by: Tim Huang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 6384d44bc4aea1de1dd77825429d9889b084f021 Author: Huang Rui Date: Tue Apr 19 11:47:40 2022 +0800 drm/amdgpu/pm: add smu v13.0.4 driver SMU if headers Add smu v13.0.4 driver SMU interface headers. v2: squash in the header updates (Alex) Signed-off-by: Huang Rui Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 7bd3114b1caf3754290d11495dc3bf5145df3f25 Author: Jack Xiao Date: Wed May 11 23:03:25 2022 -0400 drm/amdgpu/gfx11: fix mes mqd settings Use the correct Memory Queue Descriptor (MQD) structure for GC 11. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2fc092d4c761f8df092398f59c73c3359a46ae5b Author: Jack Xiao Date: Wed May 11 23:01:10 2022 -0400 drm/amdgpu/gfx11: fix me field handling in map_queue packet Select the correct microengine (me) when using the map_queue packet. There are different me's for GFX, compute, and scheduling. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cdf4c8ec39872a61a58d62f19b4db80f0f7bc586 Author: Sathishkumar S Date: Wed May 11 16:35:59 2022 +0530 drm/amd/pm: update smartshift powerboost calc for smu13 smartshift apu and dgpu power boost are reported as percentage with respect to their power limits. adjust the units of power before calculating the percentage of boost. Signed-off-by: Sathishkumar S Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 138292f1dc00e7e0724f44769f9da39cf2f3bf0b Author: Sathishkumar S Date: Wed May 11 16:06:12 2022 +0530 drm/amd/pm: update smartshift powerboost calc for smu12 smartshift apu and dgpu power boost are reported as percentage with respect to their power limits. This value[0-100] reflects the boost for the respective device. Signed-off-by: Sathishkumar S Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 7226f40af6fcb48bd3f5ff63ee68ff5530dbdd75 Author: Lang Yu Date: Wed May 11 15:37:27 2022 +0800 drm/amdkfd: allocate MMIO/DOORBELL BOs with AMDGPU_GEM_CREATE_PREEMPTIBLE MMIO/DOORBELL BOs' backing resources(bus address resources that are used to talk to the GPU) are not managed by GTT manager, but they are counted by GTT manager. That makes no sense. With AMDGPU_GEM_CREATE_PREEMPTIBLE flag, such BOs will be managed by PREEMPT manager(for preemptible contexts, e.g., KFD). Then they won't be evicted and don't need to be pinned as well. But we still leave these BOs pinned to indicate that the underlying resource never moves. Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b992a19085885c096b19625a85c674cb89829ca1 Author: Haohui Mai Date: Sat Apr 30 00:34:00 2022 -0700 drm/amdgpu: Ensure the DMA engine is deactivated during set ups Setting the HALT bit of SDMA_F32_CNTL in all paths before programming the ring buffer of the SDMA engine. Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit 505c170b628d76fc3efc1b0cf3da8499f85a9b77 Author: Alex Deucher Date: Tue May 10 10:32:26 2022 -0400 drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2) Check if the requested stable pstate matches the current one before changing it. This avoids changing the stable pstate on context destroy if the user never changed it in the first place via the IOCTL. v2: compare the current and requested rather than setting a flag (Lijo) Fixes: 8cda7a4f96e435 ("drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates") Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 1e46ab91e55c43445cf36c1e88a92914fa912bfb Author: Yang Wang Date: Wed May 11 14:57:49 2022 +0800 drm/amd/pm: add smu power_limit callback for smu_v13_0_7 - get_power_limit - set_power_limit add above callback functions to enable power_cap hwmon node. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit d72a475b4881ccd5ee2cf6856b5b16fd030f11b9 Author: Yang Wang Date: Wed May 11 13:05:09 2022 +0800 drm/amd/pm: add smu feature map support for smu_v13_0_0 the pp_features can't display full feauture information when these mapping is not exiting. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 6b1407795e8a694c21f2c3c9bff56b9f66f30a84 Author: Yang Wang Date: Wed May 11 12:50:48 2022 +0800 drm/amd/pm: add smu feature map support for smu_v13_0_7 the pp_features can't display full feauture information when these mapping is not exiting. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit d6810d7dfaec516c046bf06e676d0539b96e69f6 Author: Sathishkumar S Date: Wed May 4 12:08:18 2022 +0530 drm/amd/pm: support ss metrics read for smu11 support reading smartshift apu and dgpu power for smu11 based asic v2: add new version of SmuMetrics and make calculation more readable (Lijo) v3: avoid calculations that result in -ve values and skip related checks v4: use the current power limit on dGPU and exclude smu 11_0_7 (Lijo) v5: remove redundant code (Lijo) Signed-off-by: Sathishkumar S Acked-by: Alex Deucher Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 87b5ab28efe39134d2549273c8e15c113a95507d Author: Yang Wang Date: Wed May 11 01:49:26 2022 +0800 drm/amd/pm: add smu pp_feature_mask callback for smu_v13_0_7 - set_pp_feature_mask - get_pp_feature_mask the pp_feature device node isn't working when above callback functions aren't provided. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ded2c4c345001a129293db4bc1fa9ae236ceb0d9 Author: Sai Krishna Potthuri Date: Thu May 12 12:49:53 2022 +0530 mmc: sdhci-of-arasan: Add NULL check for data field Add NULL check for data field retrieved from of_device_get_match_data() before dereferencing the data. Addresses-coverity: CID 305057:Dereference null return value (NULL_RETURNS) Signed-off-by: Sai Krishna Potthuri Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/1652339993-27280-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com Signed-off-by: Ulf Hansson commit d6da35e0c6d50f76eaf11a0496d3d2ec1a1fea3f Merge: 4419da5d5d4b1 42226c989789d Author: Greg Kroah-Hartman Date: Mon May 16 15:39:23 2022 +0200 Merge 5.18-rc7 into usb-next We need the tty fixes in here as well, as we need to revert one of them :( Signed-off-by: Greg Kroah-Hartman commit c5468a28efde5978644f1a7eef67780abcd16340 Merge: 843e5ba75ee85 42226c989789d Author: Arnaldo Carvalho de Melo Date: Mon May 16 10:14:59 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes from perf/urgent. Signed-off-by: Arnaldo Carvalho de Melo commit d84c3ad998795503379ef8458ffffb5c06d18cc5 Author: Krzysztof Kozlowski Date: Tue May 3 08:51:46 2022 +0200 dmaengine: sprd: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Switch to new property while keeping backward compatibility. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220503065147.51728-3-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 54326f37ec134c138dad4ae33bea048b0b186dd3 Author: Krzysztof Kozlowski Date: Tue May 3 08:51:45 2022 +0200 dt-bindings: dmaengine: sprd: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220503065147.51728-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit d0ad42388a396813771e9407614f40d128ad62db Author: Dave Jiang Date: Thu May 5 08:05:07 2022 -0700 dmaengine: idxd: skip irq free when wq type is not kernel Skip wq irq resources freeing when wq type is not kernel since the driver skips the irq alloction during wq enable. Add check in wq type check in idxd_wq_free_irq() to mirror idxd_wq_request_irq(). Fixes: 63c14ae6c161 ("dmaengine: idxd: refactor wq driver enable/disable operations") Reported-by: Tony Zu Tested-by: Tony Zu Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165176310726.2112428.7474366910758522079.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 8e6226f0f1a321de5f9ffdcb3fe920f94b45d38b Author: Dave Jiang Date: Fri May 6 15:23:52 2022 -0700 dmaengine: idxd: make idxd_register/unregister_dma_channel() static Since idxd_register/unregister_dma_channel() are only called locally, make them static. Reported-by: kernel test robot Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165187583222.3287435.12882651040433040246.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 8c5e74c90bb522181dfb051fffff3dad702e704d Author: Ricardo Koller Date: Mon May 9 17:16:33 2022 -0700 KVM: arm64: vgic: Undo work in failed ITS restores Failed ITS restores should clean up all state restored until the failure. There is some cleanup already present when failing to restore some tables, but it's not complete. Add the missing cleanup. Note that this changes the behavior in case of a failed restore of the device tables. restore ioctl: 1. restore collection tables 2. restore device tables With this commit, failures in 2. clean up everything created so far, including state created by 1. Reviewed-by: Eric Auger Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510001633.552496-5-ricarkol@google.com commit a1ccfd6f6e06eceb632cc29c4f15a32860f05a7e Author: Ricardo Koller Date: Mon May 9 17:16:32 2022 -0700 KVM: arm64: vgic: Do not ignore vgic_its_restore_cte failures Restoring a corrupted collection entry (like an out of range ID) is being ignored and treated as success. More specifically, a vgic_its_restore_cte failure is treated as success by vgic_its_restore_collection_table. vgic_its_restore_cte uses positive and negative numbers to return error, and +1 to return success. The caller then uses "ret > 0" to check for success. Fix this by having vgic_its_restore_cte only return negative numbers on error. Do this by changing alloc_collection return codes to only return negative numbers on error. Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510001633.552496-4-ricarkol@google.com commit 243b1f6c8f0748bd7b03eab17323f1187e580771 Author: Ricardo Koller Date: Mon May 9 17:16:31 2022 -0700 KVM: arm64: vgic: Add more checks when restoring ITS tables Try to improve the predictability of ITS save/restores (and debuggability of failed ITS saves) by failing early on restore when trying to read corrupted tables. Restoring the ITS tables does some checks for corrupted tables, but not as many as in a save: an overflowing device ID will be detected on save but not on restore. The consequence is that restoring a corrupted table won't be detected until the next save; including the ITS not working as expected after the restore. As an example, if the guest sets tables overlapping each other, which would most likely result in some corrupted table, this is what we would see from the host point of view: guest sets base addresses that overlap each other save ioctl restore ioctl save ioctl (fails) Ideally, we would like the first save to fail, but overlapping tables could actually be intended by the guest. So, let's at least fail on the restore with some checks: like checking that device and event IDs don't overflow their tables. Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510001633.552496-3-ricarkol@google.com commit cafe7e544d4979da222eaff12141ecac07901b9c Author: Ricardo Koller Date: Mon May 9 17:16:30 2022 -0700 KVM: arm64: vgic: Check that new ITEs could be saved in guest memory Try to improve the predictability of ITS save/restores by failing commands that would lead to failed saves. More specifically, fail any command that adds an entry into an ITS table that is not in guest memory, which would otherwise lead to a failed ITS save ioctl. There are already checks for collection and device entries, but not for ITEs. Add the corresponding check for the ITT when adding ITEs. Reviewed-by: Eric Auger Signed-off-by: Ricardo Koller Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510001633.552496-2-ricarkol@google.com commit 517a710ac8fe9cbc48d0ec3ca81377f6ef3b86b7 Author: Radhey Shyam Pandey Date: Tue May 10 12:42:42 2022 +0530 dmaengine: zynqmp_dma: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() pm_runtime_resume_and_get() automatically handle dev->power.usage_count decrement on errors, so prefer using it and also implement it's error handling. Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1652166762-18317-4-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul commit 9126518e0439bc4b47b15d0da42f0cdba7a74b3a Author: Shravya Kumbham Date: Tue May 10 12:42:41 2022 +0530 dmaengine: zynqmp_dma: check dma_async_device_register return value Add condition to check the return value of dma_async_device_register and implement its error handling. Addresses-Coverity: Event check_return. Signed-off-by: Shravya Kumbham Signed-off-by: Harini Katakam Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1652166762-18317-3-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul commit f9a9f43a62a04ec3183fb0da9226c7706eed0115 Author: Radhey Shyam Pandey Date: Tue May 10 12:42:40 2022 +0530 dmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix desc_size data type In zynqmp_dma_alloc/free_chan_resources functions there is a potential overflow in the below expressions. dma_alloc_coherent(chan->dev, (2 * chan->desc_size * ZYNQMP_DMA_NUM_DESCS), &chan->desc_pool_p, GFP_KERNEL); dma_free_coherent(chan->dev,(2 * ZYNQMP_DMA_DESC_SIZE(chan) * ZYNQMP_DMA_NUM_DESCS), chan->desc_pool_v, chan->desc_pool_p); The arguments desc_size and ZYNQMP_DMA_NUM_DESCS were 32 bit. Though this overflow condition is not observed but it is a potential problem in the case of 32-bit multiplication. Hence fix it by changing the desc_size data type to size_t. In addition to coverity fix it also reuse ZYNQMP_DMA_DESC_SIZE macro in dma_alloc_coherent API argument. Addresses-Coverity: Event overflow_before_widen. Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1652166762-18317-2-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul commit 4734afb0d5ed3e56494ca6f28e51bafafef4c6aa Author: Dave Jiang Date: Wed May 11 17:00:57 2022 -0700 dmaengine: idxd: remove redudant idxd_wq_disable_cleanup() call idxd_wq_device_reset_cleanup() already calls idxd_wq_disable_cleanup(). There is no need to call idxd_wq_disable_cleanup() again in idxd_device_wqs_clear_state(). Remove redudant call from idxd_wq_device_reset_cleanup(). Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits after disabling device") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165231365717.986350.2441351765955825964.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 9120c879d28873829dfa2f511c68162d52540e6a Author: Dave Jiang Date: Wed May 11 17:01:13 2022 -0700 dmaengine: idxd: free irq before wq type is reset Call idxd_wq_free_irq() in the drv_disable_wq() function before idxd_wq_reset() is called. Otherwise the wq type is reset and the irq does not get freed. Fixes: 63c14ae6c161 ("dmaengine: idxd: refactor wq driver enable/disable operations") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165231367316.986407.11001767338124941736.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit cf4ac3fef33883a14131d8925d7edfbdb7d69b68 Author: Dave Jiang Date: Wed May 11 17:00:44 2022 -0700 dmaengine: idxd: fix lockdep warning on device driver removal Jacob reported that with lockdep debug turned on, idxd_device_driver removal causes kernel splat from lock assert warning for idxd_device_wqs_clear_state(). Make sure idxd_device_wqs_clear_state() holds the wq lock for each wq when cleaning the wq state. Move the call outside of the device spinlock. Reported-by: Jacob Pan Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165231364426.986304.9294302800482492780.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 42a1b73852c4a176d233a192422b5e1d0ba67cbf Author: Dave Jiang Date: Wed May 11 17:11:57 2022 -0700 dmaengine: idxd: Separate user and kernel pasid enabling The idxd driver always gated the pasid enabling under a single knob and this assumption is incorrect. The pasid used for kernel operation can be independently toggled and has no dependency on the user pasid (and vice versa). Split the two so they are independent "enabled" flags. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165231431746.986466.5666862038354800551.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 20492a62b99bd4367b79a76ca288d018f11980db Author: Marc Zyngier Date: Mon May 16 13:02:24 2022 +0100 KVM: arm64: pmu: Restore compilation when HW_PERF_EVENTS isn't selected Moving kvm_pmu_events into the vcpu (and refering to it) broke the somewhat unusual case where the kernel has no support for a PMU at all. In order to solve this, move things around a bit so that we can easily avoid refering to the pmu structure outside of PMU-aware code. As a bonus, pmu.c isn't compiled in when HW_PERF_EVENTS isn't selected. Reported-by: kernel test robot Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/202205161814.KQHpOzsJ-lkp@intel.com commit 491bf8f236fdeec698fa6744993f1ecf3fafd1a5 Author: Xie Yongji Date: Tue Mar 22 16:06:39 2022 +0800 nbd: Fix hung on disconnect request if socket is closed before When userspace closes the socket before sending a disconnect request, the following I/O requests will be blocked in wait_for_reconnect() until dead timeout. This will cause the following disconnect request also hung on blk_mq_quiesce_queue(). That means we have no way to disconnect a nbd device if there are some I/O requests waiting for reconnecting until dead timeout. It's not expected. So let's wake up the thread waiting for reconnecting directly when a disconnect request is sent. Reported-by: Xu Jianhai Signed-off-by: Xie Yongji Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220322080639.142-1-xieyongji@bytedance.com Signed-off-by: Jens Axboe commit 4c41186ff394680cbde32a6a29e539f1e6036a47 Author: Stefan Berger Date: Fri May 13 13:41:05 2022 -0400 evm: Clean up some variables Make hmac_tfm static since it's not used anywhere else besides the file it is in. Remove declaration of hash_tfm since it doesn't exist. Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar commit e11afdbb22a39807e1f0cb707974ddd2c03e90a4 Author: Stefan Berger Date: Thu May 12 07:43:07 2022 -0400 evm: Return INTEGRITY_PASS for enum integrity_status value '0' Return INTEGRITY_PASS for the enum integrity_status rather than 0. Signed-off-by: Stefan Berger Signed-off-by: Mimi Zohar commit 73ae97e3cabb580639f02f12a192324a53c4bebb Author: Potin Lai Date: Mon May 9 19:56:16 2022 +0200 mtd: spi-nor: aspeed: set the decoding size to at least 2MB for AST2600 In AST2600, the unit of SPI CEx decoding range register is 1MB, and end address offset is set to the acctual offset - 1MB. If the flash only has 1MB, the end address will has same value as start address, which will causing unexpected errors. This patch set the decoding size to at least 2MB to avoid decoding errors. Tested: root@bletchley:~# dmesg | grep "aspeed-smc 1e631000.spi: CE0 window" [ 59.328134] aspeed-smc 1e631000.spi: CE0 window resized to 2MB (AST2600 Decoding) [ 59.343001] aspeed-smc 1e631000.spi: CE0 window [ 0x50000000 - 0x50200000 ] 2MB root@bletchley:~# devmem 0x1e631030 0x00100000 Tested-by: Jae Hyun Yoo Signed-off-by: Potin Lai [ clg : Ported on new spi-mem driver ] Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-12-clg@kaod.org Signed-off-by: Mark Brown commit eeaec1ea05c0e0f08e04c6844f20cc24a2fcc0f4 Author: Cédric Le Goater Date: Mon May 9 19:56:13 2022 +0200 spi: aspeed: Calibrate read timings To accommodate the different response time of SPI transfers on different boards and different SPI NOR devices, the Aspeed controllers provide a set of Read Timing Compensation registers to tune the timing delays depending on the frequency being used. The AST2600 SoC has one of these registers per device. On the AST2500 and AST2400 SoCs, the timing register is shared by all devices which is problematic to get good results other than for one device. The algorithm first reads a golden buffer at low speed and then performs reads with different clocks and delay cycle settings to find a breaking point. This selects a default good frequency for the CEx control register. The current settings are a bit optimistic as we pick the first delay giving good results. A safer approach would be to determine an interval and choose the middle value. Calibration is performed when the direct mapping for reads is created. Since the underlying spi-nor object needs to be initialized to create the spi_mem operation for direct mapping, we should be fine. Having a specific API would clarify the requirements though. Cc: Pratyush Yadav Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-9-clg@kaod.org Signed-off-by: Mark Brown commit 53526ab27d9c256504f267713aea60db7af18fb0 Author: Cédric Le Goater Date: Mon May 9 19:56:12 2022 +0200 spi: aspeed: Add support for the AST2400 SPI controller Extend the driver for the AST2400 SPI Flash Controller (SPI). This controller has a slightly different interface which requires adaptation of the 4B handling. Summary of features : . host Firmware . 1 chip select pin (CE0) . slightly different register set, between AST2500 and the legacy controller . no segment registers . single, dual mode. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-8-clg@kaod.org Signed-off-by: Mark Brown commit 5785eedee42c34cfec496199a80fa8ec9ddcf7fe Author: Cédric Le Goater Date: Mon May 9 19:56:11 2022 +0200 spi: aspeed: Workaround AST2500 limitations It is not possible to configure a full 128MB window for a chip of the same size on the AST2500 SPI controller. For this case, the maximum window size is restricted to 120MB for CE0. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-7-clg@kaod.org Signed-off-by: Mark Brown commit bb084f94e1bca4a5c4f689d7aa9b410220c1ed71 Author: Cédric Le Goater Date: Mon May 9 19:56:10 2022 +0200 spi: aspeed: Adjust direct mapping to device size The segment registers of the FMC/SPI controllers provide a way to configure the mapping window of the flash device contents on the AHB bus. Adjust this window to the size of the spi-mem mapping. Things get more complex with multiple devices. The driver needs to also adjust the window of the next device to make sure that there is no overlap, even if there is no available device. The proposal below is not perfect but it is covering all the cases we have seen on different boards with one and two devices on the same bus. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-6-clg@kaod.org Signed-off-by: Mark Brown commit 9da06d7bdec7dad8018c23b180e410ef2e7a4367 Author: Cédric Le Goater Date: Mon May 9 19:56:09 2022 +0200 spi: aspeed: Add support for direct mapping Use direct mapping to read the flash device contents. This operation mode is called "Command mode" on Aspeed SoC SMC controllers. It uses a Control Register for the settings to apply when a memory operation is performed on the flash device mapping window. If the window is not big enough, fall back to the "User mode" to perform the read. Direct mapping for writes will come later when validated. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-5-clg@kaod.org Signed-off-by: Mark Brown commit e3228ed92893458e360ba2be8d75d859e115e552 Author: Cédric Le Goater Date: Mon May 9 19:56:08 2022 +0200 spi: spi-mem: Convert Aspeed SMC driver to spi-mem This SPI driver adds support for the Aspeed static memory controllers of the AST2600, AST2500 and AST2400 SoCs using the spi-mem interface. * AST2600 Firmware SPI Memory Controller (FMC) . BMC firmware . 3 chip select pins (CE0 ~ CE2) . Only supports SPI type flash memory . different segment register interface . single, dual and quad mode. * AST2600 SPI Flash Controller (SPI1 and SPI2) . host firmware . 2 chip select pins (CE0 ~ CE1) . different segment register interface . single, dual and quad mode. * AST2500 Firmware SPI Memory Controller (FMC) . BMC firmware . 3 chip select pins (CE0 ~ CE2) . supports SPI type flash memory (CE0-CE1) . CE2 can be of NOR type flash but this is not supported by the driver . single, dual mode. * AST2500 SPI Flash Controller (SPI1 and SPI2) . host firmware . 2 chip select pins (CE0 ~ CE1) . single, dual mode. * AST2400 New Static Memory Controller (also referred as FMC) . BMC firmware . New register set . 5 chip select pins (CE0 ∼ CE4) . supports NOR flash, NAND flash and SPI flash memory. . single, dual and quad mode. Each controller has a memory range on which flash devices contents are mapped. Each device is assigned a window that can be changed at bootime with the Segment Address Registers. Each SPI flash device can then be accessed in two modes: Command and User. When in User mode, SPI transfers are initiated with accesses to the memory segment of a device. When in Command mode, memory operations on the memory segment of a device generate SPI commands automatically using a Control Register for the settings. This initial patch adds support for User mode. Command mode needs a little more work to check that the memory window on the AHB bus fits the device size. It will come later when support for direct mapping is added. Single and dual mode RX transfers are supported. Other types than SPI are not supported. Reviewed-by: Joel Stanley Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Signed-off-by: Chin-Ting Kuo Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-4-clg@kaod.org Signed-off-by: Mark Brown commit ce9858ea499da025684a7a5f19823c2c3f14bdce Author: Cédric Le Goater Date: Mon May 9 19:56:07 2022 +0200 spi: Convert the Aspeed SMC controllers device tree binding The "interrupt" property is optional because it is only necessary for controllers supporting DMAs (Not implemented yet in the new driver). Cc: Chin-Ting Kuo Tested-by: Joel Stanley Tested-by: Tao Ren Tested-by: Jae Hyun Yoo Reviewed-by: Joel Stanley Reviewed-by: Rob Herring Signed-off-by: Cédric Le Goater Link: https://lore.kernel.org/r/20220509175616.1089346-3-clg@kaod.org Signed-off-by: Mark Brown commit 2def44d3aec59e38d2701c568d65540783f90f2f Author: Lin Ma Date: Mon May 16 17:20:35 2022 +0800 ASoC: rt5645: Fix errorenous cleanup order There is a logic error when removing rt5645 device as the function rt5645_i2c_remove() first cancel the &rt5645->jack_detect_work and delete the &rt5645->btn_check_timer latter. However, since the timer handler rt5645_btn_check_callback() will re-queue the jack_detect_work, this cleanup order is buggy. That is, once the del_timer_sync in rt5645_i2c_remove is concurrently run with the rt5645_btn_check_callback, the canceled jack_detect_work will be rescheduled again, leading to possible use-after-free. This patch fix the issue by placing the del_timer_sync function before the cancel_delayed_work_sync. Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20220516092035.28283-1-linma@zju.edu.cn Signed-off-by: Mark Brown commit 232213bd73bbb381b05b729829fdb5d00e0a8fdf Author: Charles Keepax Date: Fri May 13 10:05:32 2022 +0100 ASoC: soc-component: Update handling to component delays Currently the checking for if a component sits on the CPU or CODEC side of the DAI link is done with a helper function that checks if the component defines legacy_dai_naming. However, there are already a couple of CPU side components that explicitly opt in to non-legacy DAI naming and it doesn't seem like a very robust solution. Rather than looking for the flag check if the component is attached to any of the CODEC DAIs on the DAI link. This is more robust and helps to bring the core further in the direction of a component being a generic block rather than being classified as platform or CODEC drivers. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220513090532.1450944-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8c8a0f01c7c52f9037b6859ff5234ea5acf572d6 Author: Charles Keepax Date: Fri May 13 10:05:31 2022 +0100 ASoC: core: Pass legacy_dai_naming flag directly Passing the result of the helper function snd_soc_component_is_codec to snd_soc_register_dai is less clear than just passing the DAI naming flag directly. snd_soc_register_dai wants to know if it should use the legacy DAI naming. The CODEC distinction is more of a historical thing and not obviously directly related, and there are already a couple of CPU side components that explicitly opt in to non-legacy DAI naming. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220513090532.1450944-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 64c917d1cfd70ff827c9ea37277a97762ea372d4 Author: Charles Keepax Date: Fri May 13 10:05:30 2022 +0100 ASoC: core: Correct spelling fliped -> flipped Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220513090532.1450944-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a34840c4eb3278a7c29c9c57a65ce7541c66f9f2 Author: Miaoqian Lin Date: Thu May 12 15:13:30 2022 +0400 ASoC: ti: j721e-evm: Fix refcount leak in j721e_soc_probe_* of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not needed anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 6748d0559059 ("ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220512111331.44774-1-linmq006@gmail.com Signed-off-by: Mark Brown commit d91835655cc9047f8b5c40530791bd3bc020f1bd Author: YueHaibing Date: Sat May 14 10:38:06 2022 +0800 ASoC: amd: vangogh: Remove duplicate include files Remove duplicated includes. Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220514023806.34768-1-yuehaibing@huawei.com Signed-off-by: Mark Brown commit e0100bfd383c7d994d2e957e85ca56a5fe5a3f43 Author: Tinghan Shen Date: Thu May 12 16:22:15 2022 +0800 ASoC: SOF: mediatek: Add mt8186 ipc support mt8186 DSP uses two hardware mailbox IP to communicate with AP. One mailbox is used for requests coming from AP, and the other one is for requests from DSP. Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Link: https://lore.kernel.org/r/20220512082215.3018-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit aea9350108ed1627f8610c93de44578162b3ee91 Author: Allen-KH Cheng Date: Thu May 12 16:22:14 2022 +0800 ASoC: SOF: mediatek: Add ipc support for mt8195 This patch adds mt8195 IPC support by using mailbox. On mt8195 resource, there are two mboxes used to handle ipc request and reply. We create a mtk-adsp-ipc client device to request mbox controllers. Signed-off-by: Allen-KH Cheng Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220512082215.3018-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 9db69df4bdd37eb1f65b6931ee067fb15b9a4d5c Author: TingHan Shen Date: Thu May 12 16:22:13 2022 +0800 firmware: mediatek: Add adsp ipc protocol interface Some of mediatek processors contain the Tensilica HiFix DSP for audio processing. The communication between Host CPU and DSP firmware is taking place using a shared memory area for message passing. ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs. We use two mbox channels to implement a request-reply protocol. Signed-off-by: Allen-KH Cheng Signed-off-by: TingHan Shen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Curtis Malainey Reviewed-by: Tzung-Bi Shih Reviewed-by: YC Hung Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220512082215.3018-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit af0bd3c0ffae8c11790ab0108787c03767869a9a Author: Shengjiu Wang Date: Mon May 16 16:06:12 2022 +0800 ASoC: fsl_sai: Add support for i.MX8ULP Add i.MX8ULP specific soc data, the max register is FSL_SAI_RTCAP the IP version is also 0x0301, So version can't be used for the condition of register FSL_SAI_MCTL setting. Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/1652688372-10274-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 2530c5e875eab853125265b4f24a69e042d9580b Author: Shengjiu Wang Date: Mon May 16 16:06:11 2022 +0800 ASoC: fsl_sai: Add support for i.MX8M Plus Add i.MX8M Plus specific soc data, the max register is FSL_SAI_MDIV. Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/1652688372-10274-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 9e71bc33ae0d402b1579dc7a7afb3916dd35cb17 Author: Shengjiu Wang Date: Mon May 16 16:06:10 2022 +0800 ASoC: fsl_sai: Add support for i.MX8MM On i.MX8MM the max register is FSL_SAI_MCTL, which is different with previous platform, so add max_register in soc data to distinguish platforms. And add specific soc data for i.MX8MM Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/1652688372-10274-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit b965182aee6e391084addcd25be3134d82fddb22 Author: Geert Uytterhoeven Date: Mon May 2 15:34:56 2022 +0200 dt-bindings: renesas,rcar-dmac: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/e6e4cf701f3a43b061b9c3f7f0adc4d6addd4722.1651497024.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit aab08c1aac01097815fbcf10fce7021d2396a31f Author: Christophe JAILLET Date: Thu Apr 21 08:13:38 2022 +0200 dmaengine: idxd: Fix the error handling path in idxd_cdev_register() If a call to alloc_chrdev_region() fails, the already allocated resources are leaking. Add the needed error handling path to fix the leak. Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland") Signed-off-by: Christophe JAILLET Acked-by: Dave Jiang Link: https://lore.kernel.org/r/1b5033dcc87b5f2a953c413f0306e883e6114542.1650521591.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 461cd3709f266d179064b0a63d8949fa2e75ff72 Author: Akhil R Date: Thu May 5 14:44:40 2022 +0530 dmaengine: tegra: Use platform_get_irq() to get IRQ resource Use platform_irq_get() instead platform_get_resource() for IRQ resource to fix the probe failure. platform_get_resource() fails to fetch the IRQ resource as it might not be ready at that time. platform_irq_get() is also the recommended way to get interrupt as it directly gives the IRQ number and no conversion from resource is required. Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver") Reported-by: Jonathan Hunter Signed-off-by: Akhil R Acked-by: Thierry Reding Reviewed-by: Jon Hunter Link: https://lore.kernel.org/r/20220505091440.12981-1-akhilrajeev@nvidia.com Signed-off-by: Vinod Koul commit 71abb4df29815d17f3dff98dce553fc1732d9738 Author: Wan Jiabing Date: Fri May 13 15:55:54 2022 +0800 ata: pata_ftide010: Remove unneeded ERROR check before clk_disable_unprepare ERROR check is already in clk_disable() and clk_unprepare() by using IS_ERR_OR_NULL. Remove unneeded ERROR check for ftide->pclk here. Signed-off-by: Wan Jiabing Reviewed-by: Sergey Shtylyov Reviewed-by: Linus Walleij Signed-off-by: Damien Le Moal commit f74360d3440ccf3bb10178f2805498c835c3ed5d Author: Florian Westphal Date: Thu May 12 17:08:47 2022 +0200 netfilter: conntrack: remove pr_debug callsites from tcp tracker They are either obsolete or useless. Those in the normal processing path cannot be enabled on a production system; they generate too much noise. One pr_debug call resides in an error path and does provide useful info, merge it with the existing nf_log_invalid(). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d265929930e2ffafc744c0ae05fb70acd53be1ee Author: William Tu Date: Wed May 4 08:35:59 2022 -0700 netfilter: nf_conncount: reduce unnecessary GC Currently nf_conncount can trigger garbage collection (GC) at multiple places. Each GC process takes a spin_lock_bh to traverse the nf_conncount_list. We found that when testing port scanning use two parallel nmap, because the number of connection increase fast, the nf_conncount_count and its subsequent call to __nf_conncount_add take too much time, causing several CPU lockup. This happens when user set the conntrack limit to +20,000, because the larger the limit, the longer the list that GC has to traverse. The patch mitigate the performance issue by avoiding unnecessary GC with a timestamp. Whenever nf_conncount has done a GC, a timestamp is updated, and beforce the next time GC is triggered, we make sure it's more than a jiffies. By doin this we can greatly reduce the CPU cycles and avoid the softirq lockup. To reproduce it in OVS, $ ovs-appctl dpctl/ct-set-limits zone=1,limit=20000 $ ovs-appctl dpctl/ct-get-limits At another machine, runs two nmap $ nmap -p1- $ nmap -p1- Signed-off-by: William Tu Co-authored-by: Yifeng Sun Reported-by: Greg Rose Suggested-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2c50fc04757f16427e6213989cee9182c50e2c8a Author: Martin Willi Date: Tue Apr 19 15:47:01 2022 +0200 netfilter: Use l3mdev flow key when re-routing mangled packets Commit 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") introduces a flow key specific for layer 3 domains, such as a VRF master device. This allows for explicit VRF domain selection instead of abusing the oif flow key. Update ip[6]_route_me_harder() to make use of that new key when re-routing mangled packets within VRFs instead of setting the flow oif, making it consistent with other users. Signed-off-by: Martin Willi Reviewed-by: David Ahern Signed-off-by: Pablo Neira Ayuso commit c11117b634f4f832c4420d3cf41c44227f140ce1 Author: Takashi Iwai Date: Mon May 16 12:48:07 2022 +0200 ALSA: usb-audio: Refcount multiple accesses on the single clock When a clock source is connected to multiple nodes / endpoints, the current USB-audio driver tries to set up at each time one of them is configured. Although it reads the current rate and updates only if it differs, some devices seem unhappy with this behavior and spew the errors when reading/updating the rate unnecessarily. This patch tries to reduce the redundant clock setup by introducing a refcount for each clock source. When the stream is actually running, a clock rate is "locked", and it bypasses the clock and/or refuse to change any longer. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215934 Link: https://lore.kernel.org/r/20220516104807.16482-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit d887ae3247e022183f244cb325dca1dfbd0a9ed0 Author: Minghao Chi Date: Fri May 13 08:19:18 2022 +0000 octeontx2-pf: Remove unnecessary synchronize_irq() before free_irq() Calling synchronize_irq() right before free_irq() is quite useless. On one hand the IRQ can easily fire again before free_irq() is entered, on the other hand free_irq() itself calls synchronize_irq() internally (in a race condition free way), before any state associated with the IRQ is freed. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit b321dfafb0b99e285d14bcaae00b4f9093556eb6 Author: YueHaibing Date: Fri May 13 15:56:11 2022 +0800 net: wwan: t7xx: Fix return type of t7xx_dl_add_timedout() t7xx_dl_add_timedout() now return int 'ret', but the return type is bool. Change the return type to int for furthor errcode upstream. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 1dee43c2c6f159c26684e02a56373bb3b537ab24 Author: Ziyang Xuan Date: Fri May 13 15:29:28 2022 +0800 octeon_ep: delete unnecessary NULL check vfree(NULL) is safe. NULL check before vfree() is not needed. Delete them to simplify the code. Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller commit e68372efb9feae33467bdbea2654f3d91b2e0466 Author: Zheng Bin Date: Fri May 13 15:10:18 2022 +0800 octeon_ep: add missing destroy_workqueue in octep_init_module octep_init_module misses destroy_workqueue in error path, this patch fixes that. Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Zheng Bin Signed-off-by: David S. Miller commit ee3398c78767b1fe9f5cdac04295abb96496d3e4 Merge: 3daebfbeb4555 909876500251b Author: David S. Miller Date: Mon May 16 11:33:59 2022 +0100 Merge branch 'net-skb-defer-freeing-polish' Eric Dumazet says: ==================== net: polish skb defer freeing While testing this recently added feature on a variety of platforms/configurations, I found the following issues: 1) A race leading to concurrent calls to smp_call_function_single_async() 2) Missed opportunity to use napi_consume_skb() 3) Need to limit the max length of the per-cpu lists. 4) Process the per-cpu list more frequently, for the (unusual) case where net_rx_action() has mutiple napi_poll() to process per round. ==================== Signed-off-by: David S. Miller commit 909876500251b3b48480a840bbf9053588254eee Author: Eric Dumazet Date: Sun May 15 21:24:56 2022 -0700 net: call skb_defer_free_flush() before each napi_poll() skb_defer_free_flush() can consume cpu cycles, it seems better to call it in the inner loop: - Potentially frees page/skb that will be reallocated while hot. - Account for the cpu cycles in the @time_limit determination. - Keep softnet_data.defer_count small to reduce chances for skb_attempt_defer_free() to send an IPI. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 39564c3fdc6684c6726b63e131d2a9f3809811cb Author: Eric Dumazet Date: Sun May 15 21:24:55 2022 -0700 net: add skb_defer_max sysctl commit 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") added another per-cpu cache of skbs. It was expected to be small, and an IPI was forced whenever the list reached 128 skbs. We might need to be able to control more precisely queue capacity and added latency. An IPI is generated whenever queue reaches half capacity. Default value of the new limit is 64. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 2db60eed1a957423cf06ee1060fc45ed3971990d Author: Eric Dumazet Date: Sun May 15 21:24:54 2022 -0700 net: use napi_consume_skb() in skb_defer_free_flush() skb_defer_free_flush() runs from softirq context, we have the opportunity to refill the napi_alloc_cache, and/or use kmem_cache_free_bulk() when this cache is full. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 97e719a82b43c6c2bb5eebdb3c5d479a332ac2ac Author: Eric Dumazet Date: Sun May 15 21:24:53 2022 -0700 net: fix possible race in skb_attempt_defer_free() A cpu can observe sd->defer_count reaching 128, and call smp_call_function_single_async() Problem is that the remote CPU can clear sd->defer_count before the IPI is run/acknowledged. Other cpus can queue more packets and also decide to call smp_call_function_single_async() while the pending IPI was not yet delivered. This is a common issue with smp_call_function_single_async(). Callers must ensure correct synchronization and serialization. I triggered this issue while experimenting smaller threshold. Performing the call to smp_call_function_single_async() under sd->defer_lock protection did not solve the problem. Commit 5a18ceca6350 ("smp: Allow smp_call_function_single_async() to insert locked csd") replaced an informative WARN_ON_ONCE() with a return of -EBUSY, which is often ignored. Test of CSD_FLAG_LOCK presence is racy anyway. Fixes: 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3daebfbeb4555cb0c113aeb88aa469192ee41d89 Author: Rolf Eike Beer Date: Fri May 13 19:23:59 2022 +0200 net: tulip: convert to devres Works fine on my HP C3600: [ 274.452394] tulip0: no phy info, aborting mtable build [ 274.499041] tulip0: MII transceiver #1 config 1000 status 782d advertising 01e1 [ 274.750691] net eth0: Digital DS21142/43 Tulip rev 65 at MMIO 0xf4008000, 00:30:6e:08:7d:21, IRQ 17 [ 283.104520] net eth0: Setting full-duplex based on MII#1 link partner capability of c1e1 Signed-off-by: Rolf Eike Beer Signed-off-by: David S. Miller commit d93185a92918c38996dbe24ecb6bb0f30078bc75 Merge: e99a2d6bcdb0b 25c321e8534e9 Author: Kalle Valo Date: Mon May 16 13:16:34 2022 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.19. Major changes: ath11k * enable keepalive during WoWLAN suspend * implement remain-on-channel support commit e99a2d6bcdb0b40c98b345b1e838e09dc21fc9da Merge: 569cf386ec5f4 5fc201aa8cf39 Author: Kalle Valo Date: Mon May 16 13:11:58 2022 +0300 Merge tag 'mt76-for-kvalo-2022-05-12' of https://github.com/nbd168/wireless mt76 patches for 5.19 - tx locking improvements - wireless ethernet dispatch support for flow offload - non-standard VHT MCS10-11 support - fixes - runtime PM improvements - mt7921 AP mode support - mt7921 ipv6 NS offload support commit 382d917bfc1e92339dae3c8a636b2730e8bb5132 Author: Zheng Bin Date: Fri May 13 15:09:22 2022 +0800 net: hinic: add missing destroy_workqueue in hinic_pf_to_mgmt_init hinic_pf_to_mgmt_init misses destroy_workqueue in error path, this patch fixes that. Fixes: 6dbb89014dc3 ("hinic: fix sending mailbox timeout in aeq event work") Signed-off-by: Zheng Bin Signed-off-by: David S. Miller commit 6ee1d84b2b78af4cff0d9714da81c752baf4b01e Merge: 3aba103006bcc f8319dfd1b3b3 Author: David S. Miller Date: Mon May 16 10:47:44 2022 +0100 Merge branch 'skb-drop-reason-boundary' Menglong Dong says: ==================== net: skb: check the boundrary of skb drop reason In the commit 1330b6ef3313 ("skb: make drop reason booleanable"), SKB_NOT_DROPPED_YET is added to the enum skb_drop_reason, which makes the invalid drop reason SKB_NOT_DROPPED_YET can leak to the kfree_skb tracepoint. Once this happen (it happened, as 4th patch says), it can cause NULL pointer in drop monitor and result in kernel panic. Therefore, check the boundrary of drop reason in both kfree_skb_reason (2th patch) and drop monitor (1th patch) to prevent such case happens again. Meanwhile, fix the invalid drop reason passed to kfree_skb_reason() in tcp_v4_rcv() and tcp_v6_rcv(). Changes since v2: 1/4 - don't reset the reason and print the debug warning only (Jakub Kicinski) 4/4 - remove new lines between tags Changes since v1: - consider tcp_v6_rcv() in the 4th patch ==================== Signed-off-by: David S. Miller commit f8319dfd1b3b3be6c08795017fc30f880f8bc861 Author: Menglong Dong Date: Fri May 13 11:03:39 2022 +0800 net: tcp: reset 'drop_reason' to NOT_SPCIFIED in tcp_v{4,6}_rcv() The 'drop_reason' that passed to kfree_skb_reason() in tcp_v4_rcv() and tcp_v6_rcv() can be SKB_NOT_DROPPED_YET(0), as it is used as the return value of tcp_inbound_md5_hash(). And it can panic the kernel with NULL pointer in net_dm_packet_report_size() if the reason is 0, as drop_reasons[0] is NULL. Fixes: 1330b6ef3313 ("skb: make drop reason booleanable") Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit 7ebd3f3ee51a9e02994cd0a1be44fbd325d1e0dc Author: Menglong Dong Date: Fri May 13 11:03:38 2022 +0800 net: skb: change the definition SKB_DR_SET() The SKB_DR_OR() is used to set the drop reason to a value when it is not set or specified yet. SKB_NOT_DROPPED_YET should also be considered as not set. Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit 20bbcd0a94c6686c2692e6f7081163c233d7ce40 Author: Menglong Dong Date: Fri May 13 11:03:37 2022 +0800 net: skb: check the boundrary of drop reason in kfree_skb_reason() Sometimes, we may forget to reset skb drop reason to NOT_SPECIFIED after we make it the return value of the functions with return type of enum skb_drop_reason, such as tcp_inbound_md5_hash. Therefore, its value can be SKB_NOT_DROPPED_YET(0), which is invalid for kfree_skb_reason(). So we check the range of drop reason in kfree_skb_reason() with DEBUG_NET_WARN_ON_ONCE(). Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit a3af33abd9210c93dc829b4fdd7a19f63f168a25 Author: Menglong Dong Date: Fri May 13 11:03:36 2022 +0800 net: dm: check the boundary of skb drop reasons The 'reason' will be set to 'SKB_DROP_REASON_NOT_SPECIFIED' if it not small that SKB_DROP_REASON_MAX in net_dm_packet_trace_kfree_skb_hit(), but it can't avoid it to be 0, which is invalid and can cause NULL pointer in drop_reasons. Therefore, reset it to SKB_DROP_REASON_NOT_SPECIFIED when 'reason <= 0'. Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit 3aba103006bcc4a7472b7c9506b3bc065ffb7992 Author: Guangguan Wang Date: Fri May 13 10:24:53 2022 +0800 net/smc: align the connect behaviour with TCP Connect with O_NONBLOCK will not be completed immediately and returns -EINPROGRESS. It is possible to use selector/poll for completion by selecting the socket for writing. After select indicates writability, a second connect function call will return 0 to indicate connected successfully as TCP does, but smc returns -EISCONN. Use socket state for smc to indicate connect state, which can help smc aligning the connect behaviour with TCP. Signed-off-by: Guangguan Wang Acked-by: Karsten Graul Signed-off-by: David S. Miller commit e97e68b56e78303581a03b26e95f6c0c03ecbbe2 Merge: 7fa2e481ff2fe eda090c31fe92 Author: David S. Miller Date: Mon May 16 10:31:06 2022 +0100 Merge branch 'sk_bound_dev_if-annotations' Eric Dumazet says: ==================== net: add annotations for sk->sk_bound_dev_if While writes on sk->sk_bound_dev_if are protected by socket lock, we have many lockless reads all over the places. This is based on syzbot report found in the first patch changelog. v2: inline ipv6 function only defined if IS_ENABLED(CONFIG_IPV6) (kernel bots) Change the INET6_MATCH() to inet6_match(), this is no longer a macro. Change INET_MATCH() to inet_match() (Olivier Hartkopp & Jakub Kicinski) ==================== Signed-off-by: David S. Miller commit eda090c31fe923ab9463b884469744ec903ab0cc Author: Eric Dumazet Date: Fri May 13 11:55:50 2022 -0700 inet: rename INET_MATCH() This is no longer a macro, but an inlined function. INET_MATCH() -> inet_match() Signed-off-by: Eric Dumazet Suggested-by: Olivier Hartkopp Suggested-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5d368f03280d3678433a7f119efe15dfbbb87bc8 Author: Eric Dumazet Date: Fri May 13 11:55:49 2022 -0700 ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH() INET6_MATCH() runs without holding a lock on the socket. We probably need to annotate most reads. This patch makes INET6_MATCH() an inline function to ease our changes. v2: inline function only defined if IS_ENABLED(CONFIG_IPV6) Change the name to inet6_match(), this is no longer a macro. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit ff0094030f146b44eba0da2d3f9dbddaa28ee3c0 Author: Eric Dumazet Date: Fri May 13 11:55:48 2022 -0700 l2tp: use add READ_ONCE() to fetch sk->sk_bound_dev_if Use READ_ONCE() in paths not holding the socket lock. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 70f87de9fa0d454c5c176876fe5d5f6a7bb1fe9d Author: Eric Dumazet Date: Fri May 13 11:55:47 2022 -0700 net_sched: em_meta: add READ_ONCE() in var_sk_bound_if() sk->sk_bound_dev_if can change under us, use READ_ONCE() annotation. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d2c135619cb89d1d5693df81ab408c5e8e97e898 Author: Eric Dumazet Date: Fri May 13 11:55:46 2022 -0700 inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict() inet_csk_bind_conflict() can access sk->sk_bound_dev_if for unlocked sockets. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 36f7cec4f3af352d7f2c646461afba4cf7fd77b0 Author: Eric Dumazet Date: Fri May 13 11:55:45 2022 -0700 dccp: use READ_ONCE() to read sk->sk_bound_dev_if When reading listener sk->sk_bound_dev_if locklessly, we must use READ_ONCE(). Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e5fccaa1eb7f6116deab0f708a787e2de915869f Author: Eric Dumazet Date: Fri May 13 11:55:44 2022 -0700 net: core: add READ_ONCE/WRITE_ONCE annotations for sk->sk_bound_dev_if sock_bindtoindex_locked() needs to use WRITE_ONCE(sk->sk_bound_dev_if, val), because other cpus/threads might locklessly read this field. sock_getbindtodevice(), sock_getsockopt() need READ_ONCE() because they run without socket lock held. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit fdb5fd7f736ec7ae9fb36d2842ea6d9ebc4e7269 Author: Eric Dumazet Date: Fri May 13 11:55:43 2022 -0700 tcp: sk->sk_bound_dev_if once in inet_request_bound_dev_if() inet_request_bound_dev_if() reads sk->sk_bound_dev_if twice while listener socket is not locked. Another cpu could change this field under us. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit a20ea298071f46effa3aaf965bf9bb34c901db3f Author: Eric Dumazet Date: Fri May 13 11:55:42 2022 -0700 sctp: read sk->sk_bound_dev_if once in sctp_rcv() sctp_rcv() reads sk->sk_bound_dev_if twice while the socket is not locked. Another cpu could change this field under us. Fixes: 0fd9a65a76e8 ("[SCTP] Support SO_BINDTODEVICE socket option on incoming packets.") Signed-off-by: Eric Dumazet Cc: Neil Horman Cc: Vlad Yasevich Cc: Marcelo Ricardo Leitner Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 4c971d2f3548e4f11b1460ac048f5307e4b39fdb Author: Eric Dumazet Date: Fri May 13 11:55:41 2022 -0700 net: annotate races around sk->sk_bound_dev_if UDP sendmsg() is lockless, and reads sk->sk_bound_dev_if while this field can be changed by another thread. Adds minimal annotations to avoid KCSAN splats for UDP. Following patches will add more annotations to potential lockless readers. BUG: KCSAN: data-race in __ip6_datagram_connect / udpv6_sendmsg write to 0xffff888136d47a94 of 4 bytes by task 7681 on cpu 0: __ip6_datagram_connect+0x6e2/0x930 net/ipv6/datagram.c:221 ip6_datagram_connect+0x2a/0x40 net/ipv6/datagram.c:272 inet_dgram_connect+0x107/0x190 net/ipv4/af_inet.c:576 __sys_connect_file net/socket.c:1900 [inline] __sys_connect+0x197/0x1b0 net/socket.c:1917 __do_sys_connect net/socket.c:1927 [inline] __se_sys_connect net/socket.c:1924 [inline] __x64_sys_connect+0x3d/0x50 net/socket.c:1924 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff888136d47a94 of 4 bytes by task 7670 on cpu 1: udpv6_sendmsg+0xc60/0x16e0 net/ipv6/udp.c:1436 inet6_sendmsg+0x5f/0x80 net/ipv6/af_inet6.c:652 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x50 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x00000000 -> 0xffffff9b Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 7670 Comm: syz-executor.3 Tainted: G W 5.18.0-rc1-syzkaller-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 I chose to not add Fixes: tag because race has minor consequences and stable teams busy enough. Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 7fa2e481ff2fee20e0338d98489eb9f513ada45f Merge: 5cf15ce3c8f1e de78960e025f0 Author: David S. Miller Date: Mon May 16 10:18:56 2022 +0100 Merge branch 'big-tcp' Eric Dumazet says: ==================== tcp: BIG TCP implementation This series implements BIG TCP as presented in netdev 0x15: https://netdevconf.info/0x15/session.html?BIG-TCP Jonathan Corbet made a nice summary: https://lwn.net/Articles/884104/ Standard TSO/GRO packet limit is 64KB With BIG TCP, we allow bigger TSO/GRO packet sizes for IPv6 traffic. Note that this feature is by default not enabled, because it might break some eBPF programs assuming TCP header immediately follows IPv6 header. While tcpdump recognizes the HBH/Jumbo header, standard pcap filters are unable to skip over IPv6 extension headers. Reducing number of packets traversing networking stack usually improves performance, as shown on this experiment using a 100Gbit NIC, and 4K MTU. 'Standard' performance with current (74KB) limits. for i in {1..10}; do ./netperf -t TCP_RR -H iroa23 -- -r80000,80000 -O MIN_LATENCY,P90_LATENCY,P99_LATENCY,THROUGHPUT|tail -1; done 77 138 183 8542.19 79 143 178 8215.28 70 117 164 9543.39 80 144 176 8183.71 78 126 155 9108.47 80 146 184 8115.19 71 113 165 9510.96 74 113 164 9518.74 79 137 178 8575.04 73 111 171 9561.73 Now enable BIG TCP on both hosts. ip link set dev eth0 gro_max_size 185000 gso_max_size 185000 for i in {1..10}; do ./netperf -t TCP_RR -H iroa23 -- -r80000,80000 -O MIN_LATENCY,P90_LATENCY,P99_LATENCY,THROUGHPUT|tail -1; done 57 83 117 13871.38 64 118 155 11432.94 65 116 148 11507.62 60 105 136 12645.15 60 103 135 12760.34 60 102 134 12832.64 62 109 132 10877.68 58 82 115 14052.93 57 83 124 14212.58 57 82 119 14196.01 We see an increase of transactions per second, and lower latencies as well. v7: adopt unsafe_memcpy() in mlx5 to avoid FORTIFY warnings. v6: fix a compilation error for CONFIG_IPV6=n in "net: allow gso_max_size to exceed 65536", reported by kernel bots. v5: Replaced two patches (that were adding new attributes) with patches from Alexander Duyck. Idea is to reuse existing gso_max_size/gro_max_size v4: Rebased on top of Jakub series (Merge branch 'tso-gso-limit-split') max_tso_size is now family independent. v3: Fixed a typo in RFC number (Alexander) Added Reviewed-by: tags from Tariq on mlx4/mlx5 parts. v2: Removed the MAX_SKB_FRAGS change, this belongs to a different series. Addressed feedback, for Alexander and nvidia folks. ==================== Signed-off-by: David S. Miller commit de78960e025f0f361db76f90de609ca2c26d1366 Author: Eric Dumazet Date: Fri May 13 11:34:08 2022 -0700 mlx5: support BIG TCP packets mlx5 supports LSOv2. IPv6 gro/tcp stacks insert a temporary Hop-by-Hop header with JUMBO TLV for big packets. We need to ignore/skip this HBH header when populating TX descriptor. Note that ipv6_has_hopopt_jumbo() only recognizes very specific packet layout, thus mlx5e_sq_xmit_wqe() is taking care of this layout only. v7: adopt unsafe_memcpy() and MLX5_UNSAFE_MEMCPY_DISCLAIMER v2: clear hopbyhop in mlx5e_tx_get_gso_ihs() v4: fix compile error for CONFIG_MLX5_CORE_IPOIB=y Signed-off-by: Coco Li Signed-off-by: Eric Dumazet Reviewed-by: Tariq Toukan Cc: Saeed Mahameed Cc: Leon Romanovsky Signed-off-by: David S. Miller commit 1169a64265c4ea7100091228c98d4267f041b0e7 Author: Eric Dumazet Date: Fri May 13 11:34:07 2022 -0700 mlx4: support BIG TCP packets mlx4 supports LSOv2 just fine. IPv6 stack inserts a temporary Hop-by-Hop header with JUMBO TLV for big packets. We need to ignore the HBH header when populating TX descriptor. Tested: Before: (not enabling bigger TSO/GRO packets) ip link set dev eth0 gso_max_size 65536 gro_max_size 65536 netperf -H lpaa18 -t TCP_RR -T2,2 -l 10 -Cc -- -r 70000,70000 MIGRATED TCP REQUEST/RESPONSE TEST from ::0 (::) port 0 AF_INET6 to lpaa18.prod.google.com () port 0 AF_INET6 : first burst 0 : cpu bind Local /Remote Socket Size Request Resp. Elapsed Trans. CPU CPU S.dem S.dem Send Recv Size Size Time Rate local remote local remote bytes bytes bytes bytes secs. per sec % S % S us/Tr us/Tr 262144 540000 70000 70000 10.00 6591.45 0.86 1.34 62.490 97.446 262144 540000 After: (enabling bigger TSO/GRO packets) ip link set dev eth0 gso_max_size 185000 gro_max_size 185000 netperf -H lpaa18 -t TCP_RR -T2,2 -l 10 -Cc -- -r 70000,70000 MIGRATED TCP REQUEST/RESPONSE TEST from ::0 (::) port 0 AF_INET6 to lpaa18.prod.google.com () port 0 AF_INET6 : first burst 0 : cpu bind Local /Remote Socket Size Request Resp. Elapsed Trans. CPU CPU S.dem S.dem Send Recv Size Size Time Rate local remote local remote bytes bytes bytes bytes secs. per sec % S % S us/Tr us/Tr 262144 540000 70000 70000 10.00 8383.95 0.95 1.01 54.432 57.584 262144 540000 Signed-off-by: Eric Dumazet Reviewed-by: Tariq Toukan Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit d406099d6a150d6ee09b46d660feca348f9f9bba Author: Eric Dumazet Date: Fri May 13 11:34:06 2022 -0700 veth: enable BIG TCP packets Set the TSO driver limit to GSO_MAX_SIZE (512 KB). This allows the admin/user to set a GSO limit up to this value. ip link set dev veth10 gso_max_size 200000 Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit d6f938ce52f9adb23f4c31cc371654a5f18ff328 Author: Eric Dumazet Date: Fri May 13 11:34:05 2022 -0700 net: loopback: enable BIG TCP packets Set the driver limit to GSO_MAX_SIZE (512 KB). This allows the admin/user to set a GSO limit up to this value. Tested: ip link set dev lo gso_max_size 200000 netperf -H ::1 -t TCP_RR -l 100 -- -r 80000,80000 & tcpdump shows : 18:28:42.962116 IP6 ::1 > ::1: HBH 40051 > 63780: Flags [P.], seq 3626480001:3626560001, ack 3626560001, win 17743, options [nop,nop,TS val 3771179265 ecr 3771179265], length 80000 18:28:42.962138 IP6 ::1.63780 > ::1.40051: Flags [.], ack 3626560001, win 17743, options [nop,nop,TS val 3771179265 ecr 3771179265], length 0 18:28:42.962152 IP6 ::1 > ::1: HBH 63780 > 40051: Flags [P.], seq 3626560001:3626640001, ack 3626560001, win 17743, options [nop,nop,TS val 3771179265 ecr 3771179265], length 80000 18:28:42.962157 IP6 ::1.40051 > ::1.63780: Flags [.], ack 3626640001, win 17743, options [nop,nop,TS val 3771179265 ecr 3771179265], length 0 18:28:42.962180 IP6 ::1 > ::1: HBH 40051 > 63780: Flags [P.], seq 3626560001:3626640001, ack 3626640001, win 17743, options [nop,nop,TS val 3771179265 ecr 3771179265], length 80000 18:28:42.962214 IP6 ::1.63780 > ::1.40051: Flags [.], ack 3626640001, win 17743, options [nop,nop,TS val 3771179266 ecr 3771179265], length 0 18:28:42.962228 IP6 ::1 > ::1: HBH 63780 > 40051: Flags [P.], seq 3626640001:3626720001, ack 3626640001, win 17743, options [nop,nop,TS val 3771179266 ecr 3771179265], length 80000 18:28:42.962233 IP6 ::1.40051 > ::1.63780: Flags [.], ack 3626720001, win 17743, options [nop,nop,TS val 3771179266 ecr 3771179266], length 0 Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 80e425b613421911f89664663a7060216abcaed2 Author: Coco Li Date: Fri May 13 11:34:04 2022 -0700 ipv6: Add hop-by-hop header to jumbograms in ip6_output Instead of simply forcing a 0 payload_len in IPv6 header, implement RFC 2675 and insert a custom extension header. Note that only TCP stack is currently potentially generating jumbograms, and that this extension header is purely local, it wont be sent on a physical link. This is needed so that packet capture (tcpdump and friends) can properly dissect these large packets. Signed-off-by: Coco Li Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 0fe79f28bfaf73b66b7b1562d2468f94aa03bd12 Author: Alexander Duyck Date: Fri May 13 11:34:03 2022 -0700 net: allow gro_max_size to exceed 65536 Allow the gro_max_size to exceed a value larger than 65536. There weren't really any external limitations that prevented this other than the fact that IPv4 only supports a 16 bit length field. Since we have the option of adding a hop-by-hop header for IPv6 we can allow IPv6 to exceed this value and for IPv4 and non-TCP flows we can cap things at 65536 via a constant rather than relying on gro_max_size. [edumazet] limit GRO_MAX_SIZE to (8 * 65535) to avoid overflows. Signed-off-by: Alexander Duyck Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 81fbc812132cbc72a0f933b19bfd3a829bd946e4 Author: Eric Dumazet Date: Fri May 13 11:34:02 2022 -0700 ipv6/gro: insert temporary HBH/jumbo header Following patch will add GRO_IPV6_MAX_SIZE, allowing gro to build BIG TCP ipv6 packets (bigger than 64K). This patch changes ipv6_gro_complete() to insert a HBH/jumbo header so that resulting packet can go through IPv6/TCP stacks. Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 09f3d1a3a52c696208008618a67e2c7c3fb16d41 Author: Eric Dumazet Date: Fri May 13 11:34:01 2022 -0700 ipv6/gso: remove temporary HBH/jumbo header ipv6 tcp and gro stacks will soon be able to build big TCP packets, with an added temporary Hop By Hop header. If GSO is involved for these large packets, we need to remove the temporary HBH header before segmentation happens. v2: perform HBH removal from ipv6_gso_segment() instead of skb_segment() (Alexander feedback) Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 7c96d8ec96bb71aac54c9f872aaa65d7411ab864 Author: Eric Dumazet Date: Fri May 13 11:34:00 2022 -0700 ipv6: add struct hop_jumbo_hdr definition Following patches will need to add and remove local IPv6 jumbogram options to enable BIG TCP. Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 9957b38b5e7a44290f669757520ef2a5f5f6ceb8 Author: Eric Dumazet Date: Fri May 13 11:33:59 2022 -0700 tcp_cubic: make hystart_ack_delay() aware of BIG TCP hystart_ack_delay() had the assumption that a TSO packet would not be bigger than GSO_MAX_SIZE. This will no longer be true. We should use sk->sk_gso_max_size instead. This reduces chances of spurious Hystart ACK train detections. Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 34b92e8d19da1e44070dc0ecc2747871469ac534 Author: Eric Dumazet Date: Fri May 13 11:33:58 2022 -0700 net: limit GSO_MAX_SIZE to 524280 bytes Make sure we will not overflow shinfo->gso_segs Minimal TCP MSS size is 8 bytes, and shinfo->gso_segs is a 16bit field. TCP_MIN_GSO_SIZE is currently defined in include/net/tcp.h, it seems cleaner to not bring tcp details into include/linux/netdevice.h Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d Author: Alexander Duyck Date: Fri May 13 11:33:57 2022 -0700 net: allow gso_max_size to exceed 65536 The code for gso_max_size was added originally to allow for debugging and workaround of buggy devices that couldn't support TSO with blocks 64K in size. The original reason for limiting it to 64K was because that was the existing limits of IPv4 and non-jumbogram IPv6 length fields. With the addition of Big TCP we can remove this limit and allow the value to potentially go up to UINT_MAX and instead be limited by the tso_max_size value. So in order to support this we need to go through and clean up the remaining users of the gso_max_size value so that the values will cap at 64K for non-TCPv6 flows. In addition we can clean up the GSO_MAX_SIZE value so that 64K becomes GSO_LEGACY_MAX_SIZE and UINT_MAX will now be the upper limit for GSO_MAX_SIZE. v6: (edumazet) fixed a compile error if CONFIG_IPV6=n, in a new sk_trim_gso_size() helper. netif_set_tso_max_size() caps the requested TSO size with GSO_MAX_SIZE. Signed-off-by: Alexander Duyck Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 89527be8d8d672773eeaec910118a6e84fb597e3 Author: Eric Dumazet Date: Fri May 13 11:33:56 2022 -0700 net: add IFLA_TSO_{MAX_SIZE|SEGS} attributes New netlink attributes IFLA_TSO_MAX_SIZE and IFLA_TSO_MAX_SEGS are used to report to user-space the device TSO limits. ip -d link sh dev eth1 ... tso_max_size 65536 tso_max_segs 65535 Signed-off-by: Eric Dumazet Acked-by: Alexander Duyck Signed-off-by: David S. Miller commit 5cf15ce3c8f1ef431dc9fa845c6d1674f630ecd1 Merge: 1a01a0751731c e1154be73153a Author: David S. Miller Date: Mon May 16 10:14:27 2022 +0100 Merge branch 'Renesas-RSZ-V2M-support' Phil Edworthy says: ==================== Add Renesas RZ/V2M Ethernet support The RZ/V2M Ethernet is very similar to R-Car Gen3 Ethernet-AVB, though some small parts are the same as R-Car Gen2. Other differences are: * It has separate data (DI), error (Line 1) and management (Line 2) irqs rather than one irq for all three. * Instead of using the High-speed peripheral bus clock for gPTP, it has a separate gPTP reference clock. v4: * Add clk_disable_unprepare() for gptp ref clk v3: * Really renamed irq_en_dis_regs to irq_en_dis this time * Modified ravb_ptp_extts() to use irq_en_dis * Added Reviewed-by tags v2: * Just net patches in this series * Instead of reusing ch22 and ch24 interrupt names, use the proper names * Renamed irq_en_dis_regs to irq_en_dis * Squashed use of GIC reg versus GIE/GID and got rid of separate gptp_ptm_gic feature. * Move err_mgmt_irqs code under multi_irqs * Minor editing of the commit msgs ==================== Signed-off-by: David S. Miller commit e1154be73153ab6aafa1546d998987b692ffdc02 Author: Phil Edworthy Date: Thu May 12 12:47:22 2022 +0100 ravb: Add support for RZ/V2M RZ/V2M Ethernet is very similar to R-Car Gen3 Ethernet-AVB, though some small parts are the same as R-Car Gen2. Other differences to R-Car Gen3 and Gen2 are: * It has separate data (DI), error (Line 1) and management (Line 2) irqs rather than one irq for all three. * Instead of using the High-speed peripheral bus clock for gPTP, it has a separate gPTP reference clock. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit 72069a7b2821443f57e5734f91e19936c48e4809 Author: Phil Edworthy Date: Thu May 12 12:47:21 2022 +0100 ravb: Use separate clock for gPTP RZ/V2M has a separate gPTP reference clock that is used when the AVB-DMAC Mode Register (CCC) gPTP Clock Select (CSEL) bits are set to "01: High-speed peripheral bus clock". Therefore, add a feature that allows this clock to be used for gPTP. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit b0265dcba3d6c1689e6ce315bed09192fb587403 Author: Phil Edworthy Date: Thu May 12 12:47:20 2022 +0100 ravb: Support separate Line0 (Desc), Line1 (Err) and Line2 (Mgmt) irqs R-Car has a combined interrupt line, ch22 = Line0_DiA | Line1_A | Line2_A. RZ/V2M has separate interrupt lines for each of these, so add a feature that allows the driver to get these interrupts and call the common handler. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit cb99badde146c327f150773921ffe080abe1eb44 Author: Phil Edworthy Date: Thu May 12 12:47:19 2022 +0100 ravb: Separate handling of irq enable/disable regs into feature Currently, when the HW has a single interrupt, the driver uses the GIC, TIC, RIC0 registers to enable and disable interrupts. When the HW has multiple interrupts, it uses the GIE, GID, TIE, TID, RIE0, RID0 registers. However, other devices, e.g. RZ/V2M, have multiple irqs and only have the GIC, TIC, RIC0 registers. Therefore, split this into a separate feature. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit a7931ac16128bb3af5c4ac482057a711da117856 Author: Phil Edworthy Date: Thu May 12 12:47:18 2022 +0100 dt-bindings: net: renesas,etheravb: Document RZ/V2M SoC Document the Ethernet AVB IP found on RZ/V2M SoC. It includes the Ethernet controller (E-MAC) and Dedicated Direct memory access controller (DMAC) for transferring transmitted Ethernet frames to and received Ethernet frames from respective storage areas in the RAM at high speed. The AVB-DMAC is compliant with IEEE 802.1BA, IEEE 802.1AS timing and synchronization protocol, IEEE 802.1Qav real-time transfer, and the IEEE 802.1Qat stream reservation protocol. R-Car has a pair of combined interrupt lines: ch22 = Line0_DiA | Line1_A | Line2_A ch23 = Line0_DiB | Line1_B | Line2_B Line0 for descriptor interrupts (which we call dia and dib). Line1 for error related interrupts (which we call err_a and err_b). Line2 for management and gPTP related interrupts (mgmt_a and mgmt_b). RZ/V2M hardware has separate interrupt lines for each of these. It has 3 clocks; the main AXI clock, the AMBA CHI (Coherent Hub Interface) clock and a gPTP reference clock. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit 1a01a0751731c807c04e81d3c19c5b782d205af7 Merge: d9713088158b2 4f9bd53084d18 Author: David S. Miller Date: Mon May 16 10:10:37 2022 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next This is v2 including deadlock fix in conntrack ecache rework reported by Jakub Kicinski. The following patchset contains Netfilter updates for net-next, mostly updates to conntrack from Florian Westphal. 1) Add a dedicated list for conntrack event redelivery. 2) Include event redelivery list in conntrack dumps of dying type. 3) Remove per-cpu dying list for event redelivery, not used anymore. 4) Add netns .pre_exit to cttimeout to zap timeout objects before synchronize_rcu() call. 5) Remove nf_ct_unconfirmed_destroy. 6) Add generation id for conntrack extensions for conntrack timeout and helpers. 7) Detach timeout policy from conntrack on cttimeout module removal. 8) Remove __nf_ct_unconfirmed_destroy. 9) Remove unconfirmed list. 10) Remove unconditional local_bh_disable in init_conntrack(). 11) Consolidate conntrack iterator nf_ct_iterate_cleanup(). 12) Detect if ctnetlink listeners exist to short-circuit event path early. 13) Un-inline nf_ct_ecache_ext_add(). 14) Add nf_conntrack_events autodetect ctnetlink listener mode and make it default. 15) Add nf_ct_ecache_exist() to check for event cache extension. 16) Extend flowtable reverse route lookup to include source, iif, tos and mark, from Sven Auhagen. 17) Do not verify zero checksum UDP packets in nf_reject, from Kevin Mitchell. ==================== Signed-off-by: David S. Miller commit c9311de71635d3eaa158df8516b9b99a92d60a0c Author: Thomas Richter Date: Fri May 13 12:42:55 2022 +0200 s390/cpumf: add new extended counter set for IBM z16 Export the extended counter set counters of the IBM z16 via sysfs. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Heiko Carstens commit ed6bc6bf0a7d75e80eb1df883c09975ebb74e590 Author: Geert Uytterhoeven Date: Fri May 13 14:50:28 2022 +0200 m68k: math-emu: Fix dependencies of math emulation support If CONFIG_M54xx=y, CONFIG_MMU=y, and CONFIG_M68KFPU_EMU=y: {standard input}:272: Error: invalid instruction for this architecture; needs 68000 or higher (68000 [68ec000, 68hc000, 68hc001, 68008, 68302, 68306, 68307, 68322, 68356], 68010, 68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060], cpu32 [68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349, 68360], fidoa [fido]) -- statement `sub.b %d1,%d3' ignored {standard input}:609: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `bfextu 4(%a1){%d0,#8},%d0' ignored {standard input}:752: Error: operands mismatch -- statement `mulu.l 4(%a0),%d3:%d0' ignored {standard input}:1155: Error: operands mismatch -- statement `divu.l %d0,%d3:%d7' ignored The math emulation support code is intended for 68020 and higher, and uses several instructions or instruction modes not available on coldfire or 68000. Originally, the dependency of M68KFPU_EMU on MMU was fine, as MMU support was only available on 68020 or higher. But this assumption was broken by the introduction of MMU support for M547x and M548x. Drop the dependency on MMU, as the code should work fine on 68020 and up without MMU (which are not yet supported by Linux, though). Add dependencies on M68KCLASSIC (to rule out Coldfire) and FPU (kernel has some type of floating-point support --- be it hardware or software emulated, to rule out anything below 68020). Fixes: 1f7034b9616e6f14 ("m68k: allow ColdFire 547x and 548x CPUs to be built with MMU enabled") Reported-by: kernel test robot Signed-off-by: Geert Uytterhoeven Reviewed-by: Greg Ungerer Link: https://lore.kernel.org/r/18c34695b7c95107f60ccca82a4ff252f3edf477.1652446117.git.geert@linux-m68k.org commit 569cf386ec5f4619388ae0c62169175dc2804f32 Author: Jonas Jelonek Date: Mon May 9 19:39:58 2022 +0200 mac80211: minstrel_ht: support ieee80211_rate_status This patch adds support for the new struct ieee80211_rate_status and its annotation in struct ieee80211_tx_status in minstrel_ht. In minstrel_ht_tx_status, a check for the presence of instances of the new struct in ieee80211_tx_status is added. Based on this, minstrel_ht then gets and updates internal rate stats with either struct ieee80211_rate_status or ieee80211_tx_info->status.rates. Adjusted variants of minstrel_ht_txstat_valid, minstrel_ht_get_stats, minstrel_{ht/vht}_get_group_idx are added which use struct ieee80211_rate_status and struct rate_info instead of the legacy structs. struct rate_info from cfg80211.h does not provide whether short preamble was used for the transmission. So we retrieve this information from VIF and STA configuration and cache it in a new flag in struct minstrel_ht_sta per rate control instance. Compile-Tested: current wireless-next tree with all flags on Tested-on: Xiaomi 4A Gigabit (MediaTek MT7603E, MT7612E) with OpenWrt Linux 5.10.113 Signed-off-by: Jonas Jelonek Link: https://lore.kernel.org/r/20220509173958.1398201-3-jelonek.jonas@gmail.com Signed-off-by: Johannes Berg commit 44fa75f207d8a106bc75e6230db61e961fdbf8a8 Author: Jonas Jelonek Date: Mon May 9 19:39:57 2022 +0200 mac80211: extend current rate control tx status API This patch adds the new struct ieee80211_rate_status and replaces 'struct rate_info *rate' in ieee80211_tx_status with pointer and length annotation. The struct ieee80211_rate_status allows to: (1) receive tx power status feedback for transmit power control (TPC) per packet or packet retry (2) dynamic mapping of wifi chip specific multi-rate retry (mrr) chains with different lengths (3) increase the limit of annotatable rate indices to support IEEE802.11ac rate sets and beyond ieee80211_tx_info, control and status buffer, and ieee80211_tx_rate cannot be used to achieve these goals due to fixed size limitations. Our new struct contains a struct rate_info to annotate the rate that was used, retry count of the rate and tx power. It is intended for all information related to RC and TPC that needs to be passed from driver to mac80211 and its RC/TPC algorithms like Minstrel_HT. It corresponds to one stage in an mrr. Multiple subsequent instances of this struct can be included in struct ieee80211_tx_status via a pointer and a length variable. Those instances can be allocated on-stack. The former reference to a single instance of struct rate_info is replaced with our new annotation. An extension is introduced to struct ieee80211_hw. There are two new members called 'tx_power_levels' and 'max_txpwr_levels_idx' acting as a tx power level table. When a wifi device is registered, the driver shall supply all supported power levels in this list. This allows to support several quirks like differing power steps in power level ranges or alike. TPC can use this for algorithm and thus be designed more abstract instead of handling all possible step widths individually. Further mandatory changes in status.c, mt76 and ath11k drivers due to the removal of 'struct rate_info *rate' are also included. status.c already uses the information in ieee80211_tx_status->rate in radiotap, this is now changed to use ieee80211_rate_status->rate_idx. mt76 driver already uses struct rate_info to pass the tx rate to status path. The new members of the ieee80211_tx_status are set to NULL and 0 because the previously passed rate is not relevant to rate control and accurate information is passed via tx_info->status.rates. For ath11k, the txrate can be passed via this struct because ath11k uses firmware RC and thus the information does not interfere with software RC. Compile-Tested: current wireless-next tree with all flags on Tested-on: Xiaomi 4A Gigabit (MediaTek MT7603E, MT7612E) with OpenWrt Linux 5.10.113 Signed-off-by: Jonas Jelonek Link: https://lore.kernel.org/r/20220509173958.1398201-2-jelonek.jonas@gmail.com Signed-off-by: Johannes Berg commit ee0e16ab756ac060afe367199bc36db26a157444 Author: Peter Seiderer Date: Sat Apr 2 17:30:14 2022 +0200 mac80211: minstrel_ht: fill all requested rates Fill all requested rates (in case of ath9k 4 rate slots are available, so fill all 4 instead of only 3), improves throughput in noisy environment. Signed-off-by: Peter Seiderer Link: https://lore.kernel.org/r/20220402153014.31332-2-ps.report@gmx.net Signed-off-by: Johannes Berg commit 00f87ec74c3c09628889173b0f594cfc01e74157 Author: Stefan Binding Date: Mon May 9 22:46:46 2022 +0100 ALSA: hda: cs35l41: Add Amp Name based on channel and index This will be used to identify ALSA controls and firmware. The Amp Name will be a channel identifier (L or R), and an index, which identifies which amp for that channel. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-10-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0db99577c4cddc45447701aeb7b4d7d7b03d626f Author: Stefan Binding Date: Mon May 9 22:46:45 2022 +0100 ASoC: cs35l41: Move cs_dsp config struct into shared code This can then be used by HDA code to configure cs_dsp. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220509214703.4482-9-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ff8aad072e6388243fb0c76db4154d0883988384 Author: Stefan Binding Date: Mon May 9 22:46:44 2022 +0100 ASoC: cs35l41: Move cs35l41 fs errata into shared code This sequence is required to setup firmware, and will be needed for hda driver. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220509214703.4482-8-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit caf7c1f1de9f011ea0e6494fcb1b2ba203bd3422 Author: Stefan Binding Date: Mon May 9 22:46:43 2022 +0100 ASoC: cs35l41: Move cs35l41_set_cspl_mbox_cmd to shared code This function is used to control the DSP Firmware for cs35l41, and will be needed by the cs35l41 hda driver, when firmware support is added. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220509214703.4482-7-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit de8cab7b38d74e7f2bec7f3abe129c31354a5dcf Author: Stefan Binding Date: Mon May 9 22:46:42 2022 +0100 ALSA: hda: cs35l41: Enable GPIO2 Interrupt for CLSA0100 laptops CLSA0100 Laptop does not contain configuration inside ACPI, instead the hardware configuration needs to be hardcoded. Hardcode GPIO2 Interrupt in the driver for CSLA0100. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-6-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit aa4a38af97e9f117450bcafd25ef02f9f1a37215 Author: Stefan Binding Date: Mon May 9 22:46:41 2022 +0100 ALSA: hda: cs35l41: Add Support for Interrupts The CS35L41 can produce interrupts on error. When the interrupts occur, the driver will report the error, but errors will only be fixed after playback finishes. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-5-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 14e42ceec89a59ad34bb22da9bbf3426a8824265 Author: Stefan Binding Date: Mon May 9 22:46:40 2022 +0100 ALSA: hda: cs35l41: Remove Set Channel Map api from binding This API was required for CLSA0100 laptop, which did not have correct properties inside ACPI. The required values are now hardcoded inside the driver so this is no longer needed. Without this api, there CLSA0100 can now use the generic cs35l41 fixup, like the other laptops. All other laptops will read the Speaker Position from ACPI and set the channel map from within the driver. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-4-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 775d667539a4dd8b9f7015c5da5526999f1d5bf1 Author: Stefan Binding Date: Mon May 9 22:46:39 2022 +0100 ALSA: hda: cs35l41: Set Speaker Position for CLSA0100 Laptop This laptop does not contain required properties inside ACPI, instead the values are be hardcoded inside the driver. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-3-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit c960aa6aa3ccfc59293fb0850a1addf7646d790a Author: Stefan Binding Date: Mon May 9 22:46:38 2022 +0100 ALSA: hda: cs35l41: Fix error in spi cs35l41 hda driver name For consistency, rename spi cs35l41 hda driver name so that it matches i2c. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220509214703.4482-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 195b9a0fd5817d6b907663bc0de3658719aea841 Author: Lavanya Suresh Date: Wed Apr 13 21:58:15 2022 +0530 mac80211: disable BSS color collision detection in case of no free colors AP may run out of BSS color after color collision detection event from driver. Disable BSS color collision detection if no free colors are available based on bss color disabled bit sent as a part of NL80211_ATTR_HE_BSS_COLOR attribute sent in NL80211_CMD_SET_BEACON. It can be reenabled once new color is available. Signed-off-by: Lavanya Suresh Signed-off-by: Rameshkumar Sundaram Link: https://lore.kernel.org/r/1649867295-7204-3-git-send-email-quic_ramess@quicinc.com Signed-off-by: Johannes Berg commit 3d48cb74816d8468f0235ce9a867a2d7b9832693 Author: Rameshkumar Sundaram Date: Wed Apr 13 21:58:14 2022 +0530 nl80211: Parse NL80211_ATTR_HE_BSS_COLOR as a part of nl80211_parse_beacon NL80211_ATTR_HE_BSS_COLOR attribute can be included in both NL80211_CMD_START_AP and NL80211_CMD_SET_BEACON commands. Move he_bss_color from cfg80211_ap_settings to cfg80211_beacon_data and parse NL80211_ATTR_HE_BSS_COLOR as a part of nl80211_parse_beacon() to have bss color settings parsed for both start ap and set beacon commands. Add a new flag he_bss_color_valid to indicate whether NL80211_ATTR_HE_BSS_COLOR attribute is included. Signed-off-by: Rameshkumar Sundaram Link: https://lore.kernel.org/r/1649867295-7204-2-git-send-email-quic_ramess@quicinc.com [fix build ...] Signed-off-by: Johannes Berg commit 5dfad1081215de36f863cd05e70bca56fcbdb9f0 Author: Johannes Berg Date: Fri May 13 18:03:14 2022 +0200 mac80211: mlme: track assoc_bss/associated separately We currently track whether we're associated and which the BSS is in the same variable (ifmgd->associated), but for MLD we'll need to move the BSS pointer to be per link, while the question whether we're associated or not is for the whole interface. Add ifmgd->assoc_bss that stores the pointer and change ifmgd->associated to be just a bool, so the question of whether we're associated can continue working after MLD rework, without requiring changes, while the BSS pointer will have to be changed/used checked per link. Signed-off-by: Johannes Berg commit 16d0364c722a246933ec4b39cbd5d17d7d4fe758 Author: Johannes Berg Date: Fri May 13 17:46:24 2022 +0200 mac80211: remove useless bssid copy We don't need to copy this locally, we now only use the variable to print before doing other things. Signed-off-by: Johannes Berg commit 53da4c45cadee45c1c902d58556cc0d488878e16 Author: Johannes Berg Date: Fri May 13 17:46:23 2022 +0200 mac80211: remove unused argument to ieee80211_sta_connection_lost() We never use the bssid argument to ieee80211_sta_connection_lost() so we might as well just remove it. Signed-off-by: Johannes Berg commit 926101d2b7bec7f67db3acb8c0b8c9901026df5c Author: Johannes Berg Date: Fri May 13 15:48:06 2022 +0200 mac80211: mlme: use local SSID copy There's no need to look it up from the ifmgd->associated BSS configuration, we already maintain a local copy since commit b0140fda626e ("mac80211: mlme: save ssid info to ieee80211_bss_conf while assoc"). Signed-off-by: Johannes Berg commit c8fe4b0b37f631284a447f4819231893ef4cbbaa Author: Johannes Berg Date: Fri May 13 15:48:05 2022 +0200 mac80211: use ifmgd->bssid instead of ifmgd->associated->bssid Since we always track the BSSID there when we get associated, these are equivalent, but ifmgd->bssid saves a dereference and thus makes the code a bit smaller, and more readable. Signed-off-by: Johannes Berg commit f344c58c250d68c08e8b765a8c995a957ba28ced Author: Johannes Berg Date: Fri May 13 15:48:04 2022 +0200 mac80211: mlme: move in RSSI reporting code This code is tightly coupled to the sdata->u.mgd data structure, so there's no reason for it to be in utils. Move it to mlme.c. Signed-off-by: Johannes Berg commit f5bf586aadddd9803a1f16bc18621fd819377130 Author: Johannes Berg Date: Tue May 10 16:38:19 2022 +0200 mac80211: remove stray multi_sta_back_32bit docs This field doesn't exist, remove the docs for it. Signed-off-by: Johannes Berg commit 4273d3fa8aa594e37c295bef3e73073608644241 Author: Johannes Berg Date: Tue May 10 13:37:59 2022 +0200 mac80211: fix typo in documentation This is called offload_flags, remove the extra 'a'. Signed-off-by: Johannes Berg commit 97f7a47024776f7da55297d2b1867c560a6b4390 Author: Johannes Berg Date: Fri May 6 10:51:52 2022 +0200 mac80211: unify CCMP/GCMP AAD construction Ping-Ke's previous patch adjusted the CCMP AAD construction to properly take the order bit into account, but failed to update the (identical) GCMP AAD construction as well. Unify the AAD construction between the two cases. Reported-by: Jouni Malinen Link: https://lore.kernel.org/r/20220506105150.51d66e2a6f3c.I65f12be82c112365169e8a9f48c7a71300e814b9@changeid Signed-off-by: Johannes Berg commit a71b9e66fee47c59b3ec34e652b5c23bc6550794 Author: Greg Ungerer Date: Fri May 13 17:27:39 2022 +1000 m68knommu: fix undefined reference to `_init_sp' When configuring a nommu classic m68k system enabling the uboot parameter passing support (CONFIG_UBOOT) will produce the following compile error: m68k-linux-ld: arch/m68k/kernel/uboot.o: in function `process_uboot_commandline': uboot.c:(.init.text+0x32): undefined reference to `_init_sp' The logic to support this option is only used on ColdFire based platforms (in its head.S startup code). So make the selection of this option depend on building for a ColdFire based platform. Reported-by: kernel test robot Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit 93ba75c90524618ef2c20979b0e660b9d071f0e6 Author: Chaitanya Kulkarni Date: Wed Mar 30 02:40:32 2022 -0700 nvme-fabrics: add a request timeout helper The RDAMA and TCP transport both complete the timed out request in the same manner and hence code is duplicated. Add and use the helper nvmf_complete_timed_out_request() to remove the duplicate code. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit b98235d3a471e121376bfabce27380dde5add1d9 Author: Stefan Roese Date: Fri May 6 12:15:34 2022 +0200 nvme-pci: harden drive presence detect in nvme_dev_disable() On our ZynqMP system we observe, that a NVMe drive that resets itself while doing a firmware update causes a Kernel crash like this: [ 67.720772] pcieport 0000:02:02.0: pciehp: Slot(2): Link Down [ 67.720783] pcieport 0000:02:02.0: pciehp: Slot(2): Card not present [ 67.720795] nvme 0000:04:00.0: PME# disabled [ 67.720849] Internal error: synchronous external abort: 96000010 [#1] PREEMPT SMP [ 67.720853] nwl-pcie fd0e0000.pcie: Slave error Analysis: When nvme_dev_disable() is called because of this PCIe hotplug event, pci_is_enabled() is still true. And accessing the NVMe drive which is currently not available as it's in reboot process causes this "synchronous external abort" on this ARM64 platform. This patch adds the pci_device_is_present() check as well, which returns false in this "Card not present" hot-plug case. With this change, the NVMe driver does not try to access the NVMe registers any more and the FW update finishes without any problems. Signed-off-by: Stefan Roese Signed-off-by: Christoph Hellwig commit da42761181627e9bdc37d18368b827948a583929 Author: Smith, Kyle Miller (Nimble Kernel) Date: Fri Apr 22 14:40:32 2022 +0000 nvme-pci: fix a NULL pointer dereference in nvme_alloc_admin_tags In nvme_alloc_admin_tags, the admin_q can be set to an error (typically -ENOMEM) if the blk_mq_init_queue call fails to set up the queue, which is checked immediately after the call. However, when we return the error message up the stack, to nvme_reset_work the error takes us to nvme_remove_dead_ctrl() nvme_dev_disable() nvme_suspend_queue(&dev->queues[0]). Here, we only check that the admin_q is non-NULL, rather than not an error or NULL, and begin quiescing a queue that never existed, leading to bad / NULL pointer dereference. Signed-off-by: Kyle Smith Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 128126a7943622424350752a71be5bb95e7946db Author: Chaitanya Kulkarni Date: Tue Apr 19 15:53:51 2022 -0700 nvme: mark internal passthru request RQF_QUIET Most of the internal passthru commands use __nvme_submit_sync_cmd() interface. There are few places we open code the request submission :- 1. nvme_keep_alive_work(struct work_struct *work) 2. nvme_timeout(struct request *req, bool reserved) 3. nvme_delete_queue(struct nvme_queue *nvmeq, u8 opcode) Mark the internal passthru request quiet so that we can skip the verbose error message from nvme_log_error() in nvme_end_req() completion path, this will be consistent with what we have in __nvme_submit_sync_cmd(). Signed-off-by: Chaitanya Kulkarni Reviewed-by: Alan Adamson Signed-off-by: Christoph Hellwig commit da3340e77eeb4ced79784eaadbcc529e1ecef673 Author: Max Gurtovoy Date: Thu Apr 28 12:15:24 2022 +0300 nvme: remove unneeded include from constants file No usage of blkdev.h elements. Signed-off-by: Max Gurtovoy Signed-off-by: Christoph Hellwig commit ca2d89925ae3f3d5c65182ff75e58bc9b484e69c Author: Max Gurtovoy Date: Thu Apr 28 12:19:35 2022 +0300 nvme: add missing status values to verbose logging Log a few more path related status codes. Signed-off-by: Max Gurtovoy Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 52fde2c07da606f3f120af4f734eadcfb52b04be Author: Keith Busch Date: Wed May 4 11:43:25 2022 -0700 nvme: set dma alignment to dword The nvme specification only requires qword alignment for segment descriptors, and the driver already guarantees that. The spec has always allowed user data to be dword aligned, which is what the queue's attribute is for, so relax the alignment requirement to that value. While we could allow byte alignment for some controllers when using SGLs, we still need to support PRP, and that only allows dword. Fixes: 3b2a1ebceba3 ("nvme: set dma alignment to qword") Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit 1a86924e4f464757546d7f7bdc469be237918395 Author: Tom Yan Date: Fri Apr 29 12:52:43 2022 +0800 nvme: fix interpretation of DMRSL DMRSLl is in the unit of logical blocks, while max_discard_sectors is in the unit of "linux sector". Signed-off-by: Tom Yan Signed-off-by: Christoph Hellwig commit 782f4c5c44e7d99d89740e272dc5ff84052c036a Author: Greg Ungerer Date: Wed Apr 27 23:42:46 2022 +1000 m68knommu: allow elf_fdpic loader to be selected The m68k architecture code is capable of supporting the binfmt_elf_fdpic loader, so allow it to be configured. It is restricted to nommu configurations at this time due to the MMU context structures/code not supporting everything elf_fdpic needs when MMU is enabled. Signed-off-by: Greg Ungerer commit 67b660b1f7e5611108e05ca97bd387e141fc61b6 Author: Greg Ungerer Date: Wed Apr 27 23:32:15 2022 +1000 m68knommu: add definitions to support elf_fdpic program loader Add a few required defines to support using the binfmt_elf_fdpic loader on the m68k architecture. The values are defined to be consistent with those used on arm and sh which support this too. The most important m68k specific change is the register initialization. The pt_reg structure only contains a subset of the architecture general registers, so we are more limited than to be expected on what can be used. Signed-off-by: Greg Ungerer commit bd53e442e8373d8e10898d1e99d54e825535e316 Author: Greg Ungerer Date: Wed Apr 27 23:09:37 2022 +1000 m68knommu: implement minimal regset support Add code support to the m68k architecture for regsets. Currently the only thing that will need to use regsets for m68k will be coredump support of the elf_fdpic loader. So the changes are conditional on that. The added support is the minimum definitions required to support just that. Signed-off-by: Greg Ungerer commit 6ed2db985a8db06c4e3d4de622d8c894a20827ae Author: Greg Ungerer Date: Tue Apr 26 11:59:53 2022 +1000 m68knommu: use asm-generic/mmu.h for nommu setups The nommu case defines its own local mm_context_t structure. There is nothing special or different about the m68knommu version of this and it can easily use the common asm-generic version. Remove the local mmu_context struct and include the asm-generic version instead. This will also make it easier to support ELF format executables in the future (since the asm-generic version has support for this already). Signed-off-by: Greg Ungerer Reviewed-by: Geert Uytterhoeven commit 968f0e1ce923ff2e67a97edba7cccc006b0e9207 Author: Julia Lawall Date: Sat Apr 30 21:11:18 2022 +0200 m68k: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Ungerer commit f95a387cdeb3fd2ef64f3824df99e8e11297ce7a Author: Arnd Bergmann Date: Thu Apr 21 10:20:12 2022 +0200 m68k: coldfire: drop ISA_DMA_API support After a build regression report, I took a look at possible users of CONFIG_ISA_DMA_API on m68k and found none, which Greg confirmed. The CONFIG_GENERIC_ISA_DMA option in turn is only needed to implement ISA_DMA_API, and is clearly not used on the platforms with ISA support. The CONFIG_ISA support for AMIGA_PCMCIA is probably also unneeded, but this is less clear. Unlike other PCMCIA implementations, this one does not use the drivers/pcmcia subsystem at all and just supports the "apne" network driver. When it was first added, one could use ISA drivers on it as well, but this probably broke at some point. With no reason to keep this, let's just drop the corresponding files and prevent the remaining ISA drivers that use this from getting built. The remaining definitions in asm/dma.h are used for PCI support. Link: https://lore.kernel.org/lkml/9e5ee1c3-ca80-f343-a1f5-66f3dd1c0727@linux-m68k.org/ Acked-by: Geert Uytterhoeven Acked-by: Ulf Hansson # For MMC Acked-by: Greg Ungerer Acked-by: Takashi Iwai Signed-off-by: Arnd Bergmann Signed-off-by: Greg Ungerer commit dc068f46217970d9516f16cd37972a01d50dc055 Author: Greg Ungerer Date: Wed Apr 20 23:27:47 2022 +1000 m68knommu: set ZERO_PAGE() to the allocated zeroed page The non-MMU m68k pagetable ZERO_PAGE() macro is being set to the somewhat non-sensical value of "virt_to_page(0)". The zeroth page is not in any way guaranteed to be a page full of "0". So the result is that ZERO_PAGE() will almost certainly contain random values. We already allocate a real "empty_zero_page" in the mm setup code shared between MMU m68k and non-MMU m68k. It is just not hooked up to the ZERO_PAGE() macro for the non-MMU m68k case. Fix ZERO_PAGE() to use the allocated "empty_zero_page" pointer. I am not aware of any specific issues caused by the old code. Link: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#t Reported-by: Hugh Dickens Signed-off-by: Greg Ungerer commit bbd43a37ec7a02e81dc0afb2c6194957518a904b Author: Tzung-Bi Shih Date: Fri May 13 12:41:43 2022 +0800 platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough It is overkill to crash the kernel if the `din` buffer is going to full or overflow. Drop the BUG_ON() and return -EINVAL instead. Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220513044143.1045728-8-tzungbi@kernel.org commit ddec8e9e90cea8e8430b04a01adce7fb196d95c6 Author: Tzung-Bi Shih Date: Fri May 13 12:41:42 2022 +0800 platform/chrome: cros_ec_spi: drop unneeded BUG_ON() In the context, the following conditions are always false: - `todo` < 0 Suppose that EC_SPI_FRAME_START is found at the last byte of transfer. In the case, `ptr` == `end` - 1. As a result, `todo` must be 0. - `todo` > `ec_dev->din_size` Suppose that there is no preamble bytes. EC_SPI_FRAME_START is found at the first byte of transfer. In the case, `end` == `ptr` + EC_MSG_PREAMBLE_COUNT. As a result, `todo` == EC_MSG_PREAMBLE_COUNT - 1. However, it already checked `ec_dev->din_size` < EC_MSG_PREAMBLE_COUNT at the beginning of function. Drop the unneeded BUG_ON(). Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220513044143.1045728-7-tzungbi@kernel.org commit 8bff946c4199fd79f43dbff93c030b58b01bed65 Author: Tzung-Bi Shih Date: Fri May 13 12:41:41 2022 +0800 platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c() It is overkill to crash the kernel if the given message is oversize. Drop the BUG_ON() and return -EINVAL instead. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-6-tzungbi@kernel.org commit 20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e Author: Tzung-Bi Shih Date: Fri May 13 12:41:40 2022 +0800 platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_get_host_event() It is overkill to crash the kernel if the `ec_dev` doesn't support MKBP event but gets called into cros_ec_get_host_event(). Drop the BUG_ON() and return error (0 in the case) instead. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-5-tzungbi@kernel.org commit c2dcb1b06053a1ccfb73fe84e7b54b92383401cc Author: Tzung-Bi Shih Date: Fri May 13 12:41:39 2022 +0800 platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_prepare_tx() It is overkill to crash the kernel if the given message is oversize. Drop the BUG_ON() and return -EINVAL instead. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-4-tzungbi@kernel.org commit 71d3ae7fb6404c87b498f8b7f86b8271dd74989f Author: Tzung-Bi Shih Date: Fri May 13 12:41:38 2022 +0800 platform/chrome: correct cros_ec_prepare_tx() usage cros_ec_prepare_tx() returns either: - >= 0 for number of prepared bytes. - < 0 for -errno. Correct the comment and make sure all callers check the return code. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-3-tzungbi@kernel.org commit 42701e7c0cd2a715def2dafd22f11f25ca0f5024 Author: Tzung-Bi Shih Date: Fri May 13 12:41:37 2022 +0800 platform/chrome: cros_ec_proto: drop unneeded BUG_ON() in prepare_packet() prepare_packet() gets called if `ec_dev->proto_version` > 2. For now, it must be equivalent to EC_HOST_REQUEST_VERSION. Drop the BUG_ON(). Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-2-tzungbi@kernel.org commit 2e10a1d693b9f1c8921bd797838cff0be7cdd537 Author: Phillip Potter Date: Sun May 15 21:58:33 2022 +0100 cdrom: remove obsolete TODO list The TODO list in drivers/cdrom/cdrom.c has a single entry containing obsolete information, unchanged since the first git commit over 17 years ago, and probably longer. Remove this list from the comment to prevent confusion in future. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220515205833.944139-6-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit e24ccaaf7ec44e647dc56c1af2bc8d1ab67b4a11 Author: Paul Gortmaker Date: Sun May 15 21:58:32 2022 +0100 block: remove last remaining traces of IDE documentation The last traces of the IDE driver went away in commit b7fb14d3ac63 ("ide: remove the legacy ide driver") but it left behind some traces of old documentation. As luck would have it Randy and I would submit similar changes within a week of each other to address this. As Randy's commit is in the doc tree already - this delta is just the stuff my removal contained that was not in Randy's IDE doc removal. Cc: Jens Axboe Cc: Christoph Hellwig Cc: Jonathan Corbet Cc: Phillip Potter Cc: Randy Dunlap Cc: Damien Le Moal Signed-off-by: Paul Gortmaker Link: https://lore.kernel.org/all/20220427165917.GE12977@windriver.com [phil@philpotter.co.uk: removed diffs already added by others] Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220515205833.944139-5-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit 8fa10ee183c3a1ecb53e81c95895ed5bc2a5530a Author: Paul Gortmaker Date: Sun May 15 21:58:31 2022 +0100 cdrom: mark CDROMGETSPINDOWN/CDROMSETSPINDOWN obsolete These were only implemented by the IDE CD driver, which has since been removed. Given that nobody is likely to create new CD/DVD hardware (and associated drivers) we can mark these appropriately. Cc: Jens Axboe Cc: Christoph Hellwig Cc: Phillip Potter Signed-off-by: Paul Gortmaker Link: https://lore.kernel.org/all/20220427132436.12795-3-paul.gortmaker@windriver.com Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220515205833.944139-4-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit 03fea699b050805ad6ee111f9db04f223f3e835e Author: Paul Gortmaker Date: Sun May 15 21:58:30 2022 +0100 cdrom: remove the unused driver specific disc change ioctl This was only used by the ide-cd driver, which went away in commit b7fb14d3ac63 ("ide: remove the legacy ide driver") so we might as well take advantage of that and get rid of this hook as well. Cc: Christoph Hellwig Cc: Jens Axboe Cc: Phillip Potter Signed-off-by: Paul Gortmaker Link: https://lore.kernel.org/all/20220427132436.12795-2-paul.gortmaker@windriver.com Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220515205833.944139-3-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit eeef7565e8ba1718e8e1f835f145125fa6cc8494 Author: Enze Li Date: Sun May 15 21:58:29 2022 +0100 cdrom: make EXPORT_SYMBOL follow exported function Currently, some EXPORT_SYMBOL declarations do not follow the exported function, which affects the readability of the code. To maintain consistency, move these EXPORT_SYMBOL declarations to the correct position to improve the readability of the code. Signed-off-by: Enze Li Link: https://lore.kernel.org/all/20220406090337.1116708-1-lienze@kylinos.cn Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220515205833.944139-2-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit a4b5c26b79ffdfcfb816c198f2fc2b1e7b5b580f Author: Jason A. Donenfeld Date: Fri May 6 18:27:38 2022 +0200 random: order timer entropy functions below interrupt functions There are no code changes here; this is just a reordering of functions, so that in subsequent commits, the timer entropy functions can call into the interrupt ones. Signed-off-by: Jason A. Donenfeld commit 5eb60b7bff3233d07e6a9e3328d2ba415209691e Author: Johan Jonker Date: Wed Mar 30 15:16:06 2022 +0200 dt-bindings: clock: convert rockchip,rv1108-cru.txt to YAML Convert rockchip,rv1108-cru.txt to YAML. Changes against original bindings: Add clocks and clock-names because the device has to have at least one input clock. Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330131608.30040-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 614ab80c96474682157cabb14f8c8602b3422e90 Author: Mark Rutland Date: Fri May 13 14:30:38 2022 +0100 irqchip/gic-v3: Fix priority mask handling When a kernel is built with CONFIG_ARM64_PSEUDO_NMI=y and pseudo-NMIs are enabled at runtime, GICv3's gic_handle_irq() can leave DAIF and ICC_PMR_EL1 in an unexpected state in some cases, breaking subsequent usage of local_irq_enable() and resulting in softirqs being run with IRQs erroneously masked (possibly resulting in deadlocks). This can happen when an IRQ exception is taken from a context where regular IRQs were unmasked, and either: (1) ICC_IAR1_EL1 indicates a special INTID (e.g. as a result of an IRQ being withdrawn since the IRQ exception was taken). (2) ICC_IAR1_EL1 and ICC_RPR_EL1 indicate an NMI was acknowledged. When an NMI is taken from a context where regular IRQs were masked, there is no problem. When CONFIG_ARM64_DEBUG_PRIORITY_MASKING=y, this can be detected with perf, e.g. | # ./perf record -a -g -e cycles:k ls -alR / > /dev/null 2>&1 | ------------[ cut here ]------------ | WARNING: CPU: 0 PID: 14 at arch/arm64/include/asm/irqflags.h:32 arch_local_irq_enable+0x4c/0x6c | Modules linked in: | CPU: 0 PID: 14 Comm: ksoftirqd/0 Not tainted 5.18.0-rc5-00004-g876c38e3d20b #12 | Hardware name: linux,dummy-virt (DT) | pstate: 204000c5 (nzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : arch_local_irq_enable+0x4c/0x6c | lr : __do_softirq+0x110/0x5d8 | sp : ffff8000080bbbc0 | pmr_save: 000000f0 | x29: ffff8000080bbbc0 x28: ffff316ac3a6ca40 x27: 0000000000000000 | x26: 0000000000000000 x25: ffffa04611c06008 x24: ffffa04611c06008 | x23: 0000000040400005 x22: 0000000000000200 x21: ffff8000080bbe20 | x20: ffffa0460fe10320 x19: 0000000000000009 x18: 0000000000000000 | x17: ffff91252dfa9000 x16: ffff800008004000 x15: 0000000000004000 | x14: 0000000000000028 x13: ffffa0460fe17578 x12: ffffa0460fed4294 | x11: ffffa0460fedc168 x10: ffffffffffffff80 x9 : ffffa0460fe10a70 | x8 : ffffa0460fedc168 x7 : 000000000000b762 x6 : 00000000057c3bdf | x5 : ffff8000080bbb18 x4 : 0000000000000000 x3 : 0000000000000001 | x2 : ffff91252dfa9000 x1 : 0000000000000060 x0 : 00000000000000f0 | Call trace: | arch_local_irq_enable+0x4c/0x6c | __irq_exit_rcu+0x180/0x1ac | irq_exit_rcu+0x1c/0x44 | el1_interrupt+0x4c/0xe4 | el1h_64_irq_handler+0x18/0x24 | el1h_64_irq+0x74/0x78 | smpboot_thread_fn+0x68/0x2c0 | kthread+0x124/0x130 | ret_from_fork+0x10/0x20 | irq event stamp: 193241 | hardirqs last enabled at (193240): [] __do_softirq+0x10c/0x5d8 | hardirqs last disabled at (193241): [] el1_dbg+0x24/0x90 | softirqs last enabled at (193234): [] __do_softirq+0x470/0x5d8 | softirqs last disabled at (193239): [] __irq_exit_rcu+0x180/0x1ac | ---[ end trace 0000000000000000 ]--- The necessary manipulation of DAIF and ICC_PMR_EL1 depends on the interrupted context, but the structure of gic_handle_irq() makes this also depend on whether the GIC reports an IRQ, NMI, or special INTID: * When the interrupted context had regular IRQs masked (and hence the interrupt must be an NMI), the entry code performs the NMI entry/exit and gic_handle_irq() should return with DAIF and ICC_PMR_EL1 unchanged. This is handled correctly today. * When the interrupted context had regular IRQs unmasked, the entry code performs IRQ entry/exit, but expects gic_handle_irq() to always update ICC_PMR_EL1 and DAIF.IF to unmask NMIs (but not regular IRQs) prior to returning (which it must do prior to invoking any regular IRQ handler). This unbalanced calling convention is necessary because we don't know whether an NMI has been taken until acknowledged by a read from ICC_IAR1_EL1, and so we need to perform the read with NMI masked in case an NMI has been taken (and needs to be handled with NMIs masked). Unfortunately, this is not handled consistently: - When ICC_IAR1_EL1 reports a special INTID, gic_handle_irq() returns immediately without manipulating ICC_PMR_EL1 and DAIF. - When RPR_EL1 indicates an NMI, gic_handle_irq() calls gic_handle_nmi() to invoke the NMI handler, then returns without manipulating ICC_PMR_EL1 and DAIF. - For regular IRQs, gic_handle_irq() manipulates ICC_PMR_EL1 and DAIF prior to invoking the IRQ handler. There were related problems with special INTID handling in the past, where if an exception was taken from a context with regular IRQs masked and ICC_IAR_EL1 reported a special INTID, gic_handle_irq() would erroneously unmask NMIs in NMI context permitted an unexpected nested NMI. That case specifically was fixed by commit: a97709f563a078e2 ("irqchip/gic-v3: Do not enable irqs when handling spurious interrups") ... but unfortunately that commit added an inverse problem, where if an exception was taken from a context with regular IRQs *unmasked* and ICC_IAR_EL1 reported a special INTID, gic_handle_irq() would erroneously fail to unmask NMIs (and consequently regular IRQs could not be unmasked during softirq processing). Before and after that commit, if an NMI was taken from a context with regular IRQs unmasked gic_handle_irq() would not unmask NMIs prior to returning, leading to the same problem with softirq handling. This patch fixes this by restructuring gic_handle_irq(), splitting it into separate irqson/irqsoff helper functions which consistently perform the DAIF + ICC_PMR1_EL1 manipulation based upon the interrupted context, regardless of the event indicated by ICC_IAR1_EL1. The special INTID handling is moved into the low-level IRQ/NMI handler invocation helper functions, so that early returns don't prevent the required manipulation of DAIF + ICC_PMR_EL1. Fixes: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs") Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Thomas Gleixner Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220513133038.226182-4-mark.rutland@arm.com commit 6efb50923771f392122f5ce69dfc43b08f16e449 Author: Mark Rutland Date: Fri May 13 14:30:37 2022 +0100 irqchip/gic-v3: Refactor ISB + EOIR at ack time There are cases where a context synchronization event is necessary between an IRQ being raised and being handled, and there are races such that we cannot rely upon the exception entry being subsequent to the interrupt being raised. To fix this, we place an ISB between a read of IAR and the subsequent invocation of an IRQ handler. When EOI mode 1 is in use, we need to EOI an interrupt prior to invoking its handler, and we have a write to EOIR for this. As this write to EOIR requires an ISB, and this is provided by the gic_write_eoir() helper, we omit the usual ISB in this case, with the logic being: | if (static_branch_likely(&supports_deactivate_key)) | gic_write_eoir(irqnr); | else | isb(); This is somewhat opaque, and it would be a little clearer if there were an unconditional ISB, with only the write to EOIR being conditional, e.g. | if (static_branch_likely(&supports_deactivate_key)) | write_gicreg(irqnr, ICC_EOIR1_EL1); | | isb(); This patch rewrites the code that way, with this logic factored into a new helper function with comments explaining what the ISB is for, as were originally laid out in commit: 39a06b67c2c1256b ("irqchip/gic: Ensure we have an ISB between ack and ->handle_irq") Note that since then, we removed the IAR polling in commit: 342677d70ab92142 ("irqchip/gic-v3: Remove acknowledge loop") ... which removed one of the two race conditions. For consistency, other portions of the driver are made to manipulate EOIR using write_gicreg() and explcit ISBs, and the gic_write_eoir() helper function is removed. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220513133038.226182-3-mark.rutland@arm.com commit adf14453d2c037ab529040c1186ea32e277e783a Author: Mark Rutland Date: Fri May 13 14:30:36 2022 +0100 irqchip/gic-v3: Ensure pseudo-NMIs have an ISB between ack and handling There are cases where a context synchronization event is necessary between an IRQ being raised and being handled, and there are races such that we cannot rely upon the exception entry being subsequent to the interrupt being raised. We identified and fixes this for regular IRQs in commit: 39a06b67c2c1256b ("irqchip/gic: Ensure we have an ISB between ack and ->handle_irq") Unfortunately, we forgot to do the same for psuedo-NMIs when support for those was added in commit: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs") Which means that when pseudo-NMIs are used for PMU support, we'll hit the same problem. Apply the same fix as for regular IRQs. Note that when EOI mode 1 is in use, the call to gic_write_eoir() will provide an ISB. Fixes: f32c926651dcd168 ("irqchip/gic-v3: Handle pseudo-NMIs") Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220513133038.226182-2-mark.rutland@arm.com commit 155ca952c7ca19aa32ecfb7373a32bbc2e1ec6eb Author: Aditya Garg Date: Fri Apr 15 17:02:46 2022 +0000 efi: Do not import certificates from UEFI Secure Boot for T2 Macs On Apple T2 Macs, when Linux attempts to read the db and dbx efi variables at early boot to load UEFI Secure Boot certificates, a page fault occurs in Apple firmware code and EFI runtime services are disabled with the following logs: [Firmware Bug]: Page fault caused by firmware at PA: 0xffffb1edc0068000 WARNING: CPU: 3 PID: 104 at arch/x86/platform/efi/quirks.c:735 efi_crash_gracefully_on_page_fault+0x50/0xf0 (Removed some logs from here) Call Trace: page_fault_oops+0x4f/0x2c0 ? search_bpf_extables+0x6b/0x80 ? search_module_extables+0x50/0x80 ? search_exception_tables+0x5b/0x60 kernelmode_fixup_or_oops+0x9e/0x110 __bad_area_nosemaphore+0x155/0x190 bad_area_nosemaphore+0x16/0x20 do_kern_addr_fault+0x8c/0xa0 exc_page_fault+0xd8/0x180 asm_exc_page_fault+0x1e/0x30 (Removed some logs from here) ? __efi_call+0x28/0x30 ? switch_mm+0x20/0x30 ? efi_call_rts+0x19a/0x8e0 ? process_one_work+0x222/0x3f0 ? worker_thread+0x4a/0x3d0 ? kthread+0x17a/0x1a0 ? process_one_work+0x3f0/0x3f0 ? set_kthread_struct+0x40/0x40 ? ret_from_fork+0x22/0x30 ---[ end trace 1f82023595a5927f ]--- efi: Froze efi_rts_wq and disabled EFI Runtime Services integrity: Couldn't get size: 0x8000000000000015 integrity: MODSIGN: Couldn't get UEFI db list efi: EFI Runtime Services are disabled! integrity: Couldn't get size: 0x8000000000000015 integrity: Couldn't get UEFI dbx list integrity: Couldn't get size: 0x8000000000000015 integrity: Couldn't get mokx list integrity: Couldn't get size: 0x80000000 So we avoid reading these UEFI variables and thus prevent the crash. Cc: stable@vger.kernel.org Signed-off-by: Aditya Garg Reviewed-by: Mimi Zohar Signed-off-by: Mimi Zohar commit 2cde51f1e10f260076899bf41add74ed4a6de034 Author: Marc Zyngier Date: Sun May 15 11:36:24 2022 +0100 KVM: arm64: Hide KVM_REG_ARM_*_BMAP_BIT_COUNT from userspace These constants will change over time, and userspace has no business knowing about them. Hide them behind __KERNEL__. Signed-off-by: Marc Zyngier commit 722625c6f4c5b6a9953d6af04c7bb1a6e12830b3 Author: Fuad Tabba Date: Tue May 10 09:57:10 2022 +0000 KVM: arm64: Reenable pmu in Protected Mode Now that the pmu code does not access hyp data, reenable it in protected mode. Once fully supported, protected VMs will not have pmu support, since that could leak information. However, non-protected VMs in protected mode should have pmu support if available. Signed-off-by: Fuad Tabba Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510095710.148178-5-tabba@google.com commit 84d751a019a9792f5b4884e1d598b603c360ec22 Author: Fuad Tabba Date: Tue May 10 09:57:09 2022 +0000 KVM: arm64: Pass pmu events to hyp via vcpu Instead of the host accessing hyp data directly, pass the pmu events of the current cpu to hyp via the vcpu. This adds 64 bits (in two fields) to the vcpu that need to be synced before every vcpu run in nvhe and protected modes. However, it isolates the hypervisor from the host, which allows us to use pmu in protected mode in a subsequent patch. No visible side effects in behavior intended. Signed-off-by: Fuad Tabba Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510095710.148178-4-tabba@google.com commit e987a4c60f9755b2f7a19bf1b5ef2eb74c90579b Author: Fuad Tabba Date: Tue May 10 09:57:08 2022 +0000 KVM: arm64: Repack struct kvm_pmu to reduce size struct kvm_pmu has 2 holes using 10 bytes. This is instantiated in all vcpus, so it adds up. Repack the structures to remove the holes. No functional change intended. Reviewed-by: Oliver Upton Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510095710.148178-3-tabba@google.com commit 3cb8a091a7016be0ee5420ff6c1928972e3ce23e Author: Fuad Tabba Date: Tue May 10 09:57:07 2022 +0000 KVM: arm64: Wrapper for getting pmu_events Eases migrating away from using hyp data and simplifies the code. No functional change intended. Reviewed-by: Oliver Upton Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220510095710.148178-2-tabba@google.com commit cae889302ebf5a9b22ca3580996118b8d20b3ae6 Author: Marc Zyngier Date: Sat May 14 11:25:24 2022 +0100 KVM: arm64: vgic-v3: List M1 Pro/Max as requiring the SEIS workaround Unsusprisingly, Apple M1 Pro/Max have the exact same defect as the original M1 and generate random SErrors in the host when a guest tickles the GICv3 CPU interface the wrong way. Add the part numbers for both the CPU types found in these two new implementations, and add them to the hall of shame. This also applies to the Ultra version, as it is composed of 2 Max SoCs. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220514102524.3188730-1-maz@kernel.org commit e85c0fc1d94c52483a603651748d4c76d6aa1c6b Author: Jason A. Donenfeld Date: Sat Apr 30 22:03:29 2022 +0200 random: do not pretend to handle premature next security model Per the thread linked below, "premature next" is not considered to be a realistic threat model, and leads to more serious security problems. "Premature next" is the scenario in which: - Attacker compromises the current state of a fully initialized RNG via some kind of infoleak. - New bits of entropy are added directly to the key used to generate the /dev/urandom stream, without any buffering or pooling. - Attacker then, somehow having read access to /dev/urandom, samples RNG output and brute forces the individual new bits that were added. - Result: the RNG never "recovers" from the initial compromise, a so-called violation of what academics term "post-compromise security". The usual solutions to this involve some form of delaying when entropy gets mixed into the crng. With Fortuna, this involves multiple input buckets. With what the Linux RNG was trying to do prior, this involves entropy estimation. However, by delaying when entropy gets mixed in, it also means that RNG compromises are extremely dangerous during the window of time before the RNG has gathered enough entropy, during which time nonces may become predictable (or repeated), ephemeral keys may not be secret, and so forth. Moreover, it's unclear how realistic "premature next" is from an attack perspective, if these attacks even make sense in practice. Put together -- and discussed in more detail in the thread below -- these constitute grounds for just doing away with the current code that pretends to handle premature next. I say "pretends" because it wasn't doing an especially great job at it either; should we change our mind about this direction, we would probably implement Fortuna to "fix" the "problem", in which case, removing the pretend solution still makes sense. This also reduces the crng reseed period from 5 minutes down to 1 minute. The rationale from the thread might lead us toward reducing that even further in the future (or even eliminating it), but that remains a topic of a future commit. At a high level, this patch changes semantics from: Before: Seed for the first time after 256 "bits" of estimated entropy have been accumulated since the system booted. Thereafter, reseed once every five minutes, but only if 256 new "bits" have been accumulated since the last reseeding. After: Seed for the first time after 256 "bits" of estimated entropy have been accumulated since the system booted. Thereafter, reseed once every minute. Most of this patch is renaming and removing: POOL_MIN_BITS becomes POOL_INIT_BITS, credit_entropy_bits() becomes credit_init_bits(), crng_reseed() loses its "force" parameter since it's now always true, the drain_entropy() function no longer has any use so it's removed, entropy estimation is skipped if we've already init'd, the various notifiers for "low on entropy" are now only active prior to init, and finally, some documentation comments are cleaned up here and there. Link: https://lore.kernel.org/lkml/YmlMGx6+uigkGiZ0@zx2c4.com/ Cc: Theodore Ts'o Cc: Nadia Heninger Cc: Tom Ristenpart Reviewed-by: Eric Biggers Signed-off-by: Jason A. Donenfeld commit 0639e02254e6863fc9c96666be45919437a6dc2e Author: Mark Brown Date: Tue May 10 17:45:20 2022 +0100 selftests/arm64: Use switch statements in mte_common_util.c In the MTE tests there are several places where we use chains of if statements to open code what could be written as switch statements, move over to switch statements to make the idiom clearer. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220510164520.768783-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit 541235dee01140c4ae9e71e8dfbdb4c2f9eac9d5 Author: Mark Brown Date: Tue May 10 17:45:19 2022 +0100 selftests/arm64: Remove casts to/from void in check_tags_inclusion Void pointers may be freely used with other pointer types in C, any casts between void * and other pointer types serve no purpose other than to mask potential warnings. Drop such casts from check_tags_inclusion to help with future review of the code. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220510164520.768783-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 72d6771cb1734a2f32308c34c61043595e4bcb41 Author: Mark Brown Date: Tue May 10 17:45:18 2022 +0100 selftests/arm64: Check failures to set tags in check_tags_inclusion The MTE check_tags_inclusion test uses the mte_switch_mode() helper but ignores the return values it generates meaning we might not be testing the things we're trying to test, fail the test if it reports an error. The helper will log any errors it returns. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220510164520.768783-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit ffc8274c21938b30b10fcd6d4fc0feb29c222955 Author: Mark Brown Date: Tue May 10 17:45:17 2022 +0100 selftests/arm64: Allow zero tags in mte_switch_mode() mte_switch_mode() currently rejects attempts to set a zero tag however there are tests such as check_tags_inclusion which attempt to cover cases with zero tags using mte_switch_mode(). Since it is not clear why we are rejecting zero tags change the test to accept them. The issue has not previously been as apparent as it should be since the return value of mte_switch_mode() was not always checked in the callers and the tests weren't otherwise failing. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220510164520.768783-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9a5681710740e496ee8b08004ddf2c212b76b36a Author: Mark Brown Date: Tue May 10 17:45:16 2022 +0100 selftests/arm64: Log errors in verify_mte_pointer_validity() When we detect a problem in verify_mte_pointer_validity() while checking tags we don't log what the problem was which makes debugging harder. Add some diagnostics. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220510164520.768783-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5005d1dbbb3828078f32dff24b77866502e45e93 Author: Mark Rutland Date: Fri May 13 18:41:18 2022 +0100 arm64/sysreg: fix odd line spacing Between the header and the definitions, there's no line gap, and in a couple of places a double line gap for no semantic reason, which makes the output look a little odd. Fix this so blocks are consistently separated with a single line gap: * Add a newline after the "Generated file" comment line, so this is clearly split from whatever the first definition in the file is. * At the start of a SysregFields block there's no need for a newline as we haven't output any sysreg encoding details prior to this. * At the end of a Sysreg block there's no need for a newline if we have no RES0 or RES1 fields, as there will be a line gap after the previous element (e.g. a Fields line). There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Mark Brown Cc: Will Deacon Link: https://lore.kernel.org/r/20220513174118.266966-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 82bf59002e0f84e51c16589080c2feba6e6ec78a Author: Mark Rutland Date: Fri May 13 18:41:17 2022 +0100 arm64/sysreg: improve comment for regs without fields Currently for registers without fields we create a comment pointing at the common definitions, e.g. | #define REG_TTBR0_EL1 S3_0_C2_C0_0 | #define SYS_TTBR0_EL1 sys_reg(3, 0, 2, 0, 0) | #define SYS_TTBR0_EL1_Op0 3 | #define SYS_TTBR0_EL1_Op1 0 | #define SYS_TTBR0_EL1_CRn 2 | #define SYS_TTBR0_EL1_CRm 0 | #define SYS_TTBR0_EL1_Op2 0 | | /* See TTBRx_EL1 */ It would be slightly nicer if the comment said what we should be looking for, e.g. | #define REG_TTBR0_EL1 S3_0_C2_C0_0 | #define SYS_TTBR0_EL1 sys_reg(3, 0, 2, 0, 0) | #define SYS_TTBR0_EL1_Op0 3 | #define SYS_TTBR0_EL1_Op1 0 | #define SYS_TTBR0_EL1_CRn 2 | #define SYS_TTBR0_EL1_CRm 0 | #define SYS_TTBR0_EL1_Op2 0 | | /* For TTBR0_EL1 fields see TTBRx_EL1 */ Update the comment generation accordingly. Signed-off-by: Mark Rutland Cc: Mark Brown Cc: Will Deacon Link: https://lore.kernel.org/r/20220513174118.266966-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 6319194ec57b0452dcda4589d24c4e7db299c5bf Author: Al Viro Date: Thu May 12 17:08:03 2022 -0400 Unify the primitives for file descriptor closing Currently we have 3 primitives for removing an opened file from descriptor table - pick_file(), __close_fd_get_file() and close_fd_get_file(). Their calling conventions are rather odd and there's a code duplication for no good reason. They can be unified - 1) have __range_close() cap max_fd in the very beginning; that way we don't need separate way for pick_file() to report being past the end of descriptor table. 2) make {__,}close_fd_get_file() return file (or NULL) directly, rather than returning it via struct file ** argument. Don't bother with (bogus) return value - nobody wants that -ENOENT. 3) make pick_file() return NULL on unopened descriptor - the only caller that used to care about the distinction between descriptor past the end of descriptor table and finding NULL in descriptor table doesn't give a damn after (1). 4) lift ->files_lock out of pick_file() That actually simplifies the callers, as well as the primitives themselves. Code duplication is also gone... Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Al Viro commit 81132a39c152ca09832b9e4cb748129cee5f55ec Author: Gou Hao Date: Tue Nov 2 10:46:48 2021 +0800 fs: remove fget_many and fput_many interface These two interface were added in 091141a42 commit, but now there is no place to call them. The only user of fput/fget_many() was removed in commit 62906e89e63b ("io_uring: remove file batch-get optimisation"). A user of get_file_rcu_many() were removed in commit f073531070d2 ("init: add an init_dup helper"). And replace atomic_long_sub/add to atomic_long_dec/inc can improve performance. Here are the test results of unixbench: Cmd: ./Run -c 64 context1 Without patch: System Benchmarks Partial Index BASELINE RESULT INDEX Pipe-based Context Switching 4000.0 2798407.0 6996.0 ======== System Benchmarks Index Score (Partial Only) 6996.0 With patch: System Benchmarks Partial Index BASELINE RESULT INDEX Pipe-based Context Switching 4000.0 3486268.8 8715.7 ======== System Benchmarks Index Score (Partial Only) 8715.7 Signed-off-by: Gou Hao Signed-off-by: Al Viro commit 21673fcb2532dcd189905ff5a5389eb7dcd0e57a Author: Sebastian Andrzej Siewior Date: Wed May 11 13:07:50 2022 +0200 genirq/irq_sim: Make the irq_work always run in hard irq context The IRQ simulator uses irq_work to trigger an interrupt. Without the IRQ_WORK_HARD_IRQ flag the irq_work will be performed in thread context on PREEMPT_RT. This causes locking errors later in handle_simple_irq() which expects to be invoked with disabled interrupts. Triggering individual interrupts in hardirq context should not lead to unexpected high latencies since this is also what the hardware controller does. Also it is used as a simulator so... Use IRQ_WORK_INIT_HARD() to carry out the irq_work in hardirq context on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/YnuZBoEVMGwKkLm+@linutronix.de commit 317f29c14d0cca09952f1022491454b23455ebcb Author: Stephen Boyd Date: Wed May 11 13:19:51 2022 -0700 timers: Provide a better debugobjects hint for delayed works With debugobjects enabled the timer hint for freeing of active timers embedded inside delayed works is always the same, i.e. the hint is delayed_work_timer_fn, even though the function the delayed work is going to run can be wildly different depending on what work was queued. Enabling workqueue debugobjects doesn't help either because the delayed work isn't considered active until it is actually queued to run on a workqueue. If the work is freed while the timer is pending the work isn't considered active so there is no information from workqueue debugobjects. Special case delayed works in the timer debugobjects hint logic so that the delayed work function is returned instead of the delayed_work_timer_fn. This will help to understand which delayed work was pending that got freed. Apply the same treatment for kthread_delayed_work because it follows the same pattern. Suggested-by: Thomas Gleixner Signed-off-by: Stephen Boyd Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220511201951.42408-1-swboyd@chromium.org commit 4e86a2c980137f7be1ea600af5f1f5c8342ecc09 Author: Hao Xu Date: Sat May 14 22:20:46 2022 +0800 io_uring: implement multishot mode for accept Refactor io_accept() to support multishot mode. theoretical analysis: 1) when connections come in fast - singleshot: add accept sqe(userspace) --> accept inline ^ | |-----------------| - multishot: add accept sqe(userspace) --> accept inline ^ | |--*--| we do accept repeatedly in * place until get EAGAIN 2) when connections come in at a low pressure similar thing like 1), we reduce a lot of userspace-kernel context switch and useless vfs_poll() tests: Did some tests, which goes in this way: server client(multiple) accept connect read write write read close close Basically, raise up a number of clients(on same machine with server) to connect to the server, and then write some data to it, the server will write those data back to the client after it receives them, and then close the connection after write return. Then the client will read the data and then close the connection. Here I test 10000 clients connect one server, data size 128 bytes. And each client has a go routine for it, so they come to the server in short time. test 20 times before/after this patchset, time spent:(unit cycle, which is the return value of clock()) before: 1930136+1940725+1907981+1947601+1923812+1928226+1911087+1905897+1941075 +1934374+1906614+1912504+1949110+1908790+1909951+1941672+1969525+1934984 +1934226+1914385)/20.0 = 1927633.75 after: 1858905+1917104+1895455+1963963+1892706+1889208+1874175+1904753+1874112 +1874985+1882706+1884642+1864694+1906508+1916150+1924250+1869060+1889506 +1871324+1940803)/20.0 = 1894750.45 (1927633.75 - 1894750.45) / 1927633.75 = 1.65% Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220514142046.58072-5-haoxu.linux@gmail.com Signed-off-by: Jens Axboe commit dbc2564cfe0faff439dc46adb8c009589054ea46 Author: Hao Xu Date: Sat May 14 22:20:45 2022 +0800 io_uring: let fast poll support multishot For operations like accept, multishot is a useful feature, since we can reduce a number of accept sqe. Let's integrate it to fast poll, it may be good for other operations in the future. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220514142046.58072-4-haoxu.linux@gmail.com Signed-off-by: Jens Axboe commit 227685ebfaba0bc7e2ddc47cef4556050b6d7a8f Author: Hao Xu Date: Sat May 14 22:20:44 2022 +0800 io_uring: add REQ_F_APOLL_MULTISHOT for requests Add a flag to indicate multishot mode for fast poll. currently only accept use it, but there may be more operations leveraging it in the future. Also add a mask IO_APOLL_MULTI_POLLED which stands for REQ_F_APOLL_MULTI | REQ_F_POLLED, to make the code short and cleaner. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220514142046.58072-3-haoxu.linux@gmail.com Signed-off-by: Jens Axboe commit 390ed29b5e425ba00da2b6113b74a14949f71b02 Author: Hao Xu Date: Sat May 14 22:20:43 2022 +0800 io_uring: add IORING_ACCEPT_MULTISHOT for accept add an accept_flag IORING_ACCEPT_MULTISHOT for accept, which is to support multishot. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220514142046.58072-2-haoxu.linux@gmail.com Signed-off-by: Jens Axboe commit 4bca93abfffb049e2b52c62e7f0ccaf7022270c2 Author: Raviteja Narayanam Date: Wed Apr 20 13:29:24 2022 +0530 i2c: xiic: Fix Tx Interrupt path for grouped messages When a group of messages are sent from user space as a set, if the last message has less than Tx FIFO DEPTH number of bytes to transfer, Tx half empty interrupt is triggered continuously from the hardware. It is due to Bus not busy interrupt coming along with Tx half empty and tx empty. Hence, service the Tx interrupts before Bus not busy interrupt to update the i2c message status correctly. Signed-off-by: Raviteja Narayanam Signed-off-by: Shubhrajyoti Datta Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit b822039b8ec16b4837831404609fb1c1c2da3d33 Author: Michal Simek Date: Wed Apr 20 13:29:22 2022 +0530 i2c: xiic: Fix coding style issues Most of these stuff are reported by checkpatch. But fixes are: - Incorrect indetation - Missing blank line after variable declaration - Additional () - Missing spaces around + - Missing parenthesis when if has them - Newlines - Remove MODULE_ALIAS - none is really using it Signed-off-by: Michal Simek Signed-off-by: Shubhrajyoti Datta Signed-off-by: Wolfram Sang commit 8fa9c93880530a91c6ea83b49bd37c268e9bf47e Author: Shubhrajyoti Datta Date: Wed Apr 20 13:29:21 2022 +0530 i2c: xiic: return value of xiic_reinit Check the return value of xiic_reinit. Signed-off-by: Shubhrajyoti Datta Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit 96789dce043f5bff8b7d62aa28d52a7c59403a84 Author: Lucas Tanure Date: Wed Apr 13 10:14:10 2022 +0100 i2c: cadence: Increase timeout per message if necessary Timeout as 1 second sets an upper limit on the length of the transfer executed, but there is no maximum length of a write or read message set in i2c_adapter_quirks for this controller. This upper limit affects devices that require sending large firmware blobs over I2C. To remove that limitation, calculate the minimal time necessary, plus some wiggle room, for every message and use it instead of the default one second, if more than one second. Signed-off-by: Lucas Tanure Acked-by: Michal Simek Signed-off-by: Wolfram Sang commit f8ef475aa069cd72e9e7bdb2d60dc6a89e2bafad Author: Lv Ruyi Date: Mon May 9 07:24:05 2022 +0000 iio: adc: xilinx-ams: fix return error variable Return irq instead of ret which always equals to zero here. Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Michal Simek Signed-off-by: Jonathan Cameron commit e17daa3b58ed8ba187475b4bb12ca21193596cb3 Author: Jarkko Nikula Date: Wed Apr 20 15:58:02 2022 +0300 i2c: designware: Sort timing parameter ACPI method calls by the speed It's more logical to read these get timing parameters ACPI method calls sorted by speed categories in increasing order: Standard-mode, Fast-mode, Fast-mode Plus and High-speed mode. Originally these were in order after commit a92ec1746f10 ("i2c: designware: get fast plus and high speed *CNT configuration") but got mixed up over the years. Signed-off-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 6977262c2eee111645668fe9e235ef2f5694abf7 Author: Nathan Chancellor Date: Thu May 5 08:27:38 2022 -0700 i2c: at91: Initialize dma_buf in at91_twi_xfer() Clang warns: drivers/i2c/busses/i2c-at91-master.c:707:6: warning: variable 'dma_buf' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (dev->use_dma) { ^~~~~~~~~~~~ drivers/i2c/busses/i2c-at91-master.c:717:27: note: uninitialized use occurs here i2c_put_dma_safe_msg_buf(dma_buf, m_start, !ret); ^~~~~~~ Initialize dma_buf to NULL, as i2c_put_dma_safe_msg_buf() is a no-op when the first argument is NULL, which will work for the !dev->use_dma case. Fixes: 03fbb903c8bf ("i2c: at91: use dma safe buffers") Link: https://github.com/ClangBuiltLinux/linux/issues/1629 Signed-off-by: Nathan Chancellor Reviewed-by: Michael Walle Signed-off-by: Wolfram Sang commit 5561a2b086394f554c2ff031db4195f39db5213c Author: William Breathitt Gray Date: Tue May 10 13:30:58 2022 -0400 gpio: ws16c48: Utilize iomap interface This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by: David Laight Signed-off-by: William Breathitt Gray Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 54c8e25174a5c0557ee1c231fe9801790076b85f Author: William Breathitt Gray Date: Tue May 10 13:30:57 2022 -0400 gpio: gpio-mm: Utilize iomap interface This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by: David Laight Signed-off-by: William Breathitt Gray Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e0a574ef413b9e0b2ef6ddc540fa292eb38625b6 Author: William Breathitt Gray Date: Tue May 10 13:30:56 2022 -0400 gpio: 104-idio-16: Utilize iomap interface This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by: David Laight Signed-off-by: William Breathitt Gray Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit bed58069905dadc19e572131d97c4abb2b86893a Author: William Breathitt Gray Date: Tue May 10 13:30:55 2022 -0400 gpio: 104-idi-48: Utilize iomap interface This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by: David Laight Signed-off-by: William Breathitt Gray Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e993e236058981aceee0518ad17e11f3d16112f8 Author: William Breathitt Gray Date: Tue May 10 13:30:54 2022 -0400 gpio: 104-dio-48e: Utilize iomap interface This driver doesn't need to access I/O ports directly via inb()/outb() and friends. This patch abstracts such access by calling ioport_map() to enable the use of more typical ioread8()/iowrite8() I/O memory accessor calls. Suggested-by: David Laight Signed-off-by: William Breathitt Gray Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit cf8f4462e5fa6b3b0c7f3a7543473d0dfdd8d06a Author: Moses Christopher Bollavarapu Date: Thu May 12 09:14:15 2022 +0200 gpio: zevio: drop of_gpio.h header Remove of_gpio.h header file, replace of_* functions and structs with appropriate alternatives. Signed-off-by: Moses Christopher Bollavarapu Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit b21445db9818ccb9fa1c0ba81fd3705eb8d347e3 Author: Peter Geis Date: Wed May 11 11:01:12 2022 -0400 dt-binding: clock: Add missing rk3568 cru bindings The rk3568 cru requires a clock input and a phandle to the grf node. Add these bindings to clear some dtbs_check warnings. Signed-off-by: Peter Geis Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220511150117.113070-2-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit b846f2d7e2d28ebfa112ac595bde2ef87693d8d9 Author: Jakob Koschel Date: Fri Apr 1 00:38:57 2022 +0200 gfs2: replace '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 Signed-off-by: Andreas Gruenbacher commit d9713088158b23973266e07fdc85ff7d68791a8c Author: Sridhar Samudrala Date: Thu May 12 14:32:49 2022 -0700 ice: Expose RSS indirection tables for queue groups via ethtool When ADQ queue groups (TCs) are created via tc mqprio command, RSS contexts and associated RSS indirection tables are configured automatically per TC based on the queue ranges specified for each traffic class. For ex: tc qdisc add dev enp175s0f0 root mqprio num_tc 3 map 0 1 2 \ queues 2@0 8@2 4@10 hw 1 mode channel will create 3 queue groups (TC 0-2) with queue ranges 2, 8 and 4 in 3 queue groups. Each queue group is associated with its own RSS context and RSS indirection table. Add support to expose RSS indirection tables for all ADQ queue groups using ethtool RSS contexts interface. ethtool -x enp175s0f0 context Signed-off-by: Sridhar Samudrala Signed-off-by: Sudheer Mogilappagari Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220512213249.3747424-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 470bcfd6039b390f1bc29d9ce12461781f5cd7af Author: Lorenzo Bianconi Date: Thu May 12 14:26:21 2022 -0700 ixgbe: add xdp frags support to ndo_xdp_xmit Add the capability to map non-linear xdp frames in XDP_TX and ndo_xdp_xmit callback. Signed-off-by: Lorenzo Bianconi Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220512212621.3746140-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit c28678162b330c8d3bfc472db8c47c8e5e7726f1 Author: Jakub Kicinski Date: Thu May 12 13:56:03 2022 -0700 eth: sfc: remove remnants of the out-of-tree napi_weight module param Remove napi_weight statics which are set to 64 and never modified, remnants of the out-of-tree napi_weight module param. Acked-by: Edward Cree Link: https://lore.kernel.org/r/20220512205603.1536771-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit c7031c144043c5b9a9b8827aaf44a67937559418 Author: Julius Hemanth Pitti Date: Fri May 13 16:58:15 2022 -0700 proc/sysctl: make protected_* world readable protected_* files have 600 permissions which prevents non-superuser from reading them. Container like "AWS greengrass" refuse to launch unless protected_hardlinks and protected_symlinks are set. When containers like these run with "userns-remap" or "--user" mapping container's root to non-superuser on host, they fail to run due to denied read access to these files. As these protections are hardly a secret, and do not possess any security risk, making them world readable. Though above greengrass usecase needs read access to only protected_hardlinks and protected_symlinks files, setting all other protected_* files to 644 to keep consistency. Link: http://lkml.kernel.org/r/20200709235115.56954-1-jpitti@cisco.com Fixes: 800179c9b8a1 ("fs: add link restrictions") Signed-off-by: Julius Hemanth Pitti Acked-by: Kees Cook Acked-by: Luis Chamberlain Cc: Iurii Zaikin Cc: Ingo Molnar Cc: Al Viro Signed-off-by: Andrew Morton commit bbe832b9db2e1ad21522f8f0bf02775fff8a0e0e Author: Rei Yamamoto Date: Fri May 13 16:48:57 2022 -0700 mm, compaction: fast_find_migrateblock() should return pfn in the target zone At present, pages not in the target zone are added to cc->migratepages list in isolate_migratepages_block(). As a result, pages may migrate between nodes unintentionally. This would be a serious problem for older kernels without commit a984226f457f849e ("mm: memcontrol: remove the pgdata parameter of mem_cgroup_page_lruvec"), because it can corrupt the lru list by handling pages in list without holding proper lru_lock. Avoid returning a pfn outside the target zone in the case that it is not aligned with a pageblock boundary. Otherwise isolate_migratepages_block() will handle pages not in the target zone. Link: https://lkml.kernel.org/r/20220511044300.4069-1-yamamoto.rei@jp.fujitsu.com Fixes: 70b44595eafe ("mm, compaction: use free lists to quickly locate a migration source") Signed-off-by: Rei Yamamoto Reviewed-by: Miaohe Lin Acked-by: Mel Gorman Reviewed-by: Oscar Salvador Cc: Don Dutile Cc: Wonhyuk Yang Cc: Rei Yamamoto Cc: Signed-off-by: Andrew Morton commit d4a157f5a26fbf1f1fd5da47a4772a738306348f Author: Gautam Menghani Date: Fri May 13 16:48:57 2022 -0700 mm/damon: add documentation for Enum value Fix the warning - "Enum value 'NR_DAMON_OPS' not described in enum 'damon_ops_id'" generated by the command "make pdfdocs" Link: https://lkml.kernel.org/r/20220508073316.141401-1-gautammenghani201@gmail.com Signed-off-by: Gautam Menghani Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 8e20d4b332660a32e842e20c34cfc3b3456bc6dc Author: Ganesan Rajagopal Date: Fri May 13 16:48:57 2022 -0700 mm/memcontrol: export memcg->watermark via sysfs for v2 memcg We run a lot of automated tests when building our software and run into OOM scenarios when the tests run unbounded. v1 memcg exports memcg->watermark as "memory.max_usage_in_bytes" in sysfs. We use this metric to heuristically limit the number of tests that can run in parallel based on per test historical data. This metric is currently not exported for v2 memcg and there is no other easy way of getting this information. getrusage() syscall returns "ru_maxrss" which can be used as an approximation but that's the max RSS of a single child process across all children instead of the aggregated max for all child processes. The only work around is to periodically poll "memory.current" but that's not practical for short-lived one-off cgroups. Hence, expose memcg->watermark as "memory.peak" for v2 memcg. Link: https://lkml.kernel.org/r/20220507050916.GA13577@us192.sjc.aristanetworks.com Signed-off-by: Ganesan Rajagopal Acked-by: Shakeel Butt Acked-by: Johannes Weiner Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Roman Gushchin Reviewed-by: Michal Koutný Signed-off-by: Andrew Morton commit 78f39084b41d287aedb2ea55f2c1895cfa11d61a Author: Muchun Song Date: Fri May 13 16:48:56 2022 -0700 mm: hugetlb_vmemmap: add hugetlb_optimize_vmemmap sysctl We must add hugetlb_free_vmemmap=on (or "off") to the boot cmdline and reboot the server to enable or disable the feature of optimizing vmemmap pages associated with HugeTLB pages. However, rebooting usually takes a long time. So add a sysctl to enable or disable the feature at runtime without rebooting. Why we need this? There are 3 use cases. 1) The feature of minimizing overhead of struct page associated with each HugeTLB is disabled by default without passing "hugetlb_free_vmemmap=on" to the boot cmdline. When we (ByteDance) deliver the servers to the users who want to enable this feature, they have to configure the grub (change boot cmdline) and reboot the servers, whereas rebooting usually takes a long time (we have thousands of servers). It's a very bad experience for the users. So we need a approach to enable this feature after rebooting. This is a use case in our practical environment. 2) Some use cases are that HugeTLB pages are allocated 'on the fly' instead of being pulled from the HugeTLB pool, those workloads would be affected with this feature enabled. Those workloads could be identified by the characteristics of they never explicitly allocating huge pages with 'nr_hugepages' but only set 'nr_overcommit_hugepages' and then let the pages be allocated from the buddy allocator at fault time. We can confirm it is a real use case from the commit 099730d67417. For those workloads, the page fault time could be ~2x slower than before. We suspect those users want to disable this feature if the system has enabled this before and they don't think the memory savings benefit is enough to make up for the performance drop. 3) If the workload which wants vmemmap pages to be optimized and the workload which wants to set 'nr_overcommit_hugepages' and does not want the extera overhead at fault time when the overcommitted pages be allocated from the buddy allocator are deployed in the same server. The user could enable this feature and set 'nr_hugepages' and 'nr_overcommit_hugepages', then disable the feature. In this case, the overcommited HugeTLB pages will not encounter the extra overhead at fault time. Link: https://lkml.kernel.org/r/20220512041142.39501-5-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Jonathan Corbet Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Oscar Salvador Cc: David Hildenbrand Cc: Masahiro Yamada Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 9c54c522bb76cbef480722bd44059e2ba8304bd2 Author: Muchun Song Date: Fri May 13 16:48:56 2022 -0700 mm: hugetlb_vmemmap: use kstrtobool for hugetlb_vmemmap param parsing Use kstrtobool rather than open coding "on" and "off" parsing in mm/hugetlb_vmemmap.c, which is more powerful to handle all kinds of parameters like 'Yy1Nn0' or [oO][NnFf] for "on" and "off". Link: https://lkml.kernel.org/r/20220512041142.39501-4-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: Iurii Zaikin Cc: Jonathan Corbet Cc: Kees Cook Cc: Luis Chamberlain Cc: Masahiro Yamada Cc: Oscar Salvador Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 6e02c46b4d970f24eb51197d451b00f08a8a4186 Author: Muchun Song Date: Fri May 13 16:48:56 2022 -0700 mm: memory_hotplug: override memmap_on_memory when hugetlb_free_vmemmap=on Optimizing HugeTLB vmemmap pages is not compatible with allocating memmap on hot added memory. If "hugetlb_free_vmemmap=on" and memory_hotplug.memmap_on_memory" are both passed on the kernel command line, optimizing hugetlb pages takes precedence. However, the global variable memmap_on_memory will still be set to 1, even though we will not try to allocate memmap on hot added memory. Also introduce mhp_memmap_on_memory() helper to move the definition of "memmap_on_memory" to the scope of CONFIG_MHP_MEMMAP_ON_MEMORY. In the next patch, mhp_memmap_on_memory() will also be exported to be used in hugetlb_vmemmap.c. Link: https://lkml.kernel.org/r/20220512041142.39501-3-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Mike Kravetz Cc: David Hildenbrand Cc: Iurii Zaikin Cc: Jonathan Corbet Cc: Kees Cook Cc: Luis Chamberlain Cc: Masahiro Yamada Cc: Oscar Salvador Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 0effdf461c5789be02d40c1868c70cc02ea24627 Author: Muchun Song Date: Fri May 13 16:48:56 2022 -0700 mm: hugetlb_vmemmap: disable hugetlb_optimize_vmemmap when struct page crosses page boundaries Patch series "add hugetlb_optimize_vmemmap sysctl", v11. This series aims to add hugetlb_optimize_vmemmap sysctl to enable or disable the feature of optimizing vmemmap pages associated with HugeTLB pages. This patch (of 4): If the size of "struct page" is not the power of two but with the feature of minimizing overhead of struct page associated with each HugeTLB is enabled, then the vmemmap pages of HugeTLB will be corrupted after remapping (panic is about to happen in theory). But this only exists when !CONFIG_MEMCG && !CONFIG_SLUB on x86_64. However, it is not a conventional configuration nowadays. So it is not a real word issue, just the result of a code review. But we cannot prevent anyone from configuring that combined configure. This hugetlb_optimize_vmemmap should be disable in this case to fix this issue. Link: https://lkml.kernel.org/r/20220512041142.39501-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220512041142.39501-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: Iurii Zaikin Cc: Jonathan Corbet Cc: Kees Cook Cc: Luis Chamberlain Cc: Masahiro Yamada Cc: Oscar Salvador Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit a00a875925a418b030783457595f70ddf855de4b Author: Baolin Wang Date: Fri May 13 16:48:56 2022 -0700 mm: rmap: fix CONT-PTE/PMD size hugetlb issue when unmapping On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb: 2M and 1G, but also CONT-PTE/PMD size: 64K and 32M if a 4K page size specified. When unmapping a hugetlb page, we will get the relevant page table entry by huge_pte_offset() only once to nuke it. This is correct for PMD or PUD size hugetlb, since they always contain only one pmd entry or pud entry in the page table. However this is incorrect for CONT-PTE and CONT-PMD size hugetlb, since they can contain several continuous pte or pmd entry with same page table attributes, so we will nuke only one pte or pmd entry for this CONT-PTE/PMD size hugetlb page. And now try_to_unmap() is only passed a hugetlb page in the case where the hugetlb page is poisoned. Which means now we will unmap only one pte entry for a CONT-PTE or CONT-PMD size poisoned hugetlb page, and we can still access other subpages of a CONT-PTE or CONT-PMD size poisoned hugetlb page, which will cause serious issues possibly. So we should change to use huge_ptep_clear_flush() to nuke the hugetlb page table to fix this issue, which already considered CONT-PTE and CONT-PMD size hugetlb. We've already used set_huge_swap_pte_at() to set a poisoned swap entry for a poisoned hugetlb page. Meanwhile adding a VM_BUG_ON() to make sure the passed hugetlb page is poisoned in try_to_unmap(). Link: https://lkml.kernel.org/r/0a2e547238cad5bc153a85c3e9658cb9d55f9cac.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/730ea4b6d292f32fb10b7a4e87dad49b0eb30474.1652147571.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Acked-by: David Hildenbrand Cc: Alexander Gordeev Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Christian Borntraeger Cc: David S. Miller Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Helge Deller Cc: James Bottomley Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Sven Schnelle Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Cc: Will Deacon Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit 5d4af6195c87c6b162b7963e0ad00a214b80d764 Author: Baolin Wang Date: Fri May 13 16:48:55 2022 -0700 mm: rmap: fix CONT-PTE/PMD size hugetlb issue when migration On some architectures (like ARM64), it can support CONT-PTE/PMD size hugetlb, which means it can support not only PMD/PUD size hugetlb: 2M and 1G, but also CONT-PTE/PMD size: 64K and 32M if a 4K page size specified. When migrating a hugetlb page, we will get the relevant page table entry by huge_pte_offset() only once to nuke it and remap it with a migration pte entry. This is correct for PMD or PUD size hugetlb, since they always contain only one pmd entry or pud entry in the page table. However this is incorrect for CONT-PTE and CONT-PMD size hugetlb, since they can contain several continuous pte or pmd entry with same page table attributes. So we will nuke or remap only one pte or pmd entry for this CONT-PTE/PMD size hugetlb page, which is not expected for hugetlb migration. The problem is we can still continue to modify the subpages' data of a hugetlb page during migrating a hugetlb page, which can cause a serious data consistent issue, since we did not nuke the page table entry and set a migration pte for the subpages of a hugetlb page. To fix this issue, we should change to use huge_ptep_clear_flush() to nuke a hugetlb page table, and remap it with set_huge_pte_at() and set_huge_swap_pte_at() when migrating a hugetlb page, which already considered the CONT-PTE or CONT-PMD size hugetlb. [akpm@linux-foundation.org: fix nommu build] [baolin.wang@linux.alibaba.com: fix build errors for !CONFIG_MMU] Link: https://lkml.kernel.org/r/a4baca670aca637e7198d9ae4543b8873cb224dc.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/ea5abf529f0997b5430961012bfda6166c1efc8c.1652147571.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Acked-by: David Hildenbrand Cc: Alexander Gordeev Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Catalin Marinas Cc: Christian Borntraeger Cc: David S. Miller Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Helge Deller Cc: James Bottomley Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: Sven Schnelle Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Cc: Will Deacon Cc: Yoshinori Sato Signed-off-by: Andrew Morton commit ae07562909f3dfcdff40f87e51965728dab50485 Author: Baolin Wang Date: Fri May 13 16:48:55 2022 -0700 mm: change huge_ptep_clear_flush() to return the original pte Patch series "Fix CONT-PTE/PMD size hugetlb issue when unmapping or migrating", v4. presently, migrating a hugetlb page or unmapping a poisoned hugetlb page, we'll use ptep_clear_flush() and set_pte_at() to nuke the page table entry and remap it, and this is incorrect for CONT-PTE or CONT-PMD size hugetlb page, which will cause potential data consistent issue. This patch set will change to use hugetlb related APIs to fix this issue. Note: Mike pointed out the huge_ptep_get() will only return the one specific value, and it would not take into account the dirty or young bits of CONT-PTE/PMDs like the huge_ptep_get_and_clear() [1]. This inconsistent issue is not introduced by this patch set, and this issue will be addressed in another thread [2]. Meanwhile the uffd for hugetlb case [3] pointed out by Gerald also needs another patch to address. [1] https://lore.kernel.org/linux-mm/85bd80b4-b4fd-0d3f-a2e5-149559f2f387@oracle.com/ [2] https://lore.kernel.org/all/cover.1651998586.git.baolin.wang@linux.alibaba.com/ [3] https://lore.kernel.org/linux-mm/20220503120343.6264e126@thinkpad/ This patch (of 3): It is incorrect to use ptep_clear_flush() to nuke a hugetlb page table when unmapping or migrating a hugetlb page, and will change to use huge_ptep_clear_flush() instead in the following patches. So this is a preparation patch, which changes the huge_ptep_clear_flush() to return the original pte to help to nuke a hugetlb page table. [baolin.wang@linux.alibaba.com: fix build in several more architectures] Link: https://lkml.kernel.org/r/0009a4cd-2826-e8be-e671-f050d4f18d5d@linux.alibaba.com [sfr@canb.auug.org.au: fixup] Link: https://lkml.kernel.org/r/20220511181531.7f27a5c1@canb.auug.org.au Link: https://lkml.kernel.org/r/cover.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/20f77ddab90baa249bd24504c413189b82acde69.1652270205.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/cover.1652147571.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/dcf065868cce35bceaf138613ad27f17bb7c0c19.1652147571.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Signed-off-by: Stephen Rothwell Acked-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Bogendoerfer Cc: James Bottomley Cc: Helge Deller Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: Yoshinori Sato Cc: Rich Felker Cc: David S. Miller Cc: Arnd Bergmann Cc: Gerald Schaefer Signed-off-by: Andrew Morton commit 110bf7a523075e42703fbe9c136ad00b867bec3a Author: Fabio M. De Francesco Date: Fri May 13 16:48:55 2022 -0700 Documentation/vm: rework "Temporary Virtual Mappings" section Extend and rework the "Temporary Virtual Mappings" section of the highmem.rst documentation. Despite the local kmaps were introduced by Thomas Gleixner in October 2020, documentation was still missing information about them. These additions rely largely on Gleixner's patches, Jonathan Corbet's LWN articles, comments by Ira Weiny and Matthew Wilcox, and in-code comments from ./include/linux/highmem.h. 1) Add a paragraph to document kmap_local_page(). 2) Reorder the list of functions by decreasing order of preference of use. 3) Rework part of the kmap() entry in list. Link: https://lkml.kernel.org/r/20220428212455.892-5-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Sebastian Andrzej Siewior Reviewed-by: Ira Weiny Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Catalin Marinas Cc: Mike Rapoport Cc: Peter Collingbourne Cc: Vlastimil Babka Cc: Will Deacon Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 85a85e7601263f2b4edc86136dd0172c2cfbfaa1 Author: Fabio M. De Francesco Date: Fri May 13 16:48:55 2022 -0700 Documentation/vm: move "Using kmap-atomic" to highmem.h The use of kmap_atomic() is new code is being deprecated in favor of kmap_local_page(). For this reason the "Using kmap_atomic" section in highmem.rst is obsolete and unnecessary, but it can still help developers if it were moved to kdocs in highmem.h. Therefore, move the relevant parts of this section from highmem.rst and merge them with the kdocs in highmem.h. Link: https://lkml.kernel.org/r/20220428212455.892-4-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Suggested-by: Ira Weiny Reviewed-by: Sebastian Andrzej Siewior Reviewed-by: Ira Weiny Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Catalin Marinas Cc: Mike Rapoport Cc: Peter Collingbourne Cc: Vlastimil Babka Cc: Will Deacon Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 174270c2d664ca8ff60d2d95211b4790cedf881c Author: Fabio M. De Francesco Date: Fri May 13 16:48:55 2022 -0700 Documentation/vm: include kdocs from highmem*.h into highmem.rst kernel-docs that are in include/linux/highmem.h and in include/linux/highmem-internal.h should be included in highmem.rst. Use kdocs directives to include the above-mentioned comments into highmem.rst. Link: https://lkml.kernel.org/r/20220428212455.892-3-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Acked-by: Mike Rapoport Reviewed-by: Ira Weiny Suggested-by: Ira Weiny Reviewed-by: Sebastian Andrzej Siewior Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Catalin Marinas Cc: Peter Collingbourne Cc: Vlastimil Babka Cc: Will Deacon Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit e7392b4eca84e86718a7b73aea8fa5573b06ba76 Author: Fabio M. De Francesco Date: Fri May 13 16:48:55 2022 -0700 mm/highmem: fix kernel-doc warnings in highmem*.h Patch series "Extend and reorganize Highmem's documentation", v4. This series has the purpose to extend and reorganize Highmem's documentation. This is a work in progress because some information should still be moved from highmem.rst to highmem.h and highmem-internal.h. Specifically I'm talking about moving the "how to" information to the relevant headers, as it as been suggested by Ira Weiny (Intel). Also, this is a work in progress because some kdocs in highmem.h and highmem-internal.h should be improved. This patch (of 4): `scripts/kernel-doc -v -none include/linux/highmem*` reports the following warnings: include/linux/highmem.h:160: warning: expecting prototype for kunmap_atomic(). Prototype was for nr_free_highpages() instead include/linux/highmem.h:204: warning: No description found for return value of 'alloc_zeroed_user_highpage_movable' include/linux/highmem-internal.h:256: warning: Function parameter or member '__addr' not described in 'kunmap_atomic' include/linux/highmem-internal.h:256: warning: Excess function parameter 'addr' description in 'kunmap_atomic' Fix these warnings by (1) moving the kernel-doc comments from highmem.h to highmem-internal.h (which is the file were the kunmap_atomic() macro is actually defined), (2) extending and merging it with the comment which was already in highmem-internal.h, and (3) using correct parameter names (4) correcting a few technical inaccuracies in comments, and (5) adding a deprecation notice in kunmap_atomic() for consistency with kmap_atomic(). Link: https://lkml.kernel.org/r/20220428212455.892-1-fmdefrancesco@gmail.com Link: https://lkml.kernel.org/r/20220428212455.892-2-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Reviewed-by: Sebastian Andrzej Siewior Reviewed-by: Ira Weiny Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Catalin Marinas Cc: Will Deacon Cc: Peter Collingbourne Cc: Vlastimil Babka Cc: Jonathan Corbet Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 8b3dd882bfd2cf00da986bb0cf5c607e23c0f110 Author: Andy Shevchenko Date: Sat May 7 13:22:57 2022 +0300 pinctrl: stm32: Unshadow np variable in stm32_pctl_probe() The np variable is used globally for stm32_pctl_probe() and in one of its code branches. cppcheck is not happy with that: pinctrl-stm32.c:1530:23: warning: Local variable 'np' shadows outer variable [shadowVariable] Instead of simply renaming one of the variables convert some code to use a device pointer directly. Fixes: bb949ed9b16b ("pinctrl: stm32: Switch to use for_each_gpiochip_node() helper") Reported-by: kernel test robot Signed-off-by: Andy Shevchenko Reviewed-by: Fabien Dessenne Link: https://lore.kernel.org/r/20220507102257.26414-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 418fbe82578e2889dcc2c0ae4d367ea4e28dd05c Author: Larysa Zaremba Date: Fri May 13 14:17:43 2022 +0200 bpftool: Use sysfs vmlinux when dumping BTF by ID Currently, dumping almost all BTFs specified by id requires using the -B option to pass the base BTF. For kernel module BTFs the vmlinux BTF sysfs path should work. This patch simplifies dumping by ID usage by loading vmlinux BTF from sysfs as base, if base BTF was not specified and the ID corresponds to a kernel module BTF. Signed-off-by: Larysa Zaremba Signed-off-by: Andrii Nakryiko Reviewed-by: Alexander Lobakin Link: https://lore.kernel.org/bpf/20220513121743.12411-1-larysa.zaremba@intel.com commit 7755d26c0425cd68439686a9cdb65afe9476970c Merge: 85437018eb864 fc883ed5a43e5 Author: Linus Walleij Date: Sat May 14 01:01:56 2022 +0200 Merge tag 'renesas-pinctrl-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.19 (take two) - Reserved field optimizations, - Miscellaneous fixes and improvements. commit 16d1e00c7e8a4950e914223b3112144289a82913 Author: Joanne Koong Date: Mon May 9 15:42:52 2022 -0700 bpf: Add MEM_UNINIT as a bpf_type_flag Instead of having uninitialized versions of arguments as separate bpf_arg_types (eg ARG_PTR_TO_UNINIT_MEM as the uninitialized version of ARG_PTR_TO_MEM), we can instead use MEM_UNINIT as a bpf_type_flag modifier to denote that the argument is uninitialized. Doing so cleans up some of the logic in the verifier. We no longer need to do two checks against an argument type (eg "if (base_type(arg_type) == ARG_PTR_TO_MEM || base_type(arg_type) == ARG_PTR_TO_UNINIT_MEM)"), since uninitialized and initialized versions of the same argument type will now share the same base type. In the near future, MEM_UNINIT will be used by dynptr helper functions as well. Signed-off-by: Joanne Koong Acked-by: Andrii Nakryiko Acked-by: David Vernet Link: https://lore.kernel.org/r/20220509224257.3222614-2-joannelkoong@gmail.com Signed-off-by: Alexei Starovoitov commit 2505a981114dcb715f8977b8433f7540854851d8 Author: Sultan Alsawaf Date: Fri May 13 15:11:26 2022 -0700 zsmalloc: fix races between asynchronous zspage free and page migration The asynchronous zspage free worker tries to lock a zspage's entire page list without defending against page migration. Since pages which haven't yet been locked can concurrently migrate off the zspage page list while lock_zspage() churns away, lock_zspage() can suffer from a few different lethal races. It can lock a page which no longer belongs to the zspage and unsafely dereference page_private(), it can unsafely dereference a torn pointer to the next page (since there's a data race), and it can observe a spurious NULL pointer to the next page and thus not lock all of the zspage's pages (since a single page migration will reconstruct the entire page list, and create_page_chain() unconditionally zeroes out each list pointer in the process). Fix the races by using migrate_read_lock() in lock_zspage() to synchronize with page migration. Link: https://lkml.kernel.org/r/20220509024703.243847-1-sultan@kerneltoast.com Fixes: 77ff465799c602 ("zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse") Signed-off-by: Sultan Alsawaf Acked-by: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Cc: Signed-off-by: Andrew Morton commit 60a60e32cf91169840abcb4a80f0b0df31708ba7 Author: Dong Aisheng Date: Fri May 13 15:11:26 2022 -0700 Revert "mm/cma.c: remove redundant cma_mutex lock" This reverts commit a4efc174b382fcdb which introduced a regression issue that when there're multiple processes allocating dma memory in parallel by calling dma_alloc_coherent(), it may fail sometimes as follows: Error log: cma: cma_alloc: linux,cma: alloc failed, req-size: 148 pages, ret: -16 cma: number of available pages: 3@125+20@172+12@236+4@380+32@736+17@2287+23@2473+20@36076+99@40477+108@40852+44@41108+20@41196+108@41364+108@41620+ 108@42900+108@43156+483@44061+1763@45341+1440@47712+20@49324+20@49388+5076@49452+2304@55040+35@58141+20@58220+20@58284+ 7188@58348+84@66220+7276@66452+227@74525+6371@75549=> 33161 free of 81920 total pages When issue happened, we saw there were still 33161 pages (129M) free CMA memory and a lot available free slots for 148 pages in CMA bitmap that we want to allocate. When dumping memory info, we found that there was also ~342M normal memory, but only 1352K CMA memory left in buddy system while a lot of pageblocks were isolated. Memory info log: Normal free:351096kB min:30000kB low:37500kB high:45000kB reserved_highatomic:0KB active_anon:98060kB inactive_anon:98948kB active_file:60864kB inactive_file:31776kB unevictable:0kB writepending:0kB present:1048576kB managed:1018328kB mlocked:0kB bounce:0kB free_pcp:220kB local_pcp:192kB free_cma:1352kB lowmem_reserve[]: 0 0 0 Normal: 78*4kB (UECI) 1772*8kB (UMECI) 1335*16kB (UMECI) 360*32kB (UMECI) 65*64kB (UMCI) 36*128kB (UMECI) 16*256kB (UMCI) 6*512kB (EI) 8*1024kB (UEI) 4*2048kB (MI) 8*4096kB (EI) 8*8192kB (UI) 3*16384kB (EI) 8*32768kB (M) = 489288kB The root cause of this issue is that since commit a4efc174b382 ("mm/cma.c: remove redundant cma_mutex lock"), CMA supports concurrent memory allocation. It's possible that the memory range process A trying to alloc has already been isolated by the allocation of process B during memory migration. The problem here is that the memory range isolated during one allocation by start_isolate_page_range() could be much bigger than the real size we want to alloc due to the range is aligned to MAX_ORDER_NR_PAGES. Taking an ARMv7 platform with 1G memory as an example, when MAX_ORDER_NR_PAGES is big (e.g. 32M with max_order 14) and CMA memory is relatively small (e.g. 128M), there're only 4 MAX_ORDER slot, then it's very easy that all CMA memory may have already been isolated by other processes when one trying to allocate memory using dma_alloc_coherent(). Since current CMA code will only scan one time of whole available CMA memory, then dma_alloc_coherent() may easy fail due to contention with other processes. This patch simply falls back to the original method that using cma_mutex to make alloc_contig_range() run sequentially to avoid the issue. Link: https://lkml.kernel.org/r/20220509094551.3596244-1-aisheng.dong@nxp.com Link: https://lore.kernel.org/all/20220315144521.3810298-2-aisheng.dong@nxp.com/ Fixes: a4efc174b382 ("mm/cma.c: remove redundant cma_mutex lock") Signed-off-by: Dong Aisheng Acked-by: Minchan Kim Acked-by: David Hildenbrand Cc: Marek Szyprowski Cc: Lecopzer Chen Cc: Vlastimil Babka Cc: [5.11+] Signed-off-by: Andrew Morton commit 5c3b747ef54fa2a7318776777f6044540d99f721 Author: Jason A. Donenfeld Date: Sat Apr 30 15:08:20 2022 +0200 random: use first 128 bits of input as fast init Before, the first 64 bytes of input, regardless of how entropic it was, would be used to mutate the crng base key directly, and none of those bytes would be credited as having entropy. Then 256 bits of credited input would be accumulated, and only then would the rng transition from the earlier "fast init" phase into being actually initialized. The thinking was that by mixing and matching fast init and real init, an attacker who compromised the fast init state, considered easy to do given how little entropy might be in those first 64 bytes, would then be able to bruteforce bits from the actual initialization. By keeping these separate, bruteforcing became impossible. However, by not crediting potentially creditable bits from those first 64 bytes of input, we delay initialization, and actually make the problem worse, because it means the user is drawing worse random numbers for a longer period of time. Instead, we can take the first 128 bits as fast init, and allow them to be credited, and then hold off on the next 128 bits until they've accumulated. This is still a wide enough margin to prevent bruteforcing the rng state, while still initializing much faster. Then, rather than trying to piecemeal inject into the base crng key at various points, instead just extract from the pool when we need it, for the crng_init==0 phase. Performance may even be better for the various inputs here, since there are likely more calls to mix_pool_bytes() then there are to get_random_bytes() during this phase of system execution. Since the preinit injection code is gone, bootloader randomness can then do something significantly more straight forward, removing the weird system_wq hack in hwgenerator randomness. Cc: Theodore Ts'o Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit cbe89e5a375a51bbb952929b93fa973416fea74e Author: Jason A. Donenfeld Date: Tue May 3 14:14:32 2022 +0200 random: do not use batches when !crng_ready() It's too hard to keep the batches synchronized, and pointless anyway, since in !crng_ready(), we're updating the base_crng key really often, where batching only hurts. So instead, if the crng isn't ready, just call into get_random_bytes(). At this stage nothing is performance critical anyhow. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit b7b67d1391a831eb9de133e85a2230e2e81a2ce4 Author: Jason A. Donenfeld Date: Sun May 1 13:51:34 2022 +0200 random: mix in timestamps and reseed on system restore Since the RNG loses freshness with system suspend/hibernation, when we resume, immediately reseed using whatever data we can, which for this particular case is the various timestamps regarding system suspend time, in addition to more generally the RDSEED/RDRAND/RDTSC values that happen whenever the crng reseeds. On systems that suspend and resume automatically all the time -- such as Android -- we skip the reseeding on suspend resumption, since that could wind up being far too busy. This is the same trade-off made in WireGuard. In addition to reseeding upon resumption always mix into the pool these various stamps on every power notification event. Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld commit 78c768e619fbd5157b3544915aad5158af0c5809 Author: Jason A. Donenfeld Date: Fri Apr 22 14:47:42 2022 +0200 random: vary jitter iterations based on cycle counter speed Currently, we do the jitter dance if two consecutive reads to the cycle counter return different values. If they do, then we consider the cycle counter to be fast enough that one trip through the scheduler will yield one "bit" of credited entropy. If those two reads return the same value, then we assume the cycle counter is too slow to show meaningful differences. This methodology is flawed for a variety of reasons, one of which Eric posted a patch to fix in [1]. The issue that patch solves is that on a system with a slow counter, you might be [un]lucky and read the counter _just_ before it changes, so that the second cycle counter you read differs from the first, even though there's usually quite a large period of time in between the two. For example: | real time | cycle counter | | --------- | ------------- | | 3 | 5 | | 4 | 5 | | 5 | 5 | | 6 | 5 | | 7 | 5 | <--- a | 8 | 6 | <--- b | 9 | 6 | <--- c If we read the counter at (a) and compare it to (b), we might be fooled into thinking that it's a fast counter, when in reality it is not. The solution in [1] is to also compare counter (b) to counter (c), on the theory that if the counter is _actually_ slow, and (a)!=(b), then certainly (b)==(c). This helps solve this particular issue, in one sense, but in another sense, it mostly functions to disallow jitter entropy on these systems, rather than simply taking more samples in that case. Instead, this patch takes a different approach. Right now we assume that a difference in one set of consecutive samples means one "bit" of credited entropy per scheduler trip. We can extend this so that a difference in two sets of consecutive samples means one "bit" of credited entropy per /two/ scheduler trips, and three for three, and four for four. In other words, we can increase the amount of jitter "work" we require for each "bit", depending on how slow the cycle counter is. So this patch takes whole bunch of samples, sees how many of them are different, and divides to find the amount of work required per "bit", and also requires that at least some minimum of them are different in order to attempt any jitter entropy. Note that this approach is still far from perfect. It's not a real statistical estimate on how much these samples vary; it's not a real-time analysis of the relevant input data. That remains a project for another time. However, it makes the same (partly flawed) assumptions as the code that's there now, so it's probably not worse than the status quo, and it handles the issue Eric mentioned in [1]. But, again, it's probably a far cry from whatever a really robust version of this would be. [1] https://lore.kernel.org/lkml/20220421233152.58522-1-ebiggers@kernel.org/ https://lore.kernel.org/lkml/20220421192939.250680-1-ebiggers@kernel.org/ Cc: Eric Biggers Cc: Theodore Ts'o Cc: Linus Torvalds Signed-off-by: Jason A. Donenfeld commit 4b758eda851eb9336ca86a0041a4d3da55f66511 Author: Jason A. Donenfeld Date: Tue Apr 12 19:59:57 2022 +0200 random: insist on random_get_entropy() existing in order to simplify All platforms are now guaranteed to provide some value for random_get_entropy(). In case some bug leads to this not being so, we print a warning, because that indicates that something is really very wrong (and likely other things are impacted too). This should never be hit, but it's a good and cheap way of finding out if something ever is problematic. Since we now have viable fallback code for random_get_entropy() on all platforms, which is, in the worst case, not worse than jiffies, we can count on getting the best possible value out of it. That means there's no longer a use for using jiffies as entropy input. It also means we no longer have a reason for doing the round-robin register flow in the IRQ handler, which was always of fairly dubious value. Instead we can greatly simplify the IRQ handler inputs and also unify the construction between 64-bits and 32-bits. We now collect the cycle counter and the return address, since those are the two things that matter. Because the return address and the irq number are likely related, to the extent we mix in the irq number, we can just xor it into the top unchanging bytes of the return address, rather than the bottom changing bytes of the cycle counter as before. Then, we can do a fixed 2 rounds of SipHash/HSipHash. Finally, we use the same construction of hashing only half of the [H]SipHash state on 32-bit and 64-bit. We're not actually discarding any entropy, since that entropy is carried through until the next time. And more importantly, it lets us do the same sponge-like construction everywhere. Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld commit e10e2f58030c5c211d49042a8c2a1b93d40b2ffb Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 xtensa: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. This is accomplished by just including the asm-generic code like on other architectures, which means we can get rid of the empty stub function here. Cc: Thomas Gleixner Cc: Arnd Bergmann Acked-by: Max Filippov Signed-off-by: Jason A. Donenfeld commit ac9756c79797bb98972736b13cfb239fd2cffb79 Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 sparc: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. This is accomplished by just including the asm-generic code like on other architectures, which means we can get rid of the empty stub function here. Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: David S. Miller Signed-off-by: Jason A. Donenfeld commit 9f13fb0cd11ed2327abff69f6501a2c124c88b5a Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 um: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. This is accomplished by just including the asm-generic code like on other architectures, which means we can get rid of the empty stub function here. Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Richard Weinberger Cc: Anton Ivanov Acked-by: Johannes Berg Signed-off-by: Jason A. Donenfeld commit 3bd4abc07a267e6a8b33d7f8717136e18f921c53 Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 x86/tsc: Use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is suboptimal. Instead, fallback to calling random_get_entropy_fallback(), which isn't extremely high precision or guaranteed to be entropic, but is certainly better than returning zero all the time. If CONFIG_X86_TSC=n, then it's possible for the kernel to run on systems without RDTSC, such as 486 and certain 586, so the fallback code is only required for that case. As well, fix up both the new function and the get_cycles() function from which it was derived to use cpu_feature_enabled() rather than boot_cpu_has(), and use !IS_ENABLED() instead of #ifndef. Signed-off-by: Jason A. Donenfeld Reviewed-by: Thomas Gleixner Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Borislav Petkov Cc: x86@kernel.org commit c04e72700f2293013dab40208e809369378f224c Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 nios2: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. Cc: Thomas Gleixner Cc: Arnd Bergmann Acked-by: Dinh Nguyen Signed-off-by: Jason A. Donenfeld commit ff8a8f59c99f6a7c656387addc4d9f2247d75077 Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 arm: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. Cc: Thomas Gleixner Cc: Arnd Bergmann Reviewed-by: Russell King (Oracle) Signed-off-by: Jason A. Donenfeld commit 1c99c6a7c3c599a68321b01b9ec243215ede5a68 Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 mips: use fallback for random_get_entropy() instead of just c0 random For situations in which we don't have a c0 counter register available, we've been falling back to reading the c0 "random" register, which is usually bounded by the amount of TLB entries and changes every other cycle or so. This means it wraps extremely often. We can do better by combining this fast-changing counter with a potentially slower-changing counter from random_get_entropy_fallback() in the more significant bits. This commit combines the two, taking into account that the changing bits are in a different bit position depending on the CPU model. In addition, we previously were falling back to 0 for ancient CPUs that Linux does not support anyway; remove that dead path entirely. Cc: Thomas Gleixner Cc: Arnd Bergmann Tested-by: Maciej W. Rozycki Acked-by: Thomas Bogendoerfer Signed-off-by: Jason A. Donenfeld commit 6d01238623faa9425f820353d2066baf6c9dc872 Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 riscv: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Paul Walmsley Acked-by: Palmer Dabbelt Reviewed-by: Palmer Dabbelt Signed-off-by: Jason A. Donenfeld commit 0f392c95391f2d708b12971a07edaa7973f9eece Author: Jason A. Donenfeld Date: Fri Apr 8 18:03:13 2022 +0200 m68k: use fallback for random_get_entropy() instead of zero In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. Cc: Thomas Gleixner Cc: Arnd Bergmann Acked-by: Geert Uytterhoeven Signed-off-by: Jason A. Donenfeld commit 1366992e16bddd5e2d9a561687f367f9f802e2e4 Author: Jason A. Donenfeld Date: Sun Apr 10 16:49:50 2022 +0200 timekeeping: Add raw clock fallback for random_get_entropy() The addition of random_get_entropy_fallback() provides access to whichever time source has the highest frequency, which is useful for gathering entropy on platforms without available cycle counters. It's not necessarily as good as being able to quickly access a cycle counter that the CPU has, but it's still something, even when it falls back to being jiffies-based. In the event that a given arch does not define get_cycles(), falling back to the get_cycles() default implementation that returns 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies eventually. It's not as though random_get_entropy_fallback() is super high precision or guaranteed to be entropic, but basically anything that's not zero all the time is better than returning zero all the time. Finally, since random_get_entropy_fallback() is used during extremely early boot when randomizing freelists in mm_init(), it can be called before timekeeping has been initialized. In that case there really is nothing we can do; jiffies hasn't even started ticking yet. So just give up and return 0. Suggested-by: Thomas Gleixner Signed-off-by: Jason A. Donenfeld Reviewed-by: Thomas Gleixner Cc: Arnd Bergmann Cc: Theodore Ts'o commit 516dd4aacd67a0f27da94f3fe63fe0f4dbab6e2b Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 openrisc: start CPU timer early in boot In order to measure the boot process, the timer should be switched on as early in boot as possible. As well, the commit defines the get_cycles macro, like the previous patches in this series, so that generic code is aware that it's implemented by the platform, as is done on other archs. Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Jonas Bonn Cc: Stefan Kristiansson Acked-by: Stafford Horne Reported-by: Guenter Roeck Signed-off-by: Jason A. Donenfeld commit 408835832158df0357e18e96da7f2d1ed6b80e7f Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 powerpc: define get_cycles macro for arch-override PowerPC defines a get_cycles() function, but it does not do the usual `#define get_cycles get_cycles` dance, making it impossible for generic code to see if an arch-specific function was defined. While the get_cycles() ifdef is not currently used, the following timekeeping patch in this series will depend on the macro existing (or not existing) when defining random_get_entropy(). Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Acked-by: Michael Ellerman Signed-off-by: Jason A. Donenfeld commit 1097710bc9660e1e588cf2186a35db3d95c4d258 Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 alpha: define get_cycles macro for arch-override Alpha defines a get_cycles() function, but it does not do the usual `#define get_cycles get_cycles` dance, making it impossible for generic code to see if an arch-specific function was defined. While the get_cycles() ifdef is not currently used, the following timekeeping patch in this series will depend on the macro existing (or not existing) when defining random_get_entropy(). Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Richard Henderson Cc: Ivan Kokshaysky Acked-by: Matt Turner Signed-off-by: Jason A. Donenfeld commit 8865bbe6ba1120e67f72201b7003a16202cd42be Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 parisc: define get_cycles macro for arch-override PA-RISC defines a get_cycles() function, but it does not do the usual `#define get_cycles get_cycles` dance, making it impossible for generic code to see if an arch-specific function was defined. While the get_cycles() ifdef is not currently used, the following timekeeping patch in this series will depend on the macro existing (or not existing) when defining random_get_entropy(). Cc: Thomas Gleixner Cc: Arnd Bergmann Acked-by: Helge Deller Signed-off-by: Jason A. Donenfeld commit 2e3df523256cb9836de8441e9c791a796759bb3c Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 s390: define get_cycles macro for arch-override S390x defines a get_cycles() function, but it does not do the usual `#define get_cycles get_cycles` dance, making it impossible for generic code to see if an arch-specific function was defined. While the get_cycles() ifdef is not currently used, the following timekeeping patch in this series will depend on the macro existing (or not existing) when defining random_get_entropy(). Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Acked-by: Heiko Carstens Signed-off-by: Jason A. Donenfeld commit 57c0900b91d8891ab43f0e6b464d059fda51d102 Author: Jason A. Donenfeld Date: Sat Apr 23 21:11:41 2022 +0200 ia64: define get_cycles macro for arch-override Itanium defines a get_cycles() function, but it does not do the usual `#define get_cycles get_cycles` dance, making it impossible for generic code to see if an arch-specific function was defined. While the get_cycles() ifdef is not currently used, the following timekeeping patch in this series will depend on the macro existing (or not existing) when defining random_get_entropy(). Cc: Thomas Gleixner Cc: Arnd Bergmann Signed-off-by: Jason A. Donenfeld commit fe222a6ca2d53c38433cba5d3be62a39099e708e Author: Jason A. Donenfeld Date: Thu May 5 02:20:22 2022 +0200 init: call time_init() before rand_initialize() Currently time_init() is called after rand_initialize(), but rand_initialize() makes use of the timer on various platforms, and sometimes this timer needs to be initialized by time_init() first. In order for random_get_entropy() to not return zero during early boot when it's potentially used as an entropy source, reverse the order of these two calls. The block doing random initialization was right before time_init() before, so changing the order shouldn't have any complicated effects. Cc: Andrew Morton Reviewed-by: Stafford Horne Signed-off-by: Jason A. Donenfeld commit 069c4ea6871c18bd368f27756e0f91ffb524a788 Author: Jason A. Donenfeld Date: Tue May 3 21:43:58 2022 +0200 random: fix sysctl documentation nits A semicolon was missing, and the almost-alphabetical-but-not ordering was confusing, so regroup these by category instead. Signed-off-by: Jason A. Donenfeld commit 82706d6fb19d0b845146f7108fce3926502c5f52 Merge: 204637ece42c2 c75104762ddac Author: Arnd Bergmann Date: Fri May 13 23:17:23 2022 +0200 Merge tag 'v5.18-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt MT8195: - add evaluation and demo board MT8192: - add new nodes: pwrap, PMIC, scp, USB, efuse, IOMMU, smi, DPI, PCIe, SPMI, audio system, MMC and video enconder - add evaluation board MT8183: - fix dtschema issues - update compatible for the display ambient light processor (disp-aal) - fix dtschema warning for the pumpki board MT8173: - add power domains to the video enconder nodes - add GCE support to the display mutex node MT7622: - specify number of DMA requests explicitely - specify level 2 cache topology - add SPI-NAND flash device - fix dtschema warnings for the System Companion Processor (SCP) * tag 'v5.18-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: (37 commits) arm64: dts: mt8192: Follow binding order for SCP registers arm64: dts: mediatek: add mtk-snfi for mt7622 arm64: dts: mediatek: mt8195-demo: enable uart1 arm64: dts: mediatek: mt8195-demo: Remove input-name property arm64: dts: mediatek: mt8183-pumpkin: fix bad thermistor node name arm64: dts: mt7622: specify the L2 cache topology arm64: dts: mt7622: specify the number of DMA requests arm64: dts: mediatek: pumpkin: Remove input-name property arm64: dts: mediatek: mt8173: Add gce-client-reg handle to disp-mutex arm64: dts: mediatek: Add device-tree for MT8195 Demo board dt-bindings: arm64: dts: mediatek: Add mt8195-demo board arm64: dts: Add mediatek SoC mt8195 and evaluation board arm64: dts: mt8192: Add mmc device nodes arm64: dts: mt8183: Update disp_aal node compatible arm64: dts: mt8192: Add audio-related nodes arm64: dts: mt8192: Add spmi node dt-bindings: arm: Add compatible for Mediatek MT8192 arm64: dts: mt6359: add PMIC MT6359 related nodes arm64: dts: mediatek: mt8173: Add power domain to encoder nodes arm64: dts: mediatek: Get rid of mediatek, larb for MM nodes ... Link: https://lore.kernel.org/r/2cd90ca7-7541-d47a-fec6-b0c64cf74fa3@gmail.com Like the 32-bit branch, this contains an incompatible binding change by removing the mediatek,larb properties from the dts files, so these no longer work with kernels prior to 5.18. Signed-off-by: Arnd Bergmann commit 4808cb5b98b436f1110d83c65541dd43beb45f63 Author: Zhang Yi Date: Tue Apr 12 22:53:20 2022 +0800 ext4: add unmount filesystem message Now that we have kernel message at mount time, system administrator could acquire the mount time, device and options easily. But we don't have corresponding unmounting message at umount time, so we cannot know if someone umount a filesystem easily. Some of the modern filesystems (e.g. xfs) have the umounting kernel message, so add one for ext4 filesystem for convenience. EXT4-fs (sdb): mounted filesystem with ordered data mode. Quota mode: none. EXT4-fs (sdb): unmounting filesystem. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220412145320.2669897-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 204637ece42c2f3a51251665aaebaccf7a43d932 Merge: 8f311c09df4ea a044e6a0883bc Author: Arnd Bergmann Date: Fri May 13 22:40:35 2022 +0200 Merge tag 'v5.18-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt Delete no longer needed properties of MediaTek Larbs for MT2701. * tag 'v5.18-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mediatek: Get rid of mediatek, larb for MM nodes Link: https://lore.kernel.org/r/b4383f23-0adc-b9de-a1d9-abd1c2f82b27@gmail.com This concludes a cleanup that was started back in 2019, with an incompatible DT binding change. Kernels before 5.18 can no longer use the updated dtb from 5.19, and the drivers no longer parse the old properties, which breaks compatibility with older dtb files. Link: https://lore.kernel.org/lkml/1546318276-18993-2-git-send-email-yong.wu@mediatek.com/ Signed-off-by: Arnd Bergmann commit 1b1d7b4bf1d9948c8dba5ee550459ce7c65ac019 Author: Dylan Yudaken Date: Thu May 12 02:18:34 2022 -0700 io_uring: only wake when the correct events are set The check for waking up a request compares the poll_t bits, however this will always contain some common flags so this always wakes up. For files with single wait queues such as sockets this can cause the request to be sent to the async worker unnecesarily. Further if it is non-blocking will complete the request with EAGAIN which is not desired. Here exclude these common events, making sure to not exclude POLLERR which might be important. Fixes: d7718a9d25a6 ("io_uring: use poll driven retry for files that support it") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220512091834.728610-3-dylany@fb.com Signed-off-by: Jens Axboe commit 784a09951c1d8383498c0df091a37db612bebfc7 Author: Lv Ruyi Date: Mon Apr 11 03:23:37 2022 +0000 ext4: remove unnecessary conditionals iput() has already handled null and non-null parameter, so it is no need to use if(). Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220411032337.2517465-1-lv.ruyi@zte.com.cn Signed-off-by: Theodore Ts'o commit 0d2d2648931bdb1a629bf0df4e339e6a326a6136 Author: Andrii Nakryiko Date: Fri May 13 10:37:03 2022 -0700 selftests/bpf: Fix usdt_400 test case usdt_400 test case relies on compiler using the same arg spec for usdt_400 USDT. This assumption breaks with Clang (Clang generates different arg specs with varying offsets relative to %rbp), so simplify this further and hard-code the constant which will guarantee that arg spec is the same across all 400 inlinings. Fixes: 630301b0d59d ("selftests/bpf: Add basic USDT selftests") Reported-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220513173703.89271-1-andrii@kernel.org commit 8f311c09df4ea0c990d2afb851f7d84340546713 Merge: 7213d3a5a1e92 46a9556d977e2 Author: Arnd Bergmann Date: Fri May 13 21:52:09 2022 +0200 Merge tag 'at91-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 & LAN966 DT #1 for 5.19: - at91: DT compliance updates to gic and dataflash nodes - lan966: addition to many basic nodes for various peripherals - lan966: Kontron KSwitch D10: support for this new board and its network switch * tag 'at91-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: kswitch-d10: enable networking ARM: dts: lan966x: add switch node ARM: dts: lan966x: add serdes node ARM: dts: lan966x: add reset switch reset node ARM: dts: lan966x: add MIIM nodes ARM: dts: lan966x: add hwmon node ARM: dts: lan966x: add basic Kontron KSwitch D10 support ARM: dts: lan966x: add flexcom I2C nodes ARM: dts: lan966x: add flexcom SPI nodes ARM: dts: lan966x: add all flexcom usart nodes ARM: dts: lan966x: add missing uart DMA channel ARM: dts: lan966x: add sgpio node ARM: dts: lan966x: swap dma channels for crypto node ARM: dts: lan966x: rename pinctrl nodes ARM: dts: at91: sama7g5: remove interrupt-parent from gic node ARM: dts: at91: use generic node name for dataflash Link: https://lore.kernel.org/r/20220513162338.87717-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 213adc63dfbcdff9a0c19ec1f2681fda9c05cf6d Author: Waiman Long Date: Fri May 13 15:09:28 2022 -0400 kseltest/cgroup: Make test_stress.sh work if run interactively Commit 54de76c01239 ("kselftest/cgroup: fix test_stress.sh to use OUTPUT dir") changes the test_core command path from . to $OUTPUT. However, variable OUTPUT may not be defined if the command is run interactively. Fix that by using ${OUTPUT:-.} to cover both cases. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 1af0e4a0233fea7e8226cb977d379dc20f9bbe11 Author: Christian Göttsche Date: Thu Feb 17 15:18:57 2022 +0100 security: declare member holding string literal const The struct security_hook_list member lsm is assigned in security_add_hooks() with string literals passed from the individual security modules. Declare the function parameter and the struct member const to signal their immutability. Reported by Clang [-Wwrite-strings]: security/selinux/hooks.c:7388:63: error: passing 'const char [8]' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] security_add_hooks(selinux_hooks, ARRAY_SIZE(selinux_hooks), selinux); ^~~~~~~~~ ./include/linux/lsm_hooks.h:1629:11: note: passing argument to parameter 'lsm' here char *lsm); ^ Signed-off-by: Christian Göttsche Reviewed-by: Paul Moore Reviewed-by: Casey Schaufler Signed-off-by: Paul Moore commit 2c5f1536473b7530adefd09a25cf3fef2cfe01f2 Merge: f9a210c72d70c 0f9008e5c5103 Author: Jakub Kicinski Date: Fri May 13 10:25:08 2022 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2022-05-13 1) Cleanups for the code behind the XFRM offload API. This is a preparation for the extension of the API for policy offload. From Leon Romanovsky. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next: xfrm: drop not needed flags variable in XFRM offload struct net/mlx5e: Use XFRM state direction instead of flags netdevsim: rely on XFRM state direction instead of flags ixgbe: propagate XFRM offload state direction instead of flags xfrm: store and rely on direction to construct offload flags xfrm: rename xfrm_state_offload struct to allow reuse xfrm: delete not used number of external headers xfrm: free not used XFRM_ESP_NO_TRAILER flag ==================== Link: https://lore.kernel.org/r/20220513151218.4010119-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski commit f9a210c72d70c9a59cf989fb23fb01ff10d18136 Author: Ren Zhijie Date: Fri May 13 09:27:21 2022 +0800 sfc: siena: Fix Kconfig dependencies If CONFIG_PTP_1588_CLOCK=m and CONFIG_SFC_SIENA=y, the siena driver will fail to link: drivers/net/ethernet/sfc/siena/ptp.o: In function `efx_ptp_remove_channel': ptp.c:(.text+0xa28): undefined reference to `ptp_clock_unregister' drivers/net/ethernet/sfc/siena/ptp.o: In function `efx_ptp_probe_channel': ptp.c:(.text+0x13a0): undefined reference to `ptp_clock_register' ptp.c:(.text+0x1470): undefined reference to `ptp_clock_unregister' drivers/net/ethernet/sfc/siena/ptp.o: In function `efx_ptp_pps_worker': ptp.c:(.text+0x1d29): undefined reference to `ptp_clock_event' drivers/net/ethernet/sfc/siena/ptp.o: In function `efx_siena_ptp_get_ts_info': ptp.c:(.text+0x301b): undefined reference to `ptp_clock_index' To fix this build error, make SFC_SIENA depends on PTP_1588_CLOCK. Reported-by: Hulk Robot Fixes: d48523cb88e0 ("sfc: Copy shared files needed for Siena (part 2)") Signed-off-by: Ren Zhijie Acked-by: Martin Habets Link: https://lore.kernel.org/r/20220513012721.140871-1-renzhijie2@huawei.com Signed-off-by: Jakub Kicinski commit 0a360aeb861e94a9d17cb7e63887ef7876bac1df Author: Jiapeng Chong Date: Tue May 10 14:04:40 2022 +0800 drm/amdgpu: clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c:35 nbio_v7_7_get_rev_id() warn: inconsistent indenting. drivers/gpu/drm/amd/amdgpu/nbio_v7_7.c:214 nbio_v7_7_init_registers() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit b4927bd272623694314f37823302f9d67aa5964c Author: Andrea Parri (Microsoft) Date: Thu May 12 00:32:07 2022 +0200 PCI: hv: Fix synchronization between channel callback and hv_pci_bus_exit() [ Similarly to commit a765ed47e4516 ("PCI: hv: Fix synchronization between channel callback and hv_compose_msi_msg()"): ] The (on-stack) teardown packet becomes invalid once the completion timeout in hv_pci_bus_exit() has expired and hv_pci_bus_exit() has returned. Prevent the channel callback from accessing the invalid packet by removing the ID associated to such packet from the VMbus requestor in hv_pci_bus_exit(). Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20220511223207.3386-3-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 9937fa6d1eb6fac95586970e17617a718919c858 Author: Andrea Parri (Microsoft) Date: Thu May 12 00:32:06 2022 +0200 PCI: hv: Add validation for untrusted Hyper-V values For additional robustness in the face of Hyper-V errors or malicious behavior, validate all values that originate from packets that Hyper-V has sent to the guest in the host-to-guest ring buffer. Ensure that invalid values cannot cause data being copied out of the bounds of the source buffer in hv_pci_onchannelcallback(). While at it, remove a redundant validation in hv_pci_generic_compl(): hv_pci_onchannelcallback() already ensures that all processed incoming packets are "at least as large as [in fact larger than] a response". Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20220511223207.3386-2-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 4f9bd53084d18c2f9f1ec68fa56587b99a2cef00 Author: Kevin Mitchell Date: Fri Apr 29 20:40:27 2022 -0700 netfilter: conntrack: skip verification of zero UDP checksum The checksum is optional for UDP packets. However nf_reject would previously require a valid checksum to elicit a response such as ICMP_DEST_UNREACH. Add some logic to nf_reject_verify_csum to determine if a UDP packet has a zero checksum and should therefore not be verified. Signed-off-by: Kevin Mitchell Signed-off-by: Pablo Neira Ayuso commit 3412e16418286bdc12561827cbd22f94cb8af5e1 Author: Sven Auhagen Date: Wed Apr 27 09:15:15 2022 +0200 netfilter: flowtable: nft_flow_route use more data for reverse route When creating a flow table entry, the reverse route is looked up based on the current packet. There can be scenarios where the user creates a custom ip rule to route the traffic differently. In order to support those scenarios, the lookup needs to add more information based on the current packet. The patch adds multiple new information to the route lookup. Signed-off-by: Sven Auhagen Signed-off-by: Pablo Neira Ayuso commit 8edc813111001e9be3cce066d3d4091d2ef04a1d Author: Florian Westphal Date: Mon Apr 25 15:15:44 2022 +0200 netfilter: prefer extension check to pointer check The pointer check usually results in a 'false positive': its likely that the ctnetlink module is loaded but no event monitoring is enabled. After recent change to autodetect ctnetlink usage and only allocate the ecache extension if a listener is active, check if the extension is present on a given conntrack. If its not there, there is nothing to report and calls to the notification framework can be elided. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 90d1daa45849f272b701f29d6ca88b24743c7553 Author: Florian Westphal Date: Mon Apr 25 15:15:43 2022 +0200 netfilter: conntrack: add nf_conntrack_events autodetect mode This adds the new nf_conntrack_events=2 mode and makes it the default. This leverages the earlier flag in struct net to allow to avoid the event extension as long as no event listener is active in the namespace. This avoids, for most cases, allocation of ct->ext area. A followup patch will take further advantage of this by avoiding calls down into the event framework if the extension isn't present. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b0a7ab4a776583b4344e8313638dc795f7589209 Author: Florian Westphal Date: Mon Apr 25 15:15:42 2022 +0200 netfilter: conntrack: un-inline nf_ct_ecache_ext_add Only called when new ct is allocated or the extension isn't present. This function will be extended, place this in the conntrack module instead of inlining. The callers already depend on nf_conntrack module. Return value is changed to bool, noone used the returned pointer. Make sure that the core drops the newly allocated conntrack if the extension is requested but can't be added. This makes it necessary to ifdef the section, as the stub always returns false we'd drop every new conntrack if the the ecache extension is disabled in kconfig. Add from data path (xt_CT, nft_ct) is unchanged. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2794cdb0b97bfe62d25c996c8afe4832207e78bc Author: Florian Westphal Date: Mon Apr 25 15:15:41 2022 +0200 netfilter: nfnetlink: allow to detect if ctnetlink listeners exist At this time, every new conntrack gets the 'event cache extension' enabled for it. This is because the 'net.netfilter.nf_conntrack_events' sysctl defaults to 1. Changing the default to 0 means that commands that rely on the event notification extension, e.g. 'conntrack -E' or conntrackd, stop working. We COULD detect if there is a listener by means of 'nfnetlink_has_listeners()' and only add the extension if this is true. The downside is a dependency from conntrack module to nfnetlink module. This adds a different way: inc/dec a counter whenever a ctnetlink group is being (un)subscribed and toggle a flag in struct net. Next patches will take advantage of this and will only add the event extension if the flag is set. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8169ff584003c871a226719e998bb034231954d6 Author: Pablo Neira Ayuso Date: Fri Apr 8 13:10:19 2022 +0200 netfilter: conntrack: add nf_ct_iter_data object for nf_ct_iterate_cleanup*() This patch adds a structure to collect all the context data that is passed to the cleanup iterator. struct nf_ct_iter_data { struct net *net; void *data; u32 portid; int report; }; There is a netns field that allows to clean up conntrack entries specifically owned by the specified netns. Signed-off-by: Pablo Neira Ayuso commit 0bcfbafbcd345f285db0c3788e6359ceac6a008c Author: Florian Westphal Date: Mon Apr 11 13:01:25 2022 +0200 netfilter: conntrack: avoid unconditional local_bh_disable Now that the conntrack entry isn't placed on the pcpu list anymore the bh only needs to be disabled in the 'expectation present' case. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8a75a2c1741073f0c2d7bee146648e717527e048 Author: Florian Westphal Date: Mon Apr 11 13:01:24 2022 +0200 netfilter: conntrack: remove unconfirmed list It has no function anymore and can be removed. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ace53fdc262fa6751acd3d61f3236f84ae3340f1 Author: Florian Westphal Date: Mon Apr 11 13:01:23 2022 +0200 netfilter: conntrack: remove __nf_ct_unconfirmed_destroy Its not needed anymore: A. If entry is totally new, then the rcu-protected resource must already have been removed from global visibility before call to nf_ct_iterate_destroy. B. If entry was allocated before, but is not yet in the hash table (uncofirmed case), genid gets incremented and synchronize_rcu() call makes sure access has completed. C. Next attempt to peek at extension area will fail for unconfirmed conntracks, because ext->genid != genid. D. Conntracks in the hash are iterated as before. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 42df4fb9b1bed6a6d2c1f79b974a9ed14de27ea1 Author: Florian Westphal Date: Mon Apr 11 13:01:22 2022 +0200 netfilter: cttimeout: decouple unlink and free on netns destruction Increment the extid on module removal; this makes sure that even in extreme cases any old uncofirmed entry that happened to be kept e.g. on nfnetlink_queue list will not trip over a stale timeout reference. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c56716c69ce1ac320432fb1ea5654196ba24d2f8 Author: Florian Westphal Date: Mon Apr 11 13:01:21 2022 +0200 netfilter: extensions: introduce extension genid count Multiple netfilter extensions store pointers to external data in their extension area struct. Examples: 1. Timeout policies 2. Connection tracking helpers. No references are taken for these. When a helper or timeout policy is removed, the conntrack table gets traversed and affected extensions are cleared. Conntrack entries not yet in the hashtable are referenced via a special list, the unconfirmed list. On removal of a policy or connection tracking helper, the unconfirmed list gets traversed an all entries are marked as dying, this prevents them from getting committed to the table at insertion time: core checks for dying bit, if set, the conntrack entry gets destroyed at confirm time. The disadvantage is that each new conntrack has to be added to the percpu unconfirmed list, and each insertion needs to remove it from this list. The list is only ever needed when a policy or helper is removed -- a rare occurrence. Add a generation ID count: Instead of adding to the list and then traversing that list on policy/helper removal, increment a counter that is stored in the extension area. For unconfirmed conntracks, the extension has the genid valid at ct allocation time. Removal of a helper/policy etc. increments the counter. At confirmation time, validate that ext->genid == global_id. If the stored number is not the same, do not allow the conntrack insertion, just like as if a confirmed-list traversal would have flagged the entry as dying. After insertion, the genid is no longer relevant (conntrack entries are now reachable via the conntrack table iterators and is set to 0. This allows removal of the percpu unconfirmed list. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 17438b42ce14cb60ceda9ae62ad5dd022d55a216 Author: Florian Westphal Date: Mon Apr 11 13:01:20 2022 +0200 netfilter: remove nf_ct_unconfirmed_destroy helper This helper tags connections not yet in the conntrack table as dying. These nf_conn entries will be dropped instead when the core attempts to insert them from the input or postrouting 'confirm' hook. After the previous change, the entries get unlinked from the list earlier, so that by the time the actual exit hook runs, new connections no longer have a timeout policy assigned. Its enough to walk the hashtable instead. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 78222bacfca97cb18505df1ba5f3591864498a7e Author: Florian Westphal Date: Mon Apr 11 13:01:19 2022 +0200 netfilter: cttimeout: decouple unlink and free on netns destruction Make it so netns pre_exit unlinks the objects from the pernet list, so they cannot be found anymore. netns core issues a synchronize_rcu() before calling the exit hooks so any the time the exit hooks run unconfirmed nf_conn entries have been free'd or they have been committed to the hashtable. The exit hook still tags unconfirmed entries as dying, this can now be removed in a followup change. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1397af5bfd7d32b0cf2adb70a78c9a9e8f11d912 Author: Florian Westphal Date: Mon Apr 11 13:01:18 2022 +0200 netfilter: conntrack: remove the percpu dying list Its no longer needed. Entries that need event redelivery are placed on the new pernet dying list. The advantage is that there is no need to take additional spinlock on conntrack removal unless event redelivery failed or the conntrack entry was never added to the table in the first place (confirmed bit not set). The IPS_CONFIRMED bit now needs to be set as soon as the entry has been unlinked from the unconfirmed list, else the destroy function may attempt to unlink it a second time. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 0d3cc504ba9cdcff76346306c37eb1ea01e60a86 Author: Florian Westphal Date: Mon Apr 11 13:01:17 2022 +0200 netfilter: conntrack: include ecache dying list in dumps The new pernet dying list includes conntrack entries that await delivery of the 'destroy' event via ctnetlink. The old percpu dying list will be removed soon. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2ed3bf188b33630cf9d93b996ebf001847a00b5a Author: Florian Westphal Date: Mon Apr 11 13:01:16 2022 +0200 netfilter: ecache: use dedicated list for event redelivery This disentangles event redelivery and the percpu dying list. Because entries are now stored on a dedicated list, all entries are in NFCT_ECACHE_DESTROY_FAIL state and all entries still have confirmed bit set -- the reference count is at least 1. The 'struct net' back-pointer can be removed as well. The pcpu dying list will be removed eventually, it has no functionality. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6a985ae80befcf2c00e7c889336bfe9e9739e2ef Author: Jason Gunthorpe Date: Wed May 4 16:14:46 2022 -0300 vfio/pci: Use the struct file as the handle not the vfio_group VFIO PCI does a security check as part of hot reset to prove that the user has permission to manipulate all the devices that will be impacted by the reset. Use a new API vfio_file_has_dev() to perform this security check against the struct file directly and remove the vfio_group from VFIO PCI. Since VFIO PCI was the last user of vfio_group_get_external_user() and vfio_group_put_external_user() remove it as well. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/8-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 3e5449d5f954f537522906dfcb6a76e2b035521f Author: Jason Gunthorpe Date: Wed May 4 16:14:45 2022 -0300 kvm/vfio: Remove vfio_group from kvm None of the VFIO APIs take in the vfio_group anymore, so we can remove it completely. This has a subtle side effect on the enforced coherency tracking. The vfio_group_get_external_user() was holding on to the container_users which would prevent the iommu_domain and thus the enforced coherency value from changing while the group is registered with kvm. It changes the security proof slightly into 'user must hold a group FD that has a device that cannot enforce DMA coherence'. As opening the group FD, not attaching the container, is the privileged operation this doesn't change the security properties much. On the flip side it paves the way to changing the iommu_domain/container attached to a group at runtime which is something that will be required to support nested translation. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig i Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit ba70a89f3c2a8279809ea0fc7684857c91938b8a Author: Jason Gunthorpe Date: Wed May 4 16:14:44 2022 -0300 vfio: Change vfio_group_set_kvm() to vfio_file_set_kvm() Just change the argument from struct vfio_group to struct file *. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit a905ad043f32bbb0c35d4325036397f20f30c8a9 Author: Jason Gunthorpe Date: Wed May 4 16:14:43 2022 -0300 vfio: Change vfio_external_check_extension() to vfio_file_enforced_coherent() Instead of a general extension check change the function into a limited test if the iommu_domain has enforced coherency, which is the only thing kvm needs to query. Make the new op self contained by properly refcounting the container before touching it. Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit c38ff5b0c373fbbd6a249eb461ffd4ae0f9dbfa0 Author: Jason Gunthorpe Date: Wed May 4 16:14:42 2022 -0300 vfio: Remove vfio_external_group_match_file() vfio_group_fops_open() ensures there is only ever one struct file open for any struct vfio_group at any time: /* Do we need multiple instances of the group open? Seems not. */ opened = atomic_cmpxchg(&group->opened, 0, 1); if (opened) { vfio_group_put(group); return -EBUSY; Therefor the struct file * can be used directly to search the list of VFIO groups that KVM keeps instead of using the vfio_external_group_match_file() callback to try to figure out if the passed in FD matches the list or not. Delete vfio_external_group_match_file(). Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 50d63b5bbfd12262069ad062611cd5e69c5e9e05 Author: Jason Gunthorpe Date: Wed May 4 16:14:41 2022 -0300 vfio: Change vfio_external_user_iommu_id() to vfio_file_iommu_group() The only caller wants to get a pointer to the struct iommu_group associated with the VFIO group file. Instead of returning the group ID then searching sysfs for that string to get the struct iommu_group just directly return the iommu_group pointer already held by the vfio_group struct. It already has a safe lifetime due to the struct file kref, the vfio_group and thus the iommu_group cannot be destroyed while the group file is open. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit d55d9e7a4572182701ed0b62313b4f22e544e226 Author: Jason Gunthorpe Date: Wed May 4 16:14:40 2022 -0300 kvm/vfio: Store the struct file in the kvm_vfio_group Following patches will change the APIs to use the struct file as the handle instead of the vfio_group, so hang on to a reference to it with the same duration of as the vfio_group. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 73b0565f19a8fbc18dcf4b9b5c26d1a47a69ab24 Author: Jason Gunthorpe Date: Wed May 4 16:14:39 2022 -0300 kvm/vfio: Move KVM_DEV_VFIO_GROUP_* ioctls into functions To make it easier to read and change in following patches. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Reviewed-by: Cornelia Huck Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit dc15f82f5329ab5daefa692bb80fb085a09ebd86 Author: Jason Gunthorpe Date: Fri Apr 29 15:46:17 2022 -0300 vfio: Delete container_q Now that the iommu core takes care of isolation there is no race between driver attach and container unset. Once iommu_group_release_dma_owner() returns the device can immediately be re-used. Remove this mechanism. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/0-v1-a1e8791d795b+6b-vfio_container_q_jgg@nvidia.com Signed-off-by: Alex Williamson commit c5e8c39282def775b707ccb5dfe644bd081aa7a8 Merge: ff806cbd90bd2 0286300e60455 Author: Alex Williamson Date: Fri May 13 10:04:22 2022 -0600 Merge remote-tracking branch 'iommu/vfio-notifier-fix' into v5.19/vfio/next Merge IOMMU dependencies for vfio. Signed-off-by: Alex Williamson commit 408b1d3c0ec8e4f36603092573108a6d3daa07a8 Author: Max Filippov Date: Fri May 13 03:40:54 2022 -0700 xtensa: add trap handler for division by zero Add c-level handler for the division by zero exception and kill the task if it was thrown from the kernel space or send SIGFPE otherwise. Signed-off-by: Max Filippov commit 426ecc5851021519374542b0a954b2a9a3942d04 Merge: dc5d8bfa3a37d 0431de14ae086 Author: Arnd Bergmann Date: Fri May 13 16:33:02 2022 +0200 Merge tag 'mvebu-arm-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/soc mvebu arm for 5.19 (part 1) Fix typos in comment on orion5x files * tag 'mvebu-arm-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: orion5x: fix typos in comments Link: https://lore.kernel.org/r/87o801r2ss.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 7213d3a5a1e921a4da6a872e72665721889b0b62 Merge: 5aef4d1ecc975 f60e2de515095 Author: Arnd Bergmann Date: Fri May 13 16:32:23 2022 +0200 Merge tag 'mvebu-dt-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt for 5.19 (part 1) Add the crypto module atsha204a node for the turis omnia (Armada 385 bases) * tag 'mvebu-dt-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: ARM: dts: turris-omnia: Add atsha204a node Link: https://lore.kernel.org/r/87lev5r2rg.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 5aef4d1ecc9758bf4b8d8749060c9b097d0100b3 Merge: 9dd7a5a896355 239466bddfc02 Author: Arnd Bergmann Date: Fri May 13 16:31:01 2022 +0200 Merge tag 'mvebu-dt64-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt64 for 5.19 (part 1) Update sdhci node names to match schema on all mvebu dt64 dtsi files Armada 3720: uDPU board: - correct temperature sensors - update partition table espressobin-ultra board: - enable front USB3 port - add PHY and switch reset pins - fix SPI-NOR config * tag 'mvebu-dt64-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: Update sdhci node names to match schema arm64: dts: marvell: espressobin-ultra: enable front USB3 port arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins arm64: dts: marvell: espressobin-ultra: fix SPI-NOR config arm64: dts: uDPU: correct temperature sensors arm64: dts: uDPU: update partition table Signed-off-by: Arnd Bergmann commit e240ac52f7da5986f9dcbe29d423b7b2f141b41b Author: zhenwei pi Date: Thu May 12 20:23:10 2022 -0700 mm/memory-failure.c: simplify num_poisoned_pages_inc/dec Originally, do num_poisoned_pages_inc() in memory failure routine, use num_poisoned_pages_dec() to rollback the number if filtered/ cancelled. Suggested by Naoya, do num_poisoned_pages_inc() only in action_result(), this make this clear and simple. Link: https://lkml.kernel.org/r/20220509105641.491313-6-pizhenwei@bytedance.com Signed-off-by: zhenwei pi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit f0696cb4068a0d79cf9795ad34560d2f6200d42c Author: zhenwei pi Date: Thu May 12 20:23:10 2022 -0700 mm/hwpoison: disable hwpoison filter during removing hwpoison filter is enabled by hwpoison-inject module, after removing this module, hwpoison filter still works. What is worse, user can not find the debugfs entries to know this. Disable the hwpoison filter during removing hwpoison-inject module. Link: https://lkml.kernel.org/r/20220509105641.491313-5-pizhenwei@bytedance.com Signed-off-by: zhenwei pi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 9113eaf331bf44579882c001867773cf1b3364fd Author: zhenwei pi Date: Thu May 12 20:23:10 2022 -0700 mm/memory-failure.c: add hwpoison_filter for soft offline hwpoison_filter is missing in the soft offline path, this leads an issue: after enabling the corrupt filter, the user process still has a chance to inject hwpoison fault by madvise(addr, len, MADV_SOFT_OFFLINE) at PFN which is expected to reject. Also do a minor change in comment of memory_failure(). Link: https://lkml.kernel.org/r/20220509105641.491313-4-pizhenwei@bytedance.com Signed-off-by: zhenwei pi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit c8bd84f73fd6215d5b8d0b3cfc914a3671b16d1c Author: zhenwei pi Date: Thu May 12 20:23:09 2022 -0700 mm/memory-failure.c: simplify num_poisoned_pages_dec Don't decrease the number of poisoned pages in page_alloc.c, let the memory-failure.c do inc/dec poisoned pages only. Also simplify unpoison_memory(), only decrease the number of poisoned pages when: - TestClearPageHWPoison() succeed - put_page_back_buddy succeed After decreasing, print necessary log. Finally, remove clear_page_hwpoison() and unpoison_taken_off_page(). Link: https://lkml.kernel.org/r/20220509105641.491313-3-pizhenwei@bytedance.com Signed-off-by: zhenwei pi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 60f272f6b09a8f14156df88cccd21447ab394452 Author: zhenwei pi Date: Thu May 12 20:23:09 2022 -0700 mm/memory-failure.c: move clear_hwpoisoned_pages Patch series "memory-failure: fix hwpoison_filter", v2. As well known, the memory failure mechanism handles memory corrupted event, and try to send SIGBUS to the user process which uses this corrupted page. For the virtualization case, QEMU catches SIGBUS and tries to inject MCE into the guest, and the guest handles memory failure again. Thus the guest gets the minimal effect from hardware memory corruption. The further step I'm working on: 1, try to modify code to decrease poisoned pages in a single place (mm/memofy-failure.c: simplify num_poisoned_pages_dec in this series). 2, try to use page_handle_poison() to handle SetPageHWPoison() and num_poisoned_pages_inc() together. It would be best to call num_poisoned_pages_inc() in a single place too. 3, introduce memory failure notifier list in memory-failure.c: notify the corrupted PFN to someone who registers this list. If I can complete [1] and [2] part, [3] will be quite easy(just call notifier list after increasing poisoned page). 4, introduce memory recover VQ for memory balloon device, and registers memory failure notifier list. During the guest kernel handles memory failure, balloon device gets notified by memory failure notifier list, and tells the host to recover the corrupted PFN(GPA) by the new VQ. 5, host side remaps the corrupted page(HVA), and tells the guest side to unpoison the PFN(GPA). Then the guest fixes the corrupted page(GPA) dynamically. This patch (of 5): clear_hwpoisoned_pages() clears HWPoison flag and decreases the number of poisoned pages, this actually works as part of memory failure. Move this function from sparse.c to memory-failure.c, finally there is no CONFIG_MEMORY_FAILURE in sparse.c. Link: https://lkml.kernel.org/r/20220509105641.491313-1-pizhenwei@bytedance.com Link: https://lkml.kernel.org/r/20220509105641.491313-2-pizhenwei@bytedance.com Signed-off-by: zhenwei pi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit cd8c1fd8cdd14158f2d8bea2d1bfe8015dccfa3a Author: Eric Dumazet Date: Thu May 12 20:23:09 2022 -0700 mm/page_owner: use strscpy() instead of strlcpy() current->comm[] is not a string (no guarantee for a zero byte in it). strlcpy(s1, s2, l) is calling strlen(s2), potentially causing out-of-bound access, as reported by syzbot: detected buffer overflow in __fortify_strlen ------------[ cut here ]------------ kernel BUG at lib/string_helpers.c:980! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 4087 Comm: dhcpcd-run-hooks Not tainted 5.18.0-rc3-syzkaller-01537-g20b87e7c29df #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:fortify_panic+0x18/0x1a lib/string_helpers.c:980 Code: 8c e8 c5 ba e1 fa e9 23 0f bf fa e8 0b 5d 8c f8 eb db 55 48 89 fd e8 e0 49 40 f8 48 89 ee 48 c7 c7 80 f5 26 8a e8 99 09 f1 ff <0f> 0b e8 ca 49 40 f8 48 8b 54 24 18 4c 89 f1 48 c7 c7 00 00 27 8a RSP: 0018:ffffc900000074a8 EFLAGS: 00010286 RAX: 000000000000002c RBX: ffff88801226b728 RCX: 0000000000000000 RDX: ffff8880198e0000 RSI: ffffffff81600458 RDI: fffff52000000e87 RBP: ffffffff89da2aa0 R08: 000000000000002c R09: 0000000000000000 R10: ffffffff815fae2e R11: 0000000000000000 R12: ffff88801226b700 R13: ffff8880198e0830 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5876ad6ff8 CR3: 000000001a48c000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: __fortify_strlen include/linux/fortify-string.h:128 [inline] strlcpy include/linux/fortify-string.h:143 [inline] __set_page_owner_handle+0x2b1/0x3e0 mm/page_owner.c:171 __set_page_owner+0x3e/0x50 mm/page_owner.c:190 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8df/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3242 dst_alloc+0x146/0x1f0 net/core/dst.c:92 Link: https://lkml.kernel.org/r/20220509145949.265184-1-eric.dumazet@gmail.com Fixes: 865ed6a32786 ("mm/page_owner: record task command name") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Waiman Long Acked-by: Shakeel Butt Cc: Signed-off-by: Andrew Morton commit fe30ddca9f18fb56bf1dd161ffd9d8a04bba5713 Author: Andrey Konovalov Date: Thu May 12 20:23:09 2022 -0700 kasan: clean-up kconfig options descriptions Various readability clean-ups of KASAN Kconfig options. No functional changes. Link: https://lkml.kernel.org/r/c160840dd9e4b1ad5529ecfdb0bba35d9a14d826.1652203271.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/47afaecec29221347bee49f58c258ac1ced3b429.1652123204.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton commit ca89f2a2e66d0bc0a5929dafaf6270d35374c7a6 Author: Andrey Konovalov Date: Thu May 12 20:23:09 2022 -0700 kasan: move boot parameters section in documentation Move the "Boot parameters" section in KASAN documentation next to the section that describes KASAN build options. No content changes. Link: https://lkml.kernel.org/r/870628e1293b4f44edf7cbcb92374ff9eb7503d7.1652203271.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/ec9c923f35e7c5312836c4624a7f317dc1ee2c1c.1652123204.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit c2ec0c8f687711e671d865b0a36344440c1e8b1f Author: Andrey Konovalov Date: Thu May 12 20:23:09 2022 -0700 kasan: update documentation Do assorted clean-ups and improvements to KASAN documentation, including: - Describe each mode in a dedicated paragraph. - Split out a Support section that describes in details which compilers, architectures and memory types each mode requires/supports. - Capitalize the first letter in the names of each KASAN mode. [andreyknvl@google.com: rewording, per Marco] Link: https://lkml.kernel.org/r/896b2d914d6b50d677fd7b38f76967cc705c01ba.1652203271.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/5bd58ebebf066593ce0e1d265d60278b5f5a1874.1652123204.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 06bc4cf6cdde69079c82330aa8f0939d680b6c84 Author: Andrey Konovalov Date: Thu May 12 20:23:08 2022 -0700 kasan: give better names to shadow values Rename KASAN_KMALLOC_* shadow values to KASAN_SLAB_*, as they are used for all slab allocations, not only for kmalloc. Also rename KASAN_FREE_PAGE to KASAN_PAGE_FREE to be consistent with KASAN_PAGE_REDZONE and KASAN_SLAB_FREE. Link: https://lkml.kernel.org/r/bebcaf4eafdb0cabae0401a69c0af956aa87fcaa.1652111464.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit 83f8e4a8b47012c299f59e301c64763727cc5f81 Author: Andrey Konovalov Date: Thu May 12 20:23:08 2022 -0700 kasan: use tabs to align shadow values Consistently use tabs instead of spaces to shadow value definitions. Link: https://lkml.kernel.org/r/00e7e66b5fc375d58200dc1489949b3edcd096b7.1652111464.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit fc0e5b91dfe4420a3f26bde36ee232aa8c6ded5d Author: Andrey Konovalov Date: Thu May 12 20:23:08 2022 -0700 kasan: clean up comments in internal kasan.h Clean up comments in mm/kasan/kasan.h: clarify, unify styles, fix punctuation, etc. Link: https://lkml.kernel.org/r/a0680ff30035b56cb7bdd5f59fd400e71712ceb5.1652111464.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton commit 3f80492001aa64ac585016050ace8680611c2e20 Author: Sebastian Andrzej Siewior Date: Thu May 12 20:23:08 2022 -0700 mm/vmalloc: use raw_cpu_ptr() for vmap_block_queue access The per-CPU resource vmap_block_queue is accessed via get_cpu_var(). That macro disables preemption and then loads the pointer from the current CPU. This doesn't work on PREEMPT_RT because a spinlock_t is later accessed within the preempt-disable section. There is no need to disable preemption while accessing the per-CPU struct vmap_block_queue because the list is protected with a spinlock_t. The per-CPU struct is also accessed cross-CPU in purge_fragmented_blocks(). It is possible that by using raw_cpu_ptr() the code migrates to another CPU and uses struct from another CPU. This is fine because the list is locked and the locked section is very short. Use raw_cpu_ptr() to access vmap_block_queue. Link: https://lkml.kernel.org/r/YnKx3duAB53P7ojN@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Cc: Uladzislau Rezki (Sony) Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit fe573327ffb1deba802c91dd1d4ff41dafa97a0e Author: Vasily Averin Date: Thu May 12 20:23:08 2022 -0700 tracing: incorrect gfp_t conversion Fixes the following sparse warnings: include/trace/events/*: sparse: cast to restricted gfp_t include/trace/events/*: sparse: restricted gfp_t degrades to integer gfp_t type is bitwise and requires __force attributes for any casts. Link: https://lkml.kernel.org/r/331d88fe-f4f7-657c-02a2-d977f15fbff6@openvz.org Signed-off-by: Vasily Averin Cc: Steven Rostedt Cc: Ingo Molnar Signed-off-by: Andrew Morton commit e7be8d1dd983156bbdd22c0319b71119a8fbb697 Author: Alexey Romanov Date: Thu May 12 20:23:07 2022 -0700 zram: remove double compression logic The 2nd trial allocation under per-cpu presumption has been used to prevent regression of allocation failure. However, it makes trouble for maintenance without significant benefit. The slowpath branch is executed extremely rarely: getting there is problematic. Therefore, we delete this branch. Since b09ab054b69b ("zram: support BDI_CAP_STABLE_WRITES"), zram has used QUEUE_FLAG_STABLE_WRITES to prevent buffer change between 1st and 2nd memory allocations. Since we remove second trial memory allocation logic, we could remove the STABLE_WRITES flag because there is no change buffer to be modified under us. Link: https://lkml.kernel.org/r/20220505094443.11728-1-avromanov@sberdevices.ru Signed-off-by: Alexey Romanov Signed-off-by: Dmitry Rokosov Acked-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Cc: Nitin Gupta Signed-off-by: Andrew Morton commit f67bed134a053663852a1a3ab1b3223bfc2104a2 Author: Vasily Averin Date: Thu May 12 20:23:07 2022 -0700 percpu: improve percpu_alloc_percpu event trace Add call_site, bytes_alloc and gfp_flags fields to the output of the percpu_alloc_percpu ftrace event: mkdir-4393 [001] 169.334788: percpu_alloc_percpu: call_site=mem_cgroup_css_alloc+0xa6 reserved=0 is_atomic=0 size=2408 align=8 base_addr=0xffffc7117fc00000 off=402176 ptr=0x3dc867a62300 bytes_alloc=14448 gfp_flags=GFP_KERNEL_ACCOUNT This is required to track memcg-accounted percpu allocations. Link: https://lkml.kernel.org/r/a07be858-c8a3-7851-9086-e3262cbcf707@openvz.org Signed-off-by: Vasily Averin Acked-by: Roman Gushchin Cc: Shakeel Butt Cc: Steven Rostedt Cc: Ingo Molnar Cc: Vlastimil Babka Cc: Michal Hocko Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Signed-off-by: Andrew Morton commit d1ed51fcdbd69be3729f6e249b61cc73fb3b2dd8 Author: Akira Yokosawa Date: Thu May 12 20:23:07 2022 -0700 docs: vm/page_owner: tweak literal block in STANDARD FORMAT SPECIFIERS A semantic conflict between commit 5603f9bdea68 ("docs: vm/page_owner: use literal blocks for param description") and a change queued for v5.19 authored by Jiajian Ye ("tools/vm/page_owner_sort.c: support sorting blocks by multiple keys") results in a warning from "make htmldocs" saying: [...]/vm/page_owner.rst:176: WARNING: Literal block expected; none found. This is because a literal block in ReST ends at a line which has the same indent as the paragraph preceding it. In this case the one with no indent. Indent the two "For --xxxx option:" lines by two columns and make the whole section a literal block. While at it, fix indents by white spaces of "ator" keys. Link: https://lkml.kernel.org/r/fdfecc82-d41e-6d8a-738d-4beb6faa27fb@gmail.com Signed-of-by: Akira Yokosawa Reported-by: Shenghong Han Cc: Jiajian Ye Cc: Chongxi Zhao Cc: Yinan Zhang Cc: Yixuan Cao Cc: Yongqiang Liu Cc: Yuhong Feng Cc: Haowen Bai Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 2e14a8d3bbccf22a807c012ff6e7c2f307600e4a Author: Jiapeng Chong Date: Thu May 12 20:23:07 2022 -0700 mm/damon/reclaim: use resource_size function on resource object Fix the following coccicheck warnings: ./mm/damon/reclaim.c:241:30-33: WARNING: Suspicious code. resource_size is maybe missing with res. Link: https://lkml.kernel.org/r/20220507032512.129598-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jiapeng Chong Reported-by: Abaci Robot Reviewed-by: SeongJae Park Cc: "Boehme, Markus" Signed-off-by: Andrew Morton commit c8db8c2628afc7088a43de3f7cfbcc2ef1f182f7 Author: Li kunyu Date: Thu May 12 20:23:07 2022 -0700 mm: functions may simplify the use of return values p4d_clear_huge may be optimized for void return type and function usage. vunmap_p4d_range function saves a few steps here. Link: https://lkml.kernel.org/r/20220507150630.90399-1-kunyu@nfschina.com Signed-off-by: Li kunyu Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton commit 3fee229a8eb936b96933c6b2cd02d2e87a4cc997 Author: Tong Tiangen Date: Thu May 12 20:23:06 2022 -0700 riscv/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK As commit d283d422c6c4 ("x86: mm: add x86_64 support for page table check"), enable ARCH_SUPPORTS_PAGE_TABLE_CHECK on riscv. Add additional page table check stubs for page table helpers, these stubs can be used to check the existing page table entries. Link: https://lkml.kernel.org/r/20220507110114.4128854-7-tongtiangen@huawei.com Signed-off-by: Tong Tiangen Reviewed-by: Pasha Tatashin Cc: Anshuman Khandual Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Kefeng Wang Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton commit 42b2547137f5c974bb1bfd657c869fe96b96d86f Author: Kefeng Wang Date: Thu May 12 20:23:06 2022 -0700 arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK As commit d283d422c6c4 ("x86: mm: add x86_64 support for page table check") , enable ARCH_SUPPORTS_PAGE_TABLE_CHECK on arm64. Add additional page table check stubs for page table helpers, these stubs can be used to check the existing page table entries. Link: https://lkml.kernel.org/r/20220507110114.4128854-6-tongtiangen@huawei.com Signed-off-by: Kefeng Wang Signed-off-by: Tong Tiangen Reviewed-by: Pasha Tatashin Acked-by: Catalin Marinas Cc: Anshuman Khandual Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton commit 2e7dc2b632a324c670ff11dd6c84d711043c683f Author: Tong Tiangen Date: Thu May 12 20:23:06 2022 -0700 mm: remove __HAVE_ARCH_PTEP_CLEAR in pgtable.h Currently, there is no architecture definition __HAVE_ARCH_PTEP_CLEAR, Generic ptep_clear() is the only definition for all architecture, So drop the "#ifndef __HAVE_ARCH_PTEP_CLEAR". Link: https://lkml.kernel.org/r/20220507110114.4128854-5-tongtiangen@huawei.com Signed-off-by: Tong Tiangen Suggested-by: Anshuman Khandual Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Kefeng Wang Cc: Palmer Dabbelt Cc: Pasha Tatashin Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton commit de8c8e52836d0082188508548d0b939f49f7f0e6 Author: Tong Tiangen Date: Thu May 12 20:23:06 2022 -0700 mm: page_table_check: add hooks to public helpers Move ptep_clear() to the include/linux/pgtable.h and add page table check relate hooks to some helpers, it's prepare for support page table check feature on new architecture. Optimize the implementation of ptep_clear(), page table hooks added page table check stubs, the interface control should be at stubs, there is no rationale for doing a IS_ENABLED() check here. For architectures that do not enable CONFIG_PAGE_TABLE_CHECK, they will call a fallback page table check stubs[1] when getting their page table helpers[2] in include/linux/pgtable.h. [1] page table check stubs defined in include/linux/page_table_check.h [2] ptep_clear() ptep_get_and_clear() pmdp_huge_get_and_clear() pudp_huge_get_and_clear() Link: https://lkml.kernel.org/r/20220507110114.4128854-4-tongtiangen@huawei.com Signed-off-by: Tong Tiangen Acked-by: Pasha Tatashin Cc: Anshuman Khandual Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Kefeng Wang Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton commit e5a554014618308f046af99ab9c950165ed6cb11 Author: Kefeng Wang Date: Thu May 12 20:23:06 2022 -0700 mm: page_table_check: move pxx_user_accessible_page into x86 The pxx_user_accessible_page() checks the PTE bit, it's architecture-specific code, move them into x86's pgtable.h. These helpers are being moved out to make the page table check framework platform independent. Link: https://lkml.kernel.org/r/20220507110114.4128854-3-tongtiangen@huawei.com Signed-off-by: Kefeng Wang Signed-off-by: Tong Tiangen Acked-by: Pasha Tatashin Reviewed-by: Anshuman Khandual Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton commit 92fb05242a1b1ecfcb39d9b1421a165adf344a3c Author: Tong Tiangen Date: Thu May 12 20:23:06 2022 -0700 mm: page_table_check: using PxD_SIZE instead of PxD_PAGE_SIZE Patch series "mm: page_table_check: add support on arm64 and riscv", v7. Page table check performs extra verifications at the time when new pages become accessible from the userspace by getting their page table entries (PTEs PMDs etc.) added into the table. It is supported on X86[1]. This patchset made some simple changes and make it easier to support new architecture, then we support this feature on ARM64 and RISCV. [1]https://lore.kernel.org/lkml/20211123214814.3756047-1-pasha.tatashin@soleen.com/ This patch (of 6): Compared with PxD_PAGE_SIZE, which is defined and used only on X86, PxD_SIZE is more common in each architecture. Therefore, it is more reasonable to use PxD_SIZE instead of PxD_PAGE_SIZE in page_table_check.c. At the same time, it is easier to support page table check in other architectures. The substitution has no functional impact on the x86. Link: https://lkml.kernel.org/r/20220507110114.4128854-1-tongtiangen@huawei.com Link: https://lkml.kernel.org/r/20220507110114.4128854-2-tongtiangen@huawei.com Signed-off-by: Tong Tiangen Suggested-by: Anshuman Khandual Acked-by: Pasha Tatashin Reviewed-by: Anshuman Khandual Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Catalin Marinas Cc: Will Deacon Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Kefeng Wang Signed-off-by: Andrew Morton commit e7e3ffeb274f1ff5bc68bb9135128e1ba14a7d53 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:05 2022 -0700 mm/migrate: convert move_to_new_page() into move_to_new_folio() Pass in the folios that we already have in each caller. Saves a lot of calls to compound_head(). Link: https://lkml.kernel.org/r/20220504182857.4013401-27-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 8b463be3a0241558071e6ba9bf11e4bf42ccc856 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:05 2022 -0700 mm: add folio_test_movable() This is the folio equivalent of PageMovable() which is needed to convert mm/migrate.c to folios. Link: https://lkml.kernel.org/r/20220504182857.4013401-26-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit a9595b305c0f6cbbf9505325509d95637f6a7062 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:05 2022 -0700 mm: add folio_mapping_flags() This is the equivalent of PageMappingFlags and is needed for converting mm/migrate.c to folios. Link: https://lkml.kernel.org/r/20220504182857.4013401-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit da08e9b7932345aff0a748c55f8a25709505f2a3 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:05 2022 -0700 mm/shmem: convert shmem_swapin_page() to shmem_swapin_folio() shmem_swapin_page() only brings in order-0 pages, which are folios by definition. Link: https://lkml.kernel.org/r/20220504182857.4013401-24-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit b1d0ec3a9a250b2d5ddd790fdaa2245432a903a3 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:05 2022 -0700 mm/shmem: convert shmem_getpage_gfp to use a folio Rename shmem_alloc_and_acct_page() to shmem_alloc_and_acct_folio() and have it return a folio, then use a folio throuughout shmem_getpage_gfp(). It continues to return a struct page. Link: https://lkml.kernel.org/r/20220504182857.4013401-23-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 72827e5c2bcb86d56f8a8aa78fde0085d8535567 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:04 2022 -0700 mm/shmem: convert shmem_alloc_and_acct_page to use a folio Convert shmem_alloc_hugepage() to return the folio that it uses and use a folio throughout shmem_alloc_and_acct_page(). Continue to return a page from shmem_alloc_and_acct_page() for now. Link: https://lkml.kernel.org/r/20220504182857.4013401-22-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 0c023ef52d769ea064df2c86bcdf29cbedb0a9b7 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:04 2022 -0700 mm/shmem: add shmem_alloc_folio() Call vma_alloc_folio() directly instead of alloc_page_vma(). Add a shmem_alloc_page() wrapper to avoid changing the callers. Link: https://lkml.kernel.org/r/20220504182857.4013401-21-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 069d849cde3a02c075548ac68a43ed97fc95ee34 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:04 2022 -0700 mm/shmem: turn shmem_should_replace_page into shmem_should_replace_folio This is a straightforward conversion. Link: https://lkml.kernel.org/r/20220504182857.4013401-20-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit b7dd44a12cf26603712e60f1e1449c87d5f8cb79 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:04 2022 -0700 mm/shmem: convert shmem_add_to_page_cache to take a folio Shrinks shmem_add_to_page_cache() by 16 bytes. All the callers grow, but this is temporary as they will all be converted to folios soon. Link: https://lkml.kernel.org/r/20220504182857.4013401-19-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 039bc1240165c99b932fb4be2f784948d1038eea Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:04 2022 -0700 mm/swap: add folio_throttle_swaprate The only use of the page argument to cgroup_throttle_swaprate() is to get the node ID, and this will be the same for all pages in the folio, so just pass in the first page of the folio. Link: https://lkml.kernel.org/r/20220504182857.4013401-18-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 0562457186752b6a65eeca9f5ed0fb9b1e2572e3 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 mm/shmem: use a folio in shmem_unused_huge_shrink When calling split_huge_page() we usually have to find the precise page, but that's not necessary here because we only need to unlock and put the folio afterwards. Saves 231 bytes of text (20% of this function). Link: https://lkml.kernel.org/r/20220504182857.4013401-17-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit c28a0e9695b724fbaa58b1f5bbf0a03c5a79d721 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 vmscan: remove remaining uses of page in shrink_page_list These are all straightforward conversions to the folio API. Link: https://lkml.kernel.org/r/20220504182857.4013401-16-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit dc786690a6a1d9a680e6872821291ad7ca9f520d Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 mm: allow can_split_folio() to be called when THP are disabled The call to can_split_folio() in vmscan is currently guarded by a test of PageTransHuge() so the BUILD_BUG() is eliminated if THP are disabled. The next patch replaces that test with folio_test_large() which may be true, even when THP are disabled. However, if THP are disabled, we cannot split, so an unconditional return of false is appropriate. Link: https://lkml.kernel.org/r/20220504182857.4013401-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 246b648038096c6024a812aac354d27e8da987a2 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 vmscan: convert the activate_locked portion of shrink_page_list to folios This accounts the number of pages activated correctly for large folios. Link: https://lkml.kernel.org/r/20220504182857.4013401-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 5441d4902f969293b5bfe057e26038db1a8b342e Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 vmscan: move initialisation of mapping down Now that we don't interrogate the BDI for congestion, we can delay looking up the folio's mapping until we've got further through the function, reducing register pressure and saving a call to folio_mapping for folios we're adding to the swap cache. Link: https://lkml.kernel.org/r/20220504182857.4013401-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 64daa5d818ae3430f0785206b0af13ef528cb9ef Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:03 2022 -0700 vmscan: convert lazy freeing to folios Remove a hidden call to compound_head(), and account nr_pages instead of a single page. This matches the code in lru_lazyfree_fn() that accounts nr_pages to PGLAZYFREE. Link: https://lkml.kernel.org/r/20220504182857.4013401-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 0a36111c8c20b2edc7c83f084bdba2be9d42c1e9 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:02 2022 -0700 vmscan: convert page buffer handling to use folios This mostly just removes calls to compound_head() although nr_reclaimed should be incremented by the number of pages, not just 1. Link: https://lkml.kernel.org/r/20220504182857.4013401-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 49bd2bf9679f4a5b30236546fca61e66b989ce96 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:02 2022 -0700 vmscan: convert dirty page handling to folios Mostly this just eliminates calls to compound_head(), but NR_VMSCAN_IMMEDIATE was being incremented by 1 instead of by nr_pages. Link: https://lkml.kernel.org/r/20220504182857.4013401-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 09c02e56327bdaf9cdbb2742a35fb8c6a6f9a6c7 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:02 2022 -0700 swap: convert add_to_swap() to take a folio The only caller already has a folio available, so this saves a conversion. Also convert the return type to boolean. Link: https://lkml.kernel.org/r/20220504182857.4013401-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit e2e3fdc7d4afdb8e7ba981eba7827993f2d390a8 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:02 2022 -0700 swap: turn get_swap_page() into folio_alloc_swap() This removes an assumption that a large folio is HPAGE_PMD_NR pages in size. Link: https://lkml.kernel.org/r/20220504182857.4013401-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit d33e4e1412c8b618f5f2f251ab9ddcfdf9f4adf3 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:02 2022 -0700 vmscan: convert the writeback handling in shrink_page_list() to folios Slightly more efficient due to fewer calls to compound_head(). Link: https://lkml.kernel.org/r/20220504182857.4013401-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 1bee2c1677bcb57dadd374cafb59be86ad1a1a82 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:01 2022 -0700 vmscan: use folio_mapped() in shrink_page_list() Remove some legacy function calls. Link: https://lkml.kernel.org/r/20220504182857.4013401-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit adf88aa8ea7ff143825a2a8a7193f92e0e6fc79b Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:01 2022 -0700 mm: remove alloc_pages_vma() All callers have now been converted to use vma_alloc_folio(), so convert the body of alloc_pages_vma() to allocate folios instead. Link: https://lkml.kernel.org/r/20220504182857.4013401-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit f9c668d281aa20e38c9bda3b7b0adeb8891aa15e Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:01 2022 -0700 alpha: fix alloc_zeroed_user_highpage_movable() Due to a typo, the final argument to alloc_page_vma() didn't refer to a real variable. This only affected CONFIG_NUMA, which was marked BROKEN in 2006 and removed from alpha in 2021. Found due to a refactoring patch. Link: https://lkml.kernel.org/r/20220504182857.4013401-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reported-by: kernel test robot Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit cb196ee1ef390bea17eb9dc81039abad9b3627ca Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:01 2022 -0700 mm/huge_memory: convert do_huge_pmd_anonymous_page() to use vma_alloc_folio() Remove the use of this old API, eliminating a call to prep_transhuge_page(). Link: https://lkml.kernel.org/r/20220504182857.4013401-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit dfe98499ef288ac730662a70110bcadaa67c0ee0 Author: Matthew Wilcox (Oracle) Date: Thu May 12 20:23:01 2022 -0700 shmem: convert shmem_alloc_hugepage() to use vma_alloc_folio() Patch series "Folio patches for 5.19", v2. This patch (of 26): For now, return the head page of the folio, but remove use of the old alloc_pages_vma() API. Link: https://lkml.kernel.org/r/20220504182857.4013401-1-willy@infradead.org Link: https://lkml.kernel.org/r/20220504182857.4013401-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Zi Yan Signed-off-by: Andrew Morton commit 54943a1a4d2a3fed23d31e96a91aa9d18ea74500 Author: Wan Jiabing Date: Thu May 12 20:23:00 2022 -0700 mm/shmem: remove duplicate include in memory.c Fix following checkincludes.pl warning: mm/memory.c: linux/mm_inline.h is included more than once. The include is in line 44. Remove the duplicated here. Link: https://lkml.kernel.org/r/20220427064717.803019-1-wanjiabing@vivo.com Signed-off-by: Wan Jiabing Signed-off-by: Andrew Morton commit ed657e5568c5fc877c517b654d65fbdaeb628539 Author: Wei Yang Date: Thu May 12 20:23:00 2022 -0700 mm/vmscan: don't use NUMA_NO_NODE as indicator of page on different node Now we are sure there is at least one page on page_list, so it is safe to get the nid of it. This means it is not necessary to use NUMA_NO_NODE as an indicator for the beginning of iteration or a page on different node. Link: https://lkml.kernel.org/r/20220429014426.29223-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Minchan Kim Signed-off-by: Andrew Morton commit 1ae65e2749b0a3d236fc17d0eca5ea5f6f2c0032 Author: Wei Yang Date: Thu May 12 20:23:00 2022 -0700 mm/vmscan: filter empty page_list at the beginning node_page_list would always be !empty on finishing the loop, except page_list is empty. Let's handle empty page_list before doing any real work including touching PF_MEMALLOC flag. Link: https://lkml.kernel.org/r/20220429014426.29223-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Minchan Kim Signed-off-by: Andrew Morton commit f19a27e399c4354b91d608dd77f33877f613224a Author: Miaohe Lin Date: Thu May 12 20:23:00 2022 -0700 mm/vmscan: use helper folio_is_file_lru() Use helper folio_is_file_lru() to check whether folio is file lru. Minor readability improvement. [linmiaohe@huawei.com: use folio_is_file_lru()] Link: https://lkml.kernel.org/r/20220428105802.21389-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220425111232.23182-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Christoph Hellwig Cc: Huang, Ying Cc: Joonsoo Kim Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 4355e4b265ccb55dd6625b82f0e2016f42f2956c Author: Miaohe Lin Date: Thu May 12 20:23:00 2022 -0700 mm/vmscan: remove obsolete comment in kswapd_run Since commit 6b700b5b3c59 ("mm/vmscan.c: remove cpu online notification for now"), cpu online notification is removed. So kswapd won't move to proper cpus if cpus are hot-added. Remove this obsolete comment. Link: https://lkml.kernel.org/r/20220425111232.23182-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Christoph Hellwig Cc: Huang, Ying Cc: Joonsoo Kim Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 9aafcffc18785fcdd9295640eb2ed927960b31a1 Author: Miaohe Lin Date: Thu May 12 20:23:00 2022 -0700 mm/vmscan: take all base pages of THP into account when race with speculative reference If the page has buffers, shrink_page_list will try to free the buffer mappings associated with the page and try to free the page as well. In the rare race with speculative reference, the page will be freed shortly by speculative reference. But nr_reclaimed is not incremented correctly when we come across the THP. We need to account all the base pages in this case. Link: https://lkml.kernel.org/r/20220425111232.23182-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Christoph Hellwig Cc: Huang, Ying Cc: Joonsoo Kim Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 1fe47c0beb2df2739b07b8e051425b6400abce5b Author: Miaohe Lin Date: Thu May 12 20:22:59 2022 -0700 mm/vmscan: introduce helper function reclaim_page_list() Introduce helper function reclaim_page_list() to eliminate the duplicated code of doing shrink_page_list() and putback_lru_page. Also we can separate node reclaim from node page list operation this way. No functional change intended. Link: https://lkml.kernel.org/r/20220425111232.23182-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Christoph Hellwig Cc: Huang, Ying Cc: Joonsoo Kim Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 32a331a72f3eec30f65fd929aeb4dfc514eca28f Author: Miaohe Lin Date: Thu May 12 20:22:59 2022 -0700 mm/vmscan: add a comment about MADV_FREE pages check in folio_check_dirty_writeback Patch series "A few cleanup and fixup patches for vmscan This series contains a few patches to remove obsolete comment, introduce helper to remove duplicated code and so no. Also we take all base pages of THP into account in rare race condition. More details can be found in the respective changelogs. This patch (of 6): The MADV_FREE pages check in folio_check_dirty_writeback is a bit hard to follow. Add a comment to make the code clear. Link: https://lkml.kernel.org/r/20220425111232.23182-2-linmiaohe@huawei.com Suggested-by: Huang, Ying Signed-off-by: Miaohe Lin Reviewed-by: Christoph Hellwig Reviewed-by: Oscar Salvador Cc: Joonsoo Kim Signed-off-by: Andrew Morton commit 048f6e1a427ee9cddf62f9b3766372c69846fa4f Author: Wei Yang Date: Thu May 12 20:22:59 2022 -0700 mm/vmscan: not necessary to re-init the list for each iteration node_page_list is defined with LIST_HEAD and be cleaned until list_empty. So it is not necessary to re-init it again. [akpm@linux-foundation.org: remove unneeded braces] Link: https://lkml.kernel.org/r/20220426021743.21007-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Signed-off-by: Andrew Morton commit 717aeab42943efa7cfa876b3b687c6ff36eae867 Author: Jagdish Gediya Date: Thu May 12 20:22:59 2022 -0700 mm: convert sysfs input to bool using kstrtobool() Sysfs input conversion to corrosponding bool value e.g. "false" or "0" to false, "true" or "1" to true are currently handled through strncmp at multiple places. Use kstrtobool() to convert sysfs input to bool value. [akpm@linux-foundation.org: propagate kstrtobool() return value, per Andy] Link: https://lkml.kernel.org/r/20220426180203.70782-2-jvgediya@linux.ibm.com Signed-off-by: Jagdish Gediya Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Andy Shevchenko Cc: Alexey Dobriyan Cc: Dave Hansen Cc: "Huang, Ying" Cc: Jonathan Cameron Cc: Petr Mladek Cc: Richard Fitzgerald Signed-off-by: Andrew Morton commit 0d6ea3ac94ca77c5273b064524ac5079312052a0 Author: Jagdish Gediya Date: Thu May 12 20:22:59 2022 -0700 lib/kstrtox.c: add "false"/"true" support to kstrtobool() At many places in kernel, It is necessary to convert sysfs input to corresponding bool value e.g. "false" or "0" need to be converted to bool false, "true" or "1" need to be converted to bool true, places where such conversion is needed currently check the input string manually, kstrtobool() can be utilized at such places but currently it doesn't have support to accept "false"/"true". Add support to accept "false"/"true" as valid string in kstrtobool(). [akpm@linux-foundation.org: undo s/iff/if/, per Matthew] Link: https://lkml.kernel.org/r/20220426180203.70782-1-jvgediya@linux.ibm.com Signed-off-by: Jagdish Gediya Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Andy Shevchenko Cc: "Huang, Ying" Cc: Dave Hansen Cc: Jonathan Cameron Cc: Alexey Dobriyan Cc: Richard Fitzgerald Cc: Petr Mladek Signed-off-by: Andrew Morton commit d8ff6fde8e88d801b62328883680c202510ed518 Author: Miaohe Lin Date: Thu May 12 20:22:58 2022 -0700 mm/vmscan: take min_slab_pages into account when try to call shrink_node Since commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from shrink_zone()"), slab reclaim and lru page reclaim are done together in the shrink_node. So we should take min_slab_pages into account when try to call shrink_node. Link: https://lkml.kernel.org/r/20220425112118.20924-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Huang Ying Cc: Christoph Hellwig Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 448b8ec3bf115b38c82c31393a1debab0e0692c5 Author: Zi Yan Date: Thu May 12 20:22:58 2022 -0700 drivers: virtio_mem: use pageblock size as the minimum virtio_mem size. alloc_contig_range() now only needs to be aligned to pageblock_nr_pages, drop virtio_mem size requirement that it needs to be MAX_ORDER_NR_PAGES. Link: https://lkml.kernel.org/r/20220425143118.2850746-7-zi.yan@sent.com Signed-off-by: Zi Yan Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: kernel test robot Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 11ac3e87ce09c27f4587a8c4fe0829d814021a82 Author: Zi Yan Date: Thu May 12 20:22:58 2022 -0700 mm: cma: use pageblock_order as the single alignment Now alloc_contig_range() works at pageblock granularity. Change CMA allocation, which uses alloc_contig_range(), to use pageblock_nr_pages alignment. Link: https://lkml.kernel.org/r/20220425143118.2850746-6-zi.yan@sent.com Signed-off-by: Zi Yan Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: kernel test robot Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 6e263fff1de48fcd97b680b54cd8d1695fc3c776 Author: Zi Yan Date: Thu May 12 20:22:58 2022 -0700 mm: page_isolation: enable arbitrary range page isolation. Now start_isolate_page_range() is ready to handle arbitrary range isolation, so move the alignment check/adjustment into the function body. Do the same for its counterpart undo_isolate_page_range(). alloc_contig_range(), its caller, can pass an arbitrary range instead of a MAX_ORDER_NR_PAGES aligned one. Link: https://lkml.kernel.org/r/20220425143118.2850746-5-zi.yan@sent.com Signed-off-by: Zi Yan Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: kernel test robot Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b2c9e2fbba32539626522b6aed30d1dde7b7e971 Author: Zi Yan Date: Thu May 12 20:22:58 2022 -0700 mm: make alloc_contig_range work at pageblock granularity alloc_contig_range() worked at MAX_ORDER_NR_PAGES granularity to avoid merging pageblocks with different migratetypes. It might unnecessarily convert extra pageblocks at the beginning and at the end of the range. Change alloc_contig_range() to work at pageblock granularity. Special handling is needed for free pages and in-use pages across the boundaries of the range specified by alloc_contig_range(). Because these= Partially isolated pages causes free page accounting issues. The free pages will be split and freed into separate migratetype lists; the in-use= Pages will be migrated then the freed pages will be handled in the aforementioned way. [ziy@nvidia.com: fix deadlock/crash] Link: https://lkml.kernel.org/r/23A7297E-6C84-4138-A9FE-3598234004E6@nvidia.com Link: https://lkml.kernel.org/r/20220425143118.2850746-4-zi.yan@sent.com Signed-off-by: Zi Yan Reported-by: kernel test robot Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 844fbae63e468e32e3a3970868602a4bb658aff9 Author: Zi Yan Date: Thu May 12 20:22:58 2022 -0700 mm: page_isolation: check specified range for unmovable pages Enable set_migratetype_isolate() to check specified range for unmovable pages during isolation to prepare arbitrary range page isolation. The functionality will take effect in upcoming commits by adjusting the callers of start_isolate_page_range(), which uses set_migratetype_isolate(). For example, alloc_contig_range(), which calls start_isolate_page_range(), accepts unaligned ranges, but because page isolation is currently done at MAX_ORDER_NR_PAEGS granularity, pages that are out of the specified range but withint MAX_ORDER_NR_PAEGS alignment might be attempted for isolation and the failure of isolating these unrelated pages fails the whole operation undesirably. Link: https://lkml.kernel.org/r/20220425143118.2850746-3-zi.yan@sent.com Signed-off-by: Zi Yan Cc: Christophe Leroy Cc: David Hildenbrand Cc: Eric Ren Cc: kernel test robot Cc: Mel Gorman Cc: Mike Rapoport Cc: Minchan Kim Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b48d8a8e5ce53e3114a1ffe96563e3555b51d40b Author: Zi Yan Date: Thu May 12 20:22:57 2022 -0700 mm: page_isolation: move has_unmovable_pages() to mm/page_isolation.c Patch series "Use pageblock_order for cma and alloc_contig_range alignment", v11. This patchset tries to remove the MAX_ORDER-1 alignment requirement for CMA and alloc_contig_range(). It prepares for my upcoming changes to make MAX_ORDER adjustable at boot time[1]. The MAX_ORDER - 1 alignment requirement comes from that alloc_contig_range() isolates pageblocks to remove free memory from buddy allocator but isolating only a subset of pageblocks within a page spanning across multiple pageblocks causes free page accounting issues. Isolated page might not be put into the right free list, since the code assumes the migratetype of the first pageblock as the whole free page migratetype. This is based on the discussion at [2]. To remove the requirement, this patchset: 1. isolates pages at pageblock granularity instead of max(MAX_ORDER_NR_PAEGS, pageblock_nr_pages); 2. splits free pages across the specified range or migrates in-use pages across the specified range then splits the freed page to avoid free page accounting issues (it happens when multiple pageblocks within a single page have different migratetypes); 3. only checks unmovable pages within the range instead of MAX_ORDER - 1 aligned range during isolation to avoid alloc_contig_range() failure when pageblocks within a MAX_ORDER - 1 aligned range are allocated separately. 4. returns pages not in the range as it did before. One optimization might come later: 1. make MIGRATE_ISOLATE a separate bit to be able to restore the original migratetypes when isolation fails in the middle of the range. [1] https://lore.kernel.org/linux-mm/20210805190253.2795604-1-zi.yan@sent.com/ [2] https://lore.kernel.org/linux-mm/d19fb078-cb9b-f60f-e310-fdeea1b947d2@redhat.com/ This patch (of 6): has_unmovable_pages() is only used in mm/page_isolation.c. Move it from mm/page_alloc.c and make it static. Link: https://lkml.kernel.org/r/20220425143118.2850746-2-zi.yan@sent.com Signed-off-by: Zi Yan Reviewed-by: Oscar Salvador Reviewed-by: Mike Rapoport Acked-by: David Hildenbrand Cc: Vlastimil Babka Cc: Mel Gorman Cc: Eric Ren Cc: Christophe Leroy Cc: Minchan Kim Cc: kernel test robot Signed-off-by: Andrew Morton commit c1a31a2f7a9c08665f95a16c40b3551af43cb95c Author: David Vernet Date: Thu May 12 20:22:57 2022 -0700 cgroup: fix racy check in alloc_pagecache_max_30M() helper function alloc_pagecache_max_30M() in the cgroup memcg tests performs a 50MB pagecache allocation, which it expects to be capped at 30MB due to the calling process having a memory.high setting of 30MB. After the allocation, the function contains a check that verifies that MB(29) < memory.current <= MB(30). This check can actually fail non-deterministically. The testcases that use this function are test_memcg_high() and test_memcg_max(), which set memory.min and memory.max to 30MB respectively for the cgroup under test. The allocation can slightly exceed this number in both cases, and for memory.max, the process performing the allocation will not have the OOM killer invoked as it's performing a pagecache allocation. This patchset therefore updates the above check to instead use the verify_close() helper function. Link: https://lkml.kernel.org/r/20220423155619.3669555-6-void@manifault.com Signed-off-by: David Vernet Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Signed-off-by: Andrew Morton commit 830316807e0275146cbd5d2ae66fd338d0dfd09e Author: David Vernet Date: Thu May 12 20:22:57 2022 -0700 cgroup: remove racy check in test_memcg_sock() test_memcg_sock() in the cgroup memcg tests, verifies expected memory accounting for sockets. The test forks a process which functions as a TCP server, and sends large buffers back and forth between itself (as the TCP client) and the forked TCP server. While doing so, it verifies that memory.current and memory.stat.sock look correct. There is currently a check in tcp_client() which asserts memory.current >= memory.stat.sock. This check is racy, as between memory.current and memory.stat.sock being queried, a packet could come in which causes mem_cgroup_charge_skmem() to be invoked. This could cause memory.stat.sock to exceed memory.current. Reversing the order of querying doesn't address the problem either, as memory may be reclaimed between the two calls. Instead, this patch just removes that assertion altogether, and instead relies on the values_close() check that follows to validate the expected accounting. Link: https://lkml.kernel.org/r/20220423155619.3669555-5-void@manifault.com Signed-off-by: David Vernet Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Signed-off-by: Andrew Morton commit 72b1e03aa7255094d15752952a7e56c5f39b6e37 Author: David Vernet Date: Thu May 12 20:22:57 2022 -0700 cgroup: account for memory_localevents in test_memcg_oom_group_leaf_events() The test_memcg_oom_group_leaf_events() testcase in the cgroup memcg tests validates that processes in a group that perform allocations exceeding memory.oom.group are killed. It also validates that the memory.events.oom_kill events are properly propagated in this case. Commit 06e11c907ea4 ("kselftests: memcg: update the oom group leaf events test") fixed test_memcg_oom_group_leaf_events() to account for the fact that the memory.events.oom_kill events in a child cgroup is propagated up to its parent. This behavior can actually be configured by the memory_localevents mount option, so this patch updates the testcase to properly account for the possible presence of this mount option. Link: https://lkml.kernel.org/r/20220423155619.3669555-4-void@manifault.com Signed-off-by: David Vernet Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Signed-off-by: Andrew Morton commit cdc69458a5f3d4cf31372efd45fe92cec6b167e4 Author: David Vernet Date: Thu May 12 20:22:57 2022 -0700 cgroup: account for memory_recursiveprot in test_memcg_low() The test_memcg_low() testcase in test_memcontrol.c verifies the expected behavior of groups using the memory.low knob. Part of the testcase verifies that a group with memory.low that experiences reclaim due to memory pressure elsewhere in the system, observes memory.events.low events as a result of that reclaim. In commit 8a931f801340 ("mm: memcontrol: recursive memory.low protection"), the memory controller was updated to propagate memory.low and memory.min protection from a parent group to its children via a configurable memory_recursiveprot mount option. This unfortunately broke the memcg tests, which asserts that a sibling that experienced reclaim but had a memory.low value of 0, would not observe any memory.low events. This patch updates test_memcg_low() to account for the new behavior introduced by memory_recursiveprot. So as to make the test resilient to multiple configurations, the patch also adds a new proc_mount_contains() helper that checks for a string in /proc/mounts, and is used to toggle behavior based on whether the default memory_recursiveprot was present. Link: https://lkml.kernel.org/r/20220423155619.3669555-3-void@manifault.com Signed-off-by: David Vernet Acked-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Signed-off-by: Andrew Morton commit f0cdaa5687d3178f3759033a7ff8411720b61647 Author: David Vernet Date: Thu May 12 20:22:56 2022 -0700 cgroups: refactor children cgroups in memcg tests Patch series "Fix bugs in memcontroller cgroup tests", v2. tools/testing/selftests/cgroup/test_memcontrol.c contains a set of testcases which validate expected behavior of the cgroup memory controller. Roman Gushchin recently sent out a patchset that fixed a few issues in the test. This patchset continues that effort by fixing a few more issues that were causing non-deterministic failures in the suite. With this patchset, I'm unable to reproduce any more errors after running the tests in a continuous loop for many iterations. Before, I was able to reproduce at least one of the errors fixed in this patchset with just one or two runs. This patch (of 5): In test_memcg_min() and test_memcg_low(), there is an array of four sibling cgroups. All but one of these sibling groups does a 50MB allocation, and the group that does no allocation is the third of four in the array. This is not a problem per se, but makes it a bit tricky to do some assertions in test_memcg_low(), as we want to make assertions on the siblings based on whether or not they performed allocations. Having a static index before which all groups have performed an allocation makes this cleaner. This patch therefore reorders the sibling groups so that the group that performs no allocations is the last in the array. A follow-on patch will leverage this to fix a bug in the test that incorrectly asserts that a sibling group that had performed an allocation, but only had protection from its parent, will not observe any memory.events.low events during reclaim. Link: https://lkml.kernel.org/r/20220423155619.3669555-1-void@manifault.com Link: https://lkml.kernel.org/r/20220423155619.3669555-2-void@manifault.com Signed-off-by: David Vernet Acked-by: Roman Gushchin Cc: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 430529b5c631749329c61113703c7a9b6cf72973 Author: Peter Xu Date: Thu May 12 20:22:56 2022 -0700 mm/uffd: move USERFAULTFD configs into mm/ We used to have USERFAULTFD configs stored in init/. It makes sense as a start because that's the default place for storing syscall related configs. However userfaultfd evolved a bit in the past few years and some more config options were added. They're no longer related to syscalls and start to be not suitable to be kept in the init/ directory anymore, because they're pure mm concepts. But it's not ideal either to keep the userfaultfd configs separate from each other. Hence this patch moves the userfaultfd configs under init/ to be under mm/ so that we'll start to group all userfaultfd configs together. We do have quite a few examples of syscall related configs that are not put under init/Kconfig: FTRACE_SYSCALLS, SWAP, FILE_LOCKING, MEMFD_CREATE.. They all reside in the dir where they're more suitable for the concept. So it seems there's no restriction to keep the role of having syscall related CONFIG_* under init/ only. Link: https://lkml.kernel.org/r/20220420144823.35277-1-peterx@redhat.com Signed-off-by: Peter Xu Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen Signed-off-by: Andrew Morton commit 1bf0831383c6b372ff870d061ee62156635035c2 Author: Guo Zhengkui Date: Thu May 12 20:22:56 2022 -0700 userfaultfd/selftests: use swap() instead of open coding it Address the following coccicheck warning: tools/testing/selftests/vm/userfaultfd.c:1536:21-22: WARNING opportunity for swap(). tools/testing/selftests/vm/userfaultfd.c:1540:33-34: WARNING opportunity for swap(). by using swap() for the swapping of variable values and drop `tmp_area` that is not needed any more. `swap()` macro in userfaultfd.c is introduced in commit 681696862bc18 ("selftests: vm: remove dependecy from internal kernel macros") It has been tested with gcc (Debian 8.3.0-6) 8.3.0. Link: https://lkml.kernel.org/r/20220407123141.4998-1-guozhengkui@vivo.com Signed-off-by: Guo Zhengkui Reviewed-by: Muchun Song Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton commit c0eeeb02d9df878c71a457008900b650d94bd0d9 Author: Peter Xu Date: Thu May 12 20:22:56 2022 -0700 selftests/uffd: enable uffd-wp for shmem/hugetlbfs After we added support for shmem and hugetlbfs, we can turn uffd-wp test on always now. Link: https://lkml.kernel.org/r/20220405014932.15212-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 81e0f15f2ef6dad7ccb9c03d8e61ef7ded836b38 Author: Peter Xu Date: Thu May 12 20:22:56 2022 -0700 mm: enable PTE markers by default Enable PTE markers by default. On x86_64 it means it'll auto-enable PTE_MARKER_UFFD_WP as well. [peterx@redhat.com: hide PTE_MARKER option] Link: https://lkml.kernel.org/r/20220419202531.27415-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20220405014929.15158-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit b1f9e876862d8f7176299ec4fb2108bc1045cbc8 Author: Peter Xu Date: Thu May 12 20:22:56 2022 -0700 mm/uffd: enable write protection for shmem & hugetlbfs We've had all the necessary changes ready for both shmem and hugetlbfs. Turn on all the shmem/hugetlbfs switches for userfaultfd-wp. We can expand UFFD_API_RANGE_IOCTLS_BASIC with _UFFDIO_WRITEPROTECT too because all existing types now support write protection mode. Since vma_can_userfault() will be used elsewhere, move into userfaultfd_k.h. Link: https://lkml.kernel.org/r/20220405014926.15101-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 8e165e733bfa06edbcdbe491ef13b2bf1a3fa883 Author: Peter Xu Date: Thu May 12 20:22:55 2022 -0700 mm/pagemap: recognize uffd-wp bit for shmem/hugetlbfs This requires the pagemap code to be able to recognize the newly introduced swap special pte for uffd-wp, meanwhile the general case for hugetlb that we recently start to support. It should make pagemap uffd-wp support complete. Link: https://lkml.kernel.org/r/20220405014923.15047-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit deb4c93a9871082a7df6a99ca8fa48024665a71a Author: Peter Xu Date: Thu May 12 20:22:55 2022 -0700 mm/khugepaged: don't recycle vma pgtable if uffd-wp registered When we're trying to collapse a 2M huge shmem page, don't retract pgtable pmd page if it's registered with uffd-wp, because that pgtable could have pte markers installed. Recycling of that pgtable means we'll lose the pte markers. That could cause data loss for an uffd-wp enabled application on shmem. Instead of disabling khugepaged on these files, simply skip retracting these special VMAs, then the page cache can still be merged into a huge thp, and other mm/vma can still map the range of file with a huge thp when proper. Note that checking VM_UFFD_WP needs to be done with mmap_sem held for write, that avoids race like: khugepaged user thread ========== =========== check VM_UFFD_WP, not set UFFDIO_REGISTER with uffd-wp on shmem wr-protect some pages (install markers) take mmap_sem write lock erase pmd and free pmd page --> pte markers are dropped unnoticed! Link: https://lkml.kernel.org/r/20220405014921.14994-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit bc70fbf269fdff410b0b6d75c3770b9f59117b90 Author: Peter Xu Date: Thu May 12 20:22:55 2022 -0700 mm/hugetlb: handle uffd-wp during fork() Firstly, we'll need to pass in dst_vma into copy_hugetlb_page_range() because for uffd-wp it's the dst vma that matters on deciding how we should treat uffd-wp protected ptes. We should recognize pte markers during fork and do the pte copy if needed. [lkp@intel.com: vma_needs_copy can be static] Link: https://lkml.kernel.org/r/Ylb0CGeFJlc4EzLk@7ec4ff11d4ae Link: https://lkml.kernel.org/r/20220405014918.14932-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 05e90bd05eea33fc77d6b11e121e2da01fee379f Author: Peter Xu Date: Thu May 12 20:22:55 2022 -0700 mm/hugetlb: only drop uffd-wp special pte if required As with shmem uffd-wp special ptes, only drop the uffd-wp special swap pte if unmapping an entire vma or synchronized such that faults can not race with the unmap operation. This requires passing zap_flags all the way to the lowest level hugetlb unmap routine: __unmap_hugepage_range. In general, unmap calls originated in hugetlbfs code will pass the ZAP_FLAG_DROP_MARKER flag as synchronization is in place to prevent faults. The exception is hole punch which will first unmap without any synchronization. Later when hole punch actually removes the page from the file, it will check to see if there was a subsequent fault and if so take the hugetlb fault mutex while unmapping again. This second unmap will pass in ZAP_FLAG_DROP_MARKER. The justification of "whether to apply ZAP_FLAG_DROP_MARKER flag when unmap a hugetlb range" is (IMHO): we should never reach a state when a page fault could errornously fault in a page-cache page that was wr-protected to be writable, even in an extremely short period. That could happen if e.g. we pass ZAP_FLAG_DROP_MARKER when hugetlbfs_punch_hole() calls hugetlb_vmdelete_list(), because if a page faults after that call and before remove_inode_hugepages() is executed, the page cache can be mapped writable again in the small racy window, that can cause unexpected data overwritten. [peterx@redhat.com: fix sparse warning] Link: https://lkml.kernel.org/r/Ylcdw8I1L5iAoWhb@xz-m1.local [akpm@linux-foundation.org: move zap_flags_t from mm.h to mm_types.h to fix build issues] Link: https://lkml.kernel.org/r/20220405014915.14873-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 60dfaad65aa97fb6755b9798a6b3c9e79bcd5930 Author: Peter Xu Date: Thu May 12 20:22:55 2022 -0700 mm/hugetlb: allow uffd wr-protect none ptes Teach hugetlbfs code to wr-protect none ptes just in case the page cache existed for that pte. Meanwhile we also need to be able to recognize a uffd-wp marker pte and remove it for uffd_wp_resolve. Since at it, introduce a variable "psize" to replace all references to the huge page size fetcher. Link: https://lkml.kernel.org/r/20220405014912.14815-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit c64e912c865a1a0df1c312bca946985eb095afa5 Author: Peter Xu Date: Thu May 12 20:22:54 2022 -0700 mm/hugetlb: handle pte markers in page faults Allow hugetlb code to handle pte markers just like none ptes. It's mostly there, we just need to make sure we don't assume hugetlb_no_page() only handles none pte, so when detecting pte change we should use pte_same() rather than pte_none(). We need to pass in the old_pte to do the comparison. Check the original pte to see whether it's a pte marker, if it is, we should recover uffd-wp bit on the new pte to be installed, so that the next write will be trapped by uffd. Link: https://lkml.kernel.org/r/20220405014909.14761-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 5a90d5a103c2badfcf12d48e2fec350969e3f486 Author: Peter Xu Date: Thu May 12 20:22:54 2022 -0700 mm/hugetlb: handle UFFDIO_WRITEPROTECT This starts from passing cp_flags into hugetlb_change_protection() so hugetlb will be able to handle MM_CP_UFFD_WP[_RESOLVE] requests. huge_pte_clear_uffd_wp() is introduced to handle the case where the UFFDIO_WRITEPROTECT is requested upon migrating huge page entries. Link: https://lkml.kernel.org/r/20220405014906.14708-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 6041c69179034278ac6d57f90a55b09e588f4b90 Author: Peter Xu Date: Thu May 12 20:22:54 2022 -0700 mm/hugetlb: take care of UFFDIO_COPY_MODE_WP Pass the wp_copy variable into hugetlb_mcopy_atomic_pte() thoughout the stack. Apply the UFFD_WP bit if UFFDIO_COPY_MODE_WP is with UFFDIO_COPY. Hugetlb pages are only managed by hugetlbfs, so we're safe even without setting dirty bit in the huge pte if the page is installed as read-only. However we'd better still keep the dirty bit set for a read-only UFFDIO_COPY pte (when UFFDIO_COPY_MODE_WP bit is set), not only to match what we do with shmem, but also because the page does contain dirty data that the kernel just copied from the userspace. Link: https://lkml.kernel.org/r/20220405014904.14643-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 166f3ecc0daf0c164bd7e2f780dbcd1e213ac95f Author: Peter Xu Date: Thu May 12 20:22:54 2022 -0700 mm/hugetlb: hook page faults for uffd write protection Hook up hugetlbfs_fault() with the capability to handle userfaultfd-wp faults. We do this slightly earlier than hugetlb_cow() so that we can avoid taking some extra locks that we definitely don't need. Link: https://lkml.kernel.org/r/20220405014901.14590-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Mike Kravetz Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 229f3fa778c50edf12b34bd91b2025645a11bb94 Author: Peter Xu Date: Thu May 12 20:22:54 2022 -0700 mm/hugetlb: introduce huge pte version of uffd-wp helpers They will be used in the follow up patches to either check/set/clear uffd-wp bit of a huge pte. So far it reuses all the small pte helpers. Archs can overwrite these versions when necessary (with __HAVE_ARCH_HUGE_PTE_UFFD_WP* macros) in the future. Link: https://lkml.kernel.org/r/20220405014858.14531-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit c56d1b62cce83695823c13e52f73e92eb568c0c1 Author: Peter Xu Date: Thu May 12 20:22:53 2022 -0700 mm/shmem: handle uffd-wp during fork() Normally we skip copy page when fork() for VM_SHARED shmem, but we can't skip it anymore if uffd-wp is enabled on dst vma. This should only happen when the src uffd has UFFD_FEATURE_EVENT_FORK enabled on uffd-wp shmem vma, so that VM_UFFD_WP will be propagated onto dst vma too, then we should copy the pgtables with uffd-wp bit and pte markers, because these information will be lost otherwise. Since the condition checks will become even more complicated for deciding "whether a vma needs to copy the pgtable during fork()", introduce a helper vma_needs_copy() for it, so everything will be clearer. Link: https://lkml.kernel.org/r/20220405014855.14468-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 019c2d8b959c9c18b04572f9c26c46be9f5df093 Author: Peter Xu Date: Thu May 12 20:22:53 2022 -0700 mm/shmem: allows file-back mem to be uffd wr-protected on thps We don't have "huge" version of pte markers, instead when necessary we split the thp. However split the thp is not enough, because file-backed thp is handled totally differently comparing to anonymous thps: rather than doing a real split, the thp pmd will simply got cleared in __split_huge_pmd_locked(). That is not enough if e.g. when there is a thp covers range [0, 2M) but we want to wr-protect small page resides in [4K, 8K) range, because after __split_huge_pmd() returns, there will be a none pmd, and change_pmd_range() will just skip it right after the split. Here we leverage the previously introduced change_pmd_prepare() macro so that we'll populate the pmd with a pgtable page after the pmd split (in which process the pmd will be cleared for cases like shmem). Then change_pte_range() will do all the rest for us by installing the uffd-wp pte marker at any none pte that we'd like to wr-protect. Link: https://lkml.kernel.org/r/20220405014852.14413-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit fe2567eb552194e5b7a3c61bed5574658f859a11 Author: Peter Xu Date: Thu May 12 20:22:53 2022 -0700 mm/shmem: allow uffd wr-protect none pte for file-backed mem File-backed memory differs from anonymous memory in that even if the pte is missing, the data could still resides either in the file or in page/swap cache. So when wr-protect a pte, we need to consider none ptes too. We do that by installing the uffd-wp pte markers when necessary. So when there's a future write to the pte, the fault handler will go the special path to first fault-in the page as read-only, then report to userfaultfd server with the wr-protect message. On the other hand, when unprotecting a page, it's also possible that the pte got unmapped but replaced by the special uffd-wp marker. Then we'll need to be able to recover from a uffd-wp pte marker into a none pte, so that the next access to the page will fault in correctly as usual when accessed the next time. Special care needs to be taken throughout the change_protection_range() process. Since now we allow user to wr-protect a none pte, we need to be able to pre-populate the page table entries if we see (!anonymous && MM_CP_UFFD_WP) requests, otherwise change_protection_range() will always skip when the pgtable entry does not exist. For example, the pgtable can be missing for a whole chunk of 2M pmd, but the page cache can exist for the 2M range. When we want to wr-protect one 4K page within the 2M pmd range, we need to pre-populate the pgtable and install the pte marker showing that we want to get a message and block the thread when the page cache of that 4K page is written. Without pre-populating the pmd, change_protection() will simply skip that whole pmd. Note that this patch only covers the small pages (pte level) but not covering any of the transparent huge pages yet. That will be done later, and this patch will be a preparation for it too. Link: https://lkml.kernel.org/r/20220405014850.14352-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 999dad824c39ed14dee7c4412aae531ba9e74a90 Author: Peter Xu Date: Thu May 12 20:22:53 2022 -0700 mm/shmem: persist uffd-wp bit across zapping for file-backed File-backed memory is prone to being unmapped at any time. It means all information in the pte will be dropped, including the uffd-wp flag. To persist the uffd-wp flag, we'll use the pte markers. This patch teaches the zap code to understand uffd-wp and know when to keep or drop the uffd-wp bit. Add a new flag ZAP_FLAG_DROP_MARKER and set it in zap_details when we don't want to persist such an information, for example, when destroying the whole vma, or punching a hole in a shmem file. For the rest cases we should never drop the uffd-wp bit, or the wr-protect information will get lost. The new ZAP_FLAG_DROP_MARKER needs to be put into mm.h rather than memory.c because it'll be further referenced in hugetlb files later. Link: https://lkml.kernel.org/r/20220405014847.14295-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 9c28a205c06123b9f0a0c4d819ece9f5f552d004 Author: Peter Xu Date: Thu May 12 20:22:53 2022 -0700 mm/shmem: handle uffd-wp special pte in page fault handler File-backed memories are prone to unmap/swap so the ptes are always unstable, because they can be easily faulted back later using the page cache. This could lead to uffd-wp getting lost when unmapping or swapping out such memory. One example is shmem. PTE markers are needed to store those information. This patch prepares it by handling uffd-wp pte markers first it is applied elsewhere, so that the page fault handler can recognize uffd-wp pte markers. The handling of uffd-wp pte markers is similar to missing fault, it's just that we'll handle this "missing fault" when we see the pte markers, meanwhile we need to make sure the marker information is kept during processing the fault. This is a slow path of uffd-wp handling, because zapping of wr-protected shmem ptes should be rare. So far it should only trigger in two conditions: (1) When trying to punch holes in shmem_fallocate(), there is an optimization to zap the pgtables before evicting the page. (2) When swapping out shmem pages. Because of this, the page fault handling is simplifed too by not sending the wr-protect message in the 1st page fault, instead the page will be installed read-only, so the uffd-wp message will be generated in the next fault, which will trigger the do_wp_page() path of general uffd-wp handling. Disable fault-around for all uffd-wp registered ranges for extra safety just like uffd-minor fault, and clean the code up. Link: https://lkml.kernel.org/r/20220405014844.14239-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 8ee79edff6d3b43b2d0c1e41f92b32e128988b22 Author: Peter Xu Date: Thu May 12 20:22:52 2022 -0700 mm/shmem: take care of UFFDIO_COPY_MODE_WP Pass wp_copy into shmem_mfill_atomic_pte() through the stack, then apply the UFFD_WP bit properly when the UFFDIO_COPY on shmem is with UFFDIO_COPY_MODE_WP. wp_copy lands mfill_atomic_install_pte() finally. Note: we must do pte_wrprotect() if !writable in mfill_atomic_install_pte(), as mk_pte() could return a writable pte (e.g., when VM_SHARED on a shmem file). Link: https://lkml.kernel.org/r/20220405014841.14185-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 1db9dbc2ef05205bf1022f9b14aa29b1dd8efd7e Author: Peter Xu Date: Thu May 12 20:22:52 2022 -0700 mm/uffd: PTE_MARKER_UFFD_WP This patch introduces the 1st user of pte marker: the uffd-wp marker. When the pte marker is installed with the uffd-wp bit set, it means this pte was wr-protected by uffd. We will use this special pte to arm the ptes that got either unmapped or swapped out for a file-backed region that was previously wr-protected. This special pte could trigger a page fault just like swap entries. This idea is greatly inspired by Hugh and Andrea in the discussion, which is referenced in the links below. Some helpers are introduced to detect whether a swap pte is uffd wr-protected. After the pte marker introduced, one swap pte can be wr-protected in two forms: either it is a normal swap pte and it has _PAGE_SWP_UFFD_WP set, or it's a pte marker that has PTE_MARKER_UFFD_WP set. [peterx@redhat.com: fixup] Link: https://lkml.kernel.org/r/YkzKiM8tI4+qOfXF@xz-m1.local Link: https://lore.kernel.org/lkml/20201126222359.8120-1-peterx@redhat.com/ Link: https://lore.kernel.org/lkml/20201130230603.46187-1-peterx@redhat.com/ Link: https://lkml.kernel.org/r/20220405014838.14131-1-peterx@redhat.com Signed-off-by: Peter Xu Suggested-by: Andrea Arcangeli Suggested-by: Hugh Dickins Cc: Alistair Popple Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit f46f2adecdcc1ba0799383e67fe98f65f41fea5c Author: Peter Xu Date: Thu May 12 20:22:52 2022 -0700 mm: check against orig_pte for finish_fault() This patch allows do_fault() to trigger on !pte_none() cases too. This prepares for the pte markers to be handled by do_fault() just like none pte. To achieve this, instead of unconditionally check against pte_none() in finish_fault(), we may hit the case that the orig_pte was some pte marker so what we want to do is to replace the pte marker with some valid pte entry. Then if orig_pte was set we'd want to check the current *pte (under pgtable lock) against orig_pte rather than none pte. Right now there's no solid way to safely reference orig_pte because when pmd is not allocated handle_pte_fault() will not initialize orig_pte, so it's not safe to reference it. There's another solution proposed before this patch to do pte_clear() for vmf->orig_pte for pmd==NULL case, however it turns out it'll break arm32 because arm32 could have assumption that pte_t* pointer will always reside on a real ram32 pgtable, not any kernel stack variable. To solve this, we add a new flag FAULT_FLAG_ORIG_PTE_VALID, and it'll be set along with orig_pte when there is valid orig_pte, or it'll be cleared when orig_pte was not initialized. It'll be updated every time we call handle_pte_fault(), so e.g. if a page fault retry happened it'll be properly updated along with orig_pte. [1] https://lore.kernel.org/lkml/710c48c9-406d-e4c5-a394-10501b951316@samsung.com/ [akpm@linux-foundation.org: coding-style cleanups] [peterx@redhat.com: fix crash reported by Marek] Link: https://lkml.kernel.org/r/Ylb9rXJyPm8/ao8f@xz-m1.local Link: https://lkml.kernel.org/r/20220405014836.14077-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Alistair Popple Tested-by: Marek Szyprowski Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 5c041f5d1f23d3a172dd0db3215634c484b4acd6 Author: Peter Xu Date: Thu May 12 20:22:52 2022 -0700 mm: teach core mm about pte markers This patch still does not use pte marker in any way, however it teaches the core mm about the pte marker idea. For example, handle_pte_marker() is introduced that will parse and handle all the pte marker faults. Many of the places are more about commenting it up - so that we know there's the possibility of pte marker showing up, and why we don't need special code for the cases. [peterx@redhat.com: userfaultfd.c needs swapops.h] Link: https://lkml.kernel.org/r/YmRlVj3cdizYJsr0@xz-m1.local Link: https://lkml.kernel.org/r/20220405014833.14015-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Alistair Popple Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Hugh Dickins Cc: Jerome Glisse Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Signed-off-by: Andrew Morton commit 679d103319101800567c8bb7e341b5eee39f6685 Author: Peter Xu Date: Thu May 12 20:22:52 2022 -0700 mm: introduce PTE_MARKER swap entry Patch series "userfaultfd-wp: Support shmem and hugetlbfs", v8. Overview ======== Userfaultfd-wp anonymous support was merged two years ago. There're quite a few applications that started to leverage this capability either to take snapshots for user-app memory, or use it for full user controled swapping. This series tries to complete the feature for uffd-wp so as to cover all the RAM-based memory types. So far uffd-wp is the only missing piece of the rest features (uffd-missing & uffd-minor mode). One major reason to do so is that anonymous pages are sometimes not satisfying the need of applications, and there're growing users of either shmem and hugetlbfs for either sharing purpose (e.g., sharing guest mem between hypervisor process and device emulation process, shmem local live migration for upgrades), or for performance on tlb hits. All these mean that if a uffd-wp app wants to switch to any of the memory types, it'll stop working. I think it's worthwhile to have the kernel to cover all these aspects. This series chose to protect pages in pte level not page level. One major reason is safety. I have no idea how we could make it safe if any of the uffd-privileged app can wr-protect a page that any other application can use. It means this app can block any process potentially for any time it wants. The other reason is that it aligns very well with not only the anonymous uffd-wp solution, but also uffd as a whole. For example, userfaultfd is implemented fundamentally based on VMAs. We set flags to VMAs showing the status of uffd tracking. For another per-page based protection solution, it'll be crossing the fundation line on VMA-based, and it could simply be too far away already from what's called userfaultfd. PTE markers =========== The patchset is based on the idea called PTE markers. It was discussed in one of the mm alignment sessions, proposed starting from v6, and this is the 2nd version of it using PTE marker idea. PTE marker is a new type of swap entry that is ony applicable to file backed memories like shmem and hugetlbfs. It's used to persist some pte-level information even if the original present ptes in pgtable are zapped. Logically pte markers can store more than uffd-wp information, but so far only one bit is used for uffd-wp purpose. When the pte marker is installed with uffd-wp bit set, it means this pte is wr-protected by uffd. It solves the problem on e.g. file-backed memory mapped ptes got zapped due to any reason (e.g. thp split, or swapped out), we can still keep the wr-protect information in the ptes. Then when the page fault triggers again, we'll know this pte is wr-protected so we can treat the pte the same as a normal uffd wr-protected pte. The extra information is encoded into the swap entry, or swp_offset to be explicit, with the swp_type being PTE_MARKER. So far uffd-wp only uses one bit out of the swap entry, the rest bits of swp_offset are still reserved for other purposes. There're two configs to enable/disable PTE markers: CONFIG_PTE_MARKER CONFIG_PTE_MARKER_UFFD_WP We can set !PTE_MARKER to completely disable all the PTE markers, along with uffd-wp support. I made two config so we can also enable PTE marker but disable uffd-wp file-backed for other purposes. At the end of current series, I'll enable CONFIG_PTE_MARKER by default, but that patch is standalone and if anyone worries about having it by default, we can also consider turn it off by dropping that oneliner patch. So far I don't see a huge risk of doing so, so I kept that patch. In most cases, PTE markers should be treated as none ptes. It is because that unlike most of the other swap entry types, there's no PFN or block offset information encoded into PTE markers but some extra well-defined bits showing the status of the pte. These bits should only be used as extra data when servicing an upcoming page fault, and then we behave as if it's a none pte. I did spend a lot of time observing all the pte_none() users this time. It is indeed a challenge because there're a lot, and I hope I didn't miss a single of them when we should take care of pte markers. Luckily, I don't think it'll need to be considered in many cases, for example: boot code, arch code (especially non-x86), kernel-only page handlings (e.g. CPA), or device driver codes when we're tackling with pure PFN mappings. I introduced pte_none_mostly() in this series when we need to handle pte markers the same as none pte, the "mostly" is the other way to write "either none pte or a pte marker". I didn't replace pte_none() to cover pte markers for below reasons: - Very rare case of pte_none() callers will handle pte markers. E.g., all the kernel pages do not require knowledge of pte markers. So we don't pollute the major use cases. - Unconditionally change pte_none() semantics could confuse people, because pte_none() existed for so long a time. - Unconditionally change pte_none() semantics could make pte_none() slower even if in many cases pte markers do not exist. - There're cases where we'd like to handle pte markers differntly from pte_none(), so a full replace is also impossible. E.g. khugepaged should still treat pte markers as normal swap ptes rather than none ptes, because pte markers will always need a fault-in to merge the marker with a valid pte. Or the smap code will need to parse PTE markers not none ptes. Patch Layout ============ Introducing PTE marker and uffd-wp bit in PTE marker: mm: Introduce PTE_MARKER swap entry mm: Teach core mm about pte markers mm: Check against orig_pte for finish_fault() mm/uffd: PTE_MARKER_UFFD_WP Adding support for shmem uffd-wp: mm/shmem: Take care of UFFDIO_COPY_MODE_WP mm/shmem: Handle uffd-wp special pte in page fault handler mm/shmem: Persist uffd-wp bit across zapping for file-backed mm/shmem: Allow uffd wr-protect none pte for file-backed mem mm/shmem: Allows file-back mem to be uffd wr-protected on thps mm/shmem: Handle uffd-wp during fork() Adding support for hugetlbfs uffd-wp: mm/hugetlb: Introduce huge pte version of uffd-wp helpers mm/hugetlb: Hook page faults for uffd write protection mm/hugetlb: Take care of UFFDIO_COPY_MODE_WP mm/hugetlb: Handle UFFDIO_WRITEPROTECT mm/hugetlb: Handle pte markers in page faults mm/hugetlb: Allow uffd wr-protect none ptes mm/hugetlb: Only drop uffd-wp special pte if required mm/hugetlb: Handle uffd-wp during fork() Misc handling on the rest mm for uffd-wp file-backed: mm/khugepaged: Don't recycle vma pgtable if uffd-wp registered mm/pagemap: Recognize uffd-wp bit for shmem/hugetlbfs Enabling of uffd-wp on file-backed memory: mm/uffd: Enable write protection for shmem & hugetlbfs mm: Enable PTE markers by default selftests/uffd: Enable uffd-wp for shmem/hugetlbfs Tests ===== - Compile test on x86_64 and aarch64 on different configs - Kernel selftests - uffd-test [0] - Umapsort [1,2] test for shmem/hugetlb, with swap on/off [0] https://github.com/xzpeter/clibs/tree/master/uffd-test [1] https://github.com/xzpeter/umap-apps/tree/peter [2] https://github.com/xzpeter/umap/tree/peter-shmem-hugetlbfs This patch (of 23): Introduces a new swap entry type called PTE_MARKER. It can be installed for any pte that maps a file-backed memory when the pte is temporarily zapped, so as to maintain per-pte information. The information that kept in the pte is called a "marker". Here we define the marker as "unsigned long" just to match pgoff_t, however it will only work if it still fits in swp_offset(), which is e.g. currently 58 bits on x86_64. A new config CONFIG_PTE_MARKER is introduced too; it's by default off. A bunch of helpers are defined altogether to service the rest of the pte marker code. [peterx@redhat.com: fixup] Link: https://lkml.kernel.org/r/Yk2rdB7SXZf+2BDF@xz-m1.local Link: https://lkml.kernel.org/r/20220405014646.13522-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20220405014646.13522-2-peterx@redhat.com Signed-off-by: Peter Xu Cc: Mike Kravetz Cc: David Hildenbrand Cc: Matthew Wilcox Cc: Alistair Popple Cc: Nadav Amit Cc: Axel Rasmussen Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Hugh Dickins Cc: Jerome Glisse Cc: Mike Rapoport Signed-off-by: Andrew Morton commit 8a87d6959f0d81108d95b0dbd3d7dc2cecea853d Author: Wonhyuk Yang Date: Thu May 12 20:22:51 2022 -0700 mm/page_alloc: cache the result of node_dirty_ok() To spread dirty pages, nodes are checked whether they have reached the dirty limit using the expensive node_dirty_ok(). To reduce the frequency of calling node_dirty_ok(), the last node that hit the dirty limit can be cached. Instead of caching the node, caching both the node and its node_dirty_ok() status can reduce the number of calle to node_dirty_ok(). [akpm@linux-foundation.org: rename last_pgdat_dirty_limit to last_pgdat_dirty_ok] Link: https://lkml.kernel.org/r/20220430011032.64071-1-vvghjk1234@gmail.com Signed-off-by: Wonhyuk Yang Acked-by: Johannes Weiner Acked-by: Mel Gorman Cc: Donghyeok Kim Cc: JaeSang Yoo Cc: Jiyoup Kim Cc: Ohhoon Kwon Signed-off-by: Andrew Morton commit 81a84182c3430c8f5f7ccf9e95a10b99f727f727 Author: SeongJae Park Date: Mon May 9 18:20:56 2022 -0700 Docs/admin-guide/mm/damon/reclaim: document 'commit_inputs' parameter This commit documents the new DAMON_RECLAIM parameter, 'commit_inputs' in its usage document. Link: https://lkml.kernel.org/r/20220429160606.127307-15-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit e035c280f6dfebf0cf7462a03d83294ca1b8c4e3 Author: SeongJae Park Date: Mon May 9 18:20:56 2022 -0700 mm/damon/reclaim: support online inputs update DAMON_RECLAIM reads the user input parameters only when it starts. To allow more efficient online tuning, this commit implements a new input parameter called 'commit_inputs'. Writing true to the parameter makes DAMON_RECLAIM reads the input parameters again. Link: https://lkml.kernel.org/r/20220429160606.127307-14-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit adc286e6bdd39e94f243cb109d73fb422368acd5 Author: SeongJae Park Date: Mon May 9 18:20:56 2022 -0700 Docs/{ABI,admin-guide}/damon: Update for 'state' sysfs file input keyword, 'commit' This commit documents the newly added 'state' sysfs file input keyword, 'commit', which allows online tuning of DAMON contexts. Link: https://lkml.kernel.org/r/20220429160606.127307-13-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit da87878010e59869d4d27b3c01ecc8ec06ff4a20 Author: SeongJae Park Date: Mon May 9 18:20:56 2022 -0700 mm/damon/sysfs: support online inputs update Currently, DAMON sysfs interface doesn't provide a way for adjusting DAMON input parameters while it is turned on. Therefore, users who want to reconfigure DAMON need to stop DAMON and restart. This means all the monitoring results that accumulated so far, which could be useful, should be flushed. This would be inefficient for many cases. For an example, let's suppose a sysadmin was running a DAMON-based Operation Scheme to find memory regions not accessed for more than 5 mins and page out the regions. If it turns out the 5 mins threshold was too long and therefore the sysadmin wants to reduce it to 4 mins, the sysadmin should turn off DAMON, restart it, and wait for at least 4 more minutes so that DAMON can find the cold memory regions, even though DAMON was knowing there are regions that not accessed for 4 mins at the time of shutdown. This commit makes DAMON sysfs interface to support online DAMON input parameters updates by adding a new input keyword for the 'state' DAMON sysfs file, 'commit'. Writing the keyword to the 'state' file while the corresponding kdamond is running makes the kdamond to read the sysfs file values again and update the DAMON context. Link: https://lkml.kernel.org/r/20220429160606.127307-12-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 01538719c098f51ac0742ef610d127ba3e3d1e03 Author: SeongJae Park Date: Mon May 9 18:20:56 2022 -0700 mm/damon/sysfs: update schemes stat in the kdamond context Only '->kdamond' and '->kdamond_stop' are protected by 'kdamond_lock' of 'struct damon_ctx'. All other DAMON context internal data items are recommended to be accessed in DAMON callbacks, or under some additional synchronizations. But, DAMON sysfs is accessing the schemes stat under 'kdamond_lock'. It makes no big issue as the read values are not used anywhere inside kernel, but would better to be fixed. This commit moves the reads to DAMON callback context, as supposed to be used for the purpose. Link: https://lkml.kernel.org/r/20220429160606.127307-11-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 3cbab4ca1ea8752912d8719d72059869b4c18045 Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/sysfs: use enum for 'state' input handling DAMON sysfs 'state' file handling code is using string literals in both 'state_show()' and 'state_store()'. This makes the code error prone and inflexible for future extensions. To improve the situation, this commit defines possible input strings and 'enum' for identifying each input keyword only once, and refactors the code to reuse those. Link: https://lkml.kernel.org/r/20220429160606.127307-10-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 97d482f4592fde2322c319f07bc54f3a0d37861c Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/sysfs: reuse damon_set_regions() for regions setting 'damon_set_regions()' is general enough so that it can also be used for only creating regions. This commit makes DAMON sysfs interface to reuse the function rather keeping two implementations for a same purpose. Link: https://lkml.kernel.org/r/20220429160606.127307-9-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 74bd8b7d2f8e7014dc34d6c5f51c629afdf822cb Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/sysfs: move targets setup code to a separated function This commit separates DAMON sysfs interface's monitoring context targets setup code to a new function for better readability. Link: https://lkml.kernel.org/r/20220429160606.127307-8-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 0a890a9faaad3bfb7fa4087c4d35e2ea3527013b Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/sysfs: prohibit multiple physical address space monitoring targets Having multiple targets for physical address space monitoring makes no sense. This commit prohibits such a ridiculous DAMON context setup my making the DAMON context build function to check and return an error for the case. Link: https://lkml.kernel.org/r/20220429160606.127307-7-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit dae0087aeff4ea7b5054d9612bba1d5f7c3046ec Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/vaddr: remove damon_va_apply_three_regions() 'damon_va_apply_three_regions()' is just a wrapper of its general version, 'damon_set_regions()'. This commit replaces the wrapper calls to directly call the general version. Link: https://lkml.kernel.org/r/20220429160606.127307-6-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit d0723bc04185b15ed96ade0a0bf9277ef00008db Author: SeongJae Park Date: Mon May 9 18:20:55 2022 -0700 mm/damon/vaddr: move 'damon_set_regions()' to core This commit moves 'damon_set_regions()' from vaddr to core, as it is aimed to be used by not only 'vaddr' but also other parts of DAMON. Link: https://lkml.kernel.org/r/20220429160606.127307-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit af3f18f6ad3f3c8ae70955cf288f467ea2bc83ed Author: SeongJae Park Date: Mon May 9 18:20:54 2022 -0700 mm/damon/vaddr: generalize damon_va_apply_three_regions() 'damon_va_apply_three_regions()' is for adjusting address ranges to fit in three discontiguous ranges. The function can be generalized for arbitrary number of discontiguous ranges and reused for future usage, such as arbitrary online regions update. For such future usage, this commit introduces a generalized version of the function called 'damon_set_regions()'. Link: https://lkml.kernel.org/r/20220429160606.127307-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit abacd635fa7b7a39858bb4182eef33ffa628b12c Author: SeongJae Park Date: Mon May 9 18:20:54 2022 -0700 mm/damon/core: finish kdamond as soon as any callback returns an error When 'after_sampling()' or 'after_aggregation()' DAMON callbacks return an error, kdamond continues the remaining loop once. It makes no much sense to run the remaining part while something wrong already happened. The context might be corrupted or having invalid data. This commit therefore makes kdamond skips the remaining works and immediately finish in the cases. Link: https://lkml.kernel.org/r/20220429160606.127307-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 6e74d2bf5a265113ca54a8323783d2f3fdde96b7 Author: SeongJae Park Date: Mon May 9 18:20:54 2022 -0700 mm/damon/core: add a new callback for watermarks checks Patch series "mm/damon: Support online tuning". Effects of DAMON and DAMON-based Operation Schemes highly depends on the configurations. Wrong configurations could even result in unexpected efficiency degradations. For finding a best configuration, repeating incremental configuration changes and results measurements, in other words, online tuning, could be helpful. Nevertheless, DAMON kernel API supports only restrictive online tuning. Worse yet, the sysfs-based DAMON user interface doesn't support online tuning at all. DAMON_RECLAIM also doesn't support online tuning. This patchset makes the DAMON kernel API, DAMON sysfs interface, and DAMON_RECLAIM supports online tuning. Sequence of patches ------------------- First two patches enhance DAMON online tuning for kernel API users. Specifically, patch 1 let kernel API users to be able to do DAMON online tuning without a restriction, and patch 2 makes error handling easier. Following seven patches (patches 3-9) refactor code for better readability and easier reuse of code fragments that will be useful for online tuning support. Patch 10 introduces DAMON callback based user request handling structure for DAMON sysfs interface, and patch 11 enables DAMON online tuning via DAMON sysfs interface. Documentation patch (patch 12) for usage of it follows. Patch 13 enables online tuning of DAMON_RECLAIM and finally patch 14 documents the DAMON_RECLAIM online tuning usage. This patch (of 14): For updating input parameters for running DAMON contexts, DAMON kernel API users can use the contexts' callbacks, as it is the safe place for context internal data accesses. When the context has DAMON-based operation schemes and all schemes are deactivated due to their watermarks, however, DAMON does nothing but only watermarks checks. As a result, no callbacks will be called back, and therefore the kernel API users cannot update the input parameters including monitoring attributes, DAMON-based operation schemes, and watermarks. To let users easily update such DAMON input parameters in such a case, this commit adds a new callback, 'after_wmarks_check()'. It will be called after each watermarks check. Users can do the online input parameters update in the callback even under the schemes deactivated case. Link: https://lkml.kernel.org/r/20220429160606.127307-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 9994715333515e82865e533250e488496b9742f4 Author: Niels Dossche Date: Mon May 9 18:20:54 2022 -0700 selftest/vm: test that mremap fails on non-existent vma Add a regression test that validates that mremap fails for vma's that don't exist. Link: https://lkml.kernel.org/r/20220427224439.23828-3-dossche.niels@gmail.com Signed-off-by: Niels Dossche Cc: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton commit dd0623020e0d068d5eba0c37d5ae1277800b49c4 Author: Adrian Huang Date: Mon May 9 18:20:54 2022 -0700 mm/rmap: Fix typos in comments Fix spelling/grammar mistakes in comments. Link: https://lkml.kernel.org/r/20220428061522.666-1-adrianhuang0701@gmail.com Signed-off-by: Adrian Huang Signed-off-by: Andrew Morton commit b304c6f0d39d927a87e72a8ac6c89b96ac25f355 Author: Hongchen Zhang Date: Mon May 9 18:20:53 2022 -0700 mm/swapops: make is_pmd_migration_entry more strict A pmd migration entry should first be a swap pmd,so use is_swap_pmd(pmd) instead of !pmd_present(pmd). On the other hand, some architecture (MIPS for example) may misjudge a pmd_none entry as a pmd migration entry. Link: https://lkml.kernel.org/r/1651131333-6386-1-git-send-email-zhanghongchen@loongson.cn Signed-off-by: Hongchen Zhang Acked-by: Peter Xu Cc: Alistair Popple Cc: Ralph Campbell Cc: Naoya Horiguchi Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 5b4494896cb379b0304ba8320589f2ffd08a7b31 Author: Florian Rommel Date: Mon May 9 18:20:53 2022 -0700 mmap locking API: fix missed mmap_sem references in comments Commit c1e8d7c6a7a6 ("mmap locking API: convert mmap_sem comments") missed replacing some references of mmap_sem by mmap_lock due to misspelling (mm_sem instead of mmap_sem). Link: https://lkml.kernel.org/r/20220503113333.214124-1-mail@florommel.de Signed-off-by: Florian Rommel Signed-off-by: Andrew Morton commit d949a8155d139aa890795b802004a196b7f00598 Author: Peter Collingbourne Date: Mon May 9 18:20:53 2022 -0700 mm: make minimum slab alignment a runtime property When CONFIG_KASAN_HW_TAGS is enabled we currently increase the minimum slab alignment to 16. This happens even if MTE is not supported in hardware or disabled via kasan=off, which creates an unnecessary memory overhead in those cases. Eliminate this overhead by making the minimum slab alignment a runtime property and only aligning to 16 if KASAN is enabled at runtime. On a DragonBoard 845c (non-MTE hardware) with a kernel built with CONFIG_KASAN_HW_TAGS, waiting for quiescence after a full Android boot I see the following Slab measurements in /proc/meminfo (median of 3 reboots): Before: 169020 kB After: 167304 kB [akpm@linux-foundation.org: make slab alignment type `unsigned int' to avoid casting] Link: https://linux-review.googlesource.com/id/I752e725179b43b144153f4b6f584ceb646473ead Link: https://lkml.kernel.org/r/20220427195820.1716975-2-pcc@google.com Signed-off-by: Peter Collingbourne Reviewed-by: Andrey Konovalov Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes Reviewed-by: Catalin Marinas Acked-by: Vlastimil Babka Cc: Pekka Enberg Cc: Roman Gushchin Cc: Joonsoo Kim Cc: Herbert Xu Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Eric W. Biederman Cc: Kees Cook Signed-off-by: Andrew Morton commit 534aa1dc975ac883ad89110534585a96630802a0 Author: Peter Collingbourne Date: Mon May 9 18:20:53 2022 -0700 printk: stop including cache.h from printk.h An inclusion of cache.h in printk.h was added in 2014 in commit c28aa1f0a847 ("printk/cache: mark printk_once test variable __read_mostly") in order to bring in the definition of __read_mostly. The usage of __read_mostly was later removed in commit 3ec25826ae33 ("printk: Tie printk_once / printk_deferred_once into .data.once for reset") which made the inclusion of cache.h unnecessary, so remove it. We have a small amount of code that depended on the inclusion of cache.h from printk.h; fix that code to include the appropriate header. This fixes a circular inclusion on arm64 (linux/printk.h -> linux/cache.h -> asm/cache.h -> linux/kasan-enabled.h -> linux/static_key.h -> linux/jump_label.h -> linux/bug.h -> asm/bug.h -> linux/printk.h) that would otherwise be introduced by the next patch. Build tested using {allyesconfig,defconfig} x {arm64,x86_64}. Link: https://linux-review.googlesource.com/id/I8fd51f72c9ef1f2d6afd3b2cbc875aa4792c1fba Link: https://lkml.kernel.org/r/20220427195820.1716975-1-pcc@google.com Signed-off-by: Peter Collingbourne Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: David Rientjes Cc: Dmitry Vyukov Cc: Eric W. Biederman Cc: Herbert Xu Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Joonsoo Kim Cc: Kees Cook Cc: Pekka Enberg Cc: Roman Gushchin Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit dfc7ab57560da385f705b28e2bf50e3b90444a6b Author: Baolin Wang Date: Mon May 9 18:20:53 2022 -0700 mm: rmap: use flush_cache_range() to flush cache for hugetlb pages Now we will use flush_cache_page() to flush cache for anonymous hugetlb pages when unmapping or migrating a hugetlb page mapping, but the flush_cache_page() only handles a PAGE_SIZE range on some architectures (like arm32, arc and so on), which will cause potential cache issues. Thus change to use flush_cache_range() to cover the whole size of a hugetlb page. Link: https://lkml.kernel.org/r/dc903b378d1e2d26bbbe85409ab9d009631f175c.1651056365.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Mike Kravetz Cc: Mina Almasry Cc: Muchun Song Signed-off-by: Andrew Morton commit 54205e9c5425049aef1bc7a812f890f00b5f79c7 Author: Baolin Wang Date: Mon May 9 18:20:53 2022 -0700 mm: rmap: move the cache flushing to the correct place for hugetlb PMD sharing The cache level flush will always be first when changing an existing virtual–>physical mapping to a new value, since this allows us to properly handle systems whose caches are strict and require a virtual–>physical translation to exist for a virtual address. So we should move the cache flushing before huge_pmd_unshare(). As Muchun pointed out[1], now the architectures whose supporting hugetlb PMD sharing have no cache flush issues in practice. But I think we should still follow the cache/TLB flushing rules when changing a valid virtual address mapping in case of potential issues in future. [1] https://lore.kernel.org/all/YmT%2F%2FhuUbFX+KHcy@FVFYT0MHHV2J.usts.net/ Link: https://lkml.kernel.org/r/4f7ae6dfdc838ab71e1655188b657c032ff1f28f.1651056365.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Mike Kravetz Cc: Mina Almasry Cc: Muchun Song Signed-off-by: Andrew Morton commit 3d0b95cd87b26b0b10e0cda8ee6105c2194a5800 Author: Baolin Wang Date: Mon May 9 18:20:52 2022 -0700 mm: hugetlb: considering PMD sharing when flushing cache/TLBs This patchset fixes some cache flushing issues if PMD sharing is possible for hugetlb pages, which were found by code inspection. Meanwhile Mike found the flush_cache_page() can not cover the whole size of a hugetlb page on some architectures [1], so I added a new patch 3 to fix this issue, since I found only try_to_unmap_one() and try_to_migrate_one() need to fix after some investigation. [1] https://lore.kernel.org/linux-mm/064da3bb-5b4b-7332-a722-c5a541128705@oracle.com/ This patch (of 3): When moving hugetlb page tables, the cache flushing is called in move_page_tables() without considering the shared PMDs, which may be cause cache issues on some architectures. Thus we should move the hugetlb cache flushing into move_hugetlb_page_tables() with considering the shared PMDs ranges, calculated by adjust_range_if_pmd_sharing_possible(). Meanwhile also expanding the TLBs flushing range in case of shared PMDs. Note this is discovered via code inspection, and did not meet a real problem in practice so far. Link: https://lkml.kernel.org/r/cover.1651056365.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/0443c8cf20db554d3ff4b439b30e0ff26c0181dd.1651056365.git.baolin.wang@linux.alibaba.com Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Baolin Wang Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Mina Almasry Signed-off-by: Andrew Morton commit 6366238b8dfc383723c211c1ffe8c8d7914107e5 Author: liusongtang Date: Mon May 9 18:20:52 2022 -0700 mm/memory_hotplug: use pgprot_val to get value of pgprot pgprot.pgprot is non-portable code. It should be replaced by portable macro pgprot_val. Link: https://lkml.kernel.org/r/20220426071302.220646-1-liusongtang@huawei.com Signed-off-by: liusongtang Reviewed-by: Anshuman Khandual Cc: Xiaoming Ni Signed-off-by: Andrew Morton commit 915418088c977993933efaf7a704c0bcd6c2bf77 Author: SeongJae Park Date: Mon May 9 18:20:52 2022 -0700 Docs/{ABI,admin-guide}/damon: update for fixed virtual address ranges monitoring This commit documents the user space support of the newly added monitoring operations set for fixed virtual address ranges monitoring, namely 'fvaddr', on the ABI and usage documents for DAMON. Link: https://lkml.kernel.org/r/20220426231750.48822-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit b82434471cd2164988f8b4436983338ef224431d Author: SeongJae Park Date: Mon May 9 18:20:52 2022 -0700 mm/damon/sysfs: support fixed virtual address ranges monitoring This commit makes DAMON sysfs interface to support the fixed virtual address ranges monitoring. After this commit, writing 'fvaddr' to the 'operations' DAMON sysfs file makes DAMON uses the monitoring operations set for fixed virtual address ranges, so that users can monitor accesses to only interested virtual address ranges. [sj@kernel.org: fix pid leak under fvaddr ops use case] Link: https://lkml.kernel.org/r/20220503220531.45913-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220426231750.48822-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit de6d01542a5c4f6fe6f0c65c14694b760f896acc Author: SeongJae Park Date: Mon May 9 18:20:52 2022 -0700 mm/damon/vaddr: register a damon_operations for fixed virtual address ranges monitoring Patch series "support fixed virtual address ranges monitoring". The monitoring operations set for virtual address spaces automatically updates the monitoring target regions to cover entire mappings of the virtual address spaces as much as possible. Some users could have more information about their programs than kernel and therefore have interest in not entire regions but only specific regions. For such cases, the automatic monitoring target regions updates are only unnecessary overhead or distractions. This patchset adds supports for the use case on DAMON's kernel API (DAMON_OPS_FVADDR) and sysfs interface ('fvaddr' keyword for 'operations' sysfs file). This patch (of 3): The monitoring operations set for virtual address spaces automatically updates the monitoring target regions to cover entire mappings of the virtual address spaces as much as possible. Some users could have more information about their programs than kernel and therefore have interest in not entire regions but only specific regions. For such cases, the automatic monitoring target regions updates are only unnecessary overheads or distractions. For such cases, DAMON's API users can simply set the '->init()' and '->update()' of the DAMON context's '->ops' NULL, and set the target monitoring regions when creating the context. But, that would be a dirty hack. Worse yet, the hack is unavailable for DAMON user space interface users. To support the use case in a clean way that can easily exported to the user space, this commit adds another monitoring operations set called 'fvaddr', which is same to 'vaddr' but does not automatically update the monitoring regions. Instead, it will only respect the virtual address regions which have explicitly passed at the initial context creation. Note that this commit leave sysfs interface not supporting the feature yet. The support will be made in a following commit. Link: https://lkml.kernel.org/r/20220426231750.48822-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220426231750.48822-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 2fe60ec99ba1c2615804ebf52e4827aee5dd6316 Author: SeongJae Park Date: Mon May 9 18:20:51 2022 -0700 Docs/{ABI,admin-guide}/damon: document 'avail_operations' sysfs file This commit updates the DAMON ABI and usage documents for the new sysfs file, 'avail_operations'. Link: https://lkml.kernel.org/r/20220426203843.45238-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit f893abbd6997f9a95815acfb84aa865f0c996373 Author: SeongJae Park Date: Mon May 9 18:20:51 2022 -0700 selftets/damon/sysfs: test existence and permission of avail_operations This commit adds a selftest test case for ensuring the existence and the permission (read-only) of the 'avail_oprations' DAMON sysfs file. Link: https://lkml.kernel.org/r/20220426203843.45238-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 0f2cb5885771b31fd1c82a1293787d1e378eaab5 Author: SeongJae Park Date: Mon May 9 18:20:51 2022 -0700 mm/damon/sysfs: add a file for listing available monitoring ops DAMON programming interface users can know if specific monitoring ops set is registered or not using 'damon_is_registered_ops()', but there is no such method for the user space. To help the case, this commit adds a new DAMON sysfs file called 'avail_operations' under each context directory for listing available monitoring ops. Reading the file will list each registered monitoring ops on each line. Link: https://lkml.kernel.org/r/20220426203843.45238-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 152e56178ad72037bc6a2f08d4a608543bc67cdf Author: SeongJae Park Date: Mon May 9 18:20:51 2022 -0700 mm/damon/core: add a function for damon_operations registration checks Patch series "mm/damon: allow users know which monitoring ops are available". DAMON users can configure it for vaious address spaces including virtual address spaces and the physical address space by setting its monitoring operations set with appropriate one for their purpose. However, there is no celan and simple way to know exactly which monitoring operations sets are available on the currently running kernel. This patchset adds functions for the purpose on DAMON's kernel API ('damon_is_registered_ops()') and sysfs interface ('avail_operations' file under each context directory). This patch (of 4): To know if a specific 'damon_operations' is registered, users need to check the kernel config or try 'damon_select_ops()' with the ops of the question, and then see if it successes. In the latter case, the user should also revert the change. To make the process simple and convenient, this commit adds a function for checking if a specific 'damon_operations' is registered or not. Link: https://lkml.kernel.org/r/20220426203843.45238-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220426203843.45238-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit f38adfef7e6bfe681d6602b6668be31fe1310ed0 Author: Fabio M. De Francesco Date: Mon May 9 18:20:51 2022 -0700 mm/highmem: VM_BUG_ON() if offset + len > PAGE_SIZE Add VM_BUG_ON() bounds checking to make sure that, if "offset + len> PAGE_SIZE", memset() does not corrupt data in adjacent pages. Mainly to match all the similar functions in highmem.h. Link: https://lkml.kernel.org/r/20220426193020.8710-1-fmdefrancesco@gmail.com Signed-off-by: Fabio M. De Francesco Reviewed-by: Andrew Morton Cc: Ira Weiny Cc: Catalin Marinas Cc: "Matthew Wilcox (Oracle)" Cc: Peter Collingbourne Signed-off-by: Andrew Morton commit 3c81b3bb0a33e2b555edb8d7eb99a7ae4f17d8bb Author: huangshaobo Date: Mon May 9 18:20:51 2022 -0700 kfence: enable check kfence canary on panic via boot param Out-of-bounds accesses that aren't caught by a guard page will result in corruption of canary memory. In pathological cases, where an object has certain alignment requirements, an out-of-bounds access might never be caught by the guard page. Such corruptions, however, are only detected on kfree() normally. If the bug causes the kernel to panic before kfree(), KFENCE has no opportunity to report the issue. Such corruptions may also indicate failing memory or other faults. To provide some more information in such cases, add the option to check canary bytes on panic. This might help narrow the search for the panic cause; but, due to only having the allocation stack trace, such reports are difficult to use to diagnose an issue alone. In most cases, such reports are inactionable, and is therefore an opt-in feature (disabled by default). [akpm@linux-foundation.org: add __read_mostly, per Marco] Link: https://lkml.kernel.org/r/20220425022456.44300-1-huangshaobo6@huawei.com Signed-off-by: huangshaobo Suggested-by: chenzefeng Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Xiaoming Ni Cc: Wangbing Cc: Jubin Zhong Signed-off-by: Andrew Morton commit 4b25f030ae69ba710eff587cabb4c57cb7e7a8a1 Author: Mina Almasry Date: Mon May 9 18:20:50 2022 -0700 hugetlbfs: fix hugetlbfs_statfs() locking After commit db71ef79b59b ("hugetlb: make free_huge_page irq safe"), the subpool lock should be locked with spin_lock_irq() and all call sites was modified as such, except for the ones in hugetlbfs_statfs(). Link: https://lkml.kernel.org/r/20220429202207.3045-1-almasrymina@google.com Fixes: db71ef79b59b ("hugetlb: make free_huge_page irq safe") Signed-off-by: Mina Almasry Reviewed-by: Mike Kravetz Signed-off-by: Andrew Morton commit 4f83145721f362c2f4d312edc4755269a2069488 Author: Nadav Amit Date: Mon May 9 18:20:50 2022 -0700 mm: avoid unnecessary flush on change_huge_pmd() Calls to change_protection_range() on THP can trigger, at least on x86, two TLB flushes for one page: one immediately, when pmdp_invalidate() is called by change_huge_pmd(), and then another one later (that can be batched) when change_protection_range() finishes. The first TLB flush is only necessary to prevent the dirty bit (and with a lesser importance the access bit) from changing while the PTE is modified. However, this is not necessary as the x86 CPUs set the dirty-bit atomically with an additional check that the PTE is (still) present. One caveat is Intel's Knights Landing that has a bug and does not do so. Leverage this behavior to eliminate the unnecessary TLB flush in change_huge_pmd(). Introduce a new arch specific pmdp_invalidate_ad() that only invalidates the access and dirty bit from further changes. Link: https://lkml.kernel.org/r/20220401180821.1986781-4-namit@vmware.com Signed-off-by: Nadav Amit Cc: Andrea Arcangeli Cc: Andrew Cooper Cc: Andy Lutomirski Cc: Dave Hansen Cc: Peter Xu Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: Yu Zhao Cc: Nick Piggin Signed-off-by: Andrew Morton commit c9fe66560bf2dc7d109754414e309888cb8c9ba9 Author: Nadav Amit Date: Mon May 9 18:20:50 2022 -0700 mm/mprotect: do not flush when not required architecturally Currently, using mprotect() to unprotect a memory region or uffd to unprotect a memory region causes a TLB flush. However, in such cases the PTE is often not modified (i.e., remain RO) and therefore not TLB flush is needed. Add an arch-specific pte_needs_flush() which tells whether a TLB flush is needed based on the old PTE and the new one. Implement an x86 pte_needs_flush(). Always flush the TLB when it is architecturally needed even when skipping a TLB flush might only result in a spurious page-faults by skipping the flush. Even with such conservative manner, we can in the future further refine the checks to test whether a PTE is present by only considering the architectural _PAGE_PRESENT flag instead of {pte|pmd}_preesnt(). For not be careful and use the latter. Link: https://lkml.kernel.org/r/20220401180821.1986781-3-namit@vmware.com Signed-off-by: Nadav Amit Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Dave Hansen Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: Yu Zhao Cc: Nick Piggin Cc: Andrew Cooper Cc: Peter Xu Signed-off-by: Andrew Morton commit 4a18419f71cdf9155d2d2a6c79546f720978b990 Author: Nadav Amit Date: Mon May 9 18:20:50 2022 -0700 mm/mprotect: use mmu_gather Patch series "mm/mprotect: avoid unnecessary TLB flushes", v6. This patchset is intended to remove unnecessary TLB flushes during mprotect() syscalls. Once this patch-set make it through, similar and further optimizations for MADV_COLD and userfaultfd would be possible. Basically, there are 3 optimizations in this patch-set: 1. Use TLB batching infrastructure to batch flushes across VMAs and do better/fewer flushes. This would also be handy for later userfaultfd enhancements. 2. Avoid unnecessary TLB flushes. This optimization is the one that provides most of the performance benefits. Unlike previous versions, we now only avoid flushes that would not result in spurious page-faults. 3. Avoiding TLB flushes on change_huge_pmd() that are only needed to prevent the A/D bits from changing. Andrew asked for some benchmark numbers. I do not have an easy determinate macrobenchmark in which it is easy to show benefit. I therefore ran a microbenchmark: a loop that does the following on anonymous memory, just as a sanity check to see that time is saved by avoiding TLB flushes. The loop goes: mprotect(p, PAGE_SIZE, PROT_READ) mprotect(p, PAGE_SIZE, PROT_READ|PROT_WRITE) *p = 0; // make the page writable The test was run in KVM guest with 1 or 2 threads (the second thread was busy-looping). I measured the time (cycles) of each operation: 1 thread 2 threads mmots +patch mmots +patch PROT_READ 3494 2725 (-22%) 8630 7788 (-10%) PROT_READ|WRITE 3952 2724 (-31%) 9075 2865 (-68%) [ mmots = v5.17-rc6-mmots-2022-03-06-20-38 ] The exact numbers are really meaningless, but the benefit is clear. There are 2 interesting results though. (1) PROT_READ is cheaper, while one can expect it not to be affected. This is presumably due to TLB miss that is saved (2) Without memory access (*p = 0), the speedup of the patch is even greater. In that scenario mprotect(PROT_READ) also avoids the TLB flush. As a result both operations on the patched kernel take roughly ~1500 cycles (with either 1 or 2 threads), whereas on mmotm their cost is as high as presented in the table. This patch (of 3): change_pXX_range() currently does not use mmu_gather, but instead implements its own deferred TLB flushes scheme. This both complicates the code, as developers need to be aware of different invalidation schemes, and prevents opportunities to avoid TLB flushes or perform them in finer granularity. The use of mmu_gather for modified PTEs has benefits in various scenarios even if pages are not released. For instance, if only a single page needs to be flushed out of a range of many pages, only that page would be flushed. If a THP page is flushed, on x86 a single TLB invlpg instruction can be used instead of 512 instructions (or a full TLB flush, which would Linux would actually use by default). mprotect() over multiple VMAs requires a single flush. Use mmu_gather in change_pXX_range(). As the pages are not released, only record the flushed range using tlb_flush_pXX_range(). Handle THP similarly and get rid of flush_cache_range() which becomes redundant since tlb_start_vma() calls it when needed. Link: https://lkml.kernel.org/r/20220401180821.1986781-1-namit@vmware.com Link: https://lkml.kernel.org/r/20220401180821.1986781-2-namit@vmware.com Signed-off-by: Nadav Amit Acked-by: Peter Zijlstra (Intel) Cc: Andrea Arcangeli Cc: Andrew Cooper Cc: Andy Lutomirski Cc: Dave Hansen Cc: Peter Xu Cc: Thomas Gleixner Cc: Will Deacon Cc: Yu Zhao Cc: Nick Piggin Signed-off-by: Andrew Morton commit 843e5ba75ee859df92a09d98370bdd1c8607cdd0 Author: Adrian Hunter Date: Fri May 13 11:44:59 2022 +0300 perf tools: Remove unused machines__find_host() machines__find_host() does not exist. Remove declaration. Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220513084459.6581-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 68a6772f11dbb1ed8b74d4c8adc2da1f84dd32a6 Author: Dmitry Vyukov Date: Thu May 5 17:57:45 2022 +0200 perf bench: Add breakpoint benchmarks Add 2 benchmarks: 1. Performance of thread creation/exiting in presence of breakpoints. 2. Performance of breakpoint modification in presence of threads. The benchmarks capture use cases that we are interested in: using inheritable breakpoints in large highly-threaded applications. The benchmarks show significant slowdown imposed by breakpoints (even when they don't fire). Testing on Intel 8173M with 112 HW threads show: perf bench --repeat=56 breakpoint thread --breakpoints=0 --parallelism=56 --threads=20 78.675000 usecs/op perf bench --repeat=56 breakpoint thread --breakpoints=4 --parallelism=56 --threads=20 12967.135714 usecs/op That's 165x slowdown due to presence of the breakpoints. perf bench --repeat=20000 breakpoint enable --passive=0 --active=0 1.433250 usecs/op perf bench --repeat=20000 breakpoint enable --passive=224 --active=0 585.318400 usecs/op perf bench --repeat=20000 breakpoint enable --passive=0 --active=111 635.953000 usecs/op That's 408x and 444x slowdown due to presence of threads. Profiles show some overhead in toggle_bp_slot, but also very high contention: 90.83% breakpoint-thre [kernel.kallsyms] [k] osq_lock 4.69% breakpoint-thre [kernel.kallsyms] [k] mutex_spin_on_owner 2.06% breakpoint-thre [kernel.kallsyms] [k] __reserve_bp_slot 2.04% breakpoint-thre [kernel.kallsyms] [k] toggle_bp_slot 79.01% breakpoint-enab [kernel.kallsyms] [k] smp_call_function_single 9.94% breakpoint-enab [kernel.kallsyms] [k] llist_add_batch 5.70% breakpoint-enab [kernel.kallsyms] [k] _raw_spin_lock_irq 1.84% breakpoint-enab [kernel.kallsyms] [k] event_function_call 1.12% breakpoint-enab [kernel.kallsyms] [k] send_call_function_single_ipi 0.37% breakpoint-enab [kernel.kallsyms] [k] generic_exec_single 0.24% breakpoint-enab [kernel.kallsyms] [k] __perf_event_disable 0.20% breakpoint-enab [kernel.kallsyms] [k] _perf_event_enable 0.18% breakpoint-enab [kernel.kallsyms] [k] toggle_bp_slot Committer notes: Fixup struct init for older compilers: 3 32.90 alpine:3.5 : FAIL clang version 3.8.1 (tags/RELEASE_381/final) bench/breakpoint.c:49:34: error: missing field 'size' initializer [-Werror,-Wmissing-field-initializers] struct perf_event_attr attr = {0}; ^ 1 error generated. 7 37.31 alpine:3.9 : FAIL gcc version 8.3.0 (Alpine 8.3.0) bench/breakpoint.c:49:34: error: missing field 'size' initializer [-Werror,-Wmissing-field-initializers] struct perf_event_attr attr = {0}; ^ 1 error generated. Signed-off-by: Dmitriy Vyukov Tested-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220505155745.1690906-1-dvyukov@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 46a9556d977e290a18890fb4cf07d19b0da16f31 Author: Michael Walle Date: Tue May 3 00:41:27 2022 +0200 ARM: dts: kswitch-d10: enable networking Enable all the necessary network related nodes, wire the pinctrl configurations, add the PHYs and connect them to the corresponding network ports. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-14-michael@walle.cc Signed-off-by: Nicolas Ferre commit 2952d32c061140f9c573f65d5361d0faff164d76 Author: Michael Walle Date: Tue May 3 00:41:26 2022 +0200 ARM: dts: lan966x: add switch node Add the switch node and its 8 children ports. All are disabled by default. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-13-michael@walle.cc Signed-off-by: Nicolas Ferre commit 4d2a87042e9fed35b5bf5d92d1955a197697aa6f Author: Michael Walle Date: Tue May 3 00:41:25 2022 +0200 ARM: dts: lan966x: add serdes node Add the SerDes node. On the LAN966x SoC these SerDes are used to connect network PHYs. By default, that node is disabled. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-12-michael@walle.cc Signed-off-by: Nicolas Ferre commit ff85a7a9dedb6c876974ae20ff0c902a9247dae8 Author: Michael Walle Date: Tue May 3 00:41:24 2022 +0200 ARM: dts: lan966x: add reset switch reset node Add the switch reset node which will later be used by the switch driver. The switch reset also resets the GPIO controller and the SGPIO controller, thus it also has to be connectected to these nodes. This way the reset will only issued once for the first device requesting the reset. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-11-michael@walle.cc Signed-off-by: Nicolas Ferre commit 6ad69e07def67c95e677a747d5320f2f734fd583 Author: Michael Walle Date: Tue May 3 00:41:23 2022 +0200 ARM: dts: lan966x: add MIIM nodes Add the MDIO controller nodes. The integrated PHYs are connected to the second controller. This controller also takes care of the resets of the integrated PHYs, thus it has two memory regions. The first controller is routed to the external MDIO/MDC pins. By default, they are disabled. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-10-michael@walle.cc Signed-off-by: Nicolas Ferre commit 63f295940d1afd88ec6704a3d50a6e87a8a1c45f Author: Michael Walle Date: Tue May 3 00:41:22 2022 +0200 ARM: dts: lan966x: add hwmon node Add the monitoring node which covers the temperature sensor as well as the PWM controller and the FAN tacho input. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-9-michael@walle.cc Signed-off-by: Nicolas Ferre commit 79d83b3a458eaebb98033424e035cb9091291c68 Author: Michael Walle Date: Thu May 12 11:12:46 2022 +0300 ARM: dts: lan966x: add basic Kontron KSwitch D10 support Add basic support for the Kontron KSwitch D10 MMT. It comes in two variants: "6G-2GS" which features 6 Gigabit copper ports and two SFP cages and "8G" which features 6 Gigbabit copper ports (where two are 2.5G capable). For now the following is supported and working: - Kernel console - SFP cages - SPI - SGPIO - Watchdog Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur [claudiu.beznea: fixed conflict on Makefile] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-8-michael@walle.cc Signed-off-by: Nicolas Ferre commit 66fc5fedb2bedcee72b5279e5a74ceb2d1ec883a Author: Michael Walle Date: Tue May 3 00:41:20 2022 +0200 ARM: dts: lan966x: add flexcom I2C nodes Add all I2C nodes of the flexcom IP blocks. The driver supports FIFO, DMA or both combined. But the latter isn't working correctly. Thus, skip the fifo-size property for now. DMA is doing single byte reads in this case. Keep the nodes disabled by default. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-7-michael@walle.cc Signed-off-by: Nicolas Ferre commit 8c38c72c29eb1807d2419bf301e0c07913a16ad4 Author: Michael Walle Date: Tue May 3 00:41:19 2022 +0200 ARM: dts: lan966x: add flexcom SPI nodes Add all the SPI nodes for the flexcom IP block. Keep them disabled by default. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-6-michael@walle.cc Signed-off-by: Nicolas Ferre commit 1e17387a30554c3631faad46a95ab85bfc19d2cc Author: Michael Walle Date: Tue May 3 00:41:18 2022 +0200 ARM: dts: lan966x: add all flexcom usart nodes Add all the remaining usart nodes for the flexcom block. Although the DMA channels are specified, DMA is not enabled by default because break detection doesn't work with DMA. Keep the nodes disabled by default. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-5-michael@walle.cc Signed-off-by: Nicolas Ferre commit 99a5f1cbd4bd2c309b3baf1cd7351424171f8905 Author: Michael Walle Date: Tue May 3 00:41:17 2022 +0200 ARM: dts: lan966x: add missing uart DMA channel The usart node of the flexcom3 block is missing the DMA channels. Add it. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-4-michael@walle.cc Signed-off-by: Nicolas Ferre commit 153dd52cb278454687ce49372ee9ff032dce8778 Author: Michael Walle Date: Tue May 3 00:41:16 2022 +0200 ARM: dts: lan966x: add sgpio node Add the device tree node for the SGPIO IP block reused from the SparX-5. Keep the node disabled by default. Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-3-michael@walle.cc Signed-off-by: Nicolas Ferre commit 8b4092fd0c1a0aaa985413c43b027f87dd457207 Author: Michael Walle Date: Tue May 3 00:41:15 2022 +0200 ARM: dts: lan966x: swap dma channels for crypto node The YAML binding (crypto/atmel,at91sam9g46-aes.yaml) mandates the order of the channels. Swap them to pass devicetree validation. Fixes: 290deaa10c50 ("ARM: dts: add DT for lan966 SoC and 2-port board pcb8291") Signed-off-by: Michael Walle Reviewed-by: Claudiu Beznea Tested-by: Horatiu Vultur Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220502224127.2604333-2-michael@walle.cc Signed-off-by: Nicolas Ferre commit 47afe2b524b8ed69c95d745a36b13e58cdafc656 Author: Michael Walle Date: Wed Apr 20 21:42:30 2022 +0200 ARM: dts: lan966x: 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 Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220420194230.3415663-1-michael@walle.cc Signed-off-by: Nicolas Ferre commit b7e86ef7afd128577ff7bb0db0ae82d27d7ed7ad Author: Eugen Hristev Date: Tue May 3 16:31:27 2022 +0300 ARM: dts: at91: sama7g5: remove interrupt-parent from gic node interrupt-parent is not to be used as a boolean property. It is already present in the DT in the proper way it's supposed to be used: interrupt-parent = <&gic>; This is also reported by dtbs_check: arch/arm/boot/dts/at91-sama7g5ek.dtb: interrupt-controller@e8c11000: interrupt-parent: True is not of type 'array' From schema: /.local/lib/python3.8/site-packages/dtschema/schemas/interrupts.yaml Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Eugen Hristev Reviewed-by: Claudiu Beznea Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220503133127.64320-1-eugen.hristev@microchip.com Signed-off-by: Nicolas Ferre commit a37bc730a572b863253c0244a798127317bd79e0 Author: Krzysztof Kozlowski Date: Tue Apr 12 12:50:13 2022 +0200 ARM: dts: at91: use generic node name for dataflash The node names should be generic, so use "flash" for dataflash nodes and for cfi-flash. Suggested-by: Tudor Ambarus Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Acked-by: Nicolas Ferre Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220412105013.249793-1-krzysztof.kozlowski@linaro.org Signed-off-by: Nicolas Ferre commit e3b9bf145cb6a0c0ffa106d5a78029c7c3e94ef7 Merge: af2d861d4cd2a 628bf55b62049 Author: Joerg Roedel Date: Fri May 13 15:17:33 2022 +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 5.19 - Add new Qualcomm device-tree compatible strings - Add new Nvidia device-tree compatible string for Tegra234 - Fix UAF in SMMUv3 shared virtual addressing code - Force identity-mapped domains for users of ye olde SMMU legacy binding - Minor cleanups commit b2531d4bdce19f28364b45aac9132e153b1f23a4 Author: Andrii Nakryiko Date: Thu May 12 15:07:13 2022 -0700 selftests/bpf: Convert some selftests to high-level BPF map APIs Convert a bunch of selftests to using newly added high-level BPF map APIs. This change exposed that map_kptr selftests allocated too big buffer, which is fixed in this patch as well. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220512220713.2617964-2-andrii@kernel.org commit 737d0646a83cdc65c070a9de61a1ef106cca5ff1 Author: Andrii Nakryiko Date: Thu May 12 15:07:12 2022 -0700 libbpf: Add safer high-level wrappers for map operations Add high-level API wrappers for most common and typical BPF map operations that works directly on instances of struct bpf_map * (so you don't have to call bpf_map__fd()) and validate key/value size expectations. These helpers require users to specify key (and value, where appropriate) sizes when performing lookup/update/delete/etc. This forces user to actually think and validate (for themselves) those. This is a good thing as user is expected by kernel to implicitly provide correct key/value buffer sizes and kernel will just read/write necessary amount of data. If it so happens that user doesn't set up buffers correctly (which bit people for per-CPU maps especially) kernel either randomly overwrites stack data or return -EFAULT, depending on user's luck and circumstances. These high-level APIs are meant to prevent such unpleasant and hard to debug bugs. This patch also adds bpf_map_delete_elem_flags() low-level API and requires passing flags to bpf_map__delete_elem() API for consistency across all similar APIs, even though currently kernel doesn't expect any extra flags for BPF_MAP_DELETE_ELEM operation. List of map operations that get these high-level APIs: - bpf_map_lookup_elem; - bpf_map_update_elem; - bpf_map_delete_elem; - bpf_map_lookup_and_delete_elem; - bpf_map_get_next_key. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220512220713.2617964-1-andrii@kernel.org commit 0d647b33e74f7cb98b7c74d638922d6c03bfdb94 Author: Lu Baolu Date: Tue May 10 10:34:07 2022 +0800 iommu/vt-d: Remove hard coding PGSNP bit in PASID entries As enforce_cache_coherency has been introduced into the iommu_domain_ops, the kernel component which owns the iommu domain is able to opt-in its requirement for force snooping support. The iommu driver has no need to hard code the page snoop control bit in the PASID table entries anymore. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220508123525.1973626-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit e80552267b63df211c805e8e8c534bfe5909b7e7 Author: Lu Baolu Date: Tue May 10 10:34:06 2022 +0800 iommu/vt-d: Remove domain_update_iommu_snooping() The IOMMU force snooping capability is not required to be consistent among all the IOMMUs anymore. Remove force snooping capability check in the IOMMU hot-add path and domain_update_iommu_snooping() becomes a dead code now. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220508123525.1973626-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit fc0051cb95909ab56bd8c929f24d48c9870c3e3a Author: Lu Baolu Date: Tue May 10 10:34:05 2022 +0800 iommu/vt-d: Check domain force_snooping against attached devices As domain->force_snooping only impacts the devices attached with the domain, there's no need to check against all IOMMU units. On the other hand, force_snooping could be set on a domain no matter whether it has been attached or not, and once set it is an immutable flag. If no device attached, the operation always succeeds. Then this empty domain can be only attached to a device of which the IOMMU supports snoop control. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220508123525.1973626-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 9d6ab26a75f47332da9949a0112727e10f2d6e51 Author: Lu Baolu Date: Tue May 10 10:34:04 2022 +0800 iommu/vt-d: Block force-snoop domain attaching if no SC support In the attach_dev callback of the default domain ops, if the domain has been set force_snooping, but the iommu hardware of the device does not support SC(Snoop Control) capability, the callback should block it and return a corresponding error code. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220508123525.1973626-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit ea661ad6e1573d5b08c27444ff2ed403bf39ff66 Author: Lu Baolu Date: Tue May 10 10:34:03 2022 +0800 iommu/vt-d: Size Page Request Queue to avoid overflow condition PRQ overflow may cause I/O throughput congestion, resulting in unnecessary degradation of I/O performance. Appropriately increasing the length of PRQ can greatly reduce the occurrence of PRQ overflow. The count of maximum page requests that can be generated in parallel by a PCIe device is statically defined in the Outstanding Page Request Capacity field of the PCIe ATS configure space. The new length of PRQ is calculated by summing up the value of Outstanding Page Request Capacity register across all devices where Page Requests are supported on the real PR-capable platform (Intel Sapphire Rapids). The result is round to the nearest higher power of 2. The PRQ length is also double sized as the VT-d IOMMU driver only updates the Page Request Queue Head Register (PQH_REG) after processing the entire queue. Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220421113558.3504874-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit bac4e778d67a5f0fd8cc49029c1fff127b86c874 Author: Lu Baolu Date: Tue May 10 10:34:02 2022 +0800 iommu/vt-d: Fold dmar_insert_one_dev_info() into its caller Fold dmar_insert_one_dev_info() into domain_add_dev_info() which is its only caller. No intentional functional impact. Suggested-by: Christoph Hellwig Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220416120423.879552-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit e19c3992b9f8bef9c8c4aa59fa30a83e7e35eccc Author: Lu Baolu Date: Tue May 10 10:34:01 2022 +0800 iommu/vt-d: Change return type of dmar_insert_one_dev_info() The dmar_insert_one_dev_info() returns the pass-in domain on success and NULL on failure. This doesn't make much sense. Change it to an integer. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220416120423.879552-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220510023407.2759143-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit cd901e9284c7893eebee6857ebe30b691ea91224 Author: Muhammad Usama Anjum Date: Tue May 10 10:34:00 2022 +0800 iommu/vt-d: Remove unneeded validity check on dev dev_iommu_priv_get() is being used at the top of this function which dereferences dev. Dev cannot be NULL after this. Remove the validity check on dev and simplify the code. Signed-off-by: Muhammad Usama Anjum Link: https://lore.kernel.org/r/20220313150337.593650-1-usama.anjum@collabora.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220510023407.2759143-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 365d519923a279af379a8d0f641ef50e44bb610e Author: Alexei Starovoitov Date: Thu May 12 18:10:25 2022 -0700 selftests/bpf: Check combination of jit blinding and pointers to bpf subprogs. Check that ld_imm64 with src_reg=1 (aka BPF_PSEUDO_FUNC) works with jit_blinding. Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220513011025.13344-2-alexei.starovoitov@gmail.com commit 4b6313cf99b0d51b49aeaea98ec76ca8161ecb80 Author: Alexei Starovoitov Date: Thu May 12 18:10:24 2022 -0700 bpf: Fix combination of jit blinding and pointers to bpf subprogs. The combination of jit blinding and pointers to bpf subprogs causes: [ 36.989548] BUG: unable to handle page fault for address: 0000000100000001 [ 36.990342] #PF: supervisor instruction fetch in kernel mode [ 36.990968] #PF: error_code(0x0010) - not-present page [ 36.994859] RIP: 0010:0x100000001 [ 36.995209] Code: Unable to access opcode bytes at RIP 0xffffffd7. [ 37.004091] Call Trace: [ 37.004351] [ 37.004576] ? bpf_loop+0x4d/0x70 [ 37.004932] ? bpf_prog_3899083f75e4c5de_F+0xe3/0x13b The jit blinding logic didn't recognize that ld_imm64 with an address of bpf subprogram is a special instruction and proceeded to randomize it. By itself it wouldn't have been an issue, but jit_subprogs() logic relies on two step process to JIT all subprogs and then JIT them again when addresses of all subprogs are known. Blinding process in the first JIT phase caused second JIT to miss adjustment of special ld_imm64. Fix this issue by ignoring special ld_imm64 instructions that don't have user controlled constants and shouldn't be blinded. Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Reported-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220513011025.13344-1-alexei.starovoitov@gmail.com commit b8397a8f4ebc0b84eefd990dc08995ba2ae9015c Author: Robin Murphy Date: Mon May 9 11:16:08 2022 +0100 iommu/dma: Explicitly sort PCI DMA windows Originally, creating the dma_ranges resource list in pre-sorted fashion was the simplest and most efficient way to enforce the order required by iova_reserve_pci_windows(). However since then at least one PCI host driver is now re-sorting the list for its own probe-time processing, which doesn't seem entirely unreasonable, so that basic assumption no longer holds. Make iommu-dma robust and get the sort order it needs by explicitly sorting, which means we can also save the effort at creation time and just build the list in whatever natural order the DT had. Signed-off-by: Robin Murphy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/35661036a7e4160850895f9b37f35408b6a29f2f.1652091160.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit a3884774d731f03d3a3dd4fb70ec2d9341ceb39d Author: Yunfei Wang Date: Sat May 7 16:52:03 2022 +0800 iommu/dma: Fix iova map result check bug The data type of the return value of the iommu_map_sg_atomic is ssize_t, but the data type of iova size is size_t, e.g. one is int while the other is unsigned int. When iommu_map_sg_atomic return value is compared with iova size, it will force the signed int to be converted to unsigned int, if iova map fails and iommu_map_sg_atomic return error code is less than 0, then (ret < iova_len) is false, which will to cause not do free iova, and the master can still successfully get the iova of map fail, which is not expected. Therefore, we need to check the return value of iommu_map_sg_atomic in two cases according to whether it is less than 0. Fixes: ad8f36e4b6b1 ("iommu: return full error code from iommu_map_sg[_atomic]()") Signed-off-by: Yunfei Wang Cc: # 5.15.* Reviewed-by: Robin Murphy Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220507085204.16914-1-yf.wang@mediatek.com Signed-off-by: Joerg Roedel commit 4a18d21649f4f34e79a16c635e5df48cebb82e1f Author: Nicolas Dufresne Date: Tue Apr 26 14:57:30 2022 +0200 media: h264: Avoid wrapping long_term_frame_idx For long term references, frame_num is set to long_term_frame_idx which does not require wrapping. This is fixed by observation, no directly related issue have been found yet. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 86ef61ad686c176f1853a0e8b7f809f21cfadbb2 Author: Nicolas Dufresne Date: Tue Apr 26 14:57:28 2022 +0200 media: v4l2-mem2mem: Trace on implicit un-hold If the timestamp of the src buffer differs from the timestamp of a held dst buffer, the held buffer is implicitly removed and marked as done. Add a trace to help debugging if someone hits that case. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 804e192a81149ef43ccaf09ac65b264813ad511b Author: Nicolas Dufresne Date: Tue Apr 26 14:57:27 2022 +0200 media: doc: Document dual use of H.264 pic_num/frame_num These two fields need documentation as they have dual meaning. It is also confusing since pic_num is a derived value from frame_num, so this should help application developers. If we ever need to make a V2 of this API, I would suggest to remove pic_num entirely. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit de78657e16f41417da9332f09c2d67d100096939 Author: Miles Chen Date: Thu May 5 21:27:30 2022 +0800 iommu/mediatek: Fix NULL pointer dereference when printing dev_name When larbdev is NULL (in the case I hit, the node is incorrectly set iommus = <&iommu NUM>), it will cause device_link_add() fail and kernel crashes when we try to print dev_name(larbdev). Let's fail the probe if a larbdev is NULL to avoid invalid inputs from dts. It should work for normal correct setting and avoid the crash caused by my incorrect setting. Error log: [ 18.189042][ T301] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000050 ... [ 18.344519][ T301] pstate: a0400005 (NzCv daif +PAN -UAO) [ 18.345213][ T301] pc : mtk_iommu_probe_device+0xf8/0x118 [mtk_iommu] [ 18.346050][ T301] lr : mtk_iommu_probe_device+0xd0/0x118 [mtk_iommu] [ 18.346884][ T301] sp : ffffffc00a5635e0 [ 18.347392][ T301] x29: ffffffc00a5635e0 x28: ffffffd44a46c1d8 [ 18.348156][ T301] x27: ffffff80c39a8000 x26: ffffffd44a80cc38 [ 18.348917][ T301] x25: 0000000000000000 x24: ffffffd44a80cc38 [ 18.349677][ T301] x23: ffffffd44e4da4c6 x22: ffffffd44a80cc38 [ 18.350438][ T301] x21: ffffff80cecd1880 x20: 0000000000000000 [ 18.351198][ T301] x19: ffffff80c439f010 x18: ffffffc00a50d0c0 [ 18.351959][ T301] x17: ffffffffffffffff x16: 0000000000000004 [ 18.352719][ T301] x15: 0000000000000004 x14: ffffffd44eb5d420 [ 18.353480][ T301] x13: 0000000000000ad2 x12: 0000000000000003 [ 18.354241][ T301] x11: 00000000fffffad2 x10: c0000000fffffad2 [ 18.355003][ T301] x9 : a0d288d8d7142d00 x8 : a0d288d8d7142d00 [ 18.355763][ T301] x7 : ffffffd44c2bc640 x6 : 0000000000000000 [ 18.356524][ T301] x5 : 0000000000000080 x4 : 0000000000000001 [ 18.357284][ T301] x3 : 0000000000000000 x2 : 0000000000000005 [ 18.358045][ T301] x1 : 0000000000000000 x0 : 0000000000000000 [ 18.360208][ T301] Hardware name: MT6873 (DT) [ 18.360771][ T301] Call trace: [ 18.361168][ T301] dump_backtrace+0xf8/0x1f0 [ 18.361737][ T301] dump_stack_lvl+0xa8/0x11c [ 18.362305][ T301] dump_stack+0x1c/0x2c [ 18.362816][ T301] mrdump_common_die+0x184/0x40c [mrdump] [ 18.363575][ T301] ipanic_die+0x24/0x38 [mrdump] [ 18.364230][ T301] atomic_notifier_call_chain+0x128/0x2b8 [ 18.364937][ T301] die+0x16c/0x568 [ 18.365394][ T301] __do_kernel_fault+0x1e8/0x214 [ 18.365402][ T301] do_page_fault+0xb8/0x678 [ 18.366934][ T301] do_translation_fault+0x48/0x64 [ 18.368645][ T301] do_mem_abort+0x68/0x148 [ 18.368652][ T301] el1_abort+0x40/0x64 [ 18.368660][ T301] el1h_64_sync_handler+0x54/0x88 [ 18.368668][ T301] el1h_64_sync+0x68/0x6c [ 18.368673][ T301] mtk_iommu_probe_device+0xf8/0x118 [mtk_iommu] ... Cc: Robin Murphy Cc: Yong Wu Reported-by: kernel test robot Fixes: 635319a4a744 ("media: iommu/mediatek: Add device_link between the consumer and the larb devices") Signed-off-by: Miles Chen Reviewed-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220505132731.21628-1-miles.chen@mediatek.com Signed-off-by: Joerg Roedel commit 397edc703a10f670a2692e492a245f6be1fe279a Author: Yunfei Dong Date: Thu May 12 05:46:20 2022 +0200 media: mediatek: vcodec: add h264 decoder driver for mt8186 Add h264 decode driver to support mt8186. For the architecture is single core, need to add new interface to decode. Signed-off-by: Yunfei Dong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0286300e60455534b23f4b86ce79247829ceddb8 Author: Jason Gunthorpe via iommu Date: Mon May 9 13:19:19 2022 -0300 iommu: iommu_group_claim_dma_owner() must always assign a domain Once the group enters 'owned' mode it can never be assigned back to the default_domain or to a NULL domain. It must always be actively assigned to a current domain. If the caller hasn't provided a domain then the core must provide an explicit DMA blocking domain that has no DMA map. Lazily create a group-global blocking DMA domain when iommu_group_claim_dma_owner is first called and immediately assign the group to it. This ensures that DMA is immediately fully isolated on all IOMMU drivers. If the user attaches/detaches while owned then detach will set the group back to the blocking domain. Slightly reorganize the call chains so that __iommu_group_set_core_domain() is the function that removes any caller configured domain and sets the domains back a core owned domain with an appropriate lifetime. __iommu_group_set_domain() is the worker function that can change the domain assigned to a group to any target domain, including NULL. Add comments clarifying how the NULL vs detach_dev vs default_domain works based on Robin's remarks. This fixes an oops with VFIO and SMMUv3 because VFIO will call iommu_detach_group() and then immediately iommu_domain_free(), but SMMUv3 has no way to know that the domain it is holding a pointer to has been freed. Now the iommu_detach_group() will assign the blocking domain and SMMUv3 will no longer hold a stale domain reference. Fixes: 1ea2a07a532b ("iommu: Add DMA ownership management interfaces") Reported-by: Qian Cai Tested-by: Baolu Lu Tested-by: Nicolin Chen Co-developed-by: Robin Murphy Signed-off-by: Robin Murphy Signed-off-by: Jason Gunthorpe -- Just minor polishing as discussed v3: - Change names to __iommu_group_set_domain() / __iommu_group_set_core_domain() - Clarify comments - Call __iommu_group_set_domain() directly in iommu_group_release_dma_owner() since we know it is always selecting the default_domain - Remove redundant detach_dev ops check in __iommu_detach_device and make the added WARN_ON fail instead - Check for blocking_domain in __iommu_attach_group() so VFIO can actually attach a new group - Update comments and spelling - Fix missed change to new_domain in iommu_group_do_detach_device() v2: https://lore.kernel.org/r/0-v2-f62259511ac0+6-iommu_dma_block_jgg@nvidia.com v1: https://lore.kernel.org/r/0-v1-6e9d2d0a759d+11b-iommu_dma_block_jgg@nvidia.com Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/0-v3-db7f0785022b+149-iommu_dma_block_jgg@nvidia.com Signed-off-by: Joerg Roedel commit f3d2a97561f62ef03c7ced9024d48d2b181c0a53 Author: Yunfei Dong Date: Thu May 12 05:46:19 2022 +0200 media: mediatek: vcodec: Support MT8186 Adds MT8186's compatible "mediatek,mt8186-vcodec-dec". Adds MT8186's device private data mtk_vdec_single_core_pdata. Signed-off-by: Yunfei Dong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2b54af6ca600fcb0d779bb2a1855cfa26995edf4 Author: Yunfei Dong Date: Thu May 12 05:46:18 2022 +0200 media: dt-bindings: media: mediatek: vcodec: Adds decoder dt-bindings for mt8186 Adds decoder dt-bindings for mt8186. Signed-off-by: Yunfei Dong Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c10c0086db688c95bb4e0e378e523818dff1551d Author: Yunfei Dong Date: Thu May 12 04:19:50 2022 +0200 media: mediatek: vcodec: prevent kernel crash when rmmod mtk-vcodec-dec.ko If the driver support subdev mode, the parameter "dev->pm.dev" will be NULL in mtk_vcodec_dec_remove. Kernel will crash when try to rmmod mtk-vcodec-dec.ko. [ 4380.702726] pc : do_raw_spin_trylock+0x4/0x80 [ 4380.707075] lr : _raw_spin_lock_irq+0x90/0x14c [ 4380.711509] sp : ffff80000819bc10 [ 4380.714811] x29: ffff80000819bc10 x28: ffff3600c03e4000 x27: 0000000000000000 [ 4380.721934] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 [ 4380.729057] x23: ffff3600c0f34930 x22: ffffd5e923549000 x21: 0000000000000220 [ 4380.736179] x20: 0000000000000208 x19: ffffd5e9213e8ebc x18: 0000000000000020 [ 4380.743298] x17: 0000002000000000 x16: ffffd5e9213e8e90 x15: 696c346f65646976 [ 4380.750420] x14: 0000000000000000 x13: 0000000000000001 x12: 0000000000000040 [ 4380.757542] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 [ 4380.764664] x8 : 0000000000000000 x7 : ffff3600c7273ae8 x6 : ffffd5e9213e8ebc [ 4380.771786] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 [ 4380.778908] x2 : 0000000000000000 x1 : ffff3600c03e4000 x0 : 0000000000000208 [ 4380.786031] Call trace: [ 4380.788465] do_raw_spin_trylock+0x4/0x80 [ 4380.792462] __pm_runtime_disable+0x2c/0x1b0 [ 4380.796723] mtk_vcodec_dec_remove+0x5c/0xa0 [mtk_vcodec_dec] [ 4380.802466] platform_remove+0x2c/0x60 [ 4380.806204] __device_release_driver+0x194/0x250 [ 4380.810810] driver_detach+0xc8/0x15c [ 4380.814462] bus_remove_driver+0x5c/0xb0 [ 4380.818375] driver_unregister+0x34/0x64 [ 4380.822288] platform_driver_unregister+0x18/0x24 [ 4380.826979] mtk_vcodec_dec_driver_exit+0x1c/0x888 [mtk_vcodec_dec] [ 4380.833240] __arm64_sys_delete_module+0x190/0x224 [ 4380.838020] invoke_syscall+0x48/0x114 [ 4380.841760] el0_svc_common.constprop.0+0x60/0x11c [ 4380.846540] do_el0_svc+0x28/0x90 [ 4380.849844] el0_svc+0x4c/0x100 [ 4380.852975] el0t_64_sync_handler+0xec/0xf0 [ 4380.857148] el0t_64_sync+0x190/0x194 [ 4380.860801] Code: 94431515 17ffffca d503201f d503245f (b9400004) Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5d418351ca8f17defa1170d968df161c35b810e3 Author: Yunfei Dong Date: Thu May 12 04:19:49 2022 +0200 media: mediatek: vcodec: support stateless VP9 decoding Add support for VP9 decoding using the stateless API, as supported by MT8192. And the drivers is lat and core architecture. Signed-off-by: Yunfei Dong Signed-off-by: George Sun Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0deb6a025ae8c850dc8685be39fb27b06c88736 Author: Pavel Begunkov Date: Fri May 13 11:24:56 2022 +0100 io_uring: avoid io-wq -EAGAIN looping for !IOPOLL If an opcode handler semi-reliably returns -EAGAIN, io_wq_submit_work() might continue busily hammer the same handler over and over again, which is not ideal. The -EAGAIN handling in question was put there only for IOPOLL, so restrict it to IOPOLL mode only where there is no other recourse than to retry as we cannot wait. Fixes: def596e9557c9 ("io_uring: support for IO polling") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f168b4f24181942f3614dd8ff648221736f572e6.1652433740.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7a7ae26fd458397d04421756dd19e5b8cf29a08f Author: Yunfei Dong Date: Thu May 12 04:19:48 2022 +0200 media: mediatek: vcodec: support stateless VP8 decoding Add support for VP8 decoding using the stateless API, as supported by MT8192. Signed-off-by: Yunfei Dong Reviewed-by: Nicolas Dufresne Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 59fba9eed5a736caa257df4738c57ff72492365f Author: Yunfei Dong Date: Thu May 12 04:19:47 2022 +0200 media: mediatek: vcodec: support stateless H.264 decoding for mt8192 Adds h264 lat and core architecture driver for mt8192, and the decode mode is frame based for stateless decoder. Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 553b0cb30b5452198de3187f1a79989eba38df00 Author: Xiao Yang Date: Fri May 13 18:16:37 2022 +0800 x86/speculation: Add missing srbds=off to the mitigations= help text The mitigations= cmdline option help text misses the srbds=off option. Add it. [ bp: Add a commit message. ] Signed-off-by: Xiao Yang Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220513101637.216487-1-yangx.jy@fujitsu.com commit 024b1f4fedc87db2aeea77dbfb1b32bbac096304 Author: Yunfei Dong Date: Thu May 12 04:19:46 2022 +0200 media: mediatek: vcodec: Extract H264 common code Mt8192 can use some of common code with mt8183. Moves them to a new file in order to reuse. [hverkuil: replaced memcpy_toio by memcpy, was left over from a prev version] Signed-off-by: Yunfei Dong Reviewed-by: Nicolas Dufresne Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ba9a7dbb232e2694c5885fbd651879fabf44c2e9 Author: Yunfei Dong Date: Thu May 12 04:19:45 2022 +0200 media: mediatek: vcodec: record capture queue format type The capture queue format type may be differ depending on platform: for stateless decoder drivers, we need to calculate the capture buffer size according to the capture queue format type in SCP. As a preparation for introducing drivers for stateless decoding, save the current capture queue type on a per vcodec context basis. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d856b360aa82f0aa60bc469413743bf88768ac61 Author: Yunfei Dong Date: Thu May 12 04:19:44 2022 +0200 media: mediatek: vcodec: Fix v4l2-compliance fail Need to use default pic info when get pic info fail. Signed-off-by: Yunfei Dong Reviewed-by: Steve Cho Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit abd12e85fc95c8ec7277bfe42da222937620a949 Author: Yunfei Dong Date: Thu May 12 04:19:43 2022 +0200 media: mediatek: vcodec: disable vp8 4K capability For vp8 not support 4K, need to disable it. Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f0a17f75d6c7f9a971c5390d1522700388931cf9 Author: Yunfei Dong Date: Thu May 12 04:19:42 2022 +0200 media: mediatek: vcodec: Add format to support MT21C Needs to use mediatek compressed mode for mt8192 decoder. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 76250b48de79f4a7a2708394aecd2009a0417cc1 Author: Yunfei Dong Date: Thu May 12 04:19:41 2022 +0200 media: mediatek: vcodec: Getting supported decoder format types Getting supported output and capture queue format types according to decoder capability. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f40b567da65694e430a617c54f760204665b5daf Author: Yunfei Dong Date: Thu May 12 04:19:40 2022 +0200 media: mediatek: vcodec: Refactor supported vdec formats and framesizes Supported output and capture format types for mt8192 are different with mt8183. Redefine parameters to store them. Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7b182b8d9c852343fb34923a2d1b4e61421b37c7 Author: Yunfei Dong Date: Thu May 12 04:19:39 2022 +0200 media: mediatek: vcodec: Refactor get and put capture buffer flow For lat and core decode in parallel, need to get capture buffer when core start to decode and put capture buffer to display list when core decode done. Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 22d35e40419a2ac0914fb6b05c8781c9af8d4126 Author: Amit Kumar Mahapatra Date: Thu May 12 20:20:25 2022 +0530 spi: spi-cadence: Update ISR status variable type to irqreturn_t Data type of status variable, that hold the return value of the ISR, should be irqreturn_t & not u32. This patch updates status variable type to irqreturn_t. Signed-off-by: Amit Kumar Mahapatra Link: https://lore.kernel.org/r/20220512145025.20205-1-amit.kumar-mahapatra@xilinx.com Signed-off-by: Mark Brown commit f8c52711530b8d99d9612f26b4d0648e62589c8a Author: Yunfei Dong Date: Thu May 12 04:19:38 2022 +0200 media: mediatek: vcodec: set each plane bytesused in buf prepare call vb2_set_plane_payload to set each plane bytesused in buf prepare, need not to set independently for stateless and statefull architectures. Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b018be06f3c71375bc056757107124bff2ef196f Author: Yunfei Dong Date: Thu May 12 04:19:37 2022 +0200 media: mediatek: vcodec: Read max resolution from dec_capability Supported max resolution for different platforms are not the same: 2K or 4K, getting it according to dec_capability. Signed-off-by: Yunfei Dong Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d12a3c1fa0cee10f140e80074f04621a748521c0 Author: Yunfei Dong Date: Thu May 12 04:19:36 2022 +0200 media: mediatek: vcodec: get capture queue buffer size from scp Different capture buffer format has different buffer size, need to get real buffer size according to buffer type from scp. Signed-off-by: Yunfei Dong Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2077759b7011cbe452d4c884cdd14bac0550974b Author: Yunfei Dong Date: Thu May 12 04:19:35 2022 +0200 media: mediatek: vcodec: Using firmware type to separate different firmware architecture MT8173 platform use vpu firmware, mt8183/mt8192 will use scp firmware instead, using chip name is not reasonable to separate different firmware architecture. Using firmware type is much better. Signed-off-by: Yunfei Dong Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7c6785d2e18d91c3ea273cd8bafeaad54f2f52eb Author: Yunfei Dong Date: Thu May 12 04:19:34 2022 +0200 media: mediatek: vcodec: Add vdec enable/disable hardware helpers Lock, power and clock are highly coupled operations. Adds vdec enable/disable hardware helpers and uses them. Signed-off-by: Yunfei Dong Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 08a83828825cbf3bc2c9f582a4cd4da9f40c77d6 Author: Yunfei Dong Date: Sat Apr 23 09:35:31 2022 +0200 media: mediatek: vcodec: Fix v4l2 compliance decoder cmd test fail Will return -EINVAL using standard framework api when test stateless decoder with cmd VIDIOC_(TRY)DECODER_CMD. Disable them to adjust v4l2 compliance test for user driver(GStreamer/Chrome) won't use decoder cmd. Fixes: 8cdc3794b2e3 ("media: mtk-vcodec: vdec: support stateless API") Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f60e2de515095d04a05c6fc169ab6457bc70f3da Author: Pali Rohár Date: Thu May 12 11:59:39 2022 +0200 ARM: dts: turris-omnia: Add atsha204a node Crypto module atsha204a is available at i2c address 0x64. Module is used for symmetric cryptography and provides also hardware random number generator and OTP storage for device serial number and MAC addresses. Signed-off-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit a8da73a32b6e9271a613e5a0e90a8c35f40abeb8 Author: Jens Axboe Date: Mon May 9 09:29:14 2022 -0600 io_uring: add flag for allocating a fully sparse direct descriptor space Currently to setup a fully sparse descriptor space upfront, the app needs to alloate an array of the full size and memset it to -1 and then pass that in. Make this a bit easier by allowing a flag that simply does this internally rather than needing to copy each slot separately. This works with IORING_REGISTER_FILES2 as the flag is set in struct io_uring_rsrc_register, and is only allow when the type is IORING_RSRC_FILE as this doesn't make sense for registered buffers. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 09893e15f1e9910711c152cd126ccfa85581ba83 Author: Jens Axboe Date: Mon May 9 09:11:01 2022 -0600 io_uring: bump max direct descriptor count to 1M We currently limit these to 32K, but since we're now backing the table space with vmalloc when needed, there's no reason why we can't make it bigger. The total space is limited by RLIMIT_NOFILE as well. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit c30c3e00cbd96f0cce478efba41dbe78dad8c774 Author: Jens Axboe Date: Sat May 7 10:08:31 2022 -0600 io_uring: allow allocated fixed files for accept If the application passes in IORING_FILE_INDEX_ALLOC as the file_slot, then that's a hint to allocate a fixed file descriptor rather than have one be passed in directly. This can be useful for having io_uring manage the direct descriptor space, and also allows multi-shot support to work with fixed files. Normal accept direct requests will complete with 0 for success, and < 0 in case of error. If io_uring is asked to allocated the direct descriptor, then the direct descriptor is returned in case of success. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 1339f24b336db5ded9811f3fe7b948e0de207785 Author: Jens Axboe Date: Sat May 7 14:18:44 2022 -0600 io_uring: allow allocated fixed files for openat/openat2 If the application passes in IORING_FILE_INDEX_ALLOC as the file_slot, then that's a hint to allocate a fixed file descriptor rather than have one be passed in directly. This can be useful for having io_uring manage the direct descriptor space. Normal open direct requests will complete with 0 for success, and < 0 in case of error. If io_uring is asked to allocated the direct descriptor, then the direct descriptor is returned in case of success. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit b70b8e3331d8134ab993368a6e0eb18c1acb1b1d Author: Jens Axboe Date: Sat May 7 14:20:40 2022 -0600 io_uring: add basic fixed file allocator Applications currently always pick where they want fixed files to go. In preparation for allowing these types of commands with multishot support, add a basic allocator in the fixed file table. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit d78bd8adfcbc55b9dc01e9034a55b2a61a2124dc Author: Jens Axboe Date: Sat May 7 09:56:13 2022 -0600 io_uring: track fixed files with a bitmap In preparation for adding a basic allocator for direct descriptors, add helpers that set/clear whether a file slot is used. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit dc5d8bfa3a37d170769eefc90a89d600212d7bf7 Merge: f03e95098e531 6041558ebf1fc Author: Arnd Bergmann Date: Fri May 13 14:25:21 2022 +0200 Merge tag 'at91-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/soc AT91 & POLARFIRE SoC #1 for 5.19: - Power Management: add possibility to implement specific pm quirks for some SoCs - Kconfig update for AT91 PIT64 and LAN966 low-level debugging - sama5d2: add secure calls to OP-TEE and secure suspend * tag 'at91-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: debug: add lan966 support ARM: at91: pm: add support for sama5d2 secure suspend ARM: at91: add code to handle secure calls ARM: at91: Kconfig: implement PIT64B selection ARM: at91: pm: add quirks for pm ARM: at91: pm: use kernel documentation style ARM: at91: pm: introduce macros for pm mode replacement ARM: at91: pm: keep documentation inline with structure members Link: https://lore.kernel.org/r/20220513121701.77683-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 2cc1cd26e913848738f31fbb07663f0fe2d98fa4 Author: Mark Brown Date: Fri May 13 13:06:32 2022 +0100 ARM: configs: Enable ASoC AC'97 glue AC'97 was quite commonly used on at least i.MX designs so enable the glue code that allows use of AC'97 with ASoC based designs to improve testing coverage. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220513120632.168148-1-broonie@kernel.org' Signed-off-by: Arnd Bergmann commit f03e95098e5310a27face004c6d6a03a782db765 Merge: 30258ae65a06b 537f8ffbdf4b9 Author: Arnd Bergmann Date: Fri May 13 14:13:06 2022 +0200 Merge tag 'v5.18-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/soc mmsys: - add SW reset to MT8192 - add support for MT8195 pmic wrapper: - update binding description needed for future MT8195 support mutex: - add support for MT8195 cmdq helper: - remove legacy callback * tag 'v5.18-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: mutex: remove mt8195 MOD0 and SOF0 definition dt-bindings: pwrap: mediatek: Update pwrap document for mt8195 soc: mediatek: add DDP_DOMPONENT_DITHER0 enum for mt8195 vdosys0 soc: mediatek: add mtk-mutex support for mt8195 vdosys0 soc: mediatek: add mtk-mmsys support for mt8195 vdosys0 soc: mediatek: cmdq: Use mailbox rx_callback instead of cmdq_task_cb dt-bindings: arm: mediatek: mmsys: add mt8195 SoC binding dt-bindings: arm: mediatek: mmsys: add power and gce properties soc: mediatek: mmsys: Add sw0_rst_offset for MT8192 Link: https://lore.kernel.org/r/6412eecf-a4c3-cf06-55ff-9df8b0656d21@gmail.com Signed-off-by: Arnd Bergmann commit e17142e069135371cffb911efb668ba7d1c1a8aa Merge: a2e8bbe07276d d66aea197d534 Author: Arnd Bergmann Date: Fri May 13 14:02:29 2022 +0200 Merge tag 'v5.18-next-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/defconfig - Enable essential PMIC and regulatro drivers for MT8195. - Enable Arm arch timer for MT7629. * tag 'v5.18-next-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: mediatek: select arch timer for mt7629 arm64: defconfig: enable some mt6360 PMIC drivers arm64: defconfig: enable MT6359 regulator driver Link: https://lore.kernel.org/r/3a6e5606-7b89-2ad8-7b45-21d3a4e9e706@gmail.com Signed-off-by: Arnd Bergmann commit a65cc84355407d1b149d4fd6843ac5cd18168bcc Merge: 9e2bc267e7806 ab0bed4bf6fae Author: David S. Miller Date: Fri May 13 12:47:41 2022 +0100 Merge branch 'bnxt_en-next' Michael Chan says: ==================== bnxt_en: Updates for net-next This small patchset updates the firmware interface, adds timestamping support for all receive packets, and adds revised NVRAM package error messages for ethtool and devlink. ==================== Signed-off-by: David S. Miller commit ab0bed4bf6fae8a42cf3b08b38e1fffb1a79193a Author: Kalesh AP Date: Thu May 12 22:40:24 2022 -0400 bnxt_en: parse and report result field when NVRAM package install fails Instead of always returning -ENOPKG, decode the firmware error code further when the HWRM_NVM_INSTALL_UPDATE firmware call fails. Return a more suitable error code to userspace and log an error in dmesg. This is version 2 of the earlier patch that was reverted: 02acd399533e ("bnxt_en: parse result field when NVRAM package install fails") In this new version, if the call is made through devlink instead of ethtool, we'll also set the error message in extack. Link: https://lore.kernel.org/netdev/20220307141358.4d52462e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 66ed81dcedc665bf8c7dfc3867d425f50eba219e Author: Pavan Chebbi Date: Thu May 12 22:40:23 2022 -0400 bnxt_en: Enable packet timestamping for all RX packets Add driver support to enable timestamping on all RX packets that are received by the NIC. This capability can be requested by the applications using SIOCSHWTSTAMP ioctl with filter type HWTSTAMP_FILTER_ALL. Cc: Richard Cochran Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 11862689e8f117e4702f55000790d7bce6859e84 Author: Pavan Chebbi Date: Thu May 12 22:40:22 2022 -0400 bnxt_en: Configure ptp filters during bnxt open For correctness, we need to configure the packet filters for timestamping during bnxt_open. This way they are always configured after firmware reset or chip reset. We should not assume that the filters will always be retained across resets. This patch modifies the ioctl handler and always configures the PTP filters in the bnxt_open() path. Cc: Richard Cochran Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ad04cc058d644acc6c903d8da4b8d59aa2b6335e Author: Michael Chan Date: Thu May 12 22:40:21 2022 -0400 bnxt_en: Update firmware interface to 1.10.2.95 The main changes are timestamp support for all RX packets and new PCIe statistics. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 0a4cad9c11ad46662ede48d94f08ecb7cd9f6916 Author: Enric Balletbo i Serra Date: Fri May 13 12:52:09 2022 +0500 platform/chrome: Add ChromeOS ACPI device driver The x86 Chromebooks have the ChromeOS ACPI device. This driver attaches to the ChromeOS ACPI device and exports the values reported by ACPI in a sysfs directory. This data isn't present in ACPI tables when read through ACPI tools, hence a driver is needed to do it. The driver gets data from firmware using the ACPI component of the kernel. The ACPI values are presented in string form (numbers as decimal values) or binary blobs, and can be accessed as the contents of the appropriate read only files in the standard ACPI device's sysfs directory tree. This data is consumed by the ChromeOS user space. Reviewed-by: Guenter Roeck Reviewed-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman Acked-by: Rafael J. Wysocki Signed-off-by: Enric Balletbo i Serra Co-developed-by: Muhammad Usama Anjum Signed-off-by: Muhammad Usama Anjum Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/Yn4OKYrtV35Dv+nd@debian-BULLSEYE-live-builder-AMD64 commit 6041558ebf1fc87d1e0bdeb51e985807dab06bed Author: Kavyasree Kotagiri Date: Fri May 13 14:55:30 2022 +0530 ARM: at91: debug: add lan966 support Add support for low-level debugging on FLEXCOM USART of LAN966 SoC. Signed-off-by: Kavyasree Kotagiri Reviewed-by: Michael Walle Tested-by: Michael Walle Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220513092530.19213-1-kavyasree.kotagiri@microchip.com commit 2852ebfa10afdcefff35ec72c8da97141df9845c Author: Nicholas Piggin Date: Thu Mar 3 15:33:15 2022 +1000 KVM: PPC: Book3S HV Nested: L2 LPCR should inherit L1 LPES setting The L1 should not be able to adjust LPES mode for the L2. Setting LPES if the L0 needs it clear would cause external interrupts to be sent to L2 and missed by the L0. Clearing LPES when it may be set, as typically happens with XIVE enabled could cause a performance issue despite having no native XIVE support in the guest, because it will cause mediated interrupts for the L2 to be taken in HV mode, which then have to be injected. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-7-npiggin@gmail.com commit 11681b79b1ab52e7625844d7ce52c4d5201a43b2 Author: Nicholas Piggin Date: Thu Mar 3 15:33:14 2022 +1000 KVM: PPC: Book3S HV Nested: L2 must not run with L1 xive context The PowerNV L0 currently pushes the OS xive context when running a vCPU, regardless of whether it is running a nested guest. The problem is that xive OS ring interrupts will be delivered while the L2 is running. At the moment, by default, the L2 guest runs with LPCR[LPES]=0, which actually makes external interrupts go to the L0. That causes the L2 to exit and the interrupt taken or injected into the L1, so in some respects this behaves like an escalation. It's not clear if this was deliberate or not, there's no comment about it and the L1 is actually allowed to clear LPES in the L2, so it's confusing at best. When the L2 is running, the L1 is essentially in a ceded state with respect to external interrupts (it can't respond to them directly and won't get scheduled again absent some additional event). So the natural way to solve this is when the L0 handles a H_ENTER_NESTED hypercall to run the L2, have it arm the escalation interrupt and don't push the L1 context while running the L2. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-6-npiggin@gmail.com commit 42b4a2b347b09e7ee4c86f7121e3b45214b63e69 Author: Nicholas Piggin Date: Thu Mar 3 15:33:13 2022 +1000 KVM: PPC: Book3S HV P9: Split !nested case out from guest entry The differences between nested and !nested will become larger in later changes so split them out for readability. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-5-npiggin@gmail.com commit ad5ace91c55e7bd16813617f67bcb7619d51a295 Author: Nicholas Piggin Date: Thu Mar 3 15:33:12 2022 +1000 KVM: PPC: Book3S HV P9: Move cede logic out of XIVE escalation rearming Move the cede abort logic out of xive escalation rearming and into the caller to prepare for handling a similar case with nested guest entry. Signed-off-by: Nicholas Piggin Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-4-npiggin@gmail.com commit 026728dc5d41f830e8194fe01e432dd4eb9b3d9a Author: Nicholas Piggin Date: Thu Mar 3 15:33:11 2022 +1000 KVM: PPC: Book3S HV P9: Inject pending xive interrupts at guest entry If there is a pending xive interrupt, inject it at guest entry (if MSR[EE] is enabled) rather than take another interrupt when the guest is entered. If xive is enabled then LPCR[LPES] is set so this behaviour should be expected. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-3-npiggin@gmail.com commit f104df7d519ff1aa92c7ec87e124c88d4e7574cd Author: Nicholas Piggin Date: Sun Jan 23 22:00:43 2022 +1000 KVM: PPC: Book3S HV: Remove KVMPPC_NR_LPIDS KVMPPC_NR_LPIDS no longer represents any size restriction on the LPID space and can be removed. A CPU with more than 12 LPID bits implemented will now be able to create more than 4095 guests. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-7-npiggin@gmail.com commit 03a2e65f54b3acae37f0992133d2f4d1d35f4200 Author: Nicholas Piggin Date: Sun Jan 23 22:00:42 2022 +1000 KVM: PPC: Book3S Nested: Use explicit 4096 LPID maximum Rather than tie this to KVMPPC_NR_LPIDS which is becoming more dynamic, fix it to 4096 (12-bits) explicitly for now. kvmhv_get_nested() does not have to check against KVM_MAX_NESTED_GUESTS because the L1 partition table registration hcall already did that, and it checks against the partition table size. This patch also puts all the partition table size calculations into the same form, using 12 for the architected size field shift and 4 for the shift corresponding to the partition table entry size. Reviewed-by: Fabiano Rosas Signed-of-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-6-npiggin@gmail.com commit c0f00a18e2a8c350a9d263aaf9a2c8bc86caa1b0 Author: Nicholas Piggin Date: Sun Jan 23 22:00:41 2022 +1000 KVM: PPC: Book3S HV Nested: Change nested guest lookup to use idr This removes the fixed sized kvm->arch.nested_guests array. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-5-npiggin@gmail.com commit 6ba2a2924dcf6026de5078ba7025248a580d8bde Author: Nicholas Piggin Date: Sun Jan 23 22:00:40 2022 +1000 KVM: PPC: Book3S HV: Use IDA allocator for LPID allocator This removes the fixed-size lpid_inuse array. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-4-npiggin@gmail.com commit 5d506f159b2b9d0c9bee9bb43ccafb4f291143c2 Author: Nicholas Piggin Date: Sun Jan 23 22:00:39 2022 +1000 KVM: PPC: Book3S HV: Update LPID allocator init for POWER9, Nested The LPID allocator init is changed to: - use mmu_lpid_bits rather than hard-coding; - use KVM_MAX_NESTED_GUESTS for nested hypervisors; - not reserve the top LPID on POWER9 and newer CPUs. The reserved LPID is made a POWER7/8-specific detail. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-3-npiggin@gmail.com commit 18827eeef022df43c1fdeca0fde00ca09405dff1 Author: Nicholas Piggin Date: Sun Jan 23 22:00:38 2022 +1000 KVM: PPC: Remove kvmppc_claim_lpid Removing kvmppc_claim_lpid makes the lpid allocator API a bit simpler to change the underlying implementation in a future patch. The host LPID is always 0, so that can be a detail of the allocator. If the allocator range is restricted, that can reserve LPIDs at the top of the range. This allows kvmppc_claim_lpid to be removed. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123120043.3586018-2-npiggin@gmail.com commit 361234d7a1c9a5290d33e35d49821b7a32a32854 Author: Nicholas Piggin Date: Sun Jan 23 21:47:25 2022 +1000 KVM: PPC: Book3S HV P9: Optimise loads around context switch It is better to get all loads for the register values in flight before starting to switch LPID, PID, and LPCR because those mtSPRs are expensive and serialising. This also just tidies up the code for a potential future change to the context switching sequence. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220123114725.3549202-1-npiggin@gmail.com commit 861604614a94a7aabc111e4a18aaf5d56d270e8a Author: Nicholas Piggin Date: Sat Jan 22 20:56:39 2022 +1000 KVM: PPC: Book3S HV: HFSCR[PREFIX] does not exist This facility is controlled by FSCR only. Reserved bits should not be set in the HFSCR register (although it's likely harmless as this position would not be re-used, and the L0 is forgiving here too). Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220122105639.3477407-1-npiggin@gmail.com commit c75104762ddace5973deb4ea54d35bf2b64bba98 Author: Nícolas F. R. A. Prado Date: Wed May 4 17:45:16 2022 -0400 arm64: dts: mt8192: Follow binding order for SCP registers The dt-binding for SCP documents the reg-names order as sram, cfg, l1tcm. Update the SCP node on the mt8192 devicetree to follow that order, which gets rid of a dtbs_check warning. This doesn't change any behavior since the SCP driver accesses the memory regions through the names anyway. Fixes: c63556ec6bfe ("arm64: dts: mt8192: Add SCP node") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220504214516.2957504-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 5ba090a03af2074841342bbe5fee45260ec62144 Author: Chuanhong Guo Date: Sun Apr 24 11:25:27 2022 +0800 arm64: dts: mediatek: add mtk-snfi for mt7622 This patch adds a device-tree node for the MTK SPI-NAND Flash Interface for MT7622 device tree. Signed-off-by: Chuanhong Guo Link: https://lore.kernel.org/r/20220424032527.673605-6-gch981213@gmail.com Signed-off-by: Matthias Brugger commit 7640d4350ae89df0ef142144c93e0ae48d623b69 Author: Fabien Parent Date: Tue Apr 26 15:41:05 2022 +0200 arm64: dts: mediatek: mt8195-demo: enable uart1 The UART1 is exposed on a header. Enable the uart1 node to be able to use it. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20220426134106.242353-8-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 8a87419481f2d51a7bd03617d363faf5f2b0e1b3 Author: Fabien Parent Date: Tue Apr 26 15:41:04 2022 +0200 arm64: dts: mediatek: mt8195-demo: Remove input-name property This property doesn't seem to exist in the documentation nor in source code, let's remove it from the device-tree. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20220426134106.242353-7-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 41d2d562e89cb9b9558242653862a932fd877f9a Author: Fabien Parent Date: Tue Apr 26 18:47:55 2022 +0200 arm64: dts: mediatek: mt8183-pumpkin: fix bad thermistor node name Fix the following dtbs_check error by using the correct node name: /home/fabo/build/linux/mt8183-pumpkin/arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dtb: ntc: $nodename:0: 'ntc' does not match '^thermistor(.*)?$' From schema: /home/fabo/devel/baylibre/linux-mainline/Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml Signed-off-by: Fabien Parent Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220426164755.435372-1-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 80dd27b6c68c7189b865b4b966aa12c77d1adc1e Author: Rui Salvaterra Date: Thu Apr 28 23:57:55 2022 +0100 arm64: dts: mt7622: specify the L2 cache topology On an MT7622 system, the kernel complains of not being able to detect the cache hierarchy of CPU 0. Specify the shared L2 cache node in the device tree, in order to fix this. Signed-off-by: Rui Salvaterra Link: https://lore.kernel.org/r/20220428225755.785153-1-rsalvaterra@gmail.com Signed-off-by: Matthias Brugger commit 7d029cc240a012f0259477c905e84f3975d7cf2f Author: Rui Salvaterra Date: Fri Apr 29 09:42:25 2022 +0100 arm64: dts: mt7622: specify the number of DMA requests The MT7622 device tree never bothered to specify the number of virtual DMA channels for the HSDMA controller, always falling back to the default value of 3. Make this value explicit, in order to avoid the following dmesg notification: mtk_hsdma 1b007000.dma-controller: Using 3 as missing dma-requests property Signed-off-by: Rui Salvaterra Link: https://lore.kernel.org/r/20220429084225.298213-1-rsalvaterra@gmail.com Signed-off-by: Matthias Brugger commit c88fd98110242ed56b24284dd975fe54f2f65756 Author: Dang Huynh Date: Mon Apr 25 13:48:51 2022 +0700 arm64: dts: mediatek: pumpkin: Remove input-name property This property doesn't seem to exist in the documentation nor in source code, but for some reason it is defined in a bunch of device trees. Signed-off-by: Dang Huynh Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220425064850.246228-1-danct12@riseup.net Signed-off-by: Matthias Brugger commit 3b42055388c30f2761a2d9cd9af2c99611dfe457 Author: Luiz Augusto von Dentz Date: Thu May 12 15:31:34 2022 -0700 Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan When suspending the passive scanning _must_ have its filter_policy set to 0x01 to use the accept list otherwise _any_ advertise report would end up waking up the system. In order to fix the filter_policy the code now checks for hdev->suspended && HCI_CONN_FLAG_REMOTE_WAKEUP first, since the MGMT_OP_SET_DEVICE_FLAGS will reject any attempt to set HCI_CONN_FLAG_REMOTE_WAKEUP when it cannot be programmed in the acceptlist, so it can return success causing the proper filter_policy to be used. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215768 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit a9a347655d224fa2841877957b34fc9d491fc2d7 Author: Luiz Augusto von Dentz Date: Thu May 12 15:31:33 2022 -0700 Bluetooth: MGMT: Add conditions for setting HCI_CONN_FLAG_REMOTE_WAKEUP HCI_CONN_FLAG_REMOTE_WAKEUP can only be set if device can be programmed in the allowlist which in case of device using RPA requires LL Privacy support to be enabled. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215768 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 9e2bc267e78068b512d4409b884662f425adb1ec Author: Robert Hancock Date: Thu May 12 11:18:53 2022 -0600 net: axienet: Use NAPI for TX completion path This driver was using the TX IRQ handler to perform all TX completion tasks. Under heavy TX network load, this can cause significant irqs-off latencies (found to be in the hundreds of microseconds using ftrace). This can cause other issues, such as overrunning serial UART FIFOs when using high baud rates with limited UART FIFO sizes. Switch to using a NAPI poll handler to perform the TX completion work to get this out of hard IRQ context and avoid the IRQ latency impact. A separate poll handler is used for TX and RX since they have separate IRQs on this controller, so that the completion work for each of them stays on the same CPU as the interrupt. Testing on a Xilinx MPSoC ZU9EG platform using iperf3 from a Linux PC through a switch at 1G link speed showed no significant change in TX or RX throughput, with approximately 941 Mbps before and after. Hard IRQ time in the TX throughput test was significantly reduced from 12% to below 1% on the CPU handling TX interrupts, with total hard+soft IRQ CPU usage dropping from about 56% down to 48%. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit f0cf4000f5867ec4325d19d32bd83cf583065667 Author: Robert Hancock Date: Thu May 12 11:18:52 2022 -0600 net: axienet: Be more careful about updating tx_bd_tail The axienet_start_xmit function was updating the tx_bd_tail variable multiple times, with potential rollbacks on error or invalid intermediate positions, even though this variable is also used in the TX completion path. Use READ_ONCE where this variable is read and WRITE_ONCE where it is written to make this update more atomic, and move the write before the MMIO write to start the transfer, so it is protected by that implicit write barrier. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit baabb7f530e8a3f0085d12f4ea0bada4115515d3 Author: Sean Wang Date: Fri May 13 05:38:11 2022 +0800 Bluetooth: btmtksdio: fix the reset takes too long Sending WMT command during the reset in progress is invalid and would get no response from firmware until the reset is complete, so we ignore the WMT command here to resolve the issue which causes the whole reset process taking too long. Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 7469720563e01f479ec5afe06bd6f440f965d523 Author: Sean Wang Date: Fri May 13 05:38:12 2022 +0800 Bluetooth: btmtksdio: fix possible FW initialization failure According to FW advised sequence, mt7921s need to re-acquire privilege immediately after the firmware download is complete before normal running. Otherwise, it is still possible the bus may be stuck in an abnormal status that causes FW initialization failure in the current driver. Fixes: 752aea58489f ("Bluetooth: mt7921s: fix bus hang with wrong privilege") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 4915d50e300e96929d2462041d6f6c6f061167fd Author: Eric Dumazet Date: Thu May 12 09:56:01 2022 -0700 inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH() INET_MATCH() runs without holding a lock on the socket. We probably need to annotate most reads. This patch makes INET_MATCH() an inline function to ease our changes. v2: We remove the 32bit version of it, as modern compilers should generate the same code really, no need to try to be smarter. Also make 'struct net *net' the first argument. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0fab6361c4ba17d1b43a991bef4238a3c1754d35 Author: Sean Wang Date: Thu May 12 06:22:15 2022 +0800 Bluetooth: btmtksdio: fix use-after-free at btmtksdio_recv_event We should not access skb buffer data anymore after hci_recv_frame was called. [ 39.634809] BUG: KASAN: use-after-free in btmtksdio_recv_event+0x1b0 [ 39.634855] Read of size 1 at addr ffffff80cf28a60d by task kworker [ 39.634962] Call trace: [ 39.634974] dump_backtrace+0x0/0x3b8 [ 39.634999] show_stack+0x20/0x2c [ 39.635016] dump_stack_lvl+0x60/0x78 [ 39.635040] print_address_description+0x70/0x2f0 [ 39.635062] kasan_report+0x154/0x194 [ 39.635079] __asan_report_load1_noabort+0x44/0x50 [ 39.635099] btmtksdio_recv_event+0x1b0/0x1c4 [ 39.635129] btmtksdio_txrx_work+0x6cc/0xac4 [ 39.635157] process_one_work+0x560/0xc5c [ 39.635177] worker_thread+0x7ec/0xcc0 [ 39.635195] kthread+0x2d0/0x3d0 [ 39.635215] ret_from_fork+0x10/0x20 [ 39.635247] Allocated by task 0: [ 39.635260] (stack is not available) [ 39.635281] Freed by task 2392: [ 39.635295] kasan_save_stack+0x38/0x68 [ 39.635319] kasan_set_track+0x28/0x3c [ 39.635338] kasan_set_free_info+0x28/0x4c [ 39.635357] ____kasan_slab_free+0x104/0x150 [ 39.635374] __kasan_slab_free+0x18/0x28 [ 39.635391] slab_free_freelist_hook+0x114/0x248 [ 39.635410] kfree+0xf8/0x2b4 [ 39.635427] skb_free_head+0x58/0x98 [ 39.635447] skb_release_data+0x2f4/0x410 [ 39.635464] skb_release_all+0x50/0x60 [ 39.635481] kfree_skb+0xc8/0x25c [ 39.635498] hci_event_packet+0x894/0xca4 [bluetooth] [ 39.635721] hci_rx_work+0x1c8/0x68c [bluetooth] [ 39.635925] process_one_work+0x560/0xc5c [ 39.635951] worker_thread+0x7ec/0xcc0 [ 39.635970] kthread+0x2d0/0x3d0 [ 39.635990] ret_from_fork+0x10/0x20 [ 39.636021] The buggy address belongs to the object at ffffff80cf28a600 which belongs to the cache kmalloc-512 of size 512 [ 39.636039] The buggy address is located 13 bytes inside of 512-byte region [ffffff80cf28a600, ffffff80cf28a800) Fixes: 9aebfd4a2200 ("Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 0d37ddfc50d9a81f46d3b2ffa156d4fea8a410f7 Author: Tim Harvey Date: Thu May 5 12:50:10 2022 -0700 Bluetooth: btbcm: Add entry for BCM4373A0 UART Bluetooth This patch adds the device ID for the BCM4373A0 module, found e.g. in the Infineon (Cypress) CYW4373E chip. The required firmware file is named 'BCM4373A0.hcd'. Signed-off-by: Tim Harvey Signed-off-by: Marcel Holtmann commit 23fcb27b33c8ca09a371de5bc95a18c20f72709c Author: Sean Wang Date: Thu Apr 28 02:38:39 2022 +0800 Bluetooth: btusb: Add a new PID/VID 0489/e0c8 for MT7921 Add VID 0489 & PID e0c8 for MediaTek MT7921 USB Bluetooth chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=13 Cnt=03 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0c8 Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit c77a592befddf10dc527a438a81d7166d724c32d Author: Ismael Luceno Date: Wed Apr 27 14:59:48 2022 +0200 Bluetooth: btusb: Add 0x0bda:0x8771 Realtek 8761BUV devices Identifies as just "Realtek Semiconductor Corp. Bluetooth Radio"; it's used in many adapters, e.g.: - UGREEN CM390 - C-TECH BTD-01 - Orico BTA-508 - KS-is KS-457 Device description at /sys/kernel/debug/usb/devices: T: Bus=03 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=8771 Rev= 2.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=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms 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 I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms Signed-off-by: Ismael Luceno Signed-off-by: Marcel Holtmann commit 247f226adadfb7be09dd537f177429f4415aef8e Author: Zijun Hu Date: Wed Apr 27 10:16:51 2022 +0800 Bluetooth: btusb: Set HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for QCA Set HCI_QUIRK_BROKEN_ERR_DATA_REPORTING for QCA controllers since they answer HCI_OP_READ_DEF_ERR_DATA_REPORTING with error code "UNKNOWN HCI COMMAND" as shown below: [ 580.517552] Bluetooth: hci0: unexpected cc 0x0c5a length: 1 < 2 [ 580.517660] Bluetooth: hci0: Opcode 0x c5a failed: -38 hcitool -i hci0 cmd 0x03 0x5a < HCI Command: ogf 0x03, ocf 0x005a, plen 0 > HCI Event: 0x0e plen 4 01 5A 0C 01 btmon log: < HCI Command: Read Default Erroneous Data Reporting (0x03|0x005a) plen 0 > HCI Event: Command Complete (0x0e) plen 4 Read Default Erroneous Data Reporting (0x03|0x005a) ncmd 1 Status: Unknown HCI Command (0x01) Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann commit ff7f2926114d3a50f5ffe461a9bce8d761748da5 Author: Vasyl Vavrychuk Date: Tue Apr 26 11:18:23 2022 +0300 Bluetooth: core: Fix missing power_on work cancel on HCI close Move power_on work cancel to hci_dev_close_sync to ensure that power_on work is canceled after HCI interface down, power off, rfkill, etc. For example, if hciconfig hci0 down is done early enough during boot, it may run before power_on work. Then, power_on work will actually bring up interface despite above hciconfig command. Signed-off-by: Vasyl Vavrychuk Signed-off-by: Marcel Holtmann commit 4622594766d0bc96d04079a96e13eb58f3f799f2 Author: Zijun Hu Date: Mon Apr 25 23:01:29 2022 +0800 Bluetooth: btusb: add support for Qualcomm WCN785x Qualcomm WCN785x has PID/VID 0cf3/e700 as shown by /sys/kernel/debug/usb/devices: T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 8 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0cf3 ProdID=e700 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) 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=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann commit 5e2b6064cbc5fd582396768c5f9583f65085e368 Author: Niels Dossche Date: Sat Apr 23 00:31:17 2022 +0200 Bluetooth: protect le accept and resolv lists with hdev->lock Concurrent operations from events on le_{accept,resolv}_list are currently unprotected by hdev->lock. Most existing code do already protect the lists with that lock. This can be observed in hci_debugfs and hci_sync. Add the protection for these events too. Fixes: b950aa88638c ("Bluetooth: Add definitions and track LE resolve list modification") Fixes: 0f36b589e4ee ("Bluetooth: Track LE white list modification via HCI commands") Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann commit fb048cae51bacdfbbda2954af3c213fdb1d484f4 Author: Niels Dossche Date: Tue Apr 5 19:37:52 2022 +0200 Bluetooth: use hdev lock for accept_list and reject_list in conn req All accesses (both reads and modifications) to hdev->{accept,reject}_list are protected by hdev lock, except the ones in hci_conn_request_evt. This can cause a race condition in the form of a list corruption. The solution is to protect these lists in hci_conn_request_evt as well. I was unable to find the exact commit that introduced the issue for the reject list, I was only able to find it for the accept list. Fixes: a55bd29d5227 ("Bluetooth: Add white list lookup for incoming connection requests") Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann commit 50a3633ae5e98cf1b80ef5b73c9e341aee9ad896 Author: Niels Dossche Date: Thu Apr 7 20:06:52 2022 +0200 Bluetooth: use hdev lock in activate_scan for hci_is_adv_monitoring hci_is_adv_monitoring's function documentation states that it must be called under the hdev lock. Paths that leads to an unlocked call are: discov_update => start_discovery => interleaved_discov => active_scan and: discov_update => start_discovery => active_scan The solution is to take the lock in active_scan during the duration of the call to hci_is_adv_monitoring. Fixes: c32d624640fd ("Bluetooth: disable filter dup when scan for adv monitor") Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann commit 8b1d66b50437b65ef109f32270bd936ca5437a83 Author: Max Chou Date: Mon Apr 11 17:19:57 2022 +0800 Bluetooth: btrtl: Add support for RTL8852C Add the support for RTL8852C BT controller on USB interface. The necessary firmware file will be submitted to linux-firmware. Signed-off-by: Max Chou Signed-off-by: Marcel Holtmann commit d44e1dbda36fff5d7c2586683c4adc0963aef908 Author: Luiz Augusto von Dentz Date: Fri Apr 1 16:38:25 2022 -0700 Bluetooth: btusb: Set HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for QCA This sets HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN for QCA controllers since SCO appear to not work when using HCI_OP_ENHANCED_SETUP_SYNC_CONN. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215576 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 6b5c1cdac44f3bcd0bd1514eed6b8b9ad141a404 Author: Luiz Augusto von Dentz Date: Fri Apr 1 16:38:24 2022 -0700 Bluetooth: Print broken quirks This prints warnings for controllers setting broken quirks to increase their visibility and warn about broken controllers firmware that probably needs updates to behave properly. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 05abad857277dda198063017b00ba5b9fed2c0cb Author: Luiz Augusto von Dentz Date: Fri Apr 1 16:38:23 2022 -0700 Bluetooth: HCI: Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk This adds HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk which can be used to mark HCI_Enhanced_Setup_Synchronous_Connection as broken even if its support command bit are set since some controller report it as supported but the command don't work properly with some configurations (e.g. BT_VOICE_TRANSPARENT/mSBC). Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 72ef98445aca568a81c2da050532500a8345ad3a Author: Steven Rostedt Date: Tue Apr 5 10:02:00 2022 -0400 Bluetooth: hci_qca: Use del_timer_sync() before freeing While looking at a crash report on a timer list being corrupted, which usually happens when a timer is freed while still active. This is commonly triggered by code calling del_timer() instead of del_timer_sync() just before freeing. One possible culprit is the hci_qca driver, which does exactly that. Eric mentioned that wake_retrans_timer could be rearmed via the work queue, so also move the destruction of the work queue before del_timer_sync(). Cc: Eric Dumazet Cc: stable@vger.kernel.org Fixes: 0ff252c1976da ("Bluetooth: hciuart: Add support QCA chipset for UART") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Marcel Holtmann commit bf7380e224f98a29ff6290beb2ea026f0a044a8c Author: Rikard Falkeborn Date: Thu Mar 31 00:32:52 2022 +0200 Bluetooth: btintel: Constify static struct regmap_bus The only usage of regmap_ibt is to (after the regmap_init() macro is expanded), pass its address to __regmap_init(), which takes a pointer to const struct regmap_bus as input. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Marcel Holtmann commit 31396dd53f32d5d82655d84ab31e193ace836688 Author: Brian Gix Date: Thu Mar 31 11:07:47 2022 -0700 Bluetooth: Keep MGMT pending queue ordered FIFO Small change to add new commands to tail of the list, and find/remove them from the head of the list. Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 7aa1e7d15f8a5b65f67bacb100d8fc033b21efa2 Author: Ying Hsu Date: Sat Mar 26 07:09:28 2022 +0000 Bluetooth: fix dangling sco_conn and use-after-free in sco_sock_timeout Connecting the same socket twice consecutively in sco_sock_connect() could lead to a race condition where two sco_conn objects are created but only one is associated with the socket. If the socket is closed before the SCO connection is established, the timer associated with the dangling sco_conn object won't be canceled. As the sock object is being freed, the use-after-free problem happens when the timer callback function sco_sock_timeout() accesses the socket. Here's the call trace: dump_stack+0x107/0x163 ? refcount_inc+0x1c/ print_address_description.constprop.0+0x1c/0x47e ? refcount_inc+0x1c/0x7b kasan_report+0x13a/0x173 ? refcount_inc+0x1c/0x7b check_memory_region+0x132/0x139 refcount_inc+0x1c/0x7b sco_sock_timeout+0xb2/0x1ba process_one_work+0x739/0xbd1 ? cancel_delayed_work+0x13f/0x13f ? __raw_spin_lock_init+0xf0/0xf0 ? to_kthread+0x59/0x85 worker_thread+0x593/0x70e kthread+0x346/0x35a ? drain_workqueue+0x31a/0x31a ? kthread_bind+0x4b/0x4b ret_from_fork+0x1f/0x30 Link: https://syzkaller.appspot.com/bug?extid=2bef95d3ab4daa10155b Reported-by: syzbot+2bef95d3ab4daa10155b@syzkaller.appspotmail.com Fixes: e1dee2c1de2b ("Bluetooth: fix repeated calls to sco_sock_kill") Signed-off-by: Ying Hsu Reviewed-by: Joseph Hwang Signed-off-by: Marcel Holtmann commit 789f6b8ac3b15bca09b69d5699cad0bf6e2103aa Author: Sean Wang Date: Wed Mar 23 07:30:40 2022 +0800 Bluetooth: mt7921s: Fix the incorrect pointer check Fix the incorrect pointer check on ven_data. Fixes: f41b91fa1783 ("Bluetooth: mt7921s: Add .btmtk_get_codec_config_data") Co-developed-by: Yake Yang Signed-off-by: Yake Yang Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 63fac3343b99e6726830bb40028fbe23c864eafe Author: Linus Walleij Date: Sun Mar 20 23:27:49 2022 +0100 Bluetooth: btbcm: Support per-board firmware variants There are provedly different firmware variants for the different phones using some of these chips. These were extracted from a few Samsung phones: 37446 BCM4334B0.samsung,codina-tmo.hcd 37366 BCM4334B0.samsung,golden.hcd 37403 BCM4334B0.samsung,kyle.hcd 37366 BCM4334B0.samsung,skomer.hcd This patch supports the above naming schedule with inserting [.board_name] between the firmware name and ".hcd". This scheme is the same as used by the companion BRCM wireless chips as can be seen in drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c or just by looking at the firmwares in linux-firmware/brcm. Currently we only support board variants using the device tree compatible string as board type, but other schemes are possible. This makes it possible to successfully load a few unique firmware variants for some Samsung phones. Cc: phone-devel@vger.kernel.org Cc: Markuss Broks Cc: Stephan Gerhold Signed-off-by: Linus Walleij Signed-off-by: Marcel Holtmann commit 49bb39bddad214304bb523258f02f57cd25ed88b Author: Amit Cohen Date: Thu May 12 16:12:07 2022 +0300 selftests: fib_nexthops: Make the test more robust Rarely some of the test cases fail. Make the test more robust by increasing the timeout of ping commands to 5 seconds. Signed-off-by: Amit Cohen Reviewed-by: David Ahern Signed-off-by: David S. Miller commit f5c0b4f30416c670408a77be94703d04d22b57df Author: Thomas Gleixner Date: Thu May 12 14:04:08 2022 +0200 x86/prctl: Remove pointless task argument The functions invoked via do_arch_prctl_common() can only operate on the current task and none of these function uses the task argument. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/87lev7vtxj.ffs@tglx commit 1b8e5d1a53696d92374acce2b19a649427f1ec1e Author: Christoph Hellwig Date: Wed May 11 08:24:10 2022 +0200 swiotlb: use the right nslabs-derived sizes in swiotlb_init_late nslabs can shrink when allocations or the remap don't succeed, so make sure to use it for all sizing. For that remove the bytes value that can get stale and replace it with local calculations and a boolean to indicate if the originally requested size could not be allocated. Fixes: 6424e31b1c05 ("swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl") Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini commit a5e891321a219679d5a2828150a7dda29a47d8a6 Author: Christoph Hellwig Date: Wed May 11 08:13:57 2022 +0200 swiotlb: use the right nslabs value in swiotlb_init_remap default_nslabs should only be used to initialize nslabs, after that we need to use the local variable that can shrink when allocations or the remap don't succeed. Fixes: 6424e31b1c05 ("swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl") Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini commit 1521c607cabe7c7edb028e211e88ba1e0f19714e Author: Christoph Hellwig Date: Wed May 11 08:44:29 2022 +0200 swiotlb: don't panic when the swiotlb buffer can't be allocated For historical reasons the switlb code paniced when the metadata could not be allocated, but just printed a warning when the actual main swiotlb buffer could not be allocated. Restore this somewhat unexpected behavior as changing it caused a boot failure on the Microchip RISC-V PolarFire SoC Icicle kit. Fixes: 6424e31b1c05 ("swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl") Reported-by: Conor Dooley Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini Acked-by: Conor Dooley Tested-by: Conor Dooley commit 6829061315065c7af394d556a887fbf847e4e708 Author: Sebastian Andrzej Siewior Date: Wed May 11 17:29:22 2022 +0200 futex: Remove a PREEMPT_RT_FULL reference. Earlier the PREEMPT_RT patch had a PREEMPT_RT_FULL and PREEMPT_RT_BASE Kconfig option. The latter was a subset of the functionality that was enabled with PREEMPT_RT_FULL and was mainly useful for debugging. During the merging efforts the two Kconfig options were abandoned in the v5.4.3-rt1 release and since then there is only PREEMPT_RT which enables the full features set (as PREEMPT_RT_FULL did in earlier releases). Replace the PREEMPT_RT_FULL reference with PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Reviewed-by: André Almeida Link: https://lore.kernel.org/r/YnvWUvq1vpqCfCU7@linutronix.de commit b7da9c6b01cbd3e50e7611d608d46628ba8addde Merge: 7b8b82224c268 1e7b81edebc14 Author: David S. Miller Date: Fri May 13 11:35:46 2022 +0100 Merge branch 'lan95xx-no-polling' Lukas Wunner says: ==================== Polling be gone on LAN95xx Do away with link status polling on LAN95xx USB Ethernet and rely on interrupts instead, thereby reducing bus traffic, CPU overhead and improving interface bringup latency. Link to v2: https://lore.kernel.org/netdev/cover.1651574194.git.lukas@wunner.de/ Only change since v2: * Patch [5/7]: * Drop call to __irq_enter_raw() which worked around a warning in generic_handle_domain_irq(). That warning is gone since 792ea6a074ae (queued on tip.git/irq/urgent). (Marc Zyngier, Thomas Gleixner) ==================== commit 1e7b81edebc1466d4154c5e716eb87468f3eeee2 Author: Lukas Wunner Date: Thu May 12 10:42:07 2022 +0200 net: phy: smsc: Cope with hot-removal in interrupt handler If reading the Interrupt Source Flag register fails with -ENODEV, then the PHY has been hot-removed and the correct response is to bail out instead of throwing a WARN splat and attempting to suspend the PHY. The PHY should be stopped in due course anyway as the kernel asynchronously tears down the device. Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 7e8b617eb93f9fcaedac02cd19edcad31c767386 Author: Lukas Wunner Date: Thu May 12 10:42:06 2022 +0200 net: phy: smsc: Cache interrupt mask Cache the interrupt mask to avoid re-reading it from the PHY upon every interrupt. This will simplify a subsequent commit which detects hot-removal in the interrupt handler and bails out. Analyzing and debugging PHY transactions also becomes simpler if such redundant reads are avoided. Last not least, interrupt overhead and latency is slightly improved. Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 1ce8b37241ed291af56f7a49bbdbf20c08728e88 Author: Lukas Wunner Date: Thu May 12 10:42:05 2022 +0200 usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling Link status of SMSC LAN95xx chips is polled once per second, even though they're capable of signaling PHY interrupts through the MAC layer. Forward those interrupts to the PHY driver to avoid polling. Benefits are reduced bus traffic, reduced CPU overhead and quicker interface bringup. Polling was introduced in 2016 by commit d69d16949346 ("usbnet: smsc95xx: fix link detection for disabled autonegotiation"). Back then, the LAN95xx driver neglected to enable the ENERGYON interrupt, hence couldn't detect link-up events when auto-negotiation was disabled. The proper solution would have been to enable the ENERGYON interrupt instead of polling. Since then, PHY handling was moved from the LAN95xx driver to the SMSC PHY driver with commit 05b35e7eb9a1 ("smsc95xx: add phylib support"). That PHY driver is capable of link detection with auto-negotiation disabled because it enables the ENERGYON interrupt. Note that signaling interrupts through the MAC layer not only works with the integrated PHY, but also with an external PHY, provided its interrupt pin is attached to LAN95xx's nPHY_INT pin. In the unlikely event that the interrupt pin of an external PHY is attached to a GPIO of the SoC (or not connected at all), the driver can be amended to retrieve the irq from the PHY's of_node. To forward PHY interrupts to phylib, it is not sufficient to call phy_mac_interrupt(). Instead, the PHY's interrupt handler needs to run so that PHY interrupts are cleared. That's because according to page 119 of the LAN950x datasheet, "The source of this interrupt is a level. The interrupt persists until it is cleared in the PHY." https://www.microchip.com/content/dam/mchp/documents/UNG/ProductDocuments/DataSheets/LAN950x-Data-Sheet-DS00001875D.pdf Therefore, create an IRQ domain with a single IRQ for the PHY. In the future, the IRQ domain may be extended to support the 11 GPIOs on the LAN95xx. Normally the PHY interrupt should be masked until the PHY driver has cleared it. However masking requires a (sleeping) USB transaction and interrupts are received in (non-sleepable) softirq context. I decided not to mask the interrupt at all (by using the dummy_irq_chip's noop ->irq_mask() callback): The USB interrupt endpoint is polled in 1 msec intervals and normally that's sufficient to wake the PHY driver's IRQ thread and have it clear the interrupt. If it does take longer, worst thing that can happen is the IRQ thread is woken again. No big deal. Because PHY interrupts are now perpetually enabled, there's no need to selectively enable them on suspend. So remove all invocations of smsc95xx_enable_phy_wakeup_interrupts(). In smsc95xx_resume(), move the call of phy_init_hw() before usbnet_resume() (which restarts the status URB) to ensure that the PHY is fully initialized when an interrupt is handled. Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn # from a PHY perspective Cc: Andre Edich Signed-off-by: David S. Miller commit 8960f878e39fadc03d74292a6731f1e914cf2019 Author: Lukas Wunner Date: Thu May 12 10:42:04 2022 +0200 usbnet: smsc95xx: Avoid link settings race on interrupt reception When a PHY interrupt is signaled, the SMSC LAN95xx driver updates the MAC full duplex mode and PHY flow control registers based on cached data in struct phy_device: smsc95xx_status() # raises EVENT_LINK_RESET usbnet_deferred_kevent() smsc95xx_link_reset() # uses cached data in phydev Simultaneously, phylib polls link status once per second and updates that cached data: phy_state_machine() phy_check_link_status() phy_read_status() lan87xx_read_status() genphy_read_status() # updates cached data in phydev If smsc95xx_link_reset() wins the race against genphy_read_status(), the registers may be updated based on stale data. E.g. if the link was previously down, phydev->duplex is set to DUPLEX_UNKNOWN and that's what smsc95xx_link_reset() will use, even though genphy_read_status() may update it to DUPLEX_FULL afterwards. PHY interrupts are currently only enabled on suspend to trigger wakeup, so the impact of the race is limited, but we're about to enable them perpetually. Avoid the race by delaying execution of smsc95xx_link_reset() until phy_state_machine() has done its job and calls back via smsc95xx_handle_link_change(). Signaling EVENT_LINK_RESET on wakeup is not necessary because phylib picks up link status changes through polling. So drop the declaration of a ->link_reset() callback. Note that the semicolon on a line by itself added in smsc95xx_status() is a placeholder for a function call which will be added in a subsequent commit. That function call will actually handle the INT_ENP_PHY_INT_ interrupt. Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 14021da69811cc9bd680a83932614adf308ed0fe Author: Lukas Wunner Date: Thu May 12 10:42:03 2022 +0200 usbnet: smsc95xx: Don't reset PHY behind PHY driver's back smsc95xx_reset() resets the PHY behind the PHY driver's back, which seems like a bad idea generally. Remove that portion of the function. We're about to use PHY interrupts instead of polling to detect link changes on SMSC LAN95xx chips. Because smsc95xx_reset() is called from usbnet_open(), PHY interrupt settings are lost whenever the net_device is brought up. There are two other callers of smsc95xx_reset(), namely smsc95xx_bind() and smsc95xx_reset_resume(), and both may indeed benefit from a PHY reset. However they already perform one through their calls to phy_connect_direct() and phy_init_hw(). Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Cc: Martyn Welch Cc: Gabriel Hojda Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3108871f19221372b251f7da1ac38736928b5b3a Author: Lukas Wunner Date: Thu May 12 10:42:02 2022 +0200 usbnet: smsc95xx: Don't clear read-only PHY interrupt Upon receiving data from the Interrupt Endpoint, the SMSC LAN95xx driver attempts to clear the signaled interrupts by writing "all ones" to the Interrupt Status Register. However the driver only ever enables a single type of interrupt, namely the PHY Interrupt. And according to page 119 of the LAN950x datasheet, its bit in the Interrupt Status Register is read-only. There's no other way to clear it than in a separate PHY register: https://www.microchip.com/content/dam/mchp/documents/UNG/ProductDocuments/DataSheets/LAN950x-Data-Sheet-DS00001875D.pdf Consequently, writing "all ones" to the Interrupt Status Register is pointless and can be dropped. Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d1408f6b4dd78fb1b9e26bcf64477984e5f85409 Author: Lukas Wunner Date: Thu May 12 10:42:01 2022 +0200 usbnet: Run unregister_netdev() before unbind() again Commit 2c9d6c2b871d ("usbnet: run unbind() before unregister_netdev()") sought to fix a use-after-free on disconnect of USB Ethernet adapters. It turns out that a different fix is necessary to address the issue: https://lore.kernel.org/netdev/18b3541e5372bc9b9fc733d422f4e698c089077c.1650177997.git.lukas@wunner.de/ So the commit was not necessary. The commit made binding and unbinding of USB Ethernet asymmetrical: Before, usbnet_probe() first invoked the ->bind() callback and then register_netdev(). usbnet_disconnect() mirrored that by first invoking unregister_netdev() and then ->unbind(). Since the commit, the order in usbnet_disconnect() is reversed and no longer mirrors usbnet_probe(). One consequence is that a PHY disconnected (and stopped) in ->unbind() is afterwards stopped once more by unregister_netdev() as it closes the netdev before unregistering. That necessitates a contortion in ->stop() because the PHY may only be stopped if it hasn't already been disconnected. Reverting the commit allows making the call to phy_stop() unconditional in ->stop(). Tested-by: Oleksij Rempel # LAN9514/9512/9500 Tested-by: Ferry Toth # LAN9514 Signed-off-by: Lukas Wunner Acked-by: Oliver Neukum Cc: Martyn Welch Cc: Andrew Lunn Signed-off-by: David S. Miller commit 9e4a51ad8eee1d263666fd31ced39bd8e3770822 Author: Thomas Gleixner Date: Tue May 10 10:53:41 2022 +0200 debugobjects: Convert to SPDX license identifier Signed-off-by: Thomas Gleixner Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/87v8udpy3u.ffs@tglx commit 7b8b82224c26863d9b6c67f6cc6044bc24044e44 Author: Yang Li Date: Thu May 12 16:03:57 2022 +0800 net: ethernet: fix platform_no_drv_owner.cocci warning Remove .owner field if calls are used which set it automatically. ./drivers/net/ethernet/sunplus/spl2sw_driver.c:569:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: David S. Miller commit 0f6deac3a07958195173119627502350925dce78 Author: Jie Wang Date: Thu May 12 14:56:31 2022 +0800 net: page_pool: add page allocation stats for two fast page allocate path Currently If use page pool allocation stats to analysis a RX performance degradation problem. These stats only count for pages allocate from page_pool_alloc_pages. But nic drivers such as hns3 use page_pool_dev_alloc_frag to allocate pages, so page stats in this API should also be counted. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a19cef450bb6b1365c3bd5c82952f95b76688143 Author: Jiapeng Chong Date: Thu May 12 14:09:05 2022 +0800 net: ethernet: Use swap() instead of open coding it Clean the following coccicheck warning: ./drivers/net/ethernet/sunplus/spl2sw_driver.c:217:27-28: WARNING opportunity for swap(). ./drivers/net/ethernet/sunplus/spl2sw_driver.c:222:27-28: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller commit d4a3b442335b0a9476248c5d6dc07f6f8580a9ca Merge: 3f656f2618fb0 add9f6f30e54b Author: Arnd Bergmann Date: Fri May 13 11:33:40 2022 +0200 Merge tag 'v5.19-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/drivers Powerdomain fixes and improvements, some GRF compatible properties and a rk3566 GRF clocksource default setup. * tag 'v5.19-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc: rockchip: Fix compile-testing SoC drivers soc: rockchip: power-domain: Replace dsb() with smb() soc: rockchip: Clean up Kconfig whitespace soc: rockchip: set dwc3 clock for rk3566 dt-bindings: soc: rockchip: add rk3566-pipe-grf compatible soc: rockchip: pm_domains: Fix typo in comment dt-bindings: soc: rockchip: add naneng combo phy register compatible Link: https://lore.kernel.org/r/3998951.tdWV9SEqCh@phil Signed-off-by: Arnd Bergmann commit 30258ae65a06b0128d4020992a8d851cdef7c207 Merge: 60166b3c69615 2946aa908bb63 Author: Arnd Bergmann Date: Fri May 13 11:32:42 2022 +0200 Merge tag 'v5.19-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/soc Comment typo fix. * tag 'v5.19-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: rockchip: fix typos in comments Link: https://lore.kernel.org/r/4421093.ElGaqSPkdT@phil Signed-off-by: Arnd Bergmann commit 9dd7a5a896355515ca3b92da6a5802d0a066781a Merge: 045d0c3db9119 5d3b6ede2c6c8 Author: Arnd Bergmann Date: Fri May 13 11:31:21 2022 +0200 Merge tag 'visconti-arm-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/iwamatsu/linux-visconti into arm/dt Visconti device tree updates for 5.19 - Update the clock providers for PCIe host controller - Update the clock providers for ethernet device - Update the clock providers for SPI - Update the clock providers for watchdog timer - Update the clock providers for I2C - Update the clock providers for UART - Add clock controller support for TMPV7708 * tag 'visconti-arm-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/iwamatsu/linux-visconti: arm64: dts: visconti: Update the clock providers for PCIe host controller arm64: dts: visconti: Update the clock providers for ethernet device arm64: dts: visconti: Update the clock providers for SPI arm64: dts: visconti: Update the clock providers for watchdog timer arm64: dts: visconti: Update the clock providers for I2C arm64: dts: visconti: Update the clock providers for UART arm64: dts: visconti: Add clock controller support for TMPV7708 Link: https://lore.kernel.org/r/TYWPR01MB94201E842A2F8E5E9EBF740D92C99@TYWPR01MB9420.jpnprd01.prod.outlook.com Signed-off-by: Arnd Bergmann commit 045d0c3db9119ebb36d50e0190bed4ea6374f6cf Author: Alexandre Torgue Date: Wed May 11 11:25:59 2022 +0200 dt-bindings: clock: stm32mp1: adapt example for "st,stm32mp1-rcc-secure" For "st,stm32mp1-rcc-secure" schema, clocks and clock-names entries are now required properties. Signed-off-by: Alexandre Torgue Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220511092559.4952-1-alexandre.torgue@foss.st.com' Signed-off-by: Arnd Bergmann commit f9222f8ca18bcb1d55dd749b493b29fd8092fb82 Author: Hans Verkuil Date: Tue May 10 10:53:05 2022 +0200 media: cec-adap.c: drop activate_cnt, use state info instead Using an activation counter to decide when the enable or disable the cec adapter is not the best approach and can lead to race conditions. Change this to determining the current status of the adapter, and enable or disable the adapter accordingly. It now only needs to be called whenever there is a chance that the state changes, and it can handle enabling/disabling monitoring as well if needed. This simplifies the code and it should be a more robust approach as well. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e3891b36364e85914fcb7a535656695a67e876a7 Author: Hans Verkuil Date: Fri May 6 14:46:46 2022 +0200 media: cec-adap.c: reconfigure if the PA changes during configuration If the physical address changes (i.e. becomes invalid, then valid again) while the adapter is still claiming free logical addresses, then trigger a reconfiguration since any claimed LAs may now be stale. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eea502e3c503afc621c584f155a98d96c2e1e2e7 Merge: 835c0d9350fd8 53070cfa8228b Author: Arnd Bergmann Date: Fri May 13 11:29:11 2022 +0200 Merge tag 'v5.19-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt Naming and flag corrections. * tag 'v5.19-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: rename pcfg_pull_default node name on rk3036 ARM: dts: rockchip: use generic node name for dma rk3036/rk322x ARM: dts: rockchip: correct interrupt flags on rk3188 boards Link: https://lore.kernel.org/r/6919636.31r3eYUQgx@phil Signed-off-by: Arnd Bergmann commit 59267fc34f4900dcd2ec3295f6be04b79aee2186 Author: Hans Verkuil Date: Fri May 6 09:43:25 2022 +0200 media: cec-adap.c: fix is_configuring state If an adapter is trying to claim a free logical address then it is in the 'is_configuring' state. If during that process the cable is disconnected (HPD goes low, which in turn invalidates the physical address), then cec_adap_unconfigure() is called, and that set the is_configuring boolean to false, even though the thread that's trying to claim an LA is still running. Don't touch the is_configuring bool in cec_adap_unconfigure(), it will eventually be cleared by the thread. By making that change the cec_config_log_addr() function also had to change: it was aborting if is_configuring became false (since that is what cec_adap_unconfigure() did), but that no longer works. Instead check if the physical address is invalid. That is a much more appropriate check anyway. This fixes a bug where the the adapter could be disabled even though the device was still configuring. This could cause POLL transmits to time out. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 835c0d9350fd855a5fea0ff38e14299d69972b75 Merge: 18176b9d82eeb bc405bb3eeee4 Author: Arnd Bergmann Date: Fri May 13 11:28:40 2022 +0200 Merge tag 'v5.19-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt New peripherals supported on rk356x: sfc, usb3, sata and the video-decoder on rk3328. RK3399 received some improvements and nodes for the memory controller. Additional peripherals for PineNote, Gru and BananaPi-R2-Pro. New boards are the Firefly Station M2, Pine64 SoQuartz SOM and Quartz64 model B as well as the Radxa Rock3 model A. * tag 'v5.19-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (32 commits) arm64: dts: rockchip: enable otg/drd operation of usb_host0_xhci in rk356x arm64: dts: rockchip: rename HDMI ref clock to 'ref' on rk3399 arm64: dts: rockchip: add dts for Firefly Station M2 rk3566 arm64: dts: rockchip: add SoQuartz CM4IO dts arm64: dts: rockchip: add Pine64 Quartz64-B device tree dt-bindings: arm: rockchip: Add Firefly Station M2 dt-bindings: arm: rockchip: Add Pine64 SoQuartz SoM dt-bindings: arm: rockchip: Add Pine64 Quartz64 Model B arm64: dts: rockchip: enable usb hub on the radxa rock3 model a arm64: dts: rockchip: add usb3 support to the radxa rock3 model a arm64: dts: rockchip: add rk356x sfc support arm64: dts: rockchip: Add USB and TCPC to rk3566-pinenote arm64: dts: rockchip: Add accelerometer to rk3566-pinenote arm64: dts: rockchip: add an input enable pinconf to rk3399 arm64: dts: rockchip: Add vdec support for RK3328 arm64: dts: rockchip: Rename vdec_mmu node for RK3328 arm64: dts: rockchip: Enable dmc and dfi nodes on gru arm64: dts: rockchip: Add dfi and dmc nodes to rk3399 arm64: dts: rockchip: add clocks property to cru nodes rk3399 arm64: dts: rockchip: use generic node name for pmucru on rk3399 ... Link: https://lore.kernel.org/r/7748558.DvuYhMxLoT@phil Signed-off-by: Arnd Bergmann commit 184c387db057c135eeab1a163f863838edb02483 Author: Hans Verkuil Date: Fri May 6 09:39:22 2022 +0200 media: cec-adap.c: stop trying LAs on CEC_TX_STATUS_TIMEOUT If, while trying to claim a free logical address, a POLL message times out, then abort this process. A CEC_TX_STATUS_TIMEOUT should be handled the same as a CEC_TX_STATUS_ABORTED. This avoids a situation where transmits time out due to a driver or hardware bug and it takes ages before the attempt to find available free logical addresses finishes. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 18176b9d82eebaf4408dc0440f54d57a8cbced83 Author: Arnd Bergmann Date: Fri May 13 11:11:07 2022 +0200 Revert "ARM: dts: BCM5301X: Fix DTC warning for NAND node" This reverts commit 90103611d573, which caused a new DTC warning arch/arm/boot/dts/bcm953012hr.dts:57.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@0:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) arch/arm/boot/dts/bcm953012hr.dts:62.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@200000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) arch/arm/boot/dts/bcm953012hr.dts:66.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@600000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) arch/arm/boot/dts/bcm953012hr.dts:70.3-33: Warning (reg_format): /nand-controller@18028000/nand@0/partition@1000000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1) arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm953012hr.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm953012hr.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm953012hr.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' Signed-off-by: Arnd Bergmann commit 498946cf6b85b5eafb142132a11351814f578535 Author: Hans Verkuil Date: Fri May 6 09:25:55 2022 +0200 media: cec-adap.c: don't unconfigure if already unconfigured The __cec_s_log_addrs() function can configure or unconfigure the adapter. The ioctl handler in cec-api.c will prevent it from being called to configure the adapter if it was already configured (or in the process of configuring). But it can still be called to unconfigure an already unconfigured adapter, and it didn't check for that. This can cause cec_activate_cnt_dec() to be called too often, causing a WARN_ON. Instead first check if adap->log_addrs.num_log_addrs == 0 and return since in that case the adapter is already unconfigured. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5f4eb16750511125aa1a874dd8cf1682a9d6a8a7 Author: Hans Verkuil Date: Tue May 10 13:59:48 2022 +0200 media: cec-pin.c: don't zero work_pin_num_events in adap_enable It's OK to keep the pending pin events when disabling or enabling the 'adapter'. Zeroing this can cause a race condition if this happens when the pin kthread is handling a pin event and calls atomic_dec later, causing work_pin_num_events to become negative. Just leave pending events in the queue, they'll be read eventually. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 60965c6a1960988bcb5ad3b530ccd133af5cc85d Author: Hans Verkuil Date: Fri May 6 09:15:40 2022 +0200 media: cec-pin.c: disabling the adapter cannot call kthread_stop When the adap_enable callback is called the adap->lock is held. When disabling the adapter it attempts to stop the kthread that deals with receiving and transmitting messages. However, kthread_stop waits for the thread to stop, so all that time adap->lock is held. Unfortunately, the kernel thread itself can call functions that take that same lock, so a deadlock can occur. Change the logic to keep the kernel thread running and instead when disabling the adapter, just set the pin to high, go to idle and then to state OFF and disable the interrupt. Only stop the kernel thread when the adapter is deleted. This way disabling the adapter will not wait for anything and the deadlock is avoided. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 349d03ffd5f62c298fd667ffa397c3fdc5c6194b Author: Vladis Dronov Date: Sun May 8 15:09:44 2022 +0200 crypto: s390 - add crypto library interface for ChaCha20 Implement a crypto library interface for the s390-native ChaCha20 cipher algorithm. This allows us to stop to select CRYPTO_CHACHA20 and instead select CRYPTO_ARCH_HAVE_LIB_CHACHA. This allows BIG_KEYS=y not to build a whole ChaCha20 crypto infrastructure as a built-in, but build a smaller CRYPTO_LIB_CHACHA instead. Make CRYPTO_CHACHA_S390 config entry to look like similar ones on other architectures. Remove CRYPTO_ALGAPI select as anyway it is selected by CRYPTO_SKCIPHER. Add a new test module and a test script for ChaCha20 cipher and its interfaces. Here are test results on an idle z15 machine: Data | Generic crypto TFM | s390 crypto TFM | s390 lib size | enc dec | enc dec | enc dec -----+--------------------+------------------+---------------- 512b | 1545ns 1295ns | 604ns 446ns | 430ns 407ns 4k | 9536ns 9463ns | 2329ns 2174ns | 2170ns 2154ns 64k | 149.6us 149.3us | 34.4us 34.5us | 33.9us 33.1us 6M | 23.61ms 23.11ms | 4223us 4160us | 3951us 4008us 60M | 143.9ms 143.9ms | 33.5ms 33.2ms | 32.2ms 32.1ms Signed-off-by: Vladis Dronov Reviewed-by: Harald Freudenberger Signed-off-by: Herbert Xu commit 6ae7a8b193d353fe3a2a371b61ec4c8ecfcbb0a1 Author: jianchunfu Date: Sun May 8 13:22:50 2022 +0800 crypto: talitos - Uniform coding style with defined variable Use the defined variable "desc" to uniform coding style. Signed-off-by: jianchunfu Signed-off-by: Herbert Xu commit e0c77eb37ec770188c0074a9f646717a434c65c9 Author: Minghao Chi Date: Thu May 5 02:20:24 2022 +0000 crypto: octeontx2 - simplify the return expression of otx2_cpt_aead_cbc_aes_sha_setkey() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Herbert Xu commit 91e8bcd7b4da182e09ea19a2c73167345fe14c98 Author: Sebastian Andrzej Siewior Date: Wed May 4 17:07:36 2022 +0200 crypto: cryptd - Protect per-CPU resource by disabling BH. The access to cryptd_queue::cpu_queue is synchronized by disabling preemption in cryptd_enqueue_request() and disabling BH in cryptd_queue_worker(). This implies that access is allowed from BH. If cryptd_enqueue_request() is invoked from preemptible context _and_ soft interrupt then this can lead to list corruption since cryptd_enqueue_request() is not protected against access from soft interrupt. Replace get_cpu() in cryptd_enqueue_request() with local_bh_disable() to ensure BH is always disabled. Remove preempt_disable() from cryptd_queue_worker() since it is not needed because local_bh_disable() ensures synchronisation. Fixes: 254eff771441 ("crypto: cryptd - Per-CPU thread implementation...") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Herbert Xu commit 42a01af3f13f09656af1f97d58e98415242eef45 Author: Corentin Labbe Date: Mon May 2 20:19:29 2022 +0000 crypto: sun8i-ce - do not fallback if cryptlen is less than sg length The sg length could be more than remaining data on it. So check the length requirement against the minimum between those two values. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit aff388f7874653aea0b8087cfedec52336d2066a Author: Corentin Labbe Date: Mon May 2 20:19:28 2022 +0000 crypto: sun8i-ce - rework debugging The "Fallback for xxx" message is annoying, remove it and store the information in the debugfs. Let's add more precise fallback stats and display it better. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 6b8309faf0ca17c819d3c9a1a262467f9dc3bd58 Author: Corentin Labbe Date: Mon May 2 20:19:27 2022 +0000 crypto: sun8i-ce - use sg_nents_for_len When testing with some large SG list, the sun8i-ce drivers always fallback even if it can handle it. So use sg_nents_for_len() which permits to see less SGs than needed. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 8a1714ad1a33f7dcdebabd67cbe7af423ddefe2b Author: Corentin Labbe Date: Mon May 2 20:19:26 2022 +0000 crypto: sun8i-ce - Add function for handling hash padding Move all padding work to a dedicated function. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 2e5545acf6584c196b4f4e1c1eea017a48699926 Author: Corentin Labbe Date: Mon May 2 20:19:25 2022 +0000 crypto: sun8i-ss - do not fallback if cryptlen is less than sg length The sg length could be more than remaining data on it. So check the length requirement against the minimum between those two values. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 801b7d572c0ad46b116730121e9d3beefb0c7004 Author: Corentin Labbe Date: Mon May 2 20:19:24 2022 +0000 crypto: sun8i-ss - add hmac(sha1) Even if sun8i-ss does not handle hmac(sha1) directly, we can provide one which use the already supported acceleration of sha1. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit e76ee4db9eb8f4a423bf3350f4348449b4339073 Author: Corentin Labbe Date: Mon May 2 20:19:23 2022 +0000 crypto: sun8i-ss - Add function for handling hash padding Move all padding work to a dedicated function. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit f95f61d0b2f152c1ab7928ad57bff1ab7257657f Author: Corentin Labbe Date: Mon May 2 20:19:22 2022 +0000 crypto: sun8i-ss - rework debugging The "Fallback for xxx" message is annoying, remove it and store the information in the debugfs. In the same time, reports more fallback statistics. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit c35e523a8b6962012a589e4a41f56015c31a3397 Author: Corentin Labbe Date: Mon May 2 20:19:21 2022 +0000 crypto: sun8i-ss - handle requests if last block is not modulo 64 The current sun8i-ss handle only requests with all SG length being modulo 64. But the last SG could be always handled by copying it on the pad buffer. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit db0c62bcd4809be50dc952bfade5adf4baf52023 Author: Corentin Labbe Date: Mon May 2 20:19:20 2022 +0000 crypto: sun8i-ss - do not zeroize all pad Instead of memset all pad buffer, it is faster to only put 0 where needed. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 8eec4563f152981a441693fc97c5459843dc5e6e Author: Corentin Labbe Date: Mon May 2 20:19:19 2022 +0000 crypto: sun8i-ss - do not allocate memory when handling hash requests Instead of allocate memory on each requests, it is easier to pre-allocate buffers. This made error path easier. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 4d867bebdc3afa97e00f9b64a21a3c51ce7feecf Author: Corentin Labbe Date: Mon May 2 20:19:18 2022 +0000 crypto: sun8i-ss - use sg_nents_for_len When testing with some large SG list, the sun8i-ss drivers always fallback even if it can handle it. So use sg_nents_for_len() which permits to see less SGs than needed. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit d86e3f37a6d05d4946788904b8968eb6287601ae Author: Corentin Labbe Date: Mon May 2 20:19:17 2022 +0000 crypto: sun8i-ss - test error before assigning The first thing we should do after dma_map_single() is to test the result. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 46e2fcbcbed6b37228bad4a9397e7d60555b8c44 Author: Corentin Labbe Date: Mon May 2 20:19:16 2022 +0000 crypto: sun8i-ss - remove redundant test Some fallback tests were redundant with what sun8i_ss_hash_need_fallback() already do. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit c149e4763d28bb4c0e5daae8a59f2c74e889f407 Author: Corentin Labbe Date: Mon May 2 20:19:15 2022 +0000 crypto: sun8i-ss - handle zero sized sg sun8i-ss does not handle well the possible zero sized sg. Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 359e893e8af456be2fefabe851716237df289cbf Author: Corentin Labbe Date: Mon May 2 20:19:14 2022 +0000 crypto: sun8i-ss - rework handling of IV sun8i-ss fail handling IVs when doing decryption of multiple SGs in-place. It should backup the last block of each SG source for using it later as IVs. In the same time remove allocation on requests path for storing all IVs. Fixes: f08fcced6d00 ("crypto: allwinner - Add sun8i-ss cryptographic offloader") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 22d03a0aad0ecf5ab871a83493f593e2127961a1 Author: Corentin Labbe Date: Mon May 2 20:19:13 2022 +0000 crypto: sun4i-ss - do not allocate backup IV on requests Instead of allocate memory on each requests, it is easier to pre-allocate buffer for backup IV. This made error path easier. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 22f7c2f8cfdac70a4414b66ce6ffa270fcd15aa7 Author: Corentin Labbe Date: Mon May 2 20:19:12 2022 +0000 crypto: sun8i-ce - do not allocate memory when handling requests Instead of allocate memory on each requests, it is easier to pre-allocate buffer for IV. This made error path easier. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 282ee0716f618655d3b2a431498966a4bf797f4c Author: Corentin Labbe Date: Mon May 2 20:19:11 2022 +0000 crypto: sun8i-ce - Fix minor style issue This patch remove a double blank line. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit db264d4c66c0fe007b5d19fd007707cd0697603d Author: Tetsuo Handa Date: Mon May 2 05:49:04 2022 +0200 media: imon: reorganize serialization Since usb_register_dev() from imon_init_display() from imon_probe() holds minor_rwsem while display_open() which holds driver_lock and ictx->lock is called with minor_rwsem held from usb_open(), holding driver_lock or ictx->lock when calling usb_register_dev() causes circular locking dependency problem. Since usb_deregister_dev() from imon_disconnect() holds minor_rwsem while display_open() which holds driver_lock is called with minor_rwsem held, holding driver_lock when calling usb_deregister_dev() also causes circular locking dependency problem. Sean Young explained that the problem is there are imon devices which have two usb interfaces, even though it is one device. The probe and disconnect function of both usb interfaces can run concurrently. Alan Stern responded that the driver and USB cores guarantee that when an interface is probed, both the interface and its USB device are locked. Ditto for when the disconnect callback gets run. So concurrent probing/ disconnection of multiple interfaces on the same device is not possible. Therefore, we don't need locks for handling race between imon_probe() and imon_disconnect(). But we still need to handle race between display_open() /vfd_write()/lcd_write()/display_close() and imon_disconnect(), for disconnect event can happen while file descriptors are in use. Since "struct file"->private_data is set by display_open(), vfd_write()/ lcd_write()/display_close() can assume that "struct file"->private_data is not NULL even after usb_set_intfdata(interface, NULL) was called. Replace insufficiently held driver_lock with refcount_t based management. Add a boolean flag for recording whether imon_disconnect() was already called. Use RCU for accessing this boolean flag and refcount_t. Since the boolean flag for imon_disconnect() is shared, disconnect event on either intf0 or intf1 affects both interfaces. But I assume that this change does not matter, for usually disconnect event would not happen while interfaces are in use. Link: https://syzkaller.appspot.com/bug?extid=c558267ad910fc494497 Reported-by: syzbot Signed-off-by: Tetsuo Handa Tested-by: syzbot Cc: Alan Stern Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit af2aa3c4e52bc63b532b55b1ac66f262ecff2fb3 Author: Oliver Neukum Date: Thu Apr 28 15:34:55 2022 +0200 media: imon: drop references only after device is no longer used The point of using get/put_device() is to keep references for as long as the device may be in use. That means dropping them must be the penultimate action right before freeing the memory. Signed-off-by: Oliver Neukum Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 07af64dddfb87d1af9360204155396be07b7aa70 Author: Oliver Neukum Date: Thu Apr 28 15:34:54 2022 +0200 media: imon: fix timer racing disconnect The timer will report events for an input device. Reporting events for an unregistered device is bad. Hence the timer must be killed first. Signed-off-by: Oliver Neukum Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit a43617a5bf1b6782303d11bec01cf67a2dfc82e8 Author: Oliver Neukum Date: Thu Apr 28 15:34:53 2022 +0200 media: imon: avoid needless atomic allocations in resume GFP_NOIO is fine here. Signed-off-by: Oliver Neukum Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 6287dee83dfae7675bc8324dd057ca12fd58e4df Author: Hans Verkuil Date: Mon May 2 09:18:54 2022 +0200 media: s5k6a3: add missing clk_disable_unprepare Fix smatch warning: drivers/media/i2c/s5k6a3.c:234 __s5k6a3_power_on() warn: 'sensor->clock' from clk_prepare_enable() not released on lines: 234. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit eca89cf60b040ee2cae693ea72a0364284f3084c Author: Hans Verkuil Date: Mon May 2 09:17:46 2022 +0200 media: ccs-core.c: fix failure to call clk_disable_unprepare Fixes smatch warning: drivers/media/i2c/ccs/ccs-core.c:1676 ccs_power_on() warn: 'sensor->ext_clk' from clk_prepare_enable() not released on lines: 1606. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6ba65e68a3cd1403354a18106adf46989fd8d84a Author: Hans Verkuil Date: Mon May 2 09:17:06 2022 +0200 media: cx25821: request_irq -> devm_request_irq Fixes smatch warning: drivers/media/pci/cx25821/cx25821-alsa.c:768 cx25821_audio_initdev() warn: 'dev->pci->irq' from request_irq() not released on lines: 768. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d5a8099c7512d94da2fd8cf99b8451278346cfcc Author: Hans Verkuil Date: Mon May 2 09:16:25 2022 +0200 media: videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc Fixes smatch warning: drivers/media/common/videobuf2/videobuf2-dma-sg.c:129 vb2_dma_sg_alloc() warn: Please consider using kvcalloc instead Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 1577d8043bcabc5842de3d6094e622ae0b064c13 Author: Hans Verkuil Date: Mon May 2 09:15:47 2022 +0200 media: v4l2-ctls-core.c: kvmalloc_array -> kvcalloc Fixes smatch warning: drivers/media/v4l2-core/v4l2-ctrls-core.c:1143 v4l2_ctrl_handler_init_class() warn: Please consider using kvcalloc instead Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 8af592e2ecbcd20e55fe01f24933ccdb6ec4a93c Author: Hans Verkuil Date: Mon May 2 09:14:42 2022 +0200 media: v4l2-subdev.c: kvmalloc_array -> kvcalloc Fixes smatch warning: drivers/media/v4l2-core/v4l2-subdev.c:978 __v4l2_subdev_state_alloc() warn: Please consider using kvcalloc instead Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 46c836569196f377f87a3657b330cffaf94bd727 Author: Benjamin Gaignard Date: Tue May 3 17:19:20 2022 +0200 media: hantro: HEVC: unconditionnaly set pps_{cb/cr}_qp_offset values Always set pps_cb_qp_offset and pps_cr_qp_offset values in Hantro/G2 register whatever is V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT flag value. The vendor code does the same to set these values. This fixes conformance test CAINIT_G_SHARP_3. Fluster HEVC score is increase by one with this patch. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 387d1176956883635c63a7d1c91b1f45e19c1777 Author: Benjamin Gaignard Date: Tue May 3 15:51:38 2022 +0200 media: hantro: HEVC: Fix reference frames management PoC shall be int the range of -2^31 to 2^31 -1 (HEVC spec section 8.3.1 Decoding process for picture order count). The current way to know if an entry in reference picture array is free is to test if PoC = UNUSED_REF. Since UNUSED_REF is defined as '-1' that could lead to decode issue if one PoC also equal '-1'. PoC with value = '-1' exists in conformance test SLIST_B_Sony_9. Change the way unused entries are managed in reference pictures array to avoid using PoC to detect then. This patch doesn't change fluster HEVC score. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d7f4149df818463c1d7094b35db6ebd79f46c7bd Author: Benjamin Gaignard Date: Wed Apr 27 19:39:36 2022 +0200 media: hantro: HEVC: Fix tile info buffer value computation Use pps->column_width_minus1[j] + 1 as value for the tile info buffer instead of pps->column_width_minus1[j + 1]. The patch fixes DBLK_E_VIXS_2, DBLK_F_VIXS_2, DBLK_G_VIXS_2, SAO_B_MediaTek_5, TILES_A_Cisco_2 and TILES_B_Cisco_1 tests in fluster. Fixes: cb5dd5a0fa51 ("media: hantro: Introduce G2/HEVC decoder") Signed-off-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 579846ec52593e6ca123c30379103377cd25728a Author: Benjamin Gaignard Date: Thu Apr 14 17:50:59 2022 +0200 media: hantro: HEVC: Fix output frame chroma offset Hantro decoder doesn't take care of the requested and aligned size of the capture buffer. Stop using the bitstream width/height and use capture frame size stored in the context to get the correct values. hantro_hevc_chroma_offset() and hantro_hevc_motion_vectors_offset() are only used in hantro_g2_hevc_dec.c so take the opportunity to move them here. fluster HEVC score goes up from 77 to 85 successful tests (over 147) with this patch. Signed-off-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 79c987de8b35421a2a975982929f150dd415f8f7 Author: Benjamin Gaignard Date: Mon Apr 4 18:06:40 2022 +0200 media: hantro: Use post processor scaling capacities Hantro G2 post processor is able to down scale decoded frames by a factor of 2, 4 or 8. Add enum_framesizes() ops to postproc_ops structure to enumerate the possible output sizes for a given input resolution. For G2 post-processor use fsize->index (from 0 to 3) as power of 2 divisor. As described in v4l2 documentation return -EINVAL when scaling down isn't possible. fluster scores: 77/147 for HEVC 143/303 for VP9 Signed-off-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d67005b7dc8235870fca149e1fb149340eeaa698 Author: Ming Qian Date: Mon May 9 09:52:25 2022 +0200 media: amphion: G/S_PARM only for encoder's output queue G/S_PARM doesn't make sense for the capture queue of a stateful encoder, unless V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL is set to reserve hardware resources. Otherwise it will fail the v4l2-compliance Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 81cad440dd1bc00277ce17f12fc6ca326d2731f6 Author: Ming Qian Date: Fri Apr 29 10:57:57 2022 +0200 media: amphion: wake up when error occurs when error occurs, driver set error flag, and driver need to wake up the poll wait Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4aafe0268cab0353e87022a96937f55c90513943 Author: Eugen Hristev Date: Thu May 5 15:23:58 2022 +0200 media: atmel: microchip-csi2dc: add link validation support With this, the csi2dc will take part in the media pipeline graph walk and validate the links with it's entities. Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9d5a3451e85802fc315d68b809b7b73471295f95 Author: Eugen Hristev Date: Tue May 3 10:44:21 2022 +0200 media: dt-bindings: media: microchip,xisc: add bus-width of 14 The Microchip XISC supports a bus width of 14 bits. Add it to the supported bus widths. Signed-off-by: Eugen Hristev Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4f564b92c3c7094f4ff2f29426a950acbb55b5d3 Author: Eugen Hristev Date: Tue May 3 10:44:20 2022 +0200 media: atmel: atmel-sama7g5-isc: remove stray line Remove stray line from formats struct. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c221670d0d67a714363c7c679f8d5f3c9f745a78 Author: Eugen Hristev Date: Tue May 3 10:44:19 2022 +0200 media: atmel: atmel-isc: compact the controller formats list Compact the list array to be more readable. No other changes, only cosmetic. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 314c96e5203de1bac744e8536ef20b195f460674 Author: Eugen Hristev Date: Tue May 3 10:44:18 2022 +0200 media: atmel: atmel-isc-base: use mutex to lock awb workq from streaming The AWB workqueue runs in a kernel thread and needs to be synchronized w.r.t. the streaming status. It is possible that streaming is stopped while the AWB workq is running. In this case it is likely that the check for vb2_start_streaming_called is done at one point in time, but the AWB computations are done later, including a call to isc_update_profile, which requires streaming to be started. Thus , isc_update_profile will fail if during this operation sequence the streaming was stopped. To solve this issue, a mutex is added, that will serialize the awb work and streaming stopping, with the mention that either streaming is stopped completely including termination of the last frame is done, and after that the AWB work can check stream status and stop; either first AWB work is completed and after that the streaming can stop correctly. The awb spin lock cannot be used since this spinlock is taken in the same context and using it in the stop streaming will result in a recursion BUG. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 91f49b80983f7bffdea9498209b2b896231ac776 Author: Eugen Hristev Date: Tue May 3 10:44:17 2022 +0200 media: atmel: atmel-sama5d2-isc: fix wrong mask in YUYV format check While this does not happen in production, this check should be done versus the mask, as checking with the YCYC value may not include some bits that may be set. It is correct and safe to check the whole mask. Fixes: 123aaf816b95 ("media: atmel: atmel-sama5d2-isc: fix YUYV format") Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1f0c113cc7abb435e531f5777efe2ca757e1361b Author: Eugen Hristev Date: Tue May 3 10:44:16 2022 +0200 media: atmel: atmel-isc: remove redundant comments Remove duplicate comments which are already in place before the struct definition. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d5e42dfa1453ff3356e7a33b1921e14c008a3339 Author: Eugen Hristev Date: Tue May 3 10:44:15 2022 +0200 media: atmel: atmel-isc-base: replace is_streaming call in s_fmt_vid_cap In s_fmt_vid_cap, we should check if vb2_is_busy and return EBUSY, not check if it's streaming to return the busy state. Suggested-by: Hans Verkuil Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0cf8b9e3a52116905ff15cf9d0e68728da1542c Author: Eugen Hristev Date: Tue May 3 10:44:14 2022 +0200 media: atmel: atmel-isc-base: use streaming status when queueing buffers During experiments with libcamera, it looks like vb2_is_streaming returns true before our start streaming is called. Order of operations is streamon -> queue -> start_streaming ISC would have started the DMA immediately when a buffer is being added to the vbqueue if the queue is streaming. It is more safe to start the DMA after the start streaming of the driver is called. Thus, even if vb2queue is streaming, add the buffer to the dma queue of the driver instead of actually starting the DMA process, if the start streaming has not been called yet. Tho achieve this, we have to use vb2_start_streaming_called instead of vb2_is_streaming. Signed-off-by: Eugen Hristev Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5f25abec8f21b7527c1223a354d23c270befddb3 Author: Michael Rodin Date: Tue Nov 23 12:50:36 2021 +0100 media: vsp1: Fix offset calculation for plane cropping The vertical subsampling factor is currently not considered in the offset calculation for plane cropping done in rpf_configure_partition. This causes a distortion (shift of the color plane) when formats with the vsub factor larger than 1 are used (e.g. NV12, see vsp1_video_formats in vsp1_pipe.c). This commit considers vsub factor for all planes except plane 0 (luminance). Drop generalization of the offset calculation to reduce the binary size. Fixes: e5ad37b64de9 ("[media] v4l: vsp1: Add cropping support") Signed-off-by: Michael Rodin Signed-off-by: LUU HOAI Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit bf7d5ee1ed7026b0412df26eea23d16e29fb7285 Author: Laurent Pinchart Date: Fri Mar 18 19:01:03 2022 +0100 media: vsp1: Use vb2_queue_is_busy() Use the new vb2_queue_is_busy() helper to replace the open-coded version. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 74ff2640152894abf4ff22041515359d165997c0 Author: Laurent Pinchart Date: Fri Mar 18 19:01:03 2022 +0100 media: vsp1: Don't open-code vb2_fop_release() Use the vb2_fop_release() helper to replace the open-coded version. The video->lock is assigned to the queue lock, used by vb2_fop_release(), so the only functional difference is that v4l2_fh_release() is now called before vsp1_device_put(). This should be harmless. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 7101d1279917e5c7fe897c275c5a0727fe90f3e3 Author: Laurent Pinchart Date: Fri Mar 18 18:44:35 2022 +0100 media: videobuf2-v4l2: Expose vb2_queue_is_busy() to drivers vb2 queue ownership is managed by the ioctl handler helpers (vb2_ioctl_*). There are however use cases where drivers can benefit from checking queue ownership, for instance when open-coding an ioctl handler that needs to perform additional checks before calling the corresponding vb2 operation. Expose the vb2_queue_is_busy() function in the videobuf2-v4l2.h header, and change its first argument to a struct vb2_queue pointer as the function name implies it operates on a queue, not a video_device. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 117368f0c4773d19d496335d8f5bd54f75348954 Author: Laurent Pinchart Date: Sun Jan 23 16:58:17 2022 +0100 media: rockchip: rkisp1: Use mipi-csi2.h Replace the driver-specific definitions of MIPI CSI-2 data types with macros from mipi-csi2.h. Signed-off-by: Laurent Pinchart Tested-by: Dafna Hirschfeld Reviewed-by: Dafna Hirschfeld Signed-off-by: Mauro Carvalho Chehab commit f87c445cfa5a44e29be78fc5a8f396668336deb4 Author: Laurent Pinchart Date: Sun Jan 23 16:58:17 2022 +0100 media: cadence: cdns-csi2tx: Use mipi-csi2.h Replace the hardcoded MIPI CSI-2 data types with macros from mipi-csi2.h. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit fa1451374ebf2474660932bf2c34fae395c69a25 Author: Mauro Carvalho Chehab Date: Fri May 13 10:15:18 2022 +0200 media: atomisp: don't pass a pointer to a local variable As warned by gcc 12.1: drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c: In function 'ia_css_rmgr_acq_vbuf': drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:275:33: error: storing the address of local variable 'h' in '*handle' [-Werror=dangling-pointer=] 275 | *handle = &h; | ~~~~~~~~^~~~ drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:257:40: note: 'h' declared here 257 | struct ia_css_rmgr_vbuf_handle h; | ^ drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c:257:40: note: 'handle' declared here cc1: all warnings being treated as errors The logic uses a temporary struct to update the handler, but, instead of copying the value to the pointer sent by the caller, it replaces it with the content with a local variable. That's wrong, and may lead the caller to use a weird value. Signed-off-by: Mauro Carvalho Chehab commit 7b602069cdddb59669cef7935c5ab06591945bfe Author: Ming Qian Date: Tue Mar 22 09:28:59 2022 +0100 media: amphion: ensure the buffer count is not less than min_buffer the output buffer count should >= min_buffer_out the capture buffer count should >= min_buffer_cap Signed-off-by: Ming Qian Signed-off-by: Mauro Carvalho Chehab commit 6d644a6300912730e316874911e6e51ee636ec53 Author: Tom Rix Date: Sat Mar 12 18:30:49 2022 +0100 media: stkwebcam: move stk_camera_read_reg() scratch buffer to struct stk_camera In stk_camera_read_reg() a single byte buffer is alloc-ed and freed on every function call. Since the size is known, move the buffer to the struct stk_camera where it will be alloc-ed and freed once. Signed-off-by: Tom Rix Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 67e33dd957880879e785cfea83a3aa24bd5c5577 Author: Philipp Zabel Date: Tue Apr 26 11:15:55 2022 +0200 media: coda: limit frame interval enumeration to supported encoder frame sizes Let VIDIOC_ENUM_FRAMEINTERVALS return -EINVAL if userspace queries frame intervals for frame sizes unsupported by the encoder. Fixes the following v4l2-compliance failure: fail: v4l2-test-formats.cpp(123): found frame intervals for invalid size 47x16 fail: v4l2-test-formats.cpp(282): node->codec_mask & STATEFUL_ENCODER test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL [hverkuil: drop incorrect 'For decoder devices, return -ENOTTY.' in the commit log] Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e223d45b53433def67a250f7bbfd958043c70bf6 Author: Philipp Zabel Date: Tue Apr 26 11:15:43 2022 +0200 media: coda: fix default JPEG colorimetry Set default colorspace to SRGB for JPEG encoder and decoder devices, to fix the following v4l2-compliance test failure: test VIDIOC_TRY_FMT: OK fail: v4l2-test-formats.cpp(818): fmt_raw.g_colorspace() != V4L2_COLORSPACE_SRGB Also explicitly set transfer function, YCbCr encoding and quantization range, as required by v4l2-compliance for the JPEG encoded side. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d83d2e08811b0b02e6a67aab3ca250e403d1cade Author: Yang Yingliang Date: Tue Apr 26 05:05:44 2022 +0200 media: isif: remove unnecessary check of res The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Yang Yingliang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a7dda6557388f984b2e962adf36c92c51d4a22a6 Author: Yang Yingliang Date: Tue Apr 26 05:05:43 2022 +0200 media: dm644x_ccdc: remove unnecessary check of res The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Yang Yingliang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 26070ea6453baeed23c6791ffdb9eed7dfd9b982 Author: Yang Yingliang Date: Tue Apr 26 05:05:42 2022 +0200 media: dm355_ccdc: remove unnecessary check of res The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Yang Yingliang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 60bc8c5606be42eadeda2ae5f5ec13bc12b61396 Author: Christopher Obbard Date: Mon Apr 25 20:45:08 2022 +0200 media: dt-bindings: media: rockchip-vdec: Add RK3328 compatible Document the RK3328 compatible for rockchip-vdec. The driver shares the same base functionality as the RK3399 hardware so make sure that the RK3399 compatible is also included in the device tree. Signed-off-by: Christopher Obbard Acked-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0daab1944318351a8b276e70a8da92936642cfb4 Author: Fabio Estevam Date: Fri Apr 22 16:31:30 2022 +0200 media: platform: video-viu: Do not select it by default The video viu driver is not a vital one for booting purposes. Remove the unneeded 'default y' option. Signed-off-by: Fabio Estevam Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6ceb72b2b88b8f24c95237f0dcce2aac60817aec Author: Dorota Czaplejewicz Date: Fri Apr 22 09:50:41 2022 +0200 media: Documentation/media: Remove incorrect statement I tried to debug streaming in libcamera, where I stumbled upon this. I asked around on IRC where I was told that this statement in the documentation is wrong, so I'm submitting a removal. Signed-off-by: Dorota Czaplejewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a3b704d829c3e4cdd0aaafd67526fee296ed499 Author: Lv Ruyi Date: Fri Apr 22 04:12:46 2022 +0200 media: amphion: no need to check return value of debugfs_create functions When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 37ed01d5f27fe67e0a86b0fe8a053f054a7f3948 Author: Ming Qian Date: Fri Apr 22 03:36:21 2022 +0200 media: amphion: free ctrl handler if error is set and return error The typical behavior is to add all controls, then at the end check if hdl->error was set, and if so, v4l2_ctrl_handler_free is called and the error is returned. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit be9fd51072a1c0e886281a060e79c669ebdf2049 Author: Ming Qian Date: Wed Apr 20 13:35:59 2022 +0200 media: amphion: handle picture skipped event For some invalid frames, especially multiple consecutive invalid frames, they all can't be decoded, then the firmware can send picture skipped event to notify driver that some frames are invalid, driver can return them with error flag. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 455e583638bd3a4066a1b22a11068871b0b48e47 Author: Ming Qian Date: Wed Apr 20 13:34:54 2022 +0200 media: amphion: encoder copy timestamp from output to capture copy the timestamp using the helper function V4L2_BUF_FLAG_TIMESTAMP_COPY To implement this, driver will keep the output buffer until it's encoded, in previous, driver will return the output buffer immediately after firmware return it Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a4dca209f23470f20b61b40cca417a5bf6ea8533 Author: Ming Qian Date: Wed Apr 20 13:34:53 2022 +0200 media: amphion: decoder copy timestamp from output to capture copy the timestamp using the helper function V4L2_BUF_FLAG_TIMESTAMP_COPY To implement this, driver will keep the output buffer until it's decoded, in previous, driver will return the output buffer immediately after copying data to stream buffer. After that, there is no need to make a workaround for poll function. driver can use v4l2_m2m_fop_poll directly. Also, driver don't need to keep a input threshold as the buffer count is up to only 32. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 215d49a41709610b9e82a49b27269cfaff1ef0b6 Author: Randy Dunlap Date: Wed Apr 20 08:36:44 2022 +0200 media: make RADIO_ADAPTERS tristate Fix build errors when RADIO_TEA575X=y, VIDEO_BT848=m, and VIDEO_DEV=m. The build errors occur due to [in drivers/media/Makefile]: obj-$(CONFIG_VIDEO_DEV) += radio/ so the (would be) builtin tea575x.o is not being built. This is also due to drivers/media/radio/Kconfig declaring a bool Kconfig symbol (RADIO_ADAPTERS) that depends on a tristate (VIDEO_DEV), so when VIDEO_DEV=m, RADIO_ADAPTERS becomes =y, and then the drivers that depend on RADIO_ADPATERS can be configured as builtin (=y) or as loadable modules (=m). Fix this by converting RADIO_ADAPTERS to a tristate symbol instead of a bool symbol. Fixes these build errors: ERROR: modpost: "snd_tea575x_hw_init" [drivers/media/pci/bt8xx/bttv.ko] undefined! ERROR: modpost: "snd_tea575x_set_freq" [drivers/media/pci/bt8xx/bttv.ko] undefined! ERROR: modpost: "snd_tea575x_s_hw_freq_seek" [drivers/media/pci/bt8xx/bttv.ko] undefined! ERROR: modpost: "snd_tea575x_enum_freq_bands" [drivers/media/pci/bt8xx/bttv.ko] undefined! ERROR: modpost: "snd_tea575x_g_tuner" [drivers/media/pci/bt8xx/bttv.ko] undefined! Link: lore.kernel.org/r/202204191711.IKJJFjgU-lkp@intel.com Fixes: 9958d30f38b9 ("media: Kconfig: cleanup VIDEO_DEV dependencies") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 471bec68457aaf981add77b4f590d65dd7da1059 Author: Pavel Skripkin Date: Fri Apr 15 23:24:48 2022 +0200 media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init Syzbot reported that -1 is used as array index. The problem was in missing validation check. hdw->unit_number is initialized with -1 and then if init table walk fails this value remains unchanged. Since code blindly uses this member for array indexing adding sanity check is the easiest fix for that. hdw->workpoll initialization moved upper to prevent warning in __flush_work. Reported-and-tested-by: syzbot+1a247e36149ffd709a9b@syzkaller.appspotmail.com Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18") Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6b124062d5b0f594ea46a20968061b60b288b524 Author: Niklas Söderlund Date: Wed Mar 30 17:58:11 2022 +0200 media: rcar-vin: Remove stray blank line Remove a stray blank line between function definition and body. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 87581a9ef5616b903a3d0edab0eae77c266d1e38 Author: Sebastian Fricke Date: Tue Mar 29 08:56:56 2022 +0200 media: docs-rst: Append HEVC specific term Describe the coding tree unit as replacement for the macroblock in the HEVC codec. Highlight a key difference of the HEVC codec to predecessors like AVC(H.264) to give a better overview of the differences between the coding standards. [hverkuil: replaced the 'corresponds to' symbol with the full text for clarity] Signed-off-by: Sebastian Fricke Acked-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6a5446f97b1c3add10d371590e7b09157f3c96fc Author: Sebastian Fricke Date: Sat Mar 26 19:37:17 2022 +0100 media: staging: media: rkvdec: Update TODO list VP9 support has been added to the driver by commit f25709c4ff15 ("media: rkvdec: Add the VP9 backend"). And the VP9 uABI was merged with commit b88dbe38dca8 ("media: uapi: Add VP9 stateless decoder controls"). The remaining codec that keeps this driver in staging is HEVC. Update the TODO list accordingly. Signed-off-by: Sebastian Fricke Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 19513911379a1c367ca68e8913c1c008b77d1a16 Author: Sebastian Fricke Date: Sat Mar 26 19:37:15 2022 +0100 media: staging: media: hantro: Update TODO list VP8 has been added to the uABI by commit 363240ce1c08 ("media: uapi: move VP8 stateless controls out of staging") VP9 has been added to the uABI by commit b88dbe38dca8 ("media: uapi: Add VP9 stateless decoder controls") H264 has been added to the uABI by commit 46a309d27517 ("media: uapi: move H264 stateless controls out of staging") The last remaining codec to be added to the uABI is HEVC. Highlight these changes in the TODO list. Signed-off-by: Sebastian Fricke Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d8f6f1c56d5469e22eeb7cc1f3580b29e2f0fef5 Author: Sebastian Fricke Date: Sat Mar 26 19:36:03 2022 +0100 media: staging: media: hantro: Fix typos Fix typos in comments within the Hantro driver. Signed-off-by: Sebastian Fricke Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a71eb6025305192e646040cd76ccacb5bd48a1b5 Author: Hangyu Hua Date: Thu Mar 24 09:37:24 2022 +0100 media: rga: fix possible memory leak in rga_probe rga->m2m_dev needs to be freed when rga_probe fails. Signed-off-by: Hangyu Hua Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b4e1fb8643daabba850e97df532191acffc23e6a Author: Ming Qian Date: Wed Mar 23 10:05:58 2022 +0100 media: imx-jpeg: Support dynamic resolution change To support dynamic resolution change, driver should meet the following conditions: 1. the previous pictures are all decoded before source change event. 2. prevent decoding new resolution pictures with incorrect capture buffer, until user handle source change event and setup capture. 3. report correct fmt and resolution during source change. Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 831f87424dd3973612782983ef7352789795b4df Author: Ming Qian Date: Wed Mar 23 10:05:57 2022 +0100 media: imx-jpeg: Handle source change in a function Refine code to support dynamic resolution change Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ef2feed1ece2366c817090bd9b48ea887921aabf Author: Ming Qian Date: Wed Mar 23 10:05:56 2022 +0100 media: imx-jpeg: Propagate the output frame size to the capture side The GStreamer v4l2videodec only ever calls S_FMT on the output side and then expects G_FMT on the capture side to return a valid format. Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bec0a3a67389ede106d0661a007edf832878d8b2 Author: Ming Qian Date: Wed Mar 23 10:05:55 2022 +0100 media: imx-jpeg: Identify and handle precision correctly The decoder will save the precision that was detected from jpeg header and use it later, when choosing the pixel format and also calculate bytesperline according to precision. The 12bit jpeg is not supported yet, but driver shouldn't led to serious problem if user enqueue a 12 bit jpeg. And the 12bit jpeg is supported by hardware, driver may support it later. [hverkuil: document the new precision field] Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8dd504a3a0a5f73b4c137ce3afc35936a4ecd871 Author: Ming Qian Date: Wed Mar 23 10:05:54 2022 +0100 media: imx-jpeg: Refactor function mxc_jpeg_parse Refine code to support dynamic resolution change Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 868519693b823f614c21372204920642eecefa7d Author: Husni Faiz Date: Sun Mar 20 17:36:18 2022 +0100 media: av7110: fix prohibited spaces in switch statement This patch fixes "space prohibited before that ':'" checkpatch error in the switch statements. Suggested-by: Hans Verkuil Signed-off-by: Husni Faiz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e673b25894eb4e52b73e9970ce80c7325de4a000 Author: Husni Faiz Date: Sun Mar 20 17:36:17 2022 +0100 media: av7110: fix switch indentation This patch fixes "switch and case should be at the same indent" checkpatch error. Signed-off-by: Husni Faiz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6bf9691159e5e5111c91478888524c5396a9ce9e Author: Tom Rix Date: Sat Mar 19 15:34:56 2022 +0100 media: platform: return early if the iface is not handled Clang static analysis reports this issue ispcsiphy.c:63:14: warning: The left operand of '<<' is a garbage value reg |= mode << shift; ~~~~ ^ The iface switch-statement default case falls through to ISP_INTERFACE_CCP2B_PHY1. Which is later checked to set the mode. Since the default case is left out of this check mode is never set. Instead of falling through and assuming a ISP_INTERFACE_CCP2B_PHY1 iface, return. Signed-off-by: Tom Rix Reviewed-by: Nick Desaulniers Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9fadab72a6916c7507d7fedcd644859eef995078 Author: Miaoqian Lin Date: Fri Mar 18 12:01:01 2022 +0100 media: exynos4-is: Change clk_disable to clk_disable_unprepare The corresponding API for clk_prepare_enable is clk_disable_unprepare, other than clk_disable. Fix this by changing clk_disable to clk_disable_unprepare. Fixes: b4155d7d5b2c ("[media] exynos4-is: Ensure fimc-is clocks are not enabled until properly configured") Signed-off-by: Miaoqian Lin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d63fb98afed38a8a097a4737d387f3e029ce2d20 Author: Laurent Pinchart Date: Thu Mar 17 21:49:03 2022 +0100 media: platform: renesas-ceu: Fix unused variable warning The ceu_data_rz variable is unused when CONFIG_OF isn't set. This generates a compiler warning. Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Geert Uytterhoeven Reported-by: kernel test robot Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7ec0966ec4ecab40283fa585355288828eb0501a Author: Dan Carpenter Date: Thu Mar 17 08:51:48 2022 +0100 media: davinci: remove unnecessary NULL check We verified that "vpif_obj.sd[i]" is non-NULL on the previous line so no need to check here. Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8919a25c21ae5ccc27254b1c250245e92dd3e418 Author: Dan Carpenter Date: Thu Mar 17 08:51:16 2022 +0100 media: bdisp: remove unnecessary IS_ERR() check The "bdisp->clock" variable cannot be an error pointer here. No need to check. Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8ca62a187a6e4533c42ac8280f9c13c6391aa074 Author: Jiapeng Chong Date: Thu Mar 17 02:37:38 2022 +0100 media: platform: Remove unused including Eliminate the follow versioncheck warning: ./drivers/media/platform/stm/sti/c8sectpfe/c8sectpfe-common.h: 16 linux/version.h not needed. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9627944c6e7ac053ad31a2cdbde9025ae4c0b4f1 Author: Jacopo Mondi Date: Wed Mar 16 22:09:16 2022 +0100 media: i2c: rdacm20: Fix format definition The RDACM20 camera supports a single image format which is currently listed as MEDIA_BUS_FMT_UYVY8_2X8. As the video stream is transmitted on the GMSL serial bus, the 2X8 variant does not apply. Fix the format by using MEDIA_BUS_FMT_UYVY8_1X16. This fixes a runtime error which is now triggered as the MAX9286 deserializer implements .link_validate(). Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 78b3f9d75a629f66654903a5dec5636f8a7933d9 Author: Niklas Söderlund Date: Wed Mar 16 15:48:39 2022 +0100 media: rcar-vin: Add check that input interface and format are valid Add a check to make sure the input interface (CSI-2 or parallel) allow for the requested input bus format. If not inform the user and error out rather then try to continue with incorrect settings. While at it add the missing define for RGB666 that is not yet supported in the driver but we can preemptively check for it in this context already. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e386038aff5f602c4ae0b0e20273095b53be6135 Author: Lukas Bulwahn Date: Wed Mar 16 08:25:17 2022 +0100 media: MAINTAINERS: adjust entries to nxp driver movement in media platform Commit 46fb99951fe2 ("media: platform: place NXP drivers on a separate dir") moves various files in media/platform into a nxp subdirectory. It adjusts the section MEDIA DRIVER FOR FREESCALE IMX PXP in MAINTAINERS, but misses some references in NXP i.MX 8QXP/8QM JPEG V4L2 DRIVER and MEDIA DRIVERS FOR FREESCALE IMX7. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Adjust the file references in the NXP i.MX 8QXP/8QM JPEG V4L2 DRIVER and MEDIA DRIVERS FOR FREESCALE IMX7 sections. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7208fdce270bb3e635a9b2fd9e444b7f3c1817fc Author: Laurent Pinchart Date: Tue Mar 15 11:22:45 2022 +0100 media: v4l2: mem2mem: Fix typos in v4l2_m2m_dev documentation The v4l2_m2m_dev structure documentation incorrectly references the v4l2_m2m_unregister_media_controller() function when it actually means v4l2_m2m_register_media_controller(). Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 97f05aad997567fa3e6301bf92074f501f8d01a3 Author: Tom Rix Date: Sat Mar 12 16:48:45 2022 +0100 media: cec: seco: remove byte handling from smb_word_op smb_word_op() has a parameter data_format that determines if the data is either a byte or word. From inspection, smb_word_op() is only used by the macros smb_wr16() and smb_rd16() both pass in CMD_WORD_DATA. There is no use of smb_word_op() that passes in CMD_BYTE_DATA. So remove the byte handling. Signed-off-by: Tom Rix Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d2facee67b4883bb3e7461a0a93fd70d0c7b7261 Author: Laurentiu Palcu Date: Wed Mar 9 12:55:06 2022 +0100 media: i2c: rdacm2x: properly set subdev entity function The subdevice entity function was left unset, which produces a warning when probing the device: mxc-md bus@58000000:camera: Entity type for entity rdacm20 19-0051 was not initialized! This patch will set entity function to MEDIA_ENT_F_CAM_SENSOR and leave flags unset. Fixes: 34009bffc1c6 ("media: i2c: Add RDACM20 driver") Fixes: a59f853b3b4b ("media: i2c: Add driver for RDACM21 camera module") Signed-off-by: Laurentiu Palcu Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e490fa1be5fe820029aa2ff2f70bcbbcebc11d28 Author: Mirela Rabulea Date: Tue Mar 8 14:16:57 2022 +0100 media: imx-jpeg: Fix potential array out of bounds in queue_setup Fix smatch warning in mxc_jpeg_queue_setup, check *nplanes against current format: drivers/media/platform/imx-jpeg/mxc-jpeg.c:1070 mxc_jpeg_queue_setup() warn: potential user controlled iterator 'i' (array size 2 vs 7) Signed-off-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ae309657b0b682e497f746ec5f3f054a2b4dc71a Author: Lukas Bulwahn Date: Tue Mar 8 12:43:00 2022 +0100 media: MAINTAINERS: drop unreachable contact for MEDIATEK JPEG DRIVER After sending a patch to Rick Chang, the mediatek mail server responded: ** Message not delivered ** Your message couldn't be delivered to rick.chang@mediatek.com because the remote server is misconfigured. See technical details below for more information. The response from the remote server was: 550 Relaying mail to rick.chang@mediatek.com is not allowed So, drop Rick Chang from the MEDIATEK JPEG DRIVER section. Signed-off-by: Lukas Bulwahn Reviewed-by: Miles Chen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit abba6f4fb2f4ea6075c41fe668b9c59aff5e92d7 Author: Lukas Bulwahn Date: Tue Mar 8 12:26:30 2022 +0100 media: MAINTAINERS: rectify entry for MEDIATEK MEDIA DRIVER Commit 9cdd70ceb6fa ("media: dt-bindings: media: mtk-vcodec: Separate video encoder and decoder dt-bindings") converts and splits mediatek-vcodec.txt to mediatek,vcodec-{de,en}coder.yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in MEDIATEK MEDIA DRIVER. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8551ed70dda9fb9e1c4d0ef98c2fa69c24fe4f60 Author: Lukas Bulwahn Date: Tue Mar 8 12:26:29 2022 +0100 media: MAINTAINERS: refurbish MEDIATEK JPEG DRIVER section Commit a16ce2f33732 ("media: dt-bindings: mediatek: convert mtk jpeg decoder/encoder to yaml") converts mediatek-jpeg-decoder.txt to yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. While touching this section, generalize the file entry to also cover the encoder yaml devicetree, as the driver directory also includes the encoder. Signed-off-by: Lukas Bulwahn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 969be493f5065c78cb0fae8f9413a9f1a291aaae Author: Colin Ian King Date: Mon Mar 7 23:42:47 2022 +0100 media: gspca: make the read-only array table static const Don't populate the read-only array table on the stack but instead make it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bebe10b9be3c6d7cf28fac29d108fd97eaddecf4 Author: Lukas Bulwahn Date: Mon Mar 7 15:59:35 2022 +0100 media: MAINTAINERS: rectify entry for MEDIA DRIVERS FOR NVIDIA TEGRA - VDE Commit ccc3016261ed ("media: dt: bindings: tegra-vde: Convert to schema") converts nvidia,tegra-vde.txt to nvidia,tegra-vde.yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in MEDIA DRIVERS FOR NVIDIA TEGRA - VDE. Signed-off-by: Lukas Bulwahn Acked-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 395829c61a196a0821a703a49c4db3ac51daff73 Author: Miaoqian Lin Date: Mon Mar 7 09:16:37 2022 +0100 media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe The pm_runtime_enable will decrease power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 0a0e265515db ("media: atmel: atmel-isc: split driver into driver base and isc") Signed-off-by: Miaoqian Lin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 94e3dba710fe0afc772172305444250023fc2d30 Author: Miaoqian Lin Date: Mon Mar 7 09:08:59 2022 +0100 media: st-delta: Fix PM disable depth imbalance in delta_probe The pm_runtime_enable will decrease power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: f386509e4959 ("[media] st-delta: STiH4xx multi-format video decoder v4l2 driver") Signed-off-by: Miaoqian Lin Acked-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 678e9c3a9389e48507e8f832963ad4290405adbc Merge: 03a679a1a4ec8 31a088b664d6b Author: Arnd Bergmann Date: Fri May 13 10:59:50 2022 +0200 Merge branch 'asm-generic-headers-cleanup' into asm-generic A series from Masahiro Yamada to clean up the uapi headers, making sure they can actually be included from user space without additional dependencies on either kernel headers or specific libc versions. * asm-generic-headers-cleanup: sparc: add asm/stat.h to UAPI compile-test coverage powerpc: add asm/stat.h to UAPI compile-test coverage mips: add asm/stat.h to UAPI compile-test coverage riscv: add linux/bpf_perf_event.h to UAPI compile-test coverage kbuild: prevent exported headers from including , agpgart.h: do not include from exported header commit 31a088b664d6b0437faf00975b63b17e433aa916 Author: Masahiro Yamada Date: Mon Apr 4 15:19:46 2022 +0900 sparc: add asm/stat.h to UAPI compile-test coverage asm/stat.h is currently excluded from the UAPI compile-test for ARCH=sparc because of the errors like follows: In file included from : ./usr/include/asm/stat.h:11:2: error: unknown type name 'ino_t' 11 | ino_t st_ino; | ^~~~~ HDRTEST usr/include/asm/param.h ./usr/include/asm/stat.h:12:2: error: unknown type name 'mode_t' 12 | mode_t st_mode; | ^~~~~~ ./usr/include/asm/stat.h:14:2: error: unknown type name 'uid_t' 14 | uid_t st_uid; | ^~~~~ ./usr/include/asm/stat.h:15:2: error: unknown type name 'gid_t' 15 | gid_t st_gid; | ^~~~~ The errors can be fixed by prefixing the types with __kernel_. Then, remove the no-header-test entry from user/include/Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig commit c01013a2f8ddfbdddfff3e288a936be13948cf5d Author: Masahiro Yamada Date: Mon Apr 4 15:19:45 2022 +0900 powerpc: add asm/stat.h to UAPI compile-test coverage asm/stat.h is currently excluded from the UAPI compile-test for ARCH=powerpc because of the errors like follows: HDRTEST usr/include/asm/stat.h In file included from :32: ./usr/include/asm/stat.h:32:2: error: unknown type name 'ino_t' 32 | ino_t st_ino; | ^~~~~ ./usr/include/asm/stat.h:35:2: error: unknown type name 'mode_t' 35 | mode_t st_mode; | ^~~~~~ ./usr/include/asm/stat.h:40:2: error: unknown type name 'uid_t' 40 | uid_t st_uid; | ^~~~~ ./usr/include/asm/stat.h:41:2: error: unknown type name 'gid_t' 41 | gid_t st_gid; | ^~~~~ The errors can be fixed by prefixing the types with __kernel_. Then, remove the no-header-test entry from user/include/Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig commit 8c1a381a4fbbc99760d7352ec3c3fc75b7147c9b Author: Masahiro Yamada Date: Mon Apr 4 15:19:44 2022 +0900 mips: add asm/stat.h to UAPI compile-test coverage asm/stat.h is currently excluded from the UAPI compile-test for ARCH=mips because of the errors like follows: HDRTEST usr/include/asm/stat.h In file included from :32: ./usr/include/asm/stat.h:22:2: error: unknown type name 'ino_t' 22 | ino_t st_ino; | ^~~~~ ./usr/include/asm/stat.h:23:2: error: unknown type name 'mode_t' 23 | mode_t st_mode; | ^~~~~~ ./usr/include/asm/stat.h:25:2: error: unknown type name 'uid_t' 25 | uid_t st_uid; | ^~~~~ ./usr/include/asm/stat.h:26:2: error: unknown type name 'gid_t' 26 | gid_t st_gid; | ^~~~~ ./usr/include/asm/stat.h:58:2: error: unknown type name 'mode_t' 58 | mode_t st_mode; | ^~~~~~ ./usr/include/asm/stat.h:61:2: error: unknown type name 'uid_t' 61 | uid_t st_uid; | ^~~~~ ./usr/include/asm/stat.h:62:2: error: unknown type name 'gid_t' 62 | gid_t st_gid; | ^~~~~ The errors can be fixed by prefixing the types with __kernel_. Then, remove the no-header-test entry from user/include/Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig commit 5c41778e9526227c2499e8a8fc614bb166b43734 Author: Masahiro Yamada Date: Mon Apr 4 15:19:43 2022 +0900 riscv: add linux/bpf_perf_event.h to UAPI compile-test coverage I can compile this for ARCH=riscv with CONFIG_UAPI_HEADER_TEST=y. Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig commit 02a6e4be2ff44344f58b078c18dc3ab3877fcfe5 Author: Masahiro Yamada Date: Mon Apr 4 15:19:42 2022 +0900 kbuild: prevent exported headers from including , Some UAPI headers included , like this: #ifndef __KERNEL__ #include #endif As it turned out, they just included it for no good reason. After some fixes, now I can compile-test UAPI headers (CONFIG_UAPI_HEADER_TEST=y) without including from the system header search paths. To avoid somebody getting it back again, this commit adds the dummy header, usr/dummy-include/stdlib.h I added $(srctree)/usr/dummy-include to the header search paths. Because it is searched before the system directories, if someone tries to include , they will see the error message. While I am here, I also replaced $(objtree)/usr/include with $(obj), but it has no functional change. If we can make kernel headers self-contained (that is, none of exported kernel headers includes system headers), we will be able to add the -nostdinc flag, but that is much far from where we stand now. As a realistic solution, we can ban header inclusion individually by putting a dummy header into usr/dummy-include/. Currently, no header include . I put it as well before somebody attempts to use it. Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Greg Kroah-Hartman commit 783eb354fb3dcd598e8e7e8a2ed88c0fb6ce5d2f Author: Masahiro Yamada Date: Mon Apr 4 15:19:41 2022 +0900 agpgart.h: do not include from exported header Commit 35d0f1d54ecd ("include/uapi/linux/agpgart.h: include stdlib.h in userspace") included to fix the unknown size_t error, but I do not think it is the right fix. This header already uses __kernel_size_t a few lines below. Replace the remaining size_t, and stop including . Signed-off-by: Masahiro Yamada Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Reviewed-by: Nick Desaulniers commit 5dcc2afe716d69f5112ce035cb14f007461ff189 Author: bumwoo lee Date: Wed Apr 27 12:00:05 2022 +0900 extcon: Modify extcon device to be created after driver data is set Currently, someone can invoke the sysfs such as state_show() intermittently before dev_set_drvdata() is done. And it can be a cause of kernel Oops because of edev is Null at that time. So modified the driver registration to after setting drviver data. - Oops's backtrace. Backtrace: [] (state_show) from [] (dev_attr_show) [] (dev_attr_show) from [] (sysfs_kf_seq_show) [] (sysfs_kf_seq_show) from [] (kernfs_seq_show) [] (kernfs_seq_show) from [] (seq_read) [] (seq_read) from [] (kernfs_fop_read) [] (kernfs_fop_read) from [] (__vfs_read) [] (__vfs_read) from [] (vfs_read) [] (vfs_read) from [] (ksys_read) [] (ksys_read) from [] (sys_read) [] (sys_read) from [] (__sys_trace_return) Signed-off-by: bumwoo lee Signed-off-by: Chanwoo Choi commit 5faf7cbaff459f885f09eed1e685a3cf9a19c78e Author: Markuss Broks Date: Sat Apr 23 11:53:14 2022 +0300 extcon: sm5502: Clarify SM5703's i2c device ID While SM5502 and SM5504 are purely micro USB switching circuits, SM5703 is a multi-function device which has multiple modules in it. Change the i2c_device_id of it to avoid conflict with MFD driver. Signed-off-by: Markuss Broks Signed-off-by: Chanwoo Choi commit 1bfcaa5700811117d845f081a1241dd59b885b6c Author: Li Jun Date: Tue Apr 19 20:44:09 2022 +0800 extcon: ptn5150: Add usb role class support Some usb controller drivers may not support extcon but use usb role class as it's the preferred approach, so to support usb dual role switch with usb role class, add usb role class consumer support. Signed-off-by: Li Jun Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 782cd939cbe0f569197cd1c9b0477ee213167f04 Author: Li Jun Date: Tue Apr 19 20:44:08 2022 +0800 extcon: ptn5150: Add queue work sync before driver release Add device managed action to sync pending queue work, otherwise the queued work may run after the work is destroyed. Fixes: 4ed754de2d66 ("extcon: Add support for ptn5150 extcon driver") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Li Jun Signed-off-by: Chanwoo Choi commit a84df1c7ddfcb5f7ccd7aaa80c40a49e54621ce8 Author: Markuss Broks Date: Sat Mar 12 20:41:54 2022 +0200 extcon: sm5502: Add support for SM5703 SM5703 is another MFD from Silicon Mitus which has a very similar MUIC unit to the one in SM5502. The only difference I've noticed is slightly different configuration only enables the interrupts which are exactly the same as on SM5502. If we make use of different interrupts in the future, this can be improved by having a separate struct for SM5703, but the main functionality (detecting cable or OTG adapter) is working properly. Signed-off-by: Markuss Broks Signed-off-by: Chanwoo Choi commit 9869ba6dc9302624fc024c0a5ead4137d9de150b Author: Markuss Broks Date: Sat Mar 12 20:41:53 2022 +0200 dt-bindings: extcon: bindings for SM5703 This patch adds device-tree bindings for Silicon Mitus SM5703 MUIC. Signed-off-by: Markuss Broks Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 68be7a5f281d50ee6572c8475ac6f1f99e0b1d1a Author: Bruce Chen Date: Thu Mar 3 15:36:03 2022 +0800 extcon: usb-gpio: Remove disable irq operation in system sleep If disable vbus/id irq, it will lead to wakeup system fail in unisoc platform. In unisoc platform, Irq enable and irq wakeup are the same interrupt line. So remove disable vbus/id irq operation is a way to solve the issue. Signed-off-by: Bruce Chen Acked-by: Roger Quadros Signed-off-by: Chanwoo Choi commit 6506f6a0208d684e77832ccd83684ee5f259a19a Author: Yang Li Date: Tue Jan 4 16:43:59 2022 +0800 extcon: Fix some kernel-doc comments Add the description of @id in extcon_sync() kernel-doc comment and @edev, @id, @prop in extcon_set_property_sync() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/extcon/extcon.c:409: warning: Function parameter or member 'id' not described in 'extcon_sync' drivers/extcon/extcon.c:750: warning: Function parameter or member 'edev' not described in 'extcon_set_property_sync' drivers/extcon/extcon.c:750: warning: Function parameter or member 'id' not described in 'extcon_set_property_sync' drivers/extcon/extcon.c:750: warning: Function parameter or member 'prop' not described in 'extcon_set_property_sync' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Chanwoo Choi commit 8ae4471d38c4952d8eb67ce60e3988c4ccb25dc6 Author: Gustavo A. R. Silva Date: Tue Jan 25 13:26:34 2022 -0600 extcon: usbc-cros-ec: Use struct_size() helper in kzalloc() Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Chanwoo Choi commit 4c018cc87e5592f5bb8160e6fd42059778e1b0dc Author: Hans de Goede Date: Tue Dec 28 18:01:41 2021 +0100 extcon: int3496: Add support for controlling Vbus through a regulator On some boards the 5V vboost-regulator for powering devices connected to the micro USB connector is not controlled through a GPIO. This happens for example when the 5V vboost-regulator is integrated into the charger IC and controlled over I2C. Add support for controlling the 5V vboost-regulator through the regulator framework for such boards. Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi commit c26aef6d396b015d89a10a3b433dc9d7f759bb9f Author: Hans de Goede Date: Tue Dec 28 18:01:40 2021 +0100 extcon: int3496: Add support for binding to plain platform devices On some X86 Android tablets the DSTD lack the INT3496 ACPI device, while also not handling micro USB port ID pin events inside the DSDT (instead the forked factory image kernel has things hardcoded). The new drivers/platform/x86/x86-android-tablets.c module manually instantiates an intel-int3496 device for these tablets. Add support to the extcon-intel-int3496 driver to bind to devices without an ACPI companion and export a normal platform_device modalias for automatic module loading. Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi commit 12514f668c1fc608624b23a3cccc4845290c1211 Author: Hans de Goede Date: Tue Dec 28 18:01:39 2021 +0100 extcon: int3496: Request non-exclusive access to the ID GPIO Some DSDTs are buggy and do a read from the ID pin during the ACPI initialization, causing the pin to be marked as owned by: "ACPI:OpRegion" and causing gpiod_get() to fail with -EBUSY. Pass the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag to the gpiod_get() call to work around this. Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi commit 019c34aaa85895a15962e4cf65e99f812848e44f Author: Hans de Goede Date: Tue Dec 28 18:01:38 2021 +0100 extcon: int3496: Make the driver a bit less verbose On all devices which I have with an INT3496 ACPI device, there is only an ID pin defined. Change the log-messages about not being able to get GPIOs for "VBUS EN" and "USB MUX" to use dev_dbg(). Signed-off-by: Hans de Goede Signed-off-by: Chanwoo Choi commit 58e4a2d27d3255e4e8c507fdc13734dccc9fc4c7 Author: Dan Carpenter Date: Fri Dec 17 09:28:46 2021 +0300 extcon: Fix extcon_get_extcon_dev() error handling The extcon_get_extcon_dev() function returns error pointers on error, NULL when it's a -EPROBE_DEFER defer situation, and ERR_PTR(-ENODEV) when the CONFIG_EXTCON option is disabled. This is very complicated for the callers to handle and a number of them had bugs that would lead to an Oops. In real life, there are two things which prevented crashes. First, error pointers would only be returned if there was bug in the caller where they passed a NULL "extcon_name" and none of them do that. Second, only two out of the eight drivers will build when CONFIG_EXTCON is disabled. The normal way to write this would be to return -EPROBE_DEFER directly when appropriate and return NULL when CONFIG_EXTCON is disabled. Then the error handling is simple and just looks like: dev->edev = extcon_get_extcon_dev(acpi_dev_name(adev)); if (IS_ERR(dev->edev)) return PTR_ERR(dev->edev); For the two drivers which can build with CONFIG_EXTCON disabled, then extcon_get_extcon_dev() will now return NULL which is not treated as an error and the probe will continue successfully. Those two drivers are "typec_fusb302" and "max8997-battery". In the original code, the typec_fusb302 driver had an 800ms hang in tcpm_get_current_limit() but now that function is a no-op. For the max8997-battery driver everything should continue working as is. Signed-off-by: Dan Carpenter Reviewed-by: Hans de Goede Reviewed-by: Heikki Krogerus Reviewed-by: Guenter Roeck Acked-by: Sebastian Reichel Signed-off-by: Chanwoo Choi commit 5fc201aa8cf39d8e313b22c97abea73849cf1edb Author: Deren Wu Date: Thu May 12 07:06:36 2022 +0800 mt76: mt7921: add ipv6 NS offload support Add ipv6 NS offload for WoWLAN state. Tested in this way: 1. Put device-A into WoW state. 2. ping6 from device-B to device-A. 3. In sniffer, see Neighbour advertisement from device-A. Reviewed-by: Sean Wang Signed-off-by: Deren Wu Signed-off-by: Ming Yen Hsieh Signed-off-by: Felix Fietkau commit a0a2034e2da0013347cd4c796ea04b5aa14f3854 Author: Lorenzo Bianconi Date: Thu May 12 07:06:35 2022 +0800 mt76: add gfp to mt76_mcu_msg_alloc signature Introduce __mt76_mcu_msg_alloc utility routine in order to specify gfp flags for mcu message allocation. Acked-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 64d607256a9e56944828794c8459e1cbdc0cea4b Author: Ryder Lee Date: Sun May 8 13:24:54 2022 +0800 mt76: mt7915: add more statistics from fw_util debugfs knobs Print out exception state and program counters of WA/WM MCUs. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 0d28ec72b0936a783f75bc5cf4719178bc48f39d Author: Ryder Lee Date: Sun May 8 13:24:53 2022 +0800 mt76: mt7915: improve error handling for fw_debug knobs In case fw.debug_wm/wa might be unavailable. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 5eb14a0cfcaa260c8037ec323c06403554a59345 Author: Bo Jiao Date: Sat May 7 09:21:21 2022 +0800 mt76: mt7615/mt7915: do reset_work with mt76's work queue reset_work may be blocked when mcu message timeout occurs Signed-off-by: Bo Jiao Signed-off-by: Felix Fietkau commit 869f06468e77b06795bc5855bd5b6b03c6cb147c Author: MeiChia Chiu Date: Tue Apr 26 10:23:35 2022 +0800 mt76: mt7915: add support for 6G in-band discovery Add offloading FILS discovery and unsolicited broadcast probe response support. Reviewed-by: Ryder Lee Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau commit f68d67623dec9445960b52a0e9e8e60297596b4b Author: Felix Fietkau Date: Mon Dec 6 13:45:54 2021 +0100 mt76: mt7915: add Wireless Ethernet Dispatch support This is used to support hardware flow offloading from Ethernet to WLAN Signed-off-by: Felix Fietkau commit 61b5156bf02dbd642de94eb61a3bc4ab6f8bfb71 Author: Felix Fietkau Date: Mon Apr 26 17:45:06 2021 +0200 mt76: make number of tokens configurable dynamically Preparation for adding Wireless Ethernet Dispatch support Signed-off-by: Felix Fietkau commit d1ddc536df93ae406ef671deb3218898d3515ea4 Author: Felix Fietkau Date: Thu Jan 6 13:22:28 2022 +0100 mt76: add support for overriding the device used for DMA mapping WED support requires using non-coherent DMA, whereas the PCI device might be configured for coherent DMA. The WED driver will take care of changing the PCI HIF coherent IO setting on attach. Signed-off-by: Felix Fietkau commit cc9fd945db4fa1ea2317c3d716b92ba2e9a13147 Author: Felix Fietkau Date: Sun Apr 25 08:22:45 2021 +0200 mt76: dma: add wrapper macro for accessing queue registers Preparation for adding indirection used for Wireless Ethernet Dispatch support Signed-off-by: Felix Fietkau commit 1dfe52adb00d260c5e53dc7c5dd2109d54d2b451 Author: Ryder Lee Date: Thu May 5 15:08:36 2022 +0800 mt76: mt7915: move MT_INT_MASK_CSR to init.c To avoid redundant MT_INT_MASK_CSR settings. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit b4c268ca4df8a86e80dbbd64589983bfb005467d Author: Ryder Lee Date: Thu May 5 15:08:35 2022 +0800 mt76: mt7915: introduce mt7915_mac_severe_check() In rare cases, TRB pointers might be out of sync leads to RMAC stopping Rx that requires minimal recovery, so add this helper to periodically check TRB status. Tested-by: Chad Monroe Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit bdd2ca78faacc10cf1963c2616e7ff16f571f4e4 Author: Ryder Lee Date: Thu May 5 15:08:34 2022 +0800 mt76: mt7915: rework SER debugfs knob 1. get status of system recovery from firmware. 2. add more recovery points. 3. make knob per phy. Signed-off-by: Bo Jiao Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 4ebcff04d3db076c054938ea2b6bc8057671a0d7 Author: Peter Chiu Date: Thu May 5 16:25:54 2022 +0800 mt76: mt7915: limit minimum twt duration The minimum twt duration supported by mt7915 is 64 according to hardware design. Reply station with TWT_SETUP_CMD_DICTATE if min_twt_dur smaller than 64. Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau commit c088eb38e642f43010fc53ab8e89f6b7c045ef96 Author: Peter Chiu Date: Thu May 5 16:25:53 2022 +0800 mt76: mt7915: reject duplicated twt flows Reject twt flows with the same parameters to prevent some potential issues causing by duplicated establishment. Reviewed-by: Ryder Lee Reviewed-by: Shayne Chen Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau commit 3620c8821ae15902eb995a32918e34b7a0c773a3 Author: Peter Chiu Date: Thu May 5 16:25:52 2022 +0800 mt76: mt7915: fix twt table_mask to u16 in mt7915_dev mt7915 can support 16 twt stations so modify table_mask to u16. Fixes: 3782b69d03e7 ("mt76: mt7915: introduce mt7915_mac_add_twt_setup routine") Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau commit b5509983d72ebb610366d692cb40202ec06adcae Author: Peter Chiu Date: Thu May 5 16:25:51 2022 +0800 mt76: mt7915: update mt7986 patch in mt7986_wmac_adie_patch_7976() Update mt7976 adie patch for different adie version. Reviewed-by: Ryder Lee Reviewed-by: Shayne Chen Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau commit ed2d3d948e6d8aff9e74af6a759ee0a2aff28935 Author: Sean Wang Date: Tue May 3 07:14:38 2022 +0800 mt76: connac: use skb_put_data instead of open coding use skb_put_data instead of open coding in mt76_connac_mcu_update_arp_filter. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit cd85efdfd0994df56ace1dd92dea6cc84b2184aa Author: Lorenzo Bianconi Date: Fri Apr 29 13:55:56 2022 +0200 mt76: mt7915: configure soc clocks in mt7986_wmac_init Configure mt7986 wmac soc clocks in mt7986_wmac_init routine. Tested-by: Peter Chiu Co-developed-by: Peter Chiu Signed-off-by: Peter Chiu Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit fcfe1b5e162bf473c1d47760962cec8523c00466 Author: Felix Fietkau Date: Sat Apr 23 07:01:18 2022 +0200 mt76: fix tx status related use-after-free race on station removal There is a small race window where ongoing tx activity can lead to a skb getting added to the status tracking idr after that idr has already been cleaned up, which will keep the wcid linked in the status poll list. Fix this by only adding status skbs if the wcid pointer is still assigned in dev->wcid, which gets cleared early by mt76_sta_pre_rcu_remove Fixes: bd1e3e7b693c ("mt76: introduce packet_id idr") Tested-by: Ben Greear Signed-off-by: Felix Fietkau commit bc98e7fdd80d215b4b55eea001023231eb8ce12e Author: Felix Fietkau Date: Wed Apr 20 14:29:00 2022 +0200 mt76: fix encap offload ethernet type check The driver needs to check if the format is 802.2 vs 802.3 in order to set a tx descriptor flag. skb->protocol can't be used, since it may not be properly initialized for packets coming in from a packet socket. Fix misdetection by checking the ethertype from the skb data instead Reported-by: Thibaut VARÈNE Signed-off-by: Felix Fietkau commit 3968a66475b40691c37b5e6c76975f699671e10e Author: Felix Fietkau Date: Wed Apr 20 13:20:23 2022 +0200 mt76: do not attempt to reorder received 802.3 packets without agg session Fixes potential latency / packet drop issues in cases where a BA session has not (yet) been established. Fixes: e195dad14115 ("mt76: add support for 802.3 rx frames") Signed-off-by: Felix Fietkau commit 46f6adbfce18d868cd29f4c03a09c71f65c07507 Author: Bo Jiao Date: Wed Apr 20 15:11:44 2022 +0800 mt76: mt7915: disable RX_HDR_TRANS_SHORT This patch disables RX_TRANS_SHORT to make MDP to do header translation when payload less than 8 bytes, hence the (QoS) null data can be encapsulated to 802.3 format. However, WDS requires (QoS) null data in 802.11 format to created vlan AP interfaces. Signed-off-by: Ryder Lee Signed-off-by: lian.chen Signed-off-by: Sujuan Chen Signed-off-by: Bo Jiao Signed-off-by: Felix Fietkau commit b61cc2a76b9d66f95e721167d74ab173b3902d97 Author: Yunbo Yu Date: Mon Apr 18 16:18:44 2022 +0800 mt76: mt7603: move spin_lock_bh() to spin_lock() It is unnecessary to call spin_lock_bh() within a tasklet. Signed-off-by: Yunbo Yu Signed-off-by: Felix Fietkau commit 0a17329ae9c1fa0fde43b45e7d04a10708020b1b Author: Shayne Chen Date: Mon Apr 18 16:03:30 2022 +0800 mt76: mt7915: add debugfs knob for RF registers read/write Add RF registers read/write support for debugging RF issues, which should be processed by mcu commands. The index of rf registers use the generic regidx, and are combined with two parts: WF selection [31:28] and offset [27:0]. Reviewed-by: Ryder Lee Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit ad483ed9dd5193a54293269c852a29051813b7bd Author: Sean Wang Date: Fri Apr 15 06:56:05 2022 +0800 mt76: mt7921: fix kernel crash at mt7921_pci_remove The crash log shown it is possible that mt7921_irq_handler is called while devm_free_irq is being handled so mt76_free_device need to be postponed until devm_free_irq is completed to solve the crash we free the mt76 device too early. [ 9299.339655] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 9299.339705] #PF: supervisor read access in kernel mode [ 9299.339735] #PF: error_code(0x0000) - not-present page [ 9299.339768] PGD 0 P4D 0 [ 9299.339786] Oops: 0000 [#1] SMP PTI [ 9299.339812] CPU: 1 PID: 1624 Comm: prepare-suspend Not tainted 5.15.14-1.fc32.qubes.x86_64 #1 [ 9299.339863] Hardware name: Xen HVM domU, BIOS 4.14.3 01/20/2022 [ 9299.339901] RIP: 0010:mt7921_irq_handler+0x1e/0x70 [mt7921e] [ 9299.340048] RSP: 0018:ffffa81b80c27cb0 EFLAGS: 00010082 [ 9299.340081] RAX: 0000000000000000 RBX: ffff98a4cb752020 RCX: ffffffffa96211c5 [ 9299.340123] RDX: 0000000000000000 RSI: 00000000000d4204 RDI: ffff98a4cb752020 [ 9299.340165] RBP: ffff98a4c28a62a4 R08: ffff98a4c37a96c0 R09: 0000000080150011 [ 9299.340207] R10: 0000000040000000 R11: 0000000000000000 R12: ffff98a4c4eaa080 [ 9299.340249] R13: ffff98a4c28a6360 R14: ffff98a4cb752020 R15: ffff98a4c28a6228 [ 9299.340297] FS: 00007260840d3740(0000) GS:ffff98a4ef700000(0000) knlGS:0000000000000000 [ 9299.340345] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9299.340383] CR2: 0000000000000008 CR3: 0000000004c56001 CR4: 0000000000770ee0 [ 9299.340432] PKRU: 55555554 [ 9299.340449] Call Trace: [ 9299.340467] [ 9299.340485] __free_irq+0x221/0x350 [ 9299.340527] free_irq+0x30/0x70 [ 9299.340553] devm_free_irq+0x55/0x80 [ 9299.340579] mt7921_pci_remove+0x2f/0x40 [mt7921e] [ 9299.340616] pci_device_remove+0x3b/0xa0 [ 9299.340651] __device_release_driver+0x17a/0x240 [ 9299.340686] device_driver_detach+0x3c/0xa0 [ 9299.340714] unbind_store+0x113/0x130 [ 9299.340740] kernfs_fop_write_iter+0x124/0x1b0 [ 9299.340775] new_sync_write+0x15c/0x1f0 [ 9299.340806] vfs_write+0x1d2/0x270 [ 9299.340831] ksys_write+0x67/0xe0 [ 9299.340857] do_syscall_64+0x3b/0x90 [ 9299.340887] entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 5c14a5f944b9 ("mt76: mt7921: introduce mt7921e support") Reported-by: ThinerLogoer Signed-off-by: Deren Wu Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit deb0891bad7c05b66867bc68a26849eb83281f70 Author: Colin Ian King Date: Thu Apr 14 10:54:38 2022 +0100 mt76: mt7921: make read-only array ppet16_ppet8_ru3_ru0 static const Don't populate the read-only array ppet16_ppet8_ru3_ru0 on the stack but instead make it static const. Also makes the object code a little smaller. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Colin Ian King Signed-off-by: Felix Fietkau commit b57a5bb0170a54f6f3b2dbb9624b1093d9abb878 Author: Colin Ian King Date: Thu Apr 14 10:50:07 2022 +0100 mt76: mt7915: make read-only array ppet16_ppet8_ru3_ru0 static const Don't populate the read-only array ppet16_ppet8_ru3_ru0 on the stack but instead make it static const. Also makes the object code a little smaller. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Colin Ian King Signed-off-by: Felix Fietkau commit 74752f5367ab42786c06bce01b707d23215deabe Author: Ryder Lee Date: Wed Apr 13 06:27:24 2022 +0800 mt76: mt7915: remove SCS feature SCS is obsoleted and no longer used, so remove it. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit abba345311a740d9dca1b5eb293b3b1c296715dd Author: Deren Wu Date: Sat Apr 9 21:44:07 2022 +0800 mt76: fix antenna config missing in 6G cap To make sure we have the proper antenna config in 6g cap, move IEEE80211_VHT_CAP_[T/R]X_ANTENNA_PATTERN to stream init. Fixes: edf9dab8ba27 ("mt76: add 6GHz support") Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit f5874fc6f54e58da8afb01092286f5e18a54c55d Author: Felix Fietkau Date: Wed Apr 20 12:27:18 2022 +0200 mt76: fix rx reordering with non explicit / psmp ack policy When the QoS ack policy was set to non explicit / psmp ack, frames are treated as not being part of a BA session, which causes extra latency on reordering. Fix this by only bypassing reordering for packets with no-ack policy Signed-off-by: Felix Fietkau commit 116c69603b01f2d6e4499ca5d535f5b71c52052c Author: Sean Wang Date: Thu Apr 7 02:29:14 2022 +0800 mt76: mt7921: Add AP mode support add AP mode support to mt7921 that can work for mt7921[e,s,u] with the common code. Tested-by: Deren Wu Tested-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 1e779f49ca0c413c80457b2db9c201c8db6188bb Author: Lorenzo Bianconi Date: Mon Apr 4 19:28:02 2022 +0200 mt76: mt7915: use 0xff to initialize bitrate_mask in mt7915_init_bitrate_mask Use 0xff (GENMASK(7,0)) in mt7915_init_bitrate_mask routine in order to initialize bitrate_mask structure in order to avoid truncating value in memset(). Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 05268cf1789d99eda491c4a32f23a4c5b9bddeba Author: Lorenzo Bianconi Date: Mon Apr 4 11:17:03 2022 +0200 mt76: mt7915: report rx mode value in mt7915_mac_fill_rx_rate Report rx mode in mt7915_mac_fill_rx_rate routine in order to properly add he radiotap if mode is at least HE_SU. Fixes: 1c9db0aa23fd1 ("mt76: mt7915: update rx rate reporting for mt7916") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit badb6ffaa1439fce30fc6ef10571dcf45a622b44 Author: Lorenzo Bianconi Date: Mon Apr 4 10:35:39 2022 +0200 mt76: mt7915: do not pass data pointer to mt7915_mcu_muru_debug_set Fix typo in mt7915_muru_debug_set routine and pass muru_debug value to mt7915_mcu_muru_debug_set() instead of data pointer. Fixes: 1966a5078f2d ("mt76: mt7915: add mu-mimo and ofdma debugfs knobs") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 62fdc974894eec80d678523458cf99bbdb887e22 Author: Lorenzo Bianconi Date: Mon Apr 4 10:23:15 2022 +0200 mt76: mt7915: fix possible NULL pointer dereference in mt7915_mac_fill_rx_vector Fix possible NULL pointer dereference in mt7915_mac_fill_rx_vector routine if the chip does not support dbdc and the hw reports band_idx set to 1. Fixes: 78fc30a21cf11 ("mt76: mt7915: move testmode data from dev to phy") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9bd6823f5a64b6465708b244eecc9b7dd4b01bfc Author: Lorenzo Bianconi Date: Mon Apr 4 10:08:10 2022 +0200 mt76: mt7915: fix possible uninitialized pointer dereference in mt7986_wmac_gpio_setup Add default case for type switch in mt7986_wmac_gpio_setup routine in order to avoid a possible uninitialized pointer dereference. Fixes: 99ad32a4ca3a2 ("mt76: mt7915: add support for MT7986") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 4e90db5e21eb3bb272fe47386dc3506755e209e9 Author: Christophe JAILLET Date: Sun Apr 3 17:40:33 2022 +0200 mt76: mt7921: Fix the error handling path of mt7921_pci_probe() In case of error, some resources must be freed, as already done above and below the devm_kmemdup() and __mt7921e_mcu_drv_pmctrl() calls added in the commit in Fixes:. Fixes: 602cc0c9618a ("mt76: mt7921e: fix possible probe failure after reboot") Signed-off-by: Christophe JAILLET Signed-off-by: Felix Fietkau commit aa796f12091aa4758366f5171fd9cba2ff574ba3 Author: Lorenzo Bianconi Date: Sat Mar 19 14:28:01 2022 +0100 mt76: mt7915: fix unbounded shift in mt7915_mcu_beacon_mbss Fix the following smatch static checker warning: drivers/net/wireless/mediatek/mt76/mt7915/mcu.c:1872 mt7915_mcu_beacon_mbss() error: undefined (user controlled) shift '(((1))) << (data[2])' Rely on mac80211 definitions for ieee80211_bssid_index subelement. Fixes: 6b7f9aff7c67 ("mt76: mt7915: introduce 802.11ax multi-bss support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5beadb27fa808172c26a6a6d3e8500cf6b547c48 Author: Ryder Lee Date: Sat Mar 19 12:53:50 2022 +0800 mt76: mt7915: always call mt7915_wfsys_reset() during init Soft reboot might not clear certain condition, so always call mt7915_wfsys_reset() during init. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 47eea8ad62a1203ce20b365f7feba23fef62a487 Author: Lorenzo Bianconi Date: Thu Mar 17 18:08:35 2022 +0100 mt76: mt7921: honor pm user configuration in mt7921_sniffer_interface_iter Honor runtime-pm user configuration in mt7921_sniffer_interface_iter routine if we do not have a monitor interface. Fixes: 1f12fa34e5dc5 ("mt76: mt7921: don't enable beacon filter when IEEE80211_CONF_CHANGE_MONITOR is set") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5e0abf6f4903d71222f4c7498ca0e271833b3694 Author: Lorenzo Bianconi Date: Thu Mar 17 18:02:22 2022 +0100 mt76: mt7921: rely on mt76_dev rxfilter in mt7921_configure_filter mt7921 is currently using rxfilter defined in mt76_dev for rx filter configuration. Fix mt7921_configure_filter implementation. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit df3e4143ba8ac159a0a55e84b616167219b7940b Author: Lorenzo Bianconi Date: Thu Mar 17 17:55:59 2022 +0100 mt76: mt7921u: add suspend/resume support Introduce suspend/resume callbacks for mt7921u driver. Tested-by: Deren Wu Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b619e01380eedf24e8d26a367e94e0ccaeb0c3dd Author: Evelyn Tsai Date: Thu Mar 17 16:21:50 2022 +0800 mt76: fix MBSS index condition in DBDC mode MT7915_MAX_INTERFACES is per-band declaration in MT7915/MT7986/MT7916. Enlarge vif_mask to 64 bits wide, including the bit operation. Reviewed-by: Shayne Chen Signed-off-by: Evelyn Tsai Signed-off-by: Bo Jiao Signed-off-by: Felix Fietkau commit 51fb1278aa57ae0fc54adaa786e1965362bed4fb Author: Felix Fietkau Date: Fri Mar 25 22:01:43 2022 +0100 mt76: fix use-after-free by removing a non-RCU wcid pointer Fixes an issue caught by KASAN about use-after-free in mt76_txq_schedule by protecting mtxq->wcid with rcu_lock between mt76_txq_schedule and sta_info_[alloc, free]. [18853.876689] ================================================================== [18853.876751] BUG: KASAN: use-after-free in mt76_txq_schedule+0x204/0xaf8 [mt76] [18853.876773] Read of size 8 at addr ffffffaf989a2138 by task mt76-tx phy0/883 [18853.876786] [18853.876810] CPU: 5 PID: 883 Comm: mt76-tx phy0 Not tainted 5.10.100-fix-510-56778d365941-kasan #5 0b01fbbcf41a530f52043508fec2e31a4215 [18853.876840] Call trace: [18853.876861] dump_backtrace+0x0/0x3ec [18853.876878] show_stack+0x20/0x2c [18853.876899] dump_stack+0x11c/0x1ac [18853.876918] print_address_description+0x74/0x514 [18853.876934] kasan_report+0x134/0x174 [18853.876948] __asan_report_load8_noabort+0x44/0x50 [18853.876976] mt76_txq_schedule+0x204/0xaf8 [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2] [18853.877002] mt76_txq_schedule_all+0x2c/0x48 [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2] [18853.877030] mt7921_tx_worker+0xa0/0x1cc [mt7921_common f0875ebac9d7b4754e1010549e7db50fbd90a047] [18853.877054] __mt76_worker_fn+0x190/0x22c [mt76 074e03e4640e97fe7405ee1fab547b81c4fa45d2] [18853.877071] kthread+0x2f8/0x3b8 [18853.877087] ret_from_fork+0x10/0x30 [18853.877098] [18853.877112] Allocated by task 941: [18853.877131] kasan_save_stack+0x38/0x68 [18853.877147] __kasan_kmalloc+0xd4/0xfc [18853.877163] kasan_kmalloc+0x10/0x1c [18853.877177] __kmalloc+0x264/0x3c4 [18853.877294] sta_info_alloc+0x460/0xf88 [mac80211] [18853.877410] ieee80211_prep_connection+0x204/0x1ee0 [mac80211] [18853.877523] ieee80211_mgd_auth+0x6c4/0xa4c [mac80211] [18853.877635] ieee80211_auth+0x20/0x2c [mac80211] [18853.877733] rdev_auth+0x7c/0x438 [cfg80211] [18853.877826] cfg80211_mlme_auth+0x26c/0x390 [cfg80211] [18853.877919] nl80211_authenticate+0x6d4/0x904 [cfg80211] [18853.877938] genl_rcv_msg+0x748/0x93c [18853.877954] netlink_rcv_skb+0x160/0x2a8 [18853.877969] genl_rcv+0x3c/0x54 [18853.877985] netlink_unicast_kernel+0x104/0x1ec [18853.877999] netlink_unicast+0x178/0x268 [18853.878015] netlink_sendmsg+0x3cc/0x5f0 [18853.878030] sock_sendmsg+0xb4/0xd8 [18853.878043] ____sys_sendmsg+0x2f8/0x53c [18853.878058] ___sys_sendmsg+0xe8/0x150 [18853.878071] __sys_sendmsg+0xc4/0x1f4 [18853.878087] __arm64_compat_sys_sendmsg+0x88/0x9c [18853.878101] el0_svc_common+0x1b4/0x390 [18853.878115] do_el0_svc_compat+0x8c/0xdc [18853.878131] el0_svc_compat+0x10/0x1c [18853.878146] el0_sync_compat_handler+0xa8/0xcc [18853.878161] el0_sync_compat+0x188/0x1c0 [18853.878171] [18853.878183] Freed by task 10927: [18853.878200] kasan_save_stack+0x38/0x68 [18853.878215] kasan_set_track+0x28/0x3c [18853.878228] kasan_set_free_info+0x24/0x48 [18853.878244] __kasan_slab_free+0x11c/0x154 [18853.878259] kasan_slab_free+0x14/0x24 [18853.878273] slab_free_freelist_hook+0xac/0x1b0 [18853.878287] kfree+0x104/0x390 [18853.878402] sta_info_free+0x198/0x210 [mac80211] [18853.878515] __sta_info_destroy_part2+0x230/0x2d4 [mac80211] [18853.878628] __sta_info_flush+0x300/0x37c [mac80211] [18853.878740] ieee80211_set_disassoc+0x2cc/0xa7c [mac80211] [18853.878851] ieee80211_mgd_deauth+0x4a4/0x10a0 [mac80211] [18853.878962] ieee80211_deauth+0x20/0x2c [mac80211] [18853.879057] rdev_deauth+0x7c/0x438 [cfg80211] [18853.879150] cfg80211_mlme_deauth+0x274/0x414 [cfg80211] [18853.879243] cfg80211_mlme_down+0xe4/0x118 [cfg80211] [18853.879335] cfg80211_disconnect+0x218/0x2d8 [cfg80211] [18853.879427] __cfg80211_leave+0x17c/0x240 [cfg80211] [18853.879519] cfg80211_leave+0x3c/0x58 [cfg80211] [18853.879611] wiphy_suspend+0xdc/0x200 [cfg80211] [18853.879628] dpm_run_callback+0x58/0x408 [18853.879642] __device_suspend+0x4cc/0x864 [18853.879658] async_suspend+0x34/0xf4 [18853.879673] async_run_entry_fn+0xe0/0x37c [18853.879689] process_one_work+0x508/0xb98 [18853.879702] worker_thread+0x7f4/0xcd4 [18853.879717] kthread+0x2f8/0x3b8 [18853.879731] ret_from_fork+0x10/0x30 [18853.879741] [18853.879757] The buggy address belongs to the object at ffffffaf989a2000 [18853.879757] which belongs to the cache kmalloc-8k of size 8192 [18853.879774] The buggy address is located 312 bytes inside of [18853.879774] 8192-byte region [ffffffaf989a2000, ffffffaf989a4000) [18853.879787] The buggy address belongs to the page: [18853.879807] page:000000004bda2a59 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d89a0 [18853.879823] head:000000004bda2a59 order:3 compound_mapcount:0 compound_pincount:0 [18853.879839] flags: 0x8000000000010200(slab|head) [18853.879857] raw: 8000000000010200 ffffffffbc89e208 ffffffffb7fb5208 ffffffaec000cc80 [18853.879873] raw: 0000000000000000 0000000000010001 00000001ffffffff 0000000000000000 [18853.879885] page dumped because: kasan: bad access detected [18853.879896] [18853.879907] Memory state around the buggy address: [18853.879922] ffffffaf989a2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [18853.879935] ffffffaf989a2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [18853.879948] >ffffffaf989a2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [18853.879961] ^ [18853.879973] ffffffaf989a2180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [18853.879986] ffffffaf989a2200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [18853.879998] ================================================================== Cc: stable@vger.kernel.org Reported-by: Sean Wang Signed-off-by: Felix Fietkau commit 3128ea016965ce9f91ddf4e1dd944724462d1698 Author: Felix Fietkau Date: Fri Mar 25 21:15:15 2022 +0100 mt76: mt7921: accept rx frames with non-standard VHT MCS10-11 The hardware receives them properly, they should not be dropped Signed-off-by: Felix Fietkau commit 77045a3740fa3d2325293cf8623899532b39303e Author: Felix Fietkau Date: Fri Mar 25 21:14:26 2022 +0100 mt76: mt7915: accept rx frames with non-standard VHT MCS10-11 The hardware receives them properly, they should not be dropped Signed-off-by: Felix Fietkau commit 402e01092e79583923579662f244bc538f466f36 Author: Felix Fietkau Date: Sat Mar 19 21:56:20 2022 +0100 mt76: dma: use kzalloc instead of devm_kzalloc for txwi dma unmap is already needed for cleanup anyway, so we don't need the extra tracking and can save a bit of memory here Signed-off-by: Felix Fietkau commit 9912a4639d1a0b7f2a7df269bf07069590b98444 Author: Felix Fietkau Date: Sat Mar 19 21:40:14 2022 +0100 mt76: reduce tx queue lock hold time - call txq dequeue without holding txq lock (locking handled by mac80211) - disable bh around tx queue schedule Signed-off-by: Felix Fietkau commit 7b8e1ae886e45aed9274048f2836a70b75ecfa40 Author: Felix Fietkau Date: Fri Mar 25 14:20:06 2022 +0100 mt76: mt7915: rework hardware/phy initialization Clean up and fix error paths in mt7915_register_device Initialize second DBDC tx queue in mt7915_dma_init Signed-off-by: Felix Fietkau commit 96c777708bcac53f73a1c079e416495647f69553 Author: Felix Fietkau Date: Sat Mar 19 08:08:26 2022 +0100 mt76: mt7915: fix DBDC default band selection on MT7915D This code was accidentally dropped while adding 6 GHz support Fixes: b4d093e321bd ("mt76: mt7915: add 6 GHz support") Signed-off-by: Felix Fietkau commit 5c0db68ce0faeb000c3540d095eb272d671a6e03 Author: Miaoqian Lin Date: Mon Mar 7 08:52:06 2022 +0100 media: exynos4-is: Fix PM disable depth imbalance in fimc_is_probe If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call. Fixes: 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 310fda622bbd38be17fb444f7f049b137af3bc0d Author: Christophe JAILLET Date: Sun Mar 6 19:08:07 2022 +0100 media: aspeed: Fix an error handling path in aspeed_video_probe() A dma_free_coherent() call is missing in the error handling path of the probe, as already done in the remove function. In fact, this call is included in aspeed_video_free_buf(). So use the latter both in the error handling path of the probe and in the remove function. It is easier to see the relation with aspeed_video_alloc_buf() this way. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a5e9e202fe4c25ab6c57061d009a17a2369355bc Author: Nícolas F. R. A. Prado Date: Fri Feb 25 23:58:54 2022 +0100 media: dt-bindings: mtk-vcodec-encoder: Add power-domains property The encoder node may be dependent on a power-domain. Add a property for it. Signed-off-by: Nícolas F. R. A. Prado Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 64d83f06774668081258bd7f3241267239bb9ab2 Author: Masahiro Yamada Date: Thu May 12 12:59:02 2022 +0900 csky: Move $(core-y) into arch/csky/Kbuild Use the standard obj-y form to specify the sub-directories under arch/csky/. Only leave core-y += arch/csky/$(CSKYABI)/ there. Signed-off-by: Masahiro Yamada Signed-off-by: Guo Ren commit 29b24a76bdea0786a727e08266607c6e3bbfa160 Author: Masahiro Yamada Date: Thu May 12 12:59:01 2022 +0900 csky: Remove unused core-y for dts This line was used for embedding a DT into vmlinux. Since commit c4c14c3bd177 ("csky: remove builtin-dtb Kbuild"), DT for csky is just a separate blob. It is covered by the generic rule in the top Makefile: ifdef CONFIG_OF_EARLY_FLATTREE all: dtbs endif Signed-off-by: Masahiro Yamada Signed-off-by: Guo Ren commit 9d975568606631601cc2bb5b62598869838ff0be Author: Masahiro Yamada Date: Thu May 12 12:59:00 2022 +0900 csky: Remove unused $(dtb-y) from boot/Makefile arch/csky/boot/Makefile does not build DTB, arch/csky/boot/dts/Makefile does. Signed-off-by: Masahiro Yamada Signed-off-by: Guo Ren commit ad732da434a2936128769216eddaece3b1af4588 Author: Dongliang Mu Date: Wed May 11 09:44:52 2022 +0800 rtlwifi: Use pr_warn instead of WARN_ONCE This memory allocation failure can be triggered by fault injection or high pressure testing, resulting a WARN. Fix this by replacing WARN with pr_warn. Reported-by: syzkaller Signed-off-by: Dongliang Mu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220511014453.1621366-1-dzm91@hust.edu.cn commit 25d9767831d3dcae8f9f278555ba9ed57b30bbce Author: Haowen Bai Date: Thu May 12 20:38:37 2022 -0700 ia64: mca: drop redundant spinlock initialization mlogbuf_rlock has declared and initialized by DEFINE_SPINLOCK, so we don't need to spin_lock_init again, drop it. Link: https://lkml.kernel.org/r/1652176897-4754-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton commit 6b9dbedbe3499fef862c4dff5217cf91f34e43b3 Author: Qi Zheng Date: Thu May 12 20:38:37 2022 -0700 tty: fix deadlock caused by calling printk() under tty_port->lock pty_write() invokes kmalloc() which may invoke a normal printk() to print failure message. This can cause a deadlock in the scenario reported by syz-bot below: CPU0 CPU1 CPU2 ---- ---- ---- lock(console_owner); lock(&port_lock_key); lock(&port->lock); lock(&port_lock_key); lock(&port->lock); lock(console_owner); As commit dbdda842fe96 ("printk: Add console owner and waiter logic to load balance console writes") said, such deadlock can be prevented by using printk_deferred() in kmalloc() (which is invoked in the section guarded by the port->lock). But there are too many printk() on the kmalloc() path, and kmalloc() can be called from anywhere, so changing printk() to printk_deferred() is too complicated and inelegant. Therefore, this patch chooses to specify __GFP_NOWARN to kmalloc(), so that printk() will not be called, and this deadlock problem can be avoided. Syzbot reported the following lockdep error: ====================================================== WARNING: possible circular locking dependency detected 5.4.143-00237-g08ccc19a-dirty #10 Not tainted ------------------------------------------------------ syz-executor.4/29420 is trying to acquire lock: ffffffff8aedb2a0 (console_owner){....}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:1752 [inline] ffffffff8aedb2a0 (console_owner){....}-{0:0}, at: vprintk_emit+0x2ca/0x470 kernel/printk/printk.c:2023 but task is already holding lock: ffff8880119c9158 (&port->lock){-.-.}-{2:2}, at: pty_write+0xf4/0x1f0 drivers/tty/pty.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&port->lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x35/0x50 kernel/locking/spinlock.c:159 tty_port_tty_get drivers/tty/tty_port.c:288 [inline] <-- lock(&port->lock); tty_port_default_wakeup+0x1d/0xb0 drivers/tty/tty_port.c:47 serial8250_tx_chars+0x530/0xa80 drivers/tty/serial/8250/8250_port.c:1767 serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1854 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1827 [inline] <-- lock(&port_lock_key); serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1870 serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x109/0xa50 kernel/irq/handle.c:156 [...] -> #1 (&port_lock_key){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x35/0x50 kernel/locking/spinlock.c:159 serial8250_console_write+0x184/0xa40 drivers/tty/serial/8250/8250_port.c:3198 <-- lock(&port_lock_key); call_console_drivers kernel/printk/printk.c:1819 [inline] console_unlock+0x8cb/0xd00 kernel/printk/printk.c:2504 vprintk_emit+0x1b5/0x470 kernel/printk/printk.c:2024 <-- lock(console_owner); vprintk_func+0x8d/0x250 kernel/printk/printk_safe.c:394 printk+0xba/0xed kernel/printk/printk.c:2084 register_console+0x8b3/0xc10 kernel/printk/printk.c:2829 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:681 console_init+0x49d/0x6d3 kernel/printk/printk.c:2915 start_kernel+0x5e9/0x879 init/main.c:713 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241 -> #0 (console_owner){....}-{0:0}: [...] lock_acquire+0x127/0x340 kernel/locking/lockdep.c:4734 console_trylock_spinning kernel/printk/printk.c:1773 [inline] <-- lock(console_owner); vprintk_emit+0x307/0x470 kernel/printk/printk.c:2023 vprintk_func+0x8d/0x250 kernel/printk/printk_safe.c:394 printk+0xba/0xed kernel/printk/printk.c:2084 fail_dump lib/fault-inject.c:45 [inline] should_fail+0x67b/0x7c0 lib/fault-inject.c:144 __should_failslab+0x152/0x1c0 mm/failslab.c:33 should_failslab+0x5/0x10 mm/slab_common.c:1224 slab_pre_alloc_hook mm/slab.h:468 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2807 [inline] __kmalloc+0x72/0x300 mm/slub.c:3871 kmalloc include/linux/slab.h:582 [inline] tty_buffer_alloc+0x23f/0x2a0 drivers/tty/tty_buffer.c:175 __tty_buffer_request_room+0x156/0x2a0 drivers/tty/tty_buffer.c:273 tty_insert_flip_string_fixed_flag+0x93/0x250 drivers/tty/tty_buffer.c:318 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x126/0x1f0 drivers/tty/pty.c:122 <-- lock(&port->lock); n_tty_write+0xa7a/0xfc0 drivers/tty/n_tty.c:2356 do_tty_write drivers/tty/tty_io.c:961 [inline] tty_write+0x512/0x930 drivers/tty/tty_io.c:1045 __vfs_write+0x76/0x100 fs/read_write.c:494 [...] other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &port->lock Link: https://lkml.kernel.org/r/20220511061951.1114-2-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20220510113809.80626-2-zhengqi.arch@bytedance.com Fixes: b6da31b2c07c ("tty: Fix data race in tty_insert_flip_string_fixed_flag") Signed-off-by: Qi Zheng Acked-by: Jiri Slaby Acked-by: Greg Kroah-Hartman Cc: Akinobu Mita Cc: Vlastimil Babka Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 47b7eae62aa7dc69f0e6d12493e5468ba57bf074 Author: Colin Ian King Date: Thu May 12 20:38:37 2022 -0700 relay: remove redundant assignment to pointer buf Pointer buf is being assigned a value that is not being read, buf is being re-assigned in the next starement. The assignment is redundant and can be removed. Cleans up clang scan build warning: kernel/relay.c:443:8: warning: Although the value stored to 'buf' is used in the enclosing expression, the value is never actually read from 'buf' [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20220508212152.58753-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Reviewed-by: Jens Axboe Cc: Christoph Hellwig Cc: Kalle Valo Signed-off-by: Andrew Morton commit a3b774342fa752a5290c0de36375289dfcf4a260 Author: Randy Dunlap Date: Thu May 12 20:38:37 2022 -0700 fs/ntfs3: validate BOOT sectors_per_clusters When the NTFS BOOT sectors_per_clusters field is > 0x80, it represents a shift value. Make sure that the shift value is not too large before using it (NTFS max cluster size is 2MB). Return -EVINVAL if it too large. This prevents negative shift values and shift values that are larger than the field size. Prevents this UBSAN error: UBSAN: shift-out-of-bounds in ../fs/ntfs3/super.c:673:16 shift exponent -192 is negative Link: https://lkml.kernel.org/r/20220502175342.20296-1-rdunlap@infradead.org Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Randy Dunlap Reported-by: syzbot+1631f09646bc214d2e76@syzkaller.appspotmail.com Reviewed-by: Namjae Jeon Cc: Konstantin Komarov Cc: Alexander Viro Cc: Kari Argillander Cc: Namjae Jeon Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit cd290a9839cee2f6641558877e707bd373c8f6f1 Author: Puyou Lu Date: Thu May 12 20:38:36 2022 -0700 lib/string_helpers: fix not adding strarray to device's resource list Add allocated strarray to device's resource list. This is a must to automatically release strarray when the device disappears. Without this fix we have a memory leak in the few drivers which use devm_kasprintf_strarray(). Link: https://lkml.kernel.org/r/20220506044409.30066-1-puyou.lu@gmail.com Link: https://lkml.kernel.org/r/20220506073623.2679-1-puyou.lu@gmail.com Fixes: acdb89b6c87a ("lib/string_helpers: Introduce managed variant of kasprintf_strarray()") Signed-off-by: Puyou Lu Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Cc: Tejun Heo Cc: Signed-off-by: Andrew Morton commit a7bd57b87f65e0e1c5d41baf51a0d0b49fb30808 Author: lizhe Date: Thu May 12 20:38:36 2022 -0700 kernel/crash_core.c: remove redundant check of ck_cmdline At the end of get_last_crashkernel(), the judgement of ck_cmdline is obviously unnecessary and causes redundance, let's clean it up. Link: https://lkml.kernel.org/r/20220506104116.259323-1-sensor1010@163.com Signed-off-by: lizhe Acked-by: Baoquan He Acked-by: Philipp Rudo Cc: Vivek Goyal Cc: Dave Young Signed-off-by: Andrew Morton commit c9b516f16be5896a3d798f8efb03acbd2ceec715 Author: Alexey Dobriyan Date: Thu May 12 20:38:36 2022 -0700 ELF, uapi: fixup ELF_ST_TYPE definition This is very theoretical compile failure: ELF_ST_TYPE(st_info = A) Cast will bind first and st_info will stop being lvalue: error: lvalue required as left operand of assignment Given that the only use of this macro is ELF_ST_TYPE(sym->st_info) where st_info is "unsigned char" I've decided to remove cast especially given that companion macro ELF_ST_BIND doesn't use cast. Link: https://lkml.kernel.org/r/Ymv7G1BeX4kt3obz@localhost.localdomain Signed-off-by: Alexey Dobriyan Acked-by: Kees Cook Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton commit 5756c29bfa816dfde24e0719002d225ab96a0cd6 Merge: f83493f7d34da cb7e1abc2c736 Author: Dave Airlie Date: Fri May 13 12:42:23 2022 +1000 Merge tag 'drm/tegra/for-5.19-rc1' of https://gitlab.freedesktop.org/drm/tegra into drm-next drm/tegra: Changes for v5.19-rc1 Only a few fixes this time, and some debuggability improvements. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20220506164004.3922226-1-thierry.reding@gmail.com commit b67fd3d9d94223b424674f45eeadeff58b4b03ef Merge: 0c1822d907253 ec8cb4f617a23 Author: Jakub Kicinski Date: Thu May 12 16:52:21 2022 -0700 Merge branch 'net-inet-retire-port-only-listening_hash' Martin KaFai Lau says: ==================== net: inet: Retire port only listening_hash This series is to retire the port only listening_hash. The listen sk is currently stored in two hash tables, listening_hash (hashed by port) and lhash2 (hashed by port and address). After commit 0ee58dad5b06 ("net: tcp6: prefer listeners bound to an address") and commit d9fbc7f6431f ("net: tcp: prefer listeners bound to an address"), the TCP-SYN lookup fast path does not use listening_hash. The commit 05c0b35709c5 ("tcp: seq_file: Replace listening_hash with lhash2") also moved the seq_file (/proc/net/tcp) iteration usage from listening_hash to lhash2. There are still a few listening_hash usages left. One of them is inet_reuseport_add_sock() which uses the listening_hash to search a listen sk during the listen() system call. This turns out to be very slow on use cases that listen on many different VIPs at a popular port (e.g. 443). [ On top of the slowness in adding to the tail in the IPv6 case ]. A latter patch has a selftest to demonstrate this case. This series takes this chance to move all remaining listening_hash usages to lhash2 and then retire listening_hash. ==================== Link: https://lore.kernel.org/r/20220512000546.188616-1-kafai@fb.com Signed-off-by: Jakub Kicinski commit ec8cb4f617a23700d37018d249e3b05149d44a38 Author: Martin KaFai Lau Date: Wed May 11 17:06:11 2022 -0700 net: selftests: Stress reuseport listen This patch adds a test that has 300 VIPs listening on port 443. Each VIP:443 will have 80 listening socks by using SO_REUSEPORT. Thus, it will have 24000 listening socks. Before removing the port only listening_hash, all socks will be in the same port 443 bucket and inet_reuseport_add_sock() spends much time to walk through the bucket. After removing the port only listening_hash and move all usage to the port+addr lhash2, each bucket in the ideal case has 80 sk which is much smaller than before. Here is the test result from a qemu: Before: listen 24000 socks took 210.210485362 (~210s) After: listen 24000 socks took 0.207173 (~210ms) Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit cae3873c5b3a4fcd9706fb461ff4e91bdf1f0120 Author: Martin KaFai Lau Date: Wed May 11 17:06:05 2022 -0700 net: inet: Retire port only listening_hash The listen sk is currently stored in two hash tables, listening_hash (hashed by port) and lhash2 (hashed by port and address). After commit 0ee58dad5b06 ("net: tcp6: prefer listeners bound to an address") and commit d9fbc7f6431f ("net: tcp: prefer listeners bound to an address"), the TCP-SYN lookup fast path does not use listening_hash. The commit 05c0b35709c5 ("tcp: seq_file: Replace listening_hash with lhash2") also moved the seq_file (/proc/net/tcp) iteration usage from listening_hash to lhash2. There are still a few listening_hash usages left. One of them is inet_reuseport_add_sock() which uses the listening_hash to search a listen sk during the listen() system call. This turns out to be very slow on use cases that listen on many different VIPs at a popular port (e.g. 443). [ On top of the slowness in adding to the tail in the IPv6 case ]. The latter patch has a selftest to demonstrate this case. This patch takes this chance to move all remaining listening_hash usages to lhash2 and then retire listening_hash. Since most changes need to be done together, it is hard to cut the listening_hash to lhash2 switch into small patches. The changes in this patch is highlighted here for the review purpose. 1. Because of the listening_hash removal, lhash2 can use the sk->sk_nulls_node instead of the icsk->icsk_listen_portaddr_node. This will also keep the sk_unhashed() check to work as is after stop adding sk to listening_hash. The union is removed from inet_listen_hashbucket because only nulls_head is needed. 2. icsk->icsk_listen_portaddr_node and its helpers are removed. 3. The current lhash2 users needs to iterate with sk_nulls_node instead of icsk_listen_portaddr_node. One case is in the inet[6]_lhash2_lookup(). Another case is the seq_file iterator in tcp_ipv4.c. One thing to note is sk_nulls_next() is needed because the old inet_lhash2_for_each_icsk_continue() does a "next" first before iterating. 4. Move the remaining listening_hash usage to lhash2 inet_reuseport_add_sock() which this series is trying to improve. inet_diag.c and mptcp_diag.c are the final two remaining use cases and is moved to lhash2 now also. Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit e8d0059000b20c4745c5b6a713f6adb269cff8ff Author: Martin KaFai Lau Date: Wed May 11 17:05:58 2022 -0700 net: inet: Open code inet_hash2 and inet_unhash2 This patch folds lhash2 related functions into __inet_hash and inet_unhash. This will make the removal of the listening_hash in a latter patch easier to review. First, this patch folds inet_hash2 into __inet_hash. For unhash, the current call sequence is like inet_unhash() => __inet_unhash() => inet_unhash2(). The specific testing cases in __inet_unhash() are mostly related to TCP_LISTEN sk and its caller inet_unhash() already has the TCP_LISTEN test, so this patch folds both __inet_unhash() and inet_unhash2() into inet_unhash(). Note that all listening_hash users also have lhash2 initialized, so the !h->lhash2 check is no longer needed. Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 8ea1eebb49a2dfee1dce621a638cc1626e542392 Author: Martin KaFai Lau Date: Wed May 11 17:05:52 2022 -0700 net: inet: Remove count from inet_listen_hashbucket After commit 0ee58dad5b06 ("net: tcp6: prefer listeners bound to an address") and commit d9fbc7f6431f ("net: tcp: prefer listeners bound to an address"), the count is no longer used. This patch removes it. Signed-off-by: Martin KaFai Lau Reviewed-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 0c1822d9072538cf8e10dc0ab08842700e717d8e Merge: 75db72de1f744 c374303969eac Author: Jakub Kicinski Date: Thu May 12 16:49:32 2022 -0700 Merge branch 'make-sfc-siena-ko-specific-to-siena' Martin Habets says: ==================== Make sfc-siena.ko specific to Siena This series is a follow-up to the one titled "Move Siena into a separate subdirectory". It enhances the new sfc-siena.ko module to differentiate it from sfc.ko. Patches Patches 1-5 create separate Kconfig options for Siena, and adjusts the various names used for work items and directories. Patch 6 reinstates SRIOV functionality in sfc-siena.ko. Testing Various build tests were done such as allyesconfig, W=1 and sparse. The new sfc-siena.ko and sfc.ko modules were tested on a machine with NICs for both modules in them. Inserting the updated sfc.ko and the new sfc-siena.ko modules at the same time works, and no work items and directories exist with the same name. ==================== Link: https://lore.kernel.org/r/165228589518.696.7119477411428288875.stgit@palantir17.mph.net Signed-off-by: Jakub Kicinski commit c374303969eac5639bd9230f1c7e7390cb92cc8e Author: Martin Habets Date: Wed May 11 17:20:25 2022 +0100 sfc/siena: Reinstate SRIOV init/fini function calls They were removed in the first series since they were not used for EF10. Put that code back for Siena, with the prototypes in siena_sriov.h since that file is a more applicable place for it. Reported-by: kernel test robot Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit ef9b5770945ddc296a68080ab7a79aedbf0b0151 Author: Martin Habets Date: Wed May 11 17:20:13 2022 +0100 sfc/siena: Make PTP and reset support specific for Siena Change the clock name and work queue names to differentiate them from the names used in sfc.ko. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 58b6b3d5379de9198c091f08e14d82e67629f96e Author: Martin Habets Date: Wed May 11 17:20:01 2022 +0100 sfc/siena: Make MCDI logging support specific for Siena Add a Siena Kconfig option and use it in stead of the sfc one. Rename the internal variable for the 'mcdi_logging_default' module parameter to avoid a naming conflict with the one in sfc.ko. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit f62a074525de47fe748ce74b81b95ea05f97b25c Author: Martin Habets Date: Wed May 11 17:19:49 2022 +0100 siena: Make HWMON support specific for Siena Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit dfb1cfbd497e758de43ee02fbeb1fe66ed1ed26b Author: Martin Habets Date: Wed May 11 17:19:36 2022 +0100 siena: Make SRIOV support specific for Siena Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 65d4b471b3cf635565d0f36294fc47685bf659b1 Author: Martin Habets Date: Wed May 11 17:19:24 2022 +0100 siena: Make MTD support specific for Siena Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 75db72de1f744f8fe1e4eb8da4c305741d02c52f Merge: 879c610c924fe 7e708760fc114 Author: Jakub Kicinski Date: Thu May 12 16:39:21 2022 -0700 Merge branch 'restructure-struct-ocelot_port' Vladimir Oltean says: ==================== Restructure struct ocelot_port This patch set represents preparation for further work. It adds an "index" field to struct ocelot_port, and populates it from the Felix DSA driver and Ocelot switchdev driver. The users of struct ocelot_port :: index are the same users as those of struct ocelot_port_private :: chip_port. ==================== Link: https://lore.kernel.org/r/20220511100637.568950-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 7e708760fc114f049df9dccb994e23d20866b310 Author: Vladimir Oltean Date: Wed May 11 13:06:37 2022 +0300 net: mscc: ocelot: move ocelot_port_private :: chip_port to ocelot_port :: index Currently the ocelot switch lib is unaware of the index of a struct ocelot_port, since that is kept in the encapsulating structures of outer drivers (struct dsa_port :: index, struct ocelot_port_private :: chip_port). With the upcoming increase in complexity associated with assigning DSA tag_8021q CPU ports to certain user ports, it becomes necessary for the switch lib to be able to retrieve the index of a certain ocelot_port. Therefore, introduce a new u8 to ocelot_port (same size as the chip_port used by the ocelot switchdev driver) and rework the existing code to populate and use it. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 6d0be600477089026c76fe529bd96fad4cf69c3b Author: Vladimir Oltean Date: Wed May 11 13:06:36 2022 +0300 net: mscc: ocelot: minimize holes in struct ocelot_port Reorder members of struct ocelot_port to eliminate holes and reduce structure size. Pahole says: Before: struct ocelot_port { struct ocelot * ocelot; /* 0 8 */ struct regmap * target; /* 8 8 */ bool vlan_aware; /* 16 1 */ /* XXX 7 bytes hole, try to pack */ const struct ocelot_bridge_vlan * pvid_vlan; /* 24 8 */ unsigned int ptp_skbs_in_flight; /* 32 4 */ u8 ptp_cmd; /* 36 1 */ /* XXX 3 bytes hole, try to pack */ struct sk_buff_head tx_skbs; /* 40 96 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ u8 ts_id; /* 136 1 */ /* XXX 3 bytes hole, try to pack */ phy_interface_t phy_mode; /* 140 4 */ bool is_dsa_8021q_cpu; /* 144 1 */ bool learn_ena; /* 145 1 */ /* XXX 6 bytes hole, try to pack */ struct net_device * bond; /* 152 8 */ bool lag_tx_active; /* 160 1 */ /* XXX 1 byte hole, try to pack */ u16 mrp_ring_id; /* 162 2 */ /* XXX 4 bytes hole, try to pack */ struct net_device * bridge; /* 168 8 */ int bridge_num; /* 176 4 */ u8 stp_state; /* 180 1 */ /* XXX 3 bytes hole, try to pack */ int speed; /* 184 4 */ /* size: 192, cachelines: 3, members: 18 */ /* sum members: 161, holes: 7, sum holes: 27 */ /* padding: 4 */ }; After: struct ocelot_port { struct ocelot * ocelot; /* 0 8 */ struct regmap * target; /* 8 8 */ struct net_device * bond; /* 16 8 */ struct net_device * bridge; /* 24 8 */ const struct ocelot_bridge_vlan * pvid_vlan; /* 32 8 */ phy_interface_t phy_mode; /* 40 4 */ unsigned int ptp_skbs_in_flight; /* 44 4 */ struct sk_buff_head tx_skbs; /* 48 96 */ /* --- cacheline 2 boundary (128 bytes) was 16 bytes ago --- */ u16 mrp_ring_id; /* 144 2 */ u8 ptp_cmd; /* 146 1 */ u8 ts_id; /* 147 1 */ u8 stp_state; /* 148 1 */ bool vlan_aware; /* 149 1 */ bool is_dsa_8021q_cpu; /* 150 1 */ bool learn_ena; /* 151 1 */ bool lag_tx_active; /* 152 1 */ /* XXX 3 bytes hole, try to pack */ int bridge_num; /* 156 4 */ int speed; /* 160 4 */ /* size: 168, cachelines: 3, members: 18 */ /* sum members: 161, holes: 1, sum holes: 3 */ /* padding: 4 */ /* last cacheline: 40 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 15f6d01e4829cd2a2dc4f02a00c51d7cec1c736d Author: Vladimir Oltean Date: Wed May 11 13:06:35 2022 +0300 net: mscc: ocelot: delete ocelot_port :: xmit_template This is no longer used since commit 7c4bb540e917 ("net: dsa: tag_ocelot: create separate tagger for Seville"). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 879c610c924fef47e27ae926539594a4d080affd Merge: f0a65f815f640 7a29d220f4c07 Author: Jakub Kicinski Date: Thu May 12 16:38:56 2022 -0700 Merge branch 'dsa-changes-for-multiple-cpu-ports-part-1' Vladimir Oltean says: ==================== DSA changes for multiple CPU ports (part 1) I am trying to enable the second internal port pair from the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q". This series represents part 1 (of an unknown number) of that effort. It does some preparation work, like managing host flooding in DSA via a dedicated method, and removing the CPU port as argument from the tagging protocol change procedure. In terms of driver-specific changes, it reworks the 2 tag protocol implementations in the Felix driver to have a structured data format. It enables host flooding towards all tag_8021q CPU ports. It dynamically updates the tag_8021q CPU port used for traps. It also fixes a bug introduced by a previous refactoring/oversimplification commit in net-next. ==================== Link: https://lore.kernel.org/r/20220511095020.562461-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 7a29d220f4c0745a6d435dbd53c659fbde4998b6 Author: Vladimir Oltean Date: Wed May 11 12:50:20 2022 +0300 net: dsa: felix: reimplement tagging protocol change with function pointers The error handling for the current tagging protocol change procedure is a bit brittle (we dismantle the previous tagging protocol entirely before setting up the new one). By identifying which parts of a tagging protocol are unique to itself and which parts are shared with the other, we can implement a protocol change procedure where error handling is a bit more robust, because we start setting up the new protocol first, and tear down the old one only after the setup of the specific and shared parts succeeded. The protocol change is a bit too open-coded too, in the area of migrating host flood settings and MDBs. By identifying what differs between tagging protocols (the forwarding masks for host flooding) we can implement a more straightforward migration procedure which is handled in the shared portion of the protocol change, rather than individually by each protocol. Therefore, a more structured approach calls for the introduction of a structure of function pointers per tagging protocol. This covers setup, teardown and the host forwarding mask. In the future it will also cover how to prepare for a new DSA master. The initial tagging protocol setup (at driver probe time) and the final teardown (at driver removal time) are also adapted to call into the structured methods of the specific protocol in current use. This is especially relevant for teardown, where we previously called felix_del_tag_protocol() only for the first CPU port. But by not specifying which CPU port this is for, we gain more flexibility to support multiple CPU ports in the future. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit c352e5e8e8f2888c99ee164632af365157da2a41 Author: Vladimir Oltean Date: Wed May 11 12:50:19 2022 +0300 net: dsa: felix: dynamically determine tag_8021q CPU port for traps Ocelot switches support a single active CPU port at a time (at least as a trapping destination, i.e. for control traffic). This is true regardless of whether we are using the native copy-to-CPU-port-module functionality, or a redirect action towards the software-defined tag_8021q CPU port. Currently we assume that the trapping destination in tag_8021q mode is the first CPU port, yet in the future we may want to migrate the user ports to the second CPU port. For that to work, we need to make sure that the tag_8021q trapping destination is a CPU port that is active, i.e. is used by at least some user port on which the trap was added. Otherwise, we may end up redirecting the traffic to a CPU port which isn't even up. Note that due to the current design where we simply choose the CPU port of the first port from the trap's ingress port mask, it may be that a CPU port absorbes control traffic from user ports which aren't affine to it as per user space's request. This isn't ideal, but is the lesser of two evils. Following the user-configured affinity for traps would mean that we can no longer reuse a single TCAM entry for multiple traps, which is what we actually do for e.g. PTP. Either we duplicate and deduplicate TCAM entries on the fly when user-to-CPU-port mappings change (which is unnecessarily complicated), or we redirect trapped traffic to all tag_8021q CPU ports if multiple such ports are in use. The latter would have actually been nice, if it actually worked, but it doesn't, since a OCELOT_MASK_MODE_REDIRECT action towards multiple ports would not take PGID_SRC into consideration, and it would just duplicate the packet towards each (CPU) port, leading to duplicates in software. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit bacf93b0561937695e9c6c1dc1d8ed10ca80eb81 Author: Vladimir Oltean Date: Wed May 11 12:50:18 2022 +0300 net: dsa: remove port argument from ->change_tag_protocol() DSA has not supported (and probably will not support in the future either) independent tagging protocols per CPU port. Different switch drivers have different requirements, some may need to replicate some settings for each CPU port, some may need to apply some settings on a single CPU port, while some may have to configure some global settings and then some per-CPU-port settings. In any case, the current model where DSA calls ->change_tag_protocol for each CPU port turns out to be impractical for drivers where there are global things to be done. For example, felix calls dsa_tag_8021q_register(), which makes no sense per CPU port, so it suppresses the second call. Let drivers deal with replication towards all CPU ports, and remove the CPU port argument from the function prototype. Signed-off-by: Vladimir Oltean Acked-by: Luiz Angelo Daros de Luca Signed-off-by: Jakub Kicinski commit 72c3b0c7359a6f91dd03e08b839adccd9d4268a8 Author: Vladimir Oltean Date: Wed May 11 12:50:17 2022 +0300 net: dsa: felix: manage host flooding using a specific driver callback At the time - commit 7569459a52c9 ("net: dsa: manage flooding on the CPU ports") - not introducing a dedicated switch callback for host flooding made sense, because for the only user, the felix driver, there was nothing different to do for the CPU port than set the flood flags on the CPU port just like on any other bridge port. There are 2 reasons why this approach is not good enough, however. (1) Other drivers, like sja1105, support configuring flooding as a function of {ingress port, egress port}, whereas the DSA ->port_bridge_flags() function only operates on an egress port. So with that driver we'd have useless host flooding from user ports which don't need it. (2) Even with the felix driver, support for multiple CPU ports makes it difficult to piggyback on ->port_bridge_flags(). The way in which the felix driver is going to support host-filtered addresses with multiple CPU ports is that it will direct these addresses towards both CPU ports (in a sort of multicast fashion), then restrict the forwarding to only one of the two using the forwarding masks. Consequently, flooding will also be enabled towards both CPU ports. However, ->port_bridge_flags() gets passed the index of a single CPU port, and that leaves the flood settings out of sync between the 2 CPU ports. This is to say, it's better to have a specific driver method for host flooding, which takes the user port as argument. This solves problem (1) by allowing the driver to do different things for different user ports, and problem (2) by abstracting the operation and letting the driver do whatever, rather than explicitly making the DSA core point to the CPU port it thinks needs to be touched. This new method also creates a problem, which is that cross-chip setups are not handled. However I don't have hardware right now where I can test what is the proper thing to do, and there isn't hardware compatible with multi-switch trees that supports host flooding. So it remains a problem to be tackled in the future. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 465c3de42b5dcdf0fa8cf996a81de6ba0e8553a3 Author: Vladimir Oltean Date: Wed May 11 12:50:16 2022 +0300 net: dsa: introduce the dsa_cpu_ports() helper Similar to dsa_user_ports() which retrieves a port mask of all user ports, introduce dsa_cpu_ports() which retrieves the mask of all CPU ports of a switch. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 910ee6cce92fc0d0c459967ac95902d7bf3e41bf Author: Vladimir Oltean Date: Wed May 11 12:50:15 2022 +0300 net: dsa: felix: bring the NPI port indirection for host flooding to surface For symmetry with host FDBs and MDBs where the indirection is now handled outside the ocelot switch lib, do the same for bridge port flags (unicast/multicast/broadcast flooding). The only caller of the ocelot switch lib which uses the NPI port is the Felix DSA driver. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 0ddf83cda5a6e1a7148ddef46b1c2e21d5be7515 Author: Vladimir Oltean Date: Wed May 11 12:50:14 2022 +0300 net: dsa: felix: bring the NPI port indirection for host MDBs to surface For symmetry with host FDBs where the indirection is now handled outside the ocelot switch lib, do the same for host MDB entries. The only caller of the ocelot switch lib which uses the NPI port is the Felix DSA driver. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit e9b3ba439dcb975474accbae1a37b99f9df59bed Author: Vladimir Oltean Date: Wed May 11 12:50:13 2022 +0300 net: dsa: felix: program host FDB entries towards PGID_CPU for tag_8021q too I remembered why we had the host FDB migration procedure in place. It is true that host FDB entry migration can be done by changing the value of PGID_CPU, but the problem is that only host FDB entries learned while operating in NPI mode go to PGID_CPU. When the CPU port operates in tag_8021q mode, the FDB entries are learned towards the unicast PGID equal to the physical port number of this CPU port, bypassing the PGID_CPU indirection. So host FDB entries learned in tag_8021q mode are not migrated any longer towards the NPI port. Fix this by extracting the NPI port -> PGID_CPU redirection from the ocelot switch lib, moving it to the Felix DSA driver, and applying it for any CPU port regardless of its kind (NPI or tag_8021q). Fixes: a51c1c3f3218 ("net: dsa: felix: stop migrating FDBs back and forth on tag proto change") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit f0a65f815f640499990d446d4f5d9090634fdf27 Author: Horatiu Vultur Date: Wed May 11 22:40:59 2022 +0200 net: lan966x: Fix use of pointer after being freed The smatch found the following warning: drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c:736 lan966x_fdma_reload() warn: 'rx_dcbs' was already freed. This issue can happen when changing the MTU on one of the ports and once the RX buffers are allocated and then the TX buffer allocation fails. In that case the RX buffers should not be restore. This fix this issue such that the RX buffers will not be restored if the TX buffers failed to be allocated. Fixes: 2ea1cbac267e2a ("net: lan966x: Update FDMA to change MTU.") Reported-by: Dan Carpenter Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220511204059.2689199-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit fa926bb3e491221a76bd476a990019cd55df8a30 Author: Jakub Kicinski Date: Wed May 11 12:07:20 2022 -0700 net: update the register_netdevice() kdoc The BUGS section looks quite dated, the registration is under rtnl lock. Remove some obvious information while at it. Link: https://lore.kernel.org/r/20220511190720.1401356-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 0df65743537dd6e1c8b0924714f14dc367cba2be Author: Jakub Kicinski Date: Wed May 11 10:23:05 2022 -0700 skbuff: replace a BUG_ON() with the new DEBUG_NET_WARN_ON_ONCE() Very few drivers actually have Kconfig knobs for adding -DDEBUG. 8 according to a quick grep, while there are 93 users of skb_checksum_none_assert(). Switch to the new DEBUG_NET_WARN_ON_ONCE() to catch bad skbs. Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220511172305.1382810-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit f4826443f4d69d2c97c184952c085caf0936a7b8 Author: David Thompson Date: Wed May 11 09:52:51 2022 -0400 mlxbf_gige: remove driver-managed interrupt counts The driver currently has three interrupt counters, which are incremented every time each interrupt handler executes. These driver-managed counters are not necessary as the kernel already has logic that manages interrupt counts and exposes them via /proc/interrupts. This patch removes the driver-managed counters. Signed-off-by: David Thompson Signed-off-by: Asmaa Mnebhi Link: https://lore.kernel.org/r/20220511135251.2989-1-davthompson@nvidia.com Signed-off-by: Jakub Kicinski commit 9b19e57a3c78f1f7c08a48bafb7d84caf6e80b68 Merge: b33177f1d62be f3f19f939c119 Author: Jakub Kicinski Date: Thu May 12 15:39:02 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Build issue in drivers/net/ethernet/sfc/ptp.c 54fccfdd7c66 ("sfc: efx_default_channel_type APIs can be static") 49e6123c65da ("net: sfc: fix memory leak due to ptp channel") https://lore.kernel.org/all/20220510130556.52598fe2@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit c46d541a00e04027359f75d3645b4110a898daa5 Merge: 891163adf180b 02ee2316b9356 Author: Mimi Zohar Date: Thu May 12 18:42:08 2022 -0400 Merge branch 'next-integrity.fsverity-v9' into next-integrity Support for including fs-verity file digests and signatures in the IMA measurement list as well as verifying the fs-verity file digest based signatures. Signed-off-by: Mimi Zohar commit 02ee2316b93569a26a0f9ccc8679c1066ea76047 Author: Mimi Zohar Date: Thu Dec 2 13:13:51 2021 -0500 fsverity: update the documentation Update the fsverity documentation related to IMA signature support. Acked-by: Stefan Berger Acked-by: Eric Biggers Signed-off-by: Mimi Zohar commit 95b00f68209e2bc9f2ee9126afcebab451e0e9d8 Author: Parshuram Thombare Date: Mon Oct 25 05:31:15 2021 -0700 PCI: cadence: Clear FLR in device capabilities register Clear FLR (Function Level Reset) from device capabilities registers for all physical functions. During FLR, the Margining Lane Status and Margining Lane Control registers should not be reset, as per PCIe specification. However, the controller incorrectly resets these registers upon FLR. This causes PCISIG compliance FLR test to fail. Hence preventing all functions from advertising FLR support if flag quirk_disable_flr is set. Link: https://lore.kernel.org/r/1635165075-89864-1-git-send-email-pthombar@cadence.com Signed-off-by: Parshuram Thombare Signed-off-by: Lorenzo Pieralisi commit 4329490a78b66ae44a9c93e433da375284162e3d Author: Al Viro Date: Wed May 11 20:30:20 2022 -0400 io_uring_enter(): don't leave f.flags uninitialized simplifies logics on cleanup, as well... Reviewed-by: Jens Axboe Signed-off-by: Al Viro commit a1f67bc131c3935f325513cd153249fdbc22ac5b Author: Christian Gmeiner Date: Thu May 12 07:55:38 2022 +0200 PCI: cadence: Allow PTM Responder to be enabled This enables the Controller [RP] to automatically respond with Response/ResponseD messages if CDNS_PCIE_LM_TPM_CTRL_PTMRSEN and PCI_PTM_CTRL_ENABLE bits are both set. Link: https://lore.kernel.org/r/20220512055539.1782437-1-christian.gmeiner@gmail.com Signed-off-by: Christian Gmeiner Signed-off-by: Lorenzo Pieralisi commit c58d7c55de8bf7afd25d13d6eb8ef68782a51be9 Author: Jaegeuk Kim Date: Fri May 6 14:23:27 2022 -0700 f2fs: keep wait_ms if EAGAIN happens In f2fs_gc thread, let's keep wait_ms when sec_freed was zero. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d147ea4adb969b03f7f1c7613cc6f44b70760eb3 Author: Jaegeuk Kim Date: Fri May 6 11:40:33 2022 -0700 f2fs: introduce f2fs_gc_control to consolidate f2fs_gc parameters No functional change. - remove checkpoint=disable check for f2fs_write_checkpoint - get sec_freed all the time Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1d1a0e7c5100d332583e20b40aa8c0a8ed3d7849 Author: Josh Poimboeuf Date: Thu May 12 12:05:27 2022 -0700 scripts/faddr2line: Fix overlapping text section failures There have been some recent reports of faddr2line failures: $ scripts/faddr2line sound/soundcore.ko sound_devnode+0x5/0x35 bad symbol size: base: 0x0000000000000000 end: 0x0000000000000000 $ ./scripts/faddr2line vmlinux.o enter_from_user_mode+0x24 bad symbol size: base: 0x0000000000005fe0 end: 0x0000000000005fe0 The problem is that faddr2line is based on 'nm', which has a major limitation: it doesn't know how to distinguish between different text sections. So if an offset exists in multiple text sections in the object, it may fail. Rewrite faddr2line to be section-aware, by basing it on readelf. Fixes: 67326666e2d4 ("scripts: add script for translating stack dump function offsets") Reported-by: Kaiwan N Billimoria Reported-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/29ff99f86e3da965b6e46c1cc2d72ce6528c17c3.1652382321.git.jpoimboe@kernel.org commit 7390b94a3c2d93272d6da4945b81a9cf78055b7b Author: Masahiro Yamada Date: Thu May 5 12:52:12 2022 +0900 module: merge check_exported_symbol() into find_exported_symbol_in_section() Now check_exported_symbol() always succeeds. Merge it into find_exported_symbol_in_search() to make the code concise. Signed-off-by: Masahiro Yamada Signed-off-by: Luis Chamberlain commit cdd66eb52fdaa9bdab7f1be8dc9162bf4acc64ae Author: Masahiro Yamada Date: Thu May 5 12:52:11 2022 +0900 module: do not binary-search in __ksymtab_gpl if fsa->gplok is false Currently, !fsa->gplok && syms->license == GPL_ONLY) is checked after bsearch() succeeds. It is meaningless to do the binary search in the GPL symbol table when fsa->gplok is false because we know find_exported_symbol_in_section() will fail anyway. This check should be done before bsearch(). Signed-off-by: Masahiro Yamada Signed-off-by: Luis Chamberlain commit c6eee9df57a6d9252bae93a9386d0d872798f5d5 Author: Masahiro Yamada Date: Thu May 5 12:52:10 2022 +0900 module: do not pass opaque pointer for symbol search There is no need to use an opaque pointer for check_exported_symbol() or find_exported_symbol_in_section. Pass (struct find_symbol_arg *) explicitly. Signed-off-by: Masahiro Yamada Signed-off-by: Luis Chamberlain commit 8eac910a49347821cbafc770a319e00ccd69d58b Author: Lecopzer Chen Date: Wed Apr 27 15:36:06 2022 +0800 module: show disallowed symbol name for inherit_taint() The error log for inherit_taint() doesn't really help to find the symbol which violates GPL rules. For example, if a module has 300 symbol and includes 50 disallowed symbols, the log only shows the content below and we have no idea what symbol is. AAA: module using GPL-only symbols uses symbols from proprietary module BBB. It's hard for user who doesn't really know how the symbol was parsing. This patch add symbol name to tell the offending symbols explicitly. AAA: module using GPL-only symbols uses symbols SSS from proprietary module BBB. Signed-off-by: Lecopzer Chen Signed-off-by: Luis Chamberlain commit 391e982bfa632b8315235d8be9c0a81374c6a19c Author: Alexey Dobriyan Date: Wed May 4 12:54:20 2022 +0300 module: fix [e_shstrndx].sh_size=0 OOB access It is trivial to craft a module to trigger OOB access in this line: if (info->secstrings[strhdr->sh_size - 1] != '\0') { BUG: unable to handle page fault for address: ffffc90000aa0fff PGD 100000067 P4D 100000067 PUD 100066067 PMD 10436f067 PTE 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 7 PID: 1215 Comm: insmod Not tainted 5.18.0-rc5-00007-g9bf578647087-dirty #10 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-4.fc34 04/01/2014 RIP: 0010:load_module+0x19b/0x2391 Fixes: ec2a29593c83 ("module: harden ELF info handling") Signed-off-by: Alexey Dobriyan [rebased patch onto modules-next] Signed-off-by: Luis Chamberlain commit 99bd9956551b27cb6f5b445abaced7e13b9976cd Author: Aaron Tomlin Date: Mon May 2 21:52:52 2022 +0100 module: Introduce module unload taint tracking Currently, only the initial module that tainted the kernel is recorded e.g. when an out-of-tree module is loaded. The purpose of this patch is to allow the kernel to maintain a record of each unloaded module that taints the kernel. So, in addition to displaying a list of linked modules (see print_modules()) e.g. in the event of a detected bad page, unloaded modules that carried a taint/or taints are displayed too. A tainted module unload count is maintained. The number of tracked modules is not fixed. This feature is disabled by default. Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 6fb0538d0121ffab770a505b183968d93466ad59 Author: Aaron Tomlin Date: Mon May 2 21:51:04 2022 +0100 module: Move module_assert_mutex_or_preempt() to internal.h No functional change. This patch migrates module_assert_mutex_or_preempt() to internal.h. So, the aforementiond function can be used outside of main/or core module code yet will remain restricted for internal use only. Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit c14e522bc76efed6e947cd0ab83a1fac7a7a3ec9 Author: Aaron Tomlin Date: Mon May 2 21:51:03 2022 +0100 module: Make module_flags_taint() accept a module's taints bitmap and usable outside core code No functional change. The purpose of this patch is to modify module_flags_taint() to accept a module's taints bitmap as a parameter and modifies all users accordingly. Furthermore, it is now possible to access a given module's taint flags data outside of non-essential code yet does remain for internal use only. This is in preparation for module unload taint tracking support. Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 80140a81f7f833998d732102eea0fea230b88067 Author: Greg Kroah-Hartman Date: Wed Apr 27 11:03:21 2022 +0200 module.h: simplify MODULE_IMPORT_NS In commit ca321ec74322 ("module.h: allow #define strings to work with MODULE_IMPORT_NS") I fixed up the MODULE_IMPORT_NS() macro to allow defined strings to work with it. Unfortunatly I did it in a two-stage process, when it could just be done with the __stringify() macro as pointed out by Masahiro Yamada. Clean this up to only be one macro instead of two steps to achieve the same end result. Fixes: ca321ec74322 ("module.h: allow #define strings to work with MODULE_IMPORT_NS") Reported-by: Masahiro Yamada Cc: Luis Chamberlain Cc: Jessica Yu Cc: Matthias Maennich Signed-off-by: Greg Kroah-Hartman Signed-off-by: Luis Chamberlain commit 813c980294d48362ead5422b056072ed214ca2bf Author: Wenpeng Liang Date: Thu May 12 16:00:12 2022 +0800 RDMA/hns: Use hr_reg_read() instead of remaining roce_get_xxx() To reduce the code size and make the code clearer, replace all roce_get_xxx() with hr_reg_read() to read the data fields. Link: https://lore.kernel.org/r/20220512080012.38728-3-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 82600b2d3cd57428bdb03c66ae67708d3c8f7281 Author: Wenpeng Liang Date: Thu May 12 16:00:11 2022 +0800 RDMA/hns: Use hr_reg_xxx() instead of remaining roce_set_xxx() To reduce the code size and make the code clearer, replace all roce_set_xxx() with hr_reg_xxx() to write the data fields. Link: https://lore.kernel.org/r/20220512080012.38728-2-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 9660209d9418f2295d31fea0d32e313e9b2c1200 Author: Daniel Latypov Date: Tue Mar 29 14:42:48 2022 -0700 kunit: tool: print clearer error message when there's no TAP output Before: $ ./tools/testing/kunit/kunit.py parse /dev/null ... [ERROR] Test : invalid KTAP input! After: $ ./tools/testing/kunit/kunit.py parse /dev/null ... [ERROR] Test : could not find any KTAP output! This error message gets printed out when extract_tap_output() yielded no lines. So while it could be because of malformed KTAP output from KUnit, it could also be due to not having any KTAP output at all. Try and make the error message here more clear. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 3f0a50f345f78183f6e9b39c2f45ca5dcaa511ca Author: Daniel Latypov Date: Thu May 12 07:25:55 2022 -0700 kunit: tool: stop using a shell to run kernel under QEMU Note: this potentially breaks custom qemu_configs if people are using them! But the fix for them is simple, don't specify multiple arguments in one string and don't add on a redundant ''. It feels a bit iffy to be using a shell in the first place. There's the usual shenanigans where people could pass in arbitrary shell commands via --kernel_arg (since we're just adding '' around the kernel_cmdline) or via a custom qemu_config. This isn't too much of a concern given the nature of this script (and the qemu_config file is in python, you can do w/e you want already). But it does have some other drawbacks. One example of a kunit-specific pain point: If the relevant qemu binary is missing, we get output like this: > /bin/sh: line 1: qemu-system-aarch64: command not found This in turn results in our KTAP parser complaining about missing/invalid KTAP, but we don't directly show the error! It's even more annoying to debug when you consider --raw_output only shows KUnit output by default, i.e. you need --raw_output=all to see it. Whereas directly invoking the binary, Python will raise a FileNotFoundError for us, which is a noisier but more clear. Making this change requires * splitting parameters like ['-m 256'] into ['-m', '256'] in kunit/qemu_configs/*.py * change [''] to [] in kunit/qemu_configs/*.py since otherwise QEMU fails w/ 'Device needs media, but drive is empty' * dropping explicit quoting of the kernel cmdline * using shlex.quote() when we print what command we're running so the user can copy-paste and run it Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit c249764320cba8ab42821b0c7dad75f117c853e4 Author: Daniel Latypov Date: Fri Apr 8 14:51:05 2022 -0700 kunit: tool: update test counts summary line format Before: > Testing complete. Passed: 137, Failed: 0, Crashed: 0, Skipped: 36, Errors: 0 After: > Testing complete. Ran 173 tests: passed: 137, skipped: 36 Even with our current set of statuses, the output is a bit verbose. It could get worse in the future if we add more (e.g. timeout, kasan). Let's only print the relevant ones. I had previously been sympathetic to the argument that always printing out all the statuses would make it easier to parse results. But now we have commit acd8e8407b8f ("kunit: Print test statistics on failure"), there are test counts printed out in the raw output. We don't currently print out an overall total across all suites, but it would be easy to add, if we see a need for that. Signed-off-by: Daniel Latypov Co-developed-by: David Gow Signed-off-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit a02353f491622e49c7ddedc6a6dc4f1d6ed2150a Author: Daniel Latypov Date: Wed May 11 14:16:26 2022 -0700 kunit: bail out of test filtering logic quicker if OOM When filtering what tests to run (suites and/or cases) via kunit.filter_glob (e.g. kunit.py run ), we allocate copies of suites. These allocations can fail, and we largely don't handle that. Note: realistically, this probably doesn't matter much. We're not allocating much memory and this happens early in boot, so if we can't do that, then there's likely far bigger problems. This patch makes us immediately bail out from the top-level function (kunit_filter_suites) with -ENOMEM if any of the underlying kmalloc() calls return NULL. Implementation note: we used to return NULL pointers from some functions to indicate either that all suites/tests were filtered out or there was an error allocating the new array. We'll log a short error in this case and not run any tests or print a TAP header. From a kunit.py user's perspective, they'll get a message about missing/invalid TAP output and have to dig into the test.log to see it. Since hitting this error seems so unlikely, it's probably fine to not invent a way to plumb this error message more visibly. See also: https://lore.kernel.org/linux-kselftest/20220329103919.2376818-1-lv.ruyi@zte.com.cn/ Signed-off-by: Daniel Latypov Reported-by: Zeal Robot Reported-by: Lv Ruyi Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit dcbb2ee24601fabbb547fb0c747ca98b876fe5df Author: Daniel Latypov Date: Tue Apr 5 12:06:19 2022 -0700 lib/Kconfig.debug: change KUnit tests to default to KUNIT_ALL_TESTS This is in line with Documentation/dev-tools/kunit/style.rst. Some of these tests predate that so they don't follow this convention. With this and commit b0841b51cac9 ("kunit: arch/um/configs: Enable KUNIT_ALL_TESTS by default"), kunit.py will now run these tests by default. This hopefully makes it easier to run and maintain the tests. If any of these were to start failing, people would notice much quicker. Note: this commit doesn't update LINEAR_RANGES_TEST since that would select its dependency (LINEAR_RANGES). We don't want KUNIT_ALL_TESTS to enable anything other than test kconfigs. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Nico Pache Acked-by: Nico Pache Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit ad69172ec930075d25e14220841dd96375088d28 Author: David Gow Date: Sat Apr 2 12:35:30 2022 +0800 kunit: Rework kunit_resource allocation policy KUnit's test-managed resources can be created in two ways: - Using the kunit_add_resource() family of functions, which accept a struct kunit_resource pointer, typically allocated statically or on the stack during the test. - Using the kunit_alloc_resource() family of functions, which allocate a struct kunit_resource using kzalloc() behind the scenes. Both of these families of functions accept a 'free' function to be called when the resource is finally disposed of. At present, KUnit will kfree() the resource if this 'free' function is specified, and will not if it is NULL. However, this can lead kunit_alloc_resource() to leak memory (if no 'free' function is passed in), or kunit_add_resource() to incorrectly kfree() memory which was allocated by some other means (on the stack, as part of a larger allocation, etc), if a 'free' function is provided. Instead, always kfree() if the resource was allocated with kunit_alloc_resource(), and never kfree() if it was passed into kunit_add_resource() by the user. (If the user of kunit_add_resource() wishes the resource be kfree()ed, they can call kfree() on the resource from within the 'free' function. This is implemented by adding a 'should_free' member to struct kunit_resource and setting it appropriately. To facilitate this, the various resource add/alloc functions have been refactored somewhat, making them all call a __kunit_add_resource() helper after setting the 'should_free' member appropriately. In the process, all other functions have been made static inline functions. Signed-off-by: David Gow Tested-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 64e3ed0b8ea019597d0b5448fdf05a29eb65ae95 Author: Eric Biggers Date: Sat Apr 30 22:08:52 2022 -0700 f2fs: reject test_dummy_encryption when !CONFIG_FS_ENCRYPTION There is no good reason to allow this mount option when the kernel isn't configured with encryption support. Since this option is only for testing, we can just fix this; we don't really need to worry about breaking anyone who might be counting on this option being ignored. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim commit 7bc155fec5b371dbb57256e84a49c78692a09060 Author: Jaegeuk Kim Date: Thu May 5 17:49:18 2022 -0700 f2fs: kill volatile write support There's no user, since all can use atomic writes simply. Let's kill it. Signed-off-by: Jaegeuk Kim commit 3db1de0e582c358dd013f3703cd55b5fe4076436 Author: Daeho Jeong Date: Thu Apr 28 11:18:09 2022 -0700 f2fs: change the current atomic write way Current atomic write has three major issues like below. - keeps the updates in non-reclaimable memory space and they are even hard to be migrated, which is not good for contiguous memory allocation. - disk spaces used for atomic files cannot be garbage collected, so this makes it difficult for the filesystem to be defragmented. - If atomic write operations hit the threshold of either memory usage or garbage collection failure count, All the atomic write operations will fail immediately. To resolve the issues, I will keep a COW inode internally for all the updates to be flushed from memory, when we need to flush them out in a situation like high memory pressure. These COW inodes will be tagged as orphan inodes to be reclaimed in case of sudden power-cut or system failure during atomic writes. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 6213f5d4d23c50d393a31dc8e351e63a1fd10dbe Author: Jaegeuk Kim Date: Thu May 5 17:40:25 2022 -0700 f2fs: don't need inode lock for system hidden quota Let's avoid false-alarmed lockdep warning. [ 58.914674] [T1501146] -> #2 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}: [ 58.915975] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.916738] [T1501146] system_server: f2fs_quota_sync+0x60/0x1a8 [ 58.917563] [T1501146] system_server: block_operations+0x16c/0x43c [ 58.918410] [T1501146] system_server: f2fs_write_checkpoint+0x114/0x318 [ 58.919312] [T1501146] system_server: f2fs_issue_checkpoint+0x178/0x21c [ 58.920214] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.920999] [T1501146] system_server: f2fs_do_sync_file+0x334/0x738 [ 58.921862] [T1501146] system_server: f2fs_sync_file+0x30/0x48 [ 58.922667] [T1501146] system_server: __arm64_sys_fsync+0x84/0xf8 [ 58.923506] [T1501146] system_server: el0_svc_common.llvm.12821150825140585682+0xd8/0x20c [ 58.924604] [T1501146] system_server: do_el0_svc+0x28/0xa0 [ 58.925366] [T1501146] system_server: el0_svc+0x24/0x38 [ 58.926094] [T1501146] system_server: el0_sync_handler+0x88/0xec [ 58.926920] [T1501146] system_server: el0_sync+0x1b4/0x1c0 [ 58.927681] [T1501146] -> #1 (&sbi->cp_global_sem){+.+.}-{3:3}: [ 58.928889] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.929650] [T1501146] system_server: f2fs_write_checkpoint+0xbc/0x318 [ 58.930541] [T1501146] system_server: f2fs_issue_checkpoint+0x178/0x21c [ 58.931443] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.932226] [T1501146] system_server: sync_filesystem+0xac/0x130 [ 58.933053] [T1501146] system_server: generic_shutdown_super+0x38/0x150 [ 58.933958] [T1501146] system_server: kill_block_super+0x24/0x58 [ 58.934791] [T1501146] system_server: kill_f2fs_super+0xcc/0x124 [ 58.935618] [T1501146] system_server: deactivate_locked_super+0x90/0x120 [ 58.936529] [T1501146] system_server: deactivate_super+0x74/0xac [ 58.937356] [T1501146] system_server: cleanup_mnt+0x128/0x168 [ 58.938150] [T1501146] system_server: __cleanup_mnt+0x18/0x28 [ 58.938944] [T1501146] system_server: task_work_run+0xb8/0x14c [ 58.939749] [T1501146] system_server: do_notify_resume+0x114/0x1e8 [ 58.940595] [T1501146] system_server: work_pending+0xc/0x5f0 [ 58.941375] [T1501146] -> #0 (&sbi->gc_lock){+.+.}-{3:3}: [ 58.942519] [T1501146] system_server: __lock_acquire+0x1270/0x2868 [ 58.943366] [T1501146] system_server: lock_acquire+0x114/0x294 [ 58.944169] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.944930] [T1501146] system_server: f2fs_issue_checkpoint+0x13c/0x21c [ 58.945831] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.946614] [T1501146] system_server: f2fs_do_sync_file+0x334/0x738 [ 58.947472] [T1501146] system_server: f2fs_ioc_commit_atomic_write+0xc8/0x14c [ 58.948439] [T1501146] system_server: __f2fs_ioctl+0x674/0x154c [ 58.949253] [T1501146] system_server: f2fs_ioctl+0x54/0x88 [ 58.950018] [T1501146] system_server: __arm64_sys_ioctl+0xa8/0x110 [ 58.950865] [T1501146] system_server: el0_svc_common.llvm.12821150825140585682+0xd8/0x20c [ 58.951965] [T1501146] system_server: do_el0_svc+0x28/0xa0 [ 58.952727] [T1501146] system_server: el0_svc+0x24/0x38 [ 58.953454] [T1501146] system_server: el0_sync_handler+0x88/0xec [ 58.954279] [T1501146] system_server: el0_sync+0x1b4/0x1c0 Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim commit 54de76c0123915e7533ce352de30a1f2d80fe81f Author: Phil Auld Date: Thu May 12 10:34:39 2022 -0400 kselftest/cgroup: fix test_stress.sh to use OUTPUT dir Running cgroup kselftest with O= fails to run the with_stress test due to hardcoded ./test_core. Find test_core binary using the OUTPUT directory. Fixes: 1a99fcc035fb ("selftests: cgroup: Run test_core under interfering stress") Signed-off-by: Phil Auld Signed-off-by: Tejun Heo commit 21e350233b07619dbfc3ce606ff1fc468fce2d82 Author: Josh Poimboeuf Date: Thu Apr 21 14:56:55 2022 -0700 scripts: Create objdump-func helper script Add a simple script which disassembles a single function from an object file. Comes in handy for objtool warnings and kernel stack traces. Originally-by: Peter Zijlstra Acked-by: Borislav Petkov Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/3eb3f091fd6bd9caba50392ceab98ce756804f3b.1650578171.git.jpoimboe@redhat.com commit 74f55a62c4c354f43a6d75f77dd184c4f57b9a26 Author: Mathias Nyman Date: Thu May 12 01:04:50 2022 +0300 xhci: Allow host runtime PM as default for Intel Alder Lake N xHCI Alder Lake N TCSS xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3 and thus save energy Cc: stable@kernel.org Suggested-by: Gopal Vamshi Krishna Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-10-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 15ad5b615f7078290b97b64750ee37e4a9ddd4f6 Author: Mathias Nyman Date: Thu May 12 01:04:49 2022 +0300 xhci: Remove quirk for over 10 year old evaluation hardware The XHCI_RESET_EP_QUIRK was added in 2009 to support prototype xHC hardware from Fresco Logic that needed an additional configure endpoint command after a reset endpoint. That hardware should not have made it to the market. Now, 13 years later its about time we get rid of it. quirk was added in commit ac9d8fe7c6a8 ("USB: xhci: Add quirk for Fresco Logic xHCI hardware.") Print a debug message about the removed quirk if against all odds we run into this controller. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-9-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 424140d31ba1c613e7a087caf87723d0273f4dae Author: Mathias Nyman Date: Thu May 12 01:04:48 2022 +0300 xhci: prevent U2 link power state if Intel tier policy prevented U1 Don't enable U1 or U2 Link powermanagenet (LPM) states for USB3 devices connected to tier 2 or further hubs. For unknown reasons we previously only prevented U1. Be consistent, and prevent both U1/U2 states if tier policy doesn't allow LPM. Also check the tier policy a bit earlier, and return if U1/U2 is not allowed. This avoids unnecessary xhci MEL commands. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-8-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 25355e046d295bc15bb0d235eff019da67e245d3 Author: Mathias Nyman Date: Thu May 12 01:04:47 2022 +0300 xhci: use generic command timer for stop endpoint commands. The 'stop endpoint' command timer was started when a 'stop endpoint' command was added to the command queue. This can trigger unwanted timeouts if there are several pending commands in the queue that xHC needs to handle first. The generic command timer, which was added later than the 'stop endpoint' timeout timer, times each command currently being handled by xHC hardware. A timed out stop endpoint command was treated as a more severe issue than other failed commands, so the separate stop endpoint timer was left unchanged. Use the generic command timer for stop endpoint commands. Identify if the timed out command was a stop endpoint command in the generic handler, and treat it with the same severity as earlier. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4736ebd7fcaff1eb8481c140ba494962847d6e0a Author: Heiner Kallweit Date: Thu May 12 01:04:46 2022 +0300 usb: host: xhci-plat: omit shared hcd if either root hub has no ports Activate the just added extension for xhci-plat and omit the shared hcd if either of the root hubs has no ports. Signed-off-by: Heiner Kallweit Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e0fe986972f5b6b12086c73569206dd29c520be9 Author: Heiner Kallweit Date: Thu May 12 01:04:45 2022 +0300 usb: host: xhci-plat: prepare operation w/o shared hcd This patch prepares xhci-plat for the following scenario - If either of the root hubs has no ports, then omit shared hcd - Main hcd can be USB3 if there are no USB2 ports Signed-off-by: Heiner Kallweit Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0cf1ea040a7e2cae4776216d16d33d3898ea58de Author: Heiner Kallweit Date: Thu May 12 01:04:44 2022 +0300 usb: host: xhci-plat: create shared hcd after having added main hcd This patch is in preparation of an extension where in case of a root hub with no ports no shared hcd will be created. Whether one of the root hubs has no ports we figure our in usb_add_hcd() for the primary hcd. Therefore create the shared hcd only after this call. Signed-off-by: Heiner Kallweit Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 873f323618c202cd0675324a1027dcecc7745d0b Author: Heiner Kallweit Date: Thu May 12 01:04:43 2022 +0300 xhci: prepare for operation w/o shared hcd This patch prepares xhci for the following scenario: - If either of the root hubs has no ports, then omit shared hcd - Main hcd can be USB3 if there are no USB2 ports Signed-off-by: Heiner Kallweit Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 57f23cd0bf2f56d339f810a913a9c0c5abfcfc7e Author: Heiner Kallweit Date: Thu May 12 01:04:42 2022 +0300 xhci: factor out parts of xhci_gen_setup() Factoring out parts of xhci_gen_setup() has two motivations: - When adding functionaliy to omit shared hcd if not needed in a subsequent patch, we'll have to call xhci_hcd_init_usb3_data() from two places. - It reduces size of xhci_gen_setup() and makes it better readable. Signed-off-by: Heiner Kallweit Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220511220450.85367-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 93c0651617a62a69717299f1464dda798af8bebb Merge: d26eee72d9b90 a35707c3d850d Author: Palmer Dabbelt Date: Thu May 12 09:12:09 2022 -0700 riscv: support for Svpbmt and D1 memory types Adds support for Svpbmt, the "Supervisor-mode: page-based memory types" extension, which allows pages to be marked as non-cacheable and/or I/O. This also includes support for the Allwinner D1's page table attributes via the alternatives framework, which differ from Svpbmt in various ways but are necessary to make the D1 function. * palmer/riscv-d1: riscv: add memory-type errata for T-Head riscv: don't use global static vars to store alternative data riscv: remove FIXMAP_PAGE_IO and fall back to its default value riscv: add RISC-V Svpbmt extension support riscv: Fix accessing pfn bits in PTEs for non-32bit variants riscv: move boot alternatives to after fill_hwcap riscv: prevent compressed instructions in alternatives riscv: extend concatenated alternatives-lines to the same length riscv: implement ALTERNATIVE_2 macro riscv: implement module alternatives riscv: allow different stages with alternatives riscv: integrate alternatives better into the main architecture commit dd089d485849792c540d34f4be30bedade5ca791 Author: Guo Zhengkui Date: Thu May 5 11:01:14 2022 +0800 MIPS: Sibyte: remove unnecessary return variable Fix the following coccicheck warning: arch/mips/sibyte/bcm1480/setup.c:37:5-8: Unneeded variable: "ret". Return "0" on line 67. Signed-off-by: Guo Zhengkui Signed-off-by: Thomas Bogendoerfer commit f5e2d8186d5eafc809704fa1b25b5b753f50617c Author: Tiezhu Yang Date: Fri May 6 19:02:03 2022 +0800 MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation If define CONFIG_KPROBES, __kprobes annotation forces the whole function into the ".kprobes.text" section, NOKPROBE_SYMBOL() only stores the given function address in the "_kprobe_blacklist" section which is introduced to maintain kprobes blacklist. Modify the related code to use NOKPROBE_SYMBOL() to protect functions from kprobes instead of __kprobes annotation under arch/mips. No obvious functional change in this patch, some more work needs to be done to fix the kernel panic when execute the following testcase on mips: # cd tools/testing/selftests/ftrace # ./ftracetest test.d/kprobe/multiple_kprobes.tc Signed-off-by: Tiezhu Yang Acked-by: Masami Hiramatsu Signed-off-by: Thomas Bogendoerfer commit eab691b1a6841813e84abfc8cef392b67efdaede Author: Tiezhu Yang Date: Fri May 6 19:02:02 2022 +0800 selftests/ftrace: Save kprobe_events to test log It may lead to kernel panic when execute the following testcase on mips: # cd tools/testing/selftests/ftrace # ./ftracetest test.d/kprobe/multiple_kprobes.tc A preliminary analysis shows that the issue is related with echo 1 > events/kprobes/enable after add the 256 probe points. In order to find the root cause, I want to verify which probe point has problem, so it is necessary to save kprobe_events to test log. With this patch, we can get the 256 probe points in the test log through the following command: # ./ftracetest test.d/kprobe/multiple_kprobes.tc -vvv -k Signed-off-by: Tiezhu Yang Acked-by: Masami Hiramatsu Signed-off-by: Thomas Bogendoerfer commit a4fa106ee1e146a1955e81337ad95f0cc5c20592 Author: Jason Wang Date: Sun May 8 10:31:46 2022 +0800 MIPS: tools: 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 Signed-off-by: Thomas Bogendoerfer commit abae018a03821be2b65c01ebe2bef06fd7d85a4c Author: Guenter Roeck Date: Wed May 11 07:56:59 2022 -0700 MIPS: Loongson: Use hwmon_device_register_with_groups() to register hwmon Calling hwmon_device_register_with_info() with NULL dev and/or chip information parameters is an ABI abuse and not a real conversion to the new API. Also, the code creates sysfs attributes _after_ creating the hwmon device, which is racy and unsupported to start with. On top of that, the removal code tries to remove the name attribute which is owned by the hwmon core. Use hwmon_device_register_with_groups() to register the hwmon device instead. In the future, the hwmon subsystem will reject calls to hwmon_device_register_with_info with NULL dev or chip/info parameters. Without this patch, the hwmon device will fail to register. Fixes: f59dc5119192 ("MIPS: Loongson: Fix boot warning about hwmon_device_register()") Cc: Zhi Li Signed-off-by: Guenter Roeck Signed-off-by: Thomas Bogendoerfer commit 85663a86cdc782f6cb7090fb8bbfac00eb74d638 Author: Haowen Bai Date: Tue May 10 17:55:27 2022 +0800 MIPS: VR41xx: Drop redundant spinlock initialization slot_errbuf_lock has declared and initialized by DEFINE_SPINLOCK, so we don't need to spin_lock_init again, drop it. Signed-off-by: Haowen Bai Signed-off-by: Thomas Bogendoerfer commit 84595f450a8fc773a5543e2a0cca55067db38a8d Author: Mao Bibo Date: Tue May 10 19:44:41 2022 +0800 MIPS: smp: optimization for flush_tlb_mm when exiting When process exits or execute new binary, it will call function exit_mmap with old mm, there is such function call trace: exit_mmap(struct mm_struct *mm) --> tlb_finish_mmu(&tlb, 0, -1) --> arch_tlb_finish_mmu(tlb, start, end, force) --> tlb_flush_mmu(tlb); --> tlb_flush(struct mmu_gather *tlb) --> flush_tlb_mm(tlb->mm) It is not necessary to flush tlb since oldmm is not used anymore by the process, there is similar operations on IA64/ARM64 etc, this patch adds such optimization on MIPS. Signed-off-by: Mao Bibo Signed-off-by: Thomas Bogendoerfer commit 89c30dd22137afcaaf91eff54aebc9e1ec48ebb2 Author: Huilong Deng Date: Tue May 10 10:01:35 2022 +0800 docs/zh_CN: fix devicetree usage-model translation machine_desc is a item in devicetree, shouldn't be half translated. Let's keep a whole word untranslated. Signed-off-by: Huilong Deng Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20220510020135.55452-1-denghuilong@cdjrlc.com Signed-off-by: Jonathan Corbet commit f339f3541701d824a0256ad4bf14c26ceb6d79c3 Author: Rafael J. Wysocki Date: Wed May 11 17:51:39 2022 +0200 cpufreq: Rearrange locking in cpufreq_remove_dev() Currently, cpufreq_remove_dev() invokes the ->exit() driver callback without holding the policy rwsem which is inconsistent with what happens if ->exit() is invoked directly from cpufreq_offline(). It also manipulates the real_cpus mask and removes the CPU device symlink without holding the policy rwsem, but cpufreq_offline() holds the rwsem around the modifications thereof. For consistency, modify cpufreq_remove_dev() to hold the policy rwsem until the ->exit() callback has been called (or it has been determined that it is not necessary to call it). Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar commit fddd8f86dff4a24742a7f0322ccbb34c6c1c9850 Author: Rafael J. Wysocki Date: Wed May 11 17:50:09 2022 +0200 cpufreq: Split cpufreq_offline() Split the "core" part running under the policy rwsem out of cpufreq_offline() to allow the locking in cpufreq_remove_dev() to be rearranged more easily. As a side-effect this eliminates the unlock label that's not needed any more. No expected functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar commit e1e962c5b9edbc628a335bcdbd010331a12d3e5b Author: Rafael J. Wysocki Date: Wed May 11 17:48:41 2022 +0200 cpufreq: Reorganize checks in cpufreq_offline() Notice that cpufreq_offline() only needs to check policy_is_inactive() once and rearrange the code in there to make that happen. No expected functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar commit a508e33956b538e034ed5df619a73ec7c15bda72 Author: Miaoqian Lin Date: Thu May 12 08:44:45 2022 +0400 ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 00d93611f002 ("ipmi:ipmb: Add the ability to have a separate slave and master device") Signed-off-by: Miaoqian Lin Message-Id: <20220512044445.3102-1-linmq006@gmail.com> Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: Corey Minyard commit 5396ccbd79ab03bd588bcfaa59f58c9bbf9fdcde Author: Yu Zhe Date: Thu Apr 21 08:09:41 2022 -0700 ipmi: remove unnecessary type castings remove unnecessary void* type castings. Signed-off-by: Yu Zhe Message-Id: <20220421150941.7659-1-yuzhe@nfschina.com> Signed-off-by: Corey Minyard commit 1016daf218371b4bb7300245d43060e511b60814 Author: Corey Minyard Date: Thu Apr 14 11:07:05 2022 -0500 ipmi: Make two logs unique There were two identical logs in two different places, so you couldn't tell which one was being logged. Make them unique. Signed-off-by: Corey Minyard commit be8503597c3e20b1d1dfc68b3a8cb99ea4d261ba Author: Corey Minyard Date: Wed Apr 13 17:47:47 2022 -0500 ipmi:si: Convert pr_debug() to dev_dbg() A device is available, use it. Signed-off-by: Corey Minyard commit b2c6941a5cf4a644010c0c9ecb33750e1f7eaf31 Author: Corey Minyard Date: Wed Apr 13 17:40:54 2022 -0500 ipmi: Convert pr_debug() to dev_dbg() A device is available at all debug points, use the right interface. Signed-off-by: Corey Minyard commit 2ebaf18a0b7fb764bba6c806af99fe868cee93de Author: Corey Minyard Date: Fri Apr 15 07:23:32 2022 -0500 ipmi: Fix pr_fmt to avoid compilation issues The was it was wouldn't work in some situations, simplify it. What was there was unnecessary complexity. Reported-by: kernel test robot Signed-off-by: Corey Minyard commit f214549d717310f795c20db9497db3938116399d Author: Corey Minyard Date: Tue Apr 12 15:49:47 2022 -0500 ipmi: Add an intializer for ipmi_recv_msg struct Don't hand-initialize the struct here, create a macro to initialize it so new fields added don't get forgotten in places. Signed-off-by: Corey Minyard commit 9824117dd964ecebf5d81990dbf21dfb56445049 Author: Corey Minyard Date: Tue Apr 12 15:38:51 2022 -0500 ipmi: Add an intializer for ipmi_smi_msg struct There was a "type" element added to this structure, but some static values were missed. The default value will be zero, which is correct, but create an initializer for the type and initialize the type properly in the initializer to avoid future issues. Reported-by: Joe Wiese Signed-off-by: Corey Minyard commit 7602b957e2404e5f98d9a40b68f1fd27f0028712 Author: Corey Minyard Date: Fri Apr 1 07:44:53 2022 -0500 ipmi:ssif: Check for NULL msg when handling events and messages Even though it's not possible to get into the SSIF_GETTING_MESSAGES and SSIF_GETTING_EVENTS states without a valid message in the msg field, it's probably best to be defensive here and check and print a log, since that means something else went wrong. Also add a default clause to that switch statement to release the lock and print a log, in case the state variable gets messed up somehow. Reported-by: Haowen Bai Signed-off-by: Corey Minyard commit 0924c5a0cbed5831a2a0ff2f9a19692265f1ab92 Author: Stephen Kitt Date: Thu Mar 24 18:11:59 2022 +0100 ipmi: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Message-Id: <20220324171159.544565-1-steve@sk2.org> Signed-off-by: Corey Minyard Reviewed-by: Wolfram Sang commit d5d91586beda89b204dd1956a27e3ed2309ea995 Author: Corey Minyard Date: Tue Mar 29 13:13:34 2022 -0500 ipmi: Add a sysfs count of total outstanding messages for an interface Go through each user and add its message count to a total and print the total. It would be nice to have a per-user file, but there's no user sysfs entity at this point to hang it off of. Probably not worth the effort. Based on work by Chen Guanqiao Cc: Chen Guanqiao Signed-off-by: Corey Minyard commit f60231885fa986fcd5503f4eb9ef3e53a2002b12 Author: Corey Minyard Date: Tue Mar 29 08:31:36 2022 -0500 ipmi: Add a sysfs interface to view the number of users A count of users is kept for each interface, allow it to be viewed. Based on work by Chen Guanqiao Cc: Chen Guanqiao Signed-off-by: Corey Minyard commit 333730e456fa67eaf6032c6371936fd4aca6cc62 Author: Corey Minyard Date: Mon Mar 28 11:39:29 2022 -0500 ipmi: Limit the number of message a user may have outstanding This way a rogue application can't use up a bunch of memory. Based on work by Chen Guanqiao Cc: Chen Guanqiao Signed-off-by: Corey Minyard commit 8e76741c3d8b20dfa2d6c30fa10ff927cfd93d82 Author: Corey Minyard Date: Mon Mar 28 11:26:08 2022 -0500 ipmi: Add a limit on the number of users that may use IPMI Each user uses memory, we need limits to avoid a rogue program from running the system out of memory. Based on work by Chen Guanqiao Cc: Chen Guanqiao Signed-off-by: Corey Minyard commit d52848620de00cde4a3a5df908e231b8c8868250 Author: Mario Limonciello Date: Tue May 10 08:11:36 2022 -0500 ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default ASUS B1400CEAE fails to resume from suspend to idle by default. This was bisected back to commit df4f9bc4fb9c ("nvme-pci: add support for ACPI StorageD3Enable property") but this is a red herring to the problem. Before this commit the system wasn't getting into deepest sleep state. Presumably this commit is allowing entry into deepest sleep state as advertised by firmware, but there are some other problems related to the wakeup. As it is confirmed the system works properly with S3, set the default for this system to S3. Reported-by: Jian-Hong Pan Link: https://bugzilla.kernel.org/show_bug.cgi?id=215742 Signed-off-by: Mario Limonciello Tested-by: Jian-Hong Pan Signed-off-by: Rafael J. Wysocki commit 4c19851c70bae39e85979a72954982891a72e1c2 Author: Ian Cowan Date: Fri May 6 16:47:31 2022 -0400 ACPI: clean up white space in a few places for consistency This cleans up a few line spaces so that it is consistent with the rest of the file. There are a few places where a space was added before a return and two spots where a double line space was made into one line space. Signed-off-by: Ian Cowan [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki commit c94f732e8001a860b42aa740b0a178a29907463c Author: Nirmal Patel Date: Wed May 11 02:57:07 2022 -0700 PCI: vmd: Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") Revert 2565e5b69c44 ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.") The commit 2565e5b69c44 was added as a workaround to keep MSI-X remapping enabled if IOMMU enables interrupt remapping. VMD would keep running in low performance mode. There is no dependency between MSI-X remapping by VMD and interrupt remapping by IOMMU. Link: https://lore.kernel.org/r/20220511095707.25403-3-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi commit 886e67100b904cb1b106ed1dfa8a60696aff519a Author: Nirmal Patel Date: Wed May 11 02:57:06 2022 -0700 PCI: vmd: Assign VMD IRQ domain before enumeration During the boot process all the PCI devices are assigned default PCI-MSI IRQ domain including VMD endpoint devices. If interrupt-remapping is enabled by IOMMU, the PCI devices except VMD get new INTEL-IR-MSI IRQ domain. And VMD is supposed to create and assign a separate VMD-MSI IRQ domain for its child devices in order to support MSI-X remapping capabilities. Now when MSI-X remapping in VMD is disabled in order to improve performance, VMD skips VMD-MSI IRQ domain assignment process to its child devices. Thus the devices behind VMD get default PCI-MSI IRQ domain instead of INTEL-IR-MSI IRQ domain when VMD creates root bus and configures child devices. As a result host OS fails to boot and DMAR errors were observed when interrupt remapping was enabled on Intel Icelake CPUs. For instance: DMAR: DRHD: handling fault status reg 2 DMAR: [INTR-REMAP] Request device [0xe2:0x00.0] fault index 0xa00 [fault reason 0x25] Blocked a compatibility format interrupt request To fix this issue, dev_msi_info struct in dev struct maintains correct value of IRQ domain. VMD will use this information to assign proper IRQ domain to its child devices when it doesn't create a separate IRQ domain. Link: https://lore.kernel.org/r/20220511095707.25403-2-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi commit b7fbf4cebd7c693d30e258f2ce27a362848634ae Author: Rafael J. Wysocki Date: Thu May 5 20:52:57 2022 +0200 ACPI: glue: Rearrange find_child_checks() Notice that it is not necessary to evaluate _STA in find_child_checks() if the device is expected to have children, but there are none, so move the children check to the front of the function. Also notice that FIND_CHILD_MIN_SCORE can be returned right away if _STA is missing, so make the function do so. Finally, replace the ternary operator in the return statement argument with an if () and a standalone return which is somewhat easier to follow. Signed-off-by: Rafael J. Wysocki commit 516edb456f121e819d2130571004ed82f9566c4d Author: Yang Li Date: Thu May 12 07:05:29 2022 -0700 nilfs2: Fix some kernel-doc comments The description of @flags in nilfs_dirty_inode() kernel-doc comment is missing, and some functions had kernel-doc that used a hash instead of a colon to separate the parameter name from the one line description. Fix them to remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/nilfs2/inode.c:73: warning: Function parameter or member 'inode' not described in 'nilfs_get_block' fs/nilfs2/inode.c:73: warning: Function parameter or member 'blkoff' not described in 'nilfs_get_block' fs/nilfs2/inode.c:73: warning: Function parameter or member 'bh_result' not described in 'nilfs_get_block' fs/nilfs2/inode.c:73: warning: Function parameter or member 'create' not described in 'nilfs_get_block' fs/nilfs2/inode.c:145: warning: Function parameter or member 'file' not described in 'nilfs_readpage' fs/nilfs2/inode.c:145: warning: Function parameter or member 'page' not described in 'nilfs_readpage' fs/nilfs2/inode.c:968: warning: Function parameter or member 'flags' not described in 'nilfs_dirty_inode' Link: https://lkml.kernel.org/r/20220324024215.63479-1-yang.lee@linux.alibaba.com Link: https://lkml.kernel.org/r/1652276316-7791-1-git-send-email-konishi.ryusuke@gmail.com Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) commit 08104fb0b1503324b5ecb08be8d06918c2fd01db Author: Matthew Wilcox (Oracle) Date: Sun May 8 15:23:51 2022 -0400 Appoint myself page cache maintainer This feels like a sufficiently distinct area of responsibility to be worth separating out from both MM and VFS. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Jeff Layton Acked-by: Christian Brauner (Microsoft) Acked-by: Vlastimil Babka commit a327c341dc65e38af7a2398e7313e6f2c4a813db Author: Ming Lei Date: Thu May 12 22:00:10 2022 +0800 blk-mq: fix passthrough plugging First we can't add request into plug list in blk_mq_request_bypass_insert which may be called when flushing plug list, so nested plug is caused. Second if polled passthrough request is inserted via blk_execute_rq(), it can't be added to plug list too since io polling needs the request to be issued to driver. Fixes the two by moving plugging into blk_execute_rq_no_wait(). Cc: Christoph Hellwig Fixes: 1c2d2fff6dc0 ("block: wire-up support for passthrough plugging") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220512140010.1458645-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 66d7a40beb413815a5b1adbc1558200f5b18d817 Author: Geert Uytterhoeven Date: Mon May 9 15:50:02 2022 +0200 mtd: nand: MTD_NAND_ECC_MEDIATEK should depend on ARCH_MEDIATEK The MediaTek Hardware ECC Engine is only present on MediaTek MT27xx and MT76xx SoCs. The driver for this engine is a dependency for the MediaTek NAND controller (MTD_NAND_MTK) and the MediaTek SPI NAND Flash Interface (SPI_MTK_SNFI) drivers, both of which already depend on ARCH_MEDIATEK. Hence add a dependency on ARCH_MEDIATEK to the Hardware ECC Engine driver, too, to prevent asking the user about this driver when configuring a kernel without MediaTek SoC support. Fixes: 4fd62f15afa0d0da ("mtd: nand: make mtk_ecc.c a separated module") Signed-off-by: Geert Uytterhoeven Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/bb9568e825d4bc7506870b03836baa91bcc4b725.1652104136.git.geert+renesas@glider.be commit 75d6fe48a21a0ea1565228c12b9c16f3fb37b673 Author: Siddh Raman Pant Date: Thu May 12 20:06:45 2022 +0530 spi: Doc fix - Describe add_lock and dma_map_dev in spi_controller This fixes the corresponding warnings during building the docs. Signed-off-by: Siddh Raman Pant Link: https://lore.kernel.org/r/4e6187a4-d0f8-4750-e407-e09cc1c91789@gmail.com Signed-off-by: Mark Brown commit c96f824af0e9f88299430db8360dfc9e6c40df36 Author: Minghao Chi Date: Thu May 5 02:23:54 2022 +0000 mtd: rawnand: cs553x: simplify the return expression of cs553x_write_ctrl_byte() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220505022354.61458-1-chi.minghao@zte.com.cn commit 606e5d408184989f53028125e0cb5aa6713362d5 Author: Vaishnav Achath Date: Wed May 11 17:25:16 2022 +0530 spi: cadence-quadspi: Handle spi_unregister_master() in remove() Currently devres managed removal of the spi_controller happens after removing the power domain of the host platform_device.While this does not affect the clean removal of the controller, but affects graceful removal of the child devices if the child device removal requires issuing commands over SPI. Eg. flash device being soft reset to 1S-1S-1S mode before removal so that on next probe operations in 1S-1S-1S mode is successful. Failure is seen when `rmmod spi-cadence-quadspi` is performed: root@j7-evm:~# rmmod spi_cadence_quadspi [ 49.230996] cadence-qspi 47050000.spi: QSPI is still busy after 500ms timeout. [ 49.238209] spi-nor spi1.0: operation failed with -110 [ 49.244457] spi-nor spi1.0: Software reset failed: -110 and on subsequent modprobe the OSPI flash probe fails as it is in 8D-8D-8D mode since the previous soft reset did not happen. root@j7-evm:~# modprobe spi_cadence_quadspi [ 73.253536] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff [ 73.260476] spi-nor: probe of spi0.0 failed with error -2 This commit adds necessary changes to perform spi_unregister_master() in the host device remove() so that the child devices are gracefully removed before the power domain is removed. changes tested on J721E with mt35xu512aba flash. Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20220511115516.14894-1-vaishnav.a@ti.com Signed-off-by: Mark Brown commit 773898127ebff6056d207c9b5901e97573999b74 Author: Rickard x Andersson Date: Fri Apr 29 10:39:31 2022 +0200 mtd: rawnand: kioxia: Add support for TH58NVG3S0HBAI4 Add timings for Kioxia/Toshiba TH58NVG3S0HBAI4. Timings for this memory matches the timings selected for TH58NVG2S3HBAI4. This patch increases eraseblock write speed from 5248 KiB/s to 6864 KiB/s and erase block read speed from 8542 KiB/s to 18360 KiB/s Tested on i.MX6SX. Signed-off-by: Rickard x Andersson Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220429083931.26795-1-rickaran@axis.com commit bc469ddf67154a4840267132e87ce0d8b72d4952 Author: Zucheng Zheng Date: Thu Apr 21 19:10:31 2022 +0800 perf/x86/amd: Remove unused variable 'hwc' 'hwc' is never used in amd_pmu_enable_all(), so remove it. Signed-off-by: Zucheng Zheng Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220421111031.174698-1-zhengzucheng@huawei.com commit 4bc78005887f6fca60b624822943708652fda01a Author: Tiezhu Yang Date: Wed May 11 16:37:50 2022 +0800 objtool: Remove libsubcmd.a when make clean The file libsubcmd.a still exists after make clean, remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/1652258270-6278-3-git-send-email-yangtiezhu@loongson.cn commit f193c32cad2ddc79ad55a2e2fb3bc35e7d92946a Author: Tiezhu Yang Date: Wed May 11 16:37:49 2022 +0800 objtool: Remove inat-tables.c when make clean When build objtool on x86, the generated file inat-tables.c is in arch/x86/lib instead of arch/x86, use the correct dir to remove it when make clean. $ cd tools/objtool $ make [...] GEN arch/x86/lib/inat-tables.c [...] Signed-off-by: Tiezhu Yang Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/1652258270-6278-2-git-send-email-yangtiezhu@loongson.cn commit 3a21c3ac93aff7b4522b152399df8f6a041df56d Author: Dinh Nguyen Date: Wed May 11 12:54:46 2022 -0500 dt-bindings: gpio: altera: correct interrupt-cells update documentation to correctly state the interrupt-cells to be 2. Cc: stable@vger.kernel.org Fixes: 4fd9bbc6e071 ("drivers/gpio: Altera soft IP GPIO driver devicetree binding") Signed-off-by: Dinh Nguyen commit f9ccf752ed212e93a22921beeef350325a9e0da4 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:30:49 2022 +0200 ARM: dts: socfpga: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit fd4b80044b09c8ee9ccdd1caff025b7d0dabcaf7 Merge: 0b7f644f52e81 a4cfdebdfe62e Author: Mark Brown Date: Thu May 12 15:18:23 2022 +0100 ASoC: SOF: Add IPC4 FW loader support Merge series from Ranjani Sridharan : The patches in this series add support for FW loading for IPC4 in the SOF driver. commit 6ba1e04fa60787ced4c9049cf7bd6cd0f1b80764 Author: Vipin Sharma Date: Mon May 2 22:03:47 2022 +0000 KVM: x86/mmu: Speed up slot_rmap_walk_next for sparsely populated rmaps Avoid calling handlers on empty rmap entries and skip to the next non empty rmap entry. Empty rmap entries are noop in handlers. Signed-off-by: Vipin Sharma Suggested-by: Sean Christopherson Message-Id: <20220502220347.174664-1-vipinsh@google.com> Signed-off-by: Paolo Bonzini commit 3c5c32457d7da76d077effc08176d3ad2e7536f9 Author: Kai Huang Date: Tue Apr 19 23:17:04 2022 +1200 KVM: VMX: Include MKTME KeyID bits in shadow_zero_check Intel MKTME KeyID bits (including Intel TDX private KeyID bits) should never be set to SPTE. Set shadow_me_value to 0 and shadow_me_mask to include all MKTME KeyID bits to include them to shadow_zero_check. Signed-off-by: Kai Huang Message-Id: <27bc10e97a3c0b58a4105ff9107448c190328239.1650363789.git.kai.huang@intel.com> Signed-off-by: Paolo Bonzini commit e54f1ff244ac96c919049838a5a1f03087793594 Author: Kai Huang Date: Tue Apr 19 23:17:03 2022 +1200 KVM: x86/mmu: Add shadow_me_value and repurpose shadow_me_mask Intel Multi-Key Total Memory Encryption (MKTME) repurposes couple of high bits of physical address bits as 'KeyID' bits. Intel Trust Domain Extentions (TDX) further steals part of MKTME KeyID bits as TDX private KeyID bits. TDX private KeyID bits cannot be set in any mapping in the host kernel since they can only be accessed by software running inside a new CPU isolated mode. And unlike to AMD's SME, host kernel doesn't set any legacy MKTME KeyID bits to any mapping either. Therefore, it's not legitimate for KVM to set any KeyID bits in SPTE which maps guest memory. KVM maintains shadow_zero_check bits to represent which bits must be zero for SPTE which maps guest memory. MKTME KeyID bits should be set to shadow_zero_check. Currently, shadow_me_mask is used by AMD to set the sme_me_mask to SPTE, and shadow_me_shadow is excluded from shadow_zero_check. So initializing shadow_me_mask to represent all MKTME keyID bits doesn't work for VMX (as oppositely, they must be set to shadow_zero_check). Introduce a new 'shadow_me_value' to replace existing shadow_me_mask, and repurpose shadow_me_mask as 'all possible memory encryption bits'. The new schematic of them will be: - shadow_me_value: the memory encryption bit(s) that will be set to the SPTE (the original shadow_me_mask). - shadow_me_mask: all possible memory encryption bits (which is a super set of shadow_me_value). - For now, shadow_me_value is supposed to be set by SVM and VMX respectively, and it is a constant during KVM's life time. This perhaps doesn't fit MKTME but for now host kernel doesn't support it (and perhaps will never do). - Bits in shadow_me_mask are set to shadow_zero_check, except the bits in shadow_me_value. Introduce a new helper kvm_mmu_set_me_spte_mask() to initialize them. Replace shadow_me_mask with shadow_me_value in almost all code paths, except the one in PT64_PERM_MASK, which is used by need_remote_flush() to determine whether remote TLB flush is needed. This should still use shadow_me_mask as any encryption bit change should need a TLB flush. And for AMD, move initializing shadow_me_value/shadow_me_mask from kvm_mmu_reset_all_pte_masks() to svm_hardware_setup(). Signed-off-by: Kai Huang Message-Id: Signed-off-by: Paolo Bonzini commit c919e881ba83e2912354ffa035980f62c78cc2f3 Author: Kai Huang Date: Tue Apr 19 23:17:02 2022 +1200 KVM: x86/mmu: Rename reset_rsvds_bits_mask() Rename reset_rsvds_bits_mask() to reset_guest_rsvds_bits_mask() to make it clearer that it resets the reserved bits check for guest's page table entries. Signed-off-by: Kai Huang Message-Id: Signed-off-by: Paolo Bonzini commit c9f3d9fbcd9a013f44a43bd74a3f40d924ce4843 Author: Paolo Bonzini Date: Wed Apr 27 13:34:51 2022 -0400 KVM: x86: a vCPU with a pending triple fault is runnable Reviewed-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 1075d41efd598d3fd4d52a1e1116b20979975135 Author: Sean Christopherson Date: Sat Apr 23 03:47:49 2022 +0000 KVM: x86/mmu: Expand and clean up page fault stats Expand and clean up the page fault stats. The current stats are at best incomplete, and at worst misleading. Differentiate between faults that are actually fixed vs those that result in an MMIO SPTE being created, track faults that are spurious, faults that trigger emulation, faults that that are fixed in the fast path, and last but not least, track the number of faults that are taken. Note, the number of faults that require emulation for write-protected shadow pages can roughly be calculated by subtracting the number of MMIO SPTEs created from the overall number of faults that trigger emulation. Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-10-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 8d5265b1016369836c0735ed40933e179f186630 Author: Sean Christopherson Date: Sat Apr 23 03:47:48 2022 +0000 KVM: x86/mmu: Use IS_ENABLED() to avoid RETPOLINE for TDP page faults Use IS_ENABLED() instead of an #ifdef to activate the anti-RETPOLINE fast path for TDP page faults. The generated code is identical, and the #ifdef makes it dangerously difficult to extend the logic (guess who forgot to add an "else" inside the #ifdef and ran through the page fault handler twice). No functional or binary change intented. Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 8a009d5bca0af7385880123d12081713f7066904 Author: Sean Christopherson Date: Sat Apr 23 03:47:47 2022 +0000 KVM: x86/mmu: Make all page fault handlers internal to the MMU Move kvm_arch_async_page_ready() to mmu.c where it belongs, and move all of the page fault handling collateral that was in mmu.h purely for the async #PF handler into mmu_internal.h, where it belongs. This will allow kvm_mmu_do_page_fault() to act on the RET_PF_* return without having to expose those enums outside of the MMU. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5276c616abf149a4dfbc708df3f22da642ec3dde Author: Sean Christopherson Date: Sat Apr 23 03:47:46 2022 +0000 KVM: x86/mmu: Add RET_PF_CONTINUE to eliminate bool+int* "returns" Add RET_PF_CONTINUE and use it in handle_abnormal_pfn() and kvm_faultin_pfn() to signal that the page fault handler should continue doing its thing. Aside from being gross and inefficient, using a boolean return to signal continue vs. stop makes it extremely difficult to add more helpers and/or move existing code to a helper. E.g. hypothetically, if nested MMUs were to gain a separate page fault handler in the future, everything up to the "is self-modifying PTE" check can be shared by all shadow MMUs, but communicating up the stack whether to continue on or stop becomes a nightmare. More concretely, proposed support for private guest memory ran into a similar issue, where it'll be forced to forego a helper in order to yield sane code: https://lore.kernel.org/all/YkJbxiL%2FAz7olWlq@google.com. No functional change intended. Cc: David Matlack Cc: Chao Peng Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5c64aba5179f6fc6a367f76342c6290a5e06cfc4 Author: Sean Christopherson Date: Sat Apr 23 03:47:45 2022 +0000 KVM: x86/mmu: Drop exec/NX check from "page fault can be fast" Tweak the "page fault can be fast" logic to explicitly check for !PRESENT faults in the access tracking case, and drop the exec/NX check that becomes redundant as a result. No sane hardware will generate an access that is both an instruct fetch and a write, i.e. it's a waste of cycles. If hardware goes off the rails, or KVM runs under a misguided hypervisor, spuriously running throught fast path is benign (KVM has been uknowingly being doing exactly that for years). Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 54275f74cf384217d9e6e85629793f0a024d88b7 Author: Sean Christopherson Date: Sat Apr 23 03:47:44 2022 +0000 KVM: x86/mmu: Don't attempt fast page fault just because EPT is in use Check for A/D bits being disabled instead of the access tracking mask being non-zero when deciding whether or not to attempt to fix a page fault vian the fast path. Originally, the access tracking mask was non-zero if and only if A/D bits were disabled by _KVM_ (including not being supported by hardware), but that hasn't been true since nVMX was fixed to honor EPTP12's A/D enabling, i.e. since KVM allowed L1 to cause KVM to not use A/D bits while running L2 despite KVM using them while running L1. In other words, don't attempt the fast path just because EPT is enabled. Note, attempting the fast path for all !PRESENT faults can "fix" a very, _VERY_ tiny percentage of faults out of mmu_lock by detecting that the fault is spurious, i.e. has been fixed by a different vCPU, but again the odds of that happening are vanishingly small. E.g. booting an 8-vCPU VM gets less than 10 successes out of 30k+ faults, and that's likely one of the more favorable scenarios. Disabling dirty logging can likely lead to a rash of collisions between vCPUs for some workloads that operate on a common set of pages, but penalizing _all_ !PRESENT faults for that one case is unlikely to be a net positive, not to mention that that problem is best solved by not zapping in the first place. The number of spurious faults does scale with the number of vCPUs, e.g. a 255-vCPU VM using TDP "jumps" to ~60 spurious faults detected in the fast path (again out of 30k), but that's all of 0.2% of faults. Using legacy shadow paging does get more spurious faults, and a few more detected out of mmu_lock, but the percentage goes _down_ to 0.08% (and that's ignoring faults that are reflected into the guest), i.e. the extra detections are purely due to the sheer number of faults observed. On the other hand, getting a "negative" in the fast path takes in the neighborhood of 150-250 cycles. So while it is tempting to keep/extend the current behavior, such a change needs to come with hard numbers showing that it's actually a win in the grand scheme, or any scheme for that matter. Fixes: 995f00a61958 ("x86: kvm: mmu: use ept a/d in vmcs02 iff used in vmcs12") Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 91ab933f7514fc0fb42b77dc6d128c450baeae0b Author: Li RongQing Date: Wed Apr 6 19:25:02 2022 +0800 KVM: VMX: clean up pi_wakeup_handler Passing per_cpu() to list_for_each_entry() causes the macro to be evaluated N+1 times for N sleeping vCPUs. This is a very small inefficiency, and the code is cleaner if the address of the per-CPU variable is loaded earlier. Do this for both the list and the spinlock. Signed-off-by: Li RongQing Message-Id: <1649244302-6777-1-git-send-email-lirongqing@baidu.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 33fbe6befa622c082f7d417896832856814bdde0 Author: Maxim Levitsky Date: Thu May 12 13:14:20 2022 +0300 KVM: x86: fix typo in __try_cmpxchg_user causing non-atomicness This shows up as a TDP MMU leak when running nested. Non-working cmpxchg on L0 relies makes L1 install two different shadow pages under same spte, and one of them is leaked. Fixes: 1c2361f667f36 ("KVM: x86: Use __try_cmpxchg_user() to emulate atomic accesses") Signed-off-by: Maxim Levitsky Message-Id: <20220512101420.306759-1-mlevitsk@redhat.com> Reviewed-by: Sean Christopherson Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 46ecf720f36230385d876013bbdb4536a56dcec9 Author: Minghao Chi Date: Wed May 11 02:16:38 2022 +0000 platform/x86: toshiba_acpi: use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Signed-off-by: Minghao Chi Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220511021638.1488650-1-chi.minghao@zte.com.cn Signed-off-by: Hans de Goede commit c8ad6a768062e0e0aea59ad35bf33cd0a329b03b Author: Minghao Chi Date: Wed May 11 02:15:22 2022 +0000 platform/x86: samsung-laptop: use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Signed-off-by: Minghao Chi Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220511021522.1488373-1-chi.minghao@zte.com.cn Signed-off-by: Hans de Goede commit 0ca48a2e73699d5c62de7760ec60d47d5e351765 Author: Frank Crawford Date: Tue May 10 22:00:12 2022 +1000 platform/x86: gigabyte-wmi: Add support for Z490 AORUS ELITE AC and X570 AORUS ELITE WIFI Tested on my systems with module force_load option. Signed-off-by: Frank Crawford Link: https://lore.kernel.org/r/20220510120012.2167591-1-frank@crawford.emu.id.au Signed-off-by: Hans de Goede commit 9230a2ac2b47c443e3f0be512d439e811356fab2 Author: Srinivas Pandruvada Date: Wed May 11 10:12:08 2022 -0700 tools/power/x86/intel-speed-select: Fix warning for perf_cap.cpu Initialize perf_cap struct to avoid warning: CC hfi-events.o In function ‘process_hfi_event’, inlined from ‘handle_event’ at hfi-events.c:220:5: hfi-events.c:184:9: warning: ‘perf_cap.cpu’ may be used uninitialized [-Wmaybe-uninitialized] 184 | process_level_change(perf_cap->cpu); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hfi-events.c: In function ‘handle_event’: hfi-events.c:193:25: note: ‘perf_cap.cpu’ was declared here 193 | struct perf_cap perf_cap; | ^~~~~~~~ Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220511171208.211319-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit 2da6391dfc2aa4c5ef97fe94d2173e87a7bfb534 Author: Srinivas Pandruvada Date: Mon May 9 19:34:21 2022 -0700 tools/power/x86/intel-speed-select: Display error on turbo mode disabled For Intel SST turbo-freq feature to be enabled, the turbo mode on the platform must be enabled also. If turbo mode is disabled, display error while enabling turbo-freq feature. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220510023421.3930540-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit 34604d28916710070390036118fcd21217b0f597 Author: Tony Luck Date: Fri May 6 15:54:10 2022 -0700 Documentation: In-Field Scan Add documentation for In-Field Scan (IFS). This documentation describes the basics of IFS, the loading IFS image, chunk authentication, running scan and how to check result via sysfs. The CORE_CAPABILITIES MSR enumerates whether IFS is supported. The full github location for distributing the IFS images is still being decided. So just a placeholder included for now in the documentation. Future CPUs will support more than one type of test. Plan for that now by using a "_0" suffix on the ABI directory names. Additional test types will use "_1", etc. Reviewed-by: Dan Williams Signed-off-by: Tony Luck Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-13-tony.luck@intel.com Signed-off-by: Hans de Goede commit 55b52633e16205663ab7d4c3168b9274eaa26400 Author: Jithu Joseph Date: Fri May 6 15:54:09 2022 -0700 platform/x86/intel/ifs: add ABI documentation for IFS Add the sysfs attributes in ABI/testing for In-Field Scan. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220506225410.1652287-12-tony.luck@intel.com Signed-off-by: Hans de Goede commit 51af802fc05152e84727a4293ccaa7e7e1b64d7e Author: Tony Luck Date: Fri May 6 15:54:08 2022 -0700 trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Add tracing support which may be useful for debugging systems that fail to complete In Field Scan tests. Acked-by: Steven Rostedt (Google) Reviewed-by: Dan Williams Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220506225410.1652287-11-tony.luck@intel.com Signed-off-by: Hans de Goede commit 6f33a92b92f9cc37f31137cd5a2060ec714d486b Author: Jithu Joseph Date: Fri May 6 15:54:07 2022 -0700 platform/x86/intel/ifs: Add IFS sysfs interface Implement sysfs interface to trigger ifs test for a specific cpu. Additional interfaces related to checking the status of the scan test and seeing the version of the loaded IFS binary are also added. The basic usage is as below. - To start test, for example on cpu5: echo 5 > /sys/devices/platform/intel_ifs/run_test - To see the status of the last test cat /sys/devices/platform/intel_ifs/status - To see the version of the loaded scan binary cat /sys/devices/platform/intel_ifs/image_version Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-10-tony.luck@intel.com Signed-off-by: Hans de Goede commit 2b40e654b73ae061f1acbe28fbec6007914ba8d8 Author: Jithu Joseph Date: Fri May 6 15:54:06 2022 -0700 platform/x86/intel/ifs: Add scan test support In a core, the scan engine is shared between sibling cpus. When a Scan test (for a particular core) is triggered by the user, the scan chunks are executed on all the threads on the core using stop_core_cpuslocked. Scan may be aborted by some reasons. Scan test will be aborted in certain circumstances such as when interrupt occurred or cpu does not have enough power budget for scan. In this case, the kernel restart scan from the chunk where it stopped. Scan will also be aborted when the test is failed. In this case, the test is immediately stopped without retry. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-9-tony.luck@intel.com Signed-off-by: Hans de Goede commit 684ec215706d449f78da232aae125c0bc14f22a9 Author: Jithu Joseph Date: Fri May 6 15:54:05 2022 -0700 platform/x86/intel/ifs: Authenticate and copy to secured memory The IFS image contains hashes that will be used to authenticate the ifs test chunks. First, use WRMSR to copy the hashes and enumerate the number of test chunks, chunk size and the maximum number of cores that can run scan test simultaneously. Next, use WRMSR to authenticate each and every scan test chunk which is stored in the IFS image. The CPU will check if the test chunks match the hashes, otherwise failure is indicated to system software. If the test chunk is authenticated, it is automatically copied to secured memory. Use schedule_work_on() to perform the hash copy and authentication. Note this needs only be done on the first logical cpu of each socket. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-8-tony.luck@intel.com Signed-off-by: Hans de Goede commit 846e751ff37e8ab2d161de04314435f9c1d729ca Author: Jithu Joseph Date: Fri May 6 15:54:04 2022 -0700 platform/x86/intel/ifs: Check IFS Image sanity IFS image is designed specifically for a given family, model and stepping of the processor. Like Intel microcode header, the IFS image has the Processor Signature, Checksum and Processor Flags that must be matched with the information returned by the CPUID. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-7-tony.luck@intel.com Signed-off-by: Hans de Goede commit fb57fc785ed3b71a3e8188d4914471bd1360bc53 Author: Jithu Joseph Date: Fri May 6 15:54:03 2022 -0700 platform/x86/intel/ifs: Read IFS firmware image Driver probe routine allocates structure to communicate status and parameters between functions in the driver. Also call load_ifs_binary() to load the scan image file. There is a separate scan image file for each processor family, model, stepping combination. This is read from the static path: /lib/firmware/intel/ifs/{ff-mm-ss}.scan Step 1 in loading is to generate the correct path and use request_firmware_direct() to load into memory. Subsequent patches will use the IFS MSR interfaces to copy the image to BIOS reserved memory and validate the SHA256 checksums. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-6-tony.luck@intel.com Signed-off-by: Hans de Goede commit 67896ef13c4db88082a914e96d958044cd3392e8 Author: Tony Luck Date: Fri May 6 15:54:02 2022 -0700 platform/x86/intel/ifs: Add stub driver for In-Field Scan Cloud Service Providers that operate fleets of servers have reported [1] occasions where they can detect that a CPU has gone bad due to effects like electromigration, or isolated manufacturing defects. However, that detection method is A/B testing seemingly random application failures looking for a pattern. In-Field Scan (IFS) is a driver for a platform capability to load a crafted 'scan image' to run targeted low level diagnostics outside of the CPU's architectural error detection capabilities. Stub version of driver just does initial part of check for the IFS feature. MSR_IA32_CORE_CAPS must enumerate the presence of the MSR_INTEGRITY_CAPS MSR. [1]: https://www.youtube.com/watch?v=QMF3rqhjYuM Reviewed-by: Dan Williams Signed-off-by: Tony Luck Acked-by: Hans de Goede Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-5-tony.luck@intel.com Signed-off-by: Hans de Goede commit 2760f5a415c3b86c6394738c6cff740c8b4ce664 Author: Peter Zijlstra Date: Fri May 6 15:54:01 2022 -0700 stop_machine: Add stop_core_cpuslocked() for per-core operations Hardware core level testing features require near simultaneous execution of WRMSR instructions on all threads of a core to initiate a test. Provide a customized cut down version of stop_machine_cpuslocked() that just operates on the threads of a single core. Suggested-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Tony Luck Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-4-tony.luck@intel.com Signed-off-by: Hans de Goede commit db1af12929c99d15fc04cc5c4447b87ab51eab0a Author: Tony Luck Date: Fri May 6 15:54:00 2022 -0700 x86/msr-index: Define INTEGRITY_CAPABILITIES MSR The INTEGRITY_CAPABILITIES MSR is enumerated by bit 2 of the CORE_CAPABILITIES MSR. Add defines for the CORE_CAPS enumeration as well as for the integrity MSR. Reviewed-by: Dan Williams Signed-off-by: Tony Luck Reviewed-by: Greg Kroah-Hartman Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220506225410.1652287-3-tony.luck@intel.com Signed-off-by: Hans de Goede commit d3287fb0d3c8afdfd4870a6cd4a852abc9008b3b Author: Jithu Joseph Date: Fri May 6 15:53:59 2022 -0700 x86/microcode/intel: Expose collect_cpu_info_early() for IFS IFS is a CPU feature that allows a binary blob, similar to microcode, to be loaded and consumed to perform low level validation of CPU circuitry. In fact, it carries the same Processor Signature (family/model/stepping) details that are contained in Intel microcode blobs. In support of an IFS driver to trigger loading, validation, and running of these tests blobs, make the functionality of cpu_signatures_match() and collect_cpu_info_early() available outside of the microcode driver. Add an "intel_" prefix and drop the "_early" suffix from collect_cpu_info_early() and EXPORT_SYMBOL_GPL() it. Add declaration to x86 Make cpu_signatures_match() an inline function in x86 , and also give it an "intel_" prefix. No functional change intended. Reviewed-by: Dan Williams Signed-off-by: Jithu Joseph Co-developed-by: Tony Luck Signed-off-by: Tony Luck Reviewed-by: Thomas Gleixner Acked-by: Borislav Petkov Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220506225410.1652287-2-tony.luck@intel.com Signed-off-by: Hans de Goede commit 33e21e56243eb56d06530b07bcadc24ad02001f1 Author: Luca Stefani Date: Fri May 6 14:25:36 2022 +0200 platform/x86: asus-nb-wmi: Add keymap for MyASUS key This event is triggered by pressing Fn+F12 on ASUS Zenbook UX425JA Map it to KEY_PROG1 to allow userspace to configure it Signed-off-by: Luca Stefani Link: https://lore.kernel.org/r/20220506122536.113566-2-luca.stefani.ge1@gmail.com Signed-off-by: Hans de Goede commit 3e70a57b659463147a35734429d035940306e08f Author: Luca Stefani Date: Fri May 6 14:25:35 2022 +0200 platform/x86: asus-wmi: Update unknown code message Prepend 0x to the actual key code to specify it is already an hex value Signed-off-by: Luca Stefani Link: https://lore.kernel.org/r/20220506122536.113566-1-luca.stefani.ge1@gmail.com Signed-off-by: Hans de Goede commit b1a9c69792caaac0813c9dc7806fb8654212e56c Author: Michael Shych Date: Sat Apr 30 14:58:09 2022 +0300 Documentation/ABI: Add new attributes for mlxreg-io sysfs interfaces Add documentation for the new attributes: - "phy_reset" - Reset PHY. - "mac_reset" - Reset MAC. - "qsfp_pwr_good" - The power status of QSFP ports. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-4-michaelsh@nvidia.com Signed-off-by: Hans de Goede commit 662f24826f954d49d56211822bcd7b3109287961 Author: Michael Shych Date: Sat Apr 30 14:58:08 2022 +0300 platform/mellanox: Add support for new SN2201 system The SN2201 is a highly integrated for one rack unit system with L3 management switches. It has 48 x 1Gbps RJ45 + 4 x 100G QSFP28 ports in a compact 1RU form factor. The system also including a serial port (RS-232 interface), an OOB port (1G/100M MDI interface) and USB ports for management functions. The processor used on SN2201 is Intel Atom®Processor C Series, C3338R which is one of the Denverton product families. System equipped with Nvidia®Spectrum-1 32x100GbE Ethernet switch. Features: - 48 ports RJ45 support 10/100/1000M speed. - Support 4 QSFP28 ports with 10/25/40/50/100G. - A USB port is available on SN2201. This port is used for image and File Management purposes - backing up and restoring images and config files - Provides flow control mechanism to ensure zero packet loss. Uses backpressure for half-duplex operation and IEEE802.3x for full duplex operation. - Cut-through and Store-and-Forward free switching mechanism. By default the mode is cut-through. - Standard 1U chassis height. - 19" rack mountable. - Extensive system LED and per port LEDs. - Redundant power supply. - 2 x AC Power Supply (one PSU is default, second PSU is optional). Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-3-michaelsh@nvidia.com Signed-off-by: Hans de Goede commit c5781212985a76ae610d18429388f9ec6ee3f77b Author: Robin Murphy Date: Wed May 11 14:12:53 2022 +0100 perf/arm-cmn: Decode CAL devices properly in debugfs The debugfs code is lazy, and since it only keeps the bottom byte of each connect_info register to save space, it also treats the whole thing as the device_type since the other bits were reserved anyway. Upon closer inspection, though, this is no longer true on newer IP versions, so let's be good and decode the exact field properly. This should help it not get confused when a Component Aggregation Layer is present (which is already implied if Node IDs are found for both device addresses represented by the next two lines of the table). Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/6a13a6128a28cfe2eec6d09cf372a167ec9c3b65.1652274773.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 5d2ae14276e698c76fa0c8ce870103f343b38263 Author: Bart Van Assche Date: Wed May 11 16:51:52 2022 -0700 block: Fix the bio.bi_opf comment Commit ef295ecf090d modified the Linux kernel such that the bottom bits of the bi_opf member contain the operation instead of the topmost bits. That commit did not update the comment next to bi_opf. Hence this patch. From commit ef295ecf090d: -#define bio_op(bio) ((bio)->bi_opf >> BIO_OP_SHIFT) +#define bio_op(bio) ((bio)->bi_opf & REQ_OP_MASK) Cc: Christoph Hellwig Cc: Ming Lei Fixes: ef295ecf090d ("block: better op and flags encoding") Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220511235152.1082246-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit c47452194641b5d27c20e557c84a46c85fd7ce37 Author: Michael Walle Date: Thu May 12 13:20:27 2022 +0200 mtd: spi-nor: debugfs: fix format specifier The intention was to print the JEDEC ID in the following format: nn nn nn In this case format specifier has to be "%*ph". Fix it. Fixes: 0257be79fc4a ("mtd: spi-nor: expose internal parameters via debugfs") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Michael Walle Signed-off-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220512112027.3771734-1-michael@walle.cc commit 5ce7729f25c16d5045deff4c9577e6d565da2d8d Author: Christoph Hellwig Date: Thu May 12 08:14:08 2022 +0200 block: reorder the REQ_ flags Keep the op-specific flag last so that they are clearly separate from the generic flags. Various recent commits just kept adding new flags at the end. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220512061408.1826595-1-hch@lst.de Signed-off-by: Jens Axboe commit b7a4f9b5d0e4b6dd937678c546c0b322dd1a4054 Author: Kishon Vijay Abraham I Date: Tue May 10 14:46:30 2022 +0530 xhci: Set HCD flag to defer primary roothub registration Set "HCD_FLAG_DEFER_RH_REGISTER" to hcd->flags in xhci_run() to defer registering primary roothub in usb_add_hcd() if xhci has two roothubs. This will make sure both primary roothub and secondary roothub will be registered along with the second HCD. This is required for cold plugged USB devices to be detected in certain PCIe USB cards (like Inateck USB card connected to AM64 EVM or J7200 EVM). This patch has been added and reverted earier as it triggered a race in usb device enumeration. That race is now fixed in 5.16-rc3, and in stable back to 5.4 commit 6cca13de26ee ("usb: hub: Fix locking issues with address0_mutex") commit 6ae6dc22d2d1 ("usb: hub: Fix usb enumeration issue due to address0 race") [minor rebase change, and commit message update -Mathias] CC: stable@vger.kernel.org # 5.4+ Suggested-by: Mathias Nyman Tested-by: Chris Chiu Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220510091630.16564-3-kishon@ti.com Signed-off-by: Greg Kroah-Hartman commit a44623d9279086c89f631201d993aa332f7c9e66 Author: Kishon Vijay Abraham I Date: Tue May 10 14:46:29 2022 +0530 usb: core: hcd: Add support for deferring roothub registration It has been observed with certain PCIe USB cards (like Inateck connected to AM64 EVM or J7200 EVM) that as soon as the primary roothub is registered, port status change is handled even before xHC is running leading to cold plug USB devices not detected. For such cases, registering both the root hubs along with the second HCD is required. Add support for deferring roothub registration in usb_add_hcd(), so that both primary and secondary roothubs are registered along with the second HCD. This patch has been added and reverted earier as it triggered a race in usb device enumeration. That race is now fixed in 5.16-rc3, and in stable back to 5.4 commit 6cca13de26ee ("usb: hub: Fix locking issues with address0_mutex") commit 6ae6dc22d2d1 ("usb: hub: Fix usb enumeration issue due to address0 race") CC: stable@vger.kernel.org # 5.4+ Suggested-by: Mathias Nyman Tested-by: Chris Chiu Acked-by: Alan Stern Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220510091630.16564-2-kishon@ti.com Signed-off-by: Greg Kroah-Hartman commit 72e28b70499ac3b5d720c9cb9ad0d4229fdc5e0d Author: Piyush Mehta Date: Mon May 9 22:32:52 2022 +0530 usb: host: ehci-xilinx: adding description for return value This patch resolves kernel-doc warnings to add return value description in function comments. Addressed warnings: drivers/usb/host/ehci-xilinx-of.c:37: warning: No description found for return value of 'ehci_xilinx_port_handed_over' drivers/usb/host/ehci-xilinx-of.c:117: warning: No description found for return value of 'ehci_hcd_xilinx_of_probe' drivers/usb/host/ehci-xilinx-of.c:201: warning: No description found for return value of 'ehci_hcd_xilinx_of_remove' Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220509170252.28271-1-piyush.mehta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit b4b44897ad3f4c1ad4ffe910e7b141c61522726c Author: Piyush Mehta Date: Fri May 6 23:23:49 2022 +0530 usb: gadget: udc: Remove useless variable assignment in xudc_read_fifo() This patch removes the unused variables assignment warning. Value assigned to variable bufferspace is overwritten, before it can be used. This makes such variable assignment useless. Reported Coverity warning: UNUSED_VALUE Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220506175349.10102-1-piyush.mehta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit f2f5cf78a3336f0245a1a59e641ce98fa9503db8 Author: Clément Léger Date: Mon May 2 17:22:19 2022 +0200 ARM: at91: pm: add support for sama5d2 secure suspend When running with OP-TEE, the suspend control is handled securely. Suspend can be entered using PSCI support. Since the sama5d2 supports multiple suspend modes, add a new CONFIG_ATMEL_SECURE_PM which will send a SMC call to select the suspend mode at init time. "atmel.pm_modes" boot argument is still supported for compatibility purposes but the standby value is actually ignored since PSCI suspend is used and it only support one mode (suspend). Signed-off-by: Clément Léger Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit 0c9fd821175a5634e00aa391f5f202f8ed4c9223 Author: Clément Léger Date: Mon May 2 17:22:18 2022 +0200 ARM: at91: add code to handle secure calls Since OP-TEE now has a more complete support for sama5d2, add necessary code to perform SMC calls. The detection of OP-TEE is based on a specific device-tree node path (/firmware/optee) such has done by some other SoC. A check is added to avoid doing SMC calls without having OP-TEE. Signed-off-by: Clément Léger Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit b33177f1d62bea7dd8a7dd6775116958ea71dc6b Merge: 982c97eede13f e0d0e1fdf1ed9 Author: Paolo Abeni Date: Thu May 12 13:03:12 2022 +0200 Merge branch 'nfp-vf-rate-limit-support' Simon Horman says: ==================== *nfp: VF rate limit support this short series adds VF rate limiting to the NFP driver. The first patch, as suggested by Jakub Kicinski, adds a helper to check that ndo_set_vf_rate() rate parameters are sane. It also provides a place for further parameter checking to live, if needed in future. The second patch adds VF rate limit support to the NFP driver. It addresses several comments made on v1, including removing the parameter check that is now provided by the helper added in the first patch. ==================== Link: https://lore.kernel.org/r/20220511113932.92114-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit e0d0e1fdf1ed9dcbca60409af0856fa17f0021cb Author: Bin Chen Date: Wed May 11 13:39:32 2022 +0200 nfp: VF rate limit support Add VF rate limit feature This patch enhances the NFP driver to supports assignment of both max_tx_rate and min_tx_rate to VFs The template of configurations below is all supported. e.g. # ip link set $DEV vf $VF_NUM max_tx_rate $RATE_VALUE # ip link set $DEV vf $VF_NUM min_tx_rate $RATE_VALUE # ip link set $DEV vf $VF_NUM max_tx_rate $RATE_VALUE \ min_tx_rate $RATE_VALUE # ip link set $DEV vf $VF_NUM min_tx_rate $RATE_VALUE \ max_tx_rate $RATE_VALUE The max RATE_VALUE is limited to 0xFFFF which is about 63Gbps (using 1024 for 1G) Signed-off-by: Bin Chen Signed-off-by: Louis Peens Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: Paolo Abeni commit a14857c27a505bc7ebcef6311424274b2f42f846 Author: Bin Chen Date: Wed May 11 13:39:31 2022 +0200 rtnetlink: verify rate parameters for calls to ndo_set_vf_rate When calling ndo_set_vf_rate() the max_tx_rate parameter may be zero, in which case the setting is cleared, or it must be greater or equal to min_tx_rate. Enforce this requirement on all calls to ndo_set_vf_rate via a wrapper which also only calls ndo_set_vf_rate() if defined by the driver. Based on work by Jakub Kicinski Signed-off-by: Bin Chen Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: Paolo Abeni commit 0b7f644f52e81e2a653a353966933b47d01df9bb Author: Hui Tang Date: Thu May 12 15:46:39 2022 +0800 ASoC: max98396: Fix build error for implicit function declaration sound/soc/codecs/max98396.c: In function ‘max98396_i2c_probe’: sound/soc/codecs/max98396.c:1555:25: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_regulator_get_optional’? [-Werror=implicit-function-declaration] max98396->reset_gpio = devm_gpiod_get_optional(&i2c->dev, ^~~~~~~~~~~~~~~~~~~~~~~ devm_regulator_get_optional sound/soc/codecs/max98396.c:1556:23: error: ‘GPIOD_OUT_HIGH’ undeclared (first use in this function); did you mean ‘GPIOF_INIT_HIGH’? "reset", GPIOD_OUT_HIGH); ^~~~~~~~~~~~~~ GPIOF_INIT_HIGH sound/soc/codecs/max98396.c:1556:23: note: each undeclared identifier is reported only once for each function it appears in sound/soc/codecs/max98396.c:1565:3: error: implicit declaration of function ‘gpiod_set_value_cansleep’; did you mean ‘gpio_set_value_cansleep’? [-Werror=implicit-function-declaration] gpiod_set_value_cansleep(max98396->reset_gpio, 0); ^~~~~~~~~~~~~~~~~~~~~~~~ gpio_set_value_cansleep cc1: all warnings being treated as errors Include header file Fixes: b58581136770 ("ASoC: max98396: add amplifier driver") Signed-off-by: Hui Tang Link: https://lore.kernel.org/r/20220512074640.75550-2-tanghui20@huawei.com Signed-off-by: Mark Brown commit cbcab8cd737c74c20195c31d647e19f7cb49c9b8 Author: Zheng Bin Date: Thu May 12 09:37:28 2022 +0800 ASoC: SOF: amd: add missing platform_device_unregister in acp_pci_rn_probe acp_pci_rn_probe misses a call platform_device_unregister in error path, this patch fixes that. Signed-off-by: Zheng Bin Link: https://lore.kernel.org/r/20220512013728.4128903-1-zhengbin13@huawei.com Signed-off-by: Mark Brown commit bf4a9b2467b775717d0e9034ad916888e19713a3 Author: Miaoqian Lin Date: Thu May 12 08:38:28 2022 +0400 ASoC: samsung: Fix refcount leak in aries_audio_probe of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. If extcon_find_edev_by_node() fails, it doesn't call of_node_put() Calling of_node_put() after extcon_find_edev_by_node() to fix this. Fixes: 7a3a7671fa6c ("ASoC: samsung: Add driver for Aries boards") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220512043828.496-1-linmq006@gmail.com Signed-off-by: Mark Brown commit a4cfdebdfe62e276f7626eb55b859fe16dcc28ef Author: Ranjani Sridharan Date: Wed May 11 10:16:48 2022 -0700 ASoC: SOF: Intel: HDA: Set up sof_ipc4_fw_data for IPC4 Allocate the sof_ipc4_fw_data struct for IPC4 and set the fw header offset for the platforms which will be used by the core when loading the firmware image. The core expects that the "private" field in struct snd_sof_dev (which is unused today with IPC3) is used to save this data. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220511171648.1622993-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit c62ff366b3c9984dbc30ab032540d1167acdda32 Author: Ranjani Sridharan Date: Wed May 11 10:16:47 2022 -0700 ASoC: SOF: IPC4: Add FW loader ops Define and add the FW loader ops for IPC4. Also, introduce a new structure, struct sof_ipc4_private_data that will be used to define some IPC4-sepcific data. Co-developed-by: Rander Wang Signed-off-by: Rander Wang Co-developed-by: Bard Liao Signed-off-by: Bard Liao Co-developed-by: Peter Ujfalusi Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220511171648.1622993-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 71cb8ad1a78043ca0eec1686bdd2e65143943b78 Author: Ranjani Sridharan Date: Wed May 11 10:16:46 2022 -0700 ASoC: SOF: Add header for IPC4 manifest Add the header for the IPC4 manifest. Co-developed-by: Rander Wang Signed-off-by: Rander Wang Co-developed-by: Bard Liao Signed-off-by: Bard Liao Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220511171648.1622993-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 0af829041d3f8e8f585f5692884d9c7402e7794d Author: Ranjani Sridharan Date: Wed May 11 10:16:45 2022 -0700 ASoC: SOF: Add IPC4 private header Add a struct sof_ipc4_fw_data to hold the firmware module data and manifest FW header offset. The FW reports data about the modules supported by the base FW in its manifest and the FW header offset is platform dependent information. This structure will be allocated when the ops are initialized for each platform and populated when the FW is loaded. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220511171648.1622993-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit e3105c0ccc3e706584030159b6fde54cab2f8aef Author: Ranjani Sridharan Date: Wed May 11 10:16:44 2022 -0700 ASoC: SOF: Intel: HDA: Set IPC4-specific DSP ops for CaVS platforms Add implementation of low level, platform dependent IPC4 message handling and set the DSP ops for IPC4 for APL, CNL and TGL platforms. Co-developed-by: Peter Ujfalusi Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220511171648.1622993-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 982c97eede13f3cb98c471c1b8fc5a12686ef85c Author: Colin Ian King Date: Wed May 11 11:44:48 2022 +0100 net: ethernet: SP7021: Fix spelling mistake "Interrput" -> "Interrupt" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220511104448.150800-1-colin.i.king@gmail.com Signed-off-by: Paolo Abeni commit 8b7a4075a5b5cc8d58a09c558d7c95e7befe77ee Merge: de2427207d13d c1ce4ba5021a9 Author: Mark Brown Date: Thu May 12 11:06:30 2022 +0100 ASOC: Fix the error handling code of the probe Merge series from Zheyu Ma : These drivers mishandle the regulator resource in the probe function, failing to disable the regulator for probing failure. commit 542350509499fed057a2a56921a383888a6f4fd3 Author: Daniel Kaehn Date: Mon May 9 09:59:33 2022 -0500 ALSA: Add generic serial MIDI driver using serial bus API Generic serial MIDI driver adding support for using serial devices compatible with the serial bus as raw MIDI devices, allowing using additional serial devices not compatible with the existing serial-u16550 driver. Supports only setting standard serial baudrates on the underlying serial device; however, the underlying serial device can be configured so that a requested 38.4 kBaud is actually the standard MIDI 31.25 kBaud. Supports DeviceTree configuration. Signed-off-by: Daniel Kaehn Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220509145933.1161526-3-kaehndan@gmail.com Signed-off-by: Takashi Iwai commit 1e5a74620922646f3ab5c3e90b1709fb51963614 Author: Daniel Kaehn Date: Mon May 9 09:59:32 2022 -0500 dt-bindings: sound: Add generic serial MIDI device Adds dt-binding for a Generic MIDI Interface using a serial device. Signed-off-by: Daniel Kaehn Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220509145933.1161526-2-kaehndan@gmail.com Signed-off-by: Takashi Iwai commit 6e7cf6702c6a6338b2116aae236cf3c9e1c07855 Author: Stefan Binding Date: Wed May 11 11:02:07 2022 +0100 ALSA: hda/cs8409: Add Speaker Playback Switch for Warlock Add support for a Speaker Playback Switch, which disables the Amp connected to cs8409. The Switch is not added automatically because cs8409 does not have an output amp for the speaker NID. Note: This switch uses a different GPIO to Cyborg/Odin variants Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20220511100207.1268321-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f129f26f76959fb09784c1d2d959a7c1d05201a3 Author: Stefan Binding Date: Wed May 11 11:02:06 2022 +0100 ALSA: hda/cs8409: Add Speaker Playback Switch for Cyborg Add support for a Speaker Playback Switch, which disables the Amp connected to cs8409. The Switch is not added automatically because cs8409 does not have an output amp for the speaker NID. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20220511100207.1268321-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 22bb82264c655ef297adf442cdc796849e5a2a8c Author: Stefan Binding Date: Wed May 11 11:02:05 2022 +0100 ALSA: hda/cs8409: Support new Odin Variants Odin Variants have the internal mic connected directly to the CPU rather than codec. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20220511100207.1268321-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b92d8a6e935fbd586397341ac1cb6762b041c6d5 Author: Yang Yingliang Date: Tue May 10 19:28:04 2022 +0800 USB: c67x00: remove unnecessary check of res The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220510112804.2401150-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 84db2ee2370332240a5e562779862b564fb9d49a Author: Piyush Mehta Date: Tue May 10 18:52:52 2022 +0530 usb: host: ehci-xilinx: Fix quoted string split across lines This patch resolves checkpatch warnings for xilinx EHCI driver. Addressed warnings: WARNING: quoted string split across lines 50: FILE: drivers/usb/host/ehci-xilinx-of.c:50: + "The USB host controller does not support full speed " + "nor low speed devices\n"); WARNING: quoted string split across lines 53: FILE: drivers/usb/host/ehci-xilinx-of.c:53: + "You can reconfigure the host controller to have " + "full speed support\n"); Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220510132252.26001-1-piyush.mehta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit d090c7a2ab84663185e4abda21d7d83880937c8a Author: Kushagra Verma Date: Wed May 11 21:19:36 2022 +0530 USB / dwc3: Fix a checkpatch warning in core.c This patch fixes the following checkpatch.pl warning in core.c: WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Kushagra Verma Link: https://lore.kernel.org/r/TYZPR01MB39354534E2F9EE4E022DDAFFF8C89@TYZPR01MB3935.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman commit 0f84d403b8e52c9c9bca52ac4f767c8f955e784d Author: Vladimir Oltean Date: Wed May 11 12:42:00 2022 +0300 net: enetc: kill PHY-less mode for PFs Right now, a PHY-less port (no phy-mode, no fixed-link, no phy-handle) doesn't register with phylink, but calls netif_carrier_on() from enetc_start(). This makes sense for a VF, but for a PF, this is braindead, because we never call enetc_mac_enable() so the MAC is left inoperational. Furthermore, commit 71b77a7a27a3 ("enetc: Migrate to PHYLINK and PCS_LYNX") put the nail in the coffin because it removed the initial netif_carrier_off() call done right after register_netdev(). Without that call, netif_carrier_on() does not call linkwatch_fire_event(), so the operstate remains IF_OPER_UNKNOWN. Just deny the broken configuration by requiring that a phy-mode is present, and always register a PF with phylink. Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220511094200.558502-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni commit 43213daed6d6cb60e8cf69058a6db8648a556d9d Author: Kees Cook Date: Tue May 10 19:53:01 2022 -0700 fortify: Provide a memcpy trap door for sharp corners As we continue to narrow the scope of what the FORTIFY memcpy() will accept and build alternative APIs that give the compiler appropriate visibility into more complex memcpy scenarios, there is a need for "unfortified" memcpy use in rare cases where combinations of compiler behaviors, source code layout, etc, result in cases where the stricter memcpy checks need to be bypassed until appropriate solutions can be developed (i.e. fix compiler bugs, code refactoring, new API, etc). The intention is for this to be used only if there's no other reasonable solution, for its use to include a justification that can be used to assess future solutions, and for it to be temporary. Example usage included, based on analysis and discussion from: https://lore.kernel.org/netdev/CANn89iLS_2cshtuXPyNUGDPaic=sJiYfvTb_wNLgWrZRyBxZ_g@mail.gmail.com Cc: Jakub Kicinski Cc: Eric Dumazet Cc: "David S. Miller" Cc: Paolo Abeni Cc: Coco Li Cc: Tariq Toukan Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: netdev@vger.kernel.org Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220511025301.3636666-1-keescook@chromium.org Signed-off-by: Paolo Abeni commit e1bbcd277a53e08d619ffeec56c5c9287f2bf42f Author: Christian Brauner Date: Tue May 10 11:58:40 2022 +0200 fs: hold writers when changing mount's idmapping Hold writers when changing a mount's idmapping to make it more robust. The vfs layer takes care to retrieve the idmapping of a mount once ensuring that the idmapping used for vfs permission checking is identical to the idmapping passed down to the filesystem. For ioctl codepaths the filesystem itself is responsible for taking the idmapping into account if they need to. While all filesystems with FS_ALLOW_IDMAP raised take the same precautions as the vfs we should enforce it explicitly by making sure there are no active writers on the relevant mount while changing the idmapping. This is similar to turning a mount ro with the difference that in contrast to turning a mount ro changing the idmapping can only ever be done once while a mount can transition between ro and rw as much as it wants. This is a minor user-visible change. But it is extremely unlikely to matter. The caller must've created a detached mount via OPEN_TREE_CLONE and then handed that O_PATH fd to another process or thread which then must've gotten a writable fd for that mount and started creating files in there while the caller is still changing mount properties. While not impossible it will be an extremely rare corner-case and should in general be considered a bug in the application. Consider making a mount MOUNT_ATTR_NOEXEC or MOUNT_ATTR_NODEV while allowing someone else to perform lookups or exec'ing in parallel by handing them a copy of the OPEN_TREE_CLONE fd or another fd beneath that mount. Link: https://lore.kernel.org/r/20220510095840.152264-1-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner (Microsoft) commit f611af4c3bfa26fc827b8074d288a3ce686916f2 Author: Claudiu Beznea Date: Mon May 9 10:26:05 2022 +0300 ARM: at91: Kconfig: implement PIT64B selection Implement PIT64B selection thus it will be available for the necessary targets (at the moment SAM9X60 and SAMA7G5) w/o the necessity to specify it via defconfig. With this the current CONFIG_TIMER_OF dependency of PIT64B driver could be removed. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit b7fc72c63399925175368d378b1513d86f15d83b Author: Claudiu Beznea Date: Fri May 6 11:23:35 2022 +0300 ARM: at91: pm: add quirks for pm SoCs supporting ULP0 or ULP1 modes and variants of Cadence Ethernet IP (controlled by macb driver) may behave buggy when Wake-on-Lan (WoL) is configured and WoL packet is received while in ULP0/ULP1. On some SoCs Ethernet interface is not working after resume. On other SoCs the CPU goes to abort on resume path when switching execution from internal SRAM to DRAM. For ULP1 + WoL the issue is related a particular restart sequence of the internal clocks when resuming. These clocks are automatically managed by PMC and may happen that GMAC peripheral clock is restarted few clock cycles before internal clocks causing blocking of Ethernet's DMA. As a consequence Ethernet TX transactions are stopped and RX transactions are partially stopped (packets are received by MAC, RX counters incremented but the data is not transferred to DRAM). The workaround for this is to disable Ethernet's peripheral clock when going to ULP1. Same behavior has been reproduced on ULP0 for some platforms (SAMA5D2, SAMA5D3) and the same workaround solves the issue. The problem has been solved on pm.c as quirk to avoid polluting the MACB driver with AT91 specific issues as this driver is generic to multiple vendors. At probe pointers to struct device_node are retrieved and on the at91_pm_enter() the quirk specifics are applied: for all Ethernet interfaces that were parsed the peripheral clocks are disabled. A special handling is done for modes in dns_modes mask as these are considered modes that blocks the system if WoL packet are received but for which applying quirk will lead to not waking up on WoL packets: in situation where Ethernet interface(s) has suspend mode in dns_modes mask and Ethernet interface(s) is the only available wakeup source the suspend is canceled. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit 9750d3b4d2a5d12f955d497a8ecc2a6b5edb24d5 Author: Claudiu Beznea Date: Fri May 6 11:23:34 2022 +0300 ARM: at91: pm: use kernel documentation style Use kernel documentation style. Along with it fix the naming of struct at91_pm_sfrbu_regs in documentation. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit b568c71de798d26e71164f08f179c86cd231d577 Author: Claudiu Beznea Date: Fri May 6 11:23:33 2022 +0300 ARM: at91: pm: introduce macros for pm mode replacement Introduce macros to replace standby/suspend mode if they depends on controllers that failed to map (or other errors). Macros keep track of the complementary mode to avoid having set the same AT91 PM mode for both suspend and standby. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit 22cbf0776d396899f3a651b79af0bc50fc299cfb Author: Claudiu Beznea Date: Fri May 6 11:23:32 2022 +0300 ARM: at91: pm: keep documentation inline with structure members Move documentation of bu to keep the same order as in the structure itself. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre commit c7c99a09ef0e2615d13e13b19c74428ca43b7dcf Author: Gil Fine Date: Mon May 9 23:49:04 2022 +0300 thunderbolt: Add KUnit test for devices with no DisplayPort adapters Add a KUnit test to check that buffer allocation works also for devices with no DP adapters. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 93bf344f66995ef816bd63c165fa9ac1ea4fcb3d Author: Gil Fine Date: Mon May 9 23:49:03 2022 +0300 thunderbolt: Fix buffer allocation of devices with no DisplayPort adapters For the case of a device without DisplayPort adapters we calculate incorrectly the amount of buffers. Fix the calculation for this case. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit d2b8060f165105a68748a6d98ed548ca112ce4d3 Author: Kees Cook Date: Wed May 11 22:46:09 2022 -0700 lkdtm/usercopy: Rename "heap" to "slab" To more clearly distinguish between the various heap types, rename the slab tests to "slab". Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook commit efd409a4329f6927795be5ae080cd3ec8c014f49 Merge: 45ff8b471cdc5 5349b2afc117d Author: Dave Chinner Date: Thu May 12 15:23:07 2022 +1000 Merge branch 'xfs-5.19-quota-warn-remove' into xfs-5.19-for-next commit 45ff8b471cdc58701a7ba5c5dcd8dfc57ae06829 Author: Dave Chinner Date: Thu May 12 15:12:57 2022 +1000 xfs: can't use kmem_zalloc() for attribute buffers Because heap allocation of 64kB buffers will fail: .... XFS: fs_mark(8414) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8417) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8409) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8428) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8430) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8437) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8433) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8406) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8412) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8432) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) XFS: fs_mark(8424) possible memory allocation deadlock size 65768 in kmem_alloc (mode:0x2d40) .... I'd use kvmalloc() instead, but.... - 48.19% xfs_attr_create_intent - 46.89% xfs_attri_init - kvmalloc_node - 46.04% __kmalloc_node - kmalloc_large_node - 45.99% __alloc_pages - 39.39% __alloc_pages_slowpath.constprop.0 - 38.89% __alloc_pages_direct_compact - 38.71% try_to_compact_pages - compact_zone_order - compact_zone - 21.09% isolate_migratepages_block 10.31% PageHuge 5.82% set_pfnblock_flags_mask 0.86% get_pfnblock_flags_mask - 4.48% __reset_isolation_suitable 4.44% __reset_isolation_pfn - 3.56% __pageblock_pfn_to_page 1.33% pfn_to_online_page 2.83% get_pfnblock_flags_mask - 0.87% migrate_pages 0.86% compaction_alloc 0.84% find_suitable_fallback - 6.60% get_page_from_freelist 4.99% clear_page_erms - 1.19% _raw_spin_lock_irqsave - do_raw_spin_lock __pv_queued_spin_lock_slowpath - 0.86% __vmalloc_node_range 0.65% __alloc_pages_bulk .... this is just yet another reminder of how much kvmalloc() sucks. So lift xlog_cil_kvmalloc(), rename it to xlog_kvmalloc() and use that instead.... We also clean up the attribute name and value lengths as they no longer need to be rounded out to sizes compatible with log vectors. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 51e6104fdb95f377c8741794778319bd413f4fff Author: Dave Chinner Date: Thu May 12 15:12:57 2022 +1000 xfs: detect empty attr leaf blocks in xfs_attr3_leaf_verify xfs_repair flags these as a corruption error, so the verifier should catch software bugs that result in empty leaf blocks being written to disk, too. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit fdaf1bb3cafcfee9ef05c4eaf6ee1193fd90cbd2 Author: Dave Chinner Date: Thu May 12 15:12:56 2022 +1000 xfs: ATTR_REPLACE algorithm with LARP enabled needs rework We can't use the same algorithm for replacing an existing attribute when logging attributes. The existing algorithm is essentially: 1. create new attr w/ INCOMPLETE 2. atomically flip INCOMPLETE flags between old + new attribute 3. remove old attr which is marked w/ INCOMPLETE This algorithm guarantees that we see either the old or new attribute, and if we fail after the atomic flag flip, we don't have to recover the removal of the old attr because we never see INCOMPLETE attributes in lookups. For logged attributes, however, this does not work. The logged attribute intents do not track the work that has been done as the transaction rolls, and hence the only recovery mechanism we have is "run the replace operation from scratch". This is further exacerbated by the attempt to avoid needing the INCOMPLETE flag to create an atomic swap. This means we can create a second active attribute of the same name before we remove the original. If we fail at any point after the create but before the removal has completed, we end up with duplicate attributes in the attr btree and recovery only tries to replace one of them. There are several other failure modes where we can leave partially allocated remote attributes that expose stale data, partially free remote attributes that enable UAF based stale data exposure, etc. TO fix this, we need a different algorithm for replace operations when LARP is enabled. Luckily, it's not that complex if we take the right first step. That is, the first thing we log is the attri intent with the new name/value pair and mark the old attr as INCOMPLETE in the same transaction. From there, we then remove the old attr and keep relogging the new name/value in the intent, such that we always know that we have to create the new attr in recovery. Once the old attr is removed, we then run a normal ATTR_CREATE operation relogging the intent as we go. If the new attr is local, then it gets created in a single atomic transaction that also logs the final intent done. If the new attr is remote, the we set INCOMPLETE on the new attr while we allocate and set the remote value, and then we clear the INCOMPLETE flag at in the last transaction taht logs the final intent done. If we fail at any point in this algorithm, log recovery will always see the same state on disk: the new name/value in the intent, and either an INCOMPLETE attr or no attr in the attr btree. If we find an INCOMPLETE attr, we run the full replace starting with removing the INCOMPLETE attr. If we don't find it, then we simply create the new attr. Notably, recovery of a failed create that has an INCOMPLETE flag set is now the same - we start with the lookup of the INCOMPLETE attr, and if that exists then we do the full replace recovery process, otherwise we just create the new attr. Hence changing the way we do the replace operation when LARP is enabled allows us to use the same log recovery algorithm for both the ATTR_CREATE and ATTR_REPLACE operations. This is also the same algorithm we use for runtime ATTR_REPLACE operations (except for the step setting up the initial conditions). The result is that: - ATTR_CREATE uses the same algorithm regardless of whether LARP is enabled or not - ATTR_REPLACE with larp=0 is identical to the old algorithm - ATTR_REPLACE with larp=1 runs an unmodified attr removal algorithm from the larp=0 code and then runs the unmodified ATTR_CREATE code. - log recovery when larp=1 runs the same ATTR_REPLACE algorithm as it uses at runtime. Because the state machine is now quite clean, changing the algorithm is really just a case of changing the initial state and how the states link together for the ATTR_REPLACE case. Hence it's not a huge amount of code for what is a fairly substantial rework of the attr logging and recovery algorithm.... Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit e7f358dee4e5cf1ce8b11ff2e65d5ccb1ced24db Author: Dave Chinner Date: Thu May 12 15:12:56 2022 +1000 xfs: use XFS_DA_OP flags in deferred attr ops We currently store the high level attr operation in args->attr_flags. This field contains what the VFS is telling us to do, but don't necessarily match what we are doing in the low level modification state machine. e.g. XATTR_REPLACE implies both XFS_DA_OP_ADDNAME and XFS_DA_OP_RENAME because it is doing both a remove and adding a new attr. However, deep in the individual state machine operations, we check errors against this high level VFS op flags, not the low level XFS_DA_OP flags. Indeed, we don't even have a low level flag for a REMOVE operation, so the only way we know we are doing a remove is the complete absence of XATTR_REPLACE, XATTR_CREATE, XFS_DA_OP_ADDNAME and XFS_DA_OP_RENAME. And because there are other flags in these fields, this is a pain to check if we need to. As the XFS_DA_OP flags are only needed once the deferred operations are set up, set these flags appropriately when we set the initial operation state. We also introduce a XFS_DA_OP_REMOVE flag to make it easy to know that we are doing a remove operation. With these, we can remove the use of XATTR_REPLACE and XATTR_CREATE in low level lookup operations, and manipulate the low level flags according to the low level context that is operating. e.g. log recovery does not have a VFS xattr operation state to copy into args->attr_flags, and the low level state machine ops we do for recovery do not match the high level VFS operations that were in progress when the system failed... Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 59782a236b622a983ff101b2cb1333f714e4ed4e Author: Dave Chinner Date: Thu May 12 15:12:56 2022 +1000 xfs: remove xfs_attri_remove_iter xfs_attri_remove_iter is not used anymore, so remove it and all the infrastructure it uses and is needed to drive it. THe xfs_attr_refillstate() function now throws an unused warning, so isolate the xfs_attr_fillstate()/xfs_attr_refillstate() code pair with an #if 0 and a comment explaining why we want to keep this code and restore the optimisation it provides in the near future. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 4b9879b19cafa63ae02fef30f678b2179a648d45 Author: Dave Chinner Date: Thu May 12 15:12:56 2022 +1000 xfs: switch attr remove to xfs_attri_set_iter Now that xfs_attri_set_iter() has initial states for removing attributes, switch the pure attribute removal code over to using it. This requires attrs being removed to always be marked as INCOMPLETE before we start the removal due to the fact we look up the attr to remove again in xfs_attr_node_remove_attr(). Note: this drops the fillstate/refillstate optimisations from the remove path that avoid having to look up the path again after setting the incomplete flag and removing remote attrs. Restoring that optimisation to this path is future Dave's problem. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit e5d5596a2a1790d8c57938f820aa33e58f90ad0d Author: Dave Chinner Date: Thu May 12 15:12:56 2022 +1000 xfs: introduce attr remove initial states into xfs_attr_set_iter We need to merge the add and remove code paths to enable safe recovery of replace operations. Hoist the initial remove states from xfs_attr_remove_iter into xfs_attr_set_iter. We will make use of them in the next patches. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 4e3d96a57a06f20f4ce04a92422cc100251f346d Author: Dave Chinner Date: Thu May 12 15:12:55 2022 +1000 xfs: xfs_attr_set_iter() does not need to return EAGAIN Now that the full xfs_attr_set_iter() state machine always terminates with either the state being XFS_DAS_DONE on success or an error on failure, we can get rid of the need for it to return -EAGAIN whenever it needs to roll the transaction before running the next state. That is, we don't need to spray -EAGAIN return states everywhere, the caller just check the state machine state for completion to determine what action should be taken next. This greatly simplifies the code within the state machine implementation as it now only has to handle 0 for success or -errno for error and it doesn't need to tell the caller to retry. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit b11fa61bc4c679172a35e48d149f797ee37db3fc Author: Dave Chinner Date: Thu May 12 15:12:55 2022 +1000 xfs: clean up final attr removal in xfs_attr_set_iter Clean up the final leaf/node states in xfs_attr_set_iter() to further simplify the high level state machine and to set the completion state correctly. As we are adding a separate state for node format removal, we need to ensure that node formats are collapsed back to shortform or empty correctly. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 2e7ef218e489f5b3f5156a305b55a08c41839c1b Author: Dave Chinner Date: Thu May 12 15:12:55 2022 +1000 xfs: remote xattr removal in xfs_attr_set_iter() is conditional We may not have a remote value for the old xattr we have to remove, so skip over the remote value removal states and go straight to the xattr name removal in the leaf/node block. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 411b434a63248ecff58aaf498b09eaf3b3f52f90 Author: Dave Chinner Date: Thu May 12 15:12:55 2022 +1000 xfs: XFS_DAS_LEAF_REPLACE state only needed if !LARP We can skip the REPLACE state when LARP is enabled, but that means the XFS_DAS_FLIP_LFLAG state is now poorly named - it indicates something that has been done rather than what the state is going to do. Rename it to "REMOVE_OLD" to indicate that we are now going to perform removal of the old attr. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 7d03533629d1c3fca395e6fd0935ca1de676f2bc Author: Dave Chinner Date: Thu May 12 15:12:55 2022 +1000 xfs: split remote attr setting out from replace path When we set a new xattr, we have three exit paths: 1. nothing else to do 2. allocate and set the remote xattr value 3. perform the rest of a replace operation Currently we push both 2 and 3 into the same state, regardless of whether we just set a remote attribute or not. Once we've set the remote xattr, we have two exit states: 1. nothing else to do 2. perform the rest of a replace operation Hence we can split the remote xattr allocation and setting into their own states and factor it out of xfs_attr_set_iter() to further clean up the state machine and the implementation of the state machine. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 251b29c88eb84922e916ed4685f50db741aeb0af Author: Dave Chinner Date: Thu May 12 15:12:54 2022 +1000 xfs: consolidate leaf/node states in xfs_attr_set_iter The operations performed from XFS_DAS_FOUND_LBLK through to XFS_DAS_RM_LBLK are now identical to XFS_DAS_FOUND_NBLK through to XFS_DAS_RM_NBLK. We can collapse these down into a single set of code. To do this, define the states that leaf and node run through as separate sets of sequential states. Then as we move to the next state, we can use increments rather than specific state assignments to move through the states. This means the state progression is set by the initial state that enters the series and we don't need to duplicate the code anymore. At the exit point of the series we need to select the correct leaf or node state, but that can also be done by state increment rather than assignment. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 2157d1699e59819c8a31ba3e47008e4145d854a9 Author: Dave Chinner Date: Thu May 12 15:12:54 2022 +1000 xfs: kill XFS_DAC_LEAF_ADDNAME_INIT We re-enter the XFS_DAS_FOUND_LBLK state when we have to allocate multiple extents for a remote xattr. We currently have a flag called XFS_DAC_LEAF_ADDNAME_INIT to avoid running the remote attr hole finding code more than once. However, for the node format tree, we have a separate state for this so we never reenter the state machine at XFS_DAS_FOUND_NBLK and so it does not need a special flag to skip over the remote attr hold finding code. Convert the leaf block code to use the same state machine as the node blocks and kill the XFS_DAC_LEAF_ADDNAME_INIT flag. This further points out that this "ALLOC" state is only traversed if we have remote xattrs or we are doing a rename operation. Rename both the leaf and node alloc states to _ALLOC_RMT to indicate they are iterating to do allocation of remote xattr blocks. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit e0c41089b998f5a54dabd7a34ab24108e192d2ee Author: Dave Chinner Date: Thu May 12 15:12:52 2022 +1000 xfs: separate out initial attr_set states We current use XFS_DAS_UNINIT for several steps in the attr_set state machine. We use it for setting shortform xattrs, converting from shortform to leaf, leaf add, leaf-to-node and leaf add. All of these things are essentially known before we start the state machine iterating, so we really should separate them out: XFS_DAS_SF_ADD: - tries to do a shortform add - on success -> done - on ENOSPC converts to leaf, -> XFS_DAS_LEAF_ADD - on error, dies. XFS_DAS_LEAF_ADD: - tries to do leaf add - on success: - inline attr -> done - remote xattr || REPLACE -> XFS_DAS_FOUND_LBLK - on ENOSPC converts to node, -> XFS_DAS_NODE_ADD - on error, dies XFS_DAS_NODE_ADD: - tries to do node add - on success: - inline attr -> done - remote xattr || REPLACE -> XFS_DAS_FOUND_NBLK - on error, dies This makes it easier to understand how the state machine starts up and sets us up on the path to further state machine simplifications. This also converts the DAS state tracepoints to use strings rather than numbers, as converting between enums and numbers requires manual counting rather than just reading the name. This also introduces a XFS_DAS_DONE state so that we can trace successful operation completions easily. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 39b360102f3ac6b12cafac9db25762071eb0418c Author: Jia-Wei Chang Date: Thu May 5 19:52:23 2022 +0800 cpufreq: mediatek: Add support for MT8186 The platform data of MT8186 is different from previous MediaTek SoCs, so we add a new compatible and platform data for it. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 0daa47325baee6bb1412498462fd0a0477c32cc6 Author: Rex-BC Chen Date: Thu May 5 19:52:22 2022 +0800 cpufreq: mediatek: Link CCI device to CPU In some MediaTek SoCs, like MT8183, CPU and CCI share the same power supplies. Cpufreq needs to check if CCI devfreq exists and wait until CCI devfreq ready before scaling frequency. Before CCI devfreq is ready, we record the voltage when booting to kernel and use the max(cpu target voltage, booting voltage) to prevent cpufreq adjust to the lower voltage which will cause the CCI crash because of high frequency and low voltage. - Add is_ccifreq_ready() to link CCI device to CPI, and CPU will start DVFS when CCI is ready. - Add platform data for MT8183. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Kevin Hilman Signed-off-by: Viresh Kumar commit 818c8321d8def50971188b8b33ef2a43ca1e2511 Author: Rex-BC Chen Date: Thu May 5 19:52:17 2022 +0800 dt-bindings: cpufreq: mediatek: Add MediaTek CCI property MediaTek Cache Coherent Interconnect (CCI) uses software devfreq module for scaling clock frequency and adjust voltage. The phandle could be linked between CPU and MediaTek CCI for some MediaTek SoCs, like MT8183 and MT8186. The reason we need the link status between cpufreq and MediaTek cci is cpufreq and mediatek cci could share the same regulator in some MediaTek SoCs. Therefore, to prevent the issue of high frequency and low voltage, we need to use this to make sure mediatek cci is ready. Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Signed-off-by: Viresh Kumar commit a35707c3d850dda0ceefb75b1b3bd191921d5765 Author: Heiko Stuebner Date: Wed May 11 21:29:21 2022 +0200 riscv: add memory-type errata for T-Head Some current cpus based on T-Head cores implement memory-types way different than described in the svpbmt spec even going so far as using PTE bits marked as reserved. Add the T-Head vendor-id and necessary errata code to replace the affected instructions. Signed-off-by: Heiko Stuebner Tested-by: Samuel Holland Link: https://lore.kernel.org/r/20220511192921.2223629-13-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit 1745cfafebdfb017f6871c80f9894910a76373a4 Author: Heiko Stuebner Date: Wed May 11 21:29:20 2022 +0200 riscv: don't use global static vars to store alternative data Right now the code uses a global struct to store vendor-ids and another global variable to store the vendor-patch-function. There exist specific cases where we'll need to patch the kernel at an even earlier stage, where trying to write to a static variable might actually result in hangs. Also collecting the vendor-information consists of 3 sbi-ecalls (or csr-reads) which is pretty negligible in the context of booting a kernel. So rework the code to not rely on static variables and instead collect the vendor-information when a round of alternatives is to be applied. Signed-off-by: Heiko Stuebner Reviewed-by: Guo Ren Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-12-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e1026505c1a9c5abd61f6afdf396b9cf467834c7 Author: Heiko Stuebner Date: Wed May 11 21:29:19 2022 +0200 riscv: remove FIXMAP_PAGE_IO and fall back to its default value If not defined in the arch, FIXMAP_PAGE_IO defaults to PAGE_KERNEL_IO, which we defined when adding the svpbmt implementation. So drop the FIXMAP_PAGE_IO riscv define. Signed-off-by: Heiko Stuebner Reviewed-by: Christoph Hellwig Reviewed-by: Philipp Tomsich Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220511192921.2223629-11-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit ff689fd21cb13098305bae3f8d0c0065df2e2fc1 Author: Heiko Stuebner Date: Wed May 11 21:29:18 2022 +0200 riscv: add RISC-V Svpbmt extension support Svpbmt (the S should be capitalized) is the "Supervisor-mode: page-based memory types" extension that specifies attributes for cacheability, idempotency and ordering. The relevant settings are done in special bits in PTEs: Here is the svpbmt PTE format: | 63 | 62-61 | 60-8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 N MT RSW D A G U X W R V ^ Of the Reserved bits [63:54] in a leaf PTE, the high bit is already allocated (as the N bit), so bits [62:61] are used as the MT (aka MemType) field. This field specifies one of three memory types that are close equivalents (or equivalent in effect) to the three main x86 and ARMv8 memory types - as shown in the following table. RISC-V Encoding & MemType RISC-V Description ---------- ------------------------------------------------ 00 - PMA Normal Cacheable, No change to implied PMA memory type 01 - NC Non-cacheable, idempotent, weakly-ordered Main Memory 10 - IO Non-cacheable, non-idempotent, strongly-ordered I/O memory 11 - Rsvd Reserved for future standard use As the extension will not be present on all implementations, implement a method to handle cpufeatures via alternatives to not incur runtime penalties on cpu variants not supporting specific extensions and patch relevant code parts at runtime. Co-developed-by: Wei Fu Signed-off-by: Wei Fu Co-developed-by: Liu Shaohua Signed-off-by: Liu Shaohua Co-developed-by: Guo Ren Signed-off-by: Guo Ren [moved to use the alternatives mechanism] Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-10-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit 100631b48ded73fcd8fdd7e17139cda92dfbfb79 Author: Heiko Stuebner Date: Wed May 11 21:29:17 2022 +0200 riscv: Fix accessing pfn bits in PTEs for non-32bit variants On rv32 the PFN part of PTEs is defined to use bits [xlen-1:10] while on rv64 it is defined to use bits [53:10], leaving [63:54] as reserved. With upcoming optional extensions like svpbmt these previously reserved bits will get used so simply right-shifting the PTE to get the PFN won't be enough. So introduce a _PAGE_PFN_MASK constant to mask the correct bits for both rv32 and rv64 before shifting. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-9-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit ffb0b0afbd7c2608b6608d693569f0e726efd26b Author: Heiko Stuebner Date: Wed May 11 21:29:16 2022 +0200 riscv: move boot alternatives to after fill_hwcap Move the application of boot alternatives to after the hw-capabilities are populated. This allows to check for available extensions when determining which alternatives to apply and also makes it actually work if CONFIG_SMP is disabled for whatever reason. Signed-off-by: Heiko Stuebner Reviewed-by: Christoph Hellwig Reviewed-by: Philipp Tomsich Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20220511192921.2223629-8-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit 49b290e430d390bacf7d3792d5654fa4b3212926 Author: Heiko Stuebner Date: Wed May 11 21:29:15 2022 +0200 riscv: prevent compressed instructions in alternatives Instructions are opportunistically compressed by the RISC-V assembler when possible, but in alternatives-blocks both the old and new content need to be the same size, so having the toolchain do somewhat random optimizations will cause strange side-effects like "attempt to move .org backwards" compile-time errors. Already a simple "and" used in alternatives assembly will cause these mismatched code sizes. So prevent compressed instructions to be generated in alternatives- code and use option-push and -pop to only limit this to the relevant code blocks Signed-off-by: Heiko Stuebner Reviewed-by: Christoph Hellwig Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-7-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e509204acb03785719cda632758b7ac6cd351e28 Author: Heiko Stuebner Date: Wed May 11 21:29:14 2022 +0200 riscv: extend concatenated alternatives-lines to the same length ALT_NEW_CONTENT already uses same-length assembler lines, so extend this to the other elements as well. This makes it more readable when these elements need to be extended in the future. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-6-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit fbdba60b8119f60887974dd3d7adb537d71c18b4 Author: Heiko Stuebner Date: Wed May 11 21:29:13 2022 +0200 riscv: implement ALTERNATIVE_2 macro When the alternatives were added the commit already provided a template on how to implement 2 different alternatives for one piece of code. Make this usable. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-5-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit a8e910168bbad5c901202727470e601eb2489ec1 Author: Heiko Stuebner Date: Wed May 11 21:29:12 2022 +0200 riscv: implement module alternatives This allows alternatives to also be applied when loading modules and follows the implementation of other architectures (e.g. arm64). Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-4-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit d14ca1f8d3039970e812fec1f01e7b46b62cc5fc Author: Heiko Stuebner Date: Wed May 11 21:29:11 2022 +0200 riscv: allow different stages with alternatives Future features may need to be applied at a different time during boot, so allow defining stages for alternatives and handling them differently depending on the stage. Also make the alternatives-location more flexible so that future stages may provide their own location. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-3-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit e64f737ad70fee4a3c57d147fc511e5d5014b5dd Author: Heiko Stuebner Date: Wed May 11 21:29:10 2022 +0200 riscv: integrate alternatives better into the main architecture Right now the alternatives need to be explicitly enabled and erratas are limited to SiFive ones. We want to use alternatives not only for patching soc erratas, but in the future also for handling different behaviour depending on the existence of future extensions. So move the core alternatives over to the kernel subdirectory and move the CONFIG_RISCV_ALTERNATIVE to be a hidden symbol which we expect relevant erratas and extensions to just select if needed. Signed-off-by: Heiko Stuebner Reviewed-by: Philipp Tomsich Link: https://lore.kernel.org/r/20220511192921.2223629-2-heiko@sntech.de Signed-off-by: Palmer Dabbelt commit a2aa95b71c9bbec793b5c5fa50f0a80d882b3e8d Author: Yuntao Wang Date: Sat Apr 30 21:08:03 2022 +0800 bpf: Fix potential array overflow in bpf_trampoline_get_progs() The cnt value in the 'cnt >= BPF_MAX_TRAMP_PROGS' check does not include BPF_TRAMP_MODIFY_RETURN bpf programs, so the number of the attached BPF_TRAMP_MODIFY_RETURN bpf programs in a trampoline can exceed BPF_MAX_TRAMP_PROGS. When this happens, the assignment '*progs++ = aux->prog' in bpf_trampoline_get_progs() will cause progs array overflow as the progs field in the bpf_tramp_progs struct can only hold at most BPF_MAX_TRAMP_PROGS bpf programs. Fixes: 88fd9e5352fe ("bpf: Refactor trampoline update code") Signed-off-by: Yuntao Wang Link: https://lore.kernel.org/r/20220430130803.210624-1-ytcoode@gmail.com Signed-off-by: Alexei Starovoitov commit 5790a2fee02c48e28fde2ce7ea4765eeadcda0ba Author: Andrii Nakryiko Date: Wed May 11 16:20:12 2022 -0700 selftests/bpf: make fexit_stress test run in serial mode fexit_stress is attaching maximum allowed amount of fexit programs to bpf_fentry_test1 kernel function, which is used by a bunch of other parallel tests, thus pretty frequently interfering with their execution. Given the test assumes nothing else is attaching to bpf_fentry_test1, mark it serial. Suggested-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20220511232012.609370-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 0bed8f374a9981d94c6b03376925419ef588f44a Merge: 571b8739dd6df ed7c13776e20c Author: Alexei Starovoitov Date: Wed May 11 18:16:55 2022 -0700 Merge branch 'Introduce access remote cpu elem support in BPF percpu map' Feng zhou says: ==================== From: Feng Zhou Trace some functions, such as enqueue_task_fair, need to access the corresponding cpu, not the current cpu, and bpf_map_lookup_elem percpu map cannot do it. So add bpf_map_lookup_percpu_elem to accomplish it for percpu_array_map, percpu_hash_map, lru_percpu_hash_map. v1->v2: Addressed comments from Alexei Starovoitov. - add a selftest for bpf_map_lookup_percpu_elem. ==================== Signed-off-by: Alexei Starovoitov commit ed7c13776e20c74486b0939a3c1de984c5efb6aa Author: Feng Zhou Date: Wed May 11 17:38:54 2022 +0800 selftests/bpf: add test case for bpf_map_lookup_percpu_elem test_progs: Tests new ebpf helpers bpf_map_lookup_percpu_elem. Signed-off-by: Feng Zhou Link: https://lore.kernel.org/r/20220511093854.411-3-zhoufeng.zf@bytedance.com Signed-off-by: Alexei Starovoitov commit 07343110b293456d30393e89b86c4dee1ac051c8 Author: Feng Zhou Date: Wed May 11 17:38:53 2022 +0800 bpf: add bpf_map_lookup_percpu_elem for percpu map Add new ebpf helpers bpf_map_lookup_percpu_elem. The implementation method is relatively simple, refer to the implementation method of map_lookup_elem of percpu map, increase the parameters of cpu, and obtain it according to the specified cpu. Signed-off-by: Feng Zhou Link: https://lore.kernel.org/r/20220511093854.411-2-zhoufeng.zf@bytedance.com Signed-off-by: Alexei Starovoitov commit 571b8739dd6df6d41bdcc83ed50b481a27af912c Merge: fd0ad6f1d10c0 0ef6740e97777 Author: Alexei Starovoitov Date: Wed May 11 16:57:27 2022 -0700 Merge branch 'Follow ups for kptr series' Kumar Kartikeya Dwivedi says: ==================== Fix a build time warning, and address comments from Alexei on the merged version [0]. [0]: https://lore.kernel.org/bpf/20220424214901.2743946-1-memxor@gmail.com Changelog: ---------- v1 -> v2 v1: https://lore.kernel.org/bpf/20220510211727.575686-1-memxor@gmail.com * Add Fixes tag to patch 1 * Fix test_progs-noalu32 failure in CI due to different alloc_insn (Alexei) * Remove per-CPU struct, use global struct (Alexei) ==================== Signed-off-by: Alexei Starovoitov commit 0ef6740e97777bbe04aeacd32239ccb1732098d7 Author: Kumar Kartikeya Dwivedi Date: Thu May 12 01:16:54 2022 +0530 selftests/bpf: Add tests for kptr_ref refcounting Check at runtime how various operations for kptr_ref affect its refcount and verify against the actual count. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220511194654.765705-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 04accf794bb2a5a06f23f7d48d195ffa329181a6 Author: Kumar Kartikeya Dwivedi Date: Thu May 12 01:16:53 2022 +0530 selftests/bpf: Add negative C tests for kptrs This uses the newly added SEC("?foo") naming to disable autoload of programs, and then loads them one by one for the object and verifies that loading fails and matches the returned error string from verifier. This is similar to already existing verifier tests but provides coverage for BPF C. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220511194654.765705-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 5cdccadcac2612f947ebc26ad7023dfb7e8871f9 Author: Kumar Kartikeya Dwivedi Date: Thu May 12 01:16:52 2022 +0530 bpf: Prepare prog_test_struct kfuncs for runtime tests In an effort to actually test the refcounting logic at runtime, add a refcount_t member to prog_test_ref_kfunc and use it in selftests to verify and test the whole logic more exhaustively. The kfunc calls for prog_test_member do not require runtime refcounting, as they are only used for verifier selftests, not during runtime execution. Hence, their implementation now has a WARN_ON_ONCE as it is not meant to be reachable code at runtime. It is strictly used in tests triggering failure cases in the verifier. bpf_kfunc_call_memb_release is called from map free path, since prog_test_member is embedded in map value for some verifier tests, so we skip WARN_ON_ONCE for it. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220511194654.765705-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 5b74c690e1c55953ec99fd9dab74f72dbee4fe95 Author: Kumar Kartikeya Dwivedi Date: Thu May 12 01:16:51 2022 +0530 bpf: Fix sparse warning for bpf_kptr_xchg_proto Kernel Test Robot complained about missing static storage class annotation for bpf_kptr_xchg_proto variable. sparse: symbol 'bpf_kptr_xchg_proto' was not declared. Should it be static? This caused by missing extern definition in the header. Add it to suppress the sparse warning. Fixes: c0a5a21c25f3 ("bpf: Allow storing referenced kptr in map") Reported-by: kernel test robot Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220511194654.765705-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit bb709987f1043e23fce907cddedde5d8e495e76b Merge: d7722973a1923 285e8dedb4bd6 Author: Jakub Kicinski Date: Wed May 11 16:37:12 2022 -0700 Merge branch 'count-tc-taprio-window-drops-in-enetc-driver' Vladimir Oltean says: ==================== Count tc-taprio window drops in enetc driver This series includes a patch from Po Liu (no longer with NXP) which counts frames dropped by the tc-taprio offload in ethtool -S and in ndo_get_stats64. It also contains a preparation patch from myself. ==================== Link: https://lore.kernel.org/r/20220510163615.6096-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 285e8dedb4bd62bb608a27eff8adabff7b2c82e3 Author: Po Liu Date: Tue May 10 19:36:15 2022 +0300 net: enetc: count the tc-taprio window drops The enetc scheduler for IEEE 802.1Qbv has 2 options (depending on PTGCR[TG_DROP_DISABLE]) when we attempt to send an oversized packet which will never fit in its allotted time slot for its traffic class: either block the entire port due to head-of-line blocking, or drop the packet and set a bit in the writeback format of the transmit buffer descriptor, allowing other packets to be sent. We obviously choose the second option in the driver, but we do not detect the drop condition, so from the perspective of the network stack, the packet is sent and no error counter is incremented. This change checks the writeback of the TX BD when tc-taprio is enabled, and increments a specific ethtool statistics counter and a generic "tx_dropped" counter in ndo_get_stats64. Signed-off-by: Po Liu Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Signed-off-by: Jakub Kicinski commit 32bf8e1f6fb9f6dc334b2b98dffc2e5dcd51e513 Author: Vladimir Oltean Date: Tue May 10 19:36:14 2022 +0300 net: enetc: manage ENETC_F_QBV in priv->active_offloads only when enabled Future work in this driver would like to look at priv->active_offloads & ENETC_F_QBV to determine whether a tc-taprio qdisc offload was installed, but this does not produce the intended effect. All the other flags in priv->active_offloads are managed dynamically, except ENETC_F_QBV which is set statically based on the probed SI capability. This change makes priv->active_offloads & ENETC_F_QBV really track the presence of a tc-taprio schedule on the port. Some existing users, like the enetc_sched_speed_set() call from phylink_mac_link_up(), are best kept using the old logic: the tc-taprio offload does not re-trigger another link mode resolve, so the scheduler needs to be functional from the get go, as long as Qbv is supported at all on the port. So to preserve functionality there, look at the static station interface capability from pf->si->hw_features instead. Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Signed-off-by: Jakub Kicinski commit d7722973a1923c9af6372f5bd7ee75439e68c882 Merge: 11ecf3412bdc5 138badbc21a01 Author: Jakub Kicinski Date: Wed May 11 16:14:15 2022 -0700 Merge branch 'macb-napi-improvements' Robert Hancock says: ==================== MACB NAPI improvements Simplify the logic in the Cadence MACB/GEM driver for determining when to reschedule NAPI processing, and update it to use NAPI for the TX path as well as the RX path. Changes since v1: Changed to use separate TX and RX NAPI instances and poll functions to avoid unnecessary checks of the other ring (TX/RX) states during polling and to use budget handling for both RX and TX. Fixed locking to protect against concurrent access to TX ring on TX transmit and TX poll paths. ==================== Link: https://lore.kernel.org/r/20220509194635.3094080-1-robert.hancock@calian.com Signed-off-by: Jakub Kicinski commit 138badbc21a0113ce783270c426210d6451da5d1 Author: Robert Hancock Date: Mon May 9 13:46:35 2022 -0600 net: macb: use NAPI for TX completion path This driver was using the TX IRQ handler to perform all TX completion tasks. Under heavy TX network load, this can cause significant irqs-off latencies (found to be in the hundreds of microseconds using ftrace). This can cause other issues, such as overrunning serial UART FIFOs when using high baud rates with limited UART FIFO sizes. Switch to using a NAPI poll handler to perform the TX completion work to get this out of hard IRQ context and avoid the IRQ latency impact. A separate NAPI instance is used for TX and RX to avoid checking the other ring's state unnecessarily when doing the poll, and so that the NAPI budget handling can work for both TX and RX packets. A new per-queue tx_ptr_lock spinlock has been added to avoid using the main device lock (with IRQs needing to be disabled) across the entire TX mapping operation, and also to protect the TX queue pointers from concurrent access between the TX start and TX poll operations. The TX Used Bit Read interrupt (TXUBR) handling also needs to be moved into the TX NAPI poll handler to maintain the proper order of operations. A flag is used to notify the poll handler that a UBR condition needs to be handled. The macb_tx_restart handler has had some locking added for global register access, since this could now potentially happen concurrently on different queues. Signed-off-by: Robert Hancock Signed-off-by: Jakub Kicinski commit 1900e30d0ef74755213811cc23079b1be51298fe Author: Robert Hancock Date: Mon May 9 13:46:34 2022 -0600 net: macb: simplify/cleanup NAPI reschedule checking Previously the macb_poll method was checking the RSR register after completing its RX receive work to see if additional packets had been received since IRQs were disabled, since this controller does not maintain the pending IRQ status across IRQ disable. It also had to double-check the register after re-enabling IRQs to detect if packets were received after the first check but before IRQs were enabled. Using the RSR register for this purpose is problematic since it reflects the global device state rather than the per-queue state, so if packets are being received on multiple queues it may end up retriggering receive on a queue where the packets did not actually arrive and not on the one where they did arrive. This will also cause problems with an upcoming change to use NAPI for the TX path where use of multiple queues is more likely. Add a macb_rx_pending function to check the RX ring to see if more packets have arrived in the queue, and use that to check if NAPI should be rescheduled rather than the RSR register. By doing this, we can just ignore the global RSR register entirely, and thus save some extra device register accesses at the same time. This also makes the previous first check for pending packets rather redundant, since it would be checking the RX ring state which was just checked in the receive work function. Therefore we can get rid of it and just check after enabling interrupts whether packets are already pending. Signed-off-by: Robert Hancock Signed-off-by: Jakub Kicinski commit 2a371f7d5fa575010b915e325c5d20b9ad0d5d5a Author: Chengming Zhou Date: Tue May 10 11:47:57 2022 +0800 blk-iocost: combine local_stat and desc_stat to stat When we flush usage, wait, indebt stat in iocg_flush_stat(), we use local_stat and desc_stat, which has no point since the leaf iocg only has local_stat and the inner iocg only has desc_stat. Also we don't need to flush percpu abs_vusage for these inner iocgs. This patch combine local_stat and desc_stat to stat, only flush percpu abs_vusage for active leaf iocgs, then build inner walk list to propagate. Signed-off-by: Chengming Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220510034757.21761-1-zhouchengming@bytedance.com Signed-off-by: Jens Axboe commit 11ecf3412bdc583defd9c79584dd64ff82aa796d Author: Vladimir Oltean Date: Tue May 10 19:43:20 2022 +0300 net: dsa: ocelot: accept 1000base-X for VSC9959 and VSC9953 Switches using the Lynx PCS driver support 1000base-X optical SFP modules. Accept this interface type on a port. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220510164320.10313-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a91ee0e9fca9d7501286cfbced9b30a33e52740a Author: Yicong Yang Date: Mon Apr 4 14:25:39 2022 +0800 PCI: Avoid pci_dev_lock() AB/BA deadlock with sriov_numvfs_store() The sysfs sriov_numvfs_store() path acquires the device lock before the config space access lock: sriov_numvfs_store device_lock # A (1) acquire device lock sriov_configure vfio_pci_sriov_configure # (for example) vfio_pci_core_sriov_configure pci_disable_sriov sriov_disable pci_cfg_access_lock pci_wait_cfg # B (4) wait for dev->block_cfg_access == 0 Previously, pci_dev_lock() acquired the config space access lock before the device lock: pci_dev_lock pci_cfg_access_lock dev->block_cfg_access = 1 # B (2) set dev->block_cfg_access = 1 device_lock # A (3) wait for device lock Any path that uses pci_dev_lock(), e.g., pci_reset_function(), may deadlock with sriov_numvfs_store() if the operations occur in the sequence (1) (2) (3) (4). Avoid the deadlock by reversing the order in pci_dev_lock() so it acquires the device lock before the config space access lock, the same as the sriov_numvfs_store() path. [bhelgaas: combined and adapted commit log from Jay Zhou's independent subsequent posting: https://lore.kernel.org/r/20220404062539.1710-1-jianjay.zhou@huawei.com] Link: https://lore.kernel.org/linux-pci/1583489997-17156-1-git-send-email-yangyicong@hisilicon.com/ Also-posted-by: Jay Zhou Signed-off-by: Yicong Yang Signed-off-by: Bjorn Helgaas commit b57c7e8b76c646cf77ce4353a779a8b781592209 Author: Vladimir Oltean Date: Wed May 11 01:09:04 2022 +0300 selftests: forwarding: tc_actions: allow mirred egress test to run on non-offloaded h2 The host interfaces $h1 and $h2 don't have to be switchdev interfaces, but due to the fact that we pass $tcflags which may have the value of "skip_sw", we force $h2 to offload a drop rule for dst_ip, something which it may not be able to do. The selftest only wants to verify the hit count of this rule as a means of figuring out whether the packet was received, so remove the $tcflags for it and let it be done in software. Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Link: https://lore.kernel.org/r/20220510220904.284552-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit ddae9bc4678cfce4af0dbd9c79edfa4f566e450d Merge: 01f4685797a57 95073d08154a2 Author: Jakub Kicinski Date: Wed May 11 15:11:32 2022 -0700 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2022-05-10 This series contains updates to igc driver only. Sasha cleans up the code by removing an unused function and removing an enum for PHY type as there is only one PHY. The return type for igc_check_downshift() is changed to void as it always returns success. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igc: Change type of the 'igc_check_downshift' method igc: Remove unused phy_type enum igc: Remove igc_set_spd_dplx method ==================== Link: https://lore.kernel.org/r/20220510210656.2168393-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 065b8ced7c40bd6a4444f7005413f7af9fe6b642 Author: Jason A. Donenfeld Date: Wed May 11 15:35:50 2022 +0200 openrisc: remove bogus nops and shutdowns Nop 42 is some leftover debugging thing by the looks of it. Nop 1 will shut down the simulator, which isn't what we want, since it makes it impossible to handle errors. Cc: Stafford Horne Signed-off-by: Jason A. Donenfeld Signed-off-by: Stafford Horne commit d49401999adda2d69150b69655ade16dc77baa96 Author: Julia Lawall Date: Sat Apr 30 21:11:22 2022 +0200 openrisc: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Stafford Horne commit fd0ad6f1d10c01796904608aacd6e70d6f624305 Author: Yonghong Song Date: Wed May 11 11:47:35 2022 -0700 selftests/bpf: fix a few clang compilation errors With latest clang, I got the following compilation errors: .../prog_tests/test_tunnel.c:291:6: error: variable 'local_ip_map_fd' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (attach_tc_prog(&tc_hook, -1, set_dst_prog_fd)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .../bpf/prog_tests/test_tunnel.c:312:6: note: uninitialized use occurs here if (local_ip_map_fd >= 0) ^~~~~~~~~~~~~~~ ... .../prog_tests/kprobe_multi_test.c:346:6: error: variable 'err' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (IS_ERR(map)) ^~~~~~~~~~~ .../prog_tests/kprobe_multi_test.c:388:6: note: uninitialized use occurs here if (err) { ^~~ This patch fixed the above compilation errors. Signed-off-by: Yonghong Song Acked-by: David Vernet Link: https://lore.kernel.org/r/20220511184735.3670214-1-yhs@fb.com Signed-off-by: Alexei Starovoitov commit 31cae1eaae4fd65095ad6a3659db467bc3c2599e Author: Peter Zijlstra Date: Tue May 3 15:57:47 2022 -0500 sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state Currently ptrace_stop() / do_signal_stop() rely on the special states TASK_TRACED and TASK_STOPPED resp. to keep unique state. That is, this state exists only in task->__state and nowhere else. There's two spots of bother with this: - PREEMPT_RT has task->saved_state which complicates matters, meaning task_is_{traced,stopped}() needs to check an additional variable. - An alternative freezer implementation that itself relies on a special TASK state would loose TASK_TRACED/TASK_STOPPED and will result in misbehaviour. As such, add additional state to task->jobctl to track this state outside of task->__state. NOTE: this doesn't actually fix anything yet, just adds extra state. --EWB * didn't add a unnecessary newline in signal.h * Update t->jobctl in signal_wake_up and ptrace_signal_wake_up instead of in signal_wake_up_state. This prevents the clearing of TASK_STOPPED and TASK_TRACED from getting lost. * Added warnings if JOBCTL_STOPPED or JOBCTL_TRACED are not cleared Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220421150654.757693825@infradead.org Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-12-ebiederm@xmission.com Signed-off-by: Eric W. Biederman commit 5b4197cb287daf3cfd008fbf8682a1d6f4b13c0b Author: Eric W. Biederman Date: Fri Apr 29 10:50:17 2022 -0500 ptrace: Always take siglock in ptrace_resume Make code analysis simpler and future changes easier by always taking siglock in ptrace_resume. Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-11-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 2500ad1c7fa42ad734677853961a3a8bec0772c5 Author: Eric W. Biederman Date: Fri Apr 29 08:43:34 2022 -0500 ptrace: Don't change __state Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace command is executing. Instead remove TASK_WAKEKILL from the definition of TASK_TRACED, and implement a new jobctl flag TASK_PTRACE_FROZEN. This new flag is set in jobctl_freeze_task and cleared when ptrace_stop is awoken or in jobctl_unfreeze_task (when ptrace_stop remains asleep). In signal_wake_up add __TASK_TRACED to state along with TASK_WAKEKILL when the wake up is for a fatal signal. Skip adding __TASK_TRACED when TASK_PTRACE_FROZEN is not set. This has the same effect as changing TASK_TRACED to __TASK_TRACED as all of the wake_ups that use TASK_KILLABLE go through signal_wake_up. Handle a ptrace_stop being called with a pending fatal signal. Previously it would have been handled by schedule simply failing to sleep. As TASK_WAKEKILL is no longer part of TASK_TRACED schedule will sleep with a fatal_signal_pending. The code in signal_wake_up guarantees that the code will be awaked by any fatal signal that codes after TASK_TRACED is set. Previously the __state value of __TASK_TRACED was changed to TASK_RUNNING when woken up or back to TASK_TRACED when the code was left in ptrace_stop. Now when woken up ptrace_stop now clears JOBCTL_PTRACE_FROZEN and when left sleeping ptrace_unfreezed_traced clears JOBCTL_PTRACE_FROZEN. Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-10-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 57b6de08b5f6586851c2261ef0cc16cd275615e7 Author: Eric W. Biederman Date: Wed May 4 13:39:58 2022 -0500 ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs Long ago and far away there was a BUG_ON at the start of ptrace_stop that did "BUG_ON(!(current->ptrace & PT_PTRACED));" [1]. The BUG_ON had never triggered but examination of the code showed that the BUG_ON could actually trigger. To complement removing the BUG_ON an attempt to better handle the race was added. The code detected the tracer had gone away and did not call do_notify_parent_cldstop. The code also attempted to prevent ptrace_report_syscall from sending spurious SIGTRAPs when the tracer went away. The code to detect when the tracer had gone away before sending a signal to tracer was a legitimate fix and continues to work to this date. The code to prevent sending spurious SIGTRAPs is a failure. At the time and until today the code only catches it when the tracer goes away after siglock is dropped and before read_lock is acquired. If the tracer goes away after read_lock is dropped a spurious SIGTRAP can still be sent to the tracee. The tracer going away after read_lock is dropped is the far likelier case as it is the bigger window. Given that the attempt to prevent the generation of a SIGTRAP was a failure and continues to be a failure remove the code that attempts to do that. This simplifies the code in ptrace_stop and makes ptrace_stop much easier to reason about. To successfully deal with the tracer going away, all of the tracer's instrumentation of the child would need to be removed, and reliably detecting when the tracer has set a signal to continue with would need to be implemented. [1] 66519f549ae5 ("[PATCH] fix ptracer death race yielding bogus BUG_ON") History-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-9-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 7b0fe1367ef2d2591c20f03c4e64b7230e1ebcd7 Author: Eric W. Biederman Date: Thu May 5 12:25:36 2022 -0500 ptrace: Document that wait_task_inactive can't fail After ptrace_freeze_traced succeeds it is known that the tracee has a __state value of __TASK_TRACED and that no __ptrace_unlink will happen because the tracer is waiting for the tracee, and the tracee is in ptrace_stop. The function ptrace_freeze_traced can succeed at any point after ptrace_stop has set TASK_TRACED and dropped siglock. The read_lock on tasklist_lock only excludes ptrace_attach. This means that the !current->ptrace which executes under a read_lock of tasklist_lock will never see a ptrace_freeze_trace as the tracer must have gone away before the tasklist_lock was taken and ptrace_attach can not occur until the read_lock is dropped. As ptrace_freeze_traced depends upon ptrace_attach running before it can run that excludes ptrace_freeze_traced until __state is set to TASK_RUNNING. This means that task_is_traced will fail in ptrace_freeze_attach and ptrace_freeze_attached will fail. On the current->ptrace branch of ptrace_stop which will be reached any time after ptrace_freeze_traced has succeed it is known that __state is __TASK_TRACED and schedule() will be called with that state. Use a WARN_ON_ONCE to document that wait_task_inactive(TASK_TRACED) should never fail. Remove the stale comment about may_ptrace_stop. Strictly speaking this is not true because if PREEMPT_RT is enabled wait_task_inactive can fail because __state can be changed. I don't see this as a problem as the ptrace code is currently broken on PREMPT_RT, and this is one of the issues. Failing and warning when the assumptions of the code are broken is good. Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-8-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 6a2d90ba027adba528509ffa27097cffd3879257 Author: Eric W. Biederman Date: Fri Apr 29 09:23:55 2022 -0500 ptrace: Reimplement PTRACE_KILL by always sending SIGKILL The current implementation of PTRACE_KILL is buggy and has been for many years as it assumes it's target has stopped in ptrace_stop. At a quick skim it looks like this assumption has existed since ptrace support was added in linux v1.0. While PTRACE_KILL has been deprecated we can not remove it as a quick search with google code search reveals many existing programs calling it. When the ptracee is not stopped at ptrace_stop some fields would be set that are ignored except in ptrace_stop. Making the userspace visible behavior of PTRACE_KILL a noop in those case. As the usual rules are not obeyed it is not clear what the consequences are of calling PTRACE_KILL on a running process. Presumably userspace does not do this as it achieves nothing. Replace the implementation of PTRACE_KILL with a simple send_sig_info(SIGKILL) followed by a return 0. This changes the observable user space behavior only in that PTRACE_KILL on a process not stopped in ptrace_stop will also kill it. As that has always been the intent of the code this seems like a reasonable change. Cc: stable@vger.kernel.org Reported-by: Al Viro Suggested-by: Al Viro Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-7-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit cb3c19c93d656caa6fe63d6277aabd7e570f1d03 Author: Eric W. Biederman Date: Fri Apr 29 09:16:10 2022 -0500 signal: Use lockdep_assert_held instead of assert_spin_locked The distinction is that assert_spin_locked() checks if the lock is held *by*anyone* whereas lockdep_assert_held() asserts the current context holds the lock. Also, the check goes away if you build without lockdep. Suggested-by: Peter Zijlstra Link: https://lkml.kernel.org/r/Ympr/+PX4XgT/UKU@hirez.programming.kicks-ass.net Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-6-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 16cc1bc67de88be19fa595f4645506ea2ac106d2 Author: Eric W. Biederman Date: Fri Apr 29 11:09:11 2022 -0500 ptrace: Remove arch_ptrace_attach The last remaining implementation of arch_ptrace_attach is ia64's ptrace_attach_sync_user_rbs which was added at the end of 2007 in commit aa91a2e90044 ("[IA64] Synchronize RBS on PTRACE_ATTACH"). Reading the comments and examining the code ptrace_attach_sync_user_rbs has the sole purpose of saving registers to the stack when ptrace_attach changes TASK_STOPPED to TASK_TRACED. In all other cases arch_ptrace_stop takes care of the register saving. In commit d79fdd6d96f4 ("ptrace: Clean transitions between TASK_STOPPED and TRACED") modified ptrace_attach to wake up the thread and enter ptrace_stop normally even when the thread starts out stopped. This makes ptrace_attach_sync_user_rbs completely unnecessary. So just remove it. I read through the code to verify that ptrace_attach_sync_user_rbs is unnecessary. What I found is that the code is quite dead. Reading ptrace_attach_sync_user_rbs it is easy to see that the it does nothing unless __state == TASK_STOPPED. Calling arch_ptrace_attach (aka ptrace_attach_sync_user_rbs) after ptrace_traceme it is easy to see that because we are talking about the current process the value of __state is TASK_RUNNING. Which means ptrace_attach_sync_user_rbs does nothing. The only other call of arch_ptrace_attach (aka ptrace_attach_sync_user_rbs) is after ptrace_attach. If the task is running (and PTRACE_SEIZE is not specified), a SIGSTOP is sent which results in do_signal_stop setting JOBCTL_TRAP_STOP on the target task (as it is ptraced) and the target task stopping in ptrace_stop with __state == TASK_TRACED. If the task was already stopped then ptrace_attach sets JOBCTL_TRAPPING and JOBCTL_TRAP_STOP, wakes it out of __TASK_STOPPED, and waits until the JOBCTL_TRAPPING_BIT is clear. At which point the task stops in ptrace_stop. In both cases there are a couple of funning excpetions such as if the traced task receiveds a SIGCONT, or is set a fatal signal. However in all of those cases the tracee never stops in __state TASK_STOPPED. Which is a long way of saying that ptrace_attach_sync_user_rbs is guaranteed never to do anything. Cc: linux-ia64@vger.kernel.org Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 4a3d2717d140401df7501a95e454180831a0c5af Author: Eric W. Biederman Date: Tue Apr 26 16:45:37 2022 -0500 ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP xtensa is the last user of the PT_SINGLESTEP flag. Changing tsk->ptrace in user_enable_single_step and user_disable_single_step without locking could potentiallly cause problems. So use a thread info flag instead of a flag in tsk->ptrace. Use TIF_SINGLESTEP that xtensa already had defined but unused. Remove the definitions of PT_SINGLESTEP and PT_BLOCKSTEP as they have no more users. Cc: stable@vger.kernel.org Acked-by: Max Filippov Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit c200e4bb44e80b343c09841e7caaaca0aac5e5fa Author: Eric W. Biederman Date: Tue Apr 26 16:30:17 2022 -0500 ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP User mode linux is the last user of the PT_DTRACE flag. Using the flag to indicate single stepping is a little confusing and worse changing tsk->ptrace without locking could potentionally cause problems. So use a thread info flag with a better name instead of flag in tsk->ptrace. Remove the definition PT_DTRACE as uml is the last user. Cc: stable@vger.kernel.org Acked-by: Johannes Berg Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-3-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit e71ba124078e391879e0bf111529fa2d630d106c Author: Eric W. Biederman Date: Fri Apr 22 09:28:50 2022 -0500 signal: Replace __group_send_sig_info with send_signal_locked The function __group_send_sig_info is just a light wrapper around send_signal_locked with one parameter fixed to a constant value. As the wrapper adds no real value update the code to directly call the wrapped function. Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-2-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 157cc18122b4a1456d19048e151a164216c4a704 Author: Eric W. Biederman Date: Fri Apr 22 09:48:54 2022 -0500 signal: Rename send_signal send_signal_locked Rename send_signal and __send_signal to send_signal_locked and __send_signal_locked to make send_signal usable outside of signal.c. Tested-by: Kees Cook Reviewed-by: Oleg Nesterov Link: https://lkml.kernel.org/r/20220505182645.497868-1-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit ff806cbd90bd2cc3d08a026e26157e5b5a6b5e03 Author: Jason Gunthorpe Date: Wed May 11 13:19:07 2022 -0600 vfio/pci: Remove vfio_device_get_from_dev() The last user of this function is in PCI callbacks that want to convert their struct pci_dev to a vfio_device. Instead of searching use the vfio_device available trivially through the drvdata. When a callback in the device_driver is called, the caller must hold the device_lock() on dev. The purpose of the device_lock is to prevent remove() from being called (see __device_release_driver), and allow the driver to safely interact with its drvdata without races. The PCI core correctly follows this and holds the device_lock() when calling error_detected (see report_error_detected) and sriov_configure (see sriov_numvfs_store). Further, since the drvdata holds a positive refcount on the vfio_device any access of the drvdata, under the device_lock(), from a driver callback needs no further protection or refcounting. Thus the remark in the vfio_device_get_from_dev() comment does not apply here, VFIO PCI drivers all call vfio_unregister_group_dev() from their remove callbacks under the device_lock() and cannot race with the remaining callers. Reviewed-by: Kevin Tian Reviewed-by: Shameer Kolothum Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v4-c841817a0349+8f-vfio_get_from_dev_jgg@nvidia.com Signed-off-by: Alex Williamson commit 91be0bd6c6cf21328017e990d3ceeb00f03821fd Author: Jason Gunthorpe Date: Wed May 11 13:19:07 2022 -0600 vfio/pci: Have all VFIO PCI drivers store the vfio_pci_core_device in drvdata Having a consistent pointer in the drvdata will allow the next patch to make use of the drvdata from some of the core code helpers. Use a WARN_ON inside vfio_pci_core_register_device() to detect drivers that miss this. Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v4-c841817a0349+8f-vfio_get_from_dev_jgg@nvidia.com Signed-off-by: Alex Williamson commit af2b327581582a959f1923eca9cafee5b29a7399 Author: Jinke Han Date: Mon Apr 4 23:22:43 2022 +0800 ext4: remove unnecessary code in __mb_check_buddy When enter elseif branch, the the MB_CHECK_ASSERT will never fail. In addtion, the only illegal combination is 0/0, which can be caught by the first if branch. Signed-off-by: Jinke Han Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220404152243.13556-1-hanjinke.666@bytedance.com Signed-off-by: Theodore Ts'o commit fac88735278b4508ab8de505530be8413fd32fc2 Author: Chin Yik Ming Date: Sat Apr 2 02:07:44 2022 -0700 ext4: fix spelling errors in comments 'functoin' and 'entres' should be 'function' and 'entries' respectively Signed-off-by: Chin Yik Ming Link: https://lore.kernel.org/r/20220402090744.8918-1-yikming2222@gmail.com Signed-off-by: Theodore Ts'o commit c30365b90ab26fa991751119cde047312d370cab Author: Yu Zhe Date: Fri Apr 1 01:13:21 2022 -0700 ext4: remove unnecessary type castings remove unnecessary void* type castings. Signed-off-by: Yu Zhe Link: https://lore.kernel.org/r/20220401081321.73735-1-yuzhe@nfschina.com Signed-off-by: Theodore Ts'o commit f4534c9fc94d22383f187b9409abb3f9df2e3db3 Author: Ye Bin Date: Sat Mar 26 14:53:51 2022 +0800 ext4: fix warning in ext4_handle_inode_extension We got issue as follows: EXT4-fs error (device loop0) in ext4_reserve_inode_write:5741: Out of memory EXT4-fs error (device loop0): ext4_setattr:5462: inode #13: comm syz-executor.0: mark_inode_dirty error EXT4-fs error (device loop0) in ext4_setattr:5519: Out of memory EXT4-fs error (device loop0): ext4_ind_map_blocks:595: inode #13: comm syz-executor.0: Can't allocate blocks for non-extent mapped inodes with bigalloc ------------[ cut here ]------------ WARNING: CPU: 1 PID: 4361 at fs/ext4/file.c:301 ext4_file_write_iter+0x11c9/0x1220 Modules linked in: CPU: 1 PID: 4361 Comm: syz-executor.0 Not tainted 5.10.0+ #1 RIP: 0010:ext4_file_write_iter+0x11c9/0x1220 RSP: 0018:ffff924d80b27c00 EFLAGS: 00010282 RAX: ffffffff815a3379 RBX: 0000000000000000 RCX: 000000003b000000 RDX: ffff924d81601000 RSI: 00000000000009cc RDI: 00000000000009cd RBP: 000000000000000d R08: ffffffffbc5a2c6b R09: 0000902e0e52a96f R10: ffff902e2b7c1b40 R11: ffff902e2b7c1b40 R12: 000000000000000a R13: 0000000000000001 R14: ffff902e0e52aa10 R15: ffffffffffffff8b FS: 00007f81a7f65700(0000) GS:ffff902e3bc80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffff600400 CR3: 000000012db88001 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_iter_readv_writev+0x2e5/0x360 do_iter_write+0x112/0x4c0 do_pwritev+0x1e5/0x390 __x64_sys_pwritev2+0x7e/0xa0 do_syscall_64+0x37/0x50 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Above issue may happen as follows: Assume inode.i_size=4096 EXT4_I(inode)->i_disksize=4096 step 1: set inode->i_isize = 8192 ext4_setattr if (attr->ia_size != inode->i_size) EXT4_I(inode)->i_disksize = attr->ia_size; rc = ext4_mark_inode_dirty ext4_reserve_inode_write ext4_get_inode_loc __ext4_get_inode_loc sb_getblk --> return -ENOMEM ... if (!error) ->will not update i_size i_size_write(inode, attr->ia_size); Now: inode.i_size=4096 EXT4_I(inode)->i_disksize=8192 step 2: Direct write 4096 bytes ext4_file_write_iter ext4_dio_write_iter iomap_dio_rw ->return error if (extend) ext4_handle_inode_extension WARN_ON_ONCE(i_size_read(inode) < EXT4_I(inode)->i_disksize); ->Then trigger warning. To solve above issue, if mark inode dirty failed in ext4_setattr just set 'EXT4_I(inode)->i_disksize' with old value. Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20220326065351.761952-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit eadd86f835c63769febbd056dfcb70dafef0d4b3 Author: Jason Gunthorpe Date: Wed May 11 13:13:00 2022 -0600 vfio: Remove calls to vfio_group_add_container_user() When the open_device() op is called the container_users is incremented and held incremented until close_device(). Thus, so long as drivers call functions within their open_device()/close_device() region they do not need to worry about the container_users. These functions can all only be called between open_device() and close_device(): vfio_pin_pages() vfio_unpin_pages() vfio_dma_rw() vfio_register_notifier() vfio_unregister_notifier() Eliminate the calls to vfio_group_add_container_user() and add vfio_assert_device_open() to detect driver mis-use. This causes the close_device() op to check device->open_count so always leave it elevated while calling the op. Reviewed-by: Christoph Hellwig Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 231657b345046552b35670b45b892cfce2610e12 Author: Jason Gunthorpe Date: Wed May 11 13:13:00 2022 -0600 vfio: Remove dead code Now that callers have been updated to use the vfio_device APIs the driver facing group interface is no longer used, delete it: - vfio_group_get_external_user_from_dev() - vfio_group_pin_pages() - vfio_group_unpin_pages() - vfio_group_iommu_domain() -- Reviewed-by: Christoph Hellwig Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 5eb20a78c032da9c5d00090953c1bed6c4e3f143 Author: Jason Gunthorpe Date: Wed May 11 13:12:59 2022 -0600 drm/i915/gvt: Change from vfio_group_(un)pin_pages to vfio_(un)pin_pages Use the existing vfio_device versions of vfio_(un)pin_pages(). There is no reason to use a group interface here, kvmgt has easy access to a vfio_device. Delete kvmgt_vdev::vfio_group since these calls were the last users. Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Acked-by: Zhi Wang Link: https://lore.kernel.org/r/5-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit c6250ffbacc5989a5db3b9acce34b93570938f60 Author: Jason Gunthorpe Date: Wed May 11 13:12:59 2022 -0600 vfio/mdev: Pass in a struct vfio_device * to vfio_dma_rw() Every caller has a readily available vfio_device pointer, use that instead of passing in a generic struct device. Change vfio_dma_rw() to take in the struct vfio_device and move the container users that would have been held by vfio_group_get_external_user_from_dev() to vfio_dma_rw() directly, like vfio_pin/unpin_pages(). Reviewed-by: Christoph Hellwig Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 8e432bb015b6c327d016b1dca509964e189c4770 Author: Jason Gunthorpe Date: Wed May 11 13:12:59 2022 -0600 vfio/mdev: Pass in a struct vfio_device * to vfio_pin/unpin_pages() Every caller has a readily available vfio_device pointer, use that instead of passing in a generic struct device. The struct vfio_device already contains the group we need so this avoids complexity, extra refcountings, and a confusing lifecycle model. Reviewed-by: Christoph Hellwig Acked-by: Eric Farman Reviewed-by: Jason J. Herne Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 0a58795647cd4300470788ffdbff6b29b5f00632 Author: Jason Gunthorpe Date: Wed May 11 13:12:59 2022 -0600 vfio/ccw: Remove mdev from struct channel_program The next patch wants the vfio_device instead. There is no reason to store a pointer here since we can container_of back to the vfio_device. Reviewed-by: Eric Farman Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit 09ea48efffa3156218980e20aaf23dcc7d6000fc Author: Jason Gunthorpe Date: Wed May 11 13:12:58 2022 -0600 vfio: Make vfio_(un)register_notifier accept a vfio_device All callers have a struct vfio_device trivially available, pass it in directly and avoid calling the expensive vfio_group_get_from_dev(). Acked-by: Eric Farman Reviewed-by: Jason J. Herne Reviewed-by: Tony Krowiak Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v4-8045e76bf00b+13d-vfio_mdev_no_group_jgg@nvidia.com Signed-off-by: Alex Williamson commit a77109ffca339097833f26a1fea55ff71e2b608a Author: Robin Murphy Date: Wed May 11 13:12:58 2022 -0600 vfio: Stop using iommu_present() IOMMU groups have been mandatory for some time now, so a device without one is necessarily a device without any usable IOMMU, therefore the iommu_present() check is redundant (or at best unhelpful). Signed-off-by: Robin Murphy Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/537103bbd7246574f37f2c88704d7824a3a889f2.1649160714.git.robin.murphy@arm.com Signed-off-by: Alex Williamson commit 5acb6cd19d121522e215b51b243955901ae5ad02 Merge: 920df8d6ef122 419f8299ddad6 Author: Alex Williamson Date: Wed May 11 13:12:05 2022 -0600 Merge tag 'gvt-next-2022-04-29' into v5.19/vfio/next Merge GVT-g dependencies for vfio. Signed-off-by: Alex Williamson commit 920df8d6ef122a4129960d410209ee92614667ca Merge: c5eb0a61238dd 85c205db605b2 Author: Alex Williamson Date: Wed May 11 13:08:49 2022 -0600 Merge tag 'mlx5-lm-parallel' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux into v5.19/vfio/next Improve mlx5 live migration driver From Yishai: This series improves mlx5 live migration driver in few aspects as of below. Refactor to enable running migration commands in parallel over the PF command interface. To achieve that we exposed from mlx5_core an API to let the VF be notified before that the PF command interface goes down/up. (e.g. PF reload upon health recovery). Once having the above functionality in place mlx5 vfio doesn't need any more to obtain the global PF lock upon using the command interface but can rely on the above mechanism to be in sync with the PF. This can enable parallel VFs migration over the PF command interface from kernel driver point of view. In addition, Moved to use the PF async command mode for the SAVE state command. This enables returning earlier to user space upon issuing successfully the command and improve latency by let things run in parallel. Alex, as this series touches mlx5_core we may need to send this in a pull request format to VFIO to avoid conflicts before acceptance. Link: https://lore.kernel.org/all/20220510090206.90374-1-yishaih@nvidia.com Signed-of-by: Leon Romanovsky commit 998e1869de1b10caec6ec940632ff271036926f5 Author: Daniel Müller Date: Wed May 11 17:22:49 2022 +0000 selftests/bpf: Enable CONFIG_FPROBE for self tests Some of the BPF selftests are failing when running with a rather bare bones configuration based on tools/testing/selftests/bpf/config. Specifically, we see a bunch of failures due to errno 95: > test_attach_api:PASS:fentry_raw_skel_load 0 nsec > libbpf: prog 'test_kprobe_manual': failed to attach: Operation not supported > test_attach_api:FAIL:bpf_program__attach_kprobe_multi_opts unexpected error: -95 > 79 /6 kprobe_multi_test/attach_api_syms:FAIL The cause of these is that CONFIG_FPROBE is missing. With this change we add this configuration value to the BPF selftests config. Signed-off-by: Daniel Müller Acked-by: David Vernet Link: https://lore.kernel.org/r/20220511172249.4082510-1-deso@posteo.net Signed-off-by: Alexei Starovoitov commit 81091d7696ae71627ff80bbf2c6b0986d2c1cce3 Author: Mustafa Ismail Date: Mon Apr 25 13:16:24 2022 -0500 RDMA/irdma: Add SW mechanism to generate completions on error HW flushes after QP in error state is not reliable. This can lead to application hang waiting on a completion for outstanding WRs. Implement a SW mechanism to generate completions for any outstanding WR's after the QP is modified to error. This is accomplished by starting a delayed worker after the QP is modified to error and the HW flush is performed. The worker will generate completions that will be returned to the application when it polls the CQ. This mechanism only applies to Kernel applications. Link: https://lore.kernel.org/r/20220425181624.1617-1-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 03a679a1a4ec8fbe44119a6d06eeabdf7944883d Merge: fba2689ee77e6 9282d0996936c Author: Arnd Bergmann Date: Wed May 11 20:52:52 2022 +0200 Merge tag 'generic-ticket-spinlocks-v6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux into asm-generic asm-generic: New generic ticket-based spinlock This contains a new ticket-based spinlock that uses only generic atomics and doesn't require as much from the memory system as qspinlock does in order to be fair. It also includes a bit of documentation about the qspinlock and qrwlock fairness requirements. This will soon be used by a handful of architectures that don't meet the qspinlock requirements. * tag 'generic-ticket-spinlocks-v6' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux: csky: Move to generic ticket-spinlock RISC-V: Move to queued RW locks RISC-V: Move to generic spinlocks openrisc: Move to ticket-spinlock asm-generic: qrwlock: Document the spinlock fairness requirements asm-generic: qspinlock: Indicate the use of mixed-size atomics asm-generic: ticket-lock: New generic ticket-based spinlock commit 9282d0996936c5fbf877c0d096a3feb456c878ad Author: Guo Ren Date: Fri Mar 18 16:34:21 2022 +0800 csky: Move to generic ticket-spinlock There is no benefit from custom implementation for ticket-spinlock, so move to generic ticket-spinlock for easy maintenance. Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit c9c0b0ba1e1134a8dcf386474a4c85718b6fe1d2 Author: Palmer Dabbelt Date: Wed Mar 16 16:11:33 2022 -0700 RISC-V: Move to queued RW locks Now that we have fair spinlocks we can use the generic queued rwlocks, so we might as well do so. Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit 4922a3ea0121fb6741bacaa7bd1b678f51f40461 Author: Palmer Dabbelt Date: Wed Mar 16 16:07:34 2022 -0700 RISC-V: Move to generic spinlocks Our existing spinlocks aren't fair and replacing them has been on the TODO list for a long time. This moves to the recently-introduced ticket spinlocks, which are simple enough that they are likely to be correct and fast on the vast majority of extant implementations. This introduces a horrible hack that allows us to split out the spinlock conversion from the rwlock conversion. We have to do the spinlocks first because qrwlock needs fair spinlocks, but we don't want to pollute the asm-generic code to support the generic spinlocks without qrwlocks. Thus we pollute the RISC-V code, but just until the next commit as it's all going away. Reviewed-by: Arnd Bergmann Reviewed-by: Guo Ren Tested-by: Heiko Stuebner Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 205bf39a3441fde4fcd3931a28f4720b20ca68f7 Author: Peter Zijlstra Date: Wed Mar 16 16:03:58 2022 -0700 openrisc: Move to ticket-spinlock We have no indications that openrisc meets the qspinlock requirements, so move to ticket-spinlock as that is more likey to be correct. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Stafford Horne Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit 493e2ba27635971565a991dc9f689553242890a4 Author: Palmer Dabbelt Date: Thu Apr 14 09:34:29 2022 -0700 asm-generic: qrwlock: Document the spinlock fairness requirements I could only find the fairness requirements documented as the C code, this calls them out in a comment just to be a bit more explicit. Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit a8ad07e5240c9e78633270be2fa2356b7e0f0af5 Author: Peter Zijlstra Date: Wed Mar 16 15:48:29 2022 -0700 asm-generic: qspinlock: Indicate the use of mixed-size atomics The qspinlock implementation depends on having well behaved mixed-size atomics. This is true on the more widely-used platforms, but these requirements are somewhat subtle and may not be satisfied by all the platforms that qspinlock is used on. Document these requirements, so ports that use qspinlock can more easily determine if they meet these requirements. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit 1bce11126d57dde90a02ecf9bfe98175ab4e729e Author: Peter Zijlstra Date: Wed Mar 16 15:53:54 2022 -0700 asm-generic: ticket-lock: New generic ticket-based spinlock This is a simple, fair spinlock. Specifically it doesn't have all the subtle memory model dependencies that qspinlock has, which makes it more suitable for simple systems as it is more likely to be correct. It is implemented entirely in terms of standard atomics and thus works fine without any arch-specific code. This replaces the existing asm-generic/spinlock.h, which just errored out on SMP systems. Signed-off-by: Peter Zijlstra (Intel) Tested-by: Heiko Stuebner Reviewed-by: Guo Ren Reviewed-by: Arnd Bergmann Signed-off-by: Palmer Dabbelt commit ce13389053a347aa9f8ffbfda2238352536e15c9 Merge: be05ee54378d4 9621fbee44df9 Author: Paul E. McKenney Date: Wed May 11 11:49:35 2022 -0700 Merge branch 'exp.2022.05.11a' into HEAD exp.2022.05.11a: Expedited-grace-period latency-reduction updates. commit d5efbfc5210cc7ce8e413278da0dc4b7ccbe5bb7 Merge: 0d8688298d6a4 ae16cc18f37bc Author: Mark Brown Date: Wed May 11 19:48:07 2022 +0100 spi: stm32-qspi: flags management fixes Merge series from patrice.chotard@foss.st.com Patrice Chotard : From: Patrice Chotard This series update flags management in the following cases: - In APM mode, don't take care of TCF and TEF flags - Always check TCF flag in stm32_qspi_wait_cmd() - Don't check BUSY flag when sending new command commit 9621fbee44df940e2e1b94b0676460a538dffefa Author: Kalesh Singh Date: Fri Apr 8 17:35:27 2022 -0700 rcu: Move expedited grace period (GP) work to RT kthread_worker Enabling CONFIG_RCU_BOOST did not reduce RCU expedited grace-period latency because its workqueues run at SCHED_OTHER, and thus can be delayed by normal processes. This commit avoids these delays by moving the expedited GP work items to a real-time-priority kthread_worker. This option is controlled by CONFIG_RCU_EXP_KTHREAD and disabled by default on PREEMPT_RT=y kernels which disable expedited grace periods after boot by unconditionally setting rcupdate.rcu_normal_after_boot=1. The results were evaluated on arm64 Android devices (6GB ram) running 5.10 kernel, and capturing trace data in critical user-level code. The table below shows the resulting order-of-magnitude improvements in synchronize_rcu_expedited() latency: ------------------------------------------------------------------------ | | workqueues | kthread_worker | Diff | ------------------------------------------------------------------------ | Count | 725 | 688 | | ------------------------------------------------------------------------ | Min Duration (ns) | 326 | 447 | 37.12% | ------------------------------------------------------------------------ | Q1 (ns) | 39,428 | 38,971 | -1.16% | ------------------------------------------------------------------------ | Q2 - Median (ns) | 98,225 | 69,743 | -29.00% | ------------------------------------------------------------------------ | Q3 (ns) | 342,122 | 126,638 | -62.98% | ------------------------------------------------------------------------ | Max Duration (ns) | 372,766,967 | 2,329,671 | -99.38% | ------------------------------------------------------------------------ | Avg Duration (ns) | 2,746,353 | 151,242 | -94.49% | ------------------------------------------------------------------------ | Standard Deviation (ns) | 19,327,765 | 294,408 | | ------------------------------------------------------------------------ The below table show the range of maximums/minimums for synchronize_rcu_expedited() latency from all experiments: ------------------------------------------------------------------------ | | workqueues | kthread_worker | Diff | ------------------------------------------------------------------------ | Total No. of Experiments | 25 | 23 | | ------------------------------------------------------------------------ | Largest Maximum (ns) | 372,766,967 | 2,329,671 | -99.38% | ------------------------------------------------------------------------ | Smallest Maximum (ns) | 38,819 | 86,954 | 124.00% | ------------------------------------------------------------------------ | Range of Maximums (ns) | 372,728,148 | 2,242,717 | | ------------------------------------------------------------------------ | Largest Minimum (ns) | 88,623 | 27,588 | -68.87% | ------------------------------------------------------------------------ | Smallest Minimum (ns) | 326 | 447 | 37.12% | ------------------------------------------------------------------------ | Range of Minimums (ns) | 88,297 | 27,141 | | ------------------------------------------------------------------------ Cc: "Paul E. McKenney" Cc: Tejun Heo Reported-by: Tim Murray Reported-by: Wei Wang Tested-by: Kyle Lin Tested-by: Chunwei Lu Tested-by: Lulu Wang Signed-off-by: Kalesh Singh Signed-off-by: Paul E. McKenney commit bf00745e7791fe2ba7941aeead8528075a158bbe Author: Andy Lutomirski Date: Wed May 11 10:38:53 2022 -0700 x86/vsyscall: Remove CONFIG_LEGACY_VSYSCALL_EMULATE CONFIG_LEGACY_VSYSCALL_EMULATE is, as far as I know, only needed for the combined use of exotic and outdated debugging mechanisms with outdated binaries. At this point, no one should be using it. Eventually, dynamic switching of vsyscalls will be implemented, but this is much more complicated to support in EMULATE mode than XONLY mode. So let's force all the distros off of EMULATE mode. If anyone actually needs it, they can set vsyscall=emulate, and the kernel can then get away with refusing to support newer security models if that option is set. [ bp: Remove "we"s. ] Signed-off-by: Andy Lutomirski Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Acked-by: Florian Weimer Link: https://lore.kernel.org/r/898932fe61db6a9d61bc2458fa2f6049f1ca9f5c.1652290558.git.luto@kernel.org commit 28b3ae426598e722cf5d5ab9cc7038791b955a56 Author: Uladzislau Rezki Date: Wed Feb 16 14:52:09 2022 +0100 rcu: Introduce CONFIG_RCU_EXP_CPU_STALL_TIMEOUT Currently both expedited and regular grace period stall warnings use a single timeout value that with units of seconds. However, recent Android use cases problem require a sub-100-millisecond expedited RCU CPU stall warning. Given that expedited RCU grace periods normally complete in far less than a single millisecond, especially for small systems, this is not unreasonable. Therefore introduce the CONFIG_RCU_EXP_CPU_STALL_TIMEOUT kernel configuration that defaults to 20 msec on Android and remains the same as that of the non-expedited stall warnings otherwise. It also can be changed in run-time via: /sys/.../parameters/rcu_exp_cpu_stall_timeout. [ paulmck: Default of zero to use CONFIG_RCU_STALL_TIMEOUT. ] Signed-off-by: Uladzislau Rezki Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney commit ca522482e3eafd005b8d4e8b1331c911505a58d5 Author: Mike Snitzer Date: Wed May 11 09:38:38 2022 -0400 dm: pass NULL bdev to bio_alloc_clone Most DM targets will remap the clone bio passed to their ->map function using bio_set_bdev(). So this change to pass NULL bdev to bio_alloc_clone avoids clone-time work that sets up resources for a bdev association that will not be used in practice (e.g. clone issued to underlying device will not use DM device's blk-cgroups resources). But clone->bi_bdev is still initialized following bio_alloc_clone to preserve DM target expectations that clone->bi_bdev will be set. Follow-up work is needed to audit DM targets to remove accesses to a clone->bi_bdev that the target didn't initialize with bio_set_dev(). Depends-on: 7ecc56c62b27 ("block: allow passing a NULL bdev to bio_alloc_clone/bio_init_clone") Signed-off-by: Mike Snitzer commit a2bad844a67b1c7740bda63e87453baf63c3a7f7 Author: Jeffrey Hugo Date: Wed May 11 09:23:19 2022 -0600 PCI: hv: Fix interrupt mapping for multi-MSI According to Dexuan, the hypervisor folks beleive that multi-msi allocations are not correct. compose_msi_msg() will allocate multi-msi one by one. However, multi-msi is a block of related MSIs, with alignment requirements. In order for the hypervisor to allocate properly aligned and consecutive entries in the IOMMU Interrupt Remapping Table, there should be a single mapping request that requests all of the multi-msi vectors in one shot. Dexuan suggests detecting the multi-msi case and composing a single request related to the first MSI. Then for the other MSIs in the same block, use the cached information. This appears to be viable, so do it. Suggested-by: Dexuan Cui Signed-off-by: Jeffrey Hugo Reviewed-by: Dexuan Cui Tested-by: Michael Kelley Link: https://lore.kernel.org/r/1652282599-21643-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Wei Liu commit b4b77778ecc5bfbd4e77de1b2fd5c1dd3c655f1f Author: Jeffrey Hugo Date: Wed May 11 09:23:02 2022 -0600 PCI: hv: Reuse existing IRTE allocation in compose_msi_msg() Currently if compose_msi_msg() is called multiple times, it will free any previous IRTE allocation, and generate a new allocation. While nothing prevents this from occurring, it is extraneous when Linux could just reuse the existing allocation and avoid a bunch of overhead. However, when future IRTE allocations operate on blocks of MSIs instead of a single line, freeing the allocation will impact all of the lines. This could cause an issue where an allocation of N MSIs occurs, then some of the lines are retargeted, and finally the allocation is freed/reallocated. The freeing of the allocation removes all of the configuration for the entire block, which requires all the lines to be retargeted, which might not happen since some lines might already be unmasked/active. Signed-off-by: Jeffrey Hugo Reviewed-by: Dexuan Cui Tested-by: Dexuan Cui Tested-by: Michael Kelley Link: https://lore.kernel.org/r/1652282582-21595-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Wei Liu commit 515755906921fa9393d6c9de18fac4343882a88d Author: Sumeet Pawnikar Date: Fri May 6 19:23:52 2022 +0530 powercap: RAPL: Add Power Limit4 support for RaptorLake Add RaptorLake to the list of processor models for which Power Limit4 is supported by the Intel RAPL driver. Signed-off-by: Sumeet Pawnikar [ rjw: Changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit ac6811a9b36f3ceb549d8b84bd8aeedf6026df02 Author: Michael Kelley Date: Mon May 2 09:36:31 2022 -0700 drm/hyperv: Remove support for Hyper-V 2008 and 2008R2/Win7 The DRM Hyper-V driver has special case code for running on the first released versions of Hyper-V: 2008 and 2008 R2/Windows 7. These versions are now out of support (except for extended security updates) and lack support for performance features that are needed for effective production usage of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the DRM Hyper-V driver. Signed-off-by: Michael Kelley Reviewed-by: Deepak Rawat Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/1651509391-2058-5-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit b0cce4f6fe6633546bbe5ca04f965f76948e2f34 Author: Michael Kelley Date: Mon May 2 09:36:30 2022 -0700 video: hyperv_fb: Remove support for Hyper-V 2008 and 2008R2/Win7 The hyperv_fb driver has special case code for running on the first released versions of Hyper-V: 2008 and 2008 R2/Windows 7. These versions are now out of support (except for extended security updates) and lack support for performance features that are needed for effective production usage of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the hyperv_fb driver. Signed-off-by: Michael Kelley Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/1651509391-2058-4-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 106b98a5181c1a5831f1fe31d33d17dd1f0e7ae1 Author: Michael Kelley Date: Mon May 2 09:36:29 2022 -0700 scsi: storvsc: Remove support for Hyper-V 2008 and 2008R2/Win7 The storvsc driver has special case code for running on the first released versions of Hyper-V: 2008 and 2008 R2/Windows 7. These versions are now out of support (except for extended security updates) and lack support for performance features like multiple VMbus channels that are needed for effective production usage of Linux guests. The negotiation of the VMbus protocol versions required by these old Hyper-V versions has been removed from the VMbus driver. So now remove the handling of these VMbus protocol versions from the storvsc driver. Signed-off-by: Michael Kelley Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/1651509391-2058-3-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit a6b94c6b49198266eaf78095a632df7245ef5196 Author: Michael Kelley Date: Mon May 2 09:36:28 2022 -0700 Drivers: hv: vmbus: Remove support for Hyper-V 2008 and Hyper-V 2008R2/Win7 The VMbus driver has special case code for running on the first released versions of Hyper-V: 2008 and 2008 R2/Windows 7. These versions are now out of support (except for extended security updates) and lack the performance features needed for effective production usage of Linux guests. Simplify the code by removing the negotiation of the VMbus protocol versions required for these releases of Hyper-V, and by removing the special case code for handling these VMbus protocol versions. Signed-off-by: Michael Kelley Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/1651509391-2058-2-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 84bc4f1dbbbb5f8aa68706a96711dccb28b518e5 Author: Mikulas Patocka Date: Tue May 10 13:17:32 2022 -0400 dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT allocation - so it can't access the emergency memory reserves and it fails as soon as anybody reaches the watermark. This patch changes GFP_NOWAIT to GFP_ATOMIC, so that it can access the emergency memory reserves. Signed-off-by: Mikulas Patocka Signed-off-by: Christoph Hellwig commit 92826e967535db2eb117db227b1191aaf98e4bb3 Author: Christoph Hellwig Date: Sat Apr 23 19:20:24 2022 +0200 dma-direct: don't fail on highmem CMA pages in dma_direct_alloc_pages When dma_direct_alloc_pages encounters a highmem page it just gives up currently. But what we really should do is to try memory using the page allocator instead - without this platforms with a global highmem CMA pool will fail all dma_alloc_pages allocations. Fixes: efa70f2fdc84 ("dma-mapping: add a new dma_alloc_pages API") Reported-by: Mark O'Neill Signed-off-by: Christoph Hellwig commit 566fb90e050dfa2132340bbdab9533b727dda6f1 Author: Christoph Hellwig Date: Fri Apr 22 06:37:57 2022 +0200 swiotlb-xen: fix DMA_ATTR_NO_KERNEL_MAPPING on arm swiotlb-xen uses very different ways to allocate coherent memory on x86 vs arm. On the former it allocates memory from the page allocator, while on the later it reuses the dma-direct allocator the handles the complexities of non-coherent DMA on arm platforms. Unfortunately the complexities of trying to deal with the two cases in the swiotlb-xen.c code lead to a bug in the handling of DMA_ATTR_NO_KERNEL_MAPPING on arm. With the DMA_ATTR_NO_KERNEL_MAPPING flag the coherent memory allocator does not actually allocate coherent memory, but just a DMA handle for some memory that is DMA addressable by the device, but which does not have to have a kernel mapping. Thus dereferencing the return value will lead to kernel crashed and memory corruption. Fix this by using the dma-direct allocator directly for arm, which works perfectly fine because on arm swiotlb-xen is only used when the domain is 1:1 mapped, and then simplifying the remaining code to only cater for the x86 case with DMA coherent device. Reported-by: Rahul Singh Signed-off-by: Christoph Hellwig Reviewed-by: Rahul Singh Reviewed-by: Stefano Stabellini Tested-by: Rahul Singh commit b3f9916d81e8ffb21cbe7abccf63f86a5a1d598a Author: Eric W. Biederman Date: Wed May 11 12:16:21 2022 -0500 sched: Update task_tick_numa to ignore tasks without an mm Qian Cai wrote: > Reverting the last 3 commits of the series fixed a boot crash. > > 1b2552cbdbe0 fork: Stop allowing kthreads to call execve > 753550eb0ce1 fork: Explicitly set PF_KTHREAD > 68d85f0a33b0 init: Deal with the init process being a user mode process > > BUG: KASAN: null-ptr-deref in task_nr_scan_windows.isra.0 > arch_atomic_long_read at ./include/linux/atomic/atomic-long.h:29 > (inlined by) atomic_long_read at ./include/linux/atomic/atomic-instrumented.h:1266 > (inlined by) get_mm_counter at ./include/linux/mm.h:1996 > (inlined by) get_mm_rss at ./include/linux/mm.h:2049 > (inlined by) task_nr_scan_windows at kernel/sched/fair.c:1123 > Read of size 8 at addr 00000000000003d0 by task swapper/0/1 With the change to init and the user mode helper processes to not have PF_KTHREAD set before they call kernel_execve the PF_KTHREAD test in task_tick_numa became insufficient to detect all tasks that have "->mm == NULL". Correct that by testing for "->mm == NULL" directly. Reported-by: Qian Cai Tested-by: Qian Cai Fixes: 1b2552cbdbe0 ("fork: Stop allowing kthreads to call execve") Link: https://lkml.kernel.org/r/87r150ug1l.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 24773e6c7a27bfc724a8ed5523dc31bbfc9543d5 Author: Li kunyu Date: Wed May 11 13:16:05 2022 +0800 x86: ACPI: Make mp_config_acpi_gsi() a void function Because the return value of mp_config_acpi_gsi() is not use, change it into a void function. Signed-off-by: Li kunyu [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit 5c84c1b84bd80a735b2c7804e7be86d043fca595 Author: Viresh Kumar Date: Wed May 11 14:36:24 2022 +0530 cpufreq: Clear real_cpus mask from remove_cpu_dev_symlink() add_cpu_dev_symlink() is responsible for setting the CPUs in the real_cpus mask, the reverse of which should be done from remove_cpu_dev_symlink() to make it look clean and avoid any breakage later on. Move the call to clear the mask to remove_cpu_dev_symlink(). Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit bbd67f1b5a9449b090560ca5288aef0cfe623275 Author: Srinivas Pandruvada Date: Mon May 2 13:50:52 2022 -0700 cpufreq: intel_pstate: Support Sapphire Rapids OOB mode Prevent intel_pstate to load when OOB (Out Of Band) P-states mode is enabled in Sapphire Rapids. The OOB identifying bits are same as the prior generation CPUs like Ice Lake servers. So, also add Sapphire Rapids to intel_pstate_cpu_oob_ids list. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit c9d8923bfbcb63f15ea6cb2b5c8426fc3d96f643 Author: Pierre Gondois Date: Tue Apr 26 16:44:48 2022 +0200 PM: EM: Decrement policy counter In commit e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq"), cpufreq_cpu_get() is called without a cpufreq_cpu_put(), permanently increasing the reference counts of the policy struct. Decrement the reference count once the policy struct is not used anymore. Fixes: e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq") Tested-by: Cristian Marussi Signed-off-by: Pierre Gondois Reviewed-by: Vincent Donnefort Signed-off-by: Rafael J. Wysocki commit f9d76d15072caf1ec5558fa7cc6d93c7b9d33488 Author: Alan Stern Date: Tue May 10 11:51:29 2022 -0400 USB: gadget: Add ID numbers to gadget names Putting USB gadgets on a new bus of their own encounters a problem when multiple gadgets are present: They all have the same name! The driver core fails with a "sys: cannot create duplicate filename" error when creating any of the /sys/bus/gadget/devices/ symbolic links after the first. This patch fixes the problem by adding a ".N" suffix to each gadget's name when the gadget is registered (where N is a unique ID number), thus making the names distinct. Reported-and-tested-by: Geert Uytterhoeven Signed-off-by: Alan Stern Reviewed-by: Geert Uytterhoeven Fixes: fc274c1e9973 ("USB: gadget: Add a new bus for gadgets") Link: https://lore.kernel.org/r/YnqKAXKyp9Vq/pbn@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit a2d36b02c15d49cec1f5a44c5123bb7f3bdfea8e Author: Bernard Metzler Date: Tue May 10 16:39:17 2022 +0200 RDMA/siw: Enable siw on tunnel devices Enable siw to attach to tunnel devices, there is no reason not to, siw properly generates all packets already. Link: https://lore.kernel.org/r/20220510143917.23735-1-bmt@zurich.ibm.com Tested-by: Chuck Lever Signed-off-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit afaa7b933ef00a2d3262f4d1252087613fb5c06d Author: Miaoqian Lin Date: Wed May 11 15:35:05 2022 +0400 regulator: pfuze100: Fix refcount leak in pfuze_parse_regulators_dt of_node_get() returns a node with refcount incremented. Calling of_node_put() to drop the reference when not needed anymore. Fixes: 3784b6d64dc5 ("regulator: pfuze100: add pfuze100 regulator driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511113506.45185-1-linmq006@gmail.com Signed-off-by: Mark Brown commit de2427207d13d7fe1882cd1772d66e33debf999e Author: Charles Keepax Date: Tue May 10 16:38:43 2022 +0100 ASoC: wm9090: Remove redundant endianness flag The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device has no DAI links and as such the flag would have no effect, remove the redundant flag. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220510153843.1029540-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 69b53a097d9984d93448b021e0d422f2803310bd Author: Charles Keepax Date: Tue May 10 16:38:42 2022 +0100 ASoC: wm2000: Remove redundant endianness flag The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device has no DAI links and as such the flag would have no effect, remove the redundant flag. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220510153843.1029540-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 2be84f73785fa9ed6443e3c5b158730266f1c2ee Author: Miaoqian Lin Date: Wed May 11 17:37:22 2022 +0400 ASoC: mxs-saif: Fix refcount leak in mxs_saif_probe of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Fixes: 08641c7c74dd ("ASoC: mxs: add device tree support for mxs-saif") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511133725.39039-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 1a9fa95447bba1704b7d701ad08988e15b28aba6 Author: Zheyu Ma Date: Wed May 11 09:55:14 2022 +0800 ASoC: cs42l56: Fix the error handling of cs42l56_i2c_probe() The driver should goto label 'err_enable' when failing at regmap_read(). Signed-off-by: Zheyu Ma Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220511015514.1777923-1-zheyuma97@gmail.com Signed-off-by: Mark Brown commit ed46731d8e86c8d65f5fc717671e1f1f6c3146d2 Author: Miaoqian Lin Date: Wed May 11 09:27:40 2022 +0400 ASoC: imx-hdmi: Fix refcount leak in imx_hdmi_probe of_find_device_by_node() takes reference, we should use put_device() to release it. when devm_kzalloc() fails, it doesn't have a put_device(), it will cause refcount leak. Add missing put_device() to fix this. Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver") Fixes: f670b274f7f6 ("ASoC: imx-hdmi: add put_device() after of_find_device_by_node()") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220511052740.46903-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 7aded7003a4e949b3bf73f060771f9db018a6d96 Author: Shengjiu Wang Date: Tue May 10 19:56:48 2022 +0800 ASoC: fsl_ssi: Add support multi fifo script With dual fifo enabled, the case that recording mono sound in the background, playback mono sound twice in parallal, at second time playback sound may distort, the possible reason is using dual fifo to playback mono sound is not recommended. This patch is to provide a option to use multi fifo script, which can be dynamically configured as one fifo or two fifo mode. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1652183808-3745-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 41cd312dfe980af869c3503b4d38e62ed20dd3b7 Author: Miaoqian Lin Date: Wed May 11 10:58:03 2022 +0400 ASoC: fsl: Fix refcount leak in imx_sgtl5000_probe of_find_i2c_device_by_node() takes a reference, In error paths, we should call put_device() to drop the reference to aviod refount leak. Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000") Signed-off-by: Miaoqian Lin Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220511065803.3957-1-linmq006@gmail.com Signed-off-by: Mark Brown commit c1ce4ba5021a9730c00bab6f8122702deb69d37e Author: Zheyu Ma Date: Tue May 10 23:32:46 2022 +0800 ASoC: cs42l46: Fix the error handling of cs42l56_i2c_probe() The driver should goto label 'err_enable' when failing at regmap_read(). Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220510153251.1741210-2-zheyuma97@gmail.com Signed-off-by: Mark Brown commit 83d1b65d4cbe6fb0bbdacc18c1f4ad0450275d8f Author: Zheyu Ma Date: Tue May 10 23:32:51 2022 +0800 ASoC: wm8903: Fix the error handling of wm8903_i2c_probe() The driver should goto label 'err' when failing to request the irq. Signed-off-by: Zheyu Ma Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220510153251.1741210-7-zheyuma97@gmail.com Signed-off-by: Mark Brown commit 68cacb5cf5cf04aaa95be1fd76eff728dfddc613 Author: Zheyu Ma Date: Tue May 10 23:32:50 2022 +0800 ASoC: tas6424: Fix the error handling of tas6424_i2c_probe() After enabling the regulator, The driver should disable the regulator when failing at probing. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220510153251.1741210-6-zheyuma97@gmail.com Signed-off-by: Mark Brown commit ef1878fd0cd61f0f3fafdf518bb8f1df742ef760 Author: Zheyu Ma Date: Tue May 10 23:32:49 2022 +0800 ASoC: tas571x: Fix the error handling of tas571x_i2c_probe() After enabling the regulator, The driver should disable the regulator when failing at probing. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220510153251.1741210-5-zheyuma97@gmail.com Signed-off-by: Mark Brown commit 7883c193d7ae1ccc20ee4c06d2a1fea40074e454 Author: Zheyu Ma Date: Tue May 10 23:32:48 2022 +0800 ASoC: rt5645: Fix the error handling of rt5645_i2c_probe() After enabling the regulator, The driver should disable the regulator when failing at probing. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220510153251.1741210-4-zheyuma97@gmail.com Signed-off-by: Mark Brown commit cf7250e95d309ae518918613fb904a4565ffc85d Author: Zheyu Ma Date: Tue May 10 23:32:47 2022 +0800 ASoC: cs35l36: Fix the error handling of cs35l36_i2c_probe() The driver should goto label 'err' when failing at regmap_read(). Signed-off-by: Zheyu Ma Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220510153251.1741210-3-zheyuma97@gmail.com Signed-off-by: Mark Brown commit ae16cc18f37bcdea7d4ef57a5e526a60b09a1506 Author: Patrice Chotard Date: Wed May 11 09:46:44 2022 +0200 spi: stm32-qspi: Remove SR_BUSY bit check before sending command Waiting for SR_BUSY bit when receiving a new command is not needed. SR_BUSY bit is already managed in the previous command treatment. Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220511074644.558874-4-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit 0cf8d32600cf5660ee45d421f1b6e3a129ca58b6 Author: Patrice Chotard Date: Wed May 11 09:46:43 2022 +0200 spi: stm32-qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd() Currently, SR_TCF flag is checked in case there is data, this criteria is not correct. SR_TCF flags is set when programmed number of bytes has been transferred to the memory device ("bytes" comprised command and data send to the SPI device). So even if there is no data, we must check SR_TCF flag. Signed-off-by: Patrice Chotard Link: https://lore.kernel.org/r/20220511074644.558874-3-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit d83d89ea68b4726700fa87b22db075e4217e691c Author: Patrice Chotard Date: Wed May 11 09:46:42 2022 +0200 spi: stm32-qspi: Fix wait_cmd timeout in APM mode In APM mode, TCF and TEF flags are not set. To avoid timeout in stm32_qspi_wait_cmd(), don't check if TCF/TEF are set. Signed-off-by: Patrice Chotard Reported-by: eberhard.stoll@kontron.de Link: https://lore.kernel.org/r/20220511074644.558874-2-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit 71013db522a90513e4e4ec3b33eb00c939e2f4b3 Merge: 7b46eb1bf9534 cebbefbd22d5a Author: Mark Brown Date: Wed May 11 17:38:15 2022 +0100 ASoC: Intel: boards: Chromebook configuration updates Merge series from Pierre-Louis Bossart : Two minor changes to enable DMIC and capture for CS35L41, and one new configuration for AlderLake hardware. commit 467cd948f8a92086441dd9b9859885132f1adc35 Merge: cad10ce36671c feb9c5e19e913 Author: Arnaldo Carvalho de Melo Date: Wed May 11 12:37:19 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core Get fixes sent via perf/urgent, etc. Signed-off-by: Arnaldo Carvalho de Melo commit 99f785d5e5ae3b143872f55cb6f5c2d08df9c89c Merge: b63b3c490eeee 27e934bec35bc Author: Alexei Starovoitov Date: Wed May 11 08:03:16 2022 -0700 Merge branch 'selftests: xsk: add busy-poll testing plus various fixes' Magnus Karlsson says: ==================== This patch set adds busy-poll testing to the xsk selftests. It runs exactly the same tests as with regular softirq processing, but with busy-poll enabled. I have also included a number of fixes to the selftests that have been bugging me for a while or was discovered while implementing the busy-poll support. In summary these are: * Fix the error reporting of failed tests. Each failed test used to be reported as both failed and passed, messing up things. * Added a summary test printout at the end of the test suite so that users do not have to scroll up and look at the result of both the softirq run and the busy_poll run. * Added a timeout to the tests, so that if a test locks up, we report a fail and still get to run all the other tests. * Made the stats test just look and feel like all the other tests. Makes the code simpler and the test reporting more consistent. These are the 3 last commits. * Replaced zero length packets with packets of 64 byte length. This so that some of the tests will pass after commit 726e2c5929de84 ("veth: Ensure eth header is in skb's linear part"). * Added clean-up of the veth pair when terminating the test run. * Some smaller clean-ups of unused stuff. Note, to pass the busy-poll tests commit 8de8b71b787f ("xsk: Fix l2fwd for copy mode + busy poll combo") need to be present. It is present in bpf but not yet in bpf-next. Thanks: Magnus ==================== Acked-by: Björn Töpel Signed-off-by: Alexei Starovoitov commit 27e934bec35bc733733cd886508376cc8f9bd80f Author: Magnus Karlsson Date: Tue May 10 13:56:04 2022 +0200 selftests: xsk: make stat tests not spin on getsockopt Convert the stats tests from spinning on the getsockopt to just check getsockopt once when the Rx thread has received all the packets. The actual completion of receiving the last packet forms a natural point in time when the receiver is ready to call the getsockopt to check the stats. In the previous version , we just span on the getsockopt until we received the right answer. This could be forever or just getting the "correct" answer by shear luck. The pacing_on variable can now be dropped since all test can now handle pacing properly. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-10-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 4fec7028ffeaa7d8b55d65d3d1e75202196ee441 Author: Magnus Karlsson Date: Tue May 10 13:56:03 2022 +0200 selftests: xsk: make the stats tests normal tests Make the stats tests look and feel just like normal tests instead of bunched under the umbrella of TEST_STATS. This means we will always run each of them even if one fails. Also gets rid of some special case code. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-9-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 76c576638f5d8dcfd86df4dcb0641133a662b4d5 Author: Magnus Karlsson Date: Tue May 10 13:56:02 2022 +0200 selftests: xsk: introduce validation functions Introduce validation functions that can be optionally called by the Rx and Tx threads. These are then used to replace the Rx and Tx stats dispatchers. This so that we in the next commit can make the stats tests proper normal tests and not be some special case, as today. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-8-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit d41cb6c47474484c647933702e9fa8fb5054cdf2 Author: Magnus Karlsson Date: Tue May 10 13:56:01 2022 +0200 selftests: xsk: cleanup veth pair at ctrl-c Remove the veth pair when the tests are aborted by pressing ctrl-c. Currently in this situation, the veth pair is left on the system polluting the netdev space. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-7-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit db1bd7a99454db5d9003ddcd64e771e265170f5b Author: Magnus Karlsson Date: Tue May 10 13:56:00 2022 +0200 selftests: xsk: add timeout to tests Add a timeout to the tests so that if all packets have not been received within 3 seconds, fail the ongoing test. Hinders a test from dead-locking if there is something wrong. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-6-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 895b62eed2ab48c314653bcf3459521b42f9db4e Author: Magnus Karlsson Date: Tue May 10 13:55:59 2022 +0200 selftests: xsk: fix reporting of failed tests Fix the reporting of failed tests as it was broken in several ways. First, a failed test was reported as both failed and passed messing up the count. Second, tests were not aborted after a failure and could generate more "failures" messing up the count even more. Third, the failure reporting from the application to the shell script was wrong. It always reported pass. And finally, the handling of the failures in the launch script was not correct. Correct all this by propagating the failure up through the function calls to a calling function that can abort the test. A receiver or sender thread will mark the new variable in the test spec called fail, if a test has failed. This is then picked up by the main thread when everyone else has exited and this is then marked and propagated up to the calling script. Also add a summary function in the calling script so that a user does not have to go through the sub tests to see if something has failed. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-5-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit f90062b53229aeb51ed71388f8864442d9e2c6ab Author: Magnus Karlsson Date: Tue May 10 13:55:58 2022 +0200 selftests: xsk: run all tests for busy-poll Execute all xsk selftests for busy-poll mode too. Currently they were only run for the standard interrupt driven softirq mode. Replace the unused option queue-id with the new option busy-poll. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-4-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit f3e619bb34d37c4c7ee80647e68b533d1f357927 Author: Magnus Karlsson Date: Tue May 10 13:55:57 2022 +0200 selftests: xsk: do not send zero-length packets Do not try to send packets of zero length since they are dropped by veth after commit 726e2c5929de84 ("veth: Ensure eth header is in skb's linear part"). Replace these two packets with packets of length 60 so that they are not dropped. Also clean up the confusing naming. MIN_PKT_SIZE was really MIN_ETH_PKT_SIZE and PKT_SIZE was both MIN_ETH_SIZE and the default packet size called just PKT_SIZE. Make it consistent by using the right define in the right place. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-3-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 685e64a3c91df3d169be9e3e37862f118280927f Author: Magnus Karlsson Date: Tue May 10 13:55:56 2022 +0200 selftests: xsk: cleanup bash scripts Remove the spec-file that is not used any longer from the shell scripts. Also remove an unused option. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20220510115604.8717-2-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit e8aae154df6121167e5b4f156cfc2402e651d2b1 Author: Peter Geis Date: Fri Apr 29 08:38:29 2022 -0400 PCI: rockchip-dwc: Add legacy interrupt support The legacy interrupts on the rk356x PCIe controller are handled by a single muxed interrupt. Add IRQ domain support to the pcie-dw-rockchip driver to support the virtual domain. Link: https://lore.kernel.org/r/20220429123832.2376381-4-pgwipeout@gmail.com Signed-off-by: Peter Geis Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marc Zyngier commit 431e7d2eece5b906578926d15ee22a70504c364d Author: Peter Geis Date: Fri Apr 29 08:38:28 2022 -0400 PCI: rockchip-dwc: Reset core at driver probe The PCIe controller is in an unknown state at driver probe. This can lead to undesireable effects when the driver attempts to configure the controller. Prevent issues in the future by resetting the core during probe. Link: https://lore.kernel.org/r/20220429123832.2376381-3-pgwipeout@gmail.com Tested-by: Nicolas Frattaroli Signed-off-by: Peter Geis Signed-off-by: Lorenzo Pieralisi commit 931262e646caae906d818c82390ebc1716263ff0 Author: Peter Geis Date: Fri Apr 29 08:38:27 2022 -0400 dt-bindings: PCI: Remove fallback from Rockchip DesignWare binding The snps,dw-pcie binds to a standalone driver. It is not fully compatible with the Rockchip implementation and causes a hang if it binds to the device. Remove this binding as a valid fallback. Link: https://lore.kernel.org/r/20220429123832.2376381-2-pgwipeout@gmail.com Signed-off-by: Peter Geis Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit f1f8288d19d03af9d03db219c23d07a6e8ecd51b Author: Michael Kelley Date: Mon May 9 08:44:23 2022 -0700 x86/hyperv: Disable hardlockup detector by default in Hyper-V guests In newer versions of Hyper-V, the x86/x64 PMU can be virtualized into guest VMs by explicitly enabling it. Linux kernels are typically built to automatically enable the hardlockup detector if the PMU is found. To prevent the possibility of false positives due to the vagaries of VM scheduling, disable the PMU-based hardlockup detector by default in a VM on Hyper-V. The hardlockup detector can still be enabled by overriding the default with the nmi_watchdog=1 option on the kernel boot line or via sysctl at runtime. This change mimics the approach taken with KVM guests in commit 692297d8f968 ("watchdog: introduce the hardlockup_detector_disable() function"). Linux on ARM64 does not provide a PMU-based hardlockup detector, so there's no corresponding disable in the Hyper-V init code on ARM64. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1652111063-6535-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit abcebcd39fe094b68826cc04f2eca835606697f9 Author: Michael Shych Date: Sat Apr 30 14:58:07 2022 +0300 platform_data/mlxreg: Add field for notification callback Add notification callback to inform caller that platform driver probing has been completed. It allows to caller to perform some initialization flow steps depending on specific driver probing completion. Signed-off-by: Michael Shych Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20220430115809.54565-2-michaelsh@nvidia.com Signed-off-by: Hans de Goede commit 734387ec2f9d77b00276042b1fa7c95f48ee879d Author: Hao Jia Date: Sat Apr 30 16:58:43 2022 +0800 sched/deadline: Remove superfluous rq clock update in push_dl_task() The change to call update_rq_clock() before activate_task() commit 840d719604b0 ("sched/deadline: Update rq_clock of later_rq when pushing a task") is no longer needed since commit f4904815f97a ("sched/deadline: Fix double accounting of rq/running bw in push & pull") removed the add_running_bw() before the activate_task(). So we remove some comments that are no longer needed and update rq clock in activate_task(). Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20220430085843.62939-3-jiahao.os@bytedance.com commit 2679a83731d51a744657f718fc02c3b077e47562 Author: Hao Jia Date: Sat Apr 30 16:58:42 2022 +0800 sched/core: Avoid obvious double update_rq_clock warning When we use raw_spin_rq_lock() to acquire the rq lock and have to update the rq clock while holding the lock, the kernel may issue a WARN_DOUBLE_CLOCK warning. Since we directly use raw_spin_rq_lock() to acquire rq lock instead of rq_lock(), there is no corresponding change to rq->clock_update_flags. In particular, we have obtained the rq lock of other CPUs, the rq->clock_update_flags of this CPU may be RQCF_UPDATED at this time, and then calling update_rq_clock() will trigger the WARN_DOUBLE_CLOCK warning. So we need to clear RQCF_UPDATED of rq->clock_update_flags to avoid the WARN_DOUBLE_CLOCK warning. For the sched_rt_period_timer() and migrate_task_rq_dl() cases we simply replace raw_spin_rq_lock()/raw_spin_rq_unlock() with rq_lock()/rq_unlock(). For the {pull,push}_{rt,dl}_task() cases, we add the double_rq_clock_clear_update() function to clear RQCF_UPDATED of rq->clock_update_flags, and call double_rq_clock_clear_update() before double_lock_balance()/double_rq_lock() returns to avoid the WARN_DOUBLE_CLOCK warning. Some call trace reports: Call Trace 1: sched_rt_period_timer+0x10f/0x3a0 ? enqueue_top_rt_rq+0x110/0x110 __hrtimer_run_queues+0x1a9/0x490 hrtimer_interrupt+0x10b/0x240 __sysvec_apic_timer_interrupt+0x8a/0x250 sysvec_apic_timer_interrupt+0x9a/0xd0 asm_sysvec_apic_timer_interrupt+0x12/0x20 Call Trace 2: activate_task+0x8b/0x110 push_rt_task.part.108+0x241/0x2c0 push_rt_tasks+0x15/0x30 finish_task_switch+0xaa/0x2e0 ? __switch_to+0x134/0x420 __schedule+0x343/0x8e0 ? hrtimer_start_range_ns+0x101/0x340 schedule+0x4e/0xb0 do_nanosleep+0x8e/0x160 hrtimer_nanosleep+0x89/0x120 ? hrtimer_init_sleeper+0x90/0x90 __x64_sys_nanosleep+0x96/0xd0 do_syscall_64+0x34/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Call Trace 3: deactivate_task+0x93/0xe0 pull_rt_task+0x33e/0x400 balance_rt+0x7e/0x90 __schedule+0x62f/0x8e0 do_task_dead+0x3f/0x50 do_exit+0x7b8/0xbb0 do_group_exit+0x2d/0x90 get_signal+0x9df/0x9e0 ? preempt_count_add+0x56/0xa0 ? __remove_hrtimer+0x35/0x70 arch_do_signal_or_restart+0x36/0x720 ? nanosleep_copyout+0x39/0x50 ? do_nanosleep+0x131/0x160 ? audit_filter_inodes+0xf5/0x120 exit_to_user_mode_prepare+0x10f/0x1e0 syscall_exit_to_user_mode+0x17/0x30 do_syscall_64+0x40/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Call Trace 4: update_rq_clock+0x128/0x1a0 migrate_task_rq_dl+0xec/0x310 set_task_cpu+0x84/0x1e4 try_to_wake_up+0x1d8/0x5c0 wake_up_process+0x1c/0x30 hrtimer_wakeup+0x24/0x3c __hrtimer_run_queues+0x114/0x270 hrtimer_interrupt+0xe8/0x244 arch_timer_handler_phys+0x30/0x50 handle_percpu_devid_irq+0x88/0x140 generic_handle_domain_irq+0x40/0x60 gic_handle_irq+0x48/0xe0 call_on_irq_stack+0x2c/0x60 do_interrupt_handler+0x80/0x84 Steps to reproduce: 1. Enable CONFIG_SCHED_DEBUG when compiling the kernel 2. echo 1 > /sys/kernel/debug/clear_warn_once echo "WARN_DOUBLE_CLOCK" > /sys/kernel/debug/sched/features echo "NO_RT_PUSH_IPI" > /sys/kernel/debug/sched/features 3. Run some rt/dl tasks that periodically work and sleep, e.g. Create 2*n rt or dl (90% running) tasks via rt-app (on a system with n CPUs), and Dietmar Eggemann reports Call Trace 4 when running on PREEMPT_RT kernel. Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20220430085843.62939-2-jiahao.os@bytedance.com commit 9cb23f598c641c1dcbe18defd219cdc439bc94a8 Author: Ravi Bangoria Date: Mon May 9 10:19:14 2022 +0530 perf/ibs: Fix comment s/IBS Op Data 2/IBS Op Data 1/ for MSR 0xc0011035. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-9-ravi.bangoria@amd.com commit 838de1d843fc9b6161e0e1c6308a8c027d08606d Author: Ravi Bangoria Date: Mon May 9 10:19:10 2022 +0530 perf/amd/ibs: Advertise zen4_ibs_extensions as pmu capability attribute PMU driver can advertise certain feature via capability attribute('caps' sysfs directory) which can be consumed by userspace tools like perf. Add zen4_ibs_extensions capability attribute for IBS pmus. This attribute will be enabled when CPUID_Fn8000001B_EAX[11] is set. With patch on Zen4: $ ls /sys/bus/event_source/devices/ibs_op/caps zen4_ibs_extensions Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-5-ravi.bangoria@amd.com commit ba5d35b442c65f32d38ef61f732218274c6dcf4c Author: Ravi Bangoria Date: Mon May 9 10:19:09 2022 +0530 perf/amd/ibs: Add support for L3 miss filtering IBS L3 miss filtering works by tagging an instruction on IBS counter overflow and generating an NMI if the tagged instruction causes an L3 miss. Samples without an L3 miss are discarded and counter is reset with random value (between 1-15 for fetch pmu and 1-127 for op pmu). This helps in reducing sampling overhead when user is interested only in such samples. One of the use case of such filtered samples is to feed data to page-migration daemon in tiered memory systems. Add support for L3 miss filtering in IBS driver via new pmu attribute "l3missonly". Example usage: # perf record -a -e ibs_op/l3missonly=1/ --raw-samples sleep 5 Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-4-ravi.bangoria@amd.com commit 2a7a7e658682bfd7501dc6b4c9d365aa6c79788a Author: Ravi Bangoria Date: Mon May 9 10:19:08 2022 +0530 perf/amd/ibs: Use ->is_visible callback for dynamic attributes Currently, some attributes are added at build time whereas others at boot time depending on IBS pmu capabilities. Instead, we can just add all attribute groups at build time but hide individual group at boot time using more appropriate ->is_visible() callback. Also, struct perf_ibs has bunch of fields for pmu attributes which just pass on the pointer, does not do anything else. Remove them. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-3-ravi.bangoria@amd.com commit 39b2ca75eec8a33e2ffdb8aa0c4840ec3e3b472c Author: Ravi Bangoria Date: Mon May 9 10:19:07 2022 +0530 perf/amd/ibs: Cascade pmu init functions' return value IBS pmu initialization code ignores return value provided by callee functions. Fix it. Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220509044914.1473-2-ravi.bangoria@amd.com commit f758bc5a91233bb5b5b6994a8e72ba4eba0e9ab2 Author: Kan Liang Date: Wed May 4 12:44:13 2022 -0700 perf/x86/uncore: Add new Alder Lake and Raptor Lake support From the perspective of the uncore PMU, there is nothing changed for the new Alder Lake N and Raptor Lake P. Add new PCIIDs of IMC. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220504194413.1003071-5-kan.liang@linux.intel.com commit e5ae168e8394dc3c6dce580690c87ff2cf16cdbb Author: Kan Liang Date: Wed May 4 12:44:12 2022 -0700 perf/x86/uncore: Clean up uncore_pci_ids[] The initialization code to assign PCI IDs for different platforms is similar. Add the new macros to reduce the redundant code. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220504194413.1003071-4-kan.liang@linux.intel.com commit cd971104ac7e41ff66082b9b584d319bb0688a1a Author: Kan Liang Date: Wed May 4 12:44:11 2022 -0700 perf/x86/cstate: Add new Alder Lake and Raptor Lake support From the perspective of Intel cstate residency counters, there is nothing changed for the new Alder Lake N and Raptor Lake P. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220504194413.1003071-3-kan.liang@linux.intel.com commit d773a73366bd54d0c75c533269fe2f0765ce42ee Author: Kan Liang Date: Wed May 4 12:44:10 2022 -0700 perf/x86/msr: Add new Alder Lake and Raptor Lake support The new Alder Lake N and Raptor Lake P also support PPERF and SMI_COUNT MSRs. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220504194413.1003071-2-kan.liang@linux.intel.com commit c2a960f7c5741cc4f03b4e587afeb89ad53c32c5 Author: Kan Liang Date: Wed May 4 12:44:09 2022 -0700 perf/x86: Add new Alder Lake and Raptor Lake support From PMU's perspective, there is no difference for the new Alder Lake N and Raptor Lake P. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220504194413.1003071-1-kan.liang@linux.intel.com commit 47319846a9e2ab1c4d22108e891818d003615bd8 Merge: 3d47083b9ff46 672c0c5173427 Author: Peter Zijlstra Date: Wed May 11 16:27:06 2022 +0200 Merge branch 'v5.18-rc5' Obtain the new INTEL_FAM6 stuff required. Signed-off-by: Peter Zijlstra commit 434e09e7575b02e014931bc5672289fabd7a825c Author: Waiman Long Date: Tue May 10 15:21:33 2022 -0400 locking/qrwlock: Change "queue rwlock" to "queued rwlock" Queued rwlock was originally named "queue rwlock" which wasn't quite grammatically correct. However there are still some "queue rwlock" references in the code. Change those to "queued rwlock" for consistency. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220510192134.434753-1-longman@redhat.com commit deaf7c4b4bf8b802cc465bb9b33fe6c76e812924 Author: Thomas Gleixner Date: Mon May 9 21:03:43 2022 +0200 lockdep: Delete local_irq_enable_in_hardirq() No more users and there is no desire to grow new ones. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/8735hir0j4.ffs@tglx commit 1d565935e3b9ccc682631e0bc6e415a7f48295d9 Author: AngeloGioacchino Del Regno Date: Mon Apr 4 16:48:58 2022 +0200 PCI: mediatek-gen3: Assert resets to ensure expected init state The controller may have been left out of reset by the bootloader, in which case, before the powerup sequence, the controller will be found preconfigured with values that were set before booting the kernel: this produces a controller failure, with the result of a failure during the mtk_pcie_startup_port() sequence as the PCIe link never gets up. To ensure that we get a clean start in an expected state, assert both the PHY and MAC resets before executing the controller power-up sequence. Link: https://lore.kernel.org/r/20220404144858.92390-1-angelogioacchino.delregno@collabora.com Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Lorenzo Pieralisi commit f68cd356d0ac0101263c551bd951db2082d38e43 Author: Andy Shevchenko Date: Wed May 11 15:34:21 2022 +0300 pinctrl: broxton: Add module alias for Intel Apollo Lake We have platform device IDs for Broxton and Apollo Lake, but module alias is provided only for the former. Make it consistent by providing an alias for Apollo Lake. Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg commit f569add47119fa910ed7711b26b8d38e21f7ea77 Author: Anuj Gupta Date: Wed May 11 11:17:49 2022 +0530 nvme: add vectored-io support for uring-cmd wire up support for async passthru that takes an array of buffers (using iovec). Exposed via a new op NVME_URING_CMD_IO_VEC. Same 'struct nvme_uring_cmd' is to be used with - 1. cmd.addr as base address of user iovec array 2. cmd.data_len as count of iovec array elements Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220511054750.20432-6-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 456cba386e94f22fa1b1426303fdcac9e66b1417 Author: Kanchan Joshi Date: Wed May 11 11:17:48 2022 +0530 nvme: wire-up uring-cmd support for io-passthru on char-device. Introduce handler for fops->uring_cmd(), implementing async passthru on char device (/dev/ngX). The handler supports newly introduced operation NVME_URING_CMD_IO. This operates on a new structure nvme_uring_cmd, which is similar to struct nvme_passthru_cmd64 but without the embedded 8b result field. This field is not needed since uring-cmd allows to return additional result via big-CQE. Signed-off-by: Kanchan Joshi Signed-off-by: Anuj Gupta Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220511054750.20432-5-joshi.k@samsung.com Signed-off-by: Jens Axboe commit bcad2565b5d64700cf68cc9d48618ab817ff5bc4 Author: Christoph Hellwig Date: Wed May 11 11:17:47 2022 +0530 nvme: refactor nvme_submit_user_cmd() Divide the work into two helpers, namely nvme_alloc_user_request and nvme_execute_user_rq. This is a prep patch, to help wiring up uring-cmd support in nvme. Signed-off-by: Christoph Hellwig [axboe: fold in fix for assuming bio is non-NULL] Link: https://lore.kernel.org/r/20220511054750.20432-4-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 1c2d2fff6dc04662dc8e86b537989643e1abeed9 Author: Jens Axboe Date: Wed May 11 11:17:46 2022 +0530 block: wire-up support for passthrough plugging Add support for plugging in passthrough path. When plugging is enabled, the requests are added to a plug instead of getting dispatched to the driver. And when the plug is finished, the whole batch gets dispatched via ->queue_rqs which turns out to be more efficient. Otherwise dispatching used to happen via ->queue_rq, one request at a time. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220511054750.20432-3-joshi.k@samsung.com Signed-off-by: Jens Axboe commit ee692a21e9bf8354bd3ec816f1cf4bff8619ed77 Author: Jens Axboe Date: Wed May 11 11:17:45 2022 +0530 fs,io_uring: add infrastructure for uring-cmd file_operations->uring_cmd is a file private handler. This is somewhat similar to ioctl but hopefully a lot more sane and useful as it can be used to enable many io_uring capabilities for the underlying operation. IORING_OP_URING_CMD is a file private kind of request. io_uring doesn't know what is in this command type, it's for the provider of ->uring_cmd() to deal with. Co-developed-by: Kanchan Joshi Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220511054750.20432-2-joshi.k@samsung.com Signed-off-by: Jens Axboe commit b6b1c3ce06ca438eb24e0f45bf0e63ecad0369f5 Author: Laurent Dufour Date: Wed May 4 12:12:44 2022 +0200 powerpc/rtas: Keep MSR[RI] set when calling RTAS RTAS runs in real mode (MSR[DR] and MSR[IR] unset) and in 32-bit big endian mode (MSR[SF,LE] unset). The change in MSR is done in enter_rtas() in a relatively complex way, since the MSR value could be hardcoded. Furthermore, a panic has been reported when hitting the watchdog interrupt while running in RTAS, this leads to the following stack trace: watchdog: CPU 24 Hard LOCKUP watchdog: CPU 24 TB:997512652051031, last heartbeat TB:997504470175378 (15980ms ago) ... Supported: No, Unreleased kernel CPU: 24 PID: 87504 Comm: drmgr Kdump: loaded Tainted: G E X 5.14.21-150400.71.1.bz196362_2-default #1 SLE15-SP4 (unreleased) 0d821077ef4faa8dfaf370efb5fdca1fa35f4e2c NIP: 000000001fb41050 LR: 000000001fb4104c CTR: 0000000000000000 REGS: c00000000fc33d60 TRAP: 0100 Tainted: G E X (5.14.21-150400.71.1.bz196362_2-default) MSR: 8000000002981000 CR: 48800002 XER: 20040020 CFAR: 000000000000011c IRQMASK: 1 GPR00: 0000000000000003 ffffffffffffffff 0000000000000001 00000000000050dc GPR04: 000000001ffb6100 0000000000000020 0000000000000001 000000001fb09010 GPR08: 0000000020000000 0000000000000000 0000000000000000 0000000000000000 GPR12: 80040000072a40a8 c00000000ff8b680 0000000000000007 0000000000000034 GPR16: 000000001fbf6e94 000000001fbf6d84 000000001fbd1db0 000000001fb3f008 GPR20: 000000001fb41018 ffffffffffffffff 000000000000017f fffffffffffff68f GPR24: 000000001fb18fe8 000000001fb3e000 000000001fb1adc0 000000001fb1cf40 GPR28: 000000001fb26000 000000001fb460f0 000000001fb17f18 000000001fb17000 NIP [000000001fb41050] 0x1fb41050 LR [000000001fb4104c] 0x1fb4104c Call Trace: Instruction dump: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX Oops: Unrecoverable System Reset, sig: 6 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries ... Supported: No, Unreleased kernel CPU: 24 PID: 87504 Comm: drmgr Kdump: loaded Tainted: G E X 5.14.21-150400.71.1.bz196362_2-default #1 SLE15-SP4 (unreleased) 0d821077ef4faa8dfaf370efb5fdca1fa35f4e2c NIP: 000000001fb41050 LR: 000000001fb4104c CTR: 0000000000000000 REGS: c00000000fc33d60 TRAP: 0100 Tainted: G E X (5.14.21-150400.71.1.bz196362_2-default) MSR: 8000000002981000 CR: 48800002 XER: 20040020 CFAR: 000000000000011c IRQMASK: 1 GPR00: 0000000000000003 ffffffffffffffff 0000000000000001 00000000000050dc GPR04: 000000001ffb6100 0000000000000020 0000000000000001 000000001fb09010 GPR08: 0000000020000000 0000000000000000 0000000000000000 0000000000000000 GPR12: 80040000072a40a8 c00000000ff8b680 0000000000000007 0000000000000034 GPR16: 000000001fbf6e94 000000001fbf6d84 000000001fbd1db0 000000001fb3f008 GPR20: 000000001fb41018 ffffffffffffffff 000000000000017f fffffffffffff68f GPR24: 000000001fb18fe8 000000001fb3e000 000000001fb1adc0 000000001fb1cf40 GPR28: 000000001fb26000 000000001fb460f0 000000001fb17f18 000000001fb17000 NIP [000000001fb41050] 0x1fb41050 LR [000000001fb4104c] 0x1fb4104c Call Trace: Instruction dump: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX ---[ end trace 3ddec07f638c34a2 ]--- This happens because MSR[RI] is unset when entering RTAS but there is no valid reason to not set it here. RTAS is expected to be called with MSR[RI] as specified in PAPR+ section "7.2.1 Machine State": R1–7.2.1–9. If called with MSR[RI] equal to 1, then RTAS must protect its own critical regions from recursion by setting the MSR[RI] bit to 0 when in the critical regions. Fixing this by reviewing the way MSR is compute before calling RTAS. Now a hardcoded value meaning real mode, 32 bits big endian mode and Recoverable Interrupt is loaded. In the case MSR[S] is set, it will remain set while entering RTAS as only urfid can unset it (thanks Fabiano). In addition a check is added in do_enter_rtas() to detect calls made with MSR[RI] unset, as we are forcing it on later. This patch has been tested on the following machines: Power KVM Guest P8 S822L (host Ubuntu kernel 5.11.0-49-generic) PowerVM LPAR P8 9119-MME (FW860.A1) p9 9008-22L (FW950.00) P10 9080-HEX (FW1010.00) Suggested-by: Nicholas Piggin Signed-off-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220504101244.12107-1-ldufour@linux.ibm.com commit 5ad1aa007da5f1907673a7cbfdf6e355835ef428 Author: Christophe Leroy Date: Wed Apr 6 08:23:21 2022 +0200 powerpc/8xx: Use kmalloced data structure instead of global static Use a kmalloced data structure to store interrupt controller internal data instead of static global variables. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c8f0866ee013113d5e28948943cf0586e49f5353.1649226186.git.christophe.leroy@csgroup.eu commit e3ba31b78074bee155662edccd9ca00324087e04 Author: Christophe Leroy Date: Wed Apr 6 08:23:20 2022 +0200 powerpc/8xx: Remove mpc8xx_pics_init() mpc8xx_pics_init() is now only a trampoline to mpc8xx_pic_init(). Remove mpc8xx_pics_init() and use mpc8xx_pic_init() directly. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9c55a698adb5ba3b7b77023170fcaf0acb5d2d81.1649226186.git.christophe.leroy@csgroup.eu commit 14d893fc6846892ae68f8b259594d9cdae99e515 Author: Christophe Leroy Date: Wed Apr 6 08:23:19 2022 +0200 powerpc/8xx: Convert CPM1 interrupt controller to platform_device In the same logic as commit be7ecbd240b2 ("soc: fsl: qe: convert QE interrupt controller to platform_device"), convert CPM1 interrupt controller to platform_device. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fb80d0b2077312079c49da0296e25591578771cd.1649226186.git.christophe.leroy@csgroup.eu commit 22add2a20e968291251d46d1b833b651b6aba5d7 Author: Christophe Leroy Date: Wed Apr 6 08:23:18 2022 +0200 powerpc/8xx: Convert CPM1 error interrupt handler to platform driver Add CPM error interrupt as a standalone platform driver, to simplify the init of CPM interrupt handler. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/375a72df6e4a26c5959cc81a6c6d46152efa2306.1649226186.git.christophe.leroy@csgroup.eu commit acf9e575d889eb8806be2c8451e7ad12bf444b50 Author: Christophe Leroy Date: Wed Apr 6 08:23:17 2022 +0200 powerpc/8xx: Move CPM interrupt controller into a dedicated file CPM interrupt controller is quite standalone. Move it into a dedicated file. It will help for next step which will change it to a platform driver. This is pure code move, checkpatch report is ignored at this point, except one parenthesis alignment which would remain at the end of the series. All other points fly away with following patches. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d3a7dc832d905bed14b35d83410cdb69a7ba20e8.1649226186.git.christophe.leroy@csgroup.eu commit d8d2af70b98109418bb16ff6638d7c1c4336f7fe Author: Christophe Leroy Date: Sat Apr 2 11:52:33 2022 +0200 cxl/ocxl: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Acked-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a2bae89b280e7a7cb87889635d9911d6a245e780.1648833388.git.christophe.leroy@csgroup.eu commit a486e512d1f3fb93b0406ab125f35777d22b47ba Author: Christophe Leroy Date: Fri Apr 1 19:15:53 2022 +0200 macintosh: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/04961364547fe4556e30cb302b0e20a939b83426.1648833027.git.christophe.leroy@csgroup.eu commit 1751289268ef959db68b0b6f798d904d6403309a Author: Christophe Leroy Date: Tue Mar 22 16:40:21 2022 +0100 powerpc/code-patching: Use jump_label to check if poking_init() is done It's only during early startup that poking_init() is not done yet, for instance when calling ftrace_init(). Once poking_init() has been called there must be a poking area, no need to check it everytime patch_instruction() is called. ftrace activation time is reduced by 7% with the change on an 8xx. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8d6088aca7b63247377b6d9e4897d08d935fbe93.1647962456.git.christophe.leroy@csgroup.eu commit b033767848c4115e486b1a51946de3bee2ac0fa6 Author: Christophe Leroy Date: Tue Mar 22 16:40:20 2022 +0100 powerpc/code-patching: Use jump_label for testing freed initmem Once init is done, initmem is freed forever so no need to test system_state at every call to patch_instruction(). Use jump_label. This reduces by 2% the time needed to activate ftrace on an 8xx. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0aee964721cab7316cffde21a2ca223cee14d373.1647962456.git.christophe.leroy@csgroup.eu commit 30097efa334a706f9021b9aee6efcddcfa44a78a Author: Conor Dooley Date: Wed May 11 10:55:05 2022 +0100 PCI: microchip: Add missing chained_irq_enter()/exit() calls Two of the chained IRQ handlers miss their chained_irq_enter()/chained_irq_exit() calls, so add them in to avoid potentially lost interrupts. Reported by: Bjorn Helgaas Link: https://lore.kernel.org/linux-pci/87h76b8nxc.wl-maz@kernel.org Link: https://lore.kernel.org/r/20220511095504.2273799-1-conor.dooley@microchip.com Signed-off-by: Conor Dooley Signed-off-by: Lorenzo Pieralisi commit fb396bb459c1fa3920dd8a9d84680398c65fed75 Author: Anshuman Khandual Date: Tue May 10 10:09:30 2022 +0530 arm64/hugetlb: Drop TLB flush from get_clear_flush() This drops now redundant TLB flush in get_clear_flush() which is no longer required after recent commit 697a1d44af8b ("tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry"). It also renames this function i.e dropping off '_flush' and replacing it with '__contig' as appropriate. Cc: Will Deacon Cc: Mike Kravetz Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220510043930.2410985-1-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit a6809941c1f17f455db2cf4ca19c6d8c8746ec25 Author: Francesco Dolcini Date: Mon Apr 4 10:15:09 2022 +0200 PCI: imx6: Fix PERST# start-up sequence According to the PCIe standard the PERST# signal (reset-gpio in fsl,imx* compatible dts) should be kept asserted for at least 100 usec before the PCIe refclock is stable, should be kept asserted for at least 100 msec after the power rails are stable and the host should wait at least 100 msec after it is de-asserted before accessing the configuration space of any attached device. From PCIe CEM r2.0, sec 2.6.2 T-PVPERL: Power stable to PERST# inactive - 100 msec T-PERST-CLK: REFCLK stable before PERST# inactive - 100 usec. From PCIe r5.0, sec 6.6.1 With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms before sending a Configuration Request to the device immediately below that Port. Failure to do so could prevent PCIe devices to be working correctly, and this was experienced with real devices. Move reset assert to imx6_pcie_assert_core_reset(), this way we ensure that PERST# is asserted before enabling any clock, move de-assert to the end of imx6_pcie_deassert_core_reset() after the clock is enabled and deemed stable and add a new delay of 100 msec just afterward. Link: https://lore.kernel.org/all/20220211152550.286821-1-francesco.dolcini@toradex.com Link: https://lore.kernel.org/r/20220404081509.94356-1-francesco.dolcini@toradex.com Fixes: bb38919ec56e ("PCI: imx6: Add support for i.MX6 PCIe controller") Signed-off-by: Francesco Dolcini Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach Acked-by: Richard Zhu commit 2a66c3124afd2782015d160f8bad693488ce68de Author: Masahiro Yamada Date: Mon May 9 04:06:19 2022 +0900 modpost: change the license of EXPORT_SYMBOL to bool type There were more EXPORT_SYMBOL types in the past. The following commits removed unused ones. - f1c3d73e973c ("module: remove EXPORT_SYMBOL_GPL_FUTURE") - 367948220fce ("module: remove EXPORT_UNUSED_SYMBOL*") There are 3 remaining in enum export, but export_unknown does not make any sense because we never expect such a situation like "we do not know how it was exported". If the symbol name starts with "__ksymtab_", but the section name does not start with "___ksymtab+" or "___ksymtab_gpl+", it is not an exported symbol. It occurs when a variable starting with "__ksymtab_" is directly defined: int __ksymtab_foo; Presumably, there is no practical issue for using such a weird variable name (but there is no good reason for doing so, either). Anyway, that is not an exported symbol. Setting export_unknown is not the right thing to do. Do not call sym_add_exported() in this case. With pointless export_unknown removed, the export type finally becomes boolean (either EXPORT_SYMBOL or EXPORT_SYMBOL_GPL). I renamed the field name to is_gpl_only. EXPORT_SYMBOL_GPL sets it true. Only GPL-compatible modules can use it. I removed the orphan comment, "How a symbol is exported", which is unrelated to sec_mismatch_count. It is about enum export. See commit bd5cbcedf446 ("kbuild: export-type enhancement to modpost.c") Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor commit ce79c406a24c3825a2adeaa4668f79f8d5d72e58 Author: Masahiro Yamada Date: Mon May 9 04:06:18 2022 +0900 modpost: remove left-over cross_compile declaration This is a remnant of commit 6543becf26ff ("mod/file2alias: make modalias generation safe for cross compiling"). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 78e9e56af3858bf2c52c065daa6c8bee0d72048c Author: Masahiro Yamada Date: Thu May 5 16:22:35 2022 +0900 kbuild: record symbol versions in *.cmd files When CONFIG_MODVERSIONS=y, the output from genksyms is saved in separate *.symversions files, and will be used much later when CONFIG_LTO_CLANG=y because it is impossible to update LLVM bit code here. This approach is not robust because: - *.symversions may or may not exist. If *.symversions does not exist, we never know if it is missing for legitimate reason (i.e. no EXPORT_SYMBOL) or something bad has happened (for example, the user accidentally deleted it). Once it occurs, it is not self-healing because *.symversions is generated as a side effect. - stale (i.e. invalid) *.symversions might be picked up if an object is generated in a non-ordinary way, and corresponding *.symversions (, which was generated by old builds) just happen to exist. A more robust approach is to save symbol versions in *.cmd files because: - *.cmd always exists (if the object is generated by if_changed rule or friends). Even if the user accidentally deletes it, it will be regenerated in the next build. - *.cmd is always re-generated when the object is updated. This avoid stale version information being picked up. I will remove *.symversions later. Signed-off-by: Masahiro Yamada Tested-by: Nicolas Schier Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor commit e493f472752000968f5b30aac10391288cfbf5b1 Author: Masahiro Yamada Date: Thu May 5 16:22:34 2022 +0900 kbuild: generate a list of objects in vmlinux A *.mod file lists the member objects of a module, but vmlinux does not have such a file. Generate this list to allow modpost to know all the member objects. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor commit a44abaca0e196cfeef2374ed663b97daa1ad112a Author: Masahiro Yamada Date: Thu May 5 16:22:33 2022 +0900 modpost: move *.mod.c generation to write_mod_c_files() A later commit will add more code to this list_for_each_entry loop. Before that, move the loop body into a separate helper function. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor commit 7fedac9698b3a56571064eb3b23063f09c93eb94 Author: Masahiro Yamada Date: Thu May 5 16:22:32 2022 +0900 modpost: merge add_{intree_flag,retpoline,staging_flag} to add_header add_intree_flag(), add_retpoline(), and add_staging_flag() are small enough to be merged into add_header(). Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Tested-by: Nathan Chancellor commit 5d53508d1bae79a84840bcfd3c45094d2081d6d2 Author: Reza Arbab Date: Wed May 4 16:27:14 2022 -0500 scripts/prune-kernel: Use kernel-install if available If the new-kernel-pkg utility isn't present, try using kernel-install. This is what the %preun scriptlet in scripts/package/mkspec does too. Signed-off-by: Reza Arbab Signed-off-by: Masahiro Yamada commit f774f5bb87d132b48bc4a99598c45f35121ac054 Author: Masahiro Yamada Date: Tue May 3 11:47:16 2022 +0900 kbuild: factor out the common installation code into scripts/install.sh Many architectures have similar install.sh scripts. The first half is really generic; it verifies that the kernel image and System.map exist, then executes ~/bin/${INSTALLKERNEL} or /sbin/${INSTALLKERNEL} if available. The second half is kind of arch-specific; it copies the kernel image and System.map to the destination, but the code is slightly different. Factor out the generic part into scripts/install.sh. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 63678eecec57fc51b778be3da35a397931287170 Author: Heiko Carstens Date: Fri May 6 11:33:19 2022 +0200 s390/preempt: disable __preempt_count_add() optimization for PROFILE_ALL_BRANCHES gcc 12 does not (always) optimize away code that should only be generated if parameters are constant and within in a certain range. This depends on various obscure kernel config options, however in particular PROFILE_ALL_BRANCHES can trigger this compile error: In function ‘__atomic_add_const’, inlined from ‘__preempt_count_add.part.0’ at ./arch/s390/include/asm/preempt.h:50:3: ./arch/s390/include/asm/atomic_ops.h:80:9: error: impossible constraint in ‘asm’ 80 | asm volatile( \ | ^~~ Workaround this by simply disabling the optimization for PROFILE_ALL_BRANCHES, since the kernel will be so slow, that this optimization won't matter at all. Reported-by: Thomas Richter Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens commit 5ace65ebb5ce9fe1cc8fdbdd97079fb566ef0ea4 Author: Sven Schnelle Date: Tue May 3 09:58:33 2022 +0200 s390/stp: clock_delta should be signed clock_delta is declared as unsigned long in various places. However, the clock sync delta can be negative. This would add a huge positive offset in clock_sync_global where clock_delta is added to clk.eitod which is a 72 bit integer. Declare it as signed long to fix this. Cc: stable@vger.kernel.org Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 03780c83c78546310c084ef3df69da2a0bafbcb5 Author: Sven Schnelle Date: Mon May 2 11:12:09 2022 +0200 s390/stp: fix todoff size The size of the TOD offset field in the stp info response is 64 bits. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 710c8d6c026c0bbbd5d9036ef210e263edeb07d3 Author: Linu Cherian Date: Mon May 9 10:02:21 2022 +0530 arm64: Declare non global symbols as static Fix below sparse warnings introduced while adding errata. arch/arm64/kernel/cpu_errata.c:218:25: sparse: warning: symbol 'cavium_erratum_23154_cpus' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: Linu Cherian Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220509043221.16361-1-lcherian@marvell.com Signed-off-by: Catalin Marinas commit fa33382c7f74a1444f90f324007da1431d7180b2 Author: Bryan Cain Date: Thu May 5 13:12:21 2022 -0600 HID: apple: Properly handle function keys on Keychron keyboards Keychron's C-series and K-series of keyboards copy the vendor and product IDs of an Apple keyboard, but only behave like that device when set to "Mac" mode. In "Windows" mode, the Fn key doesn't generate a scancode, so it's impossible to use the F1-F12 keys when fnmode is set to its default value of 1. To fix this, make fnmode default to the new value of 3, which behaves like fnmode=2 for Keychron keyboards and like fnmode=1 for actual Apple keyboards. This way, Keychron devices are fully usable in both "Windows" and "Mac" modes, while behavior is unchanged for everything else. Signed-off-by: Bryan Cain Reviewed-by: Hans de Goede Tested-by: José Expósito Signed-off-by: Jiri Kosina commit f7d8e387d9aeff963e6691c0166269b8042b4ff9 Author: Nikolai Kondrashov Date: Sun May 8 18:01:46 2022 +0200 HID: uclogic: Switch to Digitizer usage for styluses The (incorrect) "Pen" (0x02) application usage used in replacement report descriptors throughout the drivers leads to all tablets recognized as a "direct" input device (i.e. a tablet monitor) by recent kernels, which messes up desktop environments [1]. Replace the application usage with "Digitizer" (0x01) for each non-display graphics tablet. [1] https://lore.kernel.org/linux-input/f39ce5d5-bd5b-bd3f-3ea2-9b2a89ba1eb1@gmail.com/ Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 61b1db5a14b7651e808176c17d629114763c3641 Author: Roman Romanenko Date: Sun May 8 18:01:45 2022 +0200 HID: uclogic: Add pen support for XP-PEN Star 06 Similar to other UGEE pens, but the IDs were missing. Signed-off-by: Roman Romanenko Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 118dfdeaa3c64c781d0219fd58a65dc31b97c3f5 Author: Nikolai Kondrashov Date: Sun May 8 18:01:44 2022 +0200 HID: uclogic: Differentiate touch ring and touch strip Improve support for touch strips. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit fbc08b4e8ea5582029dc3c05c954d4d157e4d3f8 Author: Nikolai Kondrashov Date: Sun May 8 18:01:43 2022 +0200 HID: uclogic: Always shift touch reports to zero Always decrement touch report values to have the range start with zero, regardless if flipped or not. This fixes the future non-flipped touch strip reports. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit caf7e93479c73374a9fcad29f90477280444584e Author: Nikolai Kondrashov Date: Sun May 8 18:01:42 2022 +0200 HID: uclogic: Do not focus on touch ring only Accommodate both touch ring and touch strip in naming throughout hid-uclogic by talking about abstract "touch" instead of "touch ring", wherever possible. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 945d5dd5a5f88b99c090d80948f589416e2ceb37 Author: Nikolai Kondrashov Date: Sun May 8 18:01:41 2022 +0200 HID: uclogic: Return raw parameters from v2 pen init Return the raw parameters buffer from uclogic_params_pen_init_v2(), if requested, as a way to identify the tablet. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit a228809fa6f39c3fa46ac6b929024686750f7a09 Author: Nikolai Kondrashov Date: Sun May 8 18:01:40 2022 +0200 HID: uclogic: Move param printing to a function Move parameter printing from a format string/argument list to a function to allow printing the full parameters, which now wouldn't fit into a single print call. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 806fc359a39458c54dedc28b904ca27b3fc79b19 Author: Basavaraj Natikar Date: Mon May 9 18:50:26 2022 +0530 HID: core: Display "SENSOR HUB" for sensor hub bus string in hid_info Currently sensor hub shows "", but this is a pretty common type available in many notebooks. Hence using the string "SENSOR HUB". Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit a8641d7d8500d41d312350470464e03f3df3672a Author: Basavaraj Natikar Date: Mon May 9 18:50:25 2022 +0530 HID: amd_sfh: Move bus declaration outside of amd-sfh This should allow external drivers to reference this bus ID reservation and detect data coming from amd-sfh. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 863fcfec6203363d92190ff0b8c93e6030e41fa9 Author: Basavaraj Natikar Date: Mon May 9 18:50:24 2022 +0530 HID: amd_sfh: Add physical location to HID device when HID device is loaded a wrong string is shown as physical location is not declared. ``` hid-generic 0020:1022:0001.0009: hidraw4: HID v0.00 Device [hid-amdtp 1022:0001] on ``` Hence use amd sfh driver name or device name which is connected to the HID device. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 10f865cdcf37d26ae5e9595a7b4f9e06538e84e5 Author: Basavaraj Natikar Date: Mon May 9 18:50:23 2022 +0530 HID: amd_sfh: Modify the hid name Modifying the amd-sfh hid name to meaningful name. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 206c3c2d85de8847fb732a5fb71443bacd287216 Author: Basavaraj Natikar Date: Mon May 9 18:50:22 2022 +0530 HID: amd_sfh: Modify the bus name Modifying the amd-sfh bus name to meaningful name. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 696455e9d099fb024017e4d8a42b517dfd45b79e Author: Basavaraj Natikar Date: Mon May 9 18:50:21 2022 +0530 HID: amd_sfh: Add sensor name by index for debug info Adding get sensor name for debug info. This will make debug messages clearer. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit b5d7f43e97dabfa04a4be5ff027ce7da119332be Author: Basavaraj Natikar Date: Mon May 9 18:50:20 2022 +0530 HID: amd_sfh: Add support for sensor discovery Sensor discovery status fails in case of broken sensors or platform not supported. Hence disable driver on failure of sensor discovery. Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit b63b3c490eeeedd324e194929bd0aa8ba553f875 Author: Jiri Olsa Date: Tue May 10 09:46:57 2022 +0200 libbpf: Add bpf_program__set_insns function Adding bpf_program__set_insns that allows to set new instructions for a BPF program. This is a very advanced libbpf API and users need to know what they are doing. This should be used from prog_prepare_load_fn callback only. We can have changed instructions after calling prog_prepare_load_fn callback, reloading them. One of the users of this new API will be perf's internal BPF prologue generation. Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510074659.2557731-2-jolsa@kernel.org commit 01f4685797a5723b0046da03c30185ac9ff42b30 Author: Jakub Kicinski Date: Mon May 9 08:05:32 2022 -0700 eth: amd: remove NI6510 support (ni65) Looks like all the changes to this driver had been tree-wide refactoring since git era begun. The driver is using virt_to_bus() we should make it use more modern DMA APIs but since it's unlikely to be getting any use these days delete it instead. We can always revert to bring it back. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 03dcb90dbf62fd0bb6152bb59b1d70c8e4ad1c87 Author: Jakub Kicinski Date: Mon May 9 08:01:30 2022 -0700 net: appletalk: remove Apple/Farallon LocalTalk PC support Looks like all the changes to this driver had been tree-wide refactoring since git era begun. The driver is using virt_to_bus() we should make it use more modern DMA APIs but since it's unlikely to be getting any use these days delete it instead. We can always revert to bring it back. Signed-off-by: Jakub Kicinski Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 5eefe17c7ae41bac4d2d281669e8357a10f4d5a4 Author: Andrii Nakryiko Date: Tue May 10 11:51:59 2022 -0700 libbpf: Clean up ringbuf size adjustment implementation Drop unused iteration variable, move overflow prevention check into the for loop. Fixes: 0087a681fa8c ("libbpf: Automatically fix up BPF_MAP_TYPE_RINGBUF size, if necessary") Reported-by: Nathan Chancellor Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220510185159.754299-1-andrii@kernel.org commit 7e0d0d44001506bc42932b5e37baaab84f0397cf Author: Ojaswin Mujoo Date: Tue Mar 15 17:14:54 2022 +0530 ext4: get rid of unused DEFAULT_MB_OPTIMIZE_SCAN After recent changes to the mb_optimize_scan mount option the DEFAULT_MB_OPTIMIZE_SCAN is no longer needed so get rid of it. Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220315114454.104182-1-ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit e508af8abbf9ced64f644755f2ddd509c935173f Merge: dc3a2001f6161 eeee4b77dc52b Author: David S. Miller Date: Wed May 11 12:44:30 2022 +0100 Merge branch 'debug-net' Eric Dumazet says: ==================== net: CONFIG_DEBUG_NET and friends This patch series is inspired by some syzbot reports hinting that skb transport_header might be not set in places we expect it being set. Add a new CONFIG_DEBUG_NET option and DEBUG_NET_WARN_ON_ONCE() helper, so that we can start adding more sanity checks in the future. Replace two BUG() in skb_checksum_help() with less risky code. v2: make first patch compile on more arches/compilers add the 5th patch to add more debugging in skb_checksum_help() ==================== Signed-off-by: David S. Miller commit eeee4b77dc52b9128ee450c110caeb92ce3f3f9c Author: Eric Dumazet Date: Mon May 9 20:57:41 2022 -0700 net: add more debug info in skb_checksum_help() This is a followup of previous patch. Dumping the stack trace is a good start, but printing basic skb information is probably better. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d7ea0d9df2a6265b2b180d17ebc64b38105968fc Author: Eric Dumazet Date: Mon May 9 20:57:40 2022 -0700 net: remove two BUG() from skb_checksum_help() I have a syzbot report that managed to get a crash in skb_checksum_help() If syzbot can trigger these BUG(), it makes sense to replace them with more friendly WARN_ON_ONCE() since skb_checksum_help() can instead return an error code. Note that syzbot will still crash there, until real bug is fixed. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 66e4c8d950083df8e12981babca788e1635c92b6 Author: Eric Dumazet Date: Mon May 9 20:57:39 2022 -0700 net: warn if transport header was not set Make sure skb_transport_header() and skb_transport_offset() uses are not fooled if the transport header has not been set. This change will likely expose existing bugs in linux networking stacks. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d268c1f5cfc92eb5bb605f7365769aacd93be234 Author: Eric Dumazet Date: Mon May 9 20:57:38 2022 -0700 net: add CONFIG_DEBUG_NET This config option enables network debugging checks. This patch adds DEBUG_NET_WARN_ON_ONCE(cond) Note that this is not a replacement for WARN_ON_ONCE(cond) as (cond) is not evaluated if CONFIG_DEBUG_NET is not set. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 5b87be9e4978fe507c7e14c0bdff147d10d39aec Author: Eric Dumazet Date: Mon May 9 20:57:37 2022 -0700 net: add include/net/net_debug.h Remove from include/linux/netdevice.h helpers that send debug/info/warnings to syslog. We plan adding more helpers in following patches. v2: added two includes, and 'struct net_device' forward declaration to avoid compile errors (kernel bots) Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit dc3a2001f61611347c057fea422c382b9ce3cfcb Merge: 53a332f222c01 7f46a0b7327ae Author: David S. Miller Date: Wed May 11 12:12:27 2022 +0100 Merge tag 'mlx5-updates-2022-05-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-05-09 1) Gavin Li, adds exit route from waiting for FW init on device boot and increases FW init timeout on health recovery flow 2) Support 4 ports HCAs LAG mode Mark Bloch Says: ================ This series adds to mlx5 drivers support for 4 ports HCAs. Starting with ConnectX-7 HCAs with 4 ports are possible. As most driver parts aren't affected by such configuration most driver code is unchanged. Specially the only affected areas are: - Lag - Devcom - Merged E-Switch - Single FDB E-Switch Lag was chosen to be converted first. Creating hardware LAG when all 4 ports are added to the same bond device. Devom, merge E-Switch and single FDB E-Switch, are marked as supporting only 2 ports HCAs and future patches will add support for 4 ports HCAs. In order to activate the hardware lag a user can execute the: ip link add bond0 type bond ip link set bond0 type bond miimon 100 mode 2 ip link set eth2 master bond0 ip link set eth3 master bond0 ip link set eth4 master bond0 ip link set eth5 master bond0 Where eth2, eth3, eth4 and eth5 are the PFs of the same HCA. ================ ==================== Signed-off-by: David S. Miller commit bc49681c96360e0ff9c6659e352eec3286b968ce Author: Dmitry Baryshkov Date: Mon May 2 16:19:38 2022 +0530 PCI: qcom-ep: Move enable/disable resources code to common functions Remove code duplication by moving the code related to enabling/disabling the resources (PHY, CLK, Reset) to common functions so that they can be called from multiple places. [mani: renamed the functions and reworded the commit message] Link: https://lore.kernel.org/r/20220502104938.97033-1-manivannan.sadhasivam@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi commit 3630b2a86390b4be907d8685b2fddee0dd73a835 Author: Robin Murphy Date: Tue May 10 22:23:08 2022 +0100 perf/arm-cmn: Fix filter_sel lookup Carefully considering the bounds of an array is all well and good, until you forget that that array also contains a NULL sentinel at the end and dereference it. So close... Reported-by: Qian Cai Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/bebba768156aa3c0757140457bdd0fec10819388.1652217788.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit b011946d039d66bbc7102137e98cc67e1356aa87 Author: Yi Yang Date: Tue May 10 16:05:33 2022 +0800 xtensa/simdisk: fix proc_read_simdisk() The commit a69755b18774 ("xtensa simdisk: switch to proc_create_data()") split read operation into two parts, first retrieving the path when it's non-null and second retrieving the trailing '\n'. However when the path is non-null the first simple_read_from_buffer updates ppos, and the second simple_read_from_buffer returns 0 if ppos is greater than 1 (i.e. almost always). As a result reading from that proc file is almost always empty. Fix it by making a temporary copy of the path with the trailing '\n' and using simple_read_from_buffer on that copy. Cc: stable@vger.kernel.org Fixes: a69755b18774 ("xtensa simdisk: switch to proc_create_data()") Signed-off-by: Yi Yang Signed-off-by: Max Filippov commit c6ab42b31fce42c4b7f775752d91db0f2b71c65e Author: Jason Wang Date: Sun May 8 10:29:10 2022 +0800 xtensa: 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 Message-Id: <20220508022910.98481-1-wangborong@cdjrlc.com> Signed-off-by: Max Filippov commit 5349b2afc117d87d35502f2fe1930692d6bfc68b Author: Catherine Hoang Date: Tue May 10 13:28:00 2022 -0700 xfs: don't set quota warning values Having just dropped support for quota warning limits and warning counters, the warning fields no longer have any meaning. Prevent these fields from being set by removing QC_WARNS_MASK from XFS_QC_SETINFO_MASK and XFS_QC_MASK. Signed-off-by: Catherine Hoang Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 2e06df552a7cba13eb0046b9116a9aa26001ee2c Author: Catherine Hoang Date: Tue May 10 13:27:59 2022 -0700 xfs: remove warning counters from struct xfs_dquot_res Warning counts are not used anywhere in the kernel. In addition, there are no use cases, test coverage, or documentation for this functionality. Remove the 'warnings' field from struct xfs_dquot_res and any other related code. Signed-off-by: Catherine Hoang Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 5cc21e522d02d9a10bf856d71032d4dcc10185a8 Author: Catherine Hoang Date: Tue May 10 13:27:58 2022 -0700 xfs: remove quota warning limit from struct xfs_quota_limits Warning limits in xfs quota is an unused feature that is currently documented as unimplemented, and it is unclear what the intended behavior of these limits are. Remove the ‘warn’ field from struct xfs_quota_limits and any other related code. Signed-off-by: Catherine Hoang Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 709c8632597c3276cd21324b0256628f1a7fd4df Author: Dave Chinner Date: Wed May 11 17:05:23 2022 +1000 xfs: rework deferred attribute operation setup Logged attribute intents only have set and remove types - there is no separate intent type for a replace operation. We should have a separate type for a replace operation, as it needs to perform operations that neither SET or REMOVE can perform. Add this type to the intent items and rearrange the deferred operation setup to reflect the different operations we are performing. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit e22b88de5bacdd60ffa70e911e5fbae9ad36441a Author: Dave Chinner Date: Wed May 11 17:04:23 2022 +1000 xfs: make xattri_leaf_bp more useful We currently set it and hold it when converting from short to leaf form, then release it only to immediately look it back up again to do the leaf insert. Do a bit of refactoring to xfs_attr_leaf_try_add() to avoid this messy handling of the newly allocated leaf buffer. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit f3d430ff8cda80ccb9b73d9efa0e186fa532b74e Author: Dave Chinner Date: Wed May 11 17:03:23 2022 +1000 xfs: initialise attrd item to zero On the first allocation of a attrd item, xfs_trans_add_item() fires an assert like so: XFS (pmem0): EXPERIMENTAL logged extended attributes feature added. Use at your own risk! XFS: Assertion failed: !test_bit(XFS_LI_DIRTY, &lip->li_flags), file: fs/xfs/xfs_trans.c, line: 683 ------------[ cut here ]------------ kernel BUG at fs/xfs/xfs_message.c:102! Call Trace: xfs_trans_add_item+0x17e/0x190 xfs_trans_get_attrd+0x67/0x90 xfs_attr_create_done+0x13/0x20 xfs_defer_finish_noroll+0x100/0x690 __xfs_trans_commit+0x144/0x330 xfs_trans_commit+0x10/0x20 xfs_attr_set+0x3e2/0x4c0 xfs_initxattrs+0xaa/0xe0 security_inode_init_security+0xb0/0x130 xfs_init_security+0x18/0x20 xfs_generic_create+0x13a/0x340 xfs_vn_create+0x17/0x20 path_openat+0xff3/0x12f0 do_filp_open+0xb2/0x150 The attrd log item is allocated via kmem_cache_alloc, and xfs_log_item_init() does not zero the entire log item structure - it assumes that the structure is already all zeros as it only initialises non-zero fields. Fix the attr items to be allocated via the *zalloc methods. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit a4b8917b06c71a4ea61ac45b6e979eb7676417f8 Author: Dave Chinner Date: Wed May 11 17:02:23 2022 +1000 xfs: avoid empty xattr transaction when attrs are inline generic/642 triggered a reproducable assert failure in xlog_cil_commit() that resulted from a xfs_attr_set() committing an empty but dirty transaction. When the CIL is empty and this occurs, xlog_cil_commit() tries a background push and this triggers a "pushing an empty CIL" assert. XFS: Assertion failed: !list_empty(&cil->xc_cil), file: fs/xfs/xfs_log_cil.c, line: 1274 Call Trace: xlog_cil_commit+0xa5a/0xad0 __xfs_trans_commit+0xb8/0x330 xfs_trans_commit+0x10/0x20 xfs_attr_set+0x3e2/0x4c0 xfs_xattr_set+0x8d/0xe0 __vfs_setxattr+0x6b/0x90 __vfs_setxattr_noperm+0x76/0x220 __vfs_setxattr_locked+0xdf/0x100 vfs_setxattr+0x94/0x170 setxattr+0x110/0x200 path_setxattr+0xbf/0xe0 __x64_sys_setxattr+0x2b/0x30 do_syscall_64+0x35/0x80 The problem is related to the breakdown of attribute addition in xfs_attr_set_iter() and how it is called from deferred operations. When we have a pure leaf xattr insert, we add the xattr to the leaf and set the next state to XFS_DAS_FOUND_LBLK and return -EAGAIN. This requeues the xattr defered work, rolls the transaction and runs xfs_attr_set_iter() again. This then checks the xattr for being remote (it's not) and whether a replace op is being done (this is a create op) and if neither are true it returns without having done anything. xfs_xattri_finish_update() then unconditionally sets the transaction dirty, and the deferops finishes and returns to __xfs_trans_commit() which sees the transaction dirty and tries to commit it by calling xlog_cil_commit(). The transaction is empty, and then the assert fires if this happens when the CIL is empty. This patch addresses the structure of xfs_attr_set_iter() that requires re-entry on leaf add even when nothing will be done. This gets rid of the trailing empty transaction and so doesn't trigger the XFS_TRANS_DIRTY assignment in xfs_xattri_finish_update() incorrectly. Addressing that is for a different patch. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit c5218a7cd97349c53bc64e447778a07e49364d40 Author: Allison Henderson Date: Wed May 11 17:01:23 2022 +1000 xfs: add leaf to node error tag Add an error tag on xfs_attr3_leaf_to_node to test log attribute recovery and replay. Signed-off-by: Catherine Hoang Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Allison Henderson Signed-off-by: Dave Chinner commit c3b948be34702a0a81f10662c4040e500a90eb54 Author: Allison Henderson Date: Wed May 11 17:01:23 2022 +1000 xfs: add leaf split error tag Add an error tag on xfs_da3_split to test log attribute recovery and replay. Signed-off-by: Catherine Hoang Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Allison Henderson Signed-off-by: Dave Chinner commit c3546cf5d1e50389a789290f8c21a555e3408aa8 Author: Allison Henderson Date: Wed May 11 17:01:23 2022 +1000 xfs: Add helper function xfs_init_attr_trans Quick helper function to collapse duplicate code to initialize transactions for attributes Signed-off-by: Allison Henderson Suggested-by: Darrick J. Wong Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit cd1549d6df22e4f72903dbb169202203d429bcff Author: Allison Henderson Date: Wed May 11 17:01:22 2022 +1000 xfs: Add helper function xfs_attr_leaf_addname This patch adds a helper function xfs_attr_leaf_addname. While this does help to break down xfs_attr_set_iter, it does also hoist out some of the state management. This patch has been moved to the end of the clean up series for further discussion. Suggested-by: Darrick J. Wong Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit d68c51e9a4095b57f06bf5dd15ab8fae6dab5d8b Author: Allison Henderson Date: Wed May 11 17:01:22 2022 +1000 xfs: Merge xfs_delattr_context into xfs_attr_item This is a clean up patch that merges xfs_delattr_context into xfs_attr_item. Now that the refactoring is complete and the delayed operation infrastructure is in place, we can combine these to eliminate the extra struct Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 535e2f75c4e377e6ccc9d4396695b516d118f8f0 Author: Allison Henderson Date: Wed May 11 17:01:22 2022 +1000 xfs: Add larp debug option This patch adds a debug option to enable log attribute replay. Eventually this can be removed when delayed attrs becomes permanent. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit abd61ca3c333506ffa4ee73b78659ab57e7efcf7 Author: Allison Henderson Date: Wed May 11 17:01:22 2022 +1000 xfs: Add log attribute error tag This patch adds an error tag that we can use to test log attribute recovery and replay Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 73159fc27c6944ebe55e6652d6a1981d7cb3eb4a Author: Allison Henderson Date: Wed May 11 17:01:22 2022 +1000 xfs: Remove unused xfs_attr_*_args Remove xfs_attr_set_args, xfs_attr_remove_args, and xfs_attr_trans_roll. These high level loops are now driven by the delayed operations code, and can be removed. Additionally collapse in the leaf_bp parameter of xfs_attr_set_iter since we only have one caller that passes dac->leaf_bp Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit f3f36c893f260275eb9229cdc3dabb4c79650591 Author: Allison Henderson Date: Wed May 11 17:01:13 2022 +1000 xfs: Add xfs_attr_set_deferred and xfs_attr_remove_deferred These routines set up and queue a new deferred attribute operations. These functions are meant to be called by any routine needing to initiate a deferred attribute operation as opposed to the existing inline operations. New helper function xfs_attr_item_init also added. Finally enable delayed attributes in xfs_attr_set and xfs_attr_remove. Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 85c205db605b2067dec5c72ff7efbbad899a608e Author: Yishai Hadas Date: Tue May 10 12:02:06 2022 +0300 vfio/mlx5: Run the SAVE state command in an async mode Use the PF asynchronous command mode for the SAVE state command. This enables returning earlier to user space upon issuing successfully the command and improve latency by let things run in parallel. Link: https://lore.kernel.org/r/20220510090206.90374-5-yishaih@nvidia.com Signed-off-by: Yishai Hadas Reviewed-by: Alex Williamson Signed-off-by: Leon Romanovsky commit 8580ad14f9396b03c4b9645b4cf0dd0085664562 Author: Yishai Hadas Date: Tue May 10 12:02:05 2022 +0300 vfio/mlx5: Refactor to enable VFs migration in parallel Refactor to enable different VFs to run their commands over the PF command interface in parallel and to not block one each other. This is done by not using the global PF lock that was used before but relying on the VF attach/detach mechanism to sync. Link: https://lore.kernel.org/r/20220510090206.90374-4-yishaih@nvidia.com Signed-off-by: Yishai Hadas Reviewed-by: Alex Williamson Signed-off-by: Leon Romanovsky commit 61a2f1460fd03285ea34c1a235f2f50f71e13a1f Author: Yishai Hadas Date: Tue May 10 12:02:04 2022 +0300 vfio/mlx5: Manage the VF attach/detach callback from the PF Manage the VF attach/detach callback from the PF. This lets the driver to enable parallel VFs migration as will be introduced in the next patch. As part of this, reorganize the VF is migratable code to be in a separate function and rename it to be set_migratable() to match its functionality. Link: https://lore.kernel.org/r/20220510090206.90374-3-yishaih@nvidia.com Signed-off-by: Yishai Hadas Reviewed-by: Alex Williamson Signed-off-by: Leon Romanovsky commit 2c33360bce6af0948fa162cdbd373d49be5a7491 Author: Jaehee Park Date: Fri May 6 13:00:46 2022 -0400 wfx: use container_of() to get vif Currently, upon virtual interface creation, wfx_add_interface() stores a reference to the corresponding struct ieee80211_vif in private data, for later usage. This is not needed when using the container_of construct. This construct already has all the info it needs to retrieve the reference to the corresponding struct from the offset that is already available, inherent in container_of(), between its type and member inputs (struct ieee80211_vif and drv_priv, respectively). Remove vif (which was previously storing the reference to the struct ieee80211_vif) from the struct wfx_vif, define a function wvif_to_vif(wvif) for container_of(), and replace all wvif->vif with the newly defined container_of construct. Signed-off-by: Jaehee Park Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506170046.GA1297231@jaehee-ThinkPad-X1-Extreme commit dadb20864d89d43dd5386089bd82e5c66f0060c0 Author: Ping-Ke Shih Date: Fri May 6 20:02:16 2022 +0800 rtw89: add debug entry to dump BSSID CAM BSSID CAM is a kind of CAM that is used to determine if we receive a packet or not. Add an entry to assist in debugging. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506120216.58567-6-pkshih@realtek.com commit 0b75b35c3867ba9189628f1a3113bd2435f35380 Author: Ping-Ke Shih Date: Fri May 6 20:02:15 2022 +0800 rtw89: add debug select to dump MAC pages 0x30 to 0x33 Dump new region 0x3000 to 0x33ff to help debug. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506120216.58567-5-pkshih@realtek.com commit 98ed6159a50524f3b3302bdc237e2d3dd89fdfe7 Author: Ping-Ke Shih Date: Fri May 6 20:02:14 2022 +0800 rtw89: correct CCA control EDCCA signal can block transmitting in certain situation, so ignore this signal and use others to decide transmitting time. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506120216.58567-4-pkshih@realtek.com commit 4b0d341b2e0401b1d44489af5bc2fa0e30ea5d2b Author: Ping-Ke Shih Date: Fri May 6 20:02:13 2022 +0800 rtw89: correct setting of RX MPDU length Set proper setting according to RX quota, and then it doesn't break buffer due to size of received packet exceeding buffer size. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506120216.58567-3-pkshih@realtek.com commit 0cd75e4f1c9dce097665bee757da280bd5276864 Author: Hsuan Hung Date: Fri May 6 20:02:12 2022 +0800 rtw89: 8852c: add settings to decrease the effect of DC Modify NBI and PD boost settings according to different primary channels. This setting can decrease the false alarm induced by DC. Signed-off-by: Hsuan Hung Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506120216.58567-2-pkshih@realtek.com commit 84dc992e23df2633c7bd4f662e3f0073c126aac7 Author: Jiapeng Chong Date: Fri May 6 15:58:14 2022 +0800 ssb: remove unreachable code Clean up the following smatch warning: drivers/ssb/pci.c:917 ssb_pci_sprom_get() warn: ignoring unreachable code. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Michael Büsch Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506075814.115059-1-jiapeng.chong@linux.alibaba.com commit 716c220b4d990a4fe7800d0685ca69dee99e4e8f Author: Pavel Löbl Date: Fri May 6 06:42:46 2022 +0200 brcmfmac: allow setting wlan MAC address using device tree This allows firmware to provide MAC address using device tree. Like in case there is no MAC burned in wlan NVRAM. Signed-off-by: Pavel Löbl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506044246.67146-1-pavel@loebl.cz commit 62296b3e19dd252694d24a60d6f10b487551d70b Author: Ajay Singh Date: Wed May 4 16:19:27 2022 +0000 wilc1000: add valid vmm_entry check before fetching from TX queue 'vmm_table' array contains the size of data buffer length including host header length. In 'vmm_table' array, the Zero value means the end of vmm_entries that needs to transfer to firmware which is calculated based on VMM free size in firmware. Use 'vmm_table' valid entry check before fetching the entry from TX queue to only copy valid number of entries to avoid possible NULL pointer exception observed sometimes during large file transfers. Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-5-ajay.kathat@microchip.com commit 819b161b9487870d1d1a76171b6820c6b977d99a Author: Ajay Singh Date: Wed May 4 16:19:26 2022 +0000 wilc1000: use 'u64' datatype for cookie variable Use 'u64' instead of 'u32' for the cookie variable as expected by cfg80211 callback function argument. Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-4-ajay.kathat@microchip.com commit 868f0e28290c7a33e8cb79bfe97ebdcbb756e048 Author: Ajay Singh Date: Wed May 4 16:19:26 2022 +0000 wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice() Monitor(mon.) interface is used for handling the AP mode and 'ieee80211_ptr' reference is not getting set for it. Like earlier implementation, use register_netdevice() instead of cfg80211_register_netdevice() which expects valid 'ieee80211_ptr' reference to avoid the possible crash. Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics") Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-3-ajay.kathat@microchip.com commit 72ebd6751f9eb3f9b023a81f10b02e9a2c8c0acb Author: Ajay Singh Date: Wed May 4 16:19:25 2022 +0000 wilc1000: use fixed function base register value to access SDIO_FBR_ENABLE_CSA The function number was not correct(reset to 0) when host resumes from suspend state. Use hardcoded value in function base information register(FBR base address) to re-initialize correctly on host resume. Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-2-ajay.kathat@microchip.com commit 4ee8a915730f3219a1737c8d73815c97ec8f3c27 Author: Ajay Singh Date: Wed May 4 16:19:25 2022 +0000 wilc1000: increase firmware version array size Increase firmware version array size to hold complete version information. The firmware commit id(Build:) information is also part of the firmware version string. Firmware version format: WILC_WIFI_FW_REL_XX_XX Build: XXXXX e.g. WILC_WIFI_FW_REL_15_6 Build: 12804 Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504161924.2146601-1-ajay.kathat@microchip.com commit 93dafa92e1cf922bd06fa738bc4f85fdfb63a39f Merge: cb411545309e6 ddc0027a4c3f0 Author: Andrii Nakryiko Date: Tue May 10 17:47:45 2022 -0700 Merge branch 'Attach a cookie to a tracing program.' Kui-Feng Lee says: ==================== Allow users to attach a 64-bits cookie to a bpf_link of fentry, fexit, or fmod_ret. This patchset includes several major changes. - Define struct bpf_tramp_links to replace bpf_tramp_prog. struct bpf_tramp_links collects bpf_links of a trampoline - Generate a trampoline to call bpf_progs of given bpf_links. - Trampolines always set/reset bpf_run_ctx before/after calling/leaving a tracing program. - Attach a cookie to a bpf_link of fentry/fexit/fmod_ret/lsm. The value will be available when running the associated bpf_prog. Th major differences from v6: - bpf_link_create() can create links of BPF_LSM_MAC attach type. - Add a test for lsm. - Add function proto of bpf_get_attach_cookie() for lsm. - Check BPF_LSM_MAC in bpf_prog_has_trampoline(). - Adapt to the changes of LINK_CREATE made by Andrii. The major differences from v7: - Change stack_size instead of pushing/popping run_ctx. - Move cookie to bpf_tramp_link from bpf_tracing_link.. v1: https://lore.kernel.org/all/20220126214809.3868787-1-kuifeng@fb.com/ v2: https://lore.kernel.org/bpf/20220316004231.1103318-1-kuifeng@fb.com/ v3: https://lore.kernel.org/bpf/20220407192552.2343076-1-kuifeng@fb.com/ v4: https://lore.kernel.org/bpf/20220411173429.4139609-1-kuifeng@fb.com/ v5: https://lore.kernel.org/bpf/20220412165555.4146407-1-kuifeng@fb.com/ v6: https://lore.kernel.org/bpf/20220416042940.656344-1-kuifeng@fb.com/ v7: https://lore.kernel.org/bpf/20220508032117.2783209-1-kuifeng@fb.com/ ==================== Signed-off-by: Andrii Nakryiko commit ddc0027a4c3f0cf07a5d54178f016535ef58bca5 Author: Kui-Feng Lee Date: Tue May 10 13:59:23 2022 -0700 selftest/bpf: The test cases of BPF cookie for fentry/fexit/fmod_ret/lsm. Make sure BPF cookies are correct for fentry/fexit/fmod_ret/lsm. Signed-off-by: Kui-Feng Lee Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510205923.3206889-6-kuifeng@fb.com commit 129b9c5ee2c18c3e36ec289140b5149f301118d1 Author: Kui-Feng Lee Date: Tue May 10 13:59:22 2022 -0700 libbpf: Assign cookies to links in libbpf. Add a cookie field to the attributes of bpf_link_create(). Add bpf_program__attach_trace_opts() to attach a cookie to a link. Signed-off-by: Kui-Feng Lee Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510205923.3206889-5-kuifeng@fb.com commit 2fcc82411e74e5e6aba336561cf56fb899bfae4e Author: Kui-Feng Lee Date: Tue May 10 13:59:21 2022 -0700 bpf, x86: Attach a cookie to fentry/fexit/fmod_ret/lsm. Pass a cookie along with BPF_LINK_CREATE requests. Add a bpf_cookie field to struct bpf_tracing_link to attach a cookie. The cookie of a bpf_tracing_link is available by calling bpf_get_attach_cookie when running the BPF program of the attached link. The value of a cookie will be set at bpf_tramp_run_ctx by the trampoline of the link. Signed-off-by: Kui-Feng Lee Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510205923.3206889-4-kuifeng@fb.com commit bc405bb3eeee4b711830ab569e7f3811b92196ab Author: Michael Riesch Date: Mon Apr 25 15:35:00 2022 +0200 arm64: dts: rockchip: enable otg/drd operation of usb_host0_xhci in rk356x This USB 3.0 controller is capable of OTG/DRD operation. Enable it in the device tree. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220425133502.405512-1-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit f83493f7d34da258310ecd3d07f0cc78f884c954 Merge: d53b8e19c24ba 24df12013853a Author: Dave Airlie Date: Wed May 11 12:40:47 2022 +1000 Merge tag 'drm-msm-next-2022-05-09' of https://gitlab.freedesktop.org/drm/msm into drm-next - Fourcc modifier for tiled but not compressed layouts - Support for userspace allocated IOVA (GPU virtual address) - Devfreq clamp_to_idle fix - DPU: DSC (Display Stream Compression) support - DPU: inline rotation support on SC7280 - DPU: update DP timings to follow vendor recommendations - DP, DPU: add support for wide bus (on newer chipsets) - DP: eDP support - Merge DPU1 and MDP5 MDSS driver, make dpu/mdp device the master component - MDSS: optionally reset the IP block at the bootup to drop bootloader state - Properly register and unregister internal bridges in the DRM framework - Complete DPU IRQ cleanup - DP: conversion to use drm_bridge and drm_bridge_connector - eDP: drop old eDP parts again - DPU: writeback support - Misc small fixes Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvJCr_1D8d0dgmyQC5HD4gmXeZw=bFV_CNCfceZbpMxRw@mail.gmail.com commit 0873fe44e780eb8ff7932aed347de8dd4103cea7 Author: Max Gurtovoy Date: Thu Apr 28 12:29:39 2022 +0300 scsi: target: iscsi: Rename iscsi_session to iscsit_session The structure iscsi_session naming is used by the iSCSI initiator driver. Rename the target session to iscsit_session to have more readable code. Link: https://lore.kernel.org/r/20220428092939.36768-3-mgurtovoy@nvidia.com Reviewed-by: Mike Christie Signed-off-by: Max Gurtovoy Signed-off-by: Martin K. Petersen commit be36d683fc29e74bbd29347717be72beb6a74219 Author: Max Gurtovoy Date: Thu Apr 28 12:29:38 2022 +0300 scsi: target: iscsi: Rename iscsi_conn to iscsit_conn The structure iscsi_conn naming is used by the iSCSI initiator driver. Rename the target conn to iscsit_conn to have more readable code. Link: https://lore.kernel.org/r/20220428092939.36768-2-mgurtovoy@nvidia.com Reviewed-by: Mike Christie Signed-off-by: Max Gurtovoy Signed-off-by: Martin K. Petersen commit 66cd9d4ef74ae1ad459e3db3a3280182275c2ce9 Author: Max Gurtovoy Date: Thu Apr 28 12:29:37 2022 +0300 scsi: target: iscsi: Rename iscsi_cmd to iscsit_cmd The structure iscsi_cmd naming is used by the iSCSI initiator driver. Rename the target cmd to iscsit_cmd to have more readable code. Link: https://lore.kernel.org/r/20220428092939.36768-1-mgurtovoy@nvidia.com Reviewed-by: Mike Christie Signed-off-by: Max Gurtovoy Signed-off-by: Martin K. Petersen commit 256bd4f23d9cecaba2e6795f0058fa9c2362698c Author: Sreekanth Reddy Date: Fri May 6 00:18:06 2022 +0530 scsi: mpi3mr: Return I/Os to an unrecoverable HBA with DID_ERROR Complete all new I/O requests issued to an unrecoverable controller with DID_ERROR status instead of returning the I/O requests with SCSI_MLQUEUE_HOST_BUSY. This will prevent the infinite retries of the new I/Os when a controller is in an unrecoverable state. Link: https://lore.kernel.org/r/20220505184808.24049-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 2dd8389f96d6d00a24816888262e33a85d414c05 Author: Sreekanth Reddy Date: Fri May 6 00:18:07 2022 +0530 scsi: mpi3mr: Hidden drives not removed during soft reset If any drive is missing during reset, the driver checks whether the device is exposed to the OS. If it is, then it removes the device from the OS and its own internal list. For hidden devices, even if they are found as missing during reset, the driver is not removing them from its internal list. Modify driver to remove hidden devices from the driver's target device list if they are missing during soft reset. Link: https://lore.kernel.org/r/20220505184808.24049-2-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 1aa529d400253eda76733dbb95b62f6cca7b274a Author: Sreekanth Reddy Date: Fri May 6 00:18:08 2022 +0530 scsi: mpi3mr: Increase I/O timeout value to 60s Set each SCSI device's default I/O timeout and default error handling I/O timeout to 60s. Link: https://lore.kernel.org/r/20220505184808.24049-3-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit fcb9e738667c874cbff0b240b96a895901f09ee0 Author: James Smart Date: Thu May 5 20:55:19 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.3 Update lpfc version to 14.2.0.3 Link: https://lore.kernel.org/r/20220506035519.50908-13-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a14396b6d139ff9335b4be25ba30ffa67cadd2e9 Author: James Smart Date: Thu May 5 20:55:18 2022 -0700 scsi: lpfc: Use sg_dma_address() and sg_dma_len() macros for NVMe I/O NVMe I/O problems may be seen on IOMMU enabled platforms. Adapter I/Os failing with transfer length mismatches. The sg list processing routine for NVMe I/O is accessing the sg entry directly for the length and address fields. On some IOMMU platforms, contigous mappings are compressed to the first sg entry with the sum of the lengths set to the sg entry dma_length field. The length fields are left for later use by the unmap call. As such, the driver didn't see the actual dma_length value, just the first entries length value. Drivers are to use the sg_dma_length() and sg_dma_address() macros to reference the sg entry. The macros select the proper length field (dma_length or length) to reference. Fix the offending code to use the sg_dma_xxx macros. Link: https://lore.kernel.org/r/20220506035519.50908-12-jsmart2021@gmail.com Tested-by: Jerry Snitselaar Reviewed-by: Jerry Snitselaar Co-developed-by: Nigel Kirkland Signed-off-by: Nigel Kirkland Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit e6f51041450282a8668af3a8fc5c7744e81a447c Author: James Smart Date: Thu May 5 20:55:17 2022 -0700 scsi: lpfc: Alter FPIN stat accounting logic When configuring CMF management based on signals instead of FPINs, FPIN alarm and warning statistics are not tracked. Change the behavior so that FPIN alarms and warnings are always tracked regardless of the configured mode. Similar changes are made in the CMF signal stat accounting logic. Upon receipt of a signal, only track signaled alarms and warnings. FPIN stats should not be incremented upon receipt of a signal. Link: https://lore.kernel.org/r/20220506035519.50908-11-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit de3ec318fee32313092b609f88475f86e58f3fe5 Author: James Smart Date: Thu May 5 20:55:16 2022 -0700 scsi: lpfc: Rework FDMI initialization after link up After a link up, it's possible for the switch to change FDMI support (e.g. FDMI1 vs FDMI2 vs SmartSAN). If the switch reverts to FDMI1, then the revert is currently not detected. Additionally, when NPIV is configured, it's possible the physical port's RHBA is unprocessed by the switch before reciept of an NPIV port issued RPRT. This causes some switches vendors to reject the NPIV's RPRT. Fix by reinitializing base FDMI mode on link up, and defer FDMI vport RPRT submission until after confirming physical port's RHBA is completed. Link: https://lore.kernel.org/r/20220506035519.50908-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5099478e436f0acd8c76495590c105668f2d8afc Author: James Smart Date: Thu May 5 20:55:15 2022 -0700 scsi: lpfc: Change VMID registration to be based on fabric parameters Currently, VMID registration is configured via module parameters. This could lead to VMID compatibility issues if two ports are connected to different brands of switches, as the two brands implement VMID differently. Make logical changes so that VMID registration is based on common service parameters from FLOGI_ACC with fabric rather than module parameters. Link: https://lore.kernel.org/r/20220506035519.50908-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit dc8a71bd414fb550fd17164440c409f9ecf4b2a8 Author: James Smart Date: Thu May 5 20:55:14 2022 -0700 scsi: lpfc: Decrement outstanding gidft_inp counter if lpfc_err_lost_link() During large NPIV port testing, it was sometimes seen that not all vports would log back in to the target device. There are instances when the fabric is slow to respond to a spam of GID_PT requests and as a result the SLI PORT may abort the GID_PT request because the fabric takes so long. lpfc_cmpl_ct_cmd_gid_pt() would enter the lpfc_err_lost_link() logic and attempt to lpfc_els_flush_rscn(), which is fine, but forgets to decrement the gidft_inp counter. This results in a vport->gidft_inp never reaching 0 and never restarting discovery again. Decrement vport->gidft_inp if lpfc_err_lost_link() is true for both lpfc_cmpl_ct_cmd_gid_pt() and lpfc_cmpl_ct_cmd_gid_ft(). Increase logging info during RSCN timeout and lpfc_err_lost_link() events. Link: https://lore.kernel.org/r/20220506035519.50908-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 4a0f4aff3ce5a3efdf674f3bc1ba7d2642fa55ea Author: James Smart Date: Thu May 5 20:55:13 2022 -0700 scsi: lpfc: Use list_for_each_entry_safe() in rscn_recovery_check() In GID_PT mode with lpfc_ns_query=1, a race condition between iterating the vport->fc_nodes list in lpfc_rscn_recovery_check() and cleanup of an ndlp can trigger a crash while processing the RSCN of another initiator from the same zone. During iteration of the vport->fc_nodes list, an ndlp is cleaned up and released. lpfc_dequeue_node() is called from lpfc_cleanup_node() leading to a bad ndlp dereference in lpfc_rscn_recovery_check(). Change list_for_each_entry() to list_for_each_entry_safe() in lpfc_rscn_recovery_check() to protect against removal of an initiator ndlp, while walking the vport->fc_nodes list. Link: https://lore.kernel.org/r/20220506035519.50908-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 596fc8adb171dce3751a359018e2ade612af8d97 Author: James Smart Date: Thu May 5 20:55:12 2022 -0700 scsi: lpfc: Fix dmabuf ptr assignment in lpfc_ct_reject_event() Upon driver receipt of a CT cmd for type = 0xFA (Management Server) and subtype = 0x11 (Fabric Device Management Interface), the driver is responding with garbage CT cmd data when it should send a properly formed RJT. The __lpfc_prep_xmit_seq64_s4() routine was using the wrong buffer for the reject. Fix by converting the routine to use the buffer specified in the bde within the wqe rather than the ill-set bmp element. Link: https://lore.kernel.org/r/20220506035519.50908-6-jsmart2021@gmail.com Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ead76d4c09b89f4c8d632648026a476a5a34fde8 Author: James Smart Date: Thu May 5 20:55:11 2022 -0700 scsi: lpfc: Inhibit aborts if external loopback plug is inserted After running a short external loopback test, when the external loopback is removed and a normal cable inserted that is directly connected to a target device, the system oops in the llpfc_set_rrq_active() routine. When the loopback was inserted an FLOGI was transmit. As we're looped back, we receive the FLOGI request. The FLOGI is ABTS'd as we recognize the same wppn thus understand it's a loopback. However, as the ABTS sends address information the port is not set to (fffffe), the ABTS is dropped on the wire. A short 1 frame loopback test is run and completes before the ABTS times out. The looback is unplugged and the new cable plugged in, and the an FLOGI to the new device occurs and completes. Due to a mixup in ref counting the completion of the new FLOGI releases the fabric ndlp. Then the original ABTS completes and references the released ndlp generating the oops. Correct by no-op'ing the ABTS when in loopback mode (it will be dropped anyway). Added a flag to track the mode to recognize when it should be no-op'd. Link: https://lore.kernel.org/r/20220506035519.50908-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b7e952cbc63c8b98a7433f294321c3b89850305c Author: James Smart Date: Thu May 5 20:55:10 2022 -0700 scsi: lpfc: Fix ndlp put following a LOGO completion During testing with repeated asynchronous resets of the target, an issue was found when the driver issues a LOGO to disconnect its login and recover all exchanges. The LOGO command takes a node reference but neglects to remove it, keeping the node reference count artifically high. Add a call to lpfc_nlp_put() to lpfc_nlp_logo_unreg() and move the mempool free call to the routine exit along with the needed put. This is always safe as this will not be the last reference removed as lpfc_unreg_rpi() ensures there is an additional reference on the ndlp. Link: https://lore.kernel.org/r/20220506035519.50908-4-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ba3d58a1df460ba28bb5989ad7269ff48682375a Author: James Smart Date: Thu May 5 20:55:09 2022 -0700 scsi: lpfc: Fill in missing ndlp kref puts in error paths Code review, following every lpfc_nlp_get() call vs calls during error handling, discovered cases of missing put calls. Correct by adding ndlp kref puts in the respective error paths. Also added comments to several of the error paths to record relationships to reference counts. Link: https://lore.kernel.org/r/20220506035519.50908-3-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 84c6f99e39074d45f75986e42ca28e27c140fd0d Author: James Smart Date: Thu May 5 20:55:08 2022 -0700 scsi: lpfc: Fix element offset in __lpfc_sli_release_iocbq_s4() The prior commit that moved from iocb elements to explicit wqe elements missed a name change. Correct __lpfc_sli_release_iocbq_s4() to reference wqe rather than iocb. Link: https://lore.kernel.org/r/20220506035519.50908-2-jsmart2021@gmail.com Fixes: a680a9298e7b ("scsi: lpfc: SLI path split: Refactor lpfc_iocbq") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 18ebe2390c6197738cbe67aa26acabe7815060bd Author: Bean Huo Date: Thu May 5 15:47:07 2022 +0200 scsi: ufs: ufshpb: Clean up ufshpb_suspend()/resume() ufshpb_resume() is only called when the HPB state is HPB_SUSPEND, so the check statement for "ufshpb_get_state(hpb) != HPB_PRESENT" is useless. Link: https://lore.kernel.org/r/20220505134707.35929-7-huobean@gmail.com Reviewed-by: Keoseong Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit 32d6eab31ac3bc7fecdec86541fa1458a2eb18a9 Author: Bean Huo Date: Thu May 5 15:47:06 2022 +0200 scsi: ufs: ufshpb: Add handing of device reset regions in HPB device mode In UFS HPB Spec JESD220-3A, "5.8. Active and inactive information upon power cycle ... When the device is powered off by the host, the device may restore L2P map data upon power up or build from the host's HPB READ command. In case device powered up and lost HPB information, device can signal to the host through HPB Sense data, by setting HPB Operation as '2' which will inform the host that device reset HPB information." Therefore, for HPB device control mode, if the UFS device is reset via the RST_N pin, the active region information in the device will be reset. If the host side receives this notification from the device side, it is recommended to inactivate all active regions in the host's HPB cache. Link: https://lore.kernel.org/r/20220505134707.35929-6-huobean@gmail.com Reviewed-by: Keoseong Park Reviewed-by: Daejun Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit d4300c552bf8a64e7577ce17c973e51fc89dba7c Author: Bean Huo Date: Thu May 5 15:47:05 2022 +0200 scsi: ufs: ufshpb: Change sysfs node hpb_stats/rb_* prefix to start with rcmd_* According to the documentation of the sysfs nodes rb_noti_cnt, rb_active_cnt and rb_inactive_cnt, these are all related to HPB recommendation in UPIU response packet. 'rcmd' (recommendation) should be the correct abbreviation. Change the sysfs documentation about these sysfs nodes to highlight what they mean under different HPB control modes. Link: https://lore.kernel.org/r/20220505134707.35929-5-huobean@gmail.com Reviewed-by: Keoseong Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit a3f3c26d4df5475e601f18250a94232fedfa24b8 Author: Bean Huo Date: Thu May 5 15:47:04 2022 +0200 scsi: ufs: ufshpb: Clean up the handler when device resets HPB information "When the device is powered off by the host, the device may restore L2P map data upon power up or build from the host's HPB READ command. In case device powered up and lost HPB information, device can signal to the host through HPB Sense data, by setting HPB Operation as '2' which will inform the host that device reset HPB information." Clean up the handler and make the intent of this handler more readable, no functional change. Link: https://lore.kernel.org/r/20220505134707.35929-4-huobean@gmail.com Reviewed-by: Keoseong Park Reviewed-by: Daejun Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit 6f341ed5e3771ea932b19377302ea97a0a02e0b5 Author: Bean Huo Date: Thu May 5 15:47:03 2022 +0200 scsi: ufs: ufshpb: Remove enum initialization value If the first enumerator has no initializer, the value of the corresponding constant is zero. Link: https://lore.kernel.org/r/20220505134707.35929-3-huobean@gmail.com Reviewed-by: Keoseong Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit facc239c87b1d66e7fdadade4fba07f9cecca7d6 Author: Bean Huo Date: Thu May 5 15:47:02 2022 +0200 scsi: ufs: ufshpb: Merge ufshpb_reset() and ufshpb_reset_host() There is no functional change in this patch, just merge ufshpb_reset() and ufshpb_reset_host() into one function ufshpb_toggle_state(). Link: https://lore.kernel.org/r/20220505134707.35929-2-huobean@gmail.com Reviewed-by: Keoseong Park Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit 53a332f222c015cb82349fd4f6b58cb14f574e8d Merge: 0781434af811f b2be075139fa4 Author: Jakub Kicinski Date: Tue May 10 18:57:17 2022 -0700 Merge branch 'net-phy-add-comments-for-lan8742-phy-support' Yuiko Oshino says: ==================== net: phy: add comments for LAN8742 phy support Add comments for 0xfffffff2 phy ID mask for the LAN8742 and the LAN88xx, explaining that they can coexist and allow future hardware revisions. Also add one missing tab in smsc.c. ==================== Link: https://lore.kernel.org/r/20220509185804.7147-1-yuiko.oshino@microchip.com Signed-off-by: Jakub Kicinski commit b2be075139fa4dad1649edef30963de6315ba237 Author: Yuiko Oshino Date: Mon May 9 11:58:04 2022 -0700 net: phy: smsc: add comments for the LAN8742 phy ID mask. add comments for the LAN8742 phy ID mask in the previous patch. add one missing tab in the LAN8742 phy ID line. Signed-off-by: Yuiko Oshino Signed-off-by: Jakub Kicinski commit 70a40ecfcb7d16262cf3ffe5eef4763315a68645 Author: Yuiko Oshino Date: Mon May 9 11:58:03 2022 -0700 net: phy: microchip: add comments for the modified LAN88xx phy ID mask. add comments for the updated LAN88xx phy ID mask in the previous patch. Signed-off-by: Yuiko Oshino Signed-off-by: Jakub Kicinski commit 6f21d9274c779a6425bd5056005bc69b99c956a4 Author: Manivannan Sadhasivam Date: Wed May 4 14:12:12 2022 +0530 scsi: ufs: qcom: Enable RPM_AUTOSUSPEND for runtime PM In order to allow the block devices to enter autosuspend mode during runtime, thereby allowing the ufshcd host driver to also runtime suspend, let's make use of the RPM_AUTOSUSPEND flag. Without this flag, userspace needs to enable the autosuspend feature of the block devices through sysfs. Link: https://lore.kernel.org/r/20220504084212.11605-6-manivannan.sadhasivam@linaro.org Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 23803bacaab47eafcd3a13ab607b5aa7b0debaaf Author: Manivannan Sadhasivam Date: Wed May 4 14:12:11 2022 +0530 scsi: ufs: core: Remove redundant wmb() in ufshcd_send_command() The wmb() inside ufshcd_send_command() is added to make sure that the doorbell is committed immediately. This leads to couple of expectations: 1. The doorbell write should complete before the function return. 2. The doorbell write should not cross the function boundary. 2nd expectation is fullfilled by the Linux memory model as there is a guarantee that the critical section won't cross the unlock (release) operation. 1st expectation is not really needed here as there is no following read/ write that depends on the doorbell to be complete implicitly. Even if the doorbell write is in a CPUs Write Buffer (WB), wmb() won't flush it. And there is no real need of a WB flush here as well. So let's get rid of the wmb() that seems redundant. Link: https://lore.kernel.org/r/20220504084212.11605-5-manivannan.sadhasivam@linaro.org Reviewed-by: Bart Van Assche Reviewed-by: Bjorn Andersson Acked-by: Bean Huo Signed-off-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 8eecddfca30e1651dc1c74531ed5eef21dcce7e3 Author: Manivannan Sadhasivam Date: Wed May 4 14:12:10 2022 +0530 scsi: ufs: qcom: Add a readl() to make sure ref_clk gets enabled In ufs_qcom_dev_ref_clk_ctrl(), it was noted that the ref_clk needs to be stable for at least 1us. Even though there is wmb() to make sure the write gets "completed", there is no guarantee that the write actually reached the UFS device. There is a good chance that the write could be stored in a Write Buffer (WB). In that case, even though the CPU waits for 1us, the ref_clk might not be stable for that period. So lets do a readl() to make sure that the previous write has reached the UFS device before udelay(). Also, the wmb() after writel_relaxed() is not really needed. Both writel() and readl() are ordered on all architectures and the CPU won't speculate instructions after readl() due to the in-built control dependency with read value on weakly ordered architectures. So it can be safely removed. Link: https://lore.kernel.org/r/20220504084212.11605-4-manivannan.sadhasivam@linaro.org Fixes: f06fcc7155dc ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations") Cc: stable@vger.kernel.org Reviewed-by: Bjorn Andersson Signed-off-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit c9ed9a6c56af4142ce0da240451c207d8171e451 Author: Manivannan Sadhasivam Date: Wed May 4 14:12:09 2022 +0530 scsi: ufs: qcom: Simplify handling of devm_phy_get() There is no need to call devm_phy_get() if ACPI is used, so skip it. The host->generic_phy pointer should already be NULL due to the kzalloc(), so no need to set it NULL again. While at it, also remove the comment that has no relationship with devm_phy_get(). Link: https://lore.kernel.org/r/20220504084212.11605-3-manivannan.sadhasivam@linaro.org Reviewed-by: Bjorn Andersson Reviewed-by: Andrew Halaney Signed-off-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 223b17ed76ebecba54f7857cd1a3205050d6257b Author: Manivannan Sadhasivam Date: Wed May 4 14:12:08 2022 +0530 scsi: ufs: qcom: Fix acquiring the optional reset control line On Qcom UFS platforms, the reset control line seems to be optional (for SoCs like MSM8996 and probably for others too). The current logic tries to mimic the devm_reset_control_get_optional() API but it also continues the probe if there is an error with the declared reset line in DT/ACPI. In an ideal case, if the reset line is not declared in DT/ACPI, the probe should continue. But if there is problem in acquiring the declared reset line (like EPROBE_DEFER) it should fail and return the appropriate error code. Link: https://lore.kernel.org/r/20220504084212.11605-2-manivannan.sadhasivam@linaro.org Reviewed-by: Bjorn Andersson Reviewed-by: Andrew Halaney Signed-off-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit 9b5387fe5af38116b452259d87cd66594b6277c1 Author: Xiang Chen Date: Fri May 6 20:25:39 2022 +0800 scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW If we fail to notify the phy up event then undo the RPM resume, as the phy up notify event handling pairs with that RPM resume. Link: https://lore.kernel.org/r/1651839939-101188-1-git-send-email-john.garry@huawei.com Reported-by: Yihang Li Tested-by: Yihang Li Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 0781434af811f29a0808521533bedc4027685751 Author: Chris Packham Date: Fri May 6 09:06:20 2022 +1200 dt-bindings: net: orion-mdio: Convert to JSON schema Convert the marvell,orion-mdio binding to JSON schema. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220505210621.3637268-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Jakub Kicinski commit d53b8e19c24bab37f72a2fc4b61d6f4d77b84ab4 Merge: 98bcaafd7fb06 949665a6e237a Author: Dave Airlie Date: Wed May 11 11:00:14 2022 +1000 Merge tag 'drm-intel-next-2022-05-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull #2 for v5.19: Features and functionality: - Add first set of DG2 PCI IDs for "motherboard down" designs (Matt Roper) - Add initial RPL-P PCI IDs as ADL-P subplatform (Matt Atwood) Refactoring and cleanups: - Power well refactoring and cleanup (Imre) - GVT-g refactor and mdev API cleanup (Christoph, Jason, Zhi) - DPLL refactoring and cleanup (Ville) - VBT panel specific data parsing cleanup (Ville) - Use drm_mode_init() for on-stack modes (Ville) Fixes: - Fix PSR state pipe A/B confusion by clearing more state on disable (José) - Fix FIFO underruns caused by not taking DRAM channel into account (Vinod) - Fix FBC flicker on display 11+ by enabling a workaround (José) - Fix VBT seamless DRRS min refresh rate check (Ville) - Fix panel type assumption on bogus VBT data (Ville) - Fix panel data parsing for VBT that misses panel data pointers block (Ville) - Fix spurious AUX timeout/hotplug handling on LTTPR links (Imre) Merges: - Backmerge drm-next (Jani) - GVT changes (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87bkwbkkdo.fsf@intel.com commit e384c7b7b46d0a5f4bf3c554f963e6e9622d0ab1 Author: Kui-Feng Lee Date: Tue May 10 13:59:20 2022 -0700 bpf, x86: Create bpf_tramp_run_ctx on the caller thread's stack BPF trampolines will create a bpf_tramp_run_ctx, a bpf_run_ctx, on stacks and set/reset the current bpf_run_ctx before/after calling a bpf_prog. Signed-off-by: Kui-Feng Lee Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510205923.3206889-3-kuifeng@fb.com commit f7e0beaf39d3868dc700d4954b26cf8443c5d423 Author: Kui-Feng Lee Date: Tue May 10 13:59:19 2022 -0700 bpf, x86: Generate trampolines from bpf_tramp_links Replace struct bpf_tramp_progs with struct bpf_tramp_links to collect struct bpf_tramp_link(s) for a trampoline. struct bpf_tramp_link extends bpf_link to act as a linked list node. arch_prepare_bpf_trampoline() accepts a struct bpf_tramp_links to collects all bpf_tramp_link(s) that a trampoline should call. Change BPF trampoline and bpf_struct_ops to pass bpf_tramp_links instead of bpf_tramp_progs. Signed-off-by: Kui-Feng Lee Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220510205923.3206889-2-kuifeng@fb.com commit 4c0c6e4cf775653d597ba3ce48c5a137d5849443 Merge: be76955dea93f 9facd94114b59 Author: Jakub Kicinski Date: Tue May 10 17:48:40 2022 -0700 Merge branch 'docs-document-some-aspects-of-struct-sk_buff' Jakub Kicinski says: ==================== docs: document some aspects of struct sk_buff This small set creates a place to render sk_buff documentation, documents one random thing (data-only skbs) and converts the big checksum comment to kdoc. ==================== Link: https://lore.kernel.org/r/20220323233715.2104106-1-kuba@kernel.org/ Link: https://lore.kernel.org/r/20220324231312.2241166-1-kuba@kernel.org/ Link: https://lore.kernel.org/r/20220509160456.1058940-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9facd94114b59afebd405e74b3bc2bf184efe986 Author: Jakub Kicinski Date: Mon May 9 09:04:56 2022 -0700 skbuff: render the checksum comment to documentation Long time ago Tom added a giant comment to skbuff.h explaining checksums. Now that we have a place in Documentation for skbuff docs we should render it. Sprinkle some markup while at it. Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 9ec7ea1462084df695f34c5ac2d2d2250d9d6897 Author: Jakub Kicinski Date: Mon May 9 09:04:55 2022 -0700 skbuff: rewrite the doc for data-only skbs The comment about shinfo->dataref split is really unhelpful, at least to me. Rewrite it and render it to skb documentation. Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit ddccc9ef55992716ad477d38fbcd9f8f1d34fc67 Author: Jakub Kicinski Date: Mon May 9 09:04:54 2022 -0700 skbuff: add a basic intro doc Add basic skb documentation. It's mostly an intro to the subsequent patches - it would looks strange if we documented advanced topics without covering the basics in any way. Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit be76955dea93fe7ee9e0a6f961a7185290a2417f Author: Jakub Kicinski Date: Mon May 9 10:04:12 2022 -0700 net: fix kdoc on __dev_queue_xmit() Commit c526fd8f9f4f21 ("net: inline dev_queue_xmit()") exported __dev_queue_xmit(), now it's being rendered in html docs, triggering: Documentation/networking/kapi:92: net/core/dev.c:4101: WARNING: Missing matching underline for section title overline. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/linux-next/20220503073420.6d3f135d@canb.auug.org.au/ Fixes: c526fd8f9f4f21 ("net: inline dev_queue_xmit()") Link: https://lore.kernel.org/r/20220509170412.1069190-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 61f60bac8c05f8ecd2ae2a6360520b91a45be9a2 Author: Kees Cook Date: Tue May 10 16:25:54 2022 -0700 gcc-plugins: Change all version strings match kernel It's not meaningful for the GCC plugins to track their versions separately from the rest of the kernel. Switch all versions to the kernel version. Fix mismatched indenting while we're at it. Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook commit 7464ff8bf2d762251b9537863db0e1caf9b0e402 Author: Akihiko Odaki Date: Mon Apr 4 13:11:01 2022 +0900 platform/chrome: cros_ec_typec: Check for EC driver The EC driver may not be initialized when cros_typec_probe is called, particulary when CONFIG_CROS_EC_CHARDEV=m. Signed-off-by: Akihiko Odaki Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220404041101.6276-1-akihiko.odaki@gmail.com Signed-off-by: Prashant Malani commit bca56ea6849fafcbc7d50b2338bd06385474a370 Merge: 61004d1d4badb c5a13c319e10e Author: Jakub Kicinski Date: Tue May 10 15:38:17 2022 -0700 Merge branch 'move-siena-into-a-separate-subdirectory' Martin Habets says: ==================== Move Siena into a separate subdirectory The Siena NICs (SFN5000 and SFN6000 series) went EOL in November 2021. Most of these adapters have been remove from our test labs, and testing has been reduced to a minimum. This patch series creates a separate kernel module for the Siena architecture, analogous to what was done for Falcon some years ago. This reduces our maintenance for the sfc.ko module, and allows us to enhance the EF10 and EF100 drivers without the risk of breaking Siena NICs. After this series further enhancements are needed to differentiate the new kernel module from sfc.ko, and the Siena code can be removed from sfc.ko. Thes will be posted as a small follow-up series. The Siena module is not built by default, but can be enabled using Kconfig option SFC_SIENA. This will create module sfc-siena.ko. Patches Patches 1-3 establish the code base for the Siena driver. Patches 4-10 ensure the allyesconfig build succeeds. Patch 11 adds the basic Siena module. I do not expect patch 1 through 3 to be reviewed, they are FYI only. No checkpatch issues were resolved as part of these, but they were fixed in the subsequent patches. Testing Various build tests were done such as allyesconfig, W=1 and sparse. The new sfc-siena.ko and sfc.ko modules were tested on a machine with both these NICs in them, and several tests were run on both drivers. ==================== Link: https://lore.kernel.org/r/165211018297.5289.9658523545298485394.stgit@palantir17.mph.net Signed-off-by: Jakub Kicinski commit c5a13c319e10e795850b61bc7e3447b08024be2e Author: Martin Habets Date: Mon May 9 16:33:23 2022 +0100 sfc: Add a basic Siena module Make the (un)load message more specific to differentiate it from the sfc.ko messages. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 782f7130849f58825fc0ab8dcfe297054cb58f2c Author: Martin Habets Date: Mon May 9 16:33:10 2022 +0100 sfc/siena: Inline functions in sriov.h to avoid conflicts with sfc The implementation of each is quite short. This means sriov.c is not needed any more. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit c8443b698238fd0cd525c48578e74f093e9f80aa Author: Martin Habets Date: Mon May 9 16:32:58 2022 +0100 sfc/siena: Rename functions in nic_common.h to avoid conflicts with sfc For siena use efx_siena_ as the function prefix. efx_nic_update_stats_atomic is only used in efx_common.c, so move it there. efx_nic_copy_stats is not used in Siena, so it is removed. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 4d49e5cd4b095cd1fcf6b1abee0c1bac1b5fc722 Author: Martin Habets Date: Mon May 9 16:32:45 2022 +0100 sfc/siena: Rename functions in mcdi headers to avoid conflicts with sfc For siena use efx_siena_ as the function prefix. Several functions are not used in Siena, so they are removed. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 95e96f7788d0ccea7e70322ce75b873d43124dc9 Author: Martin Habets Date: Mon May 9 16:32:33 2022 +0100 sfc/siena: Rename peripheral functions to avoid conflicts with sfc For siena use efx_siena_ as the function prefix. This patch covers selftest.h, ptp.h, net_driver.h and ethtool_common.h. efx_ethtool_fill_self_tests() can become static. Some functions in ptp.c can also become static. Rename loopback_mode in net_driver.h. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 7f9e4b2a61ba1ffda9ebcf79dc0374e01051e86a Author: Martin Habets Date: Mon May 9 16:32:20 2022 +0100 sfc/siena: Rename RX/TX functions to avoid conflicts with sfc For siena use efx_siena_ as the function prefix. Several functions are not used in Siena, so they are removed. Use a Siena specific variable name for module parameter efx_separate_tx_channels. Move efx_fini_tx_queue() to avoid a forward declaration of efx_dequeue_buffer(). Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 71ad88f661253f5f2500f6e20c34927722401a13 Author: Martin Habets Date: Mon May 9 16:32:08 2022 +0100 sfc/siena: Rename functions in efx headers to avoid conflicts with sfc When building with allyesconfig there are many identical symbol names. For siena use efx_siena_ as the function and variable prefix to avoid build errors. efx_mtd_remove_partition can become static as it is no longer called from other files. efx_ticks_to_usecs and efx_xmit_done_single are not used in Siena, so they are removed. Several functions are only used inside efx_channels.c for Siena so they can become static. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 956f2d86cb37dc6dae8174001a668cbc8b9bbd1f Author: Martin Habets Date: Mon May 9 16:31:55 2022 +0100 sfc/siena: Remove build references to missing functionality Functionality not supported or needed on Siena includes: - Anything for EF100 - EF10 specifics such as register access, PIO and TSO offload. Also only bind to Siena NICs. Remove EF10 specifics from nic.h. The functions that start with efx_farch_ will be removed from sfc.ko with a subsequent patch. Add the efx_ prefix to siena_prepare_flush() to make it consistent with the other APIs. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit d48523cb88e0703055c1b33e61eb644a7976f92b Author: Martin Habets Date: Mon May 9 16:31:43 2022 +0100 sfc: Copy shared files needed for Siena (part 2) These are the files starting with m through w. No changes are done, those will be done with subsequent commits. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 6e173d3b4af9e8804ebdbdb7a4afd7ed8f96220b Author: Martin Habets Date: Mon May 9 16:31:31 2022 +0100 sfc: Copy shared files needed for Siena (part 1) These are the files starting with b through i. No changes are done, those will be done with subsequent commits. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 36ff6393292d3b7b3b02007bd7d9a353524ed225 Author: Martin Habets Date: Mon May 9 16:31:18 2022 +0100 sfc: Move Siena specific files Files are only moved, no changes are made. Signed-off-by: Martin Habets Signed-off-by: Jakub Kicinski commit 61004d1d4badb5ba31d57d49003c17cfcdfed027 Author: Louis Peens Date: Tue May 10 09:48:45 2022 +0200 nfp: flower: fix 'variable 'flow6' set but not used' Kernel test robot reported an issue after a recent patch about an unused variable when CONFIG_IPV6 is disabled. Move the variable declaration to be inside the #ifdef, and do a bit more cleanup. There is no need to use a temporary ipv6 bool value, it is just checked once, remove the extra variable and just do the check directly. Fixes: 9d5447ed44b5 ("nfp: flower: fixup ipv6/ipv4 route lookup for neigh events") Reported-by: kernel test robot Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220510074845.41457-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 81c5495910e81c2cadcb9118ca0c8803ab3bde61 Author: Wan Jiabing Date: Tue May 10 10:49:58 2022 +0800 drm/amdgpu: Remove duplicated argument in vcn_v4_0 Fix following coccicheck warning: ./drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c:724:4-36: duplicated argument to & or | Remove duplicated UVD_SUVD_CGC_GATE__SRE_H264_MASK. Signed-off-by: Wan Jiabing Signed-off-by: Alex Deucher commit 0eb73feebbef21726261fafd20a1c24fe8726333 Author: Alex Deucher Date: Tue May 10 09:37:06 2022 -0400 Revert "drm/amd/pm: keep the BACO feature enabled for suspend" This reverts commit eaa090538e8d21801c6d5f94590c3799e6a528b5. Commit ebc002e3ee78 ("drm/amdgpu: don't use BACO for reset in S3") stops using BACO for reset during suspend, so it's no longer necessary to leave BACO enabled during suspend. This fixes resume from suspend on the navy flounder dGPU in the ASUS ROG Strix G513QY. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2008 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1982 Reviewed-by: Lijo Lazar Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit 5be323562c6a699d38430bc068a3fd192be8ed0d Author: Philip Yang Date: Tue May 10 10:29:54 2022 -0400 drm/amdgpu: vm flush needed after updating PDEs If page table PDEs is evicted and restored, after updating PDEs, need increase vm->tlb_seq, then amdgpu_vm_flush will flush TLB before command submission. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 688ea54949c5dd95732e99d46de23a919311a9ea Author: Aric Cyr Date: Mon May 2 01:11:17 2022 -0400 drm/amd/display: 3.2.185 This version brings along following fixes: - Refactor LTTPR code - Fix PSR after hibernate - Fix DC build errors - Fix IRQ unregister error when unloading amdgpu - Improve DP link training - Fix stutter - Remove redundant CONFIG_DRM_AMD_DC_DCN guards - Fix 2nd connected USB-C display not lighting up Acked-by: Stylon Wang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1039188806d4cfdf9c412bb4ddb51b4d8cd15478 Author: Stylon Wang Date: Wed May 4 18:09:44 2022 +0800 Revert "drm/amd/display: Fix DCN3 B0 DP Alt Mapping" This reverts commit 4b7786d87fb3adf3e534c4f1e4f824d8700b786b. Commit 4b7786d87fb3 ("drm/amd/display: Fix DCN3 B0 DP Alt Mapping") is causing 2nd USB-C display not lighting up. Phy id remapping is done differently than is assumed in this patch. Signed-off-by: Stylon Wang Reviewed-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9e204fdf5e8f2e694914fc7adf0b42d0052cc53e Author: Alex Hung Date: Mon Apr 25 16:31:49 2022 -0600 drm/amd/display: remove unnecessary else by CONFIG_DRM_AMD_DC_DCN [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN guards for #if-#else clause. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7865f22a5ade9947c0b3dea322de316f3db0bd14 Author: James Zhu Date: Sun May 8 13:24:31 2022 -0400 drm/amdgpu/vcn: include header for vcn_dec_sw_ring_emit_fence Fixed warning: no previous prototype for 'vcn_dec_sw_ring_emit_fence'. v2: regenerate patch after git rebase. v3: update commit message. Signed-off-by: James Zhu Reported-by: kernel test robot Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1b85257290f382a78adba1b0a5b59a95cebdfa2f Author: Danijel Slivka Date: Thu May 5 16:45:32 2022 +0200 amdgpu/pm: Disallow managing power profiles on SRIOV for Sienna Cichlid Managing power profiles mode is not allowed in SRIOV mode for Sienna Cichlid. This patch is adjusting the "pp_power_profile_mode" and "power_dpm_force_performance_level" accordingly. Signed-off-by: Danijel Slivka Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit cae5c1ab057197f1dad8524d37906fda3978bcc9 Author: Alex Hung Date: Mon Apr 25 15:12:02 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in amdgpu_dm [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN in amdgpu_dm directory. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 663e48113136769814c913471fbb9ced080b0af2 Author: Evan Quan Date: Sat May 7 14:54:44 2022 +0800 drm/amd/pm: suppress compile warning about possible unaligned accesses Suppress the following compile warning: In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_0_ppt.c:39: >> drivers/gpu/drm/amd/amdgpu/../pm/inc/smu_v13_0_0_pptable.h:194:39: warning: field overdrive_table within 'struct smu_13_0_0_powerplay_table' is less aligned than 'struct smu_13_0_0_overdrive_table' and is usually due to 'struct smu_13_0_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] Reported-by: kernel test robot Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0ae99221f3f73ff284a1db27dcd0d80f39f5b445 Author: Mohammad Zafar Ziya Date: Sat May 7 14:09:21 2022 +0800 drm/amdgpu/vcn: Add vcn ras poison consumption event handling Add vcn ras poison consumption event handling V2: Removed default poison consumption handling function cb Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Lijo Lazar Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7e0357fcf86c4bb237e2fbde77588549fb5af24c Author: Mohammad Zafar Ziya Date: Sat May 7 12:02:56 2022 +0800 drm/amdgpu/jpeg: add jpeg ras poison consumption handling Add jpeg ras poison event callback and consumption handling V2: Removed the default poison consumption cb handle Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Lijo Lazar Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e91241c0306dba4b04cc84b6b4748d5a1279285f Author: Alex Hung Date: Mon Apr 25 14:02:25 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN for z10 [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN for enabling z10. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 47f7d80715704a6c4f071ab2fa38dd2e3ae4a184 Author: Alex Hung Date: Mon Apr 25 13:49:47 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in irq [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN in irq directory. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b63ac5d3033976301f296d048c54d584dfb3ac30 Author: Tao Zhou Date: Mon May 9 17:52:15 2022 +0800 drm/amdgpu: refine RAS poison consumption handler Qeury ras status before ras poison consumption handling, add more comment and log. Signed-off-by: Tao Zhou Reviewed-and-tested-by: Mohammad Zafar Ziya Signed-off-by: Alex Deucher commit 367806068283725d91ffcf49149db1cda5c1fd23 Author: Tao Zhou Date: Mon May 9 14:49:16 2022 +0800 drm/amdgpu: enable RAS IH for poison consumption Enable RAS IH if poison consumption handler is implemented. Signed-off-by: Tao Zhou Reviewed-by: Mohammad Zafar Ziya Signed-off-by: Alex Deucher commit 79e03f29fc84db76f78834b1f73ed329b377d753 Author: Alex Hung Date: Mon Apr 25 13:40:05 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in gpio [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN in gpio directory. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a58cda030231c5e6f70ef376975fbdf3dc0cfda3 Author: Alex Hung Date: Mon Apr 25 13:22:55 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in dce [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN in dce directory. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 59b8ca2425486ab366bf64a575f161baae0dc760 Author: Alex Hung Date: Mon Apr 25 13:07:33 2022 -0600 drm/amd/display: remove redundant CONFIG_DRM_AMD_DC_DCN in dc [Why & How] CONFIG_DRM_AMD_DC_DCN is used by pass the compilation failures, but DC code should be OS-agnostic. This patch fixes it by removing unnecessasry CONFIG_DRM_AMD_DC_DCN in dc and dc/core directories. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5d3e144214105497f6db47f12c94d25df6ba5e52 Author: Josip Pavic Date: Fri Apr 29 14:03:22 2022 -0400 drm/amd/display: do not wait for vblank during pipe programming [Why] Waiting for the vlbank every time a global sync update is requested, including during full update flips, results in a stutter. [How] Do not wait for vblank during pipe programming. Reviewed-by: Aric Cyr Acked-by: Stylon Wang Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c371b0d12d0b8497355cc1ac2a11accd2f5b8528 Author: Wenjing Liu Date: Fri Apr 29 15:42:30 2022 -0400 drm/amd/display: do not calculate DP2.0 SST payload when link is off [Why & How] There is a chance where the RX issues HPD deassert in the middle of link training, this will cause our logic to abort link training and turn off link. However our payload allocation logic needs to use current link settings to determine average time slot per MTP. This will need to use current link bandwidth as divider. This causes divide by zero error occasionally. The fix is to skip DP2.0 payload allocation logic if current link is not in 128b/132b mode. Reviewed-by: George Shen Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d9db36d1cdbf2627b75e56f9915f8a2b01b7d2e0 Author: Alan Liu Date: Tue Apr 26 19:50:00 2022 +0800 drm/amd/display: do not disable an invalid irq source in hdp finish [why] Observing error log about trying to disable non-implemented irq source when user unload the driver. [how] Check and filter the invalid irq source before disabling it. Reviewed-by: Qingqing (Lillian) Zhuo Acked-by: Stylon Wang Signed-off-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 86edfc0db6438a4e1e8e51b3f67b4e2ddefbd735 Author: Josip Pavic Date: Thu Apr 28 17:01:33 2022 -0400 drm/amd/display: move definition of dc_flip_addrs struct [Why & How] Move definition of dc_flip_addrs struct from dc.h to dc_hw_types.h to prevent build errors Reviewed-by: Aric Cyr Acked-by: Stylon Wang Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 99c04671b1e9c08faf5155c0d7347c91932ca2a0 Author: Evgenii Krasnikov Date: Thu Apr 21 17:18:19 2022 -0400 drm/amd/display: Reset cached PSR parameters after hibernate [WHY] After hibernate system might be using old invalid psr_power_opt and psr_allow_active that never get reset [HOW] Reset cached Panel Self Refresh parameters when PSR is first configured for eDP in dc_link_setup_psr. Reviewed-by: Anthony Koo Acked-by: Stylon Wang Signed-off-by: Evgenii Krasnikov Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3b90318d44f87a3582f876802253a7748d270385 Author: Michael Strauss Date: Fri Apr 22 15:40:34 2022 -0400 drm/amd/display: Refactor LTTPR cap retrieval [WHY] Split LTTPR mode selection between platform support and downstream link support Reviewed-by: Wesley Chalmers Acked-by: Stylon Wang Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 362c3c7014d79f9663fa7b7c43c1078d6f0a6f37 Author: Likun Gao Date: Mon Apr 25 16:04:09 2022 +0800 drm/amdgpu: support memory power gating for lsdma 6.0.2 Support memory power gating control for lsdma 6.0.2. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 41967850e4f0720f0b472beb84b908957cbc1ebe Author: Likun Gao Date: Fri May 6 14:53:31 2022 -0400 drm/amdgpu: support memory power gating for lsdma Support memory power gating control for LSDMA. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 74c9b2e704c99d09e3b7e6928df9d8d5891b5174 Author: Likun Gao Date: Mon Apr 25 14:02:25 2022 +0800 drm/amdgpu: add LSDMA block for LSDMA v6.0.2 Add LSDMA ip block for LSDMA v6.0.2. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 04de4afc13d131a79d713213feb5089bfe1b958e Author: Likun Gao Date: Mon Apr 25 14:01:04 2022 +0800 drm/amdgpu: add LSDMA block for LSDMA v6.0.0 Add LSDMA ip block for LSDMA v6.0.0. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d9b9aaae3ad0449fb93dd01290b32ef42ca2f513 Author: Likun Gao Date: Fri May 6 14:50:38 2022 -0400 drm/amdgpu: support fill mem for LSDMA Support constant data filling in PIO mode for LSDMA. Signed-off-by: Likun Gao Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f932ffbbf6ffa9e8425e2d3775a799d3e670c31e Author: Likun Gao Date: Fri May 6 14:45:54 2022 -0400 drm/amdgpu: support mem copy for LSDMA Support memory to memory linear copy in PIO mode for LSDMA. Signed-off-by: Likun Gao Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1b491330421bb0fdeff8eb928ce83fdd636087d3 Author: Likun Gao Date: Thu May 5 13:57:30 2022 -0400 drm/amdgpu: add lsdma block Add Light SDMA (LSDMA) block and related function. LSDMA is a small instance of SDMA mainly for kernel driver use. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 81570d6dc2efc3835cf1f271c582a604c44d35d7 Author: Hawking Zhang Date: Mon Jan 4 15:25:49 2021 +0800 drm/amdgpu: add lsdma v6_0_0 ip headers Add lsdma v6_0_0 register offset and shift masks header files v2: squash in updates (Alex) Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 0d6355844ba18cb3b75054ab1390d8e6f1ab2ffa Author: Dan Carpenter Date: Mon May 9 12:08:49 2022 +0300 drm/amdgpu/gfx11: unlock on error in gfx_v11_0_kiq_resume() Add a missing amdgpu_bo_unreserve(ring->mqd_obj) to an error path in gfx_v11_0_kiq_resume(). Fixes: 3d879e81f0f9 ("drm/amdgpu: add init support for GFX11 (v2)") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 948ceec7c41574666dd1b78fd6bad4d89cdae452 Author: Alex Deucher Date: Fri May 6 11:41:20 2022 -0400 drm/amdgpu/mes: fix format specifier for size_t To avoid a warning on 32 bit. Reported-by: kernel test robot Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit e2ce1d9abd908d968c195a05be1d338e6fc89d84 Author: Alex Deucher Date: Fri May 6 10:28:09 2022 -0400 drm/amdgpu: make smu_v13_0_7_check_fw_status() static It's not used outside of the this file. Reviewed-by: Kenneth Feng Reviewed-by: Guchun Chen Reported-by: kernel test robot Signed-off-by: Alex Deucher commit 4bef1abe74ceab5bc647e6a04453d3772af802dd Author: Alice Wong Date: Tue May 10 17:44:02 2022 -0400 drm/amdgpu/psp: Return failure when firmware failed to load in SRIOV In SRIOV, PSP will block incompatible firmware from loading. When this happens, driver should be prevented from continue initialization and start cleanup. Return failure in psp_cmd_submit_buf when firmware load failed in SRIOV. Signed-off-by: Alice Wong Reviewed-by: Sashank Saye Signed-off-by: Alex Deucher commit 3cc69021e5d4e4fe5322d425f4abf8128f0599b7 Author: Graham Sider Date: Thu Apr 21 10:32:02 2022 -0400 drm/amdgpu: Implement get_vmid_pasid_mapping for gfx11 Implement gmc_v11_0_get_vmid_pasid_mapping_info to fix gmc_v11_0_flush_gpu_tlb_pasid logic. Change from gfx10 to use IH_VMID_*_LUT registers for VMID -> PASID mapping. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3055e5d155b246dd87766655a8a89af4ba8369af Author: Graham Sider Date: Thu May 5 15:07:36 2022 -0400 drm/amdkfd: Update event_interrupt_isr_v11 return Add amdgpu_no_queue_eviction_on_vm_fault condition to event_interrupt_isr_v11 return. If no queue eviction on vm fault specified, function should return false for client/source ids specifying vm fault. Signed-off-by: Graham Sider Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit de4c8a7b028ee16e340745de107b17555d8dc925 Author: Graham Sider Date: Tue Nov 30 13:24:12 2021 -0500 drm/amdgpu: Disable SDMA WPTR_POLL_ENABLE for sdma_v6_0 WPTR_POLL_ENABLE = 1 was kept to support legacy doorbell programming in SimNow environment. Disable for real hardware. Signed-off-by: Graham Sider Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b4e7b0e86f4c0acd4e377bf2d3ce38cad5105d59 Author: Kenneth Feng Date: Fri Apr 29 17:19:26 2022 +0800 drm/amd/pm: enable gfxoff control on smu_v13_0_7 enable gfxoff control interface on smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f5f79e32609dd24943b87abcda47ac37d25b7320 Author: Kenneth Feng Date: Tue Apr 26 17:03:52 2022 +0800 drm/amd/pm: disable ac/dc on smu_v13_0_7 temporarily disable ac/dc on smu_v13_0_7 due to the force clock issue. Signed-off-by: Kenneth Feng Acked-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0137418c8050cb92cc4a02ad5f22104fb0022ff2 Author: Evan Quan Date: Thu Apr 28 22:52:36 2022 +0800 drm/amd/pm: disable the gfxoff feature temporarily for SMU 13.0.0 There is a known "sdma busy" issue with gfxoff enabled. Let's disable the gfxoff feature temporarily until that issue is fixed. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 82682d09bac330d763cb95ec15b77f822063c1ca Author: Evan Quan Date: Thu Apr 28 11:03:04 2022 +0800 drm/amd/pm: enable FCLK DPM support for SMU 13.0.0 With PMFW 78.35.0, the FCLK DPM is ready to go on SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit a3c09346734fd58fa6eff9205eee55628e11ca47 Author: Evan Quan Date: Thu Apr 28 11:00:05 2022 +0800 drm/amd/pm: correct the way for retrieving current fclk frequency Instead of using AverageFclkFrequencyPostDs/AverageFclkFrequencyPreDs, we turn to target clock frequency(CurrClock[PPCLK_FCLK]). Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 48637d8c423d93a2743e9f2de987afc634818783 Author: Evan Quan Date: Wed Apr 27 23:22:00 2022 +0800 drm/amd/pm: correct the way for retrieving current uclk frequency There is some problem with average frequency reading for now. So, we switch to the target frequency reading. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 58a3ed59de9e7b5696385731826139c75916c303 Author: Evan Quan Date: Wed Apr 27 23:16:50 2022 +0800 drm/amd/pm: correct the check for current link status The output from metrics table for current link status changed. We need to update our driver accordingly. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit add490f610ab0a670ae9de24d3b40e9aadc9d395 Author: Evan Quan Date: Wed Apr 27 11:24:45 2022 +0800 drm/amd/pm: enable UCLK DPM for SMU 13.0.0 Enable SMU 13.0.0 UCLK DPM. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 7c1fa0bf65a53c70fe09a050cd59714e1081a934 Author: Evan Quan Date: Mon Apr 25 17:20:40 2022 +0800 drm/amd/pm: enable BACO support for SMU 13.0.0 Enable SMU 13.0.0 BACO support. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 06845732df7857c34116319528854241627593df Author: Evan Quan Date: Mon Apr 25 16:43:45 2022 +0800 drm/amd/pm: enable lclk dpm/ds and BACO features for SMU 13.0.0 Enable those features supported by latest PMFW 78.34.0. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit dfc53681de592d31a6de894c9b9afb14634ec6aa Author: Likun Gao Date: Thu May 5 15:45:06 2022 -0400 drm/amdgpu: add sysfs to shows psp vbflash status Add new sysfs interface to shows the status of psp vbflash status. V2: rename the sysfs interface, and set more return value. (0: not start; 1: in progress; MBX115 value when vbflash finish) V3: warning fixes Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8424f2ccb3c0dd43369288a47d15c980136c3bd5 Author: Likun Gao Date: Tue Feb 22 13:34:28 2022 +0800 drm/amdgpu/psp: Add vbflash sysfs interface support Add sysfs interface to copy VBIOS. v2: squash in fix for proper vmalloc API (Alex) Signed-off-by: Andrey Grodzovsky Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cb411545309e69753bfa4805060c17faaa25500d Merge: 9376d3898b2da 5b6c7e5c44349 Author: Alexei Starovoitov Date: Tue May 10 14:42:06 2022 -0700 Merge branch 'bpf: Speed up symbol resolving in kprobe multi link' Jiri Olsa says: ==================== hi, sending additional fix for symbol resolving in kprobe multi link requested by Alexei and Andrii [1]. This speeds up bpftrace kprobe attachment, when using pure symbols (3344 symbols) to attach: Before: # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' ... 6.5681 +- 0.0225 seconds time elapsed ( +- 0.34% ) After: # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' ... 0.5661 +- 0.0275 seconds time elapsed ( +- 4.85% ) v6 changes: - rewrote patch 1 changelog and fixed the line length [Christoph] v5 changes: - added acks [Masami] - workaround in selftest for RCU warning by filtering out several functions to attach v4 changes: - fix compile issue [kernel test robot] - added acks [Andrii] v3 changes: - renamed kallsyms_lookup_names to ftrace_lookup_symbols and moved it to ftrace.c [Masami] - added ack [Andrii] - couple small test fixes [Andrii] v2 changes (first version [2]): - removed the 2 seconds check [Alexei] - moving/forcing symbols sorting out of kallsyms_lookup_names function [Alexei] - skipping one array allocation and copy_from_user [Andrii] - several small fixes [Masami,Andrii] - build fix [kernel test robot] thanks, jirka [1] https://lore.kernel.org/bpf/CAEf4BzZtQaiUxQ-sm_hH2qKPRaqGHyOfEsW96DxtBHRaKLoL3Q@mail.gmail.com/ [2] https://lore.kernel.org/bpf/20220407125224.310255-1-jolsa@kernel.org/ ==================== Signed-off-by: Alexei Starovoitov commit 5b6c7e5c44349b29c614e1b61f80c6849fc72ccf Author: Jiri Olsa Date: Tue May 10 14:26:16 2022 +0200 selftests/bpf: Add attach bench test Adding test that reads all functions from ftrace available_filter_functions file and attach them all through kprobe_multi API. It also prints stats info with -v option, like on my setup: test_bench_attach: found 48712 functions test_bench_attach: attached in 1.069s test_bench_attach: detached in 0.373s Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220510122616.2652285-6-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 0236fec57a15dc2a068dfe4488e0c2ab4559b1ec Author: Jiri Olsa Date: Tue May 10 14:26:15 2022 +0200 bpf: Resolve symbols with ftrace_lookup_symbols for kprobe multi link Using kallsyms_lookup_names function to speed up symbols lookup in kprobe multi link attachment and replacing with it the current kprobe_multi_resolve_syms function. This speeds up bpftrace kprobe attachment: # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' ... 6.5681 +- 0.0225 seconds time elapsed ( +- 0.34% ) After: # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' ... 0.5661 +- 0.0275 seconds time elapsed ( +- 4.85% ) Acked-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220510122616.2652285-5-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 8be9253344a1d8cd91b22655e55de41e3288aaf9 Author: Jiri Olsa Date: Tue May 10 14:26:14 2022 +0200 fprobe: Resolve symbols with ftrace_lookup_symbols Using ftrace_lookup_symbols to speed up symbols lookup in register_fprobe_syms API. Acked-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220510122616.2652285-4-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit bed0d9a50dacee6fcf785c555cfb0d2573355afc Author: Jiri Olsa Date: Tue May 10 14:26:13 2022 +0200 ftrace: Add ftrace_lookup_symbols function Adding ftrace_lookup_symbols function that resolves array of symbols with single pass over kallsyms. The user provides array of string pointers with count and pointer to allocated array for resolved values. int ftrace_lookup_symbols(const char **sorted_syms, size_t cnt, unsigned long *addrs) It iterates all kallsyms symbols and tries to loop up each in provided symbols array with bsearch. The symbols array needs to be sorted by name for this reason. We also check each symbol to pass ftrace_location, because this API will be used for fprobe symbols resolving. Suggested-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Reviewed-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220510122616.2652285-3-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit d721def7392a7348ffb9f3583b264239cbd3702c Author: Jiri Olsa Date: Tue May 10 14:26:12 2022 +0200 kallsyms: Make kallsyms_on_each_symbol generally available Making kallsyms_on_each_symbol generally available, so it can be used outside CONFIG_LIVEPATCH option in following changes. Rather than adding another ifdef option let's make the function generally available (when CONFIG_KALLSYMS option is defined). Cc: Christoph Hellwig Reviewed-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20220510122616.2652285-2-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 95073d08154a27b1d0a84bcf6210e67c3b4d8c08 Author: Sasha Neftin Date: Sat Apr 23 19:55:02 2022 +0300 igc: Change type of the 'igc_check_downshift' method The 'igc_check_downshift' method always returns 0; there is no need for a return value so change the type of this method to void. Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 7241069f7a0715f85ec868cf807446a6113b84fe Author: Sasha Neftin Date: Sat Apr 23 19:53:21 2022 +0300 igc: Remove unused phy_type enum Complete to commit 8e153faf5827 ("igc: Remove unused phy type") i225 parts have only one PHY. There is no point to use phy_type enum. Clean up the code accordingly, and get rid of the unused enum lines. Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit d098538ed4e8a6c09f86cf243f406c1451066040 Author: Sasha Neftin Date: Mon Mar 21 08:05:10 2022 +0200 igc: Remove igc_set_spd_dplx method igc_set_spd_dplx method is not used. This patch comes to tidy up the driver code. Reported-by: Muhammad Husaini Zulkifli Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 9376d3898b2da50e6a6e7c0c1a0d7a3bbf0b8f44 Merge: c4423a174d292 5a9b8e2c1ad44 Author: Alexei Starovoitov Date: Tue May 10 11:20:45 2022 -0700 Merge branch 'bpf: bpf link iterator' Dmitrii Dolgov says: ==================== Bpf links seem to be one of the important structures for which no iterator is provided. Such iterator could be useful in those cases when generic 'task/file' is not suitable or better performance is needed. The implementation is mostly copied from prog iterator. This time tests were executed, although I still had to exclude test_bpf_nf (failed to find BTF info for global/extern symbol 'bpf_skb_ct_lookup') -- since it's unrelated, I hope it's a minor issue. Per suggestion from the previous discussion, there is a new patch for converting CHECK to corresponding ASSERT_* macro. Such replacement is done only if the final result would be the same, e.g. CHECK with important-looking custom formatting strings are still in place -- from what I understand ASSERT_* doesn't allow to specify such format. The third small patch fixes what looks like a copy-paste error in the condition checking. ==================== Signed-off-by: Alexei Starovoitov commit 5a9b8e2c1ad44ade2f0e5419de223425bd380bda Author: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Tue May 10 17:52:33 2022 +0200 selftests/bpf: Add bpf link iter test Add a simple test for bpf link iterator Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Link: https://lore.kernel.org/r/20220510155233.9815-5-9erthalion6@gmail.com Signed-off-by: Alexei Starovoitov commit f78625fdc95efeaac6deea5a4ed992dff7358c1e Author: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Tue May 10 17:52:32 2022 +0200 selftests/bpf: Use ASSERT_* instead of CHECK Replace usage of CHECK with a corresponding ASSERT_* macro for bpf_iter tests. Only done if the final result is equivalent, no changes when replacement means loosing some information, e.g. from formatting string. Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Link: https://lore.kernel.org/r/20220510155233.9815-4-9erthalion6@gmail.com Signed-off-by: Alexei Starovoitov commit 6b2d16b6579acf63456817fda3bc9bf4a35c6a60 Author: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Tue May 10 17:52:31 2022 +0200 selftests/bpf: Fix result check for test_bpf_hash_map The original condition looks like a typo, verify the skeleton loading result instead. Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Link: https://lore.kernel.org/r/20220510155233.9815-3-9erthalion6@gmail.com Signed-off-by: Alexei Starovoitov commit 9f88361273082825d9f0d13a543d49f9fa0d44a8 Author: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Tue May 10 17:52:30 2022 +0200 bpf: Add bpf_link iterator Implement bpf_link iterator to traverse links via bpf_seq_file operations. The changeset is mostly shamelessly copied from commit a228a64fc1e4 ("bpf: Add bpf_prog iterator") Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20220510155233.9815-2-9erthalion6@gmail.com Signed-off-by: Alexei Starovoitov commit c4423a174d2926c1c165176d17383631d75dfbec Merge: bd2331b3757f5 71b2ec21c3313 Author: Alexei Starovoitov Date: Tue May 10 10:49:03 2022 -0700 Merge branch 'Add source ip in bpf tunnel key' Kaixi Fan says: ==================== From: Kaixi Fan Now bpf code could not set tunnel source ip address of ip tunnel. So it could not support flow based tunnel mode completely. Because flow based tunnel mode could set tunnel source, destination ip address and tunnel key simultaneously. Flow based tunnel is useful for overlay networks. And by configuring tunnel source ip address, user could make their networks more elastic. For example, tunnel source ip could be used to select different egress nic interface for different flows with same tunnel destination ip. Another example, user could choose one of multiple ip address of the egress nic interface as the packet's tunnel source ip. Add tunnel and tunnel source testcases in test_progs. Other types of tunnel testcases would be moved to test_progs step by step in the future. v6: - use libbpf api to attach tc progs and remove some shell commands to reduce test runtime based on Alexei Starovoitov's suggestion v5: - fix some code format errors - use bpf kernel code at namespace at_ns0 to set tunnel metadata v4: - fix subject error of first patch v3: - move vxlan tunnel testcases to test_progs - replace bpf_trace_printk with bpf_printk - rename bpf kernel prog section name to tic v2: - merge vxlan tunnel and tunnel source ip testcases in test_tunnel.sh ==================== Signed-off-by: Alexei Starovoitov commit 71b2ec21c3313e4cea38d5a6b009e99df30e540a Author: Kaixi Fan Date: Sat Apr 30 15:48:44 2022 +0800 selftests/bpf: Replace bpf_trace_printk in tunnel kernel code Replace bpf_trace_printk with bpf_printk in test_tunnel_kern.c. function bpf_printk is more easier and useful than bpf_trace_printk. Signed-off-by: Kaixi Fan Link: https://lore.kernel.org/r/20220430074844.69214-4-fankaixi.li@bytedance.com Signed-off-by: Alexei Starovoitov commit 1ee7efd40abf3ab01e67ff4be15d4385d5fa52c1 Author: Kaixi Fan Date: Sat Apr 30 15:48:43 2022 +0800 selftests/bpf: Move vxlan tunnel testcases to test_progs Move vxlan tunnel testcases from test_tunnel.sh to test_progs. And add vxlan tunnel source testcases also. Other tunnel testcases will be moved to test_progs step by step in the future. Rename bpf program section name as SEC("tc") because test_progs bpf loader could not load sections with name SEC("gre_set_tunnel"). Because of this, add bpftool to load bpf programs in test_tunnel.sh. Signed-off-by: Kaixi Fan Link: https://lore.kernel.org/r/20220430074844.69214-3-fankaixi.li@bytedance.com Signed-off-by: Alexei Starovoitov commit 26101f5ab6bdf30ac25c8e578e0b4873e7849e0c Author: Kaixi Fan Date: Sat Apr 30 15:48:42 2022 +0800 bpf: Add source ip in "struct bpf_tunnel_key" Add tunnel source ip field in "struct bpf_tunnel_key". Add related code to set and get tunnel source field. Signed-off-by: Kaixi Fan Link: https://lore.kernel.org/r/20220430074844.69214-2-fankaixi.li@bytedance.com Signed-off-by: Alexei Starovoitov commit bd2331b3757f5b2ab4aafc591b55fa2a592abf7c Author: KP Singh Date: Mon May 9 21:49:05 2022 +0000 bpftool: bpf_link_get_from_fd support for LSM programs in lskel bpf_link_get_from_fd currently returns a NULL fd for LSM programs. LSM programs are similar to tracing programs and can also use skel_raw_tracepoint_open. Signed-off-by: KP Singh Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220509214905.3754984-1-kpsingh@kernel.org commit 1ff297584fad2eef390f212b860e0fbb7363e0e8 Author: Kees Cook Date: Tue May 10 10:29:36 2022 -0700 randomize_kstack: Improve docs on requirements/rationale There were some recent questions about where and why to use the random_kstack routines when applying them to new architectures[1]. Update the header comments to reflect the design choices for the routines. [1] https://lore.kernel.org/lkml/1652173338.7bltwybi0c.astroid@bobo.none Cc: Nicholas Piggin Cc: Xiu Jianfeng Signed-off-by: Kees Cook commit cad10ce36671c99dde850de7bd4ca0d8df66c47f Author: Namhyung Kim Date: Mon May 2 16:20:15 2022 -0700 perf annotate: Add --percent-limit option Like in 'perf report' and 'perf top', Add this option to limit the number of functions it displays based on the overhead value in percent. This affects only stdio and stdio2 output modes. Without this, it shows very long disassembly lines for every function in the data file. If users don't want this behavior, they can set a value in percent to suppress that. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220502232015.697243-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a82ebb093fc7bdd88f8df17b2fa303d7535fa43b Author: Takshak Chahande Date: Tue May 10 01:22:21 2022 -0700 selftests/bpf: Handle batch operations for map-in-map bpf-maps This patch adds up test cases that handles 4 combinations: a) outer map: BPF_MAP_TYPE_ARRAY_OF_MAPS inner maps: BPF_MAP_TYPE_ARRAY and BPF_MAP_TYPE_HASH b) outer map: BPF_MAP_TYPE_HASH_OF_MAPS inner maps: BPF_MAP_TYPE_ARRAY and BPF_MAP_TYPE_HASH Signed-off-by: Takshak Chahande Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220510082221.2390540-2-ctakshak@fb.com commit 9263dddc7b6f816fdd327eee435cc54ba51dd095 Author: Takshak Chahande Date: Tue May 10 01:22:20 2022 -0700 bpf: Extend batch operations for map-in-map bpf-maps This patch extends batch operations support for map-in-map map-types: BPF_MAP_TYPE_HASH_OF_MAPS and BPF_MAP_TYPE_ARRAY_OF_MAPS A usecase where outer HASH map holds hundred of VIP entries and its associated reuse-ports per VIP stored in REUSEPORT_SOCKARRAY type inner map, needs to do batch operation for performance gain. This patch leverages the exiting generic functions for most of the batch operations. As map-in-map's value contains the actual reference of the inner map, for BPF_MAP_TYPE_HASH_OF_MAPS type, it needed an extra step to fetch the map_id from the reference value. selftests are added in next patch 2/2. Signed-off-by: Takshak Chahande Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220510082221.2390540-1-ctakshak@fb.com commit 7df319e5b3b60f159bebf2949f7e28823fff2086 Author: Adrian Hunter Date: Fri May 6 15:25:47 2022 +0300 perf auxtrace: Record whether an auxtrace mmap is needed Add a flag needs_auxtrace_mmap to record whether an auxtrace mmap is needed, in preparation for correctly determining whether or not an auxtrace mmap is needed. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-10-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 8f111be6434de90c9743ea522c32b384d203a8de Author: Adrian Hunter Date: Fri May 6 15:25:46 2022 +0300 libperf evlist: Add evsel as a parameter to ->idx() Add evsel as a parameter to ->idx() in preparation for correctly determining whether an auxtrace mmap is needed. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d8fe2efb65acdc213eb180b7853fc1121c1bff37 Author: Adrian Hunter Date: Fri May 6 15:25:45 2022 +0300 libperf evlist: Move ->idx() into mmap_per_evsel() Move ->idx() into mmap_per_evsel() in preparation for adding evsel as a parameter. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 6a7b8a5a30e60e27cd2489af3d0a441280b441e6 Author: Adrian Hunter Date: Fri May 6 15:25:44 2022 +0300 libperf evlist: Remove ->idx() per_cpu parameter Remove ->idx() per_cpu parameter because it isn't needed. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-7-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d205a3a665158f4229845aaa29245b19a9e4be03 Author: Adrian Hunter Date: Fri May 6 15:25:43 2022 +0300 perf auxtrace: Do not mix up mmap idx The idx is with respect to evlist not evsel. That hasn't mattered because they are the same at present. Prepare for that not being the case, which it won't be when sideband tracking events are allowed on all CPUs even when auxtrace is limited to selected CPUs. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 024b3b42adc07f6292adcfbae50c6f2db0546b60 Author: Adrian Hunter Date: Fri May 6 15:25:42 2022 +0300 perf auxtrace: Move evlist__enable_event_idx() to auxtrace.c evlist__enable_event_idx() is used only by auxtrace. Move it to auxtrace.c in preparation for making it even more auxtrace specific. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit a40bb7518e78afb2958bc5857c8c72d753655245 Author: Adrian Hunter Date: Fri May 6 15:25:41 2022 +0300 perf evlist: Use libperf functions in evlist__enable_event_idx() evlist__enable_event_idx() is used only for auxtrace events which are never system_wide. Simplify by using libperf enable event functions. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit b35f27fe73d8c86fe40125e063b28007e961b862 Author: Chanho Park Date: Wed May 4 16:51:51 2022 +0900 clk: samsung: exynosautov9: add cmu_peric1 clock support Like CMU_PERIC0, this provides clocks for USI06 ~ USI11 and USI_I2C. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-10-chanho61.park@samsung.com commit f2dd366992d03b5676b495edc41f69078693eb8a Author: Chanho Park Date: Wed May 4 16:51:50 2022 +0900 clk: samsung: exynosautov9: add cmu_peric0 clock support CMU_PERIC0 provides clocks for USI0 ~ USI5 and USIx_I2C. USI0/1/2/3/4/5 have its own divider but USI_I2Cs share "dout_peric0_usi_i2c" divider. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504075154.58819-9-chanho61.park@samsung.com commit 65165b11eee8a7a94d0b1a0d3480f6957c4c6970 Author: Chanho Park Date: Wed May 4 16:51:49 2022 +0900 clk: samsung: exynosautov9: add cmu_fsys2 clock support CMU_FSYS2 is responsible to control clocks of BLK_FSYS2 which includes ufs and ethernet IPs. This patch adds some essential clocks to be controlled by ethernet/ufs drivers instead of listing full clocks. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-8-chanho61.park@samsung.com commit 69a21d53381722c9fe0d232b6c335be5e7e0f11d Author: Chanho Park Date: Wed May 4 16:51:48 2022 +0900 clk: samsung: exynosautov9: add cmu_busmc clock support CMU_BUSMC is responsible to control clocks of BLK_BUSMC which represents Data/Peri buses. Most clocks except PDMA/SPDMA are not necessary to be controlled by HLOS. So, this adds PDMA/SPDMA gate clocks. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-7-chanho61.park@samsung.com commit ceb4c8b3c6b9f461d88ddc8c4d9bf19efaebe824 Author: Chanho Park Date: Wed May 4 16:51:47 2022 +0900 clk: samsung: exynosautov9: add cmu_peris clock support CMU_PERIS is responsible to control clocks of BLK_PERIS which has OPT/MCT/WDT and TMU. This patch only supports WDT gate clocks and all other clocks except WDT will be supported later. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-6-chanho61.park@samsung.com commit 17f7dc48aabd90a3327495dfc24c3476c43f12cb Author: Chanho Park Date: Wed May 4 16:51:46 2022 +0900 clk: samsung: exynosautov9: add cmu_core clock support Add CMU_CORE clock which represents Core BUS clocks. The source clocks of this CMU block are oscclk or dout_clkcmu_core_bus. Thus, two source clocks should be provided via device tree. All the gate clocks are defined as CLK_IS_CRITICAL because they control(gate/ungate) core bus clocks but not been assigned to any drivers. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-5-chanho61.park@samsung.com commit 6587c62f69dc11ca80ca746854626bf0394e1088 Author: Chanho Park Date: Wed May 4 16:51:45 2022 +0900 clk: samsung: add top clock support for Exynos Auto v9 SoC This adds support for CMU_TOP which generates clocks for all the function blocks such as CORE, FSYS0/1/2, PERIC0/1 and so on. For CMU_TOP, PLL_SHARED0,1,2,3 and 4 will be the sources of this block and they will generate bus clocks. Signed-off-by: Chanho Park Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-4-chanho61.park@samsung.com commit 00632610c2f0b732ae87b8c7e7e1375abaeb01a0 Author: Adrian Hunter Date: Fri May 6 15:25:40 2022 +0300 libperf evsel: Add perf_evsel__enable_thread() Add perf_evsel__enable_thread() as a counterpart to perf_evsel__enable_cpu(), to enable all events for a thread. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220506122601.367589-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 174efa7811659b3e3dec05b3649dc6d66c8c4628 Author: Tiezhu Yang Date: Tue May 10 11:35:03 2022 +0800 bpf: Print some info if disable bpf_jit_enable failed A user told me that bpf_jit_enable can be disabled on one system, but he failed to disable bpf_jit_enable on the other system: # echo 0 > /proc/sys/net/core/bpf_jit_enable bash: echo: write error: Invalid argument No useful info is available through the dmesg log, a quick analysis shows that the issue is related with CONFIG_BPF_JIT_ALWAYS_ON. When CONFIG_BPF_JIT_ALWAYS_ON is enabled, bpf_jit_enable is permanently set to 1 and setting any other value than that will return failure. It is better to print some info to tell the user if disable bpf_jit_enable failed. Signed-off-by: Tiezhu Yang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/1652153703-22729-3-git-send-email-yangtiezhu@loongson.cn commit f922c8972fb53ad9221501e2e432f06246c74cc8 Author: Tiezhu Yang Date: Tue May 10 11:35:02 2022 +0800 net: sysctl: Use SYSCTL_TWO instead of &two It is better to use SYSCTL_TWO instead of &two, and then we can remove the variable "two" in net/core/sysctl_net_core.c. Signed-off-by: Tiezhu Yang Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/1652153703-22729-2-git-send-email-yangtiezhu@loongson.cn commit 25c321e8534e9efe1869b548e7912faffed1f5be Author: Colin Ian King Date: Mon May 9 14:57:32 2022 +0300 ath11k: remove redundant assignment to variables vht_mcs and he_mcs The variables vht_mcs and he_mcs are being initialized in the start of for-loops however they are re-assigned new values in the loop and not used outside the loop. The initializations are redundant and can be removed. Cleans up clang scan warnings: warning: Although the value stored to 'vht_mcs' is used in the enclosing expression, the value is never actually read from 'vht_mcs' [deadcode.DeadStores] warning: Although the value stored to 'he_mcs' is used in the enclosing expression, the value is never actually read from 'he_mcs' [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220507184155.26939-1-colin.i.king@gmail.com commit 5962f370ce416371b432325a8f98680f73a1bfdc Author: Anilkumar Kolli Date: Mon May 9 14:57:32 2022 +0300 ath11k: Reuse the available memory after firmware reload Ath11k allocates memory when firmware requests memory in QMI. Coldboot calibration and firmware recovery uses firmware reload. On firmware reload, firmware sends memory request again. If Ath11k allocates memory on first firmware boot, reuse the available memory. Also check if the segment type and size is same on the next firmware boot. Reuse if segment type/size is same as previous firmware boot else free the segment and allocate the segment with size/type. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.6.0.1-00752-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506141448.10340-1-quic_akolli@quicinc.com commit 4255a07a98cb0054947fbe5cb3d6f0b5eb87522b Author: Johannes Berg Date: Mon May 9 14:57:32 2022 +0300 wil6210: remove 'freq' debugfs This is completely racy, remove it. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506095451.9852305a92c8.I05155824a1b9059eb59beccde81786dc69de354a@changeid commit 1d7f514577f0ccf3e5f5736247138868fb62896a Author: Baochen Qiang Date: Mon May 9 14:57:32 2022 +0300 ath11k: Designating channel frequency when sending management frames In case of Passpoint, the WLAN interface may be requested to remain on a specific channel and then to send some management frames on that channel. Now chanfreq of wmi_mgmt_send_cmd is set as 0, as a result firmware may choose a default but wrong channel. Fix it by assigning chanfreq field with the designated channel. This change only applies to WCN6855 and QCA6390, other chips are not affected. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506013614.1580274-4-quic_bqiang@quicinc.com commit 355333a217541916576351446b5832fec7930566 Author: Baochen Qiang Date: Mon May 9 14:57:31 2022 +0300 ath11k: Don't check arvif->is_started before sending management frames Commit 66307ca04057 ("ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev") wants both of below two conditions are true before sending management frames: 1: ar->allocated_vdev_map & (1LL << arvif->vdev_id) 2: arvif->is_started Actually the second one is not necessary because with the first one we can make sure the vdev is present. Also use ar->conf_mutex to synchronize vdev delete and mgmt. TX. This issue is found in case of Passpoint scenario where ath11k needs to send action frames before vdev is started. Fix it by removing the second condition. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Fixes: 66307ca04057 ("ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506013614.1580274-3-quic_bqiang@quicinc.com commit 3a5627b94222c3abc7e65486e2d2c0cc0a35c140 Author: Baochen Qiang Date: Mon May 9 14:57:31 2022 +0300 ath11k: Implement remain-on-channel support Add remain on channel support, it is needed in several scenarios such as Passpoint etc. Currently this is supported by QCA6390, WCN6855, IPQ8074, IPQ6018 and QCN9074. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506013614.1580274-2-quic_bqiang@quicinc.com commit 0f84a156aa3b9c9889c64a31d36b533508fabcb7 Author: Baochen Qiang Date: Mon May 9 14:57:31 2022 +0300 ath11k: Handle keepalive during WoWLAN suspend and resume With WoWLAN enabled and after sleeping for a rather long time, we are seeing that with some APs, it is not able to wake up the STA though the correct wake up pattern has been configured. This is because the host doesn't send keepalive command to firmware, thus firmware will not send any packet to the AP and after a specific time the AP kicks out the STA. Fix this issue by enabling keepalive before going to suspend and disabling it after resume back. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506012540.1579604-1-quic_bqiang@quicinc.com commit e30b64a3ab9b9640e25b2ee6d7a9d70c1efd3b67 Author: Dan Carpenter Date: Fri May 6 17:53:52 2022 +0300 hte: Fix off by one in hte_push_ts_ns() The &chip->gdev->ei[] array has chip->nlines elements so this > comparison needs to be >= to prevent an out of bounds access. The gdev->ei[] array is allocated in hte_register_chip(). Fixes: 31ab09b42188 ("drivers: Add hardware timestamp engine (HTE) subsystem") Signed-off-by: Dan Carpenter Reviewed-by: Dipen Patel Acked-by: Dipen Patel Signed-off-by: Thierry Reding commit 0668e8ccd33122a350629f6583c880b62b40ab5d Author: Yang Yingliang Date: Fri May 6 16:48:51 2022 +0800 hte: Fix possible use-after-free in tegra_hte_test_remove() del_timer() does not wait until the timer handler finishing. This means that the timer handler may still be running after the driver's remove function has finished, which would result in a use-after-free. Fix it by calling del_timer_sync(), which makes sure the timer handler has finished. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Dipen Patel Acked-by: Dipen Patel Signed-off-by: Thierry Reding commit e0bfb57e1b0fa93fc9ce3b6c4e40a0281cdba7bc Author: Jiapeng Chong Date: Fri May 6 11:42:09 2022 +0800 hte: Remove unused including Eliminate the follow versioncheck warning: ./drivers/hte/hte-tegra194-test.c: 8 linux/version.h not needed. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Dipen Patel Acked-by: Dipen Patel Signed-off-by: Thierry Reding commit 0d8688298d6a43f2e187dad1e45871248123764f Author: Ian Abbott Date: Tue May 10 12:51:41 2022 +0100 spi: cadence-quadspi: remove unnecessary (void *) casts Remove a couple of unnecessary casts to `(void *)` when initializing the `.data` members in the device ID table. Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20220510115141.212779-3-abbotti@mev.co.uk Signed-off-by: Mark Brown commit 76159e2f9a0fa29fd9fccb262687d95282985b49 Author: Ian Abbott Date: Tue May 10 12:51:40 2022 +0100 spi: cadence-quadspi: Add missing blank line in cqspi_request_mmap_dma() Fix "WARNING: Missing a blank line after declarations" reported by checkpatch.pl. Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20220510115141.212779-2-abbotti@mev.co.uk Signed-off-by: Mark Brown commit 7b46eb1bf9534a75ff072a01e774b79e6a17cfdd Author: Shengjiu Wang Date: Mon May 9 17:14:23 2022 +0800 ASoC: dt-bindings: fsl,micfil: Add compatible string for imx8mp Add compatible string for imx8mp, which has micfil module Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1652087663-1908-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit cb05dac1bc34ad701972503ca1a75b51ae4478ff Author: Shengjiu Wang Date: Mon May 9 17:14:22 2022 +0800 ASoC: fsl_micfil: Add support for i.MX8MPlus On i.MX8Plus there are two updates for micfil module. One is that the output format is S32_LE, only the 24 more significative bits have information, the other bits are always zero. Add 'formats' variable in soc data to distinguish the format on different platform. Another is that the fifo depth is 32 entries. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1652087663-1908-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 2cb29da3f2c29e62311eec6446be92aa5f2c1620 Author: YC Hung Date: Mon May 9 12:04:25 2022 -0500 ASoC: SOF: ipc: introduce cont_update_posn in sof_ipc_stream_params struct The host stream position is updated when no_stream_position is set as 0. However current implementation updates host stream position only when report data is larger than or equal to host period size which is decided by the period size of host side. It maybe cause host stream position update not in time. Therefore this patch introduces another field "cont_update_posn", a boolean value aimed to update host stream position continuously and based on period size of pipeline. It can get better precise when need to update host stream position from firmware. Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220509170425.54640-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9d62ba94266be3ddc864348a4df7e54f5562f0d5 Author: Yang Yingliang Date: Tue May 10 20:47:49 2022 +0800 ASoC: samsung: spdif: remove unnecessary check of mem_res The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220510124749.2663874-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit cebbefbd22d5afd161a4762ced7212c10971d011 Author: Brent Lu Date: Mon May 9 12:09:22 2022 -0500 ASoC: Intel: sof_ssp_amp: enable capture stream from cs35l41 Enable capture stream of the cs35l41 dai link to support feedback stream from amplifier. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220509170922.54868-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d1c808765deb2bcd35d827402ed4d75d068aae18 Author: Brent Lu Date: Mon May 9 12:09:21 2022 -0500 ASoC: Intel: sof_ssp_amp: fix no DMIC BE Link on Chromebooks The SOF topology supports 2 BE Links(dmic01 and dmic16k) and each link supports up to four DMICs. However, Chromebook does not implement ACPI NHLT table so the mach->mach_params.dmic_num is always zero. We add a quirk so machine driver knows it's running on a Chromebook and need to create BE Links for DMIC. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220509170922.54868-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0b56ed197d7df394fc4918bfea0f77e6192996b0 Author: Vamshi Krishna Date: Mon May 9 12:09:20 2022 -0500 ASoC: Intel: sof_rt5682: Add support for adl_rt1019_rt5682s This patch adds the driver data for two rt1019 speaker amplifiers on SSP1 and rt5682s on SSP0 for ADL platform Reviewed-by: Brent Lu Signed-off-by: Vamshi Krishna Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220509170922.54868-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 846e437387e74c44ddc9f3eeec472fd37ca3cdb9 Author: Yishai Hadas Date: Tue May 10 12:02:03 2022 +0300 net/mlx5: Expose mlx5_sriov_blocking_notifier_register / unregister APIs Expose mlx5_sriov_blocking_notifier_register / unregister APIs to let a VF register to be notified for its enablement / disablement by the PF. Upon VF probe it will call mlx5_sriov_blocking_notifier_register() with its notifier block and upon VF remove it will call mlx5_sriov_blocking_notifier_unregister() to drop its registration. This can give a VF the ability to clean some resources upon disable before that the command interface goes down and on the other hand sets some stuff before that it's enabled. This may be used by a VF which is migration capable in few cases.(e.g. PF load/unload upon an health recovery). Link: https://lore.kernel.org/r/20220510090206.90374-2-yishaih@nvidia.com Signed-off-by: Yishai Hadas Signed-off-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit c23d47abee3a54e4991ed3993340596d04aabd6a Author: Christoph Hellwig Date: Tue Apr 19 08:33:03 2022 +0200 loop: remove most the top-of-file boilerplate comment from the UAPI header Just leave the SPDX marker and the copyright notice and remove the irrelevant rest. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220419063303.583106-5-hch@lst.de Signed-off-by: Jens Axboe commit eb04bb154b76a0633afc5d26c1de7619a6686e9b Author: Christoph Hellwig Date: Tue Apr 19 08:33:02 2022 +0200 loop: remove most the top-of-file boilerplate comment Remove the irrelevant changelogs and todo notes and just leave the SPDX marker and the copyright notice. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220419063303.583106-4-hch@lst.de Signed-off-by: Jens Axboe commit f21e6e185a3a95dedc0d604b468d40ff1dc71fd9 Author: Christoph Hellwig Date: Tue Apr 19 08:33:01 2022 +0200 loop: add a SPDX header The copyright statement says: "Redistribution of this file is permitted under the GNU General Public License." and was added by Ted in 1993, at which point GPLv2 only was the default Linux license. Replace it with the usual GPLv2 only SPDX header. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220419063303.583106-3-hch@lst.de Signed-off-by: Jens Axboe commit 754d96798fab1316f4f14bb86cf3c0244cb2b20b Author: Christoph Hellwig Date: Tue Apr 19 08:33:00 2022 +0200 loop: remove loop.h Merge loop.h into loop.c as all the content is only used there. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220419063303.583106-2-hch@lst.de Signed-off-by: Jens Axboe commit e1c9f68aa23a8bf98e956e92e61293ef51bd6282 Author: Zheyu Ma Date: Tue May 10 13:30:31 2022 +0800 ASoC: tlv320adcx140: Register a callback to disable the regulator_disable The driver should register a callback that will deal with the disabling when it fails to probe. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220510053031.1685337-1-zheyuma97@gmail.com Signed-off-by: Mark Brown commit 5118da41c7594ccf4e64003bf325ffcefb3da6e3 Author: Pierre-Louis Bossart Date: Mon May 9 13:57:29 2022 -0500 ASoC: codecs: rt715-sdca: remove useless assignment of ops The ops are already part of the 'struct sdw_driver', it's unclear why this was copied into the 'slave' structure - no other driver does so. Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220509185729.59884-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 33835e8dfb3c79821cdc6e2a9b48ae05bd4820dc Author: Tanmay Jagdale Date: Tue May 10 15:56:57 2022 +0530 perf/marvell_cn10k: Fix tad_pmu_event_init() to check pmu type first Make sure to check the pmu type first and then check event->attr.disabled. Doing so would avoid reading the disabled attribute of an event that is not handled by TAD PMU. Signed-off-by: Tanmay Jagdale Link: https://lore.kernel.org/r/20220510102657.487539-1-tanmay@marvell.com Signed-off-by: Will Deacon commit 795dd8d3b883b0e7f5ceb66efe362749b0c65f7d Merge: d491db14df2f5 e2d61f6255a26 Author: Mark Brown Date: Tue May 10 12:12:50 2022 +0100 Clean up usage of the endianness flag Merge series from Charles Keepax : Before componentisation any part registered as a CODEC would have automatically supported both little and big endian, ie. the core would duplicate any supported LE or BE PCM format to support the other endian as well. As componentisation removed the distinction between CODEC drivers and platform drivers, a flag was added to specify if this behaviour is required for a particular component. However, as most systems tend to use little endian the absence of the flag is rarely noticed. Also the naming of the flag "endianness" is a little unobvious as to if it should be applied to a particular component. This series adds a comment to better explain the meaning of the flag and then tidys up the usage of the flag. A couple of uses of the flag are removed where is has been used inappropriately on the CPU side of the DAI link, this is clearly not valid in the cases it has been used, and I suspect never would be valid. Then some redundant formats are removed, since they would be covered by existing endianness flags. And finally a bunch of devices that are missing the flag have it added. It is worth noting that since componenisation there are now a couple of cases where it is not entire clear to me that the flag should be applied to all CODECs as it was before. In those cases I haven't updated the driver to add the flag and they are outlined here: 1) Build into the AP CODECs, these are actual silicon inside the main processor and they typically receive audio directly from an internal bus. It is not obvious to me that these can happily ignore endian. On the CODEC side these include: jz4725b.c, jz4760.c, jz4770.c, rk3328_codec.c, lpass-va-macro.c, lpass-rx-macro.c, lpass-tx-macro.c, lpass-wsa-macro.c. There are also some examples of this scattered around the various platform support directories in sound/soc. 2) Devices behind non-audio buses, SPI just moves bits and doesn't really define an endian for audio data on the bus. Thus it seems the CODEC probably can care about the endian. The only devices that fall into this group (mostly for AoV) are: rt5514-spi.c, rt5677-spi.c, cros_ec_codec.c (only the AoV). 3) CODECs with no DAIs, these could specify the flag and plenty of them do; CODECs from the initial conversion to componentisation. But the flag makes no difference here since there is nothing for it to apply to. This includes purely analogue CODECs: aw8738.c, ssm2305.c, tpa6130a2.c, tda7419.c, max9759.c, max9768.c, max9877.c, lm4857.c, simple-mux.c, simple-amplifier.c. And devices that only do jack detection: ts3a227e.c, mt6359-accdet.c. If there are any opinions on adding the flag to any of those three groups they would be greatfully received. But I am leaning towards leaving 1,2 without endianness flags since it feels inappropriate, and removing the endian flag from devices in catagory 3 that already have it. Assuming no one objects to that I will do a follow up series for that. commit 628bf55b620497a105f4963ee8fb84769f7e6bb4 Author: Robin Murphy Date: Tue May 10 09:38:58 2022 +0100 iommu/arm-smmu: Force identity domains for legacy binding When using the legacy "mmu-masters" DT binding, we reject DMA domains since we have no guarantee of driver probe order and thus can't rely on client drivers getting the correct DMA ops. However, we can do better than fall back to the old no-default-domain behaviour now, by forcing an identity default domain instead. This also means that detaching from a VFIO domain can actually work - that looks to have been broken for over 6 years, so clearly isn't something that legacy binding users care about, but we may as well make the driver code make sense anyway. Suggested-by: Jason Gunthorpe Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9805e4c492cb972bdcdd57999d2d001a2d8b5aab.1652171938.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit f7b6fc327327698924ef3afa0c3e87a5b7466af3 Author: Vincent Whitchurch Date: Fri Apr 29 17:21:18 2022 +0200 mmc: core: Support zeroout using TRIM for eMMC If an eMMC card supports TRIM and indicates that it erases to zeros, we can use it to support hardware offloading of REQ_OP_WRITE_ZEROES, so let's add support for this. Signed-off-by: Vincent Whitchurch Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20220429152118.3617303-1-vincent.whitchurch@axis.com Signed-off-by: Ulf Hansson commit ecd17a87eb78b5bd5ca6d1aa20c39f2bc3591337 Author: Colin Ian King Date: Sun May 8 22:45:00 2022 +0100 x25: remove redundant pointer dev Pointer dev is being assigned a value that is never used, the assignment and the variable are redundant and can be removed. Also replace null check with the preferred !ptr idiom. Cleans up clang scan warning: net/x25/x25_proc.c:94:26: warning: Although the value stored to 'dev' is used in the enclosing expression, the value is never actually read from 'dev' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220508214500.60446-1-colin.i.king@gmail.com Signed-off-by: Paolo Abeni commit 249838b7660ac04a67bfb017364a7f01029370a0 Author: Oliver Upton Date: Mon May 9 16:25:59 2022 +0000 KVM: arm64: pkvm: Don't mask already zeroed FEAT_SVE FEAT_SVE is already masked by the fixed configuration for ID_AA64PFR0_EL1; don't try and mask it at runtime. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220509162559.2387784-3-oupton@google.com commit 4d2e469e163ec79340b2f42c2a07838b5ff30686 Author: Oliver Upton Date: Mon May 9 16:25:58 2022 +0000 KVM: arm64: pkvm: Drop unnecessary FP/SIMD trap handler The pVM-specific FP/SIMD trap handler just calls straight into the generic trap handler. Avoid the indirection and just call the hyp handler directly. Note that the BUILD_BUG_ON() pattern is repeated in pvm_init_traps_aa64pfr0(), which is likely a better home for it. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220509162559.2387784-2-oupton@google.com commit a12af6f860b3537085d00dd9114b990d256efcae Merge: 827634531e344 fd3040b9394c5 Author: Paolo Abeni Date: Tue May 10 11:31:34 2022 +0200 Merge branch 'this-is-a-patch-series-for-ethernet-driver-of-sunplus-sp7021-soc' Wells Lu says: ==================== This is a patch series for Ethernet driver of Sunplus SP7021 SoC. Sunplus SP7021 is an ARM Cortex A7 (4 cores) based SoC. It integrates many peripherals (ex: UART, I2C, SPI, SDIO, eMMC, USB, SD card and etc.) into a single chip. It is designed for industrial control applications. Refer to: https://sunplus.atlassian.net/wiki/spaces/doc/overview https://tibbo.com/store/plus1.html ==================== Link: https://lore.kernel.org/r/1652004800-3212-1-git-send-email-wellslutw@gmail.com Signed-off-by: Paolo Abeni commit fd3040b9394c58bcedb83554bcf1a073021d6b36 Author: Wells Lu Date: Sun May 8 18:13:20 2022 +0800 net: ethernet: Add driver for Sunplus SP7021 Add driver for Sunplus SP7021 SoC. Reviewed-by: Andrew Lunn Signed-off-by: Wells Lu Signed-off-by: Paolo Abeni commit 0cfeca62b56abde16c6f12e30cdff46177c687e8 Author: Wells Lu Date: Sun May 8 18:13:19 2022 +0800 devicetree: bindings: net: Add bindings doc for Sunplus SP7021. Add bindings documentation for Sunplus SP7021 SoC. Reviewed-by: Rob Herring Signed-off-by: Wells Lu Signed-off-by: Paolo Abeni commit 85f5b3c437c927526ab2c4af962dceec08ae58c6 Author: Wan Jiabing Date: Tue May 10 17:05:31 2022 +0800 cpufreq: mediatek: Fix potential deadlock problem in mtk_cpufreq_set_target Fix following coccichek error: ./drivers/cpufreq/mediatek-cpufreq.c:199:2-8: preceding lock on line ./drivers/cpufreq/mediatek-cpufreq.c:208:2-8: preceding lock on line mutex_lock is acquired but not released before return. Use 'goto out' to help releasing the mutex_lock. Fixes: c210063b40ac ("cpufreq: mediatek: Add opp notification support") Signed-off-by: Wan Jiabing Reviewed-by: Rex-BC Chen Signed-off-by: Viresh Kumar commit 3d47083b9ff46863e8374ad3bb5edb5e464c75f8 Author: Ravi Bangoria Date: Fri Apr 29 10:44:41 2022 +0530 perf/amd/ibs: Use interrupt regs ip for stack unwinding IbsOpRip is recorded when IBS interrupt is triggered. But there is a skid from the time IBS interrupt gets triggered to the time the interrupt is presented to the core. Meanwhile processor would have moved ahead and thus IbsOpRip will be inconsistent with rsp and rbp recorded as part of the interrupt regs. This causes issues while unwinding stack using the ORC unwinder as it needs consistent rip, rsp and rbp. Fix this by using rip from interrupt regs instead of IbsOpRip for stack unwinding. Fixes: ee9f8fce99640 ("x86/unwind: Add the ORC unwinder") Reported-by: Dmitry Monakhov Suggested-by: Peter Zijlstra Signed-off-by: Ravi Bangoria Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220429051441.14251-1-ravi.bangoria@amd.com commit f8d9f46e87e51543f42851a090f72695e40f5724 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sat May 7 16:35:06 2022 +0900 MAINTAINERS: add myself as reviewer for slab Recently I was involved in slab subsystem (reviewing struct slab, SLUB debugfs and etc). I would like to help maintainers and people working on slab allocators by reviewing and testing their work. Let me be Cc'd on patches related to slab. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220507073506.241963-1-42.hyeyoo@gmail.com commit ae23f746d7442909a19bd43397b567145d6e5db3 Author: Matthew Gerlach Date: Thu May 5 06:06:17 2022 -0400 fpga: dfl: Allow Port to be linked to FME's DFL Currently we use PORTn_OFFSET to locate PORT DFLs, and PORT DFLs are not connected FME DFL. But for some cases (e.g. Intel Open FPGA Stack device), PORT DFLs are connected to FME DFL directly, so we don't need to search PORT DFLs via PORTn_OFFSET again. If BAR value of PORTn_OFFSET is 0x7 (FME_PORT_OFST_BAR_SKIP) then driver will skip searching the DFL for that port. If BAR value is invalid, return -EINVAL. Signed-off-by: Matthew Gerlach Signed-off-by: Tianfei Zhang Acked-by: Wu Hao Link: https://lore.kernel.org/r/20220505100617.703672-1-tianfei.zhang@intel.com Signed-off-by: Xu Yilun commit 2b28c9e0fe97fa2bae2ab52540a2970c0d3bdf8d Author: Tianfei zhang Date: Mon Apr 18 23:29:42 2022 -0400 Documentation: fpga: dfl: add link address of feature id table This patch adds the link address of feature id table in documentation. Signed-off-by: Tianfei zhang Reviewed-by: Matthew Gerlach Acked-by: Moritz Fischer Acked-by: Wu Hao Link: https://lore.kernel.org/r/20220419032942.427429-3-tianfei.zhang@intel.com Signed-off-by: Xu Yilun commit 88b3f3ff38d188e3c54603ea0244139cc55348fc Author: Tianfei zhang Date: Mon Apr 18 23:29:41 2022 -0400 fpga: dfl: check feature type before parse irq info Previously the feature IDs defined are unique, no matter which feature type. But currently we want to extend its usage to have a per-type feature ID space, so this patch adds feature type checking as well just before look into feature ID for different features which have irq info. Signed-off-by: Tianfei zhang Reviewed-by: Matthew Gerlach Acked-by: Wu Hao Acked-by: Moritz Fischer Link: https://lore.kernel.org/r/20220419032942.427429-2-tianfei.zhang@intel.com Signed-off-by: Xu Yilun commit 838a84382a9d78f306903e173bcaacd2e5178d9b Author: Nava kishore Manne Date: Sat Apr 23 22:32:35 2022 +0530 fpga: fpga-region: fix kernel-doc formatting issues To fix below kernel-doc warnings this patch does the following ->Replaced Return\Returns with 'Return:' keyword. ->Added 'Return' description For __init of_fpga_region_init()' API. ->Added description for 'child_regions_with_firmware()' API. warning: No description found for return value of 'of_fpga_region_find'. warning: No description found for return value of 'of_fpga_region_get_bridges'. warning: missing initial short description on line: * child_regions_with_firmware warning: No description found for return value of 'child_regions_with_firmware'. warning: No description found for return value of 'of_fpga_region_notify_pre_apply'. warning: No description found for return value of 'of_fpga_region_notify'. warning: No description found for return value of 'of_fpga_region_init'. Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20220423170235.2115479-6-nava.manne@xilinx.com Signed-off-by: Xu Yilun commit baf7d27d033c7cbbdd483ce0867b27e54b702ad5 Author: Nava kishore Manne Date: Sat Apr 23 22:32:34 2022 +0530 fpga: Use tab instead of space indentation In FPGA Makefile has both space and tab indentation, to make them align use tab instead of space indentation. Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20220423170235.2115479-5-nava.manne@xilinx.com Signed-off-by: Xu Yilun commit 3f3f9cb67f69a45d2fa52b919c1e6bc6416b9ec7 Author: Nava kishore Manne Date: Sat Apr 23 22:32:33 2022 +0530 fpga: fpga-mgr: fix kernel-doc warnings warnings: No description found for return value of 'xxx' In-order to fix the above kernel-doc warnings added the 'Return' description for 'devm_fpga_mgr_register_full()' and 'devm_fpga_mgr_register()' APIs. Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20220423170235.2115479-4-nava.manne@xilinx.com Signed-off-by: Xu Yilun commit 57ce2e406fe1fa005e8fdbf20936c791252ac7bc Author: Nava kishore Manne Date: Sat Apr 23 22:32:32 2022 +0530 fpga: fix for coding style issues fixes the below checks reported by checkpatch.pl: - Lines should not end with a '(' - Alignment should match open parenthesis Signed-off-by: Nava kishore Manne Link: https://lore.kernel.org/r/20220423170235.2115479-3-nava.manne@xilinx.com Signed-off-by: Xu Yilun commit 827634531e344850106c7ac618a3acb5ac40f6e6 Merge: b3552d6a3b8bd 0abb62b68252b Author: Paolo Abeni Date: Tue May 10 09:48:11 2022 +0200 Merge branch 'ptp-support-hardware-clocks-with-additional-free-running-cycle-counter' Gerhard Engleder says: ==================== ptp: Support hardware clocks with additional free running cycle counter ptp vclocks require a clock with free running time for the timecounter. Currently only a physical clock forced to free running is supported. If vclocks are used, then the physical clock cannot be synchronized anymore. The synchronized time is not available in hardware in this case. As a result, timed transmission with TAPRIO hardware support is not possible anymore. If hardware would support a free running time additionally to the physical clock, then the physical clock does not need to be forced to free running. Thus, the physical clocks can still be synchronized while vclocks are in use. The physical clock could be used to synchronize the time domain of the TSN network and trigger TAPRIO. In parallel vclocks can be used to synchronize other time domains. One year ago I thought for two time domains within a TSN network also two physical clocks are required. This would lead to new kernel interfaces for asking for the second clock, ... . But actually for a time triggered system like TSN there can be only one time domain that controls the system itself. All other time domains belong to other layers, but not to the time triggered system itself. So other time domains can be based on a free running counter if similar mechanisms like 2 step synchroisation are used. Synchronisation was tested with two time domains between two directly connected hosts. Each host run two ptp4l instances, the first used the physical clock and the second used the virtual clock. I used my FPGA based network controller as network device. ptp4l was used in combination with the virtual clock support patches from Miroslav Lichvar. v4: - if_index of 0 is invalid (Jonathan Lemon) - set if_index to 0 in the SOF_TIMESTAMPING_RAW_HARDWARE block (Jonathan Lemon) - add helper function for netdev_get_tstamp() call (Jonathan Lemon) - update SKBTX_ANY_TSTAMP (Paolo Abeni) - use separate bits for new tx_flags (Richard Cochran) v3: - optimize ptp_convert_timestamp (Richard Cochran) - call dev_get_by_napi_id() only if needed (Richard Cochran) - use non-negated logical test (Richard Cochran) - add comment for skipped output (Richard Cochran) - add comment for SKBTX_HW_TSTAMP_USE_CYCLES masking (Richard Cochran) v2: - rename ptp_clock cycles to has_cycles (Richard Cochran) - call it free running cycle counter (Richard Cochran) - update struct skb_shared_hwtstamps kdoc (Richard Cochran) - optimize timestamp address/cookie processing path (Richard Cochran, Vinicius Costa Gomes) v1: - complete rework based on suggestions (Richard Cochran) ==================== Link: https://lore.kernel.org/r/20220506200142.3329-1-gerhard@engleder-embedded.com Signed-off-by: Paolo Abeni commit 0abb62b68252b1beefd553dd80f5b4c0b456bcaf Author: Gerhard Engleder Date: Fri May 6 22:01:42 2022 +0200 tsnep: Add free running cycle counter support The TSN endpoint Ethernet MAC supports a free running counter additionally to its clock. This free running counter can be read and hardware timestamps are supported. As the name implies, this counter cannot be set and its frequency cannot be adjusted. Add free running cycle counter support based on this free running counter to physical clock. This also requires hardware time stamps based on that free running counter. Signed-off-by: Gerhard Engleder Acked-by: Jonathan Lemon Signed-off-by: Paolo Abeni commit fcf308e50928a9c9eca90c56f9fc6885005dafd1 Author: Gerhard Engleder Date: Fri May 6 22:01:41 2022 +0200 ptp: Speed up vclock lookup ptp_convert_timestamp() is called in the RX path of network messages. The current implementation takes ~5000ns on 1.2GHz A53. This is too much for the hot path of packet processing. Introduce hash table for fast vclock lookup in ptp_convert_timestamp(). The execution time of ptp_convert_timestamp() is reduced to ~700ns on 1.2GHz A53. Signed-off-by: Gerhard Engleder Acked-by: Richard Cochran Signed-off-by: Paolo Abeni commit 97dc7cd92ac67f6e05df418df1772ba4a7fbf693 Author: Gerhard Engleder Date: Fri May 6 22:01:40 2022 +0200 ptp: Support late timestamp determination If a physical clock supports a free running cycle counter, then timestamps shall be based on this time too. For TX it is known in advance before the transmission if a timestamp based on the free running cycle counter is needed. For RX it is impossible to know which timestamp is needed before the packet is received and assigned to a socket. Support late timestamp determination by a network device. Therefore, an address/cookie is stored within the new netdev_data field of struct skb_shared_hwtstamps. This address/cookie is provided to a new network device function called ndo_get_tstamp(), which returns a timestamp based on the normal/adjustable time or based on the free running cycle counter. If function is not supported, then timestamp handling is not changed. This mechanism is intended for RX, but TX use is also possible. Signed-off-by: Gerhard Engleder Acked-by: Jonathan Lemon Acked-by: Richard Cochran Signed-off-by: Paolo Abeni commit d58809d854c9ee19e4cd41023e137e65e9dc3f94 Author: Gerhard Engleder Date: Fri May 6 22:01:39 2022 +0200 ptp: Pass hwtstamp to ptp_convert_timestamp() ptp_convert_timestamp() converts only the timestamp hwtstamp, which is a field of the argument with the type struct skb_shared_hwtstamps *. So a pointer to the hwtstamp field of this structure is sufficient. Rework ptp_convert_timestamp() to use an argument of type ktime_t *. This allows to add additional timestamp manipulation stages before the call of ptp_convert_timestamp(). Signed-off-by: Gerhard Engleder Acked-by: Richard Cochran Signed-off-by: Paolo Abeni commit 51eb7492af276b5b4d27cfa4474d40bdac7b9cf8 Author: Gerhard Engleder Date: Fri May 6 22:01:38 2022 +0200 ptp: Request cycles for TX timestamp The free running cycle counter of physical clocks called cycles shall be used for hardware timestamps to enable synchronisation. Introduce new flag SKBTX_HW_TSTAMP_USE_CYCLES, which signals driver to provide a TX timestamp based on cycles if cycles are supported. Signed-off-by: Gerhard Engleder Acked-by: Richard Cochran Signed-off-by: Paolo Abeni commit 42704b26b0f1d891f6cf4ebc877dbac0d17c690d Author: Gerhard Engleder Date: Fri May 6 22:01:37 2022 +0200 ptp: Add cycles support for virtual clocks ptp vclocks require a free running time for their timecounter. Currently only a physical clock forced to free running is supported. If vclocks are used, then the physical clock cannot be synchronized anymore. The synchronized time is not available in hardware in this case. As a result, timed transmission with TAPRIO hardware support is not possible anymore. If hardware would support a free running time additionally to the physical clock, then the physical clock does not need to be forced to free running. Thus, the physical clocks can still be synchronized while vclocks are in use. The physical clock could be used to synchronize the time domain of the TSN network and trigger TAPRIO. In parallel vclocks can be used to synchronize other time domains. Introduce support for a free running cycle counter called cycles to physical clocks. Rework ptp vclocks to use this free running cycle counter. Default implementation is based on time of physical clock. Thus, behavior of ptp vclocks based on physical clocks without free running cycle counter is identical to previous behavior. Signed-off-by: Gerhard Engleder Acked-by: Richard Cochran Signed-off-by: Paolo Abeni commit b3552d6a3b8bd4260a971f1f70140ed3513cc4f7 Author: Jakub Kicinski Date: Fri May 6 13:00:29 2022 -0700 eth: dpaa2-mac: remove a dead-code NULL check on fwnode parent Since commit 4e30e98c4b4c ("dpaa2-mac: return -EPROBE_DEFER from dpaa2_mac_open in case the fwnode is not set") @parent can't be NULL after the if. It's either the address of the ->fwnode of @dpmacs or @fwnode in case of ACPI. Signed-off-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220506200029.852310-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 7f46a0b7327ae261f9981888708dbca22c283900 Author: Mark Bloch Date: Tue Mar 15 16:56:50 2022 +0000 net/mlx5: Lag, add debugfs to query hardware lag state Lag state has become very complicated with many modes, flags, types and port selections methods and future work will add additional features. Add a debugfs to query the current lag state. A new directory named "lag" will be created under the mlx5 debugfs directory. As the driver has debugfs per pci function the location will be: /mlx5//lag For example: /sys/kernel/debug/mlx5/0000:08:00.0/lag The following files are exposed: - state: Returns "active" or "disabled". If "active" it means hardware lag is active. - members: Returns the BDFs of all the members of lag object. - type: Returns the type of the lag currently configured. Valid only if hardware lag is active. * "roce" - Members are bare metal PFs. * "switchdev" - Members are in switchdev mode. * "multipath" - ECMP offloads. - port_sel_mode: Returns the egress port selection method, valid only if hardware lag is active. * "queue_affinity" - Egress port is selected by the QP/SQ affinity. * "hash" - Egress port is selected by hash done on each packet. Controlled by: xmit_hash_policy of the bond device. - flags: Returns flags that are specific per lag @type. Valid only if hardware lag is active. * "shared_fdb" - "on" or "off", if "on" single FDB is used. - mapping: Returns the mapping which is used to select egress port. Valid only if hardware lag is active. If @port_sel_mode is "hash" returns the active egress ports. The hash result will select only active ports. if @port_sel_mode is "queue_affinity" returns the mapping between the configured port affinity of the QP/SQ and actual egress port. For example: * 1:1 - Mapping means if the configured affinity is port 1 traffic will egress via port 1. * 1:2 - Mapping means if the configured affinity is port 1 traffic will egress via port 2. This can happen if port 1 is down or in active/backup mode and port 1 is backup. Signed-off-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 352899f384d4aefa77ede6310d08c1b515612a8f Author: Mark Bloch Date: Wed Mar 2 15:38:50 2022 +0000 net/mlx5: Lag, use buckets in hash mode When in hardware lag and the NIC has more than 2 ports when one port goes down need to distribute the traffic between the remaining active ports. For better spread in such cases instead of using 1-to-1 mapping and only 4 slots in the hash, use many. Each port will have many slots that point to it. When a port goes down go over all the slots that pointed to that port and spread them between the remaining active ports. Once the port comes back restore the default mapping. We will have number_of_ports * MLX5_LAG_MAX_HASH_BUCKETS slots. Each MLX5_LAG_MAX_HASH_BUCKETS belong to a different port. The native mapping is such that: port 1: The first MLX5_LAG_MAX_HASH_BUCKETS slots are: [1, 1, .., 1] which means if a packet is hased into one of this slots it will hit the wire via port 1. port 2: The second MLX5_LAG_MAX_HASH_BUCKETS slots are: [2, 2, .., 2] which means if a packet is hased into one of this slots it will hit the wire via port2. and this mapping is the same of the rest of the ports. On a failover, lets say port 2 goes down (port 1, 3, 4 are still up). the new mapping for port 2 will be: port 2: The second MLX5_LAG_MAX_HASH_BUCKETS are: [1, 3, 1, 4, .., 4] which means the mapping was changed from the native mapping to a mapping that consists of only the active ports. With this if a port goes down the traffic will be split between the active ports randomly Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 24b3599effe2b1eda7bc7e8b2b5e8fe459256222 Author: Mark Bloch Date: Wed Mar 2 09:12:01 2022 +0000 net/mlx5: Lag, refactor dmesg print Combine dmesg lag prints into a single function. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 4cd14d44b11dabf195d1e66dadbb954336224658 Author: Mark Bloch Date: Tue Mar 1 17:34:58 2022 +0000 net/mlx5: Support devices with more than 2 ports Increase the define MLX5_MAX_PORTS to 4 as the driver is ready to support NICs with 4 ports. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 7e978e7714d6b0ba40ee60cb23852ed888658768 Author: Mark Bloch Date: Tue Mar 1 17:20:35 2022 +0000 net/mlx5: Lag, use actual number of lag ports Refactor the entire lag code to use ldev->ports instead of hard-coded defines (like MLX5_MAX_PORTS) for its operations. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit cdf611d17094aea113d7acc32040a1b362dfe2c4 Author: Mark Bloch Date: Tue Mar 1 17:34:31 2022 +0000 net/mlx5: Lag, use hash when in roce lag on 4 ports Downstream patches will add support for lag over 4 ports. In that mode we will only use hash as the uplink selection method. Using hash instead of queue affinity (before this patch) offers key advantages like: - Align ports selection method with the method used by the bond device - Better packets distribution where a single queue can transmit from multiple ports (with queue affinity a queue is bound to a single port regardless of the packet being sent). - In case of failover we traffic is split between multiple ports and not a single one like in queue affinity. Going forward it was decided that queue affinity will be deprecated as using hash provides a better user experience which means on 4 ports HCAs hash will always be used. Future work will add hash support for 2 ports HCAs as well. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit e2c45931ff124381e6389c5e226a9527ff8c9969 Author: Mark Bloch Date: Tue Mar 1 17:24:40 2022 +0000 net/mlx5: Lag, support single FDB only on 2 ports E-Switch currently doesn't support more than 2 E-Switch managers being aggregated under a single hardware lag. Have specific checks to disallow creating lag when the code doesn't support it. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit e9d5bb51c592d0275b00a52ce3d8fe8457501ce6 Author: Mark Bloch Date: Sun Feb 27 13:45:59 2022 +0000 net/mlx5: Lag, store number of ports inside lag object Store the number of lag ports inside the lag object. Lag object is a single shared object managing the lag state of multiple mlx5 devices on the same physical HCA. Downstream patches will allow hardware lag to be created over devices with more than 2 ports. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit bc4c2f2e017949646b43fdcad005a03462d437c6 Author: Mark Bloch Date: Sun Feb 27 12:40:39 2022 +0000 net/mlx5: Lag, filter non compatible devices When search for a peer lag device we can filter based on that device's capabilities. Downstream patch will be less strict when filtering compatible devices and remove the limitation where we require exact MLX5_MAX_PORTS and change it to a range. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit ec2fa47d7b984ce7b736f3e74072757c146278cd Author: Mark Bloch Date: Wed Dec 15 06:51:18 2021 +0000 net/mlx5: Lag, use lag lock Use a lag specific lock instead of depending on external locks to synchronise the lag creation/destruction. With this, taking E-Switch mode lock is no longer needed for syncing lag logic. Cleanup any dead code that is left over and don't export functions that aren't used outside the E-Switch core code. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 4202ea95a6b64f6d773af9f901c74197a6431fa8 Author: Mark Bloch Date: Tue Mar 1 16:45:41 2022 +0000 net/mlx5: Lag, move E-Switch prerequisite check into lag code There is no need to expose E-Switch function for something that can be checked with already present API inside lag code. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 8a6e75e5f57e9ac82268d9bfca3403598d9d0292 Author: Mark Bloch Date: Sun Feb 27 12:23:34 2022 +0000 net/mlx5: devcom only supports 2 ports Devcom API is intended to be used between 2 devices only add this implied assumption into the code and check when it's no true. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 34a30d7635a8e37275a7b63bec09035ed762969b Author: Mark Bloch Date: Tue Mar 1 15:42:01 2022 +0000 net/mlx5: Lag, expose number of lag ports Downstream patches will add support for hardware lag with more than 2 ports. Add a way for users to query the number of lag ports. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 37ca95e62ee23fa6d2c2c64e3dc40b4a0c0146dc Author: Gavin Li Date: Sun Mar 27 17:36:44 2022 +0300 net/mlx5: Increase FW pre-init timeout for health recovery Currently, health recovery will reload driver to recover it from fatal errors. During the driver's load process, it would wait for FW to set the pre-init bit for up to 120 seconds, beyond this threshold it would abort the load process. In some cases, such as a FW upgrade on the DPU, this timeout period is insufficient, and the user has no way to recover the host device. To solve this issue, introduce a new FW pre-init timeout for health recovery, which is set to 2 hours. The timeout for devlink reload and probe will use the original one because they are user triggered flows, and therefore should not have a significantly long timeout, during which the user command would hang. Signed-off-by: Gavin Li Reviewed-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 8324a02c342a36336114a497130826612ed5520d Author: Gavin Li Date: Sun Mar 27 17:45:32 2022 +0300 net/mlx5: Add exit route when waiting for FW Currently, removing a device needs to get the driver interface lock before doing any cleanup. If the driver is waiting in a loop for FW init, there is no way to cancel the wait, instead the device cleanup waits for the loop to conclude and release the lock. To allow immediate response to remove device commands, check the TEARDOWN flag while waiting for FW init, and exit the loop if it has been set. Signed-off-by: Gavin Li Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 13b9b814da2de5006795ddcff2bbaea46017429d Author: Slark Xiao Date: Tue May 3 10:43:49 2022 +0800 bus: mhi: host: Add support for Foxconn T99W373 and T99W368 Product's enumeration align with previous Foxconn SDX55, so T99W373(SDX62)/T99W368(SDX65) would use the same config as Foxconn SDX55. Remove fw and edl for this new commit. Signed-off-by: Slark Xiao Reviewed-by: Manivannan Sadhasivam Reviewed-by: Loic Poulain Link: https://lore.kernel.org/r/20220503024349.4486-1-slark_xiao@163.com Signed-off-by: Manivannan Sadhasivam commit 77fc41204734042861210b9d05338c9b8360affb Author: Daniele Palmas Date: Mon May 2 13:20:36 2022 +0200 bus: mhi: host: pci_generic: add Telit FN990 Add Telit FN990: 01:00.0 Unassigned class [ff00]: Qualcomm Device 0308 Subsystem: Device 1c5d:2010 Signed-off-by: Daniele Palmas Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220502112036.443618-1-dnlplm@gmail.com [mani: Added "host" to the subject] Signed-off-by: Manivannan Sadhasivam commit a96ef8b504efb2ad445dfb6d54f9488c3ddf23d2 Author: Daniele Palmas Date: Wed Apr 27 09:26:48 2022 +0200 bus: mhi: host: pci_generic: add Telit FN980 v1 hardware revision Add Telit FN980 v1 hardware revision: 01:00.0 Unassigned class [ff00]: Qualcomm Device [17cb:0306] Subsystem: Device [1c5d:2000] Signed-off-by: Daniele Palmas Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220427072648.17635-1-dnlplm@gmail.com [mani: Added "host" to the subject] Signed-off-by: Manivannan Sadhasivam commit 158a66b245739e15858de42c0ba60fcf3de9b8e6 Author: Marios Makassikis Date: Wed May 4 15:40:10 2022 +0200 ksmbd: validate length in smb2_write() The SMB2 Write packet contains data that is to be written to a file or to a pipe. Depending on the client, there may be padding between the header and the data field. Currently, the length is validated only in the case padding is present. Since the DataOffset field always points to the beginning of the data, there is no need to have a special case for padding. By removing this, the length is validated in both cases. Signed-off-by: Marios Makassikis Acked-by: Namjae Jeon Signed-off-by: Steve French commit d21a580dafc69aa04f46e6099616146a536b0724 Author: Xin Xiong Date: Fri Apr 29 16:11:22 2022 +0800 ksmbd: fix reference count leak in smb_check_perm_dacl() The issue happens in a specific path in smb_check_perm_dacl(). When "id" and "uid" have the same value, the function simply jumps out of the loop without decrementing the reference count of the object "posix_acls", which is increased by get_acl() earlier. This may result in memory leaks. Fix it by decreasing the reference count of "posix_acls" before jumping to label "check_access_bits". Fixes: 777cad1604d6 ("ksmbd: remove select FS_POSIX_ACL in Kconfig") Signed-off-by: Xin Xiong Signed-off-by: Xin Tan Acked-by: Namjae Jeon Signed-off-by: Steve French commit e4d1293cb19b4a84db74614a8ae94351a619d78a Author: Masahiro Yamada Date: Sat May 7 14:22:43 2022 +0900 crypto: vmx - Fix build error When I refactored this Makefile, I accidentally changed the CONFIG option. Fixes: b52455a73db9 ("crypto: vmx - Align the short log with Makefile cleanups") Reported-by: kernel test robot Signed-off-by: Masahiro Yamada Signed-off-by: Herbert Xu commit 8560cb1a7d75048af275dd23fb0cf05382b3c2b9 Author: Matthew Wilcox (Oracle) Date: Thu May 5 00:43:09 2022 -0400 fs: Remove aops->freepage All implementations now use free_folio so we can delete the callers and the method. Signed-off-by: Matthew Wilcox (Oracle) commit 6612ed24a242734560f9643ccb08f2f40b6e144b Author: Matthew Wilcox (Oracle) Date: Mon May 2 01:47:42 2022 -0400 secretmem: Convert to free_folio Prepare for any size of folio, even though secretmem only uses order-0 folios for now. Signed-off-by: Matthew Wilcox (Oracle) commit aa5dc8c46189779555e491d5a5ae1cc717ead774 Author: Matthew Wilcox (Oracle) Date: Sun May 1 08:00:56 2022 -0400 nfs: Convert to free_folio Add a wrapper that converts back from the folio to the page. This entire file needs to be converted to use folios, but that's a task for a different set of patches. Signed-off-by: Matthew Wilcox (Oracle) commit c78ac80e98ad5065b3ff32680236494b7527e509 Author: Matthew Wilcox (Oracle) Date: Sun May 1 07:39:06 2022 -0400 orangefs: Convert to free_folio I suspect this isn't actually needed and that releasepage will have done the job, but convert it for now and we can delete it later. Signed-off-by: Matthew Wilcox (Oracle) commit d2329aa0c78f4a8dd368bb706f196ab99f692eaa Author: Matthew Wilcox (Oracle) Date: Sun May 1 07:35:31 2022 -0400 fs: Add free_folio address space operation Include documentation and convert the callers to use ->free_folio as well as ->freepage. Signed-off-by: Matthew Wilcox (Oracle) commit 6439476311a649594124c4cf42f8389661f04e4f Author: Matthew Wilcox (Oracle) Date: Sun May 1 06:39:50 2022 -0400 fs: Convert drop_buffers() to use a folio All callers now have a folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 68189fef88c7d02eb92e038be3d6428ebd0d2945 Author: Matthew Wilcox (Oracle) Date: Sun May 1 01:08:08 2022 -0400 fs: Change try_to_free_buffers() to take a folio All but two of the callers already have a folio; pass a folio into try_to_free_buffers(). This removes the last user of cancel_dirty_page() so remove that wrapper function too. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 731222557a69003bb27280b0750183803fa79770 Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:52:35 2022 -0400 jbd2: Convert release_buffer_page() to use a folio Saves a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o Reviewed-by: Jeff Layton commit c56a6eb03deb187c989a966fda5a254249b56c2a Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:46:03 2022 -0400 jbd2: Convert jbd2_journal_try_to_free_buffers to take a folio Also convert it to return a bool since it's called from release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o Reviewed-by: Jeff Layton commit be6b969c9b2fc5365c988634ffafd186146aee93 Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:35:39 2022 -0400 reiserfs: Convert release_buffer_page() to use a folio Saves 671 bytes from an allmodconfig build (!) Function old new delta release_buffer_page 1617 946 -671 Total: Before=67656, After=66985, chg -0.99% Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 704ead2bed202579f025a4754e52e9ab21ff3ada Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:27:53 2022 -0400 fs: Remove last vestiges of releasepage All users are now converted to release_folio Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit bcaabc55491203f90eb8b8807e9948028ea53bd7 Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:10:21 2022 -0400 ubifs: Convert to release_folio Use folios throughout the release_folio path. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit dc2e58b24abf9d949864138be440042602a854ae Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:10:21 2022 -0400 reiserfs: Convert to release_folio Use folios throughout the release_folio path. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 4993474a21b4a041d78be8623b92d94d7c114008 Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:10:21 2022 -0400 orangefs: Convert to release_folio Use folios throughout the release_folio path. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit eca66389744df54ee98f02a232774e47be75f16a Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:10:21 2022 -0400 ocfs2: Convert to release_folio Use folios throughout the release_folio path. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 31c0b4afb9241bd603ee17728decd83be4075e27 Author: Matthew Wilcox (Oracle) Date: Sun May 1 00:08:58 2022 -0400 nilfs2: Remove comment about releasepage If we need a release_folio, we can add it back. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 3577da4aa895847da74890903a3ae7e67ba1ee2f Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:53:28 2022 -0400 nfs: Convert to release_folio Use folios throughout the release_folio paths. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit a613b861aabebb13ec08b5791075fe38ad361ba0 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:53:28 2022 -0400 jfs: Convert to release_folio The use of folios should be pushed further down into jfs from here. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 7ffce3d94110065792fdd1ee807c4fae18d2c2c3 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:53:28 2022 -0400 hfsplus: Convert to release_folio Use a folio throughout hfsplus_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 5784f09bf4dfdc76d8d68437efd01c6a0646a08e Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:53:28 2022 -0400 hfs: Convert to release_folio Use a folio throughout hfs_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit e45c20d110414730db224d78db4cfb44495c0d8a Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:49:17 2022 -0400 gfs2: Convert to release_folio Use a folio throughout gfs2_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Bob Peterson Reviewed-by: Jeff Layton commit c26cd04586309e85fe9b15c7c3c9cb83ec5ec70b Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:41:46 2022 -0400 f2fs: Convert to release_folio While converting f2fs_release_page() to f2fs_release_folio(), cache the sb_info so we don't need to retrieve it twice, and remove the redundant call to set_page_private(). The use of folios should be pushed further into f2fs from here. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 3c402f1543cc0136eecd6c5d6a8aef22d7ad723b Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:33:38 2022 -0400 ext4: Convert to release_folio The use of folios should be pushed deeper into ext4 from here. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o Reviewed-by: Jeff Layton commit 8c5de05e41d4850db271f35fe25f8dd43e4beaeb Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:29:26 2022 -0400 erofs: Convert to release_folio Use a folio in erofs_managed_cache_release_folio(), but use of folios should be pushed into erofs_try_to_free_cached_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit eef15ea146f82a06487c4b1d6a545a97b0401cd3 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:26:14 2022 -0400 cifs: Convert to release_folio Use a folio throughout cifs_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 5e4146558c96f4935b803f2c4243f3c3f29c4476 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:21:43 2022 -0400 ceph: Convert to release_folio Use a folio throughout ceph_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit f913cff3505adb8c1e9e631535a847ac089e24c4 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:15:16 2022 -0400 btrfs: Convert to release_folio I've only converted the outer layers of the btrfs release_folio paths to use folios; the use of folios should be pushed further down into btrfs from here. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 508cae6843fecc7bdf05ded340384ab70cd515e2 Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:05:09 2022 -0400 afs: Convert to release_folio A straightforward conversion as they already work in terms of folios. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit a26d3411bbdd5124d6c63272f279a509e903553b Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:05:09 2022 -0400 9p: Convert to release_folio A straightforward conversion as it already works in terms of folios. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 8597447dc565a6a3fa7bc503674452b7ae2b914c Author: Matthew Wilcox (Oracle) Date: Sat Apr 30 23:01:08 2022 -0400 iomap: Convert to release_folio Change all the filesystems which used iomap_releasepage to use the new function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit fa29000b6b2603ec2bfdc4c73249fcb00cd54f85 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 17:00:05 2022 -0400 fs: Add aops->release_folio This replaces aops->releasepage. Update the documentation, and call it if it exists. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jeff Layton commit 5d3b6ede2c6c80304944cdb5bc653957390afcf4 Author: Nobuhiro Iwamatsu Date: Thu Apr 21 16:38:05 2022 +0900 arm64: dts: visconti: Update the clock providers for PCIe host controller Remove fixed clock and source common clock for PCIe host controller. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-7-nobuhiro1.iwamatsu@toshiba.co.jp/ commit c8a93f913109e575f3b9ddc330f210aa3d3cf2e1 Author: Nobuhiro Iwamatsu Date: Fri Apr 22 23:12:54 2022 +0900 arm64: dts: visconti: Update the clock providers for ethernet device Remove fixed clock and source common clock for ethernet device. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-6-nobuhiro1.iwamatsu@toshiba.co.jp/ commit 340657b179165410ec6ca30db6e6d7fc5c366ca1 Author: Nobuhiro Iwamatsu Date: Fri Apr 22 11:39:44 2022 +0900 arm64: dts: visconti: Update the clock providers for SPI Remove fixed clock and source common clock for SPI. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-5-nobuhiro1.iwamatsu@toshiba.co.jp/ commit 27b754902dab93d1c3bde94e97983ca0fe81f253 Author: Nobuhiro Iwamatsu Date: Thu Apr 21 16:38:05 2022 +0900 arm64: dts: visconti: Update the clock providers for watchdog timer Remove fixed clock and source common clock for watchdog timer. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-4-nobuhiro1.iwamatsu@toshiba.co.jp/ commit 0e7cd4395be5f433b70bde8d902ed50484ee1bc1 Author: Nobuhiro Iwamatsu Date: Thu Apr 21 16:38:05 2022 +0900 arm64: dts: visconti: Update the clock providers for I2C Replace I2C clock with common clock framework. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-3-nobuhiro1.iwamatsu@toshiba.co.jp/ commit 4374055674eaf52c185c24fcbeb6cf7d6359bfc4 Author: Nobuhiro Iwamatsu Date: Thu Apr 21 16:38:05 2022 +0900 arm64: dts: visconti: Update the clock providers for UART Remove fixed clock and source common clock for UART. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220510015229.139818-2-nobuhiro1.iwamatsu@toshiba.co.jp/ commit 34f7c6e7d4396090692a09789db231e12cb4762b Author: Nobuhiro Iwamatsu Date: Tue Apr 20 14:38:27 2021 +0900 arm64: dts: visconti: Add clock controller support for TMPV7708 Adds node of clock controller support for Toshiba Visconti TMPV7708. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20220421080143.2135566-1-nobuhiro1.iwamatsu@toshiba.co.jp/ commit d60c4d01a98bc1942dba6e3adc02031f5519f94b Author: Waiman Long Date: Mon May 9 18:29:21 2022 -0700 ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() When running the stress-ng clone benchmark with multiple testing threads, it was found that there were significant spinlock contention in sget_fc(). The contended spinlock was the sb_lock. It is under heavy contention because the following code in the critcal section of sget_fc(): hlist_for_each_entry(old, &fc->fs_type->fs_supers, s_instances) { if (test(old, fc)) goto share_extant_sb; } After testing with added instrumentation code, it was found that the benchmark could generate thousands of ipc namespaces with the corresponding number of entries in the mqueue's fs_supers list where the namespaces are the key for the search. This leads to excessive time in scanning the list for a match. Looking back at the mqueue calling sequence leading to sget_fc(): mq_init_ns() => mq_create_mount() => fc_mount() => vfs_get_tree() => mqueue_get_tree() => get_tree_keyed() => vfs_get_super() => sget_fc() Currently, mq_init_ns() is the only mqueue function that will indirectly call mqueue_get_tree() with a newly allocated ipc namespace as the key for searching. As a result, there will never be a match with the exising ipc namespaces stored in the mqueue's fs_supers list. So using get_tree_keyed() to do an existing ipc namespace search is just a waste of time. Instead, we could use get_tree_nodev() to eliminate the useless search. By doing so, we can greatly reduce the sb_lock hold time and avoid the spinlock contention problem in case a large number of ipc namespaces are present. Of course, if the code is modified in the future to allow mqueue_get_tree() to be called with an existing ipc namespace instead of a new one, we will have to use get_tree_keyed() in this case. The following stress-ng clone benchmark command was run on a 2-socket 48-core Intel system: ./stress-ng --clone 32 --verbose --oomable --metrics-brief -t 20 The "bogo ops/s" increased from 5948.45 before patch to 9137.06 after patch. This is an increase of 54% in performance. Link: https://lkml.kernel.org/r/20220121172315.19652-1-longman@redhat.com Fixes: 935c6912b198 ("ipc: Convert mqueue fs to fs_context") Signed-off-by: Waiman Long Cc: Al Viro Cc: David Howells Cc: Manfred Spraul Cc: Davidlohr Bueso Signed-off-by: Andrew Morton commit 49c9dd0df65d547a58642d2f717eeb560e1db140 Author: Prakash Sangappa Date: Mon May 9 18:29:20 2022 -0700 ipc: update semtimedop() to use hrtimer semtimedop() should be converted to use hrtimer like it has been done for most of the system calls with timeouts. This system call already takes a struct timespec as an argument and can therefore provide finer granularity timed wait. Link: https://lkml.kernel.org/r/1651187881-2858-1-git-send-email-prakash.sangappa@oracle.com Signed-off-by: Prakash Sangappa Reviewed-by: Thomas Gleixner Reviewed-by: Davidlohr Bueso Reviewed-by: Manfred Spraul Signed-off-by: Andrew Morton commit 0e900029655327bb5326ced02eff97667a079039 Author: Michal Orzel Date: Mon May 9 18:29:20 2022 -0700 ipc/sem: remove redundant assignments Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20220409101933.207157-1-michalorzel.eng@gmail.com Signed-off-by: Michal Orzel Reviewed-by: Tom Rix Reviewed-by: Nathan Chancellor Cc: Nick Desaulniers Signed-off-by: Andrew Morton commit 800c24dc34b93d2014f3952683f8d5e9309e1b73 Author: David Disseldorp Date: Mon May 9 18:29:20 2022 -0700 initramfs: support cpio extraction with file checksums Add support for extraction of checksum-enabled "070702" cpio archives, specified in Documentation/driver-api/early-userspace/buffer-format.rst. Fail extraction if the calculated file data checksum doesn't match the value carried in the header. Link: https://lkml.kernel.org/r/20220404093429.27570-7-ddiss@suse.de Signed-off-by: David Disseldorp Suggested-by: Matthew Wilcox (Oracle) Cc: Al Viro Cc: Christian Brauner Cc: Martin Wilck Signed-off-by: Andrew Morton commit ea8048719a0c46d95e6ab925bf0924e7198d9971 Author: David Disseldorp Date: Mon May 9 18:29:20 2022 -0700 gen_init_cpio: support file checksum archiving Documentation/driver-api/early-userspace/buffer-format.rst includes the specification for checksum-enabled cpio archives. Implement support for this format in gen_init_cpio via a new '-c' parameter. Link: https://lkml.kernel.org/r/20220404093429.27570-6-ddiss@suse.de Signed-off-by: David Disseldorp Suggested-by: Matthew Wilcox (Oracle) Cc: Al Viro Cc: Christian Brauner Cc: Martin Wilck Signed-off-by: Andrew Morton commit 3a2699cfbe317f6e1b9c84d2f10ab7debb1c79dc Author: David Disseldorp Date: Mon May 9 18:29:20 2022 -0700 gen_init_cpio: fix short read file handling When processing a "file" entry, gen_init_cpio attempts to allocate a buffer large enough to stage the entire contents of the source file. It then attempts to fill the buffer via a single read() call and subsequently writes out the entire buffer length, without checking that read() returned the full length, potentially writing uninitialized buffer memory. Fix this by breaking up file I/O into 64k chunks and only writing the length returned by the prior read() call. Link: https://lkml.kernel.org/r/20220404093429.27570-5-ddiss@suse.de Signed-off-by: David Disseldorp Reviewed-by: Martin Wilck Cc: Al Viro Cc: Christian Brauner Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 1274aea127b2e8c9a4b9cbcc3ea6baf78990a958 Author: David Disseldorp Date: Mon May 9 18:29:19 2022 -0700 initramfs: add INITRAMFS_PRESERVE_MTIME Kconfig option initramfs cpio mtime preservation, as implemented in commit 889d51a10712 ("initramfs: add option to preserve mtime from initramfs cpio images"), uses a linked list to defer directory mtime processing until after all other items in the cpio archive have been processed. This is done to ensure that parent directory mtimes aren't overwritten via subsequent child creation. The lkml link below indicates that the mtime retention use case was for embedded devices with applications running exclusively out of initramfs, where the 32-bit mtime value provided a rough file version identifier. Linux distributions which discard an extracted initramfs immediately after the root filesystem has been mounted may want to avoid the unnecessary overhead. This change adds a new INITRAMFS_PRESERVE_MTIME Kconfig option, which can be used to disable on-by-default mtime retention and in turn speed up initramfs extraction, particularly for cpio archives with large directory counts. Benchmarks with a one million directory cpio archive extracted 20 times demonstrated: mean extraction time (s) std dev INITRAMFS_PRESERVE_MTIME=y 3.808 0.006 INITRAMFS_PRESERVE_MTIME unset 3.056 0.004 The above extraction times were measured using ftrace (initcall_finish - initcall_start) values for populate_rootfs() with initramfs_async disabled. [ddiss@suse.de: rebase atop dir_entry.name flexible array member and drop separate initramfs_mtime.h header] Link: https://lkml.org/lkml/2008/9/3/424 Link: https://lkml.kernel.org/r/20220404093429.27570-4-ddiss@suse.de Signed-off-by: David Disseldorp Reviewed-by: Martin Wilck Cc: Al Viro Cc: Christian Brauner Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit fcb7aedd2e90c4ad43f7f01827014df8c6f034a5 Author: David Disseldorp Date: Mon May 9 18:29:19 2022 -0700 initramfs: make dir_entry.name a flexible array member dir_entry.name is currently allocated via a separate kstrdup(). Change it to a flexible array member and allocate it along with struct dir_entry. Link: https://lkml.kernel.org/r/20220404093429.27570-3-ddiss@suse.de Signed-off-by: David Disseldorp Acked-by: Christian Brauner Cc: Al Viro Cc: Martin Wilck Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit da028e4c4b0279eb49f80220d8f7cc62b4a57ccb Author: David Disseldorp Date: Mon May 9 18:29:19 2022 -0700 initramfs: refactor do_header() cpio magic checks Patch series "initramfs: "crc" cpio format and INITRAMFS_PRESERVE_MTIME", v7. This patchset does some minor initramfs refactoring and allows cpio entry mtime preservation to be disabled via a new Kconfig INITRAMFS_PRESERVE_MTIME option. Patches 4/6 to 6/6 implement support for creation and extraction of "crc" cpio archives, which carry file data checksums. Basic tests for this functionality can be found at https://github.com/rapido-linux/rapido/pull/163 This patch (of 6): do_header() is called for each cpio entry and fails if the first six bytes don't match "newc" magic. The magic check includes a special case error message if POSIX.1 ASCII (cpio -H odc) magic is detected. This special case POSIX.1 check can be nested under the "newc" mismatch code path to avoid calling memcmp() twice in a non-error case. Link: https://lkml.kernel.org/r/20220404093429.27570-1-ddiss@suse.de Link: https://lkml.kernel.org/r/20220404093429.27570-2-ddiss@suse.de Signed-off-by: David Disseldorp Reviewed-by: Martin Wilck Acked-by: Christian Brauner Cc: Al Viro Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 7055197705709c59b8ab77e6a5c7d46d61edd96e Author: Alexey Dobriyan Date: Mon May 9 18:29:19 2022 -0700 proc: fix dentry/inode overinstantiating under /proc/${pid}/net When a process exits, /proc/${pid}, and /proc/${pid}/net dentries are flushed. However some leaf dentries like /proc/${pid}/net/arp_cache aren't. That's because respective PDEs have proc_misc_d_revalidate() hook which returns 1 and leaves dentries/inodes in the LRU. Force revalidation/lookup on everything under /proc/${pid}/net by inheriting proc_net_dentry_ops. [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/YjdVHgildbWO7diJ@localhost.localdomain Fixes: c6c75deda813 ("proc: fix lookup in /proc/net subdirectories after setns(2)") Signed-off-by: Alexey Dobriyan Reported-by: hui li Cc: Al Viro Signed-off-by: Andrew Morton commit a2ad63daa88b9d6846976fd2a0b5e4f5cfc58377 Author: NeilBrown Date: Mon May 9 18:20:49 2022 -0700 VFS: add FMODE_CAN_ODIRECT file flag Currently various places test if direct IO is possible on a file by checking for the existence of the direct_IO address space operation. This is a poor choice, as the direct_IO operation may not be used - it is only used if the generic_file_*_iter functions are called for direct IO and some filesystems - particularly NFS - don't do this. Instead, introduce a new f_mode flag: FMODE_CAN_ODIRECT and change the various places to check this (avoiding pointer dereferences). do_dentry_open() will set this flag if ->direct_IO is present, so filesystems do not need to be changed. NFS *is* changed, to set the flag explicitly and discard the direct_IO entry in the address_space_operations for files. Other filesystems which currently use noop_direct_IO could usefully be changed to set this flag instead. Link: https://lkml.kernel.org/r/164859778128.29473.15189737957277399416.stgit@noble.brown Reviewed-by: Christoph Hellwig Signed-off-by: NeilBrown Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 6341a446a0e66355d729b663d7c8ca28ad6d1442 Author: NeilBrown Date: Mon May 9 18:20:49 2022 -0700 MM: handle THP in swap_*page_fs() - count_vm_events() We need to use count_swpout_vm_event() for sio_write_complete() to get correct counting. Note that THP swap in (if it ever happens) is current accounted 1 for each page, whether HUGE or normal. This is different from swap-out accounting. This patch should be squashed into MM: handle THP in swap_*page_fs() Link: https://lkml.kernel.org/r/165146948934.24404.5909750610552745025@noble.neil.brown.name Signed-off-by: NeilBrown Reported-by: Miaohe Lin Reviewed-by: Miaohe Lin Cc: Geert Uytterhoeven Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Yang Shi Cc: Huang Ying Signed-off-by: Andrew Morton commit a1a0dfd56f97738c1974976309bbf38bb5a21132 Author: NeilBrown Date: Mon May 9 18:20:49 2022 -0700 mm: handle THP in swap_*page_fs() Pages passed to swap_readpage()/swap_writepage() are not necessarily all the same size - there may be transparent-huge-pages involves. The BIO paths of swap_*page() handle this correctly, but the SWP_FS_OPS path does not. So we need to use thp_size() to find the size, not just assume PAGE_SIZE, and we need to track the total length of the request, not just assume it is "page * PAGE_SIZE". Link: https://lkml.kernel.org/r/165119301488.15698.9457662928942765453.stgit@noble.brown Signed-off-by: NeilBrown Reported-by: Miaohe Lin Cc: Christoph Hellwig Cc: David Howells Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Signed-off-by: Andrew Morton commit 2282679fb20bf036a714ed49fadd0230c278a203 Author: NeilBrown Date: Mon May 9 18:20:49 2022 -0700 mm: submit multipage write for SWP_FS_OPS swap-space swap_writepage() is given one page at a time, but may be called repeatedly in succession. For block-device swapspace, the blk_plug functionality allows the multiple pages to be combined together at lower layers. That cannot be used for SWP_FS_OPS as blk_plug may not exist - it is only active when CONFIG_BLOCK=y. Consequently all swap reads over NFS are single page reads. With this patch we pass a pointer-to-pointer via the wbc. swap_writepage can store state between calls - much like the pointer passed explicitly to swap_readpage. After calling swap_writepage() some number of times, the state will be passed to swap_write_unplug() which can submit the combined request. Link: https://lkml.kernel.org/r/164859778128.29473.5191868522654408537.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 5169b844b7dd5934cd4f22ab66de0cc669abf0b0 Author: NeilBrown Date: Mon May 9 18:20:49 2022 -0700 mm: submit multipage reads for SWP_FS_OPS swap-space swap_readpage() is given one page at a time, but may be called repeatedly in succession. For block-device swap-space, the blk_plug functionality allows the multiple pages to be combined together at lower layers. That cannot be used for SWP_FS_OPS as blk_plug may not exist - it is only active when CONFIG_BLOCK=y. Consequently all swap reads over NFS are single page reads. With this patch we pass in a pointer-to-pointer when swap_readpage can store state between calls - much like the effect of blk_plug. After calling swap_readpage() some number of times, the state will be passed to swap_read_unplug() which can submit the combined request. Link: https://lkml.kernel.org/r/164859778127.29473.14059420492644907783.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit cba738f6490953e154d163b2980ad6d7f06307aa Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 doc: update documentation for swap_activate and swap_rw This documentation for ->swap_activate() has been out-of-date for a long time. This patch updates it to match recent changes, and adds documentation for the associated ->swap_rw() Link: https://lkml.kernel.org/r/164859778126.29473.6778751233552859461.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 7eadabc05d45ecedc0e8906d1db46bc8cfeb02af Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 mm: perform async writes to SWP_FS_OPS swap-space using ->swap_rw This patch switches swap-out to SWP_FS_OPS swap-spaces to use ->swap_rw and makes the writes asynchronous, like they are for other swap spaces. To make it async we need to allocate the kiocb struct from a mempool. This may block, but won't block as long as waiting for the write to complete. At most it will wait for some previous swap IO to complete. Link: https://lkml.kernel.org/r/164859778126.29473.12399585304843922231.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit eb79f3af9395fbe448e91b0940a6c395b7d06be4 Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 nfs: rename nfs_direct_IO and use as ->swap_rw The nfs_direct_IO() exists to support SWAP IO, but hasn't worked for a while. We now need a ->swap_rw function which behaves slightly differently, returning zero for success rather than a byte count. So modify nfs_direct_IO accordingly, rename it, and use it as the ->swap_rw function. Link: https://lkml.kernel.org/r/165119301493.15698.7491285551903597618.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: Geert Uytterhoeven (on Renesas RSK+RZA1 with 32 MiB of SDRAM) Cc: David Howells Cc: Hugh Dickins Cc: Mel Gorman Cc: Miaohe Lin Cc: Trond Myklebust Signed-off-by: Andrew Morton commit e1209d3a7a67c281260ba9989621060ba7328b8c Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 mm: introduce ->swap_rw and use it for reads from SWP_FS_OPS swap-space swap currently uses ->readpage to read swap pages. This can only request one page at a time from the filesystem, which is not most efficient. swap uses ->direct_IO for writes which while this is adequate is an inappropriate over-loading. ->direct_IO may need to had handle allocate space for holes or other details that are not relevant for swap. So this patch introduces a new address_space operation: ->swap_rw. In this patch it is used for reads, and a subsequent patch will switch writes to use it. No filesystem yet supports ->swap_rw, but that is not a problem because no filesystem actually works with filesystem-based swap. Only two filesystems set SWP_FS_OPS: - cifs sets the flag, but ->direct_IO always fails so swap cannot work. - nfs sets the flag, but ->direct_IO calls generic_write_checks() which has failed on swap files for several releases. To ensure that a NULL ->swap_rw isn't called, ->activate_swap() for both NFS and cifs are changed to fail if ->swap_rw is not set. This can be removed if/when the function is added. Future patches will restore swap-over-NFS functionality. To submit an async read with ->swap_rw() we need to allocate a structure to hold the kiocb and other details. swap_readpage() cannot handle transient failure, so we create a mempool to provide the structures. Link: https://lkml.kernel.org/r/164859778125.29473.13430559328221330589.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit d791ea676b66489ef6dabd04cd655f5c77426e40 Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 mm: reclaim mustn't enter FS for SWP_FS_OPS swap-space If swap-out is using filesystem operations (SWP_FS_OPS), then it is not safe to enter the FS for reclaim. So only down-grade the requirement for swap pages to __GFP_IO after checking that SWP_FS_OPS are not being used. This makes the calculation of "may_enter_fs" slightly more complex, so move it into a separate function. with that done, there is little value in maintaining the bool variable any more. So replace the may_enter_fs variable with a may_enter_fs() function. This removes any risk for the variable becoming out-of-date. Link: https://lkml.kernel.org/r/164859778124.29473.16176717935781721855.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 4b60c0ff2f2021ab99b7fb9da63b7ed1579ef1d8 Author: NeilBrown Date: Mon May 9 18:20:48 2022 -0700 mm: move responsibility for setting SWP_FS_OPS to ->swap_activate If a filesystem wishes to handle all swap IO itself (via ->direct_IO and ->readpage), rather than just providing devices addresses for submit_bio(), SWP_FS_OPS must be set. Currently the protocol for setting this it to have ->swap_activate return zero. In that case SWP_FS_OPS is set, and add_swap_extent() is called for the entire file. This is a little clumsy as different return values for ->swap_activate have quite different meanings, and it makes it hard to search for which filesystems require SWP_FS_OPS to be set. So remove the special meaning of a zero return, and require the filesystem to set SWP_FS_OPS if it so desires, and to always call add_swap_extent() as required. Currently only NFS and CIFS return zero for add_swap_extent(). Link: https://lkml.kernel.org/r/164859778123.29473.17908205846599043598.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 4c4a763406ef903b78334bd2ccea168d2f7a741a Author: NeilBrown Date: Mon May 9 18:20:47 2022 -0700 mm: drop swap_dirty_folio folios that are written to swap are owned by the MM subsystem - not any filesystem. When such a folio is passed to a filesystem to be written out to a swap-file, the filesystem handles the data, but the folio itself does not belong to the filesystem. So calling the filesystem's ->dirty_folio() address_space operation makes no sense. This is for folios in the given address space, and a folio to be written to swap does not exist in the given address space. So drop swap_dirty_folio() which calls the address-space's ->dirty_folio(), and always use noop_dirty_folio(), which is appropriate for folios being swapped out. Link: https://lkml.kernel.org/r/164859778123.29473.6900942583784889976.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Hugh Dickins Cc: Mel Gorman Cc: Trond Myklebust Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 014bb1de4fc17d54907d54418126a9a9736f4aff Author: NeilBrown Date: Mon May 9 18:20:47 2022 -0700 mm: create new mm/swap.h header file Patch series "MM changes to improve swap-over-NFS support". Assorted improvements for swap-via-filesystem. This is a resend of these patches, rebased on current HEAD. The only substantial changes is that swap_dirty_folio has replaced swap_set_page_dirty. Currently swap-via-fs (SWP_FS_OPS) doesn't work for any filesystem. It has previously worked for NFS but that broke a few releases back. This series changes to use a new ->swap_rw rather than ->readpage and ->direct_IO. It also makes other improvements. There is a companion series already in linux-next which fixes various issues with NFS. Once both series land, a final patch is needed which changes NFS over to use ->swap_rw. This patch (of 10): Many functions declared in include/linux/swap.h are only used within mm/ Create a new "mm/swap.h" and move some of these declarations there. Remove the redundant 'extern' from the function declarations. [akpm@linux-foundation.org: mm/memory-failure.c needs mm/swap.h] Link: https://lkml.kernel.org/r/164859751830.29473.5309689752169286816.stgit@noble.brown Link: https://lkml.kernel.org/r/164859778120.29473.11725907882296224053.stgit@noble.brown Signed-off-by: NeilBrown Reviewed-by: Christoph Hellwig Tested-by: David Howells Tested-by: Geert Uytterhoeven Cc: Trond Myklebust Cc: Hugh Dickins Cc: Mel Gorman Cc: Miaohe Lin Signed-off-by: Andrew Morton commit 17de1e559cf1eb01d5d90afd3064d5a280060f6f Author: Joel Savitz Date: Mon May 9 18:20:47 2022 -0700 selftests: clarify common error when running gup_test The gup_test binary will fail showing only the output of perror("open") in the case that /sys/kernel/debug/gup_test is not found. This will almost always be due to CONFIG_GUP_TEST not being set, which enables compilation of a kernel that provides this file. Add a short error message to clarify this failure and point the user to the solution. Link: https://lkml.kernel.org/r/20220502224942.995427-1-jsavitz@redhat.com Signed-off-by: Joel Savitz Cc: Shuah Khan Cc: Nico Pache Signed-off-by: Andrew Morton commit 0768c8de1b74b0f177d5f16c00b1459e92837d26 Author: Yury Norov Date: Mon May 9 18:20:47 2022 -0700 mm/gup: fix comments to pin_user_pages_*() pin_user_pages API forces FOLL_PIN in gup_flags, which means that the API requires struct page **pages to be provided (not NULL). However, the comment to pin_user_pages() clearly allows for passing in a NULL @pages argument. Remove the incorrect comments, and add WARN_ON_ONCE(!pages) calls to enforce the API. It has been independently spotted by Minchan Kim and confirmed with John Hubbard: https://lore.kernel.org/all/YgWA0ghrrzHONehH@google.com/ Link: https://lkml.kernel.org/r/20220422015839.1274328-1-yury.norov@gmail.com Signed-off-by: Yury Norov (NVIDIA) Reviewed-by: John Hubbard Cc: Minchan Kim Signed-off-by: Andrew Morton commit bff9beaa2e8039d42dd60c27d0f0e2c586a6cb6b Author: David Hildenbrand Date: Mon May 9 18:20:47 2022 -0700 powerpc/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE for book3s Right now, the last 5 bits (0x1f) of the swap entry are used for the type and the bit before that (0x20) is used for _PAGE_SWP_SOFT_DIRTY. We cannot use 0x40, as that collides with _RPAGE_RSV1 -- contained in _PAGE_HPTEFLAGS. The next candidate would be _RPAGE_SW3 (0x200) -- which is used for _PAGE_SOFT_DIRTY for !swp ptes. So let's just use _PAGE_SOFT_DIRTY for _PAGE_SWP_SOFT_DIRTY (to make it easier to grasp) and use 0x20 now for _PAGE_SWP_EXCLUSIVE. Link: https://lkml.kernel.org/r/20220329164329.208407-9-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 03ac1b71fca171315dbbc3f9318e3cd2a210541e Author: David Hildenbrand Date: Mon May 9 18:20:46 2022 -0700 powerpc/pgtable: remove _PAGE_BIT_SWAP_TYPE for book3s The swap type is simply stored in bits 0x1f of the swap pte. Let's simplify by just getting rid of _PAGE_BIT_SWAP_TYPE. It's not like that we can simply change it: _PAGE_SWP_SOFT_DIRTY would suddenly fall into _RPAGE_RSV1, which isn't possible and would make the BUILD_BUG_ON(_PAGE_HPTEFLAGS & _PAGE_SWP_SOFT_DIRTY) angry. While at it, make it clearer which bit we're actually using for _PAGE_SWP_SOFT_DIRTY by just using the proper define and introduce and use SWP_TYPE_MASK. Link: https://lkml.kernel.org/r/20220329164329.208407-8-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 92cd58bd2566de905b347025b9408a55134956b7 Author: David Hildenbrand Date: Mon May 9 18:20:46 2022 -0700 s390/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE Let's use bit 52, which is unused. Link: https://lkml.kernel.org/r/20220329164329.208407-7-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 8043d26c46596ef2e7875e48a9536fb6df020813 Author: David Hildenbrand Date: Mon May 9 18:20:46 2022 -0700 s390/pgtable: cleanup description of swp pte layout Bit 52 and bit 55 don't have to be zero: they only trigger a translation-specifiation exception if the PTE is marked as valid, which is not the case for swap ptes. Document which bits are used for what, and which ones are unused. Link: https://lkml.kernel.org/r/20220329164329.208407-6-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 570ef363509b031966ed669fa002c8441dff273c Author: David Hildenbrand Date: Mon May 9 18:20:46 2022 -0700 arm64/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE Let's use one of the type bits: core-mm only supports 5, so there is no need to consume 6. Note that we might be able to reuse bit 1, but reusing bit 1 turned out problematic in the past for PROT_NONE handling; so let's play safe and use another bit. Link: https://lkml.kernel.org/r/20220329164329.208407-5-david@redhat.com Reviewed-by: Catalin Marinas Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 3e20889cfbee1e9716544a14c5d23be598412ddf Author: David Hildenbrand Date: Mon May 9 18:20:46 2022 -0700 x86/pgtable: support __HAVE_ARCH_PTE_SWP_EXCLUSIVE Let's use bit 3 to remember PG_anon_exclusive in swap ptes. [david@redhat.com: fix 32-bit swap layout] Link: https://lkml.kernel.org/r/d875c292-46b3-f281-65ae-71d0b0c6f592@redhat.com Link: https://lkml.kernel.org/r/20220329164329.208407-4-david@redhat.com Signed-off-by: David Hildenbrand Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vlastimil Babka Cc: Will Deacon Signed-off-by: Andrew Morton commit 210d1e8af42df0fc35aee953124798f743432fab Author: David Hildenbrand Date: Mon May 9 18:20:45 2022 -0700 mm/debug_vm_pgtable: add tests for __HAVE_ARCH_PTE_SWP_EXCLUSIVE Let's test that __HAVE_ARCH_PTE_SWP_EXCLUSIVE works as expected. Link: https://lkml.kernel.org/r/20220329164329.208407-3-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Dave Hansen Cc: Don Dutile Cc: Gerald Schaefer Cc: Heiko Carstens Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michael Ellerman Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Paul Mackerras Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Will Deacon Signed-off-by: Andrew Morton commit 1493a1913e34b0ac366e33f9ebad721e69fd06ac Author: David Hildenbrand Date: Mon May 9 18:20:45 2022 -0700 mm/swap: remember PG_anon_exclusive via a swp pte bit Patch series "mm: COW fixes part 3: reliable GUP R/W FOLL_GET of anonymous pages", v2. This series fixes memory corruptions when a GUP R/W reference (FOLL_WRITE | FOLL_GET) was taken on an anonymous page and COW logic fails to detect exclusivity of the page to then replacing the anonymous page by a copy in the page table: The GUP reference lost synchronicity with the pages mapped into the page tables. This series focuses on x86, arm64, s390x and ppc64/book3s -- other architectures are fairly easy to support by implementing __HAVE_ARCH_PTE_SWP_EXCLUSIVE. This primarily fixes the O_DIRECT memory corruptions that can happen on concurrent swapout, whereby we lose DMA reads to a page (modifying the user page by writing to it). O_DIRECT currently uses FOLL_GET for short-term (!FOLL_LONGTERM) DMA from/to a user page. In the long run, we want to convert it to properly use FOLL_PIN, and John is working on it, but that might take a while and might not be easy to backport. In the meantime, let's restore what used to work before we started modifying our COW logic: make R/W FOLL_GET references reliable as long as there is no fork() after GUP involved. This is just the natural follow-up of part 2, that will also further reduce "wrong COW" on the swapin path, for example, when we cannot remove a page from the swapcache due to concurrent writeback, or if we have two threads faulting on the same swapped-out page. Fixing O_DIRECT is just a nice side-product This issue, including other related COW issues, has been summarized in [3] under 2): " 2. Intra Process Memory Corruptions due to Wrong COW (FOLL_GET) It was discovered that we can create a memory corruption by reading a file via O_DIRECT to a part (e.g., first 512 bytes) of a page, concurrently writing to an unrelated part (e.g., last byte) of the same page, and concurrently write-protecting the page via clear_refs SOFTDIRTY tracking [6]. For the reproducer, the issue is that O_DIRECT grabs a reference of the target page (via FOLL_GET) and clear_refs write-protects the relevant page table entry. On successive write access to the page from the process itself, we wrongly COW the page when resolving the write fault, resulting in a loss of synchronicity and consequently a memory corruption. While some people might think that using clear_refs in this combination is a corner cases, it turns out to be a more generic problem unfortunately. For example, it was just recently discovered that we can similarly create a memory corruption without clear_refs, simply by concurrently swapping out the buffer pages [7]. Note that we nowadays even use the swap infrastructure in Linux without an actual swap disk/partition: the prime example is zram which is enabled as default under Fedora [10]. The root issue is that a write-fault on a page that has additional references results in a COW and thereby a loss of synchronicity and consequently a memory corruption if two parties believe they are referencing the same page. " We don't particularly care about R/O FOLL_GET references: they were never reliable and O_DIRECT doesn't expect to observe modifications from a page after DMA was started. Note that: * this only fixes the issue on x86, arm64, s390x and ppc64/book3s ("enterprise architectures"). Other architectures have to implement __HAVE_ARCH_PTE_SWP_EXCLUSIVE to achieve the same. * this does *not * consider any kind of fork() after taking the reference: fork() after GUP never worked reliably with FOLL_GET. * Not losing PG_anon_exclusive during swapout was the last remaining piece. KSM already makes sure that there are no other references on a page before considering it for sharing. Page migration maintains PG_anon_exclusive and simply fails when there are additional references (freezing the refcount fails). Only swapout code dropped the PG_anon_exclusive flag because it requires more work to remember + restore it. With this series in place, most COW issues of [3] are fixed on said architectures. Other architectures can implement __HAVE_ARCH_PTE_SWP_EXCLUSIVE fairly easily. [1] https://lkml.kernel.org/r/20220329160440.193848-1-david@redhat.com [2] https://lkml.kernel.org/r/20211217113049.23850-1-david@redhat.com [3] https://lore.kernel.org/r/3ae33b08-d9ef-f846-56fb-645e3b9b4c66@redhat.com This patch (of 8): Currently, we clear PG_anon_exclusive in try_to_unmap() and forget about it. We do this, to keep fork() logic on swap entries easy and efficient: for example, if we wouldn't clear it when unmapping, we'd have to lookup the page in the swapcache for each and every swap entry during fork() and clear PG_anon_exclusive if set. Instead, we want to store that information directly in the swap pte, protected by the page table lock, similarly to how we handle SWP_MIGRATION_READ_EXCLUSIVE for migration entries. However, for actual swap entries, we don't want to mess with the swap type (e.g., still one bit) because it overcomplicates swap code. In try_to_unmap(), we already reject to unmap in case the page might be pinned, because we must not lose PG_anon_exclusive on pinned pages ever. Checking if there are other unexpected references reliably *before* completely unmapping a page is unfortunately not really possible: THP heavily overcomplicate the situation. Once fully unmapped it's easier -- we, for example, make sure that there are no unexpected references *after* unmapping a page before starting writeback on that page. So, we currently might end up unmapping a page and clearing PG_anon_exclusive if that page has additional references, for example, due to a FOLL_GET. do_swap_page() has to re-determine if a page is exclusive, which will easily fail if there are other references on a page, most prominently GUP references via FOLL_GET. This can currently result in memory corruptions when taking a FOLL_GET | FOLL_WRITE reference on a page even when fork() is never involved: try_to_unmap() will succeed, and when refaulting the page, it cannot be marked exclusive and will get replaced by a copy in the page tables on the next write access, resulting in writes via the GUP reference to the page being lost. In an ideal world, everybody that uses GUP and wants to modify page content, such as O_DIRECT, would properly use FOLL_PIN. However, that conversion will take a while. It's easier to fix what used to work in the past (FOLL_GET | FOLL_WRITE) remembering PG_anon_exclusive. In addition, by remembering PG_anon_exclusive we can further reduce unnecessary COW in some cases, so it's the natural thing to do. So let's transfer the PG_anon_exclusive information to the swap pte and store it via an architecture-dependant pte bit; use that information when restoring the swap pte in do_swap_page() and unuse_pte(). During fork(), we simply have to clear the pte bit and are done. Of course, there is one corner case to handle: swap backends that don't support concurrent page modifications while the page is under writeback. Special case these, and drop the exclusive marker. Add a comment why that is just fine (also, reuse_swap_page() would have done the same in the past). In the future, we'll hopefully have all architectures support __HAVE_ARCH_PTE_SWP_EXCLUSIVE, such that we can get rid of the empty stubs and the define completely. Then, we can also convert SWP_MIGRATION_READ_EXCLUSIVE. For architectures it's fairly easy to support: either simply use a yet unused pte bit that can be used for swap entries, steal one from the arch type bits if they exceed 5, or steal one from the offset bits. Note: R/O FOLL_GET references were never really reliable, especially when taking one on a shared page and then writing to the page (e.g., GUP after fork()). FOLL_GET, including R/W references, were never really reliable once fork was involved (e.g., GUP before fork(), GUP during fork()). KSM steps back in case it stumbles over unexpected references and is, therefore, fine. [david@redhat.com: fix SWP_STABLE_WRITES test] Link: https://lkml.kernel.org/r/ac725bcb-313a-4fff-250a-68ba9a8f85fb@redhat.comLink: https://lkml.kernel.org/r/20220329164329.208407-1-david@redhat.com Link: https://lkml.kernel.org/r/20220329164329.208407-2-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Hugh Dickins Cc: Shakeel Butt Cc: John Hubbard Cc: Jason Gunthorpe Cc: Mike Kravetz Cc: Mike Rapoport Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox (Oracle) Cc: Jann Horn Cc: Michal Hocko Cc: Nadav Amit Cc: Rik van Riel Cc: Roman Gushchin Cc: Andrea Arcangeli Cc: Peter Xu Cc: Don Dutile Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: Jan Kara Cc: Liang Zhang Cc: Pedro Demarchi Gomes Cc: Oded Gabbay Cc: Catalin Marinas Cc: Will Deacon Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Gerald Schaefer Signed-off-by: Andrew Morton commit b6a2619c60b41a929bbb9c09f193d690d707b1af Author: David Hildenbrand Date: Mon May 9 18:20:45 2022 -0700 mm/gup: sanity-check with CONFIG_DEBUG_VM that anonymous pages are exclusive when (un)pinning Let's verify when (un)pinning anonymous pages that we always deal with exclusive anonymous pages, which guarantees that we'll have a reliable PIN, meaning that we cannot end up with the GUP pin being inconsistent with he pages mapped into the page tables due to a COW triggered by a write fault. When pinning pages, after conditionally triggering GUP unsharing of possibly shared anonymous pages, we should always only see exclusive anonymous pages. Note that anonymous pages that are mapped writable must be marked exclusive, otherwise we'd have a BUG. When pinning during ordinary GUP, simply add a check after our conditional GUP-triggered unsharing checks. As we know exactly how the page is mapped, we know exactly in which page we have to check for PageAnonExclusive(). When pinning via GUP-fast we have to be careful, because we can race with fork(): verify only after we made sure via the seqcount that we didn't race with concurrent fork() that we didn't end up pinning a possibly shared anonymous page. Similarly, when unpinning, verify that the pages are still marked as exclusive: otherwise something turned the pages possibly shared, which can result in random memory corruptions, which we really want to catch. With only the pinned pages at hand and not the actual page table entries we have to be a bit careful: hugetlb pages are always mapped via a single logical page table entry referencing the head page and PG_anon_exclusive of the head page applies. Anon THP are a bit more complicated, because we might have obtained the page reference either via a PMD or a PTE -- depending on the mapping type we either have to check PageAnonExclusive of the head page (PMD-mapped THP) or the tail page (PTE-mapped THP) applies: as we don't know and to make our life easier, check that either is set. Take care to not verify in case we're unpinning during GUP-fast because we detected concurrent fork(): we might stumble over an anonymous page that is now shared. Link: https://lkml.kernel.org/r/20220428083441.37290-18-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit a7f226604170acd6b142b76472c1a49c12ebb83d Author: David Hildenbrand Date: Mon May 9 18:20:45 2022 -0700 mm/gup: trigger FAULT_FLAG_UNSHARE when R/O-pinning a possibly shared anonymous page Whenever GUP currently ends up taking a R/O pin on an anonymous page that might be shared -- mapped R/O and !PageAnonExclusive() -- any write fault on the page table entry will end up replacing the mapped anonymous page due to COW, resulting in the GUP pin no longer being consistent with the page actually mapped into the page table. The possible ways to deal with this situation are: (1) Ignore and pin -- what we do right now. (2) Fail to pin -- which would be rather surprising to callers and could break user space. (3) Trigger unsharing and pin the now exclusive page -- reliable R/O pins. Let's implement 3) because it provides the clearest semantics and allows for checking in unpin_user_pages() and friends for possible BUGs: when trying to unpin a page that's no longer exclusive, clearly something went very wrong and might result in memory corruptions that might be hard to debug. So we better have a nice way to spot such issues. This change implies that whenever user space *wrote* to a private mapping (IOW, we have an anonymous page mapped), that GUP pins will always remain consistent: reliable R/O GUP pins of anonymous pages. As a side note, this commit fixes the COW security issue for hugetlb with FOLL_PIN as documented in: https://lore.kernel.org/r/3ae33b08-d9ef-f846-56fb-645e3b9b4c66@redhat.com The vmsplice reproducer still applies, because vmsplice uses FOLL_GET instead of FOLL_PIN. Note that follow_huge_pmd() doesn't apply because we cannot end up in there with FOLL_PIN. This commit is heavily based on prototype patches by Andrea. Link: https://lkml.kernel.org/r/20220428083441.37290-17-david@redhat.com Signed-off-by: Andrea Arcangeli Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Co-developed-by: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit c89357e27f20dda3fff6791d27bb6c91eae99f4a Author: David Hildenbrand Date: Mon May 9 18:20:45 2022 -0700 mm: support GUP-triggered unsharing of anonymous pages Whenever GUP currently ends up taking a R/O pin on an anonymous page that might be shared -- mapped R/O and !PageAnonExclusive() -- any write fault on the page table entry will end up replacing the mapped anonymous page due to COW, resulting in the GUP pin no longer being consistent with the page actually mapped into the page table. The possible ways to deal with this situation are: (1) Ignore and pin -- what we do right now. (2) Fail to pin -- which would be rather surprising to callers and could break user space. (3) Trigger unsharing and pin the now exclusive page -- reliable R/O pins. We want to implement 3) because it provides the clearest semantics and allows for checking in unpin_user_pages() and friends for possible BUGs: when trying to unpin a page that's no longer exclusive, clearly something went very wrong and might result in memory corruptions that might be hard to debug. So we better have a nice way to spot such issues. To implement 3), we need a way for GUP to trigger unsharing: FAULT_FLAG_UNSHARE. FAULT_FLAG_UNSHARE is only applicable to R/O mapped anonymous pages and resembles COW logic during a write fault. However, in contrast to a write fault, GUP-triggered unsharing will, for example, still maintain the write protection. Let's implement FAULT_FLAG_UNSHARE by hooking into the existing write fault handlers for all applicable anonymous page types: ordinary pages, THP and hugetlb. * If FAULT_FLAG_UNSHARE finds a R/O-mapped anonymous page that has been marked exclusive in the meantime by someone else, there is nothing to do. * If FAULT_FLAG_UNSHARE finds a R/O-mapped anonymous page that's not marked exclusive, it will try detecting if the process is the exclusive owner. If exclusive, it can be set exclusive similar to reuse logic during write faults via page_move_anon_rmap() and there is nothing else to do; otherwise, we either have to copy and map a fresh, anonymous exclusive page R/O (ordinary pages, hugetlb), or split the THP. This commit is heavily based on patches by Andrea. Link: https://lkml.kernel.org/r/20220428083441.37290-16-david@redhat.com Signed-off-by: Andrea Arcangeli Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Co-developed-by: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 8909691b6c5a84b67573b23ee8bb917b005628f0 Author: David Hildenbrand Date: Mon May 9 18:20:44 2022 -0700 mm/gup: disallow follow_page(FOLL_PIN) We want to change the way we handle R/O pins on anonymous pages that might be shared: if we detect a possibly shared anonymous page -- mapped R/O and not !PageAnonExclusive() -- we want to trigger unsharing via a page fault, resulting in an exclusive anonymous page that can be pinned reliably without getting replaced via COW on the next write fault. However, the required page fault will be problematic for follow_page(): in contrast to ordinary GUP, follow_page() doesn't trigger faults internally. So we would have to end up failing a R/O pin via follow_page(), although there is something mapped R/O into the page table, which might be rather surprising. We don't seem to have follow_page(FOLL_PIN) users, and it's a purely internal MM function. Let's just make our life easier and the semantics of follow_page() clearer by just disallowing FOLL_PIN for follow_page() completely. Link: https://lkml.kernel.org/r/20220428083441.37290-15-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 7f5abe609b3dcbc62a36e18b1437f4f3521ecb75 Author: David Hildenbrand Date: Mon May 9 18:20:44 2022 -0700 mm/rmap: fail try_to_migrate() early when setting a PMD migration entry fails Let's fail right away in case we cannot clear PG_anon_exclusive because the anon THP may be pinned. Right now, we continue trying to install migration entries and the caller of try_to_migrate() will realize that the page is still mapped and has to restore the migration entries. Let's just fail fast just like for PTE migration entries. Link: https://lkml.kernel.org/r/20220428083441.37290-14-david@redhat.com Signed-off-by: David Hildenbrand Suggested-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 6c287605fd56466e645693eff3ae7c08fba56e0a Author: David Hildenbrand Date: Mon May 9 18:20:44 2022 -0700 mm: remember exclusively mapped anonymous pages with PG_anon_exclusive Let's mark exclusively mapped anonymous pages with PG_anon_exclusive as exclusive, and use that information to make GUP pins reliable and stay consistent with the page mapped into the page table even if the page table entry gets write-protected. With that information at hand, we can extend our COW logic to always reuse anonymous pages that are exclusive. For anonymous pages that might be shared, the existing logic applies. As already documented, PG_anon_exclusive is usually only expressive in combination with a page table entry. Especially PTE vs. PMD-mapped anonymous pages require more thought, some examples: due to mremap() we can easily have a single compound page PTE-mapped into multiple page tables exclusively in a single process -- multiple page table locks apply. Further, due to MADV_WIPEONFORK we might not necessarily write-protect all PTEs, and only some subpages might be pinned. Long story short: once PTE-mapped, we have to track information about exclusivity per sub-page, but until then, we can just track it for the compound page in the head page and not having to update a whole bunch of subpages all of the time for a simple PMD mapping of a THP. For simplicity, this commit mostly talks about "anonymous pages", while it's for THP actually "the part of an anonymous folio referenced via a page table entry". To not spill PG_anon_exclusive code all over the mm code-base, we let the anon rmap code to handle all PG_anon_exclusive logic it can easily handle. If a writable, present page table entry points at an anonymous (sub)page, that (sub)page must be PG_anon_exclusive. If GUP wants to take a reliably pin (FOLL_PIN) on an anonymous page references via a present page table entry, it must only pin if PG_anon_exclusive is set for the mapped (sub)page. This commit doesn't adjust GUP, so this is only implicitly handled for FOLL_WRITE, follow-up commits will teach GUP to also respect it for FOLL_PIN without FOLL_WRITE, to make all GUP pins of anonymous pages fully reliable. Whenever an anonymous page is to be shared (fork(), KSM), or when temporarily unmapping an anonymous page (swap, migration), the relevant PG_anon_exclusive bit has to be cleared to mark the anonymous page possibly shared. Clearing will fail if there are GUP pins on the page: * For fork(), this means having to copy the page and not being able to share it. fork() protects against concurrent GUP using the PT lock and the src_mm->write_protect_seq. * For KSM, this means sharing will fail. For swap this means, unmapping will fail, For migration this means, migration will fail early. All three cases protect against concurrent GUP using the PT lock and a proper clear/invalidate+flush of the relevant page table entry. This fixes memory corruptions reported for FOLL_PIN | FOLL_WRITE, when a pinned page gets mapped R/O and the successive write fault ends up replacing the page instead of reusing it. It improves the situation for O_DIRECT/vmsplice/... that still use FOLL_GET instead of FOLL_PIN, if fork() is *not* involved, however swapout and fork() are still problematic. Properly using FOLL_PIN instead of FOLL_GET for these GUP users will fix the issue for them. I. Details about basic handling I.1. Fresh anonymous pages page_add_new_anon_rmap() and hugepage_add_new_anon_rmap() will mark the given page exclusive via __page_set_anon_rmap(exclusive=1). As that is the mechanism fresh anonymous pages come into life (besides migration code where we copy the page->mapping), all fresh anonymous pages will start out as exclusive. I.2. COW reuse handling of anonymous pages When a COW handler stumbles over a (sub)page that's marked exclusive, it simply reuses it. Otherwise, the handler tries harder under page lock to detect if the (sub)page is exclusive and can be reused. If exclusive, page_move_anon_rmap() will mark the given (sub)page exclusive. Note that hugetlb code does not yet check for PageAnonExclusive(), as it still uses the old COW logic that is prone to the COW security issue because hugetlb code cannot really tolerate unnecessary/wrong COW as huge pages are a scarce resource. I.3. Migration handling try_to_migrate() has to try marking an exclusive anonymous page shared via page_try_share_anon_rmap(). If it fails because there are GUP pins on the page, unmap fails. migrate_vma_collect_pmd() and __split_huge_pmd_locked() are handled similarly. Writable migration entries implicitly point at shared anonymous pages. For readable migration entries that information is stored via a new "readable-exclusive" migration entry, specific to anonymous pages. When restoring a migration entry in remove_migration_pte(), information about exlusivity is detected via the migration entry type, and RMAP_EXCLUSIVE is set accordingly for page_add_anon_rmap()/hugepage_add_anon_rmap() to restore that information. I.4. Swapout handling try_to_unmap() has to try marking the mapped page possibly shared via page_try_share_anon_rmap(). If it fails because there are GUP pins on the page, unmap fails. For now, information about exclusivity is lost. In the future, we might want to remember that information in the swap entry in some cases, however, it requires more thought, care, and a way to store that information in swap entries. I.5. Swapin handling do_swap_page() will never stumble over exclusive anonymous pages in the swap cache, as try_to_migrate() prohibits that. do_swap_page() always has to detect manually if an anonymous page is exclusive and has to set RMAP_EXCLUSIVE for page_add_anon_rmap() accordingly. I.6. THP handling __split_huge_pmd_locked() has to move the information about exclusivity from the PMD to the PTEs. a) In case we have a readable-exclusive PMD migration entry, simply insert readable-exclusive PTE migration entries. b) In case we have a present PMD entry and we don't want to freeze ("convert to migration entries"), simply forward PG_anon_exclusive to all sub-pages, no need to temporarily clear the bit. c) In case we have a present PMD entry and want to freeze, handle it similar to try_to_migrate(): try marking the page shared first. In case we fail, we ignore the "freeze" instruction and simply split ordinarily. try_to_migrate() will properly fail because the THP is still mapped via PTEs. When splitting a compound anonymous folio (THP), the information about exclusivity is implicitly handled via the migration entries: no need to replicate PG_anon_exclusive manually. I.7. fork() handling fork() handling is relatively easy, because PG_anon_exclusive is only expressive for some page table entry types. a) Present anonymous pages page_try_dup_anon_rmap() will mark the given subpage shared -- which will fail if the page is pinned. If it failed, we have to copy (or PTE-map a PMD to handle it on the PTE level). Note that device exclusive entries are just a pointer at a PageAnon() page. fork() will first convert a device exclusive entry to a present page table and handle it just like present anonymous pages. b) Device private entry Device private entries point at PageAnon() pages that cannot be mapped directly and, therefore, cannot get pinned. page_try_dup_anon_rmap() will mark the given subpage shared, which cannot fail because they cannot get pinned. c) HW poison entries PG_anon_exclusive will remain untouched and is stale -- the page table entry is just a placeholder after all. d) Migration entries Writable and readable-exclusive entries are converted to readable entries: possibly shared. I.8. mprotect() handling mprotect() only has to properly handle the new readable-exclusive migration entry: When write-protecting a migration entry that points at an anonymous page, remember the information about exclusivity via the "readable-exclusive" migration entry type. II. Migration and GUP-fast Whenever replacing a present page table entry that maps an exclusive anonymous page by a migration entry, we have to mark the page possibly shared and synchronize against GUP-fast by a proper clear/invalidate+flush to make the following scenario impossible: 1. try_to_migrate() places a migration entry after checking for GUP pins and marks the page possibly shared. 2. GUP-fast pins the page due to lack of synchronization 3. fork() converts the "writable/readable-exclusive" migration entry into a readable migration entry 4. Migration fails due to the GUP pin (failing to freeze the refcount) 5. Migration entries are restored. PG_anon_exclusive is lost -> We have a pinned page that is not marked exclusive anymore. Note that we move information about exclusivity from the page to the migration entry as it otherwise highly overcomplicates fork() and PTE-mapping a THP. III. Swapout and GUP-fast Whenever replacing a present page table entry that maps an exclusive anonymous page by a swap entry, we have to mark the page possibly shared and synchronize against GUP-fast by a proper clear/invalidate+flush to make the following scenario impossible: 1. try_to_unmap() places a swap entry after checking for GUP pins and clears exclusivity information on the page. 2. GUP-fast pins the page due to lack of synchronization. -> We have a pinned page that is not marked exclusive anymore. If we'd ever store information about exclusivity in the swap entry, similar to migration handling, the same considerations as in II would apply. This is future work. Link: https://lkml.kernel.org/r/20220428083441.37290-13-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 78fbe906cc900b33ce078102e13e0e99b5b8c406 Author: David Hildenbrand Date: Mon May 9 18:20:44 2022 -0700 mm/page-flags: reuse PG_mappedtodisk as PG_anon_exclusive for PageAnon() pages The basic question we would like to have a reliable and efficient answer to is: is this anonymous page exclusive to a single process or might it be shared? We need that information for ordinary/single pages, hugetlb pages, and possibly each subpage of a THP. Introduce a way to mark an anonymous page as exclusive, with the ultimate goal of teaching our COW logic to not do "wrong COWs", whereby GUP pins lose consistency with the pages mapped into the page table, resulting in reported memory corruptions. Most pageflags already have semantics for anonymous pages, however, PG_mappedtodisk should never apply to pages in the swapcache, so let's reuse that flag. As PG_has_hwpoisoned also uses that flag on the second tail page of a compound page, convert it to PG_error instead, which is marked as PF_NO_TAIL, so never used for tail pages. Use custom page flag modification functions such that we can do additional sanity checks. The semantics we'll put into some kernel doc in the future are: " PG_anon_exclusive is *usually* only expressive in combination with a page table entry. Depending on the page table entry type it might store the following information: Is what's mapped via this page table entry exclusive to the single process and can be mapped writable without further checks? If not, it might be shared and we might have to COW. For now, we only expect PTE-mapped THPs to make use of PG_anon_exclusive in subpages. For other anonymous compound folios (i.e., hugetlb), only the head page is logically mapped and holds this information. For example, an exclusive, PMD-mapped THP only has PG_anon_exclusive set on the head page. When replacing the PMD by a page table full of PTEs, PG_anon_exclusive, if set on the head page, will be set on all tail pages accordingly. Note that converting from a PTE-mapping to a PMD mapping using the same compound page is currently not possible and consequently doesn't require care. If GUP wants to take a reliable pin (FOLL_PIN) on an anonymous page, it should only pin if the relevant PG_anon_exclusive is set. In that case, the pin will be fully reliable and stay consistent with the pages mapped into the page table, as the bit cannot get cleared (e.g., by fork(), KSM) while the page is pinned. For anonymous pages that are mapped R/W, PG_anon_exclusive can be assumed to always be set because such pages cannot possibly be shared. The page table lock protecting the page table entry is the primary synchronization mechanism for PG_anon_exclusive; GUP-fast that does not take the PT lock needs special care when trying to clear the flag. Page table entry types and PG_anon_exclusive: * Present: PG_anon_exclusive applies. * Swap: the information is lost. PG_anon_exclusive was cleared. * Migration: the entry holds this information instead. PG_anon_exclusive was cleared. * Device private: PG_anon_exclusive applies. * Device exclusive: PG_anon_exclusive applies. * HW Poison: PG_anon_exclusive is stale and not changed. If the page may be pinned (FOLL_PIN), clearing PG_anon_exclusive is not allowed and the flag will stick around until the page is freed and folio->mapping is cleared. " We won't be clearing PG_anon_exclusive on destructive unmapping (i.e., zapping) of page table entries, page freeing code will handle that when also invalidate page->mapping to not indicate PageAnon() anymore. Letting information about exclusivity stick around will be an important property when adding sanity checks to unpinning code. Note that we properly clear the flag in free_pages_prepare() via PAGE_FLAGS_CHECK_AT_PREP for each individual subpage of a compound page, so there is no need to manually clear the flag. Link: https://lkml.kernel.org/r/20220428083441.37290-12-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 500539419fae0aeb27189b2d62a238a056ca6742 Author: David Hildenbrand Date: Mon May 9 18:20:44 2022 -0700 mm/huge_memory: remove outdated VM_WARN_ON_ONCE_PAGE from unmap_page() We can already theoretically fail to unmap (still having page_mapped()) in case arch_unmap_one() fails, which can happen on sparc. Failures to unmap are handled gracefully, just as if there are other references on the target page: freezing the refcount in split_huge_page_to_list() will fail if still mapped and we'll simply remap. In commit 504e070dc08f ("mm: thp: replace DEBUG_VM BUG with VM_WARN when unmap fails for split") we already converted to VM_WARN_ON_ONCE_PAGE, let's get rid of it completely now. This is a preparation for making try_to_migrate() fail on anonymous pages with GUP pins, which will make this VM_WARN_ON_ONCE_PAGE trigger more frequently. Link: https://lkml.kernel.org/r/20220428083441.37290-11-david@redhat.com Signed-off-by: David Hildenbrand Reported-by: Yang Shi Reviewed-by: Yang Shi Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 6c54dc6c74371eebf7eddc16b4f64b8c841c1585 Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: use page_move_anon_rmap() when reusing a mapped PageAnon() page exclusively We want to mark anonymous pages exclusive, and when using page_move_anon_rmap() we know that we are the exclusive user, as properly documented. This is a preparation for marking anonymous pages exclusive in page_move_anon_rmap(). In both instances, we're holding page lock and are sure that we're the exclusive owner (page_count() == 1). hugetlb already properly uses page_move_anon_rmap() in the write fault handler. Note that in case of a PTE-mapped THP, we'll only end up calling this function if the whole THP is only referenced by the single PTE mapping a single subpage (page_count() == 1); consequently, it's fine to modify the compound page mapping inside page_move_anon_rmap(). Link: https://lkml.kernel.org/r/20220428083441.37290-10-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 40f2bbf71161fa9195c7869004290003af152375 Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: drop "compound" parameter from page_add_new_anon_rmap() New anonymous pages are always mapped natively: only THP/khugepaged code maps a new compound anonymous page and passes "true". Otherwise, we're just dealing with simple, non-compound pages. Let's give the interface clearer semantics and document these. Remove the PageTransCompound() sanity check from page_add_new_anon_rmap(). Link: https://lkml.kernel.org/r/20220428083441.37290-9-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 28c5209dfd5f86f4398ce01bfac8508b2c4d4050 Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: pass rmap flags to hugepage_add_anon_rmap() Let's prepare for passing RMAP_EXCLUSIVE, similarly as we do for page_add_anon_rmap() now. RMAP_COMPOUND is implicit for hugetlb pages and ignored. Link: https://lkml.kernel.org/r/20220428083441.37290-8-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit f1e2db12e45baaa2d366f87c885968096c2ff5aa Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: remove do_page_add_anon_rmap() ... and instead convert page_add_anon_rmap() to accept flags. Passing flags instead of bools is usually nicer either way, and we want to more often also pass RMAP_EXCLUSIVE in follow up patches when detecting that an anonymous page is exclusive: for example, when restoring an anonymous page from a writable migration entry. This is a preparation for marking an anonymous page inside page_add_anon_rmap() as exclusive when RMAP_EXCLUSIVE is passed. Link: https://lkml.kernel.org/r/20220428083441.37290-7-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 14f9135d547060d1d0c182501201f8da19895fe3 Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: convert RMAP flags to a proper distinct rmap_t type We want to pass the flags to more than one anon rmap function, getting rid of special "do_page_add_anon_rmap()". So let's pass around a distinct __bitwise type and refine documentation. Link: https://lkml.kernel.org/r/20220428083441.37290-6-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit fb3d824d1a46c5bb0584ea88f32dc2495544aebf Author: David Hildenbrand Date: Mon May 9 18:20:43 2022 -0700 mm/rmap: split page_dup_rmap() into page_dup_file_rmap() and page_try_dup_anon_rmap() ... and move the special check for pinned pages into page_try_dup_anon_rmap() to prepare for tracking exclusive anonymous pages via a new pageflag, clearing it only after making sure that there are no GUP pins on the anonymous page. We really only care about pins on anonymous pages, because they are prone to getting replaced in the COW handler once mapped R/O. For !anon pages in cow-mappings (!VM_SHARED && VM_MAYWRITE) we shouldn't really care about that, at least not that I could come up with an example. Let's drop the is_cow_mapping() check from page_needs_cow_for_dma(), as we know we're dealing with anonymous pages. Also, drop the handling of pinned pages from copy_huge_pud() and add a comment if ever supporting anonymous pages on the PUD level. This is a preparation for tracking exclusivity of anonymous pages in the rmap code, and disallowing marking a page shared (-> failing to duplicate) if there are GUP pins on a page. Link: https://lkml.kernel.org/r/20220428083441.37290-5-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 9eab75d45ddc9d29640fd17199880d39241eeb35 Merge: 5bcfeb6efee91 299ba7a32a3ca Author: Jakub Kicinski Date: Mon May 9 18:20:42 2022 -0700 Merge branch 'nfp-support-corigine-pcie-vendor-id' Simon Horman says: ==================== nfp: support Corigine PCIE vendor ID Historically the nfp driver has supported NFP chips with Netronome's PCIE vendor ID. This patch extends the driver to also support NFP chips, which at this point are assumed to be otherwise identical from a software perspective, that have Corigine's PCIE vendor ID (0x1da8). This patchset begins by cleaning up strings to make them: * Vendor neutral for the NFP chip * Relate to Corigine for the driver itself It then adds support to the driver for the Corigine's PCIE vendor ID ==================== Link: https://lore.kernel.org/r/20220508173816.476357-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit b51ad4f8679e50284ce35ff671767f8f0309b64a Author: David Hildenbrand Date: Mon May 9 18:20:42 2022 -0700 mm/memory: slightly simplify copy_present_pte() Let's move the pinning check into the caller, to simplify return code logic and prepare for further changes: relocating the page_needs_cow_for_dma() into rmap handling code. While at it, remove the unused pte parameter and simplify the comments a bit. No functional change intended. Link: https://lkml.kernel.org/r/20220428083441.37290-4-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 623a1ddfeb232526275ddd0c8378771e6712aad4 Author: David Hildenbrand Date: Mon May 9 18:20:42 2022 -0700 mm/hugetlb: take src_mm->write_protect_seq in copy_hugetlb_page_range() Let's do it just like copy_page_range(), taking the seqlock and making sure the mmap_lock is held in write mode. This allows for add a VM_BUG_ON to page_needs_cow_for_dma() and properly synchronizes concurrent fork() with GUP-fast of hugetlb pages, which will be relevant for further changes. Link: https://lkml.kernel.org/r/20220428083441.37290-3-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Khalid Aziz Cc: "Kirill A. Shutemov" Cc: Liang Zhang Cc: "Matthew Wilcox (Oracle)" Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oded Gabbay Cc: Oleg Nesterov Cc: Pedro Demarchi Gomes Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton commit 322842ea3c7264936b084ac949e9070ee47a5202 Author: David Hildenbrand Date: Mon May 9 18:20:42 2022 -0700 mm/rmap: fix missing swap_free() in try_to_unmap() after arch_unmap_one() failed Patch series "mm: COW fixes part 2: reliable GUP pins of anonymous pages", v4. This series is the result of the discussion on the previous approach [2]. More information on the general COW issues can be found there. It is based on latest linus/master (post v5.17, with relevant core-MM changes for v5.18-rc1). This series fixes memory corruptions when a GUP pin (FOLL_PIN) was taken on an anonymous page and COW logic fails to detect exclusivity of the page to then replacing the anonymous page by a copy in the page table: The GUP pin lost synchronicity with the pages mapped into the page tables. This issue, including other related COW issues, has been summarized in [3] under 3): " 3. Intra Process Memory Corruptions due to Wrong COW (FOLL_PIN) page_maybe_dma_pinned() is used to check if a page may be pinned for DMA (using FOLL_PIN instead of FOLL_GET). While false positives are tolerable, false negatives are problematic: pages that are pinned for DMA must not be added to the swapcache. If it happens, the (now pinned) page could be faulted back from the swapcache into page tables read-only. Future write-access would detect the pinning and COW the page, losing synchronicity. For the interested reader, this is nicely documented in feb889fb40fa ("mm: don't put pinned pages into the swap cache"). Peter reports [8] that page_maybe_dma_pinned() as used is racy in some cases and can result in a violation of the documented semantics: giving false negatives because of the race. There are cases where we call it without properly taking a per-process sequence lock, turning the usage of page_maybe_dma_pinned() racy. While one case (clear_refs SOFTDIRTY tracking, see below) seems to be easy to handle, there is especially one rmap case (shrink_page_list) that's hard to fix: in the rmap world, we're not limited to a single process. The shrink_page_list() issue is really subtle. If we race with someone pinning a page, we can trigger the same issue as in the FOLL_GET case. See the detail section at the end of this mail on a discussion how bad this can bite us with VFIO or other FOLL_PIN user. It's harder to reproduce, but I managed to modify the O_DIRECT reproducer to use io_uring fixed buffers [15] instead, which ends up using FOLL_PIN | FOLL_WRITE | FOLL_LONGTERM to pin buffer pages and can similarly trigger a loss of synchronicity and consequently a memory corruption. Again, the root issue is that a write-fault on a page that has additional references results in a COW and thereby a loss of synchronicity and consequently a memory corruption if two parties believe they are referencing the same page. " This series makes GUP pins (R/O and R/W) on anonymous pages fully reliable, especially also taking care of concurrent pinning via GUP-fast, for example, also fully fixing an issue reported regarding NUMA balancing [4] recently. While doing that, it further reduces "unnecessary COWs", especially when we don't fork()/KSM and don't swapout, and fixes the COW security for hugetlb for FOLL_PIN. In summary, we track via a pageflag (PG_anon_exclusive) whether a mapped anonymous page is exclusive. Exclusive anonymous pages that are mapped R/O can directly be mapped R/W by the COW logic in the write fault handler. Exclusive anonymous pages that want to be shared (fork(), KSM) first have to be marked shared -- which will fail if there are GUP pins on the page. GUP is only allowed to take a pin on anonymous pages that are exclusive. The PT lock is the primary mechanism to synchronize modifications of PG_anon_exclusive. We synchronize against GUP-fast either via the src_mm->write_protect_seq (during fork()) or via clear/invalidate+flush of the relevant page table entry. Special care has to be taken about swap, migration, and THPs (whereby a PMD-mapping can be converted to a PTE mapping and we have to track information for subpages). Besides these, we let the rmap code handle most magic. For reliable R/O pins of anonymous pages, we need FAULT_FLAG_UNSHARE logic as part of our previous approach [2], however, it's now 100% mapcount free and I further simplified it a bit. #1 is a fix #3-#10 are mostly rmap preparations for PG_anon_exclusive handling #11 introduces PG_anon_exclusive #12 uses PG_anon_exclusive and make R/W pins of anonymous pages reliable #13 is a preparation for reliable R/O pins #14 and #15 is reused/modified GUP-triggered unsharing for R/O GUP pins make R/O pins of anonymous pages reliable #16 adds sanity check when (un)pinning anonymous pages [1] https://lkml.kernel.org/r/20220131162940.210846-1-david@redhat.com [2] https://lkml.kernel.org/r/20211217113049.23850-1-david@redhat.com [3] https://lore.kernel.org/r/3ae33b08-d9ef-f846-56fb-645e3b9b4c66@redhat.com [4] https://bugzilla.kernel.org/show_bug.cgi?id=215616 This patch (of 17): In case arch_unmap_one() fails, we already did a swap_duplicate(). let's undo that properly via swap_free(). Link: https://lkml.kernel.org/r/20220428083441.37290-1-david@redhat.com Link: https://lkml.kernel.org/r/20220428083441.37290-2-david@redhat.com Fixes: ca827d55ebaa ("mm, swap: Add infrastructure for saving page metadata on swap") Signed-off-by: David Hildenbrand Reviewed-by: Khalid Aziz Acked-by: Vlastimil Babka Cc: Hugh Dickins Cc: David Rientjes Cc: Shakeel Butt Cc: John Hubbard Cc: Jason Gunthorpe Cc: Mike Kravetz Cc: Mike Rapoport Cc: Yang Shi Cc: "Kirill A. Shutemov" Cc: "Matthew Wilcox (Oracle)" Cc: Jann Horn Cc: Michal Hocko Cc: Nadav Amit Cc: Rik van Riel Cc: Roman Gushchin Cc: Andrea Arcangeli Cc: Peter Xu Cc: Don Dutile Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: Jan Kara Cc: Liang Zhang Cc: Pedro Demarchi Gomes Cc: Oded Gabbay Cc: David Hildenbrand Signed-off-by: Andrew Morton commit 299ba7a32a3ca2ad2955bbad6b30eb88d1ced62d Author: Yu Xiao Date: Sun May 8 19:38:16 2022 +0200 nfp: support Corigine PCIE vendor ID Historically the nfp driver has supported NFP chips with Netronome's PCIE vendor ID. This patch extends the driver to also support NFP chips, which at this point are assumed to be otherwise identical from a software perspective, that have Corigine's PCIE vendor ID (0x1da8). Also, Rename the macro definitions PCI_DEVICE_ID_NERTONEOME_NFPXXXX to PCI_DEVICE_ID_NFPXXXX, as they are now used in conjunction with two PCIE vendor IDs. Signed-off-by: Yu Xiao Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 34e244ea150769fed3dbfd1d1cb33a088216d3ac Author: Yu Xiao Date: Sun May 8 19:38:15 2022 +0200 nfp: vendor neutral strings for chip and Corigne in strings for driver Historically the nfp driver has supported NFP chips with Netronome's PCIE vendor ID. In preparation for extending the to also support NFP chips that have Corigine's PCIE vendor ID (0x1da8) make printk statements relating to the chip vendor neutral. An alternate approach is to set the string based on the PCI vendor ID. In our judgement this proved to cumbersome so we have taken this simpler approach. Update strings relating to the driver to use Corigine, who have taken over maintenance of the driver. Signed-off-by: Yu Xiao Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski commit 5bcfeb6efee9126e3c41a537e16536df0c8af973 Merge: eef0dc7e517e7 e0c7402270d99 Author: Jakub Kicinski Date: Mon May 9 17:51:01 2022 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-05-06 Marcin Szycik says: This patchset adds support for systemd defined naming scheme for port representors, as well as re-enables displaying PCI bus-info in ethtool. bus-info information has previously been removed from ethtool for port representors, as a workaround for a bug in lshw tool, where the tool would sometimes display wrong descriptions for port representors/PF. Now the bug has been fixed in lshw tool [1]. Removing the workaround can be considered a regression (user might be running an older, unpatched version of lshw) (see [2] for discussion). However, calling SET_NETDEV_DEV also produces the same effect as removing the workaround, i.e. lshw is able to access PCI bus-info (this time not via ethtool, but in some other way) and the bug can occur. Adding SET_NETDEV_DEV is important, as it greatly improves netdev naming - - port representors are named based on PF name. Currently port representors are named "ethX", which might be confusing, especially when spawning VFs on multiple PFs. Furthermore, it's currently harder to determine to which PF does a particular port representor belong, as bus-info is not shown in ethtool. Consider the following three cases: Case 1: current code - driver workaround in place, no SET_NETDEV_DEV, lshw with or without fix. Port representors are not displayed because they don't have bus-info (the workaround), PFs are labelled correctly: $ sudo ./lshw -c net -businfo Bus info Device Class Description ======================================================== pci@0000:02:00.0 ens6f0 network Ethernet Controller E810-XXV for SFP <-- PF pci@0000:02:00.1 ens6f1 network Ethernet Controller E810-XXV for SFP pci@0000:02:01.0 ens6f0v0 network Ethernet Adaptive Virtual Function <-- VF pci@0000:02:01.1 ens6f0v1 network Ethernet Adaptive Virtual Function ... Case 2: driver workaround in place, SET_NETDEV_DEV, no lshw fix. Port representors have predictable names. lshw is able to get bus-info because of SET_NETDEV_DEV and netdevs CAN be mislabelled: $ sudo ./lshw -c net -businfo Bus info Device Class Description ============================================================= pci@0000:02:00.0 ens6f0npf0vf60 network Ethernet Controller E810-XXV for SFP <-- mislabeled port representor pci@0000:02:00.1 ens6f1 network Ethernet Controller E810-XXV for SFP pci@0000:02:01.0 ens6f0v0 network Ethernet Adaptive Virtual Function pci@0000:02:01.1 ens6f0v1 network Ethernet Adaptive Virtual Function ... pci@0000:02:00.0 ens6f0npf0vf26 network Ethernet interface pci@0000:02:00.0 ens6f0 network Ethernet interface <-- mislabeled PF pci@0000:02:00.0 ens6f0npf0vf81 network Ethernet interface ... $ sudo ethtool -i ens6f0npf0vf60 driver: ice ... bus-info: ... Output of lshw would be the same with workaround removed; it does not change the fact that lshw labels netdevs incorrectly, while at the same time it prevents ethtool from displaying potentially useful data (bus-info). Case 3: workaround removed, SET_NETDEV_DEV, lshw fix: $ sudo ./lshw -c net -businfo Bus info Device Class Description ============================================================= pci@0000:02:00.0 ens6f0npf0vf73 network Ethernet Controller E810-XXV for SFP pci@0000:02:00.1 ens6f1 network Ethernet Controller E810-XXV for SFP pci@0000:02:01.0 ens6f0v0 network Ethernet Adaptive Virtual Function pci@0000:02:01.1 ens6f0v1 network Ethernet Adaptive Virtual Function ... pci@0000:02:00.0 ens6f0npf0vf5 network Ethernet Controller E810-XXV for SFP pci@0000:02:00.0 ens6f0 network Ethernet Controller E810-XXV for SFP pci@0000:02:00.0 ens6f0npf0vf60 network Ethernet Controller E810-XXV for SFP ... $ sudo ethtool -i ens6f0npf0vf73 driver: ice ... bus-info: 0000:02:00.0 ... In this case poort representors have predictable names, netdevs are not mislabelled in lshw, and bus-info is shown in ethtool. [1] https://ezix.org/src/pkg/lshw/commit/9bf4e4c9c1 [2] https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20220321144731.3935-1-marcin.szycik@linux.intel.com * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: Revert "ice: Hide bus-info in ethtool for PRs in switchdev mode" ice: link representors to PCI device ==================== Link: https://lore.kernel.org/r/20220506180052.5256-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 43bf087848ab796fab93c9b4de59a7ed70aab94a Author: Yuntao Wang Date: Thu May 5 15:01:14 2022 +0800 bpf: Remove unused parameter from find_kfunc_desc_btf() The func_id parameter in find_kfunc_desc_btf() is not used, get rid of it. Fixes: 2357672c54c3 ("bpf: Introduce BPF support for kernel module function calls") Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20220505070114.3522522-1-ytcoode@gmail.com commit 56c3e749d08a041454f5d75273c24d16240f26dc Author: Jason Wang Date: Mon May 9 17:02:47 2022 +0800 bpftool: Declare generator name Most code generators declare its name so did this for bfptool. Signed-off-by: Jason Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220509090247.5457-1-jasowang@redhat.com commit ec24704492d8791a52a75a39e3ad762b6e017bc6 Author: Jerome Marchand Date: Sat May 7 18:16:35 2022 +0200 samples: bpf: Don't fail for a missing VMLINUX_BTF when VMLINUX_H is provided samples/bpf build currently always fails if it can't generate vmlinux.h from vmlinux, even when vmlinux.h is directly provided by VMLINUX_H variable, which makes VMLINUX_H pointless. Only fails when neither method works. Fixes: 384b6b3bbf0d ("samples: bpf: Add vmlinux.h generation support") Reported-by: CKI Project Reported-by: Veronika Kabatova Signed-off-by: Jerome Marchand Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220507161635.2219052-1-jmarchan@redhat.com commit eef0dc7e517e72344d6d121e598866dad8c96666 Author: Jiapeng Chong Date: Sat May 7 11:42:07 2022 +0800 ROSE: Remove unused code and clean up some inconsistent indenting Eliminate the follow smatch warning: net/rose/rose_route.c:1136 rose_node_show() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220507034207.18651-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jakub Kicinski commit bfa92e0bdc8ee5d444086fa25489de861a17b085 Merge: 7b3a06382442c b06a92a18d465 Author: Andrii Nakryiko Date: Mon May 9 17:16:05 2022 -0700 Merge branch 'bpftool: fix feature output when helper probes fail' Milan Landaverde says: ==================== Currently in bpftool's feature probe, we incorrectly tell the user that all of the helper functions are supported for program types where helper probing fails or is explicitly unsupported[1]: $ bpftool feature probe ... eBPF helpers supported for program type tracing: - bpf_map_lookup_elem - bpf_map_update_elem - bpf_map_delete_elem ... - bpf_redirect_neigh - bpf_check_mtu - bpf_sys_bpf - bpf_sys_close This patch adjusts bpftool to relay to the user when helper support can't be determined: $ bpftool feature probe ... eBPF helpers supported for program type lirc_mode2: Program type not supported eBPF helpers supported for program type tracing: Could not determine which helpers are available eBPF helpers supported for program type struct_opts: Could not determine which helpers are available eBPF helpers supported for program type ext: Could not determine which helpers are available Rather than imply that no helpers are available for the program type, we let the user know that helper function probing failed entirely. [1] https://lore.kernel.org/bpf/20211217171202.3352835-2-andrii@kernel.org/ ==================== Signed-off-by: Andrii Nakryiko commit b06a92a18d4651c983c60d83935a76b2d47d85e0 Author: Milan Landaverde Date: Wed May 4 12:13:32 2022 -0400 bpftool: Output message if no helpers found in feature probing Currently in libbpf, we have hardcoded program types that are not supported for helper function probing (e.g. tracing, ext, lsm). Due to this (and other legitimate failures), bpftool feature probe returns empty for those program type helper functions. Instead of implying to the user that there are no helper functions available for a program type, we output a message to the user explaining that helper function probing failed for that program type. Signed-off-by: Milan Landaverde Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220504161356.3497972-3-milan@mdaverde.com commit 6d9f63b9df5ed7ffe10ac70025f408d28b3dd260 Author: Milan Landaverde Date: Wed May 4 12:13:31 2022 -0400 bpftool: Adjust for error codes from libbpf probes Originally [1], libbpf's (now deprecated) probe functions returned a bool to acknowledge support but the new APIs return an int with a possible negative error code to reflect probe failure. This change decides for bpftool to declare maps and helpers are not available on probe failures. [1]: https://lore.kernel.org/bpf/20220202225916.3313522-3-andrii@kernel.org/ Signed-off-by: Milan Landaverde Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220504161356.3497972-2-milan@mdaverde.com commit 494dcdf46e5cdee926c9f441d37e3ea1db57d1da Author: YueHaibing Date: Wed Apr 27 21:10:02 2022 +0800 sched: Fix build warning without CONFIG_SYSCTL IF CONFIG_SYSCTL is n, build warn: kernel/sched/core.c:1782:12: warning: ‘sysctl_sched_uclamp_handler’ defined but not used [-Wunused-function] static int sysctl_sched_uclamp_handler(struct ctl_table *table, int write, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ sysctl_sched_uclamp_handler() is used while CONFIG_SYSCTL enabled, wrap all related code with CONFIG_SYSCTL to fix this. Fixes: 3267e0156c33 ("sched: Move uclamp_util sysctls to core.c") Signed-off-by: YueHaibing Signed-off-by: Luis Chamberlain commit 764aaf44cd64dd1f760268ee0b22d2dc53cd5bc0 Author: YueHaibing Date: Wed Apr 27 20:54:01 2022 +0800 reboot: Fix build warning without CONFIG_SYSCTL If CONFIG_SYSCTL is n, build warn: kernel/reboot.c:443:20: error: ‘kernel_reboot_sysctls_init’ defined but not used [-Werror=unused-function] static void __init kernel_reboot_sysctls_init(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~ Move kernel_reboot_sysctls_init() to #ifdef block to fix this. Fixes: 06d177662fb8 ("kernel/reboot: move reboot sysctls to its own file") Signed-off-by: YueHaibing Signed-off-by: Luis Chamberlain commit 218d921b581eadf312c8ef0e09113b111f104eeb Author: Eric Biggers Date: Sat Apr 30 22:08:54 2022 -0700 fscrypt: add new helper functions for test_dummy_encryption Unfortunately the design of fscrypt_set_test_dummy_encryption() doesn't work properly for the new mount API, as it combines too many steps into one function: - Parse the argument to test_dummy_encryption - Check the setting against the filesystem instance - Apply the setting to the filesystem instance The new mount API has split these into separate steps. ext4 partially worked around this by duplicating some of the logic, but it still had some bugs. To address this, add some new helper functions that split up the steps of fscrypt_set_test_dummy_encryption(): - fscrypt_parse_test_dummy_encryption() - fscrypt_dummy_policies_equal() - fscrypt_add_test_dummy_key() While we're add it, also add a function fscrypt_is_dummy_policy_set() which will be useful to avoid some #ifdef's. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220501050857.538984-5-ebiggers@kernel.org commit bfb9700bdf35417454a9bb8b67221d89d7c6e75a Author: Eric Biggers Date: Sat Apr 30 22:08:53 2022 -0700 fscrypt: factor out fscrypt_policy_to_key_spec() Factor out a function that builds the fscrypt_key_specifier for an fscrypt_policy. Before this was only needed when finding the key for a file, but now it will also be needed for test_dummy_encryption support. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220501050857.538984-4-ebiggers@kernel.org commit 481cc97349d694e3211e14a886ad2b7ef55b5a2c Author: Matthew Wilcox (Oracle) Date: Sat May 7 14:49:47 2022 +0100 mm,doc: Add new documentation structure Closely following the outline of Mel Gorman's book "Understanding the Linux Virtual Memory Manager", add a new outline. Preserve the current contents of the mm underneath the new outline so we can transition those documents to a more sensible place later. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Acked-by: Randy Dunlap Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220507134947.444287-1-willy@infradead.org Signed-off-by: Jonathan Corbet commit 4a840d5fdcfcfff55b8b22896c1193a9b26405aa Author: Randy Dunlap Date: Sat Apr 23 20:37:01 2022 -0700 Documentation: drop more IDE boot options and ide-cd.rst Drop ide-* command line options. Drop cdrom/ide-cd.rst documentation. Fixes: 898ee22c32be ("Drop Documentation/ide/") Signed-off-by: Randy Dunlap Cc: Jens Axboe Cc: Christoph Hellwig Acked-by: Damien Le Moal Acked-by: Phillip Potter Link: https://lore.kernel.org/r/20220424033701.7988-1-rdunlap@infradead.org [jc: also deleted reference from cdrom/index.rst] Signed-off-by: Jonathan Corbet commit f1a693994b1c340ceb982cf1da467da0e545e36d Author: Krzysztof Kozlowski Date: Wed Apr 27 20:56:45 2022 +0200 Documentation/process: use scripts/get_maintainer.pl on patches Explain that, when collecting list of people to Cc the patch, scripts/get_maintainer.pl should be used on patches, not on the directories. The behavior is quite different, because with "-f" on a directory, the maintainers of individual files will not be shown. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220427185645.677039-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Corbet commit 0327b8b392377f6ae45d6cd0d5c8f32f9174552b Author: Akira Yokosawa Date: Sat Apr 30 16:59:33 2022 +0900 MAINTAINERS: Add entry for DOCUMENTATION/JAPANESE Due to the lack of an entry for the Japanese translation of documentation, Kosuke Fujimoto needed to ask the status of its maintenance [1]. Add an entry for DOCUMENTATION/JAPANESE as a sub-subsystem under the DOCUMENTATION subsystem to make it easier for another prospective contributor to know there is someone who takes care of Japanese translation. As a first step, install myself as a designated reviewer. Hopefully, other interested members get accustomed to the kernel-dev workflow and would get ready to be (co-)maintainers/reviewers shortly. [1]: https://lore.kernel.org/r/172fa015-26df-c978-853d-3aba67c581cc@gmail.com/ Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Link: https://lore.kernel.org/r/7689b502-8c34-85b1-54e0-7a3b5e3c2bd1@gmail.com Signed-off-by: Jonathan Corbet commit 6548e96edb50aa1fcd919ef95ffc2d19e29f855d Author: Kosuke Fujimoto Date: Sun May 1 19:22:56 2022 +0900 docs/trans/ja_JP/howto: Don't mention specific kernel versions This change is based on commit d2b008f134b7 ("Documentation/process/howto: Update for 4.x -> 5.x versioning"). Replace "4.x kernel version" with generic term such as "mainline tree" Reviewed-by: Akira Yokosawa --- V2: Reformatted commit log message (Yokosawa-san) V3: Updated some expressions (Shibata-san) - added "version number" in mainline tree section - updated from "stable kernel" to "stable tree" V4: Added reviewed by tag and removed extra characters (Yokosawa-san)  V5: Removed an extra character (Shibata-san) Signed-off-by: Kosuke Fujimoto Acked-by: Tsugikazu Shibata Link: https://lore.kernel.org/r/20220501102256.6379-1-fujimotokosuke0@gmail.com Signed-off-by: Jonathan Corbet commit e29b3abcb2b6227a27a74fbeb417b14995194067 Author: Akira Yokosawa Date: Tue May 3 19:48:20 2022 +0900 docs/ja_JP/SubmittingPatches: Request summaries for commit references Reflect changes made in commit 0af5270324cc ("Documentation/SubmittingPatches: Request summaries for commit references"). Note: Translated paragraph uses a slightly different structure and omit a redundant phrase so that they are easier to follow. Signed-off-by: Akira Yokosawa Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Tsugikazu Shibata Reviewed-by: Kosuke Fujimoto Link: https://lore.kernel.org/r/20220503104820.49269-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit fccf0cc918f208dfa2328e7943b2267c64b454e5 Author: Akira Yokosawa Date: Tue May 3 19:47:57 2022 +0900 docs/ja_JP/SubmittingPatches: Add Suggested-by as a standard signature Reflect changes made in commit 8543ae1296f6 ("checkpatch: add Suggested-by as a standard signature"). Signed-off-by: Akira Yokosawa Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Tsugikazu Shibata Reviewed-by: Kosuke Fujimoto Link: https://lore.kernel.org/r/20220503104757.49208-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit d797255be8a79305d187d34e6fee94b3579c0d14 Author: Akira Yokosawa Date: Tue May 3 19:47:29 2022 +0900 docs/ja_JP/SubmittingPatches: Randy has moved Reflect changes made in commit 755727b7fb1e ("Randy has moved"). Signed-off-by: Akira Yokosawa Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Tsugikazu Shibata Reviewed-by: Kosuke Fujimoto Link: https://lore.kernel.org/r/20220503104729.49140-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit 164f9fcb21cc9a144ca9ebcf85b00c49537f6be2 Author: Akira Yokosawa Date: Tue May 3 19:46:50 2022 +0900 docs/ja_JP/SubmittingPatches: Suggest the use of scripts/get_maintainer.pl Reflect changes made in commit e52d2e1f25f0 ("Documentation/SubmittingPatches: suggested the use of scripts/get_maintainer.pl"). Signed-off-by: Akira Yokosawa Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Tsugikazu Shibata Reviewed-by: Kosuke Fujimoto Link: https://lore.kernel.org/r/20220503104650.49068-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit 039d5926c4028ec53c1e777349ac58588e69f7fb Author: Akira Yokosawa Date: Tue May 3 19:46:13 2022 +0900 docs/ja_JP/SubmittingPatches: Update GregKH links Reflect changes made in commit f5039935ac68 ("Documentation: update GregKH links"). Signed-off-by: Akira Yokosawa Cc: Tsugikazu Shibata Cc: Kosuke Fujimoto Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Tsugikazu Shibata Reviewed-by: Kosuke Fujimoto Link: https://lore.kernel.org/r/20220503104613.49001-1-akiyks@gmail.com Signed-off-by: Jonathan Corbet commit 977389aabe3479ebdd038582245dd24a91841318 Merge: 31df43eff28d7 d80b9c8422fa8 Author: Arnd Bergmann Date: Mon May 9 23:46:17 2022 +0200 Merge tag 'imx-dt64-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm64 device tree update for 5.19: - New board support: Engicam i.Core MX8M Plus SoM and EDIMM2.2 Starter Kit, Toradex Verdin i.MX8M Plus devices, Data Modul i.MX8M Mini eDM SBC, Verdin based MX8Menlo, 8MNANOD3L EVK, i.MX8M Plus Gateworks GW7400. - Enable RTS-CTS on UART3 for imx8mm-beacon and imx8mn-beacon boards. - Enable HS400-ES support for i.MX8MN and i.MX8MP uSDHC devices by updating the compatible. - A few updates on imx8mq-librem5 to increase boost regulation current, add panel compatible for r4 ("Evergreen") revision and volume buttons a wakeup source. - Clean up vendor specific 'fsl,uart-has-rtscts' property by using standard 'uart-has-rtscts'. - Add GPC, GPU, MEDIAMIX, and HSIO power domains for i.MX8M Plus SoC. - A series from Marcel Ziswiler to improve imx8mm-verdin support, including cosmetic changes and functional improvements like SD1 sleep pinctrl and fully validated IOMUX configuration. - Add PWM polarity inversion support for i.MX8 SoCs. - A couple of changes from Michael Walle to update PMIC output names and min/max voltages for imx8mn-evk board. - A series from Tim Harvey to improve imx8mm-venice boards, add missing uart-has-rtscts property to UARTs, clock-names to pcie_phy, and vdd_5p0 ADC channel. - Add VPU codec devices for i.MX8QXP SoC. - Other small and random changes. * tag 'imx-dt64-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (65 commits) arm64: dt: imx8mp: support pwm polarity inversion arm64: dt: imx8mn: support pwm polarity inversion arm64: dt: imx8mm: support pwm polarity inversion arm64: dt: imx8mq: support pwm polarity inversion arm64: dts: imx8mm-venice-gw7901: remove unnecessary cpu temp override arm64: dts: imx8mm-venice-gw7902: add vdd_5p0 ADC channel arm64: dts: imx8m*venice: add missing clock-names to pcie_phy arm64: dts: imx8mm-venice-gw7902: fix pcie bindings arm64: dts: freescale: reduce the interrup-map-mask arm64: dts: imx8mn-beacon: Enable RTS-CTS on UART3 arm64: dts: imx8mm-beacon: Enable RTS-CTS on UART3 arm64: dts: imx8mm: Use 100 kHz I2C2 on Data Modul i.MX8M Mini eDM SBC arm64: dts: imx8mm: Disable USB2 OC on Data Modul i.MX8M Mini eDM SBC arm64: dts: imx8mm: Add CPLD on MX8Menlo board arm64: dts: imx8mq-kontron-pitx-imx8m: Use the standard 'uart-has-rtscts' arm64: dts: imx8mp-verdin: Use the standard 'uart-has-rtscts' arm64: dts: imx8mp: Add MEDIA_BLK_CTRL arm64: dts: imx8mp: Add MEDIAMIX power domains arm64: dts: imx8mp: add HSIO power-domains arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit ... Link: https://lore.kernel.org/r/20220508033843.2773685-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 31df43eff28d7b6036e80c225602a93155bce6a5 Merge: d4dcdc53c492a 19a434aa3ebc2 Author: Arnd Bergmann Date: Mon May 9 23:43:09 2022 +0200 Merge tag 'imx-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX ARM device tree update for 5.19: - New board support: PHYTEC phyGATE-Tauri-S, TQ-Systems MBa6UL, LS1021A IoT board, Toradex Iris and Aster carrier, i.MX7D SMEGW01, i.MXRT1050 EVK, Bosch ACC board. - A series from Alexander Stein to update i.MX51 based digi-connectcore board, regarding to DMA of UART devices, PMIC voltages, USB vbus-supply and usbphy. - A series of changes from David Jander and Oleksij Rempel to remove prototype specific deprecated code not used in production from i.MX6Q/DL Vicut1 board, and unify Vicut1 and Victgo variants to reduce maintaining overhead. - Quite some changes from different people to update imx6ull-colibri board on various aspects, touchscreen, device tree overlays, NAND BCH geometry, GPIO line names, FEC phy-supply, etc. - A couple of changes from Fabio Estevam to switch imx6dl-plybas and imx6ul-kontron-n6x1x-s to use standard 'uart-has-rtscts' property. - A couple of patches from Li Yang to update IFC device compatible and node name for LayerScape SoCs. - Disable USB host to work around boot issue on imx6qdl-udoo board. - A series from Max Krummenacher to update Colibri i.MX6DL device trees, drop dedicated v1.1 DT, disable add-on accessories, cleanups, etc. - Various random and small updates on i.MX28 and i.MX6 boards. * tag 'imx-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (77 commits) ARM: dts: imx6ull-colibri: improve pinctrl node names ARM: dts: imx6ull-colibri: move gpio-keys node to som dtsi ARM: dts: imx6ull-colibri: add/update some comments ARM: dts: imx6ull-colibri: fix nand bch geometry ARM: dts: imx6ull-colibri: add support for toradex aster carrier boards ARM: dts: imx6ull-colibri: add support for toradex iris carrier boards ARM: dts: imx6ull-colibri: add gpio-line-names ARM: dts: imx6ull-colibri: update device trees to support overlays ARM: dts: imx6ull-colibri: update usdhc1 pixmux and signaling ARM: dts: imx6ull-colibri: add touchscreen device nodes ARM: dts: imx6ull-colibri: add phy-supply to fec ARM: dts: imx6ull-colibri: change touch i2c parameters ARM: dts: imx6ull-colibri: use pull-down for adc pins ARM: dts: Add bosch acc board ARM: dts: imx: Add i.MXRT1050-EVK support ARM: dts: imx7d-smegw01: Add support for i.MX7D SMEGW01 board ARM: dts: imx6qdl-udoo: Disable USB host to work around boot issues ARM: dts: imx27: use new 'dma-channels' property ARM: dts: imx6qdl-phytec: Add LED labels ARM: dts: ls1021a: reduce the interrupt-map-mask ... Link: https://lore.kernel.org/r/20220508033843.2773685-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit d4dcdc53c492a7b9fa9031cb85e238b21208ada2 Merge: 4c94666955356 19794489fa247 Author: Arnd Bergmann Date: Mon May 9 23:26:14 2022 +0200 Merge tag 'qcom-arm64-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM64 DT updates for v5.19 This adds MDIO bus description on the IPQ6018 platform. On MSM8916 the BAM-DMUX WWAN network device is added and the Huawei Ascend G7 gains sound card definition and clarified installation instructions. MSM8992 and MSM8994 continues to be worked on, gaining multimedia clock controller, on-chip memory, watchdog and various cleanup changes. The Xiaomi Mi 4C gains CPU regulators and fixes to the framebuffer definition, while Huawei Nexus 6P gains eMMC support. On MSM8996 the modem and sensor remtoeprocs are added and enabled in the Dragonboard 820c and the Xiaomi devices. On MSM8998 a few newly added clocks related to the sensor subsystem bus are marked as protected by default and the OnePlus devices gains NFC. The SC7180 platform and devices thereon are further polished and limozeen moves to using edp-panel for EDID-based detection, over statically defined panels. On SC7280 GPI DMA, WiFi remoteproc and network device, LPASS audio clocks, resets for SDCC controllers and a new CRD revision are added. A supply glitch on the PCIe power and a current leak for Bluetooth during suspend are corrected. The Herobrine board gains eDP support and the IDP gains backlight. USB is marked wakeup capable. On SDM845 the IPA, WLED based backlight and second WiFi channel are enabled for Xiaomi Pocophone F1, the firmware name is modified to not conflict with other boards. On RB3 the CAN bus controller is added and the WiFi calibration variant is defined to allow adding the board's calibration information into linux-firmware. SM6350 gains I2C busses, UFS and WiFi support, and the numbering of uart9 is corrected. On SM7225 and the Fairphone 4 UFS, WiFi and haptics are enabled. On SM8150 PCIe, Ethernet and uSD card support is added, and enabled for the SA8155p ADP board. The PDC interrupt controller is also added and described as wakup interrupt parent for TLMM. Camera subsystem and control interface are defined for SM8250. On the Sony Xperia 1 II the audio amplifiers are enabled. On SM8350 GPI DMA engines are added and linked to the I2C and SPI serial engines. Surface Duo 2 gains battery charger support. On SM8450 the two PCIe controller/PHYs are enabled, GPI DMA and QUP serial engine instances are added. Remoteproc instances are enabled on SM8450 HDK. Last, but not least, a number of DeviceTree validation errors across various boards are corrected. * tag 'qcom-arm64-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (150 commits) arm64: dts: qcom: Only include sc7180.dtsi in sc7180-trogdor.dtsi arm64: dts: qcom: sc7180-trogdor: Simplify spi0/spi6 labeling arm64: dts: qcom: sc7180-trogdor: Simplify trackpad enabling arm64: dts: qcom: sc7280: eDP for herobrine boards arm64: dts: qcom: sa8155p-adp: Disable multiple Tx and Rx queues for ethernet IP arm64: dts: qcom: sm8150: Fix iommu sid value for SDC2 controller arm64: dts: qcom: sm8350-duo2: enable battery charger arm64: dts: qcom: Enable pm8350c pwm for sc7280-idp2 arm64: dts: qcom: pm8350c: Add pwm support arm64: dts: qcom: sc7280-qcard: Configure CTS pin to bias-bus-hold for bluetooth arm64: dts: qcom: sc7280-idp: Configure CTS pin to bias-bus-hold for bluetooth arm64: dts: qcom: sc7180: Remove ipa interconnect node arm64: dts: qcom: sc7280-idp: Enable GPI DMAs arm64: dts: qcom: sc7280: Add GENI I2C/SPI DMA channels arm64: dts: qcom: sc7280: Add GPI DMAengines arm64: dts: qcom: sm8450: Fix qmp phy node (use phy@ instead of lanes@) arm64: dts: qcom: db845c: Add support for MCP2517FD arm64: dts: qcom: qrb5165-rb5: Fix can-clock node name arm64: dts: qcom: sc7280: Add SAR sensors to herobrine crd arm64: dts: qcom: sm8250: camss: Add CCI definitions ... Link: https://lore.kernel.org/r/20220509204451.325675-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 4c94666955356944b7ba95a35c140cd6a72b4ea8 Merge: 41f0bbd621e9d fb5e339fb1bc9 Author: Arnd Bergmann Date: Mon May 9 23:21:54 2022 +0200 Merge tag 'qcom-dts-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM DT updates for v5.19 This contains a long overdue overhaul of the MSM8974 DeviceTrees, aligning the style, structure and naming with what we've learned since the introduction of this platform. On top of this the Sony Rhine platform gained I2C masters, NFC and pstore support and the Fairphone 2 gained touchscreen support. For the new SDX65 platform reserved-memory nodes, rpmpd, SPMI, CPU clocks, SDHCI controller, SMMU and TCSR mutex was added. As was the initial DeviceTree for the related PMX65 PMIC. MSM8226 gained VADC and RTC support and support for the ASUS ZenWatch 2 was added. * tag 'qcom-dts-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (62 commits) ARM: dts: qcom: msm8974-FP2: Add supplies for remoteprocs ARM: dts: qcom: msm8974-FP2: Configure charger ARM: dts: qcom: msm8974-FP2: Add support for touchscreen ARM: dts: qcom: sdx55: Remove ipa interconnect node ARM: dts: qcom: msm8974: Add missing license headers ARM: dts: qcom: msm8974-FP2: Add mmc* aliases ARM: dts: qcom: msm8974-FP2: We're msm8974pro ARM: dts: qcom-msm8974*: Remove unnecessary include ARM: dts: qcom-msm8974-rhine: Add pstore node ARM: dts: qcom-msm8974-rhine: Add NFC and enable I2C hosts ARM: dts: qcom-msm8974*: Clean up old GPIO declarations ARM: dts: qcom-msm8974*: Consolidate I2C/UART/SDHCI ARM: dts: qcom-msm8974*: Enable IMEM unconditionally ARM: dts: qcom-msm8974: Sort and clean up nodes ARM: dts: qcom-msm8974: Convert ADSP to a MMIO device ARM: dts: qcom-msm8974pro-*: Use the 8974pro name in DT filenames ARM: dts: qcom-msm8974pro: Use &labels ARM: dts: qcom-msm8974-castor: Use &labels ARM: dts: qcom-msm8974-{"hon","am"}ami: Commonize and modernize the DTs ARM: dts: qcom-msm8974-klte: Use &labels ... Link: https://lore.kernel.org/r/20220509172125.313259-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 3f656f2618fb0a7fd1ae128628f2a7a789645642 Merge: 6e6962ffe2ea8 28e3dc8f8cd37 Author: Arnd Bergmann Date: Mon May 9 23:14:05 2022 +0200 Merge tag 'qcom-drivers-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for v5.19 This converts a wide range of Qualcomm-related DeviceTree bindings to YAML, in order to improve our ability to validate the DeviceTree source. The RPMh power-domain driver gains support for the modem platform SDX65, the compute platform SC8280XP and the automotive platform SA8540p. While LLCC gains support for SC8180X and SC8280XP and gains a MODULE_DEVICE_TABLE() to make it functional as a module. It adds a driver for configuring the SSC bus, providing Linux access to the hardware blocks in the sensor subsystem. The socinfo driver gets confusion related to MSM8974 Pro sorted out and adds new ids for SM8540 and SC7280. The SCM driver gains support for MSM8974. Add missing of_node_put() in smp2p and smsm drivers. Stop using iterator after list_for_each_entry() and define static definitions as such, in the PDR driver. * tag 'qcom-drivers-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (33 commits) soc: qcom: pdr: use static for servreg_* variables soc: qcom: llcc: Add sc8180x and sc8280xp configurations dt-bindings: arm: msm: Add sc8180x and sc8280xp LLCC compatibles soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains spi: dt-bindings: qcom,spi-geni-qcom: convert to dtschema soc: qcom: socinfo: Sort out 8974PRO names dt-bindings: soc: qcom,smp2p: convert to dtschema dt-bindings: qcom: geni-se: Update UART schema reference dt-bindings: qcom: geni-se: Update I2C schema reference dt-bindings: soc: qcom,rpmh-rsc: convert to dtschema bus: add driver for initializing the SSC bus on (some) qcom SoCs dt-bindings: bus: add device tree bindings for qcom,ssc-block-bus dt-bindings: qcom: qcom,geni-se: refer to dtschema for SPI dt-bindings: soc: qcom,smd: convert to dtschema firmware: qcom_scm: Add compatible for MSM8976 SoC dt-bindings: firmware: qcom-scm: Document msm8976 bindings soc: qcom: smem: validate fields of shared structures soc: qcom: smem: map only partitions used by local HOST ... Link: https://lore.kernel.org/r/20220509181839.316655-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 6e6962ffe2ea8019877bc1db04b6105a4b3026bb Merge: 2b6866d70db1e 54a85e09f44c5 Author: Arnd Bergmann Date: Mon May 9 23:12:49 2022 +0200 Merge tag 'memory-controller-drv-tegra-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.19 - Tegra SoC Add support for Tegra234 memory controller and for logging memory controller errors on Tegra186, Tegra194 and Tegra234. * tag 'memory-controller-drv-tegra-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: tegra: Add MC error logging on Tegra186 onward memory: tegra: Add memory controller channels support memory: tegra: Add APE memory clients for Tegra234 memory: tegra: Add Tegra234 support Link: https://lore.kernel.org/r/20220509160807.154187-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit d491db14df2f59257812551db64a46420d27062c Merge: d94d1486952b8 5889ccdd094ac Author: Mark Brown Date: Mon May 9 22:12:23 2022 +0100 ASoC: SOF: sof-client: Update for different IPC versions Merge series from Peter Ujfalusi : Hi, The current IPC client infrastructure can only be used with IPC3. This series carries updates for the core side of the client support to handle IPC4 messages and updates the ipc message injector to be usable with IPC4. The IPC flood test is only supported by SOF_IPC (IPC3), we are not going to create the aux device for it at all if the firmware is using IPC4. Regards, Peter --- Peter Ujfalusi (8): ASoC: SOF: sof-client: Add API to get the maximum IPC payload size ASoC: SOF: ipc-msg-injector: Query the maximum IPC payload size ASoC: SOF: sof-client-probes: Query the maximum IPC payload size ASoC: SOF: sof-client: Add API to get the ipc_type ASoC: SOF: sof-client: Add support IPC4 message sending ASoC: SOF: ipc-msg-injector: Separate the message sending ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages ASoC: SOF: sof-client: IPC flood test can only work with SOF_IPC sound/soc/sof/sof-client-ipc-msg-injector.c | 181 ++++++++++++++++++-- sound/soc/sof/sof-client-probes.c | 5 +- sound/soc/sof/sof-client.c | 66 ++++++- sound/soc/sof/sof-client.h | 2 + 4 files changed, 227 insertions(+), 27 deletions(-) -- 2.36.0 commit 2b6866d70db1e2f19c7f8a4e90d9544957f734e6 Merge: 1901300bf356a 7a0c5cb67166b Author: Arnd Bergmann Date: Mon May 9 23:10:47 2022 +0200 Merge tag 'imx-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX drivers update for 5.19: - A series from Lucas and Paul to update GPCv2 driver for i.MX8MP power domains, and add HSIO and HDMI block control support. * tag 'imx-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: fix semicolon.cocci warnings soc: imx: add i.MX8MP HDMI blk-ctrl soc: imx: imx8m-blk-ctrl: Add i.MX8MP media blk-ctrl soc: imx: add i.MX8MP HSIO blk-ctrl dt-bindings: power: imx8mp: add defines for HDMI blk-ctrl domains dt-bindings: soc: Add i.MX8MP media block control DT bindings soc: imx: imx8m-blk-ctrl: set power device name soc: imx: gpcv2: add support for i.MX8MP power domains soc: imx: gpcv2: add PGC control register indirection Link: https://lore.kernel.org/r/20220508033843.2773685-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 1901300bf356a74437117464e19fc5f278f88d9a Merge: 68edb53a4f4b5 2a21f9e6d9a40 Author: Arnd Bergmann Date: Mon May 9 23:09:09 2022 +0200 Merge tag 'ti-driver-soc-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/drivers TI Driver updates for v5.19 * wkup_m3: io isolation, voltage scaling, vtt regulator and a debug option to stop m3 in suspend. * tisci: support for polled mode for system suspend, reset driver is now enabled for COMPILE_TEST * knav, dma.. misc cleanups for IS_ERR, pm_run_time*, and various other fixups. * tag 'ti-driver-soc-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling soc: ti: wkup_m3_ipc: Add support for IO Isolation soc: ti: knav_qmss_queue: Use IS_ERR instead of IS_ERR_OR_NULL when checking knav_queue_open() result soc: ti: pm33xx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync firmware: ti_sci: Switch transport to polled mode during system suspend soc: ti: wkup_m3_ipc: Add support for toggling VTT regulator soc: ti: knav_qmss_queue: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync soc: ti: knav_dma: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync reset: ti-sci: Allow building under COMPILE_TEST soc: ti: ti_sci_pm_domains: Check for null return of devm_kcalloc soc: ti: omap_prm: Use of_device_get_match_data() soc: ti: pruss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync soc: ti: replace usage of found with dedicated list iterator variable soc: ti: wkup_m3_ipc: fix platform_get_irq.cocci warning Link: https://lore.kernel.org/r/20220507163424.pvqnwrxpoo73lmp2@debtless Signed-off-by: Arnd Bergmann commit 60166b3c6961560e2cf52f349b62b2194e77217f Merge: baf7cbbefbe80 9bc72e47d4630 Author: Arnd Bergmann Date: Mon May 9 23:07:41 2022 +0200 Merge tag 'hisi-armv7soc-for-5.19' of https://github.com/hisilicon/linux-hisi into arm/soc HiSilicon ARMv7 SoC updates for v5.19 - Add of_node_put to avoid the refcount leak * tag 'hisi-armv7soc-for-5.19' of https://github.com/hisilicon/linux-hisi: ARM: hisi: Add missing of_node_put after of_find_compatible_node Link: https://lore.kernel.org/r/62762DF0.30602@hisilicon.com Signed-off-by: Arnd Bergmann commit a2e8bbe07276d8d981d0a88db9c77944877706cf Merge: 0e33a258413e5 889b94dbc5539 Author: Arnd Bergmann Date: Mon May 9 23:06:44 2022 +0200 Merge tag 'qcom-defconfig-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM defconfig updates for v5.19 This enables the Qualcomm random number generator and hardware crypto drivers, as well as DebugFS support, in the qcom defconfig. * tag 'qcom-defconfig-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: qcom_defconfig: enable debug fs support ARM: qcom_defconfig: enable options for Qualcomm random number generator Link: https://lore.kernel.org/r/20220509182209.317208-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 0e33a258413e515702fa42081a728da336cb145a Merge: 1758da7f31cb1 ad1661b0c91d5 Author: Arnd Bergmann Date: Mon May 9 23:04:33 2022 +0200 Merge tag 'qcom-arm64-defconfig-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM64 defconfig updates for v5.19 This enables the GPI DMA driver, providing access to I2C and SPI controllers that are setup for shared ownership. The PCIe Gen2 PHY provides PCI support on the QCS405 platform, among others. The PMIC watchdog, concell and ADC5 ThermalMonitor drivers provides housekeeping services on a range of different platforms. The Display and Video clock controllers for SM8250 are enabled, as is the audio RX/TX macros and the WCD9335 audio codec driver. Lastly the Ath11k driver, used on a variety of modern boards and the FastRPC driver, which provides an interface for computational offloading on the Hexagon cores, are enabled. All drivers, except the SM8250 Display and Video clock controller drivers are enabled as modules. The two clock controllers provides power-domains and must be builtin to reduce the risk of probe deferral happening (and being ignored) after late initcall. * tag 'qcom-arm64-defconfig-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Enable Qualcomm GPI DMA Driver arm64: defconfig: Enable Qualcomm PCIe Gen2 PHY arm64: defconfig: Enable SM8250 video clock controller arm64: defconfig: Enable PM8916 watchdog driver arm64: defconfig: enable ath11k driver arm64: defconfig: Enable some Qualcomm drivers arm64: defconfig: reenable SM_DISPCC_8250 arm64: defconfig: enable wcd9335 codec as module arm64: defconfig: enable Qualcomm RX and TX macro for SM8250 audio Link: https://lore.kernel.org/r/20220509170158.311962-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 1758da7f31cb16fa0978f22c91f34cc5378fb8a0 Merge: 9bc4df1d8b91d 080d681bf3c64 Author: Arnd Bergmann Date: Mon May 9 23:03:39 2022 +0200 Merge tag 'imx-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/defconfig i.MX defconfig update for 5.19: - Enable the WM8524 codec driver as module in arm64 defconfig for audio support on imx8mn-evk board. - Enable the ADC part of the STMPE MFD in imx_v6_v7_defconfig, as the SoM Apalis/Colibri iMX6 use the ADC of a STMPE 811. * tag 'imx-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: defconfig: Enable the WM8524 codec driver ARM: imx_v6_v7_defconfig: Enable the ADC part of the STMPE MFD Link: https://lore.kernel.org/r/20220508033843.2773685-5-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 9bc4df1d8b91d8677a547d4d21fde7405e46a39c Merge: 553a4ee1c026f b7d8a9973374e Author: Arnd Bergmann Date: Mon May 9 23:01:00 2022 +0200 Merge tag 'ti-k3-config-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/defconfig TI K3 defconfig updates for v5.19 * Enable TIDSS and Display Port related configs * Enable Cadence Torrent PHY for Display Port * tag 'ti-k3-config-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: defconfig: Enable configs for DisplayPort on J721e Link: https://lore.kernel.org/r/88cd734e-47a7-4307-c119-8f6ec6c40452@ti.com Signed-off-by: Arnd Bergmann commit 07950008692bf22074020e927e95655cd48fdcda Author: Matthew Wilcox (Oracle) Date: Sun May 8 15:07:11 2022 -0400 mm/filemap: Hoist filler_t decision to the top of do_read_cache_folio() Now that filler_t and aops->read_folio() have the same type, we can decide which one to use at the top of the function, and cache ->read_folio in the filler parameter. Signed-off-by: Matthew Wilcox (Oracle) commit e9b5b23e957ef9260fec811d8d8081125889308a Author: Matthew Wilcox (Oracle) Date: Sun May 1 21:39:29 2022 -0400 fs: Change the type of filler_t By making filler_t the same as read_folio, we can use the same function for both in gfs2. We can push the use of folios down one more level in jffs2 and nfs. We also increase type safety for future users of the various read_cache_page() family of functions by forcing the parameter to be a pointer to struct file (or NULL). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Andreas Gruenbacher commit 6ece0a0452c97fe6cbdce1ff3069248d99f1b4aa Author: Matthew Wilcox (Oracle) Date: Sun May 1 19:39:03 2022 -0400 nfs: Pass the file pointer to nfs_symlink_filler() In preparation for unifying the read_cache_page() and read_folio() implementations, make nfs_symlink_filler() get the inode from the page instead of passing it in from read_cache_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 2294f9b8793d02b265423207e55ce5b26d8960cd Author: Matthew Wilcox (Oracle) Date: Sun May 1 19:39:03 2022 -0400 jffs2: Pass the file pointer to jffs2_do_readpage_unlock() In preparation for unifying the read_cache_page() and read_folio() implementations, make jffs2_do_readpage_unlock() get the inode from the page instead of passing it in from read_cache_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 7e0a126519b82648b254afcd95a168c15f65ea40 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:53:28 2022 -0400 mm,fs: Remove aops->readpage With all implementations of aops->readpage converted to aops->read_folio, we can stop checking whether it's set and remove the member from aops. Signed-off-by: Matthew Wilcox (Oracle) commit 0f312591d656c1d81bf2cf2a5642af478397a5dc Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:51:22 2022 -0400 mm: Convert swap_readpage to call read_folio instead of readpage This commit is split out so it can be dropped when resolving conflicts with Neil Brown's series to stop calling ->readpage in the swap code. Signed-off-by: Matthew Wilcox (Oracle) commit 4b4db9b4c7269a9a78cd3b334254c89c564f0636 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 vboxsf: Convert vboxsf to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 0c698cc5e61a208aae82d7dff7b0f4dc81abdb0e Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 udf: Convert adinicb and symlinks to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 0b7bf4830a3031db538cb2d0ecc0e920572caec0 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 ubifs: Convert ubifs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 124cfc154f6cfb530bfb36e7728406c56ebf37ad Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 squashfs: Convert squashfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit f91dbd02224bb2bc5243b756f2ff72419c42aca3 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 romfs: Convert romfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 1a6417885b102ccbd8b5d27d1f7714683b118f25 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 orangefs: Convert orangefs to read_folio This is a full conversion which should be large folio ready, although I have not tested it. Signed-off-by: Matthew Wilcox (Oracle) commit bb9263fc14353e7576330d97ae79f11cc47b087b Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 ocfs2: Convert ocfs2 to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 933906f8e8e4110c56db9bddd1281e4e4983a2bb Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 ntfs: Convert ntfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 65d023af7f29eb1250a6105141a74776bae7e1f8 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 nfs: Convert nfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit bb8e283a6479d2308d6938c71f1a4d4b3165660c Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 jfs: Convert metadata pages to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 75a47803b8e118a2af4f9498acd40d9b4d4b0dff Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 jffs2: Convert jffs2 to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 551cb124b1bc52b39607940caa0e84524d1100f8 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 isofs: Convert symlinks and zisofs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit cc14d240267042fe3fb09ffc8412f8ef8f2f1cd0 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 hpfs: Convert symlinks to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 8f4fe249a671f1e3abbab76b14096d0ebda1aa75 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 hostfs: Convert hostfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 5efd00e4899e0a9b294b435d7c7bf53f42343e99 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 fuse: Convert fuse to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 42d7a524e9ee13f6ea8b1539a293a365db2ba2f5 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 freevxfs: Convert vxfs_immed to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit be05584f0670a572ea9ecd949403363f5f392c29 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 f2fs: Convert f2fs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit fe5ddf6b21c7b9b2c6e29ef6fd38d827ced55e6e Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 ext4: Convert ext4 to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit a2e20a25a1470ebf33b270197fca8d3cab728f07 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 erofs: Convert erofs zdata to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 356d9fbb090ef0b49af27a278d667071fa99b217 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 efs: Convert efs symlinks to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 025e65c3438ecf677348b7b6ad87758e05f8daf4 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 ecryptfs: Convert ecryptfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 5aab331ad68f7cad432f350c6b28f0b5a9c777fc Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 cramfs: Convert cramfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit 65c0d259cb1721c49387f1db97245d5228616a16 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 coda: Convert coda to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit ce3bb0d2cb60fbfcd5e27d489e13e6ed7a4a7dfe Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 cifs: Convert cifs to read_folio This is a "weak" conversion which converts straight back to using pages. CIFS should probably be converted to use netfs_read_folio() by someone familiar with it. Signed-off-by: Matthew Wilcox (Oracle) commit fb12489b0dfd0028dc504575f3fae0532c412cf4 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 btrfs: Convert btrfs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit a13fe6928ae269b70fb15bd0fafe9ce1151a9332 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 befs: Convert befs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit d7e0f539d85fd673bd5e8ec388b7468ff41fe1f0 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:17:40 2022 -0400 afs: Convert afs_symlink_readpage to afs_symlink_read_folio This function mostly used folios already, and only a few minor changes were needed. Signed-off-by: Matthew Wilcox (Oracle) commit 1b6f3c8731e9550317a66117a197572c86b0e1c3 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:12:16 2022 -0400 affs: Convert affs to read_folio This is a "weak" conversion which converts straight back to using pages. A full conversion should be performed at some point, hopefully by someone familiar with the filesystem. Signed-off-by: Matthew Wilcox (Oracle) commit a77f580a2d4645ee0bec8679c377900b95863260 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:49:41 2022 -0400 fs: Convert simple_readpage to simple_read_folio This is a full folio conversion; it is prepared to handle folios of arbitrary size. Signed-off-by: Matthew Wilcox (Oracle) commit f132ab7d3ab03c5bae28d31fb80ba77c4da05500 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 11:47:39 2022 -0400 fs: Convert mpage_readpage to mpage_read_folio mpage_readpage still works in terms of pages, and has not been audited for correctness with large folios, so include an assertion that the filesystem is not passing it large folios. Convert all the filesystems to call mpage_read_folio() instead of mpage_readpage(). Signed-off-by: Matthew Wilcox (Oracle) commit 2c69e2057962b6bd76d72446453862eb59325b49 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 10:40:40 2022 -0400 fs: Convert block_read_full_page() to block_read_full_folio() This function is NOT converted to handle large folios, so include an assert that the filesystem isn't passing one in. Otherwise, use the folio functions instead of the page functions, where they exist. Convert all filesystems which use block_read_full_page(). Signed-off-by: Matthew Wilcox (Oracle) commit 7479c505b4ab5ed5f81f35fdd68c44c58d6f0439 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 08:54:32 2022 -0400 fs: Convert iomap_readpage to iomap_read_folio A straightforward conversion as iomap_readpage already worked in folios. Signed-off-by: Matthew Wilcox (Oracle) commit 6c62371b7fd77628feb5b806bc29433caecedff8 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 08:49:28 2022 -0400 fs: Convert netfs_readpage to netfs_read_folio This is straightforward because netfs already worked in terms of folios. Signed-off-by: Matthew Wilcox (Oracle) commit 08830c8bc6cc7047d2cc8a136849a15fcb977044 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 08:45:43 2022 -0400 fs: Add read_folio documentation Convert all the ->readpage documentation to ->read_folio. Signed-off-by: Matthew Wilcox (Oracle) commit 5efe7448a1426250b5747c10ad438517f44f1e51 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 08:43:23 2022 -0400 fs: Introduce aops->read_folio Change all the callers of ->readpage to call ->read_folio in preference, if it exists. This is a transitional duplication, and will be removed by the end of the series. Signed-off-by: Matthew Wilcox (Oracle) commit d254c3699fddb671bc555f042c96ec033582ae72 Author: Guo Zhengkui Date: Thu May 5 00:28:26 2022 +0800 dm cache metadata: remove unnecessary variable in __dump_mapping Fix the following coccicheck warning: drivers/md/dm-cache-metadata.c:1512:5-6: Unneeded variable: "r". Return "0" on line 1520. Signed-off-by: Guo Zhengkui Signed-off-by: Mike Snitzer commit c06dfd124d46df9c482fbd1319b5fe19bcb1a110 Author: Gabriel Krisman Bertazi Date: Wed Apr 27 12:57:10 2022 -0400 dm mpath: provide high-resolution timer to HST for bio-based The precision loss of reading IO start_time with jiffies_to_nsecs instead of using a high resolution timer degrades HST path prediction for BIO-based mpath on high load workloads. Below, I show the utilization percentage of a 10 disk multipath with asymmetrical disk access cost, while being exercised by a randwrite FIO benchmark with high submission queue depth (depth=64). It is possible to see that the HST path selection degrades heavily for high-iops in BIO-mpath, underutilizing the slower paths way beyond expected. This seems to be caused by the start_time truncation, which makes some IO to seem much slower than it actually is. In this scenario ST outperforms HST for bio-mpath, but not for mq-mpath, which already uses ktime_get_ns(). The third column shows utilization with this patch applied. It is easy to see that now HST prediction is much closer to the ideal distribution (calculated considering the real cost of each path). | | ST | HST (orig) | HST(ktime) | Best | | sdd | 0.17 | 0.20 | 0.17 | 0.18 | | sde | 0.17 | 0.20 | 0.17 | 0.18 | | sdf | 0.17 | 0.20 | 0.17 | 0.18 | | sdg | 0.06 | 0.00 | 0.06 | 0.04 | | sdh | 0.03 | 0.00 | 0.03 | 0.02 | | sdi | 0.03 | 0.00 | 0.03 | 0.02 | | sdj | 0.02 | 0.00 | 0.01 | 0.01 | | sdk | 0.02 | 0.00 | 0.01 | 0.01 | | sdl | 0.17 | 0.20 | 0.17 | 0.18 | | sdm | 0.17 | 0.20 | 0.17 | 0.18 | This issue was originally discussed [1] when we first merged HST, and this patch was left as a low hanging fruit to be solved later. Regarding the implementation, as suggested by Mike in that mail thread, in order to avoid the overhead of ktime_get_ns for other selectors, this patch adds a flag for the selector code to request the high-resolution timer. I tested this using the same benchmark used in the original HST submission. Full test and benchmark scripts are available here: https://people.collabora.com/~krisman/HST-BIO-MPATH/ [1] https://lore.kernel.org/lkml/85tv0am9de.fsf@collabora.com/T/ Signed-off-by: Gabriel Krisman Bertazi [snitzer: cleaned up various implementation details] Signed-off-by: Mike Snitzer commit d94d1486952b860dcedd04d0ff8ade2176418905 Author: Nícolas F. R. A. Prado Date: Mon May 9 14:56:25 2022 -0400 ASoC: dt-bindings: mediatek: mt8192: Drop i2s-share properties This reverts commit e056cf4341 ("ASoC: dt-bindings: mediatek: mt8192: Add i2s-share properties") which was merged while the property name and definition were still being discussed. Revert the commit for now and a follow up commit will re-add the property after it is further discussed and reviewed. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220509185625.580811-1-nfraprado@collabora.com Signed-off-by: Mark Brown commit e813526e5535ab009e2550e1da63abf297e1af68 Author: Peter Ujfalusi Date: Fri May 6 16:02:29 2022 +0300 ASoC: SOF: trace: The dtrace is only available with SOF_IPC Currently the dtrace only supported with SOF_IPC. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220506130229.23354-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 29f4078f777fed4cb47695b284938fbfd80f990e Author: Mark Brown Date: Fri May 6 14:03:49 2022 +0100 ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card() Log the error code when snd_soc_regster_card() fails, but fold in the silencing of deferred probe errors. Signed-off-by: Mark Brown Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220506130349.451452-1-broonie@kernel.org commit 0e63a2be5651e2b34e5c2505992e58be0e9c4bb1 Author: YueHaibing Date: Mon May 9 20:09:18 2022 +0800 ASoC: mediatek: mt8195: Fix build warning without CONFIG_OF sound/soc/mediatek/mt8195/mt8195-mt6359.c:1639:32: warning: ‘mt8195_mt6359_max98390_rt5682_card’ defined but not used [-Wunused-variable] 1639 | static struct mt8195_card_data mt8195_mt6359_max98390_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/mediatek/mt8195/mt8195-mt6359.c:1634:32: warning: ‘mt8195_mt6359_rt1011_rt5682_card’ defined but not used [-Wunused-variable] 1634 | static struct mt8195_card_data mt8195_mt6359_rt1011_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/mediatek/mt8195/mt8195-mt6359.c:1629:32: warning: ‘mt8195_mt6359_rt1019_rt5682_card’ defined but not used [-Wunused-variable] 1629 | static struct mt8195_card_data mt8195_mt6359_rt1019_rt5682_card = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since all users of this driver do need CONFIG_OF anyway, there is no need to save a few bytes on kernel builds while CONFIG_OF disabled, so just remove the #ifdef to fix this warning. Fixes: 86a6b9c9dfff ("ASoC: mediatek: mt8195: add machine support for max98390 and rt5682") Signed-off-by: YueHaibing Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220509120918.9000-1-yuehaibing@huawei.com Signed-off-by: Mark Brown commit 3a3610aaa9dce8ef1257bb42ac7f0fe2b5809a54 Author: Lukasz Majewski Date: Mon May 9 14:10:55 2022 +0200 ASoC: wm8940: add devicetree support This adds devicetree support to the wm8940 codec driver. With a DT-based kernel, there is no board-specific setting to select the driver so allow it to be manually chosen. Signed-off-by: Lukasz Majewski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220509121055.31103-1-lukma@denx.de Signed-off-by: Mark Brown commit 29e87c4f62e2e688c1c91da9f8d54d0f042cb75e Author: Lukasz Majewski Date: Mon May 9 14:13:13 2022 +0200 doc: dts: Add device tree information regarding wm8940 codec This commit provides documentation entry for wm8940 codec. Signed-off-by: Lukasz Majewski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220509121313.31216-1-lukma@denx.de Signed-off-by: Mark Brown commit 184434fcd6177b76f929570348935d7c9f22d296 Author: Marc Kleine-Budde Date: Mon May 2 19:54:57 2022 +0200 spi: spi-imx: mx51_ecspi_prepare_message(): skip writing MX51_ECSPI_CONFIG register if unchanged In mx51_ecspi_prepare_message() the MX51_ECSPI_CONFIG register is setup for the current spi_message. After writing the register, there is a delay to ensure that the changes hit the hardware. This patch checks if the register MX51_ECSPI_CONFIG actually needs to be changed. If the register content is unchanged the function is left early, skipping the write to the hardware and the delay. This leads to a small, but measurable performance increase. For a given workload with small transfers on an imx6 single core the CPU load decreases from 30% to ~27%. Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-10-mkl@pengutronix.de Signed-off-by: Mark Brown commit 07e7593877882fbd07c55b26b7dcf88760449323 Author: Marc Kleine-Budde Date: Mon May 2 19:54:56 2022 +0200 spi: spi-imx: add PIO polling support The driver supports several modes, one of them is PIO/IRQ "spi_imx_pio_transfer()". The data is exchanged with the IP core using PIO, an IRQ is setup to signal empty/full FIFOs and the end of the transfer. The IRQ and scheduling overhead for short transfers is significant. Using polling instead of IRQs can be beneficial to reduce the overall CPU load, especially on small transfer workloads. On an imx6 single core, a given RX workload of the mcp251xfd driver results in 40% CPU load. Using polling mode reduces the CPU load to 30%. This patch adds PIO polling support to the driver. For transfers with a duration of less than 30 µs the polling mode instead of IRQ based PIO mode is used. 30 µs seems to be a good compromise, which is used the by the SPI drivers for the raspberry Pi (spi-bcm2835, spi-bcm2835), too. Co-developed-by: David Jander Signed-off-by: David Jander Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-9-mkl@pengutronix.de Signed-off-by: Mark Brown commit 307c897db762d1e0feee9477276b08f6deca4a5b Author: Marc Kleine-Budde Date: Mon May 2 19:54:55 2022 +0200 spi: spi-imx: replace struct spi_imx_data::bitbang by pointer to struct spi_controller There's no need to embed the struct spi_bitbang into our private data (struct spi_imx_data), the spi core is flexible enough, so that we only need a pointer to the allocated struct spi_controller. This is also a preparation patch to add PIO based polling support to the driver. Co-developed-by: David Jander Signed-off-by: David Jander Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-8-mkl@pengutronix.de Signed-off-by: Mark Brown commit 63cd96b70f9366f67048fbc07294ce5823001ded Author: Marc Kleine-Budde Date: Mon May 2 19:54:54 2022 +0200 spi: spi-imx: complete conversion from master -> controller With patch: | 8caab75fd2c2 ("spi: Generalize SPI "master" to "controller"") the SPI "master" was generalized to "controller". This patch completed the conversion of the spi-imx driver by replacing the remaining occurrences of master to controller. Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-7-mkl@pengutronix.de Signed-off-by: Mark Brown commit baaadffe8854ea14eed1a5f3c09f2136c3aa4427 Author: Marc Kleine-Budde Date: Mon May 2 19:54:53 2022 +0200 spi: spi-imx: spi_imx_buf_rx_swap_u32(): replace open coded swahw32s() This patch replaces an open coded swahw32s(). Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-6-mkl@pengutronix.de Signed-off-by: Mark Brown commit dae336d0dca669143e0fdf6b82c333bf6a8d9e0a Author: Marc Kleine-Budde Date: Mon May 2 19:54:52 2022 +0200 spi: spi-imx: spi_imx_buf_rx_swap_u32(): fix sparse warning: use swab32s() instead of cpu_to_be32() This patch fixes the following sparse warning by using a swab32s() instead of a cpu_to_be32(). The driver is used on little endian systems only and we really want to swap the bytes. | drivers/spi/spi-imx.c:305:29: warning: incorrect type in assignment (different base types) | drivers/spi/spi-imx.c:305:29: expected unsigned int val | drivers/spi/spi-imx.c:305:29: got restricted __be32 [usertype] | drivers/spi/spi-imx.c:361:21: warning: incorrect type in assignment (different base types) | drivers/spi/spi-imx.c:361:21: expected unsigned int [assigned] [usertype] val | drivers/spi/spi-imx.c:361:21: got restricted __be32 [usertype] Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-5-mkl@pengutronix.de Signed-off-by: Mark Brown commit 1a23461a8a08c4a32972dec31a394eee3302511d Author: Marc Kleine-Budde Date: Mon May 2 19:54:51 2022 +0200 spi: spi-imx: mx51_ecspi_intctrl(): prefer 'unsigned int' to bare use of 'unsigned' This patch fixes the following checkpatch warning, by making val an "unsigned int". | WARNING: Prefer 'unsigned int' to bare use of 'unsigned' | + unsigned val = 0; Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-4-mkl@pengutronix.de Signed-off-by: Mark Brown commit a8c785c1e75538876b524247a3738db53b1f78b8 Author: Marc Kleine-Budde Date: Mon May 2 19:54:50 2022 +0200 spi: spi-imx: avoid unnecessary line continuations This patch fixes the following checkpatch warning by removing the trailing backslash: | WARNING: Avoid unnecessary line continuations | + spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \ Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-3-mkl@pengutronix.de Signed-off-by: Mark Brown commit f7b8787164551a09fca287b1dea15d0c4d646e4a Author: Marc Kleine-Budde Date: Mon May 2 19:54:49 2022 +0200 spi: spi-imx: fix sparse warning: add identifier name to function definition This patch fixes the following and similar sparse warnings by adding the missing identifier names to the function definitions: | WARNING: function definition argument 'struct spi_imx_data *' should also have an identifier name | #68: FILE: drivers/spi/spi-imx.c:68: | + int (*prepare_message)(struct spi_imx_data *, struct spi_message *); Signed-off-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220502175457.1977983-2-mkl@pengutronix.de Signed-off-by: Mark Brown commit 5889ccdd094ac32ee52851fc9eccd124897daf2b Author: Peter Ujfalusi Date: Fri May 6 16:26:47 2022 +0300 ASoC: SOF: sof-client: IPC flood test can only work with SOF_IPC Currently the ipc flood test is only supported with SOF_IPC. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220506132647.18690-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 066c67624d8ca2a2465690d4a7b7f52b880e9925 Author: Peter Ujfalusi Date: Fri May 6 16:26:46 2022 +0300 ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages The IPC message representation of an IPC4 differs from the IPC3 version significantly. The message for IPC4 should be written to the debugfs file in this form: 0-7 IPC4 header (2x u32) 8- additional payload, if any The reply is given back in the same form. The message size limitation is the same as with the IPC3, only messages which can fit to the mailbox can be injected (and received). Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a9aa3381e404abae3dd8c37b7c845415b56f0305 Author: Peter Ujfalusi Date: Fri May 6 16:26:45 2022 +0300 ASoC: SOF: ipc-msg-injector: Separate the message sending Move out the code for sending the IPC message into a separate helper function in preparation for support for handling IPC4 communication. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 100c9374318f881c3083573af9dc76afa229fd23 Author: Peter Ujfalusi Date: Fri May 6 16:26:44 2022 +0300 ASoC: SOF: sof-client: Add support IPC4 message sending In order to be able to send an IPC4 message, the sof_client_ipc_tx_message() needs to parse the tx message differently to extract the size. The IPC notification registration is done by providing the notification type and the whole message is passed to the client when a match is found. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit cdf8233d2cd2e55c8bc409e5b4fbdb181a1dea2b Author: Peter Ujfalusi Date: Fri May 6 16:26:43 2022 +0300 ASoC: SOF: sof-client: Add API to get the ipc_type Provide a way for the client drivers to query the ipc_type used by the firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a1e5bbc8ea6ae6e0fa1bd42f2ef810b13d9ec066 Author: Peter Ujfalusi Date: Fri May 6 16:26:42 2022 +0300 ASoC: SOF: sof-client-probes: Query the maximum IPC payload size Instead of using the SOF_IPC_MSG_MAX_SIZE as the maximum payload size for and IPC message, use the provided API to query it. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ef368c3347fe79a4193317b130b02064801920d7 Author: Peter Ujfalusi Date: Fri May 6 16:26:41 2022 +0300 ASoC: SOF: ipc-msg-injector: Query the maximum IPC payload size Instead of using the SOF_IPC_MSG_MAX_SIZE as the maximum payload size for and IPC message, use the provided API to query it. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a669ec5f4bc485a56b2f379e7c7197a810872cc1 Author: Peter Ujfalusi Date: Fri May 6 16:26:40 2022 +0300 ASoC: SOF: sof-client: Add API to get the maximum IPC payload size Provide a way for the client drivers to query the maximum payload size of an IPC message. Currently clients do not have access to this information and they can only use the SOF_IPC_MSG_MAX_SIZE defined value. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220506132647.18690-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b11b3d21a94d66bc05d1142e0b210bfa316c62be Author: Konrad Dybcio Date: Sat Apr 30 18:37:52 2022 +0200 regulator: qcom_smd: Fix up PM8950 regulator configuration Following changes have been made: - S5, L4, L18, L20 and L21 were removed (S5 is managed by SPMI, whereas the rest seems not to exist [or at least it's blocked by Sony Loire /MSM8956/ RPM firmware]) - Supply maps have were adjusted to reflect regulator changes. Fixes: e44adca5fa25 ("regulator: qcom_smd: Add PM8950 regulators") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20220430163753.609909-1-konrad.dybcio@somainline.org Signed-off-by: Mark Brown commit 17770e66a7cc51667ddcdf31a4ed55210f30dc1e Merge: 5cb3bdd6bdcda 0adccaf1eac91 Author: Mark Brown Date: Mon May 9 18:16:54 2022 +0100 Add missing dt-binding properties for audio components on mt8192-asurada Merge series from Nícolas F. R. A. Prado : These patches add properties that were missing on the dt-bindings of the audio components used by mt8192-asurada. Namely the i2s-share properties for the sound platform and the #sound-dai-cells on the rt1015p and rt5682 codecs when they're referenced by the machine sound node. Nícolas F. R. A. Prado (3): ASoC: dt-bindings: mediatek: mt8192: Add i2s-share properties ASoC: dt-bindings: rt1015p: Add #sound-dai-cells ASoC: dt-bindings: rt5682: Add #sound-dai-cells Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml | 5 +++++ Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml | 3 +++ Documentation/devicetree/bindings/sound/rt5682.txt | 2 ++ 3 files changed, 10 insertions(+) -- 2.36.0 commit 85f0e42bd65d01b351d561efb38e584d4c596553 Author: Viresh Kumar Date: Mon May 9 09:27:37 2022 +0530 Revert "cpufreq: Fix possible race in cpufreq online error path" This reverts commit f346e96267cd76175d6c201b40f770c0116a8a04. The commit tried to fix a possible real bug but it made it even worse. The fix was simply buggy as now an error out to out_offline_policy or out_exit_policy will try to release a semaphore which was never taken in the first place. This works fine only if we failed late, i.e. via out_destroy_policy. Fixes: f346e96267cd ("cpufreq: Fix possible race in cpufreq online error path") Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 52bf4b7147e5a0446ec5bdfe92106f0e16bf281f Merge: 0f6983509ea12 5dc4630426511 Author: Rob Herring Date: Mon May 9 11:50:27 2022 -0500 Merge branch 'dt/linus' into dt/next Pick up new meta-schema fixes. commit 567dd8f34560fa221a6343729474536aa7ede4fd Author: Mikulas Patocka Date: Mon Apr 25 08:53:29 2022 -0400 dm crypt: make printing of the key constant-time The device mapper dm-crypt target is using scnprintf("%02x", cc->key[i]) to report the current key to userspace. However, this is not a constant-time operation and it may leak information about the key via timing, via cache access patterns or via the branch predictor. Change dm-crypt's key printing to use "%c" instead of "%02x". Also introduce hex2asc() that carefully avoids any branching or memory accesses when converting a number in the range 0 ... 15 to an ascii character. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Tested-by: Milan Broz Signed-off-by: Mike Snitzer commit 2e42b7f817acd6e8d78226445eb6fe44fe79c12a Author: Jaegeuk Kim Date: Fri May 6 14:17:32 2022 -0700 f2fs: stop allocating pinned sections if EAGAIN happens EAGAIN doesn't guarantee to have a free section. Let's report it. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2880f47b949f1f49e2d861ffbba91d57416be7d9 Author: Weichao Guo Date: Sat May 7 00:28:14 2022 +0800 f2fs: skip GC if possible when checkpoint disabling If the number of unusable blocks is not larger than unusable capacity, we can skip GC when checkpoint disabling. Signed-off-by: Weichao Guo Signed-off-by: Chao Yu [Jaegeuk Kim: Fix missing gc_mode assignment] Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d3f2a14b8906df913cb04a706367b012db94a6e8 Author: Dan Carpenter Date: Mon Apr 25 14:56:48 2022 +0300 dm integrity: fix error code in dm_integrity_ctr() The "r" variable shadows an earlier "r" that has function scope. It means that we accidentally return success instead of an error code. Smatch has a warning for this: drivers/md/dm-integrity.c:4503 dm_integrity_ctr() warn: missing error code 'r' Fixes: 7eada909bfd7 ("dm: add integrity target") Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit bfe2b0146c4d0230b68f5c71a64380ff8d361f8b Author: Mikulas Patocka Date: Sun Apr 24 16:43:00 2022 -0400 dm stats: add cond_resched when looping over entries dm-stats can be used with a very large number of entries (it is only limited by 1/4 of total system memory), so add rescheduling points to the loops that iterate over the entries. Cc: stable@vger.kernel.org Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 0f6983509ea126e41b8cfd17bc490cba0df58728 Author: Andre Przywara Date: Fri May 6 15:05:33 2022 +0100 dt-bindings: display: convert Arm Komeda to DT schema The Arm Komeda (aka Mali-D71) is a display controller that scans out a framebuffer and hands a signal to a digital encoder to generate a DVI or HDMI signal. It supports up to two pipelines, each frame can be composed of up to four layers. Convert the existing DT binding to DT schema. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-12-andre.przywara@arm.com commit 2c8b082a3ab1f4f0b5a2cd8f7f0460b909545be9 Author: Andre Przywara Date: Fri May 6 15:05:32 2022 +0100 dt-bindings: display: convert Arm Mali-DP to DT schema The Arm Mali Display Processor (DP) 5xx/6xx is a series of IP that scans out a framebuffer and hands the pixels over to a digital signal encoder. It supports multiple layers, scaling and rotation. Convert the existing DT binding to DT schema. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-11-andre.przywara@arm.com commit 36fd2a65bcafb7cc3014d06c7b1335eb746e09c8 Author: Andre Przywara Date: Fri May 6 15:05:31 2022 +0100 dt-bindings: display: convert Arm HDLCD to DT schema The Arm HDLCD is a display controller that scans out a framebuffer and hands a signal to a digital encoder to generate a DVI or HDMI signal. Convert the existing DT binding to DT schema. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-10-andre.przywara@arm.com commit 3f7e3653c1248a13fd36a84f63beb06d6e97358f Author: Andre Przywara Date: Fri May 6 15:05:30 2022 +0100 dt-bindings: display: convert PL110/PL111 to DT schema The Arm PL110 and PL111 are IP blocks that provide a display engine with an LCD interface, being able to drive a variety of LC panels. Convert the binding over to DT schema, to the DTs can be automatically checked. This still contains the deprecated "arm,pl11x,tft-r0g0b0-pads" property, because this is used by several DTs in the tree. Signed-off-by: Andre Przywara [robh: make interrupts optional (not connected on Realview EB)] Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-9-andre.przywara@arm.com commit 7e8339b5162fb193a89e537e7a2ce4ad471e8a6e Author: Andre Przywara Date: Fri May 6 15:05:29 2022 +0100 dt-bindings: arm: convert vexpress-config to DT schema The Arm Versatile Express system features a bridge device that provides access to various smaller devices like clocks, reset gates and various sensors. Extract the second half of the informal vexpress-sysreg.txt binding and make it proper DT schema compliant. This makes the old .txt binding redundant, so remove it. This describes both the actual parent configuration bridge, as well as all the possible children devices. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-8-andre.przywara@arm.com commit 47db321666cb88e1add876535da8aeb4e6c3a8dd Author: Andre Przywara Date: Fri May 6 15:05:28 2022 +0100 dt-bindings: arm: convert vexpress-sysregs to DT schema The Arm Versatile Express system control register block provides GPIO functionality to some devices and is also used for board identification. Extract the first half of the informal vexpress-sysreg.txt binding and make it proper DT schema compliant. Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-7-andre.przywara@arm.com commit 97ef3551fb9cb2313806e865eca53ab09d1803c6 Author: Andre Przywara Date: Fri May 6 15:05:27 2022 +0100 dt-bindings: serio: add Arm PL050 DT schema The Arm PL050 "Keyboard/Mouse Interface" is an Arm system IP providing a PS/2 compatible serial interface. Add a simple DT schema binding, based on the TRM[1], the existing DTs and the Linux driver. [1] https://developer.arm.com/documentation/ddi0143/latest Signed-off-by: Andre Przywara Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-6-andre.przywara@arm.com commit b85593476ec497dc246ea9142433d9ea7b24f65d Author: Andre Przywara Date: Fri May 6 15:05:26 2022 +0100 dt-bindings: sound: add Arm PL041 AACI DT schema The Arm PrimeCell Advanced Audio CODEC Interface (AACI aka PL041) is a peripheral that provides communication with an audio CODEC. Add a simple DT schema binding for it, so that DTs can be validated automatically. Signed-off-by: Andre Przywara Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-5-andre.przywara@arm.com commit f7187a02f1f9ec22cf7d4400cf35f1a0f687acbf Author: Andre Przywara Date: Fri May 6 15:05:25 2022 +0100 dt-bindings: arm: sp810: convert to DT schema The Arm SP810 IP is a "system controller", providing clocks, timer and a watchdog. Convert the DT binding to DT schema, to allow automatic validation. The existing .txt binding described all properties as required, but the assigned-clock* and clock-output-names are actually not (from a hardware perspective). The only existing driver I could find (in Linux) doesn't require them either, so drop those properties from the "required" list. Signed-off-by: Andre Przywara Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-4-andre.przywara@arm.com commit b25bccb697798242e87ce36979f1d0b7ff0875be Author: Andre Przywara Date: Fri May 6 15:05:24 2022 +0100 dt-bindings: arm: spe-pmu: convert to DT schema Convert the Arm Statisical Profiling Extension (SPE) binding to DT schema. Not much to see here, basically just the announcement that SPE is integrated on the system level and where the IRQ is routed to. Move it into the more suitable perf/ directory on the way. Signed-off-by: Andre Przywara Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-3-andre.przywara@arm.com commit e4783856a2e8e41c679fd818afc912904d4088ba Author: Andre Przywara Date: Fri May 6 15:05:23 2022 +0100 dt-bindings: iommu: arm,smmu-v3: make PRI IRQ optional The Page Request Interface (PRI) is an optional PCIe feature. As such, a SMMU would not need to handle it if the PCIe host bridge or the SMMU itself do not implement it. Also an SMMU could be connected to a platform device, without any PRI functionality whatsoever. In all cases there would be no SMMU PRI queue interrupt to be wired up to an interrupt controller. At the moment, with the "eventq,gerror,priq,cmdq-sync" order, we would need to sacrifice the command queue sync interrupt as well, which might not be desired. Relax the binding to allow specifying certain useful combinations of wired interrupts, for instance just the "gerror" interrupt, or omitting both "pri" and "cmdq-sync". Signed-off-by: Andre Przywara Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220506140533.3566431-2-andre.przywara@arm.com commit be1de12cb6738929b711094e228da439492a4b91 Author: Arnaud Pouliquen Date: Thu May 5 13:36:39 2022 +0200 dt-bindings: remoteproc: st,stm32-rproc: Fix phandle-array parameters description Replace the FIXME by appropriate description. Fixes: 39bd2b6a3783 ("dt-bindings: Improve phandle-array schemas") Signed-off-by: Arnaud Pouliquen Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220505113639.1344281-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 9222fabf0e39d281de65e908b94f4331eab556a2 Author: Peng Fan Date: Fri Apr 29 08:53:46 2022 +0800 remoteproc: imx_rproc: Support i.MX93 i.MX93 features a Cortex-M33 core which could be kicked by ROM/Bootloader /Linux. Similar with i.MX8MN/P, we use SMC to trap into Arm Trusted Firmware to start/stop the M33 core. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220429005346.2108279-3-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit fcb24583509f843b1b4025761552dd64aa9f8b96 Author: Peng Fan Date: Fri Apr 29 08:53:45 2022 +0800 dt-bindings: remoteproc: imx_rproc: Support i.MX93 Add i.MX93 remote processor(Cortex-M33) compatible string, and reorder the strings in alphabetical order. Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429005346.2108279-2-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 7b3a06382442c4d83c9d35253638cb3f561da9b9 Author: Andrii Nakryiko Date: Sun May 8 17:41:48 2022 -0700 selftests/bpf: Test libbpf's ringbuf size fix up logic Make sure we always excercise libbpf's ringbuf map size adjustment logic by specifying non-zero size that's definitely not a page size multiple. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-10-andrii@kernel.org commit 0087a681fa8c22f719a567317e8f8f894d734b9c Author: Andrii Nakryiko Date: Sun May 8 17:41:47 2022 -0700 libbpf: Automatically fix up BPF_MAP_TYPE_RINGBUF size, if necessary Kernel imposes a pretty particular restriction on ringbuf map size. It has to be a power-of-2 multiple of page size. While generally this isn't hard for user to satisfy, sometimes it's impossible to do this declaratively in BPF source code or just plain inconvenient to do at runtime. One such example might be BPF libraries that are supposed to work on different architectures, which might not agree on what the common page size is. Let libbpf find the right size for user instead, if it turns out to not satisfy kernel requirements. If user didn't set size at all, that's most probably a mistake so don't upsize such zero size to one full page, though. Also we need to be careful about not overflowing __u32 max_entries. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-9-andrii@kernel.org commit f760d0537925e2973ed3adc2e590aa2968d0e8dc Author: Andrii Nakryiko Date: Sun May 8 17:41:46 2022 -0700 libbpf: Provide barrier() and barrier_var() in bpf_helpers.h Add barrier() and barrier_var() macros into bpf_helpers.h to be used by end users. While a bit advanced and specialized instruments, they are sometimes indispensable. Instead of requiring each user to figure out exact asm volatile incantations for themselves, provide them from bpf_helpers.h. Also remove conflicting definitions from selftests. Some tests rely on barrier_var() definition being nothing, those will still work as libbpf does the #ifndef/#endif guarding for barrier() and barrier_var(), allowing users to redefine them, if necessary. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-8-andrii@kernel.org commit 785c3342cf6c520250258d8d7bc0cae1d4461dc8 Author: Andrii Nakryiko Date: Sun May 8 17:41:45 2022 -0700 selftests/bpf: Add bpf_core_field_offset() tests Add test cases for bpf_core_field_offset() helper. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-7-andrii@kernel.org commit 7715f549a9d80a82428a7925fa4a00518c53c35c Author: Andrii Nakryiko Date: Sun May 8 17:41:44 2022 -0700 libbpf: Complete field-based CO-RE helpers with field offset helper Add bpf_core_field_offset() helper to complete field-based CO-RE helpers. This helper can be useful for feature-detection and for some more advanced cases of field reading (e.g., reading flexible array members). Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-6-andrii@kernel.org commit 2a4ca46b7d2a6f7ba7359e8d7fafe9ad378fa18e Author: Andrii Nakryiko Date: Sun May 8 17:41:43 2022 -0700 selftests/bpf: Use both syntaxes for field-based CO-RE helpers Excercise both supported forms of bpf_core_field_exists() and bpf_core_field_size() helpers: variable-based field reference and type/field name-based one. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-5-andrii@kernel.org commit 73d0280f6b79c936770698250549ba9f62682a45 Author: Andrii Nakryiko Date: Sun May 8 17:41:42 2022 -0700 libbpf: Improve usability of field-based CO-RE helpers Allow to specify field reference in two ways: - if user has variable of necessary type, they can use variable-based reference (my_var.my_field or my_var_ptr->my_field). This was the only supported syntax up till now. - now, bpf_core_field_exists() and bpf_core_field_size() support also specifying field in a fashion similar to offsetof() macro, by specifying type of the containing struct/union separately and field name separately: bpf_core_field_exists(struct my_type, my_field). This forms is quite often more convenient in practice and it matches type-based CO-RE helpers that support specifying type by its name without requiring any variables. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-4-andrii@kernel.org commit 8e2f618e8be66f74e6e088281ca72deb5c87cf04 Author: Andrii Nakryiko Date: Sun May 8 17:41:41 2022 -0700 libbpf: Make __kptr and __kptr_ref unconditionally use btf_type_tag() attr It will be annoying and surprising for users of __kptr and __kptr_ref if libbpf silently ignores them just because Clang used for compilation didn't support btf_type_tag(). It's much better to get clear compiler error than debug BPF verifier failures later on. Fixes: ef89654f2bc7 ("libbpf: Add kptr type tag macros to bpf_helpers.h") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-3-andrii@kernel.org commit 1e2666e029e5cc2b81dbd7c85af5bcc8c80524e0 Author: Andrii Nakryiko Date: Sun May 8 17:41:40 2022 -0700 selftests/bpf: Prevent skeleton generation race Prevent "classic" and light skeleton generation rules from stomping on each other's toes due to the use of the same .linked{1,2,3}.o naming pattern. There is no coordination and synchronizataion between .skel.h and .lskel.h rules, so they can easily overwrite each other's intermediate object files, leading to errors like: /bin/sh: line 1: 170928 Bus error (core dumped) /data/users/andriin/linux/tools/testing/selftests/bpf/tools/sbin/bpftool gen skeleton /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.linked3.o name test_ksyms_weak > /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h make: *** [Makefile:507: /data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h] Error 135 make: *** Deleting file '/data/users/andriin/linux/tools/testing/selftests/bpf/test_ksyms_weak.skel.h' Fix by using different suffix for light skeleton rule. Fixes: c48e51c8b07a ("bpf: selftests: Add selftests for module kfunc support") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220509004148.1801791-2-andrii@kernel.org commit 1adff542d67a2ed1120955cb219bfff8a9c53f59 Author: Guilherme G. Piccoli Date: Wed Apr 27 19:49:03 2022 -0300 coresight: cpu-debug: Replace mutex with mutex_trylock on panic notifier The panic notifier infrastructure executes registered callbacks when a panic event happens - such callbacks are executed in atomic context, with interrupts and preemption disabled in the running CPU and all other CPUs disabled. That said, mutexes in such context are not a good idea. This patch replaces a regular mutex with a mutex_trylock safer approach; given the nature of the mutex used in the driver, it should be pretty uncommon being unable to acquire such mutex in the panic path, hence no functional change should be observed (and if it is, that would be likely a deadlock with the regular mutex). Fixes: 2227b7c74634 ("coresight: add support for CPU debug module") Cc: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Guilherme G. Piccoli Reviewed-by: Suzuki K Poulose Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220427224924.592546-10-gpiccoli@igalia.com commit 553a4ee1c026f5c991937d0f9fec534087d9fdbd Author: Mark Brown Date: Fri May 6 23:26:46 2022 +0100 ARM: configs: Enable audio on BeagleBone Black in multi_v7_defconfig The BeagleBone Black supports audio over HDMI, using a combination of the DaVinci McASP (used for audio by a very large proportion of DaVinci systems with audio support) and a TDA998x device driving the HDMI link (this is a very widely used driver). Build both drivers as modules in multi_v7_defconfig so they can be more easily included in testing. Signed-off-by: Mark Brown Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220506222646.1671474-1-broonie@kernel.org' Signed-off-by: Arnd Bergmann commit 41f0bbd621e9df72f970962465b3a267ddfeaf53 Merge: 3d09c0dfd0bcf 092b3ace58d90 Author: Arnd Bergmann Date: Mon May 9 16:18:30 2022 +0200 Merge tag 'sunxi-dt-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/dt - F1C100 improvements (SPI, MMC, timer, cpu, watchdog) - SPI flash node for licheepi-nano - enabled analogue audio on olinuxino-a64 - GPIO port regulators on teres-i - remove undocumented property from nanopi * tag 'sunxi-dt-for-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sunxi: nanopi: Remove input-name property Link: https://lore.kernel.org/r/Yngton59OacOR2ht@kista.localdomain Signed-off-by: Arnd Bergmann commit 33a1c6618677fe33f8e84cb7bedc45abbce89a50 Author: Sean Anderson Date: Fri Apr 29 17:27:01 2022 +0100 nvmem: sfp: Add support for TA 2.1 devices This adds support for Trust Architecture (TA) 2.1 devices to the SFP driver. There are few differences between TA 2.1 and TA 3.0, especially for read-only support, so just re-use the existing data. Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-17-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 943eadbdb11314b41eacbcc484dfb7f93e271ff4 Author: Sean Anderson Date: Fri Apr 29 17:27:00 2022 +0100 nvmem: sfp: Use regmap This converts the SFP driver to use regmap. This will allow easily supporting devices with different endians. We disallow byte-level access, as regmap_bulk_read doesn't support it (and it's unclear what the correct result would be when we have an endianness difference). Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-16-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 60ed1f7cecbdaf0e3f2d62ca53d118138f4065e0 Author: Sean Anderson Date: Fri Apr 29 17:26:59 2022 +0100 dt-bindings: nvmem: sfp: Add compatible binding for TA 2.1 SFPs Trust Architecture (TA) 2.1 devices include the LS1012A, LS1021A, LS1043A, and LS1046A. The SFP device on TA 2.1 devices is very similar to the SFP on TA 3.0 devices. The primary difference is a few fields in the control register. Add a compatible string. Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-15-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 54eb278a06128a83973390fc8b06acf4d6c0675b Author: Sean Anderson Date: Fri Apr 29 17:26:58 2022 +0100 dt-bindings: nvmem: sfp: Add TA_PROG_SFP supply The TA_PROG_SFP supply must be enabled to program the fuses, and disabled to read the fuses (such as at power-on-reset). On many boards, this supply is controlled by a jumper. The user must manually insert or remove it at the appropriate time in the programming process. However, on other boards this supply is controlled by an FPGA or a GPIO. In these cases, the driver can automatically enable and disable it as necessary. Reviewed-by: Andrew Lunn Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-14-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8cb0cd68bef75af5ac8ef93f3314d4f8dc8767a3 Author: Sean Anderson Date: Fri Apr 29 17:26:57 2022 +0100 dt-bindings: nvmem: sfp: Add clock properties To program fuses, it is necessary to set the fuse programming time. This is determined based on the value of the platform clock. Add a clock property. Because this property is necessary for programming, it is made mandatory. Since these bindings have not yet been present in a stable release (though they are on track for 5.18), it is not an ABI break to change them in this manner. Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-13-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit c75945ac2e503375a5fcd44684a5243df07a6158 Author: Sean Anderson Date: Fri Apr 29 17:26:56 2022 +0100 dt-bindings: nvmem: sfp: Fix typo There is a small grammatical error in the description. Fix it. Reviewed-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: Sean Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-12-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 517f6e2641a2802dce5a5aa0d18c7d37a35678d2 Author: Minghao Chi Date: Fri Apr 29 17:26:54 2022 +0100 nvmem: qfprom: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-10-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit b6b7ef932ae838209254f016ecf8862d716a5ced Author: Sven Peter Date: Fri Apr 29 17:26:50 2022 +0100 nvmem: Add Apple eFuse driver Apple SoCs contain eFuses used to store factory-programmed data such as calibration values for the PCIe or the Type-C PHY. They are organized as 32bit values exposed as MMIO. Signed-off-by: Sven Peter Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-6-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7177042bdd1605b6c8d6b5c65a72f3e389690eaf Author: Sven Peter Date: Fri Apr 29 17:26:49 2022 +0100 dt-bindings: nvmem: Add apple,efuses Apple SoCs come with eFuses used to store factory-programmed data such as calibration settings for the PCIe and Type-C PHY. Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Sven Peter Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8c240bd68ba089c189194b0f78968f3bbf09db97 Author: Sven Peter Date: Fri Apr 29 17:26:48 2022 +0100 MAINTAINERS: Add apple efuses nvmem files to ARM/APPLE MACHINE Signed-off-by: Sven Peter Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 207775f7e17b8fd0426a2ac4a5b81e4e1d71849e Author: Rafał Miłecki Date: Fri Apr 29 17:26:47 2022 +0100 nvmem: brcm_nvram: find Device Tree nodes for NVMEM cells DT binding for Broadcom's NVRAM supports specifying NVMEM cells as NVMEM device (provider) subnodes. Look for such subnodes when collecing NVMEM cells. This allows NVMEM consumers to use NVRAM variables. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit dbc2f62061c6bfba0aee93161ee3194dcee84bd0 Author: Rafał Miłecki Date: Fri Apr 29 17:26:46 2022 +0100 nvmem: core: support passing DT node in cell info Some hardware may have NVMEM cells described in Device Tree using individual nodes. Let drivers pass such nodes to the NVMEM subsystem so they can be later used by NVMEM consumers. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit a15dac8b228677daf8ad7f9855d38734ffa0e7d9 Author: Carlos Llamas Date: Fri Apr 29 23:56:44 2022 +0000 binder: additional transaction error logs Log readable and specific error messages whenever a transaction failure happens. This will ensure better context is given to regular users about these unique error cases, without having to decode a cryptic log. Acked-by: Todd Kjos Acked-by: Christian Brauner (Microsoft) Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220429235644.697372-6-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 06a3494ef61a9c67a5be068a74bc5d3ab9d72a4c Author: Carlos Llamas Date: Fri Apr 29 23:56:43 2022 +0000 binder: convert logging macros into functions Converting binder_debug() and binder_user_error() macros into functions reduces the overall object size by 16936 bytes when cross-compiled with aarch64-linux-gnu-gcc 11.2.0: $ size drivers/android/binder.o.{old,new} text data bss dec hex filename 77935 6168 20264 104367 197af drivers/android/binder.o.old 65551 1616 20264 87431 15587 drivers/android/binder.o.new This is particularly beneficial to functions binder_transaction() and binder_thread_write() which repeatedly use these macros and are both part of the critical path for all binder transactions. $ nm --size vmlinux.{old,new} |grep ' binder_transaction$' 0000000000002f60 t binder_transaction 0000000000002358 t binder_transaction $ nm --size vmlinux.{old,new} |grep binder_thread_write 0000000000001c54 t binder_thread_write 00000000000014a8 t binder_thread_write Acked-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220429235644.697372-5-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit d23386ed7019d50164fa2066aae8656097a02425 Author: Carlos Llamas Date: Fri Apr 29 23:56:42 2022 +0000 binderfs: add extended_error feature entry Add extended_error to the binderfs feature list, to help userspace determine whether the BINDER_GET_EXTENDED_ERROR ioctl is supported by the binder driver. Reviewed-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220429235644.697372-4-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit bd32889e841c12533d09a1bd02bba932baa9ed8f Author: Carlos Llamas Date: Fri Apr 29 23:56:41 2022 +0000 binder: add BINDER_GET_EXTENDED_ERROR ioctl Provide a userspace mechanism to pull precise error information upon failed operations. Extending the current error codes returned by the interfaces allows userspace to better determine the course of action. This could be for instance, retrying a failed transaction at a later point and thus offloading the error handling from the driver. Acked-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220429235644.697372-3-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 9474be34a72726c5a20467e36d9b08102ff9d304 Author: Carlos Llamas Date: Fri Apr 29 23:56:40 2022 +0000 binder: add failed transaction logging info Make sure we log relevant information about failed transactions such as the target proc/thread, call type and transaction id. These details are particularly important when debugging userspace issues. Acked-by: Christian Brauner (Microsoft) Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220429235644.697372-2-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit 83b716d1fe9e0e5b0ba6ad08519e832b881e8e5c Author: Matthew Gerlach Date: Thu May 5 05:41:29 2022 -0400 uio: dfl: add HSSI subsystem feature id Add the Device Feature List (DFL) feature id for the High Speed Serial Interface (HSSI) Subsystem to the table of ids supported by the uio_dfl driver. The HSSI Subsystem is a configurable set of IP blocks to be used as part of a Ethernet or PCS/FEC/PMA pipeline. Like the Ethernet group used by the N3000 card, the HSSI Subsystem does not fully implement a network device from a Linux netdev perspective and is controlled and monitored from user space software via the uio interface. The Feature ID table of DFL can be found: https://github.com/OPAE/dfl-feature-id Reviewed-by: Tom Rix Acked-by: Xu Yilun Signed-off-by: Matthew Gerlach Signed-off-by: Tianfei Zhang Link: https://lore.kernel.org/r/20220505094129.686535-1-tianfei.zhang@intel.com Signed-off-by: Greg Kroah-Hartman commit 228662b074149e16949ab73205ac93b5ca2c3552 Author: Lad Prabhakar Date: Fri Apr 29 17:50:50 2022 +0100 slimbus: qcom-ngd-ctrl: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Tested-By: Steev Klimaszewski Reviewed-by: Bjorn Andersson Signed-off-by: Lad Prabhakar Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429165051.6187-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 249369e93121306ccf0e1365fc5b2ecc6c8618ab Author: Wan Jiabing Date: Tue Apr 26 20:58:59 2022 +0800 bus: mhi: replace snprintf with sysfs_emit Fix following coccicheck warning: ./drivers/bus/mhi/host/init.c:89:8-16: WARNING: use scnprintf or sprintf Use sysfs_emit and sysfs_emit_at instead of snprintf. Reviewed-by: Kees Cook Reviewed-by: Manivannan Sadhasivam Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220426125902.681258-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman commit 77acbdc0f314b7040afcc02be267fe71161f4ac7 Author: Kees Cook Date: Tue Apr 26 17:12:26 2022 -0700 lkdtm: cfi: Fix type width for masking PAC bits The masking for PAC bits wasn't handling 32-bit architectures correctly. Replace the u64 cast with uintptr_t. Link: https://lore.kernel.org/lkml/CAMuHMdVz-J-1ZQ08u0bsQihDkcRmEPrtX5B_oRJ+Ns5jrasnUw@mail.gmail.com Fixes: 2e53b877dc12 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations") Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Reported-by: kernel test robot Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Tested-by: Randy Dunlap Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427001226.1224704-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit f861d36e021e1ac4a0a2a1f6411d623809975d63 Author: Shuah Khan Date: Fri Apr 29 15:09:13 2022 -0600 misc: rtsx: set NULL intfdata when probe fails rtsx_usb_probe() doesn't call usb_set_intfdata() to null out the interface pointer when probe fails. This leaves a stale pointer. Noticed the missing usb_set_intfdata() while debugging an unrelated invalid DMA mapping problem. Fix it with a call to usb_set_intfdata(..., NULL). Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20220429210913.46804-1-skhan@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 9145554d3613299c8f9b0d17c62762cb6b0c4e41 Author: Jiapeng Chong Date: Thu May 5 16:15:39 2022 +0800 altera-stapl: Use swap() instead of open coding it Clean the following coccicheck warning: ./drivers/misc/altera-stapl/altera.c:955:51-52: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220505081539.91575-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman commit b1c5f3085149e9643b125eb10aae0e74644d7dcc Author: Ricky WU Date: Mon Mar 21 11:18:30 2022 +0000 misc: rtsx: add rts5261 efuse function move rts5261_fetch_vendor_settings() to rts5261_init_from_hw() make sure it be called from S3 or D3 add more register setting when efuse is set read efuse setting to register on init flow Signed-off-by: Ricky Wu Link: https://lore.kernel.org/r/18101ecb0f0749ccb9f564eda171ba40@realtek.com Signed-off-by: Greg Kroah-Hartman commit 9c095bd0d4c451d31d0fd1131cc09d3b60de815d Merge: 1728c0567f705 443edfd6d43d5 Author: David S. Miller Date: Mon May 9 14:30:38 2022 +0100 Merge branch 'hns3-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. Change logs: V1 -> V2: - Fix some sparse warnings of patch 3# and 4#. - Add patch #6 to fix sparse warnings of incorrect type of argument. ==================== Signed-off-by: David S. Miller commit 443edfd6d43d59652a6062e89de680fc0c824f84 Author: Guangbin Huang Date: Mon May 9 15:55:32 2022 +0800 net: hns3: fix incorrect type of argument in declaration of function hclge_comm_get_rss_indir_tbl The argument rss_ind_tbl_size is type u16 in function definition of hclge_comm_get_rss_indir_tbl(), but it is set to type __le16 in function declaration by mistake, so fix it. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a1aed456e3261c0096e36618db9aa61d5974ad16 Author: Guangbin Huang Date: Mon May 9 15:55:31 2022 +0800 net: hns3: add query vf ring and vector map relation This patch adds a new mailbox opcode to query map relation between vf ring and vector. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 416eedb60361151b3eeb0f52cb8a37b6d47be328 Author: Jie Wang Date: Mon May 9 15:55:30 2022 +0800 net: hns3: add byte order conversion for VF to PF mailbox message This patch uses __le16/__32 to define mailbox data structures. Then byte order conversion are added for mailbox messages from VF to PF. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 767975e582c50b39d633f6e1c4bb99cc1f156efb Author: Jie Wang Date: Mon May 9 15:55:29 2022 +0800 net: hns3: add byte order conversion for PF to VF mailbox message Currently, hns3 mailbox processing between PF and VF missed to convert message byte order and use data type u16 instead of __le16 for mailbox data process. These processes may cause problems between different architectures. So this patch uses __le16/__le32 data type to define mailbox data structures. To be compatible with old hns3 driver, these structures use one-byte alignment. Then byte order conversions are added to mailbox messages from PF to VF. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit bbed702412041c370d336f076b783bc9e5e04c21 Author: Yufeng Mo Date: Mon May 9 15:55:28 2022 +0800 net: hns3: remove the affinity settings of vector0 Vector0 is used for common interrupt control events and is irrelevant to performance. Currently, the driver sets the default affinity of vector0 to NUMA nodes, which is unnecessary. Therefore, the default setting is removed, and the driver does not set the affinity for vector0. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a4fe9b6db6f93694fa14b41e764a2c0f147f13da Author: Hao Chen Date: Mon May 9 15:55:27 2022 +0800 net: hns3: fix access null pointer issue when set tx-buf-size as 0 When set tx-buf-size as 0 by ethtool, hns3_init_tx_spare_buffer() will return directly and priv->ring->tx_spare->len is uninitialized, then print function access priv->ring->tx_spare->len will cause this issue. When set tx-buf-size as 0 by ethtool, the print function will print 0 directly and not access priv->ring->tx_spare->len. Fixes: 2373b35c24ff ("net: hns3: add log for setting tx spare buf size") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8586d2744ff3065e05d04f4c526402ce00e1f7ac Author: Ian Rogers Date: Fri May 6 22:34:10 2022 -0700 perf metrics: Don't add all tool events for sharing Tool events are added to the set of events for parsing so that having a tool event in a metric doesn't inhibit event sharing of events between metrics. All tool events were added but this meant unused tool events would be counted. Reduce this set of tool events to just those present in the overall metric list. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220507053410.3798748-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9aa09230f011a624b23c06870ccd5ff7b81e034e Author: Ian Rogers Date: Fri May 6 22:34:09 2022 -0700 perf metrics: Support all tool events Previously duration_time was hard coded, which was ok until commit b03b89b350034f22 ("perf stat: Add user_time and system_time events") added additional tool events. Do for all tool events what was previously done just for duration_time. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220507053410.3798748-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 79932d161fda7f2d18761ace5f25445f7b525741 Author: Ian Rogers Date: Fri May 6 22:34:08 2022 -0700 perf evsel: Add tool event helpers Convert to and from a string. Fix evsel__tool_name() as array is off-by-1. Support more than just duration_time as a metric-id. Fixes: 75eafc970bd9d36d ("perf list: Print all available tool events") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220507053410.3798748-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 545a96c90fbe82c4c1e214b0aada4a22e5ffd1e4 Author: Ian Rogers Date: Fri May 6 22:34:07 2022 -0700 perf evsel: Constify a few arrays Remove public definition of evsel__tool_names(). Not used outside util/evsel.c. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220507053410.3798748-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 17b3867d973e7fa585a40a6abff945976dedc14a Author: Ian Rogers Date: Fri May 6 22:34:06 2022 -0700 Revert "perf stat: Support metrics with hybrid events" This reverts commit 60344f1a9a597f2e0efcd57df5dad0b42da15e21. Hybrid metrics place a PMU at the end of the parse string. This is also where tool events are placed. The behavior of the parse string isn't clear and so revert the change for now. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Florian Fischer Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kim Phillips Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220507053410.3798748-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2bb04df7c2af9dad5d28771c723bc39b01cf7df4 Author: Stefan Roesch Date: Tue Apr 26 11:21:34 2022 -0700 io_uring: support CQE32 for nop operation This adds support for filling the extra1 and extra2 fields for large CQE's. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-13-shr@fb.com Signed-off-by: Jens Axboe commit 76c68fbf1a1f97afed0c8f680ee4e3f4da3e720d Author: Stefan Roesch Date: Tue Apr 26 11:21:33 2022 -0700 io_uring: enable CQE32 This enables large CQE's in the uring setup. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-12-shr@fb.com Signed-off-by: Jens Axboe commit f9b3dfcc68a502ef82e50274e2e7e9e91f6bf4e2 Author: Stefan Roesch Date: Tue Apr 26 11:21:32 2022 -0700 io_uring: support CQE32 in /proc info This exposes the extra1 and extra2 fields in the /proc output. Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-11-shr@fb.com Signed-off-by: Jens Axboe commit c4bb964fa092fb68645a852365dfe9855fef178a Author: Stefan Roesch Date: Tue Apr 26 11:21:31 2022 -0700 io_uring: add tracing for additional CQE32 fields This adds tracing for the extra1 and extra2 fields. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-10-shr@fb.com Signed-off-by: Jens Axboe commit e45a3e05008d52c6db63a3a01a9cdc7d89cd133a Author: Stefan Roesch Date: Tue Apr 26 11:21:30 2022 -0700 io_uring: overflow processing for CQE32 This adds the overflow processing for large CQE's. This adds two parameters to the io_cqring_event_overflow function and uses these fields to initialize the large CQE fields. Allocate enough space for large CQE's in the overflow structue. If no large CQE's are used, the size of the allocation is unchanged. The cqe field can have a different size depending if its a large CQE or not. To be able to allocate different sizes, the two fields in the structure are re-ordered. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-9-shr@fb.com Signed-off-by: Jens Axboe commit 0e2e5c47fed68ce203f2c6978188cc49a2a96e26 Author: Stefan Roesch Date: Tue Apr 26 11:21:29 2022 -0700 io_uring: flush completions for CQE32 This flushes the completions according to their CQE type: the same processing is done for the default CQE size, but for large CQE's the extra1 and extra2 fields are filled in. Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-8-shr@fb.com Signed-off-by: Jens Axboe commit 2fee6bc6407848043798698116b8fd81d1fe470a Author: Stefan Roesch Date: Tue Apr 26 11:21:28 2022 -0700 io_uring: modify io_get_cqe for CQE32 Modify accesses to the CQE array to take large CQE's into account. The index needs to be shifted by one for large CQE's. Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-7-shr@fb.com Signed-off-by: Jens Axboe commit effcf8bdeb03aa726e9db834325c650e1700b041 Author: Stefan Roesch Date: Tue Apr 26 11:21:27 2022 -0700 io_uring: add CQE32 completion processing This adds the completion processing for the large CQE's and makes sure that the extra1 and extra2 fields are passed through. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-6-shr@fb.com Signed-off-by: Jens Axboe commit 916587984facd01a2f4a2e327d721601a94ed1ed Author: Stefan Roesch Date: Tue Apr 26 11:21:26 2022 -0700 io_uring: add CQE32 setup processing This adds two new function to setup and fill the CQE32 result structure. Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-5-shr@fb.com Signed-off-by: Jens Axboe commit baf9cb643b485d57c404b0ea9c1865036dde9eb7 Author: Stefan Roesch Date: Tue Apr 26 11:21:25 2022 -0700 io_uring: change ring size calculation for CQE32 This changes the function rings_size to take large CQE's into account. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-4-shr@fb.com Signed-off-by: Jens Axboe commit 4e5bc0a9a1d0be5b20a0366fbfbe5a99d61c6003 Author: Stefan Roesch Date: Tue Apr 26 11:21:24 2022 -0700 io_uring: store add. return values for CQE32 This reuses the hash list node for the storage we need to hold the two 64-bit values that must be passed back. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-3-shr@fb.com Signed-off-by: Jens Axboe commit 7a51e5b44b92686eebd3e1b46b86e1eb4db975db Author: Stefan Roesch Date: Tue Apr 26 11:21:23 2022 -0700 io_uring: support CQE32 in io_uring_cqe This adds the big_cqe array to the struct io_uring_cqe to support large CQE's. Co-developed-by: Jens Axboe Signed-off-by: Stefan Roesch Reviewed-by: Kanchan Joshi Link: https://lore.kernel.org/r/20220426182134.136504-2-shr@fb.com Signed-off-by: Jens Axboe commit ebdeb7c01d025cb059f05dc26b9dc914e46dd43f Author: Jens Axboe Date: Thu Mar 31 19:27:52 2022 -0600 io_uring: add support for 128-byte SQEs Normal SQEs are 64-bytes in length, which is fine for all the commands we support. However, in preparation for supporting passthrough IO, provide an option for setting up a ring with 128-byte SQEs. We continue to use the same type for io_uring_sqe, it's marked and commented with a zero sized array pad at the end. This provides up to 80 bytes of data for a passthrough command - 64 bytes for the extra added data, and 16 bytes available at the end of the existing SQE. Signed-off-by: Jens Axboe commit b5ba65df47cabcba6fe7a03f8f57513e9f78f72f Merge: 1308689906ad3 033b87d24f725 Author: Jens Axboe Date: Mon May 9 06:35:28 2022 -0600 Merge branch 'for-5.19/io_uring-socket' into for-5.19/io_uring-passthrough * for-5.19/io_uring-socket: io_uring: use the text representation of ops in trace io_uring: rename op -> opcode io_uring: add io_uring_get_opcode io_uring: add type to op enum io_uring: add socket(2) support net: add __sys_socket_file() io_uring: fix trace for reduced sqe padding io_uring: add fgetxattr and getxattr support io_uring: add fsetxattr and setxattr support fs: split off do_getxattr from getxattr fs: split off setxattr_copy and do_setxattr function from setxattr commit 1308689906ad35b017eec8e595a2beb6f2f972fb Merge: c5eb0a61238dd 7ccba24d3bc08 Author: Jens Axboe Date: Mon May 9 06:34:52 2022 -0600 Merge branch 'for-5.19/io_uring' into for-5.19/io_uring-passthrough * for-5.19/io_uring: (85 commits) io_uring: don't clear req->kbuf when buffer selection is done io_uring: eliminate the need to track provided buffer ID separately io_uring: move provided buffer state closer to submit state io_uring: move provided and fixed buffers into the same io_kiocb area io_uring: abstract out provided buffer list selection io_uring: never call io_buffer_select() for a buffer re-select io_uring: get rid of hashed provided buffer groups io_uring: always use req->buf_index for the provided buffer group io_uring: ignore ->buf_index if REQ_F_BUFFER_SELECT isn't set io_uring: kill io_rw_buffer_select() wrapper io_uring: make io_buffer_select() return the user address directly io_uring: kill io_recv_buffer_select() wrapper io_uring: use 'sr' vs 'req->sr_msg' consistently io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg io_uring: check IOPOLL/ioprio support upfront io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread() io_uring: add IORING_SETUP_TASKRUN_FLAG io_uring: use TWA_SIGNAL_NO_IPI if IORING_SETUP_COOP_TASKRUN is used io_uring: set task_work notify method at init time io-wq: use __set_notify_signal() to wake workers ... commit 3d09c0dfd0bcfd7bca4a3fa4fb34165f417d8d6e Merge: 168b43ac21c7f 75f9d540862a3 Author: Arnd Bergmann Date: Mon May 9 14:32:56 2022 +0200 Merge tag 'imx-bindings-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX dt-bindings update for 5.19: - Various board compatible additions to fsl.yaml. - Update fsl-imx-dma bindings to deprecate '#dma-channels' and '#dma-requests'. - Add bindings for i.MX8MP HDMI and media block control. - Add vendor prefix for Storopack. * tag 'imx-bindings-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: Add bosch acc board dt-bindings: arm: fsl: Add Storopack i.MX7D SMEGW01 board dt-bindings: vendor-prefixes: Add prefix for Storopack dt-bindings: dmaengine: fsl-imx: deprecate '#dma-channels' and '#dma-requests' dt-bindings: arm: fsl: add toradex,colibri-imx6ull dt-bindings: arm: fsl: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit dt-bindings: arm: fsl: add ls1021a-iot board dt-bindings: arm: Add i.MX8M Mini Toradex Verdin based Menlo board dt-bindings: arm: Add i.MX8M Plus Gateworks GW74xx board dt-bindings: arm: fsl: add IMX8MN DDR3L eval board dt-bindings: arm: fsl: Add carriers for toradex,colibri-imx6dl dt-bindings: arm: fsl: imx6dl-colibri: Drop dedicated v1.1 bindings dt-bindings: arm: fsl: add toradex,verdin-imx8mp et al. dt-bindings: arm: Add i.MX53 based Menlo board comment dt-bindings: arm: fsl: add PHYTEC phyGATE Tauri i.MX6 ULL dt-bindings: arm: fsl: add TQ Systems boards based on i.MX6UL(L) dt-bindings: arm: Add Data Modul i.MX8M Mini eDM SBC dt-bindings: soc: add binding for i.MX8MP HDMI blk-ctrl dt-bindings: power: imx8mp: add defines for HDMI blk-ctrl domains dt-bindings: soc: Add i.MX8MP media block control DT bindings Link: https://lore.kernel.org/r/20220508033843.2773685-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 7ccba24d3bc084d891def1a6fea504e4cb327a8c Author: Jens Axboe Date: Sun May 1 12:31:56 2022 -0600 io_uring: don't clear req->kbuf when buffer selection is done It's not needed as the REQ_F_BUFFER_SELECTED flag tracks the state of whether or not kbuf is valid, so just drop it. Suggested-by: Dylan Yudaken Signed-off-by: Jens Axboe commit 1dbd023eb083249026d51f41cee48a7b199b3d4e Author: Jens Axboe Date: Sun May 1 12:08:35 2022 -0600 io_uring: eliminate the need to track provided buffer ID separately We have io_kiocb->buf_index which is used for either fixed buffers, or for provided buffers. For the latter, it's used to hold the buffer group ID for buffer selection. Post selection, req->kbuf->bid is used to get the buffer ID. Store the buffer ID, when selected, in req->buf_index. If we do end up recycling the buffer, reset it back to the buffer group ID. Signed-off-by: Jens Axboe commit 660cbfa2340af1d25db4f7c4e93b8c1722bc72aa Author: Jens Axboe Date: Sun May 1 11:57:06 2022 -0600 io_uring: move provided buffer state closer to submit state The timeout and other items that follow are less hot, so let's move the provided buffer state above that. Signed-off-by: Jens Axboe commit a4f8d94cfb7c69f996b6a52b1fcbec2f2504dd3f Author: Jens Axboe Date: Sat Apr 30 14:35:17 2022 -0600 io_uring: move provided and fixed buffers into the same io_kiocb area These are mutually exclusive - if you use provided buffers, then you cannot use fixed buffers and vice versa. Move them into the same spot in the io_kiocb, which is also advantageous for provided buffers as they get near the submit side hot cacheline. Signed-off-by: Jens Axboe commit 149c69b04a901c8b611b643af8f4dd6b104e7379 Author: Jens Axboe Date: Sat Apr 30 12:22:02 2022 -0600 io_uring: abstract out provided buffer list selection In preparation for providing another way to select a buffer, move the existing logic into a helper. Signed-off-by: Jens Axboe commit b66e65f41426ec82b92ad4d9a752802bf9e2e383 Author: Jens Axboe Date: Sat Apr 30 12:16:40 2022 -0600 io_uring: never call io_buffer_select() for a buffer re-select Callers already have room to store the addr and length information, clean it up by having the caller just assign the previously provided data. Signed-off-by: Jens Axboe commit 9cfc7e94e42be9c73072606b84d4574a0a2ec270 Author: Jens Axboe Date: Sun May 1 10:52:44 2022 -0600 io_uring: get rid of hashed provided buffer groups Use a plain array for any group ID that's less than 64, and punt anything beyond that to an xarray. 64 fits in a page even for 4KB page sizes and with the planned additions. This makes the expected group usage faster by avoiding a hash and lookup to find our list, and it uses less memory upfront by not allocating any memory for provided buffers unless it's actually being used. Suggested-by: Pavel Begunkov Signed-off-by: Jens Axboe commit 4e9067025259d1227c7f4f18a02c166c93e49290 Author: Jens Axboe Date: Thu Apr 28 19:09:43 2022 -0600 io_uring: always use req->buf_index for the provided buffer group The read/write opcodes use it already, but the recv/recvmsg do not. If we switch them over and read and validate this at init time while we're checking if the opcode supports it anyway, then we can do it in one spot and we don't have to pass in a separate group ID for io_buffer_select(). Signed-off-by: Jens Axboe commit bb68d504f7c4183178b00c1af68fca870728e7e0 Author: Jens Axboe Date: Fri Apr 29 09:25:12 2022 -0600 io_uring: ignore ->buf_index if REQ_F_BUFFER_SELECT isn't set There's no point in validity checking buf_index if the request doesn't have REQ_F_BUFFER_SELECT set, as we will never use it for that case. Signed-off-by: Jens Axboe commit e5b003495e934321f78ba1f95e48da4a8c3a3a35 Author: Jens Axboe Date: Thu Apr 28 14:02:49 2022 -0600 io_uring: kill io_rw_buffer_select() wrapper After the recent changes, this is direct call to io_buffer_select() anyway. With this change, there are no wrappers left for provided buffer selection. Signed-off-by: Jens Axboe commit c54d52c2d6131d112176b26aa97dc5e1af930d6e Author: Jens Axboe Date: Thu Apr 28 13:57:23 2022 -0600 io_uring: make io_buffer_select() return the user address directly There's no point in having callers provide a kbuf, we're just returning the address anyway. Signed-off-by: Jens Axboe commit 168b43ac21c7f6d96ebb5d801194ca63548ae006 Merge: 7665a85a6943b 7d4686fc3c2ad Author: Arnd Bergmann Date: Mon May 9 14:19:13 2022 +0200 Merge tag 'ti-k3-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/dt TI K3 device tree updates for v5.19 New Features: J721e: * Enable DSS, DP, HDMI on J721e EVM and SK AM62: * MCAN, MCU GPIO, ECAP APWM, DMA, Etherent and several peripheral on AM62 SK EVM AM64: * Enable Wireless LAN support Fixes: Drop incorrect MCU UART clock rates * tag 'ti-k3-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: dts: ti: k3-j721e-sk: Enable HDMI arm64: dts: ti: k3-j721e-sk: Enable DisplayPort arm64: dts: ti: k3-j721e-common-proc-board: add DP to j7 evm arm64: dts: ti: k3-j721e-*: add DP & DP PHY arm64: dts: ti: k3-am62: Add SA3UL ranges in cbass_main arm64: dts: ti: k3-am62: Add support for MCAN arm64: dts: ti: k3-am62-mcu: Enable MCU GPIO module arm64: dts: ti: k3-am625-sk: Add ECAP APWM nodes arm64: dts: ti: k3-am625-sk: Enable on board peripherals arm64: dts: ti: k3-am62: Add more peripheral nodes arm64: dts: ti: k3-am642-sk: Enable WLAN connected to SDHCI0 arm64: dts: ti: k3-am64-mcu: remove incorrect UART base clock rates Link: https://lore.kernel.org/r/3dc2011b-eb6d-dcd5-3921-57f6a1cf6d8e@ti.com Signed-off-by: Arnd Bergmann commit 7665a85a6943b975835dd716e23e709047f4175f Merge: 73ff4d189bae1 6273a1864d437 Author: Arnd Bergmann Date: Mon May 9 14:12:12 2022 +0200 Merge tag 'ti-keystone-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/dt Keystone2 device tree updates for v5.19 * Cleanups for SPI NOR / flash * tag 'ti-keystone-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: ARM: dts: keystone: Fix missing fallback and case in SPI NOR node compatible ARM: dts: keystone: Align SPI NOR node name with dtschema Link: https://lore.kernel.org/r/20220507163435.tcg46cacwqhe7n64@busily Signed-off-by: Arnd Bergmann commit 4703b4f0d94a5f887297713a2f6c2916a1ef08fd Author: Bob Pearson Date: Wed Apr 20 20:40:40 2022 -0500 RDMA/rxe: Enforce IBA C11-17 Add a counter to keep track of the number of WQs connected to a CQ and return an error if destroy_cq() is called while the counter is non zero. Link: https://lore.kernel.org/r/20220421014042.26985-8-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit cde3f5d682279340a75b6ae90944b1c6bd3ae0d8 Author: Bob Pearson Date: Wed Apr 20 20:40:39 2022 -0500 RDMA/rxe: Move mw cleanup code to rxe_mw_cleanup() Move code from rxe_dealloc_mw() to rxe_mw_cleanup() to allow flows which hold a reference to mw to complete. Link: https://lore.kernel.org/r/20220421014042.26985-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit cf40367961d8e8af084f4333e6554205c62c7946 Author: Bob Pearson Date: Wed Apr 20 20:40:38 2022 -0500 RDMA/rxe: Move mr cleanup code to rxe_mr_cleanup() Move the code which tears down an mr to rxe_mr_cleanup to allow operations holding a reference to the mr to complete. Link: https://lore.kernel.org/r/20220421014042.26985-6-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit ed2b5dd0f895f80c30e28de63ce607c2f139318e Author: Bob Pearson Date: Wed Apr 20 20:40:37 2022 -0500 RDMA/rxe: Move qp cleanup code to rxe_qp_do_cleanup() Move the code from rxe_qp_destroy() to rxe_qp_do_cleanup(). This allows flows holding references to qp to complete before the qp object is torn down. Link: https://lore.kernel.org/r/20220421014042.26985-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 4e05a4b329e9416e5aded022feacde4385148f21 Author: Bob Pearson Date: Wed Apr 20 20:40:36 2022 -0500 RDMA/rxe: Check rxe_get() return value In the tasklets (completer, responder, and requester) check the return value from rxe_get() to detect failures to get a reference. This only occurs if the qp has had its reference count drop to zero which indicates that it no longer should be used. The ref is never 0 today because the tasklets are flushed before the ref is dropped. The next patch changes this so that the ref is dropped then the tasklets are flushed. Link: https://lore.kernel.org/r/20220421014042.26985-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit b2a41678fc21fd39b11f5aca0a8c999f8efcb1a8 Author: Bob Pearson Date: Wed Apr 20 20:40:35 2022 -0500 RDMA/rxe: Add rxe_srq_cleanup() Move cleanup code from rxe_destroy_srq() to rxe_srq_cleanup() which is called after all references are dropped to allow code depending on the srq object to complete. Link: https://lore.kernel.org/r/20220421014042.26985-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 9497b7880ffd71fcbd469970f6ef45bb55877bfd Author: Wen Gong Date: Wed May 4 23:46:36 2022 -0400 ath11k: reset 11d state in process of recovery When doing simulate_fw_crash operation periodically with a short interval time such as 10 seconds, it is easy happened WMI command timed out for WMI_SCAN_CHAN_LIST_CMDID in ath11k_reg_update_chan_list(). log: [42287.610053] ath11k_pci 0000:01:00.0: wmi command 12291 timeout [42287.610064] ath11k_pci 0000:01:00.0: failed to send WMI_SCAN_CHAN_LIST cmd [42287.610073] ath11k_pci 0000:01:00.0: failed to perform regd update : -11 Note that this issue does not occur with a longer interval such as 20 seconds. The reason the issue occurs with a shorter interval is the following steps: 1) Upon initial boot, or after device recovery, the initial hw scan plus the 11d scan will run, and when 6 GHz support is present, these scans can take up to 12 seconds to complete, so ath11k_reg_update_chan_list() is still waiting the completion of ar->completed_11d_scan. 2) If a simulate_fw_crash operation is received during this time, those scans do not complete, and ath11k_core_pre_reconfigure_recovery() complete the ar->completed_11d_scan, then ath11k_reg_update_chan_list() wakeup and start to send WMI_SCAN_CHAN_LIST_CMDID, but firmware is crashed at this moment, so wmi timed out occur. To address this issue, reset the 11d state during device recovery so that WMI_SCAN_CHAN_LIST_CMDID does not timed out for short interval time such as 10 seconds. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 1f682dc9fb37 ("ath11k: reduce the wait time of 11d scan and hw scan while add interface") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220505034636.29582-1-quic_wgong@quicinc.com commit a2b331ac11e1cac56f5b7d367e9f3c5796deaaed Author: Yang Yingliang Date: Thu May 5 17:39:54 2022 +0800 spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname() It will cause null-ptr-deref if platform_get_resource_byname() returns NULL, we need check the return value. Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220505093954.1285615-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 5c422f0b970d287efa864b8390a02face404db5d Author: Marek Vasut Date: Mon May 9 02:30:35 2022 +0200 regmap: Add missing map->bus check The map->bus can be NULL here, add the missing NULL pointer check. Fixes: d77e745613680 ("regmap: Add bulk read/write callbacks into regmap_config") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Marek Vasut Cc: Dan Carpenter Cc: Mark Brown To: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20220509003035.225272-1-marex@denx.de Signed-off-by: Mark Brown commit 5cb3bdd6bdcda6293aafe2a5adaaa44d011fbdf2 Author: Minghao Chi Date: Thu May 5 02:21:02 2022 +0000 ASoC: pcm186x: simplify the return expression of pcm186x_power_off() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220505022102.54650-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 74eaa8126f50e52a19f055eed002cc76cf3122dc Author: Minghao Chi Date: Thu May 5 02:18:08 2022 +0000 ASoC: mediatek: simplify the return expression of mtk_dai_pcm_prepare() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220505021808.54337-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit ef1258a7820d99cc7999cafbd8ea78a24559ff12 Author: Minghao Chi Date: Thu May 5 02:17:33 2022 +0000 ASoC: uniphier: simplify the return expression of uniphier_aio_compr_set_params() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220505021733.54275-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 85437018eb864a4c2d9ad6ea9b2279415809e8b7 Author: Andy Shevchenko Date: Tue May 3 18:15:17 2022 +0300 pinctrl: microchip-sgpio: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220503151517.59115-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0adccaf1eac91a2c2ee6a54a6de042affe9860f4 Author: Nícolas F. R. A. Prado Date: Fri Apr 29 16:30:39 2022 -0400 ASoC: dt-bindings: rt5682: Add #sound-dai-cells The rt5682 codec can be pointed to through a sound-dai property to be used as part of a machine sound driver. dtc expects #sound-dai-cells to be defined in the codec's node in those cases, so add it in the dt-binding and set it to 0. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220429203039.2207848-4-nfraprado@collabora.com Signed-off-by: Mark Brown commit 2f45536587e53a7a22024e12fbe97ef13598e623 Author: Nícolas F. R. A. Prado Date: Fri Apr 29 16:30:38 2022 -0400 ASoC: dt-bindings: rt1015p: Add #sound-dai-cells The rt1015p codec can be pointed to through a sound-dai property to be used as part of a machine sound driver. dtc expects #sound-dai-cells to be defined in the codec's node in those cases, so add it in the dt-binding and set it to 0. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220429203039.2207848-3-nfraprado@collabora.com Signed-off-by: Mark Brown commit e056cf4341ae3f856f1e38da02b27cb04de4c69b Author: Nícolas F. R. A. Prado Date: Fri Apr 29 16:30:37 2022 -0400 ASoC: dt-bindings: mediatek: mt8192: Add i2s-share properties The Mediatek AFE PCM controller for MT8192 allows sharing of an I2S bus between two busses. Add a pattern for these properties in the dt-binding. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220429203039.2207848-2-nfraprado@collabora.com Signed-off-by: Mark Brown commit e2d61f6255a26a09d4fe2458fa93a33a71db1024 Author: Charles Keepax Date: Wed May 4 18:09:05 2022 +0100 ASoC: sdw-mockup: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-39-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 96bc59d097047a8a013cb77b2a1215cc4877fa96 Author: Charles Keepax Date: Wed May 4 18:09:04 2022 +0100 ASoC: wsa881x: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-38-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8f6a83daf7366661010cd9fe48930648e9c190aa Author: Andy Shevchenko Date: Tue May 3 18:13:21 2022 +0300 pinctrl: equilibrium: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220503151321.58800-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit ff7f9aa523d1699663cbeec4b0e69aaeab5e6bba Author: Charles Keepax Date: Wed May 4 18:09:03 2022 +0100 ASoC: wcd938x: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-37-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 7fb6f48351c896fc6c18f9d3e7b0b4fb689e73cb Author: Charles Keepax Date: Wed May 4 18:09:02 2022 +0100 ASoC: rt1316-sdw: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-36-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 9b536b34693c8ab9caf0612bf4fdbc09fd51f126 Author: Charles Keepax Date: Wed May 4 18:09:01 2022 +0100 ASoC: rt1308-sdw: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-35-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit e8f4ddcb33de9b1eaf74d150234a2cd07dddcfad Author: Charles Keepax Date: Wed May 4 18:09:00 2022 +0100 ASoC: rt715-sdca: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-34-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1a6750123b5d2f05200fb55633b32c81c840f681 Author: Charles Keepax Date: Wed May 4 18:08:59 2022 +0100 ASoC: rt715: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-33-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 3e50a5001055d79c04ea1c79fe4b4ff937a3339c Author: Charles Keepax Date: Wed May 4 18:08:58 2022 +0100 ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-32-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 33f06beac3ade10834a82ad4105dcd91d4b00d61 Author: Charles Keepax Date: Wed May 4 18:08:57 2022 +0100 ASoC: rt711: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-31-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 4982fc1def317febc74398e839dab2a4059692fa Author: Charles Keepax Date: Wed May 4 18:08:56 2022 +0100 ASoC: rt700: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SoundWire DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-30-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit e230b1b1819f2941b8b31174a3839388641920f8 Author: Charles Keepax Date: Wed May 4 18:08:55 2022 +0100 ASoC: wcd9335: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SLIMbus DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-29-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 6b1b1579aa9879bbf729f75c386cb3c932b1f5b3 Author: Charles Keepax Date: Wed May 4 18:08:54 2022 +0100 ASoC: wcd934x: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a SLIMbus DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-28-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit cfacadbdca23f1a8d9c5db2a8f1bb3c6a1dd4dd8 Author: Charles Keepax Date: Wed May 4 18:08:53 2022 +0100 ASoC: cros_ec_codec: Add endianness flag in i2s_rx_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. The i2s_rx component receives audio over an I2S DAI and as such should have endianness applied. A fixup is also required to use the width directly rather than relying on the format in hw_params, now both little and big endian would be supported. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-27-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit ff69ec96b87dccb3a29edef8cec5d4fefbbc2055 Author: Charles Keepax Date: Wed May 4 18:08:52 2022 +0100 ASoC: tscs454: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. A fixup is also required to use the width directly rather than relying on the format in hw_params, now both little and big endian would be supported. It is worth noting this changes the behaviour of S24_LE to use a word length of 24 rather than 32. This would appear to be a correction since the fact S24_LE is stored as 32 bits should not be presented over the bus. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-26-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f5e0084b5beed00f11fb7cd1e90b8b91fcd06e9f Author: Charles Keepax Date: Wed May 4 18:08:51 2022 +0100 ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. A fixup is also required to use the width directly rather than relying on the format in hw_params, now both little and big endian would be supported. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-25-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 80827c123f2a5f5e0fbcc6cb33b102666acec08e Author: Charles Keepax Date: Wed May 4 18:08:50 2022 +0100 ASoC: rt9120: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-24-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 3816069538d54a9c45345f45b569bb2e42846561 Author: Charles Keepax Date: Wed May 4 18:08:49 2022 +0100 ASoC: rt1019: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-23-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f0488349c1183a3a524434958d909f38628e1d4b Author: Charles Keepax Date: Wed May 4 18:08:48 2022 +0100 ASoC: pcm3060: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-22-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8044910bc28e06e0dc0194f160118e00964d8b6a Author: Charles Keepax Date: Wed May 4 18:08:47 2022 +0100 ASoC: mt6660: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-21-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit d990af7422761fa58713e2f56664f7c8c2bf6383 Author: Charles Keepax Date: Wed May 4 18:08:46 2022 +0100 ASoC: mt6359: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. As the core will now expand the formats to cover both endian types, remove the redundant manual specification of both. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-20-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a5f956e221e92a0e93f036651cdab80a2eb6bb18 Author: Charles Keepax Date: Wed May 4 18:08:45 2022 +0100 ASoC: mt6358: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. As the core will now expand the formats to cover both endian types, remove the redundant manual specification of both. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-19-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 39723d3493edd60ed41f9891391d4335b65547b9 Author: Charles Keepax Date: Wed May 4 18:08:44 2022 +0100 ASoC: mt6351: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. As the core will now expand the formats to cover both endian types, remove the redundant manual specification of both. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-18-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit ba7328f31cd508964cf2a0b62edfb0b8339c1e77 Author: Charles Keepax Date: Wed May 4 18:08:43 2022 +0100 ASoC: lochnagar: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-17-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1c3cbc1dacecdb427b693992f1a05b5837b33a70 Author: Charles Keepax Date: Wed May 4 18:08:42 2022 +0100 ASoC: cx2072x: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-16-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f0688b567fb88ba7636e87a5daed8a175275aa2e Author: Charles Keepax Date: Wed May 4 18:08:41 2022 +0100 ASoC: cs35l41: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-15-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit de88ca441a3066668cae62741a52042f0273d364 Author: Charles Keepax Date: Wed May 4 18:08:40 2022 +0100 ASoC: cs4234: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-14-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit ac6f26c18f2d231e4006b2f12e0e46aeb6430cbb Author: Charles Keepax Date: Wed May 4 18:08:39 2022 +0100 ASoC: adau1372: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-13-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a0556e3ad0c40359d5fa3dc72de14ad2efb9dfda Author: Charles Keepax Date: Wed May 4 18:08:38 2022 +0100 ASoC: max98504: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over a PDM DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-12-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1324cd8d14f06ff933c825ca5a51139604bc6b97 Author: Charles Keepax Date: Wed May 4 18:08:37 2022 +0100 ASoC: hdac_hda: Add endianness flag in snd_soc_component_driver The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an HDA DAI and as such should have endianness applied. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-11-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 2ac5b98284b3744514dcf75909a3bb3c3d5ab7d4 Author: Charles Keepax Date: Wed May 4 18:08:36 2022 +0100 ASoC: sta350: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-10-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a9b5bef89a68ec45ec198e2d316cd8b9b9bf6655 Author: Charles Keepax Date: Wed May 4 18:08:35 2022 +0100 ASoC: sta32x: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-9-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 6edfed8f2cce012e87277c8a1786a2de7d5cae35 Author: Charles Keepax Date: Wed May 4 18:08:34 2022 +0100 ASoC: hdmi-codec: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-8-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8a85e2fca6476968f8558163b95c2df38930e523 Author: Charles Keepax Date: Wed May 4 18:08:33 2022 +0100 ASoC: cs4349: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 2bf1e87b9338e8986f78b675a201f7f02a3c43d5 Author: Charles Keepax Date: Wed May 4 18:08:32 2022 +0100 ASoC: cs42l51: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 99a4b91ae967d22158d3f4d4f9564ac63295930e Author: Charles Keepax Date: Wed May 4 18:08:31 2022 +0100 ASoC: cs4270: Remove redundant big endian formats The CODEC already provides the endianness flag on its snd_soc_component_driver structure, specifying it is ambivalent to endian. The core will expand the formats to cover both endian types, as such remove the redundant specification of both endians. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 0104d52a6a69b06b0e8167f7c1247e8c76aca070 Author: Charles Keepax Date: Wed May 4 18:08:30 2022 +0100 ASoC: atmel-classd: Remove endianness flag on class d component The endianness flag should have been removed when the driver was ported across from having both a CODEC and CPU side component, to just having a CPU component and using the dummy for the CODEC. The endianness flag is used to indicate that the device is completely ambivalent to the endianness of the data, typically due to the endianness being lost over the hardware link (ie. the link defines bit ordering). It's usage didn't have any effect when the driver had both a CPU and CODEC component, since the union of those equals the CPU side settings, but now causes the driver to falsely report it supports big endian. Correct this by removing the flag. Fixes: 1dfdbe73ccf9 ("ASoC: atmel-classd: remove codec component") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 52857c3baa0e5ddeba7b2c84e56bb71c9674e048 Author: Charles Keepax Date: Wed May 4 18:08:29 2022 +0100 ASoC: atmel-pdmic: Remove endianness flag on pdmic component The endianness flag should have been removed when the driver was ported across from having both a CODEC and CPU side component, to just having a CPU component and using the dummy for the CODEC. The endianness flag is used to indicate that the device is completely ambivalent to the endianness of the data, typically due to the endianness being lost over the hardware link (ie. the link defines bit ordering). It's usage didn't have any effect when the driver had both a CPU and CODEC component, since the union of those equals the CPU side settings, but now causes the driver to falsely report it supports big endian. Correct this by removing the flag. Fixes: f3c668074a04 ("ASoC: atmel-pdmic: remove codec component") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 5c832efdbf8651e2800a0169a870786bd85ee230 Author: Charles Keepax Date: Wed May 4 18:08:28 2022 +0100 ASoC: soc-component: Add comment for the endianness flag Add a comment to make the purpose of the endianness flag on the snd_soc_component structure more clear. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220504170905.332415-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit fa82cabb888316fc419affb4b0cd91d671c5011b Author: Damien Le Moal Date: Fri Mar 18 19:26:54 2022 +0900 doc: admin-guide: Update libata kernel parameters Cleanup the text text describing the libata.force boot parameter and update the list of the values to include all supported horkage and link flag that can be forced. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 2c33bbdac28c0cddd5a3d5e5e1bf05d440e4fe7b Author: Damien Le Moal Date: Fri Mar 18 14:03:06 2022 +0900 ata: libata-core: Allow forcing most horkage flags To facilitate debugging of drive issues in the field without kernel changes (e.g. temporary test patches), add an entry for most horkage flags in the force_tbl array to allow controlling these horkage settings with the libata.force kernel boot parameter. Signed-off-by: Damien Le Moal Reviewed-by: Sergey Shtylyov Reviewed-by: Hannes Reinecke commit 3af9ca4d341d2b8756fa9056ca0715915480e251 Author: Damien Le Moal Date: Thu Apr 7 15:05:59 2022 +0900 ata: libata-core: Improve link flags forced settings Similarly to the horkage flags, introduce the force_lflag_onoff() macro to define struct ata_force_param entries of the force_tbl array that allow turning on or off a link flag using the libata.force boot parameter. To be consistent with naming, the macro force_lflag() is renamed to force_lflag_on(). Using force_lflag_onoff(), define a new force_tbl entry for the ATA_LFLAG_NO_DEBOUNCE_DELAY link flag, thus allowing testing if an adapter requires a link debounce delay or not. Signed-off-by: Damien Le Moal Reviewed-by: Sergey Shtylyov Reviewed-by: Hannes Reinecke commit 168af4afd1fce013f677b224180a19e33bd7d40f Author: Damien Le Moal Date: Fri Mar 18 13:09:22 2022 +0900 ata: libata-core: Refactor force_tbl definition Introduce the macro definitions force_cbl(), force_spd_limit(), force_xfer(), force_lflag(), force_horkage_on() and force_horkage_onoff() to define with a more compact syntax the struct ata_force_param entries in the force_tbl array defined in the function ata_parse_force_one(). To reduce the indentation of the array declaration, force_tbl definition is also moved out of the ata_parse_force_one() function. The entries are also reordered to group them by type of the quirck that is applied. Finally, fix a comment in ata_parse_force_param() incorrectly referencing force_tbl instead of ata_force_tbl. Signed-off-by: Damien Le Moal Reviewed-by: Sergey Shtylyov Reviewed-by: Hannes Reinecke commit ef1429c0da2656e97b77066a5032ec238b4ead03 Author: Damien Le Moal Date: Fri Mar 18 19:24:51 2022 +0900 ata: libata-core: cleanup ata_device_blacklist Remove the unneeded comma after the last field of the array entries. Signed-off-by: Damien Le Moal Reviewed-by: Sergey Shtylyov Reviewed-by: Hannes Reinecke commit f63bc788727c591a3a6186327882048a75bb2bef Author: Andy Shevchenko Date: Wed May 4 12:25:26 2022 +0300 bcma: gpio: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504092525.71668-1-andriy.shevchenko@linux.intel.com commit 4fb3f1f1818cdfded6d40ff6881a9a5e78cc8609 Author: Chin-Yen Lee Date: Sat May 7 07:50:45 2022 +0800 rtw88: adjust adaptivity option to 1 Fine tune algorithm of adaptivity sensitivity to avoid disconnecting from AP suddenly in field. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506235045.4669-1-pkshih@realtek.com commit ec194bdbc5f9268db15832ccc6699be4728101c9 Author: Minghao Chi Date: Thu May 5 02:21:33 2022 +0000 ata: simplify the return expression of brcm_ahci_remove Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Damien Le Moal commit cdbc44dbb2c73d8bafa1a8ae0d780608be5dbd40 Author: Leon M. George Date: Tue May 3 01:33:10 2022 +0200 mtd: spi-nor: support eon en25qh256a variant This patch allows accessing the upper 16m on the A variant (EN25QH256A) of the EN25QH256 that shares same JEDEC ID. Without this patch, addr_with is detected to be '4' but the read_opcode is a plain READ (supporting only 3 byte addresses). Setting PARSE_SFDP is enough to detect the read_opcode READ_4B on the A variant. READ_4B is not available on the no-A variant. Both variants support 4-byte address mode (spi_nor_set_4byte_addr_mode) but that is prone to breaking on unexpected reboots if the reset pin isn't connected (broken-flash-reset). The no-A variant supports a 'high bank latch mode' that affects read, program, and erase commands - similar to the extended address register (EAR). The HBL bit is manipulated using the ENHBL (0x67) and EXHBL (0x98) opcodes. Should it become necessary to distinguish the two variants in the future, the A variant sets the SNOR_HWCAPS_READ_1_1_4 SFDP param - the no-A variant doesn't. Tested with and without fast read on the A variant only. Signed-off-by: Leon M. George Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220502233310.791565-2-leon@georgemail.eu commit 89051ff5dd3bfbdc95c315dc3377fc46dadddc7c Author: Shaik Sajida Bhanu Date: Fri Apr 29 17:40:39 2022 +0530 mtd: spi-nor: winbond: add support for W25Q512NW-IM Add support for winbond W25Q512NW-IM chip. Below are the tests done: 1. Verified flashing binary image on spi card using flashrom tool. 2. Verified OTP support, below are the test results: localhost / # cat /sys/bus/platform/devices/soc\@0/88dc000.spi/spi_master/spi16/ spi16.0/spi-nor/jedec_id ef8020 localhost / # cat /sys/bus/platform/devices/soc\@0/88dc000.spi/spi_master/spi16/ spi16.0/spi-nor/manufacturer winbond localhost / # cat /sys/bus/platform/devices/soc\@0/88dc000.spi/spi_master/spi16/ spi16.0/spi-nor/partname w25q512nwm localhost / # hexdump /sys/bus/platform/devices/soc\@0/88dc000.spi/spi_master/sp i16/spi16.0/spi-nor/sfdp 0000000 4653 5044 0106 ff01 0600 1001 0080 ff00 0000010 0084 0201 00d0 ff00 ffff ffff ffff ffff 0000020 6800 6c65 6f6c 7720 726f 646c ffff ffff 0000030 ffff ffff ffff ffff ffff ffff ffff ffff * 0000080 20e5 fffb ffff 1fff eb44 6b08 3b08 bb42 0000090 fffe ffff ffff 0000 ffff eb40 200c 520f 00000a0 d810 0000 0233 00a6 e781 d914 63e9 3376 00000b0 757a 757a bdf7 5cd5 f719 ff5d 70e9 a5f9 00000c0 ffff ffff ffff ffff ffff ffff ffff ffff 00000d0 0aff fff0 ff21 ffdc 00000d8 localhost / # md5sum /sys/bus/platform/devices/soc\@0/88dc000.spi/spi_master/spi 16/spi16.0/spi-nor/sfdp 106d89d6c049110bc94c01517cb4ce24 /sys/bus/platform/devices/soc@0/88dc000.spi/ spi_master/spi16/spi16.0/spi-nor/sfdp Signed-off-by: Shaik Sajida Bhanu Signed-off-by: Pratyush Yadav Reviewed-by: Doug Anderson Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/1651234239-32217-1-git-send-email-quic_c_sbhanu@quicinc.com commit 0257be79fc4a16a3252ce80aa13b3640f728c425 Author: Michael Walle Date: Fri Apr 29 12:20:18 2022 +0200 mtd: spi-nor: expose internal parameters via debugfs There is no way to gather all information to verify support for a new flash chip. Also if you want to convert an existing flash chip to the new SFDP parsing, there is not enough information to determine if the flash will work like before. To ease this development, expose internal parameters via the debugfs. Signed-off-by: Michael Walle Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220429102018.2361038-2-michael@walle.cc commit d92e0dbc6a2686e20b558220376d5d1c6b0d9108 Author: Michael Walle Date: Fri Apr 29 12:20:17 2022 +0200 mtd: spi-nor: export spi_nor_hwcaps_pp2cmd() The function will also be used by the debugfs module. Signed-off-by: Michael Walle Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220429102018.2361038-1-michael@walle.cc commit 1728c0567f70583d5e8aa698ce5778c481cc8de7 Merge: 613707eb8bb07 53ad228682899 Author: David S. Miller Date: Mon May 9 12:20:57 2022 +0100 Merge branch 'lan8742-phy' Yuiko Oshino says: ==================== net: phy: add LAN8742 phy support add LAN8742 phy support update LAN88xx phy ID and phy ID mask so that it can coexist with LAN8742 The current phy IDs on the available hardware. LAN8742 0x0007C130, 0x0007C131 LAN88xx 0x0007C132 v3->v4: - fixed the one tab missing issue in the smsc.c. v2->v3: -added comments about the 0xfffffff2 mask that is for the differentiation and the future revisions. v1->v2: -removed "REVIEW REQUEST3" from the PATCH 1/2. ==================== Signed-off-by: David S. Miller commit 53ad228682899689d8a3a0f91e399febe88a1db3 Author: Yuiko Oshino Date: Thu May 5 11:12:52 2022 -0700 net: phy: smsc: add LAN8742 phy support. The current phy IDs on the available hardware. LAN8742 0x0007C130, 0x0007C131 Signed-off-by: Yuiko Oshino Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit e078286a1375c3073e11c71add0c19e9f5816f71 Author: Yuiko Oshino Date: Thu May 5 11:12:51 2022 -0700 net: phy: microchip: update LAN88xx phy ID and phy ID mask. update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy. The current phy IDs on the available hardware. LAN8742 0x0007C130, 0x0007C131 LAN88xx 0x0007C132 Signed-off-by: Yuiko Oshino Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 4fbdb1a9e9e5c802080aa86c8d557135922fb859 Author: Julia Lawall Date: Sat Apr 30 21:11:21 2022 +0200 m68k: math-emu: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220430191122.8667-7-Julia.Lawall@inria.fr Signed-off-by: Geert Uytterhoeven commit c862fe70b023b5efeb1f360ff614b270089bd6ce Author: Michael Schmitz Date: Thu Jan 27 20:41:56 2022 +1300 m68k: Wire up syscall_trace_enter/leave for m68k m68k (other than Coldfire) uses syscall_trace for both trace entry and trace exit. Seccomp support requires separate entry points for trace entry and exit which are already provided for Coldfire. Replace syscall_trace by syscall_trace_enter and syscall_trace_leave in preparation for seccomp support. No regression seen in testing with strace on ARAnyM. Signed-off-by: Michael Schmitz Acked-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20220127074158.25888-2-schmitzmic@gmail.com Signed-off-by: Geert Uytterhoeven commit 613707eb8bb07164d8b01771ef7cbfeb291b588c Merge: 5dd6da25255a9 165cd04fe2539 Author: David S. Miller Date: Mon May 9 12:09:30 2022 +0100 Merge branch 'add-ti-dp83td510-support' Oleksij Rempel says: ==================== add ti dp83td510 support changes v4: - dp83td510: remove unused variables - s/base1/baset1 - s/genphy_c45_baset1_read_master_slave/genphy_c45_pma_baset1_read_master_slave changes v3: - export reusable code snippets and make use of it in the dp83td510 driver changes v2: - rewrite the driver reduce usage of common code and to reduce amount of quirks. - add genphy_c45_baset1_an_config_aneg fix ==================== Signed-off-by: David S. Miller commit 165cd04fe25392f875ebb94188c4faa20905290d Author: Oleksij Rempel Date: Fri May 6 06:23:57 2022 +0200 net: phy: dp83td510: Add support for the DP83TD510 Ethernet PHY The DP83TD510E is an ultra-low power Ethernet physical layer transceiver that supports 10M single pair cable. This driver was tested with NXP SJA1105, STMMAC and ASIX AX88772B USB Ethernet controller. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2013ad8836aceb828c0fb5b16fa8bb98fd3d9b28 Author: Oleksij Rempel Date: Fri May 6 06:23:56 2022 +0200 net: phy: export genphy_c45_baset1_read_status() Export genphy_c45_baset1_read_status() to make it reusable by PHY drivers. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit acb8c5aec2b13dab96f0be33feb10a5b1213f113 Author: Oleksij Rempel Date: Fri May 6 06:23:55 2022 +0200 net: phy: genphy_c45_pma_baset1_read_master_slave: read actual configuration Since MDIO_PMA_PMD_BT1_CTRL register shows actual configuration (and forced state configuration is equal to the state), we should show this configuration for ethtool. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b9a366f3d874ce1c9c0148ec399f2ce4ab05a467 Author: Oleksij Rempel Date: Fri May 6 06:23:54 2022 +0200 net: phy: introduce genphy_c45_pma_baset1_read_master_slave() Move baset1 specific part of genphy_c45_read_pma() code to separate function to make it reusable by PHY drivers. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a04dd88f77a4036ceedd42ed1fbefa68008e1850 Author: Oleksij Rempel Date: Fri May 6 06:23:53 2022 +0200 net: phy: genphy_c45_pma_baset1_setup_master_slave: do no set unknown configuration Do not change default master/slave forced configuration if no changes was requested. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 90532850eb210dff70423eaf20e323a91ef542d8 Author: Oleksij Rempel Date: Fri May 6 06:23:52 2022 +0200 net: phy: introduce genphy_c45_pma_baset1_setup_master_slave() Move baset1 specific part of genphy_c45_pma_setup_forced() code to separate function to make it reusable by PHY drivers. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a7f0e4bea8eda1d286f4e99176bcb88f53aa703b Author: Oleksij Rempel Date: Fri May 6 06:23:51 2022 +0200 net: phy: genphy_c45_baset1_an_config_aneg: do no set unknown configuration Do not change default master/slave autoneg configuration if no changes was requested. Fixes: 3da8ffd8545f ("net: phy: Add 10BASE-T1L support in phy-c45") Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 5dd6da25255a9d64622c693b99d7668da939a980 Merge: 6da3c47264b20 e92695e506d66 Author: David S. Miller Date: Mon May 9 11:58:20 2022 +0100 Merge branch 'vxlan_fdb_delete-extack' Alaa Mohamed says: ==================== propagate extack to vxlan_fdb_delete In order to propagate extack to vxlan_fdb_delete and vxlan_fdb_parse, add extack to .ndo_fdb_del and edit all fdb del handelers. ==================== Signed-off-by: David S. Miller commit e92695e506d663bc4868ffc5bc187488a4f4d5c8 Author: Alaa Mohamed Date: Thu May 5 17:09:58 2022 +0200 net: vxlan: Add extack support to vxlan_fdb_delete This patch adds extack msg support to vxlan_fdb_delete and vxlan_fdb_parse. extack is used to propagate meaningful error msgs to the user of vxlan fdb netlink api Signed-off-by: Alaa Mohamed Signed-off-by: David S. Miller commit ca4567f1e6f660f86fcd04f3563c0045b0d4772f Author: Alaa Mohamed Date: Thu May 5 17:09:57 2022 +0200 rtnetlink: add extack support in fdb del handlers Add extack support to .ndo_fdb_del in netdevice.h and all related methods. Signed-off-by: Alaa Mohamed Signed-off-by: David S. Miller commit 135464f9d29c5b306d7201220f1d00dab30fea89 Author: Mickaël Salaün Date: Fri May 6 18:05:10 2022 +0200 selftests/landlock: Normalize array assignment Add a comma after each array value to make clang-format keep the current array formatting. See the following commit. Automatically modified with: sed -i 's/\t\({}\|NULL\)$/\0,/' tools/testing/selftests/landlock/fs_test.c Link: https://lore.kernel.org/r/20220506160513.523257-5-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 4598d9abf4215e1e371a35683350d50122793c80 Author: Mickaël Salaün Date: Fri May 6 18:05:09 2022 +0200 selftests/landlock: Add clang-format exceptions In preparation to a following commit, add clang-format on and clang-format off stanzas around constant definitions and the TEST_F_FORK macro. This enables to keep aligned values, which is much more readable than packed definitions. Add other clang-format exceptions for FIXTURE() and FIXTURE_VARIANT_ADD() declarations to force space before open brace, which is reported by checkpatch.pl . Link: https://lore.kernel.org/r/20220506160513.523257-4-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 06a1c40a09a8dded4bf0e7e3ccbda6bddcccd7c8 Author: Mickaël Salaün Date: Fri May 6 18:05:08 2022 +0200 landlock: Format with clang-format Let's follow a consistent and documented coding style. Everything may not be to our liking but it is better than tacit knowledge. Moreover, this will help maintain style consistency between different developers. This contains only whitespace changes. Automatically formatted with: clang-format-14 -i security/landlock/*.[ch] include/uapi/linux/landlock.h Link: https://lore.kernel.org/r/20220506160513.523257-3-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 6cc2df8e3a3967e7c13a424f87f6efb1d4a62d80 Author: Mickaël Salaün Date: Fri May 6 18:05:07 2022 +0200 landlock: Add clang-format exceptions In preparation to a following commit, add clang-format on and clang-format off stanzas around constant definitions. This enables to keep aligned values, which is much more readable than packed definitions. Link: https://lore.kernel.org/r/20220506160513.523257-2-mic@digikod.net Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün commit 000605cd1b14f0970465a44bfe89da93cca66348 Author: Rebecca Mckeever Date: Sat Apr 30 17:49:40 2022 -0500 memblock tests: remove completed TODO item Remove completed item from TODO list. Signed-off-by: Rebecca Mckeever Reviewed-by: David Hildenbrand Signed-off-by: Mike Rapoport commit a5550c053f6cf9993119f5c82ffc25ea80364b64 Author: Rebecca Mckeever Date: Sat Apr 30 17:49:39 2022 -0500 memblock tests: update style of comments for memblock_free_*() functions Update comments in memblock_free_*() functions to match the style used in tests/alloc_*.c by rewording to make the expected outcome more apparent and, if more than one memblock is involved, adding a visual of the memory blocks. If the comment has an extra column of spaces, remove the extra space at the beginning of each line for consistency and to conform to Linux kernel coding style. Signed-off-by: Rebecca Mckeever Reviewed-by: David Hildenbrand Signed-off-by: Mike Rapoport commit 60bba7b193cc8241b464b4616cfece9353086eeb Author: Rebecca Mckeever Date: Sat Apr 30 17:49:38 2022 -0500 memblock tests: update style of comments for memblock_remove_*() functions Update comments in memblock_remove_*() functions to match the style used in tests/alloc_*.c by rewording to make the expected outcome more apparent and, if more than one memblock is involved, adding a visual of the memory blocks. If the comment has an extra column of spaces, remove the extra space at the beginning of each line for consistency and to conform to Linux kernel coding style. Signed-off-by: Rebecca Mckeever Reviewed-by: David Hildenbrand Signed-off-by: Mike Rapoport commit e4f76c8d217e6b8c689ab31e0546888c2df016e4 Author: Rebecca Mckeever Date: Sat Apr 30 17:49:37 2022 -0500 memblock tests: update style of comments for memblock_reserve_*() functions Update comments in memblock_reserve_*() functions to match the style used in tests/alloc_*.c by rewording to make the expected outcome more apparent and, if more than one memblock is involved, adding a visual of the memory blocks. If the comment has an extra column of spaces, remove the extra space at the beginning of each line for consistency and to conform to Linux kernel coding style. Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport commit 23b5c7961f7597ba063969dfd79da3f4e19c792f Author: Rebecca Mckeever Date: Sat Apr 30 17:49:36 2022 -0500 memblock tests: update style of comments for memblock_add_*() functions Update comments in memblock_add_*() functions to match the style used in tests/alloc_*.c by rewording to make the expected outcome more apparent and, if more than one memblock is involved, adding a visual of the memory blocks. Reviewed-by: David Hildenbrand Signed-off-by: Rebecca Mckeever Signed-off-by: Mike Rapoport commit 6da3c47264b2083006262f9c733b6597bf191d9b Merge: c908565eecf2d c9933d494c54f Author: David S. Miller Date: Mon May 9 10:51:59 2022 +0100 Merge branch 'wwan-t7xx' Ricardo Martinez says: ==================== net: wwan: t7xx: PCIe driver for MediaTek M.2 modem t7xx is the PCIe host device driver for Intel 5G 5000 M.2 solution which is based on MediaTek's T700 modem to provide WWAN connectivity. The driver uses the WWAN framework infrastructure to create the following control ports and network interfaces: * /dev/wwan0mbim0 - Interface conforming to the MBIM protocol. Applications like libmbim [1] or Modem Manager [2] from v1.16 onwards with [3][4] can use it to enable data communication towards WWAN. * /dev/wwan0at0 - Interface that supports AT commands. * wwan0 - Primary network interface for IP traffic. The main blocks in t7xx driver are: * PCIe layer - Implements probe, removal, and power management callbacks. * Port-proxy - Provides a common interface to interact with different types of ports such as WWAN ports. * Modem control & status monitor - Implements the entry point for modem initialization, reset and exit, as well as exception handling. * CLDMA (Control Layer DMA) - Manages the HW used by the port layer to send control messages to the modem using MediaTek's CCCI (Cross-Core Communication Interface) protocol. * DPMAIF (Data Plane Modem AP Interface) - Controls the HW that provides uplink and downlink queues for the data path. The data exchange takes place using circular buffers to share data buffer addresses and metadata to describe the packets. * MHCCIF (Modem Host Cross-Core Interface) - Provides interrupt channels for bidirectional event notification such as handshake, exception, PM and port enumeration. The compilation of the t7xx driver is enabled by the CONFIG_MTK_T7XX config option which depends on CONFIG_WWAN. This driver was originally developed by MediaTek. Intel adapted t7xx to the WWAN framework, optimized and refactored the driver source code in close collaboration with MediaTek. This will enable getting the t7xx driver on the Approved Vendor List for interested OEM's and ODM's productization plans with Intel 5G 5000 M.2 solution. List of contributors: Amir Hanania Andriy Shevchenko Chandrashekar Devegowda Dinesh Sharma Eliot Lee Haijun Liu M Chetan Kumar Mika Westerberg Moises Veleta Pierre-louis Bossart Chiranjeevi Rapolu Ricardo Martinez Madhusmita Sahu Muralidharan Sethuraman Soumya Prakash Mishra Sreehari Kancharla Suresh Nagaraj [1] https://www.freedesktop.org/software/libmbim/ [2] https://www.freedesktop.org/software/ModemManager/ [3] https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/582 [4] https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/523 V8: - Rebase skb_data_area_size() patch (02). V7: - Delete unused macros. - Avoid duplicated calls to le32_to_cpu(). - Fix 'out of bounds' compilation error. - Rename port_number to port_count. - Remove '!!' when the destination variable is a boolean. - Remove unneeded spinlock around rx_length_th. - Remove common field from union inside dpmaif_drb struct. - Use 'goto' for the exit flow in t7xx_pci_enable_sleep(). - Merge CLDMA tgpd and rgpd structs. - Add comments to clarify skb consumption by ports. - Introduce skb_data_area_size() helper. - Declare the port config array as constant. - Update CLDMA_JUMBO_BUFF_SZ definition when ccci_header is introduced by port-proxy patch. - Update Reviewed-by tags. - Simplify t7xx_dpmaif_tx_send_skb() and make t7xx_dpmaif_add_skb_to_ring() report the tx queue full state early. V6: - Remove unneeded initializations and bit masks. - Remove t7xx_common.h file. - Add comment to circular linking in GPD list. - Use min instead of min_t. - Use int for local indexes instead of short or char. - Update the commit message in CLDMA patch about dependencies on core patch. - Add space between contributor name and email address. - Rename registers with double negatives e.g. DIS_ASPM_LOWPWR_CLR_0 -> ENABLE_ASPM_LOWPWR. - Fix a race condition in pci sleep resource locking. - Initialize interrupts with t7xx_pcie_mac_set_int() instead of 'clear'. - Remove duplicate spin_lock_init(&md->exp_lock). - Remove .ndo_select_queue callback due to singular TX queue. - Remove call to deprecated netif_rx_any_context(). - Fix include guard name in t7xx_hif_dpmaif.h. - Remove unused q_num parameter in DPMAIF functions. - Do not serialize the drb_wr_idx write in t7xx_dpmaif_add_skb_to_ring() and the read from t7xx_txq_drb_wr_available(). - Fix potential leak in t7xx_dpmaif_add_skb_to_ring(). - Unionize: DRB structs: msg and pd. PIT structs: msg and pd. - Replace list_head & spinlock with skb_buff_head in dpmaif_tx_queue. - Remove rx_length_th check in TX WWAN port flow. - Remove wwan_remove_port() from the critical section in WWAN port uninit. - Use skb_end_pointer() to avoid conditional compilation. - Simplify the loop in t7xx_port_ctrl_tx() by checking the buffer offset instead of calculating the number of required packets. - Remove the code for unused channel PORT_CH_STATUS_RX. - Remove bit flags from ports. Ports can check chan_enable instead of the PORT_F_RX_ALLOW_DROP flag. - Use INVALID_SEQ_NUM to identify the first seq number. - Rename port_static to port_conf and ports_private to ports. - Implement t7xx_port_send_skb() and t7xx_port_send_ctl_skb() in a layered approach to reduce duplicated code and simplify the CCCI header handling. - Move wwan_port_rx() call from port-proxy to WWAN port. - Rename t7xx_port_recv_skb() to t7xx_port_enqueue_skb(). - Move control message parsing logic from port-proxy to control port, preserve the endianness when parsing the message and make port-proxy export a function to enable/disable ports. - Use flexible arrays for: port-proxy ports. payload data in t7xx_fsm_event, port_msg, and mtk_runtime_feature. v5: - Update Intel's copyright years to 2021-2022. - Remove circular dependency between DPMAIF HW (07) and HIF (08). - Keep separate patches for CLDMA (02) and Core (03) but improve the code split by decoupling CLDMA from modem ops and cleaning up t7xx_common.h. - Rename ID_CLDMA0/ID_CLDMA1 to CLDMA_ID_AP/CLDMA_ID_MD. - Consistently use CLDMA's ring_lock to protect tr_ring. - Free resources first and then print messages. - Implement suggested name changes. - Do not explicitly include dev_printk.h. - Remove redundant dev_err()s. - Fix possible memory leak during probe. - Remove infrastructure for legacy interrupts. - Remove unused macros and variables, including those that can be replaced with constants. - Remove PCIE_MAC_MSIX_MSK_SET macro which is duplicated code. - Refactor __t7xx_pci_pm_suspend() for clarity. - Refactor t7xx_cldma_rx_ring_init() and t7xx_cldma_tx_ring_init(). - Do not use & for function callbacks. - Declare a structure to access skb->cb[] data. - Use skb_put_data instead of memcpy. - No need to use kfree_sensitive. - Use dev_kfree_skb() instead of kfree_skb(). - Refactor t7xx_prepare_device_rt_data() to remove potential leaks, avoid unneeded memset and keep rt_data and packet_size updates inside the same 'if' block. - Set port's rx_length_th back to 0 during uninit. - Remove unneeded 'blocking' parameter from t7xx_cldma_send_skb(). - Return -EIO in t7xx_cldma_send_skb() if the queue is inactive. - Refactor t7xx_cldma_qs_are_active() to use pci_device_is_present(). - Simplify t7xx_cldma_stop_q() and rename it to t7xx_cldma_stop_all_qs(). - Fix potential leaks in t7xx_cldma_init(). - Improve error handling in fsm_append_event and fsm_routine_starting(). - Propagate return codes from fsm_append_cmd() and t7xx_fsm_append_event(). - Refactor fsm_wait_for_event() to avoid unnecessary sleep. - Create the WWAN ports and net device only after the modem is in the ready state. - Refactor t7xx_port_proxy_recv_skb() and port_recv_skb(). - Rename t7xx_port_check_rx_seq_num() as t7xx_port_next_rx_seq_num() and fix the seq_num logic to handle overflows. - Declare seq_nums as u16 instead of short. - Use unsigned int for local indexes. - Use min_t instead of the ternary operator. - Refactor the loop in t7xx_dpmaif_rx_data_collect() to avoid a dead condition check. - Use a bitmap (bat_bitmap) instead of an array to keep track of the DRB status. Used in t7xx_dpmaif_avail_pkt_bat_cnt(). - Refactor t7xx_dpmaif_tx_send_skb() to protect tx_submit_skb_cnt with spinlock and remove the misleading tx_drb_available variable. - Consolidate bit operations before endianness conversion. - Use C bit fields in dpmaif_drb_skb struct which is not HW related. - Add back the que_started check in t7xx_select_tx_queue(). - Create a helper function to get the DRB count. - Simplify the use of 'usage' during t7xx_ccmni_close(). - Enforce CCMNI MTU selection with BUILD_BUG_ON() instead of a comment. - Remove t7xx_ccmni_ctrl->capability parameter which remains constant. v4: - Implement list_prev_entry_circular() and list_next_entry_circular() macros. - Remove inline from all c files. - Define ioread32_poll_timeout_atomic() helper macro. - Fix return code for WWAN port tx op. - Allow AT commands fragmentation same as MBIM commands. - Introduce t7xx_common.h file in the first patch. - Rename functions and variables as suggested in v3. - Reduce code duplication by creating fsm_wait_for_event() helper function. - Remove unneeded dev_err in t7xx_fsm_clr_event(). - Remove unused variable last_state from struct t7xx_fsm_ctl. - Remove unused variable txq_select_times from struct dpmaif_ctrl. - Replace ETXTBSY with EBUSY. - Refactor t7xx_dpmaif_rx_buf_alloc() to remove an unneeded allocation. - Fix potential leak at t7xx_dpmaif_rx_frag_alloc(). - Simplify return value handling at t7xx_dpmaif_rx_start(). - Add a helper to handle the common part of CCCI header initialization. - Make sure interrupts are enabled during PM resume. - Add a parameter to t7xx_fsm_append_cmd() to tell if it is in interrupt context. v3: - Avoid unneeded ping-pong changes between patches. - Use t7xx_ prefix in functions. - Use t7xx_ prefix in generic structs where mtk_ or ccci prefix was used. - Update Authors/Contributors header. - Remove skb pools used for control path. - Remove skb pools used for RX data path. - Do not use dedicated TX queue for ACK-only packets. - Remove __packed attribute from GPD structs. - Remove the infrastructure for test and debug ports. - Use the skb control buffer to store metadata. - Get the IP packet type from RX PIT. - Merge variable declaration and simple assignments. - Use preferred coding patterns. - Remove global variables. - Declare HW facing structure members as little endian. - Rename goto tags to describe what is going to be done. - Do not use variable length arrays. - Remove unneeded blank lines source code and kdoc headers. - Use C99 initialization format for port-proxy ports. - Clean up comments. - Review included headers. - Better use of 100 column limit. - Remove unneeded mb() in CLDMA. - Remove unneeded spin locks and atomics. - Handle read_poll_timeout error. - Use dev_err_ratelimited() where required. - Fix resource leak when requesting IRQs. - Use generic DEFAULT_TX_QUEUE_LEN instead custom macro. - Use ETH_DATA_LEN instead of defining WWAN_DEFAULT_MTU. - Use sizeof() instead of defines when the size of structures is required. - Remove unneeded code from netdev: No need to configure HW address length No need to implement .ndo_change_mtu Remove random address generation - Code simplifications by using kernel provided functions and macros such as: module_pci_driver PTR_ERR_OR_ZERO for_each_set_bit pci_device_is_present skb_queue_purge list_prev_entry __ffs64 v2: - Replace pdev->driver->name with dev_driver_string(&pdev->dev). - Replace random_ether_addr() with eth_random_addr(). - Update kernel-doc comment for enum data_policy. - Indicate the driver is 'Supported' instead of 'Maintained'. - Fix the Signed-of-by and Co-developed-by tags in the patches. - Added authors and contributors in the top comment of the src files. ==================== commit c9933d494c54f72290831191c09bb8488bfd5905 Author: Ricardo Martinez Date: Fri May 6 11:13:10 2022 -0700 net: wwan: t7xx: Add maintainers and documentation Adds maintainers and documentation for MediaTek t7xx 5G WWAN modem device driver. Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit de49ea38ba11c1f0fd9e126e93b2f7eb67ed5020 Author: Haijun Liu Date: Fri May 6 11:13:09 2022 -0700 net: wwan: t7xx: Device deep sleep lock/unlock Introduce the mechanism to lock/unlock the device 'deep sleep' mode. When the PCIe link state is L1.2 or L2, the host side still can keep the device is in D0 state from the host side point of view. At the same time, if the device's 'deep sleep' mode is unlocked, the device will go to 'deep sleep' while it is still in D0 state on the host side. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit d10b3a695ba0227faf249537402bb72b283a36b8 Author: Haijun Liu Date: Fri May 6 11:13:08 2022 -0700 net: wwan: t7xx: Runtime PM Enables runtime power management callbacks including runtime_suspend and runtime_resume. Autosuspend is used to prevent overhead by frequent wake-ups. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Eliot Lee Signed-off-by: Eliot Lee Signed-off-by: Ricardo Martinez Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit 46e8f49ed7b3063f51e28f3ea2084b3da29c1503 Author: Haijun Liu Date: Fri May 6 11:13:07 2022 -0700 net: wwan: t7xx: Introduce power management Implements suspend, resumes, freeze, thaw, poweroff, and restore `dev_pm_ops` callbacks. From the host point of view, the t7xx driver is one entity. But, the device has several modules that need to be addressed in different ways during power management (PM) flows. The driver uses the term 'PM entities' to refer to the 2 DPMA and 2 CLDMA HW blocks that need to be managed during PM flows. When a dev_pm_ops function is called, the PM entities list is iterated and the matching function is called for each entry in the list. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit 05d19bf500f8281f574713479b04679fa226d0a3 Author: Haijun Liu Date: Fri May 6 11:13:06 2022 -0700 net: wwan: t7xx: Add WWAN network interface Creates the Cross Core Modem Network Interface (CCMNI) which implements the wwan_ops for registration with the WWAN framework, CCMNI also implements the net_device_ops functions used by the network device. Network device operations include open, close, start transmission, TX timeout and change MTU. Signed-off-by: Haijun Liu Co-developed-by: Chandrashekar Devegowda Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit d642b012df70a76dd5723f2d426b40bffe83ac49 Author: Haijun Liu Date: Fri May 6 11:13:05 2022 -0700 net: wwan: t7xx: Add data path interface Data Path Modem AP Interface (DPMAIF) HIF layer provides methods for initialization, ISR, control and event handling of TX/RX flows. DPMAIF TX Exposes the 'dmpaif_tx_send_skb' function which can be used by the network device to transmit packets. The uplink data management uses a Descriptor Ring Buffer (DRB). First DRB entry is a message type that will be followed by 1 or more normal DRB entries. Message type DRB will hold the skb information and each normal DRB entry holds a pointer to the skb payload. DPMAIF RX The downlink buffer management uses Buffer Address Table (BAT) and Packet Information Table (PIT) rings. The BAT ring holds the address of skb data buffer for the HW to use, while the PIT contains metadata about a whole network packet including a reference to the BAT entry holding the data buffer address. The driver reads the PIT and BAT entries written by the modem, when reaching a threshold, the driver will reload the PIT and BAT rings. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Sergey Ryazanov Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit 33f78ab5a38a79cc5227eb59da9c98b25cfb0ff1 Author: Haijun Liu Date: Fri May 6 11:13:04 2022 -0700 net: wwan: t7xx: Data path HW layer Data Path Modem AP Interface (DPMAIF) HW layer provides HW abstraction for the upper layer (DPMAIF HIF). It implements functions to do the HW configuration, TX/RX control and interrupt handling. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 61b7a2916a0ef91be2e9a4b0d0a5bdf9a371cbee Author: Chandrashekar Devegowda Date: Fri May 6 11:13:03 2022 -0700 net: wwan: t7xx: Add AT and MBIM WWAN ports Adds AT and MBIM ports to the port proxy infrastructure. The initialization method is responsible for creating the corresponding ports using the WWAN framework infrastructure. The implemented WWAN port operations are start, stop, and TX. Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Sergey Ryazanov Reviewed-by: Ilpo Järvinen Signed-off-by: David S. Miller commit da45d2566a1d4e260b894ff5d96be64b21c7fa79 Author: Haijun Liu Date: Fri May 6 11:13:02 2022 -0700 net: wwan: t7xx: Add control port Control Port implements driver control messages such as modem-host handshaking, controls port enumeration, and handles exception messages. The handshaking process between the driver and the modem happens during the init sequence. The process involves the exchange of a list of supported runtime features to make sure that modem and host are ready to provide proper feature lists including port enumeration. Further features can be enabled and controlled in this handshaking process. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 48cc2f5ef846e76dc3bb1501a4014be18c644c1b Author: Haijun Liu Date: Fri May 6 11:13:01 2022 -0700 net: wwan: t7xx: Add port proxy infrastructure Port-proxy provides a common interface to interact with different types of ports. Ports export their configuration via `struct t7xx_port` and operate as defined by `struct port_ops`. Signed-off-by: Haijun Liu Co-developed-by: Chandrashekar Devegowda Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 13e920d93e37fcaef4a9309515798a3cae9dcf19 Author: Haijun Liu Date: Fri May 6 11:13:00 2022 -0700 net: wwan: t7xx: Add core components Registers the t7xx device driver with the kernel. Setup all the core components: PCIe layer, Modem Host Cross Core Interface (MHCCIF), modem control operations, modem state machine, and build infrastructure. * PCIe layer code implements driver probe and removal. * MHCCIF provides interrupt channels to communicate events such as handshake, PM and port enumeration. * Modem control implements the entry point for modem init, reset and exit. * The modem status monitor is a state machine used by modem control to complete initialization and stop. It is used also to propagate exception events reported by other components. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 39d439047f1dc88f98b755d6f3a53a4ef8f0de21 Author: Haijun Liu Date: Fri May 6 11:12:59 2022 -0700 net: wwan: t7xx: Add control DMA interface Cross Layer DMA (CLDMA) Hardware interface (HIF) enables the control path of Host-Modem data transfers. CLDMA HIF layer provides a common interface to the Port Layer. CLDMA manages 8 independent RX/TX physical channels with data flow control in HW queues. CLDMA uses ring buffers of General Packet Descriptors (GPD) for TX/RX. GPDs can represent multiple or single data buffers (DB). CLDMA HIF initializes GPD rings, registers ISR handlers for CLDMA interrupts, and initializes CLDMA HW registers. CLDMA TX flow: 1. Port Layer write 2. Get DB address 3. Configure GPD 4. Triggering processing via HW register write CLDMA RX flow: 1. CLDMA HW sends a RX "done" to host 2. Driver starts thread to safely read GPD 3. DB is sent to Port layer 4. Create a new buffer for GPD ring Note: This patch does not enable compilation since it has dependencies such as t7xx_pcie_mac_clear_int()/t7xx_pcie_mac_set_int() and struct t7xx_pci_dev which are added by the core patch. Signed-off-by: Haijun Liu Signed-off-by: Chandrashekar Devegowda Co-developed-by: Ricardo Martinez Signed-off-by: Ricardo Martinez Reviewed-by: Loic Poulain Reviewed-by: Ilpo Järvinen Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit a4ff365346c98081311c299955d91d657123e8aa Author: Ricardo Martinez Date: Fri May 6 11:12:58 2022 -0700 net: skb: introduce skb_data_area_size() Helper to calculate the linear data space in the skb. Signed-off-by: Ricardo Martinez Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit 2fbdf45d7d26361a0c3ec8833fd96edf0f5812da Author: Ricardo Martinez Date: Fri May 6 11:12:57 2022 -0700 list: Add list_next_entry_circular() and list_prev_entry_circular() Add macros to get the next or previous entries and wraparound if needed. For example, calling list_next_entry_circular() on the last element should return the first element in the list. Signed-off-by: Ricardo Martinez Reviewed-by: Andy Shevchenko Signed-off-by: David S. Miller commit 39d62336f5c126ad6dccdf66cd249f2d0e86d3c9 Author: Thomas Richter Date: Wed May 4 08:23:51 2022 +0200 s390/pai: add support for cryptography counters PMU device driver perf_pai_crypto supports Processor Activity Instrumentation (PAI), available with IBM z16: - maps a full page to lowcore address 0x1500. - uses CR0 bit 13 to turn PAI crypto counting on and off. - creates a sample with raw data on each context switch out when at context switch some mapped counters have a value of nonzero. This device driver only supports CPU wide context, no task context is allowed. Support for counting: - one or more counters can be specified using perf stat -e pai_crypto/xxx/ where xxx stands for the counter event name. Multiple invocation of this command is possible. The counter names are listed in /sys/devices/pai_crypto/events directory. - one special counters can be specified using perf stat -e pai_crypto/CRYPTO_ALL/ which returns the sum of all incremented crypto counters. - one event pai_crypto/CRYPTO_ALL/ is reserved for sampling. No multiple invocations are possible. The event collects data at context switch out and saves them in the ring buffer. Add qpaci assembly instruction to query supported memory mapped crypto counters. It returns the number of counters (no holes allowed in that range). The PAI crypto counter events are system wide and can not be executed in parallel. Therefore some restrictions documented in function paicrypt_busy apply. In particular event CRYPTO_ALL for sampling must run exclusive. Only counting events can run in parallel. PAI crypto counter events can not be created when a CPU hot plug add is processed. This means a CPU hot plug add does not get the necessary PAI event to record PAI cryptography counter increments on the newly added CPU. CPU hot plug remove removes the event and terminates the counting of PAI counters immediately. Co-developed-by: Sven Schnelle Signed-off-by: Sven Schnelle Reviewed-by: Juergen Christ Signed-off-by: Thomas Richter Link: https://lore.kernel.org/r/20220504062351.2954280-3-tmricht@linux.ibm.com Signed-off-by: Heiko Carstens commit 6d97af487dee3176cb1342d4ab16637e495440ad Author: Sven Schnelle Date: Wed May 4 08:23:50 2022 +0200 entry: Rename arch_check_user_regs() to arch_enter_from_user_mode() arch_check_user_regs() is used at the moment to verify that struct pt_regs contains valid values when entering the kernel from userspace. s390 needs a place in the generic entry code to modify a cpu data structure when switching from userspace to kernel mode. As arch_check_user_regs() is exactly this, rename it to arch_enter_from_user_mode(). When entering the kernel from userspace, arch_check_user_regs() is used to verify that struct pt_regs contains valid values. Note that the NMI codepath doesn't call this function. s390 needs a place in the generic entry code to modify a cpu data structure when switching from userspace to kernel mode. As arch_check_user_regs() is exactly this, rename it to arch_enter_from_user_mode(). Signed-off-by: Sven Schnelle Reviewed-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Link: https://lore.kernel.org/r/20220504062351.2954280-2-tmricht@linux.ibm.com Signed-off-by: Heiko Carstens commit 239466bddfc02f9643f64be74ba9a1d80c286f4b Author: Chris Packham Date: Wed Mar 30 11:05:43 2022 +1300 arm64: dts: marvell: Update sdhci node names to match schema Update the node names of the sdhci@ interfaces to be mmc@ to match the node name enforced by the mmc-controller.yaml schema. Signed-off-by: Chris Packham Acked-by: Krzysztof Kozlowski Signed-off-by: Gregory CLEMENT commit ccbd0c991985afc53670e2b01840517922fc30e4 Author: Rodrigo Campos Date: Fri Apr 29 15:57:48 2022 +0200 docs: Add small intro to idmap examples When reading the documentation, I didn't understand why this list examples of things that fail without using the mount idmap feature. It seems pretty pointless and I doubted if I was missing something, until I finished the examples, the next section and saw the examples revisited. After that, it all made sense. Let's add one small sentence before, so the reader knows where this is going and why examples that don't might seem relevant are used. Link: https://lore.kernel.org/r/20220429135748.481301-1-rodrigo@sdfg.com.ar Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Rodrigo Campos Signed-off-by: Christian Brauner (Microsoft) commit f38dc503d366b589d98d5676a5b279d10b47bcb9 Author: Allison Henderson Date: Mon May 9 19:09:10 2022 +1000 xfs: Skip flip flags for delayed attrs This is a clean up patch that skips the flip flag logic for delayed attr renames. Since the log replay keeps the inode locked, we do not need to worry about race windows with attr lookups. So we can skip over flipping the flag and the extra transaction roll for it Signed-off-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 1d08e11d04d293cb7006d1c8641be1fdd8a8e397 Author: Allison Henderson Date: Mon May 9 19:09:07 2022 +1000 xfs: Implement attr logging and replay This patch adds the needed routines to create, log and recover logged extended attribute intents. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit eacec7ebc16cf5d2f6a6c7cf5d57156da2c3e98f Author: Robert Marko Date: Tue Sep 28 19:09:19 2021 +0200 arm64: dts: marvell: espressobin-ultra: enable front USB3 port Espressobin Ultra has a front panel USB3.0 Type-A port which works just fine so enable it. I dont see a reason why it was disabled in the first place anyway. Fixes: 3404fe15a60f ("arm64: dts: marvell: add DT for ESPRESSObin-Ultra") Signed-off-by: Robert Marko Signed-off-by: Gregory CLEMENT commit e836070f94619af5325fd69d3fb48bd1a9e569b4 Author: Robert Marko Date: Tue Sep 28 19:09:18 2021 +0200 arm64: dts: marvell: espressobin-ultra: add PHY and switch reset pins Both the Topaz switch and 88E1512 PHY have their reset and interrupts connected to the SoC. So, define the Topaz and 88E1512 reset pins in the DTS. Defining the interrupt pins wont work as both the 88E1512 and the Topaz switch uses active LOW IRQ signals but the A37xx GPIO controller only supports edge triggers. 88E1512 would require special setup anyway as its INT pin is shared with the LED2 and you first need to configure it as INT. Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 5202f4c3816b42e989f9cad49a73c7e88fba89f4 Author: Robert Marko Date: Tue Sep 28 19:09:17 2021 +0200 arm64: dts: marvell: espressobin-ultra: fix SPI-NOR config SPI config for the SPI-NOR is incorrect and completely breaking reading/writing to the onboard SPI-NOR. SPI-NOR is connected in the single(x1) IO mode and not in the quad (x4) mode. Also, there is no need to override the max frequency from the DTSI as the mx25u3235f that is used supports 104Mhz. Fixes: 3404fe15a60f ("arm64: dts: marvell: add DT for ESPRESSObin-Ultra") Signed-off-by: Robert Marko Signed-off-by: Gregory CLEMENT commit e4fde76fa54a6f13da7fd5fd6601474c16c54d8d Author: Robert Marko Date: Tue Mar 22 11:58:57 2022 +0100 arm64: dts: uDPU: correct temperature sensors uDPU has a pair of NCT375 temperature sensors, which are TMP75C compatible as far as the driver is concerned. The current LM75 compatible worked as all of the LM75 compatible sensors are backwards compatible with the original part, but it meant that lower resolution and incorrect sample rate was being used. The "lm75" compatible has been deprecated anyway and is meant as fallback in order to keep older DTS-es working. Signed-off-by: Robert Marko Reviewed-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 5e9b59bd37371ef1e627b24483c0388a2567cc1c Author: Robert Marko Date: Tue Mar 22 11:58:56 2022 +0100 arm64: dts: uDPU: update partition table Partition currently called "uboot" does not only contain U-boot, but rather it contains TF-A, U-boot and U-boot environment. So, to avoid accidentally deleting the U-boot environment which is located at 0x180000 split the partition. "uboot" is not the correct name as you can't boot these boards with U-boot only, TF-A must be present as well, so rename the "uboot" partition to "firmware". While we are here, describe the NOR node as "spi-flash@0" instead of "m25p80@0" which is the old SPI-NOR driver name. This won't break booting for existing devices as the SoC-s BootROM is not partition aware at all, it will simply try booting from 0x0 of the boot device that is set by bootstrap pins. This will however prevent accidental or automated flashing of just U-boot to the partition. Signed-off-by: Robert Marko Reviewed-by: Pali Rohár Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit ec6a8aaafbc5b0467b7554b6e61a93d91fceb613 Author: Stefan Binding Date: Wed May 4 17:12:36 2022 +0100 ALSA: hda/cs8409: Support manual mode detection for CS42L42 For Jack detection on CS42L42, detection is normally done using "auto" mode, which automatically detects what type of jack is connected to the device. However, some headsets are not automatically detected, and as such and alternative detection method "manual mode" can be used to detect these headsets. Signed-off-by: Stefan Binding Tested-by: Chris Chiu Link: https://lore.kernel.org/r/20220504161236.2490532-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 54a85e09f44c5fa322a2d186f50862d09f517225 Author: Ashish Mhetre Date: Fri May 6 15:23:12 2022 +0200 memory: tegra: Add MC error logging on Tegra186 onward Add support for logging memory controller errors on Tegra186, Tegra194 and Tegra234. On these SoCs, interrupts can occur on multiple channels. Add support required to read the status of interrupts across multiple channels, log and clear them. Also add new interrupts supported on these SoCs. Reviewed-by: Dmitry Osipenko Signed-off-by: Ashish Mhetre Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220506132312.3910637-5-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski commit a7cffa11fa9232eabf0c4f441dc53002978ab526 Author: Ashish Mhetre Date: Fri May 6 15:23:11 2022 +0200 memory: tegra: Add memory controller channels support From Tegra186 onwards, the memory controller supports multiple channels. Add support for mapping the address spaces of these channels and specify the number of channels supported by Tegra186, Tegra194 and Tegra234. In case of old bindings, channels won't be present. If channels are not present then print a warning and continue so that backward compatibility will be preserved in driver. During error interrupts from memory controller, appropriate registers from these channels need to be accessed for logging error info. Signed-off-by: Ashish Mhetre Reviewed-by: Dmitry Osipenko Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220506132312.3910637-4-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski commit cc3d696c01d83dfb2009a2d7ffbb330d2b506ac9 Author: Sameer Pujar Date: Fri May 6 15:23:10 2022 +0200 memory: tegra: Add APE memory clients for Tegra234 Add the memory clients on Tegra234 which are needed for APE DMA to properly use the SMMU. Signed-off-by: Sameer Pujar Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220506132312.3910637-3-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski commit 72c81bb67026a07d7cd40418520269e12f0657cb Author: Thierry Reding Date: Fri May 6 15:23:09 2022 +0200 memory: tegra: Add Tegra234 support The memory controller and external memory controller found on Tegra234 is similar to the version found on earlier SoCs but supports a number of new memory clients. Add initial memory client definitions for the Tegra234 so that the SMMU stream ID override registers can be properly programmed at boot time. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220506132312.3910637-2-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski commit 9cd827381310e9947ea0ed7fb69b6491419549f2 Author: Stefan Binding Date: Wed May 4 17:12:35 2022 +0100 ALSA: hda/cs8409: Use general cs42l42 include in cs8409 hda driver This is to improve maintainability of the driver. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20220504161236.2490532-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 7b43e6d795623e23834dd528c36023f692468480 Author: Stefan Binding Date: Wed May 4 17:12:34 2022 +0100 ASoC: cs42l42: Move CS42L42 register descriptions to general include This is to allow the hda driver to have access to the register names, for improved maintainability. Also ensure new header is aligned to 100 columns. Signed-off-by: Stefan Binding Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220504161236.2490532-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit d06130dc3e7aafc6a194f16ddc6011072e87cc4c Author: Colin Ian King Date: Sun May 8 22:28:19 2022 +0100 ALSA: hdsp: remove redundant assignment to pointer kctl Pointer kctl is being assigned a value that is not being read, buf is being re-assigned later. The assignment is redundant and can be removed. Cleans up clang scan build warning: sound/pci/rme9652/hdsp.c:3317:28: warning: Although the value stored to 'kctl' is used in the enclosing expression, the value is never actually read from 'kctl' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220508212819.59188-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai commit 0431de14ae0868ccc5f36bfdf8e8d664bfd8ab53 Author: Julia Lawall Date: Fri Mar 18 11:36:58 2022 +0100 orion5x: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Gregory CLEMENT commit 74da272400b46f2e898f115d1b1cd60828766919 Author: Srinivas Kandagatla Date: Fri May 6 09:47:05 2022 +0100 soundwire: qcom: adjust autoenumeration timeout Currently timeout for autoenumeration during probe and bus reset is set to 2 secs which is really a big value. This can have an adverse effect on boot time if the slave device is not ready/reset. This was the case with wcd938x which was not reset yet but we spent 2 secs waiting in the soundwire controller probe. Reduce this time to 1/10 of Hz which should be good enough time to finish autoenumeration if any slaves are available on the bus. Reported-by: Srinivasa Rao Mandadapu Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220506084705.18525-1-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 57ed510b0547988c24af5e0507775e69fd94d7a2 Author: Pierre-Louis Bossart Date: Wed Apr 27 07:56:23 2022 +0800 soundwire: qcom: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220426235623.4253-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit fff1fd9c1b42b1d8a9dda8d50553543e5d5f5368 Author: Pierre-Louis Bossart Date: Wed Apr 27 07:56:22 2022 +0800 soundwire: intel: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220426235623.4253-5-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 915bf27a46bb4e7d330fb384f47853ccd28e5564 Author: Pierre-Louis Bossart Date: Wed Apr 27 07:56:21 2022 +0800 soundwire: cadence: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220426235623.4253-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 443a98e649b469b4e6a2832799853a5764ef9002 Author: Pierre-Louis Bossart Date: Wed Apr 27 07:56:20 2022 +0800 soundwire: bus: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220426235623.4253-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit f6ee6c8499226eb158ca30457d346511f5e329ce Author: Pierre-Louis Bossart Date: Wed Apr 27 07:56:19 2022 +0800 soundwire: qcom: return error when pm_runtime_get_sync fails For some reason there's a missing error return in two places. Fixes: 74e79da9fd46a ("soundwire: qcom: add runtime pm support") Fixes: 04d46a7b38375 ("soundwire: qcom: add in-band wake up interrupt support") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Bard Liao Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220426235623.4253-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e557bca49b812908f380c56b5b4b2f273848b676 Author: Pierre-Louis Bossart Date: Wed Apr 20 10:32:41 2022 +0800 soundwire: bus: pm_runtime_request_resume on peripheral attachment In typical use cases, the peripheral becomes pm_runtime active as a result of the ALSA/ASoC framework starting up a DAI. The parent/child hierarchy guarantees that the manager device will be fully resumed beforehand. There is however a corner case where the manager device may become pm_runtime active, but without ALSA/ASoC requesting any functionality from the peripherals. In this case, the hardware peripheral device will report as ATTACHED and its initialization routine will be executed. If this initialization routine initiates any sort of deferred processing, there is a possibility that the manager could suspend without the peripheral suspend sequence being invoked: from the pm_runtime framework perspective, the peripheral is *already* suspended. To avoid such disconnects between hardware state and pm_runtime state, this patch adds an asynchronous pm_request_resume() upon successful attach/initialization which will result in the proper resume/suspend sequence to be followed on the peripheral side. BugLink: https://github.com/thesofproject/linux/issues/3459 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220420023241.14335-4-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit e286472cff8a6785f6fa7950a1ab1b485cc87885 Author: Pierre-Louis Bossart Date: Wed Apr 20 10:32:40 2022 +0800 soundwire: intel: disable WAKEEN in pm_runtime resume When the manager device is pm_runtime resumed, we see a series of spurious wakes and attempts to resume the same device: soundwire_intel.link.0: intel_resume_runtime: start soundwire_intel.link.0: intel_link_power_up: powering up all links soundwire_intel.link.0: intel_link_power_up: first link up, programming SYNCPRD soundwire_intel.link.0: intel_shim_wake: WAKEEN disabled for link 0 soundwire_intel.link.0: intel_link_process_wakeen_event: pm_request_resume start soundwire_intel.link.0: intel_link_process_wakeen_event: pm_request_resume done soundwire_intel.link.0: intel_shim_wake: WAKEEN disabled for link 0 soundwire_intel.link.0: intel_link_process_wakeen_event: pm_request_resume start soundwire_intel.link.0: intel_link_process_wakeen_event: pm_request_resume done This sequence does not break anything but is totally unnecessary. Currently the wakes are only disabled after the peripheral generates a wake, e.g. for jack detection. If the resume is initiated by the host drivers as a result of userspace actions (play/record typically), we need to disable wake detection as well. Doing so prevents the spurious wakes and calls to pm_request_resume(). Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220420023241.14335-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 6d9f2dadba698114fed97b224578c5338a36b0d9 Author: Pierre-Louis Bossart Date: Wed Apr 20 10:32:39 2022 +0800 soundwire: intel: prevent pm_runtime resume prior to system suspend commit e38f9ff63e6d ("ACPI: scan: Do not add device IDs from _CID if _HID is not valid") exposes a race condition on a TGL RVP device leading to a timeout. The detailed analysis shows the RT711 codec driver scheduling a jack detection workqueue while attaching during a spurious pm_runtime resume, and the work function happens to be scheduled after the manager device is suspended. The direct link between this ACPI patch and a spurious pm_runtime resume is not obvious; the most likely explanation is that a change in the ACPI device linked list management modifies the order in which the pm_runtime device status is checked and exposes a race condition that was probably present for a very long time, but was not identified. We already have a check in the .prepare stage, where we will resume to full power from specific clock-stop modes. In all other cases, we don't need to resume to full power by default. Adding the SMART_SUSPEND flag prevents the spurious resume from happening. BugLink: https://github.com/thesofproject/linux/issues/3459 Fixes: 029bfd1cd53cd ("soundwire: intel: conditionally exit clock stop mode on system suspend") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220420023241.14335-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 3db50a99f97765be7a3cd0bff4e3f26581920515 Author: Pierre-Louis Bossart Date: Wed Apr 20 10:30:39 2022 +0800 soundwire: cadence: recheck device0 attachment after status change This patch adds a status check after device0 attachment to solve race conditions observed during attachment with multiple devices per link The sequence is the following 1) deviceA attaches as device0 2) the hardware detects a device0 status change and throws an interrupt. 3) the interrupt handler schedules the work function 4) the workqueue starts, we read the status slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0); slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1); we deal with the status change and program deviceA device number to a non-zero value. 5) deviceB attaches as device0, the device0 status seen by the hardware does not change. 6) we clear the CDNS_MCP_SLAVE_INTSTAT0/1 registers -> we will never detect deviceB! This patch suggest re-checking in a loop the device0 status with a PING frame, i.e. using the real device0 status instead of information on status changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220420023039.14144-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit d74999c8c060dfeaf9977b91baa3c795fc183a84 Author: Andreas Gruenbacher Date: Thu May 5 18:19:13 2022 -0700 iomap: iomap_write_end cleanup In iomap_write_end(), only call iomap_write_failed() on the byte range that has failed. This should improve code readability, but doesn't fix an actual bug because iomap_write_failed() is called after updating the file size here and it only affects the memory beyond the end of the file. Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b71450e2cc4b3c79f33c5bd276d152af9bd54f79 Author: Andreas Gruenbacher Date: Thu May 5 18:19:13 2022 -0700 iomap: iomap_write_failed fix The @lend parameter of truncate_pagecache_range() should be the offset of the last byte of the hole, not the first byte beyond it. Fixes: ae259a9c8593 ("fs: introduce iomap infrastructure") Signed-off-by: Andreas Gruenbacher Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 092b3ace58d9049bcd0381c32f2cd69302e199bc Author: Dang Huynh Date: Mon Apr 25 13:42:32 2022 +0700 ARM: dts: sunxi: nanopi: Remove input-name property This property doesn't seem to exist in the documentation nor in source code, but for some reason it is defined in a bunch of device trees. Signed-off-by: Dang Huynh Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220425064231.243482-1-danct12@riseup.net commit 6c2ae0d5db57d772a11f2d7399da5e22f94767d6 Author: Matthew Wilcox (Oracle) Date: Thu Apr 28 23:59:15 2022 -0400 buffer: Rewrite nobh_truncate_page() to use folios - Calculate iblock directly instead of using a while loop - Move has_buffers to the end to remove a backwards jump - Use __filemap_get_folio() instead of grab_cache_page(), which removes a spurious FGP_ACCESSED flag. - Eliminate length and pos variables - Use folio APIs where they exist Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 2ebdd1df316636c2faf25a1780e12553adf09cf7 Author: Matthew Wilcox (Oracle) Date: Wed Mar 17 22:38:26 2021 -0400 mm/readahead: Convert page_cache_async_readahead to take a folio Removes a couple of calls to compound_head and saves a few bytes. Also convert verity's read_file_data_page() to be folio-based. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 520f301c54faa3484e820b80d4505d48ee587163 Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 14:35:22 2022 -0500 fs: Convert is_dirty_writeback() to take a folio Pass a folio instead of a page to aops->is_dirty_writeback(). Convert both implementations and the caller. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit a42634a6c07d5a66e8ad446ad0f184c0c78012ff Author: Matthew Wilcox (Oracle) Date: Thu Mar 31 14:15:59 2022 -0400 readahead: Use a folio in read_pages() Handle multi-page folios correctly and removes a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 2ca456c24801e439256c0ec7dbe21eba7b01544e Author: Matthew Wilcox (Oracle) Date: Thu Apr 28 14:21:02 2022 -0400 filemap: Update the folio_mark_dirty documentation The previous comment was not terribly helpful. Be a bit more explicit about the necessary locking environment. Signed-off-by: Matthew Wilcox (Oracle) commit cd125eeab2de8ef8ca3a0f3a284bc695375c73af Author: Matthew Wilcox (Oracle) Date: Mon Apr 4 13:24:36 2022 -0400 filemap: Update the folio_lock documentation Add kernel-doc for several functions relating to take the folio lock. Signed-off-by: Matthew Wilcox (Oracle) commit 65aa6b5a18294b3713a90c120312ed5d63a16b82 Author: Miaohe Lin Date: Mon Apr 4 11:38:20 2022 -0400 filemap: Remove obsolete comment in lock_page We no longer need the page's inode pinned. This comment dates back to commit db37648cd6ce ("[PATCH] mm: non syncing lock_page()") which added lock_page_nosync(). That was removed by commit 7eaceaccab5f ("block: remove per-queue plugging") which also made this comment obsolete. Signed-off-by: Miaohe Lin Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 84a1041c60ff8f648a09d28af7b2e50a8f6345ed Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 15:00:20 2022 -0500 fs: Remove pagecache_write_begin() and pagecache_write_end() These wrappers have no more users; remove them. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit c5edd542aa548d2a086b117933eedb229768472e Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 i915: Call aops write_begin() and write_end() directly pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 6e0ee0446570c358bae4e224f6a43a5f53f793a0 Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 f2fs: Call aops write_begin() and write_end() directly pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 1b0aa4449cb81e0a7d43cb90d03888c23bacc825 Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 ext4: Call aops write_begin() and write_end() directly pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 07a31f728d7a9a3cdc5aa1bdf9e6a6d7524d93ad Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 hfsplus: Call hfsplus_write_begin() and generic_write_end() directly There is only one kind of write_begin/write_end aops, so we don't need to look up which aop it is, just make hfsplus_write_begin() available to this file and call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit cfef1f7b39a6f24555175c48c56bf1dc9fe01d4e Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 hfs: Call hfs_write_begin() and generic_write_end() directly There is only one kind of write_begin/write_end aops, so we don't need to look up which aop it is, just make hfs_write_begin() available to this file and call it directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 652118b8c979e7f21358016b5568aac4b25c64d9 Author: Matthew Wilcox (Oracle) Date: Sun May 8 14:40:32 2022 -0400 ntfs3: Remove fsdata parameter from ntfs_extend_initialized_size() After the last patch, Smatch reports: fs/ntfs3/file.c:168 ntfs_extend_initialized_size() error: uninitialized symbol 'fsdata'. fsdata is indeed unused. This is not new, but Smatch couldn't see it before because calls through pagecache_write_begin()/pagecache_write_end() could theoretically call any implemention of ->write_begin/write_end, some of which do use fsdata. Now that the calls are direct, Smatch can see they're never used. Fix this by simply passing NULL. While ntfs3 does pass this parameter on to generic functions, those generic functions also never dereference the fsdata parameter, so it's unnecessary to pass the address of a real pointer. Reported-by: Dan Carpenter Signed-off-by: Matthew Wilcox (Oracle) commit 2e691421a2c9e0462175fe98171afa632861b199 Author: Brian Norris Date: Tue Apr 5 18:48:42 2022 -0700 PM / devfreq: rk3399_dmc: Block PMU during transitions See the previous patch ("soc: rockchip: power-domain: Manage resource conflicts with firmware") for a thorough explanation of the conflicts. While ARM Trusted Firmware may be modifying memory controller and power-domain states, we need to block the kernel's power-domain driver. If the power-domain driver is disabled, there is no resource conflict and this becomes a no-op. Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit defec178df76e0caadd4e8ef68f3d655a2088198 Author: Brian Norris Date: Tue Apr 5 18:48:41 2022 -0700 soc: rockchip: power-domain: Manage resource conflicts with firmware On RK3399 platforms, power domains are managed mostly by the kernel (drivers/soc/rockchip/pm_domains.c), but there are a few exceptions where ARM Trusted Firmware has to be involved: (1) system suspend/resume (2) DRAM DVFS (a.k.a., "ddrfreq") Exception (1) does not cause much conflict, since the kernel has quiesced itself by the time we make the relevant PSCI call. Exception (2) can cause conflict, because of two actions: (a) ARM Trusted Firmware needs to read/modify/write the PMU_BUS_IDLE_REQ register to idle the memory controller domain; the kernel driver also has to touch this register for other domains. (b) ARM Trusted Firmware needs to manage the clocks associated with these domains. To elaborate on (b): idling a power domain has always required ungating an array of clocks; see this old explanation from Rockchip: https://lore.kernel.org/linux-arm-kernel/54503C19.9060607@rock-chips.com/ Historically, ARM Trusted Firmware has avoided this issue by using a special PMU_CRU_GATEDIS_CON0 register -- this register ungates all the necessary clocks -- when idling the memory controller. Unfortunately, we've found that this register is not 100% sufficient; it does not turn the relevant PLLs on [0]. So it's possible to trigger issues with something like the following: 1. enable a power domain (e.g., RK3399_PD_VDU) -- kernel will temporarily enable relevant clocks/PLLs, then turn them back off 2. a PLL (e.g., PLL_NPLL) is part of the clock tree for RK3399_PD_VDU's clocks but otherwise unused; NPLL is disabled 3. perform a ddrfreq transition (rk3399_dmcfreq_target() -> ... drivers/clk/rockchip/clk-ddr.c / ROCKCHIP_SIP_DRAM_FREQ) 4. ARM Trusted Firmware unagates VDU clocks (via PMU_CRU_GATEDIS_CON0) 5. ARM Trusted firmware idles the memory controller domain 6. Step 5 waits on the VDU domain/clocks, but NPLL is still off i.e., we hang the system. So for (b), we need to at a minimum manage the relevant PLLs on behalf of firmware. It's easier to simply manage the whole clock tree, in a similar way we do in rockchip_pd_power(). For (a), we need to provide mutual exclusion betwen rockchip_pd_power() and firmware. To resolve that, we simply grab the PMU mutex and release it when ddrfreq is done. The Chromium OS kernel has been carrying versions of part of this hack for a while, based on some new custom notifiers [1]. I've rewritten as a simple function call between the drivers, which is OK because: * the PMU driver isn't enabled, and we don't have this problem at all (the firmware should have left us in an OK state, and there are no runtime conflicts); or * the PMU driver is present, and is a single instance. And the power-domain driver cannot be removed, so there's no lifetime management to worry about. For completeness, there's a 'dmc_pmu_mutex' to guard (likely theoretical?) probe()-time races. It's OK for the memory controller driver to start running before the PMU, because the PMU will avoid any critical actions during the block() sequence. [0] The RK3399 TRM for PMU_CRU_GATEDIS_CON0 only talks about ungating clocks. Based on experimentation, we've found that it does not power up the necessary PLLs. [1] CHROMIUM: soc: rockchip: power-domain: Add notifier to dmc driver https://chromium-review.googlesource.com/q/I242dbd706d352f74ff706f5cbf42ebb92f9bcc60 Notably, the Chromium solution only handled conflict (a), not (b). In practice, item (b) wasn't a problem in many cases because we never managed to fully power off PLLs. Now that the (upstream) video decoder driver performs runtime clock management, we often power off NPLL. Signed-off-by: Brian Norris Tested-by: Peter Geis Reviewed-by: Heiko Stuebner Signed-off-by: Chanwoo Choi commit 44ab23b9b3c7a73c738b37a8f5f84adb7d66c267 Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:43:29 2022 -0500 ntfs3: Call ntfs_write_begin() and ntfs_write_end() directly There is only one kind of write_begin/write_end aops, so we don't need to look up which aop it is, just make ntfs_write_begin() and ntfs_write_end() available to this file and call them directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Namjae Jeon Reviewed-by: Christoph Hellwig commit 27a77913448fe976f7c1d5e4b5467a5fa1b2a195 Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:35:20 2022 -0500 namei: Call aops write_begin() and write_end() directly pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 53b524b83d17ac857e8904afac9f28def691fca3 Author: Matthew Wilcox (Oracle) Date: Thu Mar 3 13:35:20 2022 -0500 buffer: Call aops write_begin() and write_end() directly pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 9d6b0cd7579844761ed68926eb3073bab1dca87b Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 14:31:43 2022 -0500 fs: Remove flags parameter from aops->write_begin There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 8371f30cf774a20fd627a0f7b1ecf00e8257f3bc Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 11:54:56 2022 -0500 fs: Remove aop flags parameter from nobh_write_begin() There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit b7446e7cf15f0926866c8e5de90ab278998bf8c8 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 11:25:12 2022 -0500 fs: Remove aop flags parameter from grab_cache_page_write_begin() There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit be3bbbc588118bdc10e21fdd7bfa6ee6b8c2555d Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 11:25:12 2022 -0500 fs: Remove aop flags parameter from cont_write_begin() There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit b3992d1e2ebcd478e0614494a6abd95e902a029b Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 11:25:12 2022 -0500 fs: Remove aop flags parameter from block_write_begin() There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit de2a931150177957d37e9c975025604f4a1fe853 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:47:09 2022 -0500 fs: Remove aop_flags parameter from netfs_write_begin() There are no more aop flags left, so remove the parameter. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 236d93c4bf2d6da83241cc8e4625e89d9604cb43 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:40:11 2022 -0500 fs: Remove AOP_FLAG_NOFS With all users of this flag gone, we can stop testing whether it's set. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 832ee62d992d9b2d599a6dc70ac822dec4557ea4 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:36:28 2022 -0500 ext4: Use scoped memory APIs in ext4_write_begin() Instead of setting AOP_FLAG_NOFS, use memalloc_nofs_save() and memalloc_nofs_restore() to prevent GFP_FS allocations recursing into the filesystem with a journal already started. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o commit 36d116e99da7e45c8827a157a0a92da0fbbfcaa2 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:36:28 2022 -0500 ext4: Use scoped memory APIs in ext4_da_write_begin() Instead of setting AOP_FLAG_NOFS, use memalloc_nofs_save() and memalloc_nofs_restore() to prevent GFP_FS allocations recursing into the filesystem with a journal already started. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o commit 8f50c8b7ffc727643693f33657a857aeeefbd80b Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:15:07 2022 -0500 ext4: Use scoped memory API in mext_page_double_lock() Replace use of AOP_FLAG_NOFS with calls to memalloc_nofs_save() and memalloc_nofs_restore(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o commit 7333ed3587700680cfcd83a72dabc37ec40f08bf Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 10:10:51 2022 -0500 ext4: Allow GFP_FS allocations in ext4_da_convert_inline_data_to_extent() Since commit 8bc1379b82b8, the transaction is stopped before calling ext4_da_convert_inline_data_to_extent(), which means we can do GFP_FS allocations and recurse into the filesystem. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o commit df8081801dc8e6292390fe33198174b6a60d4356 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 09:45:38 2022 -0500 f2fs: Convert f2fs_grab_cache_page() to use scoped memory APIs Prevent GFP_FS allocations by using memalloc_nofs_save() instead of AOP_FLAG_NOFS. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 2d878178baf32dda7eaf6c1de05a42ab19fe4094 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 09:43:12 2022 -0500 namei: Convert page_symlink() to use memalloc_nofs_save() Stop using AOP_FLAG_NOFS in favour of the scoped memory API. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 56f5746c414d92ae8e8314f46760822b4ecf8be3 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 09:40:54 2022 -0500 namei: Merge page_symlink() and __page_symlink() There are no callers of __page_symlink() left, so we can remove that entry point. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner commit a125d2aec37c660afdd81d09dea616ef5d06eef4 Author: Matthew Wilcox (Oracle) Date: Tue Feb 22 09:27:42 2022 -0500 ext4: Use page_symlink() instead of __page_symlink() By using the memalloc_nofs_save() functionality, we can call page_symlink(), safe in the knowledge that it won't recurse into the filesystem. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig commit 5fb9bfe01c88788ca3a99c44e44d52abb138595d Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 12:58:22 2022 -0500 scsicam: Fix use of page cache Convert scsicam to use a folio instead of a page. There is no need to check the error flag here; read_cache_folio() will return -EIO if the folio cannot be read correctly. Signed-off-by: Matthew Wilcox (Oracle) commit c908565eecf2d310edddaecea6166015abe9df08 Merge: eb60020411fca 8864d2fcf0438 Author: David S. Miller Date: Sun May 8 17:10:59 2022 +0100 Merge tag 'batadv-next-pullrequest-20220508' of git://git.open-mesh.org/linux-merge This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - remove unnecessary type castings, by Yu Zhe Signed-off-by: David S. Miller commit cb3ac45214c03852430979a43180371a44b74596 Author: Christophe Leroy Date: Tue Mar 22 16:40:18 2022 +0100 powerpc/code-patching: Don't call is_vmalloc_or_module_addr() without CONFIG_MODULES If CONFIG_MODULES is not set, there is no point in checking whether text is in module area. This reduced the time needed to activate/deactivate ftrace by more than 10% on an 8xx. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f3c701cce00a38620788c0fc43ff0b611a268c54.1647962456.git.christophe.leroy@csgroup.eu commit 65883b78bc9f49ac891bb202c59fcb76b9cfc611 Author: Christophe Leroy Date: Mon Mar 21 16:44:45 2022 +0100 powerpc: align address to page boundary in change_page_attr() Aligning address to page boundary allows flush_tlb_kernel_range() to know it's a single page flush and use tlbie instead of tlbia. On 603 we now have the following code in first leg of change_page_attr(): 2c: 55 29 00 3c rlwinm r9,r9,0,0,30 30: 91 23 00 00 stw r9,0(r3) 34: 7c 00 22 64 tlbie r4,r0 38: 7c 00 04 ac hwsync 3c: 38 60 00 00 li r3,0 40: 4e 80 00 20 blr Before we had: 28: 55 29 00 3c rlwinm r9,r9,0,0,30 2c: 91 23 00 00 stw r9,0(r3) 30: 54 89 00 26 rlwinm r9,r4,0,0,19 34: 38 84 10 00 addi r4,r4,4096 38: 7c 89 20 50 subf r4,r9,r4 3c: 28 04 10 00 cmplwi r4,4096 40: 41 81 00 30 bgt 70 44: 7c 00 4a 64 tlbie r9,r0 48: 7c 00 04 ac hwsync 4c: 38 60 00 00 li r3,0 50: 4e 80 00 20 blr ... 70: 94 21 ff f0 stwu r1,-16(r1) 74: 7c 08 02 a6 mflr r0 78: 90 01 00 14 stw r0,20(r1) 7c: 48 00 00 01 bl 7c 7c: R_PPC_REL24 _tlbia 80: 80 01 00 14 lwz r0,20(r1) 84: 38 60 00 00 li r3,0 88: 7c 08 03 a6 mtlr r0 8c: 38 21 00 10 addi r1,r1,16 90: 4e 80 00 20 blr Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/6bb118fb2ee89fa3c1f9cf90ed19f88220002cb0.1647877467.git.christophe.leroy@csgroup.eu commit 9290c379d19774d8de6e2b895d756004dbad9ce5 Author: Christophe Leroy Date: Mon Mar 21 16:44:18 2022 +0100 powerpc/8xx: Simplify flush_tlb_kernel_range() In the same spirit as commit 63f501e07a85 ("powerpc/8xx: Simplify TLB handling"), simplify flush_tlb_kernel_range() for 8xx. 8xx cannot be SMP, and has 'tlbie' and 'tlbia' instructions, so an inline version of flush_tlb_kernel_range() for 8xx is worth it. With this page, first leg of change_page_attr() is: 2c: 55 29 00 3c rlwinm r9,r9,0,0,30 30: 91 23 00 00 stw r9,0(r3) 34: 7c 00 22 64 tlbie r4,r0 38: 7c 00 04 ac hwsync 3c: 38 60 00 00 li r3,0 40: 4e 80 00 20 blr Before the patch it was: 30: 55 29 00 3c rlwinm r9,r9,0,0,30 34: 91 2a 00 00 stw r9,0(r10) 38: 94 21 ff f0 stwu r1,-16(r1) 3c: 7c 08 02 a6 mflr r0 40: 38 83 10 00 addi r4,r3,4096 44: 90 01 00 14 stw r0,20(r1) 48: 48 00 00 01 bl 48 48: R_PPC_REL24 flush_tlb_kernel_range 4c: 80 01 00 14 lwz r0,20(r1) 50: 38 60 00 00 li r3,0 54: 7c 08 03 a6 mtlr r0 58: 38 21 00 10 addi r1,r1,16 5c: 4e 80 00 20 blr Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d2610043419ce3e0e53a85386baf2c3625af5cfb.1647877442.git.christophe.leroy@csgroup.eu commit e59596a2d6a75ea3deb60698b95942aaf03681f5 Author: Christophe Leroy Date: Fri Mar 11 13:38:04 2022 +0100 powerpc: Use static call for get_irq() __do_irq() inconditionnaly calls ppc_md.get_irq() That's definitely a hot path. At the time being ppc_md.get_irq address is read every time from ppc_md structure. Replace that call by a static call, and initialise that call after ppc_md.init_IRQ() has set ppc_md.get_irq. Emit a warning and don't set the static call if ppc_md.init_IRQ() is still NULL, that way the kernel won't blow up if for some reason ppc_md.get_irq() doesn't get properly set. With the patch: 00000000 <__SCT__ppc_get_irq>: 0: 48 00 00 20 b 20 <__static_call_return0> <== Replaced by 'b ' at runtime ... 00000020 <__static_call_return0>: 20: 38 60 00 00 li r3,0 24: 4e 80 00 20 blr ... 00000058 <__do_irq>: ... 64: 48 00 00 01 bl 64 <__do_irq+0xc> 64: R_PPC_REL24 __SCT__ppc_get_irq 68: 2c 03 00 00 cmpwi r3,0 ... Before the patch: 00000038 <__do_irq>: ... 3c: 3d 20 00 00 lis r9,0 3e: R_PPC_ADDR16_HA ppc_md+0x1c ... 44: 81 29 00 00 lwz r9,0(r9) 46: R_PPC_ADDR16_LO ppc_md+0x1c ... 4c: 7d 29 03 a6 mtctr r9 50: 4e 80 04 21 bctrl 54: 2c 03 00 00 cmpwi r3,0 ... On PPC64 which doesn't implement static calls yet we get: 00000000000000d0 <__do_irq>: ... dc: 00 00 22 3d addis r9,r2,0 dc: R_PPC64_TOC16_HA .data+0x8 ... e4: 00 00 89 e9 ld r12,0(r9) e4: R_PPC64_TOC16_LO_DS .data+0x8 ... f0: a6 03 89 7d mtctr r12 f4: 18 00 41 f8 std r2,24(r1) f8: 21 04 80 4e bctrl fc: 18 00 41 e8 ld r2,24(r1) ... So on PPC64 that's similar to what we get without static calls. But at least until ppc_md.get_irq() is set the call is to __static_call_return0. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/afb92085f930651d8b1063e4d4bf0396c80ebc7d.1647002274.git.christophe.leroy@csgroup.eu commit a1ae431705410fc7092790977bffd1b00c63c229 Author: Christophe Leroy Date: Wed Mar 9 08:56:14 2022 +0100 powerpc: Use rol32() instead of opencoding in csum_fold() rol32(x, 16) will do the rotate using rlwinm. No need to open code using inline assembly. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/794337eff7bb803d2c4e67d9eee635390c4c48fe.1646812553.git.christophe.leroy@csgroup.eu commit e6f6390ab7b9d649c13de2c8a591bce61a10ec3b Author: Christophe Leroy Date: Tue Mar 8 20:20:25 2022 +0100 powerpc: Add missing headers Don't inherit headers "by chances" from asm/prom.h, asm/mpc52xx.h, asm/pci.h etc... Include the needed headers, and remove asm/prom.h when it was needed exclusively for pulling necessary headers. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/be8bdc934d152a7d8ee8d1a840d5596e2f7d85e0.1646767214.git.christophe.leroy@csgroup.eu commit 86c38fec69a461846d84f250f281e8cfbe54b25a Author: Christophe Leroy Date: Tue Mar 8 20:20:24 2022 +0100 powerpc: Remove asm/prom.h from all files that don't need it Several files include asm/prom.h for no reason. Clean it up. Signed-off-by: Christophe Leroy [mpe: Drop change to prom_parse.c as reported by lkp@intel.com] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7c9b8fda63dcf63e1b28f43e7ebdb95182cbc286.1646767214.git.christophe.leroy@csgroup.eu commit eb60020411fca202e8bd0b8f762a5a4e1cc204a0 Merge: 9f88af22521db 813f97a268608 Author: David S. Miller Date: Sun May 8 11:46:21 2022 +0100 Merge branch 'mlxsw-dedicated-router-notification-block' Ido Schimmel says: ==================== mlxsw: A dedicated notifier block for router code Petr says: Currently all netdevice events are handled in the centralized notifier handler maintained by spectrum.c. Since a number of events are involving router code, spectrum.c needs to dispatch them to spectrum_router.c. The spectrum module therefore needs to know more about the router code than it should have, and there is are several API points through which the two modules communicate. In this patchset, move bulk of the router-related event handling to the router code. Some of the knowledge has to stay: spectrum.c cannot veto events that the router supports, and vice versa. But beyond that, the two can ignore each other's details, which leads to more focused and simpler code. As a side effect, this fixes L3 HW stats support on tunnel netdevices. The patch set progresses as follows: - In patch #1, change spectrum code to not bounce L3 enslavement, which the router code supports. - In patch #2, add a new do-nothing notifier block to the router code. - In patches #3-#6, move router-specific event handling to the router module. In patch #7, clean up a comment. - In patch #8, use the advantage that all router event handling is in the router code and clean up taking router lock. - mlxsw supports L3 HW stats on tunnels as of this patchset. Patches #9 and #10 therefore add a selftest for L3 HW stats support on tunnels. ==================== Signed-off-by: David S. Miller commit 813f97a2686086464f59a433c1bf3413cf504757 Author: Petr Machata Date: Sun May 8 11:08:23 2022 +0300 selftests: forwarding: Add a tunnel-based test for L3 HW stats Add a selftest that uses an IPIP topology and tests that L3 HW stats reflect the traffic in the tunnel. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 32fb67a3e7a65171cd790ff0e65fcee49cae7cf5 Author: Petr Machata Date: Sun May 8 11:08:22 2022 +0300 selftests: lib: Add a generic helper for obtaining HW stats The function get_l3_stats() from the test hw_stats_l3.sh will be useful for any test that wishes to work with L3 stats. Furthermore, it is easy to generalize to other HW stats suites (for when such are added). Therefore, move the code to lib.sh, rewrite it to have the same interface as the other stats-collecting functions, and generalize to take the name of the HW stats suite to collect as an argument. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c353fb0d4c932e4b8b561d31afc54b5a60df3d95 Author: Petr Machata Date: Sun May 8 11:08:21 2022 +0300 mlxsw: spectrum_router: Take router lock in router notifier handler For notifications that the router needs to handle, router lock is taken. Further, at least to determine whether an event is related to a tunnel underlay, router lock also needs to be taken. Due to this, the router lock is always taken for each unhandled event, and also for some handled events, even if they are not related to underlay. Thus each event implies at least one router lock, sometimes two. Instead of deferring the locking to the leaf handlers, take the lock in the router notifier handler always. This simplifies thinking about the locking state, and in some cases saves one lock cycle. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 05a8d7d4fadfc0ab65c6e8d81f8a02484d8db116 Author: Petr Machata Date: Sun May 8 11:08:20 2022 +0300 mlxsw: spectrum: Update a comment The position of netdevice notifier registration no longer depends on the router initialization, because the event handler no longer dispatches to the router code. Update the comment at the registration to that effect. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 75ef4342282a2e2d008b97d70155475a5d342927 Author: Petr Machata Date: Sun May 8 11:08:19 2022 +0300 mlxsw: spectrum: Move handling of tunnel events to router code The events related to IPIP tunnels are handled by the router code. Move the handling from the central dispatcher in spectrum.c to the new notifier handler in the router module. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ba81954cd5266c2cbcd3e1513f0dd10986d23948 Author: Petr Machata Date: Sun May 8 11:08:18 2022 +0300 mlxsw: spectrum: Move handling of router events to router code The events NETDEV_PRE_CHANGEADDR, NETDEV_CHANGEADDR and NETDEV_CHANGEMTU have implications for in-ASIC router interface objects, and as such are handled in the router module. Move the handling from the central dispatcher in spectrum.c to the new notifier handler in the router module. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f40e600b369e00b990d788bf3c68631234ff2843 Author: Petr Machata Date: Sun May 8 11:08:17 2022 +0300 mlxsw: spectrum: Move handling of HW stats events to router code L3 HW stats are implemented in mlxsw as RIF counters, and therefore the code resides in spectrum_router. Exclude the offload xstats events from the mlxsw_sp_netdevice_event_is_router() predicate, and instead recreate the glue code in the router module. Previously, the order of dispatch was that for events on tunnels, a dedicated handler was called, which however did not handle HW stats events. But there is nothing special about tunnel devices as far as HW stats: there is a RIF associated with the tunnel netdevice, and that RIF is where the counter should be installed. Therefore now, HW stats events are tested first, independent of netdevice type. The upshot is that as of this commit, mlxsw supports L3 HW stats work on GRE tunnels. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 4f8afb680f1343a2ce42d5ff3c31e8486650a3a6 Author: Petr Machata Date: Sun May 8 11:08:16 2022 +0300 mlxsw: spectrum: Move handling of VRF events to router code Events involving VRF, as L3 concern, are handled in the router code, by the helper mlxsw_sp_netdevice_vrf_event(). The handler is currently invoked from the centralized dispatcher in spectrum.c. Instead, move the call to the newly-introduced router-specific notifier handler. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0a27cb1692dedd44516745d86e0cb8e9524004c0 Author: Petr Machata Date: Sun May 8 11:08:15 2022 +0300 mlxsw: spectrum_router: Add a dedicated notifier block Currently all netdevice events are handled in the centralized notifier handler maintained by spectrum.c. Since a number of events are involving router code, spectrum.c needs to dispatch them to spectrum_router.c. The spectrum module therefore needs to know more about the router code than it should have, and there is are several API points through which the two modules communicate. To simplify the notifier handlers, introduce a new notifier into the router module. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7cf0f96df1d86a4d08ac0160931df85bc88d42e8 Author: Petr Machata Date: Sun May 8 11:08:14 2022 +0300 mlxsw: spectrum: Tolerate enslaving of various devices to VRF Enslaving netdevices to VRF is currently handled through an mlxsw_sp_is_vrf_event() conditional in mlxsw_sp_netdevice_event(). In the following patch sets, VRF enslavement will be handled purely in the router code. Therefore make handlers of NETDEV_PRECHANGEUPPER tolerant of enslaving to VRF, so that they do not bounce the change. For NETDEV_CHANGEUPPER, drop the WARN_ON(1) and bounce from mlxsw_sp_netdevice_port_vlan_event(). This is the only handler that warned and bounces even in the CHANGEUPPER code, other handler quietly do nothing when they encounter an unfamiliar upper. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 9f88af22521db8602c68dc7b38b3b1189a6ec0ba Merge: 8fc0b6992a069 6f83cb8cbfbfc Author: David S. Miller Date: Sun May 8 11:33:57 2022 +0100 Merge branch 'switch-drivers-to-netif_napi_add_weight' Jakub Kicinski says: ==================== net: switch drivers to netif_napi_add_weight() The minority of drivers pass a custom weight to netif_napi_add(). Switch those away to the new netif_napi_add_weight(). All drivers (which can go thru net-next) calling netif_napi_add() will now be calling it with NAPI_POLL_WEIGHT or 64. ==================== Signed-off-by: David S. Miller commit 6f83cb8cbfbfc2f26c644dba98992356a74aec4c Author: Jakub Kicinski Date: Fri May 6 10:07:51 2022 -0700 net: wan: switch to netif_napi_add_weight() A handful of WAN drivers use custom napi weights, switch them to the new API. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d484735dcf923e7872d5e353aacfaa4f42dea1d4 Author: Jakub Kicinski Date: Fri May 6 10:07:50 2022 -0700 net: virtio: switch to netif_napi_add_weight() virtio netdev driver uses a custom napi weight, switch to the new API for setting custom weight. Signed-off-by: Jakub Kicinski Reviewed-by: Xuan Zhuo Acked-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 8ded532cd1cbe48461821c605dbad9447555755a Author: Jakub Kicinski Date: Fri May 6 10:07:49 2022 -0700 r8152: switch to netif_napi_add_weight() r8152 uses a custom napi weight, switch to the new API for setting custom weight. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit b707b89f7be36147187ebc52d91c085040c26de9 Author: Jakub Kicinski Date: Fri May 6 10:07:48 2022 -0700 eth: switch to netif_napi_add_weight() Switch all Ethernet drivers which use custom napi weights to the new API. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit be8af67fabcb94b2f4e0897e5782bccd3104bef3 Author: Jakub Kicinski Date: Fri May 6 10:07:47 2022 -0700 caif_virtio: switch to netif_napi_add_weight() caif_virtio uses a custom napi weight, switch to the new API for setting custom weights. Signed-off-by: Jakub Kicinski Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 4d92c627557584621fcea04992b2935feff99a24 Author: Jakub Kicinski Date: Fri May 6 10:07:46 2022 -0700 um: vector: switch to netif_napi_add_weight() UM's netdev driver uses a custom napi weight, switch to the new API for setting custom weight. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ca348e7fe1ab9192ad7d9ff029a82a1594e0e289 Author: bo liu Date: Fri May 6 10:57:35 2022 +0800 ALSA: hda/conexant: add a new hda codec SN6140 The current kernel does not support the SN6140 codec chip. Add the SN6140 codec configuration item to kernel. Signed-off-by: bo liu Link: https://lore.kernel.org/r/20220506025735.17731-1-bo.liu@senarytech.com Signed-off-by: Takashi Iwai commit 5b38db0ed51e17ab1135f8e354951aeb46aa57d3 Author: Andre Przywara Date: Thu Mar 17 16:23:39 2022 +0000 dt-bindings: watchdog: sunxi: clarify clock support Most Allwinner SoCs have just one input clock to drive the watchdog peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down internally to 32 KHz. The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as its only clock input, which has the same effect, but let's the binding description mismatch. Change the binding description to name the clocks more loosely, so both the LOSC and divided HOSC match the description. As the fixed clock names now make less sense, drop them from SoCs supporting just one clock input, they were not used by any DT anyway. For the newer SoCs, supporting a choice of two input clocks, we keep both the description and clock-names requirement. Signed-off-by: Andre Przywara Reviewed-by: Rob Herring Reviewed-by: Samuel Holland Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220317162349.739636-3-andre.przywara@arm.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 70fabe207135194a48313bf56305f1ead32cea1f Author: Andre Przywara Date: Thu Mar 17 16:23:38 2022 +0000 dt-bindings: watchdog: sunxi: fix F1C100s compatible The F1C100 series actually features a newer generation watchdog IP, so the compatible string was wrong. Signed-off-by: Andre Przywara Acked-by: Rob Herring Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220317162349.739636-2-andre.przywara@arm.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit daf42866960ce69d48c94c4fc1aa997638b4c2e9 Author: Xiantao Hu Date: Thu Mar 24 11:18:05 2022 +0800 watchdog: Add watchdog driver for Sunplus SP7021 Sunplus SP7021 requires watchdog timer support. Add watchdog driver to enable this. Signed-off-by: Xiantao Hu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220324031805.61316-3-xt.hu@cqplus1.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 94e4a7d5f87668e43f6939c6418d64f884e0bdab Author: Xiantao Hu Date: Thu Mar 24 11:18:04 2022 +0800 dt-bindings: watchdog: Add watchdog yaml file for Sunplus SP7021 This adds the documentation for the devicetree bindings of the Sunplus SP7021 watchdog driver, found from SP7021 SoCs and newer. Signed-off-by: Xiantao Hu Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220324031805.61316-2-xt.hu@cqplus1.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5794dda109fc870fce48a8cdf580750b40bf9d15 Author: Sam Shih Date: Wed Jan 5 18:04:55 2022 +0800 dt-bindings: reset: mt7986: Add reset-controller header file Add infracfg, toprgu, and ethsys reset-controller header file for MT7986 platform. Signed-off-by: Sam Shih Acked-by: Rob Herring Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220105100456.7126-2-sam.shih@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 83999b61d583cd07492600ea7b5cde3fbfd863fb Author: Lad Prabhakar Date: Tue Mar 1 12:23:32 2022 +0000 dt-bindings: watchdog: renesas,wdt: Document RZ/V2L SoC Document RZ/V2L WDT bindings. RZ/V2L WDT is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-wdt" will be used as a fallback. While at it, drop the comment "# RZ/G2L" for "renesas,rzg2l-wdt" compatible string as this will avoid changing the line for every new SoC addition. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220301122332.14796-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4055ee81009e606e830af1acd9e2e35a36249713 Author: Biju Das Date: Fri Feb 25 17:53:20 2022 +0000 watchdog: rzg2l_wdt: Add set_timeout callback This patch adds support for set_timeout callback. Once WDT is started, the WDT cycle setting register(WDTSET) can be updated only after issuing a module reset. Otherwise, it will ignore the writes and will hold the previous value. This patch updates the WDTSET register if it is active. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-8-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f43e6ddbd7d7b63b9e71927a1f50860f8d55f9cc Author: Biju Das Date: Fri Feb 25 17:53:19 2022 +0000 watchdog: rzg2l_wdt: Use force reset for WDT reset This patch uses the force reset(WDTRSTB) for triggering WDT reset for restart callback. This method(ie, Generate Reset (WDTRSTB) Signal on parity error)is faster compared to the overflow method for triggering watchdog reset. Overflow method: reboot: Restarting system Reboot failed -- System halted NOTICE: BL2: v2.5(release):v2.5/rzg2l-1.00-27-gf48f1440c Parity error method: reboot: Restarting system NOTICE: BL2: v2.5(release):v2.5/rzg2l-1.00-27-gf48f1440c Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-7-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit baf1aace9ad15401f08e048a7f1fdec79821bc61 Author: Biju Das Date: Fri Feb 25 17:53:18 2022 +0000 watchdog: rzg2l_wdt: Add error check for reset_control_deassert If reset_control_deassert() fails, then we won't be able to access the device registers. Therefore check the return code of reset_control_deassert() and bailout in case of error. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-6-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 33d04d0fdba9fae18c7d58364643d2c606a43dba Author: Biju Das Date: Fri Feb 25 17:53:17 2022 +0000 watchdog: rzg2l_wdt: Fix reset control imbalance Both rzg2l_wdt_probe() and rzg2l_wdt_start() calls reset_control_ deassert() which results in a reset control imbalance. This patch fixes reset control imbalance by removing reset_control_ deassert() from rzg2l_wdt_start() and replaces reset_control_assert with reset_control_reset in rzg2l_wdt_stop() as watchdog module can be stopped only by a module reset. This change will allow us to restart WDT after stop() by configuring WDT timeout and enable registers. Fixes: 2cbc5cd0b55fa2 ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-5-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e4cf89596c1f1e33309556699f910ced4abbaf44 Author: Biju Das Date: Fri Feb 25 17:53:16 2022 +0000 watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' This patch fixes the issue 'BUG: Invalid wait context' during restart() callback by using clk_prepare_enable() instead of pm_runtime_get_sync() for turning on the clocks during restart. This issue is noticed when testing with renesas_defconfig. [ 42.213802] reboot: Restarting system [ 42.217860] [ 42.219364] ============================= [ 42.223368] [ BUG: Invalid wait context ] [ 42.227372] 5.17.0-rc5-arm64-renesas-00002-g10393723e35e #522 Not tainted [ 42.234153] ----------------------------- [ 42.238155] systemd-shutdow/1 is trying to lock: [ 42.242766] ffff00000a650828 (&genpd->mlock){+.+.}-{3:3}, at: genpd_lock_mtx+0x14/0x20 [ 42.250709] other info that might help us debug this: [ 42.255753] context-{4:4} [ 42.258368] 2 locks held by systemd-shutdow/1: [ 42.262806] #0: ffff80000944e1c8 (system_transition_mutex#2){+.+.}-{3:3}, at: __do_sys_reboot+0xd0/0x250 [ 42.272388] #1: ffff8000094c4e40 (rcu_read_lock){....}-{1:2}, at: atomic_notifier_call_chain+0x0/0x150 [ 42.281795] stack backtrace: [ 42.284672] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.17.0-rc5-arm64-renesas-00002-g10393723e35e #522 [ 42.294577] Hardware name: Renesas SMARC EVK based on r9a07g044c2 (DT) [ 42.301096] Call trace: [ 42.303538] dump_backtrace+0xcc/0xd8 [ 42.307203] show_stack+0x14/0x30 [ 42.310517] dump_stack_lvl+0x88/0xb0 [ 42.314180] dump_stack+0x14/0x2c [ 42.317492] __lock_acquire+0x1b24/0x1b50 [ 42.321502] lock_acquire+0x120/0x3a8 [ 42.325162] __mutex_lock+0x84/0x8f8 [ 42.328737] mutex_lock_nested+0x30/0x58 [ 42.332658] genpd_lock_mtx+0x14/0x20 [ 42.336319] genpd_runtime_resume+0xc4/0x228 [ 42.340587] __rpm_callback+0x44/0x170 [ 42.344337] rpm_callback+0x64/0x70 [ 42.347824] rpm_resume+0x4e0/0x6b8 [ 42.351310] __pm_runtime_resume+0x50/0x78 [ 42.355404] rzg2l_wdt_restart+0x28/0x68 [ 42.359329] watchdog_restart_notifier+0x1c/0x30 [ 42.363943] atomic_notifier_call_chain+0x94/0x150 [ 42.368732] do_kernel_restart+0x24/0x30 [ 42.372652] machine_restart+0x44/0x70 [ 42.376399] kernel_restart+0x3c/0x60 [ 42.380058] __do_sys_reboot+0x228/0x250 [ 42.383977] __arm64_sys_reboot+0x20/0x28 [ 42.387983] invoke_syscall+0x40/0xf8 Fixes: 2cbc5cd0b55fa2 ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-4-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 95abafe76297fa057de6c3486ef844bd446bdf18 Author: Biju Das Date: Fri Feb 25 17:53:15 2022 +0000 watchdog: rzg2l_wdt: Fix Runtime PM usage Both rzg2l_wdt_probe() and rzg2l_wdt_start() calls pm_runtime_get() which results in a usage counter imbalance. This patch fixes this issue by removing pm_runtime_get() call from probe. Fixes: 2cbc5cd0b55fa2 ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220225175320.11041-3-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ea2949df22a533cdf75e4583c00b1ce94cd5a83b Author: Biju Das Date: Fri Feb 25 17:53:14 2022 +0000 watchdog: rzg2l_wdt: Fix 32bit overflow issue The value of timer_cycle_us can be 0 due to 32bit overflow. For eg:- If we assign the counter value "0xfff" for computing maxval. This patch fixes this issue by appending ULL to 1024, so that it is promoted to 64bit. This patch also fixes the warning message, 'watchdog: Invalid min and max timeout values, resetting to 0!'. Fixes: 2cbc5cd0b55fa2 ("watchdog: Add Watchdog Timer driver for RZ/G2L") Signed-off-by: Biju Das Reviewed-by: Guenter Roeck Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220225175320.11041-2-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 289660a4af0e1e38873b7a5cc772114d3b911427 Author: Corentin Labbe Date: Fri Feb 11 11:55:28 2022 +0000 dt-bindings: watchdog: convert faraday,ftwdt010 to yaml Converts watchdog/faraday,ftwdt010.txt to yaml. This permits to detect missing properties like clocks and resets or compatible like moxa,moxart-watchdog. Signed-off-by: Corentin Labbe Reviewed-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220211115528.3382374-1-clabbe@baylibre.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a03f70cfb283c48a5f0925fe868b479bc9b66fd4 Author: David Heidelberg Date: Tue Jan 11 22:23:10 2022 +0100 dt-bindings: watchdog: improve QCOM compatible parsing for modern chips Parse compatible as expected for modern QCOMs. Fixes warnings as: arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: watchdog@17980000: compatible: ['qcom,apss-wdt-sdm845', 'qcom,kpss-wdt'] is too long From schema: Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: watchdog@17980000: compatible: Additional items are not allowed ('qcom,kpss-wdt' was unexpected) From schema: Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml Signed-off-by: David Heidelberg Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220111212310.97566-1-david@ixit.cz Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 711a5b25bac95dcd1111521ed71693330e74a926 Author: Sam Shih Date: Wed Jan 5 18:04:56 2022 +0800 watchdog: mtk_wdt: mt7986: Add toprgu reset controller support Besides watchdog, the mt7986 toprgu module also provides software reset functionality for various peripheral subsystems (eg, ethernet, pcie, and connectivity) Signed-off-by: Sam Shih Reviewed-by: Matthias Brugger Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220105100456.7126-3-sam.shih@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2dd441f16d6ad6104d85c4e5dfeb6dde4df26869 Author: Rafał Miłecki Date: Wed Feb 16 07:34:08 2022 +0100 watchdog: bcm7038_wdt: Support BCM6345 compatible string A new "compatible" value has been added in the commit 17fffe91ba36 ("dt-bindings: watchdog: Add BCM6345 compatible to BCM7038 binding"). It's meant to be used for BCM63xx SoCs family but hardware block can be programmed just like the 7038 one. Cc: Florian Fainelli Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220216063408.23168-1-zajec5@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 100ad27e9537aa1187b86c249b1b48e451ded4cb Author: Peng Fan Date: Tue Feb 15 16:12:02 2022 +0800 dt-bindings: watchdog: imx7ulp-wdt: Add imx93 compatible string The wdog on i.MX93 is modified from i.MX8ULP with some changes, it uses one compatible string, so add i.MX93 support. Signed-off-by: Peng Fan Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220215081202.787853-1-peng.fan@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4dbabc4d9e8cc6d8267a9883d6694c8925235e1a Author: Runyang Chen Date: Tue Mar 1 13:37:33 2022 +0800 watchdog: mediatek: mt8186: add wdt support Support MT8186 watchdog device. Signed-off-by: Runyang Chen Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220301054405.25021-4-rex-bc.chen@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 1d6866e8f15c978e82ef16ce6d21ee96b2eca7ee Author: Runyang Chen Date: Tue Mar 1 13:37:32 2022 +0800 dt-bindings: reset: mt8186: add reset-controller header file 1. Add toprgu reset-controller header file for MT8186. 2. Add DSI software reset bit which is controlled in MMSYS for MT8186. Signed-off-by: Runyang Chen Signed-off-by: Rex-BC Chen Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220301054405.25021-3-rex-bc.chen@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a45b408a020ba53e0a2b2214e1371ef6d42ad5c4 Author: Rex-BC Chen Date: Tue Mar 1 13:37:31 2022 +0800 dt-bindings: watchdog: Add compatible for MediaTek MT8186 Add dt-binding documentation of watchdog for MediaTek MT8186 SoC. Signed-off-by: Rex-BC Chen Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220301054405.25021-2-rex-bc.chen@mediatek.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8c6a490e404fe82b53bbafe0f0eeef10605617f7 Author: Mark Rutland Date: Fri May 6 13:11:45 2022 +0100 lkdtm/stackleak: fix CONFIG_GCC_PLUGIN_STACKLEAK=n Recent rework broke building LKDTM when CONFIG_GCC_PLUGIN_STACKLEAK=n. This patch fixes that breakage. Prior to recent stackleak rework, the LKDTM STACKLEAK_ERASING code could be built when the kernel was not built with stackleak support, and would run a test that would almost certainly fail (or pass by sheer cosmic coincidence), e.g. | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: checking unused part of the thread stack (15560 bytes)... | lkdtm: FAIL: the erased part is not found (checked 15560 bytes) | lkdtm: FAIL: the thread stack is NOT properly erased! | lkdtm: This is probably expected, since this kernel (5.18.0-rc2 aarch64) was built *without* CONFIG_GCC_PLUGIN_STACKLEAK=y The recent rework to the test made it more accurate by using helpers which are only defined when CONFIG_GCC_PLUGIN_STACKLEAK=y, and so when building LKDTM when CONFIG_GCC_PLUGIN_STACKLEAK=n, we get a build failure: | drivers/misc/lkdtm/stackleak.c: In function 'check_stackleak_irqoff': | drivers/misc/lkdtm/stackleak.c:30:46: error: implicit declaration of function 'stackleak_task_low_bound' [-Werror=implicit-function-declaration] | 30 | const unsigned long task_stack_low = stackleak_task_low_bound(current); | | ^~~~~~~~~~~~~~~~~~~~~~~~ | drivers/misc/lkdtm/stackleak.c:31:47: error: implicit declaration of function 'stackleak_task_high_bound'; did you mean 'stackleak_task_init'? [-Werror=implicit-function-declaration] | 31 | const unsigned long task_stack_high = stackleak_task_high_bound(current); | | ^~~~~~~~~~~~~~~~~~~~~~~~~ | | stackleak_task_init | drivers/misc/lkdtm/stackleak.c:33:48: error: 'struct task_struct' has no member named 'lowest_stack' | 33 | const unsigned long lowest_sp = current->lowest_stack; | | ^~ | drivers/misc/lkdtm/stackleak.c:74:23: error: implicit declaration of function 'stackleak_find_top_of_poison' [-Werror=implicit-function-declaration] | 74 | poison_high = stackleak_find_top_of_poison(task_stack_low, untracked_high); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ This patch fixes the issue by not compiling the body of the test when CONFIG_GCC_PLUGIN_STACKLEAK=n, and replacing this with an unconditional XFAIL message. This means the pr_expected_config() in check_stackleak_irqoff() is redundant, and so it is removed. Where an architecture does not support stackleak, the test will log: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: XFAIL: stackleak is not supported on this arch (HAVE_ARCH_STACKLEAK=n) Where an architectures does support stackleak, but this has not been compiled in, the test will log: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: XFAIL: stackleak is not enabled (CONFIG_GCC_PLUGIN_STACKLEAK=n) Where stackleak has been compiled in, the test behaves as usual: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: stackleak stack usage: | high offset: 336 bytes | current: 688 bytes | lowest: 1232 bytes | tracked: 1232 bytes | untracked: 672 bytes | poisoned: 14136 bytes | low offset: 8 bytes | lkdtm: OK: the rest of the thread stack is properly erased Fixes: f4cfacd92972cc44 ("lkdtm/stackleak: rework boundary management") Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220506121145.1162908-1-mark.rutland@arm.com commit 88959a39a1708fc755a89923d60e50de74847bc9 Author: Mark Rutland Date: Wed Apr 27 18:31:28 2022 +0100 arm64: entry: use stackleak_erase_on_task_stack() On arm64 we always call stackleak_erase() on a task stack, and never call it on another stack. We can avoid some redundant work by using stackleak_erase_on_task_stack(), telling the stackleak code that it's being called on a task stack. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Kees Cook Cc: Will Deacon Acked-by: Catalin Marinas Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-14-mark.rutland@arm.com commit 8111e67dee9ff774712cff8e34fba465c8361960 Author: Mark Rutland Date: Wed Apr 27 18:31:27 2022 +0100 stackleak: add on/off stack variants The stackleak_erase() code dynamically handles being on a task stack or another stack. In most cases, this is a fixed property of the caller, which the caller is aware of, as an architecture might always return using the task stack, or might always return using a trampoline stack. This patch adds stackleak_erase_on_task_stack() and stackleak_erase_off_task_stack() functions which callers can use to avoid on_thread_stack() check and associated redundant work when the calling stack is known. The existing stackleak_erase() is retained as a safe default. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-13-mark.rutland@arm.com commit f171d695f3adfd8093272fa5776ef4a2c6b9cf08 Author: Mark Rutland Date: Wed Apr 27 18:31:26 2022 +0100 lkdtm/stackleak: check stack boundaries The stackleak code relies upon the current SP and lowest recorded SP falling within expected task stack boundaries. Check this at the start of the test. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Kees Cook Cc: Will Deacon Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-12-mark.rutland@arm.com commit f03a50938decaa601f02294e4d057fb0048ca9ca Author: Mark Rutland Date: Wed Apr 27 18:31:25 2022 +0100 lkdtm/stackleak: prevent unexpected stack usage The lkdtm_STACKLEAK_ERASING() test is instrumentable and runs with IRQs unmasked, so it's possible for unrelated code to clobber the task stack and/or manipulate current->lowest_stack while the test is running, resulting in spurious failures. The regular stackleak erasing code is non-instrumentable and runs with IRQs masked, preventing similar issues. Make the body of the test non-instrumentable, and run it with IRQs masked, avoiding such spurious failures. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Kees Cook Cc: Will Deacon Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-11-mark.rutland@arm.com commit 72b61896f2b47fa4b98e86184bc0e6ddbd1a8db1 Author: Mark Rutland Date: Wed Apr 27 18:31:24 2022 +0100 lkdtm/stackleak: rework boundary management There are a few problems with the way the LKDTM STACKLEAK_ERASING test manipulates the stack pointer and boundary values: * It uses the address of a local variable to determine the current stack pointer, rather than using current_stack_pointer directly. As the local variable could be placed anywhere within the stack frame, this can be an over-estimate of the true stack pointer value. * Is uses an estimate of the current stack pointer as the upper boundary when scanning for poison, even though prior functions could have used more stack (and may have updated current->lowest stack accordingly). * A pr_info() call is made in the middle of the test. As the printk() code is out-of-line and will make use of the stack, this could clobber poison and/or adjust current->lowest_stack. It would be better to log the metadata after the body of the test to avoid such problems. These have been observed to result in spurious test failures on arm64. In addition to this there are a couple of things which are sub-optimal: * To avoid the STACK_END_MAGIC value, it conditionally modifies 'left' if this contains more than a single element, when it could instead calculate the bound unconditionally using stackleak_task_low_bound(). * It open-codes the poison scanning. It would be better if this used the same helper code as used by erasing function so that the two cannot diverge. This patch reworks the test to avoid these issues, making use of the recently introduced helpers to ensure this is aligned with the regular stackleak code. As the new code tests stack boundaries before accessing the stack, there is no need to fail early when the tracked or untracked portions of the stack extend all the way to the low stack boundary. As stackleak_find_top_of_poison() is now used to find the top of the poisoned region of the stack, the subsequent poison checking starts at this boundary and verifies that stackleak_find_top_of_poison() is working correctly. The pr_info() which logged the untracked portion of stack is now moved to the end of the function, and logs the size of all the portions of the stack relevant to the test, including the portions at the top and bottom of the stack which are not erased or scanned, and the current / lowest recorded stack usage. Tested on x86_64: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: stackleak stack usage: | high offset: 168 bytes | current: 336 bytes | lowest: 656 bytes | tracked: 656 bytes | untracked: 400 bytes | poisoned: 15152 bytes | low offset: 8 bytes | lkdtm: OK: the rest of the thread stack is properly erased Tested on arm64: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: stackleak stack usage: | high offset: 336 bytes | current: 656 bytes | lowest: 1232 bytes | tracked: 1232 bytes | untracked: 672 bytes | poisoned: 14136 bytes | low offset: 8 bytes | lkdtm: OK: the rest of the thread stack is properly erased Tested on arm64 with deliberate breakage to the starting stack value and poison scanning: | # echo STACKLEAK_ERASING > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry STACKLEAK_ERASING | lkdtm: FAIL: non-poison value 24 bytes below poison boundary: 0x0 | lkdtm: FAIL: non-poison value 32 bytes below poison boundary: 0xffff8000083dbc00 ... | lkdtm: FAIL: non-poison value 1912 bytes below poison boundary: 0x78b4b9999e8cb15 | lkdtm: FAIL: non-poison value 1920 bytes below poison boundary: 0xffff8000083db400 | lkdtm: stackleak stack usage: | high offset: 336 bytes | current: 688 bytes | lowest: 1232 bytes | tracked: 576 bytes | untracked: 288 bytes | poisoned: 15176 bytes | low offset: 8 bytes | lkdtm: FAIL: the thread stack is NOT properly erased! | lkdtm: Unexpected! This kernel (5.18.0-rc1-00013-g1f7b1f1e29e0-dirty aarch64) was built with CONFIG_GCC_PLUGIN_STACKLEAK=y Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-10-mark.rutland@arm.com commit 4130a61cebb1843517d68017a967f27fb602b885 Author: Mark Rutland Date: Wed Apr 27 18:31:23 2022 +0100 lkdtm/stackleak: avoid spurious failure The lkdtm_STACKLEAK_ERASING() test scans for a contiguous block of poison values between the low stack bound and the stack pointer, and fails if it does not find a sufficiently large block. This can happen legitimately if the scan the low stack bound, which could occur if functions called prior to lkdtm_STACKLEAK_ERASING() used a large amount of stack. If this were to occur, it means that the erased portion of the stack is smaller than the size used by the scan, but does not cause a functional problem In practice this is unlikely to happen, but as this is legitimate and would not result in a functional problem, the test should not fail in this case. Remove the spurious failure case. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-9-mark.rutland@arm.com commit 77cf2b6dee6680536a3109d894f1b1ccda3fc5bf Author: Mark Rutland Date: Wed Apr 27 18:31:22 2022 +0100 stackleak: rework poison scanning Currently we over-estimate the region of stack which must be erased. To determine the region to be erased, we scan downwards for a contiguous block of poison values (or the low bound of the stack). There are a few minor problems with this today: * When we find a block of poison values, we include this block within the region to erase. As this is included within the region to erase, this causes us to redundantly overwrite 'STACKLEAK_SEARCH_DEPTH' (128) bytes with poison. * As the loop condition checks 'poison_count <= depth', it will run an additional iteration after finding the contiguous block of poison, decrementing 'erase_low' once more than necessary. As this is included within the region to erase, this causes us to redundantly overwrite an additional unsigned long with poison. * As we always decrement 'erase_low' after checking an element on the stack, we always include the element below this within the region to erase. As this is included within the region to erase, this causes us to redundantly overwrite an additional unsigned long with poison. Note that this is not a functional problem. As the loop condition checks 'erase_low > task_stack_low', we'll never clobber the STACK_END_MAGIC. As we always decrement 'erase_low' after this, we'll never fail to erase the element immediately above the STACK_END_MAGIC. In total, this can cause us to erase `128 + 2 * sizeof(unsigned long)` bytes more than necessary, which is unfortunate. This patch reworks the logic to find the address immediately above the poisoned region, by finding the lowest non-poisoned address. This is factored into a stackleak_find_top_of_poison() helper both for clarity and so that this can be shared with the LKDTM test in subsequent patches. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-8-mark.rutland@arm.com commit 0cfa2ccd285d98ad62218add2eebdcfff69fb2c0 Author: Mark Rutland Date: Wed Apr 27 18:31:21 2022 +0100 stackleak: rework stack high bound handling Prior to returning to userspace, we reset current->lowest_stack to a reasonable high bound. Currently we do this by subtracting the arbitrary value `THREAD_SIZE/64` from the top of the stack, for reasons lost to history. Looking at configurations today: * On i386 where THREAD_SIZE is 8K, the bound will be 128 bytes. The pt_regs at the top of the stack is 68 bytes (with 0 to 16 bytes of padding above), and so this covers an additional portion of 44 to 60 bytes. * On x86_64 where THREAD_SIZE is at least 16K (up to 32K with KASAN) the bound will be at least 256 bytes (up to 512 with KASAN). The pt_regs at the top of the stack is 168 bytes, and so this cover an additional 88 bytes of stack (up to 344 with KASAN). * On arm64 where THREAD_SIZE is at least 16K (up to 64K with 64K pages and VMAP_STACK), the bound will be at least 256 bytes (up to 1024 with KASAN). The pt_regs at the top of the stack is 336 bytes, so this can fall within the pt_regs, or can cover an additional 688 bytes of stack. Clearly the `THREAD_SIZE/64` value doesn't make much sense -- in the worst case, this will cause more than 600 bytes of stack to be erased for every syscall, even if actual stack usage were substantially smaller. This patches makes this slightly less nonsensical by consistently resetting current->lowest_stack to the base of the task pt_regs. For clarity and for consistency with the handling of the low bound, the generation of the high bound is split into a helper with commentary explaining why. Since the pt_regs at the top of the stack will be clobbered upon the next exception entry, we don't need to poison these at exception exit. By using task_pt_regs() as the high stack boundary instead of current_top_of_stack() we avoid some redundant poisoning, and the compiler can share the address generation between the poisoning and resetting of `current->lowest_stack`, making the generated code more optimal. It's not clear to me whether the existing `THREAD_SIZE/64` offset was a dodgy heuristic to skip the pt_regs, or whether it was attempting to minimize the number of times stackleak_check_stack() would have to update `current->lowest_stack` when stack usage was shallow at the cost of unconditionally poisoning a small portion of the stack for every exit to userspace. For now I've simply removed the offset, and if we need/want to minimize updates for shallow stack usage it should be easy to add a better heuristic atop, with appropriate commentary so we know what's going on. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-7-mark.rutland@arm.com commit 1723d39d2fe49b8a75939060c95e7e908b463793 Author: Mark Rutland Date: Wed Apr 27 18:31:20 2022 +0100 stackleak: clarify variable names The logic within __stackleak_erase() can be a little hard to follow, as `boundary` switches from being the low bound to the high bound mid way through the function, and `kstack_ptr` is used to represent the start of the region to erase while `boundary` represents the end of the region to erase. Make this a little clearer by consistently using clearer variable names. The `boundary` variable is removed, the bounds of the region to erase are described by `erase_low` and `erase_high`, and bounds of the task stack are described by `task_stack_low` and `task_stack_high`. As the same time, remove the comment above the variables, since it is unclear whether it's intended as rationale, a complaint, or a TODO, and is more confusing than helpful. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-6-mark.rutland@arm.com commit 9ec79840d6afaf472294588a6bbe145bcdffa28b Author: Mark Rutland Date: Wed Apr 27 18:31:19 2022 +0100 stackleak: rework stack low bound handling In stackleak_task_init(), stackleak_track_stack(), and __stackleak_erase(), we open-code skipping the STACK_END_MAGIC at the bottom of the stack. Each case is implemented slightly differently, and only the __stackleak_erase() case is commented. In stackleak_task_init() and stackleak_track_stack() we unconditionally add sizeof(unsigned long) to the lowest stack address. In stackleak_task_init() we use end_of_stack() for this, and in stackleak_track_stack() we use task_stack_page(). In __stackleak_erase() we handle this by detecting if `kstack_ptr` has hit the stack end boundary, and if so, conditionally moving it above the magic. This patch adds a new stackleak_task_low_bound() helper which is used in all three cases, which unconditionally adds sizeof(unsigned long) to the lowest address on the task stack, with commentary as to why. This uses end_of_stack() as stackleak_task_init() did prior to this patch, as this is consistent with the code in kernel/fork.c which initializes the STACK_END_MAGIC value. In __stackleak_erase() we no longer need to check whether we've spilled into the STACK_END_MAGIC value, as stackleak_track_stack() ensures that `current->lowest_stack` stops immediately above this, and similarly the poison scan will stop immediately above this. For stackleak_task_init() and stackleak_track_stack() this results in no change to code generation. For __stackleak_erase() the generated assembly is slightly simpler and shorter. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-5-mark.rutland@arm.com commit ac7838b4e1c552d54e67f78a29bc1bd7701c13e8 Author: Mark Rutland Date: Wed Apr 27 18:31:18 2022 +0100 stackleak: remove redundant check In __stackleak_erase() we check that the `erase_low` value derived from `current->lowest_stack` is above the lowest legitimate stack pointer value, but this is already enforced by stackleak_track_stack() when recording the lowest stack value. Remove the redundant check. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-4-mark.rutland@arm.com commit a12685e2d1f7eed58ee408ba375606577b59610c Author: Mark Rutland Date: Wed Apr 27 18:31:17 2022 +0100 stackleak: move skip_erasing() check earlier In stackleak_erase() we check skip_erasing() after accessing some fields from current. As generating the address of current uses asm which hazards with the static branch asm, this work is always performed, even when the static branch is patched to jump to the return at the end of the function. This patch avoids this redundant work by moving the skip_erasing() check earlier. To avoid complicating initialization within stackleak_erase(), the body of the function is split out into a __stackleak_erase() helper, with the check left in a wrapper function. The __stackleak_erase() helper is marked __always_inline to ensure that this is inlined into stackleak_erase() and not instrumented. Before this patch, on x86-64 w/ GCC 11.1.0 the start of the function is: : 65 48 8b 04 25 00 00 mov %gs:0x0,%rax 00 00 48 8b 48 20 mov 0x20(%rax),%rcx 48 8b 80 98 0a 00 00 mov 0xa98(%rax),%rax 66 90 xchg %ax,%ax <------------ static branch 48 89 c2 mov %rax,%rdx 48 29 ca sub %rcx,%rdx 48 81 fa ff 3f 00 00 cmp $0x3fff,%rdx After this patch, on x86-64 w/ GCC 11.1.0 the start of the function is: : 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) <--- static branch 65 48 8b 04 25 00 00 mov %gs:0x0,%rax 00 00 48 8b 48 20 mov 0x20(%rax),%rcx 48 8b 80 98 0a 00 00 mov 0xa98(%rax),%rax 48 89 c2 mov %rax,%rdx 48 29 ca sub %rcx,%rdx 48 81 fa ff 3f 00 00 cmp $0x3fff,%rdx Before this patch, on arm64 w/ GCC 11.1.0 the start of the function is: : d503245f bti c d5384100 mrs x0, sp_el0 f9401003 ldr x3, [x0, #32] f9451000 ldr x0, [x0, #2592] d503201f nop <------------------------------- static branch d503233f paciasp cb030002 sub x2, x0, x3 d287ffe1 mov x1, #0x3fff eb01005f cmp x2, x1 After this patch, on arm64 w/ GCC 11.1.0 the start of the function is: : d503245f bti c d503201f nop <------------------------------- static branch d503233f paciasp d5384100 mrs x0, sp_el0 f9401003 ldr x3, [x0, #32] d287ffe1 mov x1, #0x3fff f9451000 ldr x0, [x0, #2592] cb030002 sub x2, x0, x3 eb01005f cmp x2, x1 While this may not be a huge win on its own, moving the static branch will permit further optimization of the body of the function in subsequent patches. Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-3-mark.rutland@arm.com commit e85094c31ddb794ac41c299a5a7a68243148f829 Author: Mark Rutland Date: Wed Apr 27 18:31:16 2022 +0100 arm64: stackleak: fix current_top_of_stack() Due to some historical confusion, arm64's current_top_of_stack() isn't what the stackleak code expects. This could in theory result in a number of problems, and practically results in an unnecessary performance hit. We can avoid this by aligning the arm64 implementation with the x86 implementation. The arm64 implementation of current_top_of_stack() was added specifically for stackleak in commit: 0b3e336601b82c6a ("arm64: Add support for STACKLEAK gcc plugin") This was intended to be equivalent to the x86 implementation, but the implementation, semantics, and performance characteristics differ wildly: * On x86, current_top_of_stack() returns the top of the current task's task stack, regardless of which stack is in active use. The implementation accesses a percpu variable which the x86 entry code maintains, and returns the location immediately above the pt_regs on the task stack (above which x86 has some padding). * On arm64 current_top_of_stack() returns the top of the stack in active use (i.e. the one which is currently being used). The implementation checks the SP against a number of potentially-accessible stacks, and will BUG() if no stack is found. The core stackleak_erase() code determines the upper bound of stack to erase with: | if (on_thread_stack()) | boundary = current_stack_pointer; | else | boundary = current_top_of_stack(); On arm64 stackleak_erase() is always called on a task stack, and on_thread_stack() should always be true. On x86, stackleak_erase() is mostly called on a trampoline stack, and is sometimes called on a task stack. Currently, this results in a lot of unnecessary code being generated for arm64 for the impossible !on_thread_stack() case. Some of this is inlined, bloating stackleak_erase(), while portions of this are left out-of-line and permitted to be instrumented (which would be a functional problem if that code were reachable). As a first step towards improving this, this patch aligns arm64's implementation of current_top_of_stack() with x86's, always returning the top of the current task's stack. With GCC 11.1.0 this results in the bulk of the unnecessary code being removed, including all of the out-of-line instrumentable code. While I don't believe there's a functional problem in practice I've marked this as a fix since the semantic was clearly wrong, the fix itself is simple, and other code might rely upon this in future. Fixes: 0b3e336601b82c6a ("arm64: Add support for STACKLEAK gcc plugin") Signed-off-by: Mark Rutland Cc: Alexander Popov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Kees Cook Cc: Will Deacon Acked-by: Catalin Marinas Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220427173128.2603085-2-mark.rutland@arm.com commit 035f7f87b7295a342577aebd7b5b451f1e2a353c Author: Kees Cook Date: Tue May 3 13:55:03 2022 -0700 randstruct: Enable Clang support Clang 15 will support randstruct via the -frandomize-layout-seed-file=... option. Update the Kconfig and Makefile to recognize this feature. Cc: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-7-keescook@chromium.org commit be2b34fa9be31c60a95989f984c9a5d40cd781b6 Author: Kees Cook Date: Tue May 3 13:55:02 2022 -0700 randstruct: Move seed generation into scripts/basic/ To enable Clang randstruct support, move the structure layout randomization seed generation out of scripts/gcc-plugins/ into scripts/basic/ so it happens early enough that it can be used by either compiler implementation. The gcc-plugin still builds its own header file, but now does so from the common "randstruct.seed" file. Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-6-keescook@chromium.org commit 613f4b3ed7902d1dbbc6ade6401e452a63dfbc21 Author: Kees Cook Date: Tue May 3 13:55:01 2022 -0700 randstruct: Split randstruct Makefile and CFLAGS To enable the new Clang randstruct implementation[1], move randstruct into its own Makefile and split the CFLAGS from GCC_PLUGINS_CFLAGS into RANDSTRUCT_CFLAGS. [1] https://reviews.llvm.org/D121556 Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-5-keescook@chromium.org commit 595b893e2087de306d0781795fb8ec47873596a6 Author: Kees Cook Date: Tue May 3 13:55:00 2022 -0700 randstruct: Reorganize Kconfigs and attribute macros In preparation for Clang supporting randstruct, reorganize the Kconfigs, move the attribute macros, and generalize the feature to be named CONFIG_RANDSTRUCT for on/off, CONFIG_RANDSTRUCT_FULL for the full randomization mode, and CONFIG_RANDSTRUCT_PERFORMANCE for the cache-line sized mode. Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-4-keescook@chromium.org commit d3646589703731026ae7bcba5731fa7a7d0e5291 Author: Kees Cook Date: Tue May 3 13:54:59 2022 -0700 sancov: Split plugin build from plugin CFLAGS When the sancov_plugin is enabled, it gets added to gcc-plugin-y which is used to populate both GCC_PLUGIN (for building the plugin) and GCC_PLUGINS_CFLAGS (for enabling and options). Instead of adding sancov to both and then removing it from GCC_PLUGINS_CFLAGS, create a separate list, gcc-plugin-external-y, which is only added to GCC_PLUGIN. This will also be used by the coming randstruct build changes. Cc: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-3-keescook@chromium.org commit 3b5eed3c71a2fb60aa4405ad92a2a6ad2677f220 Author: Kees Cook Date: Tue May 3 13:54:58 2022 -0700 netfs: Eliminate Clang randstruct warning Clang's structure layout randomization feature gets upset when it sees struct inode (which is randomized) cast to struct netfs_i_context. This is due to seeing the inode pointer as being treated as an array of inodes, rather than "something else, following struct inode". Since netfs can't use container_of() (since it doesn't know what the true containing struct is), it uses this direct offset instead. Adjust the code to better reflect what is happening: an arbitrary pointer is being adjusted and cast to something else: use a "void *" for the math. The resulting binary output is the same, but Clang no longer sees an unexpected cross-structure cast: In file included from ../fs/nfs/inode.c:50: In file included from ../fs/nfs/fscache.h:15: In file included from ../include/linux/fscache.h:18: ../include/linux/netfs.h:298:9: error: casting from randomized structure pointer type 'struct inode *' to 'struct netfs_i_context *' return (struct netfs_i_context *)(inode + 1); ^ 1 error generated. Cc: David Howells Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503205503.3054173-2-keescook@chromium.org Reviewed-by: Jeff Layton Link: https://lore.kernel.org/lkml/7562f8eccd7cc0e447becfe9912179088784e3b9.camel@kernel.org commit be938c70e292731f81226917fc214683e66da577 Author: James_Lin Date: Mon Apr 18 11:06:52 2022 +0200 media: uvcvideo: Add UVC_GUID_FORMAT_H265 This patch aims to add UVC_GUID_FORMAT_H265 High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2. They describe the same video encoding method. So for handling their behavior is the same. However, when external camera device describes this encoding method, some use hevc, some use h265. There is no uniform specification to describe this encoding method. So if an external camera device use h265 to describe this encoding method, driver will not recognize it. Therefore, this patch is to enable driver to read HEVC/H265 and convert it to V4L2_PIX_FMT_HEVC. Signed-off-by: James_Lin Reviewed-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 5b9c75c794ce041e6e00789efef75d71915c4f4c Author: Ricardo Ribalda Date: Fri Apr 1 19:24:37 2022 +0200 media: uvcvideo: Undup use uvc_endpoint_max_bpi() code Replace manual decoding of psize in uvc_parse_streaming(), with the code from uvc_endpoint_max_bpi(). It also handles usb3 devices. Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit c89d3bbbfc1125b0784bdc1ff76d3fd564e38c97 Author: Ricardo Ribalda Date: Fri Apr 1 19:24:36 2022 +0200 media: uvcvideo: Simplify uvc_endpoint_max_bpi() The case USB_SPEED_WIRELESS and the default one were doing the same. Also, make always use of usb_endpoint_maxp_mult, as it should have a sane value, even for LOW speed and WIRELESS. Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 18a9b21f7a9d417ac07e2d2717a6a9679b664627 Author: Ricardo Ribalda Date: Fri Apr 1 18:44:58 2022 +0200 media: uvcvideo: Fix memory leak if uvc_ctrl_add_mapping fails Move all the life cycle of the name to add_mapping. This simplifies the error handling inside uvc_ioctl_ctrl_map and solves a memory leak when kemmdup fails. Also make sure that for custom controls, the user provides a valid name. Fixes: 07adedb5c606 ("media: uvcvideo: Use control names from framework") Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 1c8af8e93748d173b6eac55108455aca18bd93c9 Author: Hangyu Hua Date: Thu Mar 24 10:13:08 2022 +0100 media: uvcvideo: Fix bit overflow in uvc_probe_video probe->dwMaxPayloadTransferSize is a 32bit value, but bandwidth is 16bit. This may lead to a bit overflow. Signed-off-by: Hangyu Hua Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 261f33388c29f6f3c12a724e6d89172b7f6d5996 Author: Xiaomeng Tong Date: Sat Mar 19 11:22:22 2022 +0100 media: uvcvideo: Fix missing check to determine if element is found in list The list iterator will point to a bogus position containing HEAD if the list is empty or the element is not found in list. This case should be checked before any use of the iterator, otherwise it will lead to a invalid memory access. The missing check here is before "pin = iterm->id;", just add check here to fix the security bug. In addition, the list iterator value will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the element is not found in list, considering the (mis)use here: "if (iterm == NULL". Use a new value 'it' as the list iterator, while use the old value 'iterm' as a dedicated pointer to point to the found element, which 1. can fix this bug, due to 'iterm' is NULL only if it's not found. 2. do not need to change all the uses of 'iterm' after the loop. 3. can also limit the scope of the list iterator 'it' *only inside* the traversal loop by simply declaring 'it' inside the loop in the future, as usage of the iterator outside of the list_for_each_entry is considered harmful. https://lkml.org/lkml/2022/2/17/1032 Fixes: d5e90b7a6cd1c ("[media] uvcvideo: Move to video_ioctl2") Signed-off-by: Xiaomeng Tong Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e3a0f5569e17b4ddb24487f6243ae0cae3879550 Author: Jonathan Neuschäfer Date: Tue Mar 15 23:10:06 2022 +0100 media: docs: media: uvcvideo: Use linux-media mailing list As discussed with other developers, the linux-uvc-devel mailing list is not very useful anymore, and it's better to send people to the general linux-media mailing list. Replace/remove the old mailing list address in uvcvideo.rst and MAINTAINERS. Signed-off-by: Jonathan Neuschäfer Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 2a952d92f75b1f71a3a00f05536c6b7eff700b0f Author: Sean Young Date: Thu Apr 7 10:43:38 2022 +0200 media: gpio-ir-tx: simplify wait logic Do not handroll mdelay(). Suggested-by: Geert Uytterhoeven Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 73bce575ed90c752eaa4b2b9a70860481d58d240 Author: Uwe Kleine-König Date: Thu May 5 09:07:27 2022 +0200 leds: lp50xx: Remove duplicated error reporting in .remove() Returning an error value from an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As stk3310_set_state() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, don't pass the error value up the stack. Instead continue to clean up and return 0. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Pavel Machek commit 1d6a1b5e505b52777f20b9bac5c1f8624f5a8776 Author: Johan Hovold Date: Thu May 5 10:03:58 2022 +0200 leds: qcom-lpg: add missing PWM dependency The Qualcomm LPG driver fails to probe unless PWM support is enabled so add the missing Kconfig dependency. Fixes: 24e2d05d1b68 ("leds: Add driver for Qualcomm LPG") Signed-off-by: Johan Hovold Signed-off-by: Pavel Machek commit 69175786d5bc81da7cc8baab92f1ac0b07567dba Author: Markuss Broks Date: Thu May 5 18:25:18 2022 +0300 leds: ktd2692: Make aux-gpios optional Make the AUX pin optional, since it isn't a core part of functionality, and the device is designed to be operational with only one CTRL pin. Reviewed-by: Andy Shevchenko Signed-off-by: Markuss Broks Signed-off-by: Pavel Machek commit 92db043f030225f1fbfdbe105db7ac2b8a420068 Author: Markuss Broks Date: Thu May 5 18:25:17 2022 +0300 dt-bindings: leds: convert ktd2692 bindings to yaml This patch converts the leds-ktd2692.txt bindings to modern yaml style device-tree bindings. Reviewed-by: Rob Herring Signed-off-by: Markuss Broks Signed-off-by: Pavel Machek commit 1d3b5aaaa41088770ae31feb075ca07893d2c898 Author: Markuss Broks Date: Thu May 5 18:25:16 2022 +0300 leds: ktd2692: Avoid duplicate error messages on probe deferral Use dev_err_probe instead of dev_err to avoid duplicate error messages if the GPIO allocation makes the probe defer. Signed-off-by: Markuss Broks Signed-off-by: Pavel Machek commit e1347bd4abfb3eaee8bbdc9089b64b249a7639b6 Author: Uwe Kleine-König Date: Wed May 4 20:31:31 2022 +0200 leds: is31fl32xx: Improve error reporting in .remove() Returning an error value in an i2c remove callback results in a generic error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. So instead of triggering the generic i2c error message, emit a more helpful message if a problem occurs and return 0 to suppress the generic message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Pavel Machek commit 818d03b3d4ae00eeb56687d2115a930406b2c7b3 Author: Sven Schwermer Date: Wed May 4 20:49:46 2022 +0200 leds: Move pwm-multicolor driver into rgb directory The drivers/leds/rgb subdirectory is relatively fresh, so we move this new PWM multi-color driver into it. Signed-off-by: Sven Schwermer Signed-off-by: Pavel Machek commit 250c1a694ff304e5d69e74ab32755eddcc2b8f65 Author: Arnd Bergmann Date: Mon Apr 4 22:52:18 2022 +0200 ARM: pxa: convert to multiplatform PXA is now ready to be built into a single kernel with all the other ARMv5 platforms, so change the Kconfig bit to finish it off. The mach/uncompress.h support is the last bit that goes away, getting replaced with the normal DEBUG_LL based approach. Signed-off-by: Arnd Bergmann commit 645b302673bb74930b5f38f1d5b7e7532f164595 Author: Arnd Bergmann Date: Sun Apr 24 14:36:35 2022 +0200 ARM: pxa/sa1100: move I/O space to PCI_IOBASE PXA and StrongARM1100 traditionally map their I/O space 1:1 into virtual memory, using a per-bus io_offset that matches the base address of the ioremap mapping. In order for PXA to work in a multiplatform config, this needs to change so I/O space starts at PCI_IOBASE (0xfee00000). Since the pcmcia soc_common support is shared with StrongARM1100, both have to change at the same time. The affected machines are: - Anything with a PCMCIA slot now uses pci_remap_iospace, which is made available to PCMCIA configurations as well, rather than just PCI. The first PCMCIA slot now starts at port number 0x10000. - The Zeus and Viper platforms have PC/104-style ISA buses, which have a static mapping for both I/O and memory space at 0xf1000000, which can no longer work. It does not appear to have any in-tree users, so moving it to port number 0 makes them behave like a traditional PC. - SA1100 does support ISA slots in theory, but all machines that originally enabled this appear to have been removed from the tree ages ago, and the I/O space is never mapped anywhere. - The Nanoengine machine has support for PCI slots, but looks like this never included I/O space, the resources only define the location for memory and config space. With this, the definitions of __io() and IO_SPACE_LIMIT can be simplified, as the only remaining cases are the generic PCI_IOBASE and the custom inb()/outb() macros on RiscPC. S3C24xx still has a custom inb()/outb() in this here, but this is already removed in another branch. Signed-off-by: Arnd Bergmann commit 5414bea9a462ba66b54f6ceee6e29b0a3b071828 Author: Arnd Bergmann Date: Mon Apr 4 22:00:55 2022 +0200 ARM: pxa: remove support for MTD_XIP Using MTD-XIP does not work on multiplatform kernels because it requires SoC specific register accesses to be done from low-level flash handling functions in RAM while the rest of the kernel sits in flash. I found no evidence of anyone still actually using this feature, so remove it from PXA to avoid spending a lot of time on actually making it work. Signed-off-by: Arnd Bergmann commit e6acc4062c02ee4a1a3ae961d073229f72e8f200 Author: Arnd Bergmann Date: Mon Apr 4 22:37:04 2022 +0200 ARM: pxa: move mach/*.h to mach-pxa/ None of the headers are included from outside of the mach-pxa directory, so move them all in there. Signed-off-by: Arnd Bergmann commit c8a91428941b912d66e13a2719fe6ac670150d69 Author: Arnd Bergmann Date: Mon Apr 4 23:38:28 2022 +0200 ARM: PXA: fix multi-cpu build of xsc3 On a kernel that includes both ARMv4 and XScale support, the copypage function fails to build with invalid instructions. Since these are only called on an actual XScale processor, annotate the assembly with the correct .arch directive. Signed-off-by: Arnd Bergmann commit 64dbc4dd7a7cc6642c522963a6194b62480e2a68 Author: Arnd Bergmann Date: Fri Sep 20 13:33:40 2019 +0200 ARM: pxa: move plat-pxa to drivers/soc/ There are two drivers in arch/arm/plat-pxa: mfp and ssp. Both of them should ideally not be needed at all, as there are proper subsystems to replace them. OTOH, they are self-contained and can simply be normal SoC drivers, so move them over there to eliminate one more of the plat-* directories. Acked-by: Robert Jarzmik (mach-pxa) Acked-by: Lubomir Rintel (mach-mmp) Signed-off-by: Arnd Bergmann commit 6922a3d14e85040c022bbad23af4de5c03557e21 Author: Arnd Bergmann Date: Thu Sep 19 12:25:06 2019 +0200 ARM: mmp: rename pxa_register_device In a multiplatform kernel that includes both pxa and mmp, we get a link failure from the clash of two pxa_register_device functions. Rename the one in mach-mmp to mmp_register_device, along with with the rename of pxa_device_desc. Acked-by: Lubomir Rintel Signed-off-by: Arnd Bergmann commit 340d01335891347303e4ae8d07b4c7bfc1fa6dcc Author: Arnd Bergmann Date: Thu Sep 19 15:12:45 2019 +0200 ARM: mmp: remove tavorevb board support There are two tavorevb boards in the kernel, one using a PXA930 chip in mach-pxa, and one using the later PXA910 chip in mach-mmp. They use the same board number, which is generally a bad idea, and in a multiplatform kernel, we can end up with funny link errors like this one resulting from two boards gettting controlled by the same Kconfig symbol: arch/arm/mach-mmp/tavorevb.o: In function `tavorevb_init': tavorevb.c:(.init.text+0x4c): undefined reference to `pxa910_device_uart1' tavorevb.c:(.init.text+0x50): undefined reference to `pxa910_device_gpio' tavorevb.o:(.arch.info.init+0x54): undefined reference to `pxa910_init_irq' tavorevb.o:(.arch.info.init+0x58): undefined reference to `pxa910_timer_init' The mach-pxa TavorEVB seems much more complete than the mach-mmp one that supports only uart, gpio and ethernet. Further, I could find no information about the board on the internet aside from references to the Linux kernel, so I assume this was never available outside of Marvell and can be removed entirely. There is a third board named TavorEVB in the Kconfig description, but this refers to the "TTC_DKB" machine. The two are clearly related, so I change the Kconfig description to just list both names. Cc: Lubomir Rintel Reviewed-by: Lubomir Rintel Signed-off-by: Arnd Bergmann commit b72232b42037e248e23dfbf2092ec50c8b5608e0 Author: Arnd Bergmann Date: Thu Sep 19 11:15:18 2019 +0200 ARM: pxa: remove unused mach/bitfield.h The sa1111.h header defines some constants using the bitfield macros, but those are only used on sa1100, not on pxa, and the users include the bitfield header through mach/hardware.h. Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 3c816d950a494ae6e16b1fa017af29bc53cb7791 Author: Arnd Bergmann Date: Wed Sep 18 20:54:17 2019 +0200 ARM: pxa: move clk register definitions to driver The clock register definitions are now used (almost) exclusively in the clk driver, and that relies on no other mach/*.h header files any more. Remove the dependency on mach/pxa*-regs.h by addressing the registers as offsets from a void __iomem * pointer, which is either passed from a board file, or (for the moment) ioremapped at boot time from a hardcoded address in case of DT (this should be moved into the DT of course). Cc: linux-clk@vger.kernel.org Acked-by: Stephen Boyd Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit fd13f8117f7a2d4054bf420ec1428e918a24a480 Author: Arnd Bergmann Date: Wed Sep 18 17:42:52 2019 +0200 ARM: pxa: move smemc register access from clk to platform The get_sdram_rows() and get_memclkdiv() helpers need smemc register that are separate from the clk registers, move them out of the clk driver, and use an extern declaration instead. Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Link: https://lore.kernel.org/lkml/87pnielzo4.fsf@belgarion.home/ Signed-off-by: Arnd Bergmann commit 5c6603e741921c75f67a724e798642ed50a6328e Author: Arnd Bergmann Date: Wed Sep 18 15:34:10 2019 +0200 cpufreq: pxa3: move clk register access to clk driver The driver needs some low-level register access for setting the core and bus frequencies. These registers are owned by the clk driver, so move the low-level access into that driver with a slightly higher-level interface and avoid any machine header file dependencies. Cc: Michael Turquette Cc: Stephen Boyd Acked-by: Viresh Kumar Cc: linux-clk@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: Arnd Bergmann commit e0a3596eb811bb86c9b5b2fe46493aa7782692ba Author: Arnd Bergmann Date: Wed Sep 18 15:10:51 2019 +0200 ARM: pxa: remove get_clk_frequency_khz() get_clk_frequency_khz() is not a proper name for a global function, and there is only one caller. Convert viper to use the properly namespaced pxa25x_get_clk_frequency_khz() and remove the other references. Acked-by: Viresh Kumar Acked-by: Robert Jarzmik Cc: linux-pm@vger.kernel.org Signed-off-by: Arnd Bergmann commit 6a946f1bd5cc966c9dd377b14efa4cec388101ce Author: Arnd Bergmann Date: Wed Sep 18 14:50:37 2019 +0200 ARM: pxa: pcmcia: move smemc configuration back to arch Rather than poking at the smemc registers directly from the pcmcia/pxa2xx_base driver, move those bits into machine file to have a cleaner interface. Cc: Dominik Brodowski Link: https://lore.kernel.org/lkml/87d0egjzxk.fsf@belgarion.home/ Signed-off-by: Arnd Bergmann commit 85c611991255603fef24e374eed3b35175be490b Author: Arnd Bergmann Date: Wed Sep 18 10:52:31 2019 +0200 ASoC: pxa: i2s: use normal MMIO accessors To avoid dereferencing hardwired constant pointers from a global header file, change the driver to use devm_platform_ioremap_resource for getting an __iomem pointer, and then using readl/writel on that. Each pointer dereference gets changed by a search&replace, which leads to a few overlong lines, but seems less risky than trying to clean up the code at the same time. Acked-by: Mark Brown Acked-by: Robert Jarzmik Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 8ff064521f97554cd9bc95af8902485e97131c78 Author: Arnd Bergmann Date: Wed Sep 18 10:52:31 2019 +0200 ASoC: pxa: ac97: use normal MMIO accessors To avoid dereferencing hardwired constant pointers from a global header file, change the driver to use devm_platform_ioremap_resource for getting an __iomem pointer, and then using readl/writel on that. Each pointer dereference gets changed by a search&replace, which leads to a few overlong lines, but seems less risky than trying to clean up the code at the same time. Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 4d2dba6b6e7b697bba7e8167ab8b0ac8b3df492c Author: Arnd Bergmann Date: Wed Sep 18 10:20:19 2019 +0200 ASoC: pxa: use pdev resource for FIFO regs The driver currently takes the hardwired FIFO address from a header file that we want to eliminate. Change it to use the mmio resource instead and stop including the here. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit e1d8f31218aab302df9e18526345af189fd061f0 Author: Dmitry Torokhov Date: Fri Oct 18 13:48:34 2019 -0700 Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops Now that we are using oneshot threaded IRQ this method is not used anymore. Signed-off-by: Dmitry Torokhov [arnd: add the db1300 change as well] Cc: Manuel Lauss Signed-off-by: Arnd Bergmann commit a2ef926143b84664f4823c82a437b29c4667a08c Author: Dmitry Torokhov Date: Fri Oct 18 13:48:33 2019 -0700 Input: wm97xx - switch to using threaded IRQ Instead of manually disabling and enabling interrupts and scheduling work to access the device, let's use threaded oneshot interrupt handler. It simplifies things. Signed-off-by: Dmitry Torokhov Signed-off-by: Arnd Bergmann commit e217b085a1ac1c4108fe632bdaa08ea5b0ecd145 Author: Arnd Bergmann Date: Wed Sep 18 09:55:23 2019 +0200 Input: touchscreen: use wrapper for pxa2xx ac97 registers To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff. Acked-by: Dmitry Torokhov Acked-by: Robert Jarzmik Cc: linux-input@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 7b8a0b90b6597fb6853383d28db2b1b0ebac0924 Author: Arnd Bergmann Date: Thu Sep 12 10:57:54 2019 +0200 input: touchscreen: mainstone: sync with zylonite driver The two drivers are almost identical and can work on a variety of hardware in principle. The mainstone driver supports additional hardware, and the zylonite driver has a few cleanup patches. Sync the two by adding the zylonite changes into the mainstone one, and checking for the zylonite board to order to keep the default behavior (interrupt enabled) there. Acked-by: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Arnd Bergmann commit bb628a6eb1a1b6539dc5a250a4b0b51c14ea7045 Author: Arnd Bergmann Date: Thu Sep 12 10:56:20 2019 +0200 input: touchscreen: mainstone: fix pxa2xx+pxa3xx configuration There are two different ways of flushing the ac97 queue in this driver, selected by a compile time option. Change this to a runtime selection to make it work when both are enabled. Acked-by: Dmitry Torokhov Acked-by: Robert Jarzmik Cc: linux-input@vger.kernel.org Signed-off-by: Arnd Bergmann commit f0b66b606ad0409c55539aa8326dd6b386b6594a Author: Arnd Bergmann Date: Wed Sep 11 23:20:45 2019 +0200 ARM: pxa: zylonite: use gpio lookup instead mfp header The mach/mfp.h header is only used by this one driver for hardcoded gpio numbers. Change that to use a lookup table instead. Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Acked-by: Robert Jarzmik Acked-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 0ca7231fe3a98c61f3a87c4cb99082cbfa5210f0 Author: Arnd Bergmann Date: Wed Sep 11 23:37:28 2019 +0200 ARM: pxa: mainstone-wm97xx: use gpio lookup table This driver hardcodes gpio numbers without a header file. Use lookup tables instead. Cc: Marek Vasut Acked-by: Dmitry Torokhov Acked-by: Robert Jarzmik Reviewed-by: Linus Walleij Cc: linux-input@vger.kernel.org Signed-off-by: Arnd Bergmann commit f1131a46f37ea249e7190a1bc0845ee6a4c3f92e Author: Arnd Bergmann Date: Tue Sep 17 16:08:07 2019 +0200 ARM: pxa: magician: use platform driver for audio The magician audio driver creates a codec device and gets data from a board specific header file, both of which is a bit suspicious. Move these into the board file itself, using a gpio lookup table. Acked-by: Mark Brown Acked-by: Robert Jarzmik Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 83a551c82d9e861238ae6d1958aa4aa6d1cedb6c Author: Arnd Bergmann Date: Tue Sep 17 14:40:58 2019 +0200 ARM: pxa: z2: use gpio lookup for audio device The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 216459838355b66a7dc617bfb727878dd8631431 Author: Arnd Bergmann Date: Tue Sep 17 14:25:44 2019 +0200 ARM: pxa: eseries: use gpio lookup for audio The three eseries machines have very similar drivers for audio, all using the mach/eseries-gpio.h header for finding the gpio numbers. Change these to use gpio descriptors to avoid the header file dependency. I convert the _OFF gpio numbers into GPIO_ACTIVE_LOW ones for consistency here. Acked-by: Mark Brown Acked-by: Robert Jarzmik Reviewed-by: Linus Walleij Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 726d8c965bae2d7468445d990849e281dca8cbf7 Author: Arnd Bergmann Date: Wed Sep 11 16:43:59 2019 +0200 ARM: pxa: spitz: use gpio descriptors for audio The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 047dc2a21ed01437f99bc78c55a8ff86dfe3493e Author: Arnd Bergmann Date: Wed Sep 11 16:10:33 2019 +0200 ARM: pxa: lubbock: pass udc irqs as resource Lubbock is the only machine that has three IRQs for the UDC. These are currently hardcoded in the driver based on a machine header file. Change this to use platform device resources as we use for the generic IRQ anyway. Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit e6c91e1adfd385e99cbe5d1b90684ebeb96540ea Author: Arnd Bergmann Date: Wed Sep 11 14:27:13 2019 +0200 ARM: pxa: hx4700: use gpio descriptors for audio The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table. Cc: Philipp Zabel Cc: Paul Parsons Acked-by: Mark Brown Acked-by: Robert Jarzmik Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 2f361e9459559d4ea97f6645ea6d2f814fb5f2e9 Author: Arnd Bergmann Date: Wed Sep 11 13:57:45 2019 +0200 ARM: pxa: corgi: use gpio descriptors for audio The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann commit ac70f4d80df414223130b04d9b4435bf56dda654 Author: Arnd Bergmann Date: Wed Sep 11 10:58:26 2019 +0200 ARM: pxa: poodle: use platform data for poodle asoc driver The poodle audio driver shows its age by using a custom gpio api for the "locomo" support chip. In a perfect world, this would get converted to use gpiolib and a gpio lookup table. As the world is not perfect, just pass all the required data in a custom platform_data structure. to avoid the globally visible mach/poodle.h header. Acked-by: Mark Brown Acked-by: Robert Jarzmik Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 813c2aee51dd7d7d9092251851e33f66719513cc Author: Linus Walleij Date: Sat May 7 14:33:31 2022 +0200 ARM/pxa/mfd/power/sound: Switch Tosa to GPIO descriptors The Tosa device (Sharp SL-6000) has a mishmash driver set-up for the Toshiba TC6393xb MFD that includes a battery charger and touchscreen and has some kind of relationship to the SoC sound driver for the AC97 codec. Other devices define a chip like this but seem only half-implemented, not really handling battery charging etc. This patch switches the Toshiba MFD device to provide GPIO descriptors to the battery charger and SoC codec. As a result some descriptors need to be moved out of the Tosa boardfile and new one added: all SoC GPIO resources to these drivers now comes from the main boardfile, while the MFD provide GPIOs for its portions. As a result we can request one GPIO from our own GPIO chip and drop two hairy callbacks into the board file. This platform badly needs to have its drivers split up and converted to device tree probing to handle this quite complex relationship in an orderly manner. I just do my best in solving the GPIO descriptor part of the puzzle. Please don't ask me to fix everything that is wrong with these driver to todays standards, I am just trying to fix one aspect. I do try to use modern devres resource management and handle deferred probe using new functions where appropriate. Cc: Dmitry Eremin-Solenikov Cc: Dirk Opfer Cc: Robert Jarzmik Cc: Daniel Mack Cc: Haojian Zhuang Cc: Lee Jones Cc: Liam Girdwood Reviewed-by: Dmitry Baryshkov Acked-by: Mark Brown Acked-by: Sebastian Reichel Signed-off-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 24df12013853ac59c52cc726e9cbe51e38d09eda Author: Dmitry Baryshkov Date: Sat Apr 30 00:53:24 2022 +0300 MAINTAINERS: Add Dmitry as MSM DRM driver co-maintainer For the past several releases I have been assisting Rob by writing, collecting, testing and integrating patches for non-GPU and non-core parts of MSM DRM driver, while Rob is more interested in improving the GPU-related part. Let's note this in the MAINTAINERS file. While we are at it, per Rob's suggestion let's also promote Abhinav Kumar to M: (as he is actively working on the driver) and switch Sean Paul to R: (since he isn't doing much on msm these days). Signed-off-by: Dmitry Baryshkov Acked-by: Rob Clark Link: https://lore.kernel.org/r/20220429215324.3729441-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark commit 5832f1ae50600ac6b2b6d00cfef42d33a9473f06 Author: Zhen Lei Date: Fri May 6 19:44:02 2022 +0800 docs: kdump: Update the crashkernel description for arm64 Now arm64 has added support for "crashkernel=X,high" and "crashkernel=Y,low". Unlike x86, crash low memory is not allocated if "crashkernel=Y,low" is not specified. Signed-off-by: Zhen Lei Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-7-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit 8af6b91f58341325bf74ecb0389ddc0039091d84 Author: Zhen Lei Date: Fri May 6 19:44:01 2022 +0800 of: Support more than one crash kernel regions for kexec -s When "crashkernel=X,high" is used, there may be two crash regions: high=crashk_res and low=crashk_low_res. But now the syscall kexec_file_load() only add crashk_res into "linux,usable-memory-range", this may cause the second kernel to have no available dma memory. Fix it like kexec-tools does for option -c, add both 'high' and 'low' regions into the dtb. Signed-off-by: Zhen Lei Acked-by: Rob Herring Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-6-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit fb319e77a0e70b9ccfef87827d34b10d6bc2ccce Author: Chen Zhou Date: Fri May 6 19:44:00 2022 +0800 of: fdt: Add memory for devices by DT property "linux,usable-memory-range" When reserving crashkernel in high memory, some low memory is reserved for crash dump kernel devices and never mapped by the first kernel. This memory range is advertised to crash dump kernel via DT property under /chosen, linux,usable-memory-range = We reused the DT property linux,usable-memory-range and made the low memory region as the second range "BASE2 SIZE2", which keeps compatibility with existing user-space and older kdump kernels. Crash dump kernel reads this property at boot time and call memblock_add() to add the low memory region after memblock_cap_memory_range() has been called. Signed-off-by: Chen Zhou Co-developed-by: Zhen Lei Signed-off-by: Zhen Lei Reviewed-by: Rob Herring Tested-by: Dave Kleikamp Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-5-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit 944a45abfabc171fd121315ff0d5e62b11cb5d6f Author: Chen Zhou Date: Fri May 6 19:43:59 2022 +0800 arm64: kdump: Reimplement crashkernel=X There are following issues in arm64 kdump: 1. We use crashkernel=X to reserve crashkernel in DMA zone, which will fail when there is not enough low memory. 2. If reserving crashkernel above DMA zone, in this case, crash dump kernel will fail to boot because there is no low memory available for allocation. To solve these issues, introduce crashkernel=X,[high,low]. The "crashkernel=X,high" is used to select a region above DMA zone, and the "crashkernel=Y,low" is used to allocate specified size low memory. Signed-off-by: Chen Zhou Co-developed-by: Zhen Lei Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20220506114402.365-4-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit e6b394425c615d1596ce7d9de23a3a34ee2e612b Author: Zhen Lei Date: Fri May 6 19:43:58 2022 +0800 arm64: Use insert_resource() to simplify code insert_resource() traverses the subtree layer by layer from the root node until a proper location is found. Compared with request_resource(), the parent node does not need to be determined in advance. In addition, move the insertion of node 'crashk_res' into function reserve_crashkernel() to make the associated code close together. Signed-off-by: Zhen Lei Acked-by: John Donnelly Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-3-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit 2e5920bb073a4e3e69cf8e581836cafc8ba1b464 Author: Zhen Lei Date: Fri May 6 19:43:57 2022 +0800 kdump: return -ENOENT if required cmdline option does not exist According to the current crashkernel=Y,low support in other ARCHes, it's an optional command-line option. When it doesn't exist, kernel will try to allocate minimum required memory below 4G automatically. However, __parse_crashkernel() returns '-EINVAL' for all error cases. It can't distinguish the nonexistent option from invalid option. Change __parse_crashkernel() to return '-ENOENT' for the nonexistent option case. With this change, crashkernel,low memory will take the default value if crashkernel=,low is not specified; while crashkernel reservation will fail and bail out if an invalid option is specified. Signed-off-by: Zhen Lei Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220506114402.365-2-thunder.leizhen@huawei.com Signed-off-by: Catalin Marinas commit f18379a30271c0289c2d0e1074e1ed633bfd708c Author: Masahiro Yamada Date: Sun May 1 17:40:19 2022 +0900 modpost: split new_symbol() to symbol allocation and hash table addition new_symbol() does two things; allocate a new symbol and register it to the hash table. Using a separate function for each is easier to understand. Replace new_symbol() with hash_add_symbol(). Remove the second parameter of alloc_symbol(). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit e76cc48d8e6df5d949284132981db73d2dd8c6b5 Author: Masahiro Yamada Date: Sun May 1 17:40:18 2022 +0900 modpost: make sym_add_exported() always allocate a new symbol Currently, sym_add_exported() does not allocate a symbol if the same name symbol already exists in the hash table. This does not reflect the real use cases. You can let an external module override the in-tree one. In this case, the external module will export the same name symbols as the in-tree one. However, modpost simply ignores those symbols, then Module.symvers for the external module loses its symbols. sym_add_exported() should allocate a new symbol. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b8422711080f57cdf9fb1c0cb8683a2112bed27c Author: Masahiro Yamada Date: Sun May 1 17:40:17 2022 +0900 modpost: make multiple export error This is currently a warning, but I think modpost should stop building in this case. If the same symbol is exported multiple times and we let it keep going, the sanity check becomes difficult. Only the legitimate case is that an external module overrides the corresponding in-tree module to provide a different implementation with the same interface. Also, there exists an upstream example that exploits this feature. $ make M=tools/testing/nvdimm ... builds tools/testing/nvdimm/libnvdimm.ko. This is a mocked module that overrides the symbols from drivers/nvdimm/libnvdimm.ko. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f841536e8c5b28e1fbf8743911ae1dc78993abd4 Author: Masahiro Yamada Date: Sun May 1 17:40:15 2022 +0900 modpost: dump Module.symvers in the same order of modules.order modpost dumps the exported symbols into Module.symvers, but currently in random order because it iterates in the hash table. Add a linked list of exported symbols in struct module, so we can iterate on symbols per module. This commit makes Module.symvers much more readable; the outer loop in write_dump() iterates over the modules in the order of modules.order, and the inner loop dumps symbols in each module. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit ab489d6002fc27dc5db6d66f121da6fc0bda13ad Author: Masahiro Yamada Date: Sun May 1 17:40:14 2022 +0900 modpost: traverse the namespace_list in order Use the doubly linked list to traverse the list in the added order. This makes the code more consistent. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 4484054816cab940fc2fde23fa989174fec889d0 Author: Masahiro Yamada Date: Sun May 1 17:40:13 2022 +0900 modpost: use doubly linked list for dump_lists This looks easier to understand (just because this is a pattern in the kernel code). No functional change is intended. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 8a69152be9a8c1f7a02c6b8410b35c68cb200f6d Author: Masahiro Yamada Date: Sun May 1 17:40:12 2022 +0900 modpost: traverse unresolved symbols in order Currently, modpost manages unresolved in a singly linked list; it adds a new node to the head, and traverses the list from new to old. Use a doubly linked list to keep the order in the symbol table in the ELF file. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit e882e89bcf1d54da2e4388570325774c3e3078a9 Author: Masahiro Yamada Date: Sun May 1 17:40:11 2022 +0900 modpost: add sym_add_unresolved() helper Add a small helper, sym_add_unresolved() to ease the further refactoring. Remove the 'weak' argument from alloc_symbol() because it is sensible only for unresolved symbols. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 325eba05e8ab53a9182a2734f0986c15e5f87349 Author: Masahiro Yamada Date: Sun May 1 17:40:10 2022 +0900 modpost: traverse modules in order Currently, modpost manages modules in a singly linked list; it adds a new node to the head, and traverses the list from new to old. It works, but the error messages are shown in the reverse order. If you have a Makefile like this: obj-m += foo.o bar.o then, modpost shows error messages in bar.o, foo.o, in this order. Use a doubly linked list to keep the order in modules.order; use list_add_tail() for the node addition and list_for_each_entry() for the list traverse. Now that the kernel's list macros have been imported to modpost, I will use them actively going forward. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 97aa4aef532aed6885e887ad6979e5ffb2667c84 Author: Masahiro Yamada Date: Sun May 1 17:40:09 2022 +0900 modpost: import include/linux/list.h Import include/linux/list.h to use convenient list macros in modpost. I dropped kernel-space code such as {WRITE,READ}_ONCE etc. and unneeded macros. I also imported container_of() from include/linux/container_of.h and type definitions from include/linux/types.h. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 5066743e4c2f702c1da8ba00a1dc217527a0ab7c Author: Masahiro Yamada Date: Sun May 1 17:40:08 2022 +0900 modpost: change mod->gpl_compatible to bool type Currently, mod->gpl_compatible is tristate; it is set to -1 by default, then to 1 or 0 when MODULE_LICENSE() is found. Maybe, -1 was chosen to represent the 'unknown' license, but it is not useful. The current code: if (!mod->gpl_compatible) check_for_gpl_usage(exp->export, basename, exp->name); ... only cares whether gpl_compatible is zero or not. Change it to a bool type with the initial value 'true', which has no functional change. The default value should be 'true' instead of 'false'. Since commit 1d6cd3929360 ("modpost: turn missing MODULE_LICENSE() into error"), unknown module license is an error. The error message, "missing MODULE_LICENSE()" is enough to explain the issue. It is not sensible to show another message, "GPL-incompatible module ... uses GPL-only symbol". Add comments to explain this. While I was here, I renamed gpl_compatible to is_gpl_compatible for clarification, and also slightly refactored the code. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 58e01fcae18c9d01be701bec9e9a8ee58269c7c1 Author: Masahiro Yamada Date: Sun May 1 17:40:07 2022 +0900 modpost: use bool type where appropriate Use 'bool' to clarify that the valid value is true or false. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 63cbee7f3a1d4f48f8aceb11598f0da4f32fb403 Author: Masahiro Yamada Date: Sat Apr 30 21:16:38 2022 +0900 ia64: make the install target not depend on any build artifact The install target should not depend on any build artifact. The reason is explained in commit 19514fc665ff ("arm, kbuild: make "make install" not depend on vmlinux"). Signed-off-by: Masahiro Yamada commit 8d613a1d048c233a490d45a26d55fc2fd58d26e8 Author: Masahiro Yamada Date: Sat Apr 30 20:04:09 2022 +0900 kbuild: drop $(objtree)/ prefix support for clean-files I think this hack is a bad idea. arch/powerpc/boot/Makefile is the only and last user. Let's stop doing this. Signed-off-by: Masahiro Yamada Acked-by: Michael Ellerman (powerpc) commit 75ef31221cec1b6056c42ac21cde59a2881d60f1 Author: Randy Dunlap Date: Mon Apr 25 20:53:18 2022 -0700 Makefile: fix 2 typos Fix typos in comments so that they make sense. Signed-off-by: Randy Dunlap Signed-off-by: Masahiro Yamada commit 70ddb48db4aaddd3c2a7d8802463e15b21ce8525 Author: Masahiro Yamada Date: Mon Apr 25 04:07:56 2022 +0900 modpost: move struct namespace_list to modpost.c There is no good reason to define struct namespace_list in modpost.h struct module has pointers to struct namespace_list, but that does not require the definition of struct namespace_list. Move it to modpost.c. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 4cae77ac582b430d6ad6fbf0e1b23248997ceac8 Author: Masahiro Yamada Date: Mon Apr 25 04:07:49 2022 +0900 modpost: retrieve the module dependency and CRCs in check_exports() Do not repeat the similar code. It is simpler to do this in check_exports() instead of add_versions(). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 23beb44a0effaad1bd627fd134f0301c622deba7 Author: Masahiro Yamada Date: Mon Apr 25 04:07:48 2022 +0900 modpost: add a separate error for exported symbols without definition It took me a while to understand the intent of "exp->module == mod". This code goes back to 2003. [1] The commit is not in this git repository, and might be worth a little explanation. You can add EXPORT_SYMBOL() without having its definition in the same file (but you need to put a declaration). This is typical when EXPORT_SYMBOL() is added in a C file, but the actual implementation is in a separate assembly file. One example is arch/arm/kernel/armksyms.c In the old days, EXPORT_SYMBOL() was only available in C files (but this limitation does not exist any more). If you forget to add the definition, this error occurs. Add a separate, clearer message for this case. It should be an error even if KBUILD_MODPOST_WARN is given. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=2763b6bcb96e6a38a2fe31108fe5759ec5bcc80a Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 594ade3eef3f2d458902ced2cb2614dfae8558de Author: Masahiro Yamada Date: Mon Apr 25 04:07:47 2022 +0900 modpost: remove stale comment about sym_add_exported() The description, it may have already been added without a CRC, in this case just update the CRC ... is no longer valid. In the old days, this function was used to update the CRC as well. Commit 040fcc819a2e ("kbuild: improved modversioning support for external modules") started to use a separate function (sym_update_crc) for updating the CRC. The first part, "Add an exported symbol" is correct, but it is too obvious from the function name. Drop this comment entirely. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit c155a47d83ab0b5ee96ebe1721057cba1936d0d5 Author: Masahiro Yamada Date: Mon Apr 25 04:07:46 2022 +0900 modpost: do not write out any file when error occurred If an error occurs, modpost will fail anyway. Do not write out any content (, which might be invalid). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 15a28c7c72917f96820e9e9ccd113606363ba3ac Author: Masahiro Yamada Date: Mon Apr 25 04:07:45 2022 +0900 modpost: use snprintf() instead of sprintf() for safety Use snprintf() to avoid the potential buffer overflow, and also check the return value to detect the too long path. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f4d40868fc4dcfd5db4999149b13fea3902c8883 Author: Vincent Mailhol Date: Sat Apr 23 00:17:25 2022 +0900 checksyscalls: ignore -Wunused-macros The macros defined in this file are for testing only and are purposely not used. When compiled with W=2, both gcc and clang yield some -Wunused-macros warnings. Ignore them. Signed-off-by: Vincent Mailhol Signed-off-by: Masahiro Yamada commit a90bb65ae2168c8b36e53f82dc3cb35c6cff4f1e Author: Jiri Slaby Date: Tue Apr 19 08:30:09 2022 +0200 scripts: dummy-tools, add pahole CONFIG_PAHOLE_VERSION is a part of a config since the commit below. And when multiple people update the config, this value constantly changes. Even if they use dummy scripts. To fix this, add a pahole dummy script returning v99.99. (This is translated into 9999 later in the process.) Thereafter, this script can be invoked easily for example as: make PAHOLE=scripts/dummy-tools/pahole oldconfig Fixes: 613fe1692377 (kbuild: Add CONFIG_PAHOLE_VERSION) Signed-off-by: Jiri Slaby Signed-off-by: Masahiro Yamada commit 1e8ca62b79dec20aeded4fe283f4890e5016767a Author: Daniel Mentz Date: Wed Apr 13 16:36:49 2022 -0700 kheaders: Have cpio unconditionally replace files For out-of-tree builds, this script invokes cpio twice to copy header files from the srctree and subsequently from the objtree. According to a comment in the script, there might be situations in which certain files already exist in the destination directory when header files are copied from the objtree: "The second CPIO can complain if files already exist which can happen with out of tree builds having stale headers in srctree. Just silence CPIO for now." GNU cpio might simply print a warning like "newer or same age version exists", but toybox cpio exits with a non-zero exit code unless the command line option "-u" is specified. To improve compatibility with toybox cpio, add the command line option "-u" to unconditionally replace existing files in the destination directory. Signed-off-by: Daniel Mentz Signed-off-by: Masahiro Yamada commit c77d06e70d59cbc6e3c22bf644bb0b197a5fc182 Author: Yann Droneaud Date: Fri Apr 8 10:46:07 2022 +0200 kbuild: support W=e to make build abort in case of warning When developing new code/feature, CONFIG_WERROR is most often turned off, especially for people using make W=12 to get more warnings. In such case, turning on -Werror temporarily would require switching on CONFIG_WERROR in the configuration, building, then switching off CONFIG_WERROR. For this use case, this patch introduces a new 'e' modifier to W= as a short hand for KCFLAGS+=-Werror" so that -Werror got added to the kernel (built-in) and modules' CFLAGS. Signed-off-by: Yann Droneaud Signed-off-by: Masahiro Yamada commit feb7d79fea1d43ddf51a09359b52e73bba0340fd Author: Masahiro Yamada Date: Thu Apr 7 00:30:23 2022 +0900 kbuild: read *.mod to get objects passed to $(LD) or $(AR) ld and ar support @file, which command-line options are read from. Now that *.mod lists the member objects in the correct order, without duplication, it is ready to be passed to ld and ar. By using the @file syntax, people will not be worried about the pitfall described in the NOTE. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit fc93a4cdce1db7568fcdff608924324f5754efe5 Author: Masahiro Yamada Date: Thu Apr 7 00:30:22 2022 +0900 kbuild: make *.mod not depend on *.o The dependency $(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o ... exists because *.mod files previously contained undefined symbols, which are computed from *.o files when CONFIG_TRIM_UNUSED_KSYMS=y. Now that the undefined symbols are put into separate *.usyms files, there is no reason to make *.mod depend on *.o files. Signed-off-by: Masahiro Yamada commit 22f26f21774f838e97921952d8c5c4aab3da2ea4 Author: Masahiro Yamada Date: Thu Apr 7 00:30:21 2022 +0900 kbuild: get rid of duplication in *.mod files It is allowed to add the same objects multiple times to obj-y / obj-m: obj-y += foo.o foo.o foo.o obj-m += bar.o bar.o bar.o It is also allowed to add the same objects multiple times to a composite module: obj-m += foo.o foo-y := foo1.o foo2.o foo2.o foo1.o This flexibility is useful because the same object might be selected by different CONFIG options, like this: obj-m += foo.o foo-y := foo1.o foo-$(CONFIG_FOO_X) += foo2.o foo-$(CONFIG_FOO_Y) += foo2.o The duplicated objects are omitted at link time. It works naturally in Makefiles because GNU Make removes duplication in $^ without changing the order. It is working well, almost... A small flaw I notice is, *.mod contains duplication in such a case. This is probably not a big deal. As far as I know, the only small problem is scripts/mod/sumversion.c parses the same file multiple times. I am fixing this because I plan to reuse *.mod for other purposes, where the duplication can be problematic. The code change is quite simple. We already use awk to drop duplicated lines in modules.order (see cmd_modules_order in the same file). I copied the code, but changed RS to use spaces as record separators. I also changed the file format to list one object per line. Signed-off-by: Masahiro Yamada commit 9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb Author: Masahiro Yamada Date: Thu Apr 7 00:30:20 2022 +0900 kbuild: split the second line of *.mod into *.usyms The *.mod files have two lines; the first line lists the member objects of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists the undefined symbols. Currently, we generate *.mod after constructing composite modules, otherwise, we cannot compute the second line. No prerequisite is required to print the first line. They are orthogonal. Splitting them into separate commands will ease further cleanups. This commit splits the list of undefined symbols out to *.usyms files. Previously, the list of undefined symbols ended up with a very long line, but now it has one symbol per line. Use sed like we did before commit 7d32358be8ac ("kbuild: avoid split lines in .mod files"). Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit b3591e061919c837c14680c1ceff8f009ed0afb4 Author: Masahiro Yamada Date: Thu Apr 7 00:30:19 2022 +0900 kbuild: reuse real-search to simplify cmd_mod The first command in cmd_mod is similar to the real-search macro. Reuse it. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit f97cf399915bc928f5f97ce93e15ce40da514e16 Author: Masahiro Yamada Date: Thu Apr 7 00:30:18 2022 +0900 kbuild: make multi_depend work with targets in subdirectory Precisely speaking, when you get the stem of the path, you should use $(patsubst $(obj)/%,%,...) instead of $(notdir ...). I do not see this usecase, but if you create a composite object in a subdirectory, the Makefile should look like this: obj-$(CONFIG_FOO) += dir/foo.o dir/foo-objs := dir/foo1.o dir/foo2.o The member objects should be assigned to dir/foo-objs instead of foo-objs. This syntax is more consistent with commit 54b8ae66ae1a ("kbuild: change *FLAGS_.o to take the path relative to $(obj)"). Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 9eef99f7a335e4ffc6dfe65fc29c7d38dafae915 Author: Masahiro Yamada Date: Thu Apr 7 00:30:17 2022 +0900 kbuild: reuse suffix-search to refactor multi_depend The complicated part of multi_depend is the same as suffix-search. Reuse it. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 7cfa2fcbac167ca0ceadf25a4b600391fd01fb29 Author: Masahiro Yamada Date: Tue Apr 5 20:33:58 2022 +0900 kbuild: refactor cmd_modversions_S Split the code into two macros, cmd_gen_symversions_S for running genksyms, and cmd_modversions for running $(LD) to update the object with CRCs. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 8017ce50641c303b9b5d96f3c10229ecfd770a70 Author: Masahiro Yamada Date: Tue Apr 5 20:33:57 2022 +0900 kbuild: refactor cmd_modversions_c cmd_modversions_c implements two parts; run genksyms to calculate CRCs of exported symbols, run $(LD) to update the object with the CRCs. The latter is not executed for CONFIG_LTO_CLANG=y since the object is not ELF but LLVM bit code at this point. The first part can be unified because we can always use $(NM) instead of "$(OBJDUMP) -h" to dump the symbols. Split the code into the two macros, cmd_gen_symversions_c and cmd_modversions. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 79f646e8654b6b8e4f7dda456ec3eabd51052041 Author: Masahiro Yamada Date: Tue Apr 5 20:33:54 2022 +0900 modpost: remove annoying namespace_from_kstrtabns() There are two call sites for sym_update_namespace(). When the symbol has no namespace, s->namespace is set to NULL, but the conversion from "" to NULL is done in two different places. [1] read_symbols() This gets the namespace from __kstrtabns_. If the symbol has no namespace, sym_get_data(info, sym) returns the empty string "". namespace_from_kstrtabns() converts it to NULL before it is passed to sym_update_namespace(). [2] read_dump() This gets the namespace from the dump file, *.symvers. If the symbol has no namespace, the 'namespace' is the empty string "", which is directly passed into sym_update_namespace(). The conversion from "" to NULL is done in sym_update_namespace(). namespace_from_kstrtabns() exists only for creating this inconsistency. Remove namespace_from_kstrtabns() so that sym_update_namespace() is consistently passed with "" instead of NULL. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit b5f1a52a59eb810f68c96d1cea7cf1256c39956c Author: Masahiro Yamada Date: Tue Apr 5 20:33:53 2022 +0900 modpost: remove redundant initializes for static variables These are initialized with zeros without explicit initializers. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 535b3e05f435698f8f661d9e6449beb5791fff59 Author: Masahiro Yamada Date: Tue Apr 5 20:33:52 2022 +0900 modpost: move export_from_secname() call to more relevant place The assigned 'export' is only used when if (strstarts(symname, "__ksymtab_")) is met. The else-part of the assignment is the dead code. Move the export_from_secname() call to where it is used. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 7ce3e410e0188ce7ca65b49c90cff2863d6e232e Author: Masahiro Yamada Date: Tue Apr 5 20:33:51 2022 +0900 modpost: remove useless export_from_sec() With commit 1743694eb235 ("modpost: stop symbol preloading for modversion CRC") applied, now export_from_sec() is useless. handle_symbol() is called for every symbol in the ELF. When 'symname' does not start with "__ksymtab", export_from_sec() is called, and the returned value is stored in 'export'. It is used in the last part of handle_symbol(): if (strstarts(symname, "__ksymtab_")) { name = symname + strlen("__ksymtab_"); sym_add_exported(name, mod, export); } 'export' is used only when 'symname' starts with "__ksymtab_". So, the value returned by export_from_sec() is never used. Remove useless export_from_sec(). This makes further cleanups possible. I put the temporary code: export = export_unknown; Otherwise, I would get the compiler warning: warning: 'export' may be used uninitialized in this function [-Wmaybe-uninitialized] This is apparently false positive because if (strstarts(symname, "__ksymtab_") ... is a stronger condition than: if (strstarts(symname, "__ksymtab") Anyway, this part will be cleaned up by the next commit. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit dfba7f5b24d1877f57f3ca296f8a654a23637149 Author: Dmitry Baryshkov Date: Sat May 7 14:40:09 2022 +0300 drm/msm/dpu: remove NULL-ness check in dpu_hw_intr_destroy There is no need to check that kfree() argument is not NULL. Remove extra check and call kfree() unconditionally. Reported-by: kernel test robot Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220507114009.1696278-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark commit 4a257ca694015f8c10aeb27bc4b32282d136b7d0 Author: Rob Clark Date: Mon May 2 10:29:08 2022 -0700 drm/msm: Limit command submission when no IOMMU Running the GPU without an IOMMU is not really a supported (or sane) configuration. Yet it can be useful during SoC bringup (ie. if the iommu driver doesn't work yet). Lets limit it to users who already have /dev/mem access, to avoid the chance that a user accidentially configures kernel without IOMMU support. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220502172908.3569799-1-robdclark@gmail.com Signed-off-by: Rob Clark commit bb52d3691db8cf24cea049235223f3599778f264 Author: Linus Walleij Date: Sun May 1 21:50:29 2022 +0200 iio: magnetometer: yas530: Fix memchr_inv() misuse The call to check if the calibration is all zeroes is doing it wrong: memchr_inv() returns NULL if the the calibration contains all zeroes, but the check is for != NULL. Fix it up. It's probably not an urgent fix because the inner check for BIT(7) in data[13] will save us. But fix it. Fixes: de8860b1ed47 ("iio: magnetometer: Add driver for Yamaha YAS530") Reported-by: Jakob Hauser Cc: Andy Shevchenko Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220501195029.151852-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron commit 048058399f19d43cf21de9f5d36cd8144337d004 Author: Hans de Goede Date: Fri May 6 11:50:40 2022 +0200 iio: adc: axp288: Override TS pin bias current for some models Since commit 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") we preserve the bias current set by the firmware at boot. This fixes issues we were seeing on various models. Some models like the Nuvision Solo 10 Draw tablet actually need the old hardcoded 80ųA bias current for battery temperature monitoring to work properly. Add a quirk entry for the Nuvision Solo 10 Draw to the DMI quirk table to restore setting the bias current to 80ųA on this model. Fixes: 9bcf15f75cac ("iio: adc: axp288: Fix TS-pin handling") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215882 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220506095040.21008-1-hdegoede@redhat.com Cc: Signed-off-by: Jonathan Cameron commit 1b2552cbdbe099b51aaffa486c042b0a7bf0a808 Author: Eric W. Biederman Date: Mon Apr 11 14:15:54 2022 -0500 fork: Stop allowing kthreads to call execve Now that kernel_execve is no longer called from kernel threads stop supporting kernel threads calling kernel_execve. Remove the code for converting a kthread to a normal thread in execve. Document the restriction that kthreads may not call kernel_execve by having kernel_execve fail if called by a kthread. Link: https://lkml.kernel.org/r/20220506141512.516114-7-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 753550eb0ce1fea4b5cbd989f2e06ef80b2feb28 Author: Eric W. Biederman Date: Mon Apr 11 14:13:56 2022 -0500 fork: Explicitly set PF_KTHREAD Instead of implicitly inheriting PF_KTHREAD from the parent process examine arguments in kernel_clone_args to see if PF_KTHREAD should be set. This makes knowledge of which new threads are kernel threads explicit. This also makes it so that init and the user mode helper processes no longer have PF_KTHREAD set. Link: https://lkml.kernel.org/r/20220506141512.516114-6-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 68d85f0a33b0cbfe4921485160ff75ea7a081215 Author: Eric W. Biederman Date: Mon Apr 11 09:58:26 2022 -0500 init: Deal with the init process being a user mode process It is silly for user_mode_thread to leave PF_KTHREAD set on the resulting task. Update the init process so that it does not care if PF_KTHREAD is set or not. Ensure do_populate_rootfs flushes all delayed fput work by calling task_work_run. In the rare instance that async_schedule_domain calls do_populate_rootfs synchronously it is possible do_populate_rootfs will be called directly from the init process. At which point fput will call "task_work_add(current, ..., TWA_RESUME)". The files on the initramfs need to be completely put before we attempt to exec them (which is before the code enters userspace). So call task_work_run just in case there are any pending fput operations. Link: https://lkml.kernel.org/r/20220506141512.516114-5-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 5bd2e97c868a8a44470950ed01846cab6328e540 Author: Eric W. Biederman Date: Tue Apr 12 10:18:48 2022 -0500 fork: Generalize PF_IO_WORKER handling Add fn and fn_arg members into struct kernel_clone_args and test for them in copy_thread (instead of testing for PF_KTHREAD | PF_IO_WORKER). This allows any task that wants to be a user space task that only runs in kernel mode to use this functionality. The code on x86 is an exception and still retains a PF_KTHREAD test because x86 unlikely everything else handles kthreads slightly differently than user space tasks that start with a function. The functions that created tasks that start with a function have been updated to set ".fn" and ".fn_arg" instead of ".stack" and ".stack_size". These functions are fork_idle(), create_io_thread(), kernel_thread(), and user_mode_thread(). Link: https://lkml.kernel.org/r/20220506141512.516114-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 36cb0e1cda645ee645b85a6ce652cb46a16e14e5 Author: Eric W. Biederman Date: Mon Apr 11 16:17:28 2022 -0500 fork: Explicity test for idle tasks in copy_thread The architectures ia64 and parisc have special handling for the idle thread in copy_process. Add a flag named idle to kernel_clone_args and use it to explicity test if an idle process is being created. Fullfill the expectations of the rest of the copy_thread implemetations and pass a function pointer in .stack from fork_idle(). This makes what is happening in copy_thread better defined, and is useful to make idle threads less special. Link: https://lkml.kernel.org/r/20220506141512.516114-3-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit c5febea0956fd3874e8fb59c6f84d68f128d68f8 Author: Eric W. Biederman Date: Fri Apr 8 18:07:50 2022 -0500 fork: Pass struct kernel_clone_args into copy_thread With io_uring we have started supporting tasks that are for most purposes user space tasks that exclusively run code in kernel mode. The kernel task that exec's init and tasks that exec user mode helpers are also user mode tasks that just run kernel code until they call kernel execve. Pass kernel_clone_args into copy_thread so these oddball tasks can be supported more cleanly and easily. v2: Fix spelling of kenrel_clone_args on h8300 Link: https://lkml.kernel.org/r/20220506141512.516114-2-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 0f9008e5c5103e32e788d260558d170c2fc9c2be Merge: 949dfdcf343c1 254c4a824c7c6 Author: Steffen Klassert Date: Sat May 7 09:19:47 2022 +0200 Merge branch 'Be explicit with XFRM offload direction' Leon Romanovsky says: ==================== I may admit that the title of this series is not the best one as it contains straightforward cleanups and code that converts flags to something less confusing. This series follows removal of FPGA IPsec code from the mlx5 driver and based on net-next commit 4950b6990e3b ("Merge branch 'ocelot-vcap-cleanups'"). As such, first two patches delete code that was used by mlx5 FPGA code but isn't needed anymore. Third patch is simple struct rename. Rest of the patches separate user's provided flags variable from driver's usage. This allows us to created more simple in-kernel interface, that supports type checking without blending different properties into one variable. It is achieved by converting flags to specific bitfield variables with clear, meaningful names. Such change allows us more clear addition of new input flags needed to mark IPsec offload type. The followup code uses this extensively: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=xfrm-next ==================== Signed-off-by: Steffen Klassert commit 8fc0b6992a06998404321f26a57ea54522659b64 Merge: 0a02e282bad4d fe5233b0ba0d2 Author: Jakub Kicinski Date: Fri May 6 21:00:15 2022 -0700 Merge branch 'simplify-migration-of-host-filtered-addresses-in-felix-driver' Vladimir Oltean says: ==================== Simplify migration of host filtered addresses in Felix driver The purpose of this patch set is to remove the functions dsa_port_walk_fdbs() and dsa_port_walk_mdbs() from the DSA core, which were introduced when the Felix driver gained support for unicast filtering on standalone ports. They get called when changing the tagging protocol back and forth between "ocelot" and "ocelot-8021q". I did not realize we could get away without having them. The patch set was regression-tested using the local_termination.sh selftest using both tagging protocols. ==================== Link: https://lore.kernel.org/r/20220505162213.307684-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit fe5233b0ba0d2216d549f93e4540542b99b97642 Author: Vladimir Oltean Date: Thu May 5 19:22:13 2022 +0300 net: dsa: delete dsa_port_walk_{fdbs,mdbs} All the users of these functions are gone, delete them before they gain new ones. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 28de0f9fec5a84bd5b56d6364432a8730eac410a Author: Vladimir Oltean Date: Thu May 5 19:22:12 2022 +0300 net: dsa: felix: perform MDB migration based on ocelot->multicast list The felix driver is the only user of dsa_port_walk_mdbs(), and there isn't even a good reason for it, considering that the host MDB entries are already saved by the ocelot switch lib in the ocelot->multicast list. Rewrite the multicast entry migration procedure around the ocelot->multicast list so we can delete dsa_port_walk_mdbs(). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit a51c1c3f3218c74c07fed55ea2ad5b18c374dc25 Author: Vladimir Oltean Date: Thu May 5 19:22:11 2022 +0300 net: dsa: felix: stop migrating FDBs back and forth on tag proto change I just realized we don't need to migrate the host-filtered FDB entries when the tagging protocol changes from "ocelot" to "ocelot-8021q". Host-filtered addresses are learned towards the PGID_CPU "multicast" port group, reserved by software, which contains BIT(ocelot->num_phys_ports). That is the "special" port entry in the analyzer block for the CPU port module. In "ocelot" mode, the CPU port module's packets are redirected to the NPI port. In "ocelot-8021q" mode, felix_8021q_cpu_port_init() does something funny anyway, and changes PGID_CPU to stop pointing at the CPU port module and start pointing at the physical port where the DSA master is attached. The fact that we can alter the destination of packets learned towards PGID_CPU without altering the MAC table entries themselves means that it is pointless to walk through the FDB entries, forget that they were learned towards PGID_CPU, and re-learn them towards the "unicast" PGID associated with the physical port connected to the DSA master. We can let the PGID_CPU value change simply alter the destination of the host-filtered unicast packets in one fell swoop. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 2c110abc46168c3a8cc9f855c986a55650c777dd Author: Vladimir Oltean Date: Thu May 5 19:22:10 2022 +0300 net: dsa: felix: use PGID_CPU for FDB entry migration on NPI port ocelot_fdb_add() redirects FDB entries installed on the NPI port towards the special reserved PGID_CPU used for host-filtered addresses. PGID_CPU contains BIT(ocelot->num_phys_ports) in the destination port mask, which is code name for the CPU port module. Whereas felix_migrate_fdbs_to_*_port() uses the ocelot->num_phys_ports PGID directly, and it appears that this works too. Even if this PGID is set to zero, apparently its number is special and packets still reach the CPU port module. Nonetheless, in the end, these addresses end up in the same place regardless of whether they go through an extra indirection layer or not. Use PGID_CPU across to have more uniformity. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 19a434aa3ebc29fda4799454afe882a5edcb1b94 Author: Marcel Ziswiler Date: Fri May 6 15:24:16 2022 +0200 ARM: dts: imx6ull-colibri: improve pinctrl node names Improve on pinctrl node names. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit a5fa132bbe4f66e4b3eea1085015a281477fa905 Author: Marcel Ziswiler Date: Fri May 6 15:24:15 2022 +0200 ARM: dts: imx6ull-colibri: move gpio-keys node to som dtsi The gpio-keys define module level wake-up pin functionality. Move it from the carrier board dts file to the Som dtsi file. While at it, also re-order the properties in the gpio-keys node alphabetically and rename to sub-node from power to wakeup. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 17c101d839f58cc4b977706719909871765fe7b9 Author: Marcel Ziswiler Date: Fri May 6 15:24:14 2022 +0200 ARM: dts: imx6ull-colibri: add/update some comments Add/update some comments. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 548453688549a69849bb93c5090767330ff98cbe Author: Marcel Ziswiler Date: Fri May 6 15:24:13 2022 +0200 ARM: dts: imx6ull-colibri: fix nand bch geometry Fix NAND BCH geometry relevant mainly for U-Boot. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 015feccc772297b7d8e95361437aa9def4adba7e Author: Denys Drozdov Date: Fri May 6 15:24:12 2022 +0200 ARM: dts: imx6ull-colibri: add support for toradex aster carrier boards Add support for Toradex Aster, small form-factor Colibri Arm Computer Module family carrier board. Aster Device Trees: - imx6ull-colibri-aster.dtb - imx6ull-colibri-emmc-aster.dtb - imx6ull-colibri-wifi-aster.dtb Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 613d063240538e6c9a880bb63eb62d6ad33a9352 Author: Denys Drozdov Date: Fri May 6 15:24:11 2022 +0200 ARM: dts: imx6ull-colibri: add support for toradex iris carrier boards Add support for Toradex Iris, small form-factor Pico-ITX Colibri Arm Computer Module family carrier boards. Iris Device Trees: - imx6ull-colibri-iris.dtb - imx6ull-colibri-emmc-iris.dtb - imx6ull-colibri-wifi-iris.dtb Iris-V2 Device Trees: - imx6ull-colibri-iris-v2.dtb - imx6ull-colibri-emmc-iris-v2.dtb - imx6ull-colibri-wifi-iris-v2.dtb Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit c8eb30d06ee8401d21b166b6e3f0f7a5b2990971 Author: Oleksandr Suvorov Date: Fri May 6 15:24:10 2022 +0200 ARM: dts: imx6ull-colibri: add gpio-line-names Add GPIO line names on module-level. Those are all GPIOs that a user might use on his custom carrier board. If more meaningful names are available on the carrier board, the user can overwrite the line names in the carrier board-level device tree. Signed-off-by: Oleksandr Suvorov Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 233edcae449c660c3bcc49848c99f9f8e60b640c Author: Denys Drozdov Date: Fri May 6 15:24:09 2022 +0200 ARM: dts: imx6ull-colibri: update device trees to support overlays Prepare in-tree device trees for out-of-tree device tree overlay support (eMMC SKU only). Relocate panel-dpi default to edt,et057090dhu (RGB 18bit VGA 640x480) to the module-level dtsi and remove it from the carrier board dtsi. Keep backlight, resistive touch and Atmel maxtouch nodes enabled for both eMMC and NAND modules. Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 8d386fa04d2f652d3d8e2a5d82e25f20a8467bfb Author: Philippe Schenker Date: Fri May 6 15:24:08 2022 +0200 ARM: dts: imx6ull-colibri: update usdhc1 pixmux and signaling Due to many carrier boards pulling the usdhc1 signals up to 3.3 volt we need to disable 1.8 volt signaling. Adding the no-1-8-v property basically disables UHS-I modes by default. Also pull-up the command and data lines to the +V3.3_1.8_SD rail and set them to the 200 MHz speed grade (e.g. pinmux bits 7-6: meaning 11 SPEED_3_max_200MHz). Explicitly specify a bus-width of <4> in the module-level device tree include file and drop the no-1-8-v property from the carrier boards device trees. Signed-off-by: Philippe Schenker Signed-off-by: Denys Drozdov Signed-off-by: Andrejs Cainikovs Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 2aa9d6201949b07dca7951710ef3be995600216c Author: Denys Drozdov Date: Fri May 6 15:24:07 2022 +0200 ARM: dts: imx6ull-colibri: add touchscreen device nodes Move all Atmel nodes from the board-level into the main module-level device tree and prepare the device trees for use with Atmel MXT device tree overlays. Also, add required pinmux groups. The common scheme for pin groups in touch screen overlays is as follows: - pinctrl_atmel_conn - SODIMM 106/107 pins for INT/RST signals (default) - pinctrl_atmel_adap - SODIMM 28/30 pins for INT/RST signals. Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 5f9a2cedfaf3206b64a4d6b287357ae4037ed4a9 Author: Philippe Schenker Date: Fri May 6 15:24:06 2022 +0200 ARM: dts: imx6ull-colibri: add phy-supply to fec This adds the proper phy-supply to the FEC. This supply is actually switched by a clock that is now properly stated. This has the advantage to add a delay for that particular regulator which is needed. Signed-off-by: Philippe Schenker Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 5516144425e413f0efe92b249142b4db15ff7ec5 Author: Max Krummenacher Date: Fri May 6 15:24:05 2022 +0200 ARM: dts: imx6ull-colibri: change touch i2c parameters Switch on 22 kOhm pull-ups and lower the I2C frequency to around 40 kHz to get more reliable communication. Signed-off-by: Max Krummenacher Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 3f781d5c67f7f5763913cccb972598df19f80c06 Author: Philippe Schenker Date: Fri May 6 15:24:04 2022 +0200 ARM: dts: imx6ull-colibri: use pull-down for adc pins Disable the keeper and enable a 100k pull-down on the ADC pins as per the following note in section 13.2 of the i.MX 6ULL Application Processor Reference Manual, Rev. 1, 11/2017 [1]: The keeper causes an undesired jump behavior in ADC. To avoid the problem, disable keeper before starting ADC. [1] https://www.nxp.com/webapp/Download?colCode=IMX6ULLRM Signed-off-by: Philippe Schenker Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit b9b19980a14fc3c37cd3936ef84a5a47aa891965 Author: Dmitry Baryshkov Date: Sun May 1 22:56:20 2022 +0300 drm/msm/dsi: pll_7nm: remove unsupported dividers for DSI pixel clock Remove dividers that are not recommended for DSI DPHY mode when setting up the clock tree for the DSI pixel clock. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/484333/ Link: https://lore.kernel.org/r/20220501195620.4135080-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 54199009958fab50af7ea308b435438f307214eb Author: Douglas Anderson Date: Wed May 4 16:39:30 2022 -0700 drm/msm: Fix shutdown When rebooting on my sc7280-herobrine based device, I got a crash. Upon debugging, I found that I was in msm_drv_shutdown() and my "pdev" was the one associated with mdss_probe(). From source, I found that mdss_probe() has the line: platform_set_drvdata(pdev, mdss); ...where "mdss" is of type "struct msm_mdss *". Also from source, I saw that in msm_drv_shutdown() we have the line: struct msm_drm_private *priv = platform_get_drvdata(pdev); This is a mismatch and is the root of the problem. Further digging made it apparent that msm_drv_shutdown() is only supposed to be used for parts of the msm display framework that also call msm_drv_probe() but mdss_probe() doesn't call msm_drv_probe(). Let's remove the shutdown functon from msm_mdss.c. Digging a little further, code inspection found that two drivers that use msm_drv_probe() weren't calling msm_drv_shutdown(). Let's add it to them. Fixes: 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/484975/ Link: https://lore.kernel.org/r/20220504163900.v2.1.Iaebd35e60160fc0f2a50fac3a0bf3b298c0637c8@changeid Signed-off-by: Dmitry Baryshkov commit cf575e31611eb6dccf08fad02e57e35b2187704d Author: Dan Carpenter Date: Thu May 5 13:28:05 2022 +0300 drm/msm: return an error pointer in msm_gem_prime_get_sg_table() The msm_gem_prime_get_sg_table() needs to return error pointers on error. This is called from drm_gem_map_dma_buf() and returning a NULL will lead to a crash in that function. Fixes: ac45146733b0 ("drm/msm: fix msm_gem_prime_get_sg_table()") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/485023/ Link: https://lore.kernel.org/r/YnOmtS5tfENywR9m@kili Signed-off-by: Dmitry Baryshkov commit ca75f6f7c6f89365e40f10f641b15981b1f07c31 Author: Jessica Zhang Date: Thu May 5 14:40:51 2022 -0700 drm/msm/mdp5: Return error code in mdp5_mixer_release when deadlock is detected There is a possibility for mdp5_get_global_state to return -EDEADLK when acquiring the modeset lock, but currently global_state in mdp5_mixer_release doesn't check for if an error is returned. To avoid a NULL dereference error, let's have mdp5_mixer_release check if an error is returned and propagate that error. Reported-by: Tomeu Vizoso Signed-off-by: Jessica Zhang Fixes: 7907a0d77cb4 ("drm/msm/mdp5: Use the new private_obj state") Reviewed-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/485181/ Link: https://lore.kernel.org/r/20220505214051.155-2-quic_jesszhan@quicinc.com Signed-off-by: Dmitry Baryshkov commit d59be579fa932c46b908f37509f319cbd4ca9a68 Author: Jessica Zhang Date: Thu May 5 14:40:50 2022 -0700 drm/msm/mdp5: Return error code in mdp5_pipe_release when deadlock is detected mdp5_get_global_state runs the risk of hitting a -EDEADLK when acquiring the modeset lock, but currently mdp5_pipe_release doesn't check for if an error is returned. Because of this, there is a possibility of mdp5_pipe_release hitting a NULL dereference error. To avoid this, let's have mdp5_pipe_release check if mdp5_get_global_state returns an error and propogate that error. Changes since v1: - Separated declaration and initialization of *new_state to avoid compiler warning - Fixed some spelling mistakes in commit message Changes since v2: - Return 0 in case where hwpipe is NULL as this is considered normal behavior - Added 2nd patch in series to fix a similar NULL dereference issue in mdp5_mixer_release Reported-by: Tomeu Vizoso Signed-off-by: Jessica Zhang Fixes: 7907a0d77cb4 ("drm/msm/mdp5: Use the new private_obj state") Reviewed-by: Rob Clark Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/485179/ Link: https://lore.kernel.org/r/20220505214051.155-1-quic_jesszhan@quicinc.com Signed-off-by: Dmitry Baryshkov commit 2f9b5b3ae2eb625b75a898212a76f3b8c6d0d2b0 Author: Kuogee Hsieh Date: Tue May 3 09:25:36 2022 -0700 drm/msm/dp: fix event thread stuck in wait_event after kthread_stop() Event thread supposed to exit from its while loop after kthread_stop(). However there may has possibility that event thread is pending in the middle of wait_event due to condition checking never become true. To make sure event thread exit its loop after kthread_stop(), this patch OR kthread_should_stop() into wait_event's condition checking so that event thread will exit its loop after kernal_stop(). Changes in v2: -- correct spelling error at commit title Changes in v3: -- remove unnecessary parenthesis -- while(1) to replace while (!kthread_should_stop()) Reported-by: Dmitry Baryshkov Fixes: 570d3e5d28db ("drm/msm/dp: stop event kernel thread when DP unbind") Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/484576/ Link: https://lore.kernel.org/r/1651595136-24312-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 9208c707650354dff5b164b586837454f7285124 Author: Dmitry Baryshkov Date: Tue May 3 23:43:40 2022 +0300 drm/msm/dsi: fix address for second DSI PHY on SDM660 Correct a typo in the address of the second DSI PHY in the SDM660 device config. Fixes: 694dd304cc29 ("drm/msm/dsi: Add phy configuration for SDM630/636/660") Cc: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/484697/ Link: https://lore.kernel.org/r/20220503204340.935532-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit c162352e70c1492939057b1a0445051e1719ef70 Author: Konrad Dybcio Date: Sat Apr 30 18:15:27 2022 +0200 drm/msm/disp: dpu1: Properly sort qcm2290_dpu_caps Due to MSM8998 support having been stuck in review for so long, another struct was added nearby, which confused git and resulted in the definitions not being sorted alphabetically. Fix it. Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/484296/ Link: https://lore.kernel.org/r/20220430161529.605843-3-konrad.dybcio@somainline.org Signed-off-by: Dmitry Baryshkov commit 01013ba9bbddc62f7d011163cebfd7ed06bb698b Author: Vinod Polimera Date: Mon May 2 22:14:06 2022 +0530 drm/msm/disp/dpu1: avoid clearing hw interrupts if hw_intr is null during drm uninit If edp modeset init is failed due to panel being not ready and probe defers during drm bind, avoid clearing irqs and dereference hw_intr when hw_intr is null. BUG: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Call trace: dpu_core_irq_uninstall+0x50/0xb0 dpu_irq_uninstall+0x18/0x24 msm_drm_uninit+0xd8/0x16c msm_drm_bind+0x580/0x5fc try_to_bring_up_master+0x168/0x1c0 __component_add+0xb4/0x178 component_add+0x1c/0x28 dp_display_probe+0x38c/0x400 platform_probe+0xb0/0xd0 really_probe+0xcc/0x2c8 __driver_probe_device+0xbc/0xe8 driver_probe_device+0x48/0xf0 __device_attach_driver+0xa0/0xc8 bus_for_each_drv+0x8c/0xd8 __device_attach+0xc4/0x150 device_initial_probe+0x1c/0x28 Changes in V2: - Update commit message and coreect fixes tag. Fixes: f25f656608e3 ("drm/msm/dpu: merge struct dpu_irq into struct dpu_hw_intr") Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/484430/ Link: https://lore.kernel.org/r/1651509846-4842-1-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov commit 4c1e9df7264567617ba2ed620338dfcef0618c39 Author: Dmitry Baryshkov Date: Mon May 2 11:24:20 2022 +0300 drm/msm/dpu: don't access mode pointer before it is set Move the initializer for the mode variable to the declaration point to remove unitialized variable access from the DEBUG_DPU macro. This fixes the following warning: drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c:250:37: note: initialize the variable 'mode' to silence this warning Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Reported-by: kernel test robot Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/484346/ Link: https://lore.kernel.org/r/20220502082420.48409-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 88334f8c937a4c9083a73fd1e8b129d00100c472 Author: Abhinav Kumar Date: Sun May 1 22:39:41 2022 -0700 drm/msm/dpu: add missing break statement for update_pending_flush_wb() Add missing break statement for dpu_hw_ctl_update_pending_flush_wb(). Otherwise this leads to below build warning. drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c:273:2: warning: unannotated fall-through between switch labels default: ^ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c:273:2: note: insert 'break;' to avoid fall-through default: ^ break; 1 warning generated. Fixes: 6d084806c8c1 ("drm/msm/dpu: add changes to support writeback in hw_ctl") Reported-by: kernel test robot Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/484337/ Link: https://lore.kernel.org/r/1651469981-21469-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 0a02e282bad4dad455553fc2b9268cf1d003f132 Author: David Thompson Date: Thu May 5 12:23:09 2022 -0400 mlxbf_gige: increase MDIO polling rate to 5us This patch increases the polling rate used by the mlxbf_gige driver on the MDIO bus. The previous polling rate was every 100us, and the new rate is every 5us. With this change the amount of time spent waiting for the MDIO BUSY signal to de-assert drops from ~100us to ~27us for each operation. Signed-off-by: David Thompson Signed-off-by: Asmaa Mnebhi Link: https://lore.kernel.org/r/20220505162309.20050-1-davthompson@nvidia.com Signed-off-by: Jakub Kicinski commit 53e2cb3b2a5a9ecd42555a1c1c0d24cf1c33b4e3 Merge: 95730d6570839 b35413f415c64 Author: Jakub Kicinski Date: Fri May 6 15:39:28 2022 -0700 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 10GbE Intel Wired LAN Driver Updates 2022-05-05 This series contains updates to ixgbe and igb drivers. Jeff Daly adjusts type for 'allow_unsupported_sfp' to match the associated struct value for ixgbe. Alaa Mohamed converts, deprecated, kmap() call to kmap_local_page() for igb. * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igb: Convert kmap() to kmap_local_page() ixgbe: Fix module_param allow_unsupported_sfp type ==================== Link: https://lore.kernel.org/r/20220505155651.2606195-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 71419129625a50cfb5e3c5cc215948a3f98c806d Author: Chao Yu Date: Fri May 6 18:30:31 2022 +0800 f2fs: give priority to select unpinned section for foreground GC Previously, during foreground GC, if victims contain data of pinned file, it will fail migration of the data, and meanwhile i_gc_failures of that pinned file may increase, and when it exceeds threshold, GC will unpin the file, result in breaking pinfile's semantics. In order to mitigate such condition, let's record and skip section which has pinned file's data and give priority to select unpinned one. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 6b8beca0edd32075a769bfe4178ca00c0dcd22a9 Author: Chao Yu Date: Fri May 6 09:33:06 2022 +0800 f2fs: fix to do sanity check on total_data_blocks As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215916 The kernel message is shown below: kernel BUG at fs/f2fs/segment.c:2560! Call Trace: allocate_segment_by_default+0x228/0x440 f2fs_allocate_data_block+0x13d1/0x31f0 do_write_page+0x18d/0x710 f2fs_outplace_write_data+0x151/0x250 f2fs_do_write_data_page+0xef9/0x1980 move_data_page+0x6af/0xbc0 do_garbage_collect+0x312f/0x46f0 f2fs_gc+0x6b0/0x3bc0 f2fs_balance_fs+0x921/0x2260 f2fs_write_single_data_page+0x16be/0x2370 f2fs_write_cache_pages+0x428/0xd00 f2fs_write_data_pages+0x96e/0xd50 do_writepages+0x168/0x550 __writeback_single_inode+0x9f/0x870 writeback_sb_inodes+0x47d/0xb20 __writeback_inodes_wb+0xb2/0x200 wb_writeback+0x4bd/0x660 wb_workfn+0x5f3/0xab0 process_one_work+0x79f/0x13e0 worker_thread+0x89/0xf60 kthread+0x26a/0x300 ret_from_fork+0x22/0x30 RIP: 0010:new_curseg+0xe8d/0x15f0 The root cause is: ckpt.valid_block_count is inconsistent with SIT table, stat info indicates filesystem has free blocks, but SIT table indicates filesystem has no free segment. So that during garbage colloection, it triggers panic when LFS allocator fails to find free segment. This patch tries to fix this issue by checking consistency in between ckpt.valid_block_count and block accounted from SIT. Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit baf7cbbefbe801ca6aedd9e0c029ce341720bc9a Merge: 48a68a4e7597e d5becc32308c3 Author: Arnd Bergmann Date: Fri May 6 23:12:14 2022 +0200 Merge tag 'tegra-for-5.19-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/soc ARM: tegra: Core changes for v5.19-rc1 A single fix for a typo in one of the comments in the SMP code. * tag 'tegra-for-5.19-arm-core' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Fix typos in comments Link: https://lore.kernel.org/r/20220506143005.3916655-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 09fffcd9692110c57b2c776d8cb3539038549886 Author: Andrey Grodzovsky Date: Fri Aug 13 10:47:57 2021 -0400 drm/amdgpu/psp: Add VBIOS flash handler Add psp vbflash function for psp v13. v2: fix warnings Signed-off-by: Andrey Grodzovsky Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bce04f216df40cb407243efce1beec9e8ea7815e Author: Andrey Grodzovsky Date: Mon Aug 16 09:57:43 2021 -0400 drm/amd/psp: Add C2P registers to mp_13_0_2 header Add additional registers. Signed-off-by: Andrey Grodzovsky Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 594a1d0f34d95c426d58624bb47aba8071c16c3a Author: Yang Li Date: Fri May 6 07:23:11 2022 +0800 drm/amdkfd: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c:244:9-10: WARNING: return of 0/1 in function 'event_interrupt_isr_v11' with return type bool Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 1e51dbad4b5a9f72435fa8172510134afe6aad67 Author: Yang Li Date: Fri May 6 07:23:12 2022 +0800 drm/amdgpu/gfx11: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1222:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 97aa0c184fe9feb5919599613aebdf8aadf6c6cb Author: James Zhu Date: Tue May 3 12:23:54 2022 -0400 drm/amdgpu/vcn4: replace ip based software ring decode with common vcn software ring decode Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu Reviewed-by: Christian Koenig Signed-off-by: Alex Deucher commit 3d4cfd9e4d3ce4381dc84fce1bb9385eeab5592b Author: James Zhu Date: Tue May 3 12:22:35 2022 -0400 drm/amdgpu/vcn3: replace ip based software ring decode with common vcn software ring decode Replace ip based software ring decode with common vcn software ring decode. Signed-off-by: James Zhu Reviewed-by: Christian Koenig Signed-off-by: Alex Deucher commit 60a2e9eecf1676e3d59f050e5c9688830d7425cc Author: James Zhu Date: Tue May 3 12:18:49 2022 -0400 drm/amdgpu/vcn: add common vcn sofware ring decode Add common vcn sofware ring decode. v2: fixed compiling error Signed-off-by: James Zhu Reviewed-by: Christian Koenig Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e02fe3bc7aba2f7b292c6005b8334fffd4ac5e5f Author: Richard Gong Date: Fri Apr 8 12:08:38 2022 -0500 drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems Active State Power Management (ASPM) feature is enabled since kernel 5.14. There are some AMD Volcanic Islands (VI) GFX cards, such as the WX3200 and RX640, that do not work with ASPM-enabled Intel Alder Lake based systems. Using these GFX cards as video/display output, Intel Alder Lake based systems will freeze after suspend/resume. The issue was originally reported on one system (Dell Precision 3660 with BIOS version 0.14.81), but was later confirmed to affect at least 4 pre-production Alder Lake based systems. Add an extra check to disable ASPM on Intel Alder Lake based systems with the problematic AMD Volcanic Islands GFX cards. Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885 Signed-off-by: Richard Gong Signed-off-by: Alex Deucher commit d54762cc3e6abb08f5ae31e3fa6a249768c07617 Author: Christian König Date: Thu May 5 11:03:51 2022 +0200 drm/amdgpu: nuke dynamic gfx scratch reg allocation It's over a decade ago that this was actually used for more than ring and IB tests. Just use the static register directly where needed and nuke the now useless infrastructure. Signed-off-by: Christian König Acked-by: Lang Yu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit bf1781e17f30a594f959671af59a253e9313a9b9 Author: Alex Deucher Date: Wed May 4 23:24:00 2022 -0400 drm/amdgpu: simplify nv and soc21 read_register functions Check of the base offset for the IP exists rather than explicitly checking for how many instances of a particular IP there are. This is what soc15.c already does. Expand this to nv.c and soc21.c. Acked-by: Christian König Signed-off-by: Alex Deucher commit 98f561884683cdca65bec80ef4dddfc3fe7aca63 Author: Yiqing Yao Date: Thu May 5 18:12:33 2022 +0800 drm/amdgpu: flush delete wq after wait fence [why] lru_list not empty warning in sw fini during repeated device bind unbind. There should be a amdgpu_fence_wait_empty() before the flush_delayed_work() call as Christian suggested. [how] Move to do flush_delayed_work for ttm bo delayed delete wq after fence_driver_hw_fini. Tested by: Yiqing Yao Reviewed-by: Christian König Signed-off-by: Yiqing Yao Signed-off-by: Alex Deucher commit 77ef40603f3a26e4144fa6623a6c8d5d94df6e15 Merge: ef0bf470b0ab6 e46ab742195ae Author: Arnd Bergmann Date: Fri May 6 22:54:01 2022 +0200 Merge tag 'tegra-for-5.19-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfig arm64: tegra: Default configuration updates for v5.19-rc1 This enables the driver for the new ASRC audio block that is found on Tegra186 and later. * tag 'tegra-for-5.19-arm64-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: defconfig: Build Tegra ASRC module Link: https://lore.kernel.org/r/20220506143005.3916655-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit ef0bf470b0ab62008ff821a8653ab9edc570f267 Merge: 7a2dc21938cca 39ad93d280506 Author: Arnd Bergmann Date: Fri May 6 22:52:44 2022 +0200 Merge tag 'tegra-for-5.19-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfig ARM: tegra: Default configuration fixes for v5.18 This contains two updates to the default configuration needed because of a Kconfig symbol name change. This fixes a failure that was detected in the NVIDIA automated test farm. * tag 'tegra-for-5.19-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: config: multi v7: Enable NVIDIA Tegra video decoder driver ARM: tegra_defconfig: Update CONFIG_TEGRA_VDE option Link: https://lore.kernel.org/r/20220506143005.3916655-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 7a2dc21938cca1f9d5e027b7056e903b6393ef68 Merge: a46be400e2c19 0b8842db35518 Author: Arnd Bergmann Date: Fri May 6 22:50:58 2022 +0200 Merge tag 'renesas-arm-defconfig-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v5.19 (take two) - Enable support for the Renesas RZ/G2UL and RZ/V2M SoCs in the arm64 defconfig, * tag 'renesas-arm-defconfig-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable Renesas RZ/V2M SoC arm64: defconfig: Enable ARCH_R9A07G043 Link: https://lore.kernel.org/r/cover.1651828601.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit a46be400e2c1979267cb8e2f66b2e63bd2f0d914 Merge: f68ec51423227 386d0503c1eb0 Author: Arnd Bergmann Date: Fri May 6 22:50:09 2022 +0200 Merge tag 'at91-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/defconfig AT91 defconfig #1 for 5.19: - update to MTD options and use of UBI - addition of systemd needed options - sama7: addition of reset, camera and microphone drivers * tag 'at91-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: configs: at91: Enable AUTOFS_FS required by systemd ARM: configs: at91: Enable options required for systemd ARM: configs: at91: sama7: enable CONFIG_RESET_CONTROLLER ARM: configs: at91: sama7: add MCHP PDMC and DMIC drivers ARM: configs: at91: sama7: Enable MTD_UBI_BLOCK ARM: configs: at91: sama7: Enable MTD_UBI_FASTMAP ARM: configs: at91: sama7: add xisc and csi2dc ARM: multi_v7_defconfig: add atmel video pipeline modules ARM: configs: at91: Remove MTD_BLOCK and use MTD_UBI_BLOCK for read only block FS Link: https://lore.kernel.org/r/20220506085425.58270-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 48a68a4e7597e9f8f9c9624ac911cde04af551d6 Merge: ff9fb2e8111eb 7bc53f59fbcad Author: Arnd Bergmann Date: Fri May 6 22:48:42 2022 +0200 Merge tag 'renesas-arm-soc-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/soc Renesas ARM SoC updates for v5.19 - Drop commas after sentinels. * tag 'renesas-arm-soc-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: rcar-gen2: Drop comma after OF match table sentinel ARM: shmobile: Drop commas after dt_compat sentinels Link: https://lore.kernel.org/r/cover.1651828611.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit ff9fb2e8111eb61a608b3bc8c28422f31d9a49c9 Merge: 10b1964630fdb 170a0c56c5ec5 Author: Arnd Bergmann Date: Fri May 6 22:43:55 2022 +0200 Merge tag 'samsung-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/soc Samsung mach/soc changes for v5.19 Cleanup: drop unneeded CONFIG_S3C24XX_PWM and fix some typos. * tag 'samsung-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: s3c: fix typos in comments ARM: s3c: Drop config symbol S3C24XX_PWM Link: https://lore.kernel.org/r/20220506081438.149192-6-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 73ff4d189bae17cb2aa783611ec80ba63b9c57ae Merge: 1bc44c1e79a2b 50612cf9e05d1 Author: Arnd Bergmann Date: Fri May 6 22:40:54 2022 +0200 Merge tag 'sunxi-dt-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/dt - F1C100 improvements (SPI, MMC, timer, cpu, watchdog) - SPI flash node for licheepi-nano - enabled analogue audio on olinuxino-a64 - GPIO port regulators on teres-i * tag 'sunxi-dt-for-5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: teres-i: Add GPIO port regulators arm64: dts: allwinner: a64: olinuxino: Enable audio ARM: dts: suniv: licheepi-nano: add SPI flash ARM: dts: suniv: F1C100: add SPI support dt-bindings: spi: sunxi: document F1C100 controllers ARM: dts: suniv: licheepi-nano: add microSD card ARM: dts: suniv: F1C100: add MMC controllers ARM: dts: suniv: F1C100: fix timer node ARM: dts: suniv: F1C100: fix CPU node ARM: dts: suniv: F1C100: add clock and reset macros dt-bindings: arm: sunxi: document LicheePi Nano name ARM: dts: suniv: F1C100: fix watchdog compatible dt-bindings: watchdog: sunxi: clarify clock support dt-bindings: watchdog: sunxi: fix F1C100s compatible Link: https://lore.kernel.org/r/YnVUmSLE1MZFkApt@kista.localdomain Signed-off-by: Arnd Bergmann commit 1bc44c1e79a2bad13e9e091007a1982cdb1cde1d Merge: 72a21285a7804 0017f2c856e21 Author: Arnd Bergmann Date: Fri May 6 22:39:39 2022 +0200 Merge tag 'tegra-for-5.19-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt arm64: tegra: Device tree changes for v5.19-rc1 This adds some improvements on Tegra234 (QSPI, CCPLEX), improves the SDMMC clock speed on Tegra194 and adds the ASRC audio block on various chip generations. Memory controller channels are also added on Tegra186 and later and the missing DFLL reset is added for Tegra210. * tag 'tegra-for-5.19-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Add missing DFLL reset on Tegra210 arm64: tegra: Add memory controller channels arm64: tegra: Enable ASRC on various platforms arm64: tegra: Add ASRC device on Tegra186 and later arm64: tegra: Update PWM fan node name arm64: tegra: Add node for Tegra234 CCPLEX cluster arm64: tegra: Add QSPI controllers on Tegra234 arm64: tegra: Update SDMMC1/3 clock source for Tegra194 Link: https://lore.kernel.org/r/20220506143005.3916655-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 72a21285a7804b1f4f3b7a34221ba9d86be8e5a7 Merge: 50a543372d7ca e2ab93e59bc3c Author: Arnd Bergmann Date: Fri May 6 22:38:43 2022 +0200 Merge tag 'tegra-for-5.19-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt dt-bindings: Changes for v5.19-rc1 Updates the memory controller bindings to properly validate the number of entries in the reg and reg-names properties. * tag 'tegra-for-5.19-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: memory: tegra: Update validation for reg and reg-names Link: https://lore.kernel.org/r/20220506143005.3916655-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 50a543372d7ca0ffb898c0a29b9a6f5cba69f0cc Merge: 4a17dc417aad3 033a26dcbe104 Author: Arnd Bergmann Date: Fri May 6 22:36:15 2022 +0200 Merge tag 'renesas-dt-bindings-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.19 (take two) - Document support for the R-Car V4H SoC and the White Hawk development board stack, - Document support for the RZ/V2M SoC and the RZ/V2M Evaluation Kit Board, - Document SPI Multi I/O Bus Controller (RPC-IF) support for RZ/G2UL, - Miscellaneous fixes and improvements. * tag 'renesas-dt-bindings-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: soc: renesas: Move renesas,rzg2l-sysc from arm to soc dt-bindings: memory: renesas,rpc-if: Document RZ/G2UL SoC dt-bindings: arm: renesas: Document Renesas RZ/V2M SoC and EVK board dt-bindings: power: renesas,rcar-sysc: Document r8a779g0 SYSC bindings dt-bindings: reset: renesas,rst: Document r8a779g0 reset module dt-bindings: arm: renesas: Document R-Car V4H White Hawk DT bindings Link: https://lore.kernel.org/r/cover.1651828616.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 4a17dc417aad30cf91bfb781ec042c26767eb58f Merge: 2367ee1ab9119 ad1bd2bf65806 Author: Arnd Bergmann Date: Fri May 6 22:30:58 2022 +0200 Merge tag 'renesas-arm-dt-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.19 (take two) - I2C, sound, USB, CANFD, timer, watchdog, (Q)SPI, cpufreq, and thermal support for the RZ/G2UL SoC and the RZ/G2UL SMARC EVK development board, - Initial support for the R-Car V4H SoC and the Renesas White Hawk development board stack, - DMA, RTC, and USB support for the RZ/N1D SoC, - Initial support for the RZ/V2M SoC an the RZ/V2M Evaluation Kit Board, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (40 commits) arm64: dts: renesas: Add initial device tree for RZ/V2M EVK arm64: dts: renesas: Add initial DTSI for RZ/V2M SoC arm64: dts: renesas: r8a779a0: Update to R-Car Gen4 compatible values ARM: dts: r9a06g032: Link the PCI USB devices to the USB PHY ARM: dts: r9a06g032: Add USB PHY DT support ARM: dts: r9a06g032: Add internal PCI bridge node ARM: dts: r9a06g032: Describe the RTC arm64: dts: renesas: Add interrupt-names to CANFD nodes arm64: dts: renesas: r9a07g043: Add SPI Multi I/O Bus controller node arm64: dts: renesas: r9a07g043: Create thermal zone to support IPA arm64: dts: renesas: r9a07g043: Add TSU node arm64: dts: renesas: r9a07g043: Add OPP table arm64: dts: renesas: r9a07g043: Add RSPI{0,1,2} nodes arm64: dts: renesas: r9a07g054: Fix external clk node names arm64: dts: renesas: r9a07g044: Fix external clk node names ARM: dts: r9a06g032: Fix the NAND controller node ARM: dts: r9a06g032: Fill the UART DMA properties ARM: dts: r9a06g032: Describe the DMA router ARM: dts: r9a06g032: Add the two DMA nodes arm64: dts: renesas: Remove empty rgb output endpoints ... Link: https://lore.kernel.org/r/cover.1651828603.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 2367ee1ab9119b5e8ffa7566eaa75d735ab7de9f Merge: c86071e890fda 9882948322874 Author: Arnd Bergmann Date: Fri May 6 22:26:28 2022 +0200 Merge tag 'samsung-dt64-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM64 changes for v5.19, part two 1. Cleanups: unused and undocumented dma-channels and dma-requests. 2. Add clock controllers to ExynosAutov9. * tag 'samsung-dt64-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: switch UFS clock node in ExynosAutov9 arm64: dts: exynos: switch USI clocks in ExynosAutov9 arm64: dts: exynos: add initial CMU clock nodes in ExynosAutov9 dt-bindings: clock: add Exynos Auto v9 SoC CMU bindings dt-bindings: clock: add clock binding definitions for Exynos Auto v9 arm64: dts: fsd: drop useless 'dma-channels/requests' properties arm64: dts: exynos: drop useless 'dma-channels/requests' properties arm64: dts: exynos: move XTCXO clock frequency to board in Exynos Auto v9 Link: https://lore.kernel.org/r/20220506081438.149192-5-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit c86071e890fda32caf252c670d495c531e0a64f9 Merge: 6e4c9b1fc5c24 d414b7a3f370d Author: Arnd Bergmann Date: Fri May 6 22:24:51 2022 +0200 Merge tag 'samsung-dt-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM changes for v5.19, part two 1. Cleanups: unused and undocumented dma-channels and dma-requests. 2. Correct compatible of Samsung EEPROM on S5PV210. * tag 'samsung-dt-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: drop useless 'dma-channels/requests' properties ARM: dts: s5pv210: drop useless 'dma-channels/requests' properties ARM: dts: exynos: add atmel,24c128 fallback to Samsung EEPROM Link: https://lore.kernel.org/r/20220506081438.149192-4-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 6e4c9b1fc5c24ee12ef317c919b4a8dc11229f5b Merge: 620b2c35aba11 361736cf495cc Author: Arnd Bergmann Date: Fri May 6 22:23:41 2022 +0200 Merge tag 'dt-cleanup-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Minor cleanup of ARM DTS for v5.19, part two Align SPI NOR node names to DT schema and drop unused/undocumented dma-channels/dma-requests. * tag 'dt-cleanup-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: socfpga: drop useless 'dma-channels/requests' properties ARM: dts: zynq-7000: drop useless 'dma-channels/requests' properties ARM: dts: marvell: align SPI NOR node name with dtschema ARM: dts: omap: align SPI NOR node name with dtschema ARM: dts: nuvoton: align SPI NOR node name with dtschema Link: https://lore.kernel.org/r/20220506081438.149192-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit e2ef115813c34ea5380ac5b4879f515070150210 Author: Peter Zijlstra Date: Fri May 6 14:14:37 2022 +0200 objtool: Fix STACK_FRAME_NON_STANDARD reloc type STACK_FRAME_NON_STANDARD results in inconsistent relocation types depending on .c or .S usage: Relocation section '.rela.discard.func_stack_frame_non_standard' at offset 0x3c01090 contains 5 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 00020c2200000002 R_X86_64_PC32 0000000000047b40 do_suspend_lowlevel + 0 0000000000000008 0002461e00000001 R_X86_64_64 00000000000480a0 machine_real_restart + 0 0000000000000010 0000001400000001 R_X86_64_64 0000000000000000 .rodata + b3d4 0000000000000018 0002444600000002 R_X86_64_PC32 00000000000678a0 __efi64_thunk + 0 0000000000000020 0002659d00000001 R_X86_64_64 0000000000113160 __crash_kexec + 0 Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220506121631.508692613@infradead.org commit 620b2c35aba116dce389cb57725f9dd5b5b239b1 Merge: 485b5afae6817 8dba791a72805 Author: Arnd Bergmann Date: Fri May 6 22:12:37 2022 +0200 Merge tag 'dt64-cleanup-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Minor cleanup of ARM64 DTS for v5.19 Align SPI NOR node names and freq-table-hz to DT schema. Drop unused/undocumented dma-channels/dma-requests. * tag 'dt64-cleanup-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: broadcom: drop useless 'dma-channels/requests' properties arm64: dts: stratix10/agilex: drop useless 'dma-channels/requests' properties arm64: dts: marvell: align SPI NOR node name with dtschema arm64: dts: microchip: align SPI NOR node name with dtschema arm64: dts: hisilicon: align 'freq-table-hz' with dtschema in UFS Link: https://lore.kernel.org/r/20220506081438.149192-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 68edb53a4f4b54bd84ba8f88b6ea5c0815dd1581 Merge: 819ed6f07da07 d3a20dcbca488 Author: Arnd Bergmann Date: Fri May 6 22:10:56 2022 +0200 Merge tag 'tegra-for-5.19-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: Changes for v5.19-rc1 This set of changes adds nvmem cell lookup entries for Tegra194 that are used to read calibration data from the SoC fuses, and updates the reset sources for Tegra234. Other than that, included is a minor build fix for a missing dependency that can be encountered very rarely in random config builds. Lastly some kerneldoc comments are added to avoid build warnings. * tag 'tegra-for-5.19-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Document core domain fields soc/tegra: pmc: Select REGMAP soc/tegra: pmc: Update Tegra234 reset sources soc/tegra: fuse: Add nvmem cell lookup entries for Tegra194 Link: https://lore.kernel.org/r/20220506143005.3916655-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 819ed6f07da07728368fb513859fa6a54a4dc6a2 Merge: 15b5b762454c5 27e7657a7cdc4 Author: Arnd Bergmann Date: Fri May 6 22:08:22 2022 +0200 Merge tag 'renesas-drivers-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.19 (take two) - Initial support for the R-Car V4H and RZ/V2M SoCs, - Miscellaneous fixes and improvements. * tag 'renesas-drivers-for-v5.19-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: R-Car V3U is R-Car Gen4 soc: renesas: rzn1: Select PM and PM_GENERIC_DOMAINS configs soc: renesas: Add RZ/V2M (R9A09G011) config option soc: renesas: rcar-rst: Add support for R-Car V4H soc: renesas: Identify R-Car V4H soc: renesas: r8a779g0-sysc: Add r8a779g0 support dt-bindings: clock: Add r8a779g0 CPG Core Clock Definitions dt-bindings: power: Add r8a779g0 SYSC power domain definitions Link: https://lore.kernel.org/r/cover.1651828613.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 15b5b762454c59e9043d08597db660a2d73fdd47 Merge: 7a3c3a650b678 170a0c56c5ec5 Author: Arnd Bergmann Date: Fri May 6 22:07:12 2022 +0200 Merge tag 'samsung-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers Samsung mach/soc changes for v5.19 Cleanup: drop unneeded CONFIG_S3C24XX_PWM and fix some typos. * tag 'samsung-soc-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: s3c: fix typos in comments ARM: s3c: Drop config symbol S3C24XX_PWM Link: https://lore.kernel.org/r/20220506081438.149192-6-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 7a3c3a650b678d69ed895ffbd4909332e45fdc14 Merge: 728c0d29415a3 5fe580196dd9b Author: Arnd Bergmann Date: Fri May 6 22:03:26 2022 +0200 Merge tag 'samsung-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers Samsung SoC drivers changes for v5.19 Make MCT and USI bindings stricter by describing expected interrupts per variant and expected child node. * tag 'samsung-drivers-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: timer: exynos4210-mct: describe known hardware and its interrupts dt-bindings: soc: samsung: usi: refer to dtschema for SPI Link: https://lore.kernel.org/r/20220506081438.149192-3-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 728c0d29415a3a0ac998175e0e3ad470edbfbfa8 Merge: 7ad7ab903681c d8fc1c7c4c9b7 Author: Arnd Bergmann Date: Fri May 6 22:02:10 2022 +0200 Merge tag 'tee-cleanup-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers TEE cleanup Removes the old and unused TEE_IOCTL_SHM_* flags Removes unused the unused tee_shm_va2pa() and tee_shm_pa2va() functions * tag 'tee-cleanup-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF tee: remove tee_shm_va2pa() and tee_shm_pa2va() Link: https://lore.kernel.org/r/20220506070328.GA1344495@jade Signed-off-by: Arnd Bergmann commit 343f4c49f2438d8920f1f76fa823ee59b91f02e4 Author: Eric W. Biederman Date: Mon Apr 11 11:40:14 2022 -0500 kthread: Don't allocate kthread_struct for init and umh If kthread_is_per_cpu runs concurrently with free_kthread_struct the kthread_struct that was just freed may be read from. This bug was introduced by commit 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads"). When kthread_struct started to be allocated for all tasks that have PF_KTHREAD set. This in turn required the kthread_struct to be freed in kernel_execve and violated the assumption that kthread_struct will have the same lifetime as the task. Looking a bit deeper this only applies to callers of kernel_execve which is just the init process and the user mode helper processes. These processes really don't want to be kernel threads but are for historical reasons. Mostly that copy_thread does not know how to take a kernel mode function to the process with for processes without PF_KTHREAD or PF_IO_WORKER set. Solve this by not allocating kthread_struct for the init process and the user mode helper processes. This is done by adding a kthread member to struct kernel_clone_args. Setting kthread in fork_idle and kernel_thread. Adding user_mode_thread that works like kernel_thread except it does not set kthread. In fork only allocating the kthread_struct if .kthread is set. I have looked at kernel/kthread.c and since commit 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads") there have been no assumptions added that to_kthread or __to_kthread will not return NULL. There are a few callers of to_kthread or __to_kthread that assume a non-NULL struct kthread pointer will be returned. These functions are kthread_data(), kthread_parmme(), kthread_exit(), kthread(), kthread_park(), kthread_unpark(), kthread_stop(). All of those functions can reasonably expected to be called when it is know that a task is a kthread so that assumption seems reasonable. Cc: stable@vger.kernel.org Fixes: 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads") Reported-by: Максим Кутявин Link: https://lkml.kernel.org/r/20220506141512.516114-1-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 7ad7ab903681cc7ac2ee7be00d85ad63bfa78d08 Author: Arnd Bergmann Date: Fri May 6 21:06:25 2022 +0200 nvme-apple: fix sparse endianess warnings The new nvme-apple driver is missing a few conversions to and from little-endian data: drivers/nvme/host/apple.c:291:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] prp1 @@ got restricted __le64 [usertype] prp1 @@ drivers/nvme/host/apple.c:291:19: sparse: expected unsigned long long [usertype] prp1 drivers/nvme/host/apple.c:291:19: sparse: got restricted __le64 [usertype] prp1 drivers/nvme/host/apple.c:292:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long long [usertype] prp2 @@ got restricted __le64 [usertype] prp2 @@ drivers/nvme/host/apple.c:293:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] length @@ got restricted __le16 [usertype] length @@ drivers/nvme/host/apple.c:351:52: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] next_dma_addr @@ got restricted __le64 [usertype] @@ drivers/nvme/host/apple.c:456:45: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] @@ got unsigned int [addressable] [usertype] prp_dma @@ drivers/nvme/host/apple.c:459:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] @@ got unsigned long long [assigned] [usertype] dma_addr @@ drivers/nvme/host/apple.c:474:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] prp1 @@ got unsigned int [usertype] dma_address @@ drivers/nvme/host/apple.c:475:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] prp2 @@ got unsigned int [usertype] first_dma @@ Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit 740fcdc2c20ecf855b36b919d7fa1b872b5a7eae Author: Pierre Gondois Date: Mon Apr 25 14:38:08 2022 +0200 cpufreq: CPPC: Register EM based on efficiency class information Performance states and energy consumption values are not advertised in ACPI. In the GicC structure of the MADT table, the "Processor Power Efficiency Class field" (called efficiency class from now) allows to describe the relative energy efficiency of CPUs. To leverage the EM and EAS, the CPPC driver creates a set of artificial performance states and registers them in the Energy Model (EM), such as: - Every 20 capacity unit, a performance state is created. - The energy cost of each performance state gradually increases. No power value is generated as only the cost is used in the EM. During task placement, a task can raise the frequency of its whole pd. This can make EAS place a task on a pd with CPUs that are individually less energy efficient. As cost values are artificial, and to place tasks on CPUs with the lower efficiency class, a gap in cost values is generated for adjacent efficiency classes. E.g.: - efficiency class = 0, capacity is in [0-1024], so cost values are in [0: 51] (one performance state every 20 capacity unit) - efficiency class = 1, capacity is in [0-1024], cost values are in [1*gap+0: 1*gap+51]. The value of the cost gap is chosen to absorb a the energy of 4 CPUs at their maximum capacity. This means that between: 1- a pd of 4 CPUs, each of them being used at almost their full capacity. Their efficiency class is N. 2- a CPU using almost none of its capacity. Its efficiency class is N+1 EAS will choose the first option. This patch also populates the (struct cpufreq_driver).register_em callback if the valid efficiency_class ACPI values are provided. Signed-off-by: Pierre Gondois Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit d3c3db41df7e1bdefc9c68073070b62ce3b260bd Author: Pierre Gondois Date: Mon Apr 25 14:38:07 2022 +0200 cpufreq: CPPC: Add per_cpu efficiency_class In ACPI, describing power efficiency of CPUs can be done through the following arm specific field: ACPI 6.4, s5.2.12.14 'GIC CPU Interface (GICC) Structure', 'Processor Power Efficiency Class field': Describes the relative power efficiency of the associated pro- cessor. Lower efficiency class numbers are more efficient than higher ones (e.g. efficiency class 0 should be treated as more efficient than efficiency class 1). However, absolute values of this number have no meaning: 2 isn’t necessarily half as efficient as 1. The efficiency_class field is stored in the GicC structure of the ACPI MADT table and it's currently supported in Linux for arm64 only. Thus, this new functionality is introduced for arm64 only. To allow the cppc_cpufreq driver to know and preprocess the efficiency_class values of all the CPUs, add a per_cpu efficiency_class variable to store them. At least 2 different efficiency classes must be present, otherwise there is no use in creating an Energy Model. The efficiency_class values are squeezed in [0:#efficiency_class-1] while conserving the order. For instance, efficiency classes of: [111, 212, 250] will be mapped to: [0 (was 111), 1 (was 212), 2 (was 250)]. Each policy being independently registered in the driver, populating the per_cpu efficiency_class is done only once at the driver initialization. This prevents from having each policy re-searching the efficiency_class values of other CPUs. The EM will be registered in a following patch. The patch also exports acpi_cpu_get_madt_gicc() to fetch the GicC structure of the ACPI MADT table for each CPU. Acked-by: Catalin Marinas Signed-off-by: Pierre Gondois Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 46acb9d9b6bb24448936365ec4e49198aa712090 Merge: f55ae08c89873 985a67709a66c Author: Rafael J. Wysocki Date: Fri May 6 21:00:44 2022 +0200 Merge Energy Model material for 5.19 to satisfy dependencies. commit f55ae08c89873e140c7cac2a7fa161d31a0d60cf Author: Viresh Kumar Date: Wed May 4 13:51:35 2022 +0530 cpufreq: Avoid unnecessary frequency updates due to mismatch For some platforms, the frequency returned by hardware may be slightly different from what is provided in the frequency table. For example, hardware may return 499 MHz instead of 500 MHz. In such cases it is better to avoid getting into unnecessary frequency updates, as we may end up switching policy->cur between the two and sending unnecessary pre/post update notifications, etc. This patch has chosen allows the hardware frequency and table frequency to deviate by 1 MHz for now, we may want to increase it a bit later on if someone still complains. Reported-by: Rex-BC Chen Signed-off-by: Viresh Kumar Tested-by: Jia-wei Chang Reviewed-by: Matthias Brugger Signed-off-by: Rafael J. Wysocki commit 42e5ed0618030543e4f679afa5e42ec8ab9337bb Author: Sumeet Pawnikar Date: Thu May 5 22:30:19 2022 +0530 ACPI: DPTF: Add support for high frequency impedance notification Add high frequency impedance notification support under DPTF. This returns high frequency impedance value that can be obtained from battery fuel gauge whenever there is change over a threshold. Also, corrected the typo from IMPEDANCED_CHNGED to IMPEDANCE_CHANGED. Signed-off-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit f6e109a0afedec2a9470fec31a567071e2f01e46 Author: Andy Shevchenko Date: Mon May 2 12:51:01 2022 +0300 device property: Advertise fwnode and device property count API calls The documentation of fwnode and device property array API calls isn't pointing out to the shortcuts to count the number of elements of size in an array. Amend the documentation to advertise fwnode and device property count API calls. Reported-by: Sakari Ailus Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 27263b3428f5b2b73be97adf3d679125b6065271 Author: Yajun Deng Date: Thu Apr 28 17:54:13 2022 +0800 ACPI: processor: idle: Expose max_cstate/nocst/bm_check_disable read-only in sysfs This will allow super users to verify the module parameters in question when changed via kernel command line. The parameters "nocst/bm_check_disable" are only used for enable/disable, so change them from integer to bool. Signed-off-by: Yajun Deng [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit fcdc03f78d5c8db53ba090e38474b05113d34ade Author: Heiko Carstens Date: Wed May 4 15:23:39 2022 +0200 s390/compat: cleanup compat_linux.h header file Remove various declarations from former s390 specific compat system calls which have been removed with commit fef747bab3c0 ("s390: use generic UID16 implementation"). While at it clean up the whole small header file. Signed-off-by: Heiko Carstens commit 29b06ad7e8a69ad1cbfe7898aef1d9cb7fbd02a5 Author: Heiko Carstens Date: Tue May 3 14:59:16 2022 +0200 s390/entry: remove broken and not needed code LLVM's integrated assembler reports the following error when compiling entry.S: :38:5: error: unknown token in expression tm %r8,0x0001 # coming from user space? The correct instruction would have been tmhh instead of tm. The current code is doing nothing, since (with gas) it get's translated to a tm instruction which reads from real address 8, which again contains always zero, and therefore the conditional code is never executed. Note that due to the missing displacement gas translates "%r8" into "8(%r0)". Also code inspection reveals that this conditional code is not needed. Therefore remove it. Reviewed-by: Sven Schnelle Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit f84d88ed3beb7fc2b4549e4c213ad428c0be9029 Author: Heiko Carstens Date: Mon Apr 25 21:24:56 2022 +0200 s390/boot: convert parmarea to C Convert parmarea to C, which makes it much easier to initialize it. No need to keep offsets in assembler code in sync with struct parmarea anymore. Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 834979c27f5281f37ae9ce5191134f26ae7b9fd0 Author: Heiko Carstens Date: Wed Apr 27 04:14:34 2022 +0200 s390/boot: convert initial lowcore to C Convert initial lowcore to C and use proper defines and structures to initialize it. This should make the z/VM ipl procedure a bit less magic. Acked-by: Peter Oberparleiter Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 67a9c428ef35780d09e5a3c1247919789a8212b4 Author: Heiko Carstens Date: Wed Apr 27 04:14:29 2022 +0200 s390/ptrace: move short psw definitions to ptrace header file The short psw definitions are contained in compat header files, however short psws are not compat specific. Therefore move the definitions to ptrace header file. This also gets rid of a compat header include in kvm code. Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit aceb06d1e83783bf5a25c4979647bd8af6a99654 Author: Heiko Carstens Date: Sun Apr 24 16:02:21 2022 +0200 s390/head: initialize all new psws Initialize all new psws with disabled wait psws, except for the restart new psw. This way every unexpected exception, svc, machine check, or interrupt is handled properly. Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 84f4e1dfb243c0aaed0425a2b1c308a2fb37425d Author: Heiko Carstens Date: Sun Apr 24 15:52:01 2022 +0200 s390/boot: change initial program check handler to disabled wait psw The program check handler of the kernel image points to startup_pgm_check_handler. However an early program check which happens while loading the kernel image will jump to potentially random code, since the code of the program check handler is not yet loaded; leading to a program check loop. Therefore initialize it to a disabled wait psw and let the startup code set the proper psw when everything is in memory. Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 734757976e337dff02da5e36dedbac8321326f5c Author: Heiko Carstens Date: Sun Apr 24 15:44:05 2022 +0200 s390/head: adjust iplstart entry point Move iplstart entry point to 0x200 again, instead of the middle of the ipl code. This way even the comment describing the ccw program is correct again. Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit edd4a8667355607345b76d5652adc0f300a28970 Author: Heiko Carstens Date: Sat Apr 23 21:31:22 2022 +0200 s390/boot: get rid of startup archive The final kernel image is created by linking decompressor object files with a startup archive. The startup archive file however does not contain only optional code and data which can be discarded if not referenced. It also contains mandatory object data like head.o which must never be discarded, even if not referenced. Move the decompresser code and linker script to the boot directory and get rid of the startup archive so everything is kept during link time. Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens commit 964bc5dbe602a62b7bbd67624c4b8f7a4ea692b2 Author: Heiko Carstens Date: Tue May 3 10:48:41 2022 +0200 s390/vx: remove comments from macros which break LLVM's IAS LLVM's integrated assembler does not like comments within macros: :3:19: error: too many positional arguments GR_NUM b2, 1 /* Base register */ ^ Remove them, since they are obvious anyway. Signed-off-by: Heiko Carstens commit 68a971acc9484559ae8e1cc80950f34919299eba Author: Heiko Carstens Date: Sun May 1 21:05:59 2022 +0200 s390/extable: prefer local labels in .set directives Use local labels in .set directives to avoid potential compile errors with LTO + clang. See commit 334865b2915c ("x86/extable: Prefer local labels in .set directives") for further details. Since s390 doesn't support LTO currently this doesn't fix a real bug for now, but helps to avoid problems as soon as required pieces have been added to llvm. Signed-off-by: Heiko Carstens commit f9a3099f794c67b6edbaf3cef67b80bea8923a2c Author: Heiko Carstens Date: Sun May 1 20:55:05 2022 +0200 s390/nospec: prefer local labels in .set directives Use local labels in .set directives to avoid potential compile errors with LTO + clang. See commit 334865b2915c ("x86/extable: Prefer local labels in .set directives") for further details. Since s390 doesn't support LTO currently this doesn't fix a real bug for now, but helps to avoid problems as soon as required pieces have been added to llvm. Signed-off-by: Heiko Carstens commit 108ab40fc1fe60c226f856a1e5e4cd4600a0092c Author: Julia Lawall Date: Sat Apr 30 21:11:19 2022 +0200 s390/hypfs: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220430191122.8667-5-Julia.Lawall@inria.fr Signed-off-by: Heiko Carstens commit 4b03b3ee60db1d46da7638e535848c377aa5348d Author: Julia Lawall Date: Sat Apr 30 21:11:16 2022 +0200 s390/crypto: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220430191122.8667-2-Julia.Lawall@inria.fr Signed-off-by: Heiko Carstens commit 4ae46db99cd88444fffb4591a477cefaf5330c30 Author: Guilherme G. Piccoli Date: Wed Apr 27 19:49:07 2022 -0300 s390/consoles: improve panic notifiers reliability Currently many console drivers for s390 rely on panic/reboot notifiers to invoke callbacks on these events. The panic() function disables local IRQs, secondary CPUs and preemption, so callbacks invoked on panic are effectively running in atomic context. Happens that most of these console callbacks from s390 doesn't take the proper care with regards to atomic context, like taking spinlocks that might be taken in other function/CPU and hence will cause a lockup situation. The goal for this patch is to improve the notifiers reliability, acting on 4 console drivers, as detailed below: (1) con3215: changed a regular spinlock to the trylock alternative. (2) con3270: also changed a regular spinlock to its trylock counterpart, but here we also have another problem: raw3270_activate_view() takes a different spinlock. So, we worked a helper to validate if this other lock is safe to acquire, and if so, raw3270_activate_view() should be safe. Notice though that there is a functional change here: it's now possible to continue the notifier code [reaching con3270_wait_write() and con3270_rebuild_update()] without executing raw3270_activate_view(). (3) sclp: a global lock is used heavily in the functions called from the notifier, so we added a check here - if the lock is taken already, we just bail-out, preventing the lockup. (4) sclp_vt220: same as (3), a lock validation was added to prevent the potential lockup problem. Besides (1)-(4), we also removed useless void functions, adding the code called from the notifier inside its own body, and changed the priority of such notifiers to execute late, since they are "heavyweight" for the panic environment, so we aim to reduce risks here. Changed return values to NOTIFY_DONE as well, the standard one. Signed-off-by: Guilherme G. Piccoli Link: https://lore.kernel.org/r/20220427224924.592546-14-gpiccoli@igalia.com Signed-off-by: Heiko Carstens commit 185d20694a8aceb4eda9fc1314cbaad0df0aab07 Author: Werner Sembach Date: Wed Apr 27 17:40:53 2022 +0200 ACPI: battery: Make "not-charging" the default on no charging or full info When the battery is neither charging or discharging and is not full, "not-charging" is a useful status description for the case in general. Currently this state is set as "unknown" by default, expect when this is explicitly replaced with "not-charging" on a per device or per vendor basis. A lot of devices have this state without a BIOS specification available explicitly describing it. e.g. some current Clevo barebones have a BIOS setting to stop charging at a user defined battery level. Signed-off-by: Werner Sembach Signed-off-by: Rafael J. Wysocki commit 988d7a14408db4183202f16bb02b8149b9da3727 Author: Ilkka Koskinen Date: Mon Apr 25 15:18:02 2022 -0700 ACPI: AGDI: Fix missing prototype warning for acpi_agdi_init() When building with W=1, we get the following warning: drivers/acpi/arm64/agdi.c:88:13: warning: no previous prototype for ‘acpi_agdi_init’ [-Wmissing-prototypes] void __init acpi_agdi_init(void) Include AGDI driver's header file to pull in the prototype definition for acpi_agdi_init() to get rid of the compiler warning Fixes: a2a591fb76e6 ("ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device") Reported-by: kernel test robot Signed-off-by: Ilkka Koskinen Signed-off-by: Rafael J. Wysocki commit 0b1fbfb9e9058e6eae6564cdb4ed0003d766445c Author: Bob Pearson Date: Wed Apr 20 20:40:34 2022 -0500 RDMA/rxe: Remove IB_SRQ_INIT_MASK Currently the #define IB_SRQ_INIT_MASK is used to distinguish the rxe_create_srq verb from the rxe_modify_srq verb so that some code can be shared between these two subroutines. This commit splits rxe_srq_chk_attr into two subroutines: rxe_srq_chk_init and rxe_srq_chk_attr which handle the create_srq and modify_srq verbs separately. Link: https://lore.kernel.org/r/20220421014042.26985-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 280c36d26eb80ec674df1648034b0ad2df5b0cff Author: Ian Rogers Date: Thu May 5 11:25:05 2022 -0700 perf test: Add skip to --per-thread test As reported in: https://lore.kernel.org/linux-perf-users/20220428122821.3652015-1-tmricht@linux.ibm.com/ the 'instructions:u' event may not be supported. Add a skip using 'perf record'. Switch some code away from pipe to make the failures clearer. Reported-by: Thomas Richter Signed-off-by: Ian Rogers Tested-by: Thomas Richter Cc: Heiko Carstens Cc: Jiri Olsa Cc: Namhyung Kim Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20220505182505.3313191-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d158a0608eb85f29f98357b97d01b80250636613 Author: Mark Brown Date: Thu May 5 23:15:17 2022 +0100 arm64/sme: More sensibly define the size for the ZA register set Since the vector length configuration mechanism is identical between SVE and SME we share large elements of the code including the definition for the maximum vector length. Unfortunately when we were defining the ABI for SVE we included not only the actual maximum vector length of 2048 bits but also the value possible if all the bits reserved in the architecture for expansion of the LEN field were used, 16384 bits. This starts creating problems if we try to allocate anything for the ZA matrix based on the maximum possible vector length, as we do for the regset used with ptrace during the process of generating a core dump. While the maximum potential size for ZA with the current architecture is a reasonably managable 64K with the higher reserved limit ZA would be 64M which leads to entirely reasonable complaints from the memory management code when we try to allocate a buffer of that size. Avoid these issues by defining the actual maximum vector length for the architecture and using it for the SME regsets. Also use the full ZA_PT_SIZE() with the header rather than just the actual register payload when specifying the size, fixing support for the largest vector lengths now that we have this new, lower define. With the SVE maximum this did not cause problems due to the extra headroom we had. While we're at it add a comment clarifying why even though ZA is a single register we tell the regset code that it is a multi-register regset. Reported-by: Qian Cai Signed-off-by: Mark Brown Tested-by: Naresh Kamboju Link: https://lore.kernel.org/r/20220505221517.1642014-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit cfd66bb715fd11fde3338d0660cffa1396adc27d Author: Chao Yu Date: Wed May 4 14:09:22 2022 +0800 f2fs: fix deadloop in foreground GC As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215914 The root cause is: in a very small sized image, it's very easy to exceed threshold of foreground GC, if we calculate free space and dirty data based on section granularity, in corner case, has_not_enough_free_secs() will always return true, result in deadloop in f2fs_gc(). So this patch refactors has_not_enough_free_secs() as below to fix this issue: 1. calculate needed space based on block granularity, and separate all blocks to two parts, section part, and block part, comparing section part to free section, and comparing block part to free space in openned log. 2. account F2FS_DIRTY_NODES, F2FS_DIRTY_IMETA and F2FS_DIRTY_DENTS as node block consumer; 3. account F2FS_DIRTY_DENTS as data block consumer; Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 25f8236213a91efdf708b9d77e9e51b6fc3e141c Author: Chao Yu Date: Wed Apr 27 17:51:40 2022 +0800 f2fs: fix to do sanity check on block address in f2fs_do_zero_range() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215894 I have encountered a bug in F2FS file system in kernel v5.17. I have uploaded the system call sequence as case.c, and a fuzzed image can be found in google net disk The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can reproduce the bug by running the following commands: kernel BUG at fs/f2fs/segment.c:2291! Call Trace: f2fs_invalidate_blocks+0x193/0x2d0 f2fs_fallocate+0x2593/0x4a70 vfs_fallocate+0x2a5/0xac0 ksys_fallocate+0x35/0x70 __x64_sys_fallocate+0x8e/0xf0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is, after image was fuzzed, block mapping info in inode will be inconsistent with SIT table, so in f2fs_fallocate(), it will cause panic when updating SIT with invalid blkaddr. Let's fix the issue by adding sanity check on block address before updating SIT table with it. Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 4d17e6fe9293d57081ffdc11e1cf313e25e8fd9e Author: Chao Yu Date: Wed Apr 27 01:06:02 2022 +0800 f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215897 I have encountered a bug in F2FS file system in kernel v5.17. The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can reproduce the bug by running the following commands: The kernel message is shown below: kernel BUG at fs/f2fs/f2fs.h:2511! Call Trace: f2fs_remove_inode_page+0x2a2/0x830 f2fs_evict_inode+0x9b7/0x1510 evict+0x282/0x4e0 do_unlinkat+0x33a/0x540 __x64_sys_unlinkat+0x8e/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is: .total_valid_block_count or .total_valid_node_count could fuzzed to zero, then once dec_valid_node_count() was called, it will cause BUG_ON(), this patch fixes to print warning info and set SBI_NEED_FSCK into CP instead of panic. Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a9163b947ae8f7af7cb8d63606cd87b9facbfe74 Author: Byungki Lee Date: Fri Apr 29 13:29:53 2022 -0700 f2fs: write checkpoint during FG_GC If there's not enough free sections each of which consistis of large segments, we can hit no free section for upcoming section allocation. Let's reclaim some prefree segments by writing checkpoints. Signed-off-by: Byungki Lee Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f2db71053dc0409fae785096ad19cce4c8a95af7 Author: Chao Yu Date: Sat Apr 30 21:19:24 2022 +0800 f2fs: fix to clear dirty inode in f2fs_evict_inode() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215904 The kernel message is shown below: kernel BUG at fs/f2fs/inode.c:825! Call Trace: evict+0x282/0x4e0 __dentry_kill+0x2b2/0x4d0 shrink_dentry_list+0x17c/0x4f0 shrink_dcache_parent+0x143/0x1e0 do_one_tree+0x9/0x30 shrink_dcache_for_umount+0x51/0x120 generic_shutdown_super+0x5c/0x3a0 kill_block_super+0x90/0xd0 kill_f2fs_super+0x225/0x310 deactivate_locked_super+0x78/0xc0 cleanup_mnt+0x2b7/0x480 task_work_run+0xc8/0x150 exit_to_user_mode_prepare+0x14a/0x150 syscall_exit_to_user_mode+0x1d/0x40 do_syscall_64+0x48/0x90 The root cause is: inode node and dnode node share the same nid, so during f2fs_evict_inode(), dnode node truncation will invalidate its NAT entry, so when truncating inode node, it fails due to invalid NAT entry, result in inode is still marked as dirty, fix this issue by clearing dirty for inode and setting SBI_NEED_FSCK flag in filesystem. output from dump.f2fs: [print_node_info: 354] Node ID [0xf:15] is inode i_nid[0] [0x f : 15] Cc: stable@vger.kernel.org Reported-by: Ming Yan Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 7f262f737502689ddc77117ffdefaea0a4a25b03 Author: Luis Chamberlain Date: Wed Apr 27 18:02:54 2022 +0200 f2fs: ensure only power of 2 zone sizes are allowed F2FS zoned support has power of 2 zone size assumption in many places such as in __f2fs_issue_discard_zone, init_blkz_info. As the power of 2 requirement has been removed from the block layer, explicitly add a condition in f2fs to allow only power of 2 zone size devices. This condition will be relaxed once those calculation based on power of 2 is made generic. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav Signed-off-by: Jaegeuk Kim commit d46db4595be680bf9facb783fb95cf03b85f1d05 Author: Luis Chamberlain Date: Wed Apr 27 18:02:53 2022 +0200 f2fs: call bdev_zone_sectors() only once on init_blkz_info() Instead of calling bdev_zone_sectors() multiple times, call it once and cache the value locally. This will make the subsequent change easier to read. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav Signed-off-by: Jaegeuk Kim commit 4de851459ea65ac8cf4313af648ec9cf16b72562 Author: Niels Dossche Date: Fri Apr 22 20:05:04 2022 +0200 f2fs: extend stat_lock to avoid potential race in statfs There are multiple calculations and reads of fields of sbi that should be protected by stat_lock. As stat_lock is not used to read these values in statfs, this can lead to inconsistent results. Extend the locking to prevent this issue. Commit c9c8ed50d94c ("f2fs: fix to avoid potential race on sbi->unusable_block_count access/update") already added the use of sbi->stat_lock in statfs in order to make the calculation of multiple, different fields atomic so that results are consistent. This is similar to that patch regarding the change in statfs. Signed-off-by: Niels Dossche Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a7b8618aa2f0f926ce85f2486ac835a85c753ca7 Author: Jaegeuk Kim Date: Tue Mar 29 16:25:54 2022 -0700 f2fs: avoid infinite loop to flush node pages xfstests/generic/475 can give EIO all the time which give an infinite loop to flush node page like below. Let's avoid it. [16418.518551] Call Trace: [16418.518553] ? dm_submit_bio+0x48/0x400 [16418.518574] ? submit_bio_checks+0x1ac/0x5a0 [16418.525207] __submit_bio+0x1a9/0x230 [16418.525210] ? kmem_cache_alloc+0x29e/0x3c0 [16418.525223] submit_bio_noacct+0xa8/0x2b0 [16418.525226] submit_bio+0x4d/0x130 [16418.525238] __submit_bio+0x49/0x310 [f2fs] [16418.525339] ? bio_add_page+0x6a/0x90 [16418.525344] f2fs_submit_page_bio+0x134/0x1f0 [f2fs] [16418.525365] read_node_page+0x125/0x1b0 [f2fs] [16418.525388] __get_node_page.part.0+0x58/0x3f0 [f2fs] [16418.525409] __get_node_page+0x2f/0x60 [f2fs] [16418.525431] f2fs_get_dnode_of_data+0x423/0x860 [f2fs] [16418.525452] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [16418.525458] ? __mod_memcg_state.part.0+0x2a/0x30 [16418.525465] ? __mod_memcg_lruvec_state+0x27/0x40 [16418.525467] ? __xa_set_mark+0x57/0x70 [16418.525472] f2fs_do_write_data_page+0x10e/0x7b0 [f2fs] [16418.525493] f2fs_write_single_data_page+0x555/0x830 [f2fs] [16418.525514] ? sysvec_apic_timer_interrupt+0x4e/0x90 [16418.525518] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [16418.525523] f2fs_write_cache_pages+0x303/0x880 [f2fs] [16418.525545] ? blk_flush_plug_list+0x47/0x100 [16418.525548] f2fs_write_data_pages+0xfd/0x320 [f2fs] [16418.525569] do_writepages+0xd5/0x210 [16418.525648] filemap_fdatawrite_wbc+0x7d/0xc0 [16418.525655] filemap_fdatawrite+0x50/0x70 [16418.525658] f2fs_sync_dirty_inodes+0xa4/0x230 [f2fs] [16418.525679] f2fs_write_checkpoint+0x16d/0x1720 [f2fs] [16418.525699] ? ttwu_do_wakeup+0x1c/0x160 [16418.525709] ? ttwu_do_activate+0x6d/0xd0 [16418.525711] ? __wait_for_common+0x11d/0x150 [16418.525715] kill_f2fs_super+0xca/0x100 [f2fs] [16418.525733] deactivate_locked_super+0x3b/0xb0 [16418.525739] deactivate_super+0x40/0x50 [16418.525741] cleanup_mnt+0x139/0x190 [16418.525747] __cleanup_mnt+0x12/0x20 [16418.525749] task_work_run+0x6d/0xa0 [16418.525765] exit_to_user_mode_prepare+0x1ad/0x1b0 [16418.525771] syscall_exit_to_user_mode+0x27/0x50 [16418.525774] do_syscall_64+0x48/0xc0 [16418.525776] entry_SYSCALL_64_after_hwframe+0x44/0xae Signed-off-by: Jaegeuk Kim commit c550e25bca660ed2554cbb48d32b82d0bb98e4b1 Author: Jaegeuk Kim Date: Mon Apr 18 16:57:44 2022 -0700 f2fs: use flush command instead of FUA for zoned device The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush command to keep the write order. Signed-off-by: Jaegeuk Kim commit dc2f78e2d4cc844a1458653d57ce1b54d4a29f21 Author: Dongliang Mu Date: Fri Apr 15 21:19:02 2022 +0800 f2fs: remove WARN_ON in f2fs_is_valid_blkaddr Syzbot triggers two WARNs in f2fs_is_valid_blkaddr and __is_bitmap_valid. For example, in f2fs_is_valid_blkaddr, if type is DATA_GENERIC_ENHANCE or DATA_GENERIC_ENHANCE_READ, it invokes WARN_ON if blkaddr is not in the right range. The call trace is as follows: f2fs_get_node_info+0x45f/0x1070 read_node_page+0x577/0x1190 __get_node_page.part.0+0x9e/0x10e0 __get_node_page f2fs_get_node_page+0x109/0x180 do_read_inode f2fs_iget+0x2a5/0x58b0 f2fs_fill_super+0x3b39/0x7ca0 Fix these two WARNs by replacing WARN_ON with dump_stack. Reported-by: syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e0c7402270d9928d4a19669704056147b830bc69 Author: Marcin Szycik Date: Mon Mar 28 16:58:28 2022 +0200 Revert "ice: Hide bus-info in ethtool for PRs in switchdev mode" This reverts commit bfaaba99e680bf82bf2cbf69866c3f37434ff766. Commit bfaaba99e680 ("ice: Hide bus-info in ethtool for PRs in switchdev mode") was a workaround for lshw tool displaying incorrect descriptions for port representors and PF in switchdev mode. Now the issue has been fixed in the lshw tool itself [1]. Removing the workaround can be considered a regression, as the user might be running older, unpatched lshw version. However, another important change (ice: link representors to PCI device, which improves port representor netdev naming with SET_NETDEV_DEV) also causes the same "regression" as removing the workaround, i.e. unpatched lshw is able to access bus-info information (this time not via ethtool) and the bug can occur. Therefore, the workaround no longer prevents the bug and can be removed. [1] https://ezix.org/src/pkg/lshw/commit/9bf4e4c9c1 Signed-off-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 6384b7695953dcb18da04a255b6616ae13c51b01 Author: Michal Swiatkowski Date: Mon Mar 28 16:58:27 2022 +0200 ice: link representors to PCI device Link port representors to parent PCI device to benefit from systemd defined naming scheme. Example from ip tool: - without linking: eth0 ... - with linking: eth0 ... altname enp24s0f0npf0vf0 The port representor name is being shown in altname, because the name is longer than IFNAMSIZ (16) limit. Altname can be used in ip tool. Signed-off-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 1c591c8f66a1141643ca73fd8918815e8fb211b0 Author: Rob Herring Date: Fri May 6 11:11:53 2022 -0500 Revert "dt-bindings: rcc: Add optional external ethernet RX clock properties" This reverts commit 694ed9922bc821e7208bc6593b5eeb88f8382fd5. The same commit was also applied to stm32 tree. Signed-off-by: Rob Herring commit 1a7085b34291a266a0413795c27061eb707104f7 Author: Chengguang Xu Date: Mon May 2 01:39:07 2022 -0400 RDMA/rxe: Skip adjusting remote addr for write in retry operation For write request the remote addr will be sent only with first packet so we don't have to adjust wqe->iova in retry operation. Link: https://lore.kernel.org/r/20220502053907.6388-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Reviewed-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 31ab5169803ebc009e01d1ee4501ca9faf347161 Author: Andre Przywara Date: Fri Apr 29 00:09:29 2022 +0100 clk: sunxi-ng: h616: Add PLL derived 32KHz clock The RTC section of the H616 manual mentions in a half-sentence the existence of a clock "32K divided by PLL_PERI(2X)". This is used as one of the possible inputs for the mux that selects the clock for the 32 KHz fanout pad. On the H616 this is routed to pin PG10, and some boards use that clock output to compensate for a missing 32KHz crystal. On the OrangePi Zero2 this is for instance connected to the LPO pin of the WiFi/BT chip. The new RTC clock binding requires this clock to be named as one input clock, so we need to expose this to the DT. In contrast to the D1 SoC there does not seem to be a gate for this clock, so just use a fixed divider clock, using a newly assigned clock number. Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220428230933.15262-3-andre.przywara@arm.com commit 38d321b61bda32624bde46f662faac039905e3db Author: Andre Przywara Date: Fri Apr 29 00:09:28 2022 +0100 clk: sunxi-ng: h6-r: Add RTC gate clock The H6 and H616 feature an (undocumented) bus clock gate for accessing the RTC registers. This seems to be enabled at reset (or by the BootROM), so we got away without it so far, but exists regardless. Since the new RTC clock binding for the H616 requires this "bus" clock to be specified in the DT, add this to R_CCU clock driver and expose it on the DT side with a new number. We do this for both the H6 and H616, but mark it as IGNORE_UNUSED, as we cannot reference it in any H6 DTs. Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220428230933.15262-2-andre.przywara@arm.com commit 5ca216155b5ead6e2d64738644afed9ac17f1fe3 Author: Thierry Reding Date: Fri Apr 29 10:22:43 2022 +0200 iommu/arm-smmu: Support Tegra234 SMMU Allow the NVIDIA-specific ARM SMMU implementation to bind to the SMMU instances found on Tegra234. Acked-by: Robin Murphy Acked-by: Will Deacon Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220429082243.496000-4-thierry.reding@gmail.com Signed-off-by: Will Deacon commit 95d5aeabda00baaccb2be262511adac74255dd7c Author: Thierry Reding Date: Fri Apr 29 10:22:42 2022 +0200 dt-bindings: arm-smmu: Add compatible for Tegra234 SOC The NVIDIA Tegra234 SoC comes with one single-instance ARM SMMU used by isochronous memory clients and two dual-instance ARM SMMUs used by non- isochronous memory clients. Reviewed-by: Rob Herring Acked-by: Will Deacon Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220429082243.496000-3-thierry.reding@gmail.com Signed-off-by: Will Deacon commit c02bda09f91a340bc9fae4e236ce3e3ec6b1c9ff Author: Thierry Reding Date: Fri Apr 29 10:22:41 2022 +0200 dt-bindings: arm-smmu: Document nvidia,memory-controller property On NVIDIA SoC's the ARM SMMU needs to interact with the memory controller in order to map memory clients to the corresponding stream IDs. Document how the nvidia,memory-controller property can be used to achieve this. Note that this is a backwards-incompatible change that is, however, necessary to ensure correctness. Without the new property, most of the devices would still work but it is not guaranteed that all will. Reviewed-by: Rob Herring Acked-by: Will Deacon Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20220429082243.496000-2-thierry.reding@gmail.com Signed-off-by: Will Deacon commit d044023e219d415d2af87e5e48e9e03488ad145c Author: Bjorn Andersson Date: Tue May 3 09:34:29 2022 -0700 iommu/arm-smmu-qcom: Add SC8280XP support Add the Qualcomm SC8280XP platform to the list of compatible for which the Qualcomm-impl of the ARM SMMU should apply. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220503163429.960998-3-bjorn.andersson@linaro.org Signed-off-by: Will Deacon commit 38db6b41b2f499c3a6e068f7796a2dd050b24166 Author: Bjorn Andersson Date: Tue May 3 09:34:28 2022 -0700 dt-bindings: arm-smmu: Add compatible for Qualcomm SC8280XP Add compatible for the Qualcomm SC8280XP platform to the ARM SMMU DeviceTree binding. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220503163429.960998-2-bjorn.andersson@linaro.org Signed-off-by: Will Deacon commit cbd23144f7662b00bcde32a938c4a4057e476d68 Author: Jean-Philippe Brucker Date: Tue Apr 26 14:04:45 2022 +0100 iommu/arm-smmu-v3-sva: Fix mm use-after-free We currently call arm64_mm_context_put() without holding a reference to the mm, which can result in use-after-free. Call mmgrab()/mmdrop() to ensure the mm only gets freed after we unpinned the ASID. Fixes: 32784a9562fb ("iommu/arm-smmu-v3: Implement iommu_sva_bind/unbind()") Signed-off-by: Jean-Philippe Brucker Tested-by: Zhangfei Gao Link: https://lore.kernel.org/r/20220426130444.300556-1-jean-philippe@linaro.org Signed-off-by: Will Deacon commit b131fa8c1d2afd05d0b7598621114674289c2fbb Author: Yang Yingliang Date: Mon Apr 25 19:45:25 2022 +0800 iommu/arm-smmu-v3: check return value after calling platform_get_resource() It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220425114525.2651143-1-yangyingliang@huawei.com Signed-off-by: Will Deacon commit d9ed8af1dee37f181096631fb03729ece98ba816 Author: Yang Yingliang Date: Mon Apr 25 19:41:36 2022 +0800 iommu/arm-smmu: fix possible null-ptr-deref in arm_smmu_device_probe() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220425114136.2649310-1-yangyingliang@huawei.com Signed-off-by: Will Deacon commit 5a4eb91634711aa6278d0f5b3d33c3ea63397639 Author: Rohit Agarwal Date: Mon Apr 11 15:20:12 2022 +0530 dt-bindings: arm-smmu: Add binding for SDX65 SMMU Add devicetree binding for Qualcomm SDX65 SMMU. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1649670615-21268-5-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Will Deacon commit f333c9c6f5ae250ddc0835d0413f5f55bec0ade5 Author: Huang Rui Date: Mon Oct 11 15:12:51 2021 +0800 drm/amdgpu/discovery: enable mes support for GC v11.0.1 GC v11.0.1 is using MES v11, so add IP block. Signed-off-by: Huang Rui Reviewed-by: Xiaojian Du Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 10eab4e7d74a789234418c42de72682b2ee9001a Author: Huang Rui Date: Tue Apr 19 17:49:14 2022 -0400 drm/amdgpu/discovery: enable gfx v11 for GC 11.0.1 Enable gfx v11 for GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 7319c14fb0582bafe80e89c128404f36403c962a Author: Huang Rui Date: Sat Apr 16 14:33:58 2022 +0800 drm/amdgpu: enable imu firmware for GC 11.0.1 The GC 11.0.1 needs load IMU to power up the GFX before loads GFX firmware. Signed-off-by: Huang Rui Reviewed-by: Tim Huang Signed-off-by: Alex Deucher commit 26776a7031c4234eb1a36dbaf9843e0793ff3e90 Author: Huang Rui Date: Wed Dec 29 20:51:24 2021 +0800 drm/amdkfd: add GC 11.0.1 KFD support Add initial support for GC 11.0.1 in KFD compute driver. Signed-off-by: Huang Rui Signed-off-by: Xiaojian Du Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit b0abae7d5db83d8ab7a2ecf2cf8bfc5d5fa0ae2a Author: Huang Rui Date: Wed Dec 15 14:21:15 2021 +0800 drm/amdgpu: add GC v11.0.1 into mes v11 Add GC v11.0.1 support into mes v11. Signed-off-by: Huang Rui Reviewed-by: Xiaojian Du Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2e5dbc1b05ebf027070c4f766647db5ac6f3656d Author: Huang Rui Date: Mon Aug 2 13:07:20 2021 +0800 drm/amdgpu: add gfx support for GC 11.0.1 Add GC 11.0.1 gfx support to gfx11 implementation. v2: squash in golden regs Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 921173e24d507c04620a36764b3251ccfb1474b1 Author: Alex Deucher Date: Tue Apr 19 17:34:40 2022 -0400 drm/amdgpu/discovery: set flag for GC 11.0.1 Set the APU flag appropriately for GC 11.0.1. Signed-off-by: Alex Deucher commit 2375271493d2f187d80fa197437a8d010c5299d4 Author: Huang Rui Date: Thu Mar 10 16:21:17 2022 +0800 drm/amdgpu: set GC 11.0.1 family Add GC 11.0.1 family support. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit cbe757ecdb4b0c8ac4c62b03cda3fa58ba6d23fd Author: Huang Rui Date: Mon Aug 2 09:06:03 2021 +0800 drm/amdgpu: add GC 11.0.1 family id Add a flag to define GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 500448dce20f386d2cfd723abbd56e3de1d94c90 Author: Huang Rui Date: Tue Apr 19 17:50:14 2022 -0400 drm/amdgpu/discovery: enable sdma v6 for SDMA 6.0.1 Enable sdma (system dma) v6 for SDMA 6.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 04dd809b6fad0994d1e97b446bade28e3882340a Author: Huang Rui Date: Mon Aug 2 13:33:11 2021 +0800 drm/amdgpu: add sdma support for sdma 6.0.1 Add sdma 6.0.1 support to sdma6 implementation. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit bed95cfdc57b77a431e8228141e8ac3ab8ab107e Author: Xiaojian Du Date: Tue Jan 11 15:46:40 2022 +0800 drm/amdgpu/discovery: add PSP v13.0.4 into the IP discovery list This patch will add PSP v13.0.4 into the IP discovery list. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 48858a101e0108c8ebe1a76ae7204f30df8a38c9 Author: Huang Rui Date: Tue Apr 19 17:47:47 2022 -0400 drm/amdgpu/discovery: enable ih v6 for OSS 6.0.1 Enable ih (interrupt handler) v6 for OSS 6.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit a8f24139cc7b75a18152d11103a80f66f93d3bb4 Author: Huang Rui Date: Tue Apr 19 17:46:22 2022 -0400 drm/amdgpu/discovery: enable gmc v11 for GC 11.0.1 Enable gmc (graphic memory controller) v11 for GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit ee367aed75e27c2ec0208e61363b7ffa51ab21b7 Author: Huang Rui Date: Mon Aug 2 10:33:55 2021 +0800 drm/amdgpu: add gmc v11 support for GC 11.0.1 Add gmc v11 support for GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 6e4eb7ce1fa3aafe4160d728c6b97833a3af5730 Author: Huang Rui Date: Tue Apr 19 17:44:11 2022 -0400 drm/amdgpu/discovery: enable soc21 common for GC 11.0.1 Enable soc21 common for GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 11417a927b1c8c70c5d23b47ac9b563242e9fc78 Author: Huang Rui Date: Mon Aug 2 10:15:39 2021 +0800 drm/amdgpu: add soc21 common ip block support for GC 11.0.1 Add common soc21 ip block support for GC 11.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 50e9f54de4f82f5355fbae10275c09f4c98e069d Author: Huang Rui Date: Mon Aug 2 10:21:08 2021 +0800 drm/amdgpu: add mmhub support for MMHUB 3.0.1 Add the mmhub support for MMHUB 3.0.1. Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 6e9e59e26fd0ee09ca1c181f5deb4a57a507d969 Author: Xiaojian Du Date: Tue Jan 11 14:54:32 2022 +0800 drm/amdgpu/discovery: add HDP v5.2.1 into the IP discovery list This patch is to add HDP v5.2.1 in the IP discovery list. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 78039df8e8d24aa62611941b2d7e566c7020e729 Author: Xiaojian Du Date: Tue Dec 14 16:16:33 2021 +0800 drm/amdgpu: add the files of HDP v5.2 block This patch is to add the files of HDP v5.2 block. HDP (Host Data Port) is the IP which handles host access to VRAM via the PCI BAR. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c4d1c905ba885e46e7decdd6007367ac45ec4d17 Author: Huang Rui Date: Mon Aug 2 08:37:11 2021 +0800 drm/amdgpu: add hdp v5_2_1 ip headers Add hdp v5.2.1 offset and shift mask ip header files. v2: squash in updates (Alex) Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 0c1e5527e0fcf2b46e8c9e3032cf8b13170bce50 Author: Xiaojian Du Date: Tue Jan 11 15:01:39 2022 +0800 drm/admgpu/discovery: add NBIO v7.7 into the IP discovery list This patch is to add NBIO v7.7 into the IP discovery list. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 810ecd40015c25b315b8cada7e86bfe2a7b55741 Author: Xiaojian Du Date: Tue Dec 14 16:14:48 2021 +0800 drm/amdgpu: add the files of NBIO v7.7 block This patch is to add the files of NBIO v7.7 block. NBIO (New Bus IO) is the block which handles the GPU interface to the PCIe bus. v2: squash in register name fix (Xiaojian) Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit bafd6cbe4add7427687da1001d78aab937c990ce Author: Xiaojian Du Date: Wed Jan 19 15:09:54 2022 +0800 drm/amdgpu: add pcie port function helpers for SOC21 These helpers will be used on NBIO v7.7.0. Signed-off-by: Xiaojian Du Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4debe753953f20325b1d8a5e0958c0d38c9fd32f Author: Huang Rui Date: Mon Aug 2 08:40:47 2021 +0800 drm/amdgpu: add nbio v7_7_0 ip headers Add nbio v7.7.0 offset and shift mask ip header files. v2: squash in updates (Alex) Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit f5d990d61215cd249da1eb6c6fa850318712af40 Author: Xiaojian Du Date: Wed Jan 5 16:58:39 2022 +0800 drm/amdgpu: skip the new gc doorbell function for some asics This patch will skip the new gc doorbell function for some asics, only enable new doorbell model on aisc where it is supported. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 06aeb7533294d8a02383f2b248d04cd9a2731172 Author: Xiaojian Du Date: Wed Dec 29 15:03:11 2021 +0800 drm/amdgpu: handle asics with 1 SDMA instance This patch will handle asics with 1 SDMA instance. Signed-off-by: Xiaojian Du Reviewed-by: Huang Rui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c1eeb3d2e86e6eb9923e550fe5144789cc7f5186 Author: Kenneth Feng Date: Tue Apr 26 10:54:54 2022 +0800 drm/amd/pm: report preDS gfxclk on smu_v13_0_7 report preDS gfxclk on smu_v13_0_7 to avoid the test confusion Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit cbd3adaef820bf8bf5c56f791d46b6842071af3c Author: Kenneth Feng Date: Mon Apr 25 21:39:30 2022 +0800 drm/amd/pm: change the soft pptable id for smu_v13_0_7 change the soft pptable id for smu_v13_0_7 according to pptable updatde Signed-off-by: Kenneth Feng Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 986118548119747fcf4b7b040a219faafc6a6380 Author: Yang Wang Date: Mon Apr 25 16:10:21 2022 +0800 drm/amd/pm: enable pmlog support for smu_v13_0_7 enable pmlog support for smu 13_0_7. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 334682ae81513638aa49da9615c2c0054a711ed4 Author: Kenneth Feng Date: Fri Apr 22 11:40:51 2022 +0800 drm/amd/pm: enable workload type change on smu_v13_0_7 enable workload type change on smu_v13_0_7 v2: squash in out of bounds fix (Alex) Signed-off-by: Kenneth Feng Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 6b79738b6ed91a2d0fe958819469eeedac3bca81 Author: Qi Liu Date: Fri Apr 15 18:23:52 2022 +0800 drivers/perf: hisi: Add Support for CPA PMU On HiSilicon Hip09 platform, there is a CPA (Coherency Protocol Agent) on each SICL (Super IO Cluster) which implements packet format translation, route parsing and traffic statistics. CPA PMU has 8 PMU counters and interrupt is supported to handle counter overflow. Let's support its driver under the framework of HiSilicon PMU driver. Signed-off-by: Qi Liu Reviewed-by: John Garry Reviewed-by: Shaokun Zhang Link: https://lore.kernel.org/r/20220415102352.6665-3-liuqi115@huawei.com Signed-off-by: Will Deacon commit 807907dae9701c4b0593d5195d4839f17d103314 Author: Qi Liu Date: Fri Apr 15 18:23:51 2022 +0800 drivers/perf: hisi: Associate PMUs in SICL with CPUs online If a PMU is in a SICL (Super IO cluster), it is not appropriate to associate this PMU with a CPU die. So we associate it with all CPUs online, rather than CPUs in the nearest SCCL. As the firmware of Hip09 platform hasn't been published yet, change of PMU driver will not influence backwards compatibility between driver and firmware. Signed-off-by: Qi Liu Reviewed-by: John Garry Link: https://lore.kernel.org/r/20220415102352.6665-2-liuqi115@huawei.com Signed-off-by: Will Deacon commit 47a9ed88a4fc6c67ea7f1d65df28d2eb6a89bbbb Author: Shaokun Zhang Date: Fri Apr 29 14:33:07 2022 +0800 drivers/perf: arm_spe: Expose saturating counter to 16-bit In order to acquire more accurate latency, Armv8.8[1] has defined the CountSize field to 16-bit saturating counters when it's 0b0011. Let's support this new feature and expose its to user under sysfs. [1] https://developer.arm.com/documentation/ddi0487/latest Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/20220429063307.63251-1-zhangshaokun@hisilicon.com Signed-off-by: Will Deacon commit 23760a0144173ef398522fbcc1dbe79521b5caf9 Author: Robin Murphy Date: Mon Apr 18 23:57:41 2022 +0100 perf/arm-cmn: Add CMN-700 support Add the identifiers, events, and subtleties for CMN-700. Highlights include yet more options for doubling up CHI channels, which finally grows event IDs beyond 8 bits for XPs, and a new set of CML gateway nodes adding support for CXL as well as CCIX, where the Link Agent is now internal to the CMN mesh so we gain regular PMU events for that too. Signed-off-by: Robin Murphy Tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/cf892baa0d0258ea6cd6544b15171be0069a083a.1650320598.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 65adf71398f5af9a591dc1b7eccac123f992d97a Author: Robin Murphy Date: Mon Apr 18 23:57:40 2022 +0100 perf/arm-cmn: Refactor occupancy filter selector So far, DNs and HN-Fs have each had one event ralated to occupancy trackers which are filtered by a separate field. CMN-700 raises the stakes by introducing two more sets of HN-F events with corresponding additional filter fields. Prepare for this by refactoring our filter selection and tracking logic to account for multiple filter types coexisting on the same node. This need not affect the uAPI, which can just continue to encode any per-event filter setting in the "occupid" config field, even if it's technically not the most accurate name for some of them. Signed-off-by: Robin Murphy Tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/1aa47ba0455b144c416537f6b0e58dc93b467a00.1650320598.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 8e504d93acb647c0db31ba13ba11b510bbab4174 Author: Robin Murphy Date: Mon Apr 18 23:57:39 2022 +0100 perf/arm-cmn: Add CMN-650 support Add the identifiers and events for CMN-650, which slots into its evolutionary position between CMN-600 and the 700-series products. Imagine CMN-600 made bigger, and with most of the rough edges smoothed off, but that then balanced out by some bonkers PMU functionality for the new HN-P enhancement in CMN-650r2. Most of the CXG events are actually common to newer revisions of CMN-600 too, so they're arguably a little late; oh well. Signed-off-by: Robin Murphy Tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/b0adc5824db53f71a2b561c293e2120390106536.1650320598.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 2b60a22b70fa77db73f91fd895c6509f70b3e276 Author: Robin Murphy Date: Mon Apr 18 23:57:38 2022 +0100 dt-bindings: perf: arm-cmn: Add CMN-650 and CMN-700 If you were to guess from the product names that CMN-650 and CMN-700 are the next two evolutionary steps of Arm's enterprise-level interconnect following on from CMN-600, you'd be pleasantly correct. Add them to the DT binding. CC: devicetree@vger.kernel.org Signed-off-by: Robin Murphy Acked-by: Rob Herring Tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/9b4dc0c82c91adff62b6f92eec5f61fb25b9db87.1650320598.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 4b5b7129095b265ba3bae8a6553d22a41e078b96 Author: Ren Yu Date: Mon Apr 25 18:04:36 2022 +0800 perf: check return value of armpmu_request_irq() When the function armpmu_request_irq() failed, goto err Signed-off-by: Ren Yu Link: https://lore.kernel.org/r/20220425100436.4881-1-renyu@nfschina.com Signed-off-by: Will Deacon commit 3ff5f7840979aa36d47a6a00694826c78d63bf3c Author: Peter Zijlstra Date: Fri May 6 14:14:36 2022 +0200 linkage: Fix issue with missing symbol size Occasionally, typically when a function doesn't end with 'ret', an alias on that function will have 0 size. The difference between what GCC generates and our linkage magic, is that GCC doesn't appear to provide .size for the alias'ed symbol at all. And indeed, removing this directive cures the issue. Additionally, GCC also doesn't emit .type for alias symbols either, so also omit that. Fixes: e0891269a8c2 ("linkage: add SYM_FUNC_ALIAS{,_LOCAL,_WEAK}()") Suggested-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Mark Rutland Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220506121631.437480085@infradead.org commit 1b331eeea7b8676fc5dbdf80d0a07e41be226177 Author: Peter Zijlstra Date: Fri May 6 14:14:35 2022 +0200 x86/entry: Remove skip_r11rcx Yes, r11 and rcx have been restored previously, but since they're being popped anyway (into rsi) might as well pop them into their own regs -- setting them to the value they already are. Less magical code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220506121631.365070674@infradead.org commit 8c42819b61b8340cff0643e65b5ce6a4144ab155 Author: Peter Zijlstra Date: Fri May 6 14:14:34 2022 +0200 x86/entry: Use PUSH_AND_CLEAR_REGS for compat Since the upper regs don't exist for ia32 code, preserving them doesn't hurt and it simplifies the code. This doesn't add any attack surface that would not already be available through INT80. Notably: - 32bit SYSENTER: didn't clear si, dx, cx. - 32bit SYSCALL, INT80: *do* clear si since the C functions don't take a second argument. - 64bit: didn't clear si since the C functions take a second argument; except the error_entry path might have only one argument, so clearing si was missing here. 32b SYSENTER should be clearing all those 3 registers, nothing uses them and selftests pass. Unconditionally clear rsi since it simplifies code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20220506121631.293889636@infradead.org commit cb7e1abc2c73633e1eefa168ab2dad6e838899c9 Author: Thierry Reding Date: Fri May 6 15:52:49 2022 +0200 drm/tegra: gem: Do not try to dereference ERR_PTR() When mapping the DMA-BUF attachment fails, map->sgt will be an ERR_PTR- encoded error code and the cleanup code would try to free that memory, which obviously would fail. Zero out that pointer after extracting the error code when this happens so that kfree() can do the right thing. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Thierry Reding commit d205222eb6a8e5e70c21200beb81c6e19ec211d6 Author: Linus Torvalds Date: Fri May 6 14:14:33 2022 +0200 x86/entry: Simplify entry_INT80_compat() Instead of playing silly games with rdi, use rax for simpler and more consistent code. Signed-off-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20220506121631.221072885@infradead.org commit a1e2c031ec3949b8c039b739c0b5bf9c30007b00 Author: Josh Poimboeuf Date: Fri May 6 14:14:32 2022 +0200 x86/mm: Simplify RESERVE_BRK() RESERVE_BRK() reserves data in the .brk_reservation section. The data is initialized to zero, like BSS, so the macro specifies 'nobits' to prevent the data from taking up space in the vmlinux binary. The only way to get the compiler to do that (without putting the variable in .bss proper) is to use inline asm. The macro also has a hack which encloses the inline asm in a discarded function, which allows the size to be passed (global inline asm doesn't allow inputs). Remove the need for the discarded function hack by just stringifying the size rather than supplying it as an input to the inline asm. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20220506121631.133110232@infradead.org commit c7a9dcea8e98377734821d41cd37bb96add9ca1c Author: Palmer Dabbelt Date: Tue Mar 22 15:01:47 2022 -0700 perf: RISC-V: Remove non-kernel-doc ** comments This will presumably trip up some tools that try to parse the comments as kernel doc when they're not. Reported-by: kernel test robot Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") Signed-off-by: Palmer Dabbelt -- These recently landed in for-next, but I'm trying to avoid rewriting history as there's a lot in flight right now. Reviewed-by: Atish Patra Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220322220147.11407-1-palmer@rivosinc.com Signed-off-by: Will Deacon commit 75f9d540862a392395f41a5aa437a7fc2d059c23 Author: Philip Oberfichtner Date: Fri May 6 07:59:47 2022 +0200 dt-bindings: arm: Add bosch acc board Add device tree binding for the Bosch ACC board, based on i.MX6 Dual. Signed-off-by: Philip Oberfichtner Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 6192cf8ac0824a87c4dac0e94ae94062a0edc811 Author: Philip Oberfichtner Date: Fri May 6 07:59:49 2022 +0200 ARM: dts: Add bosch acc board Add device tree for the Bosch ACC board, based on i.MX6 Dual. Signed-off-by: Philip Oberfichtner Signed-off-by: Shawn Guo commit 1c4f01be3490263b73755ed24a229a5885d9ce8e Author: Giulio Benetti Date: Tue Jan 11 16:54:14 2022 -0500 ARM: dts: imx: Add i.MXRT1050-EVK support The NXP i.MXRT1050 Evaluation Kit (EVK) provides a platform for rapid evaluation of the i.MXRT, which features NXP's implementation of the Arm Cortex-M7 core. The EVK provides 32 MB SDRAM, 64 MB Quad SPI flash, Micro SD card socket, USB 2.0 OTG. This patch aims to support the preliminary booting up features as follows: GPIO LPUART SD/MMC Signed-off-by: Giulio Benetti Signed-off-by: Jesse Taube [Jesse: Add clock-parents, edma, usdhc, anatop, remove old pinctl] Signed-off-by: Shawn Guo commit a3d66a76348daf559873f19afc912a2a7c2ccdaf Author: Pali Rohár Date: Mon Apr 25 13:37:05 2022 +0200 irqchip/armada-370-xp: Do not touch Performance Counter Overflow on A375, A38x, A39x Register ARMADA_370_XP_INT_FABRIC_MASK_OFFS is Armada 370 and XP specific and on new Armada platforms it has different meaning. It does not configure Performance Counter Overflow interrupt masking. So do not touch this register on non-A370/XP platforms (A375, A38x and A39x). Signed-off-by: Pali Rohár Cc: stable@vger.kernel.org Fixes: 28da06dfd9e4 ("irqchip: armada-370-xp: Enable the PMU interrupts") Reviewed-by: Andrew Lunn Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425113706.29310-1-pali@kernel.org commit 95730d65708397828f75ca7dbca838edf6727bfd Merge: beb21e3e8e261 744d49daf8bd3 Author: David S. Miller Date: Fri May 6 12:07:56 2022 +0100 Merge branch 'tso-gso-limit-split' Jakub Kicinski says: ==================== net: disambiguate the TSO and GSO limits This series separates the device-reported TSO limitations from the user space-controlled GSO limits. It used to be that we only had the former (HW limits) but they were named GSO. This probably lead to confusion and letting user override them. The problem came up in the BIG TCP discussion between Eric and Alex, and seems like something we should address. Targeting net-next because (a) nobody is reporting problems; and (b) there is a tiny but non-zero chance that some actually wants to lift the HW limitations. ==================== Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 744d49daf8bd3b17b345c836f2e6f97d49fa6ae8 Author: Jakub Kicinski Date: Thu May 5 19:51:34 2022 -0700 net: move netif_set_gso_max helpers These are now internal to the core, no need to expose them. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ee8b7a1156f357613646d6c69d07ac5a087a1071 Author: Jakub Kicinski Date: Thu May 5 19:51:33 2022 -0700 net: make drivers set the TSO limit not the GSO limit Drivers should call the TSO setting helper, GSO is controllable by user space. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 14d7b8122fd591693a2388b98563707ba72c6780 Author: Jakub Kicinski Date: Thu May 5 19:51:32 2022 -0700 net: don't allow user space to lift the device limits Up until commit 46e6b992c250 ("rtnetlink: allow GSO maximums to be set on device creation") the gso_max_segs and gso_max_size of a device were not controlled from user space. The quoted commit added the ability to control them because of the following setup: netns A | netns B veth<->veth eth0 If eth0 has TSO limitations and user wants to efficiently forward traffic between eth0 and the veths they should copy the TSO limitations of eth0 onto the veths. This would happen automatically for macvlans or ipvlan but veth users are not so lucky (given the loose coupling). Unfortunately the commit in question allowed users to also override the limits on real HW devices. It may be useful to control the max GSO size and someone may be using that ability (not that I know of any user), so create a separate set of knobs to reliably record the TSO limitations. Validate the user requests. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 6df6398f7c8b481ce83f28143bc08a5231616deb Author: Jakub Kicinski Date: Thu May 5 19:51:31 2022 -0700 net: add netif_inherit_tso_max() To make later patches smaller create a helper for inheriting the TSO limitations of a lower device. The TSO in the name is not an accident, subsequent patches will replace GSO with TSO in more names. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 619695fab3ba18a9145000280b0d74faf2131dea Author: Paul Gortmaker Date: Thu Apr 28 02:24:29 2022 -0400 platform/x86: pmc_atom: dont export pmc_atom_read - no modular users There is only one user of pmc_atom_read in tree, and that is in drivers/acpi/acpi_lpss.c -- which can't be anything but built-in. As such there is no point in adding this function to the global symbol list exported to modules. Note that there is no include removal since the code was getting that header implicitly. Cc: Andy Shevchenko Cc: Aubrey Li Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Paul Gortmaker Link: https://lore.kernel.org/r/20220428062430.31010-4-paul.gortmaker@windriver.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6de4d4eca9a2d0195f802bc97b0e9aeeaff05900 Author: Paul Gortmaker Date: Thu Apr 28 02:24:27 2022 -0400 platform/x86: pmc_atom: remove unused pmc_atom_write() This function isn't used anywhere in the driver or anywhere in tree. So remove it. It can always be re-added if/when a use arises. Cc: Andy Shevchenko Cc: Aubrey Li Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Paul Gortmaker Link: https://lore.kernel.org/r/20220428062430.31010-2-paul.gortmaker@windriver.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 17faaacac3c92abde4019600e107c10c367d74f2 Author: Ren Zhijie Date: Thu May 5 20:19:58 2022 +0800 platform/x86: amd-pmc: Fix build error unused-function If CONFIG_SUSPEND and CONFIG_DEBUG_FS are not set. compile error: drivers/platform/x86/amd-pmc.c:323:12: error: ‘get_metrics_table’ defined but not used [-Werror=unused-function] static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table) ^~~~~~~~~~~~~~~~~ drivers/platform/x86/amd-pmc.c:298:12: error: ‘amd_pmc_idlemask_read’ defined but not used [-Werror=unused-function] static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev, ^~~~~~~~~~~~~~~~~~~~~ drivers/platform/x86/amd-pmc.c:196:12: error: ‘amd_pmc_get_smu_version’ defined but not used [-Werror=unused-function] static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev) ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors To fix building warning, wrap all related code with CONFIG_SUSPEND or CONFIG_DEBUG_FS. Reported-by: Hulk Robot Signed-off-by: Ren Zhijie Link: https://lore.kernel.org/r/20220505121958.138905-1-renzhijie2@huawei.com Signed-off-by: Hans de Goede commit 4555906fdcafa253135bd6daaa8faede61d73ee9 Author: Maximilian Luz Date: Fri Apr 29 21:57:38 2022 +0200 platform/surface: aggregator: Fix initialization order when compiling as builtin module When building the Surface Aggregator Module (SAM) core, registry, and other SAM client drivers as builtin modules (=y), proper initialization order is not guaranteed. Due to this, client driver registration (triggered by device registration in the registry) races against bus initialization in the core. If any attempt is made at registering the device driver before the bus has been initialized (i.e. if bus initialization fails this race) driver registration will fail with a message similar to: Driver surface_battery was unable to register with bus_type surface_aggregator because the bus was not initialized Switch from module_init() to subsys_initcall() to resolve this issue. Note that the serdev subsystem uses postcore_initcall() so we are still able to safely register the serdev device driver for the core. Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Reported-by: Blaž Hrastnik Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220429195738.535751-1-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 14048b90f51b65955d3bc7b6415dafdc6b881a80 Author: Maximilian Luz Date: Fri Apr 29 20:00:49 2022 +0200 platform/surface: gpe: Add support for Surface Pro 8 The new Surface Pro 8 uses GPEs for lid events as well. Add an entry for that so that the lid can be used to wake the device. Note that this is a device with a keyboard type-cover, where this acts as the "lid". Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220429180049.1282447-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede commit 16b12375e05573a35af70145db36ef438945d196 Author: Prarit Bhargava Date: Fri Apr 29 08:23:22 2022 -0400 platform/x86/intel: Fix 'rmmod pmt_telemetry' panic 'rmmod pmt_telemetry' panics with: BUG: kernel NULL pointer dereference, address: 0000000000000040 #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: 4 PID: 1697 Comm: rmmod Tainted: G S W -------- --- 5.18.0-rc4 #3 Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS ADLPFWI1.R00.3056.B00.2201310233 01/31/2022 RIP: 0010:device_del+0x1b/0x3d0 Code: e8 1a d9 e9 ff e9 58 ff ff ff 48 8b 08 eb dc 0f 1f 44 00 00 41 56 41 55 41 54 55 48 8d af 80 00 00 00 53 48 89 fb 48 83 ec 18 <4c> 8b 67 40 48 89 ef 65 48 8b 04 25 28 00 00 00 48 89 44 24 10 31 RSP: 0018:ffffb520415cfd60 EFLAGS: 00010286 RAX: 0000000000000070 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000080 R08: ffffffffffffffff R09: ffffb520415cfd78 R10: 0000000000000002 R11: ffffb520415cfd78 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f7e198e5740(0000) GS:ffff905c9f700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000040 CR3: 000000010782a005 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: ? __xa_erase+0x53/0xb0 device_unregister+0x13/0x50 intel_pmt_dev_destroy+0x34/0x60 [pmt_class] pmt_telem_remove+0x40/0x50 [pmt_telemetry] auxiliary_bus_remove+0x18/0x30 device_release_driver_internal+0xc1/0x150 driver_detach+0x44/0x90 bus_remove_driver+0x74/0xd0 auxiliary_driver_unregister+0x12/0x20 pmt_telem_exit+0xc/0xe4a [pmt_telemetry] __x64_sys_delete_module+0x13a/0x250 ? syscall_trace_enter.isra.19+0x11e/0x1a0 do_syscall_64+0x58/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? exc_page_fault+0x64/0x140 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7e1803a05b Code: 73 01 c3 48 8b 0d 2d 4e 38 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 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d fd 4d 38 00 f7 d8 64 89 01 48 The probe function, pmt_telem_probe(), adds an entry for devices even if they have not been initialized. This results in the array of initialized devices containing both initialized and uninitialized entries. This causes a panic in the remove function, pmt_telem_remove() which expects the array to only contain initialized entries. Only use an entry when a device is initialized. Cc: "David E. Box" Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: David Arcari Signed-off-by: Prarit Bhargava Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220429122322.2550003-1-prarit@redhat.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f964f0c9b1a5f915aec0ff70b9c3fe4a7bb8b01c Author: Mark Pearson Date: Mon May 2 15:12:00 2022 -0400 platform/x86: thinkpad_acpi: Correct dual fan probe There was an issue with the dual fan probe whereby the probe was failing as it assuming that second_fan support was not available. Corrected the logic so the probe works correctly. Cleaned up so quirks only used if 2nd fan not detected. Tested on X1 Carbon 10 (2 fans), X1 Carbon 9 (2 fans) and T490 (1 fan) Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220502191200.63470-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit fbb404ab4e45c029bbc96764d202f15e629ae86b Author: Mario Limonciello Date: Thu Apr 28 22:05:01 2022 -0500 platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops Lenovo laptops that contain NVME SSDs across a variety of generations have trouble resuming from suspend to idle when the IOMMU translation layer is active for the NVME storage device. This generally manifests as a large resume delay or page faults. These delays and page faults occur as a result of a Lenovo BIOS specific SMI that runs during the D3->D0 transition on NVME devices. This SMI occurs because of a flag that is set during resume by Lenovo firmware: ``` OperationRegion (PM80, SystemMemory, 0xFED80380, 0x10) Field (PM80, AnyAcc, NoLock, Preserve) { SI3R, 1 } Method (_ON, 0, NotSerialized) // _ON_: Power On { TPST (0x60D0) If ((DAS3 == 0x00)) { If (SI3R) { TPST (0x60E0) M020 (NBRI, 0x00, 0x00, 0x04, (NCMD | 0x06)) M020 (NBRI, 0x00, 0x00, 0x10, NBAR) APMC = HDSI /* \HDSI */ SLPS = 0x01 SI3R = 0x00 TPST (0x60E1) } D0NV = 0x01 } } ``` Create a quirk that will run early in the resume process to prevent this SMI from running. As any of these machines are fixed, they can be peeled back from this quirk or narrowed down to individual firmware versions. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1910 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1689 Signed-off-by: Mario Limonciello Tested-by: Mark Pearson Link: https://lore.kernel.org/r/20220429030501.1909-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 89643719d86ff9ec7b972aa969587d37b08d113c Author: Mario Limonciello Date: Thu Apr 28 22:05:00 2022 -0500 platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks DMI matching in thinkpad_acpi happens local to a function meaning quirks can only match that function. Future changes to thinkpad_acpi may need to quirk other code, so change this to use a quirk infrastructure. Signed-off-by: Mario Limonciello Tested-by: Mark Pearson Link: https://lore.kernel.org/r/20220429030501.1909-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit beb21e3e8e261fc9f11050af17efe6de183b33d3 Merge: 76a8426959a6a a7da2a864a4fa Author: David S. Miller Date: Fri May 6 11:21:34 2022 +0100 Merge branch 'nfp-flower-rework' Simon Horman says: ==================== nfp: flower: decap neighbour table rework Louis Peens says: This patch series reworks the way in which flow rules that outputs to OVS internal ports gets handled by the nfp driver. Previously this made use of a small pre_tun_table, but this only used destination MAC addresses, and made the implicit assumption that there is only a single source MAC":"destination MAC" mapping per tunnel. In hindsight this seems to be a pretty obvious oversight, but this was hidden in plain sight for quite some time. This series changes the implementation to make use of the same Neighbour table for decap that is in use for the tunnel encap solution. It stores any new Neighbour updates in this table. Previously this path was only triggered for encapsulation candidates, and the entries were send and forget, not saved on the host as it is after this series. It also keeps track of any flow rule that outputs to OVS internal ports (and some other criteria not worth mentioning here), very similar to how it was done previously, except now these flows are kept track of in a list. When a new Neighbour entry gets added this list gets iterated for potential matches, in which case the table gets updated with a reference to the flow, and the Neighbour entry on the card gets updated with the relevant host_ctx. The same happens when a new qualifying flow gets added - the Neighbour table gets iterated for applicable matches, and once again the firmware gets updated with the host_ctx when any matches are found. Since this also requires a firmware change we add a new capability bit, and keep the old behaviour in case of older firmware without this bit set. This series starts by doing some preparation, then adding the new list and table entries. Next the functionality to link/unlink these entries are added, and finally this new functionality is enabled by adding the DECAP_V2 bit to the driver feature list. ==================== Signed-off-by: David S. Miller commit a7da2a864a4fa63fe39c808eec8abfb76abf1dbd Author: Louis Peens Date: Thu May 5 14:43:48 2022 +0900 nfp: flower: enable decap_v2 bit Finally enable the decap_v2 feature bit now that all the other bits are in place to configure it correctly. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit c83a0fbe9766b3ae970b96435b7c9786299a9b12 Author: Louis Peens Date: Thu May 5 14:43:47 2022 +0900 nfp: flower: remove unused neighbour cache With the neighbour entries now stored in a dedicated table there is no use to make use of the tunnel route cache anymore, so remove this. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 591c90a1d0b06f93695e443a1adaebdc8865647e Author: Louis Peens Date: Thu May 5 14:43:46 2022 +0900 nfp: flower: link pre_tun flow rules with neigh entries Add helper functions that can create links between flow rules and cached neighbour entries. Also add the relevant calls to these functions. * When a new neighbour entry gets added cycle through the saved pre_tun flow list and link any relevant matches. Update the neighbour table on the nfp with this new information. * When a new pre_tun flow rule gets added iterate through the save neighbour entries and link any relevant matches. Once again update the nfp neighbour table with any new links. * Do the inverse when deleting - remove any created links and also inform the nfp of this. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit f1df7956c11f93b2a90ceae78cdc4bfc00f5e38d Author: Louis Peens Date: Thu May 5 14:43:45 2022 +0900 nfp: flower: rework tunnel neighbour configuration This patch updates the way in which the tunnel neighbour entries are handled. Previously they were mostly send-and-forget, with just the destination IP's cached in a list. This update changes to a scheme where the neighbour entry information is stored in a hash table. The reason for this is that the neighbour table will now also be used on the decapsulation path, whereas previously it was only used for encapsulation. We need to save more of the neighbour information in order to link them with flower flows in follow up patches. Updating of the neighbour table is now also handled by the same function, instead of separate *_write_neigh_vX functions. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 9ee7c42183d1eaa7d559a7c20cbbf7803a25523e Author: Louis Peens Date: Thu May 5 14:43:44 2022 +0900 nfp: flower: update nfp_tun_neigh structs Prepare for more rework in following patches by updating the existing nfp_neigh_structs. The update allows for the same headers to be used for both old and new firmware, with a slight length adjustment when sending the control message to the firmware. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 9d5447ed44b5ddca07d82aba4d8a9436c4e910c4 Author: Louis Peens Date: Thu May 5 14:43:43 2022 +0900 nfp: flower: fixup ipv6/ipv4 route lookup for neigh events When a callback is received to invalidate a neighbour entry there is no need to try and populate any other flow information. Only the flowX->daddr information is needed as lookup key to delete an entry from the NFP neighbour table. Fix this by only doing the lookup if the callback is for a new entry. As part of this cleanup remove the setting of flow6.flowi6_proto, as this is not needed either, it looks to be a possible leftover from a previous implementation. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 38fc158e172b2df03f24d4a6ea6a89eab37a4b29 Author: Louis Peens Date: Thu May 5 14:43:42 2022 +0900 nfp: flower: enforce more strict pre_tun checks Make sure that the rule also matches on source MAC address. On top of that also now save the src and dst MAC addresses similar to how vlan_tci is saved - this will be used in later comparisons with neighbour entries. Indicate if the flow matched on ipv4 or ipv6. Populate the vlan_tpid field that got added to the pre_run_rule struct as well. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e30b2b68c14f51156ae982047903bb37d4799a16 Author: Louis Peens Date: Thu May 5 14:43:41 2022 +0900 nfp: flower: add/remove predt_list entries Add calls to add and remove flows to the predt_table. This very simply just allocates and add a new pretun entry if detected as such, and removes it when encountered on a delete flow. Compatibility for older firmware is kept in place through the DECAP_V2 feature bit. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 29c691347e38248607eeab74691bed05115fca79 Author: Louis Peens Date: Thu May 5 14:43:40 2022 +0900 nfp: flower: add infrastructure for pre_tun rework The previous implementation of using a pre_tun_table for decap has some limitations, causing flows to end up unoffloaded when in fact we are able to offload them. This is because the pre_tun_table does not have enough matching resolution. The next step is to instead make use of the neighbour table which already exists for the encap direction. This patch prepares for this by: - Moving nfp_tun_neigh/_v6 to main.h. - Creating two new "wrapping" structures, one to keep track of neighbour entries (previously they were send-and-forget), and another to keep track of pre_tun flows. - Create a new list in nfp_flower_priv to keep track of pre_tunnel flows - Create a new table in nfp_flower_priv to keep track of next neighbour entries - Initialising and destroying these new list/tables - Extending nfp_fl_payload->pre_tun_rule to save more information for future use. Signed-off-by: Louis Peens Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit b52455a73db95ef90fd3c2be84db77b55be43f46 Author: Masahiro Yamada Date: Sun May 1 22:07:49 2022 +0900 crypto: vmx - Align the short log with Makefile cleanups I notieced the log is not properly aligned: PERL drivers/crypto/vmx/aesp8-ppc.S CC [M] fs/xfs/xfs_reflink.o PERL drivers/crypto/vmx/ghashp8-ppc.S CC [M] drivers/crypto/vmx/aes.o Add some spaces after 'PERL'. While I was here, I cleaned up the Makefile: - Merge the two similar rules - Remove redundant 'clean-files' (Having 'targets' is enough) - Move the flavour into the build command This still avoids the build failures fixed by commit 4ee812f6143d ("crypto: vmx - Avoid weird build failures"). Signed-off-by: Masahiro Yamada Reported-by: kernel test robot Signed-off-by: Herbert Xu commit 0a2f4b5785ca5e9c5bc2d4e59183e016096ee889 Author: Tetsuo Handa Date: Sat Apr 30 16:01:46 2022 +0900 crypto: atmel - Avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local atmel_wq. If CONFIG_CRYPTO_DEV_ATMEL_{I2C,ECC,SHA204A}=y, the ordering in Makefile guarantees that module_init() for atmel-i2c runs before module_init() for atmel-ecc and atmel-sha204a runs. Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Signed-off-by: Herbert Xu commit 59f71498c7ff591824863be55b0eff5aae743947 Author: Uwe Kleine-König Date: Fri Apr 29 16:03:49 2022 +0200 crypto: atmel-i2c - Simplify return code in probe function There is no semantical change introduced by this change. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Signed-off-by: Herbert Xu commit 0aa6ac7795cab3d8bcf3209d77459d595f4843da Author: Meenakshi Aggarwal Date: Fri Apr 29 13:48:08 2022 +0200 crypto: caam/rng - Add support for PRNG Add support for random number generation using PRNG mode of CAAM and expose the interface through crypto API. According to the RM, the HW implementation of the DRBG follows NIST SP 800-90A specification for DRBG_Hash SHA-256 function Signed-off-by: Meenakshi Aggarwal Reviewed-by: Horia Geant Signed-off-by: Herbert Xu commit 25dfae684031f292034a0f42155090df6309f152 Author: Herbert Xu Date: Fri Apr 29 13:37:20 2022 +0800 hwrng: cn10k - Enable compile testing This patch enables COMPILE_TEST for cn10k. Signed-off-by: Herbert Xu commit 57182182317aaadb6548f39eeadfe557a24f6a30 Author: Uwe Kleine-König Date: Thu Apr 28 19:11:46 2022 +0200 crypto: atmel-sha204a - Suppress duplicate error message Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As atmel_sha204a_remove already emits an error message ant the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this error message. Note that after atmel_sha204a_remove() returns *i2c_priv is freed, so there is trouble ahead because atmel_sha204a_rng_done() might be called after that freeing. So make the error message a bit more frightening. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 384e9aa77ae6b0575631ea3100563a9fe44b0e77 Author: Uwe Kleine-König Date: Thu Apr 28 19:11:45 2022 +0200 crypto: atmel-sha204a - Remove useless check kfree(NULL) is a noop, so there is no win in checking a pointer before kfreeing it. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 580c8619698f2c4af4c81abc2a26641d4162d9b3 Author: Juerg Haefliger Date: Wed Apr 27 09:43:51 2022 +0200 crypto: inside-secure - Add MODULE_FIRMWARE macros The safexcel module loads firmware so add MODULE_FIRMWARE macros to provide that information via modinfo. Signed-off-by: Juerg Haefliger Acked-by: Antoine Tenart Signed-off-by: Herbert Xu commit fdbf5e46e7af5b13ee9df35f2ea62484591c4341 Author: Kai Ye Date: Tue Apr 26 19:53:58 2022 +0800 crypto: hisilicon/sec - add sm4 generic selection Add sm4 generic selection for fallback tfm in the Kconfig. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit fa048cd1ef5ef86bdd42af0180dfd9d3f7af81e7 Author: Pali Rohár Date: Thu Apr 21 15:44:57 2022 +0200 crypto: atmel-sha204a - Add support for ATSHA204 cryptochip ATSHA204 is predecessor of ATSHA204A which supports less features and some of them are slightly different. Introduce a new compatible string for ATSHA204 cryptochip "atmel,atsha204". Current version of Linux kernel driver atmel-sha204a.c implements only hw random number generator which is same in both ATSHA204 and ATSHA204A cryptochips. So driver already supports also ATSHA204 hw generator, so just simply extends list of compatible strings. Signed-off-by: Pali Rohár Acked-by: Rob Herring Signed-off-by: Herbert Xu commit bd61395ae8393f28f4b084702acd6f5f02b1f7c0 Author: Randy Dunlap Date: Fri Apr 29 22:01:23 2022 -0700 KVM: arm64: nvhe: Eliminate kernel-doc warnings Don't use begin-kernel-doc notation (/**) for comments that are not in kernel-doc format. This prevents these kernel-doc warnings: arch/arm64/kvm/hyp/nvhe/switch.c:126: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Disable host events, enable guest events arch/arm64/kvm/hyp/nvhe/switch.c:146: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Disable guest events, enable host events arch/arm64/kvm/hyp/nvhe/switch.c:164: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Handler for protected VM restricted exceptions. arch/arm64/kvm/hyp/nvhe/switch.c:176: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Handler for protected VM MSR, MRS or System instruction execution in AArch64. arch/arm64/kvm/hyp/nvhe/switch.c:196: warning: Function parameter or member 'vcpu' not described in 'kvm_handle_pvm_fpsimd' arch/arm64/kvm/hyp/nvhe/switch.c:196: warning: Function parameter or member 'exit_code' not described in 'kvm_handle_pvm_fpsimd' arch/arm64/kvm/hyp/nvhe/switch.c:196: warning: expecting prototype for Handler for protected floating(). Prototype was for kvm_handle_pvm_fpsimd() instead Fixes: 09cf57eba304 ("KVM: arm64: Split hyp/switch.c to VHE/nVHE") Fixes: 1423afcb4117 ("KVM: arm64: Trap access to pVM restricted features") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Fuad Tabba Cc: Marc Zyngier Cc: David Brazdil Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220430050123.2844-1-rdunlap@infradead.org commit 7ee74cc7ad7ef526e4383a3a3294b7039622eb37 Author: Ard Biesheuvel Date: Thu Apr 28 16:03:50 2022 +0200 KVM: arm64: Avoid unnecessary absolute addressing via literals There are a few cases in the nVHE code where we take the absolute address of a symbol via a literal pool entry, and subsequently translate it to another address space (PA, kimg VA, kernel linear VA, etc). Originally, this literal was needed because we relied on a different translation for absolute references, but this is no longer the case, so we can simply use relative addressing instead. This removes a couple of RELA entries pointing into the .text segment. Signed-off-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220428140350.3303481-1-ardb@kernel.org commit 76a8426959a6a70b0d00158d2d7a8661957878c8 Merge: 949dfdcf343c1 4eaf1797bca19 Author: David S. Miller Date: Fri May 6 10:50:05 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-05-05 This series contains updates to ice driver only. Wan Jiabing converts an open coded min selection to min_t(). Maciej commonizes on a single find VSI function and removes the duplicated implementation. Wojciech adjusts the return value when exceeding ICE_MAX_CHAIN_WORDS to, a more appropriate, -ENOSPC and allows for the error to be propagated. Michal adds support for ndo_get_devlink_port(). Jake does some cleanup related to virtualization code. Mainly involving function header comments and wording changes. NULL checks are added to ice_get_vf_vsi() calls in order to prevent static analysis tools from complaining that a NULL value could be dereferenced. --- v2: Dropped patch 1: "ice: Add support for classid based queue selection" ==================== Signed-off-by: David S. Miller commit ad1bd2bf658062c6edc5ff1ee1725565a4fc8930 Author: Phil Edworthy Date: Tue May 3 12:55:57 2022 +0100 arm64: dts: renesas: Add initial device tree for RZ/V2M EVK Add basic support for RZ/V2M EVK (based on R9A09G011): - memory - External input clock - UART Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-13-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit fb1929b98f2e1c012b4df596b7b2c9f6f28fbe54 Author: Phil Edworthy Date: Wed May 4 10:44:56 2022 +0100 arm64: dts: renesas: Add initial DTSI for RZ/V2M SoC Details of the SoC can be found here: https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-cortex-a-mpus/rzv2m-dual-cortex-a53-lpddr4x32bit-ai-accelerator-isp-4k-video-codec-4k-camera-input-fhd-display-output Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220504094456.24386-3-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit d7f49cb45183f6d4db35c087ba4ca0ac92751cc9 Merge: a1721bbbdb5c6 96055bf71ab16 Author: Geert Uytterhoeven Date: Fri May 6 11:09:45 2022 +0200 Merge tag 'renesas-r9a09g011-dt-binding-defs-tag' into renesas-arm-dt-for-v5.19 Renesas RZ/V2M DT Binding Definitions Clock definitions for the Renesas RZ/V2M (R9A09G011) SoC, shared by driver and DT source files. commit a1721bbbdb5c6687d157f8b8714bba837f6028ac Author: Geert Uytterhoeven Date: Mon May 2 15:35:17 2022 +0200 arm64: dts: renesas: r8a779a0: Update to R-Car Gen4 compatible values Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence update the compatible properties in various device nodes to include family-specific compatible values for R-Car Gen4 instead of R-Car Gen3: - DMAC, - (H)SCIF, - I2C, - IPMMU, - WDT. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/73cea9d5e1a6639422c67e4df4285042e31c9fd5.1651497071.git.geert+renesas@glider.be commit fcb3083968df0addf6fb0b452d6e29be756ea943 Author: Herve Codina Date: Fri Apr 29 15:41:43 2022 +0200 ARM: dts: r9a06g032: Link the PCI USB devices to the USB PHY Describe the PCI USB devices that are behind the PCI bridge, adding necessary links to the USB PHY device. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220429134143.628428-8-herve.codina@bootlin.com Signed-off-by: Geert Uytterhoeven commit 47f02f883883d6e318a06cb7c05c8a7bed2c17ce Author: Herve Codina Date: Fri Apr 29 15:41:42 2022 +0200 ARM: dts: r9a06g032: Add USB PHY DT support Define the r9a06g032 generic part of the USB PHY device node. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220429134143.628428-7-herve.codina@bootlin.com Signed-off-by: Geert Uytterhoeven commit 627632dcc2dd2e9a09a1bafb2e5fcf53cd4c968a Author: Herve Codina Date: Fri Apr 29 15:41:41 2022 +0200 ARM: dts: r9a06g032: Add internal PCI bridge node Add the device node for the r9a06g032 internal PCI bridge device. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220429134143.628428-6-herve.codina@bootlin.com Signed-off-by: Geert Uytterhoeven commit d8ff11cdc0b153bfebf103716cb1e3f6a26029ed Author: Miquel Raynal Date: Fri Apr 29 12:46:02 2022 +0200 ARM: dts: r9a06g032: Describe the RTC Describe the SoC RTC which counts time and provides alarm support. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220429104602.368055-7-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit 6af663af3c46300032fd7a783bdc3e585035438f Author: Geert Uytterhoeven Date: Mon May 2 19:33:52 2022 +0200 arm64: dts: renesas: Add interrupt-names to CANFD nodes The Renesas R-Car CAN-FD Controller on R-Car Gen3 and RZ/G2 SoCs has two interrupts. Add interrupt-names properties to all CAN-FD device nodes to identify the individual interrupts, so we can make this property a required property in the DT bindings. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/10eef1e20372af4a156b06df8e5124666ec7c6b6.1651512451.git.geert+renesas@glider.be commit 470218e29daf7f1de9f4d1af16c7ecf54344f6a1 Author: Biju Das Date: Mon May 2 20:01:55 2022 +0100 arm64: dts: renesas: r9a07g043: Add SPI Multi I/O Bus controller node Add SPI Multi I/O Bus controller node to R9A07G043 (RZ/G2UL) SoC DTSI. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220502190155.84496-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c2ff5c0282f94c1f1f81007e1fa7378fe95f46d3 Author: Biju Das Date: Sun May 1 12:29:25 2022 +0100 arm64: dts: renesas: r9a07g043: Create thermal zone to support IPA Setup a thermal zone driven by SoC temperature sensor. Create passive trip points and bind them to CPUFreq cooling device that supports power extension. Based on the work done by Dien Pham and others for r8a77990 SoC. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501112926.47024-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 91e548da2cb1b180a1ab1059a1c89d7532135da7 Author: Biju Das Date: Sun May 1 12:29:24 2022 +0100 arm64: dts: renesas: r9a07g043: Add TSU node Add TSU node to RZ/G2UL SoC DTSI. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501112926.47024-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e6a9acc370c6cb9e6ff6225b034a7a4374df0134 Author: Biju Das Date: Sun May 1 12:29:23 2022 +0100 arm64: dts: renesas: r9a07g043: Add OPP table Add OPP table for RZ/G2UL SoC. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501112926.47024-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 22ec868997108e514fe380171c45578da630a0ec Author: Biju Das Date: Sun May 1 12:29:22 2022 +0100 arm64: dts: renesas: r9a07g043: Add RSPI{0,1,2} nodes Add RSPI{0,1,2} nodes to R9A07G043 (RZ/G2UL) SoC DTSI. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501112926.47024-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 975253505429bc60d1b400296728fffb416aa1ff Author: Biju Das Date: Thu Apr 28 14:31:56 2022 +0100 arm64: dts: renesas: r9a07g054: Fix external clk node names Add suffix '-clk' for can and extal clk node names and replace the clk node names audio_clk{1,2} with audio{1,2}-clk as per the device tree specification. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220428133156.18080-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1404ca90f49be530551e26b8bc6dfe2142aba86e Author: Biju Das Date: Thu Apr 28 14:31:55 2022 +0100 arm64: dts: renesas: r9a07g044: Fix external clk node names Add suffix '-clk' for can and extal clk node names and replace the clk node names audio_clk{1,2} with audio{1,2}-clk as per the device tree specification. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220428133156.18080-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d5379f9c7f2230d6af6bc0f7d0587cca4689ddc7 Author: Miquel Raynal Date: Fri Apr 29 12:52:28 2022 +0200 ARM: dts: r9a06g032: Fix the NAND controller node Add the missing power-domains property which is mandatory. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220429105229.368728-3-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit f691d4b64c19176099c58811b0e1240259a1d258 Author: Miquel Raynal Date: Thu Apr 21 11:53:21 2022 +0200 ARM: dts: r9a06g032: Fill the UART DMA properties UART 0 to 2 do not have DMA support, while UART 3 to 7 do. Fill the "dmas" and "dma-names" properties for each of these nodes. Please mind that these nodes go through the dmamux node which will redirect the requests to the right DMA controller. The first 4 cells of the "dmas" properties will be transferred as-is to the DMA controllers. The last 2 cells are consumed by the dmamux. Which means cell 0 and 4 are almost redundant, one giving the controller request ID and the other the dmamux channel which is a 1:1 translation of the request IDs, shifted by 16 when pointing to the second DMA controller. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220421095323.101811-11-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit 6002e2f179ec65e97e880b21e919e71852d95204 Author: Miquel Raynal Date: Wed Apr 27 11:56:53 2022 +0200 ARM: dts: r9a06g032: Describe the DMA router There is a dmamux on this SoC which allows picking two different sources for a single DMA request. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220427095653.91804-10-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit 257d24b3589ba745e5709f180667c6b27e5442aa Author: Miquel Raynal Date: Wed Apr 27 11:56:52 2022 +0200 ARM: dts: r9a06g032: Add the two DMA nodes Describe the two DMA controllers available on this SoC. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220427095653.91804-9-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit 747bbcd3aacd95fe200cdda415dba02e872946b5 Author: Laurent Pinchart Date: Sun Apr 24 19:12:28 2022 +0300 arm64: dts: renesas: Remove empty rgb output endpoints Endpoints node must have a remote-endpoint property, as endpoints only exist to model a link between ports. Drop the empty rgb output endpoints from SoC dtsi files, and declare them in the board dts instead. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20220424161228.8147-2-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit b7423e39432c00de8ba8ebefce3849aa502208d1 Author: Laurent Pinchart Date: Sun Apr 24 19:12:27 2022 +0300 arm64: dts: renesas: Remove empty lvds endpoints Endpoints node must have a remote-endpoint property, as endpoints only exist to model a link between ports. Drop the empty lvds endpoints from SoC dtsi files, they should be instead declared in the board dts or in overlays. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20220424161228.8147-1-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 094ff3485a05cd29db083a6e2905e87b68f13538 Author: Biju Das Date: Fri Apr 29 08:24:00 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Enable USB2.0 support Enable USB2.0 Host/Device support on RZ/G2UL SMARC EVK by adding usb{0,1} pincontrol entries to the soc-pinctrl dtsi and deleting the nodes which disabled it. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220429072400.23729-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1ed914e341392dbb7c29f0f62c105a81cce6b3e0 Author: Biju Das Date: Fri Apr 29 08:23:59 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Enable Audio Enable Audio on RZ/G2UL SMARC EVK by adding ssi1 pincontrol entries to the soc-pinctrl dtsi and ssi1 and cpu sound_dai nodes to the board dtsi. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220429072400.23729-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c62af12c700dc435b82df207e49dac3f91ece6c6 Author: Biju Das Date: Fri Apr 29 08:23:58 2022 +0100 arm64: dts: renesas: rzg2l-smarc: Move ssi0 and cpu sound_dai nodes from common dtsi On RZ/G2{L,LC} SoM module, the wm8978 audio codec is connected to ssi0, whereas on RZ/G2UL it is connected to ssi1. So move ssi0 and cpu sound_dai nodes from common dtsi to board specific dtsi. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220429072400.23729-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e4d755cfec44197f605e1a2e9ff17434c6c9d513 Author: Yoshihiro Shimoda Date: Thu Apr 28 22:50:58 2022 +0900 arm64: dts: renesas: Add Renesas White Hawk boards support Initial support for the Renesas White Hawk CPU and BreakOut boards. Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220428135058.597586-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 987da486d84a5643fb0e027fe4fc4dfcb54206a0 Author: Yoshihiro Shimoda Date: Thu Apr 28 22:50:57 2022 +0900 arm64: dts: renesas: Add Renesas R8A779G0 SoC support Add initial support for the Renesas R8A779G0 (R-Car V4H) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220428135058.597586-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 6f6baf690c3b8c41083d7443ab6a5645b96ff91b Author: Thierry Reding Date: Fri May 6 10:56:00 2022 +0200 clk: tegra: Update kerneldoc to match prototypes For some DFLL functions, the kerneldoc comments don't match the function prototype. Fix them up to avoid some warnings at build time. Signed-off-by: Thierry Reding commit 701850dc0c31bfadf75a0a74af7d2c97859945ec Author: Marco Elver Date: Tue May 3 09:38:44 2022 +0200 printk, tracing: fix console tracepoint The original intent of the 'console' tracepoint per the commit 95100358491a ("printk/tracing: Add console output tracing") had been to "[...] record any printk messages into the trace, regardless of the current console loglevel. This can help correlate (existing) printk debugging with other tracing." Petr points out [1] that calling trace_console_rcuidle() in call_console_driver() had been the wrong thing for a while, because "printk() always used console_trylock() and the message was flushed to the console only when the trylock succeeded. And it was always deferred in NMI or when printed via printk_deferred()." With the commit 09c5ba0aa2fc ("printk: add kthread console printers"), things only got worse, and calls to call_console_driver() no longer happen with typical printk() calls but always appear deferred [2]. As such, the tracepoint can no longer serve its purpose to clearly correlate printk() calls and other tracing, as well as breaks usecases that expect every printk() call to result in a callback of the console tracepoint. Notably, the KFENCE and KCSAN test suites, which want to capture console output and assume a printk() immediately gives us a callback to the console tracepoint. Fix the console tracepoint by moving it into printk_sprint() [3]. One notable difference is that by moving tracing into printk_sprint(), the 'text' will no longer include the "header" (loglevel and timestamp), but only the raw message. Arguably this is less of a problem now that the console tracepoint happens on the printk() call and isn't delayed. Link: https://lore.kernel.org/all/Ym+WqKStCg%2FEHfh3@alley/ [1] Link: https://lore.kernel.org/all/CA+G9fYu2kS0wR4WqMRsj2rePKV9XLgOU1PiXnMvpT+Z=c2ucHA@mail.gmail.com/ [2] Link: https://lore.kernel.org/all/87fslup9dx.fsf@jogness.linutronix.de/ [3] Reported-by: Linux Kernel Functional Testing Signed-off-by: Marco Elver Cc: John Ogness Cc: Petr Mladek Reviewed-by: Petr Mladek Acked-by: John Ogness Acked-by: Steven Rostedt (Google) Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220503073844.4148944-1-elver@google.com commit d3a20dcbca4880ada8974b2d0167df99161bbfaf Author: Thierry Reding Date: Fri May 6 10:53:15 2022 +0200 soc/tegra: pmc: Document core domain fields These fields are used to track the state of the core domain. Add basic descriptions so that kerneldoc can be properly generated for them. Signed-off-by: Thierry Reding commit fc4ef9d5724973193bfa5ebed181dba6de3a56db Author: Dongliang Mu Date: Fri May 6 15:24:25 2022 +0800 HID: bigben: fix slab-out-of-bounds Write in bigben_probe There is a slab-out-of-bounds Write bug in hid-bigbenff driver. The problem is the driver assumes the device must have an input but some malicious devices violate this assumption. Fix this by checking hid_device's input is non-empty before its usage. Reported-by: syzkaller Signed-off-by: Dongliang Mu Signed-off-by: Jiri Kosina commit 0c9ee5ba7555016afd1efc9598c3f83de5d83470 Author: Ulf Hansson Date: Fri May 6 10:28:05 2022 +0200 mmc: sdhci-brcmstb: Fix compiler warning Fix the compiler warning triggered by -Wmissing-prototypes for brcmstb_reset() by making it static. Reported-by: kernel test robot Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20220506082805.273909-1-ulf.hansson@linaro.org commit d70522fc541224b8351ac26f4765f2c6268f8d72 Merge: 1a90bfd220201 672c0c5173427 Author: Ingo Molnar Date: Fri May 6 10:21:46 2022 +0200 Merge tag 'v5.18-rc5' into sched/core to pull in fixes & to resolve a conflict - sched/core is on a pretty old -rc1 base - refresh it to include recent fixes. - this also allows up to resolve a (trivial) .mailmap conflict Conflicts: .mailmap Signed-off-by: Ingo Molnar commit 386d0503c1eb04d11ec241789439334f1c2c3b72 Author: Nicolas Ferre Date: Fri May 6 09:49:35 2022 +0200 ARM: configs: at91: Enable AUTOFS_FS required by systemd Align all at91 defconfigs to required options for systemd. The missing of autofs would cause warnings on boot when not available. Suggested-by: Mark Brown Signed-off-by: Nicolas Ferre commit 44a26be07924fdd91fa62e22358504372c6ee20c Author: Mark Brown Date: Thu May 5 18:10:43 2022 +0100 ARM: configs: at91: Enable options required for systemd Even smaller embedded systems are using systemd these days, as are test automation systems like KernelCI, so it is useful to be able to use systemd on these boards by default. Enable options that are missing in the at91_dt_defconfig, cgroups which is critical and autofs4 which is less critical but causes warnings on boot when not available. Signed-off-by: Mark Brown Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220505171043.553079-1-broonie@kernel.org commit 7dac8e27c62d9acec3470d2675747abeacfb7422 Author: Claudiu Beznea Date: Fri Apr 8 11:00:31 2022 +0300 ARM: configs: at91: sama7: enable CONFIG_RESET_CONTROLLER Enable CONFIG_RESET_CONTROLLER. It is necessary for resetting individual in SoC devices. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220408080031.2527232-11-claudiu.beznea@microchip.com commit 1cbc6291603db480908ae0c82eb87ac38a0ef7df Author: Codrin Ciubotariu Date: Mon Mar 7 14:22:02 2022 +0200 ARM: configs: at91: sama7: add MCHP PDMC and DMIC drivers Enable drivers needed for Microchip's PDMC and PDM microphones. Signed-off-by: Codrin Ciubotariu Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220307122202.2251639-7-codrin.ciubotariu@microchip.com commit bc443c31def574e3bfaed50cb493b8305ad79435 Author: Dan Carpenter Date: Thu May 5 13:32:59 2022 +0300 driver core: location: Check for allocations failure Check whether the kzalloc() succeeds and return false if it fails. Fixes: 6423d2951087 ("driver core: Add sysfs support for physical location of a device") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YnOn28OFBHHd5bQb@kili Signed-off-by: Greg Kroah-Hartman commit c3d438eeb5413111889edef10cb5fcc2c0fb8bc9 Author: Lukasz Luba Date: Wed Apr 27 09:08:06 2022 +0100 arch_topology: Trace the update thermal pressure Add trace event to capture the moment of the call for updating the thermal pressure value. It's helpful to investigate how often those events occur in a system dealing with throttling. This trace event is needed since the old 'cdev_update' might not be used by some drivers. The old 'cdev_update' trace event only provides a cooling state value: [0, n]. That state value then needs additional tools to translate it: state -> freq -> capacity -> thermal pressure. This new trace event just stores proper thermal pressure value in the trace buffer, no need for additional logic. This is helpful for cooperation when someone can simply sends to the list the trace buffer output from the platform (no need from additional information from other subsystems). There are also platforms which due to some design reasons don't use cooling devices and thus don't trigger old 'cdev_update' trace event. They are also important and measuring latency for the thermal signal raising/decaying characteristics is in scope. This new trace event would cover them as well. We already have a trace point 'pelt_thermal_tp' which after a change to trace event can be paired with this new 'thermal_pressure_update' and derive more insight what is going on in the system under thermal pressure (and why). Signed-off-by: Lukasz Luba Acked-by: Sudeep Holla Link: https://lore.kernel.org/r/20220427080806.1906-1-lukasz.luba@arm.com Signed-off-by: Greg Kroah-Hartman commit c1b1352f21bcf8c0678c4d4fbfafc4f6729e1daa Author: Imran Khan Date: Wed May 4 19:51:19 2022 +1000 kernfs: Rename kernfs_put_open_node to kernfs_unlink_open_file. Since we are no longer using refcnt for kernfs_open_node instances, rename kernfs_put_open_node to kernfs_unlink_open_file to reflect this change. Also update function description and inline comments accordingly. Signed-off-by: Imran Khan Link: https://lore.kernel.org/r/20220504095123.295859-2-imran.f.khan@oracle.com Signed-off-by: Greg Kroah-Hartman commit d143b9db8069f0e2a0fa34484e806a55a0dd4855 Author: Greg Kroah-Hartman Date: Wed Apr 27 11:04:42 2022 +0200 export: fix string handling of namespace in EXPORT_SYMBOL_NS Commit c3a6cf19e695 ("export: avoid code duplication in include/linux/export.h") broke the ability for a defined string to be used as a namespace value. Fix this up by using stringify to properly encode the namespace name. Fixes: c3a6cf19e695 ("export: avoid code duplication in include/linux/export.h") Cc: Miroslav Benes Cc: Emil Velikov Cc: Jessica Yu Cc: Quentin Perret Cc: Matthias Maennich Reviewed-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220427090442.2105905-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 38ea74eb8fc1b82b39e13a6527095a0036539117 Author: Krzysztof Kozlowski Date: Fri Apr 29 21:59:46 2022 +0200 rpmsg: use local 'dev' variable '&rpdev->dev' is already cached as local variable, so use it to simplify the code. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429195946.1061725-3-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit bb17d110cbf270d5247a6e261c5ad50e362d1675 Author: Krzysztof Kozlowski Date: Fri Apr 29 21:59:45 2022 +0200 rpmsg: Fix calling device_lock() on non-initialized device driver_set_override() helper uses device_lock() so it should not be called before rpmsg_register_device() (which calls device_register()). Effect can be seen with CONFIG_DEBUG_MUTEXES: DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 3 PID: 57 at kernel/locking/mutex.c:582 __mutex_lock+0x1ec/0x430 ... Call trace: __mutex_lock+0x1ec/0x430 mutex_lock_nested+0x44/0x50 driver_set_override+0x124/0x150 qcom_glink_native_probe+0x30c/0x3b0 glink_rpm_probe+0x274/0x350 platform_probe+0x6c/0xe0 really_probe+0x17c/0x3d0 __driver_probe_device+0x114/0x190 driver_probe_device+0x3c/0xf0 ... Refactor the rpmsg_register_device() function to use two-step device registering (initialization + add) and call driver_set_override() in proper moment. This moves the code around, so while at it also NULL-ify the rpdev->driver_override in error path to be sure it won't be kfree() second time. Fixes: 42cd402b8fd4 ("rpmsg: Fix kfree() of static memory on setting driver_override") Reported-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220429195946.1061725-2-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit a6cfe03c34bad8c7f51aba49a73403e348c51d1f Author: Ard Biesheuvel Date: Tue May 3 14:29:39 2022 +0200 efi: stub: prefer mirrored memory for randomized allocations If the system exposes memory regions with the EFI_MORE_RELIABLE attribute, it is implied that it is intended to be used for allocations that are relatively important, such as the kernel's static image. Since efi_random_alloc() is mostly (only) used for allocating space for the kernel image, let's update it to take this into account, and disregard all memory without the EFI_MORE_RELIABLE attribute if there is sufficient memory available that does have this attribute. Note that this change only affects booting with randomization enabled. In other cases, the EFI stub runs the kernel image in place unless its placement is unsuitable for some reason (i.e., misaligned, or its BSS overlaps with another allocation), and it is left to the bootloader to ensure that the kernel was loaded into EFI_MORE_RELIABLE memory if this is desired. Signed-off-by: Ard Biesheuvel Reviewed-by: Kefeng Wang commit a5f83aacf1c7568c407aa235f3a0bad613aa4aa0 Author: Tudor Ambarus Date: Wed Apr 20 16:47:40 2022 +0300 ARM: configs: at91: sama7: Enable MTD_UBI_BLOCK Address read only block filesystems like SquashFS, and use MTD_UBI_BLOCK to benefit of UBI's bit-flip handling and wear-levelling. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220420134740.193563-3-tudor.ambarus@microchip.com commit 398a7f7ce7121782d9f0b513c57ffed3b6a18fdd Author: Tudor Ambarus Date: Wed Apr 20 16:47:39 2022 +0300 ARM: configs: at91: sama7: Enable MTD_UBI_FASTMAP Use fastmap to accelerate the attach procedure. Signed-off-by: Tudor Ambarus [nicolas.ferre@microchip.com: removed unrelated changes] Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220420134740.193563-2-tudor.ambarus@microchip.com commit 907080f0a5ba914b79f32c82bd2fc2e84510f558 Author: Eugen Hristev Date: Tue May 3 12:51:26 2022 +0300 ARM: configs: at91: sama7: add xisc and csi2dc Enable XISC and CSI2DC drivers. Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220503095127.48710-5-eugen.hristev@microchip.com commit f095e413f9363a809d064cb04ced084108af45ac Author: Eugen Hristev Date: Tue May 3 12:51:27 2022 +0300 ARM: multi_v7_defconfig: add atmel video pipeline modules Add drivers for the atmel video capture pipeline: atmel isc, xisc and microchip csi2dc. Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220503095127.48710-6-eugen.hristev@microchip.com commit 5c6f84728db77367df696ebb63a8f6430b3c9708 Author: Tudor Ambarus Date: Wed Apr 20 16:47:38 2022 +0300 ARM: configs: at91: Remove MTD_BLOCK and use MTD_UBI_BLOCK for read only block FS Using mtdblock on raw flashes is generally a bad idea as it lacks wear-leveling, bad block handling or power-cut management. What happens when you use mtdblock and you change any sector of your mtdblockX device, is that it reads the whole corresponding eraseblock into the memory, erases the eraseblock, changes the sector in RAM, and writes the whole eraseblock back. If you have a power failure when the eraseblock is being erased, you lose all the block device sectors in it. The flash will likely decay soon because the eraseblocks will wear out. Remove this archaic tool as its use case should rather be only for debug purposes. This means that write-capable block file systems like ext2, ext3, FAT, etc. will no longer be addressed with at91 defconfigs. For read only block filesystems like SquashFS, use MTD_UBI_BLOCK instead and benefit of UBI's bit-flip handling and wear-levelling. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220420134740.193563-1-tudor.ambarus@microchip.com commit 23426d1be3c20907b4f3d72bf95234d4ee254393 Author: Phil Edworthy Date: Wed May 4 15:54:46 2022 +0100 clk: renesas: r9a09g011: Add eth clock and reset entries Add ethernet clock/reset entries to CPG driver. Note that the AXI and CHI clocks are both enabled and disabled using the same register bit. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220504145454.71287-2-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 1dd65bb08604ad2906d839c243e1bede2b0efe53 Author: Phil Edworthy Date: Tue May 3 12:55:55 2022 +0100 clk: renesas: Add RZ/V2M support using the rzg2l driver The Renesas RZ/V2M SoC is very similar to RZ/G2L, though it doesn't have any CLK_MON registers. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-11-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 98bcaafd7fb06647529227561ee72e37d3f00ff0 Merge: c67f84e97bafe b8b8eeda63d60 Author: Dave Airlie Date: Fri May 6 17:25:54 2022 +1000 Merge tag 'mediatek-drm-next-5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 5.19 1. Add display support for MT8186 2. Miscellaneous refinement and fixup. Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/1651702965-23630-1-git-send-email-chunkuang.hu@kernel.org commit c67f84e97bafe73c47d5773105b114118ffb84df Merge: af3847a7472d2 6071c4c2a319d Author: Dave Airlie Date: Fri May 6 17:19:11 2022 +1000 Merge tag 'drm-misc-next-2022-05-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.19: UAPI Changes: Cross-subsystem Changes: Core Changes: - Add DRM-managed mutex initialisation - edid: Doc improvements - fbdev: deferred io improvements - format-helper: consolidate format conversion helpers - gem: Rework fence handling in drm_gem_plane_helper_prepare_fb Driver Changes: - ast: DisplayPort support, locking improvements - exynos: Revert conversion to devm_drm_of_get_bridge for DSI - mgag200: locking improvements - mxsfb: LCDIF CRC support - nouveau: switch to drm_gem_plane_helper_prepare_fb - rockchip: Refactor IOMMU initialisation, make some structures static, replace drm_detect_hdmi_monitor with drm_display_info.is_hdmi, support swapped YUV formats, clock improvements, rk3568 support, VOP2 support - bridge: - adv7511: Enable CEC for ADV7535 - it6505: Send DPCD SET_POWER to monitor at disable - mcde_dsi: Revert conversion to devm_drm_of_get_bridge - tc358767: Fix for eDP and DP DT endpoint parsing - new bridge: i.MX8MP LDB - panel: - new panel: Startek KD070WVFPA043-C069A Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220505131127.lcqvsywo7qt3eywk@houat commit d88591a555325f6f0ec1f28c5fe2c7f2383a4366 Author: Joshua-Dickens Date: Fri Apr 29 17:01:34 2022 -0700 Hid: wacom: Fix kernel test robot warning Kernel test robot throws the following warning - >> drivers/hid/wacom_wac.c:2411:42: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] hid_warn(hdev, "Dropped %hu packets", value - wacom_wac->hid_data.sequence_number); ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %d Explicitly casting the argument to unsigned short to silence the warning and retain the intended behavior. Reported-by: kernel test robot Signed-off-by: Joshua Dickens Signed-off-by: Jiri Kosina commit 254c4a824c7c6a53360bc4974710e4213b8b7f5d Author: Leon Romanovsky Date: Thu May 5 13:06:45 2022 +0300 xfrm: drop not needed flags variable in XFRM offload struct After drivers were converted to rely on direction, the flags is not used anymore and can be removed. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 3ef535eccea33b2a4fce20f4f298e09647350d71 Author: Leon Romanovsky Date: Thu May 5 13:06:44 2022 +0300 net/mlx5e: Use XFRM state direction instead of flags Convert mlx5 driver to use XFRM state direction. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 55e2f83afb1c142885da63c5a9ce2998b6f6ab21 Author: Leon Romanovsky Date: Thu May 5 13:06:43 2022 +0300 netdevsim: rely on XFRM state direction instead of flags Make sure that netdevsim relies on direction and not on flags. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Acked-by: Jakub Kicinski Signed-off-by: Steffen Klassert commit 4c60bc7d1f2a908f53260bc4a0831b3ea204f327 Author: Nikolai Kondrashov Date: Thu Apr 21 19:50:52 2022 +0200 HID: uclogic: Disable pen usage for Huion keyboard interfaces Disable pen usage inputs for Huion interfaces reporting on-the-frame buttons. We don't want to change those, as they mostly work, but we want to avoid creation of a mute pen interface, confusing to users. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit f5927973f8d667eb93b81f796039c0ef94449866 Author: Nikolai Kondrashov Date: Thu Apr 21 19:50:51 2022 +0200 HID: uclogic: Support disabling pen usage Restore the ability to disable pen usage in hid-uclogic to support e.g. keyboard interfaces which also have pen usages for some reason, but which we don't want to rewrite report descriptors for. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit d64a6e4460d6415df37590ecb76fad6bd5f2c8a6 Author: Nikolai Kondrashov Date: Thu Apr 21 19:50:50 2022 +0200 HID: uclogic: Pass keyboard reports as is Allow keyboard reports from interface #1 of Huion tablets to pass unmodified, and stop the Wacom X.org driver from handling them. The method for the latter is rather crude and also take the Dial reports from the Wacom driver, but it's expected that libinput will be able to handle them (still to be tested). This enables Huion HS611 media and desktop keys. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 4933a722a05c99be124bc31fbcc750d7c0a04bc9 Author: Nikolai Kondrashov Date: Thu Apr 21 19:50:49 2022 +0200 HID: uclogic: Clarify pen/frame desc_ptr description Documentation improvements. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 87dc28eb11ac2f52b8f73af061f9acd32fb895c3 Author: Nikolai Kondrashov Date: Thu Apr 21 19:50:48 2022 +0200 HID: uclogic: Clarify params desc_size description Documentation improvements. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 0c05ab78e3f2105de0f7be56e244906b1e8d176d Author: Leon Romanovsky Date: Thu May 5 13:06:42 2022 +0300 ixgbe: propagate XFRM offload state direction instead of flags Convert the ixgbe driver to rely on XFRM offload state direction instead of flags bits that were not checked at all. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 482db2f1dd211f73ad9d71e33ae15c1df6379982 Author: Leon Romanovsky Date: Thu May 5 13:06:41 2022 +0300 xfrm: store and rely on direction to construct offload flags XFRM state doesn't need anything from flags except to understand direction, so store it separately. For future patches, such change will allow us to reuse xfrm_dev_offload for policy offload too, which has three possible directions instead of two. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit 87e0a94e60ea2e29be9dec6bc146fbc9861a4055 Author: Leon Romanovsky Date: Thu May 5 13:06:40 2022 +0300 xfrm: rename xfrm_state_offload struct to allow reuse The struct xfrm_state_offload has all fields needed to hold information for offloaded policies too. In order to do not create new struct with same fields, let's rename existing one and reuse it later. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Acked-by: David S. Miller Signed-off-by: Steffen Klassert commit 06be0d6442a07f73107964d7b56c21759c6dfb00 Author: frank zago Date: Wed Apr 20 21:40:41 2022 -0500 HID: Add support for Mega World controller force feedback This patch adds support for one of the several Mega World USB game controller with integrated force feedback. It is a HID based memory-less game controller, with a weak motor on the left, and a strong one on the right. Signed-off-by: frank zago Signed-off-by: Jiri Kosina commit a36708e646586f74d073199828ed878b223e988d Author: Leon Romanovsky Date: Thu May 5 13:06:39 2022 +0300 xfrm: delete not used number of external headers num_exthdrs is set but never used, so delete it. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Acked-by: David S. Miller Signed-off-by: Steffen Klassert commit b01a277a0520edd5c815af346f05ef2c747919b6 Author: Leon Romanovsky Date: Thu May 5 13:06:38 2022 +0300 xfrm: free not used XFRM_ESP_NO_TRAILER flag After removal of Innova IPsec support from mlx5 driver, the last user of this XFRM_ESP_NO_TRAILER was gone too. This means that we can safely remove it as no other hardware is capable (or need) to remove ESP trailer. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Acked-by: David S. Miller Signed-off-by: Steffen Klassert commit 22cc687326e049fe294da118d9a067538c0066cb Author: Manikanta Pubbisetty Date: Wed May 4 14:09:00 2022 +0530 ath11k: Fix RX de-fragmentation issue on WCN6750 The offset of REO register where the RX fragment destination ring is configured is different in WCN6750 as compared to WCN6855. Due to this differnce in offsets, on WCN6750, fragment destination ring will be configured incorrectly, leading to RX fragments not getting delivered to the driver. Fix this by defining HW specific offsets for the REO MISC CTL register. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504083900.31513-1-quic_mpubbise@quicinc.com commit f2a7064a78b22f2b68b9fcbc8a6f4c5e61c5ba64 Author: Robert Marko Date: Sun Oct 10 00:17:11 2021 +0200 ath10k: support bus and device specific API 1 BDF selection Some ath10k IPQ40xx devices like the MikroTik hAP ac2 and ac3 require the BDF-s to be extracted from the device storage instead of shipping packaged API 2 BDF-s. This is required as MikroTik has started shipping boards that require BDF-s to be updated, as otherwise their WLAN performance really suffers. This is however impossible as the devices that require this are release under the same revision and its not possible to differentiate them from devices using the older BDF-s. In OpenWrt we are extracting the calibration data during runtime and we are able to extract the BDF-s in the same manner, however we cannot package the BDF-s to API 2 format on the fly and can only use API 1 to provide BDF-s on the fly. This is an issue as the ath10k driver explicitly looks only for the board.bin file and not for something like board-bus-device.bin like it does for pre-cal data. Due to this we have no way of providing correct BDF-s on the fly, so lets extend the ath10k driver to first look for BDF-s in the board-bus-device.bin format, for example: board-ahb-a800000.wifi.bin If that fails, look for the default board file name as defined previously. Signed-off-by: Robert Marko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211009221711.2315352-1-robimarko@gmail.com commit d9e441855c64e3b4c1d83b7e82d723c12d5de3fa Author: Kalle Valo Date: Wed May 4 09:00:44 2022 +0300 ath10k: mac: fix too long lines checkpatch warns: drivers/net/wireless/ath/ath10k/mac.c:2696: line length of 92 exceeds 90 columns drivers/net/wireless/ath/ath10k/mac.c:6942: line length of 94 exceeds 90 columns drivers/net/wireless/ath/ath10k/mac.c:6948: line length of 91 exceeds 90 columns These were introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for MLO support"). Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503060415.24499-2-kvalo@kernel.org commit 80c5075f39996dc75ee8bb7748c4805ffea0e2fb Author: Kalle Valo Date: Wed May 4 09:00:43 2022 +0300 ath11k: mac: fix too long line checkpatch warns: drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for MLO support"). Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503060415.24499-1-kvalo@kernel.org commit af3847a7472d2def8358b7ae94b14f1d20fd8661 Merge: 97ab530870cc2 1df1c79cbb7ac Author: Dave Airlie Date: Fri May 6 16:16:13 2022 +1000 Merge tag 'drm-intel-gt-next-2022-05-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - Add kerneldoc for engine class enum (Matt Roper) - Add compute engine ABI (Matt Roper) Driver Changes: - Define GuC firmware version for DG2 (John Harrison) - Clear SET_PREDICATE_RESULT prior to executing the ring (Chris Wilson) - Fix race in __i915_vma_remove_closed (Karol Herbst) - Add register for compute engine's MMIO-based TLB invalidation (Matt Roper) - Xe_HP SDV and DG2 have up to 4 CCS engines (Daniele Ceraolo Spurio) - Add initial Ponte Vecchio definitions (Stuart Summers) - Document the eviction of the Flat-CCS objects (Ramalingam C) - Use existing uncore helper to read gpm_timestamp (Umesh Nerlige Ramappa) - Fix issue with LRI relative addressing (Akeem G Abodunrin) - Skip poisoning SET_PREDICATE_RESULT on dg2 (Chris Wilson) - Optimize the ccs_sz calculation per chunk (Ramalingam C) - Remove superfluous string helper include (Jani Nikula) - Fix assert in i915_ggtt_pin (Tvrtko Ursulin) - Use IOMEM_ERR_PTR() directly (Kefeng Wang) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YnNxCm1pyflu3taj@tursulin-mobl2 commit 454744754cbf2c21b3fc7344e46e10bee2768094 Author: H. Nikolaus Schaller Date: Mon May 2 14:38:32 2022 +0200 wl1251: dynamically allocate memory used for DMA With introduction of vmap'ed stacks, stack parameters can no longer be used for DMA and now leads to kernel panic. It happens at several places for the wl1251 (e.g. when accessed through SDIO) making it unuseable on e.g. the OpenPandora. We solve this by allocating temporary buffers or use wl1251_read32(). Tested on v5.18-rc5 with OpenPandora. Fixes: a1c510d0adc6 ("ARM: implement support for vmap'ed stacks") Signed-off-by: H. Nikolaus Schaller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1676021ae8b6d7aada0b1806fed99b1b8359bdc4.1651495112.git.hns@goldelico.com commit 193eb523d27c4225aa6cf6fe7debac4d3eac942f Author: Jakub Kicinski Date: Wed May 4 09:33:16 2022 -0700 qtnfmac: switch to netif_napi_add_weight() qtnfmac chooses its own magic NAPI weight so switch to the new API created for those who don't use NAPI_POLL_WEIGHT. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504163316.549648-4-kuba@kernel.org commit 3ed27b602cc3e13e37a411980083bb850aff0a01 Author: Jakub Kicinski Date: Wed May 4 09:33:15 2022 -0700 mt76: switch to netif_napi_add_tx() Switch to the new API not requiring passing in NAPI_POLL_WEIGHT. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504163316.549648-3-kuba@kernel.org commit f1c5d4ded782800d58321a9f10d0caff2af56fc3 Author: Jakub Kicinski Date: Wed May 4 09:33:14 2022 -0700 wil6210: switch to netif_napi_add_tx() Switch to the new API not requiring passing in NAPI_POLL_WEIGHT. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220504163316.549648-2-kuba@kernel.org commit 97ab530870cc23bf20952ce8a1d86196dddc2e6e Merge: b900352f9ddeb 927d8fd465adb Author: Dave Airlie Date: Fri May 6 15:07:07 2022 +1000 Merge tag 'imx-drm-next-2022-05-04' of git://git.pengutronix.de/pza/linux into drm-next drm/imx: various cleanups - Use swap() instead of open-coding in ipu-image-convert. - Use devm_platform_ioremap_resource() helper in imx-tve. - Make static channel_offsets array const in ipu-dc. - Remove redundant zpos, color encoding and range initialization. Signed-off-by: Dave Airlie From: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20220504144628.3954620-1-p.zabel@pengutronix.de commit b900352f9ddebc5c8dd30dc16218c4ff1b8c9147 Merge: 8d62a974ac5fa 3da2c38231a4c Author: Dave Airlie Date: Fri May 6 15:05:27 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-04-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-04-29: amdgpu - RAS updates - SI dpm deadlock fix - Misc code cleanups - HDCP fixes - PSR fixes - DSC fixes - SDMA doorbell cleanups - S0ix fix - DC FP fix - Zen dom0 regression fix for APUs - IP discovery updates - Initial SoC21 support - Support for new vbios tables - Runtime PM fixes - Add PSP TA debugfs interface amdkfd: - Misc code cleanups - Ignore bogus MEC signals more efficiently - SVM fixes - Use bitmap helpers radeon: - Misc code cleanups - Spelling/grammer fixes From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220429144853.5742-1-alexander.deucher@amd.com commit c210063b40acab74bb7262d2bfae557171884ff2 Author: Rex-BC Chen Date: Thu May 5 19:52:21 2022 +0800 cpufreq: mediatek: Add opp notification support From this opp notifier, cpufreq should listen to opp notification and do proper actions when receiving events of disable and voltage adjustment. One of the user for this opp notifier is MediaTek SVS. The MediaTek Smart Voltage Scaling (SVS) is a hardware which calculates suitable SVS bank voltages to OPP voltage table. Signed-off-by: Andrew-sh.Cheng Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno [ Viresh: Renamed opp_freq as current_freq and moved its initialization ] Signed-off-by: Viresh Kumar commit 6a17b3876bc8303612d7ad59ecf7cbc0db418bcd Author: Jia-Wei Chang Date: Thu May 5 19:52:20 2022 +0800 cpufreq: mediatek: Refine mtk_cpufreq_voltage_tracking() Because the difference of sram and proc should in a range of min_volt_shift and max_volt_shift. We need to adjust the sram and proc step by step. We replace VOLT_TOL (voltage tolerance) with the platform data and update the logic to determine the voltage boundary and invoking regulator_set_voltage. - Use 'sram_min_volt' and 'sram_max_volt' to determine the voltage boundary of sram regulator. - Use (sram_min_volt - min_volt_shift) and 'proc_max_volt' to determine the voltage boundary of vproc regulator. Moreover, to prevent infinite loop when tracking voltage, we calculate the maximum value for each platform data. We assume min voltage is 0 and tracking target voltage using min_volt_shift for each iteration. The retry_max is 3 times of expeted iteration count. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit ead858bd128d4ecfb2107115190d52d50416ec45 Author: Rex-BC Chen Date: Thu May 5 19:52:19 2022 +0800 cpufreq: mediatek: Move voltage limits to platform data Voltages and shifts are defined as macros originally. There are different requirements of these values for each MediaTek SoCs. Therefore, we add the platform data and move these values into it. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit f126fbadce92b92c3a7be41e4abc1fbae93ae2ef Author: Rex-BC Chen Date: Thu May 5 19:52:18 2022 +0800 cpufreq: mediatek: Unregister platform device on exit We register the platform device when driver inits. However, we do not unregister it when driver exits. To resolve this, we declare the platform data to be a global static variable and rename it to be "cpufreq_pdev". With this global variable, we can do platform_device_unregister() when driver exits. Fixes: 501c574f4e3a ("cpufreq: mediatek: Add support of cpufreq to MT2701/MT7623 SoC") Signed-off-by: Rex-BC Chen [ Viresh: Commit log and Subject ] Signed-off-by: Viresh Kumar commit 19794489fa2474a55c00848e00ca3d15ea01d36c Author: Stephen Boyd Date: Tue Apr 26 19:03:39 2022 -0700 arm64: dts: qcom: Only include sc7180.dtsi in sc7180-trogdor.dtsi The SoC is always present on sc7180-trogdor.dtsi and thus we should include it in the "generic" dtsi file for trogdor. Previously we had removed it from there because we had to do the spi6/spi0 swizzle, so each trogdor variant board had to include sc7180.dtsi and then sc7180-trogdor.dtsi so that the latter dtsi file could modify the right spi bus for EC and H1 properties that are common to all trogdor boards. Now that we're done with that we can replace sc7180.dtsi includes with sc7180-trogdor.dtsi and include sc7180.dtsi in sc7180-trogdor.dtsi as was originally intended. We still need to include sc7180-trogdor.dtsi before the bridge dtsi files though because those rely on the panel label. Cc: "Joseph S. Barrera III" Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220427020339.360855-4-swboyd@chromium.org commit d277cab7afc7b54ea91808c0895d78c2021af534 Author: Stephen Boyd Date: Tue Apr 26 19:03:38 2022 -0700 arm64: dts: qcom: sc7180-trogdor: Simplify spi0/spi6 labeling We had to do this spi0/spi6 flip-flop on trogdor-r0 because the spi buses got swizzled between r0 and r1. The swizzle stopped after r1, but we kept this around to support either hardware possibility and to keep trogdor-r0 working. trogdor-r0 isn't supported upstream, so this swizzle is not doing anything besides making a pattern that others tryt to copy for the EC and H1 nodes. Let's remove it and simplify the dts files. Cc: "Joseph S. Barrera III" Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220427020339.360855-3-swboyd@chromium.org commit 51d30402be7506db007af6d29c6bc7c1cefcc82f Author: Stephen Boyd Date: Tue Apr 26 19:03:37 2022 -0700 arm64: dts: qcom: sc7180-trogdor: Simplify trackpad enabling Trogdor boards with a detachable keyboard don't have a trackpad over i2c. Instead the trackpad is on the detachable keyboard base. Let's move the enabling of the trackpad i2c bus out of the base sc7180-trogdor.dtsi file so that each trogdor board that is detachable, of which there are many, doesn't have to disable the trackpad bus. Cc: "Joseph S. Barrera III" Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220427020339.360855-2-swboyd@chromium.org commit 366a0a194b3b3e3e52bc7b7b1ac35b40a1187902 Author: Douglas Anderson Date: Tue Apr 26 12:41:03 2022 -0700 arm64: dts: qcom: sc7280: eDP for herobrine boards Add eDP support to herobrine boards, splitting up amongst the different files as makes sense. Rationale for the current split of things: * The eDP connector itself is on qcard. However, not all devices with a qcard will use an eDP panel. Some might use MIPI and, presumably, someone could build a device with qcard that had no display at all. * The qcard provides a PWM for backlight that goes to the eDP connector. This PWM is also provided to the board and it's expected that it would be used as the backlight PWM even for herobrine devices with MIPI displays. * It's currently assumed that all herobrine boards will have some sort of display, either MIPI or eDP (but not both). * We will assume herobrine-rev1 has eDP. The schematics allow for a MIPI panel to be hooked up but, aside from some testing, nobody is doing this and most boards don't have all the parts stuffed for it. The two panels would also share a PWM for backlight, which is weird. * herobrine-villager and herobrine-hoglin (crd) also have eDP. * herobrine-hoglin (crd) has slightly different regulator setup for the backlight. It's expected that this is unique to this board. See comments in the dts file. * There are some regulators that are defined in the qcard schematic but provided by the board like "vreg_edp_bl" and "vreg_edp_3p3". While we could put references to these regulators straight in the qcard.dtsi file, this would force someone using qcard that didn't provide those regulators to provide a dummy or do an ugly /delete-node/. Instead, we'll add references in herobrine.dtsi. Signed-off-by: Douglas Anderson Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426124053.v2.1.Iedd71976a78d53c301ce0134832de95a989c9195@changeid commit cadf16c9469e58ba74806f76b3d0f9f553a41b2c Author: Adam Skladowski Date: Tue Apr 26 09:30:48 2022 +0200 clk: qcom: gcc-msm8976: Add modem reset Add modem reset, it will be needed during modem bringup. Signed-off-by: Adam Skladowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426073048.11509-4-a39.skl@gmail.com commit 7e555e9975698924d7f3ead154847bcf8f5cd40c Author: Adam Skladowski Date: Tue Apr 26 09:30:47 2022 +0200 dt-bindings: clk: qcom: gcc-msm8976: Add modem reset Add modem reset for MSM8976. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426073048.11509-3-a39.skl@gmail.com commit 24a8ed12aa00af135fe698061017042532aac5e5 Author: Adam Skladowski Date: Tue Apr 26 09:30:46 2022 +0200 clk: qcom: gcc-msm8976: Set floor ops for SDCC Just like in case of other SoCs change SDCC1/SDCC2 ops to floor to avoid overclocking controller. This commit only sets SDCC1/SDCC2 which are used for EMMC/SDCARD. Leave SDCC3 because on this platform it's mostly used for WIFI/BT chips, like on Sony Loire familly devices. Signed-off-by: Adam Skladowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426073048.11509-2-a39.skl@gmail.com commit 4ac7e878c15781286c043cff19ec88d82b8e2014 Author: Krzysztof Kozlowski Date: Tue Apr 26 08:42:41 2022 +0200 dt-bindings: clock: qcom,gcc-apq8064: Fix typo in compatible and split apq8084 The qcom,gcc-apq8064.yaml was meant to describe only APQ8064 and APQ8084 should have slightly different bindings (without Qualcomm thermal sensor device). Add new bindings for APQ8084. Fixes: a469bf89a009 ("dt-bindings: clock: simplify qcom,gcc-apq8064 Documentation") Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426064241.6379-1-krzysztof.kozlowski@linaro.org commit 11a3f3dc2cf8d6127aae6183a69dcf3dde026305 Author: Bhupesh Sharma Date: Sun Apr 24 01:20:03 2022 +0530 arm64: dts: qcom: sa8155p-adp: Disable multiple Tx and Rx queues for ethernet IP Fix the issues seen with ethernet traffic getting stalled on SA8155p-ADP board with default (or larger) mtu size of 1500 bytes, by disabling multiple Tx and Rx queues for the stmmac IP block. With the single queue setup, the ethernet traffic is stable, wget / curl can work well on the board and no ethernet stall is observed even when longer netperf / iperf3 test are run. Also a performance of ~940 Mbits/sec is observed on the 1G link, so there is no observable degradation in performance as well. Fixes: c5cb42cc8411 ("arm64: dts: qcom: sa8155p-adp: Enable ethernet node") Cc: Bjorn Andersson Cc: Vinod Koul Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423195003.353150-1-bhupesh.sharma@linaro.org commit 9583009097c8933a30110097d373a09624cb8c37 Author: Bhupesh Sharma Date: Sat Apr 23 02:36:11 2022 +0530 arm64: dts: qcom: sm8150: Fix iommu sid value for SDC2 controller Fix the IOMMU sid value for SDC2 controller, to ensure that no ADMA error is observed when the microSD card is detected on the SA8155p-ADP board. Fixes: 876644c76034 ("arm64: dts: qcom: sm8150: Add support for SDC2") Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422210611.173842-1-bhupesh.sharma@linaro.org commit 28e3dc8f8cd37eedc14e97e80a7a2e33359491df Author: Tom Rix Date: Fri Apr 22 13:38:06 2022 -0400 soc: qcom: pdr: use static for servreg_* variables Sparse reports this repesentative issue pdr_internal.h:31:22: warning: symbol 'servreg_location_entry_ei' was not declared. Should it be static? Similar for other servreg_* Global variables should not be defined in header files. This only works because pdr_internal.h is only included by pdr_interface.c. Single file use variables should be static so add static to their storage-class specifiers. Signed-off-by: Tom Rix Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422173806.21982-1-trix@redhat.com commit 9bc72e47d4630d58a840a66a869c56b29554cfe4 Author: Peng Wu Date: Thu Apr 28 10:43:06 2022 +0000 ARM: hisi: Add missing of_node_put after of_find_compatible_node of_find_compatible_node will increment the refcount of the returned device_node. Calling of_node_put() to avoid the refcount leak Signed-off-by: Peng Wu Signed-off-by: Wei Xu commit fb4f07cc93995ebad7725512c0edc903c693037f Author: Luca Weiss Date: Sat Apr 23 17:50:56 2022 +0200 remoteproc: qcom: pas: Add MSM8226 ADSP support Add a config for the ADSP present on MSM8226. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423155059.660387-2-luca@z3ntu.xyz commit b51431850f5bf456a1887b4bdfd3813c75641c56 Author: Luca Weiss Date: Sat Apr 23 17:50:55 2022 +0200 dt-bindings: remoteproc: qcom: pas: Add MSM8226 adsp Add the compatible for the adsp found in MSM8226. Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423155059.660387-1-luca@z3ntu.xyz commit 949dfdcf343c1646d26ee0ef320d6b2a4a39af28 Merge: 10b4a11fe70f2 38acb6260f60a Author: Jakub Kicinski Date: Thu May 5 19:00:19 2022 -0700 Merge branch 'mptcp-improve-mptcp-level-window-tracking' Mat Martineau says: ==================== mptcp: Improve MPTCP-level window tracking This series improves MPTCP receive window compliance with RFC 8684 and helps increase throughput on high-speed links. Note that patch 3 makes a change in tcp_output.c For the details, Paolo says: I've been chasing bad/unstable performance with multiple subflows on very high speed links. It looks like the root cause is due to the current mptcp-level congestion window handling. There are apparently a few different sub-issues: - the rcv_wnd is not effectively shared on the tx side, as each subflow takes in account only the value received by the underlaying TCP connection. This is addressed in patch 1/5 - The mptcp-level offered wnd right edge is currently allowed to shrink. Reading section 3.3.4.: """ The receive window is relative to the DATA_ACK. As in TCP, a receiver MUST NOT shrink the right edge of the receive window (i.e., DATA_ACK + receive window). The receiver will use the data sequence number to tell if a packet should be accepted at the connection level. """ I read the above as we need to reflect window right-edge tracking on the wire, see patch 4/5. - The offered window right edge tracking can happen concurrently on multiple subflows, but there is no mutex protection. We need an additional atomic operation - still patch 4/5 This series additionally bumps a few new MIBs to track all the above (ensure/observe that the suspected races actually take place). I could not access again the host where the issue was so noticeable, still in the current setup the tput changes from [6-18] Gbps to 19Gbps very stable. ==================== Link: https://lore.kernel.org/r/20220504215408.349318-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 38acb6260f60a7698c3a24db4df6ec1cf8f14c60 Author: Paolo Abeni Date: Wed May 4 14:54:08 2022 -0700 mptcp: add more offered MIBs counter Track the exceptional handling of MPTCP-level offered window with a few more counters for observability. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit f3589be0c420a3137e5902d15705ced6a36f3f43 Author: Paolo Abeni Date: Wed May 4 14:54:07 2022 -0700 mptcp: never shrink offered window As per RFC, the offered MPTCP-level window should never shrink. While we currently track the right edge, we don't enforce the above constraint on the wire. Additionally, concurrent xmit on different subflows can end-up in erroneous right edge update. Address the above explicitly updating the announced window and protecting the update with an additional atomic operation (sic) Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit ea66758c1795cef81dc59cd5240e9d0f5c5207cf Author: Paolo Abeni Date: Wed May 4 14:54:06 2022 -0700 tcp: allow MPTCP to update the announced window The MPTCP RFC requires that the MPTCP-level receive window's right edge never moves backward. Currently the MPTCP code enforces such constraint while tracking the right edge, but it does not reflects it on the wire, as MPTCP lacks a suitable hook to update accordingly the TCP header. This change modifies the existing mptcp_write_options() hook, providing the current packet's TCP header to the MPTCP protocol, so that the next patch could implement the above mentioned constraint. No functional changes intended. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 92be2f522777b775a2d83b00c3690732c1243dfc Author: Paolo Abeni Date: Wed May 4 14:54:05 2022 -0700 mptcp: add mib for xmit window sharing Bump a counter for counter when snd_wnd is shared among subflow, for observability's sake. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit b713d0067574e15cddd08ee7f25acd535b7437cf Author: Paolo Abeni Date: Wed May 4 14:54:04 2022 -0700 mptcp: really share subflow snd_wnd As per RFC, mptcp subflows use a "shared" snd_wnd: the effective window is the maximum among the current values received on all subflows. Without such feature a data transfer using multiple subflows could block. Window sharing is currently implemented in the RX side: __tcp_select_window uses the mptcp-level receive buffer to compute the announced window. That is not enough: the TCP stack will stick to the window size received on the given subflow; we need to propagate the msk window value on each subflow at xmit time. Change the packet scheduler to ignore the subflow level window and use instead the msk level one Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 10b4a11fe70f295426fb4ebbb8b20370885c3806 Author: Andy Shevchenko Date: Wed May 4 12:14:07 2022 +0300 firmware: tee_bnxt: Use UUID API for exporting the UUID There is export_uuid() function which exports uuid_t to the u8 array. Use it instead of open coding variant. This allows to hide the uuid_t internals. Signed-off-by: Andy Shevchenko Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220504091407.70661-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jakub Kicinski commit c67b627e99affe4865b13557d68152ad4c35515c Author: David Ahern Date: Wed May 4 10:09:47 2022 -0700 net: Make msg_zerocopy_alloc static msg_zerocopy_alloc is only used by msg_zerocopy_realloc; remove the export and make static in skbuff.c Signed-off-by: David Ahern Acked-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220504170947.18773-1-dsahern@kernel.org Signed-off-by: Jakub Kicinski commit 9396ed850f2e0ea286de372968987157aeeca617 Author: Jens Axboe Date: Thu Apr 28 13:36:50 2022 -0600 io_uring: kill io_recv_buffer_select() wrapper It's just a thin wrapper around io_buffer_select(), get rid of it. Signed-off-by: Jens Axboe commit 0a352aaa9473006f6bc5b0b2d707827d1c1afe80 Author: Jens Axboe Date: Sat Apr 30 15:22:44 2022 -0600 io_uring: use 'sr' vs 'req->sr_msg' consistently For all of send/sendmsg and recv/recvmsg we have the local 'sr' variable, yet some cases still use req->sr_msg which sr points to. Use 'sr' consistently. Signed-off-by: Jens Axboe commit 0455d4ccec548b0fb51db39a4d3350a7a80a0222 Author: Jens Axboe Date: Tue Apr 26 12:11:33 2022 -0600 io_uring: add POLL_FIRST support for send/sendmsg and recv/recvmsg If IORING_RECVSEND_POLL_FIRST is set for recv/recvmsg or send/sendmsg, then we arm poll first rather than attempt a receive or send upfront. This can be useful if we expect there to be no data (or space) available for the request, as we can then avoid wasting time on the initial issue attempt. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 73911426aaaadbae54fa72359b33a7b6a56947db Author: Jens Axboe Date: Tue Apr 26 11:34:56 2022 -0600 io_uring: check IOPOLL/ioprio support upfront Don't punt this check to the op prep handlers, add the support to io_op_defs and we can check them while setting up the request. This reduces the text size by 500 bytes on aarch64, and makes this less fragile by having the check in one spot and needing opcodes to opt in to IOPOLL or ioprio support. Reviewed-by: Hao Xu Signed-off-by: Jens Axboe commit 8d602e1a132e91eb7bc1a2cbe96019371eb8da64 Author: Jakub Kicinski Date: Wed May 4 09:37:25 2022 -0700 net: move snowflake callers to netif_napi_add_tx_weight() Make the drivers with custom tx napi weight call netif_napi_add_tx_weight(). Reviewed-by: Xuan Zhuo Link: https://lore.kernel.org/r/20220504163725.550782-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 16d083e28f1a4f6deef82be92d6a0f5aa2fe7e08 Author: Jakub Kicinski Date: Wed May 4 09:37:24 2022 -0700 net: switch to netif_napi_add_tx() Switch net callers to the new API not requiring the NAPI_POLL_WEIGHT argument. Acked-by: Florian Fainelli Reviewed-by: Alex Elder Acked-by: Mat Martineau Acked-by: Alexandra Winter Link: https://lore.kernel.org/r/20220504163725.550782-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fd49f8e61cd3a62251838e47507ee6a423e88214 Author: Jakub Kicinski Date: Wed May 4 09:39:39 2022 -0700 jme: remove an unnecessary indirection Remove a define which looks like a OS abstraction layer and makes spatch conversions on this driver problematic. Link: https://lore.kernel.org/r/20220504163939.551231-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 6bff3ffcf6eed522cfc302e2d934b9a875d20cd2 Author: Christophe Leroy Date: Wed May 4 13:32:17 2022 +0200 net: ethernet: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h includes some headers that it doesn't need itself. In order to clean powerpc's asm/prom.h up in a further step, first clean all files that include asm/prom.h Some files don't need asm/prom.h at all. For those ones, just remove inclusion of asm/prom.h Some files don't need any of the items provided by asm/prom.h, but need some of the headers included by asm/prom.h. For those ones, add the needed headers that are brought by asm/prom.h at the moment and remove asm/prom.h Some files really need asm/prom.h but also need some of the headers included by asm/prom.h. For those one, leave asm/prom.h but also add the needed headers so that they can be removed from asm/prom.h in a later step. Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/09a13d592d628de95d30943e59b2170af5b48110.1651663857.git.christophe.leroy@csgroup.eu Signed-off-by: Jakub Kicinski commit d9ccf770c7c5e5e92ee2189fcddf39e348bb0028 Author: Christophe Leroy Date: Wed May 4 13:16:09 2022 +0200 sungem: Prepare cleanup of powerpc's asm/prom.h powerpc's includes some headers that it doesn't need itself. In order to clean powerpc's up in a further step, first clean all files that include sungem_phy.c doesn't use any object provided by . But removing inclusion of leads to the following errors: CC drivers/net/sungem_phy.o drivers/net/sungem_phy.c: In function 'bcm5421_init': drivers/net/sungem_phy.c:448:42: error: implicit declaration of function 'of_get_parent'; did you mean 'dget_parent'? [-Werror=implicit-function-declaration] 448 | struct device_node *np = of_get_parent(phy->platform_data); | ^~~~~~~~~~~~~ | dget_parent drivers/net/sungem_phy.c:448:42: warning: initialization of 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion] drivers/net/sungem_phy.c:450:35: error: implicit declaration of function 'of_get_property' [-Werror=implicit-function-declaration] 450 | if (np == NULL || of_get_property(np, "no-autolowpower", NULL)) | ^~~~~~~~~~~~~~~ Remove from included headers but add to handle the above. Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/f7a7fab3ec5edf803d934fca04df22631c2b449d.1651662885.git.christophe.leroy@csgroup.eu Signed-off-by: Jakub Kicinski commit 1f86123b97491cc2b5071d7f9933f0e91890c976 Author: Eyal Birger Date: Wed May 4 12:54:59 2022 +0300 net: align SO_RCVMARK required privileges with SO_MARK The commit referenced in the "Fixes" tag added the SO_RCVMARK socket option for receiving the skb mark in the ancillary data. Since this is a new capability, and exposes admin configured details regarding the underlying network setup to sockets, let's align the needed capabilities with those of SO_MARK. Fixes: 6fd1d51cfa25 ("net: SO_RCVMARK socket option for SO_MARK with recvmsg()") Signed-off-by: Eyal Birger Link: https://lore.kernel.org/r/20220504095459.2663513-1-eyal.birger@gmail.com Signed-off-by: Jakub Kicinski commit c4a67a21a6d255ddcbaa076c0412aad73c7e0c02 Author: Jakub Kicinski Date: Wed May 4 08:40:37 2022 -0700 Revert "Merge branch 'mlxsw-line-card-model'" This reverts commit 5e927a9f4b9f29d78a7c7d66ea717bb5c8bbad8e, reversing changes made to cfc1d91a7d78cf9de25b043d81efcc16966d55b3. The discussion is still ongoing so let's remove the uAPI until the discussion settles. Link: https://lore.kernel.org/all/20220425090021.32e9a98f@kernel.org/ Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220504154037.539442-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fa2024c315135d8319001363f1e456dcd0d9b51e Author: Stanislav Jakubek Date: Wed May 4 19:55:02 2022 +0200 dt-bindings: timer: Convert rda,8810pl-timer to YAML Convert RDA Micro Timer bindings to DT schema format. Signed-off-by: Stanislav Jakubek Reviewed-by: Krzysztof Kozlowski Reviewed-by: Manivannan Sadhasivam Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220504175502.GA2573@standask-GA-A55M-S2HP commit 398c42e2c46c88b186ec29097a05b7a8d93b7ce5 Author: Mimi Zohar Date: Wed Nov 24 10:56:33 2021 -0500 ima: support fs-verity file digest based version 3 signatures IMA may verify a file's integrity against a "good" value stored in the 'security.ima' xattr or as an appended signature, based on policy. When the "good value" is stored in the xattr, the xattr may contain a file hash or signature. In either case, the "good" value is preceded by a header. The first byte of the xattr header indicates the type of data - hash, signature - stored in the xattr. To support storing fs-verity signatures in the 'security.ima' xattr requires further differentiating the fs-verity signature from the existing IMA signature. In addition the signatures stored in 'security.ima' xattr, need to be disambiguated. Instead of directly signing the fs-verity digest, a new signature format version 3 is defined as the hash of the ima_file_id structure, which identifies the type of signature and the digest. The IMA policy defines "which" files are to be measured, verified, and/or audited. For those files being verified, the policy rules indicate "how" the file should be verified. For example to require a file be signed, the appraise policy rule must include the 'appraise_type' option. appraise_type:= [imasig] | [imasig|modsig] | [sigv3] where 'imasig' is the original or signature format v2 (default), where 'modsig' is an appended signature, where 'sigv3' is the signature format v3. The policy rule must also indicate the type of digest, if not the IMA default, by first specifying the digest type: digest_type:= [verity] The following policy rule requires fsverity signatures. The rule may be constrained, for example based on a fsuuid or LSM label. appraise func=BPRM_CHECK digest_type=verity appraise_type=sigv3 Acked-by: Stefan Berger Signed-off-by: Mimi Zohar commit 4edadf6dcb54d2a86eeb424f27122dc0076d9267 Author: Mike Snitzer Date: Sun Apr 17 13:00:15 2022 -0400 dm: improve abnormal bio processing Read/write/flush are the most common operations, optimize switch in is_abnormal_io() for those cases. Follows same pattern established in block perf-wip commit ("block: optimise blk_may_split for normal rw") Also, push is_abnormal_io() check and blk_queue_split() down from dm_submit_bio() to dm_split_and_process_bio() and set new 'is_abnormal_io' flag in clone_info. Optimize __split_and_process_bio and __process_abnormal_io by leveraging ci.is_abnormal_io flag. Signed-off-by: Mike Snitzer commit 9d20653fe84ebd772c3af71808e6a727603e0b71 Author: Mike Snitzer Date: Fri Apr 15 20:08:23 2022 -0400 dm: simplify bio-based IO accounting further Now that io splitting is recorded prior to, or during, ->map IO accounting can happen immediately rather than defer until after bio splitting in dm_split_and_process_bio(). Remove the DM_IO_START_ACCT flag and also remove dm_io's map_task member because there is no longer any need to wait for splitting to occur before accounting. Also move dm_io struct's 'flags' member to consolidate struct holes. Signed-off-by: Mike Snitzer commit ec211631ae24b1e700354f48c05fab5b3c617d83 Author: Ming Lei Date: Tue Apr 12 16:56:16 2022 +0800 dm: put all polled dm_io instances into a single list Now that bio_split() isn't used by DM's bio splitting, it is a bit overkill to link dm_io into an hlist given there is only single dm_io in the list. Convert to using a single list for holding all dm_io instances associated with this bio. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit 0f14d60a023cc4fe68758e0fcdc0ce82a82dde7d Author: Ming Lei Date: Tue Apr 12 16:56:15 2022 +0800 dm: improve dm_io reference counting Currently each dm_io's reference counter is grabbed before calling __map_bio(), this way isn't efficient since we can move this grabbing to initialization time inside alloc_io(). Meantime it becomes typical async io reference counter model: one is for submission side, the other is for completion side, and the io won't be completed until both sides are done. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit 2e803cd99ba8b7a84be155c1d5ee28d363fdbe44 Author: Ming Lei Date: Tue Apr 12 16:56:14 2022 +0800 dm: don't grab target io reference in dm_zone_map_bio dm_zone_map_bio() is only called from __map_bio in which the io's reference is grabbed already, and the reference won't be released until the bio is submitted, so not necessary to do it dm_zone_map_bio any more. Reviewed-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit 7dd76d1feec70a23e1de2b55c0c2a9c592fa8423 Author: Ming Lei Date: Tue Apr 12 16:56:13 2022 +0800 dm: improve bio splitting and associated IO accounting The current DM code (ab)uses late assignment of dm_io->orig_bio (after __map_bio() returns and any bio splitting is complete) to indicate the FS bio has been processed and can be accounted. This results in awkward waiting until ->orig_bio is set in dm_submit_bio_remap(). Also the bio splitting was implemented using bio_split()+bio_chain() -- a well-worn pattern but it requires bio cloning purely for the benefit of more natural IO accounting. The bio_split() result was stored in ->orig_bio to represent the mapped part of the original FS bio. DM has switched to the bdev based IO accounting interface. DM's IO accounting can be implemented in terms of the original FS bio (now stored early in ->orig_bio) via access to its sectors/bio_op. And if/when splitting is needed, set a new DM_IO_WAS_SPLIT flag and use new dm_io fields of .sector_offset & .sectors to allow IO accounting for split bios _without_ needing to clone a new bio to store in ->orig_bio. Signed-off-by: Ming Lei Co-developed-by: Mike Snitzer Signed-off-by: Mike Snitzer commit d3de6d12694de45dfb4d7821d09224ed43dde3d7 Author: Ming Lei Date: Tue Apr 12 16:56:12 2022 +0800 dm: switch to bdev based IO accounting interfaces DM splits flush with data into empty flush followed by bio with data payload, switch dm_io_acct() to use bdev_{start,end}_io_acct() to do this accoiunting more naturally (rather than temporarily changing the bio's bi_size). This will allow DM to more easily account bios that are split (in following commit). Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit e6926ad0c988d4cf8d4f4ec77373572831149104 Author: Ming Lei Date: Tue Apr 12 16:56:11 2022 +0800 dm: pass dm_io instance to dm_io_acct directly All the other 4 parameters are retrieved from the 'dm_io' instance, so it's not necessary to pass all four to dm_io_acct(). Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit b992b40dfcc1d904e5040c34c5edde3bbc83f60b Author: Ming Lei Date: Tue Apr 12 16:56:10 2022 +0800 dm: don't pass bio to __dm_start_io_acct and dm_end_io_acct dm->orig_bio is always passed to __dm_start_io_acct and dm_end_io_acct, so it isn't necessary to take one bio parameter for the two helpers. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer commit bdb34759a0dbc89c134c60d282b5f100bed1365f Author: Mike Snitzer Date: Fri Apr 15 03:04:59 2022 -0400 dm: use bio_sectors in dm_aceept_partial_bio Rename 'bi_size' to 'bio_sectors' given bi_size is being stored in sectors. Also, use bio_sectors() rather than open-coding it. Signed-off-by: Mike Snitzer commit e86f2b005a51437d2887eec5ee659d0287d370ad Author: Mike Snitzer Date: Wed Mar 30 13:52:10 2022 -0400 dm: simplify basic targets Remove needless factoring and remap bi_sector regardless of bio_sectors() being non-zero. Signed-off-by: Mike Snitzer commit 442761fd2b297d65d1cb5786249e1e07a19e9122 Author: Mike Snitzer Date: Sat Mar 26 14:14:00 2022 -0400 dm: conditionally enable branching for less used features Use jump_labels to further reduce cost of unlikely branches for zoned block devices, dm-stats and swap_bios throttling. Signed-off-by: Mike Snitzer commit 563a225c9fd207326c2a2af9d59b4097cb31ce70 Author: Mike Snitzer Date: Sat Mar 26 21:08:36 2022 -0400 dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio If a bio is marked REQ_NOWAIT optimize dm_submit_bio()'s dm_table RCU usage to dm_{get,put}_live_table_fast. DM core offers protection against blocking (via suspend) if REQ_NOWAIT. Signed-off-by: Mike Snitzer commit 982b48ae25d9aabd69c1f012a94f63766181f0b2 Author: Mike Snitzer Date: Sat Mar 26 14:38:07 2022 -0400 dm: move hot dm_io members to same cacheline as dm_target_io Just saves some cacheline bouncing for members accessed during cloned bio submission and completion. Signed-off-by: Mike Snitzer commit 6cbce280fc741c2057d574366318eafbeabbcfda Author: Mike Snitzer Date: Sat Mar 26 13:46:06 2022 -0400 dm: add local variables to clone_endio and __map_bio Avoid redundant dereferences in both functions. Signed-off-by: Mike Snitzer commit fe221db4192cf6c5f6b0be59e09025b05418e226 Author: Mike Snitzer Date: Fri Mar 25 17:20:45 2022 -0400 dm: mark various branches unlikely Signed-off-by: Mike Snitzer commit 3b03f7c1242c754f0c474b37eec7d79107b9f375 Author: Mike Snitzer Date: Fri Mar 25 14:12:47 2022 -0400 dm: simplify dm_start_io_acct Pull common DM_IO_ACCOUNTED check out to beginning of dm_start_io_acct. Also, use dm_tio_is_normal (and move it to dm-core.h). Signed-off-by: Mike Snitzer commit 4857abf66434d96dec1a9209bbfbf55e2ee359fa Author: Mike Snitzer Date: Fri Mar 25 13:53:23 2022 -0400 dm: simplify dm_io access in dm_split_and_process_bio Use local variable instead of redudant access using ci.io Signed-off-by: Mike Snitzer commit 84b98f4ce4d1d1f811d3e0658ec76c0349d8023a Author: Mike Snitzer Date: Thu Mar 17 13:52:06 2022 -0400 dm: factor out dm_io_set_error and __dm_io_dec_pending Also eliminate need to use errno_to_blk_status(). Signed-off-by: Mike Snitzer commit cfc97abcbe0b1ffac441202fe330e697370ecbcc Author: Mike Snitzer Date: Thu Mar 24 14:36:47 2022 -0400 dm: conditionally enable BIOSET_PERCPU_CACHE for dm_io bioset A bioset's per-cpu alloc cache may have broader utility in the future but for now constrain it to being tightly coupled to QUEUE_FLAG_POLL. Also change dm_io_complete() to use bio_clear_polled() so that it properly clears all associated bio state on requeue. This commit improves DM's hipri bio polling (REQ_POLLED) perf by 7 - 20% depending on the system. Signed-off-by: Mike Snitzer commit e41f7a5521d7f03dca99e3207633df71740569dd Author: Martin Kaiser Date: Mon May 2 22:06:52 2022 +0200 staging: r8188eu: remove unused IEEE_* defines The IEEE_* defines in the driver's ieee80211.h header file are not used. Remove them. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 64c62b697f76121aa7c25b580b02fe91f82319c0 Author: Martin Kaiser Date: Mon May 2 22:06:51 2022 +0200 staging: r8188eu: use standard category defines Replace some of the driver-specific defines for action categories with the defines from ieee80211.h. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 87f4820238bbc8869c5a450fe9a08ef77c0ab6ec Author: Martin Kaiser Date: Mon May 2 22:06:50 2022 +0200 staging: r8188eu: use ieee80211_mgmt for action category Use the struct ieee80211_mgmt from ieee80211.h to read the action category. There's no need to parse the incoming frame ourselves. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 11d2e7de0d8a4b706872f6e79679c32dcb3c0393 Author: Martin Kaiser Date: Mon May 2 22:06:49 2022 +0200 staging: r8188eu: replace OnAction_tbl with switch-case OnAction_tbl has only three entries. It's simpler to use a switch statement instead of iterating over the table. We can then remove the table itself and struct action_handler, which was used only for the table entries. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 42e00fbbbab049591682d7de3071f713215bd799 Author: Martin Kaiser Date: Mon May 2 22:06:48 2022 +0200 staging: r8188eu: remove an unused category define RTW_WLAN_CATEGORY_TDLS is not used. Remove the define. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d0c9872117e944fb314d0c71d9d25c17c3ed3b38 Author: Martin Kaiser Date: Mon May 2 22:06:47 2022 +0200 staging: r8188eu: remove action_handler string Remove the unused str component from struct action_handler and the corresponding entries in OnAction_tbl. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 639880ea94c84c817392e452a15b474e6c227800 Author: Martin Kaiser Date: Mon May 2 22:06:46 2022 +0200 staging: r8188eu: remove unused action handler prototypes For some action categories, we removed the handler function, but we forgot the prototypes. Remove them as well. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit efba1df56f84ade6b654530839078023a3a09c0d Author: Martin Kaiser Date: Mon May 2 22:06:45 2022 +0200 staging: r8188eu: action category wmm is not used The r8188eu driver does not handle the wmm action category. Remove the empty handler function, the entry in OnAction_tbl and the define for the category. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d2dbac0c1b1637d951041dbd60feb0a4c7d23d27 Author: Martin Kaiser Date: Mon May 2 22:06:44 2022 +0200 staging: r8188eu: action category ht is not used The r8188eu driver does not handle the ht action category. Remove the empty handler function, the entry in OnAction_tbl and the define for the category. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220502200652.143665-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 60a16985171c4e53e98facf40dfe035f7e34fc83 Author: Philipp Hortmann Date: Sun May 1 22:25:41 2022 +0200 staging: vt6655: Replace unused return value of vt6655_get_current_tsf Replace unused return value with u64 to increase readability, reduce address and dereference operators and omit pqwCurrTSF that uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/62c83d78627196ec0ce2f5a562cb080a1c87a05a.1651435890.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fed5b53385f313bf7a6efa9649bf20a12eead833 Author: Philipp Hortmann Date: Sun May 1 22:25:35 2022 +0200 staging: vt6655: Rename function CARDbGetCurrentTSF The name of the function uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2b92db8d67e8dd1fc85b45efe3b32d2199371190.1651435890.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 889d18950aee72dc7b0397a75209a9e75ee1decd Author: Philipp Hortmann Date: Sun May 1 21:12:29 2022 +0200 staging: vt6655: Added missing BE support in CARDbGetCurrentTSF Added missing big-endian support in CARDbGetCurrentTSF. Reported-by: David Laight Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/25c80e3eb889ef2e530f26b4a97a9f5fe88e01ab.1651431640.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 79ffde57deb8e3ca64cc4465bfa5d40dbb8e87e1 Author: Philipp Hortmann Date: Sun May 1 21:12:23 2022 +0200 staging: vt6655: Replace VNSvInPortD with ioread32 Replace macro VNSvInPortD with ioread32 and as it was the only user, it can now be removed. The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl Reported-by: kernel test robot Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3945d32053898e5f9771d6f742ae118ca56943ce.1651431640.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 72b901c1aaa3ba1f8bdd55625e689e48ad1f85e3 Author: Charlie Sands Date: Sat Apr 30 00:28:59 2022 -0400 staging: r8188eu: Remove broken rtw_p2p_get function. Removes broken and unsafe rtw_p2p_get function and all of the code associated with it from the r8188eu driver. Signed-off-by: Charlie Sands Link: https://lore.kernel.org/r/Ymy7C/A2q+VzfBhO@sckzor-linux.localdomain Signed-off-by: Greg Kroah-Hartman commit 3136dc602950d4c294bd82991b4eca4b626c87f3 Author: Vihas Makwana Date: Wed Apr 27 22:27:49 2022 +0530 staging: r8188eu: drop redundant check in _rtw_free_mlme_priv There's a NULL check on pmlmepriv in rtw_mlme.c:112 which makes no sense as rtw_free_mlme_priv_ie_data() dereferences it unconditionally and it would have already crashed at this point. Remove this redundant check. Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220427165748.10584-1-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 921f9c587013b5b216d9d3802cd3456b11c86524 Author: Jaehee Park Date: Wed Apr 27 11:32:03 2022 -0400 staging: r8188eu: remove unused else condition rtw_select_and_join_from_scanned_queue() cannot return '2' so this else condition is unused. Remove this unnecessary else statement. Suggested-by: Pavel Skripkin Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/20220427153203.GA503502@jaehee-ThinkPad-X1-Extreme Signed-off-by: Greg Kroah-Hartman commit fbfa3c632746c3cc6cd3d1b01be5e850ed090029 Author: Vihas Makwana Date: Thu Apr 28 00:30:54 2022 +0530 staging: r8188eu: remove unused semaphore "allrxreturnevt" The semaphore allrxreturnevt of struct recv_priv is initialized but not used anywhere in the code. Remove the initialization and the structure member. Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220427190054.17841-1-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3a9aaf047a37eb5e30218ff979ddba373b48e0e8 Author: Nickalas Cason Date: Sat Apr 30 19:01:39 2022 -0400 staging: greybus: correct typo in comment Correct misspelling in comment. Issue found with checkpatch. Signed-off-by: Nickalas Cason Link: https://lore.kernel.org/r/20220430230139.7i772mvejlhevamn@desktop Signed-off-by: Greg Kroah-Hartman commit 039510e80193ebd01cd035448b1aaf0e0fbd935a Author: Andy Shevchenko Date: Wed May 4 12:29:15 2022 +0300 staging: vc04_services: Re-use generic struct s32_fract Instead of custom data type re-use generic struct s32_fract. No changes intended. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220504092915.72021-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit db8725718ae565f002bc7a9f721629c98e90b8a2 Author: Kenneth Feng Date: Tue Apr 19 14:51:36 2022 +0800 drm/amd/pm: pp_dpm_sclk change for smu_v13_0_7 fetch the average gfxclk according to pmfw for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e575aa69e1dc3d849876905e10dbdb4de10575eb Author: Kenneth Feng Date: Mon Apr 18 16:03:17 2022 +0800 drm/amd/pm: enable gfx pcc and soc cg on smu_v13_0_7 enable gfx pcc and soc cg on smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7620443d8f72894558791f07e5c03806a17d257e Author: Kenneth Feng Date: Mon Apr 18 14:39:02 2022 +0800 drm/amd/pm: enable gfx ds for smu_v13_0_7 enable gfx ds for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 27e3911c40f23730514900a6a47af1ab61665ac5 Author: Kenneth Feng Date: Fri Apr 15 11:16:41 2022 -0400 drm/amd/soc21: enable mmhub and athub power gating add the pg_flag for athub and mmhub pg. Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit fd32ce21f0af061b15d443e88e60124b37d607d9 Author: Kenneth Feng Date: Fri Apr 15 11:16:03 2022 -0400 drm/amd/pm: add the pg_flag for athub and mmhub pg on smu_v13_0_7 add the pg_flag for athub and mmhub pg on smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 9c1a7354e27ec4efbabac4f706a664763bbfd6a2 Author: Kenneth Feng Date: Fri Apr 15 11:59:16 2022 -0400 drm/amd/pm: port the fan interface to smu_v13_0_7 port the fan interface to smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 3929f3381e9cc61f73070377825b62667243bfb4 Author: Kenneth Feng Date: Tue Apr 12 17:07:24 2022 +0800 drm/amd/pm: enable pp_dpm_vclk/dclk interface for smu_v13_0_7 enable pp_dpm_vclk/dclk interface for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 59a08e133b6c04532400faf5a53ee19b747c9986 Author: Kenneth Feng Date: Fri Apr 15 11:58:02 2022 -0400 drm/amd/pm:add UMD Pstate clock settings for smu_v13_0_7 add UMD Pstate clock settings for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 2492d40d6ff2043682316b26c1c6436c9023de8f Author: Kenneth Feng Date: Fri Apr 15 11:56:47 2022 -0400 drm/amd/pm: pp_dpm_* interface for smu_v13_0_7 add the sysfs pp_dpm_* interface for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit 1be51ec93ecadf099b387240c6de3e01b6103d32 Author: Kenneth Feng Date: Fri Apr 8 17:33:45 2022 +0800 drm/amd/pm: update the features for smu_v13_0_7 Enable socclk ds, dstate, mp0clk ds, mpioclk ds, gfxclk ss, memory temperature reading, athub and mmhub pg. Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f88fe2037292aeb98fd7f406549c3544578758f7 Author: Kenneth Feng Date: Thu Apr 7 16:42:45 2022 +0800 drm/amd/pm: add SCPM support in smu v13_0_7 port the SCPM change from smu_v13_0_0 to smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bae456dd18cbb5d823788685fa12f14a2e02b2d4 Author: Kenneth Feng Date: Fri Apr 1 11:28:44 2022 +0800 drm/amd/pm: enable platform features for smu_v13_0_7 enable throttler, AC/DC, VR hot, FW CTF, fan control for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Wang Yang Signed-off-by: Alex Deucher commit 37d0fd44cc0c052b23db9d115fe055767c301556 Author: Kenneth Feng Date: Thu Mar 31 20:20:05 2022 +0800 drm/amd/pm: enable fclk,vcn ds and df cstate for smu_v13_0_7 enable fclk ds, vcn ds and df cstate for smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7ab0cd71d715dd658f09c739b5b46c6d3875a321 Author: Kenneth Feng Date: Thu Mar 31 16:37:01 2022 +0800 drm/amd/pm: enable mp0,vcn,dcn dpm on smu_v13_0_7 enable mp0 dpm, vcn dpm, dcn dpm on smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit bae3fcdeff4a215305ca7972b7dcb7494c42f578 Author: Kenneth Feng Date: Thu Mar 31 15:22:46 2022 +0800 drm/amd/pm: enable link dpm and link ds on smu_v13_0_7 enable link clock dpm and link clock deep sleep on smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher commit a3b49ee0c30ff2b37696a41c7ea9b50136618191 Author: Kenneth Feng Date: Thu Mar 31 14:45:38 2022 +0800 drm/amd/pm: add mvdd and vddio scaling in smu_v13_0_7 add mvdd and vddio scaling in smu_v13_0_7 to follow uclk dpm Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 712b91827da466072a1558685cc791bac9f7f3b8 Author: Kenneth Feng Date: Thu Mar 31 12:43:45 2022 +0800 drm/amd/pm: add features to smu_v13_0_7 add prefetcher, socclk dpm, fclk dpm, uclk dpm to smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 44426f6cfac92e586db6f933b7bc156382067790 Author: Kenneth Feng Date: Mon Mar 7 14:29:43 2022 +0800 drm/amd/pm: support power on/off vcn/jpeg in smu v13_0_7 add power on/off vcn&jpeg callbacks in smu_v13_0_7 Signed-off-by: Kenneth Feng Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 061ca5f52a7687364de714b3ecf10a4a182fdedc Author: Likun Gao Date: Tue Mar 1 17:22:14 2022 +0800 drm/amd/pm: add get enable mask function for smu v13_0_7 Add get_enabled_mask interface for smu v13_0_7. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 113cc31dde66e3153f7290141b6c008dce8ab2bf Author: Chengming Gui Date: Mon Feb 21 15:42:00 2022 +0800 drm/amd/pm: add SMU_13_0_7 ppt_funcs for SMU_13_0_7 Add initial support for SMU 13.0.7. V2: unify ppt name, fix copyright format, add missing break (Kenneth/Evan) V3: Split PMFW headers as separate patch (Alex) Signed-off-by: Chengming Gui Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 0c2a2d1c811fc1a695e8f88bf530fefc8d1e65f8 Author: Chengming Gui Date: Fri Apr 15 10:36:19 2022 -0400 drm/amdgpu/swsmu: add smu 13.0.7 firmware Declare smu 13.0.7 firmware. Reviewed-by: Hawking Zhang Signed-off-by: Chengming Gui Signed-off-by: Alex Deucher commit bb4a9c15b2eb6d29ec0feca8219e32b7cc816e26 Author: Chengming Gui Date: Wed Feb 23 09:23:20 2022 +0800 drm/amd/pm: add SMU_13_0_7 PMFW headers Add driver_if/ppsmc/pptable head files. Signed-off-by: Chengming Gui Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 9503a944e723a8e81ab6f6181070d1194060a78f Author: Likun Gao Date: Mon Feb 14 14:46:41 2022 +0800 drm/amdgpu: enable cgcg and cgls for GC 11_0_2 Enable GFX CGCG and CGLS for GFX v11_0_2. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 30ca5b2b6b7ea5053e7dfd09de72088f60aa433c Author: Flora Cui Date: Fri Apr 15 10:27:31 2022 -0400 drm/amdgpu/discovery: set family for GC 11.0.2 Set AMDGPU_FAMILY_GC_11_0_0. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit af6958492a0f197cae279839fcb7f1cf1f0c73e1 Author: Flora Cui Date: Fri Apr 15 10:24:36 2022 -0400 drm/amdgpu/discovery: add gfx11 support for GC 11.0.2 Enable gfx11 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 84f567073795b7650a2770785ebadac38dcf6eaf Author: Likun Gao Date: Sun Feb 27 14:30:18 2022 +0800 drm/amdgpu: update rlc ram for gc v11_0_2 Add imu rlc ram register settings for gc v11_0_2 Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ec661f1ca421991e41c3568963f56862ebf15b8a Author: Eric Huang Date: Tue Feb 8 15:22:05 2022 -0500 drm/amdkfd: add asic support for GC 11.0.2 Changes are inherited from GC 11.0.0. Signed-off-by: Eric Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1366018e01a2c72c3540be7cbc30832785f3424a Author: Flora Cui Date: Fri Apr 15 10:15:09 2022 -0400 drm/amdgpu: add initial GC 11.0.2 support Add initial support for GC 11.0.2 to gfx_v11_0.c. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 621e87875c448b23e66fe1f8549f3aef326dab8e Author: Flora Cui Date: Sat Apr 2 15:31:37 2022 +0800 drm/amdgpu: add gc v11_0_2 imu firmware add gc v11_0_2 imu firmware Signed-off-by: Flora Cui Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 215a65f5d11892312c80de80fc95b3e3cd7bcf98 Author: Flora Cui Date: Fri Apr 15 10:26:28 2022 -0400 drm/amdgpu/discovery: add mes11 support for GC 11.0.2 Enable Micro Engine Scheduler support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 32697fea3afc03091b9c550c4de738bb7113004d Author: Flora Cui Date: Fri Apr 15 10:13:43 2022 -0400 drm/amdgpu: add mes 11 firmware for mes 11.0.2 Define firmware for MES 11.0.2. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 63b170806bd8f62d15cb86e1a532185aacfd3a96 Author: Flora Cui Date: Fri Apr 15 10:25:29 2022 -0400 drm/amdgpu/discovery: add sdma6 support for SDMA 6.0.2 Enable sdma6 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 22dd871e2b24dafd7d1026604ad39610ab110121 Author: Eric Huang Date: Tue Feb 8 15:35:31 2022 -0500 drm/amdkfd: add asic support for SDMA 6.0.2 It is inherited from SDMA 6.0.0. Signed-off-by: Eric Huang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c233f3fac77929f9d059ff50ab95f0e56f49a53c Author: Flora Cui Date: Fri Apr 15 10:12:16 2022 -0400 drm/amdgpu: add sdma 6.0.2 firware support define sdma 6.0.2 firmware. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 3a65fbc0a3207a05a31f6cb3b1bb614b26261343 Author: James Zhu Date: Fri Feb 11 08:17:25 2022 -0500 drm/amdgpu/discovery: enable vcn/jpeg v4_0_4 Enable vcn/jpeg 4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit f963052b55e6e60d4fc8f783860c8418759038fb Author: Sonny Jiang Date: Tue Feb 22 16:24:10 2022 -0500 drm/amdgpu: Enable vcn v4_0_4 sram enable vcn v4_0_4 sram Signed-off-by: Sonny Jiang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit ec9db74e1a4534cf8a88385656baeed00d069f64 Author: James Zhu Date: Wed Jan 5 20:39:49 2022 -0500 drm/amdgpu/vcn: enable VCN DPG mode for VCN4_0_4 Enable VCN DPG mode for VCN4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 143a34a0ac51726233767a42ee4359f2fa90a07b Author: James Zhu Date: Wed Jan 5 20:39:06 2022 -0500 drm/amdgpu/vcn: enable VCN PG for VCN4_0_4 Enable VCN PG for VCN4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 7ece9314a4d3fd0ee1989f1eaf1ba65f83558d1f Author: James Zhu Date: Wed Jan 5 20:38:04 2022 -0500 drm/amdgpu/vcn: enable VCN CG for VCN4_0_4 Enable VCN CG for VCN4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit ebac66a3283689c0f58dce023108ba71968eb161 Author: James Zhu Date: Fri Apr 15 11:50:10 2022 -0400 drm/amdgpu/jpeg: enable JPEG PG for VCN4_0_4 Enable JPEG PG for VCN4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 71dae221432cbf2dbd77325c90b9abecccb7b29c Author: James Zhu Date: Wed Jan 5 20:36:08 2022 -0500 drm/amdgpu/jpeg: enable JPEG CG for VCN4_0_4 Enable JPEG CG for VCN4_0_4. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit fbd23b55983720ccc235e6ca341d38eb81cf876d Author: James Zhu Date: Wed Jan 5 20:27:49 2022 -0500 drm/amdgpu: add VCN4_0_4 firmware Add VCN4_0_4 firmware. Signed-off-by: James Zhu Reviewed-by: Sonny Jiang Signed-off-by: Alex Deucher commit 5681e8009de60a81848ce5119ff6bd07b44f43c0 Author: Chengming Gui Date: Fri Apr 15 10:34:51 2022 -0400 drm/amdgpu/discovery: add psp13 support for PSP 13.0.7 Enable psp 13 support. Reviewed-by: Hawking Zhang Signed-off-by: Chengming Gui Signed-off-by: Alex Deucher commit 438a937d9a700b4ca0d199163f14a8c43b2c783c Author: Chengming Gui Date: Fri Apr 15 10:37:37 2022 -0400 drm/amdgpu/psp13: add support for MP0 13.0.7 Enable support in psp code. Reviewed-by: Hawking Zhang Signed-off-by: Chengming Gui Signed-off-by: Alex Deucher commit eee5ed424183e9dbbfc8a0269ad0e925dfb3f37f Author: Flora Cui Date: Fri Apr 15 10:20:54 2022 -0400 drm/amdgpu/discovery: add gmc11 support for GC 11.0.2 Enable gmc11 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit f2754bf7e02bec8a6c147dfe7070dff07f40d4a9 Author: Flora Cui Date: Fri Apr 15 10:18:35 2022 -0400 drm/amdgpu: add GMC11 support for GC 11.0.2 Add initial support for GC 11.0.2. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 89ae779b496cf8a9ab009a8003a7ef8a12ca9f2d Author: Flora Cui Date: Fri Apr 15 10:17:23 2022 -0400 drm/amdgpu: add UMC 8.11.0 support Add initial support for UMC 8.11.0. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit f40fc1916ce8243c48cdfcdb97ba51a012c78af9 Author: Hawking Zhang Date: Mon Feb 7 00:55:03 2022 +0800 drm/amdgpu: split mmhub v3_0_2 callbacks from mmhub v3_0 So we don't need to add ip version check in every callback when there is atc related programming that is only available in mmhub v3_0 Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 9fa57397d933a83f5fafc2e3bd4ab3626bf9aed9 Author: Hawking Zhang Date: Wed Apr 6 18:28:53 2022 +0800 drm/amdgpu: add mmhub v3_0_2 ip callback functions Unlike mmhub v3_0_0, there is no atc_l2 related registers available in mmhub v3_0_2. Split the mmhub v3_0_2 callback implementations from mmhub v3_0 so we don't need to add ip version check when atc related programming needs to be added to mmhub v3_0_0. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit fd1e77d915bcbd65a5ee667b94b73628f77c818e Author: Hawking Zhang Date: Mon Feb 7 00:34:00 2022 +0800 drm/amdgpu: add mmhub v3_0_2 ip headers Add mmhub v3_0_2 register offset and shift masks v2: update to latest headers Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 86140844dc5f50b68df9d99ff342565cdefe1c85 Author: Chengming Gui Date: Thu Feb 10 09:04:56 2022 +0800 drm/amdgpu/discovery: add SMUIO_13_0_8 func support Add SMUIO funcs for SMUIO_13_0_8. Signed-off-by: Chengming Gui Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8742f5f1c450fda02f6deb89aa054dd8bbd2d152 Author: Flora Cui Date: Fri Apr 15 10:29:42 2022 -0400 drm/amdgpu/discovery: add hdp6 support for HDP 6.0.1 Enable Host Data Path support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 4dad9d633864f8bdac9cfc850f0ec1a04ec69a35 Author: Flora Cui Date: Fri Apr 15 10:28:37 2022 -0400 drm/amdgpu/discovery: add nbio 4.3 support for NBIO 4.3.1 Enable nbio 4.3 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 1db7b3aa99c0a8173ad716b0531ae4cad8b404dc Author: Flora Cui Date: Fri Apr 15 10:23:20 2022 -0400 drm/amdgpu/discovery: add smu13 support for MP1 13.0.7 Enable System Management Unit support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 1f9261863ac4eb4335df090f4f2f3f5ff355ed69 Author: Flora Cui Date: Fri Apr 15 10:21:52 2022 -0400 drm/amdgpu/discovery: add ih6 support for IH 6.0.2 Enable Interrupt Handler v6 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 446af531f51a8a0f777fe450d809dbe5abb9ed50 Author: Flora Cui Date: Fri Apr 15 10:10:42 2022 -0400 drm/amdgpu: add support for ATHUB 3.0.2 Add support 3.0.2 to the ATHUB 3.0 code. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 0effe4a08641949dfe023c01c3d9e724b0737365 Author: Flora Cui Date: Fri Apr 15 10:19:56 2022 -0400 drm/amdgpu/discovery: add soc21 support for GC 11.0.2 Enable soc21 common soc support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit 92fd2153149fcb23ad6bda97aec025c0a5bad7cf Author: Flora Cui Date: Fri Apr 15 10:09:00 2022 -0400 drm/amdgpu: add soc21 support for GC 11.0.2 Add initial soc21 support. Reviewed-by: Hawking Zhang Signed-off-by: Flora Cui Signed-off-by: Alex Deucher commit d386f64588aad1058f6a0f97abeddfcae753bf14 Author: Evan Quan Date: Fri Apr 15 17:06:45 2022 +0800 drm/amdgpu: enable clock gating for HDP 6.0 Enable HDP 6.0 clock gating. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2013906955f49cbb927642a995640f8bc83c30db Author: Evan Quan Date: Fri Apr 15 15:55:04 2022 +0800 drm/amdgpu: enable clock gating for IH 6.0 Enable IH 6.0 clock gating. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7ccf6eb00337824cdd10b0544630e5df847e6da9 Author: Evan Quan Date: Fri Apr 15 15:44:27 2022 +0800 drm/amdgpu: enable MGCG and LS for MMHUB 3.0 Enable MMHUB 3.0 MGCG and LS features. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c649ed054ad7d2ffe4d4ae175e7b1420fb59fc06 Author: Evan Quan Date: Fri Apr 15 14:38:02 2022 +0800 drm/amdgpu: enable MGCG and LS for ATHUB 3.0 Enable ATHUB 3.0 MGCG and LS features. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ea26ad7f0fdf775c5cbaae616ddeaeb2eae5d016 Author: Evan Quan Date: Tue Apr 19 10:21:59 2022 +0800 drm/amd/pm: enable more dpm features to pair with PMFW 78.31.0 Enables the support for DCN DPM and DCFCLK DS features. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 914b30874c506be52d227dde0b15fede6f1a91d7 Author: Evan Quan Date: Wed Apr 13 15:54:50 2022 +0800 drm/amd/pm: enable gfx ulv feature control for SMU 13.0.0 Fulfill the interface for gfx ulv control. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit a5ffbfa0901bd30aff177b72a70fd2d727f5593b Author: Evan Quan Date: Wed Apr 13 15:32:44 2022 +0800 drm/amd/pm: enable deep sleep features control for SMU 13.0.0 Fulfill the interface for deep sleep features control. Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 9f3f1b03faffc978d4884134369b691f7e41682a Author: Evan Quan Date: Tue Apr 12 11:20:08 2022 +0800 drm/amd/pm: support more DPM features for SMU 13.0.0 To pair with 78.30.0 PMFW, support more dpm features: - UCLK DPM (disabled temporarily) - VMEMP Scaling (disabled temporarily) - VDDIO Scaling (disabled temporarily) - GFXCLK DS - SOCCLK DS - MPCLK Deep Sleep on VDD_SOC - MPCLK Deep Sleep on VDD_BACO - Memory Temperature Reading (disabled temporarily) Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 915b5ce774b5d59f90f970f97a7295f12cf898bc Author: Evan Quan Date: Mon Apr 11 14:39:59 2022 +0800 drm/amdgpu: enable more GFX clockgating features for GC 11.0.0 Support more GFX clockgating features(3D_CGCG, 3D_CGLS, MGCG, FGCG and PERF_CLK). Signed-off-by: Evan Quan Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 04491df50234936ded5159b58c86d28036d97136 Author: Evan Quan Date: Thu Apr 7 20:41:23 2022 +0800 drm/amd/pm: enable df cstate feature for SMU 13.0.0 As the feature is ready with 78.29.0 PMFW. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit bb70ac580c7a35418f4325c751672fcd5fb455bc Author: Evan Quan Date: Wed Apr 6 17:40:09 2022 +0800 drm/amd/pm: enable PMLOG support for SMU 13.0.0 Fulfill the interface for setting PMLOG DramAddr on SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 08960aca883e3f90004b9800674ebae27bb58416 Author: Evan Quan Date: Fri Apr 1 15:52:12 2022 +0800 drm/amd/pm: enable ppfeature mask setting for SMU 13.0.0 Fulfill the interfaces for retrieving and setting ppfeature masks on SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 93661c1d6c6bccf9a4ee42394a841f8f7f1bf48f Author: Evan Quan Date: Fri Apr 1 11:40:00 2022 +0800 drm/amd/pm: enable RunDcBtc support for SMU 13.0.0 Fulfill the RunDcBtc for SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 619b15a2556c1b3d9d0d365757957f88bfeac511 Author: Evan Quan Date: Fri Apr 1 10:49:33 2022 +0800 drm/amd/pm: enable power profile setting for SMU 13.0.0 Fulfill the interfaces for retrieving and setting power profile mode on SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b538995d8d43098b7c3e787960108c40bee53003 Author: Evan Quan Date: Fri Apr 1 10:02:28 2022 +0800 drm/amd/pm: enable ac/dc switching for SMU 13.0.0 Fulfill the ->set_power_source interface which notifies PMFW the current system power source(AC/DC). Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit fcd1ac96ccec4e761fd840a26f8b523df74d1d91 Author: Evan Quan Date: Thu Mar 31 17:50:13 2022 +0800 drm/amd/pm: enable power limit retrieving and setting for SMU 13.0.0 Fulfill the interfaces for retrieving and setting power limit on SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 38c1c73670bc5641208a6ab8c55ef2286f56f3a7 Author: Minghao Chi Date: Thu May 5 02:22:39 2022 +0000 drm/amdgpu: simplify the return expression of vega10_ih_hw_init() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Alex Deucher commit 3f92a7d8282334f50b35e4b6ade562157981fdf1 Author: Minghao Chi Date: Thu May 5 02:10:57 2022 +0000 drm/amdgpu: simplify the return expression Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Alex Deucher commit 0c1c5e4aaef8e3ca06aa0217a1773bd6f65d8e2a Author: Mike Lothian Date: Wed May 4 23:24:14 2022 +0100 drm/amdgpu/gfx11: Avoid uninitialised variable 'index' This stops clang complaining: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:376:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:433:30: note: uninitialized use occurs here amdgpu_device_wb_free(adev, index); ^~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:376:2: note: remove the 'if' if its condition is always false if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:364:16: note: initialize the variable 'index' to silence this warning unsigned index; ^ = 0 Signed-off-by: Mike Lothian Signed-off-by: Alex Deucher commit 8fab8e2ecc7df1cb42c80af40e7b6069debef451 Author: Mike Lothian Date: Wed May 4 23:24:13 2022 +0100 drm/amdgpu/gfx10: Avoid uninitialised variable 'index' This stops clang complaining: drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3846:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3903:30: note: uninitialized use occurs here amdgpu_device_wb_free(adev, index); ^~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3846:2: note: remove the 'if' if its condition is always false if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3839:16: note: initialize the variable 'index' to silence this warning unsigned index; ^ = 0 Signed-off-by: Mike Lothian Signed-off-by: Alex Deucher commit 0a8c5ec66a26cc0a6b0b7e760e5bf66872877541 Author: Mike Lothian Date: Wed May 4 17:50:09 2022 +0100 drm/amdgpu/gfx11: Add missing break This stops clang complaining: drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:5895:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] default: ^ drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:5895:2: note: insert 'break;' to avoid fall-through default: ^ break; Signed-off-by: Mike Lothian Signed-off-by: Alex Deucher commit 26817fb7b066b21c66cd41d75ed2137e046045be Author: Alex Deucher Date: Wed May 4 09:27:10 2022 -0400 Revert "fbdev: fbmem: add a helper to determine if an aperture is used by a fw fb" This reverts commit 9a45ac2320d0a6ae01880a30d4b86025fce4061b. This was added a helper for amdgpu to workaround a runtime pm regression caused by a runtime pm fix in efifb. We now have a better workaround in amdgpu in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays attached (v3)") so this workaround is no longer necessary. Since amdgpu was the only user of this interface, we can remove it. Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter Signed-off-by: Alex Deucher commit 5a90c24ad0283434f60ed2e1a628c9e6134d1fdc Author: Alex Deucher Date: Wed May 4 09:23:28 2022 -0400 Revert "drm/amdgpu: disable runpm if we are the primary adapter" This reverts commit b95dc06af3e683d6b7ddbbae178b2b2a21ee8b2b. This workaround is no longer necessary. We have a better workaround in commit f95af4a9236695 ("drm/amdgpu: don't runtime suspend if there are displays attached (v3)"). Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter Signed-off-by: Alex Deucher commit 4419da5d5d4b1788568b7bf22c083ba2832891df Author: Shanker Donthineni Date: Thu Apr 28 14:38:58 2022 +0530 tty: hvc: dcc: Bind driver to CPU core0 for reads and writes Some external debuggers do not handle reads/writes from/to DCC on secondary cores. Each core has its own DCC device registers, so when a core reads or writes from/to DCC, it only accesses its own DCC device. Since kernel code can run on any core, every time the kernel wants to write to the console, it might write to a different DCC. In SMP mode, external debugger creates multiple windows, and each window shows the DCC output only from that core's DCC. The result is that console output is either lost or scattered across windows. Selecting this debug option will enable code that serializes all console input and output to core 0. The DCC driver will create input and output FIFOs that all cores will use. Reads and writes from/to DCC are handled by a workqueue that runs only core 0. This is a debug feature to be used only in early stage development where debug serial console support would not be present. It disables PM feature like CPU hotplug and is not suitable for production environment. Signed-off-by: Shanker Donthineni Acked-by: Adam Wallis Signed-off-by: Timur Tabi Signed-off-by: Elliot Berman Signed-off-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20220428090858.14489-1-quic_saipraka@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 6808b7f5c8255d07d79cb8eac40047f59e4154ad Author: Ilpo Järvinen Date: Wed May 4 10:20:46 2022 +0300 termbits: Convert octal defines to hex Many archs have termbits.h as octal numbers. It makes hard for humans to parse the magnitude of large numbers correctly and to compare with hex ones of the same define. Convert octal values to hex. First step is an automated conversion with: for i in $(git ls-files | grep 'termbits\.h'); do awk --non-decimal-data '/^#define\s+[A-Z][A-Z0-9]*\s+0[0-9]/ { l=int(((length($3) - 1) * 3 + 3) / 4); repl = sprintf("0x%0" l "x", $3); print gensub(/[^[:blank:]]+/, repl, 3); next} {print}' $i > $i~; mv $i~ $i; done On top of that, some manual processing on alignment and number of zeros. In addition, small tweaks to formatting of a few comments on the same lines. Signed-off-by: Ilpo Järvinen Acked-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Link: https://lore.kernel.org/r/2c8c96f-a12f-aadc-18ac-34c1d371929c@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 240754894c30e3b13ca91113f177dd7f315eb297 Author: Jiri Slaby Date: Tue May 3 10:08:08 2022 +0200 serial: pch: inline pop_tx() into handle_tx() Given pop_tx() is a simple loop, inline it directly into handle_tx(). The code in handle_tx() looks much saner and straightforward now. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 80219e59ff503f2ba7d87b9fda40c69e5ff71546 Author: Jiri Slaby Date: Tue May 3 10:08:07 2022 +0200 serial: pch: simplify pop_tx() even more 1) take uart_tx_stopped into account every loop (the same as other uart drivers) 2) no need for 'count' variable, operate on 'size' directly This allows inlining this into handle_tx() nicely in the next patch. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 862526523e71a96e11ae48e081c424fdb1b50011 Author: Jiri Slaby Date: Tue May 3 10:08:06 2022 +0200 serial: pch: remove xmit circ_buf size double check One is in handle_tx() (as "min(xmit->head - xmit->tail, fifo_size))", another one in pop_tx() (as uart_circ_empty(xmit)). So keep only the latter. This makes the code simpler and size variable is not needed now. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9bc995f51d7828bec9b7432f0034b6e31cefb851 Author: Jiri Slaby Date: Tue May 3 10:08:05 2022 +0200 serial: pch: remove debug print from pop_tx It makes the code overly complicated for no good reason. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit fcfb1c3982b9c80d62c94aba2107acd4cb00cc5f Author: Jiri Slaby Date: Tue May 3 10:08:04 2022 +0200 serial: pch: decomission pch_uart_hal_write() It's horrid and if we inline it into callers, we can get rid of a lot of sugar around. So: * x_char handling becomes a single iowrite8. * xmit->buf handling is a single loop simply writing characters one by one directly from the buf instead of complex cnt_to_end computations. Until the buf is empty or fifo size is reached. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d9f3af4fbb1d955bbaf872d9e76502f6e3e803cb Author: Jiri Slaby Date: Tue May 3 10:08:03 2022 +0200 serial: pch: don't overwrite xmit->buf[0] by x_char When x_char is to be sent, the TX path overwrites whatever is in the circular buffer at offset 0 with x_char and sends it using pch_uart_hal_write(). I don't understand how this was supposed to work if xmit->buf[0] already contained some character. It must have been lost. Remove this whole pop_tx_x() concept and do the work directly in the callers. (Without printing anything using dev_dbg().) Cc: Fixes: 3c6a483275f4 (Serial: EG20T: add PCH_UART driver) Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080808.28332-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 6c1f77c3781a893cabe04b560a63b0524fe458f3 Author: Jiri Slaby Date: Tue May 3 10:06:07 2022 +0200 serial: pch: move size check from pop_tx one level up 'count' is zero in the pop_tx()'s comparison against 'size'. So the 'if' tries to find out if 'size' is negative or zero and returns in that case. But it cannot be negative, due to previous (size < 0) check in the caller: handle_tx(). So simply move this check from pop_tx() to handle_tx(). Now it's clear that pop_tx() is called only if fifo_size is non-zero. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503080613.27601-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 10b1964630fdbb07a9446da334b8f2e9538c5b0c Merge: caf10a34aa72b c270a59bc4d75 Author: Arnd Bergmann Date: Thu May 5 22:40:48 2022 +0200 Merge tag 'arm-soc/for-5.19/maintainers' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains Broadcom updates to the MAINTAINERS file for 5.19, please pull the following: - Stefan adds the raspberrypi keyword to the BCM2835 section to avoid missing patches - Joe updates the various entries where the Broadcom internal mailing list is mentioned to make it a reviewer entry - William updates the MAINTAINERS file to include the BCMBCA SoC entry * tag 'arm-soc/for-5.19/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Add Broadcom BCMBCA entry MAINTAINERS: Broadcom internal lists aren't maintainers MAINTAINERS: add raspberrypi to BCM2835 architecture Signed-off-by: Arnd Bergmann commit dfb9afb6c0e7af7c381c88d72d6d9c64268c160f Author: Jiri Slaby Date: Tue May 3 08:31:22 2022 +0200 serial: pic32: restore disabled irqs in pic32_uart_startup() pic32_uart_startup() disables interrupts by local_irq_save(). But the function never enables them. The serial core only holds a mutex, so irqs are not restored. So how could this driver work? This irq handling was already present in the driver's initial commit 157b9394709ed (serial: pic32_uart: Add PIC32 UART driver). So is it a candidate for removal? Anyone has a contact to the author: Andrei Pistirica (I believe the one below -- @microchip.com -- will bounce)? Or to someone else @microchip.com? Cc: Andrei Pistirica Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-12-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit fe36fa18ca77ca3ca9f90aab6cf39031416e432b Author: Jiri Slaby Date: Tue May 3 08:31:21 2022 +0200 serial: pic32: free up irq names correctly struct pic32_sport contains built-up names for irqs. These are freed only in error path of pic32_uart_startup(). And even there, the freeing happens before free_irq(). So fix this by: * moving frees after free_irq(), and * add frees to pic32_uart_shutdown() -- the opposite of pic32_uart_startup(). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 28dc563339b181461494918d5d155e3ebc9a87ec Author: Jiri Slaby Date: Tue May 3 08:31:20 2022 +0200 serial: pic32: don't zero members of kzalloc-ated structure struct pic32_sport (sport) has just been kzallocated. So there is no need to zero its member (sport->port) now. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0ed55be47c99cb156f96ad95649760d474d9c56c Author: Jiri Slaby Date: Tue May 3 08:31:19 2022 +0200 serial: pic32: don't assign pic32_sport::cts_gpio twice sport->cts_gpio is first assigned -EINVAL and few lines below using of_get_named_gpio(). Remove the first (useless) assignment. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 412314720aec9226e7e423395d27ca17d5dd3b24 Author: Jiri Slaby Date: Tue May 3 08:31:18 2022 +0200 serial: pic32: convert to_pic32_sport() to an inline 'c' is not in wrapped in parentheses in the to_pic32_sport() macro, so it might be problematic wrt macro expansion. Using an inline is always safer in these cases. Both type-wise and macro-expansion-wise. So switch the macro to an inline. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 343f23cfc22b1d1577289db694f6896d1ac26594 Author: Jiri Slaby Date: Tue May 3 08:31:17 2022 +0200 serial: pic32: remove pic32_get_port() macro It's just &sport->port. First, sport was not in parenthesis, so macro expansion could be an issue. Second, it's so simple, that we can expand the macro and make the code really straightforward. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e8616bd0e9f24a9265fe5db1e7963185514b445a Author: Jiri Slaby Date: Tue May 3 08:31:16 2022 +0200 serial: pic32: simplify pic32_sport::enable_tx_irq handling Make it a bool, so use true+false. And remove the wrap-around macro -- i.e. access the member directly. It makes the code more obvious. BTW the macro did not have 'sport' in parentheses, so it was potentially problematic wrt expansion. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit bb2cff419d3253aac12e7513be2b0fd7ee11ad78 Author: Jiri Slaby Date: Tue May 3 08:31:15 2022 +0200 serial: pic32: simplify clk handling struct pic32_sport::ref_clk is only set, but not read. That means we can remove it. And when we do so, pic32_enable_clock() and pic32_disable_clock() are simple wrappers around clk_prepare_enable() and clk_disable_unprepare() respectively. So we can remove the former two from the code and replace it by the latter two. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 08f643e0224222aa089265a72690187898cac3e7 Author: Jiri Slaby Date: Tue May 3 08:31:14 2022 +0200 serial: pic32: remove constants from struct pic32_sport All the irqflags_* in struct pic32_sport are set to IRQF_NO_THREAD and never updated. So remove pic32_sport::irqflags_* and use the flag directly. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 29574d0ded40f1834f4a4a054d213fdc0642d60a Author: Jiri Slaby Date: Tue May 3 08:31:13 2022 +0200 serial: pic32: move header content to .c There is no point keeping the header content separated. So move the content to the appropriate source file. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5c83ffd90bc078d6f585190dc9740584bfcad1e7 Author: Jiri Slaby Date: Tue May 3 08:31:12 2022 +0200 serial: pic32: remove unused items from the header struct pic32_console_opt and its support are unused in pic32. So remove all that. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220503063122.20957-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d7c76716169ddc37cf6316ff381d34ea807fbfd7 Author: Marek Vasut Date: Sat Apr 30 18:28:45 2022 +0200 serial: stm32: Use TC interrupt to deassert GPIO RTS in RS485 mode In case the RS485 mode is emulated using GPIO RTS, use the TC interrupt to deassert the GPIO RTS, otherwise the GPIO RTS stays asserted after a transmission ended and the RS485 cannot work. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Erwan Le Ray Cc: Greg Kroah-Hartman Cc: Jean Philippe Romain Cc: Valentin Caron Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-serial@vger.kernel.org Link: https://lore.kernel.org/r/20220430162845.244655-2-marex@denx.de Signed-off-by: Greg Kroah-Hartman commit 3bcea529b295a993b1b05db63f245ae8030c5acf Author: Marek Vasut Date: Sat Apr 30 18:28:44 2022 +0200 serial: stm32: Factor out GPIO RTS toggling into separate function Pull out the GPIO RTS enable and disable handling into separate function. Limit the scope of GPIO RTS toggling only to GPIO emulated RS485 too. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Erwan Le Ray Cc: Greg Kroah-Hartman Cc: Jean Philippe Romain Cc: Valentin Caron Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-serial@vger.kernel.org Link: https://lore.kernel.org/r/20220430162845.244655-1-marex@denx.de Signed-off-by: Greg Kroah-Hartman commit 4487cd3e5f94b8cde264d5a73d6f4b5a50494646 Author: Maciej W. Rozycki Date: Fri Apr 29 21:40:26 2022 +0100 serial: sifive: Remove duplicate `clkin_rate' setting The `clkin_rate' member of `struct sifive_serial_port' now duplicates `uartclk' from nested `struct uart_port', so use `uartclk' throughout and remove `clkin_rate'. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204291656150.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 0a7ff843d507ce2cca2c3b7e169ee56e28133530 Author: Maciej W. Rozycki Date: Fri Apr 29 21:40:18 2022 +0100 serial: sifive: Report actual baud base rather than fixed 115200 The base baud value reported is supposed to be the highest baud rate that can be set for a serial port. The SiFive FU740-C000 SOC's on-chip UART supports baud rates of up to 1/16 of the input clock rate, which is the bus clock `tlclk'[1], often at 130MHz in the case of the HiFive Unmatched board. However the sifive UART driver reports a fixed value of 115200 instead: 10010000.serial: ttySIF0 at MMIO 0x10010000 (irq = 1, base_baud = 115200) is a SiFive UART v0 10011000.serial: ttySIF1 at MMIO 0x10011000 (irq = 2, base_baud = 115200) is a SiFive UART v0 even though we already support setting higher baud rates, e.g.: $ tty /dev/ttySIF1 $ stty speed 230400 The baud base value is computed by the serial core by dividing the UART clock recorded in `struct uart_port' by 16, which is also the minimum value of the clock divider supported, so correct the baud base value reported by setting the UART clock recorded to the input clock rate rather than 115200: 10010000.serial: ttySIF0 at MMIO 0x10010000 (irq = 1, base_baud = 8125000) is a SiFive UART v0 10011000.serial: ttySIF1 at MMIO 0x10011000 (irq = 2, base_baud = 8125000) is a SiFive UART v0 References: [1] "SiFive FU740-C000 Manual", v1p3, SiFive, Inc., August 13, 2021, Section 16.9 "Baud Rate Divisor Register (div)", pp.143-144 Signed-off-by: Maciej W. Rozycki Fixes: 1f1496a923b6 ("riscv: Fix sifive serial driver") Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204291656280.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 366f6c955d4d1a5125ffcd6875ead26a3c7a2a1c Author: Maciej W. Rozycki Date: Mon Apr 18 16:27:33 2022 +0100 serial: 8250: Add proper clock handling for OxSemi PCIe devices Oxford Semiconductor PCIe (Tornado) 950 serial port devices are driven by a fixed 62.5MHz clock input derived from the 100MHz PCI Express clock. We currently drive the device using its default oversampling rate of 16 and the clock prescaler disabled, consequently yielding the baud base of 3906250. This base is inadequate for some of the high-speed baud rates such as 460800bps, for which the closest rate possible can be obtained by dividing the baud base by 8, yielding the baud rate of 488281.25bps, which is off by 5.9638%. This is enough for data communication to break with the remote end talking actual 460800bps, where missed stop bits have been observed. We can do better however, by taking advantage of a reduced oversampling rate, which can be set to any integer value from 4 to 16 inclusive by programming the TCR register, and by using the clock prescaler, which can be set to any value from 1 to 63.875 in increments of 0.125 in the CPR/CPR2 register pair. The prescaler has to be explicitly enabled though by setting bit 7 in the MCR or otherwise it is bypassed (in the enhanced mode that we enable) as if the value of 1 was used. Make use of these features then as follows: - Set the baud base to 15625000, reflecting the minimum oversampling rate of 4 with the clock prescaler and divisor both set to 1. - Override the `set_mctrl' and set the MCR shadow there so as to have MCR[7] always set and have the 8250 core propagate these settings. - Override the `get_divisor' handler and determine a good combination of parameters by using a lookup table with predetermined value pairs of the oversampling rate and the clock prescaler and finding a pair that divides the input clock such that the quotient, when rounded to the nearest integer, deviates the least from the exact result. Calculate the clock divisor accordingly. Scale the resulting oversampling rate (only by powers of two) if possible so as to maximise it, reducing the divisor accordingly, and avoid a divisor overflow for very low baud rates by scaling the oversampling rate and/or the prescaler even if that causes some accuracy loss. Also handle the historic spd_cust feature so as to allow one to set all the three parameters manually to arbitrary values, by keeping the low 16 bits for the divisor and then putting TCR in bits 19:16 and CPR/CPR2 in bits 28:20, sanitising the bit pattern supplied such as to clamp CPR/CPR2 values between 0.000 and 0.875 inclusive to 33.875. This preserves compatibility with any existing setups, that is where requesting a custom divisor that only has any bits set among the low 16 the oversampling rate of 16 and the clock prescaler of 33.875 will be used as with the original 8250. Finally abuse the `frac' argument to store the determined bit patterns for the TCR, CPR and CPR2 registers. - Override the `set_divisor' handler so as to set the TCR, CPR and CPR2 registers from the `frac' value supplied. Set the divisor as usual. With the baud base set to 15625000 and the unsigned 16-bit UART_DIV_MAX limitation imposed by `serial8250_get_baud_rate' standard baud rates below 300bps become unavailable in the regular way, e.g. the rate of 200bps requires the baud base to be divided by 78125 and that is beyond the unsigned 16-bit range. The historic spd_cust feature can still be used to obtain such rates if so required. See Documentation/tty/device_drivers/oxsemi-tornado.rst for more details. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181519450.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit cb5a40e3143bc64437858b337273fd63cc42e9c2 Author: Maciej W. Rozycki Date: Mon Apr 18 16:27:27 2022 +0100 serial: 8250: Export ICR access helpers for internal use Make ICR access helpers available outside 8250_port.c, however retain them as ordinary static functions so as not to regress code generation. This is because `serial_icr_write' is currently automatically inlined by GCC, however `serial_icr_read' is not. Making them both static inline would grow code produced, e.g.: $ i386-linux-gnu-size --format=gnu 8250_port-{old,new}.o text data bss total filename 15065 3378 0 18443 8250_port-old.o 15289 3378 0 18667 8250_port-new.o and: $ riscv64-linux-gnu-size --format=gnu 8250_port-{old,new}.o text data bss total filename 16980 5306 0 22286 8250_port-old.o 17124 5306 0 22430 8250_port-new.o while making them external would needlessly add a new module interface and lose the benefit from `serial_icr_write' getting inlined outside 8250_port.o. Signed-off-by: Maciej W. Rozycki Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181517500.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 1f32c65bad24b9787d3e52843de375430e3df822 Author: Maciej W. Rozycki Date: Mon Apr 18 16:27:22 2022 +0100 serial: 8250: Fold EndRun device support into OxSemi Tornado code The EndRun PTP/1588 dual serial port device is based on the Oxford Semiconductor OXPCIe952 UART device with the PCI vendor:device ID set for EndRun Technologies and uses the same sequence to determine the number of ports available. Despite that we have duplicate code specific to the EndRun device. Remove redundant code then and factor out OxSemi Tornado device detection. Signed-off-by: Maciej W. Rozycki Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181516220.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 67f12fbe87b59d4021e41bb397f0309d538c6dac Author: Ilpo Järvinen Date: Wed May 4 10:28:51 2022 +0300 serial: men_z135_uart: Drop duplicated iotype assignment The driver assigns same iotype twice. Drop one of them. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/14b71e1-2396-3d83-3a97-9582765d453@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9ae081f47027d424dd00c75d2ad3e6e8461b06b4 Author: Geert Uytterhoeven Date: Mon May 2 14:37:06 2022 +0200 serial: 8250: pxa: Remove unneeded The 8250 PXA driver never used Runtime PM, so there was never a need to include . Fixes: ab28f51c77cd4618 ("serial: rewrite pxa2xx-uart to use 8250_core") Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/9fd96fba9bbbbdeb16af0dc07ae9dee21c8e297c.1651494971.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 174f86b879cefce1a34253cbde4ee17ce80f9525 Author: Geert Uytterhoeven Date: Mon May 2 14:37:05 2022 +0200 serial: 8250: core: Remove unneeded The last calls into Runtime PM were moved to 8250_port.c a long time ago. Fixes: b6830f6df8914faa ("serial: 8250: Split base port operations from universal driver") Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/2545eaa7fc552013a5d04c4df027255204e64834.1651494971.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit e6a08c6949cba95e261ce11cd4648ea3d96bd2f1 Author: Heikki Krogerus Date: Mon May 2 14:56:21 2022 +0300 serial: 8250: dw: Fix NULL pointer dereference dw8250_platform_data is only used on DT platforms for now. Fixes: 4a218b277fdb ("serial: 8250: dw: Create a generic platform data structure") Signed-off-by: Heikki Krogerus Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220502115621.77985-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f26c65dacfc2a9a0da07220972727de48534b646 Author: Geert Uytterhoeven Date: Mon May 2 15:34:58 2022 +0200 dt-bindings: serial: renesas,scif: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/c57ed00e85778380776330be6183c6861d843c22.1651497024.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit e4de48da57f337a0296f04885ca8b94ae61ca41a Author: Geert Uytterhoeven Date: Mon May 2 15:34:57 2022 +0200 dt-bindings: serial: renesas,hscif: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/dd734aaa4e5e0b32864b038b79eafe72907fb99f.1651497024.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 98bae89647603309ca2a5f172299ecc31c5d2db0 Author: Alex Deucher Date: Wed May 4 23:17:38 2022 -0400 drm/amdgpu/gfx11: remove some register fields that no longer exist Some copy paste leftovers for older asics. They were protected by __BIG_ENDIAN, so we didn't notice them initially. Reported-by: kernel test robot Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a2673d570bd648851e00ac531bdf695f4ebb4f78 Author: Michael Grzeschik Date: Thu Apr 21 23:14:25 2022 +0200 usb: gadget: uvc: track frames in format entries Just like the header is tracking the formats in a linked list, in this patch we track the frames in a linked list of the formats. It simplifies the parsing of the configfs structure. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220421211427.3400834-6-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e2fa7b36de90de26da11b7f37fe0ce16935ab8a8 Author: Michael Grzeschik Date: Thu Apr 21 23:14:24 2022 +0200 usb: gadget: uvc: move structs to common header The functions and structs of the configfs interface should also be used by the uvc gadget driver. This patch prepares the stack by moving the common structs and functions to the common header file. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220421211427.3400834-5-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a350cfb6537f94be8a6423bc68a7a7883263c306 Author: Michael Grzeschik Date: Thu Apr 21 23:14:23 2022 +0200 usb: gadget: uvc: prevent index variables to start from 0 Some configfs variables like bDefaultFrameIndex are always starting by 1. This patch adds a check to prevent setting those variables to 0. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220421211427.3400834-4-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 4a7ffc10d19555d75aefb686fd5d91509b3f6f01 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:23 2022 +0200 arm64: dts: qcom: align DWC3 USB interrupts with DT schema Align order of interrupts with Qualcomm DWC3 USB DT schema. No functional impact expected. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-14-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8d5fd4e4d4e3c128d5afa925bf98c98e66a5205b Author: Krzysztof Kozlowski Date: Wed May 4 15:19:22 2022 +0200 arm64: dts: qcom: align DWC3 USB clocks with DT schema Align order of clocks and their names with Qualcomm DWC3 USB DT schema. No functional impact expected. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-13-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit bbd25a8703ef11174252daf4ccb233c9aa2627f3 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:21 2022 +0200 arm64: dts: qcom: msm8996: add clock-names to DWC3 USB node The clock-names is a required property of DWC3 USB node. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-12-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 28c71c305de9335716c1488b588cf834ec29d3e2 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:20 2022 +0200 arm64: dts: qcom: qcs404: add dedicated qcom,qcs404-dwc3 compatible Add dedicated compatible for DWC3 USB node name to allow more accurate DT schema matching. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-11-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit f526072aacce0c75b71c20c0093f5ca90986eb80 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:19 2022 +0200 arm64: dts: qcom: sm6125: add dedicated qcom,sm6125-dwc3 compatible Add dedicated compatible for DWC3 USB node name to allow more accurate DT schema matching. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-10-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit b7f1528eba75005563b924fc7ad9d1d6cba75d19 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:18 2022 +0200 arm64: dts: qcom: msm8994: add dedicated qcom,msm8994-dwc3 compatible Add dedicated compatible for DWC3 USB node name to allow more accurate DT schema matching. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-9-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3a6b8bf18e88a4fef2c4e665bec7aa2d4d50fa6e Author: Krzysztof Kozlowski Date: Wed May 4 15:19:17 2022 +0200 arm64: dts: qcom: ipq8074: add dedicated qcom,ipq8074-dwc3 compatible Add dedicated compatible for DWC3 USB node name to allow more accurate DT schema matching. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-8-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit b77a1c4d6b058d801645a9f46030e7f8829628b2 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:16 2022 +0200 arm64: dts: qcom: correct DWC3 node names and unit addresses Align DWC3 USB node names with DT schema ("usb" is expected) and correct the unit addresses to match the "reg" property. This also implies overriding nodes by label, instead of full path. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504131923.214367-7-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 16946a60715c1043fa4b265334969778b9be9fee Author: Krzysztof Kozlowski Date: Wed May 4 15:19:14 2022 +0200 dt-bindings: usb: qcom,dwc3: fix clock matching The bindings defined strict clocks but several variants do not use them in such order. Split the clocks and clock-names per variants to match current DTS usage. In few cases this might not be complete match, due to incomplete DTS. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220504131923.214367-5-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit d5591aa079537942aeb6f6914e57e29389800f17 Author: Krzysztof Kozlowski Date: Wed May 4 15:19:13 2022 +0200 dt-bindings: usb: qcom,dwc3: add IPQ8074, MSM8994, QCS404 and SM6125 Add compatibles for dedicated USB DWC3 blocks on Qualcomm IPQ8074, MSM8994, QCS404 and SM6125. They differ against other variants in clock and/or interrupts. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220504131923.214367-4-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit f66eef8fb8989a7193cafc3870f7c7b2b97f16cb Author: Thinh Nguyen Date: Thu Apr 21 19:23:03 2022 -0700 usb: dwc3: gadget: Delay issuing End Transfer If the controller hasn't DMA'ed the Setup data from its fifo, it won't process the End Transfer command. Polling for the command completion may block the driver from servicing the Setup phase and cause a timeout. Previously we only check and delay issuing End Transfer in the case of endpoint dequeue. Let's do that for all End Transfer scenarios. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/2fcf3b5d90068d549589a57a27a79f76c6769b04.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit ace17b6ee4f92ab0375d12a1b42494f8590a96b6 Author: Thinh Nguyen Date: Thu Apr 21 19:22:57 2022 -0700 usb: dwc3: gadget: Only End Transfer for ep0 data phase The driver shouldn't be able to issue End Transfer to the control endpoint at anytime. Typically we should only do so in error cases such as invalid/unexpected direction of Data Phase as described in the control transfer flow of the programming guide. It _may_ end started data phase during controller deinitialization from soft disconnect or driver removal. However, that should not happen because the driver should be maintained in EP0_SETUP_PHASE during driver tear-down. On soft-connect, the controller should be reset from a soft-reset and there should be no issue starting the control endpoint. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/3c6643678863a26702e4115e9e19d7d94a30d49c.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit c96683798e272366866a5c0ce3073c0b5a256db7 Author: Thinh Nguyen Date: Thu Apr 21 19:22:50 2022 -0700 usb: dwc3: ep0: Don't prepare beyond Setup stage Since we can't guarantee that the host won't send new Setup packet before going through the device-initiated disconnect, don't prepare beyond the Setup stage and keep the device in EP0_SETUP_PHASE. This ensures that the device-initated disconnect sequence can go through gracefully. Note that the controller won't service the End Transfer command if it can't DMA out the Setup packet. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/6bacec56ecabb2c6e49a09cedfcac281fdc97de0.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 8f8034f493b5eb1ad21ff392fd30c0cf9e71f73f Author: Thinh Nguyen Date: Thu Apr 21 19:22:44 2022 -0700 usb: dwc3: gadget: Don't modify GEVNTCOUNT in pullup() If the GEVNTCOUNT indicates events in the event buffer, the driver needs to acknowledge them before the controller can halt. Simply let the interrupt handler acknowledges the remaining event generated by the controller while polling for DSTS.DEVCTLHLT. This avoids disabling irq and taking care of race condition between the interrupt handlers and pullup(). Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/ea306ec93c41ccafbdb5d16404ff3b6eca299613.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 861c010a2ee1bc4a66d23f0da4aa22e75d8eaa24 Author: Thinh Nguyen Date: Thu Apr 21 19:22:38 2022 -0700 usb: dwc3: gadget: Refactor pullup() Move soft-disconnect sequence out of dwc3_gadget_pullup(). No functional change here. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/4c0f259b17d95acaaa931f90276683a48a32fe22.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 69e131d1ac4e52a59ec181ab4f8aa8c48cd8fb64 Author: Thinh Nguyen Date: Thu Apr 21 19:22:31 2022 -0700 usb: dwc3: gadget: Prevent repeat pullup() Don't do soft-disconnect if it's previously done. Likewise, don't do soft-connect if the device is currently connected and running. It would break normal operation. Currently the caller of pullup() (udc's sysfs soft_connect) only checks if it had initiated disconnect to prevent repeating soft-disconnect. It doesn't check for soft-connect. To be safe, let's keep the check here regardless whether the udc core is fixed. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/1c1345bd66c97a9d32f77d63aaadd04b7b037143.1650593829.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit c8227d568ddf2f38a8806fdcd2e20b9e11747d9a Merge: 1c1ed5a48411e 68533eb1fb197 Author: Jakub Kicinski Date: Thu May 5 13:03:18 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net tools/testing/selftests/net/forwarding/Makefile f62c5acc800e ("selftests/net/forwarding: add missing tests to Makefile") 50fe062c806e ("selftests: forwarding: new test, verify host mdb entries") https://lore.kernel.org/all/20220502111539.0b7e4621@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit ca05b38252d7bf6b0d42e80b3d3d98a642f4143b Author: Piyush Mehta Date: Wed May 4 13:23:09 2022 +0530 usb: dwc3: xilinx: Add gpio-reset support This patch adds a USB GPIO based reset for dwc3-xilinx driver. The PHY needs to be reset after the completion of phy initialization. As part of the reset, check for gpio-reset binding before toggling the pin. This feature is advantageous when the user toggle GPIO to trigger the ULPI-PHY reset. Delay of milliseconds is added in between low and high to meet the setup and hold time requirement of the reset. The reset-gpio error handling is added for error notification. Some GPIO controllers must be accessed using message-based buses, like I2C or SPI, to address this problem, updates GPIO access with sleep API. This reset is specific to the zynqMp. Signed-off-by: Piyush Mehta Link: https://lore.kernel.org/r/20220504075309.6244-3-piyush.mehta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 1cda12b15d5035663e5a1d92e33d6443c285332c Author: Piyush Mehta Date: Wed May 4 13:23:08 2022 +0530 dt-bindings: usb: dwc3-xilinx: add optional property reset-gpios Added optional property support reset-gpios for the dwc3-Xilinx glue driver. Signed-off-by: Piyush Mehta Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504075309.6244-2-piyush.mehta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 78489569b7d775fcb4dba8822be6526761efe3ae Author: Rohit Agarwal Date: Mon May 2 14:36:33 2022 +0530 dt-bindings: usb: qcom,dwc3: Add binding for SDX65 Add devicetree binding for SDX65 USB controller based on Qcom designware IP. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1651482395-29443-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 29f84af6abb590411418e2c0f948a6bf557ec0ea Author: Krzysztof Kozlowski Date: Tue May 3 08:51:57 2022 +0200 dt-bindings: usb: da8xx-usb: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220503065201.51818-3-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3a538f8f0946053c0da6a13f73d4046cb7717e61 Author: Krzysztof Kozlowski Date: Tue May 3 08:51:56 2022 +0200 dt-bindings: usb: am33xx-usb: deprecate '#dma-channels' The generic property, used in most of the drivers and defined in generic dma-common DT bindings, is 'dma-channels'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20220503065201.51818-2-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4ea150889ad70dfae540e761c485b28bd1009486 Author: Kushagra Verma Date: Mon May 2 14:37:14 2022 +0530 usb: dwc3: remove a possible unnecessary 'out of memory' message This patch removes a possible unnecessary out of memory message from core.c as reported by checkpatch.pl: WARNING: Possible unnecessary 'out of memory' message Signed-off-by: Kushagra Verma Link: https://lore.kernel.org/r/SI2PR01MB392926A7AFB821410770D7CFF8C19@SI2PR01MB3929.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman commit 7fd069d65da2e20b1caec3b7bcf9dfbe28c04bb2 Author: Heikki Krogerus Date: Thu Apr 28 14:10:56 2022 +0300 usb: dwc3: host: Stop setting the ACPI companion It is no longer needed. The sysdev pointer is now used when assigning the ACPI companions to the xHCI ports and USB devices. Assigning the ACPI companion here resulted in the fwnode->secondary pointer to be replaced also for the parent dwc3 device since the primary fwnode (the ACPI companion) was shared. That was unintentional and it created potential side effects like resource leaks. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220428111056.3558-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f7ffaa6f62f6bca00f3e7b1cfe0cf1d1ab4306bb Author: Heikki Krogerus Date: Thu Apr 28 14:10:55 2022 +0300 usb: core: acpi: Use the sysdev pointer instead of controller device The controller device (hcd) does not always have the ACPI companion assigned to it at all. We can not rely on it when finding the ACPI companion for the root hub. Instead we need to use the sysdev pointer. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220428111056.3558-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9a922c042a63bc68a53da2bc5e5e4cccee58d9df Author: Fabien Parent Date: Tue Apr 26 15:40:59 2022 +0200 dt-bindings: usb: mediatek,mtu3: add binding for MT8195 SoC Add binding to support the mtu3 driver on the MT8195 SoC. Signed-off-by: Fabien Parent Acked-by: Krzysztof Kozlowski Reviewed-by: Macpaul Lin Link: https://lore.kernel.org/r/20220426134106.242353-2-fparent@baylibre.com Signed-off-by: Greg Kroah-Hartman commit 0cb46f8c7c72cb56badcf1f6b5f0ba1138a0f98c Author: Arnd Bergmann Date: Thu Apr 28 12:22:58 2022 +0200 usb: ehci-omap: drop unused ehci_read() function After moving the omap1 platform into generalized multiplatform support on ARM, the kernel test robot points out a W=1 warning that now shows up in more configurations: drivers/usb/host/ehci-omap.c:64:19: warning: unused function 'ehci_read' The function was last used 9 years ago and can just be removed. Fixes: 87425ad36330 ("USB: ehci-omap: Remove PHY reset handling code") Reported-by: kernel test robot Acked-by: Alan Stern Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220428102314.950323-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit d7c90d9f9a5b6a85c09d37c5616d880d849a0c8b Author: Colin Ian King Date: Wed May 4 14:58:40 2022 +0100 USB: gadget: Fix return of -EBUSY Currently when driver->match_existing_only is true, the error return is set to -EBUSY however ret is then set to 0 at the end of the if/else statement. I believe the ret = 0 statement should be set in the else part of the if statement and not at the end to ensure -EBUSY is being returned correctly. Detected by clang scan: drivers/usb/gadget/udc/core.c:1558:4: warning: Value stored to 'ret' is never read [deadcode.DeadStores] Fixes: fc274c1e9973 ("USB: gadget: Add a new bus for gadgets") Acked-by: Alan Stern Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220504135840.232209-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3120aac6d0ecd9accf56894aeac0e265f74d3d5a Author: Marek Szyprowski Date: Thu May 5 12:46:18 2022 +0200 usb: dwc2: gadget: don't reset gadget's driver->bus UDC driver should not touch gadget's driver internals, especially it should not reset driver->bus. This wasn't harmful so far, but since commit fc274c1e9973 ("USB: gadget: Add a new bus for gadgets") gadget subsystem got it's own bus and messing with ->bus triggers the following NULL pointer dereference: dwc2 12480000.hsotg: bound driver g_ether 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000000 [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: ... CPU: 0 PID: 620 Comm: modprobe Not tainted 5.18.0-rc5-next-20220504 #11862 Hardware name: Samsung Exynos (Flattened Device Tree) PC is at module_add_driver+0x44/0xe8 LR is at sysfs_do_create_link_sd+0x84/0xe0 ... Process modprobe (pid: 620, stack limit = 0x(ptrval)) ... module_add_driver from bus_add_driver+0xf4/0x1e4 bus_add_driver from driver_register+0x78/0x10c driver_register from usb_gadget_register_driver_owner+0x40/0xb4 usb_gadget_register_driver_owner from do_one_initcall+0x44/0x1e0 do_one_initcall from do_init_module+0x44/0x1c8 do_init_module from load_module+0x19b8/0x1b9c load_module from sys_finit_module+0xdc/0xfc sys_finit_module from ret_fast_syscall+0x0/0x54 Exception stack(0xf1771fa8 to 0xf1771ff0) ... dwc2 12480000.hsotg: new device is high-speed ---[ end trace 0000000000000000 ]--- Fix this by removing driver->bus entry reset. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220505104618.22729-1-m.szyprowski@samsung.com Signed-off-by: Greg Kroah-Hartman commit 0f40ac35e4ecb16ab5bb672386a90e3cde13b186 Author: Rafael J. Wysocki Date: Thu May 5 20:18:09 2022 +0200 PCI/PM: Replace pci_set_power_state() in pci_pm_thaw_noirq() Calling pci_set_power_state() to put the given device into D0 in pci_pm_thaw_noirq() may cause it to restore the device's BARs, which is redundant before calling pci_restore_state(), so replace it with a direct pci_power_up() call followed by pci_update_current_state() if it returns a nonzero value, in analogy with pci_pm_default_resume_early(). Avoid code duplication by introducing a wrapper function to contain the repeating pattern and calling it in both places. Link: https://lore.kernel.org/r/3639079.MHq7AAxBmi@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 3cc2a2b2704f76702cdd417573a934502254276d Author: Rafael J. Wysocki Date: Thu May 5 20:16:50 2022 +0200 PCI/PM: Rearrange pci_set_power_state() The part of pci_set_power_state() related to transitions into low-power states is unnecessary convoluted, so clearly divide it into the D3cold special case and the general case covering all of the other states. Also fix a potential issue with calling pci_bus_set_current_state() to set the current state of all devices on the subordinate bus to D3cold without checking if the power state of the parent bridge has really changed to D3cold. Link: https://lore.kernel.org/r/2139440.Mh6RI2rZIc@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 0aacdc957401802bd2b94141a3d2c5f88c529e30 Author: Rafael J. Wysocki Date: Thu May 5 20:15:34 2022 +0200 PCI/PM: Clean up pci_set_low_power_state() Make the following assorted non-essential changes in pci_set_low_power_state(): 1. Drop two redundant checks from it (the caller takes care of these conditions). 2. Change the log level of a messages printed by it to "debug", because it only indicates a programming mistake. Link: https://lore.kernel.org/r/2539071.Lt9SDvczpP@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 0ce74a3b9c5255f641842df3c4c14fa8ea049a5a Author: Rafael J. Wysocki Date: Thu May 5 20:14:24 2022 +0200 PCI/PM: Do not restore BARs if device is not in D0 Do not attempt to restore the device's BARs in pci_set_full_power_state() if the actual current power state of the device is not D0. Link: https://lore.kernel.org/r/1849718.CQOukoFCf9@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit e200904b275c63dae711fca542f5fb20d162eb26 Author: Rafael J. Wysocki Date: Thu May 5 20:13:00 2022 +0200 PCI/PM: Split pci_power_up() One of the two callers of pci_power_up() invokes pci_update_current_state() and pci_restore_state() right after calling it, in which case running the part of it happening after the mandatory transition delays is redundant, so move that part out of it into a new function called pci_set_full_power_state() that will be invoked from pci_set_power_state() which is the other caller of pci_power_up(). Link: https://lore.kernel.org/r/1942150.usQuhbGJ8B@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit f0881d38c7eca3351f59d551604aaf74283c2e13 Author: Rafael J. Wysocki Date: Thu May 5 20:10:43 2022 +0200 PCI/PM: Write 0 to PMCSR in pci_power_up() in all cases Make pci_power_up() write 0 to the device's PCI_PM_CTRL register in order to put it into D0 regardless of the power state returned by the previous read from that register which should not matter. Link: https://lore.kernel.org/r/5748066.MhkbZ0Pkbq@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 0b59193548e63957101aae5e4fc47151fce4a629 Author: Rafael J. Wysocki Date: Thu May 5 20:09:12 2022 +0200 PCI/PM: Do not call pci_update_current_state() from pci_power_up() Notice that calling pci_update_current_state() from pci_power_up() is redundant and may be harmful in some cases. First, if the device is in a low-power state before pci_power_up() gets called for it and platform_pci_set_power_state() successfully changes its power state to D0, pci_update_current_state() will update current_state to reflect that and pci_power_up() will return success right away without restoring the device's BARs or reconfiguring ASPM which may be necessary. This is arguably incorrect and definitely inconsistent with the case when platform_pci_set_power_state() returns an error (for example, because the device is not power-manageable by the platform firmware). Second, current_state should not be overwritten until the decision whether or not to restore the device's BARs is made, because that decision generally depends on its value. Again, calling pci_update_current_state() in pci_power_up() is not consistent with this observation. Next, pci_power_up() attempts to read from the device's PCI_PM_CTRL register regardless of the current_state value unless it is PCI_D0, including the case when pci_update_current_state() sets current_state to PCI_D3cold to indicate that the device is not accessible. If the register read is not successful, current_state will be set to PCI_D3cold anyway, so that pci_update_current_state() action is redundant. Further, if pci_update_current_state() reads the device's PCI_PM_CTRL register, pci_power_up() will repeat that read going forward and it is not necessary to update current_state in the meantime. Finally, if pm_cap is not set (in which case the PCI_PM_CTRL register is not present), the power state of the device should be determined with the help of the platform firmware or set to D0 if that's not possible and pci_update_current_state() does not do that. Accordingly, rearrange pci_power_up() so as to address the above shortcomings. Link: https://lore.kernel.org/r/3695055.kQq0lBPeGt@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 6d8c016a55aca612802fc325eb0e659d1c5f255d Author: Rafael J. Wysocki Date: Thu May 5 20:05:15 2022 +0200 PCI/PM: Unfold pci_platform_power_transition() in pci_power_up() Some actions carried out by pci_platform_power_transition(() in pci_power_up() are redundant, but before dealing with them, make pci_power_up() call the pci_platform_power_transition() code directly (and avoid a redundant check when pm_cap is unset while at it). Link: https://lore.kernel.org/r/1922486.PYKUYFuaPT@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 1aa85bb14d8ed0ae4238617061924032c80dad37 Author: Rafael J. Wysocki Date: Thu May 5 20:04:07 2022 +0200 PCI/PM: Set current_state to D3cold if the device is not accessible Make pci_power_up() and pci_set_low_power_state() change current_state to PCI_D3cold when the device is not accessible along the lines of pci_update_current_state(). Link: https://lore.kernel.org/r/10104376.nUPlyArG6x@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 7957d201456f436557870cf8bbd47328a280c522 Author: Rafael J. Wysocki Date: Thu May 5 20:02:52 2022 +0200 PCI/PM: Relocate pci_set_low_power_state() Because pci_set_power_state() is the only caller of pci_set_low_power_state(), put the latter next to the former. No functional impact. Link: https://lore.kernel.org/r/3202976.44csPzL39Z@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 10aa5377fc8ae0a259692dd9b20593a79567e0ef Author: Rafael J. Wysocki Date: Thu May 5 20:00:33 2022 +0200 PCI/PM: Split pci_raw_set_power_state() The transitions from low-power states to D0 and the other way around are unnecessarily tangled in pci_raw_set_power_state() which makes it rather hard to follow. Moreover, the only caller of pci_raw_set_power_state() passing PCI_D0 as its state argument is pci_power_up(), so the code carrying out transitions into D0 can be put directly into that function. Accordingly, move the code handling transitions from low-power states into D0 directly into pci_power_up() and rename the remaining part of pci_raw_set_power_state() to pci_set_low_power_state(), because it only handles transitions into low-power state now. While at it, fix up some white space, update some comments and modify messages printed by pci_power_up() and pci_set_low_power_state() to be less confusing (which is the only expected functional impact of this change). Link: https://lore.kernel.org/r/13038676.uLZWGnKmhe@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 9c384ddd6eb2ee90d19cd01128748dec85fa36e3 Author: Rafael J. Wysocki Date: Thu Apr 14 15:07:24 2022 +0200 PCI/PM: Rearrange pci_update_current_state() Save one config space access in pci_update_current_state() by testing the retrieved PCI_PM_CTRL register value against PCI_POSSIBLE_ERROR() instead of invoking pci_device_is_present() separately. While at it, drop a pair of unnecessary parens. No expected functional impact. Link: https://lore.kernel.org/r/1917095.PYKUYFuaPT@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas commit 8221ecd4e4620cf2f0e942cafcdecac1685f8f16 Author: Rafael J. Wysocki Date: Thu Apr 14 15:04:27 2022 +0200 PCI/PM: Drop the runtime_d3cold device flag The runtime_d3cold flag is not needed any more, so drop it. Link: https://lore.kernel.org/r/8077784.T7Z3S40VBb@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 730643d33e2d9ae52d974201b5017d8c3efe5aa5 Author: Rafael J. Wysocki Date: Thu Apr 14 15:04:13 2022 +0200 PCI/PM: Resume subordinate bus in bus type callbacks Calling pci_resume_bus() on the secondary bus from pci_power_up() as it is done now is questionable, because it depends on the mandatory bridge power-up delays that are only covered by the PCI bus type PM callbacks. For this reason, move the subordinate bus resume to those callbacks too and use the observation that if a bridge is being powered-up during resume from system-wide suspend, it may be still desirable to runtime-resume its subordinate bus after completing the system-wide transition (in case the resume of the devices on that bus is skipped during it). Link: https://lore.kernel.org/r/3190097.aeNJFYEL58@kreacher Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 9a6058312ea941bac3b0ba8c963d7543fc42a288 Author: Rafael J. Wysocki Date: Fri Apr 8 20:29:01 2022 +0200 PCI/PM: Power up all devices during runtime resume Currently, endpoint devices may not be powered up entirely during runtime resume that follows a D3hot -> D0 transition of the parent bridge. Namely, even if the power state of an endpoint device, as indicated by its PCI_PM_CTRL register, is D0 after powering up its parent bridge, it may be still necessary to bring its ACPI companion into D0 and that should be done before accessing it. However, the current code assumes that reading the PCI_PM_CTRL register is sufficient to establish the endpoint device's power state, which may lead to problems. Address that by forcing a power-up of all PCI devices, including the platform firmware part of it, during runtime resume. Link: https://lore.kernel.org/linux-pm/11967527.O9o76ZdvQC@kreacher Fixes: 5775b843a619 ("PCI: Restore config space on runtime resume despite being unbound") Link: https://lore.kernel.org/r/2652115.mvXUDI8C0e@kreacher Reported-by: Abhishek Sahu Tested-by: Abhishek Sahu Signed-off-by: Rafael J. Wysocki Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit 18a94192e20de31e7e495d7c805c8930c42e99ef Author: Krzysztof Kozlowski Date: Wed Apr 20 16:11:35 2022 +0200 PCI/PM: Define pci_restore_standard_config() only for CONFIG_PM_SLEEP pci_restore_standard_config() was defined under CONFIG_PM but called only by pci_pm_resume() (defined under CONFIG_SUSPEND) and pci_pm_restore() (defined under CONFIG_HIBERNATE_CALLBACKS). A configuration with only CONFIG_PM leads to a warning: drivers/pci/pci-driver.c:533:12: error: ‘pci_restore_standard_config’ defined but not used [-Werror=unused-function] CONFIG_PM_SLEEP depends on CONFIG_SUSPEND and CONFIG_HIBERNATE_CALLBACKS, so define pci_restore_standard_config() under that instead. Link: https://lore.kernel.org/r/20220420141135.444820-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Helgaas commit bdc33dad34be94ab7ef2602cc54f34c72160f581 Merge: dbdaca1300072 5bd2927aceba1 Author: Arnd Bergmann Date: Thu May 5 21:07:45 2022 +0200 Merge tag 'asahi-soc-rtkit-sart-nvme-for-5.19' of https://github.com/AsahiLinux/linux into arm/drivers Apple SoC NVMe driver and dependencies: - RTKit IPC library required to boot and communicate with co-processors embedded inside Apple SoCs - SART DMA address filter required to allow some DMA transactions for the NVMe co-processor - NVMe platform driver The following minor changes since v3 on the mailing list have been folded in: - sart: %llx -> %pa for a phys_addr_t - rtkit:/sart: Drop IS_ENABLED inside headers - rtkit: Use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL - nvme: Set NVME_REQ_CANCELLED in the timeout handler - nvme: Use DEFINE_SIMPLE_DEV_PM_OPS instead of #ifdef CONFIG_PM_SLEEP * tag 'asahi-soc-rtkit-sart-nvme-for-5.19' of https://github.com/AsahiLinux/linux: nvme-apple: Add initial Apple SoC NVMe driver dt-bindings: nvme: Add Apple ANS NVMe soc: apple: Add SART driver dt-bindings: iommu: Add Apple SART DMA address filter soc: apple: Add RTKit IPC library soc: apple: Always include Makefile Link: https://lore.kernel.org/r/20220505154020.84638-1-sven@svenpeter.dev Signed-off-by: Arnd Bergmann commit caf10a34aa72b10d93640afc03ba48e17320704e Merge: 89c839720c9ba b32c613b3fda3 Author: Arnd Bergmann Date: Thu May 5 21:06:30 2022 +0200 Merge tag 'arm-soc/for-5.19/soc' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains Broadcom ARM-based SoC changes for 5.19, please pull the following: - Julia fixes a couple of typographic errors in the Brahma-B15 read ahead cache driver and in the ARCH_BRCMSTB bare metal SMP bring-up code - William adds a Kconfig entry for ARCH_BCMBCA which will be used to upstream support for Broadcom's broadband SoCs * tag 'arm-soc/for-5.19/soc' of https://github.com/Broadcom/stblinux: arm: bcmbca: add arch bcmbca machine entry ARM: brcmstb: fix typos in comments ARM: mm: fix typos in comments Link: https://lore.kernel.org/r/20220504210942.1838248-6-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit f68ec514232271bb8d035b8509d0bde900cf7e05 Merge: efad535480c1a 1f61e9aa2e6f9 Author: Arnd Bergmann Date: Thu May 5 21:02:23 2022 +0200 Merge tag 'arm-soc/for-5.19/defconfig' of https://github.com/Broadcom/stblinux into arm/defconfig This pull request contains Broadcom ARM-based SoC changes to the multi_v7_defconfig file, please pull the following: - William enables the Broadcom BCA SoC Kconfig option to get build coverage for this newly added SoC * tag 'arm-soc/for-5.19/defconfig' of https://github.com/Broadcom/stblinux: ARM: multi_v7_defconfig: enable CONFIG_ARCH_BCMBCA in armv7 defconfig Link: https://lore.kernel.org/r/20220504210942.1838248-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 485b5afae681784c50934c23fc9172518d42ba4d Merge: 1b8e9677bc486 e4edfeaf6b585 Author: Arnd Bergmann Date: Thu May 5 20:40:26 2022 +0200 Merge tag 'omap-for-v5.19/dt-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt More devicetree changes for omaps Devicetree updates for few boards and more clean-up for make dtbs warnings: - Updates for am335x-myirtech oscillator and mtd - Firmware configuration for i2c voltage scaling and IO isolation for am3/4 that are wired for these features - A series of omap3 clock node clean-up for make dtbs warnings for unique_unit_address and node_name_chars_strict - Updates for dma-channel usage to add the generic dma-common properties * tag 'omap-for-v5.19/dt-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (26 commits) ARM: dts: dm81xx: use new 'dma-channels/requests' properties ARM: dts: am33xx: use new 'dma-channels/requests' properties ARM: dts: Group omap3 CM_CLKSEL1_EMU clocks ARM: dts: Group omap3 CM_CLKSEL_PER clocks ARM: dts: Group omap3 CM_ICLKEN_PER clocks ARM: dts: Group omap3 CM_FCLKEN_PER clocks ARM: dts: Group omap3 CM_FCLKEN_CAM clocks ARM: dts: Group omap3 CM_CLKSEL_DSS clocks ARM: dts: Group omap3 CM_FCLKEN_DSS clocks ARM: dts: Group omap3 CM_CLKOUT_CTRL clocks ARM: dts: Group omap3 CM_CLKSEL1_PLL clocks ARM: dts: Group omap3 CM_CLKSEL_WKUP clocks ARM: dts: Group omap3 CM_ICLKEN_WKUP clocks ARM: dts: Group omap3 CM_FCLKEN_WKUP clocks ARM: dts: Group omap3 CM_CLKSEL_CORE clocks ARM: dts: Group omap3 CM_ICLKEN3_CORE clocks ARM: dts: Group omap3 CM_ICLKEN1_CORE clocks ARM: dts: Group omap3 crypto accelerator clocks ARM: dts: Group omap3 CM_FCLKEN1_CORE clocks ARM: dts: Group omap3 CONTROL_DEVCONF1 clocks ... Link: https://lore.kernel.org/r/pull-1651726643-535261@atomide.com Signed-off-by: Arnd Bergmann commit 4eaf1797bca19ed766dc3d7b607f0b0617214e7e Author: Jacob Keller Date: Mon Apr 11 16:29:07 2022 -0700 ice: remove period on argument description in ice_for_each_vf The ice_for_each_vf macros have comments describing the implementation. One of the arguments has a period on the end, which is not our typical style. Remove the unnecessary period. Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit 71c114e8753978c0728edf639a17756cf90ae629 Author: Jacob Keller Date: Mon Apr 11 16:29:06 2022 -0700 ice: add a function comment for ice_cfg_mac_antispoof This function definition was missing a comment describing its implementation. Add one. Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit 19c3e1ede517bf2e4c9ead30316866aa9ac6e331 Author: Jacob Keller Date: Mon Apr 11 16:29:05 2022 -0700 ice: fix wording in comment for ice_reset_vf The comment explaining ice_reset_vf has an extraneous "the" with the "if the resets are disabled". Remove it. Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit 00be8197c9741b91700289a33c25b7b6de951cc9 Author: Jacob Keller Date: Mon Apr 11 16:29:04 2022 -0700 ice: remove return value comment for ice_reset_all_vfs Since commit fe99d1c06c16 ("ice: make ice_reset_all_vfs void"), the ice_reset_all_vfs function has not returned anything. The function comment still indicated it did. Fix this. While here, also add a line to clarify the function resets all VFs at once in response to hardware resets such as a PF reset. Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit baeb705fd6a7245cc1fa69ed991a9cffdf44a174 Author: Jacob Keller Date: Mon Apr 11 16:29:03 2022 -0700 ice: always check VF VSI pointer values The ice_get_vf_vsi function can return NULL in some cases, such as if handling messages during a reset where the VSI is being removed and recreated. Several places throughout the driver do not bother to check whether this VSI pointer is valid. Static analysis tools maybe report issues because they detect paths where a potentially NULL pointer could be dereferenced. Fix this by checking the return value of ice_get_vf_vsi everywhere. Signed-off-by: Jacob Keller Reviewed-by: Paul Menzel Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 9880d3d6f9e3ab264d58368306dd83218ea6a3c1 Author: Jacob Keller Date: Mon Apr 11 16:29:02 2022 -0700 ice: add newline to dev_dbg in ice_vf_fdir_dump_info The debug print in ice_vf_fdir_dump_info does not end in newlines. This can look confusing when reading the kernel log, as the next print will immediately continue on the same line. Fix this by adding the forgotten newline. Signed-off-by: Jacob Keller Reviewed-by: Paul Menzel Signed-off-by: Tony Nguyen commit 4b889474adc628326df35bb2196cf36b506c7706 Author: Michal Swiatkowski Date: Wed Apr 20 13:22:43 2022 +0200 ice: get switch id on switchdev devices Switch id should be the same for each netdevice on a driver. The id must be unique between devices on the same system, but does not need to be unique between devices on different systems. The switch id is used to locate ports on a switch and to know if aggregated ports belong to the same switch. To meet this requirements, use pci_get_dsn as switch id value, as this is unique value for each devices on the same system. Implementing switch id is needed by automatic tools for kubernetes. Set switch id by setting devlink port attribiutes and calling devlink_port_attrs_set while creating pf (for uplink) and vf (for representator) devlink port. To get switch id (in switchdev mode): cat /sys/class/net/$PF0/phys_switch_id Signed-off-by: Michal Swiatkowski Signed-off-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit bd1ffe8e5df4e24fc637d85b01f40e282c29856d Author: Wojciech Drewek Date: Wed Apr 20 12:55:41 2022 +0200 ice: return ENOSPC when exceeding ICE_MAX_CHAIN_WORDS When number of words exceeds ICE_MAX_CHAIN_WORDS, -ENOSPC should be returned not -EINVAL. Do not overwrite this error code in ice_add_tc_flower_adv_fltr. Signed-off-by: Wojciech Drewek Suggested-by: Marcin Szycik Acked-by: Maciej Fijalkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 295819b562fa13e48d0de72eebae7e75dc7c2cc4 Author: Maciej Fijalkowski Date: Thu Mar 24 12:49:07 2022 +0100 ice: introduce common helper for retrieving VSI by vsi_num Both ice_idc.c and ice_virtchnl.c carry their own implementation of a helper function that is looking for a given VSI based on provided vsi_num. Their functionality is the same, so let's introduce the common function in ice.h that both of the mentioned sites will use. This is a strictly cleanup thing, no functionality is changed. Reviewed-by: Alexander Lobakin Signed-off-by: Maciej Fijalkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 187dbc15d8a7c4437c7757eba8542594d7eab22e Author: Wan Jiabing Date: Mon Mar 21 21:59:47 2022 +0800 ice: use min_t() to make code cleaner in ice_gnss Fix the following coccicheck warning: ./drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min() Signed-off-by: Wan Jiabing Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 1b8e9677bc486753f27bcd673f119b46ffd36147 Merge: 814cc4fce8b40 ad2c6e3cdd612 Author: Arnd Bergmann Date: Thu May 5 19:56:58 2022 +0200 Merge tag 'arm-soc/for-5.19/devicetree-arm64' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM64-based SoCs changes for 5.19, please pull the following: - Krzysztof fixes the SPI NOR Device Tree node name to comply with the dtschema * tag 'arm-soc/for-5.19/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: align SPI NOR node name with dtschema Link: https://lore.kernel.org/r/20220504210942.1838248-3-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 33cd6928039c6bf18cf0baec936924d908e6c89b Author: Ian Rogers Date: Mon May 2 21:17:53 2022 -0700 perf evlist: Clear all_cpus before propagating all_cpus is merged into during propagation. Initially all_cpus is set from PMU sysfs. perf_evlist__set_maps() will recompute it and change evsel->cpus to user_requested_cpus if they are given. If all_cpus isn't cleared then the union of the user_requested_cpus and PMU sysfs values is set to all_cpus, whereas just user_requested_cpus is necessary. To avoid this make all_cpus empty prior to propagation. Reviewed-by: Adrian Hunter Signed-off-by: Ian Rogers Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Link: http://lore.kernel.org/lkml/20220503041757.2365696-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ec648fc0a00378359dbf719371ed36657d6ccf4a Author: Samuel Holland Date: Sun Apr 24 20:42:09 2022 -0700 Input: sun4i-lradc-keys - add support for R329 and D1 This LRADC variant uses the same 3/4*AVCC reference voltage as the A83T variant. The R329 and D1 LRADCs appear to be identical, so D1 support is accomplished through having the R329 LRADC as a fallback compatible. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220414002349.24332-3-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit ac2d5b43ea1676ca99397eb355ca68fab44172e4 Author: Samuel Holland Date: Sun Apr 24 20:39:11 2022 -0700 Input: sun4i-lradc-keys - add optional clock/reset support Until the R329, the LRADC hardware was always active. Now it requires enabling a clock gate and deasserting a reset line. Add support for this variant of the hardware. Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220414002349.24332-2-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit 61f19f67490bf3f459d2e67f2a70588a9c4c8cda Author: Samuel Holland Date: Sun Apr 24 20:38:44 2022 -0700 dt-bindings: input: sun4i-lradc-keys: Add R329 and D1 compatibles The R329 and D1 SoCs each contain an LRADC with a programming interface compatible to earlier LRADCs. However, the LRADC now has its own clock gate and reset line, instead of being always active. To support this, add clock/reset properties to the binding, and require them for the variant in the new SoCs. Acked-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220414002349.24332-1-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit 7d4686fc3c2ad9bfd1eaf3c54515d6469e542578 Author: Rahul T R Date: Thu May 5 14:37:09 2022 +0530 arm64: dts: ti: k3-j721e-sk: Enable HDMI Add node for dvi bridge and the endpoint nodes to describe connection from DSS => TI TFP410 DPI-to-DVI Bridge => HDMI connector. Also add the required pinmux for HDMI hotplug and powerdown Signed-off-by: Rahul T R Signed-off-by: Vignesh Raghavendra Reviewed-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20220505090709.9252-3-r-ravikumar@ti.com commit d4f3c8a169ab82b91ba1e10a495e900477a75cf5 Author: Rahul T R Date: Thu May 5 14:37:08 2022 +0530 arm64: dts: ti: k3-j721e-sk: Enable DisplayPort Add the endpoint nodes to describe connection from DSS => MHDP => DisplayPort connector. Signed-off-by: Rahul T R Signed-off-by: Vignesh Raghavendra Reviewed-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20220505090709.9252-2-r-ravikumar@ti.com commit 8f984f60f2f1fa109f9ae8c9194b6989f6675c1d Author: Tomi Valkeinen Date: Fri Apr 29 16:56:39 2022 +0530 arm64: dts: ti: k3-j721e-common-proc-board: add DP to j7 evm Add the endpoint nodes to describe connection from DSS => MHDP => DisplayPort connector. Also add the required pinmux nodes for hotplug. Signed-off-by: Tomi Valkeinen Signed-off-by: Rahul T R Signed-off-by: Vignesh Raghavendra Reviewed-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20220429112639.13004-3-r-ravikumar@ti.com commit 92c996f4ceabd5780bb7678138267db0a1e1a00e Author: Tomi Valkeinen Date: Fri Apr 29 16:56:38 2022 +0530 arm64: dts: ti: k3-j721e-*: add DP & DP PHY Add DT nodes for DisplayPort and DisplayPort PHY. The DP is Cadence MHDP 8546 and the PHY is a Cadence Torrent PHY with TI WIZ wrapper. Also add the required phy link nodes in the board dts files. A slight irregularity in the bindings is the DPTX PHY register block, which is in the MHDP IP, but is needed and mapped by the PHY. Signed-off-by: Tomi Valkeinen Signed-off-by: Rahul T R Signed-off-by: Vignesh Raghavendra Reviewed-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20220429112639.13004-2-r-ravikumar@ti.com commit 0255571a16059c8e863a65a4b1611db93bb9b3ae Author: Ian Rogers Date: Mon May 2 21:17:52 2022 -0700 perf cpumap: Switch to using perf_cpu_map API Switch some raw accesses to the cpu map to using the library API. This can help with reference count checking. Some BPF cases switch from index to CPU for consistency, this shouldn't matter as the CPU map is full. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Link: http://lore.kernel.org/lkml/20220503041757.2365696-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 54f03916fb892441f9a9b579db9ad7925cdeb395 Author: Mimi Zohar Date: Thu Dec 23 12:29:56 2021 -0500 ima: permit fsverity's file digests in the IMA measurement list Permit fsverity's file digest (a hash of struct fsverity_descriptor) to be included in the IMA measurement list, based on the new measurement policy rule 'digest_type=verity' option. To differentiate between a regular IMA file hash from an fsverity's file digest, use the new d-ngv2 format field included in the ima-ngv2 template. The following policy rule requires fsverity file digests and specifies the new 'ima-ngv2' template, which contains the new 'd-ngv2' field. The policy rule may be constrained, for example based on a fsuuid or LSM label. measure func=FILE_CHECK digest_type=verity template=ima-ngv2 Acked-by: Stefan Berger Signed-off-by: Mimi Zohar commit 989dc72511f7b57b94b42eabfcbe79d9070de6e3 Author: Mimi Zohar Date: Thu Dec 23 12:29:56 2021 -0500 ima: define a new template field named 'd-ngv2' and templates In preparation to differentiate between unsigned regular IMA file hashes and fs-verity's file digests in the IMA measurement list, define a new template field named 'd-ngv2'. Also define two new templates named 'ima-ngv2' and 'ima-sigv2', which include the new 'd-ngv2' field. Signed-off-by: Mimi Zohar commit b35413f415c6469c79b430c52a718de17c62db2f Author: Alaa Mohamed Date: Wed Apr 20 01:43:13 2022 +0200 igb: Convert kmap() to kmap_local_page() kmap() is being deprecated and these usages are all local to the thread so there is no reason kmap_local_page() can't be used. Replace kmap() calls with kmap_local_page(). Signed-off-by: Alaa Mohamed Reviewed-by: Ira Weiny Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 833fbbbbfc8b4b1effb95e1487b196efdaf842ea Author: Jeff Daly Date: Thu Apr 14 16:21:04 2022 -0400 ixgbe: Fix module_param allow_unsupported_sfp type The module_param allow_unsupported_sfp should be a boolean to match the type in the ixgbe_hw struct. Signed-off-by: Jeff Daly Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 949665a6e237a6fd49ff207e3876d71b20b7e9f2 Author: Ville Syrjälä Date: Wed May 4 18:04:40 2022 +0300 drm/i915: Respect VBT seamless DRRS min refresh rate Make sure our choice of downclock mode respects the VBT seameless DRRS min refresh rate limit. v2: s/vrefesh/vrefresh/ (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-10-ville.syrjala@linux.intel.com commit 790b45f1bc6736a8dd48ba5731b6871e0217311e Author: Ville Syrjälä Date: Wed May 4 18:04:39 2022 +0300 drm/i915/bios: Parse the seamless DRRS min refresh rate Extract the seamless DRRS min refresh rate from the VBT. v2: Do a version check Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-9-ville.syrjala@linux.intel.com commit cc589f2deeb4160fb21cd74c25d6779082d9d561 Author: Ville Syrjälä Date: Wed May 4 18:04:38 2022 +0300 drm/i915/bios: Refactor panel_type code Make the panel type code a bit more abstract along the lines of the source of the panel type. For the moment we have three classes: OpRegion, VBT, fallback. Well introduce another one shortly. We can now also print out all the different panel types, and indicate which one we ultimately selected. Could help with debugging. v2: Add .get_panel_type() vfunc (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-8-ville.syrjala@linux.intel.com commit 719f4c51e2c9198bbe1e5e194d7467ac0413cfbb Author: Ville Syrjälä Date: Wed May 4 18:04:37 2022 +0300 drm/i915/bios: Extract get_panel_type() Pull the code to determine the panel type into its own set of sane functions. v2: rebase Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-7-ville.syrjala@linux.intel.com commit 4d1b21605d3922c18ceea7fb610a0e17cf7700f9 Author: Ville Syrjälä Date: Wed May 4 18:04:36 2022 +0300 drm/i915/bios: Assume panel_type==0 if the VBT has bogus data Just assume panel_type==0 always if the VBT gives us bogus data. We actually already do this everywhere else except in parse_panel_options() since we just leave i915->vbt.panel_type zeroed. This also seems to be what Windows does. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-6-ville.syrjala@linux.intel.com commit 9adf7d4186772ab9fc9fd68d03b1dd2a81a6a36b Author: Ville Syrjälä Date: Wed May 4 18:04:35 2022 +0300 drm/i915/bios: Document the mess around the LFP data tables Document the fact that struct lvds_lfp_data_entry can't be used directly and instead must be accessed via the data table pointers. Also remove the bogus comment implying that there might be a variable number of panel entries in the table. There are always exactly 16. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-5-ville.syrjala@linux.intel.com commit 901a0cad2ab8f6edcb3f21f88037eab54c48fd1a Author: Ville Syrjälä Date: Wed May 4 18:04:34 2022 +0300 drm/i915/bios: Get access to the tail end of the LFP data block We need to start parsing stuff from the tail end of the LFP data block. This is made awkward by the fact that the fp_timing table has variable size. So we must use a bit more finesse to get the tail end, and to make sure we allocate enough memory for it to make sure our struct representation fits. v2: Rebase due to the preallocation of BDB blocks v3: Rebase due to min_size WARN relocation v4: Document BDB_LVDS_LFP_DATA vs. BDB_LVDS_LFP_DATA_PTRS order (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-4-ville.syrjala@linux.intel.com commit a87d0a84760726445dcc0f0177623f0d683f3559 Author: Ville Syrjälä Date: Wed May 4 18:04:33 2022 +0300 drm/i915/bios: Generate LFP data table pointers if the VBT lacks them Modern VBTs no longer contain the LFP data table pointers block (41). We are expecting to have one in order to be able to parse the LFP data block (42), so let's make one up. Since the fp_timing table has variable size we must somehow determine its size. Rather than just hardcode it we look for the terminator bytes (0xffff) to figure out where each table entry starts. dvo_timing, panel_pnp_id, and panel_name are expected to have fixed size. This has been observed on various machines, eg. TGL with BDB version 240, CML with BDB version 231, etc. The most recent VBT I've observed that still had block 41 had BDB version 228. So presumably the cutoff (if an exact cutoff even exists) is somewhere around BDB version 229-231. v2: kfree the thing we allocated, not the thing+3 bytes v3: Do the debugprint only if we found the LFP data block v4: Fix t0 null check (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-3-ville.syrjala@linux.intel.com commit 13367132a7ad2e29d58d55f7755fb1844db5f362 Author: Ville Syrjälä Date: Wed May 4 18:04:32 2022 +0300 drm/i915/bios: Reorder panel DTD parsing Reorder things so that we can parse the entier LFP data block in one go. For now we just stick to parsing the DTD from it. Also fix the misleading comment about block 42 being deprecated. Only the DTD part is deprecated, the rest is still very much needed. v2: Move the version check+comment into parse_generic_dtd() (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220504150440.13748-2-ville.syrjala@linux.intel.com commit bb7acf59a11e013b5d548215918df9eb27dd35b2 Author: Ville Syrjälä Date: Fri Feb 18 12:03:59 2022 +0200 drm/i915: Use drm_mode_init() for on-stack modes Initialize on-stack modes with drm_mode_init() to guarantee no stack garbage in the list head, or that we aren't copying over another mode's list head. Based on the following cocci script, with manual fixups: @decl@ identifier M; expression E; @@ - struct drm_display_mode M = E; + struct drm_display_mode M; @@ identifier decl.M; expression decl.E; statement S, S1; @@ struct drm_display_mode M; ... when != S + drm_mode_init(&M, &E); + S1 @@ expression decl.E; @@ - &*E + E Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-19-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit eedd8a8542b9509d3a2aa8141c60858ac0c5024a Merge: d640947562cea d77e745613680 Author: Mark Brown Date: Thu May 5 16:08:41 2022 +0100 regmap: Custom bulk operations for regmaps Merge series from Marek Vasut: This patch adds an API for custom bulk operations on a simple regmap, the number of single use bus implementations shows there's a need for this. commit cae640c5ff94134ddb928122365a84c2e0c478d5 Merge: e14bd35ef4460 ceb89acc4dc8f Author: Mark Brown Date: Thu May 5 16:08:39 2022 +0100 ASoC: SOF: IPC4: Introduce message handling functionality Merge series from Peter Ujfalusi : The series adds the basic IPC4 message handling code, implementing the ipc callbacks. Due to the difference between IPC3 and IPC4 messaging we need to introduce new message container for IPC4, but the SOF internal callbacks and structures can be kept as they were and leaving it for the IPC specific code to handle the differences. The series provides the foundation for both lowe level (sound/soc/sof/intel) and high level IPC4 implementation (topologies, firmware loading, control handling, etc). commit 646e321f332ba9328ad573d3d88d9a26032e8761 Author: Michael Walle Date: Thu Apr 28 13:16:22 2022 +0200 pinctrl: microchip-sgpio: make irq_chip immutable Since recently, the kernel is nagging about mutable irq_chips: [ 4.967050] gpio gpiochip1: (e2004190.gpio-input): not an immutable chip, please consider fixing it! Drop the unneeded copy, flag it as IRQCHIP_IMMUTABLE, add the new helper functions and call the appropriate gpiolib functions. Signed-off-by: Michael Walle Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220428111622.1395831-1-michael@walle.cc Signed-off-by: Linus Walleij commit 160625856d324c27888ccbbe7693475b2706bd3b Merge: f4b09d8d67efc 5644b66a9c63c Author: Linus Walleij Date: Thu May 5 16:50:14 2022 +0200 Merge branch 'irq/gpio-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into devel commit 814cc4fce8b40ff874d0e33ac3fa84b46fbe9457 Merge: e8bcacdaf1386 417aea4436bb6 Author: Arnd Bergmann Date: Thu May 5 16:48:55 2022 +0200 Merge tag 'arm-soc/for-5.19/devicetree' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM-based SoCs Device Tree changes for 5.19, please pull the following: - Oleksij fixes the ethernet node name for the USB Ethernet adapter on BCM283x (Raspberry Pi 1/2/3) platforms - Kuldeep fixes the PL022 SPI controller clock names to conform to the binding - Rafal updates the various BCM5301X (Northstar) Device Tree include files to be dtsschema conforming for pinctrl, NAND - Arinc adds the Asus RT-AC88U binding, removes some unnecessary properties of the Ethernet switch DT node, populates the correct PHY interface for port 5 of the switch, adds support for fetching the MAC address from the NVMEM provider and finally disables gmac0 on that device which is unused - Phil updates the Raspberry Pi 1/2/3 DTS files to have the latest gpio line names conforming to the printed circuit board layout - Krzysztof updates various Broadcom DTS files to have a conforming SPI nor Device Tree node - Takayoshi adds support for the Buffalo WZR-1166DHP/WZR-1166DHP2 wireless routers based on the BCM4708 SoC - William adds support for the BCM47622 ARMv7 Broadband SoC and provides a basic DTS to boot upstream Linux on such a system * tag 'arm-soc/for-5.19/devicetree' of https://github.com/Broadcom/stblinux: (22 commits) ARM: dts: BCM5301X: Add DT for WZR-1166DHP,DHP2 ARM: dts: add dts files for bcmbca soc 47622 dt-bindings: arm: add bcmbca device tree binding document ARM: dts: bcm283x: Align ETH_CLK GPIO line name ARM: dts: bcm283x: Remove gpio line name NC ARM: dts: bcm2835-rpi-b: Fix GPIO line names ARM: dts: bcm2837-rpi-3-b-plus: Fix GPIO line name of power LED ARM: dts: bcm2837-rpi-cm3-io3: Fix GPIO line names for SMPS I2C ARM: dts: bcm2835-rpi-zero-w: Fix GPIO line name for Wifi/BT ARM: dts: BCM5301X: Disable gmac0 and enable port@8 on Asus RT-AC88U ARM: dts: broadcom: align SPI NOR node name with dtschema dt-bindings: arm: bcm: add bindings for Asus RT-AC88U ARM: dts: BCM5301X: Fix compatible strings for BCM53012 and BCM53016 SoC dt-bindings: arm: bcm: create new description for BCM53016 dt-bindings: arm: bcm: fix BCM53012 and BCM53016 SoC strings ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on Asus RT-AC88U ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on Asus RT-AC88U ARM: dts: BCM5301X: Remove cell properties from srab ports on Asus RT-AC88U ARM: dts: BCM5301X: Fix DTC warning for NAND node ARM: dts: BCM5301X: Update pin controller node name ... Link: https://lore.kernel.org/r/20220504210942.1838248-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit e8bcacdaf1386a61a760269905bb44ec7860912c Merge: 0fd8954b9e8ab b30ae5638dac6 Author: Arnd Bergmann Date: Thu May 5 16:45:50 2022 +0200 Merge tag 'juno-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/dt Arm FVP/Juno device tree updates for v5.19 The main and bulk of the change is the addition of new platform Arm corstone1000(both FVP and FPGA versions). Also, there are addition of Coresight Cross Trigger Interface(CTI) support on Juno, fix for incorrect SCMI power domain IDs, addition of virtio-rng on FVP which is default disabled as it works only on latest versions of the FVP model. Other miscellanous changes include dropping of useless 'dma-channels/requests' properties and updating virtio device node names as per dtschema. * tag 'juno-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm64: dts: juno: Drop useless 'dma-channels/requests' properties arm64: dts: fvp: Align virtio device node names with dtschema arm64: dts: fvp: Add virtio-rng support arm64: dts: Add Arm corstone1000 platform support dt-bindings: Add Arm corstone1000 platform arm64: dts: juno: add CTI entries to device tree arm64: dts: juno: Fix SCMI power domain IDs for ETF and CS funnel Link: https://lore.kernel.org/r/20220504112917.3492009-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 0fd8954b9e8ab28c78e4234b0d94baa42c01da19 Merge: 87f5bc6deac44 5b7e58313a77e Author: Arnd Bergmann Date: Thu May 5 16:44:18 2022 +0200 Merge tag 'stm32-dt-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/dt STM32 DT for v5.19, round 1 Highlights: ---------- -MCU: -Fix pinctrl node names to match with pinctrl yaml. - MPU: -General: - Fix pinctrl node names to match with pinctrl yaml. - Add Protonics boards support based on STM32MP151A SoC: - PRTT1C - 10BaseT1L switch: mainly embeds a sja1105q switch with TI and Micrel 10BaseT Phys and wifi support. - PRTT1S - 10BaseT1L CO2 sensor board: mainly embeds I2C humidity and CO2 sensors. - PRTT1A - 10BaseT1L multi functional controller. - ST boards: - Add RTC support on stm32mp13. - Add button and heartbit support on stm32mp13 DK board. - Add a secure version of STM32MP15 ED1/EV1/DK1/DK2 boards based on OP-TEE OS and SCMI protocol. - DH boards: - Use MCO2 to generate PHY clock and ETHRX clock in order to release internal PLL for a better SD card usage. - Add 1ms PHY post-reset on Avenger96 board to match with PHY requirements. * tag 'stm32-dt-for-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: (24 commits) ARM: dts: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1) dt-bindings: arm: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1) ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15 dt-bindings: reset: stm32mp15: rename RST_SCMI define dt-bindings: clock: stm32mp15: rename CK_SCMI define dt-bindings: clock: stm32mp1: describes clocks if "st,stm32mp1-rcc-secure" dt-bindings: rcc: Add optional external ethernet RX clock properties ARM: dts: stm32: add UserPA13 button on stm32mp135f-dk ARM: dts: stm32: add blue led (Linux heartbeat) on stm32mp135f-dk ARM: dts: stm32: add EXTI interrupt-parent to pinctrl node on stm32mp131 ARM: dts: stm32: add support for Protonic PRTT1x boards ARM: dts: stm32: stm32mp15-pinctrl: add spi1-1 pinmux group dt-bindings: net: silabs,wfx: add prt,prtt1c-wfm200 antenna variant dt-bindings: arm: stm32: Add compatible strings for Protonic T1L boards dt-bindings: arm: stm32: correct blank lines dt-bindings: arm: stm32: narrow DH STM32MP1 SoM boards ARM: dts: stm32: enable RTC support on stm32mp135f-dk ARM: dts: stm32: add RTC node on stm32mp131 ARM: dts: stm32: Fix PHY post-reset delay on Avenger96 ARM: dts: stm32: fix pinctrl node name warnings (MPU soc) ... Link: https://lore.kernel.org/r/5818c943-882d-7e50-430d-ae3299a108ee@foss.st.com Signed-off-by: Arnd Bergmann commit dbdaca13000729dbc2b0bb39d20831c49ce47aff Merge: 6c6012ab96fd9 9235d5118fa4e Author: Arnd Bergmann Date: Thu May 5 16:30:15 2022 +0200 Merge tag 'arm-soc/for-5.19/drivers' of https://github.com/Broadcom/stblinux into arm/drivers This pull request contains Broadcom ARM/ARM64 SoCs drivers changes for 5.19, please pull the following: - Qintao adds a missing NULL check to the Broadcom PMB driver after a memory allocation - Li removes the redundant suppress_bind_attrs from the brcmstb_gisb driver which only has a probe and no remove function * tag 'arm-soc/for-5.19/drivers' of https://github.com/Broadcom/stblinux: bus: brcmstb_gisb: Remove the suppress_bind_attrs attribute of the driver soc: bcm: Check for NULL return of devm_kzalloc() Link: https://lore.kernel.org/r/20220504210942.1838248-4-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit f4b09d8d67efcc0620a9395b7a180bbd44066939 Author: Linus Walleij Date: Thu May 5 16:24:06 2022 +0200 pinctrl: stm32: Fix up errorpath after merge When merging the for_each_gpiochip_node() changes, I made some mistakes by not disabling the clocks on the errorpath, fix it up. Fixes: a0912083086d ("Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel") Cc: Stephen Rothwell Cc: Fabien Dessenne Reported-by: Andy Shevchenko Signed-off-by: Linus Walleij commit c3e3ca05dae37f8f74bb80358efd540911cbc2c8 Author: Zev Weiss Date: Wed May 4 21:31:52 2022 -0700 regulator: core: Fix enable_count imbalance with EXCLUSIVE_GET Since the introduction of regulator->enable_count, a driver that did an exclusive get on an already-enabled regulator would end up with enable_count initialized to 0 but rdev->use_count initialized to 1. With that starting point the regulator is effectively stuck enabled, because if the driver attempted to disable it it would fail the enable_count underflow check in _regulator_handle_consumer_disable(). The EXCLUSIVE_GET path in _regulator_get() now initializes enable_count along with rdev->use_count so that the regulator can be disabled without underflowing the former. Signed-off-by: Zev Weiss Fixes: 5451781dadf85 ("regulator: core: Only count load for enabled consumers") Link: https://lore.kernel.org/r/20220505043152.12933-1-zev@bewilderbeest.net Signed-off-by: Mark Brown commit 6c6012ab96fd9e9ffbd90ece0e7e41255d634a3c Merge: a4f7f93180a72 5b4018b959149 Author: Arnd Bergmann Date: Thu May 5 16:01:21 2022 +0200 Merge tag 'optee-rpc-arg-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers OP-TEE RPC argument cache Adds caching of the OP-TEE argument structure used to pass request to secure world. This reduces quite a bit of unnecessary alloc/free and possibly switching back and forth to secure work in order to register the buffers in some configurations, most notably FF-A. * tag 'optee-rpc-arg-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: optee: cache argument shared memory structs optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG optee: rename rpc_arg_count to rpc_param_count Link: https://lore.kernel.org/r/20220504201759.GA180315@jade Signed-off-by: Arnd Bergmann commit 669df99c957561dddf580ec269fb4255c41dabc1 Author: Christophe Leroy Date: Tue Mar 8 20:20:23 2022 +0100 powerpc: Add missing declaration in asm/drmem.h Don't rely on random inclusion of linux/of.h by users of asm/drmem.h Add a forward declaration of struct property and struct device_node. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5643ec410e51b749db0636471cb7979524f9ed0e.1646767214.git.christophe.leroy@csgroup.eu commit a4f7f93180a725d85a1156c7dbb86addd4e48fc3 Merge: 91f92d70387bb c7f8852d4216f Author: Arnd Bergmann Date: Thu May 5 16:00:19 2022 +0200 Merge tag 'scmi-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers Arm SCMI firmware driver updates/fixes for v5.19 The main theme for most of the changes this time is around the addition of the support for SCMI v3.1 specification changes. Though one of the main addition in the specification is the powercap protocol, that is still work in progress and this set includes all other changes bit and pieces scattered all around the different parts of the specification. There are few bugs discovered during the process and associated fixes and some refactoring to simplify the addition of v3.1 support. It mainly includes the support for extended names, few newly added notifications and async command support. Apart from v3.1 SCMI changes, OPTEE transport gets support for dynamic shared memory. * tag 'scmi-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (24 commits) firmware: arm_scmi: Fix late checks on pointer dereference firmware: arm_scmi: Support optee shared memory in the optee transport firmware: arm_scmi: Add SCMI v3.1 VOLTAGE_LEVEL_SET_COMPLETE firmware: arm_scmi: Add SCMI v3.1 clock notifications firmware: arm_scmi: Add checks for min/max limits in PERFORMANCE_LIMITS_SET firmware: arm_scmi: Add SCMI v3.1 perf power-cost in microwatts firmware: arm_scmi: Use common iterators in the perf protocol firmware: arm_scmi: Use common iterators in the voltage protocol firmware: arm_scmi: Use common iterators in the clock protocol firmware: arm_scmi: Add SCMI v3.1 SENSOR_AXIS_NAME_GET support firmware: arm_scmi: Use common iterators in the sensor protocol firmware: arm_scmi: Add iterators for multi-part commands firmware: arm_scmi: Parse clock_enable_latency conditionally firmware: arm_scmi: Set clock latency to U32_MAX if it is not supported firmware: arm_scmi: Add SCMI v3.1 protocol extended names support firmware: arm_scmi: Introduce a common SCMI v3.1 .extended_name_get helper firmware: arm_scmi: Split protocol specific definitions in a dedicated header firmware: arm_scmi: Remove unneeded NULL termination of clk name firmware: arm_scmi: Check CLOCK_RATE_SET_COMPLETE async response firmware: arm_scmi: Make name_get operations return a const ... Link: https://lore.kernel.org/r/20220504112906.3491985-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit eb4713c40a619046af99586743d48b9b4435d371 Author: Christophe Leroy Date: Tue Mar 8 20:20:22 2022 +0100 powerpc: Include asm/reg.h in asm/svm.h is_secure_guest() uses mfmsr(). Don't rely on users to include asm/reg.h, include it in asm/svm.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/482c82c8a29d5fb3ea279b34f107e0e775001344.1646767214.git.christophe.leroy@csgroup.eu commit 07071346bb76f4fbc2c1ca8894ec3d3ad2f22577 Author: Christophe Leroy Date: Tue Mar 8 20:20:21 2022 +0100 powerpc: Don't include asm/prom.h in asm/parport.h parport.h needs only of_irq.h, no need to go via asm/prom.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ec796ee56cf61f16ba24e62a9d3525d11931538c.1646767214.git.christophe.leroy@csgroup.eu commit 0aa297e73bba35bedadbd2d452c62d643dfd4a32 Author: Christophe Leroy Date: Tue Mar 8 20:20:20 2022 +0100 powerpc/64: Move pci_device_from_OF_node() out of asm/pci-bridge.h Move pci_device_from_OF_node() in pci64.c because it needs definition of struct device_node and is not worth inlining. ppc32.c already has it in pci32.c. That way pci-bridge.h doesn't need linux/of.h (Brought by asm/prom.h via asm/pci.h) Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3c88286b55413730d7784133993a46ef4a3607ce.1646767214.git.christophe.leroy@csgroup.eu commit f206fdd9d41bf7deb96219b8ca3499a5abd79b83 Author: Christophe Leroy Date: Sat Feb 12 08:36:17 2022 +0100 powerpc: Reduce csum_add() complexity for PPC64 PPC64 does everything in C, gcc is able to skip calculation when one of the operands in zero. Move the constant folding in PPC32 part. This helps GCC and reduces ppc64_defconfig by 170 bytes. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a4ca63dd4c4b09e1906d08fb814af5a41d0f3fcb.1644651363.git.christophe.leroy@csgroup.eu commit a553476c44fb6bd3dc3a7e5efef8f130f0f34850 Author: Nicholas Piggin Date: Wed Mar 30 19:37:19 2022 +0530 powerpc/64: remove system call instruction emulation emulate_step() instruction emulation including sc instruction emulation initially appeared in xmon. It was then moved into sstep.c where kprobes could use it too, and later hw_breakpoint and uprobes started to use it. Until uprobes, the only instruction emulation users were for kernel mode instructions. - xmon only steps / breaks on kernel addresses. - kprobes is kernel only. - hw_breakpoint only emulates kernel instructions, single steps user. At one point, there was support for the kernel to execute sc instructions, although that is long removed and it's not clear whether there were any in-tree users. So system call emulation is not required by the above users. uprobes uses emulate_step and it appears possible to emulate sc instruction in userspace. Userspace system call emulation is broken and it's not clear it ever worked well. The big complication is that userspace takes an interrupt to the kernel to emulate the instruction. The user->kernel interrupt sets up registers and interrupt stack frame expecting to return to userspace, then system call instruction emulation re-directs that stack frame to the kernel, early in the system call interrupt handler. This means the interrupt return code takes the kernel->kernel restore path, which does not restore everything as the system call interrupt handler would expect coming from userspace. regs->iamr appears to get lost for example, because the kernel->kernel return does not restore the user iamr. Accounting such as irqflags tracing and CPU accounting does not get flipped back to user mode as the system call handler expects, so those appear to enter the kernel twice without returning to userspace. These things may be individually fixable with various complication, but it is a big complexity for unclear real benefit. Furthermore, it is not possible to single step a system call instruction since it causes an interrupt. As such, a separate patch disables probing on system call instructions. This patch removes system call emulation and disables stepping system calls. Signed-off-by: Nicholas Piggin [minor commit log edit, and also get rid of '#ifdef CONFIG_PPC64'] Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a412e3b3791ed83de18704c8d90f492e7a0049c0.1648648712.git.naveen.n.rao@linux.vnet.ibm.com commit 54cdacd7d3b3c1a8dc10965f56c8b5eb8eda1a33 Author: Naveen N. Rao Date: Wed Mar 30 19:37:18 2022 +0530 powerpc: Reject probes on instructions that can't be single stepped Per the ISA, a Trace interrupt is not generated for: - [h|u]rfi[d] - rfscv - sc, scv, and Trap instructions that trap - Power-Saving Mode instructions - other instructions that cause interrupts (other than Trace interrupts) - the first instructions of any interrupt handler (applies to Branch and Single Step tracing; CIABR matches may still occur) - instructions that are emulated by software Add a helper to check for instructions belonging to the first four categories above and to reject kprobes, uprobes and xmon breakpoints on such instructions. We reject probing on instructions belonging to these categories across all ISA versions and across both BookS and BookE. For trap instructions, we can't know in advance if they can cause a trap, and there is no good reason to allow probing on those. Also, uprobes already refuses to probe trap instructions and kprobes does not allow probes on trap instructions used for kernel warnings and bugs. As such, stop allowing any type of probes/breakpoints on trap instruction across uprobes, kprobes and xmon. For some of the fp/altivec instructions that can generate an interrupt and which we emulate in the kernel (altivec assist, for example), we check and turn off single stepping in emulate_single_step(). Instructions generating a DSI are restarted and single stepping normally completes once the instruction is completed. In uprobes, if a single stepped instruction results in a non-fatal signal to be delivered to the task, such signals are "delayed" until after the instruction completes. For fatal signals, single stepping is cancelled and the instruction restarted in-place so that core dump captures proper addresses. In kprobes, we do not allow probes on instructions having an extable entry and we also do not allow probing interrupt vectors. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f56ee979d50b8711fae350fc97870f3ca34acd75.1648648712.git.naveen.n.rao@linux.vnet.ibm.com commit f31c618373f2051a32e30002d8eacad7bbbd3885 Author: Naveen N. Rao Date: Wed Mar 30 19:37:17 2022 +0530 powerpc: Sort and de-dup primary opcodes in ppc-opcode.h Some of the primary opcodes are duplicated. Remove those, and sort the rest of the primary opcodes to make it easy to read. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a05edf638a2638d708fc2db0272f6317837b5eab.1648648712.git.naveen.n.rao@linux.vnet.ibm.com commit 91f92d70387bbb116d3401666d8bffe4b9f98845 Merge: a37de2ad8e2d0 f3f3bdbd58cea Author: Arnd Bergmann Date: Thu May 5 15:59:27 2022 +0200 Merge tag 'ffa-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/drivers Arm FF-A firmware driver updates/fixes for v5.19 Couple of fixes to handle fragmented memory descriptors and incorrect UUID parameter passed to ffa_partition_probe. Another fix deals with the incorrect use of ffa_device's driver_data by the core driver. Apart from these fixes, there is an addition of ffa_dev_get_drvdata helper function and its use in optee driver. * tag 'ffa-updates-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: tee: optee: Use ffa_dev_get_drvdata to fetch driver_data firmware: arm_ffa: Add ffa_dev_get_drvdata helper function firmware: arm_ffa: Remove incorrect assignment of driver_data firmware: arm_ffa: Fix uuid parameter to ffa_partition_probe firmware: arm_ffa: Fix handling of fragmented memory descriptors Link: https://lore.kernel.org/r/20220504112853.3491961-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit a37de2ad8e2d0982329fdb8ec1021abf040ac53f Merge: a964ecd8a70a7 3e47235eaee09 Author: Arnd Bergmann Date: Thu May 5 15:56:54 2022 +0200 Merge tag 'tee-shm-vmalloc-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers TEE accept vmalloc()ed buffers for tee_shm_register_kernel_buf() * tag 'tee-shm-vmalloc-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: make tee_shm_register_kernel_buf vmalloc supported Link: https://lore.kernel.org/r/20220503192916.GA3288817@jade Signed-off-by: Arnd Bergmann commit a964ecd8a70a72577a5e1ca3ec4b74029e953ee9 Merge: 89c500b1fa6d1 a4b75fe8e1c15 Author: Arnd Bergmann Date: Thu May 5 15:48:31 2022 +0200 Merge tag 'tee-menu-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers Combine TEE config and menu in one line * tag 'tee-menu-for-v5.19' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: combine "config" and "menu" for TEE's menuconfig Link: https://lore.kernel.org/r/20220503191626.GA3278203@jade Signed-off-by: Arnd Bergmann commit 89c500b1fa6d1b6066342290f0abe3feec834b69 Merge: 4d7b3fd9f38f1 2ca065dc9468f Author: Arnd Bergmann Date: Thu May 5 15:21:00 2022 +0200 Merge tag 'reset-for-v5.19' of git://git.pengutronix.de/pza/linux into arm/drivers Reset controller updates for v5.19 Add Meson-S4 SoC reset controller support to reset-meson, AST2600 LPC reset controller support to reset-simple, and R9A07G054 USBPHY reset controller support to reset-rzg2l-usbphy-ctrl. Add ACPI _RST support to device_reset(), simplify the uniphier-glue reset driver using bulk API and devres and clean up its dt-bindings docs. Convert most dt-bindings docs from txt to yaml. * tag 'reset-for-v5.19' of git://git.pengutronix.de/pza/linux: dt-bindings: reset: st,sti-powerdown: Convert to yaml dt-bindings: reset: st,sti-picophyreset: Convert to yaml dt-bindings: reset: socfpga: Convert to yaml dt-bindings: reset: snps,axs10x-reset: Convert to yaml dt-bindings: reset: nuvoton,npcm-reset: Convert to yaml dt-bindings: reset: lantiq,reset: Convert to yaml dt-bindings: reset: bitmain,bm1880-reset: Convert to yaml dt-bindings: reset: berlin: Convert to yaml dt-bindings: reset: ath79: Convert to yaml dt-bindings: reset: amlogic,meson-axg-audio-arb: Convert to yaml dt-bindings: reset: uniphier-glue: Clean up clocks, resets, and their names using compatible string reset: Kconfig: Make RESET_RZG2L_USBPHY_CTRL depend on ARCH_RZG2L reset: ACPI reset support reset: simple: Add AST2600 compatible reset: reset-meson: add support for the Meson-S4 SoC Reset Controller dt-bindings: reset: add bindings for the Meson-S4 SoC Reset Controller dt-bindings: reset: Add compatible for Meson-S4 Reset Controller reset: uniphier-glue: Use devm_add_action_or_reset() reset: uniphier-glue: Use reset_control_bulk API Link: https://lore.kernel.org/r/20220503160057.46625-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann commit 1c1ed5a48411e1686997157c21633653fbe045c6 Author: Casper Andersson Date: Tue May 3 11:39:22 2022 +0200 net: sparx5: Add handling of host MDB entries Handle adding and removing MDB entries for host Signed-off-by: Casper Andersson Link: https://lore.kernel.org/r/20220503093922.1630804-1-casper.casan@gmail.com Signed-off-by: Paolo Abeni commit 86bfb916df5982911028b285dbfb7faf494b4a05 Merge: 7f42aa7b008c6 5644b66a9c63c Author: Bartosz Golaszewski Date: Thu May 5 15:03:29 2022 +0200 Merge branch 'irq/gpio-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into gpio/for-next This pulls in changes improving the handling of immutable irqchips in core gpiolib and several drivers. commit 7f42aa7b008c611743daf830e5ac4066e8ae276f Author: Jon Hunter Date: Wed May 4 15:44:06 2022 +0100 gpio: max77620: Make the irqchip immutable Commit 6c846d026d49 ("gpio: Don't fiddle with irqchips marked as immutable") added a warning to indicate if the gpiolib is altering the internals of irqchips. Following this change the following warning is now observed for the max77620 gpio driver ... WARNING KERN gpio gpiochip0: (max77620-gpio): not an immutable chip, please consider fixing it! Fix the above warning by making the max77620 gpio driver immutable. Signed-off-by: Jon Hunter Reviewed-by: Marc Zyngier Signed-off-by: Bartosz Golaszewski commit 9ac0ae97e34911177e3b59328055eccbd27cefca Author: Fabio Estevam Date: Thu May 5 08:19:05 2022 -0300 ARM: dts: imx7d-smegw01: Add support for i.MX7D SMEGW01 board Add support for the i.MX7D SMEGW01 board. This is a gateway board that supports the following peripherals: - eMMC / SD card - RTC - USB modem - Wifi via SDIO - Dual Ethernet - CAN - Serial SRAM Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0efdbec205bfd16a537c29eecd535afce195b4d2 Author: Fabio Estevam Date: Thu May 5 08:19:04 2022 -0300 dt-bindings: arm: fsl: Add Storopack i.MX7D SMEGW01 board Add DT compatible string for Storopack i.MX7D SMEGW01 board. Signed-off-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 5c39d087c98db6bc453e6f7911e7a9713f219a77 Author: Fabio Estevam Date: Thu May 5 08:19:03 2022 -0300 dt-bindings: vendor-prefixes: Add prefix for Storopack Add a vendor prefix entry for Storopack (https://www.storopack.com). Signed-off-by: Fabio Estevam Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 2d4fdc15f9b7c1cbc1800653f8c1a48ab615cbd8 Author: Justin Chen Date: Wed May 4 15:29:17 2022 -0700 dt-bindings: gpio: pca95xx: add entry for pca6408 The NXP PCA5608 is the 8-bit version of PCA5616. Signed-off-by: Justin Chen Acked-by: Florian Fainelli Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit a9e49635e263b5f304179ef537e0b056199c66d8 Author: Justin Chen Date: Wed May 4 15:29:16 2022 -0700 gpio: pca953xx: Add support for pca6408 Add support for pca6408 which is the 8-bit version of the pca6416. https://www.nxp.com/docs/en/data-sheet/PCA6408A.pdf Signed-off-by: Justin Chen Acked-by: Florian Fainelli Signed-off-by: Bartosz Golaszewski commit 7a0c5cb67166ba546ec52e2dc2145b8f89caa9fc Author: kernel test robot Date: Thu May 5 19:29:01 2022 +0800 soc: imx: fix semicolon.cocci warnings drivers/soc/imx/imx8mp-blk-ctrl.c:227:61-62: Unneeded semicolon drivers/soc/imx/imx8mp-blk-ctrl.c:192:61-62: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 556f5cf9568a ("soc: imx: add i.MX8MP HSIO blk-ctrl") CC: Lucas Stach Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Shawn Guo commit 6d5f2207447b28dc73c25b3907e7ee32ee66bdbd Author: Uwe Kleine-König Date: Mon May 2 19:08:27 2022 +0200 gpio: max732x: Drop unused support for irq and setup code via platform data The only user of max732x_platform_data is arch/arm/mach-pxa/littleton.c and it only uses .gpio_base. So drop the other members from the data struct and simplify the driver accordingly. The motivating side effect of this change is that the .remove() callback cannot return a nonzero error code any more which prepares making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Bartosz Golaszewski commit be60348a82f53bfef11321481fd0a7e5c24213ea Merge: d0f6cfb2bd165 ad47f8343a96c Author: Rafael J. Wysocki Date: Thu May 5 14:25:13 2022 +0200 Merge back earlier int340x thermal driver changes for 5.19. commit e14bd35ef44606c7d55ccb3660cededd421a14a1 Author: Andy Shevchenko Date: Mon May 2 15:04:55 2022 +0300 ASoC: cs43130: Re-use generic struct u16_fract Instead of custom data type re-use generic struct u16_fract. No changes intended. Signed-off-by: Andy Shevchenko Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220502120455.84386-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 101b096bc2549618f18bc08ae3a0e364b3c8fff1 Author: Shengjiu Wang Date: Thu May 5 15:34:07 2022 +0800 ASoC: fsl_micfil: fix the naming style for mask definition Remove the _SHIFT for the mask definition. Fixes: 17f2142bae4b ("ASoC: fsl_micfil: use GENMASK to define register bit fields") Signed-off-by: Shengjiu Wang Acked-by: Sascha Hauer Link: https://lore.kernel.org/r/1651736047-28809-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit ea706e5604e6d68ec7ec7243f0af0b569045e925 Author: Jayesh Choudhary Date: Thu May 5 16:42:26 2022 +0530 ASoC: ti: davinci-mcasp: Add dma-type for bcdma Set DMA type for ti-bcdma controller for AM62-SK. Acked-by: Peter Ujfalusi Signed-off-by: Jayesh Choudhary Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20220505111226.29217-1-j-luthra@ti.com Signed-off-by: Mark Brown commit ceb89acc4dc8f071f63f8d64442c7a5d768e4c9d Author: Peter Ujfalusi Date: Thu May 5 12:48:18 2022 +0300 ASoC: SOF: ipc4: Add support for mandatory message handling functionality Introduce the initial and mandatory IPC ops support for IPC4 to enable IPC communication with this new IPC protocol. This patch implements the following ops: tx_msg, rx_msg, set_get_data and get_reply. Co-developed-by: Rander Wang Signed-off-by: Rander Wang Co-developed-by: Bard Liao Signed-off-by: Bard Liao Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220505094818.10346-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ed85a6e6fe7c01faff4504af9d5569e8ba417999 Author: Peter Ujfalusi Date: Thu May 5 12:48:17 2022 +0300 ASoC: SOF: Add initial header file for ipc4 The header file contains essential structure definitions, description of bit fields and bits in the ipc4 header and an internally used ipc4 message container definition. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220505094818.10346-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 84c2dca3c3d4b8e011a2536fc7aaf2a2bdc77972 Author: Peter Ujfalusi Date: Thu May 5 12:48:16 2022 +0300 ASoC: SOF: Add rx_data pointer to snd_sof_ipc_msg struct The rx_data pointer can be used by IPC implementations to pass the received message (or part of the message, like the header) from platform code to generic, high level IPC code. IPC4 is going to be the first user of this as its implementation on Intel platforms detaches the header and payload and the rx cannot be handled in a similar way as it is implemented for ipc3. If the rx_data is dynamically allocated, it is up to the platform code to free it up. After the message reception handling (rx_msg ops) returned, the pointer via the msg->rx_data should be considered as invalid. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220505094818.10346-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit d77e745613680c54708470402e2b623dcd769681 Author: Marek Vasut Date: Sat Apr 30 04:51:44 2022 +0200 regmap: Add bulk read/write callbacks into regmap_config Currently the regmap_config structure only allows the user to implement single element register read/write using .reg_read/.reg_write callbacks. The regmap_bus already implements bulk counterparts of both, and is being misused as a workaround for the missing bulk read/write callbacks in regmap_config by a couple of drivers. To stop this misuse, add the bulk read/write callbacks to regmap_config and call them from the regmap core code. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Mark Brown Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Link: https://lore.kernel.org/r/20220430025145.640305-1-marex@denx.de Signed-off-by: Mark Brown commit 02678c08822f45246e5efa371c91c9e154e34e11 Merge: 0f03610b20ccf f346e96267cd7 Author: Rafael J. Wysocki Date: Thu May 5 14:22:23 2022 +0200 Merge back earlier cpufreq changes for 5.19. commit 117ef574074d69d87c222dbbbc744bc06cf5a833 Author: Douglas Anderson Date: Fri Apr 29 16:43:47 2022 -0700 device property: Fix recent breakage of fwnode_get_next_parent_dev() Due to a subtle typo, instead of commit 87ffea09470d ("device property: Introduce fwnode_for_each_parent_node()") being a no-op change, it ended up causing the display on my sc7180-trogdor-lazor device from coming up unless I added "fw_devlink=off" to my kernel command line. Fix the typo. Fixes: 87ffea09470d ("device property: Introduce fwnode_for_each_parent_node()") Signed-off-by: Douglas Anderson Reviewed-by: Saravana Kannan Reviewed-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 1fd02f6605b855b4af2883f29a2abc88bdf17857 Author: Julia Lawall Date: Sat Apr 30 20:56:54 2022 +0200 powerpc: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220430185654.5855-1-Julia.Lawall@inria.fr commit c14d31bae372e050b053f2511fb3f0f90c27e4f9 Author: Alexey Kardashevskiy Date: Wed Apr 6 17:00:38 2022 +1000 powerpc/boot: Stop using RELACOUNT So far the RELACOUNT tag from the ELF header was containing the exact number of R_PPC_RELATIVE/R_PPC64_RELATIVE relocations. However the LLVM's recent change [1] make it equal-or-less than the actual number which makes it useless. This replaces RELACOUNT in zImage loader with a pair of RELASZ and RELAENT. The vmlinux relocation code is fixed in commit d79976918852 ("powerpc/64: Add UADDR64 relocation support"). To make it more future proof, this walks through the entire .rela.dyn section instead of assuming that the section is sorter by a relocation type. Unlike d79976918852, this does not add unaligned UADDR/UADDR64 relocations as we are likely not to see those in practice - the zImage is small and very arch specific so there is a smaller chance that some generic feature (such as PRINK_INDEX) triggers unaligned relocations. [1] https://github.com/llvm/llvm-project/commit/da0e5b885b25cf4 Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406070038.3704604-1-aik@ozlabs.ru commit 3ba4289a3e7ff4a89a78c4f74d694a344e8d9cc9 Author: Christophe Leroy Date: Sat Apr 9 19:17:37 2022 +0200 powerpc: Simplify and move arch_randomize_brk() arch_randomize_brk() is only needed for hash on book3s/64, for other platforms the one provided by the default mmap layout is good enough. Move it to hash_utils.c and use randomize_page() like the generic one. And properly opt out the radix case instead of making an assumption on mmu_highuser_ssize. Also change to a 32M range like most other architectures instead of 8M. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/eafa4d18ec8ac7b98dd02b40181e61643707cc7c.1649523076.git.christophe.leroy@csgroup.eu commit 36e5f9ee776cb6db6ab8cb9b056076c4492b9871 Author: Christophe Leroy Date: Sat Apr 9 19:17:36 2022 +0200 powerpc/mm: Convert to default topdown mmap layout Select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT and remove arch/powerpc/mm/mmap.c This change reuses the generic framework added by commit 67f3977f805b ("arm64, mm: move generic mmap layout functions to mm") without any functional change. Comparison between powerpc implementation and the generic one: - mmap_is_legacy() is identical. - arch_mmap_rnd() does exactly the same allthough it's written slightly differently. - MIN_GAP and MAX_GAP are identical. - mmap_base() does the same but uses STACK_RND_MASK which provides the same values as stack_maxrandom_size(). - arch_pick_mmap_layout() is identical. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/518f9def87d3c889d5958103e7463cf45a2f673d.1649523076.git.christophe.leroy@csgroup.eu commit 5cf7f9a0a54e93a6d3361de5f4ba4358b054c6c2 Author: Christophe Leroy Date: Sat Apr 9 19:17:35 2022 +0200 powerpc/mm: Enable full randomisation of memory mappings Do like most other architectures and provide randomisation also to "legacy" memory mappings, by adding the random factor to mm->mmap_base in arch_pick_mmap_layout(). See commit 8b8addf891de ("x86/mm/32: Enable full randomization on i386 and X86_32") for all explanations and benefits of that mmap randomisation. At the moment, slice_find_area_bottomup() doesn't use mm->mmap_base but uses the fixed TASK_UNMAPPED_BASE instead. slice_find_area_bottomup() being used as a fallback to slice_find_area_topdown(), it can't use mm->mmap_base directly. Instead of always using TASK_UNMAPPED_BASE as base address, leave it to the caller. When called from slice_find_area_topdown() TASK_UNMAPPED_BASE is used. Otherwise mm->mmap_base is used. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/417fb10dde828534c73a03138b49621d74f4e5be.1649523076.git.christophe.leroy@csgroup.eu commit ab57bd7570d4393beb5a91bf092ed54e9c3574a2 Author: Christophe Leroy Date: Sat Apr 9 19:17:34 2022 +0200 powerpc/mm: Move get_unmapped_area functions to slice.c hugetlb_get_unmapped_area() is now identical to the generic version if only RADIX is enabled, so move it to slice.c and let it fallback on the generic one when HASH MMU is not compiled in. Do the same with arch_get_unmapped_area() and arch_get_unmapped_area_topdown(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b5d9c124e82889e0cb115c150915a0c0d84eb960.1649523076.git.christophe.leroy@csgroup.eu commit 1a0261fd3b218b6999f38dc791a66c9b7ddc7e8b Author: Christophe Leroy Date: Sat Apr 9 19:17:33 2022 +0200 powerpc/mm: Use generic_hugetlb_get_unmapped_area() Use the generic version of arch_hugetlb_get_unmapped_area() which is now available at all time. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/05f77014c619061638ecc52a0a4136eb04cc2799.1649523076.git.christophe.leroy@csgroup.eu commit 76a345ed16c63df9b02d3e374e8d5e39471174ad Author: Christophe Leroy Date: Sat Apr 9 19:17:32 2022 +0200 powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area() Use the generic version of arch_get_unmapped_area() which is now available at all time instead of its copy radix__arch_get_unmapped_area() To allow that for PPC64, add arch_get_mmap_base() and arch_get_mmap_end() macros. Instead of setting mm->get_unmapped_area() to either arch_get_unmapped_area() or generic_get_unmapped_area(), always set it to arch_get_unmapped_area() and call generic_get_unmapped_area() from there when radix is enabled. Do the same with radix__arch_get_unmapped_area_topdown() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/393be1fa386446443682fdb74544d733f68ef3bb.1649523076.git.christophe.leroy@csgroup.eu commit f693d38d9468101587175b1e62d7e4483b51d8f5 Author: Christophe Leroy Date: Sat Apr 9 19:17:31 2022 +0200 powerpc/mm: Remove CONFIG_PPC_MM_SLICES CONFIG_PPC_MM_SLICES is always selected by hash book3s/64. CONFIG_PPC_MM_SLICES is never selected by other platforms. Remove it. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/dc2cdc204de8978574bf7c02329b6cfc4db0bce7.1649523076.git.christophe.leroy@csgroup.eu commit 1408fca0c198471a5cd089742b9d3f9739073483 Author: Christophe Leroy Date: Sat Apr 9 19:17:30 2022 +0200 powerpc/mm: Make slice specific to book3s/64 Since commit 555904d07eef ("powerpc/8xx: MM_SLICE is not needed anymore") only book3s/64 selects CONFIG_PPC_MM_SLICES. Move slice.c into mm/book3s64/ Move necessary stuff in asm/book3s/64/slice.h and remove asm/slice.h Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4a0d74ef1966a5902b5fd4ac4b513a760a6d675a.1649523076.git.christophe.leroy@csgroup.eu commit 93ea910295cae7ad69571ed1570e5b5ca54a2f9e Author: Christophe Leroy Date: Sat Apr 9 19:17:29 2022 +0200 powerpc/mm: Move vma_mmu_pagesize() vma_mmu_pagesize() is only required for slices, otherwise there is a generic weak version doing the exact same thing. Move it to slice.c Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1302e000d529c93d07208f1fae90f938e7a551b4.1649523076.git.christophe.leroy@csgroup.eu commit 2cb4de085f383cb9289083d1bedbaad046f640eb Author: Christophe Leroy Date: Sat Apr 9 19:17:28 2022 +0200 mm: Add len and flags parameters to arch_get_mmap_end() Powerpc needs flags and len to make decision on arch_get_mmap_end(). So add them as parameters to arch_get_mmap_end(). Signed-off-by: Christophe Leroy Acked-by: Catalin Marinas Acked-by: Andrew Morton Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b556daabe7d2bdb2361c4d6130280da7c1ba2c14.1649523076.git.christophe.leroy@csgroup.eu commit 4b439e25e29ec336c0e71ef1d1b212c412526518 Author: Christophe Leroy Date: Sat Apr 9 19:17:27 2022 +0200 mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functions Unlike most architectures, powerpc can only define at runtime if it is going to use the generic arch_get_unmapped_area() or not. Today, powerpc has a copy of the generic arch_get_unmapped_area() because when selection HAVE_ARCH_UNMAPPED_AREA the generic arch_get_unmapped_area() is not available. Rename it generic_get_unmapped_area() and make it independent of HAVE_ARCH_UNMAPPED_AREA. Do the same for arch_get_unmapped_area_topdown() versus HAVE_ARCH_UNMAPPED_AREA_TOPDOWN. Do the same for hugetlb_get_unmapped_area() versus HAVE_ARCH_HUGETLB_UNMAPPED_AREA. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin Acked-by: Andrew Morton Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/77f9d3e592f1c8511df9381aa1c4e754651da4d1.1649523076.git.christophe.leroy@csgroup.eu commit 723820f3f77dc9f7ffdceb076ebcf6a5b91d0a27 Author: Christophe Leroy Date: Sat Apr 9 19:17:26 2022 +0200 mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT Commit e7142bf5d231 ("arm64, mm: make randomization selected by generic topdown mmap layout") introduced a default version of arch_randomize_brk() provided when CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT is selected. powerpc could select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT but needs to provide its own arch_randomize_brk(). In order to allow that, define generic version of arch_randomize_brk() as a __weak symbol. Signed-off-by: Christophe Leroy Acked-by: Andrew Morton Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b222f1ca06c850daf1b2f26afdb46c6dd97d21ba.1649523076.git.christophe.leroy@csgroup.eu commit d0a31acc34dc2921ad32a67a7534704114e64f82 Merge: f06351f8c0c85 af2d861d4cd2a Author: Michael Ellerman Date: Thu May 5 22:09:35 2022 +1000 Merge tag 'v5.18-rc4' into next Merge master into next, to bring in commit 5f24d5a579d1 ("mm, hugetlb: allow for "high" userspace addresses"), which is needed as a prerequisite for the series converting powerpc to the generic mmap logic. commit 1b30499ace5bdc1f5e84427f88d883784f61be4c Author: Daniels Umanovskis Date: Tue Apr 26 12:37:35 2022 +0000 USB: serial: ftdi_sio: clean up printk format specifier The latency is an unsigned int and should be printed as such (even if it only holds values in the range 0..255). Signed-off-by: Daniels Umanovskis Link: https://lore.kernel.org/r/20220426123714.2000-1-du@axentia.se [ johan: amend commit message ] Signed-off-by: Johan Hovold commit 582eb04e05ddd234ca32083c8457c6d409fd7b6a Author: Stephen Rothwell Date: Thu May 5 20:06:34 2022 +1000 Documentation: KVM: Fix title level for PSCI_SUSPEND The htmldoc build breaks in a funny way with: Sphinx parallel build error: docutils.utils.SystemMessage: /home/sfr/next/next/Documentation/virt/kvm/api.rst:6175: (SEVERE/4) Title level inconsistent: For arm/arm64: ^^^^^^^^^^^^^^ Swap the ^^s for a bunch of --s... Signed-off-by: Stephen Rothwell [maz: commit message] Signed-off-by: Marc Zyngier commit 7bc53f59fbcad34599c99d07d6be1ff01849d457 Author: Geert Uytterhoeven Date: Thu Mar 3 13:51:14 2022 +0100 ARM: shmobile: rcar-gen2: Drop comma after OF match table sentinel It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Add a comment to clarify the purpose of the empty element. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/baaa4df6284401eb126573eb1c8ea5a88705cc37.1646311858.git.geert+renesas@glider.be commit 3238f82df0cb7f8df000634ec16edf260fd039d8 Author: Geert Uytterhoeven Date: Thu Mar 3 13:50:54 2022 +0100 ARM: shmobile: Drop commas after dt_compat sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ab4acc22eebb96a0747eb301c878b24b1200736a.1646311825.git.geert+renesas@glider.be commit 27e7657a7cdc4b4a73bd5e4448e9ed733bae05c0 Author: Geert Uytterhoeven Date: Mon May 2 15:35:24 2022 +0200 soc: renesas: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. Hence reflect this in the SoC Family field. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/2bbecad7b6c24c0d5c1797b3f7f0733d5ba33842.1651497066.git.geert+renesas@glider.be commit 6071c4c2a319da360b0bf2bc397d4fefad10b2c8 Author: Christian König Date: Fri Apr 29 15:29:08 2022 +0200 drm/qxl: add drm_gem_plane_helper_prepare_fb We could need to wait for the pin to complete here. Signed-off-by: Christian König Cc: Dave Airlie Cc: Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220429134230.24334-4-christian.koenig@amd.com commit 8090bea32484d45b19b57577dee4519cbc28571c Author: Phil Edworthy Date: Tue May 3 12:55:54 2022 +0100 clk: renesas: rzg2l: Add support for RZ/V2M reset monitor reg The RZ/V2M doesn't have a matching set of reset monitor regs for each reset reg like the RZ/G2L. Instead, it has a single CPG_RST_MON reg which has a single bit per module. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-10-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 63804400f2a5ababe596b4ec908321d6b54f45aa Author: Phil Edworthy Date: Tue May 3 12:55:53 2022 +0100 clk: renesas: rzg2l: Make use of CLK_MON registers optional The RZ/V2M SoC doesn't use CLK_MON registers, so make them optional. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-9-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 75b0ad42ccd9a87873e91598116471d9991b09ea Author: Phil Edworthy Date: Tue May 3 12:55:52 2022 +0100 clk: renesas: rzg2l: Set HIWORD mask for all mux and dividers All of the muxes and dividers that can be modified require the HIWORD flags, so make the macros set them. It won't affect read only muxes and dividers. This will make the clock tables a little easier to read, particularly for new SoCs coming. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-8-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 8282fe0029e0db02fc21500790bfb621572fd28c Author: Phil Edworthy Date: Tue May 3 12:55:51 2022 +0100 clk: renesas: rzg2l: Add read only versions of the clk macros This just makes the clk tables easier to read. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220503115557.53370-7-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit ceb3bfab2da49f804ec629a20f731611b9ece207 Author: Phil Edworthy Date: Tue May 3 12:55:50 2022 +0100 clk: renesas: rzg2l: Move the DEF_MUX array size calc into the macro We only ever use ARRAY_SIZE() to populate the number of parents, so move this into the macro to always detect it automatically. This also makes the tables of clocks a little simpler. Similarly for the DEF_SD_MUX macro. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220503115557.53370-6-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 4a526957e6368597dea08175a67f0e15569f3958 Author: Phil Edworthy Date: Tue May 3 12:55:48 2022 +0100 dt-bindings: clock: renesas,rzg2l: Document RZ/V2M SoC Document the device tree binding for the Renesas RZ/V2M (r9a09g011) SoC. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220503115557.53370-4-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 049bddcb893141503923bf0dfc518136269c0a24 Merge: 53c58c08b454a 96055bf71ab16 Author: Geert Uytterhoeven Date: Thu May 5 12:10:49 2022 +0200 Merge tag 'renesas-r9a09g011-dt-binding-defs-tag' into renesas-clk-for-v5.19 Renesas RZ/V2M DT Binding Definitions Clock definitions for the Renesas RZ/V2M (R9A09G011) SoC, shared by driver and DT source files. commit 53c58c08b454aea3c9c9ceda600567436134e6a2 Author: Geert Uytterhoeven Date: Mon May 2 14:35:02 2022 +0200 clk: renesas: r9a07g044: Fix OSTM1 module clock name Fix a typo in the name of the "ostm1_pclk" clock. This change has no run-time impact. Fixes: 161450134ae9bab3 ("clk: renesas: r9a07g044: Add OSTM clock and reset entries") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e0eff1f57378ec29d0d3f1a7bdd7e380583f736b.1651494871.git.geert+renesas@glider.be commit 84c9829d16d86a09703d9f2c8dac3816c56bcdcd Author: Biju Das Date: Sun May 1 09:34:50 2022 +0100 clk: renesas: r9a07g043: Add clock and reset entries for ADC Add clock and reset entries for ADC block in CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501083450.26541-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b67685300478ff768bde0d06a2a664a66223945f Author: Biju Das Date: Sun May 1 09:34:49 2022 +0100 clk: renesas: r9a07g043: Add TSU clock and reset entry Add TSU clock and reset entry to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501083450.26541-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 14d8857d8266bce49dc4ee0d71e6cd79335d7c8c Author: Biju Das Date: Sun May 1 09:34:48 2022 +0100 clk: renesas: r9a07g043: Add RSPI clock and reset entries Add RSPI{0,1,2} clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501083450.26541-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4e683604cfc1322f609afcbe053e6821832d5f19 Author: Biju Das Date: Sun May 1 09:34:47 2022 +0100 clk: renesas: r9a07g043: Add clock and reset entries for SPI Multi I/O Bus Controller Add clock and reset entries for SPI Multi I/O Bus Controller. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220501083450.26541-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 67f80edf8390fd8201bb285fe2b55df9e2e5edbe Author: Biju Das Date: Sat Apr 30 12:41:56 2022 +0100 clk: renesas: r9a07g044: Add DSI clock and reset entries Add DSI clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-10-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6f6178f1e1250d959ef19f408f0e392ea29de665 Author: Biju Das Date: Sat Apr 30 12:41:55 2022 +0100 clk: renesas: r9a07g044: Add LCDC clock and reset entries Add LCDC clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-9-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 31d5ef2f565d2378d9a615f89e4ff86d3d87eb80 Author: Biju Das Date: Sat Apr 30 12:41:54 2022 +0100 clk: renesas: r9a07g044: Add M4 Clock support Add support for M4 clock which is sourced from pll2_533_div2. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-8-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 359f10c1b02d3c65c7eba6146e5b7962f0abbd93 Author: Biju Das Date: Sat Apr 30 12:41:53 2022 +0100 clk: renesas: r9a07g044: Add M3 Clock support Add support for M3 clock which is sourced from DSI divider connected to PLL5_4 mux. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-7-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 300d95c5bbb4cb59a149e436ed162a0ca09cdca1 Author: Biju Das Date: Sat Apr 30 12:41:52 2022 +0100 clk: renesas: r9a07g044: Add {M2, M2_DIV2} Clocks support Add support for {M2, M2_DIV2} clocks which is sourced from pll3_533. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 60191843db7812dba4fdd2790a2d646721e13b21 Author: Biju Das Date: Sat Apr 30 12:41:51 2022 +0100 clk: renesas: r9a07g044: Add M1 clock support Add support for M1 clock which is sourced from FOUTPOSTDIV. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 46bb3e15e8c7e6c045f619e91b380ff090669b83 Author: Biju Das Date: Sat Apr 30 12:41:50 2022 +0100 clk: renesas: rzg2l: Add DSI divider clk support M3 clock is sourced from DSI Divider (DSIDIVA * DSIDIVB) This patch add support for DSI divider clk by combining DSIDIVA and DSIDIVB. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6cc859cae9aa8c42e8347e2806232bdffeb1b33d Author: Biju Das Date: Sat Apr 30 12:41:49 2022 +0100 clk: renesas: rzg2l: Add PLL5_4 clk mux support Add PLL5_4 clk mux support to select clock from clock sources FOUTPOSTDIV and FOUT1PH0. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1561380ee72f55e3a86856ee046532c18d3e9855 Author: Biju Das Date: Sat Apr 30 12:41:48 2022 +0100 clk: renesas: rzg2l: Add FOUTPOSTDIV clk support PLL5 generates FOUTPOSTDIV clk and is sourced by LCDC/DSI modules. The FOUTPOSTDIV is connected to PLL5_4 MUX. Video clock is sourced from DSI divider which is connected to PLL5_4 MUX. This patch adds support for generating FOUTPOSTDIV clk. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220430114156.6260-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 96055bf71ab1629cdedff15bcbc04609cfa1f198 Author: Phil Edworthy Date: Tue May 3 12:55:47 2022 +0100 dt-bindings: clock: Add r9a09g011 CPG Clock Definitions Define RZ/V2M (R9A09G011) Clock Pulse Generator module clock outputs (CPG_CLK_ON* registers), and reset definitions (CPG_RST_* registers) in Section 48.5 ("Register Description") of the RZ/V2M Hardware User's Manual (Rev. 1.10, Sep. 2021). Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220503115557.53370-3-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit fc883ed5a43e5f94894216896d74190ecf1356ff Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:12 2022 +0200 pinctrl: renesas: checker: Add reserved field checks Add checks for discovering registers with reserved fields that could benefit from being described using variable-width reserved field shorthands, reducing kernel size. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f5a5159ba7b396e6f09dd3f23c864a74ed8e342d.1649865241.git.geert+renesas@glider.be commit 753278b4cb23869c79032b5dc655e0f06b3b2f68 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:11 2022 +0200 pinctrl: renesas: sh7786: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 79 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/22487451ff7d8cce0182354c9553f3b171cc34d9.1649865241.git.geert+renesas@glider.be commit 63a32f8286b916a17d18b64294940ab2fd45eed4 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:10 2022 +0200 pinctrl: renesas: sh7785: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 150 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/07a238f13f80674d86719a5e869c65a2e0b8c1c1.1649865241.git.geert+renesas@glider.be commit 2439a0dde4f3215100e11de78b55e90dc4b10bad Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:09 2022 +0200 pinctrl: renesas: sh7757: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 115 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/05c69ca8710134bb96ec8f7d18bafe42418f3510.1649865241.git.geert+renesas@glider.be commit 3a0a3c1be88780c720220fed2159bcd255a60ba9 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:08 2022 +0200 pinctrl: renesas: sh7734: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 161 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/18e476c0a9f0af5b5d511d1c4922c6e299d1847a.1649865241.git.geert+renesas@glider.be commit 2a1b67b565bb34c88fda8dc65fa2b5a8e301cf97 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:07 2022 +0200 pinctrl: renesas: sh7724: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 8 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/696dcad42a8b8395276301eb5dd5c5a895826f35.1649865241.git.geert+renesas@glider.be commit 98edc79d9adab6d5dbe4be2f488b3f0195427e8e Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:06 2022 +0200 pinctrl: renesas: sh7723: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 105 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5d7ef2fa02c2137d2d243fc183d18220c9aaf7b8.1649865241.git.geert+renesas@glider.be commit 72db29175f40d056e50dfc6a4b13d019f8e37c75 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:05 2022 +0200 pinctrl: renesas: sh7722: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 396 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c3965b6f9ea603b185924136f859c6eca7d5d6f4.1649865241.git.geert+renesas@glider.be commit aa9c0a767fbed2cb0e7aa499973512d3b8044a04 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:04 2022 +0200 pinctrl: renesas: sh7720: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 128 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4b290f93a7edb1f91c97da90e67b7f6f3df62951.1649865241.git.geert+renesas@glider.be commit 064aa9aabe5119590ce629bd44483764dcf5109c Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:03 2022 +0200 pinctrl: renesas: sh73a0: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 154 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e74738b403cc15b3407e7568d323fdae8e7b30dd.1649865241.git.geert+renesas@glider.be commit d567210e4b8ab2cc49cf087ac81f3f0a6bc8e274 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:02 2022 +0200 pinctrl: renesas: sh7269: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 406 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/feb1e865c2b6abbc0db24243143ea09ad143f6df.1649865241.git.geert+renesas@glider.be commit 78fc20c155411d26f4a549959f3e3c7da9805a1e Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:01 2022 +0200 pinctrl: renesas: sh7264: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 572 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/434c274f626b2eab3539fe2ab80c6eda164e07fa.1649865241.git.geert+renesas@glider.be commit 256c14196fe9424a0bfe7bdb316b15d2084e6e06 Author: Geert Uytterhoeven Date: Wed Apr 13 19:24:00 2022 +0200 pinctrl: renesas: sh7203: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 281 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c625b4eee298b88c2ee47ed80b0dea5d02ed56d1.1649865241.git.geert+renesas@glider.be commit 170285f4c5f34c38155440d0c375eca3654b63a5 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:59 2022 +0200 pinctrl: renesas: r8a779f0: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 183 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e50f9c8ef1261b7ceb6b1be637d4019fe7312250.1649865241.git.geert+renesas@glider.be commit b9f01b20ccfa2d352c81d5431a3116bceb2122b5 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:58 2022 +0200 pinctrl: renesas: r8a779a0: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 556 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7db3751ecf96fcc469bd14eeb02d69e565956151.1649865241.git.geert+renesas@glider.be commit ec255e1c15c4f8333d0539648b6aaf034eb0fd86 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:57 2022 +0200 pinctrl: renesas: r8a77995: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 422 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d74af80fdb7b6d78b10634238a88e55a139e5c22.1649865241.git.geert+renesas@glider.be commit be525de9e811645c1c32014cad29cb2f5b740def Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:56 2022 +0200 pinctrl: renesas: r8a77990: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 226 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/924ba4505e33180e078ca72a1db8db13c193cbea.1649865241.git.geert+renesas@glider.be commit 23dbafd81972f168c39fc9fd6327c0abbe92fd4d Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:55 2022 +0200 pinctrl: renesas: r8a77980: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 198 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0bf6b069a794b3c56c0c9311ac4b2ada577a9cb7.1649865241.git.geert+renesas@glider.be commit 37362c77de88cebf0c32dafa1df2e71735f83900 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:54 2022 +0200 pinctrl: renesas: r8a77970: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 268 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/33dd9bc41df888f132e2e6921d2ff38225b68105.1649865241.git.geert+renesas@glider.be commit 34856c5029683890435d48b44d11bf254fec2895 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:53 2022 +0200 pinctrl: renesas: r8a7796: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 496 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/81f3586749bb1117c5636e9a9663d25e77cbe158.1649865241.git.geert+renesas@glider.be commit efd5ee63e9d090ac5dca57abb3ef6d518c496a7d Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:52 2022 +0200 pinctrl: renesas: r8a77965: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 496 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2aff2f4c1ed6d834370ce6dd9379c8c93bfc0a92.1649865241.git.geert+renesas@glider.be commit d5ea70ead8f4800bde283eb66a8a551aff86af09 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:51 2022 +0200 pinctrl: renesas: r8a77951: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 496 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/cd59cc2e0f55f0dcede1356f73a9e69fe09bf5eb.1649865241.git.geert+renesas@glider.be commit 8e8fb812923b8755abdecdd9caf75c3c6e86c5c2 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:50 2022 +0200 pinctrl: renesas: r8a77950: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 473 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a1617d24af2b9b3224ce84c0ada535565009fdda.1649865241.git.geert+renesas@glider.be commit 5b7dda3a49393829296676d210b519edfe69c22a Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:49 2022 +0200 pinctrl: renesas: r8a7792: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 257 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0f211d493a0cfbcd96d84a709d21bea51c7385ae.1649865241.git.geert+renesas@glider.be commit 9794156d6b6322d64ad6b692e19773571c267f8a Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:48 2022 +0200 pinctrl: renesas: r8a7779: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 81 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ecc7377d2992694226dcf055bed0b617701a3d71.1649865241.git.geert+renesas@glider.be commit ade1ef9904ecd81fcda302abfd81e1aaccb238a7 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:47 2022 +0200 pinctrl: renesas: r8a77470: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 70 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c5183fcb3dd417d57ced0f60d091e2c7d37e1c8c.1649865241.git.geert+renesas@glider.be commit 72ee7f9b6fd34076a8c6d443450b9f1e5208e3fc Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:46 2022 +0200 pinctrl: renesas: r8a7740: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 230 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a18fb98a4eefe648a1b1c5b5913dbeee092674c4.1649865241.git.geert+renesas@glider.be commit 9cad77c5c817688048d38d66e2c679ad25ca1a0f Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:45 2022 +0200 pinctrl: renesas: r8a73a4: Optimize fixed-width reserved fields Describe registers with fixed-width register fields and many reserved fields using the PINMUX_CFG_REG_VAR() macro, as the latter supports a shorthand not requiring dummy values. This reduces kernel size by 126 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f835c2ff5bb07e541f6377b16f0a32c5aad2a47f.1649865241.git.geert+renesas@glider.be commit 0479e084f748d49ea170bbcc5a0b8780c370f4f7 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:44 2022 +0200 pinctrl: renesas: sh7734: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 174 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/3ab96d28494b8c5a2d427ba25f31a04ca0cc7305.1649865241.git.geert+renesas@glider.be commit cdc29f1088831fe87bf30f107214955f2b55dcbe Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:43 2022 +0200 pinctrl: renesas: r8a779f0: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 164 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c98e577996a71ae96145ee6da94aa18fd9ea85b9.1649865241.git.geert+renesas@glider.be commit 599e16c1478dc6d08c0eef00e109e5b5c2315864 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:42 2022 +0200 pinctrl: renesas: r8a779a0: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 140 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/807b2a7e02be2fac50c280961a4841813ab13cd8.1649865241.git.geert+renesas@glider.be commit de3561ba2ecc463c122aa5fbc29a0e98506b817d Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:41 2022 +0200 pinctrl: renesas: r8a77995: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 246 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7098704f89bb702c28036c567d3222521ff60f86.1649865241.git.geert+renesas@glider.be commit f1bef7db75e7609a80e851a0ff1cd5d0eaaf4b6d Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:40 2022 +0200 pinctrl: renesas: r8a77990: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 40 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c032fce3fff6a6a63dc90f9ab8dfe1f4f3cf6ad6.1649865241.git.geert+renesas@glider.be commit 10890813b275ca5f43f495da8f323c0cc80b1f6c Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:39 2022 +0200 pinctrl: renesas: r8a77980: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 168 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c81b26815dff2e191b8c415624a20aa3b4725d23.1649865241.git.geert+renesas@glider.be commit 289acf3a99615d5282dca870093e4523f4e8f8ef Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:38 2022 +0200 pinctrl: renesas: r8a77970: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 164 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f2dda82454bb1b0c97f842de2c9fa68da05ef3e6.1649865241.git.geert+renesas@glider.be commit 6088f726c9d055bf44181fd479c52b3e5d2605e8 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:37 2022 +0200 pinctrl: renesas: r8a77965: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 148 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1cf52b1f93e8af593a60f65d8a848d1ebb24cac6.1649865241.git.geert+renesas@glider.be commit 6c0c5abc07c3a462b4a0595783e37ff6dae12e26 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:36 2022 +0200 pinctrl: renesas: r8a7796: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 148 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/433f5ddcc2dba7352825cba007b99b8e654d4c61.1649865241.git.geert+renesas@glider.be commit 5e0857fd53bf1df7f1fb6e1223dc6ee786c4da23 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:35 2022 +0200 pinctrl: renesas: r8a77951: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 152 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/35d0ff4881335889002718540101bcdb8e7f5b5a.1649865241.git.geert+renesas@glider.be commit 18a5e80dba42d0e573bcaed74ff6136f51d581cc Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:34 2022 +0200 pinctrl: renesas: r8a77950: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 232 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1866c399e94408439a469c12dc53557b55a00f3a.1649865241.git.geert+renesas@glider.be commit 6d261290d3a6247aa95afab69cb124c38865077a Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:33 2022 +0200 pinctrl: renesas: r8a7794: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 201 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2fa43bd38c5cf260e89ae1da38d1a217ab762589.1649865241.git.geert+renesas@glider.be commit cb53eb5455f9b382ade7f1ca0f53c7cc399dd713 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:32 2022 +0200 pinctrl: renesas: r8a7792: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 784 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d39a52cf972a450ef5a0989ba7e448115a8147ba.1649865241.git.geert+renesas@glider.be commit d3fcaad605f48543b2413515cc439af34b2a66cc Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:31 2022 +0200 pinctrl: renesas: r8a7791: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 349 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/972808be595fd742afc6b7fc89751ca4788d6f62.1649865241.git.geert+renesas@glider.be commit 9bfb06a378d8af8ac142ee6eaf6c6988d44245c0 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:30 2022 +0200 pinctrl: renesas: r8a7790: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 445 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/842d8060422a9b67dfac4af6d9325d0d99cf50dc.1649865241.git.geert+renesas@glider.be commit 5ca9a715f572d3a7a3c63517ef34cc9de91a15ac Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:29 2022 +0200 pinctrl: renesas: r8a7779: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 197 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4b468118e0da681c860ed750976a990a0930dcba.1649865241.git.geert+renesas@glider.be commit 0f1dd62cab2c3cfa9e1940f7eb1e31b6d2ff330f Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:28 2022 +0200 pinctrl: renesas: r8a7778: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 142 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1af5225c81ac871a461f7d824619275e2e0ed8df.1649865241.git.geert+renesas@glider.be commit 287f1ee38a94d577ed768fb8642c0d3668cbdb46 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:27 2022 +0200 pinctrl: renesas: r8a77470: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 114 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/bc8f9647bbf677ac67cbdb34cf0c8fbaf62fb7fc.1649865241.git.geert+renesas@glider.be commit ead4017fcd5e900a7a357bbbdce2b6e4bbcf3b53 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:26 2022 +0200 pinctrl: renesas: emev2: Use shorthands for reserved fields Replace the full descriptions of reserved register fields by shorthands with a negative field width, and merge adjacent reserved fields. This reduces kernel size by 769 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/616afe67d3b4d2cbf5f43876f9aa7b258862ceaa.1649865241.git.geert+renesas@glider.be commit 44778aec5ed9b541bc0ec61d475c35f3087e8024 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:25 2022 +0200 pinctrl: renesas: rmobile: Mark unused PORTCR bits reserved The PULMD bits and the SEC bit in the PORTCR register descriptions on SH/R-Mobile SoCs are either unused or unsupported. Describe them as reserved bits using a negative field width value, and drop the corresponding dummy enum IDs. This reduces kernel size by 2832 (R-Mobile APE6), 2544 (R-Mobile A1), and/or 3228 (SH-Mobile AG5) bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1b123d8f04c2314d5a7a87004971868ba2176499.1649865241.git.geert+renesas@glider.be commit 6210905586ae7f40e6f581e963cbf298dd13d462 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:24 2022 +0200 pinctrl: renesas: Add shorthand for reserved register fields Currently, reserved register fields must be fully described using dummy enum IDs (zeroes), one for each possible state (2^bits states). Add support for describing reserved fields using negative field width values as shorthands, thus removing the need for dummy values. Apart from the obvious size reduction due to the removal of the dummy values, this will also enable merging adjacent reserved fields into a single field, reducing the number of fields to describe, and thus kernel size. Update the checker accordingly. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/cad7c92ef039d9a4d039807efc15886a7aa862be.1649865241.git.geert+renesas@glider.be commit 7fefb7c0594fc8f4eb88646e5eb767a56529a5a0 Author: Geert Uytterhoeven Date: Wed Apr 13 19:23:23 2022 +0200 pinctrl: renesas: r8a77470: Use fixed-width description for IPSR regs All fields in the IPSR registers on RZ/G1C have the same width, but the driver describes them using the PINMUX_CFG_REG_VAR() macro, which is intended for fields with different widths. Convert the description to use the PINMUX_CFG_REG() macro for fixed-width fields instead. This reduces kernel size by 162 bytes. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f6f26a0dfd16050ead83daf2b9fabeb8b26821a6.1649865241.git.geert+renesas@glider.be commit 033a26dcbe10476c5203f590dce0537fac802d03 Author: Geert Uytterhoeven Date: Mon May 2 14:40:58 2022 +0200 dt-bindings: soc: renesas: Move renesas,rzg2l-sysc from arm to soc The Renesas RZ/{G2L,V2L} System Controller (SYSC) DT binding is not really a power-related DT binding, hence it does not belong under Documentation/devicetree/bindings/power/. Move it to Documentation/devicetree/bindings/soc/renesas/. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/a47015888f99476a5206a556dce93503494d9a73.1651495078.git.geert+renesas@glider.be commit 5652dc5cd96765d236ada1006db1d467c523c3b4 Author: Biju Das Date: Sun May 1 09:25:08 2022 +0100 dt-bindings: memory: renesas,rpc-if: Document RZ/G2UL SoC Document RZ/G2UL RPC-IF bindings. RZ/G2UL RPC-IF is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-rpc-if" will be used as a fallback. Signed-off-by: Biju Das Acked-by: Rob Herring Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220501082508.25511-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 596c35b1440e7e8a954c87ae73b3f7c4e877b055 Author: Javier Martinez Canillas Date: Wed May 4 10:02:12 2022 +0200 drm/todo: Add entry for using kunit in the subsystem The Kernel Unit Testing (KUnit) framework provides a common framework for unit tests within the Linux kernel. Having a test suite would allow to identify regressions earlier. Signed-off-by: Javier Martinez Canillas Acked-by: Daniel Vetter Acked-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220504080212.713275-1-javierm@redhat.com commit 9fa2762110dd5d4e3ccadcd6bc1e5c7c517cbe4d Author: Sven Schwermer Date: Thu Apr 7 09:32:25 2022 +0200 leds: Add PWM multicolor driver By allowing to group multiple monochrome PWM LEDs into multicolor LEDs, all involved LEDs can be controlled in-sync. This enables using effects using triggers, etc. Signed-off-by: Sven Schwermer Reviewed-by: Andy Shevchenko Signed-off-by: Pavel Machek commit ac123741b8f52311af118f8a052b1cbbed041291 Author: Sven Schwermer Date: Thu Apr 7 09:32:24 2022 +0200 dt-bindings: leds: Add multicolor PWM LED bindings This allows to group multiple PWM-connected monochrome LEDs into multicolor LEDs, e.g. RGB LEDs. Signed-off-by: Sven Schwermer Reviewed-by: Rob Herring Signed-off-by: Pavel Machek commit 21c0d13e3dd64581bab0ef4b4d0fea7752cc236b Author: Sven Schwermer Date: Thu Apr 7 09:32:23 2022 +0200 dt-bindings: leds: Optional multi-led unit address The unit address does not make sense in all cases the multi-led node is used, e.g. for the upcoming PWM multi-color LED driver. Signed-off-by: Sven Schwermer Reviewed-by: Rob Herring Signed-off-by: Pavel Machek commit 835fc89e249e07ec5c1587a297e30db8f2adcea3 Author: Linus Walleij Date: Mon Apr 4 22:35:22 2022 +0200 leds: regulator: Make probeable from device tree The regulator LED can easily be adapted to probe from the device tree. We switch led_classdev_register() to led_classdev_register_ext() passing some struct led_init_data init_data that we leave NULL save the fwnode if platform data isn't present so that it will be populated from the device tree. If we have platform data we set up the name from the platform data but using init_data instead. Cc: Antonio Ospite Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 4c350c658f946dae81dbbaff25da0a03e9bb0c4b Author: Linus Walleij Date: Mon Apr 4 22:35:21 2022 +0200 leds: regulator: Add dev helper variable Instead of repeating the hard to read &pdev->dev just create a local struct device *dev in probe(). Cc: Antonio Ospite Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 5a71917f3b43b9fd6d6ff7b0622a85153bf184cb Author: Linus Walleij Date: Mon Apr 4 22:35:20 2022 +0200 dt-bindings: leds: Add regulator-led binding The regulator is a LED connected directly to a regulator and with its brightness controlled by the voltage of the regulator. Cc: devicetree@vger.kernel.org Cc: Antonio Ospite Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit f41ef4c2ee99d255c82d8ac6f720f28116340869 Author: Kefeng Wang Date: Mon Apr 11 17:24:55 2022 +0800 arm64: mm: Cleanup useless parameters in zone_sizes_init() Directly use max_pfn for max and no one use min, kill them. Reviewed-by: Vijay Balakrishna Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20220411092455.1461-4-wangkefeng.wang@huawei.com Signed-off-by: Catalin Marinas commit d80b9c8422fa8e02b9a92b90fbb328e3e069c649 Author: Markus Niebel Date: Mon May 2 11:49:01 2022 +0200 arm64: dt: imx8mp: support pwm polarity inversion The i.MX8M Plus has the same PWM IP as i.MX6 / i.MX7. This IP and the driver supporting pwm polarity inversion. Switch CPU device tree fragment to use 3 pwm-cells. Tested on MBa8MPxL mainboard. Signed-off-by: Markus Niebel Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 6bc1e58055c1ea3ff31335637f62a1b77da5633d Author: Markus Niebel Date: Mon May 2 11:49:00 2022 +0200 arm64: dt: imx8mn: support pwm polarity inversion The i.MX8M Nano has the same PWM IP as i.MX6 / i.MX7. This IP and the driver supporting pwm polarity inversion. Switch CPU device tree fragment to use 3 pwm-cells. Signed-off-by: Markus Niebel Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 957aef026c462f27419082c61cd170f6e2d5c833 Author: Markus Niebel Date: Mon May 2 11:48:59 2022 +0200 arm64: dt: imx8mm: support pwm polarity inversion The i.MX8M Mini has the same PWM IP as i.MX6 / i.MX7. This IP and the driver supporting pwm polarity inversion. Switch CPU device tree fragment to use 3 pwm-cells and correct board device trees. Signed-off-by: Markus Niebel Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 15ca3f00a1e3a56811371a63bf0c067603226eae Author: Markus Niebel Date: Mon May 2 11:48:58 2022 +0200 arm64: dt: imx8mq: support pwm polarity inversion The i.MX8MQ has the same PWM IP as i.MX6 / i.MX7. This IP and the driver supporting pwm polarity inversion. Switch CPU device tree fragment to use 3 pwm-cells and correct board device trees. Signed-off-by: Markus Niebel Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 22463f7cd0e17c4b60a0d8ad6c10f62c76840344 Author: Tim Harvey Date: Fri Apr 29 09:20:30 2022 -0700 arm64: dts: imx8mm-venice-gw7901: remove unnecessary cpu temp override Remove the unnecessary cpu_alert0 and cpu_crit0 TMU node overrides as these are added dynamically by boot firmware based on CPU temperature grade. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit dd6fa8604301248935b0cf15b8ff6352dc5f7637 Author: Tim Harvey Date: Fri Apr 29 09:19:44 2022 -0700 arm64: dts: imx8mm-venice-gw7902: add vdd_5p0 ADC channel Add missing vdd_5p0 ADC channel for the GW7902 boards. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 450cec4f7d78fb2e04e3f7f5360e62f4837a4b68 Author: Tim Harvey Date: Fri Apr 29 09:16:29 2022 -0700 arm64: dts: imx8m*venice: add missing clock-names to pcie_phy Define the missing clock-names property for the pcie_phy required by the fsl,imx8-pcie-phy dt bindings. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 0e1759b60ffeff949ea18c831b22822527bd6ad7 Author: Minghao Chi Date: Thu May 5 02:22:08 2022 +0000 drm: simplify the return expression of ast_drm_resume() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220505022208.57157-1-chi.minghao@zte.com.cn commit 931e3f3a0e997c41eafbc88e4fc07ba9fef28f29 Author: Thomas Zimmermann Date: Mon May 2 16:25:14 2022 +0200 drm/mgag200: Protect concurrent access to I/O registers with lock Add a mutex lock to protect concurrent access to I/O registers against each other. This happens between invocation of commit- tail functions and get-mode operations. Both with use the CRTC index registers MGA1064_GEN_IO_DATA and MGA1064_GEN_IO_CTL. Concurrent access can lead to failed mode-setting operations. v2: * fix typo in commit description (Jocelyn) * add comment to explain rmmio_lock Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-4-tzimmermann@suse.de commit f870231fdd6ce2c6c040a3584a2eac97ae473780 Author: Thomas Zimmermann Date: Mon May 2 16:25:13 2022 +0200 drm/ast: Protect concurrent access to I/O registers with lock Add a mutex lock to protect concurrent access to I/O registers against each other. This happens between invocation of commit- tail functions and get-mode operations. Both with use the CRTC index register AST_IO_CRTC_PORT. Concurrent access can lead to failed mode-setting operations. v2: * fix typo in commit description (Jocelyn) Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Acked-by: Daniel Vetter Reported-by: KuoHsiang Chou Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-3-tzimmermann@suse.de commit 9882948322874b1ffdd559e6887397de4c903440 Author: Chanho Park Date: Wed May 4 16:51:54 2022 +0900 arm64: dts: exynos: switch UFS clock node in ExynosAutov9 Use cmu_fsys's clock node instead of dummy UFS clock node. Signed-off-by: Chanho Park Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-13-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit 4c882968d434c9968f53fbefa3ba6e64ff33d6a0 Author: Chanho Park Date: Wed May 4 16:51:53 2022 +0900 arm64: dts: exynos: switch USI clocks in ExynosAutov9 Use CMU clock nodes instead of dummy fixed-rate-clock. Signed-off-by: Chanho Park Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-12-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit 5394461a31c9d1c6a0452a0312f941e0b4d08d74 Author: Chanho Park Date: Wed May 4 16:51:52 2022 +0900 arm64: dts: exynos: add initial CMU clock nodes in ExynosAutov9 Add cmu_top, cmu_busmc, cmu_core, cmu_fsys and peric0/c1/s clock nodes. Signed-off-by: Chanho Park Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-11-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit e13f13e039dc8f31168b5569120a7658035c80ee Author: Thomas Zimmermann Date: Mon May 2 16:25:12 2022 +0200 drm: Add DRM-managed mutex_init() Add drmm_mutex_init(), a helper that provides managed mutex cleanup. The mutex will be destroyed with the final reference of the DRM device. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220502142514.2174-2-tzimmermann@suse.de commit fb43f8face509a5391da2f94bd6d551d135e8e49 Merge: 6745dbc731128 e61492e47838f Author: Krzysztof Kozlowski Date: Thu May 5 09:03:42 2022 +0200 Merge tag 'samsung-dt-bindings-clk-exynosautov9-5.19' into next/dt64 dt-bindings for Samsung ExynosAutov9 clock controllers for v5.19 The Devicetree bindings for Samsung ExynosAutov9 clock controllers. commit bf198e2e919ed551794d6eec3fe52e2d1693f0eb Author: Tim Harvey Date: Fri Apr 29 09:13:47 2022 -0700 arm64: dts: imx8mm-venice-gw7902: fix pcie bindings Update the pcie bindings to the correct dt bindings: pcie_phy: - use pcie0_refclk - add required clock-names pcie: - remove pcie_phy clock as it comes from phy driver Signed-off-by: Tim Harvey Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e61492e47838f4d99a3ffcc591ba57d1d5d0896f Author: Chanho Park Date: Wed May 4 16:51:44 2022 +0900 dt-bindings: clock: add Exynos Auto v9 SoC CMU bindings Add dt-schema for Exynos Auto v9 SoC clock controller. Signed-off-by: Chanho Park Reviewed-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504075154.58819-3-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit 680e1c8370a2ed7aff4f99ce3cebf79873d68f59 Author: Chanho Park Date: Wed May 4 16:51:43 2022 +0900 dt-bindings: clock: add clock binding definitions for Exynos Auto v9 Add device tree clock binding definitions for below CMU blocks. - CMU_TOP - CMU_BUSMC - CMU_CORE - CMU_FYS2 - CMU_PERIC0 / C1 - CMU_PERIS Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanho Park Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20220504075154.58819-2-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit cce6bedb38ed08f1c3a9b1b01fbba0fdb472fb50 Author: Thomas Zimmermann Date: Wed Apr 27 16:14:09 2022 +0200 drm/format-helper: Share implementation among conversion helpers Provide format-independent conversion helpers for system and I/O memory. Implement most existing helpers on top of it. The source and destination formats of each conversion is handled by a per-line helper that is given to the generic implementation. v2: * remove a blank line Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-5-tzimmermann@suse.de commit a6fdb669bb65232a440717098e9e702e27586a0f Author: Thomas Zimmermann Date: Wed Apr 27 16:14:08 2022 +0200 drm/format-helper: Unify the parameters of all per-line conversion helpers Give each per-line conversion helper pointers of type void and the number of pixels in the line. Remove the unused swab parameters. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-4-tzimmermann@suse.de commit 69add027fd2bac9bf757f012d0e5c53ecc15144e Author: Thomas Zimmermann Date: Wed Apr 27 16:14:07 2022 +0200 drm/format-helper: Remove optional byte-swap from line convertion Implement per-pixel byte swapping in a separate conversion helper for the single function that requires it. Select the correct helper for each conversion. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-3-tzimmermann@suse.de commit 41fd6f0a6dd62def79e91c2170cdfd29473fb833 Author: Thomas Zimmermann Date: Wed Apr 27 16:14:06 2022 +0200 drm/format-helper: Implement drm_fb_swab() with per-line helpers Replace the inner loop of drm_fb_swab() with helper functions that swap the bytes in each pixel. This will allow to share the outer loop with other conversion helpers. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220427141409.22842-2-tzimmermann@suse.de commit 8e1de7042596abb7cb277ea751fc13a4c2b65aea Author: Mika Westerberg Date: Sun Feb 13 16:44:45 2022 +0200 thunderbolt: Add support for XDomain lane bonding The USB4 Inter-Domain Service specification defines a protocol that can be used to establish lane bonding between two USB4 domains (hosts). So far we have not implemented it because the host controller DMA was not fast enough to be able to go over 20 Gbits/s even if lanes were bonded. However, starting from Intel Alder Lake CPUs the DMA can go over 20 Gbits/s so now it makes more sense to add this support to the driver. Because both ends need to negotiate the bonding we add a simple state machine that tracks the connection state and does the necessary steps described by the USB4 Inter-Domain Service specification. We only establish lane bonding when both sides of the link support it. Otherwise we default to use the single lane. Also this is only done when software connection manager is used. On systems with firmware based connection manager, it handles the high-speed tunneling so bonding lanes is specific to the implementation (Intel firmware based connection manager does not support lane bonding). Signed-off-by: Mika Westerberg commit 0a2e1667a73fe0c4374ddace925d85a4072d509c Author: Mika Westerberg Date: Sun Feb 13 17:16:24 2022 +0200 thunderbolt: Ignore port locked error in tb_port_wait_for_link_width() Sometimes when polling for the port after target link width is changed we get back port locked notification (because the link actually was reset and then re-trained). Instead of bailing out we can ignore these when polling for the width change as this is expected. Signed-off-by: Mika Westerberg commit 0e14dd5e14d697e2489c7bf0fe35947831de3975 Author: Mika Westerberg Date: Sun Feb 13 11:54:15 2022 +0200 thunderbolt: Split setting link width and lane bonding into own functions When bonding lanes over XDomain the host that has "higher" UUID triggers link re-train for bonding, and the host that has "lower" UUID just waits for this to happen. To support this split setting the link width and triggering the actual bonding a separate functions that can be called as needed. While there remove duplicated empty line in the kernel-doc comment of tb_port_lane_bonding_disable(). Signed-off-by: Mika Westerberg commit 94581b25d81f8f16b48e0b61a13f81469d6e5bc0 Author: Mika Westerberg Date: Sun Feb 13 11:45:39 2022 +0200 thunderbolt: Move tb_port_state() prototype to correct place This should be before tb_wait_for_port() following how the functions in switch.c are organized. Signed-off-by: Mika Westerberg commit 90f720d2292f52de51df2307272a8f8cf7ef7134 Author: Mika Westerberg Date: Sun Feb 13 11:42:23 2022 +0200 thunderbolt: Add debug logging when lane is enabled/disabled This is useful when debugging possible issues. Signed-off-by: Mika Westerberg commit 8f2ca252ee1f848d3eec9ebbbf3c3881cb423322 Author: Mark Brown Date: Sun May 1 18:47:13 2022 +0100 ARM: dts: imx6qdl-udoo: Disable USB host to work around boot issues Attempting to boot my Udoo Dual and Quad with mainline hangs during boot after printing: [ 3.270471] imx_usb 2184000.usb: No over current polarity defined [ 3.922502] mxs_phy 20c9000.usbphy: Data pin can't make good contact. [ 3.940097] imx_usb 2184200.usb: No over current polarity defined where imx_usb 2184200.usb is usbh1 in the DT. Adding debug prints to the code seems to show that we lock up at the first read in usbmisc_imx6q_init() which in combination with the above logging about the USB controllers suggests that we lock up on the first read in usbmisc_imx6q_init(). Looking at some of the other i.MX6 boards and the warning messages that are being printed suggests that there is bitrot in the DTS for the device so disable it for now, with it disabled the board boots successfully. Clearly this is not a real fix, but it does allow some use of the board with mainline. Similar behaviour is seen all the way back as far as v4.19, I tried going back to when the board was added but had toolchain issues. Vendor provided binaries seem fine on the boards so it seems likely that the hardware is fine and the issue is with some combination of the DT and kernel. This should obviously be resolved properly but for now this at least allows the kernel to boot with reduced functionality on these systems. Signed-off-by: Mark Brown Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 552de48b9e429ca723cd5c3c2613769a428d98dc Author: Krzysztof Kozlowski Date: Wed Apr 27 18:15:33 2022 +0200 ARM: dts: imx27: use new 'dma-channels' property The '#dma-channels' property was deprecated in favor of one defined by generic dma-common DT bindings. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 5bb0276031b2c768667f6902c8eda8ddefab74d0 Author: Krzysztof Kozlowski Date: Wed Apr 27 18:15:32 2022 +0200 dt-bindings: dmaengine: fsl-imx: deprecate '#dma-channels' and '#dma-requests' The generic properties, used in most of the drivers and defined in generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit fcc070a44ecce5e800725136ce2e47ce00d40ca7 Author: Alexander Shiyan Date: Wed Apr 27 12:42:05 2022 +0300 ARM: dts: imx6qdl-phytec: Add LED labels This allows boards the option of adding properties or disabling the LEDs entirely. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit 339c8beae89b0435610b363df378abe10a486542 Author: Michael Walle Date: Wed Apr 27 09:53:36 2022 +0200 arm64: dts: freescale: reduce the interrup-map-mask Reduce the interrupt-map-mask of the external interrupt controller to 0xf to align with the devicetree schema. Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit 51b9d74cdb9fe5d5492214da20ab50173c1e9b08 Author: Michael Walle Date: Wed Apr 27 09:53:35 2022 +0200 ARM: dts: ls1021a: reduce the interrupt-map-mask Reduce the interrupt-map-mask of the external interrupt controller to 7 to align with the devicetree schema. Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit 5446ff1a67160ad92d9aae9530846aa54750be36 Author: Adam Ford Date: Tue Apr 26 15:51:44 2022 -0500 arm64: dts: imx8mn-beacon: Enable RTS-CTS on UART3 There is a header for a DB9 serial port, but any attempts to use hardware handshaking fail. Enable RTS and CTS pin muxing and enable handshaking in the uart node. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 4ce01ce36d77137cf60776b320babed89de6bd4c Author: Adam Ford Date: Tue Apr 26 15:51:43 2022 -0500 arm64: dts: imx8mm-beacon: Enable RTS-CTS on UART3 There is a header for a DB9 serial port, but any attempts to use hardware handshaking fail. Enable RTS and CTS pin muxing and enable handshaking in the uart node. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 42c1a6f62e5c46269ed37238f6a5331b30c32c75 Author: Marek Vasut Date: Tue Apr 26 22:03:29 2022 +0200 arm64: dts: imx8mm: Use 100 kHz I2C2 on Data Modul i.MX8M Mini eDM SBC The I2C2 has SMBus device SMSC USB2514Bi connected to it, the device is capable of up to 100 kHz operation. Reduce the bus frequency to 100 kHz to guarantee this I2C device can work correctly. Fixes: 583f24ae42a07 ("arm64: dts: imx8mm: Add support for Data Modul i.MX8M Mini eDM SBC") Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 13305aa53692700a7d2ed2a7ad47965650d8be7b Author: Marek Vasut Date: Tue Apr 26 22:02:47 2022 +0200 arm64: dts: imx8mm: Disable USB2 OC on Data Modul i.MX8M Mini eDM SBC The USB2 port has USB Hub permanently connected to it, disable OC to avoid getting false OC indication. Fixes: 583f24ae42a07 ("arm64: dts: imx8mm: Add support for Data Modul i.MX8M Mini eDM SBC") Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 13e4e43a1934d22e27a4553cb219133ef9583954 Author: Marek Vasut Date: Tue Apr 26 21:59:01 2022 +0200 arm64: dts: imx8mm: Add CPLD on MX8Menlo board The CPLD on MX8Menlo board is used to operate custom hardware, the CPLD content is compatible with previous M53Menlo CPLD, add the bindings. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Marcel Ziswiler Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: NXP Linux Team Cc: devicetree@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 4950b6990e3b1efae64a5f6fc5738d25e3b816b3 Merge: fa728505f3e7d 91d350d661bf9 Author: Jakub Kicinski Date: Wed May 4 20:42:17 2022 -0700 Merge branch 'ocelot-vcap-cleanups' Vladimir Oltean says: ==================== Ocelot VCAP cleanups This is a series of minor code cleanups brought to the Ocelot switch driver logic for VCAP filters. - don't use list_for_each_safe() in ocelot_vcap_filter_add_to_block - don't use magic numbers for OCELOT_POLICER_DISCARD ==================== Link: https://lore.kernel.org/r/20220503120150.837233-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 91d350d661bf9c7d4afeb585a81ad694280cc0fb Author: Vladimir Oltean Date: Tue May 3 15:01:50 2022 +0300 net: mscc: ocelot: don't use magic numbers for OCELOT_POLICER_DISCARD OCELOT_POLICER_DISCARD helps "kill dropped packets dead" since a PERMIT/DENY mask mode with a port mask of 0 isn't enough to stop the CPU port from receiving packets removed from the forwarding path. The hardcoded initialization done for it in ocelot_vcap_init() is confusing. All we need from it is to have a rate and a burst size of 0. Reuse qos_policer_conf_set() for that purpose. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 8e90c499bd6816f6dc4127f071179e7bd190e5aa Author: Vladimir Oltean Date: Tue May 3 15:01:49 2022 +0300 net: mscc: ocelot: drop port argument from qos_policer_conf_set The "port" argument is used for nothing else except printing on the error path. Print errors on behalf of the policer index, which is less confusing anyway. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 09fd1e0d14815fd2c80577f4116c8976d8d080f8 Author: Vladimir Oltean Date: Tue May 3 15:01:48 2022 +0300 net: mscc: ocelot: use list_for_each_entry in ocelot_vcap_filter_add_to_block Unify the code paths for adding to an empty list and to a list with elements by keeping a "pos" list_head element that indicates where to insert. Initialize "pos" with the list head itself in case list_for_each_entry() doesn't iterate over any element. Note that list_for_each_safe() isn't needed because no element is removed from the list while iterating. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 3825a0d02748b4eb355b1d3926ff750fd3846178 Author: Vladimir Oltean Date: Tue May 3 15:01:47 2022 +0300 net: mscc: ocelot: add to tail of empty list in ocelot_vcap_filter_add_to_block This makes no functional difference but helps in minimizing the delta for a future change. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 0a448bba50090a6147c144f452f49301025111ec Author: Vladimir Oltean Date: Tue May 3 15:01:46 2022 +0300 net: mscc: ocelot: use list_add_tail in ocelot_vcap_filter_add_to_block() list_add(..., pos->prev) and list_add_tail(..., pos) are equivalent, use the later form to unify with the case where the list is empty later. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit fa728505f3e7dd1089beed7d0ac40267d5b22dce Author: Michael Walle Date: Tue May 3 15:20:38 2022 +0200 dt-bindings: net: lan966x: fix example In commit 4fdabd509df3 ("dt-bindings: net: lan966x: remove PHY reset") the PHY reset was removed, but I failed to remove it from the example. Fix it. Fixes: 4fdabd509df3 ("dt-bindings: net: lan966x: remove PHY reset") Reported-by: Rob Herring Signed-off-by: Michael Walle Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220503132038.2714128-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit b1f7836d93baff7c8c1e8550e089190d118a95f7 Author: Denys Drozdov Date: Mon Apr 25 18:23:50 2022 +0200 dt-bindings: arm: fsl: add toradex,colibri-imx6ull Add toradex,colibri-imx6ull for carrier board dts, including aster, iris and iris-v2 device tree, wifi and nonwifi variants for NAND and eMMC modules. Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Acked-by: Rob Herring Signed-off-by: Shawn Guo commit ce92db719adc14c7a8a5acb4bd85cb8a9d072831 Author: Fabio Estevam Date: Fri Apr 22 16:55:37 2022 -0300 ARM: dts: imx6sl: Add a label for the cpu node Add a label for the cpu node, so that board devicetree files can reference to the CPU node. This is useful for describing a PMIC voltage that supplies the CPU voltage. For example: &cpu0 { cpu-supply = <&sw1_reg>; Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 080d681bf3c64481425c2f8c6ffdd068c5a806c9 Author: Fabio Estevam Date: Thu May 5 10:18:47 2022 +0800 arm64: defconfig: Enable the WM8524 codec driver imx8mn-evk has a WM8524 codec. Enable the WM8524 codec driver so that audio can be functional on this board. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 425b9c7f51c98443db71ad679893725483b21196 Author: Vasily Averin Date: Mon May 2 15:15:51 2022 +0300 memcg: accounting for objects allocated for new netdevice Creating a new netdevice allocates at least ~50Kb of memory for various kernel objects, but only ~5Kb of them are accounted to memcg. As a result, creating an unlimited number of netdevice inside a memcg-limited container does not fall within memcg restrictions, consumes a significant part of the host's memory, can cause global OOM and lead to random kills of host processes. The main consumers of non-accounted memory are: ~10Kb 80+ kernfs nodes ~6Kb ipv6_add_dev() allocations 6Kb __register_sysctl_table() allocations 4Kb neigh_sysctl_register() allocations 4Kb __devinet_sysctl_register() allocations 4Kb __addrconf_sysctl_register() allocations Accounting of these objects allows to increase the share of memcg-related memory up to 60-70% (~38Kb accounted vs ~54Kb total for dummy netdevice on typical VM with default Fedora 35 kernel) and this should be enough to somehow protect the host from misuse inside container. Other related objects are quite small and may not be taken into account to minimize the expected performance degradation. It should be separately mentonied ~300 bytes of percpu allocation of struct ipstats_mib in snmp6_alloc_dev(), on huge multi-cpu nodes it can become the main consumer of memory. This patch does not enables kernfs accounting as it affects other parts of the kernel and should be discussed separately. However, even without kernfs, this patch significantly improves the current situation and allows to take into account more than half of all netdevice allocations. Signed-off-by: Vasily Averin Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/354a0a5f-9ec3-a25c-3215-304eab2157bc@openvz.org Signed-off-by: Jakub Kicinski commit dab98061d71891a506c3ae2766fd23c07b65f6d3 Author: Fabio Estevam Date: Thu Apr 21 22:19:17 2022 -0300 arm64: dts: imx8mq-kontron-pitx-imx8m: Use the standard 'uart-has-rtscts' The usage of the 'fsl,uart-has-rtscts' property is deprecated. Use the standard 'uart-has-rtscts' instead. Cc: Heiko Thiery Signed-off-by: Fabio Estevam Acked-By: Heiko Thiery Signed-off-by: Shawn Guo commit 83b41ad1dca61ede1c261aa788fe643b746fb546 Author: Fabio Estevam Date: Thu Apr 21 22:19:16 2022 -0300 arm64: dts: imx8mp-verdin: Use the standard 'uart-has-rtscts' The usage of the 'fsl,uart-has-rtscts' property is deprecated. Use the standard 'uart-has-rtscts' instead. Cc: Marcel Ziswiler Signed-off-by: Fabio Estevam Acked-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 89bbe4e4ba0ac2402ac6fd268acedeb44f387a80 Author: Fabio Estevam Date: Thu Apr 21 22:18:21 2022 -0300 ARM: dts: imx6ul-kontron-n6x1x-s: Use the standard 'uart-has-rtscts' The usage of the 'fsl,uart-has-rtscts' property is deprecated. Use the standard 'uart-has-rtscts' instead. Cc: Frieder Schrempf Signed-off-by: Fabio Estevam Acked-by: Frieder Schrempf Signed-off-by: Shawn Guo commit a25875276e93636a8d1878c564d635f1a18bac24 Author: Fabio Estevam Date: Thu Apr 21 22:18:20 2022 -0300 ARM: dts: imx6dl-plybas: Use the standard 'uart-has-rtscts' The usage of the 'fsl,uart-has-rtscts' property is deprecated. Use the standard 'uart-has-rtscts' instead. Cc: Oleksij Rempel Signed-off-by: Fabio Estevam Reviewed-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 3a70c8b607c45dfc5306771879270ba00e74160a Author: Fabio Estevam Date: Wed Apr 20 10:27:34 2022 -0300 ARM: dts: mba6ulx: Remove unnecessary #address-cells/#size-cells The following W=1 dtc warning is seen: arch/arm/boot/dts/mba6ulx.dtsi:33.26-64.4: Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Remove the unnecessary #address-cells/#size-cells to fix it. Fixes: 7b8861d8e627 ("ARM: dts: imx6ul: add TQ-Systems MBa6ULx device trees") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 29f440a7bda8df98c595f6ac29cd196fa1df394a Author: Paul Elder Date: Wed Apr 6 17:34:01 2022 +0200 arm64: dts: imx8mp: Add MEDIA_BLK_CTRL Add a DT node for the MEDIA_BLK_CTRL, which provides power domains for the camera and display devices. Signed-off-by: Paul Elder Signed-off-by: Laurent Pinchart Reviewed-by: Marek Vasut Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 9d89189d5227507a05a6029818e1a2e2b074522a Author: Laurent Pinchart Date: Wed Apr 6 17:34:00 2022 +0200 arm64: dts: imx8mp: Add MEDIAMIX power domains Add the power domains related to the MEDIAMIX to the GPC. Signed-off-by: Laurent Pinchart Reviewed-by: Marek Vasut Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 2ae42e0c0b67d155cdac1f801f59ac3290650442 Author: Lucas Stach Date: Wed Apr 6 17:33:59 2022 +0200 arm64: dts: imx8mp: add HSIO power-domains This adds the GPC and HSIO blk-ctrl nodes providing power control for the high-speed (USB and PCIe) IOs. Signed-off-by: Lucas Stach Reviewed-by: Laurent Pinchart Signed-off-by: Shawn Guo commit e3442022f54301ed8c27a2087b031a0a7265c4ba Author: Lucas Stach Date: Wed Apr 6 17:33:58 2022 +0200 soc: imx: add i.MX8MP HDMI blk-ctrl This adds driver support for the HDMI blk-ctrl found on the i.MX8MP SoC. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 07614fed00e9f4e272c4e30f4c317e63a44207f9 Author: Paul Elder Date: Wed Apr 6 17:33:55 2022 +0200 soc: imx: imx8m-blk-ctrl: Add i.MX8MP media blk-ctrl Add the description for the i.MX8MP media blk-ctrl. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Reviewed-by: Marek Vasut Tested-by: Marek Vasut # MX8MP LCDIF #1 and #2 Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 556f5cf9568af772d494cff24ffaa7ea41e1ab40 Author: Lucas Stach Date: Wed Apr 6 17:33:53 2022 +0200 soc: imx: add i.MX8MP HSIO blk-ctrl The i.MX8MP added some blk-ctrl peripherals that don't follow the regular structure of the blk-ctrls in the previous SoCs. Add a new file for those with currently only the HSIO blk-ctrl being supported. Others will be added later on. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit a0c756681b902f2db56e2f7c76173f5363774250 Merge: 8239d67f59cf5 f11cf9e35e7f7 Author: Shawn Guo Date: Thu May 5 09:28:24 2022 +0800 Merge commit 'f11cf9e35e7f' into imx/drivers commit 7a0a377425210eb2cdee394db73136631d5dd204 Author: Manoj Sai Date: Mon Apr 25 19:12:22 2022 +0530 dt-bindings: arm: fsl: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam. EDIMM2.2 Starter Kit is an EDIMM 2.2 Form Factor Capacitive Evaluation Board from Engicam. i.Core MX8M Plus needs to mount on top of this Evaluation board for creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit. Add bindings for it. Signed-off-by: Manoj Sai Reviewed-by: Jagan Teki Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit cff15d3ee66d0412f36fc927a19b27fcc3f9dc20 Author: Changming Huang Date: Wed Apr 20 10:35:55 2022 +0800 dt-bindings: arm: fsl: add ls1021a-iot board Add the board ls1021a-iot in the binding docuemnt. Signed-off-by: Changming Huang Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 1299bb1d2e9adbd4e64c7bbd572d67cff09851fd Author: Marek Vasut Date: Mon Apr 18 15:24:56 2022 +0200 dt-bindings: arm: Add i.MX8M Mini Toradex Verdin based Menlo board Add DT compatible string for board based on the Toradex Verdin iMX8M Mini SoM, the MX8Menlo. The board is a compatible replacement for i.MX53 M53Menlo and features USB, multiple UARTs, ethernet, LEDs, SD and eMMC. Acked-by: Peng Fan Acked-by: Rob Herring Reviewed-by: Fabio Estevam Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Francesco Dolcini Cc: Marcel Ziswiler Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: NXP Linux Team Cc: devicetree@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit bed5522940e08ee9b2dc802e4ef53a09e27975e8 Author: Tim Harvey Date: Thu Apr 14 09:15:04 2022 -0700 dt-bindings: arm: Add i.MX8M Plus Gateworks GW74xx board Add DT compatible string for i.MX8M Plus based Gateworks GW74xx board. Signed-off-by: Tim Harvey Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 84cb08ca541437b061f9d901f3c637d93ebebb2e Author: Michael Walle Date: Tue Apr 12 16:32:37 2022 +0200 dt-bindings: arm: fsl: add IMX8MN DDR3L eval board This eval board features an IMX8MN UltraLite and has DDR3L RAM. The product part number is 8MNANOD3L-EVK. Signed-off-by: Michael Walle Reviewed-by: Heiko Thiery Acked-by: Krzysztof Kozlowski Acked-by: Peng Fan Signed-off-by: Shawn Guo commit 9eef821d3b84c866acbe58a0964e2756990523e9 Author: Max Krummenacher Date: Mon Apr 11 17:22:22 2022 +0200 dt-bindings: arm: fsl: Add carriers for toradex,colibri-imx6dl Add bindings for Aster, Iris and Iris V2 carrier boards our Colibri iMX6S/DL may be mated with. Acked-by: Rob Herring Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 31963ac56eb5ff6af62787128d635975d8d103e5 Author: Max Krummenacher Date: Mon Apr 11 17:22:21 2022 +0200 dt-bindings: arm: fsl: imx6dl-colibri: Drop dedicated v1.1 bindings The dedicated device tree for V1.1 modules has been dropped. Remove its bindings too. Acked-by: Rob Herring Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit a84091746e50111b0dd6722eca7230d5719ffd18 Author: Marcel Ziswiler Date: Fri Apr 8 16:57:24 2022 +0200 dt-bindings: arm: fsl: add toradex,verdin-imx8mp et al. Add toradex,verdin-imx8mp for the Verdin iMX8M Plus modules, its nonwifi and wifi variants and the carrier boards (both Dahlia and the Verdin Development Board) they may be mated in. Signed-off-by: Marcel Ziswiler Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit afd406d7328e93bf99467e9ad866c34beb9f306f Author: Marek Vasut Date: Thu Apr 7 21:21:41 2022 +0200 dt-bindings: arm: Add i.MX53 based Menlo board comment Add comment regarding the i.MX53 based Menlo board. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: NXP Linux Team Cc: devicetree@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Acked-by: Rob Herring Signed-off-by: Shawn Guo commit f11cf9e35e7f740d158e298baf5764bcdd8a199e Author: Lucas Stach Date: Wed Apr 6 17:33:56 2022 +0200 dt-bindings: power: imx8mp: add defines for HDMI blk-ctrl domains This adds the defines for the power domains provided by the HDMI blk-ctrl on the i.MX8MP. Signed-off-by: Lucas Stach Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 5a10857a8e35c71f526965211759dffbc54b5827 Author: Andrej Picej Date: Tue Feb 22 10:16:04 2022 +0100 dt-bindings: arm: fsl: add PHYTEC phyGATE Tauri i.MX6 ULL Add devicetree bindings for phyGATE Tauri board with phyCORE-i.MX6 ULL. Signed-off-by: Andrej Picej Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 8b3dd27bfe47abe30450d01077983497aa1a159f Author: Paul Elder Date: Wed Apr 6 17:33:54 2022 +0200 dt-bindings: soc: Add i.MX8MP media block control DT bindings The i.MX8MP Media Block Control (MEDIA BLK_CTRL) is a top-level peripheral providing access to the NoC and ensuring proper power sequencing of the peripherals within the MEDIAMIX domain. Add DT bindings for it. There is already a driver for block controls of other SoCs in the i.MX8M family, so these bindings will expand upon that. Signed-off-by: Paul Elder Reviewed-by: Rob Herring Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Reviewed-by: Marek Vasut Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 5c35e2284103ea2674d95a7532d6d4e2bb759553 Author: Matthias Schiffer Date: Tue Feb 22 08:09:41 2022 +0100 dt-bindings: arm: fsl: add TQ Systems boards based on i.MX6UL(L) TQMa6ULx is a SOM family using NXP i.MX6UL CPU family. TQMa6ULLx is a SOM family using NXP i.MX6ULL CPU family. Both are available as a socket type as well as an LGA type. For both variants there are the mainboards MBa6ULx and MBa6ULxL, trailing 'L' is LGA version. Finally there is the possibility to use the socket module with an LGA adapter on the MBa6ULxL. The SOM needs a mainboard, therefore we provide compatibles using this naming schema: "tq,imx6ul-" for the module and "tq,imx6ul--" for when mounted on the mainboard. The i.MX6ULL version is done similar. Signed-off-by: Matthias Schiffer Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit eca2eee48d78af51bddacbd40844fb2ce3767616 Author: Marek Vasut Date: Mon Feb 21 01:17:37 2022 +0100 dt-bindings: arm: Add Data Modul i.MX8M Mini eDM SBC Add DT compatible string for Data Modul i.MX8M Mini eDM SBC board into YAML DT binding document. This system is an evaluation board for various custom display units. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: NXP Linux Team Cc: devicetree@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Reviewed-by: Peng Fan Acked-by: Rob Herring Signed-off-by: Shawn Guo commit e95a7329f83781916ff5c1a52c1f7641757ff1e2 Author: Lucas Stach Date: Wed Apr 6 17:33:57 2022 +0200 dt-bindings: soc: add binding for i.MX8MP HDMI blk-ctrl Add the DT binding for the HDMI blk-ctrl found on the i.MX8MP SoC. Signed-off-by: Lucas Stach Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 8239d67f59cf522dd4f7135392a2f9a3a25f9cff Author: Lucas Stach Date: Wed Apr 6 17:33:52 2022 +0200 soc: imx: imx8m-blk-ctrl: set power device name Set the name for the virtual power device to the name of the attached blk-ctrl domain. Makes the debug output for the power domains a lot more pleasant to read. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 08d709d5e1242340e10dd8d0a789b5cea508ccf5 Author: Zhu Yanjun Date: Thu Apr 28 00:10:28 2022 -0400 RDMA/rxe: Optimize the mr pool struct Based on the commit c9f4c695835c ("RDMA/rxe: Reverse the sense of RXE_POOL_NO_ALLOC"), only the mr pool uses the RXE_POOL_ALLOC, As such, replace this flags with pool type to save memory. Link: https://lore.kernel.org/r/20220428041028.1363139-1-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit aec8ad34f7f248381288919f4fc1315e8abad90d Author: Manoj Sai Date: Mon Apr 25 19:12:24 2022 +0530 arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit Genaral features: - LCD 7" C.Touch - microSD slot - Ethernet 1Gb - Wifi/BT - 2x LVDS Full HD interfaces - 3x USB 2.0 - 1x USB 3.0 - HDMI Out - Plus PCIe - MIPI CSI - 2x CAN - Audio Out i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam. i.Core MX8M Plus needs to mount on top of this Evaluation board for creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit. Add support for it. Signed-off-by: Manoj Sai Signed-off-by: Matteo Lisi Reviewed-by: Jagan Teki Signed-off-by: Shawn Guo commit eefe06b295087caa24340888b9465d7dc61df856 Author: Manoj Sai Date: Mon Apr 25 19:12:23 2022 +0530 arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam. General features: - NXP i.MX8M Plus - Up to 4GB LDDR4 - 8 eMMC - Gigabit Ethernet - USB 3.0, 2.0 Host/OTG - PCIe 3.0 interface - I2S - LVDS - rest of i.MX8M Plus features i.Core MX8M Plus needs to mount on top of Engicam baseboards for creating complete platform solutions. Add support for it. Signed-off-by: Manoj Sai Signed-off-by: Matteo Lisi Reviewed-by: Jagan Teki Signed-off-by: Shawn Guo commit e55264f3d7581e8a352ef734109edede7e7befbb Author: Li Yang Date: Mon Mar 21 21:28:17 2022 -0500 arm64: dts: freescale: update ifc node name to be memory-controller Update the node name to be align with updated DT binding. But be noted that u-boot for ls1088a used the ifc node name to disable ifc-nor node when the SoC is configured to use QSPI. The u-boot has been updated to use the latest name but the change could break compatibility with older u-boot for ls1088a. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit fefbc0021940a1da023eeff7634341841a048acf Author: Li Yang Date: Mon Mar 21 21:28:14 2022 -0500 arm64: dts: remove "simple-bus" compatible from ifc node The binding of ifc device has been updated. Update dts to match accordingly. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit b4269132ace84954915a6630238a9bc7194fd4a7 Author: Li Yang Date: Mon Mar 21 21:28:16 2022 -0500 ARM: dts: update ifc node name to be memory-controller Update the node name to be align with latest binding. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 1c1271e3bd28f293d336d92a78cce65b59c1d2d0 Author: Li Yang Date: Mon Mar 21 21:28:13 2022 -0500 ARM: dts: ls1021a: remove "simple-bus" compatible from ifc node The binding of ifc device has been updated. Update dts to match accordingly. Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit db5dfbf5b201df65c1f5332c4d9d5e7c2f42396b Author: Yixing Liu Date: Fri Apr 29 17:35:45 2022 +0800 RDMA/hns: Remove the num_cqc_timer variable The bt number of cqc_timer of HIP09 increases compared with that of HIP08. Therefore, cqc_timer_bt_num and num_cqc_timer do not match. As a result, the driver may fail to allocate cqc_timer. So the driver needs to uniquely uses cqc_timer_bt_num to represent the bt number of cqc_timer. Fixes: 0e40dc2f70cd ("RDMA/hns: Add timer allocation support for hip08") Link: https://lore.kernel.org/r/20220429093545.58070-1-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit e8ea058edc2b225a68b307057a65599625daaebf Author: Yangyang Li Date: Fri Apr 29 17:31:04 2022 +0800 RDMA/hns: Add the detection for CMDQ status in the device initialization process CMDQ may fail during HNS ROCEE initialization. The following is the log when the execution fails: hns3 0000:bd:00.2: In reset process RoCE client reinit. hns3 0000:bd:00.2: CMDQ move tail from 840 to 839 hns3 0000:bd:00.2 hns_2: failed to set gid, ret = -11! hns3 0000:bd:00.2: CMDQ move tail from 840 to 839 <...> hns3 0000:bd:00.2: CMDQ move tail from 840 to 839 hns3 0000:bd:00.2: CMDQ move tail from 840 to 0 hns3 0000:bd:00.2: [cmd]token 14e mailbox 20 timeout. hns3 0000:bd:00.2 hns_2: set HEM step 0 failed! hns3 0000:bd:00.2 hns_2: set HEM address to HW failed! hns3 0000:bd:00.2 hns_2: failed to alloc mtpt, ret = -16. infiniband hns_2: Couldn't create ib_mad PD infiniband hns_2: Couldn't open port 1 hns3 0000:bd:00.2: Reset done, RoCE client reinit finished. However, even if ib_mad client registration failed, ib_register_device() still returns success to the driver. In the device initialization process, CMDQ execution fails because HW/FW is abnormal. Therefore, if CMDQ fails, the initialization function should set CMDQ to a fatal error state and return a failure to the caller. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Link: https://lore.kernel.org/r/20220429093104.26687-1-liangwenpeng@huawei.com Signed-off-by: Yangyang Li Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 069adbac2cd85ae00252da6c5576cbf9b9d9ba6e Author: Christoph Hellwig Date: Wed May 4 07:33:55 2022 -0700 block: improve the error message from bio_check_eod Print the start sector and length separately instead of the combined value to help with debugging. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20220504143355.568660-1-hch@lst.de Signed-off-by: Jens Axboe commit 7ecc56c62b27d93838ee67fc2c7a1c3c480aea04 Author: Christoph Hellwig Date: Wed May 4 07:29:50 2022 -0700 block: allow passing a NULL bdev to bio_alloc_clone/bio_init_clone Device mapper wants to allocate a bio before knowing the device it gets send to, so add explicit support for that. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20220504142950.567582-3-hch@lst.de Signed-off-by: Jens Axboe commit 513616843d736fb7161b4460cdfe5aa825c5902c Author: Christoph Hellwig Date: Wed May 4 07:29:49 2022 -0700 block: remove superfluous calls to blkcg_bio_issue_init blkcg_bio_issue_init is called in submit_bio. There is no need to have extra calls that just get overriden in __bio_clone and the two places that copy and pasted from it. Signed-off-by: Christoph Hellwig Reviewed-by: Mike Snitzer Link: https://lore.kernel.org/r/20220504142950.567582-2-hch@lst.de Signed-off-by: Jens Axboe commit cc377b9b24c7839531c2c0b7a2165819b578393e Author: Guo Zhengkui Date: Tue Apr 26 15:08:58 2022 +0800 RDMA/hns: Remove unnecessary ret variable from hns_roce_dereg_mr() Fix the following coccicheck warning: drivers/infiniband/hw/hns/hns_roce_mr.c:343:5-8: Unneeded variable: "ret". Return 0 directly instead. Link: https://lore.kernel.org/r/20220426070858.9098-1-guozhengkui@vivo.com Signed-off-by: Guo Zhengkui Signed-off-by: Jason Gunthorpe commit 1bb533b6871a7e3b0692253f7f8bf18338e21627 Author: Marek Vasut Date: Fri Apr 29 22:46:25 2022 +0200 drm/bridge: tc358767: Fix DP bridge mode detection from DT endpoints Per toshiba,tc358767.yaml DT binding document, port@2 the output (e)DP port is optional. In case this port is not described in DT, the bridge driver operates in DPI-to-DP mode. Make sure the driver treats this as a valid mode of operation instead of reporting invalid mode. Fixes: 71f7d9c03118 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT") Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Marek Vasut Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg Reviewed-by: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20220429204625.241591-1-marex@denx.de commit 05ecc678357ae0929835b24f40a9ea8a1fcb105a Author: Marek Vasut Date: Fri Apr 29 23:23:13 2022 +0200 drm: mxsfb: Implement LCDIF scanout CRC32 support The LCDIF controller as present in i.MX28/i.MX6SX/i.MX8M Mini/Nano has CRC_STAT register, which contains CRC32 of the frame as it was clocked out of the DPI interface of the LCDIF. This is most likely meant as a functional safety feature. Unfortunately, there is zero documentation on how the CRC32 is calculated, there is no documentation of the polynomial, the init value, nor on which data is the checksum applied. By applying brute-force on 8 pixel / 2 line frame, which is the minimum size LCDIF would work with, it turns out the polynomial is CRC32_POLY_LE 0xedb88320 , init value is 0xffffffff , the input data are bitrev32() of the entire frame and the resulting CRC has to be also bitrev32()ed. Doing this calculation in kernel for each frame is unrealistic due to the CPU demand, so attach the CRC collected from hardware to a frame instead. The DRM subsystem already has an interface for this purpose and the CRC can be accessed e.g. via debugfs: " $ echo auto > /sys/kernel/debug/dri/1/crtc-0/crc/control $ cat /sys/kernel/debug/dri/1/crtc-0/crc/data 0x0000408c 0xa4e5cdd8 0x0000408d 0x72f537b4 " The per-frame CRC can be used by userspace e.g. during automated testing, to verify that whatever buffer was sent to be scanned out was actually scanned out of the LCDIF correctly. Acked-by: Lucas Stach Acked-by: Stefan Agner Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Link: https://patchwork.freedesktop.org/patch/msgid/20220429212313.305556-1-marex@denx.de commit f4f1739a09dc7bcac3c6471cf3f82443934c3608 Author: Andy Shevchenko Date: Tue May 3 18:13:10 2022 +0300 pinctrl: nomadik: Setup parent device and get rid of unnecessary of_node assignment Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220503151310.58762-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 3389b09878dddd58ef52bd0bf43cc42ea5a9ea2a Author: Fabien Dessenne Date: Mon May 2 17:31:14 2022 +0200 pinctrl: stm32: prevent the use of the secure protected pins The hardware denies any access from the Linux non-secure world to the secure-protected pins. Hence, prevent any driver to request such a pin. Mark the secure-protected GPIO lines as invalid (.init_valid_mask) and prevent the pinmux request / pinconf setting operations. Identify the secure pins with "NO ACCESS" in the pinconf sysfs. Signed-off-by: Fabien Dessenne Link: https://lore.kernel.org/r/20220502153114.283618-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij commit 3296c473d9aada9b8ca1f47d395727595c01cff7 Author: Fabien Dessenne Date: Mon May 2 17:25:24 2022 +0200 pinctrl: stm32: improve debugfs information of pinconf-pins entry Print the name of the selected alternate function in addition to its number. Ex: "pin 135 (PI7): alternate 10 (SAI2_FS_A) - ..." Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue Link: https://lore.kernel.org/r/20220502152524.283374-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij commit b983d423ce7408e13b3682558741aae3180bdcc9 Author: Hector Martin Date: Mon May 2 18:23:35 2022 +0900 pinctrl: apple: Make it work as a module We need MODULE_DEVICE_TABLE for module autoloading to work. Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20220502092335.30670-1-marcan@marcan.st Signed-off-by: Linus Walleij commit e804944dcc77991e6b5d81ee9b422297b2998d1d Author: Krzysztof Kozlowski Date: Sat Apr 23 11:41:42 2022 +0200 pinctrl: nuvoton: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: 3b588e43ee5c ("pinctrl: nuvoton: add NPCM7xx pinctrl and GPIO driver") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220423094142.33013-2-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit d96a89407e5f682d1cb22569d91784506c784863 Author: Minghao Chi Date: Tue Apr 12 08:30:44 2022 +0000 power: supply: bq24190_charger: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Sebastian Reichel commit 68fdbe090c362e8be23890a7333d156e18c27781 Author: Sicelo A. Mhlongo Date: Wed Apr 20 14:30:59 2022 +0200 power: supply: bq27xxx: expose battery data when CI=1 When the Capacity Inaccurate flag is set, the chip still provides data about the battery, albeit inaccurate. Instead of discarding capacity values for CI=1, expose the stale data and use the POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED property to indicate that the values should be used with care. Reviewed-by: Pali Rohár Signed-off-by: Sicelo A. Mhlongo Signed-off-by: Sebastian Reichel commit a9387099d8a14cc9eaf6db15db1aa37bcfc3ac2d Author: Krzysztof Kozlowski Date: Fri Apr 29 08:13:32 2022 +0200 pinctrl: tegra: tegra194: drop unused pin groups The sdmmc1_hv_trim_pins, sdmmc3_hv_trim_pins and sys_reset_n_pins are not defined as pin groups: drivers/pinctrl/tegra/pinctrl-tegra194.c:1119:27: error: ‘sdmmc3_hv_trim_pins’ defined but not used [-Werror=unused-const-variable=] 1119 | static const unsigned int sdmmc3_hv_trim_pins[] = { Proper fix would be to define them, but this requires knowledge from datasheet. Removal should not cause any harm and at least it silences the warnings. Fixes: 613c0826081b ("pinctrl: tegra: Add pinmux support for Tegra194") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429061332.25135-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit b8b8eeda63d60d434fcb0351ed45daf9f2d15afd Author: Yang Li Date: Thu Feb 24 09:23:18 2022 +0800 drm/mediatek: mtk_dsi: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warning: ./drivers/gpu/drm/mediatek/mtk_dsi.c:1092:2-9: line 1092 is redundant because platform_get_irq() already prints an error Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220224012318.84935-1-yang.lee@linux.alibaba.com/ Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Chun-Kuang Hu commit 6384f12461523844cec72af2b94504b7d6c218ac Author: Rob Herring Date: Fri Apr 22 14:21:38 2022 -0500 dt-bindings: pinctrl: aspeed: Drop referenced nodes in examples The additional nodes in the example referenced from the pinctrl node 'aspeed,external-nodes' properties are either incorrect (aspeed,ast2500-lpc) or not documented with a schema (aspeed,ast2500-gfx). There's no need to show these nodes as part of the pinctrl example, so just remove them. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220422192139.2592632-1-robh@kernel.org Signed-off-by: Linus Walleij commit a0912083086d7b6bd7f0f1b4c2ffa6c8283a9f98 Merge: c954531bc5d84 edc5601db6641 Author: Linus Walleij Date: Wed May 4 23:15:21 2022 +0200 Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel intel-gpio for v5.19-1 * Introduce helpers to iterate over GPIO chip nodes and covert some drivers The following is an automated git shortlog grouped by driver: gpiolib: - Introduce a helper to get first GPIO controller node - Introduce gpiochip_node_count() helper - Introduce for_each_gpiochip_node() loop helper pinctrl: - meson: Replace custom code by gpiochip_node_count() call - meson: Enable COMPILE_TEST - meson: Rename REG_* to MESON_REG_* - armada-37xx: Reuse GPIO fwnode in armada_37xx_irqchip_register() - armada-37xx: Switch to use fwnode instead of of_node - samsung: Switch to use for_each_gpiochip_node() helper - samsung: Drop redundant node parameter in samsung_banks_of_node_get() - npcm7xx: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Replace custom code by gpiochip_node_count() call - stm32: Switch to use for_each_gpiochip_node() helper - stm32: Replace custom code by gpiochip_node_count() call commit ac87e588b49302a9b9ff71c3b5c074eb5ab1fc4e Merge: 0f2d636e7d1fd e84f3c41a5834 Author: Mark Brown Date: Wed May 4 21:59:20 2022 +0100 regulator: dt-bindings: qcom,rpmh: minor cleanups and extend supplies Merge series from Krzysztof Kozlowski : Extend the RPMH regulator bindings with minor fixes and adding narrow supply matching. commit 1ca980168669acc361e3e3e984f23e20d8bf99f9 Author: Muna Sinada Date: Wed Mar 23 15:46:36 2022 -0700 mac80211: support disabling EHT mode Allow userspace to disable EHT mode. This forces EHT capable interfaces to disable during association. Signed-off-by: Muna Sinada Signed-off-by: Aloka Dixit Link: https://lore.kernel.org/r/20220323224636.20211-2-quic_alokad@quicinc.com [remove stray message change] Signed-off-by: Johannes Berg commit 36f8423597000bd7d5e48b7b306e1d0958e72359 Author: Muna Sinada Date: Wed Mar 23 15:46:35 2022 -0700 cfg80211: support disabling EHT mode Allow userspace to disable EHT mode during association. Signed-off-by: Muna Sinada Signed-off-by: Aloka Dixit Link: https://lore.kernel.org/r/20220323224636.20211-1-quic_alokad@quicinc.com Signed-off-by: Johannes Berg commit b041b7b9de6e1d4362de855ab90f9d03ef323edd Author: Felix Fietkau Date: Wed Apr 20 12:49:07 2022 +0200 mac80211: upgrade passive scan to active scan on DFS channels after beacon rx In client mode, we can't connect to hidden SSID APs or SSIDs not advertised in beacons on DFS channels, since we're forced to passive scan. Fix this by sending out a probe request immediately after the first beacon, if active scan was requested by the user. Cc: stable@vger.kernel.org Reported-by: Catrinel Catrinescu Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20220420104907.36275-1-nbd@nbd.name Signed-off-by: Johannes Berg commit 0969b96352d69c25855d90fd6d74bd619f1f1f0c Author: Hangyu Hua Date: Wed Apr 13 17:19:02 2022 +0800 mac80211: tx: delete a redundant if statement in ieee80211_check_fast_xmit() If statement is meaningless because the code will goto out regardless of whether fast_tx is NULL or not. Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220413091902.27438-1-hbh25y@gmail.com Signed-off-by: Johannes Berg commit fa4d58da401f7fb4e45142d97f1e7e64d224bdfd Author: Ping-Ke Shih Date: Thu Mar 24 08:48:16 2022 +0800 mac80211: consider Order bit to fill CCMP AAD Follow IEEE 802.11-21 that HTC subfield masked to 0 for all data frames containing a QoS Control field. It also defines the AAD length depends on QC and A4 fields, so change logic to determine length accordingly. Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20220324004816.6202-1-pkshih@realtek.com Signed-off-by: Johannes Berg commit a181b8d187319bf265a2019ddde856a3d2f107a6 Author: Minghao Chi Date: Thu Apr 14 09:07:27 2022 +0000 i2c: davinci: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang commit 5692900bed2a76c4086dc25557f28d7baac9307c Author: Yang Yingliang Date: Thu Apr 21 17:00:42 2022 +0800 i2c: meson: fix missing clk_disable_unprepare() on error in meson_i2c_probe() Fix the missing clk_disable_unprepare() before return from meson_i2c_probe() in the error handling case. Fixes: a57f9b4dd6f5 ("i2c: meson: Use 50% duty cycle for I2C clock") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Neil Armstrong Signed-off-by: Wolfram Sang commit 32d4536133f5d96b0b63ff70748b9ef4579b211d Author: Stephen Kitt Date: Fri Mar 25 17:19:10 2022 +0100 docs: i2c: reference simple probes Instead of documenting old-style probes, reference "simple probes" and document the i2c_match_id function. This might help reduce the use of two-argument probes in new code. Signed-off-by: Stephen Kitt Signed-off-by: Wolfram Sang commit 43bf42ff4737d6f6e4fb328e61cdaa9044a22639 Author: Christophe Leroy Date: Sat Apr 2 12:06:59 2022 +0200 i2c: powermac: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Signed-off-by: Wolfram Sang commit 5e91d2a4146946ea0abc984ca957f12b70632901 Author: Colin Ian King Date: Wed May 4 16:55:35 2022 +0100 selftests/seccomp: Fix spelling mistake "Coud" -> "Could" There is a spelling mistake in an error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220504155535.239180-1-colin.i.king@gmail.com commit 912a4427bec0e423c45dcf2afda079c22f505237 Author: Shida Zhang Date: Mon May 2 11:20:02 2022 +0800 MIPS: adding a safety check for cpu_has_fpu There is a chance 'cpu_has_fpu' would still be overridden when the CONFIG_MIPS_FP_SUPPORT configuration option has been disabled. So add a safety check for 'cpu_has_fpu'. Suggested-by: Maciej W. Rozycki Signed-off-by: Shida Zhang Signed-off-by: Thomas Bogendoerfer commit 03fbb903c8bf7e53e101e8d9a7b261264317c411 Author: Michael Walle Date: Thu Apr 7 17:08:28 2022 +0200 i2c: at91: use dma safe buffers The supplied buffer might be on the stack and we get the following error message: [ 3.312058] at91_i2c e0070600.i2c: rejecting DMA map of vmalloc memory Use i2c_{get,put}_dma_safe_msg_buf() to get a DMA-able memory region if necessary. Fixes: 60937b2cdbf9 ("i2c: at91: add dma support") Signed-off-by: Michael Walle Reviewed-by: Codrin Ciubotariu Signed-off-by: Wolfram Sang commit d0ab32b0f0c14173591dc5996ddbd90fb9375f7c Author: Guilherme G. Piccoli Date: Wed Apr 27 19:49:01 2022 -0300 mips: ip22: Reword PANICED to PANICKED and remove useless header Many other place in the kernel prefer the latter, so let's keep it consistent in MIPS code as well. Also, removes a useless header. Cc: Thomas Bogendoerfer Signed-off-by: Guilherme G. Piccoli Signed-off-by: Thomas Bogendoerfer commit f44b3e74c33fe04defeff24ebcae98c3bcc5b285 Author: Maciej W. Rozycki Date: Sun May 1 23:14:22 2022 +0100 MIPS: IP30: Remove incorrect `cpu_has_fpu' override Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu' kernel parameter non-functional, and also causes a link error: ld: arch/mips/kernel/traps.o: in function `trap_init': ./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe' ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe' ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe' where the CONFIG_MIPS_FP_SUPPORT configuration option has been disabled. Signed-off-by: Maciej W. Rozycki Reported-by: Stephen Zhang Fixes: 7505576d1c1a ("MIPS: add support for SGI Octane (IP30)") Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Thomas Bogendoerfer commit 424c3781dd1cb401857585331eaaa425a13f2429 Author: Maciej W. Rozycki Date: Sun May 1 23:14:16 2022 +0100 MIPS: IP27: Remove incorrect `cpu_has_fpu' override Remove unsupported forcing of `cpu_has_fpu' to 1, which makes the `nofpu' kernel parameter non-functional, and also causes a link error: ld: arch/mips/kernel/traps.o: in function `trap_init': ./arch/mips/include/asm/msa.h:(.init.text+0x348): undefined reference to `handle_fpe' ld: ./arch/mips/include/asm/msa.h:(.init.text+0x354): undefined reference to `handle_fpe' ld: ./arch/mips/include/asm/msa.h:(.init.text+0x360): undefined reference to `handle_fpe' where the CONFIG_MIPS_FP_SUPPORT configuration option has been disabled. Signed-off-by: Maciej W. Rozycki Reported-by: Stephen Zhang Fixes: 0ebb2f4159af ("MIPS: IP27: Update/restructure CPU overrides") Cc: stable@vger.kernel.org # v4.2+ Signed-off-by: Thomas Bogendoerfer commit 94bd83e45acdd72b81545ff25324a13bc5cae54e Author: Julia Lawall Date: Sat Apr 30 21:03:10 2022 +0200 MIPS: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Thomas Bogendoerfer commit 8b4fc246c3fffde96835b2f6d5d0e2a56c70d8f9 Author: AngeloGioacchino Del Regno Date: Mon Apr 11 15:21:07 2022 +0200 i2c: mediatek: Optimize master_xfer() and avoid circular locking Especially (but not only) during probe, it may happen that multiple devices are communicating via i2c (or multiple i2c busses) and sometimes while others are probing asynchronously. For example, a Cr50 TPM may be filling entropy (or userspace may be reading random data) while the rt5682 (i2c) codec driver reads/sets some registers, like while getting/setting a clock's rate, which happens both during probe and during system operation. In this driver, the mtk_i2c_transfer() function (which is the i2c .master_xfer() callback) was granularly managing the clocks by performing a clk_bulk_prepare_enable() to start them and its inverse. This is not only creating possible circular locking dependencies in the some cases (like former explanation), but it's also suboptimal, as clk_core prepare/unprepare operations are using mutex locking, which creates a bit of unwanted overhead (for example, i2c trackpads will call master_xfer() every few milliseconds!). With this commit, we avoid both the circular locking and additional overhead by changing how we handle the clocks in this driver: - Prepare the clocks during probe (and PM resume) - Enable/disable clocks in mtk_i2c_transfer() - Unprepare the clocks only for driver removal (and PM suspend) For the sake of providing a full explanation: during probe, the clocks are not only prepared but also enabled, as this is needed for some hardware initialization but, after that, we are disabling but not unpreparing them, leaving an expected state for the aforementioned clock handling strategy. Signed-off-by: AngeloGioacchino Del Regno Tested-by: Nícolas F. R. A. Prado Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang commit 336feb502a715909a8136eb6a62a83d7268a353b Author: Gustavo A. R. Silva Date: Wed Apr 27 17:47:14 2022 -0500 drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency() Fix the following -Wstringop-overflow warnings when building with GCC-11: drivers/gpu/drm/i915/intel_pm.c:3106:9: warning: ‘intel_read_wm_latency’ accessing 16 bytes in a region of size 10 [-Wstringop-overflow=] 3106 | intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/intel_pm.c:3106:9: note: referencing argument 2 of type ‘u16 *’ {aka ‘short unsigned int *’} drivers/gpu/drm/i915/intel_pm.c:2861:13: note: in a call to function ‘intel_read_wm_latency’ 2861 | static void intel_read_wm_latency(struct drm_i915_private *dev_priv, | ^~~~~~~~~~~~~~~~~~~~~ by removing the over-specified array size from the argument declarations. It seems that this code is actually safe because the size of the array depends on the hardware generation, and the function checks for that. Notice that wm can be an array of 5 elements: drivers/gpu/drm/i915/intel_pm.c:3109: intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency); or an array of 8 elements: drivers/gpu/drm/i915/intel_pm.c:3131: intel_read_wm_latency(dev_priv, dev_priv->wm.skl_latency); and the compiler legitimately complains about that. This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/181 Signed-off-by: Gustavo A. R. Silva commit be18ce150a436d01c13546e4a2440e717c99d57c Author: Jan Dabros Date: Thu Apr 28 14:26:51 2022 +0200 i2c: designware: Modify timing parameters for amdpsp mailbox Adjust retry period and timeout values for x86-PSP mailbox based on the typical I2C traffic generated by PSP. In order to limit the possibility of timeouts, x86 should reduce the interval between retries as well as increase overall time after which it gives up. Signed-off-by: Jan Dabros Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 1621fe09fec6386a6c0a3390c51d1196b4e92566 Author: Geert Uytterhoeven Date: Mon May 2 15:34:54 2022 +0200 dt-bindings: i2c: renesas,rcar-i2c: R-Car V3U is R-Car Gen4 Despite the name, R-Car V3U is the first member of the R-Car Gen4 family. I2C on R-Car V3U also supports some extra features (e.g. Slave Clock Stretch Select), which are supported by other R-Car Gen4 SoCs, but not by any other R-Car Gen3 SoC. Hence move its compatible value to the R-Car Gen4 section. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Wolfram Sang Signed-off-by: Wolfram Sang commit c81474ee890670eb942934e5ddc9366e6ec7f381 Author: Christian König Date: Tue May 3 10:59:35 2022 +0200 drm/nouveau: remove trace_dma_fence_emit Hardware drivers which don't have much difference between emit and init shouldn't use this trace point. Signed-off-by: Christian König Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220503085935.11023-1-christian.koenig@amd.com commit 921d161f15d6b090599f6a8c23f131969edbd1fa Author: Tong Tiangen Date: Wed Apr 20 03:04:13 2022 +0000 arm64: fix types in copy_highpage() In copy_highpage() the `kto` and `kfrom` local variables are pointers to struct page, but these are used to hold arbitrary pointers to kernel memory . Each call to page_address() returns a void pointer to memory associated with the relevant page, and copy_page() expects void pointers to this memory. This inconsistency was introduced in commit 2563776b41c3 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") and while this doesn't appear to be harmful in practice it is clearly wrong. Correct this by making `kto` and `kfrom` void pointers. Fixes: 2563776b41c3 ("arm64: mte: Tags-aware copy_{user_,}highpage() implementations") Signed-off-by: Tong Tiangen Acked-by: Mark Rutland Reviewed-by: Kefeng Wang Link: https://lore.kernel.org/r/20220420030418.3189040-3-tongtiangen@huawei.com Signed-off-by: Catalin Marinas commit 9887bda0c831df0c044d6de147d002e48024fb4a Author: Lyude Paul Date: Fri Apr 29 15:53:47 2022 -0400 drm/nouveau/subdev/bus: Ratelimit logging for fault errors There's plenty of ways to fudge the GPU when developing on nouveau by mistake, some of which can result in nouveau seriously spamming dmesg with fault errors. This can be somewhat annoying, as it can quickly overrun the message buffer (or your terminal emulator's buffer) and get rid of actually useful feedback from the driver. While working on my new atomic only MST branch, I ran into this issue a couple of times. So, let's fix this by adding nvkm_error_ratelimited(), and using it to ratelimit errors from faults. This should be fine for developers, since it's nearly always only the first few faults that we care about seeing. Plus, you can turn off rate limiting in the kernel if you really need to. Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220429195350.85620-1-lyude@redhat.com commit e0602d3a13e230fd5fb00236f7dc355f1447d8cb Author: Jani Nikula Date: Tue May 3 11:21:34 2022 +0300 drm/i915: warn about missing ->get_buf_trans initialization Make sure each DDI platform has sane ->get_buf_trans initialized. Suggested-by: Matt Roper Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20220503082134.4128355-1-jani.nikula@intel.com commit 7a41a97b65ea7c4e0458b11e7a2c71c6dd3be0c4 Author: Mark Brown Date: Tue May 3 18:02:33 2022 +0100 arm64/sysreg: Generate definitions for SCTLR_EL1 Automatically generate register definitions for SCTLR_EL1. No functional change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220503170233.507788-13-broonie@kernel.org [catalin.marinas@arm.com: fix the SCTLR_EL1 encoding] Signed-off-by: Catalin Marinas commit c55f75c4f9c01934341b59ba8ac7492c13423e5b Author: Uwe Kleine-König Date: Fri Oct 22 12:17:07 2021 +0200 leds: pca9532: Make pca9532_destroy_devices() return void Up to now pca9532_destroy_devices() returns always zero because it's always called with data != NULL. Remove the never-taken error path and make it return void which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König Signed-off-by: Pavel Machek commit 96c59c8ba801bad56f5e635640e1371b1680e42e Author: Satya Priya Date: Tue Feb 22 11:25:07 2022 +0530 leds: Add pm8350c support to Qualcomm LPG driver Add pm8350c compatible and lpg_data to the driver. Signed-off-by: Satya Priya Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Tested-by: Douglas Anderson Signed-off-by: Pavel Machek commit da19d10f5f194a155be8a756551df33a794a08f3 Author: Satya Priya Date: Tue Feb 22 11:25:06 2022 +0530 dt-bindings: leds: Add pm8350c pmic support Add pm8350c pmic pwm support. Signed-off-by: Satya Priya Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Signed-off-by: Pavel Machek commit 60856812f07cd774831dbc7f4da5979ef62d676b Author: Guo Zhengkui Date: Thu May 5 00:09:29 2022 +0800 drm/nouveau/devinit: fix returnvar.cocci warnings Fix the following coccicheck warnings: drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c:71:5-12: Unneeded variable: "disable". Return "0ULL" on line 90. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c:35:5-12: Unneeded variable: "disable". Return "0ULL" on line 44. drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c:35:5-12: Unneeded variable: "disable". Return "0ULL" on line 50. Signed-off-by: Guo Zhengkui Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220504161003.9245-1-guozhengkui@vivo.com commit 325031d4f39cfb1adf41708c1329e60b9abfbdac Author: Alexandru Elisei Date: Thu Apr 28 11:34:05 2022 +0100 KVM: arm64: Print emulated register table name when it is unsorted When a sysreg table entry is out-of-order, KVM attempts to print the address of the table: [ 0.143911] kvm [1]: sys_reg table (____ptrval____) out of order (1) Printing the name of the table instead of a pointer is more helpful in this case. The message has also been slightly tweaked to be point out the offending entry (and to match the missing reset error message): [ 0.143891] kvm [1]: sys_reg table sys_reg_descs+0x50/0x7490 entry 1 out of order Signed-off-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220428103405.70884-3-alexandru.elisei@arm.com commit f1f0c0cfeaa7c10eb536d9919bf3902af0e17bce Author: Alexandru Elisei Date: Thu Apr 28 11:34:04 2022 +0100 KVM: arm64: Don't BUG_ON() if emulated register table is unsorted To emulate a register access, KVM uses a table of registers sorted by register encoding to speed up queries using binary search. When Linux boots, KVM checks that the table is sorted and uses a BUG_ON() statement to let the user know if it's not. The unfortunate side effect is that an unsorted sysreg table brings down the whole kernel, not just KVM, even though the rest of the kernel can function just fine without KVM. To make matters worse, on machines which lack a serial console, the user is left pondering why the machine is taking so long to boot. Improve this situation by returning an error from kvm_arch_init() if the sysreg tables are not in the correct order. The machine is still very much usable for the user, with the exception of virtualization, who can now easily determine what went wrong. A minor typo has also been corrected in the check_sysreg_table() function. Signed-off-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220428103405.70884-2-alexandru.elisei@arm.com commit aadc48f7c4ecd11b4fba7ba7d5ed1788ce32bb78 Author: Katherine Perez Date: Tue Dec 7 15:17:36 2021 -0800 arm64: dts: qcom: sm8350-duo2: enable battery charger Enable the relevant qup and I2C nodes to enable the battery charger. Signed-off-by: Katherine Perez Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211207231736.1762503-2-kaperez@linux.microsoft.com commit ec69dfbdc426f22a9557e5c5408d7902fe0e0144 Author: Bjorn Andersson Date: Mon May 2 14:54:06 2022 -0700 soc: qcom: llcc: Add sc8180x and sc8280xp configurations Add LLCC configuration data for the SC8180X and SC8280XP platforms, based on the downstream tables. Signed-off-by: Bjorn Andersson Reviewed-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20220502215406.612967-3-bjorn.andersson@linaro.org commit d0d8cb7b94b8d23e9721cbbec5c7b00c04ae6514 Author: Bjorn Andersson Date: Mon May 2 14:54:05 2022 -0700 dt-bindings: arm: msm: Add sc8180x and sc8280xp LLCC compatibles Add compatibles for the SC8180X and SC8280XP platforms to the existing LLCC binding. Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220502215406.612967-2-bjorn.andersson@linaro.org commit 82096cc644098ab610e6df5238341907ea662164 Author: Satya Priya Date: Tue Feb 22 11:25:09 2022 +0530 arm64: dts: qcom: Enable pm8350c pwm for sc7280-idp2 Enable pm8350c pmic pwm support for backlight on sc7280-idp2. Signed-off-by: Satya Priya Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645509309-16142-5-git-send-email-quic_c_skakit@quicinc.com commit 5be66d2dc8873edcf215804067b1c076b00c6887 Author: Satya Priya Date: Tue Feb 22 11:25:08 2022 +0530 arm64: dts: qcom: pm8350c: Add pwm support Add pwm support for PM8350C pmic. Signed-off-by: Satya Priya Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645509309-16142-4-git-send-email-quic_c_skakit@quicinc.com commit 1ef64b1e89e6d4018da46e08ffc32779a31160c7 Author: Randy Dunlap Date: Mon Mar 14 17:10:45 2022 -0700 x86/mm: Cleanup the control_va_addr_alignment() __setup handler Clean up control_va_addr_alignment(): a. Make '=' required instead of optional (as documented). b. Print a warning if an invalid option value is used. c. Return 1 from the __setup handler when an invalid option value is used. This prevents the kernel from polluting init's (limited) environment space with the entire string. Fixes: dfb09f9b7ab0 ("x86, amd: Avoid cache aliasing penalties on AMD family 15h") Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Link: https://lore.kernel.org/r/20220315001045.7680-1-rdunlap@infradead.org commit 4c5b2be1d071af26749790429726712e4d9105fb Author: Florian Fainelli Date: Tue Mar 8 12:11:16 2022 -0800 irqchip/gic: Improved warning about incorrect type Issue the warning for interrupt lines that have an incorrect interrupt type and also print the hardware interrupt number to facilitate the resolution of such problems. Signed-off-by: Florian Fainelli Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220308201117.3870678-1-f.fainelli@gmail.com commit 1ce7fc6fd42412ac612b0e295be88562a18eecfc Author: Ian Rogers Date: Thu Apr 28 00:57:24 2022 -0700 perf vendor events intel: Update CLX events to v1.15 Events are generated for CascadeLake Server v1.15 with events from: https://download.01.org/perfmon/CLX/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions, adds INST_DECODED.DECODERS and corrects a counter mask in UOPS_RETIRED.TOTAL_CYCLES. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0c16e931a735500f15db74916db56c698d8ff735 Author: Haowen Bai Date: Thu Mar 17 11:21:24 2022 +0800 irqchip/csky: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. Signed-off-by: Haowen Bai Acked-by: Guo Ren Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/1647487284-30088-1-git-send-email-baihaowen@meizu.com commit 4730d2233311d86cad9dc510318d1b40e4b53cf2 Author: Lucas Stach Date: Wed Apr 6 18:37:01 2022 +0200 irqchip/imx-irqsteer: Add runtime PM support There are now SoCs that integrate the irqsteer controller within a separate power domain. In order to allow this domain to be powered down when not needed, add runtime PM support to the driver. Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406163701.1277930-2-l.stach@pengutronix.de commit e9a50f12e579a48e124ac5adb93dafc35f0a46b8 Author: Lucas Stach Date: Wed Apr 6 18:37:00 2022 +0200 irqchip/imx-irqsteer: Constify irq_chip struct The imx_irqsteer_irq_chip struct is constant data. Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406163701.1277930-1-l.stach@pengutronix.de commit 8ca61cde32c1db778aa52631184484e051cbdf27 Author: Nathan Rossi Date: Fri Apr 22 04:35:32 2022 +0000 irqchip/armada-370-xp: Enable MSI affinity configuration With multiple devices attached via PCIe to an Armada 385 it is possible to overwhelm a single CPU with MSI interrupts. Under certain scenarios configuring the interrupts to be handled by more than one CPU would prevent the system from being overwhelmed. However the irqchip-aramada-370-xp driver is configured to only handle MSIs on the boot CPU, and provides no affinity configuration. This change adds support to the armada-370-xp driver to allow for configuring the affinity of specific MSI irqs and to generate the interrupts on secondary CPUs. This is done by enabling the private doorbell for all online CPUs and configures all CPUs to unmask MSI specific private doorbell bits. The CPU affinity selection of the interrupt is handled by the target list of the software triggered interrupt value, which is provided as the MSI message. The message has the associated CPU bit set for the target CPU. For private doorbell interrupts only one bit can be set otherwise all CPUs will receive the interrupt, so the lowest CPU in the affinity mask is used. This means that by default the first CPU will handle all the interrupts as was the case before. Signed-off-by: Nathan Rossi Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220422043532.146946-1-nathan@nathanrossi.com commit f03a9670d27d23fe734a456f16e2579b21ec02b4 Author: Krzysztof Kozlowski Date: Sat Apr 23 11:42:27 2022 +0200 irqchip/aspeed-scu-ic: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: 04f605906ff0 ("irqchip: Add Aspeed SCU interrupt controller") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220423094227.33148-2-krzysztof.kozlowski@linaro.org commit 50f0f26e7c8665763d0d7d3372dbcf191f94d077 Author: Krzysztof Kozlowski Date: Sat Apr 23 11:42:26 2022 +0200 irqchip/aspeed-i2c-ic: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: f48e699ddf70 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220423094227.33148-1-krzysztof.kozlowski@linaro.org commit 1b2eb89ccf4ffff2ea83c41451b3fed709cd3fc8 Author: Samuel Holland Date: Sun Apr 24 12:39:51 2022 -0500 irqchip/sun6i-r: Use NULL for chip_data sparse complains about using an integer as a NULL pointer. Reported-by: kernel test robot Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220424173952.36591-1-samuel@sholland.org commit 168f633b1722597673e5aa5a6c7721191a9d221f Author: Max Filippov Date: Tue Apr 26 09:19:12 2022 -0700 irqchip/xtensa-mx: Fix initial IRQ affinity in non-SMP setup When irq-xtensa-mx chip is used in non-SMP configuration its irq_set_affinity callback is not called leaving IRQ affinity set empty. As a result IRQ delivery does not work in that configuration. Initialize IRQ affinity of the xtensa MX interrupt distributor to CPU 0 for all external IRQ lines. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220426161912.1113784-1-jcmvbkbc@gmail.com commit 5028fbad2d57910e8c776ba1c868da0e4f64978f Author: Hector Martin Date: Mon May 2 18:14:27 2022 +0900 arm64: Set ARCH_NR_GPIO to 2048 for ARCH_APPLE We're already running into the 512 GPIO limit on t600[01] depending on how many SMC GPIOs we allocate, and a 2-die version could double that. Let's make it 2K to be safe for now. Signed-off-by: Hector Martin Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502091427.28416-1-marcan@marcan.st Signed-off-by: Catalin Marinas commit 4efc851c36e389f7ed432edac0149acc5f94b0c7 Author: Daniel Thompson Date: Tue May 3 14:45:41 2022 +0100 irqchip/exiu: Fix acknowledgment of edge triggered interrupts Currently the EXIU uses the fasteoi interrupt flow that is configured by it's parent (irq-gic-v3.c). With this flow the only chance to clear the interrupt request happens during .irq_eoi() and (obviously) this happens after the interrupt handler has run. EXIU requires edge triggered interrupts to be acked prior to interrupt handling. Without this we risk incorrect interrupt dismissal when a new interrupt is delivered after the handler reads and acknowledges the peripheral but before the irq_eoi() takes place. Fix this by clearing the interrupt request from .irq_ack() if we are configured for edge triggered interrupts. This requires adopting the fasteoi-ack flow instead of the fasteoi to ensure the ack gets called. These changes have been tested using the power button on a Developerbox/SC2A11 combined with some hackery in gpio-keys so I can play with the different trigger mode [and an mdelay(500) so I can can check what happens on a double click in both modes]. Fixes: 706cffc1b912 ("irqchip/exiu: Add support for Socionext Synquacer EXIU controller") Signed-off-by: Daniel Thompson Reviewed-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503134541.2566457-1-daniel.thompson@linaro.org commit 1df1c79cbb7ac9bf148930be3418973c76ba8dde Author: Karol Herbst Date: Wed Apr 20 11:57:20 2022 +0200 drm/i915: Fix race in __i915_vma_remove_closed i915_vma_reopen checked if the vma is closed before without taking the lock. So multiple threads could attempt removing the vma. Instead the lock needs to be taken before actually checking. v2: move struct declaration Cc: Chris Wilson Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: # v5.3+ Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5732 Signed-off-by: Karol Herbst Fixes: 155ab8836caa ("drm/i915: Move object close under its own lock") Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220420095720.3331609-1-kherbst@redhat.com commit a6ad8551b86137cbe266cbbeb512ee550ba3af6e Merge: 4bde53ab3370b 2b2cd74a06c38 Author: Marc Zyngier Date: Wed May 4 16:09:47 2022 +0100 Merge branch irq/gic-v3-5.19 into irq/irqchip-next * irq/gic-v3-5.19: : . : Misc improvements for GICv3: : : - Minimise the number of cases where we need to poll RWP : : - Allow the use of MMIO-based invalidation for LPIs : : - Track GICD/GICR mappings in /proc/iomem : : - Tighten the GICv3 DT binding to avoid endless discussions : on the list... : . irqchip/gic-v3: Claim iomem resources dt-bindings: interrupt-controller: arm,gic-v3: Make the v2 compat requirements explicit irqchip/gic-v3: Relax polling of GIC{R,D}_CTLR.RWP irqchip/gic-v3: Detect LPI invalidation MMIO registers irqchip/gic-v3: Exposes bit values for GICR_CTLR.{IR, CES} Signed-off-by: Marc Zyngier commit ea16c74c29d7e5c9e526cd869f1a928c74b52c44 Author: Jagan Teki Date: Thu Apr 28 15:18:08 2022 +0530 drm: exynos: dsi: Use child panel or bridge find helpers commit <711c7adc4687> ("drm: exynos: dsi: Use drm panel_bridge API") added devm_drm_of_get_bridge for looking up if child node has panel or bridge. However commit ("Revert "drm: of: Lookup if child node has panel or bridge") has reverted panel or bridge child node lookup from devm_drm_of_get_bridge which eventually failed to find the DSI devices in exynos drm dsi driver. So, use the conventional child panel bridge lookup helpers like it does before. Signed-off-by: Jagan Teki Tested-by: Marek Szyprowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220428094808.782938-1-jagan@amarulasolutions.com commit 4b6fd25f3a4c3369679d01d127d81c7b2f384877 Author: Jagan Teki Date: Fri Apr 29 14:29:47 2022 +0530 Revert "drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge" commit <3d7039e1e649> ("drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge") switched to devm_drm_of_get_bridge for looking up if child node has panel or bridge. However commit ("Revert "drm: of: Lookup if child node has panel or bridge") has reverted panel or bridge child node lookup from devm_drm_of_get_bridge as it breaks the non-trivial cases the first child node might not be a panel or bridge. So, revert this commit to switch the previous behavior of looking up child panel or bridge. Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220429085947.1699963-2-jagan@amarulasolutions.com commit 6aba439620123c6bf2201e76d1162e380462e4d6 Author: Jagan Teki Date: Fri Apr 29 14:29:46 2022 +0530 Revert "drm: bridge: mcde_dsi: Drop explicit bridge remove" commit <3730bc6147b0> ("drm: bridge: mcde_dsi: Drop explicit bridge remove") has removed downstream bridge as it's prior commit <3d7039e1e649> ("drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge") added devm_drm_of_get_bridge for looking up if child node has panel or bridge. However commit ("Revert "drm: of: Lookup if child node has panel or bridge") has reverted panel or bridge child node lookup from devm_drm_of_get_bridge as it breaks the non-trivial cases the first child node might not be a panel or bridge. So, revert this commit to switch the previous behavior of looking up child panel or bridge. Link: https://lore.kernel.org/all/20220429085947.1699963-1-jagan@amarulasolutions.com/ Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij Signed-off-by: Maxime Ripard commit 2cd757e6292e23b898791d71978c6edf60a251ad Author: Andrea Zanotti Date: Mon May 2 13:13:00 2022 +0200 spi: omap2-mcspi: add support for interword delay The module omap2-mcspi does not support the interword delay parameter present in the spi transfer. On one side, if the module is instructed to use the dma, this parameter is correctly ignored. However, without the usage of the dma, that parameter should be used. The patch introduce the handling of such delay in the omap2-mcspi module, using standard spi_delay struct. The patch has been tested using as benchmark a DM3730. The delay function used (spi_delay_exec) is already present in the kernel and it checks on its own the validity of the input, as such, no additional checks are present. The range of usage of the udelay function is incremented to 200 us, as the change from udelay to usleep_range introduces not neglectible delays. Signed-off-by: Andrea Zanotti Link: https://lore.kernel.org/r/20220502111300.24754-1-andreazanottifo@gmail.com Signed-off-by: Mark Brown commit 12441ccdf5e2f5a01a46e344976cbbd3d46845c9 Author: Randy Dunlap Date: Sun Mar 13 18:27:25 2022 -0700 x86: Fix return value of __setup handlers __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument (no '=') or environment (with '=') strings. So return 1 from these x86 __setup handlers. Examples: Unknown kernel command line parameters "apicpmtimer BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init apicpmtimer with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable Fixes: 2aae950b21e4 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Fixes: 77b52b4c5c66 ("x86: add "debugpat" boot option") Fixes: e16fd002afe2 ("x86/cpufeature: Enable RING3MWAIT for Knights Landing") Fixes: b8ce33590687 ("x86_64: convert to clock events") Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Link: https://lore.kernel.org/r/20220314012725.26661-1-rdunlap@infradead.org commit 2b2cd74a06c38cc26b2a17854f5e42f7270438eb Author: Robin Murphy Date: Tue Apr 12 16:28:15 2022 +0100 irqchip/gic-v3: Claim iomem resources As a simple quality-of-life tweak, claim our MMIO regions when mapping them, such that the GIC shows up in /proc/iomem. No effort is spent on trying to release them, since frankly if the GIC fails to probe then it's never getting a second try anyway. Signed-off-by: Robin Murphy Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/c534c2a458a3bf94ccdae8abc6edc3d45a689c30.1649777295.git.robin.murphy@arm.com commit d6ffefccf7f04eefddc8e8aa35fb4afe05a42e0c Author: James Zhu Date: Mon Apr 4 17:35:39 2022 -0400 drm/amdgpu/discovery: add VCN 4.0 Support Enable VCN 4.0 on asics where it is present. Signed-off-by: James Zhu Signed-off-by: Alex Deucher commit 9ac0edaa0f8323a8f1ef737174397bd8bd993ace Author: James Zhu Date: Sun Feb 13 11:14:39 2022 -0500 drm/amdgpu: add vcn_4_0_0 video codec query Add vcn_4_0_0 video codec query. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 04270390fe85eb314cce8e67919d69f016239d70 Author: James Zhu Date: Thu Apr 7 01:37:07 2022 -0400 drm/amdgpu/vcn: enable vcn4 dpg mode Enable vcn4 dpg mode. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 7c507d35a53214ea366f2aeda7bebbc94909491b Author: James Zhu Date: Thu Apr 14 10:19:13 2022 -0400 drm/amdgpu/jpeg: enable JPEG PG and CG for VCN4_0_0 Enable JPEG PG and CG for VCN4_0_0. Reviewed-by: Leo Liu Reviewed-by: Sonny Jiang Acked-by: Alex Deucher Signed-off-by: James Zhu Signed-off-by: Alex Deucher commit 8b719b968fac3b212070afc4808ff25e16e24476 Author: Leo Liu Date: Thu Apr 14 10:16:42 2022 -0400 drm/amdgpu: enable VCN4 PG and CG for VCN4_0_0 Most of the tiles can be power/clock gated. Reviewed-by: Sonny Jiang Signed-off-by: Leo Liu Signed-off-by: Alex Deucher commit b13111de32a9202c6d58bb7e4c06296b99c4d7e3 Author: James Zhu Date: Sat Oct 9 16:58:10 2021 -0400 drm/amdgpu/jpeg: add jpeg support for VCN4_0_0 Add jpeg support for VCN4_0_0. Reviewed-by: Leo Liu Reviewed-by: Sonny Jiang Acked-by: Alex Deucher Signed-off-by: James Zhu Signed-off-by: Alex Deucher commit 8da1170a16e4d4b49fa07d1f75ad480847ff7eca Author: Leo Liu Date: Wed Apr 13 11:45:03 2022 -0400 drm/amdgpu: add VCN4 ip block support Add VCN 4.0 initialization and decoder/encoder ring functions. Signed-off-by: Leo Liu Reviewed-by: James Zhu Acked-by: Christian König Signed-off-by: Alex Deucher commit 19dc81b4017baffd6e919fd71cfc8dcbd5442e15 Author: James Zhu Date: Wed Jan 19 23:10:56 2022 -0500 drm/amdgpu: add irq sources for vcn v4_0 Add the interrupt source packet definitions for VCN4. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit b857e1477d94ff6bf493118dd4cd2b2af3964074 Author: James Zhu Date: Sat Dec 4 12:20:37 2021 -0500 drm/amdgpu: move out asic specific definition from common header Move out asic specific definition from common header. Acked-by: Alex Deucher Reviewed-by: Leo Liu Reviewed-by: Sonny Jiang Signed-off-by: James Zhu Signed-off-by: Alex Deucher commit 1218a2e39fded75543d1dea04b8ed50e59ac6cdd Author: Leo Liu Date: Sat Sep 25 20:20:52 2021 -0400 drm/amdgpu: make software ring functions reuseable for newer VCN Software ring will be supported only from VCN4 Signed-off-by: Leo Liu Reviewed-by: James Zhu Acked-by: Christian König Signed-off-by: Alex Deucher commit ed1db32e33ed534fbb914f4e4b5fb7b54448f295 Author: Leo Liu Date: Thu Dec 30 19:34:16 2021 +0800 drm/amdgpu: add vcn 4_0_0 header files v7 Add VCN 4.0.0 registers Signed-off-by: Leo Liu Signed-off-by: Alex Deucher Reviewed-by: James Zhu Acked-by: Christian König Signed-off-by: Alex Deucher commit 8143b87c9dbed25e0c00a1295bd2f2879ed6f85a Author: Stanley Yang Date: Fri Mar 12 18:02:33 2021 +0800 drm/amdgpu/discovery: add SDMA v6_0 ip block Add SDMA v6 ip block for asics which support it. Signed-off-by: Stanley Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 61a039d1757b148717b9e10ea0cd30e5da6cf919 Author: Stanley Yang Date: Wed Apr 13 14:26:40 2022 -0400 drm/amdgpu: add initial support for sdma v6.0 Add functions for SDMA version 6. Signed-off-by: Stanley Yang Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5e779b1745d11fd365a8b92e411f7c0c31ec47cc Author: Hawking Zhang Date: Sun Feb 20 18:22:28 2022 +0800 drm/amdgpu: add sdma v6_0_0 pkt header v3 v1: add sdma v6_0_0 pkt definitions (Hawking) v2: add gcr control field definition (Likun) v3: correct some definitions (Likun) Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 843871e8463d61121e4bb301f777bd26b9ce884c Author: Aric Cyr Date: Sun Apr 24 23:19:52 2022 -0400 drm/amd/display: 3.2.184 This version brings along following fixes: - Have optc3 function accessible to newer DCN - Add CM boot option for USB4 tunneling - Fix system hang issue when game resolution is changed - Remove outdated register for dcn3+ - Add new DSC interface to disconnect from pipe - Clean up pixel format types in enum surface_pixel_format Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ea5a4db9673e651aaad10a9bc6fb8e6f047aaaef Author: Anthony Koo Date: Sat Apr 23 12:01:47 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.115.0 - Add new cmd for querying HPD state Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b6f8389248f0f30596c9d2b0f671936605bf76d7 Author: Aric Cyr Date: Sat Apr 23 15:21:01 2022 -0400 drm/amd/display: Clean up pixel format types [Why & How] Equate the first non-subsampled video surface format to the enum SURFACE_PIXEL_FORMAT_SUBSAMPLE_END since it's not a real format. Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b060022c39f8f07c54f606fc4ac7a6d7e6b05d1e Author: Eric Bernstein Date: Thu Apr 21 16:19:34 2022 -0400 drm/amd/display: Add new DSC interface to disconnect from pipe [Why & How] Add new DSC interface to disconnect from pipe. Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Eric Bernstein Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0292e5b54cb1b51bf1bee24399cfa4af251664a2 Author: Tse, Kaitlyn Date: Tue Apr 19 10:44:26 2022 -0400 drm/amd/display: Remove outdated register for dcn3+ [Why & How] Remove MPCC_OGAM_LUT_RAM_CONTROL register which is outdated. Reviewed-by: Nevenko Stupar Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Tse Kaitlyn Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit eaacf13b33eca727349575c7a0edc39379c9d47e Author: Evgenii Krasnikov Date: Wed Apr 20 16:04:33 2022 -0400 Revert "drm/amd/display: Reset cached PSR parameters after hibernate" This reverts commit d2069326d26c7de78e77a060fb6e6d0d21c35dbd. Commit d2069326d26c ("drm/amd/display: Reset cached PSR parameters after hibernate") causes a system hang when game resolution is changed. Revert it. Reviewed-by: Jayendran Ramani Reviewed-by: Harry Vanzylldejong Acked-by: Wayne Lin Signed-off-by: Evgenii Krasnikov Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0f05c998d16d69079f56a9e24a9e6ace9b0b8a28 Author: Jimmy Kizito Date: Thu Apr 7 13:55:04 2022 -0400 drm/amd/display: Add Connection Manager boot option. [Why] Boot up behaviour may differ depending on the Connection Manager handling USB4 tunneling. [How] Send boot option to firmware to indicate Connection Manager. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 42a809eba53e4d45aa744395a4d63d79debb9796 Author: Lee, Alvin Date: Tue Apr 19 11:22:17 2022 -0400 drm/amd/display: Make OPTC3 function accessible to other DCN [Why] Newer DCN should use optc3 [How] Declare optc3 vmin/vmax function in header. Reviewed-by: Harry Vanzylldejong Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e97b07208d8e17fc4d61961e08feeaeb3a7602af Author: Alex Deucher Date: Wed Apr 13 18:07:17 2022 -0400 drm/amdgpu/discovery: add MES11 support Enable MES 11 on asics which support it. Signed-off-by: Alex Deucher commit f6abd4d9f519621ddae6a4ab06190ff7f9ae9c86 Author: Likun Gao Date: Mon Apr 4 17:02:31 2022 -0400 drm/amdgpu/discovery: add GFX 11.0 Support Enable GFX 11.0 on asics where it is present. Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit d81d75c999366e490d512600c8227dcbbe720239 Author: Jack Xiao Date: Tue Aug 4 15:56:20 2020 +0800 drm/amdgpu/gfx11: enable kiq to map mes ring Enable KIQ to map MES ring: 1). add MES queue mapping support in MAP_QUEUES packet. 2). use correct MQD settings for MES queue. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 12ec9a432b480a82512aaaa936159cced0834deb Author: Jack Xiao Date: Tue Aug 4 15:56:20 2020 +0800 drm/amdgpu/gfx10: enable kiq to map mes ring Enable KIQ to map MES ring: 1). add MES queue mapping support in MAP_QUEUES packet. 2). use correct MQD settings for MES queue. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 65b462fc7ef97dad2fe99b58f0172a14b8948329 Author: Hawking Zhang Date: Wed Apr 6 12:08:12 2022 +0800 drm/amdgpu: enable GENERIC0_INT for gfx/compute pipes To generate an interrupt to RLC for accessing indirect registers that CP can not access directly Signed-off-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b21348a28bffd1fd10eaa92c3fe85b5d7220b76f Author: Evan Quan Date: Thu Apr 14 10:14:34 2022 -0400 drm/amdgpu: enable fgcg for soc21 Enable Fine Grained Clock Gating on soc21 asics. Signed-off-by: Evan Quan Signed-off-by: Alex Deucher commit 390db4b84aacbf3ef631b8045a7c37465b1248ea Author: Evan Quan Date: Thu Apr 14 10:12:10 2022 -0400 drm/amdgpu: enable GFX CGCG/CGLS for GC11.0.0 Enable GFX CGCG (coarse grained clockgating) and CGLS (coarse grained light sleep) for GC11.0.0. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit cc009e613de6560eb499f8bc92c80a737752cb30 Author: Mukul Joshi Date: Tue Apr 26 13:00:11 2022 -0400 drm/amdkfd: Add KFD support for soc21 v3 Add initial support for soc21 in KFD compute driver (Mukul) - Add new definition for soc21 device. - Add new file for amdgpu-kfd interface for GFX11 family. - Add new file for queue management, interrupt handling, mqd management for GFX11 family in KFD driver. - Related changes/updates for soc21 device in KFD driver. - Repurpose last 2 entries of SDMA MQD for driver use. v2: Add an optional argument into update queue operation (Mukul) v3: Switch to ip version check, replace kgd_dev with amdgpu_device (Hawking) Signed-off-by: Mukul Joshi Signed-off-by: Hawking Zhang Reviewed-by: Oak Zeng Signed-off-by: Alex Deucher commit 3b9186fa868be5d0f2756d06af54c497288d2601 Author: Alex Deucher Date: Tue Mar 29 16:41:12 2022 -0400 drm/amdkfd: add helper to generate cache info from gfx config Rather than using hardcoded tables, we can use the gfx and gmc config pulled from the IP discovery table to generate the cache configuration. Acked-by: Christian König Signed-off-by: Alex Deucher commit 3d879e81f0f9ed5d33b5eda0fe5226c884bb8073 Author: Hawking Zhang Date: Wed Apr 13 14:27:32 2022 -0400 drm/amdgpu: add init support for GFX11 (v2) Add initial support for GC version 11. GC is the graphics and compute block on the GPU. v1: add initial gfx11 support (Wenhui) v2: switch to new amdgpu_gfx_is_high_priority_compute_queue interface (Hawking) v3: fix num_mec (Alex) Signed-off-by: Wenhui Sheng Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 028c3fb37e705b8fa1448c23c42d1c89f48c07c5 Author: Jack Xiao Date: Wed Apr 13 14:30:03 2022 -0400 drm/amdgpu/mes11: initiate mes v11 support Initiate mes v11 code base from mes v10, rename function and register names. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 289bcffb9d76f575995113dd48c09de7f2deb1d1 Author: Likun Gao Date: Wed Apr 13 14:28:02 2022 -0400 drm/amdgpu: support imu for gfx11 Add support to initialize imu for gfx v11. IMU is a new power management block for gfx which manages gfx power. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 18ee4ce63e0f32cc63dcadb1062e7a3446ead338 Author: Jack Xiao Date: Wed Apr 13 14:30:37 2022 -0400 drm/amdgpu: add mes unmap legacy queue routine For mes kiq has been taken over by mes sched, drv can't directly use mes kiq to unmap queues. drv has to use mes sched api to unmap legacy queue. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 14ab29241817582e1b92c29ccd738354b2d3241b Author: Likun Gao Date: Tue Apr 12 17:00:11 2022 -0400 drm/amdgpu: support RS64 CP fw front door load Support to load RS64 CP firmware front door load. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8e070831d3f814013796a32d1588447592cd589f Author: Likun Gao Date: Fri Mar 12 17:27:44 2021 +0800 drm/amdgpu: renovate sdma fw struct Add sdma firmware struct version 2 to support new SDMA v6 and forward firmware version. v2: squash in fix Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a8bc8923987caa0d674674cc9652f08ceafdf77b Author: Alex Deucher Date: Wed Apr 13 18:08:49 2022 -0400 drm/amdgpu/discovery: handle AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO in SMU Handle SMU load ordering when firmware load type is AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO. This works similarly to AMDGPU_FW_LOAD_DIRECT where the SMU load order is different from the standard ordering when front door loading is enabled. Signed-off-by: Alex Deucher commit aca670e41f9fe52176040553f174d517cbd69da9 Author: Likun Gao Date: Tue Apr 12 16:57:45 2022 -0400 drm/amdgpu: fix the fw size for sdma For SDMA, if use the total size of SDMA TH0 and TH1 to allocate fw BO may result to the ucode data overflow when copy ucode to BO as the PAGE alignment. IMU have the same issue. Fix the above issue by alignment the fw size per fw ID. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a76be7bbc3d7213e2e5ef9cbfa397c3ef48fb8b9 Author: Chengming Gui Date: Thu Feb 17 18:01:27 2022 +0800 drm/amd/amdgpu: add more fw load type to fit new ASICs Align exported fw load types with internal used. Signed-off-by: Chengming Gui Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fd0ed91ae8a2b5f3d61a6356b6aaeb2f5b097950 Author: Jack Xiao Date: Tue Apr 12 16:17:41 2022 -0400 drm/amdgpu: correct cp doorbell range 1. move MES doorbell inside the mec doorbell range, for mes belongs to mec block 2. setting the correct gfx/mec doorbell range, so that fw can correctly detect gfx/compute work load to enter/exit power saving state. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Tested-and-acked-by: Evan Quan Signed-off-by: Alex Deucher commit ae2d50be7efce273f769a800c8956b7e86c79b60 Author: Chengming Gui Date: Thu Feb 17 19:22:01 2022 +0800 drm/amd/amdgpu: adjust the fw load type list Use 0 for legacy backdoor and 1 for frontdoor. Signed-off-by: Chengming Gui Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 7edda6749fb76ce84d7c0b2a9858be384eeecbf7 Author: Likun Gao Date: Mon May 31 14:16:56 2021 +0800 drm/amdgpu/gfx: refine fw hdr check fuction The return value of function amdgpu_ucode_hdr_version doesn't make sense, so change it to return true when fw header version is match with passed in parameters. Signed-off-by: Wenhui Sheng Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 619c94c3b5494a1c0654fde415083a589d3f0048 Author: Likun Gao Date: Tue Sep 7 11:38:41 2021 +0800 drm/amdgpu: extend the show ucode name function Extend amdgpu_ucode_name function to show SDMA TH0, TH1, IMU, RLCP, RLCV and MES related ucode name via ucode id. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4e9d10ce445ba75a42d1a509f88c87347c848fa9 Author: Likun Gao Date: Mon Apr 11 17:37:21 2022 -0400 drm/amdgpu: init SDMA v6 microcode with PSP load type Update to use new SDMA UCODE ID when init sdma microcode for sdma6 with psp front door load type. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit be3a3409ef1d674da35cfb27028e61a6f90fb952 Author: Likun Gao Date: Wed Jan 26 20:07:08 2022 +0800 drm/amdgpu: add convert for new gfx type Add convert for CP RS64 related gfx ip type. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a32fa029218f17f48af8bb56e8f618befc650671 Author: Likun Gao Date: Tue Apr 5 13:42:51 2022 -0400 drm/amdgpu: support IMU front door load Support for front door to load IMU firmware. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d6b4014ad7b9bf9dac5d42a485ed104d1578b453 Author: Jack Xiao Date: Mon Apr 11 17:05:20 2022 -0400 drm/amdgpu: add new CP_MES ucode ids Needed for MES KIQ firmware loading. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6777c8cfcace139822f645c59102d556c541d6d4 Author: Likun Gao Date: Wed Sep 1 15:25:51 2021 +0800 drm/amdgpu: support for new SDMA front door load Support for SDMA v6_0 ucode front door load. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8e41a56a79a74e5bb99628231c21dd902b8badc4 Author: Likun Gao Date: Mon Apr 11 17:18:34 2022 -0400 drm/amdgpu: support RLCV firmware front door load Support RLCV firmware front door load. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a0fe38b4908639a57be797307e6bbd43e1e520cf Author: Likun Gao Date: Mon Apr 11 17:16:37 2022 -0400 drm/amdgpu: support RLCP firmware front door load Support RLCP firmware front door load. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 464913c0dd3bc5f05befa62a38e0f5327736c95f Author: Mukul Joshi Date: Wed Sep 2 15:34:04 2020 -0400 drm/amdgpu/mes: Update the doorbell function signatures Update the function signatures for process doorbell allocations with MES enabled to make them more generic. KFD would need to access these functions to allocate/free doorbells when MES is enabled. Signed-off-by: Mukul Joshi Acked-by: Oak Zeng Reviewed-by: Felix Kuehling Reviewed-by: Jack Xiao Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit da1c0338f035e51ba718bf446a82121e973f7d1f Author: Jack Xiao Date: Wed May 26 14:00:11 2021 +0800 drm/amdgpu/mes: disable mes sdma queue test Disable mes sdma queue test on sienna cichlid+, for fw hasn't supported to map sdma queue. The test can be enabled if fw supports. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7c18b40e220a6213f3e63e89b761ef3ba056815e Author: Jack Xiao Date: Fri Feb 25 17:46:25 2022 +0800 drm/amdgpu/mes: fix vm csa update issue Need reserve VM buffers before update VM csa. v2: rebase fixes Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2131733594946fc789e7b216b5aa6446d476a4f1 Author: Jack Xiao Date: Thu Mar 26 14:34:24 2020 +0800 drm/amdgpu/mes10.1: add mes self test in late init Add MES self test in late init. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6624d161039734e58fd1f045a5d821d3907f47ab Author: Jack Xiao Date: Sat Mar 28 00:23:34 2020 +0800 drm/amdgpu/mes: implement mes self test Add mes self test to verify its fundamental functionality by running ring test and ib test of mes kernel queue. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cdb7476d9692c84ba204e0b4172998506b41f270 Author: Jack Xiao Date: Sat Mar 28 00:18:26 2020 +0800 drm/amdgpu/mes: add ring/ib test for mes self test Run the ring test and ib test for mes self test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f1d93c9c2722a2fc25cdb93b5f99da7252cae6c1 Author: Jack Xiao Date: Fri Mar 27 21:38:42 2020 +0800 drm/amdgpu/mes: create gang and queues for mes self test Create gang and queues for mes self test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a22f760a02f80d140147de4b504bd7531b268e62 Author: Jack Xiao Date: Fri Mar 27 21:36:43 2020 +0800 drm/amdgpu/mes: map ctx metadata for mes self test Map ctx metadata for mes self test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 712ce872213c1d503c6e65deab91769d63f980d1 Author: Jack Xiao Date: Tue Jun 16 11:50:12 2020 +0800 drm/amdgpu: kiq takes charge of all queues To make kgq/kcq and mes queue co-exist, kiq needs take charge of all queues. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a4a5f5cab6128953b87c01f359e9b0b4e82b7be4 Author: Jack Xiao Date: Fri Mar 20 15:12:26 2020 +0800 drm/amdgpu: skip gds switch for mes queue For mes manages gds allocation, skip gds switch. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9d3bccdc720c4522e8e1a65d732d0a33539daba5 Author: Jack Xiao Date: Fri Mar 20 15:07:27 2020 +0800 drm/amdgpu: skip kiq ib tests if mes enabled For kiq conflicts with mes, skip kiq ib tests. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f89703f5619ca0c49f5672784698dd6f1d4ed66e Author: Jack Xiao Date: Fri Mar 20 14:59:54 2020 +0800 drm/amdgpu: skip some checking for mes queue ib submission Skip some checking for mes queue ib submission. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c004d44e1037752a1a5a271a6915a57d3e2ebc43 Author: Mukul Joshi Date: Thu Mar 31 15:00:46 2022 -0400 drm/amdgpu: Enable KFD with MES enabled Enable KFD initialization with MES enabled. Signed-off-by: Mukul Joshi Acked-by: Oak Zeng Reviewed-by: Felix Kuehling Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 9c12f5cd06f88821ba5ea46ef874dd92580a2a00 Author: Jack Xiao Date: Thu Mar 31 14:09:30 2022 -0400 drm/amdgpu: skip kfd routines when mes enabled For kfd hasn't supported mes, skip kfd routines. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e3652b0976f383dea912607a404e974632b019b1 Author: Jack Xiao Date: Fri Mar 27 18:11:15 2020 +0800 drm/amdgpu/mes: add helper functions to alloc/free ctx metadata Add the helper functions to allocate/free context metadata. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9cc654c8ceb6561dc7f646a142535737932a0309 Author: Jack Xiao Date: Fri Mar 27 18:04:36 2020 +0800 drm/amdgpu/mes: implement removing mes ring Remove the mes ring and its resources. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d0c423b64765a5060aa56e6df147c45ac696b5dd Author: Jack Xiao Date: Fri Mar 27 17:30:00 2020 +0800 drm/amdgpu/mes: use ring for kernel queue submission Use ring as the front end for kernel queue submission. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 11ec5b3605db3a136c1a0fde0d78883f6361d666 Author: Jack Xiao Date: Fri Mar 27 17:42:01 2020 +0800 drm/amdgpu/mes: add helper function to get the ctx meta data offset Add the helper function to get the corresponding ctx meta data offset. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1a27aacb6ed7422eb9c47e03d3355d201c35f224 Author: Jack Xiao Date: Fri Mar 27 17:16:28 2020 +0800 drm/amdgpu/mes: add helper function to convert ring to queue property Add the helper function to convert ring to queue property. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bcc4e1e1d43d6fe7cd8e6892e01572ee8ba78cba Author: Jack Xiao Date: Fri Mar 27 17:08:40 2020 +0800 drm/amdgpu/mes: implement removing mes queue Remove the MES queue from MES scheduling and free its resources. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit be5609de15aab00a5154979c0112fd9c31051f75 Author: Jack Xiao Date: Fri Mar 27 16:58:55 2020 +0800 drm/amdgpu/mes: implement adding mes queue Allocate related resources for the queue and add it to mes for scheduling. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5fa963d0fc358766adb6c12f0eafe81b2735fc17 Author: Jack Xiao Date: Wed Jul 1 14:58:46 2020 +0800 drm/amdgpu/mes: initialize mqd from queue properties Add helper function to initialize mqd from queue properties. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ea756bd5cc675b8dfb2be4069c620302200ecc2f Author: Jack Xiao Date: Fri Mar 27 16:43:28 2020 +0800 drm/amdgpu/mes: implement resuming all gangs Implement resuming all gangs. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c8bb10572ca3a03aa0a11d0ba2d87c205f140883 Author: Jack Xiao Date: Fri Mar 27 16:41:56 2020 +0800 drm/amdgpu/mes: implement suspending all gangs Implement suspending all gangs. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b0306e584004b20d406d8111cb8922b7bb8d8840 Author: Jack Xiao Date: Thu Mar 24 11:35:29 2022 +0800 drm/amdgpu/mes: implement removing mes gang Free the mes gang and its resources. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5d0f619f723d0caa909e99c875a0c813588a0d68 Author: Jack Xiao Date: Fri Mar 27 15:27:48 2020 +0800 drm/amdgpu/mes: implement adding mes gang Gang is a group of the same type queue, which is the scheduling unit of mes hardware scheduler. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 063a38d6628e7c91e808cab8f83384c51cb5c853 Author: Jack Xiao Date: Fri Mar 27 15:10:55 2020 +0800 drm/amdgpu/mes: implement destroying mes process Destroy the mes process, which free resources of the process. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 48dcd2b751d3e3f4a46447263817b3b4b15c2328 Author: Jack Xiao Date: Fri Mar 27 15:03:16 2020 +0800 drm/amdgpu/mes: implement creating mes process v2 Create a mes process which contains process-related resources, like vm, doorbell bitmap, process ctx bo and etc. v2: move the simple variable to the end Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 29634c3f8b44ae982001b471aabdd6fa7393ea34 Author: Jack Xiao Date: Tue Jun 16 15:34:57 2020 +0800 drm/amdgpu/mes10.1: implement the suspend/resume routine Implement the suspend/resume routine of mes. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7149599be4085117ff21b2988890491fff25fecf Author: Jack Xiao Date: Thu Jun 4 18:27:28 2020 +0800 drm/amdgpu/mes10.1: add delay after mes engine enable Add delay after mes engine enable, for it needs more time to complete engine initialising. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4df80927377b82e139a5d79151a824a3fb6ce787 Author: Jack Xiao Date: Wed Mar 25 18:27:19 2020 +0800 drm/amdgpu/mes10.1: call general mes initialization Call general mes initialization/finalization. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0bf478f01abf1c35fd706081c4686fd0250eb559 Author: Jack Xiao Date: Sat Mar 28 15:32:27 2020 +0800 drm/amdgpu/mes: relocate status_fence slot allocation Move the status_fence slot allocation from ip specific function to general mes function. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b04c1d64685ecc45f68c6e3667d662cf8633d027 Author: Jack Xiao Date: Fri Mar 27 14:50:01 2020 +0800 drm/amdgpu/mes: initialize/finalize common mes structure v2 Initialize/finalize common mes structure. v2: add mutex_init for adev->mes.mutex Cc: Le Ma Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 534000c0802a304c26909defb289e2a403b4aa8e Author: Jack Xiao Date: Fri Mar 20 14:09:54 2020 +0800 drm/amdgpu: add mes queue id mask v2 Add MES queue id mask. v2: move queue id mask to amdgpu_mes_ctx.h Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 32de57e9ef59b6f646849a8bd615b7c978a4fa6d Author: Jack Xiao Date: Mon Apr 11 16:46:13 2022 -0400 drm/amdgpu/mes: manage mes doorbell allocation It is used to manage the doorbell allocation of mes processes and queues. Driver calls into process doorbell allocation to get the slice doorbell for the process, then the doorbell for a queue is allocated from the process doorbell slice. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f10e80e3a4171a451027e480dafde6c8c3974eb7 Author: Jack Xiao Date: Wed Apr 14 20:08:37 2021 +0800 drm/amdgpu: enable mes kiq N-1 test on sienna cichlid Enable kiq support on gfx10.3, enable mes kiq (n-1) test on sienna cichlid, so that mes kiq can be tested on sienna cichlid. The patch can be dropped once mes kiq is functional. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b0f340288bfb12476ea8126b17f514ceb97ab234 Author: Jack Xiao Date: Wed Apr 14 19:50:54 2021 +0800 drm/amdgpu: add mes kiq frontdoor loading support Add mes kiq frontdoor loading support. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cf064b458976e13288400927d8de2f875f2f89cc Author: Jack Xiao Date: Mon Apr 11 16:32:58 2022 -0400 drm/amdgpu/mes: add mes kiq callback Needed to properly initialize mes kiq. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c1248e11247bb16a630e139d5f55bea69c1fc1ee Author: Likun Gao Date: Mon Sep 6 17:14:02 2021 +0800 drm/amdgpu: add mes kiq PSP GFX FW type Add MES KIQ PSP GFX FW type and the convert type. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8183d7436ab55a85be664755f4877b0f6448cbd5 Author: Jack Xiao Date: Thu Mar 26 10:57:43 2020 +0800 drm/amdgpu/sdma5: add mes support for sdma ib test Add MES support for sdma ib test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ea93ac2f4e1e46be29bf1478adba922069226bf2 Author: Jack Xiao Date: Thu Mar 26 10:56:11 2020 +0800 drm/amdgpu/sdma5: add mes support for sdma ring test Add MES support for sdma ring test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 76411afd5bc52470c6ba36cfdaae49248279c33d Author: Jack Xiao Date: Thu Mar 26 10:50:58 2020 +0800 drm/amdgpu/sdma5: add mes queue fence handling From IH ring buffer look up the coresponding kernel queue and process. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 217d29f1382e58a08d960cbb02494824efb9753e Author: Jack Xiao Date: Thu Mar 26 10:53:16 2020 +0800 drm/amdgpu/sdma5: associate mes queue id with fence Associate mes queue id with fence, so that EOP trap handler can look up which queue issues the fence. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 810479bad3661025cbafac54c75addfc93914b58 Author: Jack Xiao Date: Thu Mar 26 10:45:38 2020 +0800 drm/amdgpu/sdma5: initialize sdma mqd Initialize sdma mqd according to ring settings. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c097aac7d9e250bbeabd83c51c7858c8300f23ee Author: Jack Xiao Date: Sun Mar 22 17:24:07 2020 +0800 drm/amdgpu/sdma5.2: add mes support for sdma ib test Add MES support for sdma ib test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7e5e7971ce77428f836a7f4e4f00f7c1ae1f463e Author: Jack Xiao Date: Sun Mar 22 17:15:42 2020 +0800 drm/amdgpu/sdma5.2: add mes support for sdma ring test Add MES support for sdma ring test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 254492b66ca3f74d91e66feb0713cb03798e7f59 Author: Jack Xiao Date: Sun Mar 22 16:48:48 2020 +0800 drm/amdgpu/sdma5.2: add mes queue fence handling From IH ring buffer, look up the coresponding kernel queue and process. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6f120134ff7a67f282838b606daf62fd5fe54006 Author: Jack Xiao Date: Sun Mar 22 17:00:59 2020 +0800 drm/amdgpu/sdma5.2: associate mes queue id with fence Associate mes queue id with fence, so that EOP trap handler can look up which queue issues the fence. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e0f5b4c9af6c8dd187b53918b665669a7110d054 Author: Jack Xiao Date: Sun Mar 22 13:51:02 2020 +0800 drm/amdgpu/sdma5.2: initialize sdma mqd Initialize sdma mqd according to ring settings. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 065891958d8c9bd96d1adbadc3c1251a14cf14fc Author: Jack Xiao Date: Sun Mar 22 13:31:52 2020 +0800 drm/amdgpu/sdma: use per-ctx sdma csa address for mes sdma queue Use per context sdma csa address for mes sdma queue. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a3d686a6adbeb69806aa4c7a1cc338571bc423e9 Author: Jack Xiao Date: Thu Mar 31 14:17:50 2022 -0400 drm/amdgpu: don't use kiq to flush gpu tlb if mes enabled If MES is enabled, don't use kiq to flush gpu tlb, for it would result in conflicting with mes fw. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 15d839c16a66434c19f9c8a560b7553f9468e588 Author: Jack Xiao Date: Tue Apr 26 12:16:42 2022 -0400 drm/amdgpu/gfx10: add mes support for gfx ib test Add mes support for gfx ib test. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 954e0a72b4220cba6bfcf50a3f13ed29f233b170 Author: Jack Xiao Date: Fri Mar 20 12:37:49 2020 +0800 drm/amdgpu/gfx10: add mes queue fence handling From IH ring buffer, look up the coresponding kernel queue and process. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 207e8bbe667fa1368155bae8d0e92041a4c1c079 Author: Jack Xiao Date: Wed Apr 14 18:00:13 2021 +0800 drm/amdgpu/mes: extend mes framework to support multiple mes pipes Add support for multiple mes pipes, so that reuse the existing code to initialize more mes pipe and queue. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b608e785e1ed7c665b4eeff79e267322eff3c847 Author: Jack Xiao Date: Wed Apr 14 16:22:43 2021 +0800 drm/amdgpu: allocate doorbell index for mes kiq Allocate a doorbell index for mes kiq queue. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 928fe236c002ed75dfb3b7a0abe6e3d2a3c87376 Author: Jack Xiao Date: Wed Apr 14 16:04:31 2021 +0800 drm/amdgpu: add mes_kiq module parameter v2 mes_kiq parameter is used to enable mes kiq pipe. This module parameter is unneccessary or enabled by default in final version. v2: reword commit message. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3a42c7f38bde9d86d82083fe8b5111baf698dc32 Author: Jack Xiao Date: Fri Mar 27 13:15:56 2020 +0800 drm/amdgpu: update mes process/gang/queue definitions Update the definitions of MES process/gang/queue. v2: add missing includes v3: rebase fix, include mm.h Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4053b6b43fae126bea0654493fe512d364ee9fc1 Author: Marc Zyngier Date: Sat Apr 9 11:16:17 2022 +0100 dt-bindings: interrupt-controller: arm,gic-v3: Make the v2 compat requirements explicit A common mistake when writing a device tree for a platform that is using GICv3 with ancient CPUs is to overlook the MMIO frames that implement the GICv2 compatibility feature, because this feature is implemented by the CPUs and not by the GIC itself. The compatibility feature itself is optional (all the modern implementations have dropped it), but is present in all the ARM Ltd implementations of the ARMv8.0 architecture (A3x, A53, A57, A72, A73), and many others from various implementers. Make it explicit that GICC, GICH and GICV are required for these CPUs. Also take this opportunity to update my email address, as people keep sending them to the wrong place... Signed-off-by: Marc Zyngier Cc: Rob Herring Cc: Krzysztof Kozlowski Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220409101617.268796-1-maz@kernel.org commit 63f13483f0689a4de20fbfd847866ab39bec736f Author: Marc Zyngier Date: Tue Apr 5 19:38:57 2022 +0100 irqchip/gic-v3: Relax polling of GIC{R,D}_CTLR.RWP Recent work on the KVM GIC emulation has revealed that the GICv3 driver is a bit RWP-happy, as it polls this bit for each and every write MMIO access involving a single interrupt. As it turns out, polling RWP is only required when: - Disabling an SGI, PPI or SPI - Disabling LPIs at the redistributor level - Disabling groups - Enabling ARE - Dealing with DPG* Simplify the driver by removing all the other instances of RWP polling, and add the one that was missing when enabling the distributor (as that's where we set ARE). Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220405183857.205960-4-maz@kernel.org commit a837ed362e7070d48b6064138d3b61eb75eb9fd9 Author: Marc Zyngier Date: Tue Apr 5 19:38:56 2022 +0100 irqchip/gic-v3: Detect LPI invalidation MMIO registers Since GICv4.1, an implementation can offer the same MMIO-based implementation as DirectLPI, only with an ITS. Given that this can be hugely beneficial for workloads that are very LPI masking heavy (although these workloads are admitedly a bit odd). Interestingly, this is independent of RVPEI, which only *implies* the functionnality. So let's detect whether the implementation has GICR_CTLR.IR set, and propagate this as DirectLPI to the ITS driver. While we're at it, repaint the GICv3 banner so that we advertise the various capabilities at boot time to be slightly less invasive. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220405183857.205960-3-maz@kernel.org commit 0f2d636e7d1fd76f704dd3ea5089ce29a8aee049 Author: Zev Weiss Date: Tue May 3 23:52:49 2022 -0700 regulator: core: Add error flags to sysfs attributes If a regulator provides a get_error_flags() operation, its sysfs attributes will now include an entry for each defined REGULATOR_ERROR_* flag. Signed-off-by: Zev Weiss Link: https://lore.kernel.org/r/20220504065252.6955-3-zev@bewilderbeest.net Signed-off-by: Mark Brown commit e84f3c41a583408c7c67ed7824a7ff14ff40d045 Author: Krzysztof Kozlowski Date: Tue Apr 26 12:55:01 2022 +0200 regulator: dt-bindings: qcom,rpmh: document vdd-l7-bob-supply on PMR735A The PMR735A comes with vdd-l7-bob-supply supply which was previously not documented. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220426105501.73200-4-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit ba5d99609a5e6a3d0d9ac2574250208457d839cc Author: Krzysztof Kozlowski Date: Tue Apr 26 12:55:00 2022 +0200 regulator: dt-bindings: qcom,rpmh: document supplies per variant The RPMH regulator binding covers several devices with different regulator supplies, so it uses patterns matching broad range of these supplies. This works fine but is not specific and might miss actual mistakes when a wrong supply property is used for given variant. Describe the supplies depending on the compatible, using a defs-allOf method. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220426105501.73200-3-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit a6d889a8fdbb8cb4b0d01f30f93357f3ffd61f06 Author: Krzysztof Kozlowski Date: Tue Apr 26 12:54:59 2022 +0200 regulator: dt-bindings: qcom,rpmh: update maintainers David Collins' email bounces ("Recipient address rejected: undeliverable address: No such user here"). Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426105501.73200-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 6ff98a694cc114fd79f692345a7fbd469f800f8c Author: Richard Fitzgerald Date: Wed May 4 14:44:58 2022 +0100 ASoC: cs35l45: Enable BOOST Do not disable the boost converter during probe. The silicon contains functional default tunings so the boost converter can be left at the chip default enabled state. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220504134458.283780-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 43556516fffe1d2be2d4a73cfe7cd34d6062dd11 Author: Sascha Hauer Date: Mon May 2 15:13:35 2022 +0200 ASoC: soc-generic-dmaengine-pcm: Use default config when none is given snd_dmaengine_pcm_register() can be passed a NULL pointer for the config which means that the we have to test for pcm->config being non NULL before accessing it. Make the code more straight forward by providing a default config when none is passed. With this pcm->config is never NULL and we can skip all the if (pcm->config) tests. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220502131335.2604158-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit f80beaf6f2b1eb55fb1b2128a43e0a0c9c4d19de Author: Peter Ujfalusi Date: Wed May 4 13:28:31 2022 +0300 ASoC: SOF: ipc3: Remove the ipc3-ops.h header file Only the main IPC ops struct should be visible outside of IPC3 code to make sure that the code is correctly abstracted. Instead of keeping the ipc3-ops.h with only the high level ops struct declaration, put the ipc3_ops to sof-priv.h and move all other ops struct declaration into ipc3-priv.h New IPC implementation should follow this route: the main IPC ops should be declared in sof-priv.h and no other IPC version related header be used for generic code. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220504102831.10071-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c0b38be14f1d843c29edc763d3df3cc741a2bf10 Merge: 55d2a66cfec6a a962890a5a3cc Author: Mark Brown Date: Wed May 4 15:30:32 2022 +0100 ASoC: Pull in fixes Cleanups for the dmaengine code build on top of current fixes. commit 41fde735062d8dbf7ebf27b278ac567eaf8d9255 Author: Mark Brown Date: Tue May 3 18:02:32 2022 +0100 arm64/sysreg: Generate definitions for TTBRn_EL1 Automatically generate definitions for accessing the TTBRn_EL1 registers, no functional change. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-12-broonie@kernel.org Signed-off-by: Catalin Marinas commit e33bb6461cd6ca0e0dad8392f0e3ee0179871e7a Author: Mark Brown Date: Tue May 3 18:02:31 2022 +0100 arm64/sysreg: Generate definitions for ID_AA64ISAR0_EL1 Remove the manual definitions for ID_AA64ISAR0_EL1 in favour of automatic generation. There should be no functional change. The only notable change is that 27:24 TME is defined rather than RES0 reflecting DDI0487H.a. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-11-broonie@kernel.org Signed-off-by: Catalin Marinas commit c07d8017bceb82cbe5fedd129d072c59a53f5513 Author: Mark Brown Date: Tue May 3 18:02:30 2022 +0100 arm64/sysreg: Enable automatic generation of system register definitions Now that we have a script for generating system registers hook it up to the build system similarly to cpucaps. Since we don't currently have any actual register information in the input file this should produce no change in the built kernel. For ease of review the register information will be converted in separate patches. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-10-broonie@kernel.org Signed-off-by: Catalin Marinas commit 66847e0618d7dcaf34d9626e2b1f699fc05a2fef Author: Mark Rutland Date: Tue May 3 18:02:29 2022 +0100 arm64: Add sysreg header generation scripting The arm64 kernel requires some metadata for each system register it may need to access. Currently we have: * A SYS_ definition which sorresponds to a sys_reg() macro. This is used both to look up a sysreg by encoding (e.g. in KVM), and also to generate code to access a sysreg where the assembler is unaware of the specific sysreg encoding. Where assemblers support the S3__C_C_ syntax for system registers, we could use this rather than manually assembling the instructions. However, we don't have consistent definitions for these and we currently still need to handle toolchains that lack this feature. * A set of __SHIFT and __MASK definitions, which can be used to extract fields from the register, or to construct a register from a set of fields. These do not follow the convention used by , and the masks are not shifted into place, preventing their use in FIELD_PREP() and FIELD_GET(). We require the SHIFT definitions for inline assembly (and WIDTH definitions would be helpful for UBFX/SBFX), so we cannot only define a shifted MASK. Defining a SHIFT, WIDTH, shifted MASK and unshifted MASK is tedious and error-prone and life is much easier when they can be relied up to exist when writing code. * A set of __ definitions for each enumerated value a field may hold. These are used when identifying the presence of features. Atop of this, other code has to build up metadata at runtime (e.g. the sets of RES0/RES1 bits in a register). This patch adds scripting so that we can have an easier-to-manage canonical representation of this metadata, from which we can generate all the definitions necessary for various use-cases, e.g. | #define REG_ID_AA64ISAR0_EL1 S3_0_C0_C6_0 | #define SYS_ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0) | #define SYS_ID_AA64ISAR0_EL1_Op0 3 | #define SYS_ID_AA64ISAR0_EL1_Op1 0 | #define SYS_ID_AA64ISAR0_EL1_CRn 0 | #define SYS_ID_AA64ISAR0_EL1_CRm 6 | #define SYS_ID_AA64ISAR0_EL1_Op2 0 | #define ID_AA64ISAR0_EL1_RNDR GENMASK(63, 60) | #define ID_AA64ISAR0_EL1_RNDR_MASK GENMASK(63, 60) | #define ID_AA64ISAR0_EL1_RNDR_SHIFT 60 | #define ID_AA64ISAR0_EL1_RNDR_WIDTH 4 | #define ID_AA64ISAR0_EL1_RNDR_NI UL(0b0000) | #define ID_AA64ISAR0_EL1_RNDR_IMP UL(0b0001) The script requires that all bits in the register be specified and that there be no overlapping fields. This helps the script spot errors in the input but means that the few registers which change layout at runtime depending on things like virtualisation settings will need some manual handling. No actual register conversions are done here but a header for the register data with some documention of the format is provided. For cases where multiple registers share a layout (eg, when identical controls are provided at multiple ELs) the register fields can be defined once and referenced from the actual registers, currently we do not generate actual defines for the individual registers. At the moment this is only intended to express metadata from the architecture, and does not handle policy imposed by the kernel, such as values exposed to userspace or VMs. In future this could be extended to express such information. This script was mostly written by Mark Rutland but has been extended by Mark Brown to improve validation of input and better integrate with the kernel. Signed-off-by: Mark Rutland Co-Developed-by: Mark Brown Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220503170233.507788-9-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0eda2ec48907f0ec8c283306c98f28d13e43dafd Author: Mark Brown Date: Tue May 3 18:02:28 2022 +0100 arm64/sysreg: Standardise ID_AA64ISAR0_EL1 macro names The macros for accessing fields in ID_AA64ISAR0_EL1 omit the _EL1 from the name of the register. In preparation for converting this register to be automatically generated update the names to include an _EL1, there should be no functional change. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-8-broonie@kernel.org Signed-off-by: Catalin Marinas commit 6329eb543d991a120fba5de1362fa3df7b6b62e1 Author: Mark Brown Date: Tue May 3 18:02:27 2022 +0100 arm64: Update name of ID_AA64ISAR0_EL1_ATOMIC to reflect ARM The architecture reference manual refers to the field in bits 23:20 of ID_AA64ISAR0_EL1 with the name "atomic" but the kernel defines for this bitfield use the name "atomics". Bring the two into sync to make it easier to cross reference with the specification. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit 56eb621b8ab6c1d36e9eb6e75367ec49ba482f1a Author: Mark Brown Date: Tue May 3 18:02:26 2022 +0100 arm64/sysreg: Define bits for previously RES1 fields in SCTLR_EL1 In older revisions of the architecture SCTLR_EL1 contained several RES1 fields but in DDI0487H.a these now all have assigned functions. In preparation for automatically generating sysreg.h provide explicit definitions for all these bits and use them in the INIT_SCTLR_EL1_ macros where _RES1 was previously used. There should be no functional change. Signed-off-by: Mark Brown Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit e4e6a9d5593c18b637668ac70ea1bfa868b5c210 Author: Mark Brown Date: Tue May 3 18:02:25 2022 +0100 arm64/sysreg: Rename SCTLR_EL1_NTWE/TWI to SCTLR_EL1_nTWE/TWI We already use lower case in some defines in sysreg.h, for consistency with the architecture definition do so for SCTLR_EL1.nTWE and SCTLR_EL1.nTWI. No functional change. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit bc249e37b9334826de29111c5350c3e7a08a3969 Author: Mark Brown Date: Tue May 3 18:02:24 2022 +0100 arm64/mte: Make TCF field values and naming more standard In preparation for automatic generation of the defines for system registers make the values used for the enumeration in SCTLR_ELx.TCF suitable for use with the newly defined SYS_FIELD_PREP_ENUM helper, removing the shift from the define and using the helper to generate it on use instead. Since we only ever interact with this field in EL1 and in preparation for generation of the defines also rename from SCTLR_ELx to SCTLR_EL1. SCTLR_EL2 is not quite the same as SCTLR_EL1 so the conversion does not share the field definitions. There should be no functional change from this patch. Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220503170233.507788-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 96f101a9eab479dbfbdf7713ba966f9031c9c045 Author: Mark Brown Date: Tue May 3 18:02:23 2022 +0100 arm64/mte: Make TCF0 naming and field values more standard In preparation for automatic generation of SCTLR_EL1 register definitions make the macros used to define SCTLR_EL1.TCF0 and the enumeration values it has more standard so they can be used with FIELD_PREP() via the newly defined SYS_FIELD_PREP_ helpers. Since the field also exists in SCTLR_EL2 with the same values also rename the macros to SCTLR_ELx rather than SCTLR_EL1. There should be no functional change as a result of this patch. Signed-off-by: Mark Brown Acked-by: Mark Rutland commit e6a6b34f97efe3ded077b31f4370b4c1206c9e56 Author: Mark Brown Date: Tue May 3 18:02:22 2022 +0100 arm64/sysreg: Introduce helpers for access to sysreg fields The macros we define for the bitfields within sysregs have very regular names, especially once we switch to automatic generation of those macros. Take advantage of this to define wrappers around FIELD_PREP() allowing us to simplify setting values in fields either numerically SYS_FIELD_PREP(SCTLR_EL1, TCF0, 0x0) or using the values of enumerations within the fields SYS_FIELD_PREP_ENUM(SCTLR_EL1, TCF0, ASYMM) Suggested-by: Mark Rutland Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220503170233.507788-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 6d435a94ba5bb4f2ad381c0828fbae89c66b50fe Author: Nícolas F. R. A. Prado Date: Fri Apr 29 16:13:24 2022 -0400 regulator: mt6315: Enforce regulator-compatible, not name The MT6315 PMIC dt-binding should enforce that one of the valid regulator-compatible is set in each regulator node. However it was mistakenly matching against regulator-name instead. Fix the typo. This not only fixes the compatible verification, but also lifts the regulator-name restriction, so that more meaningful names can be set for each platform. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220429201325.2205799-1-nfraprado@collabora.com Signed-off-by: Mark Brown commit e7734156b0ad7c32643de851d644db74ea4b0074 Author: Bob Pearson Date: Wed Apr 20 12:23:17 2022 -0500 RDMA/rxe: Replace paylen by payload In finish_packet() in rxe_req.c a variable was incorrectly called paylen instead of payload. Elsewhere in the rxe source payload is always used for the RoCE payload length and paylen is always used for the UDP payload length. This will cause unnecessary confusion. Replace paylen by payload in finish_packet(). Link: https://lore.kernel.org/r/20220420172316.5465-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit de33a32968e8e2a22b0d6ae621a4505fccce8234 Author: Jack Xiao Date: Fri Mar 20 14:53:07 2020 +0800 drm/amdgpu: use the whole doorbell space for mes Use the whole doorbell space for mes. Each queue in one process occupies one doorbell slot to ring the queue submitting. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 564434020a19810f57708feaacd07ad34ae7a8e3 Author: Jack Xiao Date: Fri Mar 20 14:11:04 2020 +0800 drm/amdgpu/gmc10: skip emitting pasid mapping packet For MES FW manages IH_VMID_x_LUT updating, skip emitting pasid mapping packet. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 115efa440f78f925ad52c234ad20c5205eb3af2f Author: Jack Xiao Date: Fri Mar 20 12:21:14 2020 +0800 drm/amdgpu/gfx10: use INVALIDATE_TLBS to invalidate TLBs v2 For MES queue VM flush, use INVALIDATE_TLBS to invalidate TLBs. This packet can let CP firmware to determine the current vmid and inv eng to invalidate. v2: unify invalidate_tlbs functions Cc: Le Ma Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1f0f303c858f4ff8f5c659075ff0ecbcce784adb Author: Jack Xiao Date: Fri Mar 20 12:10:00 2020 +0800 drm/amdgpu/gfx10: inherit vmid from mqd For MES manages vmid assignment, let vmid inherit from mqd instead of ib packet setting. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 11f39576ac807d39b1e7e7a3842eb55c387607bb Author: Jack Xiao Date: Fri Mar 20 12:03:08 2020 +0800 drm/amdgpu/gfx10: associate mes queue id with fence v2 Associate mes queue id with fence, so that EOP trap handler can look up which queue has issued the fence. v2: move mes queue flag to amdgpu_mes_ctx.h Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 34ec3c2e0ef2fb6b60e42782caf19201de1372db Author: Jack Xiao Date: Fri Mar 20 11:37:31 2020 +0800 drm/amdgpu/gfx10: use per ctx CSA for de metadata As MES requires per context preemption, use per context CSA address for DE metadata to correctly enable context MCBP preemption. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 75df9e88c57d07278633417bf5a190b36afbc42e Author: Jack Xiao Date: Fri Mar 20 11:10:20 2020 +0800 drm/amdgpu/gfx10: use per ctx CSA for ce metadata As MES requires per context preemption, use per context CSA address for CE metadata to correctly enable context MCBP preemption. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c755f68095eba41f213e2f748c84b25d5c435551 Author: Jack Xiao Date: Wed Jul 1 13:32:36 2020 +0800 drm/amdgpu/gfx10: implement mqd functions of gfx/compute eng v2 Refine the existing gfx/compute mqd functions, and add them to engine mqd layer. v2: rebase fix. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ae9fd76fd8abd6ee2cd6f7595d7d7a81ee6a31eb Author: Jack Xiao Date: Fri Mar 20 13:59:48 2020 +0800 drm/amdgpu: assign the cpu/gpu address of fence from ring assign the cpu/gpu address of fence for the normal or mes ring from ring structure. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 502b6cef8fd3026fe83fc142934fe0673a23c019 Author: Jack Xiao Date: Wed Mar 30 22:04:38 2022 +0800 drm/amdgpu: initialize/finalize the ring for mes queue Iniailize/finalize the ring for mes queue which submits the command stream to the mes-managed hardware queue. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3748424ba9f1241a532c57372806ecfdda894449 Author: Jack Xiao Date: Fri Mar 20 10:54:45 2020 +0800 drm/amdgpu: use ring structure to access rptr/wptr v2 Use ring structure to access the cpu/gpu address of rptr/wptr. v2: merge gfx10/sdma5/sdma5.2 patches Signed-off-by: Jack Xiao Reviewed-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d74c5b06e6a1f7931558bf9c16a948d84219bf95 Author: Jack Xiao Date: Thu Jun 11 11:27:47 2020 +0800 drm/amdgpu: define ring structure to access rptr/wptr/fence Define ring structure to access the cpu/gpu address of rptr/wptr/fence instead of dynamic calculation. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c6abbcbc769554bf5661b3fa54b7ef52975d561d Author: Jack Xiao Date: Mon Mar 16 17:12:23 2020 +0800 drm/amdgpu: add mes ctx data in amdgpu_ring Add mes context data structure in amdgpu_ring. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2bc956ef54415e0f7240ebb6d269c5ec1e12a46d Author: Jack Xiao Date: Fri Mar 27 00:38:05 2020 +0800 drm/amdgpu: add the per-context meta data v3 The per-context meta data is a per-context data structure associated with a mes-managed hardware ring, which includes MCBP CSA, ring buffer and etc. v2: fix typo v3: a. use structure instead of typedef b. move amdgpu_mes_ctx_get_offs_* to amdgpu_ring.h c. use __aligned to make alignement Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 80af9daa62faeb9397a80ddf5777f97809efb166 Author: Jack Xiao Date: Wed Jul 1 12:23:06 2020 +0800 drm/amdgpu: add helper function to initialize mqd from ring v4 Add the helper function to initialize mqd from ring configuration. v2: use if/else pair instead of ?/: pair v3: use simpler way to judge hqd_active v4: fix parameters to amdgpu_gfx_is_high_priority_compute_queue Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5405a526276a51905bca0ad3d155cf3f8822563a Author: Jack Xiao Date: Wed Jul 1 11:48:52 2020 +0800 drm/amdgpu: define MQD abstract layer for hw ip Define MQD abstract layer for hw ip, for the passing mqd configuration not only from ring but more sources, like user queue. Signed-off-by: Jack Xiao Acked-by: Christian König Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d142f56e4fa2296c5c9f4e28d8deba0ba2780607 Author: Likun Gao Date: Wed Jun 23 17:53:35 2021 +0800 drm/amdgpu: add imu fw structure Add IMU firmware structure. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 89466f49b285fe162dad5a22471673a3463145c9 Author: Likun Gao Date: Sun Jun 27 22:33:29 2021 +0800 drm/amdgpu: add rlc TOC header file for soc21 (v2) Add RLC autoload TOC header file for soc21 ASIC. v2: squash in updates Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d6b9a91f5d1bd9f8027dbab1119a3a51f0afed26 Author: Evan Quan Date: Thu Apr 7 09:51:41 2022 -0400 drm/amdgpu: add FGCG support Add the CG flag for Fine Grained Clock Gating. Reviewed-by: Hawking Zhang Signed-off-by: Evan Quan Signed-off-by: Alex Deucher commit 550bb28e64a0200dbc04476fac880f86f914ad36 Author: Likun Gao Date: Mon Aug 30 11:07:59 2021 +0800 drm/amdgpu: support rlc v2_3 ucode struct Add support for rlc v2_3 to support RLCV and RLCP fw load. Signed-off-by: Likun Gao Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 641f053e3e9d89830b4e0f2d8ca6ad574435ccc1 Author: Likun Gao Date: Tue May 25 11:13:27 2021 +0800 drm/amdgpu: add gfx firmware header v2_0 We need define new firmware header to support CP RS64 fw. Signed-off-by: Wenhui Sheng Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e6b58555558a1ea653e415fc45308964087f9053 Author: Wenhui Sheng Date: Fri Oct 16 16:11:25 2020 +0800 drm/amdgpu: add irq src id for GFX11 Signed-off-by: Wenhui Sheng Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 86a65c566ef48fc467ad610109f3af6b475dd129 Author: Hawking Zhang Date: Wed Jul 7 16:33:34 2021 +0800 drm/amdgpu: add gfx11 mqd structures memory queue descriptors for gfx11. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 6c982cf87834ab492288637f6ccb38256b62d618 Author: Hawking Zhang Date: Wed Jan 6 18:47:02 2021 +0800 drm/amdgpu: add gfx11 clearstate header Add gfx11 clearstate register arrays Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0eb1df055ad969e539220c7bf216573ab4351a65 Author: Hawking Zhang Date: Sun Feb 20 18:37:12 2022 +0800 drm/amdgpu: add soc21 chip enum header v8 add soc21 enum definitions (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 7d33614285662d20d5d9b79b1fe989f56a9b0996 Author: Likun Gao Date: Mon Apr 4 16:45:16 2022 -0400 drm/amdgpu/discovery: Set GC family for GC 11.0 IP Set GC family for GC 11.0 IPs. Reviewed-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 5eca8379c73d1bb8cd84e335b9529c263f699468 Author: Hawking Zhang Date: Tue Feb 22 13:38:51 2022 +0800 drm/amdgpu: add GC v11_0_0 family id Add GC v11_0_0 family id Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit ab0cd4a9ae5b4679b714d8dbfedc0901fecdce9f Author: Alice Wong Date: Mon May 2 11:40:18 2022 -0400 drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo When psp_hw_init failed, it will set the load_type to AMDGPU_FW_LOAD_DIRECT. During amdgpu_device_ip_fini, amdgpu_ucode_free_bo checks that load_type is AMDGPU_FW_LOAD_DIRECT and skips deallocating fw_buf causing memory leak. Remove load_type check in amdgpu_ucode_free_bo. Signed-off-by: Alice Wong Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6d5276cdf9943bebcf8ae04ffaad37bee4c0a8db Author: Sung Joon Kim Date: Fri Apr 29 16:34:15 2022 -0400 drm/amd/display: Fix null pointer exception while load amdgpu Recently we got a hard hang during the boot on DCN 3.0.1, which caused the below null pointer exception: [ +0.000426] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ +0.000003] #PF: supervisor read access in kernel mode [ +0.000003] #PF: error_code(0x0000) - not-present page [ +0.000003] PGD 0 P4D 0 [ +0.000004] Oops: 0000 [#1] PREEMPT SMP NOPTI [ +0.000005] CPU: 6 PID: 874 Comm: Xorg Not tainted 5.16.0.asdn-apr28+ #15 [ +0.000004] Hardware name: AMD Chachani-VN/Chachani-VN, BIOS WCH2303N 03/03/2022 [ +0.000003] RIP: 0010:resource_map_pool_resources+0x431/0xa70 [amdgpu] [ +0.000356] Code: c1 4d 89 c8 49 c1 e0 07 4d 01 c8 49 c1 e0 04 4d 01 f0 49 83 b8 f0 01 00 00 00 0f 85 16 02 00 00 49 8b b8 e0 02 00 00 89 45 c0 <48> 8b 17 4c 8b 92 a0 01 00 00 4d 85 d2 74 24 4c 89 4d 88 48 8d 4d [ +0.000003] RSP: 0018:ffffa92a4142f718 EFLAGS: 00010246 [ +0.000003] RAX: 0000000000000000 RBX: ffff9a0b86d93000 RCX: 0000000000000000 [ +0.000002] RDX: 0000000000000000 RSI: 000000000000554b RDI: 0000000000000000 [ +0.000002] RBP: ffffa92a4142f798 R08: ffff9a0bdb3c0000 0000000000000000 [ +0.000002] R10: 0000000000000000 R11: 000000000000f000 R12: 0000000000000000 [ +0.000001] R13: ffff9a0b88360000 R14: ffff9a0bdb3c0000 R15: ffff9a0b86273000 [ +0.000003] FS: 00007f4b5641ca40(0000) GS:ffff9a0cb7f80000(0000) knlGS:0000000000000000 [ +0.000002] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ +0.000002] CR2: 0000000000000000 CR3: 0000000102cb2000 CR4: 00000000003506e0 [ +0.000003] Call Trace: [ +0.000002] [ +0.000004] ? kvmalloc_node+0x5c/0x90 [ +0.000009] dcn20_add_stream_to_ctx+0x1c/0x90 [amdgpu] [ +0.000330] dcn30_add_stream_to_ctx+0xe/0x10 [amdgpu] [ +0.000313] dc_add_stream_to_ctx+0x67/0x80 [amdgpu] [ +0.000300] dm_update_crtc_state+0x4dd/0x6e0 [amdgpu] [ +0.000320] amdgpu_dm_atomic_check+0x63b/0x1270 [amdgpu] [ +0.000311] ? __drm_mode_object_add+0x90/0xc0 [drm] [ +0.000043] ? preempt_count_add+0x74/0xc0 [ +0.000005] ? _raw_spin_lock_irqsave+0x2a/0x60 [ +0.000006] ? _raw_spin_unlock_irqrestore+0x29/0x3d [ +0.000003] ? drm_connector_list_iter_next+0x8e/0xb0 [drm] [ +0.000038] drm_atomic_check_only+0x5dd/0xa20 [drm] [ +0.000044] drm_atomic_commit+0x18/0x60 [drm] [ +0.000046] drm_client_modeset_commit_atomic+0x1e5/0x220 [drm] [ +0.000051] drm_client_modeset_commit_locked+0x57/0x160 [drm] [ +0.000038] __drm_fb_helper_restore_fbdev_mode_unlocked+0x60/0xd0 [drm_kms_helper] [ +0.000027] drm_fb_helper_set_par+0x40/0x50 [drm_kms_helper] [ +0.000022] fb_set_var+0x1c8/0x3d0 [ +0.000007] ? __ext4_mark_inode_dirty+0x83/0x210 [ +0.000006] ? __ext4_journal_stop+0x3c/0xb0 [ +0.000008] fbcon_blank+0x228/0x290 [ +0.000007] do_unblank_screen+0xae/0x150 [ +0.000005] vt_ioctl+0xcf4/0x1360 [ +0.000005] ? get_max_files+0x20/0x20 [ +0.000005] ? get_max_files+0x20/0x20 [ +0.000004] ? debug_smp_processor_id+0x17/0x20 [ +0.000004] tty_ioctl+0x373/0x8a0 [ +0.000005] ? __fput+0x123/0x260 [ +0.000004] ? __fget_light+0xc5/0x100 [ +0.000005] __x64_sys_ioctl+0x91/0xc0 [ +0.000005] do_syscall_64+0x3b/0xc0 [ +0.000005] entry_SYSCALL_64_after_hwframe+0x44/0xae This issue happens because "pipe_ctx->stream_res.tg" needs to be initialized first before reading its members. This commit fixes this issue by properly initializing the pointer before accessing the target data. Fixes: 663d2daeaee6 ("drm/amd/display: Add odm seamless boot support") Cc: Agustin Gutierrez Signed-off-by: Sung Joon Kim Reviewed-by: Agustin Gutierrez Signed-off-by: Alex Deucher commit 40c487409a7e919a10bad1dae0d6a12e67fe84d1 Author: Likun Gao Date: Mon Apr 4 16:59:56 2022 -0400 drm/amdgpu/discovery: Enable SMU for SMU 13.0.0 Enable SMU on SMU IP version 13.0.0 Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit a6dec8684079e38edc36c6f2f285d88985d5a4d1 Author: Evan Quan Date: Thu Apr 7 01:31:32 2022 -0400 drm/amdgpu/soc21: enable ATHUB and MMHUB PG Enable ATHUB and MMHUB powergating. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 276c03a0547068026241decd2c1159df0be5941f Author: Evan Quan Date: Wed Apr 6 17:13:54 2022 -0400 drm/amd/smu: Update SMU13 support for SMU 13.0.0 Modify the common smu13 code and add a new smu 13.0.0 ppt file to handle the smu 13.0.0 specific configuration. v2: squash in typo fix in profile name Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ce81151c7d9df872119941e46f3f34c295b08503 Author: Likun Gao Date: Wed Apr 6 17:08:50 2022 -0400 drm/amd/smu: add smu v13_0 header files Add driver_if ppsmc and pptable header files for smu v13_0_0 Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6a2d7a229e23a22b790721c63907e41871ccbb95 Author: Evan Quan Date: Wed Apr 6 18:00:16 2022 -0400 drm/amd/pm: enable the support for retrieving combo pptable We need to relay on this way to get the raw PPTable when SCPM feature is enabled. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d51e577c7dd477af448cce89dc04740722734a1c Author: Evan Quan Date: Wed Apr 6 17:47:20 2022 -0400 drm/amd/pm: correct SMU OverridePcieParameters related settings Correct the hw initialization sequence. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 9b5f9891c40b0ed0f34c7fbbe1cf521c19b4608c Author: Evan Quan Date: Wed Apr 6 17:44:44 2022 -0400 drm/amd/pm: enable SCPM support for SMU With SCPM enabled, the pptable used will be signed. It cannot be used directly by driver. To get the raw pptable, we need to rely on the combo pptable(and its revelant SMU message). Also, the pptable transferring(to SMU) will be performed by PSP. Some SMU messages will be not available to driver any more. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b37c41f2cb3254fdf36134e38a9f507933da2aaa Author: Evan Quan Date: Wed Apr 6 17:34:57 2022 -0400 drm/amdgpu: enable pptable ucode loading With SCPM enabled, pptable cannot be uploaded to SMU directly. The transferring has to be via PSP. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 288908edce3e27b3f959979d81f55e6a858fef34 Author: Evan Quan Date: Thu Mar 17 14:15:06 2022 +0800 drm/amd/pm: update the hw initialization sequence around pptable setup Place pptable setup after smu_set_driver_table_location. As under SCPM enabled scenario, the latter one is a prerequisite for the former one. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 593a54f18031edb1081e2447e66e499f7d013bbd Author: Evan Quan Date: Thu Feb 24 16:14:14 2022 +0800 drm/amd/pm: correct the way for retrieving bootup clocks The bootup clocks can be retrieved from the smu_info table. That is light-weight compared with existing way. Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit a1c30111de1c973751c654a64f6a99fb70ec03ca Author: Evan Quan Date: Thu Mar 31 18:10:35 2022 -0400 drm/amd/pm: move bootup values retrieving to ->sw_init Firsrt of all, the operations involved is to interact with VBIOS. They are fully supported at ->sw_init phase. Secondly, the new mechanism to upload pptable to SMU is introduced. With the new mechanism, the pptable transferring has to be via PSP. That requires the pptable ucode(and necessary bootupp values retrieving) must be ready before ->hw_init phase of PSP. Signed-off-by: Evan Quan Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6f3c9dbb65be3d90eee1b90e270c4e62b15a91b3 Author: Likun Gao Date: Wed Jan 12 15:38:24 2022 +0800 drm/amd/pm: fix NULL pointer issue of amdgpu_smu_stb_debug_fs_init Fix NULL pointer issue on amdgpu_smu_stb_debug_fs_init if SMU block not enabled. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 64440743e89629231fee712879d7a9d5ec7dfb8c Author: Evan Quan Date: Fri Mar 18 14:35:05 2022 +0800 drm/amd/pm: enable pp_dpm_vclk/dclk sysfs interface support for SMU 13.0.0 Make the pp_dpm_vclk/dclk sysfs interfaces visible for SMU 13.0.0. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f0b0a1b8062dba25cfe632582c92c047242598b2 Author: Hawking Zhang Date: Sun Jan 23 19:12:30 2022 +0800 drm/amdgpu: query core refclk from bios for smu v13 The smu_info structrue for smu v13 is changed that core_refclk in v31 strucuture is not correct for smu v13_0_0 Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 21c8685b06d8cfb5709fb2cc0cae3a8f9331caea Author: Hawking Zhang Date: Sun Jan 23 19:08:25 2022 +0800 drm/amdgpu: add updated smu_info structures To match with smu v13_0_0 Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 0984d38441fded4582bf38ba2fc1332750f18896 Author: Likun Gao Date: Mon Apr 4 16:57:54 2022 -0400 drm/amdgpu/discovery: add GMC 11.0 Support Enable GMC 11.0 on asics where it is present. Reviewed-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 1c2014da77858af2da85b2f2917dbb00858bd869 Author: Tianci.Yin Date: Wed Apr 6 14:11:38 2022 -0400 drm/amdgpu: add gmc v11_0 ip block (v3) Add support for GPU memory controller v11. v1: Add support for gmc v11.0 Add gmc 11 block (Tianci) v2: drop unused amdgpu_bo_late_init (Hawking) v3: squash in various fix Signed-off-by: Tianci.Yin Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit d7dab4fc44ad020b48a893dae728190e2f01f14d Author: Jack Xiao Date: Wed May 12 15:53:48 2021 +0800 drm/amdgpu: save the setting of VM_CONTEXT_CNTL MES firmware needs the setting of VM_CONTEXT_CNTL to perform vmid switch. Save the initial setting when hub initializing. Signed-off-by: Jack Xiao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 98a0f8687e3135b4606e17bb05fc0a5fa33be55f Author: Tianci.Yin Date: Mon Oct 12 18:10:13 2020 +0800 drm/amdgpu: add mmhub v3_0 ip block Add support for mmhub v3.0 Signed-off-by: Tianci.Yin Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9f99d9830554a13dc9f5e47dbaddfae36cbf416e Author: Hawking Zhang Date: Thu Nov 18 13:42:36 2021 +0800 drm/amdgpu: add mmhub v3_0_0 ip headers v6 Add mmhub v3_0_0 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 2279b4e5967f92ef5d12e153f33c9c89219855bd Author: Tianci.Yin Date: Mon Oct 12 18:08:11 2020 +0800 drm/amdgpu: add gfxhub v3_0 ip block Add support for gfxhub v3.0 Signed-off-by: Tianci.Yin Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ae460cd5663e007dbabd317b9dfdbdbcfb20476e Author: Tianci.Yin Date: Mon Oct 12 18:12:56 2020 +0800 drm/amdgpu: add athub v3_0 ip block Add support for athub v3.0 Signed-off-by: Tianci.Yin Reviewed-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f41c963972a548792da9344b1e5b6eef971d8441 Author: Hawking Zhang Date: Thu Dec 30 16:50:57 2021 +0800 drm/amdgpu: add athub v3_0_0 ip headers v6 Add athub v3_0_0 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 55a800da490b17453693800bac7dd22359ec2366 Author: Likun Gao Date: Mon Apr 4 16:52:08 2022 -0400 drm/amdgpu/discovery: Enable PSP for PSP 13.0.0 Enable PSP on PSP IP version 13.0.0 Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 7f318f4e305ac2675bc6e67712f03e631b6f2ed1 Author: Likun Gao Date: Wed May 4 09:56:33 2022 -0400 drm/amdgpu: add tracking for the enablement of SCPM Add parmeter to shows whether SCPM feature is enabled or not, and whether is valid. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a6b6d38ed873bb4f105cde4b91f6d4cb5aa41efa Author: Likun Gao Date: Wed Dec 8 16:19:52 2021 +0800 drm/amdgpu: rework psp firmware name Use the new helper for deriving the fw name from the IP version. Signed-off-by: Likun Gao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 911a75043f9e062fe232eb9fb428948afd80219b Author: Likun Gao Date: Wed Jun 30 17:54:30 2021 +0800 drm/amdgpu: support psp v13_0_0 microcode init Support psp v13_0_0 microcode init. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e995e2ecdf35c19dd5772f6ac62e38221fdfa9ab Author: Likun Gao Date: Wed Jun 30 17:43:21 2021 +0800 drm/amdgpu: add support for spl fw load on psp v13 Support for spl firmware load on psp v13. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 47a203855467871143a07e3ad3fb1e2258a3e8ac Author: Likun Gao Date: Wed Sep 1 15:26:54 2021 +0800 drm/amdgpu: extend PSP GFX FW type Extend PSP GFX FW type to support IMU, LSDMA, SDMA v6, RS64 MES related fw load. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5fea10d5a9dcbe9bf2cd53bbdaf84abe17d7466b Author: Hawking Zhang Date: Tue Aug 31 17:23:23 2021 +0800 drm/amdgpu: support print psp v2_0 hdr debug information print out psp firmware v2_0 hdr information for debugging purpose Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit e2c34219d16e8c3710278b4e23ebd5bc1ec7b804 Author: Alice Wong Date: Wed Apr 27 21:03:54 2022 -0400 drm/amdgpu/psp: deallocate memory when psp_load_fw failed psp_load_fw failure would cause memory leak for psp tmr and psp ring because psp_hw_init is not called as psp block is not fully initialized. Clean up psp tmr and psp ring when psp_load_fw fail by calling psp_free_shared_bufs and psp_ring_destroy. Reviewed-by: Hawking Zhang Signed-off-by: Alice Wong Signed-off-by: Alex Deucher commit da40bf8f9376370b5bc2fda07aadaaddc308b1eb Author: Alex Deucher Date: Fri Apr 22 17:19:29 2022 -0400 drm/amdgpu/psp: move shared buffer frees into single function So we can properly clean up if any of the TAs or TMR fails to properly initialize or terminate. This avoids any memory leaks in the error case. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fb4f4f4256f86501bdd5117a9fe00c3a84519276 Author: Alex Deucher Date: Fri Apr 22 16:51:00 2022 -0400 drm/amdgpu/psp: fix memory leak in terminate functions Make sure we free the memory even if the unload fails. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f03d97b0bd96d18d8a75d7c9b3652aaf79da9af6 Author: Alex Deucher Date: Fri Apr 22 16:46:24 2022 -0400 drm/amdgpu/psp: drop load/unload/init_shared_buf wrappers Just call the load/unload/init_shared_buf functions directly. Makes the code easier to follow. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 57301181a5fc0df7e4b01661f80124e590ce4c40 Author: Elena Sakhnovitch Date: Fri Mar 11 14:03:09 2022 -0500 drm/amd/pm: Disable fan control if not supported On Sienna Cichild, not all platforms use PMFW based fan control (ex: fanless systems). On such ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon knobs for fan control also as it is not possible to report or control fan speed on such platforms through driver. v3: FeaturesToRun casted as uint64_t Signed-off-by: Elena Sakhnovitch Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 996ea8591b099b0657750ade07a99138c5513457 Author: Hawking Zhang Date: Sat Jan 8 17:13:37 2022 +0800 drm/amdgpu: init smuio v13_0_6 callbacks initialize smuio callback for soc21 Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b95b5391684b39695887afb4a13cccee7820f5d6 Author: Alex Deucher Date: Thu Apr 21 01:21:52 2022 -0400 drm/amdgpu/psp: move PSP memory alloc from hw_init to sw_init Memory allocations should be done in sw_init. hw_init should just be hardware programming needed to initialize the IP block. This is how most other IP blocks work. Move the GPU memory allocations from psp hw_init to psp sw_init and move the memory free to sw_fini. This also fixes a potential GPU memory leak if psp hw_init fails. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e6e405e0481f753567bc0be081420ea3163bc313 Author: Hawking Zhang Date: Sat Jan 8 17:26:32 2022 +0800 drm/amdgpu: add smuio v13_0_6 support add smuio v13_0_6 callbacks to support read rom image Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 55437d3bf4d51a321a81551c8750a5dd5d5c1322 Author: Hawking Zhang Date: Thu Dec 30 19:25:29 2021 +0800 drm/amdgpu: add smuio v13_0_6 ip headers v4 Add smuio v13_0_6 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 20f5e6cf3ba308fb228fab75a2e272fe8966a27f Author: Elena Sakhnovitch Date: Thu Apr 28 19:26:29 2022 -0400 drm/amdgpu: Remove trailing space Clean up trailing space in file sienna_cichlid_ppt.c. Signed-off-by: Elena Sakhnovitch Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1761e5efabe43f060c16bcd6093004c71c15abcb Author: Likun Gao Date: Mon Apr 4 16:48:30 2022 -0400 drm/amdgpu/discovery: add HDP v6 Enable HDP v6 on asics where it is present. Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 563fcfbf3101b569d642ac4d71c8177f0d7dc0ce Author: Likun Gao Date: Mon Apr 4 17:29:28 2022 -0400 drm/amdgpu: add hdp version 6 functions Unify hdp related function into hdp structure for hdp version 6. V2: Remove hdp invalidate function as hdp v6 doesn't have read cache. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 068421b1730fe65fb4f73921fdb78c080b0c62f4 Author: Philip Yang Date: Thu Apr 28 20:17:38 2022 -0400 drm/amdgpu: Free user pages if kvmalloc_array fails To cleanup the BOs of bo_list which have got user pages. Signed-off-by: Philip Yang Reviewed-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 11c4328a82d542653fda0c60ffd9aab8ba9d5ce8 Author: Hawking Zhang Date: Thu Dec 30 17:00:10 2021 +0800 drm/amdgpu: add hdp v6_0_0 ip headers v4 Add hdp v6_0_0 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 4de0f429740a5d908c3eb8a487e52560aa7f5de3 Author: pengfuyuan Date: Fri Apr 29 09:51:14 2022 +0800 gpu/drm/radeon: Fix spelling typo in comments Fix spelling typo in comments. Signed-off-by: pengfuyuan Signed-off-by: Alex Deucher commit 364d453f4d8ed5914ec34d7a193ceac49cc27b37 Author: Minghao Chi Date: Fri Apr 29 05:50:37 2022 +0000 drm/amdgpu: simplify the return expression of navi10_ih_hw_init() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Alex Deucher commit 3453677aead7f0ced1561a76a832dc90deb014c3 Author: Minghao Chi Date: Fri Apr 29 05:48:41 2022 +0000 drm/amdgpu: simplify the return expression of iceland_ih_hw_init Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Alex Deucher commit 2929a6bfa14f8a83d9257fd2ccca2f58cbfdb9af Author: Likun Gao Date: Mon Apr 4 16:50:39 2022 -0400 drm/amdgpu/discovery: add IH v6 Enable IH v6 on asics where it is present. Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 6e02c0ed4bb5c3acdf826442ccc30c12791f42d4 Author: Stanley.Yang Date: Tue Feb 22 14:53:16 2022 +0800 drm/amdgpu: add ih v6_0 ip block v2 This adds ih v6_0 ip block support. IH is the interrupt handler. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2913b567cecb1e354d321a91ce744735448795f0 Author: Likun Gao Date: Fri Apr 29 12:03:53 2022 +0800 drm/amd/smu: Increace dpm level count only for smu v13.0.2 Only V13.0.2 on SMU v13 will get 0 based max level from fw and increment by one, other ASIC will not need for this. V2: replace the asic_type check with ip versioning check. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit db56aebd81cfbbb265af64a7077f65c629555c7a Author: Stanley Yang Date: Tue Feb 22 16:35:39 2022 +0800 drm/amdgpu: add soc21 ih clientid definition Define soc21 ih clientid Signed-off-by: Stanley Yang Reviewed-by: Hawking Zhang Signed-off-by: Hawking Zhang Signed-off-by: Alex Deucher commit d71093aa15f018ec005a31a131068f46653900ac Author: Hawking Zhang Date: Thu Dec 30 19:21:43 2021 +0800 drm/amdgpu: add osssys v6_0_0 ip headers v4 Add osssys v6_0_0 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 2c0e7ddd1f3c20ee9dcc2d1f6df2e401698cf1c1 Author: Likun Gao Date: Mon Apr 4 16:55:18 2022 -0400 drm/amdgpu/discovery: add NBIO 4.3 Support Enable NBIO 4.3 on asics where it is present. Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 0d09a60e3ebddb4c1bf595cef89d796a0afe96ac Author: Stanley.Yang Date: Mon Apr 4 17:28:13 2022 -0400 drm/amdgpu: add nbio v4_3_0 ip block v2 This adds nbio v4_3_0 ip block support Changed from v1: use WREG32_SOC15/RREG32_SOC15 instead of WREG32_PCIE/RREG32_PCIE remove the programming of PCIE_CONFIG_CNTL Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e19920c6a08334d9a38b5edb4b03b62d989e6ae1 Author: Hawking Zhang Date: Thu Dec 30 19:18:08 2021 +0800 drm/amdgpu: add nbio v4_3_0 ip headers v6 Add nbio v4_3_0 register offset and shift masks header files (Hawking) Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Signed-off-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 759693aced71734080d38cbdeeda6cf6dc1e9702 Author: Likun Gao Date: Mon Apr 4 17:04:55 2022 -0400 drm/amdgpu/discovery: add soc21 common Support Enable soc21 common support on asics where it is present. Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit 0ee42ab70118ace9a09861bccaaf43e9779fa91e Author: Harry Wentland Date: Tue Apr 19 13:03:12 2022 -0400 drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT A faulty receiver might report an erroneous channel count. We should guard against reading beyond AUDIO_CHANNELS_COUNT as that would overflow the dpcd_pattern_period array. Signed-off-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 49a1a2c70a7fd820fe60a65a3e38ab9095082dc9 Author: Marc Zyngier Date: Tue Apr 5 19:23:27 2022 +0100 KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision Since adversising GICR_CTLR.{IC,CES} is directly observable from a guest, we need to make it selectable from userspace. For that, bump the default GICD_IIDR revision and let userspace downgrade it to the previous default. For GICv2, the two distributor revisions are strictly equivalent. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220405182327.205520-5-maz@kernel.org commit 4645d11f4a5538ec1221f36e397cfb0115718ffe Author: Marc Zyngier Date: Tue Apr 5 19:23:26 2022 +0100 KVM: arm64: vgic-v3: Implement MMIO-based LPI invalidation Since GICv4.1, it has become legal for an implementation to advertise GICR_{INVLPIR,INVALLR,SYNCR} while having an ITS, allowing for a more efficient invalidation scheme (no guest command queue contention when multiple CPUs are generating invalidations). Provide the invalidation registers as a primitive to their ITS counterpart. Note that we don't advertise them to the guest yet (the architecture allows an implementation to do this). Signed-off-by: Marc Zyngier Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20220405182327.205520-4-maz@kernel.org commit 94828468a6085e6ae148986d300b634b87f86516 Author: Marc Zyngier Date: Tue Apr 5 19:23:25 2022 +0100 KVM: arm64: vgic-v3: Expose GICR_CTLR.RWP when disabling LPIs When disabling LPIs, a guest needs to poll GICR_CTLR.RWP in order to be sure that the write has taken effect. We so far reported it as 0, as we didn't advertise that LPIs could be turned off the first place. Start tracking this state during which LPIs are being disabled, and expose the 'in progress' state via the RWP bit. We also take this opportunity to disallow enabling LPIs and programming GICR_{PEND,PROP}BASER while LPI disabling is in progress, as allowed by the architecture (UNPRED behaviour). We don't advertise the feature to the guest yet (which is allowed by the architecture). Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220405182327.205520-3-maz@kernel.org commit 34453c2e9f799d02f5f379519495208bbd96a935 Author: Marc Zyngier Date: Tue Apr 5 19:23:24 2022 +0100 irqchip/gic-v3: Exposes bit values for GICR_CTLR.{IR, CES} As we're about to expose GICR_CTLR.{IR,CES} to guests, populate the include file with the architectural values. Signed-off-by: Marc Zyngier Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20220405182327.205520-2-maz@kernel.org commit c36820b04c56db0c34b198a2af6c9a6bd7d93459 Author: Marc Zyngier Date: Wed May 4 13:13:55 2022 +0100 Documentation: Fix index.rst after psci.rst renaming Fix the TOC in index.rst after psci.rst has been renamed to hypercalls.rst. Signed-off-by: Marc Zyngier Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220504205627.18f46380@canb.auug.org.au commit ea3ce08cb42b8a4d482282842dd93ae4a00d2506 Author: Kefeng Wang Date: Tue May 3 15:49:37 2022 +0100 drm/i915: use IOMEM_ERR_PTR() directly Use IOMEM_ERR_PTR() instead of self defined IO_ERR_PTR(). Signed-off-by: Kefeng Wang Reviewed-by: Jani Nikula Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220503144937.679424-1-tvrtko.ursulin@linux.intel.com commit e123b4edb2a13b67c4de7caee2e3d5e083bef58b Author: Lucas Stach Date: Wed May 4 11:02:29 2022 +0200 drm/etnaviv: avoid cleaning up sched_job when submit succeeded While the labels may mislead the casual reader, the tail of the function etnaviv_ioctl_gem_submit is always executed, as a lot of the structures set up in this function need to be cleaned up regardless of whether the submit succeeded or failed. An exception is the newly added drm_sched_job_cleanup, which must only be called when the submit failed before handing the job to the scheduler. Fixes: b827c84f5e84 ("drm/etnaviv: Use scheduler dependency handling") Reported-by: Michael Walle Signed-off-by: Lucas Stach Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220504090229.2506560-1-l.stach@pengutronix.de commit 420f95b0ad603165684528276ca9bf1a290bfb4e Author: Raphael Gallais-Pou Date: Tue Apr 26 15:19:12 2022 +0200 drm: fix typo in comment Fix typo in a doxygen comment (replaced green by blue) in drm_color_mgmt.c Signed-off-by: Raphael Gallais-Pou Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220426131912.3850354-1-raphael.gallais-pou@foss.st.com commit 604be85547ce4d61b89292d2f9a78c721b778c16 Author: Andy Yan Date: Fri Apr 22 09:28:39 2022 +0200 drm/rockchip: Add VOP2 driver The VOP2 unit is found on Rockchip SoCs beginning with rk3566/rk3568. It replaces the VOP unit found in the older Rockchip SoCs. This driver has been derived from the downstream Rockchip Kernel and heavily modified: - All nonstandard DRM properties have been removed - dropped struct vop2_plane_state and pass around less data between functions - Dropped all DRM_FORMAT_* not known on upstream - rework register access to get rid of excessively used macros - Drop all waiting for framesyncs The driver is tested with HDMI and MIPI-DSI display on a RK3568-EVB board. Overlay support is tested with the modetest utility. AFBC support on the cluster windows is tested with weston-simple-dmabuf-egl on weston using the (yet to be upstreamed) panfrost driver support. Signed-off-by: Andy Yan Co-Developed-by: Sascha Hauer Signed-off-by: Sascha Hauer Tested-by: Michael Riesch [dt-binding-header:] Acked-by: Rob Herring [moved dt-binding header from dt-nodes patch to here and made checkpatch --strict happier] Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-23-s.hauer@pengutronix.de commit b382406a2cf4afaa7320a7ad4b298ed6e2675437 Author: Sascha Hauer Date: Fri Apr 22 09:28:38 2022 +0200 drm/rockchip: Make VOP driver optional With upcoming VOP2 support VOP won't be the only choice anymore, so make the VOP driver optional. This also adds a dependency from ROCKCHIP_ANALOGIX_DP to ROCKCHIP_VOP, because that driver currently only links and works with the VOP driver. Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-22-s.hauer@pengutronix.de commit 4073e42028de0f6ebbd86a9b30aaa5501bcdff59 Author: Sascha Hauer Date: Fri Apr 22 09:28:41 2022 +0200 dt-bindings: display: rockchip: dw-hdmi: fix ports description Current port description doesn't cover all possible cases. It currently expects one single port with two endpoints. When the HDMI connector is described in the device tree there can be two ports, first one going to the VOP and the second one going to the connector. Also on SoCs which only have a single VOP there will be only one endpoint instead of two. This patch addresses both issues. With this there can either be a single port ("port") , or two of them ("port@0", "port@1") when the connector is also in the device tree. Also the first or only port can either have one endpoint ("endpoint") for single VOP SoCs or two ("endpoint@0", "endpoint@1") for dual VOP SoCs. Signed-off-by: Sascha Hauer Reviewed-by: Rob Herring Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-25-s.hauer@pengutronix.de commit 74015e2650bad641a02100cdf0ac23a96c1a2553 Author: Sascha Hauer Date: Fri Apr 22 09:28:40 2022 +0200 dt-bindings: display: rockchip: Add binding for VOP2 The VOP2 is found on newer Rockchip SoCs like the rk3568 or the rk3566. The binding differs slightly from the existing VOP binding, so add a new binding file for it. Signed-off-by: Sascha Hauer Reviewed-by: Rob Herring Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-24-s.hauer@pengutronix.de commit f06351f8c0c85e2d53e73c53a33b4ef55b4ad6de Author: YueHaibing Date: Wed Mar 16 18:42:39 2022 +0800 powerpc/eeh: Remove unused inline functions pseries_eeh_init_edev() is used exclusively in eeh_pseries.c, make it static and remove unused inline function. pseries_eeh_init_edev_recursive() is only called from files build wich CONFIG_HOTPLUG_PCI_RPA which depends on CONFIG_PSERIES and CONFIG_EEH, so can remove the unused inline version. Suggested-by: Christophe Leroy Signed-off-by: YueHaibing Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220316104239.26508-1-yuehaibing@huawei.com commit 49c3b9266a718dbd73c42e004288b4bb2ea0ac0b Author: Damien Le Moal Date: Wed Apr 20 09:57:18 2022 +0900 block: null_blk: Improve device creation with configfs Currently, the directory name used to create a nullb device through sysfs is not used as the device name, potentially causing headaches for users if devices are already created through the modprobe operation withe the nr_device module parameter not set to 0. E.g. a user can do "mkdir /sys/kernel/config/nullb/nullb0" to create a nullb device even though /dev/nullb0 was already created by modprobe. In this case, the configfs nullb device will be named nullb1, causing confusion for the user. Simplify this by using the configfs directory name as the nullb device name, always, unless another nullb device is already using the same name. E.g. if modprobe created nullb0, then: $ mkdir /sys/kernel/config/nullb/nullb0 mkdir: cannot create directory '/sys/kernel/config/nullb/nullb0': File exists will be reported to the user. To implement this, the function null_find_dev_by_name() is added to check for the existence of a nullb device with the name used for a new configfs device directory. nullb_group_make_item() uses this new function to check if the directory name can be used as the disk name. Finally, null_add_dev() is modified to use the device config item name as the disk name for a new nullb device created using configfs. The naming of devices created though modprobe remains unchanged. Of note is that it is possible for a user to create through configfs a nullb device with the same name as an existing device. E.g. $ mkdir /sys/kernel/config/nullb/null will successfully create the nullb device named "null" but this block device will however not appear under /dev/ since /dev/null already exists. Suggested-by: Joseph Bacik Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220420005718.3780004-5-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit db060f54e0c53af66d72aacd13a2550f1e24c90b Author: Damien Le Moal Date: Wed Apr 20 09:57:17 2022 +0900 block: null_blk: Cleanup messages Use the pr_fmt() macro to prefix all null_blk pr_xxx() messages with "null_blk:" to clarify which module is printing the messages. Also add a pr_info() message in null_add_dev() to print the name of a newly created disk. Signed-off-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220420005718.3780004-4-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit b3a0a73e8a79eab6ec74139b505f4c6d6781aae9 Author: Damien Le Moal Date: Wed Apr 20 09:57:16 2022 +0900 block: null_blk: Cleanup device creation and deletion Introduce the null_create_dev() and null_destroy_dev() helper functions to respectivel create nullb devices on modprobe and destroy them on rmmod. The null_destroy_dev() helper avoids duplicated code in the null_init() and null_exit() functions for deleting devices. Signed-off-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220420005718.3780004-3-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit 525323d25e8756f9c661f405208a7d333a1470c3 Author: Damien Le Moal Date: Wed Apr 20 09:57:15 2022 +0900 block: null_blk: Fix code style issues Fix message grammar and code style issues (brackets and indentation) in null_init(). Signed-off-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220420005718.3780004-2-damien.lemoal@opensource.wdc.com Signed-off-by: Jens Axboe commit 0000f2f7205d88e0d97f8b47b2c8a98e86137708 Author: Christoph Hellwig Date: Mon Apr 18 06:53:14 2022 +0200 xen-blkback: use bdev_discard_alignment Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Also switch to use bdev_discard_granularity to get rid of the last direct queue reference in xen_blkbk_discard. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-12-hch@lst.de [axboe: fold in 'q' removal as it's now unused] Signed-off-by: Jens Axboe commit 48e6f22e25a44e43952db5fbb767dea0c9319cb2 Author: Michal Orzel Date: Tue Apr 26 09:06:03 2022 +0200 arm64: cputype: Avoid overflow using MIDR_IMPLEMENTOR_MASK Value of macro MIDR_IMPLEMENTOR_MASK exceeds the range of integer and can lead to overflow. Currently there is no issue as it is used in expressions implicitly casting it to u32. To avoid possible problems, fix the macro. Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220426070603.56031-1-michal.orzel@arm.com Signed-off-by: Catalin Marinas commit 8c1d3f79d9ca48e406b78e90e94cf09a8c076bf2 Author: Mao Jinlong Date: Wed Mar 9 06:22:06 2022 -0800 coresight: core: Fix coresight device probe failure issue It is possibe that probe failure issue happens when the device and its child_device's probe happens at the same time. In coresight_make_links, has_conns_grp is true for parent, but has_conns_grp is false for child device as has_conns_grp is set to true in coresight_create_conns_sysfs_group. The probe of parent device will fail at this condition. Add has_conns_grp check for child device before make the links and make the process from device_register to connection_create be atomic to avoid this probe failure issue. Cc: stable@vger.kernel.org Suggested-by: Suzuki K Poulose Suggested-by: Mike Leach Signed-off-by: Mao Jinlong Link: https://lore.kernel.org/r/20220309142206.15632-1-quic_jinlmao@quicinc.com [ Added Cc stable ] Signed-off-by: Suzuki K Poulose commit 0662d797d5962fd0a21aceb0cf651a6ff308e924 Merge: 953706844f0f2 3e5a8e8494a81 Author: Ulf Hansson Date: Wed May 4 12:32:44 2022 +0200 Merge branch 'fixes' into next commit 7bc7981eeebe1b8e603ad2ffc5e84f4df76920dd Author: Dimitri John Ledkov Date: Thu Apr 14 13:50:03 2022 +0100 cfg80211: declare MODULE_FIRMWARE for regulatory.db Add MODULE_FIRMWARE declarations for regulatory.db and regulatory.db.p7s such that userspace tooling can discover and include these files. Cc: stable@vger.kernel.org Signed-off-by: Dimitri John Ledkov Link: https://lore.kernel.org/r/20220414125004.267819-1-dimitri.ledkov@canonical.com Signed-off-by: Johannes Berg commit 2182db91e0016ca2b451426290c3b368ba9f6fdc Author: Johannes Berg Date: Thu Apr 14 14:04:03 2022 +0200 nl80211: rework internal_flags usage Since internal_flags is only 8 bits, we can only have one more internal flag. However, we can obviously never use all of possible the combinations, in fact, we only use 14 of them (including no flags). Since we want more flags for MLO (multi-link operation) in the future, refactor the code to use a flags selector, so wrap all of the .internal_flags assignments in a IFLAGS() macro which selects the combination according to the pre- defined list of combinations. When we need a new combination, we'll have to add it, but again we will never use all possible combinations. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220414140402.70ddf8af3eb0.I2cc38cb6a10bb4c3863ec9ee97edbcc70a07aa4b@changeid Signed-off-by: Johannes Berg commit 1b550a0bebfc0b69d6ec08fe6eb58953a8aec48a Author: Johannes Berg Date: Thu Apr 14 14:04:02 2022 +0200 nl80211: don't hold RTNL in color change request It's not necessary to hold the RTNL across color change requests, since all the inner locking needs only the wiphy mutex which we already hold as well. Fixes: 0d2ab3aea50b ("nl80211: add support for BSS coloring") Link: https://lore.kernel.org/r/20220414140402.32e03e8c261b.I5e7dc6bc563a129b938c43298da6bb4e812400a5@changeid Signed-off-by: Johannes Berg commit 34c9a0e71cbb316f360919353273b185c2780cd7 Author: Johannes Berg Date: Tue Apr 12 22:09:59 2022 +0200 cfg80211: remove cfg80211_get_chan_state() We haven't used this function for years, since commit c781944b71f8 ("cfg80211: Remove unused cfg80211_can_use_iftype_chan()") which itself removed a function unused since commit 97dc94f1d933 ("cfg80211: remove channel_switch combination check"), almost eight years ago. Also remove the now unused enum cfg80211_chan_mode and some struct members that were only used for this function. Link: https://lore.kernel.org/r/20220412220958.1a191dca19d7.Ide4448f02d0e2f1ca2992971421ffc1933a5370a@changeid Signed-off-by: Johannes Berg commit 953706844f0f2fd4dc6984cc010fe6cf51c041f2 Author: Rohit Agarwal Date: Mon May 2 14:07:43 2022 +0530 mmc: sdhci-msm: Add compatible string check for sdx65 Add sdx65 SoC specific compatible string check inside qcom 'sdhci-msm' controller driver. Signed-off-by: Rohit Agarwal Link: https://lore.kernel.org/r/1651480665-14978-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Ulf Hansson commit 210deba2d9b73082625a7f67a406c396bf0e9b84 Author: Rohit Agarwal Date: Mon May 2 14:07:42 2022 +0530 dt-bindings: mmc: sdhci-msm: Document the SDX65 compatible The SDHCI controller on SDX65 is based on MSM SDHCI v5 IP. Hence, document the compatible with "qcom,sdhci-msm-v5" as the fallback. Signed-off-by: Rohit Agarwal Acked-by: Rob Herring Link: https://lore.kernel.org/r/1651480665-14978-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Ulf Hansson commit 5acd6adb65802cc6f9986be3750179a820580d37 Author: Bhupesh Sharma Date: Sat Apr 30 03:38:33 2022 +0530 mmc: sdhci-msm: Add compatible string check for sm8150 Add sm8150 SoC specific compatible string check inside qcom 'sdhci-msm' controller driver. Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220429220833.873672-5-bhupesh.sharma@linaro.org Signed-off-by: Ulf Hansson commit 17a9f73d45ea74b2beb009c29ad38569990c3453 Author: Bhupesh Sharma Date: Sat Apr 30 03:38:32 2022 +0530 dt-bindings: mmc: sdhci-msm: Add compatible string for sm8150 Add sm8150 SoC specific compatible strings for qcom-sdhci controller. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220429220833.873672-4-bhupesh.sharma@linaro.org Signed-off-by: Ulf Hansson commit 466614a9765c6fb67e1464d0a3f1261db903834b Author: Bhupesh Sharma Date: Sat Apr 30 03:38:31 2022 +0530 mmc: sdhci-msm: Add SoC specific compatibles Since Qualcomm device-trees already use SoC specific compatibles for describing the 'sdhci-msm' nodes, it makes sense to add the support for the same in the driver as well. Keep the old deprecated compatible strings still in the driver, to ensure backward compatibility with older device-trees. Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220429220833.873672-3-bhupesh.sharma@linaro.org Signed-off-by: Ulf Hansson commit a45537723f4b87fa2c97ae01ac08a3a9ddec0a10 Author: Bhupesh Sharma Date: Sat Apr 30 03:38:30 2022 +0530 dt-bindings: mmc: sdhci-msm: Convert bindings to yaml Convert Qualcomm sdhci-msm devicetree binding to YAML. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220429220833.873672-2-bhupesh.sharma@linaro.org Signed-off-by: Ulf Hansson commit a37f37a2e7f5ea3ae2a1278f552aa21a8e32c221 Merge: 39e85fe01127c cff9437605d5c Author: David S. Miller Date: Wed May 4 11:21:33 2022 +0100 Merge branch 'mlxsw-updates' Ido Schimmel says: ==================== mlxsw: Various updates Patches #1-#3 add missing topology diagrams in selftests and perform small cleanups. Patches #4-#5 make small adjustments in QoS configuration. See detailed description in the commit messages. Patches #6-#8 reduce the number of background EMAD transactions. The driver periodically queries the device (via EMAD transactions) about updates that cannot happen in certain situations. This can negatively impact the latency of time critical transactions, as the device is busy processing other transactions. Before: # perf stat -a -e devlink:devlink_hwmsg -- sleep 10 Performance counter stats for 'system wide': 452 devlink:devlink_hwmsg 10.009736160 seconds time elapsed After: # perf stat -a -e devlink:devlink_hwmsg -- sleep 10 Performance counter stats for 'system wide': 0 devlink:devlink_hwmsg 10.001726333 seconds time elapsed ==================== Signed-off-by: David S. Miller commit cff9437605d5c282c1fe00c63ea5f312a7465646 Author: Ido Schimmel Date: Wed May 4 09:29:09 2022 +0300 mlxsw: spectrum_router: Only query neighbour activity when necessary The driver periodically queries the device for activity of neighbour entries in order to report it to the kernel's neighbour table. Avoid unnecessary activity query when no neighbours are installed. Use an atomic variable to track the number of neighbours, as it is read without any locks. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit b8950003849de2a78f7aed9e348233e2b678b755 Author: Ido Schimmel Date: Wed May 4 09:29:08 2022 +0300 mlxsw: spectrum_switchdev: Only query FDB notifications when necessary The driver periodically queries the device for FDB notifications (e.g., learned, aged-out) in order to update the bridge driver. These notifications can only be generated when bridges are offloaded to the device. Avoid unnecessary queries by starting to query upon installation of the first bridge and stop querying upon removal of the last bridge. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit d1314096fbe9601ea6606b925ec4563c027936d9 Author: Ido Schimmel Date: Wed May 4 09:29:07 2022 +0300 mlxsw: spectrum_acl: Do not report activity for multicast routes The driver periodically queries the device for activity of ACL rules in order to report it to tc upon 'FLOW_CLS_STATS'. In Spectrum-2 and later ASICs, multicast routes are programmed as ACL rules, but unlike rules installed by tc, their activity is of no interest. Avoid unnecessary activity query for such rules by always reporting them as inactive. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 0106668cd2f91bf913fb78972840dedfba80a3c3 Author: Petr Machata Date: Wed May 4 09:29:06 2022 +0300 mlxsw: Treat LLDP packets as control When trapping packets for on-CPU processing, Spectrum machines differentiate between control and non-control traps. Traffic trapped through non-control traps is treated as data and kept in shared buffer in pools 0-4. Traffic trapped through control traps is kept in the dedicated control buffer 9. The advantage of marking traps as control is that pressure in the data plane does not prevent the control traffic to be processed. When the LLDP trap was introduced, it was marked as a control trap. But then in commit aed4b5721143 ("mlxsw: spectrum: PTP: Hook into packet receive path"), PTP traps were introduced. Because Ethernet-encapsulated PTP packets look to the Spectrum-1 ASIC as LLDP traffic and are trapped under the LLDP trap, this trap was reconfigured as non-control, in sync with the PTP traps. There is however no requirement that PTP traffic be handled as data. Besides, the usual encapsulation for PTP traffic is UDP, not bare Ethernet, and that is in deployments that even need PTP, which is far less common than LLDP. This is reflected by the default policer, which was not bumped up to the 19Kpps / 24Kpps that is the expected load of a PTP-enabled Spectrum-1 switch. Marking of LLDP trap as non-control was therefore probably misguided. In this patch, change it back to control. Reported-by: Maksym Yaremchuk Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b6b584562cbe7dc357083459d6dd5b171e12cadb Author: Petr Machata Date: Wed May 4 09:29:05 2022 +0300 mlxsw: spectrum_dcb: Do not warn about priority changes The idea behind the warnings is that the user would get warned in case when more than one priority is configured for a given DSCP value on a netdevice. The warning is currently wrong, because dcb_ieee_getapp_mask() returns the first matching entry, not all of them, and the warning will then claim that some priority is "current", when in fact it is not. But more importantly, the warning is misleading in general. Consider the following commands: # dcb app flush dev swp19 dscp-prio # dcb app add dev swp19 dscp-prio 24:3 # dcb app replace dev swp19 dscp-prio 24:2 The last command will issue the following warning: mlxsw_spectrum3 0000:07:00.0 swp19: Ignoring new priority 2 for DSCP 24 in favor of current value of 3 The reason is that the "replace" command works by first adding the new value, and then removing all old values. This is the only way to make the replacement without causing the traffic to be prioritized to whatever the chip defaults to. The warning is issued in response to adding the new priority, and then no warning is shown when the old priority is removed. The upshot is that the canonical way to change traffic prioritization always produces a warning about ignoring the new priority, but what gets configured is in fact what the user intended. An option to just emit warning every time that the prioritization changes just to make it clear that it happened is obviously unsatisfactory. Therefore, in this patch, remove the warnings. Reported-by: Maksym Yaremchuk Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit faa7521add89416983e61283057a101d135e9174 Author: Petr Machata Date: Wed May 4 09:29:04 2022 +0300 selftests: router.sh: Add a diagram It is customary for selftests to have a comment with a topology diagram, which serves to illustrate the situation in which the test is done. This selftest lacks it. Add it. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5ade50e2df2ba93fae29b0aaeb8a71f6721b6a06 Author: Petr Machata Date: Wed May 4 09:29:03 2022 +0300 selftests: router_vid_1: Add a diagram, fix coding style It is customary for selftests to have a comment with a topology diagram, which serves to illustrate the situation in which the test is done. This selftest lacks it. Add it. While at it, fix the list of tests so that the test names are enumerated one at a line. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 18d2c710e5dfa0cad7d8e170496dafe0939d26a2 Author: Petr Machata Date: Wed May 4 09:29:02 2022 +0300 selftests: mlxsw: bail_on_lldpad before installing the cleanup trap A number of mlxsw-specific QoS tests use manual QoS DCB management. As such, they need to make sure lldpad is not running, because it would override the configuration the test has applied using other tools. To that end, these selftests invoke the bail_on_lldpad() helper, which terminates the selftest if th lldpad is running. Some of these tests however first install the bash exit trap, which invokes a cleanup() at the test exit. If bail_on_lldpad() has terminated the script even before the setup part was run, the cleanup part will be very confused. Therefore make sure bail_on_lldpad() is invoked before the cleanup is registered. While there are still edge cases where the user terminates the script before the setup was fully done, this takes care of a common situation where the cleanup would be invoked in an inconsistent state. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 39e85fe01127cfb1b4b59a08e5d81fed45ee5633 Merge: 402f2d6b6b075 6b73f20ab6c40 Author: David S. Miller Date: Wed May 4 11:18:08 2022 +0100 Merge branch 'sfc-Siena-subdir' Martin Habets says: ==================== sfc: Move Siena into a separate subdirectory The Siena NICs (SFN5000 and SFN6000 series) went EOL in November 2021. Most of these adapters have been remove from our test labs, and testing has been reduced to a minimum. This patch series creates a separate kernel module for the Siena architecture, analogous to what was done for Falcon some years ago. This reduces our maintenance for the sfc.ko module, and allows us to enhance the EF10 and EF100 drivers without the risk of breaking Siena NICs. After this series further enhancements are needed to differentiate the new kernel module from sfc.ko, and the Siena code can be removed from sfc.ko. Thes will be posted as a small follow-up series. The Siena module is not built by default, but can be enabled using Kconfig option SFC_SIENA. This will create module sfc-siena.ko. Patches Patch 1 disables the Siena code in the sfc.ko module. Patches 2-6 establish the code base for the Siena driver. Patches 7-12 ensure the allyesconfig build succeeds. Patch 13 adds the basic Siena module. I do not expect patch 2 through 5 to be reviewed, they are FYI only. No checkpatch issues were resolved as part of these, but they were fixed in the subsequent patches. Testing Various build tests were done such as allyesconfig, W=1 and sparse. The new sfc-siena.ko and sfc.ko modules were tested on a machine with both these NICs in them, and several tests were run on both drivers. Martin --- v3: - Fix build errors after rebase. v2: - Split up patch that copies existing files. - Only copy a subset of mcdi_pcol.h. - Use --find-copies-harder as suggested by Benjamin Poirier. - Merge several patches for the allyesconfig build into larger ones. ==================== Signed-off-by: David S. Miller commit 6b73f20ab6c401a1a7860f02734ab11bf748e69b Author: Martin Habets Date: Wed May 4 08:50:44 2022 +0100 sfc: Copy a subset of mcdi_pcol.h to siena For Siena we do not need new messages that were defined for the EF100 architecture. Several debug messages have also been removed. Signed-off-by: Martin Habets Signed-off-by: David S. Miller commit 0c38a5bd60ebce1172e27cfaf37e7b855f5392a3 Author: Martin Habets Date: Wed May 4 08:49:53 2022 +0100 sfc: Disable Siena support Disable the build of Siena code until later in this patch series. Prevent sfc.ko from binding to Siena NICs. efx_init_sriov/efx_fini_sriov is only used for Siena. Remove calls to those. Signed-off-by: Martin Habets Signed-off-by: David S. Miller commit 0180a1e823d7c41d9a1c19f38e6069b38fe60c87 Author: Tony Luck Date: Wed Apr 27 16:10:59 2022 -0700 x86/split_lock: Enable the split lock feature on Raptor Lake Raptor Lake supports the split lock detection feature. Add it to the split_lock_cpu_ids[] array. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220427231059.293086-1-tony.luck@intel.com commit 22079af7df5a5dfef1c4d160abfd43035211759e Author: Viresh Kumar Date: Wed May 4 15:40:22 2022 +0530 opp: Reorder definition of ceil/floor helpers Reorder the helpers to keep all freq specific ones, followed by level and bw. No functional change. Signed-off-by: Viresh Kumar commit f778f405faa2cda2342ac290b24c2c17c25d7c16 Author: Christian König Date: Fri Apr 22 14:38:47 2022 +0200 dma-buf/sync_file: cleanup fence merging a bit krealloc_array() ignores attempts to reduce the array size, so the attempt to save memory is completely pointless here. Also move testing for the no fence case into sync_file_set_fence(), this way we don't even touch the fence array when we don't have any fences. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220426124637.329764-1-christian.koenig@amd.com commit 00ce3873f730fb24c657854ec04374358e711838 Author: Krzysztof Kozlowski Date: Wed May 4 10:17:32 2022 +0200 opp: Add apis to retrieve opps with interconnect bandwidth Add dev_pm_opp_find_bw_ceil and dev_pm_opp_find_bw_floor to retrieve opps based on interconnect associated with the opp and bandwidth. The index variable is the index of the interconnect as specified in the opp table in Devicetree. Co-developed-by: Thara Gopinath Signed-off-by: Thara Gopinath Signed-off-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar commit 0a70c5d289b050fe1d2b3de91c837763a3c347f5 Author: Krzysztof Kozlowski Date: Thu Apr 28 10:18:17 2022 +0200 dt-bindings: mmc: brcm,sdhci-brcmstb: cleanup example Cleanup indentation and order of entries in example DTS. The most important when reading the DTS are compatible and reg. By convention they are usually to first entries. No functional change. Signed-off-by: Krzysztof Kozlowski Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220428081817.35382-2-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson commit b16ebda6d00361095c539d27b21b50488b71cec2 Author: Krzysztof Kozlowski Date: Thu Apr 28 10:18:16 2022 +0200 dt-bindings: mmc: brcm,sdhci-brcmstb: correct number of reg entries The binding should not allow infinite number of 'reg' entries, so add strict limit. Signed-off-by: Krzysztof Kozlowski Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220428081817.35382-1-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson commit 6bcc55fe648b860ef0c2b8dc23adc05bcddb93c2 Author: Al Cooper Date: Wed Apr 27 14:08:51 2022 -0400 mmc: sdhci-brcmstb: Enable Clock Gating to save power Enabling this feature will allow the controller to stop the bus clock when the bus is idle. The feature is not part of the standard and is unique to newer Arasan cores and is enabled with a bit in a vendor specific register. This feature will only be enabled for non-removable devices because they don't switch the voltage and clock gating breaks SD Card volatge switching. Signed-off-by: Al Cooper Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220427180853.35970-3-kdasu.kdev@gmail.com Signed-off-by: Ulf Hansson commit f3a70f991dd07330225ea11e158e1d07ad5733fb Author: Al Cooper Date: Wed Apr 27 14:08:50 2022 -0400 mmc: sdhci-brcmstb: Re-organize flags Re-organize the flags by basing the bit names on the flag that they apply to. Also change the "flags" member in the "brcmstb_match_priv" struct to const. Signed-off-by: Al Cooper Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220427180853.35970-2-kdasu.kdev@gmail.com Signed-off-by: Ulf Hansson commit 3ae2722c93c916b47bfe47a4326e88cc4abb9bf4 Author: Linus Walleij Date: Wed Apr 27 14:55:57 2022 +0200 mmc: mmci: Remove custom ios handler The custom boardfile ios handler isn't used anywhere in the kernel. Delete it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220427125557.1608825-1-linus.walleij@linaro.org Signed-off-by: Ulf Hansson commit 83961aacb2219311e4af5dda34bcc15435becd50 Author: Wan Jiabing Date: Wed Apr 27 20:03:09 2022 +0800 mmc: atmel-mci: Simplify if(chan) and if(!chan) Use if(!host->dma.chan) instead of if(chan) and if(!chan) to make code better. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220427120310.838843-1-wanjiabing@vivo.com Signed-off-by: Ulf Hansson commit 0e8bb6666e3dcf18e4920a325028647da71eb500 Author: Minghao Chi Date: Mon Apr 25 10:53:39 2022 +0000 mmc: core: use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220425105339.3515368-1-chi.minghao@zte.com.cn Signed-off-by: Ulf Hansson commit 402f2d6b6b075bb54bc3a73f64f60e5a3b47fa10 Merge: 6a9b3de825165 656d338907329 Author: David S. Miller Date: Wed May 4 10:53:00 2022 +0100 Merge tag 'mlx5-updates-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux mlx5-updates-2022-05-03 Leon Romanovsky Says: ===================== Extra IPsec cleanup After FPGA IPsec removal, we can go further and make sure that flow steering logic is aligned to mlx5_core standard together with deep cleaning of whole IPsec path. ===================== Signed-off-by: David S. Miller commit 89877983ac60c1becf3cd6f161d2e2ac0aa6233a Merge: bbbd887282531 e9f3fb523dbf4 Author: Ulf Hansson Date: Wed May 4 11:52:07 2022 +0200 Merge branch 'fixes' into next commit 6a9b3de82516551543d153aefa8fe3577cea7271 Merge: f43f0cd2d9b07 259a834fadda0 Author: David S. Miller Date: Wed May 4 10:49:32 2022 +0100 Merge branch 'mptcp-pathmanager-api' Mat Martineau says: ==================== mptcp: Userspace path manager API Userspace path managers (PMs) make use of generic netlink MPTCP events and commands to control addition and removal of MPTCP subflows on an existing MPTCP connection. The path manager events have already been upstream for a while, and this patch series adds four netlink commands for userspace: * MPTCP_PM_CMD_ANNOUNCE: advertise an address that's available for additional subflow connections. * MPTCP_PM_CMD_REMOVE: revoke an advertisement * MPTCP_PM_CMD_SUBFLOW_CREATE: initiate a new subflow on an existing MPTCP connection * MPTCP_PM_CMD_SUBFLOW_DESTROY: close a subflow on an existing MPTCP connection Userspace path managers, such as mptcpd, can be more easily customized for different devices. The in-kernel path manager remains available to handle server use cases. Patches 1-3 update common path manager code (used by both in-kernel and userspace PMs) Patches 4, 6, and 8 implement the new generic netlink commands. Patches 5, 7, and 9-13 add self test support and test cases for the new path manager commands. ==================== Signed-off-by: David S. Miller commit 259a834fadda06db430bcd4ab95e1fcf5e63c4cb Author: Kishen Maloor Date: Tue May 3 19:39:01 2022 -0700 selftests: mptcp: functional tests for the userspace PM type This change adds a selftest script that performs a comprehensive behavioral/functional test of all userspace PM capabilities by exercising all the newly added APIs and changes to support said capabilities. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit bdde081d728ab86812947a62bf84a3b4dfeb2635 Author: Kishen Maloor Date: Tue May 3 19:39:00 2022 -0700 selftests: mptcp: create listeners to receive MPJs This change updates the "pm_nl_ctl" testing sample with a "listen" option to bind a MPTCP listening socket to the provided addr+port. This option is exercised in testing subflow initiation scenarios in conjunction with userspace path managers where the MPTCP application does not hold an active listener to accept requests for new subflows. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit b3e5fd653d3959f2845018f60db497a056aa41b2 Author: Kishen Maloor Date: Tue May 3 19:38:59 2022 -0700 selftests: mptcp: capture netlink events This change adds to self-testing support for the MPTCP netlink interface by capturing various MPTCP netlink events (and all their metadata) associated with connections, subflows and address announcements. It is used in self-testing scripts that exercise MPTCP netlink commands to precisely validate those operations by examining the dispatched MPTCP netlink events in response to those commands. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 57cc361b8d38d5fc4c97abe13094d72ea0cfe8c4 Author: Kishen Maloor Date: Tue May 3 19:38:58 2022 -0700 selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_DESTROY This change updates the "pm_nl_ctl" testing sample with a "dsf" (destroy subflow) option to support the newly added netlink interface command MPTCP_PM_CMD_SUBFLOW_DESTROY over the chosen MPTCP connection. E.g. ./pm_nl_ctl dsf lip 10.0.2.1 lport 44567 rip 10.0.2.2 rport 56789 token 823274047 Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit cf8d0a6dfd649acd6b450444b56eb244cd2e86c1 Author: Kishen Maloor Date: Tue May 3 19:38:57 2022 -0700 selftests: mptcp: support MPTCP_PM_CMD_SUBFLOW_CREATE This change updates the "pm_nl_ctl" testing sample with a "csf" (create subflow) option to support the newly added netlink interface command MPTCP_PM_CMD_SUBFLOW_CREATE over the chosen MPTCP connection. E.g. ./pm_nl_ctl csf lip 10.0.2.1 lid 23 rip 10.0.2.2 rport 56789 token 823274047 Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 702c2f646d42cfd9e31133d68a8283fea48fd810 Author: Florian Westphal Date: Tue May 3 19:38:56 2022 -0700 mptcp: netlink: allow userspace-driven subflow establishment This allows userspace to tell kernel to add a new subflow to an existing mptcp connection. Userspace provides the token to identify the mptcp-level connection that needs a change in active subflows and the local and remote addresses of the new or the to-be-removed subflow. MPTCP_PM_CMD_SUBFLOW_CREATE requires the following parameters: { token, { loc_id, family, loc_addr4 | loc_addr6 }, { family, rem_addr4 | rem_addr6, rem_port } MPTCP_PM_CMD_SUBFLOW_DESTROY requires the following parameters: { token, { family, loc_addr4 | loc_addr6, loc_port }, { family, rem_addr4 | rem_addr6, rem_port } Acked-by: Paolo Abeni Co-developed-by: Kishen Maloor Signed-off-by: Kishen Maloor Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ecd2a77d672f0ea954b00bb5700f25bb1f9a32be Author: Kishen Maloor Date: Tue May 3 19:38:55 2022 -0700 selftests: mptcp: support MPTCP_PM_CMD_REMOVE This change updates the "pm_nl_ctl" testing sample with a "rem" (remove) option to support the newly added netlink interface command MPTCP_PM_CMD_REMOVE to issue a REMOVE_ADDR signal over the chosen MPTCP connection. E.g. ./pm_nl_ctl rem token 823274047 id 23 Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit d9a4594edabf125dc17dfd52acc722c3de1cb44c Author: Kishen Maloor Date: Tue May 3 19:38:54 2022 -0700 mptcp: netlink: Add MPTCP_PM_CMD_REMOVE This change adds a MPTCP netlink command for issuing a REMOVE_ADDR signal for an address over the chosen MPTCP connection from a userspace path manager. The command requires the following parameters: {token, loc_id}. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 9a0b36509df07f2e3b24d3ae6f222a4f099e0709 Author: Kishen Maloor Date: Tue May 3 19:38:53 2022 -0700 selftests: mptcp: support MPTCP_PM_CMD_ANNOUNCE This change updates the "pm_nl_ctl" testing sample with an "ann" (announce) option to support the newly added netlink interface command MPTCP_PM_CMD_ANNOUNCE to issue ADD_ADDR advertisements over the chosen MPTCP connection. E.g. ./pm_nl_ctl ann 192.168.122.75 token 823274047 id 25 dev enp1s0 Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 9ab4807c84a4aacfc9b4f79cc81254035e0ec361 Author: Kishen Maloor Date: Tue May 3 19:38:52 2022 -0700 mptcp: netlink: Add MPTCP_PM_CMD_ANNOUNCE This change adds a MPTCP netlink interface for issuing ADD_ADDR advertisements over the chosen MPTCP connection from a userspace path manager. The command requires the following parameters: { token, { loc_id, family, daddr4 | daddr6 [, dport] } [, if_idx], flags[signal] }. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 982f17ba1a2534b878fbcb1a5273bfbc551c5397 Author: Florian Westphal Date: Tue May 3 19:38:51 2022 -0700 mptcp: netlink: split mptcp_pm_parse_addr into two functions Next patch will need to parse MPTCP_PM_ATTR_ADDR attributes and fill an mptcp_addr_info structure from a different genl command callback. To avoid copy-paste, split the existing function to a helper that does the common part and then call the helper from the (renamed)mptcp_pm_parse_entry function. Acked-by: Paolo Abeni Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 8b20137012d9e521736c040328f8979cf0a144d0 Author: Kishen Maloor Date: Tue May 3 19:38:50 2022 -0700 mptcp: read attributes of addr entries managed by userspace PMs This change introduces a parallel path in the kernel for retrieving the local id, flags, if_index for an addr entry in the context of an MPTCP connection that's being managed by a userspace PM. The userspace and in-kernel PM modes deviate in their procedures for obtaining this information. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4638de5aefe56366726e5107a9da13ce5c84a1b7 Author: Kishen Maloor Date: Tue May 3 19:38:49 2022 -0700 mptcp: handle local addrs announced by userspace PMs This change adds an internal function to store/retrieve local addrs announced by userspace PM implementations to/from its kernel context. The function addresses the requirements of three scenarios: 1) ADD_ADDR announcements (which require that a local id be provided), 2) retrieving the local id associated with an address, and also where one may need to be assigned, and 3) reissuance of ADD_ADDRs when there's a successful match of addr/id. The list of all stored local addr entries is held under the MPTCP sock structure. Memory for these entries is allocated from the sock option buffer, so the list of addrs is bounded by optmem_max. The list if not released via REMOVE_ADDR signals is ultimately freed when the sock is destructed. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit bbbd8872825310b14bc6e04250d2cb5edcd55edb Author: Sebastian Reichel Date: Fri Apr 22 19:09:08 2022 +0200 dt-bindings: mmc: sdhci-of-dwcmhsc: Add rk3588 Add compatible value for the Rockchip rk3588 dwcmshc controller. Signed-off-by: Sebastian Reichel Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220422170920.401914-8-sebastian.reichel@collabora.com Signed-off-by: Ulf Hansson commit 2656d3ff4f66675cfec482982189ae6cd7d0f425 Author: Michael Ellerman Date: Wed May 4 19:38:32 2022 +1000 powerpc/powermac: Use for_each_property_of_node() Replace open-coded for loop with for_each_property_of_node(). Reported-by: Jiapeng Chong Signed-off-by: Michael Ellerman commit 5bb99fd4090fe1acfdb90a97993fcda7f8f5a3d6 Author: Randy Dunlap Date: Mon May 2 12:29:41 2022 -0700 powerpc/4xx/cpm: Fix return value of __setup() handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from cpm_powersave_off(). Fixes: d164f6d4f910 ("powerpc/4xx: Add suspend and idle support") Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220502192941.20955-1-rdunlap@infradead.org commit b793a01000122d2bd133ba451a76cc135b5e162c Author: Randy Dunlap Date: Mon May 2 12:29:25 2022 -0700 powerpc/idle: Fix return value of __setup() handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from powersave_off(). Fixes: 302eca184fb8 ("[POWERPC] cell: use ppc_md->power_save instead of cbe_idle_loop") Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220502192925.19954-1-rdunlap@infradead.org commit f44cf716e46c2786a9f4ba26a78705b42412983c Author: Wang Qing Date: Wed Feb 9 00:34:55 2022 -0800 powerpc/5xx: Drop unnecessary cast do_div() does a 64-by-32 division, the 2nd parameter is a u32. gbp->ipb_freq is already a u32, there's no need to transform it to u64 before passing it to do_div(). Signed-off-by: Wang Qing Signed-off-by: Christophe Leroy [mpe: Add some detail to change log] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1644395696-3545-1-git-send-email-wangqing@vivo.com commit dcbff9ad418497c2608d4b4d9423efc8e87e130e Author: Russell Currey Date: Tue Jun 8 15:48:51 2021 +1000 selftests/powerpc: Fix typo in spectre_v2 Signed-off-by: Russell Currey Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210608054851.164659-1-ruscur@russell.cc commit 6c1e5600b7c305fe2b7c4967c14c4d0cc5a13fae Author: Zou Wei Date: Mon Jun 7 11:01:48 2021 +0800 macintosh: Use for_each_child_of_node() macro Use for_each_child_of_node() macro instead of open coding it. Reported-by: Hulk Robot Signed-off-by: Zou Wei Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1623034908-30525-1-git-send-email-zou_wei@huawei.com commit 87ccc6684d3b57e3073f77cf28396b3037154193 Author: Christophe Leroy Date: Sun Mar 13 20:41:41 2022 +0100 powerpc/book3e: Fix sparse report in mm/nohash/fsl_book3e.c Make tlbcam_addrs[] static. Declare TLBCAM[] in mm/mmu_decl.h And use NULL instead of 0 as pointer when calling restore_to_as0(). Reported-by: kernel test robot Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fd0cc30b5556428ce1d8a1fc0f983b462e88a956.1647200488.git.christophe.leroy@csgroup.eu commit 5e6ec1ad2e89c9b9d4047778748e42f4450fb381 Author: YueHaibing Date: Fri Mar 11 21:00:17 2022 +0800 powerpc/kuap: Remove unused inline function __kuap_assert_locked() commit 2341964e27b0 ("powerpc/kuap: Remove __kuap_assert_locked()") left behind this one, remove it. Signed-off-by: YueHaibing Acked-by: Christophe Leroy Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220311130017.22936-1-yuehaibing@huawei.com commit dc7a98b89b0c209e6ccba0a1f6390adbc36d5ca4 Author: YueHaibing Date: Wed Mar 24 22:07:52 2021 +0800 powerpc/smp: Remove unused inline functions commit 441c19c8a290 ("powerpc/kvm/book3s_hv: Rework the secondary inhibit code") left behind this, so can remove it. Signed-off-by: YueHaibing Reviewed-by: Daniel Axtens Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210324140752.11320-1-yuehaibing@huawei.com commit c2267354638dc48bcf5bb089b44362841a2a8925 Author: maqiang Date: Wed Mar 3 19:57:10 2021 +0800 powerpc: Remove redundant spaces to match coding style These one line of code don't meet the kernel coding style, so remove the redundant space. Signed-off-by: maqiang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210303115710.30886-1-maqianga@uniontech.com commit 44c10404c13604d1c98e285ff1c4bf821da80240 Author: Magali Lemes Date: Mon Feb 21 20:07:41 2022 -0300 powerpc: Fix missing declaration of [en/dis]able_kernel_altivec() When CONFIG_PPC64 is set and CONFIG_ALTIVEC is not the following build failures occur: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c: In function 'dc_fpu_begin': >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:61:17: error: implicit declaration of function 'enable_kernel_altivec'; did you mean 'enable_kernel_vsx'? [-Werror=implicit-function-declaration] 61 | enable_kernel_altivec(); | ^~~~~~~~~~~~~~~~~~~~~ | enable_kernel_vsx drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c: In function 'dc_fpu_end': >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/dc_fpu.c:89:17: error: implicit declaration of function 'disable_kernel_altivec'; did you mean 'disable_kernel_vsx'? [-Werror=implicit-function-declaration] 89 | disable_kernel_altivec(); | ^~~~~~~~~~~~~~~~~~~~~~ | disable_kernel_vsx cc1: some warnings being treated as errors This commit adds stub instances of both enable_kernel_altivec() and disable_kernel_altivec() the same way as done in commit bd73758803c2 regarding enable_kernel_vsx() and disable_kernel_vsx(). Reported-by: kernel test robot Signed-off-by: Magali Lemes Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220221230741.293064-1-magalilemes00@gmail.com commit 928b39645ec4985ea02dc3e3b45720d1456e190b Author: Yang Li Date: Mon Feb 14 09:05:58 2022 +0800 macintosh: Fix warning comparing pointer to 0 Fix the following coccicheck warnings: ./drivers/macintosh/via-cuda.c:240:16-17: WARNING comparing pointer to 0 ./drivers/macintosh/via-cuda.c:243:16-17: WARNING comparing pointer to 0, suggest !E ./drivers/macintosh/via-cuda.c:521:23-24: WARNING comparing pointer to 0 Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220214010558.130201-1-yang.lee@linux.alibaba.com commit 2077631917591650fdab5ec62717fd291a39b050 Author: Jiapeng Chong Date: Sat Jan 29 11:48:47 2022 +0800 powerpc/fadump: Use swap() instead of open coding it Clean the following coccicheck warning: ./arch/powerpc/kernel/fadump.c:1291:34-35: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220129034847.76902-1-jiapeng.chong@linux.alibaba.com commit e9bb94cde12d14e460b954f468af1200856564cf Author: Minghao Chi Date: Tue Jan 18 07:52:52 2022 +0000 macintosh/ams: Remove unneeded result variable Return the value from i2c_add_driver() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220118075252.925616-1-chi.minghao@zte.com.cn commit 9d021a2149b8804627d04a9aceec60b24e384f11 Author: Xiang wangx Date: Tue Dec 21 11:34:23 2021 +0800 powerpc: 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: Xiang wangx Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221033423.29820-1-wangxiang@cdjrlc.com commit 6130ed79decc38b873deb582678ac81caefd5555 Author: Yang Guang Date: Thu Nov 4 09:14:56 2021 +0800 macintosh/adb: Use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211104011456.1027830-1-yang.guang5@zte.com.cn commit 887f56a07f0eee41f60ef3d165facaa348b3e3af Author: Randy Dunlap Date: Fri Oct 29 17:26:19 2021 -0700 powerpc/fadump: Correct two typos in a comment Fix typos of 'remaining' and 'those'. Signed-off-by: Randy Dunlap Suggested-by: Matthew Wilcox # 'remaining' Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211030002619.2063-1-rdunlap@infradead.org commit cc4639989e93f5be6445e1466937e0a455f9bd88 Author: Qing Wang Date: Thu Oct 14 23:49:04 2021 -0700 macintosh/ams: Replace snprintf in show functions with sysfs_emit show() must not use snprintf() when formatting the value to be returned to user space. Fix the following coccicheck warning: drivers/macintosh/ams/ams-core.c:53: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1634280544-4581-1-git-send-email-wangqing@vivo.com commit 5749e7c1aa8c25ca11a8c8cac71d1a052231ef51 Author: Sohaib Mohamed Date: Wed Oct 6 17:50:17 2021 +0200 Documentation: Fix typo in testing/sysfs-class-cxl Remove repeated words: "the the lowest" and "this this kernel" Signed-off-by: Sohaib Mohamed Acked-by: Andrew Donnellan Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211006155017.135592-1-sohaib.amhmd@gmail.com commit 8cd1d2e9d08654b66c17432eccd404de9137ac08 Author: Jing Yangyang Date: Tue Aug 24 23:18:38 2021 -0700 macintosh/smu: Fix warning comparing pointer to 0 Fix the following coccicheck warning: ./drivers/macintosh/smu.c:1089: 11-12: WARNING comparing pointer to 0, suggest !E ./drivers/macintosh/smu.c:1256:11-12: WARNING comparing pointer to 0 Reported-by: Zeal Robot Signed-off-by: Jing Yangyang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210825061838.69746-1-deng.changcheng@zte.com.cn commit a2ece1f512959258f29a11909d23a44fc95edf97 Author: Jason Wang Date: Sat Aug 7 15:21:54 2021 +0800 powerpc: use strscpy to replace strlcpy The strlcpy should not be used because it doesn't limit the source length. As linus says, it's a completely useless function if you can't implicitly trust the source string - but that is almost always why people think they should use it! All in all the BSD function will lead some potential bugs. But the strscpy doesn't require reading memory from the src string beyond the specified "count" bytes, and since the return value is easier to error-check than strlcpy()'s. In addition, the implementation is robust to the string changing out from underneath it, unlike the current strlcpy() implementation. Thus, We prefer using strscpy instead of strlcpy. Signed-off-by: Jason Wang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210807072154.64512-1-wangborong@cdjrlc.com commit 76c452b494b8be58a1965ab93b7002f295f7705a Author: Jason Wang Date: Thu Jul 29 19:52:52 2021 +0800 powerpc/perf/24x7: use 'unsigned int' instead of 'unsigned' Replace the 'unsigned' with 'unsigned int' which is more accurate. Signed-off-by: Jason Wang [chleroy: Fixed parenthesis alignment] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210729115252.40895-1-wangborong@cdjrlc.com commit 4ac751d3f3cc7f62200d1aca32ce6f58f3d0ae96 Author: Dwaipayan Ray Date: Sun Jul 11 14:18:37 2021 +0530 powerpc/powernv: Switch from __FUNCTION__ to __func__ __FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__. Signed-off-by: Dwaipayan Ray Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210711084837.95577-1-dwaipayanray1@gmail.com commit e62520b8870837440262057f6573c231cd700116 Author: Dwaipayan Ray Date: Sun Jul 11 14:15:36 2021 +0530 powerpc/mm: Switch from __FUNCTION__ to __func__ __FUNCTION__ exists only for backwards compatibility reasons with old gcc versions. Replace it with __func__. Signed-off-by: Dwaipayan Ray [chleroy: Fixed parenthesis alignment] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210711084536.95394-1-dwaipayanray1@gmail.com commit 8617982d82c0b7d97b4b216a4d59135ffcb88aaf Author: Colin Ian King Date: Sun Jul 4 10:38:46 2021 +0100 powerpc: Fix spelling mistake "mesages" -> "messages" in Kconfig There is a spelling mistake in the Kconfig text. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210704093846.36972-1-colin.king@canonical.com commit 08d61b46c53fc5fe1ed2c36019ae8240cfba15d0 Author: Chen Huang Date: Wed May 26 09:20:18 2021 +0000 powerpc/rtas: Replaced simple_strtoull() with kstrtoull() The simple_strtoull() function is deprecated in some situation, since it does not check for the range overflow, use kstrtoull() instead. Signed-off-by: Chen Huang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210526092020.554341-1-chenhuang5@huawei.com commit 59510820fff76fa6165a8adeafd072e62c16cc5d Author: Randy Dunlap Date: Wed Apr 28 17:53:23 2021 -0700 powerpc/mpc52xx: Fix some pr_debug() issues Fix some pr_debug() issues in mpc52xx_pci.c: - use __func__ to print function names - use "%pr" to print struct resource entries - use "%pa" to print a resource_size_t (phys_addr_t) The latter two fix several build warnings: ../arch/powerpc/platforms/52xx/mpc52xx_pci.c: In function 'mpc52xx_pci_setup': ../include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:277:40: note: format string is defined here 277 | pr_debug("mem_resource[1] = {.start=%x, .end=%x, .flags=%lx}\n", | ~^ | | | unsigned int | %llx ../include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:277:49: note: format string is defined here 277 | pr_debug("mem_resource[1] = {.start=%x, .end=%x, .flags=%lx}\n", | ~^ | | | unsigned int | %llx ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:299:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 299 | (unsigned long long)res->flags, (void*)hose->io_base_phys); | ^ ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:295:2: note: in expansion of macro 'pr_debug' 295 | pr_debug(".io_resource={.start=%llx,.end=%llx,.flags=%llx} " | ^~~~~~~~ The change to print mem_resource[0] is for consistency within this source file and to use the kernel API -- there were no warnings here. Signed-off-by: Randy Dunlap [chleroy: Fixed checkpatch complaints] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210429005323.8195-1-rdunlap@infradead.org commit d5f14dcf0016e8c86c424d1fd839b1e9ab000279 Author: Ye Bin Date: Fri Apr 9 17:51:45 2021 +0800 macintosh/via-pmu: Use DEFINE_SPINLOCK() for spinlock spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Reported-by: Hulk Robot Signed-off-by: Ye Bin Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210409095145.2294210-1-yebin10@huawei.com commit 295135d32fde7fa11c983cc7b1b79c49556c14cf Author: Zucheng Zheng Date: Fri Apr 9 17:35:19 2021 +0800 powerpc/pmac: remove unused symbol sccdbg symbol is not used, so remove it Reported-by: Hulk Robot Signed-off-by: Zucheng Zheng Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210409093519.118000-1-zhengzucheng@huawei.com commit 2b6ff203cd45ba3018fe84affdac93ef07e1db3d Author: Yu Kuai Date: Thu Apr 8 09:18:01 2021 +0800 powerpc: make 'boot_text_mapped' static The sparse tool complains as follow: arch/powerpc/kernel/btext.c:48:5: warning: symbol 'boot_text_mapped' was not declared. Should it be static? This symbol is not used outside of btext.c, so this commit make it static. Signed-off-by: Yu Kuai Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210408011801.557004-3-yukuai3@huawei.com commit b396dd3d800c1374973c8fb901cb7e3a1439c8b6 Author: Yu Kuai Date: Thu Apr 8 09:18:00 2021 +0800 powerpc: remove set but not used variable 'force_printk_to_btext' Fixes gcc '-Wunused-but-set-variable' warning: arch/powerpc/kernel/btext.c:49:12: error: 'force_printk_to_btext' defined but not used. It is never used, and so can be removed. Signed-off-by: Yu Kuai Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210408011801.557004-2-yukuai3@huawei.com commit 701c31672a0b8f3694579e82f4c3fd8a1f9f4d5b Author: zuoqilin Date: Fri Mar 26 15:56:19 2021 +0800 powerpc/pseries/cmm: Remove unneeded variable "ret" Remove unneeded variable: "ret". Signed-off-by: zuoqilin Signed-off-by: Christophe Leroy [mpe: Just return NOTIFY_OK directly] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210326075619.48-1-zuoqilin1@163.com commit 0a3ef48c2fac4691db6060df54723e46e0c69b2a Author: YueHaibing Date: Wed Mar 24 22:07:14 2021 +0800 powerpc/eeh: Remove unused inline function eeh_dev_phb_init_dynamic() commit 475028efc708 ("powerpc/eeh: Remove eeh_dev_phb_init_dynamic()") left behind this, so can remove it. Signed-off-by: YueHaibing Reviewed-by: Daniel Axtens Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210324140714.19612-1-yuehaibing@huawei.com commit ce0091a0e06045e70c526c8735f8b866a85e0a45 Author: He Ying Date: Wed Mar 24 05:09:39 2021 -0400 powerpc/time: Fix sparse warnings We found these warnings in arch/powerpc/kernel/time.c as follows: warning: symbol 'decrementer_max' was not declared. Should it be static? warning: symbol 'rtc_lock' was not declared. Should it be static? warning: symbol 'dtl_consumer' was not declared. Should it be static? Declare 'decrementer_max' in powerpc asm/time.h. Include linux/mc146818rtc.h in powerpc kernel/time.c where 'rtc_lock' is declared. And remove duplicated declaration of 'rtc_lock' in powerpc platforms/chrp/time.c because it has included linux/mc146818rtc.h. Move 'dtl_consumer' definition after "include " because it is declared there. Reported-by: Hulk Robot Signed-off-by: He Ying Reviewed-by: Christophe Leroy Reviewed-by: Alexandre Belloni Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210324090939.143477-1-heying24@huawei.com commit 6a7ace2b99706a17b3f38e0114172abaeb00f240 Author: Rajkumar Kasirajan Date: Wed Apr 6 16:17:01 2022 +0100 clk: tegra: Replace .round_rate() with .determine_rate() Replace the .round_rate() callback with .determine_rate() which can consider max_rate imposed by clk_set_max_rate() while rounding the clock rate. Note that if the .determine_rate() callback is defined it will be called instead of the .round_rate() callback when calling clk_round_rate(). By using .determine_rate(), the maximum rate returned when calling clk_round_rate() is now limited by the current max_rate. Signed-off-by: Rajkumar Kasirajan [jonathanh@nvidia.com: checkpatch fixes and commit message update] Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 2db12b15c6f3e41ae2f2b3bb15627f28d1eaf715 Author: Timo Alho Date: Wed Apr 6 16:17:00 2022 +0100 clk: tegra: Register clocks from root to leaf Current clock initialization causes intermediate registering of orphan clocks (i.e. a clock without a parent registered). CCF keeps track of orphan clocks and any time a new clock is registered, it will loop through the list of orphan and queries if the parent is now available. This operation triggers one or more clock operations, which are IPCs with BPMP-FW. Hence, due to the order in which the clocks appear currently, this causes > 5000 IPC messages to be sent to BPMP-FW during clock initialization. Optimize the clock probing by registering clocks hierarchically from root clock towards leafs. Signed-off-by: Timo Alho [jonathanh@nvidia.com: checkpatch fixes] Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 0017f2c856e21bb900be88469e15dac4f41f4065 Author: Diogo Ivo Date: Fri Apr 29 13:58:43 2022 +0100 arm64: tegra: Add missing DFLL reset on Tegra210 Commit 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") removed deassertion of reset lines when enabling peripheral clocks. This breaks the initialization of the DFLL driver which relied on this behaviour. In order to be able to fix this, add the corresponding reset to the DT. Tested on Google Pixel C. Cc: stable@vger.kernel.org Fixes: 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 23a43cc437e747473d5f8f98b4fe189fb5c433b7 Author: Diogo Ivo Date: Fri Apr 29 13:58:43 2022 +0100 clk: tegra: Add missing reset deassertion Commit 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") removed deassertion of reset lines when enabling peripheral clocks. This breaks the initialization of the DFLL driver which relied on this behaviour. Fix this problem by adding explicit deassert/assert requests to the driver. Tested on Google Pixel C. Cc: stable@vger.kernel.org Fixes: 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 7685665c390dc68c2d9a74e8445f41494cc8f6cf Author: Sandipan Das Date: Thu Apr 21 11:16:58 2022 +0530 perf/x86/amd/core: Add PerfMonV2 overflow handling If AMD Performance Monitoring Version 2 (PerfMonV2) is supported, use a new scheme to process Core PMC overflows in the NMI handler using the new global control and status registers. This will be bypassed on unsupported hardware (x86_pmu.version < 2). In x86_pmu_handle_irq(), overflows are detected by testing the contents of the PERF_CTR register for each active PMC in a loop. The new scheme instead inspects the overflow bits of the global status register. The Performance Counter Global Status (PerfCntrGlobalStatus) register has overflow (PerfCntrOvfl) bits for each PMC. This is, however, a read-only MSR. To acknowledge that overflows have been processed, the NMI handler must clear the bits by writing to the PerfCntrGlobalStatusClr register. In x86_pmu_handle_irq(), PMCs counting the same event that are started and stopped at the same time record slightly different counts due to delays in between reads from the PERF_CTR registers. This is fixed by stopping and starting the PMCs at the same before and with a single write to the Performance Counter Global Control (PerfCntrGlobalCtl) upon entering and before exiting the NMI handler. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/f20b7e4da0b0a83bdbe05857f354146623bc63ab.1650515382.git.sandipan.das@amd.com commit 9622e67e3980c01872490de0925e5c6c23247c94 Author: Sandipan Das Date: Thu Apr 21 11:16:57 2022 +0530 perf/x86/amd/core: Add PerfMonV2 counter control If AMD Performance Monitoring Version 2 (PerfMonV2) is supported, use a new scheme to manage the Core PMCs using the new global control and status registers. This will be bypassed on unsupported hardware (x86_pmu.version < 2). Currently, all PMCs have dedicated control (PERF_CTL) and counter (PERF_CTR) registers. For a given PMC, the enable (En) bit of its PERF_CTL register is used to start or stop counting. The Performance Counter Global Control (PerfCntrGlobalCtl) register has enable (PerfCntrEn) bits for each PMC. For a PMC to start counting, both PERF_CTL and PerfCntrGlobalCtl enable bits must be set. If either of those are cleared, the PMC stops counting. In x86_pmu_{en,dis}able_all(), the PERF_CTL registers of all active PMCs are written to in a loop. Ideally, PMCs counting the same event that were started and stopped at the same time should record the same counts. Due to delays in between writes to the PERF_CTL registers across loop iterations, the PMCs cannot be enabled or disabled at the same instant and hence, record slightly different counts. This is fixed by enabling or disabling all active PMCs at the same time with a single write to the PerfCntrGlobalCtl register. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/dfe8e934074aaabc6ba748dfaccd0a77c974bb82.1650515382.git.sandipan.das@amd.com commit 56e026a7ca3f92b8e44359e1f705febd1833f701 Author: Sandipan Das Date: Thu Apr 21 11:16:56 2022 +0530 perf/x86/amd/core: Detect available counters If AMD Performance Monitoring Version 2 (PerfMonV2) is supported, use CPUID leaf 0x80000022 EBX to detect the number of Core PMCs. This offers more flexibility if the counts change in later processor families. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/68a6d9688df189267db26530378870edd34f7b06.1650515382.git.sandipan.das@amd.com commit 21d59e3e2c403c83ba196a5857d517054124168e Author: Sandipan Das Date: Thu Apr 21 11:16:55 2022 +0530 perf/x86/amd/core: Detect PerfMonV2 support AMD Performance Monitoring Version 2 (PerfMonV2) introduces some new Core PMU features such as detection of the number of available PMCs and managing PMCs using global registers namely, PerfCntrGlobalCtl and PerfCntrGlobalStatus. Clearing PerfCntrGlobalCtl and PerfCntrGlobalStatus ensures that all PMCs are inactive and have no pending overflows when CPUs are onlined or offlined. The PMU version (x86_pmu.version) now indicates PerfMonV2 support and will be used to bypass the new features on unsupported processors. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/dc8672ecbddff394e088ca8abf94b089b8ecc2e7.1650515382.git.sandipan.das@amd.com commit 089be16d5992dd0bc6df15ef12042fd1023ded9a Author: Sandipan Das Date: Thu Apr 21 11:16:54 2022 +0530 x86/msr: Add PerfCntrGlobal* registers Add MSR definitions that will be used to enable the new AMD Performance Monitoring Version 2 (PerfMonV2) features. These include: * Performance Counter Global Control (PerfCntrGlobalCtl) * Performance Counter Global Status (PerfCntrGlobalStatus) * Performance Counter Global Status Clear (PerfCntrGlobalStatusClr) The new Performance Counter Global Control and Status MSRs provide an interface for enabling or disabling multiple counters at the same time and for testing overflow without probing the individual registers for each PMC. The availability of these registers is indicated through the PerfMonV2 feature bit of CPUID leaf 0x80000022 EAX. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/cdc0d8f75bd519848731b5c64d924f5a0619a573.1650515382.git.sandipan.das@amd.com commit d6d0c7f681fda1d07e005c8f653e578b77a0eb40 Author: Sandipan Das Date: Thu Apr 21 11:16:53 2022 +0530 x86/cpufeatures: Add PerfMonV2 feature bit 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. Additionally, Core PMCs can be managed using new global control and status registers. For better utilization of feature words, PerfMonV2 is added as a scattered feature bit. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/c70e497e22f18e7f05b025bb64ca21cc12b17792.1650515382.git.sandipan.das@amd.com commit 9767d1be1529c40469d1bbdc457953f88fa1dca7 Author: Thierry Reding Date: Wed May 4 11:08:14 2022 +0200 soc/tegra: pmc: Select REGMAP Commit 9d5e7c3e36eb ("soc/tegra: pmc: Provide USB sleepwalk register map") introduced a dependency on the regmap infrastructure, so select the corresponding Kconfig entry. This avoids failures in random builds that may otherwise end up having SOC_TEGRA_PMC enabled but not REGMAP. Signed-off-by: Thierry Reding commit e263d33ceccf940d5e17caf34bf6f09630b8dc2e Author: Dipen Patel Date: Fri Apr 22 13:52:21 2022 -0700 MAINTAINERS: Add HTE Subsystem Add myself as a maintainer for this new Hardware Timestamping Engine (HTE) subsystem. Signed-off-by: Dipen Patel Signed-off-by: Thierry Reding commit 9a75a7cd03c957fd13c39f01402e952c5ad4aebc Author: Dipen Patel Date: Fri Apr 22 13:52:20 2022 -0700 hte: Add Tegra HTE test driver The test driver uses IRQ and GPIO lines to timestamp using HTE subsystem. The patch also adds compilation support in Kconfig and Makefile. Signed-off-by: Dipen Patel Signed-off-by: Thierry Reding commit ed94eb2e22846e04ea32fe2282b49cb293ae88e2 Author: Dipen Patel Date: Fri Apr 22 13:52:19 2022 -0700 tools: gpio: Add new hardware clock type gpiolib-cdev is extended to support hardware clock type, this patch reflects that fact. Signed-off-by: Dipen Patel Reviewed-by: Linus Walleij Signed-off-by: Thierry Reding commit 2068339a6c35147847ba433fd0da67b313779059 Author: Dipen Patel Date: Fri Apr 22 13:52:18 2022 -0700 gpiolib: cdev: Add hardware timestamp clock type This patch adds new clock type for the GPIO controller which can timestamp gpio lines in using hardware means. To expose such functionalities to the userspace, code has been added where during line create or set config API calls, it checks for new clock type and if requested, calls HTE API. During line change event, the HTE subsystem pushes timestamp data to userspace through gpiolib-cdev. Signed-off-by: Dipen Patel Acked-by: Linus Walleij Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Thierry Reding commit 10e4afd6cc4bf1b6cc21ad9418bcebdcc18abefb Author: Dipen Patel Date: Fri Apr 22 13:52:17 2022 -0700 gpio: tegra186: Add HTE support Tegra194 AON GPIO controller with the use of its internal hardware timestamping engine (HTE), also known as GTE, can timestamp GPIO lines through system counter. This patch implements enable/disable callbacks for the GPIO controller. In enable call, it will set timestamp function bit and GPIO line rising/falling edges in the config register. In disable call, it restores the state. Signed-off-by: Dipen Patel Signed-off-by: Thierry Reding commit 42112dd77b74220e6a1f4a71bb51ca3f583d3842 Author: Dipen Patel Date: Fri Apr 22 13:52:16 2022 -0700 gpiolib: Add HTE support Some GPIO chip can provide hardware timestamp support on its GPIO lines , in order to support that, additional API needs to be added which can talk to both GPIO chip and HTE (hardware timestamping engine) providers if there is any dependencies. This patch introduces optional hooks to enable and disable hardware timestamping related features in the GPIO controller chip. Signed-off-by: Dipen Patel Reviewed-by: Linus Walleij Reported-by: kernel test robot Signed-off-by: Thierry Reding commit e6a3a65be8e4dc6fc74fdb28483ba5b997aab6aa Author: Dipen Patel Date: Fri Apr 22 13:52:15 2022 -0700 dt-bindings: Add HTE bindings Introduces HTE devicetree binding details for the HTE subsystem. It includes examples for the consumers, binding details for the providers and specific binding details for the Tegra194 based HTE providers. Signed-off-by: Dipen Patel Reviewed-by: Linus Walleij Signed-off-by: Thierry Reding commit 09574cca6ad649f84ba804caf63a5aefe0202834 Author: Dipen Patel Date: Fri Apr 22 13:52:14 2022 -0700 hte: Add Tegra194 HTE kernel provider Tegra194 device has multiple HTE instances also known as GTE (Generic Hardware Timestamping Engine) which can timestamp subset of SoC lines and signals. This provider driver focuses on IRQ and GPIO lines and exposes timestamping ability on those lines to the consumers through HTE subsystem. Also, with this patch, added: - documentation about this provider and its capabilities at Documentation/hte. - Compilation support in Makefile and Kconfig Signed-off-by: Dipen Patel Reported-by: kernel test robot Signed-off-by: Thierry Reding commit 31ab09b4218879bc394c9faa6da983a82a694600 Author: Dipen Patel Date: Fri Apr 22 13:52:13 2022 -0700 drivers: Add hardware timestamp engine (HTE) subsystem Some devices can timestamp system lines/signals/Buses in real-time using the hardware counter or other hardware means which can give finer granularity and help avoid jitter introduced by software timestamping. To utilize such functionality, this patchset creates HTE subsystem where devices can register themselves as providers so that the consumers devices can request specific line from the providers. The patch also adds compilation support in Makefile and menu options in Kconfig. The provider does following: - Registers chip with the framework. - Provides translation hook to convert logical line id. - Provides enable/disable, request/release callbacks. - Pushes timestamp data to HTE subsystem. The consumer does following: - Initializes line attribute. - Gets HTE timestamp descriptor. - Requests timestamp functionality. - Puts HTE timestamp descriptor. Signed-off-by: Dipen Patel Reported-by: kernel test robot Signed-off-by: Thierry Reding commit 5b7e58313a77e951850586cfaa9f5d60122f908f Author: Alexandre Torgue Date: Fri Apr 22 17:09:52 2022 +0200 ARM: dts: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1) Add a "secure" version based on SCMI of STM32 boards. Only boards provided by STMicroelectronics are concerned: -STM32MP157A-DK1 -STM32MP157C-DK2 -STM32MP157C-ED1 -STM32MP157C-EV1 Signed-off-by: Alexandre Torgue commit ae60e0763e97e977b03af1ac6ba782a4a86c3a5a Author: Mark Brown Date: Wed May 4 00:16:55 2022 +0100 kselftest/arm64: Fix ABI header directory location Currently the arm64 kselftests attempt to locate the ABI headers using custom logic which doesn't work correctly in the case of out of tree builds if KBUILD_OUTPUT is not specified. Since lib.mk defines KHDR_INCLUDES with the appropriate flags we can simply remove the custom logic and use that instead. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220503231655.211346-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8e14ebb1f08f036539c8cd362a9fd173c4befa2a Author: Alexandre Torgue Date: Fri Apr 22 17:09:51 2022 +0200 dt-bindings: arm: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1) Add a "secure" version based on SCMI of STM32 boards. Only boards provided by STMicroelectronics are concerned: -STM32MP157A-DK1 -STM32MP157C-DK2 -STM32MP157C-ED1 -STM32MP157C-EV1 Signed-off-by: Alexandre Torgue Acked-by: Rob Herring commit 40b4157dbd8cfecbfafdf64aaa562c140a4a5ef1 Author: Alexandre Torgue Date: Fri Apr 22 17:09:50 2022 +0200 ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15 Enable optee and SCMI clocks/reset protocols support. Signed-off-by: Alexandre Torgue commit 5f5d7decf046557876794c5686ee0ccf5907bfde Author: Alexandre Torgue Date: Fri Apr 22 17:09:48 2022 +0200 dt-bindings: reset: stm32mp15: rename RST_SCMI define As we only have one SCMI instance, it's not necessary to add an index to the name. Signed-off-by: Alexandre Torgue Acked-by: Rob Herring commit 9b0df592522c6f86283679436f2eac49bd23cdce Author: Alexandre Torgue Date: Fri Apr 22 17:09:47 2022 +0200 dt-bindings: clock: stm32mp15: rename CK_SCMI define As we only have one SCMI instance, it's not necessary to add an index to the name. Signed-off-by: Alexandre Torgue Acked-by: Rob Herring commit 35de4b4b82bcfaa5a33fd02e74a453fc67b3b1ec Author: Alexandre Torgue Date: Fri Apr 22 17:09:46 2022 +0200 dt-bindings: clock: stm32mp1: describes clocks if "st,stm32mp1-rcc-secure" In case of "st,stm32mp1-rcc-secure" (stm32mp1 clock driver with RCC security support hardened), "clocks" and "clock-names" describe oscillators and are required. Signed-off-by: Alexandre Torgue Reviewed-by: Rob Herring commit 6e5b6ce2053c3a7ba94d93962e66b5240e286279 Author: Marek Vasut Date: Mon Apr 11 00:05:14 2022 +0200 dt-bindings: rcc: Add optional external ethernet RX clock properties Describe optional external ethernet RX clock in the DT binding to fix dtbs_check warnings like: arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dt.yaml: rcc@50000000: 'assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Gabriel Fernandez Cc: Rob Herring To: devicetree@vger.kernel.org Acked-by: Gabriel Fernandez Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220410220514.21779-1-marex@denx.de Signed-off-by: Alexandre Torgue commit 8b9ad480bd1dd25f4ff4854af5685fa334a2f57a Author: Xiaomeng Tong Date: Sun May 1 21:28:23 2022 +0800 iommu/msm: Fix an incorrect NULL check on list iterator The bug is here: if (!iommu || iommu->dev->of_node != spec->np) { The list iterator value 'iommu' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found (in fact, it will point to a invalid structure object containing HEAD). To fix the bug, use a new value 'iter' as the list iterator, while use the old value 'iommu' as a dedicated variable to point to the found one, and remove the unneeded check for 'iommu->dev->of_node != spec->np' outside the loop. Cc: stable@vger.kernel.org Fixes: f78ebca8ff3d6 ("iommu/msm: Add support for generic master bindings") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220501132823.12714-1-xiam0nd.tong@gmail.com Signed-off-by: Joerg Roedel commit d25f30fe41ee70c38b75067936cdcbe0b3a2b6ec Merge: 904cabf471242 ee87a9bd657e8 Author: Marc Zyngier Date: Wed May 4 09:42:45 2022 +0100 Merge branch kvm-arm64/aarch32-idreg-trap into kvmarm-master/next * kvm-arm64/aarch32-idreg-trap: : . : Add trapping/sanitising infrastructure for AArch32 systen registers, : allowing more control over what we actually expose (such as the PMU). : : Patches courtesy of Oliver and Alexandru. : . KVM: arm64: Fix new instances of 32bit ESRs KVM: arm64: Hide AArch32 PMU registers when not available KVM: arm64: Start trapping ID registers for 32 bit guests KVM: arm64: Plumb cp10 ID traps through the AArch64 sysreg handler KVM: arm64: Wire up CP15 feature registers to their AArch64 equivalents KVM: arm64: Don't write to Rt unless sys_reg emulation succeeds KVM: arm64: Return a bool from emulate_cp() Signed-off-by: Marc Zyngier commit 904cabf4712426fdcb902b149b97c62ac0fbc8f6 Merge: b2c4caf3316ce 6ccf9cb557bd3 Author: Marc Zyngier Date: Wed May 4 09:42:37 2022 +0100 Merge branch kvm-arm64/hyp-stack-guard into kvmarm-master/next * kvm-arm64/hyp-stack-guard: : . : Harden the EL2 stack by providing stack guards, courtesy of : Kalesh Singh. : . KVM: arm64: Symbolize the nVHE HYP addresses KVM: arm64: Detect and handle hypervisor stack overflows KVM: arm64: Add guard pages for pKVM (protected nVHE) hypervisor stack KVM: arm64: Add guard pages for KVM nVHE hypervisor stack KVM: arm64: Introduce pkvm_alloc_private_va_range() KVM: arm64: Introduce hyp_alloc_private_va_range() Signed-off-by: Marc Zyngier commit b2c4caf3316ce535af333bbd2cd99ad96f991074 Merge: 4b88524c47d7b 06e0b802583d7 Author: Marc Zyngier Date: Wed May 4 09:42:16 2022 +0100 Merge branch kvm-arm64/wfxt into kvmarm-master/next * kvm-arm64/wfxt: : . : Add support for the WFET/WFIT instructions that provide the same : service as WFE/WFI, only with a timeout. : . KVM: arm64: Expose the WFXT feature to guests KVM: arm64: Offer early resume for non-blocking WFxT instructions KVM: arm64: Handle blocking WFIT instruction KVM: arm64: Introduce kvm_counter_compute_delta() helper KVM: arm64: Simplify kvm_cpu_has_pending_timer() arm64: Use WFxT for __delay() when possible arm64: Add wfet()/wfit() helpers arm64: Add HWCAP advertising FEAT_WFXT arm64: Add RV and RN fields for ESR_ELx_WFx_ISS arm64: Expand ESR_ELx_WFx_ISS_TI to match its ARMv8.7 definition Signed-off-by: Marc Zyngier commit e8d7ccaa3fb7575fda703ee6e05640c1c830fa06 Author: Yong Wu Date: Tue May 3 15:14:27 2022 +0800 iommu/mediatek: Add mt8186 iommu support Add mt8186 iommu supports. Signed-off-by: Anan Sun Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220503071427.2285-37-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 7597e3c5618d40986b23ddfd65d55d741536bf85 Author: Yong Wu Date: Tue May 3 15:14:26 2022 +0800 iommu/mediatek: mt8195: Enable multi banks for infra iommu Enable the multi-bank functions for infra-iommu. We put PCIE in bank0 and USB in the last bank(bank4). and we don't use the other banks currently, disable them. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-36-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit d7127de15eba3f96f9ed6854d3275a4e5919f025 Author: Yong Wu Date: Tue May 3 15:14:25 2022 +0800 iommu/mediatek: Backup/restore regsiters for multi banks Each bank has some independent registers. thus backup/restore them for each a bank when suspend and resume. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-35-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 42d57fc58aebc5801804424082028f43bad1b73c Author: Yong Wu Date: Tue May 3 15:14:24 2022 +0800 iommu/mediatek: Initialise/Remove for multi bank dev The registers for each bank of the IOMMU base are in order, delta is 0x1000. Initialise the base for each bank. For all the previous SoC, we only have bank0. thus use "do {} while()" to allow bank0 always go. When removing the device, Not always all the banks are initialised, it depend on if there is masters for that bank. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-34-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 57fb481f9008997563a8de96aa49726fd51d6e3e Author: Yong Wu Date: Tue May 3 15:14:23 2022 +0800 iommu/mediatek: Get the proper bankid for multi banks We preassign some ports in a special bank via the new defined banks_portmsk. Put it in the plat_data means it is not expected to be adjusted dynamically. If the iommu id in the iommu consumer's dtsi node is inside this banks_portmsk, then we switch it to this special iommu bank, and initialise the IOMMU bank HW. Each bank has the independent pgtable(4GB iova range). Each bank is a independent iommu domain/group. Currently we don't separate different iova ranges inside a bank. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-33-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit d72e0ff5424e74b551c73ed2d34c73b70b921733 Author: Yong Wu Date: Tue May 3 15:14:22 2022 +0800 iommu/mediatek: Change the domid to iova_region_id Prepare for adding bankid, also no functional change. In the previous SoC, each a iova_region is a domain; In the multi-banks case, each a bank is a domain, then the original function name "mtk_iommu_get_domain_id" is not proper. Use "iova_region_id" instead of "domain_id". Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-32-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit e24453e165bc774b53f826e86e8f4e9931ffcfba Author: Yong Wu Date: Tue May 3 15:14:21 2022 +0800 iommu/mediatek: Initialise bank HW for each a bank The mt8195 IOMMU HW max support 5 banks, and regarding the banks' registers, it looks like: ---------------------------------------- |bank0 | bank1 | bank2 | bank3 | bank4| ---------------------------------------- |global | |control| null |regs | ----------------------------------------- |bank |bank |bank |bank |bank | |regs |regs |regs |regs |regs | | | | | | | ----------------------------------------- Each bank has some special bank registers and it share bank0's global control registers. this patch initialise the bank hw with the bankid. In the hw_init, we always initialise bank0's control register since we don't know if the bank0 is initialised. Additionally, About each bank's register base, always delta 0x1000. like bank[x + 1] = bank[x] + 0x1000. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-31-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 99ca02281332957e0ee7e3702c4713dfae4a6046 Author: Yong Wu Date: Tue May 3 15:14:20 2022 +0800 iommu/mediatek: Add mtk_iommu_bank_data structure Prepare for supporting multi-banks for the IOMMU HW, No functional change. Add a new structure(mtk_iommu_bank_data) for each a bank. Each a bank have the independent HW base/IRQ/tlb-range ops, and each a bank has its special iommu-domain(independent pgtable), thus, also move the domain information into it. In previous SoC, we have only one bank which could be treated as bank0( bankid always is 0 for the previous SoC). After adding this structure, the tlb operations and irq could use bank_data as parameter. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-30-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit ad9b10e533f6fb3fa74afdc2341774b1305c176f Author: Yong Wu Date: Tue May 3 15:14:19 2022 +0800 iommu/mediatek-v1: Just rename mtk_iommu to mtk_iommu_v1 No functional change. Just rename this for readable. Differentiate this from mtk_iommu.c Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-29-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 6a513de3efe099976fc5924082e48b79c467664f Author: Yong Wu Date: Tue May 3 15:14:18 2022 +0800 iommu/mediatek: Remove mtk_iommu.h Currently there is a suspend structure in the header file. It's no need to keep a header file only for this. Move these into the c file and rm this header file. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-28-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 9485a04a5bb97e2b9749277005e1f7c23b9ec8be Author: Yong Wu Date: Tue May 3 15:14:17 2022 +0800 iommu/mediatek: Separate mtk_iommu_data for v1 and v2 Prepare for adding the structure "mtk_iommu_bank_data". No functional change. The mtk_iommu_domain in v1 and v2 are different, we could not add current data as bank[0] in v1 simplistically. Currently we have no plan to add new SoC for v1, in order to avoid affect v1 when we add many new features for v2, I totally separate v1 and v2 in this patch, there are many structures only for v2. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-27-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 634f57df1f3b61cc1b1441762718a14da28c27f8 Author: Yong Wu Date: Tue May 3 15:14:16 2022 +0800 iommu/mediatek: Just move code position in hw_init No functional change too, prepare for mt8195 IOMMU support bank functions. Some global control settings are in bank0 while the other banks have their bank independent setting. Here only move the global control settings and the independent registers together. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-26-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 887cf6a74a2f7225300186ff0896aa93ce42f969 Author: Yong Wu Date: Tue May 3 15:14:15 2022 +0800 iommu/mediatek: Only adjust code about register base No functional change. Use "base" instead of the data->base. This is avoid to touch too many lines in the next patches. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-25-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit ef68a193c719436a2203c2d59442e0f32775385c Author: Yong Wu Date: Tue May 3 15:14:14 2022 +0800 iommu/mediatek: Add mt8195 support mt8195 has 3 IOMMU, containing 2 MM IOMMUs, one is for vdo, the other is for vpp. and 1 INFRA IOMMU. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-24-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit e76290702570bb0ef825050ce4a529b10dab2dba Author: Yong Wu Date: Tue May 3 15:14:13 2022 +0800 iommu/mediatek: Add PCIe support Currently the code for of_iommu_configure_dev_id is like this: static int of_iommu_configure_dev_id(struct device_node *master_np, struct device *dev, const u32 *id) { struct of_phandle_args iommu_spec = { .args_count = 1 }; err = of_map_id(master_np, *id, "iommu-map", "iommu-map-mask", &iommu_spec.np, iommu_spec.args); ... } It supports only one id output. BUT our PCIe HW has two ID(one is for writing, the other is for reading). I'm not sure if we should change of_map_id to support output MAX_PHANDLE_ARGS. Here add the solution in ourselve drivers. If it's pcie case, enable one more bit. Not all infra iommu support PCIe, thus add a PCIe support flag here. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-23-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit f9b8c9b2194327c26eecfc82dde9541e80c24c80 Author: Yong Wu Date: Tue May 3 15:14:12 2022 +0800 iommu/mediatek: Add infra iommu support The infra iommu enable bits in mt8195 is in the pericfg register segment, use regmap to update it. If infra iommu master translation fault, It doesn't have the larbid/portid, thus print out the whole register value. Since regmap_update_bits may fail, add return value for mtk_iommu_config. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-22-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 6077c7e5d22f2e0ffdb1dd97bf37cba66f317627 Author: Yong Wu Date: Tue May 3 15:14:11 2022 +0800 iommu/mediatek: Add a PM_CLK_AO flag for infra iommu The power/clock of infra iommu is always on, and it doesn't have the device link with the master devices, then the infra iommu device's PM status is not active, thus we add A PM_CLK_AO flag for infra iommu. The tlb operation is a bit not clear here, there are 2 special cases. Comment them in the code. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-21-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 32e1cccf68123bcd357c0115567d2ce3453cd3ed Author: Yong Wu Date: Tue May 3 15:14:10 2022 +0800 iommu/mediatek: Allow IOMMU_DOMAIN_UNMANAGED for PCIe VFIO Allow the type IOMMU_DOMAIN_UNMANAGED since vfio_iommu_type1.c always call iommu_domain_alloc. The PCIe EP works ok when going through vfio. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-20-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit f7b71d0d3ee7f83439f82af2d7e595ecd9b9b42c Author: Yong Wu Date: Tue May 3 15:14:09 2022 +0800 iommu/mediatek: Adjust device link when it is sub-common For MM IOMMU, We always add device link between smi-common and IOMMU HW. In mt8195, we add smi-sub-common. Thus, if the node is sub-common, we still need find again to get smi-common, then do device link. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-19-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit d2e9a1102cfc22c08450875faa667a60f0b1b1f6 Author: Yong Wu Date: Tue May 3 15:14:08 2022 +0800 iommu/mediatek: Contain MM IOMMU flow with the MM TYPE Prepare for supporting INFRA_IOMMU, and APU_IOMMU later. For Infra IOMMU/APU IOMMU, it doesn't have the "larb""port". thus, Use the MM flag contain the MM_IOMMU special flow, Also, it moves a big chunk code about parsing the mediatek,larbs into a function, this is only needed for MM IOMMU. and all the current SoC are MM_IOMMU. The device link between iommu consumer device and smi-larb device only is needed in MM iommu case. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-18-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 8cd1e619e79b5bdcd6fc346324a89e25c3325fde Author: Yong Wu Date: Tue May 3 15:14:07 2022 +0800 iommu/mediatek: Add IOMMU_TYPE flag Add IOMMU_TYPE definition. In the mt8195, we have another IOMMU_TYPE: infra iommu, also there will be another APU_IOMMU, thus, use 2bits for the IOMMU_TYPE. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-17-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 9ec30c09547d8dcf5491bb1334a5099a3412538b Author: Yong Wu Date: Tue May 3 15:14:06 2022 +0800 iommu/mediatek: Add SUB_COMMON_3BITS flag In prevous SoC, the sub common id occupy 2 bits. the mt8195's sub common id has 3bits. Add a new flag for this. and rename the previous flag to _2BITS. For readable, I put these two flags together, then move the other flags. no functional change. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-16-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 82e51771bff9ec900891a51629278a54a866a6ba Author: Yong Wu Date: Tue May 3 15:14:05 2022 +0800 iommu/mediatek: Always enable output PA over 32bits in isr Currently the output PA[32:33] is contained by the flag IOVA_34. This is not right. the iova_34 has no relation with pa[32:33], the 32bits iova still could map to pa[32:33]. Move it out from the flag. No need fix tag since currently only mt8192 use the calulation and it always has this IOVA_34 flag. Prepare for the IOMMU that still use IOVA 32bits but its dram size may be over 4GB. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-15-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit e6d25e7daaf28341b3be4b8d4ea0bdee6265b1c9 Author: Yong Wu Date: Tue May 3 15:14:04 2022 +0800 iommu/mediatek: Remove the granule in the tlb flush The MediaTek IOMMU doesn't care about granule when tlb flushing. Remove this variable. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-14-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit d265a4addc9c118d2467177b77a78a9956ddb2d5 Author: Yong Wu Date: Tue May 3 15:14:03 2022 +0800 iommu/mediatek: Add a flag STD_AXI_MODE Add a new flag STD_AXI_MODE which is prepared for infra and apu iommu which use the standard axi mode. All the current SoC don't use this flag. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-13-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 9a87005ed9c2a2135e15e03d97de849577d29437 Author: Yong Wu Date: Tue May 3 15:14:02 2022 +0800 iommu/mediatek: Add a flag DCM_DISABLE In the infra iommu, we should disable DCM. add a new flag for this. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-12-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 129a3b885879c42494044ded94d2dd77e90004b0 Author: Yong Wu Date: Tue May 3 15:14:01 2022 +0800 iommu/mediatek: Add 12G~16G support for multi domains In mt8192, we preassign 0-4G; 4G-8G; 8G-12G for different multimedia engines. This depends on the "dma-ranges=" in the iommu consumer's dtsi node. Adds 12G-16G region here. and reword the previous comment. we don't limit which master locate in which region. CCU still is 8G-12G. Don't change it here. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-11-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 9e3a2a64365318a743e3c0b028952d2cdbaf2b0c Author: Yong Wu Date: Tue May 3 15:14:00 2022 +0800 iommu/mediatek: Adapt sharing and non-sharing pgtable case In previous mt2712, Both IOMMUs are MM IOMMU, and they will share pgtable. However in the latest SoC, another is infra IOMMU, there is no reason to share pgtable between MM with INFRA IOMMU. This patch manage to implement the two case(sharing and non-sharing pgtable). Currently we use for_each_m4u to loop the 2 HWs. Add the list_head into this macro. In the sharing pgtable case, the list_head is the global "m4ulist". In the non-sharing pgtable case, the list_head is hw_list_head which is a variable in the "data". then for_each_m4u will only loop itself. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-10-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit ddf67a87bebf2a8750d86f67cb298313ee93db31 Author: Yong Wu Date: Tue May 3 15:13:59 2022 +0800 iommu/mediatek: Add mutex for data in the mtk_iommu_domain Same with the previous patch, add a mutex for the "data" in the mtk_iommu_domain. Just improve the safety for multi devices enter attach_device at the same time. We don't get the real issue for this. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-9-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 0e5a3f2e630b28e88e018655548212ef8eb4dfcb Author: Yong Wu Date: Tue May 3 15:13:58 2022 +0800 iommu/mediatek: Add mutex for m4u_group and m4u_dom in data Add a mutex to protect the data in the structure mtk_iommu_data, like ->"m4u_group" ->"m4u_dom". For the internal data, we should protect it in ourselves driver. Add a mutex for this. This could be a fix for the multi-groups support. Fixes: c3045f39244e ("iommu/mediatek: Support for multi domains") Signed-off-by: Yunfei Wang Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-8-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 98df772bdd1c4ce717a26289efea15cbbe4b64ed Author: Yong Wu Date: Tue May 3 15:13:57 2022 +0800 iommu/mediatek: Remove clk_disable in mtk_iommu_remove After the commit b34ea31fe013 ("iommu/mediatek: Always enable the clk on resume"), the iommu clock is controlled by the runtime callback. thus remove the clk control in the mtk_iommu_remove. Otherwise, it will warning like: echo 14018000.iommu > /sys/bus/platform/drivers/mtk-iommu/unbind [ 51.413044] ------------[ cut here ]------------ [ 51.413648] vpp0_smi_iommu already disabled [ 51.414233] WARNING: CPU: 2 PID: 157 at */v5.15-rc1/kernel/mediatek/ drivers/clk/clk.c:952 clk_core_disable+0xb0/0xb8 [ 51.417174] Hardware name: MT8195V/C(ENG) (DT) [ 51.418635] pc : clk_core_disable+0xb0/0xb8 [ 51.419177] lr : clk_core_disable+0xb0/0xb8 ... [ 51.429375] Call trace: [ 51.429694] clk_core_disable+0xb0/0xb8 [ 51.430193] clk_core_disable_lock+0x24/0x40 [ 51.430745] clk_disable+0x20/0x30 [ 51.431189] mtk_iommu_remove+0x58/0x118 [ 51.431705] platform_remove+0x28/0x60 [ 51.432197] device_release_driver_internal+0x110/0x1f0 [ 51.432873] device_driver_detach+0x18/0x28 [ 51.433418] unbind_store+0xd4/0x108 [ 51.433886] drv_attr_store+0x24/0x38 [ 51.434363] sysfs_kf_write+0x40/0x58 [ 51.434843] kernfs_fop_write_iter+0x164/0x1e0 Fixes: b34ea31fe013 ("iommu/mediatek: Always enable the clk on resume") Reported-by: Hsin-Yi Wang Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-7-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit ee55f75e4bcade81d253163641b63bef3e76cac4 Author: Yong Wu Date: Tue May 3 15:13:56 2022 +0800 iommu/mediatek: Add list_del in mtk_iommu_remove Lack the list_del in the mtk_iommu_remove, and remove bus_set_iommu(*, NULL) since there may be several iommu HWs. we can not bus_set_iommu null when one iommu driver unbind. This could be a fix for mt2712 which support 2 M4U HW and list them. Fixes: 7c3a2ec02806 ("iommu/mediatek: Merge 2 M4U HWs into one iommu domain") Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-6-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 645b87c190c959e9bb4f216b8c4add4ee880451a Author: Yong Wu Date: Tue May 3 15:13:55 2022 +0800 iommu/mediatek: Fix 2 HW sharing pgtable issue In the commit 4f956c97d26b ("iommu/mediatek: Move domain_finalise into attach_device"), I overlooked the sharing pgtable case. After that commit, the "data" in the mtk_iommu_domain_finalise always is the data of the current IOMMU HW. Fix this for the sharing pgtable case. Only affect mt2712 which is the only SoC that share pgtable currently. Fixes: 4f956c97d26b ("iommu/mediatek: Move domain_finalise into attach_device") Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-5-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 2d555a3844142b9e0f876925a8475cc830cd472a Author: Yong Wu Date: Tue May 3 15:13:54 2022 +0800 dt-bindings: mediatek: mt8186: Add binding for MM iommu Add mt8186 iommu binding. "-mm" means the iommu is for Multimedia. Signed-off-by: Yong Wu Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220503071427.2285-4-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit dc1d99342db705efbeec517f9c6187f3b93ab423 Author: Yong Wu Date: Tue May 3 15:13:53 2022 +0800 dt-bindings: mediatek: mt8195: Add binding for infra IOMMU In mt8195, we have a new IOMMU that is for INFRA IOMMU. its masters mainly are PCIe and USB. Different with MM IOMMU, all these masters connect with IOMMU directly, there is no mediatek,larbs property for infra IOMMU. Another thing is about PCIe ports. currently the function "of_iommu_configure_dev_id" only support the id number is 1, But our PCIe have two ports, one is for reading and the other is for writing. see more about the PCIe patch in this patchset. Thus, I only list the reading id here and add the other id in our driver. Signed-off-by: Yong Wu Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-3-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 6625ffb90f44efc28a3fe1432191a4eacb08c915 Author: Yong Wu Date: Tue May 3 15:13:52 2022 +0800 dt-bindings: mediatek: mt8195: Add binding for MM IOMMU This patch adds descriptions for mt8195 IOMMU which also use ARM Short-Descriptor translation table format. In mt8195, there are two smi-common HW and IOMMU, one is for vdo(video output), the other is for vpp(video processing pipe). They connects with different smi-larbs, then some setting(larbid_remap) is different. Differentiate them with the compatible string. Something like this: IOMMU(VDO) IOMMU(VPP) | | SMI_COMMON_VDO SMI_COMMON_VPP --------------- ---------------- | | ... | | ... larb0 larb2 ... larb1 larb3 ... Another change is that we have a new IOMMU that is for infra master like PCIe and USB. The infra master don't have the larb and ports, thus we rename the port header file to mt8195-memory-port.h rather than mt8195-larb-port.h. Also, the IOMMU is not only for MM, thus, we don't call it "m4u" which means "MultiMedia Memory Management UNIT". thus, use the "iommu" as the compatiable string. Signed-off-by: Yong Wu Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220503071427.2285-2-yong.wu@mediatek.com Signed-off-by: Joerg Roedel commit 4b88524c47d7bffd5aaabf918c7759c74a1c577b Merge: 672c0c5173427 2e29b9971ac54 Author: Marc Zyngier Date: Wed May 4 09:38:32 2022 +0100 Merge remote-tracking branch 'arm64/for-next/sme' into kvmarm-master/next Merge arm64's SME branch to resolve conflicts with the WFxT branch. Signed-off-by: Marc Zyngier commit 9ed1d7f510336e283c0bb2d20fd771e9d8fa085b Author: Vasant Hegde via iommu Date: Mon Mar 14 12:32:26 2022 +0530 iommu/amd: Remove redundant check smatch static checker warning: drivers/iommu/amd/init.c:1989 amd_iommu_init_pci() warn: duplicate check 'ret' (previous on line 1978) Reported-by: Dan Carpenter Fixes: 06687a03805e ("iommu/amd: Improve error handling for amd_iommu_init_pci") Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220314070226.40641-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 5edde870d3283edeaa27ab62ac4fac5ee8cae35a Author: Suravee Suthikulpanit Date: Sun Mar 13 21:43:21 2022 -0500 iommu/amd: Do not call sleep while holding spinlock Smatch static checker warns: drivers/iommu/amd/iommu_v2.c:133 free_device_state() warn: sleeping in atomic context Fixes by storing the list of struct device_state in a temporary list, and then free the memory after releasing the spinlock. Reported-by: Dan Carpenter Fixes: 9f968fc70d85 ("iommu/amd: Improve amd_iommu_v2_exit()") Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220314024321.37411-1-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit b26dafc8a9e74254a390e8f21ff028a2573ee4fc Author: Oliver Upton Date: Wed May 4 03:24:46 2022 +0000 selftests: KVM: Test SYSTEM_SUSPEND PSCI call Assert that the vCPU exits to userspace with KVM_SYSTEM_EVENT_SUSPEND if the guest calls PSCI SYSTEM_SUSPEND. Additionally, guarantee that the SMC32 and SMC64 flavors of this call are discoverable with the PSCI_FEATURES call. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-13-oupton@google.com commit 67a36a821312e9c0d2a2f7e6c2225204500cc01c Author: Oliver Upton Date: Wed May 4 03:24:45 2022 +0000 selftests: KVM: Refactor psci_test to make it amenable to new tests Split up the current test into several helpers that will be useful to subsequent test cases added to the PSCI test suite. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-12-oupton@google.com commit d135399a97cc3e27716a8e468a5fd1a209346831 Author: Oliver Upton Date: Wed May 4 03:24:44 2022 +0000 selftests: KVM: Use KVM_SET_MP_STATE to power off vCPU in psci_test Setting a vCPU's MP state to KVM_MP_STATE_STOPPED has the effect of powering off the vCPU. Rather than using the vCPU init feature flag, use the KVM_SET_MP_STATE ioctl to power off the target vCPU. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-11-oupton@google.com commit 694e3dcc47471b8b409a0ef647319b746eabcb3a Author: Oliver Upton Date: Wed May 4 03:24:43 2022 +0000 selftests: KVM: Create helper for making SMCCC calls The PSCI and PV stolen time tests both need to make SMCCC calls within the guest. Create a helper for making SMCCC calls and rework the existing tests to use the library function. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-10-oupton@google.com commit 6689fb8f21ecf5fd99278b622c9579ffbc2742c2 Author: Oliver Upton Date: Wed May 4 03:24:42 2022 +0000 selftests: KVM: Rename psci_cpu_on_test to psci_test There are other interactions with PSCI worth testing; rename the PSCI test to make it more generic. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-9-oupton@google.com commit bfbab44568779e1682bc6f63688bb9c965f0e74a Author: Oliver Upton Date: Wed May 4 03:24:41 2022 +0000 KVM: arm64: Implement PSCI SYSTEM_SUSPEND ARM DEN0022D.b 5.19 "SYSTEM_SUSPEND" describes a PSCI call that allows software to request that a system be placed in the deepest possible low-power state. Effectively, software can use this to suspend itself to RAM. Unfortunately, there really is no good way to implement a system-wide PSCI call in KVM. Any precondition checks done in the kernel will need to be repeated by userspace since there is no good way to protect a critical section that spans an exit to userspace. SYSTEM_RESET and SYSTEM_OFF are equally plagued by this issue, although no users have seemingly cared for the relatively long time these calls have been supported. The solution is to just make the whole implementation userspace's problem. Introduce a new system event, KVM_SYSTEM_EVENT_SUSPEND, that indicates to userspace a calling vCPU has invoked PSCI SYSTEM_SUSPEND. Additionally, add a CAP to get buy-in from userspace for this new exit type. Only advertise the SYSTEM_SUSPEND PSCI call if userspace has opted in. If a vCPU calls SYSTEM_SUSPEND, punt straight to userspace. Provide explicit documentation of userspace's responsibilites for the exit and point to the PSCI specification to describe the actual PSCI call. Reviewed-by: Reiji Watanabe Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-8-oupton@google.com commit 7b33a09d036ffd9a04506122840629c7e870cf08 Author: Oliver Upton Date: Wed May 4 03:24:40 2022 +0000 KVM: arm64: Add support for userspace to suspend a vCPU Introduce a new MP state, KVM_MP_STATE_SUSPENDED, which indicates a vCPU is in a suspended state. In the suspended state the vCPU will block until a wakeup event (pending interrupt) is recognized. Add a new system event type, KVM_SYSTEM_EVENT_WAKEUP, to indicate to userspace that KVM has recognized one such wakeup event. It is the responsibility of userspace to then make the vCPU runnable, or leave it suspended until the next wakeup event. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-7-oupton@google.com commit 3fdd04592d38bb31a0bea567d9a66672b484bed3 Author: Oliver Upton Date: Wed May 4 03:24:39 2022 +0000 KVM: arm64: Return a value from check_vcpu_requests() A subsequent change to KVM will introduce a vCPU request that could result in an exit to userspace. Change check_vcpu_requests() to return a value and document the function. Unconditionally return 1 for now. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-6-oupton@google.com commit 1c6219e3faf12e58d520b3b2cdfa8cd5e1efc9a5 Author: Oliver Upton Date: Wed May 4 03:24:38 2022 +0000 KVM: arm64: Rename the KVM_REQ_SLEEP handler The naming of the kvm_req_sleep function is confusing: the function itself sleeps the vCPU, it does not request such an event. Rename the function to make its purpose more clear. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-5-oupton@google.com commit b171f9bbb130cb323f2101edd32da2a25d43ebfa Author: Oliver Upton Date: Wed May 4 03:24:37 2022 +0000 KVM: arm64: Track vCPU power state using MP state values A subsequent change to KVM will add support for additional power states. Store the MP state by value rather than keeping track of it as a boolean. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-4-oupton@google.com commit 1e5794295c5dbfcc31cf5de840c9e095ae50efb7 Author: Oliver Upton Date: Wed May 4 03:24:36 2022 +0000 KVM: arm64: Dedupe vCPU power off helpers vcpu_power_off() and kvm_psci_vcpu_off() are equivalent; rename the former and replace all callsites to the latter. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-3-oupton@google.com commit 5bc2cb95ad03d866422d7b3f19ec42a6720f3262 Author: Oliver Upton Date: Wed May 4 03:24:35 2022 +0000 KVM: arm64: Don't depend on fallthrough to hide SYSTEM_RESET2 Depending on a fallthrough to the default case for hiding SYSTEM_RESET2 requires that any new case statements clean up the failure path for this PSCI call. Unhitch SYSTEM_RESET2 from the default case by setting val to PSCI_RET_NOT_SUPPORTED outside of the switch statement. Apply the cleanup to both the PSCI_1_1_FN_SYSTEM_RESET2 and PSCI_1_0_FN_PSCI_FEATURES handlers. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220504032446.4133305-2-oupton@google.com commit 8dba791a7280542bc125b68b3547bfa2680bc1af Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:58 2022 +0200 arm64: dts: broadcom: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-6-krzysztof.kozlowski@linaro.org commit a93fbb002310ef04fce504dbf1510f6eb8265188 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:56 2022 +0200 arm64: dts: stratix10/agilex: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-4-krzysztof.kozlowski@linaro.org commit 361736cf495ccc49df5ae66d0f9f10a55976d2da Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:55 2022 +0200 ARM: dts: socfpga: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-3-krzysztof.kozlowski@linaro.org commit 0501eeca5aedab16a0dc4fd25135eb18d9408f80 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:54 2022 +0200 ARM: dts: zynq-7000: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220430121902.59895-2-krzysztof.kozlowski@linaro.org commit d414b7a3f370d640cff544a3aa3a41abf34fd5d6 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:19:00 2022 +0200 ARM: dts: exynos: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-8-krzysztof.kozlowski@linaro.org commit d0b05d3820fa1b688b192699017f95f8a565523b Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:59 2022 +0200 ARM: dts: s5pv210: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-7-krzysztof.kozlowski@linaro.org commit 6745dbc73112819529d776275b4e76dae5c12680 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:19:02 2022 +0200 arm64: dts: fsd: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-10-krzysztof.kozlowski@linaro.org commit 03e1d34d27a5e8065c5ef691648ee8a519e3c1b0 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:19:01 2022 +0200 arm64: dts: exynos: drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Reported-by: Rob Herring Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220430121902.59895-9-krzysztof.kozlowski@linaro.org commit f223095c6e1d20aac831e75016b58ca8adbbf122 Author: Krzysztof Kozlowski Date: Tue May 3 11:26:31 2022 +0200 arm64: dts: exynos: move XTCXO clock frequency to board in Exynos Auto v9 The external oscillator - XTCXO - is an input to the SoC. It is defined in the Exynos Auto v9 SoC DTSI, because all boards will provide it and clock controller bindings expect it, however the actual frequency of the clock should be determined by the board. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Chanho Park Link: https://lore.kernel.org/r/20220503092631.174713-1-krzysztof.kozlowski@linaro.org commit 97f7d384ac4fcadfc0fb83519be23ccd59b4250b Author: Leo Yan Date: Wed May 4 10:46:18 2022 +0300 interconnect: qcom: icc-rpm: Cache every clock rate The cached clock rate is used for all bus clocks, thus it has the assumption that all interconnect clock rates are always same, this causes trouble if we want to set different clock rates separately. This patch is to allocate a clock rate array to cache every clock rate. Signed-off-by: Leo Yan Link: https://lore.kernel.org/r/20220416031029.693211-3-leo.yan@linaro.org Signed-off-by: Georgi Djakov commit 65fac3b3493f74eed6a7dcbc1835c1549b70f167 Author: Leo Yan Date: Wed May 4 10:46:18 2022 +0300 interconnect: qcom: icc-rpm: Fix for cached clock rate All nodes within an interconnect bus share interconnect bus clocks, but every node has its own cached clock rate values, this can lead to unexpected clock rate setting. Let's see an example shown in below, in this case, a bus have two nodes A and B, and its buswidth is 8: step1: vote bandwidth 1600M for node(A): aggregated(bw) = 1600M qcom_icc_node(A)->rate = 1600M / 8 = 200MHz step2: vote bandwidth 1600M for node(B): aggregated(bw) = 1600M + 1600M = 3200M qcom_icc_node(B)->rate = 3200M / 8 = 400MHz step3: unvote bandwidth 1600M for node(A) aggregated(bw) = 3200M - 1600M = 1600M target_clock = 1600M / 8 = 200MHz The problem is in step 3, the calculated target clock rate is 200MHz, which equals to the cached clock rate in node(A) (See step 1), unfortunately, qcom_icc_set() skips to set the new clock rate 200MHz in this case, so the bus clock rate will continue to stay at 400MHz. To resolve the issue, one possible solution is to invoke clk_get_rate() to retrieve the clock rates on the fly, thus we can totally remove the cached clock rates. But after review the code, many bus clock has set the flag CLK_GET_RATE_NOCACHE, this results in the retrieving bus clock rate is time cost for iterating parent clock nodes, and even challenges bus clock drivers to provide recalc_rate() callbacks. So this patch moves the cached rates into structure qcom_icc_provider, we use it as a central place to maintain bus clock handlers and cached clock rate, therefore, it can smoothly dismiss the mismatching problem. Signed-off-by: Leo Yan Link: https://lore.kernel.org/r/20220416031029.693211-2-leo.yan@linaro.org Signed-off-by: Georgi Djakov commit 24e2d05d1b68981f22c984c766fabc5a93c83dba Author: Bjorn Andersson Date: Thu Mar 3 13:43:00 2022 -0800 leds: Add driver for Qualcomm LPG The Light Pulse Generator (LPG) is a PWM-block found in a wide range of PMICs from Qualcomm. These PMICs typically comes with 1-8 LPG instances, with their output being routed to various other components, such as current sinks or GPIOs. Each LPG instance can operate on fixed parameters or based on a shared lookup-table, altering the duty cycle over time. This provides the means for hardware assisted transitions of LED brightness. A typical use case for the fixed parameter mode is to drive a PWM backlight control signal, the driver therefor allows each LPG instance to be exposed to the kernel either through the LED framework or the PWM framework. A typical use case for the LED configuration is to drive RGB LEDs in smartphones etc, for which the driver supports multiple channels to be ganged up to a MULTICOLOR LED. In this configuration the pattern generators will be synchronized, to allow for multi-color patterns. The idea of modelling this as a LED driver ontop of a PWM driver was considered, but setting the properties related to patterns does not fit in the PWM API. Similarly the idea of just duplicating the lower bits in a PWM and LED driver separately was considered, but this would not allow the PWM channels and LEDs to be configured on a per-board basis. The driver implements the more complex LED interface, and provides a PWM interface on the side of that, in the same driver. Signed-off-by: Bjorn Andersson Tested-by: Douglas Anderson Tested-by: Luca Weiss Reviewed-by: Marijn Suijten Tested-by: Marijn Suijten [On the Sony Xperia Nile Discovery, SDM630] Signed-off-by: Pavel Machek commit a8e53db46f19f67be6a26488aafb7d10c78e33bd Author: Bjorn Andersson Date: Thu Mar 3 13:42:59 2022 -0800 dt-bindings: leds: Add Qualcomm Light Pulse Generator binding This adds the binding document describing the three hardware blocks related to the Light Pulse Generator found in a wide range of Qualcomm PMICs. Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Rob Herring Reviewed-by: Marijn Suijten Signed-off-by: Pavel Machek commit ee87a9bd657e89fe7763cb79cfe1b6bb2d0b0623 Author: Marc Zyngier Date: Wed May 4 08:01:05 2022 +0100 KVM: arm64: Fix new instances of 32bit ESRs Fix the new instances of ESR being described as a u32, now that we consistently are using a u64 for this register. Signed-off-by: Marc Zyngier commit 656d33890732978919f79bdbc96921dfca6f28bb Author: Leon Romanovsky Date: Tue Apr 5 19:33:39 2022 +0300 net/mlx5: Allow future addition of IPsec object modifiers Currently, all released FW versions support only two IPsec object modifiers, and modify_field_select get and set same value with proper bits. However, it is not future compatible, as new FW can have more modifiers and "default" will cause to overwrite not-changed fields. Fix it by setting explicitly fields that need to be overwritten. Fixes: 7ed92f97a1ad ("net/mlx5e: IPsec: Add Connect-X IPsec ESN update offload support") Signed-off-by: Huy Nguyen Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit bd24d1ffb445fc74679c3d9725c8b891f0739231 Author: Leon Romanovsky Date: Wed Apr 6 14:53:13 2022 +0300 net/mlx5: Don't perform lookup after already known sec_path There is no need to perform extra lookup in order to get already known sec_path that was set a couple of lines above. Simply reuse it. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 6cd2126ac602305f52e43666400b135b20b46b07 Author: Leon Romanovsky Date: Mon Mar 28 12:06:21 2022 +0300 net/mlx5: Cleanup XFRM attributes struct Remove everything that is not used or from mlx5_accel_esp_xfrm_attrs, together with change type of spi to store proper type from the beginning. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 1c4a59b9fa98c222bd6a8fa82bff942312165c1a Author: Leon Romanovsky Date: Sun Mar 27 19:23:19 2022 +0300 net/mlx5: Remove not-supported ICV length mlx5 doesn't allow to configure any AEAD ICV length other than 128, so remove the logic that configures other unsupported values. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit effbe2675165515e47e45aa26d70c3caedc9f6bc Author: Leon Romanovsky Date: Sun Mar 20 16:07:14 2022 +0200 net/mlx5: Simplify IPsec capabilities logic Reduce number of hard-coded IPsec capabilities by making sure that mlx5_ipsec_device_caps() sets only supported bits. As part of this change, remove _ACCEL_ notations from the capabilities names as they represent IPsec-capable device, so it is aligned with MLX5_CAP_IPSEC() macro. And prepare the code to IPsec full offload mode. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit a8444b0bdd1ae9c437fe6d3ef44f1ba4721c4329 Author: Leon Romanovsky Date: Sun Mar 20 15:50:16 2022 +0200 net/mlx5: Don't advertise IPsec netdev support for non-IPsec device Device that lacks proper IPsec capabilities won't pass mlx5e_ipsec_init() later, so no need to advertise HW netdev offload support for something that isn't going to work anyway. Fixes: 8ad893e516a7 ("net/mlx5e: Remove dependency in IPsec initialization flows") Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit b7242ffc562ccf26121c85beb58e9ad40157b6fe Author: Leon Romanovsky Date: Thu Mar 10 20:48:03 2022 +0200 net/mlx5: Make sure that no dangling IPsec FS pointers exist The IPsec FS code was implemented with anti-pattern there failures in create functions left the system with dangling pointers that were cleaned in global routines. The less error prone approach is to make sure that failed function cleans everything internally. As part of this change, we remove the batch of one liners and rewrite get/put functions to remove ambiguity. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 82f7bdba377578e09935bff59157f7361ec6919c Author: Leon Romanovsky Date: Thu Mar 10 16:07:58 2022 +0200 net/mlx5: Clean IPsec FS add/delete rules Reuse existing struct to pass parameters instead of open code them. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit b73e67287b80519bef0217637028d1a49456baac Author: Leon Romanovsky Date: Wed Mar 9 22:14:26 2022 +0200 net/mlx5: Simplify HW context interfaces by using SA entry SA context logic used multiple structures to store same data over and over. By simplifying the SA context interfaces, we can remove extra structs. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit a534e24d720f02395367e65af1285dc1ee3cf406 Author: Leon Romanovsky Date: Wed Mar 9 11:11:31 2022 +0200 net/mlx5: Remove indirections from esp functions This change cleanups the mlx5 esp interface. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit c6e3b421c7079af67201351c9faff62613e06f40 Author: Leon Romanovsky Date: Wed Mar 9 10:35:05 2022 +0200 net/mlx5: Merge various control path IPsec headers into one file The mlx5 IPsec code has logical separation between code that operates with XFRM objects (ipsec.c), HW objects (ipsec_offload.c), flow steering logic (ipsec_fs.c) and data path (ipsec_rxtx.c). Such separation makes sense for C-files, but isn't needed at all for H-files as they are included in batch anyway. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 2ea36e2e4ad2b77bd5d45142a529b72eb5ca9156 Author: Leon Romanovsky Date: Tue Mar 8 20:55:00 2022 +0200 net/mlx5: Remove useless validity check All callers build xfrm attributes with help of mlx5e_ipsec_build_accel_xfrm_attrs() function that ensure validity of attributes. There is no need to recheck them again. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit c674df973ad8af2074c834788e167332d81309fa Author: Leon Romanovsky Date: Tue Mar 8 20:36:15 2022 +0200 net/mlx5: Store IPsec ESN update work in XFRM state mlx5 IPsec code updated ESN through workqueue with allocation calls in the data path, which can be saved easily if the work is created during XFRM state initialization routine. The locking used later in the work didn't protect from anything because change of HW context is possible during XFRM state add or delete only, which can cancel work and make sure that it is not running. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit a05a54694e409e8b1a3f0219a24d919cd9e445f3 Author: Leon Romanovsky Date: Wed Mar 2 11:42:52 2022 +0200 net/mlx5: Reduce useless indirection in IPsec FS add/delete flows There is no need in one-liners wrappers to call internal functions. Let's remove them. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 021a429bdbde93be504adcea79a81a3f19349483 Author: Leon Romanovsky Date: Tue Mar 1 11:55:25 2022 +0200 net/mlx5: Don't hide fallback to software IPsec in FS code The XFRM code performs fallback to software IPsec if .xdo_dev_state_add() returns -EOPNOTSUPP. This is what mlx5 did very deep in its stack trace, despite have all the knowledge that IPsec is not going to work in very early stage. This is achieved by making sure that priv->ipsec pointer is valid for fully working and supported hardware crypto IPsec engine. In case, the hardware IPsec is not supported, the XFRM code will set NULL to xso->dev and it will prevent from calls to various .xdo_dev_state_*() callbacks. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 9af1968ee13b33b0bff7def9c4861f1730389a7b Author: Leon Romanovsky Date: Sun Mar 6 15:21:22 2022 +0200 net/mlx5: Check IPsec TX flow steering namespace in advance Ensure that flow steering is usable as early as possible, to understand if crypto IPsec is supported or not. Reviewed-by: Raed Salem Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 301e0be800be425c5fa4f384f9f0e9b23109f809 Author: Leon Romanovsky Date: Sun Mar 6 14:41:38 2022 +0200 net/mlx5: Simplify IPsec flow steering init/cleanup functions Remove multiple function wrappers to make sure that IPsec FS initialization and cleanup functions present in one place to help with code readability. Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit f9eec4947add999e1251bf14365a48a655b786a4 Author: Manikanta Pubbisetty Date: Wed May 4 07:34:15 2022 +0300 ath11k: Add support for targets without trustzone Add the support to attach WCN6750 and map iommu domain for targets which do not have the support of TrustZone. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328062032.28881-1-quic_mpubbise@quicinc.com commit 7ba49f4c6896d83b3841c0b046a0a7b1e97cc0dd Author: Ping-Ke Shih Date: Tue May 3 20:00:01 2022 +0800 rtw89: 8852c: add 8852ce to Makefile and Kconfig This initial vesion is usable now. It can support STA, AP and monitor modes, so we can add 8852ce to Kconfig and Makefile. We are still working on some features, such as deep power save, and BT coexistence. But, this version still can have a good WiFi-only performance already, and will continue to fine tune power consumption. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-9-pkshih@realtek.com commit 68bf56e3b020e913c20276576317f9df9fa02fa7 Author: Ping-Ke Shih Date: Tue May 3 20:00:00 2022 +0800 rtw89: 8852c: fix warning of FIELD_PREP() mask type To fix the compiler warning of clang with i386 config, but not complain by gcc: __write_ctrl(R_AX_PWR_RATE_CTRL, B_AX_FORCE_PWR_BY_RATE_VALUE_MASK, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw89/rtw8852c.c:2621:13: note: expanded from macro '__write_ctrl' u32 _wrt = FIELD_PREP(__msk, _val); \ ^~~~~~~~~~~~~~~~~~~~~~~ include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PREP' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bitfield.h:71:53: note: expanded from macro '__BF_FIELD_CHECK' BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all) include/linux/compiler_types.h:352:22: note: expanded from macro 'compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler_types.h:340:23: note: expanded from macro '_compiletime_assert' __compiletime_assert(condition, msg, prefix, suffix) ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler_types.h:332:9: note: expanded from macro '__compiletime_assert' if (!(condition)) \ ^~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-8-pkshih@realtek.com commit 55cf5b7e2d970d2252df67141b203758f0f16ed8 Author: Ping-Ke Shih Date: Tue May 3 19:59:59 2022 +0800 rtw89: 8852c: correct register definitions used by 8852c First one could affect SER because of false alarm event. Second one can affect spur elimination. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-7-pkshih@realtek.com commit 62440fbefad1e2a412a99b1a662d50daec422296 Author: Ping-Ke Shih Date: Tue May 3 19:59:58 2022 +0800 rtw89: correct AID settings of beamformee Without this fix, it would cause IOT issue due to AID mismatch. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-6-pkshih@realtek.com commit 39a7652103ff5f052b5eff944a1ed3d607f747f7 Author: Ping-Ke Shih Date: Tue May 3 19:59:57 2022 +0800 rtw89: ps: fine tune polling interval while changing low power mode By experiments, it spends ~45/1090~2480us to enter/leave low power mode, so the old polling interval 1000us can waste time. Use smaller polling interval depends on experimental results to reduce the time to transition state. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-5-pkshih@realtek.com commit 78af3cc673567c0978a8d4d610e5b8e88b01717c Author: Ping-Ke Shih Date: Tue May 3 19:59:56 2022 +0800 rtw89: 8852c: add basic and remaining chip_info The chip_info include BT coexistence tables, size and number of hardware components, and supported functions. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-4-pkshih@realtek.com commit e212d5d48d8593bdff076e5b9412c0152a58196e Author: Ping-Ke Shih Date: Tue May 3 19:59:55 2022 +0800 rtw89: 8852c: add chip_ops::bb_ctrl_btc_preagc Add to configure BT share RX path and related settings. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-3-pkshih@realtek.com commit 5309cd5ec9b46c893ac65618ce0507e53ca68347 Author: Ping-Ke Shih Date: Tue May 3 19:59:54 2022 +0800 rtw89: 8852c: rfk: get calibrated channels to notify firmware The commit 16b44ed0ffd3 ("rtw89: add RF H2C to notify firmware") is to add firmware command, and this commit is to prepare the channels. Then, firmware can get proper channels. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220503120001.79272-2-pkshih@realtek.com commit eeff214dbfcb96bafbf83607925f35795d62a7aa Author: Tetsuo Handa Date: Mon May 2 17:16:06 2022 +0900 wfx: avoid flush_workqueue(system_highpri_wq) usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_highpri_wq with per "struct wfx_dev" bh_wq. Signed-off-by: Tetsuo Handa Acked-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/f15574a6-aba4-72bc-73af-26fdcdf9fb63@I-love.SAKURA.ne.jp commit fd920008784ead369e79c2be2f8d9cc736e306ca Author: Allison Henderson Date: Wed May 4 12:41:02 2022 +1000 xfs: Set up infrastructure for log attribute replay Currently attributes are modified directly across one or more transactions. But they are not logged or replayed in the event of an error. The goal of log attr replay is to enable logging and replaying of attribute operations using the existing delayed operations infrastructure. This will later enable the attributes to become part of larger multi part operations that also must first be recorded to the log. This is mostly of interest in the scheme of parent pointers which would need to maintain an attribute containing parent inode information any time an inode is moved, created, or removed. Parent pointers would then be of interest to any feature that would need to quickly derive an inode path from the mount point. Online scrub, nfs lookups and fs grow or shrink operations are all features that could take advantage of this. This patch adds two new log item types for setting or removing attributes as deferred operations. The xfs_attri_log_item will log an intent to set or remove an attribute. The corresponding xfs_attrd_log_item holds a reference to the xfs_attri_log_item and is freed once the transaction is done. Both log items use a generic xfs_attr_log_format structure that contains the attribute name, value, flags, inode, and an op_flag that indicates if the operations is a set or remove. [dchinner: added extra little bits needed for intent whiteouts] Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 9a39cdabc172ef2de3f21a34e73cdc1d02338d79 Author: Allison Henderson Date: Wed May 4 12:40:02 2022 +1000 xfs: Return from xfs_attr_set_iter if there are no more rmtblks to process During an attr rename operation, blocks are saved for later removal as rmtblkno2. The rmtblkno is used in the case of needing to alloc more blocks if not enough were available. However, in the case that no further blocks need to be added or removed, we can return as soon as xfs_attr_node_addname completes, rather than rolling the transaction with an -EAGAIN return. This extra loop does not hurt anything right now, but it will be a problem later when we get into log items because we end up with an empty log transaction. So, add a simple check to cut out the unneeded iteration. Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 7b3ec2b20e44f579c022ad62243aa18c04c6addc Author: Allison Henderson Date: Wed May 4 12:39:02 2022 +1000 xfs: Fix double unlock in defer capture code The new deferred attr patch set uncovered a double unlock in the recent port of the defer ops capture and continue code. During log recovery, we're allowed to hold buffers to a transaction that's being used to replay an intent item. When we capture the resources as part of scheduling a continuation of an intent chain, we call xfs_buf_hold to retain our reference to the buffer beyond the transaction commit, but we do /not/ call xfs_trans_bhold to maintain the buffer lock. This means that xfs_defer_ops_continue needs to relock the buffers before xfs_defer_restore_resources joins then tothe new transaction. Additionally, the buffers should not be passed back via the dres structure since they need to remain locked unlike the inodes. So simply set dr_bufs to zero after populating the dres structure. Signed-off-by: Darrick J. Wong Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 86810a9ebd9e69498524c57a83f1271ade56ded8 Merge: 166afc45ed552 f0f5f658065a5 Author: Dave Chinner Date: Wed May 4 12:38:02 2022 +1000 Merge branch 'guilt/xfs-5.19-fuzz-fixes' into xfs-5.19-for-next commit 166afc45ed5523298541fd0297f9ad585cc2708c Merge: 956f1b8f80b5d 6ed7e509d2304 Author: Dave Chinner Date: Wed May 4 12:37:40 2022 +1000 Merge tag 'reflink-speedups-5.19_2022-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-5.19-for-next xfs: fix reflink inefficiencies As Dave Chinner has complained about on IRC, there are a couple of things about reflink that are very inefficient. First of all, we limited the size of all bunmapi operations to avoid flooding the log with defer ops in the worst case, but recent changes to the defer ops code have solved that problem, so get rid of the bunmapi length clamp. Second, the log reservations for reflink operations are far far larger than they need to be. Shrink them to exactly what we need to handle each deferred RUI and CUI log item, and no more. Also reduce logcount because we don't need 8 rolls per operation. Introduce a transaction reservation compatibility layer to avoid changing the minimum log size calculations. Signed-off-by: Dave Chinner commit 956f1b8f80b5d34394950269fcf7286122b9a3a9 Merge: 5e116e99dc94c 1edf8056131ac Author: Dave Chinner Date: Wed May 4 12:37:18 2022 +1000 Merge tag 'rmap-speedups-5.19_2022-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-5.19-for-next xfs: fix rmap inefficiencies Reduce the performance impact of the reverse mapping btree when reflink is enabled by using the much faster non-overlapped btree lookup functions when we're searching the rmap index with a fully specified key. If we find the exact record we're looking for, great! We don't have to perform the full overlapped scan. For filesystems with high sharing factors this reduces the xfs_scrub runtime by a good 15%%. This has been shown to reduce the fstests runtime for realtime rmap configurations by 30%%, since the lack of AGs severely limits scalability. Signed-off-by: Dave Chinner commit 5e116e99dc94c84650a94aaf51d0c5bca3702352 Merge: 9cf4f6160c20b 0d227466be843 Author: Dave Chinner Date: Wed May 4 12:37:02 2022 +1000 Merge branch 'guilt/xlog-intent-whiteouts' into xfs-5.19-for-next commit 9cf4f6160c20bbdb53f20a773d48ab6dfa3b49e3 Merge: a44a027a8b2a2 bc37e4fb5cac2 Author: Dave Chinner Date: Wed May 4 12:36:54 2022 +1000 Merge branch 'guilt/xfs-5.19-misc-2' into xfs-5.19-for-next commit f0f5f658065a5af09126ec892e4c383540a1c77f Author: Dave Chinner Date: Wed May 4 12:17:18 2022 +1000 xfs: validate v5 feature fields We don't check that the v4 feature flags taht v5 requires to be set are actually set anywhere. Do this check when we see that the filesystem is a v5 filesystem. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit dd0d2f9755191690541b09e6385d0f8cd8bc9d8f Author: Dave Chinner Date: Wed May 4 12:14:13 2022 +1000 xfs: set XFS_FEAT_NLINK correctly While xfs_has_nlink() is not used in kernel, it is used in userspace (e.g. by xfs_db) so we need to set the XFS_FEAT_NLINK flag correctly in xfs_sb_version_to_features(). Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 1eb70f54c445fcbb25817841e774adb3d912f3e8 Author: Dave Chinner Date: Wed May 4 12:13:53 2022 +1000 xfs: validate inode fork size against fork format xfs_repair catches fork size/format mismatches, but the in-kernel verifier doesn't, leading to null pointer failures when attempting to perform operations on the fork. This can occur in the xfs_dir_is_empty() where the in-memory fork format does not match the size and so the fork data pointer is accessed incorrectly. Note: this causes new failures in xfs/348 which is testing mode vs ftype mismatches. We now detect a regular file that has been changed to a directory or symlink mode as being corrupt because the data fork is for a symlink or directory should be in local form when there are only 3 bytes of data in the data fork. Hence the inode verify for the regular file now fires w/ -EFSCORRUPTED because the inode fork format does not match the format the corrupted mode says it should be in. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit dc04db2aa7c9307e740d6d0e173085301c173b1a Author: Dave Chinner Date: Wed May 4 12:13:35 2022 +1000 xfs: detect self referencing btree sibling pointers To catch the obvious graph cycle problem and hence potential endless looping. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 0d227466be84332d1888724e1e74dac34bff6d71 Author: Dave Chinner Date: Wed May 4 11:50:29 2022 +1000 xfs: intent item whiteouts When we log modifications based on intents, we add both intent and intent done items to the modification being made. These get written to the log to ensure that the operation is re-run if the intent done is not found in the log. However, for operations that complete wholly within a single checkpoint, the change in the checkpoint is atomic and will never need replay. In this case, we don't need to actually write the intent and intent done items to the journal because log recovery will never need to manually restart this modification. Log recovery currently handles intent/intent done matching by inserting the intent into the AIL, then removing it when a matching intent done item is found. Hence for all the intent-based operations that complete within a checkpoint, we spend all that time parsing the intent/intent done items just to cancel them and do nothing with them. Hence it follows that the only time we actually need intents in the log is when the modification crosses checkpoint boundaries in the log and so may only be partially complete in the journal. Hence if we commit and intent done item to the CIL and the intent item is in the same checkpoint, we don't actually have to write them to the journal because log recovery will always cancel the intents. We've never really worried about the overhead of logging intents unnecessarily like this because the intents we log are generally very much smaller than the change being made. e.g. freeing an extent involves modifying at lease two freespace btree blocks and the AGF, so the EFI/EFD overhead is only a small increase in space and processing time compared to the overall cost of freeing an extent. However, delayed attributes change this cost equation dramatically, especially for inline attributes. In the case of adding an inline attribute, we only log the inode core and attribute fork at present. With delayed attributes, we now log the attr intent which includes the name and value, the inode core adn attr fork, and finally the attr intent done item. We increase the number of items we log from 1 to 3, and the number of log vectors (regions) goes up from 3 to 7. Hence we tripple the number of objects that the CIL has to process, and more than double the number of log vectors that need to be written to the journal. At scale, this means delayed attributes cause a non-pipelined CIL to become CPU bound processing all the extra items, resulting in a > 40% performance degradation on 16-way file+xattr create worklaods. Pipelining the CIL (as per 5.15) reduces the performance degradation to 20%, but now the limitation is the rate at which the log items can be written to the iclogs and iclogs be dispatched for IO and completed. Even log IO completion is slowed down by these intents, because it now has to process 3x the number of items in the checkpoint. Processing completed intents is especially inefficient here, because we first insert the intent into the AIL, then remove it from the AIL when the intent done is processed. IOWs, we are also doing expensive operations in log IO completion we could completely avoid if we didn't log completed intent/intent done pairs. Enter log item whiteouts. When an intent done is committed, we can check to see if the associated intent is in the same checkpoint as we are currently committing the intent done to. If so, we can mark the intent log item with a whiteout and immediately free the intent done item rather than committing it to the CIL. We can basically skip the entire formatting and CIL insertion steps for the intent done item. However, we cannot remove the intent item from the CIL at this point because the unlocked per-cpu CIL item lists do not permit removal without holding the CIL context lock exclusively. Transaction commit only holds the context lock shared, hence the best we can do is mark the intent item with a whiteout so that the CIL push can release it rather than writing it to the log. This means we never write the intent to the log if the intent done has also been committed to the same checkpoint, but we'll always write the intent if the intent done has not been committed or has been committed to a different checkpoint. This will result in correct log recovery behaviour in all cases, without the overhead of logging unnecessary intents. This intent whiteout concept is generic - we can apply it to all intent/intent done pairs that have a direct 1:1 relationship. The way deferred ops iterate and relog intents mean that all intents currently have a 1:1 relationship with their done intent, and hence we can apply this cancellation to all existing intent/intent done implementations. For delayed attributes with a 16-way 64kB xattr create workload, whiteouts reduce the amount of journalled metadata from ~2.5GB/s down to ~600MB/s and improve the creation rate from 9000/s to 14000/s. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit 3512fc1e84c3ab58fa08466c2f75ae973fc472d1 Author: Dave Chinner Date: Wed May 4 11:46:47 2022 +1000 xfs: whiteouts release intents that are not in the AIL When we release an intent that a whiteout applies to, it will not have been committed to the journal and so won't be in the AIL. Hence when we drop the last reference to the intent, we do not want to try to remove it from the AIL as that will trigger a filesystem shutdown. Hence make the removal of intents from the AIL conditional on them actually being in the AIL so we do the correct thing. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit c23ab603e3d6557bd15e672fdbcbba4b28d08921 Author: Dave Chinner Date: Wed May 4 11:46:39 2022 +1000 xfs: add log item method to return related intents To apply a whiteout to an intent item when an intent done item is committed, we need to be able to retrieve the intent item from the the intent done item. Add a log item op method for doing this, and wire all the intent done items up to it. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit 22b1afc57e42da13f840d630ad484d4d99504839 Author: Dave Chinner Date: Wed May 4 11:46:30 2022 +1000 xfs: factor and move some code in xfs_log_cil.c In preparation for adding support for intent item whiteouts. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit bb7b1c9c5dd3d24db3f296e365570fd50c8ca80c Author: Dave Chinner Date: Wed May 4 11:46:21 2022 +1000 xfs: tag transactions that contain intent done items Intent whiteouts will require extra work to be done during transaction commit if the transaction contains an intent done item. To determine if a transaction contains an intent done item, we want to avoid having to walk all the items in the transaction to check if they are intent done items. Hence when we add an intent done item to a transaction, tag the transaction to indicate that it contains such an item. We don't tag the transaction when the defer ops is relogging an intent to move it forward in the log. Whiteouts will never apply to these cases, so we don't need to bother looking for them. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit f5b81200b6c166f78b73b3e2ca3e8f0c34c9daaf Author: Dave Chinner Date: Wed May 4 11:46:09 2022 +1000 xfs: add log item flags to indicate intents We currently have a couple of helper functions that try to infer whether the log item is an intent or intent done item from the combinations of operations it supports. This is incredibly fragile and not very efficient as it requires checking specific combinations of ops. We need to be able to identify intent and intent done items quickly and easily in upcoming patches, so simply add intent and intent done type flags to the log item ops flags. These are static flags to begin with, so intent items should have been typed like this from the start. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 5ddd658ea878f8dbae5ec33dba6cfdabb5056916 Author: Dave Chinner Date: Wed May 4 11:46:00 2022 +1000 xfs: don't commit the first deferred transaction without intents If the first operation in a string of defer ops has no intents, then there is no reason to commit it before running the first call to xfs_defer_finish_one(). This allows the defer ops to be used effectively for non-intent based operations without requiring an unnecessary extra transaction commit when first called. This fixes a regression in per-attribute modification transaction count when delayed attributes are not being used. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit b2c28035cea290edbcec697504e5b7a4b1e023e7 Author: Dave Chinner Date: Wed May 4 11:45:50 2022 +1000 xfs: hide log iovec alignment constraints Callers currently have to round out the size of buffers to match the aligment constraints of log iovecs and xlog_write(). They should not need to know this detail, so introduce a new function to calculate the iovec length (for use in ->iop_size implementations). Also modify xlog_finish_iovec() to round up the length to the correct alignment so the callers don't need to do this, either. Convert the only user - inode forks - of this alignment rounding to use the new interface. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit c230a4a85bcdbfc1a7415deec6caf04e8fca1301 Author: Dave Chinner Date: Wed May 4 11:45:11 2022 +1000 xfs: fix potential log item leak Ever since we added shadown format buffers to the log items, log items need to handle the item being released with shadow buffers attached. Due to the fact this requirement was added at the same time we added new rmap/reflink intents, we missed the cleanup of those items. In theory, this means shadow buffers can be leaked in a very small window when a shutdown is initiated. Testing with KASAN shows this leak does not happen in practice - we haven't identified a single leak in several years of shutdown testing since ~v4.8 kernels. However, the intent whiteout cleanup mechanism results in every cancelled intent in exactly the same state as this tiny race window creates and so if intents down clean up shadow buffers on final release we will leak the shadow buffer for just about every intent we create. Hence we start with this patch to close this condition off and ensure that when whiteouts start to be used we don't leak lots of memory. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit cb512c921639613ce03f87e62c5e93ed9fe8c84d Author: Dave Chinner Date: Wed May 4 11:44:55 2022 +1000 xfs: zero inode fork buffer at allocation When we first allocate or resize an inline inode fork, we round up the allocation to 4 byte alingment to make journal alignment constraints. We don't clear the unused bytes, so we can copy up to three uninitialised bytes into the journal. Zero those bytes so we only ever copy zeros into the journal. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Dave Chinner commit f43f0cd2d9b07caf38d744701b0b54d4244da8cc Merge: 58caed3dacb43 f39af96d352dd Author: Jakub Kicinski Date: Tue May 3 17:27:49 2022 -0700 Merge tag 'wireless-next-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v5.19 First set of patches for v5.19 and this is a big one. We have two new drivers, a change in mac80211 STA API affecting most drivers and ath11k getting support for WCN6750. And as usual lots of fixes and cleanups all over. Major changes: new drivers - wfx: silicon labs devices - plfxlc: pureLiFi X, XL, XC devices mac80211 - host based BSS color collision detection - prepare sta handling for IEEE 802.11be Multi-Link Operation (MLO) support rtw88 - support TP-Link T2E devices rtw89 - support firmware crash simulation - preparation for 8852ce hardware support ath11k - Wake-on-WLAN support for QCA6390 and WCN6855 - device recovery (firmware restart) support for QCA6390 and WCN6855 - support setting Specific Absorption Rate (SAR) for WCN6855 - read country code from SMBIOS for WCN6855/QCA6390 - support for WCN6750 wcn36xx - support for transmit rate reporting to user space * tag 'wireless-next-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (228 commits) rtw89: 8852c: rfk: add DPK rtw89: 8852c: rfk: add IQK rtw89: 8852c: rfk: add RX DCK rtw89: 8852c: rfk: add RCK rtw89: 8852c: rfk: add TSSI rtw89: 8852c: rfk: add LCK rtw89: 8852c: rfk: add DACK rtw89: 8852c: rfk: add RFK tables plfxlc: fix le16_to_cpu warning for beacon_interval rtw88: remove a copy of the NAPI_POLL_WEIGHT define carl9170: tx: fix an incorrect use of list iterator wil6210: use NAPI_POLL_WEIGHT for napi budget ath10k: remove a copy of the NAPI_POLL_WEIGHT define ath11k: Add support for WCN6750 device ath11k: Datapath changes to support WCN6750 ath11k: HAL changes to support WCN6750 ath11k: Add QMI changes for WCN6750 ath11k: Fetch device information via QMI for WCN6750 ath11k: Add register access logic for WCN6750 ath11k: Add HW params for WCN6750 ... ==================== Link: https://lore.kernel.org/r/20220503153622.C1671C385A4@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 58caed3dacb4354a25a1aa8d2febc3e9648ba1f4 Author: Jakub Kicinski Date: Mon May 2 16:27:03 2022 -0700 netdev: reshuffle netif_napi_add() APIs to allow dropping weight Most drivers should not have to worry about selecting the right weight for their NAPI instances and pass NAPI_POLL_WEIGHT. It'd be best if we didn't require the argument at all and selected the default internally. This change prepares the ground for such reshuffling, allowing for a smooth transition. The following API should remain after the next release cycle: netif_napi_add() netif_napi_add_weight() netif_napi_add_tx() netif_napi_add_tx_weight() Where the _weight() variants take an explicit weight argument. I opted for a _weight() suffix rather than a __ prefix, because we use __ in places to mean that caller needs to also issue a synchronize_net() call. Signed-off-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220502232703.396351-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 7d4e91e06486a9adb9126ce14ccb4f564ebeceae Author: Vladimir Oltean Date: Mon May 2 18:54:24 2022 +0300 selftests: forwarding: add basic QoS classification test for Ocelot switches Test basic (port-default, VLAN PCP and IP DSCP) QoS classification for Ocelot switches. Advanced QoS classification using tc filters is covered by tc_flower_chains.sh in the same directory. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220502155424.4098917-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 2201124dbbad9f5c35cb8b00847045653ac86a13 Merge: 2b68abf933654 304ab97f4c7c4 Author: Jakub Kicinski Date: Tue May 3 16:54:58 2022 -0700 Merge branch 'mptcp-userspace-path-manager-prerequisites' Mat Martineau says: ==================== mptcp: Userspace path manager prerequisites This series builds upon the path manager mode selection changes merged in 4994d4fa99ba ("Merge branch 'mptcp-path-manager-mode-selection'") to further modify the path manager code in preparation for adding the new netlink commands to announce/remove advertised addresses and create/destroy subflows of an MPTCP connection. The third and final patch series for the userspace path manager will implement those commands as discussed in https://lore.kernel.org/netdev/23ff3b49-2563-1874-fa35-3af55d3088e7@linux.intel.com/#r Patches 1, 5, and 7 remove some internal constraints on path managers (in general) without changing in-kernel PM behavior. Patch 2 adds a self test to validate MPTCP address advertisement ack behavior. Patches 3, 4, and 6 add new attributes to existing MPTCP netlink events and track internal state for populating those attributes. ==================== Link: https://lore.kernel.org/r/20220502205237.129297-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 304ab97f4c7c49dc6a1d1dac04cabba602a25c43 Author: Kishen Maloor Date: Mon May 2 13:52:37 2022 -0700 mptcp: allow ADD_ADDR reissuance by userspace PMs This change allows userspace PM implementations to reissue ADD_ADDR announcements (if necessary) based on their chosen policy. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 41b3c69bf9414375319290c59f198ff5c71d273f Author: Kishen Maloor Date: Mon May 2 13:52:36 2022 -0700 mptcp: expose server_side attribute in MPTCP netlink events This change records the 'server_side' attribute of MPTCP_EVENT_CREATED and MPTCP_EVENT_ESTABLISHED events to inform their recipient about the Client/Server role of the running MPTCP application. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/246 Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 70c708e82606f842dc1bcf0943b8acae30c4088f Author: Kishen Maloor Date: Mon May 2 13:52:35 2022 -0700 mptcp: establish subflows from either end of connection This change updates internal logic to permit subflows to be established from either the client or server ends of MPTCP connections. This symmetry and added flexibility may be harnessed by PM implementations running on either end in creating new subflows. The essence of this change lies in not relying on the "server_side" flag (which continues to be available if needed). Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d1ace2d9abf3eb5aaa91621050bfd02695721d18 Author: Kishen Maloor Date: Mon May 2 13:52:34 2022 -0700 mptcp: reflect remote port (not 0) in ANNOUNCED events Per RFC 8684, if no port is specified in an ADD_ADDR message, MPTCP SHOULD attempt to connect to the specified address on the same port as the port that is already in use by the subflow on which the ADD_ADDR signal was sent. To facilitate that, this change reflects the specific remote port in use by that subflow in MPTCP_EVENT_ANNOUNCED events. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 8a348392209ffdd70926253f014eec0c04dbf3e7 Author: Kishen Maloor Date: Mon May 2 13:52:33 2022 -0700 mptcp: store remote id from MP_JOIN SYN/ACK in local ctx This change reads the addr id assigned to the remote endpoint of a subflow from the MP_JOIN SYN/ACK message and stores it in the related subflow context. The remote id was not being captured prior to this change, and will now provide a consistent view of remote endpoints and their ids as seen through netlink events. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit b3b71bf915210969ef4807e39c8f037c40a05e76 Author: Mat Martineau Date: Mon May 2 13:52:32 2022 -0700 selftests: mptcp: ADD_ADDR echo test with missing userspace daemon Check userspace PM behavior to ensure ADD_ADDR echoes are only sent when there is an active userspace daemon. If the daemon is restarting or hasn't loaded yet, the missing echo will cause the peer to retransmit the ADD_ADDR - and hopefully the daemon will be ready to receive it at that later time. Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 4d25247d3ae486e6e4c59394487fd01523628234 Author: Kishen Maloor Date: Mon May 2 13:52:31 2022 -0700 mptcp: bypass in-kernel PM restrictions for non-kernel PMs Current limits on the # of addresses/subflows must apply only to in-kernel PM managed sockets. Thus this change removes such restrictions on connections overseen by non-kernel (e.g. userspace) PMs. This change also ensures that the kernel does not record stats inside struct mptcp_pm_data updated along kernel code paths when exercised via non-kernel PMs. Additionally, address announcements are acknolwedged and subflow requests are honored only when it's deemed that a userspace path manager is active at the time. Acked-by: Paolo Abeni Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 38cd5b12b7854941ede1954cf5a2393eb94b5d37 Author: Alexey Gladkov Date: Tue May 3 15:39:57 2022 +0200 ipc: Remove extra braces Fix coding style. In the previous commit, I added braces because, in addition to changing .data, .extra1 also changed. Now this is not needed. Fixes: 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/37687827f630bc150210f5b8abeeb00f1336814e.1651584847.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit 0889f44e281034e180daa6daf3e2d57c012452d4 Author: Alexey Gladkov Date: Tue May 3 15:39:56 2022 +0200 ipc: Check permissions for checkpoint_restart sysctls at open time As Eric Biederman pointed out, it is possible not to use a custom proc_handler and check permissions for every write, but to use a .permission handler. That will allow the checkpoint_restart sysctls to perform all of their permission checks at open time, and not need any other special code. Link: https://lore.kernel.org/lkml/87czib9g38.fsf@email.froward.int.ebiederm.org/ Fixes: 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") Signed-off-by: Eric W. Biederman Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/65fa8459803830608da4610a39f33c76aa933eb9.1651584847.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit dd141a4955d5ebbb3f4c7996796e86a3ac9ed57f Author: Alexey Gladkov Date: Tue May 3 15:39:55 2022 +0200 ipc: Remove extra1 field abuse to pass ipc namespace Eric Biederman pointed out that using .extra1 to pass ipc namespace looks like an ugly hack and there is a better solution. We can get the ipc_namespace using the .data field. Link: https://lore.kernel.org/lkml/87czib9g38.fsf@email.froward.int.ebiederm.org/ Fixes: 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") Signed-off-by: Eric W. Biederman Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/93df64a8fe93ba20ebbe1d9f8eda484b2f325426.1651584847.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit def7343ff03bbb36ce7a34dcb19cab599f0da446 Author: Alexey Gladkov Date: Tue May 3 15:39:54 2022 +0200 ipc: Use the same namespace to modify and validate In the 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") I missed that in addition to the modification of sem_ctls[3], the change is validated. This validation must occur in the same namespace. Link: https://lore.kernel.org/lkml/875ymnvryb.fsf@email.froward.int.ebiederm.org/ Fixes: 1f5c135ee509 ("ipc: Store ipc sysctls in the ipc namespace") Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/b3cb9a25cce6becbef77186bc1216071a08a969b.1651584847.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit 417aea4436bb658d8c5c4dcd0e3c255931d0ee96 Author: SHIMAMOTO Takayoshi Date: Fri Apr 22 00:10:54 2022 +0900 ARM: dts: BCM5301X: Add DT for WZR-1166DHP,DHP2 Buffalo WZR-1166DHP/WZR-1166DHP2 wireless router with - BCM4708A0 - 128MiB NAND flash - 2T2R 11ac/a/b/g/n Wi-Fi - 4x 10/100/1000M ethernet switch - 1x USB 3.0 port WZR-1166DHP and WZR-1166DHP2 have different memory capacity. WZR-1166DHP - 512 MiB DDR2 SDRAM WZR-1166DHP2 - 256 MiB DDR2 SDRAM These hardware components are very similar to the WZR-1750DHP except for the number of antennas. Signed-off-by: SHIMAMOTO Takayoshi Signed-off-by: Florian Fainelli commit 6742ca620bd929ee96bd6724692132056203fb95 Author: Rob Herring Date: Fri Apr 22 14:22:36 2022 -0500 dt-bindings: i3c: Convert snps,dw-i3c-master to DT schema Convert the Synopsys Designware I3C master to DT schema format. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220422192236.2594577-1-robh@kernel.org commit 4bd69ecfa672e94334618ef9ec653b2a237cf2d9 Author: Rob Herring Date: Fri Apr 22 14:22:23 2022 -0500 dt-bindings: i3c: Convert cdns,i3c-master to DT schema Convert the Cadence I3C master to DT schema format. This fixes a warning as it is used in the i3c.yaml example. The "nintendo,nunchuk" is not documented by a schema, so change the example child device to something which is documented. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220422192224.2594098-1-robh@kernel.org commit 3b96a9c522b2ee267fa1f46943ebc5d9cdd7b3dc Author: Sargun Dhillon Date: Tue May 3 01:09:58 2022 -0700 selftests/seccomp: Add test for wait killable notifier This verifies that if a filter is set up with the wait killable feature that it obeys the semantics that non-fatal signals are ignored during a notification after the notification is received. Cases tested: * Non-fatal signal prior to receive * Non-fatal signal during receive * Fatal signal after receive The normal signal handling is tested in user_notification_signal. That behaviour remains unchanged. On an unsupported kernel, these tests will immediately bail as it relies on a new seccomp flag. Signed-off-by: Sargun Dhillon Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503080958.20220-4-sargun@sargun.me commit 922a1b520c5ffb09079dddeb0c686f9c008a9923 Author: Sargun Dhillon Date: Tue May 3 01:09:57 2022 -0700 selftests/seccomp: Refactor get_proc_stat to split out file reading code This splits up the get_proc_stat function to make it so we can use it as a generic helper to read the nth field from multiple different files, versus replicating the logic in multiple places. Signed-off-by: Sargun Dhillon Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503080958.20220-3-sargun@sargun.me commit c2aa2dfef243efe213a480a1ee8566507a5152f4 Author: Sargun Dhillon Date: Tue May 3 01:09:56 2022 -0700 seccomp: Add wait_killable semantic to seccomp user notifier This introduces a per-filter flag (SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV) that makes it so that when notifications are received by the supervisor the notifying process will transition to wait killable semantics. Although wait killable isn't a set of semantics formally exposed to userspace, the concept is searchable. If the notifying process is signaled prior to the notification being received by the userspace agent, it will be handled as normal. One quirk about how this is handled is that the notifying process only switches to TASK_KILLABLE if it receives a wakeup from either an addfd or a signal. This is to avoid an unnecessary wakeup of the notifying task. The reasons behind switching into wait_killable only after userspace receives the notification are: * Avoiding unncessary work - Often, workloads will perform work that they may abort (request racing comes to mind). This allows for syscalls to be aborted safely prior to the notification being received by the supervisor. In this, the supervisor doesn't end up doing work that the workload does not want to complete anyways. * Avoiding side effects - We don't want the syscall to be interruptible once the supervisor starts doing work because it may not be trivial to reverse the operation. For example, unmounting a file system may take a long time, and it's hard to rollback, or treat that as reentrant. * Avoid breaking runtimes - Various runtimes do not GC when they are during a syscall (or while running native code that subsequently calls a syscall). If many notifications are blocked, and not picked up by the supervisor, this can get the application into a bad state. Signed-off-by: Sargun Dhillon Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220503080958.20220-2-sargun@sargun.me commit 920f4a55fdaa6f68b31c50cca6e51fecac5857a0 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:53 2022 +0000 selftests: KVM: aarch64: Add the bitmap firmware registers to get-reg-list Add the psuedo-firmware registers KVM_REG_ARM_STD_BMAP, KVM_REG_ARM_STD_HYP_BMAP, and KVM_REG_ARM_VENDOR_HYP_BMAP to the base_regs[] list. Also, add the COPROC support for KVM_REG_ARM_FW_FEAT_BMAP. Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-10-rananta@google.com commit 5ca24697d54027c1c94c94a5b920a75448108ed0 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:52 2022 +0000 selftests: KVM: aarch64: Introduce hypercall ABI test Introduce a KVM selftest to check the hypercall interface for arm64 platforms. The test validates the user-space' [GET|SET]_ONE_REG interface to read/write the psuedo-firmware registers as well as its effects on the guest upon certain configurations. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-9-rananta@google.com commit e918e2bc52c8ac1cccd6ef822ac23eded41761b6 Author: Oliver Upton Date: Sat Apr 9 18:45:46 2022 +0000 selftests: KVM: Create helper for making SMCCC calls The PSCI and PV stolen time tests both need to make SMCCC calls within the guest. Create a helper for making SMCCC calls and rework the existing tests to use the library function. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220409184549.1681189-11-oupton@google.com commit bf08515d39cb843c81f991ee67ff543eecdba0c3 Author: Oliver Upton Date: Sat Apr 9 18:45:45 2022 +0000 selftests: KVM: Rename psci_cpu_on_test to psci_test There are other interactions with PSCI worth testing; rename the PSCI test to make it more generic. No functional change intended. Signed-off-by: Oliver Upton Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220409184549.1681189-10-oupton@google.com commit ea733263949646700977feeb662a92703f514351 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:51 2022 +0000 tools: Import ARM SMCCC definitions Import the standard SMCCC definitions from include/linux/arm-smccc.h. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-8-rananta@google.com commit fa246c68a04d46c7af6953b47dba7e16d24efbe2 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:50 2022 +0000 Docs: KVM: Add doc for the bitmap firmware registers Add the documentation for the bitmap firmware registers in hypercalls.rst and api.rst. This includes the details for KVM_REG_ARM_STD_BMAP, KVM_REG_ARM_STD_HYP_BMAP, and KVM_REG_ARM_VENDOR_HYP_BMAP registers. Since the document is growing to carry other hypercall related information, make necessary adjustments to present the document in a generic sense, rather than being PSCI focused. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan [maz: small scale reformat, move things about, random typo fixes] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-7-rananta@google.com commit f1ced23a9be5727c6f4cac0e2262c5411038952f Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:49 2022 +0000 Docs: KVM: Rename psci.rst to hypercalls.rst Since the doc also covers general hypercalls' details, rather than just PSCI, and the fact that the bitmap firmware registers' details will be added to this doc, rename the file to a more appropriate name- hypercalls.rst. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-6-rananta@google.com commit b22216e1a617ca55b41337cd1e057ebc784a65d4 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:48 2022 +0000 KVM: arm64: Add vendor hypervisor firmware register Introduce the firmware register to hold the vendor specific hypervisor service calls (owner value 6) as a bitmap. The bitmap represents the features that'll be enabled for the guest, as configured by the user-space. Currently, this includes support for KVM-vendor features along with reading the UID, represented by bit-0, and Precision Time Protocol (PTP), represented by bit-1. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan [maz: tidy-up bitmap values] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-5-rananta@google.com commit 428fd6788d4d0e0d390de9fb4486be3c1187310d Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:47 2022 +0000 KVM: arm64: Add standard hypervisor firmware register Introduce the firmware register to hold the standard hypervisor service calls (owner value 5) as a bitmap. The bitmap represents the features that'll be enabled for the guest, as configured by the user-space. Currently, this includes support only for Paravirtualized time, represented by bit-0. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan [maz: tidy-up bitmap values] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-4-rananta@google.com commit 05714cab7d63b189894235cf310fae7d6ffc2e9b Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:46 2022 +0000 KVM: arm64: Setup a framework for hypercall bitmap firmware registers KVM regularly introduces new hypercall services to the guests without any consent from the userspace. This means, the guests can observe hypercall services in and out as they migrate across various host kernel versions. This could be a major problem if the guest discovered a hypercall, started using it, and after getting migrated to an older kernel realizes that it's no longer available. Depending on how the guest handles the change, there's a potential chance that the guest would just panic. As a result, there's a need for the userspace to elect the services that it wishes the guest to discover. It can elect these services based on the kernels spread across its (migration) fleet. To remedy this, extend the existing firmware pseudo-registers, such as KVM_REG_ARM_PSCI_VERSION, but by creating a new COPROC register space for all the hypercall services available. These firmware registers are categorized based on the service call owners, but unlike the existing firmware pseudo-registers, they hold the features supported in the form of a bitmap. During the VM initialization, the registers are set to upper-limit of the features supported by the corresponding registers. It's expected that the VMMs discover the features provided by each register via GET_ONE_REG, and write back the desired values using SET_ONE_REG. KVM allows this modification only until the VM has started. Some of the standard features are not mapped to any bits of the registers. But since they can recreate the original problem of making it available without userspace's consent, they need to be explicitly added to the case-list in kvm_hvc_call_default_allowed(). Any function-id that's not enabled via the bitmap, or not listed in kvm_hvc_call_default_allowed, will be returned as SMCCC_RET_NOT_SUPPORTED to the guest. Older userspace code can simply ignore the feature and the hypercall services will be exposed unconditionally to the guests, thus ensuring backward compatibility. In this patch, the framework adds the register only for ARM's standard secure services (owner value 4). Currently, this includes support only for ARM True Random Number Generator (TRNG) service, with bit-0 of the register representing mandatory features of v1.0. Other services are momentarily added in the upcoming patches. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Gavin Shan [maz: reduced the scope of some helpers, tidy-up bitmap max values, dropped error-only fast path] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-3-rananta@google.com commit c29722fad4aabbf6bb841b8f058f858ec911df56 Author: Christian Göttsche Date: Tue Mar 8 18:09:26 2022 +0100 selinux: log anon inode class name Log the anonymous inode class name in the security hook inode_init_security_anon. This name is the key for name based type transitions on the anon_inode security class on creation. Example: type=AVC msg=audit(02/16/22 22:02:50.585:216) : avc: granted \ { create } for pid=2136 comm=mariadbd anonclass=[io_uring] \ scontext=system_u:system_r:mysqld_t:s0 \ tcontext=system_u:system_r:mysqld_iouring_t:s0 tclass=anon_inode Add a new LSM audit data type holding the inode and the class name. Signed-off-by: Christian Göttsche [PM: adjusted 'anonclass' to be a trusted string, cgzones approved] Signed-off-by: Paul Moore commit ded34574d4d351ab0ca095a45496b393cef611c2 Author: Christian Göttsche Date: Mon May 2 16:43:38 2022 +0200 selinux: declare data arrays const The arrays for the policy capability names, the initial sid identifiers and the class and permission names are not changed at runtime. Declare them const to avoid accidental modification. Do not override the classmap and the initial sid list in the build time script genheaders. Check flose(3) is successful in genheaders.c, otherwise the written data might be corrupted or incomplete. Signed-off-by: Christian Göttsche [PM: manual merge due to fuzz, minor style tweaks] Signed-off-by: Paul Moore commit fb5e339fb1bc9eb7f34b341d995e4ab39c03588e Author: Luca Weiss Date: Thu Apr 21 23:42:43 2022 +0200 ARM: dts: qcom: msm8974-FP2: Add supplies for remoteprocs Those were removed from msm8974.dtsi as part of a recent cleanup commit, so add them back for FP2. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421214243.352469-3-luca@z3ntu.xyz commit da281bf9345a8bcde224976b83d6ad7899830e97 Author: Luca Weiss Date: Thu Apr 21 23:42:42 2022 +0200 ARM: dts: qcom: msm8974-FP2: Configure charger Set the relevant properties on the smbb charger to allow the device to charge properly. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421214243.352469-2-luca@z3ntu.xyz commit 88044abcde58ebf810f4be49ee2555ecc333bad4 Author: Luca Weiss Date: Thu Apr 21 23:42:41 2022 +0200 ARM: dts: qcom: msm8974-FP2: Add support for touchscreen Configure the touchscreen found on the new display module of the FP2. To add some detail, FP2 has two different screen/touchscreen variants ("display module"), the old module has Synaptics touchscreen, the new one this Ilitek touchscreen. We're only supporting the new display module for now. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421214243.352469-1-luca@z3ntu.xyz commit 3d0e375bae55c2dfa6dd0762f45ad71f0b192f71 Author: Vijaya Krishna Nivarthi Date: Thu Apr 21 21:26:07 2022 +0530 arm64: dts: qcom: sc7280-qcard: Configure CTS pin to bias-bus-hold for bluetooth WLAN rail was leaking power during RBSC/sleep even after turning BT off. Change active and sleep pinctrl configurations to handle same. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1650556567-4995-3-git-send-email-quic_vnivarth@quicinc.com commit 497b272759986af1aa5a25b5e903d082c67bd8f6 Author: Vijaya Krishna Nivarthi Date: Thu Apr 21 21:26:06 2022 +0530 arm64: dts: qcom: sc7280-idp: Configure CTS pin to bias-bus-hold for bluetooth WLAN rail was leaking power during RBSC/sleep even after turning BT off. Change active and sleep pinctrl configurations to handle same. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1650556567-4995-2-git-send-email-quic_vnivarth@quicinc.com commit 02fbeb1649534d564b100a994b05d4eaa167ea19 Author: Stephen Boyd Date: Thu Apr 14 17:58:27 2022 -0700 ARM: dts: qcom: sdx55: Remove ipa interconnect node This device node is unused now that we've removed the driver that consumed it in the kernel. Drop the unused node to save some space. Cc: Alex Elder Cc: Taniya Das Cc: Mike Tipton Cc: Georgi Djakov Signed-off-by: Stephen Boyd Reviewed-by: Alex Elder Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415005828.1980055-2-swboyd@chromium.org commit 067bc653b85e466048914c48e46659a50a907fa6 Author: Stephen Boyd Date: Thu Apr 14 17:58:26 2022 -0700 arm64: dts: qcom: sc7180: Remove ipa interconnect node This device node is unused now that we've removed the driver that consumed it in the kernel. Drop the unused node to save some space. Cc: Alex Elder Cc: Taniya Das Cc: Mike Tipton Cc: Georgi Djakov Signed-off-by: Stephen Boyd Acked-by: Georgi Djakov Reviewed-by: Alex Elder Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415005828.1980055-1-swboyd@chromium.org commit a9029d97045468bc25281971d452b6cecf009553 Author: Christian Göttsche Date: Mon May 2 16:05:46 2022 +0200 selinux: fix indentation level of mls_ops block Add one level of indentation to the code block of the label mls_ops in constraint_expr_eval(), to adjust the trailing break; to the parent case: branch. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 8d62a974ac5fa1609e57a54622eef71e87bace78 Author: Christian König Date: Tue May 3 08:36:13 2022 +0200 drm/amdgpu: fix drm-next merge fallout That hunk somehow got missing while solving the conflict between the TTM and AMDGPU changes for drm-next. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20220503063613.46925-1-christian.koenig@amd.com commit 4ad37de496425b1d2bc4cd923cf94f3e582d5dea Author: Christian Göttsche Date: Mon May 2 16:15:20 2022 +0200 selinux: include necessary headers in headers Include header files required for struct or typedef declarations in header files. This is for example helpful when working with an IDE, which needs to resolve those symbols. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 1d4e8036cb2b301842797d447164464896824c58 Author: Christian Göttsche Date: Mon May 2 16:10:51 2022 +0200 selinux: avoid extra semicolon Wrap macro into `do { } while (0)` to avoid Clang emitting warnings about extra semicolons. Similar to userspace commit https://github.com/SELinuxProject/selinux/commit/9d85aa60d12e468e7fd510c2b5475b5299b71622 Signed-off-by: Christian Göttsche [PM: whitespace/indenting tweaks] Signed-off-by: Paul Moore commit 759205151c09324dcdf788edc6fc6a5768523657 Author: Christian Göttsche Date: Mon May 2 16:01:50 2022 +0200 selinux: update parameter documentation security/selinux/include/audit.h:54: warning: Function parameter or member 'krule' not described in 'selinux_audit_rule_known' security/selinux/include/audit.h:54: warning: Excess function parameter 'rule' description in 'selinux_audit_rule_known' security/selinux/include/avc.h:130: warning: Function parameter or member 'state' not described in 'avc_audit' This also bring the parameter name of selinux_audit_rule_known() in sync between declaration and definition. Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit ede17552b1e70d4435decba026b86e137b516248 Author: Christian Göttsche Date: Mon May 2 15:48:48 2022 +0200 selinux: resolve checkpatch errors Reported by checkpatch: security/selinux/nlmsgtab.c --------------------------- ERROR: that open brace { should be on the previous line #29: FILE: security/selinux/nlmsgtab.c:29: +static const struct nlmsg_perm nlmsg_route_perms[] = +{ ERROR: that open brace { should be on the previous line #97: FILE: security/selinux/nlmsgtab.c:97: +static const struct nlmsg_perm nlmsg_tcpdiag_perms[] = +{ ERROR: that open brace { should be on the previous line #105: FILE: security/selinux/nlmsgtab.c:105: +static const struct nlmsg_perm nlmsg_xfrm_perms[] = +{ ERROR: that open brace { should be on the previous line #134: FILE: security/selinux/nlmsgtab.c:134: +static const struct nlmsg_perm nlmsg_audit_perms[] = +{ security/selinux/ss/policydb.c ------------------------------ ERROR: that open brace { should be on the previous line #318: FILE: security/selinux/ss/policydb.c:318: +static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) = +{ ERROR: that open brace { should be on the previous line #674: FILE: security/selinux/ss/policydb.c:674: +static int (*index_f[SYM_NUM]) (void *key, void *datum, void *datap) = +{ ERROR: that open brace { should be on the previous line #1643: FILE: security/selinux/ss/policydb.c:1643: +static int (*read_f[SYM_NUM]) (struct policydb *p, struct symtab *s, void *fp) = +{ ERROR: that open brace { should be on the previous line #3246: FILE: security/selinux/ss/policydb.c:3246: + void *datap) = +{ Signed-off-by: Christian Göttsche Signed-off-by: Paul Moore commit 448a54ace4bb20216f5bfcecf272871d387d03dd Author: Stuart Summers Date: Mon May 2 09:34:07 2022 -0700 drm/i915/pvc: add initial Ponte Vecchio definitions Additional blitter and media engines will be enabled later. Bspec: 44481, 44482 Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220502163417.2635462-2-matthew.d.roper@intel.com commit be05ee54378d451e1d60196921566d6087f3079f Merge: 404147faaaf28 f596e2ce1c0f2 87c5adf06bfbf ab2756ea6b749 586e31d59c436 bd6c375b92c3f bf5e7a2f4609d fb036ad7db108 Author: Paul E. McKenney Date: Tue May 3 10:21:40 2022 -0700 Merge branches 'docs.2022.04.20a', 'fixes.2022.04.20a', 'nocb.2022.04.11b', 'rcu-tasks.2022.04.11b', 'srcu.2022.05.03a', 'torture.2022.04.11b', 'torture-tasks.2022.04.20a' and 'torturescript.2022.04.20a' into HEAD docs.2022.04.20a: Documentation updates. fixes.2022.04.20a: Miscellaneous fixes. nocb.2022.04.11b: Callback-offloading updates. rcu-tasks.2022.04.11b: RCU-tasks updates. srcu.2022.05.03a: Put SRCU on a memory diet. torture.2022.04.11b: Torture-test updates. torture-tasks.2022.04.20a: Avoid torture testing changing RCU configuration. torturescript.2022.04.20a: Torture-test scripting updates. commit 586e31d59c436cda65a2e8ac04ff954bed247023 Author: Lukas Bulwahn Date: Tue Mar 15 09:55:49 2022 +0100 srcu: Drop needless initialization of sdp in srcu_gp_start() Commit 9c7ef4c30f12 ("srcu: Make Tree SRCU able to operate without snp_node array") initializes the local variable sdp differently depending on the srcu's state in srcu_gp_start(). Either way, this initialization overwrites the value used when sdp is defined. This commit therefore drops this pointless definition-time initialization. Although there is no functional change, compiler code generation may be affected. Signed-off-by: Lukas Bulwahn Signed-off-by: Paul E. McKenney commit 282d8998e9979c2186af7f7d22366f2fc3149838 Author: Paul E. McKenney Date: Tue Mar 8 15:45:33 2022 -0800 srcu: Prevent expedited GPs and blocking readers from consuming CPU If an SRCU reader blocks while a synchronize_srcu_expedited() waits for that same reader, then that grace period will spawn an endless series of workqueue handlers, consuming a full CPU. This quickly gets pointless because consuming more CPU isn't going to make that reader get done faster, especially if it is blocked waiting for an external event. This commit therefore spawns at most one pair of back-to-back workqueue handlers per expedited grace period phase, instead inserting increasing delays as that grace period phase grows older, but capped at 10 jiffies. In any case, if there have been at least 100 back-to-back workqueue handlers within a single jiffy, regardless of grace period or grace-period phase, then a one-jiffy delay is inserted. [ paulmck: Apply feedback from kernel test robot. ] Cc: Neeraj Upadhyay Reported-by: Song Liu Tested-by: kernel test robot Signed-off-by: Paul E. McKenney commit c2445d38785086422e56dcbe049b73a53b2ba81f Author: Paul E. McKenney Date: Mon Jan 31 13:27:15 2022 -0800 srcu: Add contention check to call_srcu() srcu_data ->lock acquisition This commit increases the sensitivity of contention detection by adding checks to the acquisition of the srcu_data structure's lock on the call_srcu() code path. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit a57ffb3c6b67e59e8632f731414b792eacc6cca0 Author: Paul E. McKenney Date: Mon Jan 31 11:21:30 2022 -0800 srcu: Automatically determine size-transition strategy at boot This commit adds a srcutree.convert_to_big option of zero that causes SRCU to decide at boot whether to wait for contention (small systems) or immediately expand to large (large systems). A new srcutree.big_cpu_lim (defaulting to 128) defines how many CPUs constitute a large system. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 5b759db44195bb779828a188bad6b745c18dcd55 Author: Akira Yokosawa Date: Mon May 2 21:05:09 2022 +0900 tools/memory-model/README: Update klitmus7 compat table EXPORT_SYMBOL of do_exec() was removed in v5.17. Unfortunately, kernel modules from klitmus7 7.56 have do_exec() at the end of each kthread. herdtools7 7.56.1 has addressed the issue. Update the compatibility table accordingly. Signed-off-by: Akira Yokosawa Cc: Luc Maranget Cc: Jade Alglave Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: Paul E. McKenney commit 50612cf9e05d111c21e84096e50a31d0c35d5825 Author: Harald Geyer Date: Sat Apr 30 19:10:09 2022 +0000 arm64: dts: allwinner: teres-i: Add GPIO port regulators Allwinner A64 SoC has separate supplies for PC, PD, PE, PG and PL. Signed-off-by: Harald Geyer Reviewed-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220430191009.73946-1-harald@ccbib.org commit ae8f4223b15227ec054bdb8a6247ce5b54d6e48e Author: Kuldeep Singh Date: Mon Apr 4 23:59:34 2022 +0530 dt-bindings: I2C: Add Qualcomm Geni based QUP I2C bindings GENI(generic interface) based Qualcomm Universal Peripheral controller can support multiple serial interfaces like SPI,UART and I2C. Unlike other I2C controllers, QUP I2C bindings are present in parent schema. Move it out from parent to an individual binding and let parent refer to child schema later on. Please note, current schema isn't complete as it misses out few properties and thus, add these missing properties along the process. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220404182938.29492-2-singh.kuldeep87k@gmail.com commit 421f4d14bc037f708a3d11fbb01274b741767bf9 Author: Frank Rowand Date: Mon May 2 13:17:42 2022 -0500 of: overlay: do not free changeset when of_overlay_apply returns error New unittests for overlay notifiers reveal a memory leak in of_overlay_apply() when a notifier returns an error for action OF_OVERLAY_POST_APPLY. The pr_err() message is: OF: ERROR: memory leak, expected refcount 1 instead of 3, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /testcase-data/overlay-node/test-bus/test-unittest17 Change the error path to no longer call free_overlay_changeset(), and document that the caller of of_overlay_fdt_apply() may choose to remove the overlay. Update the unittest that triggered the error to expect the changed return values and to call of_overlay_remove(). Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220502181742.1402826-4-frowand.list@gmail.com commit 992b0dc5c38a4e79dca17577960c5201275b83f1 Author: Frank Rowand Date: Mon May 2 13:17:41 2022 -0500 of: overlay: unittest: add tests for overlay notifiers Add tests for overlay apply and remove notifiers. Trigger errors for each of the notifier actions. These tests will reveal a memory leak problem when a notifier returns an error for action OF_OVERLAY_POST_APPLY. The pr_err() message is: OF: ERROR: memory leak, expected refcount 1 instead of 3, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node /testcase-data/overlay-node/test-bus/test-unittest17 Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220502181742.1402826-3-frowand.list@gmail.com commit 1ac17586c950a2c129393f8a92901a2b357acf24 Author: Frank Rowand Date: Mon May 2 13:17:40 2022 -0500 of: overlay: add entry to of_overlay_action_name[] The values of enum of_overlay_notify_action are used to index into array of_overlay_action_name. Add an entry to of_overlay_action_name for the value recently added to of_overlay_notify_action. Array of_overlay_action_name[] is moved into include/linux/of.h adjacent to enum of_overlay_notify_action to make the connection between the two more obvious if either is modified in the future. The only use of of_overlay_action_name is for error reporting in overlay_notify(). All callers of overlay_notify() report the same error, but with fewer details. Remove the redundant error reports in the callers. Fixes: 067c098766c6 ("of: overlay: rework overlay apply and remove kfree()s") Reported-by: Dan Carpenter Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220502181742.1402826-2-frowand.list@gmail.com commit b20eee62ee89aba03261a1abac80f29abea5bdf5 Author: David Heidelberg Date: Tue Apr 26 12:18:37 2022 +0200 dt-bindings: mailbox: qcom-ipcc: add missing properties into example These missing required properties are needed for smp2p binding reference checks. Also includes cosmetic change to the example formatting. Reviewed-by: Krzysztof Kozlowski Signed-off-by: David Heidelberg Reviewed-by: Manivannan Sadhasivam Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220426101837.16201-2-david@ixit.cz commit 897c675605e372eb6fd8e042ffbec5baff54dccd Author: David Heidelberg Date: Tue Apr 26 12:18:36 2022 +0200 dt-bindings: mailbox: qcom-ipcc: add missing compatible for SM8450 Fill missing compatible already used in SM8450 DTS. Signed-off-by: David Heidelberg Reviewed-by: Dmitry Baryshkov Reviewed-by: Manivannan Sadhasivam Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220426101837.16201-1-david@ixit.cz commit a6bf474cda4cb5239cacc44bc57f4528f2a2da37 Author: Linus Walleij Date: Mon Apr 25 15:22:15 2022 +0200 dt-bindings: gnss: Add Broacom BCM4751 family bindings The Broadcom BCM4751 family of (A-)GPS chips have been around for some years. The latest iteration BCM4753 is for example mounted on the Huawei HiKey970. Cc: devicetree@vger.kernel.org Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220425132215.1309216-1-linus.walleij@linaro.org commit dedf10f40f30e6ebce6094c57f7667602c58424f Author: Rob Herring Date: Tue Apr 26 12:59:39 2022 -0500 dt-bindings: eeprom/at24: Add samsung,s524ad0xd1 compatible The samsung,s524ad0xd1 compatible is in use, but not documented. According to arch/arm/mach-s3c/mach-smdk6410.c, the samsung,s524ad0xd1 is compatible with the 24c128. As the schema requires a fallback compatible to the corresponding Atmel compatible, 'atmel,24c128' is added as a fallback. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220426175938.2262966-1-robh@kernel.org commit 18292faa89d2bff3bdd33ab9c065f45fb6710e47 Author: Christoph Hellwig Date: Mon Apr 18 06:53:13 2022 +0200 rnbd-srv: use bdev_discard_alignment Use bdev_discard_alignment to calculate the correct discard alignment offset even for partitions instead of just looking at the queue limit. Signed-off-by: Christoph Hellwig Acked-by: Jack Wang Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-11-hch@lst.de Signed-off-by: Jens Axboe commit 4e7f0ece41e1be8f876f320a0972a715daec0a50 Author: Christoph Hellwig Date: Mon Apr 18 06:53:12 2022 +0200 nvme: remove a spurious clear of discard_alignment The nvme driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-10-hch@lst.de Signed-off-by: Jens Axboe commit 4418bfd8fb9602d9cd8747c3ad52fdbaa02e2ffd Author: Christoph Hellwig Date: Mon Apr 18 06:53:11 2022 +0200 loop: remove a spurious clear of discard_alignment The loop driver never sets a discard_alignment, so it also doens't need to clear it to zero. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-9-hch@lst.de Signed-off-by: Jens Axboe commit c3f765299632727fa5ea5a0acf118665227a4f1a Author: Christoph Hellwig Date: Mon Apr 18 06:53:10 2022 +0200 dasd: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to PAGE_SIZE while the discard granularity is the block size that is smaller or the same as PAGE_SIZE as done by dasd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-8-hch@lst.de Signed-off-by: Jens Axboe commit 3d50d368c92ade2f98a3d0d28b842a57c35284e9 Author: Christoph Hellwig Date: Mon Apr 18 06:53:09 2022 +0200 raid5: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by raid5 is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-7-hch@lst.de Signed-off-by: Jens Axboe commit 44d583702f4429763c558624fac763650a1f05bf Author: Christoph Hellwig Date: Mon Apr 18 06:53:08 2022 +0200 dm-zoned: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by dm-zoned is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-6-hch@lst.de Signed-off-by: Jens Axboe commit 62952cc5bccd89b76d710de1d0b43244af0f2903 Author: Christoph Hellwig Date: Mon Apr 18 06:53:07 2022 +0200 virtio_blk: fix the discard_granularity and discard_alignment queue limits The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. On the other hand the discard_sector_alignment from the virtio 1.1 looks similar to what Linux uses as discard granularity (even if not very well described): "discard_sector_alignment can be used by OS when splitting a request based on alignment. " And at least qemu does set it to the discard granularity. So stop setting the discard_alignment and use the virtio discard_sector_alignment to set the discard granularity. Fixes: 1f23816b8eb8 ("virtio_blk: add discard and write zeroes support") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-5-hch@lst.de Signed-off-by: Jens Axboe commit fb749a87f4536d2fa86ea135ae4eff1072903438 Author: Christoph Hellwig Date: Mon Apr 18 06:53:06 2022 +0200 null_blk: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by null_blk is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-4-hch@lst.de Signed-off-by: Jens Axboe commit 4a04d517c56e0616c6f69afc226ee2691e543712 Author: Christoph Hellwig Date: Mon Apr 18 06:53:05 2022 +0200 nbd: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by nbd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-3-hch@lst.de Signed-off-by: Jens Axboe commit 07c6e92a8478770a7302f7dde72f03a5465901bd Author: Christoph Hellwig Date: Mon Apr 18 06:53:04 2022 +0200 ubd: don't set the discard_alignment queue limit The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by ubd is mostly harmless but also useless. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220418045314.360785-2-hch@lst.de Signed-off-by: Jens Axboe commit 2ca065dc9468fa1c60ada1e8cb9c1aa866367ec7 Author: Philipp Zabel Date: Thu Apr 7 17:43:37 2022 +0200 dt-bindings: reset: st,sti-powerdown: Convert to yaml Convert the device tree bindings for the STMicroelectronics STi Peripheral Powerdown reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Srinivas Kandagatla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-13-p.zabel@pengutronix.de commit b550b8a451380965ecf2d0ae1e4b97f8047a8e9a Author: Philipp Zabel Date: Thu Apr 7 17:43:36 2022 +0200 dt-bindings: reset: st,sti-picophyreset: Convert to yaml Convert the device tree bindings for the STMicroelectronics STi SoftReset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Peter Griffin Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-12-p.zabel@pengutronix.de commit e54bbcb02aeffda00a31c18372411f88b1615fa2 Author: Philipp Zabel Date: Thu Apr 7 17:43:35 2022 +0200 dt-bindings: reset: socfpga: Convert to yaml Convert the device tree bindings for the Altera SOCFPGA reset manager to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Dinh Nguyen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-11-p.zabel@pengutronix.de commit 820f722c05dd08706be1fed2787cd91ed38642e2 Author: Philipp Zabel Date: Thu Apr 7 17:43:32 2022 +0200 dt-bindings: reset: snps,axs10x-reset: Convert to yaml Convert the device tree bindings for the AXS10x reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Eugeniy Paltsev Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-8-p.zabel@pengutronix.de commit 5c9360ea998222abf1fba351fabbaba4a4c599fe Author: Philipp Zabel Date: Thu Apr 7 17:43:30 2022 +0200 dt-bindings: reset: nuvoton,npcm-reset: Convert to yaml Convert the device tree bindings for the Nuvoton NPCM reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Avi Fishman Cc: Tomer Maimon Cc: Tali Perry Cc: Patrick Venture Cc: Nancy Yuen Cc: Benjamin Fair Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-6-p.zabel@pengutronix.de commit 7809a619d41e6c1c43fdf15f0531681b36ad31c0 Author: Philipp Zabel Date: Thu Apr 7 17:43:29 2022 +0200 dt-bindings: reset: lantiq,reset: Convert to yaml Convert the device tree bindings for the Lantiq XWAY SoC RCU reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-5-p.zabel@pengutronix.de commit e2ac01c199b4a9f2d12b55e1c614eba1f03e0eec Author: Philipp Zabel Date: Thu Apr 7 17:43:28 2022 +0200 dt-bindings: reset: bitmain,bm1880-reset: Convert to yaml Convert the device tree bindings for the Bitmain BM1880 reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Manivannan Sadhasivam Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-4-p.zabel@pengutronix.de commit 1b6dc00703a2b8c312581ee0678f08468556ed6a Author: Philipp Zabel Date: Thu Apr 7 17:43:27 2022 +0200 dt-bindings: reset: berlin: Convert to yaml Convert the device tree bindings for the Marvell Berlin reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Antoine Tenart Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-3-p.zabel@pengutronix.de commit 1b4efb23092b7503304c79f2307ae618c6c62d95 Author: Philipp Zabel Date: Thu Apr 7 17:43:26 2022 +0200 dt-bindings: reset: ath79: Convert to yaml Convert the device tree bindings for the Qualcomm Atheros AR7xxx/AR9XXX reset controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Alban Bedel Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-2-p.zabel@pengutronix.de commit 5d814b2c3326c939c66bd52e472aabb9254bb2ce Author: Philipp Zabel Date: Thu Apr 7 17:43:25 2022 +0200 dt-bindings: reset: amlogic,meson-axg-audio-arb: Convert to yaml Convert the device tree bindings for the Amlogic audio memory arbiter controller to YAML schema to allow participating in DT validation. Signed-off-by: Philipp Zabel Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Reviewed-by: Martin Blumenstingl Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407154338.4190674-1-p.zabel@pengutronix.de commit edb9bd8f857e60be871e4e1cf0f96bfd77f1e604 Author: Kunihiko Hayashi Date: Tue Apr 5 16:56:18 2022 +0900 dt-bindings: reset: uniphier-glue: Clean up clocks, resets, and their names using compatible string Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks, resets, and their names that can be taken by the compatible string. The order of clock-names and reset-names doesn't change here. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/1649145378-30358-1-git-send-email-hayashi.kunihiko@socionext.com commit 9fe7dd4e94f0bb76ec96224e8813695bdf019fa5 Author: Lad Prabhakar Date: Wed Apr 6 08:16:47 2022 +0100 reset: Kconfig: Make RESET_RZG2L_USBPHY_CTRL depend on ARCH_RZG2L The USBPHY Control block is identical on Renesas RZ/G2L and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Lad Prabhakar Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220406071647.14037-1-prabhakar.mahadev-lad.rj@bp.renesas.com commit 82816b4ffce96e7b0df3de583037490ba7dc8792 Author: Krishna Yarlagadda Date: Mon Mar 7 19:26:26 2022 +0530 reset: ACPI reset support Some of the IO devices like I2C or SPI require reset at runtime to recover from an error condition without changing the power state of the system. Added check for ACPI handle and a call to method '__RST' if supported. Devices using device tree method are unaffected by this. Signed-off-by: Krishna Yarlagadda [p.zabel@pengutronix.de: wrap in #ifdef CONFIG_ACPI due to missing stubs] Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220307135626.16673-1-kyarlagadda@nvidia.com commit 77fb4e45260ac2e2f20616bea6aa1003f4cd168c Author: Joel Stanley Date: Mon Feb 21 17:56:50 2022 +1030 reset: simple: Add AST2600 compatible Similar to the 2400 and 2500, the LPC controller has some simple reset lines that are used by the UART devices. This is already documented in LPC bindings document. Signed-off-by: Joel Stanley Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220221072650.129348-1-joel@jms.id.au commit 636728d0893f1c73b31301f21ef8e5e26d2436e9 Author: Zelong Dong Date: Fri Jan 7 10:39:31 2022 +0800 reset: reset-meson: add support for the Meson-S4 SoC Reset Controller Compared to the A1 SoCs the number of RESET registers is different and the offset for the level registers is the same. Add a new compatible string and struct meson_reset_param to add support for the reset controller on the S4 SoC. Signed-off-by: Zelong Dong Reviewed-by: Martin Blumenstingl Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220107023931.13251-4-zelong.dong@amlogic.com commit 52f988d757c78cea06b1d5c75791a7fe1638ef86 Author: Zelong Dong Date: Fri Jan 7 10:39:30 2022 +0800 dt-bindings: reset: add bindings for the Meson-S4 SoC Reset Controller Add DT bindings for the Meson-S4 SoC Reset Controller include file. Signed-off-by: Zelong Dong Reviewed-by: Martin Blumenstingl Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220107023931.13251-3-zelong.dong@amlogic.com commit 55b6267efd10b5c332af9dc624a25070fbfe2fc0 Author: Zelong Dong Date: Fri Jan 7 10:39:29 2022 +0800 dt-bindings: reset: Add compatible for Meson-S4 Reset Controller Add new compatible for Amlogic's Meson-S4 Reset Controller Signed-off-by: Zelong Dong Acked-by: Rob Herring Reviewed-by: Martin Blumenstingl Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220107023931.13251-2-zelong.dong@amlogic.com commit 72bb7314e320a74b2ca02ceb1187b2c650f38311 Author: Philipp Zabel Date: Wed Dec 15 10:38:29 2021 +0100 reset: uniphier-glue: Use devm_add_action_or_reset() Slightly simplify uniphier_glue_reset_probe() and drop uniphier_glue_reset_remove() by using devm_add_action_or_reset() for clock and reset cleanup. Signed-off-by: Philipp Zabel Reviewed-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20211215093829.3209416-2-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel commit 176cae38719196a43cd8ae08377413a3884a9f15 Author: Philipp Zabel Date: Wed Dec 15 10:38:28 2021 +0100 reset: uniphier-glue: Use reset_control_bulk API This driver already uses the clk_bulk API. Simplify the driver by using the reset_control_bulk API as well. Signed-off-by: Philipp Zabel Reviewed-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20211215093829.3209416-1-p.zabel@pengutronix.de Signed-off-by: Philipp Zabel commit f038e8186fbc5723d7d38c6fa1d342945107347e Author: Krzysztof Kozlowski Date: Tue Apr 26 20:34:43 2022 +0200 ARM: dts: exynos: add atmel,24c128 fallback to Samsung EEPROM The Samsung s524ad0xd1 EEPROM should use atmel,24c128 fallback, according to the AT24 EEPROM bindings. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220426183443.243113-1-krzysztof.kozlowski@linaro.org commit 010ddb813f3554cbbf8bd13b731452236a2c8017 Author: Linus Walleij Date: Sat Apr 23 19:27:27 2022 +0200 power: supply: ab8500_fg: Allocate wq in probe The workqueue is allocated in bind() but all interrupts are registered in probe(). Some interrupts put work on the workqueue, which can have bad side effects. Allocate the workqueue in probe() instead, destroy it in .remove() and make unbind() simply flush the workqueue. Fixes: 1c1f13a006ed ("power: supply: ab8500: Move to componentized binding") Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 6733dd4af7818559114e2a4771363dd6239297f6 Author: Saurabh Sengar Date: Mon Apr 11 21:28:59 2022 -0700 drm/hyperv: Add error message for fb size greater than allocated Add error message when the size of requested framebuffer is more than the allocated size by vmbus mmio region for framebuffer. Signed-off-by: Saurabh Sengar Reviewed-by: Dexuan Cui Link: https://lore.kernel.org/r/1649737739-10113-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Wei Liu commit f61509a6f0b70f5bedea34efaf8065621689bd7a Author: Hans de Goede Date: Mon May 2 13:12:35 2022 +0200 power: supply: axp288_fuel_gauge: Drop BIOS version check from "T3 MRD" DMI quirk Some "T3 MRD" mini-PCs / HDMI-sticks without a battery use a different value then "5.11" for their DMI BIOS version field. Drop the BIOS version check so that the no-battery "T3 MRD" DMI quirk applies to these too. Fixes: 3a06b912a5ce ("power: supply: axp288_fuel_gauge: Make "T3 MRD" no_battery_list DMI entry more generic") Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit 34f243e9fb5ace1ca760c72e366247eaeff430c0 Author: Hans de Goede Date: Mon May 2 13:12:34 2022 +0200 power: supply: axp288_fuel_gauge: Fix battery reporting on the One Mix 1 Commit 3a06b912a5ce ("power: supply: axp288_fuel_gauge: Make "T3 MRD" no_battery_list DMI entry more generic") added a generic no-battery DMI match for many mini-PCs / HDMI-sticks which use "T3 MRD" as their DMI board-name. It turns out that the One Mix 1 mini laptop also uses "T3 MRD" for its DMI boardname and it also has its chassis-type wrongly set to a value of "3" (desktop). This was causing the axp288_fuel_gauge driver to disable battery reporting because this matches the no-battery DMI list entry for generic "T3 MRD" mini-PCs. Change the no-battery DMI list into a quirks DMI list and add a specific match for the One Mix 1 mini laptop before the generic "T3 MRD" no-battery quirk entry to fix this. Fixes: 3a06b912a5ce ("power: supply: axp288_fuel_gauge: Make "T3 MRD" no_battery_list DMI entry more generic") Signed-off-by: Hans de Goede Signed-off-by: Sebastian Reichel commit e56a4be2843c95c08cf8421dc1f8e880cafbaf91 Author: Linus Walleij Date: Mon Apr 25 00:13:01 2022 +0200 power: supply: core: Initialize struct to zero As we rely on pointers in the battery info to be zero-initialized such as in the helper function power_supply_supports_vbat2ri() we certainly need to allocate the struct power_supply_battery_info with kzalloc() as well. Else this happens: Unable to handle kernel paging request at virtual address 00280000 (...) PC is at power_supply_vbat2ri+0x50/0x12c LR is at ab8500_fg_battery_resistance+0x34/0x108 Fixes: e9e7d165b4b0 ("power: supply: Support VBAT-to-Ri lookup tables") Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 23b44f9c649bbef10b45fa33080cd8b4166800ae Author: Peng Wu Date: Fri Apr 29 01:03:56 2022 +0200 ARM: versatile: Add missing of_node_put in dcscb_init The device_node pointer is returned by of_find_compatible_node with refcount incremented. We should use of_node_put() to avoid the refcount leak. Signed-off-by: Peng Wu Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220428230356.69418-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 4e411ee400c106668e150501c42610dedc595117 Author: Zhengjun Xing Date: Mon Apr 25 21:22:11 2022 +0800 perf vendor events intel: Add uncore event list for Sapphirerapids Add JSON uncore events for Sapphirerapids to perf. Based on JSON list v1.01: https://download.01.org/perfmon/SPR/ Signed-off-by: Zhengjun Xing Reviewed-by: Kan Liang Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220425132211.801228-2-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 9061dffd5ebb6326a9e4678678c53ee9f0409bb7 Author: Zhengjun Xing Date: Mon Apr 25 21:22:10 2022 +0800 perf vendor events intel: Update core event list for Sapphirerapids Update JSON core events for Sapphirerapids to perf. Based on JSON list v1.01: https://download.01.org/perfmon/SPR/ Reviewed-by: Kan Liang Signed-off-by: Zhengjun Xing Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220425132211.801228-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1a9517a0a43040b77b5ef64d9053df214ba33d17 Author: Greg Kroah-Hartman Date: Tue May 3 16:44:24 2022 +0200 Revert "of/platform: Add stubs for of_platform_device_create/destroy()" This reverts commit 8e8b11956486e3fe8cacf54a1d492ebdd8cc1fb2. The series still has built errors as reported in linux-next, so revert it for now. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220502210728.0b36f3cd@canb.auug.org.au Cc: Stephen Boyd Cc: Douglas Anderson Cc: Rob Herring Cc: Matthias Kaehlcke Signed-off-by: Greg Kroah-Hartman commit 67a7570ad31f2a7f02550153e774bf4c630f0fef Author: Greg Kroah-Hartman Date: Tue May 3 16:44:11 2022 +0200 Revert "usb: misc: Add onboard_usb_hub driver" This reverts commit 0298b4b95cb373c21e6323c905589f8dac42c5b4. The series still has built errors as reported in linux-next, so revert it for now. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220502210728.0b36f3cd@canb.auug.org.au Cc: Alan Stern Cc: Douglas Anderson Cc: Matthias Kaehlcke Cc: Ravi Chandra Sadineni Cc: Stephen Boyd Signed-off-by: Greg Kroah-Hartman commit f2b6e79c7378542e03e42fd47c0c8bf00a2fcf6b Author: Greg Kroah-Hartman Date: Tue May 3 16:44:02 2022 +0200 Revert "usb: core: hcd: Create platform devices for onboard hubs in probe()" This reverts commit c40b62216c1aecc0dc00faf33d71bd71cb440337. The series still has built errors as reported in linux-next, so revert it for now. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220502210728.0b36f3cd@canb.auug.org.au Cc: Stephen Boyd Cc: Douglas Anderson Cc: Matthias Kaehlcke Signed-off-by: Greg Kroah-Hartman commit 0de2cc0e2b5faff50d36552ba174d525ca1e8fb3 Author: Tvrtko Ursulin Date: Fri Apr 29 15:07:57 2022 +0100 drm/i915: Fix assert in i915_ggtt_pin Use lockdep_assert_not_held to simplify and correct the code. Otherwise false positive are hit if lock state is uknown like after a previous taint. Signed-off-by: Tvrtko Ursulin Reported-by: Ville Syrjälä Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220429140757.651406-1-tvrtko.ursulin@linux.intel.com commit 89c839720c9ba7cb021e704d062480c45913de26 Merge: b2d229d4ddb17 df3eb1feeb73f Author: Arnd Bergmann Date: Tue May 3 16:36:52 2022 +0200 Merge tag 'omap-for-v5.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc Soc clean-up for omaps Soc clean-up for omaps to add missing of_node_put() calls and drop unused omap_device_register(). * tag 'omap-for-v5.19/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: drop hwmod-clock helper comment ARM: OMAP2+: drop omap_device_register() helper ARM: OMAP2+: add missing of_node_put before break and return Link: https://lore.kernel.org/r/pull-1651061256-836848@atomide.com-3 Signed-off-by: Arnd Bergmann commit b9c92fb4aabb8d93b657d028f7c530d6c42cb630 Merge: c40b62216c1ae 672c0c5173427 Author: Greg Kroah-Hartman Date: Tue May 3 16:35:26 2022 +0200 Merge 5.18-rc5 into usb-next We need the USB fixes in here, and this resolves a merge issue in drivers/usb/dwc3/drd.c Reported-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman commit 630af16eee495f583db5202c3613d1b191f10694 Author: James Clark Date: Wed Mar 9 19:43:13 2022 +0000 perf tools: Use Python devtools for version autodetection rather than runtime This fixes the issue where the build will fail if only the Python2 runtime is installed but the Python3 devtools are installed. Currently the workaround is 'make PYTHON=python3'. Fix it by autodetecting Python based on whether python[x]-config exists rather than just python[x] because both are needed for the build. Then -config is stripped to find the Python runtime. Testing ======= * Auto detect links with Python3 when the v3 devtools are installed and only Python 2 runtime is installed * Auto detect links with Python2 when both devtools are installed * Sensible warning is printed if no Python devtools are installed * 'make PYTHON=x' still automatically sets PYTHON_CONFIG=x-config * 'make PYTHON=x' fails if x-config doesn't exist * 'make PYTHON=python3' overrides Python2 devtools * 'make PYTHON=python2' overrides Python3 devtools * 'make PYTHON_CONFIG=x-config' works * 'make PYTHON=x PYTHON_CONFIG=x' works * 'make PYTHON=missing' reports an error * 'make PYTHON_CONFIG=missing' reports an error Fixes: 79373082fa9de8be ("perf python: Autodetect python3 binary") Signed-off-by: James Clark Cc: Alexander Shishkin Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220309194313.3350126-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 570c44a01b47f308405c9b04b7d055640be725e5 Author: Ian Rogers Date: Mon May 2 21:17:54 2022 -0700 perf stat: Avoid printing cpus with no counters perf_evlist's user_requested_cpus can contain CPUs not present in any evsel's cpus, for example uncore counters. Avoid printing the prefix and trailing \n until the first valid counter is encountered. Reviewed-by: Adrian Hunter Signed-off-by: Ian Rogers Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Link: http://lore.kernel.org/lkml/20220503041757.2365696-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d7442505de9259f8b975232470378d399c25b2fa Author: Thomas Zimmermann Date: Thu Mar 3 21:58:31 2022 +0100 drm/simpledrm: Use fbdev defaults for shadow buffering Don't select shadow buffering for the fbdev console explicitly. The fbdev emulation's heuristic will enable it for any framebuffer with .dirty callback. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220303205839.28484-2-tzimmermann@suse.de commit e2d8b4289c937447ab710052f15a18f686db73dc Author: Thomas Zimmermann Date: Fri Apr 29 12:08:34 2022 +0200 fbdev: Use pageref offset for deferred-I/O writeback Use pageref->offset instead of page->index for deferred-I/O writeback where appropriate. Distinguishes between file-mapping offset and video- memory offset. While at it, also remove unnecessary references to struct page. Fbdev's deferred-I/O code uses the two related page->index and pageref->offset. The former is the page offset in the mapped file, the latter is the byte offset in the video memory (or fbdev screen buffer). It's the same value for fbdev drivers, but for DRM the values can be different. Because GEM buffer objects are mapped at an offset in the DRM device file, page->index has this offset added to it as well. We currently don't hit this case in DRM, because all affected mappings of GEM memory are performed with an internal, intermediate shadow buffer. The value of page->index is required by page_mkclean(), which we call to reset the mappings during the writeback phase of the deferred I/O. The value of pageref->offset is for conveniently getting an offset into video memory in fb helpers. v4: * fix commit message (Javier) Suggested-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-6-tzimmermann@suse.de commit e80eec1b871a2acb8f5c92db4c237e9ae6dd322b Author: Thomas Zimmermann Date: Fri Apr 29 12:08:33 2022 +0200 fbdev: Rename pagelist to pagereflist for deferred I/O Rename various instances of pagelist to pagereflist. The list now stores pageref structures, so the new name is more appropriate. In their write-back helpers, several fbdev drivers refer to the pageref list in struct fb_deferred_io instead of using the one supplied as argument to the function. Convert them over to the supplied one. It's the same instance, so no change of behavior occurs. v4: * fix commit message (Javier) Suggested-by: Sam Ravnborg Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-5-tzimmermann@suse.de commit 3ed3811283ddbc959db564efce6f0988c63bc03c Author: Thomas Zimmermann Date: Fri Apr 29 12:08:32 2022 +0200 fbdev: Refactor implementation of page_mkwrite Refactor the page-write handler for deferred I/O. Drivers use the function to let fbdev track written pages of mmap'ed framebuffer memory. v3: * keep locking within track-pages function for readability (Sam) v2: * don't export the helper until we have an external caller Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-4-tzimmermann@suse.de commit 56c134f7f1b58be08bdb0ca8372474a4a5165f31 Author: Thomas Zimmermann Date: Fri Apr 29 12:08:31 2022 +0200 fbdev: Track deferred-I/O pages in pageref struct Store the per-page state for fbdev's deferred I/O in struct fb_deferred_io_pageref. Maintain a list of pagerefs for the pages that have to be written back to video memory. Update all affected drivers. As with pages before, fbdev acquires a pageref when an mmaped page of the framebuffer is being written to. It holds the pageref in a list of all currently written pagerefs until it flushes the written pages to video memory. Writeback occurs periodically. After writeback fbdev releases all pagerefs and builds up a new dirty list until the next writeback occurs. Using pagerefs has a number of benefits. For pages of the framebuffer, the deferred I/O code used struct page.lru as an entry into the list of dirty pages. The lru field is owned by the page cache, which makes deferred I/O incompatible with some memory pages (e.g., most notably DRM's GEM SHMEM allocator). struct fb_deferred_io_pageref now provides an entry into a list of dirty framebuffer pages, freeing lru for use with the page cache. Drivers also assumed that struct page.index is the page offset into the framebuffer. This is not true for DRM buffers, which are located at various offset within a mapped area. struct fb_deferred_io_pageref explicitly stores an offset into the framebuffer. struct page.index is now only the page offset into the mapped area. These changes will allow DRM to use fbdev deferred I/O without an intermediate shadow buffer. v3: * use pageref->offset for sorting * fix grammar in comment v2: * minor fixes in commit message Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-3-tzimmermann@suse.de commit 5905585103276b7c14bb9a7de4b575216cb6dac4 Author: Thomas Zimmermann Date: Fri Apr 29 12:08:30 2022 +0200 fbdev: Put mmap for deferred I/O into drivers The fbdev mmap function fb_mmap() unconditionally overrides the driver's implementation if deferred I/O has been activated. This makes it hard to implement mmap with anything but a vmalloc()'ed software buffer. That is specifically a problem for DRM, where video memory is maintained by a memory manager. Leave the mmap handling to drivers and expect them to call the helper for deferred I/O by thmeselves. v4: * unlock mm_lock in fb_mmap() error path (Dan) v3: * fix warning if fb_mmap is missing (kernel test robot) v2: * print a helpful error message if the defio setup is incorrect (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220429100834.18898-2-tzimmermann@suse.de commit 594e9c04b5864b4b8b151ef4ba9521c59e0f5c54 Author: KuoHsiang Chou Date: Thu Apr 28 15:56:03 2022 +0800 drm/ast: Create the driver for ASPEED proprietory Display-Port V1: 1. The MCU FW controling ASPEED DP is loaded by BMC boot loader. 2. Driver starts after CR[3:1] == 111b that indicates Tx is ASTDP, and CRD1[5] has been asserted by BMVC boot loader. 3. EDID is prioritized by DP monitor. 4. DP's EDID has high priority to decide resolution supporting. V2: Modules description: 1. ASTDP (ASPEED DisplayPort) is controlled by dedicated AST-MCU (ASPEED propriatary MCU). 2. MCU is looping in charged of HPD, Read EDID, Link Training with DP sink. 3. ASTDP and AST-MUC reside in BMC (Baseboard Management controller) addressing-space. 4. ASPEED DRM driver requests MCU to get HPD and EDID by CR-scratched register. Booting sequence: 1. Check if TX is ASTDP // ast_dp_launch() 2. Check if DP-MCU FW has loaded // ast_dp_launch() 3. Read EDID // ast_dp_read_edid() 4. Resolution switch // ast_dp_SetOutput() V3: 1. Remove unneeded semicolon. 2. Apply to git://anongit.freedesktop.org/drm/drm, instead of git://anongit.freedesktop.org/drm/drm-misc 3. Resolve auto build test WARNINGs on V1 patch. V4: 1. Sync code-base with kernel 5.17_rc6 2. Remove the define of DPControlPower, because DP chips need to be powered on to be used. 3. Remove the switches of PHY and Display from EDID procedure. 4. Revise increaing delay to fixed delay, because this version kernel doesn't detect minitor consistenntly. 5. Create clean-up code used for reset of power state on errors with -EIO manner. 6. Revise the DP detection by TX type and its DP-FW status during booting and resume. 7. Correct the CamelCase Style. 8. Use register reading while needing, and remove to hold full register. 9. Instead of 'u8', revise to 'bool' on swwitch of PHY and video. 10.Correct typo 11.Remove the duplicated copy of TX definition. 12.Use EDID_LENGTH as the constant of 128. Signed-off-by: KuoHsiang Chou Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220428075603.20904-1-kuohsiang_chou@aspeedtech.com commit 85fbe08e4da862dc64fc10071c4a03e51b6361d0 Author: Raghavendra Rao Ananta Date: Mon May 2 23:38:45 2022 +0000 KVM: arm64: Factor out firmware register handling from psci.c Common hypercall firmware register handing is currently employed by psci.c. Since the upcoming patches add more of these registers, it's better to move the generic handling to hypercall.c for a cleaner presentation. While we are at it, collect all the firmware registers under fw_reg_ids[] to help implement kvm_arm_get_fw_num_regs() and kvm_arm_copy_fw_reg_indices() in a generic way. Also, define KVM_REG_FEATURE_LEVEL_MASK using a GENMASK instead. No functional change intended. Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Oliver Upton Reviewed-by: Gavin Shan [maz: fixed KVM_REG_FEATURE_LEVEL_MASK] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220502233853.1233742-2-rananta@google.com commit 57012d79fefd56499da681ecd0f94642e8b59992 Author: Fabien Dessenne Date: Tue May 3 11:41:33 2022 +0200 ARM: dts: stm32: add UserPA13 button on stm32mp135f-dk The PA13 user button is connected to the PA13 pin of the stm32mp135f-dk board. It requires an internal pull-up configuration. Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue commit fd91c36fd349f5117cf51c1c9b75f60ac5a7a4fe Author: Fabien Dessenne Date: Tue May 3 11:41:24 2022 +0200 ARM: dts: stm32: add blue led (Linux heartbeat) on stm32mp135f-dk The blue led (Linux heartbeat) is connected to the PA14 pin of the stm32mp135f-dk board. Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue commit 6e82a968b77c7f16a33173485eff2e9a6ae0c6d1 Author: Fabien Dessenne Date: Tue May 3 11:06:21 2022 +0200 ARM: dts: stm32: add EXTI interrupt-parent to pinctrl node on stm32mp131 Add interrupt-parent property in pinctrl node to use GPIO as IRQ. Signed-off-by: Amelie Delaunay Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue commit 07768c55f9c2ad64ccae3ed82447a87d8af8a687 Author: Ard Biesheuvel Date: Sat Mar 19 19:00:20 2022 +0100 efi/arm64: libstub: run image in place if randomized by the loader If the loader has already placed the EFI kernel image randomly in physical memory, and indicates having done so by installing the 'fixed placement' protocol onto the image handle, don't bother randomizing the placement again in the EFI stub. Signed-off-by: Ard Biesheuvel commit 416a9f84a77cf826fed1bf9a1908b2d066c17430 Author: Ard Biesheuvel Date: Sat Mar 19 18:35:53 2022 +0100 efi: libstub: pass image handle to handle_kernel_image() In a future patch, arm64's implementation of handle_kernel_image() will omit randomizing the placement of the kernel if the load address was chosen randomly by the loader. In order to do this, it needs to locate a protocol on the image handle, so pass it to handle_kernel_image(). Signed-off-by: Ard Biesheuvel commit 24b72bb12e84c75e297a5a81f24b921d7a011575 Author: Peter Jones Date: Tue Mar 29 14:47:43 2022 -0400 efi: x86: Set the NX-compatibility flag in the PE header Following Baskov Evgeniy's "Handle UEFI NX-restricted page tables" patches, it's safe to set this compatibility flag to let loaders know they don't need to make special accommodations for kernel to load if pre-boot NX is enabled. Signed-off-by: Peter Jones Link: https://lore.kernel.org/all/20220329184743.798513-1-pjones@redhat.com/ Signed-off-by: Ard Biesheuvel commit 82e0d6d76a2a74bd6a31141d555d53b4cc22c2a3 Author: Baskov Evgeniy Date: Thu Mar 3 17:21:20 2022 +0300 efi: libstub: ensure allocated memory to be executable There are UEFI versions that restrict execution of memory regions, preventing the kernel from booting. Parts that needs to be executable are: * Area used for trampoline placement. * All memory regions that the kernel may be relocated before and during extraction. Use DXE services to ensure aforementioned address ranges to be executable. Only modify attributes that does not have appropriate attributes. Signed-off-by: Baskov Evgeniy Link: https://lore.kernel.org/r/20220303142120.1975-3-baskov@ispras.ru Signed-off-by: Ard Biesheuvel commit 3ba75c1316390b2bc39c19cb8f0f85922ab3f9ed Author: Baskov Evgeniy Date: Thu Mar 3 17:21:19 2022 +0300 efi: libstub: declare DXE services table UEFI DXE services are not yet used in kernel code but are required to manipulate page table memory protection flags. Add required declarations to use DXE services functions. Signed-off-by: Baskov Evgeniy Link: https://lore.kernel.org/r/20220303142120.1975-2-baskov@ispras.ru [ardb: ignore absent DXE table but warn if the signature check fails] Signed-off-by: Ard Biesheuvel commit 87f5bc6deac444c67ecdbf91b8094e874ae67d90 Merge: 8b86fc3343f35 e8662d0832431 Author: Arnd Bergmann Date: Tue May 3 15:29:13 2022 +0200 Merge tag 'amlogic-arm-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM DT changes for v5.19: - align SPI NOR node name with dtschema * tag 'amlogic-arm-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: dts: meson: align SPI NOR node name with dtschema Link: https://lore.kernel.org/r/fbd7cbe7-1fe9-7009-37d6-c01b15c93032@baylibre.com Signed-off-by: Arnd Bergmann commit 8b86fc3343f35b095ade9031bbc7130517749649 Merge: 97736c2ef6705 456733feb0da2 Author: Arnd Bergmann Date: Tue May 3 15:27:58 2022 +0200 Merge tag 'amlogic-arm64-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM64 DT changes for v5.19: - DTS makefile alpsa sort - align SPI NOR node name with dtschema - add support for S4 power domain, gpio_intc, pinctrl - updates and fixes for JetHub D1/H1 boards * tag 'amlogic-arm64-dt-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson: alpa sort the board Makefile arm64: dts: meson: align SPI NOR node name with dtschema arm64: dts: add support for S4 power domain controller arm64: dts: meson-s4: add gpio_intc node arm64: dts: meson-s4: add pinctrl node arm64: meson: update WiFi SDIO in dts for JetHub D1 arm64: meson: update SDIO voltage in dts for JetHub D1 arm64: meson: dts: update serial alias in dts for JetHub D1 arm64: meson: add dts bluetooth node for JetHub H1 Link: https://lore.kernel.org/r/1e5179ab-2d92-0d64-c57b-e002ec2f0806@baylibre.com Signed-off-by: Arnd Bergmann commit 97736c2ef6705a2f1df7381604202ab18de2890f Merge: cbc842c2f2175 49148f4c39f04 Author: Arnd Bergmann Date: Tue May 3 15:27:33 2022 +0200 Merge tag 'ux500-dts-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt Ux500 DTS updates for the v5.19 kernel cycle: - New devicetree for Codina TMO (SGH-T599). - Add the Amastaos proximity sensor to the Codina. - Add line impedance per machine to the Fuel Gauge nodes. - Add GPS to Janice, Skomer and Codina. - Add NFC to the Codina for GT-I8160P. - Some janitorial like clock names. * tag 'ux500-dts-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ux500: Add GPS to the Codina ARM: dts: ux500: Add NFC to the Codina ARM: dts: ux500: Add GPS to Skomer device tree ARM: dts: ux500: Add GPS to Janice device tree ARM: dts: ux500: Add line impedance to fuel gauge ARM: dts: ux500: Register Amstaos proximity sensor ARM: dts: ux500: Add Codina TMO device tree dt-bindings: arm: ux500: Document Codina-TMO ARM: dts: ste-dbx: Update spi clock-names property Link: https://lore.kernel.org/r/CACRpkdYngWscqak5phKm58O2GF0RmVETgwW4NCKTBiASdaEcyg@mail.gmail.com Signed-off-by: Arnd Bergmann commit cbc842c2f217550b6bc67c7145b6fe8a55d6815e Merge: 3908ca6624166 dff844e1fe17e Author: Arnd Bergmann Date: Tue May 3 15:26:13 2022 +0200 Merge tag 'omap-for-v5.19/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Devicetree changes for omaps Devicetree changes for omaps: - A series of changes to fix devicetree binding check warnings for omaps the the use of clock-output-names and clksel bindings - Update Ethernet node names for omaps - Pinctrl updates for logicpd-som-lv - A series of updates for am335x-guardian - Regulator range update for am335x-baltos Note that this branch is based on a upstream IOMMU fix as it's needed for booting on some SoCs. * tag 'omap-for-v5.19/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (29 commits) ARM: dts: am335x-baltos: update MPU regulator range ARM: dts: am335x: Guardian: Update comments ARM: dts: am335x: Guardian: Add gpio line manes ARM: dts: am335x: Guardian: Update interface pinmux ARM: dts: am335x: Guardian: Disable DMA property of USB1 ARM: dts: am335x: Guardian: Enable UART port two ARM: dts: am335x: Guardian: Update backlight parameter ARM: dts: am335x: Guardian: Add lcd port ARM: dts: am335x: Guardian: Update regulator node name ARM: dts: am335x: Guardian: Update beeper label ARM: dts: am335x: Guardian: Update life led ARM: dts: am335x: Guardian: Remove mmc status led ARM: dts: am335x: Guardian: Disable poweroff support from RTC ARM: dts: am335x: Guardian: Add keypad ARM: dts: am335x: Guardian: Rename power button label ARM: dts: am335x: Guardian: Update NAND partition table ARM: dts: logicpd-som-lv: Move pinmuxing to peripheral nodes ARM: dts: omap3/4/5: fix ethernet node name for different OMAP boards ARM: dts: Drop custom clkctrl compatible and update omap5 l4per ARM: dts: Add clock-output-names for omap5 ... Link: https://lore.kernel.org/r/pull-1650961799-428630@atomide.com-2 Signed-off-by: Arnd Bergmann commit 3908ca6624166c2569d126683830cb9ab5f8db86 Merge: fafb0343aa6d6 fc3d39d5758dc Author: Arnd Bergmann Date: Tue May 3 15:25:36 2022 +0200 Merge tag 'bindings-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Clock binding updates for omaps Minor clock binding changes to document clock-output-names usage for omaps so we can fix lots of related dt bindings check warnings. The related driver changes already got merged for v5.18. * tag 'bindings-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: dt-bindings: clock: ti: Add clock-output-names for TI composite clocks dt-bindings: clock: ti: Add clock-output-names for clockctrl dt-bindings: omap: Add clock-output-names and #clock-cells Link: https://lore.kernel.org/r/pull-1650961799-428630@atomide.com Signed-off-by: Arnd Bergmann commit fafb0343aa6d6d71b0a3b184a0ca555a13549586 Merge: 70a89009f723f 05d39fc06cee5 Author: Arnd Bergmann Date: Tue May 3 15:25:04 2022 +0200 Merge tag 'renesas-dt-bindings-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.19 - Document support for the new RZ/G2UL SoC and the RZ/G2UL SMARC EVK development board. * tag 'renesas-dt-bindings-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: arm: renesas: Document Renesas RZ/G2UL SMARC EVK dt-bindings: power: renesas,rzg2l-sysc: Document RZ/G2UL SoC Link: https://lore.kernel.org/r/cover.1650638516.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 70a89009f723ff72ab923ae6f7581ad9e95618c3 Merge: 9c099a379c889 aa70cbda745d5 Author: Arnd Bergmann Date: Tue May 3 15:24:08 2022 +0200 Merge tag 'renesas-arm-dt-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.19 - ADC, SDHI, CAN-FD, I2C, QSPI, timer, watchdog, sound, USB, SPI, GPU, cpufreq, and thermal support for the RZ/V2L SoC, and the RZ/V2L SMARC EVK development board, - USB, I2C, Audio, NOR Flash, timer, SPI support for RZ/G2LC SMARC EVK development board, - Can-FD support for the R-Car M30W+ and V3U SoCs, and the Falcon development board, - I2C and GPIO support for the R-Car S4-8 SoC, - I2C EEPROM support for the Falcon development board, - SPI Multi I/O Bus Controller (RPC-IF) support for the R-Car H3, M3-W(+), M3-N, E3, and D3 SoCs, - RPC HyperFlash support for the Draak, Ebisu, Salvator-X(S), and ULCB development boards, - Initial support (UART, DMAC, pin control, SDHI, eMMC, Ethernet) for the RZ/G2UL SoC, and the RZ/G2UL SMARC EVK development board, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (55 commits) ARM: dts: r9a06g032: Drop "arm,cortex-a7-timer" from timer node arm64: dts: renesas: r8a779f0: Add GPIO nodes arm64: dts: renesas: rzg2ul-smarc-som: Enable Ethernet on SMARC platform arm64: dts: renesas: rzg2ul-smarc-som: Enable eMMC on SMARC platform arm64: dts: renesas: rzg2ul-smarc: Enable microSD on SMARC platform arm64: dts: renesas: r9a07g043: Add GbEthernet nodes arm64: dts: renesas: r9a07g043: Add SDHI nodes arm64: dts: renesas: rzg2ul-smarc: Add scif0 and audio clk pins arm64: dts: renesas: r9a07g043: Fillup the pinctrl stub node arm64: dts: renesas: Add initial device tree for RZ/G2UL Type-1 SMARC EVK arm64: dts: renesas: Add initial DTSI for RZ/G2UL SoC arm64: dts: renesas: rzg2l-smarc: Move gpios property of vccq_sdhi1 from common dtsi arm64: dts: renesas: rzg2lc-smarc: Enable RSPI1 on carrier board arm64: dts: renesas: ulcb: Add RPC HyperFlash device node arm64: dts: renesas: salvator-common: Add RPC HyperFlash device node arm64: dts: renesas: ebisu: Add RPC HyperFlash device node arm64: dts: renesas: draak: Add RPC HyperFlash device node arm64: dts: renesas: rcar-gen3: Add RPC device nodes arm64: dts: renesas: rcar-gen4: Add interrupt properties to watchdog nodes arm64: dts: renesas: rzg2: Add interrupt properties to watchdog nodes ... Link: https://lore.kernel.org/r/cover.1650638505.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit c7f8852d4216f7dc061f0bc02dda5af396048861 Author: Cristian Marussi Date: Tue May 3 13:10:47 2022 +0100 firmware: arm_scmi: Fix late checks on pointer dereference A few dereferences could happen before the iterator pointer argument was checked for NULL, causing the following smatch warnings: drivers/firmware/arm_scmi/driver.c:1214 scmi_iterator_run() warn: variable dereferenced before check 'i' (see line 1210) Fix by moving the checks early and dropping some unneeded local references. No functional change. Link: https://lore.kernel.org/r/20220503121047.3590340-1-cristian.marussi@arm.com Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 4d7b3fd9f38f17093ac1779368a361e407d9fcf3 Merge: 447455690fb71 b6cd9be3d2882 Author: Arnd Bergmann Date: Tue May 3 15:09:08 2022 +0200 Merge tag 'omap-for-v5.19/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/drivers Driver changes for omaps One patch to remove commas from sentinels for ti-sysc. * tag 'omap-for-v5.19/ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: bus: ti-sysc: Drop commas after SoC match table sentinels commit 6370b04f24bc10c1f2056c0f12dd651ac0121a6f Author: Bagas Sanjaya Date: Mon May 2 12:14:56 2022 +0700 firmware_loader: describe 'module' parameter of firmware_upload_register() Stephen Rothwell reported kernel-doc warning: drivers/base/firmware_loader/sysfs_upload.c:285: warning: Function parameter or member 'module' not described in 'firmware_upload_register' Fix the warning by describing the 'module' parameter. Link: https://lore.kernel.org/linux-next/20220502083658.266d55f8@canb.auug.org.au/ Fixes: 97730bbb242cde ("firmware_loader: Add firmware-upload support") Reported-by: Stephen Rothwell Cc: Russ Weight Cc: Luis Chamberlain Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Linux Kernel Mailing List Cc: Linux Next Mailing List Reviewed-by: Russ Weight Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220502051456.30741-1-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman commit 447455690fb718f6adfdb9c3ece9df7d5b5a66fc Merge: b8e3d15e7312a 2f89bef90de47 Author: Arnd Bergmann Date: Tue May 3 15:03:28 2022 +0200 Merge tag 'renesas-drivers-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.19 - Initial support for the new RZ/G2UL SoC. * tag 'renesas-drivers-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Identify RZ/G2UL SoC Link: https://lore.kernel.org/r/cover.1650638515.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 2a21f9e6d9a408dbd09a01caf5fff42c2f70fa82 Author: Dave Gerlach Date: Sun May 1 20:32:12 2022 -0700 soc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend Add a debugfs option to allow configurable halting of the wkup_m3 during suspend at the last possible point before low power mode entry. This condition can only be resolved through JTAG and advancing beyond the while loop in a8_lp_ds0_handler [1]. Although this hangs the system it forces the system to remain active once it has been entirely configured for low power mode entry, allowing for register inspection through JTAG to help in debugging transition errors. Halt mode can be set using the enable_off_mode entry under wkup_m3_ipc in the debugfs. [1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/tree/src/pm_services/pm_handlers.c?h=08.02.00.006#n141 Suggested-by: Brad Griffis Signed-off-by: Dave Gerlach [dfustini: add link for a8_lp_ds0_handler() in ti-amx3-cm3-pm-firmware] Signed-off-by: Drew Fustini Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220502033211.1383158-1-dfustini@baylibre.com commit ea082040fe071d2ba1f8f73792743d7ca9fb218e Author: Dave Gerlach Date: Tue Apr 26 13:07:44 2022 -0700 soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling Allow loading of a binary containing i2c scaling sequences to be provided to the wkup_m3 firmware in order to properly scale voltage rails on the PMIC during low power modes like DeepSleep0. Proper binary format is determined by the FW in use. Code expects firmware to have 0x0C57 present as the first two bytes followed by one byte defining offset to sleep sequence followed by one byte defining offset to wake sequence and then lastly both sequences. Each sequence is a series of I2C transfers in the form: u8 length | u8 chip address | u8 byte0/reg address | u8 byte1 | u8 byteN .. The length indicates the number of bytes to transfer, including the register address. The length of each transfer is limited by the I2C buffer size of 32 bytes. Based on previous work by Russ Dill. [dfustini: replace FW_ACTION_HOTPLUG with FW_ACTION_UEVENT] Signed-off-by: Dave Gerlach Signed-off-by: Keerthy [dfustini: add NULL argument to rproc_da_to_va() call] Signed-off-by: Drew Fustini Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220426200741.712842-3-dfustini@baylibre.com commit 1dcbae86ee669bdb0338954cd0136863f5c96c0a Author: Dave Gerlach Date: Thu Apr 14 12:27:24 2022 -0700 soc: ti: wkup_m3_ipc: Add support for IO Isolation AM43xx support isolation of the IOs so that control is taken from the peripheral they are connected to and overridden by values present in the CTRL_CONF_* registers for the pad in the control module. The actual toggling happens from the wkup_m3, so use a DT property from the wkup_m3_ipc node to allow the PM code to communicate the necessity for placing the IOs into isolation to the firmware. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Drew Fustini Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220414192722.2978837-3-dfustini@baylibre.com commit d4c41d32cf8af10e4c0a35a6d4995de253b54df6 Author: Haowen Bai Date: Sun Apr 24 10:05:43 2022 +0800 soc: ti: knav_qmss_queue: Use IS_ERR instead of IS_ERR_OR_NULL when checking knav_queue_open() result As the usage of knav_queue_open(): * Returns a handle to the open hardware queue if successful. Use IS_ERR() * to check the returned value for error codes. It will only return error codes, not null. Signed-off-by: Haowen Bai Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/1650765944-20170-1-git-send-email-baihaowen@meizu.com commit dfc6597eb1e1604575c6e061e1a9be0048d17b2c Author: Biju Das Date: Sun May 1 09:21:50 2022 +0100 spi: dt-bindings: renesas,rspi: Document RZ/G2UL SoC Add RSPI binding documentation for Renesas RZ/G2UL SoC. RSPI block is identical to one found on RZ/A, so no driver changes are required. The fallback compatible string "renesas,rspi-rz" will be used on RZ/G2UL. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220501082150.24662-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 73c1a5153ec8c53100b13bccafbb29cd502ee086 Author: Dan Carpenter Date: Fri Apr 29 20:41:37 2022 +0300 spi: mtk-snfi: preserve dma_mapping_error() error codes Return -ENOMEM of there is a dma mapping error. Do not return success. Fixes: 764f1b748164 ("spi: add driver for MTK SPI NAND Flash Interface") Signed-off-by: Dan Carpenter Reviewed-by: Chuanhong Guo Link: https://lore.kernel.org/r/YmwjUcTKyQNrrn2g@kili Signed-off-by: Mark Brown commit efad535480c1a622ea0a21fd0582587dcdb40b79 Merge: 65462ba7e1ad7 5c81cfb6a60a7 Author: Arnd Bergmann Date: Tue May 3 14:54:17 2022 +0200 Merge tag 'omap-for-v5.19/defconfig-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/defconfig Defconfig changes for omaps Changes to add tlv320aic3x and is176x drivers as loadable modules to omap2plus_defconfig. * tag 'omap-for-v5.19/defconfig-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: omap2plus_defconfig: Enable ISP176x USB driver ARM: omap2plus_defconfig: enable TLV320AIC3X Link: https://lore.kernel.org/r/pull-1651061256-836848@atomide.com-2 Signed-off-by: Arnd Bergmann commit 65462ba7e1ad7e02926cd7cecf90f871c26397b2 Merge: 16a5b26d27be7 dcc1449554ba8 Author: Arnd Bergmann Date: Tue May 3 14:53:52 2022 +0200 Merge tag 'renesas-arm-defconfig-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v5.19 - Enable support for the Renesas RZ/V2L SoC and the Maxim MAX96712 Quad GMSL2 Deserializer in the arm64 defconfig, - Refresh shmobile_defconfig for v5.18-rc1. * tag 'renesas-arm-defconfig-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: defconfig: Refresh for v5.18-rc1 arm64: defconfig: Enable Maxim MAX96712 Quad GMSL2 Deserializer support arm64: defconfig: Enable ARCH_R9A07G054 Link: https://lore.kernel.org/r/cover.1650638503.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 16a5b26d27be7af3e99ca96e268e4ab82e76876b Author: carsten.haitzler@foss.arm.com Date: Wed Apr 27 12:42:00 2022 +0100 arm64: defconfig: Enable modules for arm displays Key devices that support displays on SoCs like the Komeda DRM driver, the older HDLCD were not enabled by default and should be so displays can work out of the box on defconfig. Also Candence I2C support should be enabled so the PHY and thus displays can work too. Signed-off-by: Carsten Haitzler Link: https://lore.kernel.org/r/20220427114200.111904-1-carsten.haitzler@foss.arm.com' Signed-off-by: Arnd Bergmann commit 20078e3bbe6e5adb1a88f03f9609d532d99c690c Author: Rickard x Andersson Date: Fri Apr 29 09:22:11 2022 +0200 regulator: pca9450: Enable DVS control via PMIC_STBY_REQ When DVS is enabled via the devicetree properties "nxp,dvs-run-voltage" and "nxp,dvs-standby-voltage" then also the bit that enables DVS control via PMIC_STBY_REQ pin should be set. Signed-off-by: Rickard x Andersson Link: https://lore.kernel.org/r/20220429072211.24957-5-rickaran@axis.com Signed-off-by: Mark Brown commit 2364a64d0673f5044e6a52cb17d6d60c6f1f8329 Author: Rickard x Andersson Date: Fri Apr 29 09:22:10 2022 +0200 regulator: pca9450: Make warm reset on WDOG_B assertion The default configuration of the PMIC behavior makes the PMIC power cycle most regulators on WDOG_B assertion. This power cycling causes the memory contents of OCRAM to be lost. Some systems neeeds some memory that survives reset and reboot, therefore this patch is created. Signed-off-by: Rickard x Andersson Link: https://lore.kernel.org/r/20220429072211.24957-4-rickaran@axis.com Signed-off-by: Mark Brown commit bd2f5e71454bc84427c4fd67c5ea4881f155ac6e Author: Rickard x Andersson Date: Fri Apr 29 09:22:09 2022 +0200 regulator: Add property for WDOG_B warm reset Make it possible to do warm reset on WDOG_B assertion. Signed-off-by: Rickard x Andersson Link: https://lore.kernel.org/r/20220429072211.24957-3-rickaran@axis.com Signed-off-by: Mark Brown commit 62139f52b7e588d565aa9df81ea0a0548a68b823 Author: Per-Daniel Olsson Date: Fri Apr 29 09:22:08 2022 +0200 regulator: pca9450: Make I2C Level Translator configurable Make the I2C Level Translator included in PCA9450 configurable from devicetree. The reset state is off. By setting nxp,i2c-lt-enable, the I2C Level Translator will be enabled while in STANDBY or RUN state. Signed-off-by: Per-Daniel Olsson Signed-off-by: Rickard x Andersson Link: https://lore.kernel.org/r/20220429072211.24957-2-rickaran@axis.com Signed-off-by: Mark Brown commit e721b161399b30e085faa2f4b930ebeb15df36a7 Author: Per-Daniel Olsson Date: Fri Apr 29 09:22:07 2022 +0200 regulator: Add property for I2C level shifter By setting nxp,i2c-lt-enable the I2C level translator is enabled. Signed-off-by: Per-Daniel Olsson Signed-off-by: Rickard x Andersson Link: https://lore.kernel.org/r/20220429072211.24957-1-rickaran@axis.com Signed-off-by: Mark Brown commit f724c296f2f2cc3f9342b0fc26239635cbed856e Author: Ian Abbott Date: Wed Apr 27 16:34:46 2022 +0100 spi: cadence-quadspi: fix Direct Access Mode disable for SoCFPGA The Cadence QSPI compatible string required for the SoCFPGA platform changed from the default "cdns,qspi-nor" to "intel,socfpga-qspi" with the introduction of an additional quirk in commit 98d948eb8331 ("spi: cadence-quadspi: fix write completion support"). However, that change did not preserve the previously used quirk for this platform. Reinstate the `CQSPI_DISABLE_DAC_MODE` quirk for the SoCFPGA platform. Fixes: 98d948eb8331 ("spi: cadence-quadspi: fix write completion support") Cc: Dinh Nguyen Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20220427153446.10113-1-abbotti@mev.co.uk Signed-off-by: Mark Brown commit 55d2a66cfec6a4196243940f754f5b34dd2106bf Author: Stephen Kitt Date: Sun May 1 19:10:09 2022 +0200 ASoC: tpa6130: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id table is moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220501171009.45060-1-steve@sk2.org Signed-off-by: Mark Brown commit 2b65c1162adeca3684cb68b05bce98bf7d99c315 Author: Lukas Bulwahn Date: Sun Apr 10 16:56:23 2022 +0200 arm: nomadik: drop selecting obsolete CLKSRC_NOMADIK_MTU_SCHED_CLOCK Commit 85b6fcadcf66 ("clocksource/drivers/ux500: Drop Ux500 custom SCHED_CLOCK") removes a sched_clock workaround and its corresponding config CLKSRC_NOMADIK_MTU_SCHED_CLOCK. Since then, selecting CLKSRC_NOMADIK_MTU_SCHED_CLOCK in ./arch/arm/mach-nomadik/Kconfig has no effect and ./scripts/checkkconfigsymbols.py warns: CLKSRC_NOMADIK_MTU_SCHED_CLOCK Referencing files: arch/arm/mach-nomadik/Kconfig Simply drop selecting the obsolete CLKSRC_NOMADIK_MTU_SCHED_CLOCK. Signed-off-by: Lukas Bulwahn Signed-off-by: Linus Walleij Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220410145623.2620380-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 0af2de76a21f24ab09f865da748ef3a63b4c2bd6 Author: Linus Walleij Date: Thu Apr 7 22:45:02 2022 +0200 ARM: config: Refresh IXP4xx config after multiplatform After converting to multiplatform the old IXP4xx defconfig doesn't even activate the ethernet driver anymore, we need to refresh this thoroughly. - Drop options that ARCH_MULTI_V5 selects for us. - Some options moved around because of multiplatform and because generic Kconfig movements. - Drop all MACH_* that do not exist anymore. - Compress the kernel and initramfs with XZ as the memory is often limited for these machines. - Make sure IXP4XX_QMGR and IXP4XX_NPE is selected. - Make sure the MTD_PHYSMAP_IXP4XX is selected and not the old MTD_IXP4XX (will be deleted). - Activate CRYPTO_DEV_IXP4XX - Add some very basic default drivers such as AT24 EEPROMs used in many routers. - Add some kernel configs needed to bring up OpenWrt which is the only userspace for these devices: CGROUPS, DEVTMPFS, INOTIFY_USER, SIGNALFD, TIMERFD, EPOLL, OVERLAY_FS and SQUASHFS. Signed-off-by: Linus Walleij Cc: Arnd Bergmann Cc: Krzysztof Halasa Cc: Imre Kaloz Link: https://lore.kernel.org/r/20220407204502.2470560-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 35a9b000b24d512228d4513dc55f5767b015bc73 Author: Nicolas Frattaroli Date: Wed Apr 27 19:23:11 2022 +0200 ASoC: rk3328: fix disabling mclk on pclk probe failure If preparing/enabling the pclk fails, the probe function should unprepare and disable the previously prepared and enabled mclk, which it doesn't do. This commit rectifies this. Fixes: c32759035ad2 ("ASoC: rockchip: support ACODEC for rk3328") Signed-off-by: Nicolas Frattaroli Reviewed-by: Katsuhiro Suzuki Link: https://lore.kernel.org/r/20220427172310.138638-1-frattaroli.nicolas@gmail.com Signed-off-by: Mark Brown commit c7b92395836c3962eedbe6b4f58f9dfb2b2cc921 Author: Ricard Wanderlof Date: Thu Apr 28 18:46:35 2022 +0200 ASoC: adau1761: Add ADAU1761-as-ADAU1361 compatibility mode During probe, determine if the chip is in fact an ADAU1761 even though an ADAU1361 is specified, and perform additional operations to enable the ADAU1761 to behave as an ADAU1361, i.e. disregarding the DSP and setting up routing and PM transparently. This enables either chip to be mounted when an ADAU1361 is specified. Signed-off-by: Ricard Wanderlof Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204281841290.5574@lnxricardw1.se.axis.com Signed-off-by: Mark Brown commit a962890a5a3cce903ff7c7a19fadee63ed9efdc7 Author: Peter Ujfalusi Date: Wed Apr 27 21:52:21 2022 +0300 ASoC: SOF: ipc3-topology: Correct get_control_data for non bytes payload It is possible to craft a topology where sof_get_control_data() would do out of bounds access because it expects that it is only called when the payload is bytes type. Confusingly it also handles other types of controls, but the payload parsing implementation is only valid for bytes. Fix the code to count the non bytes controls and instead of storing a pointer to sof_abi_hdr in sof_widget_data (which is only valid for bytes), store the pointer to the data itself and add a new member to save the size of the data. In case of non bytes controls we store the pointer to the chanv itself, which is just an array of values at the end. In case of bytes control, drop the wrong cdata->data (wdata[i].pdata) check against NULL since it is incorrect and invalid in this context. The data is pointing to the end of cdata struct, so it should never be null. Reported-by: Sergey Senozhatsky Signed-off-by: Peter Ujfalusi Reviewed-by: Sergey Senozhatsky Tested-by: Sergey Senozhatsky Link: https://lore.kernel.org/r/20220427185221.28928-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4213ff556740bb45e2d9ff0f50d056c4e7dd0921 Author: Mark Brown Date: Thu Apr 28 17:24:44 2022 +0100 ASoC: rt5514: Fix event generation for "DSP Voice Wake Up" control The driver has a custom put function for "DSP Voice Wake Up" which does not generate event notifications on change, instead returning 0. Since we already exit early in the case that there is no change this can be fixed by unconditionally returning 1 at the end of the function. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220428162444.3883147-1-broonie@kernel.org Signed-off-by: Mark Brown commit ad685980469b9f9b99d4d6ea05f4cb8f57cb2234 Author: Mark Brown Date: Thu Apr 28 17:18:32 2022 +0100 ASoC: dapm: Don't fold register value changes into notifications DAPM tracks and reports the value presented to the user from DAPM controls separately to the register value, these may diverge during initialisation or when an autodisable control is in use. When writing DAPM controls we currently report that a change has occurred if either the DAPM value or the value stored in the register has changed, meaning that if the two are out of sync we may appear to report a spurious event to userspace. Since we use this folded in value for nothing other than the value reported to userspace simply drop the folding in of the register change. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220428161833.3690050-1-broonie@kernel.org Signed-off-by: Mark Brown commit a0746cbd0b8224c4c0e4ae59968075cb7c14762a Author: Mark Brown Date: Thu Apr 28 12:32:21 2022 +0100 ASoC: max98090: Fix event generation for custom controls The previous fix for event generation for custom controls compared the value already in the register with the value being written, missing the logic that only applies the value to the register when the control is already enabled. Fix this, compare the value cached in the driver data rather than the register. This should really be an autodisable control rather than open coded. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220428113221.15326-1-broonie@kernel.org Signed-off-by: Mark Brown commit b8e3d15e7312ac2ddc7f30ade96358be91f39e69 Merge: 54711ee4f65d6 854fd9209b208 Author: Arnd Bergmann Date: Tue May 3 14:27:31 2022 +0200 Merge tag 'memory-controller-drv-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.19, part two 1. Cleanup: simplify platform_get_resource() calls by using devm_platform_get_and_ioremap_resource() helper. 2. OMAP: allow building omap-gpmc as module and make it visible (it is not selected by platform anymore). * tag 'memory-controller-drv-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: omap-gpmc: Allow building as a module memory: omap-gpmc: Make OMAP_GPMC config visible and selectable memory: renesas-rpc-if: simplify platform_get_resource_byname() memory: brcmstb_dpfe: simplify platform_get_resource_byname() memory: tegra: mc: simplify platform_get_resource() memory: ti-emif-pm: simplify platform_get_resource() memory: ti-emif: simplify platform_get_resource() memory: emif: simplify platform_get_resource() memory: da8xx-ddrctl: simplify platform_get_resource() Link: https://lore.kernel.org/r/20220503070652.54091-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 6406ac633d8096d5a05e4a82499a4efac2dd18d5 Author: Dipen Patel Date: Fri Apr 22 13:52:12 2022 -0700 Documentation: Add HTE subsystem guide Adding hte document which can help understand various APIs implemented in HTE framework for the HTE producers and the consumers. Signed-off-by: Dipen Patel Signed-off-by: Thierry Reding commit 9913288318aa4acf2c849add1616e9b4df5a7b44 Merge: 6ea6581f12712 5a1bde46f98b8 Author: Paolo Bonzini Date: Tue May 3 07:57:40 2022 -0400 Merge branch 'kvm-amd-pmu-fixes' into HEAD commit 2b7042500cab7952bdbf4fe4a84de8712b418c36 Author: Minghao Chi Date: Mon Apr 18 06:30:59 2022 +0000 soc: ti: pm33xx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Nishanth Menon Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20220418063059.2558074-1-chi.minghao@zte.com.cn commit b9e8a7d950ffed4cdd81e6457cfb8049227da2d1 Author: Dave Gerlach Date: Tue Apr 12 14:21:38 2022 -0500 firmware: ti_sci: Switch transport to polled mode during system suspend During system suspend it is completely valid for devices to invoke TISCI commands during the noirq phase of the suspend path. Specifically this will always be seen for devices that define a power-domains DT property and make use of the ti_sci_pm_domains genpd implementation. The genpd_finish_suspend call will power off devices during the noirq phase, which will invoke TISCI. In order to support this, the ti_sci driver must switch to not use wait_for_completion_timeout during suspend, but instead rely on a manual check for if the completion is not yet done, and proceed only if this is the case. Signed-off-by: Dave Gerlach Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220412192138.31189-1-d-gerlach@ti.com commit 6ea6581f127128a07e18f61ea691a22741a3c714 Merge: c180269d27bfa ba3a6120a4e7e Author: Paolo Bonzini Date: Tue May 3 07:23:08 2022 -0400 Merge branch 'kvm-tdp-mmu-atomicity-fix' into HEAD We are dropping A/D bits (and W bits) in the TDP MMU. Even if mmu_lock is held for write, as volatile SPTEs can be written by other tasks/vCPUs outside of mmu_lock. Attempting to prove that bug exposed another notable goof, which has been lurking for a decade, give or take: KVM treats _all_ MMU-writable SPTEs as volatile, even though KVM never clears WRITABLE outside of MMU lock. As a result, the legacy MMU (and the TDP MMU if not fixed) uses XCHG to update writable SPTEs. The fix does not seem to have an easily-measurable affect on performance; page faults are so slow that wasting even a few hundred cycles is dwarfed by the base cost. commit 23e118a48acf7be223e57d98e98da8ac5a4071ac Author: Dexuan Cui Date: Mon May 2 00:42:55 2022 -0700 PCI: hv: Do not set PCI_COMMAND_MEMORY to reduce VM boot time Currently when the pci-hyperv driver finishes probing and initializing the PCI device, it sets the PCI_COMMAND_MEMORY bit; later when the PCI device is registered to the core PCI subsystem, the core PCI driver's BAR detection and initialization code toggles the bit multiple times, and each toggling of the bit causes the hypervisor to unmap/map the virtual BARs from/to the physical BARs, which can be slow if the BAR sizes are huge, e.g., a Linux VM with 14 GPU devices has to spend more than 3 minutes on BAR detection and initialization, causing a long boot time. Reduce the boot time by not setting the PCI_COMMAND_MEMORY bit when we register the PCI device (there is no need to have it set in the first place). The bit stays off till the PCI device driver calls pci_enable_device(). With this change, the boot time of such a 14-GPU VM is reduced by almost 3 minutes. Link: https://lore.kernel.org/lkml/20220419220007.26550-1-decui@microsoft.com/ Tested-by: Boqun Feng (Microsoft) Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley Acked-by: Lorenzo Pieralisi Cc: Jake Oshins Link: https://lore.kernel.org/r/20220502074255.16901-1-decui@microsoft.com Signed-off-by: Wei Liu commit 6e944f52a225484b87bb343d0ba28165edf04b19 Author: Sascha Hauer Date: Fri Apr 22 09:28:32 2022 +0200 dt-bindings: display: rockchip: dw-hdmi: Make unwedge pinctrl optional None of the upstream device tree files has a "unwedge" pinctrl specified. Make it optional. Signed-off-by: Sascha Hauer Acked-by: Rob Herring Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-16-s.hauer@pengutronix.de commit ca80c4eb4b01a7f1c2f333d0a329937ef9c7f03a Author: Sascha Hauer Date: Fri Apr 22 09:28:26 2022 +0200 drm/rockchip: dw_hdmi: add regulator support The RK3568 has HDMI_TX_AVDD0V9 and HDMI_TX_AVDD_1V8 supply inputs needed for the HDMI port. add support for these to the driver for boards which have them supplied by switchable regulators. Signed-off-by: Sascha Hauer Reviewed-by: Dmitry Osipenko Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-10-s.hauer@pengutronix.de commit 80266ccb864b6443fd0bf54bb17444d2632fad21 Author: Sascha Hauer Date: Fri Apr 22 09:28:27 2022 +0200 dt-bindings: display: rockchip: dw-hdmi: Add regulator support The RK3568 has HDMI_TX_AVDD0V9 and HDMI_TX_AVDD_1V8 supply inputs needed for the HDMI port. Add the binding for these supplies. Signed-off-by: Sascha Hauer Acked-by: Rob Herring Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-11-s.hauer@pengutronix.de commit 28bbb5ffbe32741e65d798070986d212cc11e1bb Author: Sascha Hauer Date: Fri Apr 22 09:28:24 2022 +0200 drm/rockchip: dw_hdmi: add rk3568 support Add a new dw_hdmi_plat_data struct and new compatible for rk3568. Signed-off-by: Benjamin Gaignard Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-8-s.hauer@pengutronix.de commit 77b0693f875d4d916d0518ac0de68d4d0de3934f Author: Benjamin Gaignard Date: Fri Apr 22 09:28:25 2022 +0200 dt-bindings: display: rockchip: dw-hdmi: Add compatible for rk3568 HDMI Define a new compatible for rk3568 HDMI. This version of HDMI hardware block needs two new clocks hclk_vio and hclk to provide phy reference clocks. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-9-s.hauer@pengutronix.de commit 2b68abf933654eb750ba963e46bd9cd2d8677dce Merge: f4f1fd7646203 3a09fae035c87 Author: Paolo Abeni Date: Tue May 3 12:43:41 2022 +0200 Merge tag 'mlx5-updates-2022-05-02' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-05-02 1) Trivial Misc updates to mlx5 driver 2) From Mark Bloch: Flow steering, general steering refactoring/cleaning An issue with flow steering deletion flow (when creating a rule without dests) turned out to be easy to fix but during the fix some issue with the flow steering creation/deletion flows have been found. The following patch series tries to fix long standing issues with flow steering code and hopefully preventing silly future bugs. A) Fix an issue where a proper dest type wasn't assigned. B) Refactor and fix dests enums values, refactor deletion function and do proper bookkeeping of dests. C) Change mlx5_del_flow_rules() to delete rules when there are no no more rules attached associated with an FTE. D) Don't call hard coded deletion function but use the node's defined one. E) Add a WARN_ON() to catch future bugs when an FTE with dests is deleted. * tag 'mlx5-updates-2022-05-02' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: fs, an FTE should have no dests when deleted net/mlx5: fs, call the deletion function of the node net/mlx5: fs, delete the FTE when there are no rules attached to it net/mlx5: fs, do proper bookkeeping for forward destinations net/mlx5: fs, add unused destination type net/mlx5: fs, jump to exit point and don't fall through net/mlx5: fs, refactor software deletion rule net/mlx5: fs, split software and IFC flow destination definitions net/mlx5e: TC, set proper dest type net/mlx5e: Remove unused mlx5e_dcbnl_build_rep_netdev function net/mlx5e: Drop error CQE handling from the XSK RX handler net/mlx5: Print initializing field in case of timeout net/mlx5: Delete redundant default assignment of runtime devlink params net/mlx5: Remove useless kfree net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create ==================== Link: https://lore.kernel.org/r/ Signed-off-by: Paolo Abeni commit c89191ce67efa4e5353db6a67f7287c28e673740 Author: Lai Jiangshan Date: Tue May 3 11:21:07 2022 +0800 x86/entry: Convert SWAPGS to swapgs and remove the definition of SWAPGS XENPV doesn't use swapgs_restore_regs_and_return_to_usermode(), error_entry() and the code between entry_SYSENTER_compat() and entry_SYSENTER_compat_after_hwframe. Change the PV-compatible SWAPGS to the ASM instruction swapgs in these places. Also remove the definition of SWAPGS since no more users. Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220503032107.680190-7-jiangshanlai@gmail.com commit 64cbd0acb58203fb769ed2f4eab526d43e243847 Author: Lai Jiangshan Date: Tue May 3 11:21:06 2022 +0800 x86/entry: Don't call error_entry() for XENPV XENPV guests enter already on the task stack and they can't fault for native_iret() nor native_load_gs_index() since they use their own pvop for IRET and load_gs_index(). A CR3 switch is not needed either. So there is no reason to call error_entry() in XENPV. [ bp: Massage commit message. ] Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220503032107.680190-6-jiangshanlai@gmail.com commit a9e192cd4fc738469448803693c9dc730898b8f1 Author: Alexandru Elisei Date: Tue May 3 06:02:04 2022 +0000 KVM: arm64: Hide AArch32 PMU registers when not available commit 11663111cd49 ("KVM: arm64: Hide PMU registers from userspace when not available") hid the AArch64 PMU registers from userspace and guest when the PMU VCPU feature was not set. Do the same when the PMU registers are accessed by an AArch32 guest. While we're at it, rename the previously unused AA32_ZEROHIGH to AA32_DIRECT to match the behavior of get_access_mask(). Now that KVM emulates ID_DFR0 and hides the PMU from the guest when the feature is not set, it is safe to inject to inject an undefined exception when the PMU is not present, as that corresponds to the architected behaviour. Signed-off-by: Alexandru Elisei [Oliver - Add AA32_DIRECT to match the zero value of the enum] Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-7-oupton@google.com commit c64cc2802a784ecfd25d39945e57e7a147854a5b Author: Lai Jiangshan Date: Thu Apr 21 22:10:51 2022 +0800 x86/entry: Move CLD to the start of the idtentry macro Move it after CLAC. Suggested-by: Peter Zijlstra Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220503032107.680190-5-jiangshanlai@gmail.com commit fd1264c4ca610a99d52c35a37e5551eec442723d Author: Oliver Upton Date: Tue May 3 06:02:03 2022 +0000 KVM: arm64: Start trapping ID registers for 32 bit guests To date KVM has not trapped ID register accesses from AArch32, meaning that guests get an unconstrained view of what hardware supports. This can be a serious problem because we try to base the guest's feature registers on values that are safe system-wide. Furthermore, KVM does not implement the latest ISA in the PMU and Debug architecture, so we constrain these fields to supported values. Since KVM now correctly handles CP15 and CP10 register traps, we no longer need to clear HCR_EL2.TID3 for 32 bit guests and will instead emulate reads with their safe values. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-6-oupton@google.com commit 9369bc5c5e35985f38d04bd98c6d28a032e84b17 Author: Oliver Upton Date: Tue May 3 06:02:02 2022 +0000 KVM: arm64: Plumb cp10 ID traps through the AArch64 sysreg handler In order to enable HCR_EL2.TID3 for AArch32 guests KVM needs to handle traps where ESR_EL2.EC=0x8, which corresponds to an attempted VMRS access from an ID group register. Specifically, the MVFR{0-2} registers are accessed this way from AArch32. Conveniently, these registers are architecturally mapped to MVFR{0-2}_EL1 in AArch64. Furthermore, KVM already handles reads to these aliases in AArch64. Plumb VMRS read traps through to the general AArch64 system register handler. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-5-oupton@google.com commit e65197666773f39e4378161925e5a1c7771cff29 Author: Oliver Upton Date: Tue May 3 06:02:01 2022 +0000 KVM: arm64: Wire up CP15 feature registers to their AArch64 equivalents KVM currently does not trap ID register accesses from an AArch32 EL1. This is painful for a couple of reasons. Certain unimplemented features are visible to AArch32 EL1, as we limit PMU to version 3 and the debug architecture to v8.0. Additionally, we attempt to paper over heterogeneous systems by using register values that are safe system-wide. All this hard work is completely sidestepped because KVM does not set TID3 for AArch32 guests. Fix up handling of CP15 feature registers by simply rerouting to their AArch64 aliases. Punt setting HCR_EL2.TID3 to a later change, as we need to fix up the oddball CP10 feature registers still. Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-4-oupton@google.com commit 28eda7b5e82489b9dcffc630af68c207552b4f4d Author: Oliver Upton Date: Tue May 3 06:02:00 2022 +0000 KVM: arm64: Don't write to Rt unless sys_reg emulation succeeds emulate_sys_reg() returns 1 unconditionally, even though a a system register access can fail. Furthermore, kvm_handle_sys_reg() writes to Rt for every register read, regardless of if it actually succeeded. Though this pattern is safe (as params.regval is initialized with the current value of Rt) it is a bit ugly. Indicate failure if the register access could not be emulated and only write to Rt on success. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-3-oupton@google.com commit 001bb819994cd1bd037b6aefdb233f1720ee2126 Author: Oliver Upton Date: Tue May 3 06:01:59 2022 +0000 KVM: arm64: Return a bool from emulate_cp() KVM indicates success/failure in several ways, but generally an integer is used when conditionally bouncing to userspace is involved. That is not the case from emulate_cp(); just use a bool instead. No functional change intended. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220503060205.2823727-2-oupton@google.com commit f4f1fd7646203d36b844645704636e2208a54268 Merge: cb636b3e372ba 1d267aa8699b5 Author: Paolo Abeni Date: Tue May 3 12:10:51 2022 +0200 Merge branch 'mlxsw-remove-size-limitations-on-egress-descriptor-buffer' Ido Schimmel says: ==================== mlxsw: Remove size limitations on egress descriptor buffer Petr says: Spectrum machines have two resources related to keeping packets in an internal buffer: bytes (allocated in cell-sized units) for packet payload, and descriptors, for keeping headers. Currently, mlxsw only configures the bytes part of the resource management. Spectrum switches permit a full parallel configuration for the descriptor resources, including port-pool and port-TC-pool quotas. By default, these are all configured to use pool 14, with an infinite quota. The ingress pool 14 is then infinite in size. However, egress pool 14 has finite size by default. The size is chip dependent, but always much lower than what the chip actually permits. As a result, we can easily construct workloads that exhaust the configured descriptor limit. Going forward, mlxsw will have to fix this issue properly by maintaining descriptor buffer sizes, TC bindings, and quotas that match the architecture recommendation. Short term, fix the issue by configuring the egress descriptor pool to be infinite in size as well. This will maintain the same configuration philosophy, but will unlock all chip resources to be usable. In this patchset, patch #1 first adds the "desc" field into the pool configuration register. Then in patch #2, the new field is used to configure both ingress and egress pool 14 as infinite. In patches #3 and #4, add a selftest that verifies that a large burst can be absorbed by the shared buffer. This test specifically exercises a scenario where descriptor buffer is the limiting factor and the test fails without the above patches. ==================== Link: https://lore.kernel.org/r/20220502084926.365268-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit 1d267aa8699b5985a297f697c493aadc507711a9 Author: Petr Machata Date: Mon May 2 11:49:26 2022 +0300 selftests: mlxsw: Add a test for soaking up a burst of traffic Add a test that sends 1Gbps of traffic through the switch, into which it then injects a burst of traffic and tests that there are no drops. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni commit 1531cc632d13af2846bd2b533cea1c4aaee8cd90 Author: Petr Machata Date: Mon May 2 11:49:25 2022 +0300 selftests: forwarding: lib: Add start_traffic_pktsize() helpers Add two helpers, start_traffic_pktsize() and start_tcp_traffic_pktsize(), that allow explicit overriding of packet size. Change start_traffic() and start_tcp_traffic() to dispatch through these helpers with the default packet size. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni commit c864769add96f568ac10a6173e5d2c55057d64c2 Author: Petr Machata Date: Mon May 2 11:49:24 2022 +0300 mlxsw: Configure descriptor buffers Spectrum machines have two resources related to keeping packets in an internal buffer: bytes (allocated in cell-sized units) for packet payload, and descriptors, for keeping metadata. Currently, mlxsw only configures the bytes part of the resource management. Spectrum switches permit a full parallel configuration for the descriptor resources, including port-pool and port-TC-pool quotas. By default, these are all configured to use pool 14, with an infinite quota. The ingress pool 14 is then infinite in size. However, egress pool 14 has finite size by default. The size is chip dependent, but always much lower than what the chip actually permits. As a result, we can easily construct workloads that exhaust the configured descriptor limit. Fix the issue by configuring the egress descriptor pool to be infinite in size as well. This will maintain the configuration philosophy of the default configuration, but will unlock all chip resources to be usable. In the code, include both the configuration of ingress and ingress, mostly for clarity. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni commit 135433b30a53f5424c1137fb7be55bf8412b03ac Author: Petr Machata Date: Mon May 2 11:49:23 2022 +0300 mlxsw: reg: Add "desc" field to SBPR SBPR, or Shared Buffer Pools Register, configures and retrieves the shared buffer pools and configuration. The desc field determines whether the configuration relates to the byte pool or the descriptor pool. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni commit b812f646bb818ca0e1806072eb7f0006f3a65dde Merge: a5fc012e6ee75 e954d2c94d007 Author: Maxime Ripard Date: Tue May 3 11:53:42 2022 +0200 Merge drm/drm-next into drm-misc-next Christian needs a backmerge to avoid a merge conflict for amdgpu. Signed-off-by: Maxime Ripard commit ee774dac0da1543376a69fd90840af6aa86879b3 Author: Lai Jiangshan Date: Thu Apr 21 22:10:50 2022 +0800 x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry() The macro idtentry() (through idtentry_body()) calls error_entry() unconditionally even on XENPV. But XENPV needs to only push and clear regs. PUSH_AND_CLEAR_REGS in error_entry() makes the stack not return to its original place when the function returns, which means it is not possible to convert it to a C function. Carve out PUSH_AND_CLEAR_REGS out of error_entry() and into a separate function and call it before error_entry() in order to avoid calling error_entry() on XENPV. It will also allow for error_entry() to be converted to C code that can use inlined sync_regs() and save a function call. [ bp: Massage commit message. ] Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220503032107.680190-4-jiangshanlai@gmail.com commit 520a7e80c96d655fbe4650d9cc985bd9d0443389 Author: Lai Jiangshan Date: Thu Apr 21 22:10:49 2022 +0800 x86/entry: Switch the stack after error_entry() returns error_entry() calls fixup_bad_iret() before sync_regs() if it is a fault from a bad IRET, to copy pt_regs to the kernel stack. It switches to the kernel stack directly after sync_regs(). But error_entry() itself is also a function call, so it has to stash the address it is going to return to, in %r12 which is unnecessarily complicated. Move the stack switching after error_entry() and get rid of the need to handle the return address. [ bp: Massage commit message. ] Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220503032107.680190-3-jiangshanlai@gmail.com commit bd820bc5e77087a71a42c36f2660b8a35d2c01a5 Author: Sascha Hauer Date: Fri Apr 22 09:28:23 2022 +0200 arm64: dts: rockchip: rename HDMI ref clock to 'ref' on rk3399 The reference clock for the HDMI controller has been renamed to 'ref', the previous 'vpll' name is only left for compatibility in the driver. Rename the clock to the new name. Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220422072841.2206452-7-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit a5fc012e6ee75a899173398573e77207542f588a Author: Sascha Hauer Date: Fri Apr 22 09:28:22 2022 +0200 dt-bindings: display: rockchip: dw-hdmi: use "ref" as clock name "vpll" is a misnomer. A clock input to a device should be named after the usage in the device, not after the clock that drives it. On the rk3568 the same clock is driven by the HPLL. This patch adds "ref" as a new alternative clock name for "vpll" Signed-off-by: Sascha Hauer Acked-by: Rob Herring Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-6-s.hauer@pengutronix.de commit a9d37e684492ab5db1cce28b655e20c01191873f Author: Sascha Hauer Date: Fri Apr 22 09:28:21 2022 +0200 drm/rockchip: dw_hdmi: rename vpll clock to reference clock "vpll" is a misnomer. A clock input to a device should be named after the usage in the device, not after the clock that drives it. On the rk3568 the same clock is driven by the HPLL. To fix that, this patch renames the vpll clock to ref clock. The clock name "vpll" is left for compatibility to old device trees. Signed-off-by: Sascha Hauer Reviewed-by: Dmitry Osipenko Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-5-s.hauer@pengutronix.de commit cf544c6a885c52d79e4d8bf139fb8cb63a878512 Author: Sascha Hauer Date: Fri Apr 22 09:28:20 2022 +0200 drm/rockchip: Add crtc_endpoint_id to rockchip_encoder The VOP2 has an interface mux which decides to which encoder(s) a CRTC is routed to. The encoders and CRTCs are connected via of_graphs in the device tree. When given an encoder the VOP2 driver needs to know to which internal register setting this encoder matches. For this the VOP2 binding offers different endpoints, one for each possible encoder. The endpoint ids of these endpoints are used as a key from an encoders device tree description to the internal register setting. This patch adds the key aka endpoint id to struct rockchip_encoder plus a function to read the endpoint id starting from the encoders device node. Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-4-s.hauer@pengutronix.de commit 540b8f271e53362a308f6bf288d38b630cf3fbd2 Author: Sascha Hauer Date: Fri Apr 22 09:28:19 2022 +0200 drm/rockchip: Embed drm_encoder into rockchip_decoder The VOP2 driver needs rockchip specific information for a drm_encoder. This patch creates a struct rockchip_encoder with a struct drm_encoder embedded in it. This is used throughout the rockchip driver instead of struct drm_encoder directly. The information the VOP2 drivers needs is the of_graph endpoint node of the encoder. To ease bisectability this is added here. While at it convert the different encoder-to-driverdata macros to static inline functions in order to gain type safety and readability. Signed-off-by: Sascha Hauer Tested-by: Michael Riesch Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422072841.2206452-3-s.hauer@pengutronix.de commit 0aca53c6b522f8d6e2681ca875acbbe105f5fdcf Author: Lai Jiangshan Date: Thu Apr 21 22:10:48 2022 +0800 x86/traps: Use pt_regs directly in fixup_bad_iret() Always stash the address error_entry() is going to return to, in %r12 and get rid of the void *error_entry_ret; slot in struct bad_iret_stack which was supposed to account for it and pt_regs pushed on the stack. After this, both fixup_bad_iret() and sync_regs() can work on a struct pt_regs pointer directly. [ bp: Rewrite commit message, touch ups. ] Signed-off-by: Lai Jiangshan Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220503032107.680190-2-jiangshanlai@gmail.com commit 6931f85c29d5a0261219cf8a73773d3165806d84 Author: Sascha Hauer Date: Fri Apr 22 09:28:18 2022 +0200 clk: rockchip: Mark hclk_vo as critical on rk3568 Whenever pclk_vo is enabled hclk_vo must be enabled as well. This is described in the Reference Manual as: | 2.8.6 NIU Clock gating reliance | | A part of niu clocks have a dependence on another niu clock in order to | sharing the internal bus. When these clocks are in use, another niu | clock must be opened, and cannot be gated. These clocks and the special | clock on which they are relied are as following: | | Clocks which have dependency The clock which can not be gated | ----------------------------------------------------------------- | ... | pclk_vo_niu, hclk_vo_s_niu hclk_vo_niu | ... The clock framework doesn't offer a way to enable clock B whenever clock A is enabled, at least not when B is not an ancestor of A. Workaround this by marking hclk_vo as critical so it is never disabled. This is suboptimal in terms of power consumption, but a stop gap solution until the clock framework has a way to deal with this. We have this clock tree: | aclk_vo 2 2 0 300000000 0 0 50000 Y | aclk_hdcp 0 0 0 300000000 0 0 50000 N | pclk_vo 2 3 0 75000000 0 0 50000 Y | pclk_edp_ctrl 0 0 0 75000000 0 0 50000 N | pclk_dsitx_1 0 0 0 75000000 0 0 50000 N | pclk_dsitx_0 1 2 0 75000000 0 0 50000 Y | pclk_hdmi_host 1 2 0 75000000 0 0 50000 Y | pclk_hdcp 0 0 0 75000000 0 0 50000 N | hclk_vo 2 5 0 150000000 0 0 50000 Y | hclk_hdcp 0 0 0 150000000 0 0 50000 N | hclk_vop 0 2 0 150000000 0 0 50000 N Without this patch the edp, dsitx, hdmi and hdcp driver would enable their clocks which then enables pclk_vo, but hclk_vo stays disabled and register accesses just hang. hclk_vo is enabled by the VOP2 driver, so reproducibility of this issue depends on the probe order. Signed-off-by: Sascha Hauer Reviewed-by: Dmitry Osipenko Reviewed-by: Robin Murphy Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220422072841.2206452-2-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit cb636b3e372bac984ac54ab7b39bef560bbcf7d5 Merge: 0530a683fc858 57b19468b369c Author: Paolo Abeni Date: Tue May 3 10:15:09 2022 +0200 Merge branch 'use-standard-sysctl-macro' Tonghao Zhang says: ==================== use standard sysctl macro From: Tonghao Zhang This patchset introduce sysctl macro or replace var with macro. ==================== Link: https://lore.kernel.org/r/20220501035524.91205-1-xiangxia.m.yue@gmail.com Signed-off-by: Paolo Abeni commit 57b19468b369c5f70068540d698ea2a5f4598945 Author: Tonghao Zhang Date: Sun May 1 11:55:24 2022 +0800 selftests/sysctl: add sysctl macro test Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Hideaki YOSHIFUJI Cc: David Ahern Cc: Simon Horman Cc: Julian Anastasov Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: Shuah Khan Cc: Andrew Morton Cc: Alexei Starovoitov Cc: Eric Dumazet Cc: Lorenz Bauer Cc: Akhmat Karakotov Signed-off-by: Tonghao Zhang Signed-off-by: Paolo Abeni commit 4c7f24f857c7cd0381dd92495db476066d1c6aec Author: Tonghao Zhang Date: Sun May 1 11:55:23 2022 +0800 net: sysctl: introduce sysctl SYSCTL_THREE This patch introdues the SYSCTL_THREE. KUnit: [00:10:14] ================ sysctl_test (10 subtests) ================= [00:10:14] [PASSED] sysctl_test_api_dointvec_null_tbl_data [00:10:14] [PASSED] sysctl_test_api_dointvec_table_maxlen_unset [00:10:14] [PASSED] sysctl_test_api_dointvec_table_len_is_zero [00:10:14] [PASSED] sysctl_test_api_dointvec_table_read_but_position_set [00:10:14] [PASSED] sysctl_test_dointvec_read_happy_single_positive [00:10:14] [PASSED] sysctl_test_dointvec_read_happy_single_negative [00:10:14] [PASSED] sysctl_test_dointvec_write_happy_single_positive [00:10:14] [PASSED] sysctl_test_dointvec_write_happy_single_negative [00:10:14] [PASSED] sysctl_test_api_dointvec_write_single_less_int_min [00:10:14] [PASSED] sysctl_test_api_dointvec_write_single_greater_int_max [00:10:14] =================== [PASSED] sysctl_test =================== ./run_kselftest.sh -c sysctl ... ok 1 selftests: sysctl: sysctl.sh Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Hideaki YOSHIFUJI Cc: David Ahern Cc: Simon Horman Cc: Julian Anastasov Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: Shuah Khan Cc: Andrew Morton Cc: Alexei Starovoitov Cc: Eric Dumazet Cc: Lorenz Bauer Cc: Akhmat Karakotov Signed-off-by: Tonghao Zhang Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit bd8a53675c0dc1eb05c18899fdb93e100bd7040b Author: Tonghao Zhang Date: Sun May 1 11:55:22 2022 +0800 net: sysctl: use shared sysctl macro This patch replace two, four and long_one to SYSCTL_XXX. Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Hideaki YOSHIFUJI Cc: David Ahern Cc: Simon Horman Cc: Julian Anastasov Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: Shuah Khan Cc: Andrew Morton Cc: Alexei Starovoitov Cc: Eric Dumazet Cc: Lorenz Bauer Cc: Akhmat Karakotov Signed-off-by: Tonghao Zhang Signed-off-by: Paolo Abeni commit 2f661477c2bb8068194dbba9738d05219f111c6e Author: Yang Yingliang Date: Fri Apr 29 16:26:37 2022 +0800 pinctrl: renesas: rzn1: Fix possible null-ptr-deref in sh_pfc_map_resources() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220429082637.1308182-2-yangyingliang@huawei.com Signed-off-by: Geert Uytterhoeven commit 5376e3d904532e657fd7ca1a9b1ff3d351527b90 Author: Yang Yingliang Date: Fri Apr 29 16:26:36 2022 +0800 pinctrl: renesas: core: Fix possible null-ptr-deref in sh_pfc_map_resources() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: c7977ec4a336 ("pinctrl: sh-pfc: Convert to platform_get_*()") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220429082637.1308182-1-yangyingliang@huawei.com Signed-off-by: Geert Uytterhoeven commit 8bdd369dba7ff2f89cfd723ca3a26602aae4e498 Author: Geert Uytterhoeven Date: Fri Apr 22 09:29:31 2022 +0200 pinctrl: renesas: r8a779f0: Fix GPIO function on I2C-capable pins Unlike on R-Car Gen3 SoCs, setting a bit to zero in a GPIO / Peripheral Function Select Register (GPSRn) on R-Car S4-8 is not always sufficient to configure a pin for GPIO. For I2C-capable pins, the I2C function must also be explicitly disabled in the corresponding Module Select Register (MODSELn). Add the missing FN_SEL_I2Ci_0 function enums to the pinmux_data[] array by temporarily overriding the GP_1_j_FN function enum to expand to two enums: the original GP_1_j_FN enum to configure the GPSR register bits, and the missing FN_SEL_I2Ci_0 enum to configure the MODSEL register bits. Fixes: 030ac6d7eeff81e3 ("pinctrl: renesas: Initial R8A779F0 PFC support") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c12c60ec1058140a37f03650043ab73f730f104f.1650610471.git.geert+renesas@glider.be commit 4288caed9a6319b766dc0adf605c7b401180db34 Author: Geert Uytterhoeven Date: Fri Apr 22 09:29:30 2022 +0200 pinctrl: renesas: r8a779a0: Fix GPIO function on I2C-capable pins Unlike on R-Car Gen3 SoCs, setting a bit to zero in a GPIO / Peripheral Function Select Register (GPSRn) on R-Car V3U is not always sufficient to configure a pin for GPIO. For I2C-capable pins, the I2C function must also be explicitly disabled in the corresponding Module Select Register (MODSELn). Add the missing FN_SEL_I2Ci_0 function enums to the pinmux_data[] array by temporarily overriding the GP_2_j_FN function enum to expand to two enums: the original GP_2_j_FN enum to configure the GSPR register bits, and the missing FN_SEL_I2Ci_0 enum to configure the MODSEL register bits. Fixes: 741a7370fc3b8b54 ("pinctrl: renesas: Initial R8A779A0 (V3U) PFC support") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4611e29e7b105513883084c1d6dc39c3ac8b525c.1650610471.git.geert+renesas@glider.be commit 10dcf783f7e986a36ec2d6d07d79360ddd4a2e4f Author: Jani Nikula Date: Mon Apr 25 18:47:54 2022 +0300 drm/i915: remove superfluous string helper include Remove the duplicate and incorrect (uses "" instead of <>) linux/string_helpers.h include. Fixes: cc1338f259a2 ("drm/i915/xehp: Update topology dumps for Xe_HP") Cc: Matt Roper Cc: Lucas De Marchi Signed-off-by: Jani Nikula Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220425154754.990815-1-jani.nikula@intel.com commit e4edfeaf6b585fac340071ea9845970ab528c6ce Author: Krzysztof Kozlowski Date: Tue May 3 08:52:01 2022 +0200 ARM: dts: dm81xx: use new 'dma-channels/requests' properties The '#dma-channels' and '#dma-requests' properties were deprecated in favor of these defined by generic dma-common DT bindings. Add new properties while keeping old ones for backwards compatibility. Signed-off-by: Krzysztof Kozlowski Message-Id: <20220503065201.51818-7-krzysztof.kozlowski@linaro.org> Signed-off-by: Tony Lindgren commit f960b54b6f195817f5a9c62257edfd602f026725 Author: Krzysztof Kozlowski Date: Tue May 3 08:51:59 2022 +0200 ARM: dts: am33xx: use new 'dma-channels/requests' properties The '#dma-channels' and '#dma-requests' properties were deprecated in favor of these defined by generic dma-common DT bindings. Add new properties while keeping old ones for backwards compatibility. Signed-off-by: Krzysztof Kozlowski Message-Id: <20220503065201.51818-5-krzysztof.kozlowski@linaro.org> Signed-off-by: Tony Lindgren commit 29a5f5f0b08af1bac5c3d2c0948ed7f56ba4d255 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL1_EMU clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit c22a3d8cad504f18efb437a6998f8948e7dc992f Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL_PER clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit cab3db1b8d15a4daccda72f94397192bc6e4d298 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_ICLKEN_PER clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit b508079bf2dca43995eb2cfa2aef5a4e7d82d2e6 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_FCLKEN_PER clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 32169e7ef4be5cb3af7c2c32fde9e07171b4c80b Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_FCLKEN_CAM clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 2d09a2a9d13163b9b401cc0d88c1166c6dd18b1c Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL_DSS clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 89953638a83cb5b55193f720653de931fa92347c Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_FCLKEN_DSS clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 0019a9543a71995304bf2c2aa493d8242f387587 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKOUT_CTRL clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 173e215b7f8632c62db2dc713e51a998038bb8ac Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL1_PLL clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 2f7c426df6f63447a65af770a07539051bc8c868 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL_WKUP clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 23347c90e2329b88fab5b8fad6bfe94471ca1514 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_ICLKEN_WKUP clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 05891b43bee70e026bcf11028936cabd3cc1eb08 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_FCLKEN_WKUP clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit b0985e02787759d99a8e921215b6dee0a2980c8c Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_CLKSEL_CORE clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 4e28ab96e311e4cf07f064f3bbe78e92ef013b15 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_ICLKEN3_CORE clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit eea4b03528410bc893b031860885e25e4f856bf3 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_ICLKEN1_CORE clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit aeb4dcf2c2bf0f8b0ae354ea37cf55fd0e17de65 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 crypto accelerator clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 3408a95f213e71fae8a9530872ecd2a77be78926 Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CM_FCLKEN1_CORE clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 1e7079d32e6ae9ec8caae2a4e7d9696b97307b7a Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CONTROL_DEVCONF1 clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 24a3db53ec9cac80b71e14b3c489b98e7537cdae Author: Tony Lindgren Date: Fri Apr 29 09:57:36 2022 +0300 ARM: dts: Group omap3 CONTROL_DEVCONF0 clocks The clksel related registers on omap3 cause unique_unit_address and node_name_chars_strict warnings with the W=1 or W=2 make flags enabled. With the clock drivers updated, we can now avoid most of these warnings by grouping the TI component clocks using the TI clksel binding, and with the use of clock-output-names property to avoid non-standard node names for the clocks. Signed-off-by: Tony Lindgren commit 392ab2e2af060962ee1e37a5e2aa358f878a8f77 Author: Dave Gerlach Date: Sun May 1 19:15:09 2022 -0700 ARM: dts: am43xx: Add i2c voltage scaling firmware to wkup_m3_ipc Add appropriate firmware-name property for all am43xx platforms. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy [dfustini: change property from 'ti,scale-data-fw' to 'firmware-name'] Signed-off-by: Drew Fustini Message-Id: <20220502021508.1342869-4-dfustini@baylibre.com> Signed-off-by: Tony Lindgren commit d480ecc9752d2b5a46f6f590e5853337bf4754f6 Author: Dave Gerlach Date: Sun May 1 19:15:08 2022 -0700 ARM: dts: am33xx: Add i2c voltage scaling firmware to wkup_m3_ipc Add appropriate firmware-name property for all am33xx platforms. Signed-off-by: Dave Gerlach [dfustini: change property from 'ti,scale-data-fw' to 'firmware-name'] Signed-off-by: Drew Fustini Message-Id: <20220502021508.1342869-3-dfustini@baylibre.com> Signed-off-by: Tony Lindgren commit e348101bbaed4a0263ccc37e9b6c68f686465588 Author: Dave Gerlach Date: Sun May 1 19:15:07 2022 -0700 ARM: dts: am437x-gp-evm: Enable wkup_m3 control of IO isolation With this flag wkup_m3 is able to control IO isolation during suspend on the board. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy Signed-off-by: Drew Fustini Message-Id: <20220502021508.1342869-2-dfustini@baylibre.com> Signed-off-by: Tony Lindgren commit e954d2c94d007afe487044ecfa48f2518643df0e Merge: 15e2b419a8377 672c0c5173427 Author: Dave Airlie Date: Tue May 3 16:08:48 2022 +1000 Backmerge tag 'v5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next Linux 5.18-rc5 There was a build fix for arm I wanted in drm-next, so backmerge rather then cherry-pick. Signed-off-by: Dave Airlie commit c9bc1a0ef9f613a7bc1adfff4c67dc5e5d7d1709 Author: Dustin L. Howett Date: Thu Feb 17 10:59:30 2022 -0600 platform/chrome: cros_ec_lpcs: reserve the MEC LPC I/O ports first Some ChromeOS EC devices (such as the Framework Laptop) only map I/O ports 0x800-0x807. Making the larger reservation required by the non-MEC LPC (the 0xFF ports for the memory map, and the 0xFF ports for the parameter region) is non-viable on these devices. Since we probe the MEC EC first, we can get away with a smaller reservation that covers the MEC EC ports. If we fall back to classic LPC, we can grow the reservation to cover the memory map and the parameter region. cros_ec_lpc_probe also interacted with I/O ports 0x800-0x807 without a reservation. Restructuring the code to request the MEC LPC region first obviates the need to do so. Signed-off-by: Dustin L. Howett Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220217165930.15081-3-dustin@howett.net commit 6a5d778edaa39dfa07a61d487a70f2deb1017c0f Author: Dustin L. Howett Date: Thu Feb 17 10:59:29 2022 -0600 platform/chrome: cros_ec_lpcs: detect the Framework Laptop The Framework Laptop identifies itself in DMI with manufacturer "Framework" and product "Laptop". Signed-off-by: Dustin L. Howett Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220217165930.15081-2-dustin@howett.net commit f39af96d352dd4f36a4a43601ea90561e17e5ca6 Merge: da4cea16cb134 54a6f29522da3 Author: Kalle Valo Date: Tue May 3 08:38:03 2022 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.19. Major changes: ath11k * support setting Specific Absorption Rate (SAR) for WCN6855 * read country code from SMBIOS for WCN6855/QCA6390 * support for WCN6750 commit da4cea16cb1340576459e1a703cae4084f9e6514 Author: Ping-Ke Shih Date: Tue May 3 07:54:08 2022 +0800 rtw89: 8852c: 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. 8852c needs two backup buffers, so we enlarge the array. But, 8852a still needs only one, so it only uses first element (index zero). Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220502235408.15052-9-pkshih@realtek.com commit 2da8109d9885395b2439d8460cc7f616a9ccb3a8 Author: Ping-Ke Shih Date: Tue May 3 07:54:07 2022 +0800 rtw89: 8852c: 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/20220502235408.15052-8-pkshih@realtek.com commit ac91be9756168c7834ffb2ab5692c1dfbf2e957a Author: Ping-Ke Shih Date: Tue May 3 07:54:06 2022 +0800 rtw89: 8852c: rfk: add RX DCK RX DCK is receiver DC calibration. 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/20220502235408.15052-7-pkshih@realtek.com commit 30052c5a1c997da1c2523336b59d9a5eeb1905c9 Author: Ping-Ke Shih Date: Tue May 3 07:54:05 2022 +0800 rtw89: 8852c: rfk: add RCK RCK is synchronize RC calibration. It needs to be triggered only once when interface is going to up. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220502235408.15052-6-pkshih@realtek.com commit e5efc4d55c20beea57683b3c94f0e1c4e254c9c9 Author: Ping-Ke Shih Date: Tue May 3 07:54:04 2022 +0800 rtw89: 8852c: 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/20220502235408.15052-5-pkshih@realtek.com commit fb8177d729f2c1f772128441adc80962d7e6ee85 Author: Ping-Ke Shih Date: Tue May 3 07:54:03 2022 +0800 rtw89: 8852c: rfk: add LCK LCK is short fro LC Tank calibration. Do this calibration once driver loads RF parameters table. Since the characteristic can be changed by temperature, we do this calibration again 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/20220502235408.15052-4-pkshih@realtek.com commit 76599a8d0b7d23b990d03dc5a0ceb450afd18391 Author: Ping-Ke Shih Date: Tue May 3 07:54:02 2022 +0800 rtw89: 8852c: rfk: add DACK DACK (digital-to-analog converters calibration) is used to calibrate DAC to output analog signals as expected. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220502235408.15052-3-pkshih@realtek.com commit ec424639d41b82aee16282b47091f95ee42e1767 Author: Ping-Ke Shih Date: Tue May 3 07:54:01 2022 +0800 rtw89: 8852c: rfk: add RFK tables These tables are used by RFK (RF calibration) to set parameters. These parameters can trigger certain calibration, or configure/reset settings before and after RF calibrations. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220502235408.15052-2-pkshih@realtek.com commit ccc915e7dd7e79d2d810a62a73c57e25a120795d Author: Srinivasan Raju Date: Mon May 2 16:01:32 2022 +0100 plfxlc: fix le16_to_cpu warning for beacon_interval Fix the following sparse warnings: drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: expected unsigned short [usertype] beacon_interval drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: got restricted __le16 [usertype] Reported-by: kernel test robot Signed-off-by: Srinivasan Raju Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220502150133.6052-1-srini.raju@purelifi.com commit d413a34932f98cc5bf0ffdd332884a8b63a1a7f9 Author: Johan Hovold Date: Mon May 2 15:31:30 2022 +0200 phy: qcom-qmp: rename error labels Rename all error labels after what they are used for in order to improve readability and for consistency. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220502133130.4125-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 5e73b2d9867998278479ccc065a8a8227a5513ef Author: Johan Hovold Date: Mon May 2 15:31:29 2022 +0200 phy: qcom-qmp: fix pipe-clock imbalance on power-on failure Make sure to disable the pipe clock also if ufs-reset deassertion fails during power on. Note that the ufs-reset is asserted in qcom_qmp_phy_com_exit(). Fixes: c9b589791fc1 ("phy: qcom: Utilize UFS reset controller") Cc: Evan Green Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220502133130.4125-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 0a97630ac9726436e319e38cb95d73706581c6c4 Author: Johan Hovold Date: Wed Apr 27 08:32:43 2022 +0200 phy: qcom-qmp: switch to explicit reset helpers Switch to consistently using the explicit reset-controller API which makes it clear that the reset controllers are used exclusively by the PHY driver. Note that the deprecated of_reset_control_get() and devm_reset_control_get() are just transitional wrappers for the explicit API so there's no functional change. Suggested-by: Philipp Zabel Signed-off-by: Johan Hovold Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220427063243.32576-4-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 4d2900f20edfe541f75756a00deeb2ffe7c66bc1 Author: Johan Hovold Date: Wed Apr 27 08:32:42 2022 +0200 phy: qcom-qmp: fix reset-controller leak on probe errors Make sure to release the lane reset controller in case of a late probe error (e.g. probe deferral). Note that due to the reset controller being defined in devicetree in "lane" child nodes, devm_reset_control_get_exclusive() cannot be used directly. Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Cc: stable@vger.kernel.org # 4.12 Cc: Vivek Gautam Reviewed-by: Philipp Zabel Signed-off-by: Johan Hovold Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220427063243.32576-3-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit f0a4bc38a12f5a0cc5ad68670d9480e91e6a94df Author: Johan Hovold Date: Wed Apr 27 08:32:41 2022 +0200 phy: qcom-qmp: fix struct clk leak on probe errors Make sure to release the pipe clock reference in case of a late probe error (e.g. probe deferral). Fixes: e78f3d15e115 ("phy: qcom-qmp: new qmp phy driver for qcom-chipsets") Cc: stable@vger.kernel.org # 4.12 Cc: Vivek Gautam Reviewed-by: Bjorn Andersson Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220427063243.32576-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 3a09fae035c879c7ae8e5e154d7b03ddf0de5f20 Author: Mark Bloch Date: Tue Mar 22 12:58:02 2022 +0000 net/mlx5: fs, an FTE should have no dests when deleted When deleting an FTE it should have no dests, which means fte->dests_size should be 0. Add a WARN_ON() to catch bugs where the proper tracking wasn't done. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 72191a4cd5250bc39e431ad1a2ad3b4fb3c52d2e Author: Mark Bloch Date: Tue Mar 15 11:51:55 2022 +0000 net/mlx5: fs, call the deletion function of the node Don't call del_hw_fte() directly, instead use the hardware deletion function set. This is just a small cleanup and doesn't change anything as for an FTE the deletion function is already set to del_hw_fte(). Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 7b0c6338597613f465d131bd939a51844a00455a Author: Mark Bloch Date: Tue Mar 15 11:23:40 2022 +0000 net/mlx5: fs, delete the FTE when there are no rules attached to it When an FTE has no children is means all the rules where removed and the FTE can be deleted regardless of the dests_size value. While dests_size should be 0 when there are no children be extra careful not to leak memory or get firmware syndrome if the proper bookkeeping of dests_size wasn't done. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit a30c8b9025dbc088c6041fccf97e0368c7db1c8d Author: Mark Bloch Date: Tue Mar 15 11:22:17 2022 +0000 net/mlx5: fs, do proper bookkeeping for forward destinations Keep track after destinations that are forward destinations. When a forward destinations is removed from an FTE check if the actions bits need to be updated. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 6510bc0d7cb4119ebe10f9ab43aca6fd0e5f3e73 Author: Mark Bloch Date: Tue Mar 15 14:08:23 2022 +0000 net/mlx5: fs, add unused destination type When the caller doesn't pass a destination fs_core will create a unused rule just so a context can be returned. This unused rule is zeroed out and its type is 0 which can be mixed up with MLX5_FLOW_DESTINATION_TYPE_VPORT. Create a dedicated type to differentiate between the two named MLX5_FLOW_DESTINATION_TYPE_NONE. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit c3ae3a9cfe2f3cfdea5a990fa96e23aee343fdb9 Author: Mark Bloch Date: Tue Mar 15 10:45:00 2022 +0000 net/mlx5: fs, jump to exit point and don't fall through For code clarity and to prevent future bugs make sure to jump to the exit point once done handling that specific type. This aligns the code with the rest logic in the function. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit d49d63075e0f56f7f05e3ddda59e0484d8a3aa7b Author: Mark Bloch Date: Tue Mar 15 10:44:14 2022 +0000 net/mlx5: fs, refactor software deletion rule When deleting a rule make sure that for every type dests_size is decreased only once and no other logic is executed. Without this dests_size might be decreased twice when dests_size == 1 so the if for that type won't be entered and if action has MLX5_FLOW_CONTEXT_ACTION_FWD_DEST set dests_size will be decreased again. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit d639af621600dc52dd9ed0dcf62b22595f2f5b52 Author: Mark Bloch Date: Tue Mar 22 09:16:39 2022 +0000 net/mlx5: fs, split software and IFC flow destination definitions Separate flow destinations between software and IFC. Flow destination type passed by callers was used as the input in firmware commands and over the years software only types were added which resulted in mixing between the two. Create an IFC enum that contains only the flow destinations defined when talking to the firmware. Now that there is a proper software only enum for flow destinations the hardcoded values can be removed as the values are no longer used in firmware commands. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit c70c3336a63ef83c1ac057b3321f438ed2a068a3 Author: Mark Bloch Date: Tue Mar 22 16:14:51 2022 +0000 net/mlx5e: TC, set proper dest type Dest type isn't set, this works only because MLX5_FLOW_DESTINATION_TYPE_VPORT is zero. Set the proper type. Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit a90889b4e8bdf49fa9a9b12c6f31811930b92b94 Author: Gal Pressman Date: Tue Mar 29 15:24:33 2022 +0300 net/mlx5e: Remove unused mlx5e_dcbnl_build_rep_netdev function Commit 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode") removed the usage of mlx5e_dcbnl_build_rep_netdev() from the driver, delete the function. Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 84a137f051a571f0c89e395a8fb2acb5cb60e6a7 Author: Maxim Mikityanskiy Date: Thu Jan 20 11:32:04 2022 +0200 net/mlx5e: Drop error CQE handling from the XSK RX handler This commit removes the redundant check and removes the unused cqe parameter of skb_from_cqe handlers. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit cdfc6ffbfb390185f7cb442be16d1d2c29a8762d Author: Shay Drory Date: Tue Mar 22 16:55:58 2022 +0200 net/mlx5: Print initializing field in case of timeout Print the initializing field in case of FW couldn't initialize before timeout. This will help to better understand the root cause in some cases. Signed-off-by: Shay Drory Reviewed-by: Maor Gottlieb Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit b5235a9979f9be05e1ffde3546877d3b9a1172c4 Author: Shay Drory Date: Wed Nov 3 12:18:35 2021 +0200 net/mlx5: Delete redundant default assignment of runtime devlink params Runtime devlink params always read their values from the get() callbacks. Also, it is an error to set driverinit_value for params which don't support driverinit cmode. Delete such assignments. In addition, move the set of default matching mode inside eswitch code. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 7134c602812a69885de9be7b6bc15c7250c5e637 Author: Haowen Bai Date: Fri Apr 22 14:08:32 2022 +0800 net/mlx5: Remove useless kfree After alloc fail, we do not need to kfree. Signed-off-by: Haowen Bai Signed-off-by: Saeed Mahameed commit c389362096be8ee69ec3a163a0699a31e84b8451 Author: Ziyang Xuan Date: Wed Apr 20 18:36:17 2022 +0800 net/mlx5: use kvfree() for kvzalloc() in mlx5_ct_fs_smfs_matcher_create The memory of spec is allocated with kvzalloc(), the corresponding release function should not be kfree(), use kvfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Signed-off-by: Ziyang Xuan Signed-off-by: Saeed Mahameed commit 6e29832f61a055638c8d9f3777ceb2d85f4b8875 Author: Ramalingam C Date: Mon May 2 19:56:18 2022 +0530 drm/i915/gt: Document the eviction of the Flat-CCS objects Capture the eviction details for Flat-CCS capable, lmem objects. v2: Fix the Flat-ccs capbility of lmem obj with smem residency possibility [Thomas] v3: Fixed the suggestions [Matt] Signed-off-by: Ramalingam C cc: Thomas Hellstrom cc: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220502142618.2704-4-ramalingam.c@intel.com commit b8c9d486af7b462d117f92ecc5afb4d406b74d15 Author: Ramalingam C Date: Mon May 2 19:56:17 2022 +0530 drm/i915/gt: optimize the ccs_sz calculation per chunk Calculate the ccs_sz that needs to be emitted based on the src and dst pages emitted per chunk. And handle the return value of emit_pte for the ccs pages. v2: ccs_sz moved to the reduced scope [Matt] Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220502142618.2704-3-ramalingam.c@intel.com commit 0530a683fc858aa641d88ad83315ea53c27bce10 Merge: 954f46d2f0b4a bd50c5dc182b0 Author: Jakub Kicinski Date: Mon May 2 16:04:36 2022 -0700 Merge branch 'vsock-virtio-add-support-for-device-suspend-resume' Stefano Garzarella says: ==================== vsock/virtio: add support for device suspend/resume Vilas reported that virtio-vsock no longer worked properly after suspend/resume (echo mem >/sys/power/state). It was impossible to connect to the host and vice versa. Indeed, the support has never been implemented. This series implement .freeze and .restore callbacks of struct virtio_driver to support device suspend/resume. The first patch factors our the code to initialize and delete VQs. The second patch uses that code to support device suspend/resume. Signed-off-by: Stefano Garzarella ==================== Link: https://lore.kernel.org/r/20220428132241.152679-1-sgarzare@redhat.com Signed-off-by: Jakub Kicinski commit bd50c5dc182b0a52599f87b429f9a5a9cbfc9b1c Author: Stefano Garzarella Date: Thu Apr 28 15:22:41 2022 +0200 vsock/virtio: add support for device suspend/resume Implement .freeze and .restore callbacks of struct virtio_driver to support device suspend/resume. During suspension all connected sockets are reset and VQs deleted. During resume the VQs are re-initialized. Reported by: Vilas R K Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski commit a103209886264a3289f7e53e7ed389d0391fb23f Author: Stefano Garzarella Date: Thu Apr 28 15:22:40 2022 +0200 vsock/virtio: factor our the code to initialize and delete VQs Add virtio_vsock_vqs_init() and virtio_vsock_vqs_del() with the code that was in virtio_vsock_probe() and virtio_vsock_remove to initialize and delete VQs. These new functions will be used in the next commit to support device suspend/resume Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski commit 3fa50896c35982afb59ad5bcbe04ec2e91bb54a5 Author: Chen-Yu Tsai Date: Fri Jan 14 15:40:38 2022 +0800 drm/rockchip: Support YUV formats with U/V swapped The VOP in Rockchip SoCs that support YUV planes also support swapping of the U and V elements. Supporting the swapped variants, especially NV21, would be beneficial for multimedia applications, as the hardware video decoders only output NV21, and supporting this pixel format in the display pipeline would allow the decoded video frames to be output directly. Add support for this to support the various formats that have U/V swapped. Signed-off-by: Chen-Yu Tsai Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220114074038.2633848-1-wenst@chromium.org commit 954f46d2f0b4a76405a5e0788e3f80a24c657fd4 Author: Vladimir Oltean Date: Sun May 1 14:29:53 2022 +0300 selftests: forwarding: add Per-Stream Filtering and Policing test for Ocelot The Felix VSC9959 switch in NXP LS1028A supports the tc-gate action which enforced time-based access control per stream. A stream as seen by this switch is identified by {MAC DA, VID}. We use the standard forwarding selftest topology with 2 host interfaces and 2 switch interfaces. The host ports must require timestamping non-IP packets and supporting tc-etf offload, for isochron to work. The isochron program monitors network sync status (ptp4l, phc2sys) and deterministically transmits packets to the switch such that the tc-gate action either (a) always accepts them based on its schedule, or (b) always drops them. I tried to keep as much of the logic that isn't specific to the NXP LS1028A in a new tsn_lib.sh, for future reuse. This covers synchronization using ptp4l and phc2sys, and isochron. The cycle-time chosen for this selftest isn't particularly impressive (and the focus is the functionality of the switch), but I didn't really know what to do better, considering that it will mostly be run during debugging sessions, various kernel bloatware would be enabled, like lockdep, KASAN, etc, and we certainly can't run any races with those on. I tried to look through the kselftest framework for other real time applications and didn't really find any, so I'm not sure how better to prepare the environment in case we want to go for a lower cycle time. At the moment, the only thing the selftest is ensuring is that dynamic frequency scaling is disabled on the CPU that isochron runs on. It would probably be useful to have a blacklist of kernel config options (checked through zcat /proc/config.gz) and some cyclictest scripts to run beforehand, but I saw none of those. Signed-off-by: Vladimir Oltean Reviewed-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20220501112953.3298973-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit d2eabdb64474c2101953859601794f1ea08ec1d9 Author: José Expósito Date: Thu Apr 21 19:07:23 2022 +0200 drm/rockchip: rk3066_hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi Once EDID is parsed, the monitor HDMI support information is available through drm_display_info.is_hdmi. This driver calls drm_detect_hdmi_monitor() to receive the same information and stores its own cached value, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead and also remove hdmi_data_info.sink_is_hdmi as it is no longer necessary. Signed-off-by: José Expósito Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220421170725.903361-4-jose.exposito89@gmail.com commit d449222dd533ca83a3a2f88aafe06fdd8d589280 Author: José Expósito Date: Thu Apr 21 19:07:22 2022 +0200 drm/rockchip: inno_hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi Once EDID is parsed, the monitor HDMI support information is available through drm_display_info.is_hdmi. This driver calls drm_detect_hdmi_monitor() to receive the same information and stores its own cached value, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead and also remove hdmi_data_info.sink_is_hdmi as it is no longer necessary. Signed-off-by: José Expósito Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220421170725.903361-3-jose.exposito89@gmail.com commit 7494b1ed1df414e43dc8429f0c016b2054b1b5da Author: Tom Rix Date: Thu Apr 21 10:43:04 2022 -0400 drm/rockchip: cdn-dp: change rk3399_cdn_dp from global to static Smatch reports this issue cdn-dp-core.c:51:20: warning: symbol 'rk3399_cdn_dp' was not declared. Should it be static? rk3399_cdn_dp is only used in cdn-dp-core.c so change its storge-class specifier to static. Signed-off-by: Tom Rix Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220421144304.586396-1-trix@redhat.com commit 421be3ee36a497949a4b564cd1e4f7f9fe755f57 Author: Robin Murphy Date: Tue Apr 5 15:32:50 2022 +0100 drm/rockchip: Refactor IOMMU initialisation Defer the IOMMU domain setup until after successfully binding components, so we can figure out IOMMU support directly from the VOP devices themselves, rather than manually inferring it from the DT (which also fails to account for whether the IOMMU driver is actually loaded). Although this is somewhat of a logical cleanup, the main motivation is to prepare for a change in the iommu_domain_alloc() interface. Signed-off-by: Robin Murphy Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/94eee7ab434fe11eb0787f691e9f1ab03a2e91be.1649168685.git.robin.murphy@arm.com commit b52e1cce31ca721e937d517411179f9196ee6135 Author: jianghaoran Date: Fri Apr 29 13:38:02 2022 +0800 ipv6: Don't send rs packets to the interface of ARPHRD_TUNNEL ARPHRD_TUNNEL interface can't process rs packets and will generate TX errors ex: ip tunnel add ethn mode ipip local 192.168.1.1 remote 192.168.1.2 ifconfig ethn x.x.x.x ethn: flags=209 mtu 1480 inet x.x.x.x netmask 255.255.255.255 destination x.x.x.x inet6 fe80::5efe:ac1e:3cdb prefixlen 64 scopeid 0x20 tunnel txqueuelen 1000 (IPIP Tunnel) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 3 dropped 0 overruns 0 carrier 0 collisions 0 Signed-off-by: jianghaoran Link: https://lore.kernel.org/r/20220429053802.246681-1-jianghaoran@kylinos.cn Signed-off-by: Jakub Kicinski commit 829b7bdd70449c211eb6b2673fcbc597ce120939 Author: Pavel Begunkov Date: Thu Apr 28 11:57:46 2022 +0100 tcp: optimise skb_zerocopy_iter_stream() It's expensive to make a copy of 40B struct iov_iter to the point it was taking 0.2-0.5% of all cycles in my tests. iov_iter_revert() should be fine as it's a simple case without nested reverts/truncates. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a7e1690c00c5dfe700c30eb9a8a81ec59f6545dd.1650884401.git.asml.silence@gmail.com Signed-off-by: Jakub Kicinski commit 0b9f1b265ee16cd991714fe310eb59b800c142c5 Author: Niels Dossche Date: Sat Apr 30 21:46:56 2022 +0200 octeontx2-af: debugfs: fix error return of allocations Current memory failure code in the debugfs returns -ENOSPC. This is normally used for indicating that there is no space left on the device and is not applicable for memory allocation failures. Replace this with -ENOMEM. Signed-off-by: Niels Dossche Link: https://lore.kernel.org/r/20220430194656.44357-1-dossche.niels@gmail.com Signed-off-by: Jakub Kicinski commit f8c242908ad15bbd604d3bcb54961b7d454c43f8 Author: Yang Yingliang Date: Fri Apr 22 11:28:54 2022 +0800 drm/rockchip: vop: fix possible null-ptr-deref in vop_bind() It will cause null-ptr-deref in resource_size(), if platform_get_resource() returns NULL, move calling resource_size() after devm_ioremap_resource() that will check 'res' to avoid null-ptr-deref. Fixes: 2048e3286f34 ("drm: rockchip: Add basic drm driver") Signed-off-by: Yang Yingliang Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220422032854.2995175-1-yangyingliang@huawei.com commit e1ff0bd673505727e0d7fc062f4d6745ec8ca8bb Merge: c5f50500a0270 8c5b07da9bc8c Author: Jakub Kicinski Date: Mon May 2 14:04:19 2022 -0700 Merge branch 'ocelot-stats-improvement' Colin Foster says: ==================== ocelot stats improvement A couple of pick-ups after f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer") - one addresses a warning patchwork flagged about operator precedence when using macro arguments. The other is a reduction of unnecessary memory allocation. ==================== Link: https://lore.kernel.org/r/20220430232327.4091825-1-colin.foster@in-advantage.com Signed-off-by: Jakub Kicinski commit 8c5b07da9bc8c056a3ddca00b4e268358f643343 Author: Colin Foster Date: Sat Apr 30 16:23:27 2022 -0700 net: mscc: ocelot: add missed parentheses around macro argument Commit 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer") added a macro that patchwork warned it lacked parentheses around an argument. Correct this mistake. Fixes: 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer") Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 05e4ed1ce585637958c8ad6121999dc3109633ad Author: Colin Foster Date: Sat Apr 30 16:23:26 2022 -0700 net: mscc: ocelot: remove unnecessary variable Commit 2f187bfa6f35 ("net: ethernet: ocelot: remove the need for num_stats initializer") added a flags field to the ocelot stats structure. The same behavior can be achieved without this additional field taking up extra memory. Remove this structure element to free up RAM Suggested-by: Vladimir Oltean Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit f304d35e59958ea4be399f78e5be08d4a0c4db75 Author: Sumit Saxena Date: Fri Apr 29 17:16:41 2022 -0400 scsi: mpi3mr: Update driver version to 8.0.0.69.0 Link: https://lore.kernel.org/r/20220429211641.642010-9-sumit.saxena@broadcom.com Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 7dbd0dd8cde356d2a747d5c87dad7c2233dad8a4 Author: Sumit Saxena Date: Fri Apr 29 17:16:40 2022 -0400 scsi: mpi3mr: Add support for NVMe passthrough Add support for management applications to send an MPI3 Encapsulated NVMe passthru command to the NVMe devices attached to an Avenger controller. Since the NVMe drives are exposed as SCSI devices by the controller, the standard NVMe applications cannot be used to interact with the drives and the command sets supported are also limited by the controller firmware. Special handling is required for MPI3 Encapsulated NVMe passthru commands for PRP/SGL setup in the commands. Link: https://lore.kernel.org/r/20220429211641.642010-8-sumit.saxena@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 986d6bad2103fb24bd886aad455245ace168c984 Author: Sumit Saxena Date: Fri Apr 29 17:16:39 2022 -0400 scsi: mpi3mr: Expose adapter state to sysfs Link: https://lore.kernel.org/r/20220429211641.642010-7-sumit.saxena@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 43ca110050988c7a0e581d24ce212ef34a4cdf29 Author: Sumit Saxena Date: Fri Apr 29 17:16:38 2022 -0400 scsi: mpi3mr: Add support for PEL commands Implement driver support for management applications to enable persistent event log (PEL) notifications. Upon receipt of events, the driver will increment a sysfs variable named event_counter. The management application will poll for event_counter value changes and signal the application about events. Link: https://lore.kernel.org/r/20220429211641.642010-6-sumit.saxena@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 506bc1a0d6ba626492c06e5632a3fbe202770fd2 Author: Sumit Saxena Date: Fri Apr 29 17:16:37 2022 -0400 scsi: mpi3mr: Add support for MPT commands There are certain management commands which require firmware intervention. These commands are termed MPT commands. Add support for them. Link: https://lore.kernel.org/r/20220429211641.642010-5-sumit.saxena@broadcom.com Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit f3de4706c1e0c3b9fa39ec24a30c1996a33bc9e4 Author: Sumit Saxena Date: Fri Apr 29 17:16:36 2022 -0400 scsi: mpi3mr: Move data structures/definitions from MPI headers to uapi header This patch moves the data structures/definitions which are used by userspace applications from MPI headers to uapi/scsi/scsi_bsg_mpi3mr.h Link: https://lore.kernel.org/r/20220429211641.642010-4-sumit.saxena@broadcom.com Reported by: Stephen Rothwell Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit f5e6d5a343761081317c89d23489c93fbafc69ff Author: Sumit Saxena Date: Fri Apr 29 17:16:35 2022 -0400 scsi: mpi3mr: Add support for driver commands There are certain bsg commands which need to be completed by the driver without involving firmware. These requests are termed driver commands. Add support for these. Link: https://lore.kernel.org/r/20220429211641.642010-3-sumit.saxena@broadcom.com Reported by: Stephen Rothwell Reported-by: kernel test robot Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 4268fa7513655a83d5492705591fdac6c65db48a Author: Sumit Saxena Date: Fri Apr 29 17:16:34 2022 -0400 scsi: mpi3mr: Add bsg device support Create bsg device per controller for controller management purposes. bsg device nodes will be named /dev/bsg/mpi3mrctl0, /dev/bsg/mpi3mrctl1, etc. Link: https://lore.kernel.org/r/20220429211641.642010-2-sumit.saxena@broadcom.com Reported-by: kernel test robot Reviewed-by: Hannes Reinecke Reviewed-by: Himanshu Madhani Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit ebc95c790653508ad7e031cfb9de5d0fa39135e2 Author: Enze Li Date: Wed Apr 27 10:56:47 2022 +0800 scsi: sr: Add memory allocation failure handling for get_capabilities() The function get_capabilities() has the possibility of failing to allocate the transfer buffer but it does not currently handle this. This may lead to exceptions when accessing the buffer. Add error handling when memory allocation fails. Link: https://lore.kernel.org/r/20220427025647.298358-1-lienze@kylinos.cn Signed-off-by: Enze Li Signed-off-by: Martin K. Petersen commit bb9b9eb0ae2e9d3f6036f0ad907c3a83dcd43485 Author: Xiaoguang Wang Date: Thu Apr 21 10:37:35 2022 +0800 scsi: target: tcmu: Fix possible data corruption When tcmu_vma_fault() gets a page successfully, before the current context completes page fault procedure, find_free_blocks() may run and call unmap_mapping_range() to unmap the page. Assume that when find_free_blocks() initially completes and the previous page fault procedure starts to run again and completes, then one truncated page has been mapped to userspace. But note that tcmu_vma_fault() has gotten a refcount for the page so any other subsystem won't be able to use the page unless the userspace address is unmapped later. If another command subsequently runs and needs to extend dbi_thresh it may reuse the corresponding slot for the previous page in data_bitmap. Then though we'll allocate new page for this slot in data_area, no page fault will happen because we have a valid map and the real request's data will be lost. Filesystem implementations will also run into this issue but they usually lock the page when vm_operations_struct->fault gets a page and unlock the page after finish_fault() completes. For truncate filesystems lock pages in truncate_inode_pages() to protect against racing wrt. page faults. To fix this possible data corruption scenario we can apply a method similar to the filesystems. For pages that are to be freed, tcmu_blocks_release() locks and unlocks. Make tcmu_vma_fault() also lock found page under cmdr_lock. At the same time, since tcmu_vma_fault() gets an extra page refcount, tcmu_blocks_release() won't free pages if pages are in page fault procedure, which means it is safe to call tcmu_blocks_release() before unmap_mapping_range(). With these changes tcmu_blocks_release() will wait for all page faults to be completed before calling unmap_mapping_range(). And later, if unmap_mapping_range() is called, it will ensure stale mappings are removed. Link: https://lore.kernel.org/r/20220421023735.9018-1-xiaoguang.wang@linux.alibaba.com Reviewed-by: Bodo Stroesser Signed-off-by: Xiaoguang Wang Signed-off-by: Martin K. Petersen commit c2024e3b33ee785960e21c22da478c937a6af538 Author: James Smart Date: Wed Apr 27 15:22:23 2022 -0700 scsi: lpfc: Remove redundant lpfc_sli_prep_wqe() call Prior patch added a call to lpfc_sli_prep_wqe() prior to lpfc_sli_issue_iocb(). This call should not have been added as prep_wqe is called within the issue_iocb routine. So it's called twice now. Remove the redundant prep call. Link: https://lore.kernel.org/r/20220427222223.57920-1-jsmart2021@gmail.com Fixes: 31a59f75702f ("scsi: lpfc: SLI path split: Refactor Abort paths") Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 92bd903da12b0c0c5e9e2f560388fe80bb7ce749 Author: James Smart Date: Wed Apr 27 15:21:58 2022 -0700 scsi: lpfc: Fix additional reference counting in lpfc_bsg_rport_els() Code inspection has found an additional reference is taken in lpfc_bsg_rport_els(). Results in the ndlp not being freed thus is leaked. Fix by removing the redundant refcount taken before WQE submission. Link: https://lore.kernel.org/r/20220427222158.57867-1-jsmart2021@gmail.com Co-developed-by: Nigel Kirkland Signed-off-by: Nigel Kirkland Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1e029397d12f9085840691f4f12991a80d89888c Author: Martin K. Petersen Date: Wed Mar 2 00:35:58 2022 -0500 scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twice During device discovery we ended up calling revalidate twice and thus requested the same parameters multiple times. This was originally necessary due to the request_queue and gendisk needing to be instantiated to configure the block integrity profile. Since this dependency no longer exists, reorganize the integrity probing code so it can be run once at the end of discovery and drop the superfluous revalidate call. Postponing the registration step involves splitting sd_read_protection() into two functions, one to read the device protection type and one to configure the mode of operation. As part of this cleanup, make the printing code a bit less verbose. Link: https://lore.kernel.org/r/20220302053559.32147-14-martin.petersen@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 631669a256f96c7115c34cc19578a461c72568de Author: Martin K. Petersen Date: Wed Mar 2 00:35:53 2022 -0500 scsi: sd: Optimal I/O size should be a multiple of reported granularity Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size") validated the reported optimal I/O size against the physical block size to overcome problems with devices reporting nonsensical transfer sizes. However, some devices claim conformity to older SCSI versions that predate the physical block size being reported. Other devices do not report a physical block size at all. We need to be able to validate the optimal I/O size on those devices as well. Many devices report an OPTIMAL TRANSFER LENGTH GRANULARITY in the same VPD page as the OPTIMAL TRANSFER LENGTH. Use this value to validate the optimal I/O size. Also check that the reported granularity is a multiple of the physical block size, if supported. Link: https://lore.kernel.org/r/33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com Link: https://lore.kernel.org/r/20220302053559.32147-9-martin.petersen@oracle.com Reported-by: Bernhard Sulzer Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7fb019c46eeea4e3cc3ddfd3e01a24e610f34fac Author: Martin K. Petersen Date: Wed Mar 2 00:35:52 2022 -0500 scsi: sd: Switch to using scsi_device VPD pages Use the VPD pages already provided by the SCSI midlayer. No need to request them individually in the SCSI disk driver. Link: https://lore.kernel.org/r/20220302053559.32147-8-martin.petersen@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e38d9e83a376923454af599b2add53e71cd7508a Author: Martin K. Petersen Date: Wed Mar 2 00:35:51 2022 -0500 scsi: sd: Use cached ATA Information VPD page Since the ATA Information VPD is now cached at device discovery time it is no longer necessary to request this page when we configure WRITE SAME. Instead use the cached information to determine if this disk sits behind a SCSI-ATA translation layer. Link: https://lore.kernel.org/r/20220302053559.32147-7-martin.petersen@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d657700ccac71da19a4d1a591fafcd598ce0dd6e Author: Martin K. Petersen Date: Wed Mar 2 00:35:48 2022 -0500 scsi: core: Do not truncate INQUIRY data on modern devices Low-level device drivers have had the ability to limit the size of an INQUIRY for many years. This made sense for a wide variety of legacy devices. However, we are unnecessarily truncating the INQUIRY response for many modern devices. This prevents us from consulting fields beyond the first 36 bytes. If a device reports that it supports a larger INQUIRY response, and the device also reports that it implements SPC-4 or newer, allow the larger INQUIRY to proceed. Link: https://lore.kernel.org/r/20220302053559.32147-4-martin.petersen@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e60ac0b9e445822e60230c00e68d8cdb7748701b Author: Martin K. Petersen Date: Wed Mar 2 00:35:50 2022 -0500 scsi: core: Cache VPD pages b0, b1, b2 The SCSI disk driver consults VPD pages b0 (Block Limits), b1 (Block Device Characteristics), and b2 (Logical Block Provisioning). Instead of having sd.c request these pages every revalidate cycle, cache them along with the other commonly used VPDs. Link: https://lore.kernel.org/r/20220302053559.32147-6-martin.petersen@oracle.com Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e17d63403076affccd72d195f93bbf3f39514005 Author: Martin K. Petersen Date: Wed Mar 2 00:35:49 2022 -0500 scsi: core: Pick suitable allocation length in scsi_report_opcode() Some devices hang when a buffer size larger than expected is passed in the ALLOCATION LENGTH field. For REPORT SUPPORTED OPERATION CODES we currently only request a single command descriptor at a time and therefore the actual size of the command is known ahead of time. Limit the ALLOCATION LENGTH to the header size plus the command length of the opcode we are asking about. Link: https://lore.kernel.org/r/20220302053559.32147-5-martin.petersen@oracle.com Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c92a6b5d63359dd6d2ce6ea88ecd8e31dd769f6b Author: Martin K. Petersen Date: Wed Mar 2 00:35:47 2022 -0500 scsi: core: Query VPD size before getting full page We currently default to 255 bytes when fetching VPD pages during discovery. However, we have had a few devices that are known to wedge if the requested buffer exceeds a certain size. See commit af73623f5f10 ("[SCSI] sd: Reduce buffer size for vpd request") which works around one example of this problem in the SCSI disk driver. With commit d188b0675b21 ("scsi: core: Add sysfs attributes for VPD pages 0h and 89h") we now risk triggering the same issue in the generic midlayer code. The problem with the ATA VPD page in particular is that the SCSI portion of the page is trailed by 512 bytes of verbatim ATA Identify Device information. However, not all controllers actually provide the additional 512 bytes and will lock up if one asks for more than the 64 bytes containing the SCSI protocol fields. Instead of picking a new, somewhat arbitrary, number of bytes for the VPD buffer size, start fetching the 4-byte header for each page. The header contains the size of the page as far as the device is concerned. We can use the reported size to specify the correct allocation length when subsequently fetching the full page. The header validation is done by a new helper function scsi_get_vpd_size() and both scsi_get_vpd_page() and scsi_get_vpd_buf() now rely on this to query the page size. In addition, scsi_get_vpd_page() is simplified to mirror the logic in scsi_get_vpd_page(). This involves removing the Supported VPD Pages lookup prior to attempting to query a page. There does not appear any evidence, even in the oldest SCSI specs, that this step is required. We already rely on scsi_get_vpd_page() throughout the stack and this function never consulted the Supported VPD Pages. Since this has not caused any problems it should be safe to remove the precondition from scsi_get_vpd_page(). Instrumented runs also revealed that the Supported VPD Pages lookup had little effect since the device page index often was larger than the supplied buffer size. As a result, inquiries frequently bypassed the index check and went through the "If we ran off the end of the buffer, give us the benefit of the doubt" code path which assumed the page was present despite not being listed. The revised code takes both the page size reported by the device as well as the size of the buffer provided by the scsi_get_vpd_page() caller into account. Link: https://lore.kernel.org/r/20220302053559.32147-3-martin.petersen@oracle.com Fixes: d188b0675b21 ("scsi: core: Add sysfs attributes for VPD pages 0h and 89h") Reported-by: Maciej W. Rozycki Tested-by: Maciej W. Rozycki Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit dc1178767cba9d67f5100fb370670fd613319362 Author: Martin K. Petersen Date: Wed Mar 2 00:35:46 2022 -0500 scsi: mpt3sas: Use cached ATA Information VPD page We now cache VPD page 0x89 (ATA Information) so there is no need to request it from the hardware. Make mpt3sas use the cached page. Link: https://lore.kernel.org/r/20220302053559.32147-2-martin.petersen@oracle.com Cc: Sreekanth Reddy Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit c5f50500a0270ee1618373baa85a0bac9a0dc4bf Merge: 0decb97cb105e 1229df4b313ac Author: Jakub Kicinski Date: Mon May 2 13:57:54 2022 -0700 Stefan Schmidt says: ==================== pull-request: ieee802154-next 2022-05-01 Miquel Raynal landed two patch series bundled in this pull request. The first series re-works the symbol duration handling to better accommodate the needs of the various phy layers in ieee802154. In the second series Miquel improves th errors handling from drivers up mac802154. THis streamlines the error handling throughout the ieee/mac802154 stack in preparation for sync TX to be introduced for MLME frames. ==================== Link: https://lore.kernel.org/r/20220501194614.1198325-1-stefan@datenfreihafen.org Signed-off-by: Jakub Kicinski commit f624506f98b198e65b44da303f44974590fb16c0 Author: Christoph Hellwig Date: Wed Apr 20 06:27:23 2022 +0200 kthread: unexport kthread_blkcg kthread_blkcg is only used by the built-in blk-cgroup code. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-16-hch@lst.de Signed-off-by: Jens Axboe commit 82778259eb201870d6d4f95ca4162de60a682343 Author: Christoph Hellwig Date: Wed Apr 20 06:27:22 2022 +0200 blk-cgroup: cleanup blkcg_maybe_throttle_current Use blkcg_css instead of opencoding it. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-15-hch@lst.de Signed-off-by: Jens Axboe commit d200ca143ac6d0b4391b4e811e67e1a36461d501 Author: Christoph Hellwig Date: Wed Apr 20 06:27:21 2022 +0200 blk-cgroup: cleanup blk_cgroup_congested Use blkcg_css instead of open coding it, and switch to a slightly more natural for loop. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-14-hch@lst.de Signed-off-by: Jens Axboe commit bc5fee91f26d8d1428fb744e5ad04b1417a85197 Author: Christoph Hellwig Date: Wed Apr 20 06:27:20 2022 +0200 blk-cgroup: move blkcg_css to blk-cgroup.c blkcg_css is only used in blk-cgroup.c, so move it there. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-13-hch@lst.de Signed-off-by: Jens Axboe commit c97ab271576dec2170e7b804cb05f7617b30fed9 Author: Christoph Hellwig Date: Wed Apr 20 06:27:19 2022 +0200 blk-cgroup: remove unneeded includes from Remove all the includes that aren't actually needed from and push them to the actual source files where needed. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-12-hch@lst.de Signed-off-by: Jens Axboe commit 7f20ba7c42fd899557cef7d001f48711c3066ba5 Author: Christoph Hellwig Date: Wed Apr 20 06:27:18 2022 +0200 blk-cgroup: remove pointless CONFIG_BLOCK ifdefs No need to make BLK_CGROUP stubs conditional on CONFIG_BLOCK as they can't be used without that. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-11-hch@lst.de Signed-off-by: Jens Axboe commit bbb1ebe7a909db4de49777fb7676d5bf293f34c9 Author: Christoph Hellwig Date: Wed Apr 20 06:27:17 2022 +0200 blk-cgroup: replace bio_blkcg with bio_blkcg_css All callers of bio_blkcg actually want the CSS, so replace it with an interface that does return the CSS. This now allows to move struct blkcg_gq to block/blk-cgroup.h instead of exposing it in a public header. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-10-hch@lst.de Signed-off-by: Jens Axboe commit f4a6a61cb6d40d9ae63e47743d33200f3efe3fe7 Author: Christoph Hellwig Date: Wed Apr 20 06:27:16 2022 +0200 blktrace: cleanup the __trace_note_message interface Pass the cgroup_subsys_state instead of a the blkg so that blktrace doesn't need to poke into blk-cgroup internals, and give the name a blk prefix as the current name is way too generic for a public interface. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-9-hch@lst.de Signed-off-by: Jens Axboe commit dec223c92a4688f6c9642d640cfe15a99d289dd4 Author: Christoph Hellwig Date: Wed Apr 20 06:27:15 2022 +0200 blk-cgroup: move struct blkcg to block/blk-cgroup.h There is no real need to expose the blkcg structure to the whole kernel. Move it to the private header an expose a helper to let the writeback code access the cgwb_list member. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-8-hch@lst.de Signed-off-by: Jens Axboe commit 397c9f46ee4d99024c64954b007c1b5762d01cb4 Author: Christoph Hellwig Date: Wed Apr 20 06:27:14 2022 +0200 blk-cgroup: move blkcg_{pin,unpin}_online out of line Move these two functions out of line as there is no good reason to inline them. Also switch to passing a cgroup_subsys_state instead of doing the conversion in the caller to prepare for making the blkcg structure private to blk-cgroup. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-7-hch@lst.de Signed-off-by: Jens Axboe commit 216889aad362b5b7e998a5371348b5e95d485dd1 Author: Christoph Hellwig Date: Wed Apr 20 06:27:13 2022 +0200 blk-cgroup: move blk_cgroup_congested out line There is no urgent need to inline this function, so move it out of line. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-6-hch@lst.de Signed-off-by: Jens Axboe commit db05628435aa761d30b4eae481a82befe7a8492a Author: Christoph Hellwig Date: Wed Apr 20 06:27:12 2022 +0200 blk-cgroup: move blkcg_{get,set}_fc_appid out of line No need to have these helpers inline. Also remove the stubs and just use an IS_ENABLED for the get side (the set side already is only built conditionlly). Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-5-hch@lst.de Signed-off-by: Jens Axboe commit c814153c83a892dfd42026eaa661ae2c1f298792 Author: Christoph Hellwig Date: Wed Apr 20 06:27:11 2022 +0200 nvme-fc: fold t fc_update_appid into fc_appid_store No need for this wrapper. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-4-hch@lst.de Signed-off-by: Jens Axboe commit 55d7baa371ad90d297daf4250720af77449fdec0 Author: Christoph Hellwig Date: Wed Apr 20 06:27:10 2022 +0200 nvme-fc: don't support the appid attribute without CONFIG_BLK_CGROUP_FC_APPID nvme-fc appid support needs CONFIG_BLK_CGROUP_FC_APPID to work, so disable the whole code if the option is not set. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-3-hch@lst.de Signed-off-by: Jens Axboe commit 2524a5783e7d49e7cd936f582485a2bb4567edd1 Author: Christoph Hellwig Date: Wed Apr 20 06:27:09 2022 +0200 blk-cgroup: remove __bio_blkcg Remove the unused and deprecated __bio_blkcg helper. Signed-off-by: Christoph Hellwig Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20220420042723.1010598-2-hch@lst.de Signed-off-by: Jens Axboe commit 38289a26e1b8a37755f3e07056ca416c1ee2a2e8 Author: Daniel Latypov Date: Fri Apr 29 11:12:59 2022 -0700 kunit: fix debugfs code to use enum kunit_status, not bool Commit 6d2426b2f258 ("kunit: Support skipped tests") switched to using `enum kunit_status` to track the result of running a test/suite since we now have more than just pass/fail. This callsite wasn't updated, silently converting to enum to a bool and then back. Fixes: 6d2426b2f258 ("kunit: Support skipped tests") Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 3b91f826588ab07c37722d299dbb809b657640a0 Author: Daniel Latypov Date: Fri Apr 29 11:12:58 2022 -0700 kfence: test: use new suite_{init/exit} support, add .kunitconfig Currently, the kfence test suite could not run via "normal" means since KUnit didn't support per-suite setup/teardown. So it manually called internal kunit functions to run itself. This has some downsides, like missing TAP headers => can't use kunit.py to run or even parse the test results (w/o tweaks). Use the newly added support and convert it over, adding a .kunitconfig so it's even easier to run from kunit.py. People can now run the test via $ ./tools/testing/kunit/kunit.py run --kunitconfig=mm/kfence --arch=x86_64 ... [11:02:32] Testing complete. Passed: 23, Failed: 0, Crashed: 0, Skipped: 2, Errors: 0 [11:02:32] Elapsed time: 43.562s total, 0.003s configuring, 9.268s building, 34.281s running Cc: kasan-dev@googlegroups.com Signed-off-by: Daniel Latypov Tested-by: David Gow Reviewed-by: Marco Elver Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 1cdba21db2ca31514c60b9732fc3963ae24c59e0 Author: Daniel Latypov Date: Fri Apr 29 11:12:57 2022 -0700 kunit: add ability to specify suite-level init and exit functions KUnit has support for setup/cleanup logic for each test case in a suite. But it lacks the ability to specify setup/cleanup for the entire suite itself. This can be used to do setup that is too expensive or cumbersome to do for each test. Or it can be used to do simpler things like log debug information after the suite completes. It's a fairly common feature, so the lack of it is noticeable. Some examples in other frameworks and languages: * https://docs.python.org/3/library/unittest.html#setupclass-and-teardownclass * https://google.github.io/googletest/reference/testing.html#Test::SetUpTestSuite Meta: This is very similar to this patch here: https://lore.kernel.org/linux-kselftest/20210805043503.20252-3-bvanassche@acm.org/ The changes from that patch: * pass in `struct kunit *` so users can do stuff like `kunit_info(suite, "debug message")` * makes sure the init failure is bubbled up as a failure * updates kunit-example-test.c to use a suite init * Updates kunit/usage.rst to mention the new support * some minor cosmetic things * use `suite_{init,exit}` instead of `{init/exit}_suite` * make suite init error message more consistent w/ test init * etc. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit cae56e1740f559703c94b7f4d772d873b8a01395 Author: Daniel Latypov Date: Fri Apr 29 11:12:56 2022 -0700 kunit: rename print_subtest_{start,end} for clarity (s/subtest/suite) These names sound more general than they are. The _end() function increments a `static int kunit_suite_counter`, so it can only safely be called on suites, aka top-level subtests. It would need to have a separate counter for each level of subtest to be generic enough. So rename it to make it clear it's only appropriate for suites. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 36a1d1bda77e1851bddfa9cf4e8ada94476dbaff Author: Luca Weiss Date: Thu Apr 21 22:34:53 2022 +0200 drm/msm: Fix null pointer dereferences without iommu Check if 'aspace' is set before using it as it will stay null without IOMMU, such as on msm8974. Fixes: bc2112583a0b ("drm/msm/gpu: Track global faults per address-space") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20220421203455.313523-1-luca@z3ntu.xyz Signed-off-by: Rob Clark commit 8e51ec6146fdec82f7308f89113497631013f16a Author: Alexander Aring Date: Mon May 2 11:14:10 2022 -0400 dlm: use kref_put_lock in __put_lkb This patch will optimize __put_lkb() by using kref_put_lock(). The function kref_put_lock() will only take the lock if the reference is going to be zero, if not the lock will never be held. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 9502a7f688fe7bff297b4e1b64622e0da9b27d78 Author: Alexander Aring Date: Mon May 2 11:14:09 2022 -0400 dlm: use kref_put_lock in put_rsb This patch will optimize put_rsb() by using kref_put_lock(). The function kref_put_lock() will only take the lock if the reference is going to be zero, if not the lock will never be held. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 0ccc106052715617015277b596bd1a591bbe4416 Author: Alexander Aring Date: Mon May 2 11:14:08 2022 -0400 dlm: remove unnecessary error assign This patch removes unnecessary error assigns to 0 at places we know that error is zero because it was checked on non-zero before. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 1689c169134f4b5a39156122d799b7dca76d8ddb Author: Alexander Aring Date: Fri Apr 29 11:06:51 2022 -0400 dlm: fix missing lkb refcount handling We always call hold_lkb(lkb) if we increment lkb->lkb_wait_count. So, we always need to call unhold_lkb(lkb) if we decrement lkb->lkb_wait_count. This patch will add missing unhold_lkb(lkb) if we decrement lkb->lkb_wait_count. In case of setting lkb->lkb_wait_count to zero we need to countdown until reaching zero and call unhold_lkb(lkb). The waiters list unhold_lkb(lkb) can be removed because it's done for the last lkb_wait_count decrement iteration as it's done in _remove_from_waiters(). This issue was discovered by a dlm gfs2 test case which use excessively dlm_unlock(LKF_CANCEL) feature. Probably the lkb->lkb_wait_count value never reached above 1 if this feature isn't used and so it was not discovered before. The testcase ended in a rsb on the rsb keep data structure with a refcount of 1 but no lkb was associated with it, which is itself an invalid behaviour. A side effect of that was a condition in which the dlm was sending remove messages in a looping behaviour. With this patch that has not been reproduced. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 9650b453a3d4b1b8ed4ea8bcb9b40109608d1faf Author: Ming Lei Date: Wed Apr 20 22:31:10 2022 +0800 block: ignore RWF_HIPRI hint for sync dio So far bio is marked as REQ_POLLED if RWF_HIPRI/IOCB_HIPRI is passed from userspace sync io interface, then block layer tries to poll until the bio is completed. But the current implementation calls blk_io_schedule() if bio_poll() returns 0, and this way causes io hang or timeout easily. But looks no one reports this kind of issue, which should have been triggered in normal io poll sanity test or blktests block/007 as observed by Changhui, that means it is very likely that no one uses it or no one cares it. Also after io_uring is invented, io poll for sync dio becomes legacy interface. So ignore RWF_HIPRI hint for sync dio. CC: linux-mm@kvack.org Cc: linux-xfs@vger.kernel.org Reported-by: Changhui Zhong Suggested-by: Christoph Hellwig Signed-off-by: Ming Lei Tested-by: Changhui Zhong Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220420143110.2679002-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit ef6a0a3b2b1084059f6bb1f07d919d40f7dfbfd6 Author: David Collins Date: Thu Apr 28 09:12:47 2022 +0800 dt-bindings: spmi: spmi-pmic-arb: make interrupt properties as optional Make all interrupt related properties as optional instead of required. Some boards do not required PMIC IRQ support and it isn't needed to handle SPMI bus transactions, so specify it as optional. Signed-off-by: David Collins Signed-off-by: Fenglin Wu Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1651108369-11059-9-git-send-email-quic_fenglinw@quicinc.com commit 52077d82331a13e3e09295ac288343b9f80d7d68 Author: David Heidelberg Date: Mon Dec 27 18:01:50 2021 +0100 dt-bindings: spmi: convert QCOM PMIC SPMI bindings to yaml Convert Qualcomm PMIC SPMI binding to yaml format. Signed-off-by: David Heidelberg Reviewed-by: Vinod Koul Reviewed-by: Rob Herring Acked-by: Lee Jones Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227170151.73116-1-david@ixit.cz commit 1d7aff7788362fb85ef694874c065dc2e1f58a63 Author: Dave Gerlach Date: Tue Apr 26 13:07:42 2022 -0700 dt-bindings: wkup-m3-ipc: Add firmware-name property Document that the firmware-name property can be used to indicate a file contains I2C sequences for PMIC voltage scaling during deep sleep. Based on previous work by Russ Dill. Signed-off-by: Dave Gerlach Signed-off-by: Keerthy [dfustini: split from driver patch and convert to json-schema] Signed-off-by: Drew Fustini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220426200741.712842-2-dfustini@baylibre.com commit b3ddadbf353cb4ac5ca66c200cfb25d632cc9e6f Author: Ping Cheng Date: Sat Apr 23 22:36:58 2022 -0700 MAINTAINERS: Add Wacom driver maintainers As suggested by Bastien and Jiri. Signed-off-by: Ping Cheng Reviewed-by: Bastien Nocera Signed-off-by: Jiri Kosina commit 5c9b8fae88bc2f629926b7949dbc3672d4fbdad2 Author: ValdikSS Date: Sun Feb 13 22:49:24 2022 +0100 HID: lenovo: Add note about different report numbers Signed-off-by: Florian Klink Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit a0a5c2a696990520eba366fae67573306641b93b Author: ValdikSS Date: Sun Feb 13 22:49:23 2022 +0100 HID: lenovo: Sync Fn-lock state on button press for Compact and TrackPoint II keyboards When Fn-Esc is pressed on the keyboard, it emits the scancode which could be used to sync the fn_lock sysfs state. Previously fn_lock only allowed to set new Fn-lock state and did not keep the value in sync upon Fn-Esc press, which is now fixed. Signed-off-by: Florian Klink Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 24401f291dcc4f2c18b9e2f65763cbaadc7a1528 Author: ValdikSS Date: Sun Feb 13 22:49:22 2022 +0100 HID: lenovo: Add support for ThinkPad TrackPoint Keyboard II This keyboard has two modes: regular HID and a native mode, which is used in Windows driver. Native mode disables (poor) middle mouse button scrolling emulation and reports middle button and scrolling events with a custom report ID, which could be better handled in the driver. This commit adds functional button mapping and native scrolling support. HID collection in Bluetooth mode for custom report ID=5 is broken and is patched upon connection. The collection initially contains incorrect Usage Minimum/Usage Maximum numbers and, more importantly, marks Input as Variable, not Array, while reporting values as in Array. The keyboard is very similar to Compact USB/Bluetooth Keyboard with TrackPoint, that's why this patch reuses all of cptkbd functions, except for input mapping. Signed-off-by: Florian Klink Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit c180269d27bfadc9e79e20c233b06e49c3127732 Author: Yuan Yao Date: Fri Mar 4 11:49:33 2022 -0800 KVM: VMX: Use vcpu_to_pi_desc() uniformly in posted_intr.c The helper function, vcpu_to_pi_desc(), is defined to get the posted interrupt descriptor from vcpu. There is one place that doesn't use it, and instead references vmx_vcpu->pi_desc directly. Remove the inconsistency. Signed-off-by: Yuan Yao Signed-off-by: Isaku Yamahata Message-Id: Signed-off-by: Paolo Bonzini commit f502cc568de95e5ed9cc9e6133fa454fbe0c5c01 Author: Sean Christopherson Date: Fri Mar 4 11:48:38 2022 -0800 KVM: Add max_vcpus field in common 'struct kvm' For TDX guests, the maximum number of vcpus needs to be specified when the TDX guest VM is initialized (creating the TDX data corresponding to TDX guest) before creating vcpu. It needs to record the maximum number of vcpus on VM creation (KVM_CREATE_VM) and return error if the number of vcpus exceeds it Because there is already max_vcpu member in arm64 struct kvm_arch, move it to common struct kvm and initialize it to KVM_MAX_VCPUS before kvm_arch_init_vm() instead of adding it to x86 struct kvm_arch. Signed-off-by: Sean Christopherson Signed-off-by: Isaku Yamahata Message-Id: Signed-off-by: Paolo Bonzini commit 6fcee03df6a1a3101a77344be37bb85c6142d56c Author: Maxim Levitsky Date: Tue Mar 22 19:24:42 2022 +0200 KVM: x86: avoid loading a vCPU after .vm_destroy was called This can cause various unexpected issues, since VM is partially destroyed at that point. For example when AVIC is enabled, this causes avic_vcpu_load to access physical id page entry which is already freed by .vm_destroy. Fixes: 8221c1370056 ("svm: Manage vcpu load/unload when enable AVIC") Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit ab65f49253ff706723ecbf87af74e9383b5e4582 Author: Borislav Petkov Date: Mon May 2 17:33:40 2022 +0200 x86/sev: Fix address space sparse warning Fix: arch/x86/kernel/sev.c:605:16: warning: incorrect type in assignment (different address spaces) arch/x86/kernel/sev.c:605:16: expected struct snp_secrets_page_layout *layout arch/x86/kernel/sev.c:605:16: got void [noderef] __iomem *[assigned] mem Reported-by: kernel test robot Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/202205022233.XgNDR7WR-lkp@intel.com commit 5bd2927aceba181b84286e00aa2f56e117e699c3 Author: Sven Peter Date: Sun May 1 16:55:12 2022 +0200 nvme-apple: Add initial Apple SoC NVMe driver Apple SoCs such as the M1 come with an embedded NVMe controller that is not attached to any PCIe bus. Additionally, it doesn't conform to the NVMe specification and requires a bunch of changes to command submission and IOMMU configuration to work. Reviewed-by: Christoph Hellwig Reviewed-by: Arnd Bergmann Signed-off-by: Sven Peter commit 82b96552f15a05ee9f31813178e024720aa5b9bc Author: Sven Peter Date: Sun May 1 16:55:09 2022 +0200 dt-bindings: nvme: Add Apple ANS NVMe Apple SoCs such as the M1 come with an embedded NVMe coprocessor called ANS2. Reviewed-by: Rob Herring Signed-off-by: Sven Peter commit b170143ae1113882731666aec9b9105356f1fc17 Author: Sven Peter Date: Sun May 1 16:55:08 2022 +0200 soc: apple: Add SART driver The NVMe co-processor on the Apple M1 uses a DMA address filter called SART for some DMA transactions. This adds a simple driver used to configure the memory regions from which DMA transactions are allowed. Unlike a real IOMMU, SART does not support any pagetables and can't be implemented inside the IOMMU subsystem using iommu_ops. It also can't be implemented using dma_map_ops since not all DMA transactions of the NVMe controller are filtered by SART. Instead, most buffers have to be registered using the integrated NVMe IOMMU and we can't have two separate dma_map_ops implementations for a single device. Co-developed-by: Hector Martin Reviewed-by: Arnd Bergmann Signed-off-by: Hector Martin Signed-off-by: Sven Peter commit 6a47a16dcef3fdda79a95452964d001a620db473 Author: Uwe Kleine-König Date: Thu Apr 28 18:28:03 2022 +0200 drm/bridge: tfp410: Make tfp410_fini() return void tfp410_fini() always returns zero. Make it return no value which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and platform driver remove callbacks is ignored anyway. This prepares making i2c and platform remove callbacks return void, too. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220428162803.185275-1-u.kleine-koenig@pengutronix.de commit 463db5c2ed4aed015323bf0677fdb126e77d01a8 Author: Marek Vasut Date: Tue Apr 26 21:36:45 2022 +0200 drm: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Implement a simple bridge driver for this serializer. -- - Add sentinel of_device_table - Add RB from Sam - Rename to fsl-ldb altogether Reviewed-by: Sam Ravnborg Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Peng Fan Cc: Robby Cai Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org V2: - Rename syscon to fsl,syscon V3: - Consistently use MX8MP V4: - Fix MODULE_DESCRIPTION to also use MX8MP Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220426193645.244792-2-marex@denx.de commit 666518676d4fea1517043d6008df4f67ea19b5dd Author: Marek Vasut Date: Tue Apr 26 21:36:44 2022 +0200 dt-bindings: display: bridge: ldb: Implement simple Freescale i.MX8MP LDB bridge The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Add DT binding which represents this serializer as a bridge. Acked-by: Sam Ravnborg Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Peng Fan Cc: Rob Herring Cc: Robby Cai Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220426193645.244792-1-marex@denx.de commit 0d3b26c4b97ae1a561070a973f0b2086e3644d1a Author: Jakub Kicinski Date: Fri Apr 29 10:46:41 2022 -0700 rtw88: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429174643.196994-2-kuba@kernel.org commit ab0af093bf905a7616eaf247469bc8ee3c117e22 Author: Alvin Šipraga Date: Sat Apr 23 14:08:53 2022 +0200 drm: bridge: adv7511: use non-legacy mode for CEC RX The ADV7511 family of bridges supports two modes for CEC RX: legacy and non-legacy mode. The only difference is whether the chip uses a single CEC RX buffer, or uses all three available RX buffers. Currently the adv7511 driver uses legacy mode. While debugging a stall in CEC RX on an ADV7535, we reached out to Analog Devices, who suggested to use non-legacy mode instead. According to the programming guide for the ADV7511 [1], and the register control manual of the ADV7535 [2], this is the default behaviour on reset. As previously stated, the adv7511 driver currently overrides this to legacy mode. This patch updates the adv7511 driver to instead use non-legacy mode with all three CEC RX buffers. As a result of this change, we no longer experience any stalling of CEC RX with the ADV7535. It is not known why non-legacy mode solves this particular issue, but besides this, no functional change is to be expected by this patch. Please note that this has only been tested on an ADV7535. What follows is a brief description of the non-legacy mode interrupt handling behaviour. The programming guide in [1] gives a more detailed explanation. With three RX buffers, the interrupt handler checks the CEC_RX_STATUS register (renamed from CEC_RX_ENABLE in this patch), which contains 2-bit psuedo-timestamps for each of the RX buffers. The RX timestamps for each buffer represent the time of arrival for the CEC frame held in a given buffer, with lower timestamp values indicating chronologically older frames. A special value of 0 indicates that the given RX buffer is inactive and should be skipped. The interrupt handler parses these timestamps and then reads the active RX buffers in the prescribed order using the same logic as before. Changes have been made to ensure that the correct RX buffer is cleared after processing. This clearing procesure also sets the timestamp of the given RX buffer to 0 to mark it as inactive. [1] https://www.analog.com/media/en/technical-documentation/user-guides/ADV7511_Programming_Guide.pdf cf. CEC Map, register 0x4A, bit 3, default value 1: 0 = Use only buffer 0 to store CEC frames (Legacy mode) 1 = Use all 3 buffers to stores the CEC frames (Non-legacy mode) [2] The ADV7535 register control manual is under NDA, but trust me when I say that non-legacy CEC RX mode is the default here too. Here the register is offset by 0x70 and has an address of 0xBA in the DSI_CEC regiser map. Signed-off-by: Alvin Šipraga Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220423120854.1503163-3-alvin@pqrs.dk commit 0aae7623b4952212781cd48fa411ead52608f6eb Author: Alvin Šipraga Date: Sat Apr 23 14:08:52 2022 +0200 drm: bridge: adv7511: enable CEC support for ADV7535 Like the ADV7533, the ADV7535 has an offset for the CEC register map, and it is the same value (ADV7533_REG_CEC_OFFSET = 0x70). Rather than testing for numerous chip types in the offset calculations throughout the driver, just compute it during driver probe and put it in the private adv7511 data structure. Signed-off-by: Alvin Šipraga Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220423120854.1503163-2-alvin@pqrs.dk commit 46ca7da7f1e8592af6059419176dd58c10dcdb5b Author: Pin-Yen Lin Date: Mon Apr 25 21:44:24 2022 +0800 drm/bridge: it6505: Send DPCD SET_POWER to downstream Send DPCD SET_POWER command to downstream in .atomic_disable to make the downstream monitor enter the power down mode, so the device suspend won't be affected. Fixes: b5c84a9edcd418 ("drm/bridge: add it6505 driver") Signed-off-by: Pin-Yen Lin Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220425134424.1150965-1-treapking@chromium.org Reviewed-by: Robert Foss commit 7eafbecd2288c542ea15ea20cf1a7e64a25c21bc Author: Jagan Teki Date: Thu Nov 11 15:11:03 2021 +0530 drm/panel: panel-simple: Fix proper bpc for AM-1280800N3TZQW-T00H AM-1280800N3TZQW-T00H panel support 8 bpc not 6 bpc as per recent testing in i.MX8MM platform. Fix it. Fixes: bca684e69c4c ("drm/panel: simple: Add AM-1280800N3TZQW-T00H") Signed-off-by: Jagan Teki Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211111094103.494831-1-jagan@amarulasolutions.com commit 54a6f29522da3c914da30e50721dedf51046449a Author: Xiaomeng Tong Date: Mon Mar 28 20:28:20 2022 +0800 carl9170: tx: fix an incorrect use of list iterator If the previous list_for_each_entry_continue_rcu() don't exit early (no goto hit inside the loop), the iterator 'cvif' after the loop will be a bogus pointer to an invalid structure object containing the HEAD (&ar->vif_list). As a result, the use of 'cvif' after that will lead to a invalid memory access (i.e., 'cvif->id': the invalid pointer dereference when return back to/after the callsite in the carl9170_update_beacon()). The original intention should have been to return the valid 'cvif' when found in list, NULL otherwise. So just return NULL when no entry found, to fix this bug. Cc: stable@vger.kernel.org Fixes: 1f1d9654e183c ("carl9170: refactor carl9170_update_beacon") Signed-off-by: Xiaomeng Tong Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328122820.1004-1-xiam0nd.tong@gmail.com commit 3b3299a1080e357c540e968b704f2eeb46a697f7 Author: Jakub Kicinski Date: Fri Apr 29 10:46:43 2022 -0700 wil6210: use NAPI_POLL_WEIGHT for napi budget The comment next to WIL6210_NAPI_BUDGET says "arbitrary". If we're picking arbitrary values let's pick the recommended default which is NAPI_POLL_WEIGHT. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429174643.196994-4-kuba@kernel.org commit 52bcfd1b239b0a62d863b92abcc1a04528a41946 Author: Jakub Kicinski Date: Fri Apr 29 10:46:42 2022 -0700 ath10k: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429174643.196994-3-kuba@kernel.org commit 00402f49d26ffe991892bba76ccbdfed26538824 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:35:02 2022 +0530 ath11k: Add support for WCN6750 device WCN6750 is non-DBS 2x2 11AX chipset. Unlike QCA6390 which is a DBS (dual band simultaneous) solution (2 LMACs), WCN6750 has a single LMAC supporting 2G, 5G and 6G bands but will operate only on one band at any given point. WCN6750 is a PCIe based solution, but it is attached to the WPSS (Wireless Processor SubSystem) Q6 processor, hence it is enumerated by the Q6 processor. It is registered to the APSS processor (Application Processor SubSystem) as a platform device(AHB) and remoteproc APIs are used to boot up or shutdown the device like other AHB devices. Also, Device information like BAR and it's size is not known to the APSS processor as the chip is enumerated by WPSS Q6. These details are fetched over QMI. STA and AP modes are supported. Verified basic connectivity and ping in both the modes. An important point to note is that though WCN6750 is a PCIe device, it cannot be attached to any other platform except on Qualcomm Snapdragon SoCs due to the aforementioned reasons. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-10-quic_mpubbise@quicinc.com commit e67ba19739177f95706c1d4a53c884c89973b843 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:35:01 2022 +0530 ath11k: Datapath changes to support WCN6750 HAL RX descriptor for WCN6750 is same as QCN9074, this means that the size of the HAL RX decriptor and the DP APIs that WCN6750 requires to enable datapath should be initialized with that of QCN9074's RX descriptor size and the DP APIs respectively. There is one change wrt to REO configuration though, REO configuration for WCN6750 follows WCN6855, therefore use reo_setup() of WCN6855 for WCN6750. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-9-quic_mpubbise@quicinc.com commit 49890d9c93d5abf21babda2b495c7d3014fb9c98 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:35:00 2022 +0530 ath11k: HAL changes to support WCN6750 Add HAL changes required to support WCN6750. Offsets of some registers for WCN6750 are different from other supported devices; move such register offsets to platform specific ath11k_hw_regs. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-8-quic_mpubbise@quicinc.com commit 73d3e71306fe864d9667e8d37f731e93a91e2040 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:59 2022 +0530 ath11k: Add QMI changes for WCN6750 In the case of WCN6750, FW doesn't request for DDR memory via QMI, instead it uses a fixed 12MB reserved Memory region in the DDR which is called as MSA region. As a result, QMI message sequence is not same as other ath11k supported devices. Also, M3 firmware will be bundled into the FW and will be downloaded to the target as part of Q6 boot. This is the QMI flow in the case of WCN6750, 1) QMI firmware indication REQ/RESP 2) QMI host capability REQ/RESP 3) QMI target capability REQ/RESP 4) QMI device info REQ/RESP 5) QMI BDF download 6) QMI FW ready Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-7-quic_mpubbise@quicinc.com commit 676f8905fff904ea3e4ee52086a18ab54912b410 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:58 2022 +0530 ath11k: Fetch device information via QMI for WCN6750 Since WPPS Q6 does the PCIe enumeration of WCN6750, device information like BAR and BAR size is not known to the APPS processor (Application Processor SubSystem). In order to fetch these details, a QMI message called device info request will be sent to the target. Therefore, add logic to fetch BAR details from the target. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-6-quic_mpubbise@quicinc.com commit 56c8ccf331bd2ebf8b85f70efb4844803ef3f768 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:57 2022 +0530 ath11k: Add register access logic for WCN6750 WCN6750 uses static window mapping to access the HW registers. Unlike QCN9074 which uses 3rd window for UMAC and 2nd window for CE register access, WCN6750 uses 1st window for UMAC and 2nd window for CE registers. Also, refactor the code so that WCN6750 can use the existing ath11k_pci_read32/write32() APIs for accessing the registers. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-5-quic_mpubbise@quicinc.com commit d1e1edfde0352321af52599ad447b71c91bc6e76 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:56 2022 +0530 ath11k: Add HW params for WCN6750 WCN6750 is a PCIe based solution that is attached to and enumerated by the WPSS (Wireless Processor SubSystem) Q6 processor. Though it is a PCIe device, since it is not attached to APSS processor (Application Processor SubSystem), APSS will be unaware of such a decice and hence it is registered to the APSS processor as a platform device(AHB). Because of this hybrid nature, it is called as a hybrid bus device. A new variable hybrid_bus_type is defined in hw_params to indicate the hybrid nature of the device. Add HW params for WCN6750. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-4-quic_mpubbise@quicinc.com commit 92c1858e4399edc093a41cbf8f74874bdab59da7 Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:55 2022 +0530 ath11k: Move parameters in bus_params to hw_params In ath11k, bus_params were added with an intention to hold parameters related to bus (AHB/PCI), but this is not true as some bus parameters being different between chipsets of the same bus. With the addition of WCN6750 to ath11k, bus parameters are going to be entirely different among AHB devices. Therefore, it is wise to move bus_params to hw_params and get rid of bus_params entirely. Also, mhi_support parameter is not used anywhere in the driver, remove it from bus_params. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-3-quic_mpubbise@quicinc.com commit 00fd24089b8154ddf5b3e724e2c4c9974b9ba91e Author: Manikanta Pubbisetty Date: Fri Apr 29 22:34:54 2022 +0530 dt: bindings: net: add bindings of WCN6750 for ath11k WCN6750 is the WLAN chip on Qualcomm Snapdragon SoC SC7280; Though being a PCIe based solution, it is not attached to the APSS processor (Application Processor SubSystem), it is instead attached to another tiny processor called WPSS Q6 processor (Wireless Processor SubSystem) on the SC7280 MSM, where the WLAN firmware runs, and it is the WLAN firmware running on the Q6 processor which enumerates WCN6750, as a result APPS processor would never know such a device being present in the system and would not detect the WCN6750 hardware unless and otherwise WCN6750 is registered as a platform device. This is the reason behind adding WCN6750 WLAN node in the device tree. Add WCN6750 wireless driver support, its based on ath11k driver. Reviewed-by: Rob Herring Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429170502.20080-2-quic_mpubbise@quicinc.com commit 3a597f0d425b2160ce4278c3e1c8384bec8ccfb4 Author: Wen Gong Date: Fri Apr 29 16:15:02 2022 +0300 ath11k: change management tx queue to avoid connection timed out In the phase of wlan load, it has hw scan and 11d scan which sent to firmware by ath11k, then hw scan and 11d scan will use about 14 seconds, and meanwhile ath11k_reg_update_chan_list() is running in workqueue of ath11k_base, and wait for 11d scan/hw scan finished. When the hw scan finished, mac80211 will start to connect and send management packet, at this moment, ath11k_reg_update_chan_list() is still waiting for 11d scan finished, so wmi_mgmt_tx_work of ath11k will not run and thus the tx management packet also not send out and lead authentication timed out. log: INFO kernel: [ 187.885322] wlan0: authenticate with 72:6c:57:43:9f:90 INFO kernel: [ 187.937266] wlan0: send auth to 72:6c:57:43:9f:90 (try 1/3) INFO kernel: [ 188.626944] wlan0: send auth to 72:6c:57:43:9f:90 (try 2/3) INFO kernel: [ 189.650999] wlan0: send auth to 72:6c:57:43:9f:90 (try 3/3) INFO kernel: [ 190.651917] wlan0: authentication with 72:6c:57:43:9f:90 timed out Change wmi_mgmt_tx_work to another queue workqueue_aux of ath11k_base, then connection success. 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/20220428023320.4007-1-quic_wgong@quicinc.com commit 7330e1ec9748948177830c6e1a13379835d577f9 Author: Wen Gong Date: Fri Apr 29 16:15:02 2022 +0300 ath11k: fix warning of not found station for bssid in message When test connect/disconnect to an AP frequently with WCN6855, sometimes it show below log. [ 277.040121] wls1: deauthenticating from 8c:21:0a:b3:5a:64 by local choice (Reason: 3=DEAUTH_LEAVING) [ 277.050906] ath11k_pci 0000:05:00.0: wmi stats vdev id 0 mac 00:03:7f:29:61:11 [ 277.050944] ath11k_pci 0000:05:00.0: wmi stats bssid 8c:21:0a:b3:5a:64 vif pK-error [ 277.050954] ath11k_pci 0000:05:00.0: not found station for bssid 8c:21:0a:b3:5a:64 [ 277.050961] ath11k_pci 0000:05:00.0: failed to parse rssi chain -71 [ 277.050967] ath11k_pci 0000:05:00.0: failed to pull fw stats: -71 [ 277.050976] ath11k_pci 0000:05:00.0: wmi stats vdev id 0 mac 00:03:7f:29:61:11 [ 277.050983] ath11k_pci 0000:05:00.0: wmi stats bssid 8c:21:0a:b3:5a:64 vif pK-error [ 277.050989] ath11k_pci 0000:05:00.0: not found station for bssid 8c:21:0a:b3:5a:64 [ 277.050995] ath11k_pci 0000:05:00.0: failed to parse rssi chain -71 [ 277.051000] ath11k_pci 0000:05:00.0: failed to pull fw stats: -71 [ 278.064050] ath11k_pci 0000:05:00.0: failed to request fw stats: -110 Reason is: When running disconnect operation, sta_info removed from local->sta_hash by __sta_info_destroy_part1() from __sta_info_flush(), after this, ieee80211_find_sta_by_ifaddr() which called by ath11k_wmi_tlv_fw_stats_data_parse() and ath11k_wmi_tlv_rssi_chain_parse() cannot find this station, then failed log printed. steps are like this: 1. when disconnect from AP, __sta_info_destroy() called __sta_info_destroy_part1() and __sta_info_destroy_part2(). 2. in __sta_info_destroy_part1(), it has "sta_info_hash_del(local, sta)" and "list_del_rcu(&sta->list)", it will remove the ieee80211_sta from the list of ieee80211_hw. 3. in __sta_info_destroy_part2(), it called drv_sta_state()->ath11k_mac_op_sta_state(), then peer->sta is clear at this moment. 4. in __sta_info_destroy_part2(), it then called sta_set_sinfo()->drv_sta_statistics() ->ath11k_mac_op_sta_statistics(), then WMI_REQUEST_STATS_CMDID sent to firmware. 5. WMI_UPDATE_STATS_EVENTID reported from firmware, at this moment, the ieee80211_sta can not be found again because it has remove from list in step2 and also peer->sta is clear in step3. 6. in __sta_info_destroy_part2(), it then called cleanup_single_sta()-> sta_info_free()->kfree(sta), at this moment, the ieee80211_sta is freed in memory, then the failed log will not happen because function ath11k_mac_op_sta_state() will not be called. Actually this print log is not a real error, it is only to skip parse the info, so change to skip print by default debug setting. 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/20220428022426.2927-1-quic_wgong@quicinc.com commit 5f8dac3fc7bae246cc666d0df1ba37fc077efc3d Author: Yury Norov Date: Wed Feb 9 15:54:34 2022 -0800 qed: replace bitmap_weight with bitmap_empty in qed_roce_stop() qed_roce_stop() calls bitmap_weight() to check if any bit of a given bitmap is set. We can do it more efficiently with bitmap_empty() because bitmap_empty() stops traversing the bitmap as soon as it finds first set bit, while bitmap_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Acked-by: Prabhakar Kushwaha commit 2b330a6a6c21a9b9f4ce71e5c0be494ab577423c Author: Yury Norov Date: Sun Jan 23 10:38:40 2022 -0800 octeontx2-pf: replace bitmap_weight with bitmap_empty where appropriate In some places, octeontx2 code calls bitmap_weight() to check if any bit of a given bitmap is set. It's better to use bitmap_empty() in that case because bitmap_empty() stops traversing the bitmap as soon as it finds first set bit, while bitmap_weight() counts all bits unconditionally. Signed-off-by: Yury Norov commit fe06a0c09b47ea58ba2b01c8941af16bd45c02df Author: Yury Norov Date: Sun Jan 23 10:38:37 2022 -0800 KVM: x86: replace bitmap_weight with bitmap_empty where appropriate In some places kvm/hyperv.c code calls bitmap_weight() to check if any bit of a given bitmap is set. It's better to use bitmap_empty() in that case because bitmap_empty() stops traversing the bitmap as soon as it finds first set bit, while bitmap_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Reviewed-by: Vitaly Kuznetsov Reviewed-by: Sean Christopherson Reviewed-by: Andy Shevchenko commit 64b87c1a1875803296a47b6b03f73dd2b292932f Author: Yury Norov Date: Sun Jan 23 10:38:41 2022 -0800 qed: rework qed_rdma_bmap_free() qed_rdma_bmap_free() is mostly an opencoded version of printk("%*pb"). Using %*pb format simplifies the code, and helps to avoid inefficient usage of bitmap_weight(). While here, reorganize logic to avoid calculating bmap weight if check is false. Signed-off-by: Yury Norov commit c8f14e2b737f8d3136f1012e67af99239bb30850 Author: Yury Norov Date: Wed Feb 9 10:28:16 2022 -0800 iio: fix opencoded for_each_set_bit() iio_simple_dummy_trigger_h() is mostly an opencoded for_each_set_bit(). Using for_each_set_bit() make code much cleaner, and more effective. Signed-off-by: Yury Norov commit 3a351118dc847856c1052f2bb7c76ad3d7ffbb66 Author: Yury Norov Date: Sun Jan 23 10:38:35 2022 -0800 net: mellanox: fix open-coded for_each_set_bit() Mellanox driver has an open-coded for_each_set_bit(). Fix it. Signed-off-by: Yury Norov Reviewed-by: Tariq Toukan commit 1ef1b69beaad10aab85292b822c7cfed4fb01586 Author: Yury Norov Date: Sun Jan 23 10:38:33 2022 -0800 net: systemport: don't use bitmap_weight() in bcm_sysport_rule_set() Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov Acked-by: Florian Fainelli commit e18e5cbc70f17029c3d028ee701cecc45b7618b4 Author: Yury Norov Date: Sun Jan 23 10:38:32 2022 -0800 net: dsa: don't use bitmap_weight() in b53_arl_read() Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov Acked-by: Florian Fainelli commit 0decb97cb105e85be979432bfc17491df7c6d6d1 Merge: d7ab15ab34a49 02839cc8d72b4 Author: Paolo Abeni Date: Mon May 2 15:14:22 2022 +0200 Merge branch 'net-more-heap-allocation-and-split-of-rtnl_newlink' Jakub Kicinski says: ==================== net: more heap allocation and split of rtnl_newlink() Small refactoring of rtnl_newlink() to fix a stack usage warning and make the function shorter. ==================== Link: https://lore.kernel.org/r/20220429235508.268349-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 02839cc8d72b49c1440b5019b3f40ca49c4824e5 Author: Jakub Kicinski Date: Fri Apr 29 16:55:08 2022 -0700 rtnl: move rtnl_newlink_create() Pure code move. Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 63105e83987a08f73accfba78602a073bf219b69 Author: Jakub Kicinski Date: Fri Apr 29 16:55:07 2022 -0700 rtnl: split __rtnl_newlink() into two functions __rtnl_newlink() is 250LoC, but has a few clear sections. Move the part which creates a new netdev to a separate function. For ease of review code will be moved in the next change. Signed-off-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit c92bf26ccebc8501863b38c4a4f65b8fef28ce5e Author: Jakub Kicinski Date: Fri Apr 29 16:55:06 2022 -0700 rtnl: allocate more attr tables on the heap Commit a293974590cf ("rtnetlink: avoid frame size warning in rtnl_newlink()") moved to allocating the largest attribute array of rtnl_newlink() on the heap. Kalle reports the stack has grown above 1k again: net/core/rtnetlink.c:3557:1: error: the frame size of 1104 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Move more attrs to the heap, wrap them in a struct. Don't bother with linkinfo, it's referenced a lot and we take its size so it's awkward to move, plus it's small (6 elements). Reported-by: Kalle Valo Signed-off-by: Jakub Kicinski Tested-by: Kalle Valo Signed-off-by: Paolo Abeni commit 9923a6dace1682518efe4aa872cc317fa43c2a55 Author: Yang Li Date: Sat Feb 20 16:57:35 2021 +0800 powerpc/sstep: Use bitwise instead of arithmetic operator for flags Fix the following coccinelle warnings: ./arch/powerpc/lib/sstep.c:1090:20-21: WARNING: sum of probable bitmasks, consider | ./arch/powerpc/lib/sstep.c:1115:20-21: WARNING: sum of probable bitmasks, consider | ./arch/powerpc/lib/sstep.c:1134:20-21: WARNING: sum of probable bitmasks, consider | Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1613811455-2457-1-git-send-email-yang.lee@linux.alibaba.com commit 22f8e625ebabd7ed3185b82b44b4f12fc0402113 Author: Randy Dunlap Date: Thu Jan 21 17:08:19 2021 -0800 powerpc/8xx: export 'cpm_setbrg' for modules Fix missing export for a loadable module build: ERROR: modpost: "cpm_setbrg" [drivers/tty/serial/cpm_uart/cpm_uart.ko] undefined! Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc") Signed-off-by: Randy Dunlap Reported-by: kernel test robot [chleroy: Changed Fixes: tag] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210122010819.30986-1-rdunlap@infradead.org commit cacaeb0c23979d20652d862e8ff974d9d7244e2d Author: Wang Wensheng Date: Wed Sep 23 07:14:53 2020 +0000 powerpc/perf: Fix symbol undeclared warning Build kernel with `C=2`: arch/powerpc/perf/isa207-common.c:24:18: warning: symbol 'isa207_pmu_format_attr' was not declared. Should it be static? arch/powerpc/perf/power9-pmu.c:101:5: warning: symbol 'p9_dd21_bl_ev' was not declared. Should it be static? arch/powerpc/perf/power9-pmu.c:115:5: warning: symbol 'p9_dd22_bl_ev' was not declared. Should it be static? Those symbols are used only in the files that define them so we declare them as static to fix the warnings. Signed-off-by: Wang Wensheng Reviewed-by: Athira Rajeev Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200923071453.2540-1-wangwensheng4@huawei.com commit 634a0b8fb8826aa990df621a00158a052374b538 Author: Xu Wang Date: Wed Jul 8 07:22:28 2020 +0000 powerpc/pseries/dlpar: Remove unnecessary cast to kfree() Remove unnecassary cast in the argument to kfree(). Signed-off-by: Xu Wang Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200708072228.30776-1-vulab@iscas.ac.cn commit 7641c1bafacdfcf0cb5e7da59238fbc501da92d6 Author: Fuqian Huang Date: Thu Jul 4 00:28:21 2019 +0800 macintosh: Use kmemdup rather than duplicating its implementation kmemdup is introduced to duplicate a region of memory in a neat way. Rather than kmalloc/kzalloc + memcpy, which the programmer needs to write the size twice (sometimes lead to mistakes), kmemdup improves readability, leads to smaller code and also reduce the chances of mistakes. Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy. Signed-off-by: Fuqian Huang [chleroy: Fixed parenthesis alignment] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190703162821.32322-1-huangfq.daxian@gmail.com commit 9e6a90790357e8b468445f5c549c498126cedefb Merge: 1e70d57e72859 672c0c5173427 Author: Greg Kroah-Hartman Date: Mon May 2 14:56:14 2022 +0200 Merge 5.18-rc5 into tty-next We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit f4b62e1e1137507268c2c63dc4e6da279dc58e9f Author: Maciej W. Rozycki Date: Sun Apr 24 12:47:30 2022 +0100 time/sched_clock: Fix formatting of frequency reporting code Use flat rather than nested indentation for chained else/if clauses as per coding-style.rst: if (x == y) { .. } else if (x > y) { ... } else { .... } This also improves readability. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Acked-by: John Stultz Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204240148220.9383@angie.orcam.me.uk commit cc1b923a4e378c943386e7fe6205918d43e5fede Author: Maciej W. Rozycki Date: Sun Apr 24 12:47:26 2022 +0100 time/sched_clock: Use Hz as the unit for clock rate reporting below 4kHz The kernel uses kHz as the unit for clock rates reported between 1MHz (inclusive) and 4MHz (exclusive), e.g.: sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns This reduces the amount of data lost due to rounding, but hasn't been replicated for the kHz range when support was added for proper reporting of sub-kHz clock rates. Take the same approach for rates between 1kHz (inclusive) and 4kHz (exclusive), which makes it consistent. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204240106380.9383@angie.orcam.me.uk commit 92067440f1311dfa4d77b57a9da6b3706f5da32e Author: Maciej W. Rozycki Date: Sun Apr 24 12:47:20 2022 +0100 time/sched_clock: Round the frequency reported to nearest rather than down The frequency reported for clock sources are rounded down, which gives misleading figures, e.g.: I/O ASIC clock frequency 24999480Hz sched_clock: 32 bits at 24MHz, resolution 40ns, wraps every 85901132779ns MIPS counter frequency 59998512Hz sched_clock: 32 bits at 59MHz, resolution 16ns, wraps every 35792281591ns Rounding to nearest is more adequate: I/O ASIC clock frequency 24999664Hz sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85900499947ns MIPS counter frequency 59999728Hz sched_clock: 32 bits at 60MHz, resolution 16ns, wraps every 35791556599ns Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Acked-by: John Stultz Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204240055590.9383@angie.orcam.me.uk commit 30a35c07d9e9affaebd557c454df98e5ba269776 Author: Peng Fan Date: Mon Apr 25 19:11:35 2022 +0800 gpio: vf610: drop the SOC_VF610 dependency for GPIO_VF610 i.MX7ULP, i.MX8 and i.MX9 use this driver, so drop the SOC_VF610 dependcy to make the driver could be built for i.MX platform. Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit ce4818957fdc5bca57fc2c92b0dfe109d26bcc47 Author: Minghao Chi Date: Mon Apr 18 11:07:16 2022 +0000 genirq: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() pm_runtime_resume_and_get() achieves the same and simplifies the code. [ tglx: Simplify it further by presetting retval ] Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220418110716.2559453-1-chi.minghao@zte.com.cn commit 90be8d6c1f91e1e5121c219726524c91b52bfc20 Author: Thomas Gleixner Date: Fri Apr 15 11:19:38 2022 +0200 timekeeping: Consolidate fast timekeeper Provide a inline function which replaces the copy & pasta. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220415091921.072296632@linutronix.de commit eff4849f928f2b90402907e06a6de1619cf16b1a Author: Thomas Gleixner Date: Fri Apr 15 11:19:35 2022 +0200 timekeeping: Annotate ktime_get_boot_fast_ns() with data_race() Accessing timekeeper::offset_boot in ktime_get_boot_fast_ns() is an intended data race as the reader side cannot synchronize with a writer and there is no space in struct tk_read_base of the NMI safe timekeeper. Mark it so. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220415091920.956045162@linutronix.de commit 0e509f537f8ddd89f237e62f77818dbdbc8be395 Merge: f8ae07f4b8bfd 672c0c5173427 Author: Greg Kroah-Hartman Date: Mon May 2 13:56:48 2022 +0200 Merge 5.18-rc5 into driver-core-next We need the kernfs/driver core fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 35a7609639c49f76f13f206402cbf692c4ae3e4e Merge: e918c10265ef2 672c0c5173427 Author: Greg Kroah-Hartman Date: Mon May 2 13:49:24 2022 +0200 Merge 5.18-rc5 into char-misc-next We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit bc055a50a8594a634e09a7286601d0d2bd51c734 Author: Biju Das Date: Sat Apr 23 14:47:52 2022 +0100 dt-bindings: phy: renesas,usb2-phy: Document RZ/G2UL phy bindings Document USB phy bindings for RZ/G2UL SoC. RZ/G2UL USB phy is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-usb2-phy" will be used as a fallback. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220423134752.143090-1-biju.das.jz@bp.renesas.com Signed-off-by: Vinod Koul commit d7ab15ab34a491b3837595b629e79323a1922fc8 Merge: 2fc9f69edd216 d18af067c98eb Author: Paolo Abeni Date: Mon May 2 13:21:40 2022 +0200 Merge branch 'use-mmd-c45-helpers' Andrew Lunn says: ==================== Use MMD/C45 helpers MDIO busses can perform two sorts of bus transaction, defined in clause 22 and clause 45 of 802.3. This results in two register addresses spaces. The current driver structure for indicating if C22 or C45 should be used is messy, and many C22 only bus drivers will wrongly interpret a C45 transaction as a C22 transaction. This patchset is a preparation step to cleanup the situation. It converts MDIO bus users to make use of existing _mmd and _c45 helpers to perform accesses to C45 registers. This will later allow C45 and C22 to be kept separate. ==================== Link: https://lore.kernel.org/r/20220430173037.156823-1-andrew@lunn.ch Signed-off-by: Paolo Abeni commit d18af067c98eb187b8d9fe1f4e2e59ba3ad0a1d8 Author: Andrew Lunn Date: Sat Apr 30 19:30:37 2022 +0200 net: pcs: pcs-xpcs: Convert to mdiobus_c45_read Stop using the helpers to construct a special mdio address which indicates C45. Instead use the C45 accessors, which will call the busses C45 specific read/write API. Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Andrew Lunn Signed-off-by: Paolo Abeni commit 639e4b93ab68f5f5fc4734c766124ca96c167f14 Author: Andrew Lunn Date: Sat Apr 30 19:30:36 2022 +0200 net: dsa: sja1105: Convert to mdiobus_c45_read Stop using the helpers to construct a special phy address which indicates C45. Instead use the C45 accessors, which will call the busses C45 specific read/write API. Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: Andrew Lunn Signed-off-by: Paolo Abeni commit cad75717c71b49149fbb1ab136bf88a85274d01e Author: Andrew Lunn Date: Sat Apr 30 19:30:35 2022 +0200 net: phy: bcm87xx: Use mmd helpers Rather than construct special phy device addresses to access C45 registers, use the mmd helpers. These will directly call the C45 API of the MDIO bus driver. Signed-off-by: Andrew Lunn Signed-off-by: Paolo Abeni commit 260bdfea873aec8fe8990154c722abe3a0a6d8d3 Author: Andrew Lunn Date: Sat Apr 30 19:30:34 2022 +0200 net: phy: Convert to mdiobus_c45_{read|write} Stop using the helpers to construct a special phy address which indicates C45. Instead use the C45 accessors, which will call the busses C45 specific read/write API. Signed-off-by: Andrew Lunn Signed-off-by: Paolo Abeni commit 70dcf3cdc342b8c3613614a24e587aa524a01c14 Author: Andrew Lunn Date: Sat Apr 30 19:30:33 2022 +0200 net: phylink: Convert to mdiobus_c45_{read|write} Stop using the helpers to construct a special phy address which indicates C45. Instead use the C45 accessors, which will call the busses C45 specific read/write API. Signed-off-by: Andrew Lunn Signed-off-by: Paolo Abeni commit 2fc9f69edd2165f9047ae97cfad2341e82bd3437 Merge: ae664d9d8559b 28b250e070e9a Author: Paolo Abeni Date: Mon May 2 13:03:50 2022 +0200 Merge tag 'linux-can-next-for-5.19-20220502' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-05-02 this is a pull request of 9 patches for net-next/master. The first patch is by Biju Das and documents renesas,r9a07g043-canfd support in the renesas,rcar-canfd bindings document. Jakub Kicinski's patch removes a copy of the NAPI_POLL_WEIGHT define from the m_can driver. The last 7 patches all target the ctucanfd driver. Pavel Pisa provides 2 patch which update the documentation. 2 patches by Jiapeng Chong remove unneeded includes and error messages. And another 3 patches by Pavel Pisa to further clean up the driver (remove inline keyword, remove unneeded debug statements, and remove unneeded module parameters). linux-can-next-for-5.19-20220502 * tag 'linux-can-next-for-5.19-20220502' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: ctucanfd: remove PCI module debug parameters can: ctucanfd: remove debug statements can: ctucanfd: remove inline keyword from local static functions can: ctucanfd: ctucan_platform_probe(): remove unnecessary print function dev_err() can: ctucanfd: remove unused including docs: networking: device drivers: can: ctucanfd: update author e-mail docs: networking: device drivers: can: add ctucanfd to index can: m_can: remove a copy of the NAPI_POLL_WEIGHT define dt-bindings: can: renesas,rcar-canfd: Document RZ/G2UL support ==================== Link: https://lore.kernel.org/r/20220502075914.1905039-1-mkl@pengutronix.de Signed-off-by: Paolo Abeni commit ae664d9d8559b123766b47af4dfbfa877a80156e Author: Fei Qin Date: Sun May 1 08:11:50 2022 +0900 nfp: support VxLAN inner TSO with GSO_PARTIAL offload VxLAN belongs to UDP-based encapsulation protocol. Inner TSO for VxLAN packet with udpcsum requires offloading of outer header csum. The device doesn't support outer header csum offload. However, inner TSO for VxLAN with udpcsum can still work with GSO_PARTIAL offload, which means outer udp csum computed by stack and inner tcp segmentation finished by hardware. Thus, the patch enable features "NETIF_F_GSO_UDP_TUNNEL_CSUM" and "NETIF_F_GSO_PARTIAL" and set gso_partial_features. Signed-off-by: Fei Qin Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220430231150.175270-1-simon.horman@corigine.com Signed-off-by: Paolo Abeni commit c4f2a32a7fc212a843f0540822a6f1880d176267 Author: Rob Herring Date: Fri Apr 22 14:20:54 2022 -0500 dt-bindings: phy: marvell,armada-3700-utmi-host-phy: Fix incorrect compatible in example Fix the example using the incorrect compatible string. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220422192054.2591093-1-robh@kernel.org Signed-off-by: Vinod Koul commit c7fd98f84ead200d10367bcf40d82dcf706a84c4 Author: Johan Hovold Date: Wed Apr 20 17:23:30 2022 +0200 phy: qcom-qmp: fix phy-descriptor kernel-doc typo Fix misspelled "clock" in the description of the pipe_clk field in the PHY-descriptor kernel-doc comment. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220420152331.5527-2-johan+linaro@kernel.org Signed-off-by: Vinod Koul commit 166c44e6949a05b2e61024538007a8f983afd704 Author: Chris Wilson Date: Mon Apr 25 20:53:17 2022 +0530 drm/i915/gt: Clear SET_PREDICATE_RESULT prior to executing the ring Userspace may leave predication enabled upon return from the batch buffer, which has the consequent of preventing all operation from the ring from being executed, including all the synchronisation, coherency control, arbitration and user signaling. This is more than just a local gpu hang in one client, as the user has the ability to prevent the kernel from applying critical workarounds and can cause a full GT reset. We could simply execute MI_SET_PREDICATE upon return from the user batch, but this has the repercussion of modifying the user's context state. Instead, we opt to execute a fixup batch which by mixing predicated operations can determine the state of the SET_PREDICATE_RESULT register and restore it prior to the next userspace batch. This allows us to protect the kernel's ring without changing the uABI. Suggested-by: Zbigniew Kempczynski Signed-off-by: Chris Wilson Cc: Zbigniew Kempczynski Cc: Thomas Hellstrom Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220425152317.4275-4-ramalingam.c@intel.com commit 17be812e76eee0fc46747ce3ef87eab39f9d565c Author: Chris Wilson Date: Mon Apr 25 20:53:16 2022 +0530 drm/i915/selftests: Skip poisoning SET_PREDICATE_RESULT on dg2 When predication is enabled all commands baring a few (such as MI_BB_END) are nop'ed. If we accidentally enable predication while poisoning the context, not only is the rest of the poisoning skipped (thus disabling the test), but the closing instructions of the poison request are nop'ed. Not only do we then not signal the waiting context, but we even prevent re-enabling arbitration and the GPU will not perform a context switch at the end of the request. Cc: Joonas Lahtinen Suggested-by: CQ Tang Signed-off-by: Chris Wilson Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220425152317.4275-3-ramalingam.c@intel.com commit 7c161b85e88552a037566678128c169fba3b1efe Author: Akeem G Abodunrin Date: Mon Apr 25 20:53:15 2022 +0530 drm/i915/xehpsdv/dg1/tgl: Fix issue with LRI relative addressing When bit 19 of MI_LOAD_REGISTER_IMM instruction opcode is set on tgl+ devices, HW does not care about certain register address offsets, but instead check the following for valid address ranges on specific engines: RCS && CCS: BITS(0 - 10) BCS: BITS(0 - 11) VECS && VCS: BITS(0 - 13) Also, tgl+ now support relative addressing for BCS engine - So, this patch fixes issue with live_gt_lrc selftest that is failing where there is mismatch between LRC register layout generated during init and HW default register offsets. Signed-off-by: Akeem G Abodunrin cc: Prathap Kumar Valsan Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220425152317.4275-2-ramalingam.c@intel.com commit c85b2f15f59397cdb07f9efc625cf58033254242 Merge: 2e9cf8458d3fc edc5601db6641 Author: Bartosz Golaszewski Date: Mon May 2 11:44:02 2022 +0200 Merge tag 'intel-gpio-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v5.19-1 * Introduce helpers to iterate over GPIO chip nodes and covert some drivers gpiolib: - Introduce a helper to get first GPIO controller node - Introduce gpiochip_node_count() helper - Introduce for_each_gpiochip_node() loop helper pinctrl: - meson: Replace custom code by gpiochip_node_count() call - meson: Enable COMPILE_TEST - meson: Rename REG_* to MESON_REG_* - armada-37xx: Reuse GPIO fwnode in armada_37xx_irqchip_register() - armada-37xx: Switch to use fwnode instead of of_node - samsung: Switch to use for_each_gpiochip_node() helper - samsung: Drop redundant node parameter in samsung_banks_of_node_get() - npcm7xx: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Switch to use for_each_gpiochip_node() helper - renesas: rza1: Replace custom code by gpiochip_node_count() call - stm32: Switch to use for_each_gpiochip_node() helper - stm32: Replace custom code by gpiochip_node_count() call commit 43896f56b59eeaf08687fa976257ae7083d01b41 Author: Lucas Stach Date: Wed Apr 27 18:21:31 2022 +0200 clk: imx8mp: add clkout1/2 support clkout1 and clkout2 allow to supply clocks from the SoC to the board, which is used by some board designs to provide reference clocks. Signed-off-by: Lucas Stach Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220427162131.3127303-1-l.stach@pengutronix.de Signed-off-by: Abel Vesa commit bfd594b3acbd2656edcc7742e1270d09c0de9d4d Author: Miaoqian Lin Date: Mon Apr 25 09:11:17 2022 +0800 clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1. Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this. Fixes: 78edeb080330 ("clk: imx: scu: add runtime pm support") Signed-off-by: Miaoqian Lin Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220425011117.25093-1-linmq006@gmail.com Signed-off-by: Abel Vesa commit 13088b65d93a1c29f07f97931c2b69788ad58f04 Author: Borislav Petkov Date: Tue Apr 12 23:10:29 2022 +0200 EDAC: Use kcalloc() It is syntactic sugar anyway: # drivers/edac/edac_mc.o: text data bss dec hex filename 13378 324 8 13710 358e edac_mc.o.before 13378 324 8 13710 358e edac_mc.o.after md5: 70a53ee3ac7f867730e35c2be9110748 edac_mc.o.before.asm 70a53ee3ac7f867730e35c2be9110748 edac_mc.o.after.asm # drivers/edac/edac_device.o: text data bss dec hex filename 5704 120 4 5828 16c4 edac_device.o.before 5704 120 4 5828 16c4 edac_device.o.after md5: 880563c859da6eb9aca85ec431fdbaeb edac_device.o.before.asm 880563c859da6eb9aca85ec431fdbaeb edac_device.o.after.asm No functional changes. Reported-by: kernel test robot Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220412211957.28899-1-bp@alien8.de commit 94f697c5384bd7f9632acca483ba1ef9dd99ea97 Author: Michael Walle Date: Fri Apr 29 12:01:53 2022 +0200 mtd: spi-nor: move spi_nor_write_ear() to winbond module The "Extended Address Register" is winbond specific. If the flash is larger than 16MiB and is used in 3 byte address mode, it is used to set the remaining address bits. Move the write_ear() function, the opcode macros and the spimem op template into the winbond module and rename them accordingly. Signed-off-by: Michael Walle Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220429100153.2338501-1-michael@walle.cc commit 23587f7c5daa936524ede26201253a089666b5d9 Author: Miaohe Lin Date: Fri Apr 29 17:05:45 2022 +0800 mm/slub: remove unused kmem_cache_order_objects max max field holds the largest slab order that was ever used for a slab cache. But it's unused now. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220429090545.33413-1-linmiaohe@huawei.com commit a313f858ed368d11579df62e8f7d0ac65f853bc9 Author: Jaehee Park Date: Fri Apr 29 12:46:58 2022 -0400 selftests: net: vrf_strict_mode_test: add support to select a test to run Add a boilerplate test loop to run all tests in vrf_strict_mode_test.sh. Add a -t flag that allows a selected test to run. Remove the vrf_strict_mode_tests function which is now unused. Signed-off-by: Jaehee Park Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220429164658.GA656707@jaehee-ThinkPad-X1-Extreme Signed-off-by: Paolo Abeni commit 154036a3b3f39cb17fc65511011f4c4024846e91 Author: Andrey Konovalov Date: Thu Apr 28 17:59:40 2022 +0200 mm: slab: fix comment for __assume_kmalloc_alignment The comment next to the __assume_kmalloc_alignment definition is not precise: kmalloc relies on kmem_cache_alloc, so kmalloc technically returns pointers aligned to both ARCH_KMALLOC_MINALIGN and ARCH_SLAB_MINALIGN, not only to ARCH_KMALLOC_MINALIGN. (See create_kmalloc_cache()->create_boot_cache()->calculate_alignment() for SLAB and SLUB and __do_kmalloc_node() for SLOB.) Clarify the comment. The assumption specified by __assume_kmalloc_alignment is still correct, although it can be made stronger. I'll leave this to a separate patch. Signed-off-by: Andrey Konovalov Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/84d8142747230f2015eaf9705ee7c2e1a9f56596.1651161548.git.andreyknvl@google.com commit 8cf9e1210adf49cd83d11e2b1984540cf0e0be71 Author: Andrey Konovalov Date: Thu Apr 28 17:59:39 2022 +0200 mm: slab: fix comment for ARCH_KMALLOC_MINALIGN The comment next to the ARCH_KMALLOC_MINALIGN definition says that ARCH_KMALLOC_MINALIGN can be defined in arch headers. This is incorrect: it's actually ARCH_DMA_MINALIGN that can be defined there. Fix the comment. Signed-off-by: Andrey Konovalov Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/fe1ca7a25a054b61d1038686d07569416e287e7b.1651161548.git.andreyknvl@google.com commit 2e9cf8458d3fcf0823dd02d3f9ffa2c62d5f6a2c Author: Alexander Shiyan Date: Wed Apr 20 09:51:02 2022 +0300 gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible Since version 5.13, the standard syscon bindings have been added to all clps711x DT nodes, so we can now use the more general syscon_regmap_lookup_by_phandle function to get the syscon pointer. This patch removes the usage of the syscon_regmap_lookup_by_compatible function as it is no longer used in the driver. Signed-off-by: Alexander Shiyan Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit c140915c00c92e3ca2a4f8e5748f0b9ef3e5a418 Author: Jani Nikula Date: Fri Apr 29 17:21:40 2022 +0300 drm/i915: move tons of power well initializers to rodata Using compound literals for initialization can be tricky. Lacking a const qualifier, they won't end up in rodata, which is probably not expected or intended. Add const to move a whopping 136 initializers to rodata. Compare: $ objdump --syms drivers/gpu/drm/i915/display/intel_display_power_map.o | grep "\.rodata.*__compound_literal" $ objdump --syms drivers/gpu/drm/i915/display/intel_display_power_map.o | grep "\.data.*__compound_literal" Before and after the change. Fixes: c32ffce42aa5 ("drm/i915: Convert the power well descriptor domain mask to an array of domains") Fixes: 4a845ff0c0d4 ("drm/i915: Simplify power well definitions by adding power well instances") Cc: Imre Deak Cc: Jouni Högander Signed-off-by: Jani Nikula Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220429142140.2671828-1-jani.nikula@intel.com commit 1a43e9b281c6eaadf788c3bfff3062860ced8e87 Author: Oleksij Rempel Date: Tue Apr 26 09:35:11 2022 +0200 ARM: dts: stm32: add support for Protonic PRTT1x boards This boards are based on STM32MP151AAD3 and use 10BaseT1L for communication. - PRTT1C - 10BaseT1L switch - PRTT1S - 10BaseT1L CO2 sensor board - PRTT1A - 10BaseT1L multi functional controller Signed-off-by: Oleksij Rempel Signed-off-by: Alexandre Torgue commit 9ad65d245b7b918353d4b1279e7d3190a0e087fd Author: Oleksij Rempel Date: Tue Apr 26 09:35:10 2022 +0200 ARM: dts: stm32: stm32mp15-pinctrl: add spi1-1 pinmux group Add spi1-1 pingroup as preparation for Protonic PRTT1C board. Signed-off-by: Oleksij Rempel Signed-off-by: Alexandre Torgue commit 94de07e5565be51d91dd91dcae6ede54c0f9be27 Author: Oleksij Rempel Date: Tue Apr 26 09:35:09 2022 +0200 dt-bindings: net: silabs,wfx: add prt,prtt1c-wfm200 antenna variant Add compatible for wfm200 antenna configuration variant for Protonic PRTT1C board. Signed-off-by: Oleksij Rempel Acked-by: Krzysztof Kozlowski Signed-off-by: Alexandre Torgue commit c70bb467fb211fadd2c1360892a498330d8a94a6 Author: Oleksij Rempel Date: Tue Apr 26 09:35:08 2022 +0200 dt-bindings: arm: stm32: Add compatible strings for Protonic T1L boards This boards are based on STM32MP151AAD3 and use 10BaseT1L for communication. - PRTT1C - 10BaseT1L switch - PRTT1S - 10BaseT1L CO2 sensor board - PRTT1A - 10BaseT1L multi functional controller Signed-off-by: Oleksij Rempel Acked-by: Krzysztof Kozlowski Signed-off-by: Alexandre Torgue commit 0f0c0452bbd46d713eeb8968f5f40ccc257f85eb Merge: 6e28f56c0d1d9 b11ebf2ca2c11 Author: Paolo Abeni Date: Mon May 2 10:30:36 2022 +0200 Merge branch 'devices-always-netif_f_lltx' Peilin Ye says: ==================== devices always NETIF_F_LLTX v1: https://lore.kernel.org/netdev/cover.1650580763.git.peilin.ye@bytedance.com/ change since v1: - deleted "depends on patch..." in [1/2]'s commit message This patchset depends on these fixes [1], which has been merged into net-next. Since o_seqno is now atomic_t, we can always turn on NETIF_F_LLTX for [IP6]GRE[TAP] devices, since we no longer need the TX lock (&txq->_xmit_lock). We could probably do the same thing to [IP6]ERSPAN devices as well, but I'm not familiar with them yet. For example, ERSPAN devices are initialized as |= GRE_FEATURES in erspan_tunnel_init(), but I don't see IP6ERSPAN devices being initialized as |= GRE6_FEATURES. Where should we initialize IP6ERSPAN devices' ->features? Please suggest if I'm missing something, thanks! [1] https://lore.kernel.org/netdev/cover.1650575919.git.peilin.ye@bytedance.com/ ==================== Link: https://lore.kernel.org/r/cover.1651207788.git.peilin.ye@bytedance.com Signed-off-by: Paolo Abeni commit b11ebf2ca2c118ed8767fc37a151d5c70844617d Author: Peilin Ye Date: Thu Apr 28 22:25:47 2022 -0700 ip6_gre: Make IP6GRE and IP6GRETAP devices always NETIF_F_LLTX Recently we made o_seqno atomic_t. Stop special-casing TUNNEL_SEQ, and always mark IP6GRE[TAP] devices as NETIF_F_LLTX, since we no longer need the TX lock (&txq->_xmit_lock). Signed-off-by: Peilin Ye Signed-off-by: Paolo Abeni commit 020e8f60aa8b5da6a18767a41ced3fb5d5fb47e7 Author: Peilin Ye Date: Thu Apr 28 22:25:21 2022 -0700 ip_gre: Make GRE and GRETAP devices always NETIF_F_LLTX Recently we made o_seqno atomic_t. Stop special-casing TUNNEL_SEQ, and always mark GRE[TAP] devices as NETIF_F_LLTX, since we no longer need the TX lock (&txq->_xmit_lock). Signed-off-by: Peilin Ye Signed-off-by: Paolo Abeni commit 5d68f9798d7da8a1004d3d09e56dc7b379700016 Author: Krzysztof Kozlowski Date: Mon Apr 25 16:04:36 2022 +0200 dt-bindings: arm: stm32: correct blank lines Correct blank lines to precesily separate entries. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit bb419dc67bb51d15740df5a775da1de057e4b2fb Author: Krzysztof Kozlowski Date: Mon Apr 25 16:04:35 2022 +0200 dt-bindings: arm: stm32: narrow DH STM32MP1 SoM boards The bindings for DH STM32MP1 SoM boards allows invalid combinations, e.g. st,stm32mp153 SoC on a dh,stm32mp157c-dhcom-som SoM. Split the enums to properly match valid setups. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit b91c0922bf1ed15b67a6faa404bc64e3ed532ec2 Author: Thomas Gleixner Date: Mon May 2 09:20:42 2022 +0200 x86/fpu: Cleanup variable shadowing Addresses: warning: Local variable 'mask' shadows outer variable Remove extra variable declaration and switch the bit mask assignment to use BIT_ULL() while at it. Fixes: 522e92743b35 ("x86/fpu: Deduplicate copy_uabi_from_user/kernel_to_xstate()") Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/202204262032.jFYKit5j-lkp@intel.com commit 28b250e070e9a45a814d13c4ae756aab1298ff27 Author: Pavel Pisa Date: Sun Apr 24 18:28:08 2022 +0200 can: ctucanfd: remove PCI module debug parameters This patch removes the PCI module debug parameters, which are not needed anymore, to make both checkpatch.pl and patchwork happy. Link: https://lore.kernel.org/all/1fd684bcf5ddb0346aad234072f54e976a5210fb.1650816929.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa [mkl: split into separate patches] Signed-off-by: Marc Kleine-Budde commit e391a0f7be617b16a3b4d1092596519bd96889a4 Author: Pavel Pisa Date: Sun Apr 24 18:28:08 2022 +0200 can: ctucanfd: remove debug statements This patch removes the debug statements from the driver to make checkpatch.pl and patchwork happy. Link: https://lore.kernel.org/all/1fd684bcf5ddb0346aad234072f54e976a5210fb.1650816929.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa [mkl: split into separate patches] Signed-off-by: Marc Kleine-Budde commit a51491ac6ed2f55d0c4b65bc8370b3833dca6b7b Author: Pavel Pisa Date: Sun Apr 24 18:28:08 2022 +0200 can: ctucanfd: remove inline keyword from local static functions This patch removes the inline keywords from the local static functions to make both checkpatch.pl and patchwork happy. Link: https://lore.kernel.org/all/1fd684bcf5ddb0346aad234072f54e976a5210fb.1650816929.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa [mkl: split into separate patches] Signed-off-by: Marc Kleine-Budde commit e715d4459485377273c085d30992b8f9d70eede0 Author: Jiapeng Chong Date: Fri Apr 22 04:32:42 2022 +0800 can: ctucanfd: ctucan_platform_probe(): remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warnings: | drivers/net/can/ctucanfd/ctucanfd_platform.c:67:2-9: | line 67 is redundant because platform_get_irq() already prints an error. Link: https://lore.kernel.org/all/20220421203242.7335-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Pave Pisa Signed-off-by: Marc Kleine-Budde commit 704fd176204577459beadb37d46e164d376fabc3 Author: Jiapeng Chong Date: Fri Apr 22 04:28:52 2022 +0800 can: ctucanfd: remove unused including Eliminate the follow versioncheck warning: | drivers/net/can/ctucanfd/ctucanfd_base.c: 34 linux/version.h not needed. Link: https://lore.kernel.org/all/20220421202852.2693-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Pave Pisa Signed-off-by: Marc Kleine-Budde commit 75790ef3b796abefe9a0f6a90288b7ae9971fd3c Author: Pavel Pisa Date: Sun Apr 24 18:28:11 2022 +0200 docs: networking: device drivers: can: ctucanfd: update author e-mail This patch updates the author's email address. Link: https://lore.kernel.org/all/e4396244da6b008c671def9f50bb983a10389863.1650816929.git.pisa@cmp.felk.cvut.cz Cc: Odrej Ille Signed-off-by: Pavel Pisa [mkl: split into separate patches] Signed-off-by: Marc Kleine-Budde commit 5f02ecbe08d6a3434a14b92bee98adec76e8808e Author: Pavel Pisa Date: Sun Apr 24 18:28:11 2022 +0200 docs: networking: device drivers: can: add ctucanfd to index This patch adds the ctucanfd-driver document to the index. Link: https://lore.kernel.org/all/e4396244da6b008c671def9f50bb983a10389863.1650816929.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa [mkl: split into separate patches] Signed-off-by: Marc Kleine-Budde commit e1cf330fa28acc342e527baf12298a5fd8219bad Author: Jakub Kicinski Date: Fri Apr 29 10:44:46 2022 -0700 can: m_can: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Link: https://lore.kernel.org/all/20220429174446.196655-1-kuba@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Marc Kleine-Budde commit 35a78bf20033d5d7b1c53cb5616732dbf6ec9890 Author: Biju Das Date: Sat Apr 23 14:07:43 2022 +0100 dt-bindings: can: renesas,rcar-canfd: Document RZ/G2UL support Add CANFD binding documentation for Renesas R9A07G043 (RZ/G2UL) SoC. Link: https://lore.kernel.org/all/20220423130743.123198-1-biju.das.jz@bp.renesas.com Signed-off-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Signed-off-by: Marc Kleine-Budde commit 1ff2fb982c52ed6c3478adc944441d6ea065d8fb Author: Thomas Gleixner Date: Mon May 2 09:01:55 2022 +0200 x86/aperfperf: Make it correct on 32bit and UP kernels The utilization of arch_scale_freq_tick() for CPU frequency readouts is incomplete as it failed to move the function prototype and the define out of the CONFIG_SMP && CONFIG_X86_64 #ifdef. Make them unconditionally available. Fixes: bb6e89df9028 ("x86/aperfmperf: Make parts of the frequency invariance code unconditional") Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/202205010106.06xRBR2C-lkp@intel.com commit ab7c37ec11d2f3c88e1d49c5fb4fe4ed568d88e3 Author: Christian König Date: Fri Apr 29 13:36:16 2022 +0200 drm/nouveau: use drm_gem_plane_helper_prepare_fb Instead of manually adjusting the plane state. Signed-off-by: Christian König Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220429134230.24334-3-christian.koenig@amd.com commit 302a20c717beeb0592c0f9fdad5b6d803b0fa0f4 Author: Jiapeng Chong Date: Fri Apr 22 04:30:38 2022 +0800 phy: rockchip-inno-usb2: Clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/phy/rockchip/phy-rockchip-inno-usb2.c:1203 rockchip_usb2phy_probe() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220421203038.4550-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Vinod Koul commit 1ea28bc5542d607ff7c806e409a72862c5af8f5e Author: Christian König Date: Thu Apr 21 20:20:49 2022 +0200 drm: handle kernel fences in drm_gem_plane_helper_prepare_fb v2 drm_gem_plane_helper_prepare_fb() was using drm_atomic_set_fence_for_plane() which ignores all implicit fences when an explicit fence is already set. That's rather unfortunate when the fb still has a kernel fence we need to wait for to avoid presenting garbage on the screen. So instead update the fence in the plane state directly. While at it also take care of all potential GEM objects and not just the first one. Also remove the now unused drm_atomic_set_fence_for_plane() function, new drivers should probably use the atomic helpers directly. v2: improve kerneldoc, use local variable and num_planes, WARN_ON_ONCE on missing planes. Signed-off-by: Christian König Reviewed-by: Daniel Vetter (v1) Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220429134230.24334-1-christian.koenig@amd.com commit 78b5f52ab6f6074a6fe2f27122e2165f32d6a143 Author: Julia Lawall Date: Sat Apr 30 21:11:15 2022 +0200 microblaze: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220430191122.8667-1-Julia.Lawall@inria.fr Signed-off-by: Michal Simek commit 7f9c974174812908747fd26844e6ee479afc8826 Author: Max Filippov Date: Sat Apr 23 04:18:23 2022 -0700 xtensa: clean up labels in the kernel entry assembly Don't use numeric labels for long jumps, use named local labels instead. Avoid conditional label definition. No functional changes. Signed-off-by: Max Filippov commit 2a26f4ee399db65ccd97465d57002339afe48572 Author: Max Filippov Date: Sat Apr 23 03:52:23 2022 -0700 xtensa: don't leave invalid TLB entry in fast_store_prohibited When fast_store_prohibited needs to go to the C-level exception handler it leaves TLB entry that caused page fault in the TLB. If the faulting task gets switched to a different CPU and completes page table update there the TLB entry will get out of sync with the page table which may cause a livelock on access to that page. Invalidate faulting TLB entry on a slow path exit from the fast_store_prohibited. Signed-off-by: Max Filippov commit 5442b8c7dd1eb5e5ba8143c9abfbfe7dddedd375 Author: Max Filippov Date: Tue Apr 26 07:46:45 2022 -0700 xtensa: fix declaration of _SecondaryResetVector_text_* Secondary reset vector is defined, compiled and used when CONFIG_SECONDARY_RESET_VECTOR is enabled, not only on SMP. Make declarations of _SecondaryResetVector_text_* symbols available accordingly. Signed-off-by: Max Filippov commit a255ee29252066d621df5d6b420bf534c6ba5bc0 Author: Max Filippov Date: Tue Apr 26 09:01:18 2022 -0700 irqchip: irq-xtensa-mx: fix initial IRQ affinity When irq-xtensa-mx chip is used in non-SMP configuration its irq_set_affinity callback is not called leaving IRQ affinity set empty. As a result IRQ delivery does not work in that configuration. Initialize IRQ affinity of the xtensa MX interrupt distributor to CPU 0 for all external IRQ lines. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov commit af7a16e567aec884276c2523eadf22dda547f949 Author: Max Filippov Date: Mon Apr 25 10:59:04 2022 -0700 xtensa: enable ARCH_HAS_DEBUG_VM_PGTABLE xtensa kernels successfully build and run with CONFIG_DEBUG_VM_PGTABLE=y, enable arch support for it. Reviewed-by: Anshuman Khandual Signed-off-by: Max Filippov commit 733f5c28e59ef23fef9e0b64d79df24c2a4eed2b Author: Max Filippov Date: Wed Apr 20 06:07:20 2022 -0700 xtensa: add hibernation support Define ARCH_HIBERNATION_POSSIBLE in Kconfig and implement hibernation callbacks. Signed-off-by: Max Filippov commit 11e969bc964a0e50ae64cdba092048e3937d2389 Author: Max Filippov Date: Fri Apr 15 03:05:31 2022 -0700 xtensa: support coprocessors on SMP Current coprocessor support on xtensa only works correctly on uniprocessor configurations. Make it work on SMP too and keep it lazy. Make coprocessor_owner array per-CPU and move it to struct exc_table for easy access from the fast_coprocessor exception handler. Allow task to have live coprocessors only on single CPU, record this CPU number in the struct thread_info::cp_owner_cpu. Change struct thread_info::cpenable meaning to be 'coprocessors live on cp_owner_cpu'. Introduce C-level coprocessor exception handler that flushes and releases live coprocessors of the task taking 'coprocessor disabled' exception and call it from the fast_coprocessor handler when the task has live coprocessors on other CPU. Make coprocessor_flush_all and coprocessor_release_all work correctly when called from any CPU by sending IPI to the cp_owner_cpu. Add function coprocessor_flush_release_all to do flush followed by release atomically. Add function local_coprocessors_flush_release_all to flush and release all coprocessors on the local CPU and use it to flush coprocessor contexts from the CPU that goes offline. Signed-off-by: Max Filippov commit f29cab2906346fa93831376256e01f5a6629f979 Author: Max Filippov Date: Mon Apr 18 00:14:00 2022 -0700 xtensa: get rid of stack frame in coprocessor_flush coprocessor_flush is an ordinary function, it can use all registers. Don't reserve stack frame for it and use a7 to preserve a0 around the context saving call. Signed-off-by: Max Filippov commit e45d4bfbeb265f352fe5f32852e64eca5fdabe13 Author: Max Filippov Date: Mon Apr 18 12:44:49 2022 -0700 xtensa: merge SAVE_CP_REGS_TAB and LOAD_CP_REGS_TAB Both tables share the same offset field but the different function pointers. Merge them into single table with 3-element entries to reduce code and data duplication. Signed-off-by: Max Filippov commit dedfe2590bdf1beaaf064f1f1b71098b5fddbfe1 Author: Max Filippov Date: Mon Nov 25 12:59:13 2019 -0800 xtensa: add xtensa_xsr macro xtensa_xsr does the XSR instruction for the specified special register. Signed-off-by: Max Filippov commit 0b549f813387231e0053c10dd7006e69ad4c5f95 Author: Max Filippov Date: Thu Jan 3 18:26:16 2019 -0800 xtensa: handle coprocessor exceptions in kernel mode In order to let drivers use xtensa coprocessors on behalf of the calling process the kernel must handle coprocessor exceptions from the kernel mode the same way as from the user mode. This is not sufficient to allow using coprocessors transparently in IRQ or softirq context. Should such users exist they must be aware of the context and do the right thing, e.g. preserve the coprocessor state and resore it after use. Signed-off-by: Max Filippov commit 6179ef4d460a0e4d8de7b88b4bd9aa6c35215b5f Author: Max Filippov Date: Wed Apr 13 22:50:54 2022 -0700 xtensa: use callx0 opcode in fast_coprocessor Instead of emulating call0 in fast_coprocessor use that opcode directly. Use 'ret' instead of 'jx a0'. Signed-off-by: Max Filippov commit 9fa8c59f5f82aec99a7f87095ab093b68dd492a5 Author: Max Filippov Date: Fri Apr 15 02:59:33 2022 -0700 xtensa: clean up excsave1 initialization Use xtensa_set_sr instead of inline assembly. Rename local variable exc_table in early_trap_init to avoid conflict with per-CPU variable of the same name. Signed-off-by: Max Filippov commit 3e554d47dfe3f1d0639fd3d2d4f64bca0e5e62e0 Author: Max Filippov Date: Fri Apr 15 02:50:17 2022 -0700 xtensa: clean up declarations in coprocessor.h Drop 'extern' from all function declarations. Add parameter names in declarations. Signed-off-by: Max Filippov commit fc55402b84385bdb907c24f891e3e5df464f027c Author: Max Filippov Date: Thu Apr 21 02:35:23 2022 -0700 xtensa: clean up exception handler prototypes Exception handlers are currently passed as void pointers because they may have one or two parameters. Only two handlers uses the second parameter and it is available in the struct pt_regs anyway. Make all handlers have only one parameter, introduce xtensa_exception_handler type for handlers and use it in trap_set_handler. Signed-off-by: Max Filippov commit db0d07fa192a3c05776875f4a851588d7dfc9f96 Author: Max Filippov Date: Fri Apr 15 02:47:04 2022 -0700 xtensa: clean up function declarations in traps.c Drop 'extern' from all function declarations and move those that need to be visible from traps.c to traps.h. Add 'asmlinkage' to declarations of fucntions defined in assembly. Add 'static' to declarations and definitions only used locally. Add argument names in declarations. Drop unused second argument from do_multihit and do_page_fault. Signed-off-by: Max Filippov commit 725aea873261e8d986e527838fde2a721f0962d8 Author: Max Filippov Date: Fri Oct 4 23:33:31 2019 -0700 xtensa: enable KCSAN Prefix arch-specific barrier macros with '__' to make use of instrumented generic macros. Prefix arch-specific bitops with 'arch_' to make use of instrumented generic functions. Provide stubs for 64-bit atomics when building with KCSAN. Disable KCSAN instrumentation in arch/xtensa/boot. Signed-off-by: Max Filippov Acked-by: Marco Elver commit 507185695e93c70aced2f419892bc2ab9387b324 Author: Max Filippov Date: Wed Apr 13 20:40:10 2022 -0700 xtensa: enable HAVE_VIRT_CPU_ACCOUNTING_GEN There's no direct cputime_t manipulation in the xtensa arch code, so generic virt CPU accounting may be enabled. Signed-off-by: Max Filippov commit 55427d5b0dff5754f3579dde93955aac483e8d6a Author: Max Filippov Date: Wed Apr 13 20:41:12 2022 -0700 xtensa: enable context tracking Put user exit context tracking call on the common kernel entry/exit path (function calls are impossible at earlier kernel entry stages because PS.EXCM is not cleared yet). Put user entry context tracking call on the user exit path. Syscalls go through this common code too, so nothing specific needs to be done for them. Signed-off-by: Max Filippov commit 961c5efbc493ef497fe68ec07a4ed081acba4c92 Author: Max Filippov Date: Fri Apr 15 23:53:38 2022 -0700 xtensa: use abi_* register names in the kernel exit code Using plain register names is prone to errors when code is changed and new calls are added between the register load and use. Change plain register names to abi_* names in the call-heavy part of the kernel exit code to clearly indicate what's supposed to be preserved and what's not. Re-align code while at it. Signed-off-by: Max Filippov commit de4415d0bac91192ee9c74e849bc61429efa9b42 Author: Max Filippov Date: Sun Apr 3 21:29:46 2022 -0700 xtensa: move trace_hardirqs_off call back to entry.S Context tracking call must be done after hardirq tracking call, otherwise lockdep_assert_irqs_disabled called from rcu_eqs_exit gives a warning. To avoid context tracking logic duplication for IRQ/exception entry paths move trace_hardirqs_off call back to common entry code. Signed-off-by: Max Filippov commit 4b81690980d45c4972d97facf11b65918e232fd5 Author: Max Filippov Date: Sun Apr 17 02:41:13 2022 -0700 xtensa: drop dead code from entry.S KERNEL_STACK_OVERFLOW_CHECK is incomplete and have never been enabled. Remove it. Signed-off-by: Max Filippov commit a8f0c31fa87dcf9154c4209960f1dd1ed6a1aad8 Author: Max Filippov Date: Tue Dec 10 14:23:49 2019 -0800 xtensa: noMMU: allow handling protection faults Many xtensa CPU cores without full MMU still have memory protection features capable of raising exceptions for invalid instruction fetches/data access. Allow handling such exceptions. This improves behavior of processes that pass invalid memory pointers to syscalls in noMMU configs: in case of exception the kernel instead of killing the process is now able to return -EINVAL from a syscall. Introduce CONFIG_PFAULT that controls whether protection fault code is enabled and register handlers for common memory protection exceptions when it is enabled. Signed-off-by: Max Filippov commit 270a8306917e40746a02494abbd40828356b08e1 Author: Max Filippov Date: Wed Mar 23 14:11:14 2022 -0700 xtensa: extract vmalloc_fault code into a function Move full MMU-specific code into a separate function to isolate it from more generic do_page_fault code. No functional changes. Signed-off-by: Max Filippov commit 4916be4290d3e2ca3161528607da1e32d858fe64 Author: Max Filippov Date: Mon Dec 9 18:12:18 2019 -0800 xtensa: move asid_cache from fault.c to mmu.c asid_cache is only useful with full MMU, but fault.c is also useful with MPU. Move asid_cache definition to MMU-specific source file. Signed-off-by: Max Filippov commit 2aed7af34fc67de08e0720c091ddf753e2e87710 Author: Max Filippov Date: Fri Apr 8 01:22:34 2022 -0700 xtensa: iss: extract and constify network callbacks Instead of storing pointers to callback functions in the struct iss_net_private::tp move them to struct struct iss_net_ops and store a const pointer to it. Make static const tuntap_ops structure with tuntap callbacks and initialize tp.net_ops with it in the tuntap_probe. Signed-off-by: Max Filippov commit b7a861a6c3fb8903d4806a12b9ec7806472faa9a Author: Max Filippov Date: Fri Apr 8 01:56:53 2022 -0700 xtensa: iss: clean up per-device locking in network driver Per-device locking in the ISS network driver is used to protect poll timer and stats updates. Stat collection is not protected. Remove per-device locking everywhere except the stats updates. Replace ndo_get_stats callback with ndo_get_stats64 and use proper locking there as well. As a side effect this fixes possible deadlock between iss_net_close and iss_net_timer. Reported by: Duoming Zhou Signed-off-by: Max Filippov commit fd16501614dd590a3478f1a0ac3257d1cd5cf909 Author: Max Filippov Date: Fri Apr 8 05:15:16 2022 -0700 xtensa: iss: replace iss_net_set_mac with eth_mac_addr iss_net_set_mac is just a copy of eth_mac_addr with pointless locking. Drop this function and replace it with eth_mac_addr. Signed-off-by: Max Filippov commit 9d7cafd5a735791cb7e0cb24eafd058f0a322b23 Author: Max Filippov Date: Thu Apr 7 23:56:35 2022 -0700 xtensa: iss: drop opened_list logic from the network driver opened_list is used to poll all opened devices in the timer callback, but there's individual timer that is associated with each device. Drop opened_list and only poll the device that is associated with the timer in the timer callback. Signed-off-by: Max Filippov commit 1030c8792313b9dd219aa48f265b00d72938b116 Author: Max Filippov Date: Sat Apr 9 19:33:33 2022 -0700 xtensa: localize labels used in memmove Internal labels in the memmove implementation don't need to be visible, localize them by prefixing their names with '.L'. Signed-off-by: Max Filippov commit f1fc2b87de4719cfa8e193e0746cc524dd9f7472 Author: Dmitry Baryshkov Date: Sat Apr 30 20:57:47 2022 +0300 drm/msm: drop old eDP block support (again) The msm driver has dropped support for older eDP block. However the merge conflict in the commit 4ce2ca4b374a ("drm/msm: Fix include statements for DisplayPort") was resolved incorrectly and two files were left in place. Drop them now (again). Fixes: 4ce2ca4b374a ("drm/msm: Fix include statements for DisplayPort") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/484307/ Link: https://lore.kernel.org/r/20220430175747.3818137-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 8123fe83c3a3448bbfa5b5b1cacfdfe7d076fca6 Author: Dmitry Baryshkov Date: Sat Apr 30 21:09:17 2022 +0300 drm/msm: add missing include to msm_drv.c Add explicit include of drm_bridge.h to the msm_drv.c to fix the following warning: drivers/gpu/drm/msm/msm_drv.c:236:17: error: implicit declaration of function 'drm_bridge_remove'; did you mean 'drm_bridge_detach'? [-Werror=implicit-function-declaration] Fixes: d28ea556267c ("drm/msm: properly add and remove internal bridges") Reported-by: kernel test robot Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/484310/ Link: https://lore.kernel.org/r/20220430180917.3819294-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 666a68a70ab76a04869b205dfd33c091ae09adf7 Author: Dmitry Baryshkov Date: Sat Apr 30 20:55:33 2022 +0300 drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing The downstream uses read-modify-write for updating command mode compression registers. Let's follow this approach. This also fixes the following warning: drivers/gpu/drm/msm/dsi/dsi_host.c:918:23: warning: variable 'reg_ctrl' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/484305/ Link: https://lore.kernel.org/r/20220430175533.3817792-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 4b8dd2be5cd0e898fac631904a09496cc0cb8273 Author: Marijn Suijten Date: Sat Feb 26 20:46:32 2022 +0100 drm/msm/dpu: Use indexed array initializer to prevent mismatches While there's a comment pointing from dpu_intr_set to dpu_hw_intr_reg and vice-versa, an array initializer using indices makes it so that the indices between the enum and array cannot possibly get out of sync even if they're accidentially ordered wrongly. It is still useful to keep the comment to be made aware where the register offset mapping resides while looking at dpu_hw_intr_reg. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/476358/ Link: https://lore.kernel.org/r/20220226194633.204501-1-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov commit 3ce8bdca394fc606b55e7c5ed779d171aaae5d09 Author: Jessica Zhang Date: Fri Apr 29 17:52:10 2022 -0700 drm/msm/dpu: Clean up CRC debug logs Currently, dpu_hw_lm_collect_misr returns EINVAL if CRC is disabled. This causes a lot of spam in the DRM debug logs as it's called for every vblank. Instead of returning EINVAL when CRC is disabled in dpu_hw_lm_collect_misr, let's return ENODATA and add an extra ENODATA check before the debug log in dpu_crtc_get_crc. Changes since V1: - Added reported-by and suggested-by tags Reported-by: Dmitry Baryshkov Suggested-by: Rob Clark Signed-off-by: Jessica Zhang Tested-by: Jessica Zhang # RB5 (qrb5165) Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/484274/ Link: https://lore.kernel.org/r/20220430005210.339-1-quic_jesszhan@quicinc.com Signed-off-by: Dmitry Baryshkov commit e791bc29fea7186e0440301ab481f1b7508decb3 Author: Vinod Polimera Date: Tue Mar 22 08:57:07 2022 +0530 drm/msm/disp/dpu1: set mdp clk to the maximum frequency in opp table during probe Set mdp clock to max clock rate during probe/bind sequence from the opp table so that rails are not at undetermined state. Since we do not know what will be the rate set in boot loader, it would be ideal to vote at max frequency. There could be a firmware display programmed in bootloader and we want to transition it to kernel without underflowing. The clock will be scaled down later when framework sends an update. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Patchwork: https://patchwork.freedesktop.org/patch/479090/ Link: https://lore.kernel.org/r/1647919631-14447-2-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov commit 92b5eff9c5823054aa17788c565169c9b12f8d10 Author: Abhinav Kumar Date: Thu Apr 28 11:15:59 2022 -0700 drm/msm/dpu: remove unused refcount for encoder_phys_wb Remove the unused local variable refcount for encoder_phys_wb as the one part of wb_enc is used directly. changes in v2: - remove usage of ret variable also - remove the if (ret) code as it was dead-code anyway Fixes: d7d0e73f7de3 ("drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback") Reported-by: kernel test robot Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483919/ Link: https://lore.kernel.org/r/1651169759-29760-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit c102e9fcc2cc10364832972af151a5da0e851465 Author: Guo Zhengkui Date: Mon Apr 25 20:22:21 2022 +0800 drm/msm: fix returnvar.cocci warning Fix the following coccicheck warning: drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c:24:5-8: Unneeded variable: "ret". Return "0" on line 75. Signed-off-by: Guo Zhengkui Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483328/ Link: https://lore.kernel.org/r/20220425122223.7415-1-guozhengkui@vivo.com Signed-off-by: Dmitry Baryshkov commit b9e4f1d2b505df8e2439b63e67afaa287c1c43e2 Author: Lv Ruyi Date: Sun Apr 24 03:19:59 2022 +0000 drm: msm: fix error check return value of irq_of_parse_and_map() The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483175/ Link: https://lore.kernel.org/r/20220424031959.3172406-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Baryshkov commit 14e7b0345902816fa4d2870e2386b5ad574fae75 Author: Haowen Bai Date: Tue Apr 19 14:16:19 2022 +0800 drm/msm/mdp5: Eliminate useless code Since mdp5_state is initialized twice at the same time, so we make code simple and easy to understand by delete one. Signed-off-by: Haowen Bai Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482500/ Link: https://lore.kernel.org/r/1650348980-19050-1-git-send-email-baihaowen@meizu.com Signed-off-by: Dmitry Baryshkov commit 03371e4fbdeb7f596cbceacb59e474248b6d95ac Author: Lv Ruyi Date: Mon Apr 25 09:18:31 2022 +0000 drm/msm/hdmi: fix error check return value of irq_of_parse_and_map() The irq_of_parse_and_map() function returns 0 on failure, and does not return a negative value anyhow, so never enter this conditional branch. Fixes: f6a8eaca0ea1 ("drm/msm/mdp5: use irqdomains") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483294/ Link: https://lore.kernel.org/r/20220425091831.3500487-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Baryshkov commit a36e506711548df923ceb7ec9f6001375be799a5 Author: Yang Yingliang Date: Fri Apr 22 11:22:27 2022 +0800 drm/msm/hdmi: check return value after calling platform_get_resource_byname() It will cause null-ptr-deref if platform_get_resource_byname() returns NULL, we need check the return value. Fixes: c6a57a50ad56 ("drm/msm/hdmi: add hdmi hdcp support (V3)") Signed-off-by: Yang Yingliang Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482992/ Link: https://lore.kernel.org/r/20220422032227.2991553-1-yangyingliang@huawei.com Signed-off-by: Dmitry Baryshkov commit f0e7e9ed379c012c4d6b09a09b868accc426223c Author: Dmitry Baryshkov Date: Sat Apr 2 02:11:04 2022 +0300 drm/msm/dsi: fix error checks and return values for DSI xmit functions As noticed by Dan ([1] an the followup thread) there are multiple issues with the return values for MSM DSI command transmission callback. In the error case it can easily return a positive value when it should have returned a proper error code. This commits attempts to fix these issues both in TX and in RX paths. [1]: https://lore.kernel.org/linux-arm-msm/20211001123617.GH2283@kili/ Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") Reported-by: Dan Carpenter Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Tested-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/480501/ Link: https://lore.kernel.org/r/20220401231104.967193-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 2788b4efa60c1e03ac10a156f3fdbd3be0f9198c Author: Kuogee Hsieh Date: Tue Apr 26 10:58:59 2022 -0700 drm/msm/dp: do not stop transmitting phy test pattern during DP phy compliance test At normal operation, transmit phy test pattern has to be terminated before DP controller switch to video ready state. However during phy compliance testing, transmit phy test pattern should not be terminated until end of compliance test which usually indicated by unplugged interrupt. Only stop sending the train pattern in dp_ctrl_on_stream() if we're not doing compliance testing. We also no longer reset 'p_level' and 'v_level' within dp_ctrl_on_link() due to both 'p_level' and 'v_level' are acquired from link status at previous dpcd read and we like to use those level to start link training. Changes in v2: -- add more details commit text -- correct Fixes Changes in v3: -- drop unnecessary braces Fixes: 2e0adc765d88 ("drm/msm/dp: do not end dp link training until video is ready") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483564/ Link: https://lore.kernel.org/r/1650995939-28467-3-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 581d69981159b00f0443d171a4b900089f34ccfe Author: Kuogee Hsieh Date: Tue Apr 26 10:58:58 2022 -0700 drm/msm/dp: reset DP controller before transmit phy test pattern DP controller state can not switch from video ready state to transmit phy pattern state at run time. DP mainlink has to be teared down followed by reset controller to default state to have DP controller switch to transmit phy test pattern state and start generate specified phy test pattern to sinker once main link setup again. Changes in v2: -- correct Fixes's commit id Fixes: 52352fe2f866 ("drm/msm/dp: use dp_ctrl_off_link_stream during PHY compliance test run") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483563/ Link: https://lore.kernel.org/r/1650995939-28467-2-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 3bc965f15e96b51c7e683eaf72e93a2dc6dac471 Author: Sankeerth Billakanti Date: Mon Apr 25 17:14:32 2022 +0530 drm/msm/dp: Support the eDP modes given by panel The eDP controller does not have a reliable way keep panel powered on to read the sink capabilities. So, the controller driver cannot validate if a mode can be supported by the source. We will rely on the panel driver to populate only the supported modes for now. Signed-off-by: Sankeerth Billakanti Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483313/ Link: https://lore.kernel.org/r/1650887072-16652-5-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov commit 86d56a770442be550ef0d1c90dec5272e1745d93 Author: Sankeerth Billakanti Date: Mon Apr 25 17:14:31 2022 +0530 drm/msm/dp: wait for hpd high before aux transaction The source device should ensure the sink is ready before proceeding to read the sink capability or perform any aux transactions. The sink will indicate its readiness by asserting the HPD line. The controller driver needs to wait for the hpd line to be asserted by the sink before it performs any aux transactions. The eDP sink is assumed to be always connected. It needs power from the source and its HPD line will be asserted only after the panel is powered on. The panel power will be enabled from the panel-edp driver and only after that, the hpd line will be asserted. Whereas for DP, the sink can be hotplugged and unplugged anytime. The hpd line gets asserted to indicate the sink is connected and ready. Hence there is no need to wait for the hpd line to be asserted for a DP sink. Signed-off-by: Sankeerth Billakanti Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483312/ Link: https://lore.kernel.org/r/1650887072-16652-4-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov commit 391c96ff055508bcc28f2b8d6b745e1eb8e472f2 Author: Sankeerth Billakanti Date: Mon Apr 25 17:14:30 2022 +0530 drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP The panel-edp enables the eDP panel power during probe, get_modes and pre-enable. The eDP connect and disconnect interrupts for the eDP/DP controller are directly dependent on panel power. As eDP display can be assumed as always connected, the controller driver can skip the eDP connect and disconnect interrupts. Any disruption in the link status will be indicated via the IRQ_HPD interrupts. So, the eDP controller driver can just enable the IRQ_HPD and replug interrupts. The DP controller driver still needs to enable all the interrupts. Signed-off-by: Sankeerth Billakanti Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483310/ Link: https://lore.kernel.org/r/1650887072-16652-3-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov commit f5d01644921b7cba461fe1cde57d60a0e4ab3518 Author: Dmitry Baryshkov Date: Tue Apr 26 03:41:28 2022 +0300 drm/msm: select DRM_DP_AUX_BUS for the AUX bus support Add missing dependency on the AUX bus implementation. Fixes: c3bf8e21b38a ("drm/msm/dp: Add eDP support via aux_bus") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483406/ Link: https://lore.kernel.org/r/20220426004128.2832555-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 81c653659d34ec253fba7f5d0f430813fe0f643d Author: Joel Savitz Date: Thu Mar 24 18:11:56 2022 -0400 Documentation/sysctl: document max_rcu_stall_to_panic commit dfe564045c65 ("rcu: Panic after fixed number of stalls") introduced a new systctl but no accompanying documentation. Add a simple entry to the documentation. Signed-off-by: Joel Savitz Acked-by: Paul E. McKenney Signed-off-by: Jonathan Corbet commit c3bf8e21b38a89418f2e22173b229aaad2306815 Author: Sankeerth Billakanti Date: Mon Apr 25 17:14:29 2022 +0530 drm/msm/dp: Add eDP support via aux_bus This patch adds support for generic eDP sink through aux_bus. The eDP/DP controller driver should support aux transactions originating from the panel-edp driver and hence should be initialized and ready. The panel bridge supporting the panel should be ready before the bridge connector is initialized. The generic panel probe needs the controller resources to be enabled to support the aux transactions originating from the panel probe. Signed-off-by: Sankeerth Billakanti Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483307/ Link: https://lore.kernel.org/r/1650887072-16652-2-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov commit 375a126090b95de08fcfce2940790ccb02d7529a Author: Kuogee Hsieh Date: Mon Apr 25 15:56:22 2022 -0700 drm/msm/dp: tear down main link at unplug handle immediately Two stages are required to setup up main link to be ready to transmit video stream. Stage 1: dp_hpd_plug_handle() perform link training to set up main link stage 2: user space framework (msm_dp_display_enable()) to enable pixel clock and transfer main link to video ready state. At current implementation, when dongle unplugged dp_hdp_unplug_handle() has to wait until stage 2 completed before it can send link down uevent to user space framework to disable pixel clock followed by tearing down main link. This introduce unnecessary latency if dongle unplugged happen after stage 1 and before stage 2. It also has possibility leave main link stay at ready state after dongle unplugged if framework does not response to link down uevent notification. This will prevent next dongle plug in from working. This scenario could possibly happen when dongle unplug while system in the middle of suspending. This patch allow unplug handle to tear down main link and notify framework link down immediately if dongle unplugged happen after stage 1 and before stage 2. With this approach, dp driver is much more resilient to any different scenarios. Also redundant both dp_connect_pending_timeout() and dp_disconnect_pending_timeout() are removed to reduce logic complexity. Changes in V2: -- return -EINVAL at msm_dp_display_enable() if not in correct state -- replace ST_CONNECT_PENDING with ST_MAINLINK_READY Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483391/ Link: https://lore.kernel.org/r/1650927382-22461-1-git-send-email-quic_khsieh@quicinc.com [DB: fixed return values due to conversion to function merge] Signed-off-by: Dmitry Baryshkov commit e92d0d93f86699b7b25c7906613fdc374d66c8ca Author: Lv Ruyi Date: Sun Apr 24 03:24:18 2022 +0000 drm/msm/dp: fix error check return value of irq_of_parse_and_map() The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483176/ Link: https://lore.kernel.org/r/20220424032418.3173632-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Baryshkov commit 570d3e5d28db7a94557fa179167a9fb8642fb8a1 Author: Kuogee Hsieh Date: Mon Apr 18 14:56:28 2022 -0700 drm/msm/dp: stop event kernel thread when DP unbind Current DP driver implementation, event thread is kept running after DP display is unbind. This patch fix this problem by disabling DP irq and stop event thread to exit gracefully at dp_display_unbind(). Changes in v2: -- start event thread at dp_display_bind() Changes in v3: -- disable all HDP interrupts at unbind -- replace dp_hpd_event_setup() with dp_hpd_event_thread_start() -- replace dp_hpd_event_stop() with dp_hpd_event_thread_stop() -- move init_waitqueue_head(&dp->event_q) to probe() -- move spin_lock_init(&dp->event_lock) to probe() Changes in v4: -- relocate both dp_display_bind() and dp_display_unbind() to bottom of file Changes in v5: -- cancel relocation of both dp_display_bind() and dp_display_unbind() Changes in v6: -- move empty event q to dp_event_thread_start() Changes in v7: -- call ktheread_stop() directly instead of dp_hpd_event_thread_stop() function Changes in v8: -- return error immediately if audio registration failed. Changes in v9: -- return error immediately if event thread create failed. Changes in v10: -- delete extra DRM_ERROR("failed to create DP event thread\n"); Fixes: 8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets") Signed-off-by: Kuogee Hsieh Reported-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/482399/ Link: https://lore.kernel.org/r/1650318988-17580-1-git-send-email-quic_khsieh@quicinc.com [DB: fixed Fixes tag] Signed-off-by: Dmitry Baryshkov commit 13b73e1f0b44eab11da3ba5414dedd04f1413343 Author: Dmitry Baryshkov Date: Thu Mar 31 01:30:07 2022 +0300 drm/msm/dp: remove max_pclk_khz field from dp_panel/dp_display Since the last commit, the max_pclk_khz became constant, it's set to DP_MAX_PIXEL_CLK_KHZ and never changed afterwards. Remove it completely and use DP_MAX_PIXEL_CLK_KHZ directly. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/480139/ Link: https://lore.kernel.org/r/20220330223008.649274-4-dmitry.baryshkov@linaro.org [DB: applied a fix to follow connector->bridge conversion] Signed-off-by: Dmitry Baryshkov commit a52bfaf614e702a04f4dd4ddf331f8923e29b15f Author: Dmitry Baryshkov Date: Thu Mar 31 01:30:06 2022 +0300 drm/msm/dp: simplify dp_connector_get_modes() Since dp_panel_get_modes() handling for dp_mode was removed, dp_display_get_modes also doesn't change the passed dp_mode, drop the unused dp_mode variable being allocated unused and then freed. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/480137/ Link: https://lore.kernel.org/r/20220330223008.649274-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit ac31f3387c4a354b52a2f69819446887b922320b Author: Dmitry Baryshkov Date: Thu Mar 31 01:30:05 2022 +0300 drm/msm/dp: drop dp_mode argument from dp_panel_get_modes() Since the commit ab205927592b ("drm/msm/dp: remove mode hard-coding in case of DP CTS") the function dp_panel_get_modes() doesn't use (or fill) the dp_mode argument. Drop it completely. Reviewed-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/480138/ Link: https://lore.kernel.org/r/20220330223008.649274-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 202aceac8bb3ae12d41dcd3ac9e6c3395963032b Author: Kuogee Hsieh Date: Thu Feb 17 10:35:30 2022 -0800 drm/msm/dp: replace DRM_DEBUG_DP marco with drm_dbg_dp Since DRM_DEBUG_DP is deprecated in favor of drm_dbg_dp(NULL, ...), this patch replace all DRM_DEBUG_DP with drm_dbg_dp(). Changes in v4: -- replace (strucr drm_dev *)NULL with drm_dev Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/474870/ Link: https://lore.kernel.org/r/1645122930-23863-4-git-send-email-quic_khsieh@quicinc.com [DB: fixed compilation of dp_bridge_detect() caused by previous patch] Signed-off-by: Dmitry Baryshkov commit 13ea4799a81b48aca810e1639d7bbeb2792709ac Author: Dmitry Baryshkov Date: Sat Feb 12 01:40:06 2022 +0300 drm/msm/dp: remove extra wrappers and public functions dp_bridge's functions are thin wrappers around the msm_dp_display_* family. Squash dp_bridge callbacks into respective msm_dp_display functions, removing the latter functions from public space. Signed-off-by: Dmitry Baryshkov Tested-by: Sankeerth Billakanti Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473858/ Link: https://lore.kernel.org/r/20220211224006.1797846-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit a586191c141ef413d899e136c1d06407c9454971 Author: Dmitry Baryshkov Date: Sat Feb 12 01:40:05 2022 +0300 drm/msm/dp: replace dp_connector with drm_bridge_connector There is little point in having both connector and root bridge implementation in the same driver. Move connector's functionality to the bridge to let next bridge in chain to override it. Signed-off-by: Dmitry Baryshkov Tested-by: Sankeerth Billakanti Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/473854/ Link: https://lore.kernel.org/r/20220211224006.1797846-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit da10e2801423879a231724a9417a444c026747cb Author: Abhinav Kumar Date: Tue Apr 26 07:41:36 2022 -0700 drm/msm/dpu: add wb_idx to DRM traces in dpu_encoder Change the DRM traces to include both the intf_mode and wb_idx similar to the DRM prints in the previous change. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483528/ Link: https://lore.kernel.org/r/1650984096-9964-20-git-send-email-quic_abhinavk@quicinc.com [DB: fixed indentation and added wb_idx to the dpu_enc_trigger_flush's TP_ARGS] Signed-off-by: Dmitry Baryshkov commit 750e78a19db3bc0af612273fcdaba8b525359175 Author: Abhinav Kumar Date: Tue Apr 26 07:41:35 2022 -0700 drm/msm/dpu: add wb_idx to existing DRM prints in dpu_encoder Add wb_idx to existing DRM prints in dpu_encoder and also print the intf_mode so that its clear that for any INTF_CMD/VID there will be a valid intf_idx and any INTF_WB_* there will be a valid wb_idx. Update the debugfs to add the same information. Here is a sample output with this change: root:/sys/kernel/debug/dri/0/encoder31# cat status intf:1 wb:-1 vsync: 31 underrun: 0 mode: INTF_MODE_VIDEO root:/sys/kernel/debug/dri/0/encoder33# cat status intf:-1 wb:2 vsync: 7 underrun: 0 mode: INTF_MODE_WB_LINE Also remove DPU_DEBUG_PHYS macros as its unused because the respective dpu_encoder_phys_* files have their own macros. changes in v2: - use switch case instead of if/else-if for get_intf_type Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483530/ Link: https://lore.kernel.org/r/1650984096-9964-19-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 4448d59104151cc6de9472d45925595651288af2 Author: Abhinav Kumar Date: Tue Apr 26 07:41:34 2022 -0700 drm/msm/dpu: add writeback blocks to the display snapshot Add writeback block information while capturing the display snapshot. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483524/ Link: https://lore.kernel.org/r/1650984096-9964-18-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit f2969c4948bbe9051aea41a402029fa76b785944 Author: Abhinav Kumar Date: Tue Apr 26 07:41:33 2022 -0700 drm/msm/dpu: gracefully handle null fb commits for writeback kms_writeback test cases also verify with a null fb for the writeback connector job. In addition there are also other commit paths which can result in kickoffs without a valid framebuffer like while closing the fb which results in the callback to drm_atomic_helper_dirtyfb() which internally triggers a commit. Add protection in the dpu driver to ensure that commits for writeback encoders without a valid fb are gracefully skipped. changes in v2: - rename dpu_encoder_has_valid_fb to dpu_encoder_is_valid_for_commit changes in v3: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483522/ Link: https://lore.kernel.org/r/1650984096-9964-17-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 5cf5afcdbe050124caa02c898f61c5fad97a0b0b Author: Abhinav Kumar Date: Tue Apr 26 07:41:32 2022 -0700 drm/msm/dpu: initialize dpu encoder and connector for writeback Initialize dpu encoder and connector for writeback if the target supports it in the catalog. changes in v2: - start initialing the encoder for writeback since we have migrated to using drm_writeback_connector_init_with_encoder() - instead of checking for WB_2 inside _dpu_kms_initialize_writeback call it only when its WB_2 - rebase on tip of msm-next and remove usage of priv->encoders changes in v3: - none changes in v4: - fix copyright years order Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483526/ Link: https://lore.kernel.org/r/1650984096-9964-16-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 77b001acdcfeb892842caac49fb7f0d286b29c43 Author: Abhinav Kumar Date: Tue Apr 26 07:41:31 2022 -0700 drm/msm/dpu: add the writeback connector layer Introduce the dpu_writeback module which serves as the interface between dpu operations and the drm_writeback. This module manages the connector related operations for dpu writeback. changes in v2: - start using drm_writeback_connector_init_with_encoder() - drop unnecessary arguments from dpu_writeback_init() - rebase on msm-next tip and remove usage of priv->connectors changes in v3: - none changes in v4: - none changes in v5: - store the drm_enc in the dpu_wb_conn to be used while using dpu_encoder APIs Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483520/ Link: https://lore.kernel.org/r/1650984096-9964-15-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit d7d0e73f7de33a2b9998b607707a3e944ef3b86d Author: Abhinav Kumar Date: Tue Apr 26 07:41:30 2022 -0700 drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback Introduce the dpu_encoder_phys_* for the writeback interface to handle writeback specific hardware programming. changes in v4: - squash the encoder_phys_wb bits from [1] - since its a trivial change of a previously acked change preserving the ack [1] https://patchwork.freedesktop.org/patch/483099/?series=102964&rev=2 Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483532/ Link: https://lore.kernel.org/r/1650984096-9964-14-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 21539b8f88914ea00e11ed328d14e604f43be561 Author: Abhinav Kumar Date: Tue Apr 26 07:41:29 2022 -0700 drm/msm/dpu: move _dpu_plane_get_qos_lut to dpu_hw_util file _dpu_plane_get_qos_lut() is not specific to just dpu_plane. It can take any fill level and return the LUT matching it. This can be used even for other modules like dpu_writeback. Move _dpu_plane_get_qos_lut() to the common dpu_hw_util file and rename it to _dpu_hw_get_qos_lut(). Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483518/ Link: https://lore.kernel.org/r/1650984096-9964-13-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit d4e5f4508df076eb47dde81f71cacbea7ba3923a Author: Abhinav Kumar Date: Tue Apr 26 07:41:28 2022 -0700 drm/msm/dpu: add encoder operations to prepare/cleanup wb job add dpu encoder APIs to prepare and cleanup writeback job for the writeback encoder. These shall be invoked from the prepare_wb_job/cleanup_wb_job hooks of the drm_writeback framework. changes in v3: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483516/ Link: https://lore.kernel.org/r/1650984096-9964-12-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit e02a559a720fb06798fda9ab42113f76a1384c5a Author: Abhinav Kumar Date: Tue Apr 26 07:41:27 2022 -0700 drm/msm/dpu: make changes to dpu_encoder to support virtual encoder Make changes to dpu_encoder to support virtual encoder needed to support writeback for dpu. changes in v4: - squash dpu_encoder pieces from [1] changes in v5: - none changes in v6: - fix the comment about intf_idx and wb_idx - add the condition for valid phys_enc with intf_idx and wb_idx [1] https://patchwork.freedesktop.org/patch/483099/?series=102964&rev=2 Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483514/ Link: https://lore.kernel.org/r/1650984096-9964-11-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit ae4d721ce10057a4aa9f0d253e0d460518a9ef75 Author: Abhinav Kumar Date: Tue Apr 26 07:41:26 2022 -0700 drm/msm/dpu: add an API to reset the encoder related hw blocks Add an API to reset the encoder related hw blocks to ensure a proper teardown of the pipeline. At the moment this is being used only for the writeback encoder but eventually we can start using this for all interfaces. changes in v4: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483512/ Link: https://lore.kernel.org/r/1650984096-9964-10-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 6d084806c8c107dc0b652d6792c7aea9b6b0d66f Author: Abhinav Kumar Date: Tue Apr 26 07:41:25 2022 -0700 drm/msm/dpu: add changes to support writeback in hw_ctl Add changes to support writeback module in the dpu_hw_ctl interface. changes in v4: - fix the copyright year order Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483507/ Link: https://lore.kernel.org/r/1650984096-9964-9-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 25a29653aec65e0b4368ef50921075b1c2da577e Author: Abhinav Kumar Date: Tue Apr 26 07:41:24 2022 -0700 drm/msm/dpu: add writeback blocks to DPU RM Add writeback blocks to DPU resource manager so that the encoders can directly request them through RM. changes in v4: - absorb dpu_rm.h header change from [1] - since its a trivial change absorbed from an approved patch, preserving the previous ack on this [1] https://patchwork.freedesktop.org/patch/483099/?series=102964&rev=2 Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483508/ Link: https://lore.kernel.org/r/1650984096-9964-8-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 84a33d0fd921767b911b7027431811b4bb336e8d Author: Abhinav Kumar Date: Tue Apr 26 07:41:23 2022 -0700 drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks Add the dpu_hw_wb abstraction to program registers related to the writeback block. These will be invoked once all the configuration is set and ready to be programmed to the registers. changes in v3: - start using the common struct dpu_hw_cdp_cfg - leave a comment about DPU non-DPU_WB_QOS_8LVL chipsets Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483505/ Link: https://lore.kernel.org/r/1650984096-9964-7-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 786de937c4a0481dcce62f067576810f4141c896 Author: Abhinav Kumar Date: Tue Apr 26 07:41:22 2022 -0700 drm/msm/dpu: rename dpu_hw_pipe_cdp_cfg to dpu_hw_cdp_cfg Rename dpu_hw_pipe_cdp_cfg to dpu_hw_cdp_cfg and move it to dpu_hw_utils file so that other modules in addition to SSPP such as writeback can use it as all the fields can be used by writeback as well. Suggested-by: Dmitry Baryshkov Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483503/ Link: https://lore.kernel.org/r/1650984096-9964-6-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit e1a950eec25656e78f3a7a3b96e2bb21531f7421 Author: Abhinav Kumar Date: Tue Apr 26 07:41:21 2022 -0700 drm/msm/dpu: add reset_intf_cfg operation for dpu_hw_ctl Add a reset_intf_cfg operation for dpu_hw_ctl to reset the entire CTL path by disabling each component namely layer mixer, 3d-merge and interface blocks. changes in v3: - none Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483502/ Link: https://lore.kernel.org/r/1650984096-9964-5-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 53324b99bd7b4d6a65364ea0a992bf0bb1108513 Author: Abhinav Kumar Date: Tue Apr 26 07:41:20 2022 -0700 drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog Add writeback blocks to the sm8250 DPU hardware catalog. Other chipsets support writeback too but add it to sm8250 to prototype the feature so that it can be easily extended to other chipsets. changes in v4: - fix the copyright year order Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483510/ Link: https://lore.kernel.org/r/1650984096-9964-4-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 7933aecffa28a1746997436426b5df767b2df925 Author: Abhinav Kumar Date: Tue Apr 26 07:41:19 2022 -0700 drm: introduce drm_writeback_connector_init_with_encoder() API For vendors drivers which pass an already allocated and initialized encoder especially for cases where the encoder hardware is shared OR the writeback encoder shares the resources with the rest of the display pipeline introduce a new API, drm_writeback_connector_init_with_encoder() which expects an initialized encoder as a parameter and only sets up the writeback connector. changes in v5: - fix the encoder doc to indicate that its not valid for users of drm_writeback_connector_init_with_encoder() Reviewed-by: Liviu Dudau Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Reviewed-by: Laurent Pinchart Patchwork: https://patchwork.freedesktop.org/patch/483500/ Link: https://lore.kernel.org/r/1650984096-9964-3-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 57b8280a0a4163545b532ae516c2dd5c9b295ea3 Author: Abhinav Kumar Date: Tue Apr 26 07:41:18 2022 -0700 drm: allow passing possible_crtcs to drm_writeback_connector_init() Clients of drm_writeback_connector_init() initialize the possible_crtcs and then invoke the call to this API. To simplify things, allow passing possible_crtcs as a parameter to drm_writeback_connector_init() and make changes to the other drm drivers to make them compatible with this change. changes in v2: - split the changes according to their functionality changes in v3: - allow passing possible_crtcs for existing users of drm_writeback_connector_init() - squash the vendor changes into the same commit so that each patch in the series can compile individually changes in v4: - keep only changes related to possible_crtcs - add line breaks after ARRAY_SIZE - stop using temporary variables for possible_crtcs changes in v5: - None changes in v6: - None changes in v7: - wrap long lines to match the coding style of existing drivers - Fix indentation and remove parenthesis where not needed - use u32 instead of uint32_t for possible_crtcs Signed-off-by: Abhinav Kumar Acked-by: Liviu Dudau Reviewed-by: Dmitry Baryshkov Reviewed-by: Laurent Pinchart Patchwork: https://patchwork.freedesktop.org/patch/483501/ Link: https://lore.kernel.org/r/1650984096-9964-2-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit fa5186b279ecf44b14fb435540d2065be91cb1ed Author: Vinod Polimera Date: Mon Apr 25 08:56:53 2022 +0530 drm/msm/disp/dpu1: set vbif hw config to NULL to avoid use after memory free during pm runtime resume BUG: Unable to handle kernel paging request at virtual address 006b6b6b6b6b6be3 Call trace: dpu_vbif_init_memtypes+0x40/0xb8 dpu_runtime_resume+0xcc/0x1c0 pm_generic_runtime_resume+0x30/0x44 __genpd_runtime_resume+0x68/0x7c genpd_runtime_resume+0x134/0x258 __rpm_callback+0x98/0x138 rpm_callback+0x30/0x88 rpm_resume+0x36c/0x49c __pm_runtime_resume+0x80/0xb0 dpu_core_irq_uninstall+0x30/0xb0 dpu_irq_uninstall+0x18/0x24 msm_drm_uninit+0xd8/0x16c Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/483255/ Link: https://lore.kernel.org/r/1650857213-30075-1-git-send-email-quic_vpolimer@quicinc.com [DB: fixed Fixes tag] Signed-off-by: Dmitry Baryshkov commit 95093595914c17f32e1d6228b4db06fab8cebd35 Author: Lv Ruyi Date: Mon Apr 25 09:09:47 2022 +0000 drm/msm/dpu: fix error check return value of irq_of_parse_and_map() The irq_of_parse_and_map() function returns 0 on failure, and does not return a negative value anyhow, so never enter this conditional branch. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/483291/ Link: https://lore.kernel.org/r/20220425090947.3498897-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Baryshkov commit 3e9c146f4997e32d257215b0036b2425c6053ffe Author: Bjorn Andersson Date: Wed Apr 20 21:15:50 2022 -0700 drm/msm/dpu: Issue MDSS reset during initialization It's typical for the bootloader to bring up the display for showing a boot splash or efi framebuffer. But in some cases the kernel driver ends up only partially configuring (in particular) the DPU, which might result in e.g. that two different data paths attempts to push data to the interface - with resulting graphical artifacts. Naturally the end goal would be to inherit the bootloader's configuration and provide the user with a glitch free handover from the boot configuration to a running DPU. But as implementing seamless transition from the bootloader configuration to the running OS will be a considerable effort, start by simply resetting the entire MDSS to its power-on state, to avoid the partial configuration. Signed-off-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482796/ Link: https://lore.kernel.org/r/20220421041550.643964-2-bjorn.andersson@linaro.org Signed-off-by: Dmitry Baryshkov commit 3e4659f98ef93de21ea69ac8222d02367da79de6 Author: Bjorn Andersson Date: Wed Apr 20 21:15:49 2022 -0700 dt-bindings: display: msm: Add optional resets Add an optional reference to the MDSS_CORE reset, which when specified can be used by the implementation to reset the hardware blocks. Reviewed-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Patchwork: https://patchwork.freedesktop.org/patch/482794/ Link: https://lore.kernel.org/r/20220421041550.643964-1-bjorn.andersson@linaro.org Signed-off-by: Dmitry Baryshkov commit dabfdd89eaa9283ef3db49a528f27782f829a39f Author: Vinod Polimera Date: Mon Apr 11 22:07:01 2022 +0530 drm/msm/disp/dpu1: add inline rotation support for sc7280 - Some DPU versions support inline rot90. It is supported only for limited amount of UBWC formats. - There are two versions of inline rotators, v1 (present on sm8250 and sm7250) and v2 (sc7280). These versions differ in the list of supported formats and in the scaler possibilities. Co-developed-by: Kalyan Thota Signed-off-by: Kalyan Thota Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/481672/ Link: https://lore.kernel.org/r/1649695021-19132-3-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov commit b72192f424e33ccfa31180f405a6494624e87d56 Author: Vinod Polimera Date: Mon Apr 11 22:07:00 2022 +0530 drm/msm/disp/dpu1: add inline function to validate format support Check if the dpu format is supported or not using dpu_find_format. Co-developed-by: Kalyan Thota Signed-off-by: Kalyan Thota Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/481670/ Link: https://lore.kernel.org/r/1649695021-19132-2-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov commit f271d3bfeba99b8af373d10343b02769febd8762 Author: Marijn Suijten Date: Wed Feb 23 12:40:10 2022 +0100 drm/msm/dpu: Bind pingpong block to intf on active ctls in cmd encoder As per the specification of DPU_CTL_ACTIVE_CFG the configuration of active blocks should be proactively specified, and the pingpong block is no different. The downstream display driver [1] confirms this by also calling bind_pingpong_blk on CTL_ACTIVE_CFG. Note that this else-if is always entered, as setup_intf_cfg - unlike this mainline dpu driver that combines both behind the same function pointer - is left NULL in favour of using setup_intf_cfg_v1 when CTL_ACTIVE_CFG is set. This solves continuous timeouts on at least the Qualcomm sm6125 SoC: [drm:dpu_encoder_frame_done_timeout:2091] [dpu error]enc31 frame done timeout [drm:_dpu_encoder_phys_cmd_handle_ppdone_timeout.isra.0] *ERROR* id:31 pp:0 kickoff timeout 0 cnt 1 koff_cnt 1 [drm:dpu_encoder_phys_cmd_prepare_for_kickoff] *ERROR* failed wait_for_idle: id:31 ret:-110 pp:0 In the same way this pingpong block should also be unbound followed by an interface flush when the encoder is disabled, according to the downstream display driver [2]. [1]: https://source.codeaurora.org/quic/la/platform/vendor/opensource/display-drivers/tree/msm/sde/sde_encoder_phys_cmd.c?h=LA.UM.9.16.r1-08500-MANNAR.0#n167 [2]: https://source.codeaurora.org/quic/la/platform/vendor/opensource/display-drivers/tree/msm/sde/sde_encoder.c?h=LA.UM.9.16.r1-08500-MANNAR.0#n2986 Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/475874/ Link: https://lore.kernel.org/r/20220223114011.219044-1-marijn.suijten@somainline.org Signed-off-by: Dmitry Baryshkov commit 1c7b8ed7dbe0f4601752a4e4ed46c9a78fd824a4 Author: Dmitry Baryshkov Date: Tue Feb 22 09:22:46 2022 +0300 drm/msm/dpu: drop INTF_EDP from interface type conditions To remove possible confusion between (old) INTF_EDP and newer INTF_DP, stop using INTF_EDP in DPU's code. Until the 8x74/8x84 SoCs are supported by DPU driver, there is no point in using INTF_EDP. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/475560/ Link: https://lore.kernel.org/r/20220222062246.242577-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 5f12b42e538933b5ba71dd6da6cdd88afe1b13c8 Author: Dmitry Baryshkov Date: Tue Feb 22 09:22:45 2022 +0300 drm/msm/dpu: drop obsolete INTF_EDP comment DPU driver never supported INTF_EDP, so let's drop the obsolete comment. If at some point 8x74/8x84's INTF_EDP is ported to DPU driver, corresponding handling will have to be ported too. Until that time, the comment serves no purpose. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/475557/ Link: https://lore.kernel.org/r/20220222062246.242577-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit f4f3112213ebed0a32cf9e3739ad1711b919ebf5 Author: Dmitry Baryshkov Date: Tue Feb 22 09:22:44 2022 +0300 drm/msm/dpu: drop INTF_TYPE_MAX symbol This enum value does not correspond to any of actual interface types, it's not used by the driver, and the value of INTF_WB is greater than INTF_TYPE_MAX. Thus this symbol serves no purpose and can be removed. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/475556/ Link: https://lore.kernel.org/r/20220222062246.242577-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 4a9fb91ac74028d85f96f4caf7097e3a1e3a7321 Author: Dmitry Baryshkov Date: Tue Feb 22 09:22:43 2022 +0300 drm/msm/dpu: document INTF_EDP/INTF_DP difference Based on the discussions on the mailing list, document enum dpu_intf_type and it's controversial fields: INTF_DP and INTF_EDP. INTF_EDP is used for older eDP interface found on msm8x74/msm8x84 INTF_DP is used for both eDP and DP interfaces handled by the msm/dp driver. The DPU driver does not make a difference between them. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/475555/ Link: https://lore.kernel.org/r/20220222062246.242577-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 1e7ac595fa46eab834535dca1f38e0784b3594ad Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:48 2022 +0300 drm/msm/dpu: pass irq to dpu_encoder_helper_wait_for_irq() Pass IRQ number directly rather than passing an index in the dpu_encoder's irq table. Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/474703/ Link: https://lore.kernel.org/r/20220217043148.480898-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit b8c149e2b1dd59a5861e293a51f4ebf760c04987 Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:47 2022 +0300 drm/msm/dpu: remove struct dpu_encoder_irq Remove additional indirection: specify IRQ callbacks and IRQ indices directly rather than through the pointer in the irq structure. For each IRQ we have a constant IRQ callback. This change simplifies code review as the reader no longer needs to remember which function is called. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/474700/ Link: https://lore.kernel.org/r/20220217043148.480898-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 6ee11c415ec9b5e8a9673ef66a8d137d5792e32c Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:46 2022 +0300 drm/msm/dpu: get rid of dpu_encoder_helper_(un)register_irq Get rid of dpu_encoder_helper_register_irq/unregister_irq helpers, call dpu_core_register/unregister_callback directly, without surrounding them with helpers. Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/474698/ Link: https://lore.kernel.org/r/20220217043148.480898-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit c929ac60b3ed34accd25a052a4833e418900f466 Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:45 2022 +0300 drm/msm/dpu: allow just single IRQ callback DPU interrupts code allows multiple callbacks per interrut. In reality none of the interrupts is shared between blocks (and will probably never be). Drop support for registering multiple callbacks per interrupt to simplify interrupt handling code. Reported-by: kernel test robot Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/474701/ Link: https://lore.kernel.org/r/20220217043148.480898-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 52db0f2b9f6e131c759a480790a902c6237b453f Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:44 2022 +0300 drm/msm/dpu: remove always-true argument of dpu_core_irq_read() The argument clear of the function dpu_core_irq_read() is always true. Remove it. Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/474697/ Link: https://lore.kernel.org/r/20220217043148.480898-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit dd77ce4da889fa41f8ad7cc5ece514a9959d3377 Author: Dmitry Baryshkov Date: Thu Feb 17 07:31:43 2022 +0300 drm/msm/dpu: remove extra wrappers around dpu_core_irq Remove extra dpu_irq_* wrappers from dpu_kms.c, merge them directly into dpu_core_irq_* functions. Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/474696/ Link: https://lore.kernel.org/r/20220217043148.480898-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit c954531bc5d84fc13e035204750c3761c5fc93b0 Author: Fabien Dessenne Date: Fri Apr 22 16:36:08 2022 +0200 pinctrl: stm32: improve bank clocks management Instead of enabling/disabling the clock at each IO configuration update, just keep the clock enabled from the probe. This makes things simpler and more efficient (e.g. the time required to toggle an output IO is drastically decreased) without significantly increasing the power consumption. Signed-off-by: Fabien Dessenne Reviewed-by: Marek Vasut Link: https://lore.kernel.org/r/20220422143608.226580-1-fabien.dessenne@foss.st.com Signed-off-by: Linus Walleij commit f930b69a8944ab3f018e2a175ddbd16e71348df9 Merge: fdc33eba11c59 672c0c5173427 Author: Linus Walleij Date: Sun May 1 23:25:10 2022 +0200 Merge tag 'v5.18-rc5' into devel Merge in Linux 5.18-rc5 since new code to the STM32 driver depend in a non-trivial way on the fixes merged in -rc5. Signed-off-by: Linus Walleij commit 7a116a2dd32d96869f0f93bac00b900859ba0434 Author: Kuppuswamy Sathyanarayanan Date: Sat Apr 16 02:45:32 2022 +0000 x86/apic: Do apic driver probe for "nosmp" use case For the "nosmp" use case, the APIC initialization code selects "APIC_SYMMETRIC_IO_NO_ROUTING" as the default interrupt mode and avoids probing APIC drivers. This works well for the default APIC modes, but for the x2APIC case the probe function is required to allocate the cluster_hotplug mask. So in the APIC_SYMMETRIC_IO_NO_ROUTING case when the x2APIC is initialized it dereferences a NULL pointer and the kernel crashes. This was observed on a TDX platform where x2APIC is enabled and "nosmp" command line option is allowed. To fix this issue, probe APIC drivers via default_setup_apic_routing() for the APIC_SYMMETRIC_IO_NO_ROUTING interrupt mode too. Suggested-by: Kirill A. Shutemov Suggested-by: Rafael J. Wysocki Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Link: https://lore.kernel.org/r/a64f864e1114bcd63593286aaf61142cfce384ea.1650076869.git.sathyanarayanan.kuppuswamy@intel.com commit 246d921646c071b878480997c294db6c83215b06 Author: Mimi Zohar Date: Tue Nov 23 13:37:52 2021 -0500 fs-verity: define a function to return the integrity protected file digest Define a function named fsverity_get_digest() to return the verity file digest and the associated hash algorithm (enum hash_algo). This assumes that before calling fsverity_get_digest() the file must have been opened, which is even true for the IMA measure/appraise on file open policy rule use case (func=FILE_CHECK). do_open() calls vfs_open() immediately prior to ima_file_check(). Acked-by: Eric Biggers Signed-off-by: Mimi Zohar commit 09091c44cb737256f588050e363c4675d88aaac3 Author: Mimi Zohar Date: Wed Apr 27 08:12:38 2022 -0400 ima: use IMA default hash algorithm for integrity violations Integrity file violations - ToM/ToU, open writers - are recorded in the IMA measurement list, containing 0x00's in both the template data and file data hash fields, but 0xFF's are actually extended into TPM PCRs. Although the original 'ima' template data field ('d') is limited to 20 bytes, the 'd-ng' template digest field is not. The violation file data hash template field ('d-ng') is unnecessarily hard coded to SHA1. Instead of simply replacing the hard coded SHA1 hash algorithm with a larger hash algorithm, use the hash algorithm as defined in "ima_hash_algo". ima_hash_algo is set to either the Kconfig IMA default hash algorithm or as defined on the boot command line (ima_hash=). Including a non-SHA1 file data hash algorithm in the 'd-ng' field of violations is a cosmetic change. The template data hash field, which is extended into the TPM PCRs, is not affected by this change and should not affect attestation of the IMA measurement list. Tested-by: Stefan Berger Signed-off-by: Mimi Zohar commit 644664627d21648735adfa733956f94064d3417d Author: Mimi Zohar Date: Thu Apr 14 16:46:39 2022 -0400 ima: fix 'd-ng' comments and documentation Initially the 'd-ng' template field did not prefix the digest with either "md5" or "sha1" hash algorithms. Prior to being upstreamed this changed, but the comments and documentation were not updated. Fix the comments and documentation. Fixes: 4d7aeee73f53 ("ima: define new template ima-ng and template fields d-ng and n-ng") Reported-by: Eric Biggers Reviewed-by: Stefan Berger Signed-off-by: Mimi Zohar commit eda75f8238b079a41aa11383bd47dc3297e74cb1 Author: Krzysztof Kozlowski Date: Sun May 1 12:34:47 2022 +0200 iio: ti-ads8688: use of_device_id for OF matching The of_device_id was added to allow module autoloading, but it should be also used to allow driver matching via Devicetree. This also fixes W=1 warning: drivers/iio/adc/ti-ads8688.c:501:34: error: ‘ads8688_of_match’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220501103447.111392-2-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit 046dab28b10e6e1766685653d9a170e4c9b1e5fc Author: Krzysztof Kozlowski Date: Sun May 1 12:34:46 2022 +0200 iio: stmpe-adc: use of_device_id for OF matching The of_device_id was added to allow module autoloading, but it should be also used to allow driver matching via Devicetree. This also fixes W=1 warning: drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220501103447.111392-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jonathan Cameron commit e678acedf364a8843388af4e1e0ebe854f2e0e8c Author: Rob Herring Date: Fri Apr 22 14:20:39 2022 -0500 dt-bindings: iio: Fix incorrect compatible strings in examples Fix a couple of examples using incorrect compatible strings. Signed-off-by: Rob Herring Reviewed-by: Slawomir Stepien Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220422192039.2590548-1-robh@kernel.org Signed-off-by: Jonathan Cameron commit d3beaf181c2d6ad0690746db8495705f5abcafb3 Author: Uwe Kleine-König Date: Mon Apr 25 21:17:35 2022 +0200 iio: gyro: mpu3050: Make mpu3050_common_remove() return void This function (up to now) returns zero unconditionally, so there isn't any benefit of returning a value. Make it return void to be able to see at a glance that the return value of mpu3050_i2c_remove is always zero. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220425191735.59032-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 6e28f56c0d1d976a4940d13d7f27e446ce65cd0a Merge: 411a1476ea417 49714461b7970 Author: David S. Miller Date: Sun May 1 17:45:35 2022 +0100 Merge branch 'adin1100-industrial-PHY-support' Alexandru Tachici says: ==================== net: phy: adin1100: Add initial support for ADIN1100 industrial PHY The ADIN1100 is a low power single port 10BASE-T1L transceiver designed for industrial Ethernet applications and is compliant with the IEEE 802.3cg Ethernet standard for long reach 10 Mb/s Single Pair Ethernet. The ADIN1100 uses Auto-Negotiation capability in accordance with IEEE 802.3 Clause 98, providing a mechanism for exchanging information between PHYs to allow link partners to agree to a common mode of operation. The concluded operating mode is the transmit amplitude mode and master/slave preference common across the two devices. Both device and LP advertise their ability and request for increased transmit at: - BASE-T1 autonegotiation advertisement register [47:32]\ Clause 45.2.7.21 of Standard 802.3 - BIT(13) - 10BASE-T1L High Level Transmit Operating Mode Ability - BIT(12) - 10BASE-T1L High Level Transmit Operating Mode Request For 2.4 Vpp (high level transmit) operation, both devices need to have the High Level Transmit Operating Mode Ability bit set, and only one of them needs to have the High Level Transmit Operating Mode Request bit set. Otherwise 1.0 Vpp transmit level will be used. Settings for eth1: Supported ports: [ TP MII ] Supported link modes: 10baseT1L/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT1L/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Link partner advertised link modes: 10baseT1L/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: Yes Link partner advertised FEC modes: Not reported Speed: 10Mb/s Duplex: Full Auto-negotiation: on master-slave cfg: preferred slave master-slave status: slave Port: Twisted Pair PHYAD: 0 Transceiver: external MDI-X: Unknown Link detected: yes SQI: 7/7 1. Add basic support for ADIN1100. Alexandru Ardelean (1): net: phy: adin1100: Add initial support for ADIN1100 industrial PHY 1. Added 10baset-T1L link modes. 2. Added 10-BasetT1L registers. 3. Added Base-T1 auto-negotiation registers. For Base-T1 these registers decide master/slave status and TX voltage of the device and link partner. 4. Added 10BASE-T1L support in phy-c45.c. Now genphy functions will call Base-T1 functions where registers don't match, like the auto-negotiation ones. 5. Convert MSE to SQI using a predefined table and allow user access through ethtool. 6. DT bindings for the 2.4 Vpp transmit mode. ==================== Signed-off-by: David S. Miller commit 49714461b7970acb38c421a48f5d7f782e360003 Author: Alexandru Tachici Date: Fri Apr 29 18:34:37 2022 +0300 dt-bindings: net: phy: Add 10-baseT1L 2.4 Vpp Add a tristate property to advertise desired transmit level. If the device supports the 2.4 Vpp operating mode for 10BASE-T1L, as defined in 802.3gc, and the 2.4 Vpp transmit voltage operation is desired, property should be set to 1. This property is used to select whether Auto-Negotiation advertises a request to operate the 10BASE-T1L PHY in increased transmit level mode. If property is set to 1, the PHY shall advertise a request to operate the 10BASE-T1L PHY in increased transmit level mode. If property is set to zero, the PHY shall not advertise a request to operate the 10BASE-T1L PHY in increased transmit level mode. Reviewed-by: Rob Herring Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 48f20f90211978140fc391c4c1f10016f020a0fa Author: Alexandru Tachici Date: Fri Apr 29 18:34:36 2022 +0300 net: phy: adin1100: Add SQI support Determine the SQI from MSE using a predefined table for the 10BASE-T1L. Reviewed-by: Andrew Lunn Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 7eaf9132996a34ba2643efe91a355385c6ff5114 Author: Alexandru Ardelean Date: Fri Apr 29 18:34:35 2022 +0300 net: phy: adin1100: Add initial support for ADIN1100 industrial PHY The ADIN1100 is a low power single port 10BASE-T1L transceiver designed for industrial Ethernet applications and is compliant with the IEEE 802.3cg Ethernet standard for long reach 10 Mb/s Single Pair Ethernet. Signed-off-by: Alexandru Ardelean Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 3da8ffd8545f62fec85a48a3c637b2f427974f11 Author: Alexandru Tachici Date: Fri Apr 29 18:34:34 2022 +0300 net: phy: Add 10BASE-T1L support in phy-c45 This patch is needed because the BASE-T1 uses different registers for status, control and advertisement to those already employed in the existing phy-c45 functions. Where required, genphy_c45 functions will now check whether the device supports BASE-T1 and use the specific registers instead: 45.2.7.19 BASE-T1 AN control register, 45.2.7.20 BASE-T1 AN status, 45.2.7.21 BASE-T1 AN advertisement register, 45.2.7.22 BASE-T1 AN LP Base Page ability register, 45.2.1.185 BASE-T1 PMA/PMD control register. Tested-by: Oleksij Rempel Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 1b020e448e0fb67bcb04ee0f778d413045f965d3 Author: Alexandru Tachici Date: Fri Apr 29 18:34:33 2022 +0300 net: phy: Add BaseT1 auto-negotiation registers Added BASE-T1 AN advertisement register (Registers 7.514, 7.515, and 7.516) and BASE-T1 AN LP Base Page ability register (Registers 7.517, 7.518, and 7.519). Reviewed-by: Andrew Lunn Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 909b4f2bf764a903e9183111368f1509f9b40e6d Author: Alexandru Tachici Date: Fri Apr 29 18:34:32 2022 +0300 net: phy: Add 10-BaseT1L registers The 802.3gc specification defines the 10-BaseT1L link mode for ethernet trafic on twisted wire pair. PMA status register can be used to detect if the phy supports 2.4 V TX level and PCS control register can be used to enable/disable PCS level loopback. Reviewed-by: Andrew Lunn Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit 3254e0b9eb5649ffaa48717ebc9c593adc4ee6a9 Author: Alexandru Tachici Date: Fri Apr 29 18:34:31 2022 +0300 ethtool: Add 10base-T1L link mode entry Add entry for the 10base-T1L full duplex mode. Reviewed-by: Andrew Lunn Reviewed-by: Oleksij Rempel Signed-off-by: Alexandru Tachici Signed-off-by: David S. Miller commit fe18894930a025617114aa8ca0adbf94d5bffe89 Author: Haibo Chen Date: Mon Apr 25 16:41:00 2022 +0800 iio: mma8452: fix probe fail when device tree compatible is used. Correct the logic for the probe. First check of_match_table, if not meet, then check i2c_driver.id_table. If both not meet, then return fail. Fixes: a47ac019e7e8 ("iio: mma8452: Fix probe failing when an i2c_device_id is used") Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1650876060-17577-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Jonathan Cameron commit 5b3fd8fd7ceb135d08edf52adf6e833ee92a351e Author: Chih-Kang Chang Date: Thu Apr 28 10:05:21 2022 +0800 rtw88: fix hw scan may cause disconnect issue After scan aborts we still receive some hw scan c2h packets, and processing these c2h commands will change current channel. If device already connect to other AP, driver will set wrong op channel due to current channel changed. The disconnection happens when hw scan back to wrong op channel that device can't receive beacon from AP. To fix this issue, we ignore the late c2h if we are not scanning, and set current channel back to op channel after scan to align the FW behavior. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220428020521.8015-3-pkshih@realtek.com commit 02ee806843bd8ee868a0a2ff4364188807ce321d Author: Chih-Kang Chang Date: Thu Apr 28 10:05:20 2022 +0800 rtw88: fix not disabling beacon filter after disconnection Correct the judgment to let beacon filter disable after disconnection. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220428020521.8015-2-pkshih@realtek.com commit 1d6d131d504922327dbef7aded01430a251d765c Author: Chih-Kang Chang Date: Thu Apr 28 10:05:19 2022 +0800 rtw88: add HT MPDU density value for each chip Each chip have best ampdu density value, the correct setting can improve throughput performance. Signed-off-by: Chih-Kang Chang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220428020521.8015-1-pkshih@realtek.com commit 411a1476ea417c7cce9792b31dbc83cedbad7a41 Author: Marek Behún Date: Fri Apr 29 16:32:14 2022 +0200 net: dsa: mv88e6xxx: Cosmetic change spaces to tabs in dsa_switch_ops All but 5 methods in dsa_swith_ops use tabs for indentation. Change the 5 methods that break this rule. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 72a1a2edeb1cfb9d4400e19ff80ba5b0f93e9bd6 Author: Jiapeng Chong Date: Fri Apr 29 15:54:59 2022 +0800 plfxlc: Remove unused include Eliminate the follow versioncheck warning: ./drivers/net/wireless/purelifi/plfxlc/usb.c: 20 linux/version.h not needed. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220429075459.72029-1-jiapeng.chong@linux.alibaba.com commit a12d521f4a3d2088f23b75f063de68ea1dc6b5a3 Author: Sven Peter Date: Sun May 1 16:55:07 2022 +0200 dt-bindings: iommu: Add Apple SART DMA address filter Apple SoCs such as the M1 come with a simple DMA address filter called SART. Unlike a real IOMMU no pagetables can be configured but instead DMA transactions can be allowed for up to 16 paddr regions. The consumer also needs special support since not all DMA allocations have to be added to this filter. Reviewed-by: Rob Herring Signed-off-by: Sven Peter commit 9bd1d9a0d8bb1a549831fd98fcc3105960f7068b Author: Sven Peter Date: Sun May 1 16:55:06 2022 +0200 soc: apple: Add RTKit IPC library Apple SoCs such as the M1 come with multiple embedded co-processors running proprietary firmware. Communication with those is established over a simple mailbox using the RTKit IPC protocol. This cannot be implemented inside the mailbox subsystem since on top of communication over channels we also need support for starting, hibernating and resetting these co-processors. We also need to handle shared memory allocations differently depending on the co-processor and don't want to split that across multiple drivers. Reviewed-by: Arnd Bergmann Signed-off-by: Sven Peter commit cbb0f00131e48f38db9eda67e0f731504404567b Author: Sven Peter Date: Sun May 1 16:55:05 2022 +0200 soc: apple: Always include Makefile We want to allow the code inside drivers/soc/apple to be compiled with COMPILE_TEST but this will currently result in linking errors because ARCH_APPLE is not set and make will never recurse into drivers/soc/apple. Let's just unconditionally recurse into apple/ since all drivers in there are guarded by config options anyways. Signed-off-by: Sven Peter commit 30ac9b4e25d8cece00d32c7419f9d919f55421fe Author: Furkan Kardame Date: Fri Apr 29 07:52:52 2022 -0400 arm64: dts: rockchip: add dts for Firefly Station M2 rk3566 Add dts for Firefly Station M2. Working IO: * UART * LED * LAN * Wifi * SD Card * eMMC * USB2 Signed-off-by: Furkan Kardame Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220429115252.2360496-8-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 5859b5a9c3ac92d831bed164374cb837519524ad Author: Peter Geis Date: Fri Apr 29 07:52:51 2022 -0400 arm64: dts: rockchip: add SoQuartz CM4IO dts This is the initial SoQuartz SoM device tree on a CM4IO carrier board. This board outputs debug on uart2 and supports the following components: Gigabit Ethernet USB2 (OTG/Host shared) PCIe 2.0 x1 HDMI (HDMI Port 0) eDP (HDMI Port 1) DSI (RPi compatible pinout) CSI (RPi compatible pinout) A/B/G/N WiFi Bluetooth SDMMC eMMC SPI NOR Flash (Not placed) PI-40 compatible pin header Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220429115252.2360496-7-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit dcc8c66bef79befa6c9ebe7d7d62b0ce66983c20 Author: Peter Geis Date: Fri Apr 29 07:52:50 2022 -0400 arm64: dts: rockchip: add Pine64 Quartz64-B device tree Add a device tree for the Pine64 Quartz64 Model B single board computer. This board ouputs debug on uart2 and supports the following components: Gigabit Ethernet USB2 x2 (one port otg capable) USB3 PCIe/SATA M2 HDMI DSI (RPi compatible pinout) CSI (RPi compatible pinout) A/B/G/N WiFi Bluetooth SDMMC eMMC SPI Flash PI-40 compatible pin header Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220429115252.2360496-6-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit e52ded5543708e0382f236ce35372a63f4568341 Author: Peter Geis Date: Fri Apr 29 07:52:48 2022 -0400 dt-bindings: arm: rockchip: Add Firefly Station M2 The Station M2 is a compact single board computer based on the rk3566 SoC. It outputs on uart2 for debug and console purposes. Signed-off-by: Peter Geis Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429115252.2360496-4-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit c466828fb3ba8cb7f5c3bf28766da9b70bf9745e Author: Peter Geis Date: Fri Apr 29 07:52:47 2022 -0400 dt-bindings: arm: rockchip: Add Pine64 SoQuartz SoM The SoQuartz system on module is designed to be pin compatible with the RPi CM4 SoM. It is based on the rk3566 SoC and outputs on uart2 for debug and console. The first carrier board supported is the CM4IO board from RPi. Signed-off-by: Peter Geis Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429115252.2360496-3-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit c37415f55bdadffe5b4c0e7981e9fc7e8b96beea Author: Peter Geis Date: Fri Apr 29 07:52:46 2022 -0400 dt-bindings: arm: rockchip: Add Pine64 Quartz64 Model B The Quartz64 Model B is a compact single board computer from Pine64 based on the rk3566 SoC. It outputs on uart2 for the debug console. Signed-off-by: Peter Geis Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220429115252.2360496-2-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 0b8d7622ab1859bec082bd01c5e11137195f3d52 Author: Tetsuo Handa Date: Tue Apr 19 08:31:55 2022 +0900 aoe: Avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local aoe_wq. Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Link: https://lore.kernel.org/r/abb37616-eec9-2794-e21e-7c623085d987@I-love.SAKURA.ne.jp Signed-off-by: Jens Axboe commit 961c6136359eef38a8c023d02028fdcd123f02a6 Author: Vasily Averin Date: Fri Apr 29 08:17:35 2022 +0300 net: enable memcg accounting for veth queues veth netdevice defines own rx queues and allocates array containing up to 4095 ~750-bytes-long 'struct veth_rq' elements. Such allocation is quite huge and should be accounted to memcg. Signed-off-by: Vasily Averin Signed-off-by: David S. Miller commit b97af72209eedccb79a146b7b6243cffb20739b2 Merge: 0ed99ecc95b9c 0a8afd9f026a7 Author: David S. Miller Date: Sun May 1 12:19:01 2022 +0100 Merge branch 'UDP-sock_wfree-opts' Pavel Begunkov says: ==================== UDP sock_wfree optimisations The series is not UDP specific but that the main beneficiary. 2/3 saves one atomic in sock_wfree() and on top 3/3 removes an extra barrier. Tested with UDP over dummy netdev, 2038491 -> 2099071 req/s (or around +3%). note: in regards to 1/3, there is a "Should agree with poll..." comment that I don't completely get, and there is no git history to explain it. Though I can't see how it could rely on having the second check without racing with tasks woken by wake_up*(). The series was split from a larger patchset, see https://lore.kernel.org/netdev/cover.1648981570.git.asml.silence@gmail.com/ ==================== Signed-off-by: David S. Miller commit 0a8afd9f026a7f6c835be0fed2ab709d4133797f Author: Pavel Begunkov Date: Thu Apr 28 11:58:19 2022 +0100 sock: optimise sock_def_write_space barriers Now we have a separate path for sock_def_write_space() and can go one step further. When it's called from sock_wfree() we know that there is a preceding atomic for putting down ->sk_wmem_alloc. We can use it to replace to replace smb_mb() with a less expensive smp_mb__after_atomic(). It also removes an extra RCU read lock/unlock as a small bonus. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit 052ada096842a910327936b4ed203048906eb2c3 Author: Pavel Begunkov Date: Thu Apr 28 11:58:18 2022 +0100 sock: optimise UDP sock_wfree() refcounting For non SOCK_USE_WRITE_QUEUE sockets, sock_wfree() (atomically) puts ->sk_wmem_alloc twice. It's needed to keep the socket alive while calling ->sk_write_space() after the first put. However, some sockets, such as UDP, are freed by RCU (i.e. SOCK_RCU_FREE) and use already RCU-safe sock_def_write_space(). Carve a fast path for such sockets, put down all refs in one go before calling sock_def_write_space() but guard the socket from being freed by an RCU read section. note: because TCP sockets are marked with SOCK_USE_WRITE_QUEUE it doesn't add extra checks in its path. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit 14bfee9b62702ccac3014f1291943fabebafd5bc Author: Pavel Begunkov Date: Thu Apr 28 11:58:17 2022 +0100 sock: dedup sock_def_write_space wmem_alloc checks Except for minor rounding differences the first ->sk_wmem_alloc test in sock_def_write_space() is a hand coded version of sock_writeable(). Replace it with the helper, and also kill the following if duplicating the check. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit 0ed99ecc95b9c1d3c46d3bc34459088e82caef32 Author: Robert Hancock Date: Wed Apr 27 13:39:28 2022 -0600 net: phy: marvell: update abilities and advertising when switching to SGMII With some SFP modules, such as Finisar FCLF8522P2BTL, the PHY hardware strapping defaults to 1000BaseX mode, but the kernel prefers to set them for SGMII mode. When this happens and the PHY is soft reset, the BMSR status register is updated, but this happens after the kernel has already read the PHY abilities during probing. This results in support not being detected for, and the PHY not advertising support for, 10 and 100 Mbps modes, preventing the link from working with a non-gigabit link partner. When the PHY is being configured for SGMII mode, call genphy_read_abilities again in order to re-read the capabilities, and update the advertising field accordingly. Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 1a90bfd220201fbe050dfc15deaac20ca5f15638 Author: Sebastian Andrzej Siewior Date: Wed Apr 13 15:31:05 2022 +0200 smp: Make softirq handling RT safe in flush_smp_call_function_queue() flush_smp_call_function_queue() invokes do_softirq() which is not available on PREEMPT_RT. flush_smp_call_function_queue() is invoked from the idle task and the migration task with preemption or interrupts disabled. So RT kernels cannot process soft interrupts in that context as that has to acquire 'sleeping spinlocks' which is not possible with preemption or interrupts disabled and forbidden from the idle task anyway. The currently known SMP function call which raises a soft interrupt is in the block layer, but this functionality is not enabled on RT kernels due to latency and performance reasons. RT could wake up ksoftirqd unconditionally, but this wants to be avoided if there were soft interrupts pending already when this is invoked in the context of the migration task. The migration task might have preempted a threaded interrupt handler which raised a soft interrupt, but did not reach the local_bh_enable() to process it. The "running" ksoftirqd might prevent the handling in the interrupt thread context which is causing latency issues. Add a new function which handles this case explicitely for RT and falls back to do_softirq() on !RT kernels. In the RT case this warns when one of the flushed SMP function calls raised a soft interrupt so this can be investigated. [ tglx: Moved the RT part out of SMP code ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/YgKgL6aPj8aBES6G@linutronix.de Link: https://lore.kernel.org/r/20220413133024.356509586@linutronix.de commit 16bf5a5e1ec56474ed2a19d72f272ed09a5d3ea1 Author: Thomas Gleixner Date: Wed Apr 13 15:31:03 2022 +0200 smp: Rename flush_smp_call_function_from_idle() This is invoked from the stopper thread too, which is definitely not idle. Rename it to flush_smp_call_function_queue() and fixup the callers. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220413133024.305001096@linutronix.de commit d664e399128bd78b905ff480917e2c2d4949e101 Author: Thomas Gleixner Date: Wed Apr 13 15:31:02 2022 +0200 sched: Fix missing prototype warnings A W=1 build emits more than a dozen missing prototype warnings related to scheduler and scheduler specific includes. Reported-by: kernel test robot Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220413133024.249118058@linutronix.de commit b30ae5638dac6c5e640c47f59707d5b1e2c493e2 Author: Krzysztof Kozlowski Date: Sat Apr 30 14:18:57 2022 +0200 arm64: dts: juno: Drop useless 'dma-channels/requests' properties The pl330 DMA controller provides number of DMA channels and requests through its registers, so duplicating this information (with a chance of mistakes) in DTS is pointless. Additionally the DTS used always wrong property names which causes DT schema check failures - the bindings documented 'dma-channels' and 'dma-requests' properties without leading hash sign. Another reason is that the number of requests also does not seem right (should be 8). Link: https://lore.kernel.org/r/20220430121902.59895-5-krzysztof.kozlowski@linaro.org Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sudeep Holla commit 1229df4b313acf15d372caadcbbc62a430cd2697 Author: Miquel Raynal Date: Thu Apr 28 18:41:40 2022 +0200 net: mac802154: Fix symbol durations There are two major issues in the logic calculating the symbol durations based on the page/channel: - The page number is used in place of the channel value. - The BIT() macro is missing because we want to check the channel value against a bitmask. Fix these two errors and apologize loudly for this mistake. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220428164140.251965-1-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 4d27cf1d9de5becfa4d1efb2ea54dba1b9fc962a Author: Yang Jihong Date: Fri Apr 29 17:05:39 2022 +0800 perf tools: Add missing headers needed by util/data.h 'struct perf_data' in util/data.h uses the "u64" data type, which is defined in "linux/types.h". If we only include util/data.h, the following compilation error occurs: util/data.h:38:3: error: unknown type name ‘u64’ u64 version; ^~~ Solution: include "linux/types.h." to add the needed type definitions. Fixes: 258031c017c353e8 ("perf header: Add DIR_FORMAT feature to describe directory data") Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220429090539.212448-1-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 3297e5547b32c1d95ccf5fa1a81902dc402ef876 Merge: 36c84190dca0b 8013d1d3d2e33 Author: Arnaldo Carvalho de Melo Date: Sat Apr 30 12:23:24 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes from perf/urgent. Signed-off-by: Arnaldo Carvalho de Melo commit f2e030dd7aaea5a937a2547dc980fab418fbc5e7 Author: Almog Khaikin Date: Tue Apr 26 19:34:03 2022 +0300 io_uring: replace smp_mb() with smp_mb__after_atomic() in io_sq_thread() The IORING_SQ_NEED_WAKEUP flag is now set using atomic_or() which implies a full barrier on some architectures but it is not required to do so. Use the more appropriate smp_mb__after_atomic() which avoids the extra barrier on those architectures. Signed-off-by: Almog Khaikin Link: https://lore.kernel.org/r/20220426163403.112692-1-almogkh@gmail.com Fixes: 8018823e6987 ("io_uring: serialize ctx->rings->sq_flags with atomic_or/and") Signed-off-by: Jens Axboe commit ef060ea9e4fd3b763e7060a3af0a258d2d5d7c0d Author: Jens Axboe Date: Mon Apr 25 19:49:04 2022 -0600 io_uring: add IORING_SETUP_TASKRUN_FLAG If IORING_SETUP_COOP_TASKRUN is set to use cooperative scheduling for running task_work, then IORING_SETUP_TASKRUN_FLAG can be set so the application can tell if task_work is pending in the kernel for this ring. This allows use cases like io_uring_peek_cqe() to still function appropriately, or for the task to know when it would be useful to call io_uring_wait_cqe() to run pending events. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220426014904.60384-7-axboe@kernel.dk Signed-off-by: Jens Axboe commit e1169f06d5bbdbc2b22ae4e3083a4bf75ae5ecee Author: Jens Axboe Date: Mon Apr 25 19:49:03 2022 -0600 io_uring: use TWA_SIGNAL_NO_IPI if IORING_SETUP_COOP_TASKRUN is used If this is set, io_uring will never use an IPI to deliver a task_work notification. This can be used in the common case where a single task or thread communicates with the ring, and doesn't rely on io_uring_cqe_peek(). This provides a noticeable win in performance, both from eliminating the IPI itself, but also from avoiding interrupting the submitting task unnecessarily. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220426014904.60384-6-axboe@kernel.dk Signed-off-by: Jens Axboe commit 9f010507bbc1be19dbeedc1a254209fea44adc14 Author: Jens Axboe Date: Mon Apr 25 19:49:02 2022 -0600 io_uring: set task_work notify method at init time While doing so, switch SQPOLL to TWA_SIGNAL_NO_IPI as well, as that just does a task wakeup and then we can remove the special wakeup we have in task_work_add. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220426014904.60384-5-axboe@kernel.dk Signed-off-by: Jens Axboe commit 6cf5862e3c2caafd11f39a373b98b00c5a04b83a Author: Jens Axboe Date: Mon Apr 25 19:49:01 2022 -0600 io-wq: use __set_notify_signal() to wake workers The only difference between set_notify_signal() and __set_notify_signal() is that the former checks if it needs to deliver an IPI to force a reschedule. As the io-wq workers never leave the kernel, and IPI is never needed, they simply need a wakeup. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220426014904.60384-4-axboe@kernel.dk Signed-off-by: Jens Axboe commit 3a4b89a25ce59a87fcfff1f030cba8d544fd402c Author: Jens Axboe Date: Mon Apr 25 19:49:00 2022 -0600 io_uring: serialize ctx->rings->sq_flags with atomic_or/and Rather than require ctx->completion_lock for ensuring that we don't clobber the flags, use the atomic bitop helpers instead. This removes the need to grab the completion_lock, in preparation for needing to set or clear sq_flags when we don't know the status of this lock. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20220426014904.60384-3-axboe@kernel.dk Signed-off-by: Jens Axboe commit e788be95a57a9bebe446878ce9bf2750f6fe4974 Author: Jens Axboe Date: Thu Apr 28 17:25:16 2022 -0600 task_work: allow TWA_SIGNAL without a rescheduling IPI Some use cases don't always need an IPI when sending a TWA_SIGNAL notification. Add TWA_SIGNAL_NO_IPI, which is just like TWA_SIGNAL, except it doesn't send an IPI to the target task. It merely sets TIF_NOTIFY_SIGNAL and wakes up the task. This can be useful in avoiding a forceful transition to the kernel if the task is running in userspace. Depending on the task_work in question, it may be quite fine waiting for the next reschedule or kernel enter anyway, or the use case may even have other mechanisms for hinting to the task that a transition may be useful. This can drive more cooperative scheduling of task_work. Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/821f42b6-7d91-8074-8212-d34998097de4@kernel.dk Signed-off-by: Jens Axboe commit 48cec73a891cca087fbc7791c4753784180991a9 Author: Horatiu Vultur Date: Fri Apr 29 09:19:53 2022 +0200 net: lan966x: Fix compilation error Starting from the blamed commit, the lan966x build fails with the following compilation error: drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c:342:9: error: implicit declaration of function ‘ptp_find_pin_unlocked’ [-Werror=implicit-function-declaration] 342 | pin = ptp_find_pin_unlocked(phc->clock, PTP_PF_EXTTS, 0); The issue is that there is no stub function for ptp_find_pin_unlocked in case CONFIG_PTP_1588_CLOCK is not selected. Therefore add one. Reported-by: kernel test robot Fixes: f3d8e0a9c28ba0 ("net: lan966x: Add support for PTP_PF_EXTTS") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2e47eece158a7e5d2205be42e9c44b87302de1a7 Author: Yu Zhe Date: Thu Apr 28 19:14:04 2022 -0700 ipv4: remove unnecessary type castings remove unnecessary void* type castings. Signed-off-by: Yu Zhe Signed-off-by: David S. Miller commit 160f126b89e10bd58491e10067a44c7e3f85fa2c Author: Michael Riesch Date: Mon Apr 25 15:35:02 2022 +0200 arm64: dts: rockchip: enable usb hub on the radxa rock3 model a One USB 2.0 host port on the Radxa ROCK3 Model A is connected to the SoC via a hub. Introduce a voltage regulator to enable this USB hub. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220425133502.405512-3-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 254a1f6a29e7a273adb1a1d032305ec58ef83a69 Author: Michael Riesch Date: Mon Apr 25 15:35:01 2022 +0200 arm64: dts: rockchip: add usb3 support to the radxa rock3 model a The Radxa ROCK3 Model A features one USB 3.0 host port and one USB 3.0 OTG/DRD port. Enable them in the device tree. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220425133502.405512-2-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 13e0ee34f39c01948a7bbaab0b3c225d9b00a5bb Author: Peter Geis Date: Fri Apr 29 07:52:49 2022 -0400 arm64: dts: rockchip: add rk356x sfc support Add the sfc node to the rk356x device tree. This enables spi flash support for this soc. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220429115252.2360496-5-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 87a267b4af09477721e9d2bad63555f0dc49d08a Author: Samuel Holland Date: Tue Apr 12 22:56:14 2022 -0500 arm64: dts: rockchip: Add USB and TCPC to rk3566-pinenote PineNote has a USB Type-C port connected to the first USB 2.0 OTG PHY and XHCI controller via a Willsemi WUSB3801 Type-C port controller. Add support for it. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220413035614.31045-3-samuel@sholland.org Signed-off-by: Heiko Stuebner commit 8d411bebd4538a9750db175c030d6083d5210d7c Author: Samuel Holland Date: Tue Apr 12 22:56:13 2022 -0500 arm64: dts: rockchip: Add accelerometer to rk3566-pinenote PineNote has an SC7A20 accelerometer connected via I2C. Enable it. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220413035614.31045-2-samuel@sholland.org Signed-off-by: Heiko Stuebner commit ec48c3e82ca36a66ae37ba8b1fdb9a7561dcab14 Author: Caleb Connolly Date: Mon Mar 28 01:50:05 2022 +0100 arm64: dts: rockchip: add an input enable pinconf to rk3399 Add a pinconf to configure pins as input-enable. Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20220328005005.72492-5-kc@postmarketos.org Signed-off-by: Heiko Stuebner commit add9f6f30e54b5c07e7a0260cda459ef1d9646b7 Author: Brian Norris Date: Mon Apr 25 18:45:44 2022 -0700 soc: rockchip: Fix compile-testing SoC drivers Similar to commit 7f94b69ece51 ("ARM: ixp4xx: fix compile-testing soc drivers"). drivers/soc/rockchip/Kconfig makes plenty of provision for configuring drivers either for ARCH_ROCKCHIP or for COMPILE_TEST. But drivers/soc/Makefile pulls the rug out from under us, by refusing to build anything if we specified COMPILE_TEST but not ARCH_ROCKCHIP. Currently, I'm not aware of anything that breaks without this patch, but it certainly makes for confusing builds (CONFIG_ROCKCHIP_PM_DOMAINS=y, but we didn't actually compile the driver?) and leaves room for future error (I have pending patches that break confusingly with COMPILE_TEST=y even though their Kconfig dependencies seem correct [1]). Defer to drivers/soc/rockchip/{Makefile,Kconfig} to do the right thing. [1] e.g., https://lore.kernel.org/linux-rockchip/20220405184816.RFC.2.I2d73b403944f0b8b5871a77585b73f31ccc62999@changeid/ [RFC PATCH 2/2] PM / devfreq: rk3399_dmc: Block PMU during transitions Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220425184503.v3.3.Id5f16dec920f620120c0a143a97a12e16d401760@changeid Signed-off-by: Heiko Stuebner commit 2ca9e472c70f15de768ab200571e2f6634f66394 Author: Brian Norris Date: Mon Apr 25 18:45:43 2022 -0700 soc: rockchip: power-domain: Replace dsb() with smb() It's unclear if these are really needed at all, but seemingly their purpose is only as a write barrier. Use the general macro instead of the ARM-specific one. This driver is partially marked for COMPILE_TEST'ing, but it doesn't build under non-ARM architectures. Fix this up before *really* enabling it for COMPILE_TEST. Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220426014545.628100-2-briannorris@chromium.org Signed-off-by: Heiko Stuebner commit 9be1a9996ebd8da27cafc947e4578b2d419dc07e Author: Brian Norris Date: Mon Apr 25 18:45:42 2022 -0700 soc: rockchip: Clean up Kconfig whitespace There are spaces instead of tabs, and other inconsistent indentation. Signed-off-by: Brian Norris Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220426014545.628100-1-briannorris@chromium.org Signed-off-by: Heiko Stuebner commit 17408c9b119de4edef9ea57ade7e97d4a1b8b632 Author: Christopher Obbard Date: Mon Apr 25 19:45:10 2022 +0100 arm64: dts: rockchip: Add vdec support for RK3328 The RK3328 has an vdec device with dedicated iommu. Describe the vdec device, the required power-domains and enable the iommu in the devicetree. Signed-off-by: Christopher Obbard Link: https://lore.kernel.org/r/20220425184510.1138446-4-chris.obbard@collabora.com Signed-off-by: Heiko Stuebner commit a2fe0f97fd4a5e482123fc207a48bde844b161a1 Author: Christopher Obbard Date: Mon Apr 25 19:45:09 2022 +0100 arm64: dts: rockchip: Rename vdec_mmu node for RK3328 All other rockchip devices which have vdec nodes do not have an rk prefix. Remove the prefix from the (currently unused) rkvdec_mmu node for consistency with other devices. Signed-off-by: Christopher Obbard Reviewed-by: Ezequiel Garcia Link: https://lore.kernel.org/r/20220425184510.1138446-3-chris.obbard@collabora.com Signed-off-by: Heiko Stuebner commit 36ffca1afea9b429d3e49aa0b6a68ecd93f3be11 Author: Jakub Kicinski Date: Fri Apr 29 10:43:30 2022 -0700 eth: remove remaining copies of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. This patch covers three more drivers which I missed in commit 5f012b40ef63 ("eth: remove copies of the NAPI_POLL_WEIGHT define"). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5a8ad1ce2c605ffaae4523d75ca91180f05f1e8b Author: Pengcheng Yang Date: Fri Apr 29 18:32:56 2022 +0800 tcp: use tcp_skb_sent_after() instead in RACK This patch doesn't change any functionality. Signed-off-by: Pengcheng Yang Cc: Neal Cardwell Acked-by: Neal Cardwell Tested-by: Neal Cardwell Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit ce7deda0d5cdbd84e31aa17d95a5896966f2ed83 Author: Minghao Chi Date: Fri Apr 29 09:01:04 2022 +0000 net/funeth: simplify the return expression of fun_dl_info_get() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit 059d9f413efe3ed954e2df37511a4c0e514662f7 Author: Prabhakar Kushwaha Date: Sat Apr 30 04:05:13 2022 +0300 qede: Reduce verbosity of ptp tx timestamp Reduce verbosity of ptp tx timestamp error to reduce excessive log messages. Signed-off-by: Manish Chopra Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: Prabhakar Kushwaha Signed-off-by: David S. Miller commit 2f187bfa6f35cc8bf1626bfc09449a09a6063ea1 Author: Colin Foster Date: Fri Apr 29 14:30:36 2022 -0700 net: ethernet: ocelot: remove the need for num_stats initializer There is a desire to share the oclot_stats_layout struct outside of the current vsc7514 driver. In order to do so, the length of the array needs to be known at compile time, and defined in the struct ocelot and struct felix_info. Since the array is defined in a .c file and would be declared in the header file via: extern struct ocelot_stat_layout[]; the size of the array will not be known at compile time to outside modules. To fix this, remove the need for defining the number of stats at compile time and allow this number to be determined at initialization. Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit 783d108dd71d97e4cac5fe8ce70ca43ed7dc7bb7 Author: Eric Dumazet Date: Fri Apr 29 18:15:23 2022 -0700 tcp: drop skb dst in tcp_rcv_established() In commit f84af32cbca7 ("net: ip_queue_rcv_skb() helper") I dropped the skb dst in tcp_data_queue(). This only dealt with so-called TCP input slow path. When fast path is taken, tcp_rcv_established() calls tcp_queue_rcv() while skb still has a dst. This was mostly fine, because most dsts at this point are not refcounted (thanks to early demux) However, TCP packets sent over loopback have refcounted dst. Then commit 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") came and had the effect of delaying skb freeing for an arbitrary time. If during this time the involved netns is dismantled, cleanup_net() frees the struct net with embedded net->ipv6.ip6_dst_ops. Then when eventually dst_destroy_rcu() is called, if (dst->ops->destroy) ... triggers an use-after-free. It is not clear if ip6_route_net_exit() lacks a rcu_barrier() as syzbot reported similar issues before the blamed commit. ( https://groups.google.com/g/syzkaller-bugs/c/CofzW4eeA9A/m/009WjumTAAAJ ) Fixes: 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") Signed-off-by: Eric Dumazet Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 90e29e592ec95c5c2af6fe73896dba40303728cf Merge: 8fd813441e78f 5b06ef86826a4 Author: David S. Miller Date: Sat Apr 30 13:09:26 2022 +0100 Merge branch 'lan966x-phy-reset-remove' Michael Walle says: ==================== net: lan966x: remove PHY reset support Remove the unneeded PHY reset node as well as the driver support for it. This was already discussed [1] and I expect Microchip to Ack on this removal. Since there is no user, no breakage is expected. I'm not sure it this should go through net or net-next and if the patches should have a Fixes: tag or not. In upstream linux there was never any user of it, so there is no bug to be fixed. But OTOH if the schema fix isn't backported, then there might be an older schema version still containing the reset node. Thoughts? The patches needed for the GPIO part are just waiting to be picked up by Linus [2,3]. This patch and the GPIO parts are the last pieces of the puzzle to get ethernet working on the LAN9668 on upstream linux. [1] https://lore.kernel.org/netdev/20220330110210.3374165-1-michael@walle.cc/ [2] https://lore.kernel.org/linux-gpio/CACRpkdbxmN+SWt95aGHjA2ZGnN61aWaA7c5S4PaG+WePAj=htg@mail.gmail.com/ [3] https://lore.kernel.org/linux-gpio/20220420191926.3411830-1-michael@walle.cc/ ==================== Signed-off-by: David S. Miller commit 5b06ef86826a4636c4475b024c0fdc3c9b088843 Author: Michael Walle Date: Thu Apr 28 13:40:49 2022 +0200 net: lan966x: remove PHY reset support The PHY subsystem as well as the MIIM mdio driver (in case of the integrated PHYs) will take care of the resets. A separate reset driver isn't needed. There is no in-tree user of this feature. Remove the support. Signed-off-by: Michael Walle Signed-off-by: David S. Miller commit 4fdabd509df3fb5e731031197034cb02f053731a Author: Michael Walle Date: Thu Apr 28 13:40:48 2022 +0200 dt-bindings: net: lan966x: remove PHY reset The PHY reset was intended to be a phandle for a special PHY reset driver for the integrated PHYs as well as any external PHYs. It turns out, that the culprit is how the reset of the switch device is done. In particular, the switch reset also affects other subsystems like the GPIO and the SGPIO block and it happens to be the case that the reset lines of the external PHYs are connected to a common GPIO line. Thus as soon as the switch issues a reset during probe time, all the external PHYs will go into reset because all the GPIO lines will switch to input and the pull-down on that signal will take effect. So even if there was a special PHY reset driver, it (1) won't fix the root cause of the problem and (2) it won't fix all the other consumers of GPIO lines which will also be reset. It turns out, the Ocelot SoC has the same weird behavior (or the lack of a dedicated switch reset) and there the problem is already solved and all the bits and pieces are already there and this PHY reset property isn't not needed at all. There are no users of this binding. Just remove it. Signed-off-by: Michael Walle Signed-off-by: David S. Miller commit 8fd813441e78f1fc7918f55dba6553943eaf1085 Merge: 0813aeee0d02d 58f71be58b871 Author: David S. Miller Date: Sat Apr 30 12:58:45 2022 +0100 Merge branch 'ipv6-net-opts' Pavel Begunkov says: ==================== generic net and ipv6 minor optimisations 1-3 inline simple functions that only reshuffle arguments possibly adding extra zero args, and call another function. It was benchmarked before with a bunch of extra patches, see for details https://lore.kernel.org/netdev/cover.1648981570.git.asml.silence@gmail.com/ It may increase the binary size, but it's the right thing to do and at least without modules it actually sheds some bytes for some standard-ish config. text data bss dec hex filename 9627200 0 0 9627200 92e640 ./arch/x86_64/boot/bzImage text data bss dec hex filename 9627104 0 0 9627104 92e5e0 ./arch/x86_64/boot/bzImage ==================== Signed-off-by: David S. Miller commit 58f71be58b8713e41f8568938a0199190f723d1d Author: Pavel Begunkov Date: Thu Apr 28 11:58:48 2022 +0100 ipv6: refactor ip6_finish_output2() Throw neigh checks in ip6_finish_output2() under a single slow path if, so we don't have the overhead in the hot path. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit 4b143ed7dde59d8a4f94c39aa7c4e92842c3ecc1 Author: Pavel Begunkov Date: Thu Apr 28 11:58:47 2022 +0100 ipv6: help __ip6_finish_output() inlining There are two callers of __ip6_finish_output(), both are in ip6_finish_output(). We can combine the call sites into one and handle return code after, that will inline __ip6_finish_output(). Note, error handling under NET_XMIT_CN will only return 0 if __ip6_finish_output() succeded, and in this case it return 0. Considering that NET_XMIT_SUCCESS is 0, it'll be returning exactly the same result for it as before. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit c526fd8f9f4f21cb83c0b1c9a1ee9c0ac9be9e2e Author: Pavel Begunkov Date: Thu Apr 28 11:58:46 2022 +0100 net: inline dev_queue_xmit() Inline dev_queue_xmit() and dev_queue_xmit_accel(), they both are small proxy functions doing nothing but redirecting the control flow to __dev_queue_xmit(). Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit 657dd5f97b2ed16cdaa6339f42f9130240af1c04 Author: Pavel Begunkov Date: Thu Apr 28 11:58:45 2022 +0100 net: inline skb_zerocopy_iter_dgram skb_zerocopy_iter_dgram() is a small proxy function, inline it. For that, move __zerocopy_sg_from_iter into linux/skbuff.h Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit de32bc6aad09131a30b4a9a738e2bf2ba5a9a5aa Author: Pavel Begunkov Date: Thu Apr 28 11:58:44 2022 +0100 net: inline sock_alloc_send_skb sock_alloc_send_skb() is simple and just proxying to another function, so we can inline it and cut associated overhead. Signed-off-by: Pavel Begunkov Signed-off-by: David S. Miller commit f548a12efd5ab97e6b1fb332e5634ce44b3d9328 Author: Jens Axboe Date: Tue Apr 26 17:39:50 2022 -0600 io_uring: return hint on whether more data is available after receive For now just use a CQE flag for this, with big CQE support we could return the actual number of bytes left. Signed-off-by: Jens Axboe commit a4c76853609107f0e5e7b51571d966785fe89cb3 Merge: 27738039fcdc6 f94fd25cb0aaf Author: Jens Axboe Date: Fri Apr 29 21:11:15 2022 -0600 Merge branch 'tcp-pass-back-data-left-in-socket-after-receive' of git://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux into for-5.19/io_uring-net Merge net branch with the required patch for supporting the io_uring feature that passes back whether we had more data in the socket or not. * 'tcp-pass-back-data-left-in-socket-after-receive' of git://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux: tcp: pass back data left in socket after receive commit 27738039fcdc6cb63400fe9b820b4027753568b7 Merge: 8013d1d3d2e33 033b87d24f725 Author: Jens Axboe Date: Fri Apr 29 21:10:52 2022 -0600 Merge branch 'for-5.19/io_uring-socket' into for-5.19/io_uring-net * for-5.19/io_uring-socket: (73 commits) io_uring: use the text representation of ops in trace io_uring: rename op -> opcode io_uring: add io_uring_get_opcode io_uring: add type to op enum io_uring: add socket(2) support net: add __sys_socket_file() io_uring: fix trace for reduced sqe padding io_uring: add fgetxattr and getxattr support io_uring: add fsetxattr and setxattr support fs: split off do_getxattr from getxattr fs: split off setxattr_copy and do_setxattr function from setxattr io_uring: return an error when cqe is dropped io_uring: use constants for cq_overflow bitfield io_uring: rework io_uring_enter to simplify return value io_uring: trace cqe overflows io_uring: add trace support for CQE overflow io_uring: allow re-poll if we made progress io_uring: support MSG_WAITALL for IORING_OP_SEND(MSG) io_uring: add support for IORING_ASYNC_CANCEL_ANY io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key ... commit 0813aeee0d02d80912c86b2b3a1ebdb4ee4476ba Merge: 7195464cf8f21 f94fd25cb0aaf Author: Jakub Kicinski Date: Fri Apr 29 19:12:05 2022 -0700 Merge branch 'tcp-pass-back-data-left-in-socket-after-receive' of git://git.kernel.org/pub/scm/linux/kernel/git/kuba/linux Signed-off-by: Jakub Kicinski commit f94fd25cb0aaf77fd7453f31c5d394a1a68ecf60 Author: Jens Axboe Date: Thu Apr 28 18:45:06 2022 -0600 tcp: pass back data left in socket after receive This is currently done for CMSG_INQ, add an ability to do so via struct msghdr as well and have CMSG_INQ use that too. If the caller sets msghdr->msg_get_inq, then we'll pass back the hint in msghdr->msg_inq. Rearrange struct msghdr a bit so we can add this member while shrinking it at the same time. On a 64-bit build, it was 96 bytes before this change and 88 bytes afterwards. Reviewed-by: Eric Dumazet Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/650c22ca-cffc-0255-9a05-2413a1e20826@kernel.dk Signed-off-by: Jakub Kicinski commit 7195464cf8f219c4d5e493f07efdd532926c2434 Author: Yinjun Zhang Date: Fri Apr 29 09:51:24 2022 +0200 nfp: flower: utilize the tuple iifidx in offloading ct flows The device info from which conntrack originates is stored in metadata field of the ct flow to offload now, driver can utilize it to reduce the number of offloaded flows. v2: Drop inline keyword from get_netdev_from_rule() signature. The compiler can decide. Signed-off-by: Yinjun Zhang Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220429075124.128589-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 78a9b3c47befde80a4896a8c5172990b60c58af4 Author: Pieter Jansen van Vuuren Date: Thu Apr 28 12:39:33 2022 +0100 sfc: add EF100 VF support via a write to sriov_numvfs This patch extends the EF100 PF driver by adding .sriov_configure() which would allow users to enable and disable virtual functions using the sriov sysfs. Signed-off-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Link: https://lore.kernel.org/r/75e74d9e-14ce-0524-9668-5ab735a7cf62@gmail.com Signed-off-by: Jakub Kicinski commit 4994d4fa99ba4552194eb7c257dc3001892d3e70 Merge: a41c653dc503a 5ac1d2d634519 Author: Jakub Kicinski Date: Fri Apr 29 17:25:25 2022 -0700 Merge branch 'mptcp-path-manager-mode-selection' Mat Martineau says: ==================== mptcp: Path manager mode selection MPTCP already has an in-kernel path manager (PM) to add and remove TCP subflows associated with a given MPTCP connection. This in-kernel PM has been designed to handle typical server-side use cases, but is not very flexible or configurable for client devices that may have more complicated policies to implement. This patch series from the MPTCP tree is the first step toward adding a generic-netlink-based API for MPTCP path management, which a privileged userspace daemon will be able to use to control subflow establishment. These patches add a per-namespace sysctl to select the default PM type (in-kernel or userspace) for new MPTCP sockets. New self-tests confirm expected behavior when userspace PM is selected but there is no daemon available to handle existing MPTCP PM events. Subsequent patch series (already staged in the MPTCP tree) will add the generic netlink path management API. ==================== Link: https://lore.kernel.org/r/20220427225002.231996-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 5ac1d2d6345190907e260daedd980ab3be512cf0 Author: Mat Martineau Date: Wed Apr 27 15:50:02 2022 -0700 selftests: mptcp: Add tests for userspace PM type These tests ensure that the in-kernel path manager is bypassed when the userspace path manager is configured. Kernel code is still responsible for ADD_ADDR echo, so also make sure that's working. Tested-by: Geliang Tang Acked-by: Paolo Abeni Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 6bb63ccc25d4a8cb8fe48efeda680cb13f84d1b0 Author: Mat Martineau Date: Wed Apr 27 15:50:01 2022 -0700 mptcp: Add a per-namespace sysctl to set the default path manager type The new net.mptcp.pm_type sysctl determines which path manager will be used by each newly-created MPTCP socket. v2: Handle builds without CONFIG_SYSCTL v3: Clarify logic for type-specific PM init (Geliang Tang and Paolo Abeni) Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 6961326e38fe571ac1d2180041ce3142c8fd24d5 Author: Mat Martineau Date: Wed Apr 27 15:50:00 2022 -0700 mptcp: Make kernel path manager check for userspace-managed sockets Userspace-managed sockets should not have their subflows or advertisements changed by the kernel path manager. v3: Use helper function for PM mode (Paolo Abeni) Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 14b06811bec686af3dbba58141c23b06f3e385bd Author: Mat Martineau Date: Wed Apr 27 15:49:59 2022 -0700 mptcp: Bypass kernel PM when userspace PM is enabled When a MPTCP connection is managed by a userspace PM, bypass the kernel PM for incoming advertisements and subflow events. Netlink events are still sent to userspace. v2: Remove unneeded check in mptcp_pm_rm_addr_received() (Kishen Maloor) v3: Add and use helper function for PM mode (Paolo Abeni) Acked-by: Paolo Abeni Co-developed-by: Kishen Maloor Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit d85a8fde71e245981180698a5a662598682b7524 Author: Mat Martineau Date: Wed Apr 27 15:49:58 2022 -0700 mptcp: Add a member to mptcp_pm_data to track kernel vs userspace mode When adding support for netlink path management commands, the kernel needs to know whether paths are being controlled by the in-kernel path manager or a userspace PM. Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 9273b9d5799598d35f7a2a2df61b8e29102aeac8 Author: Mat Martineau Date: Wed Apr 27 15:49:57 2022 -0700 mptcp: Remove redundant assignments in path manager init A few members of the mptcp_pm_data struct were assigned to hard-coded values in mptcp_pm_data_reset(), and then immediately changed in mptcp_pm_nl_data_init(). Instead, flatten all the assignments in to mptcp_pm_data_reset(). v2: Resolve conflicts due to rename of mptcp_pm_data_reset() v4: Resolve conflict in mptcp_pm_data_reset() Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit a41c653dc503a25dbfbf8d9b3db6a62dd0becc99 Merge: 17d49e6e8012a 738871b09250e Author: Jakub Kicinski Date: Fri Apr 29 16:37:56 2022 -0700 Merge branch 'net-phy-micrel-add-coma-mode-support' Michael Walle says: ==================== net: phy: micrel: add coma mode support Add support to disable coma mode by a GPIO line. ==================== Link: https://lore.kernel.org/r/20220427214406.1348872-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 738871b09250ee9043c0e05101fcc254059f1492 Author: Michael Walle Date: Wed Apr 27 23:44:06 2022 +0200 net: phy: micrel: add coma mode GPIO The LAN8814 has a coma mode pin which puts the PHY into isolate and power-dowm mode. Unfortunately, the mode cannot be disabled by a register. Usually, the input pin has a pull-up and connected to a GPIO which can then be used to disable the mode. Try to get the GPIO and deassert it. Signed-off-by: Michael Walle Signed-off-by: Jakub Kicinski commit 31d00ca4ce0e1abf5342854606bbe7d20e38c3f8 Author: Michael Walle Date: Wed Apr 27 23:44:05 2022 +0200 net: phy: micrel: move the PHY timestamping check Both lan8814_ptp_init() and lan8814_ptp_probe_once() are only used if PTP and PHY timestamping is enabed. Up until now the probe function just returns early, if they are not needed. But we need the phy_package_init_once() functionality for the coma mode GPIO setup. Move the check into the functions itself. Signed-off-by: Michael Walle Signed-off-by: Jakub Kicinski commit 749c61e5b30a18037fcae27694cd949c4d652205 Author: Michael Walle Date: Wed Apr 27 23:44:04 2022 +0200 dt-bindings: net: micrel: add coma-mode-gpios property The LAN8814 has a coma mode pin which is used to put the PHY into isolate and power-down mode. Usually strapped to be asserted by default. A GPIO is then used to take the PHY out of this mode. Signed-off-by: Michael Walle Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit f6e2c20ca7604e6a267c93a511d19dda72573be1 Author: Liu Shixin Date: Fri Apr 29 14:38:04 2022 -0700 fs: sysv: check sbi->s_firstdatazone in complete_read_super sbi->s_firstinodezone is initialized to 2 and sbi->s_firstdatazone is read from sbd. There's no guarantee that sbi->s_firstdatazone must bigger than sbi->s_firstinodezone. If sbi->s_firstdatazone less than 2, the filesystem can still be mounted unexpetly. At this point, sbi->s_ninodes flip to very large value and this filesystem is broken. We can observe this by executing 'df' command. When we execute, we will get an error message: "sysv_count_free_inodes: unable to read inode table" Link: https://lkml.kernel.org/r/20220330104215.530223-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit edc73c7261ca3ea79867437bb0b9dab0e232436c Author: xu xin Date: Fri Apr 29 14:38:03 2022 -0700 kernel: make taskstats available from all net namespaces If getdelays runs in a non-init network namespace, it will fail in getting delayacct stats even if it has privilege of root user, which seems to be not very reasonable. We can simply reproduce this by executing commands: unshare -n getdelays -d -p I don't think net namespace should be an obstacle to the normal execution of getdelay function. So let's make it available from all net namespaces. Link: https://lkml.kernel.org/r/20220412071946.2532318-1-xu.xin16@zte.com.cn Signed-off-by: xu xin Cc: Balbir Singh Cc: Yang Yang Cc: "Dr. Thomas Orgis" Cc: Eric W. Biederman Cc: Ismael Luceno Signed-off-by: Andrew Morton commit 0e0af57e0e91b304f36b7d1dba859e3c04094273 Author: Dr. Thomas Orgis Date: Fri Apr 29 14:38:03 2022 -0700 taskstats: version 12 with thread group and exe info The task exit struct needs some crucial information to be able to provide an enhanced version of process and thread accounting. This change provides: 1. ac_tgid in additon to ac_pid 2. thread group execution walltime in ac_tgetime 3. flag AGROUP in ac_flag to indicate the last task in a thread group / process 4. device ID and inode of task's /proc/self/exe in ac_exe_dev and ac_exe_inode 5. tools/accounting/procacct as demonstrator When a task exits, taskstats are reported to userspace including the task's pid and ppid, but without the id of the thread group this task is part of. Without the tgid, the stats of single tasks cannot be correlated to each other as a thread group (process). The taskstats documentation suggests that on process exit a data set consisting of accumulated stats for the whole group is produced. But such an additional set of stats is only produced for actually multithreaded processes, not groups that had only one thread, and also those stats only contain data about delay accounting and not the more basic information about CPU and memory resource usage. Adding the AGROUP flag to be set when the last task of a group exited enables determination of process end also for single-threaded processes. My applicaton basically does enhanced process accounting with summed cputime, biggest maxrss, tasks per process. The data is not available with the traditional BSD process accounting (which is not designed to be extensible) and the taskstats interface allows more efficient on-the-fly grouping and summing of the stats, anyway, without intermediate disk writes. Furthermore, I do carry statistics on which exact program binary is used how often with associated resources, getting a picture on how important which parts of a collection of installed scientific software in different versions are, and how well they put load on the machine. This is enabled by providing information on /proc/self/exe for each task. I assume the two 64-bit fields for device ID and inode are more appropriate than the possibly large resolved path to keep the data volume down. Add the tgid to the stats to complete task identification, the flag AGROUP to mark the last task of a group, the group wallclock time, and inode-based identification of the associated executable file. Add tools/accounting/procacct.c as a simplified fork of getdelays.c to demonstrate process and thread accounting. [thomas.orgis@uni-hamburg.de: fix version number in comment] Link: https://lkml.kernel.org/r/20220405003601.7a5f6008@plasteblaster Link: https://lkml.kernel.org/r/20220331004106.64e5616b@plasteblaster Signed-off-by: Dr. Thomas Orgis Reviewed-by: Ismael Luceno Cc: Balbir Singh Cc: Eric W. Biederman Cc: xu xin Cc: Yang Yang Signed-off-by: Andrew Morton commit f8323a0cb9a66d8d8747c463211392a2cfc4c1dc Author: Jakob Koschel Date: Fri Apr 29 14:38:03 2022 -0700 rapidio: remove unnecessary use of list iterator req->map is set in the valid case and always equals 'map' if the break was hit. It therefore is unnecessary to use the list iterator variable and the use of 'map' can be replaced with req->map. This is done in preparation to limit the scope of a list iterator to the list traversal loop [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Link: https://lkml.kernel.org/r/20220319203344.2547702-1-jakobkoschel@gmail.com Signed-off-by: Jakob Koschel Reviewed-by: John Hubbard Cc: Matt Porter Cc: Alexandre Bounine Cc: Kees Cook Cc: Mike Rapoport Cc: "Brian Johannesmeyer" Cc: Cristiano Giuffrida Cc: "Bos, H.J." Signed-off-by: Andrew Morton commit 16b0b7adabfb5564a77fa35917afe08decd55b29 Author: Michal Orzel Date: Fri Apr 29 14:38:03 2022 -0700 kexec: remove redundant assignments Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Link: https://lkml.kernel.org/r/20220326180948.192154-1-michalorzel.eng@gmail.com Signed-off-by: Michal Orzel Acked-by: Baoquan He Cc: Eric Biederman Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Michal Orzel Signed-off-by: Andrew Morton commit f224cabeedb274db8e64824a50765e2eabacca90 Author: Tiezhu Yang Date: Fri Apr 29 14:38:03 2022 -0700 MAINTAINERS: remove redundant file of PTRACE SUPPORT entry In MAINTAINERS PTRACE SUPPORT entry, the file include/uapi/linux/ptrace.h is redundant, remove it. Link: https://lkml.kernel.org/r/1649240981-11024-4-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Cc: Oleg Nesterov Signed-off-by: Andrew Morton commit a9866bef5171c859cfabc1155c594d28f194aa23 Author: Tiezhu Yang Date: Fri Apr 29 14:38:02 2022 -0700 ptrace: fix wrong comment of PT_DTRACE PT_DTRACE is only used on um now, fix the wrong comment. Link: https://lkml.kernel.org/r/1649240981-11024-3-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Cc: Oleg Nesterov Signed-off-by: Andrew Morton commit f26b2afd53e70db67be8252d340b4a1387ec8b55 Author: Tiezhu Yang Date: Fri Apr 29 14:38:02 2022 -0700 ptrace: remove redudant check of #ifdef PTRACE_SINGLESTEP Patch series "ptrace: do some cleanup". This patch (of 3): PTRACE_SINGLESTEP is always defined as 9 in include/uapi/linux/ptrace.h, remove redudant check of #ifdef PTRACE_SINGLESTEP. Link: https://lkml.kernel.org/r/1649240981-11024-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Cc: Oleg Nesterov Signed-off-by: Andrew Morton commit 183c3237c928109d2008c0456dff508baf692b20 Author: OGAWA Hirofumi Date: Fri Apr 29 14:38:02 2022 -0700 fat: add ratelimit to fat*_ent_bread() fat*_ent_bread() can be the cause of too many report on I/O error path. So use fat_msg_ratelimit() instead. Link: https://lkml.kernel.org/r/87bkxogfeq.fsf@mail.parknet.co.jp Signed-off-by: OGAWA Hirofumi Reported-by: qianfan Tested-by: qianfan Signed-off-by: Andrew Morton commit e057aaec34ae7534ac8f5cc4f880aa7de8402852 Author: Jonathan Lassoff Date: Fri Apr 29 14:38:02 2022 -0700 fatfs: add FAT messages to printk index In order for end users to quickly react to new issues that come up in production, it is proving useful to leverage the printk indexing system. This printk index enables kernel developers to use calls to printk() with changeable ad-hoc format strings (as they always have; no change of expectations), while enabling end users to examine format strings to detect changes. Since end users are using regular expressions to match messages printed through printk(), being able to detect changes in chosen format strings from release to release provides a useful signal to review printk()-matching regular expressions for any necessary updates. So that detailed FAT messages are captured by this printk index, this patch wraps fat_msg with a macro. [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/8aaa2dd7995e820292bb40d2120ab69756662c65.1648688136.git.jof@thejof.com Signed-off-by: Jonathan Lassoff Acked-by: OGAWA Hirofumi Reviewed-by: Petr Mladek Tested-by: Petr Mladek Signed-off-by: Andrew Morton commit 3fbb6b784acb4f308e2bc93dbc57761e8b6d9e80 Author: Yubo Feng Date: Fri Apr 29 14:38:02 2022 -0700 fatfs: remove redundant judgment iput() has already judged the incoming parameter, so there is no need to repeat outside. Link: https://lkml.kernel.org/r/1648265418-76563-1-git-send-email-fengyubo3@huawei.com Signed-off-by: Yubo Feng Reported-by: Hulk Robot Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton commit 7374fa33dc2dd76b71999f8fd236e73b21161030 Author: Kees Cook Date: Fri Apr 29 14:38:01 2022 -0700 init/Kconfig: remove USELIB syscall by default The uselib syscall has been long deprecated. There's no need to keep this enabled by default under X86_32. Link: https://lkml.kernel.org/r/20220412212519.4113845-1-keescook@chromium.org Signed-off-by: Kees Cook Reviewed-by: Nathan Chancellor Cc: Masahiro Yamada Signed-off-by: Andrew Morton commit d679ae94fdd5d3ab00c35078f5af5f37e068b03d Author: Kuniyuki Iwashima Date: Fri Apr 29 14:38:01 2022 -0700 list: fix a data-race around ep->rdllist ep_poll() first calls ep_events_available() with no lock held and checks if ep->rdllist is empty by list_empty_careful(), which reads rdllist->prev. Thus all accesses to it need some protection to avoid store/load-tearing. Note INIT_LIST_HEAD_RCU() already has the annotation for both prev and next. Commit bf3b9f6372c4 ("epoll: Add busy poll support to epoll with socket fds.") added the first lockless ep_events_available(), and commit c5a282e9635e ("fs/epoll: reduce the scope of wq lock in epoll_wait()") made some ep_events_available() calls lockless and added single call under a lock, finally commit e59d3c64cba6 ("epoll: eliminate unnecessary lock for zero timeout") made the last ep_events_available() lockless. BUG: KCSAN: data-race in do_epoll_wait / do_epoll_wait write to 0xffff88810480c7d8 of 8 bytes by task 1802 on cpu 0: INIT_LIST_HEAD include/linux/list.h:38 [inline] list_splice_init include/linux/list.h:492 [inline] ep_start_scan fs/eventpoll.c:622 [inline] ep_send_events fs/eventpoll.c:1656 [inline] ep_poll fs/eventpoll.c:1806 [inline] do_epoll_wait+0x4eb/0xf40 fs/eventpoll.c:2234 do_epoll_pwait fs/eventpoll.c:2268 [inline] __do_sys_epoll_pwait fs/eventpoll.c:2281 [inline] __se_sys_epoll_pwait+0x12b/0x240 fs/eventpoll.c:2275 __x64_sys_epoll_pwait+0x74/0x80 fs/eventpoll.c:2275 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff88810480c7d8 of 8 bytes by task 1799 on cpu 1: list_empty_careful include/linux/list.h:329 [inline] ep_events_available fs/eventpoll.c:381 [inline] ep_poll fs/eventpoll.c:1797 [inline] do_epoll_wait+0x279/0xf40 fs/eventpoll.c:2234 do_epoll_pwait fs/eventpoll.c:2268 [inline] __do_sys_epoll_pwait fs/eventpoll.c:2281 [inline] __se_sys_epoll_pwait+0x12b/0x240 fs/eventpoll.c:2275 __x64_sys_epoll_pwait+0x74/0x80 fs/eventpoll.c:2275 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0xffff88810480c7d0 -> 0xffff888103c15098 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 1799 Comm: syz-fuzzer Tainted: G W 5.17.0-rc7-syzkaller-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Link: https://lkml.kernel.org/r/20220322002653.33865-3-kuniyu@amazon.co.jp Fixes: e59d3c64cba6 ("epoll: eliminate unnecessary lock for zero timeout") Fixes: c5a282e9635e ("fs/epoll: reduce the scope of wq lock in epoll_wait()") Fixes: bf3b9f6372c4 ("epoll: Add busy poll support to epoll with socket fds.") Signed-off-by: Kuniyuki Iwashima Reported-by: syzbot+bdd6e38a1ed5ee58d8bd@syzkaller.appspotmail.com Cc: Al Viro , Andrew Morton Cc: Kuniyuki Iwashima Cc: Kuniyuki Iwashima Cc: "Soheil Hassas Yeganeh" Cc: Davidlohr Bueso Cc: "Sridhar Samudrala" Cc: Alexander Duyck Signed-off-by: Andrew Morton commit f485922d8fe4e44f6d52a5bb95a603b7c65554bb Author: Kuniyuki Iwashima Date: Fri Apr 29 14:38:01 2022 -0700 pipe: make poll_usage boolean and annotate its access Patch series "Fix data-races around epoll reported by KCSAN." This series suppresses a false positive KCSAN's message and fixes a real data-race. This patch (of 2): pipe_poll() runs locklessly and assigns 1 to poll_usage. Once poll_usage is set to 1, it never changes in other places. However, concurrent writes of a value trigger KCSAN, so let's make KCSAN happy. BUG: KCSAN: data-race in pipe_poll / pipe_poll write to 0xffff8880042f6678 of 4 bytes by task 174 on cpu 3: pipe_poll (fs/pipe.c:656) ep_item_poll.isra.0 (./include/linux/poll.h:88 fs/eventpoll.c:853) do_epoll_wait (fs/eventpoll.c:1692 fs/eventpoll.c:1806 fs/eventpoll.c:2234) __x64_sys_epoll_wait (fs/eventpoll.c:2246 fs/eventpoll.c:2241 fs/eventpoll.c:2241) 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:113) write to 0xffff8880042f6678 of 4 bytes by task 177 on cpu 1: pipe_poll (fs/pipe.c:656) ep_item_poll.isra.0 (./include/linux/poll.h:88 fs/eventpoll.c:853) do_epoll_wait (fs/eventpoll.c:1692 fs/eventpoll.c:1806 fs/eventpoll.c:2234) __x64_sys_epoll_wait (fs/eventpoll.c:2246 fs/eventpoll.c:2241 fs/eventpoll.c:2241) 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:113) Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 177 Comm: epoll_race Not tainted 5.17.0-58927-gf443e374ae13 #6 Hardware name: Red Hat KVM, BIOS 1.11.0-2.amzn2 04/01/2014 Link: https://lkml.kernel.org/r/20220322002653.33865-1-kuniyu@amazon.co.jp Link: https://lkml.kernel.org/r/20220322002653.33865-2-kuniyu@amazon.co.jp Fixes: 3b844826b6c6 ("pipe: avoid unnecessary EPOLLET wakeups under normal loads") Signed-off-by: Kuniyuki Iwashima Cc: Alexander Duyck Cc: Al Viro Cc: Davidlohr Bueso Cc: Kuniyuki Iwashima Cc: "Soheil Hassas Yeganeh" Cc: "Sridhar Samudrala" Signed-off-by: Andrew Morton commit d1bd5fa07667fcc3e38996ec42aef98761f23039 Author: Tom Rix Date: Fri Apr 29 14:38:01 2022 -0700 lib: remove back_str initialization Clang static analysis reports this false positive glob.c:48:32: warning: Assigned value is garbage or undefined char const *back_pat = NULL, *back_str = back_str; ^~~~~~~~ ~~~~~~~~ back_str is set after back_pat and it's use is protected by the !back_pat check. It is not necessary to initialize back_str, so remove the initialization. Link: https://lkml.kernel.org/r/20220402131546.3383578-1-trix@redhat.com Signed-off-by: Tom Rix Reviewed-by: Nick Desaulniers Cc: Nathan Chancellor Signed-off-by: Andrew Morton commit dffad91b06e0a1ee584f008565cbf2bb508a9777 Author: Rasmus Villemoes Date: Fri Apr 29 14:38:01 2022 -0700 lib/string.c: simplify str[c]spn Use strchr(), which makes them a lot shorter, and more obviously symmetric in their treatment of accept/reject. It also saves a little bit of .text; bloat-o-meter for an arm build says Function old new delta strcspn 92 76 -16 strspn 108 76 -32 While here, also remove a stray empty line before EXPORT_SYMBOL(). Link: https://lkml.kernel.org/r/20220328224119.3003834-2-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Cc: Andy Shevchenko Signed-off-by: Andrew Morton commit e0fa2ab3fcff42b8c2ed906f5619aae896e1e5e1 Author: Rasmus Villemoes Date: Fri Apr 29 14:38:00 2022 -0700 lib/test_string.c: add strspn and strcspn tests Before refactoring strspn() and strcspn(), add some simple test cases. Link: https://lkml.kernel.org/r/20220328224119.3003834-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Cc: Andy Shevchenko Signed-off-by: Andrew Morton commit 67fca000e1e173fe2c539a127ccf1bc338d5ff37 Author: Rasmus Villemoes Date: Fri Apr 29 14:38:00 2022 -0700 lib/Kconfig.debug: remove more CONFIG_..._VALUE indirections As in "kernel/panic.c: remove CONFIG_PANIC_ON_OOPS_VALUE indirection", use the IS_ENABLED() helper rather than having a hidden config option. Link: https://lkml.kernel.org/r/20220321121301.1389693-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Cc: Masahiro Yamada Cc: Kees Cook Signed-off-by: Andrew Morton commit d4557fae77079f4e53f06712395c7a28e3734eb7 Author: Xiaoke Wang Date: Fri Apr 29 14:38:00 2022 -0700 lib/test_meminit: optimize do_kmem_cache_rcu_persistent() test To make the test more robust, there are the following changes: 1. add a check for the return value of kmem_cache_alloc(). 2. properly release the object `buf` on several error paths. 3. release the objects of `used_objects` if we never hit `saved_ptr`. 4. destroy the created cache by default. Link: https://lkml.kernel.org/r/tencent_7CB95F1C3914BCE1CA4A61FF7C20E7CCB108@qq.com Signed-off-by: Xiaoke Wang Reviewed-by: Andrew Morton Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Marco Elver Cc: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Xiaoke Wang Signed-off-by: Andrew Morton commit 11fb48961e5250768767612da4a303fa2f5ea504 Author: Rob Herring Date: Fri Apr 29 14:38:00 2022 -0700 get_maintainer: Honor mailmap for in file emails Add support to also use the mailmap for 'in file' email addresses. Link: https://lkml.kernel.org/r/20220323193645.317514-1-robh@kernel.org Signed-off-by: Rob Herring Reported-by: Marc Zyngier Acked-by: Joe Perches Signed-off-by: Andrew Morton commit c06d7aaf2951ce7f986a879127995728d63d8577 Author: Haowen Bai Date: Fri Apr 29 14:38:00 2022 -0700 kernel: pid_namespace: use NULL instead of using plain integer as pointer This fixes the following sparse warnings: kernel/pid_namespace.c:55:77: warning: Using plain integer as NULL pointer Link: https://lkml.kernel.org/r/1647944288-2806-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Andrew Morton commit 6308499b5e99c0c903fde2c605e41d9a86c4be6c Author: Christoph Hellwig Date: Fri Apr 29 14:37:59 2022 -0700 net: unexport csum_and_copy_{from,to}_user csum_and_copy_from_user and csum_and_copy_to_user are exported by a few architectures, but not actually used in modular code. Drop the exports. Link: https://lkml.kernel.org/r/20220421070440.1282704-1-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Jakub Kicinski Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Cc: David Miller Signed-off-by: Andrew Morton commit e0690479917cbce740eef51fa3de92c69647a5ad Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 14:37:59 2022 -0700 vmcore: convert read_from_oldmem() to take an iov_iter Remove the read_from_oldmem() wrapper introduced earlier and convert all the remaining callers to pass an iov_iter. Link: https://lkml.kernel.org/r/20220408090636.560886-4-bhe@redhat.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Cc: Tiezhu Yang Cc: Amit Daniel Kachhap Cc: Al Viro Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 4a22fd20379ca897a6bfdb8372b4f9601e430332 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 14:37:59 2022 -0700 vmcore: convert __read_vmcore to use an iov_iter This gets rid of copy_to() and let us use proc_read_iter() instead of proc_read(). Link: https://lkml.kernel.org/r/20220408090636.560886-3-bhe@redhat.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 5d8de293c224896a4da99763fce4f9794308caf4 Author: Matthew Wilcox (Oracle) Date: Fri Apr 29 14:37:59 2022 -0700 vmcore: convert copy_oldmem_page() to take an iov_iter Patch series "Convert vmcore to use an iov_iter", v5. For some reason several people have been sending bad patches to fix compiler warnings in vmcore recently. Here's how it should be done. Compile-tested only on x86. As noted in the first patch, s390 should take this conversion a bit further, but I'm not inclined to do that work myself. This patch (of 3): Instead of passing in a 'buf' and 'userbuf' argument, pass in an iov_iter. s390 needs more work to pass the iov_iter down further, or refactor, but I'd be more comfortable if someone who can test on s390 did that work. It's more convenient to convert the whole of read_from_oldmem() to take an iov_iter at the same time, so rename it to read_from_oldmem_iter() and add a temporary read_from_oldmem() wrapper that creates an iov_iter. Link: https://lkml.kernel.org/r/20220408090636.560886-1-bhe@redhat.com Link: https://lkml.kernel.org/r/20220408090636.560886-2-bhe@redhat.com Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Cc: Heiko Carstens Signed-off-by: Andrew Morton commit 04d168c6d42d1772d35372301a14bb20784c81c5 Author: Jakob Koschel Date: Fri Apr 29 14:37:59 2022 -0700 fs/proc/kcore.c: remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. [akpm@linux-foundation.org: reduce scope of `iter'] Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Link: https://lkml.kernel.org/r/20220331223700.902556-1-jakobkoschel@gmail.com Signed-off-by: Jakob Koschel Cc: Mike Rapoport Cc: David Hildenbrand Cc: Oscar Salvador Cc: "Brian Johannesmeyer" Cc: Cristiano Giuffrida Cc: "Bos, H.J." Cc: Alexey Dobriyan Signed-off-by: Andrew Morton commit f1e75d128b46e3b066e7b2e7cfca10491109d44d Author: Heming Zhao via Ocfs2-devel Date: Fri Apr 29 14:37:58 2022 -0700 ocfs2: rewrite error handling of ocfs2_fill_super Current ocfs2_fill_super() uses one goto label "read_super_error" to handle all error cases. And with previous serial patches, the error handling should fork more branches to handle different error cases. This patch rewrite the error handling of ocfs2_fill_super. Link: https://lkml.kernel.org/r/20220424130952.2436-6-heming.zhao@suse.com Signed-off-by: Heming Zhao Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Signed-off-by: Andrew Morton commit 0737e01de9c411e4db87dcedf4a9789d41b1c5c1 Author: Heming Zhao via Ocfs2-devel Date: Fri Apr 29 14:37:58 2022 -0700 ocfs2: ocfs2_mount_volume does cleanup job before return error After this patch, when error, ocfs2_fill_super doesn't take care to release resources which are allocated in ocfs2_mount_volume. Link: https://lkml.kernel.org/r/20220424130952.2436-5-heming.zhao@suse.com Signed-off-by: Heming Zhao Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Signed-off-by: Andrew Morton commit a8a986db64930b7d4cd4e4f68d8718bfa75c9528 Author: Heming Zhao via Ocfs2-devel Date: Fri Apr 29 14:37:58 2022 -0700 ocfs2: ocfs2_initialize_super does cleanup job before return error After this patch, when error, ocfs2_fill_super doesn't take care to release resources which are allocated in ocfs2_initialize_super. Link: https://lkml.kernel.org/r/20220424130952.2436-4-heming.zhao@suse.com Signed-off-by: Heming Zhao Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Signed-off-by: Andrew Morton commit 54bd3f7c5c3b6b6101673ec9c73457127c317bf9 Author: Heming Zhao via Ocfs2-devel Date: Fri Apr 29 14:37:58 2022 -0700 ocfs2: change return type of ocfs2_resmap_init Since ocfs2_resmap_init() always return 0, change it to void. Link: https://lkml.kernel.org/r/20220424130952.2436-3-heming.zhao@suse.com Signed-off-by: Heming Zhao Reviewed-by: Joseph Qi Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Signed-off-by: Andrew Morton commit bb20b31dee1a6c329c2f721fbe21c51945cdfc29 Author: Heming Zhao via Ocfs2-devel Date: Fri Apr 29 14:37:58 2022 -0700 ocfs2: fix mounting crash if journal is not alloced Patch series "rewrite error handling during mounting stage". This patch (of 5): After commit da5e7c87827e8 ("ocfs2: cleanup journal init and shutdown"), journal init later than before, it makes NULL pointer access in free routine. Crash flow: ocfs2_fill_super + ocfs2_mount_volume | + ocfs2_dlm_init //fail & return, osb->journal is NULL. | + ... | + ocfs2_check_volume //no chance to init osb->journal | + ... + ocfs2_dismount_volume ocfs2_release_system_inodes ... evict ... ocfs2_clear_inode ocfs2_checkpoint_inode ocfs2_ci_fully_checkpointed time_after(journal->j_trans_id, ci->ci_last_trans) + journal is empty, crash! For fixing, there are three solutions: 1> Partly revert commit da5e7c87827e8 For avoiding kernel crash, this make sense for us. We only concerned whether there has any non-system inode access before dlm init. The answer is NO. And all journal replay/recovery handling happen after dlm & journal init done. So this method is not graceful but workable. 2> Add osb->journal check in free inode routine (eg ocfs2_clear_inode) The fix code is special for mounting phase, but it will continue working after mounting stage. In another word, this method adds useless code in normal inode free flow. 3> Do directly free inode in mounting phase This method is brutal/complex and may introduce unsafe code, currently maintainer didn't like. At last, we chose method <1> and did partly reverted job. We reverted journal init codes, and kept cleanup codes flow. Link: https://lkml.kernel.org/r/20220424130952.2436-1-heming.zhao@suse.com Link: https://lkml.kernel.org/r/20220424130952.2436-2-heming.zhao@suse.com Fixes: da5e7c87827e8 ("ocfs2: cleanup journal init and shutdown") Signed-off-by: Heming Zhao 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 b02da32b613f989b73c88113db16ab47de11a3fd Author: Jakob Koschel Date: Fri Apr 29 14:37:57 2022 -0700 ocfs2: remove usage of list iterator variable after the loop body 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 [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Link: https://lkml.kernel.org/r/20220322105014.3626194-1-jakobkoschel@gmail.com Signed-off-by: Jakob Koschel 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 81cd1ae909e0080eb41457766f0f448fd8ab9979 Author: Jakob Koschel Date: Fri Apr 29 14:37:57 2022 -0700 ocfs2: 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/ Link: https://lkml.kernel.org/r/20220324071650.61168-1-jakobkoschel@gmail.com Signed-off-by: Jakob Koschel 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 dec81a532027a77bd52f9bd8d8b3230843533d3f Author: Paul Gortmaker Date: Fri Apr 29 14:37:57 2022 -0700 scripts/bloat-o-meter: filter out vermagic as it is not relevant Seeing it as a false positive increase at the top is just noise: linux-head$./scripts/bloat-o-meter ../pre/vmlinux ../post/vmlinux add/remove: 0/571 grow/shrink: 1/9 up/down: 20/-64662 (-64642) Function old new delta vermagic 49 69 +20 Since it really doesn't "grow", it makes sense to filter it out. Link: https://lkml.kernel.org/r/20220428035824.7934-1-paul.gortmaker@windriver.com Signed-off-by: Paul Gortmaker Signed-off-by: Andrew Morton commit 3af8acf6aff2a98731522b52927429760f0b8006 Author: Schspa Shi Date: Fri Apr 29 14:37:57 2022 -0700 scripts/decode_stacktrace.sh: support old bash version Old bash version don't support associative array variables. Avoid to use associative array variables to avoid error. Without this, old bash version will report error as fellowing [ 15.954042] Kernel panic - not syncing: sysrq triggered crash [ 15.955252] CPU: 1 PID: 167 Comm: sh Not tainted 5.18.0-rc1-00208-gb7d075db2fd5 #4 [ 15.956472] Hardware name: Hobot J5 Virtual development board (DT) [ 15.957856] Call trace: ./scripts/decode_stacktrace.sh: line 128: ,dump_backtrace: syntax error: operand expected (error token is ",dump_backtrace") Link: https://lkml.kernel.org/r/20220409180331.24047-1-schspa@gmail.com Signed-off-by: Schspa Shi Cc: Stephen Boyd Signed-off-by: Andrew Morton commit 059342d1dd4e01d634184793fa3f8437e62afaa1 Author: Hailong Tu Date: Fri Apr 29 14:37:00 2022 -0700 mm/damon/reclaim: fix the timer always stays active The timer stays active even if the reclaim mechanism is never enabled. It is unnecessary overhead can be completely avoided by using module_param_cb() for enabled flag. Link: https://lkml.kernel.org/r/20220421125910.1052459-1-tuhailong@gmail.com Signed-off-by: Hailong Tu Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit cef4493f1aaacf797bc4ab0565682ab1143bf580 Author: Yu Zhe Date: Fri Apr 29 14:37:00 2022 -0700 mm/damon: remove unnecessary type castings Remove unnecessary void* type castings. Link: https://lkml.kernel.org/r/20220421153056.8474-1-yuzhe@nfschina.com Signed-off-by: Yu Zhe Cc: SeongJae Park Cc: liqiong Signed-off-by: Andrew Morton commit 4f540f5ab4f22961ea3467cce075d77d255d493c Author: SeongJae Park Date: Fri Apr 29 14:37:00 2022 -0700 mm/damon/core-test: add a kunit test case for ops registration This commit adds a simple kunit test case for DAMON operations registration feature. Link: https://lkml.kernel.org/r/20220419122225.290518-1-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 1f4910b3affc982a94d665470f0f700225952108 Author: Xiaomeng Tong Date: Fri Apr 29 14:37:00 2022 -0700 damon: vaddr-test: tweak code to make the logic clearer Move these two lines into the damon_for_each_region loop, it is always for testing the last region. And also avoid to use a list iterator 'r' outside the loop which is considered harmful[1]. [1]: https://lkml.org/lkml/2022/2/17/1032 Link: https://lkml.kernel.org/r/20220328115252.31675-1-xiam0nd.tong@gmail.com Signed-off-by: Xiaomeng Tong Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit eae3cb2e87ff84547e66211b81301a8f9122840f Author: Yosry Ahmed Date: Fri Apr 29 14:37:00 2022 -0700 selftests: cgroup: add a selftest for memory.reclaim Add a new test for memory.reclaim that verifies that the interface correctly reclaims memory as intended, from both anon and file pages. Link: https://lkml.kernel.org/r/20220425190040.2475377-5-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Roman Gushchin Acked-by: David Rientjes Cc: Chen Wandun Cc: Dave Hansen Cc: Greg Thelen Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Michal Hocko Cc: "Michal Koutn" Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun Heo Cc: Tim Chen Cc: Vaibhav Jain Cc: Wei Xu Cc: Yu Zhao Cc: Zefan Li Signed-off-by: Andrew Morton commit a3622a53e620700053b648478dbc638ad373be3b Author: Yosry Ahmed Date: Fri Apr 29 14:36:59 2022 -0700 selftests: cgroup: fix alloc_anon_noexit() instantly freeing memory Currently, alloc_anon_noexit() calls alloc_anon() which instantly frees the allocated memory. alloc_anon_noexit() is usually used with cg_run_nowait() to run a process in the background that allocates memory. It makes sense for the background process to keep the memory allocated and not instantly free it (otherwise there is no point of running it in the background). Link: https://lkml.kernel.org/r/20220425190040.2475377-4-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Roman Gushchin Acked-by: Shakeel Butt Acked-by: David Rientjes Cc: Chen Wandun Cc: Dave Hansen Cc: Greg Thelen Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Michal Hocko Cc: "Michal Koutn" Cc: Shuah Khan Cc: Tejun Heo Cc: Tim Chen Cc: Vaibhav Jain Cc: Wei Xu Cc: Yu Zhao Cc: Zefan Li Signed-off-by: Andrew Morton commit 6c26df84e1f2f9181c0741865105a53537da842c Author: Yosry Ahmed Date: Fri Apr 29 14:36:59 2022 -0700 selftests: cgroup: return -errno from cg_read()/cg_write() on failure Currently, cg_read()/cg_write() returns 0 on success and -1 on failure. Modify them to return the -errno on failure. Link: https://lkml.kernel.org/r/20220425190040.2475377-3-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: David Rientjes Acked-by: Roman Gushchin Cc: Chen Wandun Cc: Dave Hansen Cc: Greg Thelen Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Michal Hocko Cc: "Michal Koutn" Cc: Shuah Khan Cc: Tejun Heo Cc: Tim Chen Cc: Vaibhav Jain Cc: Wei Xu Cc: Yu Zhao Cc: Zefan Li Signed-off-by: Andrew Morton commit 94968384dde15d48263bfc59d280cd71b1259d8c Author: Shakeel Butt Date: Fri Apr 29 14:36:59 2022 -0700 memcg: introduce per-memcg reclaim interface This patch series adds a memory.reclaim proactive reclaim interface. The rationale behind the interface and how it works are in the first patch. This patch (of 4): Introduce a memcg interface to trigger memory reclaim on a memory cgroup. Use case: Proactive Reclaim --------------------------- A userspace proactive reclaimer can continuously probe the memcg to reclaim a small amount of memory. This gives more accurate and up-to-date workingset estimation as the LRUs are continuously sorted and can potentially provide more deterministic memory overcommit behavior. The memory overcommit controller can provide more proactive response to the changing behavior of the running applications instead of being reactive. A userspace reclaimer's purpose in this case is not a complete replacement for kswapd or direct reclaim, it is to proactively identify memory savings opportunities and reclaim some amount of cold pages set by the policy to free up the memory for more demanding jobs or scheduling new jobs. A user space proactive reclaimer is used in Google data centers. Additionally, Meta's TMO paper recently referenced a very similar interface used for user space proactive reclaim: https://dl.acm.org/doi/pdf/10.1145/3503222.3507731 Benefits of a user space reclaimer: ----------------------------------- 1) More flexible on who should be charged for the cpu of the memory reclaim. For proactive reclaim, it makes more sense to be centralized. 2) More flexible on dedicating the resources (like cpu). The memory overcommit controller can balance the cost between the cpu usage and the memory reclaimed. 3) Provides a way to the applications to keep their LRUs sorted, so, under memory pressure better reclaim candidates are selected. This also gives more accurate and uptodate notion of working set for an application. Why memory.high is not enough? ------------------------------ - memory.high can be used to trigger reclaim in a memcg and can potentially be used for proactive reclaim. However there is a big downside in using memory.high. It can potentially introduce high reclaim stalls in the target application as the allocations from the processes or the threads of the application can hit the temporary memory.high limit. - Userspace proactive reclaimers usually use feedback loops to decide how much memory to proactively reclaim from a workload. The metrics used for this are usually either refaults or PSI, and these metrics will become messy if the application gets throttled by hitting the high limit. - memory.high is a stateful interface, if the userspace proactive reclaimer crashes for any reason while triggering reclaim it can leave the application in a bad state. - If a workload is rapidly expanding, setting memory.high to proactively reclaim memory can result in actually reclaiming more memory than intended. The benefits of such interface and shortcomings of existing interface were further discussed in this RFC thread: https://lore.kernel.org/linux-mm/5df21376-7dd1-bf81-8414-32a73cea45dd@google.com/ Interface: ---------- Introducing a very simple memcg interface 'echo 10M > memory.reclaim' to trigger reclaim in the target memory cgroup. The interface is introduced as a nested-keyed file to allow for future optional arguments to be easily added to configure the behavior of reclaim. Possible Extensions: -------------------- - This interface can be extended with an additional parameter or flags to allow specifying one or more types of memory to reclaim from (e.g. file, anon, ..). - The interface can also be extended with a node mask to reclaim from specific nodes. This has use cases for reclaim-based demotion in memory tiering systens. - A similar per-node interface can also be added to support proactive reclaim and reclaim-based demotion in systems without memcg. - Add a timeout parameter to make it easier for user space to call the interface without worrying about being blocked for an undefined amount of time. For now, let's keep things simple by adding the basic functionality. [yosryahmed@google.com: worked on versions v2 onwards, refreshed to current master, updated commit message based on recent discussions and use cases] Link: https://lkml.kernel.org/r/20220425190040.2475377-1-yosryahmed@google.com Link: https://lkml.kernel.org/r/20220425190040.2475377-2-yosryahmed@google.com Signed-off-by: Shakeel Butt Co-developed-by: Yosry Ahmed Signed-off-by: Yosry Ahmed Acked-by: Johannes Weiner Acked-by: Michal Hocko Acked-by: Wei Xu Acked-by: Roman Gushchin Acked-by: David Rientjes Cc: Tejun Heo Cc: Zefan Li Cc: Jonathan Corbet Cc: Shuah Khan Cc: Yu Zhao Cc: Dave Hansen Cc: Greg Thelen Cc: Chen Wandun Cc: Vaibhav Jain Cc: "Michal Koutn" Cc: Tim Chen Signed-off-by: Andrew Morton commit 30226b69f8767a822f87c2c92bf6d4fbf545cee1 Author: Brian Geffon Date: Fri Apr 29 14:36:59 2022 -0700 zram: add a huge_idle writeback mode Today it's only possible to write back as a page, idle, or huge. A user might want to writeback pages which are huge and idle first as these idle pages do not require decompression and make a good first pass for writeback. Idle writeback specifically has the advantage that a refault is unlikely given that the page has been swapped for some amount of time without being refaulted. Huge writeback has the advantage that you're guaranteed to get the maximum benefit from a single page writeback, that is, you're reclaiming one full page of memory. Pages which are compressed in zram being written back result in some benefit which is always less than a page size because of the fact that it was compressed. The primary use of this is for minimizing refaults in situations where the device has to be sensitive to storage endurance. On ChromeOS we have devices with slow eMMC and repeated writes and refaults can negatively affect performance and endurance. Link: https://lkml.kernel.org/r/20220322215821.1196994-1-bgeffon@google.com Signed-off-by: Brian Geffon Acked-by: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Signed-off-by: Andrew Morton commit d137a7cb9b2ab8155184b2da9a304afff8f84d36 Author: Chen Wandun Date: Fri Apr 29 14:36:59 2022 -0700 mm/page_alloc: simplify update of pgdat in wake_all_kswapds There is no need to update last_pgdat for each zone, only update last_pgdat when iterating the first zone of a node. Link: https://lkml.kernel.org/r/20220322115635.2708989-1-chenwandun@huawei.com Signed-off-by: Chen Wandun Reviewed-by: Andrew Morton Cc: Mel Gorman Cc: Vlastimil Babka Cc: Johannes Weiner Signed-off-by: Andrew Morton commit ec2a0f9c8b50865a11720651c9c536f20c578def Author: Andrey Konovalov Date: Fri Apr 29 14:36:58 2022 -0700 kasan: mark KASAN_VMALLOC flags as kasan_vmalloc_flags_t Fix sparse warning: mm/kasan/shadow.c:496:15: warning: restricted kasan_vmalloc_flags_t degrades to integer Link: https://lkml.kernel.org/r/52d8fccdd3a48d4bdfd0ff522553bac2a13f1579.1649351254.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reported-by: kernel test robot Cc: Andrey Konovalov Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton commit 07d067e4f2ceb72b9f681995cc53828caaba9e6e Author: Zqiang Date: Fri Apr 29 14:36:58 2022 -0700 kasan: fix sleeping function called from invalid context on RT kernel BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 1, name: swapper/0 preempt_count: 1, expected: 0 ........... CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.1-rt16-yocto-preempt-rt #22 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x60/0x8c dump_stack+0x10/0x12 __might_resched.cold+0x13b/0x173 rt_spin_lock+0x5b/0xf0 ___cache_free+0xa5/0x180 qlist_free_all+0x7a/0x160 per_cpu_remove_cache+0x5f/0x70 smp_call_function_many_cond+0x4c4/0x4f0 on_each_cpu_cond_mask+0x49/0xc0 kasan_quarantine_remove_cache+0x54/0xf0 kasan_cache_shrink+0x9/0x10 kmem_cache_shrink+0x13/0x20 acpi_os_purge_cache+0xe/0x20 acpi_purge_cached_objects+0x21/0x6d acpi_initialize_objects+0x15/0x3b acpi_init+0x130/0x5ba do_one_initcall+0xe5/0x5b0 kernel_init_freeable+0x34f/0x3ad kernel_init+0x1e/0x140 ret_from_fork+0x22/0x30 When the kmem_cache_shrink() was called, the IPI was triggered, the ___cache_free() is called in IPI interrupt context, the local-lock or spin-lock will be acquired. On PREEMPT_RT kernel, these locks are replaced with sleepbale rt-spinlock, so the above problem is triggered. Fix it by moving the qlist_free_allfrom() from IPI interrupt context to task context when PREEMPT_RT is enabled. [akpm@linux-foundation.org: reduce ifdeffery] Link: https://lkml.kernel.org/r/20220401134649.2222485-1-qiang1.zhang@intel.com Signed-off-by: Zqiang Acked-by: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton commit 9c8bbfaca1bce84664403fd7dddbef6b3ff0a05a Author: Baolin Wang Date: Fri Apr 29 14:36:58 2022 -0700 mm: hugetlb: add missing cache flushing in hugetlb_unshare_all_pmds() Missed calling flush_cache_range() before removing the sharing PMD entrires, otherwise data consistence issue may be occurred on some architectures whose caches are strict and require a virtual>physical translation to exist for a virtual address. Thus add it. Now no architectures enabling PMD sharing will be affected, since they do not have a VIVT cache. That means this issue can not be happened in practice so far. Link: https://lkml.kernel.org/r/47441086affcabb6ecbe403173e9283b0d904b38.1650956489.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/419b0e777c9e6d1454dcd906e0f5b752a736d335.1650781755.git.baolin.wang@linux.alibaba.com Fixes: 6dfeaff93be1 ("hugetlb/userfaultfd: unshare all pmds for hugetlbfs when register wp") Signed-off-by: Baolin Wang Reviewed-by: Muchun Song Reviewed-by: Peter Xu Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 25fa414adad5b91b54a93f294bf3b17239741858 Author: xu xin Date: Fri Apr 29 14:36:58 2022 -0700 mm/khugepaged: use vma_is_anonymous Clean up the vma->vm_ops usage. Use vma_is_anonymous instead of vma->vm_ops to make it more understandable. Link: https://lkml.kernel.org/r/20220424071642.3234971-1-xu.xin16@zte.com.cn Signed-off-by: xu xin Reviewed-by: Yang Shi Signed-off-by: Andrew Morton commit 30a514002db23fd630e3e52a2bdfb05c0de03378 Author: Peng Liu Date: Fri Apr 29 14:36:58 2022 -0700 mm: use for_each_online_node and node_online instead of open coding Use more generic functions to deal with issues related to online nodes. The changes will make the code simplified. Link: https://lkml.kernel.org/r/20220429030218.644635-1-liupeng256@huawei.com Signed-off-by: Peng Liu Suggested-by: Davidlohr Bueso Suggested-by: Andrew Morton Reviewed-by: Muchun Song Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton commit f81f6e4b5eedb41045fd0ccc8ea31f4f07ce0993 Author: Peng Liu Date: Fri Apr 29 14:36:57 2022 -0700 hugetlb: fix return value of __setup handlers When __setup() return '0', using invalid option values causes the entire kernel boot option string to be reported as Unknown. Hugetlb calls __setup() and will return '0' when set invalid parameter string. The following phenomenon is observed: cmdline: hugepagesz=1Y hugepages=1 dmesg: HugeTLB: unsupported hugepagesz=1Y HugeTLB: hugepages=1 does not follow a valid hugepagesz, ignoring Unknown kernel command line parameters "hugepagesz=1Y hugepages=1" Since hugetlb will print warning/error information before return for invalid parameter string, just use return '1' to avoid print again. Link: https://lkml.kernel.org/r/20220413032915.251254-4-liupeng256@huawei.com Signed-off-by: Peng Liu Reviewed-by: Muchun Song Reviewed-by: Baolin Wang Reviewed-by: Davidlohr Bueso Reviewed-by: Mike Kravetz Cc: David Hildenbrand Cc: Liu Yuntao Cc: Zhenguo Yao Cc: Kefeng Wang Signed-off-by: Andrew Morton commit f87442f407af80dac4dc81c8a7772b71b36b2e09 Author: Peng Liu Date: Fri Apr 29 14:36:57 2022 -0700 hugetlb: fix hugepages_setup when deal with pernode Hugepages can be specified to pernode since "hugetlbfs: extend the definition of hugepages parameter to support node allocation", but the following problem is observed. Confusing behavior is observed when both 1G and 2M hugepage is set after "numa=off". cmdline hugepage settings: hugepagesz=1G hugepages=0:3,1:3 hugepagesz=2M hugepages=0:1024,1:1024 results: HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages HugeTLB registered 2.00 MiB page size, pre-allocated 1024 pages Furthermore, confusing behavior can be also observed when an invalid node behind a valid node. To fix this, never allocate any typical hugepage when an invalid parameter is received. Link: https://lkml.kernel.org/r/20220413032915.251254-3-liupeng256@huawei.com Fixes: b5389086ad7b ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") Signed-off-by: Peng Liu Reviewed-by: Mike Kravetz Cc: Baolin Wang Cc: David Hildenbrand Cc: Liu Yuntao Cc: Muchun Song Cc: Zhenguo Yao Cc: Kefeng Wang Signed-off-by: Andrew Morton commit 0a7a0f6f7f3679c906fc55e3805c1d5e2c566f55 Author: Peng Liu Date: Fri Apr 29 14:36:57 2022 -0700 hugetlb: fix wrong use of nr_online_nodes Patch series "hugetlb: Fix some incorrect behavior", v3. This series fix three bugs of hugetlb: 1) Invalid use of nr_online_nodes; 2) Inconsistency between 1G hugepage and 2M hugepage; 3) Useless information in dmesg. This patch (of 4): Certain systems are designed to have sparse/discontiguous nodes. In this case, nr_online_nodes can not be used to walk through numa node. Also, a valid node may be greater than nr_online_nodes. However, in hugetlb, it is assumed that nodes are contiguous. For sparse/discontiguous nodes, the current code may treat a valid node as invalid, and will fail to allocate all hugepages on a valid node that "nid >= nr_online_nodes". As David suggested: if (tmp >= nr_online_nodes) goto invalid; Just imagine node 0 and node 2 are online, and node 1 is offline. Assuming that "node < 2" is valid is wrong. Recheck all the places that use nr_online_nodes, and repair them one by one. [liupeng256@huawei.com: v4] Link: https://lkml.kernel.org/r/20220416103526.3287348-1-liupeng256@huawei.com Link: https://lkml.kernel.org/r/20220413032915.251254-1-liupeng256@huawei.com Link: https://lkml.kernel.org/r/20220413032915.251254-2-liupeng256@huawei.com Fixes: 4178158ef8ca ("hugetlbfs: fix issue of preallocation of gigantic pages can't work") Fixes: b5389086ad7b ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") Fixes: e79ce9832316 ("hugetlbfs: fix a truncation issue in hugepages parameter") Fixes: f9317f77a6e0 ("hugetlb: clean up potential spectre issue warnings") Signed-off-by: Peng Liu Suggested-by: David Hildenbrand Reviewed-by: Baolin Wang Reviewed-by: Kefeng Wang Reviewed-by: Davidlohr Bueso Reviewed-by: Mike Kravetz Acked-by: David Hildenbrand Cc: Zhenguo Yao Cc: Muchun Song Cc: Liu Yuntao Signed-off-by: Andrew Morton commit 59a4752895b2e43351c7c1dd2b264d17d74e8466 Author: Daniele Ceraolo Spurio Date: Wed Apr 27 21:19:26 2022 -0700 drm/i915: Xe_HP SDV and DG2 have up to 4 CCS engines Cc: Vinay Belgaumkar Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Matt Roper Reviewed-by: Andi Shyti Reviewed-by: Jordan Justen Tested-by: Jordan Justen # mesa anvil & iris Link: https://patchwork.freedesktop.org/patch/msgid/20220428041926.1483683-5-matthew.d.roper@intel.com commit ecf8eca51f33dbfddcc23902bdee65c17587247c Author: Matt Roper Date: Wed Apr 27 21:19:25 2022 -0700 drm/i915/xehp: Add compute engine ABI We're now ready to start exposing compute engines to userspace. v2: - Move kerneldoc for other engine classes to a separate patch. (Andi) Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Cc: Vinay Belgaumkar Cc: Jordan Justen Cc: Szymon Morek UMD (mesa): https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14395 Signed-off-by: Matt Roper Acked-by: Tvrtko Ursulin Reviewed-by: Andi Shyti Reviewed-by: Jordan Justen Tested-by: Jordan Justen # mesa anvil & iris Link: https://patchwork.freedesktop.org/patch/msgid/20220428041926.1483683-4-matthew.d.roper@intel.com commit 9ff9236394dd8a4fc7d1d3f3dc9d00cda3dd58be Author: Heiko Schocher Date: Fri Apr 29 14:20:56 2022 -0300 drm/panel: simple: Add Startek KD070WVFPA043-C069A panel support Add Startek KD070WVFPA043-C069A 7" TFT LCD panel support. Signed-off-by: Heiko Schocher [fabio: passed .flags and .bus_flags] Signed-off-by: Fabio Estevam Acked-by: Sam Ravnborg Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220429172056.3499563-2-festevam@gmail.com commit 97e17a09063074a2534e8c2f4873588a9aaa48b3 Author: Matt Roper Date: Wed Apr 27 21:19:24 2022 -0700 drm/i915/xehp: Add register for compute engine's MMIO-based TLB invalidation Compute engines have a separate register that the driver should use to perform MMIO-based TLB invalidation. Note that the term "context" in this register's bspec description is used to refer to the engine instance (in the same way "context" is used on bspec 46167). Bspec: 43930 Cc: Prathap Kumar Valsan Cc: Tvrtko Ursulin Signed-off-by: Matt Roper Acked-by: Tvrtko Ursulin Reviewed-by: Prathap Kumar Valsan Link: https://patchwork.freedesktop.org/patch/msgid/20220428041926.1483683-3-matthew.d.roper@intel.com commit 1e69a83a5e1aae7a1e6079cf306fc72087a059d9 Author: Fabio Estevam Date: Fri Apr 29 14:20:55 2022 -0300 dt-bindings: display: simple: Add Startek KD070WVFPA043-C069A panel Add Startek KD070WVFPA043-C069A 7" TFT LCD panel compatible string. Signed-off-by: Fabio Estevam Acked-by: Sam Ravnborg Reviewed-by: Marek Vasut Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220429172056.3499563-1-festevam@gmail.com commit 991b4de3275728fd746ce15e00087fdbd51c29a1 Author: Matt Roper Date: Wed Apr 27 21:19:23 2022 -0700 drm/i915/uapi: Add kerneldoc for engine class enum We'll be adding a new type of engine soon. Let's document the existing engine classes first to help make it clear what each type of engine is used for. Cc: Andi Shyti Signed-off-by: Matt Roper Reviewed-by: Andi Shyti Reviewed-by: Jordan Justen Link: https://patchwork.freedesktop.org/patch/msgid/20220428041926.1483683-2-matthew.d.roper@intel.com commit ab7671282b7ca750b5de99b2a59e51edab34ecc7 Author: Minghao Chi Date: Fri Apr 29 09:03:09 2022 +0000 drm/nouveau: simplify the return expression of nouveau_debugfs_init() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Lyude Paul [fixed an indenting error before pushing] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220429090309.3853003-1-chi.minghao@zte.com.cn commit 662340ef921828507c931da6db303fa3cb02228e Author: Sargun Dhillon Date: Wed Apr 27 18:54:47 2022 -0700 selftests/seccomp: Ensure that notifications come in FIFO order When multiple notifications are waiting, ensure they show up in order, as defined by the (predictable) seccomp notification ID. This ensures FIFO ordering of notification delivery as notification ids are monitonic and decided when the notification is generated (as opposed to received). Signed-off-by: Sargun Dhillon Cc: linux-kselftest@vger.kernel.org Acked-by: Tycho Andersen Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220428015447.13661-2-sargun@sargun.me commit c8220e87213b23ccb4b58b0048d86e3c4f234c88 Merge: 756a615083315 66344c6d92113 Author: Mark Brown Date: Fri Apr 29 19:48:47 2022 +0100 ASoC: SOF: Miscellaneous preparatory patches for IPC4 Merge series from Ranjani Sridharan : This series includes last few remaining miscellaneous patches to prepare for the introduction of new IPC version, IPC4, in the SOF driver. The changes include new IPC ops for topology parsing to set up the volume table, prepare the widgets for set up and free the routes. The remaining patches introduce new fields in the existing data structures for use in IPC4 and align the flows for widget/route set up so that they are common for both IPC3 and IPC4. commit 4cbf6f621150e4fca78543067260f68fab0ee328 Author: Sargun Dhillon Date: Wed Apr 27 18:54:46 2022 -0700 seccomp: Use FIFO semantics to order notifications Previously, the seccomp notifier used LIFO semantics, where each notification would be added on top of the stack, and notifications were popped off the top of the stack. This could result one process that generates a large number of notifications preventing other notifications from being handled. This patch moves from LIFO (stack) semantics to FIFO (queue semantics). Signed-off-by: Sargun Dhillon Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220428015447.13661-1-sargun@sargun.me commit 95a126d9812ff51f7ff3e42d956390ff9a1801f8 Author: Yang Guang Date: Wed Mar 30 08:22:10 2022 +0800 selftests/seccomp: Add SKIP for failed unshare() Running the seccomp tests under the kernel with "defconfig" shouldn't fail. Because the CONFIG_USER_NS is not supported in "defconfig". Skipping this case instead of failing it is better. Signed-off-by: Yang Guang Signed-off-by: David Yang Reviewed-by: Shuah Khan Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/7f7687696a5c0a2d040a24474616e945c7cf2bb5.1648599460.git.yang.guang5@zte.com.cn commit d250a3e4e5b41d9d805a8bfd2458b548d1681742 Author: Jann Horn Date: Sat Mar 19 02:08:38 2022 +0100 selftests/seccomp: Test PTRACE_O_SUSPEND_SECCOMP without CAP_SYS_ADMIN Add a test to check that PTRACE_O_SUSPEND_SECCOMP can't be set without CAP_SYS_ADMIN through PTRACE_SEIZE or PTRACE_SETOPTIONS. Signed-off-by: Jann Horn Co-developed-by: Kees Cook Signed-off-by: Kees Cook commit 18f3976fdb5da2ba9572845e6f7dfb58652871ea Author: Alexandru Elisei Date: Mon Apr 25 12:44:44 2022 +0100 KVM: arm64: uapi: Add kvm_debug_exit_arch.hsr_high When userspace is debugging a VM, the kvm_debug_exit_arch part of the kvm_run struct contains arm64 specific debug information: the ESR_EL2 value, encoded in the field "hsr", and the address of the instruction that caused the exception, encoded in the field "far". Linux has moved to treating ESR_EL2 as a 64-bit register, but unfortunately kvm_debug_exit_arch.hsr cannot be changed because that would change the memory layout of the struct on big endian machines: Current layout: | Layout with "hsr" extended to 64 bits: | offset 0: ESR_EL2[31:0] (hsr) | offset 0: ESR_EL2[61:32] (hsr[61:32]) offset 4: padding | offset 4: ESR_EL2[31:0] (hsr[31:0]) offset 8: FAR_EL2[61:0] (far) | offset 8: FAR_EL2[61:0] (far) which breaks existing code. The padding is inserted by the compiler because the "far" field must be aligned to 8 bytes (each field must be naturally aligned - aapcs64 [1], page 18), and the struct itself must be aligned to 8 bytes (the struct must be aligned to the maximum alignment of its fields - aapcs64, page 18), which means that "hsr" must be aligned to 8 bytes as it is the first field in the struct. To avoid changing the struct size and layout for the existing fields, add a new field, "hsr_high", which replaces the existing padding. "hsr_high" will be used to hold the ESR_EL2[61:32] bits of the register. The memory layout, both on big and little endian machine, becomes: offset 0: ESR_EL2[31:0] (hsr) offset 4: ESR_EL2[61:32] (hsr_high) offset 8: FAR_EL2[61:0] (far) The padding that the compiler inserts for the current struct layout is unitialized. To prevent an updated userspace running on an old kernel mistaking the padding for a valid "hsr_high" value, add a new flag, KVM_DEBUG_ARCH_HSR_HIGH_VALID, to kvm_run->flags to let userspace know that "hsr_high" holds a valid ESR_EL2[61:32] value. [1] https://github.com/ARM-software/abi-aa/releases/download/2021Q3/aapcs64.pdf Signed-off-by: Alexandru Elisei Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425114444.368693-6-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit 0b12620fddb8a8087091df1a9c7b1da1dec7a4a0 Author: Alexandru Elisei Date: Mon Apr 25 12:44:43 2022 +0100 KVM: arm64: Treat ESR_EL2 as a 64-bit register ESR_EL2 was defined as a 32-bit register in the initial release of the ARM Architecture Manual for Armv8-A, and was later extended to 64 bits, with bits [63:32] RES0. ARMv8.7 introduced FEAT_LS64, which makes use of bits [36:32]. KVM treats ESR_EL1 as a 64-bit register when saving and restoring the guest context, but ESR_EL2 is handled as a 32-bit register. Start treating ESR_EL2 as a 64-bit register to allow KVM to make use of the most significant 32 bits in the future. The type chosen to represent ESR_EL2 is u64, as that is consistent with the notation KVM overwhelmingly uses today (u32), and how the rest of the registers are declared. Signed-off-by: Alexandru Elisei Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425114444.368693-5-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit 8d56e5c5a99ce1d17d39ce5a8260e42c2a2d7682 Author: Alexandru Elisei Date: Mon Apr 25 12:44:42 2022 +0100 arm64: Treat ESR_ELx as a 64-bit register In the initial release of the ARM Architecture Reference Manual for ARMv8-A, the ESR_ELx registers were defined as 32-bit registers. This changed in 2018 with version D.a (ARM DDI 0487D.a) of the architecture, when they became 64-bit registers, with bits [63:32] defined as RES0. In version G.a, a new field was added to ESR_ELx, ISS2, which covers bits [36:32]. This field is used when the Armv8.7 extension FEAT_LS64 is implemented. As a result of the evolution of the register width, Linux stores it as both a 64-bit value and a 32-bit value, which hasn't affected correctness so far as Linux only uses the lower 32 bits of the register. Make the register type consistent and always treat it as 64-bit wide. The register is redefined as an "unsigned long", which is an unsigned double-word (64-bit quantity) for the LP64 machine (aapcs64 [1], Table 1, page 14). The type was chosen because "unsigned int" is the most frequent type for ESR_ELx and because FAR_ELx, which is used together with ESR_ELx in exception handling, is also declared as "unsigned long". The 64-bit type also makes adding support for architectural features that use fields above bit 31 easier in the future. The KVM hypervisor will receive a similar update in a subsequent patch. [1] https://github.com/ARM-software/abi-aa/releases/download/2021Q3/aapcs64.pdf Signed-off-by: Alexandru Elisei Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425114444.368693-4-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit 3fed9e551417b84038b15117732ea4505eee386b Author: Alexandru Elisei Date: Mon Apr 25 12:44:41 2022 +0100 arm64: compat: Do not treat syscall number as ESR_ELx for a bad syscall If a compat process tries to execute an unknown system call above the __ARM_NR_COMPAT_END number, the kernel sends a SIGILL signal to the offending process. Information about the error is printed to dmesg in compat_arm_syscall() -> arm64_notify_die() -> arm64_force_sig_fault() -> arm64_show_signal(). arm64_show_signal() interprets a non-zero value for current->thread.fault_code as an exception syndrome and displays the message associated with the ESR_ELx.EC field (bits 31:26). current->thread.fault_code is set in compat_arm_syscall() -> arm64_notify_die() with the bad syscall number instead of a valid ESR_ELx value. This means that the ESR_ELx.EC field has the value that the user set for the syscall number and the kernel can end up printing bogus exception messages*. For example, for the syscall number 0x68000000, which evaluates to ESR_ELx.EC value of 0x1A (ESR_ELx_EC_FPAC) the kernel prints this error: [ 18.349161] syscall[300]: unhandled exception: ERET/ERETAA/ERETAB, ESR 0x68000000, Oops - bad compat syscall(2) in syscall[10000+50000] [ 18.350639] CPU: 2 PID: 300 Comm: syscall Not tainted 5.18.0-rc1 #79 [ 18.351249] Hardware name: Pine64 RockPro64 v2.0 (DT) [..] which is misleading, as the bad compat syscall has nothing to do with pointer authentication. Stop arm64_show_signal() from printing exception syndrome information by having compat_arm_syscall() set the ESR_ELx value to 0, as it has no meaning for an invalid system call number. The example above now becomes: [ 19.935275] syscall[301]: unhandled exception: Oops - bad compat syscall(2) in syscall[10000+50000] [ 19.936124] CPU: 1 PID: 301 Comm: syscall Not tainted 5.18.0-rc1-00005-g7e08006d4102 #80 [ 19.936894] Hardware name: Pine64 RockPro64 v2.0 (DT) [..] which although shows less information because the syscall number, wrongfully advertised as the ESR value, is missing, it is better than showing plainly wrong information. The syscall number can be easily obtained with strace. *A 32-bit value above or equal to 0x8000_0000 is interpreted as a negative integer in compat_arm_syscal() and the condition scno < __ARM_NR_COMPAT_END evaluates to true; the syscall will exit to userspace in this case with the ENOSYS error code instead of arm64_notify_die() being called. Signed-off-by: Alexandru Elisei Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425114444.368693-3-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit a99ef9cb4b79e79d1574804eaf39608f8187e174 Author: Alexandru Elisei Date: Mon Apr 25 12:44:40 2022 +0100 arm64: Make ESR_ELx_xVC_IMM_MASK compatible with assembly ESR_ELx_xVC_IMM_MASK is used as a mask for the immediate value for the HVC/SMC instructions. The header file is included by assembly files (like entry.S) and ESR_ELx_xVC_IMM_MASK is not conditioned on __ASSEMBLY__ being undefined. Use the UL() macro for defining the constant's size, as that is compatible with both C code and assembly, whereas the UL suffix only works for C code. Signed-off-by: Alexandru Elisei Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425114444.368693-2-alexandru.elisei@arm.com Signed-off-by: Catalin Marinas commit c4a0ebf87cebbfa28d56e7d93b2536e2311e30c9 Author: Chengming Zhou Date: Thu Apr 21 00:00:06 2022 +0800 arm64/ftrace: Make function graph use ftrace directly As we do in commit 0c0593b45c9b ("x86/ftrace: Make function graph use ftrace directly"), we don't need special hook for graph tracer, but instead we use graph_ops:func function to install return_hooker. Since commit 3b23e4991fb6 ("arm64: implement ftrace with regs") add implementation for FTRACE_WITH_REGS on arm64, we can easily adopt the same cleanup on arm64. And this cleanup only changes the FTRACE_WITH_REGS implementation, so the mcount-based implementation is unaffected. While in theory it would be possible to make a similar cleanup for !FTRACE_WITH_REGS, this will require rework of the core code, and so for now we only change the FTRACE_WITH_REGS implementation. Tested-by: Mark Rutland Reviewed-by: Mark Rutland Signed-off-by: Chengming Zhou Link: https://lore.kernel.org/r/20220420160006.17880-2-zhouchengming@bytedance.com Signed-off-by: Catalin Marinas commit e999995c84c3abb6dcae83f8c35942a8d4ee0451 Author: Chengming Zhou Date: Thu Apr 21 00:00:05 2022 +0800 ftrace: cleanup ftrace_graph_caller enable and disable The ftrace_[enable,disable]_ftrace_graph_caller() are used to do special hooks for graph tracer, which are not needed on some ARCHs that use graph_ops:func function to install return_hooker. So introduce the weak version in ftrace core code to cleanup in x86. Signed-off-by: Chengming Zhou Acked-by: Steven Rostedt (Google) Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220420160006.17880-1-zhouchengming@bytedance.com Signed-off-by: Catalin Marinas commit d43fae7c4d3e6dfee9d26287907dbe8e27ff8846 Author: Michal Suchanek Date: Fri Apr 29 09:43:34 2022 +0200 testing: nvdimm: asm/mce.h is not needed in nfit.c asm/mce.h is not available on arm, and it is not needed to build nfit.c. Remove the include. It was likely needed for COPY_MC_TEST Fixes: 3adb776384f2 ("x86, libnvdimm/test: Remove COPY_MC_TEST") Signed-off-by: Michal Suchanek Link: https://lore.kernel.org/r/20220429074334.21771-1-msuchanek@suse.de Signed-off-by: Dan Williams commit dccfbc73a9ddd2c7232696f563c39d0ca09ae905 Author: Michal Suchanek Date: Fri Apr 29 15:40:39 2022 +0200 testing: nvdimm: iomap: make __nfit_test_ioremap a macro The ioremap passed as argument to __nfit_test_ioremap can be a macro so it cannot be passed as function argument. Make __nfit_test_ioremap into a macro so that ioremap can be passed as untyped macro argument. Signed-off-by: Michal Suchanek Fixes: 6bc756193ff6 ("tools/testing/nvdimm: libnvdimm unit test infrastructure") Link: https://lore.kernel.org/r/20220429134039.18252-1-msuchanek@suse.de Signed-off-by: Dan Williams commit 84e5ffd045f33e4fa32370135436d987478d0bf7 Author: Lai Jiangshan Date: Wed Apr 20 21:12:04 2022 +0800 KVM: X86/MMU: Fix shadowing 5-level NPT for 4-level NPT L1 guest When shadowing 5-level NPT for 4-level NPT L1 guest, the root_sp is allocated with role.level = 5 and the guest pagetable's root gfn. And root_sp->spt[0] is also allocated with the same gfn and the same role except role.level = 4. Luckily that they are different shadow pages, but only root_sp->spt[0] is the real translation of the guest pagetable. Here comes a problem: If the guest switches from gCR4_LA57=0 to gCR4_LA57=1 (or vice verse) and uses the same gfn as the root page for nested NPT before and after switching gCR4_LA57. The host (hCR4_LA57=1) might use the same root_sp for the guest even the guest switches gCR4_LA57. The guest will see unexpected page mapped and L2 may exploit the bug and hurt L1. It is lucky that the problem can't hurt L0. And three special cases need to be handled: The root_sp should be like role.direct=1 sometimes: its contents are not backed by gptes, root_sp->gfns is meaningless. (For a normal high level sp in shadow paging, sp->gfns is often unused and kept zero, but it could be relevant and meaningful if sp->gfns is used because they are backed by concrete gptes.) For such root_sp in the case, root_sp is just a portal to contribute root_sp->spt[0], and root_sp->gfns should not be used and root_sp->spt[0] should not be dropped if gpte[0] of the guest root pagetable is changed. Such root_sp should not be accounted too. So add role.passthrough to distinguish the shadow pages in the hash when gCR4_LA57 is toggled and fix above special cases by using it in kvm_mmu_page_{get|set}_gfn() and sp_has_gptes(). Signed-off-by: Lai Jiangshan Message-Id: <20220420131204.2850-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 767d8d8d503f946c7a67735e77dea7e1c9cb6b51 Author: Lai Jiangshan Date: Wed Apr 20 21:12:03 2022 +0800 KVM: X86/MMU: Add sp_has_gptes() Add sp_has_gptes() which equals to !sp->role.direct currently. Shadow page having gptes needs to be write-protected, accounted and responded to kvm_mmu_pte_write(). Use it in these places to replace !sp->role.direct and rename for_each_gfn_indirect_valid_sp. Signed-off-by: Lai Jiangshan Message-Id: <20220420131204.2850-2-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 9f084f7c2ed7e6b8cc3176b9ece2f6cb0641c385 Author: Suravee Suthikulpanit Date: Wed Apr 20 10:49:54 2022 -0500 KVM: SVM: Introduce trace point for the slow-path of avic_kic_target_vcpus This can help identify potential performance issues when handles AVIC incomplete IPI due vCPU not running. Reviewed-by: Maxim Levitsky Signed-off-by: Suravee Suthikulpanit Signed-off-by: Paolo Bonzini Message-Id: <20220420154954.19305-3-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini commit 7223fd2d5338d5eeef1775abd3440f8b499f3c0a Author: Suravee Suthikulpanit Date: Wed Apr 20 10:49:53 2022 -0500 KVM: SVM: Use target APIC ID to complete AVIC IRQs when possible Currently, an AVIC-enabled VM suffers from performance bottleneck when scaling to large number of vCPUs for I/O intensive workloads. In such case, a vCPU often executes halt instruction to get into idle state waiting for interrupts, in which KVM would de-schedule the vCPU from physical CPU. When AVIC HW tries to deliver interrupt to the halting vCPU, it would result in AVIC incomplete IPI #vmexit to notify KVM to reschedule the target vCPU into running state. Investigation has shown the main hotspot is in the kvm_apic_match_dest() in the following call stack where it tries to find target vCPUs corresponding to the information in the ICRH/ICRL registers. - handle_exit - svm_invoke_exit_handler - avic_incomplete_ipi_interception - kvm_apic_match_dest However, AVIC provides hints in the #vmexit info, which can be used to retrieve the destination guest physical APIC ID. In addition, since QEMU defines guest physical APIC ID to be the same as vCPU ID, it can be used to quickly identify the target vCPU to deliver IPI, and avoid the overhead from searching through all vCPUs to match the target vCPU. Reviewed-by: Maxim Levitsky Signed-off-by: Suravee Suthikulpanit Signed-off-by: Paolo Bonzini Message-Id: <20220420154954.19305-2-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini commit 347a0d0ded16a2e59c35b43ace7ad2b53fb6df57 Author: Paolo Bonzini Date: Thu Feb 10 08:00:56 2022 -0500 KVM: x86/mmu: replace direct_map with root_role.direct direct_map is always equal to the direct field of the root page's role: - for shadow paging, direct_map is true if CR0.PG=0 and root_role.direct is copied from cpu_role.base.direct - for TDP, it is always true and root_role.direct is also always true - for shadow TDP, it is always false and root_role.direct is also always false Signed-off-by: Paolo Bonzini commit 4d25502aa12ef1fb01e599cbfd341a8d436f4b8b Author: Paolo Bonzini Date: Thu Feb 10 07:42:22 2022 -0500 KVM: x86/mmu: replace root_level with cpu_role.base.level Remove another duplicate field of struct kvm_mmu. This time it's the root level for page table walking; the separate field is always initialized as cpu_role.base.level, so its users can look up the CPU mode directly instead. Signed-off-by: Paolo Bonzini commit a972e29c1d6c957242a23b42f355b1fdf721cbd4 Author: Paolo Bonzini Date: Thu Feb 10 07:41:19 2022 -0500 KVM: x86/mmu: replace shadow_root_level with root_role.level root_role.level is always the same value as shadow_level: - it's kvm_mmu_get_tdp_level(vcpu) when going through init_kvm_tdp_mmu - it's the level argument when going through kvm_init_shadow_ept_mmu - it's assigned directly from new_role.base.level when going through shadow_mmu_init_context Remove the duplication and get the level directly from the role. Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a7f1de9b6066cc62e0142302d8021731d56b9559 Author: Paolo Bonzini Date: Thu Feb 10 07:57:21 2022 -0500 KVM: x86/mmu: pull CPU mode computation to kvm_init_mmu Do not lead init_kvm_*mmu into the temptation of poking into struct kvm_mmu_role_regs, by passing to it directly the CPU mode. Signed-off-by: Paolo Bonzini commit 56b321f9e332082b9c5f7519495f068b147fe2c0 Author: Paolo Bonzini Date: Thu Feb 10 07:39:50 2022 -0500 KVM: x86/mmu: simplify and/or inline computation of shadow MMU roles Shadow MMUs compute their role from cpu_role.base, simply by adjusting the root level. It's one line of code, so do not place it in a separate function. Signed-off-by: Paolo Bonzini commit faf729621c9609367a0714f5383df67fdd8d021c Author: Paolo Bonzini Date: Thu Feb 10 07:38:51 2022 -0500 KVM: x86/mmu: remove redundant bits from extended role Before the separation of the CPU and the MMU role, CR0.PG was not available in the base MMU role, because two-dimensional paging always used direct=1 in the MMU role. However, now that the raw role is snapshotted in mmu->cpu_role, the value of CR0.PG always matches both !cpu_role.base.direct and cpu_role.base.level > 0. There is no need to store it again in union kvm_mmu_extended_role; instead, write an is_cr0_pg accessor by hand that takes care of the conversion. Use cpu_role.base.level since the future of the direct field is unclear. Likewise, CR4.PAE is now always present in the CPU role as !cpu_role.base.has_4_byte_gpte. The inversion makes certain tests on the MMU role easier, and is easily hidden by the is_cr4_pae accessor when operating on the CPU role. Signed-off-by: Paolo Bonzini commit 7a7ae8292391c4d53c4340e606bf48776c3449e7 Author: Paolo Bonzini Date: Thu Feb 10 07:38:32 2022 -0500 KVM: x86/mmu: rename kvm_mmu_role union It is quite confusing that the "full" union is called kvm_mmu_role but is used for the "cpu_role" field of struct kvm_mmu. Rename it to kvm_cpu_role. Signed-off-by: Paolo Bonzini commit 7a458f0e1ba150a6ea012171a43c4b947f1d825d Author: Paolo Bonzini Date: Mon Feb 14 08:46:24 2022 -0500 KVM: x86/mmu: remove extended bits from mmu_role, rename field mmu_role represents the role of the root of the page tables. It does not need any extended bits, as those govern only KVM's page table walking; the is_* functions used for page table walking always use the CPU role. ext.valid is not present anymore in the MMU role, but an all-zero MMU role is impossible because the level field is never zero in the MMU role. So just zap the whole mmu_role in order to force invalidation after CPUID is updated. While making this change, which requires touching almost every occurrence of "mmu_role", rename it to "root_role". Signed-off-by: Paolo Bonzini commit 362505deb8e2ce27993a1dee0b3c5755d4d6646e Author: Paolo Bonzini Date: Thu Feb 10 07:33:38 2022 -0500 KVM: x86/mmu: store shadow EFER.NX in the MMU role Now that the MMU role is separate from the CPU role, it can be a truthful description of the format of the shadow pages. This includes whether the shadow pages use the NX bit; so force the efer_nx field of the MMU role when TDP is disabled, and remove the hardcoding it in the callers of reset_shadow_zero_bits_mask. In fact, the initialization of reserved SPTE bits can now be made common to shadow paging and shadow NPT; move it to shadow_mmu_init_context. Signed-off-by: Paolo Bonzini commit f417e1459a1299bb4984cbffc03d8746cab9f8a8 Author: Paolo Bonzini Date: Thu Feb 10 07:33:26 2022 -0500 KVM: x86/mmu: cleanup computation of MMU roles for shadow paging Pass the already-computed CPU role, instead of redoing it. Signed-off-by: Paolo Bonzini commit 2ba676774dfc9369f67f30cd3b4f58ccda907c24 Author: Paolo Bonzini Date: Thu Feb 10 07:33:08 2022 -0500 KVM: x86/mmu: cleanup computation of MMU roles for two-dimensional paging Inline kvm_calc_mmu_role_common into its sole caller, and simplify it by removing the computation of unnecessary bits. Extended bits are unnecessary because page walking uses the CPU role, and EFER.NX/CR0.WP can be set to one unconditionally---matching the format of shadow pages rather than the format of guest pages. The MMU role for two dimensional paging does still depend on the CPU role, even if only barely so, due to SMM and guest mode; for consistency, pass it down to kvm_calc_tdp_mmu_root_page_role instead of querying the vcpu with is_smm or is_guest_mode. Signed-off-by: Paolo Bonzini commit 19b5dcc3be2efe93760372f444dec44e77f67146 Author: Paolo Bonzini Date: Thu Feb 10 07:33:01 2022 -0500 KVM: x86/mmu: remove kvm_calc_shadow_root_page_role_common kvm_calc_shadow_root_page_role_common is the same as kvm_calc_cpu_role except for the level, which is overwritten afterwards in kvm_calc_shadow_mmu_root_page_role and kvm_calc_shadow_npt_root_page_role. role.base.direct is already set correctly for the CPU role, and CR0.PG=1 is required for VMRUN so it will also be correct for nested NPT. Signed-off-by: Paolo Bonzini commit ec283cb1dcb934d1a861e5e25ce843e033ee4ab7 Author: Paolo Bonzini Date: Thu Feb 10 07:32:51 2022 -0500 KVM: x86/mmu: remove ept_ad field The ept_ad field is used during page walk to determine if the guest PTEs have accessed and dirty bits. In the MMU role, the ad_disabled bit represents whether the *shadow* PTEs have the bits, so it would be incorrect to replace PT_HAVE_ACCESSED_DIRTY with just !mmu->mmu_role.base.ad_disabled. However, the similar field in the CPU mode, ad_disabled, is initialized correctly: to the opposite value of ept_ad for shadow EPT, and zero for non-EPT guest paging modes (which always have A/D bits). It is therefore possible to compute PT_HAVE_ACCESSED_DIRTY from the CPU mode, like other page-format fields; it just has to be inverted to account for the different polarity. In fact, now that the CPU mode is distinct from the MMU roles, it would even be possible to remove PT_HAVE_ACCESSED_DIRTY macro altogether, and use !mmu->cpu_role.base.ad_disabled instead. I am not doing this because the macro has a small effect in terms of dead code elimination: text data bss dec hex 103544 16665 112 120321 1d601 # as of this patch 103746 16665 112 120523 1d6cb # without PT_HAVE_ACCESSED_DIRTY Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 60f3cb60a59d3f155d7b5b7f8339754b2aba8815 Author: Paolo Bonzini Date: Thu Feb 10 07:32:40 2022 -0500 KVM: x86/mmu: do not recompute root level from kvm_mmu_role_regs The root_level can be found in the cpu_role (in fact the field is superfluous and could be removed, but one thing at a time). Since there is only one usage left of role_regs_to_root_level, inline it into kvm_calc_cpu_role. Signed-off-by: Paolo Bonzini commit e5ed0fb01004f93ddf8a0c632cbc8a3f1ea5b518 Author: Paolo Bonzini Date: Fri Feb 11 06:50:11 2022 -0500 KVM: x86/mmu: split cpu_role from mmu_role Snapshot the state of the processor registers that govern page walk into a new field of struct kvm_mmu. This is a more natural representation than having it *mostly* in mmu_role but not exclusively; the delta right now is represented in other fields, such as root_level. The nested MMU now has only the CPU role; and in fact the new function kvm_calc_cpu_role is analogous to the previous kvm_calc_nested_mmu_role, except that it has role.base.direct equal to !CR0.PG. For a walk-only MMU, "direct" has no meaning, but we set it to !CR0.PG so that role.ext.cr0_pg can go away in a future patch. Signed-off-by: Paolo Bonzini commit b89805082adf1f502b1f0b993063e938e1bcb098 Author: Paolo Bonzini Date: Thu Feb 10 07:30:58 2022 -0500 KVM: x86/mmu: remove "bool base_only" arguments The argument is always false now that kvm_mmu_calc_root_page_role has been removed. Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 6819af7597d87d40769b47bb377472877a6b56c0 Author: Sean Christopherson Date: Thu Mar 3 20:20:17 2022 -0800 KVM: x86: Clean up and document nested #PF workaround Replace the per-vendor hack-a-fix for KVM's #PF => #PF => #DF workaround with an explicit, common workaround in kvm_inject_emulated_page_fault(). Aside from being a hack, the current approach is brittle and incomplete, e.g. nSVM's KVM_SET_NESTED_STATE fails to set ->inject_page_fault(), and nVMX fails to apply the workaround when VMX is intercepting #PF due to allow_smaller_maxphyaddr=1. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 25cc05652cd6be7349c84abbea3886b5483330cd Author: Paolo Bonzini Date: Thu Feb 10 07:30:40 2022 -0500 KVM: x86/mmu: rephrase unclear comment If accessed bits are not supported there simple isn't any distinction between accessed and non-accessed gPTEs, so the comment does not make much sense. Rephrase it in terms of what happens if accessed bits *are* supported. Signed-off-by: Paolo Bonzini commit 39e7e2bf321ac7784823e61abcbdf1459aeaee94 Author: Paolo Bonzini Date: Thu Feb 10 07:30:31 2022 -0500 KVM: x86/mmu: pull computation of kvm_mmu_role_regs to kvm_init_mmu The init_kvm_*mmu functions, with the exception of shadow NPT, do not need to know the full values of CR0/CR4/EFER; they only need to know the bits that make up the "role". This cleanup however will take quite a few incremental steps. As a start, pull the common computation of the struct kvm_mmu_role_regs into their caller: all of them extract the struct from the vcpu as the very first step. Reviewed-by: David Matlack Signed-off-by: Paolo Bonzini commit 82ffa13f7933cdc9aa3d22c9bc5c8d9c9f610af1 Author: Paolo Bonzini Date: Thu Feb 10 07:30:20 2022 -0500 KVM: x86/mmu: constify uses of struct kvm_mmu_role_regs struct kvm_mmu_role_regs is computed just once and then accessed. Use const to make this clearer, even though the const fields of struct kvm_mmu_role_regs already prevent (or make it harder...) to modify the contents of the struct. Reviewed-by: David Matlack Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit daed87b8767c005cb2b385c80e265edf82a2f64b Author: Paolo Bonzini Date: Thu Feb 10 07:30:08 2022 -0500 KVM: x86/mmu: nested EPT cannot be used in SMM The role.base.smm flag is always zero when setting up shadow EPT, do not bother copying it over from vcpu->arch.root_mmu. Reviewed-by: David Matlack Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 8b9e74bfbf8c7020498a9ea600bd4c0f1915134d Author: Sean Christopherson Date: Wed Apr 20 00:27:47 2022 +0000 KVM: x86/mmu: Use enable_mmio_caching to track if MMIO caching is enabled Clear enable_mmio_caching if hardware can't support MMIO caching and use the dedicated flag to detect if MMIO caching is enabled instead of assuming shadow_mmio_value==0 means MMIO caching is disabled. TDX will use a zero value even when caching is enabled, and is_mmio_spte() isn't so hot that it needs to avoid an extra memory access, i.e. there's no reason to be super clever. And the clever approach may not even be more performant, e.g. gcc-11 lands the extra check on a non-zero value inline, but puts the enable_mmio_caching out-of-line, i.e. avoids the few extra uops for non-MMIO SPTEs. Cc: Isaku Yamahata Cc: Kai Huang Signed-off-by: Sean Christopherson Message-Id: <20220420002747.3287931-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 65936229d35883a1637730e628c3c84d3600025d Author: Sean Christopherson Date: Fri Apr 15 00:49:09 2022 +0000 KVM: x86/mmu: Check for host MMIO exclusion from mem encrypt iff necessary When determining whether or not a SPTE needs to have SME/SEV's memory encryption flag set, do the moderately expensive host MMIO pfn check if and only if the memory encryption mask is non-zero. Note, KVM could further optimize the host MMIO checks by making a single call to kvm_is_mmio_pfn(), but the tdp_enabled path (for EPT's memtype handling) will likely be split out to a separate flow[*]. At that point, a better approach would be to shove the call to kvm_is_mmio_pfn() into VMX code so that AMD+NPT without SME doesn't get hit with an unnecessary lookup. [*] https://lkml.kernel.org/r/20220321224358.1305530-3-bgardon@google.com Signed-off-by: Sean Christopherson Message-Id: <20220415004909.2216670-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 296d5a17e793956f7b914336422043c939263409 Author: Babu Moger Date: Tue Apr 19 15:54:44 2022 -0500 KVM: SEV-ES: Use V_TSC_AUX if available instead of RDTSC/MSR_TSC_AUX intercepts The TSC_AUX virtualization feature allows AMD SEV-ES guests to securely use TSC_AUX (auxiliary time stamp counter data) in the RDTSCP and RDPID instructions. The TSC_AUX value is set using the WRMSR instruction to the TSC_AUX MSR (0xC0000103). It is read by the RDMSR, RDTSCP and RDPID instructions. If the read/write of the TSC_AUX MSR is intercepted, then RDTSCP and RDPID must also be intercepted when TSC_AUX virtualization is present. However, the RDPID instruction can't be intercepted. This means that when TSC_AUX virtualization is present, RDTSCP and TSC_AUX MSR read/write must not be intercepted for SEV-ES (or SEV-SNP) guests. Signed-off-by: Babu Moger Message-Id: <165040164424.1399644.13833277687385156344.stgit@bmoger-ubuntu> Signed-off-by: Paolo Bonzini commit f30903394eb62316dddea8801b357f5cec4df187 Author: Babu Moger Date: Tue Apr 19 15:53:52 2022 -0500 x86/cpufeatures: Add virtual TSC_AUX feature bit The TSC_AUX Virtualization feature allows AMD SEV-ES guests to securely use TSC_AUX (auxiliary time stamp counter data) MSR in RDTSCP and RDPID instructions. The TSC_AUX MSR is typically initialized to APIC ID or another unique identifier so that software can quickly associate returned TSC value with the logical processor. Add the feature bit and also include it in the kvm for detection. Signed-off-by: Babu Moger Acked-by: Borislav Petkov Message-Id: <165040157111.1399644.6123821125319995316.stgit@bmoger-ubuntu> Signed-off-by: Paolo Bonzini commit 71d7c575a673d42ad7175ad5fc27c85c80330311 Merge: 5d6c7de6446e9 44187235cbcc7 Author: Paolo Bonzini Date: Fri Apr 29 06:38:56 2022 -0400 Merge branch 'kvm-fixes-for-5.18-rc5' into HEAD Fixes for (relatively) old bugs, to be merged in both the -rc and next development trees. The merge reconciles the ABI fixes for KVM_EXIT_SYSTEM_EVENT between 5.18 and commit c24a950ec7d6 ("KVM, SEV: Add KVM_EXIT_SHUTDOWN metadata for SEV-ES", 2022-04-13). commit 756a615083315c9dc3b60c3b84c01427a082f1f8 Merge: 66727cdb250ec 1dd4b999dad2d Author: Mark Brown Date: Fri Apr 29 17:01:18 2022 +0100 ASoC: SOF: IPC Abstraction for FW loading Merge series from Ranjani Sridharan : This series introduces IPC abstraction for FW loading in the SOF driver in preparation for supporting the new IPC version in the SOF firmware. commit 2e29b9971ac54dec88baa58856a230ec2f2a2dff Author: Wan Jiabing Date: Tue Apr 26 19:30:53 2022 +0800 arm64/sme: Fix NULL check after kzalloc Fix following coccicheck error: ./arch/arm64/kernel/process.c:322:2-23: alloc with no test, possible model on line 326 Here should be dst->thread.sve_state. Fixes: 8bd7f91c03d8 ("arm64/sme: Implement traps and syscall handling for SME") Signed-off-by: Wan Jiabing Reviwed-by: Mark Brown Link: https://lore.kernel.org/r/20220426113054.630983-1-wanjiabing@vivo.com Signed-off-by: Catalin Marinas commit e918c10265ef2bc82ce8a6fed6d8123d09ec1db3 Author: Guilherme G. Piccoli Date: Wed Apr 27 19:48:59 2022 -0300 misc/pvpanic: Convert regular spinlock into trylock on panic path The pvpanic driver relies on panic notifiers to execute a callback on panic event. Such function is executed in atomic context - the panic function disables local IRQs, preemption and all other CPUs that aren't running the panic code. With that said, it's dangerous to use regular spinlocks in such path, as introduced by commit b3c0f8774668 ("misc/pvpanic: probe multiple instances"). This patch fixes that by replacing regular spinlocks with the trylock safer approach. It also fixes an old comment (about a long gone framebuffer code) and the notifier priority - we should execute hypervisor notifiers early, deferring this way the panic action to the hypervisor, as expected by the users that are setting up pvpanic. Fixes: b3c0f8774668 ("misc/pvpanic: probe multiple instances") Cc: Christophe JAILLET Cc: Mihai Carabas Cc: Shile Zhang Cc: Wang ShaoBo Cc: zhenwei pi Signed-off-by: Guilherme G. Piccoli Link: https://lore.kernel.org/r/20220427224924.592546-6-gpiccoli@igalia.com Signed-off-by: Greg Kroah-Hartman commit f8ae07f4b8bfde0f33761e1a1aaee45a4e85e9d6 Author: Russ Weight Date: Tue Apr 26 13:03:56 2022 -0700 firmware_loader: Move definitions from sysfs_upload.h to sysfs.h Move definitions required by sysfs.c from sysfs_upload.h to sysfs.h so that sysfs.c does not need to include sysfs_upload.h. Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220426200356.126085-3-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit bc187f6f8d12568413656e2e5b0d51a001e21915 Author: Russ Weight Date: Tue Apr 26 13:03:55 2022 -0700 firmware_loader: Fix configs for sysfs split Fix the CONFIGs around register_sysfs_loader(), unregister_sysfs_loader(), register_firmware_config_sysctl(), and unregister_firmware_config_sysctl(). The full definitions of the register_sysfs_loader() and unregister_sysfs_loader() functions should be used whenever CONFIG_FW_LOADER_SYSFS is defined. The register_firmware_config_sysctl() and unregister_firmware_config_sysctl() functions should be stubbed out unless CONFIG_FW_LOADER_USER_HELPER CONFIG_SYSCTL are both defined. Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220426200356.126085-2-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit a37ddddd86037c896c702b4df416bc4e51b2a5a0 Author: Russ Weight Date: Tue Apr 26 09:35:32 2022 -0700 selftests: firmware: Add firmware upload selftests Add selftests to verify the firmware upload mechanism. These test include simple firmware uploads as well as upload cancellation and error injection. The test creates three firmware devices and verifies that they all work correctly and independently. Tested-by: Matthew Gerlach Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220426163532.114961-1-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit a425e9802d029838660edd898667f8da6c64b030 Author: Minghao Chi Date: Fri Apr 29 09:02:08 2022 +0000 drm/vc4: simplify the return expression of vc4_grab_bin_bo() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220429090208.3852879-1-chi.minghao@zte.com.cn commit f2a28a83f6c42f716f44b33e8a8acb718187b09f Author: Minghao Chi Date: Fri Apr 29 05:49:45 2022 +0000 drm/vc4: simplify the return expression of vc4_prepare_fb() Simplify the return expression. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220429054945.3852039-1-chi.minghao@zte.com.cn commit 37f67d390d160f4bf6bde76e5113acfc004ee96a Author: Dan Carpenter Date: Thu Apr 28 15:26:23 2022 +0300 drm/sun4i: dsi: delete unnecessary IS_ERR() checks The "dsi->bus_clk" pointer cannot be an error pointer at this point. The check is confusing and unnecessary. Delete it. Signed-off-by: Dan Carpenter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/YmqH71MtoGn2AXUg@kili commit f3f3bdbd58cea4fdd088075fdc8864fc47ecd419 Author: Sudeep Holla Date: Fri Apr 29 12:39:46 2022 +0100 tee: optee: Use ffa_dev_get_drvdata to fetch driver_data Due to lack of an helper like ffa_dev_get_drvdata, this driver was fetching driver_data directly accessing the structure member. Now that we have added an helper, just use the same instead. Link: https://lore.kernel.org/r/20220429113946.2087145-4-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 498af8d1678ae2351218337b47bbf3cb0fc16821 Author: Sudeep Holla Date: Fri Apr 29 12:39:45 2022 +0100 firmware: arm_ffa: Add ffa_dev_get_drvdata helper function Add a helper function to fetch ffa_dev's driver_data using dev_get_drvdata. At the same time move existing ffa_dev_set_drvdata to use dev_set_drvdata. Link: https://lore.kernel.org/r/20220429113946.2087145-3-sudeep.holla@arm.com Suggested-by: Arunachalam Ganapathy Signed-off-by: Sudeep Holla commit 00512d2930b338fdd42bd90bbd1793fe212c2d31 Author: Sudeep Holla Date: Fri Apr 29 12:39:44 2022 +0100 firmware: arm_ffa: Remove incorrect assignment of driver_data The ffa core driver currently assigns its own driver information to individual ffa device driver_data which is wrong. Firstly, it leaks this core driver information to individual ffa_device and hence to ffa_driver. Secondly the ffa_device driver_data is for use by individual ffa_driver and not for this core driver managing all those devices. Link: https://lore.kernel.org/r/20220429113946.2087145-2-sudeep.holla@arm.com Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions") Signed-off-by: Sudeep Holla commit f3c45c045e25ed52461829d2ce07954f72b6ad15 Author: Sudeep Holla Date: Fri Apr 29 12:39:43 2022 +0100 firmware: arm_ffa: Fix uuid parameter to ffa_partition_probe While we pass uuid_null intentionally to ffa_partition_probe in ffa_setup_partitions to get the count of the partitions, it must not be uuid_null in ffa_partition_info_get which is used by the ffa_drivers to fetch the specific partition info passing the UUID of the partition. Fix ffa_partition_info_get by passing the received uuid down to ffa_partition_probe so that the correct partition information is fetched. Link: https://lore.kernel.org/r/20220429113946.2087145-1-sudeep.holla@arm.com Fixes: d0c0bce83122 ("firmware: arm_ffa: Setup in-kernel users of FFA partitions") Reported-by: Arunachalam Ganapathy Signed-off-by: Sudeep Holla commit cebdc5349fba7ba9a76a756d35997d010cd1aac2 Author: Haowen Bai Date: Thu Apr 21 09:43:13 2022 +0800 firmware: edd: Remove redundant condition The logic (!A || (A && B)) is equivalent to (!A || B). so we have to make code clear. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650505393-19398-1-git-send-email-baihaowen@meizu.com Reviewed-by: Griffin Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 66727cdb250ec5d3f42558e33ace5c7d0fbd9477 Author: YC Hung Date: Thu Jan 6 14:48:48 2022 +0800 ASoC: dsp: mediatek: add mt8195 dsp document This patch adds mt8195 dsp document. The dsp is used for Sound Open Firmware driver node. It includes registers, clocks, memory regions, and mailbox for dsp. Signed-off-by: yc.hung Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220106064847.15588-1-yc.hung@mediatek.com Signed-off-by: Mark Brown commit 9030a9e571b3ba250d3d450a98310e3c74ecaff4 Author: Marek Vasut Date: Thu Apr 28 23:31:32 2022 +0200 drm/bridge: tc358767: Fix (e)DP bridge endpoint parsing in dedicated function Per toshiba,tc358767.yaml DT binding document, port@2 the output (e)DP port is optional. In case this port is not described in DT, the bridge driver operates in DPI-to-DP mode. The drm_of_find_panel_or_bridge() call in tc_probe_edp_bridge_endpoint() returns -ENODEV in case port@2 is not present in DT and this specific return value is incorrectly propagated outside of tc_probe_edp_bridge_endpoint() function. All other error values must be propagated and are propagated correctly. Return 0 in case the port@2 is missing instead, that reinstates the original behavior before the commit this patch fixes. Fixes: 8478095a8c4b ("drm/bridge: tc358767: Move (e)DP bridge endpoint parsing into dedicated function") Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Marek Vasut Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg Reviewed-by: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20220428213132.447890-1-marex@denx.de commit eee645eccfc4edc9fb7dcef1b381e406c5dd4d14 Author: Baochen Qiang Date: Fri Apr 29 09:09:25 2022 +0300 ath11k: Don't use GFP_KERNEL in atomic context We are seeing below warning: ... kernel: [ 5720.362941] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:197 kernel: [ 5720.362943] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/4 kernel: [ 5720.362947] CPU: 4 PID: 0 Comm: swapper/4 Tainted: G W 5.10.90 #18 4fa489e3e5c16043994f416310c2f60eff666320 kernel: [ 5720.362949] Hardware name: Google Nipperkin/Nipperkin, BIOS Google_Nipperkin.14316.0.0 10/30/2021 kernel: [ 5720.362950] Call Trace: kernel: [ 5720.362953] kernel: [ 5720.362959] dump_stack+0x9c/0xe7 kernel: [ 5720.362964] ___might_sleep+0x14a/0x160 kernel: [ 5720.362967] kmem_cache_alloc+0x46/0x226 kernel: [ 5720.362970] ? __alloc_skb+0x6c/0x19e kernel: [ 5720.362972] __alloc_skb+0x6c/0x19e kernel: [ 5720.362985] cfg80211_gtk_rekey_notify+0xa2/0x21d [cfg80211 2c8b5aee0416e7d010d70c332a47990fc843c1c5] kernel: [ 5720.362995] ath11k_wmi_gtk_offload_status_event+0x102/0x155 [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838] kernel: [ 5720.363002] ath11k_wmi_tlv_op_rx+0x301/0x51b [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838] kernel: [ 5720.363009] ath11k_htc_rx_completion_handler+0xee/0x3f5 [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838] kernel: [ 5720.363017] ath11k_ce_per_engine_service+0x2aa/0x32c [ath11k 4c6bb5f7331c81199d56a7e37bdc10030f167838] kernel: [ 5720.363024] ath11k_pci_ce_tasklet+0x1a/0x30 [ath11k_pci 9acc399855ea172aa14a892c0bfdba0ce22d6f07] kernel: [ 5720.363028] tasklet_action_common+0x8d/0x9f kernel: [ 5720.363032] __do_softirq+0x163/0x29a kernel: [ 5720.363035] asm_call_irq_on_stack+0x12/0x20 kernel: [ 5720.363037] kernel: [ 5720.363041] do_softirq_own_stack+0x3c/0x48 kernel: [ 5720.363043] __irq_exit_rcu+0x9b/0x9d kernel: [ 5720.363046] common_interrupt+0xc9/0x14d kernel: [ 5720.363049] asm_common_interrupt+0x1e/0x40 kernel: [ 5720.363054] RIP: 0010:cpuidle_enter_state+0x1c5/0x2ac kernel: [ 5720.363056] Code: 84 f6 4c 8b 75 c0 74 1e 48 c7 45 c8 00 00 00 00 9c 8f 45 c8 0f ba 65 c8 09 0f 82 d1 00 00 00 31 ff e8 4a bb 6c ff fb 45 85 e4 <78> 47 44 89 e0 48 6b d0 68 49 8b 4c 16 48 48 2b 5d b8 49 89 5d 18 kernel: [ 5720.363058] RSP: 0018:ffffa7e640157e78 EFLAGS: 00000206 kernel: [ 5720.363060] RAX: ffff9807ddf29b40 RBX: 00000533e033584c RCX: 00000533e033584c kernel: [ 5720.363062] RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000000 kernel: [ 5720.363063] RBP: ffffa7e640157ec0 R08: 0000000000000002 R09: 00000533e171bb7a kernel: [ 5720.363064] R10: 0000000000000900 R11: fffffffffffffffe R12: 0000000000000003 kernel: [ 5720.363065] R13: ffff9804c2ef6000 R14: ffffffffbe9a7bd0 R15: 0000000000000003 kernel: [ 5720.363069] ? cpuidle_enter_state+0x19a/0x2ac kernel: [ 5720.363072] cpuidle_enter+0x2e/0x3d kernel: [ 5720.363074] do_idle+0x163/0x1ee kernel: [ 5720.363076] cpu_startup_entry+0x1d/0x1f kernel: [ 5720.363078] secondary_startup_64_no_verify+0xb1/0xbb ... This is because GFP_KERNEL is used by ath11k_wmi_gtk_offload_status_event while in atomic context. Fix it by using GFP_ATOMIC instead. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: a16d9b50cfba ("ath11k: support GTK rekey offload") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220427120033.1046759-1-quic_bqiang@quicinc.com commit dc6d04619e62825083926929d88c94c5b6b42670 Author: Markuss Broks Date: Fri Apr 29 15:09:14 2022 +0300 regulator: sm5703: Correct reference to the common regulator schema The correct file name is regulator.yaml, not regulators.yaml. Signed-off-by: Markuss Broks Link: https://lore.kernel.org/r/20220429120914.9928-1-markuss.broks@gmail.com Signed-off-by: Mark Brown commit bdc8cd505b5312c3b26f13f0b6a567d97d55e715 Author: Yang Yingliang Date: Tue Apr 26 21:25:39 2022 +0800 ASoC: SOF: sof-pci-dev: fix missing pci_release_regions() on error in sof_pci_probe() Fix the missing pci_release_regions() before return from sof_pci_probe() in the error handling case. Fixes: 4bfbbb76e82e ("ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220426132539.416676-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 1dd4b999dad2d8b8fce257e4c3c3d334a709c933 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:29 2022 -0700 ASoC: SOF: loader: Call optional query_fw_configuration on first boot Execute the firmware information query on the first boot if it is available. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 910bd536d3f72d9c39e5ec08e946c11f9bcdc532 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:28 2022 -0700 ASoC: SOF: loader: Remove snd_sof_parse_module_memcpy() as it is not used The snd_sof_parse_module_memcpy() is no longer used and we have the implementation of it in ipc3-loader.c which is a default mode to load module(s) with IPC3 if the snd_sof_load_firmware_memcpy() is used for loading the firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 77b677d139dbf53fec02e1cfe3cc593f5a5f080a Author: Peter Ujfalusi Date: Mon Apr 25 15:11:27 2022 -0700 ASoC: SOF: mediatek: mt8195: Do not set the load_module ops The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy. No need to set the callback for this platform. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit a22502fb61b2fdd9ba12e158590a29b6d35ae68a Author: Peter Ujfalusi Date: Mon Apr 25 15:11:26 2022 -0700 ASoC: SOF: Intel: bdw/byt/pci-tng: Do not set the load_module ops The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy. No need to set the callback for these platforms. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 499c55fe5f5e5c4d586777e6850f484c1ded3bb8 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:25 2022 -0700 ASoC: SOF: imx: Do not set the load_module ops The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy. No need to set the callback for iMX. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 0da5f110c583551b39471ecedc3fba704c7362a5 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:24 2022 -0700 ASoC: SOF: amd: renoir: Do not set the load_module ops The used firmware loader (snd_sof_load_firmware_memcpy) can use the generic module loading, which is by default uses the same implementation as the snd_sof_parse_module_memcpy. No need to set the callback for this platform. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 143cdcf1780eae05c33184380987d29682ac1ad6 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:23 2022 -0700 ASoC: SOF: loader: Switch to use the fw_loader ops Since we have the fw_loader ops implementation for IPC3, we can start using it and remove most of the IPC dependent code from the file. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 2a6099a73c943130c6f864c2df9c5607d25f6b6b Author: Peter Ujfalusi Date: Mon Apr 25 15:11:22 2022 -0700 ASoC: SOF: ipc: Add check for fw_loader ops Add checks for the mandatory fw_loader ops. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit d2458baa799fff377660d86323dd20a3f4deecb4 Author: Peter Ujfalusi Date: Mon Apr 25 15:11:21 2022 -0700 ASoC: SOF: ipc3-loader: Implement firmware parsing and loading Add the IPC3 dependent implementation of validating the firmware image, parsing the ext manifest and to load modules via memcpy. The code introduced by this commit is the IPC dependent code from the loader.c, which is going to be removed later. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 61bafd1c4571ceb9cdf1830a257eac873d0b68ee Author: Peter Ujfalusi Date: Mon Apr 25 15:11:20 2022 -0700 ASoC: SOF: Introduce IPC dependent ops for firmware handling, loading The parsing and loading of firmware modules/components are IPC dependent operations as the organization of the firmware depends on the IPC it is supporting. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220425221129.124615-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 66344c6d92113e605d8212e79b1219406893ee05 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:43 2022 -0700 ASoC: SOF: Add a prepare op to IPC topology widget ops In order to set up a pipeline with IPC4, the total memory usage for the pipeline needs to be calculated based on the list of connected widgets. Add a new ipc_prepare() op to struct sof_ipc_tplg_widget_ops that will be used to calculate the memory usage for each widget in the pipelines associated with a PCM and prepare the widget for getting set up in the DSP. The prepare step will be used to allocate memory for the IPC payload, assign instance ID and update the config data for the widget based on the runtime PCM params. Once prepared, the setup step is used to send the IPC to create the widget in the DSP. Add an ipc_unprepare() op to unprepare the widget i.e free the memory allocated during prepare, free the instance ID etc. This should be invoked after the widget is freed. A new flag "prepared" is added to struct snd_sof_widget to track the prepared status of widgets. Also, IPC4 requires the platform_params and the runtime PCM params in order to prepare a widget for set up. So modify the signature of sof_pcm_setup_connected_widgets() and sof_widget_list_setup() to accept these as arguments. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426171743.171061-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 463a809ba8efa127484d16ff588e3bcdb63fe41e Author: Ranjani Sridharan Date: Tue Apr 26 10:17:42 2022 -0700 ASoC: SOF: clarify use of widget complete flag Currently, the complete flag is used only for the snd_soc_dapm_scheduler type widgets to indicate that the pipeline has been set up. All other widgets do not need it. Add a comment to clarify its usage and set the complete flag to false only for the scheduler widget in sof_widget_free(). Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426171743.171061-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit a5ba725e9dc928832ba97a4418e36fef8d0244c6 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:41 2022 -0700 ASoC: SOF: topology: Skip parsing DAI link tokens if not needed Do not parse these tokens if they are not defined in the IPC version specific token list. In the case of IPC4 with HDA topologies for example, no DAI link specific tokens need to be added in topology. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit f18ad9caa0dfeb12cb386777b1130c5fba9a0079 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:40 2022 -0700 ASoC: SOF: pcm: remove unnecessary function declaration sof_pcm_setup_connected_widgets() can be a static function in pcm.c. No need to declare it in the header. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 36cbc9df3faca01500480acdda016222663da761 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:39 2022 -0700 ASoC: SOF: Add two new fields to struct snd_sof_widget Add two new fields, instance_id and module_info to struct snd_sof_widget. instance_id for widgets will be assigned when they are set up in the DSP and reset when the widgets are freed. module_info is used to save information the firmware provides about each module in its manifest. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit d77d7795547ae8e2ed23d1ce835b539ee1d794bb Author: Ranjani Sridharan Date: Tue Apr 26 10:17:38 2022 -0700 ASoC: SOF: Add a route_free op in struct sof_ipc_tplg_ops IPC4 requires that the widgets be unbound in the firmware before they are freed. So add a new op in struct sof_ipc_tplg_ops that will be used to send the IPC to the firmware to unbind widgets. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 7b3a5be546a131f806fa015d1c78987daf1eb5c9 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:37 2022 -0700 ASoC: SOF: expose a couple of functions Expose the mixer_to_ipc() and ipc_to_mixer() functions for reuse in IPC4. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit f0d31dbb3fc44ac9cb0d9991cc0a629c88e80ac8 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:36 2022 -0700 ASoC: SOF: pcm: Move the call to snd_sof_pcm_platform_hw_params() IPC4 requires the platform_params be passed when invoking sof_pcm_setup_connected_widgets(). So move the call to snd_sof_pcm_platform_hw_params() before calling sof_pcm_setup_connected_widgets(). This has no functional impact. sof_pcm_setup_connected_widgets will be modified in the follow up patches to accept the platform params as an argument. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 5da0590a090b096279227cf2b044b1ef9b9c6c1b Author: Ranjani Sridharan Date: Tue Apr 26 10:17:35 2022 -0700 ASoC: SOF: sof-audio: Set up widgets from source to sink For IPC3, the order of setting up the widgets associated with a PCM doesn't matter. But for IPC4, widgets must be set up from the source to the sink in order. In order to accommodate this, change the sof_widget_list_setup/free() functions to set up/free widgets starting with the source widget all the way to the sink widget for all pipelines. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220426171743.171061-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 33a3facdf8ccf1b777ef0c39841425ca8d8d4a40 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:34 2022 -0700 ASoC: SOF: sof-audio: reset route status before freeing widget This is in preparation for IPC4 which requires that the route be reset before the widget is freed. For IPC3, there is nothing more to be done other than setting the route status. So it is OK to be moved before the widget is freed. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220426171743.171061-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 48d2a1ceae03610a431535aca9106eab4201b191 Author: Ranjani Sridharan Date: Tue Apr 26 10:17:33 2022 -0700 ASoC: SOF: Add a new op to set up volume table Add a new op set_up_volume_table for control IPC ops. Define and set the op for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220426171743.171061-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 17edb8e1e325cbd10ec41f1524869870953ed1a8 Author: Jani Nikula Date: Tue Apr 26 12:19:13 2022 +0300 drm/edid: drop kernel-doc for static functions Drop the kernel-doc for static functions, it's excessive, but retain the info in plain comments. Signed-off-by: Jani Nikula Reviewed-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20220426091913.1339941-2-jani.nikula@intel.com commit 5d96fc9c9e2ac8a4c78959286e1ec890ad340fc4 Author: Jani Nikula Date: Tue Apr 26 12:19:12 2022 +0300 drm/edid: fix kernel-doc parameter name mismatches Fix the below drm/edid kernel-doc warnings: drivers/gpu/drm/drm_edid.c:1589: warning: Function parameter or member '_edid' not described in 'drm_edid_header_is_valid' drivers/gpu/drm/drm_edid.c:1589: warning: Excess function parameter 'raw_edid' description in 'drm_edid_header_is_valid' drivers/gpu/drm/drm_edid.c:1737: warning: Function parameter or member '_block' not described in 'drm_edid_block_valid' drivers/gpu/drm/drm_edid.c:1737: warning: Excess function parameter 'raw_edid' description in 'drm_edid_block_valid' drivers/gpu/drm/drm_edid.c:2136: warning: Function parameter or member 'read_block' not described in 'drm_do_get_edid' drivers/gpu/drm/drm_edid.c:2136: warning: Function parameter or member 'context' not described in 'drm_do_get_edid' drivers/gpu/drm/drm_edid.c:2136: warning: Excess function parameter 'get_edid_block' description in 'drm_do_get_edid' drivers/gpu/drm/drm_edid.c:2136: warning: Excess function parameter 'data' description in 'drm_do_get_edid' Reported-by: Stephen Rothwell References: https://lore.kernel.org/r/20220406154431.567414c3@canb.auug.org.au References: https://lore.kernel.org/r/20220420162431.2b28ddea@canb.auug.org.au Signed-off-by: Jani Nikula Reviewed-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20220426091913.1339941-1-jani.nikula@intel.com commit 17d49e6e8012a9e30f8aab7af82f6a14ca25afaf Merge: 5da66099d6e28 4bb0c7f09a196 Author: David S. Miller Date: Fri Apr 29 11:57:01 2022 +0100 Merge branch 'remove-NAPI_POLL_WEIGHT-copies' Merge branch 'remove-NAPI_POLL_WEIGHT-copies' Jakub Kicinski says: ==================== remove copies of the NAPI_POLL_WEIGHT define netif_napi_add() takes weight as the last argument. The value of that parameter is hard to come up with and depends on many factors, so driver authors are encouraged to use NAPI_POLL_WEIGHT. We should probably move weight to an "advanced" version of the API (__netif_napi_add()?) and simplify the life of most driver authors. In preparation for such API changes this series removes local defines equivalent to NAPI_POLL_WEIGHT from drivers, so that a simple coccinelle / spatch script does not get thrown off by them. v2: - drop staging bits (patch 2) - fix subject (patch 8) - add qeth change (patch 15) ==================== Signed-off-by: David S. Miller commit 4bb0c7f09a1962330e9edf5dd6cfe44113aeee45 Author: Jakub Kicinski Date: Thu Apr 28 14:23:23 2022 -0700 qeth: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Acked-by: Alexandra Winter Signed-off-by: David S. Miller commit e9c6ec6510301285647d0a1357ce49ab07ccd4ef Author: Jakub Kicinski Date: Thu Apr 28 14:23:22 2022 -0700 eth: velocity: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 26450aa7ca4266444e89d065766f8d8b98e277ff Author: Jakub Kicinski Date: Thu Apr 28 14:23:21 2022 -0700 eth: spider: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Acked-by: Geoff Levand Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 288696565f2d2f04ad7eddd599aa113422b96613 Author: Jakub Kicinski Date: Thu Apr 28 14:23:20 2022 -0700 eth: vxge: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit bbbe6ecbc36d55e0ac49251f52f3ccffa51ec32a Author: Jakub Kicinski Date: Thu Apr 28 14:23:19 2022 -0700 eth: gfar: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit e702def527ecdeabe0c8a302db0370161892d740 Author: Jakub Kicinski Date: Thu Apr 28 14:23:18 2022 -0700 eth: benet: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0258f5399f0cba31933be07cf222f084999fa94e Author: Jakub Kicinski Date: Thu Apr 28 14:23:17 2022 -0700 eth: atlantic: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 592df366378963669a7e561f58b23564193a230d Author: Jakub Kicinski Date: Thu Apr 28 14:23:16 2022 -0700 net: bgmac: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit b3c2b61ef621d3b31ea3ccc7811b0c8c07f28970 Author: Jakub Kicinski Date: Thu Apr 28 14:23:15 2022 -0700 slic: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Acked-by: Lino Sanfilippo Signed-off-by: David S. Miller commit f130683b1e24292cb99f46653b7f6799c318f7ec Author: Jakub Kicinski Date: Thu Apr 28 14:23:14 2022 -0700 usb: lan78xx: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 889e3691b9d6573de133da1f5e78f590e52152cd Author: Jakub Kicinski Date: Thu Apr 28 14:23:13 2022 -0700 eth: mtk_eth_soc: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit feda771f1b9ec7a0f6d957d280a8ccf571351b46 Author: Jakub Kicinski Date: Thu Apr 28 14:23:12 2022 -0700 eth: pch_gbe: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Reviewed-by: Andy Shevchenko Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 055e13f31f283bb7f672ba95dd457f04deb77dcf Author: Jakub Kicinski Date: Thu Apr 28 14:23:11 2022 -0700 eth: cpsw: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit e2a303295d28070cd602f3355d007b9222aa6683 Author: Jakub Kicinski Date: Thu Apr 28 14:23:10 2022 -0700 eth: smsc: remove a copy of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5f012b40ef639343a976553bf3cc26dd0474756e Author: Jakub Kicinski Date: Thu Apr 28 14:23:09 2022 -0700 eth: remove copies of the NAPI_POLL_WEIGHT define Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Drop the special defines in a bunch of drivers where the removal is relatively simple so grouping into one patch does not impact reviewability. Signed-off-by: Jakub Kicinski Reviewed-by: Paul Durrant Signed-off-by: David S. Miller commit 0ab55cf1834177a2162757fee2ac3cb6730beb20 Author: Yoshihiro Shimoda Date: Thu Apr 28 22:50:56 2022 +0900 clk: renesas: cpg-mssr: Add support for R-Car V4H Initial CPG support for R-Car V4H (r8a779g0). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220428135058.597586-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit d1fcd661ba7fe4d487f2deafe708fd2306e0493f Merge: 7f906eaa95f38 f2afa78d5a0c0 Author: Geert Uytterhoeven Date: Fri Apr 29 12:23:34 2022 +0200 Merge tag 'renesas-r8a779g0-dt-binding-defs-tag' into renesas-clk-for-v5.19 Renesas R-Car V4H DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car V4H (R8A779G0) SoC, shared by driver and DT source files. commit a4744a1de601e86d2c78cb8c5a1c40d25117a97d Merge: 3f67af66e65ba f2afa78d5a0c0 Author: Geert Uytterhoeven Date: Fri Apr 29 12:22:36 2022 +0200 Merge tag 'renesas-r8a779g0-dt-binding-defs-tag' into renesas-arm-dt-for-v5.19 Renesas R-Car V4H DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car V4H (R8A779G0) SoC, shared by driver and DT source files. commit 7f906eaa95f38fae24957e0bf61878d5cb3f8847 Author: Yoshihiro Shimoda Date: Mon Apr 25 15:41:58 2022 +0900 clk: renesas: rcar-gen4: Add CLK_TYPE_GEN4_PLL4 R-Car V4H (r8a779g0) has PLL4 so that add CLK_TYPE_GEN4_PLL4. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220425064201.459633-5-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 608a0b46bc7c421bb07dc36c0598a5163cdc06f1 Merge: 0be0b70df6611 5644b66a9c63c Author: Andy Shevchenko Date: Fri Apr 29 13:02:02 2022 +0300 Merge branch 'irq/gpio-immutable' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into intel/pinctrl Signed-off-by: Andy Shevchenko commit 119125d96b8bb31d95345738e4827998115d70c9 Merge: 1bc4ae0ccbc66 419f8299ddad6 Author: Jani Nikula Date: Fri Apr 29 12:58:40 2022 +0300 Merge tag 'gvt-next-2022-04-29' of https://github.com/intel/gvt-linux into drm-intel-next gvt-next-2022-04-29 Introduce fixes from previous pull. - Fix a compiling warning of non-static funtion only having one caller. - Fix a potential NULL pointer reference in the code re-factor. - Fix a compiling error when CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n Signed-off-by: Jani Nikula From: "Wang, Zhi A" Link: https://patchwork.freedesktop.org/patch/msgid/9c2fc678-2e6e-a9d5-a540-2a6bfda31196@intel.com commit 815fad6e4f9c7dcd3336b989d84ee02fd912d29e Author: Tom Rix Date: Thu Apr 21 09:53:19 2022 -0400 EDAC/ghes: Change ghes_hw from global to static Smatch reports this issue ghes_edac.c:44:3: warning: symbol 'ghes_hw' was not declared. Should it be static? ghes_hw is used only in ghes_edac.c so change its storage-class specifier to static. Signed-off-by: Tom Rix Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220421135319.1508754-1-trix@redhat.com commit 5dddb41692849594862473e4ddf57fb52e1249d6 Author: Heikki Krogerus Date: Mon Apr 18 17:59:32 2022 +0000 thunderbolt: Link USB4 ports to their USB Type-C connectors Creating a symlink pointing to the correct USB Type-C connector for the on-board USB4 ports when they are created. The link will be created only if the firmware is able to describe the connection between the port and its connector. Signed-off-by: Heikki Krogerus Signed-off-by: Won Chung Signed-off-by: Mika Westerberg commit 84d4333c1e28cedfad37c5347b4a94a3565a454f Author: Won Chung Date: Mon Apr 18 17:59:31 2022 +0000 misc/mei: Add NULL check to component match callback functions Currently, component_match callback functions used in mei refers to the driver name, assuming that the component device being matched has a driver bound. It can cause a NULL pointer dereference when a device without a driver bound registers a component. This is due to the nature of the component framework where all registered components are matched in any component_match callback functions. So even if a component is registered by a totally irrelevant device, that component is also shared to these callbacks for i915 driver. To prevent totally irrelevant device being matched for i915 and causing a NULL pointer dereference for checking driver name, add a NULL check on dev->driver to check if there is a driver bound before checking the driver name. In the future, the string compare on the driver name, "i915" may need to be refactored too. Reviewed-by: Heikki Krogerus Reviewed-by: Prashant Malani Signed-off-by: Won Chung Acked-by: Tomas Winkler Signed-off-by: Mika Westerberg commit 2f58783c5d8882273eb0c872d19bb89954d466e8 Author: Lv Ruyi Date: Thu Apr 21 08:46:21 2022 +0000 EDAC/armada_xp: Use devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Make the code simpler without functional changes. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Borislav Petkov Reviewed-by: Jan Luebbe Link: https://lore.kernel.org/r/20220421084621.2615517-1-lv.ruyi@zte.com.cn commit 97956dd278d3af1b5657026b992b54cf2e1b50b9 Author: Dietmar Eggemann Date: Thu Apr 28 15:43:38 2022 +0100 sched/fair: Remove cfs_rq_tg_path() cfs_rq_tg_path() is used by a tracepoint-to traceevent (tp-2-te) converter to format the path of a taskgroup or autogroup respectively. It doesn't have any in-kernel users after the removal of the sched_trace_cfs_rq_path() helper function. cfs_rq_tg_path() can be coded in a tp-2-te converter. Remove it from kernel/sched/fair.c. Signed-off-by: Dietmar Eggemann Signed-off-by: Qais Yousef Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220428144338.479094-3-qais.yousef@arm.com commit 50e7b416d2ab10b9771bd00a4d85df90ad2e4b37 Author: Dietmar Eggemann Date: Thu Apr 28 15:43:37 2022 +0100 sched/fair: Remove sched_trace_*() helper functions We no longer need them as we can use DWARF debug info or BTF + pahole to re-generate the required structs to compile against them for a given kernel. This moves the burden of maintaining these helper functions to the module. https://github.com/qais-yousef/sched_tp Note that pahole v1.15 is required at least for using DWARF. And for BTF v1.23 which is not yet released will be required. There's alignment problem that will lead to crashes in earlier versions when used with BTF. We should have enough infrastructure to make these helper functions now obsolete, so remove them. [Rewrote commit message to reflect the new alternative] Signed-off-by: Dietmar Eggemann Signed-off-by: Qais Yousef Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220428144338.479094-2-qais.yousef@arm.com commit 4e3c7d338a2260406ae22eaf6d77b639d59bdc7e Author: Dietmar Eggemann Date: Fri Mar 18 17:36:56 2022 +0100 sched/fair: Refactor cpu_util_without() Except the 'task has no contribution or is new' condition at the beginning of cpu_util_without(), which it shares with the load and runnable counterpart functions, a cpu_util_next(..., dst_cpu = -1) call can replace the rest of it. The UTIL_EST specific check that task util_est has to be subtracted from the CPU one in case of an enqueued (or current (to cater for the wakeup - lb race)) task has to be moved to cpu_util_next(). This was initially introduced by commit c469933e7721 ("sched/fair: Fix cpu_util_wake() for 'execl' type workloads"). UnixBench's `execl` throughput tests were run on the dual socket 40 CPUs Intel E5-2690 v2 to make sure it doesn't regress again. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220318163656.954440-1-dietmar.eggemann@arm.com commit 000b99e5ed1c9e33c14f3582474ae55cd739ae8d Author: Ashish Mhetre Date: Tue Apr 26 13:08:27 2022 +0530 arm64: tegra: Add memory controller channels From tegra186 onwards, memory controller support multiple channels. During the error interrupts from memory controller, corresponding channels need to be accessed for logging error info and clearing the interrupt. So add address and size of these channels in device tree node of tegra186, tegra194 and tegra234 memory controller. Also add reg-names for each of these reg items which are used by driver for mapping. Signed-off-by: Ashish Mhetre Signed-off-by: Thierry Reding commit e2ab93e59bc3c029b61a7091825f193f1a66a1a1 Author: Ashish Mhetre Date: Tue Apr 26 13:08:26 2022 +0530 dt-bindings: memory: tegra: Update validation for reg and reg-names From Tegra186 onwards, memory controller support multiple channels. "reg" items are updated with address and size of these channels. Tegra186 has overall 5 memory controller channels. Tegra194 and Tegra234 have overall 17 memory controller channels each. There is one "reg" entry for memory controller stream-ID registers. So update the "reg" property's "minItems" and "maxItems" accordingly in the Tegra186 devicetree documentation. Also update validation for "reg-names" added for these corresponding "reg" items. ABI change due to new bindings is intended but backward compatibility is preserved in driver. Reviewed-by: Rob Herring Signed-off-by: Ashish Mhetre Signed-off-by: Thierry Reding commit b2aa405e89a4025642ba53897bb7b9ef5de210a9 Author: Javier Martinez Canillas Date: Thu Apr 28 10:22:44 2022 +0200 drm/display: Select DP helper for DRM_DP_AUX_CHARDEV and DRM_DP_CEC The DRM_DP_AUX_CHARDEV and DRM_DP_CEC Kconfig symbols enable code that use DP helper functions, that are only present if CONFIG_DRM_DISPLAY_DP_HELPER is also enabled. But these don't select the DRM_DISPLAY_DP_HELPER symbol, meaning that it is possible to enable any of them without CONFIG_DRM_DISPLAY_DP_HELPER. That will lead to the following linking errors with the mentioned config: LD vmlinux.o MODPOST vmlinux.symvers MODINFO modules.builtin.modinfo GEN modules.builtin LD .tmp_vmlinux.kallsyms1 KSYMS .tmp_vmlinux.kallsyms1.S AS .tmp_vmlinux.kallsyms1.S LD .tmp_vmlinux.kallsyms2 KSYMS .tmp_vmlinux.kallsyms2.S AS .tmp_vmlinux.kallsyms2.S LD vmlinux SYSMAP System.map SORTTAB vmlinux OBJCOPY arch/arm64/boot/Image MODPOST modules-only.symvers ERROR: modpost: "drm_dp_dpcd_write" [drivers/gpu/drm/display/drm_display_helper.ko] undefined! ERROR: modpost: "drm_dp_read_desc" [drivers/gpu/drm/display/drm_display_helper.ko] undefined! ERROR: modpost: "drm_dp_dpcd_read" [drivers/gpu/drm/display/drm_display_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:134: modules-only.symvers] Error 1 make[1]: *** Deleting file 'modules-only.symvers' make: *** [Makefile:1749: modules] Error 2 Besides making these symbols to select CONFIG_DRM_DISPLAY_DP_HELPER, make them to depend on DRM_DISPLAY_HELPER, since can't be enabled without it. Note: It seems this has been an issue for a long time but was made easier to reproduce after the commit 1e0f66420b13 ("drm/display: Introduce a DRM display-helper module"). Adding a Fixes: tag just to make sure that this fix will be picked for stable once the mentioned change also lands there. Fixes: 1e0f66420b13 ("drm/display: Introduce a DRM display-helper module") Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220428082244.390859-1-javierm@redhat.com commit 766475cb526b2fc5ca21374b5810d6d8557870fc Author: Arnd Bergmann Date: Thu Apr 28 12:28:59 2022 +0200 ARM: omap1: add back omap_set_dma_priority() stub One of my multiplatform patches went a little too far and removed a declaration that is needed for compile-testing the omapfb driver on non-OMAP1 platforms: arm-linux-gnueabi-ld: drivers/video/fbdev/omap/omapfb_main.o: in function `omapfb_do_probe': omapfb_main.c:(.text+0x41ec): undefined reference to `omap_set_dma_priority' Add back the inline stub, and in turn hide the definition when omapfb is disabled, like we do for the usb specific bits. Reported-by: kernel test robot Reviewed-by: Tony Lindgren Fixes: 52ef8efcb75e ("dma: omap: hide legacy interface") Signed-off-by: Arnd Bergmann commit e514f1fd09b6f966f5f55220fdc4fb8a2efc0d6a Author: Arnd Bergmann Date: Thu Apr 28 11:11:35 2022 +0200 ARM: omap: fix missing declaration warnings Moving the plat-omap files triggered a sparse warning for omap1 and omap2 that is now in a different file from before. Found some more sparse warnings here that I address by making sure the declaration is visible to both the caller and the callee, or they are static mach-omap1/fb.c:33:17: warning: symbol 'omap_fb_resources' was not declared. Should it be static? mach-omap1/timer32k.c:215:12: warning: symbol 'omap_init_clocksource_32k' was not declared. Should it be static? mach-omap1/i2c.c:36:12: warning: symbol 'omap_i2c_add_bus' was not declared. Should it be static? mach-omap1/i2c.c:115:12: warning: symbol 'omap_register_i2c_bus_cmdline' was not declared. Should it be static? mach-omap1/i2c.c:140:12: warning: symbol 'omap_register_i2c_bus' was not declared. Should it be static? mach-omap2/dma.c:180:34: warning: symbol 'dma_plat_info' was not declared. Should it be static? mach-omap2/omap4-common.c:116:6: warning: symbol 'omap_interconnect_sync' was not declared. Should it be static? mach-omap2/omap-iommu.c:113:5: warning: symbol 'omap_iommu_set_pwrdm_constraint' was not declared. Should it be static? Reported-by: kernel test robot Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit deb44711675efa923ee8cebc0c5730d6f5905b32 Author: Arnd Bergmann Date: Thu Apr 28 11:08:16 2022 +0200 ARM: omap: fix address space warnings from sparse Moving sram code from plat-omap got the attention of the kernel test robot. I found a few more places with related warnings because the sram references are a mix of kernel pointers and __iomem pointers: mach-omap1/sram-init.c:56:17: warning: cast removes address space '__iomem' of expression mach-omap1/board-ams-delta.c:667:9: warning: incorrect type in argument 1 (different base types) mach-omap2/sram.c:78:17: warning: cast removes address space '__iomem' of expression mach-omap2/omap4-common.c:142:27: warning: incorrect type in assignment (different address spaces) mach-omap2/omap4-common.c:142:27: expected void [noderef] __iomem *static [toplevel] sram_sync mach-omap2/omap4-common.c:142:27: got void * mach-omap2/pm34xx.c:113:45: warning: incorrect type in argument 1 (different address spaces) mach-omap2/pm34xx.c:113:45: expected void [noderef] __iomem *save_regs mach-omap2/pm34xx.c:113:45: got void *extern [addressable] [toplevel] omap3_secure_ram_storage There is no good solution here, as sram is a bit special in this regard. Change the annotations to at least shut up the warnings. Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit c164620ae2f4d7b31023fd79445063f0f5cc9471 Author: Arnd Bergmann Date: Thu Apr 28 09:44:23 2022 +0200 ARM: spear: remove include/mach/ subdirectory Two of the remaining four headers are never used, the other two are only used inside of the platform code. Move them next to the files that include them and remove the Makefile trick that adds the include path. Acked-by: Viresh Kumar Signed-off-by: Arnd Bergmann commit ca31807b8506d261c884f152fc434a9dd7ccdf42 Author: Arnd Bergmann Date: Thu Apr 28 09:32:09 2022 +0200 ARM: davinci: remove include/mach/ subdirectory The files in include/mach are only used from mach/davinci, so they are no longer needed in the traditional location. Move them to arch/arm/mach-davinci/ and drop the logic for the special include path. The mach/uncompress.h file is not used at all and can just be removed. Signed-off-by: Arnd Bergmann commit 6d9230edf08ff633c377ad6c61c65dc69f577cad Author: Arnd Bergmann Date: Thu Apr 28 09:23:52 2022 +0200 ARM: omap2: remove include/mach/ subdirectory mach/serial.h is only included from arch/arm/mach-omap2/serial.h, and the other two files are unused and empty. Remove the directory by relocating the contents of mach/serial.h and dropping all other references. Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 3f67af66e65baf88da482b6327c53c742b949d15 Author: Biju Das Date: Mon Apr 25 18:05:30 2022 +0100 arm64: dts: renesas: rzg2ul-smarc-som: Enable watchdog Enable watchdog{0,2} interfaces on RZ/G2UL SMARC EVK. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-14-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0b3e18dbcdf6ec80d22d76d4c8099968704f7cf9 Author: Biju Das Date: Mon Apr 25 18:05:29 2022 +0100 arm64: dts: renesas: rzg2ul-smarc-som: Enable OSTM Enable OSTM{1, 2} interfaces on RZ/G2UL SMARC EVK. OSTM0 is reserved for TF-A. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-13-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 820e976909c2b286d1ef259ea524979540475ba6 Author: Biju Das Date: Mon Apr 25 18:05:28 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Enable CANFD Enable CANFD on RZ/G2UL SMARC platform. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-12-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b0fa698b834f0f8b4a0c9c5c086d88787f1124a0 Author: Biju Das Date: Mon Apr 25 18:05:24 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Enable i2c{0,1} and wm8978 Enable i2c{0,1} on RZ/G2UL SMARC EVK by deleting respective entries from board dts and adding pincontrol entries to the soc-pinctrl dtsi. Also enable wm8978 audio codec. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-8-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 165c79da163f9909aba8fad68b897148399a1ba5 Author: Alexander Shiyan Date: Wed Apr 27 11:19:14 2022 +0300 ARM: dts: am335x-myirtech: Update NAND default partition table layout This patch replaces the legacy partition table layout with a modern style. As an additional change, we are reserving space for three backup MLO entries and increasing space for the main bootloader. Signed-off-by: Alexander Shiyan Message-Id: <20220427081914.6773-2-eagle.alexander923@gmail.com> Signed-off-by: Tony Lindgren commit 97fab2004d11577dfe17aaaacdbf02093194dbb9 Author: Alexander Shiyan Date: Wed Apr 27 11:19:13 2022 +0300 ARM: dts: am335x-myirtech: Add an external clock oscillator for CPU RTC The CPU RTC has an external crystal, so to keep time, let's define it for devicetree. Signed-off-by: Alexander Shiyan Message-Id: <20220427081914.6773-1-eagle.alexander923@gmail.com> Signed-off-by: Tony Lindgren commit c024c46fe13bb9e9a70d044fd2d63dbee82bbb59 Author: Jayesh Choudhary Date: Tue Apr 12 13:20:08 2022 +0530 arm64: dts: ti: k3-am62: Add SA3UL ranges in cbass_main Add the address space for SA3UL to the ranges property of the cbass_main node. Signed-off-by: Jayesh Choudhary Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220412075008.10553-1-j-choudhary@ti.com commit 854fd9209b20837ab48c2e6714e5e44dd8ea33a2 Author: Roger Quadros Date: Tue Apr 26 11:26:11 2022 +0300 memory: omap-gpmc: Allow building as a module Allow OMAP_GPMC to be built as a module. When building this driver as a module, the symbol 'of_default_bus_match_table' will not be found as it is not being exported. The of_match_node() call is redundant anyways as of_platform_default_populate() already takes care of matching with 'of_default_bus_match_table'. So get rid of that call. This will also resolve the module build failure. Move compatible match table to the end where it is usually expected. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220426082611.24427-3-rogerq@kernel.org Signed-off-by: Krzysztof Kozlowski commit be34f45f0d4aa91c6b83d140f9ace1ca40a5f9dc Author: Roger Quadros Date: Tue Apr 26 11:26:10 2022 +0300 memory: omap-gpmc: Make OMAP_GPMC config visible and selectable So far for armv7 TI platforms, GPMC was being selected by arch/arm/mach-* architecture Kconfig files. For K3 platforms, GPMC is no longer required for basic boot and cannot be always enabled by default by mach- Kconfig. We need a way for user (or board defconfig) to enable it if required so make OMAP_GPMC Kconfig option always visible. Drop COMPILE_TEST as build fails if IRQ_DOMAIN is not enabled. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20220426082611.24427-2-rogerq@kernel.org Signed-off-by: Krzysztof Kozlowski commit bd7155a0282e2f4e14260c30272d6472253e6564 Author: Benjamin Stürz Date: Thu Apr 28 23:17:25 2022 -0700 ia64: replace comments with C99 initializers This replaces comments with C99's designated initializers because the kernel supports them now. Link: https://lkml.kernel.org/r/20220326165909.506926-3-benni@stuerz.xyz Signed-off-by: Benjamin Stürz Signed-off-by: Andrew Morton commit 72a4fd6a7f032b921b1c195eb42a038ab9026021 Author: Julia Lawall Date: Thu Apr 28 23:17:25 2022 -0700 ia64: ptrace: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20220318103729.157574-23-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton commit 0af96a024f524a5318485cbada73ab7d874895d4 Author: Julia Lawall Date: Thu Apr 28 23:17:25 2022 -0700 ia64: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20220318103729.157574-1-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton commit f47f758cff59c68015d6b9b9c077110df7c2c828 Author: Christophe JAILLET Date: Thu Apr 28 23:16:19 2022 -0700 drivers/base/memory: fix an unlikely reference counting issue in __add_memory_block() __add_memory_block() calls both put_device() and device_unregister() when storing the memory block into the xarray. This is incorrect because xarray doesn't take an additional reference and device_unregister() already calls put_device(). Triggering the issue looks really unlikely and its only effect should be to log a spurious warning about a ref counted issue. Link: https://lkml.kernel.org/r/d44c63d78affe844f020dc02ad6af29abc448fc4.1650611702.git.christophe.jaillet@wanadoo.fr Fixes: 4fb6eabf1037 ("drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup") Signed-off-by: Christophe JAILLET Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Scott Cheloha Cc: Nathan Lynch Signed-off-by: Andrew Morton commit ca2864e52d391f8df29da78261592502ffadd9d9 Author: Miaohe Lin Date: Thu Apr 28 23:16:19 2022 -0700 mm: compaction: make sure highest is above the min_pfn It's not guaranteed that highest will be above the min_pfn. If highest is below the min_pfn, migrate_pfn and free_pfn can meet prematurely and lead to some useless work. Make sure highest is above min_pfn to avoid making a futile effort. Link: https://lkml.kernel.org/r/20220418141253.24298-13-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit fa599c44987df43eb5cd5d60e9868fc2c790d9dc Author: Miaohe Lin Date: Thu Apr 28 23:16:19 2022 -0700 mm: compaction: simplify the code in __compact_finished Since commit efe771c7603b ("mm, compaction: always finish scanning of a full pageblock"), compaction will always finish scanning a pageblock. And migrate_pfn is assured to align with pageblock_nr_pages when we reach here. So we will always return COMPACT_SUCCESS if a suitable fallback is found due to the below IS_ALIGNED check of migrate_pfn. Simplify the code to make this clear and improve the readability. No functional change intended. Link: https://lkml.kernel.org/r/20220418141253.24298-12-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit cff387d6a2949a46d78a4f558938ef7b4cccd41f Author: Miaohe Lin Date: Thu Apr 28 23:16:18 2022 -0700 mm: compaction: make compaction_zonelist_suitable return false when COMPACT_SUCCESS When compact_result indicates that the allocation should now succeed, i.e. compact_result = COMPACT_SUCCESS, compaction_zonelist_suitable should return false because there is no need to do compaction now. Link: https://lkml.kernel.org/r/20220418141253.24298-11-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 3109de308987ceae413ee015038d51e2a86c7806 Author: Miaohe Lin Date: Thu Apr 28 23:16:18 2022 -0700 mm: compaction: avoid possible NULL pointer dereference in kcompactd_cpu_online It's possible that kcompactd_run could fail to run kcompactd for a hot added node and leave pgdat->kcompactd as NULL. So pgdat->kcompactd should be checked here to avoid possible NULL pointer dereference. Link: https://lkml.kernel.org/r/20220418141253.24298-10-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 556162bf3a8c27dd6aab180e9a1427d945a708e9 Author: Miaohe Lin Date: Thu Apr 28 23:16:18 2022 -0700 mm: compaction: clean up comment about async compaction in isolate_migratepages Since commit 282722b0d258 ("mm, compaction: restrict async compaction to pageblocks of same migratetype"), async direct compaction is restricted to scan the pageblocks of same migratetype. Correct the comment accordingly. Link: https://lkml.kernel.org/r/20220418141253.24298-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 66fe1cf7f581593750931266ad8f57c744e4b750 Author: Miaohe Lin Date: Thu Apr 28 23:16:18 2022 -0700 mm: compaction: use helper compound_nr in isolate_migratepages_block Use helper compound_nr to make use of compound_nr when CONFIG_64BIT and simplify the code a bit. Link: https://lkml.kernel.org/r/20220418141253.24298-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit c036ddffe4acb0a35d2f999e3a655c89c7a5b512 Author: Miaohe Lin Date: Thu Apr 28 23:16:18 2022 -0700 mm: compaction: use COMPACT_CLUSTER_MAX in compaction.c Always use COMPACT_CLUSTER_MAX here as we're doing the compaction. Minor improvements in readability. Link: https://lkml.kernel.org/r/20220418141253.24298-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 85f73e6d752de325d7570293e909140bc3280d37 Author: Miaohe Lin Date: Thu Apr 28 23:16:17 2022 -0700 mm: compaction: clean up comment about suitable migration target recheck checked_pageblock is already removed and suitable_migration_target is not rechecked under the zone lock since commit f8224aa5a0a4 ("mm, compaction: do not recheck suitable_migration_target under lock"). Correct the comment accordingly. Link: https://lkml.kernel.org/r/20220418141253.24298-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit d56c15845a5493dbe9e8b77f63418bea117d1221 Author: Miaohe Lin Date: Thu Apr 28 23:16:17 2022 -0700 mm: compaction: clean up comment for sched contention Since commit cf66f0700c8f ("mm, compaction: do not consider a need to reschedule as contention"), async compaction won't abort when scheduling is needed. Correct the relevant comment accordingly. Link: https://lkml.kernel.org/r/20220418141253.24298-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 00bc102f82e0a0c70f1d4c9fdeb4c0cbc622d777 Author: Miaohe Lin Date: Thu Apr 28 23:16:17 2022 -0700 mm: compaction: remove unneeded assignment to isolate_start_pfn isolate_start_pfn is unused when cc->nr_freepages ! = 0. Otherwise cc->free_pfn will overwrite it unconditionally. So we should remove this unneeded and somewhat misleading assignment. Link: https://lkml.kernel.org/r/20220418141253.24298-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 02d04a5163cd6bad66fd6091d2b4f53d06052aff Author: Miaohe Lin Date: Thu Apr 28 23:16:17 2022 -0700 mm: compaction: remove unneeded pfn update pfn is unused in this do while loop. Remove the unneeded pfn update. Link: https://lkml.kernel.org/r/20220418141253.24298-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Charan Teja Kalla Cc: David Hildenbrand Cc: Pintu Kumar Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 024c61eaff17f6a8c73cb8b25137251f0c3ef039 Author: Miaohe Lin Date: Thu Apr 28 23:16:17 2022 -0700 mm: compaction: remove unneeded return value of kcompactd_run Patch series "A few cleanup and fixup patches for compaction". This series contains a few patches to clean up some obsolete comment, remove unneeded return value and so on. Also we fix the possible NULL pointer dereference. More details can be found in the respective changelogs. This patch (of 12): The return value of kcompactd_run() is unused now. Clean it up. Link: https://lkml.kernel.org/r/20220418141253.24298-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220418141253.24298-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc; Mel Gorman Cc: David Hildenbrand Cc: Vlastimil Babka Cc: Pintu Kumar Cc: Charan Teja Kalla Signed-off-by: Andrew Morton commit 94bfe85bde18a99612bb5d0ce348643c2d352836 Author: Yang Yang Date: Thu Apr 28 23:16:16 2022 -0700 mm/vmstat: add events for ksm cow Users may use ksm by calling madvise(, , MADV_MERGEABLE) when they want to save memory, it's a tradeoff by suffering delay on ksm cow. Users can get to know how much memory ksm saved by reading /sys/kernel/mm/ksm/pages_sharing, but they don't know what's the costs of ksm cow, and this is important of some delay sensitive tasks. So add ksm cow events to help users evaluate whether or how to use ksm. Also update Documentation/admin-guide/mm/ksm.rst with new added events. Link: https://lkml.kernel.org/r/20220331035616.2390805-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reviewed-by: David Hildenbrand Reviewed-by: xu xin Reviewed-by: Ran Xiaokai Cc: Matthew Wilcox (Oracle) Cc: Jonathan Corbet Cc: Dave Hansen Cc: Saravanan D Cc: Minchan Kim Cc: John Hubbard Signed-off-by: Andrew Morton commit 7609385337a4feb6236e42dcd0df2185683ce839 Author: xu xin Date: Thu Apr 28 23:16:16 2022 -0700 ksm: count ksm merging pages for each process Some applications or containers want to use KSM by calling madvise() to advise areas of address space to be MERGEABLE. But they may not know which applications are more likely to cause real merges in the deployment. If this patch is applied, it helps them know their corresponding number of merged pages, and then optimize their app code. As current KSM only counts the number of KSM merging pages(e.g. ksm_pages_sharing and ksm_pages_shared) of the whole system, we cannot see the more fine-grained KSM merging, for the upper application optimization, the merging area cannot be set easily according to the KSM page merging probability of each process. Therefore, it is necessary to add extra statistical means so that the upper level users can know the detailed KSM merging information of each process. We add a new proc file named as ksm_merging_pages under /proc// to indicate the involved ksm merging pages of this process. [akpm@linux-foundation.org: fix comment typo, remove BUG_ON()s] Link: https://lkml.kernel.org/r/20220325082318.2352853-1-xu.xin16@zte.com.cn Signed-off-by: xu xin Reported-by: kernel test robot Reviewed-by: Yang Yang Reviewed-by: Ran Xiaokai Reported-by: Zeal Robot Cc: Kees Cook Cc: Alexey Dobriyan Cc: Stephen Rothwell Cc: Ohhoon Kwon Cc: Matthew Wilcox (Oracle) Cc: Stephen Brennan Cc: Vlastimil Babka Cc: Feng Tang Cc: Yang Yang Cc: Ran Xiaokai Cc: Zeal Robot Signed-off-by: Andrew Morton commit ba91fb7dd03c4f463453f28af24851097a6547fb Author: Peter Xu Date: Thu Apr 28 23:16:16 2022 -0700 include/linux/swapops.h: remove stub for non_swap_entry() The stub for non_swap_entry() may not help much, because MAX_SWAPFILES has already contained all the information to decide whether a swap entry is real swap entry or pesudo ones (migrations, ...). There can be some performance influences on non_swap_entry() with below conditions all met: !CONFIG_MIGRATION && !CONFIG_MEMORY_FAILURE && !CONFIG_DEVICE_PRIVATE But that's definitely not the major config most machines will use, at the meantime it's already in a slow path of swap entry (being parsed from a swap pte), so IMHO it shouldn't be a major issue. Also according to the analysis from Alistair, somehow the stub didn't do the job right [1]. To make the code cleaner, let's drop the stub. [1] https://lore.kernel.org/lkml/8735ihbw6g.fsf@nvdebian.thelocal/ Note: the uffd-wp shmem & hugetlbfs series will need this patch to make sure swap entries work as expected with below config as spotted by Alistair: !CONFIG_MIGRATION && !CONFIG_MEMORY_FAILURE && !CONFIG_DEVICE_PRIVATE && CONFIG_PTE_MARKER (PS: this config should mostly never gonna happen, though, afaict..) Link: https://lkml.kernel.org/r/20220413191147.66645-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Alistair Popple Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 6fd3620b342861de9547ea01d28f664892ef51a1 Author: Joao Martins Date: Thu Apr 28 23:16:16 2022 -0700 mm/page_alloc: reuse tail struct pages for compound devmaps Currently memmap_init_zone_device() ends up initializing 32768 pages when it only needs to initialize 128 given tail page reuse. That number is worse with 1GB compound pages, 262144 instead of 128. Update memmap_init_zone_device() to skip redundant initialization, detailed below. When a pgmap @vmemmap_shift is set, all pages are mapped at a given huge page alignment and use compound pages to describe them as opposed to a struct per 4K. With @vmemmap_shift > 0 and when struct pages are stored in ram (!altmap) most tail pages are reused. Consequently, the amount of unique struct pages is a lot smaller than the total amount of struct pages being mapped. The altmap path is left alone since it does not support memory savings based on compound pages devmap. Link: https://lkml.kernel.org/r/20220420155310.9712-6-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Muchun Song Cc: Christoph Hellwig Cc: Dan Williams Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Vishal Verma Signed-off-by: Andrew Morton commit 4917f55b4ef963e2d2288fe4eb651728be8db406 Author: Joao Martins Date: Thu Apr 28 23:16:16 2022 -0700 mm/sparse-vmemmap: improve memory savings for compound devmaps A compound devmap is a dev_pagemap with @vmemmap_shift > 0 and it means that pages are mapped at a given huge page alignment and utilize uses compound pages as opposed to order-0 pages. Take advantage of the fact that most tail pages look the same (except the first two) to minimize struct page overhead. Allocate a separate page for the vmemmap area which contains the head page and separate for the next 64 pages. The rest of the subsections then reuse this tail vmemmap page to initialize the rest of the tail pages. Sections are arch-dependent (e.g. on x86 it's 64M, 128M or 512M) and when initializing compound devmap with big enough @vmemmap_shift (e.g. 1G PUD) it may cross multiple sections. The vmemmap code needs to consult @pgmap so that multiple sections that all map the same tail data can refer back to the first copy of that data for a given gigantic page. On compound devmaps with 2M align, this mechanism lets 6 pages be saved out of the 8 necessary PFNs necessary to set the subsection's 512 struct pages being mapped. On a 1G compound devmap it saves 4094 pages. Altmap isn't supported yet, given various restrictions in altmap pfn allocator, thus fallback to the already in use vmemmap_populate(). It is worth noting that altmap for devmap mappings was there to relieve the pressure of inordinate amounts of memmap space to map terabytes of pmem. With compound pages the motivation for altmaps for pmem gets reduced. Link: https://lkml.kernel.org/r/20220420155310.9712-5-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Muchun Song Cc: Christoph Hellwig Cc: Dan Williams Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Vishal Verma Signed-off-by: Andrew Morton commit 60a427db0f80f16b9bb9efe6cc79c93f336e8466 Author: Joao Martins Date: Thu Apr 28 23:16:15 2022 -0700 mm/hugetlb_vmemmap: move comment block to Documentation/vm In preparation for device-dax for using hugetlbfs compound page tail deduplication technique, move the comment block explanation into a common place in Documentation/vm. Link: https://lkml.kernel.org/r/20220420155310.9712-4-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Muchun Song Reviewed-by: Dan Williams Suggested-by: Dan Williams Cc: Muchun Song Cc: Mike Kravetz Cc: Christoph Hellwig Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Vishal Verma Signed-off-by: Andrew Morton commit 2beea70a3edc03608ecc89b13ba9ba669c56b3fd Author: Joao Martins Date: Thu Apr 28 23:16:15 2022 -0700 mm/sparse-vmemmap: refactor core of vmemmap_populate_basepages() to helper In preparation for describing a memmap with compound pages, move the actual pte population logic into a separate function vmemmap_populate_address() and have a new helper vmemmap_populate_range() walk through all base pages it needs to populate. While doing that, change the helper to use a pte_t* as return value, rather than an hardcoded errno of 0 or -ENOMEM. Link: https://lkml.kernel.org/r/20220420155310.9712-3-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Muchun Song Cc: Christoph Hellwig Cc: Dan Williams Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Vishal Verma Signed-off-by: Andrew Morton commit e3246d8f52173a798710314a42fea83223036fc8 Author: Joao Martins Date: Thu Apr 28 23:16:15 2022 -0700 mm/sparse-vmemmap: add a pgmap argument to section activation Patch series "sparse-vmemmap: memory savings for compound devmaps (device-dax)", v9. This series minimizes 'struct page' overhead by pursuing a similar approach as Muchun Song series "Free some vmemmap pages of hugetlb page" (now merged since v5.14), but applied to devmap with @vmemmap_shift (device-dax). The vmemmap dedpulication original idea (already used in HugeTLB) is to reuse/deduplicate tail page vmemmap areas, particular the area which only describes tail pages. So a vmemmap page describes 64 struct pages, and the first page for a given ZONE_DEVICE vmemmap would contain the head page and 63 tail pages. The second vmemmap page would contain only tail pages, and that's what gets reused across the rest of the subsection/section. The bigger the page size, the bigger the savings (2M hpage -> save 6 vmemmap pages; 1G hpage -> save 4094 vmemmap pages). This is done for PMEM /specifically only/ on device-dax configured namespaces, not fsdax. In other words, a devmap with a @vmemmap_shift. In terms of savings, per 1Tb of memory, the struct page cost would go down with compound devmap: * with 2M pages we lose 4G instead of 16G (0.39% instead of 1.5% of total memory) * with 1G pages we lose 40MB instead of 16G (0.0014% instead of 1.5% of total memory) The series is mostly summed up by patch 4, and to summarize what the series does: Patches 1 - 3: Minor cleanups in preparation for patch 4. Move the very nice docs of hugetlb_vmemmap.c into a Documentation/vm/ entry. Patch 4: Patch 4 is the one that takes care of the struct page savings (also referred to here as tail-page/vmemmap deduplication). Much like Muchun series, we reuse the second PTE tail page vmemmap areas across a given @vmemmap_shift On important difference though, is that contrary to the hugetlbfs series, there's no vmemmap for the area because we are late-populating it as opposed to remapping a system-ram range. IOW no freeing of pages of already initialized vmemmap like the case for hugetlbfs, which greatly simplifies the logic (besides not being arch-specific). altmap case unchanged and still goes via the vmemmap_populate(). Also adjust the newly added docs to the device-dax case. [Note that device-dax is still a little behind HugeTLB in terms of savings. I have an additional simple patch that reuses the head vmemmap page too, as a follow-up. That will double the savings and namespaces initialization.] Patch 5: Initialize fewer struct pages depending on the page size with DRAM backed struct pages -- because fewer pages are unique and most tail pages (with bigger vmemmap_shift). NVDIMM namespace bootstrap improves from ~268-358 ms to ~80-110/<1ms on 128G NVDIMMs with 2M and 1G respectivally. And struct page needed capacity will be 3.8x / 1071x smaller for 2M and 1G respectivelly. Tested on x86 with 1.5Tb of pmem (including pinning, and RDMA registration/deregistration scalability with 2M MRs) This patch (of 5): In support of using compound pages for devmap mappings, plumb the pgmap down to the vmemmap_populate implementation. Note that while altmap is retrievable from pgmap the memory hotplug code passes altmap without pgmap[*], so both need to be independently plumbed. So in addition to @altmap, pass @pgmap to sparse section populate functions namely: sparse_add_section section_activate populate_section_memmap __populate_section_memmap Passing @pgmap allows __populate_section_memmap() to both fetch the vmemmap_shift in which memmap metadata is created for and also to let sparse-vmemmap fetch pgmap ranges to co-relate to a given section and pick whether to just reuse tail pages from past onlined sections. While at it, fix the kdoc for @altmap for sparse_add_section(). [*] https://lore.kernel.org/linux-mm/20210319092635.6214-1-osalvador@suse.de/ Link: https://lkml.kernel.org/r/20220420155310.9712-1-joao.m.martins@oracle.com Link: https://lkml.kernel.org/r/20220420155310.9712-2-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Dan Williams Reviewed-by: Muchun Song Cc: Vishal Verma Cc: Matthew Wilcox Cc: Jason Gunthorpe Cc: Jane Chu Cc: Mike Kravetz Cc: Jonathan Corbet Cc: Christoph Hellwig Signed-off-by: Andrew Morton commit 47010c040dec8af6347ec6259104fc13f7e7e30a Author: Muchun Song Date: Thu Apr 28 23:16:15 2022 -0700 mm: hugetlb_vmemmap: cleanup CONFIG_HUGETLB_PAGE_FREE_VMEMMAP* The word of "free" is not expressive enough to express the feature of optimizing vmemmap pages associated with each HugeTLB, rename this keywork to "optimize". In this patch , cheanup configs to make code more expressive. Link: https://lkml.kernel.org/r/20220404074652.68024-4-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Mike Kravetz Cc: David Hildenbrand Signed-off-by: Andrew Morton commit f10f1442c309ccef7a80ba3dc4abde0978e86fb4 Author: Muchun Song Date: Thu Apr 28 23:16:15 2022 -0700 mm: hugetlb_vmemmap: cleanup hugetlb_free_vmemmap_enabled* The word of "free" is not expressive enough to express the feature of optimizing vmemmap pages associated with each HugeTLB, rename this keywork to "optimize". In this patch , cheanup the static key and hugetlb_free_vmemmap_enabled() to make code more expressive. Link: https://lkml.kernel.org/r/20220404074652.68024-3-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: David Hildenbrand Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 5981611d0a006472d367d7a8e6ead8afaecf17c7 Author: Muchun Song Date: Thu Apr 28 23:16:14 2022 -0700 mm: hugetlb_vmemmap: cleanup hugetlb_vmemmap related functions Patch series "cleanup hugetlb_vmemmap". The word of "free" is not expressive enough to express the feature of optimizing vmemmap pages associated with each HugeTLB, rename this keywork to "optimize" is more clear. In this series, cheanup related codes to make it more clear and expressive. This is suggested by David. This patch (of 3): The word of "free" is not expressive enough to express the feature of optimizing vmemmap pages associated with each HugeTLB, rename this keywork to "optimize". And some function names are prefixed with "huge_page" instead of "hugetlb", it is easily to be confused with THP. In this patch, cheanup related functions to make code more clear and expressive. Link: https://lkml.kernel.org/r/20220404074652.68024-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220404074652.68024-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: David Hildenbrand Cc: Mike Kravetz Signed-off-by: Andrew Morton commit aa282a157bf8ff79bed9164dc5e0e99f0d9e9755 Author: Ma Wupeng Date: Thu Apr 28 23:16:14 2022 -0700 mm/page_alloc.c: calc the right pfn if page size is not 4K Previous 0x100000 is used to check the 4G limit in find_zone_movable_pfns_for_nodes(). This is right in x86 because the page size can only be 4K. But 16K and 64K are available in arm64. So replace it with PHYS_PFN(SZ_4G). Link: https://lkml.kernel.org/r/20220414101314.1250667-8-mawupeng1@huawei.com Signed-off-by: Ma Wupeng Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Acked-by: Ard Biesheuvel Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton commit 3c9fe8b8f5e3e30bfa81eeeff4bc34c0fb67b739 Author: Miaohe Lin Date: Thu Apr 28 23:16:14 2022 -0700 mm/mremap: avoid unneeded do_munmap call When old_len == new_len, do_munmap will return -EINVAL due to len == 0. This errno will be simply ignored because of old_len != new_len check. So it is unnecessary to call do_munmap when old_len == new_len because nothing is actually done. Link: https://lkml.kernel.org/r/20220401081023.37080-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Signed-off-by: Andrew Morton commit f433195679a9639a3af5be03bcb9c3d933e3b261 Author: Miaohe Lin Date: Thu Apr 28 23:16:14 2022 -0700 mm/mremap: use helper mlock_future_check() Use helper mlock_future_check() to check whether it's safe to resize the locked_vm to simplify the code. Minor readability improvement. Link: https://lkml.kernel.org/r/20220322112004.27380-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Wei Yang Signed-off-by: Andrew Morton commit 3afa793082e624f7bd83533010ff4a676451d4ee Author: Anshuman Khandual Date: Thu Apr 28 23:16:14 2022 -0700 mm/mmap: drop arch_vm_get_page_pgprot() There are no platforms left which use arch_vm_get_page_prot(). Just drop generic arch_vm_get_page_prot(). Link: https://lkml.kernel.org/r/20220414062125.609297-8-anshuman.khandual@arm.com Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Christophe Leroy Reviewed-by: Catalin Marinas Signed-off-by: Anshuman Khandual Cc: Christoph Hellwig Cc: David S. Miller Cc: Ingo Molnar Cc: Khalid Aziz Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 5dcfc6a1cc53ea0859de98a7380933f9e779859d Author: Anshuman Khandual Date: Thu Apr 28 23:16:13 2022 -0700 mm/mmap: drop arch_filter_pgprot() There are no platforms left which subscribe ARCH_HAS_FILTER_PGPROT. Hence drop generic arch_filter_pgprot() and also config ARCH_HAS_FILTER_PGPROT. Link: https://lkml.kernel.org/r/20220414062125.609297-7-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christophe Leroy Reviewed-by: Catalin Marinas Cc: Christoph Hellwig Cc: David S. Miller Cc: Ingo Molnar Cc: Khalid Aziz Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit e10cd4b00904db127b178859d81f6b5d05d16c67 Author: Christoph Hellwig Date: Thu Apr 28 23:16:13 2022 -0700 x86/mm: enable ARCH_HAS_VM_GET_PAGE_PROT This defines and exports a platform specific custom vm_get_page_prot() via subscribing ARCH_HAS_VM_GET_PAGE_PROT. This also unsubscribes from config ARCH_HAS_FILTER_PGPROT, after dropping off arch_filter_pgprot() and arch_vm_get_page_prot(). Link: https://lkml.kernel.org/r/20220414062125.609297-6-anshuman.khandual@arm.com Signed-off-by: Christoph Hellwig Signed-off-by: Anshuman Khandual Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Catalin Marinas Cc: Christophe Leroy Cc: David S. Miller Cc: Khalid Aziz Cc: Michael Ellerman Cc: Paul Mackerras Cc: Will Deacon Signed-off-by: Andrew Morton commit 91d4ce985fbb22c9a8ae50601f1ad4fe953b9382 Author: Anshuman Khandual Date: Thu Apr 28 23:16:13 2022 -0700 sparc/mm: enable ARCH_HAS_VM_GET_PAGE_PROT This defines and exports a platform specific custom vm_get_page_prot() via subscribing ARCH_HAS_VM_GET_PAGE_PROT. It localizes arch_vm_get_page_prot() as sparc_vm_get_page_prot() and moves near vm_get_page_prot(). Link: https://lkml.kernel.org/r/20220414062125.609297-5-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Acked-by: David S. Miller Reviewed-by: Khalid Aziz Reviewed-by: Christophe Leroy Cc: Khalid Aziz Cc: Catalin Marinas Cc: Christoph Hellwig Cc: Ingo Molnar Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit b3aca728fb276782ab3c851aedaf3d19b33faabe Author: Anshuman Khandual Date: Thu Apr 28 23:16:13 2022 -0700 arm64/mm: enable ARCH_HAS_VM_GET_PAGE_PROT This defines and exports a platform specific custom vm_get_page_prot() via subscribing ARCH_HAS_VM_GET_PAGE_PROT. It localizes arch_vm_get_page_prot() and moves it near vm_get_page_prot(). Link: https://lkml.kernel.org/r/20220414062125.609297-4-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Catalin Marinas Cc: Catalin Marinas Cc: Will Deacon Cc: Christophe Leroy Cc: Christoph Hellwig Cc: David S. Miller Cc: Ingo Molnar Cc: Khalid Aziz Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 634093c59a12fc90e33c4e5acd1da4498fd159d4 Author: Anshuman Khandual Date: Thu Apr 28 23:16:13 2022 -0700 powerpc/mm: enable ARCH_HAS_VM_GET_PAGE_PROT This defines and exports a platform specific custom vm_get_page_prot() via subscribing ARCH_HAS_VM_GET_PAGE_PROT. While here, this also localizes arch_vm_get_page_prot() as __vm_get_page_prot() and moves it near vm_get_page_prot(). Link: https://lkml.kernel.org/r/20220414062125.609297-3-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christophe Leroy Cc: Michael Ellerman Cc: Paul Mackerras Cc: Catalin Marinas Cc: Christoph Hellwig Cc: David S. Miller Cc: Ingo Molnar Cc: Khalid Aziz Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 67436193c2874c2e0e2d654820fadb9e79785335 Author: Anshuman Khandual Date: Thu Apr 28 23:16:12 2022 -0700 mm/mmap: add new config ARCH_HAS_VM_GET_PAGE_PROT Patch series "mm/mmap: Drop arch_vm_get_page_prot() and arch_filter_pgprot()", v7. protection_map[] is an array based construct that translates given vm_flags combination. This array contains page protection map, which is populated by the platform via [__S000 .. __S111] and [__P000 .. __P111] exported macros. Primary usage for protection_map[] is for vm_get_page_prot(), which is used to determine page protection value for a given vm_flags. vm_get_page_prot() implementation, could again call platform overrides arch_vm_get_page_prot() and arch_filter_pgprot(). Some platforms override protection_map[] that was originally built with __SXXX/__PXXX with different runtime values. Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros , protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built between the platform and generic MM, finally defining vm_get_page_prot(). Hence this series proposes to drop later two abstraction levels and instead just move the responsibility of defining vm_get_page_prot() to the platform (still utilizing generic protection_map[] array) itself making it clean and simple. This first introduces ARCH_HAS_VM_GET_PAGE_PROT which enables the platforms to define custom vm_get_page_prot(). This starts converting platforms that define the overrides arch_filter_pgprot() or arch_vm_get_page_prot() which enables for those constructs to be dropped off completely. The series has been inspired from an earlier discuss with Christoph Hellwig https://lore.kernel.org/all/1632712920-8171-1-git-send-email-anshuman.khandual@arm.com/ This patch (of 7): Add a new config ARCH_HAS_VM_GET_PAGE_PROT, which when subscribed enables a given platform to define its own vm_get_page_prot() but still utilizing the generic protection_map[] array. Link: https://lkml.kernel.org/r/20220414062125.609297-1-anshuman.khandual@arm.com Link: https://lkml.kernel.org/r/20220414062125.609297-2-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christophe Leroy Reviewed-by: Catalin Marinas Suggested-by: Christoph Hellwig Cc: David S. Miller Cc: Ingo Molnar Cc: Khalid Aziz Cc: Michael Ellerman Cc: Paul Mackerras Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit c5d8a3643d91be748d7ff12eedc5876f32cc8283 Author: Miaohe Lin Date: Thu Apr 28 23:16:12 2022 -0700 mm/mmap.c: use helper mlock_future_check() Use helper mlock_future_check() to check whether it's safe to enlarge the locked_vm to simplify the code. Minor readability improvement. Link: https://lkml.kernel.org/r/20220402032231.64974-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton commit 6c862bd05922af770c5b652037404c4f8131d984 Author: Anshuman Khandual Date: Thu Apr 28 23:16:12 2022 -0700 mm/mmap: clarify protection_map[] indices protection_map[] maps vm_flags access combinations into page protection value as defined by the platform via __PXXX and __SXXX macros. The array indices in protection_map[], represents vm_flags access combinations but it's not very intuitive to derive. This makes it clear and explicit. Link: https://lkml.kernel.org/r/20220404031840.588321-3-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 31d17076b07c8ed212b1d865b36b0c7313885ef2 Author: Anshuman Khandual Date: Thu Apr 28 23:16:12 2022 -0700 mm/debug_vm_pgtable: drop protection_map[] usage Patch series "mm: protection_map[] cleanups". This patch (of 2): Although protection_map[] contains the platform defined page protection map for a given vm_flags combination, vm_get_page_prot() is the right interface to use. This will also reduce dependency on protection_map[] which is going to be dropped off completely later on. Link: https://lkml.kernel.org/r/20220404031840.588321-1-anshuman.khandual@arm.com Link: https://lkml.kernel.org/r/20220404031840.588321-2-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit b191c9bc334a936775843867485c207e23b30e1b Author: Jianxing Wang Date: Thu Apr 28 23:16:12 2022 -0700 mm/mmu_gather: limit free batch count and add schedule point in tlb_batch_pages_flush free a large list of pages maybe cause rcu_sched starved on non-preemptible kernels. howerver free_unref_page_list maybe can't cond_resched as it maybe called in interrupt or atomic context, especially can't detect atomic context in CONFIG_PREEMPTION=n. The issue is detected in guest with kvm cpu 200% overcommit, however I didn't see the warning in the host with the same application. I'm sure that the patch is needed for guest kernel, but no sure for host. To reproduce, set up two virtual machines in one host machine, per vm has the same number cpu and half memory of host. the run ltpstress.sh in per vm, then will see rcu stall warning.kernel is preempt disabled, append kernel command 'preempt=none' if enable dynamic preempt . It could detected in loongson machine(32 core, 128G mem) and ProLiant DL380 Gen9(x86 E5-2680, 28 core, 64G mem) tlb flush batch count depends on PAGE_SIZE, it's too large if PAGE_SIZE > 4K, here limit free batch count with 512. And add schedule point in tlb_batch_pages_flush. rcu: rcu_sched kthread starved for 5359 jiffies! g454793 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x0 ->cpu=19 [...] Call Trace: free_unref_page_list+0x19c/0x270 release_pages+0x3cc/0x498 tlb_flush_mmu_free+0x44/0x70 zap_pte_range+0x450/0x738 unmap_page_range+0x108/0x240 unmap_vmas+0x74/0xf0 unmap_region+0xb0/0x120 do_munmap+0x264/0x438 vm_munmap+0x58/0xa0 sys_munmap+0x10/0x20 syscall_common+0x24/0x38 Link: https://lkml.kernel.org/r/20220317072857.2635262-1-wangjianxing@loongson.cn Signed-off-by: Jianxing Wang Signed-off-by: Peter Zijlstra Cc: Will Deacon Cc: Nicholas Piggin Signed-off-by: Andrew Morton commit 325bca1fe0b1bb9f535e69bb9ec48d4a6e0ca3ce Author: Rolf Eike Beer Date: Thu Apr 28 23:16:11 2022 -0700 mm/mmap.c: use mmap_assert_write_locked() instead of open coding it In case the lock is actually not held at this point. Link: https://lkml.kernel.org/r/5827758.TJ1SttVevJ@mobilepool36.emlix.com Signed-off-by: Rolf Eike Beer Reviewed-by: Christoph Hellwig Signed-off-by: Andrew Morton commit 241ec63a9a0fbb39292ea1dd2d07f8dabedfe3df Author: Axel Rasmussen Date: Thu Apr 28 23:16:11 2022 -0700 selftests: vm: fix shellcheck warnings in run_vmtests.sh These might not be issues yet, but they make the script more fragile. Also by fixing them we give a better example to future readers, who might copy/paste or otherwise re-use snippets from our script. - Use "read -r", since we don't ever want read to be interpreting '\' characters as escape sequences... - Quote variables, to deal with spaces properly. - Use $() instead of the older and harder-to-nest ``. - Get rid of superfluous "$" prefixes inside arithmetic $(()). Link: https://lkml.kernel.org/r/20220421224928.1848230-2-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Cc: Shuah Khan Signed-off-by: Andrew Morton commit b67bd551201a3e2c7e1def84980e9b2f0b3a3c77 Author: Axel Rasmussen Date: Thu Apr 28 23:16:11 2022 -0700 selftests: vm: refactor run_vmtests.sh to reduce boilerplate Previously, each test printed out its own header, dealt with its own return code, etc. By just putting this standard stuff in a function, we can delete > 300 lines from the script. This also makes adding future tests easier. And, it gets rid of various inconsistencies that already exist: - Some tests correctly deal with ksft_skip, but others don't. - Some tests just print the executable name, others print arguments, and yet others print some comment in the header. - Most tests print out a header with two separator lines, but not the HMM smoke test or the memfd_secret test, which only print one. - We had a redundant "exit" at the end, with all the boilerplate it's an easy oversight. Link: https://lkml.kernel.org/r/20220421224928.1848230-1-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Cc: Shuah Khan Signed-off-by: Andrew Morton commit 9f3265db6ae87de27a5e382410b8eb9af53b161e Author: Gabriel Krisman Bertazi Date: Thu Apr 28 23:16:11 2022 -0700 selftests: vm: add test for Soft-Dirty PTE bit This introduces three tests: 1) Sanity check soft dirty basic semantics: allocate area, clean, dirty, check if the SD bit is flipped. 2) Check VMA reuse: validate the VM_SOFTDIRTY usage 3) Check soft-dirty on huge pages This was motivated by Will Deacon's fix commit 912efa17e512 ("mm: proc: Invalidate TLB after clearing soft-dirty page state"). I was tracking the same issue that he fixed, and this test would have caught it. Link: https://lkml.kernel.org/r/20220420084036.4101604-2-usama.anjum@collabora.com Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Muhammad Usama Anjum Co-developed-by: Muhammad Usama Anjum Cc: Will Deacon Cc: Shuah Khan Signed-off-by: Andrew Morton commit 642bc52aed9c99e8c9c9cfb6781f77719717a36c Author: Muhammad Usama Anjum Date: Thu Apr 28 23:16:11 2022 -0700 selftests: vm: bring common functions to a new file Bring common functions to a new file while keeping code as much same as possible. These functions can be used in the new tests. This helps in avoiding code duplication. Link: https://lkml.kernel.org/r/20220420084036.4101604-1-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Acked-by: David Hildenbrand Cc: Gabriel Krisman Bertazi Cc: Shuah Khan Cc: Will Deacon Signed-off-by: Andrew Morton commit 62e80f2b5072ed80a41fc6a272e44e8e17fdcf66 Author: Sidhartha Kumar Date: Thu Apr 28 23:16:10 2022 -0700 tools/testing/selftests/vm/gup_test.c: clarify error statement Print three possible reasons /sys/kernel/debug/gup_test cannot be opened to help users of this test diagnose failures. Link: https://lkml.kernel.org/r/20220405214809.3351223-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton commit 0e5e64c0b0d7bb33a5e971ad17e771cf6e0a1127 Author: Muchun Song Date: Thu Apr 28 23:16:10 2022 -0700 mm: simplify follow_invalidate_pte() The only user (DAX) of range and pmdpp parameters of follow_invalidate_pte() is gone, it is safe to remove them and make it static to simlify the code. This is revertant of the following commits: 097963959594 ("mm: add follow_pte_pmd()") a4d1a8852513 ("dax: update to new mmu_notifier semantic") There is only one caller of the follow_invalidate_pte(). So just fold it into follow_pte() and remove it. Link: https://lkml.kernel.org/r/20220403053957.10770-7-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Christoph Hellwig Cc: Alistair Popple Cc: Al Viro Cc: Dan Williams Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Ralph Campbell Cc: Ross Zwisler Cc: Xiongchun Duan Cc: Xiyu Yang Cc: Yang Shi Signed-off-by: Andrew Morton commit 06083a0921fd5939223a8bf30e83d5f483d348dc Author: Muchun Song Date: Thu Apr 28 23:16:10 2022 -0700 dax: fix missing writeprotect the pte entry Currently dax_mapping_entry_mkclean() fails to clean and write protect the pte entry within a DAX PMD entry during an *sync operation. This can result in data loss in the following sequence: 1) process A mmap write to DAX PMD, dirtying PMD radix tree entry and making the pmd entry dirty and writeable. 2) process B mmap with the @offset (e.g. 4K) and @length (e.g. 4K) write to the same file, dirtying PMD radix tree entry (already done in 1)) and making the pte entry dirty and writeable. 3) fsync, flushing out PMD data and cleaning the radix tree entry. We currently fail to mark the pte entry as clean and write protected since the vma of process B is not covered in dax_entry_mkclean(). 4) process B writes to the pte. These don't cause any page faults since the pte entry is dirty and writeable. The radix tree entry remains clean. 5) fsync, which fails to flush the dirty PMD data because the radix tree entry was clean. 6) crash - dirty data that should have been fsync'd as part of 5) could still have been in the processor cache, and is lost. Just to use pfn_mkclean_range() to clean the pfns to fix this issue. Link: https://lkml.kernel.org/r/20220403053957.10770-6-songmuchun@bytedance.com Fixes: 4b4bb46d00b3 ("dax: clear dirty entry tags on cache flush") Signed-off-by: Muchun Song Reviewed-by: Christoph Hellwig Cc: Alistair Popple Cc: Al Viro Cc: Dan Williams Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Ralph Campbell Cc: Ross Zwisler Cc: Xiongchun Duan Cc: Xiyu Yang Cc: Yang Shi Signed-off-by: Andrew Morton commit 6472f6d2f7d90c0e8b32bd13acd45622635b04cc Author: Muchun Song Date: Thu Apr 28 23:16:10 2022 -0700 mm: pvmw: add support for walking devmap pages The devmap pages can not use page_vma_mapped_walk() to check if a huge devmap page is mapped into a vma. Add support for walking huge devmap pages so that DAX can use it in the next patch. Link: https://lkml.kernel.org/r/20220403053957.10770-5-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alistair Popple Cc: Al Viro Cc: Christoph Hellwig Cc: Dan Williams Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Ralph Campbell Cc: Ross Zwisler Cc: Xiongchun Duan Cc: Xiyu Yang Cc: Yang Shi Signed-off-by: Andrew Morton commit 6a8e0596f00469c15ec556b9f3624acd2e9a04f9 Author: Muchun Song Date: Thu Apr 28 23:16:10 2022 -0700 mm: rmap: introduce pfn_mkclean_range() to cleans PTEs The page_mkclean_one() is supposed to be used with the pfn that has a associated struct page, but not all the pfns (e.g. DAX) have a struct page. Introduce a new function pfn_mkclean_range() to cleans the PTEs (including PMDs) mapped with range of pfns which has no struct page associated with them. This helper will be used by DAX device in the next patch to make pfns clean. Link: https://lkml.kernel.org/r/20220403053957.10770-4-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alistair Popple Cc: Al Viro Cc: Christoph Hellwig Cc: Dan Williams Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Ralph Campbell Cc: Ross Zwisler Cc: Xiongchun Duan Cc: Xiyu Yang Cc: Yang Shi Signed-off-by: Andrew Morton commit e583b5c472bd23d450e06f148dc1f37be74f7666 Author: Muchun Song Date: Thu Apr 28 23:16:09 2022 -0700 dax: fix cache flush on PMD-mapped pages The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. However, it does not cover the full pages in a THP except a head page. Replace it with flush_cache_range() to fix this issue. This is just a documentation issue with the respect to properly documenting the expected usage of cache flushing before modifying the pmd. However, in practice this is not a problem due to the fact that DAX is not available on architectures with virtually indexed caches per: commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Link: https://lkml.kernel.org/r/20220403053957.10770-3-songmuchun@bytedance.com Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") Signed-off-by: Muchun Song Reviewed-by: Dan Williams Reviewed-by: Christoph Hellwig Cc: Alistair Popple Cc: Al Viro Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Ralph Campbell Cc: Ross Zwisler Cc: Xiongchun Duan Cc: Xiyu Yang Cc: Yang Shi Signed-off-by: Andrew Morton commit 7f9c9b607dc2641c77266efe788fab853d27dbd1 Author: Muchun Song Date: Thu Apr 28 23:16:09 2022 -0700 mm: rmap: fix cache flush on THP pages Patch series "Fix some bugs related to ramp and dax", v7. Patch 1-2 fix a cache flush bug, because subsequent patches depend on those on those changes, there are placed in this series. Patch 3-4 are preparation for fixing a dax bug in patch 5. Patch 6 is code cleanup since the previous patch removes the usage of follow_invalidate_pte(). This patch (of 6): The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. However, it does not cover the full pages in a THP except a head page. Replace it with flush_cache_range() to fix this issue. At least, no problems were found due to this. Maybe because the architectures that have virtual indexed caches is less. Link: https://lkml.kernel.org/r/20220403053957.10770-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220403053957.10770-2-songmuchun@bytedance.com Fixes: f27176cfc363 ("mm: convert page_mkclean_one() to use page_vma_mapped_walk()") Signed-off-by: Muchun Song Reviewed-by: Yang Shi Reviewed-by: Dan Williams Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox Cc: Jan Kara Cc: Al Viro Cc: Alistair Popple Cc: Yang Shi Cc: Ralph Campbell Cc: Hugh Dickins Cc: Xiyu Yang Cc: "Kirill A. Shutemov" Cc: Ross Zwisler Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit f3b9e8cc8b09ba3b41bb068c24a1061e8a70d26f Author: Miaohe Lin Date: Thu Apr 28 23:16:09 2022 -0700 mm/madvise: fix potential pte_unmap_unlock pte error We can't assume pte_offset_map_lock will return same orig_pte value. So it's necessary to reacquire the orig_pte or pte_unmap_unlock will unmap the stale pte. Link: https://lkml.kernel.org/r/20220416081416.23304-1-linmiaohe@huawei.com Fixes: 9c276cc65a58 ("mm: introduce MADV_COLD") Fixes: 854e9ed09ded ("mm: support madvise(MADV_FREE)") Signed-off-by: Miaohe Lin Cc: Johannes Weiner Cc: Michal Hocko Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 7d6e2d96384556a4f30547803be1f606eb805a62 Author: Oscar Salvador Date: Thu Apr 28 23:16:09 2022 -0700 mm: untangle config dependencies for demote-on-reclaim At the time demote-on-reclaim was introduced, it was tied to CONFIG_HOTPLUG_CPU + CONFIG_MIGRATE, but that is not really accurate. The only two things we need to depend on are CONFIG_NUMA + CONFIG_MIGRATE, so clean this up. Furthermore, we only register the hotplug memory notifier when the system has CONFIG_MEMORY_HOTPLUG. Link: https://lkml.kernel.org/r/20220322224016.4574-1-osalvador@suse.de Signed-off-by: Oscar Salvador Suggested-by: "Huang, Ying" Reviewed-by: "Huang, Ying" Cc: Dave Hansen Cc: Abhishek Goel Cc: Baolin Wang Signed-off-by: Andrew Morton commit 9c42fe4e30a9b934b1de66c2edca196563221392 Author: Baolin Wang Date: Thu Apr 28 23:16:09 2022 -0700 mm: migrate: simplify the refcount validation when migrating hugetlb mapping There is no need to validate the hugetlb page's refcount before trying to freeze the hugetlb page's expected refcount, instead we can just rely on the page_ref_freeze() to simplify the validation. Moreover we are always under the page lock when migrating the hugetlb page mapping, which means nowhere else can remove it from the page cache, so we can remove the xas_load() validation under the i_pages lock. Link: https://lkml.kernel.org/r/eb2fbbeaef2b1714097b9dec457426d682ee0635.1649676424.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Mike Kravetz Cc: Matthew Wilcox Cc: "Huang, Ying" Cc: Muchun Song Cc: Alistair Popple Cc: Zi Yan Signed-off-by: Andrew Morton commit 4cd614841c06338a087769ee3cfa96718784d1f5 Author: Miaohe Lin Date: Thu Apr 28 23:16:08 2022 -0700 mm/migration: fix possible do_pages_stat_array racing with memory offline When follow_page peeks a page, the page could be migrated and then be offlined while it's still being used by the do_pages_stat_array(). Use FOLL_GET to hold the page refcnt to fix this potential race. Link: https://lkml.kernel.org/r/20220318111709.60311-12-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: "Huang, Ying" Reviewed-by: Muchun Song Cc: Alistair Popple Cc: Baolin Wang Cc: Zi Yan Signed-off-by: Andrew Morton commit 3f26c88bd66cd8ab1731763c68df7fe23a7671c0 Author: Miaohe Lin Date: Thu Apr 28 23:16:08 2022 -0700 mm/migration: fix potential invalid node access for reclaim-based migration If we failed to setup hotplug state callbacks for mm/demotion:online in some corner cases, node_demotion will be left uninitialized. Invalid node might be returned from the next_demotion_node() when doing reclaim-based migration. Use kcalloc to allocate node_demotion to fix the issue. Link: https://lkml.kernel.org/r/20220318111709.60311-11-linmiaohe@huawei.com Fixes: ac16ec835314 ("mm: migrate: support multiple target nodes demotion") Signed-off-by: Miaohe Lin Reviewed-by: "Huang, Ying" Cc: Alistair Popple Cc: Baolin Wang Cc: Muchun Song Cc: Zi Yan Signed-off-by: Andrew Morton commit 69a041ff505806c95b24b8d5cab43e66aacd91e6 Author: Miaohe Lin Date: Thu Apr 28 23:16:08 2022 -0700 mm/migration: fix potential page refcounts leak in migrate_pages In -ENOMEM case, there might be some subpages of fail-to-migrate THPs left in thp_split_pages list. We should move them back to migration list so that they could be put back to the right list by the caller otherwise the page refcnt will be leaked here. Also adjust nr_failed and nr_thp_failed accordingly to make vm events account more accurate. Link: https://lkml.kernel.org/r/20220318111709.60311-10-linmiaohe@huawei.com Fixes: b5bade978e9b ("mm: migrate: fix the return value of migrate_pages()") Signed-off-by: Miaohe Lin Reviewed-by: Zi Yan Reviewed-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Muchun Song Cc: Alistair Popple Signed-off-by: Andrew Morton commit f430893b01e78e0b2e21f9bd1633a778c063993e Author: Miaohe Lin Date: Thu Apr 28 23:16:08 2022 -0700 mm/migration: remove some duplicated codes in migrate_pages Remove the duplicated codes in migrate_pages to simplify the code. Minor readability improvement. No functional change intended. Link: https://lkml.kernel.org/r/20220318111709.60311-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Zi Yan Reviewed-by: Baolin Wang Cc: Alistair Popple Cc: "Huang, Ying" Cc: Muchun Song Signed-off-by: Andrew Morton commit 91925ab8cc2a05ab0e524830247e1d66ba4e4e19 Author: Miaohe Lin Date: Thu Apr 28 23:16:08 2022 -0700 mm/migration: avoid unneeded nodemask_t initialization Avoid unneeded next_pass and this_pass initialization as they're always set before using to save possible cpu cycles when there are plenty of nodes in the system. Link: https://lkml.kernel.org/r/20220318111709.60311-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Reviewed-by: Baolin Wang Cc: Alistair Popple Cc: "Huang, Ying" Cc: Zi Yan Signed-off-by: Andrew Morton commit 3eefb826c5a627084eccec788f0236a070988dae Author: Miaohe Lin Date: Thu Apr 28 23:16:07 2022 -0700 mm/migration: use helper macro min in do_pages_stat We could use helper macro min to help set the chunk_nr to simplify the code. Link: https://lkml.kernel.org/r/20220318111709.60311-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Alistair Popple Cc: Baolin Wang Cc: "Huang, Ying" Cc: Zi Yan Signed-off-by: Andrew Morton commit cb1c37b1c65d9e5450af2ea6ec8916c5cd23a2e7 Author: Miaohe Lin Date: Thu Apr 28 23:16:07 2022 -0700 mm/migration: use helper function vma_lookup() in add_page_for_migration We could use helper function vma_lookup() to lookup the needed vma to simplify the code. Link: https://lkml.kernel.org/r/20220318111709.60311-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: Baolin Wang Cc: "Huang, Ying" Cc: Muchun Song Cc: Zi Yan Signed-off-by: Andrew Morton commit b75454e10101af3a11b24ca7e14917b6c8874688 Author: Miaohe Lin Date: Thu Apr 28 23:16:07 2022 -0700 mm/migration: remove unneeded local variable page_lru We can use page_is_file_lru() directly to help account the isolated pages to simplify the code a bit. Link: https://lkml.kernel.org/r/20220318111709.60311-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: Baolin Wang Cc: "Huang, Ying" Cc: Muchun Song Cc: Zi Yan Signed-off-by: Andrew Morton commit 5202978b48786703a6cec94596067b3fafd1f734 Author: Miaohe Lin Date: Thu Apr 28 23:16:07 2022 -0700 mm/migration: remove unneeded local variable mapping_locked Patch series "A few cleanup and fixup patches for migration", v2. This series contains a few patches to remove unneeded variables, jump label and use helper to simplify the code. Also we fix some bugs such as page refcounts leak , invalid node access and so on. More details can be found in the respective changelogs. This patch (of 11): When mapping_locked is true, TTU_RMAP_LOCKED is always set to ttu. We can check ttu instead so mapping_locked can be removed. And ttu is either 0 or TTU_RMAP_LOCKED now. Change '|=' to '=' to reflect this. Link: https://lkml.kernel.org/r/20220318111709.60311-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220318111709.60311-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Cc: Zi Yan Cc: Baolin Wang Cc: "Huang, Ying" Cc: Muchun Song Cc: Alistair Popple Signed-off-by: Andrew Morton commit 0c2d08728470b93a3f05416f53222f38a89868e2 Author: Alistair Popple Date: Thu Apr 28 23:16:07 2022 -0700 mm: add selftests for migration entries Add some basic migration tests and in particular tests that will stress both the pte and pmd migration entry wait paths. Link: https://lkml.kernel.org/r/20220324014349.229253-1-apopple@nvidia.com Signed-off-by: Alistair Popple Cc: Hugh Dickins Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox (Oracle) Cc: Ralph Campbell Cc: Muchun Song Cc: John Hubbard Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Shuah Khan Signed-off-by: Andrew Morton commit bc78b5ed9ff2359f8af1454ee98670b1dc79f06e Author: Miaohe Lin Date: Thu Apr 28 23:16:06 2022 -0700 mm/mempolicy: clean up the code logic in queue_pages_pte_range Since commit e5947d23edd8 ("mm: mempolicy: don't have to split pmd for huge zero page"), THP is never splited in queue_pages_pmd. Thus 2 is never returned now. We can remove such unnecessary ret != 2 check and clean up the relevant comment. Minor improvements in readability. Link: https://lkml.kernel.org/r/20220419122234.45083-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Yang Shi Acked-by: David Rientjes Cc: Zi Yan Cc: Michal Hocko Signed-off-by: Andrew Morton commit da63dc84befaa9e6079a0bc363ff0eaa975f9073 Author: Miaohe Lin Date: Thu Apr 28 23:16:06 2022 -0700 drivers/base/node.c: fix compaction sysfs file leak Compaction sysfs file is created via compaction_register_node in register_node. But we forgot to remove it in unregister_node. Thus compaction sysfs file is leaked. Using compaction_unregister_node to fix this issue. Link: https://lkml.kernel.org/r/20220401070905.43679-1-linmiaohe@huawei.com Fixes: ed4a6d7f0676 ("mm: compaction: add /sys trigger for per-node memory compaction") Signed-off-by: Miaohe Lin Cc: Greg Kroah-Hartman Cc: Rafael J. Wysocki Cc: Mel Gorman Cc: Minchan Kim Cc: KAMEZAWA Hiroyuki Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton commit 4af12d04e71c2d0d961c4921602e577d6cc6010e Author: Miaohe Lin Date: Thu Apr 28 23:16:06 2022 -0700 mm: compaction: use helper isolation_suitable() Use helper isolation_suitable() to check whether page is suitable to isolate to simplify the code. Minor readability improvement. Link: https://lkml.kernel.org/r/20220322110750.60311-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Andrew Morton Reviewed-by: Wei Yang Signed-off-by: Andrew Morton commit daf79bd8ee1c8187c133c77a82943ae50994bb66 Author: Miaohe Lin Date: Thu Apr 28 23:16:06 2022 -0700 mm/z3fold: remove unneeded PAGE_HEADLESS check in free_handle() The only caller z3fold_free() never calls free_handle() in PAGE_HEADLESS case. Remove this unneeded check. Link: https://lkml.kernel.org/r/20220308134311.59086-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 52fb90cc19197f831e5e76e994ae82a29532d89f Author: Miaohe Lin Date: Thu Apr 28 23:16:06 2022 -0700 mm/z3fold: remove redundant list_del_init of zhdr->buddy in z3fold_free do_compact_page() will do list_del_init(&zhdr->buddy) for us. Remove this extra one to save some possible cpu cycles. Link: https://lkml.kernel.org/r/20220308134311.59086-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 5e36c25b2c1aeee16df21d5e4fef22d7ff2b80cf Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: move decrement of pool->pages_nr into __release_z3fold_page() The z3fold will always do atomic64_dec(&pool->pages_nr) when the __release_z3fold_page() is called. Thus we can move decrement of pool->pages_nr into __release_z3fold_page() to simplify the code. Also we can reduce the size of z3fold.o ~1k. Without this patch: text data bss dec hex filename 15444 1376 8 16828 41bc mm/z3fold.o With this patch: text data bss dec hex filename 15044 1248 8 16300 3fac mm/z3fold.o Link: https://lkml.kernel.org/r/20220308134311.59086-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Vitaly Wool Signed-off-by: Andrew Morton commit a3148b5fea52d86b8d1c2445b09ca1033f29fdf0 Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: remove confusing local variable l reassignment The local variable l holds the address of unbuddied[i] which won't change after we take the pool lock. Remove it to avoid confusion. Link: https://lkml.kernel.org/r/20220308134311.59086-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 8ea2f86cea6ea9fad665c96431ce634e3284b7d0 Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: remove unneeded page_mapcount_reset and ClearPagePrivate Page->page_type and PagePrivate are not used in z3fold. We should remove these confusing unneeded operations. The z3fold do these here is due to referring to zsmalloc's migration code which does need these operations. Link: https://lkml.kernel.org/r/20220308134311.59086-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit ed0e5dcab3a76782f20189e844e6aeb6110c0706 Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: minor clean up for z3fold_free Use put_z3fold_header() to pair with get_z3fold_header. Also fix the wrong comments. Minor readability improvement. Link: https://lkml.kernel.org/r/20220308134311.59086-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit 78da57d401f8ebe3c15e8e80047eefa87df69ca3 Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: remove obsolete comment in z3fold_alloc The highmem pages are supported since commit f1549cb5ab2b ("mm/z3fold.c: allow __GFP_HIGHMEM in z3fold_alloc"). Remove the residual comment. Link: https://lkml.kernel.org/r/20220308134311.59086-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit dc3a1f3024b3222e21176249eea38ccb5d562218 Author: Miaohe Lin Date: Thu Apr 28 23:16:05 2022 -0700 mm/z3fold: declare z3fold_mount with __init Patch series "A few cleanup patches for z3fold", v2. This series contains a few patches to simplify the code, remove unneeded code, fix obsolete comment and so on. More details can be found in the respective changelogs. This patch (of 8): z3fold_mount is only called during init. So we should declare it with __init. Link: https://lkml.kernel.org/r/20220308134311.59086-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220308134311.59086-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Vitaly Wool Signed-off-by: Andrew Morton commit c310e06cc4e44b4ec4bc02f0494a7f55cc36c1be Author: Xianting Tian Date: Thu Apr 28 23:16:04 2022 -0700 fs/proc/task_mmu.c: remove redundant page validation of pte_page pte_page() always returns a valid page, so remove the redundant page validation, as we did in many other places. Link: https://lkml.kernel.org/r/20220316025947.328276-1-xianting.tian@linux.alibaba.com Signed-off-by: Xianting Tian Reviewed-by: Chaitanya Kulkarni Cc: Alexey Dobriyan Cc: Yang Shi Cc: Sasha Levin Cc: Miaohe Lin Signed-off-by: Andrew Morton commit b2cb6826b6df2bdf91ae4406fd2ef97da7a9cd35 Author: Miaohe Lin Date: Thu Apr 28 23:16:04 2022 -0700 mm/vmscan: fix comment for isolate_lru_pages Since commit 791b48b64232 ("mm: vmscan: scan until it finds eligible pages"), splicing any skipped pages to the tail of the LRU list won't put the system at risk of premature OOM but will waste lots of cpu cycles. Correct the comment accordingly. Link: https://lkml.kernel.org/r/20220416025231.8082-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Minchan Kim Signed-off-by: Andrew Morton commit 5829f7dbae4158f9c946fac42760de848a8f1695 Author: Miaohe Lin Date: Thu Apr 28 23:16:04 2022 -0700 mm/vmscan: fix comment for current_may_throttle Since commit 6d6435811c19 ("remove bdi_congested() and wb_congested() and related functions"), there is no congested backing device check anymore. Correct the comment accordingly. [akpm@linux-foundation.org: tweak grammar] Link: https://lkml.kernel.org/r/20220414120202.30082-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton commit 02e458d8d04ed952a0451c094e6498c6829c28e8 Author: Miaohe Lin Date: Thu Apr 28 23:16:04 2022 -0700 mm/vmscan: remove obsolete comment in get_scan_count Since commit 1431d4d11abb ("mm: base LRU balancing on an explicit cost model"), the relative value of each set of LRU lists is based on cost model instead of rotated/scanned ratio. Cleanup the relevant comment. Link: https://lkml.kernel.org/r/20220409030245.61211-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton commit 8b3a899abe15e68b8b82ff96c2f4e8c9a37874a0 Author: Wei Yang Date: Thu Apr 28 23:16:04 2022 -0700 mm/vmscan: sc->reclaim_idx must be a valid zone index lruvec_lru_size() is only used in get_scan_count(), so the only possible zone_idx is sc->reclaim_idx. Since sc->reclaim_idx is ensured to be a valid zone idex, we can remove the extra check for zone iteration. Link: https://lkml.kernel.org/r/20220317234624.23358-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Cc: Johannes Weiner Signed-off-by: Andrew Morton commit bc53008eea55330f485c956338d3c59f96c70c08 Author: Wei Yang Date: Thu Apr 28 23:16:03 2022 -0700 mm/vmscan: make sure wakeup_kswapd with managed zone wakeup_kswapd() only wake up kswapd when the zone is managed. For two callers of wakeup_kswapd(), they are node perspective. * wake_all_kswapds * numamigrate_isolate_page If we picked up a !managed zone, this is not we expected. This patch makes sure we pick up a managed zone for wakeup_kswapd(). And it also use managed_zone in migrate_balanced_pgdat() to get the proper zone. [richard.weiyang@gmail.com: adjust the usage in migrate_balanced_pgdat()] Link: https://lkml.kernel.org/r/20220329010901.1654-2-richard.weiyang@gmail.com Link: https://lkml.kernel.org/r/20220327024101.10378-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: "Huang, Ying" Reviewed-by: Miaohe Lin Reviewed-by: David Hildenbrand Cc: Mel Gorman Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 36c26128b8983d9af58266c36f23209064e22108 Author: Wei Yang Date: Thu Apr 28 23:16:03 2022 -0700 mm/vmscan: reclaim only affects managed_zones As mentioned in commit 6aa303defb74 ("mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator") , reclaim only affects managed_zones. Let's adjust the code and comment accordingly. Link: https://lkml.kernel.org/r/20220327024101.10378-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: "Huang, Ying" Cc: Mel Gorman Signed-off-by: Andrew Morton commit 1e63ac088f20f7a4425c430c31ecd3cf167fb3f2 Author: Muchun Song Date: Thu Apr 28 23:16:03 2022 -0700 arm64: mm: hugetlb: enable HUGETLB_PAGE_FREE_VMEMMAP for arm64 The feature of minimizing overhead of struct page associated with each HugeTLB page aims to free its vmemmap pages (used as struct page) to save memory, where is ~14GB/16GB per 1TB HugeTLB pages (2MB/1GB type). In short, when a HugeTLB page is allocated or freed, the vmemmap array representing the range associated with the page will need to be remapped. When a page is allocated, vmemmap pages are freed after remapping. When a page is freed, previously discarded vmemmap pages must be allocated before remapping. More implementations and details can be found here [1]. The infrastructure of freeing vmemmap pages associated with each HugeTLB page is already there, we can easily enable HUGETLB_PAGE_FREE_VMEMMAP for arm64, the only thing to be fixed is flush_dcache_page() . flush_dcache_page() need to be adapted to operate on the head page's flags since the tail vmemmap pages are mapped with read-only after the feature is enabled (clear operation is not permitted). There was some discussions about this in the thread [2], but there was no conclusion in the end. And I copied the concern proposed by Anshuman to here and explain why those concern is superfluous. It is safe to enable it for x86_64 as well as arm64. 1st concern: ''' But what happens when a hot remove section's vmemmap area (which is being teared down) is nearby another vmemmap area which is either created or being destroyed for HugeTLB alloc/free purpose. As you mentioned HugeTLB pages inside the hot remove section might be safe. But what about other HugeTLB areas whose vmemmap area shares page table entries with vmemmap entries for a section being hot removed ? Massive HugeTLB alloc /use/free test cycle using memory just adjacent to a memory hotplug area, which is always added and removed periodically, should be able to expose this problem. ''' Answer: At the time memory is removed, all HugeTLB pages either have been migrated away or dissolved. So there is no race between memory hot remove and free_huge_page_vmemmap(). Therefore, HugeTLB pages inside the hot remove section is safe. Let's talk your question "what about other HugeTLB areas whose vmemmap area shares page table entries with vmemmap entries for a section being hot removed ?", the question is not established. The minimal granularity size of hotplug memory 128MB (on arm64, 4k base page), any HugeTLB smaller than 128MB is within a section, then, there is no share PTE page tables between HugeTLB in this section and ones in other sections and a HugeTLB page could not cross two sections. In this case, the section cannot be freed. Any HugeTLB bigger than 128MB (section size) whose vmemmap pages is an integer multiple of 2MB (PMD-mapped). As long as: 1) HugeTLBs are naturally aligned, power-of-two sizes 2) The HugeTLB size >= the section size 3) The HugeTLB size >= the vmemmap leaf mapping size Then a HugeTLB will not share any leaf page table entries with *anything else*, but will share intermediate entries. In this case, at the time memory is removed, all HugeTLB pages either have been migrated away or dissolved. So there is also no race between memory hot remove and free_huge_page_vmemmap(). 2nd concern: ''' differently, not sure if ptdump would require any synchronization. Dumping an wrong value is probably okay but crashing because a page table entry is being freed after ptdump acquired the pointer is bad. On arm64, ptdump() is protected against hotremove via [get|put]_online_mems(). ''' Answer: The ptdump should be fine since vmemmap_remap_free() only exchanges PTEs or splits the PMD entry (which means allocating a PTE page table). Both operations do not free any page tables (PTE), so ptdump cannot run into a UAF on any page tables. The worst case is just dumping an wrong value. [1] https://lore.kernel.org/all/20210510030027.56044-1-songmuchun@bytedance.com/ [2] https://lore.kernel.org/all/20210518091826.36937-1-songmuchun@bytedance.com/ [songmuchun@bytedance.com: restructure the code comment inside flush_dcache_page()] Link: https://lkml.kernel.org/r/20220414072646.21910-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220331065640.5777-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Barry Song Tested-by: Barry Song Cc: Will Deacon Cc: David Hildenbrand Cc: Bodeddula Balasubramaniam Cc: Oscar Salvador Cc: Mike Kravetz Cc: David Rientjes Cc: Mark Rutland Cc: Catalin Marinas Cc: James Morse Cc: Xiongchun Duan Cc: Fam Zheng Signed-off-by: Andrew Morton commit 2e4ec02bbcc05b8905d65c763ebde6bc85508e90 Author: Muchun Song Date: Thu Apr 28 23:16:03 2022 -0700 mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP The feature of minimizing overhead of struct page associated with each HugeTLB page is implemented on x86_64, however, the infrastructure of this feature is already there, we could easily enable it for other architectures. Introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP for other architectures to be easily enabled. Just select this config if they want to enable this feature. Link: https://lkml.kernel.org/r/20220331065640.5777-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Suggested-by: Andrew Morton Reviewed-by: Barry Song Tested-by: Barry Song Reviewed-by: Anshuman Khandual Cc: Bodeddula Balasubramaniam Cc: Catalin Marinas Cc: David Hildenbrand Cc: David Rientjes Cc: Fam Zheng Cc: James Morse Cc: Mark Rutland Cc: Mike Kravetz Cc: Oscar Salvador Cc: Will Deacon Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 84448c8ecd9a130e8cddef5c585446c5520e774b Author: Jakob Koschel Date: Thu Apr 28 23:16:03 2022 -0700 hugetlb: remove use of list iterator variable after loop In preparation to limit the scope of the list iterator to the list traversal loop, use a dedicated pointer to iterate through the list [1]. Before hugetlb_resv_map_add() was expecting a file_region struct, but in case the list iterator in add_reservation_in_range() did not exit early, the variable passed in, is not actually a valid structure. In such a case 'rg' is computed on the head element of the list and represents an out-of-bounds pointer. This still remains safe *iff* you only use the link member (as it is done in hugetlb_resv_map_add()). To avoid the type-confusion altogether and limit the list iterator to the loop, only a list_head pointer is kept to pass to hugetlb_resv_map_add(). Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Link: https://lkml.kernel.org/r/20220331224323.903842-1-jakobkoschel@gmail.com Signed-off-by: Jakob Koschel Cc: Mike Kravetz Cc: Mike Rapoport Cc: "Brian Johannesmeyer" Cc: Cristiano Giuffrida Cc: "Bos, H.J." Cc: Jakob Koschel Signed-off-by: Andrew Morton commit b283d983a7a6ffe3939ff26f06d151331a7c1071 Author: Naoya Horiguchi Date: Thu Apr 28 23:16:02 2022 -0700 mm, hugetlb, hwpoison: separate branch for free and in-use hugepage We know that HPageFreed pages should have page refcount 0, so get_page_unless_zero() always fails and returns 0. So explicitly separate the branch based on page state for minor optimization and better readability. Link: https://lkml.kernel.org/r/20220415041848.GA3034499@ik1-406-35019.vs.sakura.ne.jp Signed-off-by: Naoya Horiguchi Suggested-by: Mike Kravetz Suggested-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Miaohe Lin Signed-off-by: Andrew Morton commit ef526b17bc3399b8df25d574aa11fc36f89da80a Author: Miaohe Lin Date: Thu Apr 28 23:16:02 2022 -0700 mm/memory-failure.c: dissolve truncated hugetlb page If me_huge_page meets a truncated but not yet freed hugepage, it won't be dissolved even if we hold the last refcnt. It's because the hugepage has NULL page_mapping while it's not anonymous hugepage too. Thus we lose the last chance to dissolve it into buddy to save healthy subpages. Remove PageAnon check to handle these hugepages too. Link: https://lkml.kernel.org/r/20220414114941.11223-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Cc: David Hildenbrand Cc: Yang Shi Signed-off-by: Andrew Morton commit 3f871370686ddf3c72207321eef8f6672ae957e4 Author: Miaohe Lin Date: Thu Apr 28 23:16:02 2022 -0700 mm/memory-failure.c: minor cleanup for HWPoisonHandlable Patch series "A few fixup and cleanup patches for memory failure", v2. This series contains a patch to clean up the HWPoisonHandlable and another one to dissolve truncated hugetlb page. More details can be found in the respective changelogs. This patch (of 2): The local variable movable can be removed by returning true directly. Also fix typo 'mirgate'. No functional change intended. Link: https://lkml.kernel.org/r/20220414114941.11223-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220414114941.11223-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton commit 2ba2b008a8bf5fd268a43d03ba79e0ad464d6836 Author: Naoya Horiguchi Date: Thu Apr 28 23:16:02 2022 -0700 Revert "mm/memory-failure.c: fix race with changing page compound again" Reverts commit 888af2701db7 ("mm/memory-failure.c: fix race with changing page compound again") because now we fetch the page refcount under hugetlb_lock in try_memory_failure_hugetlb() so that the race check is no longer necessary. Link: https://lkml.kernel.org/r/20220408135323.1559401-4-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Suggested-by: Miaohe Lin Reviewed-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Miaohe Lin Cc: Yang Shi Cc: Dan Carpenter Signed-off-by: Andrew Morton commit f361e2462e8cccdd9231aa3274690705a2ea35a2 Author: Naoya Horiguchi Date: Thu Apr 28 23:16:02 2022 -0700 mm/hwpoison: put page in already hwpoisoned case with MF_COUNT_INCREASED In already hwpoisoned case, memory_failure() is supposed to return with releasing the page refcount taken for error handling. But currently the refcount is not released when called with MF_COUNT_INCREASED, which makes page refcount inconsistent. This should be rare and non-critical, but it might be inconvenient in testing (unpoison doesn't work). Link: https://lkml.kernel.org/r/20220408135323.1559401-3-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Suggested-by: Miaohe Lin Reviewed-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Dan Carpenter Cc: Yang Shi Signed-off-by: Andrew Morton commit f142e70750a1ea36ba60fb4f24bc37713e921f73 Author: liqiong Date: Thu Apr 28 23:16:01 2022 -0700 mm/memory-failure.c: remove unnecessary (void*) conversions No need cast (void*) to (struct hwp_walk*). Link: https://lkml.kernel.org/r/20220322142826.25939-1-liqiong@nfschina.com Signed-off-by: liqiong Acked-by: Naoya Horiguchi Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit 8170ac4700d26f65a9a4ebc8ae488539158dc5f7 Author: Zi Yan Date: Thu Apr 28 23:16:01 2022 -0700 mm: wrap __find_buddy_pfn() with a necessary buddy page validation Whenever the buddy of a page is found from __find_buddy_pfn(), page_is_buddy() should be used to check its validity. Add a helper function find_buddy_page_pfn() to find the buddy page and do the check together. [ziy@nvidia.com: updates per David] Link: https://lkml.kernel.org/r/20220401230804.1658207-2-zi.yan@sent.com Link: https://lore.kernel.org/linux-mm/CAHk-=wji_AmYygZMTsPMdJ7XksMt7kOur8oDfDdniBRMjm4VkQ@mail.gmail.com/ Link: https://lkml.kernel.org/r/7236E7CA-B5F1-4C04-AB85-E86FA3E9A54B@nvidia.com Suggested-by: Linus Torvalds Signed-off-by: Zi Yan Acked-by: Vlastimil Babka Acked-by: David Hildenbrand Cc: Steven Rostedt (Google) Cc: Mel Gorman Cc: Mike Rapoport Cc: Oscar Salvador Signed-off-by: Andrew Morton commit bb0e28eb5bc2b3a22e47861ca59bccca566023e8 Author: Zi Yan Date: Thu Apr 28 23:16:01 2022 -0700 mm: page_alloc: simplify pageblock migratetype check in __free_one_page() Move pageblock migratetype check code in the while loop to simplify the logic. It also saves redundant buddy page checking code. Link: https://lkml.kernel.org/r/20220401230804.1658207-1-zi.yan@sent.com Link: https://lore.kernel.org/linux-mm/27ff69f9-60c5-9e59-feb2-295250077551@suse.cz/ Signed-off-by: Zi Yan Suggested-by: Vlastimil Babka Acked-by: Vlastimil Babka Acked-by: David Hildenbrand Cc: Linus Torvalds Cc: Mel Gorman Cc: Mike Rapoport Cc: Oscar Salvador Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 379313241e77abc18258da1afd49d111c72c5a3d Author: Wei Yang Date: Thu Apr 28 23:16:01 2022 -0700 mm/page_alloc: adding same penalty is enough to get round-robin order To make node order in round-robin in the same distance group, we add a penalty to the first node we got in each round. To get a round-robin order in the same distance group, we don't need to decrease the penalty since: * find_next_best_node() always iterates node in the same order * distance matters more then penalty in find_next_best_node() * in nodes with the same distance, the first one would be picked up So it is fine to increase same penalty when we get the first node in the same distance group. Since we just increase a constance of 1 to node penalty, it is not necessary to multiply MAX_NODE_LOAD for preference. [richard.weiyang@gmail.com: remove remove MAX_NODE_LOAD, per Vlastimil] Link: https://lkml.kernel.org/r/20220412001319.7462-1-richard.weiyang@gmail.com Link: https://lkml.kernel.org/r/20220123013537.20491-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Signed-off-by: Wei Yang Acked-by: Vlastimil Babka Acked-by: David Hildenbrand Acked-by: Oscar Salvador Cc: David Rientjes Cc: KAMEZAWA Hiroyuki Cc: Krupa Ramakrishnan Cc: Michal Hocko Signed-off-by: Andrew Morton commit 8d98e42fb20c25e8efdab4cc1ac46d52ba964aca Author: Joel Savitz Date: Thu Apr 28 23:16:01 2022 -0700 Documentation/sysctl: document page_lock_unfairness commit 5ef64cc8987a ("mm: allow a controlled amount of unfairness in the page lock") introduced a new systctl but no accompanying documentation. Add a simple entry to the documentation. Link: https://lkml.kernel.org/r/20220325164437.120246-1-jsavitz@redhat.com Signed-off-by: Joel Savitz Cc: Jonathan Corbet Cc: Vlastimil Babka Cc: Mel Gorman Cc: Dave Hansen Cc: Suren Baghdasaryan Cc: Mike Rapoport Cc: "zhangyi (F)" Cc: Charan Teja Reddy Cc: Linus Torvalds Signed-off-by: Andrew Morton commit 4fcdcc12915c70761ae6adf25e3a295a75a7431d Author: Yury Norov Date: Thu Apr 28 23:16:00 2022 -0700 vmap(): don't allow invalid pages vmap() takes struct page *pages as one of arguments, and user may provide an invalid pointer which may lead to corrupted translation table. An example of such behaviour is erroneous usage of virt_to_page(): vaddr1 = dma_alloc_coherent() page = virt_to_page() // Wrong here ... vaddr2 = vmap(page) memset(vaddr2) // Faulting here virt_to_page() returns a wrong pointer if vaddr1 is not a linear kernel address. The problem is that vmap() populates pte with bad pfn successfully, and it's much harder to debug at memory access time. This case should be caught by DEBUG_VIRTUAL being that enabled, but it's not enabled in popular distros. Kernel already checks the pages against NULL. In the case mentioned above, however, the address is not NULL, and it's big enough so that the hardware generated Address Size Abort on arm64: [ 665.484101] Unhandled fault at 0xffff8000252cd000 [ 665.488807] Mem abort info: [ 665.491617] ESR = 0x96000043 [ 665.494675] EC = 0x25: DABT (current EL), IL = 32 bits [ 665.499985] SET = 0, FnV = 0 [ 665.503039] EA = 0, S1PTW = 0 [ 665.506167] Data abort info: [ 665.509047] ISV = 0, ISS = 0x00000043 [ 665.512882] CM = 0, WnR = 1 [ 665.515851] swapper pgtable: 4k pages, 48-bit VAs, pgdp=00000000818cb000 [ 665.522550] [ffff8000252cd000] pgd=000000affcfff003, pud=000000affcffe003, pmd=0000008fad8c3003, pte=00688000a5217713 [ 665.533160] Internal error: level 3 address size fault: 96000043 [#1] SMP [ 665.539936] Modules linked in: [...] [ 665.616212] CPU: 178 PID: 13199 Comm: test Tainted: P OE 5.4.0-84-generic #94~18.04.1-Ubuntu [ 665.626806] Hardware name: HPE Apollo 70 /C01_APACHE_MB , BIOS L50_5.13_1.0.6 07/10/2018 [ 665.636618] pstate: 80400009 (Nzcv daif +PAN -UAO) [ 665.641407] pc : __memset+0x38/0x188 [ 665.645146] lr : test+0xcc/0x3f8 [ 665.650184] sp : ffff8000359bb840 [ 665.653486] x29: ffff8000359bb840 x28: 0000000000000000 [ 665.658785] x27: 0000000000000000 x26: 0000000000231000 [ 665.664083] x25: ffff00ae660f6110 x24: ffff00ae668cb800 [ 665.669382] x23: 0000000000000001 x22: ffff00af533e5000 [ 665.674680] x21: 0000000000001000 x20: 0000000000000000 [ 665.679978] x19: ffff00ae66950000 x18: ffffffffffffffff [ 665.685276] x17: 00000000588636a5 x16: 0000000000000013 [ 665.690574] x15: ffffffffffffffff x14: 000000000007ffff [ 665.695872] x13: 0000000080000000 x12: 0140000000000000 [ 665.701170] x11: 0000000000000041 x10: ffff8000652cd000 [ 665.706468] x9 : ffff8000252cf000 x8 : ffff8000252cd000 [ 665.711767] x7 : 0303030303030303 x6 : 0000000000001000 [ 665.717065] x5 : ffff8000252cd000 x4 : 0000000000000000 [ 665.722363] x3 : ffff8000252cdfff x2 : 0000000000000001 [ 665.727661] x1 : 0000000000000003 x0 : ffff8000252cd000 [ 665.732960] Call trace: [ 665.735395] __memset+0x38/0x188 [...] Interestingly, this abort happens even if copy_from_kernel_nofault() is used, which is quite inconvenient for debugging purposes. This patch adds a pfn_valid() check into vmap() path, so that invalid mapping will not be created; WARN_ON() is used to let client code know that something goes wrong, and it's not a regular EINVAL situation. Link: https://lkml.kernel.org/r/20220422220410.1308706-1-yury.norov@gmail.com Signed-off-by: Yury Norov (NVIDIA) Suggested-by: Matthew Wilcox (Oracle) Cc: Alexey Klimov Cc: Anshuman Khandual Cc: Catalin Marinas Cc: Ding Tianhong Cc: Mark Rutland Cc: Nicholas Piggin Cc: Robin Murphy Cc: Russell King Cc: Will Deacon Signed-off-by: Andrew Morton commit 98af39d52e336b2d7d7be67ac405f978d81f65b8 Author: Yixuan Cao Date: Thu Apr 28 23:16:00 2022 -0700 mm/vmalloc: fix a comment The sentence "but the mempolcy want to alloc memory by interleaving" should be rephrased with "but the mempolicy wants to alloc memory by interleaving" where "mempolicy" is a struct name. This work is coauthored by Yinan Zhang Jiajian Ye Shenghong Han Chongxi Zhao Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220401064543.4447-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Signed-off-by: Andrew Morton commit 9707aff701e325e7c4660409c43392ff2fb36fad Author: Lu Jialin Date: Thu Apr 28 23:16:00 2022 -0700 mm/memcontrol.c: remove unused private flag of memory.oom_control There is no use for the private value, __OOM_TYPE and OOM notifier OOM_CONTROL. Therefore remove them to make the code clean. Link: https://lkml.kernel.org/r/20220421122755.40899-1-lujialin4@huawei.com Signed-off-by: Lu Jialin Acked-by: Johannes Weiner Acked-by: Shakeel Butt Acked-by: Roman Gushchin Cc: Michal Hocko Signed-off-by: Andrew Morton commit ef7a4ffc4c7f969d61e297c53cb2de1d6f012a11 Author: Lu Jialin Date: Thu Apr 28 23:16:00 2022 -0700 mm/memcontrol.c: make cgroup_memory_noswap static cgroup_memory_noswap is only used in mm/memcontrol.c, therefore just make it static, and remove export in include/linux/memcontrol.h Link: https://lkml.kernel.org/r/20220421124736.62180-1-lujialin4@huawei.com Signed-off-by: Lu Jialin Acked-by: Johannes Weiner Acked-by: Shakeel Butt Acked-by: Roman Gushchin Reviewed-by: Muchun Song Cc: Michal Hocko Signed-off-by: Andrew Morton commit 9c946e3e7f579081a2dd6912a8a23baedef8c3f9 Author: Roman Gushchin Date: Thu Apr 28 23:16:00 2022 -0700 MAINTAINERS: add corresponding kselftests to memcg entry List memory control and kernel memory control kselftests in the memory resource controller entry. Link: https://lkml.kernel.org/r/20220415000133.3955987-5-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Chris Down Cc: David Vernet Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit 1bd1a4dd3e8ce8a23234a15c9dad4dcd257033fa Author: Roman Gushchin Date: Thu Apr 28 23:15:59 2022 -0700 MAINTAINERS: add corresponding kselftests to cgroup entry List cgroup kselftests in the cgroup MAINTAINERS entry. These are tests covering core, freezer and cgroup.kill functionality. Link: https://lkml.kernel.org/r/20220415000133.3955987-4-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Acked-by: Tejun Heo Cc: Zefan Li Cc: Johannes Weiner Cc: Chris Down Cc: David Vernet Cc: Michal Hocko Cc: Shakeel Butt Signed-off-by: Andrew Morton commit be74553f250fb2154375b8e14e9f9b58aafd23b0 Author: Roman Gushchin Date: Thu Apr 28 23:15:59 2022 -0700 kselftests: memcg: speed up the memory.high test After commit 0e4b01df8659 ("mm, memcg: throttle allocators when failing reclaim over memory.high") allocating memory over memory.high became very time consuming. But it's exactly what the memory.high test from cgroup kselftests is doing: it tries to allocate 100M with 30M memory.high value. It takes forever to complete. In order to keep it passing (or failing) in a reasonable amount of time let's try to allocate only a little over 30M: 31M to be precise. With this change test_memcontrol finishes in a reasonable amount of time: $ time ./test_memcontrol ok 1 test_memcg_subtree_control ok 2 test_memcg_current ok 3 test_memcg_min ok 4 test_memcg_low ok 5 test_memcg_high ok 6 test_memcg_max ok 7 test_memcg_oom_events ok 8 test_memcg_swap_max ok 9 test_memcg_sock ok 10 test_memcg_oom_group_leaf_events ok 11 test_memcg_oom_group_parent_events ok 12 test_memcg_oom_group_score_events real 0m2.273s user 0m0.064s sys 0m0.739s Link: https://lkml.kernel.org/r/20220415000133.3955987-3-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Reviewed-by: David Vernet Cc: Chris Down Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit c85bcc912f4f404bf6eaf4b6bdb8480ef2c2faa1 Author: Roman Gushchin Date: Thu Apr 28 23:15:59 2022 -0700 kselftests: memcg: update the oom group leaf events test Patch series "mm: memcg kselftests fixes". This patch (of 4): Commit 9852ae3fe529 ("mm, memcg: consider subtrees in memory.events") made memory.events recursive: all events are propagated upwards by the tree. It was a change in semantics. It broke the oom group leaf events test: it assumes that after an OOM the oom_kill counter is zero on parent's level. Let's adjust the test: it should have similar expectations for the child and parent levels. The test passes after this fix. Link: https://lkml.kernel.org/r/20220415000133.3955987-2-roman.gushchin@linux.dev Link: https://lkml.kernel.org/r/20220415000133.3955987-1-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Reviewed-by: David Vernet Cc: Chris Down Cc: Johannes Weiner Cc: Michal Hocko Cc: Shakeel Butt Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit c449d5599287742f11b0f2ae34b921dc0837d1c6 Author: Wei Yang Date: Thu Apr 28 23:15:59 2022 -0700 mm/memcg: non-hierarchical mode is deprecated After commit bef8620cd8e0 ("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent except root_mem_cgroup. And this case is handled when (memcg == root). Link: https://lkml.kernel.org/r/20220403020833.26164-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Roman Gushchin Reviewed-by: Shakeel Butt Cc: Johannes Weiner Signed-off-by: Andrew Morton commit a9320aae68a1cd3f41b9846e24504b09ffc3311e Author: Wei Yang Date: Thu Apr 28 23:15:59 2022 -0700 mm/memcg: move generation assignment and comparison together For each round-trip, we assign generation on first invocation and compare it on subsequent invocations. Let's move them together to make it more self-explaining. Also this reduce a check on prev. [hannes@cmpxchg.org: better comment to explain reclaim model] Link: https://lkml.kernel.org/r/20220330234719.18340-4-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin Signed-off-by: Andrew Morton commit 89d8330ccf2ad4c0744e1d1b77ffe2deb1641e54 Author: Wei Yang Date: Thu Apr 28 23:15:58 2022 -0700 mm/memcg: set pos explicitly for reclaim and !reclaim During mem_cgroup_iter, there are two ways to get iteration position: reclaim vs non-reclaim mode. Let's do it explicitly for reclaim vs non-reclaim mode. Link: https://lkml.kernel.org/r/20220330234719.18340-3-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Roman Gushchin Acked-by: Johannes Weiner Signed-off-by: Andrew Morton commit 41555dadbff8d2558d868110e47c24b747aad224 Author: Wei Yang Date: Thu Apr 28 23:15:58 2022 -0700 mm/memcg: set memcg after css verified and got reference Patch series "mm/memcg: some cleanup for mem_cgroup_iter()", v2. No functional change, try to make it more readable. This patch (of 3): Instead of resetting memcg when css is either not verified or not got reference, we can set it after these process. No functional change, just simplified the code a little. Link: https://lkml.kernel.org/r/20220330234719.18340-1-richard.weiyang@gmail.com Link: https://lkml.kernel.org/r/20220330234719.18340-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin Cc: Michal Hocko Cc: Shakeel Butt Signed-off-by: Andrew Morton commit 391e0efc15e9919cd74a5c29255441e1f643dcae Author: Wei Yang Date: Thu Apr 28 23:15:58 2022 -0700 mm/memcg: mz already removed from rb_tree if not NULL When mz is not NULL, it means mz can either come from mem_cgroup_largest_soft_limit_node or __mem_cgroup_largest_soft_limit_node. And both of them have removed this node by __mem_cgroup_remove_exceeded(). Not necessary to call __mem_cgroup_remove_exceeded() again. [mhocko@suse.com: refine changelog] Link: https://lkml.kernel.org/r/20220314233030.12334-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Signed-off-by: Andrew Morton commit d8f653386cb571b46e9ce7d9681d6dc4eae441d6 Author: Miaohe Lin Date: Thu Apr 28 23:15:58 2022 -0700 mm/memcg: remove unneeded nr_scanned The local variable nr_scanned is unneeded as mem_cgroup_soft_reclaim always does *total_scanned += nr_scanned. So we can pass total_scanned directly to the mem_cgroup_soft_reclaim to simplify the code and save some cpu cycles of adding nr_scanned to total_scanned. Link: https://lkml.kernel.org/r/20220328114144.53389-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Reviewed-by: Roman Gushchin Reviewed-by: Wei Yang Signed-off-by: Andrew Morton commit 9096bbe951ddd3f9dc813e73b5bde6d5715d1cdb Author: Miaohe Lin Date: Thu Apr 28 23:15:58 2022 -0700 mm: shmem: make shmem_init return void The return value of shmem_init is never used. So we can make it return void now. [akpm@linux-foundation.org: remove `return;' from void-returning function, per Muchun Song] Link: https://lkml.kernel.org/r/20220328112707.22217-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Muchun Song Cc: Hugh Dickins Signed-off-by: Andrew Morton commit 21f0dd88f23dc9dc46b781f8ec9acf975dca4e6e Author: Chen Wandun Date: Thu Apr 28 23:15:57 2022 -0700 mm: rework calculation of bdi_min_ratio in bdi_set_min_ratio In function bdi_set_min_ratio, min_ratio is unsigned int, it will result underflow when setting min_ratio below bdi->min_ratio, it is confusing. Rework it, no functional change. Link: https://lkml.kernel.org/r/20220422095159.2858305-1-chenwandun@huawei.com Signed-off-by: Chen Wandun Cc: Peter Zijlstra Cc: Jens Axboe Signed-off-by: Andrew Morton commit c7c4ab859642830a14c45785ca7866659b65fc44 Author: Yixuan Cao Date: Thu Apr 28 23:15:57 2022 -0700 tools/vm/page_owner_sort.c: avoid repeated judgments I noticed a detail that needs to be adjusted. When judging whether a page is allocated by vmalloc, the value of the variable "tmp" was repeatedly judged, so the code was adjusted. This work is coauthored by Yinan Zhang, Jiajian Ye, Shenghong Han, Chongxi Zhao, Yuhong Feng and Yongqiang Liu. Link: https://lkml.kernel.org/r/20220414042744.13896-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Chongxi Zhao Cc: Haowen Bai Cc: Jiajian Ye Cc: Sean Anderson Cc: Shenghong Han Cc: Yinan Zhang Cc: Yongqiang Liu Cc: Yuhong Feng Signed-off-by: Andrew Morton commit f09654bb88127473b4baf3bc0b68d4d4695aca7b Author: Yixuan Cao Date: Thu Apr 28 23:15:57 2022 -0700 tools/vm/page_owner_sort.c: provide allocator labelling and update --cull and --sort options An application is suspected of having memory leak when its memory consumption is high and keeps increasing. There are several commonly used memory allocators: slab, cma, vmalloc, etc. The memory leak identification can be sped up if the page information allocated by an allocator can be analyzed separately. This patch provides supports for memory allocator labelling for slab, vmalloc, and cma. The pages allocated by slab and cma can be confirmed from the "PFN" line according to the kernel codes, and the label of the vmalloc allocator can be obtained by analyzing the stack trace. Thanks for Vlastimil Babka's constructive suggestions. Based on Yinan Zhang's study, the call chain of vmalloc() is vmalloc() -> ... -> __vmalloc_node_range() -> __vmalloc_area_node(). __vmalloc_area_node() requests memory through the interface of buddy allocation system. In the current version, __vmalloc_area_node() uses four interfaces: alloc_pages_bulk_array_mempolicy(), alloc_pages_bulk_array_node(), alloc_pages() and alloc_pages_node(). By disassembling the code, we find that __vmalloc_area_node() is expanded in __vmalloc_node_range(). So __vmalloc_area_node is not in the stack trace. On the test machine, the stack trace of pages allocated by vmalloc has the following four forms: __alloc_pages_bulk+0x230/0x6a0 __vmalloc_node_range+0x19c/0x598 alloc_pages_bulk_array_mempolicy+0xbc/0x278 __vmalloc_node_range+0x1e8/0x598 __alloc_pages+0x160/0x2b0 __vmalloc_node_range+0x234/0x598 alloc_pages+0xac/0x150 __vmalloc_node_range+0x44c/0x598 Therefore, in two consecutive lines of stacktrace, if the first line contains the word "alloc_pages" and the second line contains the word "__vmalloc_node_range", it can be determined that the page is allocated by vmalloc. And the function offset and size are not the same on different machines, so there is no need to match them. At the same time, this patch updates the --cull and --sort options to support allocator-based merge statistics and sorting. The added functions are fully compatible with the original work. When using, you can use "allocator", or abbreviated as "ator". Relevant updates have also been made in the documentation(Documentation/vm/page_owner.rst). Example: ./page_owner_sort --cull=st,pid,name,allocator ./page_owner_sort --sort=ator,pid,name This work is coauthored by Jiajian Ye, Yinan Zhang, Shenghong Han, Chongxi Zhao, Yuhong Feng and Yongqiang Liu. Link: https://lkml.kernel.org/r/20220410132932.9402-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Chongxi Zhao Cc: Haowen Bai Cc: Jiajian Ye Cc: Sean Anderson Cc: Shenghong Han Cc: Yinan Zhang Cc: Yongqiang Liu Cc: Yuhong Feng Signed-off-by: Andrew Morton commit a72469aa593881c2a5ad3a38cfb3e7871c50f169 Author: Haowen Bai Date: Thu Apr 28 23:15:57 2022 -0700 tools/vm/page_owner: support debug log to avoid huge log print As normal usage, tool will print huge parser log and spend a lot of time printing, so it would be preferable add "-d" debug control to avoid this problem. Link: https://lkml.kernel.org/r/1649672446-5685-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Cc: Chongxi Zhao Cc: Jiajian Ye Cc: Shenghong Han Cc: Yinan Zhang Cc: Yixuan Cao Cc: Yongqiang Liu Cc: Yuhong Feng Cc: Sean Anderson Signed-off-by: Andrew Morton commit ebbeae36387ccf1326c896167872c3acf6c3c956 Author: Jiajian Ye Date: Thu Apr 28 23:15:57 2022 -0700 tools/vm/page_owner_sort.c: support sorting blocks by multiple keys When viewing page owner information, we may want to sort blocks of information by multiple keys, since one single key does not uniquely identify a block. Therefore, following adjustments are made: 1. Add a new --sort option to support sorting blocks of information by multiple keys. ./page_owner_sort --sort= ./page_owner_sort --sort is a single argument in the form of a comma-separated list, which offers a way to specify sorting order. Sorting syntax is [+|-]key[,[+|-]key[,...]]. The ascending or descending order can be specified by adding the + (ascending, default) or - (descend -ing) prefix to the key: ./page_owner_sort [option] --sort -key1,+key2,key3... For example, to sort the blocks first by task command name in lexicographic order and then by pid in ascending numerical order, use the following: ./page_owner_sort --sort=name,+pid To sort the blocks first by pid in ascending order and then by timestamp of the page when it is allocated in descending order, use the following: ./page_owner_sort --sort=pid,-alloc_ts 2. Add explanations of a newly added --sort option in the function usage() and the document(Documentation/vm/page_owner.rst). This work is coauthored by Yixuan Cao Shenghong Han Yinan Zhang Chongxi Zhao Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220401024856.767-3-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Chongxi Zhao Cc: Shenghong Han Cc: Yinan Zhang Cc: Yixuan Cao Cc: Yongqiang Liu Cc: Yuhong Feng Cc: Haowen Bai Cc: Sean Anderson Signed-off-by: Andrew Morton commit 75382a2dca0e9e9e57e88b479cf537549461a934 Author: Jiajian Ye Date: Thu Apr 28 23:15:56 2022 -0700 tools/vm/page_owner_sort.c: support for multi-value selection in single argument When viewing page owner information, we may want to select blocks whose PID/TGID/TASK_COMM_NAME appears in a user-specified list for data analysis and aggregation. But currently page_owner_sort only supports selecting blocks associated with only one specified PID/TGID/TASK_COMM_NAME. Therefore, following adjustments are made to fix the problem: 1. Enhance selecting function to support the selection of multiple PIDs/TGIDs/TASK_COMM_NAMEs. The enhanced usages are as follows: --pid Select by pid. This selects the blocks whose PID numbers appear in . --tgid Select by tgid. This selects the blocks whose TGID numbers appear in . --name Select by task command name. This selects the blocks whose task command name appear in . Where , , are single arguments in the form of a comma-separated list,which offers a way to specify individual selecting rules. For example, if you want to select blocks whose tgids are 1, 2 or 3, you have to use 4 commands as follows: ./page_owner_sort --tgid=1 ./page_owner_sort --tgid=2 ./page_owner_sort --tgid=3 cat > With this patch, you can use only 1 command to obtain the same result as above: ./page_owner_sort --tgid=1,2,3 2. Update explanations of --pid, --tgid and --name in the function usage() and the document(Documents/vm/page_owner.rst). This work is coauthored by Yixuan Cao Shenghong Han Yinan Zhang Chongxi Zhao Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220401024856.767-2-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Chongxi Zhao Cc: Shenghong Han Cc: Yinan Zhang Cc: Yixuan Cao Cc: Yongqiang Liu Cc: Yuhong Feng Cc: Haowen Bai Cc: Sean Anderson Signed-off-by: Andrew Morton commit 329687a03d18143f491b535d22be1cccc291bb58 Author: Jiajian Ye Date: Thu Apr 28 23:15:56 2022 -0700 tools/vm/page_owner_sort.c: use fprintf() to send error messages to stderr Error messages should be send to stderr using fprintf() instead of printf(). This work is coauthored by Yixuan Cao Shenghong Han Yinan Zhang Chongxi Zhao Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220401024856.767-1-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Shenghong Han Cc: Yixuan Cao Cc: Yinan Zhang Cc: Chongxi Zhao Cc: Yuhong Feng Cc: Yongqiang Liu Cc: Haowen Bai Cc: Sean Anderson Signed-off-by: Andrew Morton commit b72a4aff947ba807177bdabb43debaf2c66bee05 Author: Abhishek Kumar Date: Wed Apr 27 10:37:33 2022 +0300 ath10k: skip ath10k_halt during suspend for driver state RESTARTING Double free crash is observed when FW recovery(caused by wmi timeout/crash) is followed by immediate suspend event. The FW recovery is triggered by ath10k_core_restart() which calls driver clean up via ath10k_halt(). When the suspend event occurs between the FW recovery, the restart worker thread is put into frozen state until suspend completes. The suspend event triggers ath10k_stop() which again triggers ath10k_halt() The double invocation of ath10k_halt() causes ath10k_htt_rx_free() to be called twice(Note: ath10k_htt_rx_alloc was not called by restart worker thread because of its frozen state), causing the crash. To fix this, during the suspend flow, skip call to ath10k_halt() in ath10k_stop() when the current driver state is ATH10K_STATE_RESTARTING. Also, for driver state ATH10K_STATE_RESTARTING, call ath10k_wait_for_suspend() in ath10k_stop(). This is because call to ath10k_wait_for_suspend() is skipped later in [ath10k_halt() > ath10k_core_stop()] for the driver state ATH10K_STATE_RESTARTING. The frozen restart worker thread will be cancelled during resume when the device comes out of suspend. Below is the crash stack for reference: [ 428.469167] ------------[ cut here ]------------ [ 428.469180] kernel BUG at mm/slub.c:4150! [ 428.469193] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 428.469219] Workqueue: events_unbound async_run_entry_fn [ 428.469230] RIP: 0010:kfree+0x319/0x31b [ 428.469241] RSP: 0018:ffffa1fac015fc30 EFLAGS: 00010246 [ 428.469247] RAX: ffffedb10419d108 RBX: ffff8c05262b0000 [ 428.469252] RDX: ffff8c04a8c07000 RSI: 0000000000000000 [ 428.469256] RBP: ffffa1fac015fc78 R08: 0000000000000000 [ 428.469276] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 428.469285] Call Trace: [ 428.469295] ? dma_free_attrs+0x5f/0x7d [ 428.469320] ath10k_core_stop+0x5b/0x6f [ 428.469336] ath10k_halt+0x126/0x177 [ 428.469352] ath10k_stop+0x41/0x7e [ 428.469387] drv_stop+0x88/0x10e [ 428.469410] __ieee80211_suspend+0x297/0x411 [ 428.469441] rdev_suspend+0x6e/0xd0 [ 428.469462] wiphy_suspend+0xb1/0x105 [ 428.469483] ? name_show+0x2d/0x2d [ 428.469490] dpm_run_callback+0x8c/0x126 [ 428.469511] ? name_show+0x2d/0x2d [ 428.469517] __device_suspend+0x2e7/0x41b [ 428.469523] async_suspend+0x1f/0x93 [ 428.469529] async_run_entry_fn+0x3d/0xd1 [ 428.469535] process_one_work+0x1b1/0x329 [ 428.469541] worker_thread+0x213/0x372 [ 428.469547] kthread+0x150/0x15f [ 428.469552] ? pr_cont_work+0x58/0x58 [ 428.469558] ? kthread_blkcg+0x31/0x31 Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1 Co-developed-by: Wen Gong Signed-off-by: Wen Gong Signed-off-by: Abhishek Kumar Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220426221859.v2.1.I650b809482e1af8d0156ed88b5dc2677a0711d46@changeid commit 2950833f10cfa601813262e1d9c8473f9415681b Author: Wan Jiabing Date: Wed Apr 27 10:37:32 2022 +0300 ath9k: hif_usb: simplify if-if to if-else Use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220424094441.104937-1-wanjiabing@vivo.com commit 5ad784d990ac5d9b3ee74c637bc835501df1ff87 Author: Michael Walle Date: Mon Apr 18 13:28:37 2022 +0200 mtd: spi-nor: amend the rdsr dummy cycles documentation The rdsr dummy cycles are only used by the 8d-8d-8d mode. Mention that in the documentation. Signed-off-by: Michael Walle Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220418112837.2792242-1-michael@walle.cc commit 11dc130b4ee010396b5374300e03f0b6c729ce8c Author: Yang Li Date: Wed Apr 27 08:31:42 2022 +0800 rtw89: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/net/wireless/realtek/rtw89/rtw8852c.c:2556:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220427003142.107916-1-yang.lee@linux.alibaba.com commit 11aeb93089ce0bf12ef79fe4d05fde075275e125 Author: Colin Ian King Date: Sun Apr 24 19:11:56 2022 +0100 hwrng: optee - remove redundant initialization to variable rng_size Variable rng_size is being initialized with a value that is never read, the variable is being re-assigned later on. The initialization is redundant and can be removed. Cleans up cppcheck warning: Variable 'rng_size' is assigned a value that is never used. Signed-off-by: Colin Ian King Reviewed-by: Sumit Garg Signed-off-by: Herbert Xu commit fd463e980f00a0fc7d7e462bd336efb819c04f9e Author: Haowen Bai Date: Sun Apr 24 16:50:31 2022 +0800 crypto: qat - Fix unsigned function returning negative constant The function qat_uclo_check_image_compat has an unsigned return type, but returns a negative constant to indicate an error condition. So we change unsigned to int. Signed-off-by: Haowen Bai Acked-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 7cc7ab73f83ee6d50dc9536bc3355495d8600fad Author: Vitaly Chikunov Date: Thu Apr 21 20:25:10 2022 +0300 crypto: ecrdsa - Fix incorrect use of vli_cmp Correctly compare values that shall be greater-or-equal and not just greater. Fixes: 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm") Cc: Signed-off-by: Vitaly Chikunov Signed-off-by: Herbert Xu commit 4ee4cdad368a26de3967f2975806a9ee2fa245df Author: Fabio Estevam Date: Wed Apr 20 09:06:01 2022 -0300 crypto: caam - fix i.MX6SX entropy delay value Since commit 358ba762d9f1 ("crypto: caam - enable prediction resistance in HRWNG") the following CAAM errors can be seen on i.MX6SX: caam_jr 2101000.jr: 20003c5b: CCB: desc idx 60: RNG: Hardware error hwrng: no data available This error is due to an incorrect entropy delay for i.MX6SX. Fix it by increasing the minimum entropy delay for i.MX6SX as done in U-Boot: https://patchwork.ozlabs.org/project/uboot/patch/20220415111049.2565744-1-gaurav.jain@nxp.com/ As explained in the U-Boot patch: "RNG self tests are run to determine the correct entropy delay. Such tests are executed with different voltages and temperatures to identify the worst case value for the entropy delay. For i.MX6SX, it was determined that after adding a margin value of 1000 the minimum entropy delay should be at least 12000." Cc: Fixes: 358ba762d9f1 ("crypto: caam - enable prediction resistance in HRWNG") Signed-off-by: Fabio Estevam Reviewed-by: Horia Geantă Reviewed-by: Vabhav Sharma Reviewed-by: Gaurav Jain Signed-off-by: Herbert Xu commit d3bae86698720f6fc2ca07d3850ec3167a11ec2b Author: Minghao Chi Date: Wed Apr 20 03:02:18 2022 +0000 crypto: sun8i-ce - using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Tested-by: Corentin Labbe Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit ee74fdf0ca74e6a65716400b403285686133a9f8 Author: Minghao Chi Date: Mon Apr 18 11:05:37 2022 +0000 crypto: sun8i-ss - using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Herbert Xu commit cca806307311bec150268646572ef6a3548ac295 Author: Lv Ruyi Date: Mon Apr 18 01:57:00 2022 +0000 crypto: keembay - Make use of devm helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately.Make the code simpler without functional changes. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Herbert Xu commit 05def5cacfa0bd5ba380116046747da07ff5bd78 Author: Jacky Li Date: Thu Apr 14 16:23:25 2022 +0000 crypto: ccp - Fix the INIT_EX data file open failure There are 2 common cases when INIT_EX data file might not be opened successfully and fail the sev initialization: 1. In user namespaces, normal user tasks (e.g. VMM) can change their current->fs->root to point to arbitrary directories. While init_ex_path is provided as a module param related to root file system. Solution: use the root directory of init_task to avoid accessing the wrong file. 2. Normal user tasks (e.g. VMM) don't have the privilege to access the INIT_EX data file. Solution: open the file as root and restore permissions immediately. Fixes: 3d725965f836 ("crypto: ccp - Add SEV_INIT_EX support") Signed-off-by: Jacky Li Reviewed-by: Peter Gonda Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 20b87e7c29dffcfa3f96f2e99daec84fd46cabdb Author: Mykola Lysenko Date: Thu Apr 28 15:57:44 2022 -0700 selftests/bpf: Fix two memory leaks in prog_tests Fix log_fp memory leak in dispatch_thread_read_log. Remove obsolete log_fp clean-up code in dispatch_thread. Also, release memory of subtest_selector. This can be reproduced with -n 2/1 parameters. Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220428225744.1961643-1-mykolal@fb.com commit e96a76ee5283d509f2bf45133d147e77f73a1b15 Author: Michael Ellerman Date: Fri Mar 18 01:39:25 2022 +1100 selftests/powerpc: Add a test of 4PB SLB handling Add a test for a bug we had in the 4PB address space SLB handling. It was fixed in commit 4c2de74cc869 ("powerpc/64: Interrupts save PPR on stack rather than thread_struct"). Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220317143925.1030447-1-mpe@ellerman.id.au commit a2c70dbc3407b99e716a362be2df3ed9bbed1d35 Merge: 32c03c4954a03 68964e155677a Author: Alexei Starovoitov Date: Thu Apr 28 20:03:30 2022 -0700 Merge branch 'libbpf: allow to opt-out from BPF map creation' Andrii Nakryiko says: ==================== Add bpf_map__set_autocreate() API which is a BPF map counterpart of bpf_program__set_autoload() and serves similar goal of allowing to build more flexible CO-RE applications. See patch #3 for example scenarios in which the need for such API came up previously. Patch #1 is a follow-up patch to previous patch set adding verifier log fixup logic, making sure bpf_core_format_spec()'s return result is used for something useful. Patch #2 is a small refactoring to avoid unnecessary verbose memory management around obj->maps array. Patch #3 adds and API and corresponding BPF verifier log fix up logic to provide human-comprehensible error message with useful details. Patch #4 adds a simple selftest validating both the API itself and libbpf's log fixup logic for it. ==================== Signed-off-by: Alexei Starovoitov commit 68964e155677ab6eca21784a248b8e65fb745660 Author: Andrii Nakryiko Date: Wed Apr 27 21:15:23 2022 -0700 selftests/bpf: Test bpf_map__set_autocreate() and related log fixup logic Add a subtest that excercises bpf_map__set_autocreate() API and validates that libbpf properly fixes up BPF verifier log with correct map information. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220428041523.4089853-5-andrii@kernel.org commit ec41817b4af5114825621fe9b31cb861480f6cd7 Author: Andrii Nakryiko Date: Wed Apr 27 21:15:22 2022 -0700 libbpf: Allow to opt-out from creating BPF maps Add bpf_map__set_autocreate() API that allows user to opt-out from libbpf automatically creating BPF map during BPF object load. This is a useful feature when building CO-RE-enabled BPF application that takes advantage of some new-ish BPF map type (e.g., socket-local storage) if kernel supports it, but otherwise uses some alternative way (e.g., extra HASH map). In such case, being able to disable the creation of a map that kernel doesn't support allows to successfully create and load BPF object file with all its other maps and programs. It's still up to user to make sure that no "live" code in any of their BPF programs are referencing such map instance, which can be achieved by guarding such code with CO-RE relocation check or by using .rodata global variables. If user fails to properly guard such code to turn it into "dead code", libbpf will helpfully post-process BPF verifier log and will provide more meaningful error and map name that needs to be guarded properly. As such, instead of: ; value = bpf_map_lookup_elem(&missing_map, &zero); 4: (85) call unknown#2001000000 invalid func unknown#2001000000 ... user will see: ; value = bpf_map_lookup_elem(&missing_map, &zero); 4: BPF map 'missing_map' is referenced but wasn't created Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220428041523.4089853-4-andrii@kernel.org commit 69721203b1f3f9d123ae0f81bbf41f9a85185859 Author: Andrii Nakryiko Date: Wed Apr 27 21:15:21 2022 -0700 libbpf: Use libbpf_mem_ensure() when allocating new map Reuse libbpf_mem_ensure() when adding a new map to the list of maps inside bpf_object. It takes care of proper resizing and reallocating of map array and zeroing out newly allocated memory. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220428041523.4089853-3-andrii@kernel.org commit b198881d4b4c22c499168421b44eff3913a22fb1 Author: Andrii Nakryiko Date: Wed Apr 27 21:15:20 2022 -0700 libbpf: Append "..." in fixed up log if CO-RE spec is truncated Detect CO-RE spec truncation and append "..." to make user aware that there was supposed to be more of the spec there. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220428041523.4089853-2-andrii@kernel.org commit 665ca429bc4131f9165f119ad3ed81c786bf3262 Author: Adam Skladowski Date: Tue Apr 26 11:02:17 2022 +0200 clk: qcom: smd: Update MSM8976 RPM clocks. MSM8976 does not have rpm clock named mmssnoc, instead it's called sysmmnoc, drop define and reuse. While we are at it add XO clock to list. Fixes: 7d61e773c3ed ("clk: qcom: smd: Add support for MSM8976 rpm clocks") Signed-off-by: Adam Skladowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220426090226.27293-1-a39.skl@gmail.com commit 5da66099d6e28c66d24c49d9e791f64318c136a9 Author: Nathan Rossi Date: Wed Apr 27 13:09:28 2022 +0000 net: dsa: mv88e6xxx: Single chip mode detection for MV88E6*41 The mv88e6xxx driver expects switches that are configured in single chip addressing mode to have the MDIO address configured as 0. This is due to the switch ADDR pins representing the single chip addressing mode as 0. However depending on the device (e.g. MV88E6*41) the switch does not respond on address 0 or any other address below 16 (the first port address) in single chip addressing mode. This allows for other devices to be on the same shared MDIO bus despite the switch being in single chip addressing mode. When using a switch that works this way it is not possible to configure switch driver as single chip addressing via device tree, along with another MDIO device on the same bus with address 0, as both devices would have the same address of 0 resulting in mdiobus_register_device -EBUSY errors for one of the devices with address 0. In order to support this configuration the switch node can have its MDIO address configured as 16 (the first address that the device responds to). During initialization the driver will treat this address similar to how address 0 is, however because this address is also a valid multi-chip address (in certain switch models, but not all) the driver will configure the SMI in single chip addressing mode and attempt to detect the switch model. If the device is configured in single chip addressing mode this will succeed and the initialization process can continue. If it fails to detect a valid model this is because the switch model register is not a valid register when in multi-chip mode, it will then fall back to the existing SMI initialization process using the MDIO address as the multi-chip mode address. This detection method is safe if the device is in either mode because the single chip addressing mode read is a direct SMI/MDIO read operation and has no side effects compared to the SMI writes required for the multi-chip addressing mode. In order to implement this change, the reset gpio configuration is moved to occur before any SMI initialization. This ensures that the device has the same/correct reset gpio state for both mv88e6xxx_smi_init calls. Signed-off-by: Nathan Rossi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220427130928.540007-1-nathan@nathanrossi.com Signed-off-by: Jakub Kicinski commit dde2daa0a279623a6f769b258339df744cc0fdd6 Author: Volodymyr Mytnyk Date: Wed Apr 27 15:05:48 2022 +0300 net: prestera: add police action support - Add HW api to configure policer: - SR TCM policer mode is only supported for now. - Policer ingress/egress direction support. - Add police action support into flower Signed-off-by: Volodymyr Mytnyk Link: https://lore.kernel.org/r/1651061148-21321-1-git-send-email-volodymyr.mytnyk@plvision.eu Signed-off-by: Jakub Kicinski commit 07caad0bb1f8963e6e99b665bc17842d93762469 Author: Lukas Wunner Date: Wed Apr 27 08:30:51 2022 +0200 net: phy: Deduplicate interrupt disablement on PHY attach phy_attach_direct() first calls phy_init_hw() (which restores interrupt settings through ->config_intr()), then calls phy_disable_interrupts(). So if phydev->interrupts was previously set to 1, interrupts are briefly enabled, then disabled, which seems nonsensical. If it was previously set to 0, interrupts are disabled twice, which is equally nonsensical. Deduplicate interrupt disablement. Signed-off-by: Lukas Wunner Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/805ccdc606bd8898d59931bd4c7c68537ed6e550.1651040826.git.lukas@wunner.de Signed-off-by: Jakub Kicinski commit 15e2b419a83777ef652bf5f0ea4385ef7711f710 Merge: 9bda072a7bec2 e08a99d005588 Author: Dave Airlie Date: Fri Apr 29 11:32:59 2022 +1000 Merge tag 'drm-misc-next-2022-04-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.19: UAPI Changes: Cross-subsystem Changes: Core Changes: - Introduction of display-helper module, and rework of the DP, DSC, HDCP, HDMI and SCDC headers - doc: Improvements for tiny drivers, link to external resources - formats: helper to convert from RGB888 and RGB565 to XRGB8888 - modes: make width-mm/height-mm check mandatory in of_get_drm_panel_display_mode - ttm: Convert from kvmalloc_array to kvcalloc Driver Changes: - bridge: - analogix_dp: Fix error handling in probe - dw_hdmi: Coccinelle fixes - it6505: Fix Kconfig dependency on DRM_DP_AUX_BUS - panel: - new panel: DataImage FG040346DSSWBG04 - amdgpu: ttm_eu cleanups - mxsfb: Rework CRTC mode setting - nouveau: Make some variables static - sun4i: Drop drm_display_info.is_hdmi caching, support for the Allwinner D1 - vc4: Drop drm_display_info.is_hdmi caching - vmwgfx: Fence improvements Signed-off-by: Dave Airlie # gpg: Signature made Thu 28 Apr 2022 17:52:13 AEST # gpg: using EDDSA key 5C1337A45ECA9AEB89060E9EE3EF0D6F671851C5 # gpg: Can't check signature: No public key From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220428075237.yypztjha7hetphcd@houat commit 033b87d24f7257c45506bd043ad85ed24a9925e2 Author: Dylan Yudaken Date: Tue Apr 26 01:29:07 2022 -0700 io_uring: use the text representation of ops in trace It is annoying to translate opcodes to textwhen tracing io_uring. Use the io_uring_get_opcode function instead to use the text representation. A downside here might have been that if the opcode is invalid it will not be obvious, however the opcode is already overridden in these cases to 0 (NOP) in io_init_req(). Therefore this is a non issue. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220426082907.3600028-5-dylany@fb.com [axboe: don't include register, those are not req opcodes] Signed-off-by: Jens Axboe commit fdc33eba11c5919199f3d13dc53571cc7bf19d7d Author: Jianqun Xu Date: Fri Apr 22 19:09:14 2022 +0200 pinctrl/rockchip: add rk3588 support Add pinctrl support for RK3588. [merged in downstream fixes, simplified register lookup logic for better maintanence at the cost of a bit more static const memory and fixed some incorrect registers] Signed-off-by: Jianqun Xu Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220422170920.401914-14-sebastian.reichel@collabora.com Signed-off-by: Linus Walleij commit 42573ab3b9f94fbeba8b84e142703ea551624f6d Author: Sebastian Reichel Date: Fri Apr 22 19:09:13 2022 +0200 pinctrl/rockchip: add error handling for pull/drive register getters Add error handling for the pull and driver register getters in preparation for RK3588 support. Signed-off-by: Sebastian Reichel Reviewed-by: Heiko Stübner Link: https://lore.kernel.org/r/20220422170920.401914-13-sebastian.reichel@collabora.com Signed-off-by: Linus Walleij commit 71bc7cf3be65bab441e03667cf215c557712976c Author: Krzysztof Kozlowski Date: Fri Apr 22 12:53:38 2022 +0200 pinctrl: mvebu: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: 2f227605394b ("pinctrl: armada-37xx: Add irqchip support") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220422105339.78810-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit bb7bf697fed58eae9d3445944e457ab0de4da54f Author: Dan Williams Date: Thu Apr 28 15:47:46 2022 -0700 nvdimm: Allow overwrite in the presence of disabled dimms It is not clear why the original implementation of overwrite support required the dimm driver to be active before overwrite could proceed. In fact that can lead to cases where the kernel retains an invalid cached copy of the labels from before the overwrite. Unfortunately the kernel has not only allowed that case, but enforced it. Going forward, allow for overwrite to happen while the label area is offline, and follow-on with updates to 'ndctl sanitize-dimm --overwrite' to trigger the label area invalidation by default. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: Jeff Moyer Reported-by: Krzysztof Kensicki Fixes: 7d988097c546 ("acpi/nfit, libnvdimm/security: Add security DSM overwrite support") Signed-off-by: Dan Williams commit 8274c8eae1d3e48bb834dc26b7ebdaeef53d10ba Author: Michael Walle Date: Wed Apr 27 09:53:38 2022 +0200 dt-bindings: fsl: convert fsl,layerscape-scfg to YAML Convert the fsl,layerscape-scfg binding to the new YAML format. In the device trees, the device node always have a "syscon" compatible, which wasn't mentioned in the previous binding. Also added, compared to the original binding, is the interrupt-controller subnode as used in arch/arm/boot/dts/ls1021a.dtsi as well as the litte-endian and big-endian properties. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220427075338.1156449-5-michael@walle.cc commit 0037c30a84c10819e43c9bac5f85fb9cc0fc0af4 Author: Michael Walle Date: Wed Apr 27 09:53:37 2022 +0200 dt-bindings: interrupt-controller: fsl,ls-extirq: convert to YAML Convert the fsl,ls-extirq binding to the new YAML format. In contrast to the original binding documentation, there are three compatibles which are used in their corresponding device trees which have a specific compatible and the (already documented) fallback compatible: - "fsl,ls1046a-extirq", "fsl,ls1043a-extirq" - "fsl,ls2080a-extirq", "fsl,ls1088a-extirq" - "fsl,lx2160a-extirq", "fsl,ls1088a-extirq" Depending on the number of the number of the external IRQs which is usually 12 except for the LS1021A where there are only 6, the interrupt-map-mask was reduced from 0xffffffff to 0xf and 0x7 respectively and the number of interrupt-map entries have to match. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220427075338.1156449-4-michael@walle.cc commit 453200af8a85ca023afb7f3518d85456b70ace11 Author: Michael Walle Date: Wed Apr 20 21:19:26 2022 +0200 pinctrl: ocelot: add optional shared reset On the LAN9668 there is a shared reset line which affects GPIO, SGPIO and the switch core. Add support for this shared reset line. Signed-off-by: Michael Walle Tested-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220420191926.3411830-3-michael@walle.cc Signed-off-by: Linus Walleij commit 9c1082fd1b1b8fd0f990ef917ddeff977fd320ab Author: Michael Walle Date: Wed Apr 20 21:19:25 2022 +0200 dt-bindings: pinctrl: ocelot: add reset property On the LAN966x SoC the GPIO controller will be resetted together with the SGPIO and the switch core. Add a phandle to register the shared reset line. Signed-off-by: Michael Walle Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220420191926.3411830-2-michael@walle.cc Signed-off-by: Linus Walleij commit ba99d08da6adec0fb277e7ecbb125be6dfd1f2ea Author: Yongqiang Niu Date: Thu Apr 28 16:58:29 2022 +0800 drm/mediatek: Add lut diff flag for new gamma hardware support mt8183 gamma module usage is different with before soc, gamma odd(index start from 0) lut value set to hardware register should be the difference of current lut value with last lut value. for example, chrome os user space set lut like this(only r chanel for example): 2 4 6 8 10 12. 1) mt8183 gamma driver should set the gamma lut to hardware register like this: 2 [2] 6 [2] 10 [2] the value with [] is the difference value 2)gamma hardware process display data with original lut Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220428085829.15855-2-yongqiang.niu@mediatek.com/ Signed-off-by: Yongqiang Niu Signed-off-by: Yongqiang Niu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 3da2c38231a4c62dafdbd762a199cfacaccd0533 Author: Philip Yang Date: Wed Apr 27 18:50:49 2022 -0400 drm/amdgpu: Free user pages if amdgpu_cs_parser_bos failed Otherwise userspace resubmit the BOs again will trigger kernel WARNING and fail the command submission. Signed-off-by: Philip Yang Tested-by: Robert Święcki Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 86e18ac3aee9d0a3deadb6dc0a8685621805ceed Author: Candice Li Date: Wed Apr 27 18:02:45 2022 +0800 drm/amdgpu: Fix build warning for TA debugfs interface Remove the redundant codes to fix build warning when CONFIG_DEBUG_FS is disabled. Reported-by: Randy Dunlap Signed-off-by: Candice Li Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 71199aa47bbccef3eda9940dc6d457ed0268f7d2 Author: Stanley.Yang Date: Fri Apr 1 14:41:06 2022 -0400 drm/amdgpu: add soc21 common ip block v2 This adds soc21 common ip block support Changed from v1: Switch WREG32/RREG32_PCIE to use indirect reg access helper for sco15 and onwards Acked-by: Christian König Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ba9e7a4a31ab679e60bcb7ed17b9a01a89f15df4 Author: Stanley.Yang Date: Wed Aug 4 15:43:17 2021 +0800 drm/amdgpu: add new write field for soc21 add new write field macro to handle soc21 registers with reg prefix Acked-by: Christian König Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fb1d6835137369d6776c3141593b5b33369f3ca3 Author: Hawking Zhang Date: Sat Jan 8 17:18:37 2022 +0800 drm/amdgpu: add nbio callback to query rom offset Add nbio callback func used to query rom offset. Used to query the rom offset for fetching the vbios. Acked-by: Christian König Signed-off-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f33ac92f9c010be84ecbbec7e30990012be806e8 Author: Hawking Zhang Date: Thu Dec 30 16:56:09 2021 +0800 drm/amdgpu: add gc v11_0_0 ip headers v11 Add gc v11_0_0 register offset and shift masks header files (Hawking) Acked-by: Christian König Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 85a41b429df57691124af8780f63a3a25e0e2c1e Author: Hawking Zhang Date: Thu Dec 30 19:12:28 2021 +0800 drm/amdgpu: add mp v13_0_0 ip headers v7 Add mp v13_0_0 register offset and shift masks header files (Hawking) Acked-by: Christian König Signed-off-by: Hawking Zhang Signed-off-by: Likun Gao Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit a8d59943b8846dc2cf7eafcd38dfa278d6f78158 Author: Hawking Zhang Date: Sun Jan 23 18:47:47 2022 +0800 drm/amdgpu: update query ref clk from bios Handle atom_gfx_info_v3_0 structure. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit f5fb30b6b3d8268db52c3a158e14bc64e9808c09 Author: Hawking Zhang Date: Thu Apr 7 01:49:55 2022 -0400 drm/amdgpu: update gc info from bios table Handle newer gc info tables. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 083e5ff6412da407487f307769e2143723a80f69 Author: Hawking Zhang Date: Sun Jan 23 17:40:30 2022 +0800 drm/amdgpu: add atom_gfx_info_v3_0 structure atomfirmware table used for newer gfx IPs. Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 7089dd3cc00313e6dd0606842ac92adbdf420941 Author: Hawking Zhang Date: Sat Feb 5 17:24:11 2022 +0800 drm/amdgpu: support query vram_info v3_0 vram_info table provides various vram information including vram_vendor, vram_type, vram_width, etc. v2: correct the calculation of vram_width Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 1a4824488b5b0d649e902940ab865c173ead96da Author: Hawking Zhang Date: Sat Feb 5 15:50:18 2022 +0800 drm/amdgpu: add vram_info v3_0 structure To support query vram_width, vram_type, vram_vendor information Signed-off-by: Hawking Zhang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 85d1bcc6e0c0367af04ca16fcf2de514465d3f32 Author: Hawking Zhang Date: Mon Feb 28 18:35:02 2022 +0800 drm/amdgpu: switch to atomfirmware_asic_init Some initial settings now are not available from the atom data table. The assumption that !ps[0] || !ps[1] in amdgpu_atom_asic_init is not valid. In addition, driver needs to strictly follow atomfirmware structure (asic_init_parameters) to initialize parameters used to execute asic_init function, otherwise, the execution of asic_init would fail. This shall be applicable to all soc15 adapters,but let make the transition on soc21 first. Signed-off-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ba75f6eb87bcf9b47f8fefaecec294ca57051f30 Author: Hawking Zhang Date: Tue Mar 1 16:29:21 2022 +0800 drm/amdgpu: add helper to execute atomfirmware asic_init Add helper function to execute atomfirmware asic_init from the cmd table Signed-off-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e24d0e91b336762d8756d08b13c2a4e33dceac77 Author: Alex Deucher Date: Wed Mar 30 01:09:48 2022 -0400 drm/amdgpu/discovery: move all table parsing into amdgpu_discovery.c This data has no dependencies, so encapsulate it all within amdgpu_discovery.c. Acked-by: Christian König Signed-off-by: Alex Deucher commit 622469c87fc3e6c90a980be3e2287d82bd55c977 Author: Alex Deucher Date: Wed Mar 30 00:48:25 2022 -0400 drm/amdgpu/discovery: add a function to parse the vcn info table To get the codec disable fuse mask. Acked-by: Christian König Signed-off-by: Alex Deucher commit f716113aacea122e44e7a28aa521318da65adc84 Author: Alex Deucher Date: Wed Mar 30 01:23:33 2022 -0400 drm/amdgpu/discovery: add additional validation Check the table signatures and checksums and verify that the tables exist before accessing them. v2: disable MALL table for now Acked-by: Christian König Signed-off-by: Alex Deucher commit 24681cb50bcbe09a4f8f609d35c350c7d246fe5e Author: Alex Deucher Date: Tue Mar 29 17:23:49 2022 -0400 drm/amdgpu/discovery: add a function to get the mall_size Add a function to fetch the mall size from the IP discovery table. Properly handle harvest configurations where more or less cache may be available. Acked-by: Christian König Signed-off-by: Alex Deucher commit 478d338bb0ca49f4974436f6e005d3816dcba115 Author: Alex Deucher Date: Tue Mar 29 18:04:15 2022 -0400 drm/amdgpu/discovery: handle UMC harvesting in IP discovery Check the harvesting table to determing if any UMC blocks have been harvested. Acked-by: Christian König Signed-off-by: Alex Deucher commit a2efebf1a4f8b2bb092668e1dabaa9981cd87af1 Author: Alex Deucher Date: Thu Mar 31 18:12:47 2022 -0400 drm/amdgpu/discovery: store the number of UMC IPs on the asic For chips with IP discovery get this from the table, hardcode it for older asics. Acked-by: Christian König Signed-off-by: Alex Deucher commit 053d35dedd7f2e0cb5e74ea8588aed09d6701d9c Author: Alex Deucher Date: Thu Mar 31 18:11:51 2022 -0400 drm/amdgpu: store the mall size in the gmc structure This will be useful in future patches. Acked-by: Christian König Signed-off-by: Alex Deucher commit 8eece29c4ecd5c90c84b7c5f4dbcbcb9a268fc5f Author: Alex Deucher Date: Wed Mar 30 01:21:34 2022 -0400 drm/amdgpu/discovery: fix byteswapping in gc info parsing The table is in little endian format. Acked-by: Christian König Signed-off-by: Alex Deucher commit d1acd68b2b8924c804e1e3cc1bc5fa4d6b76176c Author: Guchun Chen Date: Wed Apr 27 15:51:02 2022 +0800 drm/amdgpu: disable runtime pm on several sienna cichlid cards(v2) Disable runtime power management on several sienna cichlid cards, otherwise SMU will possibly fail to be resumed from runtime suspend. Will drop this after a clean solution between kernel driver and SMU FW is available. amdgpu 0000:63:00.0: amdgpu: GECC is enabled amdgpu 0000:63:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available amdgpu 0000:63:00.0: amdgpu: SMU is resuming... amdgpu 0000:63:00.0: amdgpu: SMU: I'm not done with your command: SMN_C2PMSG_66:0x0000000E SMN_C2PMSG_82:0x00000080 amdgpu 0000:63:00.0: amdgpu: Failed to SetDriverDramAddr! amdgpu 0000:63:00.0: amdgpu: Failed to setup smc hw! [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block failed -62 amdgpu 0000:63:00.0: amdgpu: amdgpu_device_ip_resume failed (-62) v2: seperate to a function. Signed-off-by: Guchun Chen Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 5cb1cfd5f1863c667f43d735b804dee156e09476 Author: Alex Deucher Date: Tue Mar 29 14:40:28 2022 -0400 drm/amdgpu/discovery: populate additional GC info From the GC info table to the gfx config structure in the driver. The driver will use this data to configure the card correctly. Acked-by: Christian König Signed-off-by: Alex Deucher commit 005835233a2c0fdeb5014a6d690d52474b2404f5 Author: Alex Deucher Date: Tue Mar 29 14:15:46 2022 -0400 drm/amdgpu: update latest IP discovery table structures Add new tables. Acked-by: Christian König Signed-off-by: Alex Deucher commit 1d5eee7dd6648865e041e09338cf85a154d2db80 Author: Likun Gao Date: Fri Dec 10 15:05:57 2021 +0800 drm/amdgpu: add function to decode ip version Add function to decode IP version. Signed-off-by: Likun Gao Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3202c7e7826bb29dc253e29b595df36182feb42f Author: Likun Gao Date: Thu Nov 7 16:27:16 2019 +0800 drm/amdgpu: increase HWIP MAX INSTANCE Extend HWIP MAX INSTANCE to 11. Acked-by: Christian König Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 32c03c4954a03d46f603f94acac9d2705bd5c9c6 Author: Andrii Nakryiko Date: Thu Apr 28 11:53:49 2022 -0700 selftests/bpf: Use target-less SEC() definitions in various tests Add new or modify existing SEC() definitions to be target-less and validate that libbpf handles such program definitions correctly. For kprobe/kretprobe we also add explicit test that generic bpf_program__attach() works in cases when kprobe definition contains proper target. It wasn't previously tested as selftests code always explicitly specified the target regardless. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220428185349.3799599-4-andrii@kernel.org commit cc7d8f2c8ecc003a67d4cf189d04124461524a16 Author: Andrii Nakryiko Date: Thu Apr 28 11:53:48 2022 -0700 libbpf: Support target-less SEC() definitions for BTF-backed programs Similar to previous patch, support target-less definitions like SEC("fentry"), SEC("freplace"), etc. For such BTF-backed program types it is expected that user will specify BTF target programmatically at runtime using bpf_program__set_attach_target() *before* load phase. If not, libbpf will report this as an error. Aslo use SEC_ATTACH_BTF flag instead of explicitly listing a set of types that are expected to require attach_btf_id. This was an accidental omission during custom SEC() support refactoring. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220428185349.3799599-3-andrii@kernel.org commit 78b12008f20490655e360bcb2e043aa5b9580174 Author: Marek Marczykowski-Górecki Date: Wed Apr 27 01:57:15 2022 +0200 drm/amdgpu: do not use passthrough mode in Xen dom0 While technically Xen dom0 is a virtual machine too, it does have access to most of the hardware so it doesn't need to be considered a "passthrough". Commit b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") changed how FB is accessed based on passthrough mode. This breaks amdgpu in Xen dom0 with message like this: [drm:dc_dmub_srv_wait_idle [amdgpu]] *ERROR* Error waiting for DMUB idle: status=3 While the reason for this failure is unclear, the passthrough mode is not really necessary in Xen dom0 anyway. So, to unbreak booting affected kernels, disable passthrough mode in this case. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1985 Fixes: b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Alex Deucher commit 9af8efc45eb12c3f24a7053f994985ad28b4f29b Author: Andrii Nakryiko Date: Thu Apr 28 11:53:47 2022 -0700 libbpf: Allow "incomplete" basic tracing SEC() definitions In a lot of cases the target of kprobe/kretprobe, tracepoint, raw tracepoint, etc BPF program might not be known at the compilation time and will be discovered at runtime. This was always a supported case by libbpf, with APIs like bpf_program__attach_{kprobe,tracepoint,etc}() accepting full target definition, regardless of what was defined in SEC() definition in BPF source code. Unfortunately, up till now libbpf still enforced users to specify at least something for the fake target, e.g., SEC("kprobe/whatever"), which is cumbersome and somewhat misleading. This patch allows target-less SEC() definitions for basic tracing BPF program types: - kprobe/kretprobe; - multi-kprobe/multi-kretprobe; - tracepoints; - raw tracepoints. Such target-less SEC() definitions are meant to specify declaratively proper BPF program type only. Attachment of them will have to be handled programmatically using correct APIs. As such, skeleton's auto-attachment of such BPF programs is skipped and generic bpf_program__attach() will fail, if attempted, due to the lack of enough target information. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220428185349.3799599-2-andrii@kernel.org commit 555238d92ac32dbad2d77ad2bafc48d17391990c Author: Evan Quan Date: Mon Apr 25 10:16:46 2022 +0800 drm/amd/pm: fix the compile warning Fix the compile warning below: drivers/gpu/drm/amd/amdgpu/../pm/legacy-dpm/kv_dpm.c:1641 kv_get_acp_boot_level() warn: always true condition '(table->entries[i]->clk >= 0) => (0-u32max >= 0)' Reported-by: kernel test robot CC: Alex Deucher Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b179fc28d521379ba7e0a38eec1a4c722e7ea634 Author: Mukul Joshi Date: Fri Apr 22 11:39:20 2022 -0400 drm/amdkfd: Fix circular lock dependency warning [ 168.544078] ====================================================== [ 168.550309] WARNING: possible circular locking dependency detected [ 168.556523] 5.16.0-kfd-fkuehlin #148 Tainted: G E [ 168.562558] ------------------------------------------------------ [ 168.568764] kfdtest/3479 is trying to acquire lock: [ 168.573672] ffffffffc0927a70 (&topology_lock){++++}-{3:3}, at: kfd_topology_device_by_id+0x16/0x60 [amdgpu] [ 168.583663] but task is already holding lock: [ 168.589529] ffff97d303dee668 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0xa9/0x180 [ 168.597755] which lock already depends on the new lock. [ 168.605970] the existing dependency chain (in reverse order) is: [ 168.613487] -> #3 (&mm->mmap_lock#2){++++}-{3:3}: [ 168.619700] lock_acquire+0xca/0x2e0 [ 168.623814] down_read+0x3e/0x140 [ 168.627676] do_user_addr_fault+0x40d/0x690 [ 168.632399] exc_page_fault+0x6f/0x270 [ 168.636692] asm_exc_page_fault+0x1e/0x30 [ 168.641249] filldir64+0xc8/0x1e0 [ 168.645115] call_filldir+0x7c/0x110 [ 168.649238] ext4_readdir+0x58e/0x940 [ 168.653442] iterate_dir+0x16a/0x1b0 [ 168.657558] __x64_sys_getdents64+0x83/0x140 [ 168.662375] do_syscall_64+0x35/0x80 [ 168.666492] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 168.672095] -> #2 (&type->i_mutex_dir_key#6){++++}-{3:3}: [ 168.679008] lock_acquire+0xca/0x2e0 [ 168.683122] down_read+0x3e/0x140 [ 168.686982] path_openat+0x5b2/0xa50 [ 168.691095] do_file_open_root+0xfc/0x190 [ 168.695652] file_open_root+0xd8/0x1b0 [ 168.702010] kernel_read_file_from_path_initns+0xc4/0x140 [ 168.709542] _request_firmware+0x2e9/0x5e0 [ 168.715741] request_firmware+0x32/0x50 [ 168.721667] amdgpu_cgs_get_firmware_info+0x370/0xdd0 [amdgpu] [ 168.730060] smu7_upload_smu_firmware_image+0x53/0x190 [amdgpu] [ 168.738414] fiji_start_smu+0xcf/0x4e0 [amdgpu] [ 168.745539] pp_dpm_load_fw+0x21/0x30 [amdgpu] [ 168.752503] amdgpu_pm_load_smu_firmware+0x4b/0x80 [amdgpu] [ 168.760698] amdgpu_device_fw_loading+0xb8/0x140 [amdgpu] [ 168.768412] amdgpu_device_init.cold+0xdf6/0x1716 [amdgpu] [ 168.776285] amdgpu_driver_load_kms+0x15/0x120 [amdgpu] [ 168.784034] amdgpu_pci_probe+0x19b/0x3a0 [amdgpu] [ 168.791161] local_pci_probe+0x40/0x80 [ 168.797027] work_for_cpu_fn+0x10/0x20 [ 168.802839] process_one_work+0x273/0x5b0 [ 168.808903] worker_thread+0x20f/0x3d0 [ 168.814700] kthread+0x176/0x1a0 [ 168.819968] ret_from_fork+0x1f/0x30 [ 168.825563] -> #1 (&adev->pm.mutex){+.+.}-{3:3}: [ 168.834721] lock_acquire+0xca/0x2e0 [ 168.840364] __mutex_lock+0xa2/0x930 [ 168.846020] amdgpu_dpm_get_mclk+0x37/0x60 [amdgpu] [ 168.853257] amdgpu_amdkfd_get_local_mem_info+0xba/0xe0 [amdgpu] [ 168.861547] kfd_create_vcrat_image_gpu+0x1b1/0xbb0 [amdgpu] [ 168.869478] kfd_create_crat_image_virtual+0x447/0x510 [amdgpu] [ 168.877884] kfd_topology_add_device+0x5c8/0x6f0 [amdgpu] [ 168.885556] kgd2kfd_device_init.cold+0x385/0x4c5 [amdgpu] [ 168.893347] amdgpu_amdkfd_device_init+0x138/0x180 [amdgpu] [ 168.901177] amdgpu_device_init.cold+0x141b/0x1716 [amdgpu] [ 168.909025] amdgpu_driver_load_kms+0x15/0x120 [amdgpu] [ 168.916458] amdgpu_pci_probe+0x19b/0x3a0 [amdgpu] [ 168.923442] local_pci_probe+0x40/0x80 [ 168.929249] work_for_cpu_fn+0x10/0x20 [ 168.935008] process_one_work+0x273/0x5b0 [ 168.940944] worker_thread+0x20f/0x3d0 [ 168.946623] kthread+0x176/0x1a0 [ 168.951765] ret_from_fork+0x1f/0x30 [ 168.957277] -> #0 (&topology_lock){++++}-{3:3}: [ 168.965993] check_prev_add+0x8f/0xbf0 [ 168.971613] __lock_acquire+0x1299/0x1ca0 [ 168.977485] lock_acquire+0xca/0x2e0 [ 168.982877] down_read+0x3e/0x140 [ 168.987975] kfd_topology_device_by_id+0x16/0x60 [amdgpu] [ 168.995583] kfd_device_by_id+0xa/0x20 [amdgpu] [ 169.002180] kfd_mmap+0x95/0x200 [amdgpu] [ 169.008293] mmap_region+0x337/0x5a0 [ 169.013679] do_mmap+0x3aa/0x540 [ 169.018678] vm_mmap_pgoff+0xdc/0x180 [ 169.024095] ksys_mmap_pgoff+0x186/0x1f0 [ 169.029734] do_syscall_64+0x35/0x80 [ 169.035005] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 169.041754] other info that might help us debug this: [ 169.053276] Chain exists of: &topology_lock --> &type->i_mutex_dir_key#6 --> &mm->mmap_lock#2 [ 169.068389] Possible unsafe locking scenario: [ 169.076661] CPU0 CPU1 [ 169.082383] ---- ---- [ 169.088087] lock(&mm->mmap_lock#2); [ 169.092922] lock(&type->i_mutex_dir_key#6); [ 169.100975] lock(&mm->mmap_lock#2); [ 169.108320] lock(&topology_lock); [ 169.112957] *** DEADLOCK *** This commit fixes the deadlock warning by ensuring pm.mutex is not held while holding the topology lock. For this, kfd_local_mem_info is moved into the KFD dev struct and filled during device init. This cached value can then be used instead of querying the value again and again. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 98447635b5dc4be078b26376285d3f3a6fa31094 Author: Mukul Joshi Date: Wed Apr 20 11:34:53 2022 -0400 drm/amdkfd: Fix updating IO links during device removal The logic to update the IO links when a KFD device is removed was not correct as it would miss updating the proximity domain values for some nodes where the node_from and node_to both were greater values than the proximity domain value of the KFD device being removed from topology. Fixes: 46d18d510d7831 ("drm/amdkfd: Cleanup IO links during KFD device removal") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b8b9ba58b6f93d84a8494065a56ae26893d2b54e Author: Christophe JAILLET Date: Sun Nov 28 17:46:15 2021 +0100 drm/amdkfd: Use non-atomic bitmap functions when possible All uses of the 'kfd->gtt_sa_bitmap' bitmap are protected with the 'kfd->gtt_sa_lock' mutex. So: - prefer the non-atomic '__set_bit()' function - use the non-atomic 'bitmap_[set|clear]()' functions instead of equivalent 'for' loops. These functions can work on several bits at a time Signed-off-by: Christophe JAILLET Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f43a9f18e0d52c1ab2455be42528cc2a49457890 Author: Christophe JAILLET Date: Sun Nov 28 17:45:55 2021 +0100 drm/amdkfd: Use bitmap_zalloc() when applicable 'kfd->gtt_sa_bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7324d02a6545414fff3bcd2c6e95b9e1041a327e Author: Melissa Wen Date: Wed Mar 30 22:02:04 2022 -0100 drm/amd/display: protect remaining FPU-code calls on dcn3.1.x From [1], I realized two other calls to dcn30 code are associated with FPU operations and are not protected by DC_FP_* macros: * dcn30_populate_dml_writeback_from_context() * dcn30_set_mcif_arb_params() So, since FPU-associated code is not fully isolated in dcn30, and dcn3.1.x reuses them, let's wrap their calls properly. Note: this patch complements the fix from [1]. [1] https://lore.kernel.org/amd-gfx/20220329082957.1662655-1-chandan.vurdigerenataraj@amd.com/ Reviewed-by: Rodrigo Siqueira Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 3527bfe6a92d940abfca87929207e734039f496b Author: Liu Jian Date: Wed Apr 27 19:51:50 2022 +0800 bpf, sockmap: Call skb_linearize only when required in sk_psock_skb_ingress_enqueue The skb_to_sgvec fails only when the number of frag_list and frags exceeds MAX_MSG_FRAGS. Therefore, we can call skb_linearize only when the conversion fails. Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220427115150.210213-1-liujian56@huawei.com commit 419f8299ddad6070a6c95aaedf78e50265871f36 Author: Wan Jiabing Date: Wed Apr 27 19:54:56 2022 +0800 i915/gvt: Fix NULL pointer dereference in init_mmio_block_handlers Fix following coccicheck error: ./drivers/gpu/drm/i915/gvt/handlers.c:2925:35-41: ERROR: block is NULL but dereferenced. Use gvt->mmio.mmio_block instead of block to avoid NULL pointer dereference when find_mmio_block returns NULL. Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g") Signed-off-by: Wan Jiabing Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220427115457.836729-1-wanjiabing@vivo.com Reviewed-by: Zhi Wang commit e6829d1bd3c4b58296ee9e412f7ed4d6cb390192 Author: Dan Williams Date: Tue Apr 26 13:23:05 2022 -0700 nvdimm: Fix firmware activation deadlock scenarios Lockdep reports the following deadlock scenarios for CXL root device power-management, device_prepare(), operations, and device_shutdown() operations for 'nd_region' devices: Chain exists of: &nvdimm_region_key --> &nvdimm_bus->reconfig_mutex --> system_transition_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(system_transition_mutex); lock(&nvdimm_bus->reconfig_mutex); lock(system_transition_mutex); lock(&nvdimm_region_key); Chain exists of: &cxl_nvdimm_bridge_key --> acpi_scan_lock --> &cxl_root_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&cxl_root_key); lock(acpi_scan_lock); lock(&cxl_root_key); lock(&cxl_nvdimm_bridge_key); These stem from holding nvdimm_bus_lock() over hibernate_quiet_exec() which walks the entire system device topology taking device_lock() along the way. The nvdimm_bus_lock() is protecting against unregistration, multiple simultaneous ops callers, and preventing activate_show() from racing activate_store(). For the first 2, the lock is redundant. Unregistration already flushes all ops users, and sysfs already prevents multiple threads to be active in an ops handler at the same time. For the last userspace should already be waiting for its last activate_store() to complete, and does not need activate_show() to flush the write side, so this lock usage can be deleted in these attributes. Fixes: 48001ea50d17 ("PM, libnvdimm: Add runtime firmware activation support") Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165074883800.4116052.10737040861825806582.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit fd3abd2cafa46955846d731b9a6ded2c19ab73d8 Author: Dan Williams Date: Thu Apr 21 08:33:45 2022 -0700 device-core: Kill the lockdep_mutex Per Peter [1], the lockdep API has native support for all the use cases lockdep_mutex was attempting to enable. Now that all lockdep_mutex users have been converted to those APIs, drop this lock. Link: https://lore.kernel.org/r/Ylf0dewci8myLvoW@hirez.programming.kicks-ass.net [1] Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Suggested-by: Peter Zijlstra Reviewed-by: Ira Weiny Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/165055522548.3745911.14298368286915484086.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 81beea55cb7407a52bac16f7d01a415e008c910f Author: Dan Williams Date: Thu Apr 21 08:33:39 2022 -0700 nvdimm: Drop nd_device_lock() Now that all NVDIMM subsystem locking is validated with custom lock classes, there is no need for the custom usage of the lockdep_mutex. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165055521979.3745911.10751769706032029999.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 1550a17a7da2936281fda5e87fc454cee3c9c683 Author: Dan Williams Date: Thu Apr 21 08:33:34 2022 -0700 ACPI: NFIT: Drop nfit_device_lock() The nfit_device_lock() helper was added to provide lockdep coverage for the NFIT driver's usage of device_lock() on the nvdimm_bus object. Now that nvdimm_bus objects have their own lock class this wrapper can be dropped. Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165055521409.3745911.8085645201146909612.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 4a0079bc7aae5a003ecc548090b75c96d3abf490 Author: Dan Williams Date: Thu Apr 21 08:33:29 2022 -0700 nvdimm: Replace lockdep_mutex with local lock classes In response to an attempt to expand dev->lockdep_mutex for device_lock() validation [1], Peter points out [2] that the lockdep API already has the ability to assign a dedicated lock class per subsystem device-type. Use lockdep_set_class() to override the default device_lock() '__lockdep_no_validate__' class for each NVDIMM subsystem device-type. This enables lockdep to detect deadlocks and recursive locking within the device-driver core and the subsystem. Link: https://lore.kernel.org/r/164982968798.684294.15817853329823976469.stgit@dwillia2-desk3.amr.corp.intel.com [1] Link: https://lore.kernel.org/r/Ylf0dewci8myLvoW@hirez.programming.kicks-ass.net [2] Suggested-by: Peter Zijlstra Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165055520896.3745911.8021255583475547548.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 38a34e10768c85d3be4bb31fea5d8942bb72bbd7 Author: Dan Williams Date: Thu Apr 21 08:33:23 2022 -0700 cxl: Drop cxl_device_lock() Now that all CXL subsystem locking is validated with custom lock classes, there is no need for the custom usage of the lockdep_mutex. Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky Cc: Jonathan Cameron Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165055520383.3745911.53447786039115271.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit d864b8ea6468cf1dce614a58eec92a23d8e07fec Author: Dan Williams Date: Tue Apr 26 12:22:44 2022 -0700 cxl/acpi: Add root device lockdep validation The CXL "root" device, ACPI0017, is an attach point for coordinating platform level CXL resources and is the parent device for a CXL port topology tree. As such it has distinct locking rules relative to other CXL subsystem objects, but because it is an ACPI device the lock class is established well before it is given to the cxl_acpi driver. However, the lockdep API does support changing the lock class "live" for situations like this. Add a device_lock_set_class() helper that a driver can use in ->probe() to set a custom lock class, and device_lock_reset_class() to return to the default "no validate" class before the custom lock class key goes out of scope after ->remove(). Note the helpers are all macros to support dead code elimination in the CONFIG_PROVE_LOCKING=n case, however device_set_lock_class() still needs #ifdef CONFIG_PROVE_LOCKING since lockdep_match_class() explicitly does not have a helper in the CONFIG_PROVE_LOCKING=n case (see comment in lockdep.h). The lockdep API needs 2 small tweaks to prevent "unused" warnings for the @key argument to lock_set_class(), and a new lock_set_novalidate_class() is added to supplement lockdep_set_novalidate_class() in the cases where the lock class is converted while the lock is held. Suggested-by: Peter Zijlstra Cc: "Rafael J. Wysocki" Cc: Ingo Molnar Cc: Will Deacon Cc: Waiman Long Cc: Boqun Feng Cc: Alison Schofield Cc: Vishal Verma Cc: Ben Widawsky Cc: Jonathan Cameron Reviewed-by: Greg Kroah-Hartman Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165100081305.1528964.11138612430659737238.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 3750d013182b071dbf458144540390de0031be8c Author: Dan Williams Date: Thu Apr 21 08:33:13 2022 -0700 cxl: Replace lockdep_mutex with local lock classes In response to an attempt to expand dev->lockdep_mutex for device_lock() validation [1], Peter points out [2] that the lockdep API already has the ability to assign a dedicated lock class per subsystem device-type. Use lockdep_set_class() to override the default device_lock() '__lockdep_no_validate__' class for each CXL subsystem device-type. This enables lockdep to detect deadlocks and recursive locking within the device-driver core and the subsystem. The lockdep_set_class_and_subclass() API is used for port objects that recursively lock the 'cxl_port_key' class by hierarchical topology depth. Link: https://lore.kernel.org/r/164982968798.684294.15817853329823976469.stgit@dwillia2-desk3.amr.corp.intel.com [1] Link: https://lore.kernel.org/r/Ylf0dewci8myLvoW@hirez.programming.kicks-ass.net [2] Suggested-by: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Waiman Long Cc: Boqun Feng Cc: Alison Schofield Cc: Vishal Verma Cc: Ira Weiny Cc: Ben Widawsky Cc: Jonathan Cameron Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/165055519317.3745911.7342499516839702840.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 56368029d93bbb3246ee2e03268fa6dd9754be05 Author: Vishal Verma Date: Wed Apr 13 01:36:18 2022 -0600 PCI/ACPI: negotiate CXL _OSC Add full support for negotiating _OSC as defined in the CXL 2.0 spec, as applicable to CXL-enabled platforms. Advertise support for the CXL features we support - 'CXL 2.0 port/device register access', 'Protocol Error Reporting', and 'CXL Native Hot Plug'. Request control for 'CXL Memory Error Reporting'. The requests are dependent on CONFIG_* based prerequisites, and prior PCI enabling, similar to how the standard PCI _OSC bits are determined. The CXL specification does not define any additional constraints on the hotplug flow beyond PCIe native hotplug, so a kernel that supports native PCIe hotplug, supports CXL hotplug. For error handling protocol and link errors just use PCIe AER. There is nascent support for amending AER events with CXL specific status [1], but there's otherwise no additional OS responsibility for CXL errors beyond PCIe AER. CXL Memory Errors behave the same as typical memory errors so CONFIG_MEMORY_FAILURE is sufficient to indicate support to platform firmware. [1]: https://lore.kernel.org/linux-cxl/164740402242.3912056.8303625392871313860.stgit@dwillia2-desk3.amr.corp.intel.com/ Cc: Bjorn Helgaas Cc: "Rafael J. Wysocki" Cc: Robert Moore Cc: Dan Williams Reviewed-by: Rafael J. Wysocki Reviewed-by: Davidlohr Bueso Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20220413073618.291335-4-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit 241d26bc26add2e2867c546f7474902406d37c60 Author: Dan Williams Date: Wed Apr 13 01:36:17 2022 -0600 PCI/ACPI: Prefer CXL _OSC instead of PCIe _OSC for CXL host bridges OB In preparation for negotiating OS control of CXL _OSC features, do the minimal enabling to use CXL _OSC to handle the base PCIe feature negotiation. Recall that CXL _OSC is a super-set of PCIe _OSC and the CXL 2.0 specification mandates: "If a CXL Host Bridge device exposes CXL _OSC, CXL aware OSPM shall evaluate CXL _OSC and not evaluate PCIe _OSC." Rather than pass a boolean flag alongside @root to all the helper functions that need to consider PCIe specifics, add is_pcie() and is_cxl() helper functions to check the flavor of @root. This also allows for dynamic fallback to PCIe _OSC in cases where an attempt to use CXL _OXC fails. This can happen on CXL 1.1 platforms that publish ACPI0016 devices to indicate CXL host bridges, but do not publish the optional CXL _OSC method. CXL _OSC is mandatory for CXL 2.0 hosts. Cc: Bjorn Helgaas Cc: "Rafael J. Wysocki" Cc: Robert Moore Reviewed-by: Jonathan Cameron Reviewed-by: Rafael J. Wysocki Reviewed-by: Davidlohr Bueso Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20220413073618.291335-3-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit cc10eee95204579fcd66fd5965073fdcbf629676 Author: Vishal Verma Date: Wed Apr 13 01:36:16 2022 -0600 PCI/ACPI: add a helper for retrieving _OSC Control DWORDs During _OSC negotiation, when the 'Control' DWORD is needed from the result buffer after running _OSC, a couple of places performed manual pointer arithmetic to offset into the right spot in the raw buffer. Add a acpi_osc_ctx_get_pci_control() helper to use the #define'd DWORD offsets to fetch the DWORDs needed from @acpi_osc_context, and replace the above instances of the open-coded arithmetic. Cc: "Rafael J. Wysocki" Suggested-by: Davidlohr Bueso Acked-by: Rafael J. Wysocki Reviewed-by: Rafael J. Wysocki Reviewed-by: Davidlohr Bueso Reviewed by: Adam Manzanares Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20220413073618.291335-2-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit 5b95b9d58fb0d7418c3d2d020099db789f66e7a1 Author: Zhi Wang Date: Wed Apr 27 17:28:49 2022 -0400 drm/i915/gvt: Fix the compiling error when CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n A compiling error was reported when CONFIG_DRM_I915_DEBUG_RUNTIME_PM=n. Fix the problem by using the pre-defined macro. Cc: Jason Gunthorpe Cc: Jani Nikula Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220427212849.18109-2-zhi.a.wang@intel.com Reviewed-by: Jani Nikula commit fa630c304b934bee63d437010fb3cbca55c8ee83 Author: Zhi Wang Date: Wed Apr 27 17:28:48 2022 -0400 drm/i915/gvt: Make intel_gvt_match_device() static After the refactor of GVT-g, the reference of intel_gvt_match_device() only happens in handlers.c. Make it static to let the compiler be happy. Fixes: e0f74ed4634d ("i915/gvt: Separate the MMIO tracking table from GVT-g") Cc: Jason Gunthorpe Cc: Jani Nikula Cc: Robert Beckett Cc: Lucas De Marchi Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220427212849.18109-1-zhi.a.wang@intel.com Reviewed-by: Cc: Jani Nikula commit 6fd1d51cfa253b5ee7dae18d7cf1df830e9b6137 Author: Erin MacNeil Date: Wed Apr 27 16:02:37 2022 -0400 net: SO_RCVMARK socket option for SO_MARK with recvmsg() Adding a new socket option, SO_RCVMARK, to indicate that SO_MARK should be included in the ancillary data returned by recvmsg(). Renamed the sock_recv_ts_and_drops() function to sock_recv_cmsgs(). Signed-off-by: Erin MacNeil Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220427200259.2564-1-lnx.erin@gmail.com Signed-off-by: Jakub Kicinski commit 0e55546b189fc5f1ce5149445d7df083f26d4f25 Merge: f3412b3879b4f 249aca0d3d631 Author: Jakub Kicinski Date: Thu Apr 28 13:01:50 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net include/linux/netdevice.h net/core/dev.c 6510ea973d8d ("net: Use this_cpu_inc() to increment net->core_stats") 794c24e9921f ("net-core: rx_otherhost_dropped to core_stats") https://lore.kernel.org/all/20220428111903.5f4304e0@canb.auug.org.au/ drivers/net/wan/cosa.c d48fea8401cf ("net: cosa: fix error check return value of register_chrdev()") 89fbca3307d4 ("net: wan: remove support for COSA and SRP synchronous serial boards") https://lore.kernel.org/all/20220428112130.1f689e5e@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit 6ccf9cb557bd32073b0d68baed97f1bd8a40ff1d Author: Kalesh Singh Date: Wed Apr 20 14:42:57 2022 -0700 KVM: arm64: Symbolize the nVHE HYP addresses Reintroduce the __kvm_nvhe_ symbols in kallsyms, ignoring the local symbols in this namespace. The local symbols are not informative and can cause aliasing issues when symbolizing the addresses. With the necessary symbols now in kallsyms we can symbolize nVHE addresses using the %p print format specifier: [ 98.916444][ T426] kvm [426]: nVHE hyp panic at: [] __kvm_nvhe_overflow_stack+0x8/0x34! Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-7-kaleshsingh@google.com commit 66de19fad9ef47c5376a99bb2b00661f1c788a94 Author: Kalesh Singh Date: Wed Apr 20 14:42:56 2022 -0700 KVM: arm64: Detect and handle hypervisor stack overflows The hypervisor stacks (for both nVHE Hyp mode and nVHE protected mode) are aligned such that any valid stack address has PAGE_SHIFT bit as 1. This allows us to conveniently check for overflow in the exception entry without corrupting any GPRs. We won't recover from a stack overflow so panic the hypervisor. Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-6-kaleshsingh@google.com commit 1a919b17ef012ca0572bae759c27e5ea02bfb47f Author: Kalesh Singh Date: Wed Apr 20 14:42:55 2022 -0700 KVM: arm64: Add guard pages for pKVM (protected nVHE) hypervisor stack Map the stack pages in the flexible private VA range and allocate guard pages below the stack as unbacked VA space. The stack is aligned so that any valid stack address has PAGE_SHIFT bit as 1 - this is used for overflow detection (implemented in a subsequent patch in the series) Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-5-kaleshsingh@google.com commit ce3354318a57875dc59f4bb841662e95bfba03db Author: Kalesh Singh Date: Wed Apr 20 14:42:54 2022 -0700 KVM: arm64: Add guard pages for KVM nVHE hypervisor stack Map the stack pages in the flexible private VA range and allocate guard pages below the stack as unbacked VA space. The stack is aligned so that any valid stack address has PAGE_SHIFT bit as 1 - this is used for overflow detection (implemented in a subsequent patch in the series). Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-4-kaleshsingh@google.com commit f922c13e778d6d5343d4576be785a8204c595113 Author: Kalesh Singh Date: Wed Apr 20 14:42:53 2022 -0700 KVM: arm64: Introduce pkvm_alloc_private_va_range() pkvm_hyp_alloc_private_va_range() can be used to reserve private VA ranges in the pKVM nVHE hypervisor. Allocations are aligned based on the order of the requested size. This will be used to implement stack guard pages for pKVM nVHE hypervisor (in a subsequent patch in the series). Credits to Quentin Perret for the idea of moving private VA allocation out of __pkvm_create_private_mapping() Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-3-kaleshsingh@google.com commit 92abe0f81e1385afd8f1dc66206b5be9a514899b Author: Kalesh Singh Date: Wed Apr 20 14:42:52 2022 -0700 KVM: arm64: Introduce hyp_alloc_private_va_range() hyp_alloc_private_va_range() can be used to reserve private VA ranges in the nVHE hypervisor. Allocations are aligned based on the order of the requested size. This will be used to implement stack guard pages for KVM nVHE hypervisor (nVHE Hyp mode / not pKVM), in a subsequent patch in the series. Signed-off-by: Kalesh Singh Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220420214317.3303360-2-kaleshsingh@google.com commit 59d6f72f6f9c92fec8757d9e29527da828e9281f Author: Krzysztof Kozlowski Date: Sat Apr 23 11:39:32 2022 +0200 rpmsg: qcom_smd: Fix returning 0 if irq_of_parse_and_map() fails irq_of_parse_and_map() returns 0 on failure, so this should not be passed further as error return code. Fixes: 1a358d350664 ("rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220423093932.32136-1-krzysztof.kozlowski@linaro.org commit ad6ade8e34df62e8b876ca40509bfa2ca8ad3262 Author: Umesh Nerlige Ramappa Date: Tue Apr 26 17:35:15 2022 -0700 drm/i915/pmu: Use existing uncore helper to read gpm_timestamp Use intel_uncore_read64_2x32 to read upper and lower fields of the GPM timestamp. v2: Fix compile error Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Tvrtko Ursulin Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220427003515.3944267-1-umesh.nerlige.ramappa@intel.com commit f68f1cb3437d338ee88a9fc05acd19dacdb9aabd Author: Bjorn Andersson Date: Tue Apr 26 16:35:08 2022 -0700 soc: qcom: rpmhpd: add sc8280xp & sa8540p rpmh power-domains The Qualcomm sc8280xp platform has 13 and the sa8540p platform has 11 power-domains. Add compatibles, the typically used ones power-domains and their relevant active-only variants, to the RPMh power-domain driver. Signed-off-by: Bjorn Andersson Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20220426233508.1762345-4-bjorn.andersson@linaro.org commit af77132e9d2bc8ca477003fef15e2c677ae958b1 Author: Bjorn Andersson Date: Tue Apr 26 16:35:07 2022 -0700 soc: qcom: rpmhpd: Don't warn about sparse rpmhpd arrays In some cases the DT binding will fully describe the set of available RPMh power-domains, but there is no reason for exposing them all in the implementation. Omitting individual data->domains is handle gracefully by of_genpd_add_provider_onecell(), so there's no reason for printing a warning when this occurs. Signed-off-by: Bjorn Andersson Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20220426233508.1762345-3-bjorn.andersson@linaro.org commit dbfb5f94e084287f0a3f23d14ef6692c43c98855 Author: Bjorn Andersson Date: Tue Apr 26 16:35:06 2022 -0700 dt-bindings: power: rpmpd: Add sc8280xp RPMh power-domains The sc8280xp has 13 power-domains controlled through the RPMh, document the compatible and provide definitions for the power-domains - and their active-only variants where applicable. The SA8540p differs slightly in the power domains exposed, so add a separate compatible for this, but reuse the constants to allow sharing the DeviceTree source. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20220426233508.1762345-2-bjorn.andersson@linaro.org commit a477b94d657875c81775b7e5147fd2671ff25ce0 Author: Joel Savitz Date: Fri Apr 22 12:45:26 2022 -0400 Documentation: add missing angle bracket in cgroup-v2 doc Trivial addition of missing closing angle backet. Signed-off-by: Joel Savitz Link: https://lore.kernel.org/r/20220422164526.3464306-1-jsavitz@redhat.com Signed-off-by: Jonathan Corbet commit 62ce577b9887accea6f65422f593e83b266a8bf0 Author: Frank Rowand Date: Wed Mar 16 15:26:22 2022 -0500 Documentation: dev-tools: use literal block instead of code-block KTAP Specification: Change code-block directives to straightforward literal blocks since the blocks do not contain code. Suggested-by: Jonathan Corbet Signed-off-by: Frank Rowand Reviewed-by: David Gow Link: https://lore.kernel.org/r/20220316202622.324866-3-frowand.list@gmail.com Signed-off-by: Jonathan Corbet commit a9d1a34f2a025708b2eaffddc9a338e289e5bb65 Author: Andy Shevchenko Date: Wed Apr 13 22:22:03 2022 +0300 iio: dac: ltc2632: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413192203.46704-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit f5cc416384d82d5201e9a066b5686cc38ddb2f00 Author: Yanteng Si Date: Sun Apr 24 18:10:50 2022 +0800 docs/zh_CN: add vm numa translation Translate .../vm/numa.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/65e5a38c3112fb1f9e126f1807fda2724ebf3312.1650794774.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 59c4eba59f65d24abedb39f68d725c91e15278aa Author: Yanteng Si Date: Sun Apr 24 18:10:49 2022 +0800 docs/zh_CN: add vm hmm translation Translate .../vm/hmm.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/6248f340dd43097d6517239e1f038165b9fef7cd.1650794774.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit e0bd6f14c28f49219196c81d2d7d0c16bb65986e Author: Kosuke Fujimoto Date: Mon Apr 25 21:48:53 2022 +0900 docs/ja_JP/index: update section title in Japanese Update section title "Japanese Translation" in Japanese. This change is to keep consistency with other translations. Signed-off-by: Kosuke Fujimoto Cc: Jonathan Corbet Cc: Tsugikazu Shibata Cc: Akira Yokosawa Cc: linux-doc@vger.kernel.org Reviewed-by: Akira Yokosawa Link: https://lore.kernel.org/r/20220425124853.8347-1-fujimotokosuke0@gmail.com Signed-off-by: Jonathan Corbet commit 615b5e199af1c39b19c8029149c2b0fa5659d028 Author: Andy Shevchenko Date: Wed Apr 13 21:53:35 2022 +0300 iio: temperature: max31865: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413185335.21743-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 10434640b6ebefb3d293775ad6dc983eddaa882c Author: Johan Hovold Date: Wed Apr 27 09:31:42 2022 +0200 Documentation: devres: fix typo in interface list Fix the misspelled devm_get_clk_from_child() helper name in the devres interface list. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220427073142.16700-1-johan+linaro@kernel.org Signed-off-by: Jonathan Corbet commit 06f90dd4922484b0f913415842cadf4bbbfcb383 Author: Andy Shevchenko Date: Wed Apr 13 21:31:23 2022 +0300 iio: proximity: mb1232: Switch to use fwnode_irq_get() We have OF-centric variant of fwnode_irq_get() in the driver. Replace it with a call to an agnostic implementation. Signed-off-by: Andy Shevchenko Acked-by: Andreas Klinger Link: https://lore.kernel.org/r/20220413183123.20292-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 6d5aa418b3bd42cdccc36e94ee199af423ef7c84 Author: Akira Yokosawa Date: Wed Apr 27 18:28:39 2022 +0900 docs: submitting-patches: Fix crossref to 'The canonical patch format' The reference to `explicit_in_reply_to` is pointless as when the reference was added in the form of "#15" [1], Section 15) was "The canonical patch format". The reference of "#15" had not been properly updated in a couple of reorganizations during the plain-text SubmittingPatches era. Fix it by using `the_canonical_patch_format`. [1]: 2ae19acaa50a ("Documentation: Add "how to write a good patch summary" to SubmittingPatches") Signed-off-by: Akira Yokosawa Fixes: 5903019b2a5e ("Documentation/SubmittingPatches: convert it to ReST markup") Fixes: 9b2c76777acc ("Documentation/SubmittingPatches: enrich the Sphinx output") Cc: Jonathan Corbet Cc: Mauro Carvalho Chehab Cc: stable@vger.kernel.org # v4.9+ Link: https://lore.kernel.org/r/64e105a5-50be-23f2-6cae-903a2ea98e18@gmail.com Signed-off-by: Jonathan Corbet commit cb55b4428550fc1511fdd0f74057169c9a63c96e Author: Andy Shevchenko Date: Thu Apr 14 16:15:59 2022 +0300 iio: imu: adis16480: Improve getting the optional clocks The extended clocks are optional and may not be present for some configurations supported by this driver. Nevertheless, in case the clock is provided but some error happens during its getting, that error handling should be done properly. Use devm_clk_get_optional() API and report possible errors using dev_err_probe() to handle properly -EPROBE_DEFER error. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Tested-by: Nuno Sá Link: https://lore.kernel.org/r/20220414131559.24694-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 79f4dc9dec0e0beb12728dc214ae03672b7d76d8 Author: Andy Shevchenko Date: Thu Apr 14 16:15:58 2022 +0300 iio: imu: adis16480: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Tested-by: Nuno Sá Link: https://lore.kernel.org/r/20220414131559.24694-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 9eec6e510bbca422d755272f7992656aa064c99b Author: Andy Shevchenko Date: Thu Apr 14 16:15:57 2022 +0300 iio: imu: adis16480: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Tested-by: Nuno Sá Link: https://lore.kernel.org/r/20220414131559.24694-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 0a9599e1fc489567639aa1b6717633bef589b9d4 Author: Colin Ian King Date: Mon Apr 18 14:46:03 2022 +0100 staging: iio: ad2s1210: remove redundant assignment to variable negative Variable negative is being assigned a value that is never read, it is being re-assigned later. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/staging/iio/resolver/ad2s1210.c:502:3: warning: Value stored to 'negative' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220418134603.81336-1-colin.i.king@gmail.com Signed-off-by: Jonathan Cameron commit 0ac507bbc77c87436b80c1fbd680f7c824bacef7 Author: Cixi Geng Date: Tue Apr 19 22:24:58 2022 +0800 iio: adc: sc27xx: add support for PMIC sc2730 sc2730 is the product of sc27xx series. Co-developed-by: Yuming Zhu Signed-off-by: Yuming Zhu Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220419142458.884933-8-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit fff4a7a890ea23e671c55e322c8b341f1f94c4e3 Author: Cixi Geng Date: Tue Apr 19 22:24:57 2022 +0800 iio: adc: sc27xx: add support for PMIC sc2720 and sc2721 sc2720 and sc2721 is the product of sc27xx series. Co-developed-by: Yuming Zhu Signed-off-by: Yuming Zhu Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220419142458.884933-7-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit aac053d03eecb3141268e360696f90e68d78e8ad Author: Cixi Geng Date: Tue Apr 19 22:24:56 2022 +0800 iio: adc: sc27xx: refactor some functions for support more PMiCs Refactor the common adc_nvmem_cell_calib_data,adc_to_volt and call these in the origin sc27xx_adc_scale_calibration,sc27xx_adc_to_volt Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220419142458.884933-6-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit e4171388a431d43048f8b1ca1734645b4e1a8a4d Author: Cixi Geng Date: Tue Apr 19 22:24:55 2022 +0800 iio: adc: sc27xx: structure adjustment and optimization Introduce one variant device data structure to be compatible with SC2731 PMIC since it has different scale and ratio calculation and so on. also rename the SC27xx to SC2731 for some definition and function. Co-developed-by: Yuming Zhu Signed-off-by: Yuming Zhu Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220419142458.884933-5-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit 5a7a184b11c6910f47600ff5cbbee34168f701a8 Author: Cixi Geng Date: Tue Apr 19 22:24:54 2022 +0800 iio: adc: sc27xx: Fine tune the scale calibration values Small adjustment the scale calibration value for the sc2731, use new name sc2731_[big|small]_scale_graph_calib, and remove the origin [big|small]_scale_graph_calib struct for unused. Fixes: 8ba0dbfd07a35 (iio: adc: sc27xx: Add ADC scale calibration) Signed-off-by: Cixi Geng Link: https://lore.kernel.org/r/20220419142458.884933-4-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit ad930a75613282400179361e220e58b87386b8c7 Author: Cixi Geng Date: Tue Apr 19 22:24:53 2022 +0800 iio: adc: sc27xx: fix read big scale voltage not right Fix wrong configuration value of SC27XX_ADC_SCALE_MASK and SC27XX_ADC_SCALE_SHIFT by spec documetation. Fixes: 5df362a6cf49c (iio: adc: Add Spreadtrum SC27XX PMICs ADC support) Signed-off-by: Cixi Geng Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20220419142458.884933-3-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit 392eeccc3b593558694f7caaf855bc2b827c5b0b Author: Cixi Geng Date: Tue Apr 19 22:24:52 2022 +0800 dt-bindings:iio:adc: add sprd,ump9620-adc dt-binding sprd,ump9620-adc is one variant of sc27xx series, add ump9620 description and sample in dt-bindings. Signed-off-by: Cixi Geng Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142458.884933-2-gengcixi@gmail.com Signed-off-by: Jonathan Cameron commit d6ecb01583d4e0a032cbac7faa36f66d41d02d2b Author: Arnaud Ferraris Date: Wed Apr 20 13:25:40 2022 +0200 iio: proximity: stk3310: Export near level property for proximity sensor This makes the value from which an object should be considered "near" available to userspace. This hardware-dependent value should be set in the device-tree. Signed-off-by: Arnaud Ferraris Link: https://lore.kernel.org/r/20220420112540.91907-3-arnaud.ferraris@collabora.com Signed-off-by: Jonathan Cameron commit b71b538b477f4ab7bb8bf39d1fa40e9f296df8b6 Author: Arnaud Ferraris Date: Wed Apr 20 13:25:39 2022 +0200 dt-bindings: iio: light: stk33xx: Add proximity-near-level This allows exporting the value from which userspace should assert an object is "near". Signed-off-by: Arnaud Ferraris Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220420112540.91907-2-arnaud.ferraris@collabora.com Signed-off-by: Jonathan Cameron commit 42763b249aaa0ec8950b433c3cbed021c9779a95 Author: Biju Das Date: Sat Apr 23 14:16:54 2022 +0100 dt-bindings: iio: adc: Document Renesas RZ/V2L ADC Document renesas RZ/V2L ADC bindings. RZ/V2L ADC is identical to RZ/G2L with same number of channels. While at it remove RZ/G2LC SoC from binding documentation as it does not support ADC. Signed-off-by: Biju Das Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220423131654.131390-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 50f2959113cb6756ffd73c4fedc712cf2661f711 Author: Miaoqian Lin Date: Tue Apr 12 06:42:09 2022 +0000 iio: proximity: vl53l0x: Fix return value check of wait_for_completion_timeout wait_for_completion_timeout() returns unsigned long not int. It returns 0 if timed out, and positive if completed. The check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case. Fixes: 3cef2e31b54b ("iio: proximity: vl53l0x: Add IRQ support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220412064210.10734-1-linmq006@gmail.com Signed-off-by: Jonathan Cameron commit d345b23200bcdbd2bd3582213d738c258b77718f Author: Miaoqian Lin Date: Tue Apr 12 06:51:45 2022 +0000 iio: adc: stmpe-adc: Fix wait_for_completion_timeout return value check wait_for_completion_timeout() returns unsigned long not long. it returns 0 if timed out, and positive if completed. The check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case Fixes: e813dde6f833 ("iio: stmpe-adc: Use wait_for_completion_timeout") Signed-off-by: Miaoqian Lin Reviewed-by: Philippe Schenker Link: https://lore.kernel.org/r/20220412065150.14486-1-linmq006@gmail.com Signed-off-by: Jonathan Cameron commit a503bc0a58dbb1ece323f952df92c464cc661833 Author: Jonathan Cameron Date: Sun Apr 10 16:33:17 2022 +0100 iio: accel: mma8452: Add missing documentation for name element of chip_info Documentation needed to avoid build warning with W=1 builds. It doesn't really add any non obvious information but good to have it anyway. No fixes tag as not worth backporting onto the fix that added the name element to the structure. Signed-off-by: Jonathan Cameron Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20220410153317.290896-1-jic23@kernel.org commit 024b58a30274a9e28d5c7c17b1ec405714047f2a Author: Lad Prabhakar Date: Wed Apr 6 08:03:15 2022 +0100 iio: adc: Kconfig: Make RZG2L_ADC depend on ARCH_RZG2L ADC block is common on Renesas RZ/G2L and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220406070315.13862-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Jonathan Cameron commit 61b9c4c7e355fd2f59272423df1d97df6f4cadbc Author: Andy Shevchenko Date: Wed Apr 13 16:15:13 2022 +0300 iio: gyro: fxas21002c: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Acked-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20220413131513.59258-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 720ce8b5684332547e11e24be4ea3b9ebe739201 Author: Andy Shevchenko Date: Wed Apr 13 19:30:04 2022 +0300 iio: gyro: mpu3050: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. While at it, reuse temporary device pointer in the same function. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220413163004.84789-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 813665564b3d7c74412fe2877520f1d254ce948a Author: Andy Shevchenko Date: Wed Apr 13 21:02:02 2022 +0300 iio: core: Convert to use firmware node handle instead of OF node Switch the IIO core to use firmware node handle instead of OF node. This will allow to get label from firmware on non-OF systems. Note, this doesn't change of_iio_*() APIs for now. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413180202.19220-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit f5c822c0607e5419da33ae445a2d303e2ecbfc09 Author: Andy Shevchenko Date: Wed Apr 13 21:14:02 2022 +0300 iio: light: tsl2772: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. While at it, reuse temporary device pointer in the same function. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413181402.19582-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 87b7b07bf0f013b97db2ecbdbb9c64e093bd3587 Author: Andy Shevchenko Date: Wed Apr 13 21:34:21 2022 +0300 iio: proximity: ping: Replace OF specific code by device_get_match_data() Instead of calling the OF specific API, use device_get_match_data(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413183421.20427-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 96a531799de75f20185ffbe977475e571fcad281 Author: Andy Shevchenko Date: Wed Apr 13 21:45:02 2022 +0300 iio: magnetometer: ak8974: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413184502.20998-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit de19f3d127569822b74945b95f5afaa8dfbe23c6 Author: Andy Shevchenko Date: Wed Apr 13 21:46:27 2022 +0300 iio: light: cm3605: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413184627.21125-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 60a0548f098a1d6b04554cc29159877721049bef Author: Andy Shevchenko Date: Wed Apr 13 21:50:44 2022 +0300 iio: temperature: max31856: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add missing mod_devicetable.h include. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413185044.21588-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 811ffbad592e175c9f2a417561e4e3305f42280d Author: Andy Shevchenko Date: Wed Apr 13 22:03:27 2022 +0300 iio: accel: dmard06: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413190327.30054-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit d272cfc3f0c480eac076d8ff394626e84b8c8169 Author: Andy Shevchenko Date: Wed Apr 13 22:01:17 2022 +0300 iio: afe: rescale: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413190117.29814-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 61c8686cee71ae48ff169f5de8bd5200881b32cc Author: Andy Shevchenko Date: Wed Apr 13 22:06:32 2022 +0300 iio: dac: dpot: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413190632.30365-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit a966174494e4b58a8e05026b074e7d01d86046be Author: Andy Shevchenko Date: Wed Apr 13 22:08:19 2022 +0300 iio: dac: lpc18xx: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413190819.38206-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit ebb3861c3fd9dd7329e2cdc8bbcf9a7b673927b3 Author: Andy Shevchenko Date: Wed Apr 13 22:16:11 2022 +0300 iio: dac: vf610: Drop dependency on OF Nothing in this driver depends on OF firmware so drop the dependency to remove the false impression such a dependency exists. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413191611.46204-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 5f474919fad82cd5761d2842c261d736941035fe Author: Andy Shevchenko Date: Thu Apr 14 16:18:04 2022 +0300 iio: imu: bmi160: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. While at it, reuse temporary device pointer in the same function. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220414131804.25227-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit d1100dd9068f445aa3102095f95b44aa80d47f57 Author: Puranjay Mohan Date: Wed Nov 10 01:38:40 2021 +0530 iio: accel: adxl355: use fwnode_irq_get_byname() Use the generic fwnode_irq_get_byname() in place of of_irq_get_byname() to get the IRQ number from the interrupt pin. Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20211109200840.135019-3-puranjay12@gmail.com Signed-off-by: Jonathan Cameron commit 180ab171616119a1343924db1e281c48bfbee6be Author: Lorenzo Bianconi Date: Mon Apr 4 21:24:44 2022 +0200 dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhx device bindings Add device bindings for asm330lhhx IMU sensor. Use lsm6dsr as fallback device for asm330lhhx since it implements all the features currently supported by asm330lhhx. Signed-off-by: Lorenzo Bianconi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/2e5304b7e11085d4e701b4b591fd79cc54f01301.1649100168.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit fdd70d7aad6e274828c051286677442f26d45a7e Author: Lorenzo Bianconi Date: Mon Apr 4 21:24:43 2022 +0200 iio: imu: st_lsm6dsx: add support to ASM330LHHX Add support to STM ASM330LHHX (acc + gyro) automotive Mems sensor. The ASM330LHHX sensor can use LSM6DSR as fallback device since it implements all the ASM330LHHX features currently implemented in st_lsm6dsx. Datasheet: https://www.st.com/resource/en/datasheet/asm330lhhx.pdf Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/04e2644772a6761a25c36bb9679979567fdebda3.1649100168.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit 3289237d2b6331631beaeb0a8cbce9aaadba72c4 Author: Nuno Sá Date: Mon Apr 4 10:50:00 2022 +0200 MAINTAINERS: add ad3552r Add an entry for the ad3552r DAC driver. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220404085000.249423-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit eb5e26a491d17f520921b7e236b3bf0520553542 Author: Nuno Sá Date: Mon Apr 4 10:49:59 2022 +0200 dt-bindings: iio: dac: change ad3552r maintainer As the maintainer email no longer exists, change it to myself. Signed-off-by: Nuno Sá Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220404085000.249423-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron commit aac6834d8ebfa2ad041c5825fc3ffdcdd92f1c59 Author: Maíra Canal Date: Thu Apr 7 08:56:21 2022 -0300 iio: adc: ad7266: convert probe to full device-managed Convert probe functions to device-managed variants, with exception of the regulator, which required a devm_add_action_or_reset() hook registration. Reviewed-by: Marcelo Schmitt Reviewed-by: Nuno Sá Signed-off-by: Maíra Canal Link: https://lore.kernel.org/r/20220407115621.10781-1-maira.canal@usp.br Signed-off-by: Jonathan Cameron commit 74f582ec127e3b10aec71e8d15f1c14b0f0481ec Author: Lars-Peter Clausen Date: Sat Apr 9 12:58:12 2022 +0200 iio: Replace strtobool() with kstrtobool() strtobool() is deprecated and just a wrapper around kstrtobool().Replace it with kstrtobool() so the deprecated function can be removed eventually. Suggested-by: Andy Shevchenko Signed-off-by: Lars-Peter Clausen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220409105812.2113895-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit ac3e62f51b3fbda78a44fff62ece8f11d8f08a25 Author: Miquel Raynal Date: Mon Feb 7 15:38:40 2022 +0100 iio: core: Clarify the modes As part of a previous discussion with Jonathan Cameron [1], it appeared necessary to clarify the meaning of each mode so that new developers could understand better what they should use or not use and when. The idea of renaming these modes as been let aside because naming is a big deal and requires a lot of thinking. So for now let's focus on correctly explaining what each mode implies. [1] https://lore.kernel.org/linux-iio/20210930165510.2295e6c4@jic23-huawei/ Suggested-by: Jonathan Cameron Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-14-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 3912e74c576a56920cde1d5591125cdd5560caae Author: Luca Weiss Date: Thu Apr 21 23:19:35 2022 +0200 ARM: dts: qcom: msm8974: Add missing license headers All other msm8974 dts files are licensed as GPL-2.0 so add the same header to the files where it's missing. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421211936.345168-3-luca@z3ntu.xyz commit 9c5537723429b82561087f8eb8179d065355443c Author: Luca Weiss Date: Thu Apr 21 23:19:34 2022 +0200 ARM: dts: qcom: msm8974-FP2: Add mmc* aliases Add aliases for internal storage and SD card so they don't randomly switch around. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421211936.345168-2-luca@z3ntu.xyz commit 3237f21824165b41ef0bbdd3f784579c931b2a21 Author: Luca Weiss Date: Thu Apr 21 23:19:33 2022 +0200 ARM: dts: qcom: msm8974-FP2: We're msm8974pro Fairphone 2 always uses Snapdragon 801, a.k.a msm8974pro so change the include and filename to that. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421211936.345168-1-luca@z3ntu.xyz commit 6ed7e509d2304519f4f6741670f512a55e9e80fe Author: Darrick J. Wong Date: Mon Apr 25 18:38:24 2022 -0700 xfs: rename xfs_*alloc*_log_count to _block_count These functions return the maximum number of blocks that could be logged in a particular transaction. "log count" is confusing since there's a separate concept of a log (operation) count in the reservation code, so let's change it to "block count" to be less confusing. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit df2fd88f8ac77f75a603d9fa5015225cc6c30edb Author: Darrick J. Wong Date: Mon Apr 25 18:38:15 2022 -0700 xfs: rewrite xfs_reflink_end_cow to use intents Currently, the code that performs CoW remapping after a write has this odd behavior where it walks /backwards/ through the data fork to remap extents in reverse order. Earlier, we rewrote the reflink remap function to use deferred bmap log items instead of trying to cram as much into the first transaction that we could. Now do the same for the CoW remap code. There doesn't seem to be any performance impact; we're just making better use of code that we added for the benefit of reflink. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit b037c4eed2df4568a7702cd512d26625962f95b9 Author: Darrick J. Wong Date: Mon Apr 25 18:38:14 2022 -0700 xfs: reduce transaction reservations with reflink Before to the introduction of deferred refcount operations, reflink would try to cram refcount btree updates into the same transaction as an allocation or a free event. Mainline XFS has never actually done that, but we never refactored the transaction reservations to reflect that we now do all refcount updates in separate transactions. Fix this to reduce the transaction reservation size even farther, so that between this patch and the previous one, we reduce the tr_write and tr_itruncate sizes by 66%. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 4ecf9e7c69edcb8f5b98df471dd026419b881d2b Author: Darrick J. Wong Date: Mon Apr 25 18:38:14 2022 -0700 xfs: reduce the absurdly large log operation count Back in the early days of reflink and rmap development I set the transaction reservation sizes to be overly generous for rmap+reflink filesystems, and a little under-generous for rmap-only filesystems. Since we don't need *eight* transaction rolls to handle three new log intent items, decrease the logcounts to what we actually need, and amend the shadow reservation computation function to reflect what we used to do so that the minimum log size doesn't change. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 918247ce541995dba05391cf14d6061cf0844866 Author: Darrick J. Wong Date: Mon Apr 25 18:38:13 2022 -0700 xfs: report "max_resp" used for min log size computation Move the tracepoint that computes the size of the transaction used to compute the minimum log size into xfs_log_get_max_trans_res so that we only have to compute this stuff once. Leave xfs_log_get_max_trans_res as a non-static function so that xfs_db can call it to report the results of the userspace computation of the same value to diagnose mkfs/kernel misinteractions. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 52d8ea4f2406c14d632a0e7f816bbb18d8c3e9ed Author: Darrick J. Wong Date: Mon Apr 25 18:38:13 2022 -0700 xfs: create shadow transaction reservations for computing minimum log size Every time someone changes the transaction reservation sizes, they introduce potential compatibility problems if the changes affect the minimum log size that we validate at mount time. If the minimum log size gets larger (which should be avoided because doing so presents a serious risk of log livelock), filesystems created with old mkfs will not mount on a newer kernel; if the minimum size shrinks, filesystems created with newer mkfs will not mount on older kernels. Therefore, enable the creation of a shadow log reservation structure where we can "undo" the effects of tweaks when computing minimum log sizes. These shadow reservations should never be used in practice, but they insulate us from perturbations in minimum log size. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit f1e6a8d72806d2d57560b4873d8aa42c420384ee Author: Darrick J. Wong Date: Mon Apr 25 18:38:12 2022 -0700 xfs: remove a __xfs_bunmapi call from reflink This raw call isn't necessary since we can always remove a full delalloc extent. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 4ed6435cc369cce722966983f6e07b872562276f Author: Darrick J. Wong Date: Mon Apr 25 18:37:15 2022 -0700 xfs: stop artificially limiting the length of bunmap calls In commit e1a4e37cc7b6, we clamped the length of bunmapi calls on the data forks of shared files to avoid two failure scenarios: one where the extent being unmapped is so sparsely shared that we exceed the transaction reservation with the sheer number of refcount btree updates and EFI intent items; and the other where we attach so many deferred updates to the transaction that we pin the log tail and later the log head meets the tail, causing the log to livelock. We avoid triggering the first problem by tracking the number of ops in the refcount btree cursor and forcing a requeue of the refcount intent item any time we think that we might be close to overflowing. This has been baked into XFS since before the original e1a4 patch. A recent patchset fixed the second problem by changing the deferred ops code to finish all the work items created by each round of trying to complete a refcount intent item, which eliminates the long chains of deferred items (27dad); and causing long-running transactions to relog their intent log items when space in the log gets low (74f4d). Because this clamp affects /any/ unmapping request regardless of the sharing factors of the component blocks, it degrades the performance of all large unmapping requests -- whereas with an unshared file we can unmap millions of blocks in one go, shared files are limited to unmapping a few thousand blocks at a time, which causes the upper level code to spin in a bunmapi loop even if it wasn't needed. This also eliminates one more place where log recovery behavior can differ from online behavior, because bunmapi operations no longer need to requeue. The fstest generic/447 was created to test the old fix, and it still passes with this applied. Partial-revert-of: e1a4e37cc7b6 ("xfs: try to avoid blowing out the transaction reservation when bunmaping a shared extent") Depends: 27dada070d59 ("xfs: change the order in which child and parent defer ops ar finished") Depends: 74f4d6a1e065 ("xfs: only relog deferred intent items if free space in the log gets low") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit c47260d4ea2ac11ce607d6ac1e0ca5528f42f482 Author: Darrick J. Wong Date: Tue Apr 26 15:29:54 2022 -0700 xfs: count EFIs when deciding to ask for a continuation of a refcount update A long time ago, I added to XFS the ability to use deferred reference count operations as part of a transaction chain. This enabled us to avoid blowing out the transaction reservation when the blocks in a physical extent all had different reference counts because we could ask the deferred operation manager for a continuation, which would get us a clean transaction. The refcount code asks for a continuation when the number of refcount record updates reaches the point where we think that the transaction has logged enough full btree blocks due to refcount (and free space) btree shape changes and refcount record updates that we're in danger of overflowing the transaction. We did not previously count the EFIs logged to the refcount update transaction because the clamps on the length of a bunmap operation were sufficient to avoid overflowing the transaction reservation even in the worst case situation where every other block of the unmapped extent is shared. Unfortunately, the restrictions on bunmap length avoid failure in the worst case by imposing a maximum unmap length of ~3000 blocks, even for non-pathological cases. This seriously limits performance when freeing large extents. Therefore, track EFIs with the same counter as refcount record updates, and use that information as input into when we should ask for a continuation. This enables the next patch to drop the clumsy bunmap limitation. Depends: 27dada070d59 ("xfs: change the order in which child and parent defer ops ar finished") Depends: 74f4d6a1e065 ("xfs: only relog deferred intent items if free space in the log gets low") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 1edf8056131aca6fe7f98873da8297e6fa279d8c Author: Darrick J. Wong Date: Mon Apr 25 18:37:06 2022 -0700 xfs: speed up write operations by using non-overlapped lookups when possible Reverse mapping on a reflink-capable filesystem has some pretty high overhead when performing file operations. This is because the rmap records for logically and physically adjacent extents might not be adjacent in the rmap index due to data block sharing. As a result, we use expensive overlapped-interval btree search, which walks every record that overlaps with the supplied key in the hopes of finding the record. However, profiling data shows that when the index contains a record that is an exact match for a query key, the non-overlapped btree search function can find the record much faster than the overlapped version. Try the non-overlapped lookup first when we're trying to find the left neighbor rmap record for a given file mapping, which makes unwritten extent conversion and remap operations run faster if data block sharing is minimal in this part of the filesystem. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 5e114ad984c220fcc5c08b6bf3b458ce95f46f43 Author: Etienne Carriere Date: Mon Apr 25 10:51:27 2022 +0200 firmware: arm_scmi: Support optee shared memory in the optee transport Add support for TEE shared memory in optee scmi transport. When using tee shared memory, scmi optee transport manages SCMI messages using msg protocol(from msg.c) in shared memory, whereas smt(from shmem.c) protocol is used with static IOMEM based shared buffers. Link: https://lore.kernel.org/r/20220425085127.2009-1-etienne.carriere@linaro.org Reviewed-by: Cristian Marussi Signed-off-by: Etienne Carriere Signed-off-by: Sudeep Holla commit 4c74701b1eb7636eb0cdd66b488b42920105122a Author: Cristian Marussi Date: Wed Mar 30 16:05:49 2022 +0100 firmware: arm_scmi: Add SCMI v3.1 VOLTAGE_LEVEL_SET_COMPLETE Add SCMI v3.1 voltage protocol support for asynchronous VOLTAGE_LEVEL_SET command. Note that, if a voltage domain is advertised to support the asynchronous version of VOLTAGE_LEVEL_SET, the command will be issued asynchronously unless explicitly requested to use the synchronous version by setting the mode to SCMI_VOLTAGE_LEVEL_SET_SYNC when calling voltage_ops->level_set. The SCMI regulator driver level_set invocation has been left unchanged so that it will transparently use the asynchronous version if available. Link: https://lore.kernel.org/r/20220330150551.2573938-21-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7aa75496ea1f38dfd99b93c66f8d9bc525d11efc Author: Cristian Marussi Date: Wed Mar 30 16:05:48 2022 +0100 firmware: arm_scmi: Add SCMI v3.1 clock notifications Add SCMI v3.1 clock pre and post notifications. Link: https://lore.kernel.org/r/20220330150551.2573938-20-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 71bea05797b55d43c3cee8e2ee279ab510e0563c Author: Cristian Marussi Date: Wed Mar 30 16:05:51 2022 +0100 firmware: arm_scmi: Add checks for min/max limits in PERFORMANCE_LIMITS_SET Starting with SCMI v3.1, the PERFORMANCE_LIMITS_SET command allows a user to request only one between max and min ranges to be changed, while leaving the other untouched if set to zero in the request. Anyway SCMI v3.1 states also explicitly that you cannot leave both of those unchanged (zeroed) when issuing such command, so add a proper check for this condition. Link: https://lore.kernel.org/r/20220330150551.2573938-23-cristian.marussi@arm.com Signed-off-by: Cristian Marussi [sudeep.holla: Dropped check for v3.0 and above to make the check unconditional, updated the subject accordingly] Signed-off-by: Sudeep Holla commit 3630cd8130ce0b2a607db09a1995e5bf99053ae1 Author: Cristian Marussi Date: Wed Mar 30 16:05:50 2022 +0100 firmware: arm_scmi: Add SCMI v3.1 perf power-cost in microwatts Add SCMI v3.1 internal support for parsing message attributes reporting the capability of a performance domain to report power-cost in microwatts. Link: https://lore.kernel.org/r/20220330150551.2573938-22-cristian.marussi@arm.com Cc: Lukasz Luba Reviewed-by: Lukasz Luba Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 79d2ea9244180bf76537c23406d838db955a57b5 Author: Cristian Marussi Date: Wed Mar 30 16:05:47 2022 +0100 firmware: arm_scmi: Use common iterators in the perf protocol Make SCMI perf protocol use the common iterator protocol helpers for issuing the multi-part commands. Link: https://lore.kernel.org/r/20220330150551.2573938-19-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit d8d7e91316746d130a9c5d09dc21d59eff5e3e43 Author: Cristian Marussi Date: Wed Mar 30 16:05:46 2022 +0100 firmware: arm_scmi: Use common iterators in the voltage protocol Make SCMI voltage protocol use the common iterator protocol helpers for issuing the multi-part commands. Link: https://lore.kernel.org/r/20220330150551.2573938-18-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7bc7caafe6b1e5b882255a42bc1bf112fa87b69b Author: Cristian Marussi Date: Wed Mar 30 16:05:45 2022 +0100 firmware: arm_scmi: Use common iterators in the clock protocol Make SCMI clock protocol use the common iterator protocol helpers for issuing the multi-part commands. Link: https://lore.kernel.org/r/20220330150551.2573938-17-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 802b0bed011e598876c0975da2c41dadf01a3d03 Author: Cristian Marussi Date: Wed Mar 30 16:05:44 2022 +0100 firmware: arm_scmi: Add SCMI v3.1 SENSOR_AXIS_NAME_GET support Add support for SCMI v3.1 SENSOR_AXIS_NAME_GET multi-part command using the common iterator protocol helpers. Link: https://lore.kernel.org/r/20220330150551.2573938-16-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7cab537704ec03260208ed5f4ad54accb635164c Author: Cristian Marussi Date: Wed Mar 30 16:05:43 2022 +0100 firmware: arm_scmi: Use common iterators in the sensor protocol Make SCMI sensor protocol use the common iterator protocol helpers for issuing the multi-part commands. Link: https://lore.kernel.org/r/20220330150551.2573938-15-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 36b6ea0fc6bcbc618fe20d33a3b529a6d0653d99 Author: Cristian Marussi Date: Wed Mar 30 16:05:42 2022 +0100 firmware: arm_scmi: Add iterators for multi-part commands SCMI specification defines some commands as optionally issued over multiple messages in order to overcome possible limitations in payload size enforced by the configured underlyinng transport. Introduce some common protocol helpers to provide a unified solution for issuing such SCMI multi-part commands. Link: https://lore.kernel.org/r/20220330150551.2573938-14-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit df3576d14a4598534d1a28276ded5ba2545d5e4c Author: Cristian Marussi Date: Wed Mar 30 16:05:41 2022 +0100 firmware: arm_scmi: Parse clock_enable_latency conditionally The clock_enable_latency field in CLOCK_ATTRIBUTES response message has been added only since SCMI v3.1. Use the advertised SCMI clock protocol version as a proper condition check for parsing it, instead of the bare message length lookup. Link: https://lore.kernel.org/r/20220330150551.2573938-13-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 7ad6b6ccbafc1faa04ca9d26635bdd5e3e240a69 Author: Sudeep Holla Date: Thu Apr 28 13:29:13 2022 +0100 firmware: arm_scmi: Set clock latency to U32_MAX if it is not supported As per the spec, the clock_enable_delay is the worst case latency incurred by the platform to enable the clock. The value of 0 indicates that the platform doesn't support the same and must be considered as maximum latency for practical purposes. Currently the value of 0 is assigned as is and is propogated to the clock framework which can assume that the clock can support atomic enable operation. Link: https://lore.kernel.org/r/20220428122913.1654821-1-sudeep.holla@arm.com Fixes: 18f295b758b2 ("firmware: arm_scmi: Add support for clock_enable_latency") Signed-off-by: Sudeep Holla commit b260fccaebdc2c838e62aaef24fedf497f181d10 Author: Cristian Marussi Date: Wed Mar 30 16:05:40 2022 +0100 firmware: arm_scmi: Add SCMI v3.1 protocol extended names support Using the common protocol helper implementation add support for all new SCMIv3.1 extended names commands related to all protocols with the exception of SENSOR_AXIS_GET_NAME. Link: https://lore.kernel.org/r/20220330150551.2573938-12-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 5c873d120d8676b22e04ba1c7d9eba878b6c6484 Author: Cristian Marussi Date: Wed Mar 30 16:05:39 2022 +0100 firmware: arm_scmi: Introduce a common SCMI v3.1 .extended_name_get helper Introduce a new set of common protocol operations bound to the protocol handle structure so that can be invoked by the protocol implementation code even when protocols are built as distinct loadable kernel module without the need of exporting new symbols, like already done with scmi_xfer_ops. Add at first, as new common protocol helper, an .extended_name_get helper which will ease implementation and will avoid code duplication when adding new SCMIv3.1 per-protocol _NAME_GET commands. Link: https://lore.kernel.org/r/20220330150551.2573938-11-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 23136bff80a7edbe7b5df2b7c327d6584879930b Author: Cristian Marussi Date: Wed Mar 30 16:05:38 2022 +0100 firmware: arm_scmi: Split protocol specific definitions in a dedicated header Move some SCMI protocol specific definitions from common.h into a the new dedicated protocols.h header so that SCMI protocols core code can include only what it needs; this is going to be useful to avoid the risk of growing indefinitely the dimension of common.h, especially when introducing some common protocols helper functions. Header common.h will continue to be included by SCMI core and transport layers. Link: https://lore.kernel.org/r/20220330150551.2573938-10-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 91ebc56cbcfa4c746a84ab9ee6a854be739860e2 Author: Cristian Marussi Date: Wed Mar 30 16:05:37 2022 +0100 firmware: arm_scmi: Remove unneeded NULL termination of clk name The string array 'name' inside struct scmi_clock_info holds the clock name which was successfully retrieved by querying the SCMI platform, unless the related underlying SCMI command failed. Anyway, such scmi_clock_info structure is allocated using devm_kcalloc() which in turn internally appends a __GFP_ZERO flag to its invocation: as a consequence the string 'name' field does not need to be zeroed when we fail to get the clock name via SCMI, it is already NULL terminated. Remove unneeded explicit NULL termination. Link: https://lore.kernel.org/r/20220330150551.2573938-9-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit c7e223f5c736745967e6b6e5124489d81be111d2 Author: Cristian Marussi Date: Wed Mar 30 16:05:36 2022 +0100 firmware: arm_scmi: Check CLOCK_RATE_SET_COMPLETE async response When CLOCK_RATE_SET command is issued in asynchronous mode the delayed response CLOCK_RATE_SET_COMPLETE comes back once the SCMI platform has effectively operated the requested change: such delayed response carries also the clock ID and the final clock rate that has been set. As an aid to debug issues, check that the clock ID in the delayed response matches the expected one and debug print the rate value. Link: https://lore.kernel.org/r/20220330150551.2573938-8-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 992be5d3c818fcc277db246cb409659ca82abdbe Author: Cristian Marussi Date: Wed Mar 30 16:05:35 2022 +0100 firmware: arm_scmi: Make name_get operations return a const A few protocol operations are available that returns a pointer to an internal character array representing resource name. Make those functions return a const pointer to such array. Link: https://lore.kernel.org/r/20220330150551.2573938-7-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 776b6c8a25a36b5f46ed182ed6514c208e76720d Author: Cristian Marussi Date: Wed Mar 30 16:05:34 2022 +0100 firmware: arm_scmi: Dynamically allocate implemented protocols array Move away from a statically allocated array for holding the current set of protocols implemented by the platform in favour of allocating it dynamically based on the number of protocols effectively advertised by the platform via BASE protocol exchanges. While at that, rectify the BASE_DISCOVER_LIST_PROTOCOLS loop iterations to terminate only when a number of protocols equal to the advertised ones has been received, instead of looping till the platform returns no more protocols descriptors. This new behaviour is better compliant with the specification and it has been tested to work equally well against an SCMI stack running on top of an official SCP firmware on a JUNO board. Link: https://lore.kernel.org/r/20220330150551.2573938-6-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 3b0041f6e10e5bdbb646d98172be43e88734ed62 Author: Cristian Marussi Date: Wed Mar 30 16:05:33 2022 +0100 firmware: arm_scmi: Validate BASE_DISCOVER_LIST_PROTOCOLS response Do not blindly trust SCMI platform response about list of implemented protocols, instead validate the reported length of the list of protocols against the real payload size of the message reply. Link: https://lore.kernel.org/r/20220330150551.2573938-5-cristian.marussi@arm.com Fixes: b6f20ff8bd94 ("firmware: arm_scmi: add common infrastructure and support for base protocol") Signed-off-by: Cristian Marussi [sudeep.holla: Added early break if loop_num_ret = 0 and simplified calc_list_sz calculation] Signed-off-by: Sudeep Holla commit 35e01667c84b1e16060020c3a13099447e61c822 Author: Dan Carpenter Date: Thu Apr 28 12:38:25 2022 +0300 cxl/mbox: fix logical vs bitwise typo This should be bitwise & instead of &&. Fixes: 6179045ccc0c ("cxl/mbox: Block immediate mode in SET_PARTITION_INFO command") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YmpgkbbQ1Yxu36uO@kili Signed-off-by: Dan Williams commit aca43ad51661d46b0083614a5b75b6cb90c30741 Author: Mark Brown Date: Wed Apr 27 19:19:54 2022 +0100 selftests/arm64: Fix O= builds for the floating point tests Currently the arm64 floating point tests don't support out of tree builds due to two quirks of the kselftest build system. One is that when building a program from multiple files we shouldn't separately compile the main program to an object file as that will result in the pattern rule not matching when adjusted for the output directory. The other is that we also need to include $(OUTPUT) in the names of the binaries when specifying the dependencies in order to ensure that they get picked up with O=. Rewrite the dependencies for the executables to fix these issues. The kselftest build system will ensure OUTPUT is always defined. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220427181954.357975-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 399cf0a3e8a1a2cf93e87017282e682e7b65f01c Author: Mark Brown Date: Wed Apr 27 19:19:53 2022 +0100 selftests/arm64: Clean the fp helper libraries We provide a couple of object files with helpers linked into several of the test programs, ensure they are cleaned. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220427181954.357975-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 3a23a42d1a480095e5e6ab820594f194079b6a61 Author: Mark Brown Date: Wed Apr 27 19:19:52 2022 +0100 selftests/arm64: Define top_srcdir for the fp tests Some of the rules in lib.mk use a top_srcdir variable to figure out where the top of the kselftest tree is, provide it. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220427181954.357975-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit a59f7a7f76407da78c21c42afe6d57bd885caa53 Author: Mark Brown Date: Wed Apr 27 19:19:51 2022 +0100 selftests/arm64: Use TEST_GEN_PROGS_EXTENDED in the FP Makefile The kselftest lib.mk provides a default all target which builds additional programs from TEST_GEN_PROGS_EXTENDED, use that rather than using TEST_PROGS_EXTENDED which is for programs that don't need to be built like shell scripts. Leave fpsimd-stress and sve-stress there since they are scripts. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220427181954.357975-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit f82efe5b9a3ae75a557097a074b0125032e76a83 Author: Guo Zhengkui Date: Tue Apr 19 11:24:51 2022 +0800 kselftest/arm64: fix array_size.cocci warning Fix the following coccicheck warnings: tools/testing/selftests/arm64/mte/check_child_memory.c:110:25-26: WARNING: Use ARRAY_SIZE tools/testing/selftests/arm64/mte/check_child_memory.c:88:24-25: WARNING: Use ARRAY_SIZE tools/testing/selftests/arm64/mte/check_child_memory.c:90:20-21: WARNING: Use ARRAY_SIZE tools/testing/selftests/arm64/mte/check_child_memory.c:147:24-25: WARNING: Use ARRAY_SIZE `ARRAY_SIZE` macro is defined in tools/testing/selftests/kselftest.h. Signed-off-by: Guo Zhengkui Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220419032501.22790-1-guozhengkui@vivo.com Signed-off-by: Catalin Marinas commit 212b0426bc361eede2f9ce43fb2a5b01070000a1 Author: Mark Brown Date: Tue Apr 19 12:22:47 2022 +0100 selftests/arm64: Add a testcase for handling of ZA on clone() Add a small testcase that attempts to do a clone() with ZA enabled and verifies that it remains enabled with the same contents. We only check one word in one horizontal vector of ZA since there's already other tests that check for data corruption more broadly, we're just looking to make sure that ZA is still enabled and it looks like the data got copied. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220419112247.711548-40-broonie@kernel.org Signed-off-by: Catalin Marinas commit 43e3f85523e488f8acd6b371d457818d81977934 Author: Mark Brown Date: Tue Apr 19 12:22:46 2022 +0100 kselftest/arm64: Add SME support to syscall ABI test For every possible combination of SVE and SME vector length verify that for each possible value of SVCR after a syscall we leave streaming mode and ZA is preserved. We don't need to take account of any streaming/non streaming SVE vector length changes in the assembler code since the store instructions will handle the vector length for us. We log if the system supports FA64 and only try to set FFR in streaming mode if it does. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-39-broonie@kernel.org Signed-off-by: Catalin Marinas commit 86c8888f91a95a30d8a224c0c655ddac33d04eac Author: Mark Brown Date: Tue Apr 19 12:22:45 2022 +0100 kselftest/arm64: Add coverage for the ZA ptrace interface Add some basic coverage for the ZA ptrace interface, including walking through all the vector lengths supported in the system. Unlike SVE doing syscalls does not discard the ZA state so when we set data in ZA we run the child process briefly, having it add one to each byte in ZA in order to validate that both the vector size and data are being read and written as expected when the process runs. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-38-broonie@kernel.org Signed-off-by: Catalin Marinas commit fa23100bbad0748f6503511b109cfec955e4183d Author: Mark Brown Date: Tue Apr 19 12:22:44 2022 +0100 kselftest/arm64: Add streaming SVE to SVE ptrace tests In order to allow ptrace of streaming mode SVE registers we have added a new regset for streaming mode which in isolation offers the same ABI as regular SVE with a different vector type. Add this to the array of regsets we handle, together with additional tests for the interoperation of the two regsets. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-37-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4963aeb35a9edca90f062885b0d78c47a00c1752 Author: Mark Brown Date: Tue Apr 19 12:22:43 2022 +0100 kselftest/arm64: signal: Add SME signal handling tests Add test cases for the SME signal handing ABI patterned off the SVE tests. Due to the small size of the tests and the differences in ABI (especially around needing to account for both streaming SVE and ZA) there is some code duplication here. We currently cover: - Reporting of the vector length. - Lack of support for changing vector length. - Presence and size of register state for streaming SVE and ZA. As with the SVE tests we do not yet have any validation of register contents. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-36-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5aa45cc5355db3f5302e232a0fe29759ace4bc92 Author: Mark Brown Date: Tue Apr 19 12:22:42 2022 +0100 kselftest/arm64: Add stress test for SME ZA context switching Add a stress test for context switching of the ZA register state based on the similar tests Dave Martin wrote for FPSIMD and SVE registers. The test loops indefinitely writing a data pattern to ZA then reading it back and verifying that it's what was expected. Unlike the other tests we manually assemble the SME instructions since at present no released toolchain has SME support integrated. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-35-broonie@kernel.org Signed-off-by: Catalin Marinas commit 1a792b545519b6e49f9b1653095ed785eea19afe Author: Mark Brown Date: Tue Apr 19 12:22:41 2022 +0100 kselftest/arm64: signal: Handle ZA signal context in core code As part of the generic code for signal handling test cases we parse all signal frames to make sure they have at least the basic form we expect and that there are no unexpected frames present in the signal context. Add coverage of the ZA signal frame to this code. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-34-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4126bde025c8f973dfd278879fa32e293f563df5 Author: Mark Brown Date: Tue Apr 19 12:22:40 2022 +0100 kselftest/arm64: sme: Provide streaming mode SVE stress test One of the features of SME is the addition of streaming mode, in which we have access to a set of streaming mode SVE registers at the SME vector length. Since these are accessed using the SVE instructions let's reuse the existing SVE stress test for testing with a compile time option for controlling the few small differences needed: - Enter streaming mode immediately on starting the program. - In streaming mode FFR is removed so skip reading and writing FFR. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-33-broonie@kernel.org Signed-off-by: Catalin Marinas commit a0f2eb641b7c4ff753374f8b2043b8bbb1666a96 Author: Mark Brown Date: Tue Apr 19 12:22:39 2022 +0100 kselftest/arm64: Extend vector configuration API tests to cover SME Provide RDVL helpers for SME and extend the main vector configuration tests to cover SME. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-32-broonie@kernel.org Signed-off-by: Catalin Marinas commit 30e3a42b5d47d6dadba73a8509a6687a9d8f8e40 Author: Mark Brown Date: Tue Apr 19 12:22:38 2022 +0100 kselftest/arm64: Add tests for TPIDR2 The Scalable Matrix Extension adds a new system register TPIDR2 intended to be used by libc for its own thread specific use, add some kselftests which exercise the ABI for it. Since this test should with some adjustment work for TPIDR and any other similar registers added in future add tests for it in a separate directory rather than placing it with the other floating point tests, nothing existing looked suitable so I created a new test directory called "abi". Since this feature is intended to be used by libc the test is built as freestanding code using nolibc so we don't end up with the test program and libc both trying to manage the register simultaneously and distrupting each other. As a result of being written using nolibc rather than using hwcaps to identify if SME is available in the system we check for the default SME vector length configuration in proc, adding hwcap support to nolibc seems like disproportionate effort and didn't feel entirely idiomatic for what nolibc is trying to do. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-31-broonie@kernel.org Signed-off-by: Catalin Marinas commit e8c4451480d0cb37cbc69160113b1f4ff211cd16 Author: Mark Brown Date: Tue Apr 19 12:22:37 2022 +0100 kselftest/arm64: sme: Add SME support to vlset The Scalable Matrix Extenions (SME) introduces additional register state with configurable vector lengths, similar to SVE but configured separately. Extend vlset to support configuring this state with a --sme or -s command line option. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-30-broonie@kernel.org Signed-off-by: Catalin Marinas commit 6d51b18865c65390973e6ed0aec20239cf475489 Author: Mark Brown Date: Tue Apr 19 12:22:36 2022 +0100 kselftest/arm64: Add manual encodings for SME instructions As for the kernel so that we don't have ambitious toolchain requirements to build the tests manually encode some of the SVE instructions. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-29-broonie@kernel.org Signed-off-by: Catalin Marinas commit e2d9642a5a5101a559e7d368a1df8e01e960096b Author: Mark Brown Date: Tue Apr 19 11:32:43 2022 +0100 kselftest/arm64: Add simple test for MTE prctl The current tests use the prctls for various things but there's no coverage of the edges of the interface so add some basics. This isn't hugely useful as it is (it originally had some coverage for the combinations with asymmetric mode but we removed the prctl() for that) but it might be a helpful starting point for future work, for example covering error handling. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220419103243.24774-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit f326c9a6f49b06c0a936d68ae23cb90899835c3b Author: Mark Brown Date: Tue Apr 19 11:32:42 2022 +0100 kselftest/arm64: Refactor parameter checking in mte_switch_mode() Currently we just have a big if statement with a non-specific diagnostic checking both the mode and the tag. Since we'll need to dynamically check for asymmetric mode support in the system and to improve debugability split these checks out. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220419103243.24774-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 191e678bdc9be2447dae227f5b6ea1e995c5ee9c Author: Mark Brown Date: Tue Apr 19 11:32:41 2022 +0100 kselftest/arm64: Log unexpected asynchronous MTE faults Help people figure out problems by printing a diagnostic when we get an unexpected asynchronous fault. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220419103243.24774-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 3f374d7972c48bc0824bdabb8f94fe82e54fd07d Author: Mark Brown Date: Tue Apr 19 11:32:40 2022 +0100 kselftest/arm64: Handle more kselftest result codes in MTE helpers The MTE selftests have a helper evaluate_test() which translates a return code into a call to ksft_test_result_*(). Currently this only handles pass and fail, silently ignoring any other code. Update the helper to support skipped tests and log any unknown return codes as an error so we get at least some diagnostic if anything goes wrong. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220419103243.24774-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 82f97bcd876a6b5f764726a5210bde638d9f4d0a Author: Mark Brown Date: Mon Apr 4 10:06:13 2022 +0100 kselftest/arm64: Validate setting via FPSIMD and read via SVE regsets Currently we validate that we can set the floating point state via the SVE regset and read the data via the FPSIMD regset but we do not valiate that the opposite case works as expected. Add a test that covers this case, noting that when reading via SVE regset the kernel has the option of returning either SVE or FPSIMD data so we need to accept both formats. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220404090613.181272-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 1fb1e285b4a8a3664897c34414787ea825124cb2 Author: Mark Brown Date: Mon Apr 4 10:06:12 2022 +0100 kselftest/arm64: Remove assumption that tasks start FPSIMD only Currently the sve-ptrace test for setting and reading FPSIMD data assumes that the child will start off in FPSIMD only mode and that it can use this to read some FPSIMD mode SVE ptrace data, skipping the test if it can't. This isn't an assumption guaranteed by the ABI and also limits how we can use this testcase within the program. Instead skip the initial read and just generate a FPSIMD format buffer for the write part of the test, making the coverage more robust in the face of future kernel and test program changes. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220404090613.181272-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 854f856f7ee35d26cdfd26e4eb3f293cc8cd8d12 Author: Mark Brown Date: Mon Apr 4 10:06:11 2022 +0100 kselftest/arm64: Fix comment for ptrace_sve_get_fpsimd_data() The comment for ptrace_sve_get_fpsimd_data() doesn't describe what the test does at all, fix that. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220404090613.181272-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 1e6b8d5df017aa7a0cbff4555d1803ea3e8b3d8e Author: Wayne Lin Date: Thu Apr 28 20:49:44 2022 +0800 drm/dp_mst: Lower down debug info level when receive NAK [Why] It's reasonable that we receive NAK while doing DP_REMOTE_DPCD_READ. Downstream device might reply NAK with the reason and source should react accordingly. e.g. 1. When downstream device can't handle corresponding message in time, it then replies NAK as reason been set as DEFER. 2. When multi-function branch-sink device doesn't enumerate virtual DP peer devices for those multi-function down facing ports. Without virtual DPCD, branch device might reply NAK with reason as BAD_PARAM indicating this port can't do aux DPCD read. It's expected result. Not an error. [How] Use drm_dbg_kms() to replace drm_err() when receive NAK. Changes since v1: * drm_dp_mst_topology.c file path changed. Folder was rename from 'dp' to 'display' Signed-off-by: Wayne Lin Reviewed-by: Harry Wentland Reviewed-by: Lyude Paul [fixed some indenting issues] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220428124944.1683680-1-Wayne.Lin@amd.com commit 724c3be3db3413b930320cb716214e37cf0a40e2 Author: Uwe Kleine-König Date: Thu Jan 13 11:14:30 2022 +0100 mfd: twl4030: Make twl4030_exit_irq() return void If twl4030_exit_irq() returns an error, the effect is that the caller (twl_remove()) forwards the error to the i2c core without unregistering its dummy slave devices. This only makes the i2c core emit another error message and then it still removes the device. In this situation it doesn't make sense to abort the remove cleanup and not unregister the slave devices. So do that. Then return value is actually unused and twl4030_exit_irq() can better be changed to return no value at all. Signed-off-by: Uwe Kleine-König Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220113101430.12869-3-u.kleine-koenig@pengutronix.de commit b6f29431820d16de4b16c465c44355d4aa522149 Author: Uwe Kleine-König Date: Thu Jan 13 11:14:29 2022 +0100 mfd: twl6030: Make twl6030_exit_irq() return void This function returns 0 unconditionally, so there is no benefit in returning a value at all and make the caller do error checking. Also the caller (twl_remove()) cannot do anything sensible with an error code. Passing it up the call stack isn't a good option because the i2c core ignores error codes (apart from emitting an error message). Signed-off-by: Uwe Kleine-König Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220113101430.12869-2-u.kleine-koenig@pengutronix.de commit e8ae0e140c05319fa47bb3bf615c3a585f404b9d Author: Jason Gunthorpe Date: Mon Apr 11 12:16:08 2022 -0300 vfio: Require that devices support DMA cache coherence IOMMU_CACHE means that normal DMAs do not require any additional coherency mechanism and is the basic uAPI that VFIO exposes to userspace. For instance VFIO applications like DPDK will not work if additional coherency operations are required. Therefore check IOMMU_CAP_CACHE_COHERENCY like vdpa & usnic do before allowing an IOMMU backed VFIO device to be created. Reviewed-by: Kevin Tian Acked-by: Alex Williamson Acked-by: Robin Murphy Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v3-2cf356649677+a32-intel_no_snoop_jgg@nvidia.com Signed-off-by: Joerg Roedel commit f78dc1dad829e505d83e33dc0879887f074c52e1 Author: Jason Gunthorpe Date: Mon Apr 11 12:16:07 2022 -0300 iommu: Redefine IOMMU_CAP_CACHE_COHERENCY as the cap flag for IOMMU_CACHE While the comment was correct that this flag was intended to convey the block no-snoop support in the IOMMU, it has become widely implemented and used to mean the IOMMU supports IOMMU_CACHE as a map flag. Only the Intel driver was different. Now that the Intel driver is using enforce_cache_coherency() update the comment to make it clear that IOMMU_CAP_CACHE_COHERENCY is only about IOMMU_CACHE. Fix the Intel driver to return true since IOMMU_CACHE always works. The two places that test this flag, usnic and vdpa, are both assigning userspace pages to a driver controlled iommu_domain and require IOMMU_CACHE behavior as they offer no way for userspace to synchronize caches. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Acked-by: Robin Murphy Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v3-2cf356649677+a32-intel_no_snoop_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 71cfafda9c9bd9812cdb62ddb94daf65a1af12c1 Author: Jason Gunthorpe Date: Mon Apr 11 12:16:06 2022 -0300 vfio: Move the Intel no-snoop control off of IOMMU_CACHE IOMMU_CACHE means "normal DMA to this iommu_domain's IOVA should be cache coherent" and is used by the DMA API. The definition allows for special non-coherent DMA to exist - ie processing of the no-snoop flag in PCIe TLPs - so long as this behavior is opt-in by the device driver. The flag is mainly used by the DMA API to synchronize the IOMMU setting with the expected cache behavior of the DMA master. eg based on dev_is_dma_coherent() in some case. For Intel IOMMU IOMMU_CACHE was redefined to mean 'force all DMA to be cache coherent' which has the practical effect of causing the IOMMU to ignore the no-snoop bit in a PCIe TLP. x86 platforms are always IOMMU_CACHE, so Intel should ignore this flag. Instead use the new domain op enforce_cache_coherency() which causes every IOPTE created in the domain to have the no-snoop blocking behavior. Reconfigure VFIO to always use IOMMU_CACHE and call enforce_cache_coherency() to operate the special Intel behavior. Remove the IOMMU_CACHE test from Intel IOMMU. Ultimately VFIO plumbs the result of enforce_cache_coherency() back into the x86 platform code through kvm_arch_register_noncoherent_dma() which controls if the WBINVD instruction is available in the guest. No other archs implement kvm_arch_register_noncoherent_dma() nor are there any other known consumers of VFIO_DMA_CC_IOMMU that might be affected by the user visible result change on non-x86 archs. Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Acked-by: Alex Williamson Acked-by: Robin Murphy Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v3-2cf356649677+a32-intel_no_snoop_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 6043257b1de069fbb5a2a52d7211c0275bc8c0e0 Author: Jason Gunthorpe Date: Mon Apr 11 12:16:05 2022 -0300 iommu: Introduce the domain op enforce_cache_coherency() This new mechanism will replace using IOMMU_CAP_CACHE_COHERENCY and IOMMU_CACHE to control the no-snoop blocking behavior of the IOMMU. Currently only Intel and AMD IOMMUs are known to support this feature. They both implement it as an IOPTE bit, that when set, will cause PCIe TLPs to that IOVA with the no-snoop bit set to be treated as though the no-snoop bit was clear. The new API is triggered by calling enforce_cache_coherency() before mapping any IOVA to the domain which globally switches on no-snoop blocking. This allows other implementations that might block no-snoop globally and outside the IOPTE - AMD also documents such a HW capability. Leave AMD out of sync with Intel and have it block no-snoop even for in-kernel users. This can be trivially resolved in a follow up patch. Only VFIO needs to call this API because it does not have detailed control over the device to avoid requesting no-snoop behavior at the device level. Other places using domains with real kernel drivers should simply avoid asking their devices to set the no-snoop bit. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Acked-by: Robin Murphy Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v3-2cf356649677+a32-intel_no_snoop_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 9a9a90ca1327024f669b670b02f61021306033dc Author: Tiezhu Yang Date: Thu Apr 28 17:55:54 2022 +0800 bpf, docs: Fix typo "respetively" to "respectively" "respetively" should be "respectively". Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1651139754-4838-4-git-send-email-yangtiezhu@loongson.cn commit c821d80bb890b1a8220e278984f3c64f5fd9adf9 Author: Tiezhu Yang Date: Thu Apr 28 17:55:53 2022 +0800 bpf, docs: BPF_FROM_BE exists as alias for BPF_TO_BE According to include/uapi/linux/bpf.h: #define BPF_FROM_LE BPF_TO_LE #define BPF_FROM_BE BPF_TO_BE BPF_FROM_BE exists as alias for BPF_TO_BE instead of BPF_TO_LE. Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1651139754-4838-3-git-send-email-yangtiezhu@loongson.cn commit 67b97e58423247b4c7ae1b639ccfef4dddf8a8fa Author: Tiezhu Yang Date: Thu Apr 28 17:55:52 2022 +0800 bpf, docs: Remove duplicated word "instructions" The word "instructions" is duplicated, remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1651139754-4838-2-git-send-email-yangtiezhu@loongson.cn commit 4b674dd69701c2e22e8e7770c1706a69f3b17269 Author: Steven Price Date: Fri Dec 3 10:28:15 2021 +0000 drm/plane: Move range check for format_count earlier While the check for format_count > 64 in __drm_universal_plane_init() shouldn't be hit (it's a WARN_ON), in its current position it will then leak the plane->format_types array and fail to call drm_mode_object_unregister() leaking the modeset identifier. Move it to the start of the function to avoid allocating those resources in the first place. Signed-off-by: Steven Price Signed-off-by: Liviu Dudau Link: https://lore.kernel.org/dri-devel/20211203102815.38624-1-steven.price@arm.com/ commit 455880dfe292a2bdd3b4ad6a107299fce610e64b Author: Jeffrey Hugo Date: Wed Apr 27 08:07:33 2022 -0600 PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI In the multi-MSI case, hv_arch_irq_unmask() will only operate on the first MSI of the N allocated. This is because only the first msi_desc is cached and it is shared by all the MSIs of the multi-MSI block. This means that hv_arch_irq_unmask() gets the correct address, but the wrong data (always 0). This can break MSIs. Lets assume MSI0 is vector 34 on CPU0, and MSI1 is vector 33 on CPU0. hv_arch_irq_unmask() is called on MSI0. It uses a hypercall to configure the MSI address and data (0) to vector 34 of CPU0. This is correct. Then hv_arch_irq_unmask is called on MSI1. It uses another hypercall to configure the MSI address and data (0) to vector 33 of CPU0. This is wrong, and results in both MSI0 and MSI1 being routed to vector 33. Linux will observe extra instances of MSI1 and no instances of MSI0 despite the endpoint device behaving correctly. For the multi-MSI case, we need unique address and data info for each MSI, but the cached msi_desc does not provide that. However, that information can be gotten from the int_desc cached in the chip_data by compose_msi_msg(). Fix the multi-MSI case to use that cached information instead. Since hv_set_msi_entry_from_desc() is no longer applicable, remove it. Signed-off-by: Jeffrey Hugo Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1651068453-29588-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Wei Liu commit 15342f930ebebcfe36f2415049736a77d7d2e045 Author: Miaoqian Lin Date: Mon Dec 13 07:21:15 2021 +0000 malidp: Fix NULL vs IS_ERR() checking The get_sg_table() function does not return NULL. It returns error pointers. Signed-off-by: Miaoqian Lin Signed-off-by: Liviu Dudau Link: https://lore.kernel.org/dri-devel/20211213072115.18098-1-linmq006@gmail.com/ commit 1c9de08f7f952b4101f092802581344033d84429 Author: Andrea Parri (Microsoft) Date: Thu Apr 28 16:51:07 2022 +0200 Drivers: hv: vmbus: Refactor the ring-buffer iterator functions With no users of hv_pkt_iter_next_raw() and no "external" users of hv_pkt_iter_first_raw(), the iterator functions can be refactored and simplified to remove some indirection/code. Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220428145107.7878-6-parri.andrea@gmail.com Signed-off-by: Wei Liu commit da795eb239d9e9496812e22cb582d38a71e0789a Author: Andrea Parri (Microsoft) Date: Thu Apr 28 16:51:06 2022 +0200 Drivers: hv: vmbus: Accept hv_sock offers in isolated guests So that isolated guests can communicate with the host via hv_sock channels. Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220428145107.7878-5-parri.andrea@gmail.com Signed-off-by: Wei Liu commit dbde6d0c7a5a462a1767a07c28eadd2c3dd08fb2 Author: Andrea Parri (Microsoft) Date: Thu Apr 28 16:51:05 2022 +0200 hv_sock: Add validation for untrusted Hyper-V values For additional robustness in the face of Hyper-V errors or malicious behavior, validate all values that originate from packets that Hyper-V has sent to the guest in the host-to-guest ring buffer. Ensure that invalid values cannot cause data being copied out of the bounds of the source buffer in hvs_stream_dequeue(). Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220428145107.7878-4-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 066f3377fb663f839a961cd66e71fc1a36437657 Author: Andrea Parri (Microsoft) Date: Thu Apr 28 16:51:04 2022 +0200 hv_sock: Copy packets sent by Hyper-V out of the ring buffer Pointers to VMbus packets sent by Hyper-V are used by the hv_sock driver within the guest VM. Hyper-V can send packets with erroneous values or modify packet fields after they are processed by the guest. To defend against these scenarios, copy the incoming packet after validating its length and offset fields using hv_pkt_iter_{first,next}(). Use HVS_PKT_LEN(HVS_MTU_SIZE) to initialize the buffer which holds the copies of the incoming packets. In this way, the packet can no longer be modified by the host. Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220428145107.7878-3-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 71abb94ff63063f0cb303ac7860568639c10f42e Author: Andrea Parri (Microsoft) Date: Thu Apr 28 16:51:03 2022 +0200 hv_sock: Check hv_pkt_iter_first_raw()'s return value The function returns NULL if the ring buffer doesn't contain enough readable bytes to constitute a packet descriptor. The ring buffer's write_index is in memory which is shared with the Hyper-V host, an erroneous or malicious host could thus change its value and overturn the result of hvs_stream_has_data(). Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220428145107.7878-2-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 0b8842db35518714942fe23c13f92778d58eb085 Author: Phil Edworthy Date: Wed Mar 30 16:40:22 2022 +0100 arm64: defconfig: Enable Renesas RZ/V2M SoC Enable the Renesas RZ/V2M SoC and the uart it uses. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Marcel Ziswiler Link: https://lore.kernel.org/r/20220330154024.112270-12-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 5c40b3ba9e9de22cc5c6a1edef54e4ec52fcf845 Author: Biju Das Date: Sat Apr 23 14:02:06 2022 +0100 arm64: defconfig: Enable ARCH_R9A07G043 Enable support for the Renesas RZ/G2UL SoC. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220423130206.114032-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a8352a5158ed032fa6c0d433fefc63285fdac8b0 Author: Biju Das Date: Mon Apr 25 18:05:23 2022 +0100 arm64: dts: renesas: r9a07g043: Fillup the WDT{0,2} stub nodes Fillup the WDT{0,2} stub nodes in RZ/G2UL (R9A07G043) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-7-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e42faad1ef822e186c20e60576b198e1ac9866c4 Author: Biju Das Date: Mon Apr 25 18:05:22 2022 +0100 arm64: dts: renesas: r9a07g043: Fillup the OSTM{0,1,2} stub nodes Fillup the OSTM{0,1,2} stub nodes in RZ/G2UL (R9A07G043) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1de1b44833e394e63119fcff37e458a94c244799 Author: Biju Das Date: Mon Apr 25 18:05:21 2022 +0100 arm64: dts: renesas: r9a07g043: Fillup the CANFD stub node Fillup the CANFD stub node in RZ/G2UL (R9A07G043) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f52e14095e56ab6470d959f08e40aa2e45cb85cd Author: Biju Das Date: Mon Apr 25 18:05:20 2022 +0100 arm64: dts: renesas: r9a07g043: Add USB2.0 support Add USB2.0 host and device support by filling usb phy control, phy, device and host stub nodes in RZ/G2UL SoC dtsi. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 559f2b0708c70c49ae3143d481ee10351089e590 Author: Biju Das Date: Mon Apr 25 18:05:19 2022 +0100 arm64: dts: renesas: r9a07g043: Add SSI{1,2,3} nodes and fillup the SSI0 stub node Add SSI{1,2,3} nodes and fillup the SSI0 stub node in RZ/G2UL (R9A07G043) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit bc9e1dbb175706242a7160675b4f52d0380ae4ea Author: Biju Das Date: Mon Apr 25 18:05:18 2022 +0100 arm64: dts: renesas: r9a07g043: Add I2C2 node and fillup the I2C{0,1,3} stub nodes Add I2C2 node and fillup the I2C{0,1,3} stub nodes in RZ/G2UL (R9A07G043) SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220425170530.200921-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ed66b37f916ee23b308c3f50288131d51a2682e9 Author: Herve Codina Date: Fri Apr 22 14:08:47 2022 +0200 ARM: dts: r9a06g032: Add missing '#power-domain-cells' Without '#power-domain-cells' property, power-domains cannot be used. This property is noted required in the device-tree binding. Add '#power-domain-cells' as needed. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220422120850.769480-6-herve.codina@bootlin.com Signed-off-by: Geert Uytterhoeven commit 14f11da778ff642142e9be18814815754c82d6c5 Author: Herve Codina Date: Fri Apr 22 14:08:46 2022 +0200 soc: renesas: rzn1: Select PM and PM_GENERIC_DOMAINS configs PM and PM_GENERIC_DOMAINS configs are required for RZ/N1 SOCs. Without these configs, the clocks used by the PCI bridge are not enabled and so accessing the devices leads to a kernel crash: Unhandled fault: external abort on non-linefetch (0x1008) at 0x90b5f848 Select PM and PM_GENERIC_DOMAINS for ARCH_RZN1 Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220422120850.769480-5-herve.codina@bootlin.com Signed-off-by: Geert Uytterhoeven commit 068eb5a9105bc43a60bdb20484840e5de945fe1d Author: Phil Edworthy Date: Wed Apr 20 21:43:07 2022 +0100 soc: renesas: Add RZ/V2M (R9A09G011) config option Add a configuration option for the RZ/V2M SoC. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220420204307.87343-1-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 358d1cef2a88f590a183a0357b944674097ec0ab Author: Phil Edworthy Date: Wed Mar 30 16:40:12 2022 +0100 dt-bindings: arm: renesas: Document Renesas RZ/V2M SoC and EVK board Details of the SoC can be found here: https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rz-cortex-a-mpus/rzv2m-dual-cortex-a53-lpddr4x32bit-ai-accelerator-isp-4k-video-codec-4k-camera-input-fhd-display-output The RZ/V2M Evaluation Kit (V2MEVK) consists of the RZ/V2M Main Board, RZ/V2M Base Board, and CIS IMX415 Board (CIS). Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330154024.112270-2-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit 7a5ae564198d536a53bb11ed0eb6679ee0fced10 Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:44 2022 +0900 dt-bindings: power: renesas,rcar-sysc: Document r8a779g0 SYSC bindings Document bindings for the R-Car V4H (aka R8A779G0) SYSC block. Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220420084255.375700-5-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 5d33481f54758eb050473af0692a043c084ad581 Author: Biju Das Date: Mon Apr 25 10:52:44 2022 +0100 clk: renesas: r9a07g043: Add WDT clock and reset entries Add WDT{0,2} clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-7-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6c05648b57aba4c677eaf9c6c4c10bf4e713c1c0 Author: Biju Das Date: Mon Apr 25 10:52:43 2022 +0100 clk: renesas: r9a07g043: Add OSTM clock and reset entries Add OSTM{0,1,2} clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1cbda37757ab5581a18214b62e83a914acfcf3e8 Author: Biju Das Date: Mon Apr 25 10:52:42 2022 +0100 clk: renesas: r9a07g043: Add clock and reset entries for CANFD Add clock and reset entries for CANFD in CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 666b5a010ef1e8d08227f5aa6e5b431ce0feca07 Author: Biju Das Date: Mon Apr 25 10:52:41 2022 +0100 clk: renesas: r9a07g043: Add USB clocks/resets Add clock/reset entries for USB PHY control, USB2.0 host and device. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit be5b5fcbc779f04a6ad38e9d4772712fe05b6f15 Author: Biju Das Date: Mon Apr 25 10:52:40 2022 +0100 clk: renesas: r9a07g043: Add SSIF-2 clock and reset entries Add SSIF-2{0,1,2,3} clock and reset entries in CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a9391e019015e96d4ed40587ce0f648edf1c32d3 Author: Biju Das Date: Mon Apr 25 10:52:39 2022 +0100 clk: renesas: r9a07g043: Add I2C clocks/resets Add I2C{0,1,2,3} clock and reset entries. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425095244.156720-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 2a6da4a11f47f2530413fdca0b11dde33608a723 Author: Miquel Raynal Date: Thu Apr 21 11:00:11 2022 +0200 clk: renesas: r9a06g032: Fix the RTC hclock description It needs to be un-gated, but also a reset must be released and an idle flag should also be disabled. The driver already supports all these operations, so update the description of the RTC hclock to fit these requirements. Fixes: 4c3d88526eba2143 ("clk: renesas: Renesas R9A06G032 clock driver") Signed-off-by: Miquel Raynal Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20220421090016.79517-3-miquel.raynal@bootlin.com Signed-off-by: Geert Uytterhoeven commit bc70682a497c4f3c968c552e465d1d9948b1ff4c Author: Christian Brauner Date: Mon Apr 4 12:51:58 2022 +0200 ovl: support idmapped layers Now that overlay is able to take a layers idmapping into account allow overlay mounts to be created on top of idmapped mounts. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 8bc0095df6618371768ed43fb1c569707d2a1fb4 Author: Christian Brauner Date: Mon Apr 4 12:51:57 2022 +0200 ovl: handle idmappings in ovl_xattr_{g,s}et() When retrieving xattrs from the upper or lower layers take the relevant mount's idmapping into account. We rely on the previously introduced ovl_i_path_real() helper to retrieve the relevant path. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 8423b3bd7d970f26a4cbd92f4b9a95b5c246660d Author: Christian Brauner Date: Mon Apr 4 12:51:56 2022 +0200 ovl: handle idmappings in layer open helpers In earlier patches we already passed down the relevant upper or lower path to ovl_open_realfile(). Now let the open helpers actually take the idmapping of the relevant mount into account when checking permissions. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 4b7791b2e95805eaa9568761741d33cf929c930c Author: Christian Brauner Date: Mon Apr 4 12:51:55 2022 +0200 ovl: handle idmappings in ovl_permission() Use the previously introduced ovl_i_path_real() helper to retrieve the relevant upper or lower path and take the mount's idmapping into account for the lower layer permission check. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 2878dffc7db0b5a51e308ccb6b571296b57c82e7 Author: Christian Brauner Date: Mon Apr 4 12:51:54 2022 +0200 ovl: use ovl_copy_{real,upper}attr() wrappers When copying inode attributes from the upper or lower layer to ovl inodes we need to take the upper or lower layer's mount's idmapping into account. In a lot of places we call ovl_copyattr() only on upper inodes and in some we call it on either upper or lower inodes. Split this into two separate helpers. The first one should only be called on upper inodes and is thus called ovl_copy_upperattr(). The second one can be called on upper or lower inodes. We add ovl_copy_realattr() for this task. The new helper makes use of the previously added ovl_i_path_real() helper. This is needed to support idmapped base layers with overlay. When overlay copies the inode information from an upper or lower layer to the relevant overlay inode it will apply the idmapping of the upper or lower layer when doing so. The ovl inode ownership will thus always correctly reflect the ownership of the idmapped upper or lower layer. All idmapping helpers are nops when no idmapped base layers are used. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit ffa5723c6d259b3191f851a50a98d0352b345b39 Author: Amir Goldstein Date: Mon Apr 4 12:51:53 2022 +0200 ovl: store lower path in ovl_inode Create some ovl_i_* helpers to get real path from ovl inode. Instead of just stashing struct inode for the lower layer we stash struct path for the lower layer. The helpers allow to retrieve a struct path for the relevant upper or lower layer. This will be used when retrieving information based on struct inode when copying up inode attributes from upper or lower inodes to ovl inodes and when checking permissions in ovl_permission() in following patches. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit ba9ea771ec8a9da4e3aa5cb8c8549fc3b15b2641 Author: Christian Brauner Date: Mon Apr 4 12:51:52 2022 +0200 ovl: handle idmappings for layer lookup Make the two places where lookup helpers can be called either on lower or upper layers take the mount's idmapping into account. To this end we pass down the mount in struct ovl_lookup_data. It can later also be used to construct struct path for various other helpers. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 50db8d0273551f8792b4d9367d43a0093fb4512d Author: Christian Brauner Date: Mon Apr 4 12:51:51 2022 +0200 ovl: handle idmappings for layer fileattrs Take the upper mount's idmapping into account when setting fileattrs on the upper layer. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit dad7017a840d8d198074338224cd418d37b8f79d Author: Christian Brauner Date: Mon Apr 4 12:51:50 2022 +0200 ovl: use ovl_path_getxattr() wrapper Add a helper that allows to retrieve ovl xattrs from either lower or upper layers. To stop passing mnt and dentry separately everywhere use struct path which more accurately reflects the tight coupling between mount and dentry in this helper. Swich over all places to pass a path argument that can operate on either upper or lower layers. This is needed to support idmapped base layers with overlayfs. Some helpers are always called with an upper dentry, which is now utilized by these helpers to create the path. Make this usage explicit by renaming the argument to "upperdentry" and by renaming the function as well in some cases. Also add a check in ovl_do_getxattr() to catch misuse of these functions. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 22f289ce1f8b10556617157819a48cf13370f06f Author: Christian Brauner Date: Mon Apr 4 12:51:49 2022 +0200 ovl: use ovl_lookup_upper() wrapper Introduce ovl_lookup_upper() as a simple wrapper around lookup_one(). Make it clear in the helper's name that this only operates on the upper layer. The wrapper will take upper layer's idmapping into account when checking permission in lookup_one(). Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit a15506eac96fdbb760bae4a319b088b5869725b1 Author: Christian Brauner Date: Mon Apr 4 12:51:48 2022 +0200 ovl: use ovl_do_notify_change() wrapper Introduce ovl_do_notify_change() as a simple wrapper around notify_change() to support idmapped layers. The helper mirrors other ovl_do_*() helpers that operate on the upper layers. When changing ownership of an upper object the intended ownership needs to be mapped according to the upper layer's idmapping. This mapping is the inverse to the mapping applied when copying inode information from an upper layer to the corresponding overlay inode. So e.g., when an upper mount maps files that are stored on-disk as owned by id 1001 to 1000 this means that calling stat on this object from an idmapped mount will report the file as being owned by id 1000. Consequently in order to change ownership of an object in this filesystem so it appears as being owned by id 1000 in the upper idmapped layer it needs to store id 1001 on disk. The mnt mapping helpers take care of this. All idmapping helpers are nops when no idmapped base layers are used. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 1248ea4b91bcdafefdb025087e67d58382cfc9eb Author: Amir Goldstein Date: Mon Apr 4 12:51:47 2022 +0200 ovl: pass layer mnt to ovl_open_realfile() Ensure that ovl_open_realfile() takes the mount's idmapping into account. We add a new helper ovl_path_realdata() that can be used to easily retrieve the relevant path which we can pass down. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 5272eaf3a5682750f6f26ec542b206f0821fb3cb Author: Christian Brauner Date: Mon Apr 4 12:51:46 2022 +0200 ovl: pass ofs to setattr operations Pass down struct ovl_fs to setattr operations so we can ultimately retrieve the relevant upper mount and take the mount's idmapping into account when creating new filesystem objects. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit c67cf6544753e3b04e48820bd8d4be84cd10fc02 Author: Christian Brauner Date: Mon Apr 4 12:51:45 2022 +0200 ovl: handle idmappings in creation operations When creating objects in the upper layer we need to pass down the upper idmapping into the respective vfs helpers in order to support idmapped base layers. The vfs helpers will take care of the rest. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit b65c20acef23cea2989c9f23414930149d38962f Author: Christian Brauner Date: Mon Apr 4 12:51:44 2022 +0200 ovl: add ovl_upper_mnt_userns() wrapper Add a tiny wrapper to retrieve the upper mount's idmapping. Have it return the initial idmapping until we have prepared and converted all places to take the relevant idmapping into account. Then we can switch on idmapped layer support by having ovl_upper_mnt_userns() return the upper mount's idmapping. Suggested-by: Miklos Szeredi Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 576bb263450bbba6601a9f528d0cf601d97a13e6 Author: Christian Brauner Date: Mon Apr 4 12:51:43 2022 +0200 ovl: pass ofs to creation operations Pass down struct ovl_fs to all creation helpers so we can ultimately retrieve the relevant upper mount and take the mount's idmapping into account when creating new filesystem objects. This is needed to support idmapped base layers with overlay. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit c914c0e27eb0843b7cf3bec71d6f34d53a3a671e Author: Amir Goldstein Date: Mon Apr 4 12:51:42 2022 +0200 ovl: use wrappers to all vfs_*xattr() calls Use helpers ovl_*xattr() to access user/trusted.overlay.* xattrs and use helpers ovl_do_*xattr() to access generic xattrs. This is a preparatory patch for using idmapped base layers with overlay. Note that a few of those places called vfs_*xattr() calls directly to reduce the amount of debug output. But as Miklos pointed out since overlayfs has been stable for quite some time the debug output isn't all that relevant anymore and the additional debug in all locations was actually quite helpful when developing this patch series. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Amir Goldstein Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 3a761d72fa62eec8913e45d29375344f61706541 Author: Christian Brauner Date: Mon Apr 4 12:51:41 2022 +0200 exportfs: support idmapped mounts Make the two locations where exportfs helpers check permission to lookup a given inode idmapped mount aware by switching it to the lookup_one() helper. This is a bugfix for the open_by_handle_at() system call which doesn't take idmapped mounts into account currently. It's not tied to a specific commit so we'll just Cc stable. In addition this is required to support idmapped base layers in overlay. The overlay filesystem uses exportfs to encode and decode file handles for its index=on mount option and when nfs_export=on. Cc: Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 00675017e0aeba5305665c52ded4ddce6a4c0231 Author: Christian Brauner Date: Mon Apr 4 12:51:40 2022 +0200 fs: add two trivial lookup helpers Similar to the addition of lookup_one() add a version of lookup_one_unlocked() and lookup_one_positive_unlocked() that take idmapped mounts into account. This is required to port overlay to support idmapped base layers. Cc: Tested-by: Giuseppe Scrivano Reviewed-by: Amir Goldstein Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Miklos Szeredi commit 2a8d78d566faa3d92214f161fdd7134957407871 Author: Alex Deucher Date: Fri Apr 22 15:26:56 2022 -0400 Documentation: x86: rework IOMMU documentation Add preliminary documentation for AMD IOMMU and combine with the existing Intel IOMMU documentation and clean up and modernize some of the existing documentation to align with the current state of the kernel. Signed-off-by: Alex Deucher Acked-by: Joerg Roedel Link: https://lore.kernel.org/r/20220422192656.624920-1-alexander.deucher@amd.com Signed-off-by: Jonathan Corbet commit 9ae83ec8b81dcd0a1c5d07a44e3b8d06311546d9 Author: Shubhrajyoti Datta Date: Thu Apr 28 10:10:51 2022 +0530 EDAC/synopsys: Add a SPDX identifier Replace the copyright boilerplate with a SPDX identifier. [ bp: Rewrite commit message. ] Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220428044051.2842687-1-shubhrajyoti.datta@xilinx.com commit 5b1553bf18de019388c5e9de03d9330f92507695 Author: Rob Herring Date: Fri Apr 22 14:21:03 2022 -0500 dt-bindings: iommu: Drop client node in examples There's no need to show consumer side in provider examples. The ones used here are undocumented or undocumented in schemas which results in warnings. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220422192104.2591462-1-robh@kernel.org Signed-off-by: Joerg Roedel commit a5f1bd1afacd7b1e088f93f66af5453df0d8be9a Author: Lu Baolu Date: Mon Apr 18 08:50:00 2022 +0800 iommu: Remove iommu group changes notifier The iommu group changes notifer is not referenced in the tree. Remove it to avoid dead code. Suggested-by: Christoph Hellwig Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220418005000.897664-12-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 3b86f317c9c71c9fe17409db5743b6a27114f248 Author: Lu Baolu Date: Mon Apr 18 08:49:59 2022 +0800 vfio: Remove iommu group notifier The iommu core and driver core have been enhanced to avoid unsafe driver binding to a live group after iommu_group_set_dma_owner(PRIVATE_USER) has been called. There's no need to register iommu group notifier. This removes the iommu group notifer which contains BUG_ON() and WARN(). Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Alex Williamson Link: https://lore.kernel.org/r/20220418005000.897664-11-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 93219ea94388b5195d1eeadb0bda6ed1471fba56 Author: Jason Gunthorpe Date: Mon Apr 18 08:49:58 2022 +0800 vfio: Delete the unbound_list commit 60720a0fc646 ("vfio: Add device tracking during unbind") added the unbound list to plug a problem with KVM where KVM_DEV_VFIO_GROUP_DEL relied on vfio_group_get_external_user() succeeding to return the vfio_group from a group file descriptor. The unbound list allowed vfio_group_get_external_user() to continue to succeed in edge cases. However commit 5d6dee80a1e9 ("vfio: New external user group/file match") deleted the call to vfio_group_get_external_user() during KVM_DEV_VFIO_GROUP_DEL. Instead vfio_external_group_match_file() is used to directly match the file descriptor to the group pointer. This in turn avoids the call down to vfio_dev_viable() during KVM_DEV_VFIO_GROUP_DEL and also avoids the trouble the first commit was trying to fix. There are no other users of vfio_dev_viable() that care about the time after vfio_unregister_group_dev() returns, so simply delete the unbound_list entirely. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jason Gunthorpe Signed-off-by: Lu Baolu Acked-by: Alex Williamson Link: https://lore.kernel.org/r/20220418005000.897664-10-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 31076af0cb001f698138c8158c798ec9f4a8bbae Author: Lu Baolu Date: Mon Apr 18 08:49:57 2022 +0800 vfio: Remove use of vfio_group_viable() As DMA ownership is claimed for the iommu group when a VFIO group is added to a VFIO container, the VFIO group viability is guaranteed as long as group->container_users > 0. Remove those unnecessary group viability checks which are only hit when group->container_users is not zero. The only remaining reference is in GROUP_GET_STATUS, which could be called at any time when group fd is valid. Here we just replace the vfio_group_viable() by directly calling IOMMU core to get viability status. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Alex Williamson Link: https://lore.kernel.org/r/20220418005000.897664-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 70693f470848f05fae04144675e6e41b105d45fe Author: Lu Baolu Date: Mon Apr 18 08:49:56 2022 +0800 vfio: Set DMA ownership for VFIO devices Claim group dma ownership when an IOMMU group is set to a container, and release the dma ownership once the iommu group is unset from the container. This change disallows some unsafe bridge drivers to bind to non-ACS bridges while devices under them are assigned to user space. This is an intentional enhancement and possibly breaks some existing configurations. The recommendation to such an affected user would be that the previously allowed host bridge driver was unsafe for this use case and to continue to enable assignment of devices within that group, the driver should be unbound from the bridge device or replaced with the pci-stub driver. For any bridge driver, we consider it unsafe if it satisfies any of the following conditions: 1) The bridge driver uses DMA. Calling pci_set_master() or calling any kernel DMA API (dma_map_*() and etc.) is an indicate that the driver is doing DMA. 2) If the bridge driver uses MMIO, it should be tolerant to hostile userspace also touching the same MMIO registers via P2P DMA attacks. If the bridge driver turns out to be a safe one, it could be used as before by setting the driver's .driver_managed_dma field, just like what we have done in the pcieport driver. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Alex Williamson Link: https://lore.kernel.org/r/20220418005000.897664-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit c7d469849747ce380785536173d08b30a820a83c Author: Lu Baolu Date: Mon Apr 18 08:49:55 2022 +0800 PCI: portdrv: Set driver_managed_dma If a switch lacks ACS P2P Request Redirect, a device below the switch can bypass the IOMMU and DMA directly to other devices below the switch, so all the downstream devices must be in the same IOMMU group as the switch itself. The existing VFIO framework allows the portdrv driver to be bound to the bridge while its downstream devices are assigned to user space. The pci_dma_configure() marks the IOMMU group as containing only devices with kernel drivers that manage DMA. Avoid this default behavior for the portdrv driver in order for compatibility with the current VFIO usage. We achieve this by setting ".driver_managed_dma = true" in pci_driver structure. It is safe because the portdrv driver meets below criteria: - This driver doesn't use DMA, as you can't find any related calls like pci_set_master() or any kernel DMA API (dma_map_*() and etc.). - It doesn't use MMIO as you can't find ioremap() or similar calls. It's tolerant to userspace possibly also touching the same MMIO registers via P2P DMA access. Suggested-by: Jason Gunthorpe Suggested-by: Kevin Tian Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20220418005000.897664-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 18c7a349d072a222ff80598373035820c194747b Author: Lu Baolu Date: Mon Apr 18 08:49:54 2022 +0800 PCI: pci_stub: Set driver_managed_dma The current VFIO implementation allows pci-stub driver to be bound to a PCI device with other devices in the same IOMMU group being assigned to userspace. The pci-stub driver has no dependencies on DMA or the IOVA mapping of the device, but it does prevent the user from having direct access to the device, which is useful in some circumstances. The pci_dma_configure() marks the iommu_group as containing only devices with kernel drivers that manage DMA. For compatibility with the VFIO usage, avoid this default behavior for the pci_stub. This allows the pci_stub still able to be used by the admin to block driver binding after applying the DMA ownership to VFIO. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20220418005000.897664-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 512881eacfa72c2136b27b9934b7b27504a9efc2 Author: Lu Baolu Date: Mon Apr 18 08:49:53 2022 +0800 bus: platform,amba,fsl-mc,PCI: Add device DMA ownership management The devices on platform/amba/fsl-mc/PCI buses could be bound to drivers with the device DMA managed by kernel drivers or user-space applications. Unfortunately, multiple devices may be placed in the same IOMMU group because they cannot be isolated from each other. The DMA on these devices must either be entirely under kernel control or userspace control, never a mixture. Otherwise the driver integrity is not guaranteed because they could access each other through the peer-to-peer accesses which by-pass the IOMMU protection. This checks and sets the default DMA mode during driver binding, and cleanups during driver unbinding. In the default mode, the device DMA is managed by the device driver which handles DMA operations through the kernel DMA APIs (see Documentation/core-api/dma-api.rst). For cases where the devices are assigned for userspace control through the userspace driver framework(i.e. VFIO), the drivers(for example, vfio_pci/ vfio_platfrom etc.) may set a new flag (driver_managed_dma) to skip this default setting in the assumption that the drivers know what they are doing with the device DMA. Calling iommu_device_use_default_domain() before {of,acpi}_dma_configure is currently a problem. As things stand, the IOMMU driver ignored the initial iommu_probe_device() call when the device was added, since at that point it had no fwspec yet. In this situation, {of,acpi}_iommu_configure() are retriggering iommu_probe_device() after the IOMMU driver has seen the firmware data via .of_xlate to learn that it actually responsible for the given device. As the result, before that gets fixed, iommu_use_default_domain() goes at the end, and calls arch_teardown_dma_ops() if it fails. Cc: Greg Kroah-Hartman Cc: Bjorn Helgaas Cc: Stuart Yoder Cc: Laurentiu Tudor Signed-off-by: Lu Baolu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Reviewed-by: Robin Murphy Tested-by: Eric Auger Link: https://lore.kernel.org/r/20220418005000.897664-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 4a6d9dd564d0e7339fc15ecc5ce66db4ad842be2 Author: Lu Baolu Date: Mon Apr 18 08:49:52 2022 +0800 amba: Stop sharing platform_dma_configure() Stop sharing platform_dma_configure() helper as they are about to have their own bus dma_configure callbacks. Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220418005000.897664-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 25f3bcfc54bcf7b0e45d140ec8bfbbf10ba11869 Author: Lu Baolu Date: Mon Apr 18 08:49:51 2022 +0800 driver core: Add dma_cleanup callback in bus_type The bus_type structure defines dma_configure() callback for bus drivers to configure DMA on the devices. This adds the paired dma_cleanup() callback and calls it during driver unbinding so that bus drivers can do some cleanup work. One use case for this paired DMA callbacks is for the bus driver to check for DMA ownership conflicts during driver binding, where multiple devices belonging to a same IOMMU group (the minimum granularity of isolation and protection) may be assigned to kernel drivers or user space respectively. Without this change, for example, the vfio driver has to listen to a bus BOUND_DRIVER event and then BUG_ON() in case of dma ownership conflict. This leads to bad user experience since careless driver binding operation may crash the system if the admin overlooks the group restriction. Aside from bad design, this leads to a security problem as a root user, even with lockdown=integrity, can force the kernel to BUG. With this change, the bus driver could check and set the DMA ownership in driver binding process and fail on ownership conflicts. The DMA ownership should be released during driver unbinding. Signed-off-by: Lu Baolu Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220418005000.897664-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 1ea2a07a532b0e22aabe7e8483f935c672b9e7ed Author: Lu Baolu Date: Mon Apr 18 08:49:50 2022 +0800 iommu: Add DMA ownership management interfaces Multiple devices may be placed in the same IOMMU group because they cannot be isolated from each other. These devices must either be entirely under kernel control or userspace control, never a mixture. This adds dma ownership management in iommu core and exposes several interfaces for the device drivers and the device userspace assignment framework (i.e. VFIO), so that any conflict between user and kernel controlled dma could be detected at the beginning. The device driver oriented interfaces are, int iommu_device_use_default_domain(struct device *dev); void iommu_device_unuse_default_domain(struct device *dev); By calling iommu_device_use_default_domain(), the device driver tells the iommu layer that the device dma is handled through the kernel DMA APIs. The iommu layer will manage the IOVA and use the default domain for DMA address translation. The device user-space assignment framework oriented interfaces are, int iommu_group_claim_dma_owner(struct iommu_group *group, void *owner); void iommu_group_release_dma_owner(struct iommu_group *group); bool iommu_group_dma_owner_claimed(struct iommu_group *group); The device userspace assignment must be disallowed if the DMA owner claiming interface returns failure. Signed-off-by: Jason Gunthorpe Signed-off-by: Kevin Tian Signed-off-by: Lu Baolu Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220418005000.897664-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 36c84190dca0b37db7a50238b2b379f2700634da Author: Ian Rogers Date: Thu Apr 28 00:57:30 2022 -0700 perf vendor events intel: Update WSM-EX events to v3 Events are generated for Westmere EX v3 with events from: https://download.01.org/perfmon/WSM-EX/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a0cb4489782f04d6e93b1d1d0bccfebc9a33fa8a Author: Ian Rogers Date: Thu Apr 28 00:57:29 2022 -0700 perf vendor events intel: Update WSM-EP-SP events to v3 Events are generated for Westmere EP-SP v3 with events from: https://download.01.org/perfmon/WSM-EP-SP/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e14fd2ee6de46251aadd273703ea88ab8357b9e7 Author: Ian Rogers Date: Thu Apr 28 00:57:28 2022 -0700 perf vendor events intel: Update SKX events to v1.27 Events are generated for Skylake Server v1.27 with events from: https://download.01.org/perfmon/SKX/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions, adds INST_DECODED.DECODERS and corrects a counter mask in UOPS_RETIRED.TOTAL_CYCLES. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 02c758d2aa534072a81d8781a6d7e905fdd40b44 Author: Ian Rogers Date: Thu Apr 28 00:57:27 2022 -0700 perf vendor events intel: Update SKL events to v53 Events are generated for Skylake v53 with events from: https://download.01.org/perfmon/SKL/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions, adds INST_DECODED.DECODERS and corrects a counter mask in UOPS_RETIRED.TOTAL_CYCLES. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8ce185d496c15110208b84a786c987ef52e603f0 Author: Ian Rogers Date: Thu Apr 28 00:57:26 2022 -0700 perf vendor events intel: Update IVT events to v21 Events are generated for Ivytown v21 with events from: https://download.01.org/perfmon/IVT/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change fixes a spelling mistake in a description. Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a5043ed9632227b506756d7e71928657040866f6 Author: Ian Rogers Date: Thu Apr 28 00:57:25 2022 -0700 perf vendor events intel: Update ICL events to v1.13 Events are generated for Icelake v1.13 with events from: https://download.01.org/perfmon/ICL/ Using the scripts at: https://github.com/intel/event-converter-for-linux-perf/ This change updates descriptions and adds INST_DECODED.DECODERS. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428075730.797727-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 44900ce9752ba6317885397d99507774369f92a5 Author: Thomas Richter Date: Thu Apr 28 14:28:21 2022 +0200 perf test: Fix test case 81 ("perf record tests") on s390x perf test -F 81 ("perf record tests") -v fails on s390x on the linux-next branch. The test case is x86 specific can not be executed on s390x. The test case depends on x86 register names such as: ... | egrep -q 'available registers: AX BX CX DX ....' Skip this test case on s390x. Output before: # perf test -F 81 81: perf record tests : FAILED! # Output after: # perf test -F 81 81: perf record tests : Skip # Fixes: 24f378e66021f559 ("perf test: Add basic perf record tests") 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/20220428122821.3652015-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 5297ecfe2465951682f888b5f4c2efebe23d011a Author: Sherry Sun Date: Thu Apr 28 10:32:09 2022 +0800 EDAC/synopsys: Add driver support for i.MX platforms i.MX8MP use Synopsys v3.70a DDR controller IP so add support for it with the Synopsys driver. Signed-off-by: Sherry Sun Signed-off-by: Borislav Petkov Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220428023209.18087-1-sherry.sun@nxp.com commit d1cf8bbfed1edc5108220342ab39e4544d55fbc3 Author: Zhang Rui Date: Fri Apr 15 17:39:51 2022 +0800 intel_idle: Add AlderLake support Similar to SPR, the C1 and C1E states on ADL are mutually exclusive. Only one of them can be enabled at a time. But contrast to SPR, which usually has a strong latency requirement as a Xeon processor, C1E is preferred on ADL for better energy efficiency. Add custom C-state tables for ADL with both C1 and C1E, and 1. Enable the "C1E promotion" bit in MSR_IA32_POWER_CTL and mark C1 with the CPUIDLE_FLAG_UNUSABLE flag, so C1 is not available by default. 2. Add support for the "preferred_cstates" module parameter, so that users can choose to use C1 instead of C1E by booting with "intel_idle.preferred_cstates=2". Separate custom C-state tables are introduced for the ADL mobile and desktop processors, because of the exit latency differences between these two variants, especially with respect to PC10. Signed-off-by: Zhang Rui [ rjw: Changelog edits, code rearrangement ] Signed-off-by: Rafael J. Wysocki commit ce216cfa84a4e1c23b105e652c550bdeaac9e922 Author: Hans de Goede Date: Wed Apr 27 15:49:18 2022 +0200 ASoC: Intel: bytcr_rt5640: Add quirk for the HP Pro Tablet 408 Add a quirk for the HP Pro Tablet 408, this BYTCR tablet has no CHAN package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which is the default for BYTCR devices. It also uses DMIC1 for the internal mic rather then the default IN3 and it uses JD2 rather then the default JD1 for jack-detect. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=211485 Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220427134918.527381-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit dd508e324cdde1c06ace08a8143fa50333a90703 Author: Nicolas Frattaroli Date: Wed Apr 27 19:23:11 2022 +0200 ASoC: rk3328: fix disabling mclk on pclk probe failure If preparing/enabling the pclk fails, the probe function should unprepare and disable the previously prepared and enabled mclk, which it doesn't do. This commit rectifies this. Fixes: c32759035ad2 ("ASoC: rockchip: support ACODEC for rk3328") Signed-off-by: Nicolas Frattaroli Reviewed-by: Katsuhiro Suzuki Link: https://lore.kernel.org/r/20220427172310.138638-1-frattaroli.nicolas@gmail.com Signed-off-by: Mark Brown commit 7e0bdbae446ff8a752484f6bcbcd7157e7484158 Author: Nicola Lunghi Date: Wed Apr 27 22:29:16 2022 +0100 ASoC: wm8960: Add ACPI support HID made of either Wolfson/CirrusLogic PCI ID + 8960 identifier This helps enumerate the Waveshare WM8960 WM8960 Hi-Fi Sound Card HAT on the Up2 platform. The scripts at https://github.com/thesofproject/acpi-scripts can be used to add the ACPI initrd overlay. This commit is similar to the commit: 960cdd50ca9f ("ASoC: wm8804: Add ACPI support") Signed-off-by: Nicola Lunghi Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220427212916.40145-1-nick83ola@gmail.com Signed-off-by: Mark Brown commit bb5bdc5ab7f133ba6fd32657d2ac90039c561e48 Author: Xiaoke Wang Date: Thu Apr 28 16:52:39 2022 +0800 iommu/msm: Add a check for the return of kzalloc() kzalloc() is a memory allocation function which can return NULL when some internal memory errors happen. So it is better to check it to prevent potential wrong memory access. Besides, to propagate the error to the caller, the type of insert_iommu_master() is changed to `int`. Several instructions related to it are also updated. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_EDB94B1C7E14B4E1974A66FF4D2029CC6D08@qq.com Signed-off-by: Joerg Roedel commit 380422ad344d461901dca85970ecc976e182f0c9 Author: Krzysztof Kozlowski Date: Wed Apr 27 17:58:36 2022 +0200 dt-bindings: mfd: samsung,exynos5433-lpass: Fix 'dma-channels/requests' properties pl330 DMA controller bindings documented 'dma-channels' and 'dma-requests' properties (without leading hash sign), so fix the DTS to match the bindings. Fixes: e18183cefc8b ("mfd: Add DT bindings documentation for Samsung Exynos LPASS") Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Alim Akhtar Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220427155840.596535-7-krzysztof.kozlowski@linaro.org commit 8009120e0354a67068e920eb10dce532391361d0 Author: Cristian Marussi Date: Wed Mar 30 16:05:32 2022 +0100 firmware: arm_scmi: Fix list protocols enumeration in the base protocol While enumerating protocols implemented by the SCMI platform using BASE_DISCOVER_LIST_PROTOCOLS, the number of returned protocols is currently validated in an improper way since the check employs a sum between unsigned integers that could overflow and cause the check itself to be silently bypassed if the returned value 'loop_num_ret' is big enough. Fix the validation avoiding the addition. Link: https://lore.kernel.org/r/20220330150551.2573938-4-cristian.marussi@arm.com Fixes: b6f20ff8bd94 ("firmware: arm_scmi: add common infrastructure and support for base protocol") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 4de1b36fae866c02f264f6bcda7a9a9e00ec5306 Author: Cristian Marussi Date: Wed Mar 30 16:05:31 2022 +0100 firmware: arm_scmi: Make protocols initialisation fail on basic errors Bail out of protocol initialisation routine early when basic information about protocol version and attributes could not be retrieved. Failing to act this way can lead to a successfully initialized SCMI protocol which is in fact not fully functional. Link: https://lore.kernel.org/r/20220330150551.2573938-3-cristian.marussi@arm.com Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 6086987bdeb5910778e6488b1cd6801701b4ef91 Author: Colin Ian King Date: Mon Apr 18 15:44:16 2022 +0100 PCI: versatile: Remove redundant variable retval Variable retval is being assigned a value that is never read, the variable is redundant and can be removed. Cleans up clang scan build warning: drivers/pci/controller/pci-versatile.c:37:10: warning: Although the value stored to 'retval' is used in the enclosing expression, the value is never actually read from 'retval' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220418144416.86121-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Lorenzo Pieralisi commit f3412b3879b4f7c4313b186b03940d4791345534 Author: Eric Dumazet Date: Wed Apr 27 13:41:47 2022 -0700 net: make sure net_rx_action() calls skb_defer_free_flush() I missed a stray return; in net_rx_action(), which very well is taken whenever trigger_rx_softirq() has been called on a cpu that is no longer receiving network packets, or receiving too few of them. Fixes: 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists") Signed-off-by: Eric Dumazet Reported-by: Ido Schimmel Tested-by: Ido Schimmel Link: https://lore.kernel.org/r/20220427204147.1310161-1-eric.dumazet@gmail.com Signed-off-by: Paolo Abeni commit ee5354345242ccf98dba164cc6b6e3e497a5f48f Author: Sven Peter Date: Tue Apr 12 18:12:11 2022 +0200 MAINTAINERS: Merge DART into ARM/APPLE MACHINE It's the same people anyway. Signed-off-by: Sven Peter Acked-by: Hector Martin Acked-by: Alyssa Rosenzweig Link: https://lore.kernel.org/r/20220412161211.23162-1-sven@svenpeter.dev Signed-off-by: Joerg Roedel commit 2147c438fde135d6c145a96e373d9348e7076f7f Author: Josh Poimboeuf Date: Mon Apr 25 16:40:02 2022 -0700 x86/speculation: Add missing prototype for unpriv_ebpf_notify() Fix the following warnings seen with "make W=1": kernel/sysctl.c:183:13: warning: no previous prototype for ‘unpriv_ebpf_notify’ [-Wmissing-prototypes] 183 | void __weak unpriv_ebpf_notify(int new_state) | ^~~~~~~~~~~~~~~~~~ arch/x86/kernel/cpu/bugs.c:659:6: warning: no previous prototype for ‘unpriv_ebpf_notify’ [-Wmissing-prototypes] 659 | void unpriv_ebpf_notify(int new_state) | ^~~~~~~~~~~~~~~~~~ Fixes: 44a3918c8245 ("x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting") Reported-by: kernel test robot Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/5689d065f739602ececaee1e05e68b8644009608.1650930000.git.jpoimboe@redhat.com commit f1ca70717bcb4525e29da422f3d280acbddb36fe Author: Mario Limonciello Date: Mon Apr 25 13:42:05 2022 +0100 iommu/amd: Indicate whether DMA remap support is enabled Bit 1 of the IVFS IVInfo field indicates that IOMMU has been used for pre-boot DMA protection. Export this capability to allow other places in the kernel to be able to check for it on AMD systems. Link: https://www.amd.com/system/files/TechDocs/48882_IOMMU.pdf Reviewed-by: Christoph Hellwig Signed-off-by: Mario Limonciello Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/ce7627fa1c596878ca6515dd9d4381a45b6ee38c.1650878781.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 86eaf4a5b4312bea8676fb79399d9e08b53d8e71 Author: Robin Murphy Date: Mon Apr 25 13:42:04 2022 +0100 thunderbolt: Make iommu_dma_protection more accurate Between me trying to get rid of iommu_present() and Mario wanting to support the AMD equivalent of DMAR_PLATFORM_OPT_IN, scrutiny has shown that the iommu_dma_protection attribute is being far too optimistic. Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device(s) we care about. Furthermore, all that DMAR_PLATFORM_OPT_IN really does is tell us that memory was protected before the kernel was loaded, and prevent the user from disabling the intel-iommu driver entirely. While that lets us assume kernel integrity, what matters for actual runtime DMA protection is whether we trust individual devices, based on the "external facing" property that we expect firmware to describe for Thunderbolt ports. It's proven challenging to determine the appropriate ports accurately given the variety of possible topologies, so while still not getting a perfect answer, by putting enough faith in firmware we can at least get a good bit closer. If we can see that any device near a Thunderbolt NHI has all the requisites for Kernel DMA Protection, chances are that it *is* a relevant port, but moreover that implies that firmware is playing the game overall, so we'll use that to assume that all Thunderbolt ports should be correctly marked and thus will end up fully protected. CC: Mario Limonciello Reviewed-by: Christoph Hellwig Acked-by: Mika Westerberg Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b153f208bc9eafab5105bad0358b77366509d2d4.1650878781.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit d0be55fbeb6ac694d15af5d1aad19cdec8cd64e5 Author: Robin Murphy Date: Mon Apr 25 13:42:03 2022 +0100 iommu: Add capability for pre-boot DMA protection VT-d's dmar_platform_optin() actually represents a combination of properties fairly well standardised by Microsoft as "Pre-boot DMA Protection" and "Kernel DMA Protection"[1]. As such, we can provide interested consumers with an abstracted capability rather than driver-specific interfaces that won't scale. We name it for the former aspect since that's what external callers are most likely to be interested in; the latter is for the IOMMU layer to handle itself. [1] https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-kernel-dma-protection Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Lu Baolu Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d6218dff2702472da80db6aec2c9589010684551.1650878781.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ed36d04e8f8d7b00db451b0fa56a54e8e02ec43e Author: Robin Murphy Date: Mon Apr 25 13:42:02 2022 +0100 iommu: Introduce device_iommu_capable() iommu_capable() only really works for systems where all IOMMU instances are completely homogeneous, and all devices are IOMMU-mapped. Implement the new variant which will be able to give a more accurate answer for whichever device the caller is actually interested in, and even more so once all the external users have been converted and we can reliably pass the device pointer through the internal driver interface too. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/8407eb9586677995b7a9fd70d0fd82d85929a9bb.1650878781.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit f316ba0a8814f4c91e80a435da3421baf0ddd24c Author: Mario Limonciello Date: Mon Apr 4 15:47:23 2022 -0500 dma-iommu: Check that swiotlb is active before trying to use it If the IOMMU is in use and an untrusted device is connected to an external facing port but the address requested isn't page aligned will cause the kernel to attempt to use bounce buffers. If for some reason the bounce buffers have not been allocated this is a problem that should be made apparent to the user. Signed-off-by: Mario Limonciello Reviewed-by: Robin Murphy Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220404204723.9767-3-mario.limonciello@amd.com Signed-off-by: Joerg Roedel commit 121660bba631104154b7c15e88f208c48c8c3297 Author: Mario Limonciello Date: Mon Apr 4 15:47:22 2022 -0500 iommu/amd: Enable swiotlb in all cases Previously the AMD IOMMU would only enable SWIOTLB in certain circumstances: * IOMMU in passthrough mode * SME enabled This logic however doesn't work when an untrusted device is plugged in that doesn't do page aligned DMA transactions. The expectation is that a bounce buffer is used for those transactions. This fails like this: swiotlb buffer is full (sz: 4096 bytes), total 0 (slots), used 0 (slots) That happens because the bounce buffers have been allocated, followed by freed during startup but the bounce buffering code expects that all IOMMUs have left it enabled. Remove the criteria to set up bounce buffers on AMD systems to ensure they're always available for supporting untrusted devices. Fixes: 82612d66d51d ("iommu: Allow the dma-iommu api to use bounce buffers") Suggested-by: Christoph Hellwig Signed-off-by: Mario Limonciello Reviewed-by: Robin Murphy Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220404204723.9767-2-mario.limonciello@amd.com Signed-off-by: Joerg Roedel commit cae8d1f5e34e5b2604a52d705218a6b2d288365f Author: Christophe Leroy Date: Sat Apr 2 12:08:38 2022 +0200 iommu/fsl_pamu: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/06862cca930068e8fa4fdd0b20d74872d3b929d6.1648833431.git.christophe.leroy@csgroup.eu Signed-off-by: Joerg Roedel commit 43823c5c56f247cfc028bf90299f675dd29abf88 Author: Tokunori Ikegami Date: Thu Mar 24 02:04:58 2022 +0900 mtd: cfi_cmdset_0002: Rename chip_ready variables Signed-off-by: Tokunori Ikegami Acked-by: Vignesh Raghavendra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220323170458.5608-5-ikegami.t@gmail.com commit cccea9414dae8058ce9c48b7c7ccff040501f419 Author: Tokunori Ikegami Date: Thu Mar 24 02:04:57 2022 +0900 mtd: cfi_cmdset_0002: Add S29GL064N ID definition It is for the model number 01, 02, V1 and V2. Signed-off-by: Tokunori Ikegami Acked-by: Vignesh Raghavendra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220323170458.5608-4-ikegami.t@gmail.com commit 0a8e98305f63deaf0a799d5cf5532cc83af035d1 Author: Tokunori Ikegami Date: Thu Mar 24 02:04:56 2022 +0900 mtd: cfi_cmdset_0002: Use chip_ready() for write on S29GL064N Since commit dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value") buffered writes fail on S29GL064N. This is because, on S29GL064N, reads return 0xFF at the end of DQ polling for write completion, where as, chip_good() check expects actual data written to the last location to be returned post DQ polling completion. Fix is to revert to using chip_good() for S29GL064N which only checks for DQ lines to settle down to determine write completion. Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/ Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value") Cc: stable@vger.kernel.org Signed-off-by: Tokunori Ikegami Acked-by: Vignesh Raghavendra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220323170458.5608-3-ikegami.t@gmail.com commit 083084df578a8bdb18334f69e7b32d690aaa3247 Author: Tokunori Ikegami Date: Thu Mar 24 02:04:55 2022 +0900 mtd: cfi_cmdset_0002: Move and rename chip_check/chip_ready/chip_good_for_write This is a preparation patch for the S29GL064N buffer writes fix. There is no functional change. Link: https://lore.kernel.org/r/b687c259-6413-26c9-d4c9-b3afa69ea124@pengutronix.de/ Fixes: dfeae1073583("mtd: cfi_cmdset_0002: Change write buffer to check correct value") Signed-off-by: Tokunori Ikegami Cc: stable@vger.kernel.org Acked-by: Vignesh Raghavendra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220323170458.5608-2-ikegami.t@gmail.com commit be5fd933f8c15967931121aa8a0e521bf2802e71 Merge: 50c6afabfd2ae a8db203db05c5 Author: Paolo Abeni Date: Thu Apr 28 09:39:34 2022 +0200 Merge branch 'add-reset-deassertion-for-aspeed-mdio' Dylan Hung says: ==================== Add reset deassertion for Aspeed MDIO Add missing reset deassertion for Aspeed MDIO bus controller. The reset is asserted by the hardware when power-on so the driver only needs to deassert it. To be able to work with the old DT blobs, the reset is optional since it may be deasserted by the bootloader or the previous kernel. V6: - fix merge conflict for net-next V5: - fix error of dt_binding_check V4: - use ASPEED_RESET_MII instead of hardcoding in dt-binding example V3: - remove reset property from the required list of the device tree bindings - remove "Cc: stable@vger.kernel.org" from the commit messages - add more description in the commit message of the dt-binding V2: - add reset property in the device tree bindings - add reset assertion in the error path and driver remove ==================== Link: https://lore.kernel.org/r/20220427035501.17500-1-dylan_hung@aspeedtech.com Signed-off-by: Paolo Abeni commit a8db203db05c5271e59647adc0855c7290455a35 Author: Dylan Hung Date: Wed Apr 27 11:55:01 2022 +0800 ARM: dts: aspeed: add reset properties into MDIO nodes Add reset control properties into MDIO nodes. The 4 MDIO controllers in AST2600 SOC share one reset control bit SCU50[3]. Signed-off-by: Dylan Hung Reviewed-by: Andrew Jeffery Signed-off-by: Paolo Abeni commit 1585362250fed6b0c166e176b628b335611d8f19 Author: Dylan Hung Date: Wed Apr 27 11:55:00 2022 +0800 net: mdio: add reset control for Aspeed MDIO Add reset assertion/deassertion for Aspeed MDIO. There are 4 MDIO controllers embedded in Aspeed AST2600 SOC and share one reset control register SCU50[3]. To work with old DT blobs which don't have the reset property, devm_reset_control_get_optional_shared is used in this change. Signed-off-by: Dylan Hung Reviewed-by: Philipp Zabel Reviewed-by: Andrew Lunn Reviewed-by: Andrew Jeffery Signed-off-by: Paolo Abeni commit 65e42ad98e225cf796d8ef869a712dec6821bfe8 Author: Dylan Hung Date: Wed Apr 27 11:54:59 2022 +0800 dt-bindings: net: add reset property for aspeed, ast2600-mdio binding The AST2600 MDIO bus controller has a reset control bit and must be deasserted before manipulating the MDIO controller. By default, the hardware asserts the reset so the driver only need to deassert it. Regarding to the old DT blobs which don't have reset property in them, the reset deassertion is usually done by the bootloader so the reset property is optional to work with them. Signed-off-by: Dylan Hung Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Jeffery Signed-off-by: Paolo Abeni commit 9bda072a7bec278c424ad660373e69d8e4a3385d Merge: 4eaf02db9c268 f15856d7de914 Author: Dave Airlie Date: Thu Apr 28 15:32:29 2022 +1000 Merge tag 'drm-intel-gt-next-2022-04-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next UAPI Changes: - GuC hwconfig support and query (John Harrison, Rodrigo Vivi, Tvrtko Ursulin) - Sysfs support for multi-tile devices (Andi Shyti, Sujaritha Sundaresan) - Per client GPU utilisation via fdinfo (Tvrtko Ursulin, Ashutosh Dixit) - Add DRM_I915_QUERY_GEOMETRY_SUBSLICES (Matt Atwood) Cross-subsystem Changes: - Add GSC as a MEI auxiliary device (Tomas Winkler, Alexander Usyskin) Core Changes: - Document fdinfo format specification (Tvrtko Ursulin) Driver Changes: - Fix prime_mmap to work when using LMEM (Gwan-gyeong Mun) - Fix vm open count and remove vma refcount (Thomas Hellström) - Fixup setting screen_size (Matthew Auld) - Opportunistically apply ALLOC_CONTIGIOUS (Matthew Auld) - Limit where we apply TTM_PL_FLAG_CONTIGUOUS (Matthew Auld) - Drop aux table invalidation on FlatCCS platforms (Matt Roper) - Add missing boundary check in vm_access (Mastan Katragadda) - Update topology dumps for Xe_HP (Matt Roper) - Add support for steered register writes (Matt Roper) - Add steering info to GuC register save/restore list (Daniele Ceraolo Spurio) - Small PCI BAR enabling (Matthew Auld, Akeem G Abodunrin, CQ Tang) - Add preemption changes for Wa_14015141709 (Akeem G Abodunrin) - Add logical mapping for video decode engines (Matthew Brost) - Don't evict unmappable VMAs when pinning with PIN_MAPPABLE (v2) (Vivek Kasireddy) - GuC error capture support (Alan Previn, Daniele Ceraolo Spurio) - avoid concurrent writes to aux_inv (Fei Yang) - Add Wa_22014226127 (José Roberto de Souza) - Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL (Matt Roper) - Evict and restore of compressed objects (Ramalingam C) - Update to GuC version 70.1.1 (John Harrison) - Add Wa_22011802037 force cs halt (Tilak Tangudu) - Enable Wa_22011802037 for gen12 GuC based platforms (Umesh Nerlige Ramappa) - GuC based workarounds for DG2 (Vinay Belgaumkar, John Harrison, Matthew Brost, José Roberto de Souza) - consider min_page_size when migrating (Matthew Auld) - Prep work for next GuC firmware release (John Harrison) - Support platforms with CCS engines but no RCS (Matt Roper, Stuart Summers) - Don't overallocate subslice storage (Matt Roper) - Reduce stack usage in debugfs due to SSEU (John Harrison) - Report steering details in debugfs (Matt Roper) - Refactor some x86-ism out to prepare for non-x86 builds (Michael Cheng) - add lmem_size modparam (CQ Tang) - Refactor for non-x86 driver builds (Casey Bowman) - Centralize computation of freq caps (Ashutosh Dixit) - Update dma_buf_ops.unmap_dma_buf callback to use drm_gem_unmap_dma_buf() (Gwan-gyeong Mun) - Limit the async bind to bind_async_flags (Matthew Auld) - Stop checking for NULL vma->obj (Matthew Auld) - Reduce overzealous alignment constraints for GGTT (Matthew Auld) - Remove GEN12_SFC_DONE_MAX from register defs header (Matt Roper) - Fix renamed struct field (Lucas De Marchi) - Do not return '0' if there is nothing to return (Andi Shyti) - fix i915_reg_t initialization (Jani Nikula) - move the migration sanity check (Matthew Auld) - handle more rounding in selftests (Matthew Auld) - Perf and i915 query kerneldoc updates (Matt Roper) - Use i915_probe_error instead of drm_err (Vinay Belgaumkar) - sanity check object size in the buddy allocator (Matthew Auld) - fixup selftests min_alignment usage (Matthew Auld) - tweak selftests misaligned_case (Matthew Auld) Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/i915/i915_vma.c From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Ymkfy8FjsG2JrodK@tursulin-mobl2 commit 95fb5f188cba275a87955a7b9534bd80d38f78b9 Author: John Harrison Date: Wed Apr 27 09:55:50 2022 -0700 drm/i915/dg2: Define GuC firmware version for DG2 First release of GuC for DG2. Signed-off-by: John Harrison CC: Tomasz Mistat CC: Ramalingam C CC: Daniele Ceraolo Spurio Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220427165550.3636686-3-John.C.Harrison@Intel.com commit 4eaf02db9c2680ca92af92e2de7b33c6e079b2cd Merge: dbe946287e082 e15c9d06e9ad7 Author: Dave Airlie Date: Thu Apr 28 14:56:02 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-04-22' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-04-22: amdgpu: - SMU message documentation update - Misc code cleanups - Documenation updates - PSP TA updates - Runtime PM regression fix - SR-IOV header cleanup - Misc fixes amdkfd: - TLB flush fixes - GWS fixes - CRIU GWS support radeon: - Misc code cleanups Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220422150049.5859-1-alexander.deucher@amd.com commit dbe946287e0825f0e9cd4cbeacfcde9d9b2dd168 Merge: 19df0cfa258cd d68cf992ded57 Author: Dave Airlie Date: Thu Apr 28 14:33:20 2022 +1000 Merge tag 'amd-drm-next-5.19-2022-04-15' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.19-2022-04-15: amdgpu: - USB-C updates - GPUVM updates - TMZ fixes for RV - DCN 3.1 pstate fixes - Display z state fixes - RAS fixes - Misc code cleanups and spelling fixes - More DC FP rework - GPUVM TLB handling rework - Power management sysfs code cleanup - Add RAS support for VCN - Backlight fix - Add unique id support for more asics - Misc display updates - SR-IOV fixes - Extend CG and PG flags to 64 bits - Enable VCN clk sysfs nodes for navi12 amdkfd: - Fix IO link cleanup during device removal - RAS fixes - Retry fault fixes - Asynchronously free events - SVM fixes radeon: - Drop some dead code - Misc code cleanups From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220415135144.5700-1-alexander.deucher@amd.com Signed-off-by: Dave Airlie commit d1c57439e4f3db0a12259b9978905e92847505b8 Author: Zhengchao Shao Date: Wed Apr 27 14:23:38 2022 +0800 samples/bpf: Detach xdp prog when program exits unexpectedly in xdp_rxq_info_user When xdp_rxq_info_user program exits unexpectedly, it doesn't detach xdp prog of device, and other xdp prog can't be attached to the device. So call init_exit() to detach xdp prog when program exits unexpectedly. Signed-off-by: Zhengchao Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220427062338.80173-1-shaozhengchao@huawei.com commit 0925225956bbef863d51ee882d4d20c9a9c90db2 Author: Mykola Lysenko Date: Tue Apr 26 21:13:53 2022 -0700 bpf/selftests: Add granular subtest output for prog_test Implement per subtest log collection for both parallel and sequential test execution. This allows granular per-subtest error output in the 'All error logs' section. Add subtest log transfer into the protocol during the parallel test execution. Move all test log printing logic into dump_test_log function. One exception is the output of test names when verbose printing is enabled. Move test name/result printing into separate functions to avoid repetition. Print all successful subtest results in the log. Print only failed test logs when test does not have subtests. Or only failed subtests' logs when test has subtests. Disable 'All error logs' output when verbose mode is enabled. This functionality was already broken and is causing confusion. Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220427041353.246007-1-mykolal@fb.com commit f01e49fb17bfabcac417c6ad6e55aae0fe6fb360 Merge: 8ba816b23abd2 9151ad5d8676a Author: Jens Axboe Date: Wed Apr 27 19:36:18 2022 -0600 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.19/drivers Pull MD updates from Song: "1. Improve annotation in raid5 code, by Logan Gunthorpe. 2. Support MD_BROKEN flag in raid-1/5/10, by Mariusz Tkaczyk. 3. Other small fixes/cleanups." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: Replace role magic numbers with defined constants md/raid0: Ignore RAID0 layout if the second zone has only one device md/raid5: Annotate functions that hold device_lock with __must_hold md/raid5-ppl: Annotate with rcu_dereference_protected() md/raid5: Annotate rdev/replacement access when mddev_lock is held md/raid5: Annotate rdev/replacement accesses when nr_pending is elevated md/raid5: Add __rcu annotation to struct disk_info md/raid5: Un-nest struct raid5_percpu definition md/raid5: Cleanup setup_conf() error returns md: replace deprecated strlcpy & remove duplicated line md/bitmap: don't set sb values if can't pass sanity check md: fix an incorrect NULL check in md_reload_sb md: fix an incorrect NULL check in does_sb_need_changing raid5: introduce MD_BROKEN md: Set MD_BROKEN for RAID1 and RAID10 commit 50c6afabfd2ae91a4ff0e2feb14fe702b0688ec5 Merge: c6101dd7ffb8b d54d06a4c4bc5 Author: Jakub Kicinski Date: Wed Apr 27 17:09:31 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-04-27 We've added 85 non-merge commits during the last 18 day(s) which contain a total of 163 files changed, 4499 insertions(+), 1521 deletions(-). The main changes are: 1) Teach libbpf to enhance BPF verifier log with human-readable and relevant information about failed CO-RE relocations, from Andrii Nakryiko. 2) Add typed pointer support in BPF maps and enable it for unreferenced pointers (via probe read) and referenced ones that can be passed to in-kernel helpers, from Kumar Kartikeya Dwivedi. 3) Improve xsk to break NAPI loop when rx queue gets full to allow for forward progress to consume descriptors, from Maciej Fijalkowski & Björn Töpel. 4) Fix a small RCU read-side race in BPF_PROG_RUN routines which dereferenced the effective prog array before the rcu_read_lock, from Stanislav Fomichev. 5) Implement BPF atomic operations for RV64 JIT, and add libbpf parsing logic for USDT arguments under riscv{32,64}, from Pu Lehui. 6) Implement libbpf parsing of USDT arguments under aarch64, from Alan Maguire. 7) Enable bpftool build for musl and remove nftw with FTW_ACTIONRETVAL usage so it can be shipped under Alpine which is musl-based, from Dominique Martinet. 8) Clean up {sk,task,inode} local storage trace RCU handling as they do not need to use call_rcu_tasks_trace() barrier, from KP Singh. 9) Improve libbpf API documentation and fix error return handling of various API functions, from Grant Seltzer. 10) Enlarge offset check for bpf_skb_{load,store}_bytes() helpers given data length of frags + frag_list may surpass old offset limit, from Liu Jian. 11) Various improvements to prog_tests in area of logging, test execution and by-name subtest selection, from Mykola Lysenko. 12) Simplify map_btf_id generation for all map types by moving this process to build time with help of resolve_btfids infra, from Menglong Dong. 13) Fix a libbpf bug in probing when falling back to legacy bpf_probe_read*() helpers; the probing caused always to use old helpers, from Runqing Yang. 14) Add support for ARCompact and ARCv2 platforms for libbpf's PT_REGS tracing macros, from Vladimir Isaev. 15) Cleanup BPF selftests to remove old & unneeded rlimit code given kernel switched to memcg-based memory accouting a while ago, from Yafang Shao. 16) Refactor of BPF sysctl handlers to move them to BPF core, from Yan Zhu. 17) Fix BPF selftests in two occasions to work around regressions caused by latest LLVM to unblock CI until their fixes are worked out, from Yonghong Song. 18) Misc cleanups all over the place, from various others. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (85 commits) selftests/bpf: Add libbpf's log fixup logic selftests libbpf: Fix up verifier log for unguarded failed CO-RE relos libbpf: Simplify bpf_core_parse_spec() signature libbpf: Refactor CO-RE relo human description formatting routine libbpf: Record subprog-resolved CO-RE relocations unconditionally selftests/bpf: Add CO-RE relos and SEC("?...") to linked_funcs selftests libbpf: Avoid joining .BTF.ext data with BPF programs by section name libbpf: Fix logic for finding matching program for CO-RE relocation libbpf: Drop unhelpful "program too large" guess libbpf: Fix anonymous type check in CO-RE logic bpf: Compute map_btf_id during build time selftests/bpf: Add test for strict BTF type check selftests/bpf: Add verifier tests for kptr selftests/bpf: Add C tests for kptr libbpf: Add kptr type tag macros to bpf_helpers.h bpf: Make BTF type match stricter for release arguments bpf: Teach verifier about kptr_get kfunc helpers bpf: Wire up freeing of referenced kptr bpf: Populate pairs of btf_id and destructor kfunc in btf bpf: Adapt copy_map_value for multiple offset case ... ==================== Link: https://lore.kernel.org/r/20220427224758.20976-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 1bc4ae0ccbc661b58d3e8f7b633c7786eaf7929f Author: Matt Roper Date: Mon Apr 25 14:12:50 2022 -0700 drm/i915: Add first set of DG2 PCI IDs The IDs added here are the subset reserved for 'motherboard down' designs of DG2. We have all the necessary support upstream to enable these now (although they'll continue to require force_probe until the usual requirements are met). The remaining DG2 IDs for add-in cards will come in a future patch once some additional required functionality has fully landed. Bspec: 44477 Cc: Lucas De Marchi Cc: Daniel Vetter Cc: Dave Airlie Cc: Rodrigo Vivi Cc: Joonas Lahtinen Cc: Jani Nikula Cc: Tvrtko Ursulin Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220425211251.77154-3-matthew.d.roper@intel.com commit 52cc78424458f936de0dbf7dd279f9e7d47ab96c Author: Adrian Hunter Date: Wed Apr 27 17:19:46 2022 +0300 perf tools: Delete perf-with-kcore.sh script It has been obsolete since the introduction of the 'perf record --kcore' option. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20220427141946.269523-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c6101dd7ffb8b7f940e3fc4a22ce4023f8184f0d Author: Arun Ramadoss Date: Tue Apr 26 14:40:48 2022 +0530 net: dsa: ksz9477: move get_stats64 to ksz_common.c The mib counters for the ksz9477 is same for the ksz9477 switch and LAN937x switch. Hence moving it to ksz_common.c file in order to have it generic function. The DSA hook get_stats64 now can call ksz_get_stats64. Signed-off-by: Arun Ramadoss Reviewed-by: Oleksij Rempel Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220426091048.9311-1-arun.ramadoss@microchip.com Signed-off-by: Jakub Kicinski commit 3838bf828b84d58bf0213289e06c914f7d0a04da Merge: 87e291075d06b 767e6f26204d3 Author: Mark Brown Date: Wed Apr 27 23:01:24 2022 +0100 ASoC: sh: rz-ssi: Trivial fixes Merge series from Lad Prabhakar : This patch series aims to fix trivial issues found in rz-ssi driver. commit 87e291075d06ba1613d4b7b9c1f156b8d5c2526f Merge: 9ce170dc9c088 02885dd831c04 Author: Mark Brown Date: Wed Apr 27 23:01:23 2022 +0100 ASoC: SOF: use pm_runtime_resume_and_get() Merge series from Pierre-Louis Bossart : simplify code pattern as recommended by Mark Brown. commit ba27d8555867b0e02e15709f4ddb79aec5cf2efc Author: Jakob Koschel Date: Wed Apr 27 19:07:34 2022 +0200 tracing: Remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lkml.kernel.org/r/20220427170734.819891-5-jakobkoschel@gmail.com Cc: Ingo Molnar Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Signed-off-by: Steven Rostedt (Google) commit 45e333ce2ad5cbb0ee05686336de09058c6af8ca Author: Jakob Koschel Date: Wed Apr 27 19:07:33 2022 +0200 tracing: 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://lkml.kernel.org/r/20220427170734.819891-4-jakobkoschel@gmail.com Cc: Ingo Molnar Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Signed-off-by: Steven Rostedt (Google) commit 99d8ae4ec8a90ecf6c2a6a141bd4db4a3bc5146c Author: Jakob Koschel Date: Wed Apr 27 19:07:32 2022 +0200 tracing: Remove usage of list iterator variable after the loop In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Link: https://lkml.kernel.org/r/20220427170734.819891-3-jakobkoschel@gmail.com Cc: Ingo Molnar Signed-off-by: Jakob Koschel Signed-off-by: Steven Rostedt (Google) commit 1da27a25054f7660f7bb27ad4ccf036ee6ba51e9 Author: Jakob Koschel Date: Wed Apr 27 19:07:31 2022 +0200 tracing: Remove usage of list iterator after the loop body In preparation to limit the scope of the list iterator variable to the traversal loop, use a dedicated pointer to point to the found element [1]. Before, the code implicitly used the head when no element was found when using &pos->list. Since the new variable is only set if an element was found, the head needs to be used explicitly if the variable is NULL. Link: https://lkml.kernel.org/r/20220427170734.819891-2-jakobkoschel@gmail.com Cc: Ingo Molnar Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Signed-off-by: Steven Rostedt (Google) commit 4d1257bbc220603d9e5c5157552448c066111c71 Author: Kurt Kanzenbach Date: Thu Apr 14 11:18:05 2022 +0200 tracing: Add documentation for trace clock tai Add documentation for newly introduced trace clock "tai". This clock corresponds to CLOCK_TAI. Link: https://lkml.kernel.org/r/20220414091805.89667-4-kurt@linutronix.de Signed-off-by: Kurt Kanzenbach Signed-off-by: Steven Rostedt (Google) commit c575afe21ccc47c5561d11493ede81ab7d072267 Author: Kurt Kanzenbach Date: Thu Apr 14 11:18:04 2022 +0200 tracing: Introduce trace clock tai A fast/NMI safe accessor for CLOCK_TAI has been introduced. Use it for adding the additional trace clock "tai". Link: https://lkml.kernel.org/r/20220414091805.89667-3-kurt@linutronix.de Signed-off-by: Kurt Kanzenbach Signed-off-by: Steven Rostedt (Google) commit f03f2abce4f3944b9576bc4ad28b75890e907d7c Author: Steven Rostedt (Google) Date: Wed Apr 27 17:08:12 2022 -0400 ring-buffer: Have 32 bit time stamps use all 64 bits When the new logic was made to handle deltas of events from interrupts that interrupted other events, it required 64 bit local atomics. Unfortunately, 64 bit local atomics are expensive on 32 bit architectures. Thus, commit 10464b4aa605e ("ring-buffer: Add rb_time_t 64 bit operations for speeding up 32 bit") created a type of seq lock timer for 32 bits. It used two 32 bit local atomics, but required 2 bits from them each for synchronization, making it only 60 bits. Add a new "msb" field to hold the extra 4 bits that are cut off. Link: https://lore.kernel.org/all/20220426175338.3807ca4f@gandalf.local.home/ Link: https://lkml.kernel.org/r/20220427170812.53cc7139@gandalf.local.home Signed-off-by: Steven Rostedt (Google) commit 6695da58f9445f386516ed53a3e870f534d2645d Author: Steven Rostedt (Google) Date: Wed Apr 27 15:33:39 2022 -0400 ring-buffer: Have absolute time stamps handle large numbers There's an absolute timestamp event in the ring buffer, but this only saves 59 bits of the timestamp, as the 5 MSB is used for meta data (stating it is an absolute time stamp). This was never an issue as all the clocks currently in use never used those 5 MSB. But now there's a new clock (TAI) that does. To handle this case, when reading an absolute timestamp, a previous full timestamp is passed in, and the 5 MSB of that timestamp is OR'd to the absolute timestamp (if any of the 5 MSB are set), and then to test for overflow, if the new result is smaller than the passed in previous timestamp, then 1 << 59 is added to it. All the extra processing is done on the reader "slow" path, with the exception of the "too big delta" check, and the reading of timestamps for histograms. Note, libtraceevent will need to be updated to handle this case as well. But this is not a user space regression, as user space was never able to handle any timestamps that used more than 59 bits. Link: https://lore.kernel.org/all/20220426175338.3807ca4f@gandalf.local.home/ Link: https://lkml.kernel.org/r/20220427153339.16c33f75@gandalf.local.home Cc: Tom Zanussi Cc: Thomas Gleixner Cc: Kurt Kanzenbach Signed-off-by: Steven Rostedt (Google) commit 830fe3c30dffe0b9f9485772070c29fcd8c2473d Author: Suma Hegde Date: Wed Apr 27 20:52:48 2022 +0530 amd_hsmp: Add HSMP protocol version 5 messages HSMP protocol version 5 is supported on AMD family 19h model 10h EPYC processors. This version brings new features such as -- DIMM statistics -- Bandwidth for IO and xGMI links -- Monitor socket and core frequency limits -- Configure power efficiency modes, DF pstate range etc Signed-off-by: Suma Hegde Reviewed-by: Carlos Bilbao Signed-off-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20220427152248.25643-1-nchatrad@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 77089467fc799e2c24cb4067b013db9b7664f5ed Author: Juergen Gross Date: Fri Mar 18 16:09:50 2022 +0100 platform/x86/dell: add buffer allocation/free functions for SMI calls The dcdbas driver is used to call SMI handlers for both, dcdbas and dell-smbios-smm. Both drivers allocate a buffer for communicating with the SMI handler. The physical buffer address is then passed to the called SMI handler via %ebx. Unfortunately this doesn't work when running in Xen dom0, as the physical address obtained via virt_to_phys() is only a guest physical address, and not a machine physical address as needed by SMI. The problem in dcdbas is easy to correct, as dcdbas is using dma_alloc_coherent() for allocating the buffer, and the machine physical address is available via the DMA address returned in the DMA handle. In order to avoid duplicating the buffer allocation code in dell-smbios-smm, add a generic buffer allocation function to dcdbas and use it for both drivers. This is especially fine regarding driver dependencies, as dell-smbios-smm is already calling dcdbas to generate the SMI request. Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220318150950.16843-1-jgross@suse.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b941820ec938d175fd6e4e7ba5b4a6ca9d092afd Author: Heikki Krogerus Date: Mon Apr 25 14:45:44 2022 +0300 ACPI: OSL: Remove the helper for deactivating memory region There are no more users for acpi_release_memory(). Signed-off-by: Heikki Krogerus Reviewed-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit cdc3d2abf4387dbd9c690e44b1c9dc62d1873652 Author: Heikki Krogerus Date: Mon Apr 25 14:45:43 2022 +0300 usb: typec: ucsi: acpi: Map the mailbox with memremap() The UCSI mailbox is always in main memory. Signed-off-by: Heikki Krogerus Reviewed-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit fb4c77c21aba03677f283acda3cae748ef866abf Author: Thomas Gleixner Date: Mon Apr 25 17:45:42 2022 +0200 x86/aperfmperf: Integrate the fallback code from show_cpuinfo() Due to the avoidance of IPIs to idle CPUs arch_freq_get_on_cpu() can return 0 when the last sample was too long ago. show_cpuinfo() has a fallback to cpufreq_quick_get() and if that fails to return cpu_khz, but the readout code for the per CPU scaling frequency in sysfs does not. Move that fallback into arch_freq_get_on_cpu() so the behaviour is the same when reading /proc/cpuinfo and /sys/..../cur_scaling_freq. Suggested-by: "Rafael J. Wysocki" Signed-off-by: Thomas Gleixner Tested-by: Doug Smythies Link: https://lore.kernel.org/r/87pml5180p.ffs@tglx commit f3eca381bd49d708073ba1a9af4fa6ea5d5810a6 Author: Thomas Gleixner Date: Fri Apr 15 21:20:04 2022 +0200 x86/aperfmperf: Replace arch_freq_get_on_cpu() Reading the current CPU frequency from /sys/..../scaling_cur_freq involves in the worst case two IPIs due to the ad hoc sampling. The frequency invariance infrastructure provides the APERF/MPERF samples already. Utilize them and consolidate this with the /proc/cpuinfo readout. The sample is considered valid for 20ms. So for idle or isolated NOHZ full CPUs the function returns 0, which is matching the previous behaviour. The resulting text size vs. the original APERF/MPERF plus the separate frequency invariance code: text: 2411 -> 723 init.text: 0 -> 767 Signed-off-by: Thomas Gleixner Tested-by: Eric Dumazet Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.934040006@linutronix.de commit 7d84c1ebf9ddafca27b481e6da7d24a023dacaa2 Author: Thomas Gleixner Date: Fri Apr 15 21:20:02 2022 +0200 x86/aperfmperf: Replace aperfmperf_get_khz() The frequency invariance infrastructure provides the APERF/MPERF samples already. Utilize them for the cpu frequency display in /proc/cpuinfo. The sample is considered valid for 20ms. So for idle or isolated NOHZ full CPUs the function returns 0, which is matching the previous behaviour. This gets rid of the mass IPIs and a delay of 20ms for stabilizing observed by Eric when reading /proc/cpuinfo. Reported-by: Eric Dumazet Signed-off-by: Thomas Gleixner Tested-by: Eric Dumazet Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.875029458@linutronix.de commit cd8c0e142daf9de9ce594e61b75509b0af7bfb26 Author: Thomas Gleixner Date: Fri Apr 15 21:20:01 2022 +0200 x86/aperfmperf: Store aperf/mperf data for cpu frequency reads Now that the MSR readout is unconditional, store the results in the per CPU data structure along with a jiffies timestamp for the CPU frequency readout code. Signed-off-by: Thomas Gleixner Acked-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.817702355@linutronix.de commit bb6e89df9028b2fab0ce6ac71cd9ef25b6ada32d Author: Thomas Gleixner Date: Fri Apr 15 21:19:59 2022 +0200 x86/aperfmperf: Make parts of the frequency invariance code unconditional The frequency invariance support is currently limited to x86/64 and SMP, which is the vast majority of machines. arch_scale_freq_tick() is called every tick on all CPUs and reads the APERF and MPERF MSRs. The CPU frequency getters function do the same via dedicated IPIs. While it could be argued that on systems where frequency invariance support is disabled (32bit, !SMP) the per tick read of the APERF and MPERF MSRs can be avoided, it does not make sense to keep the extra code and the resulting runtime issues of mass IPIs around. As a first step split out the non frequency invariance specific initialization code and the read MSR portion of arch_scale_freq_tick(). The rest of the code is still conditional and guarded with a static key. Signed-off-by: Thomas Gleixner Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.761988704@linutronix.de commit 73a5fa7d51366a549a9f2e3ee875ae51aa0b5580 Author: Thomas Gleixner Date: Fri Apr 15 21:19:57 2022 +0200 x86/aperfmperf: Restructure arch_scale_freq_tick() Preparation for sharing code with the CPU frequency portion of the aperf/mperf code. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.706185092@linutronix.de commit 24620d94a52adc0cafe65dc65bed1d586ca04a6e Author: Thomas Gleixner Date: Fri Apr 15 21:19:56 2022 +0200 x86/aperfmperf: Put frequency invariance aperf/mperf data into a struct Preparation for sharing code with the CPU frequency portion of the aperf/mperf code. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.648485667@linutronix.de commit 0dfaf3f6ecc0c7f4f876255aa82e8959d3721365 Author: Thomas Gleixner Date: Fri Apr 15 21:19:54 2022 +0200 x86/aperfmperf: Untangle Intel and AMD frequency invariance init AMD boot CPU initialization happens late via ACPI/CPPC which prevents the Intel parts from being marked __init. Split out the common code and provide a dedicated interface for the AMD initialization and mark the Intel specific code and data __init. The remaining text size is almost cut in half: text: 2614 -> 1350 init.text: 0 -> 786 Signed-off-by: Thomas Gleixner Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.592465719@linutronix.de commit 75d893d19c8e1b4bf4a9acd613fe5e7a80b58974 Author: Darrick J. Wong Date: Mon Apr 25 18:37:06 2022 -0700 xfs: speed up rmap lookups by using non-overlapped lookups when possible Reverse mapping on a reflink-capable filesystem has some pretty high overhead when performing file operations. This is because the rmap records for logically and physically adjacent extents might not be adjacent in the rmap index due to data block sharing. As a result, we use expensive overlapped-interval btree search, which walks every record that overlaps with the supplied key in the hopes of finding the record. However, profiling data shows that when the index contains a record that is an exact match for a query key, the non-overlapped btree search function can find the record much faster than the overlapped version. Try the non-overlapped lookup first, which will make scrub run much faster. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit 5b7ca8b313621907d80460bfcc1fa876d2a38488 Author: Darrick J. Wong Date: Mon Apr 25 18:37:06 2022 -0700 xfs: simplify xfs_rmap_lookup_le call sites Most callers of xfs_rmap_lookup_le will retrieve the btree record immediately if the lookup succeeds. The overlapped version of this function (xfs_rmap_lookup_le_range) will return the record if the lookup succeeds, so make the regular version do it too. Get rid of the useless len argument, since it's not part of the lookup key. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig commit c46eef34830e51ae7fe4b8371837c586448c3078 Author: Darrick J. Wong Date: Mon Apr 25 18:37:05 2022 -0700 xfs: capture buffer ops in the xfs_buf tracepoints Record the buffer ops in the xfs_buf tracepoints so that we can monitor the alleged type of the buffer. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 69bb9b29bf67e850beece45e9c99ca707eac7e41 Author: Chuanhong Guo Date: Sun Apr 24 11:25:26 2022 +0800 spi: dt-bindings: add binding doc for spi-mtk-snfi Add device-tree binding documentation for Mediatek SPI-NAND Flash Interface. Signed-off-by: Chuanhong Guo Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220424032527.673605-5-gch981213@gmail.com Signed-off-by: Mark Brown commit 764f1b7481645b2b4488eda26c4da7f331697e6b Author: Chuanhong Guo Date: Sun Apr 24 11:25:24 2022 +0800 spi: add driver for MTK SPI NAND Flash Interface This driver implements support for the SPI-NAND mode of MTK NAND Flash Interface as a SPI-MEM controller with pipelined ECC capability. Signed-off-by: Chuanhong Guo Tested-by: Daniel Golle Link: https://lore.kernel.org/r/20220424032527.673605-3-gch981213@gmail.com Signed-off-by: Mark Brown commit 767e6f26204d3f5406630e86b720d01818b8616d Author: Lad Prabhakar Date: Tue Apr 26 08:49:22 2022 +0100 ASoC: sh: rz-ssi: Release the DMA channels in rz_ssi_probe() error path DMA channels requested by rz_ssi_dma_request() in rz_ssi_probe() were never released in the error path apart from one place. This patch fixes this issue by calling rz_ssi_release_dma_channels() in the error path. Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220426074922.13319-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 91686a3984f34df0ab844cdbaa7e4d9621129f5d Author: Lad Prabhakar Date: Tue Apr 26 08:49:21 2022 +0100 ASoC: sh: rz-ssi: Propagate error codes returned from platform_get_irq_byname() Propagate error codes returned from platform_get_irq_byname() instead of returning -ENODEV. platform_get_irq_byname() may return -EPROBE_DEFER, to handle such cases propagate the error codes. While at it drop the dev_err_probe() messages as platform_get_irq_byname() already does this for us in case of error. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220426074922.13319-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 17a1fef58c65ec9c9a15dd60386712567ff28d45 Author: Lad Prabhakar Date: Tue Apr 26 08:49:20 2022 +0100 ASoC: sh: rz-ssi: Drop SSIFSR_TDC and SSIFSR_RDC macros The mask values of SSIFSR_TDC and SSIFSR_RDC macros are incorrect and they are unused in the file so just drop them. Reported-by: Nobuhiro Iwamatsu Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220426074922.13319-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 26ac2436f38f3592cf2962ece2d9044fc6477d22 Merge: 9ee448f94318a 4c5bf4b51c985 Author: Mark Brown Date: Wed Apr 27 17:22:02 2022 +0100 spi: Pull Mediatek ECC changes Mediatek ECC changes: * Also parse the default nand-ecc-engine property if available * Make mtk_ecc.c a separated module needed for SPI controller driver commit 079d6348f3be114f977b5b2e18174044eef6f1d3 Merge: 9b2152f96f4a2 4c5bf4b51c985 Author: Miquel Raynal Date: Wed Apr 27 18:16:14 2022 +0200 Merge tag 'mtd/mtk-spi-nand-for-5.19' into nand/next Mediatek ECC changes: * Also parse the default nand-ecc-engine property if available * Make mtk_ecc.c a separated module Signed-off-by: Miquel Raynal commit 4c5bf4b51c9857e20c5f5e9d74b86aa1bd1def40 Author: Chuanhong Guo Date: Sun Apr 24 11:25:25 2022 +0800 mtd: nand: mtk-ecc: also parse nand-ecc-engine if available The recently added ECC engine support introduced a generic property named nand-ecc-engine for ecc engine phandle. This patch adds support for this new property. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220424032527.673605-4-gch981213@gmail.com commit 4fd62f15afa0d0da4823f429a2fb4c3492a84edf Author: Chuanhong Guo Date: Sun Apr 24 11:25:23 2022 +0800 mtd: nand: make mtk_ecc.c a separated module this code will be used in mediatek snfi spi-mem controller with pipelined ECC engine. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220424032527.673605-2-gch981213@gmail.com commit 8a58bcd00e2e8d46afce468adc09fcd7968f514c Author: Mark Brown Date: Wed Apr 27 14:08:28 2022 +0100 arm64/sme: Add ID_AA64SMFR0_EL1 to __read_sysreg_by_encoding() We need to explicitly enumerate all the ID registers which we rely on for CPU capabilities in __read_sysreg_by_encoding(), ID_AA64SMFR0_EL1 was missed from this list so we trip a BUG() in paths which rely on that function such as CPU hotplug. Add the register. Reported-by: Marek Szyprowski Signed-off-by: Mark Brown Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220427130828.162615-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit b7d8a9973374e57a85e7296f429f50770ca68000 Author: Rahul T R Date: Tue Apr 26 20:59:26 2022 +0530 arm64: defconfig: Enable configs for DisplayPort on J721e Enable DRM and PHY configs required for supporting DisplayPort on J721e Signed-off-by: Rahul T R Signed-off-by: Vignesh Raghavendra Reviewed-by: Tomi Valkeinen Link: https://lore.kernel.org/r/20220426152926.20953-1-r-ravikumar@ti.com commit 9b2152f96f4a243bdfb89027c0d920aa0af810e7 Author: Yang Yingliang Date: Tue Apr 26 16:49:13 2022 +0800 mtd: rawnand: tmio: check return value after calling platform_get_resource() It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Signed-off-by: Yang Yingliang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-3-yangyingliang@huawei.com commit ddf66aefd685fd46500b9917333e1b1e118276dc Author: Yang Yingliang Date: Tue Apr 26 16:49:12 2022 +0800 mtd: rawnand: intel: fix possible null-ptr-deref in ebu_nand_probe() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Yang Yingliang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-2-yangyingliang@huawei.com commit a28ed09dafee20da51eb26452950839633afd824 Author: Yang Yingliang Date: Tue Apr 26 16:49:11 2022 +0800 mtd: rawnand: cadence: fix possible null-ptr-deref in cadence_nand_dt_probe() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: ec4ba01e894d ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem") Signed-off-by: Yang Yingliang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220426084913.4021868-1-yangyingliang@huawei.com commit 242e85a7a0a0994072383b5d29f017f6a17af472 Author: Minghao Chi Date: Mon Apr 25 10:54:46 2022 +0000 platform/x86: asus-wmi: Use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220425105446.3515663-1-chi.minghao@zte.com.cn Signed-off-by: Hans de Goede commit 0eb369bf48f25cf4f1cceb7786af27da4edb8dce Author: Minghao Chi Date: Mon Apr 25 10:55:25 2022 +0000 platform/x86/intel: pmc/core: Use kobj_to_dev() Use kobj_to_dev() instead of open-coding it. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220425105525.3515831-1-chi.minghao@zte.com.cn Signed-off-by: Hans de Goede commit b4e74f6842d4928d5d95935b1a058d503c103ed7 Author: Tom Rix Date: Sat Apr 23 08:30:48 2022 -0400 platform/x86/intel: pmc/core: change pmc_lpm_modes to static Sparse reports this issue core.c: note: in included file: core.h:239:12: warning: symbol 'pmc_lpm_modes' was not declared. Should it be static? Global variables should not be defined in headers. This only works because core.h is only included by core.c. Single file use variables should be static, so change its storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220423123048.591405-1-trix@redhat.com Signed-off-by: Hans de Goede commit 20b5ec315a3b8c830820b69fc2f69e8608d7a09f Author: David E. Box Date: Wed Apr 20 08:56:22 2022 -0700 platform/x86/intel/sdsi: Fix bug in multi packet reads Fix bug that added an offset to the mailbox addr during multi-packet reads. Did not affect current ABI since it doesn't support multi-packet transactions. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-4-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5a79615c0e186b9dd25ce9831a8405f7f1a9535b Author: David E. Box Date: Wed Apr 20 08:56:21 2022 -0700 platform/x86/intel/sdsi: Poll on ready bit for writes Due to change in firmware flow, update mailbox writes to poll on ready bit instead of run_busy bit. This change makes the polling method consistent for both writes and reads, which also uses the ready bit. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-3-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 5d7e5e346ef84949db438e9ca1ef81d895b56c0f Author: David E. Box Date: Wed Apr 20 08:56:20 2022 -0700 platform/x86/intel/sdsi: Handle leaky bucket To prevent an agent from indefinitely holding the mailbox firmware has implemented a leaky bucket algorithm. Repeated access to the mailbox may now incur a delay of up to 2.1 seconds. Add a retry loop that tries for up to 2.5 seconds to acquire the mailbox. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-2-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e769cb20c5b7c74513b88d1aed482309bcaece71 Author: Srinivas Pandruvada Date: Wed Apr 27 03:03:04 2022 -0700 platform/x86: intel-uncore-freq: Prevent driver loading in guests Loading this driver in guests results in unchecked MSR access error for MSR 0x620. There is no use of reading and modifying package/die scope uncore MSRs in guests. So check for CPU feature X86_FEATURE_HYPERVISOR to prevent loading of this driver in guests. Fixes: dbce412a7733 ("platform/x86/intel-uncore-freq: Split common and enumeration part") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215870 Suggested-by: Borislav Petkov Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220427100304.2562990-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede commit 258af41d150b2a8a2364a641bfeaa637b3ae8607 Author: Darryn Anton Jordan Date: Thu Apr 14 16:24:43 2022 +0200 platform/x86: gigabyte-wmi: added support for B660 GAMING X DDR4 motherboard This works on my system. Signed-off-by: Darryn Anton Jordan Acked-by: Thomas Weißschuh Link: https://lore.kernel.org/r/Ylguq87YG+9L3foV@hark Signed-off-by: Hans de Goede commit 24ba808a1fffdb136f5e9d418cf1fbe684041fa4 Author: Gabriele Mazzotta Date: Tue Apr 26 14:08:27 2022 +0200 platform/x86: dell-laptop: Add quirk entry for Latitude 7520 The Latitude 7520 supports AC timeouts, but it has no KBD_LED_AC_TOKEN and so changes to stop_timeout appear to have no effect if the laptop is plugged in. Signed-off-by: Gabriele Mazzotta Acked-by: Pali Rohár Link: https://lore.kernel.org/r/20220426120827.12363-1-gabriele.mzt@gmail.com Signed-off-by: Hans de Goede commit 2492a974022081935fbcb0f1bf8a80fc39812806 Author: Aswath Govindraju Date: Mon Apr 18 17:28:01 2022 +0530 arm64: dts: ti: k3-am62: Add support for MCAN AM62 SoC has one instance of MCAN in main domain. However, its corresponding CAN signals are not brought out through a transceiver, on the SK board. Therefore, add the device tree node in the main dt file and set the status to disabled in the SK board dts file. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220418115802.5672-1-a-govindraju@ti.com commit c5f2b8e9a9f891f67c58a3d9c6bca1eb8449dda2 Author: Hans de Goede Date: Wed Apr 27 13:49:56 2022 +0200 platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails Before this commit fan_curve_check_present() was trying to not cause the probe to fail on devices without fan curve control by testing for known error codes returned by asus_wmi_evaluate_method_buf(). Checking for ENODATA or ENODEV, with the latter being returned by this function when an ACPI integer with a value of ASUS_WMI_UNSUPPORTED_METHOD is returned. But for other ACPI integer returns this function just returns them as is, including the ASUS_WMI_DSTS_UNKNOWN_BIT value of 2. On the Asus U36SD ASUS_WMI_DSTS_UNKNOWN_BIT gets returned, leading to: asus-nb-wmi: probe of asus-nb-wmi failed with error 2 Instead of playing whack a mole with error codes here, simply treat all errors as there not being any fan curves, fixing the driver no longer loading on the Asus U36SD laptop. Fixes: e3d13da7f77d ("platform/x86: asus-wmi: Fix regression when probing for fan curve control") BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2079125 Cc: Luke D. Jones Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220427114956.332919-1-hdegoede@redhat.com commit d2833762f23a62cce1636452108706541a735290 Author: Dan Carpenter Date: Wed Apr 13 10:37:44 2022 +0300 platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf() This code tests for if the obj->buffer.length is larger than the buffer but then it just does the memcpy() anyway. Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220413073744.GB8812@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit acd51562e07d17aaf4ac652f1dc55c743685bf41 Author: Nathan Chancellor Date: Mon Apr 18 14:38:00 2022 -0700 platform/x86: amd-pmc: Shuffle location of amd_pmc_get_smu_version() When CONFIG_DEBUG_FS is disabled, amd_pmc_get_smu_version() is unused: drivers/platform/x86/amd-pmc.c:196:12: warning: unused function 'amd_pmc_get_smu_version' [-Wunused-function] static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev) ^ 1 warning generated. Eliminate the warning by moving amd_pmc_get_smu_version() to the CONFIG_DEBUG_FS block where it is used. Fixes: b0c07116c894 ("platform/x86: amd-pmc: Avoid reading SMU version at probe time") Signed-off-by: Nathan Chancellor Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20220418213800.21257-1-nathan@kernel.org Signed-off-by: Hans de Goede commit 4388f887b857de8576a8bf7fefc1202dc7dd10df Author: Greg Kroah-Hartman Date: Wed Apr 27 16:19:05 2022 +0200 Revert "firmware_loader: use kernel credentials when reading firmware" This reverts commit 3677563eb8731e1ad5970e3e57f74e5f9d63502a as it leaks memory :( Reported-by: Qian Cai Link: https://lore.kernel.org/r/20220427135823.GD71@qian Cc: Thiébaud Weksteen Cc: Luis Chamberlain Cc: John Stultz Signed-off-by: Greg Kroah-Hartman commit 138a7f9c6beae8d652113b8e7a44994b4200bbcd Author: Thomas Gleixner Date: Fri Apr 15 21:19:53 2022 +0200 x86/aperfmperf: Separate AP/BP frequency invariance init This code is convoluted and because it can be invoked post init via the ACPI/CPPC code, all of the initialization functionality is built in instead of being part of init text and init data. As a first step create separate calls for the boot and the application processors. Signed-off-by: Thomas Gleixner Reviewed-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.536733494@linutronix.de commit 55cb0b70749361d7f82a979768c77ac301f07da9 Author: Thomas Gleixner Date: Fri Apr 15 21:19:51 2022 +0200 x86/smp: Move APERF/MPERF code where it belongs as this can share code with the preexisting APERF/MPERF code. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.478362457@linutronix.de commit 6d108c96bf23598cc3b4f91d60e9b7694abcd2a7 Author: Thomas Gleixner Date: Fri Apr 15 21:19:50 2022 +0200 x86/aperfmperf: Dont wake idle CPUs in arch_freq_get_on_cpu() aperfmperf_get_khz() already excludes idle CPUs from APERF/MPERF sampling and that's a reasonable decision. There is no point in sending up to two IPIs to an idle CPU just because someone reads a sysfs file. Signed-off-by: Thomas Gleixner Acked-by: Rafael J. Wysocki Acked-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20220415161206.419880163@linutronix.de commit d196d2a98d62c505ab71caf2630575e448dc417c Author: Vignesh Raghavendra Date: Thu Apr 21 11:49:38 2022 +0530 arm64: dts: ti: k3-am62-mcu: Enable MCU GPIO module AM62 has x1 GPIO module and associated interrupt router in MCU Domain. Add DT nodes for the same. Signed-off-by: Vignesh Raghavendra Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220421061938.122317-1-vigneshr@ti.com commit bd67e1be98ddb884ff3f3df95c2382e6e70930b6 Author: Vignesh Raghavendra Date: Tue Apr 19 11:59:02 2022 +0530 arm64: dts: ti: k3-am625-sk: Add ECAP APWM nodes AM62 has 3 ECAP instances with 1 APWM each. Add DT nodes for the same. Keep them disabled in am625-sk dts as these pins can be repurposed in user exp connector. Signed-off-by: Vignesh Raghavendra Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220419062902.196526-1-vigneshr@ti.com commit ef79970d7ccdc4e8855aa6079fc2f4797a6807fb Author: Tony Luck Date: Thu Mar 10 12:48:54 2022 -0800 x86/split-lock: Remove unused TIF_SLD bit Changes to the "warn" mode of split lock handling mean that TIF_SLD is never set. Remove the bit, and the functions that use it. Signed-off-by: Tony Luck Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220310204854.31752-3-tony.luck@intel.com commit b041b525dab95352fbd666b14dc73ab898df465f Author: Tony Luck Date: Thu Mar 10 12:48:53 2022 -0800 x86/split_lock: Make life miserable for split lockers In https://lore.kernel.org/all/87y22uujkm.ffs@tglx/ Thomas said: Its's simply wishful thinking that stuff gets fixed because of a WARN_ONCE(). This has never worked. The only thing which works is to make stuff fail hard or slow it down in a way which makes it annoying enough to users to complain. He was talking about WBINVD. But it made me think about how we use the split lock detection feature in Linux. Existing code has three options for applications: 1) Don't enable split lock detection (allow arbitrary split locks) 2) Warn once when a process uses split lock, but let the process keep running with split lock detection disabled 3) Kill process that use split locks Option 2 falls into the "wishful thinking" territory that Thomas warns does nothing. But option 3 might not be viable in a situation with legacy applications that need to run. Hence make option 2 much stricter to "slow it down in a way which makes it annoying". Primary reason for this change is to provide better quality of service to the rest of the applications running on the system. Internal testing shows that even with many processes splitting locks, performance for the rest of the system is much more responsive. The new "warn" mode operates like this. When an application tries to execute a bus lock the #AC handler. 1) Delays (interruptibly) 10 ms before moving to next step. 2) Blocks (interruptibly) until it can get the semaphore If interrupted, just return. Assume the signal will either kill the task, or direct execution away from the instruction that is trying to get the bus lock. 3) Disables split lock detection for the current core 4) Schedules a work queue to re-enable split lock detect in 2 jiffies 5) Returns The work queue that re-enables split lock detection also releases the semaphore. There is a corner case where a CPU may be taken offline while split lock detection is disabled. A CPU hotplug handler handles this case. Old behaviour was to only print the split lock warning on the first occurrence of a split lock from a task. Preserve that by adding a flag to the task structure that suppresses subsequent split lock messages from that task. Signed-off-by: Tony Luck Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220310204854.31752-2-tony.luck@intel.com commit 01c3f0387c638127fddc1849cb2bdee7f50d88f3 Author: Krzysztof Kozlowski Date: Wed Apr 27 15:11:54 2022 +0200 interconnect: qcom: sc8280xp: constify qcom_icc_bcm pointers Pointers to struct qcom_icc_bcm are not modified, so they can be made const for safety. The contents of struct qcom_icc_bcm must stay non-const. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220427131154.302581-3-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit fcb3cd7e3af9df45d01066fced068ccdb0f1c283 Author: Krzysztof Kozlowski Date: Wed Apr 27 15:11:53 2022 +0200 interconnect: qcom: sc8280xp: constify icc_node pointers Pointers to struct qcom_icc_node (and similar structures) are not modified, so they can be made const for safety. The contents of struct qcom_icc_node must stay non-const. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220427131154.302581-2-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 3d28502d529112ac91a9d400bf13fefe9653c9b5 Author: Krzysztof Kozlowski Date: Wed Apr 27 15:11:52 2022 +0200 interconnect: qcom: sc8280xp: constify qcom_icc_desc struct qcom_icc_desc is not modified so it can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220427131154.302581-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 9ce170dc9c08895846c5828addb724e42bf98484 Author: Tinghan Shen Date: Wed Apr 27 15:10:30 2022 +0800 ASoC: SOF: mediatek: Fix allyesconfig build error ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x18): multiple definition of `adsp_clock_on'; sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x60): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function `.adsp_clock_on': ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o:(.opd+0x30): multiple definition of `adsp_clock_off'; sound/soc/sof/mediatek/mt8195/mt8195-clk.o:(.opd+0x78): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-clk.o: in function `.adsp_clock_off': ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x0): multiple definition of `sof_hifixdsp_boot_sequence'; sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x0): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function `.sof_hifixdsp_boot_sequence': ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o:(.opd+0x18): multiple definition of `sof_hifixdsp_shutdown'; sound/soc/sof/mediatek/mt8195/mt8195-loader.o:(.opd+0x18): first defined here ld: sound/soc/sof/mediatek/mt8186/mt8186-loader.o: in function `.sof_hifixdsp_shutdown': Fixes: 570c14dc92d5 ("ASoC: SOF: mediatek: Add mt8186 sof fw loader and dsp ops") Fixes: 210b3ab932f7 ("ASoC: SOF: mediatek: Add mt8186 dsp clock support") Signed-off-by: Tinghan Shen Link: https://lore.kernel.org/r/20220427071030.10172-1-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 79fc62d6b2c278bffafc24a22fa4638edcae1aa9 Author: Amadeusz Sławiński Date: Tue Apr 26 22:05:39 2022 +0200 ASoC: Intel: avs: Drop direct ACPI dependency With previous patch this allows for building driver on architectures without ACPI support present, when building with COMPILE_TEST enabled. Fixes: 47a1886a610a ("ASoC: Intel: avs: Enable AVS driver only on x86 platforms") Reported-by: kernel test robot Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220426200539.894010-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 2d3694fdeef599ef5a1352b699bdd493a51ab8cb Author: Amadeusz Sławiński Date: Tue Apr 26 22:05:38 2022 +0200 ALSA: hda: intel-nhlt: Move structs out of #define block As functions prototypes regerdless of CONFIG options as well as some code depend on structures defined in sound/intel-nhlt.h header, move them out of #define block. This allows to compile code depending on mentioned header with "depends on ACPI || COMPILE_TEST" in Kconfig. Fixes: 47a1886a610a ("ASoC: Intel: avs: Enable AVS driver only on x86 platforms") Reported-by: kernel test robot Suggested-by: Pierre-Louis Bossart Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220426200539.894010-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 5ab1679d6aab2e7855cd9241d4d832d1cda0ca46 Author: YC Hung Date: Tue Apr 26 13:34:59 2022 -0500 ASoC: SOF: mediatek: mt8195 change ipc timeout as 1 second The IPC message sending can take longer than the default 500ms during system boot up due to the concurrent loading of different drivers. Increase the IPC timeout to 1 second to avoid timeout errors due to Linux load and scheduling. Reviewed-by: Curtis Malainey Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220426183459.102251-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit afe57ecab58b976c54fcbc31d718f936a0cc98cc Author: Pierre-Louis Bossart Date: Tue Apr 26 13:36:31 2022 -0500 ASoC: SOF: bump SOF_ABI_MINOR Commit a0f84dfb3f6d9 ("ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags") did not update the SOF_ABI_MINOR, bump to version 20 before new changes are added. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220426183631.102356-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fd2cea169c4bc01f88bca84e4f01df48901c4339 Author: Peter Ujfalusi Date: Wed Apr 27 14:51:59 2022 +0300 ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path The cl_dsp_init() returns 0 on success or negative errno on error. Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for success. Fixes: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence") Reported-by: Dan Carpenter Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220427115159.26177-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit d879e9444634e3ef7cc5646fca0892c4f1483a8d Author: Pierre-Louis Bossart Date: Tue Apr 26 13:38:07 2022 -0500 ASoC: Intel: atom: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_sync() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426183807.102442-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 02885dd831c043d4804dfc1d2942f2f4ec5fdc18 Author: Pierre-Louis Bossart Date: Tue Apr 26 13:41:06 2022 -0500 ASoC: SOF: sof-client-ipc-msg-injector: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426184106.102636-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c106f46e83fd15c34cfa0a68e8218f5cb4844dd3 Author: Pierre-Louis Bossart Date: Tue Apr 26 13:41:04 2022 -0500 ASoC: SOF: debug: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426184106.102636-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bf0736e5d4644eb9238a1136625e09126721d2e3 Author: Pierre-Louis Bossart Date: Tue Apr 26 13:41:03 2022 -0500 ASoC: SOF: control: use pm_runtime_resume_and_get() Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_noidle() pattern. No functional changes. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220426184106.102636-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0d897255e79e26f471d10bbf72db9eee6f9cb723 Author: Michael Ellerman Date: Thu Apr 7 00:57:59 2022 +1000 powerpc/85xx: Fix virt_to_phys() off-by-one in smp_85xx_start_cpu() In smp_85xx_start_cpu() we are passed an address but we're unsure if it's a real or virtual address, so there's a check to determine that. The check has an off-by-one in that it tests if the address is greater than high_memory, but high_memory is the first address of high memory, so the check should be greater-or-equal. It seems this has never been a problem in practice, but it also triggers the DEBUG_VIRTUAL checks in __pa() which we would like to avoid. We can fix both issues by converting high_memory - 1 to a physical address and testing against that. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406145802.538416-3-mpe@ellerman.id.au commit b0b592cf08367719e1d1ef07c9f136e8c17f7ec3 Author: Matthieu Baerts Date: Sat Apr 23 20:24:10 2022 +0200 x86/pm: Fix false positive kmemleak report in msr_build_context() Since e2a1256b17b1 ("x86/speculation: Restore speculation related MSRs during S3 resume") kmemleak reports this issue: unreferenced object 0xffff888009cedc00 (size 256): comm "swapper/0", pid 1, jiffies 4294693823 (age 73.764s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 48 00 00 00 00 00 00 00 ........H....... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: msr_build_context (include/linux/slab.h:621) pm_check_save_msr (arch/x86/power/cpu.c:520) do_one_initcall (init/main.c:1298) kernel_init_freeable (init/main.c:1370) kernel_init (init/main.c:1504) ret_from_fork (arch/x86/entry/entry_64.S:304) Reproducer: - boot the VM with a debug kernel config (see https://github.com/multipath-tcp/mptcp_net-next/issues/268) - wait ~1 minute - start a kmemleak scan The root cause here is alignment within the packed struct saved_context (from suspend_64.h). Kmemleak only searches for pointers that are aligned (see how pointers are scanned in kmemleak.c), but pahole shows that the saved_msrs struct member and all members after it in the structure are unaligned: struct saved_context { struct pt_regs regs; /* 0 168 */ /* --- cacheline 2 boundary (128 bytes) was 40 bytes ago --- */ u16 ds; /* 168 2 */ ... u64 misc_enable; /* 232 8 */ bool misc_enable_saved; /* 240 1 */ /* Note below odd offset values for the remainder of this struct */ struct saved_msrs saved_msrs; /* 241 16 */ /* --- cacheline 4 boundary (256 bytes) was 1 bytes ago --- */ long unsigned int efer; /* 257 8 */ u16 gdt_pad; /* 265 2 */ struct desc_ptr gdt_desc; /* 267 10 */ u16 idt_pad; /* 277 2 */ struct desc_ptr idt; /* 279 10 */ u16 ldt; /* 289 2 */ u16 tss; /* 291 2 */ long unsigned int tr; /* 293 8 */ long unsigned int safety; /* 301 8 */ long unsigned int return_address; /* 309 8 */ /* size: 317, cachelines: 5, members: 25 */ /* last cacheline: 61 bytes */ } __attribute__((__packed__)); Move misc_enable_saved to the end of the struct declaration so that saved_msrs fits in before the cacheline 4 boundary. The comment above the saved_context declaration says to fix wakeup_64.S file and __save/__restore_processor_state() if the struct is modified: it looks like all the accesses in wakeup_64.S are done through offsets which are computed at build-time. Update that comment accordingly. At the end, the false positive kmemleak report is due to a limitation from kmemleak but it is always good to avoid unaligned members for optimisation purposes. Please note that it looks like this issue is not new, e.g. https://lore.kernel.org/all/9f1bb619-c4ee-21c4-a251-870bd4db04fa@lwfinger.net/ https://lore.kernel.org/all/94e48fcd-1dbd-ebd2-4c91-f39941735909@molgen.mpg.de/ [ bp: Massage + cleanup commit message. ] Fixes: 7a9c2dd08ead ("x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume") Suggested-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: Borislav Petkov Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220426202138.498310-1-matthieu.baerts@tessares.net commit c2106a231c2ba36ff9af50cdf2867b9a5f8150a6 Author: Brijesh Singh Date: Fri Apr 22 08:56:24 2022 -0500 x86/sev: Get the AP jump table address from secrets page The GHCB specification section 2.7 states that when SEV-SNP is enabled, a guest should not rely on the hypervisor to provide the address of the AP jump table. Instead, if a guest BIOS wants to provide an AP jump table, it should record the address in the SNP secrets page so the guest operating system can obtain it directly from there. Fix this on the guest kernel side by having SNP guests use the AP jump table address published in the secrets page rather than issuing a GHCB request to get it. [ mroth: - Improve error handling when ioremap()/memremap() return NULL - Don't mix function calls with declarations - Add missing __init - Tweak commit message ] Fixes: 0afb6b660a6b ("x86/sev: Use SEV-SNP AP creation to start secondary CPUs") Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220422135624.114172-3-michael.roth@amd.com commit 75d359ec4141b013727022a663762931f69e6510 Author: Michael Roth Date: Fri Apr 22 08:56:23 2022 -0500 x86/sev: Add missing __init annotations to SEV init routines Currently, get_secrets_page() is only reachable from the following call chain: __init snp_init_platform_device(): get_secrets_page() so mark it as __init as well. This is also needed since it calls early_memremap(), which is also an __init routine. Similarly, get_jump_table_addr() is only reachable from the following call chain: __init setup_real_mode(): sme_sev_setup_real_mode(): sev_es_setup_ap_jump_table(): get_jump_table_addr() so mark get_jump_table_addr() and everything up that call chain as __init as well. This is also needed since future patches will add a call to get_secrets_page(), which needs to be __init due to the reasons stated above. Suggested-by: Borislav Petkov Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220422135624.114172-2-michael.roth@amd.com commit d63670d23e60f00210635ca7c62bce27bec55f1b Author: Tom Lendacky Date: Wed Apr 20 09:14:14 2022 -0500 virt: sevguest: Rename the sevguest dir and files to sev-guest Rename the drivers/virt/coco/sevguest directory and files to sev-guest so as to match the driver name. [ bp: Rename Documentation/virt/coco/sevguest.rst too, as reported by sfr: https://lore.kernel.org/r/20220427101059.3bf55262@canb.auug.org.au ] Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/2f5c9cb16e3a67599c8e3170f6c72c8712c47d53.1650464054.git.thomas.lendacky@amd.com commit 03fa8fc93e443e6caa485cc741328a1386c63630 Merge: 95ccb04192cd1 865e2eb08f518 Author: David S. Miller Date: Wed Apr 27 12:22:56 2022 +0100 Merge branch 'remove-virt_to_bus-drivers' Jakub Kicinski says: ==================== net: remove non-Ethernet drivers using virt_to_bus() Networking is currently the main offender in using virt_to_bus(). Frankly all the drivers which use it are super old and unlikely to be used today. They are just an ongoing maintenance burden. In other words this series is using virt_to_bus() as an excuse to shed some old stuff. Having done the tree-wide dev_addr_set() conversion recently I have limited sympathy for carrying dead code. Obviously please scream if any of these drivers _is_ in fact still being used. Otherwise let's take the chance, we can always apologize and revert if users show up later. Also I should say thanks to everyone who contributed to this code! The work continues to be appreciated although realistically in more of a "history book" fashion... ==================== Signed-off-by: David S. Miller commit 865e2eb08f51820bdefa37a80abe771b5979d440 Author: Jakub Kicinski Date: Tue Apr 26 10:54:36 2022 -0700 net: hamradio: remove support for DMA SCC devices Another incarnation of Z8530, looks like? Again, no real changes in the git history, and it needs VIRT_TO_BUS. Unlikely to have users, let's spend less time refactoring dead code... Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit bc6df26f1f785be9b4c10d37e50ac40b46428984 Author: Jakub Kicinski Date: Tue Apr 26 10:54:35 2022 -0700 net: wan: remove support for Z85230-based devices Looks like all the changes to this driver had been automated churn since git era begun. The driver is using virt_to_bus(), it's just a maintenance burden unlikely to have any users. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 89fbca3307d40d5a48bc41919a543dc46298cf7a Author: Jakub Kicinski Date: Tue Apr 26 10:54:34 2022 -0700 net: wan: remove support for COSA and SRP synchronous serial boards Looks like all the changes to this driver had been automated churn since git era begun. The driver is using virt_to_bus() so it should be updated to a proper DMA API or removed. Given the latest "news" entry on the website is from 1999 I'm opting for the latter. I'm marking the allocated char device major number as [REMOVED], I reckon we can't reuse it in case some SW out there assumes its COSA? Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 052e1f01bfae8be6f31b61ed3a2356edfca855dc Author: Jakub Kicinski Date: Tue Apr 26 10:54:33 2022 -0700 net: atm: remove support for ZeitNet ZN122x ATM devices This driver received nothing but automated fixes in the last 15 years. Since it's using virt_to_bus it's unlikely to be used on any modern platform. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5b74a20d35ab8ff05c2111233bb069eb7fcea4e9 Author: Jakub Kicinski Date: Tue Apr 26 10:54:32 2022 -0700 net: atm: remove support for Madge Horizon ATM devices This driver received nothing but automated fixes since git era begun. Since it's using virt_to_bus it's unlikely to be used on any modern platform. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 41c335c8212387a7563b0eb7f885591ad49970be Author: Jakub Kicinski Date: Tue Apr 26 10:54:31 2022 -0700 net: atm: remove support for Fujitsu FireStream ATM devices This driver received nothing but automated fixes (mostly spelling and compiler warnings) since git era begun. Since it's using virt_to_bus it's unlikely to be used on any modern platform. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 95ccb04192cd16aea1338ad5ad25e96c39cf8486 Merge: 124de27101ffe f3d8e0a9c28ba Author: David S. Miller Date: Wed Apr 27 12:03:18 2022 +0100 Merge branch 'lan966x-ptp-programmable-pins' Horatiu Vultur says: ==================== net: lan966x: Add support for PTP programmable pins Lan966x has 8 PTP programmable pins. The last pin is hardcoded to be used by PHC0 and all the rest are shareable between the PHCs. The PTP pins can implement both extts and perout functions. v1->v2: - use ptp_find_pin_unlocked instead of ptp_find_pin inside the irq handler. ==================== Signed-off-by: David S. Miller commit f3d8e0a9c28ba0bb3716dd5e8697a075ea36fdd8 Author: Horatiu Vultur Date: Wed Apr 27 08:51:27 2022 +0200 net: lan966x: Add support for PTP_PF_EXTTS Extend the PTP programmable pins to implement also PTP_PF_EXTTS function. The PTP pin can be configured to capture only on the rising edge of the PPS signal. And once an event is seen then an interrupt is generated and the local time counter is saved. The interrupt is shared between all the pins. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2b7ff2588ec21dde8a3a66dc927e4e653b175ddb Author: Horatiu Vultur Date: Wed Apr 27 08:51:26 2022 +0200 net: lan966x: Add support for PTP_PF_PEROUT Lan966x has 8 PTP programmable pins, where the last pins is hardcoded to be used by PHC0, which does the frame timestamping. All the rest of the PTP pins can be shared between the PHCs and can have different functions like perout or extts. For now add support for PTP_FS_PEROUT. The HW is not able to support absolute start time but can use the nsec for phase adjustment when generating PPS. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 3adc11e5fc5fc0925aa298c8ef327224459f80bf Author: Horatiu Vultur Date: Wed Apr 27 08:51:25 2022 +0200 net: lan966x: Add registers used to configure the PTP pin Add registers that are used to configure the PTP pins. These registers are used to enable the interrupts per PTP pin and to set the waveform generated by the pin. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 77f2accb501ab7ff3d734bbf09b5872cba4285f1 Author: Horatiu Vultur Date: Wed Apr 27 08:51:24 2022 +0200 net: lan966x: Change the PTP pin used to read/write the PHC. To read/write a value to a PHC, it is required to use a PTP pin. Currently it is used pin 5, but change to pin 7 as is the last pin. All the other pins will have different functions. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit c1a519919d041f058a4451e93d7cf7c879f1a8b0 Author: Horatiu Vultur Date: Wed Apr 27 08:51:23 2022 +0200 dt-bindings: net: lan966x: Extend with the ptp external interrupt. Extend dt-bindings for lan966x with ptp external interrupt. This is generated when an external 1pps signal is received on the ptp pin. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 6260f6427c944279f8aca108140db900699a30de Author: Pingfan Liu Date: Fri Apr 22 18:02:12 2022 +0800 s390/irq: utilize RCU instead of irq_lock_sparse() in show_msi_interrupt() As demonstrated by commit 74bdf7815dfb ("genirq: Speedup show_interrupts()"), irq_desc can be accessed safely in RCU read section. Hence here resorting to rcu read lock to get rid of irq_lock_sparse(). Signed-off-by: Pingfan Liu Link: https://lore.kernel.org/r/20220422100212.22666-1-kernelfans@gmail.com Signed-off-by: Heiko Carstens commit d19a66ae488afe23398090b5dbe5483b26863e13 Author: Vignesh Raghavendra Date: Wed Apr 27 12:59:54 2022 +0530 arm64: dts: ti: k3-am625-sk: Enable on board peripherals Add nodes for I2C IO expander, OSPI Flash, Eth PHYs, SD and eMMC that are present on AM625 SK board. Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220427072954.8821-3-vigneshr@ti.com commit c37c58fdeb8a9ddaff2ae512bf738ac7a5d3cd2e Author: Vignesh Raghavendra Date: Wed Apr 27 12:59:53 2022 +0530 arm64: dts: ti: k3-am62: Add more peripheral nodes Add nodes for McSPI, OSPI, DMA, CPSW, MMC and On Chip SRAM nodes. Signed-off-by: Vignesh Raghavendra Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220427072954.8821-2-vigneshr@ti.com commit 065d62612e264e228c153afe9aa31d85aeea3d17 Author: Kishon Vijay Abraham I Date: Thu Apr 14 19:06:12 2022 +0530 arm64: dts: ti: k3-am642-sk: Enable WLAN connected to SDHCI0 WL1837 module is connected to SDHCI0 in AM642 SK. Enable it here. This will enable the WiFi functionaliy on the board. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Vignesh Raghavendra Signed-off-by: Nikhil Devshatwar Signed-off-by: Aparna M Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220414133612.13365-1-a-m1@ti.com commit 439677d416b17dd39964d5f7d64b742a2e51da5b Author: Matthias Schiffer Date: Tue Apr 19 09:51:57 2022 +0200 arm64: dts: ti: k3-am64-mcu: remove incorrect UART base clock rates We found that (at least some versions of) the sci-fw set the base clock rate for UARTs in the MCU domain to 96 MHz instead of the expected 48 MHz, leading to incorrect baud rates when used from Linux. As the 8250_omap driver will query the actual clock rate from the clk driver when clock-frequency is unset, removing the incorrect property is sufficient to fix the baud rate. Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC") Signed-off-by: Matthias Schiffer Signed-off-by: Vignesh Raghavendra Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220419075157.189347-1-matthias.schiffer@ew.tq-group.com commit 124de27101ffec33a1eb6ccf0eff89a1a9b999a8 Merge: b1190d5175acb 53f368bfff31b Author: David S. Miller Date: Wed Apr 27 10:45:55 2022 +0100 Merge branch 'mptcp-MP_FAIL-timeout' Mat Martineau says: ==================== mptcp: Timeout for MP_FAIL response When one peer sends an infinite mapping to coordinate fallback from MPTCP to regular TCP, the other peer is expected to send a packet with the MPTCP MP_FAIL option to acknowledge the infinite mapping. Rather than leave the connection in some half-fallback state, this series adds a timeout after which the infinite mapping sender will reset the connection. Patch 1 adds a fallback self test. Patches 2-5 make use of the MPTCP socket's retransmit timer to reset the MPTCP connection if no MP_FAIL was received. Patches 6 and 7 extends the self test to check MP_FAIL-related MIBs. ==================== Signed-off-by: David S. Miller commit 53f368bfff31be43ad78fecfb04d0e4c0ebceef5 Author: Geliang Tang Date: Tue Apr 26 14:57:17 2022 -0700 selftests: mptcp: print extra msg in chk_csum_nr When the multiple checksum errors occur in chk_csum_nr(), print the numbers of the errors as an extra message. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1f7d325f7d4944db022358a6f0dfe4fc206a6ced Author: Geliang Tang Date: Tue Apr 26 14:57:16 2022 -0700 selftests: mptcp: check MP_FAIL response mibs This patch extends chk_fail_nr to check the MP_FAIL response mibs. Add a new argument invert for chk_fail_nr to allow it can check the MP_FAIL TX and RX mibs from the opposite direction. When the infinite map is received before the MP_FAIL response, the response will be lost. A '-' can be added into fail_tx or fail_rx to represent that MP_FAIL response TX or RX can be lost when doing the checks. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 49fa1919d6bcdcf3cf3d080c1943f537f6ed5e70 Author: Geliang Tang Date: Tue Apr 26 14:57:15 2022 -0700 mptcp: reset subflow when MP_FAIL doesn't respond This patch adds a new msk->flags bit MPTCP_FAIL_NO_RESPONSE, then reuses sk_timer to trigger a check if we have not received a response from the peer after sending MP_FAIL. If the peer doesn't respond properly, reset the subflow. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 9c81be0dbc89ccb76ce34c3a88425bf3a0d57ebb Author: Geliang Tang Date: Tue Apr 26 14:57:14 2022 -0700 mptcp: add MP_FAIL response support This patch adds a new struct member mp_fail_response_expect in struct mptcp_subflow_context to support MP_FAIL response. In the single subflow with checksum error and contiguous data special case, a MP_FAIL is sent in response to another MP_FAIL. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4293248c6704b854bf816aa1967e433402bee11c Author: Geliang Tang Date: Tue Apr 26 14:57:13 2022 -0700 mptcp: add data lock for sk timers mptcp_data_lock() needs to be held when manipulating the msk retransmit_timer or the sk sk_timer. This patch adds the data lock for the both timers. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit bcf3cf93f64597fd3ccdcf79000f064b0c7dc943 Author: Geliang Tang Date: Tue Apr 26 14:57:12 2022 -0700 mptcp: use mptcp_stop_timer Use the helper mptcp_stop_timer() instead of using sk_stop_timer() to stop icsk_retransmit_timer directly. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit b6e074e171bc5cc83eb91b03c2558c2d9fccf26e Author: Geliang Tang Date: Tue Apr 26 14:57:11 2022 -0700 selftests: mptcp: add infinite map testcase Add the single subflow test case for MP_FAIL, to test the infinite mapping case. Use the test_linkfail value to make 128KB test files. Add a new function reset_with_fail(), in it use 'iptables' and 'tc action pedit' rules to produce the bit flips to trigger the checksum failures. Set validate_checksum to enable checksums for the MP_FAIL tests without passing the '-C' argument. Set check_invert flag to enable the invert bytes check for the output data in check_transfer(). Instead of the file mismatch error, this test prints out the inverted bytes. Add a new function pedit_action_pkts() to get the numbers of the packets edited by the tc pedit actions. Print this numbers to the output. Also add the needed kernel configures in the selftests config file. Suggested-by: Davide Caratti Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit d95ab6d2afdcbcd18d9b236219bcc666446f324c Author: Cixi Geng Date: Wed Apr 27 15:52:12 2022 +0800 mfd: sprd: Jugle {of,spi}_device_id tables into numerical order Ordered with the smallest number at the top. Signed-off-by: Cixi Geng Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220427075212.3409407-1-gengcixi@gmail.com commit 37841975b32236c6590f03e6d114f953edf5b63b Author: Tudor Ambarus Date: Wed Apr 20 13:34:27 2022 +0300 mtd: spi-nor: micron-st: Remove status polling on volatile registers write Writing volatile registers are instant according to Micron and do not need any status polling. Remove status polling on volatile registers write. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-12-tudor.ambarus@microchip.com commit 467f0e83818aebd3a4c81952f37c2734a7262fb2 Author: Tudor Ambarus Date: Wed Apr 20 13:34:26 2022 +0300 mtd: spi-nor: spansion: Remove status polling on volatile registers write Writing volatile registers are instant according to Cypress and do not need any status polling. Remove status polling on volatile registers write. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-11-tudor.ambarus@microchip.com commit c0abb861c5d040ae2d55832829f4bf0c5aab6daa Author: Tudor Ambarus Date: Wed Apr 20 13:34:25 2022 +0300 mtd: spi-nor: Introduce templates for SPI NOR operations Clean the op declaration and hide the details of each op. With this it results a cleanner, easier to read code. No functional change expected. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Acked-by: Michael Walle Acked-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220420103427.47867-10-tudor.ambarus@microchip.com commit 27ff0d34fb7e4c2a37c724d5c5ca8209c8bb5723 Author: Tudor Ambarus Date: Wed Apr 20 13:34:24 2022 +0300 mtd: spi-nor: spansion: Rework spi_nor_cypress_octal_dtr_enable() Introduce template operation to remove code duplication. Split spi_nor_cypress_octal_dtr_enable() in spi_nor_cypress_octal_dtr_ena() spi_nor_cypress_octal_dtr_dis() as it no longer made sense to try to keep everything alltogether: too many "if (enable)" throughout the code, which made the code difficult to read. Add debug messages in case spi_nor_read_id() fails. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-9-tudor.ambarus@microchip.com commit 4629adaff7bca453757f4df235e533ad460baa28 Author: Tudor Ambarus Date: Wed Apr 20 13:34:23 2022 +0300 mtd: spi-nor: micron-st: Rework spi_nor_micron_octal_dtr_enable() Introduce template operation to remove code duplication. Split spi_nor_micron_octal_dtr_enable() in spi_nor_micron_octal_dtr_en() and spi_nor_micron_octal_dtr_dis() as it no longer made sense to try to keep everything alltogether: too many "if (enable)" throughout the code, which made the code difficult to follow. Add dev_dbg messages in case spi_nor_read_id() fails. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-8-tudor.ambarus@microchip.com commit a604ab33cb4a32e12f17b43385fdeea551ce8edc Author: Tudor Ambarus Date: Wed Apr 20 13:34:22 2022 +0300 mtd: spi-nor: core: Add helpers to read/write any register There are manufacturers that use registers indexed by address. Some of them support "read/write any register" opcodes. Provide core methods that can be used by all manufacturers. SPI NOR controller ops are intentionally not supported as we intend to move all the SPI NOR controller drivers under the SPI subsystem. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Tested-by: Takahiro Kuwano Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-7-tudor.ambarus@microchip.com commit a007d81aa5255c8796f763a64db8c397fc252bb6 Author: Tudor Ambarus Date: Wed Apr 20 13:34:21 2022 +0300 mtd: spi-nor: manufacturers: Use spi_nor_read_id() core method Use spi_nor_read_id() core method to avoid duplication of code. Now the ID is read on the full SPI_NOR_MAX_ID_LEN instead of round_up(nor->info->id_len, 2), but it doesn't harm to read more ID bytes, so the change comes with no secondary effects. dev_dbg messages in case spi_nor_read_id() fails, will be added in a further patch after we split the octal DTR enable/disable methods. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-6-tudor.ambarus@microchip.com commit 86b6b55ffbbc0df2c8e3c1d62fd12388737225f6 Author: Tudor Ambarus Date: Wed Apr 20 13:34:20 2022 +0300 mtd: spi-nor: core: Introduce method for RDID op RDID is used in the core to auto detect the flash, but also by some manufacturer drivers that contain flashes that support Octal DTR mode, so that they can read the flash ID after the switch to Octal DTR was made to test if the switch was successful. Introduce a core method for RDID op to avoid code duplication. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-5-tudor.ambarus@microchip.com commit bffabd1c727d663adf67ea762acc0e57164b3281 Author: Tudor Ambarus Date: Wed Apr 20 13:34:19 2022 +0300 mtd: spi-nor: core: Use auto-detection only once In case spi_nor_match_name() returned NULL, the auto detection was issued twice. There's no reason to try to detect the same chip twice, do the auto detection only once. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-4-tudor.ambarus@microchip.com commit d0ddd88438d242de0de58b24eb9422e4ba183023 Author: Tudor Ambarus Date: Wed Apr 20 13:34:18 2022 +0300 mtd: spi-nor: Introduce spi_nor_match_id() Similar to spi_nor_match_name() extend the search of flash_info through all the manufacturers, this time doing the match by ID. There's no reason to limit the search per manufacturer yet, do it globally, search the flash in all the parts of all manufacturers in a single method. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-3-tudor.ambarus@microchip.com commit b1145d6f1e8a6575c88a2e6b7e2d84ebd4f5f4fb Author: Tudor Ambarus Date: Wed Apr 20 13:34:17 2022 +0300 mtd: spi-nor: Rename method, s/spi_nor_match_id/spi_nor_match_name The method is matching a flash_info entry by searching by name. Rename the method for better clarity. Signed-off-by: Tudor Ambarus Signed-off-by: Pratyush Yadav Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20220420103427.47867-2-tudor.ambarus@microchip.com commit 70dd83d737d8900b2d98db6dc6b928c596334d37 Author: Chen-Tsung Hsieh Date: Wed Jan 26 15:32:26 2022 +0800 mtd: spi-nor: core: Check written SR value in spi_nor_write_16bit_sr_and_check() Read back Status Register 1 to ensure that the written byte match the received value and return -EIO if read back test failed. Without this patch, spi_nor_write_16bit_sr_and_check() only check the second half of the 16bit. It causes errors like spi_nor_sr_unlock() return success incorrectly when spi_nor_write_16bit_sr_and_check() doesn't write SR successfully. Fixes: 39d1e3340c73 ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()") Signed-off-by: Chen-Tsung Hsieh Signed-off-by: Pratyush Yadav Reviewed-by: Michael Walle Reviewed-by: Tudor Ambarus Acked-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220126073227.3401275-1-chentsung@chromium.org commit 7671f9674b474505de289b548206ef48b0f5ceac Author: Aidan MacDonald Date: Mon Apr 11 16:53:15 2022 +0100 mips: dts: ingenic: x1000: Add PWM device tree node Copied from the jz4740 devicetree and trimmed to 5 timers, which is what the hardware supports. Signed-off-by: Aidan MacDonald Tested-by: 周琰杰 (Zhou Yanjie) Signed-off-by: Thomas Bogendoerfer commit 860f39bea3194ee227e0937dd0ebf1e53cc21cc1 Author: Michael Walle Date: Wed Apr 20 21:50:18 2022 +0200 MIPS: mscc: serval: 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 Signed-off-by: Thomas Bogendoerfer commit ee5930c99a193481edee56c09ef8b71a06a242e6 Author: Michael Walle Date: Wed Apr 20 21:50:17 2022 +0200 MIPS: mscc: ocelot: 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 Signed-off-by: Thomas Bogendoerfer commit 3949aaa608f37f93d9648e4c68f1c113269dac53 Author: Michael Walle Date: Wed Apr 20 21:50:16 2022 +0200 MIPS: mscc: jaguar2: 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 Signed-off-by: Thomas Bogendoerfer commit d9a683f57b5b4ba9814a49963346cadf562dad2f Author: Arınç ÜNAL Date: Mon Apr 11 14:20:49 2022 +0300 mips: dts: ralink: mt7621: remove defining gpio function for pin groups All pin groups function as gpio unless set otherwise. Therefore, remove this unnecessary binding. Tested on UniElec U7621-06-16M on OpenWrt. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 6faf0dbdc61d33db27e2933c519e384419ad9dbb Author: Arınç ÜNAL Date: Mon Apr 11 14:20:48 2022 +0300 mips: dts: ralink: mt7621: mux phy4 to gmac1 for GB-PC1 Mux the MT7530 switch's phy4 to the SoC's gmac1 on the GB-PC1 devicetree. This achieves 2 Gbps total bandwidth to the CPU using the second RGMII. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit a5ad2e8fee3857c230d6b875531a273d01555fbf Author: Arınç ÜNAL Date: Mon Apr 11 14:20:47 2022 +0300 mips: dts: ralink: mt7621: add mdio label to mdio-bus Add mdio label to the mdio-bus node to easily refer to it. Use the newly created label on the GB-PC2 devicetree. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 5fe7856ad59afc56a6ff35d091bfaddd1d4f4bce Author: Philipp Hortmann Date: Wed Apr 27 07:42:18 2022 +0200 staging: vt6655: Replace MACvReadISR with VNSvInPortD Replace macro MACvReadISR with VNSvInPortD and as it was the only user, it can now be removed. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ddd403a3f590cb81403197442b12c3986c98ba25.1651036713.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit aa20e23426b3b72165389180c2f7c1a5babc4934 Author: Philipp Hortmann Date: Wed Apr 27 07:42:13 2022 +0200 staging: vt6655: Replace MACvReadMIBCounter with VNSvInPortD Replace macro MACvReadMIBCounter with VNSvInPortD and as it was the only user, it can now be removed. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e1b7156e2c689cf53c738642fd9b33816ec89f92.1651036713.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 987756f67dee237ec35f3b249ab1ae25260c5340 Author: Marc Bonnici Date: Tue Apr 26 13:12:19 2022 +0100 firmware: arm_ffa: Fix handling of fragmented memory descriptors Fix the handling of MEM_FRAG_TX/RX SMCs when the full memory descriptor does not fit in a single innovation of a memory sharing request. The current implementation expects a FFA_MEM_SHARE/FFA_MEM_LEND call to always receive a FFA_SUCCESS response, however in the case where a full descriptor does not fit inside the partitions TX buffer, the call can instead complete with a FFA_MEM_FRAG_RX SMC to request the next part of the descriptor to be transmitted. Similarly a FFA_MEM_FRAG_TX call currently only expects FFA_MEM_FRAG_RX as a response, however once the full descriptor has been transmitted the FFA_SUCCESS ABI will be used to indicate successful transmission. Update the existing code to match the expected behaviour. Link: https://lore.kernel.org/r/20220426121219.1801601-1-marc.bonnici@arm.com Signed-off-by: Marc Bonnici Signed-off-by: Sudeep Holla commit bd900901b8d1838bf1b6e63063e0025fca42d283 Author: Imran Khan Date: Thu Mar 24 21:30:39 2022 +1100 kernfs: Remove reference counting for kernfs_open_node. The decision to free kernfs_open_node object in kernfs_put_open_node can be taken based on whether kernfs_open_node->files list is empty or not. As far as kernfs_drain_open_files is concerned it can't overlap with kernfs_fops_open and hence can check for ->attr.open optimistically (if ->attr.open is NULL) or under kernfs_open_file_mutex (if it needs to traverse the ->files list.) Thus kernfs_drain_open_files can work w/o ref counting involved kernfs_open_node as well. So remove ->refcnt and modify the above mentioned users accordingly. Suggested by: Al Viro Signed-off-by: Imran Khan Link: https://lore.kernel.org/r/20220324103040.584491-2-imran.f.khan@oracle.com Signed-off-by: Greg Kroah-Hartman commit 6423d2951087231706246f81851067f7f0593d4a Author: Won Chung Date: Mon Mar 14 19:54:58 2022 +0000 driver core: Add sysfs support for physical location of a device When ACPI table includes _PLD fields for a device, create a new directory (physical_location) in sysfs to share _PLD fields. Currently without PLD information, when there are multiple of same devices, it is hard to distinguish which device corresponds to which physical device at which location. For example, when there are two Type C connectors, it is hard to find out which connector corresponds to the Type C port on the left panel versus the Type C port on the right panel. With PLD information provided, we can determine which specific device at which location is doing what. _PLD output includes much more fields, but only generic fields are added and exposed to sysfs, so that non-ACPI devices can also support it in the future. The minimal generic fields needed for locating a device are the following. - panel - vertical_position - horizontal_position - dock - lid Signed-off-by: Won Chung Link: https://lore.kernel.org/r/20220314195458.271430-1-wonchung@google.com Signed-off-by: Greg Kroah-Hartman commit ce753ad1549cbe9ccaea4c06a1f5fa47432c8289 Author: Sergey Shtylyov Date: Fri Mar 11 22:35:29 2022 +0300 platform: finally disallow IRQ0 in platform_get_irq() and its ilk The commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid") only calls WARN() when IRQ0 is about to be returned, however using IRQ0 is considered invalid (according to Linus) outside the arch/ code where it's used by the i8253 drivers. Many driver subsystems treat 0 specially (e.g. as an indication of the polling mode by libata), so the users of platform_get_irq[_byname]() in them would have to filter out IRQ0 explicitly and this (quite obviously) doesn't scale... Let's finally get this straight and return -EINVAL instead of IRQ0! Fixes: a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid") Acked-by: Marc Zyngier Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/025679e1-1f0a-ae4b-4369-01164f691511@omp.ru Signed-off-by: Greg Kroah-Hartman commit a72b6dff4089e6c3455e73ea97b08623b4fed699 Author: Miaohe Lin Date: Fri Apr 1 15:09:05 2022 +0800 drivers/base/node.c: fix compaction sysfs file leak Compaction sysfs file is created via compaction_register_node in register_node. But we forgot to remove it in unregister_node. Thus compaction sysfs file is leaked. Using compaction_unregister_node to fix this issue. Fixes: ed4a6d7f0676 ("mm: compaction: add /sys trigger for per-node memory compaction") Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220401070905.43679-1-linmiaohe@huawei.com Signed-off-by: Greg Kroah-Hartman commit 84e7c6786aad1dffa04f5729270f8fcd7281fe4b Author: Mark-PK Tsai Date: Wed Mar 16 15:43:28 2022 +0800 driver core: Prevent overriding async driver of a device before it probe When there are 2 matched drivers for a device using async probe mechanism, the dev->p->async_driver might be overridden by the last attached driver. So just skip the later one if the previous matched driver was not handled by async thread yet. Below is my use case which having this problem. Make both driver mmcblk and mmc_test allow async probe, the dev->p->async_driver will be overridden by the later driver mmc_test and bind to the device then claim it for testing. When it happen, mmcblk will never do probe again. Signed-off-by: Mark-PK Tsai Link: https://lore.kernel.org/r/20220316074328.1801-1-mark-pk.tsai@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 500ca2a10fb3744c3d0903d4e8747f9d0d3f474f Author: Tom Rix Date: Thu Apr 21 09:15:07 2022 -0400 drm/msm: change msm_sched_ops from global to static Smatch reports this issue msm_ringbuffer.c:43:36: warning: symbol 'msm_sched_ops' was not declared. Should it be static? msm_sched_ops is only used in msm_ringbuffer.c so change its storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482883/ Link: https://lore.kernel.org/r/20220421131507.1557667-1-trix@redhat.com Signed-off-by: Dmitry Baryshkov commit c46f0d69039c8bb6b9dbb20bc861d8166d565ec2 Author: Abhinav Kumar Date: Fri Apr 15 12:09:42 2022 -0700 drm/msm: remove unused hotplug and edid macros from msm_drv.h Remove unused MSM_DISPLAY_CAP_HOT_PLUG and MSM_DISPLAY_CAP_EDID macros from msm_drv.h. Even if we need these, there are drm equivalent ones present. Reported-by: Dmitry Baryshkov Signed-off-by: Abhinav Kumar Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/482260/ Link: https://lore.kernel.org/r/1650049782-8421-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Dmitry Baryshkov commit 875709f9787c7ee48a7539d2d578f09cbdba7380 Author: Cixi Geng Date: Mon Apr 25 21:24:10 2022 +0800 mfd: sprd: Add SC2730 PMIC to SPI device ID table Add the SC2730 PMIC support for module autoloading through SPI modalises. Signed-off-by: Cixi Geng Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220425132410.2708304-1-gengcixi@gmail.com commit a5f3aed5889eac9ed72f071dd439b9c671d1092f Author: Wan Jiabing Date: Sun Apr 24 17:45:50 2022 +0800 wil6210: simplify if-if to if-else Use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220424094552.105466-1-wanjiabing@vivo.com commit 7471f7d273ac51f044dad3d78af6afb87a14bb67 Author: Wan Jiabing Date: Sun Apr 24 17:45:22 2022 +0800 ath10k: simplify if-if to if-else Use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220424094522.105262-1-wanjiabing@vivo.com commit 66721bb4bbf25e990e003a2303ef86ce34556bac Author: Wen Gong Date: Wed Apr 20 22:35:01 2022 -0400 ath11k: read country code from SMBIOS for WCN6855/QCA6390 This read the country code from SMBIOS and send the country code to firmware, firmware will indicate the regulatory domain info of the country code and then ath11k will use the info. dmesg: [ 1242.637173] ath11k_pci 0000:02:00.0: chip_id 0x2 chip_family 0xb board_id 0xff soc_id 0x400c0200 [ 1242.637176] ath11k_pci 0000:02:00.0: fw_version 0x110b09e5 fw_build_timestamp 2021-06-22 09:32 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HSP.1.1-02533-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 [ 1242.637253] ath11k_pci 0000:02:00.0: worldwide regdomain setting from SMBIOS [ 1242.637259] ath11k_pci 0000:02:00.0: bdf variant name not found. [ 1242.637261] ath11k_pci 0000:02:00.0: SMBIOS bdf variant name not set. [ 1242.637263] ath11k_pci 0000:02:00.0: DT bdf variant name not set. [ 1242.927543] ath11k_pci 0000:02:00.0: set current country pdev id 0 alpha2 00 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/20220421023501.32167-1-quic_wgong@quicinc.com commit 161c64de239c7018e0295e7e0520a19f00aa32dc Author: Hari Chandrakanthan Date: Sat Apr 23 12:36:47 2022 +0300 ath11k: disable spectral scan during spectral deinit When ath11k modules are removed using rmmod with spectral scan enabled, crash is observed. Different crash trace is observed for each crash. Send spectral scan disable WMI command to firmware before cleaning the spectral dbring in the spectral_deinit API to avoid this crash. call trace from one of the crash observed: [ 1252.880802] Unable to handle kernel NULL pointer dereference at virtual address 00000008 [ 1252.882722] pgd = 0f42e886 [ 1252.890955] [00000008] *pgd=00000000 [ 1252.893478] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1253.093035] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.89 #0 [ 1253.115261] Hardware name: Generic DT based system [ 1253.121149] PC is at ath11k_spectral_process_data+0x434/0x574 [ath11k] [ 1253.125940] LR is at 0x88e31017 [ 1253.132448] pc : [<7f9387b8>] lr : [<88e31017>] psr: a0000193 [ 1253.135488] sp : 80d01bc8 ip : 00000001 fp : 970e0000 [ 1253.141737] r10: 88e31000 r9 : 970ec000 r8 : 00000080 [ 1253.146946] r7 : 94734040 r6 : a0000113 r5 : 00000057 r4 : 00000000 [ 1253.152159] r3 : e18cb694 r2 : 00000217 r1 : 1df1f000 r0 : 00000001 [ 1253.158755] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 1253.165266] Control: 10c0383d Table: 5e71006a DAC: 00000055 [ 1253.172472] Process swapper/0 (pid: 0, stack limit = 0x60870141) [ 1253.458055] [<7f9387b8>] (ath11k_spectral_process_data [ath11k]) from [<7f917fdc>] (ath11k_dbring_buffer_release_event+0x214/0x2e4 [ath11k]) [ 1253.466139] [<7f917fdc>] (ath11k_dbring_buffer_release_event [ath11k]) from [<7f8ea3c4>] (ath11k_wmi_tlv_op_rx+0x1840/0x29cc [ath11k]) [ 1253.478807] [<7f8ea3c4>] (ath11k_wmi_tlv_op_rx [ath11k]) from [<7f8fe868>] (ath11k_htc_rx_completion_handler+0x180/0x4e0 [ath11k]) [ 1253.490699] [<7f8fe868>] (ath11k_htc_rx_completion_handler [ath11k]) from [<7f91308c>] (ath11k_ce_per_engine_service+0x2c4/0x3b4 [ath11k]) [ 1253.502386] [<7f91308c>] (ath11k_ce_per_engine_service [ath11k]) from [<7f9a4198>] (ath11k_pci_ce_tasklet+0x28/0x80 [ath11k_pci]) [ 1253.514811] [<7f9a4198>] (ath11k_pci_ce_tasklet [ath11k_pci]) from [<8032227c>] (tasklet_action_common.constprop.2+0x64/0xe8) [ 1253.526476] [<8032227c>] (tasklet_action_common.constprop.2) from [<803021e8>] (__do_softirq+0x130/0x2d0) [ 1253.537756] [<803021e8>] (__do_softirq) from [<80322610>] (irq_exit+0xcc/0xe8) [ 1253.547304] [<80322610>] (irq_exit) from [<8036a4a4>] (__handle_domain_irq+0x60/0xb4) [ 1253.554428] [<8036a4a4>] (__handle_domain_irq) from [<805eb348>] (gic_handle_irq+0x4c/0x90) [ 1253.562321] [<805eb348>] (gic_handle_irq) from [<80301a78>] (__irq_svc+0x58/0x8c) Tested-on: QCN6122 hw1.0 AHB WLAN.HK.2.6.0.1-00851-QCAHKSWPL_SILICONZ-1 Signed-off-by: Hari Chandrakanthan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1649396345-349-1-git-send-email-quic_haric@quicinc.com commit 33b67a4b4e64275b6f2cbc4318f1596c70659111 Author: Manikanta Pubbisetty Date: Wed Apr 6 15:11:05 2022 +0530 ath11k: Update WBM idle ring HP after FW mode on Currently, WBM idle ring HP is updated much before the shadow configuration is sent to the FW. Any update to the shadow registers before FW mode on request would not be reflected on to the actual HW registers failing to bring up the device. Send FW mode ON QMI request before WBM idle ring HP update to fix this problem. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220406094107.17878-12-quic_mpubbise@quicinc.com commit 95959d702ede5fffd1abfcfa739b5179828cfe24 Author: Manikanta Pubbisetty Date: Wed Apr 6 15:11:04 2022 +0530 ath11k: WMI changes to support WCN6750 WCN6750 is a single PDEV non-DBS chip which supports 2G, 5G and 6G bands. It is a single LMAC device which can be either hooked to 2G/5G/6G bands. Add WMI changes to support WCN6750. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220406094107.17878-11-quic_mpubbise@quicinc.com commit b6f6301041a3f27cb3085abb395c2607ac71671c Author: Manikanta Pubbisetty Date: Wed Apr 6 15:11:03 2022 +0530 ath11k: Do not put HW in DBS mode for WCN6750 Though WCN6750 is a single PDEV device, it is not a DBS solution. So, do not put HW in DBS mode for WCN6750. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220406094107.17878-10-quic_mpubbise@quicinc.com commit eddbb074ce6a3af5fe1d9c546e5d474ca9fa799d Author: Imre Deak Date: Sat Apr 9 01:46:29 2022 +0300 drm/i915/dp: Add workaround for spurious AUX timeouts/hotplugs on LTTPR links To avoid AUX timeouts and subsequent spurious hotplug interrupts, make sure that the first DPCD access during detection is a read from an LTTPR register. Some ADLP DP link configuration at least with multiple LTTPRs expects the first DPCD access during the LTTPR/DPCD detection after hotplug to be a read from the LTTPR range starting with DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV. The side effect of this read is to put each LTTPR into the LTTPR transparent or LTTPR non-transparent mode. The lack of the above read may leave some of the LTTPRs in non-LTTPR mode, while other LTTPRs in LTTPR transparent or LTTPR non-transparent mode (for instance LTTPRs after system suspend/resume that kept their mode from before suspend). Due to the different AUX timeouts the different modes imply, the DPCD access from a non-LTTPR range will timeout and lead to an LTTPR generated hotplug towards the source (which the LTTPR firmware uses to account for buggy TypeC adapters with a long wake-up delay). SYSCROS: 72939 v2: Keep DPCD read-out working on non-LTTPR platforms. v3: Summarize what and why the patch does at the beginning of the commit log. (Jani) Signed-off-by: Imre Deak Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220408224629.845887-1-imre.deak@intel.com commit e08a99d005588f7f1d0647cdbc3368c98471fa6c Author: Thomas Zimmermann Date: Mon Apr 25 09:59:39 2022 +0200 drm/format-helper: Add RGB565-to-XRGB8888 conversion Add a format helper that converts RGB565 to XRGB8888. Use this function in drm_fb_blit_toio(). Fixes simpledrm output for this combination of formats. UEFI and/or Grub will usually set 32-bit output in XRGB8888 format. The issue can be reproduced by enabling simpledrm and requesting a console framebuffer of different format on the kernel command line; for example nomodeset video=1024x768-16 In this case, conversion helpers will display nothing on the console. The patch makes this work by implementing the rsp conversion helpers. It also enables odd userspace configurations, such as running Xorg with 16-bit color depth on a 32-bit output buffer. v2: * use helpers for struct drm_rect (Javier) * improve commit message (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220425075939.30450-4-tzimmermann@suse.de commit 26c30f223123b7feff0ca8722af2f93935b08b85 Author: Thomas Zimmermann Date: Mon Apr 25 09:59:38 2022 +0200 drm/format-helper: Add RGB888-to-XRGB8888 conversion Add a format helper that converts RGB888 to XRGB8888. Use this function in drm_fb_blit_toio(). Fixes simpledrm output for this combination of formats. UEFI and/or Grub will usually set 32-bit output in XRGB8888 format. The issue can be reproduced by enabling simpledrm and requesting a console framebuffer of different format on the kernel command line; for example nomodeset video=1024x768-24 In this case, conversion helpers will display nothing on the console. The patch makes this work by implementing the rsp conversion helpers. It also enables odd userspace configurations, such as running Xorg with 24-bit color depth on a 32-bit output buffer. v2: * use helpers for struct drm_rect (Javier) * improve commit message (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220425075939.30450-3-tzimmermann@suse.de commit 7e553e2ab79a13511bb84559287c06db80a461b1 Author: Thomas Zimmermann Date: Mon Apr 25 09:59:37 2022 +0200 drm/format-helper: Print warning on missing format conversion Not all possible format conversions are supported yet. Print a warning on unsupported combinations. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220425075939.30450-2-tzimmermann@suse.de commit 3527e1ab9a7990530dfb0137ddcfa64bed2915be Author: Alistair Popple Date: Mon Jun 22 12:18:32 2020 +1000 selftests/powerpc: Add matrix multiply assist (MMA) test Adds a simple test of some basic matrix multiply assist (MMA) instructions. Signed-off-by: Alistair Popple Tested-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200622021832.15870-1-alistair@popple.id.au commit 8c783024d6acbd7a18b94ae7ed0e0ed4f163d0ba Author: Guo Zhengkui Date: Mon Apr 25 11:17:23 2022 +0800 rtlwifi: btcoex: fix if == else warning Fix the following coccicheck warning: drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c:1604:2-4: WARNING: possible condition with no effect (if == else). Signed-off-by: Guo Zhengkui Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220425031725.5808-1-guozhengkui@vivo.com commit 21947f3a74d6c90508e1065d649791c9a38d515b Author: Hamid Zamani Date: Sat Apr 23 15:42:37 2022 +0430 brcmfmac: use ISO3166 country code and 0 rev as fallback on brcmfmac43602 chips This uses ISO3166 country code and 0 rev on brcmfmac43602 chips. Without this patch 80 MHz width is not selected on 5 GHz channels. Commit a21bf90e927f ("brcmfmac: use ISO3166 country code and 0 rev as fallback on some devices") provides a way to specify chips for using the fallback case. Before commit 151a7c12c4fc ("Revert "brcmfmac: use ISO3166 country code and 0 rev as fallback"") brcmfmac43602 devices works correctly and for this specific case 80 MHz width is selected. Signed-off-by: Hamid Zamani Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220423111237.60892-1-hzamani.cs91@gmail.com commit 746285cf81dc19502ab238249d75f5990bd2d231 Author: Alexander Wetzel Date: Fri Apr 22 16:52:28 2022 +0200 rtl818x: Prevent using not initialized queues Using not existing queues can panic the kernel with rtl8180/rtl8185 cards. Ignore the skb priority for those cards, they only have one tx queue. Pierre Asselin (pa@panix.com) reported the kernel crash in the Gentoo forum: https://forums.gentoo.org/viewtopic-t-1147832-postdays-0-postorder-asc-start-25.html He also confirmed that this patch fixes the issue. In summary this happened: After updating wpa_supplicant from 2.9 to 2.10 the kernel crashed with a "divide error: 0000" when connecting to an AP. Control port tx now tries to use IEEE80211_AC_VO for the priority, which wpa_supplicants starts to use in 2.10. Since only the rtl8187se part of the driver supports QoS, the priority of the skb is set to IEEE80211_AC_BE (2) by mac80211 for rtl8180/rtl8185 cards. rtl8180 is then unconditionally reading out the priority and finally crashes on drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c line 544 without this patch: idx = (ring->idx + skb_queue_len(&ring->queue)) % ring->entries "ring->entries" is zero for rtl8180/rtl8185 cards, tx_ring[2] never got initialized. Cc: stable@vger.kernel.org Reported-by: pa@panix.com Tested-by: pa@panix.com Signed-off-by: Alexander Wetzel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220422145228.7567-1-alexander@wetzel-home.de commit fc6234d7e2e322e84ed3c5c6c05a54f611faa9ab Author: Kevin Lo Date: Fri Apr 22 22:50:54 2022 +0800 rtw88: use the correct bit in the REG_HCI_OPT_CTRL register Write the BIT_USB_SUS_DIS bit rather than BIT_BT_DIG_CLK_EN to the REG_HCI_OPT_CTRL register for fixing failure to PCIe power on. Signed-off-by: Kevin Lo Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YmLAzuyPr0P4Y6BP@ns.kevlo.org commit 562354ab9f0aa4fcd8f2184506dcb9c18a792182 Author: Andrejs Cainikovs Date: Fri Apr 22 11:03:13 2022 +0200 mwifiex: Add SD8997 SDIO-UART firmware With a recent change now it is possible to detect the strapping option on SD8997, which allows to pick up a correct firmware for either SDIO-SDIO or SDIO-UART. This commit enables SDIO-UART firmware on SD8997. Signed-off-by: Andrejs Cainikovs Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220422090313.125857-3-andrejs.cainikovs@toradex.com commit 255ca28a659d3cfb069f73c7644853ed93aecdb0 Author: Andrejs Cainikovs Date: Fri Apr 22 11:03:12 2022 +0200 mwifiex: Select firmware based on strapping Some WiFi/Bluetooth modules might have different host connection options, allowing to either use SDIO for both WiFi and Bluetooth, or SDIO for WiFi and UART for Bluetooth. It is possible to detect whether a module has SDIO-SDIO or SDIO-UART connection by reading its host strap register. This change introduces a way to automatically select appropriate firmware depending of the connection method, and removes a need of symlinking or overwriting the original firmware file with a required one. Host strap register used in this commit comes from the NXP driver [1] hosted at Code Aurora. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c?h=rel_imx_5.4.70_2.3.2&id=688b67b2c7220b01521ffe560da7eee33042c7bd#n1274 Signed-off-by: Andrejs Cainikovs Reviewed-by: Alvin Šipraga Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220422090313.125857-2-andrejs.cainikovs@toradex.com commit a3b8d1b12c6bc3655332f19af84d0780ba88a578 Author: Wan Jiabing Date: Tue Apr 26 19:17:14 2022 +0800 cpufreq: mediatek: Fix NULL pointer dereference in mediatek-cpufreq Fix following coccicheck error: drivers/cpufreq/mediatek-cpufreq.c:464:16-23: ERROR: info is NULL but dereferenced. Use pr_err instead of dev_err to avoid dereferring a NULL pointer. Fixes: f52b16ba9fe4 ("cpufreq: mediatek: Use device print to show logs") Signed-off-by: Wan Jiabing Reviewed-by: Matthias Brugger Signed-off-by: Viresh Kumar commit 3e1fac9324f8feaeffc724fd9aca7709caa6d3cc Author: Yassine Oudjana Date: Sat Apr 9 04:17:35 2022 +0000 dt-bindings: opp: opp-v2-kryo-cpu: Remove SMEM qcom-cpufreq-nvmem no longer uses SMEM. Remove all references to SMEM and change the description and maximum value of opp-supported-hw to reflect the new set of possible values. Signed-off-by: Yassine Oudjana Acked-by: Rob Herring Signed-off-by: Viresh Kumar commit 40a75584e526cc489234dac0897cd599e6013483 Author: Joel Stanley Date: Wed Mar 30 21:54:37 2022 +1030 powerpc/boot: Build wrapper for an appropriate CPU Currently the boot wrapper lacks a -mcpu option, so it will be built for the toolchain's default cpu. This is a problem if the toolchain defaults to a cpu with newer instructions. We could wire in TARGET_CPU but instead use the oldest supported option so the wrapper runs anywhere. The GCC documentation stays that -mcpu=powerpc64le will give us a generic 64 bit powerpc machine: -mcpu=powerpc, -mcpu=powerpc64, and -mcpu=powerpc64le specify pure 32-bit PowerPC (either endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC architecture machine types, with an appropriate, generic processor model assumed for scheduling purposes. So do that for each of the three machines. This bug was found when building the kernel with a toolchain that defaulted to powre10, resulting in a pcrel enabled wrapper which fails to link: arch/powerpc/boot/wrapper.a(crt0.o): in function `p_base': (.text+0x150): call to `platform_init' lacks nop, can't restore toc; (toc save/adjust stub) (.text+0x154): call to `start' lacks nop, can't restore toc; (toc save/adjust stub) powerpc64le-buildroot-linux-gnu-ld: final link failed: bad value Even with tha bug worked around the resulting kernel would crash on a power9 box: $ qemu-system-ppc64 -nographic -nodefaults -M powernv9 -kernel arch/powerpc/boot/zImage.epapr -serial mon:stdio [ 7.069331356,5] INIT: Starting kernel at 0x20010020, fdt at 0x3068c628 25694 bytes [ 7.130374661,3] *********************************************** [ 7.131072886,3] Fatal Exception 0xe40 at 00000000200101e4 MSR 9000000000000001 [ 7.131290613,3] CFAR : 000000002001027c MSR : 9000000000000001 [ 7.131433759,3] SRR0 : 0000000020010050 SRR1 : 9000000000000001 [ 7.131577775,3] HSRR0: 00000000200101e4 HSRR1: 9000000000000001 [ 7.131733687,3] DSISR: 00000000 DAR : 0000000000000000 [ 7.131905162,3] LR : 0000000020010280 CTR : 0000000000000000 [ 7.132068356,3] CR : 44002004 XER : 00000000 Signed-off-by: Joel Stanley Reviewed-by: Murilo Opsfelder Araujo Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman BugLink: https://github.com/linuxppc/issues/issues/400 Link: https://lore.kernel.org/r/20220330112437.540214-1-joel@jms.id.au commit 646db1a560f44236b7278b822ca99a1d3b6ea72c Author: James Smart Date: Tue Apr 26 11:14:19 2022 -0700 scsi: lpfc: Fix resource leak in lpfc_sli4_send_seq_to_ulp() If no handler is found in lpfc_complete_unsol_iocb() to match the rctl of a received frame, the frame is dropped and resources are leaked. Fix by returning resources when discarding an unhandled frame type. Update lpfc_fc_frame_check() handling of NOP basic link service. Link: https://lore.kernel.org/r/20220426181419.9154-1-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 3d1d34ec1fbcab2d77e3733ff385a074fdf2d60c Author: James Smart Date: Tue Apr 26 11:13:15 2022 -0700 scsi: lpfc: Remove unnecessary null ndlp check in lpfc_sli_prep_wqe() Smatch had the following warning: drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we previously assumed 'ndlp' could be null (see line 22298) Remove the unnecessary null check. Link: https://lore.kernel.org/r/20220426181315.8990-1-jsmart2021@gmail.com Fixes: d51cf5bd926c ("scsi: lpfc: Fix field overload in lpfc_iocbq data structure") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 75b8715e20a20bc7b4844835e4035543a2674200 Author: Minghao Chi Date: Wed Apr 20 09:03:52 2022 +0000 scsi: ufs: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync() and pm_runtime_put_noidle(). This change is just to simplify the code, no actual functional changes. Link: https://lore.kernel.org/r/20220420090353.2588804-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Martin K. Petersen commit b1190d5175acb2c9feea69871737274eb6f462ff Author: Marcel Ziswiler Date: Mon Apr 25 17:48:56 2022 +0200 net: stmmac: dwmac-imx: comment spelling fix Fix spelling in comment. Fixes: 94abdad6974a ("net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip") Signed-off-by: Marcel Ziswiler Link: https://lore.kernel.org/r/20220425154856.169499-1-marcel@ziswiler.com Signed-off-by: Jakub Kicinski commit 2a0338769f27a38b5dd60b6bef5b83003789439b Author: Kees Cook Date: Tue Apr 26 17:09:11 2022 -0700 lkdtm: cfi: Fix type width for masking PAC bits The masking for PAC bits wasn't handling 32-bit architectures correctly. Replace the u64 cast with uintptr_t. Reported-by: kernel test robot Reported-by: Geert Uytterhoeven Link: https://lore.kernel.org/lkml/CAMuHMdVz-J-1ZQ08u0bsQihDkcRmEPrtX5B_oRJ+Ns5jrasnUw@mail.gmail.com Fixes: 2e53b877dc12 ("lkdtm: Add CFI_BACKWARD to test ROP mitigations") Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Signed-off-by: Kees Cook commit e39f63fe0d94ddc8a54929e90ecf93078538d63b Author: Bjorn Helgaas Date: Mon Apr 25 16:26:44 2022 -0500 net: remove comments that mention obsolete __SLOW_DOWN_IO The only remaining definitions of __SLOW_DOWN_IO (for alpha and ia64) do nothing, and the only mentions in networking are in comments. Remove these mentions. Signed-off-by: Bjorn Helgaas Signed-off-by: Jakub Kicinski commit dac173db114d1309dadf50465ca549231deaf59b Author: Bjorn Helgaas Date: Mon Apr 25 16:26:43 2022 -0500 net: wan: atp: remove unused eeprom_delay() atp.h is included only by atp.c, which does not use eeprom_delay(). Remove the unused definition. Signed-off-by: Bjorn Helgaas Signed-off-by: Jakub Kicinski commit c706b2b5ed74d30436b85cbd8e63e969f6b5873a Author: Jakub Kicinski Date: Mon Apr 25 16:33:09 2022 -0700 net: tls: fix async vs NIC crypto offload When NIC takes care of crypto (or the record has already been decrypted) we forget to update darg->async. ->async is supposed to mean whether record is async capable on input and whether record has been queued for async crypto on output. Reported-by: Gal Pressman Fixes: 3547a1f9d988 ("tls: rx: use async as an in-out argument") Tested-by: Gal Pressman Link: https://lore.kernel.org/r/20220425233309.344858-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit fae4630840323abad04e6aeaeda14e9f4d01806f Author: Russell King (Oracle) Date: Mon Apr 25 22:28:02 2022 +0100 net: dsa: mt753x: fix pcs conversion regression Daniel Golle reports that the conversion of mt753x to phylink PCS caused an oops as below. The problem is with the placement of the PCS initialisation, which occurs after mt7531_setup() has been called. However, burited in this function is a call to setup the CPU port, which requires the PCS structure to be already setup. Fix this by changing the initialisation order. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 Mem abort info: ESR = 0x96000005 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x05: level 1 translation fault Data abort info: ISV = 0, ISS = 0x00000005 CM = 0, WnR = 0 user pgtable: 4k pages, 39-bit VAs, pgdp=0000000046057000 [0000000000000020] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 Internal error: Oops: 96000005 [#1] SMP Modules linked in: CPU: 0 PID: 32 Comm: kworker/u4:1 Tainted: G S 5.18.0-rc3-next-20220422+ #0 Hardware name: Bananapi BPI-R64 (DT) Workqueue: events_unbound deferred_probe_work_func pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mt7531_cpu_port_config+0xcc/0x1b0 lr : mt7531_cpu_port_config+0xc0/0x1b0 sp : ffffffc008d5b980 x29: ffffffc008d5b990 x28: ffffff80060562c8 x27: 00000000f805633b x26: ffffff80001a8880 x25: 00000000000009c4 x24: 0000000000000016 x23: ffffff8005eb6470 x22: 0000000000003600 x21: ffffff8006948080 x20: 0000000000000000 x19: 0000000000000006 x18: 0000000000000000 x17: 0000000000000001 x16: 0000000000000001 x15: 02963607fcee069e x14: 0000000000000000 x13: 0000000000000030 x12: 0101010101010101 x11: ffffffc037302000 x10: 0000000000000870 x9 : ffffffc008d5b800 x8 : ffffff800028f950 x7 : 0000000000000001 x6 : 00000000662b3000 x5 : 00000000000002f0 x4 : 0000000000000000 x3 : ffffff800028f080 x2 : 0000000000000000 x1 : ffffff800028f080 x0 : 0000000000000000 Call trace: mt7531_cpu_port_config+0xcc/0x1b0 mt753x_cpu_port_enable+0x24/0x1f0 mt7531_setup+0x49c/0x5c0 mt753x_setup+0x20/0x31c dsa_register_switch+0x8bc/0x1020 mt7530_probe+0x118/0x200 mdio_probe+0x30/0x64 really_probe.part.0+0x98/0x280 __driver_probe_device+0x94/0x140 driver_probe_device+0x40/0x114 __device_attach_driver+0xb0/0x10c bus_for_each_drv+0x64/0xa0 __device_attach+0xa8/0x16c device_initial_probe+0x10/0x20 bus_probe_device+0x94/0x9c deferred_probe_work_func+0x80/0xb4 process_one_work+0x200/0x3a0 worker_thread+0x260/0x4c0 kthread+0xd4/0xe0 ret_from_fork+0x10/0x20 Code: 9409e911 937b7e60 8b0002a0 f9405800 (f9401005) ---[ end trace 0000000000000000 ]--- Reported-by: Daniel Golle Tested-by: Daniel Golle Fixes: cbd1f243bc41 ("net: dsa: mt7530: partially convert to phylink_pcs") Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/E1nj6FW-007WZB-5Y@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 9bf2eed995f9f8136f00110214c120f2d7912ad8 Author: Brendan Higgins Date: Mon Apr 18 21:05:15 2022 -0700 kunit: add support for kunit_suites that reference init code Add support for a new kind of kunit_suite registration macro called kunit_test_init_section_suite(); this new registration macro allows the registration of kunit_suites that reference functions marked __init and data marked __initdata. Signed-off-by: Brendan Higgins Tested-by: Martin Fernandez Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 68822bdf76f10c3dc80609d4e2cdc1e847429086 Author: Eric Dumazet Date: Fri Apr 22 13:12:37 2022 -0700 net: generalize skb freeing deferral to per-cpu lists Logic added in commit f35f821935d8 ("tcp: defer skb freeing after socket lock is released") helped bulk TCP flows to move the cost of skbs frees outside of critical section where socket lock was held. But for RPC traffic, or hosts with RFS enabled, the solution is far from being ideal. For RPC traffic, recvmsg() has to return to user space right after skb payload has been consumed, meaning that BH handler has no chance to pick the skb before recvmsg() thread. This issue is more visible with BIG TCP, as more RPC fit one skb. For RFS, even if BH handler picks the skbs, they are still picked from the cpu on which user thread is running. Ideally, it is better to free the skbs (and associated page frags) on the cpu that originally allocated them. This patch removes the per socket anchor (sk->defer_list) and instead uses a per-cpu list, which will hold more skbs per round. This new per-cpu list is drained at the end of net_action_rx(), after incoming packets have been processed, to lower latencies. In normal conditions, skbs are added to the per-cpu list with no further action. In the (unlikely) cases where the cpu does not run net_action_rx() handler fast enough, we use an IPI to raise NET_RX_SOFTIRQ on the remote cpu. Also, we do not bother draining the per-cpu list from dev_cpu_dead() This is because skbs in this list have no requirement on how fast they should be freed. Note that we can add in the future a small per-cpu cache if we see any contention on sd->defer_lock. Tested on a pair of hosts with 100Gbit NIC, RFS enabled, and /proc/sys/net/ipv4/tcp_rmem[2] tuned to 16MB to work around page recycling strategy used by NIC driver (its page pool capacity being too small compared to number of skbs/pages held in sockets receive queues) Note that this tuning was only done to demonstrate worse conditions for skb freeing for this particular test. These conditions can happen in more general production workload. 10 runs of one TCP_STREAM flow Before: Average throughput: 49685 Mbit. Kernel profiles on cpu running user thread recvmsg() show high cost for skb freeing related functions (*) 57.81% [kernel] [k] copy_user_enhanced_fast_string (*) 12.87% [kernel] [k] skb_release_data (*) 4.25% [kernel] [k] __free_one_page (*) 3.57% [kernel] [k] __list_del_entry_valid 1.85% [kernel] [k] __netif_receive_skb_core 1.60% [kernel] [k] __skb_datagram_iter (*) 1.59% [kernel] [k] free_unref_page_commit (*) 1.16% [kernel] [k] __slab_free 1.16% [kernel] [k] _copy_to_iter (*) 1.01% [kernel] [k] kfree (*) 0.88% [kernel] [k] free_unref_page 0.57% [kernel] [k] ip6_rcv_core 0.55% [kernel] [k] ip6t_do_table 0.54% [kernel] [k] flush_smp_call_function_queue (*) 0.54% [kernel] [k] free_pcppages_bulk 0.51% [kernel] [k] llist_reverse_order 0.38% [kernel] [k] process_backlog (*) 0.38% [kernel] [k] free_pcp_prepare 0.37% [kernel] [k] tcp_recvmsg_locked (*) 0.37% [kernel] [k] __list_add_valid 0.34% [kernel] [k] sock_rfree 0.34% [kernel] [k] _raw_spin_lock_irq (*) 0.33% [kernel] [k] __page_cache_release 0.33% [kernel] [k] tcp_v6_rcv (*) 0.33% [kernel] [k] __put_page (*) 0.29% [kernel] [k] __mod_zone_page_state 0.27% [kernel] [k] _raw_spin_lock After patch: Average throughput: 73076 Mbit. Kernel profiles on cpu running user thread recvmsg() looks better: 81.35% [kernel] [k] copy_user_enhanced_fast_string 1.95% [kernel] [k] _copy_to_iter 1.95% [kernel] [k] __skb_datagram_iter 1.27% [kernel] [k] __netif_receive_skb_core 1.03% [kernel] [k] ip6t_do_table 0.60% [kernel] [k] sock_rfree 0.50% [kernel] [k] tcp_v6_rcv 0.47% [kernel] [k] ip6_rcv_core 0.45% [kernel] [k] read_tsc 0.44% [kernel] [k] _raw_spin_lock_irqsave 0.37% [kernel] [k] _raw_spin_lock 0.37% [kernel] [k] native_irq_return_iret 0.33% [kernel] [k] __inet6_lookup_established 0.31% [kernel] [k] ip6_protocol_deliver_rcu 0.29% [kernel] [k] tcp_rcv_established 0.29% [kernel] [k] llist_reverse_order v2: kdoc issue (kernel bots) do not defer if (alloc_cpu == smp_processor_id()) (Paolo) replace the sk_buff_head with a single-linked list (Jakub) add a READ_ONCE()/WRITE_ONCE() for the lockless read of sd->defer_list Signed-off-by: Eric Dumazet Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220422201237.416238-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit d54d06a4c4bc5d76815d02e4b041b31d9dbb3fef Merge: c317ab71facc2 ea4128eb43eb3 Author: Alexei Starovoitov Date: Tue Apr 26 15:41:47 2022 -0700 Merge branch 'Teach libbpf to "fix up" BPF verifier log' Andrii Nakryiko says: ==================== This patch set teaches libbpf to enhance BPF verifier log with human-readable and relevant information about failed CO-RE relocation. Patch #9 is the main one with the new logic. See relevant commit messages for some more details. All the other patches are either fixing various bugs detected while working on this feature, most prominently a bug with libbpf not handling CO-RE relocations for SEC("?...") programs, or are refactoring libbpf internals to allow for easier reuse of CO-RE relo lookup and formatting logic. ==================== Signed-off-by: Alexei Starovoitov commit ea4128eb43eb3fe856831eaa9f747fab350ed5f3 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:11 2022 -0700 selftests/bpf: Add libbpf's log fixup logic selftests Add tests validating that libbpf is indeed patching up BPF verifier log with CO-RE relocation details. Also test partial and full truncation scenarios. This test might be a bit fragile due to changing BPF verifier log format. If that proves to be frequently breaking, we can simplify tests or remove the truncation subtests. But for now it seems useful to test it in those conditions that are otherwise rarely occuring in practice. Also test CO-RE relo failure in a subprog as that excercises subprogram CO-RE relocation mapping logic which doesn't work out of the box without extra relo storage previously done only for gen_loader case. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-11-andrii@kernel.org commit 9fdc4273b8dad70dbf8f7fc1b94eadc1c1f6c934 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:10 2022 -0700 libbpf: Fix up verifier log for unguarded failed CO-RE relos Teach libbpf to post-process BPF verifier log on BPF program load failure and detect known error patterns to provide user with more context. Currently there is one such common situation: an "unguarded" failed BPF CO-RE relocation. While failing CO-RE relocation is expected, it is expected to be property guarded in BPF code such that BPF verifier always eliminates BPF instructions corresponding to such failed CO-RE relos as dead code. In cases when user failed to take such precautions, BPF verifier provides the best log it can: 123: (85) call unknown#195896080 invalid func unknown#195896080 Such incomprehensible log error is due to libbpf "poisoning" BPF instruction that corresponds to failed CO-RE relocation by replacing it with invalid `call 0xbad2310` instruction (195896080 == 0xbad2310 reads "bad relo" if you squint hard enough). Luckily, libbpf has all the necessary information to look up CO-RE relocation that failed and provide more human-readable description of what's going on: 5: failed to resolve CO-RE relocation [6] struct task_struct___bad.fake_field_subprog (0:2 @ offset 8) This hopefully makes it much easier to understand what's wrong with user's BPF program without googling magic constants. This BPF verifier log fixup is setup to be extensible and is going to be used for at least one other upcoming feature of libbpf in follow up patches. Libbpf is parsing lines of BPF verifier log starting from the very end. Currently it processes up to 10 lines of code looking for familiar patterns. This avoids wasting lots of CPU processing huge verifier logs (especially for log_level=2 verbosity level). Actual verification error should normally be found in last few lines, so this should work reliably. If libbpf needs to expand log beyond available log_buf_size, it truncates the end of the verifier log. Given verifier log normally ends with something like: processed 2 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 ... truncating this on program load error isn't too bad (end user can always increase log size, if it needs to get complete log). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-10-andrii@kernel.org commit 14032f2644534ecd5693ebfeef44cbf0d989a7fe Author: Andrii Nakryiko Date: Mon Apr 25 17:45:09 2022 -0700 libbpf: Simplify bpf_core_parse_spec() signature Simplify bpf_core_parse_spec() signature to take struct bpf_core_relo as an input instead of requiring callers to decompose them into type_id, relo, spec_str, etc. This makes using and reusing this helper easier. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-9-andrii@kernel.org commit b58af63aab11e4ae00fe96de9505759cfdde8ee9 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:08 2022 -0700 libbpf: Refactor CO-RE relo human description formatting routine Refactor how CO-RE relocation is formatted. Now it dumps human-readable representation, currently used by libbpf in either debug or error message output during CO-RE relocation resolution process, into provided buffer. This approach allows for better reuse of this functionality outside of CO-RE relocation resolution, which we'll use in next patch for providing better error message for BPF verifier rejecting BPF program due to unguarded failed CO-RE relocation. It also gets rid of annoying "stitching" of libbpf_print() calls, which was the only place where we did this. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-8-andrii@kernel.org commit 185cfe837fdbb1fcc0f6b8fbcf5fdd2d1fccd3ad Author: Andrii Nakryiko Date: Mon Apr 25 17:45:07 2022 -0700 libbpf: Record subprog-resolved CO-RE relocations unconditionally Previously, libbpf recorded CO-RE relocations with insns_idx resolved according to finalized subprog locations (which are appended at the end of entry BPF program) to simplify the job of light skeleton generator. This is necessary because once subprogs' instructions are appended to main entry BPF program all the subprog instruction indices are shifted and that shift is different for each entry (main) BPF program, so it's generally impossible to map final absolute insn_idx of the finalized BPF program to their original locations inside subprograms. This information is now going to be used not only during light skeleton generation, but also to map absolute instruction index to subprog's instruction and its corresponding CO-RE relocation. So start recording these relocations always, not just when obj->gen_loader is set. This information is going to be freed at the end of bpf_object__load() step, as before (but this can change in the future if there will be a need for this information post load step). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-7-andrii@kernel.org commit b82bb1ffbb9a20032853ef4e0d5b8f37c6ae7c25 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:06 2022 -0700 selftests/bpf: Add CO-RE relos and SEC("?...") to linked_funcs selftests Enhance linked_funcs selftest with two tricky features that might not obviously work correctly together. We add CO-RE relocations to entry BPF programs and mark those programs as non-autoloadable with SEC("?...") annotation. This makes sure that libbpf itself handles .BTF.ext CO-RE relocation data matching correctly for SEC("?...") programs, as well as ensures that BPF static linker handles this correctly (this was the case before, no changes are necessary, but it wasn't explicitly tested). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-6-andrii@kernel.org commit 11d5daa89254ba2233d422777d52dbf24666b280 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:05 2022 -0700 libbpf: Avoid joining .BTF.ext data with BPF programs by section name Instead of using ELF section names as a joining key between .BTF.ext and corresponding BPF programs, pre-build .BTF.ext section number to ELF section index mapping during bpf_object__open() and use it later for matching .BTF.ext information (func/line info or CO-RE relocations) to their respective BPF programs and subprograms. This simplifies corresponding joining logic and let's libbpf do manipulations with BPF program's ELF sections like dropping leading '?' character for non-autoloaded programs. Original joining logic in bpf_object__relocate_core() (see relevant comment that's now removed) was never elegant, so it's a good improvement regardless. But it also avoids unnecessary internal assumptions about preserving original ELF section name as BPF program's section name (which was broken when SEC("?abc") support was added). Fixes: a3820c481112 ("libbpf: Support opting out from autoloading BPF programs declaratively") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-5-andrii@kernel.org commit 966a7509325395c51c5f6d89e7352b0585e4804b Author: Andrii Nakryiko Date: Mon Apr 25 17:45:04 2022 -0700 libbpf: Fix logic for finding matching program for CO-RE relocation Fix the bug in bpf_object__relocate_core() which can lead to finding invalid matching BPF program when processing CO-RE relocation. IF matching program is not found, last encountered program will be assumed to be correct program and thus error detection won't detect the problem. Fixes: 9c82a63cf370 ("libbpf: Fix CO-RE relocs against .text section") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-4-andrii@kernel.org commit 0994a54c5202114ad0e3b3a0f1326e810b23ad38 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:03 2022 -0700 libbpf: Drop unhelpful "program too large" guess libbpf pretends it knows actual limit of BPF program instructions based on UAPI headers it compiled with. There is neither any guarantee that UAPI headers match host kernel, nor BPF verifier actually uses BPF_MAXINSNS constant anymore. Just drop unhelpful "guess", BPF verifier will emit actual reason for failure in its logs anyways. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-3-andrii@kernel.org commit afe98d46ba22316acfd198eb5cd4db2ef2d427d7 Author: Andrii Nakryiko Date: Mon Apr 25 17:45:02 2022 -0700 libbpf: Fix anonymous type check in CO-RE logic Use type name for checking whether CO-RE relocation is referring to anonymous type. Using spec string makes no sense. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220426004511.2691730-2-andrii@kernel.org commit 6621a7004684bfcff5af4c8e4d37989941f42a6b Author: Mark-PK Tsai Date: Tue Apr 26 20:24:07 2022 +0800 tracing: make tracer_init_tracefs initcall asynchronous Move trace_eval_init() to subsys_initcall to make it start earlier. And to avoid tracer_init_tracefs being blocked by trace_event_sem which trace_eval_init() hold [1], queue tracer_init_tracefs() to eval_map_wq to let the two works being executed sequentially. It can speed up the initialization of kernel as result of making tracer_init_tracefs asynchronous. On my arm64 platform, it reduce ~20ms of 125ms which total time do_initcalls spend. Link: https://lkml.kernel.org/r/20220426122407.17042-3-mark-pk.tsai@mediatek.com [1]: https://lore.kernel.org/r/68d7b3327052757d0cd6359a6c9015a85b437232.camel@pengutronix.de Signed-off-by: Mark-PK Tsai Signed-off-by: Steven Rostedt (Google) commit ef9188bcc6ca1d8a2ad83e826b548e6820721061 Author: Mark-PK Tsai Date: Tue Apr 26 20:24:06 2022 +0800 tracing: Avoid adding tracer option before update_tracer_options To prepare for support asynchronous tracer_init_tracefs initcall, avoid calling create_trace_option_files before __update_tracer_options. Otherwise, create_trace_option_files will show warning because some tracers in trace_types list are already in tr->topts. For example, hwlat_tracer call register_tracer in late_initcall, and global_trace.dir is already created in tracing_init_dentry, hwlat_tracer will be put into tr->topts. Then if the __update_tracer_options is executed after hwlat_tracer registered, create_trace_option_files find that hwlat_tracer is already in tr->topts. Link: https://lkml.kernel.org/r/20220426122407.17042-2-mark-pk.tsai@mediatek.com Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/ Reported-by: kernel test robot Signed-off-by: Mark-PK Tsai Signed-off-by: Steven Rostedt (Google) commit ed888241a0ab9a3606bd986be6f0abafa1afdf19 Author: Wan Jiabing Date: Tue Apr 26 15:06:28 2022 +0800 ring-buffer: Simplify if-if to if-else Use if and else instead of if(A) and if (!A). Link: https://lkml.kernel.org/r/20220426070628.167565-1-wanjiabing@vivo.com Signed-off-by: Wan Jiabing Signed-off-by: Steven Rostedt (Google) commit 4ee51101e93f0c8d83876ae5c0c26ca14934629e Author: Guo Zhengkui Date: Sun Apr 24 21:19:32 2022 +0800 tracing: Use WARN instead of printk and WARN_ON Use `WARN(cond, ...)` instead of `if (cond)` + `printk(...)` + `WARN_ON(1)`. Link: https://lkml.kernel.org/r/20220424131932.3606-1-guozhengkui@vivo.com Suggested-by: Steven Rostedt Signed-off-by: Guo Zhengkui Signed-off-by: Steven Rostedt (Google) commit 12025abdc8539ed9d5014e2d647a3fd1bd3de5cd Author: Jun Miao Date: Tue Apr 19 09:39:10 2022 +0800 tracing: Fix sleeping function called from invalid context on RT kernel When setting bootparams="trace_event=initcall:initcall_start tp_printk=1" in the cmdline, the output_printk() was called, and the spin_lock_irqsave() was called in the atomic and irq disable interrupt context suitation. On the PREEMPT_RT kernel, these locks are replaced with sleepable rt-spinlock, so the stack calltrace will be triggered. Fix it by raw_spin_lock_irqsave when PREEMPT_RT and "trace_event=initcall:initcall_start tp_printk=1" enabled. BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: [] try_to_wake_up+0x7e/0xba0 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.1-rt17+ #19 34c5812404187a875f32bee7977f7367f9679ea7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: dump_stack_lvl+0x60/0x8c dump_stack+0x10/0x12 __might_resched.cold+0x11d/0x155 rt_spin_lock+0x40/0x70 trace_event_buffer_commit+0x2fa/0x4c0 ? map_vsyscall+0x93/0x93 trace_event_raw_event_initcall_start+0xbe/0x110 ? perf_trace_initcall_finish+0x210/0x210 ? probe_sched_wakeup+0x34/0x40 ? ttwu_do_wakeup+0xda/0x310 ? trace_hardirqs_on+0x35/0x170 ? map_vsyscall+0x93/0x93 do_one_initcall+0x217/0x3c0 ? trace_event_raw_event_initcall_level+0x170/0x170 ? push_cpu_stop+0x400/0x400 ? cblist_init_generic+0x241/0x290 kernel_init_freeable+0x1ac/0x347 ? _raw_spin_unlock_irq+0x65/0x80 ? rest_init+0xf0/0xf0 kernel_init+0x1e/0x150 ret_from_fork+0x22/0x30 Link: https://lkml.kernel.org/r/20220419013910.894370-1-jun.miao@intel.com Signed-off-by: Jun Miao Signed-off-by: Steven Rostedt (Google) commit 69686fcbdcc0b6fed3b8d0907e641f282df2f827 Author: Ammar Faizi Date: Mon Apr 18 01:56:30 2022 +0700 tracing: Change `if (strlen(glob))` to `if (glob[0])` No need to traverse to the end of string. If the first byte is not a NUL char, it's guaranteed `if (strlen(glob))` is true. Link: https://lkml.kernel.org/r/20220417185630.199062-3-ammarfaizi2@gnuweeb.org Cc: Ingo Molnar Cc: GNU/Weeb Mailing List Signed-off-by: Ammar Faizi Signed-off-by: Steven Rostedt (Google) commit 97a5d2e5e35f119b6d7a37c7538773ae7af82dd5 Author: Ammar Faizi Date: Mon Apr 18 01:56:29 2022 +0700 tracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse() If `WARN_ON(!glob)` is ever triggered, we will still continue executing the next lines. This will trigger the more serious problem, a NULL pointer dereference bug. Just return -EINVAL if @glob is NULL. Link: https://lkml.kernel.org/r/20220417185630.199062-2-ammarfaizi2@gnuweeb.org Cc: Ingo Molnar Cc: GNU/Weeb Mailing List Signed-off-by: Ammar Faizi Signed-off-by: Steven Rostedt (Google) commit cb1c45fb68b8a4285ccf750842b1136f26cfe267 Author: Jeff Xie Date: Sun Apr 10 22:50:25 2022 +0800 tracing: Make tp_printk work on syscall tracepoints Currently the tp_printk option has no effect on syscall tracepoint. When adding the kernel option parameter tp_printk, then: echo 1 > /sys/kernel/debug/tracing/events/syscalls/enable When running any application, no trace information is printed on the terminal. Now added printk for syscall tracepoints. Link: https://lkml.kernel.org/r/20220410145025.681144-1-xiehuan09@gmail.com Signed-off-by: Jeff Xie Signed-off-by: Steven Rostedt (Google) commit 2f51efc6b71dc7e47acd26e4610107905feb074b Author: Masami Hiramatsu Date: Wed Apr 6 11:31:30 2022 +0900 docs: bootconfig: Add how to embed the bootconfig into kernel Add a description how to embed the bootconfig file into kernel. Link: https://lkml.kernel.org/r/164921228987.1090670.16843569536974147213.stgit@devnote2 Cc: Padmanabha Srinivasaiah Cc: Jonathan Corbet Cc: Randy Dunlap Cc: Nick Desaulniers Cc: Sami Tolvanen Cc: Nathan Chancellor Cc: Masahiro Yamada Cc: Linux Kbuild mailing list Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) commit a2a9d67a26ec94a99ed29efbd61cf5be0a575678 Author: Masami Hiramatsu Date: Wed Apr 6 11:31:19 2022 +0900 bootconfig: Support embedding a bootconfig file in kernel This allows kernel developer to embed a default bootconfig file in the kernel instead of embedding it in the initrd. This will be good for who are using the kernel without initrd, or who needs a default bootconfigs. This needs to set two kconfigs: CONFIG_BOOT_CONFIG_EMBED=y and set the file path to CONFIG_BOOT_CONFIG_EMBED_FILE. Note that you still need 'bootconfig' command line option to load the embedded bootconfig. Also if you boot using an initrd with a different bootconfig, the kernel will use the bootconfig in the initrd, instead of the default bootconfig. Link: https://lkml.kernel.org/r/164921227943.1090670.14035119557571329218.stgit@devnote2 Cc: Padmanabha Srinivasaiah Cc: Jonathan Corbet Cc: Randy Dunlap Cc: Nick Desaulniers Cc: Sami Tolvanen Cc: Nathan Chancellor Cc: Masahiro Yamada Cc: Linux Kbuild mailing list Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) commit 765b8552a200471414e9e92de3e35ceb9e735e61 Author: Masami Hiramatsu Date: Wed Apr 6 11:31:09 2022 +0900 bootconfig: Check the checksum before removing the bootconfig from initrd Check the bootconfig's checksum before removing the bootconfig data from initrd to avoid modifying initrd by mistake. This will also simplifies the get_boot_config_from_initrd() interface. Link: https://lkml.kernel.org/r/164921226891.1090670.16955839243639298134.stgit@devnote2 Cc: Padmanabha Srinivasaiah Cc: Jonathan Corbet Cc: Randy Dunlap Cc: Nick Desaulniers Cc: Sami Tolvanen Cc: Nathan Chancellor Cc: Masahiro Yamada Cc: Linux Kbuild mailing list Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) commit 6014a23638cdee63a71ef13c51d7c563eb5829ee Author: Masami Hiramatsu Date: Wed Apr 6 11:30:59 2022 +0900 bootconfig: Make the bootconfig.o as a normal object file Since the APIs defined in the bootconfig.o are not individually used, it is meaningless to build it as library by lib-y. Use obj-y for that. Link: https://lkml.kernel.org/r/164921225875.1090670.15565363126983098971.stgit@devnote2 Cc: Padmanabha Srinivasaiah Cc: Jonathan Corbet Cc: Randy Dunlap Cc: Nick Desaulniers Cc: Sami Tolvanen Cc: Nathan Chancellor Cc: Linux Kbuild mailing list Reported-by: Masahiro Yamada Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) commit adaa0a9f06d127b6a0a1b929ec0971df40993a9b Author: Yang Li Date: Sat Apr 2 15:20:15 2022 +0800 tracing: Fix tracing_map_sort_entries() kernel-doc comment Add the description of @n_sort_keys and make @sort_key -> @sort_keys in tracing_map_sort_entries() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. kernel/trace/tracing_map.c:1073: warning: Function parameter or member 'sort_keys' not described in 'tracing_map_sort_entries' kernel/trace/tracing_map.c:1073: warning: Function parameter or member 'n_sort_keys' not described in 'tracing_map_sort_entries' kernel/trace/tracing_map.c:1073: warning: Excess function parameter 'sort_key' description in 'tracing_map_sort_entries' Link: https://lkml.kernel.org/r/20220402072015.45864-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Steven Rostedt (Google) commit 3eaf17f5021b4cf19e9bc038cddb178630a791cd Author: Christophe Leroy Date: Fri Mar 25 07:32:21 2022 +0100 MAINTAINERS: Enlarge coverage of TRACING inside architectures Most architectures have ftrace related stuff in arch/*/kernel/ftrace.c but powerpc has it spread in multiple files located in arch/powerpc/kernel/trace/ In several architectures, there are also additional files containing 'ftrace' as part of the name but with some prefix or suffix. Use wildcards to enlarge coverage. With arch/*/*/*/*ftrace*: arch/alpha/include/asm/ftrace.h arch/arm64/include/asm/ftrace.h arch/arm/include/asm/ftrace.h arch/csky/include/asm/ftrace.h arch/csky/kernel/probes/ftrace.c arch/ia64/include/asm/ftrace.h arch/m68k/include/asm/ftrace.h arch/microblaze/include/asm/ftrace.h arch/mips/include/asm/ftrace.h arch/nds32/include/asm/ftrace.h arch/parisc/include/asm/ftrace.h arch/powerpc/include/asm/ftrace.h arch/powerpc/kernel/trace/ftrace_64_pg.S arch/powerpc/kernel/trace/ftrace.c arch/powerpc/kernel/trace/ftrace_low.S arch/powerpc/kernel/trace/ftrace_mprofile.S arch/riscv/include/asm/ftrace.h arch/riscv/kernel/probes/ftrace.c arch/s390/include/asm/ftrace.h arch/s390/include/asm/ftrace.lds.h arch/sh/include/asm/ftrace.h arch/sparc/include/asm/ftrace.h arch/x86/include/asm/ftrace.h arch/x86/kernel/kprobes/ftrace.c arch/xtensa/include/asm/ftrace.h With arch/*/*/*ftrace*: arch/arm64/kernel/entry-ftrace.S arch/arm64/kernel/ftrace.c arch/arm/kernel/entry-ftrace.S arch/arm/kernel/ftrace.c arch/csky/kernel/ftrace.c arch/ia64/kernel/ftrace.c arch/microblaze/kernel/ftrace.c arch/mips/kernel/ftrace.c arch/nds32/kernel/ftrace.c arch/parisc/kernel/ftrace.c arch/powerpc/kernel/kprobes-ftrace.c arch/riscv/kernel/ftrace.c arch/s390/kernel/ftrace.c arch/s390/kernel/ftrace.h arch/sh/kernel/ftrace.c arch/sparc/kernel/ftrace.c arch/x86/kernel/ftrace_32.S arch/x86/kernel/ftrace_64.S arch/x86/kernel/ftrace.c Link: https://lkml.kernel.org/r/e8338c0ad0e73991cbd8f31c215b16ea4efe212d.1648189904.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Steven Rostedt (Google) commit 3b57d8477cd0f427198930706958f1312cc3594b Author: Jiapeng Chong Date: Fri Feb 18 18:08:49 2022 +0800 tracing: Fix kernel-doc Fix the following W=1 kernel warnings: kernel/trace/trace.c:1181: warning: expecting prototype for tracing_snapshot_cond_data(). Prototype was for tracing_cond_snapshot_data() instead. Link: https://lkml.kernel.org/r/20220218100849.122038-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Steven Rostedt (Google) commit cf2adec7479d875973fe10782f8bf20377628ef2 Author: Oscar Shiang Date: Thu Feb 17 00:50:06 2022 +0800 tracing: Fix inconsistent style of mini-HOWTO Each description should start with a hyphen and a space. Insert spaces to fix it. Link: https://lkml.kernel.org/r/TYCP286MB19130AA4A9C6FC5A8793DED2A1359@TYCP286MB1913.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Oscar Shiang Signed-off-by: Steven Rostedt (Google) commit a7e6b7dcfb19988ad2968a1fafd29b600abbf133 Author: Tom Zanussi Date: Fri Feb 4 16:12:07 2022 -0600 tracing: Separate hist state updates from hist registration hist_register_trigger() handles both new hist registration as well as existing hist registration through event_command.reg(). Adding a new function, existing_hist_update_only(), that checks and updates existing histograms and exits after doing so allows the confusing logic in event_hist_trigger_parse() to be simplified. Link: https://lkml.kernel.org/r/211b2cd3e3d7e00f4f8ad45ef8b33063da6a7e05.1644010576.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit e1f187d09e11f50a50cbb02ae277d4e8bdfc7db8 Author: Tom Zanussi Date: Fri Feb 4 16:12:06 2022 -0600 tracing: Have existing event_command.parse() implementations use helpers Simplify the existing event_command.parse() implementations by having them make use of the helper functions previously introduced. Link: https://lkml.kernel.org/r/b353e3427a81f9d3adafd98fd7d73e78a8209f43.1644010576.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 476705419518a2f383b6695782ba1f285a2959b9 Author: Tom Zanussi Date: Fri Feb 4 16:12:05 2022 -0600 tracing: Remove redundant trigger_ops params Since event_trigger_data contains the .ops trigger_ops field, there's no reason to pass the trigger_ops separately. Remove it as a param from functions whenever event_trigger_data is passed. Link: https://lkml.kernel.org/r/9856c9bc81bde57077f5b8d6f8faa47156c6354a.1644010575.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit b8cc44a4d3c19296dfd1be1a018a8523e09ab919 Author: Tom Zanussi Date: Fri Feb 4 16:12:04 2022 -0600 tracing: Remove logic for registering multiple event triggers at a time Code for registering triggers assumes it's possible to register more than one trigger at a time. In fact, it's unimplemented and there doesn't seem to be a reason to do that. Remove the n_registered param from event_trigger_register() and fix up callers. Doing so simplifies the logic in event_trigger_register to the point that it just becomes a wrapper calling event_command.reg(). It also removes the problematic call to event_command.unreg() in case of failure. A new function, event_trigger_unregister() is also added for callers to call themselves. The changes to trace_events_hist.c simply allow compilation; a separate patch follows which updates the hist triggers to work correctly with the new changes. Link: https://lkml.kernel.org/r/6149fec7a139d93e84fa4535672fb5bef88006b0.1644010575.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 217d8c05ec6295947b0b71bc784012d112f0032e Author: Tom Rix Date: Mon Feb 7 05:12:16 2022 -0800 tracing: Cleanup double word in comment Remove the second 'is' and 'to'. Link: https://lkml.kernel.org/r/20220207131216.2059997-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Steven Rostedt (Google) commit 49148f4c39f04cb7bcfc1f42c3051d9ef8655fba Author: Linus Walleij Date: Thu Apr 14 23:40:16 2022 +0200 ARM: dts: ux500: Add GPS to the Codina The Codina has a Broadcom BCM4751 GPS chip. Signed-off-by: Linus Walleij commit 3092eb45637573c5e435fbf5eaf9516316e5f9c6 Author: Guo Ren Date: Tue Apr 5 15:13:11 2022 +0800 riscv: compat: vdso: Add setup additional pages implementation Reconstruct __setup_additional_pages() by appending vdso info pointer argument to meet compat_vdso_info requirement. And change vm_special_mapping *dm, *cm initialization into static. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-18-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 0715372a06ce17a9ba69bbec306ddf30c4bad99e Author: Guo Ren Date: Tue Apr 5 15:13:10 2022 +0800 riscv: compat: vdso: Add COMPAT_VDSO base code implementation There is no vgettimeofday supported in rv32 that makes simple to generate rv32 vdso code which only needs riscv64 compiler. Other architectures need change compiler or -m (machine parameter) to support vdso32 compiling. If rv32 support vgettimeofday (which cause C compile) in future, we would add CROSS_COMPILE to support that makes more requirement on compiler enviornment. linux-rv64/arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg: file format elf64-littleriscv Disassembly of section .text: 0000000000000800 <__vdso_rt_sigreturn>: 800: 08b00893 li a7,139 804: 00000073 ecall 808: 0000 unimp ... 000000000000080c <__vdso_getcpu>: 80c: 0a800893 li a7,168 810: 00000073 ecall 814: 8082 ret ... 0000000000000818 <__vdso_flush_icache>: 818: 10300893 li a7,259 81c: 00000073 ecall 820: 8082 ret linux-rv32/arch/riscv/kernel/vdso/vdso.so.dbg: file format elf32-littleriscv Disassembly of section .text: 00000800 <__vdso_rt_sigreturn>: 800: 08b00893 li a7,139 804: 00000073 ecall 808: 0000 unimp ... 0000080c <__vdso_getcpu>: 80c: 0a800893 li a7,168 810: 00000073 ecall 814: 8082 ret ... 00000818 <__vdso_flush_icache>: 818: 10300893 li a7,259 81c: 00000073 ecall 820: 8082 ret Finally, reuse all *.S from vdso in compat_vdso that makes implementation clear and readable. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-17-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit f4b395e6f1a588ed6c9a30474e58cf6b27b65783 Author: Guo Ren Date: Tue Apr 5 15:13:09 2022 +0800 riscv: compat: Add hw capability check for elf Detect hardware COMPAT (32bit U-mode) capability in rv64. If not support COMPAT mode in hw, compat_elf_check_arch would return false by compat_binfmt_elf.c Add CLASS to enhance (compat_)elf_check_arch to distinguish 32BIT/64BIT elf. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-16-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 87309e1082481bb78a9fbea6ed6784d979ff93c9 Author: Guo Ren Date: Tue Apr 5 15:13:08 2022 +0800 riscv: compat: Add elf.h implementation Implement necessary type and macro for compat elf. See the code comment for detail. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-15-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 69d0bf4cc668387f8b8bf89c2b77568c7bbe722e Author: Guo Ren Date: Tue Apr 5 15:13:07 2022 +0800 riscv: compat: process: Add UXL_32 support in start_thread If the current task is in COMPAT mode, set SR_UXL_32 in status for returning userspace. We need CONFIG _COMPAT to prevent compiling errors with rv32 defconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-14-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit dfb0bfa738f5c58b5c6e81262a0ee4ba154c3f28 Author: Guo Ren Date: Tue Apr 5 15:13:06 2022 +0800 riscv: compat: syscall: Add entry.S implementation Implement the entry of compat_sys_call_table[] in asm. Ref to riscv-privileged spec 4.1.1 Supervisor Status Register (sstatus): BIT[32:33] = UXL[1:0]: - 1:32 - 2:64 - 3:128 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Palmer Dabbelt Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-13-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 59c10c52f573faca862cda5ebcdd43831608eb5a Author: Guo Ren Date: Tue Apr 5 15:13:05 2022 +0800 riscv: compat: syscall: Add compat_sys_call_table implementation Implement compat sys_call_table and some system call functions: truncate64, ftruncate64, fallocate, pread64, pwrite64, sync_file_range, readahead, fadvise64_64 which need argument translation. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-12-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 01abdfeac81b5f56062d0a78f2cdc805db937a75 Author: Guo Ren Date: Tue Apr 5 15:13:04 2022 +0800 riscv: compat: Support TASK_SIZE for compat mode Make TASK_SIZE from const to dynamic detect TIF_32BIT flag function. Refer to arm64 to implement DEFAULT_MAP_WINDOW_64 for efi-stub. Limit 32-bit compatible process in 0-2GB virtual address range (which is enough for real scenarios), because it could avoid address sign extend problem when 32-bit enter 64-bit and ease software design. The standard 32-bit TASK_SIZE is 0x9dc00000:FIXADDR_START, and compared to a compatible 32-bit, it increases 476MB for the application's virtual address. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-11-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 06d0e3723647610936660c3c2a144c6243367c3c Author: Guo Ren Date: Tue Apr 5 15:13:03 2022 +0800 riscv: compat: Add basic compat data type implementation Implement riscv asm/compat.h for struct compat_xxx, is_compat_task, compat_user_regset, regset convert. The rv64 compat.h has inherited most of the structs from the generic one. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-10-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 72f045d19f25f19be6d7682d5b1d948e20580817 Author: Guo Ren Date: Tue Apr 5 15:13:02 2022 +0800 riscv: Fixup difference with defconfig Let's follow the origin patch's spirit: The only difference between rv32_defconfig and defconfig is that rv32_defconfig has CONFIG_ARCH_RV32I=y. This is helpful to compare rv64-compat-rv32 v.s. rv32-linux. Fixes: 1b937e8faa87ccfb ("RISC-V: Add separate defconfig for 32bit systems") Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-9-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit c86d2cad193a5c7f9b92467955bb7fb6642b9e80 Author: Guo Ren Date: Tue Apr 5 15:13:01 2022 +0800 syscalls: compat: Fix the missing part for __SYSCALL_COMPAT Make "uapi asm unistd.h" could be used for architectures' COMPAT mode. The __SYSCALL_COMPAT is first used in riscv. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-8-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 84a0c977ab9821a4b57f69d9a6108f64188d1e71 Author: Guo Ren Date: Tue Apr 5 15:13:00 2022 +0800 asm-generic: compat: Cleanup duplicate definitions There are 7 64bit architectures that support Linux COMPAT mode to run 32bit applications. A lot of definitions are duplicate: - COMPAT_USER_HZ - COMPAT_RLIM_INFINITY - COMPAT_OFF_T_MAX - __compat_uid_t, __compat_uid_t - compat_dev_t - compat_ipc_pid_t - struct compat_flock - struct compat_flock64 - struct compat_statfs - struct compat_ipc64_perm, compat_semid64_ds, compat_msqid64_ds, compat_shmid64_ds Cleanup duplicate definitions and merge them into asm-generic. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Link: https://lore.kernel.org/r/20220405071314.3225832-7-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit f18ed30db299458f809aec55bf1800dbeebeb953 Author: Guo Ren Date: Tue Apr 5 15:12:59 2022 +0800 fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT RISC-V doesn't neeed compat_stat, so using __ARCH_WANT_COMPAT_STAT to exclude unnecessary SYSCALL functions. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Link: https://lore.kernel.org/r/20220405071314.3225832-6-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 0cbed0ee1dbcd7ecd890e6af297c9d133f730021 Author: Guo Ren Date: Tue Apr 5 15:12:58 2022 +0800 arch: Add SYSVIPC_COMPAT for all architectures The existing per-arch definitions are pretty much historic cruft. Move SYSVIPC_COMPAT into init/Kconfig. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Acked-by: Arnd Bergmann Reviewed-by: Christoph Hellwig Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Link: https://lore.kernel.org/r/20220405071314.3225832-5-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 3ce0f2373f7073f04715b1ffd7b1812d3183f79a Author: Christoph Hellwig Date: Tue Apr 5 15:12:57 2022 +0800 compat: consolidate the compat_flock{,64} definition Provide a single common definition for the compat_flock and compat_flock64 structures using the same tricks as for the native variants. Another extra define is added for the packing required on x86. Signed-off-by: Christoph Hellwig Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Acked-by: Helge Deller # parisc Link: https://lore.kernel.org/r/20220405071314.3225832-4-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 306f7cc1e9061313c46d19e9bdffc819880794c1 Author: Christoph Hellwig Date: Tue Apr 5 15:12:56 2022 +0800 uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h The F_GETLK64/F_SETLK64/F_SETLKW64 fcntl opcodes are only implemented for the 32-bit syscall APIs, but are also needed for compat handling on 64-bit kernels. Consolidate them in unistd.h instead of definining the internal compat definitions in compat.h, which is rather error prone (e.g. parisc gets the values wrong currently). Note that before this change they were never visible to userspace due to the fact that CONFIG_64BIT is only set for kernel builds. Signed-off-by: Christoph Hellwig Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-3-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit 9f79b8b7233942e9c4b071f1f331f17e7282bbfa Author: Christoph Hellwig Date: Tue Apr 5 15:12:55 2022 +0800 uapi: simplify __ARCH_FLOCK{,64}_PAD a little Don't bother to define the symbols empty, just don't use them. That makes the intent a little more clear. Remove the unused HAVE_ARCH_STRUCT_FLOCK64 define and merge the 32-bit mips struct flock into the generic one. Add a new __ARCH_FLOCK_EXTRA_SYSID macro following the style of __ARCH_FLOCK_PAD to avoid having a separate definition just for one architecture. Signed-off-by: Christoph Hellwig Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Tested-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220405071314.3225832-2-guoren@kernel.org Signed-off-by: Palmer Dabbelt commit e87826efa9bbb0f9febaa21c3e4fdc0e09e27daf Author: Chia-I Wu Date: Tue Apr 12 13:48:09 2022 -0700 drm/sched: use __string in tracepoints Otherwise, ring names are marked [UNSAFE-MEMORY]. Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky Signed-off-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220412204809.824491-2-olvaffe@gmail.com commit 4a35c23f91b1a4c397e033b61bb9975ab5164f5a Author: Chia-I Wu Date: Tue Apr 12 13:48:08 2022 -0700 drm/sched: use DECLARE_EVENT_CLASS drm_sched_job and drm_run_job have the same prototype. v2: rename the class from drm_sched_job_entity to drm_sched_job (Andrey) Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky Signed-off-by: Andrey Grodzovsky Link: https://patchwork.freedesktop.org/patch/msgid/20220412204809.824491-1-olvaffe@gmail.com commit 4ae547cee61252b105115eabee27ec7466861179 Author: Yassine Oudjana Date: Sun Apr 24 12:46:47 2022 +0400 dt-bindings: arm: mediatek: infracfg: Convert to DT schema Convert infracfg bindings to DT schema format. Not all drivers currently implement resets, so #reset-cells is made a required property only for those that do. Using power-controller in the example node name makes #power-domain-cells required causing a dt_binding_check error. To solve this, the node is renamed to syscon@10001000. Signed-off-by: Yassine Oudjana Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424084647.76577-4-y.oudjana@protonmail.com commit 16a146735df3b67941ebf09a5fc871ac4584892d Author: Yassine Oudjana Date: Sun Apr 24 12:46:46 2022 +0400 dt-bindings: arm: mediatek: apmixedsys: Convert to DT schema Convert apmixedsys bindings to DT schema format. MT2701, MT7623 and MT7629 device trees currently have the syscon compatible without it being mentioned in the old DT bindings file which introduces dtbs_check errors when converting to DT schema as-is, so mediatek,mt2701-apmixedsys and mediatek,mt7629-apmixedsys are placed in the last items list with the syscon compatible, and syscon is added to the mediatek,mt7623-apmixedsys list. Signed-off-by: Yassine Oudjana Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424084647.76577-3-y.oudjana@protonmail.com commit cd9fdd06b0e8aafc715f239153ff41cbf12c991a Author: Yassine Oudjana Date: Sun Apr 24 12:46:45 2022 +0400 dt-bindings: arm: mediatek: topckgen: Convert to DT schema Convert topckgen bindings to DT schema format. MT2701, MT7623 and MT7629 device trees currently have the syscon compatible without it being mentioned in the old DT bindings file which introduces dtbs_check errors when converting to DT schema as-is, so mediatek,mt2701-topckgen and mediatek,mt7629-topckgen are placed in the last items list with the syscon compatible, and syscon is added to the mediatek,mt7623-topckgen list. Signed-off-by: Yassine Oudjana Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220424084647.76577-2-y.oudjana@protonmail.com commit c317ab71facc2cd0a94145973318a4c914e11acc Author: Menglong Dong Date: Mon Apr 25 21:32:47 2022 +0800 bpf: Compute map_btf_id during build time For now, the field 'map_btf_id' in 'struct bpf_map_ops' for all map types are computed during vmlinux-btf init: btf_parse_vmlinux() -> btf_vmlinux_map_ids_init() It will lookup the btf_type according to the 'map_btf_name' field in 'struct bpf_map_ops'. This process can be done during build time, thanks to Jiri's resolve_btfids. selftest of map_ptr has passed: $96 map_ptr:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Reported-by: kernel test robot Signed-off-by: Menglong Dong Signed-off-by: Alexei Starovoitov commit 3474b838f4204c21d108183d9268611d961a428f Author: Rob Herring Date: Fri Apr 22 14:21:21 2022 -0500 dt-bindings: Drop undocumented i.MX iomuxc-gpr bindings in examples The i.MX iomuxc-gpr bindings are undocumented and a mess. Drop their use from the examples. The problem with the binding beyond the just random variations is that the iomuxc-gpr is not a separate block, but registers within the iomuxc block containing random leftover controls. As a separate DT node, it creates nodes with overlapping memory addresses. Signed-off-by: Rob Herring Acked-by: Peter Rosin Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220422192121.2592030-1-robh@kernel.org commit ff23a46e4657a4ac2d2f4a481ca8e1e45a892136 Author: Stephen Boyd Date: Mon Apr 18 17:04:08 2022 -0700 mfd: cros_ec_dev: Only register PCHG device if present Don't create a device for the peripheral charger (PCHG) if there aren't any peripheral charger ports. This removes a device on most ChromeOS systems, because the peripheral charger functionality isn't always present. Cc: Prashant Malani Cc: Tzung-Bi Shih Cc: Daisuke Nojiri Cc: Benson Leung Cc: Guenter Roeck Cc: Signed-off-by: Stephen Boyd Reviewed-by: Prashant Malani Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220419000408.3202635-1-swboyd@chromium.org commit 4a901e305011e3a77873543386bd1c783b6509c0 Author: Fabien Parent Date: Fri Apr 15 17:36:25 2022 +0200 mfd: mt6397-core: Add resources for PMIC keys for MT6359 Add the MFD resources in order to be able to probe and use the keyboard driver for the MT6359 PMIC. Signed-off-by: Fabien Parent Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220415153629.1817202-4-fparent@baylibre.com commit 82028ba4d590c4e9eb3c93326019db7c26d02e35 Author: Fabien Parent Date: Fri Apr 15 17:36:24 2022 +0200 mfd: mt6359: Add missing defines necessary for mtk-pmic-keys support Add 2 missing MT6359 registers that are needed to implement the keyboard driver. Signed-off-by: Fabien Parent Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220415153629.1817202-3-fparent@baylibre.com commit febd8fdeac5ac1f722e96a51e43c0357624f369c Author: Guo Zhengkui Date: Mon Apr 25 19:47:00 2022 +0800 drm/nouveau/devinit/nva3-: fix returnvar.cocci warning Fix the following coccicheck warning: drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gt215.c:71:5-12: Unneeded variable: "disable". Return "0ULL" on line 85. Signed-off-by: Guo Zhengkui Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220425114701.7182-1-guozhengkui@vivo.com commit c6b61d48b369f92edc71a0c5dd0a9b98ea0b5397 Author: Yang Yingliang Date: Tue Apr 26 21:15:39 2022 +0800 clk: en7523: fix wrong pointer check in en7523_clk_probe() Check the real return value of devm_platform_ioremap_resource() in en7523_clk_probe(). Fixes: 1e6273179190 ("clk: en7523: Add clock driver for Airoha EN7523 SoC") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220426131539.388382-1-yangyingliang@huawei.com Acked-by: Felix Fietkau Signed-off-by: Stephen Boyd commit 942680d6192058ed56f50657250e34d8a2cc90e7 Author: Rob Herring Date: Fri Apr 22 14:19:57 2022 -0500 dt-bindings: Drop empty and unreferenced binding .txt files Drop a couple of old, empty .txt binding files which are no longer referenced. Signed-off-by: Rob Herring Acked-by: Alexandre Belloni Acked-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422191958.2589318-1-robh@kernel.org commit e53da8c490046e214528bad245521ffe9e7713c0 Author: Gene Chen Date: Thu Dec 24 11:19:49 2020 +0800 dt-bindings: mfd: mediatek: Add bindings for MT6360 PMIC Add bindings for MT6360 PMIC Signed-off-by: Gene Chen Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1608779989-9641-1-git-send-email-gene.chen.richtek@gmail.com commit 7f7166d0a84d20a4a36539658d6d8a591e8cb223 Author: Tom Rix Date: Mon Apr 25 09:13:08 2022 -0400 drm/nouveau/disp/gv100: make gv100_disp_wndw and gv100_disp_wndw_mthd static Sparse reports these issues wndwgv100.c:120:1: warning: symbol 'gv100_disp_wndw_mthd' was not declared. Should it be static? wndwgv100.c:140:1: warning: symbol 'gv100_disp_wndw' was not declared. Should it be static? These variable are only used in wndwgv100.c. Single file variables should be static. So use static as their storage-class specifiers. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220425131308.158635-1-trix@redhat.com commit 6a658c908cf0e2ee713f8c9e7844a95b824da0fc Author: Tom Rix Date: Mon Apr 25 09:00:50 2022 -0400 drm/nouveau/disp/gv100: make gv100_disp_wimm static Sparse reports this issue wimmgv100.c:39:1: warning: symbol 'gv100_disp_wimm' was not declared. Should it be static? This variable is only used in wimmgv100.c. Single file variables should be static. So use static as its storage-class specifier. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220425130050.1643103-1-trix@redhat.com commit 9e5e641045ff09ded4eb52828c4c7e110635422a Author: Adrian Hunter Date: Tue Apr 26 16:32:13 2022 +0300 perf intel-pt: Add link to the perf wiki's Intel PT page Add an EXAMPLE section and link to the perf wiki's Intel PT page. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20220426133213.248475-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ad9ee9f53c5b6594ca5c3676102280790c110ca6 Author: Tom Rix Date: Fri Apr 22 14:51:32 2022 -0400 drm/nouveau/kms/gv100: use static for gv100_disp_core_mthd_[base|sor] Sparse reports these issues coregv100.c:27:1: warning: symbol 'gv100_disp_core_mthd_base' was not declared. Should it be static? coregv100.c:43:1: warning: symbol 'gv100_disp_core_mthd_sor' was not declared. Should it be static? These variables are only used in coregv100.c. Single file use variables should be static, so add static to their storage-class specifier. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220422185132.3163248-1-trix@redhat.com commit 6aa98f6217861889523e38b0141c8c71b2ef8a83 Author: Sergey Matyukevich Date: Thu Apr 14 11:11:26 2022 +0300 ARC: bpf: define uapi for BPF_PROG_TYPE_PERF_EVENT program type Define appropriate uapi for the BPF_PROG_TYPE_PERF_EVENT program type by exporting the user_regs_struct structure instead of the pt_regs structure that is in-kernel only. Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta commit 9a78a8a8bb582743ce6747d978b58360c3c599d9 Author: Sergey Matyukevich Date: Thu Apr 14 11:17:24 2022 +0300 ARC: disasm: handle ARCv2 case in kprobe get/set functions Current implementation of get_reg/set_reg implies ARCompact layout of pt_regs structure. Meanwhile pt_regs structure differs between ARCompact and ARCv2. Update those functions to handle ARCv2. Tested-by: kernel test robot Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta commit 1552de67fbf0a51eab127fc15d55e9e1befdb156 Author: Allen-KH Cheng Date: Tue Apr 19 20:33:31 2022 +0800 remoteproc: mediatek: Allow reading firmware-name from DT The SCP firmware blob differs between platforms and SoCs. We add support in the SCP driver for reading the path of firmware file from DT in order to allow these files to live in a generic file system (or linux-firmware). The firmware-name property is optional and the code falls back to the old filename if the property isn't present. Signed-off-by: Allen-KH Cheng Reviewed-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220419123331.14377-3-allen-kh.cheng@mediatek.com Signed-off-by: Mathieu Poirier commit 31976eb180a199bc8d3e19b3e493158b1337c579 Author: Allen-KH Cheng Date: Tue Apr 19 20:33:30 2022 +0800 dt-bindings: remoteproc: mediatek: Add firmware-name property The SCP needs firmware which differs between other platforms and SoCs. Add a new property "firmware-name" to allow the DT to specify the platform/board specific path to this firmware file. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220419123331.14377-2-allen-kh.cheng@mediatek.com Signed-off-by: Mathieu Poirier commit 90209a3f5fb5731a376a63a8c2db8be3a8cecbe8 Merge: 4e55a6cf48119 b7da6f517214c Author: Mathieu Poirier Date: Tue Apr 26 10:16:45 2022 -0600 Merge branch 'rproc-fixes' into rproc-next commit 9235d5118fa4e31f4d71c45d788b6f08d18ab6e0 Author: lizhe Date: Sat Mar 19 23:45:29 2022 -0700 bus: brcmstb_gisb: Remove the suppress_bind_attrs attribute of the driver Even if platform_driver does not set suppress_bind_attrs attribute, when registering with platform_driver_probe, the value of suppress_bind_attrs is still true, see __platform_driver_probe(). Signed-off-by: lizhe Signed-off-by: Florian Fainelli commit b4bd2aafacce48db26b0a213d849818d940556dd Author: QintaoShen Date: Thu Mar 24 16:35:40 2022 +0800 soc: bcm: Check for NULL return of devm_kzalloc() As the potential failure of allocation, devm_kzalloc() may return NULL. Then the 'pd->pmb' and the follow lines of code may bring null pointer dereference. Therefore, it is better to check the return value of devm_kzalloc() to avoid this confusion. Fixes: 8bcac4011ebe ("soc: bcm: add PM driver for Broadcom's PMB") Signed-off-by: QintaoShen Signed-off-by: Florian Fainelli commit 322687d5968ba45755118feff9a64d2e6f2ae03d Author: oushixiong Date: Tue Apr 26 18:06:16 2022 +0800 drm/amd: Fix spelling typo in comment Signed-off-by: oushixiong Signed-off-by: Alex Deucher commit 2530dc3cd3dbca28c721eb0f14105bd17512b342 Author: Rongguang Wei Date: Tue Apr 26 16:15:29 2022 +0800 drm/amdgpu: fix typo Fix spelling mistake: "differnt" -> "different" "commond" -> "common" Signed-off-by: Rongguang Wei Signed-off-by: Alex Deucher commit 2f33a397e9605e70fe2082d727aa1501a9386b95 Author: Dan Carpenter Date: Tue Apr 26 11:49:20 2022 +0300 drm/amdgpu: debugfs: fix NULL dereference in ta_if_invoke_debugfs_write() If the kzalloc() fails then this code will crash. Return -ENOMEM instead. Fixes: e50d9ba0d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit a52ad5b6ce0df125d0d9ea169b61ae6cc098f047 Author: Dan Carpenter Date: Tue Apr 26 11:48:03 2022 +0300 drm/amdgpu: debugfs: fix error codes in write functions There are two error code bugs here. The copy_to/from_user() functions return the number of bytes remaining (a positive number). We should return -EFAULT if the copy fails. Second if we fail because "context.resp_status" is non-zero then return -EINVAL instead of zero. Fixes: e50d9ba0d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit a6f2e0d9fe6399ff060ae3de28089a4e0462b6cf Author: Zhenneng Li Date: Tue Apr 26 16:49:59 2022 +0800 gpu/drm/radeon: Fix typo in comments Signed-off-by: Zhenneng Li Signed-off-by: Alex Deucher commit 5533347dbb6158b9285c558e3578a48da95912a3 Author: David Zhang Date: Mon Apr 25 14:33:16 2022 -0400 drm/amd: add dc feature mask flags for PSR allow smu and multi-display optimizations [Why] Allow for PSR SMU optimization and PSR multiple display optimization. [How] Add feature flags of PSR smu optimization and PSR multiple display optimiztaion, and set them during init sequence. By default, flags are disabled. Signed-off-by: David Zhang Reviewed-by: Harry Wentland Reviewed-by: Roman Li Signed-off-by: Alex Deucher commit 3bbeaa307b54d90d2037090bbfc986dedd90e597 Author: Prike Liang Date: Tue Apr 19 17:22:34 2022 +0800 drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend Without MMHUB clock gating being enabled then MMHUB will not disconnect from DF and will result in DF C-state entry can't be accessed during S2idle suspend, and eventually s0ix entry will be blocked. Signed-off-by: Prike Liang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e6eb2c5f78cfd5d25aa108c576b30bc1869f7177 Author: Guo Zhengkui Date: Sun Apr 24 17:06:23 2022 +0800 drm/amd/display: fix if == else warning Fix the following coccicheck warning: drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c:98:8-10: WARNING: possible condition with no effect (if == else) Reviewed-by: Zhan Liu Signed-off-by: Guo Zhengkui Signed-off-by: Alex Deucher commit 0bed2ace42841bdffedecafa13b2380e085301cb Author: Alex Deucher Date: Mon Apr 25 12:05:32 2022 -0400 drm/amdgpu/display: Make dcn31_set_low_power_state static It's not used outside of dcn31_clk_mgr.c. Reported-by: kernel test robot Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 428f273cbb3f1349d27716bce0d7bd4dbfb4837f Author: Haohui Mai Date: Mon Apr 25 16:56:05 2022 +0800 drm/amdgpu: Fix out-of-bound access for gfx_v10_0_ring_test_ib() The gfx_v10_0_ring_test_ib() function uses 20 bytes instead of 16 bytes during the test. The patch sets the size of the allocation to be 4-byte larger to match the actual usage. Reviewed-by: Christian König Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit ca5d251b3b6e3aabf2d1bb7261c6b8e156b7ee16 Author: Haohui Mai Date: Mon Apr 25 20:23:38 2022 +0800 drm/amdgpu/sdma: Remove redundant lower_32_bits() calls when settings SDMA doorbell Updated the patch for the pre-vega hardware. I kept the clamping code to be safe. Reviewed-by: Christian König Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit 7dba6e838e741caadcf27ef717b6dcb561e77f89 Author: Haohui Mai Date: Mon Apr 25 20:41:38 2022 +0800 drm/amdgpu/sdma: Fix incorrect calculations of the wptr of the doorbells This patch fixes the issue where the driver miscomputes the 64-bit values of the wptr of the SDMA doorbell when initializing the hardware. SDMA engines v4 and later on have full 64-bit registers for wptr thus they should be set properly. Older generation hardwares like CIK / SI have only 16 / 20 / 24bits for the WPTR, where the calls of lower_32_bits() will be removed in a following patch. Reviewed-by: Christian König Signed-off-by: Haohui Mai Signed-off-by: Alex Deucher commit 9714d357e2ca763cc6a739f66ca67219beafd442 Author: Tom Rix Date: Sat Apr 23 16:01:55 2022 -0400 drm/radeon: change cac_weights_* to static Sparse reports these issues si_dpm.c:332:26: warning: symbol 'cac_weights_pitcairn' was not declared. Should it be static? si_dpm.c:1088:26: warning: symbol 'cac_weights_oland' was not declared. Should it be static? Both of these variables are only used in si_dpm.c. Single file variables should be static, so change their storage-class specifiers to static. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 790d8e8ecbacfa36be0b70e5a361e8ec4a55bdac Author: Tom Rix Date: Sat Apr 23 09:44:02 2022 -0400 drm/radeon: change cik_default_state table from global to static Sparse reports these issues cik_blit_shaders.c:31:11: warning: symbol 'cik_default_state' was not declared. Should it be static? cik_blit_shaders.c:246:11: warning: symbol 'cik_default_size' was not declared. Should it be static? cik_default_state and cik_default_size are only used in cik.c. Single file symbols should be static. So move their definitions to cik_blit_shaders.h and change their storage-class-specifier to static. Remove unneeded cik_blit_shader.c Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 4ae182de39e90d5eb005d3de44963be58fb172a6 Author: Randy Dunlap Date: Fri Apr 22 18:29:43 2022 -0700 drm/amd/display: fix non-kernel-doc comment warnings Fix kernel-doc warnings for a comment that should not use kernel-doc notation: dmub_psr.c:235: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Set PSR power optimization flags. dmub_psr.c:235: warning: missing initial short description on line: * Set PSR power optimization flags. Fixes: e5dfcd272722 ("drm/amd/display: dc_link_set_psr_allow_active refactoring") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Robin Chen Cc: Alex Deucher Cc: Anthony Koo Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: David Airlie Cc: Daniel Vetter Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 601354f344334fe7ee98b71ee3391a8a4215a7f9 Author: Philip Yang Date: Mon Apr 18 21:38:43 2022 -0400 drm/amdkfd: Update mapping if range attributes changed Change SVM range mapping flags or access attributes don't trigger migration, if range is already mapped on GPUs we should update GPU mapping and pass flush_tlb flag true to amdgpu vm. Change SVM range preferred_loc or migration granularity don't need update GPU mapping, skip the validate_and_map. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6b9c63a6eb540e678504a080865e9d3c716288ed Author: Philip Yang Date: Mon Apr 18 21:32:14 2022 -0400 drm/amdkfd: Add SVM range mapped_to_gpu flag To avoid unnecessary unmap SVM range from GPUs if range is not mapped on GPUs when migrating the range. This flag will also be used to flush TLB when updating the existing mapping on GPUs. It is protected by prange->migrate_mutex and mmap read lock in MMU notifier callback. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit df191796985922488e4e6b64f7bd79c3934412f2 Author: Arnaud Pouliquen Date: Tue Apr 26 14:05:36 2022 +0800 rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl Unregister the rpmsg_ctrl device instead of just freeing the the virtio_rpmsg_channel structure. This will properly unregister the device and call virtio_rpmsg_release_device() that frees the structure. Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device") Signed-off-by: Arnaud Pouliquen Reviewed-by: Hangyu Hua Link: https://lore.kernel.org/r/20220426060536.15594-4-hbh25y@gmail.com Signed-off-by: Mathieu Poirier commit 1680939e9ecf7764fba8689cfb3429c2fe2bb23c Author: Hangyu Hua Date: Tue Apr 26 14:05:35 2022 +0800 rpmsg: virtio: Fix possible double free in rpmsg_virtio_add_ctrl_dev() vch will be free in virtio_rpmsg_release_device() when rpmsg_ctrldev_register_device() fails. There is no need to call kfree() again. Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device") Signed-off-by: Hangyu Hua Tested-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220426060536.15594-3-hbh25y@gmail.com Signed-off-by: Mathieu Poirier commit 1b9728a08bfd2d2565e3643a9e965dc55aa9ede1 Author: Gustavo A. R. Silva Date: Thu Mar 3 11:25:03 2022 -0600 drm/amd/display: Fix Wstringop-overflow warnings in dc_link_dp.c Fix the following Wstringop-overflow warnings when building with GCC-11: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:493:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:493:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:493:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:388:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:388:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dpia.c:388:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1491:17: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2613:25: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:2613:25: warning: ‘dp_decide_lane_settings’ accessing 4 bytes in a region of size 1 [-Wstringop-overflow=] by removing the over-specified array size from the argument declarations. This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/181 Acked-by: Harry Wentland Signed-off-by: Gustavo A. R. Silva commit 54db804d5d7d36709d1ce70bde3b9a6c61b290b6 Author: Gustavo A. R. Silva Date: Thu Mar 3 17:55:21 2022 -0600 scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac() Fix the following Wstringop-overflow warnings when building with GCC-11: drivers/scsi/fcoe/fcoe.c: In function ‘fcoe_netdev_config’: drivers/scsi/fcoe/fcoe.c:744:32: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 744 | wwnn = fcoe_wwn_from_mac(ctlr->ctl_src_addr, 1, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/fcoe/fcoe.c:744:32: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/fcoe/fcoe.c:36: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ drivers/scsi/fcoe/fcoe.c:747:32: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 747 | wwpn = fcoe_wwn_from_mac(ctlr->ctl_src_addr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 748 | 2, 0); | ~~~~~ drivers/scsi/fcoe/fcoe.c:747:32: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/fcoe/fcoe.c:36: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ CC drivers/scsi/bnx2fc/bnx2fc_io.o In function ‘bnx2fc_net_config’, inlined from ‘bnx2fc_if_create’ at drivers/scsi/bnx2fc/bnx2fc_fcoe.c:1543:7: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:833:32: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 833 | wwnn = fcoe_wwn_from_mac(ctlr->ctl_src_addr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 834 | 1, 0); | ~~~~~ drivers/scsi/bnx2fc/bnx2fc_fcoe.c: In function ‘bnx2fc_if_create’: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:833:32: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/bnx2fc/bnx2fc.h:53, from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:17: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ In function ‘bnx2fc_net_config’, inlined from ‘bnx2fc_if_create’ at drivers/scsi/bnx2fc/bnx2fc_fcoe.c:1543:7: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:839:32: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 839 | wwpn = fcoe_wwn_from_mac(ctlr->ctl_src_addr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 840 | 2, 0); | ~~~~~ drivers/scsi/bnx2fc/bnx2fc_fcoe.c: In function ‘bnx2fc_if_create’: drivers/scsi/bnx2fc/bnx2fc_fcoe.c:839:32: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/bnx2fc/bnx2fc.h:53, from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:17: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ drivers/scsi/qedf/qedf_main.c: In function ‘__qedf_probe’: drivers/scsi/qedf/qedf_main.c:3520:30: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 3520 | qedf->wwnn = fcoe_wwn_from_mac(qedf->mac, 1, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/qedf/qedf_main.c:3520:30: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/qedf/qedf.h:9, from drivers/scsi/qedf/qedf_main.c:23: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ drivers/scsi/qedf/qedf_main.c:3521:30: warning: ‘fcoe_wwn_from_mac’ accessing 32 bytes in a region of size 6 [-Wstringop-overflow=] 3521 | qedf->wwpn = fcoe_wwn_from_mac(qedf->mac, 2, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/qedf/qedf_main.c:3521:30: note: referencing argument 1 of type ‘unsigned char *’ In file included from drivers/scsi/qedf/qedf.h:9, from drivers/scsi/qedf/qedf_main.c:23: ./include/scsi/libfcoe.h:252:5: note: in a call to function ‘fcoe_wwn_from_mac’ 252 | u64 fcoe_wwn_from_mac(unsigned char mac[MAX_ADDR_LEN], unsigned int, unsigned int); | ^~~~~~~~~~~~~~~~~ by changing the array size to the correct value of ETH_ALEN in the argument declaration. Also, fix a couple of checkpatch warnings: WARNING: function definition argument 'unsigned int' should also have an identifier name This helps with the ongoing efforts to globally enable -Wstringop-overflow. Link: https://github.com/KSPP/linux/issues/181 Fixes: 85b4aa4926a5 ("[SCSI] fcoe: Fibre Channel over Ethernet") Signed-off-by: Gustavo A. R. Silva commit c2eecefec5df1306eafce28ccdf1ca159a552ecc Author: Hangyu Hua Date: Tue Apr 26 14:05:34 2022 +0800 rpmsg: virtio: Fix possible double free in rpmsg_probe() vch will be free in virtio_rpmsg_release_device() when rpmsg_ns_register_device() fails. There is no need to call kfree() again. Fix this by changing error path from free_vch to free_ctrldev. Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device") Signed-off-by: Hangyu Hua Tested-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220426060536.15594-2-hbh25y@gmail.com Signed-off-by: Mathieu Poirier commit 746f1b0ac5bf6ecfb71674af210ae476aa714f46 Author: Len Baker Date: Fri Oct 29 19:27:46 2021 +0200 virt: acrn: Prefer array_size and struct_size over open coded arithmetic As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, use the array_size() helper to do the arithmetic instead of the argument "count * size" in the vzalloc() function. Also, take the opportunity to add a flexible array member of struct vm_memory_region_op to the vm_memory_region_batch structure. And then, change the code accordingly and use the struct_size() helper to do the arithmetic instead of the argument "size + size * count" in the kzalloc function. This code was detected with the help of Coccinelle and audited and fixed manually. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Acked-by: Fei Li Signed-off-by: Len Baker Signed-off-by: Gustavo A. R. Silva commit c7b607fa9325ccc94982774c505176677117689c Author: Colin Ian King Date: Tue Apr 26 13:25:31 2022 +0100 selftests/resctrl: Fix null pointer dereference on open failed Currently if opening /dev/null fails to open then file pointer fp is null and further access to fp via fprintf will cause a null pointer dereference. Fix this by returning a negative error value when a null fp is detected. Detected using cppcheck static analysis: tools/testing/selftests/resctrl/fill_buf.c:124:6: note: Assuming that condition '!fp' is not redundant if (!fp) ^ tools/testing/selftests/resctrl/fill_buf.c:126:10: note: Null pointer dereference fprintf(fp, "Sum: %d ", ret); Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark") Signed-off-by: Colin Ian King Signed-off-by: Shuah Khan commit cc68c613d6eeac921e6ef5987db5c764858fab1c Author: Len Baker Date: Sun Sep 19 11:44:32 2021 +0200 afs: Prefer struct_size over open coded arithmetic As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, use the struct_size() helper to do the arithmetic instead of the argument "size + size * count" in the kzalloc() function. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Len Baker Acked-by: David Howells Reviewed-by: Gustavo A. R. Silva Signed-off-by: Gustavo A. R. Silva commit 5bdcae1fe1c567c08e8bb7ef20fc70d0b70d5fc4 Author: Krzysztof Kozlowski Date: Mon Apr 4 08:40:16 2022 +0200 spi: dt-bindings: qcom,spi-geni-qcom: convert to dtschema Convert the GENI based Qualcomm Universal Peripheral (QUP) Serial Peripheral Interface (SPI) bindings to DT Schema. The original bindings in TXT were not complete, so add during conversion properties already used in DTS and/or in the driver: dmas, interconnects, operating points and power-domains. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220404064017.68634-1-krzysztof.kozlowski@linaro.org commit e8858ba89ca377064da130d09648c99683f8bd90 Author: Markuss Broks Date: Sat Apr 23 11:53:18 2022 +0300 regulator: sm5703-regulator: Add regulators support for SM5703 MFD Regulators block of SM5703 controls several voltage regulators which are used to power various components. There are 3 LDO outputs ranging from 1.5 to 3.3V, a buck regulator ranging from 1V to 3V, two fixed voltage LDO regulators for powering the USB devices and one high-power fixed voltage LDO line (actually two lines) meant to power high-power USB devices. Signed-off-by: Markuss Broks Link: https://lore.kernel.org/r/20220423085319.483524-6-markuss.broks@gmail.com Signed-off-by: Mark Brown commit d496d68d6ba6debcc135794edb5fdc5a5b4531f1 Author: Markuss Broks Date: Sat Apr 23 11:53:15 2022 +0300 dt-bindings: regulator: Add bindings for Silicon Mitus SM5703 regulators This patch adds device-tree bindings for regulators on Silicon Mitus SM5703 MFD. Signed-off-by: Markuss Broks Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220423085319.483524-3-markuss.broks@gmail.com Signed-off-by: Mark Brown commit 6cefb6264277c073030a3b2d91ba6b28593b4c89 Author: Uwe Kleine-König Date: Mon Apr 25 21:30:23 2022 +0200 ASoC: pcm1789: Make pcm1789_common_exit() return void This function returns zero unconditionally, so there isn't any benefit of returning a value. Make it return void to be able to see at a glance that the return value of pcm1789_i2c_remove() is always zero. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220425193023.61046-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit c85f533d51ca42a461a61303322b0cf74fb75a6b Author: Srinivasa Rao Mandadapu Date: Tue Apr 19 18:48:49 2022 +0530 ASoC: qcom: SC7280: Update machine driver startup, shutdown callbacks Update machine driver startup, shutdown callback functions to avoid sound card registration failure on other platforms. Without this change, platforms with WCD codec is failing to register sound card. Fixes: c5198db82d4c ("ASoC: qcom: Add driver support for ALC5682I-VS") Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1650374329-7279-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 3a2c9a553f4785555408b32d59ebfe125d8b9f09 Author: Ryan Lee Date: Mon Apr 25 10:37:15 2022 -0700 ASoC: dt-bindings: max98396: add amplifier driver This patch adds dt-bindings information for Analog Devices MAX98396 and MAX98397 Smart Amplifier. Signed-off-by: Ryan Lee Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220425173715.1827706-1-ryan.lee.analog@gmail.com Signed-off-by: Mark Brown commit b58581136770569d2ee4300b10c7c0d76bb86250 Author: Ryan Lee Date: Fri Apr 22 19:15:58 2022 -0700 ASoC: max98396: add amplifier driver This series of patches adds support for Analog Devices MAX98396 mono amplifier with IV sense. The device provides a PCM interface for audio data and a standard I2C interface for control data communication. This driver also supports MAX98397 which is a variant of MAX98396 with wide input supply range. Signed-off-by: Ryan Lee Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220423021558.1773598-1-ryan.lee.analog@gmail.com Signed-off-by: Mark Brown commit 0e631e065bcb92cc97b38a82e41695952145751d Author: Uwe Kleine-König Date: Mon Apr 25 21:32:06 2022 +0200 ASoC: tas6424: Return zero in remove callback The only effect of returning an error code in an i2c remove callback (compared to returning zero) is that the i2c core emits a generic warning. The device is still removed. So even if disabling the regulators fails it's sensible to return zero to suppress the additional generic and little helpful error message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220425193206.61710-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 3b49ae380ce1a3054e0c505dd9a356b82a5b48e8 Author: Lv Ruyi Date: Tue Apr 12 08:53:05 2022 +0000 mfd: ipaq-micro: Fix error check return value of platform_get_irq() platform_get_irq() return negative value on failure, so null check of irq is incorrect. Fix it by comparing whether it is less than zero. Fixes: dcc21cc09e3c ("mfd: Add driver for Atmel Microcontroller on iPaq h3xxx") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220412085305.2533030-1-lv.ruyi@zte.com.cn commit 7f5aaa4a0ae6948eace6cf30f40a3ec27ece8441 Author: Maíra Canal Date: Wed Apr 6 11:40:41 2022 -0300 mfd: hi655x-pmic: Replace legacy gpio interface for gpiod interface Considering the current transition of the GPIO subsystem, remove all dependencies of the legacy GPIO interface (linux/gpio.h and linux /of_gpio.h) and replace it with the descriptor-based GPIO approach. Signed-off-by: Maíra Canal Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/Yk2maZuf+5FGL+eg@fedora commit 54c861f930180e096483a6e1744c9c4b76e20da5 Author: Daniel Ammann Date: Tue Apr 5 14:54:25 2022 +0200 mfd: tps65218: Fix trivial typo in comment The driver is for TPS65218, not TPS65219. Signed-off-by: Daniel Ammann Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220405125426.28016-1-daniel.ammann@bytesatwork.ch commit 3e8d34ed49ccfdbfad0dc46b9e1e4a278c10fd24 Merge: f08699ec5bd92 19df0cfa258cd Author: Jani Nikula Date: Tue Apr 26 16:44:31 2022 +0300 Merge drm/drm-next into drm-intel-next Need to bring commit d8bb92e70a43 ("drm/dp: Factor out a function to probe a DPCD address") back as a dependency to further work in drm-intel-next. Signed-off-by: Jani Nikula commit ac9d25557dcc9fe90ed12bfbb6db401e892ca004 Author: Linus Walleij Date: Mon Apr 25 22:54:42 2022 +0200 mmc: core: Add CIDs for cards to the entropy pool To make the entropy pool a bit better we can toss in the CID for eMMC and SD cards into it, usually the serial number portion is at least unique. This does not count as improvement of the entropy but in practice it makes it a bit more random to mix in these numbers. Cc: Theodore Ts'o Acked-by: Jason A. Donenfeld Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220425205442.1347837-1-linus.walleij@linaro.org Signed-off-by: Ulf Hansson commit 23e09be254f95a5b75cd87f91a4014f3b46dda3f Author: Bean Huo Date: Sun Apr 24 00:16:23 2022 +0200 mmc: core: Allows to override the timeout value for ioctl() path Occasionally, user-land applications initiate longer timeout values for certain commands through ioctl() system call. But so far we are still using a fixed timeout of 10 seconds in mmc_poll_for_busy() on the ioctl() path, even if a custom timeout is specified in the userspace application. This patch allows custom timeout values to override this default timeout values on the ioctl path. Cc: stable Signed-off-by: Bean Huo Acked-by: Avri Altman Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220423221623.1074556-3-huobean@gmail.com Signed-off-by: Ulf Hansson commit 261a46a977c6babde207d5e979fe5cf779b067b9 Author: Sameer Pujar Date: Thu Mar 31 19:33:32 2022 +0530 arm64: tegra: Enable ASRC on various platforms Enable ASRC module usage on various Jetson Platforms. This can be plugged into an audio path using ALSA mixer controls. Signed-off-by: Sameer Pujar Signed-off-by: Thierry Reding commit 47a08153f32dc7d38953c84e3f2c07059411ce66 Author: Sameer Pujar Date: Thu Mar 31 19:33:31 2022 +0530 arm64: tegra: Add ASRC device on Tegra186 and later Asynchronous Sample Rate Converter (ASRC) is a client of AHUB and is present on Tegra186 and later generations of Tegra SoC. Add this device on the relevant SoC DTSI files. Signed-off-by: Sameer Pujar Signed-off-by: Thierry Reding commit aa88b7066a10e2cb5355478f22daa28794ab3835 Author: Stijn Tintel Date: Sun Apr 3 05:59:50 2022 +0300 MIPS: Octeon: support all interfaces on CN66XX CN66XX_PASS1_0 has 7 interfaces, other revisions have 8 interfaces. Signed-off-by: Stijn Tintel Signed-off-by: Thomas Bogendoerfer commit 407710a3b52c32db6f212727f06620f1c38ed1d2 Author: Stijn Tintel Date: Sun Apr 3 05:59:49 2022 +0300 MIPS: Octeon: fix CN6640 hang on XAUI init Some CN66XX series Octeon II chips seem to hang if a reset is issued on XAUI initialization. Avoid the hang by disabling the reset. Tested on SNIC10E. Signed-off-by: Stijn Tintel Signed-off-by: Thomas Bogendoerfer commit e46ab742195ae8760e03cb15fcf6f6a90fcad636 Author: Sameer Pujar Date: Thu Mar 31 19:33:30 2022 +0530 arm64: defconfig: Build Tegra ASRC module Asynchronous Sample Rate Converter (ASRC) module is a client of AHUB on Tegra186 and later SoCs. To use this module enable the driver build. Signed-off-by: Sameer Pujar Signed-off-by: Thierry Reding commit 4107fa700f314592850e2c64608f6ede4c077476 Author: Gong Yuanjun Date: Thu Apr 7 12:26:57 2022 +0800 mips: cpc: Fix refcount leak in mips_cpc_default_phys_base Add the missing of_node_put() to release the refcount incremented by of_find_compatible_node(). Signed-off-by: Gong Yuanjun Reviewed-by: Serge Semin Signed-off-by: Thomas Bogendoerfer commit 27498967d65c6a7c5fec5f2e33be5d8e84a775fd Author: Krzysztof Kozlowski Date: Thu Apr 7 16:33:28 2022 +0200 MIPS: dts: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Acked-by: Florian Fainelli Acked-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit fd27234f24ae11bd6a79234d9d30033152342085 Author: Christophe JAILLET Date: Sat Apr 23 15:27:58 2022 +0200 MIPS: SGI-IP30: Free some unused memory platform_device_add_data() duplicates the memory it is passed. So we can free some memory to save a few bytes that would remain unused otherwise. Signed-off-by: Christophe JAILLET Signed-off-by: Thomas Bogendoerfer commit 33d7085682b4aa212ebfadbc21da81dfefaaac16 Author: Christophe JAILLET Date: Sat Apr 23 15:24:03 2022 +0200 MIPS: SGI-IP27: Free some unused memory platform_device_add_data() duplicates the memory it is passed. So we can free some memory to save a few bytes that would remain unused otherwise. Signed-off-by: Christophe JAILLET Signed-off-by: Thomas Bogendoerfer commit c5acd61dbb32b6bda0f3a354108f2b8dcb788985 Author: Lv Ruyi Date: Mon Apr 18 10:57:55 2022 +0000 scsi: megaraid: Fix error check return value of register_chrdev() If major equals 0, register_chrdev() returns an error code when it fails. This function dynamically allocates a major and returns its number on success, so we should use "< 0" to check it instead of "!". Link: https://lore.kernel.org/r/20220418105755.2558828-1-lv.ruyi@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Martin K. Petersen commit 1497e95e22c3be382217da290106ab4f865dc1fa Author: Guo Zhengkui Date: Tue Apr 26 15:43:34 2022 +0800 scsi: qla2xxx: edif: Remove unneeded variable Fix the following coccicheck warning: drivers/scsi/qla2xxx/qla_edif.c:660:11-15: Unneeded variable: "rval". Return "0" on line 761. Link: https://lore.kernel.org/r/20220426074334.9281-1-guozhengkui@vivo.com Signed-off-by: Guo Zhengkui Signed-off-by: Martin K. Petersen commit ce7a1ecf3f9f1fccaf67295307614511d8e11b13 Author: Colin Ian King Date: Sun Apr 24 19:35:12 2022 +0100 drm/v3d: Fix null pointer dereference of pointer perfmon In the unlikely event that pointer perfmon is null the WARN_ON return path occurs after the pointer has already been deferenced. Fix this by only dereferencing perfmon after it has been null checked. Fixes: 26a4dc29b74a ("drm/v3d: Expose performance counters to userspace") Signed-off-by: Colin Ian King Reviewed-by: Juan A. Suarez Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220424183512.1365683-1-colin.i.king@gmail.com commit 036a45aa587a10fa2abbd50fbd0f6c4cfc44f69f Author: Xiaomeng Tong Date: Thu Apr 14 12:02:31 2022 +0800 scsi: dc395x: Fix a missing check on list iterator The bug is here: p->target_id, p->target_lun); The list iterator 'p' will point to a bogus position containing HEAD if the list is empty or no element is found. This case must be checked before any use of the iterator, otherwise it will lead to an invalid memory access. To fix this bug, add a check. Use a new variable 'iter' as the list iterator, and use the original variable 'p' as a dedicated pointer to point to the found element. Link: https://lore.kernel.org/r/20220414040231.2662-1-xiam0nd.tong@gmail.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Xiaomeng Tong Signed-off-by: Martin K. Petersen commit 1460af7de6ab33da82b8a1f03ce0f8e831a9e29e Author: Dylan Yudaken Date: Tue Apr 26 01:29:06 2022 -0700 io_uring: rename op -> opcode do this for consistency with the other trace messages Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220426082907.3600028-4-dylany@fb.com Signed-off-by: Jens Axboe commit 33337d03f04f9ea3a50ac2d3490a5d7a3ba9be82 Author: Dylan Yudaken Date: Tue Apr 26 01:29:05 2022 -0700 io_uring: add io_uring_get_opcode In some debug scenarios it is useful to have the text representation of the opcode. Add this function in preparation. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220426082907.3600028-3-dylany@fb.com Signed-off-by: Jens Axboe commit cc51eaa8b530bf070e76847a717adcbf603469b7 Author: Dylan Yudaken Date: Tue Apr 26 01:29:04 2022 -0700 io_uring: add type to op enum It is useful to have a type enum for opcodes, to allow the compiler to assert that every value is used in a switch statement. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220426082907.3600028-2-dylany@fb.com Signed-off-by: Jens Axboe commit 1e70d57e7285996bcf0a226eac8c5ba43a89f85d Author: Ilpo Järvinen Date: Tue Apr 26 15:24:42 2022 +0300 ACPI / property: Document RS485 _DSD properties Document RS485 related properties returned from ACPI _DSD as device properties. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220426122448.38997-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 103dcf2ea2df2669d3e4496974e6bb0911ff515f Author: Ilpo Järvinen Date: Tue Apr 26 15:24:41 2022 +0300 dt_bindings: rs485: Add receiver enable polarity Add polarity property for receiver enable. Some UARTs have separate enable pins for tx (RTS or DE) and rx (RE). As most RS485 transceivers have !RE pin, the default is active low in contrast to rs485-rts-active-low that defaults to active high. Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220426122448.38997-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5ff33917faca773e051d48ef37a6e95b2f8e4c5a Author: Ilpo Järvinen Date: Tue Apr 26 15:24:40 2022 +0300 serial: 8250_dwlib: Implement SW half duplex support This patch enables support for SW half-duplex mode using em485. Cc: Eric Tremblay Cc: Uwe Kleine-König Tested-by: Vicente Bergas Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220426122448.38997-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 642aa7603e95d0fdfc3e3fb8482561e89ca92a33 Author: Ilpo Järvinen Date: Tue Apr 26 15:24:39 2022 +0300 serial: 8250_dwlib: RS485 HW half & full duplex support The Synopsys DesignWare UART can be configured to have HW support for the RS485 protocol from IP version 4.0 onward. Add support for hardware-controlled half duplex and full duplex modes. HW will take care of managing DE and RE, the driver just gives it permission to use either by setting both to 1. To ask for full duplex mode, userspace sets SER_RS485_RX_DURING_TX flag and HW will take care of the rest. Set delay_rts_before_send and delay_rts_after_send to zero for now. The granularity of that ABI is too coarse to be useful. Co-developed-by: Heikki Krogerus Signed-off-by: Heikki Krogerus Co-developed-by: Raymond Tan Signed-off-by: Raymond Tan Co-developed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220426122448.38997-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a3ceb5882edf6696ebc6aeb8043ddec548a93052 Author: Hari Bathini Date: Wed Apr 6 15:08:39 2022 +0530 powerpc/fadump: print start of preserved area Print preserved area start address in fadump_region_show() function. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406093839.206608-4-hbathini@linux.ibm.com commit 9cf3b3a33a36ef4a988be0a770edd3555297f2a9 Author: Hari Bathini Date: Wed Apr 6 15:08:38 2022 +0530 powerpc/fadump: align destination address to pagesize On crash, boot memory area is copied to a destination address by f/w. This region is setup as separate PT_LOAD segment with appropriate offset to handle the different physical address and offset in vmcore. If this destination address is not page aligned, reading the vmcore with mmap is likely to fail forcing tools like makedumpfile to fall back to regular read. Avoid mmap read failure by ensuring that the destination address is always page aligned. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406093839.206608-3-hbathini@linux.ibm.com commit 15eb77f873255cf9f4d703b63cfbd23c46579654 Author: Hari Bathini Date: Wed Apr 6 15:08:37 2022 +0530 powerpc/fadump: fix PT_LOAD segment for boot memory area Boot memory area is setup as separate PT_LOAD segment in the vmcore as it is moved by f/w, on crash, to a destination address provided by the kernel. Having separate PT_LOAD segment helps in handling the different physical address and offset for boot memory area in the vmcore. Commit ced1bf52f477 ("powerpc/fadump: merge adjacent memory ranges to reduce PT_LOAD segements") inadvertly broke this pre-condition for cases where some of the first kernel memory is available adjacent to boot memory area. This scenario is rare but possible when memory for fadump could not be reserved adjacent to boot memory area owing to memory hole or such. Reading memory from a vmcore exported in such scenario provides incorrect data. Fix it by ensuring no other region is folded into boot memory area. Fixes: ced1bf52f477 ("powerpc/fadump: merge adjacent memory ranges to reduce PT_LOAD segements") Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406093839.206608-2-hbathini@linux.ibm.com commit 505420bd5543e806288a47ae3d2abeec8fc9642a Author: Xiaomeng Tong Date: Tue Apr 5 08:40:55 2022 +0800 scsi: qedf: Remove an unneeded NULL check on list iterator The list iterator 'fcport' is always non-NULL so it doesn't need to be checked. Thus just remove the unnecessary NULL check. Also remove the unnecessary initializer because the list iterator is always initialized. And adjust the position of blank lines. Link: https://lore.kernel.org/r/20220405004055.24312-1-xiam0nd.tong@gmail.com Signed-off-by: Xiaomeng Tong Signed-off-by: Martin K. Petersen commit 6584cec0a2255ab407d047d1b135fa0aae88d6c6 Author: Hari Bathini Date: Mon Apr 4 23:51:37 2022 +0530 powerpc/fadump: save CPU reg data in vmcore when PHYP terminates LPAR An LPAR can be terminated by the POWER Hypervisor (PHYP) for various reasons. If FADump was configured when PHYP terminates the LPAR, platform-assisted dump is initiated to save the kernel dump. But CPU register data would not be processed/saved in the vmcore in such case because CPU mask is set in crash_fadump() at the time of kernel crash and it remains unset in this case with LPAR being terminated by PHYP abruptly. To get around the problem, initialize cpu_mask to cpu_possible_mask so as to ensure all possible CPUs' register data is processed for the vmcore generated on PHYP terminated LPAR. Also, rename the crash info member variable from online_mask to cpu_mask as it doesn't necessarily have to be online CPU mask always. Signed-off-by: Hari Bathini Reviewed-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220404182137.59231-1-hbathini@linux.ibm.com commit b74196af372f7cb4902179009265fe63ac81824f Author: Hari Bathini Date: Wed Apr 21 23:20:52 2021 +0530 powerpc/fadump: Fix fadump to work with a different endian capture kernel Dump capture would fail if capture kernel is not of the endianess as the production kernel, because the in-memory data structure (struct opal_fadump_mem_struct) shared across production kernel and capture kernel assumes the same endianess for both the kernels, which doesn't have to be true always. Fix it by having a well-defined endianess for struct opal_fadump_mem_struct. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/161902744901.86147.14719228311655123526.stgit@hbathini commit ab406816fca009349b89cbde885daf68a8c77e33 Author: John Ogness Date: Thu Apr 21 23:28:50 2022 +0206 printk: remove @console_locked The static global variable @console_locked is used to help debug VT code to make sure that certain code paths are running with the console_lock held. However, this information is also available with the static global variable @console_kthreads_blocked (for locking via console_lock()), and the static global variable @console_kthreads_active (for locking via console_trylock()). Remove @console_locked and update is_console_locked() to use the alternative variables. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-16-john.ogness@linutronix.de commit 8e274732115f63c1d09136284431b3555bd5cc56 Author: John Ogness Date: Mon Apr 25 23:04:28 2022 +0206 printk: extend console_lock for per-console locking Currently threaded console printers synchronize against each other using console_lock(). However, different console drivers are unrelated and do not require any synchronization between each other. Removing the synchronization between the threaded console printers will allow each console to print at its own speed. But the threaded consoles printers do still need to synchronize against console_lock() callers. Introduce a per-console mutex and a new console boolean field @blocked to provide this synchronization. console_lock() is modified so that it must acquire the mutex of each console in order to set the @blocked field. Console printing threads will acquire their mutex while printing a record. If @blocked was set, the thread will go back to sleep instead of printing. The reason for the @blocked boolean field is so that console_lock() callers do not need to acquire multiple console mutexes simultaneously, which would introduce unnecessary complexity due to nested mutex locking. Also, a new field was chosen instead of adding a new @flags value so that the blocked status could be checked without concern of reading inconsistent values due to @flags updates from other contexts. Threaded console printers also need to synchronize against console_trylock() callers. Since console_trylock() may be called from any context, the per-console mutex cannot be used for this synchronization. (mutex_trylock() cannot be called from atomic contexts.) Introduce a global atomic counter to identify if any threaded printers are active. The threaded printers will also check the atomic counter to identify if the console has been locked by another task via console_trylock(). Note that @console_sem is still used to provide synchronization between console_lock() and console_trylock() callers. A locking overview for console_lock(), console_trylock(), and the threaded printers is as follows (pseudo code): console_lock() { down(&console_sem); for_each_console(con) { mutex_lock(&con->lock); con->blocked = true; mutex_unlock(&con->lock); } /* console_lock acquired */ } console_trylock() { if (down_trylock(&console_sem) == 0) { if (atomic_cmpxchg(&console_kthreads_active, 0, -1) == 0) { /* console_lock acquired */ } } } threaded_printer() { mutex_lock(&con->lock); if (!con->blocked) { /* console_lock() callers blocked */ if (atomic_inc_unless_negative(&console_kthreads_active)) { /* console_trylock() callers blocked */ con->write(); atomic_dec(&console_lock_count); } } mutex_unlock(&con->lock); } The console owner and waiter logic now only applies between contexts that have taken the console_lock via console_trylock(). Threaded printers never take the console_lock, so they do not have a console_lock to handover. Tasks that have used console_lock() will block the threaded printers using a mutex and if the console_lock is handed over to an atomic context, it would be unable to unblock the threaded printers. However, the console_trylock() case is really the only scenario that is interesting for handovers anyway. @panic_console_dropped must change to atomic_t since it is no longer protected exclusively by the console_lock. Since threaded printers remain asleep if they see that the console is locked, they now must be explicitly woken in __console_unlock(). This means wake_up_klogd() calls following a console_unlock() are no longer necessary and are removed. Also note that threaded printers no longer need to check @console_suspended. The check for the @blocked field implicitly covers the suspended console case. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/878rrs6ft7.fsf@jogness.linutronix.de commit 8ad8edd2fbaedbd4761c14319df26db2b556376e Author: Wan Jiabing Date: Tue Apr 26 18:45:07 2022 +0800 scsi: ufs: core: Remove duplicate include in ufshcd Fix following checkincludes warning: drivers/scsi/ufs/ufshcd.c: linux/nls.h is included more than once. The include is in line 14. Remove the duplicate. Link: https://lore.kernel.org/r/20220426104509.621394-1-wanjiabing@vivo.com Reviewed-by: Avri Altman Signed-off-by: Wan Jiabing Signed-off-by: Martin K. Petersen commit ef60031022eb6d972aac86ca26c98c33e1289436 Author: Kiwoong Kim Date: Thu Mar 31 10:24:05 2022 +0900 scsi: ufs: core: Exclude UECxx from SFR dump list Some devices may return invalid or zeroed data during an UIC error condition. In addition, reading these SFRs will clear them. This means the subsequent error handling will not be able to see them and therefore no error handling will be scheduled. Skip reading these SFRs in ufshcd_dump_regs(). Link: https://lore.kernel.org/r/1648689845-33521-1-git-send-email-kwmad.kim@samsung.com Fixes: d67247566450 ("scsi: ufs: Use explicit access size in ufshcd_dump_regs") Signed-off-by: Kiwoong Kim Signed-off-by: Martin K. Petersen commit 2deb9739bc133c6a0488f580d90351b72cadf81e Author: Samuel Holland Date: Sun Apr 24 11:26:32 2022 -0500 drm/sun4i: Add compatible for D1 display engine Now that the various blocks in the D1 display engine pipeline are supported, we can enable the overall engine. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-15-samuel@sholland.org commit b9b52d2f4aafa2bd637ace0f24615bdad8e49f01 Author: Samuel Holland Date: Sun Apr 24 11:26:31 2022 -0500 drm/sun4i: Add support for D1 TCONs D1 has a TCON TOP, so its quirks are similar to those for the R40 TCONs. While there are some register changes, the part of the TCON TV supported by the driver matches the R40 quirks, so that quirks structure can be reused. D1 has the first supported TCON LCD with a TCON TOP, so the TCON LCD needs a new quirks structure. D1's TCON LCD hardware supports LVDS; in fact it provides dual-link LVDS from a single TCON. However, it comes with a brand new LVDS PHY. Since this PHY has not been tested, leave out LVDS driver support for now. Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-14-samuel@sholland.org commit a359beb4e66b66e6b9a06036e7da7d7cf9cb1169 Author: Samuel Holland Date: Sun Apr 24 11:26:30 2022 -0500 drm/sun4i: Add support for D1 TCON TOP D1 has a TCON TOP with TCON TV0 and DSI, but no TCON TV1. This puts the DSI clock name at index 1 in clock-output-names. Support this by only incrementing the index for clocks that are actually supported. Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-13-samuel@sholland.org commit 30d334ce97ae999f190488a38445507cd36828cc Author: Samuel Holland Date: Sun Apr 24 11:26:29 2022 -0500 drm/sun4i: Add support for D1 mixers D1 has a display engine with the usual pair of mixers, albeit with relatively few layers. In fact, D1 appears to be the first SoC to have a mixer without any UI layers. Add support for these new variants. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-12-samuel@sholland.org commit b2da819209b6d60df4e409ecaeb184bf3670bdee Author: Samuel Holland Date: Sun Apr 24 11:26:28 2022 -0500 drm/sun4i: csc: Add support for the new MMIO layout D1 changes the MMIO offsets for the CSC blocks in the first mixer. The mixers' ccsc property is used as an index into the ccsc_base array. Use an enumeration to describe this index, and add the new set of offsets. Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-11-samuel@sholland.org commit c3779dab242f09c0a50753e32028d56070bf6f2f Author: Samuel Holland Date: Sun Apr 24 11:26:27 2022 -0500 drm/sun4i: Allow VI layers to be primary planes D1's mixer 1 has no UI layers, only a single VI layer. That means the mixer can only be used if the primary plane comes from this VI layer. Add the code to handle this case. Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-10-samuel@sholland.org commit 1f8a21af2171909d02257e715a47fda4cb000d81 Author: Jernej Skrabec Date: Sun Apr 24 11:26:26 2022 -0500 sun4i/drm: sun8i: use mode_set engine callback Newly introduced mode_set callback in engine structure is a much better place for setting mixer output size and interlace mode for the following reasons: 1. Aforementioned properties change only when mode changes, so it's enough to be set only once per mode set. Currently it's done whenever properties of primary plane are changed. 2. It's assumed that primary plane will always cover whole screen. While this is true most of the time, it's not always. DE2/3 planes are universal and mostly equal in functionality. There is no reason to add artificial limitation to primary planes. 3. The current code only works for UI layers, but some mixers do not have any UI layers. Signed-off-by: Jernej Skrabec [Samuel: update commit message] Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-9-samuel@sholland.org commit b5fc1c2a8bbdeaed65ac79338bcb70b2a852a2b3 Author: Jernej Skrabec Date: Sun Apr 24 11:26:25 2022 -0500 sun4i/drm: backend: use mode_set engine callback Newly introduced mode_set callback in engine structure is a much better place for setting backend output size and interlace mode for following reasons: 1. Aforementioned properties change only when mode changes, so it's enough to be set only once per mode set. Currently it's done whenever properties of primary plane are changed. 2. It's assumed that primary plane will always cover whole screen. While this is true most of the time, it's not always. Planes are universal. There is no reason to add artificial limitation to primary plane. Signed-off-by: Jernej Skrabec [Samuel: drop unused 'interlaced' variable] Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-8-samuel@sholland.org commit f7e974a31881957148110d3cc52774a4e279ef84 Author: Jernej Skrabec Date: Sun Apr 24 11:26:24 2022 -0500 sun4i/drm: engine: Add mode_set callback This optional callback is useful for setting properties which depends only on current mode. Such properties are width, height and interlaced output. These properties are currently set in update layer callback for primary plane which is less than ideal. More about that in follow up patches, which will migrate that code to this newly defined callback. Signed-off-by: Jernej Skrabec Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-7-samuel@sholland.org commit 7d57f7f7975634a7a6c5b5adcfe70450426a830b Author: Samuel Holland Date: Sun Apr 24 11:26:23 2022 -0500 drm/sun4i: Allow building the driver on RISC-V Allwinner D1 is a RISC-V SoC which contains a DE 2.0 engine. Let's remove the dependency on a specific CPU architecture, so the driver can be built wherever ARCH_SUNXI is selected. Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-6-samuel@sholland.org commit adfda0bb86183ac3b5bb0c76813bfca0fe6d5166 Author: Samuel Holland Date: Sun Apr 24 11:26:22 2022 -0500 drm/sun4i: hdmi: Use more portable I/O helpers readsb/writesb are unavailable on some architectures. In preparation for removing the Kconfig architecture dependency, switch to the equivalent but more portable ioread/write8_rep helpers. Reported-by: kernel test robot Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-5-samuel@sholland.org commit ae5a5d26c15c65cb9bea2f90c9a6405d300e7c76 Author: Samuel Holland Date: Sun Apr 24 11:26:20 2022 -0500 dt-bindings: display: Add D1 display engine compatibles Allwinner D1 contains a display engine 2.0. It features two mixers, a TCON TOP (with DSI and HDMI), one TCON LCD, and one TCON TV. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-3-samuel@sholland.org commit 2368a93789513d5725885b4b7df6a14e72dc3e35 Author: Samuel Holland Date: Sun Apr 24 11:26:19 2022 -0500 dt-bindings: display: Separate clock item lists by compatible So far, the binding and driver have relied on the fact that the H6 clocks are both a prefix and a subset of the R40 clocks. This allows them to share the clocks/clock-names items and the clock-output-names order between the hardware variants. However, the D1 hardware has TCON TV0 and DSI, but no TCON TV1. This cannot be supported by the existing scheme because it puts a gap in the middle of the item lists. To prepare for adding D1 support, use separate lists for variants with different combinations of clocks. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-2-samuel@sholland.org commit 973dac8a8a14a7fcfd4fa0b682851f415eb91b04 Author: John Garry Date: Wed Mar 30 19:38:35 2022 +0800 scsi: core: Refine how we set tag_set NUMA node For SCSI hosts which enable host_tagset the NUMA node returned from blk_mq_hw_queue_to_node() is NUMA_NO_NODE always. Then, since in scsi_mq_setup_tags() the default we choose for the tag_set NUMA node is NUMA_NO_NODE, we always evaluate the NUMA node as NUMA_NO_NODE in functions like blk_mq_alloc_rq_map(). The reason we get NUMA_NO_NODE from blk_mq_hw_queue_to_node() is that the hctx_idx passed is BLK_MQ_NO_HCTX_IDX - so we can't match against a (HW) queue mapping index. Improve this by defaulting the tag_set NUMA node to the same NUMA node of the SCSI host DMA dev. Link: https://lore.kernel.org/r/1648640315-21419-1-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 897ae3fe1216e52f2a5f28b37b4be8e6a9cb1bfa Author: Bean Huo Date: Sun Apr 24 00:16:22 2022 +0200 mmc: sdhci-omap: Use of_device_get_match_data() helper Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of open coding of_match_device(). Signed-off-by: Bean Huo Link: https://lore.kernel.org/r/20220423221623.1074556-2-huobean@gmail.com Signed-off-by: Ulf Hansson commit c7666240ec76422cb7546bd07cc8ae80dc0ccdd2 Author: Vignesh Raghavendra Date: Mon Apr 25 12:01:20 2022 +0530 drivers: mmc: sdhci_am654: Add the quirk to set TESTCD bit The ARASAN MMC controller on Keystone 3 class of devices need the SDCD line to be connected for proper functioning. Similar to the issue pointed out in sdhci-of-arasan.c driver, commit 3794c542641f ("mmc: sdhci-of-arasan: Set controller to test mode when no CD bit"). In cases where this can't be connected, add a quirk to force the controller into test mode and set the TESTCD bit. Use the flag "ti,fails-without-test-cd", to implement this above quirk when required. Signed-off-by: Vignesh Raghavendra Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220425063120.10135-3-a-govindraju@ti.com Signed-off-by: Ulf Hansson commit 7a0587496a6233b9ffa8441573d38f8844751066 Author: Aswath Govindraju Date: Mon Apr 25 12:01:19 2022 +0530 dt-bindings: mmc: sdhci-am654: Add flag to force setting of TESTCD bit The ARASAN MMC controller on Keystone 3 class of devices needs the SDCD line to be connected for proper functioning. Similar to the issue pointed out in sdhci-of-arasan.c driver, commit 3794c542641f ("mmc: sdhci-of-arasan: Set controller to test mode when no CD bit"). In cases where SDCD line is not connected, adding "ti,fails-without-test-cd" in the DT node helps to indicate the controller, that the SDCD line has been pulled down, using the TESTCD bit. Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220425063120.10135-2-a-govindraju@ti.com Signed-off-by: Ulf Hansson commit c25a7e5d18ba6e88932ef8ebcf6635cca630d032 Merge: cfb646613649c 4bc31edebde51 Author: Ulf Hansson Date: Tue Apr 26 14:05:26 2022 +0200 Merge branch 'fixes' into next commit cfb646613649c013591a9d5a4dc8f5db3e7ac25b Author: Abel Vesa Date: Tue Apr 19 14:35:12 2022 +0300 dt-bindings: mmc: imx-esdhc: Add i.MX8DXL compatible string Add i.MX8DXL compatible string. It also needs "fsl,imx8qm-fec" compatible. Signed-off-by: Abel Vesa Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220419113516.1827863-10-abel.vesa@nxp.com Signed-off-by: Ulf Hansson commit a18f3e46537434537bc3c11d33ef529c52370815 Author: Chris Packham Date: Tue Apr 19 14:46:11 2022 +1200 dt-bindings: mmc: convert sdhci-dove to JSON schema Convert the sdhci-dove binding to JSON schema. The optional clocks property was not in the original binding document but has been in the dove.dtsi since commit 5b03df9ace68 ("ARM: dove: switch to DT clock providers"). Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220419024611.1327525-5-chris.packham@alliedtelesis.co.nz Signed-off-by: Ulf Hansson commit a778dbd9a8ef30c07eaa7f46292d88f0a3b51e23 Author: Chris Packham Date: Tue Apr 19 14:46:10 2022 +1200 dt-bindings: mmc: convert orion-sdio to JSON schema Convert the orion-sdio binding to JSON schema. Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220419024611.1327525-4-chris.packham@alliedtelesis.co.nz Signed-off-by: Ulf Hansson commit de6e855b28f4c54eb04582cd468c6fa17577c8cc Author: Linus Walleij Date: Sun Apr 17 16:42:23 2022 +0200 dt-bindings: mmc: Add small binding note on level shifters The VQMMC is often provided by a level shifter, so drop a small note in the bindings that this can be the case and how that is done. It is helpful information since this is pretty common. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220417144223.649201-1-linus.walleij@linaro.org Signed-off-by: Ulf Hansson commit f7ad75041ba9b36d8141a1c0dd527154ed10b96e Author: Linus Walleij Date: Sun Apr 17 00:45:49 2022 +0200 mmc: mmci: Break IRQ status loop when all zero We iterate an extra time through the IRQ status handling loop despite nothing had fired. Enabling the debug prints: mmci-pl18x 80005000.mmc: op 01 arg 00000000 flags 000000e1 mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001 mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000 mmci-pl18x 80005000.mmc: op 01 arg 40ff8080 flags 000000e1 mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000001 mmci-pl18x 80005000.mmc: irq0 (data+cmd) 00000000 It is pointless to loop through the function when status is zero. Just break the loop if the status is zero. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220416224549.627623-1-linus.walleij@linaro.org Signed-off-by: Ulf Hansson commit 238b638b309093b77852137bcffd98702b95564f Author: Heiner Kallweit Date: Sat Apr 16 01:12:01 2022 +0200 mmc: meson-gx: switch to device-managed dmam_alloc_coherent() Using the device-managed version allows to simplify clean-up in probe() error path and remove(). Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/268b3cd5-2388-2553-bdba-c72853f91aa3@gmail.com Signed-off-by: Ulf Hansson commit 36ed2fd32b2cf7ff49804fae455e58e4d3b3bcad Author: Ben Chuang Date: Thu Apr 14 17:49:45 2022 +0800 mmc: sdhci-pci-gli: A workaround to allow GL9755 to enter ASPM L1.2 When GL9755 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9755 to enter ASPM L1.2. Signed-off-by: Ben Chuang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220414094945.457500-1-benchuanggli@gmail.com Signed-off-by: Ulf Hansson commit 13acb62ce1ee7377ef03034fbbad6f5499464b86 Author: Wolfram Sang Date: Tue Apr 12 11:31:02 2022 +0200 mmc: sh_mmcif: move platform_data header to proper location We have a dedicated directory for platform_data meanwhile, don't spoil the MMC directory with it. Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220412093102.3428-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit afadb04f1d6e74b18a253403f5274cde5e3fd7bd Author: Aidan MacDonald Date: Mon Apr 11 16:37:53 2022 +0100 mmc: jz4740: Apply DMA engine limits to maximum segment size Do what is done in other DMA-enabled MMC host drivers (cf. host/mmci.c) and limit the maximum segment size based on the DMA engine's capabilities. This is needed to avoid warnings like the following with CONFIG_DMA_API_DEBUG=y. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 21 at kernel/dma/debug.c:1162 debug_dma_map_sg+0x2f4/0x39c DMA-API: jz4780-dma 13420000.dma-controller: mapping sg segment longer than device claims to support [len=98304] [max=65536] CPU: 0 PID: 21 Comm: kworker/0:1H Not tainted 5.18.0-rc1 #19 Workqueue: kblockd blk_mq_run_work_fn Stack : 81575aec 00000004 80620000 80620000 80620000 805e7358 00000009 801537ac 814c832c 806276e3 806e34b4 80620000 81575aec 00000001 81575ab8 09291444 00000000 00000000 805e7358 81575958 ffffffea 8157596c 00000000 636f6c62 6220646b 80387a70 0000000f 6d5f6b6c 80620000 00000000 81575ba4 00000009 805e170c 80896640 00000001 00010000 00000000 00000000 00006098 806e0000 ... Call Trace: [<80107670>] show_stack+0x84/0x120 [<80528cd8>] __warn+0xb8/0xec [<80528d78>] warn_slowpath_fmt+0x6c/0xb8 [<8016f1d4>] debug_dma_map_sg+0x2f4/0x39c [<80169d4c>] __dma_map_sg_attrs+0xf0/0x118 [<8016a27c>] dma_map_sg_attrs+0x14/0x28 [<804f66b4>] jz4740_mmc_prepare_dma_data+0x74/0xa4 [<804f6714>] jz4740_mmc_pre_request+0x30/0x54 [<804f4ff4>] mmc_blk_mq_issue_rq+0x6e0/0x7bc [<804f5590>] mmc_mq_queue_rq+0x220/0x2d4 [<8038b2c0>] blk_mq_dispatch_rq_list+0x480/0x664 [<80391040>] blk_mq_do_dispatch_sched+0x2dc/0x370 [<80391468>] __blk_mq_sched_dispatch_requests+0xec/0x164 [<80391540>] blk_mq_sched_dispatch_requests+0x44/0x94 [<80387900>] __blk_mq_run_hw_queue+0xb0/0xcc [<80134c14>] process_one_work+0x1b8/0x264 [<80134ff8>] worker_thread+0x2ec/0x3b8 [<8013b13c>] kthread+0x104/0x10c [<80101dcc>] ret_from_kernel_thread+0x14/0x1c ---[ end trace 0000000000000000 ]--- Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220411153753.50443-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Ulf Hansson commit 6c1757be927ab1800754b14df01ad56da795339a Author: Adam Ford Date: Sun Apr 10 14:35:41 2022 -0500 dt-bindings: mmc: imx-esdhc: Update compatible fallbacks The SDHC controller in the imx8mn and imx8mp have the same controller as the imx8mm which is slightly different than that of the imx7d. Using the fallback of the imx8mm enables the controllers to support HS400-ES which is not available on the imx7d. After discussion with NXP, it turns out that the imx8qm should fall back to the imx8qxp, because those have some additional flags not present in the imx8mm. Mark the current state of the fallbacks as deprecated, and add the proper fallbacks so in the future, the deprecated combination can be removed and prevent any future devices from using the wrong fallback. Suggested-by: haibo.chen@nxp.com Signed-off-by: Adam Ford Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220410193544.1745684-1-aford173@gmail.com Signed-off-by: Ulf Hansson commit 32f18e596141f40dbc5d8700b2730371ffd3055f Author: Wolfram Sang Date: Fri Apr 8 10:00:44 2022 +0200 mmc: improve API to make clear hw_reset callback is for cards To make it unambiguous that the hw_reset callback is for cards and not for controllers, we add 'card' to the callback name and convert all users in one go. We keep the argument as mmc_host, though, because the callback is used very early when mmc_card is not yet populated. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220408080045.6497-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 9723f69d1de37ca25474372ad1753ea39bb0dce1 Author: Wolfram Sang Date: Fri Apr 8 10:00:43 2022 +0200 mmc: core: improve API to make clear that mmc_sw_reset is for cards To make it unambiguous that mmc_sw_reset() is for cards and not for controllers, we make the function argument mmc_card instead of mmc_host. There are no users to convert currently. Suggested-by: Ulf Hansson Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220408080045.6497-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 01c5d28a5b55d220c953dae7f8c3b7af23f982a9 Author: Lad Prabhakar Date: Mon Apr 4 18:41:59 2022 +0100 MAINTAINERS: Add linux-renesas-soc@vger.kernel.org list for Renesas TMIO/SDHI driver Add linux-renesas-soc@vger.kernel.org list entry for Renesas TMIO/SDHI driver. Signed-off-by: Lad Prabhakar Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20220404174159.571-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Ulf Hansson commit a252a4d3d4af0b19066e17f4f2514ad52dc49106 Author: Wolfram Sang Date: Mon Apr 4 15:05:51 2022 +0200 mmc: renesas_sdhi: remove superfluous specific M3W entry We don't need to specify the Gen3 compatible entry for M3W because it will be provided by the generic Gen3 fallback. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220404130551.20209-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit f504dee2c63b93fddb2dc42f37971e9f36c021e7 Author: Wolfram Sang Date: Mon Apr 4 14:34:04 2022 +0200 mmc: renesas_sdhi: R-Car V3H ES2.0 gained HS400 support The hardware evolved, so we only need to disable HS400 support on ES1.* revisions. Update the code. Signed-off-by: Takeshi Saito [wsa: refactored to top-of-tree] Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220404123404.16289-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit e3e5255e772850311d8ee0c34777cdd3701fa093 Author: Janusz Krzysztofik Date: Sat Apr 2 13:20:04 2022 +0200 mmc: omap: Make it CCF clk API compatible The driver, OMAP specific, now omits clk_prepare/unprepare() steps, not supported by OMAP custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220402112004.129886-1-jmkrzyszt@gmail.com Signed-off-by: Ulf Hansson commit 25bbf0daec560e7e4b499baa5a84089b06535701 Author: Christian Löhle Date: Thu Mar 31 07:28:47 2022 +0000 mmc: mmc_spi: parse speed mode options Since SD and MMC Highspeed modes are also valid for SPI let's parse them too. Signed-off-by: Christian Loehle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20c6efa9a4c7423bbfb9352705c4a53a@hyperstone.com Signed-off-by: Ulf Hansson commit 103da0667d4b7cdbc667666bd0e64899f3801033 Author: Sergey Shtylyov Date: Thu Mar 31 00:09:07 2022 +0300 mmc: core: block: fix sloppy typing in mmc_blk_ioctl_multi_cmd() Despite mmc_ioc_multi_cmd::num_of_cmds is a 64-bit field, its maximum value is limited to MMC_IOC_MAX_CMDS (only 255); using a 64-bit local variable to hold a copy of that field leads to gcc generating ineffective loop code: despite the source code using an *int* variable for the loop counters, the 32-bit object code uses 64-bit unsigned counters. Also, gcc has to drop the most significant word of that 64-bit variable when calling kcalloc() and assigning to mmc_queue_req::ioc_count anyway. Using the *unsigned int* variable instead results in a better code. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/eea3b0bd-6091-f005-7189-b5b7868abdb6@omp.ru Signed-off-by: Ulf Hansson commit 7792fdf626c20aa4e0d2b0daacf4e30df3ff9583 Author: Tinghan Shen Date: Wed Mar 30 17:45:31 2022 +0800 dt-bindings: mmc: mtk-sd: increase reg items MediaTek has a new version of mmc IP since mt8183. Some IO registers are moved to top to improve hardware design and named as "host top registers". Add host top register in the reg binding description for mt8183 and successors. Signed-off-by: Wenbin Mei Signed-off-by: Tinghan Shen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220330094532.21721-2-tinghan.shen@mediatek.com Signed-off-by: Ulf Hansson commit 3ddfa03d8162264b32b95b26eccb902ed4e07f3f Author: Chris Packham Date: Wed Mar 30 11:05:44 2022 +1300 dt-bindings: mmc: xenon: Convert to JSON schema Convert the marvell,xenon-sdhci binding to JSON schema. Currently the in-tree dts files don't validate because they use sdhci@ instead of mmc@ as required by the generic mmc-controller schema. The compatible "marvell,sdhci-xenon" was not documented in the old binding but it accompanies the of "marvell,armada-3700-sdhci" in the armada-37xx SoC dtsi so this combination is added to the new binding document. Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329220544.2132135-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Ulf Hansson commit fc1fdbd94cabab0f647c80fbd5c41029f84735b4 Author: Wolfram Sang Date: Mon Apr 4 12:58:31 2022 +0200 mmc: renesas_sdhi: R-Car V3M also has no HS400 Further digging in the datasheets revealed that R-Car V3M also has no HS400 support. Reported-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220404105831.5096-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 139bbdba494b0ba8ba5304db747d7f136ca9ad66 Author: Geert Uytterhoeven Date: Fri Apr 1 16:09:28 2022 +0200 mmc: renesas_sdhi: Add missing checks for the presence of quirks When running on an system without any quirks (e.g. R-Car V3U), the kernel crashes with a NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000002 ... Hardware name: Renesas Falcon CPU and Breakout boards based on r8a779a0 (DT) Workqueue: events_freezable mmc_rescan ... Call trace: renesas_sdhi_internal_dmac_start_dma+0x54/0x12c tmio_process_mrq+0x124/0x274 Fix this by adding the missing checks for the validatity of the priv->quirks pointer. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Link: https://lore.kernel.org/r/cc3178c2ff60f640f4d5a071d51f6b0b1db37656.1648822020.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson commit 970dc9c11a17994ab878016b536612ab00d1441d Author: Yann Gautier Date: Mon Mar 28 16:51:14 2022 +0200 mmc: mmci: stm32: use a buffer for unaligned DMA requests In SDIO mode, the sg list for requests can be unaligned with what the STM32 SDMMC internal DMA can support. In that case, instead of failing, use a temporary bounce buffer to copy from/to the sg list. This buffer is limited to 1MB. But for that we need to also limit max_req_size to 1MB. It has not shown any throughput penalties for SD-cards or eMMC. Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20220328145114.334577-1-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit ed9ab884987bf80e015f0531e10ad1c1af978e09 Author: Wolfram Sang Date: Sun Mar 20 13:45:38 2022 +0100 mmc: renesas_sdhi: style fix for proper function bodies Put the braces to the proper position to make reading the code easier. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220320124538.62028-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit bcfa7f15eb1657ec16a9c2cf8d93c5aef8e8e39f Author: Wolfram Sang Date: Sun Mar 20 13:30:16 2022 +0100 mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk After Shimoda-san's much appreciated refactoring of the quirk handling, we can convert now 'dmac_only_one_rx' from an ugly global flag to a regular quirk. This makes quirk handling more consistent and easier to maintain. After this patch, soc_dma_quirks is completely gone, hooray! Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220320123016.57991-7-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit c0a43968be5609c7c0f5ba0b5c72cbc7ab22ebce Author: Wolfram Sang Date: Sun Mar 20 13:30:15 2022 +0100 mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk After Shimoda-san's much appreciated refactoring of the quirk handling, we can convert now the 'fixed_addr_mode' from an ugly global flag to a regular quirk. This makes quirk handling more consistent and easier to maintain. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220320123016.57991-6-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 254b7d1299eb4876821d62cb957bf6f6434c1074 Author: Wolfram Sang Date: Sun Mar 20 13:30:14 2022 +0100 mmc: renesas_sdhi: remove a stale comment The whitelist has been refactored away with a0fb3fc8af01 ("mmc: renesas_sdhi: remove whitelist for internal DMAC") so the comment doesn't make any sense anymore. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220320123016.57991-5-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 6de9727a2207495faad6fe3822eb0f87c7381e65 Author: Wolfram Sang Date: Sun Mar 20 13:30:13 2022 +0100 mmc: renesas_sdhi: make setup selection more understandable When I read 'no_fallback', I forgot what fallback even though I was the author of this change. Name it better to make the code easier to understand. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220320123016.57991-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 6af8dd53c36f3e400b60269d3b55bdcc0d0574f7 Author: Wolfram Sang Date: Sun Mar 20 13:30:12 2022 +0100 mmc: renesas_sdhi: R-Car D3 also has no HS400 It is not explicitly expressed in the docs, but the needed data strobe pin is indeed missing for D3. The BSP disables HS400 as well. This means a little refactoring to reuse an already existing setup. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220320123016.57991-3-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 583e48372eb1370cf24195a2236878810df58d4f Author: Wolfram Sang Date: Sun Mar 20 13:30:11 2022 +0100 mmc: renesas_sdhi: remove outdated headers We moved quirk handling out of the SDHI core to the individual drivers. So, no need to include headers needed for soc_device_match et al. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220320123016.57991-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit d8e9d6909646d45391d1521a711bb711a047840b Author: Dmitry Baryshkov Date: Tue Apr 26 04:13:59 2022 +0300 drm/bridge: tc358762: drop connector field The tc358762.connector field is unused. Remove it to save space. Signed-off-by: Dmitry Baryshkov Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220426011359.2861224-1-dmitry.baryshkov@linaro.org commit c40b62216c1aecc0dc00faf33d71bd71cb440337 Author: Matthias Kaehlcke Date: Thu Feb 17 10:42:54 2022 -0800 usb: core: hcd: Create platform devices for onboard hubs in probe() Call onboard_hub_create/destroy_pdevs() from usb_add/remove_hcd() for primary HCDs to create/destroy platform devices for onboard USB hubs that may be connected to the root hub of the controller. These functions are a NOP unless CONFIG_USB_ONBOARD_HUB=y/m. Also add a field to struct usb_hcd to keep track of the onboard hub platform devices that are owned by the HCD. Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20220217104219.v21.3.I7a3a7d9d2126c34079b1cab87aa0b2ec3030f9b7@changeid Signed-off-by: Greg Kroah-Hartman commit 0298b4b95cb373c21e6323c905589f8dac42c5b4 Author: Matthias Kaehlcke Date: Thu Feb 17 10:42:53 2022 -0800 usb: misc: Add onboard_usb_hub driver The main issue this driver addresses is that a USB hub needs to be powered before it can be discovered. For discrete onboard hubs (an example for such a hub is the Realtek RTS5411) this is often solved by supplying the hub with an 'always-on' regulator, which is kind of a hack. Some onboard hubs may require further initialization steps, like changing the state of a GPIO or enabling a clock, which requires even more hacks. This driver creates a platform device representing the hub which performs the necessary initialization. Currently it only supports switching on a single regulator, support for multiple regulators or other actions can be added as needed. Different initialization sequences can be supported based on the compatible string. Besides performing the initialization the driver can be configured to power the hub off during system suspend. This can help to extend battery life on battery powered devices which have no requirements to keep the hub powered during suspend. The driver can also be configured to leave the hub powered when a wakeup capable USB device is connected when suspending, and power it off otherwise. Technically the driver consists of two drivers, the platform driver described above and a very thin USB driver that subclasses the generic driver. The purpose of this driver is to provide the platform driver with the USB devices corresponding to the hub(s) (a hub controller may provide multiple 'logical' hubs, e.g. one to support USB 2.0 and another for USB 3.x). Note: the current series only supports hubs connected directly to a root hub, support for other configurations could be added if needed. Co-developed-by: Ravi Chandra Sadineni Reviewed-by: Douglas Anderson Acked-by: Alan Stern Signed-off-by: Ravi Chandra Sadineni Signed-off-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20220217104219.v21.2.I7c9a1f1d6ced41dd8310e8a03da666a32364e790@changeid Signed-off-by: Greg Kroah-Hartman commit 8e8b11956486e3fe8cacf54a1d492ebdd8cc1fb2 Author: Matthias Kaehlcke Date: Thu Feb 17 10:42:52 2022 -0800 of/platform: Add stubs for of_platform_device_create/destroy() Code for platform_device_create() and of_platform_device_destroy() is only generated if CONFIG_OF_ADDRESS=y. Add stubs to avoid unresolved symbols when CONFIG_OF_ADDRESS is not set. Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Acked-by: Rob Herring Signed-off-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20220217104219.v21.1.I08fd2e1c775af04f663730e9fb4d00e6bbb38541@changeid Signed-off-by: Greg Kroah-Hartman commit fc274c1e997314bf47f6a62c79b5d7e554ed59c4 Author: Alan Stern Date: Sat Apr 23 21:35:51 2022 -0400 USB: gadget: Add a new bus for gadgets This patch adds a "gadget" bus and uses it for registering gadgets and their drivers. From now on, bindings will be managed by the driver core rather than through ad-hoc manipulations in the UDC core. As part of this change, the driver_pending_list is removed. The UDC core won't need to keep track of unbound drivers for later binding, because the driver core handles all of that for us. However, we do need one new feature: a way to prevent gadget drivers from being bound to more than one gadget at a time. The existing code does this automatically, but the driver core doesn't -- it's perfectly happy to bind a single driver to all the matching devices on the bus. The patch adds a new bitflag to the usb_gadget_driver structure for this purpose. A nice side effect of this change is a reduction in the total lines of code, since now the driver core will do part of the work that the UDC used to do. A possible future patch could add udc devices to the gadget bus, say as a separate device type. Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YmSpdxaDNeC2BBOf@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit d59f6d958596b54b722605657c3b56a79843695a Author: Alan Stern Date: Sat Apr 23 21:34:34 2022 -0400 USB: gadget: Fix mistakes in UDC core kerneldoc This patch fixes some minor mistakes in the UDC core's kerneldoc. Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YmSpKpnWR8WWEk/p@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 6ebb449f9f25e0da804d1247b4ffcc361321494d Author: Alan Stern Date: Sat Apr 23 21:33:29 2022 -0400 USB: gadget: Register udc before gadget In preparation for adding a "gadget" bus, this patch reverses the order of registration of udc and gadget devices in usb_add_gadget(). The current code adds the gadget device first, probably because that was more convenient at the time and the order didn't really matter. But with the upcoming change, adding the gadget will cause driver probing to occur. Unwinding that on the error pathway will become much more obtrusive, not to mention the fact that a gadget driver might not work properly before the udc is registered. It's better to register the udc device first, particularly since that doesn't involve a bus or driver binding and therefore is simpler to unwind. For symmetry, the order of unregistration in usb_del_gadget() is likewise reversed. Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YmSo6fU1FlNq8cOZ@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit af1969a2d734d6272c0640b50c3ed31e59e203a9 Author: Alan Stern Date: Sat Apr 23 20:42:03 2022 -0400 USB: gadget: Rename usb_gadget_probe_driver() In preparation for adding a "gadget" bus, this patch renames usb_gadget_probe_driver() to usb_gadget_register_driver(). The new name will be more accurate, since gadget drivers will be registered on the gadget bus and the probing will be done by the driver core, not the UDC core. Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YmSc29YZvxgT5fEJ@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 08908fa1547d0550a058d0ce2d613e570f51e5f9 Author: Sergey Shtylyov Date: Fri Apr 22 22:23:55 2022 +0300 usb: core: devices: drop redundant buffer overflow checks The USB device dump code often checks for the buffer overflow just before calling the functions that do that first thing anyways. Such checks are redundant and may be dropped... Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/0453cb0d-7b2b-25e6-50e3-091610951e58@omp.ru Signed-off-by: Greg Kroah-Hartman commit 9c1c0fdd04b5758aa35ac0f7ea802a1a599777a2 Author: Nick Hawkins Date: Thu Apr 21 14:21:30 2022 -0500 dt-bindings: usb: generic-ohci: Add HPE GXP ohci binding Add hpe,gxp-ohci to the generic-ohci list. This is to enable the device tree support. Signed-off-by: Nick Hawkins Link: https://lore.kernel.org/r/20220421192132.109954-10-nick.hawkins@hpe.com Acked-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman commit 501c12a6a774ee25c1f07e724c08f72ec7042f88 Author: Nick Hawkins Date: Thu Apr 21 14:21:29 2022 -0500 dt-bindings: usb: generic-ehci: Add HPE GXP ehci binding Add hpe,gxp-ehci to the generic-ehci list. This is to enable the device tree. Signed-off-by: Nick Hawkins Link: https://lore.kernel.org/r/20220421192132.109954-9-nick.hawkins@hpe.com Acked-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman commit 1dc246320c6b3e2a5492168159e1822c70251efa Author: Bjorn Andersson Date: Fri Apr 22 15:23:51 2022 -0700 usb: typec: mux: Add On Semi fsa4480 driver The ON Semiconductor FSA4480 is a USB Type-C port multimedia switch with support for analog audio headsets. It allows sharing a common USB Type-C port to pass USB2.0 signal, analog audio, sideband use wires and analog microphone signal. Due to lacking upstream audio support for testing, the audio muxing is left untouched, but implementation of muxing the SBU lines is provided as a pair of Type-C mux and switch devices. This provides the necessary support for enabling the DisplayPort altmode on devices with this circuit. Reviewed-by: Heikki Krogerus Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-8-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit 01afa882f12dbd4a452c86215dbb6d2d05f69e4c Author: Bjorn Andersson Date: Fri Apr 22 15:23:50 2022 -0700 dt-bindings: usb: Add binding for fcs,fsa4480 The Fairchild/ON Semiconductor FSA4480 Analog Audio switch is used in USB Type-C configurations for muxing analog audio onto the USB connector, and as such used to control the SBU signals for altmodes such as DisplayPort. Add a binding for this hardware block. Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-7-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit 71793b579ba6825d221445e3cfcd50da427b4f0e Author: Bjorn Andersson Date: Fri Apr 22 15:23:49 2022 -0700 usb: typec: mux: Allow multiple mux_devs per mux In the Qualcomm platforms the USB/DP PHY handles muxing and orientation switching of the SuperSpeed lines, but the SBU lines needs to be connected and switched by external (to the SoC) hardware. It's therefor necessary to be able to have the TypeC controller operate multiple TypeC muxes and switches. Use the newly introduced indirection object to handle this, to avoid having to taint the TypeC controllers with knowledge about the downstream hardware configuration. The max number of devs per indirection is set to 3, which account for being able to mux/switch the USB HS, SS and SBU lines, as per defined defined in the usb-c-connector binding. This number could be grown if need arrises at a later point in time. Acked-by: Heikki Krogerus Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-6-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit 713fd49b430c37263c6cae2c82954f4e1cbcd90d Author: Bjorn Andersson Date: Fri Apr 22 15:23:48 2022 -0700 usb: typec: mux: Introduce indirection Rather than directly exposing the implementation's representation of the typec muxes to the controller/clients, introduce an indirection object. This enables the introduction of turning this relationship into a one-to-many in the following patch. Acked-by: Heikki Krogerus Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-5-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit b9fa0292490db39d6542f514117333d366ec0011 Author: Bjorn Andersson Date: Fri Apr 22 15:23:47 2022 -0700 usb: typec: mux: Check dev_set_name() return value It's possible that dev_set_name() returns -ENOMEM, catch and handle this. Fixes: 3370db35193b ("usb: typec: Registering real device entries for the muxes") Reported-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Acked-by: Heikki Krogerus Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-4-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit bcd6a517aacae7e708a1be019a0c3ab9f4371c2b Author: Bjorn Andersson Date: Fri Apr 22 15:23:46 2022 -0700 device property: Use multi-connection matchers for single case The newly introduced helpers for searching for matches in the case of multiple connections can be resused by the single-connection case, so do this to save some duplication. Reviewed-by: Andy Shevchenko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-3-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7a20917d30fb627bebff6bacbe860ad4eb3a04d6 Author: Bjorn Andersson Date: Fri Apr 22 15:23:45 2022 -0700 device property: Add helper to match multiple connections In some cases multiple connections with the same connection id needs to be resolved from a fwnode graph. One such example is when separate hardware is used for performing muxing and/or orientation switching of the SuperSpeed and SBU lines in a USB Type-C connector. In this case the connector needs to belong to a graph with multiple matching remote endpoints, and the Type-C controller needs to be able to resolve them both. Add a new API that allows this kind of lookup. Reviewed-by: Andy Shevchenko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422222351.1297276-2-bjorn.andersson@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3c162511530c234f95091bdc7225f641e5f35090 Author: Linyu Yuan Date: Mon Apr 25 18:18:06 2022 +0800 usb: typec: ucsi: Wait for the USB role switches When role switch module probe late than ucsi module, fwnode_usb_role_switch_get() will return -EPROBE_DEFER, it is better to restart ucsi init work to find it again every 100ms, total wait time is 10 second. It also means change ucsi init work to delayed_work. Reviewed-by: Heikki Krogerus Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1650881886-25530-3-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 87d0e2f41b8cc2018499be4e8003fa8c09b6f2fb Author: Linyu Yuan Date: Mon Apr 25 18:18:05 2022 +0800 usb: typec: ucsi: add a common function ucsi_unregister_connectors() In error path of ucsi_init(), it will unregister all valid ucsi connectors, and similar operation also happen in ucsi_unregister(), add a common function ucsi_unregister_connectors() for two places, inside this function, if con->wq is NULL, it will break the loop, if other kind of error happen after con->wq allocated, ucsi/typec related API is safe to unregister. Also in ucsi_init(), it allocate number of (ucsi->cap.num_connectors + 1) connectors, there is one extra as the ending, ucsi_unregister_connectors() is safe to unregister all ucsi connectors according ucsi->cap.num_connectors, remove the extra one connector to save memory. Reviewed-by: Heikki Krogerus Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1650881886-25530-2-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 7a60fa06e80596dba5381fb018f5102ae4897658 Author: Biju Das Date: Mon Apr 25 15:02:15 2022 +0100 dt-bindings: usb: renesas,usbhs: Document RZ/G2UL bindings Document RZ/G2ULSoC bindings. USBHS block is identical to one found on RZ/A2 SoC. No driver changes are required as generic compatible string "renesas,rza2-usbhs" will be used as a fallback. While at it, make the resets property required on RZ/{G2L,G2UL,V2L} SoC. Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220425140215.186797-1-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit ef94b2664a2504d4091ea202c36fa20649060c3a Author: Haowen Bai Date: Thu Mar 24 10:16:11 2022 +0800 testusb: Fix warning comparing pointer to 0 Avoid pointer type value compared with 0 to make code clear. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1648088171-30912-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 85a503c9ea7d4978db5f98de941e6c04b44623f1 Author: Yoshihiro Shimoda Date: Mon Apr 25 15:41:57 2022 +0900 dt-bindings: serial: renesas,hscif: Document r8a779g0 bindings R-Car V4H (R8A779G0) SoC has the R-Car Gen4 compatible HSCIF ports, so document the SoC specific bindings. Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220425064201.459633-4-yoshihiro.shimoda.uh@renesas.com Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit b54f7a922d334014071ddaea313a045781024f4d Author: Ilpo Järvinen Date: Mon Apr 25 17:34:00 2022 +0300 serial: 8250: Handle UART without interrupt on TEMT Add UART_CAP_NOTEMT for UARTs that lack interrupt on TEMT but want to use em485. Em485 framework needs to ensure not only FIFO is empty but also that tx shift register is empty. This approach uses Uwe Kleine-König's suggestion on simply using/incrementing stop_tx timer rather than adding another timer. When UART_CAP_NOTEMT is set and THRE is present w/o TEMT, stop tx timer is reused to wait for the emptying of the shift register. This change does not add the UART_CAP_NOTEMT define as it already exist but is currently no-op. See 7a107b2c6b81 (Revert "serial: 8250: Handle UART without interrupt on TEMT using em485") for further details. Vicente Bergas reported that RTS is deasserted roughly one bit too early losing stop bit tx. To address this problem, stop_delay now accounts for one extra bit using rough formula /7 (assumes worst-case of 2+5 bits). I suspect this glitch had to do with when THRE is getting asserted. If FIFO is emptied already during the tx of the stop bit, perhaps it leads to HW asserting THRE early for the normal frame time formula to work accurately. Suggested-by: Uwe Kleine-König Cc: Eric Tremblay Tested-by: Vicente Bergas Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220425143410.12703-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e8ffbb71f783f577b24c25bd4dd1c7119d344924 Author: Ilpo Järvinen Date: Mon Apr 25 17:33:59 2022 +0300 serial: 8250: use THRE & __stop_tx also with DMA 8250 DMA tx complete path lacks calls to normal 8250 stop handling. It does not use THRE to detect true completion of the tx and also doesn't call __stop_tx. This leads to problems with em485 that needs to handle RTS timing. Instead of handling tx stop internally within 8250 dma code, enable THRE when tx'able data runs out and tweak serial8250_handle_irq to call only __stop_tx when uart is using DMA. It also seems bit early to call serial8250_rpm_put_tx from there while tx is still underway(?). Tested-by: Vicente Bergas Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220425143410.12703-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 31f6bd7fad3b149a1eb6f67fc2e742e4df369b3d Author: Ilpo Järvinen Date: Mon Apr 25 17:33:58 2022 +0300 serial: Store character timing information to uart_port Struct uart_port currently stores FIFO timeout. Having character timing information readily available is useful. Even serial core itself determines char_time from port->timeout using inverse calculation. Store frame_time directly into uart_port. Character time is stored in nanoseconds to have reasonable precision with high rates. To avoid overflow, 64-bit math is necessary. It might be possible to determine timeout from frame_time by multiplying it with fifosize as needed but only part of the users seem to be protected by a lock. Thus, this patch does not pursue storing only frame_time in uart_port. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220425143410.12703-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 070e246217230cce21b8dddad38bd59428494c48 Author: Phil Edworthy Date: Fri Apr 22 20:06:15 2022 +0200 serial: 8250: dw: Improve RZN1 support Renesas RZ/N1 SoC features a slightly modified DW UART. On this SoC, the CPR register value is known but not synthetized in hardware. We hence need to provide a CPR value in the platform data. This version of the controller also relies on acting as flow controller when using DMA, so we need to provide the "is dma flow controller" quirk. Co-developed-by: Miquel Raynal Reviewed-by: Andy Shevchenko Signed-off-by: Phil Edworthy Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-10-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit aa63d786cea2739791032742efc11990ce32ee4a Author: Phil Edworthy Date: Fri Apr 22 20:06:14 2022 +0200 serial: 8250: dw: Add support for DMA flow controlling devices DW based controllers like the one on Renesas RZ/N1 must be programmed as flow controllers when using DMA. * Table 11.45 of the system manual, "Flow Control Combinations", states that using UART with DMA requires setting the DMA in the peripheral flow controller mode regardless of the direction. * Chapter 11.6.1.3 of the system manual, "Basic Interface Definitions", explains that the burst size in the above case must be configured in the peripheral's register DEST/SRC_BURST_SIZE. Experiments shown that upon Rx timeout, the DMA transaction needed to be manually cleared as well. Co-developed-by: Miquel Raynal Reviewed-by: Andy Shevchenko Signed-off-by: Phil Edworthy Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-9-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit c9c23d01384e88a78d4fc8e6541cd439b87494db Author: Miquel Raynal Date: Fri Apr 22 20:06:13 2022 +0200 serial: 8250: dw: Move the IO accessors to 8250_dwlib.h These accessors should be used instead of the regular readl/writel() helpers. In order to use them also from 8250_dw.c in this directory, move the helpers to 8250_dwlib.h There is no functional change. There is no need for declaring `struct uart_port` or even UPIO_MEM32BE which both are already included in the 8250_dwlib.h header by 8250.h. Suggested-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-8-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 8ef6e1ba71e947abfd9f81974724ecd00dfb0f37 Author: Miquel Raynal Date: Fri Apr 22 20:06:12 2022 +0200 serial: 8250: dw: Introduce an rx_timeout variable in the IRQ path In a next change we are going to need the same Rx timeout condition as we already have in the IRQ handling code. Let's just create a boolean to clarify what this operation does before reusing it. There is no functional change. Reviewed-by: Andy Shevchenko Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-7-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit e4fb03fe10c5e7a5d9aef7cefe815253274fb9ee Author: Miquel Raynal Date: Fri Apr 22 20:06:11 2022 +0200 serial: 8250: dma: Allow driver operations before starting DMA transfers One situation where this could be used is when configuring the UART controller to be the DMA flow controller. This is a typical case where the driver might need to program a few more registers before starting a DMA transfer. Provide the necessary infrastructure to support this case. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-6-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 593dea000bc1f160623f8cf65ad5e47c72f4ec67 Author: Miquel Raynal Date: Fri Apr 22 20:06:10 2022 +0200 serial: 8250: dw: Allow to use a fallback CPR value if not synthesized DW UART controllers can be synthesized without the CPR register. In this case, allow to the platform information to provide a CPR value. Co-developed-by: Phil Edworthy Reviewed-by: Andy Shevchenko Signed-off-by: Phil Edworthy Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-5-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit ffd381445eac2aa624e49bab5a811451e8351008 Author: Miquel Raynal Date: Fri Apr 22 20:06:09 2022 +0200 serial: 8250: dw: Move the USR register to pdata This offset is a good candidate to pdata's because it changes depending on the vendor implementation. Let's move the usr_reg entry from regular to pdata. This way we can drop initializing it at run time. Let's also use a define for it instead of defining only the default value. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-4-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 4a218b277fdba357d8e9022ae675c94e59d64b4e Author: Emil Renner Berthing Date: Fri Apr 22 20:06:08 2022 +0200 serial: 8250: dw: Create a generic platform data structure Use device tree match data rather than multiple calls to of_device_is_compatible() by introducing a platform data structure and adding a quirks mask. Provide a stub to the compatibles without quirks to simplify the handling of the upcoming changes. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Signed-off-by: Emil Renner Berthing [ Link: https://lore.kernel.org/r/20220422180615.9098-3-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit d9666dfb314e1ffd6eb9c3c4243fe3e094c047a7 Author: Phil Edworthy Date: Fri Apr 22 20:06:07 2022 +0200 serial: 8250: dw: Move definitions to the shared header Move the per-device structure and a helper out of the main .c file, into a shared header as they will both be reused from another .c file. There is no functional change. Reviewed-by: Andy Shevchenko Signed-off-by: Phil Edworthy [miquel.raynal@bootlin.com: Extracted from a bigger change] Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220422180615.9098-2-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 5390e7f46b9d5546d45a83e6463bc656678b1d0e Author: Changbin Du Date: Mon Jan 17 23:43:00 2022 +0800 sysrq: do not omit current cpu when showing backtrace of all active CPUs The backtrace of current CPU also should be printed as it is active. This change add stack trace for current CPU and print a hint for idle CPU for the generic workqueue based printing. (x86 already does this) Now it looks like below: [ 279.401567] sysrq: Show backtrace of all active CPUs [ 279.407234] sysrq: CPU5: [ 279.407505] Call Trace: [ 279.408789] [] dump_backtrace+0x2c/0x3a [ 279.411698] [] show_stack+0x32/0x3e [ 279.411809] [] sysrq_handle_showallcpus+0x4c/0xc6 [ 279.411929] [] __handle_sysrq+0x106/0x26c [ 279.412034] [] write_sysrq_trigger+0x64/0x74 [ 279.412139] [] proc_reg_write+0x8e/0xe2 [ 279.412252] [] vfs_write+0x90/0x2be [ 279.412362] [] ksys_write+0xa6/0xce [ 279.412467] [] sys_write+0x2a/0x38 [ 279.412689] [] ret_from_syscall+0x0/0x2 [ 279.417173] sysrq: CPU6: backtrace skipped as idling [ 279.417185] sysrq: CPU4: backtrace skipped as idling [ 279.417187] sysrq: CPU0: backtrace skipped as idling [ 279.417181] sysrq: CPU7: backtrace skipped as idling [ 279.417190] sysrq: CPU1: backtrace skipped as idling [ 279.417193] sysrq: CPU3: backtrace skipped as idling [ 279.417219] sysrq: CPU2: [ 279.419179] Call Trace: [ 279.419440] [] dump_backtrace+0x2c/0x3a [ 279.419782] [] show_stack+0x32/0x3e [ 279.420015] [] showacpu+0x5c/0x96 [ 279.420317] [] flush_smp_call_function_queue+0xd6/0x218 [ 279.420569] [] generic_smp_call_function_single_interrupt+0x14/0x1c [ 279.420798] [] handle_IPI+0xaa/0x13a [ 279.421024] [] riscv_intc_irq+0x56/0x70 [ 279.421274] [] generic_handle_arch_irq+0x6a/0xfa [ 279.421518] [] ret_from_exception+0x0/0x10 [ 279.421750] [] rcu_idle_enter+0x16/0x1e Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20220117154300.2808-1-changbin.du@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3d27b05e4181a0eba618108292aa1998017b1dd7 Author: Wan Jiabing Date: Sun Apr 24 17:13:08 2022 +0800 tty: hvcs: simplify if-if to if-else Use if and else instead of if(A) and if (!A) and fix a coding style. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220424091310.98780-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman commit f0426b4e3b6940c6108c47ef5268c9e3ce89cb55 Author: Wan Jiabing Date: Tue Apr 26 15:10:41 2022 +0800 tty/hvc_opal: simplify if-if to if-else Use if and else instead of if(A) and if (!A). Reviewed-by: Jiri Slaby Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220426071041.168282-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman commit c268c0a8a33047cd957fecc1349d09a68eb6ad9e Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:54 2022 +0530 bus: mhi: ep: Add uevent support for module autoloading Add uevent support to MHI endpoint bus so that the client drivers can be autoloaded by udev when the MHI endpoint devices gets created. The client drivers are expected to provide MODULE_DEVICE_TABLE with the MHI id_table struct so that the alias can be exported. The MHI endpoint reused the mhi_device_id structure of the MHI bus. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-19-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit e4b7b5f0f30aaa4677126e04220677a02839e1c4 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:53 2022 +0530 bus: mhi: ep: Add support for suspending and resuming channels Add support for suspending and resuming the channels in MHI endpoint stack. The channels will be moved to the suspended state during M3 state transition and will be resumed during M0 transition. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-18-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2d945a394d9c1c59d88397cb383b11216d018a6b Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:52 2022 +0530 bus: mhi: ep: Add support for queueing SKBs to the host Add support for queueing SKBs to the host over the transfer ring of the relevant channel. The mhi_ep_queue_skb() API will be used by the client networking drivers to queue the SKBs to the host over MHI bus. The host will add ring elements to the transfer ring periodically for the device and the device will write SKBs to the ring elements. If a single SKB doesn't fit in a ring element (TRE), it will be placed in multiple ring elements and the overflow event will be sent for all ring elements except the last one. For the last ring element, the EOT event will be sent indicating the packet boundary. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-17-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 03c0bb8ec983f993a704417d73cc0a3511453d3e Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:51 2022 +0530 bus: mhi: ep: Add support for processing channel rings Add support for processing the channel rings from host. For the channel ring associated with DL channel, the xfer callback will simply invoked. For the case of UL channel, the ring elements will be read in a buffer till the write pointer and later passed to the client driver using the xfer callback. The client drivers should provide the callbacks for both UL and DL channels during registration. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-16-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 530125889977365cb6db32d7d0bd84c9f54c8aab Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:50 2022 +0530 bus: mhi: ep: Add support for reading from the host Data transfer between host and the ep device happens over the transfer ring associated with each bi-directional channel pair. Host defines the transfer ring by allocating memory for it. The read and write pointer addresses of the transfer ring are stored in the channel context. Once host places the elements in the transfer ring, it increments the write pointer and rings the channel doorbell. Device will receive the doorbell interrupt and will process the transfer ring elements. This commit adds support for reading the transfer ring elements from the transfer ring till write pointer, incrementing the read pointer and finally sending the completion event to the host through corresponding event ring. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-15-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit e827569062a804c67b51930ce83a4cb886113cb7 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:49 2022 +0530 bus: mhi: ep: Add support for processing command rings Add support for processing the command rings. Command ring is used by the host to issue channel specific commands to the ep device. Following commands are supported: 1. Start channel 2. Stop channel 3. Reset channel Once the device receives the command doorbell interrupt from host, it executes the command and generates a command completion event to the host in the primary event ring. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-14-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit f7d0806bdb1b377d4abe0f2c7798cec5b8a837ce Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:48 2022 +0530 bus: mhi: ep: Add support for handling SYS_ERR condition Add support for handling SYS_ERR (System Error) condition in the MHI endpoint stack. The SYS_ERR flag will be asserted by the endpoint device when it detects an internal error. The host will then issue reset and reinitializes MHI to recover from the error state. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-13-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 7a97b6b47353c60dd1b53ada6180741437e377f2 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:47 2022 +0530 bus: mhi: ep: Add support for handling MHI_RESET Add support for handling MHI_RESET in MHI endpoint stack. MHI_RESET will be issued by the host during shutdown and during error scenario so that it can recover the endpoint device without restarting the whole device. MHI_RESET handling involves resetting the internal MHI registers, data structures, state machines, resetting all channels/rings and setting MHICTRL.RESET bit to 0. Additionally the device will also move to READY state if the reset was due to SYS_ERR. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-12-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5d507ee04894e166f8c5a29f05c6b06ce91d5833 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:46 2022 +0530 bus: mhi: ep: Add support for powering down the MHI endpoint stack Add support for MHI endpoint power_down that includes stopping all available channels, destroying the channels, resetting the event and transfer rings and freeing the host cache. The stack will be powered down whenever the physical bus link goes down. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit fb3a26b7e8aff11e44d582604f61c38f63bd507c Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:45 2022 +0530 bus: mhi: ep: Add support for powering up the MHI endpoint stack Add support for MHI endpoint power_up that includes initializing the MMIO and rings, caching the host MHI registers, and setting the MHI state to M0. After registering the MHI EP controller, the stack has to be powered up for usage. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-10-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 4799e71b082615445dc40ba0bbb86cbb76c24724 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:44 2022 +0530 bus: mhi: ep: Add support for processing MHI endpoint interrupts Add support for processing MHI endpoint interrupts such as control interrupt, command interrupt and channel interrupt from the host. The interrupts will be generated in the endpoint device whenever host writes to the corresponding doorbell registers. The doorbell logic is handled inside the hardware internally. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-9-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit f9baa4f737950523ca648866dfa345ac378e4487 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:43 2022 +0530 bus: mhi: ep: Add support for managing MHI state machine Add support for managing the MHI state machine by controlling the state transitions. Only the following MHI state transitions are supported: 1. Ready state 2. M0 state 3. M3 state 4. SYS_ERR state Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-8-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 961aeb6892242e0a667f5b8eb62b9b0a6041752c Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:42 2022 +0530 bus: mhi: ep: Add support for sending events to the host Add support for sending the events to the host over MHI bus from the endpoint. Following events are supported: 1. Transfer completion event 2. Command completion event 3. State change event 4. Execution Environment (EE) change event An event is sent whenever an operation has been completed in the MHI EP device. Event is sent using the MHI event ring and additionally the host is notified using an IRQ if required. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-7-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit bbdcba57a1a26a4439a4f4ecdbfaf80a10fd8f34 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:41 2022 +0530 bus: mhi: ep: Add support for ring management Add support for managing the MHI ring. The MHI ring is a circular queue of data structures used to pass the information between host and the endpoint. MHI support 3 types of rings: 1. Transfer ring 2. Event ring 3. Command ring All rings reside inside the host memory and the MHI EP device maps it to the device memory using blocks like PCIe iATU. The mapping is handled in the MHI EP controller driver itself. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-6-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit e9e4da23cd65ea76ba658346f5c182791bd1cea9 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:40 2022 +0530 bus: mhi: ep: Add support for managing MMIO registers Add support for managing the Memory Mapped Input Output (MMIO) registers of the MHI bus. All MHI operations are carried out using the MMIO registers by both host and the endpoint device. The MMIO registers reside inside the endpoint device memory (fixed location based on the platform) and the address is passed by the MHI EP controller driver during its registration. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-5-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 297c77a0f27312b9a04696018c4cbd47926ca92b Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:39 2022 +0530 bus: mhi: ep: Add support for creating and destroying MHI EP devices This commit adds support for creating and destroying MHI endpoint devices. The MHI endpoint devices binds to the MHI endpoint channels and are used to transfer data between MHI host and endpoint device. There is a single MHI EP device for each channel pair. The devices will be created when the corresponding channels has been started by the host and will be destroyed during MHI EP power down and reset. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit ee0360b20b3fa08e2eee300eacb45e812ae44578 Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:38 2022 +0530 bus: mhi: ep: Add support for registering MHI endpoint client drivers This commit adds support for registering MHI endpoint client drivers with the MHI endpoint stack. MHI endpoint client drivers bind to one or more MHI endpoint devices inorder to send and receive the upper-layer protocol packets like IP packets, modem control messages, and diagnostics messages over MHI bus. Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit d434743e5cac3558381b767f343eef5af246a4dc Author: Manivannan Sadhasivam Date: Tue Apr 5 19:27:37 2022 +0530 bus: mhi: ep: Add support for registering MHI endpoint controllers This commit adds support for registering MHI endpoint controller drivers with the MHI endpoint stack. MHI endpoint controller drivers manage the interaction with the host machines (such as x86). They are also the MHI endpoint bus master in charge of managing the physical link between the host and endpoint device. Eventhough the MHI spec is bus agnostic, the current implementation is entirely based on PCIe bus. The endpoint controller driver encloses all information about the underlying physical bus like PCIe. The registration process involves parsing the channel configuration and allocating an MHI EP device. Channels used in the endpoint stack follows the perspective of the MHI host stack. i.e., UL - From host to endpoint DL - From endpoint to host Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220405135754.6622-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 39a5392889c0dcc943958f029d71d4c96af791fa Author: Rohit Agarwal Date: Wed Apr 13 18:23:35 2022 +0530 interconnect: qcom: Add SDX65 interconnect provider driver Add driver for the Qualcomm interconnect buses found in SDX65 based platforms. Signed-off-by: Rohit Agarwal Link: https://lore.kernel.org/r/1649854415-11174-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov commit d405ac52ab19301622bddabf4bf925d199937823 Author: Rohit Agarwal Date: Wed Apr 13 18:23:34 2022 +0530 dt-bindings: interconnect: Add Qualcomm SDX65 DT bindings Add interconnect IDs for Qualcomm SDX65 platform. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1649854415-11174-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov commit e88a6a8fece9b92be4f55735134a022061e6e68b Author: Fabio M. De Francesco Date: Mon Apr 25 19:57:54 2022 +0200 binder: Use memcpy_{to,from}_page() in binder_alloc_do_buffer_copy() The use of kmap_atomic() is being deprecated in favor of kmap_local_page() where it is feasible. Each call of kmap_atomic() in the kernel creates a non-preemptible section and disable pagefaults. This could be a source of unwanted latency, so kmap_local_page() should be preferred. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. Furthermore, the mapping can be acquired from any context (including interrupts). binder_alloc_do_buffer_copy() is a function where the use of kmap_local_page() in place of kmap_atomic() is correctly suited. Use kmap_local_page() / kunmap_local() in place of kmap_atomic() / kunmap_atomic() but, instead of open coding the mappings and call memcpy() to and from the virtual addresses of the mapped pages, prefer the use of the memcpy_{to,from}_page() wrappers (as suggested by Christophe Jaillet). Cc: Christophe JAILLET Acked-by: Todd Kjos Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220425175754.8180-4-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1d625960e41907af706f573a3cd097595a0ade63 Author: Fabio M. De Francesco Date: Mon Apr 25 19:57:53 2022 +0200 binder: Use kmap_local_page() in binder_alloc_copy_user_to_buffer() The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. binder_alloc_copy_user_to_buffer() is a function where the use of kmap_local_page() in place of kmap() is correctly suited because the mapping is local to the thread. Therefore, use kmap_local_page() / kunmap_local(). Cc: Christophe JAILLET Acked-by: Todd Kjos Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220425175754.8180-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 26eff2d66aff33527c7872277ab9c9d8478a978c Author: Fabio M. De Francesco Date: Mon Apr 25 19:57:52 2022 +0200 binder: Use memset_page() in binder_alloc_clear_buf() The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. binder_alloc_clear_buf() is a function where the use of kmap_local_page() in place of kmap() is correctly suited because the mapping is local to the thread. Therefore, use kmap_local_page() / kunmap_local() but, instead of open coding these two functions and adding a memset() of the virtual address of the mapping, prefer memset_page(). Cc: Christophe JAILLET Acked-by: Todd Kjos Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220425175754.8180-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4647769bab901562b1d3aa6ceb640a4886b0f277 Author: Guo Zhengkui Date: Tue Apr 26 16:33:13 2022 +0800 drivers/virt/fsl_hypervisor: remove unneeded `ret` variable in `fsl_hv_open()` Fix the following coccicheck warning: drivers/virt/fsl_hypervisor.c:662:5-8: Unneeded variable: "ret". Return "0" on line 679. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220426083315.9551-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman commit 2f00bb4a69c770b7957b9b4621323c2f84fc6538 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:34 2022 +0200 arm64: dts: marvell: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407143234.295426-2-krzysztof.kozlowski@linaro.org commit 4c32174a24759d5ac6dc42b508fcec2afb8b9602 Author: Bagas Sanjaya Date: Sat Apr 16 14:11:38 2022 +0700 Documentation: dd: Use ReST lists for return values of driver_deferred_probe_check_state() Sphinx reported build warnings mentioning drivers/base/dd.c: /Documentation/driver-api/infrastructure:35: ./drivers/base/dd.c:280: WARNING: Unexpected indentation. /Documentation/driver-api/infrastructure:35: ./drivers/base/dd.c:281: WARNING: Block quote ends without a blank line; unexpected unindent. The warnings above is due to syntax error in the "Return" section of driver_deferred_probe_check_state() which messed up with desired line breaks. Fix the issue by using ReST lists syntax. Fixes: c8c43cee29f6ca ("driver core: Fix driver_deferred_probe_check_state() logic") Cc: linux-pm@vger.kernel.org Cc: stable@vger.kernel.org Cc: Greg Kroah-Hartman Cc: Linus Walleij Cc: Thierry Reding Cc: Mark Brown Cc: Liam Girdwood Cc: Bjorn Andersson Cc: Saravana Kannan Cc: Todd Kjos Cc: Len Brown Cc: Pavel Machek Cc: Ulf Hansson Cc: Kevin Hilman Cc: "Rafael J. Wysocki" Cc: Rob Herring Cc: John Stultz Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220416071137.19512-1-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman commit 402eb8ec54b36f8fc0649768c01abb57062d6f8b Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:23 2022 +0200 arm64: dts: microchip: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Link: https://lore.kernel.org/r/20220407143223.295344-2-krzysztof.kozlowski@linaro.org commit 4a4e975bae37c995b12b4a86d46a6c14fa804277 Author: Russ Weight Date: Thu Apr 21 14:22:03 2022 -0700 test_firmware: Error injection for firmware upload Add error injection capability to the test_firmware module specifically for firmware upload testing. Error injection instructions are transferred as the first part of the firmware payload. The format of an error injection string is similar to the error strings that may be read from the error sysfs node. To inject the error "programming:hw-error", one would use the error injection string "inject:programming:hw-error" as the firmware payload: $ echo 1 > loading $ echo inject:programming:hw-error > data $ echo 0 > loading $ cat status idle $ cat error programming:hw-error The first part of the error string is the progress state of the upload at the time of the error. The progress state would be one of the following: "preparing", "transferring", or "programming". The second part of the error string is one of the following: "hw-error", "timeout", "device-busy", "invalid-file-size", "read-write-error", "flash-wearout", and "user-abort". Note that all of the error strings except "user-abort" will fail without delay. The "user-abort" error will cause the firmware upload to stall at the requested progress state for up to 5 minutes to allow you to echo 1 to the cancel sysfs node. It is this cancellation that causes the 'user-abort" error. If the upload is not cancelled within the 5 minute time period, then the upload will complete without an error. Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-8-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit a31ad463b72de2ec1a71bb4690acaf1e6dcafb45 Author: Russ Weight Date: Thu Apr 21 14:22:02 2022 -0700 test_firmware: Add test support for firmware upload Add support for testing the firmware upload driver. There are four sysfs nodes added: upload_register: write-only Write the name of the firmware device node to be created upload_unregister: write-only Write the name of the firmware device node to be destroyed config_upload_name: read/write Set the name to be used by upload_read upload_read: read-only Read back the data associated with the firmware device node named in config_upload_name You can create multiple, concurrent firmware device nodes for firmware upload testing. Read firmware back and validate it using config_upload_name and upload_red. Example: $ cd /sys/devices/virtual/misc/test_firmware $ echo -n fw1 > upload_register $ ls fw1 cancel data device error loading power remaining_size status subsystem uevent $ dd if=/dev/urandom of=/tmp/random-firmware.bin bs=512 count=4 4+0 records in 4+0 records out 2048 bytes (2.0 kB, 2.0 KiB) copied, 0.000131959 s, 15.5 MB/s $ echo 1 > fw1/loading $ cat /tmp/random-firmware.bin > fw1/data $ echo 0 > fw1/loading $ cat fw1/status idle $ cat fw1/error $ echo -n fw1 > config_upload_name $ cmp /tmp/random-firmware.bin upload_read $ echo $? 0 $ echo -n fw1 > upload_unregister Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-7-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit 536fd8184b7dfa30e28e5b459e7c5c91c3a8063f Author: Russ Weight Date: Thu Apr 21 14:22:01 2022 -0700 firmware_loader: Add sysfs nodes to monitor fw_upload Add additional sysfs nodes to monitor the transfer of firmware upload data to the target device: cancel: Write 1 to cancel the data transfer error: Display error status for a failed firmware upload remaining_size: Display the remaining amount of data to be transferred status: Display the progress of the firmware upload Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-6-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit 97730bbb242cde22b7140acd202ffd88823886c9 Author: Russ Weight Date: Thu Apr 21 14:22:00 2022 -0700 firmware_loader: Add firmware-upload support Extend the firmware subsystem to support a persistent sysfs interface that userspace may use to initiate a firmware update. For example, FPGA based PCIe cards load firmware and FPGA images from local FLASH when the card boots. The images in FLASH may be updated with new images provided by the user at his/her convenience. A device driver may call firmware_upload_register() to expose persistent "loading" and "data" sysfs files. These files are used in the same way as the fallback sysfs "loading" and "data" files. When 0 is written to "loading" to complete the write of firmware data, the data is transferred to the lower-level driver using pre-registered call-back functions. The data transfer is done in the context of a kernel worker thread. Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-5-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit e0c11a8b985137aebf4bcd07cd957b80ac23924d Author: Russ Weight Date: Thu Apr 21 14:21:59 2022 -0700 firmware_loader: Split sysfs support from fallback In preparation for sharing the "loading" and "data" sysfs nodes with the new firmware upload support, split out sysfs functionality from fallback.c and fallback.h into sysfs.c and sysfs.h. This includes the firmware class driver code that is associated with the sysfs files and the fw_fallback_config support for the timeout sysfs node. CONFIG_FW_LOADER_SYSFS is created and is selected by CONFIG_FW_LOADER_USER_HELPER in order to include sysfs.o in firmware_class-objs. This is mostly just a code reorganization. There are a few symbols that change in scope, and these can be identified by looking at the header file changes. A few white-space warnings from checkpatch are also addressed in this patch. Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-4-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit c6d3ffae0d3229e06097f2790f459c96fca5e367 Author: Herbert Xu Date: Tue Apr 26 17:42:36 2022 +0800 Revert "hwrng: mpfs - Enable COMPILE_TEST" This reverts commit 6a71277ce91e4766ebe9a5f6725089c80d043ba2. The underlying option POLARFIRE_SOC_SYS_CTRL already supports COMPILE_TEST so there is no need for this. What's more, if we force this option on without the underlying option it fails to build. Reported-by: kernel test robot Reported-by: Randy Dunlap Signed-off-by: Herbert Xu commit f898a286d99485cdfcb34727f2974e33ea95cdcb Author: Philipp Hortmann Date: Sun Apr 24 09:44:05 2022 +0200 staging: vt6655: Replace VNSvInPortW with ioread16 Replace macro VNSvInPortW with ioread16. The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2d55e245cc530ffafe53384df03691d1b29b495c.1650784817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a7d1a806718083c8997fcc0320f03376709a4000 Author: Solomon Tan Date: Sat Apr 23 21:01:50 2022 +0800 staging: rtl8192e: Remove u16 cast for u16 return value Remove explicit u16 cast of the function Mk16 return value. The variable hi does not need to be casted explicitly to u16 as it will already be casted implicitly. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-8-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit c9c5f7e02b28a0148285d3595a3eb5da9d168094 Author: Solomon Tan Date: Sat Apr 23 21:01:49 2022 +0800 staging: rtl8192e: Remove u16 cast for u32 parameter The explicit u16 cast is not necessary because rtl92e_eeprom_read's second parameter is defined to be u32. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-7-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit bd0b9adf3583fb99d285b39a7847a7ee4cdadb92 Author: Solomon Tan Date: Sat Apr 23 21:01:48 2022 +0800 staging: rtl8192e: Remove unnecessary u16 argument cast Remove the explicit u16 casts for u16 argument in the function call. This function has declared its parameter to be of type u16, so the argument given to that parameter will be automatically coerced to u16. Therefore, an explicit cast is unnecessary. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-6-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0bc8b4b97be38ace81e31093a18832273efacc36 Author: Solomon Tan Date: Sat Apr 23 21:01:47 2022 +0800 staging: rtl8192e: Remove unnecessary u16 assignment cast Remove the explicit casts in assignment statements for u16 variables. Because these variables are declared as u16, there is implicit conversion to u16 during the assignment, so an explicit cast is unnecessary. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-5-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit d9ad8050839a496e74412fb44f27ee96538a1bed Author: Solomon Tan Date: Sat Apr 23 21:01:46 2022 +0800 staging: rtl8192e: Remove unnecessary u8 cast in comparison Since the macro VERSION_8190_BD is defined to be 0x3, and the structure members card_8192_version and IC_Cut are both u8, an explicit u8 cast is unnecessary. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-4-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 46176f28c0dcfee420f7807585de015e28754527 Author: Solomon Tan Date: Sat Apr 23 21:01:45 2022 +0800 staging: rtl8192e: Remove unnecessary u8 argument cast Remove the unnecessary explicit u8 casts for u8 arguments in function calls. These functions have declared their parameters to be of type u8, so the arguments given to those parameters will be automatically coerced to u8. Therefore, an explicit cast is unnecessary. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-3-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 20400df1e48eeb1935557d372d6fdc7e2ecc1c18 Author: Solomon Tan Date: Sat Apr 23 21:01:44 2022 +0800 staging: rtl8192e: Remove unnecessary u8 assignment cast Remove the explicit casts in assignment statements for u8 variables. Because these variables are declared as u8, there is implicit conversion to u8 during the assignment, so an explicit cast is unnecessary. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220423130150.161903-2-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 92d995d158bb2b5c2cab456f069d8cb06356e1e9 Author: Vihas Makwana Date: Sat Apr 23 01:02:23 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd Drop unnecessary wrapper _rtw_dequeue_cmd and move its logic to rtw_dequeue_cmd. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-8-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 957ab09b8ca645de490e82105000ccfda37dc891 Author: Vihas Makwana Date: Sat Apr 23 01:02:22 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_alloc_network Drop unnecessary wrapper _rtw_alloc_network and move its logic to rtw_alloc_network. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-7-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 68df22cb61ff0ec6a8b8094cc322c37c12b89632 Author: Vihas Makwana Date: Sat Apr 23 01:02:21 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv Drop unnecessary wrapper _rtw_free_mlme_priv and move its logic to rtw_free_mlme_priv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-6-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 09e841b3331d4a03e86d337a7110255418e590a6 Author: Vihas Makwana Date: Sat Apr 23 01:02:20 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv Drop unnecessary wrapper _rtw_init_mlme_priv and move its logic to rtw_init_mlme_priv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-5-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8322ef200da5ea1cdf3fca90d4b71084476d2ed4 Author: Vihas Makwana Date: Sat Apr 23 01:02:19 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv Drop unnecessary wrapper _rtw_init_evt_priv and move its logic to rtw_init_evt_priv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-4-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 356eebb820afbc0c14c43eb2dd254918e61697c6 Author: Vihas Makwana Date: Sat Apr 23 01:02:18 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_init_cmd_priv Drop unnecessary wrapper _rtw_init_cmd_priv and move its logic to rtw_init_cmd_priv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-3-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit e46f80cb50882d2d4c526b4e826f0c5f1de1a346 Author: Vihas Makwana Date: Sat Apr 23 01:02:17 2022 +0530 staging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv Drop unnecessary wrapper _rtw_free_cmd_priv and move its logic to rtw_free_cmd_priv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 561215482cc69d1c758944d4463b3d5d96d37bd1 Author: Ethan Yang Date: Mon Apr 25 13:40:28 2022 +0800 net: usb: qmi_wwan: add support for Sierra Wireless EM7590 add support for Sierra Wireless EM7590 0xc081 composition. Signed-off-by: Ethan Yang Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/20220425054028.5444-1-etyang@sierrawireless.com Signed-off-by: Paolo Abeni commit 35a79f86d075c414f0020fddb6f871b69d598c78 Author: Vaibhav Nagare Date: Mon Apr 25 19:01:11 2022 +0530 staging: greybus: tools: fix spelling Fixed the spelling mistake of appendation to appending. Signed-off-by: Vaibhav Nagare Link: https://lore.kernel.org/r/20220425133111.118257-1-vnagare@redhat.com Signed-off-by: Greg Kroah-Hartman commit f3e93e3e25251b7053bfddac11507667217efbd2 Author: Geert Uytterhoeven Date: Mon Apr 25 14:18:25 2022 +0200 staging: vc04_services: Re-add dependency on HAS_DMA to BCM2835_VCHIQ Thanks to stubs for the NO_DMA=y case, drivers that use the DMA API can be compile-tested on systems that do not support DMA. Hence the dependency of BCM2835_VCHIQ on HAS_DMA was dropped to increase compile coverage. Unfortunately compilers became smarter, leading to new failures. E.g. for a CONFIG_SUN3=y allmodconfig kernel with gcc 9.4.0: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In function ‘free_pagelist’: arch/m68k/include/asm/string.h:72:25: warning: argument 2 null where non-null expected [-Wnonnull] 72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro ‘memcpy’ 614 | memcpy((char *)kmap(pages[0]) + | ^~~~~~ arch/m68k/include/asm/string.h:72:25: note: in a call to built-in function ‘__builtin_memcpy’ 72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro ‘memcpy’ 614 | memcpy((char *)kmap(pages[0]) + | ^~~~~~ This happens because the compiler can trace back the source pointer to a allocation by dma_alloc_attrs(), which always returns NULL if NO_DMA=y. Avoid this reinstating the dependency of the BCM2835_VCHIQ symbol on HAS_DMA, and by restricting the selection of BCM2835_VCHIQ. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/da55bd87eebf1a969dc8ccd807843319833f6c40.1650888813.git.geert@linux-m68k.org Signed-off-by: Greg Kroah-Hartman commit 8896ac5d0d3d9c5d9e67a22b0a9d36b6117fb2f0 Author: Solomon Tan Date: Mon Apr 25 13:28:03 2022 +0800 Revert "staging: r8188eu: use in-kernel ieee channel" This reverts commit 0afaa121813ed602bd203759c339cb639493f8c2 as changing rtw_ieee80211_channel to ieee80211_channel causes a memcpy bug as reported in: https://lore.kernel.org/linux-staging/67e2d10b-7f0f-9c5a-ce31-376b83ffba9e@gmail.com/ due to their size differences. Fixes: 0afaa121813e ("staging: r8188eu: use in-kernel ieee channel") Reported-by: Michael Straube Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220425052802.2419-1-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit dfed913e8b55a0c2c4906f1242fd38fd9a116e49 Author: Hangbin Liu Date: Mon Apr 25 09:45:02 2022 +0800 net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO Currently, the kernel drops GSO VLAN tagged packet if it's created with socket(AF_PACKET, SOCK_RAW, 0) plus virtio_net_hdr. The reason is AF_PACKET doesn't adjust the skb network header if there is a VLAN tag. Then after virtio_net_hdr_set_proto() called, the skb->protocol will be set to ETH_P_IP/IPv6. And in later inet/ipv6_gso_segment() the skb is dropped as network header position is invalid. Let's handle VLAN packets by adjusting network header position in packet_parse_headers(). The adjustment is safe and does not affect the later xmit as tap device also did that. In packet_snd(), packet_parse_headers() need to be moved before calling virtio_net_hdr_set_proto(), so we can set correct skb->protocol and network header first. There is no need to update tpacket_snd() as it calls packet_parse_headers() in tpacket_fill_skb(), which is already before calling virtio_net_hdr_* functions. skb->no_fcs setting is also moved upper to make all skb settings together and keep consistency with function packet_sendmsg_spkt(). Signed-off-by: Hangbin Liu Acked-by: Willem de Bruijn Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20220425014502.985464-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit caaff77ffb3f186c2f2df61fa91fb409ea2d929b Author: AngeloGioacchino Del Regno Date: Mon Feb 28 12:03:29 2022 +0100 arm64: dts: mediatek: mt8173: Add gce-client-reg handle to disp-mutex Add a gce client reg handle to the disp mutex to enable MT8173 platforms to use MediaTek's CMDQ for extra performance. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220228110329.245366-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 6147314aeedc24ecf70ea5656884b03cba836782 Author: Fabien Parent Date: Fri Apr 15 17:00:01 2022 +0200 arm64: dts: mediatek: Add device-tree for MT8195 Demo board Add basic device-tree for the MT8195 Demo board. The Demo board is made by MediaTek and has a MT8195 SoC, associated with the MT6359 and MT6360 PMICs, and the MT7921 connectivity chip. The IOs available on that board are: * 1 USB Type-C connector with DP aux mode support * 1 USB Type-A connector * 1 full size HDMI RX and 1 full size HDMI TX connector * 1 uSD slot * 40 pins header * SPI interface header * 1 M.2 slot * 1 audio jack * 1 micro-USB port for serial debug * 2 connectors for DSI displays * 3 connectors for CSI cameras * 1 connector for a eDP panel * 1 MMC storage This commit adds basic support in order to be able to boot. Signed-off-by: Fabien Parent Tested-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220415150003.1793063-3-fparent@baylibre.com Signed-off-by: Matthias Brugger commit cc9d1e59f47562a3b9c812c29d84996e36234308 Author: Fabien Parent Date: Fri Apr 15 17:00:00 2022 +0200 dt-bindings: arm64: dts: mediatek: Add mt8195-demo board Add bindings for the MediaTek mt8195-demo board. Signed-off-by: Fabien Parent Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220415150003.1793063-2-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 37f2582883be7218dc69f9af135959a8e93de223 Author: Tinghan Shen Date: Mon Apr 11 10:27:24 2022 +0800 arm64: dts: Add mediatek SoC mt8195 and evaluation board Add basic chip support for mediatek mt8195. Signed-off-by: Seiya Wang Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220411022724.11005-3-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit db61337e49a8324d3e7cae3450db22cf2bf87369 Author: Allen-KH Cheng Date: Thu Apr 7 19:37:03 2022 +0800 arm64: dts: mt8192: Add mmc device nodes In mt8192 SoC, mmc driver dose not use the MSDC module to control clock. It will read/write register to enable/disable clock. Also there is no other device of mt8192 using MSDC controller. We add mmc nodes for mt8192 SoC and remove the clock-controller in dts for avoid a duplicate unit-address(11f60000) warning. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220407113703.26423-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 71b946e9505510bdf2f84241205635c2f2da3e66 Author: Rex-BC Chen Date: Mon Apr 11 11:58:42 2022 +0800 arm64: dts: mt8183: Update disp_aal node compatible The driver data of MT8183 and MT8173 are different. The value of has_gamma for MT8173 is true while the value of MT8183 is false. Therefore, the compatible of disp_aal for MT8183 is not suitable for the compatible for MT8173. Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220411035843.19847-3-rex-bc.chen@mediatek.com Signed-off-by: Matthias Brugger commit 1afd9b62f95f51d68d38a006100a392b7761c53f Author: Allen-KH Cheng Date: Tue Apr 19 10:55:57 2022 +0800 arm64: dts: mt8192: Add audio-related nodes Add audio-related nodes in audsys for mt8192 SoC. - Move audsys node in ascending order. - Increase the address range's length from 0x1000 to 0x2000. Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220419025557.22262-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit a8bbcf703cf3c5cb63dd8516abc87262ad86b635 Author: Allen-KH Cheng Date: Tue Apr 19 14:32:26 2022 +0800 arm64: dts: mt8192: Add spmi node Add spmi node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220419063226.15958-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit b59add5e6e5a66ae3f6a42a573b6e56b6dbaee41 Author: Allen-KH Cheng Date: Tue Apr 19 17:20:30 2022 +0800 dt-bindings: arm: Add compatible for Mediatek MT8192 This commit adds dt-binding documentation for the Mediatek MT8192 reference board. Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220419092030.30519-1-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 3b7d143be4b7cf09cf19b04e78669ce0c970cc76 Author: Hui Liu Date: Thu Apr 21 09:26:23 2022 +0800 arm64: dts: mt6359: add PMIC MT6359 related nodes MT6359 is the primary PMIC for MT8192. Add PMIC MT6359 related node which is used for MT8192 platform. Signed-off-by: Hui Liu Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220421012623.3446-2-hui.liu@mediatek.com Signed-off-by: Matthias Brugger commit dab2782be22c359dd1a14a118e9b1592a7f91db3 Author: Allen-KH Cheng Date: Thu Apr 21 11:51:10 2022 +0800 arm64: dts: mediatek: mt8173: Add power domain to encoder nodes The power of encoder is not control by mediatek,larb, so we add power domain to encoder nodes for mt8173 SoC. Signed-off-by: Irui Wang Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220421035111.7267-4-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit bf01df06ddb1452c7b4d7d2b4f51ecfad6cc5b71 Author: Yong Wu Date: Thu Apr 21 11:51:09 2022 +0800 arm64: dts: mediatek: Get rid of mediatek, larb for MM nodes After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Signed-off-by: Allen-KH Cheng Reviewed-by: Evan Green Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220421035111.7267-3-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit d3ee03d81615a889824eca49d24d5c51d0481bd1 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:21:43 2022 +0200 arm64: dts: mt8183-kukui: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407142143.293740-1-krzysztof.kozlowski@linaro.org Signed-off-by: Matthias Brugger commit 624f1806a7c3f8061641a1f3e7c0dfa73e82fb10 Author: Krzysztof Kozlowski Date: Tue Apr 19 12:05:20 2022 +0200 arm64: dts: mediatek: align thermal zone node names with dtschema Align the name of thermal zone node to dtschema to fix warnings like: arch/arm64/boot/dts/mediatek/mt8173-elm.dt.yaml: thermal-zones: 'cpu_thermal' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210820081616.83674-2-krzysztof.kozlowski@canonical.com Signed-off-by: Matthias Brugger commit 6f117db4123931d3fbde9cfaf360b02fe550c8d6 Author: Krzysztof Kozlowski Date: Tue Apr 19 12:05:30 2022 +0200 arm64: dts: mediatek: align operating-points table name with dtschema Align the name of operating-points node to dtschema to fix warnings like: arch/arm64/boot/dts/mediatek/mt8173-elm.dt.yaml: opp_table0: $nodename:0: 'opp_table0' does not match '^opp-table(-[a-z0-9]+)?$' Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20210820081616.83674-1-krzysztof.kozlowski@canonical.com Signed-off-by: Matthias Brugger commit 74a46891867bf18535250fa8771c10f0153856f3 Author: Krzysztof Kozlowski Date: Tue Apr 19 12:02:55 2022 +0200 arm64: dts: mediatek: mt8183: align Google CROS EC PWM node name with dtschema dtschema expects PWM node name to be a generic "pwm". This also matches Devicetree specification requirements about generic node names. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220214081916.162014-3-krzysztof.kozlowski@canonical.com Signed-off-by: Matthias Brugger commit f08699ec5bd924be4c9572e21fd0a806d3fb34c2 Merge: a8e85faaa51fc 5e9ae5c47052e Author: Jani Nikula Date: Tue Apr 26 11:29:31 2022 +0300 Merge tag 'gvt-next-2022-04-26' of https://github.com/intel/gvt-linux into drm-intel-next gvt-next-2022-04-26 - Add two missing exports of symbols when i915 debug is enabled Signed-off-by: Jani Nikula From: "Wang, Zhi A" Link: https://patchwork.freedesktop.org/patch/msgid/c5cf6773-e7a2-8ba8-4cde-0bb14007bc6b@intel.com commit de6dd626d7082eda383ec77a5e06093c82122d10 Author: Arun Ramadoss Date: Sun Apr 24 16:58:31 2022 +0530 net: dsa: ksz: added the generic port_stp_state_set function The ksz8795 and ksz9477 uses the same algorithm for the port_stp_state_set function except the register address is different. So moved the algorithm to the ksz_common.c and used the dev_ops for register read and write. This function can also used for the lan937x part. Hence making it generic for all the parts. Signed-off-by: Arun Ramadoss Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220424112831.11504-1-arun.ramadoss@microchip.com Signed-off-by: Paolo Abeni commit 5e9ae5c47052e28a31fb4f55a6e735c28d4c3948 Author: Zhi Wang Date: Mon Apr 25 18:03:31 2022 -0400 drm/i915/gvt: Add missing symbol export. When CONFIG_DRM_I915_DEBUG_RUNTIME and CONFIG_DRM_I915_DEBUG_PM are enabled, two more extra symols in i915 are required to be exported. Cc: Jani Nikula Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220425220331.24865-1-zhi.a.wang@intel.com Reviewed-by: Jani Nikula commit d8fc1c7c4c9b705ce5f5bba772ad66a0137c685d Author: Andrew Davis Date: Mon Apr 25 09:16:17 2022 -0500 tee: remove flags TEE_IOCTL_SHM_MAPPED and TEE_IOCTL_SHM_DMA_BUF These look to be leftover from an early edition of this driver. Userspace does not need this information. Checking all users of this that I have access to I have verified no one is using them. They leak internal use flags out to userspace. Even more they are not correct anymore after a45ea4efa358. Lets drop these flags before someone does try to use them for something and they become ABI. Signed-off-by: Andrew Davis Acked-by: Sumit Garg Signed-off-by: Jens Wiklander commit 66eb6df79aefd6b3f7d2e749da7104e90cedc0ff Author: Andrew Davis Date: Mon Apr 25 09:16:16 2022 -0500 tee: remove tee_shm_va2pa() and tee_shm_pa2va() We should not need to index into SHMs based on absolute VA/PA. These functions are not used and this kind of usage should not be encouraged anyway. Remove these functions. Signed-off-by: Andrew Davis Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit fb0a43f5bd454dfae94aeb293b32669c6ef83b37 Author: Arun Ramadoss Date: Sat Apr 23 21:17:27 2022 +0530 net: phy: LAN937x: add interrupt support for link detection Added the config_intr and handle_interrupt for the LAN937x phy which is same as the LAN87xx phy. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220423154727.29052-1-arun.ramadoss@microchip.com Signed-off-by: Paolo Abeni commit 2ca47b33a7794ce92ae881d6d62affea953814cd Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:59 2022 +0200 memory: renesas-rpc-if: simplify platform_get_resource_byname() Use devm_platform_ioremap_resource_byname() instead of platform_get_resource_byname() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-7-krzysztof.kozlowski@linaro.org commit ef231fefa47f9c694a8a5bbe16cb43b5db62d6d6 Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:58 2022 +0200 memory: brcmstb_dpfe: simplify platform_get_resource_byname() Use devm_platform_ioremap_resource_byname() instead of platform_get_resource_byname() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-6-krzysztof.kozlowski@linaro.org commit dab022f22e3769260ef803eb7b70ec59df796a5a Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:57 2022 +0200 memory: tegra: mc: simplify platform_get_resource() Use devm_platform_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-5-krzysztof.kozlowski@linaro.org commit 8e6a257a173378d0fb42d64865545286f1f84ef6 Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:56 2022 +0200 memory: ti-emif-pm: simplify platform_get_resource() Use devm_platform_get_and_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-4-krzysztof.kozlowski@linaro.org commit 083008defd83cb1ab6f9efaef6396bf4534ac6eb Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:55 2022 +0200 memory: ti-emif: simplify platform_get_resource() Use devm_platform_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-3-krzysztof.kozlowski@linaro.org commit 734058b14de27682a176331ddd49fbdacdac1f46 Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:54 2022 +0200 memory: emif: simplify platform_get_resource() Use devm_platform_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-2-krzysztof.kozlowski@linaro.org commit 933713f5f49b816aa13a6441e41d98febef84dbe Author: Krzysztof Kozlowski Date: Tue Apr 19 16:28:53 2022 +0200 memory: da8xx-ddrctl: simplify platform_get_resource() Use devm_platform_get_and_ioremap_resource() instead of platform_get_resource() and devm_ioremap_resource(). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419142859.380566-1-krzysztof.kozlowski@linaro.org commit a4359b4e479bfa947a20a1ac5d406dae654f8a54 Author: Uwe Kleine-König Date: Mon Apr 25 21:23:06 2022 +0200 drm/ssd130x: Make ssd130x_remove() return void This function returns zero unconditionally, so there isn't any benefit of returning a value. Make it return void to be able to see at a glance that the return value of ssd130x_i2c_remove() is always zero. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220425192306.59800-1-u.kleine-koenig@pengutronix.de commit aa641a22bb5b1971a459b37746b845e3f5f084ca Author: Jean-Marc Eurin Date: Mon Apr 25 09:09:27 2022 -0700 mtd: mtdoops: Add a timestamp to the mtdoops header. On some systems, the oops only has relative time from boot. Signed-off-by: Jean-Marc Eurin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220425160927.3823016-1-jmeurin@google.com commit 0bd359ee712d9d3e757971ded4094c8ba006acd4 Author: Jean-Marc Eurin Date: Thu Apr 21 16:42:43 2022 -0700 mtd: mtdoops: Create a header structure for the saved mtdoops. Create a dump header to enable the addition of fields without having to modify the rest of the code. Reported-by: kernel test robot Signed-off-by: Jean-Marc Eurin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220421234244.2172003-3-jmeurin@google.com commit fbb83e546ea4543ab0c59dcbfc5a5a1471ea1806 Author: Jean-Marc Eurin Date: Thu Apr 21 16:42:42 2022 -0700 mtd: mtdoops: Fix the size of the header read buffer. The read buffer size depends on the MTDOOPS_HEADER_SIZE. Tested: Changed the header size, it doesn't panic, header is still read/written correctly. Signed-off-by: Jean-Marc Eurin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220421234244.2172003-2-jmeurin@google.com commit ffa7bdf7f344477ad817504c87d8d2db5316a8b6 Author: Jia-Wei Chang Date: Fri Apr 22 15:52:33 2022 +0800 cpufreq: mediatek: Make sram regulator optional For some MediaTek SoCs, like MT8186, it's possible that the sram regulator is shared between CPU and CCI. We hope regulator framework can return error for error handling rather than a dummy handler from regulator_get api. Therefore, we choose to use regulator_get_optional. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit bffcd33313dcfaf6357753c25c8ef8b4c628e46b Author: Jia-Wei Chang Date: Fri Apr 22 15:52:29 2022 +0800 cpufreq: mediatek: Record previous target vproc value We found the buck voltage may not be exactly the same with what we set because CPU may share the same buck with other module. Therefore, we need to record the previous desired value instead of reading it from regulators. Signed-off-by: Andrew-sh.Cheng Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 4aef4aeaf1dd47b2242ba78857b2773b7a5b5b05 Author: Rex-BC Chen Date: Fri Apr 22 15:52:28 2022 +0800 cpufreq: mediatek: Replace old_* with pre_* To make driver more readable, replace old_* with pre_*. Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 9acc0f7a6edd8d886782d3ac35c8ce8b0d35475b Author: Rex-BC Chen Date: Fri Apr 22 15:52:27 2022 +0800 cpufreq: mediatek: Use device print to show logs - Replace pr_* with dev_* to show logs. - Remove usage of __func__. Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 4b9ceb757bbb4e8e5769eb1f1ba84bd631e63a43 Author: Jia-Wei Chang Date: Fri Apr 8 12:58:58 2022 +0800 cpufreq: mediatek: Enable clocks and regulators We need to enable regulators so that the max and min requested values will be recorded. The intermediate clock is not always enabled by CCF in different projects, so we should enable it in the cpufreq driver. Signed-off-by: Andrew-sh.Cheng Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit ad975857818b0135bf13b72f66045e2699de5ba0 Author: Jia-Wei Chang Date: Fri Apr 8 12:58:57 2022 +0800 cpufreq: mediatek: Remove unused headers Remove unused headers. Signed-off-by: Jia-Wei Chang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 396dee972a1c6161ad8daca867e5a95d95aac61a Author: Jia-Wei Chang Date: Fri Apr 8 12:58:56 2022 +0800 cpufreq: mediatek: Cleanup variables and error handling in mtk_cpu_dvfs_info_init() - Remove several unnecessary varaibles in mtk_cpu_dvfs_info_init(). - Unify error message format and use dev_err_probe() if possible. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit b7070187c81cb90549d7561c0e750d7c7eb751f4 Author: Jia-Wei Chang Date: Fri Apr 8 12:58:55 2022 +0800 cpufreq: mediatek: Use module_init and add module_exit - Use module_init instead of device_initcall. - Add a function for module_exit to unregister driver. Signed-off-by: Jia-Wei Chang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar commit 7e6719ad5d1d308c207fb42c19be7495cccb2079 Author: Sumit Gupta Date: Tue Apr 5 18:31:19 2022 +0530 arm64: tegra: add node for tegra234 cpufreq Adding cclpex node to represent Tegra234 cpufreq. Tegra234 uses some of the CRAB (Control Register Access Bus) registers for cpu frequency requests. These registers are memory mapped to CCPLEX_MMCRAB_ARM region. In this node, mapping the range of MMCRAB registers required only for cpu frequency info. Signed-off-by: Sumit Gupta Signed-off-by: Viresh Kumar commit 273bc890a2a83ba8c7d8eee50b74138f5a5834d1 Author: Sumit Gupta Date: Tue Apr 5 18:31:18 2022 +0530 cpufreq: tegra194: Add support for Tegra234 This patch adds driver support for Tegra234 cpufreq. Tegra234 has per core MMIO registers instead of system registers for cpu frequency requests and to read the counters for re-constructing the cpu frequency. Also, MPIDR affinity info in Tegra234 is different from Tegra194. Added ops hooks and soc data for Tegra234. This will help to easily add variants of Tegra234 and future SoC's which use similar logic to {get|set} the cpu frequency. Signed-off-by: Sumit Gupta Signed-off-by: Viresh Kumar commit 0839ed1fd7aca2cc67fbe19b8c6394e8a6e58453 Author: Sumit Gupta Date: Tue Apr 5 18:31:17 2022 +0530 cpufreq: tegra194: add soc data to support multiple soc Adding SoC data and ops to support multiple SoC's in same driver. Signed-off-by: Sumit Gupta Signed-off-by: Viresh Kumar commit 15a1c2d80ae192261b5e4759d8d987ab30f6c3f4 Author: Sumit Gupta Date: Tue Apr 5 18:31:16 2022 +0530 dt-bindings: Document Tegra CCPLEX Cluster The Tegra CPU COMPLEX CLUSTER area contains memory-mapped registers that initiate CPU frequency/voltage transitions. Signed-off-by: Sumit Gupta Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar commit 73f1d07e5f8a1dec989a5ec964f5f2ce5b6f8825 Author: Gustavo A. R. Silva Date: Tue Apr 26 00:32:12 2022 -0500 checkpatch: add new alloc functions to alloc with multiplies check kvmalloc() and kvzalloc() functions have now 2-factor multiplication argument forms kvmalloc_array() and kvcalloc(), correspondingly. Add alloc-with-multiplies checks for these new functions. Link: https://github.com/KSPP/linux/issues/187 Signed-off-by: Gustavo A. R. Silva commit 31a644b3c2ae6d0c47e84614ded3ce9bef1adb7a Author: Damien Le Moal Date: Mon Apr 18 09:32:57 2022 +0900 documentation: zonefs: Document sysfs attributes Document the max_wro_seq_files, nr_wro_seq_files, max_active_seq_files and nr_active_seq_files sysfs attributes. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg Reviewed-by: Sergey Shtylyov commit dbbf16895a89953ccbcf0dab2806821b1ec565ff Author: ran jianping Date: Sun Apr 24 06:26:55 2022 +0000 tools/testing/nvdimm: remove unneeded flush_workqueue All work currently pending will be done first by calling destroy_workqueue, so there is no need to flush it explicitly. Reported-by: Zeal Robot Signed-off-by: ran jianping Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220424062655.3221152-1-ran.jianping@zte.com.cn Signed-off-by: Dan Williams commit a346f28ad231cb6746109219a1a371d7de11d67c Author: Changcheng Deng Date: Tue Apr 19 06:57:50 2022 +0000 scsi: lpfc: Remove unneeded variable Remove unneeded variable 'rc' used to store return value. Link: https://lore.kernel.org/r/20220419065750.2573861-1-deng.changcheng@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Martin K. Petersen commit 671a52f2aeafe2f42bddb53dcfe3933b1f641843 Author: ran jianping Date: Sun Apr 24 06:54:06 2022 +0000 scsi: fnic: Remove unneeded flush_workqueue() All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/20220424065406.3228528-1-ran.jianping@zte.com.cn Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Martin K. Petersen commit cf97628fe1a1f25f3a5617fa10619d7bef904da1 Author: ran jianping Date: Sun Apr 24 06:24:13 2022 +0000 scsi: qla2xxx: Remove unneeded flush_workqueue() All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/20220424062413.3220315-1-ran.jianping@zte.com.cn Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Martin K. Petersen commit 4c0df601e150c1e48566e7e4e183ba40c9f81157 Author: ran jianping Date: Sun Apr 24 06:18:45 2022 +0000 scsi: bfa: Remove unneeded flush_workqueue() All work currently pending will be done first by calling destroy_workqueue(). There is no need to flush it explicitly. Link: https://lore.kernel.org/r/20220424061845.3218774-1-ran.jianping@zte.com.cn Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Martin K. Petersen commit 21faafff6abbbe79fe56e3c7049514df08a9e66e Author: Haowen Bai Date: Thu Apr 21 18:24:53 2022 +0800 scsi: qedf: Remove unnecessary code Buffer 'msg' is memset() but never actually used. Drop it. Link: https://lore.kernel.org/r/1650536693-13089-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit bc37e4fb5cac2925b2e286b1f1d4fc2b519f7d92 Author: Eric Sandeen Date: Tue Apr 26 13:35:26 2022 +1000 xfs: revert "xfs: actually bump warning counts when we send warnings" This reverts commit 4b8628d57b725b32616965e66975fcdebe008fe7. XFS quota has had the concept of a "quota warning limit" since the earliest Irix implementation, but a mechanism for incrementing the warning counter was never implemented, as documented in the xfs_quota(8) man page. We do know from the historical archive that it was never incremented at runtime during quota reservation operations. With this commit, the warning counter quickly increments for every allocation attempt after the user has crossed a quote soft limit threshold, and this in turn transitions the user to hard quota failures, rendering soft quota thresholds and timers useless. This was reported as a regression by users. Because the intended behavior of this warning counter has never been understood or documented, and the result of this change is a regression in soft quota functionality, revert this commit to make soft quota limits and timers operable again. Fixes: 4b8628d57b72 ("xfs: actually bump warning counts when we send warnings) Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit f650df7171b882dca737ddbbeb414100b31f16af Author: Brian Foster Date: Tue Apr 26 13:34:54 2022 +1000 xfs: fix soft lockup via spinning in filestream ag selection loop The filestream AG selection loop uses pagf data to aid in AG selection, which depends on pagf initialization. If the in-core structure is not initialized, the caller invokes the AGF read path to do so and carries on. If another task enters the loop and finds a pagf init already in progress, the AGF read returns -EAGAIN and the task continues the loop. This does not increment the current ag index, however, which means the task spins on the current AGF buffer until unlocked. If the AGF read I/O submitted by the initial task happens to be delayed for whatever reason, this results in soft lockup warnings via the spinning task. This is reproduced by xfs/170. To avoid this problem, fix the AGF trylock failure path to properly iterate to the next AG. If a task iterates all AGs without making progress, the trylock behavior is dropped in favor of blocking locks and thus a soft lockup is no longer possible. Fixes: f48e2df8a877ca1c ("xfs: make xfs_*read_agf return EAGAIN to ALLOC_FLAG_TRYLOCK callers") Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner commit 1a3385069745f10c4ca7278a25499d79934c703a Author: Yang Xu Date: Tue Apr 26 13:34:42 2022 +1000 xfs: improve __xfs_set_acl Provide a proper stub for the !CONFIG_XFS_POSIX_ACL case. Also use a easy way for xfs_get_acl stub. Suggested-by: Christian Brauner (Microsoft) Signed-off-by: Yang Xu Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner (Microsoft) Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit bda57fede0a6211f9c3423e8b972caffbe623ee0 Author: Haowen Bai Date: Thu Apr 21 17:24:50 2022 +0800 scsi: qla4xxx: Drop redundant memset() The region set by the call to memset() is immediately overwritten by the subsequent call to memcpy(). Drop redundant memset(). Link: https://lore.kernel.org/r/1650533091-28815-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 391b8dac55770686d33f65ab5e87cfbc5bb3942d Author: Haowen Bai Date: Mon Mar 28 10:05:03 2022 +0800 scsi: ipr: Directly return instead of using local ret variable Fixes coccinelle warning: ./drivers/scsi/ipr.c:10095:13-15: Unneeded variable: "rc". Return "IRQ_HANDLED" on line 10104 Link: https://lore.kernel.org/r/1648433103-24308-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 507bd398a056c08d5618450db86bad69b02dde6b Author: Wan Jiabing Date: Fri Mar 18 22:52:20 2022 +0800 scsi: elx: efct: Remove unnecessary memset() in efct_io() io->sgl is allocated by kzalloc(). The memory is set to zero. It is unnecessary to call memset again. Link: https://lore.kernel.org/r/20220318145230.1031-1-wanjiabing@vivo.com Signed-off-by: Wan Jiabing Signed-off-by: Martin K. Petersen commit 367590b7fccc2c317026abe7d29923322d959781 Merge: d9d31cf88702a 792c0a345f0eb Author: Alexei Starovoitov Date: Mon Apr 25 17:31:36 2022 -0700 Merge branch 'Introduce typed pointer support in BPF maps' Kumar Kartikeya Dwivedi says: ==================== This set enables storing pointers of a certain type in BPF map, and extends the verifier to enforce type safety and lifetime correctness properties. The infrastructure being added is generic enough for allowing storing any kind of pointers whose type is available using BTF (user or kernel) in the future (e.g. strongly typed memory allocation in BPF program), which are internally tracked in the verifier as PTR_TO_BTF_ID, but for now the series limits them to two kinds of pointers obtained from the kernel. Obviously, use of this feature depends on map BTF. 1. Unreferenced kernel pointer In this case, there are very few restrictions. The pointer type being stored must match the type declared in the map value. However, such a pointer when loaded from the map can only be dereferenced, but not passed to any in-kernel helpers or kernel functions available to the program. This is because while the verifier's exception handling mechanism coverts BPF_LDX to PROBE_MEM loads, which are then handled specially by the JIT implementation, the same liberty is not available to accesses inside the kernel. The pointer by the time it is passed into a helper has no lifetime related guarantees about the object it is pointing to, and may well be referencing invalid memory. 2. Referenced kernel pointer This case imposes a lot of restrictions on the programmer, to ensure safety. To transfer the ownership of a reference in the BPF program to the map, the user must use the bpf_kptr_xchg helper, which returns the old pointer contained in the map, as an acquired reference, and releases verifier state for the referenced pointer being exchanged, as it moves into the map. This a normal PTR_TO_BTF_ID that can be used with in-kernel helpers and kernel functions callable by the program. However, if BPF_LDX is used to load a referenced pointer from the map, it is still not permitted to pass it to in-kernel helpers or kernel functions. To obtain a reference usable with helpers, the user must invoke a kfunc helper which returns a usable reference (which also must be eventually released before BPF_EXIT, or moved into a map). Since the load of the pointer (preserving data dependency ordering) must happen inside the RCU read section, the kfunc helper will take a pointer to the map value, which must point to the actual pointer of the object whose reference is to be raised. The type will be verified from the BTF information of the kfunc, as the prototype must be: T *func(T **, ... /* other arguments */); Then, the verifier checks whether pointer at offset of the map value points to the type T, and permits the call. This convention is followed so that such helpers may also be called from sleepable BPF programs, where RCU read lock is not necessarily held in the BPF program context, hence necessiating the need to pass in a pointer to the actual pointer to perform the load inside the RCU read section. Notes ----- * C selftests require https://reviews.llvm.org/D119799 to pass. * Unlike BPF timers, kptr is not reset or freed on map_release_uref. * Referenced kptr storage is always treated as unsigned long * on kernel side, as BPF side cannot mutate it. The storage (8 bytes) is sufficient for both 32-bit and 64-bit platforms. * Use of WRITE_ONCE to reset unreferenced kptr on 32-bit systems is fine, as the actual pointer is always word sized, so the store tearing into two 32-bit stores won't be a problem as the other half is always zeroed out. Changelog: ---------- v5 -> v6 v5: https://lore.kernel.org/bpf/20220415160354.1050687-1-memxor@gmail.com * Address comments from Alexei * Drop 'Revisit stack usage' comment * Rename off_btf to kernel_btf * Add comment about searching using type from map BTF * Do kmemdup + btf_get instead of get + kmemdup + put * Add comment for btf_struct_ids_match * Add comment for assigning non-zero id for mark_ptr_or_null_reg * Rename PTR_RELEASE to OBJ_RELEASE * Rename BPF_MAP_OFF_DESC_TYPE_XXX_KPTR to BPF_KPTR_XXX * Remove unneeded likely/unlikely in cold functions * Fix other misc nits * Keep release_regno instead of replacing with bool + regno * Add a patch to prevent type match for first member when off == 0 for release functions (kfunc + BPF helpers) * Guard kptr/kptr_ref definition in libbpf header with __has_attribute to prevent selftests compilation error with old clang not support type tags v4 -> v5 v4: https://lore.kernel.org/bpf/20220409093303.499196-1-memxor@gmail.com * Address comments from Joanne * Move __btf_member_bit_offset before strcmp * Move strcmp conditional on name to unref kptr patch * Directly return from btf_find_struct in patch 1 * Use enum btf_field_type vs int field_type * Put btf and btf_id in off_desc in named struct 'kptr' * Switch order for BTF_FIELD_IGNORE check * Drop dead tab->nr_off = 0 store * Use i instead of tab->nr_off to btf_put on failure * Replace kzalloc + memcpy with kmemdup (kernel test robot) * Reject both BPF_F_RDONLY_PROG and BPF_F_WRONLY_PROG * Add logging statement for reject BPF_MODE(insn->code) != BPF_MEM * Rename off_desc -> kptr_off_desc in check_mem_access * Drop check for err, fallthrough to end of function * Remove is_release_function, use meta.release_regno to detect release function, release reference state, and remove check_release_regno * Drop off_desc->flags, use off_desc->type * Update comment for ARG_PTR_TO_KPTR * Distinguish between direct/indirect access to kptr * Drop check_helper_mem_access from process_kptr_func, check_mem_reg in kptr_get * Add verifier test for helper accessing kptr indirectly * Fix other misc nits, add Acked-by for patch 2 v3 -> v4 v3: https://lore.kernel.org/bpf/20220320155510.671497-1-memxor@gmail.com * Use btf_parse_kptrs, plural kptrs naming (Joanne, Andrii) * Remove unused parameters in check_map_kptr_access (Joanne) * Handle idx < info_cnt kludge using tmp variable (Andrii) * Validate tags always precede modifiers in BTF (Andrii) * Split out into https://lore.kernel.org/bpf/20220406004121.282699-1-memxor@gmail.com * Store u32 type_id in btf_field_info (Andrii) * Use base_type in map_kptr_match_type (Andrii) * Free kptr_off_tab when not bpf_capable (Martin) * Use PTR_RELEASE flag instead of bools in bpf_func_proto (Joanne) * Drop extra reg->off and reg->ref_obj_id checks in map_kptr_match_type (Martin) * Use separate u32 and u8 arrays for offs and sizes in off_arr (Andrii) * Simplify and remove map->value_size sentinel in copy_map_value (Andrii) * Use sort_r to keep both arrays in sync while sorting (Andrii) * Rename check_and_free_timers_and_kptr to check_and_free_fields (Andrii) * Move dtor prototype checks to registration phase (Alexei) * Use ret variable for checking ASSERT_XXX, use shorter strings (Andrii) * Fix missing checks for other maps (Jiri) * Fix various other nits, and bugs noticed during self review v2 -> v3 v2: https://lore.kernel.org/bpf/20220317115957.3193097-1-memxor@gmail.com * Address comments from Alexei * Set name, sz, align in btf_find_field * Do idx >= info_cnt check in caller of btf_find_field_* * Use extra element in the info_arr to make this safe * Remove while loop, reject extra tags * Remove cases of defensive programming * Move bpf_capable() check to map_check_btf * Put check_ptr_off_reg reordering hunk into separate patch * Warn for ref_ptr once * Make the meta.ref_obj_id == 0 case simpler to read * Remove kptr_percpu and kptr_user support, remove their tests * Store size of field at offset in off_arr * Fix BPF_F_NO_PREALLOC set wrongly for hash map in C selftest * Add missing check_mem_reg call for kptr_get kfunc arg#0 check v1 -> v2 v1: https://lore.kernel.org/bpf/20220220134813.3411982-1-memxor@gmail.com * Address comments from Alexei * Rename bpf_btf_find_by_name_kind_all to bpf_find_btf_id * Reduce indentation level in that function * Always take reference regardless of module or vmlinux BTF * Also made it the same for btf_get_module_btf * Use kptr, kptr_ref, kptr_percpu, kptr_user type tags * Don't reserve tag namespace * Refactor btf_find_field to be side effect free, allocate and populate kptr_off_tab in caller * Move module reference to dtor patch * Remove support for BPF_XCHG, BPF_CMPXCHG insn * Introduce bpf_kptr_xchg helper * Embed offset array in struct bpf_map, populate and sort it once * Adjust copy_map_value to memcpy directly using this offset array * Removed size member from offset array to save space * Fix some problems pointed out by kernel test robot * Tidy selftests * Lots of other minor fixes ==================== Signed-off-by: Alexei Starovoitov commit 792c0a345f0eb2a6bb12afcca1cf6e518bf57b43 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:19:01 2022 +0530 selftests/bpf: Add test for strict BTF type check Ensure that the edge case where first member type was matched successfully even if it didn't match BTF type of register is caught and rejected by the verifier. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-14-memxor@gmail.com commit 05a945deefaa9fe6d34f06f0ab0cbfc72e2dbfa0 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:19:00 2022 +0530 selftests/bpf: Add verifier tests for kptr Reuse bpf_prog_test functions to test the support for PTR_TO_BTF_ID in BPF map case, including some tests that verify implementation sanity and corner cases. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-13-memxor@gmail.com commit 2cbc469a6fc345651569f9570b899af3b005cf80 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:59 2022 +0530 selftests/bpf: Add C tests for kptr This uses the __kptr and __kptr_ref macros as well, and tries to test the stuff that is supposed to work, since we have negative tests in test_verifier suite. Also include some code to test map-in-map support, such that the inner_map_meta matches the kptr_off_tab of map added as element. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-12-memxor@gmail.com commit ef89654f2bc7459f45b40be80de6cd3765ef8539 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:58 2022 +0530 libbpf: Add kptr type tag macros to bpf_helpers.h Include convenience definitions: __kptr: Unreferenced kptr __kptr_ref: Referenced kptr Users can use them to tag the pointer type meant to be used with the new support directly in the map value definition. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-11-memxor@gmail.com commit 2ab3b3808eb17f729edfd69e061667ca0a427195 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:57 2022 +0530 bpf: Make BTF type match stricter for release arguments The current of behavior of btf_struct_ids_match for release arguments is that when type match fails, it retries with first member type again (recursively). Since the offset is already 0, this is akin to just casting the pointer in normal C, since if type matches it was just embedded inside parent sturct as an object. However, we want to reject cases for release function type matching, be it kfunc or BPF helpers. An example is the following: struct foo { struct bar b; }; struct foo *v = acq_foo(); rel_bar(&v->b); // btf_struct_ids_match fails btf_types_are_same, then // retries with first member type and succeeds, while // it should fail. Hence, don't walk the struct and only rely on btf_types_are_same for strict mode. All users of strict mode must be dealing with zero offset anyway, since otherwise they would want the struct to be walked. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-10-memxor@gmail.com commit a1ef195996526da45bbc9710849254023df75aea Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:56 2022 +0530 bpf: Teach verifier about kptr_get kfunc helpers We introduce a new style of kfunc helpers, namely *_kptr_get, where they take pointer to the map value which points to a referenced kernel pointer contained in the map. Since this is referenced, only bpf_kptr_xchg from BPF side and xchg from kernel side is allowed to change the current value, and each pointer that resides in that location would be referenced, and RCU protected (this must be kept in mind while adding kernel types embeddable as reference kptr in BPF maps). This means that if do the load of the pointer value in an RCU read section, and find a live pointer, then as long as we hold RCU read lock, it won't be freed by a parallel xchg + release operation. This allows us to implement a safe refcount increment scheme. Hence, enforce that first argument of all such kfunc is a proper PTR_TO_MAP_VALUE pointing at the right offset to referenced pointer. For the rest of the arguments, they are subjected to typical kfunc argument checks, hence allowing some flexibility in passing more intent into how the reference should be taken. For instance, in case of struct nf_conn, it is not freed until RCU grace period ends, but can still be reused for another tuple once refcount has dropped to zero. Hence, a bpf_ct_kptr_get helper not only needs to call refcount_inc_not_zero, but also do a tuple match after incrementing the reference, and when it fails to match it, put the reference again and return NULL. This can be implemented easily if we allow passing additional parameters to the bpf_ct_kptr_get kfunc, like a struct bpf_sock_tuple * and a tuple__sz pair. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-9-memxor@gmail.com commit 14a324f6a67ef6a53e04362a70160a47eb8afffa Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:55 2022 +0530 bpf: Wire up freeing of referenced kptr A destructor kfunc can be defined as void func(type *), where type may be void or any other pointer type as per convenience. In this patch, we ensure that the type is sane and capture the function pointer into off_desc of ptr_off_tab for the specific pointer offset, with the invariant that the dtor pointer is always set when 'kptr_ref' tag is applied to the pointer's pointee type, which is indicated by the flag BPF_MAP_VALUE_OFF_F_REF. Note that only BTF IDs whose destructor kfunc is registered, thus become the allowed BTF IDs for embedding as referenced kptr. Hence it serves the purpose of finding dtor kfunc BTF ID, as well acting as a check against the whitelist of allowed BTF IDs for this purpose. Finally, wire up the actual freeing of the referenced pointer if any at all available offsets, so that no references are leaked after the BPF map goes away and the BPF program previously moved the ownership a referenced pointer into it. The behavior is similar to BPF timers, where bpf_map_{update,delete}_elem will free any existing referenced kptr. The same case is with LRU map's bpf_lru_push_free/htab_lru_push_free functions, which are extended to reset unreferenced and free referenced kptr. Note that unlike BPF timers, kptr is not reset or freed when map uref drops to zero. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-8-memxor@gmail.com commit 5ce937d613a423ca3102f53d9f3daf4210c1b6e2 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:54 2022 +0530 bpf: Populate pairs of btf_id and destructor kfunc in btf To support storing referenced PTR_TO_BTF_ID in maps, we require associating a specific BTF ID with a 'destructor' kfunc. This is because we need to release a live referenced pointer at a certain offset in map value from the map destruction path, otherwise we end up leaking resources. Hence, introduce support for passing an array of btf_id, kfunc_btf_id pairs that denote a BTF ID and its associated release function. Then, add an accessor 'btf_find_dtor_kfunc' which can be used to look up the destructor kfunc of a certain BTF ID. If found, we can use it to free the object from the map free path. The registration of these pairs also serve as a whitelist of structures which are allowed as referenced PTR_TO_BTF_ID in a BPF map, because without finding the destructor kfunc, we will bail and return an error. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-7-memxor@gmail.com commit 4d7d7f69f4b104b2ddeec6a1e7fcfd2d044ed8c4 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:53 2022 +0530 bpf: Adapt copy_map_value for multiple offset case Since now there might be at most 10 offsets that need handling in copy_map_value, the manual shuffling and special case is no longer going to work. Hence, let's generalise the copy_map_value function by using a sorted array of offsets to skip regions that must be avoided while copying into and out of a map value. When the map is created, we populate the offset array in struct map, Then, copy_map_value uses this sorted offset array is used to memcpy while skipping timer, spin lock, and kptr. The array is allocated as in most cases none of these special fields would be present in map value, hence we can save on space for the common case by not embedding the entire object inside bpf_map struct. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-6-memxor@gmail.com commit 6efe152d4061a83a2c5db6a0e5b58f9345c9742f Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:52 2022 +0530 bpf: Prevent escaping of kptr loaded from maps While we can guarantee that even for unreferenced kptr, the object pointer points to being freed etc. can be handled by the verifier's exception handling (normal load patching to PROBE_MEM loads), we still cannot allow the user to pass these pointers to BPF helpers and kfunc, because the same exception handling won't be done for accesses inside the kernel. The same is true if a referenced pointer is loaded using normal load instruction. Since the reference is not guaranteed to be held while the pointer is used, it must be marked as untrusted. Hence introduce a new type flag, PTR_UNTRUSTED, which is used to mark all registers loading unreferenced and referenced kptr from BPF maps, and ensure they can never escape the BPF program and into the kernel by way of calling stable/unstable helpers. In check_ptr_to_btf_access, the !type_may_be_null check to reject type flags is still correct, as apart from PTR_MAYBE_NULL, only MEM_USER, MEM_PERCPU, and PTR_UNTRUSTED may be set for PTR_TO_BTF_ID. The first two are checked inside the function and rejected using a proper error message, but we still want to allow dereference of untrusted case. Also, we make sure to inherit PTR_UNTRUSTED when chain of pointers are walked, so that this flag is never dropped once it has been set on a PTR_TO_BTF_ID (i.e. trusted to untrusted transition can only be in one direction). In convert_ctx_accesses, extend the switch case to consider untrusted PTR_TO_BTF_ID in addition to normal PTR_TO_BTF_ID for PROBE_MEM conversion for BPF_LDX. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-5-memxor@gmail.com commit ce781c3f05cd93515e31091def848c134f5bb2f2 Author: Alexander Vorwerk Date: Thu Mar 17 04:03:25 2022 +0100 scsi: message: fusion: Remove unused variable retval The following warning showed up when compiling with W=1. drivers/message/fusion/mptctl.c: In function ‘mptctl_hp_hostinfo’: drivers/message/fusion/mptctl.c:2337:8: warning: variable ‘retval’ set but not used [-Wunused-but-set-variable] int retval; Fixing by removing the variable. Link: https://lore.kernel.org/r/20220317030325.30526-1-alexander.vorwerk@stud.uni-goettingen.de Signed-off-by: Alexander Vorwerk Signed-off-by: Martin K. Petersen commit c0a5a21c25f37c9fd7b36072f9968cdff1e4aa13 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:51 2022 +0530 bpf: Allow storing referenced kptr in map Extending the code in previous commits, introduce referenced kptr support, which needs to be tagged using 'kptr_ref' tag instead. Unlike unreferenced kptr, referenced kptr have a lot more restrictions. In addition to the type matching, only a newly introduced bpf_kptr_xchg helper is allowed to modify the map value at that offset. This transfers the referenced pointer being stored into the map, releasing the references state for the program, and returning the old value and creating new reference state for the returned pointer. Similar to unreferenced pointer case, return value for this case will also be PTR_TO_BTF_ID_OR_NULL. The reference for the returned pointer must either be eventually released by calling the corresponding release function, otherwise it must be transferred into another map. It is also allowed to call bpf_kptr_xchg with a NULL pointer, to clear the value, and obtain the old value if any. BPF_LDX, BPF_STX, and BPF_ST cannot access referenced kptr. A future commit will permit using BPF_LDX for such pointers, but attempt at making it safe, since the lifetime of object won't be guaranteed. There are valid reasons to enforce the restriction of permitting only bpf_kptr_xchg to operate on referenced kptr. The pointer value must be consistent in face of concurrent modification, and any prior values contained in the map must also be released before a new one is moved into the map. To ensure proper transfer of this ownership, bpf_kptr_xchg returns the old value, which the verifier would require the user to either free or move into another map, and releases the reference held for the pointer being moved in. In the future, direct BPF_XCHG instruction may also be permitted to work like bpf_kptr_xchg helper. Note that process_kptr_func doesn't have to call check_helper_mem_access, since we already disallow rdonly/wronly flags for map, which is what check_map_access_type checks, and we already ensure the PTR_TO_MAP_VALUE refers to kptr by obtaining its off_desc, so check_map_access is also not required. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-4-memxor@gmail.com commit 8c36b054df01e15d285a7414a7bafff7a2ed9eb0 Author: Haowen Bai Date: Tue Mar 15 10:04:25 2022 +0800 scsi: aha1542: Remove unneeded semicolon Fixes coccicheck warning: drivers/scsi/aha1542.c:553:2-3: Unneeded semicolon drivers/scsi/aha1542.c:582:2-3: Unneeded semicolon drivers/scsi/aha1542.c:605:2-3: Unneeded semicolon drivers/scsi/aha1542.c:306:2-3: Unneeded semicolon drivers/scsi/aha1542.c:348:3-4: Unneeded semicolon drivers/scsi/aha1542.c:412:2-3: Unneeded semicolon drivers/scsi/aha1542.c:640:2-3: Unneeded semicolon drivers/scsi/aha1542.c:658:2-3: Unneeded semicolon drivers/scsi/aha1542.c:677:2-3: Unneeded semicolon drivers/scsi/aha1542.c:538:2-3: Unneeded semicolon Link: https://lore.kernel.org/r/1647309865-15620-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 8e897c84661e67e30c0c57dd4d25e18869958951 Author: Haowen Bai Date: Tue Mar 15 09:57:14 2022 +0800 scsi: bfa: Remove redundant NULL check Fix the following warning reported by coccicheck: drivers/scsi/bfa/bfad_debugfs.c:375:2-7: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/1647309434-13936-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 1dcd96c4d0b726df1155066126e029cb17a6dd3d Author: Haowen Bai Date: Tue Mar 15 09:53:39 2022 +0800 scsi: fnic: Remove redundant NULL check Fix the following warning reported by coccicheck: drivers/scsi/fnic/fnic_debugfs.c:90:2-7: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/1647309219-12772-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 93de8df20537697cc2e74ac42b61e94b5ef5a1eb Author: Haowen Bai Date: Mon Mar 14 15:58:31 2022 +0800 scsi: mac53c94: Fix warning comparing pointer to 0 Fix the following coccicheck warning: drivers/scsi/mac53c94.c:237:12-13: WARNING comparing pointer to 0 Link: https://lore.kernel.org/r/1647244711-31575-1-git-send-email-baihaowen@meizu.com Signed-off-by: Haowen Bai Signed-off-by: Martin K. Petersen commit 331c6e910f1acfcd854428241789431ebed65677 Author: Borislav Petkov Date: Tue Apr 5 17:15:07 2022 +0200 scsi: aacraid: Fix undefined behavior due to shift overflowing the constant Fix: drivers/scsi/aacraid/commsup.c: In function ‘aac_handle_sa_aif’: drivers/scsi/aacraid/commsup.c:1983:2: error: case label does not reduce to an integer constant case SA_AIF_BPCFG_CHANGE: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Link: https://lore.kernel.org/r/20220405151517.29753-2-bp@alien8.de Cc: Adaptec OEM Raid Solutions Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Reviewed-by: Randy Dunlap Signed-off-by: Borislav Petkov Signed-off-by: Martin K. Petersen commit 4a5fc1c6d75261f2f014a961d39ab10aae66a0f9 Author: Damien Le Moal Date: Thu Apr 21 11:30:23 2022 -0700 scsi: scsi_debug: Add gap zone support Add the 'zone_cap_mb' kernel module parameter. This parameter defines the zone capacity. The zone capacity must be less than or equal to the zone size. Report that sequential write zones and gap zones are paired in the Zoned Block Device Characteristics VPD page (page B6h). This patch has been tested as follows: modprobe scsi_debug delay=0 sector_size=512 dev_size_mb=128 zbc=host-managed zone_nr_conv=16 zone_size_mb=4 zone_cap_mb=3 modprobe brd rd_nr=1 rd_size=$((1<<20)) mkfs.f2fs -m /dev/ram0 -c /dev/${scsi_debug_dev} mount /dev/ram0 /mnt # Run a fio job that uses /mnt Link: https://lore.kernel.org/r/20220421183023.3462291-10-bvanassche@acm.org Cc: Douglas Gilbert Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal [ bvanassche: Switched to reporting a constant zone starting LBA granularity ] Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 35dbe2b9a7b0c92777c855c6a2cca8390f4c166b Author: Damien Le Moal Date: Thu Apr 21 11:30:22 2022 -0700 scsi: scsi_debug: Rename zone type constants Rename the scsi_debug zone type constants to prevent a conflict with the ZBC_ZONE_TYPE_GAP constant from include/scsi/scsi_proto.h. Link: https://lore.kernel.org/r/20220421183023.3462291-9-bvanassche@acm.org Cc: Douglas Gilbert Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal [ bvanassche: Extracted these changes from a larger patch ] Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 897284e8a04894537b58a079a2729a70731c229d Author: Bart Van Assche Date: Thu Apr 21 11:30:21 2022 -0700 scsi: scsi_debug: Fix a typo Change a single occurrence of "nad" into "and". Link: https://lore.kernel.org/r/20220421183023.3462291-8-bvanassche@acm.org Cc: Douglas Gilbert Reviewed-by: Damien Le Moal Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c976e588b34e4ff2fdd2922edab4b983244a17e6 Author: Damien Le Moal Date: Thu Apr 21 11:30:20 2022 -0700 scsi: sd: sd_zbc: Hide gap zones ZBC-2 allows host-managed disks to report gap zones. This allow zoned disks to report an offset between data zone starts that is a power of two even if the number of logical blocks with data per zone is not a power of two. Another new feature in ZBC-2 is support for constant zone starting LBA offsets. For zoned disks that report a constant zone starting LBA offset, hide the gap zones from the block layer. Report the offset between data zone starts as zone size and report the number of logical blocks with data per zone as the zone capacity. Link: https://lore.kernel.org/r/20220421183023.3462291-7-bvanassche@acm.org Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal [ bvanassche: Reworked this patch ] Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 60caf3758103b8edc90724ba781ff119f739162a Author: Damien Le Moal Date: Thu Apr 21 11:30:19 2022 -0700 scsi: sd: sd_zbc: Return early in sd_zbc_check_zoned_characteristics() Return early in sd_zbc_check_zoned_characteristics() for host-aware disks. This patch does not change any functionality but makes a later patch easier to read. Link: https://lore.kernel.org/r/20220421183023.3462291-6-bvanassche@acm.org Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal [ bvanassche: extracted this change from a larger patch ] Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 628617be8968e575ca0a0637fb227f8a990cb2f7 Author: Bart Van Assche Date: Thu Apr 21 11:30:18 2022 -0700 scsi: sd: sd_zbc: Introduce struct zoned_disk_info Deriving the meaning of the nr_zones, rev_nr_zones, zone_blocks and rev_zone_blocks member variables requires careful analysis of the source code. Make the meaning of these member variables easier to understand by introducing struct zoned_disk_info. Link: https://lore.kernel.org/r/20220421183023.3462291-5-bvanassche@acm.org Reviewed-by: Damien Le Moal Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 43af5da09efb8abe450ec859d3063adeb7d1eb54 Author: Damien Le Moal Date: Thu Apr 21 11:30:17 2022 -0700 scsi: sd: sd_zbc: Use logical blocks as unit when querying zones When querying zones, track the position in logical blocks instead of in sectors. This change slightly simplifies sd_zbc_report_zones(). Link: https://lore.kernel.org/r/20220421183023.3462291-4-bvanassche@acm.org Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal [ bvanassche: extracted this change from a larger patch ] Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9a93b9c9d38aee1f729f3cea72971a2616dca936 Author: Bart Van Assche Date: Thu Apr 21 11:30:16 2022 -0700 scsi: sd: sd_zbc: Verify that the zone size is a power of two The following check in sd_zbc_cmnd_checks() can only work correctly if the zone size is a power of two: if (sector & (sd_zbc_zone_sectors(sdkp) - 1)) /* Unaligned request */ return BLK_STS_IOERR; Hence this patch that verifies that the zone size is a power of two. Link: https://lore.kernel.org/r/20220421183023.3462291-3-bvanassche@acm.org Reviewed-by: Damien Le Moal Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit aa96bfb4caff59c93f0637092efe3a714cab0fe6 Author: Bart Van Assche Date: Thu Apr 21 11:30:15 2022 -0700 scsi: sd: sd_zbc: Improve source code documentation Add several kernel-doc headers. Declare input arrays const. Specify the array size in function declarations. Link: https://lore.kernel.org/r/20220421183023.3462291-2-bvanassche@acm.org Reviewed-by: Damien Le Moal Reviewed-by: Himanshu Madhani Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a8b032b5b3ba4e9d8ecb913724d0725121445b24 Author: Bart Van Assche Date: Tue Apr 19 15:58:11 2022 -0700 scsi: ufs: Move the ufs_is_valid_unit_desc_lun() definition Move the definition of this function from a public into a private header file since it is only used inside the UFS core. Link: https://lore.kernel.org/r/20220419225811.4127248-29-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 743b09d8541e2d6ae419bf41c4815f8be318dcc5 Author: Bart Van Assche Date: Tue Apr 19 15:58:10 2022 -0700 scsi: ufs: Move the struct ufs_ref_clk definition Move the definition of this data structure since it is only used in a single source file. Link: https://lore.kernel.org/r/20220419225811.4127248-28-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4bc26113c603073363ac96f6f1c7d6389bc0b243 Author: Bart Van Assche Date: Tue Apr 19 15:58:09 2022 -0700 scsi: ufs: Split the ufshcd.h header file Split the ufshcd.h header file into a header file that defines the interface used by UFS drivers and another header file with declarations and data structures only used by the UFS core. Link: https://lore.kernel.org/r/20220419225811.4127248-27-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3f06f7800b80462e8f6aadade6bb823496204e06 Author: Bart Van Assche Date: Tue Apr 19 15:58:08 2022 -0700 scsi: ufs: Minimize #include directives Follow the convention that is used elsewhere in the Linux kernel source code and only include those headers of which the declarations are used directly. Link: https://lore.kernel.org/r/20220419225811.4127248-26-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cff91daf52d364d0d84fa47b489abcfd4eb19bb9 Author: Bart Van Assche Date: Tue Apr 19 15:58:07 2022 -0700 scsi: ufs: Fix kernel-doc syntax in ufshcd.h This patch fixes all the warnings and errors reported by the following command: scripts/kernel-doc -none drivers/scsi/ufs/ufshcd.h Link: https://lore.kernel.org/r/20220419225811.4127248-25-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c10d52d73ae0ebc66a837c486b82d1259be01459 Author: Bart Van Assche Date: Tue Apr 19 15:58:06 2022 -0700 scsi: ufs: Remove unnecessary ufshcd-crypto.h include directives ufshcd-crypto.h declares functions that must only be called by the UFS core. Hence remove the #include "ufshcd-crypto.h" directive from UFS drivers. Link: https://lore.kernel.org/r/20220419225811.4127248-24-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Eric Biggers Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit bee40dc167da159ea5b939c074e1da258610a3d6 Author: Bart Van Assche Date: Tue Apr 19 15:58:05 2022 -0700 scsi: ufs: qcom: Fix ufs_qcom_resume() Clearing hba->is_sys_suspended if ufs_qcom_resume() succeeds is wrong. That variable must only be cleared if all actions involved in a resume succeed. Hence remove the statement that clears hba->is_sys_suspended from ufs_qcom_resume(). Link: https://lore.kernel.org/r/20220419225811.4127248-23-bvanassche@acm.org Fixes: 81c0fc51b7a7 ("ufs-qcom: add support for Qualcomm Technologies Inc platforms") Tested-by: Bean Huo Reviewed-by: Bjorn Andersson Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ad8a647e77294dde3487c86847ca28bd4c8543cd Author: Bart Van Assche Date: Tue Apr 19 15:58:04 2022 -0700 scsi: ufs: Introduce ufshcd_clkgate_delay_set() Since the code to modify delay_ms while holding the host lock occurs twice, introduce a function that performs this action. Link: https://lore.kernel.org/r/20220419225811.4127248-22-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3fb20fcd93fe5a1580355f1ea73f6daed1712f06 Author: Bart Van Assche Date: Tue Apr 19 15:58:03 2022 -0700 scsi: ufs: Remove locking from around single register writes Single register writes are atomic and hence do not need to be surrounded by locking. Additionally, MMIO writes are typically posted asynchronously. Hence, there is no guarantee that these have finished by the time the spin_unlock*() call has finished. See also the nonposted-mmio property of the Open Firmware tree. See also pci_iomap(). Link: https://lore.kernel.org/r/20220419225811.4127248-21-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 21c2e3418d07955c7b87fc3f75688cb1c2b04a32 Author: Bart Van Assche Date: Tue Apr 19 15:58:02 2022 -0700 scsi: ufs: Remove the TRUE and FALSE definitions In the Linux kernel coding style document (Documentation/process/coding-style.rst) it is recommended to use the type 'bool' and also the values 'true' and 'false'. Hence this patch that removes the definitions and uses of TRUE and FALSE from the UFS driver. Link: https://lore.kernel.org/r/20220419225811.4127248-20-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d0c1725b1e64d9fd4e082f4b600d658b8a535cac Author: Bart Van Assche Date: Tue Apr 19 15:58:01 2022 -0700 scsi: ufs: Remove paths from source code comments Since specifying the path in a source file is redundant, remove the paths from source code comments. Link: https://lore.kernel.org/r/20220419225811.4127248-19-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2b10863f71637797121a729a55ba6872b8c85b2b Author: Bart Van Assche Date: Tue Apr 19 15:58:00 2022 -0700 scsi: ufs: Use an SPDX license identifier in the Kconfig file As requested in Documentation/process/license-rules.rst, use an SPDX license identifier. Link: https://lore.kernel.org/r/20220419225811.4127248-18-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e2106584d0110b2613cc7de3bf013fa9e070bfd1 Author: Bart Van Assche Date: Tue Apr 19 15:57:59 2022 -0700 scsi: ufs: Rename sdev_ufs_device into ufs_device_wlun The new name reflects the role of this member variable better: a WLUN through which the power mode of the UFS device is controlled. Link: https://lore.kernel.org/r/20220419225811.4127248-17-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b4ade33b0d168334177466488cd7aa03b1569a86 Author: Bart Van Assche Date: Tue Apr 19 15:57:58 2022 -0700 scsi: ufs: Remove the driver version The current version number is 0.2. That driver version was assigned more than nine years ago. A version number that is not updated while the driver is updated is not useful. Hence remove the driver version number from the UFS driver. See also commit e0eca63e3421 ("[SCSI] ufs: Separate PCI code into glue driver"). Link: https://lore.kernel.org/r/20220419225811.4127248-16-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Reviewed-by: Avri Altman Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c906e8328de83b27f27af07cf79afb799e69838a Author: Bart Van Assche Date: Tue Apr 19 15:57:57 2022 -0700 scsi: ufs: Make the config_scaling_param calls type safe Pass the actual type to config_scaling_param callback as the third argment instead of a void pointer. Remove a superfluous NULL pointer check from ufs_qcom_config_scaling_param(). Link: https://lore.kernel.org/r/20220419225811.4127248-15-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bjorn Andersson Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 778d2b0ec6d11642f42ad55b0415988a85255f6c Author: Bart Van Assche Date: Tue Apr 19 15:57:56 2022 -0700 scsi: ufs: Switch to aggregate initialization Make it easier to verify for humans that ufshcd_init_pwr_dev_param() initializes all structure members. This patch does not change any functionality. Link: https://lore.kernel.org/r/20220419225811.4127248-14-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9474c64e83ca5561a7c5b410395ec6c24616d3b4 Author: Bart Van Assche Date: Tue Apr 19 15:57:55 2022 -0700 scsi: ufs: Remove unused constants and code Commit 5b44a07b6bb2 ("scsi: ufs: Remove pre-defined initial voltage values of device power") removed the code that uses the UFS_VREG_VCC* constants and also the code that sets the min_uV and max_uV member variables. Hence also remove these constants and that member variable. Link: https://lore.kernel.org/r/20220419225811.4127248-13-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Stanley Chu Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit acbbfe484faac99d0088aa259e62a5b55aef3b39 Author: Bart Van Assche Date: Tue Apr 19 15:57:54 2022 -0700 scsi: ufs: Invert the return value of ufshcd_is_hba_active() It is confusing that ufshcd_is_hba_active() returns 'true' if the HBA is not active. Clear up this confusion by inverting the return value of ufshcd_is_hba_active(). This patch does not change any functionality. Link: https://lore.kernel.org/r/20220419225811.4127248-12-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit aead21f32ae787af140233e32e18801dfd5185b1 Author: Bart Van Assche Date: Tue Apr 19 15:57:53 2022 -0700 scsi: ufs: Declare the quirks array const Declare the quirks array and also its 'model' member const to make it explicit that these are not modified. Link: https://lore.kernel.org/r/20220419225811.4127248-11-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 25eff2f543b11597a6200c55ca3a1bdf0a77bf9f Author: Bart Van Assche Date: Tue Apr 19 15:57:52 2022 -0700 scsi: ufs: Rename struct ufs_dev_fix into ufs_dev_quirk Since struct ufs_dev_fix contains quirk information, rename it into struct ufs_dev_quirk. Link: https://lore.kernel.org/r/20220419225811.4127248-10-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit dd2cf44ff4eca20b4b42014d1c7ada3518fda4e1 Author: Bart Van Assche Date: Tue Apr 19 15:57:51 2022 -0700 scsi: ufs: Remove the UFS_FIX() and END_FIX() macros Since these two macros reduce code readability, remove them. Link: https://lore.kernel.org/r/20220419225811.4127248-9-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9d3ab17e840c48c3ca427c5f7138f361e2d8394c Author: Bart Van Assche Date: Tue Apr 19 15:57:50 2022 -0700 scsi: ufs: Use get_unaligned_be16() instead of be16_to_cpup() Use get_unaligned_be16(...) instead of the equivalent but harder to read be16_to_cpup((__be16 *)...). Link: https://lore.kernel.org/r/20220419225811.4127248-8-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1de4378f605787d79a6aab905c96a4320411b9b1 Author: Bart Van Assche Date: Tue Apr 19 15:57:49 2022 -0700 scsi: ufs: Remove ufshcd_lrb.sense_buffer ufshcd_lrb.sense_buffer is NULL if ufshcd_lrb.cmd is NULL and ufshcd_lrb.sense_buffer points at cmd->sense_buffer if ufshcd_lrb.cmd is set. In other words, the ufshcd_lrb.sense_buffer member is identical to cmd->sense_buffer. Hence this patch that removes the ufshcd_lrb.sense_buffer structure member. Link: https://lore.kernel.org/r/20220419225811.4127248-7-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b639b59b44fdab99bcff7b4d01ef642605ae7aa4 Author: Bart Van Assche Date: Tue Apr 19 15:57:48 2022 -0700 scsi: ufs: Remove ufshcd_lrb.sense_bufflen ufshcd_lrb.sense_bufflen is set but never read. Hence remove this struct member. Link: https://lore.kernel.org/r/20220419225811.4127248-6-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Keoseong Park Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a858af9a9e01972c33f61036a3de6f707184e51b Author: Bart Van Assche Date: Tue Apr 19 15:57:47 2022 -0700 scsi: ufs: Simplify statements that return a boolean Convert "if (expr) return true; else return false;" into "return expr;" if either 'expr' is a boolean expression or the return type of the function is 'bool'. Link: https://lore.kernel.org/r/20220419225811.4127248-5-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bjorn Andersson Reviewed-by: Keoseong Park Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 51d1628fc4572705daabac18a7935b661baae1a0 Author: Bart Van Assche Date: Tue Apr 19 15:57:46 2022 -0700 scsi: ufs: Remove superfluous boolean conversions Remove "? true : false" if the preceding expression yields a boolean or if the result of the expression is assigned to a boolean since in these two cases the "? true : false" part is superfluous. Link: https://lore.kernel.org/r/20220419225811.4127248-4-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bjorn Andersson Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 59a57bb79e1079ab634370c07eb6506711c69f85 Author: Bart Van Assche Date: Tue Apr 19 15:57:45 2022 -0700 scsi: ufs: Declare ufshcd_wait_for_register() static Declare this function static since it is only used inside the ufshcd.c source file. Link: https://lore.kernel.org/r/20220419225811.4127248-3-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2abe580023644d76f9d4ef1c3f13f6ef38de7e15 Author: Bart Van Assche Date: Tue Apr 19 15:57:44 2022 -0700 scsi: ufs: Fix a spelling error in a source code comment Change one occurrence of "adpater" into "adapter". Link: https://lore.kernel.org/r/20220419225811.4127248-2-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Avri Altman Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a4e6496fca3f32e997e8a3b5c44e2a1ae09d018e Author: Konstantin Vyshetsky Date: Wed Apr 20 17:24:29 2022 -0700 scsi: ufs: core: Increase fDeviceInit poll frequency UFS devices are expected to clear fDeviceInit flag in single digit milliseconds. Current values of 5 to 10 millisecond sleep add to increased latency during the initialization and resume path. This CL lowers the sleep range to 500 to 1000 microseconds. Link: https://lore.kernel.org/r/20220421002429.3136933-1-bvanassche@acm.org Acked-by: Avri Altman Signed-off-by: Konstantin Vyshetsky Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 565138ac5f8a5330669a20e5f94759764e9165ec Author: Dan Carpenter Date: Thu Apr 21 18:03:52 2022 +0300 scsi: iscsi: Fix harmless double shift bug These flags are supposed to be bit numbers. Right now they cause a double shift bug where we use BIT(BIT(2)) instead of BIT(2). Fortunately, the bit numbers are small and it's done consistently so it does not cause an issue at run time. Link: https://lore.kernel.org/r/YmFyWHf8nrrx+SHa@kili Fixes: 5bd856256f8c ("scsi: iscsi: Merge suspend fields") Reviewed-by: Mike Christie Reviewed-by: Lee Duncan Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit a84ca704d8306a949578d36c028c8e1bab3dcf0b Author: Haowen Bai Date: Sun Apr 24 16:26:41 2022 +0800 selftests/powerpc/pmu: Fix unsigned function returning negative constant The function __perf_reg_mask has an unsigned return type, but returns a negative constant to indicate an error condition. So we change unsigned to int. Signed-off-by: Haowen Bai Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1650788802-14402-1-git-send-email-baihaowen@meizu.com commit 2fb70d1d36e2f8482a78bb8aae688ae1416af889 Author: Frank Rowand Date: Sun Apr 24 13:40:14 2022 -0500 powerpc/boot: remove unused function find_node_by_linuxphandle() The last user of find_node_by_linuxphandle() was removed in v4.18-rc1 by commit 30f4bbe0472a ("powerpc/boot: Remove support for Marvell MPSC serial controller") four years ago. This function is no longer needed. Signed-off-by: Frank Rowand Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220424184014.968274-1-frowand.list@gmail.com commit 95af09fabf3782be9728a6af6461f6937cd8e528 Author: Konstantin Shelekhin Date: Tue Apr 19 00:26:22 2022 +0300 scsi: target: core: Silence the message about unknown VPD pages Target does not support some VPD pages and is very verbose about it. Sometimes initiators don't bother and just keep sending the same request from time to time, filling up the logs. This patch lowers the message priority to debug. Link: https://lore.kernel.org/r/20220418212622.275516-1-k.shelekhin@yadro.com Signed-off-by: Konstantin Shelekhin Signed-off-by: Martin K. Petersen commit 8ba816b23abd2a9a05705f3d00b8653f8be73015 Author: Yu Kuai Date: Tue Apr 26 10:21:33 2022 +0800 null-blk: save memory footprint for struct nullb_cmd Total 16 bytes can be saved in two ways: 1) The field 'bio' will only be used in bio based mode, and the field 'rq' will only be used in mq mode. Since they won't be used in the same time, declare a union for them. 2) The field 'bool fake_timeout' can be placed in the hole after the field 'error'. Signed-off-by: Yu Kuai Link: https://lore.kernel.org/r/20220426022133.3999006-1-yukuai3@huawei.com Signed-off-by: Jens Axboe commit fe413ab32b240d30c2500c3ba8f3f0ccbcf59fe4 Author: Damien Le Moal Date: Tue Mar 8 08:48:54 2022 +0900 scsi: mpt3sas: Fix adapter replyPostRegisterIndex declaration The replyPostRegisterIndex array of struct MPT3SAS_ADAPTER stores iomem resource addresses. Fix its declaration to annotate it with __iomem to avoid sparse warnings for writel() calls using the stored addresses. Link: https://lore.kernel.org/r/20220307234854.148145-6-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 82b4420c288c45cc38a1be6c5b4e396c1ea4599f Author: Damien Le Moal Date: Tue Mar 8 08:48:53 2022 +0900 scsi: mpt3sas: Fix event callback log_code value handling In mpt3sas_scsih_event_callback(), fix a sparse warning when testing the event log code value by replacing the use of a pointer to the address storing the event log code with a log code local variable. Doing so, le32_to_cpu() is used when the log code value is assigned, avoiding a sparse warning. Link: https://lore.kernel.org/r/20220307234854.148145-5-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 7ab4d2441b952977556672c2fe3f4c2a698cbb37 Author: Damien Le Moal Date: Tue Mar 8 08:48:52 2022 +0900 scsi: mpt3sas: Fix ioc->base_readl() use The functions _base_readl_aero() and _base_readl() used for an adapter base_readl() method are implemented using a regular readl() call which internally performs a conversion to CPU endianness (le32_to_cpu()) of the values read. The users of the ioc base_readl() method should thus not convert again the values read using le16_to_cpu(). Fixing this removes sparse warnings. Link: https://lore.kernel.org/r/20220307234854.148145-4-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit b4efbec4c2a75b619fae4e8768be379e88c78687 Author: Damien Le Moal Date: Tue Mar 8 08:48:51 2022 +0900 scsi: mpt3sas: Fix writel() use writel() internally executes cpu_to_le32() to convert the value being written to little endian. The caller should thus not use this conversion function for the value passed to writel(). Remove the cpu_to_le32() calls in _base_put_smid_scsi_io_atomic(), _base_put_smid_fast_path_atomic(), _base_put_smid_hi_priority_atomic() _base_put_smid_default_atomic() and _base_handshake_req_reply_wait(). Link: https://lore.kernel.org/r/20220307234854.148145-3-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit dceaef94a4753d4d49d493a6cd4a81168e384d6f Author: Damien Le Moal Date: Tue Mar 8 08:48:50 2022 +0900 scsi: mpt3sas: Fix _ctl_set_task_mid() TaskMID check The TaskMID field of struct Mpi2SCSITaskManagementRequest_t is a 16-bit little endian value. Fix the search loop in _ctl_set_task_mid() to add a cpu_to_le16() conversion before checking the value of TaskMID to avoid sparse warnings. While at it, simplify the search loop code to remove an unnecessarily complicated if condition. Link: https://lore.kernel.org/r/20220307234854.148145-2-damien.lemoal@opensource.wdc.com Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit ad14649fc5ab216e0abb6b38115898238a0991f5 Author: Gleb Chesnokov Date: Fri Apr 15 12:42:24 2022 +0000 scsi: qla2xxx: Remove free_sg command flag The use of the free_sg command flag was dropped in commit 2c39b5ca2a8c ("qla2xxx: Remove SRR code"). Hence remove this flag and its check. Link: https://lore.kernel.org/r/AS8PR10MB4952747D20B76DC8FE793CCA9DEE9@AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM Reviewed-by: Himanshu Madhani Signed-off-by: Gleb Chesnokov Signed-off-by: Martin K. Petersen commit 4bb3894ae658d8d5217843f344dd6cd5a9388924 Author: Alexander Shiyan Date: Wed Apr 20 11:12:06 2022 +0300 ARM: dts: i.MX51: digi-connectcore-jsk: Use usb-nop-xceiv usbphy for USB1 Add node describing the USB1 usbphy. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit a65123d60d757255694e55d228c247fb6da5a4fb Author: Alexander Shiyan Date: Wed Apr 20 11:12:05 2022 +0300 ARM: dts: i.MX51: digi-connectcore-som: Setup usbotg vbus-supply The VBUS on usbotg is connected to the PMIC SWBST, let's reflect that in the bindings. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit 12f9fa8880f2309abc0d344a19590c9e00b3ae91 Author: Alexander Shiyan Date: Wed Apr 20 11:12:04 2022 +0300 ARM: dts: i.MX51: digi-connectcore-som: Update PMIC voltages This patch updates the PMIC voltages according to the module's datasheet to match both commercial and industrial variants of the module. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit ae7ab0bb32bdf18b70be04c3f254caaa54187225 Author: Alexander Shiyan Date: Wed Apr 20 11:12:03 2022 +0300 ARM: dts: i.MX51: digi-connectcore-som: Remove unused regulators VGEN1, VGEN2 and GPO1 regulators are not used on SOM. Let's remove these entries. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit 1f5985b6f5d2090897918b100cad223a74dce706 Author: Alexander Shiyan Date: Wed Apr 20 11:12:02 2022 +0300 ARM: dts: imx51: Add generic DMA bindings for UART nodes Updates UART nodes to adopt generic DMA bindings. Signed-off-by: Alexander Shiyan Signed-off-by: Shawn Guo commit 4b9b8985f9697b5d26efe7784e4b9e51cb452020 Author: Changming Huang Date: Wed Apr 20 10:35:56 2022 +0800 ARM: dts: Add initial LS1021A IoT board dts support The LS1021A-IoT gateway reference design is a purpose-built, small footprint hardware platform equipped with a wide array of both high-speed connectivity and low speed serial interfaces. CC: Li Yang Signed-off-by: Changming Huang Signed-off-by: Alison Wang Signed-off-by: Shawn Guo commit 8f14852e89113d738c99c375b4c8b8b7e1073df1 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:50 2022 +0530 bpf: Tag argument to be released in bpf_func_proto Add a new type flag for bpf_arg_type that when set tells verifier that for a release function, that argument's register will be the one for which meta.ref_obj_id will be set, and which will then be released using release_reference. To capture the regno, introduce a new field release_regno in bpf_call_arg_meta. This would be required in the next patch, where we may either pass NULL or a refcounted pointer as an argument to the release function bpf_kptr_xchg. Just releasing only when meta.ref_obj_id is set is not enough, as there is a case where the type of argument needed matches, but the ref_obj_id is set to 0. Hence, we must enforce that whenever meta.ref_obj_id is zero, the register that is to be released can only be NULL for a release function. Since we now indicate whether an argument is to be released in bpf_func_proto itself, is_release_function helper has lost its utitlity, hence refactor code to work without it, and just rely on meta.release_regno to know when to release state for a ref_obj_id. Still, the restriction of one release argument and only one ref_obj_id passed to BPF helper or kfunc remains. This may be lifted in the future. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-3-memxor@gmail.com commit 61df10c7799e27807ad5e459eec9d77cddf8bf45 Author: Kumar Kartikeya Dwivedi Date: Mon Apr 25 03:18:49 2022 +0530 bpf: Allow storing unreferenced kptr in map This commit introduces a new pointer type 'kptr' which can be embedded in a map value to hold a PTR_TO_BTF_ID stored by a BPF program during its invocation. When storing such a kptr, BPF program's PTR_TO_BTF_ID register must have the same type as in the map value's BTF, and loading a kptr marks the destination register as PTR_TO_BTF_ID with the correct kernel BTF and BTF ID. Such kptr are unreferenced, i.e. by the time another invocation of the BPF program loads this pointer, the object which the pointer points to may not longer exist. Since PTR_TO_BTF_ID loads (using BPF_LDX) are patched to PROBE_MEM loads by the verifier, it would safe to allow user to still access such invalid pointer, but passing such pointers into BPF helpers and kfuncs should not be permitted. A future patch in this series will close this gap. The flexibility offered by allowing programs to dereference such invalid pointers while being safe at runtime frees the verifier from doing complex lifetime tracking. As long as the user may ensure that the object remains valid, it can ensure data read by it from the kernel object is valid. The user indicates that a certain pointer must be treated as kptr capable of accepting stores of PTR_TO_BTF_ID of a certain type, by using a BTF type tag 'kptr' on the pointed to type of the pointer. Then, this information is recorded in the object BTF which will be passed into the kernel by way of map's BTF information. The name and kind from the map value BTF is used to look up the in-kernel type, and the actual BTF and BTF ID is recorded in the map struct in a new kptr_off_tab member. For now, only storing pointers to structs is permitted. An example of this specification is shown below: #define __kptr __attribute__((btf_type_tag("kptr"))) struct map_value { ... struct task_struct __kptr *task; ... }; Then, in a BPF program, user may store PTR_TO_BTF_ID with the type task_struct into the map, and then load it later. Note that the destination register is marked PTR_TO_BTF_ID_OR_NULL, as the verifier cannot know whether the value is NULL or not statically, it must treat all potential loads at that map value offset as loading a possibly NULL pointer. Only BPF_LDX, BPF_STX, and BPF_ST (with insn->imm = 0 to denote NULL) are allowed instructions that can access such a pointer. On BPF_LDX, the destination register is updated to be a PTR_TO_BTF_ID, and on BPF_STX, it is checked whether the source register type is a PTR_TO_BTF_ID with same BTF type as specified in the map BTF. The access size must always be BPF_DW. For the map in map support, the kptr_off_tab for outer map is copied from the inner map's kptr_off_tab. It was chosen to do a deep copy instead of introducing a refcount to kptr_off_tab, because the copy only needs to be done when paramterizing using inner_map_fd in the map in map case, hence would be unnecessary for all other users. It is not permitted to use MAP_FREEZE command and mmap for BPF map having kptrs, similar to the bpf_timer case. A kptr also requires that BPF program has both read and write access to the map (hence both BPF_F_RDONLY_PROG and BPF_F_WRONLY_PROG are disallowed). Note that check_map_access must be called from both check_helper_mem_access and for the BPF instructions, hence the kptr check must distinguish between ACCESS_DIRECT and ACCESS_HELPER, and reject ACCESS_HELPER cases. We rename stack_access_src to bpf_access_src and reuse it for this purpose. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220424214901.2743946-2-memxor@gmail.com commit d9d31cf88702ae071bec033e5c8714048aa71285 Author: Stanislav Fomichev Date: Mon Apr 25 15:04:48 2022 -0700 bpf: Use bpf_prog_run_array_cg_flags everywhere Rename bpf_prog_run_array_cg_flags to bpf_prog_run_array_cg and use it everywhere. check_return_code already enforces sane return ranges for all cgroup types. (only egress and bind hooks have uncanonical return ranges, the rest is using [0, 1]) No functional changes. v2: - 'func_ret & 1' under explicit test (Andrii & Martin) Suggested-by: Alexei Starovoitov Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220425220448.3669032-1-sdf@google.com commit a677bdf8b6aeea56bd545f7d7c1dcf18d0538426 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:51 2022 +0800 clk: mediatek: Add MT8186 ipesys clock support Add MT8186 ipesys clock controller which provides clock gate control for Image Process Engine. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-16-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 8c3adc5d2e14a4c35fcef8afdf777b8d2a99ea60 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:50 2022 +0800 clk: mediatek: Add MT8186 mdpsys clock support Add MT8186 mdpsys clock controller which provides clock gate control in Multimedia Data Path. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-15-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 6f2e1208249fde5bfdaac98affff955c49cb5da2 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:49 2022 +0800 clk: mediatek: Add MT8186 camsys clock support Add MT8186 camsys clock controllers which provide clock gate control for camera IP blocks. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-14-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit fc2195028363527bd566abd38d84fd63b620c53a Author: Chun-Jie Chen Date: Sat Apr 9 21:22:48 2022 +0800 clk: mediatek: Add MT8186 vencsys clock support Add MT8186 vencsys clock controller which provide clock gate control for video encoder. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-13-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 7e23620dff94c4956f613f4c032c4140de188349 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:47 2022 +0800 clk: mediatek: Add MT8186 vdecsys clock support Add MT8186 vdec clock controller which provide clock gate control for video decoder. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-12-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit a6c0c9b8fc91925b2702bac4d04640f894552d37 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:46 2022 +0800 clk: mediatek: Add MT8186 imgsys clock support Add MT8186 imgsys clock controllers which provide clock gate control for image IP blocks. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-11-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit b6da76d6eb42757a5e100f309ac8852d407f3c60 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:45 2022 +0800 clk: mediatek: Add MT8186 wpesys clock support Add MT8186 wpesys clock controllers which provide clock gate control in Wrapping Engine. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-10-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit c8c36b996f3c1ca0d2e799f67a2cbb5392568a45 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:44 2022 +0800 clk: mediatek: Add MT8186 mmsys clock support Add MT8186 mmsys clock controller which provides clock gate control in video system. This is integrated with mtk-mmsys driver which will populate device by platform_device_register_data to start mmsys clock driver. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-9-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit e4a424461c82daab6ef9cbe331862fbcccb292ee Author: Chun-Jie Chen Date: Sat Apr 9 21:22:43 2022 +0800 clk: mediatek: Add MT8186 mfgsys clock support Add MT8186 mfg clock controller which provides clock gate control for GPU. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-8-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 66cd0b4b0ce5e1b26e0eb42110e34860fd4a25cf Author: Chun-Jie Chen Date: Sat Apr 9 21:22:42 2022 +0800 clk: mediatek: Add MT8186 imp i2c wrapper clock support Add MT8186 imp i2c wrapper clock controllers which provide clock gate control in i2c IP blocks. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-7-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 97f0cc59e521b16792f0a0b9eb2e7c9745283e90 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:41 2022 +0800 clk: mediatek: Add MT8186 apmixedsys clock support Add MT8186 apmixedsys clock controller which provides Plls generated from SoC. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-6-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 4d6534ec55cf2c907be98b5bb2651247e3f1cf80 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:40 2022 +0800 clk: mediatek: Add MT8186 infrastructure clock support Add MT8186 infrastructure clock controller which provides clock gate control for basic IP like pwm, uart, spi and so on. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-5-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit c19df9619e5506b4ab09304ee7cdc4edbbb06ea9 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:39 2022 +0800 clk: mediatek: Add MT8186 topckgen clock support Add MT8186 topckgen clock controller which provides muxes, dividers to handle variety clock selection in other IP blocks. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-4-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 1f2967a17c595672cf9a5edcbf2ee064421375d0 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:38 2022 +0800 clk: mediatek: Add MT8186 mcusys clock support Add MT8186 mcusys clock controller which provides muxes to select the clock source of APMCU. Signed-off-by: Chun-Jie Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220409132251.31725-3-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit f113a51aa2cfbd22c376d8722b5c9fef469be162 Author: Chun-Jie Chen Date: Sat Apr 9 21:22:37 2022 +0800 dt-bindings: ARM: MediaTek: Add new document bindings of MT8186 clock This patch adds the new binding documentation for system clock and functional clock on MediaTek MT8186. Signed-off-by: Chun-Jie Chen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220409132251.31725-2-chun-jie.chen@mediatek.com Signed-off-by: Stephen Boyd commit 639d5661cc808057854681685ecb596406dbacce Author: Linus Walleij Date: Fri Apr 15 00:17:51 2022 +0200 clk: ux500: Implement the missing CLKOUT clocks This implements the two missing CLKOUT clocks for the ux500 (well really U8500/DB8500) SoC. The clocks are initialized using a specific parent and divider and these are specified in the device tree, see the separate binding patch. The implementation is a bit different in that it will only create the clock in the clock framework if a user appears in the device tree, rather than it being registered upfront like most of the other clocks. This is because the clock needs parameters for source and divider from the consumer phandle for the clock to be set up properly when the clock is registered. There could be more than one user of a CLKOUT clock, but we have not seen this in practice. If this happens the framework prints and info and returns the previously registered clock. Using the clocks requires also muxing the CLKOUT1 or CLKOUT2 to the appropriate pad. In practice this is achived in a pinctrl handle in the DTS node for the device using the CLKOUT clock, so this muxing is done separately from the clock itself. Example: haptic@49 { compatible = "immersion,isa1200"; reg = <0x49>; (...) /* clkout1 from ACLK divided by 8 */ clocks = <&clkout_clk DB8500_CLKOUT_1 DB8500_CLKOUT_SRC_ACLK 8>; pinctrl-names = "default"; pinctrl-0 = <&isa1200_janice_default>; }; isa1200_janice_default: isa1200_janice { /* Bring out clkout1 on pin GPIO227 pin AH7 */ janice_mux { function = "clkout"; groups = "clkout1_a_1"; }; janice_cfg1 { pins = "GPIO227_AH7"; ste,config = <&out_lo>; }; (...) This was tested successfully with the Immersion ISA1200 haptic feedback unit on the Samsung Galaxy S Advance GT-I9070 (Janice) mobile phone. As the CLKOUT clocks need some undefined fixed rate parent clocks that are currently missing from the PRCMU clock implementation, the three simplest are added in this patch: clk38m_to_clkgen, aclk and sysclk. The only parent not yet available in the implementation is clk009, which is a kind of special muxed and divided clock which isn't even implemented in the vendor clock driver. Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220414221751.323525-6-linus.walleij@linaro.org Signed-off-by: Stephen Boyd commit a8173c5953b1a9de279ec50dab6756234f85e93f Author: Linus Walleij Date: Fri Apr 15 00:17:50 2022 +0200 clk: ux500: Rewrite PRCMU clocks to use clk_hw_* This rewrites all the u8500 PRCMU clocks and helper functions to handle clocks using struct clk_hw rather than struct clk, as is normal for modern clock drivers. Use clk_hw_register(), of_clk_add_hw_provider() and stack all the clocks into a compile-time dynamic array of struct clk_hw_onecell_data. Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220414221751.323525-5-linus.walleij@linaro.org Signed-off-by: Stephen Boyd commit 00d08cd0bacb1cff0dca905859df68acb3f99107 Author: Linus Walleij Date: Fri Apr 15 00:17:49 2022 +0200 clk: ux500: Drop .is_prepared state from PRCMU clocks The core already keeps a software prepare count. Drop this custom software prepare count. The only semantic difference is that if disabling the clock fails, .is_prepared() will still return 1, but this will only serve to confuse the framework, the error message is sufficient. Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220414221751.323525-4-linus.walleij@linaro.org Signed-off-by: Stephen Boyd commit 801179b670be3ff5e07c76c00837615b7f481aec Author: Linus Walleij Date: Fri Apr 15 00:17:48 2022 +0200 clk: ux500: Drop .is_enabled state from PRCMU clocks The core already keeps a software enable count. Drop this custom software enable count. Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220414221751.323525-3-linus.walleij@linaro.org Signed-off-by: Stephen Boyd commit 7335631fcd5eecfa84555bd57433e6446d06ad21 Author: Linus Walleij Date: Fri Apr 15 00:17:47 2022 +0200 dt-bindings: clock: u8500: Add clkout clock bindings This adds device tree bindings for the externally routed clocks CLKOUT1 and CLKOUT2 clocks found in the DB8500. Cc: devicetree@vger.kernel.org Reviewed-by: Ulf Hansson Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220414221751.323525-2-linus.walleij@linaro.org Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 68c4844985d1f8c1b1a71dfcdbfacb5a30babc95 Author: Shaopeng Tan Date: Wed Mar 23 17:12:27 2022 +0900 selftests/resctrl: Add missing SPDX license to Makefile Add the missing SPDX(SPDX-License-Identifier) license header to tools/testing/selftests/resctrl/Makefile. Acked-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit 42e2f21451f73a00ce3e63c46da8fb71d30b4cb0 Author: Shaopeng Tan Date: Wed Mar 23 17:12:26 2022 +0900 selftests/resctrl: Update README about using kselftest framework to build/run resctrl_tests resctrl_tests can be built or run using kselftests framework. Add description on how to do so in README. Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit b733143cc455bf83fa5fbd2e0eac63fb2d302461 Author: Shaopeng Tan Date: Wed Mar 23 17:12:25 2022 +0900 selftests/resctrl: Make resctrl_tests run using kselftest framework In kselftest framework, all tests can be build/run at a time, and a sub test also can be build/run individually. As follows: $ make kselftest-all TARGETS=resctrl $ make -C tools/testing/selftests run_tests $ make -C tools/testing/selftests TARGETS=resctrl run_tests However, resctrl_tests cannot be run using kselftest framework, users have to change directory to tools/testing/selftests/resctrl/, run "make" to build executable file "resctrl_tests", and run "sudo ./resctrl_tests" to execute the test. To build/run resctrl_tests using kselftest framework. Modify tools/testing/selftests/Makefile and tools/testing/selftests/resctrl/Makefile. Even after this change, users can still build/run resctrl_tests without using framework as before. Reviewed-by: Reinette Chatre # resctrl changes Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit 3531d930c36fb991668ba0644fb14e8e24d923af Author: Shaopeng Tan Date: Wed Mar 23 17:12:24 2022 +0900 selftests/resctrl: Fix resctrl_tests' return code to work with selftest framework In kselftest framework, if a sub test can not run by some reasons, the test result should be marked as SKIP rather than FAIL. Return KSFT_SKIP(4) instead of KSFT_FAIL(1) if resctrl_tests is not run as root or it is run on a test environment which does not support resctrl. - ksft_exit_fail_msg(): returns KSFT_FAIL(1) - ksft_exit_skip(): returns KSFT_SKIP(4) Reviewed-by: Shuah Khan Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit e2e3fb6ef0d6548defbe0be6e092397aaa92f3a1 Author: Shaopeng Tan Date: Wed Mar 23 17:12:23 2022 +0900 selftests/resctrl: Change the default limited time to 120 seconds When testing on a Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz the resctrl selftests fail due to timeout after exceeding the default time limit of 45 seconds. On this system the test takes about 68 seconds. Since the failing test by default accesses a fixed size of memory, the execution time should not vary significantly between different environment. A new default of 120 seconds should be sufficient yet easy to customize with the introduction of the "settings" file for reference. Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit f54b3278164405fdd4f5f1b53f0d04e34ade27a6 Author: Shaopeng Tan Date: Wed Mar 23 17:12:22 2022 +0900 selftests/resctrl: Kill child process before parent process terminates if SIGTERM is received In kselftest framework, a sub test is run using the timeout utility and it will send SIGTERM to the test upon timeout. In resctrl_tests, a child process is created by fork() to run benchmark but SIGTERM is not set in sigaction(). If SIGTERM signal is received, the parent process will be killed, but the child process still exists. Kill child process before the parent process terminates if SIGTERM signal is received. Reviewed-by: Shuah Khan Reviewed-by: Reinette Chatre Reviewed-by: Fenghua Yu Signed-off-by: Shaopeng Tan Signed-off-by: Shuah Khan commit d577380da04e410a31e7f944b04d838ab1c8a1c3 Author: Shaopeng Tan Date: Wed Mar 23 17:09:28 2022 +0900 selftests/resctrl: Print a message if the result of MBM&CMT tests is failed on Intel CPU According to "Intel Resource Director Technology (Intel RDT) on 2nd Generation Intel Xeon Scalable Processors Reference Manual", When the Intel Sub-NUMA Clustering(SNC) feature is enabled, Intel CMT and MBM counters may not be accurate. However, there does not seem to be an architectural way to detect if SNC is enabled. If the result of MBM&CMT test fails on Intel CPU, print a message to let users know a possible cause of failure. Acked-by: Reinette Chatre Signed-off-by: Shaopeng Tan Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit 6220f69e72a534838cffd84dce6afd777777be03 Author: Shaopeng Tan Date: Wed Mar 23 17:09:27 2022 +0900 selftests/resctrl: Extend CPU vendor detection Currently, the resctrl_tests only has a function to detect AMD vendor. Since when the Intel Sub-NUMA Clustering feature is enabled, Intel CMT and MBM counters may not be accurate, the resctrl_tests also need a function to detect Intel vendor. And in the future, resctrl_tests will need a function to detect different vendors, such as Arm. Extend the function to detect Intel vendor as well. Also, this function can be easily extended to detect other vendors. Signed-off-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit 6c1c1eb8c87de221051b9198d40971640060842f Author: Hans Verkuil Date: Mon Apr 25 07:36:14 2022 +0100 media: ext-ctrls-codec.rst: fix indentation The indentation was wrong, causing the documentation build to fail with: Sphinx parallel build error: docutils.utils.SystemMessagePropagation: Error parsing content block for the "flat-table" directive: two-level bullet list expected, but row 1 does not contain a second-level bullet list... flat-table:: :header-rows: 0 :stub-columns: 0 * - ``V4L2_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_RANDOM`` - The whole frame is completely refreshed randomly after the specified period. * - ``V4L2_MPEG_VIDEO_INTRA_REFRESH_PERIOD_TYPE_CYCLIC`` - The whole frame MBs are completely refreshed in cyclic order after the specified period. make[1]: *** [Documentation/Makefile:96: htmldocs] Error 2 make: *** [Makefile:1678: htmldocs] Error 2 Link: https://lore.kernel.org/linux-media/62b53cbb-f3e2-ed8a-bba2-3f4145d9b8db@xs4all.nl Fixes: fcbc4acf8b8d ("media: v4l2-ctrls: Add intra-refresh type control") Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 83f48ad508b0539f4a1737a1a125d1b66191dbc3 Merge: 0386dd9140d04 c4eb48f7739fc Author: Mark Brown Date: Mon Apr 25 23:51:28 2022 +0100 ASoC: SOF: Intel: improve HDaudio DAI support Merge series from Pierre-Louis Bossart : The SOF CI and daily tests exposed a number of issues with corner cases on platforms using the HDaudio DAI, such as UpExtreme boards or usual HDaudio+DMIC laptops. This patchset provides improvements for pause_push/pause_release, suspend-resume, mixing use cases and combinations of all three. The initial patches provide a cleanup, the last patches improve the state machine and DMA handling. commit 14364fca21208d0954d594e1eccb4ad239881081 Author: Colin Ian King Date: Sun Apr 24 19:22:27 2022 +0100 clk: mux: remove redundant initialization of variable width Variable width is being ininitialized with a value that is never read. The ininitializtion is redundant and can be removed. Move the variable to the scope it is required. Cleans up cppcheck warning: Variable 'width' is assigned a value that is never used. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220424182227.1364966-1-colin.i.king@gmail.com Signed-off-by: Stephen Boyd commit 69cc1b6fa565993b62210f314614be166d902a54 Author: Jens Axboe Date: Mon Apr 25 16:43:45 2022 -0600 io_uring: fix compile warning for 32-bit builds If IO_URING_SCM_ALL isn't set, as it would not be on 32-bit builds, then we trigger a warning: fs/io_uring.c: In function '__io_sqe_files_unregister': fs/io_uring.c:8992:13: warning: unused variable 'i' [-Wunused-variable] 8992 | int i; | ^ Move the ifdef up to include the 'i' variable declaration. Reported-by: Stephen Rothwell Fixes: 5e45690a1cb8 ("io_uring: store SCM state in io_fixed_file->file_ptr") Signed-off-by: Jens Axboe commit 9e3a845df9ea56387d2a6011299d44ddf21b3322 Author: Jakob Koschel Date: Tue Apr 12 14:20:40 2022 +0200 f2fs: 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/ Signed-off-by: Jakob Koschel Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit df35435d4144ae3a8afeedf45ea43c5cc63a70eb Author: Jakob Koschel Date: Tue Apr 12 14:20:39 2022 +0200 f2fs: Remove usage of list iterator pas the loop for list_move_tail() In preparation to limit the scope of a list iterator to the list traversal loop, the usage of the list iterator variable 'next' should be avoided past the loop body [1]. Instead of calling list_move_tail() on 'next' after the loop, it is called within the loop if the correct location was found. After the loop it covers the case if no location was found and it should be inserted based on the 'head' of the list. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Signed-off-by: Jaegeuk Kim commit 2aaf51dd39afb6d01d13f1e6fe20b684733b37d5 Author: Jakob Koschel Date: Fri Apr 1 00:34:14 2022 +0200 f2fs: fix dereference of stale list iterator after loop body The list iterator variable will be a bogus pointer if no break was hit. Dereferencing it (cur->page in this case) could load an out-of-bounds/undefined value making it unsafe to use that in the comparision to determine if the specific element was found. Since 'cur->page' *can* be out-ouf-bounds it cannot be guaranteed that by chance (or intention of an attacker) it matches the value of 'page' even though the correct element was not found. This is fixed by using a separate list iterator variable for the loop and only setting the original variable if a suitable element was found. Then determing if the element was found is simply checking if the variable is set. Fixes: 8c242db9b8c0 ("f2fs: fix stale ATOMIC_WRITTEN_PAGE private pointer") Signed-off-by: Jakob Koschel Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 12662d19467b391b5b509ac5e9ab4f583c6dde16 Author: Chao Yu Date: Tue Mar 29 00:02:53 2022 +0800 f2fs: fix to do sanity check on inline_dots inode As Wenqing reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215765 It will cause a kernel panic with steps: - mkdir mnt - mount tmp40.img mnt - ls mnt folio_mark_dirty+0x33/0x50 f2fs_add_regular_entry+0x541/0xad0 [f2fs] f2fs_add_dentry+0x6c/0xb0 [f2fs] f2fs_do_add_link+0x182/0x230 [f2fs] __recover_dot_dentries+0x2d6/0x470 [f2fs] f2fs_lookup+0x5af/0x6a0 [f2fs] __lookup_slow+0xac/0x200 lookup_slow+0x45/0x70 walk_component+0x16c/0x250 path_lookupat+0x8b/0x1f0 filename_lookup+0xef/0x250 user_path_at_empty+0x46/0x70 vfs_statx+0x98/0x190 __do_sys_newlstat+0x41/0x90 __x64_sys_newlstat+0x1a/0x30 do_syscall_64+0x37/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is for special file: e.g. character, block, fifo or socket file, f2fs doesn't assign address space operations pointer array for mapping->a_ops field, so, in a fuzzed image, if inline_dots flag was tagged in special file, during lookup(), when f2fs runs into __recover_dot_dentries(), it will cause NULL pointer access once f2fs_add_regular_entry() calls a_ops->set_dirty_page(). Fixes: 510022a85839 ("f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries") Reported-by: Wenqing Liu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c277f1411d7bc2831d48bde5c18d3b7f87c61646 Author: Jaegeuk Kim Date: Mon Mar 21 15:13:06 2022 -0700 f2fs: introduce data read/write showing path info This was used in Android for a long time. Let's upstream it. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c2ca36e82f704cb449020ccd29f1802c7497cc49 Author: Jaegeuk Kim Date: Wed Mar 23 13:30:04 2022 -0700 f2fs: remove unnecessary f2fs_lock_op in f2fs_new_inode This can be removed, since f2fs_alloc_nid() actually doesn't require to block checkpoint and __f2fs_build_free_nids() is covered by nm_i->nat_tree_lock. Suggested-by: Linus Torvalds Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 642c0969916eaa4878cb74f36752108e590b0389 Author: Chao Yu Date: Sun Mar 20 23:11:18 2022 +0800 f2fs: don't set GC_FAILURE_PIN for background GC So that it can reduce the possibility that file be unpinned forcely by foreground GC due to .i_gc_failures[GC_FAILURE_PIN] exceeds threshold. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a22bb5526d7dd627b94a7ee22e5a98c36e39fceb Author: Chao Yu Date: Sun Mar 20 23:11:17 2022 +0800 f2fs: check pinfile in gc_data_segment() in advance In order to skip migrating section which contains data of pinned file in advance. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 57e6f0562cb40d54dbe030f94c6307665b69a594 Author: Marek Vasut Date: Sun Apr 17 04:10:11 2022 +0200 drm: mxsfb: Obtain bus flags from bridge state In case the MXSFB is connected to a bridge, attempt to obtain bus flags from that bridge state too. The bus flags may specify e.g. the DE signal polarity. Acked-by: Alexander Stein Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Lucas Stach Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220417021011.337066-1-marex@denx.de commit 3604f1e5319bb1a284cc8d600d89dc0cc3bc8ed8 Author: Marek Vasut Date: Sun Apr 17 04:08:00 2022 +0200 drm: mxsfb: Reorder mxsfb_crtc_mode_set_nofb() Reorder mxsfb_crtc_mode_set_nofb() such that all functions which perform register IO are called from one single location in this function. This is a clean up. No functional change. Reviewed-by: Lucas Stach Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220417020800.336675-4-marex@denx.de commit 268a06e1dc82ef8de2251690cb84bacbbb58b376 Author: Marek Vasut Date: Sun Apr 17 04:07:59 2022 +0200 drm: mxsfb: Factor out mxsfb_set_mode() Pull mode registers programming from mxsfb_enable_controller() into dedicated function mxsfb_set_mode(). This is a clean up. No functional change. Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220417020800.336675-3-marex@denx.de commit cb285a5348e768dbc8edfe28cc2be5ec0c7e1a33 Author: Marek Vasut Date: Sun Apr 17 04:07:58 2022 +0200 drm: mxsfb: Replace mxsfb_get_fb_paddr() with drm_fb_cma_get_gem_addr() Replace mxsfb_get_fb_paddr() with drm_fb_cma_get_gem_addr() to correctly handle FB offset. Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220417020800.336675-2-marex@denx.de commit e518a9dc81d3de494640ba0ae2677d3d43a3709b Author: Marek Vasut Date: Sun Apr 17 04:07:57 2022 +0200 drm: mxsfb: Wrap FIFO reset and comments into mxsfb_reset_block() Wrap FIFO reset and comments into mxsfb_reset_block(), this is a clean up. No functional change. Reviewed-by: Lucas Stach Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Lucas Stach Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220417020800.336675-1-marex@denx.de commit 08802f515c3cfea80b48e198de52b4fcbbef27d3 Author: Vinod Koul Date: Wed Apr 6 15:10:31 2022 +0530 drm/msm/dsi: Add support for DSC configuration When DSC is enabled, we need to configure DSI registers accordingly and configure the respective stream compression registers. Add support to calculate the register setting based on DSC params and timing information and configure these registers. Signed-off-by: Dmitry Baryshkov Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480934/ Link: https://lore.kernel.org/r/20220406094031.1027376-15-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 83527af2eb457d7cd7e2119a311f04f505160f9c Author: Vinod Koul Date: Wed Apr 6 15:10:30 2022 +0530 drm/msm: Update generated headers Update headers from mesa commit: commit 28ae397be111c37c6ced397e12d453a7695701bd Author: Vinod Koul Date: Fri Apr 1 16:53:04 2022 +0530 freedreno/registers: update dsi registers to support dsc Display Stream compression (DSC) compresses the display stream in host which is later decoded by panel. This requires addition of 3 new DSI registers to support DSC over DSI. Signed-off-by: Vinod Koul Part-of: Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480932/ Link: https://lore.kernel.org/r/20220406094031.1027376-14-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 89f1bfc43f9838e2c6f06ba1ddbca89629e352ee Author: Vinod Koul Date: Wed Apr 6 15:10:29 2022 +0530 drm/msm/dsi: add mode valid callback for dsi_mgr Add a mode valid callback for dsi_mgr for checking mode being valid in case of DSC. For DSC the height and width needs to be multiple of slice, so we check that here Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480930/ Link: https://lore.kernel.org/r/20220406094031.1027376-13-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit f2803ee91a417eee2359e1a0b919a9b3b09887ec Author: Vinod Koul Date: Wed Apr 6 15:10:28 2022 +0530 drm/msm/disp/dpu1: Add DSC support in RM This add the bits in RM to enable the DSC blocks Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480928/ Link: https://lore.kernel.org/r/20220406094031.1027376-12-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 7e9cc175b159c49cab8805aec70a88314c2b40ed Author: Vinod Koul Date: Wed Apr 6 15:10:27 2022 +0530 drm/msm/disp/dpu1: Add support for DSC in topology For DSC to work we typically need a 2,2,1 configuration. This should suffice for resolutions up to 4k. For more resolutions like 8k this won't work. Also, it is better to use 2 LMs and DSC instances as half width results in lesser power consumption as compared to single LM, DSC at full width. The panel has been tested only with 2,2,1 configuration, so for now we blindly create 2,2,1 topology when DSC is enabled Co-developed-by: Abhinav Kumar Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480925/ Link: https://lore.kernel.org/r/20220406094031.1027376-11-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 1d6fe0b7e657a51cfd8a681822362fbb990738fc Author: Vinod Koul Date: Wed Apr 6 15:10:26 2022 +0530 drm/msm: Add missing num_dspp field documentation Somehow documentation for num_dspp was missed, so add that Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480924/ Link: https://lore.kernel.org/r/20220406094031.1027376-10-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 63f4a7bedb0d4fd136ae32e86b8d9f965c895343 Author: Dmitry Baryshkov Date: Wed Apr 6 15:10:25 2022 +0530 drm/msm/dpu: don't use merge_3d if DSC merge topology is used DPU supports different topologies for the case when multiple INTFs are being driven by the single phys_enc. The driver defaults to using 3DMux in such cases. Don't use it if DSC merge is used instead. Suggested-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/480922/ Link: https://lore.kernel.org/r/20220406094031.1027376-9-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 58dca9810749480737869d02bef4704756372194 Author: Vinod Koul Date: Wed Apr 6 15:10:24 2022 +0530 drm/msm/disp/dpu1: Add support for DSC in encoder We need to configure the encoder for DSC configuration and calculate DSC parameters for the given timing so this patch adds that support by adding dpu_encoder_prep_dsc() which is invoked when DSC is enabled. Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480920/ Link: https://lore.kernel.org/r/20220406094031.1027376-8-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 77f6da90487c6f670fa082a295bc9fe110ed9e86 Author: Vinod Koul Date: Wed Apr 6 15:10:23 2022 +0530 drm/msm/disp/dpu1: Add DSC support in hw_ctl Later gens of hardware have DSC bits moved to hw_ctl, so configure these bits so that DSC would work there as well Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480918/ Link: https://lore.kernel.org/r/20220406094031.1027376-7-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 7c5ab05edc9de699566b86e3cb551c07b74a0f50 Author: Vinod Koul Date: Wed Apr 6 15:10:22 2022 +0530 drm/msm/disp/dpu1: Add DSC for SDM845 to hw_catalog This adds SDM845 DSC blocks into hw_catalog Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480916/ Link: https://lore.kernel.org/r/20220406094031.1027376-6-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 893d698203ec546a391fd3a611383e7e94faff34 Author: Vinod Koul Date: Wed Apr 6 15:10:21 2022 +0530 drm/msm/disp/dpu1: Add support for DSC in pingpong block In SDM845, DSC can be enabled by writing to pingpong block registers, so add support for DSC in hw_pp Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480914/ Link: https://lore.kernel.org/r/20220406094031.1027376-5-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit c110cfd1753e13e10d5aaa5daff78adb4e885bf5 Author: Vinod Koul Date: Wed Apr 6 15:10:20 2022 +0530 drm/msm/disp/dpu1: Add support for DSC Display Stream Compression (DSC) is one of the hw blocks in dpu, so add support by adding hw blocks for DSC Reviewed-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480912/ Link: https://lore.kernel.org/r/20220406094031.1027376-4-vkoul@kernel.org [DB: applied typo noticed by Robert Foss] Signed-off-by: Dmitry Baryshkov commit c4f3f823c2a63853fae5bbd61548dc281bd3a9ff Author: Tony Lindgren Date: Thu Apr 14 11:58:07 2022 +0300 dt-bindings: timer: Add compatible for am6 for TI timer-dm Let's add compatible for ti,am654-timer for TI am64, am65 and j72 SoCs. As the timer hardware is the same between am64, am65 and j72 we use the compatible name for the earliest SoC with this timer. The timer interrupts are not routable for the operating system for some timers on am6. Let's make sure the interrupts are configured for the timers on all other SoCs. Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Nishanth Menon Cc: Vignesh Raghavendra Acked-by: Krzysztof Kozlowski Signed-off-by: Tony Lindgren Reviewed-by: Grygorii Strashko Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220414085807.7389-3-tony@atomide.com commit 82b9a6bb4b7a350619650b32e7d64ca945e0f234 Author: Tony Lindgren Date: Thu Apr 14 11:58:06 2022 +0300 dt-bindings: timer: Update TI timer to yaml Let's update the TI timer binding to use yaml. As this binding is specific to the TI dual-mode timers also known as dm-timers, let's use file name ti,timer-dm.yaml to avoid confusion with other timers. We add checks for the deprecated ti,hwmods property as done for other TI device driver bindings earlier. We also correct the issue with the old binding that was out of date for several properties. The am43 related timers are undocumented, but compatible with the am3 timers. Let's add the am43 timers too. The dm814 and dm816 timers are missing, let's add them. Some timers on some SoCs are dual mapped, like the ABE timers on omap4 and 5. The reg property maxItems must be updated to 2. The timer clocks can be managed by the parent interconnect target module with no clocks assigned for the timer node. And in some cases, the SoC may need to configure additional system clock for the timer in addition to the functional clock. The clock names are optional and not specific to the comptible property. For example, dra7 timers on l3 interconnect do not need clock-names, while the timers on dra7 l4 interconnect need them with both being compatible with ti,omap5430-timer. Cc: Daniel Lezcano Cc: Grygorii Strashko Cc: Keerthy Cc: Nishanth Menon Cc: Vignesh Raghavendra Signed-off-by: Tony Lindgren Reviewed-by: Krzysztof Kozlowski Reviewed-by: Grygorii Strashko Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220414085807.7389-2-tony@atomide.com commit 0f40ba48de3b8a4c5793013768cd62805033869c Author: Vinod Koul Date: Wed Apr 6 15:10:19 2022 +0530 drm/msm/dsi: Pass DSC params to drm_panel When DSC is enabled, we need to get the DSC parameters from the panel driver, so add a dsc parameter in panel to fetch and pass DSC configuration for DSI panels to DPU encoder, which will enable and then configure DSC hardware blocks accordingly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480910/ Link: https://lore.kernel.org/r/20220406094031.1027376-3-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit b9080324d6ca24eec9295d20547ba171dc61c97c Author: Vinod Koul Date: Wed Apr 6 15:10:18 2022 +0530 drm/msm/dsi: add support for dsc data Display Stream Compression (DSC) parameters need to be calculated. Add helpers and struct msm_display_dsc_config in msm_drv for this msm_display_dsc_config uses drm_dsc_config for DSC parameters. Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Signed-off-by: Vinod Koul Patchwork: https://patchwork.freedesktop.org/patch/480908/ Link: https://lore.kernel.org/r/20220406094031.1027376-2-vkoul@kernel.org Signed-off-by: Dmitry Baryshkov commit 757a2f36ab095fb257c8c13c06b172e0e2d87365 Author: Kuogee Hsieh Date: Fri Feb 25 13:23:12 2022 -0800 drm/msm/dp: enable widebus feature for display port Widebus feature will transmit two pixel data per pixel clock to interface. This feature now is required to be enabled to easy migrant to higher resolution applications in future. However since some legacy chipsets does not support this feature, this feature is enabled by setting wide_bus_en flag to true within msm_dp_desc struct. changes in v2: -- remove compression related code from timing -- remove op_info from struct msm_drm_private -- remove unnecessary wide_bus_en variables -- pass wide_bus_en into timing configuration by struct msm_dp Changes in v3: -- split patch into 3 patches -- enable widebus feature base on chip hardware revision Changes in v5: -- DP_INTF_CONFIG_DATABUS_WIDEN Changes in v6: -- static inline bool msm_dp_wide_bus_enable() in msm_drv.h Changes in v7: -- add Tested-by Changes in v9: -- add wide_bus_en to msm_dp_desc Changes in v10: -- add wide_bus_en boolean to dp_catalog struc to avoid passing it as parameter Changes in v11: -- add const to dp_catalog_hw_revision() -- add const to msm_dp_wide_bus_available() Changes in v12: -- dp_catalog_hw_revision(const struct dp_catalog *dp_catalog) -- msm_dp_wide_bus_available(const struct msm_dp *dp_display) Signed-off-by: Kuogee Hsieh Reported-by: kernel test robot Tested-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/476283/ Link: https://lore.kernel.org/r/1645824192-29670-5-git-send-email-quic_khsieh@quicinc.com [DB: fixed the compilation] Signed-off-by: Dmitry Baryshkov commit 3309a75639718c065369b99f283b87a73ac4d835 Author: Kuogee Hsieh Date: Fri Feb 25 13:23:11 2022 -0800 drm/msm/dpu: revise timing engine programming to support widebus feature Widebus feature will transmit two pixel data per pixel clock to interface. Timing engine provides driving force for this purpose. This patch base on HPG (Hardware Programming Guide) to revise timing engine register setting to accommodate both widebus and non widebus application. Also horizontal width parameters need to be reduced by half since two pixel data are clocked out per pixel clock when widebus feature enabled. Widebus can be enabled individually at DP. However at DSI, widebus have to be enabled along with DSC to achieve pixel clock rate be scaled down with same ratio as compression ratio when 10 bits per source component. Therefore this patch add no supports of DSI related widebus and compression. Changes in v2: -- remove compression related code from timing -- remove op_info from struct msm_drm_private -- remove unnecessary wide_bus_en variables -- pass wide_bus_en into timing configuration by struct msm_dp Changes in v3: -- split patch into 3 patches Changes in v4: -- rework timing engine to not interfere with dsi/hdmi -- cover both widebus and compression Changes in v5: -- remove supports of DSI widebus and compression Changes in v7: -- split this patch into 3 patches -- add Tested-by Changes in v8: -- move new registers writes under DATA_HCTL_EN features check. Changes in v10: -- add const inside dpu_encoder_is_widebus_enabled() -- drop useless parenthesis please Signed-off-by: Kuogee Hsieh Tested-by: Bjorn Andersson Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/476281/ Link: https://lore.kernel.org/r/1645824192-29670-4-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit d9d6c2c19f947493d1496f158a40f52c8c28daa0 Author: Kuogee Hsieh Date: Fri Feb 25 13:23:10 2022 -0800 drm/msm/dpu: replace BIT(x) with correspond marco define string To improve code readability, this patch replace BIT(x) with correspond register bit define string Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/476280/ Link: https://lore.kernel.org/r/1645824192-29670-3-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit e18aeea7f5efb9508722c8c7fd4d32e6f8cdfe50 Author: Kuogee Hsieh Date: Fri Feb 25 13:23:09 2022 -0800 drm/msm/dpu: adjust display_v_end for eDP and DP The “DP timing” requires the active region to be defined in the bottom-right corner of the frame dimensions which is different with DSI. Therefore both display_h_end and display_v_end need to be adjusted accordingly. However current implementation has only display_h_end adjusted. Signed-off-by: Kuogee Hsieh Fixes: fc3a69ec68d3 ("drm/msm/dpu: intf timing path for displayport") Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/476277/ Link: https://lore.kernel.org/r/1645824192-29670-2-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov commit 8e809dfb9b25a97cdbe2ef2bdcca998815457317 Author: Dmitry Baryshkov Date: Wed Apr 6 13:05:56 2022 +0300 drm/msm: remove unused plane_property field from msm_drm_private Remove unused field plane_property from struct msm_drm_private. Also drop the enum msm_mdp_plane_property which also becomes unused. Fixes: 7d36db0be3b9 ("drm/msm/mdp5: switch to standard zpos property") Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/480939/ Link: https://lore.kernel.org/r/20220406100556.479706-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 0054ac2c7e6c02cfd2f81554184ff9af4fe70818 Author: Dmitry Baryshkov Date: Wed Apr 6 13:12:47 2022 +0300 drm/msm: don't store created planes, connectors and encoders There is no point now in storing arrays of creates planes, connectors and encoders. Remove them from struct msm_drm_private. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/480945/ Link: https://lore.kernel.org/r/20220406101247.483649-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit fa560afaaed908c2ca5b289073b896d571a8ec60 Author: Dmitry Baryshkov Date: Wed Apr 6 13:12:46 2022 +0300 drm/msm: loop over encoders using drm_for_each_encoder() Rather than manually looping over encoders array, use standard drm_for_each_encoder() macro. Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/480942/ Link: https://lore.kernel.org/r/20220406101247.483649-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 745b51585a6c56b246cce3f3767dca7f31f93fe5 Author: Dmitry Baryshkov Date: Wed Apr 6 13:12:45 2022 +0300 drm/msm/dpu: remove manual destruction of DRM objects Remove manual removal of DRM modesetting objects, it is done anyway by the drm_mode_config_cleanup() called from msm_drm_uninit(). Other MSM display drivers (MDP4, MDP5) do not manually destroy objects and trust generic code to do it's work. Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/480943/ Link: https://lore.kernel.org/r/20220406101247.483649-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit d28ea556267c4f2ec7264ab49f1b1296834321ec Author: Dmitry Baryshkov Date: Tue Apr 12 02:49:53 2022 +0300 drm/msm: properly add and remove internal bridges Add calls to drm_bridge_add()/drm_bridge_remove() DRM bridges created by the driver. This fixes the following warning. WARNING: CPU: 0 PID: 1 at kernel/locking/mutex.c:579 __mutex_lock+0x840/0x9f4 DEBUG_LOCKS_WARN_ON(lock->magic != lock) Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.18.0-rc1-00002-g3054695a0d27-dirty #55 Hardware name: Generic DT based system unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x58/0x70 dump_stack_lvl from __warn+0xc8/0x1e8 __warn from warn_slowpath_fmt+0x78/0xa8 warn_slowpath_fmt from __mutex_lock+0x840/0x9f4 __mutex_lock from mutex_lock_nested+0x1c/0x24 mutex_lock_nested from drm_bridge_hpd_enable+0x2c/0x84 drm_bridge_hpd_enable from msm_hdmi_modeset_init+0xc0/0x21c msm_hdmi_modeset_init from mdp4_kms_init+0x53c/0x90c mdp4_kms_init from msm_drm_bind+0x514/0x698 msm_drm_bind from try_to_bring_up_aggregate_device+0x160/0x1bc try_to_bring_up_aggregate_device from component_master_add_with_match+0xc4/0xf8 component_master_add_with_match from msm_pdev_probe+0x274/0x350 msm_pdev_probe from platform_probe+0x5c/0xbc platform_probe from really_probe.part.0+0x9c/0x290 really_probe.part.0 from __driver_probe_device+0xa8/0x13c __driver_probe_device from driver_probe_device+0x34/0x10c driver_probe_device from __driver_attach+0xbc/0x178 __driver_attach from bus_for_each_dev+0x74/0xc0 bus_for_each_dev from bus_add_driver+0x160/0x1e4 bus_add_driver from driver_register+0x88/0x118 driver_register from do_one_initcall+0x6c/0x334 do_one_initcall from kernel_init_freeable+0x1bc/0x220 kernel_init_freeable from kernel_init+0x18/0x12c kernel_init from ret_from_fork+0x14/0x2c Fixes: 3d3f8b1f8b62 ("drm/bridge: make bridge registration independent of drm flow") Reported-by: kernel test robot Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/481778/ Link: https://lore.kernel.org/r/20220411234953.2425280-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 6874f48bb8b050b695698f1145e6846ba08baa75 Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:46 2022 +0300 drm/msm: make mdp5/dpu devices master components The msm_mdss serves several roles at this moment. It provides IRQ domain used by MDP5 and DPU drivers but it also serves as a component master for both those usecases. MDP4 (which does not have separate MDSS device) is the component master on it's own. Remove this assymmetry and make both MDP5 and DPU component masters too. This removes a need to care about drm/components from msm_mdss driver, removes an mdss pointer from struct msm_drm_private and simplifies the interface between mdp5/dpu and msm_drv. Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482512/ Link: https://lore.kernel.org/r/20220419155346.1272627-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit dc43e923cd1478fad5ec7a2bbb67dc3d00c24f84 Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:45 2022 +0300 drm/msm: allow compile time selection of driver components MSM DRM driver already allows one to compile out the DP or DSI support. Add support for disabling other features like MDP4/MDP5/DPU drivers or direct HDMI output support. Suggested-by: Stephen Boyd Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482508/ Link: https://lore.kernel.org/r/20220419155346.1272627-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 5d44531be0982db3d40f7779e105ec061d857247 Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:44 2022 +0300 drm/msm: stop using device's match data pointer Let's make the match's data pointer a (sub-)driver's private data. The only user currently is the msm_drm_init() function, using this data to select kms_init callback. Pass this callback through the driver's private data instead. Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482510/ Link: https://lore.kernel.org/r/20220419155346.1272627-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit ecb23f2e3009082bb0b74a1cb1d918f90dc35778 Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:43 2022 +0300 drm/msm: split the main platform driver Currently the msm platform driver is a multiplex handling several cases: - headless GPU-only driver, - MDP4 with flat device nodes, - MDP5/DPU MDSS with all the nodes being children of MDSS node. This results in not-so-perfect code, checking the hardware version (MDP4/MDP5/DPU) in several places, checking for mdss even when it can not exist, etc. Split the code into three handling subdrivers (mdp4, mdss and headless msm). Reviewed-by: Abhinav Kumar Reported-by: kernel test robot Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482507/ Link: https://lore.kernel.org/r/20220419155346.1272627-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit e1072257ff6544ac13e59d41d5fa1f2d3a98c63a Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:42 2022 +0300 drm/msm: remove extra indirection for msm_mdss Since now there is just one mdss subdriver, drop all the indirection, make msm_mdss struct completely opaque (and defined inside msm_mdss.c) and call mdss functions directly. Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482505/ Link: https://lore.kernel.org/r/20220419155346.1272627-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 87729e2a7871564ca219132fb658113d10a33180 Author: Dmitry Baryshkov Date: Tue Apr 19 18:53:41 2022 +0300 drm/msm: unify MDSS drivers MDP5 and DPU1 both provide the driver handling the MDSS region, which handles the irq domain and (incase of DPU1) adds some init for the UBWC controller. Unify those two pieces of code into a common driver. Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/482506/ Link: https://lore.kernel.org/r/20220419155346.1272627-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 246bdfa52f33ecfa52546ed67287de4eab165b2e Author: Dominique Martinet Date: Sun Apr 24 14:10:22 2022 +0900 bpftool, musl compat: Replace sys/fcntl.h by fcntl.h musl does not like including sys/fcntl.h directly: [...] 1 | #warning redirecting incorrect #include to [...] Signed-off-by: Dominique Martinet Signed-off-by: Daniel Borkmann Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220424051022.2619648-5-asmadeus@codewreck.org commit 93bc2e9e943d20a51473a49009db3243de6e098d Author: Dominique Martinet Date: Sun Apr 24 14:10:21 2022 +0900 bpftool, musl compat: Replace nftw with FTW_ACTIONRETVAL musl nftw implementation does not support FTW_ACTIONRETVAL. There have been multiple attempts at pushing the feature in musl upstream, but it has been refused or ignored all the times: https://www.openwall.com/lists/musl/2021/03/26/1 https://www.openwall.com/lists/musl/2022/01/22/1 In this case we only care about /proc//fd/, so it's not too difficult to reimplement directly instead, and the new implementation makes 'bpftool perf' slightly faster because it doesn't needlessly stat/readdir unneeded directories (54ms -> 13ms on my machine). Signed-off-by: Dominique Martinet Signed-off-by: Daniel Borkmann Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220424051022.2619648-4-asmadeus@codewreck.org commit 9151ad5d8676a89cf1b6a4051037ab3ca077d938 Author: David Sloan Date: Thu Apr 21 13:45:58 2022 -0600 md: Replace role magic numbers with defined constants There are several instances where magic numbers are used in md.c instead of the defined constants in md_p.h. This patch set improves code readability by replacing all occurrences of 0xffff, 0xfffe, and 0xfffd when relating to md roles with their equivalent defined constant. Signed-off-by: David Sloan Reviewed-by: Logan Gunthorpe Signed-off-by: Song Liu commit 170d1c23f2a356932259034f73d579d0bab857d6 Author: Reinette Chatre Date: Mon Apr 25 14:01:14 2022 -0700 selftests/x86/corrupt_xstate_header: Use provided __cpuid_count() macro kselftest.h makes the __cpuid_count() macro available to conveniently call the CPUID instruction. Remove the local CPUID wrapper and use __cpuid_count() from kselftest.h instead. __cpuid_count() from kselftest.h is used instead of the macro provided by the compiler since gcc v4.4 (via cpuid.h) because the selftest needs to be supported with gcc v3.2, the minimal required version for stable kernels. Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: x86@kernel.org Signed-off-by: Reinette Chatre Signed-off-by: Shuah Khan commit 2ba8a7abb5ef402d94830bcf599f645852eb0153 Author: Reinette Chatre Date: Mon Apr 25 14:01:13 2022 -0700 selftests/x86/amx: Use provided __cpuid_count() macro kselftest.h makes the __cpuid_count() macro available to conveniently call the CPUID instruction. Remove the local CPUID wrapper and use __cpuid_count() from kselftest.h instead. __cpuid_count() from kselftest.h is used instead of the macro provided by the compiler since gcc v4.4 (via cpuid.h) because the selftest needs to be supported with gcc v3.2, the minimal required version for stable kernels. Cc: Chang S. Bae Cc: Dave Hansen Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Signed-off-by: Reinette Chatre Signed-off-by: Shuah Khan commit 0dba8dae6b0489c7ea5722273f3b2d70fd9756c5 Author: Reinette Chatre Date: Mon Apr 25 14:01:12 2022 -0700 selftests/vm/pkeys: Use provided __cpuid_count() macro kselftest.h makes the __cpuid_count() macro available to conveniently call the CPUID instruction. Remove the local CPUID wrapper and use __cpuid_count() from already included kselftest.h instead. __cpuid_count() from kselftest.h is used instead of the macro provided by the compiler since gcc v4.4 (via cpuid.h) because the selftest needs to be compiled with gcc v3.2, the minimal required version for stable kernels. Cc: Dave Hansen Cc: Sandipan Das Cc: Florian Weimer Cc: "Desnes A. Nunes do Rosario" Cc: Ingo Molnar Cc: Thiago Jung Bauermann Cc: Michael Ellerman Cc: Michal Suchanek Cc: linux-mm@kvack.org Signed-off-by: Reinette Chatre Signed-off-by: Shuah Khan commit a23039c7306f53416ba35d230201398ea34f4640 Author: Reinette Chatre Date: Mon Apr 25 14:01:11 2022 -0700 selftests: Provide local define of __cpuid_count() Some selftests depend on information provided by the CPUID instruction. To support this dependency the selftests implement private wrappers for CPUID. Duplication of the CPUID wrappers should be avoided. Both gcc and clang/LLVM provide __cpuid_count() macros but neither the macro nor its header file are available in all the compiler versions that need to be supported by the selftests. __cpuid_count() as provided by gcc is available starting with gcc v4.4, so it is not available if the latest tests need to be run in all the environments required to support kernels v4.9 and v4.14 that have the minimal required gcc v3.2. Duplicate gcc's __cpuid_count() macro to provide a centrally defined macro for __cpuid_count() to help eliminate the duplicate CPUID wrappers while continuing to compile in older environments. Suggested-by: Shuah Khan Signed-off-by: Reinette Chatre Signed-off-by: Shuah Khan commit 398bb283899b831bea45d639d0d4e0190c9ca305 Author: Aric Cyr Date: Mon Apr 18 01:12:10 2022 -0400 drm/amd/display: 3.2.183 This version brings along following fixes: - Keep tracking of DSC packed PPS for future use - Maintain current link settings in link loss interrupt - Remove DDC write and read size check - Read PSR-SU cap DPCD for specific panel - Don't pass HostVM by default on DCN3.1 - Reset cached PSR parameters after hibernate - Add audio readback registers - Update dcn315 clk table read Acked-by: Tom Chung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9844792ec8adcf140036d6d539a7a708865cb8d3 Author: Ilya Bakoulin Date: Mon Mar 14 17:59:01 2022 -0400 drm/amd/display: Keep track of DSC packed PPS [Why] Store current packed PPS data in dc_stream_state for future use. Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3c54074504076dc6eee89ed44d69dbf03c7af66d Author: Dillon Varone Date: Wed Apr 13 17:54:19 2022 -0400 drm/amd/display: Remove unused integer Integer no longer needed. Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9fbfeaf110714dd6176e209230569c2dd9a9ad08 Author: Gary Li Date: Thu Apr 14 09:01:48 2022 -0400 drm/amd/display: Maintain current link settings in link loss interrupt [Why] DP compliance test case 400.3.2.3 is failed because in link loss interrupt the current link settings is not used in the DP link training. [How] In link loss interrupt, use the current link settings in the following DP link training. Reviewed-by: Wenjing Liu Acked-by: Tom Chung Signed-off-by: Gary Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e953cd08d78256764721e459ce11f9d41e8934f9 Author: Leo Ma Date: Wed Mar 23 12:00:53 2022 -0400 drm/amd/display: Remove ddc write and read size checking [Why] Customer found I2C over AUX using ADL_Display_DDCBlockAccess_Get will fail when sending more than 256 bytes of data; [How] Remove the write and read size checking to allow sending data more than 256 bytes; Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Leo Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d9f442e9a20c20333ef9b2341d7c74c9783d30b4 Author: David Zhang Date: Mon Apr 11 16:04:39 2022 -0400 drm/amd/display: read PSR-SU cap DPCD for specific panel [why & how] For some specific eDP panel, we'd check the PSR-SU cap during boot by reading the vendor specific DPCD, otherwise it will cause to false report the eDP panel which supports PSR-SU as an non-PSR-SU panel. - add the vendor specific DPCD address in ddc_service_types header - if specific eDP panel detected, check vendor specific DPCD for PSR-SU cap Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Tom Chung Signed-off-by: David Zhang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4a0caac06a4c587e56d89bd2fabfc0d33eb4fcb9 Author: Michael Strauss Date: Tue Apr 5 15:56:04 2022 -0400 drm/amd/display: Don't pass HostVM by default on DCN3.1 [WHY] Roll back previous change to stop passing this value by default, instead add a debug flag to override to previous behaviour (or force HostVM calcs) Reviewed-by: Nicholas Kazlauskas Acked-by: Tom Chung Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d2069326d26c7de78e77a060fb6e6d0d21c35dbd Author: Evgenii Krasnikov Date: Tue Apr 5 10:59:27 2022 -0400 drm/amd/display: Reset cached PSR parameters after hibernate [WHY] After hibernate system might be using old invalid psr_power_opt and psr_allow_active that never get reset [HOW] Reset cached Panel Self Refresh parameters when PSR is first configured for eDP in dc_link_setup_psr. Reviewed-by: Harry Vanzylldejong Acked-by: Tom Chung Signed-off-by: Evgenii Krasnikov Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e955b5473294367c42e18faac9ab3348f3c8861c Author: Ilya Bakoulin Date: Mon Mar 28 17:43:52 2022 -0400 drm/amd/display: Add Audio readback registers [Why] Can be useful for verifying the correctness of audio output. Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 89c342a9661838b9afe3988418705f877f496928 Author: Dmytro Laktyushkin Date: Fri Apr 8 10:10:04 2022 -0400 drm/amd/display: update dcn315 clk table read Clean up the sequence by making sure clk_mgr always builds a reasonable clock table regardless of what we read from smu by moving all defaults from resource soc struct to clk_mgr. Now the only thing resource soc update does is read the clock table and apply any DC specific policy decisions to how clocks are populated in dml soc. Reviewed-by: Qingqing Zhuo Acked-by: Tom Chung Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 259f249c4b9b2a9dc15095afd071bcc5b8d6f30e Author: Aric Cyr Date: Sun Apr 10 21:53:26 2022 -0400 drm/amd/display: 3.2.182 This version brings along following improvements: - Fix HDCP QUERY Error for eDP and Tiled - Insert smu busy status before sending another request Acked-by: Tom Chung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 84ebd73e3281f7f2d7f637c8f28c63ab8754b3f2 Author: Mustapha Ghaddar Date: Thu Apr 7 09:29:16 2022 -0400 drm/amd/display: Fix HDCP QUERY Error for eDP and Tiled [WHY] For dio_output_encoder ID we are relying on SW concept which is invisible to HW [HOW] Needed to create separate cases for when DPIA and non DPIA for dio link encoder ID Reviewed-by: Wenjing Liu Reviewed-by: James Zhang Acked-by: Tom Chung Signed-off-by: Mustapha Ghaddar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 721af39f003668a86650a640b41439b7c145c52e Author: Oliver Logush Date: Fri Apr 1 10:40:30 2022 -0400 drm/amd/display: Insert smu busy status before sending another request [why] Need to check if result register is busy before sending another request [how] Call method to check if result register is busy Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Oliver Logush Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c3eb12dff0f9c6aa7f2916edaaec5545af5f379f Author: Felix Kuehling Date: Thu Apr 7 18:53:56 2022 -0400 drm/amdkfd: Ignore bogus signals from MEC efficiently MEC firmware sometimes sends signal interrupts without a valid context ID on end of pipe events that don't intend to signal any HSA signals. This triggers the slow path in kfd_signal_event_interrupt that scans the entire event page for signaled events. Detect these signals in the top half interrupt handler to stop processing them as early as possible. Because we now always treat event ID 0 as invalid, reserve that ID during process initialization. v2: Update firmware version checks to support more GPUs Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit b3ef3205bc5e5d5a91f7ef53306686967c76492b Author: Haowen Bai Date: Fri Apr 22 14:03:57 2022 +0800 drm/amdgpu: Remove useless kfree After alloc fail, we do not need to kfree. Signed-off-by: Haowen Bai Signed-off-by: Alex Deucher commit a467257ffe4bdb13eacddec0137013f6a1140b81 Author: yingelin Date: Sun Apr 24 10:57:40 2022 +0800 kernel/kexec_core: move kexec_core sysctls into its own file This move the kernel/kexec_core.c respective sysctls to its own file. kernel/sysctl.c has grown to an insane mess, We move sysctls to places where features actually belong to improve the readability and reduce merge conflicts. At the same time, the proc-sysctl maintainers can easily care about the core logic other than the sysctl knobs added for some feature. We already moved all filesystem sysctls out. This patch is part of the effort to move kexec related sysctls out. Signed-off-by: yingelin Acked-by: Baoquan He Signed-off-by: Luis Chamberlain commit ea23994edc4169bd90d7a9b5908c6ccefd82fa40 Author: Pascal Hambourg Date: Wed Apr 13 08:53:56 2022 +0200 md/raid0: Ignore RAID0 layout if the second zone has only one device The RAID0 layout is irrelevant if all members have the same size so the array has only one zone. It is *also* irrelevant if the array has two zones and the second zone has only one device, for example if the array has two members of different sizes. So in that case it makes sense to allow assembly even when the layout is undefined, like what is done when the array has only one zone. Reviewed-by: NeilBrown Signed-off-by: Pascal Hambourg Signed-off-by: Song Liu commit 4631f39f058b98bfa3fd1d6ffb491fa9e70e3e81 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:13 2022 -0600 md/raid5: Annotate functions that hold device_lock with __must_hold A handful of functions note the device_lock must be held with a comment but this is not comprehensive. Many other functions hold the lock when taken so add an __must_hold() to each call to annotate when the lock is held. This makes it a bit easier to analyse device_lock. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit 4f4ee2bf32860e4aa3b07be3fc9224fbe6cce4fe Author: Logan Gunthorpe Date: Thu Apr 7 10:57:12 2022 -0600 md/raid5-ppl: Annotate with rcu_dereference_protected() To suppress the last remaining sparse warnings about accessing rdev, add rcu_dereference_protected calls to a couple places in raid5-ppl. All of these places are called under raid5_run and therefore are occurring before the array has started and is thus safe. There's no sensible check to do for the second argument of rcu_dereference_protected() so a comment is added instead. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit 9aeb7f99a134391e19ffad926cfb6a60d72139b4 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:11 2022 -0600 md/raid5: Annotate rdev/replacement access when mddev_lock is held The mddev_lock should be held during raid5_remove_disk() which is when the rdev/replacement pointers are modified. So any access to these pointers marked __rcu should be safe whenever the mddev_lock is held. There are numerous such access that currently produce sparse warnings. Add a helper function, rdev_mdlock_deref() that wraps rcu_dereference_protected() in all these instances. This annotation fixes a number of sparse warnings. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit e38b0432550507a78d63c8da094e5f50820bdf92 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:10 2022 -0600 md/raid5: Annotate rdev/replacement accesses when nr_pending is elevated There are a number of accesses to __rcu variables that should be safe because nr_pending in the disk is known to be elevated. Create a wrapper around rcu_dereference_protected() to annotate these accesses and verify that nr_pending is non-zero. This fixes a number of sparse warnings. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit b0920ede081b3f1659872f80ce552305610675a6 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:09 2022 -0600 md/raid5: Add __rcu annotation to struct disk_info rdev and replacement are protected in some circumstances with rcu_dereference and synchronize_rcu (in raid5_remove_disk()). However, they were not annotated with __rcu so a sparse warning is emitted for every rcu_dereference() call. Add the __rcu annotation and fix up the initialization with RCU_INIT_POINTER, all pointer modifications with rcu_assign_pointer(), a few cases where the pointer value is tested with rcu_access_pointer() and one case where READ_ONCE() is used instead of rcu_dereference(), a case in print_raid5_conf() that should have rcu_dereference() and rcu_read_[un]lock() calls. Additional sparse issues will be fixed up in further commits. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit 3d9a644cf45c26ad1d0ceff0af8c9e9860677729 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:08 2022 -0600 md/raid5: Un-nest struct raid5_percpu definition Sparse reports many warnings of the form: drivers/md/raid5.c:1476:16: warning: dereference of noderef expression This is because all struct raid5_percpu definitions get marked as __percpu when really only the pointer in r5conf should have that annotation. Fix this by moving the defnition of raid5_precpu out of the definition of struct r5conf. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit 8fbcba6b999beb9fd0b95cd2efe00a1215e36406 Author: Logan Gunthorpe Date: Thu Apr 7 10:57:07 2022 -0600 md/raid5: Cleanup setup_conf() error returns Be more careful about the error returns. Most errors in this function are actually ENOMEM, but it forcibly returns EIO if conf has been allocated. Instead return ret and ensure it is set appropriately before each goto abort. Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu commit 92d9aac92b7cc92c770e736c70c3acae7b803278 Author: Heming Zhao Date: Fri Apr 1 10:13:17 2022 +0800 md: replace deprecated strlcpy & remove duplicated line This commit includes two topics: 1> replace deprecated strlcpy change strlcpy to strscpy for strlcpy is marked as deprecated in Documentation/process/deprecated.rst 2> remove duplicated strlcpy line in md_bitmap_read_sb@md-bitmap.c there are two duplicated strlcpy(), the history: - commit cf921cc19cf7 ("Add node recovery callbacks") introduced the first usage of strlcpy(). - commit b97e92574c0b ("Use separate bitmaps for each nodes in the cluster") introduced the second strlcpy(). this time, the two strlcpy() are same, we can remove anyone safely. - commit d3b178adb3a3 ("md: Skip cluster setup for dm-raid") added dm-raid special handling. And the "nodes" value is the key of this patch. but from this patch, strlcpy() which was introduced by b97e92574c0bf become necessary. - commit 3c462c880b52 ("md: Increment version for clustered bitmaps") used clustered major version to only handle in clustered env. this patch could look a polishment for clustered code logic. So cf921cc19cf7 became useless after d3b178adb3a3a, we could remove it safely. Signed-off-by: Heming Zhao Signed-off-by: Song Liu commit e68cb83a57a458b01c9739e2ad9cb70b04d1e6d2 Author: Heming Zhao Date: Fri Apr 1 10:13:16 2022 +0800 md/bitmap: don't set sb values if can't pass sanity check If bitmap area contains invalid data, kernel will crash then mdadm triggers "Segmentation fault". This is cluster-md speical bug. In non-clustered env, mdadm will handle broken metadata case. In clustered array, only kernel space handles bitmap slot info. But even this bug only happened in clustered env, current sanity check is wrong, the code should be changed. How to trigger: (faulty injection) dd if=/dev/zero bs=1M count=1 oflag=direct of=/dev/sda dd if=/dev/zero bs=1M count=1 oflag=direct of=/dev/sdb mdadm -C /dev/md0 -b clustered -e 1.2 -n 2 -l mirror /dev/sda /dev/sdb mdadm -Ss echo aaa > magic.txt == below modifying slot 2 bitmap data == dd if=magic.txt of=/dev/sda seek=16384 bs=1 count=3 <== destroy magic dd if=/dev/zero of=/dev/sda seek=16436 bs=1 count=4 <== ZERO chunksize mdadm -A /dev/md0 /dev/sda /dev/sdb == kernel crashes. mdadm outputs "Segmentation fault" == Reason of kernel crash: In md_bitmap_read_sb (called by md_bitmap_create), bad bitmap magic didn't block chunksize assignment, and zero value made DIV_ROUND_UP_SECTOR_T() trigger "divide error". Crash log: kernel: md: md0 stopped. kernel: md/raid1:md0: not clean -- starting background reconstruction kernel: md/raid1:md0: active with 2 out of 2 mirrors kernel: dlm: ... ... kernel: md-cluster: Joined cluster 44810aba-38bb-e6b8-daca-bc97a0b254aa slot 1 kernel: md0: invalid bitmap file superblock: bad magic kernel: md_bitmap_copy_from_slot can't get bitmap from slot 2 kernel: md-cluster: Could not gather bitmaps from slot 2 kernel: divide error: 0000 [#1] SMP NOPTI kernel: CPU: 0 PID: 1603 Comm: mdadm Not tainted 5.14.6-1-default kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) kernel: RIP: 0010:md_bitmap_create+0x1d1/0x850 [md_mod] kernel: RSP: 0018:ffffc22ac0843ba0 EFLAGS: 00010246 kernel: ... ... kernel: Call Trace: kernel: ? dlm_lock_sync+0xd0/0xd0 [md_cluster 77fe..7a0] kernel: md_bitmap_copy_from_slot+0x2c/0x290 [md_mod 24ea..d3a] kernel: load_bitmaps+0xec/0x210 [md_cluster 77fe..7a0] kernel: md_bitmap_load+0x81/0x1e0 [md_mod 24ea..d3a] kernel: do_md_run+0x30/0x100 [md_mod 24ea..d3a] kernel: md_ioctl+0x1290/0x15a0 [md_mod 24ea....d3a] kernel: ? mddev_unlock+0xaa/0x130 [md_mod 24ea..d3a] kernel: ? blkdev_ioctl+0xb1/0x2b0 kernel: block_ioctl+0x3b/0x40 kernel: __x64_sys_ioctl+0x7f/0xb0 kernel: do_syscall_64+0x59/0x80 kernel: ? exit_to_user_mode_prepare+0x1ab/0x230 kernel: ? syscall_exit_to_user_mode+0x18/0x40 kernel: ? do_syscall_64+0x69/0x80 kernel: entry_SYSCALL_64_after_hwframe+0x44/0xae kernel: RIP: 0033:0x7f4a15fa722b kernel: ... ... kernel: ---[ end trace 8afa7612f559c868 ]--- kernel: RIP: 0010:md_bitmap_create+0x1d1/0x850 [md_mod] Reported-by: kernel test robot Reported-by: Dan Carpenter Acked-by: Guoqing Jiang Signed-off-by: Heming Zhao Signed-off-by: Song Liu commit 64c54d9244a4efe9bc6e9c98e13c4bbb8bb39083 Author: Xiaomeng Tong Date: Fri Apr 8 16:47:15 2022 +0800 md: fix an incorrect NULL check in md_reload_sb The bug is here: if (!rdev || rdev->desc_nr != nr) { The list iterator value 'rdev' will *always* be set and non-NULL by rdev_for_each_rcu(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element found (In fact, it will be a bogus pointer to an invalid struct object containing the HEAD). Otherwise it will bypass the check and lead to invalid memory access passing the check. To fix the bug, use a new variable 'iter' as the list iterator, while using the original variable 'pdev' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: 70bcecdb1534 ("md-cluster: Improve md_reload_sb to be less error prone") Signed-off-by: Xiaomeng Tong Signed-off-by: Song Liu commit fc8738343eefc4ea8afb6122826dea48eacde514 Author: Xiaomeng Tong Date: Fri Apr 8 16:37:28 2022 +0800 md: fix an incorrect NULL check in does_sb_need_changing The bug is here: if (!rdev) The list iterator value 'rdev' will *always* be set and non-NULL by rdev_for_each(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element found. Otherwise it will bypass the NULL check and lead to invalid memory access passing the check. To fix the bug, use a new variable 'iter' as the list iterator, while using the original variable 'rdev' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: 2aa82191ac36 ("md-cluster: Perform a lazy update") Acked-by: Guoqing Jiang Signed-off-by: Xiaomeng Tong Acked-by: Goldwyn Rodrigues Signed-off-by: Song Liu commit 57668f0a4cc4083a120cc8c517ca0055c4543b59 Author: Mariusz Tkaczyk Date: Tue Mar 22 16:23:39 2022 +0100 raid5: introduce MD_BROKEN Raid456 module had allowed to achieve failed state. It was fixed by fb73b357fb9 ("raid5: block failing device if raid will be failed"). This fix introduces a bug, now if raid5 fails during IO, it may result with a hung task without completion. Faulty flag on the device is necessary to process all requests and is checked many times, mainly in analyze_stripe(). Allow to set faulty on drive again and set MD_BROKEN if raid is failed. As a result, this level is allowed to achieve failed state again, but communication with userspace (via -EBUSY status) will be preserved. This restores possibility to fail array via #mdadm --set-faulty command and will be fixed by additional verification on mdadm side. Reproduction steps: mdadm -CR imsm -e imsm -n 3 /dev/nvme[0-2]n1 mdadm -CR r5 -e imsm -l5 -n3 /dev/nvme[0-2]n1 --assume-clean mkfs.xfs /dev/md126 -f mount /dev/md126 /mnt/root/ fio --filename=/mnt/root/file --size=5GB --direct=1 --rw=randrw --bs=64k --ioengine=libaio --iodepth=64 --runtime=240 --numjobs=4 --time_based --group_reporting --name=throughput-test-job --eta-newline=1 & echo 1 > /sys/block/nvme2n1/device/device/remove echo 1 > /sys/block/nvme1n1/device/device/remove [ 1475.787779] Call Trace: [ 1475.793111] __schedule+0x2a6/0x700 [ 1475.799460] schedule+0x38/0xa0 [ 1475.805454] raid5_get_active_stripe+0x469/0x5f0 [raid456] [ 1475.813856] ? finish_wait+0x80/0x80 [ 1475.820332] raid5_make_request+0x180/0xb40 [raid456] [ 1475.828281] ? finish_wait+0x80/0x80 [ 1475.834727] ? finish_wait+0x80/0x80 [ 1475.841127] ? finish_wait+0x80/0x80 [ 1475.847480] md_handle_request+0x119/0x190 [ 1475.854390] md_make_request+0x8a/0x190 [ 1475.861041] generic_make_request+0xcf/0x310 [ 1475.868145] submit_bio+0x3c/0x160 [ 1475.874355] iomap_dio_submit_bio.isra.20+0x51/0x60 [ 1475.882070] iomap_dio_bio_actor+0x175/0x390 [ 1475.889149] iomap_apply+0xff/0x310 [ 1475.895447] ? iomap_dio_bio_actor+0x390/0x390 [ 1475.902736] ? iomap_dio_bio_actor+0x390/0x390 [ 1475.909974] iomap_dio_rw+0x2f2/0x490 [ 1475.916415] ? iomap_dio_bio_actor+0x390/0x390 [ 1475.923680] ? atime_needs_update+0x77/0xe0 [ 1475.930674] ? xfs_file_dio_aio_read+0x6b/0xe0 [xfs] [ 1475.938455] xfs_file_dio_aio_read+0x6b/0xe0 [xfs] [ 1475.946084] xfs_file_read_iter+0xba/0xd0 [xfs] [ 1475.953403] aio_read+0xd5/0x180 [ 1475.959395] ? _cond_resched+0x15/0x30 [ 1475.965907] io_submit_one+0x20b/0x3c0 [ 1475.972398] __x64_sys_io_submit+0xa2/0x180 [ 1475.979335] ? do_io_getevents+0x7c/0xc0 [ 1475.986009] do_syscall_64+0x5b/0x1a0 [ 1475.992419] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 1476.000255] RIP: 0033:0x7f11fc27978d [ 1476.006631] Code: Bad RIP value. [ 1476.073251] INFO: task fio:3877 blocked for more than 120 seconds. Cc: stable@vger.kernel.org Fixes: fb73b357fb9 ("raid5: block failing device if raid will be failed") Reviewd-by: Xiao Ni Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu commit 9631abdbf406c764f2a5d8305eac063bc3396a0a Author: Mariusz Tkaczyk Date: Tue Mar 22 16:23:38 2022 +0100 md: Set MD_BROKEN for RAID1 and RAID10 There is no direct mechanism to determine raid failure outside personality. It is done by checking rdev->flags after executing md_error(). If "faulty" flag is not set then -EBUSY is returned to userspace. -EBUSY means that array will be failed after drive removal. Mdadm has special routine to handle the array failure and it is executed if -EBUSY is returned by md. There are at least two known reasons to not consider this mechanism as correct: 1. drive can be removed even if array will be failed[1]. 2. -EBUSY seems to be wrong status. Array is not busy, but removal process cannot proceed safe. -EBUSY expectation cannot be removed without breaking compatibility with userspace. In this patch first issue is resolved by adding support for MD_BROKEN flag for RAID1 and RAID10. Support for RAID456 is added in next commit. The idea is to set the MD_BROKEN if we are sure that raid is in failed state now. This is done in each error_handler(). In md_error() MD_BROKEN flag is checked. If is set, then -EBUSY is returned to userspace. As in previous commit, it causes that #mdadm --set-faulty is able to fail array. Previously proposed workaround is valid if optional functionality[1] is disabled. [1] commit 9a567843f7ce("md: allow last device to be forcibly removed from RAID1/RAID10.") Reviewd-by: Xiao Ni Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu commit f14eb061fe89de0a090837c28ea15a79403730ee Author: Biju Das Date: Mon Apr 25 15:18:28 2022 +0100 dt-bindings: timer: renesas: ostm: Document Renesas RZ/G2UL OSTM Document the General Timer Module(a.k.a OSTM) found on the RZ/G2UL SoC. OSTM module is identical to one found RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,ostm" will be used as a fallback. Signed-off-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220425141828.197321-1-biju.das.jz@bp.renesas.com commit ac6583f56f548b0d83ae78e73a090af4b027b4e9 Author: Michael Walle Date: Mon Apr 25 16:04:33 2022 +0200 dt-bindings: fsl: convert fsl,layerscape-dcfg to YAML Convert the fsl,layerscape-dcfg binding to the new YAML format. In the device trees, the device node always have a "syscon" compatible, which wasn't mentioned in the previous binding. One thing added here, compared to the original binding is the clock controller subnode of the LS1028A SoC and its "simple-mfd" compatible as used in arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi as well as the little-endian and big-endian properties. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220425140433.33936-1-michael@walle.cc commit db92a6eb8349c42b3d195ef7686bda5fdd98290e Author: Biju Das Date: Mon Apr 25 14:31:52 2022 +0100 dt-bindings: i2c: renesas,riic: Document RZ/G2UL SoC Document RZ/G2UL I2C bindings. RZ/G2UL I2C is identical to one found on the RZ/G2L SoC. No driver changes are required as RZ/G2L compatible string "renesas,riic-rz" will be used as a fallback. Signed-off-by: Biju Das Acked-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220425133152.176949-1-biju.das.jz@bp.renesas.com commit 74de379201cdede5a49ebc5b1b069e227a2217c9 Author: Linus Walleij Date: Mon Apr 25 15:29:47 2022 +0200 dt-bindings: gnss: Rewrite Mediatek bindings in YAML This rewrites the Mediatek GNSS bindings in YAML. Cc: devicetree@vger.kernel.org Cc: Krzysztof Kozlowski Signed-off-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220425132947.1311171-1-linus.walleij@linaro.org commit fb0b54909b153ac6195378fa8ddee3f7531f8e51 Author: Sergey Matyukevich Date: Thu Apr 14 11:17:23 2022 +0300 ARC: implement syscall tracepoints Implement all the bits required to support HAVE_SYSCALL_TRACEPOINTS according to Documentation/trace/ftrace-design.rst. Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta commit b3bbf6a70ba0f827938525e285cd2be6c76a6a00 Author: Sergey Matyukevich Date: Thu Apr 14 11:17:21 2022 +0300 ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature Enable HAVE_REGS_AND_STACK_ACCESS_API feature for ARC architecture, including ARCcompact and ARCv2 flavors. Add supporting functions and defines. Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta commit acd0b04ecc795e97b7878dccc5cb4d3d627a4c27 Author: Vasily Averin Date: Sun Apr 24 21:28:54 2022 +0300 sysctl: minor cleanup in new_dir() Byte zeroing is not required here, since memory was allocated by kzalloc() Signed-off-by: Vasily Averin Signed-off-by: Luis Chamberlain commit 678f0cdc572c5fda940cb038d70eebb8d818adc8 Author: Yuanchu Xie Date: Mon Apr 18 20:20:17 2022 +0000 selftests/damon: add damon to selftests root Makefile Currently the damon selftests are not built with the rest of the selftests. We add damon to the list of targets. Fixes: b348eb7abd09 ("mm/damon: add user space selftests") Reviewed-by: SeongJae Park Signed-off-by: Yuanchu Xie Acked-by: David Rientjes Signed-off-by: Shuah Khan commit 6d9d19af3e34121a816757b4fae341a4d749e1a7 Author: Jon Hunter Date: Wed Apr 6 16:26:55 2022 +0100 arm64: tegra: Update PWM fan node name According to the device-tree binding document for PWM fans [0], the PWM fan node name should be 'pwm-fan'. Update the PWM fan node name to align with this. [0] Documentation/devicetree/bindings/hwmon/pwm-fan.txt Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 5b4018b959149eb5b5f3004fc0339674af67516b Author: Jens Wiklander Date: Tue Jan 25 21:26:42 2022 +0100 optee: cache argument shared memory structs Implements a cache to handle shared memory used to pass the argument struct needed when doing a normal yielding call into secure world. Signed-off-by: Jens Wiklander commit cc271ab86606c963e97915d84be34ae4bd067578 Author: Tetsuo Handa Date: Fri Apr 22 12:01:24 2022 +0900 wwan_hwsim: Avoid flush_scheduled_work() usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_wq with local wwan_wq. While we are at it, make err_clean_devs: label of wwan_hwsim_init() behave like wwan_hwsim_exit(), for it is theoretically possible to call wwan_hwsim_debugfs_devcreate_write()/wwan_hwsim_debugfs_devdestroy_write() by the moment wwan_hwsim_init_devs() returns. Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Reviewed-by: Sergey Ryazanov Reviewed-by: Loic Poulain Link: https://lore.kernel.org/r/7390d51f-60e2-3cee-5277-b819a55ceabe@I-love.SAKURA.ne.jp Signed-off-by: Jakub Kicinski commit ff815a89398d8bbfdc14ced98252bdae92126225 Author: Tetsuo Handa Date: Wed Apr 20 07:18:57 2022 +0900 RDMA/core: Avoid flush_workqueue(system_unbound_wq) usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_unbound_wq with local ib_unreg_wq. Link: https://lore.kernel.org/r/252cefb0-a400-83f6-2032-333d69f52c1b@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Signed-off-by: Jason Gunthorpe commit e471e5942c006532a013eefde239ce1e783ac2d9 Author: Dave Kleikamp Date: Mon Apr 25 13:48:28 2022 -0500 fs/jfs: Remove dead code Since the JFS code was first added to Linux, there has been code hidden in ifdefs for some potential future features such as defragmentation and supporting block sizes other than 4KB. There has been no ongoing development on JFS for many years, so it's past time to remove this dead code from the source. Signed-off-by: Dave Kleikamp commit fae74fb5d525f979085b6e70b883d7a7049bf15f Author: Uwe Kleine-König Date: Mon Apr 25 19:32:55 2022 +0200 gpio: pcf857x: Make teardown callback return void All teardown functions return 0. Also there is little sense in returning a negative error code from an i2c remove function as this only results in emitting an error message but the device is removed nevertheless. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Bartosz Golaszewski commit c83227a5d05ed77b634ce4c2fc5f143ae2a4d6f5 Author: Linus Walleij Date: Thu Apr 21 22:06:54 2022 +0200 irq/gpio: ixp4xx: Drop boardfile probe path The boardfiles for IXP4xx have been deleted. Delete all the quirks and code dealing with that boot path and rely solely on device tree boot. Fix some missing static keywords that the kernel test robot was complaining about while we're at it. Cc: Bartosz Golaszewski Acked-by: Marc Zyngier Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 510ce586320dafc4eebfcb4472a0f972e6c35ada Author: Miquel Raynal Date: Thu Apr 7 12:09:03 2022 +0200 net: ieee802154: ca8210: Call _xmit_error() when a transmission fails ieee802154_xmit_error() is the right helper to call when a transmission has failed. Let's use it instead of open-coding it. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-11-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit ab191c1cff9cd77ca14ac888795029422669b4e1 Author: Miquel Raynal Date: Thu Apr 7 12:09:02 2022 +0200 net: ieee802154: ca8210: Use core return codes instead of hardcoding them All the error codes defined in this driver are generic and already defined in the ieee802154 main header. Let's just get rid of these extra definition and switch to the core's values. There is no functional change. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-10-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 35f34ee102a5b2376f4b4700ac017b8f2770e754 Author: Miquel Raynal Date: Thu Apr 7 12:09:01 2022 +0200 net: ieee802154: atusb: Call _xmit_hw_error() upon transmission error ieee802154_xmit_hw_error() is the right helper to call when a transmission has failed for a non-determined (and probably not IEEE802.15.4 specific) reason. Let's use this helper instead of open-coding it. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-9-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 6ec9630b1abe7622da75fd6559e3e9468655b96b Author: Miquel Raynal Date: Thu Apr 7 12:09:00 2022 +0200 net: ieee802154: at86rf230: Forward Tx trac errors Commit 493bc90a9683 ("at86rf230: add debugfs support") brought trac support as part of a debugfs feature, in order to add some testing capabilities involving ack handling. As we want to collect trac errors but do not need the debugfs feature anymore, let's partially revert this commit, keeping the Tx trac handling part which still makes sense. This allows to always return the trac error directly to the core with the recently introduced ieee802154_xmit_error() helper. Suggested-by: Alexander Aring Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-8-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 2b1c9dbf047b57f1df988d90046fc3394926cc0b Author: Miquel Raynal Date: Thu Apr 7 12:08:59 2022 +0200 net: ieee802154: at86rf230: Call _xmit_hw_error() when failing to offload frames If we end up at this location, it means that there was likely a hardware issue (either a bus error when asynchronously offloading the packet to the transceiver, or the transceiver took too long for some state change). In this case it was decided to return IEEE802154_SYSTEM_ERROR through the ieee802154_xmit_hw_error() helper dedicated to non IEEE802.15.4 specific errors. Let's use this helper instead of (almost) open-coding it. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-7-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 0f328c70341f9891c8893e13fc47fec6c4c1e606 Author: Li Zhijian Date: Tue Apr 12 10:29:01 2022 +0800 RDMA/rxe: Remove useless parameters for update_state() wqe was not used by update_state() so far. Commit aaaf62e06623 ("RDMA/rxe: Remove useless argument for update_state()") just did a partial fixes. Link: https://lore.kernel.org/r/20220412022903.574238-1-lizhijian@fujitsu.com Signed-off-by: Li Zhijian Signed-off-by: Jason Gunthorpe commit 5a1b57c0dde9b93ba8261fa1c81f9aae2bac284a Author: Miquel Raynal Date: Thu Apr 7 12:08:58 2022 +0200 net: mac802154: Create an error helper for asynchronous offloading errors A few drivers do the full transmit operation asynchronously, which means that a bus error that happens when forwarding the packet to the transmitter or a timeout happening when offloading the request to the transmitter will not be reported immediately. The solution in this case is to call this new helper to free the necessary resources, restart the queue and always return the same generic TRAC error code: IEEE802154_SYSTEM_ERROR. Suggested-by: Alexander Aring Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-6-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 30ca44eb2480ede838c7c8c131a7d25589a98f0a Author: Miquel Raynal Date: Thu Apr 7 12:08:57 2022 +0200 net: mac802154: Create an offloaded transmission error helper So far there is only a helper for successful transmissions, which led device drivers to implement their own handling in case of error. Unfortunately, we really need all the drivers to give the hand back to the core once they are done in order to be able to build a proper synchronous API. So let's create a _xmit_error() helper and take this opportunity to fill the new device-global field storing Tx statuses. Suggested-by: Alexander Aring Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-5-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 337e2f8681d70c8ab60ea83e33791b57907e1271 Author: Miquel Raynal Date: Thu Apr 7 12:08:56 2022 +0200 net: mac802154: Save a global error code on transmissions So far no error is returned from a failing transmission. However it might sometimes be useful, and particularly easy to use during sync transfers (for certain MLME commands). Let's create an internal variable for that, global to the device. Right now only success are registered, which is rather useless, but soon we will have more situations filling this field. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-4-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit f06cfc233ac67e26ed137f4e098c047939cf1530 Author: Miquel Raynal Date: Thu Apr 7 12:08:55 2022 +0200 net: ieee802154: Fill the list of MLME return codes There are more codes than already listed, let's be a bit more exhaustive. This will allow to drop device drivers local definitions of these codes. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 5b0e58542acb3672f42e08cb1cd57784f5e08d6b Author: Miquel Raynal Date: Thu Apr 7 12:08:54 2022 +0200 net: ieee802154: Enhance/fix the names of the MLME return codes Let's keep these definitions as close to the specification as possible while they are not yet in use. The names get slightly longer, but we gain the minor cost of being able to search the spec more easily. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220407100903.1695973-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 6588cb81e546e24f8271987ce0df120305cd4c80 Author: Krzysztof Kozlowski Date: Mon Apr 25 20:46:31 2022 +0200 dt-bindings: gpio: add common consumer GPIO lines Typical GPIO lines like enable, powerdown, reset or wakeup are not documented as common, which leads to new variations of these (e.g. pwdn-gpios). Add a common schema which serves also as a documentation for preferred naming. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit a8e85faaa51fc9cada6ea272cbf60d6ad880eddf Author: Ville Syrjälä Date: Fri Mar 25 14:32:01 2022 +0200 drm/i915: Add crtc .crtc_get_shared_dpll() Start splitting the .compute_crtc_clock() into two parts; one part does the computation, the second part does the shared dpll assignment. I want to move the actual computation part much earlier into the compute_config() phase. v2: dg2_crtc_get_shared_dpll() not needed (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 3bb9e25767ba786f240c419cc1db39d01232fa0a Author: Ville Syrjälä Date: Fri Mar 25 14:32:00 2022 +0200 drm/i915: Split out dg2_crtc_compute_clock() DG2 doesn't currently used the shared_dpll stuff so let's just split it out from hsw_crtc_compute_clock() entirely. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e2f5f399af316204656caf072d60ac19f4c978fc Author: Ville Syrjälä Date: Fri Mar 25 14:31:59 2022 +0200 drm/i915: Clear the dpll_hw_state when disabling a pipe Clear the dpll_hw_state when we're about disable the pipe. Previously it looks like we just left the old junk in there. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ad3da340f903b7f1d35a134144e8550a79d5a1db Author: Ville Syrjälä Date: Fri Mar 25 14:31:58 2022 +0200 drm/i915: Move the dpll_hw_state clearing to intel_dpll_crtc_compute_clock() All .crtc_compute_clock() implementations do the same memset() to clear the dpll_hw_state (since we preserve it across intel_crtc_prepare_cleared_state()). Move the memset() to the common wrapper. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 155a27172f823583a6a6d48ec0285baca0512cc9 Author: Ville Syrjälä Date: Fri Mar 25 14:31:57 2022 +0200 drm/i915: Move stuff into intel_dpll_crtc_compute_clock() Move some checks into intel_dpll_crtc_compute_clock() from the caller. Avoids the caller from having to worry about all this crap. We'll also reorder the hw.enable vs. shared_dpll checks since it makes sense to sanity check that we've cleared out the old shared_dpll even if the pipe is getting disabled. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7275f630d842222c093376246136e0cf1c657af2 Author: Ville Syrjälä Date: Fri Mar 25 14:31:56 2022 +0200 drm/i915: Adjust .crtc_compute_clock() calling convention Pass the full atomic state+crtc rather than the redundant crtc+crtc_state pair. We already need the full atomic state in the hsw+ codepath anyway. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e87ba18b4c80cb4bb28a9a1b76edad79b34cb1fc Author: Ville Syrjälä Date: Fri Mar 25 14:31:55 2022 +0200 drm/i915: Remove pointless dpll_funcs checks All platforms have dpll_funcs. Remove the pointless NULL checks. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8e272b3af396d84d8da418b480e13964fd48f028 Author: Ville Syrjälä Date: Fri Mar 25 14:31:54 2022 +0200 drm/i915: Pass dev_priv to intel_shared_dpll_init() Stop passing around the drm_device and just pass the dev_priv instead. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 9274229af2cfe4597f805071e42be8763331898f Author: Ville Syrjälä Date: Fri Mar 25 14:31:53 2022 +0200 drm/i915: Make .get_dplls() return int Get rid of the confusing back and forth between bools and ints in the .get_dplls() stuff. Just make everything return an int. Initial conversion done with cocci, with some manual fixups on top: @find@ identifier func !~ "get_hw_state|_is_|needed"; typedef bool; parameter list[N] P; @@ - bool + int func(P) { <... ( - return true; + return 0; | - return false; + return -EINVAL; ) ...> } @@ identifier find.func; expression list[find.N] E; expression X; @@ - if (!func(E)) + ret = func(E); + if (ret) { ... - return X; + return ret; } @@ identifier find.func; expression X; expression list[find.N] E; @@ - if (!func(E)) + ret = func(E); + if (ret) - return X; + return ret; @@ identifier find.func; expression list[find.N] E; expression O, X; typedef bool; bool B; @@ - B = func(E); - if (O && !B) + if (O) { + ret = func(E); + if (ret) - return X; + return ret; + } @@ identifier find.func; expression list[find.N] E; expression O, X; @@ - if (O && !func(E)) + if (O) { + ret = func(E); + if (ret) - return X; + return ret; + } @@ identifier find.func; expression list[find.N] E; expression X; typedef bool; bool B; @@ - B = func(E); - if (!B) + ret = func(E); + if (ret) { ... - return X; + return ret; } Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0386dd9140d04743ba15ebc349d9a7fcb6e24824 Merge: 9a2fb6e78136c 19faf9ee06224 Author: Mark Brown Date: Mon Apr 25 18:34:41 2022 +0100 ASoC: SOF: Rework the firmware ready message handling Merge series from Peter Ujfalusi : The firmware ready (fw_ready) message is sent by the firmware to notify the host that it has been booted up and caries additional information about it's configuration. All of this is IPC specific, the message itself is IPC version specific and the information itself also. Move the code to handle the fw_ready message under ipc3.c since the parsing and interpretation is IPC specific. A followup series is going to take care of the rest of the loader.c to make it IPC agnostic. commit 5c26993c31f0f726aa1f90158f17ec95069b7cb2 Author: David Vernet Date: Sat Apr 23 05:30:54 2022 -0700 cgroup: Add config file to cgroup selftest suite Most of the test suites in tools/testing/selftests contain a config file that specifies which kernel config options need to be present in order for the test suite to be able to run and perform meaningful validation. There is no config file for the tools/testing/selftests/cgroup test suite, so this patch adds one. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit a79906570f9646ae174dd0899ea54cc2eeffd788 Author: David Vernet Date: Sat Apr 23 05:30:53 2022 -0700 cgroup: Add test_cpucg_max_nested() testcase The cgroup cpu controller selftests have a test_cpucg_max() testcase that validates the behavior of the cpu.max knob. Let's also add a testcase that verifies that the behavior works correctly when set on a nested cgroup. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 889ab8113ef1386c57d64da106b850e752949f07 Author: David Vernet Date: Sat Apr 23 05:30:52 2022 -0700 cgroup: Add test_cpucg_max() testcase The cgroup cpu controller test suite has a number of testcases that validate the expected behavior of the cpu.weight knob, but none for cpu.max. This testcase fixes that by adding a testcase for cpu.max as well. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 89ca0efa8468f230df965257d0c03fc3664b4331 Author: David Vernet Date: Sat Apr 23 05:30:51 2022 -0700 cgroup: Add test_cpucg_nested_weight_underprovisioned() testcase The cgroup cpu controller test suite currently contains a testcase called test_cpucg_nested_weight_underprovisioned() which verifies the expected behavior of cpu.weight when applied to nested cgroups. That first testcase validated the expected behavior when the processes in the leaf cgroups overcommitted the system. This patch adds a complementary test_cpucg_nested_weight_underprovisioned() testcase which validates behavior when those leaf cgroups undercommit the system. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit b76ee4f576ebfbab3891e51a531ec7ad7ef10a7a Author: David Vernet Date: Sat Apr 23 05:30:50 2022 -0700 cgroup: Adding test_cpucg_nested_weight_overprovisioned() testcase The cgroup cpu controller tests in tools/testing/selftests/cgroup/test_cpu.c have some testcases that validate the expected behavior of setting cpu.weight on cgroups, and then hogging CPUs. What is still missing from the suite is a testcase that validates nested cgroups. This patch adds test_cpucg_nested_weight_overprovisioned(), which validates that a parent's cpu.weight will override its children if they overcommit a host, and properly protect any sibling groups of that parent. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 9ee448f94318ab2d42e4e7266666d084fdb1e992 Merge: b0ceb62125155 6d72b11403549 Author: Mark Brown Date: Mon Apr 25 18:22:58 2022 +0100 Improve SPI support for Ingenic SoCs. Merge series from 周琰杰 (Zhou Yanjie) : 1.Add support for using GPIOs as chip select lines on Ingenic SoCs. 2.Add support for probing the spi-ingenic driver on the JZ4775 SoC, the X1000 SoC, and the X2000 SoC. 3.Modify annotation texts to be more in line with the current state. commit 9a2fb6e78136cfd4499c745ace0f7bc7473556da Merge: b34a068c0286b 5349c0c93d15d Author: Mark Brown Date: Mon Apr 25 18:22:55 2022 +0100 ASoC: Add macros for signed TLV controls with callbacks Merge series from Richard Fitzgerald : This adds SOC_DOUBLE_R_S_EXT_TLV and SOC_SINGLE_S_EXT_TLV macros for signed TLV controls that need custom get/put callbacks. These will be needed by future Cirrus codec drivers, but are not particularly exotic so could be useful for others. commit b34a068c0286ba9ca4068d7c85595e7b908007a0 Merge: 85780eb54db39 988e6870c86cc Author: Mark Brown Date: Mon Apr 25 18:22:54 2022 +0100 ASoC: remaining i2c_match_id i2c probe changes Merge series from Stephen Kitt : This series covers all the remaining changes to migrate sound/soc/codecs i2c probes to probe_new, where the const struct i2c_client * argument is still used. Instead of relying on the parameter passed in, i2c_match_id is used instead. With this set of patches, all the sound/soc/codecs i2c probes use the new probe definition. Changes since v1: two missing files were added. Stephen Kitt (7): ASoC: ak*: use i2c_match_id and simple i2c probe ASoC: alc56*: use i2c_match_id and simple i2c probe ASoC: max980*: use i2c_match_id and simple i2c probe ASoC: pcm186x: use i2c_match_id and simple i2c probe ASoC: tas*: use i2c_match_id and simple i2c probe ASoC: tlv320*: use i2c_match_id and simple i2c probe ASoC: tpa6130: use i2c_match_id and simple i2c probe sound/soc/codecs/ak4613.c | 10 +++++---- sound/soc/codecs/ak4642.c | 8 ++++--- sound/soc/codecs/alc5623.c | 24 +++++++++++---------- sound/soc/codecs/alc5632.c | 20 +++++++++-------- sound/soc/codecs/max98088.c | 21 +++++++++--------- sound/soc/codecs/max98090.c | 23 ++++++++++---------- sound/soc/codecs/max98095.c | 19 +++++++++-------- sound/soc/codecs/pcm186x-i2c.c | 24 ++++++++++----------- sound/soc/codecs/tas2562.c | 25 +++++++++++----------- sound/soc/codecs/tas571x.c | 11 ++++++---- sound/soc/codecs/tas5720.c | 21 +++++++++--------- sound/soc/codecs/tlv320adc3xxx.c | 21 +++++++++--------- sound/soc/codecs/tlv320aic31xx.c | 32 ++++++++++++++-------------- sound/soc/codecs/tlv320aic32x4-i2c.c | 11 ++++++---- sound/soc/codecs/tlv320aic3x-i2c.c | 25 +++++++++++----------- sound/soc/codecs/tpa6130a2.c | 19 +++++++++-------- 16 files changed, 168 insertions(+), 146 deletions(-) base-commit: 5d763a740e5b24e4a2ca04317255e7e941876338 -- 2.27.0 commit 85780eb54db39ba3f4a797592afbfd95d1c7c5c2 Merge: e5737cceeee5c 0e0b83cc7ec7f Author: Mark Brown Date: Mon Apr 25 18:22:52 2022 +0100 Add support of MediaTek mt8186 to SOF Merge series from Tinghan Shen : Add support of MediaTek mt8186 SoC DSP to SOF. commit b6ba1a89f73f11000f6b3062c4dc2503531bd3d2 Author: Peter Collingbourne Date: Fri Apr 22 13:29:12 2022 -0700 arm64: document the boot requirements for MTE When booting the kernel we access system registers such as GCR_EL1 if MTE is supported. These accesses are defined to trap to EL3 if SCR_EL3.ATA is disabled. Furthermore, tag accesses will not behave as expected if SCR_EL3.ATA is not set, or if HCR_EL2.ATA is not set and we were booted at EL1. Therefore, require that these bits are enabled when appropriate. Signed-off-by: Peter Collingbourne Reviewed-by: Mark Brown Link: https://linux-review.googlesource.com/id/Iadcfd4dcd9ba3279b2813970b44d7485b0116709 Link: https://lore.kernel.org/r/20220422202912.292039-1-pcc@google.com Signed-off-by: Catalin Marinas commit 962c400d48e604438cfb3732016ad1b74bfc298c Author: Sumit Gupta Date: Tue Apr 5 18:31:19 2022 +0530 arm64: tegra: Add node for Tegra234 CCPLEX cluster Adding CCPLEX cluster node to represent Tegra234 cpufreq. Tegra234 uses some of the CRAB (Control Register Access Bus) registers for CPU frequency requests. These registers are memory mapped to the CCPLEX_MMCRAB_ARM region. In this node, mapping the range of MMCRAB registers is required only for CPU frequency info. Signed-off-by: Sumit Gupta Signed-off-by: Thierry Reding commit ea1d15a067d601cf156c042bd0834acad67db650 Author: Karthik Alapati Date: Sat Apr 23 11:14:34 2022 +0530 selftests/binderfs: Improve message to provide more info Currently the binderfs test says what failure it encountered without saying why it may occurred when it fails to mount binderfs. So, Warn about enabling CONFIG_ANDROID_BINDERFS in the running kernel. Signed-off-by: Karthik Alapati Reviewed-by: Christian Brauner (Microsoft) Signed-off-by: Shuah Khan commit 067c098766c6af667a9002d4e33cf1f3c998abbe Author: Frank Rowand Date: Wed Apr 20 17:25:05 2022 -0500 of: overlay: rework overlay apply and remove kfree()s Fix various kfree() issues related to of_overlay_apply(). - Double kfree() of fdt and tree when init_overlay_changeset() returns an error. - free_overlay_changeset() free the root of the unflattened overlay (variable tree) instead of the memory that contains the unflattened overlay. - For the case of a failure during applying an overlay, move kfree() of new_fdt and overlay_mem into free_overlay_changeset(), which is called by the function that allocated them. - For the case of removing an overlay, the kfree() of new_fdt and overlay_mem remains in free_overlay_changeset(). - Check return value of of_fdt_unflatten_tree() for error instead of checking the returned value of overlay_root. - When storing pointers to allocated objects in ovcs, do so as near to the allocation as possible instead of in deeply layered function. More clearly document policy related to lifetime of pointers into overlay memory. Double kfree() Reported-by: Slawomir Stepien Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220420222505.928492-3-frowand.list@gmail.com commit 1e4089667c7c732dd1b92c4c6bc7bd240ca30213 Author: Frank Rowand Date: Wed Apr 20 17:25:04 2022 -0500 of: overlay: rename variables to be consistent Variables change name across function calls when there is not a good reason to do so. Fix by changing "fdt" to "new_fdt" and "tree" to "overlay_root". The name disparity was confusing when creating the following commit. The name changes are in this separate commit to make review of the following commmit less complex. Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220420222505.928492-2-frowand.list@gmail.com commit a765ed47e45166451680ee9af2b9e435c82ec3ba Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:25 2022 +0200 PCI: hv: Fix synchronization between channel callback and hv_compose_msi_msg() Dexuan wrote: "[...] when we disable AccelNet, the host PCI VSP driver sends a PCI_EJECT message first, and the channel callback may set hpdev->state to hv_pcichild_ejecting on a different CPU. This can cause hv_compose_msi_msg() to exit from the loop and 'return', and the on-stack variable 'ctxt' is invalid. Now, if the response message from the host arrives, the channel callback will try to access the invalid 'ctxt' variable, and this may cause a crash." Schematically: Hyper-V sends PCI_EJECT msg hv_pci_onchannelcallback() state = hv_pcichild_ejecting hv_compose_msi_msg() alloc and init comp_pkt state == hv_pcichild_ejecting Hyper-V sends VM_PKT_COMP msg hv_pci_onchannelcallback() retrieve address of comp_pkt 'free' comp_pkt and return comp_pkt->completion_func() Dexuan also showed how the crash can be triggered after introducing suitable delays in the driver code, thus validating the 'assumption' that the host can still normally respond to the guest's compose_msi request after the host has started to eject the PCI device. Fix the synchronization by leveraging the requestor lock as follows: - Before 'return'-ing in hv_compose_msi_msg(), remove the ID (while holding the requestor lock) associated to the completion packet. - Retrieve the address *and call ->completion_func() within a same (requestor) critical section in hv_pci_onchannelcallback(). Reported-by: Wei Hu Reported-by: Dexuan Cui Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-7-parri.andrea@gmail.com Signed-off-by: Wei Liu commit b91eaf7267cf7aec0a4e087decf7770dfb694d78 Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:24 2022 +0200 Drivers: hv: vmbus: Introduce {lock,unlock}_requestor() To abtract the lock and unlock operations on the requestor spin lock. The helpers will come in handy in hv_pci. No functional change. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-6-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 0aadb6a7bb811554cf39318b5d18e8ec50dd9f02 Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:23 2022 +0200 Drivers: hv: vmbus: Introduce vmbus_request_addr_match() The function can be used to retrieve and clear/remove a transation ID from a channel requestor, provided the memory address corresponding to the ID equals a specified address. The function, and its 'lockless' variant __vmbus_request_addr_match(), will be used by hv_pci. Refactor vmbus_request_addr() to reuse the 'newly' introduced code. No functional change. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-5-parri.andrea@gmail.com Signed-off-by: Wei Liu commit b03afa57c65e1e045e02df49777e953742745f4c Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:22 2022 +0200 Drivers: hv: vmbus: Introduce vmbus_sendpacket_getid() The function can be used to send a VMbus packet and retrieve the corresponding transaction ID. It will be used by hv_pci. No functional change. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-4-parri.andrea@gmail.com Signed-off-by: Wei Liu commit de5ddb7d44347ad8b00533c1850a4e2e636a1ce9 Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:21 2022 +0200 PCI: hv: Use vmbus_requestor to generate transaction IDs for VMbus hardening Currently, pointers to guest memory are passed to Hyper-V as transaction IDs in hv_pci. In the face of errors or malicious behavior in Hyper-V, hv_pci should not expose or trust the transaction IDs returned by Hyper-V to be valid guest memory addresses. Instead, use small integers generated by vmbus_requestor as request (transaction) IDs. Suggested-by: Michael Kelley Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-3-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 82cd4bacff88a11e36f143e2cb950174b09c86c3 Author: Andrea Parri (Microsoft) Date: Tue Apr 19 14:23:20 2022 +0200 Drivers: hv: vmbus: Fix handling of messages with transaction ID of zero vmbus_request_addr() returns 0 (zero) if the transaction ID passed to as argument is 0. This is unfortunate for two reasons: first, netvsc_send_completion() does not check for a NULL cmd_rqst (before dereferencing the corresponding NVSP message); second, 0 is a *valid* value of cmd_rqst in netvsc_send_tx_complete(), cf. the call of vmbus_sendpacket() in netvsc_send_pkt(). vmbus_request_addr() has included the code in question since its introduction with commit e8b7db38449ac ("Drivers: hv: vmbus: Add vmbus_requestor data structure for VMBus hardening"); such code was motivated by the early use of vmbus_requestor by hv_storvsc. Since hv_storvsc moved to a tag-based mechanism to generate and retrieve transaction IDs with commit bf5fd8cae3c8f ("scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs"), vmbus_request_addr() can be modified to return VMBUS_RQST_ERROR if the ID is 0. This change solves the issues in hv_netvsc (and makes the handling of messages with transaction ID of 0 consistent with the semantics "the ID is not contained in the requestor/invalid ID"). vmbus_next_request_id(), vmbus_request_addr() should still reserve the ID of 0 for Hyper-V, because Hyper-V will "ignore" (not respond to) VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED packets/requests with transaction ID of 0 from the guest. Fixes: bf5fd8cae3c8f ("scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs") Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220419122325.10078-2-parri.andrea@gmail.com Signed-off-by: Wei Liu commit 08e61e861a0e47e5e1a3fb78406afd6b0cea6b6d Author: Jeffrey Hugo Date: Wed Apr 13 07:36:21 2022 -0600 PCI: hv: Fix multi-MSI to allow more than one MSI vector If the allocation of multiple MSI vectors for multi-MSI fails in the core PCI framework, the framework will retry the allocation as a single MSI vector, assuming that meets the min_vecs specified by the requesting driver. Hyper-V advertises that multi-MSI is supported, but reuses the VECTOR domain to implement that for x86. The VECTOR domain does not support multi-MSI, so the alloc will always fail and fallback to a single MSI allocation. In short, Hyper-V advertises a capability it does not implement. Hyper-V can support multi-MSI because it coordinates with the hypervisor to map the MSIs in the IOMMU's interrupt remapper, which is something the VECTOR domain does not have. Therefore the fix is simple - copy what the x86 IOMMU drivers (AMD/Intel-IR) do by removing X86_IRQ_ALLOC_CONTIGUOUS_VECTORS after calling the VECTOR domain's pci_msi_prepare(). Fixes: 4daace0d8ce8 ("PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs") Signed-off-by: Jeffrey Hugo Reviewed-by: Dexuan Cui Link: https://lore.kernel.org/r/1649856981-14649-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Wei Liu commit 14eb76f73e4390e1da448e86b9a8ad22c3f25119 Author: Ville Syrjälä Date: Wed Apr 13 18:28:52 2022 +0300 drm/i915/fbc: s/false/0/ intel_fbc_check_plane() is supposed to an int, not a boolean. So replace the bogus 'return false's with the correct 'return 0's. These were accidental copy-paste mistakes when the code got moved into intel_fbc_check_plane() from somewhere else tht did return a boolean. No functional issue here since false==0. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220413152852.7336-2-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 3e1faae3398789abe8d4797255bfe28d95d81308 Author: Ville Syrjälä Date: Wed Apr 13 18:28:51 2022 +0300 drm/i915/fbc: Consult hw.crtc instead of uapi.crtc plane_state->uapi.crtc is not what we want to be looking at. If bigjoiner is used hw.crtc is what tells us what crtc the plane is supposedly using. Not an actual problem on current hardware as the only FBC capable pipe (A) can't be a bigjoiner slave and thus uapi.crtc==hw.crtc always here. But when we get more FBC instances this will become actually important. Fixes: 2e6c99f88679 ("drm/i915/fbc: Nuke lots of crap from intel_fbc_state_cache") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220413152852.7336-1-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 003fed595c0f37d0ad112447f5f942654979426c Author: Yuntao Wang Date: Sun Apr 24 22:34:20 2022 +0800 libbpf: Remove unnecessary type cast The link variable is already of type 'struct bpf_link *', casting it to 'struct bpf_link *' is redundant, drop it. Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220424143420.457082-1-ytcoode@gmail.com commit 66200bbcde697dea7f48071d325ea4dec6f66b11 Author: Michael Kelley Date: Tue Apr 12 19:49:00 2022 -0700 Drivers: hv: vmbus: Add VMbus IMC device to unsupported list Hyper-V may offer an Initial Machine Configuration (IMC) synthetic device to guest VMs. The device may be used by Windows guests to get specialization information, such as the hostname. But the device is not used in Linux and there is no Linux driver, so it is unsupported. Currently, the IMC device GUID is not recognized by the VMbus driver, which results in an "Unknown GUID" error message during boot. Add the GUID to the list of known but unsupported devices so that the error message is not generated. Other than avoiding the error message, there is no change in guest behavior. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1649818140-100953-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit c8a02e38f86fbab30aab6261662076516cfb9ec3 Author: Aharon Landau Date: Tue Apr 12 10:24:07 2022 +0300 RDMA/mlx5: Clean UMR QP type flow from mlx5_ib_post_send() No internal UMR operation is using mlx5_ib_post_send(), remove the UMR QP type logic from this function. Link: https://lore.kernel.org/r/0b2f368f14bc9266ebdf92a601ca4e1e5b1e1188.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 636bdbfc9996567af1a3ed89ecf92ea5028a8a89 Author: Aharon Landau Date: Tue Apr 12 10:24:06 2022 +0300 RDMA/mlx5: Use mlx5_umr_post_send_wait() to update xlt Move mlx5_ib_update_mr_pas logic to umr.c, and use mlx5_umr_post_send_wait() instead of mlx5_ib_post_send_wait(). Since it is the last use of mlx5_ib_post_send_wait(), remove it. Link: https://lore.kernel.org/r/55a4972f156aba3592a2fc9bcb33e2059acf295f.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit b3d47ebd490823514a2d637caee0870b6f192b07 Author: Aharon Landau Date: Tue Apr 12 10:24:05 2022 +0300 RDMA/mlx5: Use mlx5_umr_post_send_wait() to update MR pas Move mlx5_ib_update_mr_pas logic to umr.c, and use mlx5_umr_post_send_wait() instead of mlx5_ib_post_send_wait(). Link: https://lore.kernel.org/r/ed8f2ee6c64804072155d727149abf7105f92536.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 916adb491e84bc8b130618e4969c1d196525abf2 Author: Aharon Landau Date: Tue Apr 12 10:24:04 2022 +0300 RDMA/mlx5: Move creation and free of translation tables to umr.c The only use of the translation tables is to update the mkey translation by a UMR operation. Move the responsibility of creating and freeing them to umr.c Link: https://lore.kernel.org/r/1d93f1381be82a22aaf1168cdbdfb227eac1ce62.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 483196764091621b8dd45d7af29e7a9c874a9f19 Author: Aharon Landau Date: Tue Apr 12 10:24:03 2022 +0300 RDMA/mlx5: Use mlx5_umr_post_send_wait() to rereg pd access Move rereg_pd_access logic to umr.c, and use mlx5_umr_post_send_wait() instead of mlx5_ib_post_send_wait(). Link: https://lore.kernel.org/r/18da4f47edbc2561f652b7ee4e7a5269e866af77.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 33e8aa8e049811de87cd1c16a2ead85e0c9f9606 Author: Aharon Landau Date: Tue Apr 12 10:24:02 2022 +0300 RDMA/mlx5: Use mlx5_umr_post_send_wait() to revoke MRs Move the revoke_mr logic to umr.c, and using mlx5_umr_post_send_wait() instead of mlx5_ib_post_send_wait(). In the new implementation, do not zero out the access flags. Before reusing the MR, we will update it to the required access. Link: https://lore.kernel.org/r/63717dfdaf6007f81b3e6dbf598f5bf3875ce86f.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6f0689fdf19ed3aca3ee3910223ad27216640693 Author: Aharon Landau Date: Tue Apr 12 10:24:01 2022 +0300 RDMA/mlx5: Introduce mlx5_umr_post_send_wait() Introduce mlx5_umr_post_send_wait() that uses a UMR adjusted flow for posting WQEs. The next patches will gradually move UMR operations to use this flow. Once done, will get rid of mlx5_ib_post_send_wait(). mlx5_umr_post_send_wait gets already written WQE segments and will only memcpy it to the SQ. This way, we avoid packing all the data in a WR just to unpack it into the WQE. Link: https://lore.kernel.org/r/f027dd592fde62402b2d49efded8d1d22229d22b.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit fe765aeb7712b836d715109e0711f37bcb6c8ccf Author: Aharon Landau Date: Tue Apr 12 10:24:00 2022 +0300 RDMA/mlx5: Expose wqe posting helpers outside of wr.c Split posting WQEs logic to helpers, generalize it and expose for future use in the UMR post send. Link: https://lore.kernel.org/r/a2b0f6cd96f0405a65d38e82c6ae7ef34dcb34bc.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ba6a9c6899b2dce3c615ce9fac6bead976e43a48 Author: Aharon Landau Date: Tue Apr 12 10:23:59 2022 +0300 RDMA/mlx5: Simplify get_umr_update_access_mask() Instead of getting the update access capabilities each call to get_umr_update_access_mask(), pass struct mlx5_ib_dev and get the capabilities inside the function. Link: https://lore.kernel.org/r/f22b8a84ef32e29ada26691f06b57e2ed5943b76.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8a8a5d37c7b4334ede6e7121f7b0757ec7a2e2ed Author: Aharon Landau Date: Tue Apr 12 10:23:58 2022 +0300 RDMA/mlx5: Move mkey ctrl segment logic to umr.c Move set_reg_umr_segment() and its helpers to umr.c. Link: https://lore.kernel.org/r/5a7fac8ae8543521d19d174663245ae84b910310.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f49c856ac2ef314af06afba0201d0d6eed3460b0 Author: Aharon Landau Date: Tue Apr 12 10:23:57 2022 +0300 RDMA/mlx5: Move umr checks to umr.h Move mlx5_ib_can_load_pas_with_umr() and mlx5_ib_can_reconfig_with_umr() to umr.h and rename them accordingly. Link: https://lore.kernel.org/r/1b799b0142534a63dfd5bacc5f8ad2256d7777ad.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 04876c12c19e94bbbc94bb0446c7bc7cd75163de Author: Aharon Landau Date: Tue Apr 12 10:23:56 2022 +0300 RDMA/mlx5: Move init and cleanup of UMR to umr.c The first patch in a series to split UMR logic to a dedicated file. As a start, move the init and cleanup of UMR resources to umr.c. Link: https://lore.kernel.org/r/849e632dd1945a2534712a320cc5779f2149ba96.1649747695.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d7030edf32ad5196af61a8d88e557ed2951b94cd Author: Sudeep Holla Date: Mon Apr 25 14:55:24 2022 +0100 arm64: dts: fvp: Align virtio device node names with dtschema Align the virtio mmio device tree node names with the schema to avoid any schema warnings. Link: https://lore.kernel.org/r/20220425135524.1077986-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 5f756a2eaa4436d7d3dc1e040147f5e992ae34b5 Author: Nuno Sá Date: Wed Apr 20 15:02:05 2022 +0200 of: overlay: do not break notify on NOTIFY_{OK|STOP} We should not break overlay notifications on NOTIFY_{OK|STOP} otherwise we might break on the first fragment. We should only stop notifications if a *real* errno is returned by one of the listeners. Fixes: a1d19bd4cf1fe ("of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove") Signed-off-by: Nuno Sá Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220420130205.89435-1-nuno.sa@analog.com commit 5393158f009bdc5e9b55559ce4ad2b0700c46e73 Author: Diego Sueiro Date: Thu Apr 21 15:35:21 2022 +0100 arm64: dts: fvp: Add virtio-rng support The virtio-rng is available from FVP_Base_RevC-2xAEMvA version 11.17, so add the devicetree node to support it. It is disabled by default to avoid any issues with models that doesn't support it. Link: https://lore.kernel.org/r/ac3be672c636091ee1e079cadce776b1fb7e0b2e.1650543392.git.diego.sueiro@arm.com Signed-off-by: Diego Sueiro Signed-off-by: Sudeep Holla commit a69d277460888c2bd99a6fa849f474a7197a3e16 Author: Rui Miguel Silva Date: Fri Apr 8 14:19:22 2022 +0100 arm64: dts: Add Arm corstone1000 platform support Corstone1000 is a platform from arm, which includes pre verified Corstone SSE710 sub-system that combines Cortex-A and Cortex-M processors [0]. These device trees contains the necessary bits to support the Corstone 1000 FVP (Fixed Virtual Platform) [1] and the FPGA MPS3 board Cortex-A35 implementation at Cortex-A35 host side of this platform. [2] 0: https://developer.arm.com/documentation/102360/0000 1: https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps 2: https://developer.arm.com/documentation/dai0550/c/ Link: https://lore.kernel.org/r/20220408131922.3864348-3-rui.silva@linaro.org Reviewed-by: Rob Herring Signed-off-by: Rui Miguel Silva Signed-off-by: Sudeep Holla commit 41e3958475ed3f9ad09facbe04cb8eafcee14546 Author: Rui Miguel Silva Date: Fri Apr 8 14:19:21 2022 +0100 dt-bindings: Add Arm corstone1000 platform Add bindings to describe the FPGA in a prototyping board (MPS3) implementation and the Fixed Virtual Platform implementation of the ARM Corstone1000 platform. Link: https://lore.kernel.org/r/20220408131922.3864348-2-rui.silva@linaro.org Reviewed-by: Rob Herring Signed-off-by: Rui Miguel Silva Signed-off-by: Sudeep Holla commit 8ad7e8f696951f192c6629a0cbda9ac94c773159 Author: Thomas Gleixner Date: Mon Apr 4 14:11:25 2022 +0200 x86/fpu/xsave: Support XSAVEC in the kernel XSAVEC is the user space counterpart of XSAVES which cannot save supervisor state. In virtualization scenarios the hypervisor does not expose XSAVES but XSAVEC to the guest, though the kernel does not make use of it. That's unfortunate because XSAVEC uses the compacted format of saving the XSTATE. This is more efficient in terms of storage space vs. XSAVE[OPT] as it does not create holes for XSTATE components which are not supported or enabled by the kernel but are available in hardware. There is room for further optimizations when XSAVEC/S and XGETBV1 are supported. In order to support XSAVEC: - Define the XSAVEC ASM macro as it's not yet supported by the required minimal toolchain. - Create a software defined X86_FEATURE_XCOMPACTED to select the compacted XSTATE buffer format for both XSAVEC and XSAVES. - Make XSAVEC an option in the 'XSAVE' ASM alternatives Requested-by: Andrew Cooper Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220404104820.598704095@linutronix.de commit 0e0b83cc7ec7fc5e6695aa6ebbb0961e26096105 Author: Tinghan Shen Date: Fri Apr 22 13:56:59 2022 +0800 ASoC: SOF: mediatek: Add DSP system PM callback for mt8186 Add DSP system PM callback for suspend and resume Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Reviewed-by: Ranjani Sridharan Reviewed-by: Yaochun Hung Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220422055659.8738-5-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 210b3ab932f7a08d8b912c497ca0ca86f712814f Author: Tinghan Shen Date: Fri Apr 22 13:56:58 2022 +0800 ASoC: SOF: mediatek: Add mt8186 dsp clock support Add adsp clock on/off support on mt8186 SoC. Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Reviewed-by: Ranjani Sridharan Reviewed-by: Yaochun Hung Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220422055659.8738-4-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 570c14dc92d5dc6f732cb74fa691ef909d182710 Author: Tinghan Shen Date: Fri Apr 22 13:56:57 2022 +0800 ASoC: SOF: mediatek: Add mt8186 sof fw loader and dsp ops Add mt8186-loader module with ops callback to load and run firmware on mt8186 SoC. Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Reviewed-by: Ranjani Sridharan Reviewed-by: Yaochun Hung Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220422055659.8738-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 1f0214a86de87011ecb96f22545dd6e5c7324cd7 Author: Tinghan Shen Date: Fri Apr 22 13:56:56 2022 +0800 ASoC: SOF: mediatek: Add mt8186 hardware support Add support of SOF on Mediatek mt8186 SoC. MT8186 has 2 Cortex A76 cores paired with 6 Cortex A55 cores. It also has Cadence HiFi-5 DSP single core. The IPC communication between AP and DSP is based on shared DRAM and mailbox interrupt. Signed-off-by: Allen-KH Cheng Signed-off-by: Tinghan Shen Reviewed-by: Ranjani Sridharan Reviewed-by: Yaochun Hung Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220422055659.8738-2-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit 1adb4d7ad3a585b451f5cf6b0a90c5917af3eac5 Author: Colin Ian King Date: Fri Apr 22 12:04:18 2022 +0100 genirq/matrix: Remove redundant assignment to variable 'end' Variable end is being initialized with a value that is never read, it is being re-assigned later with the same value. The initialization is redundant and can be removed. Cleans up clang scan build warning: kernel/irq/matrix.c:289:25: warning: Value stored to 'end' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Thomas Gleixner Reviewed-by: Tom Rix Link: https://lore.kernel.org/r/20220422110418.1264778-1-colin.i.king@gmail.com commit b0ceb62125155c1f8e67d3a944af9536d93609c7 Author: Alexander Shiyan Date: Wed Apr 20 09:10:38 2022 +0300 spi: clps711x: Use syscon_regmap_lookup_by_phandle Since version 5.13, the standard syscon bindings have been added to all clps711x DT nodes, so we can now use the more general syscon_regmap_lookup_by_phandle function to get the syscon pointer. Signed-off-by: Alexander Shiyan Link: https://lore.kernel.org/r/20220420061038.22570-1-eagle.alexander923@gmail.com Signed-off-by: Mark Brown commit 1af2fb6283fb82755a6fe819f863e4c3d9772e69 Author: Minghao Chi Date: Wed Apr 20 09:04:52 2022 +0000 spi: stm32: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220420090452.2588930-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit b7be05d5e4a3046e245947730cd90d07d09bdcee Author: Minghao Chi Date: Thu Apr 14 08:56:37 2022 +0000 spi: spi-cadence-quadspi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220414085637.2541805-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 1e6f8bd15cf8447a42375b005476e02fc13deb2a Author: Minghao Chi Date: Mon Apr 18 11:01:41 2022 +0000 spi: spi-tegra20-slink: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220418110141.2559019-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 1aeda0966693574c07c5fa72adf41be43d491f96 Author: Matthias Schiffer Date: Wed Apr 20 17:56:16 2022 +0200 spi: cadence-quadspi: allow operations with cmd/addr buswidth >1 With the removal of the incorrect logic of cqspi_set_protocol(), ops with cmd/addr buswidth >1 are now working correctly. Tested on a TI AM64x with a Macronix MX25U51245G QSPI flash using 1-4-4 operations. DTR operations are currently untested, so we leave them disabled for now (except for the previously allowed 8-8-8 ops). Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20220420155616.281730-2-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown commit 28ac902aedd18abf4faf8816b1bea6623d0e9509 Author: Matthias Schiffer Date: Wed Apr 20 17:56:15 2022 +0200 spi: cadence-quadspi: drop cqspi_set_protocol() As suggested, this removes the whole cqspi_set_protocol() function, as it is not actually needed: - Checks for unsupported operations are already handled by supports_op(), removing the need to distinguish DTR and non-DTR modes in the buswidth setup - supports_op() ensures that the DTR flags match for all relevant parts of an operation, so op->cmd.dtr can be used instead of copying the flag to the cqspi_flash_pdata - The logic in cqspi_set_protocol() is moved to cqspi_calc_rdreg() and cqspi_write_setup() (with a helper macro CQSPI_OP_WIDTH()) The helper macro checks nbytes instead of buswidth for 0, for consistency with supports_op() etc. Suggested-by: Pratyush Yadav Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20220420155616.281730-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown commit 2b8070840e6f48b5406ebe1630a0335843109799 Author: Minghao Chi Date: Mon Apr 18 11:01:03 2022 +0000 spi: spi-tegra20-sflash: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220418110103.2558955-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit d5d933f09ac326aebad85bfb787cc786ad477711 Author: Luca Ceresoli Date: Thu Apr 21 23:32:51 2022 +0200 spi: rockchip: fix missing error on unsupported SPI_CS_HIGH The hardware (except for the ROCKCHIP_SPI_VER2_TYPE2 version) does not support active-high native chip selects. However if such a CS is configured the core does not error as it normally should, because the 'ctlr->use_gpio_descriptors = true' line in rockchip_spi_probe() makes the core set SPI_CS_HIGH in ctlr->mode_bits. In such a case the spi-rockchip driver operates normally but produces an active-low chip select signal without notice. There is no provision in the current core code to handle this situation. Fix by adding a check in the ctlr->setup function (similarly to what spi-atmel.c does). This cannot be done reading the SPI_CS_HIGH but in ctlr->mode_bits because that bit gets always set by the core for master mode (see above). Fixes: eb1262e3cc8b ("spi: spi-rockchip: use num-cs property and ctlr->enable_gpiods") Signed-off-by: Luca Ceresoli Link: https://lore.kernel.org/r/20220421213251.1077899-1-luca.ceresoli@bootlin.com Signed-off-by: Mark Brown commit 40b6a137717bb5ca5ccb4e4b051e0d22019cd188 Author: Minghao Chi Date: Thu Apr 14 08:54:33 2022 +0000 spi: spi-omap2-mcspi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220414085433.2541670-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 32831bf569e377fc80dc2b1110b72874beb8f4c2 Author: Minghao Chi Date: Wed Apr 20 09:04:20 2022 +0000 spi: mxs: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220420090420.2588868-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 7d34ff58f35c82207698f43af79817a05e1342e5 Author: Minghao Chi Date: Thu Apr 14 08:53:42 2022 +0000 spi: spi-imx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220414085343.2541608-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit b9db82e5f24932d3a1005ce17b2ef564487c1bca Author: Minghao Chi Date: Thu Apr 14 08:55:06 2022 +0000 spi: spi-sprd: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220414085506.2541732-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 6d72b11403549a34b485d2fe323c8a57b4dd1958 Author: 周琰杰 (Zhou Yanjie) Date: Sat Apr 23 22:38:45 2022 +0800 spi: ingenic: Add support for new Ingenic SoCs. 1.Since it would be dangerous to specify a newer SoC's compatible string as the fallback of an older SoC's compatible string, we add support for the "ingenic,jz4775-spi" compatible string in the driver. This will permit to support the JZ4775 by having: compatible = "ingenic,jz4775-spi"; Instead of doing: compatible = "ingenic,jz4775-spi", "ingenic,jz4780-spi"; 2.Add support for probing the spi-ingenic driver on the X1000 SoC from Ingenic. From the X1000 SoC onwards, the maximum frequency allowed by the SSI module of Ingenic SoCs has been changed from 54MHz to 50MHz. So "max_speed_hz" is introduced in "jz_soc_info" to set different maximum frequency values. 3.Add support for probing the spi-ingenic driver on the X2000 SoC from Ingenic. The X2000 SoC has only one native chip select line, so "max_native_cs" is introduced in "jz_soc_info" to set different maximum number of native chip select lines. 4.Because of the introduction of support for the X-series SoCs, the current driver is not only applicable to the JZ-series SoCs, so the description texts has been modified to avoid misunderstanding. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/1650724725-93758-4-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Mark Brown commit aecec8bbb225965c6f775b946ad7bf40736c8f09 Author: 周琰杰 (Zhou Yanjie) Date: Sat Apr 23 22:38:44 2022 +0800 spi: Add bindings for new Ingenic SoCs. Add the SPI bindings for the JZ4775 SoC, the X1000 SoC, and the X2000 SoC from Ingenic. Signed-off-by: 周琰杰 (Zhou Yanjie) Acked-by: Krzysztof Kozlowski Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/1650724725-93758-3-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Mark Brown commit c049b4b37685ff5b179a7e062b919c31eb406214 Author: Uwe Kleine-König Date: Wed Apr 20 08:58:32 2022 +0200 PCI: microchip: Add a missing semicolon If the driver is configured as a module (after allowing this by changing PCIE_MICROCHIP_HOST from bool to tristate) the missing semicolon makes the compiler very unhappy. While there isn't a real problem as MODULE_DEVICE_TABLE always evaluates to nothing for a built-in driver, do it right for consistency with other drivers. Link: https://lore.kernel.org/r/20220420065832.14173-1-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Lorenzo Pieralisi Acked-by: Daire McNamara commit e64e9ad267ca22ee3db6f9d7a02dc8400a23d4c8 Author: 周琰杰 (Zhou Yanjie) Date: Sat Apr 23 22:38:43 2022 +0800 spi: ingenic: Add support for use GPIO as chip select line. Add support for using GPIOs as chip select lines on Ingenic SoCs. Signed-off-by: 周琰杰 (Zhou Yanjie) Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/1650724725-93758-2-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Mark Brown commit 6963569103c02b22076da245b19bd081d8da8f9e Author: Krzysztof Kozlowski Date: Mon Apr 25 09:24:55 2022 +0200 regulator: richtek,rt4801: parse GPIOs per regulator Having one enable-gpios property for all regulators is discouraged and instead, similarly to regulator core ena_gpiod feature, each GPIO should be present in each regulator node. Add support for parsing such GPIOs, keeping backwards compatibility. Signed-off-by: Krzysztof Kozlowski Tested-by: ChiYuan Huang Link: https://lore.kernel.org/r/20220425072455.27356-3-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit a498db69dc6d7511d76a4f04ec19c5e378db1c3b Author: Krzysztof Kozlowski Date: Mon Apr 25 09:24:54 2022 +0200 regulator: dt-bindings: richtek,rt4801: use existing ena_gpiod feature The binding and driver duplicated regulator core feature of controlling regulators with GPIOs (of_parse_cb + ena_gpiod) and created its own enable-gpios property with multiple GPIOs. This is a less preferred way, because enable-gpios should enable only one element, not multiple. It also duplicates existing solution. Deprecate the original 'enable-gpios' and add per-regulator property. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220425072455.27356-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit d640947562cea6158df13fe021b0e117865ba8b3 Author: Jeongtae Park Date: Mon Apr 25 20:46:11 2022 +0900 regmap: cache: set max_register with reg_stride Current logic does not consider multi-stride cases, the max_register have to calculate with reg_stride because it is a kind of address range. Signed-off-by: Jeongtae Park Link: https://lore.kernel.org/r/20220425114613.15934-1-jtp.park@samsung.com Signed-off-by: Mark Brown commit e5737cceeee5c085f6f4ea76ae99e67e4ca1bdd5 Author: Minghao Chi Date: Thu Apr 14 08:53:10 2022 +0000 ASoC: img-i2s-in: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220414085310.2541546-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 9470aa1c46098587270ff34c112d670b58ff5d34 Author: Minghao Chi Date: Wed Apr 20 03:02:46 2022 +0000 ASoC: img-parallel-out: using pm_runtime_resume_and_get Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220420030246.2575629-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 4d9596d42152bfd4a57cc317acf9cd0b90769033 Author: Judy Hsiao Date: Tue Apr 19 14:29:52 2022 +0800 ASoC: qcom: Use MCLK as RT5682I-VS sysclk source Both MCLK and BCLK can be the clock source of sysclk via PLL according to its datasheet. This patch sets MCLK as the clock source as we use MCLK in the previous projects. Fixes: c5198db82d4c ("ASoC: qcom: Add driver support for ALC5682I-VS") Signed-off-by: Judy Hsiao Link: https://lore.kernel.org/r/20220419062952.356017-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 666b0cad75dc9517100295aed590aef2ff9a73d1 Author: Haowen Bai Date: Thu Apr 21 10:45:20 2022 +0800 ASoC: imx-hdmi: remove useless null check before call of_node_put() No need to add null check before call of_node_put(), since the implementation of of_node_put() has done it. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650509120-25377-1-git-send-email-baihaowen@meizu.com Signed-off-by: Mark Brown commit 5755d0f63c677b8b63b82dceacd26d96617e3ba8 Author: Amadeusz Sławiński Date: Mon Apr 25 11:16:46 2022 +0200 ASoC: Intel: avs: Depend on SND_INTEL_DSP_CONFIG In order to enable NHLT support one must select SND_INTEL_DSP_CONFIG, which will select SND_INTEL_NHLT. Otherwise the file containing NHLT code doesn't get build leading to errors when linking. Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type") Reported-by: kernel test robot Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220425091646.545216-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 47a1886a610aca6a55c18ee677f9176e73162e97 Author: Amadeusz Sławiński Date: Mon Apr 25 11:16:45 2022 +0200 ASoC: Intel: avs: Enable AVS driver only on x86 platforms Only supported platform for AVS are x86 machines, so there is no reason for it to be enabled on other architectures. Allow exception for compile tests. Fixes: 274d79e51875 ("ASoC: Intel: avs: Configure modules according to their type") Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20220425091646.545216-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit b1d1b02594d4599f0d3d5558ba9606a69df6381b Author: Minghao Chi Date: Wed Apr 20 03:04:39 2022 +0000 ASoC: img-spdif-out: using pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220420030439.2575817-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 6eaaf9bd9b4e3125779b292abd1c00b5baea67dc Author: Minghao Chi Date: Tue Apr 19 11:07:18 2022 +0000 ASoC: img-spdif-in: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220419110718.2574674-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 430c3500995484962bdbccf358201afef8055535 Author: Richard Fitzgerald Date: Mon Apr 25 10:51:59 2022 +0100 firmware: cirrus: cs_dsp: Avoid padding bytes in cs_dsp_coeff_ctl Change the order of members in struct cs_dsp_coeff_ctl to avoid the compiler having to insert alignment padding bytes. On a x86_64 build this saves 16 bytes per control. - Pointers are collected to the top of the struct (with the exception of priv, as noted below), so that they are inherently aligned. - The set and enable bitflags are placed together so they can be merged. - priv is placed at the end of the struct - it is for use by the client so it is helpful to make it stand out, and since the compiler will always pad the struct size to an alignment multiple putting a pointer last won't introduce any more padding. - struct cs_dsp_alg_region is placed at the end, right before priv, for the same reasoning as priv. Signed-off-by: Richard Fitzgerald Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/20220425095159.3044527-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit cc691ba94cf8d6c586076ed489bb9d385a2650ad Author: Biju Das Date: Sat Apr 23 17:44:43 2022 +0100 ASoC: sh: Make SND_SOC_RZ depend on ARCH_RZG2L The SSI block is identical on Renesas RZ/G2L, RZ/G2UL and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G043, ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220423164443.146299-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit d05040741afef6eb5d4366de7d5b62f700958787 Author: Minghao Chi Date: Wed Apr 20 03:04:02 2022 +0000 ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220420030402.2575755-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 988e6870c86cce7999f55133197fddfe7e2795d2 Author: Stephen Kitt Date: Fri Apr 15 18:06:12 2022 +0200 ASoC: tlv320*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. In the context of an i2c probe, i2c_match_id with the module id table and the probed client never returns null, so removing the null check on the i2c_device_id pointer is safe. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang, except where the existing code already had a declaration for the of_device_id table. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-7-steve@sk2.org Signed-off-by: Mark Brown commit 55116b39e5e1c2d0fd1a77e9f46ce8437623e0e8 Author: Stephen Kitt Date: Fri Apr 15 18:06:11 2022 +0200 ASoC: tas*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang, except where the existing code already had a declaration for the of_device_id table. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-6-steve@sk2.org Signed-off-by: Mark Brown commit 3577a8a0ac5b9aaf22ff4fa6a9670cf85351ae50 Author: Stephen Kitt Date: Fri Apr 15 18:06:10 2022 +0200 ASoC: pcm186x: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id table is moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-5-steve@sk2.org Signed-off-by: Mark Brown commit 4ac8ebb6cc28cbd99e10d7a4772be1c4da5af130 Author: Stephen Kitt Date: Fri Apr 15 18:06:09 2022 +0200 ASoC: max980*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. In the context of an i2c probe, i2c_match_id with the module id table and the probed client never returns null, so removing the null check on the i2c_device_id pointer is safe. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-4-steve@sk2.org Signed-off-by: Mark Brown commit 9d8f2edd3d7d11c9f1fc978e36219b3178af13bc Author: Stephen Kitt Date: Fri Apr 15 18:06:08 2022 +0200 ASoC: alc56*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. The i2c id tables are moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-3-steve@sk2.org Signed-off-by: Mark Brown commit e654a1331f68550f4c7c85b13b2bdb3c2502a9af Author: Stephen Kitt Date: Fri Apr 15 18:06:07 2022 +0200 ASoC: ak*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220415160613.148882-2-steve@sk2.org Signed-off-by: Mark Brown commit 19faf9ee06224c5db669539a10eae7c63f52f2e6 Author: Peter Ujfalusi Date: Thu Apr 21 11:07:35 2022 +0300 ASoC: SOF: loader: Remove the old fw_ready related code The fw_ready is handled internally to ipc3, we can remove the old code from the loader.c along with the functions only used by the fw_ready() Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0fc88b5d42c646ecf4040f65c0f22cb9df42e69a Author: Peter Ujfalusi Date: Thu Apr 21 11:07:34 2022 +0300 ASoC: SOF: Intel: Do not set fw_ready callback The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b5054161ebd168894b5a1d9d7eb97cd58dcbbb7f Author: Peter Ujfalusi Date: Thu Apr 21 11:07:33 2022 +0300 ASoC: SOF: imx: Do not set fw_ready callback The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 473dd4ea340c237e59d0c4d1973cf129a1bae504 Author: Peter Ujfalusi Date: Thu Apr 21 11:07:32 2022 +0300 ASoC: SOF: amd: Do not set fw_ready callback The fw_ready is handled internally to ipc3 and the callback no longer in use. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit cf64b67eebc222c9388adddc0038f9a59cb9511c Author: Peter Ujfalusi Date: Thu Apr 21 11:07:31 2022 +0300 ASoC: SOF: Do not check for the fw_ready callback The fw_ready is handled internally to ipc3, the callback no longer in use and it is going to be removed. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b641fb7e019214d3fa2f44c3e562ba388e2a3933 Author: Peter Ujfalusi Date: Thu Apr 21 11:07:30 2022 +0300 ASoC: SOF: ipc3: Add local implementation for handling fw_ready message The handling of fw_ready is IPC3 specific, move the needed code from the loader.c to ipc3.c and stop using the sof_ops(sdev)->fw_ready() callback. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Pandey Reviewed-by: Daniel Baluta Link: https://lore.kernel.org/r/20220421080735.31698-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c4eb48f7739fc0dae7e6b8319a77261fc1b61d74 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:32:01 2022 -0500 ASoC: SOF: Intel: hda-dai: protect hw_params against successive calls Once we've set-up the HDA stream and its format, we currently don't support additional format changes. We already have a protection in the .prepare case, but this needs to be added in the hw_params too. In mixing use cases where two DPCM FEs are connected to the same BE, if can happen that there are multiple calls to the BE hw_params when the two FEs are configured simultaneously. This could alternatively be fixed at the DPCM level but that's a more intrusive change requiring infrastructure changes: this would need to be paired with the definition of fixed hw_params at the mixer level. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 880924cad12e96092364467cb7b3ad7a689bec55 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:32:00 2022 -0500 ASoC: SOF: Intel: add helper for link DMA cleanups We do the same operations from different places, add a helper to enforce consistency and make the programming sequences clearer. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 722cbbfaed2a290b1de1fb0ec4ee9a15ec240f7c Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:59 2022 -0500 ASoC: SOF: Intel: hda-dai: reset dma_data and release stream The sequences are missing a call to snd_soc_dai_set_dma_data() when the stream is cleared, as well as a release of the stream, and tests to avoid pointer dereferences. This fixes an underflow issue in a corner case with two streams paused before a suspend-resume cycle. After resume, the pause_release of the last stream causes an underflow due to an invalid sequence. This problem probably existed since the beginning and is only see with prototypes of a 'deep-buffer' capability, which depends on additional ASoC fixes, so there's is no Fixes: tag and no real requirement to backport this patch. BugLink: https://github.com/thesofproject/linux/issues/3151 Co-developed-by: Ranjani Sridharan Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 23b1944e46ab4cd7cbd4ef999f814fc6c6f2eb88 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:58 2022 -0500 ASoC: SOF: Intel: hda-dai: improve suspend case Add comments and re-align with the TRIGGER_SUSPEND case with an additional call to hda_dai_hw_free_ipc() to free-up resources. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f09e92844eabd6a65feab0c548a7cf6741cfa39d Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:57 2022 -0500 ASoC: SOF: Intel: hda-dai: move code to deal with hda dai/dailink suspend The location of the code was not optimal and prevents us from using helpers, let's move it to hda-dai.c. No functionality change in this patch. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 81622503229943363858cd7ae1330f49b131dfbc Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:56 2022 -0500 ASOC: SOF: Intel: hda-dai: add hda_dai_hw_free_ipc() helper We do the same thing from different places, let's use a helper. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d1c73a213b462058e91654b5d1d493b3003375cd Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:55 2022 -0500 ASoC: SOF: sof-audio: flag errors on pipeline teardown Before suspending, walk through all the widgets to make sure all refcounts are zero. If not, the resume will not work and random errors will be reported. Adding this paranoia check will help identify leaks and broken sequences. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9272d6c2af6427df8d7fe665ede6a1bf97d0ca8c Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:54 2022 -0500 ASoC: SOF: Intel: hda-dai: regroup dai and link DMA operations Just code move with no functionality change, to clearly separate out the 'dai' operation from the link DMA ones. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f321ffc8d93639181af0512938e2b0630ca28051 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:53 2022 -0500 ASoC: SOF: Intel: hda-dai: split link DMA and dai operations The link DMA state management is handled completely on the host side, while the DAI operations require an IPC. Split the first part in dedicated helpers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5ef85c9e42e5fc549e934669fdca352b3da97ec4 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:52 2022 -0500 ASoC: SOF: Intel: hda-dai: use snd_soc_dai_get_widget() helper Use helper instead of open-coding the same thing multiple times. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b44c99f11de2c9f01b5526e668c476de976fd14d Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:51 2022 -0500 ASoC: SOF: Intel: hda-dai: simplify hda_dai_widget_update() prototype the argument "struct sof_intel_hda_stream *hda_stream" is not used, remove. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 309e6e557482415c32338b118f0eb17600d98060 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:31:50 2022 -0500 ASOC: SOF: Intel: hda-dai: consistent naming for HDA DAI and HDA link DMA The Intel documentation refers to the concepts of 'HDAudio host DMA' (system memory <--> DSP) and 'HDaudio link DMA' (DSP <--> peripherals). We currently use the prefix 'hda_link' to describe DAI operations, which can be confused for dailink operations. Since the topology tokens refer unambiguously to the 'HDA' dai, let's drop the link prefix for dai-related ops/callbacks. Conversely let's use 'hda_link_dma' for routines related to the DMA management. In a follow-up patch we will introduce the 'hda_dai_link' prefix for dailink ops/callbacks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421203201.1550328-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 51ec71dc0cc90e6683ebda7f5ea0ddb71265ab23 Author: Ranjani Sridharan Date: Thu Apr 21 15:31:49 2022 -0500 ASoC: SOF: Intel: Add IPC-specific dai ops for IPC3 The BE DAI driver ops involve operations that are IPC-specific. For ex: for the HDA DAI, the trigger op involves sending the DAI_CONFIG IPC to the DSP to stop the DMA for the stop/pause commands. This sequence is different for IPC3 and IPC4. So, make the dai driver ops IPC-specific and set the IPC3-specific ops during the ops_init() callback. Reviewed-by: Rander Wang Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421203201.1550328-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8e84b6a4e7f188638748d2ac0455a94799530aa1 Author: Ranjani Sridharan Date: Thu Apr 21 15:31:48 2022 -0500 ASoC: SOF: remove incorrect clearing of prepared flag When the system is suspended while a PCM is paused, it doesn't receive the SUSPEND trigger. So, the SOF driver has to ensure that the PCM and the widgets associated with the paused PCM are freed in the firmware during suspend. This is handled in the sof_tear_down_left_over_pipelines() call. But since the state of this PCM is SUSPENDED, we end up clearing the prepared flag for the PCM before freeing it. This results in IPC errors while freeing the widgets. But because the widget use_counts are reset to 0 even though the IPC fails, releasing the paused stream after resuming from suspend proceeds normally. Fix the IPC errors by removing the clearing of the prepared flag in sof_set_hw_params_upon_resume(). In fact, we can remove the sof_set_hw_params_upon_resume() and call snd_sof_dsp_hw_params_upon_resume() directly. This will ensure that the PCM is freed in the firmware before the IPC's for freeing the widgets are sent. BugLink: https://github.com/thesofproject/linux/issues/3543 Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421203201.1550328-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5349c0c93d15dff27d99fec12fc82040fab340bd Author: Richard Fitzgerald Date: Mon Apr 25 13:50:12 2022 +0100 ASoC: soc.h: Add SOC_SINGLE_S_EXT_TLV macro Add a SOC_SINGLE_S_EXT_TLV macro as a convenience wrapper around SOC_DOUBLE_R_S_EXT_TLV for mono volume controls. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220425125012.3044919-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit cf51406ccb083941102fc101718d4c0a25b17917 Author: Simon Trimmer Date: Mon Apr 25 13:50:11 2022 +0100 ASoC: soc.h: Introduce SOC_DOUBLE_R_S_EXT_TLV() macro A straightforward extension of the SOC_DOUBLE_R_S_TLV() macro that allows the get and put functions to be customised. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220425125012.3044919-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 62c1256d544747b38e77ca9b5bfe3a26f9592576 Author: Nicholas Piggin Date: Sat Apr 23 00:14:46 2022 +1000 timers/nohz: Switch to ONESHOT_STOPPED in the low-res handler when the tick is stopped When tick_nohz_stop_tick() stops the tick and high resolution timers are disabled, then the clock event device is not put into ONESHOT_STOPPED mode. This can lead to spurious timer interrupts with some clock event device drivers that don't shut down entirely after firing. Eliminate these by putting the device into ONESHOT_STOPPED mode at points where it is not being reprogrammed. When there are no timers active, then tick_program_event() with KTIME_MAX can be used to stop the device. When there is a timer active, the device can be stopped at the next tick (any new timer added by timers will reprogram the tick). Signed-off-by: Nicholas Piggin Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220422141446.915024-1-npiggin@gmail.com commit 5f9d3bd520261fd7a850818c71809fd580e0f30c Author: Amir Goldstein Date: Fri Apr 22 15:03:27 2022 +0300 fanotify: enable "evictable" inode marks Now that the direct reclaim path is handled we can enable evictable inode marks. Link: https://lore.kernel.org/r/20220422120327.3459282-17-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit e79719a2ca5c61912c0493bc1367db52759cf6fd Author: Amir Goldstein Date: Fri Apr 22 15:03:26 2022 +0300 fanotify: use fsnotify group lock helpers Direct reclaim from fanotify mark allocation context may try to evict inodes with evictable marks of the same group and hit this deadlock: [<0>] fsnotify_destroy_mark+0x1f/0x3a [<0>] fsnotify_destroy_marks+0x71/0xd9 [<0>] __destroy_inode+0x24/0x7e [<0>] destroy_inode+0x2c/0x67 [<0>] dispose_list+0x49/0x68 [<0>] prune_icache_sb+0x5b/0x79 [<0>] super_cache_scan+0x11c/0x16f [<0>] shrink_slab.constprop.0+0x23e/0x40f [<0>] shrink_node+0x218/0x3e7 [<0>] do_try_to_free_pages+0x12a/0x2d2 [<0>] try_to_free_pages+0x166/0x242 [<0>] __alloc_pages_slowpath.constprop.0+0x30c/0x903 [<0>] __alloc_pages+0xeb/0x1c7 [<0>] cache_grow_begin+0x6f/0x31e [<0>] fallback_alloc+0xe0/0x12d [<0>] ____cache_alloc_node+0x15a/0x17e [<0>] kmem_cache_alloc_trace+0xa1/0x143 [<0>] fanotify_add_mark+0xd5/0x2b2 [<0>] do_fanotify_mark+0x566/0x5eb [<0>] __x64_sys_fanotify_mark+0x21/0x24 [<0>] do_syscall_64+0x6d/0x80 [<0>] entry_SYSCALL_64_after_hwframe+0x44/0xae Set the FSNOTIFY_GROUP_NOFS flag to prevent going into direct reclaim from allocations under fanotify group lock and use the safe group lock helpers. Link: https://lore.kernel.org/r/20220422120327.3459282-16-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 7d5e005d982527e4029b0139823d179986e34cdc Author: Amir Goldstein Date: Fri Apr 22 15:03:25 2022 +0300 fanotify: implement "evictable" inode marks When an inode mark is created with flag FAN_MARK_EVICTABLE, it will not pin the marked inode to inode cache, so when inode is evicted from cache due to memory pressure, the mark will be lost. When an inode mark with flag FAN_MARK_EVICATBLE is updated without using this flag, the marked inode is pinned to inode cache. When an inode mark is updated with flag FAN_MARK_EVICTABLE but an existing mark already has the inode pinned, the mark update fails with error EEXIST. Evictable inode marks can be used to setup inode marks with ignored mask to suppress events from uninteresting files or directories in a lazy manner, upon receiving the first event, without having to iterate all the uninteresting files or directories before hand. The evictbale inode mark feature allows performing this lazy marks setup without exhausting the system memory with pinned inodes. This change does not enable the feature yet. Link: https://lore.kernel.org/linux-fsdevel/CAOQ4uxiRDpuS=2uA6+ZUM7yG9vVU-u212tkunBmSnP_u=mkv=Q@mail.gmail.com/ Link: https://lore.kernel.org/r/20220422120327.3459282-15-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 8998d110835e3781ccd3f1ae061a590b4aaba911 Author: Amir Goldstein Date: Fri Apr 22 15:03:24 2022 +0300 fanotify: factor out helper fanotify_mark_update_flags() Handle FAN_MARK_IGNORED_SURV_MODIFY flag change in a helper that is called after updating the mark mask. Replace the added and removed return values and help variables with bool recalc return values and help variable, which makes the code a bit easier to follow. Rename flags argument to fan_flags to emphasize the difference from mark->flags. Link: https://lore.kernel.org/r/20220422120327.3459282-14-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 4adce25ccfff215939ee465b8c0aa70526d5c352 Author: Amir Goldstein Date: Fri Apr 22 15:03:23 2022 +0300 fanotify: create helper fanotify_mark_user_flags() To translate from fsnotify mark flags to user visible flags. Link: https://lore.kernel.org/r/20220422120327.3459282-13-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit c3638b5b13740fa31762d414bbce8b7a694e582a Author: Amir Goldstein Date: Fri Apr 22 15:03:22 2022 +0300 fsnotify: allow adding an inode mark without pinning inode fsnotify_add_mark() and variants implicitly take a reference on inode when attaching a mark to an inode. Make that behavior opt-out with the mark flag FSNOTIFY_MARK_FLAG_NO_IREF. Instead of taking the inode reference when attaching connector to inode and dropping the inode reference when detaching connector from inode, take the inode reference on attach of the first mark that wants to hold an inode reference and drop the inode reference on detach of the last mark that wants to hold an inode reference. Backends can "upgrade" an existing mark to take an inode reference, but cannot "downgrade" a mark with inode reference to release the refernce. This leaves the choice to the backend whether or not to pin the inode when adding an inode mark. This is intended to be used when adding a mark with ignored mask that is used for optimization in cases where group can afford getting unneeded events and reinstate the mark with ignored mask when inode is accessed again after being evicted. Link: https://lore.kernel.org/r/20220422120327.3459282-12-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit aabb45fdcb31f00f1e7cae2bce83e83474a87c03 Author: Amir Goldstein Date: Fri Apr 22 15:03:21 2022 +0300 dnotify: use fsnotify group lock helpers Before commit 9542e6a643fc6 ("nfsd: Containerise filecache laundrette") nfsd would close open files in direct reclaim context. There is no guarantee that others memory shrinkers don't do the same and no guarantee that future shrinkers won't do that. For example, if overlayfs implements inode cache of fscache would keep open files to cached objects, inode shrinkers could end up closing open files to underlying fs. Direct reclaim from dnotify mark allocation context may try to close open files that have dnotify marks of the same group and hit a deadlock on mark_mutex. Set the FSNOTIFY_GROUP_NOFS flag to prevent going into direct reclaim from allocations under dnotify group lock and use the safe group lock helpers. Link: https://lore.kernel.org/r/20220422120327.3459282-11-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit b8962a9d8cc2d8c93362e2f684091c79f702f6f3 Author: Amir Goldstein Date: Fri Apr 22 15:03:20 2022 +0300 nfsd: use fsnotify group lock helpers Before commit 9542e6a643fc6 ("nfsd: Containerise filecache laundrette") nfsd would close open files in direct reclaim context and that could cause a deadlock when fsnotify mark allocation went into direct reclaim and nfsd shrinker tried to free existing fsnotify marks. To avoid issues like this in future code, set the FSNOTIFY_GROUP_NOFS flag on nfsd fsnotify group to prevent going into direct reclaim from fsnotify_add_inode_mark(). Link: https://lore.kernel.org/r/20220422120327.3459282-10-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 960bdff24ce802e38df918ebfcbfa62744d6ae22 Author: Amir Goldstein Date: Fri Apr 22 15:03:19 2022 +0300 audit: use fsnotify group lock helpers audit inode marks pin the inode so there is no need to set the FSNOTIFY_GROUP_NOFS flag. Link: https://lore.kernel.org/r/20220422120327.3459282-9-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 642054b87058019be36033f73c3e48ffff1915aa Author: Amir Goldstein Date: Fri Apr 22 15:03:18 2022 +0300 inotify: use fsnotify group lock helpers inotify inode marks pin the inode so there is no need to set the FSNOTIFY_GROUP_NOFS flag. Link: https://lore.kernel.org/r/20220422120327.3459282-8-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 43b245a788e2d8f1bb742668a9bdace02fcb3e96 Author: Amir Goldstein Date: Fri Apr 22 15:03:17 2022 +0300 fsnotify: create helpers for group mark_mutex lock Create helpers to take and release the group mark_mutex lock. Define a flag FSNOTIFY_GROUP_NOFS in fsnotify_group that determines if the mark_mutex lock is fs reclaim safe or not. If not safe, the lock helpers take the lock and disable direct fs reclaim. In that case we annotate the mutex with a different lockdep class to express to lockdep that an allocation of mark of an fs reclaim safe group may take the group lock of another "NOFS" group to evict inodes. For now, converted only the callers in common code and no backend defines the NOFS flag. It is intended to be set by fanotify for evictable marks support. Link: https://lore.kernel.org/r/20220422120327.3459282-7-amir73il@gmail.com Suggested-by: Jan Kara Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit f3010343d9e119da35ee864b3a28993bb5c78ed7 Author: Amir Goldstein Date: Fri Apr 22 15:03:16 2022 +0300 fsnotify: make allow_dups a property of the group Instead of passing the allow_dups argument to fsnotify_add_mark() as an argument, define the group flag FSNOTIFY_GROUP_DUPS to express the allow_dups behavior and set this behavior at group creation time for all calls of fsnotify_add_mark(). Rename the allow_dups argument to generic add_flags argument for future use. Link: https://lore.kernel.org/r/20220422120327.3459282-6-amir73il@gmail.com Suggested-by: Jan Kara Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 867a448d587e7fa845bceaf4ee1c632448f2a9fa Author: Amir Goldstein Date: Fri Apr 22 15:03:15 2022 +0300 fsnotify: pass flags argument to fsnotify_alloc_group() Add flags argument to fsnotify_alloc_group(), define and use the flag FSNOTIFY_GROUP_USER in inotify and fanotify instead of the helper fsnotify_alloc_user_group() to indicate user allocation. Although the flag FSNOTIFY_GROUP_USER is currently not used after group allocation, we store the flags argument in the group struct for future use of other group flags. Link: https://lore.kernel.org/r/20220422120327.3459282-5-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 623af4f538b5df9b416e1b82f720af7371b4c771 Author: Amir Goldstein Date: Fri Apr 22 15:03:14 2022 +0300 fsnotify: fix wrong lockdep annotations Commit 6960b0d909cd ("fsnotify: change locking order") changed some of the mark_mutex locks in direct reclaim path to use: mutex_lock_nested(&group->mark_mutex, SINGLE_DEPTH_NESTING); This change is explained: "...It uses nested locking to avoid deadlock in case we do the final iput() on an inode which still holds marks and thus would take the mutex again when calling fsnotify_inode_delete() in destroy_inode()." The problem is that the mutex_lock_nested() is not a nested lock at all. In fact, it has the opposite effect of preventing lockdep from warning about a very possible deadlock. Due to these wrong annotations, a deadlock that was introduced with nfsd filecache in kernel v5.4 went unnoticed in v5.4.y for over two years until it was reported recently by Khazhismel Kumykov, only to find out that the deadlock was already fixed in kernel v5.5. Fix the wrong lockdep annotations. Cc: Khazhismel Kumykov Fixes: 6960b0d909cd ("fsnotify: change locking order") Link: https://lore.kernel.org/r/20220321112310.vpr7oxro2xkz5llh@quack3.lan/ Link: https://lore.kernel.org/r/20220422120327.3459282-4-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 38035c04f5865c4ef9597d6beed6a7178f90f64a Author: Amir Goldstein Date: Fri Apr 22 15:03:13 2022 +0300 inotify: move control flags from mask to mark flags The inotify control flags in the mark mask (e.g. FS_IN_ONE_SHOT) are not relevant to object interest mask, so move them to the mark flags. This frees up some bits in the object interest mask. Link: https://lore.kernel.org/r/20220422120327.3459282-3-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit a32e697cda27679a0327ae2cafdad8c7170f548f Author: Amir Goldstein Date: Fri Apr 22 15:03:12 2022 +0300 inotify: show inotify mask flags in proc fdinfo The inotify mask flags IN_ONESHOT and IN_EXCL_UNLINK are not "internal to kernel" and should be exposed in procfs fdinfo so CRIU can restore them. Fixes: 6933599697c9 ("inotify: hide internal kernel bits from fdinfo") Link: https://lore.kernel.org/r/20220422120327.3459282-2-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 68d57a07bfe5bb29b80cd8b8fa24c9d1ea104124 Author: Srinivasan Raju Date: Thu Feb 24 18:20:07 2022 +0000 wireless: add plfxlc driver for pureLiFi X, XL, XC devices This is a driver for pureLiFi X, XL, XC devices which use light to transmit data, so they are not compatible with normal Wi-Fi devices. The driver uses separate NL80211_BAND_LC band to distinguish from Wi-Fi. The driver is based on 802.11 softMAC Architecture and uses native 802.11 for configuration and management. Station and Ad-Hoc modes are supported. The driver is compiled and tested in ARM, x86 architectures and compiled in powerpc architecture. This driver implementation has been based on the zd1211rw driver. Signed-off-by: Srinivasan Raju Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220224182042.132466-3-srini.raju@purelifi.com commit a96e4ebf3dedaf110999189939cd0272d32c4296 Author: Geert Uytterhoeven Date: Mon Apr 4 12:11:46 2022 +0200 m68k: defconfig: Update defconfigs for v5.18-rc1 - Drop CONFIG_BINFMT_AOUT=m (no longer available since commit 19e8b701e258701b ("a.out: Stop building a.out/osf1 support on alpha and m68k")), - Enable modular build of the SM3 digest algorithm (no longer auto-selected since commit 114004696bf23499 ("crypto: sm2 - make dependent on sm3 library")), - Drop CONFIG_CRC64=m (auto-selected since commit a7d4383f17e10f33 ("block: add pi for extended integrity")), - Drop CONFIG_TEST_OVERFLOW=m (replaced by auto-modular CONFIG_OVERFLOW_KUNIT_TEST in commit 617f55e20743fc50 ("lib: overflow: Convert to Kunit")), - Drop CONFIG_TEST_STACKINIT=m (replaced by auto-modular CONFIG_STACKINIT_KUNIT_TEST in commit 02788ebcf521fe78 ("lib: stackinit: Convert to KUnit")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2ca38d8de70fc9fad5ad17fb81d04736effa181d.1649066720.git.geert@linux-m68k.org commit 9a07731702d9e5787770f44d2be0c15742f27e39 Author: Ilya Leoshkevich Date: Tue Apr 19 17:40:29 2022 +0200 s390: add KCSAN instrumentation to barriers and spinlocks test_barrier fails on s390 because of the missing KCSAN instrumentation for several synchronization primitives. Add it to barriers by defining __mb(), __rmb(), __wmb(), __dma_rmb() and __dma_wmb(), and letting the common code in asm-generic/barrier.h do the rest. Spinlocks require instrumentation only on the unlock path; notify KCSAN that the CPU cannot move memory accesses outside of the spin lock. In reality it also cannot move stores inside of it, but this is not important and can be omitted. Reported-by: Tobias Huschle Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens commit 34fb0e703480a65754e1f8289d754dfc953ba8d4 Author: Niklas Schnelle Date: Fri Feb 25 09:45:24 2022 +0100 s390/pci: add error record for CC 2 retries Currently it is not detectable from within Linux when PCI instructions are retried because of a busy condition. Detecting such conditions and especially how long they lasted can however be quite useful in problem determination. This patch enables this by adding an s390dbf error log when a CC 2 is first encountered as well as after the retried instruction. Despite being unlikely it may be possible that these added debug messages drown out important other messages so allow setting the debug level in zpci_err_insn*() and set their level to 1 so they can be filtered out if need be. Reviewed-by: Matthew Rosato Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit cde8833e40dddd6e0f067f43b2734a1ad4495065 Author: Niklas Schnelle Date: Thu Feb 24 15:45:33 2022 +0100 s390/pci: add PCI access type and length to error records Currently when a PCI instruction returns a non-zero condition code it can be very hard to tell from the s390dbf logs what kind of instruction was executed. In case of PCI memory I/O (MIO) instructions it is even impossible to tell if we attempted a load, store or block store or how large the access was because only the address is logged. Improve this by adding an indicator byte for the instruction type to the error record and also store the length of the access for MIO instructions where this can not be deduced from the request. We use the following indicator values: - 'l': PCI load - 's': PCI store - 'b': PCI store block - 'L': PCI load (MIO) - 'S': PCI store (MIO) - 'B': PCI store block (MIO) - 'M': MPCIFC - 'R': RPCIT Reviewed-by: Matthew Rosato Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 723b5a9d2bb0f759c41c3cc41f7fd89a0d8278e5 Author: Niklas Schnelle Date: Fri Apr 1 14:04:14 2022 +0200 s390/pci: don't log availability events as errors Availability events are logged in s390dbf in s390dbf/pci_error/hex_ascii even though they don't indicate an error condition. They have also become redundant as commit 6526a597a2e85 ("s390/pci: add simpler s390dbf traces for events") added an s390dbf/pci_msg/sprintf log entry for availability events which contains all non reserved fields of struct zpci_ccdf_avail. On the other hand the availability entries in the error log make it easy to miss actual errors and may even overwrite error entries if the message buffer wraps. Thus simply remove the availability events from the error log thereby establishing the rule that any content in s390dbf/pci_error indicates some kind of error. Reviewed-by: Matthew Rosato Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 52c79e636a58da6650cec632e5e6d46467feefcb Author: Niklas Schnelle Date: Fri Mar 18 16:25:31 2022 +0100 s390/pci: make better use of zpci_dbg() levels While the zpci_dbg() macro offers a level parameter this is currently largely unused. The only instance with higher importance than 3 is the UID checking change debug message which is not actually more important as the UID uniqueness guarantee is already exposed in sysfs so this should rather be 3 as well. On the other hand the "add ..." message which shows what devices are visible at the lowest level is essential during problem determination. By setting its level to 1, lowering the debug level can act as a filter to only show the available functions. On the error side the default level is set to 6 while all existing messages are printed at level 0. This is inconsistent and means there is no room for having messages be invisible on the default level so instead set the default level to 3 like for errors matching the default for debug messages. Reviewed-by: Matthew Rosato Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit d4b2945dc9c05a1b24282f4c6b2f41a2a52d18dd Author: Thomas Huth Date: Wed Apr 13 11:44:16 2022 +0200 s390/vfio-ap: remove superfluous MODULE_DEVICE_TABLE declaration The vfio_ap module tries to register for the vfio_ap bus - but that's the interface that it provides itself, so this does not make much sense, thus let's simply drop this statement now. Signed-off-by: Thomas Huth Reviewed-by: Tony Krowiak Link: https://lore.kernel.org/r/20220413094416.412114-1-thuth@redhat.com Signed-off-by: Heiko Carstens commit 41cd81abafdc4e58a93fcb677712a76885e3ca25 Author: Sven Schnelle Date: Wed Apr 6 09:17:21 2022 +0200 s390/vdso: add vdso randomization Randomize the address of vdso if randomize_va_space is enabled. Note that this keeps the vdso address on the same PMD as the stack to avoid allocating an extra page table just for vdso. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 9e37a2e8546f9e48ea76c839116fa5174d14e033 Author: Sven Schnelle Date: Wed Apr 6 08:44:49 2022 +0200 s390/vdso: map vdso above stack In the current code vdso is mapped below the stack. This is problematic when programs mapped to the top of the address space are allocating a lot of memory, because the heap will clash with the vdso. To avoid this map the vdso above the stack and move STACK_TOP so that it all fits into three level paging. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 57761da4dc5cd60bed2c81ba0edb7495c3c740b8 Author: Sven Schnelle Date: Wed Apr 6 08:35:26 2022 +0200 s390/vdso: move vdso mapping to its own function This is a preparation patch for adding vdso randomization to s390. It adds a function vdso_size(), which will be used later in calculating the STACK_TOP value. It also moves the vdso mapping into a new function vdso_map(), to keep the code similar to other architectures. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit f2f47d0ef72c30622e62471903ea19446ea79ee2 Author: Sven Schnelle Date: Wed Apr 6 08:01:24 2022 +0200 s390/mmap: increase stack/mmap gap to 128MB This basically reverts commit 9e78a13bfb16 ("[S390] reduce miminum gap between stack and mmap_base"). 32MB is not enough space between stack and mmap for some programs. Given that compat task aren't common these days, lets revert back to 128MB. Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 2004b57cde6b21170d058244b53043105d89f83f Author: Harald Freudenberger Date: Mon Apr 4 17:12:37 2022 +0200 s390/zcrypt: code cleanup This patch tries to fix as much as possible of the checkpatch.pl --strict findings: CHECK: Logical continuations should be on the previous line CHECK: No space is necessary after a cast CHECK: Alignment should match open parenthesis CHECK: 'useable' may be misspelled - perhaps 'usable'? WARNING: Possible repeated word: 'is' CHECK: spaces preferred around that '*' (ctx:VxV) CHECK: Comparison to NULL could be written "!msg" CHECK: Prefer kzalloc(sizeof(*zc)...) over kzalloc(sizeof(struct...)...) CHECK: Unnecessary parentheses around resp_type->work CHECK: Avoid CamelCase: There is no functional change comming with this patch, only code cleanup, renaming, whitespaces, indenting, ... but no semantic change in any way. Also the API (zcrypt and pkey header file) is semantically unchanged. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Heiko Carstens commit 6acb086d9f78578992c146746387e136db8b4998 Author: Harald Freudenberger Date: Fri Apr 1 16:59:09 2022 +0200 s390/zcrypt: cleanup CPRB struct definitions This patch does a little cleanup on the CPRBX struct in zcrypt.h and the redundant CPRB struct definition in zcrypt_msgtype6.c. Especially some of the misleading fields from the CPRBX struct have been removed. There is no semantic change coming with this patch. The field names changed in the XCRB struct are only related to reserved fields which should never been used. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Heiko Carstens commit d9b38e9d0fd3be59122af56a299f84c951453598 Author: Harald Freudenberger Date: Wed Mar 23 12:13:32 2022 +0100 s390/ap: uevent on apmask/aqpmask change This patch introduces user space notifications for changes on the apmask or aqmask attributes. So it could be possible to write a udev rule to load/unload the vfio_ap kernel module based on changes of these masks. On chance of the apmask or aqmask an AP change event will be produced with an uevent environment variable showing the new APMASK or AQMASK mask. So a change on the apmask triggers an uvevent like this: KERNEL[490.160396] change /devices/ap (ap) ACTION=change DEVPATH=/devices/ap SUBSYSTEM=ap APMASK=0xffffffdfffffffffffffffffffffffffffffffffffffffffffffffffffffffff SEQNUM=13367 and a change on the aqmask looks like this: KERNEL[283.217642] change /devices/ap (ap) ACTION=change DEVPATH=/devices/ap SUBSYSTEM=ap AQMASK=0xfbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff SEQNUM=13348 Only real changes to the masks are processed - the old and new masks are compared and no action is done if the values are equal (and thus no uevent). The emit of the uevent is the very last action done when a mask change is processed. However, there is no guarantee that all unbind/bind actions caused by the apmask/aqmask changes are completed when the apmask/aqmask change uevent is received in userspace. Signed-off-by: Harald Freudenberger Tested-by: Thomas Huth Reviewed-by: Jürgen Christ Signed-off-by: Heiko Carstens commit 4da75a7fd04295a2623be0916a4748434513a78f Author: Haowen Bai Date: Thu Apr 7 10:16:47 2022 +0800 s390/cio: simplify the calculation of variables Fix the following coccicheck warnings: ./arch/s390/include/asm/scsw.h:695:47-49: WARNING !A || A && B is equivalent to !A || B I apply a readable version just to get rid of a warning. Signed-off-by: Haowen Bai Reviewed-by: Peter Oberparleiter Link: https://lore.kernel.org/r/1649297808-5048-1-git-send-email-baihaowen@meizu.com Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Vasily Gorbik Cc: Sven Schnelle Signed-off-by: Heiko Carstens commit 7714e16f791d948c8bb58aa23bf8ef60b9bba646 Author: Alexander Gordeev Date: Wed Mar 30 19:50:16 2022 +0200 s390/smp: sort out physical vs virtual CPU0 lowcore pointer SPX instruction called from set_prefix() expects physical address of the lowcore to be installed, but instead the virtual address is passed. Note: this does not fix a bug currently, since virtual and physical addresses are identical. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 28d3417a946762bed46815e59627bbd749347906 Author: Harald Freudenberger Date: Thu Mar 24 13:23:53 2022 +0100 s390/zcrypt: add display of ASYM master key verification pattern This patch extends the sysfs attribute mkvps for CCA cards to show the states and master key verification patterns for the old, current and new ASYM master key registers. With this patch now all relevant master key verification patterns related to a CCA HSM are available with the mkvps sysfs attribute. This is a requirement for some exploiters like the kubernetes cex plugin or initrd code needing to verify the master key verification patterns on HSMs before use. A sample output: cat /sys/devices/ap/card04/04.0005/mkvps AES NEW: empty 0x0000000000000000 AES CUR: valid 0xe9a49a58cd039bed AES OLD: valid 0x7d10d17bc8a409c4 APKA NEW: empty 0x0000000000000000 APKA CUR: valid 0x5f2f27aaa2d59b4a APKA OLD: valid 0x82a5e2cd5030d5ec ASYM NEW: empty 0x00000000000000000000000000000000 ASYM CUR: valid 0x650c25a89c27e716d0e692b6c83f10e5 ASYM OLD: valid 0xf8ae2acf8bfc57f0a0957c732c16078b Signed-off-by: Harald Freudenberger Reviewed-by: Jörg Schmidbauer Signed-off-by: Heiko Carstens commit 2ba24343bdb8637135bd0d9b5e249c44bd751670 Author: Alexander Egorenkov Date: Fri Sep 3 11:08:48 2021 +0200 s390/kexec: set end-of-ipl flag in last diag308 call If the facility IPL-complete-control is present then the last diag308 call made by kexec shall set the end-of-ipl flag in the subcode register to signal the hypervisor that this is the last diag308 call made by Linux. Only the diag308 calls made during a regular kexec need to set the end-of-ipl flag, in all other cases the hypervisor will ignore it. Signed-off-by: Alexander Egorenkov Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 1b553839e1326b6a73431e399f575862696be51b Author: Alexander Egorenkov Date: Fri Sep 3 09:39:48 2021 +0200 s390/sclp: add detection of IPL-complete-control facility The presence of the IPL-complete-control facility can be derived from the hypervisor's SCLP info response. Signed-off-by: Alexander Egorenkov Reviewed-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit af2cbc6ef967f61711a3c40fca5366ea0bc7fecc Author: Imre Deak Date: Thu Apr 21 19:22:21 2022 +0300 drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses Fix typo in the _SEL_FETCH_PLANE_BASE_1_B register base address. Fixes: a5523e2ff074a5 ("drm/i915: Add PSR2 selective fetch registers") References: https://gitlab.freedesktop.org/drm/intel/-/issues/5400 Cc: José Roberto de Souza Cc: # v5.9+ Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220421162221.2261895-1-imre.deak@intel.com commit df1cc21152ffb605e2f32e5642891f9b908e3f11 Author: Marcin Wojtas Date: Mon Apr 25 12:11:02 2022 +0200 net: dsa: remove unused headers Reduce a number of included headers to a necessary minimum. Signed-off-by: Marcin Wojtas Signed-off-by: David S. Miller commit b0e653b2a0d99299a9fce1c1ca4393f3173620d4 Author: Yajun Deng Date: Fri Apr 22 14:14:31 2022 +0800 arp: fix unused variable warnning when CONFIG_PROC_FS=n net/ipv4/arp.c:1412:36: warning: unused variable 'arp_seq_ops' [-Wunused-const-variable] Add #ifdef CONFIG_PROC_FS for 'arp_seq_ops'. Fixes: e968b1b3e9b8 ("arp: Remove #ifdef CONFIG_PROC_FS") Reported-by: kernel test robot Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 537f8ffbdf4b9e47e2e21eb8548cdf9cc254c936 Author: Jason-JH.Lin Date: Mon Apr 25 11:45:37 2022 +0800 soc: mediatek: mutex: remove mt8195 MOD0 and SOF0 definition Using mt8183 MDO0 and SOF0 definition instead of creating new one for mt8195. Fixes: 8fdb61f1933a ("soc: mediatek: add mtk-mutex support for mt8195 vdosys0") Signed-off-by: Jason-JH.Lin Link: https://lore.kernel.org/r/20220425034537.28989-1-jason-jh.lin@mediatek.com Signed-off-by: Matthias Brugger commit fa619f5156cf1ee3773edc6d756be262c9ef35de Author: Carlos Bilbao Date: Tue Apr 5 13:32:14 2022 -0500 x86/mce: Add messages for panic errors in AMD's MCE grading When a machine error is graded as PANIC by the AMD grading logic, the MCE handler calls mce_panic(). The notification chain does not come into effect so the AMD EDAC driver does not decode the errors. In these cases, the messages displayed to the user are more cryptic and miss information that might be relevant, like the context in which the error took place. Add messages to the grading logic for machine errors so that it is clear what error it was. [ bp: Massage commit message. ] Signed-off-by: Carlos Bilbao Signed-off-by: Borislav Petkov Reviewed-by: Yazen Ghannam Link: https://lore.kernel.org/r/20220405183212.354606-3-carlos.bilbao@amd.com commit 70c459d915e838b7f536b8e26e0b3a6141bd2645 Author: Carlos Bilbao Date: Tue Apr 5 13:32:13 2022 -0500 x86/mce: Simplify AMD severity grading logic The MCE handler needs to understand the severity of the machine errors to act accordingly. Simplify the AMD grading logic following a logic that closely resembles the descriptions of the public PPR documents. This will help include more fine-grained grading of errors in the future. [ bp: Touchups. ] Signed-off-by: Carlos Bilbao Signed-off-by: Borislav Petkov Reviewed-by: Yazen Ghannam Link: https://lore.kernel.org/r/20220405183212.354606-2-carlos.bilbao@amd.com commit c5794097b269f15961ed78f7f27b50e51766dec9 Author: Alex Elder Date: Thu Apr 21 13:53:33 2022 -0500 net: ipa: compute proper aggregation limit The aggregation byte limit for an endpoint is currently computed based on the endpoint's receive buffer size. However, some bytes at the front of each receive buffer are reserved on the assumption that--as with SKBs--it might be useful to insert data (such as headers) before what lands in the buffer. The aggregation byte limit currently doesn't take into account that reserved space, and as a result, aggregation could require space past that which is available in the buffer. Fix this by reducing the size used to compute the aggregation byte limit by the NET_SKB_PAD offset reserved for each receive buffer. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit a00e41bf2f47343b8d0a265cc7710f89e9233dcd Author: Dan Carpenter Date: Thu Apr 21 18:49:02 2022 +0300 net: ethernet: mtk_eth_soc: add check for allocation failure Check if the kzalloc() failed. Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 60d78e9fce8886b403a21fecb0dd13f9c0f12e1f Author: Yang Yingliang Date: Thu Apr 21 21:51:48 2022 +0800 ethernet: broadcom/sb1250-mac: remove BUG_ON in sbmac_probe() Replace the BUG_ON() with returning error code to handle the fault more gracefully. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 985e254c738ce735d744beeb4bcf77ba7d81cf3a Author: Haowen Bai Date: Thu Apr 21 18:34:41 2022 +0800 net: mscc: ocelot: Remove useless code payload only memset but no use at all, so we drop them. Signed-off-by: Haowen Bai Signed-off-by: David S. Miller commit 3c938cc5cebcbd2291fe97f523c0705a2c24c77d Author: Schspa Shi Date: Tue Apr 19 09:28:10 2022 +0800 gpio: use raw spinlock for gpio chip shadowed data In case of PREEMPT_RT, there is a raw_spinlock -> spinlock dependency as the lockdep report shows. __irq_set_handler irq_get_desc_buslock __irq_get_desc_lock raw_spin_lock_irqsave(&desc->lock, *flags); // raw spinlock get here __irq_do_set_handler mask_ack_irq dwapb_irq_ack spin_lock_irqsave(&gc->bgpio_lock, flags); // sleep able spinlock irq_put_desc_busunlock Replace with a raw lock to avoid BUGs. This lock is only used to access registers, and It's safe to replace with the raw lock without bad influence. [ 15.090359][ T1] ============================= [ 15.090365][ T1] [ BUG: Invalid wait context ] [ 15.090373][ T1] 5.10.59-rt52-00983-g186a6841c682-dirty #3 Not tainted [ 15.090386][ T1] ----------------------------- [ 15.090392][ T1] swapper/0/1 is trying to lock: [ 15.090402][ T1] 70ff00018507c188 (&gc->bgpio_lock){....}-{3:3}, at: _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090470][ T1] other info that might help us debug this: [ 15.090477][ T1] context-{5:5} [ 15.090485][ T1] 3 locks held by swapper/0/1: [ 15.090497][ T1] #0: c2ff0001816de1a0 (&dev->mutex){....}-{4:4}, at: __device_driver_lock+0x98/0x104 [ 15.090553][ T1] #1: ffff90001485b4b8 (irq_domain_mutex){+.+.}-{4:4}, at: irq_domain_associate+0xbc/0x6d4 [ 15.090606][ T1] #2: 4bff000185d7a8e0 (lock_class){....}-{2:2}, at: _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090654][ T1] stack backtrace: [ 15.090661][ T1] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.59-rt52-00983-g186a6841c682-dirty #3 [ 15.090682][ T1] Hardware name: Horizon Robotics Journey 5 DVB (DT) [ 15.090692][ T1] Call trace: ...... [ 15.090811][ T1] _raw_spin_lock_irqsave+0x1c/0x28 [ 15.090828][ T1] dwapb_irq_ack+0xb4/0x300 [ 15.090846][ T1] __irq_do_set_handler+0x494/0xb2c [ 15.090864][ T1] __irq_set_handler+0x74/0x114 [ 15.090881][ T1] irq_set_chip_and_handler_name+0x44/0x58 [ 15.090900][ T1] gpiochip_irq_map+0x210/0x644 Signed-off-by: Schspa Shi Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij Acked-by: Doug Berger Acked-by: Serge Semin Signed-off-by: Bartosz Golaszewski commit 0d5b8c298545c827ca9f2461b2655277ce0aef79 Author: Pali Rohár Date: Tue Apr 12 11:49:46 2022 +0200 PCI: mvebu: Add support for sending Set_Slot_Power_Limit message If DT supplies the 'slot-power-limit-milliwatt' property, program the value in the Slot Power Limit in the Slot Capabilities register and program the Root Port to send a Set_Slot_Power_Limit Message when the Link transitions to DL_Up. Link: https://lore.kernel.org/r/20220412094946.27069-5-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 35662423fb879dd0f32b7beae71fc5f6d8abf45c Author: Pali Rohár Date: Tue Apr 12 11:49:45 2022 +0200 PCI: Add function for parsing 'slot-power-limit-milliwatt' DT property Add function of_pci_get_slot_power_limit(), which parses the 'slot-power-limit-milliwatt' DT property, returning the value in milliwatts and in format ready for the PCIe Slot Capabilities Register. Link: https://lore.kernel.org/r/20220412094946.27069-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Reviewed-by: Bjorn Helgaas commit e8e7fbb6a39cd6761c843d97851eb40c5885e922 Author: Pali Rohár Date: Tue Apr 12 11:49:43 2022 +0200 PCI: Add PCI_EXP_SLTCTL_ASPL_DISABLE macro Add macro defining Auto Slot Power Limit Disable bit in Slot Control Register. Link: https://lore.kernel.org/r/20220412094946.27069-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi Acked-by: Bjorn Helgaas commit 5e927a9f4b9f29d78a7c7d66ea717bb5c8bbad8e Merge: cfc1d91a7d78c 002defd576a3e Author: David S. Miller Date: Mon Apr 25 10:42:29 2022 +0100 Merge branch 'mlxsw-line-card-model' Ido Schimmel says: ==================== mlxsw: extend line card model by devices and info Jiri says: This patchset is extending the line card model by three items: 1) line card devices 2) line card info 3) line card device info First three patches are introducing the necessary changes in devlink core. Then, all three extensions are implemented in mlxsw alongside with selftest. Examples: $ devlink lc show pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 state active type 16x100G supported_types: 16x100G devices: device 0 device 1 device 2 device 3 $ devlink lc info pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 versions: fixed: hw.revision 0 running: ini.version 4 devices: device 0 versions: running: fw 19.2010.1310 device 1 versions: running: fw 19.2010.1310 device 2 versions: running: fw 19.2010.1310 device 3 versions: running: fw 19.2010.1310 Note that device FW flashing is going to be implemented in the follow-up patchset. ==================== Signed-off-by: David S. Miller commit 002defd576a3eb5d0f8bf11d27f0581ed0f34dd4 Author: Jiri Pirko Date: Mon Apr 25 06:44:31 2022 +0300 selftests: mlxsw: Check device info on activated line card Once line card is activated, check the device FW version is exposed. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e932b4bdbd7cf51907d733376ddcd5b679c02923 Author: Jiri Pirko Date: Mon Apr 25 06:44:30 2022 +0300 mlxsw: core_linecards: Expose device FW version over device info Extend MDDQ to obtain FW version of line card device and implement device_info_get() op to fill up the info with that. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c38e9bf338121b8c27e0458d817d534d005bc517 Author: Jiri Pirko Date: Mon Apr 25 06:44:29 2022 +0300 mlxsw: reg: Extend MDDQ device_info by FW version fields Add FW version fields to MDDQ device_info. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 08682c9e58cde26736566445ccec23b4bdbefac6 Author: Jiri Pirko Date: Mon Apr 25 06:44:28 2022 +0300 selftests: mlxsw: Check line card info on provisioned line card Once line card is provisioned, check if HW revision and INI version are exposed. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 3b37130f48555f64be626e619e362e708c2cbd79 Author: Jiri Pirko Date: Mon Apr 25 06:44:27 2022 +0300 mlxsw: core_linecards: Expose HW revision and INI version Implement info_get() to expose HW revision of a linecard and loaded INI version. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5e22298918258d8927b55604598c3ca37ef48e2f Author: Jiri Pirko Date: Mon Apr 25 06:44:26 2022 +0300 selftests: mlxsw: Check devices on provisioned line card Once line card is provisioned, check the count of devices on it and print them out. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8e2e10f651129d6e270a0b9a8bd3aaf0aa3f06d4 Author: Jiri Pirko Date: Mon Apr 25 06:44:25 2022 +0300 mlxsw: core_linecards: Probe provisioned line cards for devices and attach them In case the line card is provisioned, go over all possible existing devices (gearboxes) on it and attach them, so devlink core is aware of them. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 798e2df5067caeb38afe501decec02abdac8a0d7 Author: Jiri Pirko Date: Mon Apr 25 06:44:24 2022 +0300 mlxsw: reg: Extend MDDQ by device_info Extend existing MDDQ register by possibility to query information about devices residing on a line card. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 28b2d1f1ac41dda0b239830765d85c7ae4434182 Author: Jiri Pirko Date: Mon Apr 25 06:44:23 2022 +0300 devlink: introduce line card device info infrastructure Extend the line card info message with information (e.g., FW version) about devices found on the line card. Example: $ devlink lc info pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 versions: fixed: hw.revision 0 running: ini.version 4 devices: device 0 versions: running: fw 19.2010.1310 device 1 versions: running: fw 19.2010.1310 device 2 versions: running: fw 19.2010.1310 device 3 versions: running: fw 19.2010.1310 Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 276910aecc6a4076f5fbfd8160ff70695d6c1eb5 Author: Jiri Pirko Date: Mon Apr 25 06:44:22 2022 +0300 devlink: introduce line card info get message Allow the driver to provide per line card info get op to fill-up info, similar to the "devlink dev info". Example: $ devlink lc info pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 versions: fixed: hw.revision 0 running: ini.version 4 Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8d92e4fbcf0fb7ecb24223b7b1ce95b9beb4dfa2 Author: Jiri Pirko Date: Mon Apr 25 06:44:21 2022 +0300 devlink: introduce line card devices support Line card can contain one or more devices that makes sense to make visible to the user. For example, this can be a gearbox with flash memory, which could be updated. Provide the driver possibility to attach such devices to a line card and expose those to user. Example: $ devlink lc show pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 state active type 16x100G supported_types: 16x100G devices: device 0 device 1 device 2 device 3 Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 18788e34642e2e3eae785b0966769d03e7fbe9d2 Author: Catalin Marinas Date: Sat Apr 23 11:07:51 2022 +0100 btrfs: Avoid live-lock in search_ioctl() on hardware with sub-page faults Commit a48b73eca4ce ("btrfs: fix potential deadlock in the search ioctl") addressed a lockdep warning by pre-faulting the user pages and attempting the copy_to_user_nofault() in an infinite loop. On architectures like arm64 with MTE, an access may fault within a page at a location different from what fault_in_writeable() probed. Since the sk_offset is rewound to the previous struct btrfs_ioctl_search_header boundary, there is no guaranteed forward progress and search_ioctl() may live-lock. Use fault_in_subpage_writeable() instead of fault_in_writeable() to ensure the permission is checked at the right granularity (smaller than PAGE_SIZE). Signed-off-by: Catalin Marinas Fixes: a48b73eca4ce ("btrfs: fix potential deadlock in the search ioctl") Reported-by: Al Viro Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Link: https://lore.kernel.org/r/20220423100751.1870771-4-catalin.marinas@arm.com Signed-off-by: Catalin Marinas commit f3ba50a7a100e91b0b13ca43190a66c1bfdb9993 Author: Catalin Marinas Date: Sat Apr 23 11:07:50 2022 +0100 arm64: Add support for user sub-page fault probing With MTE, even if the pte allows an access, a mismatched tag somewhere within a page can still cause a fault. Select ARCH_HAS_SUBPAGE_FAULTS if MTE is enabled and implement the probe_subpage_writeable() function. Note that get_user() is sufficient for the writeable MTE check since the same tag mismatch fault would be triggered by a read. The caller of probe_subpage_writeable() will need to check the pte permissions (put_user, GUP). Signed-off-by: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20220423100751.1870771-3-catalin.marinas@arm.com Signed-off-by: Catalin Marinas commit da32b5817253697671af961715517bfbb308a592 Author: Catalin Marinas Date: Sat Apr 23 11:07:49 2022 +0100 mm: Add fault_in_subpage_writeable() to probe at sub-page granularity On hardware with features like arm64 MTE or SPARC ADI, an access fault can be triggered at sub-page granularity. Depending on how the fault_in_writeable() function is used, the caller can get into a live-lock by continuously retrying the fault-in on an address different from the one where the uaccess failed. In the majority of cases progress is ensured by the following conditions: 1. copy_to_user_nofault() guarantees at least one byte access if the user address is not faulting. 2. The fault_in_writeable() loop is resumed from the first address that could not be accessed by copy_to_user_nofault(). If the loop iteration is restarted from an earlier (initial) point, the loop is repeated with the same conditions and it would live-lock. Introduce an arch-specific probe_subpage_writeable() and call it from the newly added fault_in_subpage_writeable() function. The arch code with sub-page faults will have to implement the specific probing functionality. Note that no other fault_in_subpage_*() functions are added since they have no callers currently susceptible to a live-lock. Signed-off-by: Catalin Marinas Cc: Andrew Morton Link: https://lore.kernel.org/r/20220423100751.1870771-2-catalin.marinas@arm.com Signed-off-by: Catalin Marinas commit 644edf52b6305506ba7fd552323c1dfaa9cf6d8d Author: Thomas Zimmermann Date: Thu Apr 21 09:31:08 2022 +0200 drm/display: Move SCDC helpers into display-helper library SCDC is the Status and Control Data Channel for HDMI. Move the SCDC helpers into display/ and split the header into files for core and helpers. Update all affected drivers. No functional changes. To avoid the proliferation of Kconfig options, SCDC is part of DRM's support for HDMI. If necessary, a new option could make SCDC an independent feature. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-9-tzimmermann@suse.de commit 4fc8cb47fcfdc93e274a1291757e478df4f9c39b Author: Thomas Zimmermann Date: Thu Apr 21 09:31:07 2022 +0200 drm/display: Move HDMI helpers into display-helper module Move DRM's HMDI helpers into the display/ subdirectoy and add it to DRM's display helpers. Update all affected drivers. No functional changes. The HDMI helpers were implemented in the EDID and connector code, but are actually unrelated. With the move to the display-helper library, we can remove the dependency on drm_edid.{c,h} in some driver's HDMI source files. Several of the HDMI helpers remain in EDID code because both share parts of their implementation internally. With better refractoring of the EDID code, those HDMI helpers could be moved into the display-helper library as well. v3: * fix Kconfig dependencies (Javier) v2: * reduce HDMI helpers to avoid exporting functions (Jani) * fix include statements (Jani, Javier) * update Kconfig symbols Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-8-tzimmermann@suse.de commit 6a99099fe1d6c46cbcd74298eeb386c4b9048f77 Author: Thomas Zimmermann Date: Thu Apr 21 09:31:06 2022 +0200 drm/display: Move HDCP helpers into display-helper module Move DRM's HDCP helper library into the display/ subdirectory and add it to DRM's display helpers. Split the header file into core and helpers. Update all affected drivers. No functional changes. v3: * fix Kconfig dependencies v2: * fix include statements (Jani, Javier) * update Kconfig symbols Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-7-tzimmermann@suse.de commit 2a64b147350f5b28f6b41873fcb453aaebea01c3 Author: Thomas Zimmermann Date: Thu Apr 21 09:31:05 2022 +0200 drm/display: Move DSC header and helpers into display-helper module DSC is the Display Stream Compression standard for DisplayPort. Move the DSC code into display/ and split the header into files for protocol core and DRM helpers. Adapt all users of the code. No functional changes. To avoid the proliferation of Kconfig options, DSC is part of DRM's support for DisplayPort. If necessary, a new option could make DSC an independent feature. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-6-tzimmermann@suse.de commit 5d1b8b4a14f798c1bc627fb788112067ee26d1da Author: Thomas Zimmermann Date: Thu Apr 21 09:31:04 2022 +0200 drm/display: Split DisplayPort header into core and helper Move DisplayPort protocol constants and structures into the new header drm_dp.h, which can be used by DRM core components. The existing header drm_dp_helper.h now only contains helper code for graphics drivers. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Lyude Paul Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-5-tzimmermann@suse.de commit 1e0f66420b13fdd45754be0f15220a9185d59aa4 Author: Thomas Zimmermann Date: Thu Apr 21 09:31:03 2022 +0200 drm/display: Introduce a DRM display-helper module Replace the DP-helper module with a display-helper module. The support for DisplayPort becomes an internal option that drivers have to select. Update all related Kconfig and Makefile rules. Besides the existing code for DisplayPort, the new module will contain helpers for other video-output standards, such as HDMI. Drivers will have to select their required video-output helpers. Linking all display-related code into a single module avoids the proliferation of small kernel modules. The module parameters drm_dp_cec_unregister_delay, dp_aux_i2c_speed_khz, and dp_aux_i2c_transfer_size are moving from the drm_dp_helper namespace to drm_display_helper. v2: * mention module parameters in commit message (Javier) * distiguish between display module and DP support in Kconfig * update Makefile rules for DP helpers * move Kconfig rules into separate file under display/ Signed-off-by: Thomas Zimmermann Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-4-tzimmermann@suse.de commit da68386d9edb1f57abf886febe5c5169ebd4d2c9 Author: Thomas Zimmermann Date: Thu Apr 21 09:31:02 2022 +0200 drm: Rename dp/ to display/ Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes. Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with this convention. v2: * update commit message (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Lyude Paul Reviewed-by: Javier Martinez Canillas Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-3-tzimmermann@suse.de commit c6eafc99f0f75f71bf24b55b3abb8218a75e329e Author: Thomas Zimmermann Date: Thu Apr 21 09:31:01 2022 +0200 drm: Put related statements next to each other in Makefile Give the Makefile a bit more structure by putting rules for core, helpers, drivers, etc next to each other. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-2-tzimmermann@suse.de commit d869d48ae7414cf1393636d30a1bfcf499d21ace Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:51 2022 +0900 soc: renesas: rcar-rst: Add support for R-Car V4H Add support for R-Car V4H (R8A779G0) to the R-Car RST driver. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220420084255.375700-12-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 87ab58e1fe3aa5a7f7afafe242d73a94a16d6e9c Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:50 2022 +0900 soc: renesas: Identify R-Car V4H Add support for identifying the R-Car V4H (R8A779G0) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220420084255.375700-11-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 11a5ebb42ec2ae5a979769e09845e4788e728484 Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:49 2022 +0900 soc: renesas: r8a779g0-sysc: Add r8a779g0 support Add support for R-Car V4H (R8A779G0) SoC power areas and register access. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220420084255.375700-10-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 1c1d0e5dc445d584e07da68e10e44d8abf787ae1 Merge: 2f89bef90de47 f2afa78d5a0c0 Author: Geert Uytterhoeven Date: Mon Apr 25 10:53:43 2022 +0200 Merge tag 'renesas-r8a779g0-dt-binding-defs-tag' into renesas-drivers-for-v5.19 Renesas R-Car V4H DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car V4H (R8A779G0) SoC, shared by driver and DT source files. commit 8ff93be3259fda0f7b7667ee1717b1dc9c4c8d07 Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:43 2022 +0900 dt-bindings: reset: renesas,rst: Document r8a779g0 reset module Document bindings for the R-Car V4H (R8A779G0) reset module. Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220420084255.375700-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 6cd3233242eebfd81c8eb83fa965959471a2cd97 Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:41 2022 +0900 dt-bindings: arm: renesas: Document R-Car V4H White Hawk DT bindings Add device tree binding documentation for the Renesas R-Car V4H (r8a779g0) SoC and the Renesas White Hawk CPU and BreakOut boards. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220420084255.375700-2-yoshihiro.shimoda.uh@renesas.com Link: https://lore.kernel.org/r/20220420084255.375700-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 13b4d179c6641f66f3385c5ed6f2715f5b99f003 Author: Yoshihiro Shimoda Date: Wed Apr 20 17:42:46 2022 +0900 dt-bindings: clock: renesas,cpg-mssr: Document r8a779g0 Add binding documentation for the R-Car V4H (R8A779G0) Clock Pulse Generator. Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220420084255.375700-7-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit b243a358b31338d4b8068c6c17c32d255c89ee4a Author: Yoshihiro Shimoda Date: Mon Apr 11 21:49:32 2022 +0900 clk: renesas: r8a779f0: Add UFS clock Add the module clock used by the UFS host controller on the Renesas R-Car S4-8 (R8A779F0) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220411124932.3765571-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 96a3295c351da82d7af99b2fc004a3cf9f4716a9 Author: Bjørn Mork Date: Mon Mar 28 18:11:08 2022 +0200 mtdblock: warn if opened on NAND Warning on every translated mtd partition results in excessive log noise if this driver is loaded: nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1 nand: Macronix MX30LF1G18AC nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 mt7621-nand 1e003000.nand: ECC strength adjusted to 4 bits read_bbt: found bbt at block 1023 10 fixed-partitions partitions found on MTD device mt7621-nand Creating 10 MTD partitions on "mt7621-nand": 0x000000000000-0x000000080000 : "Bootloader" mtdblock: MTD device 'Bootloader' is NAND, please consider using UBI block devices instead. 0x000000080000-0x000000100000 : "Config" mtdblock: MTD device 'Config' is NAND, please consider using UBI block devices instead. 0x000000100000-0x000000140000 : "Factory" mtdblock: MTD device 'Factory' is NAND, please consider using UBI block devices instead. 0x000000140000-0x000002000000 : "Kernel" mtdblock: MTD device 'Kernel' is NAND, please consider using UBI block devices instead. 0x000000540000-0x000002000000 : "ubi" mtdblock: MTD device 'ubi' is NAND, please consider using UBI block devices instead. 0x000002140000-0x000004000000 : "Kernel2" mtdblock: MTD device 'Kernel2' is NAND, please consider using UBI block devices instead. 0x000004000000-0x000004100000 : "wwan" mtdblock: MTD device 'wwan' is NAND, please consider using UBI block devices instead. 0x000004100000-0x000005100000 : "data" mtdblock: MTD device 'data' is NAND, please consider using UBI block devices instead. 0x000005100000-0x000005200000 : "rom-d" mtdblock: MTD device 'rom-d' is NAND, please consider using UBI block devices instead. 0x000005200000-0x000005280000 : "reserve" mtdblock: MTD device 'reserve' is NAND, please consider using UBI block devices instead. mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 21 This is more likely to annoy than to help users of embedded distros where this driver is enabled by default. Making the blockdevs available does not imply that they are in use, and warning about bootloader partitions or other devices which obviously never will be mounted is more confusing than helpful. Move the warning to open(), where it will be of more use - actually warning anyone who mounts a file system on NAND using mtdblock. Fixes: e07403a8c6be ("mtdblock: Warn if added for a NAND device") Signed-off-by: Bjørn Mork Reviewed-by: Ezequiel Garcia Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220328161108.87757-1-bjorn@mork.no commit 7090d2f1d66767928b6f24def05b715ed18e5c6f Author: Vincent Whitchurch Date: Tue Apr 12 15:53:01 2022 +0200 mtd: phram: Allow probing via reserved-memory Allow phram to be probed from the devicetree. It expects to be in a reserved-memory node as documented by the bindings. This allows things like partitioning to be specified via the devicetree. Signed-off-by: Vincent Whitchurch Acked-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412135302.1682890-4-vincent.whitchurch@axis.com commit 4e969459604632d4096ff536f72552a9d365845e Author: Vincent Whitchurch Date: Tue Apr 12 15:53:00 2022 +0200 dt-bindings: reserved-memory: Support MTD/block device Add bindings to allow MTD/block devices to be used in reserved-memory regions using the "phram" (MTD in PHysical RAM) driver. This allows things like partitioning to be specified via the existing devicetree bindings. Signed-off-by: Vincent Whitchurch Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412135302.1682890-3-vincent.whitchurch@axis.com commit 82e214f6c0f16827ea7a95b8f96c651a7a7f8ac1 Author: Vincent Whitchurch Date: Tue Apr 12 15:52:59 2022 +0200 mtd: core: Check devicetree alias for index Allow the MTD index to be specified via a devicetree alias, so that the number does not just depend on probe order. This is useful to allow pseudo-devices like phram to be optionally used on systems, without having this affect the numbering of the real hardware MTD devices. Signed-off-by: Vincent Whitchurch Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412135302.1682890-2-vincent.whitchurch@axis.com commit 9547c4e74f6b4b56c2f9e4e7a286ce126fd333fa Author: Krzysztof Kozlowski Date: Fri Apr 8 08:37:20 2022 +0200 dt-bindings: mtd: jedec, spi-nor: remove unneeded properties After conversion the jedec,spi-nor DT schema to reference other schemas (SPI and MTD) and use unevaluatedProperties, few properties are redundant. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Pratyush Yadav Reviewed-by: Rob Herring Reviewed-by: Tudor Ambarus Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220408063720.12826-1-krzysztof.kozlowski@linaro.org commit 7ceeb6011948b3e39b236f78c66a66b1924fbb4d Author: Linus Walleij Date: Thu Apr 7 23:08:44 2022 +0200 mtd: maps: ixp4xx: Drop driver This custom maps driver was never used with the device tree enabled IXP4xx systems, which use the physmap add-on from commit 2aba2f2a704d ("mtd: physmap_of: add a hook for Intel IXP4xx flash probing") Since kernel v5.18-rc1 IXP4xx is only booting from the device tree so drop this old driver. Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220407210844.2489682-1-linus.walleij@linaro.org commit f2afa78d5a0c0b0b2461a5c532d7a84214a1b633 Author: Yoshihiro Shimoda Date: Mon Apr 25 15:41:56 2022 +0900 dt-bindings: clock: Add r8a779g0 CPG Core Clock Definitions Add all Clock Pulse Generator Core Clock Outputs for the Renesas R-Car V4H (R8A779G0) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220425064201.459633-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 90715507cb899df6c726494c0225d30130ad0cc5 Author: Yoshihiro Shimoda Date: Mon Apr 25 15:41:55 2022 +0900 dt-bindings: power: Add r8a779g0 SYSC power domain definitions Add power domain indices for R-Car V4H (r8a779g0). Signed-off-by: Yoshihiro Shimoda Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220425064201.459633-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 1e1d2e185358b9383807ccfc30f51b642ebe3b8a Merge: b4b157577cb1d 2917f53113be3 Author: Jani Nikula Date: Mon Apr 25 11:17:52 2022 +0300 Merge tag 'gvt-next-2022-04-21-for-christoph' of https://github.com/intel/gvt-linux into drm-intel-next gvt-next-2022-04-21-for-christoph - Separating the MMIO table from GVT-g. (Zhi) - GVT-g re-factor. (Christoph) - GVT-g mdev API cleanup. (Jason) - GVT-g trace/makefile cleanup. (Jani) [Jani: added #include to adapt to header refactoring in drm-intel-next] Signed-off-by: Jani Nikula From: "Wang, Zhi A" Link: https://patchwork.freedesktop.org/patch/msgid/25a713cd-0b7d-4c09-7d91-4f4ef6c9eb11@intel.com commit 503e19720c723ee012e2e1c173c96a75b8025a4a Author: Chunguang Xu Date: Fri Apr 22 19:09:11 2022 +0800 drm/tilcdc: fix typos in comment Fix typos in comment. Signed-off-by: Chunguang Xu Signed-off-by: Jyri Sarha Link: https://patchwork.freedesktop.org/patch/msgid/1650625751-32137-1-git-send-email-brookxu.cn@gmail.com commit 011b559be832194f992f73d6c0d5485f5925a10b Author: Colin Ian King Date: Sun Apr 24 21:59:45 2022 +0100 ALSA: pcm: Check for null pointer of pointer substream before dereferencing it Pointer substream is being dereferenced on the assignment of pointer card before substream is being null checked with the macro PCM_RUNTIME_CHECK. Although PCM_RUNTIME_CHECK calls BUG_ON, it still is useful to perform the the pointer check before card is assigned. Fixes: d4cfb30fce03 ("ALSA: pcm: Set per-card upper limit of PCM buffer allocations") Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220424205945.1372247-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai commit c92b576a13ad917e6f5bcee916e6004e711edfa7 Author: Mark Brown Date: Thu Apr 21 12:50:20 2022 +0100 selftests: alsa: Start validating control names Not much of a test but we keep on getting problems with boolean controls not being called Switches so let's add a few basic checks to help people spot problems. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220421115020.14118-1-broonie@kernel.org Signed-off-by: Takashi Iwai commit c5acdf12cc24d34ea3f9426472dcb3f5d581b1e5 Author: Guo Ren Date: Wed Apr 13 15:27:52 2022 +0800 csky: atomic: Add conditional atomic operations' optimization Add conditional atomic operations' optimization: - arch_atomic_fetch_add_unless - arch_atomic_inc_unless_negative - arch_atomic_dec_unless_positive - arch_atomic_dec_if_positive Comments by Boqun: FWIW, you probably need to make sure that a barrier instruction inside an lr/sc loop is a good thing. IIUC, the execution time of a barrier instruction is determined by the status of store buffers and invalidate queues (and probably other stuffs), so it may increase the execution time of the lr/sc loop, and make it unlikely to succeed. But this really depends on how the arch executes these instructions. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Boqun Feng commit 6b160e0513e9f0b0c0b7ff4d5b964822d1750ce9 Author: Guo Ren Date: Wed Apr 6 20:47:52 2022 +0800 csky: atomic: Add custom atomic.h implementation The generic atomic.h used cmpxchg to implement the atomic operations, it will cause daul loop to reduce the forward guarantee. The patch implement csky custom atomic operations with ldex/stex instructions for the best performance. Important comment by Rutland: 8e86f0b409a4 ("arm64: atomics: fix use of acquire + release for full barrier semantics") Link: https://lore.kernel.org/linux-riscv/CAJF2gTSAxpAi=LbAdu7jntZRUa=-dJwL0VfmDfBV5MHB=rcZ-w@mail.gmail.com/T/#m27a0f1342995deae49ce1d0e1f2683f8a181d6c3 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Mark Rutland commit 186f69b64c80a594337211e8238e44a3863e9d94 Author: Guo Ren Date: Wed Apr 6 20:30:13 2022 +0800 csky: atomic: Optimize cmpxchg with acquire & release Optimize cmpxchg with ASM acquire/release fence ASM instructions instead of previous generic based. Prevent a fence when cmxchg's first load != old. Comments by Rutland: 8e86f0b409a4 ("arm64: atomics: fix use of acquire + release for full barrier semantics") Comments by Boqun: FWIW, you probably need to make sure that a barrier instruction inside an lr/sc loop is a good thing. IIUC, the execution time of a barrier instruction is determined by the status of store buffers and invalidate queues (and probably other stuffs), so it may increase the execution time of the lr/sc loop, and make it unlikely to succeed. But this really depends on how the arch executes these instructions. Link: https://lore.kernel.org/linux-riscv/CAJF2gTSAxpAi=LbAdu7jntZRUa=-dJwL0VfmDfBV5MHB=rcZ-w@mail.gmail.com/T/#m27a0f1342995deae49ce1d0e1f2683f8a181d6c3 Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Mark Rutland commit b243018eafeb69bf074ef013c54504632fd161ec Author: Ondrej Jirman Date: Sun Apr 24 18:02:17 2022 -0700 Input: sun4i-lradc-keys - add wakeup support Allow the driver to wake the system on key press if the "wakeup-source" property is provided in the device tree. Using the LRADC as a wakeup source requires keeping the AVCC domain active during sleep. Since this has a nontrivial impact on power consumption (sometimes doubling it), disable the LRADC wakeup source by default. Signed-off-by: Ondrej Jirman Acked-by: Jernej Skrabec Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220424161328.61103-1-samuel@sholland.org Signed-off-by: Dmitry Torokhov commit be8fc023ef64dcb11042aaa4bb0f29f7e0335d85 Author: David Collins Date: Sun Apr 24 18:21:58 2022 -0700 Input: pm8941-pwrkey - simulate missed key press events The status of the keys connected to the KPDPWR_N and RESIN_N pins is identified by reading corresponding bits in the interrupt real time status register. If the status has changed by the time that the interrupt is handled then a press event will be missed. Maintain a last known status variable to find unbalanced release events and simulate press events for each accordingly. Signed-off-by: David Collins Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220422191239.6271-6-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov commit 0b65118e6ba3024b8d9330cbca9b4c8b439d2057 Author: David Collins Date: Sun Apr 24 18:20:05 2022 -0700 Input: pm8941-pwrkey - add software key press debouncing support On certain PMICs, an unexpected assertion of KPDPWR_DEB (the positive logic hardware debounced power key signal) may be seen during the falling edge of KPDPWR_N (i.e. a power key press) when it occurs close to the rising edge of SLEEP_CLK. This then triggers a spurious KPDPWR interrupt. Handle this issue by adding software debouncing support to ignore key events that occur within the hardware debounce delay after the most recent key release event. Signed-off-by: David Collins Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220422191239.6271-5-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov commit 8ac8904bf9c7da69456731b890dd4e5839e2341a Author: Anjelique Melendez Date: Sun Apr 24 18:19:29 2022 -0700 Input: pm8941-pwrkey - add support for PON GEN3 base addresses Currently, PON address is read from the "reg" property. For PON GEN3, which starts with PMK8350, the "reg" property will have both the PON HLOS and PON PBS addesses defined. Add support so that all PON generations can be configured. Reviewed-by: Stephen Boyd Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220422191239.6271-4-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov commit 2e7cfec0edd41e44d7506beead7591fa668ff824 Author: Anjelique Melendez Date: Sun Apr 24 18:19:03 2022 -0700 Input: pm8941-pwrkey - fix error message Currently, error message reads "failed to set debounce". However, code is attempting to read revision not set debounce. Fix this. Reviewed-by: Stephen Boyd Signed-off-by: Anjelique Melendez Link: https://lore.kernel.org/r/20220422191239.6271-3-quic_amelende@quicinc.com Signed-off-by: Dmitry Torokhov commit 40f6d265665abf511af310454a0b9d64f8959fd6 Author: ran jianping Date: Sun Apr 24 18:23:40 2022 -0700 Input: synaptics-rmi4 - remove unnecessary flush_workqueue() All work currently pending will be done first by calling destroy_workqueue, so there is unnecessary to flush it explicitly. Reported-by: Zeal Robot Signed-off-by: ran jianping Link: https://lore.kernel.org/r/20220422093304.2781183-1-ran.jianping@zte.com.cn Signed-off-by: Dmitry Torokhov commit 28e26e927cf4a37fb84fb8fd9893c6a858676b87 Author: Lv Ruyi Date: Wed Apr 20 14:46:20 2022 -0700 Input: ep93xx_keypad - use devm_platform_ioremap_resource() helper Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. This makes the code simpler without functional changes. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20220418015036.2556731-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Torokhov commit 41657514c796e1f0a8cf289780aff8f79643b7e5 Author: Charles Mirabile Date: Wed Apr 20 14:00:20 2022 -0700 Input: add Raspberry Pi Sense HAT joystick driver This patch adds the driver for the Sense HAT joystick. It outputs BTN_DPAD key events when moved in any of the four directions and the BTN_SELECT event when depressed. Co-developed-by: Daniel Bauman Signed-off-by: Daniel Bauman Co-developed-by: Mwesigwa Guma Signed-off-by: Mwesigwa Guma Co-developed-by: Joel Savitz Signed-off-by: Joel Savitz Signed-off-by: Charles Mirabile Link: https://lore.kernel.org/r/20220419205158.28088-3-cmirabil@redhat.com Signed-off-by: Dmitry Torokhov commit d238b8f68018f33f12253a63543a04712d2d6a5b Author: Alexander Shiyan Date: Wed Apr 20 13:58:45 2022 -0700 Input: clps711x-keypad - use syscon_regmap_lookup_by_phandle Since version 5.13, the standard syscon bindings have been added to all clps711x DT nodes, so we can now use the more general syscon_regmap_lookup_by_phandle function to get the syscon pointer. Signed-off-by: Alexander Shiyan Link: https://lore.kernel.org/r/20220420062725.25614-1-eagle.alexander923@gmail.com Signed-off-by: Dmitry Torokhov commit 0a112e7c681ca311b241c50a75d9206f301ca21c Author: Changcheng Deng Date: Wed Apr 20 13:55:07 2022 -0700 Input: remove unneeded variable in input_inhibit_device() Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Link: https://lore.kernel.org/r/20220419064255.2563333-1-deng.changcheng@zte.com.cn Signed-off-by: Dmitry Torokhov commit 4ffaa94b9c047fe0e82b1f271554f31f0e2e2867 Author: Kanchan Joshi Date: Fri Apr 22 15:40:48 2022 +0530 io_uring: cleanup error-handling around io_req_complete Move common error-handling to io_req_complete, so that various callers avoid repeating that. Few callers (io_tee, io_splice) require slightly different handling. These are changed to use __io_req_complete instead. Suggested-by: Christoph Hellwig Signed-off-by: Kanchan Joshi Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220422101048.419942-1-joshi.k@samsung.com Signed-off-by: Jens Axboe commit 1374e08e2d44863c931910797852589803997668 Author: Jens Axboe Date: Tue Apr 12 14:22:40 2022 -0600 io_uring: add socket(2) support Supports both regular socket(2) where a normal file descriptor is instantiated when called, or direct descriptors. Link: https://lore.kernel.org/r/20220412202240.234207-3-axboe@kernel.dk Signed-off-by: Jens Axboe commit da214a475f8bd1d3e9e7a19ddfeb4d1617551bab Author: Jens Axboe Date: Tue Apr 12 14:22:39 2022 -0600 net: add __sys_socket_file() This works like __sys_socket(), except instead of allocating and returning a socket fd, it just returns the file associated with the socket. No fd is installed into the process file table. This is similar to do_accept(), and allows io_uring to use this without instantiating a file descriptor in the process file table. Signed-off-by: Jens Axboe Acked-by: David S. Miller Link: https://lore.kernel.org/r/20220412202240.234207-2-axboe@kernel.dk commit 0200ce6a57c5de802f4e438485c14cc9d63d5f4b Author: Jens Axboe Date: Sun Apr 24 18:16:57 2022 -0600 io_uring: fix trace for reduced sqe padding __pad2 is only 1 u64 now, the other one is addr3. Adjust the trace so that it matches up. Fixes: a56834e0fafe ("io_uring: add fgetxattr and getxattr support") Signed-off-by: Jens Axboe commit a56834e0fafe0adf7f22a28a5dbec3e8c3031a0e Author: Stefan Roesch Date: Wed Mar 23 08:44:20 2022 -0700 io_uring: add fgetxattr and getxattr support This adds support to io_uring for the fgetxattr and getxattr API. Signed-off-by: Stefan Roesch Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20220323154420.3301504-5-shr@fb.com Signed-off-by: Jens Axboe commit e9621e2bec80fe63f677a759066a5089b292f43a Author: Stefan Roesch Date: Wed Mar 23 08:44:19 2022 -0700 io_uring: add fsetxattr and setxattr support This adds support to io_uring for the fsetxattr and setxattr API. Signed-off-by: Stefan Roesch Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20220323154420.3301504-4-shr@fb.com Signed-off-by: Jens Axboe commit c975cad931570004b5f51248424a2a696fb65630 Author: Stefan Roesch Date: Sun Apr 24 18:13:50 2022 -0600 fs: split off do_getxattr from getxattr This splits off do_getxattr function from the getxattr function. This will allow io_uring to call it from its io worker. Signed-off-by: Stefan Roesch Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20220323154420.3301504-3-shr@fb.com Signed-off-by: Jens Axboe commit 1a91794ce8481a293c5ef432feb440aee1455619 Author: Stefan Roesch Date: Sun Apr 24 18:10:46 2022 -0600 fs: split off setxattr_copy and do_setxattr function from setxattr This splits of the setup part of the function setxattr in its own dedicated function called setxattr_copy. In addition it also exposes a new function called do_setxattr for making the setxattr call. This makes it possible to call these two functions from io_uring in the processing of an xattr request. Signed-off-by: Stefan Roesch Acked-by: Christian Brauner Link: https://lore.kernel.org/r/20220323154420.3301504-2-shr@fb.com Signed-off-by: Jens Axboe commit 155bc9505dbd6613585abbf0be6466f1c21536c4 Author: Dylan Yudaken Date: Thu Apr 21 02:13:44 2022 -0700 io_uring: return an error when cqe is dropped Right now io_uring will not actively inform userspace if a CQE is dropped. This is extremely rare, requiring a CQ ring overflow, as well as a GFP_ATOMIC kmalloc failure. However the consequences could cause for example applications to go into an undefined state, possibly waiting for a CQE that never arrives. Return an error code (EBADR) in these cases. Since this is expected to be incredibly rare, try and avoid as much as possible affecting the hot code paths, and so it only is returned lazily and when there is no other available CQEs. Once the error is returned, reset the error condition assuming the user is either ok with it or will clean up appropriately. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220421091345.2115755-6-dylany@fb.com Signed-off-by: Jens Axboe commit 10988a0a67ba918c5b3ac7de47efa7470264a291 Author: Dylan Yudaken Date: Thu Apr 21 02:13:43 2022 -0700 io_uring: use constants for cq_overflow bitfield Prepare to use this bitfield for more flags by using constants instead of magic value 0 Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220421091345.2115755-5-dylany@fb.com Signed-off-by: Jens Axboe commit 3e813c9026720c1291ef3c91caa2e26f88e28367 Author: Dylan Yudaken Date: Thu Apr 21 02:13:42 2022 -0700 io_uring: rework io_uring_enter to simplify return value io_uring_enter returns the count submitted preferrably over an error code. In some code paths this check is not required, so reorganise the code so that the check is only done as needed. This is also a prep for returning error codes only in waiting scenarios. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220421091345.2115755-4-dylany@fb.com Signed-off-by: Jens Axboe commit 08dcd0288f6ecb97bc94260856e6b44cca4149e2 Author: Dylan Yudaken Date: Thu Apr 21 02:13:41 2022 -0700 io_uring: trace cqe overflows Trace cqe overflows in io_uring. Print ocqe before the check, so if it is NULL it indicates that it has been dropped. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220421091345.2115755-3-dylany@fb.com Signed-off-by: Jens Axboe commit 47894438e916ca3fe44db33c2d4a1670fd296d6f Author: Dylan Yudaken Date: Thu Apr 21 02:13:40 2022 -0700 io_uring: add trace support for CQE overflow Add trace function for overflowing CQ ring. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220421091345.2115755-2-dylany@fb.com Signed-off-by: Jens Axboe commit 10c873334febaeea9aa0c25c10b5ac0951b77a5f Author: Jens Axboe Date: Wed Apr 20 19:27:41 2022 -0600 io_uring: allow re-poll if we made progress We currently check REQ_F_POLLED before arming async poll for a notification to retry. If it's set, then we don't allow poll and will punt to io-wq instead. This is done to prevent a situation where a buggy driver will repeatedly return that there's space/data available yet we get -EAGAIN. However, if we already transferred data, then it should be safe to rely on poll again. Gate the check on whether or not REQ_F_PARTIAL_IO is also set. Signed-off-by: Jens Axboe commit 4c3c09439c08b03d9503df0ca4c7619c5842892e Author: Jens Axboe Date: Wed Apr 20 19:21:36 2022 -0600 io_uring: support MSG_WAITALL for IORING_OP_SEND(MSG) Like commit 7ba89d2af17a for recv/recvmsg, support MSG_WAITALL for the send side. If this flag is set and we do a short send, retry for a stream of seqpacket socket. Signed-off-by: Jens Axboe commit 970f256edb8c1259c8ed48d52b38215135396126 Author: Jens Axboe Date: Mon Apr 18 10:44:02 2022 -0600 io_uring: add support for IORING_ASYNC_CANCEL_ANY Rather than match on a specific key, be it user_data or file, allow canceling any request that we can lookup. Works like IORING_ASYNC_CANCEL_ALL in that it cancels multiple requests, but it doesn't key off user_data or the file. Can't be set with IORING_ASYNC_CANCEL_FD, as that's a key selector. Only one may be used at the time. Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/20220418164402.75259-6-axboe@kernel.dk Signed-off-by: Jens Axboe commit 4bf94615b8886305199ed5755cb72fea88258d15 Author: Jens Axboe Date: Mon Apr 18 10:44:01 2022 -0600 io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key Currently sqe->addr must contain the user_data of the request being canceled. Introduce the IORING_ASYNC_CANCEL_FD flag, which tells the kernel that we're keying off the file fd instead for cancelation. This allows canceling any request that a) uses a file, and b) was assigned the file based on the value being passed in. Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/20220418164402.75259-5-axboe@kernel.dk commit 8e29da69feade64ec7fe9e1a2824b967c5183a21 Author: Jens Axboe Date: Mon Apr 18 10:44:00 2022 -0600 io_uring: add support for IORING_ASYNC_CANCEL_ALL The current cancelation will lookup and cancel the first request it finds based on the key passed in. Add a flag that allows to cancel any request that matches they key. It completes with the number of requests found and canceled, or res < 0 if an error occured. Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/20220418164402.75259-4-axboe@kernel.dk commit b21432b4d580d064b6dee6d66c9a6b0071b499ce Author: Jens Axboe Date: Mon Apr 18 10:43:59 2022 -0600 io_uring: pass in struct io_cancel_data consistently In preparation for being able to not only key cancel off the user_data, pass in the io_cancel_data struct for the various functions that deal with request cancelation. Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/20220418164402.75259-3-axboe@kernel.dk commit 98d3dcc8be97a11f7f3b674acb25f81673bb43c3 Author: Jens Axboe Date: Mon Apr 18 10:43:58 2022 -0600 io_uring: remove dead 'poll_only' argument to io_poll_cancel() It's only called from one location, and it always passes in 'false'. Kill the argument, and just pass in 'false' to io_poll_find(). Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/20220418164402.75259-2-axboe@kernel.dk commit 81ec803b4ecda446aa965e1c0d8eb4241847ed9c Author: Pavel Begunkov Date: Wed Apr 20 13:40:55 2022 +0100 io_uring: refactor io_disarm_next() locking Split timeout handling into removal + failing, so we can reduce spinlocking time and remove another instance of triple nested locking. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0f00d115f9d4c5749028f19623708ad3695512d6.1650458197.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3645c2000a7694022c39c545676c12fb9190855a Author: Pavel Begunkov Date: Wed Apr 20 13:40:54 2022 +0100 io_uring: move timeout locking in io_timeout_cancel() Move ->timeout_lock grabbing inside of io_timeout_cancel(), so we can do io_req_task_queue_fail() outside of the lock. It's much nicer than relying on triple nested locking. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/cde758c2897930d31e205ed8f476d4ec879a8849.1650458197.git.asml.silence@gmail.com [axboe: drop now wrong timeout_lock annotation] Signed-off-by: Jens Axboe commit 5e45690a1cb8cb591ccf4a517cdd6ad6cb369ac4 Author: Jens Axboe Date: Wed Apr 20 16:15:27 2022 -0600 io_uring: store SCM state in io_fixed_file->file_ptr A previous commit removed SCM accounting for non-unix sockets, as those are the only ones that can cause a fixed file reference. While that is true, it also means we're now dereferencing the file as part of the workqueue driven __io_sqe_files_unregister() after the process has exited. This isn't safe for SCM files, as unix gc may have already reaped them when the process exited. KASAN complains about this: [ 12.307040] Freed by task 0: [ 12.307592] kasan_save_stack+0x28/0x4c [ 12.308318] kasan_set_track+0x28/0x38 [ 12.309049] kasan_set_free_info+0x24/0x44 [ 12.309890] ____kasan_slab_free+0x108/0x11c [ 12.310739] __kasan_slab_free+0x14/0x1c [ 12.311482] slab_free_freelist_hook+0xd4/0x164 [ 12.312382] kmem_cache_free+0x100/0x1dc [ 12.313178] file_free_rcu+0x58/0x74 [ 12.313864] rcu_core+0x59c/0x7c0 [ 12.314675] rcu_core_si+0xc/0x14 [ 12.315496] _stext+0x30c/0x414 [ 12.316287] [ 12.316687] Last potentially related work creation: [ 12.317885] kasan_save_stack+0x28/0x4c [ 12.318845] __kasan_record_aux_stack+0x9c/0xb0 [ 12.319976] kasan_record_aux_stack_noalloc+0x10/0x18 [ 12.321268] call_rcu+0x50/0x35c [ 12.322082] __fput+0x2fc/0x324 [ 12.322873] ____fput+0xc/0x14 [ 12.323644] task_work_run+0xac/0x10c [ 12.324561] do_notify_resume+0x37c/0xe74 [ 12.325420] el0_svc+0x5c/0x68 [ 12.326050] el0t_64_sync_handler+0xb0/0x12c [ 12.326918] el0t_64_sync+0x164/0x168 [ 12.327657] [ 12.327976] Second to last potentially related work creation: [ 12.329134] kasan_save_stack+0x28/0x4c [ 12.329864] __kasan_record_aux_stack+0x9c/0xb0 [ 12.330735] kasan_record_aux_stack+0x10/0x18 [ 12.331576] task_work_add+0x34/0xf0 [ 12.332284] fput_many+0x11c/0x134 [ 12.332960] fput+0x10/0x94 [ 12.333524] __scm_destroy+0x80/0x84 [ 12.334213] unix_destruct_scm+0xc4/0x144 [ 12.334948] skb_release_head_state+0x5c/0x6c [ 12.335696] skb_release_all+0x14/0x38 [ 12.336339] __kfree_skb+0x14/0x28 [ 12.336928] kfree_skb_reason+0xf4/0x108 [ 12.337604] unix_gc+0x1e8/0x42c [ 12.338154] unix_release_sock+0x25c/0x2dc [ 12.338895] unix_release+0x58/0x78 [ 12.339531] __sock_release+0x68/0xec [ 12.340170] sock_close+0x14/0x20 [ 12.340729] __fput+0x18c/0x324 [ 12.341254] ____fput+0xc/0x14 [ 12.341763] task_work_run+0xac/0x10c [ 12.342367] do_notify_resume+0x37c/0xe74 [ 12.343086] el0_svc+0x5c/0x68 [ 12.343510] el0t_64_sync_handler+0xb0/0x12c [ 12.344086] el0t_64_sync+0x164/0x168 We have an extra bit we can use in file_ptr on 64-bit, use that to store whether this file is SCM'ed or not, avoiding the need to look at the file contents itself. This does mean that 32-bit will be stuck with SCM for all registered files, just like 64-bit did before the referenced commit. Fixes: 1f59bc0f18cf ("io_uring: don't scm-account for non af_unix sockets") Signed-off-by: Jens Axboe commit 7ac1edc4a9bbbfc43c4a1fa7c2884029df3363bf Author: Pavel Begunkov Date: Mon Apr 18 20:51:15 2022 +0100 io_uring: kill ctx arg from io_req_put_rsrc The ctx argument of io_req_put_rsrc() is not used, kill it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/bb51bf3ff02775b03e6ea21bc79c25d7870d1644.1650311386.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 25a15d3c668bf9cd23780fb0191b7f7f5054d879 Author: Pavel Begunkov Date: Mon Apr 18 20:51:14 2022 +0100 io_uring: add a helper for putting rsrc nodes Add a simple helper to encapsulating dropping rsrc nodes references, it's cleaner and will help if we'd change rsrc refcounting or play with percpu_ref_put() [no]inlining. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/63fdd953ac75898734cd50e8f69e95e6664f46fe.1650311386.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c1bdf8ed1e84ccbcf5e35fac1b311094572e5047 Author: Pavel Begunkov Date: Mon Apr 18 20:51:13 2022 +0100 io_uring: store rsrc node in req instead of refs req->fixed_rsrc_refs keeps a pointer to rsrc node pcpu references, but it's more natural just to store rsrc node directly. There were some reasons for that in the past but not anymore. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/cee1c86ec9023f3e4f6ce8940d58c017ef8782f4.1650311386.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 772f5e002b9ef65c22956990be9ecb2df58cd9c9 Author: Pavel Begunkov Date: Mon Apr 18 20:51:12 2022 +0100 io_uring: refactor io_assign_file error path All io_assign_file() callers do error handling themselves, req_set_fail() in the io_assign_file()'s fail path needlessly bloats the kernel and is not the best abstraction to have. Simplify the error path. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/eff77fb1eac2b6a90cca5223813e6a396ffedec0.1650311386.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 93f052cb39e1f8c7a002e2ecbc7f45f354dcf0c7 Author: Pavel Begunkov Date: Mon Apr 18 20:51:11 2022 +0100 io_uring: use right helpers for file assign locking We have io_ring_submit_[un]lock() functions helping us with conditional ->uring_lock locking, use them in io_file_get_fixed() instead of hand coding. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c9c9ff1e046f6eb68da0a251962a697f8a2275fa.1650311386.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a6d97a8a77cb66cbbf6a5afc6708b1c2f5b00ca2 Author: Pavel Begunkov Date: Fri Apr 15 22:08:33 2022 +0100 io_uring: add data_race annotations We have several racy reads, mark them with data_race() to demonstrate this fact. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7e56e750d294c70b2a56938bd733386f19f0eb53.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 17b147f6c1f21caef554004e19207810cbc08a8e Author: Pavel Begunkov Date: Fri Apr 15 22:08:32 2022 +0100 io_uring: inline io_req_complete_fail_submit() Inline io_req_complete_fail_submit(), there is only one caller and the name doesn't tell us much. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fe5851af01dcd39fc84b71b8539c7cbe4658fb6d.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 924a07e482baae0ced5fb9922b827c46f0c0972d Author: Pavel Begunkov Date: Fri Apr 15 22:08:31 2022 +0100 io_uring: refactor io_submit_sqe() Remove one extra if for non-linked path of io_submit_sqe(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/03183199d1bf494b4a72eca16d792c8a5945acb4.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit df3becde8d9dcaaf17a615009301479f8f9c6323 Author: Pavel Begunkov Date: Fri Apr 15 22:08:30 2022 +0100 io_uring: refactor lazy link fail Remove the lazy link fail logic from io_submit_sqe() and hide it into a helper. It simplifies the code and will be needed in next patches. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6a68aca9cf4492132da1d7c8a09068b74aba3c65.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit da1a08c5b28176398773de30a056ba7b994e6988 Author: Pavel Begunkov Date: Fri Apr 15 22:08:29 2022 +0100 io_uring: introduce IO_REQ_LINK_FLAGS Add a macro for all link request flags to avoid duplication. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/df38b883e31e7e0ca4e364d25a0743862961b180.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7bfa9badc793ba5e8b530dc3a3cb092a1c22685b Author: Pavel Begunkov Date: Fri Apr 15 22:08:28 2022 +0100 io_uring: refactor io_queue_sqe() io_queue_sqe() is a part of the submission path and we try hard to keep it inlined, so shed some extra bytes from it by moving the error checking part into io_queue_sqe_arm_apoll() and renaming it accordingly. note: io_queue_sqe_arm_apoll() is not inlined, thus the patch doesn't change the number of function calls for the apoll path. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9b79edd246336decfaca79b949a15ac69123490d.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 77955efbc46220adce9ecb803fb9ff9042bd7236 Author: Pavel Begunkov Date: Fri Apr 15 22:08:27 2022 +0100 io_uring: rename io_queue_async_work() Rename io_queue_async_work(). The name is pretty old but now doesn't reflect well what the function is doing. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5d4b25c54cccf084f9f2fd63bd4e4fa4515e998e.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cbc2e2038845ddc6d1eb5969eff4f02bd5187b47 Author: Pavel Begunkov Date: Fri Apr 15 22:08:26 2022 +0100 io_uring: inline io_queue_sqe() Inline io_queue_sqe() as there is only one caller left, and rename __io_queue_sqe(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d5742683b7a7caceb1c054e91e5b9135b0f3b858.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cb2d344c7551c250c07c009639eb81d54235ef8b Author: Pavel Begunkov Date: Fri Apr 15 22:08:25 2022 +0100 io_uring: helper for prep+queuing linked timeouts We try to aggresively inline the submission path, so it's a good idea to not pollute it with colder code. One of them is linked timeout preparation + queue, which can be extracted into a function. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ecf74df7ac77389b6d9211211ec4954e91de98ba.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f5c6cf2a310d8de3bd02aa8a217f8ca63df6f236 Author: Pavel Begunkov Date: Fri Apr 15 22:08:24 2022 +0100 io_uring: inline io_free_req() Inline io_free_req() into its only user and remove an underscore prefix from __io_free_req(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ed114edef5c256a644f4839bb372df70d8df8e3f.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 4e118cd9e9e609c805822ee423aa23ae406e7da0 Author: Pavel Begunkov Date: Fri Apr 15 22:08:23 2022 +0100 io_uring: kill io_put_req_deferred() We have several spots where a call to io_fill_cqe_req() is immediately followed by io_put_req_deferred(). Replace them with __io_req_complete_post() and get rid of io_put_req_deferred() and io_fill_cqe_req(). > size ./fs/io_uring.o text data bss dec hex filename 86942 13734 8 100684 1894c ./fs/io_uring.o > size ./fs/io_uring.o text data bss dec hex filename 86438 13654 8 100100 18704 ./fs/io_uring.o Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/10672a538774ac8986bee6468d960527af59169d.1650056133.git.asml.silence@gmail.com [axboe: fold in followup fix] Signed-off-by: Jens Axboe commit 971cf9c19e97bad172bdb7142a23e6489d1b38f0 Author: Pavel Begunkov Date: Fri Apr 15 22:08:22 2022 +0100 io_uring: minor refactoring for some tw handlers Get rid of some useless local variables Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7798327b684b7015f7e4300420142ddfcd317297.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f22190570b213dcc84216ac07cfd0eeada010013 Author: Pavel Begunkov Date: Fri Apr 15 22:08:20 2022 +0100 io_uring: clean poll tw PF_EXITING handling When we meet PF_EXITING in io_poll_check_events(), don't overcomplicate the code with io_poll_mark_cancelled() but just return -ECANCELED and the callers will deal with the rest. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f0cc981af82a5b193658f8f44397eeb3bf838b7b.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d8da428b7a9a71bc2ee6bf628a8c0f9beb96a195 Author: Pavel Begunkov Date: Tue Apr 12 15:09:51 2022 +0100 io_uring: optimise io_get_cqe() io_get_cqe() is expensive because of a bunch of loads, masking, etc. However, most of the time we should have enough of entries in the CQ, so we can cache two pointers representing a range of contiguous CQE memory we can use. When the range is exhausted we'll go through a slower path to set up a new range. When there are no CQEs avaliable, pointers will naturally point to the same address. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/487eeef00f3146537b3d9c1a9cef2fc0b9a86f81.1649771823.git.asml.silence@gmail.com [axboe: santinel -> sentinel] Signed-off-by: Jens Axboe commit 1cd15904b6e836f46e925229da8950785252b315 Author: Pavel Begunkov Date: Tue Apr 12 15:09:50 2022 +0100 io_uring: optimise submission left counting Considering all inlining io_submit_sqe() is huge and usually ends up calling some other functions. We decrement @left in io_submit_sqes() just before calling io_submit_sqe() and use it later after the call. Considering how huge io_submit_sqe() is, there is not much hope @left will be treated gracefully by compilers. Decrement it after the call, not only it's easier on register spilling and probably saves stack write/read, but also at least for x64 uses CPU flags set by the dec instead of doing (read/write and tests). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/807f9a276b54ee8ff4e42e2b78721484f1c71743.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 8e6971a819dfd289e40642405a9200076f5dd17f Author: Pavel Begunkov Date: Tue Apr 12 15:09:49 2022 +0100 io_uring: optimise submission loop invariant Instead of keeping @submitted in io_submit_sqes(), which for each iteration requires comparison with the initial number of SQEs, store the number of SQEs left to submit. We'll need nr only for when we're done with SQE handling. note: if we can't allocate a req for the first SQE we always has been returning -EAGAIN to the userspace, save this behaviour by looking into the cache in a slow path. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c3b3df9aeae4c2f7a53fd8386385742e4e261e77.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit fa05457a603e7c8e97cd4cfb62de64bc9547ecb5 Author: Pavel Begunkov Date: Tue Apr 12 15:09:48 2022 +0100 io_uring: add helper to return req to cache list Don't hand code wq_stack_add_head() to ->free_list, which serves for recycling io_kiocb, add a helper doing it for us. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f206f575486a8dd3d52f074ab37ed146b2d215b7.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 88ab95be7e408ff9cedc81ad5402ad4bd700baf9 Author: Pavel Begunkov Date: Tue Apr 12 15:09:47 2022 +0100 io_uring: helper for empty req cache checks Add io_req_cache_empty(), which checks if there are requests in the inline req cache or not. It'll be needed in the future, but also nicely cleans up a few spots poking into ->free_list directly. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b18662389f3fb483d0bd07906647f65f6037475a.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 23a5c43b2fc0cc210dcb36264fe3050468c79b17 Author: Pavel Begunkov Date: Tue Apr 12 15:09:46 2022 +0100 io_uring: inline io_flush_cached_reqs io_flush_cached_reqs() isn't descriptive and has only one caller, inline it into __io_alloc_req_refill(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ec38abe65a883d9fe6b169793119ce86806655a4.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e126391c092014af7ea6786648c9f1d3fce512a3 Author: Pavel Begunkov Date: Tue Apr 12 15:09:45 2022 +0100 io_uring: shrink final link flush All good users should not set IOSQE_IO_*LINK flags for the last request of a link. io_uring flushes collected links at the end of submission, but it's not the optimal way and so we don't care too much about it. Replace io_queue_sqe() call with io_queue_sqe_fallback() as the former one is inlined and will generate a bunch of extra code. This will also help compilers with the submission path inlining. > size ./fs/io_uring.o text data bss dec hex filename 87265 13734 8 101007 18a8f ./fs/io_uring.o > size ./fs/io_uring.o text data bss dec hex filename 87073 13734 8 100815 189cf ./fs/io_uring.o Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/01fb5e417ef49925d544a0b0bae30409845ed2b4.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 90e7c35fb89154439a4a604699faf36adbfa871b Author: Pavel Begunkov Date: Tue Apr 12 15:09:44 2022 +0100 io_uring: memcpy CQE from req We can do CQE filling a bit more efficiently when req->cqe is fully filled by memcpy()'ing it to the userspace instead of doing it field by field. It's easier on register spilling, removes a couple of extra loads/stores and write combines two u32 memory writes. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ee3f514ff28b1fe3347a8eca93a9d91647f2eaad.1649771823.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cef216fc32d7628206c523994e7e267e7a8dda59 Author: Pavel Begunkov Date: Tue Apr 12 15:09:43 2022 +0100 io_uring: explicitly keep a CQE in io_kiocb We already have req->{result,user_data,cflags}, which mimic struct io_uring_cqe and are intended to store CQE data. Combine them into a struct io_uring_cqe field. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e1efe65d5005cd6a9ec3440767eb15a9fa9351cf.1649771823.git.asml.silence@gmail.com [axboe: add mirror cqe to cater to fd union] Signed-off-by: Jens Axboe commit 8b3171bdf53c51c8edd609c3087932a24c42087f Author: Pavel Begunkov Date: Thu Apr 7 13:40:05 2022 +0100 io_uring: rename io_sqe_file_register Rename io_sqe_file_register(), so the name better reflects what the function is doing. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d5091518883786969e244d2f0854a47bbdaa5061.1649334991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 73b25d3badbf3642d15fe267ffc5b1a5c0bc07b3 Author: Pavel Begunkov Date: Thu Apr 7 13:40:04 2022 +0100 io_uring: deduplicate SCM accounting Merge io_sqe_file_register() and io_sqe_file_register(). The only real difference left between them is from where we get an skb. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/dddda3039c71fcbec24b3465cbe8c7e7ae7bb0e8.1649334991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e390510af0461e743a8f0031fc235552c40778f9 Author: Pavel Begunkov Date: Thu Apr 7 13:40:03 2022 +0100 io_uring: don't pass around fixed index for scm There is an old API nuisance where io_uring's SCM accounting functions traverse fixed file tables and so requires them to be set in advance, which leads to some implicit rules of how io_sqe_file_register() should be used. __io_sqe_files_scm() now works with only one file at a time, pass a file directly and get rid of all fixed table dereferencing inside. Clean io_sqe_file_register() callers. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/fb32031d892e61a7748c70da7999725d5e798671.1649334991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit dca58c6a08a92c5c674140047de7f72f9cc843d0 Author: Pavel Begunkov Date: Thu Apr 7 13:40:02 2022 +0100 io_uring: refactor __io_sqe_files_scm __io_sqe_files_scm() is now called only from one place passing a single file, so nr argument can be killed and __io_sqe_files_scm() simplified. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/66b492bc66dc8356d45d64076bb31d677d11a7c9.1649334991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a03a2a209e826f646dff49202b8b1eb8427c2d08 Author: Pavel Begunkov Date: Thu Apr 7 13:40:01 2022 +0100 io_uring: uniform SCM accounting Channel all SCM accounting through io_sqe_file_register(), so we do it uniformely for updates and initial registration and can kill duplicated code. Registration might be slightly slower in some case, but first we skip most of SCM accounting now so it's not a problem. Moreover, it's nicer for an empty set registration as we don't even try to allocate skb for them anymore. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6c9afbeb22812777d0c43e52353b63db5b87ed1e.1649334991.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 1f59bc0f18cf46abe27ea18cfa4cb7f1b4166896 Author: Pavel Begunkov Date: Wed Apr 6 21:33:56 2022 +0100 io_uring: don't scm-account for non af_unix sockets io_uring deals with file reference loops by registering all fixed files in the SCM/GC infrastrucure. However, only a small subset of all file types can keep long-term references to other files and those that don't are not interesting for the garbage collector as they can't be in a reference loop. They neither can be directly recycled by GC nor affect loop searching. Let's skip io_uring SCM accounting for loop-less files, i.e. all but af_unix sockets, quite imroving fixed file updates performance and greatly helpnig with memory footprint. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/9c44ecf6e89d69130a8c4360cce2183ffc5ddd6f.1649277098.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b4f20bb4e6d55a971d5f5555a971978a6263d8de Author: Jens Axboe Date: Fri Mar 25 16:39:57 2022 -0600 io_uring: move finish_wait() outside of loop in cqring_wait() We don't need to call this for every loop. This is particularly troublesome if we are task_work intensive, and get woken more often than we desire due to that. Just do it at the end, that's always safe as we initialize the waitqueue list head anyway. This can save a considerable amount of hammering on the waitqueue lock, which is also hot from the request completion side. Signed-off-by: Jens Axboe commit 775a1f2f99483bda4e43376ebbc6b459c8fbf20a Author: Pavel Begunkov Date: Fri Mar 25 11:52:17 2022 +0000 io_uring: refactor io_req_add_compl_list() A small refactoring for io_req_add_compl_list() deduplicating some code. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f0a5272b45efe4ffc41cb79b99784e39c699aade.1648209006.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 963c6abbb4e4ee3d00ca7992f751c49b38b07e68 Author: Pavel Begunkov Date: Fri Mar 25 11:52:16 2022 +0000 io_uring: silence io_for_each_link() warning Some tooling keep complaining about self assignment in io_for_each_link(), the code is correct but still let's workaround it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f0de77b0b0f8309554ba6fba34327b7813bcc3ff.1648209006.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 9d170164dbac3f674b5ec2189e2a279eb0b7625f Author: Pavel Begunkov Date: Fri Mar 25 11:52:15 2022 +0000 io_uring: partially uninline io_put_task() In most cases io_put_task() is called from the submitter task and go through a higly optimised fast path, which has to be inlined. The other branch though is bulkier and we don't care about it as much because it implies atomics and other heavy calls. Extract it into a helper, which is expected not to be inlined. [before] size ./fs/io_uring.o text data bss dec hex filename 89328 13646 8 102982 19246 ./fs/io_uring.o [after] size ./fs/io_uring.o text data bss dec hex filename 89096 13646 8 102750 1915e ./fs/io_uring.o Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/dec213db0e0b8605132da81e0a0be687a4d140cb.1648209006.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f8929630514505ef8c6cf70d8b7a2bbf7e43b225 Author: Pavel Begunkov Date: Fri Mar 25 11:52:14 2022 +0000 io_uring: cleanup conditional submit locking Refactor io_ring_submit_[un]lock(), make it accept issue_flags and remove manual IO_URING_F_UNLOCKED checks. It also allows us to place lockdep annotations inside instead of sprinkling them in a bunch of places. There is only one user that doesn't fit now, so hand code locking in __io_rsrc_put_work(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e55c2c06767676a801252e8094c9ab09912487a4.1648209006.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d487b43cd3276e40723641510cbd2d33da4f6800 Author: Pavel Begunkov Date: Tue Mar 22 14:07:58 2022 +0000 io_uring: optimise mutex locking for submit+iopoll Both submittion and iopolling requires holding uring_lock. IOPOLL can users do them together in a single syscall, however it would still do 2 pairs of lock/unlock. Optimise this case combining locking into one lock/unlock pair, which especially nice for low QD. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/034b6c41658648ad3ad3c9485ac8eb546f010bc4.1647957378.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 773697b610bff9451cf67d4f57b08d68c4b1a832 Author: Pavel Begunkov Date: Tue Mar 22 14:07:57 2022 +0000 io_uring: pre-calculate syscall iopolling decision Syscall should only iopoll for events when it's a IOPOLL ring and is not SQPOLL. Instead of check both flags every time we can save it in ring flags so it's easier to use. We don't care much about an extra if there, however it will be inconvenient to copy-paste this chunk with checks in future patches. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7fd2f8fc2606305aa06dd8c0ff8f76a66b39c383.1647957378.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f81440d33cc61bd80f37e1045f0f5a21d043eed3 Author: Pavel Begunkov Date: Tue Mar 22 14:07:56 2022 +0000 io_uring: split off IOPOLL argument verifiction IOPOLL doesn't use additional arguments like sigsets, but it still needs some basic verification, which is currently done by io_get_ext_arg(). This patch adds a separate function for the IOPOLL path, which is a bit simpler and doesn't do extra. This prepares us for further patches, which would have hurt inlining in the hot path otherwise. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/71b23fca412e3374b74be7711cfd42a3d9d5dfe0.1647957378.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 57859f4d93db3eecd5dd680d3b3520eea80c996b Author: Pavel Begunkov Date: Mon Mar 21 22:02:24 2022 +0000 io_uring: clean up io_queue_next() Move fast check out of io_queue_next(), it makes req->flags checks in __io_submit_flush_completions() a bit clearer and grants us better comtrol, e.g. can remove now not justified unlikely() in __io_submit_flush_completions(). Also, we don't care about having this check in io_free_req() as the function is a slow path and io_req_find_next() handles it correctly. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1f9e1cc80adbb11b37017d511df4a2c6141a3f08.1647897811.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit b605a7fabb607adbe4ea7cc97b69ae6e0555e7b2 Author: Pavel Begunkov Date: Mon Mar 21 22:02:23 2022 +0000 io_uring: move poll recycling later in compl flushing There is a new (req->flags & REQ_F_POLLED) check in __io_submit_flush_completions() for poll recycling, however io_free_batch_list() is a much better place for it. First, we prefer it after putting the last req ref just to avoid potential problems in the future. Also, it'll enable the recycling for IOPOLL and also will place it closer to all other req->flags bits clean up requests. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/31dfe1dafda66ba3ce36b301884ec7e162c777d1.1647897811.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit a538be5be328229d4da3343d4d6514bb4d5c3d5d Author: Pavel Begunkov Date: Mon Mar 21 22:02:22 2022 +0000 io_uring: optimise io_free_batch_list We do several req->flags checks in the fast path of io_free_batch_list(). One explicit check of REQ_F_REFCOUNT, and two other hidden in io_queue_next() and io_dismantle_req(). Moreover, there is a io_req_put_rsrc_locked() call in between, so there is no hope req->flags will be preserved in registers. All those flags if not a slow path than definitely a slower path, so put them all under a single flags mask check and save several mem reloads and ifs. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0fb493f73f2009aea395c570c2932fecaa4e1244.1647897811.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7819a1f6ac0393f1f7861dfece6ffd5ef010f0f9 Author: Pavel Begunkov Date: Mon Mar 21 22:02:21 2022 +0000 io_uring: refactor io_req_find_next Move the fast path from io_req_find_next() into callers. It prepares us for further changes. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/10bd0e564472dde0c7f8d90ae317d05356cd565a.1647897811.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 60053be859b33f7a381a3f1755db5caffaa3cab8 Author: Pavel Begunkov Date: Mon Mar 21 22:02:20 2022 +0000 io_uring: remove extra ifs around io_commit_cqring Now io_commit_cqring() is simple and it tolerates well being called without a new CQE filled, so kill a bunch of not needed anymore guards. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/36aed692dff402bba00a444a63a9cd2e97a340ea.1647897811.git.asml.silence@gmail.com [axboe: fold in followup fix] Signed-off-by: Jens Axboe commit 68ca8fc00277ad04c975c382bd6e2d500e5c7185 Author: Pavel Begunkov Date: Mon Mar 21 22:02:19 2022 +0000 io_uring: small optimisation of tctx_task_work There should be no completions stashed when we first get into tctx_task_work(), so move completion flushing checks a bit later after we had a chance to execute some task works. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c6765c804f3c438591b9825ab9c43d22039073c4.1647897811.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 0f73a559f916b618c0c05186bd644c90cc9e9695 Author: Marek Vasut Date: Wed Apr 6 11:36:27 2022 +0200 drm/panel: simple: Add missing bus flags for Innolux G070Y2-L01 The DE signal is active high on this display, fill in the missing bus_flags. This aligns panel_desc with its display_timing . Fixes: a5d2ade627dca ("drm/panel: simple: Add support for Innolux G070Y2-L01") Signed-off-by: Marek Vasut Cc: Christoph Fritz Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Sam Ravnborg Cc: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220406093627.18011-1-marex@denx.de commit 2381e02aa8732ab670051c6f4a78b8d3a98bd6cd Author: Marek Vasut Date: Mon Apr 11 02:47:28 2022 +0200 drm/panel: lvds: Drop now redundant width-mm and height-mm check The check for mandatory DT properties width-mm and height-mm is now part of of_get_drm_panel_display_mode(), drop the redundant check from this driver. Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20220411004728.68203-2-marex@denx.de commit f470cfe40bd853d8175b098365b862037be83578 Author: Marek Vasut Date: Mon Apr 11 02:47:27 2022 +0200 drm/modes: Make width-mm/height-mm check in of_get_drm_panel_display_mode() mandatory All users of this function require width-mm/height-mm DT property to be present per their DT bindings, make width-mm/height-mm check mandatory. It is generally a good idea to specify panel dimensions, so userspace can configure e.g. scaling accordingly. Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20220411004728.68203-1-marex@denx.de commit 4dd024d4ad6570815876726dedf176482dfdb31f Author: Marek Vasut Date: Fri Apr 22 12:22:42 2022 +0200 drm/panel: simple: Add DataImage FG040346DSSWBG04 panel support Add DataImage FG040346DSSWBG04 4.3" 480x272 TFT LCD 24bit DPI panel support. Acked-by: Thomas Zimmermann Signed-off-by: Marek Vasut Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220422102242.18959-2-marex@denx.de commit 26b954e4ef46f35cda5cb9807e49e779e3f166b9 Author: Marek Vasut Date: Fri Apr 22 12:22:41 2022 +0200 dt-bindings: display: simple: Add DataImage FG040346DSSWBG04 compatible string Add DataImage FG040346DSSWBG04 4.3" 480x272 TFT LCD 24bit DPI panel compatible string. Acked-by: Thomas Zimmermann Signed-off-by: Marek Vasut Cc: Rob Herring Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220422102242.18959-1-marex@denx.de commit 1f7142915d304804a9bd952245fce92786b1b62f Author: Vishnu Dasa Date: Thu Apr 14 12:33:16 2022 -0700 VMCI: Add support for ARM64 Add support for ARM64 architecture so that the driver can now be built and VMCI device can be used. Update Kconfig file to allow the driver to be built on ARM64 as well. Fail vmci_guest_probe_device() on ARM64 if the device does not support MMIO register access. Lastly, add virtualization specific barriers which map to actual memory barrier instructions on ARM64, because it is required in case of ARM64 for queuepair (de)queuing. Reviewed-by: Bryan Tan Reviewed-by: Cyprien Laplace Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220414193316.14356-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman commit 5a0793ac66ac0e254d292f129a4d6c526f9f2aff Author: Xiaomeng Tong Date: Thu Apr 14 11:56:09 2022 +0800 firmware: stratix10-svc: fix a missing check on list iterator The bug is here: pmem->vaddr = NULL; The list iterator 'pmem' will point to a bogus position containing HEAD if the list is empty or no element is found. This case must be checked before any use of the iterator, otherwise it will lead to a invalid memory access. To fix this bug, just gen_pool_free/set NULL/list_del() and return when found, otherwise list_del HEAD and return; Fixes: 7ca5ce896524f ("firmware: add Intel Stratix10 service layer driver") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220414035609.2239-1-xiam0nd.tong@gmail.com Signed-off-by: Greg Kroah-Hartman commit 830a4e5c48dfc8b4c566c9af9a0a1c4d01d95e7a Author: Jason A. Donenfeld Date: Thu Apr 7 14:26:38 2022 +0200 /dev/mem: make reads and writes interruptible In 8619e5bdeee8 ("/dev/mem: Bail out upon SIGKILL."), /dev/mem became killable, and that commit noted: Theoretically, reading/writing /dev/mem and /dev/kmem can become "interruptible". But this patch chose "killable". Future patch will make them "interruptible" so that we can revert to "killable" if some program regressed. So now we take the next step in making it "interruptible", by changing fatal_signal_pending() into signal_pending(). Cc: Tetsuo Handa Signed-off-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/20220407122638.490660-1-Jason@zx2c4.com Signed-off-by: Greg Kroah-Hartman commit b67d19662fdee275c479d21853bc1239600a798f Author: Hangyu Hua Date: Wed Apr 6 15:57:03 2022 +0800 char: xillybus: fix a refcount leak in cleanup_dev() usb_get_dev is called in xillyusb_probe. So it is better to call usb_put_dev before xdev is released. Acked-by: Eli Billauer Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220406075703.23464-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman commit 88517757a829e9ce146a6c7233ad5dcdc66fcbb0 Author: Jakob Koschel Date: Sun Mar 27 23:45:51 2022 +0200 misc: bcm-vk: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220327214551.2188544-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit f76a9ae61628fe3bf182318054ddc9e6f501b1a1 Author: Christian Vogel Date: Thu Mar 24 20:32:46 2022 +0100 w1/ds2490: remove dump from ds_recv_status, pr_ to dev_XXX logging. Changed all remaining pr_XXX calls that write out debugging info into dev_XXX calls, changed the needlessly verbose decoding of status bits into dev_dbg(), so that it's supressed by the logging levels by default. Forthermore the ds_recv_status function has a "dump" parameter that enables extremely verbose logging, and that's used only once. This has been factored out, and called explicitly at that one place. Signed-off-by: Christian Vogel Link: https://lore.kernel.org/r/20220324193246.16814-2-vogelchr@vogel.cx Signed-off-by: Greg Kroah-Hartman commit 5ac11fe03a0a83042d1a040dbce4fa2fb5521e23 Author: Xiaomeng Tong Date: Sun Mar 27 14:22:02 2022 +0800 misc: fastrpc: fix an incorrect NULL check on list iterator The bug is here: if (!buf) { The list iterator value 'buf' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty (in this case, the check 'if (!buf) {' will always be false and never exit expectly). To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'buf' as a dedicated pointer to point to the found element. Fixes: 2419e55e532de ("misc: fastrpc: add mmap/unmap support") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327062202.5720-1-xiam0nd.tong@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4834f9898c7301a365acd02095793d55b519e5a8 Author: Jakob Koschel Date: Thu Mar 24 08:09:39 2022 +0100 char: xillybus: 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/ Acked-by: Eli Billauer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324070939.59297-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit f61c5c830ff0c906907a73a4bfddba6a8f91cbcb Author: Jakob Koschel Date: Thu Mar 24 08:31:51 2022 +0100 misc: vmw_vmci: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324073151.66305-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit fd7e92d5b8b4a01f1d2c3197f2489f2a9b2d186e Author: Nadav Amit Date: Tue Mar 22 17:00:52 2022 +0000 vmw_balloon: Print errors on reset only once The VMware balloon might be reset multiple times during execution. Print errors only once to avoid filling the log unnecessarily. Signed-off-by: Nadav Amit Link: https://lore.kernel.org/r/20220322170052.6351-1-namit@vmware.com Signed-off-by: Greg Kroah-Hartman commit 874dfbcf219ccc42a2cbd187d087c7db82c3024b Author: Krzysztof Kozlowski Date: Mon Mar 21 12:03:26 2022 +0100 nvmem: sunplus-ocotp: drop useless probe confirmation Printing probe success is discouraged, because we can use tracing for this purpose. Remove useless print message after Sunplus OCOTP driver probe. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220321110326.44652-3-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman commit 1066f8156351fcd997125257cea47cf805ba4f6d Author: Krzysztof Kozlowski Date: Mon Mar 21 12:03:25 2022 +0100 nvmem: sunplus-ocotp: staticize sp_otp_v0 The "sp_otp_v0" file scope variable is not used outside, so make it static to fix warning: drivers/nvmem/sunplus-ocotp.c:74:29: sparse: sparse: symbol 'sp_otp_v0' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220321110326.44652-2-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman commit 6bd0ffeaa389866089e9573b2298ae58d6359b75 Author: Krzysztof Kozlowski Date: Mon Mar 21 12:03:24 2022 +0100 nvmem: bcm-ocotp: mark ACPI device ID table as maybe unused "bcm_otpc_acpi_ids" is used with ACPI_PTR, so a build with !CONFIG_ACPI has a warning: drivers/nvmem/bcm-ocotp.c:247:36: error: ‘bcm_otpc_acpi_ids’ defined but not used [-Werror=unused-const-variable=] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220321110326.44652-1-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3a5e65023f0274d2104724a294b9b0eb4db59057 Author: Jakob Koschel Date: Sat Mar 19 21:14:54 2022 +0100 char: misc: remove usage of list iterator past the loop body In preparation to limit the scope of the list iterator to the list traversal loop, use a dedicated pointer pointing to the found element [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220319201454.2511733-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5fe580196dd9b7d8eb2a99629055bb4ffa00f262 Author: Krzysztof Kozlowski Date: Thu Apr 7 21:41:27 2022 +0200 dt-bindings: timer: exynos4210-mct: describe known hardware and its interrupts Most of the Samsung Exynos SoCs use almost the same Multi-Core Timer block, so only two compatibles were used so far (for Exynos4210 and Exynos4412 flavors) with Exynos4210-one being used in most of the SoCs. However the Exynos4210 flavor actually differs by number of interrupts. Add new compatibles, maintaining backward compatibility with Exynos4210, and constraints for number of interrupts. This allows to exactly match the Exynos MCT hardware. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220407194127.19004-1-krzysztof.kozlowski@linaro.org commit 7912bda4f60dbb86c5aaa41fc1d36e639780ac90 Author: Oleksij Rempel Date: Tue Apr 19 06:48:24 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: add thermal zone and attach tmp103 to it. Latest version of ti,tmp103 driver supports thermal zone. So make use of it. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit b456aed07944b3048d68f7daad2fd6e1155dc4fe Author: David Jander Date: Tue Apr 19 06:48:23 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Add missing ISB led node Add missing ISB led node. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit eac849a24e188adeecd0ba3b598ea861281da725 Author: David Jander Date: Tue Apr 19 06:48:22 2022 +0200 ARM: dts: imx6dl-victgo.dts: Remove touchscreen x axis inversion X axis is not inverted in hardware. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 6d8e96fbeb07fa0ac4d248cac5174e866320ce9c Author: David Jander Date: Tue Apr 19 06:48:21 2022 +0200 ARM: dts: imx6qdl-vicut1: Factor out common parts of 12inch board variants Factor out common parts of vicut1 and vicutp to reduce maintenance overhead. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 901e8f8f8b87a56e6bb6b974063e7bcb4d272e38 Author: David Jander Date: Tue Apr 19 06:48:20 2022 +0200 ARM: dts: Remove imx6qdl-victgo.dtsi The common base is now identical to imx6qdl-vicut1.dtsi, so we can remove one of both. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 217390ad7423d65591745ec4957aaa30b62c3a7b Author: David Jander Date: Tue Apr 19 06:48:19 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Move some node out to DTS files This commit will finally make this file identical to imx6qdl-victgo.dtsi. All nodes that are removed here are added as-is to the DTS files that include this file. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit d380984764ad5c7c12d35f687aef843ea10f373c Author: David Jander Date: Tue Apr 19 06:48:18 2022 +0200 ARM: dts: imx6dl-victgo.dts: Factor out common parts to imx6qdl-victgo.dtsi These parts are common to imx6qdl-vicut1.dtsi. This patch is preparation to unify victgo and vicut1 DTs. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit deebb9ba3a64acb8dabcedcf2845f86b48f0e7b4 Author: David Jander Date: Tue Apr 19 06:48:17 2022 +0200 ARM: dts: imx6dl-victgo.dts: update gpio names Following changes was made: - Add MDIO signal names - Add missing ISB_IN2 name. Also correct ISB_nIN1. These two signals were used together in older HW revisions. Later ISB_IN2 was removed. Software should still be able to use both. - Add missing CAN1 and UART line names - Add missing ON1/2_CTRL line names - fix CPU_* line names. The real signal names are without the CPU_ prefix, like on imx6qdl-vicut1.dtsi - Fix ETH_INT signal name Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 4eef8cb7dd41a47da94191fc1d191167be07a077 Author: David Jander Date: Tue Apr 19 06:48:16 2022 +0200 ARM: dts: imx6q-vicut1.dts: remove sata node Only the prototype had the SATA interface. There are no existing products with SATA interface and no plans to add any. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 1d039a1ae2c7ccfd269ebfdb11c10085fc394aff Author: David Jander Date: Tue Apr 19 06:48:15 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Remove conflicting pinctrl entry The function of DISP0_DAT9 is dependent on hardware revision of two particular variants. This setting should be done by the bootloader anyway, and is not needed in the kernel, so remove it from the DT. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 4e6ab6837e326c975443168ac1aaf2b6132caf5b Author: David Jander Date: Tue Apr 19 06:48:14 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Update GPIO line names Add some missing names and remove names to pins that have never been used and/or are not present on any hardware. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit c061895eb0248d3d2c250930a2c69353d4ba94c2 Author: David Jander Date: Tue Apr 19 06:48:13 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Fix debug LED gpio pins While there are LEDs connected on some variants on GPIO4 pins 16 and 17, those are not the debug LEDs that should be visible to user-space. It should be the same as in imx6dl-victgo.dtsi. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 1a0e71889dea95fa73a5cfc1fb505952b1f099f0 Author: David Jander Date: Tue Apr 19 06:48:12 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Fix LED names The names should be consistent with the names in imx6dl-victgo.dts This patch is preparation to unify vicut1 and victgo DTs. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit f6d8a739b35758d6958d51e39dc760f49629047e Author: David Jander Date: Tue Apr 19 06:48:11 2022 +0200 ARM: dts: imx6qdl-vicut1/victgo: Remove UART2 Only first prototype had UART2 and there are no plans to add it in the future. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 2a0a0c5dc0764b00154f6784883ea60c69e5c275 Author: David Jander Date: Tue Apr 19 06:48:10 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Remove PCIe Only the very first prototypes had PCIe and there are no plant to add it in the future. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 092073263226b3f417597bb13145042c60b1ab93 Author: David Jander Date: Tue Apr 19 06:48:09 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: Put nON_SWITCH in own pinctrl grp Unify nON_SWITCH pinctrl configuration with imx6dl-victgo.dts. This patch is a preparation to reduce duplicated code between vicut1 and victgo. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 17efcc33e4f5fa3ffd62f6e5ce830106484817c0 Author: David Jander Date: Tue Apr 19 06:48:08 2022 +0200 ARM: dts: imx6qdl-vicut1.dtsi: remove TiWi module Only the first prototypes had a TiWi module. There is no publicly available hardware where this module is fitted and there are no plan to produce any. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit cc545760170590b5e6733ebfef8398f97d7dee05 Author: Fabio Estevam Date: Mon Apr 18 15:36:17 2022 -0300 arm64: dts: imx8mn-evk: Add UART3 support UART3 pins are available in the J1003 connector. Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 510c527b4ff574bda5c20429eb563eda63c41198 Author: Marek Vasut Date: Mon Apr 18 15:24:57 2022 +0200 arm64: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board Add new board based on the Toradex Verdin iMX8M Mini SoM, the MX8Menlo. The board is a compatible replacement for i.MX53 M53Menlo and features USB, multiple UARTs, ethernet, LEDs, SD and eMMC. Reviewed-by: Fabio Estevam Reviewed-by: Francesco Dolcini Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Francesco Dolcini Cc: Marcel Ziswiler Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 2fb822f82a59db899ba7b3a615cb0ddbc8c04f0f Author: Ping-Ke Shih Date: Thu Apr 21 20:09:03 2022 +0800 rtw89: 8852c: add chip_ops related to BTC Add some chip_ops to support BT coexistence to work properly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-15-pkshih@realtek.com commit f4ae7ccc2bbfa597db09ed5000a1efa4feb0d962 Author: Ping-Ke Shih Date: Thu Apr 21 20:09:02 2022 +0800 rtw89: 8852c: fill freq and band of RX status by PPDU report Hardware reports PPDU status containing encoded channel index to driver, so we decode it and then fill freq and band. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-14-pkshih@realtek.com commit 3ecca403d9bf714be570ca2a31569485618c9da0 Author: Ping-Ke Shih Date: Thu Apr 21 20:09:01 2022 +0800 rtw89: 8852c: implement chip_ops::get_thermal Read thermal value, and then we can use EWMA thermal value to do RF calibrations if the value is changed over a threshold. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-13-pkshih@realtek.com commit af0cac159b1c96633436b71a4a790d77a1d75858 Author: Ping-Ke Shih Date: Thu Apr 21 20:09:00 2022 +0800 rtw89: 8852c: implement chip_ops related to TX power Three chip_ops are implemented in this patch. The ::set_txpwr_ctrl and ::init_txpwr_unit are called when we up interface and then configure TX power registers to initial values. The ::set_txpwr_ctrl is to configure 'txpwr_ref' to make basic output TX power of OFDM and CCK rate to be the same. The ::init_txpwr_unit is to initialize TSSI (a method to do TX power compensation depends on thermal value) control and bandedge. The ::set_txpwr is called once switching channel. First, it sets TX power for each rate section (e.g. CCK, OFDM), and then sets TX power offset between 1SS and 2SS rate. Finally, it sets TX power limit to prevent power over regulation. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-12-pkshih@realtek.com commit cd89a47105dc697ee8a1e36f09147c2f0a03c830 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:59 2022 +0800 rtw89: 8852c: configure default BB TX/RX path 8852c propose new API to configure BB TX/RX path. Without fix patch, it can't transmit any packet. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-11-pkshih@realtek.com commit 16b44ed0ffd3ccb4bfe741a6ed88c08faf84efa4 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:58 2022 +0800 rtw89: add RF H2C to notify firmware IQK results in hardware has two copies that are used by firmware to switch these two to support MCC. This H2C tell firmware the corresponding channel and band of each IQK results, and currrent one. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-10-pkshih@realtek.com commit fc5f311fce742d906294360e378c1df631d2d692 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:57 2022 +0800 rtw89: don't flush hci queues and send h2c if power is off When disconnecting, it warns somethings after power is off, and we can't do HCI IO. So, add this patch to avoid below messages: rtw89_8852ce 0000:03:00.0: timed out to flush pci txch: 11 rtw89_8852ce 0000:03:00.0: failed to pre-release fwcmd Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-9-pkshih@realtek.com commit d7259cdbd05598ec7e1e5a14f4c3644d80331758 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:56 2022 +0800 rtw89: pci: allow to process RPP prior to TX BD RPP is to report certain skb(s) can be freed, and TX BD indicates which TX descriptors can be freed. Normally, TX BD is happened before RPP. In low power mode, RPP can happen ahead, so change flow to handle this case. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-8-pkshih@realtek.com commit 52edbb9fb78a24f355830da2e668db13689e3da6 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:55 2022 +0800 rtw89: ps: access TX/RX rings via another registers in low power mode In low power mode, we need to pause PCI to configure IMR and PCI ring index registers accordingly, because the regular registers are power-off in this mode. In the transition moment named paused in code, we can't touch ring index, so don't kick off DMA immediately. Instead, queue them into pending queue, and kick off after the moment. There are three low power modes, which are RF off/clock gate/power gate, but PCI enter low power mode in later two modes only. So, add a mask to achieve this. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-7-pkshih@realtek.com commit 98816def1973dfb493143de93446a273b9f83327 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:54 2022 +0800 rtw89: ser: re-enable interrupt in threadfn if under_recovery Normally, we re-enable interrupt by napi_poll, but for this special situation, we must turn it on immediately because napi_poll isn't scheduled. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-6-pkshih@realtek.com commit c83dcd0508e231f909be3f52fee5ccf4844896c8 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:53 2022 +0800 rtw89: pci: add a separate interrupt handler for low power mode In lower power mode, there are very low amount of RX, and it must process in a separated function instead of schedule_napi(), because the existing napi_poll does many things to optimize performance, but not all registers can access in low power mode. The simple way is to use threadfn to process the simple thing. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-5-pkshih@realtek.com commit 837202684657c2829bcdc057c1d25db751a6587b Author: Ping-Ke Shih Date: Thu Apr 21 20:08:52 2022 +0800 rtw89: pci: reclaim TX BD only if it really need To reclaim TX BD, we need to read hardware reading index to determine if any DMA is complete. Since this IO spends time, do this thing only if we really need it when TX BD has no free buffer corresponding to target skb. The experimental result shows that reading counter decreases from 26,000 to 130 per second. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-4-pkshih@realtek.com commit e1757e80450164ede118993a889979e65ead591b Author: Ping-Ke Shih Date: Thu Apr 21 20:08:51 2022 +0800 rtw89: pci: add variant RPWM/CPWM to enter low power mode RPWM/CPWM are registers that can set and check low power mode. Since chips use different address, add a field to access them in common flow. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-3-pkshih@realtek.com commit 948e521c728536db40dc7fba5a641f2115161802 Author: Ping-Ke Shih Date: Thu Apr 21 20:08:50 2022 +0800 rtw89: pci: add variant IMR/ISR and configure functions 8852CE uses different but similar IMR/ISR registers, and its masks are also different in various states, so add config_intr_mask ops to configure masks according to under_recovery or low_power states. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220421120903.73715-2-pkshih@realtek.com commit e0c1b8f9eba88173b30ba42eb492fd20582cf376 Merge: 4bbac9a1f58fb 22da5264abf49 Author: Arnaldo Carvalho de Melo Date: Sun Apr 24 07:50:49 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes, such as the llvm one for ubuntu:22.04. Signed-off-by: Arnaldo Carvalho de Melo commit 4bbac9a1f58fb74b436fbef43ec16017a580019a Author: Adrian Hunter Date: Fri Apr 22 19:23:42 2022 +0300 libperf evsel: Factor out perf_evsel__ioctl() Factor out perf_evsel__ioctl() so it can be reused. Signed-off-by: Adrian Hunter Cc: Alexey Bayduraev Cc: Ian Rogers Cc: Jiri Olsa Cc: Leo Yan Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220422162402.147958-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d7e3c397087fffde68389e7530093dbc2b70c48a Author: Zhengjun Xing Date: Fri Apr 22 14:56:35 2022 +0800 perf stat: Support hybrid --topdown option Since for cpu_core or cpu_atom, they have different topdown events groups. For cpu_core, --topdown equals to: "{slots,cpu_core/topdown-retiring/,cpu_core/topdown-bad-spec/, cpu_core/topdown-fe-bound/,cpu_core/topdown-be-bound/, cpu_core/topdown-heavy-ops/,cpu_core/topdown-br-mispredict/, cpu_core/topdown-fetch-lat/,cpu_core/topdown-mem-bound/}" For cpu_atom, --topdown equals to: "{cpu_atom/topdown-retiring/,cpu_atom/topdown-bad-spec/, cpu_atom/topdown-fe-bound/,cpu_atom/topdown-be-bound/}" To simplify the implementation, on hybrid, --topdown is used together with --cputype. If without --cputype, it uses cpu_core topdown events by default. # ./perf stat --topdown -a sleep 1 WARNING: default to use cpu_core topdown events Performance counter stats for 'system wide': retiring bad speculation frontend bound backend bound heavy operations light operations branch mispredict machine clears fetch latency fetch bandwidth memory bound Core bound 4.1% 0.0% 5.1% 90.8% 2.3% 1.8% 0.0% 0.0% 4.2% 0.9% 9.9% 81.0% 1.002624229 seconds time elapsed # ./perf stat --topdown -a --cputype atom sleep 1 Performance counter stats for 'system wide': retiring bad speculation frontend bound backend bound 13.5% 0.1% 31.2% 55.2% 1.002366987 seconds time elapsed Reviewed-by: Kan Liang Signed-off-by: Xing Zhengjun Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220422065635.767648-3-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 5b5bfecaa333fb6a0cce1bfc4852a622dacfed1d Author: SeongJae Park Date: Tue Apr 19 12:16:36 2022 +0000 scripts/get_abi: Fix wrong script file name in the help message The help message of 'get_abi.pl' is mistakenly saying it's 'abi_book.pl'. This commit fixes the wrong name in the help message. Fixes: bbc249f2b859 ("scripts: add an script to parse the ABI files") Signed-off-by: SeongJae Park Link: https://lore.kernel.org/r/20220419121636.290407-1-sj@kernel.org Signed-off-by: Greg Kroah-Hartman commit d0c19bed8cd3d005739c0a6374118c553564ef10 Author: Fabio Estevam Date: Fri Apr 22 15:31:29 2022 +0100 media: platform: imx-mipi-csis: Remove unneeded 'default n' There is no need to pass 'default n' in Kconfig, as by default the CONFIG_VIDEO_IMX_MIPI_CSIS option is not selected. Signed-off-by: Fabio Estevam Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit fe14b546d6e57542dbd4f5ccdb5a382904d26c5a Author: Laurent Pinchart Date: Mon Mar 21 15:11:35 2022 +0000 media: imx: imx-mipi-csis: Fix active format initialization on source pad Commit 5c0701a0e791 ("media: imx: csis: Store pads format separately") broke initialization of the active format on the source pad, as it forgot to update the .init_cfg() handler. Fix it. Fixes: 5c0701a0e791 ("media: imx: csis: Store pads format separately") Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Signed-off-by: Mauro Carvalho Chehab commit 851b270bc41d006ac8dddf15265f8a0fa0df9877 Author: Jacopo Mondi Date: Mon Mar 14 10:39:41 2022 +0000 media: imx: imx-mipi-csis: Protect mipi_csis_dump_regs() The mipi_csis_dump_regs() function accesses the interface registers in order to printout their values for debug purposes. As the function access the registers, it requires the interface to be powered up. Currently this is only enforced in one of the function's callers (mipi_csis_log_status)() but not when the function is called by the debugfs attribute handler. Make sure to access registers only if the interface is powered up and remove the same check from the caller. Signed-off-by: Jacopo Mondi Acked-by: Rui Miguel Silva Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e273454c50c33b32203ec93aafb52cc32546e99c Author: Jacopo Mondi Date: Mon Mar 14 10:39:38 2022 +0000 media: imx: imx-mipi-csis: Drop powered flag The mipi_csis_device.powered flag only serves for the purpose of not accessing registers in mipi_csis_log_status() when the interface is not powered up. Instead of manually tracking the power state, rely on pm_runtime_get_if_in_use() to remove the 'powered' flag. Also remove the locking in the function as runtime_pm() is refcounted and there's no risk of the interface being powered down behind our backs. Signed-off-by: Jacopo Mondi Acked-by: Rui Miguel Silva Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit df4167d9c5af4d07cab71bde3a88f35c57dd319f Author: Jacopo Mondi Date: Mon Mar 14 10:39:37 2022 +0000 media: imx: imx-mipi-csis: Simplify mipi_csis_s_stream() Simplify the mipi_csis_s_stream() function. This actually fixes a bug, as if calling the subdev's s_stream(1) fails, mipi_csis_stop_stream() was not called. Signed-off-by: Jacopo Mondi Acked-by: Rui Miguel Silva Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit c22afddcf7c5001c00010c38f67689cf19e5fb65 Author: Laurent Pinchart Date: Fri Mar 11 13:29:03 2022 +0000 media: imx: imx-mipi-csis: Simplify runtime PM implementation The runtime PM resume handler is guaranteed to be called on a suspended device, and the suspend handler on a resumed device. The implementation can thus be simplified. While at it, rename the mipi_csis_device state field to powered, as the now state contains a single flag only. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 2eab8739b6f6b3076a93d4b57f1b7cc92253b7c3 Author: Laurent Pinchart Date: Fri Mar 11 13:29:03 2022 +0000 media: imx: imx-mipi-csis: Don't stop streaming at runtime suspend time Streaming is guaranteed to have been stopped by the time the device gets runtime suspended, as pm_runtime_put() is called from .s_stream(0) only. Drop the manual stop. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 24aad87b48f4d9987221a81d9fff927713540c5e Author: Laurent Pinchart Date: Fri Mar 11 13:29:03 2022 +0000 media: imx: imx-mipi-csis: Drop unneeded system PM implementation There's no need to implement system suspend/resume manually, as video pipelines are supposed to be suspended in a controlled and ordered manner by the data sink driver at system suspend time (and similarly at resume time). Drop the system suspend/resume handlers. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 284dd84878346d85d44466cdb8d263e61de0fa46 Author: Laurent Pinchart Date: Fri Mar 11 13:29:03 2022 +0000 media: imx: imx-mipi-csis: Don't use .s_power() The subdev .s_power() operation is deprecated. Drop it, requiring sensor drivers to correctly use runtime PM instead of relying on .s_power(). As this driver has just been moved out of staging, and necessary drivers to implement a full camera pipeline are still in staging, no platform depends yet on this API being called. There is thus no risk of regression. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit c1cc03eafd319369075dd66b091bd8d309a5b726 Author: Laurent Pinchart Date: Tue Feb 22 09:50:25 2022 +0000 media: imx: imx-mipi-csis: Rename csi_state to mipi_csis_device Usage of "state" for the device-specific data structure is confusing, as it can also refer to the subdev state. Rename the structure to mipi_csis_device, and the corresponding state variables to csis. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab commit 309373a3571ef7175bd9da0c9b13476a718e8478 Author: Chen-Yu Tsai Date: Thu Mar 31 09:49:06 2022 +0100 media: hantro: Empty encoder capture buffers by default The payload size for encoder capture buffers is set by the driver upon finishing encoding each frame, based on the encoded length returned from hardware, and whatever header and padding length used. Setting a non-zero default serves no real purpose, and also causes issues if the capture buffer is returned to userspace unused, confusing the application. Instead, always set the payload size to 0 for encoder capture buffers when preparing them. Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver") Fixes: 082aaecff35f ("media: hantro: Fix .buf_prepare") Signed-off-by: Chen-Yu Tsai Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit daf3999c12dcef14151710052fca9adfbc3967bc Author: Chen-Yu Tsai Date: Thu Mar 31 10:16:28 2022 +0100 media: hantro: Implement support for encoder commands The V4L2 stateful encoder uAPI specification requires that drivers support the ENCODER_CMD ioctl to allow draining of buffers. This however was not implemented, and causes issues for some userspace applications. Implement support for the ENCODER_CMD ioctl using v4l2-mem2mem helpers. This is entirely based on existing code found in the vicodec test driver. Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver") Signed-off-by: Chen-Yu Tsai Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit acd134bca2ac4390eb4920d54bdfeecc7fe47bcb Author: Piotr Oniszczuk Date: Mon Feb 14 21:29:55 2022 +0000 media: dt-bindings: media: rockchip-vpu: Add RK3568 compatible RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP8 video formats. This patch adds RK3568 compatible in rockchip-vpu dt-bindings. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 5f6bfab6da6531238e899fdf29efd6d0185adc3e Author: Piotr Oniszczuk Date: Mon Feb 14 21:29:53 2022 +0000 media: hantro: Add support for Hantro G1 on RK356x RK356x has Hantro G1 video decoder capable to decode MPEG2/H.264/VP8 video formats. This patch adds support for RK356x family in existing Hantro video decoder kernel driver. Tested on [1] with FFmpeg v4l2_request code taken from [2] with MPEG2, H.642 and VP8 samples with results [3]. [1] https://github.com/warpme/minimyth2 [2] https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/multimedia/ffmpeg/patches/v4l2-request/ffmpeg-001-v4l2-request.patch [3] https://github.com/warpme/minimyth2/blob/master/video-test-summary.txt Signed-off-by: Piotr Oniszczuk Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9a6a70d65cd7d25bad00580157ad660330023d8 Author: Ming Qian Date: Thu Apr 14 09:57:22 2022 +0100 media: amphion: fix decoder's interlaced field For interlaced frame, the amphion vpu will store the two fields sequential into one buffer, top-bottom order so the field should be set to V4L2_FIELD_SEQ_TB. fix the previous bug that set it to V4L2_FIELD_SEQ_BT wrongly. Fixes: 6de8d628df6e ("media: amphion: add v4l2 m2m vpu decoder stateful driver") Signed-off-by: Ming Qian Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 802239d55d0a76ac2718ed322ee3f2e41c20f6a6 Author: Wan Jiabing Date: Mon Apr 11 11:56:49 2022 +0100 media: saa7134: simplify if-if to if-else use if and else instead of if(A) and if (!A). Signed-off-by: Wan Jiabing Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2394eaeebd90270aae88284ad0d3b5c94cb2846c Author: Ming Qian Date: Mon Apr 11 09:19:53 2022 +0100 media: imx-jpeg: don't change byteused of queued buffer Don't change the output buffer's bytesused set by user. Drop allow_zero_bytesused, since it's deprecated. This should also guarantee it's the application's responsibility to set bytesused for the output buffer. Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2203436a4d24302871617373a7eb21bc17e38762 Author: Zheyu Ma Date: Sun Apr 10 08:44:09 2022 +0100 media: cx25821: Fix the warning when removing the module When removing the module, we will get the following warning: [ 14.746697] remove_proc_entry: removing non-empty directory 'irq/21', leaking at least 'cx25821[1]' [ 14.747449] WARNING: CPU: 4 PID: 368 at fs/proc/generic.c:717 remove_proc_entry+0x389/0x3f0 [ 14.751611] RIP: 0010:remove_proc_entry+0x389/0x3f0 [ 14.759589] Call Trace: [ 14.759792] [ 14.759975] unregister_irq_proc+0x14c/0x170 [ 14.760340] irq_free_descs+0x94/0xe0 [ 14.760640] mp_unmap_irq+0xb6/0x100 [ 14.760937] acpi_unregister_gsi_ioapic+0x27/0x40 [ 14.761334] acpi_pci_irq_disable+0x1d3/0x320 [ 14.761688] pci_disable_device+0x1ad/0x380 [ 14.762027] ? _raw_spin_unlock_irqrestore+0x2d/0x60 [ 14.762442] ? cx25821_shutdown+0x20/0x9f0 [cx25821] [ 14.762848] cx25821_finidev+0x48/0xc0 [cx25821] [ 14.763242] pci_device_remove+0x92/0x240 Fix this by freeing the irq before call pci_disable_device(). Signed-off-by: Zheyu Ma Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e8123311cf06d7dae71e8c5fe78e0510d20cd30b Author: Zheyu Ma Date: Sun Apr 10 08:34:41 2022 +0100 media: pci: cx23885: Fix the error handling in cx23885_initdev() When the driver fails to call the dma_set_mask(), the driver will get the following splat: [ 55.853884] BUG: KASAN: use-after-free in __process_removed_driver+0x3c/0x240 [ 55.854486] Read of size 8 at addr ffff88810de60408 by task modprobe/590 [ 55.856822] Call Trace: [ 55.860327] __process_removed_driver+0x3c/0x240 [ 55.861347] bus_for_each_dev+0x102/0x160 [ 55.861681] i2c_del_driver+0x2f/0x50 This is because the driver has initialized the i2c related resources in cx23885_dev_setup() but not released them in error handling, fix this bug by modifying the error path that jumps after failing to call the dma_set_mask(). Signed-off-by: Zheyu Ma Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f83bd49cbc373983ba79bf4cd55fb6bff7901d36 Author: Yan Lei Date: Sun Apr 10 02:58:54 2022 +0100 media: v4l2: fix uninitialized value tuner_status(CWE-457) Declaring variable "tuner_status" without initializer. Using uninitialized value "tuner_status" when calling "*fe_tuner_ops->get_status". (The function pointer resolves to "cx24113_get_status".) Signed-off-by: Yan Lei Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 03b49ec8715a99192c35dfa86bdd31b61fbf303e Author: Kwang Son Date: Thu Apr 7 07:26:07 2022 +0100 media: docs: Fix vimc default pipeline graph RGB/YUV Input is sensor type and it should be sub-dev node. To generate this dot graph sudo modprobe vimc media-ctl --print-dot Signed-off-by: Kwang Son Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit eb2fd187abc878a2dfad46902becb74963473c7d Author: Nicolas Dufresne Date: Wed Apr 6 21:23:43 2022 +0100 media: coda: Add more H264 levels for CODA960 Add H264 level 1.0, 4.1, 4.2 to the list of supported formats. While the hardware does not fully support these levels, it does support most of them. The constraints on frame size and pixel formats already cover the limitation. This fixes negotiation of level on GStreamer 1.17.1. Cc: stable@vger.kernel.org Fixes: 42a68012e67c2 ("media: coda: add read-only h.264 decoder profile/level controls") Suggested-by: Philipp Zabel Signed-off-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7110c08ea71953a7fc342f0b76046f72442cf26c Author: Nicolas Dufresne Date: Wed Apr 6 21:23:42 2022 +0100 media: coda: Fix reported H264 profile The CODA960 manual states that ASO/FMO features of baseline are not supported, so for this reason this driver should only report constrained baseline support. This fixes negotiation issue with constrained baseline content on GStreamer 1.17.1. ASO/FMO features are unsupported for the encoder and untested for the decoder because there is currently no userspace support. Neither GStreamer parsers nor FFMPEG parsers support ASO/FMO. Cc: stable@vger.kernel.org Fixes: 42a68012e67c2 ("media: coda: add read-only h.264 decoder profile/level controls") Signed-off-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Tested-by: Pascal Speck Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d387c6f64028ff181c83e67ba6a938ebdace78b6 Author: Ming Qian Date: Wed Apr 6 10:47:33 2022 +0100 media: imx-jpeg: Correct the pixel format of rgb The hardware is capable of encoding/decoding RGB and ARGB formats in whatever order the color components are, but the resulting jpegs look good if we start with raw data in BGR/ABGR order, so we will further only support V4L2_PIX_FMT_BGR24 and V4L2_PIX_FMT_ABGR32. Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7aa65a75f894a2974422fe2bc8281295310f7eb6 Author: Ming Qian Date: Wed Apr 6 10:47:03 2022 +0100 media: imx-jpeg: Add pm-sleep support for imx-jpeg Wait finishing jpeg job before system sleep, otherwise the encoding/decoding can't be resumed after suspend. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e4b5793633964c1508d0e84ae79314b331ef1a0c Author: Philipp Zabel Date: Wed Apr 6 09:53:53 2022 +0100 media: coda: jpeg: start streaming without valid header Stop bailing out on JPEG header parsing errors during streamon. This allows userspace to provide valid output buffers later and fixes a v4l2-compliance streaming test failure: fail: v4l2-test-buffers.cpp(1429): node->streamon(q.g_type()) test MMAP (no poll): FAIL Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 26087650eb351cb7541ac3ad09dd0a3e122bf36f Author: Philipp Zabel Date: Wed Apr 6 09:53:52 2022 +0100 media: coda: jpeg: improve header parse error message If JPEG header parsing fails, output a single message instead of two messages that say the same thing. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d2cc715a56df87a9422740d2d62fbf8f5ea4a33b Author: Philipp Zabel Date: Wed Apr 6 09:53:51 2022 +0100 media: coda: jpeg: set buffer error flag when header parsing fails If decoding fails because the output buffer does not contain a valid header, set the error flag on the returned capture buffer. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 7e32aab9f47d54326ef5aab3a38f70727fae4c23 Author: Philipp Zabel Date: Wed Apr 6 09:51:45 2022 +0100 media: coda: add JPEG downscale support The JPEG decoder in the CODA960 VPU can downscale images while decoding, with a factor of 1/2, 1/4, or 1/8. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fb11bc40c4cb83741540bd8da6ad93155868c466 Author: Colin Ian King Date: Tue Apr 5 18:59:59 2022 +0100 media: platform: samsung: remove redundant assignment to variable m The variable m is being assigned a value that is never read, it is being re-assigned in both paths of the following if-statement. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 375acc17b108916de7357a6fad42e8bff61cd47d Author: Philipp Zabel Date: Tue Apr 5 14:55:17 2022 +0100 media: coda: consolidate job_finish calls on decoder prepare_run failure If the decoder prepare_run callback returns an error, the hardware is never started and v4l2_m2m_job_finish() is called immediately, currently in every error path. Remove the duplicated job_finish calls from the error paths and reuse the v4l2_m2m_job_finish() at the end of coda_pic_run_work instead. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 87e0ce68cc0216063c6329aca0c31961a33a5372 Author: Philipp Zabel Date: Tue Apr 5 14:50:35 2022 +0100 media: coda: assert bitstream mutex is locked in coda_fill_bitstream coda_fill_bitstream() must be called under the bitstream mutex. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bf5071cccb823582dc62dda1404f76bb6cb163f6 Author: Philipp Zabel Date: Mon Apr 4 17:35:30 2022 +0100 media: coda: disable stateful encoder ioctls for jpeg encoder Use v4l2_disable_ioctl() to disable the stateful encoder ioctls VIDIOC_ENUM_FRAMEINTERVALS, VIDIOC_G_PARM, and VIDIOC_S_PARM for the jpeg encoder device, to fix this v4l2-compliance test failure: fail: v4l2-test-formats.cpp(68): node->is_m2m && !(node->codec_mask & STATEFUL_ENCODER) test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL fail: v4l2-test-formats.cpp(1363): node->is_m2m && !is_stateful_enc test VIDIOC_G/S_PARM: FAIL Signed-off-by: Philipp Zabel Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ca43692ae15ed74d47a794884588dc7ff5afb384 Author: Philipp Zabel Date: Mon Apr 4 17:35:29 2022 +0100 media: coda: disable encoder ioctls for decoder devices Use v4l2_disable_ioctl() to disable the encoder ioctls VIDIOC_ENUM_FRAMESIZES, VIDIOC_ENUM_FRAMEINTERVALS, VIDIOC_G_PARM, and VIDIOC_S_PARM, to fix this v4l2-compliance test failure: fail: v4l2-test-formats.cpp(1363): node->is_m2m && !is_stateful_enc test VIDIOC_G/S_PARM: FAIL Signed-off-by: Philipp Zabel Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e7326bec7b07d4608894ba726d7a8f5e88565862 Author: Philipp Zabel Date: Mon Apr 4 17:35:28 2022 +0100 media: coda: disable encoder cmd ioctl on decoder and vice versa Use v4l2_disable_ioctl() to disable the VIDIOC_TRY_ENCODER_CMD and VIDIOC_ENCODER_CMD ioctls on decoder video devices and the VIDIOC_TRY_DECODER_CMD and VIDIOC_DECODER_CMD ioctls on encoder video devices. This allows to drop the coda_try_encoder/decoder_cmd() functions and to use v4l2_m2m_ioctl_try_encoder/decoder_cmd() directly. Signed-off-by: Philipp Zabel Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fc503c8a3f12af7093da60f790e6830f8ca5b23d Author: Dikshita Agarwal Date: Tue Apr 19 06:06:43 2022 +0100 media: venus: venc: Add support for intra-refresh type Add support for intra-refresh type v4l2 control. Signed-off-by: Dikshita Agarwal Acked-by: Hans Verkuil Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit fcbc4acf8b8dff5fc420a14026bd4ab1798cf465 Author: Dikshita Agarwal Date: Tue Apr 19 06:06:42 2022 +0100 media: v4l2-ctrls: Add intra-refresh type control Add a control to set intra-refresh type. Signed-off-by: Dikshita Agarwal Reviewed-by: Nicolas Dufresne Acked-by: Hans Verkuil Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit ef15219c3e25e1c4427ffebd2de9ab5f73b29b45 Author: Stanimir Varbanov Date: Thu Mar 3 15:06:36 2022 +0000 media: venus: vdec: Use output resolution on reconfigure When recalculate output buffer size we have to take into account the output resolution from the firmware received during event change notification. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit cef92b14e6535d550d571b99e753b04e44423286 Author: Stanimir Varbanov Date: Thu Mar 3 15:06:35 2022 +0000 media: venus: Add a handling of QC10C compressed format This adds QC10C compressed pixel format in the Venus driver, and make it possible to discover from v4l2 clients. Note: The QC10C format will be enumerable via VIDIOC_ENUM_FMT when the bitstream is 10-bits and the headers are parsed. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 1af7d8dacfc926c9bf73d21035e1fc78655fed07 Author: Stanimir Varbanov Date: Thu Mar 3 15:06:34 2022 +0000 media: venus: hfi_platform: Correct supported compressed format In multistream mode HFI supports TP10_UBWC on output2. Correct this in supported formats capabilities list. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 9593126dae3e6a68c86dc2038d9922178a2e363d Author: Stanimir Varbanov Date: Thu Mar 3 15:06:33 2022 +0000 media: venus: Add a handling of QC08C compressed format This adds QC08C compressed pixel format in the Venus driver, and make it possible to discover from v4l2 clients. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit fc00086ed767972553958d4d04c0bb017eec55b1 Author: Stanimir Varbanov Date: Thu Mar 3 15:06:32 2022 +0000 media: venus: helpers: Add helper to check supported pixel formats Add a helper to check supported pixel format per codec and session type. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 2308d5aff8d083a44aa02197d2f5687b73d98f82 Author: Stanimir Varbanov Date: Thu Mar 3 15:06:31 2022 +0000 media: v4l: Add Qualcomm custom compressed pixel formats Add custom Qualcomm raw compressed pixel formats. They are used in Qualcomm SoCs to optimize the interconnect bandwidth. Signed-off-by: Stanimir Varbanov Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 59685fdfac6d7343c4047f2acfbc5bce8971b0f9 Author: Vikash Garodia Date: Tue Apr 12 14:15:11 2022 +0100 media: venus: vdec: ensure venus is powered on during stream off Video decoder driver auto-suspends the hardware if there is no exchange of command or response for certain amount of time. In auto suspended state, it becomes mandatory to power on the hardware before requesting it to process a command. The fix ensures the hardware is powered on during stop streaming. Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 73664f107c0fafb59cd91e576b81c986adb74610 Author: Vikash Garodia Date: Tue Apr 12 14:15:10 2022 +0100 media: venus: do not queue internal buffers from previous sequence During reconfig (DRC) event from firmware, it is not guaranteed that all the DPB(internal) buffers would be released by the firmware. Some buffers might be released gradually while processing frames from the new sequence. These buffers now stay idle in the dpblist. In subsequent call to queue the DPBs to firmware, these idle buffers should not be queued. The fix identifies those buffers and free them. Signed-off-by: Vikash Garodia Tested-by: Fritz Koenig Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 86594f6af867b5165d2ba7b5a71fae3a5961e56c Author: Luca Weiss Date: Fri Jan 14 11:02:26 2022 +0000 media: venus: hfi: avoid null dereference in deinit If venus_probe fails at pm_runtime_put_sync the error handling first calls hfi_destroy and afterwards hfi_core_deinit. As hfi_destroy sets core->ops to NULL, hfi_core_deinit cannot call the core_deinit function anymore. Avoid this null pointer derefence by skipping the call when necessary. Signed-off-by: Luca Weiss Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 90307ebe5a562d6bdfa06c440cefccaceeaa6f4f Author: Luca Weiss Date: Fri Jan 14 11:02:25 2022 +0000 media: venus: hfi: Add error message for timeout error This error can appear with wrong configuration and is difficult to find as it just returns -ETIMEDOUT with no further message. Signed-off-by: Luca Weiss Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 011d7456e5a17cd498ef7c0b59877d439091e524 Author: Philipp Zabel Date: Tue Apr 12 08:29:05 2022 +0100 media: video-mux: Use dev_err_probe() Simplify the mux error path a bit by using dev_err_probe(). Signed-off-by: Philipp Zabel Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3bf96b6eeb6149a2b3b2df73fa6b32b2e6e41a2b Author: Kate Hsuan Date: Fri Apr 8 11:42:22 2022 +0100 media: staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used An not calibrated x_start setting would result in an incorrect AWB grid configuration on a sensor when only the rightmost stripe is used. If the AWB grid coordinate is set to the rightmost stripe, for example, x_start is greater than 640, the AWB grid will be at the rightmost edge of the sensor. The AWB statistic will be fetched from the wrong place of the sensor and results in an incorrect AWB estimation result. Therefore, stripe offset should subtract from x_start to have a correct grid configuration for the rightmost stripe. Signed-off-by: Kate Hsuan Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3c9b04d9631ef49e8b3aad72607b09099c18e40d Author: Ian Jamison Date: Fri Apr 8 18:53:45 2022 +0100 media: media-entity.h: Fix documentation for media_create_intf_link The documentation comment was inserted between the return type and the function name. Reunite the lines. Signed-off-by: Ian Jamison Fixes: db7ee32aa185 ("[media] media-device.h: Improve documentation and update it") Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3d22dd432889f2f538b53f36f9f6bcd54825fc22 Author: Masahiro Yamada Date: Mon Mar 28 17:01:53 2022 +0100 media: media.h: remove unneeded inclusion Commit b3b7a9f138b7 ("[media] media-device: Use u64 ints for pointers") added this #include , presumably in order to use uintptr_t. Now that it is gone, we can compile this for userspace without . Signed-off-by: Masahiro Yamada Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b4657e00115d0c87970a2386338b70fa95ef4ac6 Author: Uwe Kleine-König Date: Thu Mar 31 14:31:32 2022 +0100 media: i2c: dw9714: Return zero in remove callback The only effect of returning an error code in an i2c remove callback is that the i2c core emits a generic warning and still removes the device. So even if disabling the regulator fails it's sensible to further cleanup and then return zero to only emit a single error message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 02276e18defa2fccf16413b44440277d98c2b1ea Author: Zheyu Ma Date: Thu Apr 14 03:34:35 2022 +0100 media: i2c: dw9714: Disable the regulator when the driver fails to probe When the driver fails to probe, we will get the following splat: [ 59.305988] ------------[ cut here ]------------ [ 59.306417] WARNING: CPU: 2 PID: 395 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 59.310345] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 59.318362] Call Trace: [ 59.318582] [ 59.318765] regulator_put+0x1f/0x30 [ 59.319058] devres_release_group+0x319/0x3d0 [ 59.319420] i2c_device_probe+0x766/0x940 Fix this by disabling the regulator in error handling. Signed-off-by: Zheyu Ma Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4d19e0662fcc9e2f3bdada2c4e45dab36bd64a71 Author: Tom Rix Date: Sun Mar 13 16:04:57 2022 +0000 media: i2c: cleanup comments For spdx, remove leading space Replacements parametrize to parameterize Signed-off-by: Tom Rix Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ab0589af587e3a340620dee5525113f8ada9caf8 Author: Julia Lawall Date: Mon Mar 14 11:53:33 2022 +0000 media: i2c: ov5695: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 378a0e4ba89892f78fcab64f03f57f99714a1914 Author: Moses Christopher Bollavarapu Date: Thu Mar 17 14:47:14 2022 +0000 media: ov7640: Use ARRAY_SIZE instead of manual checking Currently, the driver ends the reg-val list with a 0xFF as a check to stop the loop. Instead an array of reg-vals can be used to avoid this check, by using the ARRAY_SIZE(arr) macro to obtain the length of the array and iterate over it. Signed-off-by: Moses Christopher Bollavarapu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7dd0f93a31af03cba81c684c4c361bba510ffe71 Author: Sakari Ailus Date: Wed Apr 13 13:15:58 2022 +0100 media: Revert "media: dw9768: activate runtime PM and turn off device" This reverts commit c09d776eaa060534a1663e3b89d842db3e1d9076. Revert the commit as it breaks runtime PM support on OF based systems. More fixes to the driver are needed. Signed-off-by: Sakari Ailus Reviewed-by: Tomasz Figa Reviewed-by: Bingbu Cao Signed-off-by: Mauro Carvalho Chehab commit 660440a9076b4dcfcc08f56c3cc8c41e3ed6376e Author: Tomi Valkeinen Date: Tue Apr 12 10:42:49 2022 +0100 media: Documentation: add documentation about subdev state Add documentation about centrally managed subdev state. Signed-off-by: Tomi Valkeinen Reviewed-by: Jacopo Mondi Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 14a6fca77ad122208a6db10e2abda2d7369c48a4 Author: Tomi Valkeinen Date: Tue Apr 12 10:42:48 2022 +0100 media: subdev: add v4l2_subdev_get_fmt() helper function Add v4l2_subdev_get_fmt() helper function which implements v4l2_subdev_pad_ops.get_fmt using active state. Subdev drivers that support active state and do not need to do anything special in their get_fmt op can use this helper directly for v4l2_subdev_pad_ops.get_fmt. Signed-off-by: Tomi Valkeinen Reviewed-by: Hans Verkuil Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit b2ac238724af5c40d74391c2af1b9e9d565d41c5 Author: Tomi Valkeinen Date: Tue Apr 12 10:42:47 2022 +0100 media: subdev: add locking wrappers to subdev op wrappers It is common that media drivers call subdev ops in source subdevs, and pass NULL as the state. This was the way to indicate that the callee should use the callee's private active state. E.g.: v4l2_subdev_call(priv->source_sd, pad, get_fmt, NULL, &sd_fmt); Now that we have a real subdev active state in the v4l2_subdev struct, we want the caller to pass a proper state (when available). And furthermore, the state should be locked. This would mean changing all the callers, which is the long term goal. To fix this issue in the short term, let's add an extra wrapper layer to all v4l2_subdev_call_pad_wrappers which deal with states. These wrappers handle the state == NULL case by using the locked active state instead (when available). Signed-off-by: Tomi Valkeinen Reviewed-by: Hans Verkuil Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ed647ea668fb27cd21408d5cb7cc7d4c30417332 Author: Tomi Valkeinen Date: Tue Apr 12 10:42:46 2022 +0100 media: subdev: add subdev state locking The V4L2 subdevs have managed without centralized locking for the state (previously pad_config), as the try-state is supposedly safe (although I believe two TRY ioctls for the same fd would race), and the active-state, and its locking, is managed by the drivers internally. We now have active-state in a centralized position, and need locking. Strictly speaking the locking is only needed for new drivers that use the new state, as the current drivers continue behaving as they used to. However, active-state locking is complicated by the fact that currently the real active-state of a subdev is split into multiple parts: the new v4l2_subdev_state, subdev control state, and subdev's internal state. In the future all these three states should be combined into one state (the v4l2_subdev_state), and then a single lock for the state should be sufficient. But to solve the current split-state situation we need to share locks between the three states. This is accomplished by using the same lock management as the control handler does: we use a pointer to a mutex, allowing the driver to override the default mutex. Thus the driver can do e.g.: sd->state_lock = sd->ctrl_handler->lock; before calling v4l2_subdev_init_finalize(), resulting in sharing the same lock between the states and the controls. The locking model for active-state is such that any subdev op that gets the state as a parameter expects the state to be already locked by the caller, and expects the caller to release the lock. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3cc7a4bbc3817ed79fc66122eb7cfbbc9b2ed17d Author: Tomi Valkeinen Date: Tue Apr 12 10:42:45 2022 +0100 media: subdev: pass also the active state to subdevs from ioctls At the moment when a subdev op is called, the TRY subdev state (subdev_fh->state) is passed as a parameter even for the ACTIVE case, or alternatively a NULL can be passed for ACTIVE case. This used to make sense, as the ACTIVE state was handled internally by the subdev drivers. We now have a state for the ACTIVE case in a standard place, and can pass that also to the drivers. This patch changes the subdev ioctls to either pass the TRY or ACTIVE state to the subdev. Unfortunately many drivers call ops from other subdevs, and implicitly pass NULL as the state, so this is just a partial solution. A coccinelle spatch could perhaps be created which fixes the drivers' subdev calls. For all current upstream drivers this doesn't matter, as they do not expect to get a valid state for ACTIVE case. But future drivers which support multiplexed streaming and routing will depend on getting a state for both active and try cases. For new drivers we can mandate that the pipelines where the drivers are used need to pass the state properly, or preferably, not call such subdev ops at all. However, if an existing subdev driver is changed to support multiplexed streams, the driver has to consider cases where its ops will be called with NULL state. The problem can easily be solved by using the v4l2_subdev_lock_and_get_active_state() helper, introduced in a follow up patch. Another follow up patch adds wrappers for pad ops dealing with subdev state, which automate the use of v4l2_subdev_lock_and_get_active_state() for cases where the state is NULL. Signed-off-by: Tomi Valkeinen Reviewed-by: Hans Verkuil Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2f91838c3b717b4b0b5dab005a7e50d3933bbdcd Author: Tomi Valkeinen Date: Tue Apr 12 10:42:44 2022 +0100 media: subdev: rename v4l2_subdev_get_pad_* helpers The subdev state is now used for both try and active cases. Rename rename v4l2_subdev_get_try_* helpers to v4l2_subdev_get_pad_*. Temporary wapper helper macros are added to keep the drivers using v4l2_subdev_get_try_* compiling. The next step is to change the uses in th drivers, and then drop the helpers. Signed-off-by: Tomi Valkeinen Reviewed-by: Hans Verkuil Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f69952a4dc1ef13b69497408fedbd12c7ceb294d Author: Tomi Valkeinen Date: Tue Apr 12 10:42:43 2022 +0100 media: subdev: add active state to struct v4l2_subdev Add a new 'active_state' field to struct v4l2_subdev to which we can store the active state of a subdev. This will place the subdev configuration into a known place, allowing us to use the state directly from the v4l2 framework, thus simplifying the drivers. Also add functions v4l2_subdev_init_finalize() and v4l2_subdev_cleanup(), which will allocate and free the active state. The functions are named in a generic way so that they can be also used for other subdev initialization work. Signed-off-by: Tomi Valkeinen Reviewed-by: Hans Verkuil Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 40aaab9d773b07e9b106eac4256bb50fb1ba8cff Author: Tomi Valkeinen Date: Tue Apr 12 10:42:42 2022 +0100 media: subdev: rename subdev-state alloc & free v4l2_subdev_alloc_state() and v4l2_subdev_free_state() are not supposed to be used by the drivers. However, we do have a few drivers that use those at the moment, so we need to expose these functions for the time being. Prefix the functions with __ to mark the functions as internal. At the same time, rename them to v4l2_subdev_state_alloc and v4l2_subdev_state_free to match the style used for other functions like video_device_alloc() and media_request_alloc(). Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e550c3709237b8fa5740dfba3f513e1d5bd9c6c8 Author: Tomi Valkeinen Date: Tue Apr 12 10:42:41 2022 +0100 media: v4l2-subdev: drop extra #ifdef subdev_open() is inside #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API, which depends on CONFIG_MEDIA_CONTROLLER, so there's no need for an extra Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit dadd47d46818c7587f769287aa4acca152d48039 Author: Tomi Valkeinen Date: Tue Apr 12 10:42:40 2022 +0100 media: v4l2-subdev: fix #endif comments Add comments after #endifs to clarify their scope. Signed-off-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ba449bb56203aedc4530a82b0f3f83358808b7f2 Author: Jacopo Mondi Date: Mon Mar 28 17:32:20 2022 +0100 media: i2c: ov5645: Fix media bus format The ov5645 driver reports as its unique supported format MEDIA_BUS_FMT_UYVY8_2X8, which is not correct as the sensor uses the MIPI CSI-2 serial bus. Fix that by using MEDIA_BUS_FMT_UYVY8_1X16 instead. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 282b4d26076c773b3d906f0a6937a05cafaecc16 Author: Hangyu Hua Date: Thu Mar 24 10:27:52 2022 +0000 media: mc: delete redundant code in __media_device_unregister_entity media_gobj_destroy has already set graph_obj.mdev to NULL. There is no need to set it again. [Sakari Ailus: Remove extra newline, rewrap commit msg] Signed-off-by: Hangyu Hua Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit dbdc7237ec71316e99c1905264cc00b88e277e57 Author: Umang Jain Date: Fri Mar 18 12:18:26 2022 +0000 media: staging/intel-ipu3: Cleanup dummy buffers via helper Use an existing helper imgu_video_nodes_exit() on imgu-video-node initialization failure path to cleanup dummy buffers. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1ad037645a81a0b446f9ea5a53e2d3abad33dc56 Author: Umang Jain Date: Fri Mar 18 12:18:25 2022 +0000 media: staging/intel-ipu3: Reset imgu_video_device sequence Reset the sequence number of imgu_video_device on stream start. Failing to do so results in sequence number getting incremented for consecutive stream on/off cycles. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1f391df446077d62514ee29f75970dff3d55a432 Author: Laurent Pinchart Date: Mon Mar 21 14:51:34 2022 +0000 media: v4l2-async: Use endpoints in __v4l2_async_nf_add_fwnode_remote() Matching on device fwnode handles is deprecated in favour of endpoint fwnode handles. Switch the __v4l2_async_nf_add_fwnode_remote() function to use the latter. The match code handles backward compatibility by falling by to the device fwnode handle, so this shouldn't introduce any regression. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 229fac6c44dcade7b4c40031ec5fac3134453e77 Author: Sakari Ailus Date: Fri Mar 18 16:08:12 2022 +0000 media: staging: media: ipu3-imgu: Request specific firmware binary Primarily request a specific revision of the IPU3 firmware that the driver is known to work with, irci_irci_ecr-master_20161208_0213_20170112_1500.bin. Some distros only ship this while others provide a symlink called ipu3-fw.bin, which the driver only requested previously. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2425c81fc452c510a18172202b0c6c50b125b2c2 Author: Kate Hsuan Date: Thu Mar 17 07:57:13 2022 +0000 media: staging: media: ipu3: Fix AF x_start position when rightmost stripe is used For the AF configuration, if the rightmost stripe is used, the AF scene will be at the incorrect location of the sensor. The AF coordinate may be set to the right part of the sensor. This configuration would lead to x_start being greater than the down_scaled_stripes offset and the leftmost stripe would be disabled and only the rightmost stripe is used to control the AF coordinate. If the x_start doesn't perform any adjustments, the AF coordinate will be at the wrong place of the sensor since down_scaled_stripes offset would be the new zero of the coordinate system. In this patch, if only the rightmost stripe is used, x_start should minus down_scaled_stripes offset to maintain its correctness of AF scene coordinate. Signed-off-by: Kate Hsuan Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 365ab7ebc24eebb42b9e020aeb440d51af8960cd Author: Laurentiu Palcu Date: Mon Mar 7 16:46:07 2022 +0000 media: i2c: max9286: fix kernel oops when removing module When removing the max9286 module we get a kernel oops: Unable to handle kernel paging request at virtual address 000000aa00000094 Mem abort info: ESR = 0x96000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=0000000880d85000 [000000aa00000094] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: fsl_jr_uio caam_jr rng_core libdes caamkeyblob_desc caamhash_desc caamalg_desc crypto_engine max9271 authenc crct10dif_ce mxc_jpeg_encdec CPU: 2 PID: 713 Comm: rmmod Tainted: G C 5.15.5-00057-gaebcd29c8ed7-dirty #5 Hardware name: Freescale i.MX8QXP MEK (DT) pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : i2c_mux_del_adapters+0x24/0xf0 lr : max9286_remove+0x28/0xd0 [max9286] sp : ffff800013a9bbf0 x29: ffff800013a9bbf0 x28: ffff00080b6da940 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: ffff000801a5b970 x22: ffff0008048b0890 x21: ffff800009297000 x20: ffff0008048b0f70 x19: 000000aa00000064 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000014 x13: 0000000000000000 x12: ffff000802da49e8 x11: ffff000802051918 x10: ffff000802da4920 x9 : ffff000800030098 x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff6364626d x5 : 8080808000000000 x4 : 0000000000000000 x3 : 0000000000000000 x2 : ffffffffffffffff x1 : ffff00080b6da940 x0 : 0000000000000000 Call trace: i2c_mux_del_adapters+0x24/0xf0 max9286_remove+0x28/0xd0 [max9286] i2c_device_remove+0x40/0x110 __device_release_driver+0x188/0x234 driver_detach+0xc4/0x150 bus_remove_driver+0x60/0xe0 driver_unregister+0x34/0x64 i2c_del_driver+0x58/0xa0 max9286_i2c_driver_exit+0x1c/0x490 [max9286] __arm64_sys_delete_module+0x194/0x260 invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0xd4/0xfc do_el0_svc+0x2c/0x94 el0_svc+0x28/0x80 el0t_64_sync_handler+0xa8/0x130 el0t_64_sync+0x1a0/0x1a4 The Oops happens because the I2C client data does not point to max9286_priv anymore but to v4l2_subdev. The change happened in max9286_init() which calls v4l2_i2c_subdev_init() later on... Besides fixing the max9286_remove() function, remove the call to i2c_set_clientdata() in max9286_probe(), to avoid confusion, and make the necessary changes to max9286_init() so that it doesn't have to use i2c_get_clientdata() in order to fetch the pointer to priv. Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver") Signed-off-by: Laurentiu Palcu Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f2d8b6917f3bcfb3190eb80567fea71a9b59dbd3 Author: Sakari Ailus Date: Sat Jan 22 13:23:18 2022 +0000 media: v4l: ioctl: Set bus_info in v4l_querycap() The bus_info field is set by most drivers based on the type of the device bus as well as the name of the device. Do this in v4l_querycap() so drivers don't need to. This keeps compatibility with non-default and silly bus_info. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit cef699749f3789add5ecaf0a2f73a659cae1c7ae Author: Sakari Ailus Date: Sat Jan 22 11:31:37 2022 +0000 media: mc: Set bus_info in media_device_init() Set bus_info field based on struct device in media_device_init() and remove corresponding code from drivers. Also update media_device_init() documentation: the dev field must be now initialised before calling it. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 78a171e58717685ea0eb082a24bc75bd9e20518f Author: Sakari Ailus Date: Sat Jan 22 11:25:57 2022 +0000 media: mc: Provide a helper for setting bus_info field The bus_info or a similar field exists in a lot of structs, yet drivers tend to set the value of that field by themselves in a determinable way. Thus provide a helper for doing this. To be used in subsequent patches. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit db1fa290a35b1652628ba7b921ac7ad53ce36410 Author: Sakari Ailus Date: Wed Mar 9 09:12:01 2022 +0000 media: mc: media_device_init() initialises a media_device, not media_entity The documentation for media_device_init() had several references to (struct) media_entity where it should have referred to struct media_device instead. Fix this. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit a8a2bd1001f3b5de1a9cd583467ab4559a7b3b01 Author: Sakari Ailus Date: Thu Jan 27 09:25:48 2022 +0000 media: mc: Remove redundant documentation Remove redundant kerneldoc documentation in mc-device.c. The functions are already documented in media-device.h, where non-redundant documentation is also moved. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 8b4b08b7eafaf9d54bbb6e2337eaf9bea49c8c36 Author: Sakari Ailus Date: Wed Mar 16 07:53:56 2022 +0000 media: ccs: Use unsigned int as index to an array Use an unsigned int to index an array instead of a signed one. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 63bd19442f0811014aba0bed00f63c90d391a716 Author: Sakari Ailus Date: Wed Mar 16 07:51:26 2022 +0000 media: ccs: Use %u for printing unsigned values, remove extra debug print Use %u for printing unsigned integer or u32 values. In a lot of cases %d was being used instead. Also remove an extra debug print --- the number of lanes is already printed by V4L2 when parsing fwnode endpoints when dynamic debug is enabled. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit aa4faf6eb27132532d5a133d9241254c16d4bafa Author: Daniel Scally Date: Wed Mar 2 22:03:04 2022 +0000 media: v4l2-async: Create links during v4l2_async_match_notify() Upon an async fwnode match, there's some typical behaviour that the notifier and matching subdev will want to do. For example, a notifier representing a sensor matching to an async subdev representing its VCM will want to create an ancillary link to expose that relationship to userspace. To avoid lots of code in individual drivers, try to build these links within v4l2 core. Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 012c87f7696f3191f340d9bd6b4476d8d3bb25ad Author: Daniel Scally Date: Wed Mar 2 22:03:03 2022 +0000 media: entity: Add support for ancillary links Add functions to create ancillary links, so that they don't need to be manually created by users. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9d0c23bfe7083f182194ca235156a4098aa59344 Author: Daniel Scally Date: Wed Mar 2 22:03:02 2022 +0000 media: entity: Add link_type_name() helper Now we have three types of media link, printing the right name during debug output is slightly more complicated. Add a helper function to make it easier. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4e4dab4bb6029dbee63f12a249ddc44b0124ea63 Author: Daniel Scally Date: Wed Mar 2 22:03:01 2022 +0000 media: media.h: Add new media link type To describe in the kernel the connection between devices and their supporting peripherals (for example, a camera sensor and the vcm driving the focusing lens for it), add a new type of media link to introduce the concept of these ancillary links. Add some elements to the uAPI documentation to explain the new link type, their purpose and some aspects of their current implementation. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit af3ed78ecbf367008ae4852cd676a75ce71db35f Author: Daniel Scally Date: Wed Mar 2 22:03:00 2022 +0000 media: entity: Skip non-data links in graph iteration When iterating over the media graph, don't follow links that are not data links. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6008dea1c70e1a7df05c5e1bccd48e51ea29e670 Author: Yunke Cao Date: Tue Apr 12 07:23:13 2022 +0100 media: entity: skip non-data link when removing reverse links The original implementation removes reverse links for any input link and assumes the presense of sink/source. It fails when the link is a not a data link. media_entity_remove_links when there's an ancillary link can also fail. We only need to remove reverse links for a data link. Signed-off-by: Yunke Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d8fdfc66cfd720985480db42b939892e7bf65475 Author: Jacopo Mondi Date: Wed Mar 9 10:04:48 2022 +0000 media: imx: imx-mipi-csis: Add support for JPEG_1X8 Add support for MEDIA_BUS_FMT_JPEG_1X8 media bus code to the CSIS driver. The MEDIA_BUS_FMT_JPEG_1X8 code is mapped to the RAW8 CSI-2 Data Type, while the CSI-2 specification suggests to use User Defined Data Type 1. As reported in the comment, the CSIS interface captures arbitrary Data Types by using a pixel sampling mode not supported by the IP core connected to it on i.MX SoCs. As some sensors, such as OV5640, support sending JPEG data on the RAW8 Data Type and capture operations work correcty with such configuration, map MEDIA_BUS_FMT_JPEG_1X8 to Data Type 0x2a. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f1b57164305d6342b9f77a4f4482cde492b56983 Author: Hans Verkuil Date: Thu Feb 3 12:11:15 2022 +0000 media: cec: add optional adap_configured callback This new optional callback is called when the adapter is fully configured or fully unconfigured. Some drivers may have to take action when this happens. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dad272bd03d541dc7c0ff8331756eccf659f6f02 Author: Hans Verkuil Date: Sat Nov 13 11:05:24 2021 +0000 media: cec: add xfer_timeout_ms field Allow drivers to change the transmit timeout value, i.e. after how long should a transmit be considered 'lost', i.e. the corresponding cec_transmit_done_ts was never called. Some CEC devices have their own timeout, and so this timeout value must be longer than that hardware timeout value. If it is shorter then the framework would consider the transmit lost, even though it is effectively still in progress at the hardware level. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e2ed5024ac2bc27d4bfc99fd58f5ab54de8fa965 Author: Hans Verkuil Date: Thu Mar 17 08:51:20 2022 +0000 media: cec: use call_op and check for !unregistered Use call_(void_)op consistently in the CEC core framework. Ditto for the cec pin ops. And check if !adap->devnode.unregistered before calling each op. This avoids calls to ops when the device has been unregistered and the underlying hardware may be gone. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 567f882a401346779d05a90beb8f21865ebdd398 Author: Hans Verkuil Date: Wed Mar 9 10:55:43 2022 +0000 media: cec.h: add cec_msg_recv_is_rx/tx_result helpers These two helper functions return true if the received message contains the result of a previous non-blocking transmit. Either the tx_status result (cec_msg_recv_is_tx_result) of the transmit, or the rx_status result (cec_msg_recv_is_rx_result) of the reply to the original transmit. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f9d0ecbf56f4b90745a6adc5b59281ad8f70ab54 Author: Hans Verkuil Date: Sat Nov 13 11:02:36 2021 +0000 media: cec: correctly pass on reply results The results of non-blocking transmits were not correctly communicated to userspace. Specifically: 1) if a non-blocking transmit was canceled, then rx_status wasn't set to 0 as it should. 2) if the non-blocking transmit succeeded, but the corresponding reply never arrived (aborted or timed out), then tx_status wasn't set to 0 as it should, and rx_status was hardcoded to ABORTED instead of the actual reason, such as TIMEOUT. In addition, adap->ops->received() was never called, so drivers that want to do message processing themselves would not be informed of the failed reply. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 590a8e564c6eff7e77a84e728612f1269e3c0685 Author: Hans Verkuil Date: Thu Mar 3 14:01:44 2022 +0000 media: cec: abort if the current transmit was canceled If a transmit-in-progress was canceled, then, once the transmit is done, mark it as aborted and refrain from retrying the transmit. To signal this situation the new transmit_in_progress_aborted field is set to true. The old implementation would just set adap->transmitting to NULL and set adap->transmit_in_progress to false, but on the hardware level the transmit was still ongoing. However, the framework would think the transmit was aborted, and if a new transmit was issued, then it could overwrite the HW buffer containing the old transmit with the new transmit, leading to garbled data on the CEC bus. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3813c932ed970dd4f413498ccecb03c73c4f1784 Author: Hans Verkuil Date: Thu Mar 3 13:55:08 2022 +0000 media: cec: call enable_adap on s_log_addrs Don't enable/disable the adapter if the first fh is opened or the last fh is closed, instead do this when the adapter is configured or unconfigured, and also when we enter Monitor All or Monitor Pin mode for the first time or we exit the Monitor All/Pin mode for the last time. However, if needs_hpd is true, then do this when the physical address is set or cleared: in that case the adapter typically is powered by the HPD, so it really is disabled when the HPD is low. This case (needs_hpd is true) was already handled in this way, so this wasn't changed. The problem with the old behavior was that if the HPD goes low when no fh is open, and a transmit was in progress, then the adapter would be disabled, typically stopping the transmit immediately which leaves a partial message on the bus, which isn't nice and can confuse some adapters. It makes much more sense to disable it only when the adapter is unconfigured and we're not monitoring the bus, since then you really won't be using it anymore. To keep track of this store a CEC activation count and call adap_enable only when it goes from 0 to 1 or back to 0. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 82b4737fd001247527405b19045c25bf1622ab6d Author: Yihao Han Date: Thu Mar 10 07:40:59 2022 +0000 media: meson-ir-tx: remove superfluous dev_err() Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Reviewed-by: Neil Armstrong Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit f238ff81e8946540e1a7c1496aa92fa2386893dc Author: Vinod Koul Date: Thu Apr 21 17:25:26 2022 +0530 arm64: dts: qcom: sc7280-idp: Enable GPI DMAs Some versions of the firmware for the sc7280-idp board FIFO mode disabled and must thus use GPI DMA. Enable gpi_dma0 and gpi_dma1 to allow this. Co-developed-by: Vijaya Krishna Nivarthi Signed-off-by: Vijaya Krishna Nivarthi Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421115526.1828659-3-vkoul@kernel.org commit 18bec7f725c5184f7c5b2a404602dd95f630d4d7 Author: Vinod Koul Date: Thu Apr 21 17:25:25 2022 +0530 arm64: dts: qcom: sc7280: Add GENI I2C/SPI DMA channels The GENI I2C and SPI controllers may use the GPI DMA engine, define the rx and tx channels for these controllers to enable this. Co-developed-by: Vijaya Krishna Nivarthi Signed-off-by: Vijaya Krishna Nivarthi Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421115526.1828659-2-vkoul@kernel.org commit c11e239f6aee32e20718dc3cf5349894d0e994ec Author: Vinod Koul Date: Thu Apr 21 17:25:24 2022 +0530 arm64: dts: qcom: sc7280: Add GPI DMAengines The Qualcomm SC7280 has two GPI DMAengines, add definitions for these. Co-developed-by: Vijaya Krishna Nivarthi Signed-off-by: Vijaya Krishna Nivarthi Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421115526.1828659-1-vkoul@kernel.org commit 2a31f958f8326c263f2af2511cd6d8256d81e810 Author: Bhupesh Sharma Date: Tue Apr 19 02:25:09 2022 +0530 arm64: dts: qcom: sm8450: Fix qmp phy node (use phy@ instead of lanes@) Fix the following 'make dtbs_check' warning(s) by using phy@ instead of lanes@: arch/arm64/boot/dts/qcom/sm8450-hdk.dtb: phy@1c0f000: 'lanes@1c0e000' does not match any of the regexes: '^phy@[0-9a-f]+$', 'pinctrl-[0-9]+' Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220418205509.1102109-5-bhupesh.sharma@linaro.org commit cb29e7106d4ee7bc3860fc65d28b6d7d0b71c0f8 Author: Vinod Koul Date: Thu Apr 21 13:04:38 2022 +0530 arm64: dts: qcom: db845c: Add support for MCP2517FD Add support for onboard MCP2517FD SPI CAN transceiver attached to SPI0 of RB3. Signed-off-by: Vinod Koul Reviewed-by: Manivannan Sadhasivam Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421073438.1824061-1-vkoul@kernel.org commit 1eae95fb1d696968ca72be3ac8e0d62bb4d8da42 Author: Vinod Koul Date: Thu Apr 21 13:05:02 2022 +0530 arm64: dts: qcom: qrb5165-rb5: Fix can-clock node name Per DT spec node names should not have underscores (_) in them, so change can_clock to can-clock. Fixes: 5c44c564e449 ("arm64: dts: qcom: qrb5165-rb5: Add support for MCP2518FD") Signed-off-by: Vinod Koul Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220421073502.1824089-1-vkoul@kernel.org commit 755a9d44e6e2a217cceaab9fe2c8bac55ee7f8b2 Author: Bjorn Helgaas Date: Fri Apr 15 14:08:15 2022 -0500 powerpc: Remove unused SLOW_DOWN_IO definition Remove unused SLOW_DOWN_IO definition. Signed-off-by: Bjorn Helgaas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220415190817.842864-6-helgaas@kernel.org commit 17e6ff4937be04b986558d752802bde48198e9c3 Author: Slark Xiao Date: Thu Apr 21 17:21:41 2022 +0800 bus: mhi: host: Add support for Cinterion MV32-WA/MV32-WB MV32-WA is designed based on Qualcomm SDX62, and MV32-WB is designed based on QUalcomm SDX65. Both products' enumeration would align with previous product MV31-W.So we merge MV31 and MV32 to MV3X for some common settings. Signed-off-by: Slark Xiao Reviewed-by: Loic Poulain Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220421092141.3984-1-slark_xiao@163.com [mani: removed the fixes tag that's not needed] Signed-off-by: Manivannan Sadhasivam commit d126bfeaf72161c4028769d735ce4a778a029657 Author: Bhaumik Bhatt Date: Mon Apr 18 11:50:26 2022 -0600 bus: mhi: host: Optimize and update MMIO register write method As of now, MMIO writes done after ready state transition use the mhi_write_reg_field() API even though the whole register is being written in most cases. Optimize this process by using mhi_write_reg() API instead for those writes and use the mhi_write_reg_field() API for MHI config registers only. Signed-off-by: Bhaumik Bhatt Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1650304226-11080-3-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Manivannan Sadhasivam commit 0bca889fd6fe6fbedf6de6f807c8f588cb4e639d Author: Bhaumik Bhatt Date: Mon Apr 18 11:50:25 2022 -0600 bus: mhi: host: Bail on writing register fields if read fails Helper API to write register fields relies on successful reads of the register/address prior to the write. Bail out if a failure is seen when reading the register before the actual write is performed. Signed-off-by: Bhaumik Bhatt Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Jeffrey Hugo Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1650304226-11080-2-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Manivannan Sadhasivam commit 36e5505dfb42e86b25ded0a023dace6cff875cc3 Author: Jeffrey Hugo Date: Mon Apr 18 11:22:42 2022 -0600 bus: mhi: host: Wait for ready state after reset After the device has signaled the end of reset by clearing the reset bit, it will automatically reinit MHI and the internal device structures. Once That is done, the device will signal it has entered the ready state. Signaling the ready state involves sending an interrupt (MSI) to the host which might cause IOMMU faults if it occurs at the wrong time. If the controller is being powered down, and possibly removed, then the reset flow would only wait for the end of reset. At which point, the host and device would start a race. The host may complete its reset work, and remove the interrupt handler, which would cause the interrupt to be disabled in the IOMMU. If that occurs before the device signals the ready state, then the IOMMU will fault since it blocked an interrupt. While harmless, the fault would appear like a serious issue has occurred so let's silence it by making sure the device hits the ready state before the host completes its reset processing. Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1650302562-30964-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Manivannan Sadhasivam commit 95c33ae41b822c37dc841cf80ca388fea376e36d Author: Jeffrey Hugo Date: Mon Apr 18 11:18:47 2022 -0600 bus: mhi: host: Add soc_reset sysfs The MHI bus supports a standardized hardware reset, which is known as the "SoC Reset". This reset is similar to the reset sysfs for PCI devices - a hardware mechanism to reset the state back to square one. The MHI SoC Reset is described in the spec as a reset of last resort. If some unrecoverable error has occurred where other resets have failed, SoC Reset is the "big hammer" that ungracefully resets the device. This is effectivly the same as yanking the power on the device, and reapplying it. However, depending on the nature of the particular issue, the underlying transport link may remain active and configured. If the link remains up, the device will flag a MHI system error early in the boot process after the reset is executed, which allows the MHI bus to process a fatal error event, and clean up appropiately. While the SoC Reset is generally intended as a means of recovery when all else has failed, it can be useful in non-error scenarios. For example, if the device loads firmware from the host filesystem, the device may need to be fully rebooted inorder to pick up the new firmware. In this scenario, the system administrator may use the soc_reset sysfs to cause the device to pick up the new firmware that the admin placed on the filesystem. Signed-off-by: Jeffrey Hugo Reviewed-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1650302327-30439-1-git-send-email-quic_jhugo@quicinc.com Signed-off-by: Manivannan Sadhasivam commit 89ad19bea64948685da01035af8706e587cf5d25 Author: Manivannan Sadhasivam Date: Mon Apr 11 19:04:28 2022 +0530 bus: mhi: host: pci_generic: Sort mhi_pci_id_table based on the PID Sorting this way helps in identifying the products of vendors. There is no sorting required for VID and the new VID should be added as the last entry. Let's also add a note clarifying this. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Daniele Palmas Link: https://lore.kernel.org/r/20220411133428.42165-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam commit e565d3efd894f0fba844cf3eafd098d66c266333 Author: Jeffrey Hugo Date: Wed Apr 13 10:41:53 2022 -0600 bus: mhi: host: Use cached values for calculating the shared write pointer mhi_recycle_ev_ring() computes the shared write pointer for the ring (ctxt_wp) using a read/modify/write pattern where the ctxt_wp value in the shared memory is read, incremented, and written back. There are no checks on the read value, it is assumed that it is kept in sync with the locally cached value. Per the MHI spec, this is correct. The device should only read ctxt_wp, never write it. However, there are devices in the wild that violate the spec, and can update the ctxt_wp in a specific scenario. This can cause corruption, and violate the above assumption that the ctxt_wp is in sync with the cached value. This can occur when the device has loaded firmware from the host, and is transitioning from the SBL EE to the AMSS EE. As part of shutting down SBL, the SBL flushes it's local MHI context to the shared memory since the local context will not persist across an EE change. In the case of the event ring, SBL will flush its entire context, not just the parts that it is allowed to update. This means SBL will write to ctxt_wp, and possibly corrupt it. An example: Host Device ---- --- Update ctxt_wp to 0x1f0 SBL observes 0x1f0 Update ctxt_wp to 0x0 Starts transition to AMSS EE Context flush, writes 0x1f0 to ctxt_wp Update ctxt_wp to 0x200 Update ctxt_wp to 0x210 AMSS observes 0x210 0x210 exceeds ring size AMSS signals syserr The reason the ctxt_wp goes off the end of the ring is that the rollover check is only performed on the cached wp, which is out of sync with ctxt_wp. Since the host is the authority of the value of ctxt_wp per the MHI spec, we can fix this issue by not reading ctxt_wp from the shared memory, and instead compute it based on the cached value. If SBL corrupts ctxt_wp, the host won't observe it, and will correct the value at some point later. Signed-off-by: Jeffrey Hugo Reviewed-by: Hemant Kumar Reviewed-by: Bhaumik Bhatt Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1649868113-18826-1-git-send-email-quic_jhugo@quicinc.com [mani: used the quicinc domain for Hemant and Bhaumik] Signed-off-by: Manivannan Sadhasivam commit e233fe1aa02815f38588a5a965a197bbcabfb125 Author: Michal Orzel Date: Sat Apr 23 13:38:11 2022 +0200 block/partitions/ldm: Remove redundant assignments Get rid of the following redundant assignments: - to a variable r_cols from function ldm_parse_cmp3 - to variables r_id1 and r_id2 from functions ldm_parse_dgr3 and ldm_parse_dgr4 - to a variable r_index from function ldm_parse_prt3 that end up in values not being read until the end of function. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-5-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe commit 87420fa94f6cdd2ae8aa3e1d8602bfa549794fac Author: Michal Orzel Date: Sat Apr 23 13:38:10 2022 +0200 block/partitions/atari: Remove redundant assignment Get rid of redundant assignment to a variable part_fmt from function atari_partition. It is being assigned a value that is never read until the end of function. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-4-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe commit 834726828b47c08e84df02f975e30c5c65bf316b Author: Michal Orzel Date: Sat Apr 23 13:38:09 2022 +0200 block/partitions/acorn: Remove redundant assignments Get rid of redundant assignments to a variable slot from function adfspart_check_ADFS. It is being assigned a value that is never read as we are breaking out from the switch case and the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-3-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe commit 7ab89db979017255c2163880de5c63d8c9726aef Author: Michal Orzel Date: Sat Apr 23 13:38:08 2022 +0200 block/blk-map: Remove redundant assignment Get rid of redundant assignment to a variable ret from function bio_map_user_iov as it is being assigned a value that is never read. It is being re-assigned in the first instruction after the while loop Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-2-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe commit 3de2e5f28cb133f1d9c1b2403079722d0e7b671e Author: Michal Orzel Date: Sat Apr 23 13:38:07 2022 +0200 block/badblocks: Remove redundant assignments Get rid of redundant assignments to a variable sectors from functions badblocks_check and badblocks_clear. This variable, that is a function parameter, is being assigned a value that is never read until the end of function. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Link: https://lore.kernel.org/r/20220423113811.13335-1-michalorzel.eng@gmail.com Signed-off-by: Jens Axboe commit 9ebacb1e7e75f2a7a9745d42da7031d3a1741029 Author: Po-Hao Huang Date: Wed Apr 20 17:30:58 2022 +0800 rtw88: pci: 8821c: Disable 21ce completion timeout Disable this capability to avoid timeout errors on certain platforms. Without it, pci bus might stuck and leads to disconnection. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Tested-by: Chris Chiu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220420093058.31646-2-pkshih@realtek.com commit 9cbdadf0097fc4a77071c61ed28a07eaac97f8f6 Author: Po-Hao Huang Date: Wed Apr 20 17:30:57 2022 +0800 rtw88: fix uninitialized 'tim_offset' warning This avoids below warning and makes compiler happy. error: uninitialized symbol 'tim_offset' Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220420093058.31646-1-pkshih@realtek.com commit c94e36908467011d6f793d7667cd0462a8c68710 Author: Minghao Chi Date: Wed Apr 20 09:02:47 2022 +0000 wl12xx: scan: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220420090247.2588680-1-chi.minghao@zte.com.cn commit 54d5ecc1710e4b43a73305bce5d91dc954fbb872 Author: Minghao Chi Date: Wed Apr 20 09:02:14 2022 +0000 wl12xx: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220420090214.2588618-1-chi.minghao@zte.com.cn commit 79dafcd4ff6fc5edb86528345e91b417d0bd016e Author: Ping-Ke Shih Date: Thu Apr 14 14:20:26 2022 +0800 rtw89: 8852c: add help function of set channel During setting channel, we need to backup/restore and disable/enable some settings. The settings include SCH (scheduler channel), PPDU status report, and RF components, DFS and ADC. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-13-pkshih@realtek.com commit 1b00e9236a7131284609d10e6f63ff2864ebe650 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:25 2022 +0800 rtw89: 8852c: add set channel of BB part BB does many settings during setting channel. First is to configure CCK for 2G channels, and then basic channel and bandwidth settings with a encoded channel index that will report to driver when we receive packets. Configure spur elimination to avoid spur of CSI and NBI tones in certain frequencies. Also, it initializes BT grant to arrange path sharing with BT according to band. Finally, reset TSSI and BB hardware to ensure it stays in initial state. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-12-pkshih@realtek.com commit 63fb5c981590f0bdf1708077b94563ee609efe8f Author: Ping-Ke Shih Date: Thu Apr 14 14:20:24 2022 +0800 rtw89: 8852c: set channel of MAC part Configure channel and bandwidth of MAC registers to work properly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-11-pkshih@realtek.com commit bb865ba6ea83b561bfee2f74a3cb89ff5b983ecb Author: Ping-Ke Shih Date: Thu Apr 14 14:20:23 2022 +0800 rtw89: 8852c: add set channel function of RF part Prepare functions to configure channel and bandwidth accordingly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-10-pkshih@realtek.com commit 7b9c98c7a484f33c610d957f5fb9a281d1642828 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:22 2022 +0800 rtw89: 8852c: add HFC parameters HFC is short for HCI flow control, and these parameters is used to configure PCI quota for TX/RX. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-9-pkshih@realtek.com commit e6b17cbd34e3f7aa88169e21c814692c151c7418 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:21 2022 +0800 rtw89: 8852c: add efuse gain offset parser Define efuse struct to access gain offset, and store them for further use by setting channel. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-8-pkshih@realtek.com commit e885871ee809aaadb06e8c63d5c3e90c8c07ccac Author: Zong-Zhe Yang Date: Thu Apr 14 14:20:20 2022 +0800 rtw89: 8852c: support bb gain info Add parser for bb gain table and configure bb gain table for 8852c. While ctrl_ch, obtain bb gain error settings and write them to phy. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-7-pkshih@realtek.com commit cc99eefa61f08a655a6471ee31e3096ad2e329d2 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:19 2022 +0800 rtw89: 8852c: add BB initial and reset functions chip_ops::bb_sethw is to initialize BB settings out of BB parameters tables. Once switching channel or initialing, we do chip_ops::bb_reset to reset hardware counters and states to make things in expectation. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-6-pkshih@realtek.com commit c7845551bf667894c5eb4320265d8717f056a8ac Author: Ping-Ke Shih Date: Thu Apr 14 14:20:18 2022 +0800 rtw89: 8852c: phy: configure TSSI bandedge TSSI is used to manage TX power with thermal value as a factor. This patch is to configure bandedge to TX proper waveform. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-5-pkshih@realtek.com commit c6badab206d5a2330c896ab1b77d79e80c6f16aa Author: Zong-Zhe Yang Date: Thu Apr 14 14:20:17 2022 +0800 rtw89: 8852c: add TX power track tables TX power track tables are used to do TX power compensation according to thermal value. In order to work in existing and new chip, add new 6G entries, and change type from u8 to s8. Internal version table is HALRF_027_00_031. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-4-pkshih@realtek.com commit 342475ac510ac0231fb38d00befdc86228453825 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:16 2022 +0800 rtw89: 8852c: add TX power by rate and limit tables TX power depends on rate, but must follow regulation for specific country. Once asked to set channel, we configure registers according to these TX power tables. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-3-pkshih@realtek.com commit eefad995c24295138669e5522f9b04c31fef0755 Author: Ping-Ke Shih Date: Thu Apr 14 14:20:15 2022 +0800 rtw89: 8852c: add BB and RF parameters tables These parameters are used to initialize BB and RF hardware when we are going to bring up interface and start to transmit and receive. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220414062027.62638-2-pkshih@realtek.com commit 8e95061b5b9c519891dbe2e519dc3fc1d5f6f4a4 Author: Minghao Chi Date: Wed Apr 13 09:33:56 2022 +0000 wl18xx: debugfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413093356.2538192-1-chi.minghao@zte.com.cn commit 7123f8836392f15b33ed49b47b7d4001a9577cf5 Author: Krzysztof Kozlowski Date: Tue Apr 12 12:26:23 2022 +0200 interconnect: qcom: constify qcom_icc_bcm pointers Pointers to struct qcom_icc_bcm are not modified, so they can be made const for safety. The contents of struct qcom_icc_bcm must stay non-const. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220412102623.227607-3-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 2ccf33c0638893851c7027dee149efe99d5363e0 Author: Krzysztof Kozlowski Date: Tue Apr 12 12:26:22 2022 +0200 interconnect: qcom: constify icc_node pointers Pointers to struct qcom_icc_node (and similar structures) are not modified, so they can be made const for safety. The contents of struct qcom_icc_node must stay non-const. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220412102623.227607-2-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 1625aaa3fe7c7f95e75d8be646e83a46a376c7ae Author: Krzysztof Kozlowski Date: Tue Apr 12 12:26:21 2022 +0200 interconnect: qcom: constify qcom_icc_desc struct qcom_icc_desc is not modified so it can be made const for safety. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220412102623.227607-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit cfc1d91a7d78cf9de25b043d81efcc16966d55b3 Merge: 988998ac4bd99 07c8a2dd69f61 Author: David S. Miller Date: Sat Apr 23 12:18:16 2022 +0100 Merge branch 'dsa-selftests' Vladimir Oltean says: ==================== DSA selftests When working on complex new features or reworks it becomes increasingly difficult to ensure there aren't regressions being introduced, and therefore it would be nice if we could go over the functionality we already have and write some tests for it. Verbally I know from Tobias Waldekranz that he has been working on some selftests for DSA, yet I have never seen them, so here I am adding some tests I have written which have been useful for me. The list is by no means complete (it only covers elementary functionality), but it's still good to have as a starting point. I also borrowed some refactoring changes from Joachim Wiberg that he submitted for his "net: bridge: forwarding of unknown IPv4/IPv6/MAC BUM traffic" series, but not the entirety of his selftests. I now think that his selftests have some overlap with bridge_vlan_unaware.sh and bridge_vlan_aware.sh and they should be more tightly integrated with each other - yet I didn't do that either :). Another issue I had with his selftests was that they jumped straight ahead to configure brport flags on br0 (a radical new idea still at RFC status) while we have bigger problems, and we don't have nearly enough coverage for the *existing* functionality. One idea introduced here which I haven't seen before is the symlinking of relevant forwarding selftests to the selftests/drivers/net// folder, plus a forwarding.config file. I think there's some value in having things structured this way, since the forwarding dir has so many selftests that aren't relevant to DSA that it is a bit difficult to find the ones that are. While searching for applications that I could use for multicast testing (not my domain of interest/knowledge really), I found Joachim Wiberg's mtools, mcjoin and omping, and I tried them all with various degrees of success. In particular, I was going to use mcjoin, but I faced some issues getting IPv6 multicast traffic to work in a VRF, and I bothered David Ahern about it here: https://lore.kernel.org/netdev/97eaffb8-2125-834e-641f-c99c097b6ee2@gmail.com/t/ It seems that the problem is that this application should use SO_BINDTODEVICE, yet it doesn't. So I ended up patching the bare-bones mtools (msend, mreceive) forked by Joachim from the University of Virginia's Multimedia Networks Group to include IPv6 support, and to use SO_BINDTODEVICE. This is what I'm using now for IPv6. Note that mausezahn doesn't appear to do a particularly good job of supporting IPv6 really, and I needed a program to emit the actual IP_ADD_MEMBERSHIP calls, for dev_mc_add(), so I could test RX filtering. Crafting the IGMP/MLD reports by hand doesn't really do the trick. While extremely bare-bones, the mreceive application now seems to do what I need it to. Feedback appreciated, it is very likely that I could have done things in a better way. ==================== Signed-off-by: David S. Miller commit 07c8a2dd69f6102adc12a621b4ef5e17d2a5b40d Author: Vladimir Oltean Date: Fri Apr 22 13:15:04 2022 +0300 selftests: drivers: dsa: add a subset of forwarding selftests This adds an initial subset of forwarding selftests which I considered to be relevant for DSA drivers, along with a forwarding.config that makes it easier to run them (disables veth pair creation, makes sure MAC addresses are unique and stable). The intention is to request driver writers to run these selftests during review and make sure that the tests pass, or at least that the problems are known. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 90b9566aa5cd3f99e5923d364ac976d5d3589fa6 Author: Vladimir Oltean Date: Fri Apr 22 13:15:03 2022 +0300 selftests: forwarding: add a test for local_termination.sh This tests the capability of switch ports to filter out undesired traffic. Different drivers are expected to have different capabilities here (so some may fail and some may pass), yet the test still has some value, for example to check for regressions. There are 2 kinds of failures, one is when a packet which should have been accepted isn't (and that should be fixed), and the other "failure" (as reported by the test) is when a packet could have been filtered out (for being unnecessary) yet it was received. The bridge driver fares particularly badly at this test: TEST: br0: Unicast IPv4 to primary MAC address [ OK ] TEST: br0: Unicast IPv4 to macvlan MAC address [ OK ] TEST: br0: Unicast IPv4 to unknown MAC address [FAIL] reception succeeded, but should have failed TEST: br0: Unicast IPv4 to unknown MAC address, promisc [ OK ] TEST: br0: Unicast IPv4 to unknown MAC address, allmulti [FAIL] reception succeeded, but should have failed TEST: br0: Multicast IPv4 to joined group [ OK ] TEST: br0: Multicast IPv4 to unknown group [FAIL] reception succeeded, but should have failed TEST: br0: Multicast IPv4 to unknown group, promisc [ OK ] TEST: br0: Multicast IPv4 to unknown group, allmulti [ OK ] TEST: br0: Multicast IPv6 to joined group [ OK ] TEST: br0: Multicast IPv6 to unknown group [FAIL] reception succeeded, but should have failed TEST: br0: Multicast IPv6 to unknown group, promisc [ OK ] TEST: br0: Multicast IPv6 to unknown group, allmulti [ OK ] mainly because it does not implement IFF_UNICAST_FLT. Yet I still think having the test (with the failures) is useful in case somebody wants to tackle that problem in the future, to make an easy before-and-after comparison. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 476a4f05d9b83f78c2511c01376b40609ad83834 Author: Vladimir Oltean Date: Fri Apr 22 13:15:02 2022 +0300 selftests: forwarding: add a no_forwarding.sh test Bombard a standalone switch port with various kinds of traffic to ensure it is really standalone and doesn't leak packets to other switch ports. Also check for switch ports in different bridges, and switch ports in a VLAN-aware bridge but having different pvids. No forwarding should take place in either case. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a5114df6c61336269558d3316079d25867716e64 Author: Vladimir Oltean Date: Fri Apr 22 13:15:01 2022 +0300 selftests: forwarding: add helper for retrieving IPv6 link-local address of interface Pinging an IPv6 link-local multicast address selects the link-local unicast address of the interface as source, and we'd like to monitor for that in tcpdump. Add a helper to the forwarding library which retrieves the link-local IPv6 address of an interface, to make that task easier. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f23cddc72294a345b4a8c3662b0ab6077c7583c7 Author: Vladimir Oltean Date: Fri Apr 22 13:15:00 2022 +0300 selftests: forwarding: add helpers for IP multicast group joins/leaves Extend the forwarding library with calls to some small C programs which join an IP multicast group and send some packets to it. Both IPv4 and IPv6 groups are supported. Use cases range from testing IGMP/MLD snooping, to RX filtering, to multicast routing. Testing multicast traffic using msend/mreceive is intended to be done using tcpdump. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6182c5c5098f350fd394df818b99acd075e37189 Author: Joachim Wiberg Date: Fri Apr 22 13:14:59 2022 +0300 selftests: forwarding: multiple instances in tcpdump helper Extend tcpdump_start() & C:o to handle multiple instances. Useful when observing bridge operation, e.g., unicast learning/flooding, and any case of multicast distribution (to these ports but not that one ...). This means the interface argument is now a mandatory argument to all tcpdump_*() functions, hence the changes to the ocelot flower test. Signed-off-by: Joachim Wiberg Reviewed-by: Vladimir Oltean Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit fe32dffdcd33d34bc9bab267a55a8726074b0010 Author: Joachim Wiberg Date: Fri Apr 22 13:14:58 2022 +0300 selftests: forwarding: add TCPDUMP_EXTRA_FLAGS to lib.sh For some use-cases we may want to change the tcpdump flags used in tcpdump_start(). For instance, observing interfaces without the PROMISC flag, e.g. to see what's really being forwarded to the bridge interface. Signed-off-by: Joachim Wiberg Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b343734ee26537bc0b81a32c79e789e6387643cd Author: Vladimir Oltean Date: Fri Apr 22 13:14:57 2022 +0300 selftests: forwarding: add option to run tests with stable MAC addresses By default, DSA switch ports inherit their MAC address from the DSA master. This works well for practical situations, but some selftests like bridge_vlan_unaware.sh loop back 2 standalone DSA ports with 2 bridged DSA ports, and require the bridge to forward packets between the standalone ports. Due to the bridge seeing that the MAC DA it needs to forward is present as a local FDB entry (it coincides with the MAC address of the bridge ports), the test packets are not forwarded, but terminated locally on br0. In turn, this makes the ping and ping6 tests fail. Address this by introducing an option to have stable MAC addresses. When mac_addr_prepare is called, the current addresses of the netifs are saved and replaced with 00:01:02:03:04:${netif number}. Then when mac_addr_restore is called at the end of the test, the original MAC addresses are restored. This ensures that the MAC addresses are unique, which makes the test pass even for DSA ports. The usage model is for the behavior to be opt-in via STABLE_MAC_ADDRS, which DSA should set to true, all others behave as before. By hooking the calls to mac_addr_prepare and mac_addr_restore within the forwarding lib itself, we do not need to patch each individual selftest, the only requirement is that pre_cleanup is called. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 988998ac4bd9953c034d9522149047cf5782adc0 Merge: 31693d02b06ed 8bd03be3418c7 Author: David S. Miller Date: Sat Apr 23 11:51:06 2022 +0100 Merge branch 'mptcp-tcp-fallback' Mat Martineau says: ==================== mptcp: TCP fallback for established connections RFC 8684 allows some MPTCP connections to fall back to regular TCP when the MPTCP DSS checksum detects middlebox interference, there is only a single subflow, and there is no unacknowledged out-of-sequence data. When this condition is detected, the stack sends a MPTCP DSS option with an "infinite mapping" to signal that a fallback is happening, and the peers will stop sending MPTCP options in their TCP headers. The Linux MPTCP stack has not yet supported this type of fallback, instead closing the connection when the MPTCP checksum fails. This series adds support for fallback to regular TCP in a more limited scenario, for only MPTCP connections that have never connected additional subflows or transmitted out-of-sequence data. The selftests are also updated to check new MIBs that track infinite mappings. ==================== Signed-off-by: David S. Miller commit 8bd03be3418c7b723996b621414382427cd44dc0 Author: Geliang Tang Date: Fri Apr 22 14:55:43 2022 -0700 selftests: mptcp: add infinite map mibs check This patch adds a function chk_infi_nr() to check the mibs for the infinite mapping. Invoke it in chk_join_nr() when validate_checksum is set. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit d9fdd02d4265c4c4fd5264b32b46034239192b7e Author: Geliang Tang Date: Fri Apr 22 14:55:42 2022 -0700 mptcp: dump infinite_map field in mptcp_dump_mpext In trace event class mptcp_dump_mpext, dump the newly added infinite_map field of struct mptcp_dump_mpext too. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 104125b82e5c92554c500b50a08287aa6a981753 Author: Geliang Tang Date: Fri Apr 22 14:55:41 2022 -0700 mptcp: add mib for infinite map sending This patch adds a new mib named MPTCP_MIB_INFINITEMAPTX, increase it when a infinite mapping has been sent out. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f8d4bcacff3b77f8778ae3ab97e0d175e861babf Author: Geliang Tang Date: Fri Apr 22 14:55:40 2022 -0700 mptcp: infinite mapping receiving This patch adds the infinite mapping receiving logic. When the infinite mapping is received, set the map_data_len of the subflow to 0. In subflow_check_data_avail(), only reset the subflow when the map_data_len of the subflow is non-zero. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1e39e5a32ad7fdd82d6e071aa14ecd511eedc1f7 Author: Geliang Tang Date: Fri Apr 22 14:55:39 2022 -0700 mptcp: infinite mapping sending This patch adds the infinite mapping sending logic. Add a new flag send_infinite_map in struct mptcp_subflow_context. Set it true when a single contiguous subflow is in use and the allow_infinite_fallback flag is true in mptcp_pm_mp_fail_received(). In mptcp_sendmsg_frag(), if this flag is true, call the new function mptcp_update_infinite_map() to set the infinite mapping. Add a new flag infinite_map in struct mptcp_ext, set it true in mptcp_update_infinite_map(), and check this flag in a new helper mptcp_check_infinite_map(). In mptcp_update_infinite_map(), set data_len to 0, and clear the send_infinite_map flag, then do fallback. In mptcp_established_options(), use the helper mptcp_check_infinite_map() to let the infinite mapping DSS can be sent out in the fallback mode. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 0530020a7c8f2204e784f0dbdc882bbd961fdbde Author: Geliang Tang Date: Fri Apr 22 14:55:38 2022 -0700 mptcp: track and update contiguous data status This patch adds a new member allow_infinite_fallback in mptcp_sock, which is initialized to 'true' when the connection begins and is set to 'false' on any retransmit or successful MP_JOIN. Only do infinite mapping fallback if there is a single subflow AND there have been no retransmissions AND there have never been any MP_JOINs. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 0348c690ed3731298fb73e37941475ed86b47f54 Author: Geliang Tang Date: Fri Apr 22 14:55:37 2022 -0700 mptcp: add the fallback check This patch adds the fallback check in subflow_check_data_avail(). Only do the fallback when the msk hasn't fallen back yet. Suggested-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 1761fed2567807f26fbd53032ff622f55978c7a9 Author: Geliang Tang Date: Fri Apr 22 14:55:36 2022 -0700 mptcp: don't send RST for single subflow When a bad checksum is detected and a single subflow is in use, don't send RST + MP_FAIL, send data_ack + MP_FAIL instead. So invoke tcp_send_active_reset() only when mptcp_has_another_subflow() is true. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit e999a5da28a0e0f7de242d841ef7d5e48f4646ae Author: Thibaut VARÈNE Date: Sun Apr 17 16:51:45 2022 +0200 ath9k: fix QCA9561 PA bias level This patch fixes an invalid TX PA DC bias level on QCA9561, which results in a very low output power and very low throughput as devices are further away from the AP (compared to other 2.4GHz APs). This patch was suggested by Felix Fietkau, who noted[1]: "The value written to that register is wrong, because while the mask definition AR_CH0_TOP2_XPABIASLVL uses a different value for 9561, the shift definition AR_CH0_TOP2_XPABIASLVL_S is hardcoded to 12, which is wrong for 9561." In real life testing, without this patch the 2.4GHz throughput on Yuncore XD3200 is around 10Mbps sitting next to the AP, and closer to practical maximum with the patch applied. [1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name Signed-off-by: Thibaut VARÈNE Acked-by: Felix Fietkau Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220417145145.1847-1-hacks+kernel@slashdirt.org commit 2dc509305cf956381532792cb8dceef2b1504765 Author: Dan Carpenter Date: Sat Apr 9 09:12:25 2022 +0300 ath9k_htc: fix potential out of bounds access with invalid rxstatus->rs_keyix The "rxstatus->rs_keyix" eventually gets passed to test_bit() so we need to ensure that it is within the bitmap. drivers/net/wireless/ath/ath9k/common.c:46 ath9k_cmn_rx_accept() error: passing untrusted data 'rx_stats->rs_keyix' to 'test_bit()' Fixes: 4ed1a8d4a257 ("ath9k_htc: use ath9k_cmn_rx_accept") Signed-off-by: Dan Carpenter Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220409061225.GA5447@kili commit 45286070e9e782f2f53b5272a227fc879fbda2c8 Author: Minghao Chi Date: Mon Apr 11 01:36:02 2022 +0000 wil6210: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() is more appropriate for simplifing code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220411013602.2517086-1-chi.minghao@zte.com.cn commit 67888630addeaa2ae1c04d8d020daccbd26d05d9 Author: YueHaibing Date: Mon Apr 11 10:08:43 2022 +0800 ath11k: Fix build warning without CONFIG_IPV6 drivers/net/wireless/ath/ath11k/mac.c:8175:13: error: ‘ath11k_mac_op_ipv6_changed’ defined but not used [-Werror=unused-function] static void ath11k_mac_op_ipv6_changed(struct ieee80211_hw *hw, ^~~~~~~~~~~~~~~~~~~~~~~~~~ Wrap it with #ifdef block to fix this. Fixes: c3c36bfe998b ("ath11k: support ARP and NS offload") Signed-off-by: YueHaibing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220411020843.10284-1-yuehaibing@huawei.com commit 605194411d7379645ed44e447c4b804a0b476109 Author: Yang Yingliang Date: Tue Apr 12 16:15:53 2022 +0300 ath11k: fix missing unlock on error in ath11k_wow_op_resume() Add the missing unlock before return from function ath11k_wow_op_resume() in the error handling case. Fixes: 90bf5c8d0f7e ("ath11k: purge rx pktlog when entering WoW") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408030912.3087293-1-yangyingliang@huawei.com commit 652f69ed9c1b4f8ef4ea9d6738f1e6263a5ff26d Author: Baochen Qiang Date: Tue Apr 12 16:15:50 2022 +0300 ath11k: Add support for SAR Add ath11k_mac_op_set_bios_sar_specs() to ath11k_ops, this function is called when user space application calls NL80211_CMD_SET_SAR_SPECS. ath11k also registers SAR type and frequency ranges to wiphy so user space can query SAR capabilities. This feature is currently enabled for WCN6855. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02431-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401120948.1312956-3-quic_bqiang@quicinc.com commit e2e23a791745a194aa8e6fb4983c2e7b408ab6e1 Author: Wen Gong Date: Tue Apr 12 16:15:50 2022 +0300 ath11k: add support for extended wmi service bit When the WMI service bits are reported from firmware they are divided into multiple segments, with 128 bits in each segment. The first segment is processed by ath11k_wmi_service_bitmap_copy(), the second segment is processed by ath11k_service_available_event() with WMI_TAG_SERVICE_AVAILABLE_EVENT. When the service bit exceed 256 bits, then firmware reports it by tag WMI_TAG_ARRAY_UINT32 in WMI_SERVICE_AVAILABLE_EVENTID. Currently ath11k does not process the third segment. Upcoming features need to know if firmware support is available for the features, so add processing of the third segment. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401120948.1312956-2-quic_bqiang@quicinc.com commit bdddc253b0938a0063798881d1f6a971ea1d8943 Author: Vincent Mailhol Date: Thu Mar 17 12:55:14 2022 +0900 usb: rework usb_maxpacket() using usb_pipe_endpoint() Rework the body of usb_maxpacket() and just rely on the usb_pipe_endpoint() helper function to retrieve the host endpoint instead of doing it by hand. Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-10-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 2ddf7617d568fdcbd3cc454bb4849fa6d3398c86 Author: Vincent Mailhol Date: Thu Mar 17 12:55:13 2022 +0900 usb: remove third argument of usb_maxpacket() Now that all users of usb_maxpacket() have been migrated to only use two arguments, remove the third variadic argument which was introduced for the transition. Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-9-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 80b2b03bacfc071ceaac034fa81d535d27d57b31 Author: Vincent Mailhol Date: Thu Mar 17 12:55:12 2022 +0900 sound: usb: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Jaroslav Kysela CC: Takashi Iwai CC: Clemens Ladisch Acked-by: Takashi Iwai Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-8-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit dcd2e49b550e928164ccefb5bdf90988ed4df00e Author: Vincent Mailhol Date: Thu Mar 17 12:55:11 2022 +0900 usb: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Duncan Sands CC: Alan Stern CC: Olav Kongas CC: Rui Miguel Silva Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-7-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit e13adbfa391264673bd3ff29ca966af0147b6f4d Author: Vincent Mailhol Date: Thu Mar 17 12:55:10 2022 +0900 net: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Oliver Neukum CC: David S. Miller CC: Jakub Kicinski CC: Woojung Huh CC: Felix Fietkau CC: Lorenzo Bianconi CC: Ryder Lee CC: Kalle Valo CC: Matthias Brugger CC: Stanislaw Gruszka CC: Helmut Schaa Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-6-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 61f879ab755b7dd6f468c55358a3061092682041 Author: Vincent Mailhol Date: Thu Mar 17 12:55:09 2022 +0900 media: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Sean Young CC: Mauro Carvalho Chehab CC: Benjamin Valentin Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-5-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 948bf187694fc1f4c20cf972fa18b1a6fb3d7603 Author: Vincent Mailhol Date: Thu Mar 17 12:55:08 2022 +0900 Input: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Ville Syrjala CC: Dmitry Torokhov CC: Henk Vergonet Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-4-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit b45cde330ba7b52e4c9ea9b36b4a58d32b387441 Author: Vincent Mailhol Date: Thu Mar 17 12:55:07 2022 +0900 HID: usbhid: remove third argument of usb_maxpacket() The third argument of usb_maxpacket(): in_out has been deprecated because it could be derived from the second argument (e.g. using usb_pipeout(pipe)). N.B. function usb_maxpacket() was made variadic to accommodate the transition from the old prototype with three arguments to the new one with only two arguments (so that no renaming is needed). The variadic argument is to be removed once all users of usb_maxpacket() get migrated. CC: Jiri Kosina CC: Benjamin Tissoires Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-3-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 0f08c2e7458e25c967d844170f8ad1aac3b57a02 Author: Vincent Mailhol Date: Thu Mar 17 12:55:06 2022 +0900 usb: deprecate the third argument of usb_maxpacket() This is a transitional patch with the ultimate goal of changing the prototype of usb_maxpacket() from: | static inline __u16 | usb_maxpacket(struct usb_device *udev, int pipe, int is_out) into: | static inline u16 usb_maxpacket(struct usb_device *udev, int pipe) The third argument of usb_maxpacket(): is_out gets removed because it can be derived from its second argument: pipe using usb_pipeout(pipe). Furthermore, in the current version, ubs_pipeout(pipe) is called regardless in order to sanitize the is_out parameter. In order to make a smooth change, we first deprecate the is_out parameter by simply ignoring it (using a variadic function) and will remove it later, once all the callers get updated. The body of the function is reworked accordingly and is_out is replaced by usb_pipeout(pipe). The WARN_ON() calls become unnecessary and get removed. Finally, the return type is changed from __u16 to u16 because this is not a UAPI function. Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220317035514.6378-2-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 63acaa8e9c65dc34dc249440216f8e977f5d2748 Author: Evan Green Date: Thu Apr 21 10:39:27 2022 -0700 USB: hcd-pci: Fully suspend across freeze/thaw cycle The documentation for the freeze() method says that it "should quiesce the device so that it doesn't generate IRQs or DMA". The unspoken consequence of not doing this is that MSIs aimed at non-boot CPUs may get fully lost if they're sent during the period where the target CPU is offline. The current callbacks for USB HCD do not fully quiesce interrupts, specifically on XHCI. Change to use the full suspend/resume flow for freeze/thaw to ensure interrupts are fully quiesced. This fixes issues where USB devices fail to thaw during hibernation because XHCI misses its interrupt and cannot recover. Acked-by: Alan Stern Signed-off-by: Evan Green Link: https://lore.kernel.org/r/20220421103751.v3.2.I8226c7fdae88329ef70957b96a39b346c69a914e@changeid Signed-off-by: Greg Kroah-Hartman commit 9671d55037065e9b83f84f1943bf65fc31036439 Author: Evan Green Date: Thu Apr 21 10:39:26 2022 -0700 USB: core: Disable remote wakeup for freeze/quiesce The PM_EVENT_FREEZE and PM_EVENT_QUIESCE messages should cause the device to stop generating interrupts. USB core was previously allowing devices that were already runtime suspended to keep remote wakeup enabled if they had gone down that way. This violates the contract with pm, and can potentially cause MSI interrupts to be lost. Change that so that if a device is runtime suspended with remote wakeups enabled, it will be resumed to ensure remote wakeup is always disabled across a freeze. Acked-by: Alan Stern Signed-off-by: Evan Green Link: https://lore.kernel.org/r/20220421103751.v3.1.I2c636c4decc358f5e6c27b810748904cc69beada@changeid Signed-off-by: Greg Kroah-Hartman commit a03e2ddab8e735e2cc315609b297b300e9cc60d2 Author: Zheng Yongjun Date: Fri Apr 22 06:26:52 2022 +0000 usb: dwc3: pci: Fix pm_runtime_get_sync() error checking If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: 8eed00b237a28 ("usb: dwc3: pci: Runtime resume child device from wq") Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman commit 4d378f2ae58138d4c55684e1d274e7dd94aa6524 Author: Duoming Zhou Date: Sun Apr 17 20:03:05 2022 +0800 drivers: usb: host: Fix deadlock in oxu_bus_suspend() There is a deadlock in oxu_bus_suspend(), which is shown below: (Thread 1) | (Thread 2) | timer_action() oxu_bus_suspend() | mod_timer() spin_lock_irq() //(1) | (wait a time) ... | oxu_watchdog() del_timer_sync() | spin_lock_irq() //(2) (wait timer to stop) | ... We hold oxu->lock in position (1) of thread 1, and use del_timer_sync() to wait timer to stop, but timer handler also need oxu->lock in position (2) of thread 2. As a result, oxu_bus_suspend() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_irq(), which could let timer handler to obtain the needed lock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220417120305.64577-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit bf594d1d0c1d7b895954018043536ffd327844f9 Author: Wesley Cheng Date: Thu Apr 14 11:35:21 2022 -0700 usb: dwc3: gadget: Replace list_for_each_entry_safe() if using giveback The list_for_each_entry_safe() macro saves the current item (n) and the item after (n+1), so that n can be safely removed without corrupting the list. However, when traversing the list and removing items using gadget giveback, the DWC3 lock is briefly released, allowing other routines to execute. There is a situation where, while items are being removed from the cancelled_list using dwc3_gadget_ep_cleanup_cancelled_requests(), the pullup disable routine is running in parallel (due to UDC unbind). As the cleanup routine removes n, and the pullup disable removes n+1, once the cleanup retakes the DWC3 lock, it references a request who was already removed/handled. With list debug enabled, this leads to a panic. Ensure all instances of the macro are replaced where gadget giveback is used. Example call stack: Thread#1: __dwc3_gadget_ep_set_halt() - CLEAR HALT -> dwc3_gadget_ep_cleanup_cancelled_requests() ->list_for_each_entry_safe() ->dwc3_gadget_giveback(n) ->dwc3_gadget_del_and_unmap_request()- n deleted[cancelled_list] ->spin_unlock ->Thread#2 executes ... ->dwc3_gadget_giveback(n+1) ->Already removed! Thread#2: dwc3_gadget_pullup() ->waiting for dwc3 spin_lock ... ->Thread#1 released lock ->dwc3_stop_active_transfers() ->dwc3_remove_requests() ->fetches n+1 item from cancelled_list (n removed by Thread#1) ->dwc3_gadget_giveback() ->dwc3_gadget_del_and_unmap_request()- n+1 deleted[cancelled_list] ->spin_unlock Fixes: d4f1afe5e896 ("usb: dwc3: gadget: move requests to cancelled_list") Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220414183521.23451-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 2840d6dfcf4306878f7d17ac16d4a0a6422728cc Author: Wesley Cheng Date: Thu Apr 14 00:39:02 2022 -0700 usb: dwc3: EP clear halt leading to clearing of delayed_status The usb_ep_clear_halt() API can be called from the function driver, and translates to dwc3_gadget_ep_set_halt(). This routine is shared with when the host issues a clear feature ENDPOINT_HALT, and is differentiated by the protocol argument. If the following sequence occurs, there can be a situation where the delayed_status flag is improperly cleared for the wrong SETUP transaction: 1. Vendor specific control transfer returns USB_GADGET_DELAYED_STATUS. 2. DWC3 gadget sets dwc->delayed_status to '1'. 3. Another function driver issues a usb_ep_clear_halt() call. 4. DWC3 gadget issues dwc3_stop_active_transfer() and sets DWC3_EP_PENDING_CLEAR_STALL. 5. EP command complete interrupt triggers for the end transfer, and dwc3_ep0_send_delayed_status() is allowed to run, as delayed_status is '1' due to step#1. 6. STATUS phase is sent, and delayed_status is cleared. 7. Vendor specific control transfer is finished being handled, and issues usb_composite_setup_continue(). This results in queuing of a data phase. Cache the protocol flag so that DWC3 gadget is aware of when the clear halt is due to a SETUP request from the host versus when it is sourced from a function driver. This allows for the EP command complete interrupt to know if it needs to issue a delayed status phase. Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220414073902.21960-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman commit e05c7ddfeb23182421972b9074fb8f5aa356cfee Author: Minghao Chi Date: Wed Apr 20 09:01:41 2022 +0000 wlcore: cmd: using pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220420090141.2588553-1-chi.minghao@zte.com.cn commit 00bfc8964f4349dacc6799fe712de186e9bd8bb8 Author: Minghao Chi Date: Tue Apr 19 11:04:45 2022 +0000 wlcore: sdio: using pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220419110445.2574424-1-chi.minghao@zte.com.cn commit d8e11976d8e897ffedca5d1f3b9032156274eceb Author: Minghao Chi Date: Wed Apr 13 09:39:39 2022 +0000 wlcore: vendor_cmd: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413093939.2538825-1-chi.minghao@zte.com.cn commit 3447eebe6084f3d0919e72eafa1b7d19e3f87580 Author: Minghao Chi Date: Wed Apr 13 09:35:02 2022 +0000 wlcore: testmode: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413093502.2538316-1-chi.minghao@zte.com.cn commit da8e909c99e4525da5ce56814fca5e9cc4a20a63 Author: Minghao Chi Date: Wed Apr 13 09:34:31 2022 +0000 wlcore: sysfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413093431.2538254-1-chi.minghao@zte.com.cn commit ab589ac24ee1c00be2ae47aba7ef868394b7fa9c Author: Minghao Chi Date: Tue Apr 12 09:17:42 2022 +0000 wlcore: main: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220412091742.2533527-1-chi.minghao@zte.com.cn commit 9f4f53efa986ed5e2e429f8cf534bae174e6822c Merge: 3123109284176 59086e4193f4f Author: Stephen Boyd Date: Fri Apr 22 19:39:21 2022 -0700 Merge tag 'renesas-clk-for-v5.19-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 support for the new RZ/G2UL SoC - Add RPC (QSPI/HyperFlash) clocks on R-Car E3 and D3 - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r9a07g043: Add SDHI clock and reset entries clk: renesas: r9a07g043: Add GbEthernet clock/reset clk: renesas: r9a07g043: Add ethernet clock sources clk: renesas: r9a07g043: Add GPIO clock and reset entries clk: renesas: Add support for RZ/G2UL SoC clk: renesas: Move RPC core clocks clk: renesas: rzg2l: Simplify multiplication/shift logic dt-bindings: clock: Add R9A07G043 CPG Clock and Reset Definitions clk: renesas: r8a77995: Add RPC clocks clk: renesas: r8a77990: Add RPC clocks dt-bindings: clock: renesas: Document RZ/G2UL SoC clk: renesas: rzg2l: Remove unused notifiers commit 5baa12cfc433ff514b05e289ef59b06a4de1ac16 Author: Stephen Kitt Date: Thu Apr 7 17:18:31 2022 +0200 clk: renesas-pcie: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-11-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit 2b349b893def67fd3146055d720597d9cbef26be Author: Stephen Kitt Date: Thu Apr 7 17:18:30 2022 +0200 clk: si570: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-10-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit 32a5c1d383780f4ad4455f0d79ab999377f06a48 Author: Stephen Kitt Date: Thu Apr 7 17:18:29 2022 +0200 clk: si544: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-9-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit ca3ebd20d956951e4b0633b9ee5342271728e840 Author: Stephen Kitt Date: Thu Apr 7 17:18:28 2022 +0200 clk: si5351: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-8-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit adc00f60c829b1d759b16f4f928764c92286d399 Author: Stephen Kitt Date: Thu Apr 7 17:18:27 2022 +0200 clk: si5341: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-7-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit d8703ce85e7c7afbb9df736e75138a32e1cba164 Author: Stephen Kitt Date: Thu Apr 7 17:18:26 2022 +0200 clk: si514: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-6-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit 55349aedb5daa5ca8f14e485d069b0bb6ea483d5 Author: Stephen Kitt Date: Thu Apr 7 17:18:25 2022 +0200 clk: max9485: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-5-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit eb5f909ac9e7a1e0c77b6a3b1514a4941efdefb5 Author: Stephen Kitt Date: Thu Apr 7 17:18:24 2022 +0200 clk: cs2000-cp: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-4-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit df221682075d174e04cbbded27a25c64fedc3526 Author: Stephen Kitt Date: Thu Apr 7 17:18:23 2022 +0200 clk: cdce925: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-3-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit f9edf134d75d78d3e54f3a13d9d493e86c0599fa Author: Stephen Kitt Date: Thu Apr 7 17:18:22 2022 +0200 clk: cdce706: use simple i2c probe function The i2c probe function here doesn't use the id information provided in its second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220407151831.2371706-2-steve@sk2.org Reviewed-by: Wolfram Sang Signed-off-by: Stephen Boyd commit 1e627317919066386d089aaca1aab77bc5200c02 Author: Felix Fietkau Date: Mon Mar 14 09:44:04 2022 +0100 clk: en7523: Add clock driver for Airoha EN7523 SoC This driver only registers fixed rate clocks, since the clocks are fully initialized by the boot loader and should not be changed later, according to Airoha. Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20220314084409.84394-3-nbd@nbd.name Reviewed-by: Matthias Brugger Signed-off-by: Stephen Boyd commit 038010bb30684c0219fa4f93a13149038f28291a Author: John Crispin Date: Mon Mar 14 09:44:03 2022 +0100 dt-bindings: Add en7523-scu device tree binding documentation Adds device tree binding documentation for clocks in the EN7523 SOC. Reviewed-by: Rob Herring Signed-off-by: John Crispin Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20220314084409.84394-2-nbd@nbd.name Signed-off-by: Stephen Boyd commit bae71de51b8901372d7ed5c6b89d32282db7e9ed Author: Georgi Vlaev Date: Fri Apr 15 22:03:43 2022 +0300 clk: keystone: syscon-clk: Add support for AM62 epwm-tbclk AM62 has 3 instances of EPWM modules. Each EPWM module has an EPWM TBCLKEN module input used to individually enable or disable its EPWM time-base clock. The EPWM time-base clock enable input comes from the CTRLMMR_EPWM_TB_CLKEN register bits 0 to 2 in CTRL_MMR0 module (6.1.1.4.1.48 [1]). This is virtually the same setup as in AM64 but with 3 instead of 9 clock providers on AM62. Update the driver with the 3 instances of clocks associated to a new compatible: "ti,am62-epwm-tbclk". [1] https://www.ti.com/lit/pdf/spruiv7 Signed-off-by: Georgi Vlaev Tested-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220415190343.6284-3-g-vlaev@ti.com Reviewed-by: Nishanth Menon Signed-off-by: Stephen Boyd commit 4ce2b909dcf578c79faf1e47589f59731e331b14 Author: Georgi Vlaev Date: Fri Apr 15 22:03:42 2022 +0300 dt-bindings: clock: ehrpwm: Add AM62 specific compatible Introduce AM62 specific compatible for EPWM time-base sub-module clock. The time-base clock setup is identical to AM64. The only difference is AM62 provides 3 time-base clocks instead of the 9 found in AM64. Signed-off-by: Georgi Vlaev Tested-by: Vignesh Raghavendra Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20220415190343.6284-2-g-vlaev@ti.com Signed-off-by: Stephen Boyd commit 3196a605659dcf7ea2a4442edf704aa0edc6e559 Author: Minghao Chi Date: Mon Apr 18 11:04:55 2022 +0000 clk: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220418110455.2559264-1-chi.minghao@zte.com.cn [sboyd@kernel.org: Drop local ret variable too] Signed-off-by: Stephen Boyd commit bab79506fd16dd36e3b9012ed0d882c15a3a0eb8 Author: Colin Ian King Date: Mon Apr 18 15:15:37 2022 +0100 clk: actions: remove redundant assignment after a mask operation The assignment operation after a & mask operation is redundant, the &= operator can be replaced with just the & operator. Cleans up a clang-scan warning: drivers/clk/actions/owl-pll.c:28:9: warning: Although the value stored to 'mul' is used in the enclosing expression, the value is never actually read from 'mul' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220418141537.83994-1-colin.i.king@gmail.com Signed-off-by: Stephen Boyd commit 544ccad739251b21dfa1e7f4b57aa9ea50d2d0f1 Author: Zack Rusin Date: Fri Apr 22 12:13:42 2022 -0400 drm/vmwgfx: Reserve fence slots on buffer objects in cotables The buffer objects created by cotables were missing fence reservations. They are created from vmw_validation_res_validate which makes them miss the ttm_eu_reserve_buffers which is called from vmw_validation_bo_reserve. Cotables are the only resources which create a buffer object in the create callback so make sure the code also reserves the slots. Signed-off-by: Zack Rusin Co-developed-by: Christian König Reviewed-by: Christian König Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4") Link: https://patchwork.freedesktop.org/patch/msgid/20220422161342.1142584-1-zack@kde.org commit 31693d02b06ed2f0ac668cede16cf3258e86204e Author: Colin Ian King Date: Thu Apr 21 09:55:46 2022 +0100 net: hns3: Fix spelling mistake "actvie" -> "active" There is a spelling mistake in a netdev_info message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220421085546.321792-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit f28c47bb9fd3286a99194876a6e528be87484c75 Author: Haowen Bai Date: Thu Apr 21 10:48:03 2022 +0800 tsnep: Remove useless null check before call of_node_put() No need to add null check before call of_node_put(), since the implementation of of_node_put() has done it. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650509283-26168-1-git-send-email-baihaowen@meizu.com Signed-off-by: Jakub Kicinski commit e21bebf9727a2e96c89c1f35e8f3e04e37afd6de Merge: 869376d0859ac 58f373f8d7873 Author: Jakub Kicinski Date: Fri Apr 22 16:30:07 2022 -0700 Merge branch 'add-ethtool-sqi-support-for-lan87xx-t1-phy' Arun Ramadoss says: ==================== add ethtool SQI support for LAN87xx T1 Phy This patch series add the Signal Quality Index measurement for the LAN87xx and LAN937x T1 phy. Updated the maintainers file for microchip_t1.c. ==================== Link: https://lore.kernel.org/r/20220420152016.9680-1-arun.ramadoss@microchip.com Signed-off-by: Jakub Kicinski commit 58f373f8d7873bfef0e8414bca554cf99571fa14 Author: Arun Ramadoss Date: Wed Apr 20 20:50:16 2022 +0530 MAINTAINERS: Add maintainers for Microchip T1 Phy driver Signed-off-by: Arun Ramadoss Signed-off-by: Jakub Kicinski commit b649695248b15bfd921abda7c9096e1a93f8d67d Author: Arun Ramadoss Date: Wed Apr 20 20:50:15 2022 +0530 net: phy: LAN87xx: add ethtool SQI support This patch add the support for measuring Signal Quality Index for LAN87xx and LAN937x T1 Phy. It uses the SQI Method 5 for obtaining the values. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 57ebd5d568f5e1e34f5a0b67460444d43e9b829b Merge: 8ad0b83e00795 c275872107fe1 Author: Mark Brown Date: Sat Apr 23 00:16:32 2022 +0100 ASoC: SOF: pci: add quirks and PCI IDS Merge series from Pierre-Louis Bossart : Add two PCI IDs and quirks for APL Chromebooks and Intel IPC4 selection for developers. commit 8ad0b83e0079564989ccbe5b864cc265a0f5a14d Author: Pierre-Louis Bossart Date: Thu Apr 21 11:25:05 2022 -0500 ASoC: soc-core: remove always-false path cppcheck throws the following warning: sound/soc/soc-core.c:2773:6: style: Condition '!num_widgets' is always false [knownConditionTrueFalse] if (!num_widgets) { ^ sound/soc/soc-core.c:2761:18: note: Assuming that condition 'num_widgets<0' is not redundant if (num_widgets < 0) { ^ sound/soc/soc-core.c:2766:18: note: Assuming condition is false if (num_widgets & 1) { ^ sound/soc/soc-core.c:2772:2: note: Compound assignment '/=', assigned value is 0 num_widgets /= 2; ^ We should check upfront all error conditions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220421162505.302132-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2a68ff846164922196c38718ad8dc216819ccd38 Author: Peter Ujfalusi Date: Thu Apr 21 15:20:31 2022 -0500 ASoC: SOF: Intel: hda: Revisit IMR boot sequence The sequence for IMR boot is essentially the same as normal boot with the difference that instead of DMA from host the firmware is loaded from IMR. Re-structure the code to use the existing sequence and also add fallback handling in case the IMR boot fails. Introduce a new flag to make the IMR boot support check simpler. Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421202031.1548362-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 95fa7a62e164630981c5f10d36c2967004f74237 Author: Pierre-Louis Bossart Date: Thu Apr 21 15:19:46 2022 -0500 ASoC: SOF: Intel: hda: simplify NHLT handling The existing code does an init/free for each piece of information needed. We can instead initialize the NHLT table in the .probe() and free it in the .remove() callback. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220421201946.1547041-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 14bdc7b2f9ea0d3f86beed93079ce40a7ead57ac Author: Peter Ujfalusi Date: Thu Apr 21 15:18:47 2022 -0500 ASoC: SOF: topology: Check w->sname validity once in sof_connect_dai_widget() The 'w' (struct snd_soc_dapm_widget) is not changing within the function, there is no reason to check the w->sname more than once as it is not going to change. Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421201847.1545686-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f226041424cf87245d39a1b2dfae304308b36b6b Author: Dave Gerlach Date: Sat Apr 9 14:12:15 2022 -0700 soc: ti: wkup_m3_ipc: Add support for toggling VTT regulator Some boards like the AM335x EVM-SK and AM437x GP EVM provide software control via a GPIO pin to toggle the DDR VTT regulator to reduce power consumption in low power states. The VTT regulator should be disabled after enabling self-refresh on suspend, and should be enabled before disabling self-refresh on resume. This is to allow proper self-refresh entry/exit commands to be transmitted to the memory. The "ti,vtt-gpio-pin" device tree property in the wkup_m3_ipc node specifies which GPIO pin to use. This property is communicated to the Wakeup Cortex M3 co-processor where the actual toggling of the GPIO pin happens in CM3 firmware [1]. Please note that the GPIO pin must be on the GPIO0 module as that module is in the wakeup power domain. [1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/tree/src/pm_services/ddr.c?h=08.02.00.006#n190 Signed-off-by: Dave Gerlach Signed-off-by: Keerthy [dfustini: remove the unnecessary "ti,needs-vtt-toggle" property] Signed-off-by: Drew Fustini Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220409211215.2529387-3-dfustini@baylibre.com commit 12eeb74925da70eb39d90abead9de9793be3d4c8 Author: Minghao Chi Date: Mon Apr 18 06:29:55 2022 +0000 soc: ti: knav_qmss_queue: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifying code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220418062955.2557949-1-chi.minghao@zte.com.cn commit 280302f0e8f6919f0c591753ea21906d77797746 Author: Alison Schofield Date: Wed Apr 6 18:09:15 2022 -0700 cxl/mbox: Replace NULL check with IS_ERR() after vmemdup_user() vmemdup_user() returns an ERR_PTR() on failure. Use IS_ERR() to check the return value. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Alison Schofield Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220407010915.1211258-1-alison.schofield@intel.com Signed-off-by: Dan Williams commit 26f89535a5bb17915a2e1062c3999a2ee797c7b0 Author: Alison Schofield Date: Wed Apr 13 22:12:46 2022 -0700 cxl/mbox: Use type __u32 for mailbox payload sizes Payload sizes for mailbox commands are expected to be positive values coming from userspace. The documentation correctly describes these as always unsigned values. The mailbox and send structures that support the mailbox commands however, use __s32 types for the payloads. Replace __s32 with __u32 in the mailbox and send command structures and update usages. Kernel users of the interface already block all negative values and there is no known ability for userspace to have grown a dependency on submitting negative values to the kernel. The known user of the IOCTL, the CXL command line interface (cxl-cli) already enforces positive size values. A Smatch warning of a signedness uncovered this issue. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Alison Schofield Link: https://lore.kernel.org/r/20220414051246.1244575-1-alison.schofield@intel.com Signed-off-by: Dan Williams commit 9ea4dcf49878bb9546b8fa9319dcbdc9b7ee20f8 Author: Dan Williams Date: Fri Apr 22 15:58:11 2022 -0700 PM: CXL: Disable suspend The CXL specification claims S3 support at a hardware level, but at a system software level there are some missing pieces. Section 9.4 (CXL 2.0) rightly claims that "CXL mem adapters may need aux power to retain memory context across S3", but there is no enumeration mechanism for the OS to determine if a given adapter has that support. Moreover the save state and resume image for the system may inadvertantly end up in a CXL device that needs to be restored before the save state is recoverable. I.e. a circular dependency that is not resolvable without a third party save-area. Arrange for the cxl_mem driver to fail S3 attempts. This still nominaly allows for suspend, but requires unbinding all CXL memory devices before the suspend to ensure the typical DRAM flow is taken. The cxl_mem unbind flow is intended to also tear down all CXL memory regions associated with a given cxl_memdev. It is reasonable to assume that any device participating in a System RAM range published in the EFI memory map is covered by aux power and save-area outside the device itself. So this restriction can be minimized in the future once pre-existing region enumeration support arrives, and perhaps a spec update to clarify if the EFI memory map is sufficent for determining the range of devices managed by platform-firmware for S3 support. Per Rafael, if the CXL configuration prevents suspend then it should fail early before tasks are frozen, and mem_sleep should stop showing 'mem' as an option [1]. Effectively CXL augments the platform suspend ->valid() op since, for example, the ACPI ops are not aware of the CXL / PCI dependencies. Given the split role of platform firmware vs OS provisioned CXL memory it is up to the cxl_mem driver to determine if the CXL configuration has elements that platform firmware may not be prepared to restore. Link: https://lore.kernel.org/r/CAJZ5v0hGVN_=3iU8OLpHY3Ak35T5+JcBM-qs8SbojKrpd0VXsA@mail.gmail.com [1] Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Len Brown Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/165066828317.3907920.5690432272182042556.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 1a358d35066487d228a68303d808bc4721c6b1b9 Author: Krzysztof Kozlowski Date: Fri Apr 22 12:53:26 2022 +0200 rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220422105326.78713-1-krzysztof.kozlowski@linaro.org commit 4e55a6cf48119243ca05c16bcb3bd3887a3c68b5 Author: Bjorn Andersson Date: Fri Apr 8 15:05:39 2022 -0700 remoteproc: qcom: pas: Add sc8280xp remoteprocs Among the subsystems in the Qualcomm sc8280xp platform we find an audio and two compute DSPs. Add support for controlling these using the peripheral authentication service (PAS) remoteproc driver. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220408220539.625301-2-bjorn.andersson@linaro.org commit ee651cd1e944df7d1553bb2c5593e887f12d6cda Author: Bjorn Andersson Date: Fri Apr 8 15:05:38 2022 -0700 dt-bindings: remoteproc: qcom: pas: Add sc8280xp adsp and nsp pair Add the Qualcomm sc8280xp ADSP and NSP pairs to the binding. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220408220539.625301-1-bjorn.andersson@linaro.org commit 869376d0859acf40c83b2c3942ad9d5a8b5d31e4 Author: Jiri Pirko Date: Wed Apr 20 17:20:07 2022 +0300 mlxsw: core_linecards: Fix size of array element during ini_files allocation types_info->ini_files is an array of pointers to struct mlxsw_linecard_ini_file. Fix the kmalloc_array() argument to be of a size of a pointer. Addresses-Coverity: ("Incorrect expression (SIZEOF_MISMATCH)") Fixes: b217127e5e4e ("mlxsw: core_linecards: Add line card objects and implement provisioning") Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220420142007.3041173-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit fd0493a1e49eb643ac86f3932b1bde60bcc9f402 Author: Andrii Nakryiko Date: Wed Apr 20 20:39:45 2022 -0700 selftests/bpf: Switch fexit_stress to bpf_link_create() API Use bpf_link_create() API in fexit_stress test to attach FEXIT programs. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Kui-Feng Lee Link: https://lore.kernel.org/bpf/20220421033945.3602803-4-andrii@kernel.org commit 8462e0b46fe2d4c56d0a7de705228e3bf1da03d9 Author: Andrii Nakryiko Date: Wed Apr 20 20:39:44 2022 -0700 libbpf: Teach bpf_link_create() to fallback to bpf_raw_tracepoint_open() Teach bpf_link_create() to fallback to bpf_raw_tracepoint_open() on older kernels for programs that are attachable through BPF_RAW_TRACEPOINT_OPEN. This makes bpf_link_create() more unified and convenient interface for creating bpf_link-based attachments. With this approach end users can just use bpf_link_create() for tp_btf/fentry/fexit/fmod_ret/lsm program attachments without needing to care about kernel support, as libbpf will handle this transparently. On the other hand, as newer features (like BPF cookie) are added to LINK_CREATE interface, they will be readily usable though the same bpf_link_create() API without any major refactoring from user's standpoint. bpf_program__attach_btf_id() is now using bpf_link_create() internally as well and will take advantaged of this unified interface when BPF cookie is added for fentry/fexit. Doing proactive feature detection of LINK_CREATE support for fentry/tp_btf/etc is quite involved. It requires parsing vmlinux BTF, determining some stable and guaranteed to be in all kernels versions target BTF type (either raw tracepoint or fentry target function), actually attaching this program and thus potentially affecting the performance of the host kernel briefly, etc. So instead we are taking much simpler "lazy" approach of falling back to bpf_raw_tracepoint_open() call only if initial LINK_CREATE command fails. For modern kernels this will mean zero added overhead, while older kernels will incur minimal overhead with a single fast-failing LINK_CREATE call. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Kui-Feng Lee Link: https://lore.kernel.org/bpf/20220421033945.3602803-3-andrii@kernel.org commit df86ca0d2f0fa6be525a25b0b3d836d361f85754 Author: Andrii Nakryiko Date: Wed Apr 20 20:39:43 2022 -0700 bpf: Allow attach TRACING programs through LINK_CREATE command Allow attaching BTF-aware TRACING programs, previously attachable only through BPF_RAW_TRACEPOINT_OPEN command, through LINK_CREATE command: - BTF-aware raw tracepoints (tp_btf in libbpf lingo); - fentry/fexit/fmod_ret programs; - BPF LSM programs. This change converges all bpf_link-based attachments under LINK_CREATE command allowing to further extend the API with features like BPF cookie under "multiplexed" link_create section of bpf_attr. Non-BTF-aware raw tracepoints are left under BPF_RAW_TRACEPOINT_OPEN, but there is nothing preventing opening them up to LINK_CREATE as well. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Kuifeng Lee Link: https://lore.kernel.org/bpf/20220421033945.3602803-2-andrii@kernel.org commit 5e7260712b9a76de19c32f15d667f8f93e573978 Author: Guillaume Nault Date: Thu Apr 21 14:47:26 2022 +0200 qed: Remove IP services API. qed_nvmetcp_ip_services.c and its corresponding header file were introduced in commit 806ee7f81a2b ("qed: Add IP services APIs support") but there's still no users for any of the functions they declare. Since these files are effectively unused, let's just drop them. Found by code inspection. Compile-tested only. Signed-off-by: Guillaume Nault Link: https://lore.kernel.org/r/351ac8c847980e22850eb390553f8cc0e1ccd0ce.1650545051.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit 69ab1e16d3823c05892371cd2c89e7852ac87067 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:16 2022 +0300 dt-bindings: pinctrl: add binding for Ralink RT3883 pinctrl Add binding for the Ralink RT3883 pin controller for RT3883 SoC. Signed-off-by: Arınç ÜNAL Reviewed-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-15-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit b6a3a007a99ac372a6eb3dbc6954f61cff5e2985 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:15 2022 +0300 dt-bindings: pinctrl: add binding for Ralink RT305X pinctrl Add binding for the Ralink RT305X pin controller for RT3050, RT3052, RT3350, RT3352 and RT5350 SoCs. Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-14-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit a8bf29d253a8e4c2e71d28d935fa2f0b6c65738c Author: Arınç ÜNAL Date: Thu Apr 14 20:39:14 2022 +0300 dt-bindings: pinctrl: add binding for Ralink MT7621 pinctrl Add binding for the Ralink MT7621 pin controller for MT7621 SoC. Signed-off-by: Arınç ÜNAL Reviewed-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-13-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit fdcd7c8d1588dac8846ec4f057684fd94f5614ef Author: Arınç ÜNAL Date: Thu Apr 14 20:39:13 2022 +0300 dt-bindings: pinctrl: add binding for Ralink MT7620 pinctrl Add binding for the Ralink MT7620 pin controller for MT7620, MT7628 and MT7688 SoCs. Signed-off-by: Arınç ÜNAL Reviewed-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-12-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 23e37546b25edc2e44d9a23ba6e92ef6270cd988 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:12 2022 +0300 dt-bindings: pinctrl: rt2880: fix binding name, pin groups and functions Deprecate the old property "ralink,rt2880-pinmux". Add the new property "ralink,rt2880-pinctrl". The old property name was inaccurate as the hardware block is called pinctrl across the Mediatek/Ralink architecture. Current pin group and function bindings are for MT7621. Put bindings for RT2880 instead. Add me as a maintainer. Signed-off-by: Arınç ÜNAL Reviewed-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-11-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit b4f209e32ba5c283e7b1dd00d867b0536d3e215e Author: Arınç ÜNAL Date: Thu Apr 14 20:39:11 2022 +0300 mips: dts: ralink: mt7621: use the new compatible string for MT7621 pinctrl Use the new compatible string "ralink,mt7621-pinctrl" for the Ralink MT7621 pinctrl subdriver on mt7621.dtsi. Each subdriver needs to have a different compatible string. We don't want the same compatible string to match a different subdriver's pinmux data as it's not for our SoC. Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-10-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 56dfb7baf36f9e09b55c844c8624bdb81d8ef8a6 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:10 2022 +0300 MAINTAINERS: add Ralink pinctrl driver Add a new section for the Ralink pinctrl driver and add me and Sergio as the maintainers. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-9-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit e5981cd46183508b16756cbf0278eadcb4377e0a Author: Arınç ÜNAL Date: Thu Apr 14 20:39:09 2022 +0300 pinctrl: ralink: add new compatible strings for each pinctrl subdriver As seen on any other pinctrl subdriver that calls code from a main driver, each subdriver needs to have a different compatible string. We don't want the same compatible string to match a different subdriver's pinmux data as it's not for our SoC. Therefore, add new compatible strings for each pinctrl subdriver. Change driver name on all subdrivers accordingly. Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-8-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 91da26dcf5385a65dc736117600fb982eb9867e8 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:08 2022 +0300 pinctrl: ralink: rename driver names to subdrivers MT7620, MT7621, RT2880, RT305X and RT3883 pinctrl are subdrivers of the Ralink pinctrl driver. Change the bool for these subdrivers accordingly. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-7-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 18653d4bd8ab00f44ccd9103912e08cd01ea208a Author: Arınç ÜNAL Date: Thu Apr 14 20:39:07 2022 +0300 pinctrl: ralink: rename variable names for functions on MT7620 and MT7621 Variables for functions include "grp" on the Ralink MT7620 and MT7621 subdrivers. Rename them to "func" instead as they define the functions for the pin groups. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-6-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit f5dff8ac1333538d27165a9eb022b89142a8a18e Author: Arınç ÜNAL Date: Thu Apr 14 20:39:06 2022 +0300 pinctrl: ralink: rename pinctrl-rt288x to pinctrl-rt2880 Rename "pinctrl-rt288x.c" to "pinctrl-rt2880.c" as this is the Ralink RT2880 pinctrl subdriver. Rename PINCTRL_RT288X symbol to PINCTRL_RT2880. Rename functions that include "rt288x" to "rt2880". Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-5-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit bc25a9754efa34153c9740800ae9b459fb7cc77f Author: Arınç ÜNAL Date: Thu Apr 14 20:39:05 2022 +0300 pinctrl: ralink: rename pinmux functions to pinctrl Rename pinctrl related functions from "pinmux" to "pinctrl". Change driver name from "ralink-pinmux" to "ralink-pinctrl". Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-4-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 6b3dd85b0bdec1a8308fa5dcbafcd5d55b5f3608 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:04 2022 +0300 pinctrl: ralink: rename pinctrl-rt2880 to pinctrl-ralink pinctrl-rt2880.c and pinmux.h make up the Ralink pinctrl driver. Rename pinctrl-rt2880.c to pinctrl-ralink.c. Rename pinmux.h to pinctrl-ralink.h. Fix references to it. Rename functions that include "rt2880" to "ralink". Remove PINCTRL_RT2880 symbol and make the existing PINCTRL_RALINK symbol compile pinctrl-ralink.c. Change the bool to "Ralink pinctrl driver". Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-3-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit 150438c86f55989632005b92c94f4aa2ec562ed6 Author: Arınç ÜNAL Date: Thu Apr 14 20:39:03 2022 +0300 pinctrl: ralink: rename MT7628(an) functions to MT76X8 The functions that include "MT7628(an)" are for MT7628 and MT7688 SoCs. Rename them to MT76X8 to refer to both of the SoCs. Signed-off-by: Arınç ÜNAL Reviewed-by: Sergio Paracuellos Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220414173916.5552-2-arinc.unal@arinc9.com Signed-off-by: Linus Walleij commit bc8e81a55f3a71d37f7e7aff55acb062c58551fe Merge: a6a5c1737fa91 f7bc5f52d2354 Author: Linus Walleij Date: Sat Apr 23 00:04:56 2022 +0200 Merge tag 'renesas-pinctrl-for-v5.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.19 - Add support for the new RZ/G2UL SoC, - Add drive-strength support for R-Car E3, - Add RPC/QSPI pin groups on R-Car E3 and E3, - Miscellaneous fixes and improvements. commit a6a5c1737fa914751aa9303ad9ee605244e05aa4 Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:07 2022 +0530 pinctrl: qcom: Update clock voting as optional Update bulk clock voting to optional voting as ADSP bypass platform doesn't need macro and decodec clocks, as these macro and dcodec GDSC switches are maintained as power domains and operated from lpass clock drivers. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1650285427-19752-8-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit 120a5f2e5430ca3908d8b7639105d95f12ac135c Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:06 2022 +0530 pinctrl: qcom: Add SC7280 lpass pin configuration Add pin control support for SC7280 LPASS LPI. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/1650285427-19752-7-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit 9ce49018c6928263d41b783c9e4928c6af05db43 Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:05 2022 +0530 pinctrl: qcom: Extract chip specific LPASS LPI code Extract the chip specific SM8250 data from the LPASS LPI pinctrl driver to allow reusing the common code in the addition of subsequent platforms. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/1650285427-19752-6-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit be73368d535614b351c13a10680b4cdd06db2417 Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:04 2022 +0530 pinctrl: qcom: Update lpi pin group custiom functions with framework generic functions Update custom pin group structure members with framework generic group_desc structure and replace the driver's custom pinctrl_ops with framework provided generic pin control group functions to avoid redundant code written in lpass lpi driver. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/1650285427-19752-5-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit 6454711015267fe38b6f05aba232e01be2cb9693 Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:03 2022 +0530 pinctrl: qcom: Update macro name to LPI specific Update NO_SLEW macro to LPI_NO_SLEW macro as this driver lpi specific. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1650285427-19752-4-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit 6af63b663d3beb2afba6ca867fa21baedb8640ed Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:02 2022 +0530 dt-bindings: pinctrl: qcom: Add sc7280 lpass lpi pinctrl bindings Add device tree binding Documentation details for Qualcomm SC7280 LPASS LPI pinctrl driver. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1650285427-19752-3-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit e343cff747f7af3f7898668e9058a7ad68903c8b Author: Srinivasa Rao Mandadapu Date: Mon Apr 18 18:07:01 2022 +0530 dt-bindings: pinctrl: qcom: Update lpass lpi file name to SoC specific Change generic lpass lpi pincotrol bindings file to SoC specific file, to distinguish and accomadate other SoC specific dt bindings. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Acked-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1650285427-19752-2-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Linus Walleij commit 30b7fa3a98de79683d3e2b33d945a42554c00c32 Author: Sebastian Reichel Date: Fri Apr 22 19:09:12 2022 +0200 dt-bindings: pinctrl: rockchip: add rk3588 Add compatible string for rk3588 pin controller. No other changes are required, since the new controller can use the old binding. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20220422170920.401914-12-sebastian.reichel@collabora.com Signed-off-by: Linus Walleij commit 4b9d632f66e35ed684257ff388e6197dec52db85 Author: Linus Walleij Date: Mon Apr 18 18:43:17 2022 +0200 pinctrl: nomadik: Add new MC2 config The MC2 MMC interface can be configured with the FBCLK (feedback clock) unconnected, leaving the pin available for reuse for something else. Add a group mc2_a_2 for this. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220418164317.864418-1-linus.walleij@linaro.org commit 90c0659ed38a9d4709c156f3f7ea900f9afe873f Author: Lv Ruyi Date: Mon Apr 18 02:02:38 2022 +0000 pinctrl: thunderbay: Use devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately.Make the code simpler without functional changes. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220418020238.2556989-1-lv.ruyi@zte.com.cn Signed-off-by: Linus Walleij commit 1f61e9aa2e6f97c26d84c66628c2c85bb5e5a56a Author: William Zhang Date: Wed Apr 13 12:26:45 2022 -0700 ARM: multi_v7_defconfig: enable CONFIG_ARCH_BCMBCA in armv7 defconfig Enable CONFIG_ARCH_BCMBCA in multi_v7_defconfig. This config can be used to build a basic kernel for BCM47622 booting to console. Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit c270a59bc4d7537c3e6bab080c65e669e459fc53 Author: William Zhang Date: Wed Apr 13 12:26:44 2022 -0700 MAINTAINERS: Add Broadcom BCMBCA entry Add maintainers, SCM tree, files and directories for the new BCMBCA arch. Only add 47622 for this change and will update in the future when more SoCs are supported. Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit 643661e0033632658862d73247665099db40fbd3 Author: William Zhang Date: Wed Apr 13 12:26:43 2022 -0700 ARM: dts: add dts files for bcmbca soc 47622 Add dts for ARMv7 based broadband SoC BCM47622. bcm47622.dtsi is the SoC description dts header and bcm947622.dts is a simple dts file for Broadcom BCM947622 Reference board that only enable the UART port. Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit b32c613b3fda3e1c26119609f1ad6b19178f82f5 Author: William Zhang Date: Wed Apr 13 12:26:42 2022 -0700 arm: bcmbca: add arch bcmbca machine entry Update mach-bcm Kconfig to add ARCH_BCMBCA config and select the required configs for Broadcom Broadband SoC chipsets Signed-off-by: William Zhang Signed-off-by: Florian Fainelli commit ad984c428c311a7df4b33c038be40d795a9299bf Author: William Zhang Date: Wed Apr 13 12:26:41 2022 -0700 dt-bindings: arm: add bcmbca device tree binding document Add arch bcmbca device tree binding document for Broadcom ARM based broadband SoC chipsets. In this change, only BCM47622 is added. Other chipsets will be added in the future. Signed-off-by: William Zhang Acked-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit 52ec0d90a663685afac984a6426290aa6e01032c Author: Joe Perches Date: Tue Apr 12 11:34:15 2022 -0700 MAINTAINERS: Broadcom internal lists aren't maintainers Convert the broadcom internal list M: and L: entries to R: as exploder email addresses are neither maintainers nor mailing lists. Reorder the entries as necessary. Signed-off-by: Joe Perches Signed-off-by: Florian Fainelli commit 8d2d607c6cd8c8bcbfdb8b399a1d28af27bb238d Author: Paul Cercueil Date: Tue Apr 12 17:22:18 2022 +0100 pinctrl: ingenic: Garbage-collect code paths for SoCs disabled by config By being a bit smarter about how the SoC version checks are performed, it is possible to have all the code paths that correspond to SoCs disabled in the kernel config automatically marked as dead code by the compiler, and therefore garbage-collected. With this patch, when compiling a kernel that only targets the JZ4760 for instance, the driver is now about 4.5 KiB smaller. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20220412162218.32509-1-paul@crapouillou.net Signed-off-by: Linus Walleij commit f01143f291b2e560a1641647c96e7da7b4064ddc Author: Johan Jonker Date: Wed Mar 30 15:39:51 2022 +0200 dt-bindings: pinctrl: add rockchip,rk3036-pinctrl compatible string Add the compatible string "rockchip,rk3036-pinctrl" in already in use in rk3036.dtsi to rockchip,pinctrl.yaml. Signed-off-by: Johan Jonker Reviewed-by: Heiko Stuebner Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220330133952.1949-1-jbx6244@gmail.com Signed-off-by: Linus Walleij commit 4764f39e367679e29823467b6c7fc60d8af4f117 Author: Alexander Stein Date: Thu Mar 3 16:06:52 2022 +0100 dt-bindings: pinctrl: Convert i.MX7D to json-schema Convert the i.MX7D pinctrl binding to DT schema format using json-schema Signed-off-by: Alexander Stein Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220303150653.1903910-1-alexander.stein@ew.tq-group.com Signed-off-by: Linus Walleij commit 94d93c9b7444ef90da2ef871cdb6d52ccc19b5ee Author: Krzysztof Kozlowski Date: Thu Apr 7 22:25:09 2022 +0200 pinctrl: max77620: drop unneeded MODULE_ALIAS The MODULE_DEVICE_TABLE already creates proper alias for platform driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407202509.23228-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 34069de314574cfa19781809cc7a8991a892c908 Author: Qianggui Song Date: Wed Mar 30 10:37:19 2022 +0800 pinctrl: meson: fix unused variable warning The kernel test robot reported a warning as below: >> drivers/pinctrl/meson/pinctrl-meson-s4.c:178:27: warning: unused variable 'tdm_sclk1_c_pins' [-Wunused-const-variable] static const unsigned int tdm_sclk1_c_pins[] = { GPIOC_3 }; Fix it by adding missing description about this pins Fixes: 775214d389c2 ("pinctrl: meson: add pinctrl driver support for Meson-S4 Soc") Reported-by: kernel test robot Signed-off-by: Qianggui Song Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220330023720.18238-1-qianggui.song@amlogic.com Signed-off-by: Linus Walleij commit 931d7fa89e640dea146e00b77c1d73459e66ab6e Author: Fabien Parent Date: Sun Mar 27 18:08:13 2022 +0200 pinctrl: mediatek: mt8195: enable driver on mtk platforms Set the pinctrl driver as built-in by default if ARM64 and ARCH_MEDIATEK are enabled. Fixes: 6cf5e9ef362a ("pinctrl: add pinctrl driver on mt8195") Signed-off-by: Fabien Parent Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/20220327160813.2978637-1-fparent@baylibre.com Signed-off-by: Linus Walleij commit 7ff11357810fd124825fdd9aaf0df90262b77844 Author: Caleb Connolly Date: Mon Mar 28 01:50:04 2022 +0100 gpio/rockchip: handle deferring input-enable pinconfs Add support for deferred PIN_CONFIG_INPUT_ENABLE handling. Signed-off-by: Caleb Connolly Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220328005005.72492-4-kc@postmarketos.org Signed-off-by: Linus Walleij commit 42d90a1e5caf73138ddde42da5a9fe2b543f9a2c Author: Caleb Connolly Date: Mon Mar 28 01:50:03 2022 +0100 pinctrl/rockchip: support setting input-enable param Handle the PIN_CONFIG_INPUT_ENABLE param for configuring GPIOs as input. Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20220328005005.72492-3-kc@postmarketos.org Signed-off-by: Linus Walleij commit 8ce5ef64546850294b021497046588a7abcebe96 Author: Caleb Connolly Date: Mon Mar 28 01:50:02 2022 +0100 pinctrl/rockchip: support deferring other gpio params Add support for deferring other params like PIN_CONFIG_INPUT_ENABLE. This will be used to add support for PIN_CONFIG_INPUT_ENABLE to the driver. Fixes: e7165b1dff06 ("pinctrl/rockchip: add a queue for deferred pin output settings on probe") Fixes: 59dd178e1d7c ("gpio/rockchip: fetch deferred output settings on probe") Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20220328005005.72492-2-kc@postmarketos.org Signed-off-by: Linus Walleij commit 09c5ba0aa2fcfdadb17d045c3ee6f86d69270df7 Author: John Ogness Date: Thu Apr 21 23:28:48 2022 +0206 printk: add kthread console printers Create a kthread for each console to perform console printing. During normal operation (@system_state == SYSTEM_RUNNING), the kthread printers are responsible for all printing on their respective consoles. During non-normal operation, console printing is done as it has been: within the context of the printk caller or within irqwork triggered by the printk caller, referred to as direct printing. Since threaded console printers are responsible for all printing during normal operation, this also includes messages generated via deferred printk calls. If direct printing is in effect during a deferred printk call, the queued irqwork will perform the direct printing. To make it clear that this is the only time that the irqwork will perform direct printing, rename the flag PRINTK_PENDING_OUTPUT to PRINTK_PENDING_DIRECT_OUTPUT. Threaded console printers synchronize against each other and against console lockers by taking the console lock for each message that is printed. Note that the kthread printers do not care about direct printing. They will always try to print if new records are available. They can be blocked by direct printing, but will be woken again once direct printing is finished. Console unregistration is a bit tricky because the associated kthread printer cannot be stopped while the console lock is held. A policy is implemented that states: whichever task clears con->thread (under the console lock) is responsible for stopping the kthread. unregister_console() will clear con->thread while the console lock is held and then stop the kthread after releasing the console lock. For consoles that have implemented the exit() callback, the kthread is stopped before exit() is called. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-14-john.ogness@linutronix.de commit 2bb2b7b57f81255c13f4395ea911d6bdc70c9fe2 Author: John Ogness Date: Thu Apr 21 23:28:47 2022 +0206 printk: add functions to prefer direct printing Once kthread printing is available, console printing will no longer occur in the context of the printk caller. However, there are some special contexts where it is desirable for the printk caller to directly print out kernel messages. Using pr_flush() to wait for threaded printers is only possible if the caller is in a sleepable context and the kthreads are active. That is not always the case. Introduce printk_prefer_direct_enter() and printk_prefer_direct_exit() functions to explicitly (and globally) activate/deactivate preferred direct console printing. The term "direct console printing" refers to printing to all enabled consoles from the context of the printk caller. The term "prefer" is used because this type of printing is only best effort. If the console is currently locked or other printers are already actively printing, the printk caller will need to rely on the other contexts to handle the printing. This preferred direct printing is how all printing has been handled until now (unless it was explicitly deferred). When kthread printing is introduced, there may be some unanticipated problems due to kthreads being unable to flush important messages. In order to minimize such risks, preferred direct printing is activated for the primary important messages when the system experiences general types of major errors. These are: - emergency reboot/shutdown - cpu and rcu stalls - hard and soft lockups - hung tasks - warn - sysrq Note that since kthread printing does not yet exist, no behavior changes result from this commit. This is only implementing the counter and marking the various places where preferred direct printing is active. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Acked-by: Paul E. McKenney # for RCU Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-13-john.ogness@linutronix.de commit 3b604ca81202eea2a917eb6491e90f610fba0ec7 Author: John Ogness Date: Thu Apr 21 23:28:46 2022 +0206 printk: add pr_flush() Provide a might-sleep function to allow waiting for console printers to catch up to the latest logged message. Use pr_flush() whenever it is desirable to get buffered messages printed before continuing: suspend_console(), resume_console(), console_stop(), console_start(), console_unblank(). Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-12-john.ogness@linutronix.de commit 03a749e628fdbc665d7f9712637f880a79da8b78 Author: John Ogness Date: Thu Apr 21 23:28:45 2022 +0206 printk: move buffer definitions into console_emit_next_record() caller Extended consoles print extended messages and do not print messages about dropped records. Non-extended consoles print "normal" messages as well as extra messages about dropped records. Currently the buffers for these various message types are defined within the functions that might use them and their usage is based upon the CON_EXTENDED flag. This will be a problem when moving to kthread printers because each printer must be able to provide its own buffers. Move all the message buffer definitions outside of console_emit_next_record(). The caller knows if extended or dropped messages should be printed and can specify the appropriate buffers to use. The console_emit_next_record() and call_console_driver() functions can know what to print based on whether specified buffers are non-NULL. With this change, buffer definition/allocation/specification is separated from the code that does the various types of string printing. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-11-john.ogness@linutronix.de commit a699449bb13b70b8bd10dc03ad7327ea3993221e Author: John Ogness Date: Thu Apr 21 23:28:44 2022 +0206 printk: refactor and rework printing logic Refactor/rework printing logic in order to prepare for moving to threaded console printing. - Move @console_seq into struct console so that the current "position" of each console can be tracked individually. - Move @console_dropped into struct console so that the current drop count of each console can be tracked individually. - Modify printing logic so that each console independently loads, prepares, and prints its next record. - Remove exclusive_console logic. Since console positions are handled independently, replaying past records occurs naturally. - Update the comments explaining why preemption is disabled while printing from printk() context. With these changes, there is a change in behavior: the console replaying the log (formerly exclusive console) will no longer block other consoles. New messages appear on the other consoles while the newly added console is still replaying. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-10-john.ogness@linutronix.de commit 1fc0ca9e0db61882208650b3603071e9f4b5cfee Author: John Ogness Date: Thu Apr 21 23:28:43 2022 +0206 printk: add con_printk() macro for console details It is useful to generate log messages that include details about the related console. Rather than duplicate the code to assemble the details, put that code into a macro con_printk(). Once console printers become threaded, this macro will find more users. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-9-john.ogness@linutronix.de commit 1f47e8af45fdd754c5538f8aeb7857a6c087fd6a Author: John Ogness Date: Thu Apr 21 23:28:42 2022 +0206 printk: call boot_delay_msec() in printk_delay() boot_delay_msec() is always called immediately before printk_delay() so just call it from within printk_delay(). Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-8-john.ogness@linutronix.de commit 9f0844de49cf0557d5c359131004acbb179c174e Author: John Ogness Date: Thu Apr 21 23:28:41 2022 +0206 printk: get caller_id/timestamp after migration disable Currently the local CPU timestamp and caller_id for the record are collected while migration is enabled. Since this information is CPU-specific, it should be collected with migration disabled. Migration is disabled immediately after collecting this information anyway, so just move the information collection to after the migration disabling. Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-7-john.ogness@linutronix.de commit 5341b93dea8c39d7612f7a227015d4b1d5cf30db Author: John Ogness Date: Thu Apr 21 23:28:40 2022 +0206 printk: wake waiters for safe and NMI contexts When printk() is called from safe or NMI contexts, it will directly store the record (vprintk_store()) and then defer the console output. However, defer_console_output() only causes console printing and does not wake any waiters of new records. Wake waiters from defer_console_output() so that they also are aware of the new records from safe and NMI contexts. Fixes: 03fc7f9c99c1 ("printk/nmi: Prevent deadlock when accessing the main log buffer in NMI") Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-6-john.ogness@linutronix.de commit 938ba4084abcf6fdd21d9078513c52f8fb9b00d0 Author: John Ogness Date: Thu Apr 21 23:28:39 2022 +0206 printk: wake up all waiters There can be multiple tasks waiting for new records. They should all be woken. Use wake_up_interruptible_all() instead of wake_up_interruptible(). Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-5-john.ogness@linutronix.de commit 1f5d783094cf28b4905f51cad846eb5d1db6673e Author: John Ogness Date: Thu Apr 21 23:28:38 2022 +0206 printk: add missing memory barrier to wake_up_klogd() It is important that any new records are visible to preparing waiters before the waker checks if the wait queue is empty. Otherwise it is possible that: - there are new records available - the waker sees an empty wait queue and does not wake - the preparing waiter sees no new records and begins to wait This is exactly the problem that the function description of waitqueue_active() warns about. Use wq_has_sleeper() instead of waitqueue_active() because it includes the necessary full memory barrier. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-4-john.ogness@linutronix.de commit f5343321b71ac0a1112adeab0ff90b239bad3a83 Author: John Ogness Date: Thu Apr 21 23:28:37 2022 +0206 printk: cpu sync always disable interrupts The CPU sync functions are a NOP for !CONFIG_SMP. But for !CONFIG_SMP they still need to disable interrupts in order to preserve context within the CPU sync sections. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-3-john.ogness@linutronix.de commit faebd693c59387b7b765fab64b543855e15a91b4 Author: John Ogness Date: Thu Apr 21 23:28:36 2022 +0206 printk: rename cpulock functions Since the printk cpulock is CPU-reentrant and since it is used in all contexts, its usage must be carefully considered and most likely will require programming locklessly. To avoid mistaking the printk cpulock as a typical lock, rename it to cpu_sync. The main functions then become: printk_cpu_sync_get_irqsave(flags); printk_cpu_sync_put_irqrestore(flags); Add extra notes of caution in the function description to help developers understand the requirements for correct usage. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220421212250.565456-2-john.ogness@linutronix.de commit a2443ef0a8046ca98868224ee9bd6861c17e4995 Author: David Yu Date: Fri Apr 22 10:43:41 2022 -0400 drm/amdgpu: Ta fw needs to be loaded for SRIOV aldebaran Load ta fw during psp_init_sriov_microcode to enable XGMI. It is required to be loaded by both guest and host starting from Arcturus. Cap fw needs to be loaded first. Signed-off-by: David Yu Reviewed-by: Shaoyun.liu Signed-off-by: Alex Deucher commit 114f088727314a30b62747bd6f8811dddf535cb6 Author: Evan Quan Date: Fri Apr 8 19:51:34 2022 +0800 drm/amd/pm: fix the deadlock issue observed on SI The adev->pm.mutx is already held at the beginning of amdgpu_dpm_compute_clocks/amdgpu_dpm_enable_uvd/amdgpu_dpm_enable_vce. But on their calling path, amdgpu_display_bandwidth_update will be called and thus its sub functions amdgpu_dpm_get_sclk/mclk. They will then try to acquire the same adev->pm.mutex and deadlock will occur. By placing amdgpu_display_bandwidth_update outside of adev->pm.mutex protection(considering logically they do not need such protection) and restructuring the call flow accordingly, we can eliminate the deadlock issue. This comes with no real logics change. Fixes: 3712e7a49459 ("drm/amd/pm: unified lock protections in amdgpu_dpm.c") Reported-by: Paul Menzel Reported-by: Arthur Marsh Link: https://lore.kernel.org/all/9e689fea-6c69-f4b0-8dee-32c4cf7d8f9c@molgen.mpg.de/ BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1957 Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b3c76814ce5b043faa2f07108f1c87ed1cbc8cd1 Author: Tao Zhou Date: Tue Apr 19 14:45:09 2022 +0800 drm/amdgpu: add RAS fatal error interrupt handler The fatal error handler is independent from general ras interrupt handler since there is no related IH ring. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 66f879496121c18c541125d04a444c62f3ca82ad Author: Tao Zhou Date: Tue Apr 19 11:04:19 2022 +0800 drm/amdgpu: add RAS poison consumption handler (v2) Add support for general RAS poison consumption handler. v2: remove callback function for poison consumption. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 50a7d025cacdb518a413590a5f2028ace77289f5 Author: Tao Zhou Date: Fri Apr 8 19:51:20 2022 +0800 drm/amdgpu: add RAS poison creation handler (v2) Prepare for the implementation of poison consumption handler. v2: separate umc handler from poison creation. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cc9d82fc966bbbd2b73551cdf2d7ac9c6d87e260 Author: Yang Wang Date: Thu Apr 21 20:24:55 2022 +0800 drm/amdkfd: use kvcalloc() instead of kvmalloc() in kfd_migrate simplify programming with existing functions. Signed-off-by: Yang Wang Reviewed-by: Felix Kuehling Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6273a1864d437553ab4220d1abc010c5bb758ad2 Author: Krzysztof Kozlowski Date: Wed Apr 20 11:02:47 2022 +0200 ARM: dts: keystone: Fix missing fallback and case in SPI NOR node compatible Vendor prefix in compatible should be lower-case and the jedec,spi-nor should be used as fallback, according to the bindings. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220420090247.73410-2-krzysztof.kozlowski@linaro.org commit 625f5c507994fd8ff9c70b2477902b0e3e1f355f Author: Krzysztof Kozlowski Date: Wed Apr 20 11:02:46 2022 +0200 ARM: dts: keystone: Align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20220420090247.73410-1-krzysztof.kozlowski@linaro.org commit 4ab93063c83a2478863158799b027e9489ad4a40 Author: David Vernet Date: Fri Apr 22 10:33:53 2022 -0700 cgroup: Add test_cpucg_weight_underprovisioned() testcase test_cpu.c includes testcases that validate the cgroup cpu controller. This patch adds a new testcase called test_cpucg_weight_underprovisioned() that verifies that processes with different cpu.weight that are all running on an underprovisioned system, still get roughly the same amount of cpu time. Because test_cpucg_weight_underprovisioned() is very similar to test_cpucg_weight_overprovisioned(), this patch also pulls the common logic into a separate helper function that is invoked from both testcases, and which uses function pointers to invoke the unique portions of the testcases. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 6376b22cd0a3455a534b6921b816ffab68ddc48f Author: David Vernet Date: Fri Apr 22 10:33:52 2022 -0700 cgroup: Add test_cpucg_weight_overprovisioned() testcase test_cpu.c includes testcases that validate the cgroup cpu controller. This patch adds a new testcase called test_cpucg_weight_overprovisioned() that verifies the expected behavior of creating multiple processes with different cpu.weight, on a system that is overprovisioned. So as to avoid code duplication, this patch also updates cpu_hog_func_param to take a new hog_clock_type enum which informs how time is counted in hog_cpus_timed() (either process time or wall clock time). Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 3c879a1bb88792c05c2dd6a957423838b2830d73 Author: David Vernet Date: Fri Apr 22 10:33:51 2022 -0700 cgroup: Add test_cpucg_stats() testcase to cgroup cpu selftests test_cpu.c includes testcases that validate the cgroup cpu controller. This patch adds a new testcase called test_cpucg_stats() that verifies the expected behavior of the cpu.stat interface. In doing so, we define a new hog_cpus_timed() function which takes a cpu_hog_func_param struct that configures how many CPUs it uses, and how long it runs. Future patches will also spawn threads that hog CPUs, so this function will eventually serve those use-cases as well. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 820a4f88ee4636433a46fcf14054036d0f71e798 Author: David Vernet Date: Fri Apr 22 10:33:49 2022 -0700 cgroup: Add new test_cpu.c test suite in cgroup selftests The cgroup selftests suite currently contains tests that validate various aspects of cgroup, such as validating the expected behavior for memory controllers, the expected behavior of cgroup.procs, etc. There are no tests that validate the expected behavior of the cgroup cpu controller. This patch therefore adds a new test_cpu.c file that will contain cpu controller testcases. The file currently only contains a single testcase that validates creating nested cgroups with cgroup.subtree_control including cpu. Future patches will add more sophisticated testcases that validate functional aspects of the cpu controller. Signed-off-by: David Vernet Signed-off-by: Tejun Heo commit 70578ff3367dd4ad8f212a9b5c05cffadabf39a8 Author: Eric W. Biederman Date: Wed Apr 20 09:58:03 2022 -0500 binfmt_flat: Remove shared library support In a recent discussion[1] it was reported that the binfmt_flat library support was only ever used on m68k and even on m68k has not been used in a very long time. The structure of binfmt_flat is different from all of the other binfmt implementations because of this shared library support and it made life and code review more effort when I refactored the code in fs/exec.c. Since in practice the code is dead remove the binfmt_flat shared library support and make maintenance of the code easier. [1] https://lkml.kernel.org/r/81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org Signed-off-by: "Eric W. Biederman" Reviewed-by: Damien Le Moal Acked-by: Vladimir Murzin # ARM Tested-by: Patrice Chotard Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/87levzzts4.fsf_-_@email.froward.int.ebiederm.org commit a1f4ccd25cc256255813f584f10e5527369d4a02 Author: Mark Brown Date: Tue Apr 19 12:22:35 2022 +0100 arm64/sme: Provide Kconfig for SME Now that basline support for the Scalable Matrix Extension (SME) is present introduce the Kconfig option allowing it to be built. While the feature registers don't impose a strong requirement for a system with SME to support SVE at runtime the support for streaming mode SVE is mostly shared with normal SVE so depend on SVE. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-28-broonie@kernel.org Signed-off-by: Catalin Marinas commit 861262ab862702061ae3355b811a07b15d1b2fc0 Author: Mark Brown Date: Tue Apr 19 12:22:34 2022 +0100 KVM: arm64: Handle SME host state when running guests While we don't currently support SME in guests we do currently support it for the host system so we need to take care of SME's impact, including the floating point register state, when running guests. Simiarly to SVE we need to manage the traps in CPACR_RL1, what is new is the handling of streaming mode and ZA. Normally we defer any handling of the floating point register state until the guest first uses it however if the system is in streaming mode FPSIMD and SVE operations may generate SME traps which we would need to distinguish from actual attempts by the guest to use SME. Rather than do this for the time being if we are in streaming mode when entering the guest we force the floating point state to be saved immediately and exit streaming mode, meaning that the guest won't generate SME traps for supported operations. We could handle ZA in the access trap similarly to the FPSIMD/SVE state without the disruption caused by streaming mode but for simplicity handle it the same way as streaming mode for now. This will be revisited when we support SME for guests (hopefully before SME hardware becomes available), for now it will only incur additional cost on systems with SME and even there only if streaming mode or ZA are enabled. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419112247.711548-27-broonie@kernel.org Signed-off-by: Catalin Marinas commit 51729fb1d0683df5e9e4d5dbe2ec46188f011da9 Author: Mark Brown Date: Tue Apr 19 12:22:33 2022 +0100 KVM: arm64: Trap SME usage in guest SME defines two new traps which need to be enabled for guests to ensure that they can't use SME, one for the main SME operations which mirrors the traps for SVE and another for access to TPIDR2 in SCTLR_EL2. For VHE manage SMEN along with ZEN in activate_traps() and the FP state management callbacks, along with SCTLR_EL2.EnTPIDR2. There is no existing dynamic management of SCTLR_EL2. For nVHE manage TSM in activate_traps() along with the fine grained traps for TPIDR2 and SMPRI. There is no existing dynamic management of fine grained traps. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419112247.711548-26-broonie@kernel.org Signed-off-by: Catalin Marinas commit 90807748ca3ac4874853b2148928529bf1f13e5e Author: Mark Brown Date: Tue Apr 19 12:22:32 2022 +0100 KVM: arm64: Hide SME system registers from guests For the time being we do not support use of SME by KVM guests, support for this will be enabled in future. In order to prevent any side effects or side channels via the new system registers, including the EL0 read/write register TPIDR2, explicitly undefine all the system registers added by SME and mask out the SME bitfield in SYS_ID_AA64PFR1. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419112247.711548-25-broonie@kernel.org Signed-off-by: Catalin Marinas commit e0838f6373e5cb72516fc4c26bba309097e2a80a Author: Mark Brown Date: Tue Apr 19 12:22:31 2022 +0100 arm64/sme: Save and restore streaming mode over EFI runtime calls When saving and restoring the floating point state over an EFI runtime call ensure that we handle streaming mode, only handling FFR if we are not in streaming mode and ensuring that we are in normal mode over the call into runtime services. We currently assume that ZA will not be modified by runtime services, the specification is not yet finalised so this may need updating if that changes. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-24-broonie@kernel.org Signed-off-by: Catalin Marinas commit d45d7ff7047f7f6c3221b0f028fade640812f931 Author: Mark Brown Date: Tue Apr 19 12:22:30 2022 +0100 arm64/sme: Disable streaming mode and ZA when flushing CPU state Both streaming mode and ZA may increase power consumption when they are enabled and streaming mode makes many FPSIMD and SVE instructions undefined which will cause problems for any kernel mode floating point so disable both when we flush the CPU state. This covers both kernel_neon_begin() and idle and after flushing the state a reload is always required anyway. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-23-broonie@kernel.org Signed-off-by: Catalin Marinas commit 776b4a1cf36411e96972455ca72906b722b80ea1 Author: Mark Brown Date: Tue Apr 19 12:22:29 2022 +0100 arm64/sme: Add ptrace support for ZA The ZA array can be read and written with the NT_ARM_ZA. Similarly to our interface for the SVE vector registers the regset consists of a header with information on the current vector length followed by an optional register data payload, represented as for signals as a series of horizontal vectors from 0 to VL/8 in the endianness independent format used for vectors. On get if ZA is enabled then register data will be provided, otherwise it will be omitted. On set if register data is provided then ZA is enabled and initialized using the provided data, otherwise it is disabled. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-22-broonie@kernel.org Signed-off-by: Catalin Marinas commit e12310a0d30f260b26297bc8d7c95769489af038 Author: Mark Brown Date: Tue Apr 19 12:22:28 2022 +0100 arm64/sme: Implement ptrace support for streaming mode SVE registers The streaming mode SVE registers are represented using the same data structures as for SVE but since the vector lengths supported and in use may not be the same as SVE we represent them with a new type NT_ARM_SSVE. Unfortunately we only have a single 16 bit reserved field available in the header so there is no space to fit the current and maximum vector length for both standard and streaming SVE mode without redefining the structure in a way the creates a complicatd and fragile ABI. Since FFR is not present in streaming mode it is read and written as zero. Setting NT_ARM_SSVE registers will put the task into streaming mode, similarly setting NT_ARM_SVE registers will exit it. Reads that do not correspond to the current mode of the task will return the header with no register data. For compatibility reasons on write setting no flag for the register type will be interpreted as setting SVE registers, though users can provide no register data as an alternative mechanism for doing so. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-21-broonie@kernel.org Signed-off-by: Catalin Marinas commit 39782210eb7e87634d96cacb6ece370bc59d74ba Author: Mark Brown Date: Tue Apr 19 12:22:27 2022 +0100 arm64/sme: Implement ZA signal handling Implement support for ZA in signal handling in a very similar way to how we implement support for SVE registers, using a signal context structure with optional register state after it. Where present this register state stores the ZA matrix as a series of horizontal vectors numbered from 0 to VL/8 in the endinanness independent format used for vectors. As with SVE we do not allow changes in the vector length during signal return but we do allow ZA to be enabled or disabled. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-20-broonie@kernel.org Signed-off-by: Catalin Marinas commit 85ed24dad2904f7c141911d91b7807ab02694b5e Author: Mark Brown Date: Tue Apr 19 12:22:26 2022 +0100 arm64/sme: Implement streaming SVE signal handling When in streaming mode we have the same set of SVE registers as we do in regular SVE mode with the exception of FFR and the use of the SME vector length. Provide signal handling for these registers by taking one of the reserved words in the SVE signal context as a flags field and defining a flag which is set for streaming mode. When the flag is set the vector length is set to the streaming mode vector length and we save and restore streaming mode data. We support entering or leaving streaming mode based on the value of the flag but do not support changing the vector length, this is not currently supported SVE signal handling. We could instead allocate a separate record in the signal frame for the streaming mode SVE context but this inflates the size of the maximal signal frame required and adds complication when validating signal frames from userspace, especially given the current structure of the code. Any implementation of support for streaming mode vectors in signals will have some potential for causing issues for applications that attempt to handle SVE vectors in signals, use streaming mode but do not understand streaming mode in their signal handling code, it is hard to identify a case that is clearly better than any other - they all have cases where they could cause unexpected register corruption or faults. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-19-broonie@kernel.org Signed-off-by: Catalin Marinas commit 40a8e87bb32855b39839d35b5b5b125494b3a604 Author: Mark Brown Date: Tue Apr 19 12:22:25 2022 +0100 arm64/sme: Disable ZA and streaming mode when handling signals The ABI requires that streaming mode and ZA are disabled when invoking signal handlers, do this in setup_return() when we prepare the task state for the signal handler. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-18-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8bd7f91c03d886f41d35f6108078d20be5a4a1bd Author: Mark Brown Date: Tue Apr 19 12:22:24 2022 +0100 arm64/sme: Implement traps and syscall handling for SME By default all SME operations in userspace will trap. When this happens we allocate storage space for the SME register state, set up the SVE registers and disable traps. We do not need to initialize ZA since the architecture guarantees that it will be zeroed when enabled and when we trap ZA is disabled. On syscall we exit streaming mode if we were previously in it and ensure that all but the lower 128 bits of the registers are zeroed while preserving the state of ZA. This follows the aarch64 PCS for SME, ZA state is preserved over a function call and streaming mode is exited. Since the traps for SME do not distinguish between streaming mode SVE and ZA usage if ZA is in use rather than reenabling traps we instead zero the parts of the SVE registers not shared with FPSIMD and leave SME enabled, this simplifies handling SME traps. If ZA is not in use then we reenable SME traps and fall through to normal handling of SVE. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-17-broonie@kernel.org Signed-off-by: Catalin Marinas commit 0033cd9339642f9b7bef23f96aa2e7277ab51cce Author: Mark Brown Date: Tue Apr 19 12:22:23 2022 +0100 arm64/sme: Implement ZA context switching Allocate space for storing ZA on first access to SME and use that to save and restore ZA state when context switching. We do this by using the vector form of the LDR and STR ZA instructions, these do not require streaming mode and have implementation recommendations that they avoid contention issues in shared SMCU implementations. Since ZA is architecturally guaranteed to be zeroed when enabled we do not need to explicitly zero ZA, either we will be restoring from a saved copy or trapping on first use of SME so we know that ZA must be disabled. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-16-broonie@kernel.org Signed-off-by: Catalin Marinas commit af7167d6d2675f3343eff3ad6c9b4a8e30122e2c Author: Mark Brown Date: Tue Apr 19 12:22:22 2022 +0100 arm64/sme: Implement streaming SVE context switching When in streaming mode we need to save and restore the streaming mode SVE register state rather than the regular SVE register state. This uses the streaming mode vector length and omits FFR but is otherwise identical, if TIF_SVE is enabled when we are in streaming mode then streaming mode takes precedence. This does not handle use of streaming SVE state with KVM, ptrace or signals. This will be updated in further patches. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-15-broonie@kernel.org Signed-off-by: Catalin Marinas commit b40c559b45bec736f588c57dd5be967fe573058b Author: Mark Brown Date: Tue Apr 19 12:22:21 2022 +0100 arm64/sme: Implement SVCR context switching In SME the use of both streaming SVE mode and ZA are tracked through PSTATE.SM and PSTATE.ZA, visible through the system register SVCR. In order to context switch the floating point state for SME we need to context switch the contents of this register as part of context switching the floating point state. Since changing the vector length exits streaming SVE mode and disables ZA we also make sure we update SVCR appropriately when setting vector length, and similarly ensure that new threads have streaming SVE mode and ZA disabled. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-14-broonie@kernel.org Signed-off-by: Catalin Marinas commit a9d69158595017d260ab37bf88b8f125e5e8144c Author: Mark Brown Date: Tue Apr 19 12:22:20 2022 +0100 arm64/sme: Implement support for TPIDR2 The Scalable Matrix Extension introduces support for a new thread specific data register TPIDR2 intended for use by libc. The kernel must save the value of TPIDR2 on context switch and should ensure that all new threads start off with a default value of 0. Add a field to the thread_struct to store TPIDR2 and context switch it with the other thread specific data. In case there are future extensions which also use TPIDR2 we introduce system_supports_tpidr2() and use that rather than system_supports_sme() for TPIDR2 handling. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-13-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9e4ab6c89109472082616f8d2f6ada7deaffe161 Author: Mark Brown Date: Tue Apr 19 12:22:19 2022 +0100 arm64/sme: Implement vector length configuration prctl()s As for SVE provide a prctl() interface which allows processes to configure their SME vector length. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-12-broonie@kernel.org Signed-off-by: Catalin Marinas commit 12f1bacfc5d9e55bedbfc7a25bf42ff6d19d1dab Author: Mark Brown Date: Tue Apr 19 12:22:18 2022 +0100 arm64/sme: Implement sysctl to set the default vector length As for SVE provide a sysctl which allows the default SME vector length to be configured. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-11-broonie@kernel.org Signed-off-by: Catalin Marinas commit b42990d3bf77cc29d7c33e21518c1f806dae6b21 Author: Mark Brown Date: Tue Apr 19 12:22:17 2022 +0100 arm64/sme: Identify supported SME vector lengths at boot The vector lengths used for SME are controlled through a similar set of registers to those for SVE and enumerated using a similar algorithm with some slight differences due to the fact that unlike SVE there are no restrictions on which combinations of vector lengths can be supported nor any mandatory vector lengths which must be implemented. Add a new vector type and implement support for enumerating it. One slightly awkward feature is that we need to read the current vector length using a different instruction (or enter streaming mode which would have the same issue and be higher cost). Rather than add an ops structure we add special cases directly in the otherwise generic vec_probe_vqs() function, this is a bit inelegant but it's the only place where this is an issue. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-10-broonie@kernel.org Signed-off-by: Catalin Marinas commit 5e64b862c4823ab53aac028042abd918c2f27041 Author: Mark Brown Date: Tue Apr 19 12:22:16 2022 +0100 arm64/sme: Basic enumeration support This patch introduces basic cpufeature support for discovering the presence of the Scalable Matrix Extension. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-9-broonie@kernel.org Signed-off-by: Catalin Marinas commit b2cf6a23289b3268cc7915a09c0c8372147b2727 Author: Mark Brown Date: Tue Apr 19 12:22:15 2022 +0100 arm64/sme: Early CPU setup for SME SME requires similar setup to that for SVE: disable traps to EL2 and make sure that the maximum vector length is available to EL1, for SME we have two traps - one for SME itself and one for TPIDR2. In addition since we currently make no active use of priority control for SCMUs we map all SME priorities lower ELs may configure to 0, the architecture specified minimum priority, to ensure that nothing we manage is able to configure itself to consume excessive resources. This will need to be revisited should there be a need to manage SME priorities at runtime. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-8-broonie@kernel.org Signed-off-by: Catalin Marinas commit ca8a4ebcff4465f0272637433c789a5e4a272626 Author: Mark Brown Date: Tue Apr 19 12:22:14 2022 +0100 arm64/sme: Manually encode SME instructions As with SVE rather than impose ambitious toolchain requirements for SME we manually encode the few instructions which we require in order to perform the work the kernel needs to do. The instructions used to save and restore context are provided as assembler macros while those for entering and leaving streaming mode are done in asm volatile blocks since they are expected to be used from C. We could do the SMSTART and SMSTOP operations with read/modify/write cycles on SVCR but using the aliases provided for individual field accesses should be slightly faster. These instructions are aliases for MSR but since our minimum toolchain requirements are old enough to mean that we can't use the sX_X_cX_cX_X form and they always use xzr rather than taking a value like write_sysreg_s() wants we just use .inst. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit b4adc83b07706042ad6e6a767f6c04636db69bcc Author: Mark Brown Date: Tue Apr 19 12:22:13 2022 +0100 arm64/sme: System register and exception syndrome definitions The arm64 Scalable Matrix Extension (SME) adds some new system registers, fields in existing system registers and exception syndromes. This patch adds definitions for these for use in future patches implementing support for this extension. Since SME will be the first user of FEAT_HCX in the kernel also include the definitions for enumerating it and the HCRX system register it adds. Signed-off-by: Mark Brown Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419112247.711548-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit 96d32e630935c1636b0236c88779e81eff120e0a Author: Mark Brown Date: Tue Apr 19 12:22:12 2022 +0100 arm64/sme: Provide ABI documentation for SME Provide ABI documentation for SME similar to that for SVE. Due to the very large overlap around streaming SVE mode in both implementation and interfaces documentation for streaming mode SVE is added to the SVE document rather than the SME one. Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Reviewed-by: Szabolcs Nagy Link: https://lore.kernel.org/r/20220419112247.711548-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit 2c8e64514aa2ea414c8ada6c77405680267d0ab3 Author: Zhengjun Xing Date: Fri Apr 22 14:56:34 2022 +0800 perf stat: Merge event counts from all hybrid PMUs For hybrid events, by default stat aggregates and reports the event counts per pmu. # ./perf stat -e cycles -a sleep 1 Performance counter stats for 'system wide': 14,066,877,268 cpu_core/cycles/ 6,814,443,147 cpu_atom/cycles/ 1.002760625 seconds time elapsed Sometimes, it's also useful to aggregate event counts from all PMUs. Create a new option '--hybrid-merge' to enable that behavior and report the counts without PMUs. # ./perf stat -e cycles -a --hybrid-merge sleep 1 Performance counter stats for 'system wide': 20,732,982,512 cycles 1.002776793 seconds time elapsed Reviewed-by: Kan Liang Signed-off-by: Xing Zhengjun Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220422065635.767648-2-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 60344f1a9a597f2e0efcd57df5dad0b42da15e21 Author: Zhengjun Xing Date: Fri Apr 22 14:56:33 2022 +0800 perf stat: Support metrics with hybrid events One metric such as 'Kernel_Utilization' may be from different PMUs and consists of different events. For core, Kernel_Utilization = cpu_clk_unhalted.thread:k / cpu_clk_unhalted.thread For atom, Kernel_Utilization = cpu_clk_unhalted.core:k / cpu_clk_unhalted.core The metric group string for core is: '{cpu_clk_unhalted.thread/metric-id=cpu_clk_unhalted.thread:k/k,cpu_clk_unhalted.thread/metric-id=cpu_clk_unhalted.thread/}:W' It's internally expanded to: '{cpu_clk_unhalted.thread_p/metric-id=cpu_clk_unhalted.thread_p:k/k,cpu_clk_unhalted.thread/metric-id=cpu_clk_unhalted.thread/}:W#cpu_core' The metric group string for atom is: '{cpu_clk_unhalted.core/metric-id=cpu_clk_unhalted.core:k/k,cpu_clk_unhalted.core/metric-id=cpu_clk_unhalted.core/}:W' It's internally expanded to: '{cpu_clk_unhalted.core/metric-id=cpu_clk_unhalted.core:k/k,cpu_clk_unhalted.core/metric-id=cpu_clk_unhalted.core/}:W#cpu_atom' That means the group "{cpu_clk_unhalted.thread:k,cpu_clk_unhalted.thread}:W" is from cpu_core PMU and the group "{cpu_clk_unhalted.core:k,cpu_clk_unhalted.core}" is from cpu_atom PMU. And then next, check if the events in the group are valid on that PMU. If one event is not valid on that PMU, the associated group would be removed internally. In this example, cpu_clk_unhalted.thread is valid on cpu_core and cpu_clk_unhalted.core is valid on cpu_atom. So the checks for these two groups are passed. Before: # ./perf stat -M Kernel_Utilization -a sleep 1 WARNING: events in group from different hybrid PMUs! WARNING: grouped events cpus do not match, disabling group: anon group { CPU_CLK_UNHALTED.THREAD_P:k, CPU_CLK_UNHALTED.THREAD_P:k, CPU_CLK_UNHALTED.THREAD, CPU_CLK_UNHALTED.THREAD } Performance counter stats for 'system wide': 17,639,501 cpu_atom/CPU_CLK_UNHALTED.CORE/ # 1.00 Kernel_Utilization 17,578,757 cpu_atom/CPU_CLK_UNHALTED.CORE:k/ 1,005,350,226 ns duration_time 43,012,352 cpu_core/CPU_CLK_UNHALTED.THREAD_P:k/ # 0.99 Kernel_Utilization 17,608,010 cpu_atom/CPU_CLK_UNHALTED.THREAD_P:k/ 43,608,755 cpu_core/CPU_CLK_UNHALTED.THREAD/ 17,630,838 cpu_atom/CPU_CLK_UNHALTED.THREAD/ 1,005,350,226 ns duration_time 1.005350226 seconds time elapsed After: # ./perf stat -M Kernel_Utilization -a sleep 1 Performance counter stats for 'system wide': 17,981,895 CPU_CLK_UNHALTED.CORE [cpu_atom] # 1.00 Kernel_Utilization 17,925,405 CPU_CLK_UNHALTED.CORE:k [cpu_atom] 1,004,811,366 ns duration_time 41,246,425 CPU_CLK_UNHALTED.THREAD_P:k [cpu_core] # 0.99 Kernel_Utilization 41,819,129 CPU_CLK_UNHALTED.THREAD [cpu_core] 1,004,811,366 ns duration_time 1.004811366 seconds time elapsed Reviewed-by: Kan Liang Signed-off-by: Xing Zhengjun Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220422065635.767648-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 17408e5904d489718fd486abcc4467304920e8e0 Author: Zhengjun Xing Date: Fri Apr 22 14:53:35 2022 +0800 perf vendor events intel: Add metrics for Alderlake Add JSON metrics for Alderlake to perf. It included both P-core and E-core metrics. P-core metrics based on TMA 4.3-full (TMA_Metrics-full.csv) E-core metrics based on E-core TMA 2.0 (E-core_TMA_Metrics.xlsx) They are all downloaded from: https://download.01.org/perfmon/ Signed-off-by: Zhengjun Xing Reviewed-by: Kan Liang Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220422065336.767582-1-zhengjun.xing@linux.intel.com Cc: irogers@google.com Cc: peterz@infradead.org Cc: adrian.hunter@intel.com Cc: alexander.shishkin@intel.com Cc: acme@kernel.org Cc: ak@linux.intel.com Cc: jolsa@redhat.com Cc: mingo@redhat.com Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit 1584f0a1b146dacfb2658fd8b5eb08ae1b65c701 Author: Tom Rix Date: Thu Apr 21 09:30:28 2022 -0400 drm/nouveau/gsp: change gv100_gsp from global to static Smatch reports this issue gv100.c:46:1: warning: symbol 'gv100_gsp' was not declared. Should it be static? gv100_gsp is only used in gv100.c so change its storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220421133028.724954-1-trix@redhat.com commit 3a7ab605978d9dd48ad2c7db8df7ad388884f887 Author: Jiri Olsa Date: Fri Apr 22 12:00:23 2022 +0200 perf tools: Move libbpf init in libbpf_init function Move the libbpf init code into a single function, so that we have a single place doing that. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Ian Rogers Cc: Ingo Molnar Cc: John Fastabend Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220422100025.1469207-4-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2bf8ee0faa988b5cec3503ebf2f970a0e84d24ee Author: Xinlei Lee Date: Mon Apr 18 20:20:56 2022 +0800 dt-bindings: pwm: Add interrupts property for MediaTek MT8192 Add interrupts property of pwm for MediaTek MT8192 SoC. Signed-off-by: Xinlei Lee Signed-off-by: Thierry Reding commit 6ddb156ba4749a64293b5c4079406de178e2e5cd Author: Xinlei Lee Date: Mon Apr 18 20:20:55 2022 +0800 dt-bindings: pwm: Add compatible for MediaTek MT8186 Add dt-binding documentation of pwm for MediaTek MT8186 SoC. Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 7eafddce08617b4fdbd9485fa88bb749c8c7125a Author: Xinlei Lee Date: Mon Apr 18 20:20:54 2022 +0800 dt-bindings: pwm: Add compatible for MediaTek MT8195 Add dt-binding documentation of pwm for MediaTek MT8195 SoC. Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit b8ba2b42b0e9cf6d2788e423f8fe2ba4fcc2539d Author: Xinlei Lee Date: Mon Apr 18 20:20:53 2022 +0800 dt-bindings: pwm: Add compatible for MediaTek MT8192 Add dt-binding documentation of pwm for MediaTek MT8192 SoC. Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit b09b179bac0aa3d58d79729260a7492df8a1e312 Author: Xinlei Lee Date: Mon Apr 18 20:20:52 2022 +0800 dt-bindings: pwm: Convert pwm-mtk-disp.txt to mediatek,pwm-disp.yaml format Convert pwm-mtk-disp.txt to mediatek,pwm-disp.yaml format as suggested by maintainer. Signed-off-by: Xinlei Lee Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 4225cd01d30f66b6f35e8f54ba6929db11a9a7af Author: Uwe Kleine-König Date: Fri Apr 8 17:45:20 2022 +0200 pwm: clps71xx: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This fixes a small issue in clps711x_get_duty() en passant: the multiplication v * 0xf might have overflown. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 09f688f0718f57f9cf68ee1aa94490f641e759ba Author: Uwe Kleine-König Date: Fri Apr 8 17:38:46 2022 +0200 pwm: raspberrypi-poe: Fix endianness in firmware struct The reg member of struct raspberrypi_pwm_prop is a little endian 32 bit quantity. Explicitly convert the (native endian) value to little endian on assignment as is already done in raspberrypi_pwm_set_property(). This fixes the following sparse warning: drivers/pwm/pwm-raspberrypi-poe.c:69:24: warning: incorrect type in initializer (different base types) drivers/pwm/pwm-raspberrypi-poe.c:69:24: expected restricted __le32 [usertype] reg drivers/pwm/pwm-raspberrypi-poe.c:69:24: got unsigned int [usertype] reg Fixes: 79caa362eab6 ("pwm: Add Raspberry Pi Firmware based PWM bus") Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit d7b4408374b69dbc246c59c29e3077920b9f03eb Author: Uwe Kleine-König Date: Fri Apr 8 17:29:10 2022 +0200 pwm: atmel-tcb: Make atmel_tcb_divisors static The array atmel_tcb_divisors is not supposed to be used outside of the driver, so make it static. This fixes a sparse warning: drivers/pwm/pwm-atmel-tcb.c:64:10: warning: symbol 'atmel_tcb_divisors' was not declared. Should it be static? Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Signed-off-by: Thierry Reding commit eaaad16a9b3f16b411c33404e17d4dc61cf69b16 Author: Baruch Siach Date: Mon Apr 11 09:23:40 2022 +0300 gpio: mvebu: Drop PWM base assignment pwmchip_add() unconditionally assigns the base ID dynamically. Commit f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically") dropped all base assignment from drivers under drivers/pwm/. It missed this driver. Fix that. Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically") Signed-off-by: Baruch Siach Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1d24cc89203081919e339b734728149642786f51 Author: Uwe Kleine-König Date: Fri Apr 8 17:22:39 2022 +0200 pwm: lp3943: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 5e3b07ca5cc78cd4a987e78446849e41288d87cb Author: Uwe Kleine-König Date: Fri Apr 8 17:22:38 2022 +0200 pwm: lp3943: Fix duty calculation in case period was clamped The hardware only supports periods <= 1.6 ms and if a bigger period is requested it is clamped to 1.6 ms. In this case duty_cycle might be bigger than 1.6 ms and then the duty cycle register is written with a value bigger than LP3943_MAX_DUTY. So clamp duty_cycle accordingly. Fixes: af66b3c0934e ("pwm: Add LP3943 PWM driver") Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b3c4af8507a052c231084d7e2c1cc5fa5a8c245a Author: Hammer Hsieh Date: Tue Mar 22 18:43:01 2022 +0800 pwm: sunplus-pwm: Add Sunplus SoC SP7021 PWM Driver Add Sunplus SoC SP7021 PWM Driver Signed-off-by: Hammer Hsieh Signed-off-by: Thierry Reding commit 15452ce3c9467bdd15002f5bc56cd2c13e7b1aa0 Author: Hammer Hsieh Date: Tue Mar 22 18:43:00 2022 +0800 dt-bindings: pwm: Add bindings doc for Sunplus SoC SP7021 PWM Driver Add bindings doc for Sunplus SoC SP7021 PWM Driver Reviewed-by: Krzysztof Kozlowski Signed-off-by: Hammer Hsieh Acked-by: Rob Herring Signed-off-by: Thierry Reding commit f30673a9df34931cbfb9b51da00dd185a3cd4566 Author: Sergiu Moga Date: Mon Mar 7 17:36:56 2022 +0200 dt-bindings: pwm: at91: Add SAMA7G5 compatible strings list Add compatible strings list for SAMA7G5. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 1a406a38bc1d66f68bac30cf8d83fcff621ff79c Author: Sergiu Moga Date: Mon Mar 7 17:36:55 2022 +0200 dt-bindings: pwm: Convert atmel pwm to json-schema Convert PWM binding for Atmel/Microchip SoCs to Device Tree Schema format. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit bc1ce713a0843ba14a1e00d5275ad42a8873a5ce Author: Sean Anderson Date: Thu Mar 3 17:35:43 2022 -0500 pwm: Add support for Xilinx AXI Timer This adds PWM support for Xilinx LogiCORE IP AXI soft timers commonly found on Xilinx FPGAs. At the moment clock control is very basic: we just enable the clock during probe and pin the frequency. In the future, someone could add support for disabling the clock when not in use. Some common code has been specially demarcated. While currently only used by the PWM driver, it is anticipated that it may be split off in the future to be used by the timer driver as well. This driver was written with reference to Xilinx DS764 for v1.03.a [1]. [1] https://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v1_03_a/axi_timer_ds764.pdf Signed-off-by: Sean Anderson Acked-by: Michal Simek Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit f643490e1bf941600f6105e4d27c49054fb6d562 Author: Sean Anderson Date: Thu Mar 3 17:35:42 2022 -0500 dt-bindings: pwm: Add Xilinx AXI Timer This adds a binding for the Xilinx LogiCORE IP AXI Timer. This device is a "soft" block, so it has some parameters which would not be configurable in most hardware. This binding is usually automatically generated by Xilinx's tools, so the names and values of some properties should be kept as they are, if possible. In addition, this binding is already in the kernel at arch/microblaze/boot/dts/system.dts, and in user software such as QEMU. The existing driver uses the clock-frequency property, or alternatively the /cpus/timebase-frequency property as its frequency input. Because these properties are deprecated, they have not been included with this schema. All new bindings should use the clocks/clock-names properties to specify the parent clock. Because we need to init timer devices so early in boot, we determine if we should use the PWM driver or the clocksource/clockevent driver by the presence/absence, respectively, of #pwm-cells. Because both counters are used by the PWM, there is no need for a separate property specifying which counters are to be used for the PWM. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 10fa1b2cdc899ab471000968af56215bf3c90d8e Author: Rafael J. Wysocki Date: Fri Apr 22 17:13:48 2022 +0200 ACPI: bus: Avoid non-ACPI device objects in walks over children When walking the children of an ACPI device, take extra care to avoid using to_acpi_device() on the ones that are not ACPI devices, because that may lead to out-of-bounds access and memory corruption. While at it, make the function passed to acpi_dev_for_each_child() take a struct acpi_device pointer argument (instead of a struct device one), so it is more straightforward to use. Fixes: b7dd6298db81 ("ACPI: PM: Introduce acpi_dev_power_up_children_with_adr()") Reported-by: kernel test robot BugLink: https://lore.kernel.org/lkml/20220420064725.GB16310@xsang-OptiPlex-9020/ Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg commit f346e96267cd76175d6c201b40f770c0116a8a04 Author: Schspa Shi Date: Thu Apr 21 03:15:41 2022 +0800 cpufreq: Fix possible race in cpufreq online error path When cpufreq online fails, the policy->cpus mask is not cleared and policy->rwsem is released too early, so the driver can be invoked via the cpuinfo_cur_freq sysfs attribute while its ->offline() or ->exit() callbacks are being run. Take policy->clk as an example: static int cpufreq_online(unsigned int cpu) { ... // policy->cpus != 0 at this time down_write(&policy->rwsem); ret = cpufreq_add_dev_interface(policy); up_write(&policy->rwsem); return 0; out_destroy_policy: for_each_cpu(j, policy->real_cpus) remove_cpu_dev_symlink(policy, get_cpu_device(j)); up_write(&policy->rwsem); ... out_exit_policy: if (cpufreq_driver->exit) cpufreq_driver->exit(policy); clk_put(policy->clk); // policy->clk is a wild pointer ... ^ | Another process access __cpufreq_get cpufreq_verify_current_freq cpufreq_generic_get // acces wild pointer of policy->clk; | | out_offline_policy: | cpufreq_policy_free(policy); | // deleted here, and will wait for no body reference cpufreq_policy_put_kobj(policy); } Address this by modifying cpufreq_online() to release policy->rwsem in the error path after the driver callbacks have run and to clear policy->cpus before releasing the semaphore. Fixes: 7106e02baed4 ("cpufreq: release policy->rwsem on error") Signed-off-by: Schspa Shi [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit fdaa6efce9aa83fa3c6033cb890548c584e1fded Author: Uwe Kleine-König Date: Wed Mar 2 19:00:00 2022 +0100 pwm: atmel-tcb: Drop duplicated tracking of per-channel data Per-channel data is tracked using struct pwm_device::chip_data and struct atmel_tcb_pwm_chip::pwms[]. Simplify by using the latter consistently. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit f5461124d59bfb62bd9e231ee64cbaf757343ad5 Author: Randy Dunlap Date: Mon Apr 18 19:54:16 2022 -0700 Documentation: move watch_queue to core-api Move watch_queue documentation to the core-api index and subdirectory. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Signed-off-by: Randy Dunlap Cc: David Howells Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet commit 5a5866c28b43e26dc7594b735b2a44e538ec63a4 Author: Bruno Moreira-Guedes Date: Tue Apr 19 11:48:52 2022 -0300 Docs: Replace version by 'current' in changes.rst The file 'Documentation/process/changes.rst' states the listed requirements are for the 4.x kernel version. However, there are requirements updated for the 5.x version, as there might be in other future versions. This patch updates it to 'latest' so the document won't be outdated in the future. Signed-off-by: Bruno Moreira-Guedes Signed-off-by: Jonathan Corbet commit 69ef0920bdd3ce234cf6916342d9c16251d9ccb6 Author: Bruno Moreira-Guedes Date: Tue Apr 19 11:48:15 2022 -0300 Docs: Add cpio requirement to changes.rst The install target requires cpio to run the `kernel/gen_kheaders.sh` script, but it's missing in the requirements list at 'Documentation/process/changes.rst'. This patch adds it to the list. Signed-off-by: Bruno Moreira-Guedes Signed-off-by: Jonathan Corbet commit 77930ee4d5b35e4a88a33e83fe8bf91a7a7016f9 Author: Andreas-Christian Hagau Date: Sun Apr 17 10:37:51 2022 +0200 Documentation: kunit: change complete_and_exit to kthread_complete_and_exit Commit cead18552660 ("exit: Rename complete_and_exit to kthread_complete_and_exit") renamed complete_and_exit to kthread_complete_and_exit. Signed-off-by: Andreas-Christian Hagau Reviewed-by: Brendan Higgins Signed-off-by: Jonathan Corbet commit 8246b478a23aafdef0e1deb2ac2f21eeee97e877 Author: Max Kellermann Date: Tue Jan 25 13:34:29 2022 +0100 pwm-sun4i: Calculate the delay without rounding down to jiffies This fixes a problem that was supposed to be addressed by commit 6eefb79d6f5bc ("pwm: sun4i: Remove erroneous else branch") - backlight could not be switched off on some Allwinner A20. The commit was correct, but was not a reliable fix for the problem, which was timing related. The real problem for the backlight switching problem was that sleeping for a full period did not work, because delay_us is always zero. It is zero because the period (plus 1 microsecond) is rounded down to the next "jiffies", but the period is less than one jiffy. On my Cubieboard 2, the period is 5ms, and 1 jiffy (at the default HZ=100) is 10ms, so nsecs_to_jiffies(10ms+1us)=0. The roundtrip from nanoseconds to jiffies and back to microseconds is an unnecessary loss of precision; always rounding down (via nsecs_to_jiffies()) then causes the breakage. This patch eliminates this roundtrip, and directly converts from nanoseconds to microseconds (for usleep_range()), using DIV_ROUND_UP_ULL() to force rounding up. This way, the sleep time is never zero, and after the sleep, we are guaranteed to be in a different period, and the device is ready for another control command for sure. Signed-off-by: Max Kellermann Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit ba3e5037ceeb920e98970e2342edd7ab390217c0 Author: Max Kellermann Date: Tue Jan 25 13:34:28 2022 +0100 pwm-sun4i: Calculate "delay_jiffies" directly, eliminate absolute time Basically this code did "jiffies + period - jiffies", and we can simply eliminate the "jiffies" time stamp here. Signed-off-by: Max Kellermann Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c7078972038a04549cfb1ab1f3f6554db9c31446 Author: Max Kellermann Date: Tue Jan 25 13:34:27 2022 +0100 pwm-sun4i: Convert "next_period" to local variable Its value is calculated in sun4i_pwm_apply() and is used only there. Signed-off-by: Max Kellermann Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a8a570c6d0fd9e96d52697133f33962bf08b445b Author: Carlos Llamas Date: Fri Mar 25 23:24:54 2022 +0000 binder: hold fd_install until allocating fds first Al noted in [1] that fd_install can't be undone, so it must come last in the fd translation sequence, only after we've successfully reserved all descriptors and copied them into the transaction buffer. This patch takes Al's proposed fix in [2] and makes a few tweaks to fold the traversal of t->fd_fixups during release. [1] https://lore.kernel.org/driverdev-devel/YHnJwRvUhaK3IM0l@zeniv-ca.linux.org.uk [2] https://lore.kernel.org/driverdev-devel/YHo6Ln9VI1T7RmLK@zeniv-ca.linux.org.uk Cc: Christian Brauner Suggested-by: Al Viro Acked-by: Todd Kjos Signed-off-by: Carlos Llamas Link: https://lore.kernel.org/r/20220325232454.2210817-1-cmllamas@google.com Signed-off-by: Greg Kroah-Hartman commit e5052bec7e3e460e47d77bbaf13e483b68c710be Author: Ronak Jain Date: Wed Apr 6 03:55:26 2022 -0700 firmware: xilinx: enable feature check for ZynqMP Enable the feature check if the PM_FEATURE_CHECK API returns success with the supported version for the ZynqMP. Currently, it is enabled for Versal only. Move get_set_conduit_method() at the beginning as the Linux is requesting to TF-A for the PM_FEATURE_CHECK API version for which the interface should be enabled with TF-A. Signed-off-by: Ronak Jain Link: https://lore.kernel.org/r/1649242526-17493-5-git-send-email-ronak.jain@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 218f01a80aea0ec5eeacda243ea5e06cbc9be654 Author: Ronak Jain Date: Wed Apr 6 03:55:25 2022 -0700 firmware: xilinx: always check API version for IOCTL/QUERY Currently, we are not checking feature check version for PM APIs as the support may or may not there in the firmware. To check the whether the feature check API is supported or not in the firmware, allow checking for its own version. Signed-off-by: Ronak Jain Link: https://lore.kernel.org/r/1649242526-17493-4-git-send-email-ronak.jain@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 94ae7f22265e795b4351c7a51a34c4b11dec9952 Author: Ronak Jain Date: Wed Apr 6 03:55:24 2022 -0700 firmware: xilinx: add new function for do_feature_check_call Add new function for sending feature check request to firmware and call it from zynqmp_pm_feature(). Signed-off-by: Ronak Jain Link: https://lore.kernel.org/r/1649242526-17493-3-git-send-email-ronak.jain@xilinx.com Signed-off-by: Greg Kroah-Hartman commit f918cfc08c1755b9e54cd6effc923fa809045cf4 Author: Ronak Jain Date: Wed Apr 6 03:55:23 2022 -0700 firmware: xilinx: add support for IOCTL and QUERY ID feature check Add support to check if IOCTL ID or QUERY ID is supported in firmware or not. Signed-off-by: Ronak Jain Link: https://lore.kernel.org/r/1649242526-17493-2-git-send-email-ronak.jain@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 4e224719f5d9b92abf1e0edfb2a83053208f3026 Author: Christophe JAILLET Date: Fri Apr 22 10:13:48 2022 +0200 drivers/base/memory: Fix an unlikely reference counting issue in __add_memory_block() __add_memory_block() calls both put_device() and device_unregister() when storing the memory block into the xarray. This is incorrect because xarray doesn't take an additional reference and device_unregister() already calls put_device(). Triggering the issue looks really unlikely and its only effect should be to log a spurious warning about a ref counted issue. Fixes: 4fb6eabf1037 ("drivers/base/memory.c: cache memory blocks in xarray to accelerate lookup") Signed-off-by: Christophe JAILLET Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/d44c63d78affe844f020dc02ad6af29abc448fc4.1650611702.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 3677563eb8731e1ad5970e3e57f74e5f9d63502a Author: Thiébaud Weksteen Date: Fri Apr 22 11:32:15 2022 +1000 firmware_loader: use kernel credentials when reading firmware Device drivers may decide to not load firmware when probed to avoid slowing down the boot process should the firmware filesystem not be available yet. In this case, the firmware loading request may be done when a device file associated with the driver is first accessed. The credentials of the userspace process accessing the device file may be used to validate access to the firmware files requested by the driver. Ensure that the kernel assumes the responsibility of reading the firmware. This was observed on Android for a graphic driver loading their firmware when the device file (e.g. /dev/mali0) was first opened by userspace (i.e. surfaceflinger). The security context of surfaceflinger was used to validate the access to the firmware file (e.g. /vendor/firmware/mali.bin). Because previous configurations were relying on the userspace fallback mechanism, the security context of the userspace daemon (i.e. ueventd) was consistently used to read firmware files. More devices are found to use the command line argument firmware_class.path which gives the kernel the opportunity to read the firmware directly, hence surfacing this misattribution. Signed-off-by: Thiébaud Weksteen Reviewed-by: Luis Chamberlain Tested-by: John Stultz Link: https://lore.kernel.org/r/20220422013215.2301793-1-tweek@google.com Signed-off-by: Greg Kroah-Hartman commit 736da0b657f615db7e29606eb8818871534a8943 Author: Russ Weight Date: Thu Apr 21 14:21:58 2022 -0700 firmware_loader: Check fw_state_is_done in loading_store Rename fw_sysfs_done() and fw_sysfs_loading() to fw_state_is_done() and fw_state_is_loading() respectively, and place them along side companion functions in drivers/base/firmware_loader/firmware.h. Use the fw_state_is_done() function to exit early from firmware_loading_store() if the state is already "done". This is being done in preparation for supporting persistent sysfs nodes to allow userspace to upload firmware to a device, potentially reusing the sysfs loading and data files multiple times. Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-3-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit 4ac4a90d7728b161f0ce0527feb19d60af961dfb Author: Russ Weight Date: Thu Apr 21 14:21:57 2022 -0700 firmware_loader: Clear data and size in fw_free_paged_buf The fw_free_paged_buf() function resets the paged buffer information in the fw_priv data structure. Additionally, clear the data and size members of fw_priv in order to facilitate the reuse of fw_priv. This is being done in preparation for enabling userspace to initiate multiple firmware uploads using this sysfs interface. Reviewed-by: Luis Chamberlain Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight Link: https://lore.kernel.org/r/20220421212204.36052-2-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman commit 42cd402b8fd4672b692400fe5f9eecd55d2794ac Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:35 2022 +0200 rpmsg: Fix kfree() of static memory on setting driver_override The driver_override field from platform driver should not be initialized from static memory (string literal) because the core later kfree() it, for example when driver_override is set via sysfs. Use dedicated helper to set driver_override properly. Fixes: 950a7388f02b ("rpmsg: Turn name service into a stand alone driver") Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") Reviewed-by: Bjorn Andersson Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-13-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit e5f89131a06142e91073b6959d91cea73861d40e Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:34 2022 +0200 rpmsg: Constify local variable in field store macro Memory pointed by variable 'old' in field store macro is not modified, so it can be made a pointer to const. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-12-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0f4b20ef41696a625e43587563d538bb4dd60d9c Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:33 2022 +0200 slimbus: qcom-ngd: Fix kfree() of static memory on setting driver_override The driver_override field from platform driver should not be initialized from static memory (string literal) because the core later kfree() it, for example when driver_override is set via sysfs. Use dedicated helper to set driver_override properly. Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Reviewed-by: Srinivas Kandagatla Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-11-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit fb4ac6f18be1a6ac0dfdb25adfcf26462c6e2ac0 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:32 2022 +0200 clk: imx: scu: Fix kfree() of static memory on setting driver_override The driver_override field from platform driver should not be initialized from static memory (string literal) because the core later kfree() it, for example when driver_override is set via sysfs. Use dedicated helper to set driver_override properly. Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support") Acked-by: Stephen Boyd Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-10-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 240bf4e665741241983580812a2be1b033f120ee Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:31 2022 +0200 vdpa: Use helper for safer setting of driver_override Use a helper to set driver_override to the reduce amount of duplicated code. Acked-by: Michael S. Tsirkin Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-9-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 19368f0f23e80929691dd5b1354832c0e0494419 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:30 2022 +0200 spi: Use helper for safer setting of driver_override Use a helper to set driver_override to the reduce amount of duplicated code. Reviewed-by: Mark Brown Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-8-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1e8ee51212b4876f1a8ca4b78d2499e2fc442cf3 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:29 2022 +0200 s390/cio: Use driver_set_override() instead of open-coding Use a helper to set driver_override to the reduce amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems. Acked-by: Vineeth Vijayan Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-7-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 23d99baf9d729ca30b2fb6798a7b403a37bfb800 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:28 2022 +0200 PCI: Use driver_set_override() instead of open-coding Use a helper to set driver_override to the reduce amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems. Reviewed-by: Andy Shevchenko Acked-by: Bjorn Helgaas Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-6-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 01ed100276bdac259f1b418b998904a7486b0b68 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:27 2022 +0200 hv: Use driver_set_override() instead of open-coding Use a helper to set driver_override to the reduce amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems. Reviewed-by: Michael Kelley Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-5-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5688f212e98a2469583a067fa5da4312ddc4e357 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:26 2022 +0200 fsl-mc: Use driver_set_override() instead of open-coding Use a helper to set driver_override to reduce the amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-4-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 6e67955087e72f1a5f64dd8014c27e1d9317fbb4 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:25 2022 +0200 amba: Use driver_set_override() instead of open-coding Use a helper to set driver_override to reduce the amount of duplicated code. Make the driver_override field const char, because it is not modified by the core and it matches other subsystems. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-3-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 6c2f421174273de8f83cde4286d1c076d43a2d35 Author: Krzysztof Kozlowski Date: Tue Apr 19 13:34:24 2022 +0200 driver: platform: Add helper for safer setting of driver_override Several core drivers and buses expect that driver_override is a dynamically allocated memory thus later they can kfree() it. However such assumption is not documented, there were in the past and there are already users setting it to a string literal. This leads to kfree() of static memory during device release (e.g. in error paths or during unbind): kernel BUG at ../mm/slub.c:3960! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM ... (kfree) from [] (platform_device_release+0x88/0xb4) (platform_device_release) from [] (device_release+0x2c/0x90) (device_release) from [] (kobject_put+0xec/0x20c) (kobject_put) from [] (exynos5_clk_probe+0x154/0x18c) (exynos5_clk_probe) from [] (platform_drv_probe+0x6c/0xa4) (platform_drv_probe) from [] (really_probe+0x280/0x414) (really_probe) from [] (driver_probe_device+0x78/0x1c4) (driver_probe_device) from [] (bus_for_each_drv+0x74/0xb8) (bus_for_each_drv) from [] (__device_attach+0xd4/0x16c) (__device_attach) from [] (bus_probe_device+0x88/0x90) (bus_probe_device) from [] (device_add+0x3dc/0x62c) (device_add) from [] (of_platform_device_create_pdata+0x94/0xbc) (of_platform_device_create_pdata) from [] (of_platform_bus_create+0x1a8/0x4fc) (of_platform_bus_create) from [] (of_platform_bus_create+0x20c/0x4fc) (of_platform_bus_create) from [] (of_platform_populate+0x84/0x118) (of_platform_populate) from [] (of_platform_default_populate_init+0xa0/0xb8) (of_platform_default_populate_init) from [] (do_one_initcall+0x8c/0x404) Provide a helper which clearly documents the usage of driver_override. This will allow later to reuse the helper and reduce the amount of duplicated code. Convert the platform driver to use a new helper and make the driver_override field const char (it is not modified by the core). Reviewed-by: Rafael J. Wysocki Acked-by: Rafael J. Wysocki Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419113435.246203-2-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1efba7ef1d7da5944493728c5375fef5b2130de4 Author: Adrien Thierry Date: Wed Apr 20 13:44:00 2022 -0400 staging: bcm2835-audio: delete TODO Delete TODO since all tasks were completed: 1 - fixed here: https://lore.kernel.org/all/20220408150359.26661-1-athierry@redhat.com/ 2 - there are no remaining checkpatch.pl errors or warnings Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220420174401.305964-1-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit d66aea197d534e23d4989eb72fca9c0c114b97c9 Author: Chuanhong Guo Date: Sat Apr 9 17:13:47 2022 +0800 arm: mediatek: select arch timer for mt7629 This chip has an armv7 arch timer according to the dts. Select it in Kconfig to enforce the support for it. Otherwise the system time is just completely wrong if user forget to enable ARM_ARCH_TIMER in kernel config. Fixes: a43379dddf1b ("arm: mediatek: add MT7629 smp bring up code") Signed-off-by: Chuanhong Guo Link: https://lore.kernel.org/r/20220409091347.2473449-1-gch981213@gmail.com Signed-off-by: Matthias Brugger commit b7da6f517214c307efece604ac9dc58dc6123c07 Author: Nícolas F. R. A. Prado Date: Fri Feb 25 17:58:52 2022 -0500 dt-bindings: remoteproc: mediatek: Add interrupts property to mtk,scp The SCP node can have an associated interrupt. Add a property for it. Signed-off-by: Nícolas F. R. A. Prado Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225225854.81038-2-nfraprado@collabora.com commit 290a20782ac6d1bfbd70541cacddaf9acbe1f1f5 Author: Sumeet Pawnikar Date: Thu Apr 21 22:25:43 2022 +0530 ACPI: DPTF: Correct description of INT3407 / INT3532 attributes Remove duplicate comments of PBSS for Battery steady state power and correct the typo for PMAX Maximum platform power. Signed-off-by: Sumeet Pawnikar Signed-off-by: Rafael J. Wysocki commit db2d1693fae37e01e7fcfd627b407c18737e8373 Author: Tom Rix Date: Thu Apr 21 12:42:54 2022 -0400 ACPI: BGRT: use static for BGRT_SHOW kobj_attribute defines Smatch reports this repesentative issue: bgrt.c:26:1: warning: symbol 'bgrt_attr_version' was not declared. Should it be static? Similar for *status,type,xoffset,yoffset These variables are defined with the BGRT_SHOW macro. For the definition of bgrt_attr_##_name, the storage-class specifier should be static. Signed-off-by: Tom Rix Signed-off-by: Rafael J. Wysocki commit ab59c89396c007c360b1a4d762732d1621ff5456 Author: Tony Luck Date: Tue Apr 19 14:19:21 2022 -0700 ACPI, APEI, EINJ: Refuse to inject into the zero page Some validation tests dynamically inject errors into memory used by applications to check that the system can recover from a variety of poison consumption sceenarios. But sometimes the virtual address picked by these tests is mapped to the zero page. This causes additional unexpected machine checks as other processes that map the zero page also consume the poison. Disallow injection to the zero page. Signed-off-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit e5bf06b16f6ed553f3a88b27acaea0ff21a5f494 Author: Fabien Parent Date: Fri Apr 15 17:00:03 2022 +0200 arm64: defconfig: enable some mt6360 PMIC drivers Enable the charger and regulator driver for the MT6360 PMIC. These drivers are essential for some MediaTek MT8195 based boards to boot properly. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20220415150003.1793063-5-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 940368923239d337fb0d6744fa21380d4efe5769 Author: Fabien Parent Date: Fri Apr 15 17:00:02 2022 +0200 arm64: defconfig: enable MT6359 regulator driver The PMIC regulators are essentials to be able to boot MediaTek MT8195 based boards to userspace. Like the other MediaTek PMIC regulator driver, let's enable as well the one for the MT6359 PMIC. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20220415150003.1793063-4-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 89c734e1980259e439f3c57f1e63729dc0038740 Author: Haowen Bai Date: Fri Apr 22 10:10:35 2022 +0800 staging: rtl8192u: Fix signedness bug in ieee80211_check_auth_response() The ieee80211_check_auth_response() function has a signedness bug because it's a declared as a u16 but it return -ENOMEM. When you look at it more closely it returns a mix of error codes including 0xcafe, -ENOMEM, and a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG. This is a mess. Clean it up to just return standard kernel error codes. We can print out the a->status before returning a regular error code. The printks in the caller need to be adjusted as well. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650593435-9017-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 8112446bbaa89ed7e2d012e435de0e69569b3e61 Author: Wan Jiabing Date: Fri Apr 22 10:10:38 2022 +0800 staging: r8188eu: Remove unneeded variable ret in rtw_suspend() Fix the following coccicheck error: drivers/staging/r8188eu/os_dep/usb_intf.c:202:5-8: Unneeded variable: "ret". Return "0" on line 242 Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220422021046.121870-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman commit 7079b3483a17be2cfba64cbd4feb1b7ae07f1ea7 Author: Christophe JAILLET Date: Fri Apr 22 08:48:18 2022 +0200 staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() If device_register() fails, device_unregister() should not be called because it will free some resources that are not allocated. put_device() should be used instead. Fixes: 308ee87a2f1e ("staging: fieldbus: anybus-s: support HMS Anybus-S bus") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/5401a519608d6e1a4e7435c20f4f20b0c5c36c23.1650610082.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 15210fd36ed362a04bbbfb3af6138a36ef7f90a3 Author: ran jianping Date: Fri Apr 22 09:33:40 2022 +0000 staging: vchiq:remove unneeded flush_workqueue All work currently pending will be done first by calling destroy_workqueue, so there is no need to flush it explicitly. Reported-by: Zeal Robot Signed-off-by: ran jianping Link: https://lore.kernel.org/r/20220422093340.2781311-1-ran.jianping@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit a2b5fd298130ad38d61c3fff1a6aa7dd0c1d02ea Author: Martin Kaiser Date: Fri Apr 22 16:09:58 2022 +0200 staging: r8188eu: fix the index check in mgt_dispatcher In mgt_dispatcher, we check that index is a valid index for the mlme_sta_tbl array. The valid indices for this array are from 0 to ARRAY_SIZE(mlme_sta_tbl) - 1. An invalid index is >= ARRAY_SIZE(mlme_sta_tbl). Fix the off by one error in the check. Fixes: db84803cd8de ("staging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl") Reported-by: Dan Carpenter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220422140958.239767-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e36c9c00188458d4843d68cae947e64d99259b0e Author: Bruno Moreira-Guedes Date: Thu Apr 21 11:59:34 2022 -0300 staging: vme: Move 'vme/devices/' to 'vme_user/' In ("Staging: VME: move VME drivers out of staging") the vme code, board and bridge drivers were moved out of the staging tree, remaining only the VME user device driver. Since this driver is the only one remaining in staging, such multi-level structure confuses more than helps. The current structure is as follows: - drivers/staging/vme/ Makefile devices/ Kconfig Makefile vme_user.c vme_user.h The top-level Makefile has the only function of calling another Makefile into the devices/ subdirectory. This latter only compiles the vme_user driver, since there is no other in the staging tree. This patch removes the unnecessary Makefile from the 'vme/' dir, move the contents of 'vme/devices' into the 'vme/' dir, and renames it to 'vme_user/' (the driver name), allowing a straightforward understanding of this driver's contents. Furthermore, it updates the MAINTAINERS file to properly reflect the new paths. Signed-off-by: Bruno Moreira-Guedes Link: https://lore.kernel.org/r/2cd7de9a426c443a5ea618682d605ecfd751d798.1650544175.git.codeagain@codeagain.dev Signed-off-by: Greg Kroah-Hartman commit 3da709f3efe5557bf4af8dd4f1a02b1c854ad119 Author: Bruno Moreira-Guedes Date: Thu Apr 21 11:59:02 2022 -0300 staging: vme: Add VME_BUS dependency to Kconfig The KConfig file for VME_USER ('drivers/staging/vme/devices/Kconfig') sourced at "drivers/vme/boards/KConfig" misses a `depends on` line for VME_BUS, which is unnoticeable for menuconfig users who aren't be able to select it through this interface without setting the CONFIG_VME_BUS option because it's nested on VME_BUS menu entry. A patch to move appropriately this driver to the "Staging" submenu ([PATCH 1/3], originally sent as a single patch submitted at https://lore.kernel.org/linux-staging/3fbc5325e94b9ae0666a1f5a56a4e5372bfcea1d.camel@codeagain.dev/T/#t), however, unveiled this missing `depends on` line, since it moved the `source` line for VME_USER's KConfig to somewhere else, allowing it to be compiled without the support for VME_BUS. While it compiles fine and seems to initialize the driver fine (tested both as module and as built- in), it seems to make no sense having VME_USER without VME_BUS. This patches addresses it by adding the VME_BUS to the `depends on` line at "drivers/staging/vme/devices/Kconfig". Signed-off-by: Bruno Moreira-Guedes Link: https://lore.kernel.org/r/00de5644d7c2f8c8878eccf86b761e0602732089.1650544175.git.codeagain@codeagain.dev Signed-off-by: Greg Kroah-Hartman commit adebf457179f18c278415bfafb54cf49a6498a4a Author: Bruno Moreira-Guedes Date: Thu Apr 21 11:58:24 2022 -0300 staging: vme: Move vme_user to staging KConfig Currently, the VME_USER driver is in the staging tree Kconfig, unlike other VME drivers already moved to the main portions of the kernel tree. Its configuration is, however, nested into the VME_BUS config option, which might be misleading. Since the staging tree "[...] is used to hold stand-alone drivers and filesystem that are not ready to be merged into the main portion of the Linux kernel tree [...]"(from https://lore.kernel.org/all/20090320172502.GA14647@kroah.com/T/), staging drivers should appear nested into the Main Menu -> Device Drivers -> Staging Drivers to make sure the user don't pick it without being fully aware of its staging status as it could be the case in Menu -> Device Drivers -> VME bridge support (the current location). With this change menuconfig users will clearly know this is not a driver in the main portion of the kernel tree and decide whether to build it or not with that clearly in mind. This change goes into the same direction of commit <4b4cdf3979c32fa3d042d150f49449c74d048553> ("STAGING: Move staging drivers back to staging-specific menu") Signed-off-by: Bruno Moreira-Guedes Link: https://lore.kernel.org/r/f6e6d1d2b02385f11848022f154007ef191181c1.1650544175.git.codeagain@codeagain.dev Signed-off-by: Greg Kroah-Hartman commit f9f4545b968ba607dc54ca96c03312894679528c Author: Zhiyong.Tao Date: Mon Apr 11 10:27:23 2022 +0800 dt-bindings: pwrap: mediatek: Update pwrap document for mt8195 Update pwrap document description for mt8195 Signed-off-by: Zhiyong Tao Signed-off-by: Tinghan Shen Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220411022724.11005-2-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 0afaa121813ed602bd203759c339cb639493f8c2 Author: Solomon Tan Date: Fri Apr 22 07:52:38 2022 +0800 staging: r8188eu: use in-kernel ieee channel Use the in-kernel structure and flags instead of defining a separate one. The rtw_ieee80211_channel structure and flags can be replaced by the ieee80211_channel defined in include/net/cfg80211.h since the flags serve the same purpose and the ieee80211_channel struct includes the elements used in the rtw_ieee80211_channel struct. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220421235237.4218-1-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c40dba84c79144198bacd0740c5269e7018d1ab Author: Jaehee Park Date: Thu Apr 21 15:20:31 2022 -0400 staging: r8188eu: correct typo in comments Correct misspellings in the comments. Issue found with checkpatch. Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/56b25e4394396823d52f1fe1b312c5a307aea0fc.1650568579.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit b56f8ea2b031119d95882c88130bad08c5ab335f Author: Jaehee Park Date: Thu Apr 21 15:20:30 2022 -0400 staging: r8188eu: replace spaces with tabs Use tabs instead of spaces. Issue found with checkpatch. WARNING: suspect code indent for conditional statements Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/fd4a66013be081bc5adb491c6dc7774362d1ac82.1650568579.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit 093c6d3ba771c5ad0e1128174e585485fd4cc4b2 Author: Jaehee Park Date: Thu Apr 21 15:20:28 2022 -0400 staging: r8188eu: remove 'added by' author comments Author comments "Added by Albert" and "Added by Annie" are sprinkled through the file. These comments are not useful and can be removed. Suggested-by: Alison Schofield Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/dd22bbe6b018aadec620d1ef8215e19852099f7c.1650568579.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit fe0abc0ff73301f709526e8a2cb117b7d7a003fc Author: Jaehee Park Date: Thu Apr 21 15:20:27 2022 -0400 staging: r8188eu: remove spaces before tabs Delete spaces before tabs in the comments. Issue found with checkpatch. WARNING: please, no space before tabs Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/1b1e8cda03ca5d3fdf26c511da76258f7a2ab8d5.1650568579.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit fe5d2632dfc723467cd2ba28fef6575f46594d6b Author: Jaehee Park Date: Thu Apr 21 15:20:26 2022 -0400 staging: r8188eu: remove unnecessary braces in single statement block Remove braces for single statement block to minimize the number of empty lines, without loss of readability. Issue found with checkpatch. WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/b96ae957e2ddc519e56813a1c56e770168f67a2d.1650568579.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit ff88784d69fc3ff180b6a12c73a44334ff6c1173 Author: Martin Kaiser Date: Thu Apr 21 22:08:04 2022 +0200 staging: r8188eu: remove OnAction_dls Remove the empty function OnAction_dls and its entry in OnAction_tbl. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220421200805.192083-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 69192df6757e522f96ead29d583bbcef0529bdd6 Author: Martin Kaiser Date: Thu Apr 21 22:08:03 2022 +0200 staging: r8188eu: remove OnAction_qos Remove the empty function OnAction_qos and its entry in OnAction_tbl. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220421200805.192083-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5aad5eee3e1f3b572ddbb49457093c8a651862d7 Author: Martin Kaiser Date: Thu Apr 21 22:08:02 2022 +0200 staging: r8188eu: on_action_spct does nothing One of the entries in OnAction_tbl refers to on_action_spct. This function reads some information but it performs no action. Remove on_action_spct and its entry in OnAction_tbl. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220421200805.192083-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 869ddbfccdea7366e583b7ee70070a43f891c29b Author: Martin Kaiser Date: Thu Apr 21 22:08:01 2022 +0200 staging: r8188eu: remove dummy entries from OnAction_tbl Unlike mlme_sta_tbl, OnAction_tbl is an array of structs. OnAction iterates over the array to find the entry for a specific action category. No action is performed if a category has no entry. We can remove the entries that point to the dummy function DoReserved. These were the last users of DoReserved, the function itself can be removed as well. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220421200805.192083-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6d933902c609679f7551b2b113e7d62ad81da9b1 Author: Martin Kaiser Date: Thu Apr 21 22:04:49 2022 +0200 staging: r8188eu: remove OnAtim Remove the empty OnAtim function. We can set the function pointer in mlme_sta_tbl to NULL if no action is required for this management frame subtype. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220421200449.191983-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 97042d0a75a1220bc2bb8f3cc99f3f72b1f81607 Author: Haowen Bai Date: Thu Apr 21 16:21:17 2022 +0800 staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp() The rtllib_rx_assoc_resp() function has a signedness bug because it's a declared as a u16 but it return -ENOMEM. When you look at it more closely it returns a mix of error codes including 0xcafe, -ENOMEM, and a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG. This is a mess. Clean it up to just return standard kernel error codes. We can print out the a->status before returning a regular error code. The printks in the caller need to be adjusted as well. Reviewed-by: Dan Carpenter Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650529277-7893-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 2c61fd036ac51e7ca11ab2fb6252605e8fc9bd23 Author: Haowen Bai Date: Thu Apr 21 17:20:43 2022 +0800 staging: r8188eu: Drop redundant memset The region set by the call to memset is immediately overwritten by the subsequent call to memcpy. So we drop redundant memset. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650532843-28132-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit cb65037baa62f90cfc0b14babdff0b71ceedbbbd Author: Artur Bujdoso Date: Thu Apr 21 08:52:19 2022 +0200 staging: rtl8723bs: remove leftover code for other chips Clean up unreferenced definitions in hal headers and code. Signed-off-by: Artur Bujdoso Link: https://lore.kernel.org/r/YmD/I19v8sJLrOQo@crux Signed-off-by: Greg Kroah-Hartman commit 17c8129e06241b635c7945d109eec498301628d3 Author: Rebecca Mckeever Date: Wed Apr 20 07:23:28 2022 -0500 staging: rtl8192u: change get_key functions to return 0 instead of -1 Currently, these three get_key functions return -1 when the provided len value is less a specific key length value, which can result in buffer overflow depending on how the returned value is used. These functions are used in three places in ieee80211/ieee80211_wx.c: ieee80211_wx_get_encode() : The behavior of this function will be unchanged. ieee80211_wx_get_encode_ext() : The result of the get_key function is written to ext->key_len, resulting in a buffer overflow if the result is negative. ieee80211_wx_set_encode() : The behavior of this function will change. When len is less than the key length value, it will set a default key of all 0. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/Yl/7QPKXer7YtXOs@bertie Signed-off-by: Greg Kroah-Hartman commit ae0dc7ed1a7c713ee9ba563a328d3b4d59223d7c Author: Zhang Rui Date: Thu Apr 21 23:07:36 2022 +0800 powercap: intel_rapl: add support for RaptorLake Add intel_rapl support for the RaptorLake platform. Signed-off-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 8043b16f522c9e21e2361a67514386bee3731c6e Author: Valentin Caron Date: Tue Apr 19 10:53:30 2022 +0200 serial: stm32: add earlycon support Add early console support in stm32 uart driver. Signed-off-by: Alexandre Torgue Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220419085330.1178925-4-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 1f507b3aecb3245177ca9012dfe08117bb7925e8 Author: Valentin Caron Date: Tue Apr 19 10:53:29 2022 +0200 serial: stm32: add KGDB support Add support for KGDB in stm32 serial driver by implementing characters polling callbacks (poll_init, poll_get_char and poll_put_char). Signed-off-by: Erwan Le Ray Signed-off-by: Jean Philippe Romain Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220419085330.1178925-3-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 28fb1a92a00706d4e008ab24fbd8e4642df46ca5 Author: Valentin Caron Date: Tue Apr 19 10:53:28 2022 +0200 serial: stm32: remove infinite loop possibility in putchar function Rework stm32_usart_console_putchar() function in order to anticipate the case where the character can never be sent. Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220419085330.1178925-2-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit bd5552bc4807a87a6597c629204712c7df7284f4 Author: Madhavan T. Venkataraman Date: Wed Apr 13 15:59:10 2022 +0100 arm64: stacktrace: align with common naming For historical reasons, the naming of parameters and their types in the arm64 stacktrace code differs from that used in generic code and other architectures, even though the types are equivalent. For consistency and clarity, use the generic names. There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit e9d75a0ba87851187fe52493f1527229a7e101b3 Author: Madhavan T. Venkataraman Date: Wed Apr 13 15:59:09 2022 +0100 arm64: stacktrace: rename stackframe to unwind_state Rename "struct stackframe" to "struct unwind_state" for consistency and better naming. Accordingly, rename variable/argument "frame" to "state". There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit c797bd45480b41d1d988b0a74d8d5a7c615bd674 Author: Madhavan T. Venkataraman Date: Wed Apr 13 15:59:08 2022 +0100 arm64: stacktrace: rename unwinder functions Rename unwinder functions for consistency and better naming. - Rename start_backtrace() to unwind_init(). - Rename unwind_frame() to unwind_next(). - Rename walk_stackframe() to unwind(). There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 96bb1530c4f9039996bf95d28dcc957861558696 Author: Mark Rutland Date: Wed Apr 13 15:59:07 2022 +0100 arm64: stacktrace: make struct stackframe private to stacktrace.c Now that arm64 uses arch_stack_walk() consistently, struct stackframe is only used within stacktrace.c. To make it easier to read and maintain this code, it would be nicer if the definition were there too. Move the definition into stacktrace.c. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Madhavan T. Venkataraman Cc: Mark Brown Cc: Will Deacon Reviewed-by: Madhavan T. Venkataraman Reviwed-by: Mark Brown Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit cb86a41b35c8f5da93ee7370c11634b57509d22b Author: Mark Rutland Date: Wed Apr 13 15:59:06 2022 +0100 arm64: stacktrace: delete PCS comment The comment at the top of stacktrace.c isn't all that helpful, as it's not associated with the code which inspects the frame record, and the code example isn't representative of common code generation today. Delete it. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Madhavan T. Venkataraman Cc: Mark Brown Cc: Will Deacon Reviewed-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 4f6277e8ac397e5932d9af5c6b3dadefe81d53dc Author: Madhavan T. Venkataraman Date: Wed Apr 13 15:59:05 2022 +0100 arm64: stacktrace: remove NULL task check from unwind_frame() Currently, there is a check for a NULL task in unwind_frame(). It is not needed since all current callers pass a non-NULL task. There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Reviewed-by: Mark Brown Signed-off-by: Mark Rutland Reviewed-by: Kalesh Singh for the series. Link: https://lore.kernel.org/r/20220413145910.3060139-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ec66b8cf03e5a63de6332c989b0ceebe4ba2937e Author: Ilpo Järvinen Date: Mon Apr 11 12:48:55 2022 +0300 tty: Add function for handling flow control chars Move receive path flow control character handling to own function. No functional changes. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220411094859.10894-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b0e0bd9d0d891c1811f52e836ef54fff486db866 Author: Tomasz Moń Date: Mon Feb 28 06:49:11 2022 +0100 serial: core: fix tcdrain() with CTS enabled Do not set timeout to twice the approximate amount of time to send the entire FIFO if CTS is enabled. If the caller requested no timeout, e.g. when userspace program called tcdrain(), then wait without any timeout. Premature return from tcdrain() was observed on imx based system which has 32 character long transmitter FIFO with hardware CTS handling. Simple userspace application that reproduces problem has to: * Open tty device, enable hardware flow control (CRTSCTS) * Write data, e.g. 26 bytes * Call tcdrain() to wait for the transmitter * Close tty device The other side of serial connection has to: * Receive some data, e.g. 10 bytes * Set RTS output (CTS input from sender perspective) inactive for at least twice the port timeout * Try to receive remaining data Without this patch, userspace application will finish without any error while the other side of connection will never receive remaining data. Signed-off-by: Tomasz Moń Link: https://lore.kernel.org/r/20220228054911.1420221-1-tomasz.mon@camlingroup.com Signed-off-by: Greg Kroah-Hartman commit 7ea4aa70bfcec3225e2a38d8934c0b1f582c48c1 Author: Vincent Whitchurch Date: Tue Feb 15 15:17:49 2022 +0100 char: ttyprintk: register console Register a console in the ttyprintk driver so that it can be selected for /dev/console with console=ttyprintk on the kernel command line, similar to other console drivers. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220215141750.92808-1-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman commit 8f3631f0f6eb42e57f0ed120d105483c3ef61e49 Author: Wander Lairson Costa Date: Mon Apr 11 14:48:39 2022 -0300 serial/8250: Use fifo in 8250 console driver Note: I am using a small test app + driver located at [0] for the problem description. serco is a driver whose write function dispatches to the serial controller. sertest is a user-mode app that writes n bytes to the serial console using the serco driver. While investigating a bug in the RHEL kernel, I noticed that the serial console throughput is way below the configured speed of 115200 bps in a HP Proliant DL380 Gen9. I was expecting something above 10KB/s, but I got 2.5KB/s. $ time ./sertest -n 2500 /tmp/serco real 0m0.997s user 0m0.000s sys 0m0.997s With the help of the function tracer, I then noticed the serial controller was taking around 410us seconds to dispatch one single byte: $ trace-cmd record -p function_graph -g serial8250_console_write \ ./sertest -n 1 /tmp/serco $ trace-cmd report | serial8250_console_write() { 0.384 us | _raw_spin_lock_irqsave(); 1.836 us | io_serial_in(); 1.667 us | io_serial_out(); | uart_console_write() { | serial8250_console_putchar() { | wait_for_xmitr() { 1.870 us | io_serial_in(); 2.238 us | } 1.737 us | io_serial_out(); 4.318 us | } 4.675 us | } | wait_for_xmitr() { 1.635 us | io_serial_in(); | __const_udelay() { 1.125 us | delay_tsc(); 1.429 us | } ... ... ... 1.683 us | io_serial_in(); | __const_udelay() { 1.248 us | delay_tsc(); 1.486 us | } 1.671 us | io_serial_in(); 411.342 us | } In another machine, I measured a throughput of 11.5KB/s, with the serial controller taking between 80-90us to send each byte. That matches the expected throughput for a configuration of 115200 bps. This patch changes the serial8250_console_write to use the 16550 fifo if available. In my benchmarks I got around 25% improvement in the slow machine, and no performance penalty in the fast machine. Signed-off-by: Wander Lairson Costa Link: https://lore.kernel.org/r/20220411174841.34936-2-wander@redhat.com Signed-off-by: Greg Kroah-Hartman commit 62b2caef400c1738b6d22f636c628d9f85cd4c4c Author: Duoming Zhou Date: Sun Apr 17 19:16:26 2022 +0800 drivers: tty: serial: Fix deadlock in sa1100_set_termios() There is a deadlock in sa1100_set_termios(), which is shown below: (Thread 1) | (Thread 2) | sa1100_enable_ms() sa1100_set_termios() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | sa1100_timeout() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold sport->port.lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need sport->port.lock in position (2) of thread 2. As a result, sa1100_set_termios() will block forever. This patch moves del_timer_sync() before spin_lock_irqsave() in order to prevent the deadlock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220417111626.7802-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 8ec8719fc27b29c096340866cb3e618b8a4c81e4 Author: Junwen Wu Date: Mon Apr 18 15:37:03 2022 +0000 tty/sysrq: change the definition of sysrq_key_table's element to make it more readable The definition of sysrq_key_table's elements, like sysrq_thaw_op and sysrq_showallcpus_op are not consistent with sysrq_ftrace_dump_op, Consistency makes code more readable. Reviewed-by: Jiri Slaby Signed-off-by: Junwen Wu Link: https://lore.kernel.org/r/20220418153703.97705-1-wudaemon@163.com Signed-off-by: Greg Kroah-Hartman commit c1b4148135c171f2950bf2dc40d4724f227825ac Author: Sherry Sun Date: Mon Apr 18 10:18:44 2022 +0800 tty: serial: fsl_lpuart: remove the count initialization as it is not needed No need to initialize the count variable in lpuart_copy_rx_to_tty(), so let's remove it here. Reviewed-by: Jiri Slaby Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220418021844.29591-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit e8c5e1a0f78fbfc4396866959fef43b258318b6f Author: Grant Seltzer Date: Thu Apr 21 23:10:50 2022 -0400 libbpf: Improve libbpf API documentation link position This puts the link for libbpf API documentation into the sidebar for much easier navigation. You can preview this change at: https://libbpf-test.readthedocs.io/en/latest/ Note that the link is hardcoded to the production version, so you can see that it self references itself here for now: https://libbpf-test.readthedocs.io/en/latest/api.html This will need to make its way into the libbpf mirror, before being deployed to libbpf.readthedocs.org Signed-off-by: Grant Seltzer Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220422031050.303984-1-grantseltzer@gmail.com commit e3e7b13bffae85e2806c73e3ccacd4447bcb19ed Author: Jiri Slaby Date: Thu Apr 21 12:17:08 2022 +0200 serial: allow COMPILE_TEST for some drivers Some more serial drivers can be compile-tested under certain circumstances (when building a specific architecture). So allow for that. This reduces the need of zillion mach/subarch-specific configs. And since the 0day bot has only allmodconfig's for some archs, this increases build coverage there too. Note that cpm needs a minor update in the header, so that it drags in at least some defines (CPM2 ones). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 86b9602f8203b7b3b5a189fba759b58c9d6f378e Author: Jiri Slaby Date: Thu Apr 21 12:17:07 2022 +0200 serial: pic32: make SERIAL_PIC32_CONSOLE depend on SERIAL_PIC32=y pic32_uart contains this: #ifdef CONFIG_SERIAL_PIC32_CONSOLE ... console_initcall(pic32_console_init); ... core_initcall(pic32_late_console_init); ... #endif ... arch_initcall(pic32_uart_init); When the driver is built as module, all three above become module_init(). So if SERIAL_PIC32_CONSOLE is set while SERIAL_PIC32=m, it results in the following build error: In file included from include/linux/device/driver.h:21, from include/linux/device.h:32, from include/linux/platform_device.h:13, from drivers/tty/serial/pic32_uart.c:12: include/linux/module.h:131:49: error: redefinition of '__inittest' So make sure SERIAL_PIC32_CONSOLE can be set only when SERIAL_PIC32=y -- similar as for other drivers. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d2b574c0b45eb979971343876944f982e9511bf4 Author: Jiri Slaby Date: Thu Apr 21 12:17:06 2022 +0200 serial: qcom: use check for empty instead of pending The code wants to know if the circ buffer is empty, so use the proper macro. No functional change intended, just saner function name used for that use case. Cc: Andy Gross Cc: Bjorn Andersson Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e48b68ab0ca402cd8da0363c55a834dde0331b83 Author: Jiri Slaby Date: Thu Apr 21 12:17:05 2022 +0200 serial: zs: use NULL as a pointer, not 0 struct uart_port::membase is declared as a pointer. So it should be initialized by NULL, not zero constant. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 08814cd69d4eace3612aaa386dffa5ebb8d1e1a4 Author: Jiri Slaby Date: Thu Apr 21 12:17:04 2022 +0200 serial: xilinx_uartps: cache xmit in cdns_uart_handle_tx() Cache port->state->xmit into a local variable (xmit) in cdns_uart_handle_tx(). This reduces length of some lines there significantly. I.e. makes the code more readable. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit a28ef75816fcce29b72704143347a9f7700637be Author: Jiri Slaby Date: Thu Apr 21 12:17:03 2022 +0200 serial: xilinx_uartps: return early in cdns_uart_handle_tx() Return from the true branch of the 'if'. This saves one indentation level and makes the code more readable. The two comments about what obvious code does are removed too. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421101708.5640-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit b68f42d4c99704e06c6f163af077b1bf4671f0bc Author: Tom Rix Date: Thu Apr 21 11:25:05 2022 -0400 serial: sunplus-uart: change sunplus_console_ports from global to static Smatch reports this issue sunplus-uart.c:501:26: warning: symbol 'sunplus_console_ports' was not declared. Should it be static? sunplus_console_ports is only used in sunplus-uart.c so change its storage-class specifier to static Reviewed-by: Jiri Slaby Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220421152505.1531507-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 9b92cc5ee2d10e6c4d327d1e4ceb77aa8b1081ee Author: Yu Tu Date: Fri Apr 22 19:13:20 2022 +0800 tty: serial: meson: Added S4 SOC compatibility Make UART driver compatible with S4 SOC UART. Meanwhile, the S4 SOC UART uses 12MHz as the clock source for baud rate calculations. Reviewed-by: Neil Armstrong Signed-off-by: Yu Tu Link: https://lore.kernel.org/r/20220422111320.19234-3-yu.tu@amlogic.com Signed-off-by: Greg Kroah-Hartman commit 00a7fa836dbc454faf5b7027ad67519af7c6c15b Author: Yu Tu Date: Fri Apr 22 19:13:19 2022 +0800 tty: serial: meson: Add a 12MHz internal clock rate to calculate baud rate in order to meet the baud rate requirements of special BT modules A /2 divider over XTAL was introduced since G12A, and is preferred to be used over the still present /3 divider since it provides much closer frequencies vs the request baudrate. Especially the BT module uses 3Mhz baud rate. 8Mhz calculations can lead to baud rate bias, causing some problems. Reviewed-by: Neil Armstrong Signed-off-by: Yu Tu Link: https://lore.kernel.org/r/20220422111320.19234-2-yu.tu@amlogic.com Signed-off-by: Greg Kroah-Hartman commit f938948db9078c0a4f27013c9889239c8db62e37 Author: Jiri Slaby Date: Thu Apr 21 10:58:08 2022 +0200 serial: icom: remove unused struct icom_port members Some members of struct icom_port are completely unused or only set and never read. Remove all those. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 7664b7a16b16dba0eac077dfc15c5c983ceed2c6 Author: Jiri Slaby Date: Thu Apr 21 10:58:07 2022 +0200 serial: icom: delete empty serial hooks uart_ops::release_port() and uart_ops::request_port() are not required by the serial layer. So no need to define empty ones. Remove them. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e391e325478f9c4d4cae757ef528f21d605f450a Author: Jiri Slaby Date: Thu Apr 21 10:58:06 2022 +0200 serial: icom: use list_for_each_entry() Use list_for_each_entry() helper instead of explicit combo of list_for_each() and list_entry(). Note that pos is used as a reference point in list_add_tail() in icom_alloc_adapter(). This functionality remains as with an empty list, cur_adapter_entry->icom_adapter_entry is still the list head. This simplifies the code a bit. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8b026d636d4a4a92533b7f28a86e59ffd6d7acad Author: Jiri Slaby Date: Thu Apr 21 10:58:05 2022 +0200 serial: icom: make icom_acfg_baud const and unsigned The baud rates are unsigned constants. So mark them as such. Not only it makes sense, but they are passed also to uart_get_baud_rate() and that expects unsigned int as baud rates on input. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 05ef2f3dd0cb3dd0b92691312042234083eabd01 Author: Jiri Slaby Date: Thu Apr 21 10:58:04 2022 +0200 serial: icom: use ARRAY_SIZE Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 59a1d562d35ea49b7d00d963b16b47b3ed0b3568 Author: Jiri Slaby Date: Thu Apr 21 10:58:03 2022 +0200 serial: icom: move header content to .c There is no point keeping the header content separated. The header was not even protected against double inclusion. So move the content to the appropriate source file. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 7a5f86e86b7a2466c80c7d383efd66151d70c015 Author: Jiri Slaby Date: Thu Apr 21 10:58:02 2022 +0200 serial: icom: use proper __le types and functions There is a lot of sparse warnings: .../icom.c:228:30: warning: cast from restricted __le16 .../icom.c:232:66: warning: incorrect type in assignment (different base types) .../icom.c:232:66: expected unsigned int [usertype] leBuffer .../icom.c:232:66: got restricted __le32 [usertype] .../icom.c:237:30: warning: cast from restricted __le16 ... .../icom.c:1228:22: warning: cast from restricted __le16 And they are correct. So sort them all out by using proper __leXX and uXX types and the right direction of conversion: le16_to_cpu() instead of cpu_to_le16(), where appropriate. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 2c334f12dc2523f28be5cda26d15b6fdeb70bddc Author: Jiri Slaby Date: Thu Apr 21 10:58:01 2022 +0200 serial: icom: remove to_icom_adapter() and icom_kref_release() Integrate both the to_icom_adapter() macro and icom_kref_release() wrapper into icom_remove_adapter(). (And keep it icom_kref_release() name.) It makes the code easier to follow without complex indirections. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit f73989f58d54b5b01363a2627dd9c99710770d62 Author: Jiri Slaby Date: Thu Apr 21 10:58:00 2022 +0200 serial: icom: switch vague casts to container_of In icom, there is an ICOM_PORT macro to perform upcasts from struct uart_port to struct icom_port. It's not completely safe and it works only because the first member of icom_port is uart_port. Nowadays, we use container_of for such an upcast instead. So introduce a helper (to_icom_port()) with container_of in it and convert all the ICOM_PORT users to the new helper. Apart from the code and type safety, it's also clear what icom_port (the variable) is. Unlike with the old ICOM_PORT (the macro with the cast). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 74c778ec5a272cb100e8d4b7eee04220335794d2 Author: Jiri Slaby Date: Thu Apr 21 10:57:59 2022 +0200 serial: icom: remove ICOM_VERSION_STR macro It's unused, so remove the macro. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220421085808.24152-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit bd40cbb0e3b37a4d2a2d9e2ac40122cdf619b1f3 Author: Ulf Hansson Date: Tue Apr 19 19:29:16 2022 +0200 PM: domains: Move genpd's time-accounting to ktime_get_mono_fast_ns() To move towards a more consistent behaviour between genpd and the runtime PM core, let's start by converting genpd's time-accounting from ktime_get() into ktime_get_mono_fast_ns(). Signed-off-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 0e7add1e20a0eb7ca3d0576e4a785192f53f5fa5 Author: Arnd Bergmann Date: Fri Apr 22 15:56:59 2022 +0200 integrator: remove empty ap_init_early() The ap_init_early function is defined a global but has no declaration, so it produces a warning: arch/arm/mach-versatile/integrator_ap.c:148:13: warning: no previous prototype for 'ap_init_early' [-Wmissing-prototypes The function could be made 'static' but since it's empty, we can just remove it. Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit d8a54d2e42190abd68bd5d7d3ac472f440ab8fb3 Merge: c50c29a806113 2e53b877dc125 Author: Greg Kroah-Hartman Date: Fri Apr 22 15:51:06 2022 +0200 Merge tag 'lkdtm-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into char-misc-next Kees writes: lkdtm updates for next Christophe Leroy (1): lkdtm/bugs: Don't expect thread termination without CONFIG_UBSAN_TRAP Jiasheng Jiang (1): lkdtm/bugs: Check for the NULL pointer after calling kmalloc Kees Cook (4): lkdtm/heap: Note conditions for SLAB_LINEAR_OVERFLOW lkdtm/usercopy: Expand size of "out of frame" object lkdtm: Move crashtype definitions into each category lkdtm: Add CFI_BACKWARD to test ROP mitigations * tag 'lkdtm-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lkdtm: Add CFI_BACKWARD to test ROP mitigations lkdtm: Move crashtype definitions into each category lkdtm/bugs: Don't expect thread termination without CONFIG_UBSAN_TRAP lkdtm/usercopy: Expand size of "out of frame" object lkdtm/heap: Note conditions for SLAB_LINEAR_OVERFLOW lkdtm/bugs: Check for the NULL pointer after calling kmalloc commit c5060b09f460fc83846d361018a124fcade1b9e9 Author: Robert Foss Date: Thu Apr 21 15:14:15 2022 +0200 drm/bridge: Fix it6505 Kconfig DRM_DP_AUX_BUS dependency it6505 depends on DRM_DP_AUX_BUS, the kconfig for it6505 should reflect this dependency using 'select'. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Reported-by: kernel test robot Suggested-by: Randy Dunlap Signed-off-by: Robert Foss Reviewed-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220421131415.1289469-1-robert.foss@linaro.org commit a044e6a0883bcd4ad71849c97f79fd213e940077 Author: Yong Wu Date: Thu Apr 21 11:51:08 2022 +0800 arm: dts: mediatek: Get rid of mediatek, larb for MM nodes After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Signed-off-by: Allen-KH Cheng Reviewed-by: Evan Green Tested-by: Frank Wunderlich # BPI-R2/MT7623 Link: https://lore.kernel.org/r/20220421035111.7267-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 2a2848e7c2fde1c26ff46998ac10f7bf9ca2de04 Author: Anshuman Khandual Date: Fri Apr 8 09:40:09 2022 +0530 arm64/mm: Compute PTRS_PER_[PMD|PUD] independently of PTRS_PER_PTE Possible page table entries (or pointers) on non-zero page table levels are dependent on a single page size i.e PAGE_SIZE and size required for each individual page table entry i.e 8 bytes. PTRS_PER_[PMD|PUD] as such are not related to PTRS_PER_PTE in any manner, as being implied currently. So lets just make this very explicit and compute these macros independently. Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220408041009.1259701-1-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit c78c5a660439d4d341a03b651541fda3ebe76160 Author: Lorenzo Bianconi Date: Wed Apr 20 16:07:07 2022 +0200 dt-bindings: net: mediatek,net: convert to the json-schema This patch converts the existing mediatek-net.txt binding file in yaml format. Signed-off-by: Lorenzo Bianconi Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 949cfe1a433b558ebf9e93407e3ea8bf9acae1ae Merge: 5252c1c5a08e5 4e8988c634a11 Author: Matthias Brugger Date: Fri Apr 22 14:39:59 2022 +0200 Merge tag 'v5.18-next-vdso0-stable-tag' into v5.18-next/soc commit 4e8988c634a1159e803bfdc0118578ded97e012c Author: jason-jh.lin Date: Tue Apr 19 17:41:41 2022 +0800 soc: mediatek: add DDP_DOMPONENT_DITHER0 enum for mt8195 vdosys0 The mmsys routing table of mt8195 vdosys0 has 2 DITHER components, so mmsys need to add DDP_COMPONENT_DITHER1 and change all usages of DITHER enum form DDP_COMPONENT_DITHER to DDP_COMPONENT_DITHER0. But its header need to keep DDP_COMPONENT_DITHER enum until drm/mediatek also changed it. Signed-off-by: jason-jh.lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen Link: https://lore.kernel.org/r/20220419094143.9561-7-jason-jh.lin@mediatek.com Signed-off-by: Matthias Brugger commit 8fdb61f1933a85cd5376ef5daf92f94577186bd9 Author: jason-jh.lin Date: Tue Apr 19 17:41:37 2022 +0800 soc: mediatek: add mtk-mutex support for mt8195 vdosys0 Add mtk-mutex support for mt8195 vdosys0. Signed-off-by: jason-jh.lin Acked-by: AngeloGioacchino Del Regno Tested-by: Fei Shao Reviewed-by: Rex-BC Chen Link: https://lore.kernel.org/r/20220419094143.9561-3-jason-jh.lin@mediatek.com Signed-off-by: Matthias Brugger commit b804923b7ccb9c9629703364e927b48cd02a9254 Author: jason-jh.lin Date: Tue Apr 19 17:41:36 2022 +0800 soc: mediatek: add mtk-mmsys support for mt8195 vdosys0 1. Add mt8195 mmsys compatible for 2 vdosys. 2. Add io_start into each driver data of mt8195 vdosys. 3. Add get match data function to identify mmsys by io_start. 4. Add mt8195 routing table settings of vdosys0. Signed-off-by: jason-jh.lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen Reviewed-by: CK Hu Link: https://lore.kernel.org/r/20220419094143.9561-2-jason-jh.lin@mediatek.com Signed-off-by: Matthias Brugger commit fb799dd49a25625db05af51dd141371f6f64d3d1 Merge: cb1e6bf42bce6 b1ad41384866a Author: David S. Miller Date: Fri Apr 22 13:06:03 2022 +0100 Merge branch 'ipv6-RT_ONLINK-remove-prep' Guillaume Nault says: ==================== ipv4: First steps toward removing RTO_ONLINK RTO_ONLINK is a flag that allows to reduce the scope of route lookups. It's stored in a normally unused bit of the ->flowi4_tos field, in struct flowi4. However it has several problems: * This bit is also used by ECN. Although ECN bits are supposed to be cleared before doing a route lookup, it happened that some code paths didn't properly sanitise their ->flowi4_tos. So this mechanism is fragile and we had bugs in the past where ECN bits slipped in and could end up being erroneously interpreted as RTO_ONLINK. * A dscp_t type was recently introduced to ensure ECN bits are cleared during route lookups. ->flowi4_tos is the most important structure field to convert, but RTO_ONLINK prevents such conversion, as dscp_t mandates that ECN bits (where RTO_ONLINK is stored) be zero. Therefore we need to stop using RTO_ONLINK altogether. Fortunately RTO_ONLINK isn't a necessity. Instead of passing a flag in ->flowi4_tos to tell the route lookup function to restrict the scope, we can simply initialise the scope correctly. Patch 1 does some preparatory work: it stops resetting ->flowi4_scope automatically before a route lookup, thus allowing callers to set their desired scope without having to rely on the RTO_ONLINK flag. Patch 2-3 convert a few code paths to avoid relying on RTO_ONLINK. More conversions will have to take place before we can eventually remove this flag. ==================== Signed-off-by: David S. Miller commit b1ad41384866aafadf24c6b0f7e7701c86bdddc2 Author: Guillaume Nault Date: Thu Apr 21 01:21:37 2022 +0200 ipv4: Initialise ->flowi4_scope properly in ICMP handlers. All the *_redirect() and *_update_pmtu() functions initialise their struct flowi4 variable with either __build_flow_key() or build_sk_flow_key(). When sk is provided, these functions use RT_CONN_FLAGS() to set ->flowi4_tos and always use RT_SCOPE_UNIVERSE for ->flowi4_scope. Then they rely on ip_rt_fix_tos() to adjust the scope based on the RTO_ONLINK bit and to mask the tos with IPTOS_RT_MASK. This patch modifies __build_flow_key() and build_sk_flow_key() to properly initialise ->flowi4_tos and ->flowi4_scope, so that the ICMP redirects and PMTU handlers don't need an extra call to ip_rt_fix_tos() before doing a fib lookup. That is, we: * Drop RT_CONN_FLAGS(): use ip_sock_rt_tos() and ip_sock_rt_scope() instead, so that we don't have to rely on ip_rt_fix_tos() to adjust the scope anymore. * Apply IPTOS_RT_MASK to the tos, so that we don't need ip_rt_fix_tos() to do it for us. * Drop the ip_rt_fix_tos() calls that now become useless. The only remaining ip_rt_fix_tos() caller is ip_route_output_key_hash() which needs it as long as external callers still use the RTO_ONLINK flag. Note: This patch also drops some useless RT_TOS() calls as IPTOS_RT_MASK is a stronger mask. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 67e1e2f4854bb2c0dd2b8440cf090016a0e1a091 Author: Guillaume Nault Date: Thu Apr 21 01:21:33 2022 +0200 ipv4: Avoid using RTO_ONLINK with ip_route_connect(). Now that ip_rt_fix_tos() doesn't reset ->flowi4_scope unconditionally, we don't have to rely on the RTO_ONLINK bit to properly set the scope of a flowi4 structure. We can just set ->flowi4_scope explicitly and avoid using RTO_ONLINK in ->flowi4_tos. This patch converts callers of ip_route_connect(). Instead of setting the tos parameter with RT_CONN_FLAGS(sk), as all callers do, we can: 1- Drop the tos parameter from ip_route_connect(): its value was entirely based on sk, which is also passed as parameter. 2- Set ->flowi4_scope depending on the SOCK_LOCALROUTE socket option instead of always initialising it with RT_SCOPE_UNIVERSE (let's define ip_sock_rt_scope() for this purpose). 3- Avoid overloading ->flowi4_tos with RTO_ONLINK: since the scope is now properly initialised, we don't need to tell ip_rt_fix_tos() to adjust ->flowi4_scope for us. So let's define ip_sock_rt_tos(), which is the same as RT_CONN_FLAGS() but without the RTO_ONLINK bit overload. Note: In the original ip_route_connect() code, __ip_route_output_key() might clear the RTO_ONLINK bit of fl4->flowi4_tos (because of ip_rt_fix_tos()). Therefore flowi4_update_output() had to reuse the original tos variable. Now that we don't set RTO_ONLINK any more, this is not a problem and we can use fl4->flowi4_tos in flowi4_update_output(). Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 16a28267774cd9f85405ef83d4afcbd0355e5817 Author: Guillaume Nault Date: Thu Apr 21 01:21:24 2022 +0200 ipv4: Don't reset ->flowi4_scope in ip_rt_fix_tos(). All callers already initialise ->flowi4_scope with RT_SCOPE_UNIVERSE, either by manual field assignment, memset(0) of the whole structure or implicit structure initialisation of on-stack variables (RT_SCOPE_UNIVERSE actually equals 0). Therefore, we don't need to always initialise ->flowi4_scope in ip_rt_fix_tos(). We only need to reduce the scope to RT_SCOPE_LINK when the special RTO_ONLINK flag is present in the tos. This will allow some code simplification, like removing ip_rt_fix_tos(). Also, the long term idea is to remove RTO_ONLINK entirely by properly initialising ->flowi4_scope, instead of overloading ->flowi4_tos with a special flag. Eventually, this will allow to convert ->flowi4_tos to dscp_t. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e41a2999f746e67f1230dd42930497d4e011eb9a Author: Javier Martinez Canillas Date: Wed Apr 20 09:24:11 2022 +0200 drm/doc: Add sections about tiny drivers and external refs to intro page Learning about the DRM subsystem could be quite overwhelming for newcomers but there are lots of useful talks, slides and articles available that can help to understand the needed concepts and ease the learning curve. There are also simple DRM drivers that can be used as example about how a DRM driver should look like. Add sections to the introduction page, that contains references to these. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Acked-by: Pekka Paalanen Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220420072411.15104-1-javierm@redhat.com commit cb1e6bf42bce63158884ab83fb171b518693c771 Merge: 42d594357e01e 29e96fe9e0ec0 Author: David S. Miller Date: Fri Apr 22 12:52:27 2022 +0100 Merge branch 'zynqmp-phy-config-optional' Radhey Shyam Pandey says: ==================== net: macb: Make ZynqMP SGMII phy configuration optional This patchset drop phy-names property from MACB node and also make SGMII Phy configuration optional. The motivation for this change is to support traditional usescase in which first stage bootloader does PS-GT configuration, and should still be supported in macb driver. ==================== Signed-off-by: David S. Miller commit 29e96fe9e0ec0f0fe1dd306a4ccb7b8983eae67a Author: Radhey Shyam Pandey Date: Wed Apr 20 16:33:10 2022 +0530 net: macb: In ZynqMP initialization make SGMII phy configuration optional In the macb binding documentation "phys" is an optional property. Make implementation in line with it. This change allows the traditional flow in which first stage bootloader does PS-GT configuration to work along with newer use cases in which PS-GT configuration is managed by the phy-zynqmp driver. It fixes below macb probe failure when macb DT node doesn't have SGMII phys handle. "macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY" Signed-off-by: Radhey Shyam Pandey Reviewed-by: Michal Simek Signed-off-by: David S. Miller commit 3ac8316e09b0a0fd299fb40a27546de9e1a48216 Author: Radhey Shyam Pandey Date: Wed Apr 20 16:33:09 2022 +0530 dt-bindings: net: cdns,macb: Drop phy-names property for ZynqMP SGMII PHY In zynqmp SGMII initialization, there is a single PHY so remove phy-names property as there is no real need of having it. Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 42d594357e01e360b78e13659c42de1598698fd2 Merge: 0844d36f771d3 81ee0eb6c0fe3 Author: David S. Miller Date: Fri Apr 22 12:47:51 2022 +0100 Merge branch 'ipv6-only-sock' Kuniyuki Iwashima says: ==================== ipv6: Use ipv6_only_sock helper function. The first patch removes __ipv6_only_sock(), and the second replaces ipv6only tests with ipv6_only_sock(). ==================== Signed-off-by: David S. Miller commit 81ee0eb6c0fe34490ed92667538197d9295e899e Author: Kuniyuki Iwashima Date: Wed Apr 20 10:58:51 2022 +0900 ipv6: Use ipv6_only_sock() helper in condition. This patch replaces some sk_ipv6only tests with ipv6_only_sock(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 89e9c7280075f6733b22dd0740daeddeb1256ebf Author: Kuniyuki Iwashima Date: Wed Apr 20 10:58:50 2022 +0900 ipv6: Remove __ipv6_only_sock(). Since commit 9fe516ba3fb2 ("inet: move ipv6only in sock_common"), ipv6_only_sock() and __ipv6_only_sock() are the same macro. Let's remove the one. Signed-off-by: Kuniyuki Iwashima Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 0844d36f771d3fe3c418df7569396a9a58feab85 Author: Tom Rix Date: Tue Apr 19 10:06:25 2022 -0400 USB2NET : SR9800 : change SR9800_BULKIN_SIZE from global to static Smatch reports this issue sr9800.h:166:53: warning: symbol 'SR9800_BULKIN_SIZE' was not declared. Should it be static? Global variables should not be defined in header files. This only works because sr9800.h in only included by sr9800.c Change the storage-class specifier to static. And since it does not change add type qualifier const. Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit cc470d55343056d6b2a5c32e10e0aad06f324078 Author: Zheng Yongjun Date: Fri Apr 22 06:26:41 2022 +0000 spi: img-spfi: Fix pm_runtime_get_sync() error checking If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: deba25800a12b ("spi: Add driver for IMG SPFI controller") Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220422062641.10486-1-zhengyongjun3@huawei.com Signed-off-by: Mark Brown commit d516e96bdeca103224de2f84685bf733953b6303 Author: Pierre-Louis Bossart Date: Thu Apr 21 11:26:00 2022 -0500 ASoC: SOF: sof-audio: remove useless assignment There is no need to assign spcm to NULL. Removing this assignment also removes a false alarm reported by cppcheck. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220421162600.302230-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c275872107fe1b7f9d39ce642e2d8eccfe8afbb0 Author: Gongjun Song Date: Thu Apr 21 11:33:58 2022 -0500 ASoC: SOF: Intel: pci-tgl: add RPL-P support Add PCI DID for Intel Raptor Lake P. Reviewed-by: Kai Vehmanen Signed-off-by: Gongjun Song Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421163358.319489-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6c84dae212747d0c82057c48785f2b1b6c53f553 Author: Muralidhar Reddy Date: Thu Apr 21 11:33:57 2022 -0500 ASoC: SOF: Intel: pci-tgl: add ADL-PS support Add PCI DID for Intel Alder Lake PS. Reviewed-by: Ranjani Sridharan Signed-off-by: Muralidhar Reddy Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421163358.319489-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 4bfbbb76e82e5f1e0e114e0831356656b4169c80 Author: Rander Wang Date: Thu Apr 21 11:33:56 2022 -0500 ASOC: SOF: pci: add ipc_type override for Intel IPC4 tests Add a kernel module parameter for select the non-default IPC type. This should only be used by developers with access to firmware and topology files, typically Intel and partners. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220421163358.319489-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d81e4ba5ef1c1033b6c720b22fc99feeb71e71a0 Author: Pierre-Louis Bossart Date: Thu Apr 21 11:33:55 2022 -0500 ASoC: SOF: sof-pci-dev: don't use the community key on APL Chromebooks As suggested by MrChromebox, the SOF driver can be used with the SOF firmware binary signed with the production key. This patch adds an additional check for the ApolloLake SoC before modifying the default firmware path. Note that ApolloLake Chromebooks officially ship with the Skylake driver, so to use SOF the users have to explicitly opt-in with 'options intel-dspcfg dsp_driver=3'. There is no plan to change the default selection. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220421163358.319489-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a8e35fece49b16b20de000aab687ca075e4463af Author: Josh Poimboeuf Date: Mon Apr 18 09:50:44 2022 -0700 objtool: Update documentation The objtool documentation is very stack validation centric. Broaden the documentation and describe all the features objtool supports. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/b6a84d301d9f73ec6725752654097f4e31fa1b69.1650300597.git.jpoimboe@redhat.com commit 753da4179d08b625d8df72e97724e22749969fd3 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:43 2022 -0700 objtool: Remove --lto and --vmlinux in favor of --link The '--lto' option is a confusing way of telling objtool to do stack validation despite it being a linked object. It's no longer needed now that an explicit '--stackval' option exists. The '--vmlinux' option is also redundant. Remove both options in favor of a straightforward '--link' option which identifies a linked object. Also, implicitly set '--link' with a warning if the user forgets to do so and we can tell that it's a linked object. This makes it easier for manual vmlinux runs. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/dcd3ceffd15a54822c6183e5766d21ad06082b45.1650300597.git.jpoimboe@redhat.com commit 489e355b42255c5536a0ea3083a66b54a5e235c3 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:42 2022 -0700 objtool: Add HAVE_NOINSTR_VALIDATION Remove CONFIG_NOINSTR_VALIDATION's dependency on HAVE_OBJTOOL, since other arches might want to implement objtool without it. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/488e94f69db4df154499bc098573d90e5db1c826.1650300597.git.jpoimboe@redhat.com commit 0f620cefd7753175b6258fed85f76c2014ec3799 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:41 2022 -0700 objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION" CONFIG_VMLINUX_VALIDATION is just the validation of the "noinstr" rules. That name is a misnomer, because now objtool actually does vmlinux validation for other reasons. Rename CONFIG_VMLINUX_VALIDATION to CONFIG_NOINSTR_VALIDATION. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/173f07e2d6d1afc0874aed975a61783207c6a531.1650300597.git.jpoimboe@redhat.com commit 22102f4559beaabcea614b29ee090c6a214f002f Author: Josh Poimboeuf Date: Mon Apr 18 09:50:40 2022 -0700 objtool: Make noinstr hacks optional Objtool has some hacks in place to workaround toolchain limitations which otherwise would break no-instrumentation rules. Make the hacks explicit (and optional for other arches) by turning it into a cmdline option and kernel config option. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/b326eeb9c33231b9dfbb925f194ed7ee40edcd7c.1650300597.git.jpoimboe@redhat.com commit 4ab7674f5951ac6a8ac4fa8828090edb64a4771f Author: Josh Poimboeuf Date: Mon Apr 18 09:50:39 2022 -0700 objtool: Make jump label hack optional Objtool secretly does a jump label hack to overcome the limitations of the toolchain. Make the hack explicit (and optional for other arches) by turning it into a cmdline option and kernel config option. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/3bdcbfdd27ecb01ddec13c04bdf756a583b13d24.1650300597.git.jpoimboe@redhat.com commit 26e176896a5bb9222ae3433da902edd2566a61a4 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:38 2022 -0700 objtool: Make static call annotation optional As part of making objtool more modular, put the existing static call code behind a new '--static-call' option. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/d59ac57ef3d6d8380cdce20322314c9e2e556750.1650300597.git.jpoimboe@redhat.com commit 72064474964724c59ddff58a581a31b1ede75cf9 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:37 2022 -0700 objtool: Make stack validation frame-pointer-specific Now that CONFIG_STACK_VALIDATION is frame-pointer specific, do the same for the '--stackval' option. Now the '--no-fp' option is redundant and can be removed. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/f563fa064b3b63d528de250c72012d49e14742a3.1650300597.git.jpoimboe@redhat.com commit 03f16cd020eb8bb2eb837e2090086f296a9fa91d Author: Josh Poimboeuf Date: Mon Apr 18 09:50:36 2022 -0700 objtool: Add CONFIG_OBJTOOL Now that stack validation is an optional feature of objtool, add CONFIG_OBJTOOL and replace most usages of CONFIG_STACK_VALIDATION with it. CONFIG_STACK_VALIDATION can now be considered to be frame-pointer specific. CONFIG_UNWINDER_ORC is already inherently valid for live patching, so no need to "validate" it. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/939bf3d85604b2a126412bf11af6e3bd3b872bcb.1650300597.git.jpoimboe@redhat.com commit c2bdd61c98d915ad2cc1f8cd4661fcda1f1e4c16 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:35 2022 -0700 objtool: Extricate sls from stack validation Extricate sls functionality from validate_branch() so they can be executed (or ported) independently from each other. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/2545c86ffa5f27497f0d0c542540ad4a4be3c5a5.1650300597.git.jpoimboe@redhat.com commit 3c6f9f77e6188ca4d283633d66e91b3821a505ae Author: Josh Poimboeuf Date: Mon Apr 18 09:50:34 2022 -0700 objtool: Rework ibt and extricate from stack validation Extricate ibt from validate_branch() so they can be executed (or ported) independently from each other. While shuffling code around, simplify and improve the ibt logic: - Ignore an explicit list of known sections which reference functions for reasons other than indirect branching to them. This helps prevent unnnecesary sealing. - Warn on missing !ENDBR for all other sections, not just .data and .rodata. This finds additional warnings, because there are sections other than .[ro]data which reference function pointers. For example, the ksymtab sections which are used for exporting symbols. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/fd1435e46bb95f81031b8fb1fa360f5f787e4316.1650300597.git.jpoimboe@redhat.com commit 7dce62041ac34b613a5ed1bd937117e492e06dc8 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:33 2022 -0700 objtool: Make stack validation optional Make stack validation an explicit cmdline option so that individual objtool features can be enabled individually by other arches. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/52da143699574d756e65ca4c9d4acaffe9b0fe5f.1650300597.git.jpoimboe@redhat.com commit 99c0beb547a3e0ec3a63edeba0960c6ddf2226b0 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:31 2022 -0700 objtool: Add option to print section addresses To help prevent objtool users from having to do math to convert function addresses to section addresses, and to help out with finding data addresses reported by IBT validation, add an option to print the section address in addition to the function address. Normal: vmlinux.o: warning: objtool: fixup_exception()+0x2d1: unreachable instruction With '--sec-address': vmlinux.o: warning: objtool: fixup_exception()+0x2d1 (.text+0x76c51): unreachable instruction Suggested-by: Nick Desaulniers Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/2cea4d5299d53d1a4c09212a6ad7820aa46fda7a.1650300597.git.jpoimboe@redhat.com commit 2bc3dec7055e34c2c2e497f109da6748544c0791 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:28 2022 -0700 objtool: Don't print parentheses in function addresses The parentheses in the "func()+off" address output are inconsistent with how the kernel prints function addresses, breaking Peter's scripts. Remove them. Suggested-by: Peter Zijlstra Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/f2bec70312f62ef4f1ea21c134d9def627182ad3.1650300597.git.jpoimboe@redhat.com commit b51277eb9775ce916f9efd2c51533e481180c1e8 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:27 2022 -0700 objtool: Ditch subcommands Objtool has a fairly singular focus. It runs on object files and does validations and transformations which can be combined in various ways. The subcommand model has never been a good fit, making it awkward to combine and remove options. Remove the "check" and "orc" subcommands in favor of a more traditional cmdline option model. This makes it much more flexible to use, and easier to port individual features to other arches. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/5c61ebf805e90aefc5fa62bc63468ffae53b9df6.1650300597.git.jpoimboe@redhat.com commit 2daf7faba7ded8703e4b4ebc8b161f22272fc91a Author: Josh Poimboeuf Date: Mon Apr 18 09:50:26 2022 -0700 objtool: Reorganize cmdline options Split the existing options into two groups: actions, which actually do something; and options, which modify the actions in some way. Also there's no need to have short flags for all the non-action options. Reserve short flags for the more important actions. While at it: - change a few of the short flags to be more intuitive - make option descriptions more consistently descriptive - sort options in the source like they are when printed - move options to a global struct Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/9dcaa752f83aca24b1b21f0b0eeb28a0c181c0b0.1650300597.git.jpoimboe@redhat.com commit aa3d60e050112ef1373d7216eabe0ee966615527 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:21 2022 -0700 libsubcmd: Fix OPTION_GROUP sorting The OPTION_GROUP option type is a way of grouping certain options together in the printed usage text. It happens to be completely broken, thanks to the fact that the subcmd option sorting just sorts everything, without regard for grouping. Luckily, nobody uses this option anyway, though that will change shortly. Fix it by sorting each group individually. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/e167ea3a11e2a9800eb062c1fd0f13e9cd05140c.1650300597.git.jpoimboe@redhat.com commit 3398b12d10271c008ed48fecc6577a5940d7cdf3 Merge: 4abff6d48dbce 4cdfc11b2836e Author: Peter Zijlstra Date: Fri Apr 22 12:32:01 2022 +0200 Merge branch 'tip/x86/urgent' Merge the x86/urgent objtool/IBT changes as a base Signed-off-by: Peter Zijlstra commit a658353167bf2ea6052cee071dbcc13e0f229dc9 Author: Tao Zhou Date: Fri Apr 15 17:55:04 2022 +0800 sched/fair: Revise comment about lb decision matrix If busiest group type is group_misfit_task, the local group type must be group_has_spare according to below code in update_sd_pick_busiest(): if (sgs->group_type == group_misfit_task && (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) || sds->local_stat.group_type != group_has_spare)) return false; group type imbalanced and overloaded and fully_busy are filtered in here. misfit and asym are filtered before in update_sg_lb_stats(). So, change the decision matrix to: busiest \ local has_spare fully_busy misfit asym imbalanced overloaded has_spare nr_idle balanced N/A N/A balanced balanced fully_busy nr_idle nr_idle N/A N/A balanced balanced misfit_task force N/A N/A N/A *N/A* *N/A* asym_packing force force N/A N/A force force imbalanced force force N/A N/A force force overloaded force force N/A N/A force avg_load Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()") Signed-off-by: Tao Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20220415095505.7765-1-tao.zhou@linux.dev commit 890d550d7dbac7a31ecaa78732aa22be282bb6b8 Author: Chengming Zhou Date: Fri Apr 8 20:19:14 2022 +0800 sched/psi: report zeroes for CPU full at the system level Martin find it confusing when look at the /proc/pressure/cpu output, and found no hint about that CPU "full" line in psi Documentation. % cat /proc/pressure/cpu some avg10=0.92 avg60=0.91 avg300=0.73 total=933490489 full avg10=0.22 avg60=0.23 avg300=0.16 total=358783277 The PSI_CPU_FULL state is introduced by commit e7fcd7622823 ("psi: Add PSI_CPU_FULL state"), which mainly for cgroup level, but also counted at the system level as a side effect. Naturally, the FULL state doesn't exist for the CPU resource at the system level. These "full" numbers can come from CPU idle schedule latency. For example, t1 is the time when task wakeup on an idle CPU, t2 is the time when CPU pick and switch to it. The delta of (t2 - t1) will be in CPU_FULL state. Another case all processes can be stalled is when all cgroups have been throttled at the same time, which unlikely to happen. Anyway, CPU_FULL metric is meaningless and confusing at the system level. So this patch will report zeroes for CPU full at the system level, and update psi Documentation accordingly. Fixes: e7fcd7622823 ("psi: Add PSI_CPU_FULL state") Reported-by: Martin Steigerwald Suggested-by: Johannes Weiner Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20220408121914.82855-1-zhouchengming@bytedance.com commit 0a00a354644ee1800d31c47cf5927b9b50272fac Author: Chengming Zhou Date: Fri Apr 8 19:53:09 2022 +0800 sched/fair: Delete useless condition in tg_unthrottle_up() We have tested cfs_rq->load.weight in cfs_rq_is_decayed(), the first condition "!cfs_rq_is_decayed(cfs_rq)" is enough to cover the second condition "cfs_rq->nr_running". Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220408115309.81603-2-zhouchengming@bytedance.com commit 64eaf50731ac0a8c76ce2fedd50ef6652aabc5ff Author: Chengming Zhou Date: Fri Apr 8 19:53:08 2022 +0800 sched/fair: Fix cfs_rq_clock_pelt() for throttled cfs_rq Since commit 23127296889f ("sched/fair: Update scale invariance of PELT") change to use rq_clock_pelt() instead of rq_clock_task(), we should also use rq_clock_pelt() for throttled_clock_task_time and throttled_clock_task accounting to get correct cfs_rq_clock_pelt() of throttled cfs_rq. And rename throttled_clock_task(_time) to be clock_pelt rather than clock_task. Fixes: 23127296889f ("sched/fair: Update scale invariance of PELT") Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20220408115309.81603-1-zhouchengming@bytedance.com commit 06354900787f25bf5be3c07a68e3cdbc5bf0fa69 Author: zgpeng Date: Wed Apr 6 17:57:05 2022 +0800 sched/fair: Move calculate of avg_load to a better location In calculate_imbalance function, when the value of local->avg_load is greater than or equal to busiest->avg_load, the calculated sds->avg_load is not used. So this calculation can be placed in a more appropriate position. Signed-off-by: zgpeng Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Samuel Liao Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/1649239025-10010-1-git-send-email-zgpeng@tencent.com commit e3f73ece75a88b79d14a811cec38a350a694c69d Author: Valentin Schneider Date: Wed Apr 6 15:13:15 2022 +0100 mailmap: Update my email address to @redhat.com I've brok^D contributed to a few different files in my time at Arm, so get_maintainer.pl spits out my name from time to time when it's using the git stats. Make that show an email address that's actually in use. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220406141315.732473-3-vschneid@redhat.com commit c9ca1762b25310beff332f882e20d1cf39bfaae5 Author: Valentin Schneider Date: Wed Apr 6 15:13:14 2022 +0100 MAINTAINERS: Add myself as scheduler topology reviewer I've messed around the NUMA/debug bits of the scheduler toplogy in my time at Arm, and even though I've changed ships I still intend to at the very least review those bits. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220406141315.732473-2-vschneid@redhat.com commit 915a087e4c47334a2f7ba2a4092c4bade0873769 Author: Hailong Liu Date: Fri Apr 1 13:10:11 2022 +0800 psi: Fix trigger being fired unexpectedly at initial When a trigger being created, its win.start_value and win.start_time are reset to zero. If group->total[PSI_POLL][t->state] has accumulated before, this trigger will be fired unexpectedly in the next period, even if its growth time does not reach its threshold. So set the window of the new trigger to the current state value. Signed-off-by: Hailong Liu Signed-off-by: Peter Zijlstra (Intel) Acked-by: Suren Baghdasaryan Link: https://lore.kernel.org/r/1648789811-3788971-1-git-send-email-liuhailong@linux.alibaba.com commit 78ed93d72ded679e3caf0758357209887bda885f Author: Marco Elver Date: Mon Apr 4 13:12:04 2022 +0200 signal: Deliver SIGTRAP on perf event asynchronously if blocked With SIGTRAP on perf events, we have encountered termination of processes due to user space attempting to block delivery of SIGTRAP. Consider this case: ... sigset_t s; sigemptyset(&s); sigaddset(&s, SIGTRAP | ); sigprocmask(SIG_BLOCK, &s, ...); ... When the perf event triggers, while SIGTRAP is blocked, force_sig_perf() will force the signal, but revert back to the default handler, thus terminating the task. This makes sense for error conditions, but not so much for explicitly requested monitoring. However, the expectation is still that signals generated by perf events are synchronous, which will no longer be the case if the signal is blocked and delivered later. To give user space the ability to clearly distinguish synchronous from asynchronous signals, introduce siginfo_t::si_perf_flags and TRAP_PERF_FLAG_ASYNC (opted for flags in case more binary information is required in future). The resolution to the problem is then to (a) no longer force the signal (avoiding the terminations), but (b) tell user space via si_perf_flags if the signal was synchronous or not, so that such signals can be handled differently (e.g. let user space decide to ignore or consider the data imprecise). The alternative of making the kernel ignore SIGTRAP on perf events if the signal is blocked may work for some usecases, but likely causes issues in others that then have to revert back to interception of sigprocmask() (which we want to avoid). [ A concrete example: when using breakpoint perf events to track data-flow, in a region of code where signals are blocked, data-flow can no longer be tracked accurately. When a relevant asynchronous signal is received after unblocking the signal, the data-flow tracking logic needs to know its state is imprecise. ] Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events") Reported-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Acked-by: Geert Uytterhoeven Tested-by: Dmitry Vyukov Link: https://lore.kernel.org/r/20220404111204.935357-1-elver@google.com commit 6f37c9f9dfbf9a9645ec5ea2d9370b0fd3e9081e Author: Florent Fourcot Date: Tue Apr 19 14:51:51 2022 +0200 Revert "rtnetlink: return EINVAL when request cannot succeed" This reverts commit b6177d3240a4 ip-link command is testing kernel capability by sending a RTM_NEWLINK request, without any argument. It accepts everything in reply, except EOPNOTSUPP and EINVAL (functions iplink_have_newlink / accept_msg) So we must keep compatiblity here, invalid empty message should not return EINVAL Signed-off-by: Florent Fourcot Tested-by: Guillaume Nault Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 59359597b010ced20e6e14c8660834c05c2a96b7 Author: Baowen Zheng Date: Tue Apr 19 14:44:43 2022 +0200 nfp: support 802.1ad VLAN assingment to VF The NFP driver already supports assignment of 802.1Q VLANs to VFs e.g. # ip link set $DEV vf $VF_NUM vlan $VLAN_ID [proto 802.1Q] This patch enhances the NFP driver to also allow assingment of 802.1ad VLANs to VFs. e.g. # ip link set $DEV vf $VF_NUM vlan $VLAN_ID proto 802.1ad Signed-off-by: Bin Chen Signed-off-by: Baowen Zheng Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e350dbac3c09a3318f871e0fab255e234408bde4 Author: Minghao Chi Date: Tue Apr 19 11:03:52 2022 +0000 net: ethernet: ti: am65-cpsw-ethtool: use pm_runtime_resume_and_get Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit 57ae18fbde6ade092945ab956b67303f1f857190 Author: José Expósito Date: Thu Apr 21 19:07:25 2022 +0200 drm/sun4i: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi Once EDID is parsed, the monitor HDMI support information is available through drm_display_info.is_hdmi. This driver calls drm_detect_hdmi_monitor() to receive the same information and stores its own cached value, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead and also remove sun4i_hdmi.hdmi_monitor as it is no longer necessary. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220421170725.903361-6-jose.exposito89@gmail.com commit d09d3ec03f025fdc22e193277b30a7db20816d2b Author: Arun Ajith S Date: Tue Apr 19 10:59:10 2022 +0000 net/ipv6: Enforce limits for accept_unsolicited_na sysctl Fix mistake in the original patch where limits were specified but the handler didn't take care of the limits. Signed-off-by: Arun Ajith S Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 8864d2fcf04385cabb8c8bb159f1f2ba5790cf71 Author: Yu Zhe Date: Thu Apr 21 08:48:29 2022 -0700 batman-adv: remove unnecessary type castings remove unnecessary void* type castings. Signed-off-by: Yu Zhe [sven@narfation.org: Fix missing const in batadv_choose* functions] Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 1c604f91b7735a8d55ba56c8580b4b9276d6d7ab Author: Colin Ian King Date: Mon Apr 18 15:37:59 2022 +0100 myri10ge: remove redundant assignment to variable status Variable status is being assigned a value that is never read, it is being re-assigned again later on. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/net/ethernet/myricom/myri10ge/myri10ge.c:582:7: warning: Although the value stored to 'status' is used in the enclosing expression, the value is never actually read from 'status' [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit f1ed409fb1eef7695c1ac84b109acf4b01a61399 Author: Yunbo Yu Date: Mon Apr 18 22:18:12 2022 +0800 net: cdc-ncm: Move spin_lock_bh() to spin_lock() It is unnecessary to call spin_lock_bh() for you are already in a tasklet. Signed-off-by: Yunbo Yu Acked-by: Oliver Neukum Signed-off-by: David S. Miller commit cfa4e7b1bcf85cde71a498d9f23aa84640598d71 Author: Simon Wunderlich Date: Fri Apr 22 11:21:00 2022 +0200 batman-adv: Start new development cycle This version will contain all the (major or even only minor) changes for Linux 5.19. The version number isn't a semantic version number with major and minor information. It is just encoding the year of the expected publishing as Linux -rc1 and the number of published versions this year (starting at 0). Signed-off-by: Simon Wunderlich commit 0cd47616cfbb1422e24414daa5a96637fc5aa663 Merge: c0c237d106bd3 917bf5a312fdb Author: Arnd Bergmann Date: Thu Apr 21 16:00:23 2022 +0200 Merge branch 'omap1/multiplatform-prep' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/multiplatform This is the full series for converting OMAP1 to multiplatform, rebased from my 2019 attempt to do the same thing. The soc tree contains simpler patches to do the same for iop32x, ixp4xx, ep93xx and s3c24xx, which means we are getting closer to completing this for all ARMv5 platforms (I have patches for PXA, which is the last one remaining). Janusz already tested the branch separately and did the missing work for the common-clk conversion after my previous approach was broken. Aaro found one regression during additional testing, this is fixed now. Acked-by: Tony Lindgren Tested-by: Aaro Koskinen Signed-off-by: Arnd Bergmann commit c0c237d106bd35a58b65a174bd5ec50901940040 Author: Arnd Bergmann Date: Fri Apr 22 11:12:23 2022 +0200 ARM: s3c: fix include path The include directory is gone, so stop passing the command line flag. Reported-by: kernel test robot Signed-off-by: Arnd Bergmann commit 917bf5a312fdb421a65cf3e57914a34e8eccc7a1 Author: Tony Lindgren Date: Wed Apr 13 11:16:56 2022 +0300 MAINTAINERS: omap1: Add Janusz as an additional maintainer Janusz has been active with improving and testing the omap1 SoC support and has been recently working on adding support for the common clock framework. Signed-off-by: Tony Lindgren Acked-by: Janusz Krzysztofik Acked-by: Aaro Koskinen Signed-off-by: Arnd Bergmann commit 2b2d9ef321d6b23367c457025203cf0d28f80dd4 Author: Julia Lawall Date: Fri Mar 18 11:37:22 2022 +0100 ARM: omap1: htc_herald: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Aaro Koskinen Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit ec8f128218753e29b1d86cd683617ad00c9a5072 Author: Julia Lawall Date: Fri Mar 18 11:37:28 2022 +0100 ARM: OMAP1: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Aaro Koskinen Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit e9bdc3d4f59c5c19284311994e7f80e3fcc952b6 Author: Janusz Krzysztofik Date: Sun Apr 10 15:07:56 2022 +0200 ARM: OMAP1: clock: Remove noop code There are some OMAP1 clock code bits that have no effect: - crystal_type variable is set to 0 but never changed, then crystal_type == 2 condition is never true and ck_ref.rate never set to 19200000, - clk->ops->allow_idle() is called from omap_clk_enable_autoidle_all() but that op is not configured for any clock, then the function does nothing and the op field is not needed, - ENABLE_ON_INIT flag is set for some clocks but is never checked by any code, then not needed. Drop that code. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 6bdfc9beeced467c31b0cc97367f308adffa9816 Author: Janusz Krzysztofik Date: Sun Apr 10 15:07:55 2022 +0200 ARM: OMAP1: clock: Remove unused code The code of OMAP1 clocks contains quite a few unused elements: - functions and function like macros never called: clk_reparent(), recalculate_root_clocks(), clk_enable_init_clocks(), omap_clk_get_by_name(), omap_clk_disable_autoidle_all(), __clk_get_parent(clk), __clk_get_rate(), - unused structure fields: - clkops: .find_idlest(), .find_companion(), .deny_idle(), - clk: .src_offset, as well as .clkdm -- no longer present but still mentioned in comments, - definitions of unused flags: INVERT_ENABLE, CLOCK_CLKOUTX2, - definitions of unused data types: struct clk_functions, - prototypes of functions with no implementation: clk_init(), omap1_watchdog_recalc(). - declarations of never defined global variables: clkops_dummy. Drop them. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 338d5d476cde853dfd97378d20496baabc2ce3c0 Author: Janusz Krzysztofik Date: Sun Apr 10 15:07:54 2022 +0200 ARM: OMAP1: clock: Fix UART rate reporting algorithm Since its introduction to the mainline kernel, omap1_uart_recalc() helper makes incorrect use of clk->enable_bit as a ready to use bitmap mask while it only provides the bit number. Fix it. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 34c86239b184aeedde8dee95e2ee09dde92045e6 Author: Janusz Krzysztofik Date: Sun Apr 10 15:07:53 2022 +0200 ARM: OMAP1: clock: Fix early UART rate issues Commit ef772f2ee31e ("ARM: OMAP: Fix CONFIG_DEBUG_LL") was supposed to fix low level debugging, most possibly by early enabling UART clocks. The fix actually introduced early reset of most bits of MOD_CONF_CTRL_0 register, with the exception of UART1 and UART2 clock related bits which were set high. However, UART1 clock bit can play different roles on different OMAP1 variants. On OMAP1610 it enables the clock as intended, but on OMAP1510 it switches the clock rate from 12 to 48 MHz. Even worth, for UART2 the bit changes its clock rate also on OMAP1610. As a result, UART rates set by a bootloader can be unintentionally changed early on kernel boot and low level debugging broken, not fixed. Besides, reset of all other bits was not justified. Don't touch register bits not related to UART clocks. Also, don't touch the bit of UART2 clock. Make sure UART1 and UART3 are enabled early on relevant OMAP1610 machine types while preserving bootloader UART clock rates on others. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 98e0f6345ad98531b3a3016a632c20b4d9129e39 Author: Janusz Krzysztofik Date: Sat Apr 2 21:51:55 2022 +0200 ARM: OMAP1: Prepare for conversion of OMAP1 clocks to CCF In preparation for conversion of OMAP1 clocks to common clock framework, identify arch/arm/mach-omap1 local users of those clocks and update them to call clk_prepare_enable/clk_disable_unprepare() instead of just clk_enable/disable(), as required by CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 615dce5bf7369334f8c4f19f7f8f2a5634b4f911 Author: Arnd Bergmann Date: Thu Sep 12 10:11:24 2019 +0200 ARM: omap1: fix build with no SoC selected In a multiplatform randconfig kernel, one can have CONFIG_ARCH_OMAP1 enabled, but none of the specific SoCs. This leads to some build issues as the code is not meant to deal with this configuration at the moment: arch/arm/mach-omap1/io.c:86:20: error: unused function 'omap1_map_common_io' [-Werror,-Wunused-function] arch/arm/mach-omap1/pm.h:113:2: error: "Power management for this processor not implemented yet" [-Werror,-W#warnings] Use the same trick as on OMAP2 and guard the actual compilation of platform code with another Makefile ifdef check based on an option that depends on having at least one SoC enabled. The io.c file still needs to get compiled to allow building device drivers with a dependency on CONFIG_ARCH_OMAP1. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 7e0a9e622dbe465f66cb1841d071acfe9ceaa32f Author: Arnd Bergmann Date: Tue Aug 6 16:16:03 2019 +0200 ARM: omap1: move mach/*.h into mach directory Most of the header files are no longer referenced from outside arch/arm/mach-omap1, so move them all to that place directly and change their users to use the new location. The exceptions are: - mach/compress.h is used by the core architecture code - mach/serial.h is used by mach/compress.h The mach/memory.h is empty and gets removed in the process, avoiding the need for CONFIG_NEED_MACH_MEMORY_H. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit df99e7bbbec3180693b3d932a9cbc88346e2a30e Author: Arnd Bergmann Date: Tue Aug 6 20:42:29 2019 +0200 ARM: omap1: use pci_remap_iospace() for omap_cf The ISA I/O space handling in omap_cf is incompatible with PCI drivers in a multiplatform kernel, and requires a custom mach/io.h. Change the driver to use pci_remap_iospace() like PCI drivers do, so the generic ioport access can work across platforms. To actually use that code, we have to select CONFIG_PCI here. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit c8b8a93a0a3d3204c9d801d18fb98a5c04ff0b7c Author: Arnd Bergmann Date: Wed Aug 14 15:42:27 2019 +0200 ARM: omap1: relocate static I/O mapping The address range 0xfee00000-0xfeffffff is used for PCI and PCMCIA I/O port mappings, but OMAP1 has its static mappings there as well. Move the OMAP1 addresses a little higher to avoid crashing at boot. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit e37a0bca8260a2a3348499ab20ce8586e763d211 Author: Arnd Bergmann Date: Mon Oct 7 23:26:33 2019 +0200 ARM: omap: remove empty plat-omap directory The last file in this directory is gone, and it can be removed as well. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 11237651e22c7dee1d0822c132805de23b9ed384 Author: Arnd Bergmann Date: Fri Sep 20 18:16:09 2019 +0200 ARM: omap: un-merge plat/sram.c The sram initialization code is the only shared omap1/2 code that is not a standalone driver, but it is very short. Having two copies of this code means some duplication of the sources, but actually saves object code size as it can be inlined better. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 04e8d9d139c9fca2717b65a46333dd1cfd87dc28 Author: Arnd Bergmann Date: Fri Sep 20 17:44:32 2019 +0200 ARM: omap: split up arch/arm/plat-omap/Kconfig All the remaining features in here are either omap1 or omap2plus specific, so move them into the respective Kconfig files. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 16630718ee467cda33fc3f410a84bcaf909c1fa1 Author: Arnd Bergmann Date: Fri Nov 27 14:05:55 2020 +0100 ARM: omap1: move plat/dma.c to mach/omap-dma.c Most of the interface functions in plat/dma.c are only used from the USB driver, which is practically OMAP1 specific, except for compile testing. The omap_get_plat_info(), omap_request_dma() and omap_free_dma() functions are never called on omap2 because of runtime checks. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 19491c2215f638c9198b9b33e227aeccf76b22b8 Author: Arnd Bergmann Date: Fri Nov 27 14:16:21 2020 +0100 ARM: omap1: dma: remove omap2 specific bits No part of plat-omap/dma.c is called on omap2 any more, so anything omap2 specific in here can simply be removed. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 52ef8efcb75e8a8aab88e74c1376c2785d9a5452 Author: Arnd Bergmann Date: Sat Apr 2 00:28:23 2022 +0200 dma: omap: hide legacy interface The legacy interface for omap-dma is only used on OMAP1, and the same is true for the non-DT case. Make both of these conditional on CONFIG_ARCH_OMAP1 being set to simplify the dependency. The non-OMAP stub functions in include/linux/omap-dma.h are note needed any more either now, because they are only called on OMAP1. Acked-by: Tony Lindgren Acked-By: Vinod Koul Signed-off-by: Arnd Bergmann commit 0e48711f602064705bf81eebe6f627ee1bc11d3b Author: kernel test robot Date: Thu Apr 21 23:09:46 2022 +0800 drm: bridge: dw_hdmi: Audio: fix returnvar.cocci warnings drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:80:5-8: Unneeded variable: "ret". Return "0" on line 94 drivers/gpu/drm/bridge/synopsys/dw-hdmi-gp-audio.c:105:5-8: Unneeded variable: "ret". Return "0" on line 112 Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci CC: Sandor Yu Reported-by: kernel test robot Signed-off-by: kernel test robot Reviewed-by: Sandor Yu Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/YmFzutFV/iDyEQF2@dd18de969aa6 commit 0f01017191384e3962fa31520a9fd9846c3d352f Author: Andrey Smirnov Date: Sun Apr 3 09:49:07 2022 -0700 usb: dwc3: Don't switch OTG -> peripheral if extcon is present If the extcon device exists, get the mode from the extcon device. If the controller is DRD and the driver is unable to determine the mode, only then default the dr_mode to USB_DR_MODE_PERIPHERAL. Cc: Felipe Balbi Cc: Thinh Nguyen Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Thinh Nguyen Signed-off-by: Andrey Smirnov Link: https://lore.kernel.org/r/20220403164907.662860-1-andrew.smirnov@gmail.com Signed-off-by: Greg Kroah-Hartman commit f29dabda7917d293926b2f756747c6c1d4054444 Author: Bjorn Andersson Date: Fri Apr 8 14:48:35 2022 -0700 interconnect: qcom: Add SC8280XP interconnect provider The Qualcomm SC8280XP provides the means for the OS to request bus bandwidth using RPMh. It consists of providers for each of the busses in the SoC and two virtual providers, for the "memory controller" and a few of "virtual clocks". Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220408214835.624494-2-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit ea3364db9068e37bd8e12b9a99c7c92385593ed7 Author: Bjorn Andersson Date: Fri Apr 8 14:48:34 2022 -0700 dt-bindings: interconnect: qcom: Add sc8280xp binding The Qualcomm SC8280XP platform has the usual set of busses, add a binding for these interconnect providers and port definitions to allow interconnect paths to be expressed in the sc8280xp DeviceTree. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220408214835.624494-1-bjorn.andersson@linaro.org Signed-off-by: Georgi Djakov commit f70925bf99406150d8133e775e49c9c459f78733 Merge: 9c8774e629a19 59f0c2447e255 Author: Paolo Abeni Date: Fri Apr 22 09:56:00 2022 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/microchip/lan966x/lan966x_main.c d08ed852560e ("net: lan966x: Make sure to release ptp interrupt") c8349639324a ("net: lan966x: Add FDMA functionality") Signed-off-by: Paolo Abeni commit 99faef48e7a3f878848a2d711af710e36fadbd6e Author: Yunbo Yu Date: Wed Apr 20 20:27:54 2022 +0800 dmaengine: mv_xor_v2 : Move spin_lock_bh() to spin_lock() It is unnecessary to call spin_lock_bh() for that you are already in a tasklet. Signed-off-by: Yunbo Yu Link: https://lore.kernel.org/r/20220420122754.148359-1-yuyunbo519@gmail.com Signed-off-by: Vinod Koul commit 63c14ae6c161dec8ff3be49277edc75a769e054a Author: Dave Jiang Date: Wed Apr 20 09:43:36 2022 -0700 dmaengine: idxd: refactor wq driver enable/disable operations Move the core driver operations from wq driver to the drv_enable_wq() and drv_disable_wq() functions. The move should reduce the wq driver's knowledge of the core driver operations and prevent code confusion for future wq drivers. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165047301643.3841827.11222723219862233060.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit bc67cac1032679ba5bcd8f2767f661248c2a0c9a Author: Takashi Iwai Date: Thu Apr 21 17:29:08 2022 +0200 selftests: firmware: Add ZSTD compressed file tests It's similar like XZ compressed files. For the simplicity, both XZ and ZSTD tests are done in a single function. The format is specified via $COMPRESS_FORMAT and the compression function is pre-defined. Link: https://lore.kernel.org/r/20210127154939.13288-5-tiwai@suse.de Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220421152908.4718-6-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit f18b45ff9ac7ff05beeebd62d7c25d58f38b1410 Author: Takashi Iwai Date: Thu Apr 21 17:29:07 2022 +0200 selftests: firmware: Simplify test patterns The test patterns are almost same in three sequential tests. Make the unified helper function for improving the readability. Link: https://lore.kernel.org/all/20210127154939.13288-1-tiwai@suse.de/ Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220421152908.4718-5-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit 04c826d0726720bc69617a291fad6e482ecf83d6 Author: Takashi Iwai Date: Thu Apr 21 17:29:06 2022 +0200 selftests: firmware: Fix the request_firmware_into_buf() test for XZ format The test uses a different firmware name, and we forgot to adapt for the XZ compressed file tests. https://lore.kernel.org/all/20210127154939.13288-1-tiwai@suse.de/ Fixes: 1798045900b7 ("selftests: firmware: Add request_firmware_into_buf tests") Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220421152908.4718-4-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit b3625b1324a56ff1194734c9b84a51b05e14a419 Author: Takashi Iwai Date: Thu Apr 21 17:29:05 2022 +0200 selftests: firmware: Use smaller dictionary for XZ compression The xz -9 option leads to an unnecessarily too large dictionary that isn't really suitable for the kernel firmware loader. Pass the dictionary size explicitly, instead. While we're at it, make the xz command call defined in $RUN_XZ for simplicity. Fixes: 108ae07c5036 ("selftests: firmware: Add compressed firmware tests") Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220421152908.4718-3-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit 23cfbc6ec44e5e80d5522976ff45ffcdcddfb230 Author: Takashi Iwai Date: Thu Apr 21 17:29:04 2022 +0200 firmware: Add the support for ZSTD-compressed firmware files As the growing demand on ZSTD compressions, there have been requests for the support of ZSTD-compressed firmware files, so here it is: this patch extends the firmware loader code to allow loading ZSTD files. The implementation is fairly straightforward, it just adds a ZSTD decompression routine for the file expander. (And the code is even simpler than XZ thanks to the ZSTD API that gives the original decompressed size from the header.) Link: https://lore.kernel.org/all/20210127154939.13288-1-tiwai@suse.de/ Tested-by: Piotr Gorski Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220421152908.4718-2-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman commit b21fe492a3a9831c315eb456cf5480c9490eaeef Author: Jayesh Choudhary Date: Thu Apr 21 12:23:23 2022 +0530 dmaengine: ti: k3-psil-am62: Update PSIL thread for saul. Correct the RX PSIL thread for sa3ul. Signed-off-by: Jayesh Choudhary Fixes: 5ac6bfb587772 ("dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data") Link: https://lore.kernel.org/r/20220421065323.16378-1-j-choudhary@ti.com Signed-off-by: Vinod Koul commit e235fe3bcf831dabd67bc2d9b75cad53311a16ec Author: Vinod Koul Date: Thu Apr 21 10:54:07 2022 +0530 dmaengine: ptdma: statify pt_tx_status LKP bot reports a new warning: Warning: drivers/dma/ptdma/ptdma-dmaengine.c:262:1: warning: no previous prototype for 'pt_tx_status' [-Wmissing-prototypes] pt_tx_status() should be static, so declare as such. Reported-by: kernel test robot Fixes: d965068259d1 ("dmaengine: PTDMA: support polled mode") Link: https://lore.kernel.org/r/20220421052407.745637-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 19df0cfa258cd42f7f106f6085f1e625f26283db Merge: c54b39a565227 40d8d4bd06720 Author: Dave Airlie Date: Fri Apr 22 06:43:52 2022 +1000 Merge tag 'drm-misc-next-2022-04-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.19-rc1 UAPI Changes: Cross-subsystem Changes: - of: Create a platform_device for offb Core Changes: - edid: block read refactoring - ttm: Add common debugfs code for resource managers Driver Changes: - bridges: - adv7611: Enable DRM_BRIDGE_OP_HPD if there's an interrupt - anx7625: Fill ELD if no monitor is connected - dw_hdmi: Add General Parallel Audio support - icn6211: Add data-lanes DT property - new driver: Lontium LT9211 - nouveau: make some structures static - tidss: Reset DISPC on startup - solomon: SPI Support and DT bindings improvements Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220421065948.2pyp3j7acxtl6pz5@houat commit 0cb63670d5052767391e3e1df51ebbffef8b6420 Author: Lv Ruyi Date: Thu Apr 21 08:44:12 2022 +0000 ata: Make use of the helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately.Make the code simpler without functional changes. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Damien Le Moal commit e0af10ac4dcce334ef8cc36c8e146c0b932b4f81 Author: Diego Viola Date: Thu Apr 21 01:54:23 2022 -0300 ata: libata-core: replace "its" with "it is" and "isn't" with "is not". The former fixes the typo while the latter just uses the same formal language. Signed-off-by: Diego Viola Signed-off-by: Damien Le Moal commit 5716fb0d403e4edaca5de76b548081f0da1c5c6a Author: Dan Williams Date: Wed Apr 20 20:27:26 2022 -0700 ahci: Add a generic 'controller2' RAID id Intel server platforms that support 'RAID', i.e. have platform firmware support for software-RAID metadata + features that the kernel also understands, maintain the same device-ids for RAID from generation to generation. This is in contrast to client platforms that have tended to roll new device-ids every platform generation. However, even though server platform keep the ids there are still unique device-ids per controller instance. To date there have only been 2 controllers on these platforms, but platforms code named Emmitsburg add a third controller. Add the device-id for this third controller and collect it with the other generic server RAID ids. As mentioned here [1], the pain of continuing add new and different device-ids for RAID mode to this file [2] has been heard. Ideally this device-id would not matter and the class code would remain PCI_CLASS_STORAGE_SATA_AHCI regardless of the RAID mode, but other operating systems depend on the class code *not* being AHCI when the device is in RAID mode. That said, going forward there is little reason for new server RAID ids to be added as they can simply reuse one of the existing ids even for a new controller. Server software RAID features continue to be supported on Linux. Client software RAID features continue to be not supported and the recommendation there remains to set the device to AHCI mode in platform firmware. Link: https://lore.kernel.org/all/8e61fb0104422e8d70701e2ddc7b1ca53f009797.camel@intel.com [1] Link: https://lore.kernel.org/all/20201119165022.GA3582@infradead.org/ [2] Cc: Damien Le Moal Cc: Christoph Hellwig Cc: Mika Westerberg Signed-off-by: Dan Williams Reviewed-by: Christoph Hellwig Signed-off-by: Damien Le Moal commit 10a5a651e3afc9b0b381f47e8930972e4e918397 Author: Zqiang Date: Thu Mar 31 13:57:17 2022 +0800 workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs When a CPU is going offline, all workers on the CPU's pool will have their cpus_allowed cleared to cpu_possible_mask and can run on any CPUs including the isolated ones. Instead, set cpus_allowed to wq_unbound_cpumask so that the can avoid isolated CPUs. Signed-off-by: Zqiang Signed-off-by: Tejun Heo commit 7112e0b0a58be8575547eba6596c42710922674f Author: Nícolas F. R. A. Prado Date: Thu Apr 7 21:39:50 2022 -0400 drm/mediatek: dpi: Use mt8183 output formats for mt8192 The configuration for mt8192 was incorrectly using the output formats from mt8173. Since the output formats for mt8192 are instead the same ones as for mt8183, which require two bus samples per pixel, the pixelclock and DDR edge setting were misconfigured. This made external displays unable to show the image. Fix the issue by correcting the output format for mt8192 to be the same as for mt8183, fixing the usage of external displays for mt8192. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220408013950.674477-1-nfraprado@collabora.com/ Fixes: be63f6e8601f ("drm/mediatek: dpi: Add output bus formats to driver data") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen Signed-off-by: Chun-Kuang Hu commit 885a0d09fd416cf484fba7db7109d3374f71f899 Author: Yongqiang Niu Date: Thu Apr 21 13:12:18 2022 +0800 drm/mediatek: Add display support for MT8186 Add mmsys driver data and compatible for MT8186 in mtk_drm_drv.c. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220421051218.8652-2-rex-bc.chen@mediatek.com/ Signed-off-by: Yongqiang Niu Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 78f815c1cf8fc5f05dc5cec29eb1895cb53470e9 Author: Chia-I Wu Date: Fri Apr 15 17:33:14 2022 -0700 drm/msm: return the average load over the polling period simple_ondemand interacts poorly with clamp_to_idle. It only looks at the load since the last get_dev_status call, while it should really look at the load over polling_ms. When clamp_to_idle true, it almost always picks the lowest frequency on active because the gpu is idle between msm_devfreq_idle/msm_devfreq_active. This logic could potentially be moved into devfreq core. Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") Signed-off-by: Chia-I Wu Cc: Rob Clark Link: https://lore.kernel.org/r/20220416003314.59211-3-olvaffe@gmail.com Signed-off-by: Rob Clark commit 15c411980bacddf294452fd1cf7308b14f3f8c63 Author: Chia-I Wu Date: Fri Apr 15 17:33:13 2022 -0700 drm/msm: simplify gpu_busy callback Move tracking and busy time calculation to msm_devfreq_get_dev_status. Signed-off-by: Chia-I Wu Cc: Rob Clark Link: https://lore.kernel.org/r/20220416003314.59211-2-olvaffe@gmail.com Signed-off-by: Rob Clark commit 69f06a5d854f28ee65e15c20e488f21a063c1968 Author: Chia-I Wu Date: Fri Apr 15 17:33:12 2022 -0700 drm/msm: remove explicit devfreq status reset It is redundant since commit 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints") because dev_pm_qos_update_request triggers get_dev_status. Signed-off-by: Chia-I Wu Cc: Rob Clark Link: https://lore.kernel.org/r/20220416003314.59211-1-olvaffe@gmail.com Signed-off-by: Rob Clark commit a636a0ff11483a4c158acc31ee7ca083d98a0d13 Author: Rob Clark Date: Mon Apr 11 14:58:39 2022 -0700 drm/msm: Add a way for userspace to allocate GPU iova The motivation at this point is mainly native userspace mesa driver in a VM guest. The one remaining synchronous "hotpath" is buffer allocation, because guest needs to wait to know the bo's iova before it can start emitting cmdstream/state that references the new bo. By allocating the iova in the guest userspace, we no longer need to wait for a response from the host, but can just rely on the allocation request being processed before the cmdstream submission. Allocation failures (OoM, etc) would just be treated as context-lost (ie. GL_GUILTY_CONTEXT_RESET) or subsequent allocations (or readpix, etc) can raise GL_OUT_OF_MEMORY. v2: Fix inuse check v3: Change mismatched iova case to -EBUSY Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Reviewed-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220411215849.297838-11-robdclark@gmail.com Signed-off-by: Rob Clark commit 95d1deb02a9c93bf9ea8cebe61f0c26cadf43cf9 Author: Rob Clark Date: Mon Apr 11 14:58:38 2022 -0700 drm/msm/gem: Add fenced vma unpin With userspace allocated iova (next patch), we can have a race condition where userspace observes the fence completion and deletes the vma before retire_submit() gets around to unpinning the vma. To handle this, add a fenced unpin which drops the refcount but tracks the fence, and update msm_gem_vma_inuse() to check any previously unsignaled fences. v2: Fix inuse underflow (duplicate unpin) v3: Fix msm_job_run() vs submit_cleanup() race condition Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220411215849.297838-10-robdclark@gmail.com Signed-off-by: Rob Clark commit 27674c666826d758884d61dbfa8476347bed469d Author: Rob Clark Date: Mon Apr 11 14:58:37 2022 -0700 drm/msm/gem: Split vma lookup and pin This way we only lookup vma once per object per submit, for both the submit and retire path. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220411215849.297838-9-robdclark@gmail.com Signed-off-by: Rob Clark commit 522f1abffe90a38e5f22d0112aba8b9a2eae8cf3 Author: Rob Clark Date: Mon Apr 11 14:58:36 2022 -0700 drm/msm/gem: Rework vma lookup and pin Combines duplicate vma lookup in the get_and_pin path. Signed-off-by: Rob Clark Reviewed-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220411215849.297838-8-robdclark@gmail.com Signed-off-by: Rob Clark commit d413e6f9713422a473ed51618016cee2c5239aed Author: Rob Clark Date: Mon Apr 11 14:58:35 2022 -0700 drm/msm: Drop msm_gem_iova() There was only a single user, which could just as easily stash the iova when pinning. v2: fix prepare->prepare->cleanup->cleanup sequences Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220411215849.297838-7-robdclark@gmail.com Signed-off-by: Rob Clark commit 2ee4b5d265363f19903bbeae2ffc67d4850d408f Author: Rob Clark Date: Mon Apr 11 14:58:34 2022 -0700 drm/msm/gem: Drop PAGE_SHIFT for address space mm Get rid of all the unnecessary conversion between address/size and page offsets. It just confuses things. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220411215849.297838-6-robdclark@gmail.com Signed-off-by: Rob Clark commit ca35ab2a2059c08799f0d0c5fcab8a6cc4d89dbd Author: Rob Clark Date: Mon Apr 11 14:58:33 2022 -0700 drm/msm/gem: Split out inuse helper Prep for a following patch, where it gets a bit more complicated. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220411215849.297838-5-robdclark@gmail.com Signed-off-by: Rob Clark commit 8e30fa32392ccd69bf80e83463e43aa15711ce34 Author: Rob Clark Date: Mon Apr 11 14:58:32 2022 -0700 drm/msm/gem: Convert some missed GEM_WARN_ON()s Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220411215849.297838-4-robdclark@gmail.com Signed-off-by: Rob Clark commit f9d5355fa5b6b25c3b6e1727bc36d11bb8c8ee24 Author: Rob Clark Date: Mon Apr 11 14:58:31 2022 -0700 drm/msm/gpu: Drop duplicate fence counter The ring seqno counter duplicates the fence-context last_fence counter. They end up getting incremented in lock-step, on the same scheduler thread, but the split just makes things less obvious. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220411215849.297838-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 695383a1386c57ea723ff54ea99f49222deed3fd Author: Rob Clark Date: Mon Apr 11 14:58:30 2022 -0700 drm/msm/gem: Move prototypes These belong more cleanly in the gem header. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220411215849.297838-2-robdclark@gmail.com Signed-off-by: Rob Clark commit d4726d7700688835f4784d3b94de6fff2cbe16c2 Author: Rob Clark Date: Thu Mar 17 09:51:40 2022 -0700 drm/msm: Add a way to override processes comm/cmdline In the cause of using the GPU via virtgpu, the host side process is really a sort of proxy, and not terribly interesting from the PoV of crash/fault logging. Add a way to override these per process so that we can see the guest process's name. v2: Handle kmalloc failure, add comment to explain kstrdup returns NULL if passed NULL [Dan Carpenter] Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220317165144.222101-4-robdclark@gmail.com Signed-off-by: Rob Clark commit 39ba0c0d6cd13e9ae5fe0a75313efdbb3449d87a Author: Rob Clark Date: Thu Mar 17 09:51:39 2022 -0700 drm/msm: Split out helper to get comm/cmdline Deduplicate this from fault_worker and recover_worker. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220317165144.222101-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 4bfba71640f8578b3daadb551d6bce12a2d436d8 Author: Rob Clark Date: Thu Mar 17 09:51:38 2022 -0700 drm/msm: Add support for pointer params The 64b value field is already suffient to hold a pointer instead of immediate, but we also need a length field. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220317165144.222101-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 1019933385132c88e6aeb1846344ff2bd939127a Author: Rob Clark Date: Fri Feb 25 12:26:13 2022 -0800 drm/msm: Remove unused field in submit Noticed this was unused and never set. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220225202614.225197-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 651877176c0846616add00f50b719ea6d59dff8d Author: Rob Clark Date: Sat Sep 4 10:06:03 2021 -0700 drm/fourcc: Add QCOM tiled modifiers These are mainly used internally in mesa, although I believe the display should be able to scan out the TILED3 format. Currently we define this modifier internally in mesa for use with modifier based allocation. But we can get rid of that hack if we define the modfiers properly. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210904170603.1739137-1-robdclark@gmail.com Signed-off-by: Rob Clark commit 8fd7c2144d1292f15c901211750dee021ed5079a Author: Luis Chamberlain Date: Thu Apr 21 11:38:43 2022 -0700 ftrace: fix building with SYSCTL=y but DYNAMIC_FTRACE=n Ok so hopefully this is the last of it. 0day picked up a build failure [0] when SYSCTL=y but DYNAMIC_FTRACE=n. This can be fixed by just declaring an empty routine for the calls moved just recently. [0] https://lkml.kernel.org/r/202204161203.6dSlgKJX-lkp@intel.com Reported-by: kernel test robot Fixes: f8b7d2b4c192 ("ftrace: fix building with SYSCTL=n but DYNAMIC_FTRACE=y") Acked-by: Steven Rostedt (Google) Signed-off-by: Luis Chamberlain commit e15c9d06e9ad70df41285ca41d535de6215e0b21 Author: Bokun Zhang Date: Thu Apr 21 13:57:03 2022 -0400 drm/amd/amdgpu: Update PF2VF header - In the latest version of the header, there is a variable name change. This should not cause any backward compatibility since the variable is at the same offset in the struct. Signed-off-by: Bokun Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 451913e9804f4466cdc2ac9599510fbfee267f30 Author: Bokun Zhang Date: Thu Apr 21 13:56:26 2022 -0400 drm/amd/amdgpu: Properly indent PF2VF header - Clean up the identation in the header file Signed-off-by: Bokun Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c649287aba50fdaa003f7e75f0b1ab3919beb4de Author: Bokun Zhang Date: Thu Apr 21 13:55:45 2022 -0400 drm/amd/amdgpu: Update MIT license in SRIOV msg header - Update MIT license header Signed-off-by: Bokun Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 72f05e3b96b25ebbc572938b9fd8a1e930834eb2 Author: Alex Deucher Date: Thu Apr 21 10:09:08 2022 -0400 drm/amdgpu/display: make hubp31_program_extended_blank static It's not used outside of dcn31_hubp.c. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e4f1e3a282c17cffba6fc7ad316387d5499550d0 Author: Miaoqian Lin Date: Thu Apr 21 17:03:09 2022 +0800 drm/amd/display: Fix memory leak in dcn21_clock_source_create When dcn20_clk_src_construct() fails, we need to release clk_src. Fixes: 6f4e6361c3ff ("drm/amd/display: Add Renoir resource (v2)") Signed-off-by: Miaoqian Lin Signed-off-by: Alex Deucher commit 754fc1824be6e279b410b411554c87ba0d15d93e Author: Haowen Bai Date: Thu Apr 21 18:28:58 2022 +0800 drm/amd/display: Remove useless code aux_rep only memset but no use at all, so we drop it. Signed-off-by: Haowen Bai Signed-off-by: Alex Deucher commit 4020c2280233279ea682a7f2f24b54426416d91d Author: Alex Deucher Date: Tue Dec 28 17:26:24 2021 -0500 drm/amdgpu: don't runtime suspend if there are displays attached (v3) We normally runtime suspend when there are displays attached if they are in the DPMS off state, however, if something wakes the GPU we send a hotplug event on resume (in case any displays were connected while the GPU was in suspend) which can cause userspace to light up the displays again soon after they were turned off. Prior to commit 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's."), the driver took a runtime pm reference when the fbdev emulation was enabled because we didn't implement proper shadowing support for vram access when the device was off so the device never runtime suspended when there was a console bound. Once that commit landed, we now utilize the core fb helper implementation which properly handles the emulation, so runtime pm now suspends in cases where it did not before. Ultimately, we need to sort out why runtime suspend in not working in this case for some users, but this should restore similar behavior to before. v2: move check into runtime_suspend v3: wake ups -> wakeups in comment, retain pm_runtime behavior in runtime_idle callback Fixes: 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Link: https://lore.kernel.org/r/20220403132322.51c90903@darkstar.example.org/ Tested-by: Michele Ballabio Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 515d7cebc2e2d2b4f0a276d26f3b790a83cdfe06 Author: Lang Yu Date: Wed Apr 20 10:24:31 2022 +0800 Revert "drm/amdkfd: only allow heavy-weight TLB flush on some ASICs for SVM too" This reverts commit 36bf93216ecbe399c40c5e0486f0f0e3a4afa69e. It causes SVM regressions on Vega10 with XNACK-ON. Just revert it at the moment. ./kfdtest --gtest_filter=KFDSVMRangeTest.MigratePolicyTest Signed-off-by: Lang Yu Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit e50d9ba0d2cd0cb4dd18e2a41a83fe21d3b046b8 Author: Candice Li Date: Sun Apr 17 18:50:27 2022 +0800 drm/amdgpu: Add debugfs TA load/unload/invoke support v1: Add debugfs support to load/unload/invoke TA in runtime. v2: 1. Update some variables to static. 2. Use PAGE_ALIGN to calculate shared buf size directly. 3. Remove fp check. 4. Update debugfs from read to write. Signed-off-by: John Clements Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fe96e5636acf4243834bc1686f6ee8264b7a68dd Author: Candice Li Date: Sun Apr 17 17:39:46 2022 +0800 drm/amdgpu: Use indirect buffer and save response status for TA load/invoke The upcoming TA debugfs interface needs to use indirect buffer when performing TA invoke and check psp response status for TA load and invoke. Signed-off-by: John Clements Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cb55f27ac9326bfe3bcaaf0adb498778d64602b6 Author: Meng Tang Date: Mon Apr 11 13:12:05 2022 +0800 fs/proc: Introduce list_for_each_table_entry for proc sysctl Use the list_for_each_table_entry macro to optimize the scenario of traverse ctl_table. This make the code neater and easier to understand. Suggested-by: Davidlohr Bueso Signed-off-by: Meng Tang [updated the sysctl_check_table() hunk due to some changes upstream] Signed-off-by: Luis Chamberlain commit 3c6a4cba3138d1aeeb8fd917178c6578b9b8ae29 Author: Luis Chamberlain Date: Fri Apr 15 15:08:02 2022 -0700 mm: fix unused variable kernel warning when SYSCTL=n When CONFIG_SYSCTL=n the variable dirty_bytes_min which is just used as a minimum to a proc handler is not used. So just move this under the ifdef for CONFIG_SYSCTL. Fixes: aa779e510219 ("mm: move page-writeback sysctls to their own file") Reported-by: kernel test robot Acked-by: Andrew Morton Signed-off-by: Luis Chamberlain commit 988f11e046401f8561c4afefa506a50f0203de40 Author: liaohua Date: Thu Apr 7 15:29:48 2022 +0800 latencytop: move sysctl to its own file This moves latencytop sysctl to kernel/latencytop.c Signed-off-by: liaohua Signed-off-by: Luis Chamberlain commit c3429de5b139c7e3765df1d18446d02a5ada7f74 Merge: aa4c06e02b413 d2be77b382328 Author: Mark Brown Date: Thu Apr 21 19:37:35 2022 +0100 ASoC: SOF: AMD updates Merge series from Pierre-Louis Bossart : Small updates for the AMD SoF drivers. commit f15856d7de914595d0daa2c706f53a693b48e228 Author: Tomas Winkler Date: Tue Apr 19 12:33:13 2022 -0700 drm/i915/dg2: add gsc with special gsc bar offsets DG2 uses different GSC offsets on memory bar and uses PXP head (HECI1). v2 (Daniele): Rebased to before the ATS patches Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio #v1 Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-7-daniele.ceraolospurio@intel.com commit 1bc22fc53a536c051bfbcc377ed50eb217c1fe7e Author: Alexander Usyskin Date: Tue Apr 19 12:33:12 2022 -0700 mei: gsc: retrieve the firmware version Add a hook to retrieve the firmware version of the GSC devices to bus-fixup. GSC has a different MKHI clients GUIDs but the same message structure to retrieve the firmware version as MEI so mei_fwver() can be reused. CC: Ashutosh Dixit Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-6-daniele.ceraolospurio@intel.com commit ad10a35461a5fc4e4d09a7259ede2508f042c6dd Author: Tomas Winkler Date: Tue Apr 19 12:33:11 2022 -0700 mei: gsc: add runtime pm handlers Implement runtime handlers for mei-gsc, to track idle state of the device properly. CC: Rodrigo Vivi Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin Reviewed-by: Rodrigo Vivi Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-5-daniele.ceraolospurio@intel.com commit ce97126d6c1825fc7b3dd21a66a83458055bcbd7 Author: Alexander Usyskin Date: Tue Apr 19 12:33:10 2022 -0700 mei: gsc: setup char driver alive in spite of firmware handshake failure Setup char device in spite of firmware handshake failure. In order to provide host access to the firmware status registers and other information required for the manufacturing process. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-4-daniele.ceraolospurio@intel.com commit a98c30fdc00e146daed013598f10708d6b0ef11e Author: Tomas Winkler Date: Tue Apr 19 12:33:09 2022 -0700 mei: add support for graphics system controller (gsc) devices GSC is a graphics system controller, based on CSE, it provides a chassis controller for graphics discrete cards, as well as it supports media protection on selected devices. mei_gsc binds to a auxiliary devices exposed by Intel discrete driver i915. v2: fix error check in mei_gsc_probe v3: update MODULE_LICENSE ("GPL" is preferred over "GPL v2" and they both map to GPL version 2) Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Acked-by: Rodrigo Vivi #v3 Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-3-daniele.ceraolospurio@intel.com commit 1e3dc1d8622b2699e6cf1cc06885105b13c9c514 Author: Tomas Winkler Date: Tue Apr 19 12:33:08 2022 -0700 drm/i915/gsc: add gsc as a mei auxiliary device GSC is a graphics system controller, it provides a chassis controller for graphics discrete cards. There are two MEI interfaces in GSC: HECI1 and HECI2. Both interfaces are on the BAR0 at offsets 0x00258000 and 0x00259000. GSC is a GT Engine (class 4: instance 6). HECI1 interrupt is signaled via bit 15 and HECI2 via bit 14 in the interrupt register. This patch exports GSC as auxiliary device for mei driver to bind to for HECI2 interface and prepares for HECI1 interface as it will follow up soon. CC: Rodrigo Vivi Signed-off-by: Tomas Winkler Signed-off-by: Vitaly Lubart Signed-off-by: Alexander Usyskin Acked-by: Tvrtko Ursulin Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220419193314.526966-2-daniele.ceraolospurio@intel.com commit f8b7d2b4c192118c37ab24c0540d1134dd0104d8 Author: Luis Chamberlain Date: Fri Apr 15 14:29:57 2022 -0700 ftrace: fix building with SYSCTL=n but DYNAMIC_FTRACE=y One can enable dyanmic tracing but disable sysctls. When this is doen we get the compile kernel warning: CC kernel/trace/ftrace.o kernel/trace/ftrace.c:3086:13: warning: ‘ftrace_shutdown_sysctl’ defined but not used [-Wunused-function] 3086 | static void ftrace_shutdown_sysctl(void) | ^~~~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c:3068:13: warning: ‘ftrace_startup_sysctl’ defined but not used [-Wunused-function] 3068 | static void ftrace_startup_sysctl(void) When CONFIG_DYNAMIC_FTRACE=n the ftrace_startup_sysctl() and routines ftrace_shutdown_sysctl() still compiles, so these are actually more just used for when SYSCTL=y. Fix this then by just moving these routines to when sysctls are enabled. Fixes: 7cde53da38a3 ("ftrace: move sysctl_ftrace_enabled to ftrace.c") Reported-by: kernel test robot Acked-by: Steven Rostedt (Google) Signed-off-by: Luis Chamberlain commit 6dd4a29d26200d303d354ee8fc806113b5fcc882 Author: Rafael J. Wysocki Date: Thu Apr 14 14:58:42 2022 +0200 ACPI: PM: Always print final debug message in acpi_device_set_power() acpi_device_set_power() prints debug messages regarding its outcome (whether or not the power state has been changed and how) in all cases except when the device whose power state is being changed to D0 is in that power state already. Make acpi_device_set_power() print a final debug message in that case too and while at it, fix the indentation of the "end" label in this function. Signed-off-by: Rafael J. Wysocki commit e1e1f4e32594d117d9f90e7743d33a019139fc9f Merge: 0f9fc0c1eff01 c54b39a565227 Author: Rodrigo Vivi Date: Thu Apr 21 13:44:55 2022 -0400 Merge drm/drm-next into drm-intel-gt-next In order to get the GSC Support merged on drm-intel-gt-next in a clean fashion we needed this ATS-M patch to avoid conflict in i915_pci.c: commit 412c942bdfae ("drm/i915/ats-m: add ATS-M platform info") -- Fixing a silent conflict on drivers/gpu/drm/i915/gt/intel_gt_gmch.c: - if (!intel_vtd_active(i915)) + if (!i915_vtd_active(i915)) Signed-off-by: Rodrigo Vivi commit aa4c06e02b4139c378ba8d20d767d6d1cf6a2ad8 Author: Pierre-Louis Bossart Date: Thu Apr 21 11:36:45 2022 -0500 ASoC: Intel: sof_ssp_amp: remove 'set-but-not-used' warning Clang warning: >> sound/soc/intel/boards/sof_ssp_amp.c:97:6: warning: variable 'i' set but not used [-Wunused-but-set-variable] int i = 0; ^ The device counter is not used when the quirk is not set, which static analysis cannot know. Move its initialization before the loop to remove this warning. Reported-by: kernel test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220421163645.319686-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d2be77b382328b46a79635bfd9e959a96bb6ac29 Author: Ajit Kumar Pandey Date: Thu Apr 21 11:58:20 2022 -0500 ASoC: SOF: amd: Use dedicated MBOX for ACP and PSP communication We are currently using generic PSP Mailbox register for sending SHA complete command to PSP but observe random arbitration issue during PSP validation as MP0_C2PMSG_26_REG used by other kernel modules. Use separate mailbox registers and doorbell mechanism to send SHA_DMA complete command to PSP. This fixes such validation issues and added flexibility for sending more ACP commands to PSP in future as new mbox registers i.e MP0_C2PMSG_114_REG and MP0_C2PMSG_73_REG are dedicated by PSP for ACP communications. Reviewed-by: Ranjani Sridharan Reviewed-by: Bard Liao Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421165820.337207-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bbdcd3d590cad744db46cb94649833db3575df49 Author: Ajit Kumar Pandey Date: Thu Apr 21 11:58:19 2022 -0500 ASoC: SOF: amd: Add psp_mbox_ready() and psp_send_cmd() callback We need to ensure if PSP is mbox ready before and after sending cmd to PSP over SMN interface. Add method to check MBOX_READY bit of PSP with some delay over ACP_PSP_TIMEOUT_COUNTER. Replace psp_fw_validate with new method psp_send_cmd() to send command via psp mailbox. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421165820.337207-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5c29e864999763baec9eedb9ea5bd557aa4cbd77 Author: AngeloGioacchino Del Regno Date: Mon Apr 4 16:55:58 2022 +0200 usb: musb: mediatek: Use clk_bulk API to simplify clock operations This driver uses three clocks and there's no special handling, they're either enabled or disabled sequentially: migrate to the clk_bulk API to simplify clock handling. This patch brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220404145558.93340-1-angelogioacchino.delregno@collabora.com Signed-off-by: Greg Kroah-Hartman commit ab3a560ae8e2795b8069b4587792d1b49c20e671 Author: 周琰杰 (Zhou Yanjie) Date: Fri Apr 15 03:25:37 2022 +0800 MIPS: Ingenic: Refresh USB nodes to match driver changes. Refresh USB nodes in the jz4780.dtsi, x1000.dtsi, and x1830.dtsi files. Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1649964337-114337-4-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Greg Kroah-Hartman commit d712b725b84dc1623d826b3232d706c7e9e53a4f Author: 周琰杰 (Zhou Yanjie) Date: Fri Apr 15 03:25:36 2022 +0800 USB: dwc2: Add OTG support for Ingenic SoCs. Add OTG support for the JZ4775 SoC, the JZ4780 SoC, the X1000 SoC, the X1600 SoC, the X1700 SoC, the X1830 SoC, and the X2000 SoC from Ingenic. Introduce support for disable Ingenic overcurrent detection, once selected, it enables the GOTGCTL register bits VbvalidOvEn and VbvalidOvVal to disable the VBUS overcurrent detection. This patch is derived from Dragan Čečavac (in the kernel 3.18.3 tree of CI20). It is very useful for the MIPS Creator CI20 (r1). Without this patch, OTG port of CI20 has a great probability to face overcurrent warning, which breaks the OTG functionality. Acked-by: Minas Harutyunyan Signed-off-by: Dragan Čečavac Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1649964337-114337-3-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Greg Kroah-Hartman commit 9cd6576f46be175f7ef0769554ce120470bb2ccf Author: 周琰杰 (Zhou Yanjie) Date: Fri Apr 15 03:25:35 2022 +0800 dt-bindings: dwc2: Add bindings for new Ingenic SoCs. Add the dwc2 bindings for the JZ4775 SoC, the JZ4780 SoC, the X1000 SoC, the X1600 SoC, the X1700 SoC, the X1830 SoC, and the X2000 SoC from Ingenic. Acked-by: Rob Herring Signed-off-by: 周琰杰 (Zhou Yanjie) Link: https://lore.kernel.org/r/1649964337-114337-2-git-send-email-zhouyanjie@wanyeetech.com Signed-off-by: Greg Kroah-Hartman commit 8666009c5f8327d13d4c91a2139b361b41ab43c2 Author: Tom Rix Date: Tue Apr 19 14:21:42 2022 -0400 usb: gadget: net2272: clean up comments Spelling replacements definiton to definition acceptible to acceptable seperately to separately Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220419182142.1805918-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 53b0c69f35bd71a8f7abc5411ef23c0588bbb328 Author: Tom Rix Date: Sun Apr 17 09:07:12 2022 -0400 usb: gadget: tegra-xudc: clean up comments Spelling replacements endpiont to endpoint Compliacne to Compliance Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220417130712.3932247-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit e707ec4d043502308209e3cce568f40f09c86d27 Author: Tom Rix Date: Mon Apr 18 09:36:19 2022 -0400 usb: gadget: s3c-hsudc: clean up comments Spelling replacements occured to occurred currenty to currently Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220418133619.2852678-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 77e00508c29626500c2c70655b66aaa323a03b33 Author: Tom Rix Date: Mon Apr 18 09:48:38 2022 -0400 usb: gadget: pxa27x_udc: clean up comment Spelling replacement endpoitn to endpoint Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220418134838.1236023-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 2a0a71d92d150548360150cb8b57c82409d8d9c6 Author: Tom Rix Date: Mon Apr 18 10:39:06 2022 -0400 USB: omap_udc: clean up comment Spelling replacement reactiviting to reactivating Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220418143906.475932-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 4f8cfe675f4666117c93420783049eff04c3ceba Author: Sergey Shtylyov Date: Mon Apr 18 23:33:55 2022 +0300 usb: core: devices: remove dead code under #ifdef PROC_EXTRA usb_dump_hub_descriptor() and usb_dump_string() are defined under #ifdef PROC_EXTRA (while PROC_EXTRA doesn't seem to have ever been #define'd) since the dawn of the git era -- remove this dead code at last... Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/ec08915b-faf2-2f0b-dfb1-048dfa2c67f3@omp.ru Signed-off-by: Greg Kroah-Hartman commit 424bef51fa530389b0b9008c9e144e40c10e8458 Author: Miaoqian Lin Date: Wed Mar 9 11:10:33 2022 +0000 usb: musb: Fix missing of_node_put() in omap2430_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 8934d3e4d0e7 ("usb: musb: omap2430: Don't use omap_get_control_dev()") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220309111033.24487-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7e824f28c9d7275471aa98509a7e3c8369fae379 Author: Michael Grzeschik Date: Wed Apr 6 21:29:14 2022 +0200 usb: gadget: f_acm: add support for USB_CDC_REQ_SEND_BREAK Currently the usb side setting of the USB_CDC_REQ_SEND_BREAK control is not supported. This patch adds the support. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220406192914.3302636-1-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 6a7c7df993bd3c90014453ec59a7b455613cf0e4 Author: Dan Vacura Date: Wed Apr 20 13:33:38 2022 -0500 usb: dwc3: gadget: increase tx fifo size for ss isoc endpoints Improve performance of isoc transfers in superspeed by increasing the number of possible endpoints available, matching that of what was configured for bulk transfers. Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20220420183338.445622-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit a85f023022f0e094b82ab43c44cb69cc19603631 Author: Janusz Krzysztofik Date: Sat Apr 2 13:43:53 2022 +0200 usb: host: ohci-omap: Make it CCF clk API compatible The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. Acked-by: Alan Stern Signed-off-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220402114353.130775-1-jmkrzyszt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 24a5d34d7b01b2bff4ddb65af0731ac230169153 Author: Janusz Krzysztofik Date: Sat Apr 2 13:26:58 2022 +0200 usb: gadget: omap_udc: Make it CCF clk API compatible The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20220402112658.130191-1-jmkrzyszt@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0fee30ab63512b4cc3ed0136ffb042399f9493ab Author: Kushagra Verma Date: Sun Mar 27 16:26:33 2022 +0530 USB / dwc3: Fix three doc-build warnings Two kerneldoc comments in gadget.c have excess function parameter description or wrong prototype name and one kerneldoc comment in core.c has an excess function parameter description, resulting in these three doc-build warnings: 1. ./drivers/usb/dwc3/gadget.c:675: warning: Excess function parameter 'nfifos' description in 'dwc3_gadget_calc_tx_fifo_size' 2. ./drivers/usb/dwc3/gadget.c:700: warning: expecting prototype for dwc3_gadget_clear_tx_fifo_size(). Prototype was for dwc3_gadget_clear_tx_fifos() instead 3. ./drivers/usb/dwc3/core.c:347: warning: Excess function parameter 'ref_clk_per' description in 'dwc3_ref_clk_period' Fix the warnings by correcting the prototype name and removing excess parameter descriptions. Signed-off-by: Kushagra Verma Link: https://lore.kernel.org/r/SI2PR01MB392995043CACD80884A13764F81C9@SI2PR01MB3929.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman commit f21949c1496807571ed3d09ed22e0ebeaec3e643 Author: Alex Williamson Date: Wed Apr 20 14:45:05 2022 -0600 PCI/doc: Update obsolete pci_set_dma_mask() references The function is dma_set_mask(), fix a missed instance of the old pci_set_dma_mask() and a reference to a function that doesn't exist. Fixes: 05b0ebd06ae6 ("PCI/doc: cleanup references to the legacy PCI DMA API") Link: https://lore.kernel.org/r/165048747271.2959320.13475081883467312497.stgit@omen Signed-off-by: Alex Williamson Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit 8a722fe86e5678b12ea576f4d07c2374603ec181 Author: Krzysztof Kozlowski Date: Tue Apr 19 14:08:27 2022 +0200 dt-bindings: usb: samsung,exynos-usb2: add missing required reg "reg" property is required on Samsung S5PV210/Exynos EHCI/OHCI controllers. Fixes: 4bf2283cb208 ("dt-bindings: usb: samsung,exynos-usb2: convert to dtschema") Reviewed-by: Alim Akhtar Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419120827.249627-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 1e2b2f06c1be6f9676ed99f36bc263f1cda12c9c Author: Krzysztof Kozlowski Date: Tue Apr 19 14:10:13 2022 +0200 dt-bindings: usb: samsung,exynos-usb2: include usb-hcd schema Remove parts duplicated with usb-hcd.yaml DT schema and include it directly. Reviewed-by: Rob Herring Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220419121013.250023-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit b92ffb1eddd9a66a90defc556dcbf65a43c196c7 Author: Lin Ma Date: Tue Apr 12 22:43:59 2022 +0800 USB: storage: karma: fix rio_karma_init return The function rio_karam_init() should return -ENOMEM instead of value 0 (USB_STOR_TRANSPORT_GOOD) when allocation fails. Similarly, it should return -EIO when rio_karma_send_command() fails. Fixes: dfe0d3ba20e8 ("USB Storage: add rio karma eject support") Acked-by: Alan Stern Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20220412144359.28447-1-linma@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 67ec2c75f37780e0e825d0beb2fb4892c8a93c6a Author: Guo Zhengkui Date: Thu Apr 7 18:04:52 2022 +0800 usb: gadget: net2280: use swap() instead of open coding it Address the following coccicheck warning: drivers/usb/gadget/udc/net2280.c:940:20-21: WARNING opportunity for swap(). drivers/usb/gadget/udc/net2280.c:944:25-26: WARNING opportunity for swap(). by using swap() for the swapping of variable values and drop the tmp variables (`tmp` and `end`) that are not needed any more. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220407100459.3605-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman commit b8a19881337678c02bb3d72ae821602e1a4c377d Author: Jiapeng Chong Date: Thu Apr 7 14:24:10 2022 +0800 usb: gadget: u_audio: clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/usb/gadget/function/u_audio.c:1182 g_audio_setup() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220407062410.89214-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman commit 134a3408c2d3f7e23eb0e4556e0a2d9f36c2614e Author: Zhen Ni Date: Wed Mar 2 11:37:16 2022 +0800 USB: host: isp116x: check return value after calling platform_get_resource() It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Signed-off-by: Zhen Ni Link: https://lore.kernel.org/r/20220302033716.31272-1-nizhen@uniontech.com Signed-off-by: Greg Kroah-Hartman commit 5bf4b20dc19090fef115f20d63d0adc6267d2928 Author: Minghao Chi Date: Wed Mar 9 05:36:11 2022 +0000 usb:oxu210hp-hcd: Use platform_get_irq() to get the interrupt It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220309053611.2081191-1-chi.minghao@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 9c00c7c92265434fadc597435e98c0aca3b749ac Author: Souradeep Chowdhury Date: Wed Apr 6 15:03:48 2022 +0530 arm64: dts: qcom: sc7280: Set the default dr_mode for usb2 Set the default dr_mode for usb2 node to "otg" to enable role-switch for EUD(Embedded USB Debugger) connector node. Signed-off-by: Souradeep Chowdhury Link: https://lore.kernel.org/r/451392a942f90aa9805b00afad7dff894604d189.1649235218.git.quic_schowdhu@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 0b059979090d72b3e8eca1cb18daa8da70400211 Author: Souradeep Chowdhury Date: Wed Apr 6 15:03:47 2022 +0530 arm64: dts: qcom: sc7280: Add EUD dt node and dwc3 connector Add the Embedded USB Debugger(EUD) device tree node. The node contains EUD base register region and EUD mode manager register regions along with the interrupt entry. Also add the typec connector node for EUD which is attached to EUD node via port. EUD is also attached to DWC3 node via port. Also add the role-switch property to dwc3 node. Signed-off-by: Souradeep Chowdhury Link: https://lore.kernel.org/r/17a6127d1f0e4e3bac023dacf60a9ba93c1e21d1.1649235218.git.quic_schowdhu@quicinc.com Signed-off-by: Greg Kroah-Hartman commit ba6df3ea68196d54a1e8299cea1bf4565fc755c5 Author: Lin Ma Date: Thu Apr 7 10:21:10 2022 +0800 usb-storage: isd200: fix initFunction error return The initFunction is called when probing a new device, its call relation is like: USB core: probe() -> usb_stor_probe2() -> usb_stor_acquire_resources() -> isd200_init_info() That is, the error return of the initFunction should tell USB core what happened instead of using custom error code like ISD200_ERROR. Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20220407022110.3757-1-linma@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 1abf67983a4fd74133b3d2b43722704c744621a6 Author: Lin Ma Date: Thu Apr 7 10:21:15 2022 +0800 usb-storage: shuttle_usbat: fix initFunction error return The initFunction is called when probing a new device, its call relation is like: USB core: probe() -> usb_stor_probe2() -> usb_stor_acquire_resources() -> init_usbat_cd() or init_usbat_flash() -> init_usbat() That is, the error return of the initFunction should tell USB core what happened instead of using constant or error code like USB_STOR_TRANSPORT_FAILED. Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20220407022115.3773-1-linma@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 17b2fb9c231ea418fa6c8643f2c786ec991b56f5 Author: Lin Ma Date: Thu Apr 7 10:20:58 2022 +0800 usb-storage: alauda: fix initFunction error return The initFunction is called when probing a new device, its call relation is like: USB core: probe() -> usb_stor_probe2() -> usb_stor_acquire_resources() -> init_alauda() That is, the error return of the initFunction should tell USB core what happened instead of using error code like USB_STOR_TRANSPORT_ERROR. Signed-off-by: Lin Ma Link: https://lore.kernel.org/r/20220407022058.3741-1-linma@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit eafc69a488111aa3b18794602ecc52acbef84288 Author: Christophe Leroy Date: Fri Apr 15 10:34:12 2022 +0200 usb: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up in a further step, first clean all files that include asm/prom.h Some files don't need asm/prom.h at all. For those ones, just remove inclusion of asm/prom.h Some files don't need any of the items provided by asm/prom.h, but need some of the headers included by asm/prom.h. For those ones, add the needed headers that are brought by asm/prom.h at the moment, then remove asm/prom.h Some files really need asm/prom.h but also need some of the headers included by asm/prom.h. For those one, leave asm/prom.h but also add the needed headers so that they can be removed from asm/prom.h in a later step. Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/295e87a3094a92784657f7060fb0927e762a2e3c.1650011506.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit d088fabace2ca337b275d1d4b36db4fe7771e44f Author: Niels Dossche Date: Tue Apr 12 18:50:55 2022 +0200 usb: usbip: add missing device lock on tweak configuration cmd The function documentation of usb_set_configuration says that its callers should hold the device lock. This lock is held for all callsites except tweak_set_configuration_cmd. The code path can be executed for example when attaching a remote USB device. The solution is to surround the call by the device lock. This bug was found using my experimental own-developed static analysis tool, which reported the missing lock on v5.17.2. I manually verified this bug report by doing code review as well. I runtime checked that the required lock is not held. I compiled and runtime tested this on x86_64 with a USB mouse. After applying this patch, my analyser no longer reports this potential bug. Fixes: 2c8c98158946 ("staging: usbip: let client choose device configuration") Reviewed-by: Shuah Khan Signed-off-by: Niels Dossche Link: https://lore.kernel.org/r/20220412165055.257113-1-dossche.niels@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9ec4cbf1cc55d126759051acfe328d489c5d6e60 Author: Hangyu Hua Date: Tue Apr 12 10:02:57 2022 +0800 usb: usbip: fix a refcount leak in stub_probe() usb_get_dev() is called in stub_device_alloc(). When stub_probe() fails after that, usb_put_dev() needs to be called to release the reference. Fix this by moving usb_put_dev() to sdev_free error path handling. Find this by code review. Fixes: 3ff67445750a ("usbip: fix error handling in stub_probe()") Reviewed-by: Shuah Khan Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220412020257.9767-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman commit b71a2ebf74ef509b6b6926c78549e183c3b63947 Author: Gaosheng Cui Date: Thu Apr 21 11:18:03 2022 +0800 libbpf: Remove redundant non-null checks on obj_elf Obj_elf is already non-null checked at the function entry, so remove redundant non-null checks on obj_elf. Signed-off-by: Gaosheng Cui Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220421031803.2283974-1-cuigaosheng1@huawei.com commit c14766a8a8f3d6c75bf09ec3b6d9ce4d8217015a Author: Artem Savkov Date: Thu Apr 21 11:43:20 2022 +0200 selftests/bpf: Fix map tests errno checks Switching to libbpf 1.0 API broke test_lpm_map and test_lru_map as error reporting changed. Instead of setting errno and returning -1 bpf calls now return -Exxx directly. Drop errno checks and look at return code directly. Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK") Signed-off-by: Artem Savkov Signed-off-by: Andrii Nakryiko Reviewed-by: Yafang Shao Link: https://lore.kernel.org/bpf/20220421094320.1563570-1-asavkov@redhat.com commit 6a12b8e20d7e72386594a9dbe7bf2d7fae3b3aa6 Author: Artem Savkov Date: Thu Apr 21 15:23:17 2022 +0200 selftests/bpf: Fix prog_tests uprobe_autoattach compilation error I am getting the following compilation error for prog_tests/uprobe_autoattach.c: tools/testing/selftests/bpf/prog_tests/uprobe_autoattach.c: In function ‘test_uprobe_autoattach’: ./test_progs.h:209:26: error: pointer ‘mem’ may be used after ‘free’ [-Werror=use-after-free] The value of mem is now used in one of the asserts, which is why it may be confusing compilers. However, it is not dereferenced. Silence this by moving free(mem) after the assert block. Fixes: 1717e248014c ("selftests/bpf: Uprobe tests should verify param/return values") Signed-off-by: Artem Savkov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220421132317.1583867-1-asavkov@redhat.com commit e8784c0aec03a2581ee55827ba694e129d6a57ad Author: Aswath Govindraju Date: Thu Apr 14 16:02:09 2022 +0530 drivers: usb: dwc3: Add AM62 USB wrapper driver In AM62 SoC, the Designware Core USB3 IP is progammed to operate in USB2.0 only mode. Add driver for AM62 USB DWC3 Wrapper. Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220414103211.16202-3-a-govindraju@ti.com Signed-off-by: Greg Kroah-Hartman commit ee11ae36b2c8e3b11a6eff4bf51eb3065ce5f94b Author: Aswath Govindraju Date: Thu Apr 14 16:02:08 2022 +0530 dt-bindings: usb: Add documentation for AM62 USB Wrapper module Add bindings for the TI's AM62 wrapper module for the Synopsys USBSS-DRD controller. Reviewed-by: Rob Herring Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220414103211.16202-2-a-govindraju@ti.com Signed-off-by: Greg Kroah-Hartman commit 92440202a88009ef66a236001981513e03a300fb Author: Guido Günther Date: Thu Mar 17 16:45:12 2022 +0100 usb: typec: tipd: Only update power status on IRQ Instead of refetching power status cache it and only update it when a change is signalled via irq. This simplifies tracing and adding more supply properties in follow up patches. Signed-off-by: Guido Günther Signed-off-by: Sebastian Krzyszkowiak Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220317154518.4082046-2-sebastian.krzyszkowiak@puri.sm Signed-off-by: Greg Kroah-Hartman commit 38c695e1e2a2caaacb3b2dc5cddbba5e8024412f Author: Tanveer Alam Date: Mon Mar 28 16:21:37 2022 +0530 usb: typec: mux: intel_pmc_mux: Add retry logic to a PMC command There are few scenerio when PMC reports 'busy condition' and command fail. If PMC receives a high priority command while servicing a low priority command then it discards the low priority command and start servicing the high priority command. The lower priority command fail and driver returns error. If the same command resend to the PMC then PMC latches the command and service it accordingly. Thus adds the retry logic for the PMC command. Reviewed-by: Heikki Krogerus Signed-off-by: Tanveer Alam Link: https://lore.kernel.org/r/20220328105137.6223-1-tanveer1.alam@intel.com Signed-off-by: Greg Kroah-Hartman commit aef11279888c00e1841a3533a35d279285af3a51 Author: Michael Grzeschik Date: Sun Apr 3 01:27:44 2022 +0200 usb: gadget: uvc: improve sg exit condition The exit condition to quit iterating over the sg_list, while encoding the sg entries, has to consider the case that the dma_len of the entry could be zero. This patch takes this condition to account. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220402232744.3622565-4-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9b969f93bcef9b3d9e92f1810e22bbd6c344a0e5 Author: Michael Grzeschik Date: Sun Apr 3 01:27:43 2022 +0200 usb: gadget: uvc: giveback vb2 buffer on req complete On uvc_video_encode_isoc_sg the mapped vb2 buffer is returned to early. Only after the last usb_request worked with the buffer it is allowed to give it back to vb2. This patch fixes that. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220402232744.3622565-3-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 61aa709ca58a0dbeeb817bfa9230c1a92979f2c6 Author: Michael Grzeschik Date: Sun Apr 3 01:27:42 2022 +0200 usb: gadget: uvc: rework uvcg_queue_next_buffer to uvcg_complete_buffer The function uvcg_queue_next_buffer is used different than its name suggests. The return value nextbuf is never used by any caller. This patch reworks the function to its actual purpose, by removing the unused code and renaming it. The function name uvcg_complete_buffer makes it more clear that it is actually marking the current video buffer as complete. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220402232744.3622565-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit be30e3502771ac0b5080ec61223d915354cde1cc Author: Dan Vacura Date: Wed Apr 13 14:24:02 2022 -0500 usb: gadget: uvc: remove pause flag use The pause flag doesn't appear to serve a purpose as it is possible for the pump worker thread to not be running when new buffers are queued. Before the following change was introduced: "43cd0023872e usb: gadget: uvc_video: add worker to handle the frame pumping", the pause flag status was discarded and never returned. This masked a current issues of the userspace receiving non-zero values (considered unsuccessful) and prevents trace_v4l2_qbuf() from being called. Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20220413192402.26063-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 324e4f85070f89b58c5f9926370ad19dea907dc7 Author: Dan Vacura Date: Fri Apr 1 11:04:45 2022 -0500 usb: gadget: uvc: allow changing interface name via configfs Add a configfs entry, "function_name", to change the iInterface field for VideoControl. This name is used on host devices for user selection, useful when multiple cameras are present. The default will remain "UVC Camera". Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20220401160447.5919-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman commit 747eea073252b5e30e0e38d04e3fdef7c86f16b5 Author: David Yat Sin Date: Wed Apr 13 11:37:53 2022 -0400 drm/amdkfd: CRIU add support for GWS queues Add support to checkpoint/restore GWS (Global Wave Sync) queues. Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ab4d51d47f26f0eb04e90965877a833885cb8aec Author: David Yat Sin Date: Mon Apr 18 11:55:58 2022 -0400 drm/amdkfd: Fix GWS queue count dqm->gws_queue_count and pdd->qpd.mapped_gws_queue need to be updated each time the queue gets evicted. Fixes: b8020b0304c8 ("drm/amdkfd: Enable over-subscription with >1 GWS queue") Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9c099a379c889da08d225bd110b9baee7b6135c9 Merge: 9423c823e5a54 22cbcb8f4a17c Author: Arnd Bergmann Date: Thu Apr 21 17:14:52 2022 +0200 Merge tag 'samsung-dt64-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM64 changes for v5.19 1. Cleanup: move aliases of board-related features to board in Exynos850. 2. Add specific compatibles to Multi Core Timer to allow stricter DT schema matching. * tag 'samsung-dt64-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: tesla: add a specific compatible to MCT on FSD arm64: dts: exynos: add a specific compatible to MCT arm64: dts: exynos: move aliases to board in Exynos850 Link: https://lore.kernel.org/r/20220420072152.11696-3-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 9423c823e5a54c042646a3746520b761eacf1cc5 Merge: 75e64de871410 9e916fb9bc3d1 Author: Arnd Bergmann Date: Thu Apr 21 17:10:01 2022 +0200 Merge tag 'samsung-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM changes for v5.19 1. Several DT schema related changes to make DTBs passing schema checks: EHCI/OHCI/DMA/Ethernet node names, DMA channels order, USB-like compatibles. 2. Add specific compatibles to Multi Core Timer to allow stricter DT schema matching. 3. Cleanup from deprecated bindings: - Remove deprecated unit-address workaround for Exynos5422 Odroid XU3 LPDDR3 memory timings. - Do not use unit-address (and SFR region) in Exynos5250 MIPI phy in favor of syscon node (unit-address deprecated in 2016). - Use standard generic PHYs for EHCI/OHCI device in S5PV210. 4. Fix inverted SPI CS (thus blank panel) on S5PV210 Aries boards. 5. Correct Bluetooth interupt name on S5PV210 Aries boards. * tag 'samsung-dt-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: s5pv210: align DMA channels with dtschema ARM: dts: s5pv210: Adjust DMA node names to match spec ARM: dts: s5pv210: Adjust memory reg entries to match spec ARM: dts: s5pv210: Correct interrupt name for bluetooth in Aries ARM: dts: s5pv210: Remove spi-cs-high on panel in Aries ARM: dts: s5pv210: Use standard arrays of generic PHYs for EHCI/OHCI device ARM: dts: s5pv210: align EHCI/OHCI nodes with dtschema ARM: dts: exynos: align EHCI/OHCI nodes with dtschema on Exynos4 ARM: dts: exynos: drop deprecated SFR region from MIPI phy ARM: dts: exynos: add a specific compatible to MCT ARM: dts: exynos: remove deprecated unit address for LPDDR3 timings on Odroid ARM: dts: exynos: fix compatible strings for Ethernet USB devices ARM: dts: exynos: fix ethernet node name for different odroid boards Link: https://lore.kernel.org/r/20220420072152.11696-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 75e64de871410da4bd6f79b96cd6155504d66421 Merge: 1ceaccf2b2671 c9bdd50d2019f Author: Arnd Bergmann Date: Thu Apr 21 17:08:54 2022 +0200 Merge tag 'dt-cleanup-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Minor cleanup of ARM DTS for v5.19 Align node names and unit addresses to DT schema and DT coding style in nspire, ox820 and socfpga. * tag 'dt-cleanup-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: socfpga: align interrupt controller node name with dtschema ARM: dts: ox820: align interrupt controller node name with dtschema ARM: dts: nspire: use lower case hex addresses in node unit addresses Link: https://lore.kernel.org/r/20220420072152.11696-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 54711ee4f65d66c2412f72c3af8f61bd3e2d8698 Merge: b2d229d4ddb17 d37b07897e502 Author: Arnd Bergmann Date: Thu Apr 21 17:02:44 2022 +0200 Merge tag 'memory-controller-drv-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.19 1. Exynos: Reduce memory usage/allocation in Exynos5422 DMC driver. 2. Renesas: - Add bindings for R-Car H3/M3/E3. - Simplify single/double data register access. 3. Minor cleanups: TI/EMIF and FSL/Corenet. * tag 'memory-controller-drv-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: fsl-corenet-cf: Use helper function devm_platform_ioremap_resource() memory: renesas-rpc-if: Simplify single/double data register access dt-bindings: memory: renesas,rpc-if: Document R-Car H3/M3/E3 support memory: emif: remove unneeded ENOMEM error messages memory: samsung: exynos5422-dmc: Avoid some over memory allocation Link: https://lore.kernel.org/r/20220420072712.12648-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit d09a7db431c65aaa8303eb456439d1831ca2e6b4 Author: Kuninori Morimoto Date: Thu Apr 21 02:55:58 2022 +0000 ASoC: rsnd: care return value from rsnd_node_fixed_index() Renesas Sound is very complex, and thus it needs to use rsnd_node_fixed_index() to know enabled pin index. It returns error if strange pin was selected, but some codes didn't check it. This patch 1) indicates error message, 2) check return value. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pmlbgn5t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c1d97b866100f354c3381c756e8ea7c4d8f0ccbe Author: Kuninori Morimoto Date: Thu Apr 21 02:56:17 2022 +0000 ASoC: audio-graph-card2: indicate "Experimental stage" warning only when successed Because Sound Card needs many drivers to probe, current audio-graph-card2 will indicate "Experimental stage" at top of probe function even though in case it gets -EPROBE_DEFER, thus it will be indicated many times. This patch indicates it when probe was succeeded. [ 1.601393] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage ... [ 1.721269] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage ... [ 1.755231] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage ... [ 1.907710] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage ... [ 1.933173] rcar_sound ec500000.sound: probed [ 1.948875] asoc-audio-graph-card2 sound: Audio Graph Card2 is still under Experimental stage [ 1.959558] asoc-audio-graph-card2 sound: ak4613-hifi <-> rsnd-dai.0 mapping ok [ 1.968119] asoc-audio-graph-card2 sound: i2s-hifi <-> rsnd-dai.1 mapping ok Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o80vgn5a.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b1384d4c95088d01f4266237faabf165d3d605fc Author: Kuninori Morimoto Date: Thu Apr 21 02:55:27 2022 +0000 ASoC: rsnd: care default case on rsnd_ssiu_busif_err_status_clear() commit cfb7b8bf1e2d66 ("ASoC: rsnd: tidyup rsnd_ssiu_busif_err_status_clear()") merged duplicate code, but it didn't care about default case, and causes smatch warnings. smatch warnings: sound/soc/sh/rcar/ssiu.c:112 rsnd_ssiu_busif_err_status_clear() \ error: uninitialized symbol 'offset'. sound/soc/sh/rcar/ssiu.c:114 rsnd_ssiu_busif_err_status_clear() \ error: uninitialized symbol 'shift'. This patch cares it. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r15rgn6p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 68514c9f6aa676f98328844336fc4400244a8479 Author: Steve Lee Date: Wed Apr 20 13:49:00 2022 +0900 ASoC: dt-bindings: max98390: add reset gpio bindings This adds support for the reset gpio binding. Signed-off-by: Steve Lee Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220420044900.2989-2-steve.lee.analog@gmail.com Signed-off-by: Mark Brown commit 397ff024960634962af93e9e2775fc0e4fe7de92 Author: Steve Lee Date: Wed Apr 20 13:48:59 2022 +0900 ASoC: max98390: Add reset gpio control Add reset gpio control to support RESET PIN connected to gpio. Signed-off-by: Steve Lee Acked-by: Nuno Sá Link: https://lore.kernel.org/r/20220420044900.2989-1-steve.lee.analog@gmail.com Signed-off-by: Mark Brown commit 920fd5e1771db8b338d4145c2d30d60bf0bcce99 Author: Artem Savkov Date: Thu Apr 21 15:01:04 2022 +0200 selftests/bpf: Fix attach tests retcode checks Switching to libbpf 1.0 API broke test_sock and test_sysctl as they check for return of bpf_prog_attach to be exactly -1. Switch the check to '< 0' instead. Fixes: b858ba8c52b6 ("selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK") Signed-off-by: Artem Savkov Signed-off-by: Daniel Borkmann Reviewed-by: Yafang Shao Link: https://lore.kernel.org/bpf/20220421130104.1582053-1-asavkov@redhat.com commit 9d87e41a6d644d4cee66a72fd1656fac5b7850d1 Author: Maciej Fijalkowski Date: Thu Apr 21 15:21:26 2022 +0200 i40e, xsk: Get rid of redundant 'fallthrough' Intel drivers translate actions returned from XDP programs to their own return codes that have the following mapping: XDP_REDIRECT -> I40E_XDP_{REDIR,CONSUMED} XDP_TX -> I40E_XDP_{TX,CONSUMED} XDP_DROP -> I40E_XDP_CONSUMED XDP_ABORTED -> I40E_XDP_CONSUMED XDP_PASS -> I40E_XDP_PASS Commit b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") introduced new translation XDP_REDIRECT -> I40E_XDP_EXIT which is set when XSK RQ gets full and to indicate that driver should stop further Rx processing. This happens for unsuccessful xdp_do_redirect() so it is valuable to call trace_xdp_exception() for this case. In order to avoid I40E_XDP_EXIT -> IXGBE_XDP_CONSUMED overwrite, XDP_DROP case was moved above which in turn made the 'fallthrough' that is in XDP_ABORTED useless as it became the last label in the switch statement. Simply drop this leftover. Fixes: b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220421132126.471515-3-maciej.fijalkowski@intel.com commit e130e8d5434b8732926c3eb71f678dda0d77da61 Author: Maciej Fijalkowski Date: Thu Apr 21 15:21:25 2022 +0200 ixgbe, xsk: Get rid of redundant 'fallthrough' Intel drivers translate actions returned from XDP programs to their own return codes that have the following mapping: XDP_REDIRECT -> IXGBE_XDP_{REDIR,CONSUMED} XDP_TX -> IXGBE_XDP_{TX,CONSUMED} XDP_DROP -> IXGBE_XDP_CONSUMED XDP_ABORTED -> IXGBE_XDP_CONSUMED XDP_PASS -> IXGBE_XDP_PASS Commit c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") introduced new translation XDP_REDIRECT -> IXGBE_XDP_EXIT which is set when XSK RQ gets full and to indicate that driver should stop further Rx processing. This happens for unsuccessful xdp_do_redirect() so it is valuable to call trace_xdp_exception() for this case. In order to avoid IXGBE_XDP_EXIT -> IXGBE_XDP_CONSUMED overwrite, XDP_DROP case was moved above which in turn made the 'fallthrough' that is in XDP_ABORTED useless as it became the last label in the switch statement. Simply drop this leftover. Fixes: c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220421132126.471515-2-maciej.fijalkowski@intel.com commit e9147b4422e1f35b9c229c980c596ccf03d61562 Author: Kumar Kartikeya Dwivedi Date: Fri Apr 15 21:33:43 2022 +0530 bpf: Move check_ptr_off_reg before check_map_access Some functions in next patch want to use this function, and those functions will be called by check_map_access, hence move it before check_map_access. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: Joanne Koong Link: https://lore.kernel.org/bpf/20220415160354.1050687-3-memxor@gmail.com commit 42ba1308074d9046386d58b56e793604be48ce22 Author: Kumar Kartikeya Dwivedi Date: Fri Apr 15 21:33:42 2022 +0530 bpf: Make btf_find_field more generic Next commit introduces field type 'kptr' whose kind will not be struct, but pointer, and it will not be limited to one offset, but multiple ones. Make existing btf_find_struct_field and btf_find_datasec_var functions amenable to use for finding kptrs in map value, by moving spin_lock and timer specific checks into their own function. The alignment, and name are checked before the function is called, so it is the last point where we can skip field or return an error before the next loop iteration happens. Size of the field and type is meant to be checked inside the function. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220415160354.1050687-2-memxor@gmail.com commit a66ab9a9e66ab868de7063622d91442181deba0f Author: Grant Seltzer Date: Wed Apr 20 12:12:26 2022 -0400 libbpf: Add documentation to API functions This adds documentation for the following API functions: - bpf_program__set_expected_attach_type() - bpf_program__set_type() - bpf_program__set_attach_target() - bpf_program__attach() - bpf_program__pin() - bpf_program__unpin() Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220420161226.86803-3-grantseltzer@gmail.com commit df286716321350d1ca370d5737acf5a10b20ee9e Author: Grant Seltzer Date: Wed Apr 20 12:12:25 2022 -0400 libbpf: Update API functions usage to check error This updates usage of the following API functions within libbpf so their newly added error return is checked: - bpf_program__set_expected_attach_type() - bpf_program__set_type() Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220420161226.86803-2-grantseltzer@gmail.com commit 93442f132b94721c7143ace7f43e51a9025f46fd Author: Grant Seltzer Date: Wed Apr 20 12:12:24 2022 -0400 libbpf: Add error returns to two API functions This adds an error return to the following API functions: - bpf_program__set_expected_attach_type() - bpf_program__set_type() In both cases, the error occurs when the BPF object has already been loaded when the function is called. In this case -EBUSY is returned. Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220420161226.86803-1-grantseltzer@gmail.com commit bf3e7f49b49b659aaa0d3b2f231eb18da7794fa2 Author: Michael Walle Date: Sat Mar 26 20:28:48 2022 +0100 pinctrl: ocelot: add clock monitor option for LAN966x The SoC supports a debug clock output of its internal clocks. Depending on the clk_sel input (GPIO_31) clk_mon (GPIO_30) will output either cpu_clk/64 or sys_clk/64. This is very useful for debugging and is missing in the pinmux table. Add it. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220326192848.2944519-2-michael@walle.cc Signed-off-by: Linus Walleij commit e97e36cd3f05cac1bc6333f903540cac523e4348 Author: Michael Walle Date: Sat Mar 26 20:28:47 2022 +0100 pinctrl: ocelot: add pwm output option for LAN966x According to the reference manual, you can mux the PWM output on GPIO27 and GPIO51. This was missing in the pinmux table. Add it. Tested on a LAN9668 on GPIO51. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220326192848.2944519-1-michael@walle.cc Signed-off-by: Linus Walleij commit 61b23e484f9f95d2d5710e2c9078373143c1436e Author: Michael Walle Date: Sat Mar 19 21:46:28 2022 +0100 dt-bindings: pinctrl: convert ocelot-pinctrl to YAML format Convert the ocelot-pinctrl device tree binding to the new YAML format. Additionally to the original binding documentation, add interrupt properties which are optional and already used on several SoCs like SparX-5, Luton, Ocelot and LAN966x but were not documented before. Also, on the sparx5 and the lan966x SoCs there are two items for the reg property. Signed-off-by: Michael Walle Acked-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220319204628.1759635-7-michael@walle.cc Signed-off-by: Linus Walleij commit 203638fd47f1cf20767674050cb78125676959b2 Author: Rohit Agarwal Date: Mon Apr 4 10:34:10 2022 +0530 pinctrl: qcom-pmic-gpio: Add support for pmx65 PMX65 pmic support gpio controller so add compatible. Signed-off-by: Rohit Agarwal Link: https://lore.kernel.org/r/1649048650-14059-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit 2d71025ec454b7a3e9a7f00cb506efca24fd1963 Author: Rohit Agarwal Date: Mon Apr 4 10:34:09 2022 +0530 dt-bindings: pinctrl: qcom-pmic-gpio: Add pmx65 support Add support for the PMX65 GPIO support to the Qualcomm PMIC GPIO binding. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1649048650-14059-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Linus Walleij commit d2b67744fd99b06555b7e4d67302ede6c7c6a638 Author: Stefan Wahren Date: Sat Apr 9 11:51:29 2022 +0200 pinctrl: bcm2835: implement hook for missing gpio-ranges The commit c8013355ead6 ("ARM: dts: gpio-ranges property is now required") fixed the GPIO probing issues caused by "pinctrl: bcm2835: Change init order for gpio hogs". This changed only the kernel DTS files. Unfortunately it isn't guaranteed that these files are shipped to all users. So implement the necessary backward compatibility for BCM2835 and BCM2711 platform. Fixes: 266423e60ea1 ("pinctrl: bcm2835: Change init order for gpio hogs") Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Link: https://lore.kernel.org/r/20220409095129.45786-3-stefan.wahren@i2se.com Signed-off-by: Linus Walleij commit 3550bba25d5587a701e6edf20e20984d2ee72c78 Author: Stefan Wahren Date: Sat Apr 9 11:51:28 2022 +0200 gpiolib: of: Introduce hook for missing gpio-ranges Since commit 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges") the device tree nodes of GPIO controller need the gpio-ranges property to handle gpio-hogs. Unfortunately it's impossible to guarantee that every new kernel is shipped with an updated device tree binary. In order to provide backward compatibility with those older DTB, we need a callback within of_gpiochip_add_pin_range() so the relevant platform driver can handle this case. Fixes: 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges") Signed-off-by: Stefan Wahren Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220409095129.45786-2-stefan.wahren@i2se.com Signed-off-by: Linus Walleij commit b4b157577cb1de13bee8bebc3576f1de6799a921 Author: Jouni Högander Date: Wed Apr 13 11:28:26 2022 +0300 drm/i915: Check EDID for HDR static metadata when choosing blc We have now seen panel (XMG Core 15 e21 laptop) advertizing support for Intel proprietary eDP backlight control via DPCD registers, but actually working only with legacy pwm control. This patch adds panel EDID check for possible HDR static metadata and Intel proprietary eDP backlight control is used only if that exists. Missing HDR static metadata is ignored if user specifically asks for Intel proprietary eDP backlight control via enable_dpcd_backlight parameter. v2 : - Ignore missing HDR static metadata if Intel proprietary eDP backlight control is forced via i915.enable_dpcd_backlight - Printout info message if panel is missing HDR static metadata and support for Intel proprietary eDP backlight control is detected Fixes: 4a8d79901d5b ("drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now)") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5284 Cc: Lyude Paul Cc: Mika Kahola Cc: Jani Nikula Cc: Filippo Falezza Cc: stable@vger.kernel.org Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220413082826.120634-1-jouni.hogander@intel.com Reviewed-by: Lyude Paul commit 062920d2464715ef5cbba52a8573ba12cc882b8f Author: Brian Norris Date: Wed Apr 20 14:22:13 2022 -0700 regulator: core: Sleep (not delay) in set_voltage() These delays can be relatively large (e.g., hundreds of microseconds to several milliseconds on RK3399 Gru systems). Per Documentation/timers/timers-howto.rst, that should usually use a sleeping delay. Let's use the existing regulator delay helper to handle both large and small delays appropriately. This avoids burning a bunch of CPU time and hurting scheduling latencies when hitting regulators a lot (e.g., during cpufreq). The sleep vs. delay issue choice has been made differently over time -- early versions of RK3399 Gru PWM-regulator support used usleep_range() in pwm-regulator.c. More of this got moved into the regulator core, in commits like: 73e705bf81ce regulator: core: Add set_voltage_time op At the same time, the sleep turned into a delay. It's OK to sleep in _regulator_do_set_voltage(), as we aren't in an atomic context. (All our callers grab various mutexes already.) I avoid using fsleep() because it uses a usleep_range() of [N to N*2], and usleep_range() very commonly biases to the high end of the range. We don't want to double the expected delay, especially for long delays. Signed-off-by: Brian Norris Reviewed-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20220420141511.v2.2.If0fc61a894f537b052ca41572aff098cf8e7e673@changeid Signed-off-by: Mark Brown commit a38dce4cb1f1bcc4f6ef7f11e54b6507a4043ebe Author: Brian Norris Date: Wed Apr 20 14:22:12 2022 -0700 regulator: core: Rename _regulator_enable_delay() I want to use it in other contexts besides _regulator_do_enable(). Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220420141511.v2.1.I31ef0014c9597d53722ab513890f839f357fdfb3@changeid Signed-off-by: Mark Brown commit bab76514aca36bc513224525d5598da676938218 Author: Wei Yongjun Date: Thu Apr 21 09:03:35 2022 +0000 regulator: da9121: Fix uninit-value in da9121_assign_chip_model() KASAN report slab-out-of-bounds in __regmap_init as follows: BUG: KASAN: slab-out-of-bounds in __regmap_init drivers/base/regmap/regmap.c:841 Read of size 1 at addr ffff88803678cdf1 by task xrun/9137 CPU: 0 PID: 9137 Comm: xrun Tainted: G W 5.18.0-rc2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x15a lib/dump_stack.c:88 print_report.cold+0xcd/0x69b mm/kasan/report.c:313 kasan_report+0x8e/0xc0 mm/kasan/report.c:491 __regmap_init+0x4540/0x4ba0 drivers/base/regmap/regmap.c:841 __devm_regmap_init+0x7a/0x100 drivers/base/regmap/regmap.c:1266 __devm_regmap_init_i2c+0x65/0x80 drivers/base/regmap/regmap-i2c.c:394 da9121_i2c_probe+0x386/0x6d1 drivers/regulator/da9121-regulator.c:1039 i2c_device_probe+0x959/0xac0 drivers/i2c/i2c-core-base.c:563 This happend when da9121 device is probe by da9121_i2c_id, but with invalid dts. Thus, chip->subvariant_id is set to -EINVAL, and later da9121_assign_chip_model() will access 'regmap' without init it. Fix it by return -EINVAL from da9121_assign_chip_model() if 'chip->subvariant_id' is invalid. Fixes: f3fbd5566f6a ("regulator: da9121: Add device variants") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Adam Ward Link: https://lore.kernel.org/r/20220421090335.1876149-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown commit 8868c03f3ca584abec7bb53d6c3f7c5ab6b60949 Author: Pratyush Yadav Date: Wed Apr 20 15:50:22 2022 +0530 spi: spi-mem: check if data buffers are on stack The buffers passed in the data phase must be DMA-able. Programmers often don't realise this requirement and pass in buffers that reside on the stack. This can be hard to spot when reviewing code. Reject ops if their data buffer is on the stack to avoid this. Signed-off-by: Pratyush Yadav Link: https://lore.kernel.org/r/20220420102022.3310970-1-p.yadav@ti.com Signed-off-by: Mark Brown commit 6a5e69c7ddeacbfcab1ffe501c32e21d7989c0f8 Author: Krzysztof Kozlowski Date: Wed Apr 20 09:03:42 2022 +0200 ARM: s3c: mark as deprecated and schedule removal The Samsung S3C24xx and S3C64xx platforms are very old designs. S3C2416 was introduced in 2008 and S3C6410 in 2009/2010. They are not widely available anymore - out-of-stock on FriendlyArm (one of manufacturers of boards) and only few specialist stores still offer them for quite a high price. The community around these platforms was not very active, so I suspect no one really uses them anymore. Maintenance takes precious time so there is little sense in keeping them alive if there are no real users. Let's mark all S3C24xx and S3C64xx platforms as deprecated and mention possible removal in after 2022 for the first and 2024 for the lattere. The deprecation message will be as text in Kconfig, build message (not a warning though) and runtime print error. If there are any users, they might respond and postpone the removal. Signed-off-by: Krzysztof Kozlowski Acked-by: Heiko Stuebner Acked-by: Tomasz Figa Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220407072319.75614-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 17ea03b75e5665c9ce4945aa5afd097f3c845cdf Author: Arnd Bergmann Date: Fri Nov 27 15:46:47 2020 +0100 ARM: omap: dma: make usb support optional Most of the plat-omap/dma.c code is specific to the USB driver. Hide that code when it is not in use, to make it clearer which parts are actually still required. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 7058e68c2fedf54a5b49ca6f6a4b63edfaea8464 Author: Arnd Bergmann Date: Fri Sep 20 13:47:50 2019 +0200 ARM: omap: remove debug-leds driver It has been impossible to select this driver for six years without anyone noticing, so just kill it completely. Fixes: 54ea18e8866a ("ARM: OMAP2+: Remove board file for H4") Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit d379e8899a8da1041c347ae5b792773c48a559a9 Author: Arnd Bergmann Date: Fri Sep 20 13:57:31 2019 +0200 ARM: omap1: move 32k counter from plat-omap to mach-omap1 omap2 stopped using this code with commit 8d39ff3d1696 ("ARM: OMAP2+: Remove unused legacy code for timer"), so just move it to mach-omap1 now, along with the other half of that driver. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 9fe15316563cbd46601c770a7214ccc5e1925bfb Author: Arnd Bergmann Date: Tue Aug 6 15:13:18 2019 +0200 ARM: omap1: innovator: move ohci phy power handling to board file The innovator board needs a special case for its phy control. Move the corresponding code into the board file and out of the common code by adding another callback. Acked-by: Felipe Balbi Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 0ae41a0b5370f82893b91c9edf977fe17646c12a Author: Arnd Bergmann Date: Tue Aug 6 16:55:58 2019 +0200 input: omap: void using mach/*.h headers The omap-keypad driver currently relies on including mach/memory.h implicitly, but that won't happen once omap1 is converted to CONFIG_ARCH_MULTIPLATFORM. Include the required header explicitly. Acked-by: Dmitry Torokhov Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 9fcd04dde4c472ab6d7473e6815f649bb4abb5e7 Author: Arnd Bergmann Date: Tue Aug 6 16:25:42 2019 +0200 serial: 8250/omap1: include linux/soc/ti/omap1-soc.h As a preparation for cleaning up the omap1 headers, start including linux/soc/ti/omap1-soc.h directly so we can keep calling cpu_is_omap1510(). Acked-by: Greg Kroah-Hartman Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 929527bcf9c9f2a8cf44b502a3bb225802d17280 Author: Arnd Bergmann Date: Tue Aug 6 16:18:29 2019 +0200 clocksource: ti-dmtimer: avoid using mach/hardware.h As a preparation for future omap1 multiplatform support, stop using mach/hardware.h and instead include the omap1-io.h for low-level register access to MOD_CONF_CTRL_1. Acked-by: Daniel Lezcano Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 11e002924ddb6f12638532331195a8ab09bbbf7e Author: Arnd Bergmann Date: Tue Aug 6 16:10:57 2019 +0200 usb: omap: avoid mach/*.h headers The omap usb drivers still rely on mach/*.h headers that are explicitly or implicitly included, but all the required definitions are now in include/linux/soc/ti/, so use those instead and allow compile-testing on other architectures. Acked-by: Greg Kroah-Hartman Acked-by: Felipe Balbi Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 804f7f19c2e2928aeb8eafef8379fe8b8d13f98b Author: Arnd Bergmann Date: Tue Aug 6 16:08:34 2019 +0200 fbdev: omap: avoid using mach/*.h files All the headers we actually need are now in include/linux/soc, so use those versions instead and allow compile-testing on other architectures. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit d87d44f7ab353dde25300ced494f98b69859a539 Author: Arnd Bergmann Date: Mon Aug 5 23:08:58 2019 +0200 ARM: omap1: move CF chipselect setup to board file There is only one board that uses the omap_cf driver, so moving the chipselect configuration there does not lead to code duplication but avoids the use of mach/tc.h in drivers. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 58d37dc1dfd8900892d73da1f26ac1cefca52e6e Author: Arnd Bergmann Date: Mon Aug 5 21:28:15 2019 +0200 ARM: omap1: move perseus spi pinconf to board file The driver has always had a FIXME about this, and it seems like this trivial code move avoids a mach header inclusion, so just do it. With that out of the way, and the header file inclusions changed to global files, the driver can also be compile-tested on other platforms. Acked-by: Mark Brown Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 1e9ca7c811f76b16c7822ad009b6b0c352227a15 Author: Arnd Bergmann Date: Tue Aug 6 15:24:58 2019 +0200 ARM: omap1: move some headers to include/linux/soc There are three remaining header files that are used by omap1 specific device drivers: - mach/soc.h provides cpu_is_omapXXX abstractions - mach/hardware.h provides omap_read/omap_write functions and physical addresses - mach/mux.h provides an omap specific pinctrl abstraction This is generally not how we do platform abstractions today, and it would be good to completely get rid of these in favor of passing information through platform devices and the pinctrl subsystem. However, given that nobody is working on that, just move it one step forward by splitting out the header files that are used by drivers today from the machine headers that are only used internally. Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit e8e77e97507bf3ec5419b8067d242b538cf75cba Author: Arnd Bergmann Date: Tue Aug 6 14:34:31 2019 +0200 ARM: omap1: move mach/usb.h to include/linux/soc The register definitions in this header are used in at least four different places, with little hope of completely cleaning that up. Split up the file into a portion that becomes a linux-wide header under include/linux/soc/ti/, and the parts that are actually only needed by board files. Acked-by: Felipe Balbi Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit cc81e344809cc9aab581f14398facd7104e63e80 Author: Arnd Bergmann Date: Tue Nov 24 21:19:05 2020 +0100 ARM: omap1: ams-delta: remove camera leftovers The obsolete camera support was removed, but a few lines remain in this file and cause a warning: arch/arm/mach-omap1/board-ams-delta.c:462:12: warning: 'ams_delta_camera_power' defined but not used [-Wunused-function] 462 | static int ams_delta_camera_power(struct device *dev, int power) Remove this and all related lines as well. Fixes: ce548396a433 ("media: mach-omap1: board-ams-delta.c: remove soc_camera dependencies") Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 81ad0f5bc476505781b1398be52a81eda3ee9798 Author: Arnd Bergmann Date: Fri Aug 9 21:27:01 2019 +0200 fbdev: omap: pass irqs as resource To avoid relying on the mach/irqs.h header, stop using OMAP_LCDC_IRQ and INT_1610_SoSSI_MATCH directly in the driver code, but instead pass these as resources. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 0768fb6709343679e55f7135e2ed2c432e4500d8 Author: Arnd Bergmann Date: Fri Aug 9 21:42:31 2019 +0200 ARM: omap1: declare a dummy omap_set_dma_priority omapfb calls directly into the omap_set_dma_priority() function in the DMA driver. This prevents compile-testing omapfb on other architectures. Add an inline function next to the other ones for non-omap configurations. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 042c48848b7d8dab4f095bce2872c02f711bf5d0 Author: Arnd Bergmann Date: Mon Aug 5 23:15:37 2019 +0200 ARM: omap1: move lcd_dma code into omapfb driver The omapfb driver is split into platform specific code for omap1, and driver code that is also specific to omap1. Moving both parts into the driver directory simplifies the structure and avoids the dependency on certain omap machine header files. As mach/lcd_dma.h can not be included from include/linux/omap-dma.h any more now, move the omap_lcd_dma_running() declaration into the omap-dma header, which matches where it is defined. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 6f9364746e5a43e5b602812c82a47830bb726268 Author: Arnd Bergmann Date: Tue Aug 6 14:59:00 2019 +0200 ARM: omap1: innovator: pass lcd control address as pdata To avoid using the mach/omap1510.h header file, pass the correct address as platform data. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 7727adb97a6c4e9f14efa42c795650a51778e782 Author: Arnd Bergmann Date: Mon Apr 4 23:18:51 2022 +0200 video: fbdev: omapfb: lcd_ams_delta: fix unused variable warning A recent cleanup patch removed the only reference to a local variable in some configurations. Move the variable into the one block it is still used in, inside of an #ifdef, to avoid this warning. Fixes: 9d773f103b89 ("video: fbdev: omapfb: lcd_ams_delta: Make use of the helper function dev_err_probe()") Acked-by: Tony Lindgren Signed-off-by: Arnd Bergmann commit 8f97344aa04b29acd69e592c3708b9045cf62794 Author: Yang Wang Date: Thu Apr 21 20:34:42 2022 +0800 drm/ttm: use kvcalloc() instead of kvmalloc_array() in ttm_tt v2 simplify programming with existing functions. v2 (chk): minimal coding style cleanup Signed-off-by: Yang Wang Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220421123442.1834102-1-KevinYang.Wang@amd.com Signed-off-by: Christian König commit 9c8774e629a1950c24b44e3c8fb93d76fb644b49 Author: Haowen Bai Date: Mon Apr 18 18:22:13 2022 +0800 net: eql: Use kzalloc instead of kmalloc/memset Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1650277333-31090-1-git-send-email-baihaowen@meizu.com Signed-off-by: Paolo Abeni commit 4facbe3d4426720b65354be1d0f5608c65eebc20 Author: Minghao Chi Date: Mon Apr 18 06:29:21 2022 +0000 drivers: net: davinci_mdio: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220418062921.2557884-1-chi.minghao@zte.com.cn Signed-off-by: Paolo Abeni commit 9f15930bb2ef9f031d62ffc49629cbae89137733 Author: Miaoqian Lin Date: Wed Apr 20 01:16:40 2022 +0000 drm/bridge: Fix error handling in analogix_dp_probe In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call, as already done in the remove function. Fixes: 3424e3a4f844 ("drm: bridge: analogix/dp: split exynos dp driver to bridge directory") Signed-off-by: Miaoqian Lin Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220420011644.25730-1-linmq006@gmail.com commit b6cd9be3d288249f52a1bcb10f7dbd445747ee59 Author: Geert Uytterhoeven Date: Thu Mar 3 13:45:52 2022 +0100 bus: ti-sysc: Drop commas after SoC match table sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven Message-Id: <602f74030dc746eaa9f82f115acc46e62c6be165.1646311501.git.geert+renesas@glider.be> Signed-off-by: Tony Lindgren commit 5c81cfb6a60a7abbfe7520fa13cabdad094d3d39 Author: Adam Ford Date: Mon Feb 21 12:41:07 2022 -0600 ARM: omap2plus_defconfig: Enable ISP176x USB driver The Logic PD Torpedo baseboard has an ISP1763 USB controller attached to the GPMC bus. Enable the driver as a module. Signed-off-by: Adam Ford Message-Id: <20220221184107.2321951-1-aford173@gmail.com> Signed-off-by: Tony Lindgren commit 76e26d985c548fb01ea8852c84f83fb3eb1fea8e Author: Merlijn Wajer Date: Thu Dec 16 16:05:06 2021 +0100 ARM: omap2plus_defconfig: enable TLV320AIC3X Commit a96d2ba2d824 ("ASoC: codecs: tlv320aic3x: move I2C to separated file") split the driver into SPI and I2C code and also provided a separate configuration option for it. The RX51 audio fails to probe since this commit, so let's add this non-obvious configuration option to the defconfig. Signed-off-by: Merlijn Wajer Message-Id: <20211216150506.31163-1-merlijn@wizzup.org> Signed-off-by: Tony Lindgren commit df3eb1feeb73f17776e559679eaa986572db0837 Author: Johan Hovold Date: Thu Mar 3 19:00:14 2022 +0100 ARM: OMAP2+: drop hwmod-clock helper comment Since commit a4f6cdb0672f ("ARM: OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration"), _add_hwmod_clocks_clkdev() is called from omap_device_alloc(). Drop the outdated comment referring to how this function was used ten odd years ago. Signed-off-by: Johan Hovold Message-Id: <20220303180014.2639-3-johan@kernel.org> Signed-off-by: Tony Lindgren commit 7ff07891501341871ac989a372c857a0d1b7a346 Author: Johan Hovold Date: Thu Mar 3 19:00:13 2022 +0100 ARM: OMAP2+: drop omap_device_register() helper The omap_device_register() helper is unused since commit 82f12e64a019 ("ARM: OMAP2+: Drop legacy init for sdma") and can be removed. Signed-off-by: Johan Hovold Message-Id: <20220303180014.2639-2-johan@kernel.org> Signed-off-by: Tony Lindgren commit 883f464c1d23663047eda4f2bcf622365e2d0dd0 Author: Wang Qing Date: Mon Dec 13 01:42:24 2021 -0800 ARM: OMAP2+: add missing of_node_put before break and return Fix following coccicheck warning: WARNING: Function "for_each_matching_node_and_match" should have of_node_put() before return. Early exits from for_each_matching_node_and_match should decrement the node reference counter. Signed-off-by: Wang Qing Message-Id: <1639388545-63615-1-git-send-email-wangqing@vivo.com> [tony@atomide.com: updated for omap_hwmod.c that was already patched] Signed-off-by: Tony Lindgren commit 2917f53113be3b7a0f374e02cebe6d6b749366b5 Author: Jason Gunthorpe Date: Mon Apr 11 16:14:03 2022 +0200 vfio/mdev: Remove mdev drvdata This is no longer used, remove it. All usages were moved over to either use container_of() from a vfio_device or to use dev_drvdata() directly on the mdev. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-35-hch@lst.de Reviewed-by: Kirti Wankhede Reviewed-by: Zhi Wang commit 2aa72ec97ce9eb092cb69efd26f5eb2469e61734 Author: Jason Gunthorpe Date: Mon Apr 11 16:14:02 2022 +0200 vfio/mdev: Use the driver core to create the 'remove' file The device creator is supposed to use the dev.groups value to add sysfs files before device_add is called, not call sysfs_create_files() after device_add() returns. This creates a race with uevent delivery where the extra attribute will not be visible. This was being done because the groups had been co-opted by the mdev driver, now that prior patches have moved the driver's groups to the struct device_driver the dev.group is properly free for use here. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-34-hch@lst.de Reviewed-by: Kirti Wankhede Reviewed-by: Zhi Wang commit 6b42f491e17ce13f5ff7f2d1f49c73a0f4c47b20 Author: Jason Gunthorpe Date: Mon Apr 11 16:14:01 2022 +0200 vfio/mdev: Remove mdev_parent_ops The last useful member in this struct is the supported_type_groups, move it to the mdev_driver and delete mdev_parent_ops. Replace it with mdev_driver as an argument to mdev_register_device() Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-33-hch@lst.de Reviewed-by: Kirti Wankhede Reviewed-by: Zhi Wang commit e6486939d8ea22569af942a1888aa3824f59cc5e Author: Jason Gunthorpe Date: Mon Apr 11 16:14:00 2022 +0200 vfio/mdev: Remove mdev_parent_ops dev_attr_groups This is only used by one sample to print a fixed string that is pointless. In general, having a device driver attach sysfs attributes to the parent is horrific. This should never happen, and always leads to some kind of liftime bug as it become very difficult for the sysfs attribute to go back to any data owned by the device driver. Remove the general mechanism to create this abuse. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-32-hch@lst.de Reviewed-by: Kirti Wankhede Reviewed-by: Zhi Wang commit 6c7f98b334a32df5cac8abac8983ac4ce17cab57 Author: Jason Gunthorpe Date: Mon Apr 11 16:13:59 2022 +0200 vfio/mdev: Remove vfio_mdev.c Now that all mdev drivers directly create their own mdev_device driver and directly register with the vfio core's vfio_device_ops this is all dead code. Delete vfio_mdev.c and the mdev_parent_ops members that are connected to it. Signed-off-by: Jason Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-31-hch@lst.de Reviewed-by: Kirti Wankhede Reviewed-by: Zhi Wang commit cba619cb0d4d66c743cf001c6b13c171a769a65f Author: Christoph Hellwig Date: Mon Apr 11 16:13:58 2022 +0200 drm/i915/gvt: merge gvt.c into kvmgvt.c The code in both files is deeply interconnected, so merge it and keep a bunch of structures and functions static. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-30-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 978cf586ac35f34604e2d252a51b71192c39f1e4 Author: Christoph Hellwig Date: Mon Apr 11 16:13:57 2022 +0200 drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev This is straightforward conversion, the intel_vgpu already has a pointer to the vfio_dev, which can be replaced with the embedded structure and we can replace all the mdev_get_drvdata() with a simple container_of(). Based on an patch from Jason Gunthorpe. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-29-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 0e09f4066ad11bcb4fa1b2d1a6f07fc0dc9788f9 Author: Christoph Hellwig Date: Mon Apr 11 16:13:56 2022 +0200 drm/i915/gvt: remove kvmgt_guest_{init,exit} Merge these into their only callers. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-28-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 7f11e6893ff01b63820a368851ca389293603dbe Author: Christoph Hellwig Date: Mon Apr 11 16:13:55 2022 +0200 drm/i915/gvt: pass a struct intel_vgpu to the vfio read/write helpers Pass the structure we actually care about instead of deriving it from the mdev_device in the lower level code. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-27-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 4456641232e2c1b1eb7d179449c5800b3ce9e9c1 Author: Christoph Hellwig Date: Mon Apr 11 16:13:54 2022 +0200 drm/i915/gvt: streamline intel_vgpu_create Initialize variables at declaration time, avoid pointless gotos and cater for the fact that intel_gvt_create_vgpu can't return NULL. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-26-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 37e4bdbd5bad711c7db5458041416f3925d7aae5 Author: Christoph Hellwig Date: Mon Apr 11 16:13:53 2022 +0200 drm/i915/gvt: remove the extra vfio_device refcounting for dmabufs All the dmabufs are torn down when th VGPU is released, so there is no need for extra refcounting here. Based on an patch from Jason Gunthorpe. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-25-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 5f8f3fe67cd90807f01ebac744c7e6148a8f6cb7 Author: Christoph Hellwig Date: Mon Apr 11 16:13:52 2022 +0200 drm/i915/gvt: remove struct intel_gvt_mpt Just call the initializion and exit functions directly and remove this abstraction entirely. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-24-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 91879bbaf8890fe3595e1e580354462f80dc93de Author: Christoph Hellwig Date: Mon Apr 11 16:13:51 2022 +0200 drm/i915/gvt: devirtualize dma_pin_guest_page Just call the function directly and remove a pointless wrapper. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-23-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 8398eee85fd009bfb2797ea4d0a63b7854d05e46 Author: Christoph Hellwig Date: Mon Apr 11 16:13:50 2022 +0200 drm/i915/gvt: devirtualize ->dma_{,un}map_guest_page Just call the functions directly. Also remove a pointless wrapper. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-22-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 4c2baaaf764bfb6c293c75bc911b9366d35ee085 Author: Christoph Hellwig Date: Mon Apr 11 16:13:49 2022 +0200 drm/i915/gvt: devirtualize ->{enable,disable}_page_track Just call the kvmgt functions directly. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-21-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 4050dab5981cd48f67d2367fa90ae030bcc8f7dd Author: Christoph Hellwig Date: Mon Apr 11 16:13:48 2022 +0200 drm/i915/gvt: devirtualize ->gfn_to_mfn Just open code it in the only caller. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-20-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit bd73b4b193d45074ff48705d21d4fbecc3fcfac8 Author: Christoph Hellwig Date: Mon Apr 11 16:13:47 2022 +0200 drm/i915/gvt: devirtualize ->is_valid_gfn Just call the code directly and move towards the callers. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-19-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit b3bece34956f86dcc8307f20b41a072ccdc917dc Author: Christoph Hellwig Date: Mon Apr 11 16:13:46 2022 +0200 drm/i915/gvt: devirtualize ->inject_msi Just open code the MSI injection in a single place instead of going through the method table. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-18-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 4c705ad0d784fd9ae7160d8c4e0a151abe465dbc Author: Christoph Hellwig Date: Mon Apr 11 16:13:45 2022 +0200 drm/i915/gvt: devirtualize ->detach_vgpu Just call the function directly. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-17-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit f9399b0e4a9555227559f0adaa8e861bedb4b735 Author: Christoph Hellwig Date: Mon Apr 11 16:13:44 2022 +0200 drm/i915/gvt: devirtualize ->set_edid and ->set_opregion Just call the code to setup the opregions and EDID data directly. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-16-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit fe902f0ce686e8dbdaea7dd3c40271640857328a Author: Christoph Hellwig Date: Mon Apr 11 16:13:43 2022 +0200 drm/i915/gvt: devirtualize ->{get,put}_vfio_device Just open code the calls to the VFIO APIs. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-15-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit e3d7640eeeb3066772500581172129a151a1a917 Author: Christoph Hellwig Date: Mon Apr 11 16:13:42 2022 +0200 drm/i915/gvt: devirtualize ->{read,write}_gpa Just call the VFIO functions directly instead of through the method table. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-14-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 3c340d05868d98bfded92c405363fd63bff3ca62 Author: Christoph Hellwig Date: Mon Apr 11 16:13:41 2022 +0200 drm/i915/gvt: remove vgpu->handle Always pass the actual vgpu structure instead of encoding it as a "handle" and add a bool flag to denote if a VGPU is attached. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-13-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 10ddb96295f3bdc6caf4518b8001725440d7a7d2 Author: Christoph Hellwig Date: Mon Apr 11 16:13:40 2022 +0200 drm/i915/gvt: merge struct kvmgt_guest_info into strut intel_vgpu Consolidate the per-VGPU structures into a single one. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-12-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 62980cacc37f58bd054de012d08052dfc4f5fa48 Author: Christoph Hellwig Date: Mon Apr 11 16:13:39 2022 +0200 drm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu Move towards having only a single structure for the per-VGPU state. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-11-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 3cbac24c2cdbfe7174427933a41a1027015d2644 Author: Christoph Hellwig Date: Mon Apr 11 16:13:38 2022 +0200 drm/i915/gvt: remove the unused from_virt_to_mfn op Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-10-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit c977092a9977083f1e73306658182be5123116e3 Author: Christoph Hellwig Date: Mon Apr 11 16:13:37 2022 +0200 drm/i915/gvt: remove the map_gfn_to_mfn and set_trap_area ops The map_gfn_to_mfn and set_trap_area ops are never defined, so remove them and clean up code that depends on them in the callers. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-9-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 675e5c4a33e20cc1924e99cc6f71a42d355c2c31 Author: Christoph Hellwig Date: Mon Apr 11 16:13:36 2022 +0200 drm/i915/gvt: remove intel_gvt_ops Remove these pointless indirect alls by just calling the only instance of each method directly. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-8-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 8b750bf744181ca3eadfb288830d2f42b04adc67 Author: Christoph Hellwig Date: Mon Apr 11 16:13:35 2022 +0200 drm/i915/gvt: move the gvt code into kvmgt.ko Instead of having an option to build the gvt code into the main i915 module, just move it into the kvmgt.ko module. This only requires a new struct with three entries that the KVMGT modules needs to register with the main i915 module, and a proper list of GVT-enabled devices instead of global device pointer. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-7-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit f49fc35799fa63e149ad79f4250a655edfac57a2 Author: Christoph Hellwig Date: Mon Apr 11 16:13:32 2022 +0200 drm/i915/gvt: rename intel_vgpu_ops to intel_vgpu_mdev_ops Free the intel_vgpu_ops symbol name for something that fits better. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-4-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 367748066eeb378bcb1399f1cfa6675c76afc9e1 Author: Christoph Hellwig Date: Mon Apr 11 16:13:31 2022 +0200 drm/i915/gvt: remove enum hypervisor_type The only supported hypervisor is KVM, so don't bother with dead code enumerating hypervisors. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-3-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit a85749e12d66c2cd89d1bce05ef9abca8b5875e9 Author: Christoph Hellwig Date: Mon Apr 11 16:13:30 2022 +0200 drm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor THIS_MODULE always is reference when a symbol called by it is used, so don't bother with the additional reference. Signed-off-by: Christoph Hellwig Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-2-hch@lst.de Reviewed-by: Jason Gunthorpe Reviewed-by: Zhi Wang commit 7f0cf30187cdb1f04d905505ffde910cecf1b35e Author: Jani Nikula Date: Wed Apr 13 15:25:39 2022 +0300 drm/i915/gvt: better align the Makefile with i915 Makefile Drop extra ccflags, drop extra intermediate variables, list object files one per line alphabetically. Cc: Zhi Wang Cc: Christoph Hellwig Signed-off-by: Jani Nikula Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/8bc0895376c077156a671e24ac6a5c75b7db4c9c.1649852517.git.jani.nikula@intel.com Reviewed-by: Zhi Wang Reviewed-by: Christoph Hellwig commit de5d437ae8696ab958903ac199c56c939036e3ea Author: Jani Nikula Date: Wed Apr 13 15:25:38 2022 +0300 drm/i915/gvt: fix trace TRACE_INCLUDE_PATH TRACE_INCLUDE_PATH should be a path relative to define_trace.h, not the file including it. (See the comment in include/trace/define_trace.h.) Cc: Zhi Wang Cc: Christoph Hellwig Signed-off-by: Jani Nikula Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/48b772795b7ab674f609ecad53b4882c66a8262a.1649852517.git.jani.nikula@intel.com Reviewed-by: Zhi Wang Reviewed-by: Christoph Hellwig commit 1672991412dfef000c9f9271558a3713081a4c57 Author: Zhi Wang Date: Thu Apr 7 03:19:45 2022 -0400 i915/gvt: Use the initial HW state snapshot saved in i915 The code of saving initial HW state snapshot has been moved into i915. Let the GVT-g core logic use that snapshot. Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Vivi Rodrigo Cc: Zhenyu Wang Cc: Zhi Wang Signed-off-by: Zhi Wang Reviewed-by: Christoph Hellwig Tested-by: Christoph Hellwig Reviewed-by: Zhenyu Wang Acked-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-4-zhi.a.wang@intel.com commit 66e7a8063381cb2f568cd3436df2f0ec239a84f9 Author: Zhi Wang Date: Thu Apr 7 03:19:44 2022 -0400 i915/gvt: Save the initial HW state snapshot in i915 Save the initial HW state snapshot in i915 so that the rest code of GVT-g can be moved into a dedicated module while it can still get a clean initial HW state saved at the correct time during the initialization of i915. The futhrer vGPU created by GVT-g will use this HW state as the initial HW state. v6: - Remove the reference of intel_gvt_device_info.(Christoph) - Refine the save_mmio() function. (Christoph) Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Vivi Rodrigo Cc: Zhenyu Wang Cc: Zhi Wang Signed-off-by: Zhi Wang Reviewed-by: Christoph Hellwig Tested-by: Christoph Hellwig Reviewed-by: Zhenyu Wang Acked-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-3-zhi.a.wang@intel.com commit e0f74ed4634d6d662e7dca19115d0da1143a3ec0 Author: Zhi Wang Date: Thu Apr 7 03:19:43 2022 -0400 i915/gvt: Separate the MMIO tracking table from GVT-g To support the new mdev interfaces and the re-factor patches from Christoph, which moves the GVT-g code into a dedicated module, the GVT-g MMIO tracking table needs to be separated from GVT-g. v9: - Fix a problem might cause kernel panic. - Remove the redaundant definitation of intel_get_device_type(). (Jani) - Sort the list of header reference in intel_gvt_mmio.c (Jani) - Include minimum header insted in intel_gvt_mmio.c (Jani) v8: - Use SPDX header in the intel_gvt_mmio_table.c - Reference the gvt.h with path. (Jani) - Add a missing fix on mmio emulation path during the debug. - Fix a building problem on refreshed gvt-staging branch. (Christoph) v7: - Keep the marcos of device generation in GVT-g. (Christoph, Jani) v6: - Move the mmio_table.c into i915. (Christoph) - Keep init_device_info and related structures in GVT-g. (Christoph) - Refine the callbacks of the iterator. (Christoph) - Move the flags of MMIO register defination to GVT-g. (Chrsitoph) - Move the mmio block handling to GVT-g. v5: - Re-design the mmio table framework. (Christoph) v4: - Fix the errors of patch checking scripts. v3: - Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani) v2: - Implement a mmio table instead of generating it by marco in i915. (Jani) Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Vivi Rodrigo Cc: Zhenyu Wang Cc: Zhi Wang Signed-off-by: Zhi Wang Reviewed-by: Christoph Hellwig Tested-by: Christoph Hellwig Reviewed-by: Zhenyu Wang Acked-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-2-zhi.a.wang@intel.com commit dff844e1fe17e6c41e5899d46a378f857ea4f354 Author: Yegor Yefremov Date: Tue Apr 19 16:39:23 2022 +0200 ARM: dts: am335x-baltos: update MPU regulator range Update the max MPU voltage range to align with the maximum possible value allowed in the operating-points table, which is max target voltage of 132500 uV + 2%. Signed-off-by: Yegor Yefremov Message-Id: <20220419143923.25196-1-yegorslists@googlemail.com> Signed-off-by: Tony Lindgren commit 521153f25c2f17a2da0e0785b46143baa3bc2d5a Author: Gireesh Hiremath Date: Fri Mar 25 10:06:13 2022 +0000 ARM: dts: am335x: Guardian: Update comments * Add comment to improve readability Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-16-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 762217eaf92545d35833e4a6b48fc3e79bb7ef41 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:12 2022 +0000 ARM: dts: am335x: Guardian: Add gpio line manes * assign name to gpio line Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-15-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 6e049b9a42108eeae494a370b3ea8bb46ade0674 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:11 2022 +0000 ARM: dts: am335x: Guardian: Update interface pinmux * Update interface pinmux for - poweroff button - battery and coincell enable - ASP and Miraculix Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-14-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 783bc2bb4fb10bcc3a9dec14561e9fe2599865f5 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:10 2022 +0000 ARM: dts: am335x: Guardian: Disable DMA property of USB1 * Dispble DMA property of USB1 Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-13-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 2d983a375511bfd8dd2e8df0a3add9fe36484944 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:09 2022 +0000 ARM: dts: am335x: Guardian: Enable UART port two * Add support for uart2 port Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-12-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 60f68df3971b7314bdf7246ca548aac1c12401f5 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:08 2022 +0000 ARM: dts: am335x: Guardian: Update backlight parameter * Update default brightness and dimming frequency * Enable current sink, while initialization Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-11-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 677d855707089982e13cad5ddaaddfd03f889217 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:07 2022 +0000 ARM: dts: am335x: Guardian: Add lcd port * Add port to the node lcdc Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-10-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 228e0021e73337c37536603900332fdb59246d5c Author: Gireesh Hiremath Date: Fri Mar 25 10:06:06 2022 +0000 ARM: dts: am335x: Guardian: Update regulator node name * Update mmcsd voltage regulator node name Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-9-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit b5bf6b434575d32aeaa70c82ec84b3cec92e2973 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:05 2022 +0000 ARM: dts: am335x: Guardian: Update beeper label * Update lable pwm to guardian beeper Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-8-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 6794adf4a2aac7243d17a2420e00146f083116bd Author: Gireesh Hiremath Date: Fri Mar 25 10:06:04 2022 +0000 ARM: dts: am335x: Guardian: Update life led * update life led label and pin number Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-7-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 42c83b73aea112ba4341467bec58a3b3e44fa822 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:03 2022 +0000 ARM: dts: am335x: Guardian: Remove mmc status led * MMC presence indicater LED removed from Guardian Board Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-6-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit d8da0fd615172671f7245795e8d82ac8cce97667 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:02 2022 +0000 ARM: dts: am335x: Guardian: Disable poweroff support from RTC * Disabling poweroff support form RTC will allow poweroff to handle from other machanism Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-5-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 87e4e2bf90fbed8b9e73d80be387aabced5a39a3 Author: Gireesh Hiremath Date: Fri Mar 25 10:06:01 2022 +0000 ARM: dts: am335x: Guardian: Add keypad * Add support to guardian mt gpio keypad Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-4-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit 062859b506ba393997f06a96f40eb6041f6b4c6c Author: Gireesh Hiremath Date: Fri Mar 25 10:06:00 2022 +0000 ARM: dts: am335x: Guardian: Rename power button label * Rename label button to power button Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-3-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit bbcd3f73e83ed1303b8a3afd9bf437da536d6412 Author: Gireesh Hiremath Date: Fri Mar 25 10:05:59 2022 +0000 ARM: dts: am335x: Guardian: Update NAND partition table * Update partition table to save env and splash image * GPMC config values optimized for Bosch Guardian Board * NAND Chip used by Bosch Guardian Board is Micron MT29F4G08ABBFA Signed-off-by: Gireesh Hiremath Message-Id: <20220325100613.1494-2-Gireesh.Hiremath@in.bosch.com> Signed-off-by: Tony Lindgren commit f41f5a993395d1e05d9400998c6ab1d737dbec6b Author: Adam Ford Date: Thu Mar 3 11:18:18 2022 -0600 ARM: dts: logicpd-som-lv: Move pinmuxing to peripheral nodes Move some pinmux references to their respective peripherals. This keeps the pins in safe-mode until they are requested. Signed-off-by: Adam Ford Message-Id: <20220303171818.11060-2-aford173@gmail.com> Signed-off-by: Tony Lindgren commit f5582834f3809292f98e4b471e0756b1f9d0e78d Author: Oleksij Rempel Date: Wed Feb 16 08:49:25 2022 +0100 ARM: dts: omap3/4/5: fix ethernet node name for different OMAP boards The node name of Ethernet controller should be "ethernet" instead of "usbether" as required by Ethernet controller devicetree schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml This patch can potentially affect boot loaders patching against full node path instead of using device aliases. Signed-off-by: Oleksij Rempel Message-Id: <20220216074927.3619425-8-o.rempel@pengutronix.de> Signed-off-by: Tony Lindgren commit 5af14c29f7a0e6d1fcee44c4ed4a2d12a49c4a43 Author: Borislav Petkov Date: Wed Apr 20 13:45:49 2022 +0200 x86/tdx: Annotate a noreturn function objdump complains: vmlinux.o: warning: objtool: __tdx_hypercall()+0x74: unreachable instruction because __tdx_hypercall_failed() won't return but panic the guest. Annotate that that is ok and desired. Fixes: eb94f1b6a70a ("x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions") Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220420115025.5448-1-bp@alien8.de commit b0c42232fce499ba96fbf2c5ebd2368efeb6597e Author: Weili Qian Date: Sat Apr 16 18:45:59 2022 +0800 crypto: hisilicon/qm - remove hisi_qm_get_free_qp_num() hisi_qm_get_free_qp_num() is to get the free queue number on the function. It is a simple function and is only called by hisi_qm_get_available_instances(). This patch modifies to get the free queue directly in hisi_qm_get_available_instances(), and remove hisi_qm_get_free_qp_num(). Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 7982996c5b0812cbf7846deff0e2f5dcbf290129 Author: Weili Qian Date: Sat Apr 16 18:45:58 2022 +0800 crypto: hisilicon/qm - replace hisi_qm_release_qp() with hisi_qm_free_qps() hisi_qm_free_qps() can release multiple queues in one call, and it is already exported. So, replace hisi_qm_release_qp() with hisi_qm_free_qps() in zip_crypto.c, and do not export hisi_qm_release_qp() outside qm.c. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit fb06eb9727d67eac16e6b6aff35362476389cb88 Author: Weili Qian Date: Sat Apr 16 18:45:57 2022 +0800 crypto: hisilicon/qm - set function with static These functions 'hisi_qm_create_qp' and 'hisi_qm_set_vft' are not used outside qm.c, so they are marked as static. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 0b0002315adfea3d9eb102665a4441727d4d2621 Author: Weili Qian Date: Sat Apr 16 18:45:56 2022 +0800 crypto: hisilicon/qm - remove unused function declaration The 'hisi_qm_get_hw_version' function is unused, so remove the function declaration. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 6a71277ce91e4766ebe9a5f6725089c80d043ba2 Author: Herbert Xu Date: Fri Apr 15 16:37:47 2022 +0800 hwrng: mpfs - Enable COMPILE_TEST The dependency on HW_RANDOM is redundant so this patch removes it. As this driver seems to cross-compile just fine we could also enable COMPILE_TEST. Signed-off-by: Herbert Xu Reviewed-by: Conor Dooley Signed-off-by: Herbert Xu commit 4ffa1763622ae5752961499588f3f8874315f974 Author: Corentin Labbe Date: Wed Apr 13 19:11:54 2022 +0000 crypto: marvell/cesa - ECB does not IV The DES3 ECB has an IV size set but ECB does not need one. Fixes: 4ada483978237 ("crypto: marvell/cesa - add Triple-DES support") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit a77aba3109363ae89711fa2dc3523520c760937f Author: Peter Gonda Date: Wed Apr 13 08:58:35 2022 -0700 crypto: ccp - Log when resetting PSP SEV state Currently when the PSP returns a SECURE_DATA_INVALID error on INIT or INIT_EX the driver retries the command once which should reset the PSP's state SEV related state, meaning the PSP will regenerate its keying material. This is logged with a dbg log but given this will change system state this should be logged at a higher priority and with more information. Signed-off-by: Peter Gonda Cc: Tom Lendacky Cc: Brijesh Singh Cc: David Rientjes Cc: Herbert Xu Cc: John Allen Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit 32547a6aedda132907fcd15cdc8271429609f216 Author: Vladis Dronov Date: Wed Apr 13 16:16:06 2022 +0200 hwrng: cn10k - Make check_rng_health() return an error code Currently check_rng_health() returns zero unconditionally. Make it to output an error code and return it. Fixes: 38e9791a0209 ("hwrng: cn10k - Add random number generator support") Signed-off-by: Vladis Dronov Signed-off-by: Herbert Xu commit 753d6770879894de10d74b437ab99ea380f1cad7 Author: Vladis Dronov Date: Wed Apr 13 16:16:05 2022 +0200 hwrng: cn10k - Optimize cn10k_rng_read() This function assumes that sizeof(void) is 1 and arithmetic works for void pointers. This is a GNU C extention and may not work with other compilers. Change this by using an u8 pointer. Also move cn10k_read_trng() out of a loop thus saving some cycles. Fixes: 38e9791a0209 ("hwrng: cn10k - Add random number generator support") Signed-off-by: Vladis Dronov Signed-off-by: Herbert Xu commit 5a6477eaf402a2fa48c66f1dae1fbd9f0a5f096a Author: Jayesh Choudhary Date: Tue Apr 12 13:00:16 2022 +0530 crypto: sa2ul - Add the new compatible for AM62 Add the new compatible for am62x in of_match_table. Signed-off-by: Jayesh Choudhary Signed-off-by: Herbert Xu commit bcfcc0a61debc152788a83dc7afaeda2445677e4 Author: Jayesh Choudhary Date: Tue Apr 12 13:00:15 2022 +0530 dt-bindings: crypto: ti,sa2ul: Add a new compatible for AM62 Add the AM62 version of sa3ul to the compatible list. Signed-off-by: Jayesh Choudhary Acked-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 2bf93ffbb97e0614cfc431d2ea33b7eae7481eb2 Author: Tom Lendacky Date: Wed Apr 20 09:14:13 2022 -0500 virt: sevguest: Change driver name to reflect generic SEV support During patch review, it was decided the SNP guest driver name should not be SEV-SNP specific, but should be generic for use with anything SEV. However, this feedback was missed and the driver name, and many of the driver functions and structures, are SEV-SNP name specific. Rename the driver to "sev-guest" (to match the misc device that is created) and update some of the function and structure names, too. While in the file, adjust the one pr_err() message to be a dev_err() message so that the message, if issued, uses the driver name. Signed-off-by: Tom Lendacky Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/307710bb5515c9088a19fd0b930268c7300479b2.1650464054.git.thomas.lendacky@amd.com commit 1af20714fedad238362571620be0bd690ded05b6 Author: Miaoqian Lin Date: Sat Apr 16 07:37:21 2022 +0000 HID: elan: Fix potential double free in elan_input_configured 'input' is a managed resource allocated with devm_input_allocate_device(), so there is no need to call input_free_device() explicitly or there will be a double free. According to the doc of devm_input_allocate_device(): * Managed input devices do not need to be explicitly unregistered or * freed as it will be done automatically when owner device unbinds from * its driver (or binding fails). Fixes: b7429ea53d6c ("HID: elan: Fix memleak in elan_input_configured") Fixes: 9a6a4193d65b ("HID: Add driver for USB ELAN Touchpad") Signed-off-by: Miaoqian Lin Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 0f9fc0c1eff0120403f95d4f61e330654fbe64ed Author: Matthew Auld Date: Wed Apr 20 19:16:13 2022 +0100 drm/i915/selftests: tweak the misaligned_case The compact-pt layout restrictions should only apply to the ppGTT. Also make this play nice on platforms that only have the 64K GTT restriction, and not the compact-pt thing. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Cc: Ramalingam C Reviewed-by: Nirmoy Das Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220420181613.70033-4-matthew.auld@intel.com commit 9707cc4bbaa97f289083d437b8f4d060157f2394 Author: Matthew Auld Date: Wed Apr 20 19:16:12 2022 +0100 drm/i915/selftests: fixup min_alignment usage Trying to cast the region id into the region type doesn't work too well, since the i915_vm_min_alignment() won't give us the correct value for the stolen-lmem case. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Cc: Ramalingam C Reviewed-by: Nirmoy Das Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220420181613.70033-3-matthew.auld@intel.com commit f06e2167055f4022417dcbe4cacdf15f48d60c92 Author: Christian König Date: Tue Apr 19 15:55:10 2022 +0200 drm/amdgpu: remove pointless ttm_eu usage from DM We just need to reserve one BO here, no need for using ttm_eu to reserve multiple BOs. Signed-off-by: Christian König Acked-by: Alex Deucher Acked-by: Harry Wentland Link: https://patchwork.freedesktop.org/patch/msgid/20220419141915.122157-2-christian.koenig@amd.com commit 32c2d7a536d118d725c44178d6d8856e369f05ae Author: Christian König Date: Tue Apr 19 15:09:01 2022 +0200 drm/amdgpu: remove pointless ttm_eu usage from vkms We just need to reserve one BO here, no need for using ttm_eu to reserve multiple BOs. Signed-off-by: Christian König Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220419141915.122157-1-christian.koenig@amd.com commit be77bb3e8d4d47a3ab7bd2dd5bf76092b33e08a2 Author: Matthew Auld Date: Wed Apr 20 19:16:11 2022 +0100 drm/i915/buddy: sanity check the size Ensure we check that the size is compatible with the requested page_size. For tiny objects that are automatically annotated with TTM_PL_FLAG_CONTIGUOUS(since they fit within a single page), we currently end up silently overriding the min_page_size, which ends up hiding bugs elsewhere. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220420181613.70033-2-matthew.auld@intel.com commit a7ce8f821ca9dc20fa71cd482fcadf0c7e5b2926 Author: Matthew Auld Date: Wed Apr 20 19:16:10 2022 +0100 drm/i915: consider min_page_size when migrating We can only force migrate an object if the existing object size is compatible with the new destinations min_page_size for the region. Currently we blow up with something like: [ 2857.497462] kernel BUG at drivers/gpu/drm/i915/gt/intel_migrate.c:431! [ 2857.497497] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 2857.497502] CPU: 1 PID: 8921 Comm: i915_selftest Tainted: G U W 5.18.0-rc1-drm-tip+ #27 [ 2857.497513] RIP: 0010:emit_pte.cold+0x11a/0x17e [i915] [ 2857.497646] Code: 00 48 c7 c2 f0 cd c1 a0 48 c7 c7 e9 99 bd a0 e8 d2 77 5d e0 bf 01 00 00 00 e8 08 47 5d e0 31 f6 bf 09 00 00 00 e8 3c 7b 4d e0 <0f> 0b 48 c7 c1 e0 2a c5 a0 ba 34 00 00 00 48 c7 c6 00 ce c1 a0 48 [ 2857.497654] RSP: 0018:ffffc900000f7748 EFLAGS: 00010246 [ 2857.497658] RAX: 0000000000000000 RBX: ffffc900000f77c8 RCX: 0000000000000006 [ 2857.497662] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009 [ 2857.497665] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 [ 2857.497668] R10: 0000000000022302 R11: ffff88846dea08f0 R12: 0000000000010000 [ 2857.497672] R13: 0000000001880000 R14: 000000000000081b R15: ffff888106b7c040 [ 2857.497675] FS: 00007f0d4c4e0600(0000) GS:ffff88845da80000(0000) knlGS:0000000000000000 [ 2857.497679] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2857.497682] CR2: 00007f113966c088 CR3: 0000000211e60003 CR4: 00000000003706e0 [ 2857.497686] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2857.497689] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2857.497692] Call Trace: [ 2857.497694] [ 2857.497697] intel_context_migrate_copy+0x1e5/0x4f0 [i915] Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220420181613.70033-1-matthew.auld@intel.com commit 68cbfae83a7208d960034813c4744bf9651a725d Author: Michal Simek Date: Fri Feb 25 14:17:31 2022 +0100 microblaze: Add support for reserved memory defined by DT In DT reserved memory nodes can be added as is described by Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt but Microblaze didn't have a support for it. The similar change was done for ARC by commit 1b10cb21d888 ("ARC: add support for reserved memory defined by device tree"). It is pretty much enough to call early_init_fdt_scan_reserved_mem(). Microblaze is not using initial_boot_params that's why there is no need to call early_init_fdt_reserve_self(). Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/da4395776bf0de7207767abcc8a5df05bf411816.1645795048.git.michal.simek@xilinx.com commit e4c70fc695667d115e050470375b315685ab069c Author: Michal Simek Date: Fri Feb 25 14:17:30 2022 +0100 microblaze: Wire memblock_dump_all() Wire memblock_dump_all() to be able to see the whole memblock allocation. Dumps are enabled by passing memblock=debug via kernel command line. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/6f480b6010068872f429df69c8894cc3f1f38f46.1645795048.git.michal.simek@xilinx.com commit 61a4e653cabd7d9e4a9e940d0786532725e73c0d Author: Michal Simek Date: Fri Feb 25 14:55:36 2022 +0100 microblaze: Use simple memmove/memcpy implementation from lib/string.c This is based on previous commit ("microblaze: Use simple memset implementation from lib/string.c") where generic memset implementation is used when OPT_LIB_FUNCTION is not defined. The same change can be done for memset/memcpy implementation where doesn't make sense to have generic implementation in architecture code. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/1f5cfc026a8a458f3e3134ab80f65bd4ac7e3e8e.1645797329.git.michal.simek@xilinx.com commit 95fee37be45f443a8a322ee7f6f78167b73f2abc Author: Michal Simek Date: Fri Feb 25 14:55:35 2022 +0100 microblaze: Do loop unrolling for optimized memset implementation Align implementation with memcpy and memmove where also remaining bytes are copied via final switch case instead of using simple implementations which loop. But this alignment has much stronger reason and definitely aligning implementation is not the key point here. It is just good to have in mind that the same technique is used already there. In GCC 10, now -ftree-loop-distribute-patterns optimization is on at O2. This optimization causes GCC to convert the while loop in memset.c into a call to memset. So this optimization is transforming a loop in a memset/memcpy into a call to the function itself. This makes the memset implementation as recursive. "-freestanding" option will disable the built-in library function but it has been added in generic library implementation. In default microblaze kernel defconfig we have CONFIG_OPT_LIB_FUNCTION enabled so it will always pick optimized version of memset which is target specific so we are replacing the while() loop with switch case to avoid recursive memset call. Issue with freestanding was already discussed in connection to commit 33d0f96ffd73 ("lib/string.c: Use freestanding environment") and also this is topic in glibc and gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888 http://patchwork.ozlabs.org/project/glibc/patch/20191121021040.14554-1-sandra@codesourcery.com/ Signed-off-by: Michal Simek Signed-off-by: Mahesh Bodapati Link: https://lore.kernel.org/r/10a432e269a6d3349cf458e4f5792522779cba0d.1645797329.git.michal.simek@xilinx.com commit 8f0f265e6cf5b6d99a5a5d01b36985bc1131183e Author: Michal Simek Date: Fri Feb 25 14:55:34 2022 +0100 microblaze: Use simple memset implementation from lib/string.c On microblaze systems which are not using OPT_LIB_FUNCTION only simple memset is used. This function is already implemented in lib/string.c that's why it should be used instead. This change is done in respect of issue fixed by commit 33d0f96ffd73 ("lib/string.c: Use freestanding environment") where gcc-10.x moved -ftree-loop-distribute-patterns optimization is to O2 optimization level. This optimization causes GCC to convert the while loop in memset.c into a call to memset. So This optimization is transforming a loop in a memset/memcpy into a call to the function itself. This makes the memset implementation as recursive. Based on fix above -ffreestanding was used and it needs to be used on Microblaze too but the patch is not adding this flag it removes simple implementation to cause that generic implementation is used where this flag is already setup. Signed-off-by: Michal Simek Signed-off-by: Mahesh Bodapati Link: https://lore.kernel.org/r/4a143e7654f72ee893dcea9769946e17d3570b16.1645797329.git.michal.simek@xilinx.com commit 116c3f4a78ebe478d5ad5a038baf931e93e7d748 Author: Jonathan Teh Date: Sun Mar 13 19:48:18 2022 +0000 HID: hid-led: fix maximum brightness for Dream Cheeky Increase maximum brightness for Dream Cheeky to 63. Emperically determined based on testing in kernel 4.4 on this device: Bus 003 Device 002: ID 1d34:0004 Dream Cheeky Webmail Notifier Fixes: 6c7ad07e9e05 ("HID: migrate USB LED driver from usb misc to hid") Signed-off-by: Jonathan Teh Signed-off-by: Jiri Kosina commit 1d07cef7fd7599450b3d03e1915efc2a96e1f03f Author: Marek Maślanka Date: Tue Apr 5 17:04:07 2022 +0200 HID: multitouch: Add support for Google Whiskers Touchpad The Google Whiskers touchpad does not work properly with the default multitouch configuration. Instead, use the same configuration as Google Rose. Signed-off-by: Marek Maslanka Acked-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 62f8857b2d082069b11851d1ae8ce101752436ee Author: Tom Rix Date: Wed Apr 20 10:22:44 2022 -0400 HID: amd_sfh: change global variables to static Smatch reports this representative issue amd_sfh_hid_report_desc.h:182:10: warning: symbol 'gyro3_report_descriptor' was not declared. Should it be static? Similar issues for comp3_report_descriptor and als_report_descriptor. Global variables should not be defined in header files. This only works because amd_sfh_hid_report_desc.h in only included by amd_sfh_hid_desc.c so change the storage-class specifiers to static. Signed-off-by: Tom Rix Acked-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 67d64069bc0867e52e73a1e255b17462005ca9b4 Author: Takashi Iwai Date: Thu Apr 21 08:41:01 2022 +0200 ALSA: usb-audio: Move generic implicit fb quirk entries into quirks.c Use the new quirk bits to manage the generic implicit fb quirk entries. This makes easier to compare with other devices. Link: https://lore.kernel.org/r/20220421064101.12456-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0f1f7a6661394fe4a53db254c346d6aa2dd64397 Author: Takashi Iwai Date: Thu Apr 21 08:41:00 2022 +0200 ALSA: usb-audio: Add quirk bits for enabling/disabling generic implicit fb For making easier to test, add the new quirk_flags bits 17 and 18 to enable and disable the generic implicit feedback mode. The bit 17 is equivalent with implicit_fb=1 option, applying the generic implicit feedback sync mode. OTOH, the bit 18 disables the implicit fb mode forcibly. Link: https://lore.kernel.org/r/20220421064101.12456-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6facd076f5a9827800894c77a53d100c5f0a7d2f Author: Nikolai Kondrashov Date: Thu Apr 14 13:09:36 2022 +0200 HID: uclogic: Add support for Huion Q620M The Huion Q620M tablet needs a v2 frame dial. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 2112b49eaa5c5cffc22ddd8b3b09f7d20bf13819 Author: Nikolai Kondrashov Date: Thu Apr 14 13:09:35 2022 +0200 HID: uclogic: Add support for bitmap dials A bitmap dial sends reports with a dedicated bit per direction: 1 means clockwise rotation, 2 means counterclockwise, as opposed to the normal 1 and -1 values. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit f25df3532832c93b7857a61266e48fa0ab87bca7 Author: Nikolai Kondrashov Date: Thu Apr 14 13:09:34 2022 +0200 HID: uclogic: Reduce indent for params format str/args Improve legibility of UCLOGIC_PARAMS_FMT_STR/ARGS. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit eea4269f135e7bc11eef125c4ab6c7f50fb5c809 Author: Nikolai Kondrashov Date: Thu Apr 14 13:09:33 2022 +0200 HID: uclogic: Compress params format string Shorten the format string for printing out UC-Logic interface parameters so that it fits into a single log message. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 6ff1cae2e30a79265bcce85f617663c480936ab0 Author: Bastien Nocera Date: Thu Apr 7 13:54:06 2022 +0200 HID: wacom: Correct power_supply type POWER_SUPPLY_TYPE_USB seems to only ever be used by USB ports that are used to charge the machine itself (so a "system" scope), like the single USB port on a phone, rather than devices. The wacom_sys driver is the only driver that sets its device battery as being a USB type, which doesn't seem correct based on its usage, so switch it to be a battery type like all the other USB-connected devices. Signed-off-by: Bastien Nocera Acked-by: Jason Gerecke Signed-off-by: Jiri Kosina commit 6d09085b38e5ace0001cf4f3cdbd4bf247533b61 Author: Joshua-Dickens Date: Tue Mar 22 14:33:16 2022 -0700 HID: wacom: Adding Support for new usages Added supprt for the following usages: * HID_DG_SCANTIME to report the timestamp for pen and touch events. * WACOM_HID_WD_BARRELSWITCH3 to support pens with 3 buttons. * WACOM_HID_WD_SEQUENCENUMBER to detect and report dropped packets. Signed-off-by: Joshua Dickens Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina commit 3380557fc7e28d9bce7607e16d98f123d36da4ca Author: Andreas Böhler Date: Wed Apr 20 12:40:34 2022 +0200 mtd: rawnand: add support for Toshiba TC58NVG0S3HTA00 NAND flash The Toshiba TC58NVG0S3HTA00 is detected with 64 byte OOB while the flash has 128 bytes OOB. This adds a static NAND ID entry to correct this. Tested on FRITZ!Box 7530 flashed with OpenWrt. Signed-off-by: Andreas Böhler Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220420104034.6333-1-dev@aboehler.at commit f4c5c7f9d2e5ab005d57826b740b694b042a737c Author: Felix Matouschek Date: Mon Apr 18 15:28:03 2022 +0200 mtd: spinand: Add support for XTX XT26G0xA Add support for XTX Technology XT26G01AXXXXX, XTX26G02AXXXXX and XTX26G04AXXXXX SPI NAND. These are 3V, 1G/2G/4Gbit serial SLC NAND flash devices with on-die ECC (8bit strength per 512bytes). Tested on Teltonika RUTX10 flashed with OpenWrt. Links: - http://www.xtxtech.com/download/?AId=225 - https://datasheet.lcsc.com/szlcsc/2005251034_XTX-XT26G01AWSEGA_C558841.pdf Signed-off-by: Felix Matouschek Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220418132803.664103-1-felix@matouschek.org commit d9edc4bc67c4fd77b30d0a55bc84b775c2f00bab Author: Han Xu Date: Mon Apr 11 21:52:46 2022 -0500 mtd: rawnand: gpmi: Add large oob bch setting support The code change proposes a new way to set bch geometry for large oob NAND (oobsize > 1KB). In this case, previous implementation can NOT guarantee the bad block mark always locates in data chunk, so we need a new way to do it. The general idea is, 1.Try all ECC strength from the maximum ecc that controller can support to minimum value required by NAND chip, any ECC strength makes the BBM locate in data chunk can be eligible. 2.If none of them works, using separate ECC for meta, which will add one extra ecc with the same ECC strength as other data chunks. This extra ECC can guarantee BBM located in data chunk, also we need to check if oob can afford it. Signed-off-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412025246.24269-6-han.xu@nxp.com commit 2fb038eaeed82811eaecc4248b119218f8a3551b Author: Han Xu Date: Mon Apr 11 21:52:45 2022 -0500 mtd: rawnand: gpmi: Rename the variable ecc_chunk_size There is only one variable ecc_chunk_size in bch_geometry data structure but two different field in BCH registers. The data0_size in BCH_FLASH0LAYOUT0 and datan_size in BCH_FLASH0LAYOUT1 should have dedicate variable since they might set to different values in some cases. For instance, if need dedicate ecc for meta area, the data0_size should be 0 rather than datan_size, but for all other cases, data0_size still equals to datan_size and it won't bring any function change. Signed-off-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412025246.24269-5-han.xu@nxp.com commit 109158579e64267439c4491845b770cf530f8cba Author: Han Xu Date: Mon Apr 11 21:52:44 2022 -0500 mtd: rawnand: gpmi: Uninline the gpmi_check_ecc function The gpmi_check_ecc() is not small after adding more strict ecc check, uninline it. Signed-off-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412025246.24269-4-han.xu@nxp.com commit d10af38a2e3b60dc46ca9727dfc24d0ea57136e3 Author: Han Xu Date: Mon Apr 11 21:52:43 2022 -0500 mtd: rawnand: gpmi: Add strict ecc strength check Add nand_ecc_is_strong_enough() check in gpmi_check_ecc() function to make sure ecc strength can meet chip requirement. Signed-off-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412025246.24269-3-han.xu@nxp.com commit 15616c7cfb968d72e614b1ba669467dc373b2582 Author: Han Xu Date: Mon Apr 11 21:52:42 2022 -0500 mtd: rawnand: gpmi: Refactor bch geometry settings function The code change refactor the bch geometry setting function, which doesn't change the default behavior, while user may choose to use chips required minimum ecc strength by DT flag "fsl,use-minimum-ecc". The default way to set bch geometry need to set the data chunk size(step_size) larger than oob size to make sure BBM locates in data chunk, then set the maximum ecc strength oob can hold. It always use unbalanced ECC layout, which ecc0 will cover both meta and data0 chunk. But the default bch setting is deprecated for large oobsize NAND (oobsize >1KB), so in the patch set, there is a split commit that introduces a new way to set bch geometry for large oob size NAND. For all other cases,set the bch geometry by chip required strength and step size, which uses the minimum ecc strength chip required. It can be explicitly enabled by DT flag "fsl,use-minimum-ecc", but need to be en/disabled in both u-boot and kernel at the same time. Signed-off-by: Han Xu Tested-by: Sean Nyekjaer Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412025246.24269-2-han.xu@nxp.com commit 3a745b51cddafade99aaea1b93aad31e9614e230 Author: Zheyu Ma Date: Mon Apr 11 20:58:08 2022 +0800 mtd: rawnand: denali: Use managed device resources All of the resources used by this driver has managed interfaces, so use them. Otherwise we will get the following splat: [ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for irq 0x1000 [ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5 [ 4.473538] nand: No NAND device found [ 4.474068] BUG: unable to handle page fault for address: ffffc90005000410 [ 4.475169] #PF: supervisor write access in kernel mode [ 4.475579] #PF: error_code(0x0002) - not-present page [ 4.478362] RIP: 0010:iowrite32+0x9/0x50 [ 4.486068] Call Trace: [ 4.486269] [ 4.486443] denali_isr+0x15b/0x300 [denali] [ 4.486788] ? denali_direct_write+0x50/0x50 [denali] [ 4.487189] __handle_irq_event_percpu+0x161/0x3b0 [ 4.487571] handle_irq_event+0x7d/0x1b0 [ 4.487884] handle_fasteoi_irq+0x2b0/0x770 [ 4.488219] __common_interrupt+0xc8/0x1b0 [ 4.488549] common_interrupt+0x9a/0xc0 Fixes: 93db446a424c ("mtd: nand: move raw NAND related code to the raw/ subdir") Signed-off-by: Zheyu Ma Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220411125808.958276-1-zheyuma97@gmail.com commit 8687b535553ce62e9fd33411a57591f04a8cce65 Author: José Expósito Date: Wed Apr 20 13:45:00 2022 +0200 drm/vc4: hdmi: Remove vc4_hdmi_encoder The vc4_hdmi_encoder struct was used exclusively to cache the value returned by drm_detect_hdmi_monitor() in order to avoid calling it multiple times. Now that drm_detect_hdmi_monitor() has been replaced with drm_display_info.is_hdmi, there is no need to have an extra struct. Remove vc4_hdmi_encoder. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420114500.187664-3-jose.exposito89@gmail.com commit c3c2f38ce532c6d3efa13e2aaa9d5d52396518b1 Author: José Expósito Date: Wed Apr 20 13:44:59 2022 +0200 drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi Once EDID is parsed, the monitor HDMI support information is cached in drm_display_info.is_hdmi by drm_parse_hdmi_vsdb_video(). This driver calls drm_detect_hdmi_monitor() to receive the same information and stores its own cached value in vc4_hdmi_encoder.hdmi_monitor, which is less efficient. Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi instead. This also allows to remove vc4_hdmi_encoder.hdmi_monitor. drm_detect_hdmi_monitor() is called in vc4_hdmi_connector_detect() and vc4_hdmi_connector_get_modes(). In both cases it is safe to rely on drm_display_info.is_hdmi as shown by ftrace: $ sudo trace-cmd record -p function_graph -l "vc4_hdmi_*" -l "drm_*" vc4_hdmi_connector_detect: vc4_hdmi_connector_detect() { drm_get_edid() { drm_connector_update_edid_property() { drm_add_display_info() { drm_reset_display_info(); drm_for_each_detailed_block.part.0(); drm_parse_cea_ext() { drm_find_cea_extension(); drm_parse_hdmi_vsdb_video(); /* drm_display_info.is_hdmi is cached here */ } } } } /* drm_display_info.is_hdmi is used here */ } vc4_hdmi_connector_get_modes: vc4_hdmi_connector_get_modes() { drm_get_edid() { drm_connector_update_edid_property() { drm_add_display_info() { drm_reset_display_info(); drm_for_each_detailed_block.part.0(); drm_parse_cea_ext() { drm_find_cea_extension(); drm_parse_hdmi_vsdb_video(); /* drm_display_info.is_hdmi is cached here */ } } } } /* drm_display_info.is_hdmi is used here */ drm_connector_update_edid_property(); } Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420114500.187664-2-jose.exposito89@gmail.com commit a44a027a8b2a20fec30e0e9c99b0eb41c03e7420 Merge: 463260d767056 973ac0eb3a7df Author: Dave Chinner Date: Thu Apr 21 16:46:17 2022 +1000 Merge tag 'large-extent-counters-v9' of https://github.com/chandanr/linux into xfs-5.19-for-next xfs: Large extent counters The commit xfs: fix inode fork extent count overflow (3f8a4f1d876d3e3e49e50b0396eaffcc4ba71b08) mentions that 10 billion data fork extents should be possible to create. However the corresponding on-disk field has a signed 32-bit type. Hence this patchset extends the per-inode data fork extent counter to 64 bits (out of which 48 bits are used to store the extent count). Also, XFS has an attribute fork extent counter which is 16 bits wide. A workload that, 1. Creates 1 million 255-byte sized xattrs, 2. Deletes 50% of these xattrs in an alternating manner, 3. Tries to insert 400,000 new 255-byte sized xattrs causes the xattr extent counter to overflow. Dave tells me that there are instances where a single file has more than 100 million hardlinks. With parent pointers being stored in xattrs, we will overflow the signed 16-bits wide attribute extent counter when large number of hardlinks are created. Hence this patchset extends the on-disk field to 32-bits. The following changes are made to accomplish this, 1. A 64-bit inode field is carved out of existing di_pad and di_flushiter fields to hold the 64-bit data fork extent counter. 2. The existing 32-bit inode data fork extent counter will be used to hold the attribute fork extent counter. 3. A new incompat superblock flag to prevent older kernels from mounting the filesystem. Signed-off-by: Chandan Babu R Signed-off-by: Dave Chinner commit 463260d7670566c357dfa2c38bc3124c98b646bc Merge: 898a768f54bf3 593e34391faaf Author: Dave Chinner Date: Thu Apr 21 16:45:52 2022 +1000 Merge branch 'guilt/xlog-write-rework' into xfs-5.19-for-next commit 898a768f54bf3c910392eb7987b47ebddc28e444 Merge: 1499b8a3a37ba c60d13ea657f6 Author: Dave Chinner Date: Thu Apr 21 16:45:03 2022 +1000 Merge branch 'guilt/xfs-unsigned-flags-5.18' into xfs-5.19-for-next commit 950cf957fe34d40d63dfa3bf3968210430b6491e Author: Hangyu Hua Date: Mon Apr 18 16:57:58 2022 +0800 misc: ocxl: fix possible double free in ocxl_file_register_afu info_release() will be called in device_unregister() when info->dev's reference count is 0. So there is no need to call ocxl_afu_put() and kfree() again. Fix this by adding free_minor() and return to err_unregister error path. Fixes: 75ca758adbaf ("ocxl: Create a clear delineation between ocxl backend & frontend") Signed-off-by: Hangyu Hua Acked-by: Frederic Barrat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220418085758.38145-1-hbh25y@gmail.com commit 05fe70dd2efd13de700c2dfe5169d3a7a5050bc2 Author: Randy Dunlap Date: Wed Apr 20 16:55:45 2022 -0700 MAINTAINERS: fix location of moxa-smartio.rst The moxa-smartio.rst file was moved to a different location, so update the MAINTAINERS file entry for it. Quietens one build warning: MAINTAINERS:29715: WARNING: unknown document: ../driver-api/serial/moxa-smartio Fixes: 5b437ae9fcbb ("Documentation: tty: move moxa-smartio.rst to tty") Cc: Jiri Slaby Cc: Greg Kroah-Hartman Reported-by: Stephen Rothwell Reviewed-by: Jiri Slaby Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220420235545.17081-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 1499b8a3a37baf5a78ee8044e9a8fa0471268d74 Merge: 9a5280b312e2e 2d9ac4319b995 Author: Dave Chinner Date: Thu Apr 21 11:40:17 2022 +1000 Merge branch 'guilt/5.19-miscellaneous' into xfs-5.19-for-next commit 40d8d4bd06720aed6c1125bab7296c57de4f1157 Author: Zack Rusin Date: Mon Apr 11 23:35:26 2022 -0400 drm/radeon: Use TTM builtin resource manager debugfs code Switch to using the TTM resource manager debugfs helpers. The functionality is largely the same. The TTM resource managers need to stay valid for as long as the drm debugfs_root is valid. Signed-off-by: Zack Rusin Cc: Alex Deucher Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220412033526.369115-6-zack@kde.org Reviewed-by: Christian König commit d0719e09264b2d79f8262a3e9c5d870d29c7b800 Author: Zack Rusin Date: Mon Apr 11 23:35:25 2022 -0400 drm/qxl: Use TTM builtin resource manager debugfs code Switch to using the TTM resource manager debugfs helpers. The functionality is largely the same. The TTM resource managers need to stay valid for as long as the drm debugfs_root is valid. Signed-off-by: Zack Rusin Cc: Dave Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220412033526.369115-5-zack@kde.org Reviewed-by: Christian König commit 7212d24cec522752dcd5a5f6db9e45c3d87df269 Author: Zack Rusin Date: Mon Apr 11 23:35:24 2022 -0400 drm/amdgpu: Use TTM builtin resource manager debugfs code Switch to using the TTM resource manager debugfs helpers. It's exactly the same functionality but the debugfs code is shared with other drivers. The TTM resource managers need to stay valid for as long as the drm debugfs_root is valid. Signed-off-by: Zack Rusin Cc: Alex Deucher Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Felix Kuehling Cc: Nirmoy Das Cc: Thomas Zimmermann Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220412033526.369115-4-zack@kde.org Reviewed-by: Christian König commit af4a25bbe5e7e60ff696ef5c1ec48ab2d51c17c6 Author: Zack Rusin Date: Mon Apr 11 23:35:23 2022 -0400 drm/vmwgfx: Add debugfs entries for various ttm resource managers Use the newly added TTM's ability to automatically create debugfs entries for specified placements. This creates debugfs files that can be read to get information about various TTM resource managers which are used by vmwgfx. Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220412033526.369115-3-zack@kde.org Reviewed-by: Christian König commit 8cd9efd1b7fb329681d5a5fdf441c8fc8dc4f5ae Author: Zack Rusin Date: Mon Apr 11 23:35:22 2022 -0400 drm/ttm: Add common debugfs code for resource managers Drivers duplicate the code required to add debugfs entries for various ttm resource managers. To fix it add common TTM resource manager debugfs code that each driver can reuse. Specific resource managers can overwrite ttm_resource_manager_func::debug to get more information from those debugfs entries. Signed-off-by: Zack Rusin Cc: Huang Rui Cc: David Airlie Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220412033526.369115-2-zack@kde.org Reviewed-by: Christian König commit c60d13ea657f69a0f90c7ba131c16e0a25598488 Author: Dave Chinner Date: Thu Apr 21 10:48:01 2022 +1000 xfs: convert log ticket and iclog flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 2eb7550d2c0dd7c383839018991dfa602790dc77 Author: Dave Chinner Date: Thu Apr 21 10:47:38 2022 +1000 xfs: convert shutdown reasons to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit b9f3082eee5a77d5000742859532ba4ff584354f Author: Dave Chinner Date: Thu Apr 21 10:47:32 2022 +1000 xfs: convert quota options flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 90215d74987159fdd7a6d800256ba1d2a9b0dca8 Author: Dave Chinner Date: Thu Apr 21 10:47:25 2022 +1000 xfs: convert ptag flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit a103375307ade71f3394889310ba37abb23c1c21 Author: Dave Chinner Date: Thu Apr 21 10:47:16 2022 +1000 xfs: convert inode lock flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 22d53f480c56e34316d2e5f3757ba1839d47008b Author: Dave Chinner Date: Thu Apr 21 10:47:07 2022 +1000 xfs: convert log item tracepoint flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 1005dd019c88f556f85cb3632df4d2c702ae95cd Author: Dave Chinner Date: Thu Apr 21 10:46:55 2022 +1000 xfs: convert dquot flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 3402d931575f1fb0c6863eaad6595f55e6389eda Author: Dave Chinner Date: Thu Apr 21 10:46:47 2022 +1000 xfs: convert da btree operations flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 581b4484475c14cf606cdc9d6cdecc98f7ab1be4 Author: Dave Chinner Date: Thu Apr 21 10:46:40 2022 +1000 xfs: convert buffer log item flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 722db70fb2f03ef9ff21cd5194e9f592701e1be6 Author: Dave Chinner Date: Thu Apr 21 10:46:33 2022 +1000 xfs: convert btree buffer log flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. We also pass the fields to log to xfs_btree_offsets() as a uint32_t all cases now. I have no idea why we made that parameter a int64_t in the first place, but while we are fixing this up change it to a uint32_t field, too. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 0d1b97696696871dc42dfc59d527a0b68b1a1209 Author: Dave Chinner Date: Thu Apr 21 10:46:24 2022 +1000 xfs: convert AGI log flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit f53dde11b405e7c655997513822c90ac9761efdb Author: Dave Chinner Date: Thu Apr 21 10:46:16 2022 +1000 xfs: convert AGF log flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit e7d410ac336856cdae934e14b9c2c749ca5a32ea Author: Dave Chinner Date: Thu Apr 21 10:46:09 2022 +1000 xfs: convert bmapi flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 0e5b8e45229bc2680f4b10505da338f1ca15a6d2 Author: Dave Chinner Date: Thu Apr 21 10:46:01 2022 +1000 xfs: convert bmap extent type flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 79539c7c761ac6d00abd50d5f1e4390f5dc9af18 Author: Dave Chinner Date: Thu Apr 21 10:45:52 2022 +1000 xfs: convert scrub type flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. This touches xfs_fs.h so affects the user API, but the user API fields are also unsigned so the flags should really be unsigned, too. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit a4d98629c93fdb312641dfc336a9bda56358ef72 Author: Dave Chinner Date: Thu Apr 21 10:45:41 2022 +1000 xfs: convert attr type flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit d26eee72d9b9048ba8621e3d47553792729db01f Author: Zong Li Date: Mon Mar 28 17:52:24 2022 +0800 riscv: dts: rename the node name of dma Rename the node name by the generic DMA naming Signed-off-by: Zong Li Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt commit 6f6fa9cede8f65c5752bf584f4a388d3eded04ed Author: Zong Li Date: Mon Mar 28 17:52:23 2022 +0800 riscv: dts: Add dma-channels property and modify compatible Add dma-channels property, then we can determine how many channels there by device tree, in addition, we add the pdma versioning scheme for compatible. Signed-off-by: Zong Li Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Acked-by: Conor Dooley Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt commit 7da9ca3f5b1e435eddcf539d60c0975d98dfa4b9 Author: Chuanhua Han Date: Thu Mar 31 19:43:20 2022 -0700 riscv: mm: Remove the copy operation of pmd Since all processes share the kernel address space, we only need to copy pgd in case of a vmalloc page fault exception, the other levels of page tables are shared, so the operation of copying pmd is unnecessary. Signed-off-by: Chuanhua Han Signed-off-by: Palmer Dabbelt commit 593e34391faafd72102bd79c43994f32e9dd0c91 Author: Dave Chinner Date: Thu Apr 21 10:36:56 2022 +1000 xfs: CIL context doesn't need to count iovecs Now that we account for log opheaders in the log item formatting code, we don't actually use the aggregated count of log iovecs in the CIL for anything. Remove it and the tracking code that calculates it. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 14b07ecd5cd2545fcee3ff29119405f7cf2f59ad Author: Dave Chinner Date: Thu Apr 21 10:36:48 2022 +1000 xfs: xlog_write() doesn't need optype anymore So remove it from the interface and callers. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit be8ddda5f7e01229729a3e00e9971cc2b8a9ec10 Author: Dave Chinner Date: Thu Apr 21 10:36:37 2022 +1000 xfs: xlog_write() no longer needs contwr state The rework of xlog_write() no longer requires xlog_get_iclog_state() to tell it about internal iclog space reservation state to direct it on what to do. Remove this parameter. $ size fs/xfs/xfs_log.o.* text data bss dec hex filename 26520 560 8 27088 69d0 fs/xfs/xfs_log.o.orig 26384 560 8 26952 6948 fs/xfs/xfs_log.o.patched Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 1236bbe86bb83165ff6ba68ce19d81713340f597 Author: Christoph Hellwig Date: Thu Apr 21 10:36:27 2022 +1000 xfs: remove xlog_verify_dest_ptr Just check that the offset in xlog_write_vec is smaller than the iclog size and remove the expensive cycling through all iclogs. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit ad3e3693182bb990484b187b33c7f9735bb549be Author: Dave Chinner Date: Thu Apr 21 10:36:15 2022 +1000 xfs: introduce xlog_write_partial() Re-implement writing of a log vector that does not fit into the current iclog. The iclog will already be in XLOG_STATE_WANT_SYNC because xlog_get_iclog_space() will have reserved all the remaining iclog space for us, hence we can simply iterate over the iovecs in the log vector getting more iclog space until the entire log vector is written. Handling this partial write case separately means we do need to pass unnecessary state around for the common, fast path case when the log vector fits entirely within the current iclog. It isolates the complexity and allows us to modify and improve the partial write case without impacting the simple fast path. This change includes several improvements incorporated from patches written by Christoph Hellwig. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit db357078b0423e0a86a633780cbca3f01c54885d Author: Dave Chinner Date: Thu Apr 21 10:36:05 2022 +1000 xfs: introduce xlog_write_full() Introduce an optimised version of xlog_write() that is used when the entire write will fit in a single iclog. This greatly simplifies the implementation of writing a log vector chain into an iclog, and sets the ground work for a much more understandable xlog_write() implementation. This incorporates some factoring and simplifications proposed by Christoph Hellwig. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit decb545fc081a1f03d4216831afb82482e8b6342 Author: Christoph Hellwig Date: Thu Apr 21 10:35:53 2022 +1000 xfs: change the type of ic_datap Turn ic_datap from a char into a void pointer given that it points to arbitrary data. Signed-off-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong [dgc: also remove (char *) cast in xlog_alloc_log()] Signed-off-by: Dave Chinner commit d80fc2914f9125a723d9af7038b1592fa8d1ea96 Author: Dave Chinner Date: Thu Apr 21 10:35:19 2022 +1000 xfs: pass lv chain length into xlog_write() The caller of xlog_write() usually has a close accounting of the aggregated vector length contained in the log vector chain passed to xlog_write(). There is no need to iterate the chain to calculate he length of the data in xlog_write_calculate_len() if the caller is already iterating that chain to build it. Passing in the vector length avoids doing an extra chain iteration, which can be a significant amount of work given that large CIL commits can have hundreds of thousands of vectors attached to the chain. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit c5141320c42b08b99b7c4b250ac9675d7c7ed3a7 Author: Dave Chinner Date: Thu Apr 21 10:35:09 2022 +1000 xfs: log ticket region debug is largely useless xlog_tic_add_region() is used to trace the regions being added to a log ticket to provide information in the situation where a ticket reservation overrun occurs. The information gathered is stored int the ticket, and dumped if xlog_print_tic_res() is called. For a front end struct xfs_trans overrun, the ticket only contains reservation tracking information - the ticket is never handed to the log so has no regions attached to it. The overrun debug information in this case comes from xlog_print_trans(), which walks the items attached to the transaction and dumps their attached formatted log vectors directly. It also dumps the ticket state, but that only contains reservation accounting and nothing else. Hence xlog_print_tic_res() never dumps region or overrun information from this path. xlog_tic_add_region() is actually called from xlog_write(), which means it is being used to track the regions seen in a CIL checkpoint log vector chain. In looking at CIL behaviour recently, I've seen 32MB checkpoints regularly exceed 250,000 regions in the LV chain. The log ticket debug code can track *15* regions. IOWs, if there is a ticket overrun in the CIL code, the ticket region tracking code is going to be completely useless for determining what went wrong. The only thing it can tell us is how much of an overrun occurred, and we really don't need extra debug information in the log ticket to tell us that. Indeed, the main place we call xlog_tic_add_region() is also adding up the number of regions and the space used so that xlog_write() knows how much will be written to the log. This is exactly the same information that log ticket is storing once we take away the useless region tracking array. Hence xlog_tic_add_region() is not useful, but can be called 250,000 times a CIL push... Just strip all that debug "information" out of the of the log ticket and only have it report reservation space information when an overrun occurs. This also reduces the size of a log ticket down by about 150 bytes... Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 8d547cf9d2392585204075243f29022a619550f2 Author: Dave Chinner Date: Thu Apr 21 10:34:59 2022 +1000 xfs: reserve space and initialise xlog_op_header in item formatting Current xlog_write() adds op headers to the log manually for every log item region that is in the vector passed to it. While xlog_write() needs to stamp the transaction ID into the ophdr, we already know it's length, flags, clientid, etc at CIL commit time. This means the only time that xlog write really needs to format and reserve space for a new ophdr is when a region is split across two iclogs. Adding the opheader and accounting for it as part of the normal formatted item region means we simplify the accounting of space used by a transaction and we don't have to special case reserving of space in for the ophdrs in xlog_write(). It also means we can largely initialise the ophdr in transaction commit instead of xlog_write, making the xlog_write formatting inner loop much tighter. xlog_prepare_iovec() is now too large to stay as an inline function, so we move it out of line and into xfs_log.c. Object sizes: text data bss dec hex filename 1125934 305951 484 1432369 15db31 fs/xfs/built-in.a.before 1123360 305951 484 1429795 15d123 fs/xfs/built-in.a.after So the code is a roughly 2.5kB smaller with xlog_prepare_iovec() now out of line, even though it grew in size itself. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 3c352bef8335a8d9d8f14bc0bd533df023280a72 Author: Dave Chinner Date: Thu Apr 21 10:34:49 2022 +1000 xfs: move log iovec alignment to preparation function To include log op headers directly into the log iovec regions that the ophdrs wrap, we need to move the buffer alignment code from xlog_finish_iovec() to xlog_prepare_iovec(). This is because the xlog_op_header is only 12 bytes long, and we need the buffer that the caller formats their data into to be 8 byte aligned. Hence once we start prepending the ophdr in xlog_prepare_iovec(), we are going to need to manage the padding directly to ensure that the buffer pointer returned is correctly aligned. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit c7610dceed39d978ef1ee0f2ab5a3c8d2d54d120 Author: Dave Chinner Date: Thu Apr 21 10:34:33 2022 +1000 xfs: log tickets don't need log client id We currently set the log ticket client ID when we reserve a transaction. This client ID is only ever written to the log by a CIL checkpoint or unmount records, and so anything using a high level transaction allocated through xfs_trans_alloc() does not need a log ticket client ID to be set. For the CIL checkpoint, the client ID written to the journal is always XFS_TRANSACTION, and for the unmount record it is always XFS_LOG, and nothing else writes to the log. All of these operations tell xlog_write() exactly what they need to write to the log (the optype) and build their own opheaders for start, commit and unmount records. Hence we no longer need to set the client id in either the log ticket or the xfs_trans. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 54021b624261fe5b429d7ab4d081c3b2cca153a8 Author: Dave Chinner Date: Thu Apr 21 10:34:15 2022 +1000 xfs: embed the xlog_op_header in the commit record Remove the final case where xlog_write() has to prepend an opheader to a log transaction. Similar to the start record, the commit record is just an empty opheader with a XLOG_COMMIT_TRANS type, so we can just make this the payload for the region being passed to xlog_write() and remove the special handling in xlog_write() for the commit record. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit ffa04c1f2cb047d6a44c3570bfb6e1ca5ba7f489 Author: Dave Chinner Date: Thu Apr 21 10:34:04 2022 +1000 xfs: embed the xlog_op_header in the unmount record Remove another case where xlog_write() has to prepend an opheader to a log transaction. The unmount record + ophdr is smaller than the minimum amount of space guaranteed to be free in an iclog (2 * sizeof(ophdr)) and so we don't have to care about an unmount record being split across 2 iclogs. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 6eaed95e21a0872692246e63cb45542d0f62c922 Author: Dave Chinner Date: Thu Apr 21 10:33:48 2022 +1000 xfs: only CIL pushes require a start record So move the one-off start record writing in xlog_write() out into the static header that the CIL push builds to write into the log initially. This simplifes the xlog_write() logic a lot. pahole on x86-64 confirms that the xlog_cil_trans_hdr is correctly 32 bit aligned and packed for copying the log op and transaction headers directly into the log as a single log region copy. struct xlog_cil_trans_hdr { struct xlog_op_header oph[2]; /* 0 24 */ struct xfs_trans_header thdr; /* 24 16 */ struct xfs_log_iovec lhdr[2]; /* 40 32 */ /* size: 72, cachelines: 2, members: 3 */ /* last cacheline: 8 bytes */ }; A wart is needed to handle the fact that length of the region the opheader points to doesn't include the opheader length. hence if we embed the opheader, we have to substract the opheader length from the length written into the opheader by the generic copying code. This will eventually go away when everything is converted to embedded opheaders. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 735fbf67df56f402e9baa079a5560ebe8fa049c1 Author: Dave Chinner Date: Thu Apr 21 10:33:23 2022 +1000 xfs: factor out the CIL transaction header building It is static code deep in the middle of the CIL push logic. Factor it out into a helper so that it is clear and easy to modify separately. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner commit 11dbdaeff41d9ec9376476889651fac4838bff99 Author: Ammar Faizi Date: Tue Mar 29 17:17:37 2022 +0700 tools/nolibc/string: Implement `strdup()` and `strndup()` These functions are currently only available on architectures that have my_syscall6() macro implemented. Since these functions use malloc(), malloc() uses mmap(), mmap() depends on my_syscall6() macro. On architectures that don't support my_syscall6(), these function will always return NULL with errno set to ENOSYS. Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit b26823c19a12d9a06207ad3051e3d1059a9e1005 Author: Ammar Faizi Date: Tue Mar 29 17:17:36 2022 +0700 tools/nolibc/string: Implement `strnlen()` size_t strnlen(const char *str, size_t maxlen); The strnlen() function returns the number of bytes in the string pointed to by sstr, excluding the terminating null byte ('\0'), but at most maxlen. In doing this, strnlen() looks only at the first maxlen characters in the string pointed to by str and never beyond str[maxlen-1]. The first use case of this function is for determining the memory allocation size in the strndup() function. Link: https://lore.kernel.org/lkml/CAOG64qMpEMh+EkOfjNdAoueC+uQyT2Uv3689_sOr37-JxdJf4g@mail.gmail.com Suggested-by: Alviro Iskandar Setiawan Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 0e0ff638400be8f497a35b51a4751fd823f6bd6a Author: Ammar Faizi Date: Tue Mar 29 17:17:35 2022 +0700 tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()` Implement basic dynamic allocator functions. These functions are currently only available on architectures that have nolibc mmap() syscall implemented. These are not a super-fast memory allocator, but at least they can satisfy basic needs for having heap without libc. Cc: David Laight Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 5a18d07ce3006dbcb3c4cfc7bf1c094a5da19540 Author: Ammar Faizi Date: Tue Mar 29 17:17:34 2022 +0700 tools/nolibc/types: Implement `offsetof()` and `container_of()` macro Implement `offsetof()` and `container_of()` macro. The first use case of these macros is for `malloc()`, `realloc()` and `free()`. Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 544fa1a2d3e61c954ab531f2c790bc79c1745606 Author: Ammar Faizi Date: Tue Mar 29 17:17:33 2022 +0700 tools/nolibc/sys: Implement `mmap()` and `munmap()` Implement mmap() and munmap(). Currently, they are only available for architecures that have my_syscall6 macro. For architectures that don't have, this function will return -1 with errno set to ENOSYS (Function not implemented). This has been tested on x86 and i386. Notes for i386: 1) The common mmap() syscall implementation uses __NR_mmap2 instead of __NR_mmap. 2) The offset must be shifted-right by 12-bit. Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit f4738ff74c74241c2458269bb6afb64000ec1001 Author: Ammar Faizi Date: Tue Mar 29 17:17:32 2022 +0700 tools/nolibc: i386: Implement syscall with 6 arguments On i386, the 6th argument of syscall goes in %ebp. However, both Clang and GCC cannot use %ebp in the clobber list and in the "r" constraint without using -fomit-frame-pointer. To make it always available for any kind of compilation, the below workaround is implemented. 1) Push the 6-th argument. 2) Push %ebp. 3) Load the 6-th argument from 4(%esp) to %ebp. 4) Do the syscall (int $0x80). 5) Pop %ebp (restore the old value of %ebp). 6) Add %esp by 4 (undo the stack pointer). Cc: x86@kernel.org Cc: llvm@lists.linux.dev Link: https://lore.kernel.org/lkml/2e335ac54db44f1d8496583d97f9dab0@AcuMS.aculab.com Suggested-by: David Laight Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 1590c59836dace3a20945bad049fe8802c4e6f3f Author: Ammar Faizi Date: Tue Mar 29 17:17:31 2022 +0700 tools/nolibc: Remove .global _start from the entry point code Building with clang yields the following error: ``` :3:1: error: _start changed binding to STB_GLOBAL .global _start ^ 1 error generated. ``` Make sure only specify one between `.global _start` and `.weak _start`. Remove `.global _start`. Cc: llvm@lists.linux.dev Reviewed-by: Nick Desaulniers Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 37d62758e773939636b8fa64a1a39a8a0d3a9f8c Author: Ammar Faizi Date: Tue Mar 29 17:17:30 2022 +0700 tools/nolibc: Replace `asm` with `__asm__` Replace `asm` with `__asm__` to support compilation with -std flag. Using `asm` with -std flag makes GCC think `asm()` is a function call instead of an inline assembly. GCC doc says: For the C language, the `asm` keyword is a GNU extension. When writing C code that can be compiled with `-ansi` and the `-std` options that select C dialects without GNU extensions, use `__asm__` instead of `asm`. Link: https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html Reported-by: Alviro Iskandar Setiawan Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 5312aaa5d567f0dfc11681ad991a78e9da43fe7b Author: Ammar Faizi Date: Tue Mar 29 17:17:29 2022 +0700 tools/nolibc: x86-64: Update System V ABI document link The old link no longer works, update it. Acked-by: Willy Tarreau Signed-off-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 2475d37ac30b8a850d3dd4fcbcb20895928b73fd Author: Willy Tarreau Date: Wed Mar 23 08:18:07 2022 +0100 tools/nolibc/stdlib: only reference the external environ when inlined When building with gcc at -O0 we're seeing link errors due to the "environ" variable being referenced by getenv(). The problem is that at -O0 gcc will not inline getenv() and will not drop the external reference. One solution would be to locally declare the variable as weak, but then it would appear in all programs even those not using it, and would be confusing to users of getenv() who would forget to set environ to envp. An alternate approach used in this patch consists in always inlining the outer part of getenv() that references this extern so that it's always dropped when not used. The biggest part of the function was now moved to a new function called _getenv() that's still not inlined by default. Reported-by: Ammar Faizi Signed-off-by: Willy Tarreau Tested-by: Ammar Faizi Signed-off-by: Paul E. McKenney commit 96980b833a21c6dc29d0dfdc8f211fb8a10256a7 Author: Willy Tarreau Date: Wed Mar 23 08:18:06 2022 +0100 tools/nolibc/string: do not use __builtin_strlen() at -O0 clang wants to use strlen() for __builtin_strlen() at -O0. We don't really care about -O0 but it at least ought to build, so let's make sure we don't choke on this, by dropping the optimizationn for constant strings in this case. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0b37dff10bc05576f9594a10e8ef9c718dab931f Author: Willy Tarreau Date: Mon Mar 21 18:33:14 2022 +0100 tools/nolibc: add the nolibc subdir to the common Makefile The Makefile in tools/ is used to forward options to the makefiles in the various subdirs. Let's add nolibc there so that it becomes possible to make tools/nolibc_headers_standalone from the main tree to simply create a completely usable sysroot. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 24326164687b303e3a7a5b8ef83c0f34c5582b2c Author: Willy Tarreau Date: Mon Mar 21 18:33:13 2022 +0100 tools/nolibc: add a makefile to install headers This provides a target "headers_standalone" which installs the nolibc's arch-specific headers with "arch.h" taken from the current arch (or a concatenation of both i386 and x86_64 for arch=x86), then installs kernel headers. This creates a convenient sysroot which is directly usable by a bare-metal compiler to create any executable. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 96d2a1313fe00927b33bb0ccbc3e8cd731826f7d Author: Willy Tarreau Date: Mon Mar 21 18:33:12 2022 +0100 tools/nolibc/types: add poll() and waitpid() flag definitions - POLLIN etc were missing, so poll() could only be used with timeouts. - WNOHANG was not defined and is convenient to check if a child is still running Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 54abe3590fd350afb9cde2398dd3f4ba5bf6d167 Author: Willy Tarreau Date: Mon Mar 21 18:33:11 2022 +0100 tools/nolibc/sys: add syscall definition for getppid() This is essentially for completeness as it's not the most often used in regtests. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 0e7b492943ec8cfdc7fffd9304d496315f781ea7 Author: Willy Tarreau Date: Mon Mar 21 18:33:10 2022 +0100 tools/nolibc/string: add strcmp() and strncmp() We need these functions all the time, including when checking environment variables and parsing command-line arguments. These implementations were optimized to show optimal code size on a wide range of compilers (22 bytes return included for strcmp(), 33 for strncmp()). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit bd845a193aae4b99da5215fcfff0e9014b9f7b96 Author: Willy Tarreau Date: Mon Mar 21 18:33:09 2022 +0100 tools/nolibc/stdio: add support for '%p' to vfprintf() %p remains quite useful in test code, and the code path can easily be merged with the existing "%x" thus only adds ~50 bytes, thus let's add it. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 077d0a392446981cde2e8dd23090140bdd9fb728 Author: Willy Tarreau Date: Mon Mar 21 18:33:08 2022 +0100 tools/nolibc/stdlib: add a simple getenv() implementation This implementation relies on an extern definition of the environ variable, that the caller must declare and initialize from envp. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 170b230d22e89681ebca1a3d972dca441c8e4be5 Author: Willy Tarreau Date: Mon Mar 21 18:33:07 2022 +0100 tools/nolibc/stdio: make printf(%s) accept NULL It's often convenient to support this, especially in test programs where a NULL may correspond to an allocation error or a non-existing value. Let's make printf("%s") support being passed a NULL. In this case it prints "(null)" like glibc's printf(). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit f0f04f28d5ae483b3b354cb3b63a3bab0b00cee4 Author: Willy Tarreau Date: Mon Feb 7 17:23:54 2022 +0100 tools/nolibc/stdlib: implement abort() libgcc uses it for certain divide functions, so it must be exported. Like for memset() we do that in its own section so that the linker can strip it when not needed. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit c4486e97283d0b3d72a8eeda91e53e2ea9b62fbe Author: Willy Tarreau Date: Mon Feb 7 17:23:53 2022 +0100 tools/nolibc: also mention how to build by just setting the include path Now that a few basic include files are provided, some simple portable programs may build, which will save them from having to surround their includes with #ifndef NOLIBC. This patch mentions how to proceed, and enumerates the list of files that are covered. A comprehensive list of required include files is available here: https://en.cppreference.com/w/c/header Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit cec1505321020287c3acc5a63dd75859ebf5ad0d Author: Willy Tarreau Date: Mon Feb 7 17:23:52 2022 +0100 tools/nolibc/time: create time.h with time() The time() syscall is used by a few simple applications, and is trivial to implement based on gettimeofday() that we already have. Let's create the file to ease porting and provide the function. It never returns any error, though it may segfault in case of invalid pointer, like other implementations relying on gettimeofday(). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 99cb50ab94b2aa11c756c4ba14ef09197a7ebe7b Author: Willy Tarreau Date: Mon Feb 7 17:23:51 2022 +0100 tools/nolibc/signal: move raise() to signal.h This function is normally found in signal.h, and providing the file eases porting of existing programs. Let's move it there. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 180a9797b03472e6881066d9752f2f0d81e1880f Author: Willy Tarreau Date: Mon Feb 7 17:23:50 2022 +0100 tools/nolibc/unistd: add usleep() This call is trivial to implement based on select() to complete sleep() and msleep(), let's add it. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 4619de344657c23101e8976b816466910dfb2759 Author: Willy Tarreau Date: Mon Feb 7 17:23:49 2022 +0100 tools/nolibc/unistd: extract msleep(), sleep(), tcsetpgrp() to unistd.h These functions are normally provided by unistd.h. For ease of porting, let's create the file and move them there. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 45a794bf7cee2988278802aeb64f7fc075f45f7f Author: Willy Tarreau Date: Mon Feb 7 17:23:48 2022 +0100 tools/nolibc/errno: extract errno.h from sys.h This allows us to provide a minimal errno.h to ease porting applications that use it. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 8d304a3740232f018fca19d529cbc8d13afac755 Author: Willy Tarreau Date: Mon Feb 7 17:23:47 2022 +0100 tools/nolibc/string: export memset() and memmove() "clang -Os" and "gcc -Ofast" without -ffreestanding may ignore memset() and memmove(), hoping to provide their builtin equivalents, and finally not find them. Thus we must export these functions for these rare cases. Note that as they're set in their own sections, they will be eliminated by the linker if not used. In addition, they do not prevent gcc from identifying them and replacing them with the shorter "rep movsb" or "rep stosb" when relevant. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 023033fe343cdf2ba83ab762f8de69241c7fc086 Author: Willy Tarreau Date: Mon Feb 7 17:23:46 2022 +0100 tools/nolibc/types: define PATH_MAX and MAXPATHLEN These ones are often used and commonly set by applications to fallback values. Let's fix them both to agree on PATH_MAX=4096 by default, as is already present in linux/limits.h. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit dffeb81af5fe5eedccf5ea4a8a120d8c3accd26e Author: Willy Tarreau Date: Mon Feb 7 17:23:45 2022 +0100 tools/nolibc/arch: mark the _start symbol as weak By doing so we can link together multiple C files that have been compiled with nolibc and which each have a _start symbol. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 07f47ea06fe9d38c5e8d9068fba2468ed8bb8b59 Author: Willy Tarreau Date: Mon Feb 7 17:23:44 2022 +0100 tools/nolibc: move exported functions to their own section Some functions like raise() and memcpy() are permanently exported because they're needed by libgcc on certain platforms. However most of the time they are not needed and needlessly take space. Let's move them to their own sub-section, called .text.nolibc_. This allows ld to get rid of them if unused when passed --gc-sections. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit d9390de638cd9788090c6299273a41a8cfa0b499 Author: Willy Tarreau Date: Mon Feb 7 17:23:43 2022 +0100 tools/nolibc/string: add tiny versions of strncat() and strlcat() While these functions are often dangerous, forcing the user to work around their absence is often much worse. Let's provide small versions of each of them. The respective sizes in bytes on a few architectures are: strncat(): x86:0x33 mips:0x68 arm:0x3c strlcat(): x86:0x25 mips:0x4c arm:0x2c The two are quite different, and strncat() is even different from strncpy() in that it limits the amount of data it copies and will always terminate the output by one zero, while strlcat() will always limit the total output to the specified size and will put a zero if possible. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit b312eb0b8711dbfbe2b45681926eb553e8ac8de3 Author: Willy Tarreau Date: Mon Feb 7 17:23:42 2022 +0100 tools/nolibc/string: add strncpy() and strlcpy() These are minimal variants. strncpy() always fills the destination for chars, while strlcpy() copies no more than including the zero and returns the source's length. The respective sizes on various archs are: strncpy(): x86:0x1f mips:0x30 arm:0x20 strlcpy(): x86:0x17 mips:0x34 arm:0x1a Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit d76232ff8be662b8851e975d13d59cad4bf423d3 Author: Willy Tarreau Date: Mon Feb 7 17:23:41 2022 +0100 tools/nolibc/string: slightly simplify memmove() The direction test inside the loop was not always completely optimized, resulting in a larger than necessary function. This change adds a direction variable that is set out of the loop. Now the function is down to 48 bytes on x86, 32 on ARM and 68 on mips. It's worth noting that other approaches were attempted (including relying on the up and down functions) but they were only slightly beneficial on x86 and cost more on others. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit d8dcc2d8d93e5d4263ca9f8c5bdfb713f82fe923 Author: Willy Tarreau Date: Mon Feb 7 17:23:40 2022 +0100 tools/nolibc/string: use unidirectional variants for memcpy() Till now memcpy() relies on memmove(), but it's always included for libgcc, so we have a larger than needed function. Let's implement two unidirectional variants to copy from bottom to top and from top to bottom, and use the former for memcpy(). The variants are optimized to be compact, and at the same time the compiler is sometimes able to detect the loop and to replace it with a "rep movsb". The new function is 24 bytes instead of 52 on x86_64. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 830acd088edc1604ee46916188491ef634441fc6 Author: Willy Tarreau Date: Mon Feb 7 17:23:39 2022 +0100 tools/nolibc/sys: make getpgrp(), getpid(), gettid() not set errno These syscalls never fail so there is no need to extract and set errno for them. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 6e277371a5c4c73deb799aabfd5613ee3758e810 Author: Willy Tarreau Date: Mon Feb 7 17:23:38 2022 +0100 tools/nolibc/stdlib: make raise() use the lower level syscalls only raise() doesn't set errno, so there's no point calling kill(), better call sys_kill(), which also reduces the function's size. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ac90226d53051c1ae0f0e1b71596fb038ddb6cf6 Author: Willy Tarreau Date: Mon Feb 7 17:23:37 2022 +0100 tools/nolibc/stdlib: avoid a 64-bit shift in u64toh_r() The build of printf() on mips requires libgcc for functions __ashldi3 and __lshrdi3 due to 64-bit shifts when scanning the input number. These are not really needed in fact since we scan the number 4 bits at a time. Let's arrange the loop to perform two 32-bit shifts instead on 32-bit platforms. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit a7604ba149e76d0449484116e7bf9cd0c26dafb2 Author: Willy Tarreau Date: Mon Feb 7 17:23:36 2022 +0100 tools/nolibc/sys: make open() take a vararg on the 3rd argument Let's pass a vararg to open() so that it remains compatible with existing code. The arg is only dereferenced when flags contain O_CREAT. The function is generally not inlined anymore, causing an extra call (total 16 extra bytes) but it's still optimized for constant propagation, limiting the excess to no more than 16 bytes in practice when open() is called without O_CREAT, and ~40 with O_CREAT, which remains reasonable. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit acab7bcdb1bc14d5a6a0c3c1d2b9bd681172cf47 Author: Willy Tarreau Date: Mon Feb 7 17:23:35 2022 +0100 tools/nolibc/stdio: add perror() to report the errno value It doesn't contain the text for the error codes, but instead displays "errno=" followed by the errno value. Just like the regular errno, if a non-empty message is passed, it's placed followed with ": " on the output before the errno code. The message is emitted on stderr. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 51469d5ab38fd1ac2182da8cd49eea3420b8000b Author: Willy Tarreau Date: Mon Feb 7 17:23:34 2022 +0100 tools/nolibc/types: define EXIT_SUCCESS and EXIT_FAILURE These ones are found in some examples found in man pages and ease portability tests. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7e4346f4a3a611a6233ba388080c1426545da4fc Author: Willy Tarreau Date: Mon Feb 7 17:23:33 2022 +0100 tools/nolibc/stdio: add a minimal [vf]printf() implementation This adds a minimal vfprintf() implementation as well as the commonly used fprintf() and printf() that rely on it. For now the function supports: - formats: %s, %c, %u, %d, %x - modifiers: %l and %ll - unknown chars are considered as modifiers and are ignored It is designed to remain minimalist, despite this printf() is 549 bytes on x86_64. It would be wise not to add too many formats. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit e3e19052d54db8d492b8f82f8516139469bad5d3 Author: Willy Tarreau Date: Mon Feb 7 17:23:32 2022 +0100 tools/nolibc/stdio: add fwrite() to stdio We'll use it to write substrings. It relies on a simpler _fwrite() that only takes one size. fputs() was also modified to rely on it. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 99b037cbd5a22e34202d32aad15bcfa1c06d1d80 Author: Willy Tarreau Date: Mon Feb 7 17:23:31 2022 +0100 tools/nolibc/stdio: add stdin/stdout/stderr and fget*/fput* functions The standard puts() function always emits the trailing LF which makes it unconvenient for small string concatenation. fputs() ought to be used instead but it requires a FILE*. This adds 3 dummy FILE* values (stdin, stdout, stderr) which are in fact pointers to struct FILE of one byte. We reserve 3 pointer values for them, -3, -2 and -1, so that they are ordered, easing the tests and mapping to integer. >From this, fgetc(), fputc(), fgets() and fputs() were implemented, and the previous putchar() and getchar() now remap to these. The standard getc() and putc() macros were also implemented as pointing to these ones. There is absolutely no buffering, fgetc() and fgets() read one byte at a time, fputc() writes one byte at a time, and only fputs() which knows the string's length writes all of it at once. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 4e383a66acfe16827ce7fbc0e60c56782a83fc92 Author: Willy Tarreau Date: Mon Feb 7 17:23:30 2022 +0100 tools/nolibc/stdio: add a minimal set of stdio functions This only provides getchar(), putchar(), and puts(). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 5f493178ef3187b939d3068563e5da6045085c2a Author: Willy Tarreau Date: Mon Feb 7 17:23:29 2022 +0100 tools/nolibc/stdlib: add utoh() and u64toh() This adds a pair of functions to emit hex values. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit b1c21e7d99cdab987fb858679fbc012868caac40 Author: Willy Tarreau Date: Mon Feb 7 17:23:28 2022 +0100 tools/nolibc/stdlib: add i64toa() and u64toa() These are 64-bit variants of the itoa() and utoa() functions. They also support reentrant ones, and use the same itoa_buffer. The functions are a bit larger than the previous ones in 32-bit mode (86 and 98 bytes on x86_64 and armv7 respectively), which is why we continue to provide them as separate functions. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 66c397c4d2e15871c50940c168b7d4a76aaa08a9 Author: Willy Tarreau Date: Mon Feb 7 17:23:27 2022 +0100 tools/nolibc/stdlib: replace the ltoa() function with more efficient ones The original ltoa() function and the reentrant one ltoa_r() present a number of drawbacks. The divide by 10 generates calls to external code from libgcc_s, and the number does not necessarily start at the beginning of the buffer. Let's rewrite these functions so that they do not involve a divide and only use loops on powers of 10, and implement both signed and unsigned variants, always starting from the buffer's first character. Instead of using a static buffer for each function, we're now using a common one. In order to avoid confusion with the ltoa() name, the new functions are called itoa_r() and utoa_r() to distinguish the signed and unsigned versions, and for convenience for their callers, these functions now reutrn the number of characters emitted. The ltoa_r() function is just an inline mapping to the signed one and which returns the buffer. The functions are quite small (86 bytes on x86_64, 68 on armv7) and do not depend anymore on external code. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 56d68a3c1f41ca0843fd9151654c35f4925d911b Author: Willy Tarreau Date: Mon Feb 7 17:23:26 2022 +0100 tools/nolibc/stdlib: move ltoa() to stdlib.h This function is not standard and performs the opposite of atol(). Let's move it with atol(). It's been split between a reentrant function and one using a static buffer. There's no more definition in nolibc.h anymore now. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit eba6d00d38e7c26dd5b948ed75200d05f67d8266 Author: Willy Tarreau Date: Mon Feb 7 17:23:25 2022 +0100 tools/nolibc/types: move makedev to types.h and make it a macro The makedev() man page says it's supposed to be a macro and that some OSes have it with the other ones in sys/types.h so it now makes sense to move it to types.h as a macro. Let's also define major() and minor() that perform the reverse operation. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 306c9fd4c686eebf4e0487bc4ad5dca8e68c19be Author: Willy Tarreau Date: Sun Feb 13 09:53:01 2022 +0100 tools/nolibc/types: make FD_SETSIZE configurable The macro was hard-coded to 256 but it's common to see it redefined. Let's support this and make sure we always allocate enough entries for the cases where it wouldn't be multiple of 32. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 8cb98b3fce152e8ba46d1e25515deab08d7ec271 Author: Willy Tarreau Date: Sun Feb 13 09:52:10 2022 +0100 tools/nolibc/types: move the FD_* functions to macros in types.h FD_SET, FD_CLR, FD_ISSET, FD_ZERO are often expected to be macros and not functions. In addition we already have a file dedicated to such macros and types used by syscalls, it's types.h, so let's move them there and turn them to macros. FD_CLR() and FD_ISSET() were missing, so they were added. FD_ZERO() now deals with its own loop so that it doesn't rely on memset() that sets one byte at a time. Cc: David Laight Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 50850c38b290c22da37a77e24c9382933b200c8c Author: Willy Tarreau Date: Mon Feb 7 17:23:22 2022 +0100 tools/nolibc/ctype: add the missing is* functions There was only isdigit, this commit adds the other ones. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 62a2af077493df4ebea22df4de8df4aea3c882cc Author: Willy Tarreau Date: Mon Feb 7 17:23:21 2022 +0100 tools/nolibc/ctype: split the is* functions to ctype.h In fact there's only isdigit() for now. More should definitely be added. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit c91eb033895593a998c5a49d562fb760ab2fa5bb Author: Willy Tarreau Date: Mon Feb 7 17:23:20 2022 +0100 tools/nolibc/string: split the string functions into string.h The string manipulation functions (mem*, str*) are now found in string.h. The file depends on almost nothing and will be usable from other includes if needed. Maybe more functions could be added. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 06fdba53e0a9a897ba00c3602f14b3498b321655 Author: Willy Tarreau Date: Mon Feb 7 17:23:19 2022 +0100 tools/nolibc/stdlib: extract the stdlib-specific functions to their own file The new file stdlib.h contains the definitions of functions that are usually found in stdlib.h. Many more could certainly be added. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit bd8c8fbb866fe524b769a853f2b3525c227165fa Author: Willy Tarreau Date: Mon Feb 7 17:23:18 2022 +0100 tools/nolibc/sys: split the syscall definitions into their own file The syscall definitions were moved to sys.h. They were arranged in a more easily maintainable order, whereby the sys_xxx() and xxx() functions were grouped together, which also enlights the occasional mappings such as wait relying on wait4(). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 271661c1cde5ff47eb7af9946866cd66b70dc328 Author: Willy Tarreau Date: Mon Feb 7 17:23:17 2022 +0100 tools/nolibc/arch: split arch-specific code into individual files In order to ease maintenance, this splits the arch-specific code into one file per architecture. A common file "arch.h" is used to include the right file among arch-* based on the detected architecture. Projects which are already split per architecture could simply rename these files to $arch/arch.h and get rid of the common arch.h. For this reason, include guards were placed into each arch-specific file. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit cc7a492ad0a076dff5cb4281b1516676d7924fcf Author: Willy Tarreau Date: Mon Feb 7 17:23:16 2022 +0100 tools/nolibc/types: split syscall-specific definitions into their own files The macros and type definitions used by a number of syscalls were moved to types.h where they will be easier to maintain. A few of them are arch-specific and must not be moved there (e.g. O_*, sys_stat_struct). A warning about them was placed at the top of the file. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 967cce191f50090d5cbd3841ee2bbb7835afeae2 Author: Willy Tarreau Date: Mon Feb 7 17:23:15 2022 +0100 tools/nolibc/std: move the standard type definitions to std.h The ordering of includes and definitions for now is a bit of a mess, as for example asm/signal.h is included after int definitions, but plenty of structures are defined later as they rely on other includes. Let's move the standard type definitions to a dedicated file that is included first. We also move NULL there. This way all other includes are aware of it, and we can bring asm/signal.h back to the top of the file. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit fb036ad7db108649189d6577051a87e3d3741cf4 Author: Paul E. McKenney Date: Mon Mar 28 13:30:15 2022 -0700 rcutorture: Make torture.sh allow for --kasan The torture.sh script provides extra memory for scftorture and rcuscale. However, the total memory provided is only 1G, which is less than the 2G that is required for KASAN testing. This commit therefore ups the torture.sh script's 1G to 2G. Signed-off-by: Paul E. McKenney commit d69e048b27cceec20b637ae8ec72102c79ae673c Author: Paul E. McKenney Date: Mon Mar 28 13:16:18 2022 -0700 rcutorture: Make torture.sh refscale and rcuscale specify Tasks Trace RCU Now that the Tasks RCU flavors are selected by their users rather than by the rcutorture scenarios, torture.sh fails when attempting to run NOPREEMPT scenarios for refscale and rcuscale. This commit therefore makes torture.sh specify CONFIG_TASKS_TRACE_RCU=y to avoid such failure. Why not also CONFIG_TASKS_RCU? Because tracing selects this one. Signed-off-by: Paul E. McKenney commit 31015625768e6d8bc808a892b221b69afaaa8d07 Author: Paul E. McKenney Date: Sun Mar 27 10:06:53 2022 -0700 rcutorture: Make kvm.sh allow more memory for --kasan runs KASAN allots significant memory to track allocation state, and the amount of memory has increased recently, which results in frequent OOMs on a few of the rcutorture scenarios. This commit therefore provides 2G of memory for --kasan runs, up from the 512M default. Signed-off-by: Paul E. McKenney commit c7756fff4fa11611f81f0f3b1cb13f63b5d0f87e Author: Paul E. McKenney Date: Sat Mar 12 21:32:55 2022 -0800 torture: Save "make allmodconfig" .config file Currently, torture.sh saves only the build output and exit code from the "make allmodconfig" test. This commit also saves the .config file. Signed-off-by: Paul E. McKenney commit f877e3993b53e2dd1bdfadfc2bca68619d8a3f23 Author: Paul E. McKenney Date: Sat Mar 12 21:12:41 2022 -0800 scftorture: Remove extraneous "scf" from per_version_boot_params There is an extraneous "scf" in the per_version_boot_params shell function used by scftorture. No harm done in that it is just passed as an argument to the /init program in initrd, but this commit nevertheless removes it. Signed-off-by: Paul E. McKenney commit eec52c7fb51e5a1b89508bdc0e91d955256ec5f1 Author: Paul E. McKenney Date: Tue Mar 8 10:23:46 2022 -0800 rcutorture: Adjust scenarios' Kconfig options for CONFIG_PREEMPT_DYNAMIC Now that CONFIG_PREEMPT_DYNAMIC=y is the default, kernels that are ostensibly built with CONFIG_PREEMPT_NONE=y or CONFIG_PREEMPT_VOLUNTARY=y are now actually built with CONFIG_PREEMPT=y, but are by default booted so as to disable preemption. Although this allows much more flexibility from a single kernel binary, it means that the current rcutorture scenarios won't find build errors that happen only when preemption is fully disabled at build time. This commit therefore adds CONFIG_PREEMPT_DYNAMIC=n to several scenarios, and while in the area switches one from CONFIG_PREEMPT_NONE=y to CONFIG_PREEMPT_VOLUNTARY=y to add coverage of this Kconfig option. Signed-off-by: Paul E. McKenney commit 3e112a39f7ad6d4cb1110585b11c5e74294e9578 Author: Paul E. McKenney Date: Tue Mar 1 06:36:52 2022 -0800 torture: Enable CSD-lock stall reports for scftorture This commit passes the csdlock_debug=1 kernel parameter in order to enable CSD-lock stall reports for torture.sh scftorure runs. Signed-off-by: Paul E. McKenney commit 00f3133b7f9598304c1fe25ad2d5c12b91199761 Author: Paul E. McKenney Date: Thu Feb 24 16:08:48 2022 -0800 torture: Skip vmlinux check for kvm-again.sh runs The kvm-again.sh script reruns an previously built set of kernels, so the vmlinux files are associated with that previous run, not this on. This results in kvm-find_errors.sh reporting spurious failed-build errors. This commit therefore omits the vmlinux check for kvm-again.sh runs. Signed-off-by: Paul E. McKenney commit bf5e7a2f4609db6cd65c0cad22ab2fbb52f1927e Author: Paul E. McKenney Date: Sun Mar 27 12:13:30 2022 -0700 scftorture: Adjust for TASKS_RCU Kconfig option being selected This commit adjusts the scftorture PREEMPT and NOPREEMPT scenarios to account for the TASKS_RCU Kconfig option being explicitly selected rather than computed in isolation. Signed-off-by: Paul E. McKenney commit 5ce027f4cd0e2f28ea5574ede9eef290e2ede5c5 Author: Paul E. McKenney Date: Fri Mar 25 17:05:40 2022 -0700 rcuscale: Allow rcuscale without RCU Tasks Rude/Trace Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for RCU Tasks Rude and RCU Tasks Trace. Unless that kernel builds rcuscale, whether built-in or as a module, in which case these RCU Tasks flavors are (unnecessarily) built in. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of rcuscale from the presence of RCU Tasks Rude and RCU Tasks Trace. Signed-off-by: Paul E. McKenney commit 4df002d908796c1ff87b985af1d31a0e36e6c66f Author: Paul E. McKenney Date: Fri Mar 25 16:39:01 2022 -0700 rcuscale: Allow rcuscale without RCU Tasks Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds rcuscale, whether built-in or as a module, in which case RCU Tasks is (unnecessarily) built. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of rcuscale from the presence of RCU Tasks. Signed-off-by: Paul E. McKenney commit dec86781a54f4a527386a0b86b22e99e2ac67a09 Author: Paul E. McKenney Date: Fri Mar 25 15:21:07 2022 -0700 refscale: Allow refscale without RCU Tasks Rude/Trace Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for RCU Tasks Rude and RCU Tasks Trace. Unless that kernel builds refscale, whether built-in or as a module, in which case these RCU Tasks flavors are (unnecessarily) built in. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of refscale from the presence of RCU Tasks Rude and RCU Tasks Trace. Signed-off-by: Paul E. McKenney commit 5f654af150fd5aeb9fff138c7cbd72cea016b863 Author: Paul E. McKenney Date: Fri Mar 25 14:39:54 2022 -0700 refscale: Allow refscale without RCU Tasks Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds refscale, whether built-in or as a module, in which case RCU Tasks is (unnecessarily) built in. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of refscale from the presence of RCU Tasks. Signed-off-by: Paul E. McKenney commit 58524e0fed6a4509651005c06dc1a4ecb3ed0a61 Author: Paul E. McKenney Date: Fri Mar 18 08:10:18 2022 -0700 rcutorture: Allow specifying per-scenario stat_interval The rcutorture test suite makes double use of the rcutorture.stat_interval module parameter. As its name suggests, it controls the frequency of statistics printing, but it also controls the rcu_torture_writer() stall timeout. The current setting of 15 seconds works surprisingly well. However, given that the RCU tasks stall-warning timeout is ten -minutes-, 15 seconds is too short for TASKS02, which runs a non-preemptible kernel on a single CPU. This commit therefore adds checks for per-scenario specification of the rcutorture.stat_interval module parameter. Signed-off-by: Paul E. McKenney commit 3831fc02f496cd8a8e6c75217b290fe5158a3f36 Author: Paul E. McKenney Date: Fri Mar 18 08:02:11 2022 -0700 rcutorture: Add CONFIG_PREEMPT_DYNAMIC=n to TASKS02 scenario Now that CONFIG_PREEMPT_DYNAMIC=y is the default, TASKS02 no longer builds a pure non-preemptible kernel that uses Tiny RCU. This commit therefore fixes this new hole in rcutorture testing by adding CONFIG_PREEMPT_DYNAMIC=n to the TASKS02 rcutorture scenario. Signed-off-by: Paul E. McKenney commit 4c3f7b0e1e880e892d4bc4f50bf627b251b6e2cc Author: Paul E. McKenney Date: Thu Mar 17 16:16:45 2022 -0700 rcutorture: Allow rcutorture without RCU Tasks Rude Unless a kernel builds rcutorture, whether built-in or as a module, that kernel is also built with CONFIG_TASKS_RUDE_RCU, whether anything else needs Tasks Rude RCU or not. This unnecessarily increases kernel size. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks Rude. However, there is a need to select CONFIG_TASKS_RUDE_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_RUDE_RCU that selects CONFIG_TASKS_RUDE_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney commit 3b6e1dd42317ec366dab3205f99280e2ab1ad85a Author: Paul E. McKenney Date: Thu Mar 17 15:18:27 2022 -0700 rcutorture: Allow rcutorture without RCU Tasks Currently, a CONFIG_PREEMPT_NONE=y kernel substitutes normal RCU for RCU Tasks. Unless that kernel builds rcutorture, whether built-in or as a module, in which case RCU Tasks is (unnecessarily) used. This both increases kernel size and increases the complexity of certain tracing operations. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks. However, there is a need to select CONFIG_TASKS_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_RCU that selects CONFIG_TASKS_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney commit 40c1278aa7cd51d4f8627f7adc66aa73e01aff81 Author: Paul E. McKenney Date: Thu Mar 17 13:29:59 2022 -0700 rcutorture: Allow rcutorture without RCU Tasks Trace Unless a kernel builds rcutorture, whether built-in or as a module, that kernel is also built with CONFIG_TASKS_TRACE_RCU, whether anything else needs Tasks Trace RCU or not. This unnecessarily increases kernel size. This commit therefore decouples the presence of rcutorture from the presence of RCU Tasks Trace. However, there is a need to select CONFIG_TASKS_TRACE_RCU for testing purposes. Except that casual users must not be bothered with questions -- for them, this needs to be fully automated. There is thus a CONFIG_FORCE_TASKS_TRACE_RCU that selects CONFIG_TASKS_TRACE_RCU, is user-selectable, but which depends on CONFIG_RCU_EXPERT. [ paulmck: Apply kernel test robot feedback. ] Signed-off-by: Paul E. McKenney commit 835f14ed53076384f0e1dad2fddb4881315f124f Author: Paul E. McKenney Date: Thu Mar 17 11:05:09 2022 -0700 rcu: Make the TASKS_RCU Kconfig option be selected Currently, any kernel built with CONFIG_PREEMPTION=y also gets CONFIG_TASKS_RCU=y, which is not helpful to people trying to build preemptible kernels of minimal size. Because CONFIG_TASKS_RCU=y is needed only in kernels doing tracing of one form or another, this commit moves from TASKS_RCU deciding when it should be enabled to the tracing Kconfig options explicitly selecting it. This allows building preemptible kernels without TASKS_RCU, if desired. This commit also updates the SRCU-N and TREE09 rcutorture scenarios in order to avoid Kconfig errors that would otherwise result from CONFIG_TASKS_RCU being selected without its CONFIG_RCU_EXPERT dependency being met. [ paulmck: Apply BPF_SYSCALL feedback from Andrii Nakryiko. ] Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Zhouyi Zhou Cc: Andrii Nakryiko Cc: Alexei Starovoitov Cc: Steven Rostedt Cc: Mathieu Desnoyers Acked-by: Masami Hiramatsu Signed-off-by: Paul E. McKenney commit f596e2ce1c0f250bb3ecc179f611be37e862635f Author: Zqiang Date: Mon Apr 4 07:59:32 2022 +0800 rcu: Use IRQ_WORK_INIT_HARD() to avoid rcu_read_unlock() hangs When booting kernels built with both CONFIG_RCU_STRICT_GRACE_PERIOD=y and CONFIG_PREEMPT_RT=y, the rcu_read_unlock_special() function's invocation of irq_work_queue_on() the init_irq_work() causes the rcu_preempt_deferred_qs_handler() function to work execute in SCHED_FIFO irq_work kthreads. Because rcu_read_unlock_special() is invoked on each rcu_read_unlock() in such kernels, the amount of work just keeps piling up, resulting in a boot-time hang. This commit therefore avoids this hang by using IRQ_WORK_INIT_HARD() instead of init_irq_work(), but only in kernels built with both CONFIG_PREEMPT_RT=y and CONFIG_RCU_STRICT_GRACE_PERIOD=y. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit f1efe84d6fd2af163989025bc285ff9b3b0c764f Author: David Vernet Date: Tue Mar 29 15:26:13 2022 -0700 rcu_sync: Fix comment to properly reflect rcu_sync_exit() behavior The rcu_sync_enter() function is used by updaters to force RCU readers (e.g. percpu-rwsem) to use their slow paths during an update. This is accomplished by setting the ->gp_state of the rcu_sync structure to GP_ENTER. In the case of percpu-rwsem, the readers' slow path waits on a semaphore instead of just incrementing a reader count. Each updater invokes the rcu_sync_exit() function to signal to readers that they may again take their fastpaths. The rcu_sync_exit() function sets the ->gp_state of the rcu_sync structure to GP_EXIT, and if all goes well, after a grace period the ->gp_state reverts back to GP_IDLE. Unfortunately, the rcu_sync_enter() function currently has a comment incorrectly stating that rcu_sync_exit() (by an updater) will re-enable reader "slowpaths". This patch changes the comment to state that this function re-enables reader fastpaths. Signed-off-by: David Vernet Signed-off-by: Paul E. McKenney commit 88ca472f80604c070526eb58b977ea0a9c3c2e1f Author: Zqiang Date: Thu Mar 24 19:15:15 2022 +0800 rcu: Check for successful spawn of ->boost_kthread_task For the spawning of the priority-boost kthreads can fail, improbable though this might seem. This commit therefore refrains from attemoting to initiate RCU priority boosting when The ->boost_kthread_task pointer is NULL. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 70ae7b0ce03347fab35d6d8df81e1165d7ea8045 Author: Frederic Weisbecker Date: Mon Mar 14 14:37:38 2022 +0100 rcu: Fix preemption mode check on synchronize_rcu[_expedited]() An early check on synchronize_rcu[_expedited]() tries to determine if the current CPU is in UP mode on an SMP no-preempt kernel, in which case there is no need to start a grace period since the current assumed quiescent state is all we need. However the preemption mode doesn't take into account the boot selected preemption mode under CONFIG_PREEMPT_DYNAMIC=y, missing a possible early return if the running flavour is "none" or "voluntary". Use the shiny new preempt mode accessors to fix this. However, avoid invoking them during early boot because doing so triggers a WARN_ON_ONCE(). [ paulmck: Update for mainlined API. ] Reported-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Cc: Peter Zijlstra Cc: Neeraj Upadhyay Cc: Valentin Schneider Signed-off-by: Paul E. McKenney commit 80d530b47da41642fab317a9485d58dfbe1e8896 Author: Paul E. McKenney Date: Fri Mar 11 10:10:35 2022 -0800 rcu: Print number of online CPUs in RCU CPU stall-warning messages RCU's synchronous grace periods act quite differently when there is only one online CPU, especially in the no-op case in kernels built with CONFIG_PREEMPTION=n. This change in behavior can be important debugging information, so this commit adds the number of online CPUs to the RCU CPU stall warning messages. Signed-off-by: Paul E. McKenney commit 75182a4eaaf8b697f66d68ad039f021f461dd2a4 Author: Paul E. McKenney Date: Wed Mar 2 11:01:37 2022 -0800 rcu: Add comments to final rcu_gp_cleanup() "if" statement The final "if" statement in rcu_gp_cleanup() has proven to be rather confusing, straightforward though it might have seemed when initially written. This commit therefore adds comments to its "then" and "else" clauses to at least provide a more elevated form of confusion. Reported-by: Boqun Feng Reported-by: Frederic Weisbecker Reported-by: Neeraj Upadhyay Reported-by: Uladzislau Rezki Signed-off-by: Paul E. McKenney commit 3791a22374715b36ad806db13d8b2afb1b57fd36 Author: Paul E. McKenney Date: Mon Feb 28 18:08:33 2022 -0800 kernel/smp: Provide boot-time timeout for CSD lock diagnostics Debugging of problems involving insanely long-running SMI handlers proceeds better if the CSD-lock timeout can be adjusted. This commit therefore provides a new smp.csd_lock_timeout kernel boot parameter that specifies the timeout in milliseconds. The default remains at the previously hard-coded value of five seconds. [ paulmck: Apply feedback from Juergen Gross. ] Cc: Rik van Riel Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Reviewed-by: Juergen Gross Signed-off-by: Paul E. McKenney commit ae4303886652248ed2568c9cb2ab0da485bfd7a7 Author: Damien Le Moal Date: Mon Apr 18 09:06:17 2022 +0900 documentation: zonefs: Cleanup the mount options section Use subsections to separate the descriptions of the "error=" and "explicit-open" mount sections. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit 87c9ce3ffec9060cf7556ed4d3c9e582c8baf575 Author: Damien Le Moal Date: Tue Apr 12 18:54:39 2022 +0900 zonefs: Add active seq file accounting Modify struct zonefs_sb_info to add the s_active_seq_files atomic to count the number of seq files representing a zone that is partially written or explicitly open, that is, to count sequential files with a zone that is in an active state on the device. The helper function zonefs_account_active() is introduced to update this counter whenever a file is written or truncated. This helper is also used in the zonefs_seq_file_write_open() and zonefs_seq_file_write_close() functions when the explicit_open mount option is used. The s_active_seq_files counter is exported through sysfs using the read-only attribute nr_active_seq_files. The device maximum number of active zones is also exported through sysfs with the read-only attribute max_active_seq_files. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit 9277a6d4fbd4aaa668b19b819015f87f0da53a38 Author: Damien Le Moal Date: Tue Apr 12 16:25:34 2022 +0900 zonefs: Export open zone resource information through sysfs To allow applications to easily check the current usage status of the open zone resources of the mounted device, export through sysfs the counter of write open sequential files s_wro_seq_files field of struct zonefs_sb_info. The attribute is named nr_wro_seq_files and is read only. The maximum number of write open sequential files (zones) indicated by the s_max_wro_seq_files field of struct zonefs_sb_info is also exported as the read only attribute max_wro_seq_files. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit 7d6dfbe03bd3bef51ead25d129dabebd8bae1ec4 Author: Damien Le Moal Date: Tue Apr 12 22:38:07 2022 +0900 zonefs: Always do seq file write open accounting The explicit_open mount option forces an explicitly open of the zone of sequential files that are open for writing to ensure that the open file can be written without the device failing write operations due to open zone resources limit being exceeded. To implement this, zonefs accounts all write open seq file when this mount option is used. This accounting however can be easily performed even when the explicit_open mount option is not used, thus allowing applications to control zone resources on their own, without relying on open() system call failures from zonefs. To implement this, the helper zonefs_file_use_exp_open() is removed and replaced with the helper zonefs_seq_file_need_wro() which test if a file is a sequential file being open with write access. zonefs_open_zone() and zonefs_close_zone() are renamed respectively to zonefs_seq_file_write_open() and zonefs_seq_file_write_close() and modified to update the s_wro_seq_files counter regardless of the explicit_open mount option use. If the explicit_open mount option is used, zonefs_seq_file_write_open() execute an explicit zone open operation for a sequential file open for writing for the first time, as before. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit 2b95a23c4f50c42fe85f0d345612075d0f2c3118 Author: Damien Le Moal Date: Tue Apr 12 17:00:13 2022 +0900 zonefs: Rename super block information fields The s_open_zones field of struct zonefs_sb_info is used to count the number of files that are open for writing and may not necessarilly correspond to the number of open zones on the device. For instance, an application may open for writing a sequential zone file, fully write it and keep the file open. In such case, the zone of the file is not open anymore (it is in the full state). Avoid confusion about this counter meaning by renaming it to s_wro_seq_files. To keep things consistent, the field s_max_open_zones is renamed to s_max_wro_seq_files. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit 19139539207934aef6335bdef09c9e4bd70d1808 Author: Damien Le Moal Date: Tue Apr 12 17:41:37 2022 +0900 zonefs: Fix management of open zones The mount option "explicit_open" manages the device open zone resources to ensure that if an application opens a sequential file for writing, the file zone can always be written by explicitly opening the zone and accounting for that state with the s_open_zones counter. However, if some zones are already open when mounting, the device open zone resource usage status will be larger than the initial s_open_zones value of 0. Ensure that this inconsistency does not happen by closing any sequential zone that is open when mounting. Furthermore, with ZNS drives, closing an explicitly open zone that has not been written will change the zone state to "closed", that is, the zone will remain in an active state. Since this can then cause failures of explicit open operations on other zones if the drive active zone resources are exceeded, we need to make sure that the zone is not active anymore by resetting it instead of closing it. To address this, zonefs_zone_mgmt() is modified to change a REQ_OP_ZONE_CLOSE request into a REQ_OP_ZONE_RESET for sequential zones that have not been written. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Cc: Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg commit b954ebba296bb2eb2e38322f17aaa6426934bd7e Author: Damien Le Moal Date: Tue Apr 12 20:52:35 2022 +0900 zonefs: Clear inode information flags on inode creation Ensure that the i_flags field of struct zonefs_inode_info is cleared to 0 when initializing a zone file inode, avoiding seeing the flag ZONEFS_ZONE_OPEN being incorrectly set. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Cc: Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hans Holmberg commit 404147faaaf28319ba8e60392ba9d4f3b6055ad5 Author: Akira Yokosawa Date: Wed Mar 30 23:41:00 2022 +0900 docs: Update RCU cross-references as suggested in doc-guide The RCU documentation contains old-style cross references which do not follow the best practices outlined in doc-guide/sphinx.rst. In addition, some of the cross references use URLs that should be replaced by pathnames. Update all of these cross references and adjust the surrounding words. Summary of changes: - out-of-date plaintext file names (*.txt) -> *.rst - references by :ref: tags -> path names of *.rst * use relative paths to .rst files under the RCU/ subdirectory * use abs paths of Documentation/xxx for other .rst files - references by URL under https://www.kernel.org/ -> paths of *.rst - adjust surrounding words of some of updated references. Note: The automarkup.py script interprets references via "*.txt" as if they were via "*.rst", so the *.txt -> *.rst changes should be regarded as cleanups rather than bug fixes. Cc: rcu@vger.kernel.org Cc: linux-doc@vger.kernel.org Tested-by: Bagas Sanjaya Reviewed-by: Steven Rostedt (Google) Signed-off-by: Akira Yokosawa Signed-off-by: Paul E. McKenney commit 6172de3c7f1171e55314bfc5ee4ae6edd225b048 Author: Paul E. McKenney Date: Thu Feb 17 12:26:00 2022 -0800 docs: Add documentation for rude and trace RCU flavors This commit belatedly adds documentation of Tasks Rude RCU and Tasks Trace RCU to RCU's requirements document. Tested-by: Bagas Sanjaya Reviewed-by: Steven Rostedt (Google) Signed-off-by: Paul E. McKenney commit 2d9ac4319b9959bf3195fedf88bdfd224c67593b Author: Kaixu Xia Date: Thu Apr 21 08:47:54 2022 +1000 xfs: simplify local variable assignment in file write code Get the struct inode pointer from iocb->ki_filp->f_mapping->host directly and the other variables are unnecessary, so simplify the local variables assignment. Signed-off-by: Kaixu Xia Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner commit 610cc9f45881f1a3758f323d6d7d67e572958c3b Author: Andy Shevchenko Date: Wed Mar 23 19:43:42 2022 +0200 powerpc/83xx/mpc8349emitx: Get rid of of_node assignment Let GPIO library to assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Acked-by: Scott Wood Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220323174342.56187-1-andriy.shevchenko@linux.intel.com commit db69264f983a5890fe8ba20ed4c20dfd4b687615 Author: Zhengchao Shao Date: Tue Apr 19 19:47:46 2022 +0800 samples/bpf: Reduce the sampling interval in xdp1_user If interval is 2, and sum - prev[key] = 1, the result = 0. This will mislead the tester that the port has no traffic right now. So reduce the sampling interval to 1. Signed-off-by: Zhengchao Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220419114746.291613-1-shaozhengchao@huawei.com commit 127e7dca427bc3e5d9a1c2071357e0f34be5c1d9 Author: Liu Jian Date: Sat Apr 16 18:58:01 2022 +0800 selftests/bpf: Add test for skb_load_bytes Use bpf_prog_test_run_opts to test the skb_load_bytes function. Tests the behavior when offset is greater than INT_MAX or a normal value. Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220416105801.88708-4-liujian56@huawei.com commit 92ece28072f18f30099770c5d4b8e300ea6820fa Author: Liu Jian Date: Sat Apr 16 18:58:00 2022 +0800 net: Change skb_ensure_writable()'s write_len param to unsigned int type Both pskb_may_pull() and skb_clone_writable()'s length parameters are of type unsigned int already. Therefore, change this function's write_len param to unsigned int type. Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220416105801.88708-3-liujian56@huawei.com commit 45969b4152c1752089351cd6836a42a566d49bcf Author: Liu Jian Date: Sat Apr 16 18:57:59 2022 +0800 bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes The data length of skb frags + frag_list may be greater than 0xffff, and skb_header_pointer can not handle negative offset. So, here INT_MAX is used to check the validity of offset. Add the same change to the related function skb_store_bytes. Fixes: 05c74e5e53f6 ("bpf: add bpf_skb_load_bytes helper") Signed-off-by: Liu Jian Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220416105801.88708-2-liujian56@huawei.com commit c8eefa0f2a3ba3d94cad691a698017d5a9525f6a Author: Colin Ian King Date: Mon Apr 18 11:46:32 2022 -0700 Input: aiptek - remove redundant assignment to variable ret Variable ret is being assigned a value that is never read, it is being re-assigned again in either path of the if statement. The assignment is redundant and can be removed. Cleans up clang scan build warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220418142457.84708-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit b3598fe6d009b2f2144115dfc381615c8b534aec Author: Minghao Chi Date: Wed Apr 20 03:03:15 2022 +0000 ASoC: SOF: using pm_runtime_resume_and_get to simplify the code Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220420030315.2575691-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit f5b2cd89d539aa8e16e620eb2d52c905461776bd Author: Imre Deak Date: Wed Apr 20 21:05:41 2022 +0300 drm/i915: Fixup merge of the power well refactor patchset The wrong v2 version of drm/i915: Move per-platform power well hooks to intel_display_power_well.c patch was pushed to drm-intel-next branch instead of v3, fix this up applying the difference between v2 and v3. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220415082524.1826924-1-imre.deak@intel.com commit 6044d159b5d826259a7397d42fa3ad0bfc4dbd13 Author: Michael Roth Date: Wed Apr 20 10:26:13 2022 -0500 x86/boot: Put globals that are accessed early into the .data section The helpers in arch/x86/boot/compressed/efi.c might be used during early boot to access the EFI system/config tables, and in some cases these EFI helpers might attempt to print debug/error messages, before console_init() has been called. __putstr() checks some variables to avoid printing anything before the console has been initialized, but this isn't enough since those variables live in .bss, which may not have been cleared yet. This can lead to a triple-fault occurring, primarily when booting in legacy/CSM mode (where EFI helpers will attempt to print some debug messages). Fix this by declaring these globals in .data section instead so there is no dependency on .bss being cleared before accessing them. Fixes: c01fce9cef849 ("x86/compressed: Add SEV-SNP feature detection/setup") Reported-by: Borislav Petkov Suggested-by: Thomas Lendacky Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220420152613.145077-1-michael.roth@amd.com commit 75eafc970bd9d36d906960a81376549f5dc99696 Author: Florian Fischer Date: Wed Apr 20 19:42:44 2022 +0200 perf list: Print all available tool events Introduce names for the new tool events 'user_time' and 'system_time'. $ perf list ... duration_time [Tool event] user_time [Tool event] system_time [Tool event] ... Committer testing: Before: $ perf list | grep Tool duration_time [Tool event] $ After: $ perf list | grep Tool duration_time [Tool event] user_time [Tool event] system_time [Tool event] $ Signed-off-by: Florian Fischer Tested-by: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Cc: Xing Zhengjun Link: http://lore.kernel.org/lkml/20220420174244.1741958-2-florian.fischer@muhq.space Signed-off-by: Arnaldo Carvalho de Melo commit c50c29a806113614098efd8da9fd7b48d605ba45 Author: Haowen Bai Date: Mon Mar 21 15:12:37 2022 +0800 tty: synclink_cs: Use bitwise instead of arithmetic operator for flags This silences the following coccinelle warning: drivers/s390/char/tape_34xx.c:360:38-39: WARNING: sum of probable bitmasks, consider | we will try to make code cleaner Reviewed-by: Jiri Slaby Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1647846757-946-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 799da9837d1e9c514da0e67c1f1d23f7e49f45c4 Author: Imre Deak Date: Fri Apr 15 00:06:57 2022 +0300 drm/i915: Remove the XELPD specific AUX and DDI power domains The spec calls the XELPD_D/E ports just D/E, the platform prefix in the domain names was only needed by the port->domain mapping relying on matching enum values for the whole port/domain range (and the corresponding aliasing between the platform specific domain enums). Since a previous patch we can define the port->domain mapping explicitly so do this by reusing the already existing D/E power domain names. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-18-imre.deak@intel.com commit 2431f38c17a6976e2826b1af552dc0ad0a417a3c Author: Imre Deak Date: Fri Apr 15 00:06:56 2022 +0300 drm/i915: Remove duplicate DDI/AUX power domain mappings The DDI and AUX domain -> power well mappings are identical for a few platforms/power well instances, reuse the mappings of earlier platforms for these removing the duplicate mapping of new platforms. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-17-imre.deak@intel.com commit e20b77c14bc491fbaf7ad1bba4b40de6581cb8e0 Author: Imre Deak Date: Fri Apr 15 00:06:55 2022 +0300 drm/i915: Remove the ICL specific TBT power domains The spec calls the ICL TBT AUX power well instances TBT1-4 (similarly to all later platforms), align the power domain names with the spec. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-16-imre.deak@intel.com commit c97bbab02ad7d174b50541864bfa45cf1e4ee14f Author: Imre Deak Date: Fri Apr 15 00:06:54 2022 +0300 drm/i915: Remove the aliasing of power domain enum values Aliasing the intel_display_power_domain enum values was required because of the u64 power domain mask size limit. This makes the dmesg/debugfs printouts of the domain names somewhat unclear, for instance domain names for port D are shown on D12+ platforms where the corresponding port is called TC1. Make this clearer by removing the aliasing which is possible after a previous patch converting the mask to a bitmap. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-15-imre.deak@intel.com commit 979e1b32e0e202197f182ec0abfadecbdd53b1ec Author: Imre Deak Date: Fri Apr 15 00:06:53 2022 +0300 drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform Atm the port -> DDI and AUX power domain mapping is specified by relying on the aliasing of the platform specific intel_display_power_domain enum values. For instance D12+ platforms refer to the 'D' port and power domain instances, which doesn't match the bspec terminology, on these platforms the corresponding port is TC1. To make it clear what port/domain the code refers to add a mapping between them which matches the bspec terms on different display versions. This also allows for removing the aliasing in enum values in a follow-up patch. v2: Add the functions to intel_display_power.c, use intel_display_power_ prefix. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-14-imre.deak@intel.com commit eb6dedcc194a5bdbe7e47ad111771abb4ebdd2b8 Author: Imre Deak Date: Fri Apr 15 00:06:52 2022 +0300 drm/i915: Sanitize the ADL-S power well definition Instead of the skip_mask special casing of the ADL-S power well descriptors, add a power well descriptor list for ADL-S as well reusing the TGL descriptors, w/o the TC-cold power well. ADL-S doesn't have TypeC PHYs, so a better way would be having ADL-S specific AUX descriptors, but I left changing this for a follow-up. This changes the ordering of the AUX and TC-cold vs. PW_4/5 power wells on TGL and ADL-S, but this shouldn't make a difference (PW_4/5 don't depend on the AUX/TC-cold power wells). Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-13-imre.deak@intel.com commit 13344a9bdd38a8938dad385521ce601cecf4f4f7 Author: Imre Deak Date: Fri Apr 15 00:06:51 2022 +0300 drm/i915: Simplify the DG1 power well descriptors Simplify the definition of DG1 power wells by reusing the identical RKL DDI/AUX descriptors. This reorders the DG1 DDI/AUX vs. PW4/5 power wells, but this shouldn't make a difference (it is the order on RKL and the DDI/AUX power wells don't have a dependency on PW4/5). Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-12-imre.deak@intel.com commit a6394dbbe21e5966e688dde24cc8fa5d0b44b346 Author: Imre Deak Date: Fri Apr 15 00:06:50 2022 +0300 drm/i915: Allow platforms to share power well descriptors Some power wells - like always-on and skl+/icl+ PW_1 - with the same name, domain list, flags, ops are used by multiple platforms, so allow platforms to reuse the descriptors of such power wells. This change also lets the follow up patches to simplify the DG1/RKL power well definitions, and remove the ADL-S skip_mask special casing. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-11-imre.deak@intel.com commit 4a845ff0c0d445556ec9e32073ac6cf0cd66e117 Author: Imre Deak Date: Fri Apr 15 00:06:49 2022 +0300 drm/i915: Simplify power well definitions by adding power well instances All the port specific AUX/DDI_IO power wells share the same power well ops struct and flags, so we can save some space and simplify the definition of these by listing for all such power wells only the params specific to them (name, domains, power well register index, id). Move these params to a new i915_power_well_instance struct and convert the per-platform power well definitions accordingly. For all power well instance the name and power domain list params must be specified, while the register index and id are optional, add the I915_PW() macro that both simplifies the definitions and ensures that the required params are set. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-10-imre.deak@intel.com commit 888a2a6312a14ea6f8f50ec886601db2c43179df Author: Imre Deak Date: Fri Apr 15 00:06:48 2022 +0300 drm/i915: Convert the u64 power well domains mask to a bitmap To remove the aliasing of the power domain enum values in a follow-up patch in this patchset (requiring a bigger mask) and allow for defining additional power domains in the future (at least some upcoming TypeC changes requires this) convert the u64 i915_power_well_desc::domains mask to a bitmap. For simplicity I changed the for_each_power_domain_well() macros to accept one domain only instead of a mask, as there isn't any current user passing multiple domains. v2: Don't add a typedef for the bitmap struct. (Jani) Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-9-imre.deak@intel.com commit c32ffce42aa59d054c93b2d63a3b11521dd7490b Author: Imre Deak Date: Fri Apr 15 00:06:47 2022 +0300 drm/i915: Convert the power well descriptor domain mask to an array of domains The next patch converts the i915_power_well_desc::domain mask from a u64 mask to a bitmap. I didn't find a reasonably simple way to initialize bitmaps statically, so prepare for the next patch here by converting the masks to an array of domain enums and initing the masks from these arrays during module loading. v2: Clarify list vs. array in the commit message. (Jani) Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-8-imre.deak@intel.com commit 5e9deaaf027370de5696c1c66db12604f919b74f Author: Imre Deak Date: Fri Apr 15 00:06:46 2022 +0300 drm/i915: Sanitize the power well names Use the shortest descriptive name for all power wells for simplicity and to use the same name for the same type of power wells on multiple platforms. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-7-imre.deak@intel.com commit 0ba2661db6262da49cf4edee7fc4ab6d17bcc45e Author: Imre Deak Date: Fri Apr 15 00:06:45 2022 +0300 drm/i915: Rename the power domain names to end with pipes/ports Make all power domain names end with the pipe/port instance for consistency. No functional changes. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-6-imre.deak@intel.com commit 6a006ee93ff829dddce8e82b4becef20f74db885 Author: Imre Deak Date: Fri Apr 15 00:06:44 2022 +0300 drm/i915: Move the HSW power well flags to a common bitfield Save some space by grouping the HSW power well descriptor flags along with other flags in one bitfield. This change also lets simplifying the definition of power well descriptors sharing the same flags in an upcoming patch. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-5-imre.deak@intel.com commit 92f6d062ddc6cb7a6c44e0f45d7ca9ceb82a0bbd Author: Imre Deak Date: Fri Apr 15 00:06:43 2022 +0300 drm/i915: Move the dg2 fixed_enable_delay power well param to a common bitfield The DG2 fixed delay duration is always 600usec, so save some space in the power well descriptors by converting the parameter to a flag. While at it also use a bitfield for both the always_on and fixed_enable_delay flag. This change also lets simplifying the definiton of power wells sharing the same flags in an upcoming patch. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-4-imre.deak@intel.com commit 323286c81245b3ee31f495367e51d9ee8431bf13 Author: Imre Deak Date: Fri Apr 15 00:06:42 2022 +0300 drm/i915: Move the power domain->well mappings to intel_display_power_map.c Move the list of platform specific power domain -> power well definitions to intel_display_power_map.c. While at it group the platforms' power domain macros with the corresponding power well lists and keep all the power domain lists in the same order (matching the enum order). No functional changes. v2: - s/intel_display_power_internal.h/intel_display_power_map.h/ (Jani) - Simplify intel_cleanup_power_wells(). - Don't move intel_display_power_domain_str(). v3: - Rename intel_init/cleanup_power_wells() to intel_display_power_map_init/cleanup(). - Add documentation to intel_display_power_map_init/cleanup(). Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-3-imre.deak@intel.com commit ac78f31b2f83637e24a044f62a60df7de1c0d7c9 Author: Imre Deak Date: Fri Apr 15 00:06:41 2022 +0300 drm/i915: Unexport the for_each_power_well() macros The for_each_power_well() macros are only used in intel_display_power.c and intel_display_power_well.c, so unexport them. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-2-imre.deak@intel.com commit 2cef35958da89500f30e2693b4f8ca898e27ae34 Author: Imre Deak Date: Fri Apr 15 00:06:40 2022 +0300 drm/i915: Move per-platform power well hooks to intel_display_power_well.c Move the implementation of platform specific power well hooks to intel_display_power_well.c, to reduce the clutter in intel_display_power.c. The locking of all the power domain/power well state is handled in the power domain functions in intel_display_power.c using i915_power_domains::lock. This patch also moves the chy_phy_powergate_ch/lanes() functions to intel_display_power_well.c which borrow the same lock to protect the DISPLAY_PHY_CONTROL register state, which the HW uses both for toggling power wells and power gating PHY lanes. No functional change. v2: - Clarify in the commit log why CHV functions using the i915_power_domains::lock were moved, while others locking the power domain/well state were kept in intel_display_power.c . (Jouni) - Move forward declaration of chv_phy_powergate_ch/lanes() to intel_display_power_well.h . Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-1-imre.deak@intel.com commit a204e6d626126d33f34f43374d5abd00141f3e65 Author: Miaohe Lin Date: Tue Apr 19 20:03:52 2022 +0800 mm/slub: remove unneeded return value of slab_pad_check The return value of slab_pad_check is never used. So we can make it return void now. Signed-off-by: Miaohe Lin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220419120352.37825-1-linmiaohe@huawei.com commit 0b4efcb1b55c6784f54455065e55e268a2d9a0f3 Author: Tom Rix Date: Tue Mar 29 12:54:01 2022 -0700 accessiblity: speakup: cleanup comments Replace for spelling keypresses to key presses bytesize to byte size specificly to specifically Reviewed-by: Samuel Thibault Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220329195401.3220408-1-trix@redhat.com Signed-off-by: Greg Kroah-Hartman commit 61be0f48c50a82f505d34e36b9d538d6eeab62b6 Author: José Roberto de Souza Date: Tue Apr 19 11:27:53 2022 -0700 drm/i915/dg2: Add workaround 18019627453 A new DG2 workaround added to fix some corner cases hangs. v2: - implementing the second and preferred option for this workaround BSpec: 54077 BSpec: 68173 BSpec: 71488 Cc: Matt Roper Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220419182753.364237-2-jose.souza@intel.com commit 74373977d2ca26e5735377f8874be70bc2f030f5 Author: Javier Martinez Canillas Date: Tue Apr 19 23:48:23 2022 +0200 drm/solomon: Add SSD130x OLED displays SPI support The ssd130x driver only provides the core support for these devices but it does not have any bus transport logic. Add a driver to interface over SPI. There is a difference in the communication protocol when using 4-wire SPI instead of I2C. For the latter, a control byte that contains a D/C# field has to be sent. This field tells the controller whether the data has to be written to the command register or to the graphics display data memory. But for 4-wire SPI that control byte is not used, instead a real D/C# line must be pulled HIGH for commands data and LOW for graphics display data. For this reason the standard SPI regmap can't be used and a custom .write bus handler is needed. Signed-off-by: Javier Martinez Canillas Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Link: https://patchwork.freedesktop.org/patch/msgid/20220419214824.335075-6-javierm@redhat.com commit 4203e88ba80bbcdfaa7689db286d07cf4f2993d0 Author: Javier Martinez Canillas Date: Tue Apr 19 23:48:22 2022 +0200 drm/solomon: Move device info from ssd130x-i2c to the core driver These are declared in the ssd130x-i2c transport driver but the information is not I2C specific, and could be used by other SSD130x transport drivers. Move them to the ssd130x core driver and just set the OF device entries to an ID that could be used to lookup the correct device info from an array. While being there, also move the SSD130X_DATA and SSD130X_COMMAND control bytes. Since even though they are used by the I2C interface, they could also be useful for other transport protocols such as SPI. Suggested-by: Chen-Yu Tsai Signed-off-by: Javier Martinez Canillas Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Link: https://patchwork.freedesktop.org/patch/msgid/20220419214824.335075-5-javierm@redhat.com commit fb197474eddc9369492228f1e423f4ccf0f309b4 Author: Javier Martinez Canillas Date: Tue Apr 19 23:48:21 2022 +0200 drm/solomon: Add ssd130x new compatible strings and deprecate old ones. The current compatible strings for SSD130x I2C controllers contain an "fb" and "-i2c" suffixes. These have been deprecated and more correct ones were added, that don't encode a subsystem or bus used to interface the devices. Signed-off-by: Javier Martinez Canillas Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Link: https://patchwork.freedesktop.org/patch/msgid/20220419214824.335075-4-javierm@redhat.com commit 1b6a7961908882b65def0bd2cffba3f2eba44226 Author: Javier Martinez Canillas Date: Tue Apr 19 23:48:20 2022 +0200 dt-bindings: display: ssd1307fb: Extend schema for SPI controllers The Solomon SSD130x OLED displays can either have an I2C or SPI interface, add to the schema the properties and examples for OLED devices under SPI. Signed-off-by: Javier Martinez Canillas Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220419214824.335075-3-javierm@redhat.com commit 36bf0611600dd3187fe478833ba804e7976fcae5 Author: Javier Martinez Canillas Date: Tue Apr 19 23:48:19 2022 +0200 dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings The current compatible strings for SSD130x I2C controllers contain both an "fb" and "-i2c" suffixes. It seems to indicate that are for a fbdev driver and also that are for devices that can be accessed over an I2C bus. But a DT is supposed to describe the hardware and not Linux implementation details. So let's deprecate those compatible strings and add new ones that only contain the vendor and device name, without any of these suffixes. These will just describe the device and can be matched by both I2C and SPI DRM drivers. The required properties should still be enforced for old ones. While being there, just drop the "sinowealth,sh1106-i2c" compatible string since that was never present in a released Linux version. Signed-off-by: Javier Martinez Canillas Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220419214824.335075-2-javierm@redhat.com commit 55de6cb7f81c82dea1bdb12cd3818280af7abd87 Author: Solomon Tan Date: Tue Apr 19 20:43:19 2022 +0800 staging: rtl8192e: Remove space after cast This patch addresses the checkpatch.pl flag that there should not be a space after a cast. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/20220419124318.8028-1-wjsota@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9b6bdbd9337de3917945847bde262a34a87a6303 Author: Duoming Zhou Date: Sun Apr 17 22:16:41 2022 +0800 drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() There is a deadlock in rtllib_beacons_stop(), which is shown below: (Thread 1) | (Thread 2) | rtllib_send_beacon() rtllib_beacons_stop() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | rtllib_send_beacon_cb() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold ieee->beacon_lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need ieee->beacon_lock in position (2) of thread 2. As a result, rtllib_beacons_stop() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_irqsave(), which could let timer handler to obtain the needed lock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220417141641.124388-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 806c7b53414934ba2a39449b31fd1a038e500273 Author: Duoming Zhou Date: Sun Apr 17 21:54:07 2022 +0800 drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop() There is a deadlock in ieee80211_beacons_stop(), which is shown below: (Thread 1) | (Thread 2) | ieee80211_send_beacon() ieee80211_beacons_stop() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | ieee80211_send_beacon_cb() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold ieee->beacon_lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need ieee->beacon_lock in position (2) of thread 2. As a result, ieee80211_beacons_stop() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_irqsave(), which could let timer handler to obtain the needed lock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220417135407.109536-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit bb5369edbab8363a8a9a0c9ba59cb85020accb68 Author: Rebecca Mckeever Date: Sat Apr 16 05:24:34 2022 -0500 staging: rtl8192u: compare strcmp result to zero Add " == 0" to the condition in both else if branches to address a possible bug. strcmp returns 0 when its arguments are equal, which evaluates to false, often leading to errors when used in if statements. Currently, the statement in the first else if branch does not execute when its arguments are equal, but it does execute when crypt->ops->name equals any string other than "WEP" or "TKIP". Similarly, the second else if branch does not execute when its arguments are equal, and it only executes when crypt->ops->name equals "TKIP". The else branch never executes. It is unlikely that this is working as intended. Reviewed-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/20220416102434.97567-1-remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit a8d412ec986b95f146c6786c76bb471e1b602589 Author: Colin Ian King Date: Mon Apr 18 14:46:03 2022 +0100 staging: iio: ad2s1210: remove redundant assignment to variable negative Variable negative is being assigned a value that is never read, it is being re-assigned later. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/staging/iio/resolver/ad2s1210.c:502:3: warning: Value stored to 'negative' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220418134603.81336-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 08bea7da71b34c60b9aca1258a2098fed3bc3ce6 Author: Philipp Hortmann Date: Sat Apr 16 10:00:55 2022 +0200 staging: vt6655: Replace VNSvInPortB with ioread8 Replace macro VNSvInPortB with ioread8. Avoid cast of the return value is possible with one exception. The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl Since there are more than one checkpatch issue per line, more steps are rquired to fix. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/fd71797d9d55d53f95c5c4e2df826bf85dd4626a.1650094595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit bcac7e6eecd746a8f6fc0f992f887ea2d916a937 Author: Philipp Hortmann Date: Sat Apr 16 10:00:50 2022 +0200 staging: vt6655: Replace MACvGPIOIn with VNSvInPortB Replace macro MACvGPIOIn with VNSvInPortB. Next patch will replace all macros VNSvInPortB with ioread8. The names of macros and the arguments use CamelCase which is not accepted by checkpatch.pl Since there are more than one checkpatch issue per line, more steps are rquired to fix. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0a3c3eb0d4dad544fa281b34c5a70d4a3ab2d9f1.1650094595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b03b89b350034f220cc24fc77c56990a97a796b2 Author: Florian Fischer Date: Wed Apr 20 12:23:53 2022 +0200 perf stat: Add user_time and system_time events It bothered me that during benchmarking using 'perf stat' (to collect for example CPU cache events) I could not simultaneously retrieve the times spend in user or kernel mode in a machine readable format. When running 'perf stat' the output for humans contains the times reported by rusage and wait4. $ perf stat -e cache-misses:u -- true Performance counter stats for 'true': 4,206 cache-misses:u 0.001113619 seconds time elapsed 0.001175000 seconds user 0.000000000 seconds sys But 'perf stat's machine-readable format does not provide this information. $ perf stat -x, -e cache-misses:u -- true 4282,,cache-misses:u,492859,100.00,, I found no way to retrieve this information using the available events while using machine-readable output. This patch adds two new tool internal events 'user_time' and 'system_time', similarly to the already present 'duration_time' event. Both events use the already collected rusage information obtained by wait4 and tracked in the global ru_stats. Examples presenting cache-misses and rusage information in both human and machine-readable form: $ perf stat -e duration_time,user_time,system_time,cache-misses -- grep -q -r duration_time . Performance counter stats for 'grep -q -r duration_time .': 67,422,542 ns duration_time:u 50,517,000 ns user_time:u 16,839,000 ns system_time:u 30,937 cache-misses:u 0.067422542 seconds time elapsed 0.050517000 seconds user 0.016839000 seconds sys $ perf stat -x, -e duration_time,user_time,system_time,cache-misses -- grep -q -r duration_time . 72134524,ns,duration_time:u,72134524,100.00,, 65225000,ns,user_time:u,65225000,100.00,, 6865000,ns,system_time:u,6865000,100.00,, 38705,,cache-misses:u,71189328,100.00,, Signed-off-by: Florian Fischer Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220420102354.468173-3-florian.fischer@muhq.space Signed-off-by: Arnaldo Carvalho de Melo commit 6c67631a54c6f28c4084f54798d68068dae2bcbc Author: Solomon Tan Date: Sun Apr 17 16:54:48 2022 +0000 staging: rtl8712: Remove unnecessary int typecast This patch gets rid of the following error from checkpatch.pl: WARNING: Unnecessary typecast of c90 int constant. Signed-off-by: Solomon Tan Link: https://lore.kernel.org/r/YlxGTMBsLqdOIrpC@ArchDesktop Signed-off-by: Greg Kroah-Hartman commit b5485fe7c47ac98c9adc65b67c7eadf31219201a Author: Soumya Negi Date: Sat Apr 16 12:17:45 2022 -0700 staging: qlge: add blank line after function declaration Adhere to linux coding style. Reported by checkpatch: CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/20220416191745.7079-1-soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit b8ce0acfa4ed6c57f3daad2a654ee4ab595daf6b Author: Philipp Hortmann Date: Sat Apr 16 21:16:22 2022 +0200 staging: vt6655: Delete tmacro.h Relocate the only macro MAKEWORD that is in use and remove file tmacro.h. File needs to be changed anyhow because of use of CamelCase which is not accepted by checkpatch.pl. Reduced code provides a better overview. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20220416191622.GA11596@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit 1e53f9e41400e548a1112bc9b973eabddc9eb79b Author: José Roberto de Souza Date: Tue Apr 19 11:27:52 2022 -0700 drm/i915/display: Add workaround 22014263786 This workaround fixes screen flickers with FBC. BSpec: 33450 BSpec: 52890 BSpec: 54369 BSpec: 66624 Reviewed-by: Matt Roper Cc: Matt Roper Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220419182753.364237-1-jose.souza@intel.com commit e5f45b011e4a86d62fb3d9d9a634ec30a3027649 Author: Fabio M. De Francesco Date: Thu Apr 14 12:32:17 2022 +0200 staging: Remove the drivers for the Unisys s-Par The Unisys sub-tree of drivers/staging contains three drivers for the "Unisys Secure Partition" (s-Par(R)): visorhba, visorinput, visornic. They have no maintainers, in fact the only one that is listed in MAINTAINERS has an unreacheable email address. During 2021 and 2022 several patches have been submitted to these drivers but nobody at Unisys cared of reviewing the changes. Probably, also the "sparmaintainer" internal list of unisys.com is not anymore read by interested Unisys' engineers. Therefore, remove the drivers/staging/unisys directory and delete the relevant entries in the MAINTAINERS, Kconfig, Makefile files, then remove also the drivers/visorbus directory which is not anymore needed (it contained the driver for the virtualized bus for the Unisys s-Par firmware). Cc: David Kershner Cc: Cc: Ken Cox Suggested-by: Greg Kroah-Hartman Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220414103217.32058-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit c735b0a5217620192a001323e1c2a4b4af5d3dea Author: Florian Fischer Date: Wed Apr 20 12:23:52 2022 +0200 perf stat: Introduce stats for the user and system rusage times This is preparation for exporting rusage values as tool events. Add new global stats tracking the values obtained via rusage. For now only ru_utime and ru_stime are part of the tracked stats. Both are stored as nanoseconds to be consistent with 'duration_time', although the finest resolution the struct timeval data in rusage provides are microseconds. Signed-off-by: Florian Fischer Cc: Ian Rogers Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220420102354.468173-2-florian.fischer@muhq.space Signed-off-by: Arnaldo Carvalho de Melo commit 9dc9653c8501b96123d5ca00ec792ca0e4b27180 Author: Michael Straube Date: Mon Apr 18 20:09:16 2022 +0200 staging: r8188eu: use in-kernel ieee80211 header structures The structures rtw_ieee80211_hdr rtw_ieee80211_hdr_3addr rtw_ieee80211_hdr_3addr_qos in drivers/staging/r8188eu/include/ieee80211.h just duplicate the in-kernel structures from include/linux/ieee80211.h. ieee80211_hdr ieee80211_hdr_3addr ieee80211_qos_hdr Remove the rtw_ prefixed structures and use the in-kernel versions. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220418180916.11311-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 96b6efb72d1413fab4d9e7be9a87f7d2b191a3fb Author: Ivan Safonov Date: Sun Apr 17 19:36:08 2022 +0300 r8188eu: remove unused urbs from struct xmit_buf Driver allocates eighth urbs per xmit_buf, but uses only first urb. Allocation of seven remaining urbs wastes memory for nothing. Reviewed-by: Pavel Skripkin Signed-off-by: Ivan Safonov Link: https://lore.kernel.org/r/20220417163608.42917-1-insafonov@gmail.com Signed-off-by: Greg Kroah-Hartman commit db84803cd8def406c60eb865d3b4ae0efa09a9f8 Author: Martin Kaiser Date: Sun Apr 17 12:22:21 2022 +0200 staging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl Use ARRAY_SIZE instead of hard-coding the number of entries in the mlme_sta_tbl array. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7d0b25d7fb5b6e783543165dc26ca2b9172cf664 Author: Martin Kaiser Date: Sun Apr 17 12:22:20 2022 +0200 staging: r8188eu: don't call empty DoReserved function Replace the DoReserved function pointer with NULL in mlme_sta_tbl. We can skip the function call for reserved subtypes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9e9bbd6ffd0e2dfeb02b8233f069974c7d8c5a98 Author: Martin Kaiser Date: Sun Apr 17 12:22:19 2022 +0200 staging: r8188eu: replace mlme_handler with function pointer mlme_sta_tbl is an array of struct mlme_handler. mlme_handler's num and str components are not used. The code in mgt_dispatcher uses the subtype number of the incoming frame to select the array entry for compiling the repsonse. We can remove struct mlme_handler and make mlme_sta_tbl an array of function pointers. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bea6af5447fcbdc076dfaacc33db7e49a855f794 Author: Martin Kaiser Date: Sun Apr 17 12:22:18 2022 +0200 staging: r8188eu: the frame type is shifted out The index calculation in mgt_dispatcher does not use the frame type. The 4-bit right shift ignores protocol version and frame type. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bd379a21488bbe694984ba5d1bd7d4cd4a17d416 Author: Martin Kaiser Date: Sun Apr 17 12:22:17 2022 +0200 staging: r8188eu: replace the GetFrameSubType call The driver's local GetFrameSubType macro returns both frame type and subtype. Use the ieee80211 framework to extract the two fields. This shows more clearly that both type and subtype are read. Convert everything to host endianness before we use bit operations. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 59e8d56f00a5a7635be11d4c4959de9458230553 Author: Martin Kaiser Date: Sun Apr 17 12:22:16 2022 +0200 staging: r8188eu: check receiver address only once Check only once in mgt_dispatcher that the receiver address is the local address or the broadcast address. The second identical check can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220417102221.466524-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c60664dea70a76cdffb4c4c21b2a09153b41a950 Author: Martin Liška Date: Wed Apr 20 15:32:55 2022 +0200 perf tools: Print warning when HAVE_DEBUGINFOD_SUPPORT is not set and user tries to use debuginfod support When one requests debuginfod, either via --debuginfod option, or with a perf-config value, complain when perf is not built with it. Signed-off-by: Martin Liška Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/35bae747-3951-dc3d-a66b-abf4cebcd9cb@suse.cz Signed-off-by: Arnaldo Carvalho de Melo commit e3748816b74e22725e12df991e51efa076e93fd4 Author: Mahak Gupta Date: Fri Apr 15 04:37:57 2022 +0530 staging: r8188eu: place constants in right side in a comparison reported by checkpatch: Comparisons should place the constant on the right side of the test. Fix these warnings. Signed-off-by: Mahak Gupta Link: https://lore.kernel.org/r/20220414230757.19348-1-mahak_g@cs.iitr.ac.in Signed-off-by: Greg Kroah-Hartman commit b8836c2a4d4b2abcbefa8bd6a37bdbf075633199 Author: Martin Liška Date: Wed Apr 20 13:30:09 2022 +0200 perf version: Add HAVE_DEBUGINFOD_SUPPORT to built-in features The change adds debuginfod to ./perf -vv: ... debuginfod: [ OFF ] # HAVE_DEBUGINFOD_SUPPORT ... Signed-off-by: Martin Liška Tested-by: Arnaldo Carvalho de Melo Link: http://lore.kernel.org/lkml/0d1c5ace-88e8-7102-1565-7c143f01a966@suse.cz Signed-off-by: Arnaldo Carvalho de Melo commit 2e034e0390c8c60f0ffd8ade744701f7bec7674a Author: Michael Straube Date: Sun Apr 17 19:54:41 2022 +0200 staging: r8188eu: check firmware header existence before access We should access the fields of fwhdr only if the check for firmware header existence is true. Move the affected code into the if block that checks firmware header existence. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c77031960762b95e85e857c91e9766cd2ba498eb Author: Michael Straube Date: Sun Apr 17 19:54:40 2022 +0200 staging: r8188eu: use pr_info_once() to log the firmware version Use pr_info_once() instead of a static variable and an if statement to log the firmware version only once. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4ae19e7af2ce5e0fe8aab45706f9fc168d0cb97d Author: Michael Straube Date: Sun Apr 17 19:54:39 2022 +0200 staging: r8188eu: remove variables from rtl8188e_firmware_download() The local variables fw_version, fw_subversion, fw_signature in rtl8188e_firmware_download() are only used in one place. Use the assigned values directly and remove the variables to make the code shorter and cleaner. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4e58dfad41320e65a3411c2c123fb115d3513335 Author: Michael Straube Date: Sun Apr 17 19:54:38 2022 +0200 staging: r8188eu: use sizeof instead of hardcoded firmware header size Use sizeof() instead of hardcoding the firmware header size and add a compile time check to ensure struct rt_firmware_hdr has the correct size. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 60ca4cdf50ae184c868c6f5c05f7415f2383938b Author: Michael Straube Date: Sun Apr 17 19:54:37 2022 +0200 staging: r8188eu: rename fields of struct rt_firmware_hdr Rename the fields of struct rt_firmware_hdr to avoid camel case. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fbcbbcda0205d15decf3b8519267a1e7305cfd9e Author: Michael Straube Date: Sun Apr 17 19:54:36 2022 +0200 staging: r8188eu: clean up comments in struct rt_firmware_hdr Remove unnecessary comments from struct rt_firmware_hdr. While at it align the in-line comments. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 84a44ac55059e1a87af95050a160686f9eb2817f Author: Michael Straube Date: Sun Apr 17 19:54:35 2022 +0200 staging: r8188eu: convert u32 fields of rt_firmware_hdr to __le32 Convert the u32 fields of struct rt_firmware_hdr to __le32 for consistency. Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fbfdc1b6f80abc40cb1f7bac68248b899754d8be Author: Michael Straube Date: Sun Apr 17 19:54:34 2022 +0200 staging: r8188eu: fix struct rt_firmware_hdr The size of struct rt_firmware_hdr is 36 bytes. $ pahole -C rt_firmware_hdr drivers/staging/r8188eu/r8188eu.o struct rt_firmware_hdr { __le16 Signature; /* 0 2 */ u8 Category; /* 2 1 */ u8 Function; /* 3 1 */ __le16 Version; /* 4 2 */ u8 Subversion; /* 6 1 */ /* XXX 1 byte hole, try to pack */ u16 Rsvd1; /* 8 2 */ u8 Month; /* 10 1 */ u8 Date; /* 11 1 */ u8 Hour; /* 12 1 */ u8 Minute; /* 13 1 */ __le16 RamCodeSize; /* 14 2 */ u8 Foundry; /* 16 1 */ u8 Rsvd2; /* 17 1 */ /* XXX 2 bytes hole, try to pack */ __le32 SvnIdx; /* 20 4 */ u32 Rsvd3; /* 24 4 */ u32 Rsvd4; /* 28 4 */ u32 Rsvd5; /* 32 4 */ /* size: 36, cachelines: 1, members: 17 */ /* sum members: 33, holes: 2, sum holes: 3 */ /* last cacheline: 36 bytes */ }; But the header in the firmware file is only 32 bytes long. The hexdump of rtl8188eufw.bin shows that the field Rsvd1 should be u8 instead of __le16. OFFSET rtl8188eufw.bin ----------------------------------------------------------- 0x00000000 E1 88 10 00 0B 00 01 00 01 21 11 27 30 36 00 00 0x00000010 2D 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00000000 E1 88 10 00 0B 00 01 00 01 21 11 27 30 36 00 00 ^ ^ ^ ^ ^ ^ Subversion Rsvd1 Month Date Hour Minute With the change of field Rsvd1 from __le16 to u8 the structure has the correct size 32. $ pahole -C rt_firmware_hdr drivers/staging/r8188eu/r8188eu.o struct rt_firmware_hdr { __le16 Signature; /* 0 2 */ u8 Category; /* 2 1 */ u8 Function; /* 3 1 */ __le16 Version; /* 4 2 */ u8 Subversion; /* 6 1 */ u8 Rsvd1; /* 7 1 */ u8 Month; /* 8 1 */ u8 Date; /* 9 1 */ u8 Hour; /* 10 1 */ u8 Minute; /* 11 1 */ __le16 RamCodeSize; /* 12 2 */ u8 Foundry; /* 14 1 */ u8 Rsvd2; /* 15 1 */ __le32 SvnIdx; /* 16 4 */ u32 Rsvd3; /* 20 4 */ u32 Rsvd4; /* 24 4 */ u32 Rsvd5; /* 28 4 */ /* size: 32, cachelines: 1, members: 17 */ /* last cacheline: 32 bytes */ The wrong size had no effect because the header size is hardcoded to 32 where it is used in the code and the fields after Subversion are not used. Fixes: 7884fc0a1473 ("staging: r8188eu: introduce new include dir for RTL8188eu driver") Acked-by: Larry Finger Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220417175441.13830-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7f658339b7e2ff834952969755694dfb1fd4282b Author: Adrien Thierry Date: Thu Apr 14 14:16:22 2022 -0400 staging: bcm2835-audio: fix mutex definition without comment Fix issue reported by checkpatch: CHECK: struct mutex definition without comment FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835.h:64: Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220414181622.102049-6-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit d9d19fb09b2ea59ebebf63845b4cf2e86493582c Author: Adrien Thierry Date: Thu Apr 14 14:16:21 2022 -0400 staging: bcm2835-audio: fix mutex definition without comment Fix issue reported by checkpatch: CHECK: struct mutex definition without comment FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c:14: Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220414181622.102049-5-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit f936d818bbf3652cecb44e1a6976f5150b38424e Author: Adrien Thierry Date: Thu Apr 14 14:16:20 2022 -0400 staging: bcm2835-audio: fix unnecessary space after cast Fix issue reported by checkpatch: CHECK: No space is necessary after a cast FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:240: Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220414181622.102049-4-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit b526eb830f006afd65d2162ecb787a3a2a04c728 Author: Adrien Thierry Date: Thu Apr 14 14:16:19 2022 -0400 staging: bcm2835-audio: fix line ending with '(' Fix issue reported by checkpatch: CHECK: Lines should not end with a '(' FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:85: Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220414181622.102049-3-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit 8848e22ca38579afcd928fce009ba9e75575f072 Author: Adrien Thierry Date: Thu Apr 14 14:16:18 2022 -0400 staging: bcm2835-audio: fully describe config symbol Explain SND_BCM2835 config option in more detail to fix checkpatch warning: WARNING: please write a help paragraph that fully describes the config symbol FILE: drivers/staging/vc04_services/bcm2835-audio/Kconfig:2 Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220414181622.102049-2-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit 871277738426e188cf5b8eb7a2fbee1e27a496cb Author: Daniel Starke Date: Wed Apr 20 03:13:46 2022 -0700 tty: n_gsm: clean up implicit CR bit encoding in address field n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.2.1.2 describes the encoding of the address field within the frame header. It is made up of the DLCI address, command/response (CR) bit and EA bit. Use the predefined CR value instead of a plain 2 in alignment to the remaining code and to make the encoding obvious. Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220420101346.3315-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 538668d7d2deb39bc3aa3b9af24fd779bd8f8b82 Author: Daniel Starke Date: Wed Apr 20 03:13:45 2022 -0700 tty: n_gsm: clean up dead code in gsm_queue() Remove commented out code as it is never used and if anyone accidentally turned it on, it would be broken. Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220420101346.3315-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 7a107b2c6b813c3c587d1e76cb405dc637dd2b36 Author: Ilpo Järvinen Date: Wed Apr 20 11:19:01 2022 +0300 Revert "serial: 8250: Handle UART without interrupt on TEMT using em485" This partially reverts commit f6f586102add. The code added by that commit containted math overflow for 32-bit archs. In addition, the approach used in it is unnecessarily complicated requiring a dedicated timer just for notemt. A simpler approach for providing UART_CAP_NOTEMT already exists (patches 1-2): https://lore.kernel.org/linux-serial/20220411083321.9131-3-ilpo.jarvinen@linux.intel.com/T/#u Thus, simply revert the UART_CAP_NOTEMT change for now. There were two driver changes within the patch series adding UART_CAP_NOTEMT taking advantage of the newly added flag. This does not revert the driver changes and therefore also UART_CAP_NOTEMT define has to remain. UART_CAP_NOTEMT remains no-op until support is again added. Fixes: f6f586102add ("serial: 8250: Handle UART without interrupt on TEMT using em485") Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/5f874142-fb1f-bff7-f33-fac823e65e2e@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2a72b1b2db9dbe12c730754009196a132500f007 Author: Jiri Slaby Date: Tue Apr 19 09:43:02 2022 +0200 Documentation: fix tty link The commit below causes the following warnings: Documentation/driver-api/index.rst:14: WARNING: toctree contains reference to nonexisting document 'driver-api/tty' Documentation/driver-api/tty/index.rst: WARNING: document isn't included in any toctree This is because I omitted the "/index" part from the link. That part is needed for directories and I was confused by the surrounding links which are links to files. Fix it in this patch. Fixes: b96cd8b05ead ("Documentation: move tty to driver-api") Cc: Jonathan Corbet Reported-by: Stephen Rothwell Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220419074302.29632-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 365014f5c39422fa7ccd75b36235155d9041f883 Merge: 85ef87ba9bc28 99a03b3193f62 Author: David S. Miller Date: Wed Apr 20 15:03:22 2022 +0100 Merge branch 'mlxsw-line-card-status-tracking' Ido Schimmel says: ==================== mlxsw: Line cards status tracking When a line card is provisioned, netdevs corresponding to the ports found on the line card are registered. User space can then perform various logical configurations (e.g., splitting, setting MTU) on these netdevs. However, since the line card is not present / powered on (i.e., it is not in 'active' state), user space cannot access the various components found on the line card. For example, user space cannot read the temperature of gearboxes or transceiver modules found on the line card via hwmon / thermal. Similarly, it cannot dump the EEPROM contents of these transceiver modules. The above is only possible when the line card becomes active. This patchset solves the problem by tracking the status of each line card and invoking callbacks from interested parties when a line card becomes active / inactive. Patchset overview: Patch #1 adds the infrastructure in the line cards core that allows users to registers a set of callbacks that are invoked when a line card becomes active / inactive. To avoid races, if a line card is already active during registration, the got_active() callback is invoked. Patches #2-#3 are preparations. Patch #4 changes the port module core to register a set of callbacks with the line cards core. See detailed description with examples in the commit message. Patches #5-#6 do the same with regards to thermal / hwmon support, so that user space will be able to monitor the temperature of various components on the line card when it becomes active. ==================== Signed-off-by: David S. Miller commit 99a03b3193f628a525ee0191e60418af6960004b Author: Vadim Pasternak Date: Tue Apr 19 17:54:31 2022 +0300 mlxsw: core_hwmon: Add interfaces for line card initialization and de-initialization Add callback functions for line card 'hwmon' initialization and de-initialization. Each line card is associated with the relevant 'hwmon' device, which may contain thermal attributes for the cages and gearboxes found on this line card. The line card 'hwmon' initialization / de-initialization APIs are to be called when line card is set to active / inactive state by got_active() / got_inactive() callbacks from line card state machine. For example cage temperature for module #9 located at line card #7 will be exposed by utility 'sensors' like: linecard#07 front panel 009: +32.0C (crit = +70.0C, emerg = +80.0C) And temperature for gearbox #3 located at line card #5 will be exposed like: linecard#05 gearbox 003: +41.0C (highest = +41.0C) Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f11a323da46cff1ce3e5bb87c36cc8cd21f9a793 Author: Vadim Pasternak Date: Tue Apr 19 17:54:30 2022 +0300 mlxsw: core_thermal: Add interfaces for line card initialization and de-initialization Add callback functions for line card thermal area initialization and de-initialization. Each line card is associated with the relevant thermal area, which may contain thermal zones for cages and gearboxes found on this line card. The line card thermal initialization / de-initialization APIs are to be called when line card is set to active / inactive state by got_active() / got_inactive() callbacks from line card state machine. For example thermal zone for module #9 located at line card #7 will have type: mlxsw-lc7-module9. And thermal zone for gearbox #2 located at line card #5 will have type: mlxsw-lc5-gearbox2. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 06a0fc43bb10e48355574b8d28ab5ab1a3c86c61 Author: Vadim Pasternak Date: Tue Apr 19 17:54:29 2022 +0300 mlxsw: core_env: Add interfaces for line card initialization and de-initialization Netdevs for ports found on line cards are registered upon provisioning. However, user space is not allowed to access the transceiver modules found on a line card until the line card becomes active. Therefore, register event operations with the line card core to get notifications whenever a line card becomes active or inactive. When user space tries to dump the EEPROM of a transceiver module or reset it and the corresponding line card is inactive, emit an error message: ethtool -m enp1s0nl7p9 netlink error: mlxsw_core: Cannot read EEPROM of module on an inactive line card netlink error: Input/output error When user space tries to set the power mode policy of such a transceiver, cache the configuration and apply it when the line card becomes active. This is consistent with other port configuration (e.g., MTU setting) that user space is able to perform while the line card is provisioned, but inactive. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a11e1ec141ea14b9e44240b275378a315ee44457 Author: Vadim Pasternak Date: Tue Apr 19 17:54:28 2022 +0300 mlxsw: core_env: Split module power mode setting to a separate function Move the code that applies the module power mode to the device to a separate function. This function will be invoked by the next patch to set the power mode on transceiver modules found on a line card when the line card becomes active. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7b261af9f641595f2fc2c8fae6cdcffc740b9b9e Author: Vadim Pasternak Date: Tue Apr 19 17:54:27 2022 +0300 mlxsw: core: Add bus argument to environment init API Pass bus argument to mlxsw_env_init(). The purpose is to get access to device handle, which is to be provided to error message in case of line card activation failure. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit de28976d2650d3cd962035a9fac5eef3c5b1b379 Author: Jiri Pirko Date: Tue Apr 19 17:54:26 2022 +0300 mlxsw: core_linecards: Introduce ops for linecards status change tracking Introduce an infrastructure allowing users to register a set of operations which are to be called whenever a line card gets active/inactive. Signed-off-by: Jiri Pirko Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d90502d2ef99366d7d7c2bd9503165ec5baf590c Author: Ville Syrjälä Date: Mon Mar 21 21:50:04 2022 +0200 drm/i915: Program i830 DPLL FP register later Follow the new i9xx DPLL FP register programming sequence introduced in commit 62d66b218386 ("drm/i915: Fold i9xx_set_pll_dividers() into i9xx_enable_pll()") in the i830 "power well" code as well. Just for consistency. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220321195006.775-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit b962a068347533e72ddb60ace6d649a5b974485b Author: Vinod Govindapillai Date: Sun Apr 17 12:31:05 2022 +0300 drm/i915: program wm blocks to at least blocks required per line In configurations with single DRAM channel, for usecases like 4K 60 Hz, FIFO underruns are observed quite frequently. Looks like the wm0 watermark values need to bumped up because the wm0 memory latency calculations are probably not taking the DRAM channel's impact into account. As per the Bspec 49325, if the ddb allocation can hold at least one plane_blocks_per_line we should have selected method2. Assuming that modern HW versions have enough dbuf to hold at least one line, set the wm blocks to equivalent to blocks per line. v2: styling and comments changes (Ville) v3: Updated the reviewed-by tag v4: max_t to max and patch styling (Ville) References: https://gitlab.freedesktop.org/drm/intel/-/issues/4321 Cc: Ville Syrjälä Cc: Stanislav Lisovskiy Signed-off-by: Vinod Govindapillai Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220417093105.729014-1-vinod.govindapillai@intel.com commit 681f8a5c6e372dbfd2a313ace417e7749543de1d Author: Hans de Goede Date: Mon Apr 18 17:09:36 2022 +0200 drm/i915: Fix DISP_POS_Y and DISP_HEIGHT defines Commit 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers") introduced DISP_POS_Y and DISP_HEIGHT defines but accidentally set these their masks to REG_GENMASK(31, 0) instead of REG_GENMASK(31, 16). This breaks the primary display pane on at least pineview machines, fix the mask to fix the primary display pane only showing black. Tested on an Acer One AO532h with an Intel N450 SoC. Fixes: 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers") Cc: José Roberto de Souza Cc: Ville Syrjälä Signed-off-by: Hans de Goede Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220418150936.5499-1-hdegoede@redhat.com Reviewed-by: José Roberto de Souza commit c2b5a40c9e50651a29ee9d110f7ebc41b8720efa Author: Mika Westerberg Date: Wed Apr 20 13:43:50 2022 +0300 spi: intel: Implement dirmap hooks Currently the driver goes over the supported opcodes list each time ->exec_op() is called and finds the suitable for the given operation. This consumes unnecessary amount of CPU cycles because the operation is always the same. For this reason populate dirmap hooks for the driver so that we cache the selected operation and then simply call it on each read/write. Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20220420104350.19510-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown commit fbae863de87bf50c7b13b40e3b4dc4b479335020 Author: Ajit Kumar Pandey Date: Wed Apr 20 15:14:36 2022 +0530 ASoC: amd: acp: Add pm ops callback in machine driver Add alsa snd_soc_pm_ops callback in ACP machine driver to support suspend and resume operation of sound card components Signed-off-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20220420094442.1352717-1-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit 3625a627f6e785a3469977d65dad41c21e77eedc Merge: dd769f15483ca 8e8a9e364a3b3 Author: Mark Brown Date: Wed Apr 20 14:22:11 2022 +0100 MediaTek SPI controller cleanups and documentation Merge series from AngeloGioacchino Del Regno : This series performs some cleanups to the spi-mt65xx driver, removing all gotos, simplifying the probe function and adding kerneldoc to the driver structures. commit 2ad1e059cb3c2c53dc639e4f816daddcfc0e91fd Merge: 7ed1bf73345a3 374b50e234a3e Author: Mark Brown Date: Wed Apr 20 14:22:08 2022 +0100 ASoC: soc-pcm: improve BE state transitions Merge series from Pierre-Louis Bossart : With additional tests with the introduction of a 'deep-buffer' PCM device mixed with the regular low-latency path, we came up with two improvements in the BE state machine and transitions. The short explanation is that the BE cannot directly use the trigger commands provided by the FE, and a translation is needed to deal with paused states. commit 7ed1bf73345a3fe5439f50c1d0fb24bfede417b0 Merge: e1bbfccf3c529 03cf7262076f0 Author: Mark Brown Date: Wed Apr 20 14:22:06 2022 +0100 ASoC: SOF: add INTEL_IPC4 plumbing Merge series from Pierre-Louis Bossart : The INTEL_IPC4 protocol and firmware architecture will rely on different sets of firmware binary and topology files. Some platforms will only support INTEL_IPC4, some will support both INTEL_IPC4 and SOF_IPC for development, and some will stay with the existing SOF_IPC. This patchset adds new IPC definitions, and search paths for firmware and topology files, along with means to override the default IPC type and search paths for development. The firmware binary names are aligned with those used by the Intel AVS driver to avoid duplicate firmware installs, but the topology will have to differ due to driver architecture differences. commit e1bbfccf3c52944dbdb83d8333dba4ae6b8a094c Merge: 89d2bce7e6f10 274d79e518755 Author: Mark Brown Date: Wed Apr 20 14:22:05 2022 +0100 ASoC: Intel: avs: Topology and path management Merge series from Cezary Rojewski : A continuation of avs-driver initial series [1]. This chapter covers path management and topology parsing part which was ealier path of the main series. The two patches that represented these two subjects in the initial series, have been split into many to allow for easier review and discussion. AVS topology is split into two major parts: dictionaries - found within ASoC topology manifest - and path templates. Dictionaries job is to reduce the total amount of memory occupied by topology elements. Rather than having every pipeline and module carry its own information, each refers to specific entry in specific dictionary by provided (from topology file) indexes. In consequence, most struct avs_tplg_xxx are made out of pointers. Path templates are similar to path descriptions found in skylake-driver and they describe how given path shall look like in runtime - number of modules and pipelines that shape it and how they are laid out. A single path template is tied either to FE or BE and thus at most to a single, user-visible endpoint when speaking of FE. Path is a software representation of its ADSP firmware equivalent. It's a logical container for pipelines which are themselves containers - this time for modules i.e. processing units. Depending on the number of audio formats supported, each path template may carry one or more descriptions of given path. During runtime, when audio format is known, description matching said format is selected and used when instantiating path on ADSP firmware side through IPCs. commit 89d2bce7e6f10bc361c8b9221afcb3e0d3188aeb Merge: e18610eaa66a1 a69d7f1bd3732 Author: Mark Brown Date: Wed Apr 20 14:22:03 2022 +0100 ASoC: fsl_micfil: Driver updates Merge series from Sascha Hauer : Cleanups for the fsl_micfil driver. commit 06e0b802583d7bbc075476d90da995ee3e6053d5 Author: Marc Zyngier Date: Tue Apr 19 19:27:52 2022 +0100 KVM: arm64: Expose the WFXT feature to guests Plumb in the capability, and expose WFxT to guests when available. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-8-maz@kernel.org commit a3fb59651449d8bd4dc4ed5413888819932c740b Author: Marc Zyngier Date: Tue Apr 19 19:27:51 2022 +0100 KVM: arm64: Offer early resume for non-blocking WFxT instructions For WFxT instructions used with very small delays, it is not unlikely that the deadline is already expired by the time we reach the WFx handling code. Check for this condition as soon as possible, and return to the guest immediately if we can. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419182755.601427-7-maz@kernel.org commit 89f5074c503b6b6f181c0240c931f67bcaf266e9 Author: Marc Zyngier Date: Tue Apr 19 19:27:50 2022 +0100 KVM: arm64: Handle blocking WFIT instruction When trapping a blocking WFIT instruction, take it into account when computing the deadline of the background timer. The state is tracked with a new vcpu flag, and is gated by a new CPU capability, which isn't currently enabled. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419182755.601427-6-maz@kernel.org commit daf85a5f6be33788e18ff3efad1d7c3ad66a8cb3 Author: Marc Zyngier Date: Tue Apr 19 19:27:49 2022 +0100 KVM: arm64: Introduce kvm_counter_compute_delta() helper Refactor kvm_timer_compute_delta() and extract a helper that compute the delta (in ns) between a given timer and an arbitrary value. No functional change expected. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419182755.601427-5-maz@kernel.org commit b57de4ffd7c6d1247fdaef8437450ab7c1dd4ed0 Author: Marc Zyngier Date: Tue Apr 19 19:27:48 2022 +0100 KVM: arm64: Simplify kvm_cpu_has_pending_timer() kvm_cpu_has_pending_timer() ends up checking all the possible timers for a wake-up cause. However, we already check for pending interrupts whenever we try to wake-up a vcpu, including the timer interrupts. Obviously, doing the same work twice is once too many. Reduce this helper to almost nothing, but keep it around, as we are going to make use of it soon. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419182755.601427-4-maz@kernel.org commit 7d26b0516a0df5888fd1486054bc5159f6c0b88f Author: Marc Zyngier Date: Tue Apr 19 19:27:55 2022 +0100 arm64: Use WFxT for __delay() when possible Marginally optimise __delay() by using a WFIT/WFET sequence. It probably is a win if no interrupt fires during the delay. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-11-maz@kernel.org commit 9eae588529751f95834bca775b30b66291def7f6 Author: Marc Zyngier Date: Tue Apr 19 19:27:54 2022 +0100 arm64: Add wfet()/wfit() helpers Just like we have helpers for WFI and WFE, add the WFxT versions. Note that the encoding is that reported by objdump, as no currrent toolchain knows about these instructions yet. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-10-maz@kernel.org commit 69bb02ebc38ace438c9cd7c5315cfe43862b51fe Author: Marc Zyngier Date: Wed Apr 20 13:21:12 2022 +0100 arm64: Add HWCAP advertising FEAT_WFXT In order to allow userspace to enjoy WFET, add a new HWCAP that advertises it when available. Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-9-maz@kernel.org commit 5252c1c5a08e583ab1363f809002cd8a59272b35 Author: Chun-Kuang Hu Date: Sat Apr 16 17:54:28 2022 +0800 soc: mediatek: cmdq: Use mailbox rx_callback instead of cmdq_task_cb rx_callback is a standard mailbox callback mechanism and could cover the function of proprietary cmdq_task_cb, so use the standard one instead of the proprietary one. Client has changed to use the standard callback machanism and sync dma buffer in client driver, so remove the proprietary callback in cmdq helper. Signed-off-by: Chun-Kuang Hu Reviewed-by: jason-jh.lin Tested-by: jason-jh.lin Link: https://lore.kernel.org/r/1650102868-26219-1-git-send-email-chunkuang.hu@kernel.org Signed-off-by: Matthias Brugger commit bdcc2f280334e4e3f42a5a740494444f1026fb65 Author: Marc Zyngier Date: Tue Apr 19 19:27:47 2022 +0100 arm64: Add RV and RN fields for ESR_ELx_WFx_ISS The ISS field exposed by ESR_ELx contain two additional subfields with FEAT_WFxT: - RN, the register number containing the timeout - RV, indicating if the register number is valid Describe these two fields according to the arch spec. No functional change. Reviewed-by: Joey Gouly Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-3-maz@kernel.org commit 6a437208cb942a2dd98f7e1c3fd347ed3d425ffc Author: Marc Zyngier Date: Tue Apr 19 19:27:46 2022 +0100 arm64: Expand ESR_ELx_WFx_ISS_TI to match its ARMv8.7 definition Starting with FEAT_WFXT in ARMv8.7, the TI field in the ISS that is reported on a WFx trap is expanded by one bit to allow the description of WFET and WFIT. Special care is taken to exclude the WFxT bit from the mask used to match WFI so that it also matches WFIT when trapped from EL0. Reviewed-by: Joey Gouly Signed-off-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220419182755.601427-2-maz@kernel.org commit 643a4a85b0bc7efeb5732fb4563c43c77ba0c6ac Author: Ben Walker Date: Tue Mar 1 11:25:51 2022 -0700 dmaengine: hidma: In hidma_prep_dma_memset treat value as a single byte The value parameter is a single byte, so duplicate it to the 8 byte range that is used as the pattern. Signed-off-by: Ben Walker Cc: Sinan Kaya Link: https://lore.kernel.org/r/20220301182551.883474-5-benjamin.walker@intel.com Signed-off-by: Vinod Koul commit 3e0c06964bfcc8271a07065709452fcbc44e70b0 Author: Ben Walker Date: Tue Mar 1 11:25:50 2022 -0700 dmaengine: at_xdmac: In at_xdmac_prep_dma_memset, treat value as a single byte The value passed in to .prep_dma_memset is to be treated as a single byte repeating pattern. Signed-off-by: Ben Walker Cc: Ludovic Desroches Cc: Tudor Ambarus Link: https://lore.kernel.org/r/20220301182551.883474-4-benjamin.walker@intel.com Signed-off-by: Vinod Koul commit ceabe10cf5d642b6ea80e77193f9cd4446df26b5 Author: Ben Walker Date: Tue Mar 1 11:25:49 2022 -0700 dmaengine: at_hdmac: In atc_prep_dma_memset, treat value as a single byte The value passed in to .prep_dma_memset is to be treated as a single byte repeating pattern. Signed-off-by: Ben Walker Cc: Ludovic Desroches Cc: Tudor Ambarus Link: https://lore.kernel.org/r/20220301182551.883474-3-benjamin.walker@intel.com Signed-off-by: Vinod Koul commit fc44ff0ae9f2aa20b64c4e63ab4614156df80240 Author: Ben Walker Date: Tue Mar 1 11:25:48 2022 -0700 dmaengine: Document dmaengine_prep_dma_memset Document this function to make clear the expected behavior of the 'value' parameter. It was intended to match the behavior of POSIX memset as laid out here: https://lore.kernel.org/dmaengine/YejrA5ZWZ3lTRO%2F1@matsya/ Signed-off-by: Ben Walker Link: https://lore.kernel.org/r/20220301182551.883474-2-benjamin.walker@intel.com Signed-off-by: Vinod Koul commit 439b5e765a00a546e8f6b6eedac69889d0b5a869 Author: Dave Jiang Date: Fri Mar 4 14:02:57 2022 -0700 dmaengine: idxd: move wq irq enabling to after device enable Move the calling of request_irq() and other related irq setup code until after the WQ is successfully enabled. This reduces the amount of setup/teardown if the wq is not configured correctly and cannot be enabled. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164642777730.179702.1880317757087484299.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 96144c8fb3921aa8f02ecac2129d30fa36f93ccb Author: Jiapeng Chong Date: Wed Apr 13 16:38:42 2022 +0800 dmaengine: tegra: Remove unused including Eliminate the follow versioncheck warning: ./drivers/dma/tegra186-gpc-dma.c: 21 linux/version.h not needed. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220413083842.69845-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Vinod Koul commit a8facc7b988599f83a680d2d61f4607cda495175 Author: Dave Jiang Date: Tue Apr 12 11:06:32 2022 -0700 dmaengine: add verification of DMA_INTERRUPT capability for dmatest Looks like I forgot to add DMA_INTERRUPT cap setting to the idxd driver and dmatest is still working regardless of this mistake. Add an explicit check of DMA_INTERRUPT capability for dmatest to make sure the DMA device being used actually supports interrupt before the test is launched and also that the driver is programmed correctly. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164978679251.2361020.5856734256126725993.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit e335de6ba5b63872e03208c83a44d2dc155985b8 Author: Haowen Bai Date: Tue Apr 12 15:59:00 2022 +0800 dmaengine: mediatek: mtk-hsdma: use NULL instead of using plain integer as pointer This fixes the following sparse warnings: drivers/dma/mediatek/mtk-hsdma.c:604:26: warning: Using plain integer as NULL pointer Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1649750340-30777-1-git-send-email-baihaowen@meizu.com Signed-off-by: Vinod Koul commit 3dbc47a9629d3ab1bca89cc25f6bffcc47c71ed7 Author: Haowen Bai Date: Tue Apr 12 09:16:20 2022 +0800 dmaengine: pl08x: drop the useless function Unneeded variable: "retval". Return "NULL" , so we have to make code clear. better way, drop the function. Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1649726180-13133-1-git-send-email-baihaowen@meizu.com Signed-off-by: Vinod Koul commit 23084545dbb0ac0d1f0acad915bdeed7bd5f48cd Author: Dave Jiang Date: Mon Apr 11 15:11:16 2022 -0700 dmaengine: idxd: set max_xfer and max_batch for RO device Load the max_xfer_size and max_batch_size values from the values read from registers to the shadow variables. This will allow the read-only device to display the correct values for the sysfs attributes. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971507673.2201761.11244446608988838897.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 4e5a4eb20393b851590b4465f1197a8041c2076b Author: Dave Jiang Date: Mon Apr 11 15:09:38 2022 -0700 dmaengine: idxd: set DMA_INTERRUPT cap bit Even though idxd driver has always supported interrupt, it never actually set the DMA_INTERRUPT cap bit. Rectify this mistake so the interrupt capability is advertised. Reported-by: Ben Walker Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971497859.2201379.17925303210723708961.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 2128565a8d3055623f651712b7faa3d66ce4f02c Author: Aidan MacDonald Date: Mon Apr 11 16:36:18 2022 +0100 dmaengine: jz4780: set DMA maximum segment size Set the maximum segment size, since the hardware can do transfers larger than the default 64 KiB returned by dma_get_max_seg_size(). The maximum segment size is limited by the 24-bit transfer count field in DMA descriptors. The number of bytes is equal to the transfer count times the transfer size unit, which is selected by the driver based on the DMA buffer address and length of the transfer. The size unit can be as small as 1 byte, so set the maximum segment size to 2^24-1 bytes to ensure the transfer count will not overflow regardless of the size unit selected by the driver. Signed-off-by: Aidan MacDonald Link: https://lore.kernel.org/r/20220411153618.49876-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Vinod Koul commit 2672a4bff6c03a20d5ae460a091f67ee782c3eff Author: Arnd Bergmann Date: Wed Sep 11 22:31:51 2019 +0200 ARM: pxa: maybe fix gpio lookup tables From inspection I found a couple of GPIO lookups that are listed with device "gpio-pxa", but actually have a number from a different gpio controller. Try to rectify that here, with a guess of what the actual device name is. Acked-by: Robert Jarzmik Reviewed-by: Linus Walleij Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann commit 57bf0f5a162d386cc1a33f8dd492bb7a2cf8e8ac Author: Arnd Bergmann Date: Wed Sep 11 09:36:03 2019 +0200 ARM: pxa: use pdev resource for palmld mmio The palmld header is almost unused in drivers, the only remaining thing now is the PATA device address, which should really be passed as a resource. Cc: linux-ide@vger.kernel.org Acked-by: Robert Jarzmik Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Damien Le Moal Signed-off-by: Arnd Bergmann commit d965068259d13fde49487b45064106d3d0c57a74 Author: Ilya Novikov Date: Wed Apr 13 14:37:33 2022 +0300 dmaengine: PTDMA: support polled mode If the DMA_PREP_INTERRUPT flag is not provided, run in polled mode, which significantly improves IOPS: more than twice on chunks < 4K. Signed-off-by: Ilya Novikov Link: https://lore.kernel.org/r/20220413113733.59041-1-i.m.novikov@yadro.com Signed-off-by: Vinod Koul commit 578245307f4afefd8da2ca66979d40b9ef517d67 Author: Vinod Koul Date: Thu Apr 14 12:12:16 2022 +0530 dt-bindings: dmaengine: qcom: gpi: add compatible for sc7280 Document the compatible for GPI DMA controller on SC7280 SoC Signed-off-by: Vinod Koul Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220414064216.1182177-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 1d05a0bdb420ddb3e2d7f39cdc24ff16d6902f55 Author: Yunbo Yu Date: Mon Apr 18 22:20:21 2022 +0800 dmaengine: plx_dma: Move spin_lock_bh() to spin_lock() It is unnecessary to call spin_lock_bh() if you are already in a tasklet. Signed-off-by: Yunbo Yu Reviewed-by: Logan Gunthorpe Link: https://lore.kernel.org/r/20220418142021.1241558-1-yuyunbo519@gmail.com Signed-off-by: Vinod Koul commit 766b540df8a374f75d7ad7084da026439c107825 Author: Radhey Shyam Pandey Date: Thu Apr 14 17:54:21 2022 +0530 dt-bindings: dmaengine: xilinx_dma: Add MCMDA channel ID index description MCDMA IP provides up to 16 multiple channels of data movement each on MM2S and S2MM paths. Inline with implementation, in the binding add description for the channel ID start index and mention that it's fixed irrespective of the MCDMA IP configuration(number of read/write channels). Signed-off-by: Radhey Shyam Pandey Acked-by: Rob Herring Link: https://lore.kernel.org/r/1649939061-6675-1-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul commit 85ef87ba9bc282cef441f75d90e2f52f624221ef Merge: c1f6f1e6733c5 cfdb2f365cb9d Author: David S. Miller Date: Wed Apr 20 11:14:36 2022 +0100 Merge tag 'linux-can-next-for-5.19-20220419' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-04-19 this is a pull request of 17 patches for net-next/master. The first 2 patches are by me and target the CAN driver infrastructure. One patch renames a function in the rx_offload helper the other one updates the CAN bitrate calculation to prefer small bit rate pre-scalers over larger ones, which is encouraged by the CAN in Automation. Kris Bahnsen contributes a patch to fix the links to Technologic Systems web resources in the sja1000 driver. Christophe Leroy's patch prepares the mpc5xxx_can driver for upcoming powerpc header cleanup. Minghao Chi's patch converts the flexcan driver to use pm_runtime_resume_and_get(). The next 2 patches target the Xilinx CAN driver. Lukas Bulwahn's patch fixes an entry in the MAINTAINERS file. A patch by me marks the bit timing constants as const. Wolfram Sang's patch documents r8a77961 support on the renesas,rcar-canfd bindings document. The next 2 patches are by me and add support for the mcp251863 chip to the mcp251xfd driver. The last 7 patches are by Pavel Pisa, Martin Jerabek et al. and add the ctucanfd driver for the CTU CAN FD IP Core. ==================== Signed-off-by: David S. Miller commit c1f6f1e6733c5139f61ea67d5cf37456a6a94ece Merge: e63dd41235072 99fdb22bc5e9b Author: David S. Miller Date: Wed Apr 20 11:09:13 2022 +0100 Merge branch 'net-sched-flower-num-vlan-tags' Boris Sukholitko says: ==================== net/sched: flower: match on the number of vlan tags Our customers in the fiber telecom world have network configurations where they would like to control their traffic according to the number of tags appearing in the packet. For example, TR247 GPON conformance test suite specification mostly talks about untagged, single, double tagged packets and gives lax guidelines on the vlan protocol vs. number of vlan tags. This is different from the common IT networks where 802.1Q and 802.1ad protocols are usually describe single and double tagged packet. GPON configurations that we work with have arbitrary mix the above protocols and number of vlan tags in the packet. The following patch series implement number of vlans flower filter. They add num_of_vlans flower filter as an alternative to vlan ethtype protocol matching. The end result is that the following command becomes possible: tc filter add dev eth1 ingress flower \ num_of_vlans 1 vlan_prio 5 action drop Also, from our logs, we have redirect rules such that: tc filter add dev $GPON ingress flower num_of_vlans $N \ action mirred egress redirect dev $DEV where N can range from 0 to 3 and $DEV is the function of $N. Also there are rules setting skb mark based on the number of vlans: tc filter add dev $GPON ingress flower num_of_vlans $N vlan_prio \ $P action skbedit mark $M More about the patch series: - patches 1-2 remove duplicate code by introducing is_key_vlan helper. - patch 3, 4 implement num_of_vlans in the dissector and in the flower. - patch 5 uses the num_of_vlans filter to allow further matching on vlan attributes. Complementary iproute2 patches are being sent separately. Thanks, Boris. - v4: rebased to the latest net-next - v3: - more example commands in patch 3 description (request by Jamal) - patch 5 description made clearer (thanks to Jiri) - v2: - add suitable subject prefixes - more evolved patch 5 description ==================== Signed-off-by: David S. Miller commit 99fdb22bc5e9bcefc65ffae45c6da3de01138ffe Author: Boris Sukholitko Date: Tue Apr 19 11:14:34 2022 +0300 net/sched: flower: Consider the number of tags for vlan filters Before this patch the existence of vlan filters was conditional on the vlan protocol being matched in the tc rule. For example, the following rule: tc filter add dev eth1 ingress flower vlan_prio 5 was illegal because vlan protocol (e.g. 802.1q) does not appear in the rule. Remove the above restriction by looking at the num_of_vlans filter to allow further matching on vlan attributes. The following rule becomes legal as a result of this commit: tc filter add dev eth1 ingress flower num_of_vlans 1 vlan_prio 5 because having num_of_vlans==1 implies that the packet is single tagged. Change is_vlan_key helper to look at the number of vlans in addition to the vlan ethertype. The outcome of this change is that outer (e.g. vlan_prio) and inner (e.g. cvlan_prio) tag vlan filters require the number of vlan tags to be greater then 0 and 1 accordingly. As a result of is_vlan_key change, the ethertype may be set to 0 when matching on the number of vlans. Update fl_set_key_vlan to avoid setting key, mask vlan_tpid for the 0 ethertype. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller commit b4000312822615ba2222e368188029e9b725dbf4 Author: Boris Sukholitko Date: Tue Apr 19 11:14:33 2022 +0300 net/sched: flower: Add number of vlan tags filter These are bookkeeping parts of the new num_of_vlans filter. Defines, dump, load and set are being done here. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller commit 34951fcf26c59e78ae430fba1fce7c08b1871249 Author: Boris Sukholitko Date: Tue Apr 19 11:14:32 2022 +0300 flow_dissector: Add number of vlan tags dissector Our customers in the fiber telecom world have network configurations where they would like to control their traffic according to the number of tags appearing in the packet. For example, TR247 GPON conformance test suite specification mostly talks about untagged, single, double tagged packets and gives lax guidelines on the vlan protocol vs. number of vlan tags. This is different from the common IT networks where 802.1Q and 802.1ad protocols are usually describe single and double tagged packet. GPON configurations that we work with have arbitrary mix the above protocols and number of vlan tags in the packet. The goal is to make the following TC commands possible: tc filter add dev eth1 ingress flower \ num_of_vlans 1 vlan_prio 5 action drop From our logs, we have redirect rules such that: tc filter add dev $GPON ingress flower num_of_vlans $N \ action mirred egress redirect dev $DEV where N can range from 0 to 3 and $DEV is the function of $N. Also there are rules setting skb mark based on the number of vlans: tc filter add dev $GPON ingress flower num_of_vlans $N vlan_prio \ $P action skbedit mark $M This new dissector allows extracting the number of vlan tags existing in the packet. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller commit 6ee59e554d33f1778a7cdeb10b0fb53c3bed1028 Author: Boris Sukholitko Date: Tue Apr 19 11:14:31 2022 +0300 net/sched: flower: Reduce identation after is_key_vlan refactoring Whitespace only. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller commit 285ba06b0edb21af8c7702c5771c06392011020d Author: Boris Sukholitko Date: Tue Apr 19 11:14:30 2022 +0300 net/sched: flower: Helper function for vlan ethtype checks There are somewhat repetitive ethertype checks in fl_set_key. Refactor them into is_vlan_key helper function. To make the changes clearer, avoid touching identation levels. This is the job for the next patch in the series. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller commit e63dd41235072575a190ef3f3e6e618a6dd0ac64 Author: Haowen Bai Date: Tue Apr 19 09:37:31 2022 +0800 ar5523: Use kzalloc instead of kmalloc/memset Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai Signed-off-by: David S. Miller commit fcd30c96af957f9c0eeccb95689548dfce52e149 Author: Luiz Angelo Daros de Luca Date: Mon Apr 18 20:35:58 2022 -0300 net: dsa: realtek: remove realtek,rtl8367s string There is no need to add new compatible strings for each new supported chip version. The compatible string is used only to select the subdriver (rtl8365mb.c or rtl8366rb.c). Once in the subdriver, it will detect the chip model by itself, ignoring which compatible string was used. Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Alvin Šipraga Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL Signed-off-by: David S. Miller commit 6f2d04ccae9b9dc7884c641833823e50db8472fa Author: Luiz Angelo Daros de Luca Date: Mon Apr 18 20:35:57 2022 -0300 dt-bindings: net: dsa: realtek: cleanup compatible strings Compatible strings are used to help the driver find the chip ID/version register for each chip family. After that, the driver can setup the switch accordingly. Keep only the first supported model for each family as a compatible string and reference other chip models in the description. The removed compatible strings have never been used in a released kernel. CC: devicetree@vger.kernel.org Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL Reviewed-by: Alvin Šipraga Signed-off-by: David S. Miller commit f7bc5f52d2354b41d5a111942be7ee01e5560c78 Author: Geert Uytterhoeven Date: Wed Apr 13 15:52:04 2022 +0200 pinctrl: renesas: rzg2l: Restore pin config order The PIN_CFG_* capabilities are always listed in the order they are defined, except in the "TMS/SWDIO" pin definition. Fix the order, to increase uniformity. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f9b18be9e5402531d058bd2479b4881377f9b8b6.1649857772.git.geert+renesas@glider.be commit c3b423fd08a5e9d4a9fe7cc0743a9b6427db2237 Author: Geert Uytterhoeven Date: Mon Apr 11 14:56:40 2022 +0200 pinctrl: renesas: Remove unneeded #include The last __init annotations were removed from these source files almost one decade ago. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/fb71c409ea3ad76163496e305dc955ca8e84416d.1649681741.git.geert+renesas@glider.be commit 1db28b78b35de7a6828091c9d5d7a179f3681680 Author: Lad Prabhakar Date: Wed Apr 6 08:53:18 2022 +0100 pinctrl: renesas: Select PINCTRL_RZG2L if ARCH_RZG2L is enabled GPIO (PINCTRL) block is identical on Renesas RZ/G2L, RZ/G2UL and RZ/V2L SoC's, so instead of selecting PINCTRL_RZG2L config for each SoC select PINCTRL_RZG2L config option if ARCH_RZG2L is enabled. The ARCH_RZG2L config option is already selected by ARCH_R9A07G043, ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220406075318.14385-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit bfc69bdbaad141ac408e6de86b7e0d771c8e3ccb Author: Biju Das Date: Fri Apr 1 19:02:30 2022 +0100 pinctrl: renesas: rzg2l: Add RZ/G2UL support RZ/G2UL SoC has fewer pins compared to RZ/G2L and the port pin definitions are different compared to RZ/G2L. This patch adds a new compatible to take care of these differences by adding r9a07g043_data with r9a07g043_gpio_configs and rzg2l_dedicated_pins.common. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220401180230.19950-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ff06501c1aa30342602e94ccacce167feec92c4b Author: Geert Uytterhoeven Date: Tue Mar 29 11:48:51 2022 +0200 pinctrl: renesas: r8a77995: Add QSPI and RPC pins, groups, and functions Add pins, groups, and functions for the SPI Multi I/O Bus Controller (RPC-IF) to the R8A77995 PFC driver. They are to be used when a QSPI Flash, Octal-SPI Flash, or HyperFlash is connected. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/19a3bccd0ec830846578a38b4c80dccb195109a0.1648547080.git.geert+renesas@glider.be commit d43760b30832c1b497dbbd283b1f0593bddd3eb3 Author: Geert Uytterhoeven Date: Tue Mar 29 11:48:50 2022 +0200 pinctrl: renesas: r8a77990: Add RPC pins, groups, and functions Add pins, groups, and functions for the SPI Multi I/O Bus Controller (RPC-IF) to the R8A77990 PFC driver. They are to be used when an Octal-SPI Flash or HyperFlash is connected. Redefine the QSPI[01] pin groups using the RPC DQ[0:7] pin data, to save memory. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ec9735bb3468225e04ac6cb95e11a0e237b2b9ed.1648547080.git.geert+renesas@glider.be commit 843394c61e9a71f0fb340a08b28cb42695baa929 Author: Wolfram Sang Date: Sun Mar 20 10:25:42 2022 +0100 pinctrl: renesas: r8a77990: Add drive-strength According to R-Car Gen3 HW documentation 2.20 onwards, drive-strength is introduced to r8a77990. It is also documented for r8a774c0. Add it to the pinctrl driver. Signed-off-by: LUU HOAI Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220320092542.2308-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 2130ac189251ea479da985142e5cc8f0ee7c6107 Author: Wolfram Sang Date: Sun Mar 20 10:25:41 2022 +0100 pinctrl: renesas: Allow up to 10 fields for drive_regs Needed to support R-Car E3 and RZ/G2E drive regs. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220320092542.2308-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit dd035683fd1099729bb284cba967c8ee4a0cd64d Author: Geert Uytterhoeven Date: Tue Apr 19 10:08:32 2022 +0200 pinctrl: renesas: checker: Rework drive and bias pin iteration The checker code to iterate over all drive strength and bias register description items is cumbersome, due to the repeated calculation of indices, and the use of hardcoded array sizes. The latter was done under the assumption they would never need to be changed, which turned out to be false. Increase readability by introducing helper macros to access drive strength and bias register description items. Increase maintainability by replacing hardcoded numbers by array sizes calculated at compile-time. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/5051ae56a1388ccf2d283dfc9624de2991cce914.1650355619.git.geert+renesas@glider.be commit e92453b9fe0955b408859d6a14b26662f62189fd Merge: e97e917b0efbf 29c17cb672717 Author: David S. Miller Date: Wed Apr 20 10:45:51 2022 +0100 Merge branch 'hns3-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. Change logs: V1 -> V2: - Fix failed to apply to net-next problem. ==================== Signed-off-by: David S. Miller commit 29c17cb67271709755973a6136e10bb08ae34c16 Author: Hao Chen Date: Tue Apr 19 11:27:09 2022 +0800 net: hns3: remove unnecessary line wrap for hns3_set_tunable Remove unnecessary line wrap for hns3_set_tunable to improve function readability. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 350cb44092461d719fd1a9662b2f7fb7263891d5 Author: Peng Li Date: Tue Apr 19 11:27:08 2022 +0800 net: hns3: replace magic value by HCLGE_RING_REG_OFFSET Magic values are not recommended. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 9c657cbc2c158a32e18f541df309772ca390fc0c Author: Peng Li Date: Tue Apr 19 11:27:07 2022 +0800 net: hns3: fix the wrong words in comments This patch fixes wrong words in comments. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2e0f538870119dfdacf3caf11af2d925157eb84f Author: Peng Li Date: Tue Apr 19 11:27:06 2022 +0800 net: hns3: update the comment of function hclgevf_get_mbx_resp The param of function hclgevf_get_mbx_resp has been changed but the comments not upodated. This patch updates it. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2373b35c24ffdf680efad11377ceb994149b1f6f Author: Hao Chen Date: Tue Apr 19 11:27:05 2022 +0800 net: hns3: add log for setting tx spare buf size For the active tx spare buffer size maybe changed according to the page size, so add log to notice it. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit bcc7a98f0d3cbb18ca2502c278812867f81add48 Author: Jie Wang Date: Tue Apr 19 11:27:04 2022 +0800 net: hns3: add failure logs in hclge_set_vport_mtu Currently, There is a low probability that pf mtu configuration fails, but the information in logs is insufficient for problem locating when the VF mtu value is illegally modified. So record the vf index and vf mtu value at the failure scenario. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 6fde96df0447a29ab785de4fcb229e5543f0cbf7 Author: Jian Shen Date: Tue Apr 19 11:27:03 2022 +0800 net: hns3: refine the definition for struct hclge_pf_to_vf_msg The struct hclge_pf_to_vf_msg is used for mailbox message from PF to VF, including both response and request. But its definition can only indicate respone, which makes the message data copy in function hclge_send_mbx_msg() unreadable. So refine it by edding a general message definition into it. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 07fdc163ac886613e406e8c4356279d9a824b529 Author: Hao Chen Date: Tue Apr 19 11:27:02 2022 +0800 net: hns3: refactor hns3_set_ringparam() Use struct hns3_ring_param to replace variable new/old_xxx and add hns3_is_ringparam_changed() to judge them if is changed to improve code readability. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 286c61e7279768cec9c13bf8ce947de5c33e2325 Author: Yufeng Mo Date: Tue Apr 19 11:27:01 2022 +0800 net: hns3: add ethtool parameter check for CQE/EQE mode For DEVICE_VERSION_V2, the hardware does not support the CQE mode. So add capability bit for coalesce CQE mode and add parameter check for it in ethtool. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e97e917b0efbfbf5dabffac63c6cacfd765fa403 Merge: 8ab38ed779857 45638f013a632 Author: David S. Miller Date: Wed Apr 20 10:42:57 2022 +0100 Merge branch 'atlantic-xdp-multi-buffer' [PATCH net-next v5 0/3] net: atlantic: Add XDP support @ 2022-04-17 10:12 Taehee Yoo 2022-04-17 10:12 ` [PATCH net-next v5 1/3] net: atlantic: Implement xdp control plane Taehee Yoo ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Taehee Yoo @ 2022-04-17 10:12 UTC (permalink / raw) To: davem, kuba, pabeni, netdev, irusskikh, ast, daniel, hawk, john.fastabend, andrii, kafai, songliubraving, yhs, kpsingh, bpf Cc: ap420073 This patchset is to make atlantic to support multi-buffer XDP. The first patch implement control plane of xdp. The aq_xdp(), callback of .xdp_bpf is added. The second patch implements data plane of xdp. XDP_TX, XDP_DROP, and XDP_PASS is supported. __aq_ring_xdp_clean() is added to receive and execute xdp program. aq_nic_xmit_xdpf() is added to send packet by XDP. The third patch implements callback of .ndo_xdp_xmit. aq_xdp_xmit() is added to send redirected packets and it internally calls aq_nic_xmit_xdpf(). Memory model is MEM_TYPE_PAGE_SHARED. Order-2 page allocation is used when XDP is enabled. LRO will be disabled if XDP program doesn't supports multi buffer. AQC chip supports 32 multi-queues and 8 vectors(irq). There are two options. 1. under 8 cores and maximum 4 tx queues per core. 2. under 4 cores and maximum 8 tx queues per core. Like other drivers, these tx queues can be used only for XDP_TX, XDP_REDIRECT queue. If so, no tx_lock is needed. But this patchset doesn't use this strategy because getting hardware tx queue index cost is too high. So, tx_lock is used in the aq_nic_xmit_xdpf(). single-core, single queue, 80% cpu utilization. 32.30% [kernel] [k] aq_get_rxpages_xdp 10.44% [kernel] [k] aq_hw_read_reg <---------- here 9.86% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx 5.51% [kernel] [k] aq_ring_rx_clean single-core, 8 queues, 100% cpu utilization, half PPS. 52.03% [kernel] [k] aq_hw_read_reg <---------- here 18.24% [kernel] [k] aq_get_rxpages_xdp 4.30% [kernel] [k] hw_atl_b0_hw_ring_rx_receive 4.24% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx 2.79% [kernel] [k] aq_ring_rx_clean Performance result(64 Byte) 1. XDP_TX a. xdp_geieric, single core - 2.5Mpps, 100% cpu b. xdp_driver, single core - 4.5Mpps, 80% cpu c. xdp_generic, 8 core(hyper thread) - 6.3Mpps, 40% cpu d. xdp_driver, 8 core(hyper thread) - 6.3Mpps, 30% cpu 2. XDP_REDIRECT a. xdp_generic, single core - 2.3Mpps b. xdp_driver, single core - 4.5Mpps v5: - Use MEM_TYPE_PAGE_SHARED instead of MEM_TYPE_PAGE_ORDER0 - Use 2K frame size instead of 3K - Use order-2 page allocation instead of order-0 - Rename aq_get_rxpage() to aq_alloc_rxpages() - Add missing PageFree stats for ethtool - Remove aq_unset_rxpage_xdp(), introduced by v2 patch due to change of memory model - Fix wrong last parameter value of xdp_prepare_buff() - Add aq_get_rxpages_xdp() to increase page reference count v4: - Fix compile warning v3: - Change wrong PPS performance result 40% -> 80% in single core(Intel i3-12100) - Separate aq_nic_map_xdp() from aq_nic_map_skb() - Drop multi buffer packets if single buffer XDP is attached - Disable LRO when single buffer XDP is attached - Use xdp_get_{frame/buff}_len() v2: - Do not use inline in C file Taehee Yoo (3): net: atlantic: Implement xdp control plane net: atlantic: Implement xdp data plane net: atlantic: Implement .ndo_xdp_xmit handler .../net/ethernet/aquantia/atlantic/aq_cfg.h | 1 + .../ethernet/aquantia/atlantic/aq_ethtool.c | 9 + .../net/ethernet/aquantia/atlantic/aq_main.c | 87 ++++ .../net/ethernet/aquantia/atlantic/aq_main.h | 2 + .../net/ethernet/aquantia/atlantic/aq_nic.c | 136 ++++++ .../net/ethernet/aquantia/atlantic/aq_nic.h | 5 + .../net/ethernet/aquantia/atlantic/aq_ring.c | 409 ++++++++++++++++-- .../net/ethernet/aquantia/atlantic/aq_ring.h | 21 +- .../net/ethernet/aquantia/atlantic/aq_vec.c | 23 +- .../net/ethernet/aquantia/atlantic/aq_vec.h | 6 + .../aquantia/atlantic/hw_atl/hw_atl_a0.c | 6 +- .../aquantia/atlantic/hw_atl/hw_atl_b0.c | 10 +- 12 files changed, 670 insertions(+), 45 deletions(-) -- 2.17.1 ^ permalink raw reply [flat|nested] 4+ messages in thread * [PATCH net-next v5 1/3] net: atlantic: Implement xdp control plane 2022-04-17 10:12 [PATCH net-next v5 0/3] net: atlantic: Add XDP support Taehee Yoo @ 2022-04-17 10:12 ` Taehee Yoo 2022-04-17 10:12 ` [PATCH net-next v5 2/3] net: atlantic: Implement xdp data plane Taehee Yoo 2022-04-17 10:12 ` [PATCH net-next v5 3/3] net: atlantic: Implement .ndo_xdp_xmit handler Taehee Yoo 2 siblings, 0 replies; 4+ messages in thread From: Taehee Yoo @ 2022-04-17 10:12 UTC (permalink / raw) To: davem, kuba, pabeni, netdev, irusskikh, ast, daniel, hawk, john.fastabend, andrii, kafai, songliubraving, yhs, kpsingh, bpf Cc: ap420073 aq_xdp() is a xdp setup callback function for Atlantic driver. When XDP is attached or detached, the device will be restarted because it uses different headroom, tailroom, and page order value. If XDP enabled, it switches default page order value from 0 to 2. Because the default maximum frame size is still 2K and it needs additional area for headroom and tailroom. The total size(headroom + frame size + tailroom) is 2624. So, 1472Bytes will be always wasted for every frame. But when order-2 is used, these pages can be used 6 times with flip strategy. It means only about 106Bytes per frame will be wasted. Also, It supports xdp fragment feature. MTU can be 16K if xdp prog supports xdp fragment. If not, MTU can not exceed 2K - ETH_HLEN - ETH_FCS. And a static key is added and It will be used to call the xdp_clean handler in ->poll(). data plane implementation will be contained the followed patch. Signed-off-by: Taehee Yoo --- v5: - Use MEM_TYPE_PAGE_SHARED instead of MEM_TYPE_PAGE_ORDER0 - Use 2K frame size instead of 3K - Use order-2 page allocation instead of order-0 - Rename aq_get_rxpage() to aq_alloc_rxpages() v4: - No changed v3: - Disable LRO when single buffer XDP is attached v2: - No changed commit 45638f013a63219378f7a2f9b49c5acbfe031c5a Author: Taehee Yoo Date: Sun Apr 17 10:12:47 2022 +0000 net: atlantic: Implement .ndo_xdp_xmit handler aq_xdp_xmit() is the callback function of .ndo_xdp_xmit. It internally calls aq_nic_xmit_xdpf() to send packet. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 26efaef759a1bc43e819ee44cfd8a1fc4514e8c9 Author: Taehee Yoo Date: Sun Apr 17 10:12:46 2022 +0000 net: atlantic: Implement xdp data plane It supports XDP_PASS, XDP_DROP and multi buffer. The new function aq_nic_xmit_xdpf() is used to send packet with xdp_frame and internally it calls aq_nic_map_xdp(). AQC chip supports 32 multi-queues and 8 vectors(irq). there are two option 1. under 8 cores and 4 tx queues per core. 2. under 4 cores and 8 tx queues per core. Like ixgbe, these tx queues can be used only for XDP_TX, XDP_REDIRECT queue. If so, no tx_lock is needed. But this patchset doesn't use this strategy because getting hardware tx queue index cost is too high. So, tx_lock is used in the aq_nic_xmit_xdpf(). single-core, single queue, 80% cpu utilization. 30.75% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx 10.35% [kernel] [k] aq_hw_read_reg <---------- here 4.38% [kernel] [k] get_page_from_freelist single-core, 8 queues, 100% cpu utilization, half PPS. 45.56% [kernel] [k] aq_hw_read_reg <---------- here 17.58% bpf_prog_xxx_xdp_prog_tx [k] bpf_prog_xxx_xdp_prog_tx 4.72% [kernel] [k] hw_atl_b0_hw_ring_rx_receive The new function __aq_ring_xdp_clean() is a xdp rx handler and this is called only when XDP is attached. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 0d14657f40830243266f972766f1e4d00436e648 Author: Taehee Yoo Date: Sun Apr 17 10:12:45 2022 +0000 net: atlantic: Implement xdp control plane aq_xdp() is a xdp setup callback function for Atlantic driver. When XDP is attached or detached, the device will be restarted because it uses different headroom, tailroom, and page order value. If XDP enabled, it switches default page order value from 0 to 2. Because the default maximum frame size is still 2K and it needs additional area for headroom and tailroom. The total size(headroom + frame size + tailroom) is 2624. So, 1472Bytes will be always wasted for every frame. But when order-2 is used, these pages can be used 6 times with flip strategy. It means only about 106Bytes per frame will be wasted. Also, It supports xdp fragment feature. MTU can be 16K if xdp prog supports xdp fragment. If not, MTU can not exceed 2K - ETH_HLEN - ETH_FCS. And a static key is added and It will be used to call the xdp_clean handler in ->poll(). data plane implementation will be contained the followed patch. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 8ab38ed779857fd6d739dacac928dd8df82c4655 Merge: cc4bdef26ecd5 be6ff9665d642 Author: David S. Miller Date: Wed Apr 20 10:34:34 2022 +0100 Merge branch 'dsa-cross-chip-notifier-cleanup' Vladimir Oltean says: ==================== DSA cross-chip notifier cleanups This patch set makes the following improvements: - Cross-chip notifiers pass a switch index, port index, sometimes tree index, all as integers. Sometimes we need to recover the struct dsa_port based on those integers. That recovery involves traversing a list. By passing directly a pointer to the struct dsa_port we can avoid that, and the indices passed previously can still be obtained from the passed struct dsa_port. - Resetting VLAN filtering on a switch has explicit code to make it run on a single switch, so it has no place to stay in the cross-chip notifier code. Move it out. - Changing the MTU on a user port affects only that single port, yet the code passes through the cross-chip notifier layer where all switches are notified. Avoid that. - Other related cosmetic changes in the MTU changing procedure. Apart from the slight improvement in performance given by (a) doing less work in cross-chip notifiers (b) emitting less cross-chip notifiers we also end up with about 100 less lines of code. ==================== Signed-off-by: David S. Miller commit be6ff9665d642d4cd0800b508ded289eaa5b02a2 Author: Vladimir Oltean Date: Fri Apr 15 18:46:26 2022 +0300 net: dsa: don't emit targeted cross-chip notifiers for MTU change A cross-chip notifier with "targeted_match=true" is one that matches only the local port of the switch that emitted it. In other words, passing through the cross-chip notifier layer serves no purpose. Eliminate this concept by calling directly ds->ops->port_change_mtu instead of emitting a targeted cross-chip notifier. This leaves the DSA_NOTIFIER_MTU event being emitted only for MTU updates on the CPU port, which need to be reflected also across all DSA links. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 4715029fa7e9072443af229dcc324e933c83436c Author: Vladimir Oltean Date: Fri Apr 15 18:46:25 2022 +0300 net: dsa: drop dsa_slave_priv from dsa_slave_change_mtu We can get a hold of the "ds" pointer directly from "dp", no need for the dsa_slave_priv. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit cf1c39d3b3a583c83fc7e077e1b3689b37187bd2 Author: Vladimir Oltean Date: Fri Apr 15 18:46:24 2022 +0300 net: dsa: avoid one dsa_to_port() in dsa_slave_change_mtu We could retrieve the cpu_dp pointer directly from the "dp" we already have, no need to resort to dsa_to_port(ds, port). This change also removes the need for an "int port", so that is also deleted. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b2033a05a7197f5ddef617be8f510c9957a82553 Author: Vladimir Oltean Date: Fri Apr 15 18:46:23 2022 +0300 net: dsa: use dsa_tree_for_each_user_port in dsa_slave_change_mtu Use the more conventional iterator over user ports instead of explicitly ignoring them, and use the more conventional name "other_dp" instead of "dp_iter", for readability. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 726816a129cbb1d645ed319a6f181f152f0dbda8 Author: Vladimir Oltean Date: Fri Apr 15 18:46:22 2022 +0300 net: dsa: make cross-chip notifiers more efficient for host events To determine whether a given port should react to the port targeted by the notifier, dsa_port_host_vlan_match() and dsa_port_host_address_match() look at the positioning of the switch port currently executing the notifier relative to the switch port for which the notifier was emitted. To maintain stylistic compatibility with the other match functions from switch.c, the host address and host VLAN match functions take the notifier information about targeted port, switch and tree indices as argument. However, these functions only use that information to retrieve the struct dsa_port *targeted_dp, which is an invariant for the outer loop that calls them. So it makes more sense to calculate the targeted dp only once, and pass it to them as argument. But furthermore, the targeted dp is actually known at the time the call to dsa_port_notify() is made. It is just that we decide to only save the indices of the port, switch and tree in the notifier structure, just to retrace our steps and find the dp again using dsa_switch_find() and dsa_to_port(). But both the above functions are relatively expensive, since they need to iterate through lists. It appears more straightforward to make all notifiers just pass the targeted dp inside their info structure, and have the code that needs the indices to look at info->dp->index instead of info->port, or info->dp->ds->index instead of info->sw_index, or info->dp->ds->dst->index instead of info->tree_index. For the sake of consistency, all cross-chip notifiers are converted to pass the "dp" directly. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8e9e678e4758b69b6231d3ad4d26d3381fdb5f3f Author: Vladimir Oltean Date: Fri Apr 15 18:46:21 2022 +0300 net: dsa: move reset of VLAN filtering to dsa_port_switchdev_unsync_attrs In dsa_port_switchdev_unsync_attrs() there is a comment that resetting the VLAN filtering isn't done where it is expected. And since commit 108dc8741c20 ("net: dsa: Avoid cross-chip syncing of VLAN filtering"), there is no reason to handle this in switch.c either. Therefore, move the logic to port.c, and adapt it slightly to the data structures and naming conventions from there. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f7f9abc5eab9d10561d74b20b3e284649e07d82f Author: Marek Vasut Date: Wed Apr 13 16:07:10 2022 +0200 phy: freescale: imx8m-pcie: Handle IMX8_PCIE_REFCLK_PAD_UNUSED The 'fsl,refclk-pad-mode' DT property used to select clock source for PCIe PHY can have either of three values, IMX8_PCIE_REFCLK_PAD_INPUT, IMX8_PCIE_REFCLK_PAD_OUTPUT, IMX8_PCIE_REFCLK_PAD_UNUSED. The first two options are handled correctly by the driver, the last one is not, this patch implements support for the last option. The IMX8_PCIE_REFCLK_PAD_INPUT means PCIE_RESREF is PHY clock input, the IMX8_PCIE_REFCLK_PAD_OUTPUT means PHY clock are sourced from SoC internal PLL and output to PCIE_RESREF external IO pin. The last IMX8_PCIE_REFCLK_PAD_UNUSED is a combination of previous two, PHY clock are sourced from SoC internal PLL and not output anywhere. Reviewed-by: Richard Zhu Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Kishon Vijay Abraham I Cc: Marcel Ziswiler Cc: NXP Linux Team Cc: Peng Fan Cc: Richard Zhu Cc: Shawn Guo Cc: Vinod Koul Cc: linux-arm-kernel@lists.infradead.org To: linux-phy@lists.infradead.org Link: https://lore.kernel.org/r/20220413140710.10074-1-marex@denx.de Signed-off-by: Vinod Koul commit 1599069a62c6179fdde9f6e5b54d44531064a79c Author: Jules Maselbas Date: Thu Apr 7 12:21:08 2022 +0200 phy: core: Warn when phy_power_on is called before phy_init A warning when the order of phy operation is mixed up by drivers, this is an atempt to make the phy usage more uniform across (usb) drivers. Signed-off-by: Jules Maselbas Cc: Ahmad Fatoum Cc: Amelie DELAUNAY Cc: Minas Harutyunyan Cc: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220407102108.24211-4-jmaselbas@kalray.eu Signed-off-by: Vinod Koul commit bd5bd02e1517352ff215879362624f4ca6575bdc Author: Jules Maselbas Date: Thu Apr 7 12:21:07 2022 +0200 phy: core: Update documentation syntax Update the syntax used by the documentation of phy operation functions. This is to unify the syntax with the newly added documentation. Signed-off-by: Jules Maselbas Link: https://lore.kernel.org/r/20220407102108.24211-3-jmaselbas@kalray.eu Signed-off-by: Vinod Koul commit f1b8d3358af77fc453d6b781f40ee7342a230672 Author: Jules Maselbas Date: Thu Apr 7 12:21:06 2022 +0200 phy: core: Add documentation of phy operation order Add documentation on phy function usage: init function must be called before power_on; power_off must be called before exit. Signed-off-by: Jules Maselbas Cc: Ahmad Fatoum Cc: Amelie DELAUNAY Cc: Minas Harutyunyan Cc: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220407102108.24211-2-jmaselbas@kalray.eu Signed-off-by: Vinod Koul commit 51a9b2c03dd3fddc56c2f68740fade2e38a066d0 Author: Samuel Holland Date: Wed Apr 13 22:22:57 2022 -0500 phy: rockchip-inno-usb2: Handle ID IRQ This supports detecting host mode for the OTG port without an extcon. The rv1108 properties are not updated due to lack of documentation. Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-7-samuel@sholland.org Signed-off-by: Vinod Koul commit 21a470606ed5e8b14980f34cd360595d1cba737f Author: Samuel Holland Date: Wed Apr 13 22:22:56 2022 -0500 phy: rockchip-inno-usb2: Handle bvalid falling Some SoCs have a bvalid falling interrupt, in addition to bvalid rising. This interrupt can detect OTG cable plugout immediately, so it can avoid the delay until the next scheduled work. Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-6-samuel@sholland.org Signed-off-by: Vinod Koul commit ffe597d04db2b75d9c547a2d2e07c268c2a33117 Author: Samuel Holland Date: Wed Apr 13 22:22:55 2022 -0500 phy: rockchip-inno-usb2: Support multi-bit mask properties The "bvalid" and "id" interrupts can trigger on either the rising edge or the falling edge, so each interrupt has two enable bits and two status bits. This change allows using a single property for both bits, checking whether either bit is set. Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-5-samuel@sholland.org Signed-off-by: Vinod Koul commit 5a709a46e4270a6130877c052260d9a6d14ac685 Author: Samuel Holland Date: Wed Apr 13 22:22:54 2022 -0500 phy: rockchip-inno-usb2: Do not lock in bvalid IRQ handler Clearing the IRQ is atomic, so there is no need to hold the mutex. Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-4-samuel@sholland.org Signed-off-by: Vinod Koul commit 656f7fcb1272df590e10cb82e07cd2b79bbf60d1 Author: Samuel Holland Date: Wed Apr 13 22:22:53 2022 -0500 phy: rockchip-inno-usb2: Do not check bvalid twice The bvalid interrupt handler already checks bvalid status. The muxed IRQ handler just needs to call the other handler (plus any other handlers that will be added). Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-3-samuel@sholland.org Signed-off-by: Vinod Koul commit 6a98df08ccd55e87947d253b19925691763e755c Author: Samuel Holland Date: Wed Apr 13 22:22:52 2022 -0500 phy: rockchip-inno-usb2: Fix muxed interrupt support This commit fixes two issues with the muxed interrupt handler. First, the OTG port has the "bvalid" interrupt enabled, not "linestate". Since only the linestate interrupt was handled, and not the bvalid interrupt, plugging in a cable to the OTG port caused an interrupt storm. Second, the return values from the individual port IRQ handlers need to be OR-ed together. Otherwise, the lack of an interrupt from the last port would cause the handler to erroneously return IRQ_NONE. Fixes: ed2b5a8e6b98 ("phy: phy-rockchip-inno-usb2: support muxed interrupts") Signed-off-by: Samuel Holland Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20220414032258.40984-2-samuel@sholland.org Signed-off-by: Vinod Koul commit 74d0cd478622c87c1665e19ea9217f298648581d Author: Paul Kocialkowski Date: Fri Apr 15 17:21:32 2022 +0200 phy: allwinner: phy-sun6i-mipi-dphy: Support D-PHY Rx mode for MIPI CSI-2 The Allwinner A31 D-PHY supports both Rx and Tx modes. While the latter is already supported and used for MIPI DSI this adds support for the former, to be used with MIPI CSI-2. This implementation is inspired by Allwinner's V3s Linux SDK implementation, which was used as a documentation base. It uses the direction dt property to distinguish between tx and rx directions. Signed-off-by: Paul Kocialkowski Link: https://lore.kernel.org/r/20220415152138.635525-3-paul.kocialkowski@bootlin.com Signed-off-by: Vinod Koul commit c20f80d0b89cf43be964797e6170f085b312ea01 Author: Paul Kocialkowski Date: Fri Apr 15 17:21:31 2022 +0200 dt-bindings: sun6i-a31-mipi-dphy: Add optional direction property The Allwinner A31 MIPI D-PHY block supports both tx and rx directions, although each instance of the block is meant to be used in one direction only. There will typically be one instance for MIPI DSI and one for MIPI CSI-2 (it seems unlikely to ever see a shared instance). Describe the direction with a new allwinner,direction property. For backwards compatibility, the property is optional and tx mode should be assumed by default. Signed-off-by: Paul Kocialkowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220415152138.635525-2-paul.kocialkowski@bootlin.com Signed-off-by: Vinod Koul commit 89e73afc3f54059c3baabf45d935fd333ee5b55e Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:33 2022 +0200 ARM: dts: marvell: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407143234.295426-1-krzysztof.kozlowski@linaro.org commit d8e5c884cca3b3ca11ddf25694c503d1952031b3 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:33:04 2022 +0200 ARM: dts: omap: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407143304.295610-1-krzysztof.kozlowski@linaro.org commit d1ba2b36b25a8ecbd9ca898d23488bf8c9c83a09 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:31:27 2022 +0200 ARM: dts: nuvoton: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407143127.295008-1-krzysztof.kozlowski@linaro.org commit c2fe645e5f147122646a0c2731255bf6c33ec2c0 Author: Randy Dunlap Date: Sun Apr 17 18:14:50 2022 -0700 rtla: Documentation: fix email addresses Correct lkml@vger to linux-kernel@vger. Add linux-trace-devel since that is what is in the MAINTAINERS file. Fixes: d40d48e1f1f2 ("rtla: Add Documentation") Signed-off-by: Randy Dunlap Acked-by: Daniel Bristot de Oliveira Cc: Steven Rostedt Signed-off-by: Jonathan Corbet commit 898ee22c32bed56685552fd3352ef9bd6a68af1f Author: Randy Dunlap Date: Mon Apr 18 18:10:21 2022 -0700 Drop Documentation/ide/ Drop all Documentation/ide/ since IDE support was deleted by Christoph Hellwig , Jun 16 2021. Fixes: b7fb14d3ac63 ("ide: remove the legacy ide driver") Signed-off-by: Randy Dunlap Acked-by: Jens Axboe Acked-by: Damien Le Moal Reviewed-by: Christoph Hellwig Signed-off-by: Jonathan Corbet commit b76ecff8317eed4818fdd449bacc81e05534f88b Author: Thomas Zimmermann Date: Tue Apr 19 12:04:05 2022 +0200 fbdev: Warn in hot-unplug workaround for framebuffers without device A workaround makes fbdev hot-unplugging work for framebuffers without device. The only user for this feature was offb. As each OF framebuffer now has an associated platform device, the workaround hould no longer be triggered. Update it with a warning and rewrite the comment. Fbdev drivers that trigger the hot-unplug workaround really need to be fixed. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Suggested-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220419100405.12600-3-tzimmermann@suse.de commit 52b1b46c39ae4321459a1a28dd4e596497b375b8 Author: Thomas Zimmermann Date: Tue Apr 19 12:04:04 2022 +0200 of: Create platform devices for OF framebuffers Create a platform device for each OF-declared framebuffer and have offb bind to these devices. Allows for real hot-unplugging and other drivers besides offb. Originally, offb created framebuffer devices while initializing its module by parsing the OF device tree. No actual Linux device was set up. This tied OF framebuffers to offb and makes writing other drivers for the OF framebuffers complicated. The absence of a Linux device further prevented real hot-unplugging. Adding a distinct platform device for each OF framebuffer solves both problems. Specifically, a DRM driver can now provide graphics output for modern userspace. Some of the offb init code is now located in the OF initialization. There's now also an implementation of of_platform_default_populate_init(), which was missing before. The OF side creates different devices for either OF display nodes or BootX displays as they require different handling by the driver. The offb drivers picks up each type of device and runs the appropriate fbdev initialization. Tested with OF display nodes on qemu's ppc64le target. v3: * declare variable 'node' with function scope (Rob) v2: * run PPC code as part of existing initialization (Rob) * add a few more error warnings (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220419100405.12600-2-tzimmermann@suse.de commit 3fbae284887de24c83e88b1ebbb0a5fe8dbe9ac1 Author: Liu Ying Date: Tue Apr 19 09:08:52 2022 +0800 phy: freescale: phy-fsl-imx8-mipi-dphy: Add i.MX8qxp LVDS PHY mode support i.MX8qxp SoC embeds a Mixel MIPI DPHY + LVDS PHY combo which supports either a MIPI DSI display or a LVDS display. The PHY mode is controlled by SCU firmware and the driver would call a SCU firmware function to configure the PHY mode. The single LVDS PHY has 4 data lanes to support a LVDS display. Also, with a master LVDS PHY and a slave LVDS PHY, they may work together to support a LVDS display with 8 data lanes(usually, dual LVDS link display). Note that this patch supports the LVDS PHY mode only for the i.MX8qxp Mixel combo PHY, i.e., the MIPI DPHY mode is yet to be supported, so for now error would be returned from ->set_mode() if MIPI DPHY mode is passed over to it for the combo PHY. Cc: Guido Günther Cc: Robert Chiras Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Reviewed-by: Guido Günther Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220419010852.452169-6-victor.liu@nxp.com Signed-off-by: Vinod Koul commit 0ccb8385e92af90443791b7706675feb45b8b9f9 Author: Liu Ying Date: Tue Apr 19 09:08:51 2022 +0800 dt-bindings: phy: mixel: mipi-dsi-phy: Add Mixel combo PHY support for i.MX8qxp Add support for Mixel MIPI DPHY + LVDS PHY combo IP as found on Freescale i.MX8qxp SoC. Cc: Guido Günther Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Rob Herring Cc: NXP Linux Team Reviewed-by: Rob Herring Reviewed-by: Guido Günther Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220419010852.452169-5-victor.liu@nxp.com Signed-off-by: Vinod Koul commit f9b0593dd4fc6ea766175d881a82f8d76b9d18a2 Author: Liu Ying Date: Tue Apr 19 09:08:50 2022 +0800 dt-bindings: phy: Convert mixel,mipi-dsi-phy to json-schema This patch converts the mixel,mipi-dsi-phy binding to DT schema format using json-schema. Comparing to the plain text version, the new binding adds the 'assigned-clocks', 'assigned-clock-parents' and 'assigned-clock-rates' properites, otherwise 'make dtbs_check' would complain that there are mis-matches. Also, the new binding requires the 'power-domains' property since all potential SoCs that embed this PHY would provide a power domain for it. The example of the new binding takes reference to the latest dphy node in imx8mq.dtsi. Cc: Guido Günther Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Rob Herring Cc: NXP Linux Team Reviewed-by: Rob Herring Reviewed-by: Guido Günther Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220419010852.452169-4-victor.liu@nxp.com Signed-off-by: Vinod Koul commit 3abfaefb9a6dda5e0bfa6160f55abfd0e32d8b0a Author: Liu Ying Date: Tue Apr 19 09:08:49 2022 +0800 phy: Add LVDS configuration options This patch allows LVDS PHYs to be configured through the generic functions and through a custom structure added to the generic union. The parameters added here are based on common LVDS PHY implementation practices. The set of parameters should cover all potential users. Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: NXP Linux Team Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220419010852.452169-3-victor.liu@nxp.com Signed-off-by: Vinod Koul commit ac2f033aa4fbc94a512e703a953ed36e1bb45d0a Author: Xiaomeng Tong Date: Wed Apr 13 13:11:05 2022 +0800 drm/gma500: fix a potential repeat execution in psb_driver_load Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. To avoid potential executing 'ret = gma_backlight_init(dev);' repeatly, goto outside the loop when found entry by replacing switch/case with if statement. Signed-off-by: Xiaomeng Tong Signed-off-by: Patrik Jakobsson [Fixed indentation] Link: https://patchwork.freedesktop.org/patch/msgid/20220413051105.5612-1-xiam0nd.tong@gmail.com commit c7655df434de1dab1af1b1ba2aad757b15e25b83 Merge: dcf456c9a095a 58ca8b0572cd3 Author: Andrii Nakryiko Date: Tue Apr 19 21:59:35 2022 -0700 Merge branch 'Support riscv libbpf USDT arg parsing logic' Pu Lehui says: ==================== patch 1 fix a minor issue where usdt_cookie is cast to 32 bits. patch 2 add support riscv libbpf USDT argument parsing logic, both RV32 and RV64 tests have been passed as like follow: # ./test_progs -t usdt #169 usdt:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED ==================== Signed-off-by: Andrii Nakryiko commit 58ca8b0572cd3bbaac60d14d2b1b4f38b389ad93 Author: Pu Lehui Date: Tue Apr 19 22:52:38 2022 +0800 libbpf: Support riscv USDT argument parsing logic Add riscv-specific USDT argument specification parsing logic. riscv USDT argument format is shown below: - Memory dereference case: "size@off(reg)", e.g. "-8@-88(s0)" - Constant value case: "size@val", e.g. "4@5" - Register read case: "size@reg", e.g. "-8@a1" s8 will be marked as poison while it's a reg of riscv, we need to alias it in advance. Both RV32 and RV64 have been tested. Signed-off-by: Pu Lehui Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220419145238.482134-3-pulehui@huawei.com commit 5af25a410acb8d34acb11024d752f0ea3491decf Author: Pu Lehui Date: Tue Apr 19 22:52:37 2022 +0800 libbpf: Fix usdt_cookie being cast to 32 bits The usdt_cookie is defined as __u64, which should not be used as a long type because it will be cast to 32 bits in 32-bit platforms. Signed-off-by: Pu Lehui Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220419145238.482134-2-pulehui@huawei.com commit 558094cb8d54761e8e52c4579a8c5a595ddd170a Author: Moritz Fischer Date: Thu Apr 7 19:20:02 2022 -0700 MAINTAINERS: Update linux-fpga repository location As maintainer team we have decided to move the linux-fpga development to a shared repository with shared access. Cc: Xu Yilun Cc: Wu Hao Cc: Stephen Rothwell Cc: Greg Kroah-Hartman Signed-off-by: Moritz Fischer commit 8d005269c50d6fba836eb04b989cd526375627cd Author: Eric W. Biederman Date: Tue Apr 19 09:16:41 2022 -0500 binfmt_flat: Drop vestiges of coredump support There is the briefest start of coredump support in binfmt_flat. It is actually a pain to maintain as binfmt_flat is not built on most architectures so it is easy to overlook. Since the support does not do anything remove it. Signed-off-by: "Eric W. Biederman" Reviewed-by: Niklas Cassel Acked-by: Greg Ungerer Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/87mtgh17li.fsf_-_@email.froward.int.ebiederm.org commit 4b6a151f17cbea6e9bd5b043d0e6e7d19b77c3f7 Author: Konrad Dybcio Date: Fri Apr 15 13:56:33 2022 +0200 ARM: dts: qcom-msm8974*: Remove unnecessary include gpio.h is already included in the SoC DTSI. Don't include it again. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-24-konrad.dybcio@somainline.org commit e63d4c51997af75cdf3f096c333a957b4579e43a Author: Konrad Dybcio Date: Fri Apr 15 13:56:32 2022 +0200 ARM: dts: qcom-msm8974-rhine: Add pstore node Add pstore node to allow for retrieving crash logs. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-23-konrad.dybcio@somainline.org commit e82be679de942decbcdaac82aecbcd1277e03fd1 Author: Konrad Dybcio Date: Fri Apr 15 13:56:31 2022 +0200 ARM: dts: qcom-msm8974-rhine: Add NFC and enable I2C hosts Enable I2C hosts that are (supposed to be) used on Rhine and add NXP PN544 NFC node. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-22-konrad.dybcio@somainline.org commit 09db313d392b42a3a356867d84dc933bcb4556ef Author: Konrad Dybcio Date: Fri Apr 15 13:56:30 2022 +0200 ARM: dts: qcom-msm8974*: Clean up old GPIO declarations Remove unneeded level of nesting, as it does not match the current DTS style. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-21-konrad.dybcio@somainline.org commit 1dfe967ec7cfb03b468d096a69d945070f1cd2a0 Author: Konrad Dybcio Date: Fri Apr 15 13:56:29 2022 +0200 ARM: dts: qcom-msm8974*: Consolidate I2C/UART/SDHCI Clean up and commonize (where possible and it makes sense to) I2C, UART and SDHCI nodes and pin configurations. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-20-konrad.dybcio@somainline.org commit 9f43e1973840955c0bd639c504095fba5f565e20 Author: Konrad Dybcio Date: Fri Apr 15 13:56:28 2022 +0200 ARM: dts: qcom-msm8974*: Enable IMEM unconditionally It's always a part of the SoC, so it makes little sense to disable it. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-19-konrad.dybcio@somainline.org commit f300826d27be7f7f671c922bf57007c98c683590 Author: Konrad Dybcio Date: Fri Apr 15 13:56:27 2022 +0200 ARM: dts: qcom-msm8974: Sort and clean up nodes - Remove regulators from the SoC DTSI - cpu_pmu{} -> pmu{} - move modem/iris regulators out of here; only FP2 used them - tcsr_mutex is moved out of /soc Signed-off-by: Konrad Dybcio [bjorn: Rebased on top of Krzysztof's fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-18-konrad.dybcio@somainline.org commit 2daa785817dd35172b856c30fc5148b2773b6891 Author: Konrad Dybcio Date: Fri Apr 15 13:56:26 2022 +0200 ARM: dts: qcom-msm8974: Convert ADSP to a MMIO device The cx-supply has been removed as it's supposed to be set on a per-board basis. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-17-konrad.dybcio@somainline.org commit c919956818361826903707e023efbb6db7b49091 Author: Konrad Dybcio Date: Fri Apr 15 13:56:25 2022 +0200 ARM: dts: qcom-msm8974pro-*: Use the 8974pro name in DT filenames Add the 'pro' part to the filenames of DTs of devices that are based on this SoC to make in easier to differentiate between Snapdragon 800- and 801-based platforms. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-16-konrad.dybcio@somainline.org commit 7bdc6d8c37c0848da6646484aa1b5e3554525ee5 Author: Konrad Dybcio Date: Fri Apr 15 13:56:24 2022 +0200 ARM: dts: qcom-msm8974pro: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-15-konrad.dybcio@somainline.org commit 598a1e333224e73ae8f078ed6aa8dcd416cfb490 Author: Konrad Dybcio Date: Fri Apr 15 13:56:23 2022 +0200 ARM: dts: qcom-msm8974-castor: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio [bjorn: Rebased ontop of Krzysztof's fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-14-konrad.dybcio@somainline.org commit 5c554c2d67a8c6c43a1fb542cbc73c33ff04c344 Author: Konrad Dybcio Date: Fri Apr 15 13:56:22 2022 +0200 ARM: dts: qcom-msm8974-{"hon","am"}ami: Commonize and modernize the DTs Sony Xperia Z1 and Z1 compact are almost identical, and that shows in their DTs. Commonize the repeating parts and modernize the DTs to use labels. As a bonus, Z1C gains touchscreen support in this commit, as it was present on Z1 already. Signed-off-by: Konrad Dybcio [bjorn: Rebased on top of Krzysztof's fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-13-konrad.dybcio@somainline.org commit 1d59524b9181e17110ae7b809c62a6a66f336fd6 Author: Konrad Dybcio Date: Fri Apr 15 13:56:21 2022 +0200 ARM: dts: qcom-msm8974-klte: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio [bjorn: Rebased on top of Krzysztof's fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-12-konrad.dybcio@somainline.org commit 1c1574e24990e9f9d753958745b8274874241158 Author: Konrad Dybcio Date: Fri Apr 15 13:56:20 2022 +0200 ARM: dts: qcom-msm8974-lge-nexus5: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio [bjorn: Rebased on top of Krzysztof's fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-11-konrad.dybcio@somainline.org commit 409ab7dc57c41d9db54d221f4d247e229ba34cf9 Author: Konrad Dybcio Date: Fri Apr 15 13:56:19 2022 +0200 ARM: dts: qcom-msm8974-fp2: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio [bjorn: Rebased on top of Krzysztof underscore fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-10-konrad.dybcio@somainline.org commit abd26d348b2a366f8947e8c3c2ab9bc881ac9415 Author: Geliang Tang Date: Fri Apr 8 21:36:24 2022 +0800 selftests: mqueue: drop duplicate min definition Drop duplicate macro min() definition in mq_perf_tests.c, use MIN() in sys/param.h instead. Signed-off-by: Geliang Tang Signed-off-by: Shuah Khan commit d490527d30d7cec49257ceb1092ebf974d3303f5 Author: Ze Zhang Date: Sat Apr 16 19:48:48 2022 +0800 selftests/ftrace: add mips support for kprobe args syntax tests This is the mips variant of commit <3990b5baf225> ("selftests/ftrace: Add s390 support for kprobe args tests"). Signed-off-by: Ze Zhang Acked-by: Steven Rostedt (Google) Acked-by: Masami Hiramatsu Signed-off-by: Shuah Khan commit 2238a1f49006dbef3f25e201bffbdab392d0baef Author: Ze Zhang Date: Sat Apr 16 19:48:47 2022 +0800 selftests/ftrace: add mips support for kprobe args string tests This is the mips variant of commit <3990b5baf225> ("selftests/ftrace: Add s390 support for kprobe args tests"). Signed-off-by: Ze Zhang Acked-by: Steven Rostedt (Google) Acked-by: Masami Hiramatsu Signed-off-by: Shuah Khan commit dcf456c9a095a6e71f53d6f6f004133ee851ee70 Author: KP Singh Date: Mon Apr 18 15:51:58 2022 +0000 bpf: Fix usage of trace RCU in local storage. bpf_{sk,task,inode}_storage_free() do not need to use call_rcu_tasks_trace as no BPF program should be accessing the owner as it's being destroyed. The only other reader at this point is bpf_local_storage_map_free() which uses normal RCU. The only path that needs trace RCU are: * bpf_local_storage_{delete,update} helpers * map_{delete,update}_elem() syscalls Fixes: 0fe4b381a59e ("bpf: Allow bpf_local_storage to be used by sleepable programs") Signed-off-by: KP Singh Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220418155158.2865678-1-kpsingh@kernel.org commit 72c3c8d6e5275b19fd2d32ec787e8135a421c7ec Author: Matt Atwood Date: Mon Apr 18 11:51:57 2022 +0530 drm/i915/rpl-p: Add PCI IDs Adding initial PCI ids for RPL-P. RPL-P behaves identically to ADL-P from i915's point of view. Changes since V1 : - SUBPLATFORM ADL_N and RPL_P clash as both are ADLP based - Matthew R Bspec: 55376 Signed-off-by: Matt Atwood Signed-off-by: Madhumitha Tolakanahalli Pradeep Signed-off-by: Tejas Upadhyay [mattrope: Corrected comment formatting to match coding style] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220418062157.2974665-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit 9f440d17e2309c7d14eba0898c775be6d6e6d6b7 Author: Konrad Dybcio Date: Fri Apr 15 13:56:18 2022 +0200 ARM: dts: qcom-apq8074-dragonboard: Use &labels Use &labels to align with the style used in new DTS and apply tiny style fixes. Signed-off-by: Konrad Dybcio [bjorn: Rebased ontop of Krzysztof's underscore fixes] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-9-konrad.dybcio@somainline.org commit 087c9704d5bb322dd5db52938416caeaf4cdc3c3 Author: Konrad Dybcio Date: Fri Apr 15 13:56:17 2022 +0200 ARM: dts: qcom-msm8974*: Rename msmgpio to tlmm Rename the label to match new the style used in newer DTs. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-8-konrad.dybcio@somainline.org commit 64cf62683b5398e46cf967c308be95685137626a Author: Konrad Dybcio Date: Fri Apr 15 13:56:16 2022 +0200 ARM: dts: qcom-msm8974: Fix up SDHCI nodes - Add missing labels (and remove their redefinition from klte) - Commonize bus-width - Add non-removable on sdhc_1, as it's supposed to have an eMMC on it Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-7-konrad.dybcio@somainline.org commit 4de36f7b6d0e7e792d36800ac6c5e3392b59573a Author: Konrad Dybcio Date: Fri Apr 15 13:56:15 2022 +0200 ARM: dts: qcom-msm8974: Fix up mdss nodes Fix up formatting, move status=disabled to the end where it belongs, rename DSI PHY label to match newer DTs, use tabs where possible, unwrap lines where wrapping is not necessary and don't disable mdp, as MDSS is useless without it. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-6-konrad.dybcio@somainline.org commit bb167546d06847a8729c973fe5165a231fd5c39d Author: Konrad Dybcio Date: Fri Apr 15 13:56:14 2022 +0200 ARM: dts: qcom-msm8974*: Fix I2C labels Fix up the label names and add missing ones. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-5-konrad.dybcio@somainline.org commit b905c34ae7db6b564589f02fa7eac7afaa0294e9 Author: Konrad Dybcio Date: Fri Apr 15 13:56:13 2022 +0200 ARM: dts: qcom-msm8974*: Fix UART naming It's either uart10, or blsp2_uart4, not blsp2_uart10, as there aren't 10 UARTs on BLSP2. Fix the naming to align with what's done in arm64/qcom. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-4-konrad.dybcio@somainline.org commit eba5e62045b2848042435ae0503d7c2354edf2af Author: Konrad Dybcio Date: Fri Apr 15 13:56:12 2022 +0200 ARM: dts: qcom-msm8974: Remove properties that are always overriden Model and compatible are set per-device, so having them in the SoC DTSI is superfluous. Remove them. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-3-konrad.dybcio@somainline.org commit 73618b43dc5af291be0eb150f4ba8a3c1a5c5436 Author: Konrad Dybcio Date: Fri Apr 15 13:56:11 2022 +0200 ARM: dts: qcom-*-sony*: Mention SONY board names in DT filenames SONY phones/tables are based on a common board ('platform'). Devices based on the same are often close to identical. Mention their association in filenames, like it's done in arm64 DTs. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415115633.575010-2-konrad.dybcio@somainline.org commit 1a08cb7303cfd898cb9b5c5b1a185e7ed329919f Author: Nícolas F. R. A. Prado Date: Tue Mar 15 17:19:36 2022 -0400 dt-bindings: pinctrl: mt8192: Add gpio-line-names property Add the gpio-line-names optional property to the pinctrl-mt8192 binding to prevent dt_binding_check warnings when it is present in the pinctrl node in the Devicetree. Signed-off-by: Nícolas F. R. A. Prado Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315211936.442708-5-nfraprado@collabora.com Signed-off-by: Linus Walleij commit edbacb36ea50527672e985e7ab062562dbe4a7f0 Author: Nícolas F. R. A. Prado Date: Tue Mar 15 17:19:35 2022 -0400 dt-bindings: pinctrl: mt8192: Add mediatek,pull-up-adv property Add the mediatek,pull-up-adv property to the pinctrl-mt8192 dt-binding to allow configuring pull-up resistors on the pins of MT8192. It is the same as in mt8183-pinctrl. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315211936.442708-4-nfraprado@collabora.com Signed-off-by: Linus Walleij commit 4ac68333ff6dea9bee318e4eb4a91c0b37566600 Author: Nícolas F. R. A. Prado Date: Tue Mar 15 17:19:34 2022 -0400 dt-bindings: pinctrl: mt8192: Add mediatek,drive-strength-adv property Add the mediatek,drive-strength-adv property to the pinctrl-mt8192 dt-binding to allow further drive current adjustments for I2C nodes on MT8192. It is the same as in mt8183-pinctrl. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315211936.442708-3-nfraprado@collabora.com Signed-off-by: Linus Walleij commit 1c5fdf0f79f4d292fad0c746d0925cf8b209f3c3 Author: Nícolas F. R. A. Prado Date: Tue Mar 15 17:19:33 2022 -0400 dt-bindings: pinctrl: mt8192: Add wrapping node for pin configurations On mt8192, the pinctrl node has pinctrl groups to group pin configurations. Each pinctrl group contains one or more pinmux subnodes to list needed pins and their configurations. By supporting multiple subnodes, we can configure different pin characteristics (driving/pull-up/pull-down/etc.) in a pinctrl group. Update the mt8192 pinctrl dt-binding to add the missing pinctrl group node that wraps the pinmux subnodes and update the example at the end. While at it, also remove the example embedded in the description since it is redundant to the already supplied example at the end. This same change was done for mt8195 in commit 79dcd4e840cc ("dt-bindings: pinctrl: mt8195: add wrapping node of pin configurations"). Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315211936.442708-2-nfraprado@collabora.com Signed-off-by: Linus Walleij commit 0e5aefa334dba7fc07ee4ef52ae622f957fc865b Merge: 0d7fefebea552 24fe983abe01c Author: Alexei Starovoitov Date: Tue Apr 19 14:02:49 2022 -0700 Merge branch 'Ensure type tags are always ordered first in BTF' Kumar Kartikeya Dwivedi says: ==================== When iterating over modifiers, ensure that type tags can only occur at head of the chain, and don't occur later, such that checking for them once in the start tells us there are no more type tags in later modifiers. Clang already ensures to emit such BTF, but user can craft their own BTF which violates such assumptions if relied upon in the kernel. Changelog: ---------- v2 -> v3 v2: https://lore.kernel.org/bpf/20220418224719.1604889-1-memxor@gmail.com * Address nit from Yonghong, add Acked-by v1 -> v2 v1: https://lore.kernel.org/bpf/20220406004121.282699-1-memxor@gmail.com * Fix for bug pointed out by Yonghong * Update selftests to include Yonghong's example ==================== Signed-off-by: Alexei Starovoitov commit 24fe983abe01c53e1a9354fe21fab92579fcda6d Author: Kumar Kartikeya Dwivedi Date: Tue Apr 19 22:16:08 2022 +0530 selftests/bpf: Add tests for type tag order validation Add a few test cases that ensure we catch cases of badly ordered type tags in modifier chains. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220419164608.1990559-3-memxor@gmail.com commit eb596b0905584a9389585b0f437cf8a2faeb14d0 Author: Kumar Kartikeya Dwivedi Date: Tue Apr 19 22:16:07 2022 +0530 bpf: Ensure type tags precede modifiers in BTF It is guaranteed that for modifiers, clang always places type tags before other modifiers, and then the base type. We would like to rely on this guarantee inside the kernel to make it simple to parse type tags from BTF. However, a user would be allowed to construct a BTF without such guarantees. Hence, add a pass to check that in modifier chains, type tags only occur at the head of the chain, and then don't occur later in the chain. If we see a type tag, we can have one or more type tags preceding other modifiers that then never have another type tag. If we see other modifiers, all modifiers following them should never be a type tag. Instead of having to walk chains we verified previously, we can remember the last good modifier type ID which headed a good chain. At that point, we must have verified all other chains headed by type IDs less than it. This makes the verification process less costly, and it becomes a simple O(n) pass. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220419164608.1990559-2-memxor@gmail.com commit 0d7fefebea552771b17682a12330ea47e369a5df Author: Andrii Nakryiko Date: Mon Apr 18 17:24:51 2022 -0700 selftests/bpf: Use non-autoloaded programs in few tests Take advantage of new libbpf feature for declarative non-autoloaded BPF program SEC() definitions in few test that test single program at a time out of many available programs within the single BPF object. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220419002452.632125-2-andrii@kernel.org commit a3820c48111247f4ec2ca2949597f8fa57d2c424 Author: Andrii Nakryiko Date: Mon Apr 18 17:24:50 2022 -0700 libbpf: Support opting out from autoloading BPF programs declaratively Establish SEC("?abc") naming convention (i.e., adding question mark in front of otherwise normal section name) that allows to set corresponding program's autoload property to false. This is effectively just a declarative way to do bpf_program__set_autoload(prog, false). Having a way to do this declaratively in BPF code itself is useful and convenient for various scenarios. E.g., for testing, when BPF object consists of multiple independent BPF programs that each needs to be tested separately. Opting out all of them by default and then setting autoload to true for just one of them at a time simplifies testing code (see next patch for few conversions in BPF selftests taking advantage of this new feature). Another real-world use case is in libbpf-tools for cases when different BPF programs have to be picked depending on particulars of the host kernel due to various incompatible changes (like kernel function renames or signature change, or to pick kprobe vs fentry depending on corresponding kernel support for the latter). Marking all the different BPF program candidates as non-autoloaded declaratively makes this more obvious in BPF source code and allows simpler code in user-space code. When BPF program marked as SEC("?abc") it is otherwise treated just like SEC("abc") and bpf_program__section_name() reported will be "abc". Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220419002452.632125-1-andrii@kernel.org commit 225b5d376e53543a66fc9b824a05cfcdf74c763a Author: Arnd Bergmann Date: Tue Sep 10 22:22:03 2019 +0200 ARM: pxa: make addr-map.h header local Drivers should not rely on the contents of this file, so move it into the platform directory directly. Cc: Philipp Zabel Cc: Paul Parsons Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/87mudkmx8g.fsf@belgarion.home/ commit b83deaa741558babf4b8d51d34f6637ccfff1b26 Author: Arnd Bergmann Date: Thu May 28 22:57:40 2020 +0200 ARM: pxa: move pcmcia board data into mach-pxa The drivers/pcmcia/pxa2xx_*.c are essentially part of the board files, but for historic reasons located in drivers/pcmcia. Move them into the same place as the actual board file to avoid lots of machine header inclusions. Cc: Marek Vasut Cc: Dominik Brodowski Cc: Jonathan Cameron Signed-off-by: Arnd Bergmann commit 2548e6c76ebfae09f25f941ae172535cc918c906 Author: Arnd Bergmann Date: Tue Sep 10 15:23:52 2019 +0200 ARM: pxa: pxa2xx-ac97-lib: use IRQ resource The pxa2xx-ac97-lib code is the last driver to use mach/irqs.h for PXA. Almost everything already passes the interrupt as a resource, so use it from there. The one exception is the mxm8x10 machine, which apparently has a resource-less device. Replacing it with the correct one enables the driver here as well. Cc: alsa-devel@alsa-project.org Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit e86bd43bcfc579cf8935c1913e92cb76b4ba81c2 Author: Arnd Bergmann Date: Sun Sep 8 22:33:51 2019 +0200 watchdog: sa1100: use platform device registration Rather than relying on machine specific headers to pass down the reboot status and the register locations, use resources and platform_data. Aside from this, keep the changes to a minimum. Cc: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org Acked-by: Guenter Roeck Signed-off-by: Arnd Bergmann commit fe7ff911938eaf31a5481bdd8136c9210dd52a9b Author: Krzysztof Kozlowski Date: Tue Apr 19 10:49:42 2022 +0200 docs: dt: writing-schema: mention yamllint The dtschema uses yamllint, if present, to check the syntax of the files, so document this. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220419084942.27409-1-krzysztof.kozlowski@linaro.org commit 3ca2dc75080703eaa82e3719312f8ce8ef66757c Author: Stefan Wahren Date: Sat Apr 9 20:40:17 2022 +0200 MAINTAINERS: add raspberrypi to BCM2835 architecture Recent changes to the firmware clock driver have not be send to the architecture maintainers. So fix this by adding the matching pattern. Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 307f722b4e71bf30d0a307aba33bce148d9cdd5e Author: John Harrison Date: Fri Apr 15 15:40:25 2022 -0700 drm/i915/dg2: Enable Wa_22012727170/Wa_22012727685 The above two workaronuds regarding context isolation are implemented by GuC. The KMD just needs to enable them. Signed-off-by: John Harrison Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-7-umesh.nerlige.ramappa@intel.com commit 717f9bad5d25d5cf9f750c88a41627a71fad7b23 Author: Matthew Brost Date: Fri Apr 15 15:40:24 2022 -0700 drm/i915/dg2: Enable Wa_14014475959 - RCS / CCS context exit There is bug in DG2 where if the CCS contexts switches out while the RCS is running it can cause memory corruption. To workaround this add an atomic to a memory address with a value 1 and semaphore wait to the same address for a value of 0. The GuC firmware is responsible for writing 0 to the memory address when it is safe for the context to switch out. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-6-umesh.nerlige.ramappa@intel.com commit dfa57ecf77c66eb28ac7760f582bfd7d4183c429 Author: Vinay Belgaumkar Date: Fri Apr 15 15:40:23 2022 -0700 drm/i915/guc: Apply Wa_16011777198 Enable GuC Wa to reset RCS/CCS before it goes into RC6. Signed-off-by: Vinay Belgaumkar Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-5-umesh.nerlige.ramappa@intel.com commit c6b41c4d9becce74bae50b461011250b9ae004a0 Author: John Harrison Date: Fri Apr 15 15:40:22 2022 -0700 drm/i915/guc: Enable GuC based workarounds for DG2 There are some workarounds for DG2 that are implemented in the GuC firmware. However, the KMD is required to enable these by setting the appropriate flag as GuC does not know what platform it is running on. Wa_16011759253 Wa_14012630569 Wa_14013746162 Signed-off-by: John Harrison CC: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-4-umesh.nerlige.ramappa@intel.com commit dac38381098d868d979b47e1e6ebba848db4d80f Author: Umesh Nerlige Ramappa Date: Fri Apr 15 15:40:21 2022 -0700 drm/i915/guc: Enable Wa_22011802037 for gen12 GuC based platforms Initiating a reset when the command streamer is not idle or in the middle of executing an MI_FORCE_WAKE can result in a hang. Multiple command streamers can be part of a single reset domain, so resetting one would mean resetting all command streamers in that domain. To workaround this, before initiating a reset, ensure that all command streamers within that reset domain are either IDLE or are not executing a MI_FORCE_WAKE. Enable GuC PRE_PARSER WA bit so that GuC follows the WA sequence when initiating engine-resets. For gt-resets, ensure that i915 applies the WA sequence. Opens to address in future patches: - The part of the WA to wait for pending forcewakes is also applicable to execlists backend. - The WA also needs to be applied for gen11 Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-3-umesh.nerlige.ramappa@intel.com commit f6aa0d713c8862602e85e89f876b25185234aced Author: Tilak Tangudu Date: Fri Apr 15 15:40:20 2022 -0700 drm/i915: Add Wa_22011802037 force cs halt Prior to doing a reset, SW must ensure command streamer is stopped, as a workaround, to eliminate a race condition in GPM flow. Setting both the ring stop and prefetch disable bits, will cause the command streamer to halt. Signed-off-by: Tilak Tangudu Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220415224025.3693037-2-umesh.nerlige.ramappa@intel.com commit 604319e94fc2a1ffa7ee9e3afc5d59eafefda998 Author: Phil Elwell Date: Mon Apr 11 22:01:43 2022 +0200 ARM: dts: bcm283x: Align ETH_CLK GPIO line name The GPIO line name ETHCLK is not aligned with the other signals like WIFI_CLK. Recently this has been fixed in the vendor tree, so upstream this change. Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 0b8c9a837cc3588f483f2a03723aa1e3651d8665 Author: Stefan Wahren Date: Mon Apr 11 22:01:42 2022 +0200 ARM: dts: bcm283x: Remove gpio line name NC The convention to name not connected GPIOs with NC has never been adapted. Also newer Raspberry Pi boards like RPi 4 never did. So fix this inconsistency by removing all of the NC names. Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 97bd8659c1c46c23e4daea7e040befca30939950 Author: Stefan Wahren Date: Mon Apr 11 22:01:41 2022 +0200 ARM: dts: bcm2835-rpi-b: Fix GPIO line names Recently this has been fixed in the vendor tree, so upstream this. Fixes: 731b26a6ac17 ("ARM: bcm2835: Add names for the Raspberry Pi GPIO lines") Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 57f718aa4b93392fb1a8c0a874ab882b9e18136a Author: Phil Elwell Date: Mon Apr 11 22:01:40 2022 +0200 ARM: dts: bcm2837-rpi-3-b-plus: Fix GPIO line name of power LED The red LED on the Raspberry Pi 3 B Plus is the power LED. So fix the GPIO line name accordingly. Fixes: 71c0cd2283f2 ("ARM: dts: bcm2837: Add Raspberry Pi 3 B+") Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 9fd26fd02749ec964eb0d588a3bab9e09bf77927 Author: Phil Elwell Date: Mon Apr 11 22:01:39 2022 +0200 ARM: dts: bcm2837-rpi-cm3-io3: Fix GPIO line names for SMPS I2C The GPIOs 46 & 47 are already used for a I2C interface to a SMPS. So fix the GPIO line names accordingly. Fixes: a54fe8a6cf66 ("ARM: dts: add Raspberry Pi Compute Module 3 and IO board") Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 2c663e5e5bbf2a5b85e0f76ccb69663f583c3e33 Author: Phil Elwell Date: Mon Apr 11 22:01:38 2022 +0200 ARM: dts: bcm2835-rpi-zero-w: Fix GPIO line name for Wifi/BT The GPIOs 30 to 39 are connected to the Cypress CYW43438 (Wifi/BT). So fix the GPIO line names accordingly. Fixes: 2c7c040c73e9 ("ARM: dts: bcm2835: Add Raspberry Pi Zero W") Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit a555b382e7640b80b20816cf9179d091dd7716eb Author: Luca Weiss Date: Fri Apr 15 21:54:49 2022 +0200 soc: qcom: socinfo: Sort out 8974PRO names MSM8974PRO is commonly used for referring to Snapdragon 801, compared to MSM8974 which is Snapdragon 800. The Snapdragon 801 has three variants with different clock speeds, with the -AA, -AB and -AC suffix. Adjust the names in socinfo to reflect this. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415195449.617040-1-luca@z3ntu.xyz commit 5f9e72a4025b232ef0ddd5b6e4189e81091322fe Author: Krzysztof Kozlowski Date: Mon Apr 11 17:55:28 2022 +0200 dt-bindings: soc: qcom,smp2p: convert to dtschema Convert the Qualcomm Shared Memory Point 2 Point bindings to DT Schema. Changes against original bindings: enforce only specific names of child nodes, instead of any names. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411155528.502889-1-krzysztof.kozlowski@linaro.org commit 6579f39290bf056442850094b8f4b95163c17996 Author: Kuldeep Singh Date: Mon Apr 4 23:59:37 2022 +0530 dt-bindings: qcom: geni-se: Update UART schema reference We now have geni based QUP UART controller individual binding, update reference in parent schema and remove properties from common wrapper. With removal of last child node schema, remove common properties of all the controllers as they have become obsolete now. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220404182938.29492-5-singh.kuldeep87k@gmail.com commit fcf2c0f7cbcad29f1decb88567e54c2451b60ba5 Author: Kuldeep Singh Date: Mon Apr 4 23:59:35 2022 +0530 dt-bindings: qcom: geni-se: Update I2C schema reference We now have geni based QUP I2C controller binding in place as dt-bindigs/i2c/qcom,i2c-geni-qcom.yaml similar to other controllers, update reference in parent schema and while at it, also remove properties defined for the controller from common wrapper. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220404182938.29492-3-singh.kuldeep87k@gmail.com commit 38d46b0f41ec57c734f1a647055644c2131c3d8f Author: Krzysztof Kozlowski Date: Mon Apr 11 10:59:35 2022 +0200 dt-bindings: soc: qcom,rpmh-rsc: convert to dtschema Convert the Qualcomm RPMH RSC bindings to DT Schema. Changes against original bindings: 1. Add qcom,tcs-offset as a property instead of one of reg (not used that way). 2. Add limits to interrupts. 3. Add child nodes (bcm-voter, clock-controller, power-controller). 4. Extend the example with more complex one. The device description and DTS examples were copied from existing sources, so keep the license as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411085935.130072-4-krzysztof.kozlowski@linaro.org commit 97d485edc1d9902c9ae3b2242144abdf85edd4c1 Author: Michael Srba Date: Mon Apr 11 09:21:55 2022 +0200 bus: add driver for initializing the SSC bus on (some) qcom SoCs Add bindings for the AHB bus which exposes the SSC (Snapdragon Sensor Core) block in the global address space. This bus (and the SSC block itself) is present on certain qcom SoCs. In typical configuration, this bus (as some of the clocks and registers that we need to manipulate) is not accessible to Linux, and the resources on this bus are indirectly accessed by communicating with a hexagon CPU core residing in the SSC block. In this configuration, the hypervisor is the one performing the bus initialization for the purposes of bringing the hexagon CPU core out of reset. However, it is possible to change the configuration, in which case this driver will initialize the bus. In combination with drivers for resources on the SSC bus, this driver can aid in debugging, and for example with a TLMM driver can be used to directly access SSC-dedicated GPIO pins, removing the need to commit to a particular usecase during hw design. Finally, until open firmware for the hexagon core is available, this approach allows for using sensors hooked up to SSC-dedicated GPIO pins on mainline Linux simply by utilizing the existing in-tree drivers for these sensors. Signed-off-by: Michael Srba Reviewed-by: Jeffrey Hugo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411072156.24451-5-michael.srba@seznam.cz commit 5d04419045e7ad28155e2f7403599b2fdbd1548f Author: Matthias Kaehlcke Date: Fri Apr 15 17:22:41 2022 -0700 arm64: dts: qcom: sc7280: Add SAR sensors to herobrine crd Enable the two SAR sensors of the CRD based on herobrine. Signed-off-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415172238.1.I671bdf40fdfce7a35f6349fca0dc56145d4210ee@changeid commit e7173009e139bc13bf7833ea4185dda4779b95f3 Author: Bryan O'Donoghue Date: Fri Apr 15 17:46:55 2022 +0100 arm64: dts: qcom: sm8250: camss: Add CCI definitions sm8250 has two CCI busses with two I2C busses apiece. Co-developed-by: Julian Grahsl Signed-off-by: Julian Grahsl Reviewed-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415164655.1679628-4-bryan.odonoghue@linaro.org commit 30325603b910e4ca61d56d20e2f5b9076d371e83 Author: Bryan O'Donoghue Date: Fri Apr 15 17:46:54 2022 +0100 arm64: dts: qcom: sm8250: camss: Add CAMSS block definition Adds a CAMSS definition block. Co-developed-by: Julian Grahsl Signed-off-by: Julian Grahsl Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415164655.1679628-3-bryan.odonoghue@linaro.org commit ca79a997f2c0826ccf7d313068de3d04d5e8c82b Author: Bryan O'Donoghue Date: Fri Apr 15 17:46:53 2022 +0100 arm64: dts: qcom: sm8250: Add camcc DT node Add the camcc DT node for the Camera Clock Controller on sm8250. Signed-off-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220415164655.1679628-2-bryan.odonoghue@linaro.org commit 4ae6eeed93029301022351e88fd4f82afcbdea93 Author: Tales Lelo da Aparecida Date: Fri Apr 15 16:50:27 2022 -0300 MAINTAINERS: add docs entry to AMDGPU To make sure maintainers of amdgpu drivers are aware of any changes in their documentation, add its entry to MAINTAINERS. Acked-by: Christian König Signed-off-by: Tales Lelo da Aparecida Signed-off-by: Alex Deucher commit 6954e5baa055c91bc878695ceca57cbf0787d277 Author: Tales Lelo da Aparecida Date: Fri Apr 15 16:50:26 2022 -0300 Documentation/gpu: Add entries to amdgpu glossary Add missing acronyms to the amdgppu glossary. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1939 Acked-by: Christian König Signed-off-by: Tales Lelo da Aparecida Signed-off-by: Alex Deucher commit 79847f13a086675c2332c2c7648fce5bfee7b9ee Author: Tom Rix Date: Sat Apr 16 14:47:36 2022 -0400 drm/radeon/kms: change evergreen_default_state table from global to static evergreen_default_state and evergreen_default_size are only used in evergreen.c. Single file symbols should be static. So move their definitions to evergreen_blit_shaders.h and change their storage-class-specifier to static. Remove unneeded evergreen_blit_shader.c evergreen_ps/vs definitions were removed with commit 4f8629675800 ("drm/radeon/kms: remove r6xx+ blit copy routines") So their declarations in evergreen_blit_shader.h are not needed, so remove them. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 3eccf76c2defa01a48f444d914b8ccd94ab661d5 Author: Tom Rix Date: Mon Apr 18 15:48:30 2022 -0400 drm/amd/display: add virtual_setup_stream_attribute decl to header Smatch reports this issue virtual_link_hwss.c:32:6: warning: symbol 'virtual_setup_stream_attribute' was not declared. Should it be static? virtual_setup_stream_attribute is only used in virtual_link_hwss.c, but the other functions in the file are declared in the header file and used elsewhere. For consistency, add the virtual_setup_stream_attribute decl to virtual_link_hwss.h. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit f3fa2becf2fc25b6ac7cf8d8b1a2e4a86b3b72bd Author: Keita Suzuki Date: Tue Apr 19 10:37:19 2022 +0000 drm/amd/pm: fix double free in si_parse_power_table() In function si_parse_power_table(), array adev->pm.dpm.ps and its member is allocated. If the allocation of each member fails, the array itself is freed and returned with an error code. However, the array is later freed again in si_dpm_fini() function which is called when the function returns an error. This leads to potential double free of the array adev->pm.dpm.ps, as well as leak of its array members, since the members are not freed in the allocation function and the array is not nulled when freed. In addition adev->pm.dpm.num_ps, which keeps track of the allocated array member, is not updated until the member allocation is successfully finished, this could also lead to either use after free, or uninitialized variable access in si_dpm_fini(). Fix this by postponing the free of the array until si_dpm_fini() and increment adev->pm.dpm.num_ps everytime the array member is allocated. Signed-off-by: Keita Suzuki Signed-off-by: Alex Deucher commit a26b9e0b9b153ace311245c8357715cb7ff0b727 Author: Tales Lelo da Aparecida Date: Fri Apr 15 15:20:14 2022 -0300 drm/amd/display: make hubp1_wait_pipe_read_start() static It's a local function, let's make it static. AGD: remove prototype in dcn10_hubp.h Signed-off-by: Tales Lelo da Aparecida Signed-off-by: Alex Deucher commit f24044bd9b16a059e5773170fbfa1badc536d657 Author: Darren Powell Date: Tue Apr 5 22:17:08 2022 -0400 amdgpu/pm: Clarify documentation of error handling in send_smc_mesg Clarify the smu_cmn_send_smc_msg_with_param documentation to mention two cases exist where messages are silently dropped with no error returned. These cases occur in unusual situations where either: 1. the message type is not allowed to a virtual GPU, or 2. a PCI recovery is underway and the HW is not yet in sync with the SW For more details see commit 4ea5081c82c4 ("drm/amd/powerplay: enable SMC message filter") commit bf36b52e781d ("drm/amdgpu: Avoid accessing HW when suspending SW state") (v2) Reworked with suggestions from Luben & Paul (v3) Updated wording as per Luben's feedback Corrected error stating all messages denied on virtual GPU (each GPU has mask of which messages are allowed) Signed-off-by: Darren Powell Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit eea5c7b3390c6e006ba4cbd906447dd8cea8cfbf Author: Huang Rui Date: Thu Apr 14 21:04:59 2022 +0800 drm/amdgpu/pm: fix the null pointer while the smu is disabled It needs to check if the pp_funcs is initialized while release the context, otherwise it will trigger null pointer panic while the software smu is not enabled. [ 1109.404555] BUG: kernel NULL pointer dereference, address: 0000000000000078 [ 1109.404609] #PF: supervisor read access in kernel mode [ 1109.404638] #PF: error_code(0x0000) - not-present page [ 1109.404657] PGD 0 P4D 0 [ 1109.404672] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 1109.404701] CPU: 7 PID: 9150 Comm: amdgpu_test Tainted: G OEL 5.16.0-custom #1 [ 1109.404732] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 1109.404765] RIP: 0010:amdgpu_dpm_force_performance_level+0x1d/0x170 [amdgpu] [ 1109.405109] Code: 5d c3 44 8b a3 f0 80 00 00 eb e5 66 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 83 ec 08 4c 8b b7 f0 7d 00 00 <49> 83 7e 78 00 0f 84 f2 00 00 00 80 bf 87 80 00 00 00 48 89 fb 0f [ 1109.405176] RSP: 0018:ffffaf3083ad7c20 EFLAGS: 00010282 [ 1109.405203] RAX: 0000000000000000 RBX: ffff9796b1c14600 RCX: 0000000002862007 [ 1109.405229] RDX: ffff97968591c8c0 RSI: 0000000000000001 RDI: ffff9796a3700000 [ 1109.405260] RBP: ffffaf3083ad7c50 R08: ffffffff9897de00 R09: ffff979688d9db60 [ 1109.405286] R10: 0000000000000000 R11: ffff979688d9db90 R12: 0000000000000001 [ 1109.405316] R13: ffff9796a3700000 R14: 0000000000000000 R15: ffff9796a3708fc0 [ 1109.405345] FS: 00007ff055cff180(0000) GS:ffff9796bfdc0000(0000) knlGS:0000000000000000 [ 1109.405378] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1109.405400] CR2: 0000000000000078 CR3: 000000000a394000 CR4: 00000000000506e0 [ 1109.405434] Call Trace: [ 1109.405445] [ 1109.405456] ? delete_object_full+0x1d/0x20 [ 1109.405480] amdgpu_ctx_set_stable_pstate+0x7c/0xa0 [amdgpu] [ 1109.405698] amdgpu_ctx_fini.part.0+0xcb/0x100 [amdgpu] [ 1109.405911] amdgpu_ctx_do_release+0x71/0x80 [amdgpu] [ 1109.406121] amdgpu_ctx_ioctl+0x52d/0x550 [amdgpu] [ 1109.406327] ? _raw_spin_unlock+0x1a/0x30 [ 1109.406354] ? drm_gem_handle_delete+0x81/0xb0 [drm] [ 1109.406400] ? amdgpu_ctx_get_entity+0x2c0/0x2c0 [amdgpu] [ 1109.406609] drm_ioctl_kernel+0xb6/0x140 [drm] Signed-off-by: Huang Rui Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher commit 36bf93216ecbe399c40c5e0486f0f0e3a4afa69e Author: Lang Yu Date: Fri Apr 15 15:35:44 2022 +0800 drm/amdkfd: only allow heavy-weight TLB flush on some ASICs for SVM too The idea is from commit a50fe7078035 ("drm/amdkfd: Only apply heavy-weight TLB flush on Aldebaran") and commit f61c40c0757a ("drm/amdkfd: enable heavy-weight TLB flush on Arcturus"). At the moment, heavy-weight TLB could cause problems on ASICs except Aldebaran and Arcturus. A simple hipMallocManaged/hipFree program could trigger this issue. [ 97.787657] amdgpu 0000:01:00.0: amdgpu: wait for kiq fence error: 0. [ 106.868758] amdgpu: qcm fence wait loop timeout expired [ 106.868966] amdgpu: The cp might be in an unrecoverable state due to an unsuccessful queues preemption [ 106.869203] amdgpu: Failed to evict process queues [ 106.869261] amdgpu: Failed to quiesce KFD Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit d953239726e971ecaee45d86b4bcd605be839b2a Author: Vinod Koul Date: Thu Apr 14 15:46:30 2022 +0530 arm64: dts: qcom: sm8450-qrd: Enable spi and i2c nodes Enable the i2c5, spi4, spi18 and spi19 nodes which were tested on qrd board along with related qup nodes and gpi_dma0 Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-8-vkoul@kernel.org commit 67ebdc6dd1e2049fd9620f0572bc81a809afbe24 Author: Vinod Koul Date: Thu Apr 14 15:46:29 2022 +0530 arm64: dts: qcom: sm8450: Fix missing iommus for qup1 qupv3_id_1 was missing iommus property which cause any dma transaction to fail and board crash. So add the missing iommus. Fixes: 5188049c9b36 ("arm64: dts: qcom: Add base SM8450 DTSI") Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-7-vkoul@kernel.org commit ba640cd31342b45dcf2f95f6ca7dcbc46629919f Author: Vinod Koul Date: Thu Apr 14 15:46:28 2022 +0530 arm64: dts: qcom: sm8450: Add qup nodes for qup2 qup2 has 7 SEs, so add the SEs (i2c and spi) along with pinconf for these SEs Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-6-vkoul@kernel.org commit 1a380216fd6fcf7135b2b413bb9431fc98e2fa23 Author: Vinod Koul Date: Thu Apr 14 15:46:27 2022 +0530 arm64: dts: qcom: sm8450: Add qup nodes for qup1 qup1 has 7 SEs, I2C13 and I2C14 were already added so added the remaining SEs (i2c and spi) along with pinconf for these SEs Also add interconnect properties for I2C13 and I2C14 Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-5-vkoul@kernel.org commit a84e88e9a00334f1468a9f69a77091dbe80b7a3b Author: Vinod Koul Date: Thu Apr 14 15:46:26 2022 +0530 arm64: dts: qcom: sm8450: Add qup nodes for qup0 qup0 has 7 SEs, with SE7 as uart and already added, so add the remaining 6 SEs (i2c and spi) along with pinconf for these SEs Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-4-vkoul@kernel.org commit 488922c1a372579bf2caf40933e7459e3c86276f Author: Vinod Koul Date: Thu Apr 14 15:46:25 2022 +0530 arm64: dts: qcom: sm8450: Fix missing iommus for qup qupv3_id_0 was missing iommus property which cause any dma transaction to fail and board crash. So add the missing iommus. While at it also add interconnect nodes for qup Fixes: 5188049c9b36 ("arm64: dts: qcom: Add base SM8450 DTSI") Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-3-vkoul@kernel.org commit b9c8433083097327cad19fbf633fb0735a008315 Author: Vinod Koul Date: Thu Apr 14 15:46:24 2022 +0530 arm64: dts: qcom: sm8450: Add gpi_dma nodes GPI DMA can be used for DMA operations for QUP devices, so add the three gpi_dma insances found in this SoC Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220414101630.1189052-2-vkoul@kernel.org commit 459ccca5f7ddffa0398b615162f55607dc443d08 Author: Lang Yu Date: Thu Apr 14 15:16:25 2022 +0800 drm/amdkfd: move kfd_flush_tlb_after_unmap into kfd_priv.h To make kfd_flush_tlb_after_unmap visible in kfd_svm.c, move it into kfd_priv.h. And change it to an inline function. Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 83b8347a858d06f7d070663cc3898215d3d299a0 Author: Bjorn Andersson Date: Tue Apr 12 14:51:37 2022 -0700 arm64: dts: qcom: sm8350-hdk: Enable &gpi_dma1 Some versions of the firmware for the SM8350 Hardware Development Kit (HDK) has FIFO mode disabled for i2c13 and must thus use GPI DMA. Enable &gpi_dma1 to allow this. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220412215137.2385831-3-bjorn.andersson@linaro.org commit ddc97e7d1765cb2bf6089e211dae8e0b63cb3892 Author: Bjorn Andersson Date: Tue Apr 12 14:51:36 2022 -0700 arm64: dts: qcom: sm8350: Add GENI I2C/SPI DMA channels The GENI I2C and SPI controllers may use the GPI DMA engine, define the rx and tx channels for these controllers to enable this. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220412215137.2385831-2-bjorn.andersson@linaro.org commit bc08fbf49bc87e7613717e41674303905a9934fc Author: Bjorn Andersson Date: Tue Apr 12 14:51:35 2022 -0700 arm64: dts: qcom: sm8350: Define GPI DMA engines The Qualcomm SM8350 has three GPI DMA engines, add definitions for these. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220412215137.2385831-1-bjorn.andersson@linaro.org commit 97276cbfb4fbe33c3ab8b5f5277a73c0b5f3732b Author: Sandeep Maheswaram Date: Tue Apr 12 00:46:54 2022 +0530 arm64: dts: qcom: sc7280: Add wakeup-source property for USB node Adding wakeup-source property for USB controller in SC7280. This property is added to inform that the USB controller is wake up capable and to conditionally power down the phy during system suspend. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649704614-31518-7-git-send-email-quic_c_sanm@quicinc.com commit 2a80a66f68e37ce19dee7fdb3d3e946859712b53 Author: Krzysztof Kozlowski Date: Sat Apr 2 21:28:59 2022 +0200 arm64: dts: qcom: msm8996: override nodes by label Using node paths to extend or override a device tree node is error prone. If there was a typo error, a new node will be created instead of extending the existing node. This will lead to run-time errors that could be hard to detect. A mistyped label on the other hand, will cause a dtc compile error (during build time). This also reduces the indentation making the code easier to read. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220402192859.154977-2-krzysztof.kozlowski@linaro.org commit c46e3c4bdfaca1595b898bb58b112fd683fe0c11 Author: Krzysztof Kozlowski Date: Sat Apr 2 21:28:58 2022 +0200 arm64: dts: qcom: msm8994: override nodes by label Using node paths to extend or override a device tree node is error prone. If there was a typo error, a new node will be created instead of extending the existing node. This will lead to run-time errors that could be hard to detect. A mistyped label on the other hand, will cause a dtc compile error (during build time). This also reduces the indentation making the code easier to read. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220402192859.154977-1-krzysztof.kozlowski@linaro.org commit 89561886191c0dcb6ce1491f14552eac16e14a80 Author: Joel Selvaraj Date: Fri Apr 1 05:48:10 2022 +0530 arm64: dts: qcom: sdm845-xiaomi-beryllium: enable qcom wled backlight and link to panel Xiaomi Poco F1 uses the QCOM WLED driver for backlight control. Enable and link it to the panel to use it. Signed-off-by: Joel Selvaraj Reviewed-by: Marijn Suijten Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/BY5PR02MB70092607CD7CDD8CF8BCD464D9E09@BY5PR02MB7009.namprd02.prod.outlook.com commit 3213b3741a147db59ed6f1ebc5f569854725b91f Author: Joel Selvaraj Date: Wed Mar 30 12:15:05 2022 +0530 arm64: dts: qcom: sdm845-xiaomi-beryllium: enable second wifi channel Like the c630, the Poco F1 is also capable of using both antenna channels for 2.4 and 5ghz wifi, however unlike the c630 only the first channel is used for bluetooth. Similar to Oneplus 6. Signed-off-by: Joel Selvaraj Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/BY5PR02MB7009E2566F9000F338432761D91F9@BY5PR02MB7009.namprd02.prod.outlook.com commit 1f1c494082a1f10d03ce4ee1485ee96d212e22ff Author: Joel Selvaraj Date: Wed Mar 30 12:15:04 2022 +0530 arm64: dts: qcom: sdm845-xiaomi-beryllium: fix typo in panel's vddio-supply property vddio is misspelled with a "0" instead of "o". Fix it. Signed-off-by: Joel Selvaraj Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/BY5PR02MB7009901651E6A8D5ACB0425ED91F9@BY5PR02MB7009.namprd02.prod.outlook.com commit 84b6c2420415767079baa24ffd70d048cd35bdd8 Author: Joel Selvaraj Date: Wed Mar 30 12:15:03 2022 +0530 arm64: dts: qcom: sdm845-xiaomi-beryllium: enable qcom ipa driver Enable Qualcomm IP Accelerator (IPA) driver for mobile data functionality which works by using ModemManager. Signed-off-by: Joel Selvaraj Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/BY5PR02MB7009405D7C06C0B480974063D91F9@BY5PR02MB7009.namprd02.prod.outlook.com commit efbd3599154cb3d947564a9dce419a6754d233ef Author: Joel Selvaraj Date: Wed Mar 30 12:15:02 2022 +0530 arm64: dts: qcom: sdm845-xiaomi-beryllium: change firmware path and use mbn format The "qcom/sdm845/" path conflicts with db845c's firmware that are present in the linux-firmware package. Xiaomi uses their own signed firmware for Poco F1 and can't use the db845c's firmware. So let's use "qcom/sdm845/beryllium/" to distinguish Poco F1's firmware files. For easier handling and packaging, the mdt+bXX files are squashed using Bjorn Andersson's pil-squasher tool from this link: https://github.com/andersson/pil-squasher Signed-off-by: Joel Selvaraj Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/BY5PR02MB700966DEE6F6044EBEB5B892D91F9@BY5PR02MB7009.namprd02.prod.outlook.com commit fc0e7dd6d2e2c9f8b2c6497a190ee29d8f3aef3a Author: Krzysztof Kozlowski Date: Mon Apr 11 10:59:34 2022 +0200 arm64: dts: qcom: do not use underscore in BCM node name Align BCM voter node with DT schema by using hyphen instead of underscore. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411085935.130072-3-krzysztof.kozlowski@linaro.org commit 97c246c825f73a018169834e56ffa9a89dea37a9 Author: Krzysztof Kozlowski Date: Mon Apr 11 10:59:33 2022 +0200 ARM: dts: qcom: sdx55: remove wrong unit address from RPMH RSC clocks The clock controller of RPMH RSC does not have 'reg' property, so should not have unit address. Fixes: bae2f5979c6e ("ARM: dts: qcom: Add SDX65 platform and MTP board support") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411085935.130072-2-krzysztof.kozlowski@linaro.org commit 568cd3243331b6bf0702665f7bd90baa93e2b3ac Author: Krzysztof Kozlowski Date: Mon Apr 11 10:59:32 2022 +0200 ARM: dts: qcom: sdx55: do not use underscore in BCM node name Align BCM voter node with DT schema by using hyphen instead of underscore. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411085935.130072-1-krzysztof.kozlowski@linaro.org commit 44df171a10f8969d1456e0a5af7fbac142d7fa18 Author: Yonghong Song Date: Mon Apr 18 22:09:00 2022 -0700 selftests/bpf: Workaround a verifier issue for test exhandler The llvm patch [1] enabled opaque pointer which caused selftest 'exhandler' failure. ... ; work = task->task_works; 7: (79) r1 = *(u64 *)(r6 +2120) ; R1_w=ptr_callback_head(off=0,imm=0) R6_w=ptr_task_struct(off=0,imm=0) ; func = work->func; 8: (79) r2 = *(u64 *)(r1 +8) ; R1_w=ptr_callback_head(off=0,imm=0) R2_w=scalar() ; if (!work && !func) 9: (4f) r1 |= r2 math between ptr_ pointer and register with unbounded min value is not allowed below is insn 10 and 11 10: (55) if r1 != 0 goto +5 11: (18) r1 = 0 ll ... In llvm, the code generation of 'r1 |= r2' happened in codegen selectiondag phase due to difference of opaque pointer vs. non-opaque pointer. Without [1], the related code looks like: r2 = *(u64 *)(r6 + 2120) r1 = *(u64 *)(r2 + 8) if r2 != 0 goto +6 if r1 != 0 goto +5 r1 = 0 ll ... I haven't found a good way in llvm to fix this issue. So let us workaround the problem first so bpf CI won't be blocked. [1] https://reviews.llvm.org/D123300 Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220419050900.3136024-1-yhs@fb.com commit 8c89b5db7a2894e33417dd69680729e8f65f5709 Author: Yonghong Song Date: Mon Apr 18 21:32:30 2022 -0700 selftests/bpf: Limit unroll_count for pyperf600 test LLVM commit [1] changed loop pragma behavior such that full loop unroll is always honored with user pragma. Previously, unroll count also depends on the unrolled code size. For pyperf600, without [1], the loop unroll count is 150. With [1], the loop unroll count is 600. The unroll count of 600 caused the program size close to 298k and this caused the following code is generated: 0: 7b 1a 00 ff 00 00 00 00 *(u64 *)(r10 - 256) = r1 ; uint64_t pid_tgid = bpf_get_current_pid_tgid(); 1: 85 00 00 00 0e 00 00 00 call 14 2: bf 06 00 00 00 00 00 00 r6 = r0 ; pid_t pid = (pid_t)(pid_tgid >> 32); 3: bf 61 00 00 00 00 00 00 r1 = r6 4: 77 01 00 00 20 00 00 00 r1 >>= 32 5: 63 1a fc ff 00 00 00 00 *(u32 *)(r10 - 4) = r1 6: bf a2 00 00 00 00 00 00 r2 = r10 7: 07 02 00 00 fc ff ff ff r2 += -4 ; PidData* pidData = bpf_map_lookup_elem(&pidmap, &pid); 8: 18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll 10: 85 00 00 00 01 00 00 00 call 1 11: bf 08 00 00 00 00 00 00 r8 = r0 ; if (!pidData) 12: 15 08 15 e8 00 00 00 00 if r8 == 0 goto -6123 Note that insn 12 has a branch offset -6123 which is clearly illegal and will be rejected by the verifier. The negative offset is due to the branch range is greater than INT16_MAX. This patch changed the unroll count to be 150 to avoid above branch target insn out-of-range issue. Also the llvm is enhanced ([2]) to assert if the branch target insn is out of INT16 range. [1] https://reviews.llvm.org/D119148 [2] https://reviews.llvm.org/D123877 Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220419043230.2928530-1-yhs@fb.com commit 4ab85930b7183eaabdaffbcecd89c12e2aca071a Author: Marek Vasut Date: Thu Apr 7 20:56:17 2022 +0200 drm: bridge: icn6211: Add DSI lane count DT property parsing The driver currently hard-codes DSI lane count to two, however the chip is capable of operating in 1..4 DSI lanes mode. Parse 'data-lanes' DT property and program the result into DSI_CTRL register. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220407185617.179573-2-marex@denx.de commit fccf8e31ac3d7c3f874ae5d78de495edaf1ead58 Author: Vladimir Zapolskiy Date: Mon Apr 11 02:44:57 2022 +0300 arm64: dts: qcom: sm8450: Add thermal zones Add thermal zones handled by tsens sensors. The definitions and the trip points were taken from the downstream dts. For the CPU core thermal sensors, the trip points were changed to follow the example of other Qualcomm platforms. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410234458.1739279-3-dmitry.baryshkov@linaro.org commit 48995e863307bf08a51362a0aafb10e70bdafb4e Author: Vladimir Zapolskiy Date: Mon Apr 11 02:44:56 2022 +0300 arm64: dts: qcom: sm8450: Add thermal sensor controllers The change adds description of two thermal sensor controllers found on SM8450. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410234458.1739279-2-dmitry.baryshkov@linaro.org commit 29d699a4c006940cf06f647ed02cc083234e8e33 Author: Marek Vasut Date: Thu Apr 7 20:56:16 2022 +0200 dt-bindings: display: bridge: icn6211: Document DSI data-lanes property It is necessary to specify the number of connected/used DSI data lanes when using the DSI input port of this bridge. Document the 'data-lanes' property of the DSI input port. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220407185617.179573-1-marex@denx.de commit 1ed29355df221407370933522a94dc8a0f47eb35 Author: Michael Srba Date: Mon Apr 11 09:21:56 2022 +0200 arm64: dts: qcom: msm8998: reserve potentially inaccessible clocks With the gcc driver now being more complete and describing clocks which might not always be write-accessible to the OS, conservatively specify all such clocks as protected in the SoC dts. The board dts - or even user-supplied dts - can override this property to reflect the actual configuration. Signed-off-by: Michael Srba Reviewed-by: Jeffrey Hugo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411072156.24451-6-michael.srba@seznam.cz commit 5ef1e4abc75af79166cca006f187b8d59599ef4b Author: Michael Srba Date: Mon Apr 11 09:21:53 2022 +0200 clk: qcom: gcc-msm8998: add SSC-related clocks Add four clocks which need to be manipulated in order to initialize the AHB bus which exposes the SCC block in the global address space. If a device is known to be configured such that writing to these registers from Linux is not permitted, the 'protected-clocks' device tree property must be used to denote that fact. Signed-off-by: Michael Srba Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411072156.24451-3-michael.srba@seznam.cz commit 0fb9ddbc6311202a9b904f5f2c0c7961f9a98d98 Merge: 812b0b61ee6a2 368cfcbaa3bf7 Author: Bjorn Andersson Date: Tue Apr 19 12:05:00 2022 -0500 Merge branch '20220411072156.24451-2-michael.srba@seznam.cz' into arm64-for-5.19 commit ec5a164e0840f693802ef06fbcee40cdf9fd7189 Merge: e5baef55f891b 368cfcbaa3bf7 Author: Bjorn Andersson Date: Tue Apr 19 12:04:50 2022 -0500 Merge branch '20220411072156.24451-2-michael.srba@seznam.cz' into clk-for-5.19 commit 368cfcbaa3bf7a8c482f596a131dea4befeba10a Author: Michael Srba Date: Mon Apr 11 09:21:52 2022 +0200 dt-bindings: clock: gcc-msm8998: Add definitions of SSC-related clocks Add definitions of four clocks which need to be manipulated in order to initialize the AHB bus which exposes the SCC block in the global address space. Signed-off-by: Michael Srba Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411072156.24451-2-michael.srba@seznam.cz commit 0b9fe9b7792f31674fbc8eb165c3b22a32d0a434 Author: Michael Srba Date: Mon Apr 11 09:21:54 2022 +0200 dt-bindings: bus: add device tree bindings for qcom,ssc-block-bus Adds bindings for the AHB bus which exposes the SSC block in the global address space. This bus (and the SSC block itself) is present on certain qcom SoCs. In typical configuration, this bus (as some of the clocks and registers that we need to manipulate) is not accessible to the OS, and the resources on this bus are indirectly accessed by communicating with a hexagon CPU core residing in the SSC block. In this configuration, the hypervisor is the one performing the bus initialization for the purposes of bringing the haxagon CPU core out of reset. However, it is possible to change the configuration, in which case this binding serves to allow the OS to initialize the bus. Signed-off-by: Michael Srba Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411072156.24451-4-michael.srba@seznam.cz commit fb8da7f3111ab500606960bef1bb32450c664750 Author: Nícolas F. R. A. Prado Date: Thu Apr 7 21:30:34 2022 -0400 drm/bridge: anx7625: Use uint8 for lane-swing arrays As defined in the anx7625 dt-binding, the analogix,lane0-swing and analogix,lane1-swing properties are uint8 arrays. Yet, the driver was reading the array as if it were of uint32 and masking to 8-bit before writing to the registers. This means that a devicetree written in accordance to the dt-binding would have its values incorrectly parsed. Fix the issue by reading the array as uint8 and storing them as uint8 internally, so that we can also drop the masking when writing the registers. Fixes: fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220408013034.673418-1-nfraprado@collabora.com commit 055eb95533273bc334794dbc598400d10800528f Author: Stanislav Fomichev Date: Thu Apr 14 09:12:33 2022 -0700 bpf: Move rcu lock management out of BPF_PROG_RUN routines Commit 7d08c2c91171 ("bpf: Refactor BPF_PROG_RUN_ARRAY family of macros into functions") switched a bunch of BPF_PROG_RUN macros to inline routines. This changed the semantic a bit. Due to arguments expansion of macros, it used to be: rcu_read_lock(); array = rcu_dereference(cgrp->bpf.effective[atype]); ... Now, with with inline routines, we have: array_rcu = rcu_dereference(cgrp->bpf.effective[atype]); /* array_rcu can be kfree'd here */ rcu_read_lock(); array = rcu_dereference(array_rcu); I'm assuming in practice rcu subsystem isn't fast enough to trigger this but let's use rcu API properly. Also, rename to lower caps to not confuse with macros. Additionally, drop and expand BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY. See [1] for more context. [1] https://lore.kernel.org/bpf/CAKH8qBs60fOinFdxiiQikK_q0EcVxGvNTQoWvHLEUGbgcj1UYg@mail.gmail.com/T/#u v2 - keep rcu locks inside by passing cgroup_bpf Fixes: 7d08c2c91171 ("bpf: Refactor BPF_PROG_RUN_ARRAY family of macros into functions") Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220414161233.170780-1-sdf@google.com commit e930244918092d44b60a7b538cf60d737010ceef Author: Bryan O'Donoghue Date: Tue Apr 19 00:18:57 2022 +0100 dt-bindings: soc: qcom: smd-rpm: Fix missing MSM8936 compatible Add compatible msm8936. msm8936 covers both msm8936 and msm8939. The relevant driver already has the compat string but, we haven't documented it. Fixes: d6e52482f5ab ("drivers: soc: Add MSM8936 SMD RPM compatible") Signed-off-by: Bryan O'Donoghue Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220418231857.3061053-1-bryan.odonoghue@linaro.org commit d970ce303ff80ae57bbd3e784f2772dbf3056e0c Author: Sandor Yu Date: Fri Apr 15 10:42:50 2022 +0800 drm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver General Parallel Audio (GPA) interface is one of the supported audio interface for synopsys HDMI module, which has verified for i.MX8MPlus platform. This is initial version for GPA. Signed-off-by: Shengjiu Wang Signed-off-by: Sandor Yu Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/f21ba3e8c4d9d028ac74c6f3c588ddbffe739399.1649989179.git.Sandor.yu@nxp.com commit b5a93e79df64c32814f0edefdb920b540cbc986a Author: Leon Romanovsky Date: Wed Apr 13 12:33:39 2022 +0300 RDMA/mlx5: Fix flow steering egress flow The commit mentioned in Fixes line removed the function that was called to check validity of esp_aes_gcm attribute. Sadly, that is_valid_esp_aes_gcm() returned success even for specs without esp_aes_gcm at all. So the right fix will be to remove whole if () and such fix the following error observed in smatch too. drivers/infiniband/hw/mlx5/fs.c:1126 _create_flow_rule() warn: duplicate check 'is_egress' (previous on line 1098) Fixes: de8bdb476908 ("RDMA/mlx5: Drop crypto flow steering API") Link: https://lore.kernel.org/r/11b31c1f85bc8c8add385529aa3f307c3b383a11.1649842371.git.leonro@nvidia.com Reported-by: Dan Carpenter Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8fb241e2d265de7c1711635f3f2048f33e02b57d Author: Sandor Yu Date: Fri Apr 15 10:42:49 2022 +0800 drm: bridge: dw_hdmi: add reset function for PHY GEN1 PHY reset register(MC_PHYRSTZ) active high reset control for PHY GEN2, and active low reset control for PHY GEN1. Rename function dw_hdmi_phy_reset to dw_hdmi_phy_gen2_reset. Add dw_hdmi_phy_gen1_reset function for PHY GEN1. Signed-off-by: Sandor Yu Reviewed-by: Neil Armstrong Acked-by: Jernej Skrabec Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/e0b3be2d63fe3e95246fb8b8b0dcd57415b29e04.1649989179.git.Sandor.yu@nxp.com commit a90b8fc9ca2d5cae915a0a185785325095245ec3 Author: Sandor Yu Date: Fri Apr 15 10:42:48 2022 +0800 drm: bridge: dw_hdmi: Enable GCP only for Deep Color HDMI1.4b specification section 6.5.3: Source shall only send GCPs with non-zero CD to sinks that indicate support for Deep Color. DW HDMI GCP default enabled, but only transmit CD and do not handle AVMUTE, PP norDefault_Phase (yet). Disable Auto GCP when 24-bit color for sinks that not support Deep Color. Signed-off-by: Sandor Yu Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/78fa41e4fb3d3d53354034bc221fcf870dbac617.1649989179.git.Sandor.yu@nxp.com commit 8c1bfd0ccf904d80d2874062ef3fecdfddb2a48b Author: Sandor Yu Date: Fri Apr 15 10:42:47 2022 +0800 drm: bridge: dw_hdmi: default enable workaround to clear the overflow i.MX8MPlus (v2.13a) has verified need the workaround to clear the overflow with one iteration. Only i.MX6Q(v1.30a) need the workaround with 4 iterations, the others versions later than v1.3a have been identified as needing the workaround with a single iteration. Default enable the workaround with one iteration for all versions later than v1.30a. Signed-off-by: Sandor Yu Acked-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/561951005a85574dcdd108e5d6a3a87df930ea3d.1649989179.git.Sandor.yu@nxp.com commit 34263c1b1593e44a3963dcfd6ed9af70c3002686 Author: Marek Szyprowski Date: Tue Apr 19 11:14:22 2022 +0200 drm: bridge: panel: Register connector if DRM device is already registered If panel_bridge_attach() happens after DRM device registration, the created connector will not be registered by the DRM core anymore. Fix this by registering it explicitly in such case. This fixes the following issue observed on Samsung Exynos4210-based Trats board with a DSI panel (the panel driver is registered after the Exynos DRM component device is bound): $ ./modetest -c -Mexynos could not get connector 56: No such file or directory Segmentation fault While touching this, move the connector reset() call also under the DRM device registered check, because otherwise it is not really needed. Fixes: 934aef885f9d ("drm: bridge: panel: Reset the connector state pointer") Signed-off-by: Marek Szyprowski Reviewed-by: Jagan Teki Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220419091422.4255-1-m.szyprowski@samsung.com commit 04b19d32213654e54ec819b6ac033360f1551902 Author: Biju Das Date: Tue Apr 19 15:24:53 2022 +0100 drm: bridge: adv7511: Enable DRM_BRIDGE_OP_HPD based on HPD interrupt Connector detection using poll method won't work in case of bridge attached to the encoder with the flag DRM_BRIDGE_ATTACH_NO_CONNECTOR, as the code defaults to HPD. Enable DRM_BRIDGE_OP_HPD based on HPD interrupt availability, so that it will fall back to polling, if HPD is not available. Signed-off-by: Biju Das Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220419142453.48839-1-biju.das.jz@bp.renesas.com commit 9765fa25662ae4d3e461a2f8a6b5c1a1dc8b7421 Merge: b2d229d4ddb17 58990892ca29c Author: Rafael J. Wysocki Date: Tue Apr 19 17:43:25 2022 +0200 Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull turbostat changes for 5.19 from Len Brown: "Chen Yu (1): tools/power turbostat: Support thermal throttle count print Dan Merillat (1): tools/power turbostat: fix dump for AMD cpus Len Brown (5): tools/power turbostat: tweak --show and --hide capability tools/power turbostat: fix ICX DRAM power numbers tools/power turbostat: be more useful as non-root tools/power turbostat: No build warnings with -Wextra tools/power turbostat: version 2022.04.16 Sumeet Pawnikar (2): tools/power turbostat: Add Power Limit4 support tools/power turbostat: print power values upto three decimal Zephaniah E. Loss-Cutler-Hull (2): tools/power turbostat: Allow -e for all names. tools/power turbostat: Allow printing header every N iterations" * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: tools/power turbostat: version 2022.04.16 tools/power turbostat: No build warnings with -Wextra tools/power turbostat: be more useful as non-root tools/power turbostat: fix ICX DRAM power numbers tools/power turbostat: Support thermal throttle count print tools/power turbostat: Allow printing header every N iterations tools/power turbostat: Allow -e for all names. tools/power turbostat: print power values upto three decimal tools/power turbostat: Add Power Limit4 support tools/power turbostat: fix dump for AMD cpus tools/power turbostat: tweak --show and --hide capability commit 374b50e234a3e2f92bb881a814218f9740e85dcc Author: Pierre-Louis Bossart Date: Wed Apr 6 14:00:56 2022 -0500 ASoC: soc-pcm: improve BE transition for TRIGGER_START When the BE was in PAUSED state, the correct trigger is PAUSE_RELEASE. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220406190056.233481-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9995c1d096c8ab1b5f1edc4141257719f6a53524 Author: Pierre-Louis Bossart Date: Wed Apr 6 14:00:55 2022 -0500 ASoC: soc-pcm: improve BE transition for PAUSE_RELEASE Commit 3aa1e96a2b95 ("ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE") did not modify the existing logic and kept the same logic for the following transition play FE1 -> BE state is START pause FE1 -> BE state is PAUSED play FE2 -> BE state is START stop FE2 -> BE state is STOP <<< !! release FE1 -> BE state is START stop FE1 -> BE state is STOP At the time it was identified by reviewers that a better solution might consist in play FE1 -> BE state is START pause FE1 -> BE state is PAUSED play FE2 -> BE state is START stop FE2 -> BE state is PAUSE <<< !! release FE1 -> BE state is START stop FE1 -> BE state is STOP This patch suggest a transition to PAUSE when all the 'active' streams are paused. This would allow for a more consistent resource management for platforms where PAUSE and STOP are handled differently. To track the special case of an FE going from PAUSE_PUSH to STOP, we add a state variable for each FE context. This 'fe_pause' boolean is set on PAUSE_PUSH and cleared on either PAUSE_RELEASE and STOP triggers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220406190056.233481-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8e8a9e364a3b3053f689a649df1107e61b9e3bed Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:28 2022 +0200 spi: mt65xx: Fix definitions indentation Some definitions at the beginning of this file were wrongly indented: fix the indentation for all of these and, while at it, also move the MTK_SPI_IDLE and MTK_SPI_PAUSED down, as to implicitly group the hardware related definitions to the software (driver) related ones. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-9-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 3c5cd2e23fe4c840b437496e131e1f74afaebbbd Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:27 2022 +0200 spi: mt65xx: Add kerneldoc for driver structures One of the two structures was already partially documented, but not in kerneldoc format: enhance readability by adding the missing documentation bits and use kerneldoc. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-8-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 20cdbb80095711decef6401f839aca8476be1910 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:26 2022 +0200 spi: mt65xx: Simplify probe function with dev_err_probe() Switch to dev_err_probe() to remove all dev_err() -> return repeated patterns, simplifying and shortening the probe function. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-7-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 5088b3136439896c2858173402f32dada4db69f6 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:25 2022 +0200 spi: mt65xx: Move pm_runtime_enable() call to remove all gotos The last goto in the probe function can be removed by calling pm_runtime_enable() right before devm_spi_register_master(), as only some init checks were being performed after enabling pm. This is a cleanup and brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-6-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 5dee8bb8d14dc7536cec58cc1d94148dce89dfc5 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:24 2022 +0200 spi: mt65xx: Move clock parent setting to remove clock disable gotos Reparenting sel_clk to parent_clk can be done before enabling any of spi_clk and spi_hclk. Move the call to clk_set_parent() for sel_clk earlier, and call disable_unprepare() upon spi_clk prepare_enable() failure to remove all clock disablement related gotos. This commit is in preparation of a later cleanup. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-5-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 6b4440584b92851af44b235ad825c8554dd143c0 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:23 2022 +0200 spi: mt65xx: Add and use pointer to struct device in mtk_spi_probe() In preparation for switching to dev_err_probe() in this function, add a pointer to struct device and replace all occurrences of '&pdev->dev' to using this 'dev' pointer. This is done for one-line fitting of the dev_err_probe() calls. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-4-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 7f7cdef7288a7da117a54249b680b04f503f8a67 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:22 2022 +0200 spi: mt65xx: Switch to device_get_match_data() Instead of performing yet another match check in the probe function, simply switch to device_get_match_data(). This is a cleanup and brings no functional change. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit ace145802350e0f8eec4a40522a1b1d5a4f90114 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 13:44:21 2022 +0200 spi: mt65xx: Simplify probe function with devm_spi_alloc_master Switch to the devm variant of spi_alloc_master() to save some gotos. This patch is a cleanup that brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220407114428.167091-2-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit e18610eaa66a1849aaa00ca43d605fb1a6fed800 Author: Richard Fitzgerald Date: Thu Apr 7 16:38:13 2022 +0100 ASoC: SOF: Kconfig: Make SND_SOC_SOF_HDA_PROBES tristate SND_SOC_SOF_HDA_PROBES must be tristate because the code it builds depends on code that is tristate. If SND_SOC_SOF_HDA_PROBES is bool it leads to the following build inconsistency: SND_SOC_SOF_HDA_COMMON=m which selects SND_SOC_SOF_HDA_PROBES but since this is a bool SND_SOC_SOF_HDA_PROBES=y SND_SOC_SOF_HDA_PROBES=y selects SND_SOC_SOF_DEBUG_PROBES=y so sof-client-probes.c is built into the kernel. sof-client-probes.c calls functions in sof-client.c, but SND_SOC_SOF=m sof-client.c is built into a loadable module. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220407153813.1231866-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 3271be0628917a97d8757b02b5bc40856fd03476 Author: Shengjiu Wang Date: Mon Apr 18 11:18:30 2022 +0800 ASoC: dmic: Add support for DSD data format Add DSD format support in this generic dmic driver: DSD_U8, DSD_U16_LE, DSD_U32_LE, Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1650251910-8932-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 448fb6ea127ce64efca1d91bef61e587583c2afe Author: Valentin Caron Date: Thu Apr 7 18:20:42 2022 +0200 ARM: dts: stm32: enable RTC support on stm32mp135f-dk Enables the support of RTC on stm32mp135f-dk board. Signed-off-by: Gabriel Fernandez Signed-off-by: Valentin Caron Signed-off-by: Alexandre Torgue commit cc2b6b6fa4ced56faaf5bc7ad2e26fee08bfd1f7 Author: Valentin Caron Date: Thu Apr 7 18:20:41 2022 +0200 ARM: dts: stm32: add RTC node on stm32mp131 Add RTC node with compatible, clock, and interrupt properties on stm32mp131. Add clk_rtc_k fixed clock for RTC. Signed-off-by: Gabriel Fernandez Signed-off-by: Valentin Caron Signed-off-by: Alexandre Torgue commit 171b66e2e2e9d80b93c8cff799e6175074b22297 Author: Ulf Hansson Date: Fri Apr 1 16:11:24 2022 +0200 cpuidle: PSCI: Improve support for suspend-to-RAM for PSCI OSI mode When PSCI OSI mode is supported the syscore flag is set for the CPU devices that becomes attached to their PM domains (genpds). In the suspend-to-idle case, we call dev_pm_genpd_suspend|resume() to allow genpd to properly manage the power-off/on operations (pick an idlestate and manage the on/off notifications). For suspend-to-ram, dev_pm_genpd_suspend|resume() is currently not being called, which causes a problem that the genpd on/off notifiers do not get sent as expected. This prevents the platform-specific operations from being executed, typically needed just before/after the boot CPU is being turned off/on. To deal with this problem, let's register a syscore ops for cpuidle-psci when PSCI OSI mode is being used and call dev_pm_genpd_suspend|resume() from them. In this way, genpd regains control of the PM domain topology and then sends the on/off notifications when it's appropriate. Reported-by: Maulik Shah Suggested-by: Maulik Shah Signed-off-by: Ulf Hansson Tested-by: Maulik Shah Signed-off-by: Rafael J. Wysocki commit 13966517d41efb0a549544022db7d522503bc718 Author: Ulf Hansson Date: Fri Apr 1 16:11:23 2022 +0200 PM: runtime: Allow to call __pm_runtime_set_status() from atomic context The only two users of __pm_runtime_set_status() are pm_runtime_set_active() and pm_runtime_set_suspended(). These are widely used and should be called from non-atomic context to work as expected. However, it would be convenient to allow them be called from atomic context too, as shown from a subsequent change, so let's add support for this. Signed-off-by: Ulf Hansson Tested-by: Maulik Shah Signed-off-by: Rafael J. Wysocki commit ef2d90708883f4025a801feb0ba8411a7a4387e1 Author: Marek Vasut Date: Fri Mar 25 18:58:51 2022 +0100 ARM: dts: stm32: Fix PHY post-reset delay on Avenger96 Per KSZ9031RNX PHY datasheet FIGURE 7-5: POWER-UP/POWER-DOWN/RESET TIMING Note 2: After the de-assertion of reset, wait a minimum of 100 μs before starting programming on the MIIM (MDC/MDIO) interface. Add 1ms post-reset delay to guarantee this figure. Fixes: 010ca9fe500bf ("ARM: dts: stm32: Add missing ethernet PHY reset on AV96") Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Patrice Chotard Cc: Patrick Delaunay Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Signed-off-by: Alexandre Torgue commit 0d4837fdb796f99369cf7691d33de1b856bcaf1f Author: Zixuan Fu Date: Mon Apr 11 18:45:34 2022 +0800 fs: jfs: fix possible NULL pointer dereference in dbFree() In our fault-injection testing, the variable "nblocks" in dbFree() can be zero when kmalloc_array() fails in dtSearch(). In this case, the variable "mp" in dbFree() would be NULL and then it is dereferenced in "write_metapage(mp)". The failure log is listed as follows: [ 13.824137] BUG: kernel NULL pointer dereference, address: 0000000000000020 ... [ 13.827416] RIP: 0010:dbFree+0x5f7/0x910 [jfs] [ 13.834341] Call Trace: [ 13.834540] [ 13.834713] txFreeMap+0x7b4/0xb10 [jfs] [ 13.835038] txUpdateMap+0x311/0x650 [jfs] [ 13.835375] jfs_lazycommit+0x5f2/0xc70 [jfs] [ 13.835726] ? sched_dynamic_update+0x1b0/0x1b0 [ 13.836092] kthread+0x3c2/0x4a0 [ 13.836355] ? txLockFree+0x160/0x160 [jfs] [ 13.836763] ? kthread_unuse_mm+0x160/0x160 [ 13.837106] ret_from_fork+0x1f/0x30 [ 13.837402] ... This patch adds a NULL check of "mp" before "write_metapage(mp)" is called. Reported-by: TOTE Robot Signed-off-by: Zixuan Fu Signed-off-by: Dave Kleikamp commit f688d61925f28699872307a66919bd164ba42ce0 Author: Stefano Stabellini Date: Fri Apr 15 17:30:28 2022 -0700 of: of_property_read_string return -ENODATA when !length When the length of the string is zero of_property_read_string should return -ENODATA according to the description of the function. However, of_property_read_string doesn't check prop->length. If prop->length is zero, return -ENODATA. Without this patch the following command in u-boot: fdt set /chosen/node property-name results in of_property_read_string returning -EILSEQ when attempting to read property-name. With this patch, it returns -ENODATA as expected. Signed-off-by: Stefano Stabellini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220416003028.1315268-1-sstabellini@kernel.org commit f2701e0ffd2195a2610d14d289785513100d5dfd Author: Drew Fustini Date: Thu Apr 14 12:27:23 2022 -0700 dt-bindings: wkup-m3-ipc: Add ti,set-io-isolation property Add documentation for the ti,set-io-isolation DT property on the wkup_m3_ipc node which tells the wkup_m3_ipc driver to use the wkup_m3 to enable IO Isolation during low power mode transitions on am43xx platforms. Signed-off-by: Dave Gerlach [dfustini: convert to YAML, make DTS example that passes check] Signed-off-by: Drew Fustini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220414192722.2978837-2-dfustini@baylibre.com commit cfdb2f365cb9de8f2fd1fb726d82b5bae5e042ab Author: Pavel Pisa Date: Tue Mar 22 00:32:34 2022 +0100 MAINTAINERS: Add maintainers for CTU CAN FD IP core driver This patch adds an entry for the CTU CAN FD IP to the maintainers file. Link: https://lore.kernel.org/all/2cc77e2999d9688bed155e4c7f7807e46d1bf9e3.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Signed-off-by: Marc Kleine-Budde commit c3a0addefbdec09affe7e9c597f1fceed4e7410a Author: Pavel Pisa Date: Tue Mar 22 08:21:09 2022 +0100 docs: ctucanfd: CTU CAN FD open-source IP core documentation. CTU CAN FD IP core documentation based on Martin Jeřábek's diploma theses Open-source and Open-hardware CAN FD Protocol Support https://dspace.cvut.cz/handle/10467/80366 . Link: https://lore.kernel.org/all/692b965999ff6c272239df0fe1c76b68d02b134d.1647932262.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Signed-off-by: Martin Jerabek Signed-off-by: Ondrej Ille Signed-off-by: Marc Kleine-Budde commit e8f0c23a2415fa8f95cca61e1b4a4c90c4f5a983 Author: Pavel Pisa Date: Tue Mar 22 00:32:32 2022 +0100 can: ctucanfd: CTU CAN FD open-source IP core - platform/SoC support. Platform bus adaptation for CTU CAN FD open-source IP core. The core has been tested together with OpenCores SJA1000 modified to be CAN FD frames tolerant on MicroZed Zynq based MZ_APO education kits designed by Petr Porazil from PiKRON.com company. FPGA design https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top. The kit description at the Computer Architectures course pages https://cw.fel.cvut.cz/wiki/courses/b35apo/documentation/mz_apo/start . Kit carrier board and mechanics design source files https://gitlab.com/pikron/projects/mz_apo/microzed_apo The work is documented in Martin Jeřábek's diploma theses Open-source and Open-hardware CAN FD Protocol Support https://dspace.cvut.cz/handle/10467/80366 . Link: https://lore.kernel.org/all/4d5c53499bafe7717815f948801bd5aedaa05c12.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Signed-off-by: Martin Jerabek Signed-off-by: Ondrej Ille Signed-off-by: Marc Kleine-Budde commit 792a5b678e81080313beb3bee19db189aaa2cf8c Author: Pavel Pisa Date: Tue Mar 22 00:32:31 2022 +0100 can: ctucanfd: CTU CAN FD open-source IP core - PCI bus support. PCI bus adaptation for CTU CAN FD open-source IP core. The project providing FPGA design for Intel EP4CGX15 based DB4CGX15 PCIe board with PiKRON.com designed transceiver riser shield is available at https://gitlab.fel.cvut.cz/canbus/pcie-ctucanfd . Link: https://lore.kernel.org/all/a81333e206a9bcf9434797f6f54d8664775542e2.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Signed-off-by: Martin Jerabek Signed-off-by: Ondrej Ille Signed-off-by: Marc Kleine-Budde commit 2dcb8e8782d8e4c38903bf37b1a24d3ffd193da7 Author: Martin Jerabek Date: Tue Mar 22 00:32:30 2022 +0100 can: ctucanfd: add support for CTU CAN FD open-source IP core - bus independent part. This driver adds support for the CTU CAN FD open-source IP core. More documentation and core sources at project page (https://gitlab.fel.cvut.cz/canbus/ctucanfd_ip_core). The core integration to Xilinx Zynq system as platform driver is available (https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top). Implementation on Intel FPGA based PCI Express board is available from project (https://gitlab.fel.cvut.cz/canbus/pcie-ctucanfd). More about CAN bus related projects used and developed at CTU FEE at https://canbus.pages.fel.cvut.cz/ . Link: https://lore.kernel.org/all/1906e4941560ae2ce4b8d181131fd4963aa31611.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Martin Jerabek Signed-off-by: Ondrej Ille Signed-off-by: Pavel Pisa Signed-off-by: Marc Kleine-Budde commit 1da9d6e35b6bf307c0d498bd1908c1ef9bdb4298 Author: Pavel Pisa Date: Tue Mar 22 00:32:29 2022 +0100 dt-bindings: net: can: binding for CTU CAN FD open-source IP core. The device-tree bindings for open-source/open-hardware CAN FD IP core designed at the Czech Technical University in Prague. CTU CAN FD IP core and other CTU CAN bus related projects listing and documentation page http://canbus.pages.fel.cvut.cz/ Link: https://lore.kernel.org/all/c5a37fc470ae065b21e79caa65863539393c0d7c.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Reviewed-by: Rob Herring Acked-by: Pavel Machek Signed-off-by: Marc Kleine-Budde commit fb23e43a0a9ce48031dd608f19b3298ce6a88d83 Author: Pavel Pisa Date: Tue Mar 22 00:32:28 2022 +0100 dt-bindings: vendor-prefix: add prefix for the Czech Technical University in Prague. The Czech Technical University in Prague (CTU) is one of the biggest and oldest (founded 1707) technical universities in Europe. The abbreviation in Czech language is ČVUT according to official name in Czech language České vysoké učení technické v Praze The English translation The Czech Technical University in Prague The university pages in English https://www.cvut.cz/en Link: https://lore.kernel.org/all/ff3a7216114fcd83530e70b994ef0e4277ddf000.1647904780.git.pisa@cmp.felk.cvut.cz Signed-off-by: Pavel Pisa Acked-by: Rob Herring Acked-by: Pavel Machek Signed-off-by: Marc Kleine-Budde commit c6f2a617a0a81b28ea006f91830ed2879c95c064 Author: Marc Kleine-Budde Date: Tue Mar 22 09:19:13 2022 +0100 can: mcp251xfd: add support for mcp251863 The MCP251863 device is a CAN-FD controller (MCP2518FD) with an integrated transceiver (ATA6563). This patch add support for the new device. Link: https://lore.kernel.org/all/20220419072805.2840340-3-mkl@pengutronix.de Cc: Thomas Kopp Signed-off-by: Marc Kleine-Budde commit 6211197648502315d52b19dbbe5d9f533fe242ef Author: Marc Kleine-Budde Date: Tue Mar 22 09:19:13 2022 +0100 dt-binding: can: mcp251xfd: add binding information for mcp251863 The MCP251863 device is a CAN-FD controller (MCP2518FD) with an integrated Transceiver (ATA6563). Add the microchip,mcp251863 as a new compatible to the binding. Link: https://lore.kernel.org/all/20220419072805.2840340-2-mkl@pengutronix.de Cc: devicetree@vger.kernel.org Cc: Thomas Kopp Signed-off-by: Marc Kleine-Budde commit 44b6b105dd2411735175af21f76ca1a2604d022e Author: Wolfram Sang Date: Fri Apr 1 17:37:43 2022 +0200 dt-bindings: can: renesas,rcar-canfd: document r8a77961 support This patch adds documentation for the r8a77961 to the renesas,rcar-canfd binding. Link: https://lore.kernel.org/all/20220401153743.77871-1-wsa+renesas@sang-engineering.com Cc: devicetree@vger.kernel.org Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit ae38fda02996d43d9fb09f16e81e0008704dd524 Author: Marc Kleine-Budde Date: Thu Mar 17 21:29:07 2022 +0100 can: xilinx_can: mark bit timing constants as const This patch marks the bit timing constants as const. Fixes: c223da689324 ("can: xilinx_can: Add support for CANFD FD frames") Link: https://lore.kernel.org/all/20220317203119.792552-1-mkl@pengutronix.de Cc: Appana Durga Kedareswara rao Cc: Naga Sureshkumar Relli Signed-off-by: Marc Kleine-Budde commit badea4fc7025320c163dfc24e884c1a52e7c568a Author: Lukas Bulwahn Date: Mon Mar 21 13:28:40 2022 +0100 MAINTAINERS: rectify entry for XILINX CAN DRIVER Commit 7843d3c8e5e6 ("dt-bindings: can: xilinx_can: Convert Xilinx CAN binding to YAML") converts xilinx_can.txt to xilinx,can.yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in XILINX CAN DRIVER. Fixes: 7843d3c8e5e6 ("dt-bindings: can: xilinx_can: Convert Xilinx CAN binding to YAML") Link: https://lore.kernel.org/all/20220321122840.17841-1-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Signed-off-by: Marc Kleine-Budde commit e6ec83790593af2d7ad4bae25831baa206780f66 Author: Minghao Chi Date: Tue Apr 19 08:14:49 2022 +0000 can: flexcan: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Link: https://lore.kernel.org/all/20220419081449.2574026-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Marc Kleine-Budde commit bb75e352d7ac35778fc555b02a69edcc03c36e74 Author: Christophe Leroy Date: Fri Apr 1 19:21:20 2022 +0200 can: mscan: mpc5xxx_can: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Link: https://lore.kernel.org/all/878888f9057ad2f66ca0621a0007472bf57f3e3d.1648833432.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Marc Kleine-Budde commit 20c7258980e07fb2a54797baf157e55b6c77d6e9 Author: Kris Bahnsen Date: Tue Mar 29 13:12:29 2022 -0700 can: Fix Links to Technologic Systems web resources Technologic Systems has rebranded as embeddedTS with the current domain eventually going offline. Update web/doc URLs to correct resource locations. Link: https://lore.kernel.org/all/20220329201229.16279-1-kris@embeddedTS.com Signed-off-by: Kris Bahnsen Signed-off-by: Marc Kleine-Budde commit 85d4eb2a3dfe939dda5304d61e406cb8e0852d60 Author: Marc Kleine-Budde Date: Fri Mar 18 14:58:44 2022 +0100 can: bittiming: can_calc_bittiming(): prefer small bit rate pre-scalers over larger ones The CiA (CAN in Automation) lists in their Newsletter 1/2018 in the "Recommendation for the CAN FD bit-timing" [1] article several recommendations, one of them is: | Recommendation 3: Choose BRPA and BRPD as low as possible [1] https://can-newsletter.org/uploads/media/raw/f6a36d1461371a2f86ef0011a513712c.pdf With the current bit timing algorithm Srinivas Neeli noticed that on the Xilinx Versal ACAP board the CAN data bit timing parameters are not calculated optimally. For most bit rates, the bit rate prescaler (BRP) is != 1, although it's possible to configure the requested with a bit rate with a prescaler of 1: | Data Bit timing parameters for xilinx_can_fd2i with 79.999999 MHz ref clock (cmd-line) using algo 'v4.8' | nominal real Bitrt nom real SampP | Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error | 12000000 12 2 2 2 1 1 11428571 4.8% 75.0% 71.4% 4.8% | 10000000 25 1 1 1 1 2 9999999 0.0% 75.0% 75.0% 0.0% | 8000000 12 3 3 3 1 1 7999999 0.0% 75.0% 70.0% 6.7% | 5000000 50 1 1 1 1 4 4999999 0.0% 75.0% 75.0% 0.0% | 4000000 62 1 1 1 1 5 3999999 0.0% 75.0% 75.0% 0.0% | 2000000 125 1 1 1 1 10 1999999 0.0% 75.0% 75.0% 0.0% | 1000000 250 1 1 1 1 20 999999 0.0% 75.0% 75.0% 0.0% The bit timing parameter calculation algorithm iterates effectively from low to high BRP values. It selects a new best parameter set, if the sample point error of the current parameter set is equal or less to old best parameter set. If the given hardware constraints (clock rate and bit timing parameter constants) don't allow a sample point error of 0, the algorithm will first find a valid bit timing parameter set with a low BRP, but then will accept parameter sets with higher BRPs that have the same sample point error. This patch changes the algorithm to only accept a new parameter set, if the resulting sample point error is lower. This leads to the following data bit timing parameter for the Versal ACAP board: | Data Bit timing parameters for xilinx_can_fd2i with 79.999999 MHz ref clock (cmd-line) using algo 'can-next' | nominal real Bitrt nom real SampP | Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error | 12000000 12 2 2 2 1 1 11428571 4.8% 75.0% 71.4% 4.8% | 10000000 12 2 3 2 1 1 9999999 0.0% 75.0% 75.0% 0.0% | 8000000 12 3 3 3 1 1 7999999 0.0% 75.0% 70.0% 6.7% | 5000000 12 5 6 4 1 1 4999999 0.0% 75.0% 75.0% 0.0% | 4000000 12 7 7 5 1 1 3999999 0.0% 75.0% 75.0% 0.0% | 2000000 12 14 15 10 1 1 1999999 0.0% 75.0% 75.0% 0.0% | 1000000 25 14 15 10 1 2 999999 0.0% 75.0% 75.0% 0.0% Note: Due to HW constraints a data bit rate of 1 MBit/s with BRP = 1 is not possible. Link: https://lore.kernel.org/all/20220318144913.873614-1-mkl@pengutronix.de Link: https://lore.kernel.org/all/20220113203004.jf2rqj2pirhgx72i@pengutronix.de Cc: Srinivas Neeli Signed-off-by: Marc Kleine-Budde commit 51964015565d302fda63ce84ef151e1c9a5939cc Author: Tom Lendacky Date: Mon Apr 18 11:16:13 2022 -0500 x86/mm: Fix spacing within memory encryption features message The spacing is off in the memory encryption features message on AMD platforms that support memory encryption, e.g.: "Memory Encryption Features active:AMD SEV SEV-ES" There is no space before "AMD" and two spaces after it. Fix this so that the message is spaced properly: "Memory Encryption Features active: AMD SEV SEV-ES" Fixes: 968b493173ac ("x86/mm: Make DMA memory shared for TD guest") Signed-off-by: Tom Lendacky Signed-off-by: Dave Hansen Acked-by: Kirill A. Shutemov Link: https://lkml.kernel.org/r/02401f3024b18e90bc2508147e22e729436cb6d9.1650298573.git.thomas.lendacky@amd.com commit 42da167bbd2910e4ac6334174f6dc273e079fb91 Author: Fabien Dessenne Date: Fri Mar 11 13:13:23 2022 +0100 ARM: dts: stm32: fix pinctrl node name warnings (MPU soc) The recent addition pinctrl.yaml in commit c09acbc499e8 ("dt-bindings: pinctrl: use pinctrl.yaml") resulted in some node name warnings. Fix the node names to the preferred 'pinctrl'. Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue commit efaa952f95929554c677d6d236d8641e93aa0bc2 Author: Fabien Dessenne Date: Fri Mar 11 13:14:48 2022 +0100 ARM: dts: stm32: fix pinctrl node name warnings (MCU soc) The recent addition pinctrl.yaml in commit c09acbc499e8 ("dt-bindings: pinctrl: use pinctrl.yaml") resulted in some node name warnings. Fix the node names to the preferred 'pinctrl'. Signed-off-by: Fabien Dessenne Signed-off-by: Alexandre Torgue commit d37b07897e5024088b2170b8e6e1c68d567b9be6 Author: Lv Ruyi Date: Mon Apr 18 02:01:47 2022 +0000 memory: fsl-corenet-cf: Use helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately.Make the code simpler without functional changes. Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220418020147.2556925-1-lv.ruyi@zte.com.cn Signed-off-by: Krzysztof Kozlowski commit eb38c2053b67977844404cbbdee341dbf3a02d36 Author: Marc Kleine-Budde Date: Mon Mar 14 23:09:10 2022 +0100 can: rx-offload: rename can_rx_offload_queue_sorted() -> can_rx_offload_queue_timestamp() This patch renames the function can_rx_offload_queue_sorted() to can_rx_offload_queue_timestamp(). This better describes what the function does, it adds a newly RX'ed skb to the sorted queue by its timestamp. Link: https://lore.kernel.org/all/20220417194327.2699059-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 81c5a41d10b968ea89d5f44fe1e5c2fc70289209 Author: jason-jh.lin Date: Tue Apr 19 11:32:34 2022 +0800 dt-bindings: arm: mediatek: mmsys: add mt8195 SoC binding In the SoC before, such as mt8173, it has 2 pipelines binding to one mmsys with the same clock driver and the same power domain. In mt8195, there are 4 pipelines binding to 4 different mmsys, such as vdosys0, vdosys1, vppsys0 and vppsys1. Each mmsys uses different clock drivers and different power domain. Since each mmsys has its own mmio base address, they could be identified by their different address during probe time. Signed-off-by: jason-jh.lin Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220419033237.23405-3-rex-bc.chen@mediatek.com Signed-off-by: Matthias Brugger commit 1da90b8a7bae09358569dba26e784d1f471b4aa0 Author: jason-jh.lin Date: Tue Apr 19 11:32:33 2022 +0800 dt-bindings: arm: mediatek: mmsys: add power and gce properties Power: 1. Add description for power-domains property. GCE: 1. Add description for mboxes property. 2. Add description for mediatek,gce-client-reg property. Signed-off-by: jason-jh.lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://lore.kernel.org/r/20220419033237.23405-2-rex-bc.chen@mediatek.com Signed-off-by: Matthias Brugger commit 8ce4129e3de433ab924951eeb980e97e4c2cc03b Author: Marek Vasut Date: Tue Apr 19 16:39:58 2022 +0200 drm/bridge: lt9211: Add Lontium LT9211 bridge driver Add driver for Lontium LT9211 Single/Dual-Link DSI/LVDS or Single DPI to Single-link/Dual-Link DSI/LVDS or Single DPI bridge. This chip is highly capable at converting formats, but sadly it is also highly undocumented. This driver is written without any documentation from Lontium and based only on shreds of information available in various obscure example codes, hence long runs of unknown register patches and lengthy delays in various places. Whichever register meaning could be divined from its behavior has at least a comment around it. Currently the only mode tested is Single-link DSI to Single-link LVDS. Dual-link LVDS might work as well, the register programming is in place, but is untested. Reviewed-by: Robert Foss Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220419143958.94873-2-marex@denx.de commit 501f94d09b7df2d121a626590e824d6ae6e6e095 Author: Marek Vasut Date: Tue Apr 19 16:39:57 2022 +0200 dt-bindings: display: bridge: lt9211: Add Lontium LT9211 bridge driver Add bindings for Lontium LT9211 Single/Dual-Link DSI/LVDS or Single DPI to Single-link/Dual-Link DSI/LVDS or Single DPI bridge. This chip is highly capable at converting formats, but sadly it is also highly undocumented. Reviewed-by: Rob Herring Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Lucas Stach Cc: Maxime Ripard Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220419143958.94873-1-marex@denx.de commit ee84cbd5df2beaf14e8af0955f1ab15ad3f81504 Author: Arnd Bergmann Date: Mon Sep 2 00:15:44 2019 +0200 ARM: pxa: move regs-lcd.h into driver Only the pxafb driver uses this header, so move it into the same directory. The SMART_* macros are required by some platform data definitions and can go into the linux/platform_data/video-pxafb.h header. Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Robert Jarzmik Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Arnd Bergmann commit 22f0866513c2e531ae65a9d5dfc82f24497ef3b3 Author: Arnd Bergmann Date: Mon Sep 2 00:02:08 2019 +0200 ARM: pxa: move mach/sound.h to linux/platform_data/ This is a basically a platform_data file, so move it out of the mach/* header directory. Cc: Marek Vasut Cc: Tomas Cech Cc: Sergey Lapin Acked-by: Mark Brown Acked-by: Robert Jarzmik Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit 2a0fd0a95a1e63f18df189c178459c5965d4ce6c Author: Arnd Bergmann Date: Sun Sep 1 23:25:15 2019 +0200 ARM: pxa: stop using mach/bitfield.h There are two identical copies of mach/bitfield.h, one for mach-sa1100 and one for mach-pxa. The pxafb driver only makes use of two macros, which can be trivially open-coded in the header. Cc: dri-devel@lists.freedesktop.org Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 08d3df8c81537089fc8f21006b56f2f6fb23c6f8 Author: Arnd Bergmann Date: Sun Sep 1 22:26:10 2019 +0200 ARM: pxa: split up mach/hardware.h The mach/hardware.h is included in lots of places, and it provides three different things on pxa: - the cpu_is_pxa* macros - an indirect inclusion of mach/addr-map.h - the __REG() and io_pv2() helper macros Split it up into separate and mach/pxa-regs.h headers, then change all the files that use mach/hardware.h to include the exact set of those three headers that they actually need, allowing for further more targeted cleanup. linux/soc/pxa/cpu.h can remain permanently exported and is now in a global location along with similar headers. pxa-regs.h and addr-map.h are only used in a very small number of drivers now and can be moved to arch/arm/mach-pxa/ directly when those drivers are to pass the necessary data as resources. Cc: Michael Turquette Cc: Stephen Boyd Acked-by: Viresh Kumar Acked-by: Dmitry Torokhov Cc: Jacek Anaszewski Cc: Pavel Machek Acked-by: Ulf Hansson Cc: Dominik Brodowski Acked-by: Alexandre Belloni Cc: Greg Kroah-Hartman Cc: Guenter Roeck Acked-by: Mark Brown Cc: linux-clk@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: linux-leds@vger.kernel.org Cc: linux-mmc@vger.kernel.org Cc: linux-mtd@lists.infradead.org Cc: linux-rtc@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Cc: linux-watchdog@vger.kernel.org Cc: alsa-devel@alsa-project.org Signed-off-by: Arnd Bergmann commit eec05d26ea5e20dec50fdcddcaa6e0787f394691 Author: Arnd Bergmann Date: Sun Sep 1 23:06:17 2019 +0200 ARM: pxa: remove mach/dma.h The file no longer contains anything useful, so remove it. Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit ff62bdb25e952a1c7c431e041b7b5b77dbcb944c Author: Arnd Bergmann Date: Sun Sep 1 21:34:47 2019 +0200 ARM: pxa: make mach/regs-uart.h private This is not used by any drivers, so make it private to the platform. Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit d23dc21c99b2f22c737cb50e4d04aea6e059138f Author: Arnd Bergmann Date: Sun Sep 1 21:33:34 2019 +0200 ARM: pxa: make mainstone.h private No driver includes this any more, so don't expose it globally. Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 0e2b75af658b5dccce27e8ec265e96b84fdf7036 Author: Arnd Bergmann Date: Sun Sep 1 21:32:39 2019 +0200 ARM: pxa: split mach/generic.h Only one declaration from this header is actually used in drivers, so move that one into the global location and leave everything else private. Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann commit 4bde53ab3370bfd377eff27152da36be9784e4f5 Merge: b2d229d4ddb17 5644b66a9c63c Author: Marc Zyngier Date: Tue Apr 19 15:23:14 2022 +0100 Merge branch irq/gpio-immutable into irq/irqchip-next * irq/gpio-immutable: : . : First try at preventing the GPIO subsystem from abusing irq_chip : data structures. The general idea is to have an irq_chip flag : to tell the GPIO subsystem that these structures are immutable, : and to convert drivers one by one. : . Documentation: Update the recommended pattern for GPIO irqchips gpio: Update TODO to mention immutable irq_chip structures pinctrl: amd: Make the irqchip immutable pinctrl: msmgpio: Make the irqchip immutable pinctrl: apple-gpio: Make the irqchip immutable gpio: pl061: Make the irqchip immutable gpio: tegra186: Make the irqchip immutable gpio: Add helpers to ease the transition towards immutable irq_chip gpio: Expose the gpiochip_irq_re[ql]res helpers gpio: Don't fiddle with irqchips marked as immutable Signed-off-by: Marc Zyngier commit 5644b66a9c63c3cadc6ba85faf5a15604e6cf29a Author: Marc Zyngier Date: Tue Apr 19 15:18:46 2022 +0100 Documentation: Update the recommended pattern for GPIO irqchips Update the documentation to get rid of the per-gpio_irq_chip irq_chip structure, and give examples of the new pattern. Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-11-maz@kernel.org commit afefc3266272d40cdcd0fd713c7b42008fea19d5 Author: Marc Zyngier Date: Tue Apr 19 15:18:45 2022 +0100 gpio: Update TODO to mention immutable irq_chip structures 5 drivers are converted, a few hundred to go. Definitely worth of a TODO entry, in the hope that someone will notice it and do a bulk update. Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-10-maz@kernel.org commit 6173e56f76c712aac9d45208ccec7a065382911f Author: Marc Zyngier Date: Tue Apr 19 15:18:44 2022 +0100 pinctrl: amd: Make the irqchip immutable Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-9-maz@kernel.org commit 14dbe186b9d42cbf662eae5a4da14687edbf0edb Author: Marc Zyngier Date: Tue Apr 19 15:18:43 2022 +0100 pinctrl: msmgpio: Make the irqchip immutable Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-8-maz@kernel.org commit 374b87a0fcf9fa5dd1379271337ae19f95682956 Author: Marc Zyngier Date: Tue Apr 19 15:18:42 2022 +0100 pinctrl: apple-gpio: Make the irqchip immutable Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-7-maz@kernel.org commit 15d8c14ac849f41f2d41dbddb69f402aaf73ff8b Author: Marc Zyngier Date: Tue Apr 19 15:18:41 2022 +0100 gpio: pl061: Make the irqchip immutable Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-6-maz@kernel.org commit bba00555ede79ad8a743da908f708466f6bac0f8 Author: Marc Zyngier Date: Tue Apr 19 15:18:40 2022 +0100 gpio: tegra186: Make the irqchip immutable Prevent gpiolib from messing with the irqchip by advertising the irq_chip structure as immutable, making it const, and adding the various calls that gpiolib relies upon. Acked-by: Thierry Reding Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-5-maz@kernel.org commit 36b78aae4bfee749bbde73be570796bfd0f56bec Author: Marc Zyngier Date: Tue Apr 19 15:18:39 2022 +0100 gpio: Add helpers to ease the transition towards immutable irq_chip Add a couple of new helpers to make it slightly simpler to convert drivers to immutable irq_chip structures: - GPIOCHIP_IRQ_RESOURCE_HELPERS populates the irq_chip structure with the resource management callbacks - gpio_irq_chip_set_chip() populates the gpio_irq_chip.chip structure, avoiding the proliferation of ugly casts Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-4-maz@kernel.org commit 704f08753b6dcd0e08c1953af0b2c7f3fac87111 Author: Marc Zyngier Date: Tue Apr 19 15:18:38 2022 +0100 gpio: Expose the gpiochip_irq_re[ql]res helpers The GPIO subsystem has a couple of internal helpers to manage resources on behalf of the irqchip. Expose them so that GPIO drivers can use them directly. Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-3-maz@kernel.org commit 6c846d026d490b2383d395bc8e7b06336219667b Author: Marc Zyngier Date: Tue Apr 19 15:18:37 2022 +0100 gpio: Don't fiddle with irqchips marked as immutable In order to move away from gpiolib messing with the internals of unsuspecting irqchips, add a flag by which irqchips advertise that they are not to be messed with, and do solemnly swear that they correctly call into the gpiolib helpers when required. Also nudge the users into converting their drivers to the new model. Reviewed-by: Andy Shevchenko Reviewed-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220419141846.598305-2-maz@kernel.org commit 97f2c684f34d386639926787fe5211d42b6f4e6f Author: Hsin-Yi Wang Date: Thu Apr 14 17:00:04 2022 +0800 drm/bridge: anx7625: Fill in empty ELD when no connector Speaker may share I2S with DP and .get_eld callback will be called when speaker is playing. When HDMI wans't connected, the connector will be null. Instead of return an error, fill in empty ELD. Signed-off-by: Hsin-Yi Wang Reviewed-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220414090003.1806535-1-hsinyi@chromium.org commit c837e027436df69d20474bd3fdea2c6b3971aa6f Author: José Roberto de Souza Date: Thu Apr 14 08:11:18 2022 -0700 drm/i915/display/psr: Clear more PSR state during disable After commit 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations") was merged we started to get some drm_WARN_ON(&dev_priv->drm, !(tmp & PSR2_MAN_TRK_CTL_ENABLE)) in tests that are executed in pipe B. This is probably due psr2_sel_fetch_cff_enabled being left set during PSR disable in the pipe A, so the PSR2_MAN_TRK_CTL write in intel_psr2_program_trans_man_trk_ctl() is skipped in pipe B and then we get the warning when actually enabling PSR after planes programing. We don't get such warnings when running tests in pipe A because PSR2_MAN_TRK_CTL is only cleared when enabling PSR2 with hardware tracking. Was not able to reproduce this issue but cleaning the PSR state disable will not harm anything at all. Fixes: 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5634 Cc: Jouni Högander Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220414151118.21980-2-jose.souza@intel.com commit 554ae8dce1268789e72767a67f0635cb743b3cea Author: José Roberto de Souza Date: Thu Apr 14 08:11:17 2022 -0700 drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails If any of the PSR2 checks after intel_psr2_sel_fetch_config_valid() fails, enable_psr2_sel_fetch will be kept enabled causing problems in the functions that only checks for it and not for has_psr2. So here moving the check that do not depend on enable_psr2_sel_fetch and for the remaning ones jumping to a section that unset enable_psr2_sel_fetch in case of failure to support PSR2. Fixes: 6e43e276b8c9 ("drm/i915: Initial implementation of PSR2 selective fetch") Cc: Jouni Högander Reviewed-by: Jouni Högander Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220414151118.21980-1-jose.souza@intel.com commit 2bd50abce1b6636bd3c9064e7ae5c0f832a615b2 Merge: 548f8b21ae605 652980b1541c5 Author: Rob Herring Date: Tue Apr 19 07:55:12 2022 -0500 Merge branch 'dt/linus' into dt/next Pick up new meta-schema warning fixes. commit dd769f15483cac1895fd219eb17e6f04c9a5548f Author: Minghao Chi Date: Mon Apr 18 11:02:26 2022 +0000 spi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220418110226.2559081-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 79422ed9bd7fbd79f84d8a5abb0094c16221f55b Author: Baruch Siach Date: Mon Apr 11 21:45:29 2022 +0300 spi: spi-imx: add support for SPI_RX_CPHA_FLIP When SPI_RX_CPHA_FLIP is set, flip CPHA on Rx only transfers. This is useful to access devices that use inverted CPHA for MISO vs MOSI signals. Only support the mx51/mx53 variants for now. Tested on i.MX6ULL based system. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/e11b4446afe9a46a282dd923d22c27d03fae15f8.1649702729.git.baruch@tkos.co.il Signed-off-by: Mark Brown commit 178d0cbbfe8ec652083058968c7a27485eaa33d2 Author: Baruch Siach Date: Mon Apr 11 21:45:28 2022 +0300 spi: spidev: add SPI_RX_CPHA_FLIP Allow userspace to set SPI_RX_CPHA_FLIP mode bit using the SPI_IOC_WR_MODE32 ioctl. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/6ae31ad24f8252418878b21a8759a04b78726dac.1649702729.git.baruch@tkos.co.il Signed-off-by: Mark Brown commit b617be33502d2bfefffef71924c7a7ba50264ff6 Author: Baruch Siach Date: Mon Apr 11 21:45:27 2022 +0300 spi: add SPI_RX_CPHA_FLIP mode bit Some SPI devices latch MOSI bits on one clock phase, but produce valid MISO bits on the other phase. Add SPI_RX_CPHA_FLIP mode to instruct the controller driver to flip CPHA for Rx (MISO) only transfers. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/a715ca92713ca02071f33dcca9960a66a03c949a.1649702729.git.baruch@tkos.co.il Signed-off-by: Mark Brown commit 4bbaa857e9af76d8cc346bd57fbaa50d357ae132 Author: Mika Westerberg Date: Mon Apr 11 14:31:57 2022 +0300 spi: intel: Fix typo in kernel-doc of intel_spi_probe() Should be 'specific' not 'spefific'. Fix this. Reported-by: Hongli Li Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20220411113158.2037-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown commit c03ae4876fd54822a22375aa4fc49736a8c3a5d4 Author: Minghao Chi Date: Fri Apr 8 08:09:31 2022 +0000 spi: spi-ti-qspi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220408080931.2494356-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 58b1efe2c1722cb47e5b1f49b79a50338428acbf Author: Minghao Chi Date: Tue Apr 12 07:09:51 2022 +0000 spi: spi-tegra114: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220412070951.2532157-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 3a2ac5809935e6043dae916bab6cf4741d9dcdeb Author: Minghao Chi Date: Wed Apr 13 09:36:56 2022 +0000 spi: spi-cadence-quadspi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220413093656.2538504-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit c81085840e03dd421532e16b22a8cde95de8ea41 Author: Li-hao Kuo Date: Fri Apr 15 16:12:04 2022 +0800 spi: remove spin_lock_irq and variable in the irq procress remove spin_lock_irq spin_unlock_irq and variable in the irq funciton Signed-off-by: Li-hao Kuo Link: https://lore.kernel.org/r/f9991d6064d892d22ac7c2dfabe16309e9d03888.1650010304.git.lhjeff911@gmail.com Signed-off-by: Mark Brown commit c9b2d923befd8cee0b9d6cbd96128ec0bf44c881 Author: Devarsh Thakkar Date: Mon Mar 14 17:07:39 2022 +0530 drm/tidss: Soft Reset DISPC on startup Soft reset the display subsystem controller on startup and wait for the reset to complete. This helps the scenario where display was already in use by some other core before the linux was booted. Signed-off-by: Devarsh Thakkar Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220314113739.18000-1-devarsht@ti.com commit cc4bdef26ecd56de16a04bc6d99aa10ff9076498 Merge: 8b11c35d97946 b6177d3240a4f Author: Paolo Abeni Date: Tue Apr 19 13:39:01 2022 +0200 Merge branch 'rtnetlink-improve-alt_ifname-config-and-fix-dangerous-group-usage' Florent Fourcot says: ==================== rtnetlink: improve ALT_IFNAME config and fix dangerous GROUP usage First commit forbids dangerous calls when both IFNAME and GROUP are given, since it can introduce unexpected behaviour when IFNAME does not match any interface. Second patch achieves primary goal of this patchset to fix/improve IFLA_ALT_IFNAME attribute, since previous code was never working for newlink/setlink. ip-link command is probably getting interface index before, and was not using this feature. Last two patches are improving error code on corner cases. Changes in v2: * Remove ifname argument in rtnl_dev_get/do_setlink functions (simplify code) * Use a boolean to avoid condition duplication in __rtnl_newlink Changes in v3: * Simplify rtnl_dev_get signature Changes in v4: * Rename link_lookup to link_specified Changes in v5: * Re-order patches ==================== Link: https://lore.kernel.org/r/20220415165330.10497-1-florent.fourcot@wifirst.fr Signed-off-by: Paolo Abeni commit b6177d3240a4f58fe547891010ad77a45bc1c9ab Author: Florent Fourcot Date: Fri Apr 15 18:53:30 2022 +0200 rtnetlink: return EINVAL when request cannot succeed A request without interface name/interface index/interface group cannot work. We should return EINVAL Signed-off-by: Florent Fourcot Signed-off-by: Brian Baboch Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit dee04163e9f2feabb77615c630a1e31a91cc4449 Author: Florent Fourcot Date: Fri Apr 15 18:53:29 2022 +0200 rtnetlink: return ENODEV when IFLA_ALT_IFNAME is used in dellink If IFLA_ALT_IFNAME is set and given interface is not found, we should return ENODEV and be consistent with IFLA_IFNAME behaviour This commit extends feature of commit 76c9ac0ee878, "net: rtnetlink: add possibility to use alternative names as message handle" CC: Jiri Pirko Signed-off-by: Florent Fourcot Signed-off-by: Brian Baboch Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit 5ea08b5286f66ee5ac0150668c92d1718e83e1ad Author: Florent Fourcot Date: Fri Apr 15 18:53:28 2022 +0200 rtnetlink: enable alt_ifname for setlink/newlink buffer called "ifname" given in function rtnl_dev_get is always valid when called by setlink/newlink, but contains only empty string when IFLA_IFNAME is not given. So IFLA_ALT_IFNAME is always ignored This patch fixes rtnl_dev_get function with a remove of ifname argument, and move ifname copy in do_setlink when required. It extends feature of commit 76c9ac0ee878, "net: rtnetlink: add possibility to use alternative names as message handle"" CC: Jiri Pirko Signed-off-by: Florent Fourcot Signed-off-by: Brian Baboch Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit ef2a7c9065cea4e3fbc0390e82d05141abbccd7f Author: Florent Fourcot Date: Fri Apr 15 18:53:27 2022 +0200 rtnetlink: return ENODEV when ifname does not exist and group is given When the interface does not exist, and a group is given, the given parameters are being set to all interfaces of the given group. The given IFNAME/ALT_IF_NAME are being ignored in that case. That can be dangerous since a typo (or a deleted interface) can produce weird side effects for caller: Case 1: IFLA_IFNAME=valid_interface IFLA_GROUP=1 MTU=1234 Case 1 will update MTU and group of the given interface "valid_interface". Case 2: IFLA_IFNAME=doesnotexist IFLA_GROUP=1 MTU=1234 Case 2 will update MTU of all interfaces in group 1. IFLA_IFNAME is ignored in this case This behaviour is not consistent and dangerous. In order to fix this issue, we now return ENODEV when the given IFNAME does not exist. Signed-off-by: Florent Fourcot Signed-off-by: Brian Baboch Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni commit a69d7f1bd373205bf539b9762423c8d526b9b9cb Author: Sascha Hauer Date: Thu Apr 14 18:22:49 2022 +0200 ASoC: fsl_micfil: Remove debug message The micfil driver prints out the IRQ numbers for each interrupt at error level. This information is useful for debugging at best, remove it. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-22-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit cc5ef57d130d78c8c30062eef140c01ee47f346e Author: Sascha Hauer Date: Thu Apr 14 18:22:48 2022 +0200 ASoC: fsl_micfil: fold fsl_set_clock_params() into its only user fsl_set_clock_params() is used only once and easily be folded into its caller, do so. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-21-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit cbd090fa1fbf021e286f83d602e01ff3f0b726fd Author: Sascha Hauer Date: Thu Apr 14 18:22:47 2022 +0200 ASoC: fsl_micfil: drop support for undocumented property The "fsl,shared-interrupt" property is undocumented and unnecessary. Just pass IRQF_SHARED unconditionally. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-20-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 99c08cdb6d51347ef3a56b8c8ec03e2d855b10c3 Author: Sascha Hauer Date: Thu Apr 14 18:22:46 2022 +0200 ASoC: fsl_micfil: drop only once used defines FSL_MICFIL_RATES and FSL_MICFIL_FORMATS is only used once. Drop the unnecesary indirection and use SNDRV_PCM_RATE_8000_48000 and SNDRV_PCM_FMTBIT_S16_LE directly. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-19-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit dcc4301584abcf692fbe4836b01303c4b4cdef46 Author: Sascha Hauer Date: Thu Apr 14 18:22:45 2022 +0200 ASoC: fsl_micfil: drop unused include The micfil driver doesn't use anything from imx-pcm.h. Drop its inclusion. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-18-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit bea1d61d5892083551f92818e964801baabd95a9 Author: Sascha Hauer Date: Thu Apr 14 18:22:44 2022 +0200 ASoC: fsl_micfil: rework quality setting For the quality setting the quality setting register values are directly exposed to the kcontrol and thus to userspace. This is unfortunate because the register settings contains invalid bit combinations marked as "N/A". For userspace it doesn't make much sense to be able to set these just to see that the driver responds with "Please make sure you select a valid quality." in the kernel log. Work around this by adding get/set functions for the quality setting. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-17-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit e8936f6925c1174242e643e0aa0646359c192fe2 Author: Sascha Hauer Date: Thu Apr 14 18:22:43 2022 +0200 ASoC: fsl_micfil: simplify clock setting The reference manual has this for calculating the micfil internal clock divider: MICFIL Clock rate clkdiv = ----------------- 8 * OSR * outrate (with OSR == Oversampling Rate, outrate == output sample rate) The driver first sets the MICFIL Clock rate to (outrate * 1024) and then calculates back the clkdiv value from the above calculation. Simplify this by using a fixed clkdiv value of 8 and set the MICFIL Clock rate to (outrate * clkdiv * OSR * 8). While at it drop disabling the clock before setting its rate. The MICFIL module is disabled when the rate is changed and it is also resetted before it is started again, so I doubt it's necessary to disable the clock. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-16-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit be6aeee2eb82e5ae57f8cc613c0b6cc3e8d33664 Author: Sascha Hauer Date: Thu Apr 14 18:22:42 2022 +0200 ASoC: fsl_micfil: Drop get_pdm_clk() get_pdm_clk() calculates the PDM clock based on the quality setting, but really the PDM clock is independent of the quality, it's always rate * 4 * micfil->osr. Just drop the function and do the calculation in the caller. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-15-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit fb855b8d46a17c9bb5562e315158de52b18b7e62 Author: Sascha Hauer Date: Thu Apr 14 18:22:41 2022 +0200 ASoC: fsl_micfil: use define for OSR default value The OSR (OverSampling Rate) setting is set once to the default value and never changed throughout the driver. Nevertheless the value is read back from the register for further calculations. Just use the default value because we know what we have written. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-14-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 2495ba26e838176c3b572b2b1592d75b4b963692 Author: Sascha Hauer Date: Thu Apr 14 18:22:40 2022 +0200 ASoC: fsl_micfil: add multi fifo support The micfil hardware provides the microphone data on multiple successive FIFO registers, one register per stereo pair. Also to work properly the SDMA_DONE0_CONFIG_DONE_SEL bit in the SDMA engines SDMA_DONE0_CONFIG register must be set. This patch provides the necessary information to the SDMA engine driver. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-13-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 824a0a02cd74776461aaa30d792b1ed9111c9aa5 Author: Sascha Hauer Date: Thu Apr 14 18:22:39 2022 +0200 dmaengine: imx-sdma: Add multi fifo support The i.MX SDMA engine can read from / write to multiple successive hardware FIFO registers, referred to as "Multi FIFO support". This is needed for the micfil driver and certain configurations of the SAI driver. This patch adds support for this feature. The number of FIFOs to read from / write to must be communicated from the client driver to the SDMA engine. For this the struct dma_slave_config::peripheral_config field is used. Signed-off-by: Sascha Hauer Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220414162249.3934543-12-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 625d8936c3378016ec8c480a00432034bcb813c9 Author: Sascha Hauer Date: Thu Apr 14 18:22:38 2022 +0200 dmaengine: imx-sdma: error out on unsupported transfer types The i.MX SDMA driver currently silently ignores unsupported transfer types. These transfer types are specified in the dma channel description in the device tree, so they should really be checked. Issue a message and error out when we hit unsupported transfer types. Signed-off-by: Sascha Hauer Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220414162249.3934543-11-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit c6547c2ed0e1487c91983faccad841611ab6a783 Author: Sascha Hauer Date: Thu Apr 14 18:22:37 2022 +0200 dmaengine: imx: Move header to include/dma/ The i.MX DMA drivers are device tree only, nothing in include/linux/platform_data/dma-imx.h has platform_data in it, so move the file to include/linux/dma/imx-dma.h. Signed-off-by: Sascha Hauer Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20220414162249.3934543-10-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 819dc38b93e7e0606d71dde80896c139afe7ce48 Author: Sascha Hauer Date: Thu Apr 14 18:22:36 2022 +0200 ASoC: fsl_micfil: drop unused variables struct fsl_micfil has unused fields, remove them. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-9-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 2c602c7ef9ef08835f2e3e0c438d10b7142d6959 Author: Sascha Hauer Date: Thu Apr 14 18:22:35 2022 +0200 ASoC: fsl_micfil: drop error messages from failed register accesses Failed register accesses are really not expected in memory mapped registers. When it fails then the register access itself is likely not the reason, so no need to have extra error messages for each regmap access. Just drop the error messages. This also fixes some places where a return value is concatenated using 'ret |=' and then returned as error value. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-8-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit d46c2127ae8e10378213f71abe4fe88adb17549c Author: Sascha Hauer Date: Thu Apr 14 18:22:34 2022 +0200 ASoC: fsl_micfil: use clear/set bits Instead regmap_update_bits() use the simpler variants regmap_[set|clear]_bits() where appropriate. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-7-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 17f2142bae4b6f2e27f19ce57d79fc42ba5ef659 Author: Sascha Hauer Date: Thu Apr 14 18:22:33 2022 +0200 ASoC: fsl_micfil: use GENMASK to define register bit fields Use GENMASK along with FIELD_PREP and FIELD_GET to access bitfields in registers to straighten register access and to drop a lot of defines. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-6-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit bd2cffd10d79eb9280cb8f5b7cb441f206c1e6ac Author: Sascha Hauer Date: Thu Apr 14 18:22:32 2022 +0200 ASoC: fsl_micfil: do not define SHIFT/MASK for single bits No need to have defines for the mask of single bits. Also shift is unused. Drop all these unnecessary defines. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-5-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 3ff84e3dd180c368981b2d58ed50f17a47471828 Author: Sascha Hauer Date: Thu Apr 14 18:22:31 2022 +0200 ASoC: fsl_micfil: drop fsl_micfil_set_mclk_rate() All that the .set_sysclk hook in the micfil driver does is to pass the sysclk frequency to fsl_micfil_set_mclk_rate(). This function expects the sample rate as argument though, not any kind of sysclk frequency. The resulting rate setting of the clock is overwritten in hw_params anyway, so drop this altogether. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-4-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit 384672e3b7af65aaebb794a6d1a77bb975a10678 Author: Sascha Hauer Date: Thu Apr 14 18:22:30 2022 +0200 ASoC: fsl_micfil: Drop unused register read In get_pdm_clk() REG_MICFIL_CTRL2 is read, but the result is never used. Drop the unused code. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-3-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit c808e277bcdfce37aed80a443be305ac1aec1623 Author: Sascha Hauer Date: Thu Apr 14 18:22:29 2022 +0200 ASoC: fsl_micfil: Drop unnecessary register read in get_pdm_clk() REG_MICFIL_CTRL2 is read twice. Drop second read. Signed-off-by: Sascha Hauer Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220414162249.3934543-2-s.hauer@pengutronix.de Signed-off-by: Mark Brown commit bfb5711e2455a239ad64dd5151fb16d195329d46 Author: Minghao Chi Date: Tue Apr 12 07:10:30 2022 +0000 regulator: stm32-vrefbuf: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220412071030.2532230-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit e65f2fce08fc708e65b544131999bdd933d09164 Author: Minghao Chi Date: Mon Apr 18 11:02:59 2022 +0000 ASoC: codecs: wm8962: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220418110259.2559144-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 0a8ff26dea6e9aeb11db3f1af9fc1848b7042661 Author: Srinivasa Rao Mandadapu Date: Wed Apr 13 15:39:56 2022 +0530 ASoC: qcom: lpass-platform: Update memremap flag to MEMREMAP_WC Update memremap flag from MEMREMAP_WT to MEMREMAP_WC for better performance. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1649844596-5264-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 274d79e5187558078fcf107445fe56ab2fbe4c97 Author: Cezary Rojewski Date: Thu Mar 31 15:52:46 2022 +0200 ASoC: Intel: avs: Configure modules according to their type Each module on DSP side serves a processing purpose. Depending on its purpose, it needs different information during its initialization. Add functions responsible for creating instances of specific module types given the information coming from the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 435e25730fe7b3a4e4a8e66028e39597b2524f0c Author: Cezary Rojewski Date: Thu Mar 31 15:52:45 2022 +0200 ASoC: Intel: avs: Prepare modules before bindings them When binding modules to pins other than pin0, sometimes additional preparations need to be made, depending on the module type. Add function that prepares modules when necessary before binding them. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 84a99908fc7b988067e927834575df42707ec024 Author: Cezary Rojewski Date: Thu Mar 31 15:52:44 2022 +0200 ASoC: Intel: avs: Arm paths after creating them Creating the pipelines and instantiating the modules alone is insufficient to have a fully operational stream. Before it can be run, stream components need to be bound. Add arming functions to ensure all necessary operations are completed before path is yielded back to the avs_path_create() caller. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit c96059993f939fe04427164fb99a32ace8d97f4e Author: Cezary Rojewski Date: Thu Mar 31 15:52:43 2022 +0200 ASoC: Intel: avs: Path state management Add functions to ease with state changing of all objects found in the path. Each represents either a BIND/UNBIND or SET_PIPELINE_STATE IPC. DSP pipelines follow simple state machine scheme: CREATE -> RESET -> PAUSE -> RUNNING -> PAUSE -> RESET -> DELETE There is no STOP, PAUSE serves that purpose instead. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 0ef882074eb1fee25083387ea6bc6669d0e24a85 Author: Cezary Rojewski Date: Thu Mar 31 15:52:42 2022 +0200 ASoC: Intel: avs: Path creation and freeing To implement ASoC PCM operations, DSP path handling is needed. With path template concept present, information carried by topology file can be converted into runtime path representation. Each may be composed of several pipelines and each pipeline can contain a number of processing modules inside. Number of templates and variants found within topology may vastly outnumber the total amount of pipelines and modules supported by AudioDSP firmware simultaneously (in runtime) so none of the IDs are specified in the topology. These are assigned dynamically when needed and account for limitations described by FIRMWARE_CONFIG and HARDWARE_CONFIG basefw parameters. Paths are created on ->hw_params() and are freed on ->hw_free() ALSA PCM operations. This choice is based on firmware expectations - need for complete set of information when attempting to instantiate pipelines and modules on AudioDSP side. With DMA and audio format provided, search mechanism tests all path variants available in given path template until a matching variant is found. Once found, information already available is combined with all avs_tplg_* pieces pointed by matching path variant. This finally allows to begin a cascade of IPCs which goal is to reserve resources and prepare DSP for upcoming audio streaming. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit f61ad1e9568c854ea49a2f58cf2a0b2877cfad33 Author: Cezary Rojewski Date: Thu Mar 31 15:52:41 2022 +0200 ASoC: Intel: avs: Declare path and its components Declare representatives for all crucial elements which stream on ADSP side is made of. That covers pipelines and modules subject which are presented by struct avs_path_pipeline and avs_path_module respectively. While struct avs_path_binding and struct avs_path do not represent any object on firmware side directly, they are needed to help track the interconnections and membership of every pipeline and module created. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit d48c1ada577588e769b26c3dea0a45e8856bc343 Author: Cezary Rojewski Date: Thu Mar 31 15:52:40 2022 +0200 ASoC: Intel: avs: Support link_mask formatted string Allow topology to specify formatted strings so machine board's predefined ->link_mask can be used to specify SSP port number automatically. This is done to help reduce the amount of topology files as many I2S configurations contain codec of the same type with little to no differences in number of scenarios supported - the only difference being the port number codec is connected to. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit d73d1b67ff71e39bb3a04596744fc83047e68a94 Author: Cezary Rojewski Date: Thu Mar 31 15:52:39 2022 +0200 ASoC: Intel: avs: Add topology loading operations AVS topology is split into two major parts: dictionaries - found within ASoC topology manifest - and path templates. Add custom handlers for a range of operations available in struct snd_soc_tplg_ops to allow for actually loading the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit eee475bb1ca71e963a51c20cc0f3e7c7b1cd2ba0 Author: Cezary Rojewski Date: Thu Mar 31 15:52:38 2022 +0200 ASoC: Intel: avs: Parse path and path templates tuples Path template is similar to path description found in skylake-driver and it describes how given path shall look like in runtime - number of modules and pipelines that shape it and how they are laid out. It is tied to DAPM widget's (representing either a FE or a BE) private data. Depending on the number of audio formats supported, each path template may carry one or more descriptions of given path. During runtime, when audio format is known, description matching said format is selected and used when instantiating path on ADSP firmware side through IPCs. Add parsing helpers to support loading such information from the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 276b83c807a2bc2a8d9874a92b7fb7811c2df8b2 Author: Cezary Rojewski Date: Thu Mar 31 15:52:37 2022 +0200 ASoC: Intel: avs: Parse pipeline and module tuples Shape of a path on DSP side, that is, the number and the layout of its pipelines and modules is paramount for streaming to be efficient and low power-consuming. Add parsing helpers to support loading such information from the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 1fba20364318819ecedab2d0f6a68a038f4f47c3 Author: Cezary Rojewski Date: Thu Mar 31 15:52:36 2022 +0200 ASoC: Intel: avs: Parse pplcfg and binding tuples Path in ADSP firmware is represented by one or more pipelines. Just like modules, these are described by a config structure. Add parsing helpers to support loading such information from the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 9e85ec401d038b43d9d6ad8e3f488f865404bab5 Author: Cezary Rojewski Date: Thu Mar 31 15:52:35 2022 +0200 ASoC: Intel: avs: Parse module-extension tuples Anything that goes beyond module base config is an extension config. It covers all fields for all specific module types available in ADSP firmware. Add parsing helpers to support loading such information from the topology file. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 34ae2cd536738affaa2c2f32be23aea229b3c309 Author: Cezary Rojewski Date: Thu Mar 31 15:52:34 2022 +0200 ASoC: Intel: avs: Add topology parsing infrastructure AVS topology is split into two major parts: dictionaries - found within ASoC topology manifest - and path templates. Dictionaries job is to reduce the total amount of memory occupied by topology elements. Rather than having every pipeline and module carry its own information, each refers to specific entry in specific dictionary by provided (from topology file) indexes. In consequence, most struct avs_tplg_xxx are made out of pointers. To support the above, range of parsing helpers for all value-types known to ALSA: uuid, bool, byte, short, word and string are added. Additional handlers help translate pointer-types and more complex objects such as audio formats and module base configs. Path templates are similar to path descriptions found in skylake-driver and they describe how given path shall look like in runtime - number of modules and pipelines that shape it and how they are laid out. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 99a15348d5842b3c1f95220dc9b119ee0fe0d81b Author: Cezary Rojewski Date: Thu Mar 31 15:52:33 2022 +0200 ASoC: Intel: avs: Declare vendor tokens Expose all vendor tokens that help shape AVS topology. Parsing helpers introduced in follow up patches make use of these to know which block they are currently dealing with and to verify their correctness. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220331135246.993089-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 03cf7262076f08601108cc896416fc1d66671994 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:17 2022 -0500 ASoC: SOF: Intel: add IP identifier This patch adds an IP identifier for each Intel platform. The identifier will be used to select different code branches or constants. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220414184817.362215-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b4e4c0b963c85072326222d7ea89078060aa824c Author: Ranjani Sridharan Date: Thu Apr 14 13:48:16 2022 -0500 ASoC: SOF: Intel: hda: expose some codeloader functions Expose the code loader functions for re-use in new platforms Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 71778f7940f0b496aa1ca1134f3b70b425a59bab Author: Ranjani Sridharan Date: Thu Apr 14 13:48:15 2022 -0500 ASoC: SOF: Intel: hda: Define rom_status_reg in sof_intel_dsp_desc Add the rom_status_reg field to struct sof_intel_dsp_desc and define it for HDA platforms. This will be used to check the ROM status during FW boot. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3dee239e02747a5d1447249ffb4a3c4425b9e302 Author: Ranjani Sridharan Date: Thu Apr 14 13:48:14 2022 -0500 ASoC: SOF: Intel: hda: define check_ipc_irq op Define the check_ipc_irq op for HDA platforms and use it when checking if it is an IPC IRQ. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9d201b69d04b89369240c1a7e279fda85cc94720 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:13 2022 -0500 ASoC: SOF: Intel: hda: use BIT() macros for consistency BIT() macros should be used for all ADSPIC/IS registers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220414184817.362215-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 406fed8092d96e3cd565d6041dc381d630039fe0 Author: Ranjani Sridharan Date: Thu Apr 14 13:48:12 2022 -0500 ASoC: SOF: Intel: move HDA_CL_STREAM_FORMAT definition to header Use the definition of the HDA_CL_STREAM_FORMAT macro from the header file. Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 37e809d5f8a7bfbf0abbd4666d0b8ad499f12b7f Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:11 2022 -0500 ASoC: SOF: Intel: hda: use common ops across platforms The dsp_ops are mostly common between platforms. Introduce a common structure and an init function to set platform-specific values. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220414184817.362215-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 856601e5a7ebe69b1c07adef7be80f9a03884329 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:10 2022 -0500 ASoC: SOF: remove const qualifier for 'struct snd_sof_dsp_ops' Now that we start having multiple platforms with minor variants, the use of the const qualifier for 'dsp_ops' is starting to be sub-optimal: the structures are copied across platforms, with only a couple of members that differ. This patch removes the const qualifier without any functionality changes, and adds an optional initialization callback. In follow-up patches, the dsp_ops will revisited for Intel HDaudio platforms, with the differences added programmatically over a common baseline. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220414184817.362215-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 53fe24c2c76383712bedee6a9e4ebe2ec595345b Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:09 2022 -0500 ASoC: SOF: sof-audio: preserve topology filename override in nocodec mode If the topology filename is modified at a higher level, be it with a DMI quirk or a kernel module parameter, we don't want to use the default 'nocodec' topology name extracted from descriptors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 772627acfeb0e670ede534b7d5502dae9668d3ee Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:08 2022 -0500 ASoC: SOF: sof-pci-dev: add parameter to override topology filename The existing 'tplg_path' module parameter can be used to load alternate firmware files, be it for development or to handle OEM-specific or board-specific releases. However the topology filename is either hard-coded in machine descriptors or modified by specific DMI-quirks. For additional flexibility, this patch adds the 'tplg_filename' module parameter to override topology names. To avoid any confusion between DMI- and parameter-override, a variable rename is added. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 58c520e2dad7c0abc52ce6b41b0793236398dc94 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:07 2022 -0500 ASoC: SOF: sof-pci-dev: add parameter to override firmware filename The existing 'fw_path' module parameter can be used to load alternate firmware files, be it for development or to handle OEM-specific or board-specific releases. The firmware name is however non-modifiable and defined by platform-specific descriptors. For additional flexibility during development or enable quirks, this patch adds the 'fw_filename' module parameter to override default firmware names. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a97abb3cae31b4e2420da96b95e54756333f2cc3 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:06 2022 -0500 ASoC: SOF: add IPC-dependent file names To avoid misleading file names, use different names for INTEL_IPC4 firmware files. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20220414184817.362215-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0cf8ff05e5d2b94b3ccf8a1fbfc633ecb0be56b0 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:05 2022 -0500 ASoC: SOF: add default IPC capability and file paths This patch adds a default IPC type for each platform, along with file paths to be used for each IPC type. To make reviews simpler, we only modify platform descriptors in this table, the information will be used in the next patch. The Intel IPCv4 is only supported on Intel platforms after APL, and not by default. In follow-up patches, support for SKL and KBL will be added, and in those two cases the IPCv4 will be the default (and only supported mode). Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a375791512254c154fd0d3e4091c78f4b92a5c66 Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:04 2022 -0500 ASoC: SOF: add path indirection to each IPC type With the addition of the IPCv4, we need the ability to select different paths for firmware and topologies. First add an indirection. Follow-up patches will add mechanisms to select a default IPC or override it. No functionality change in this patch. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 15527fee767f592d894d954d78cf8af3685cda6d Author: Pierre-Louis Bossart Date: Thu Apr 14 13:48:03 2022 -0500 ASoC: SOF: add definitions for different IPC types Add enum type to allow for different types of IPCs. The IPCv4 is intended for Intel only as a convergence path with firmware used in Windows. Follow-up patches will introduce different abstractions with .ops and different search paths for firmware and topology files. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220414184817.362215-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8b11c35d97946c51bfa2cafd0d0b07ee18f08349 Merge: a997157e42e31 38a6f0865796e Author: Paolo Abeni Date: Tue Apr 19 12:20:48 2022 +0200 Merge branch 'net-sched-allow-user-to-select-txqueue' Tonghao Zhang says: ==================== net: sched: allow user to select txqueue From: Tonghao Zhang Patch 1 allow user to select txqueue in clsact hook. Patch 2 support skbhash to select txqueue. ==================== Link: https://lore.kernel.org/r/20220415164046.26636-1-xiangxia.m.yue@gmail.com Signed-off-by: Paolo Abeni commit 38a6f0865796e26fc38fff4858f681d9ae76fa0f Author: Tonghao Zhang Date: Sat Apr 16 00:40:46 2022 +0800 net: sched: support hash selecting tx queue This patch allows users to pick queue_mapping, range from A to B. Then we can load balance packets from A to B tx queue. The range is an unsigned 16bit value in decimal format. $ tc filter ... action skbedit queue_mapping skbhash A B "skbedit queue_mapping QUEUE_MAPPING" (from "man 8 tc-skbedit") is enhanced with flags: SKBEDIT_F_TXQ_SKBHASH +----+ +----+ +----+ | P1 | | P2 | | Pn | +----+ +----+ +----+ | | | +-----------+-----------+ | | clsact/skbedit | MQ v +-----------+-----------+ | q0 | qn | qm v v v HTB/FQ FIFO ... FIFO For example: If P1 sends out packets to different Pods on other host, and we want distribute flows from qn - qm. Then we can use skb->hash as hash. setup commands: $ NETDEV=eth0 $ ip netns add n1 $ ip link add ipv1 link $NETDEV type ipvlan mode l2 $ ip link set ipv1 netns n1 $ ip netns exec n1 ifconfig ipv1 2.2.2.100/24 up $ tc qdisc add dev $NETDEV clsact $ tc filter add dev $NETDEV egress protocol ip prio 1 \ flower skip_hw src_ip 2.2.2.100 action skbedit queue_mapping skbhash 2 6 $ tc qdisc add dev $NETDEV handle 1: root mq $ tc qdisc add dev $NETDEV parent 1:1 handle 2: htb $ tc class add dev $NETDEV parent 2: classid 2:1 htb rate 100kbit $ tc class add dev $NETDEV parent 2: classid 2:2 htb rate 200kbit $ tc qdisc add dev $NETDEV parent 1:2 tbf rate 100mbit burst 100mb latency 1 $ tc qdisc add dev $NETDEV parent 1:3 pfifo $ tc qdisc add dev $NETDEV parent 1:4 pfifo $ tc qdisc add dev $NETDEV parent 1:5 pfifo $ tc qdisc add dev $NETDEV parent 1:6 pfifo $ tc qdisc add dev $NETDEV parent 1:7 pfifo $ ip netns exec n1 iperf3 -c 2.2.2.1 -i 1 -t 10 -P 10 pick txqueue from 2 - 6: $ ethtool -S $NETDEV | grep -i tx_queue_[0-9]_bytes tx_queue_0_bytes: 42 tx_queue_1_bytes: 0 tx_queue_2_bytes: 11442586444 tx_queue_3_bytes: 7383615334 tx_queue_4_bytes: 3981365579 tx_queue_5_bytes: 3983235051 tx_queue_6_bytes: 6706236461 tx_queue_7_bytes: 42 tx_queue_8_bytes: 0 tx_queue_9_bytes: 0 txqueues 2 - 6 are mapped to classid 1:3 - 1:7 $ tc -s class show dev $NETDEV ... class mq 1:3 root leaf 8002: Sent 11949133672 bytes 7929798 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq 1:4 root leaf 8003: Sent 7710449050 bytes 5117279 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq 1:5 root leaf 8004: Sent 4157648675 bytes 2758990 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq 1:6 root leaf 8005: Sent 4159632195 bytes 2759990 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq 1:7 root leaf 8006: Sent 7003169603 bytes 4646912 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 ... Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Jonathan Lemon Cc: Eric Dumazet Cc: Alexander Lobakin Cc: Paolo Abeni Cc: Talal Ahmad Cc: Kevin Hao Cc: Ilias Apalodimas Cc: Kees Cook Cc: Kumar Kartikeya Dwivedi Cc: Antoine Tenart Cc: Wei Wang Cc: Arnd Bergmann Signed-off-by: Tonghao Zhang Reviewed-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit 2f1e85b1aee459b7d0fd981839042c6a38ffaf0c Author: Tonghao Zhang Date: Sat Apr 16 00:40:45 2022 +0800 net: sched: use queue_mapping to pick tx queue This patch fixes issue: * If we install tc filters with act_skbedit in clsact hook. It doesn't work, because netdev_core_pick_tx() overwrites queue_mapping. $ tc filter ... action skbedit queue_mapping 1 And this patch is useful: * We can use FQ + EDT to implement efficient policies. Tx queues are picked by xps, ndo_select_queue of netdev driver, or skb hash in netdev_core_pick_tx(). In fact, the netdev driver, and skb hash are _not_ under control. xps uses the CPUs map to select Tx queues, but we can't figure out which task_struct of pod/containter running on this cpu in most case. We can use clsact filters to classify one pod/container traffic to one Tx queue. Why ? In containter networking environment, there are two kinds of pod/ containter/net-namespace. One kind (e.g. P1, P2), the high throughput is key in these applications. But avoid running out of network resource, the outbound traffic of these pods is limited, using or sharing one dedicated Tx queues assigned HTB/TBF/FQ Qdisc. Other kind of pods (e.g. Pn), the low latency of data access is key. And the traffic is not limited. Pods use or share other dedicated Tx queues assigned FIFO Qdisc. This choice provides two benefits. First, contention on the HTB/FQ Qdisc lock is significantly reduced since fewer CPUs contend for the same queue. More importantly, Qdisc contention can be eliminated completely if each CPU has its own FIFO Qdisc for the second kind of pods. There must be a mechanism in place to support classifying traffic based on pods/container to different Tx queues. Note that clsact is outside of Qdisc while Qdisc can run a classifier to select a sub-queue under the lock. In general recording the decision in the skb seems a little heavy handed. This patch introduces a per-CPU variable, suggested by Eric. The xmit.skip_txqueue flag is firstly cleared in __dev_queue_xmit(). - Tx Qdisc may install that skbedit actions, then xmit.skip_txqueue flag is set in qdisc->enqueue() though tx queue has been selected in netdev_tx_queue_mapping() or netdev_core_pick_tx(). That flag is cleared firstly in __dev_queue_xmit(), is useful: - Avoid picking Tx queue with netdev_tx_queue_mapping() in next netdev in such case: eth0 macvlan - eth0.3 vlan - eth0 ixgbe-phy: For example, eth0, macvlan in pod, which root Qdisc install skbedit queue_mapping, send packets to eth0.3, vlan in host. In __dev_queue_xmit() of eth0.3, clear the flag, does not select tx queue according to skb->queue_mapping because there is no filters in clsact or tx Qdisc of this netdev. Same action taked in eth0, ixgbe in Host. - Avoid picking Tx queue for next packet. If we set xmit.skip_txqueue in tx Qdisc (qdisc->enqueue()), the proper way to clear it is clearing it in __dev_queue_xmit when processing next packets. For performance reasons, use the static key. If user does not config the NET_EGRESS, the patch will not be compiled. +----+ +----+ +----+ | P1 | | P2 | | Pn | +----+ +----+ +----+ | | | +-----------+-----------+ | | clsact/skbedit | MQ v +-----------+-----------+ | q0 | q1 | qn v v v HTB/FQ HTB/FQ ... FIFO Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Jonathan Lemon Cc: Eric Dumazet Cc: Alexander Lobakin Cc: Paolo Abeni Cc: Talal Ahmad Cc: Kevin Hao Cc: Ilias Apalodimas Cc: Kees Cook Cc: Kumar Kartikeya Dwivedi Cc: Antoine Tenart Cc: Wei Wang Cc: Arnd Bergmann Suggested-by: Eric Dumazet Signed-off-by: Tonghao Zhang Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit 65b96377bf9130617ced41f317f3ec387d3e0dc3 Author: Krzysztof Kozlowski Date: Tue Apr 19 12:03:57 2022 +0200 arm64: dts: hisilicon: align 'freq-table-hz' with dtschema in UFS The DT schema expects 'freq-table-hz' property to be an uint32-matrix, which is also easier to read. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220306111125.116455-10-krzysztof.kozlowski@canonical.com commit ad2df24732e8956a45a00894d2163c4ee8fb0e1f Author: Tyler Hicks Date: Tue Jan 11 10:38:00 2022 -0600 EDAC/dmc520: Don't print an error for each unconfigured interrupt line The dmc520 driver requires that at least one interrupt line, out of the ten possible, is configured. The driver prints an error and returns -EINVAL from its .probe function if there are no interrupt lines configured. Don't print a KERN_ERR level message for each interrupt line that's unconfigured as that can confuse users into thinking that there is an error condition. Before this change, the following KERN_ERR level messages would be reported if only dram_ecc_errc and dram_ecc_errd were configured in the device tree: dmc520 68000000.dmc: IRQ ram_ecc_errc not found dmc520 68000000.dmc: IRQ ram_ecc_errd not found dmc520 68000000.dmc: IRQ failed_access not found dmc520 68000000.dmc: IRQ failed_prog not found dmc520 68000000.dmc: IRQ link_err not dmc520 68000000.dmc: IRQ temperature_event not found dmc520 68000000.dmc: IRQ arch_fsm not found dmc520 68000000.dmc: IRQ phy_request not found Fixes: 1088750d7839 ("EDAC: Add EDAC driver for DMC520") Reported-by: Sinan Kaya Signed-off-by: Tyler Hicks Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220111163800.22362-1-tyhicks@linux.microsoft.com commit dcc1449554ba8e49880507c7b761559022363bdd Author: Geert Uytterhoeven Date: Thu Apr 14 16:44:07 2022 +0200 ARM: shmobile: defconfig: Refresh for v5.18-rc1 Refresh the defconfig for Renesas ARM systems: - Move CONFIG_V4L_MEM2MEM_DRIVERS (moved in commit 256bf685691d8646 ("media: platform: move platform menu dependencies to drivers")), - Move CONFIG_DEBUG_FS (moved in commit f9b3cd24578401e7 ("Kconfig.debug: make DEBUG_INFO selectable from a choice")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/922ba60d81a71acfae5d88c1991d8c96bb2b3527.1649947421.git.geert+renesas@glider.be commit 40f150937c8148d52ef0927627a25c95d717a8a0 Author: Geert Uytterhoeven Date: Thu Apr 14 16:45:52 2022 +0200 arm64: defconfig: Enable Maxim MAX96712 Quad GMSL2 Deserializer support Increase build and test coverage by enabling modular support for the Maxim MAX96712 Quad GMSL2 Deserializer, as used on the Renesas Falcon board. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7b5ea7eaabc1da79fd974f9d9845a5a527f2fb14.1649947458.git.geert+renesas@glider.be commit aa70cbda745d5d2085f2847b875d0da3173a9032 Author: Geert Uytterhoeven Date: Mon Apr 11 14:32:44 2022 +0200 ARM: dts: r9a06g032: Drop "arm,cortex-a7-timer" from timer node "make dtbs_check": arch/arm/boot/dts/r9a06g032-rzn1d400-db.dt.yaml: timer: compatible: 'oneOf' conditional failed, one must be fixed: ['arm,cortex-a7-timer', 'arm,armv7-timer'] is too long 'arm,cortex-a7-timer' is not one of ['arm,cortex-a15-timer'] 'arm,cortex-a7-timer' is not one of ['arm,armv7-timer'] 'arm,cortex-a7-timer' is not one of ['arm,armv8-timer'] From schema: Documentation/devicetree/bindings/timer/arm,arch_timer.yaml The Cortex-A7 timer should just declare compatibility with "arm,armv7-timer". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a8e0cf00a983b4c539cdb1cfad5cc6b10b423c5b.1649680220.git.geert+renesas@glider.be commit 8ba8560d4ff1b1b2000aaed5500c56bfd3dfd69c Author: Geert Uytterhoeven Date: Mon Apr 4 17:35:32 2022 +0200 arm64: dts: renesas: r8a779f0: Add GPIO nodes Add device nodes for the General Purpose Input/Output (GPIO) blocks on the Renesas R-Car S4-8 (R8A779F0) SoC. Note that GPIO blocks 4-7 are not added, as they can only be accessed from the Control Domain. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7fb68561026fa8bb5d9baf0596560c5c719a38cc.1649086225.git.geert+renesas@glider.be commit 74273035c7e486fa046ee7f80fbdb9c19169ef19 Author: Biju Das Date: Tue Mar 15 15:27:16 2022 +0000 dt-bindings: pinctrl: renesas: Document RZ/G2UL pinctrl Document Renesas RZ/G2UL pinctrl bindings. RZ/G2UL GPIO block is almost identical to RZ/G2L and has lesser pins compared to RZ/G2L. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220315152717.20045-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 29af63443003afd41ce3b0e039ae97f0a09a87b8 Author: Geert Uytterhoeven Date: Mon Feb 21 17:24:19 2022 +0100 pinctrl: renesas: Simplify multiplication/shift logic "a * (1 << b)" == "a << b". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/31eaa3226c61ecf653e2b031307eea42a9a3d54e.1645460548.git.geert+renesas@glider.be commit 9d2d0a5cf0ca063f417681cc33e767ce52615286 Author: Mika Westerberg Date: Fri Apr 1 17:24:28 2022 +0300 thunderbolt: Use different lane for second DisplayPort tunnel Brad reported that on Apple hardware with Light Ridge or Falcon Ridge controller, plugging in a chain of Thunderbolt displays (Light Ridge based controllers) causes all kinds of tearing and flickering. The reason for this is that on Thunderbolt 1 hardware there is no lane bonding so we have two independent 10 Gb/s lanes, and currently Linux tunnels both displays through the lane 1. This makes the displays to share the 10 Gb/s bandwidth which may not be enough for higher resolutions. For this reason make the second tunnel go through the lane 0 instead. This seems to match what the macOS connection manager is also doing. Reported-by: Brad Campbell Signed-off-by: Mika Westerberg Tested-by: Brad Campbell commit 259e0c71e552557294d4820c840f62185e135c3a Author: Mika Westerberg Date: Thu Mar 31 18:21:24 2022 +0300 thunderbolt: Dump path config space entries during discovery This is useful when debugging possible issues during tunnel discovery. Signed-off-by: Mika Westerberg Tested-by: Brad Campbell commit ebe99c0f297dfc0f349f54dae850b83985539de5 Author: Mika Westerberg Date: Fri Apr 1 13:36:47 2022 +0300 thunderbolt: Use decimal number with port numbers This makes it consistent with the other logging functions. Signed-off-by: Mika Westerberg Tested-by: Brad Campbell commit ca319f5565193b7c51533852083ab44837eb2709 Author: Mika Westerberg Date: Thu Jan 20 17:23:04 2022 +0200 thunderbolt: Fix typo in comment Should be 'in' instead of 'bin'. Fix it. Signed-off-by: Mika Westerberg Tested-by: Brad Campbell commit 2324257dbd6889638c6cba1ade9eeac3224e2043 Author: Mykola Lysenko Date: Mon Apr 18 15:25:07 2022 -0700 selftests/bpf: Refactor prog_tests logging and test execution This is a pre-req to add separate logging for each subtest in test_progs. Move all the mutable test data to the test_result struct. Move per-test init/de-init into the run_one_test function. Consolidate data aggregation and final log output in calculate_and_print_summary function. As a side effect, this patch fixes double counting of errors for subtests and possible duplicate output of subtest log on failures. Also, add prog_tests_framework.c test to verify some of the counting logic. As part of verification, confirmed that number of reported tests is the same before and after the change for both parallel and sequential test execution. Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220418222507.1726259-1-mykolal@fb.com commit 57b888ca2541785de2fcb90575b378921919b6c0 Author: Guenter Roeck Date: Fri Mar 18 09:54:22 2022 -0700 platform/chrome: Re-introduce cros_ec_cmd_xfer and use it for ioctls Commit 413dda8f2c6f ("platform/chrome: cros_ec_chardev: Use cros_ec_cmd_xfer_status helper") inadvertendly changed the userspace ABI. Previously, cros_ec ioctls would only report errors if the EC communication failed, and otherwise return success and the result of the EC communication. An EC command execution failure was reported in the EC response field. The above mentioned commit changed this behavior, and the ioctl itself would fail. This breaks userspace commands trying to analyze the EC command execution error since the actual EC command response is no longer reported to userspace. Fix the problem by re-introducing the cros_ec_cmd_xfer() helper, and use it to handle ioctl messages. Fixes: 413dda8f2c6f ("platform/chrome: cros_ec_chardev: Use cros_ec_cmd_xfer_status helper") Cc: Daisuke Nojiri Cc: Rob Barnes Cc: Rajat Jain Cc: Brian Norris Cc: Parth Malkan Reviewed-by: Daisuke Nojiri Reviewed-by: Brian Norris Signed-off-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih commit f9bdac31cf4b8609c1b241749b0ceb8f67c8685b Author: Sumit Saxena Date: Thu Apr 14 06:36:01 2022 -0400 scsi: core: Increase max device queue_depth to 4096 The maximum SCSI device queue depth of 1024 is not sufficient for RAID volumes configured behind Broadcom RAID controllers. For a 16-drive RAID volume with a device queue depth limit of 1024, only 64 I/Os (1024/16) can be issued per drive. That is not sufficient to saturate the device. Link: https://lore.kernel.org/r/20220414103601.140687-1-sumit.saxena@broadcom.com Cc: Ming Lei Cc: Hannes Reinecke Cc: Bart Van Assche Cc: Sumanesh Samanta Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit 65db22e505c4f3d13f588775844074bee5e93163 Author: Yihao Han Date: Fri Apr 8 01:12:37 2022 -0700 scsi: fcoe: Simplify if-if to if-else Replace 'if (!is_zero_ether_addr(mac))' with 'else' for simplification and add curly brackets according to the kernel coding style: "Do not unnecessarily use braces where a single statement will do." ... "This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches" Please refer to: https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html Link: https://lore.kernel.org/r/20220408081237.14037-1-hanyihao@vivo.com Signed-off-by: Yihao Han Signed-off-by: Martin K. Petersen commit 21a023ce397ba1959d342b1087216655abc2ba49 Author: Jiapeng Chong Date: Fri Apr 1 11:06:40 2022 +0800 scsi: pmcraid: Remove unneeded semicolon Fix the following coccicheck warning: ./drivers/scsi/pmcraid.c:4593:2-3: Unneeded semicolon. Link: https://lore.kernel.org/r/20220401030640.28246-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Martin K. Petersen commit 66c20a97367a6a9254af7cf863271d55a731a4a0 Author: James Smart Date: Tue Apr 12 15:20:08 2022 -0700 scsi: lpfc: Copyright updates for 14.2.0.2 patches Update copyrights to 2022 for files modified in the 14.2.0.2 patch set. Link: https://lore.kernel.org/r/20220412222008.126521-27-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 4af4d0e2ea942a7f141fec51bde224fcb8c551a1 Author: James Smart Date: Tue Apr 12 15:20:07 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.2 Update lpfc version to 14.2.0.2. Link: https://lore.kernel.org/r/20220412222008.126521-26-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit fd4a0c6da5c12aa881b933fb4e426cb706fc2c01 Author: James Smart Date: Tue Apr 12 15:20:06 2022 -0700 scsi: lpfc: Expand setting ELS_ID field in ELS_REQUEST64_WQE ELS_ID field for ELS_REQUEST64_WQE is not filled out when FIP is not supported by the HBA. Move setting ELS_ID logic into __lpfc_sli_prep_els_req_rsp_s4(), and remove ELS_ID FIP dependency logic from lpfc_sli_prep_wqe(). Introduce PLOGI ELS_ID and as a result update wqe_els_id_MASK because PLOGI ELS_ID = 0x4 occupies up to 3 bits. While in __lpfc_sli_prep_els_req_rsp_s4() routine, remove SLI3-isms. Link: https://lore.kernel.org/r/20220412222008.126521-25-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit f4fbf4acaa503a8509337572d0c10e5fa4309bc9 Author: James Smart Date: Tue Apr 12 15:20:05 2022 -0700 scsi: lpfc: Update stat accounting for READ_STATUS mbox command READ_STATUS tx/rx byte count fields are now expanded to 64 bit wide counters. This patch updates logic for the READ_STATUS mbox command when displaying tx_word and rx_word statistics in sysfs. Link: https://lore.kernel.org/r/20220412222008.126521-24-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1b6f71f7fcb685970aa1c4ecca3dd60ed37a32ea Author: James Smart Date: Tue Apr 12 15:20:04 2022 -0700 scsi: lpfc: Change FA-PWWN detection methodology Do not rely on vendor version field of the CSPs to determine if we are in a FA-PWWN environment. Instead, use the following procedure: First, during HBA initialization, driver does a READ_CONFIG to determine if FA-PWWN is configured on the HBA. A LPFC_FAWWPN_CONFIG hba_flag is set accordingly. Next, when the link comes up before the driver gets a link up event, the firmware logs into the fabric with FA-PWWN. If the fabric port does not support FA-PWWN, the driver will get a Misconfigured FA-WWN async event before the link up. A LPFC_FAWWPN_FABRIC hba_flag will be set accordingly. Finally, if the fabric supports FA-PWWN, the firmware will replace its CSPs WWN with the Fabric Assigned ones. Then after link up, the driver will retrieve the Fabric Assigned WWN when it does a READ_SPARAM mbox command. Link: https://lore.kernel.org/r/20220412222008.126521-23-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit ef47575fd982c7ed1993fbe104909722afa1994b Author: James Smart Date: Tue Apr 12 15:20:03 2022 -0700 scsi: lpfc: Refactor cleanup of mailbox commands The intention of this patch is to refactor mailbox memory allocation and cleanup steps in one routine respectively to prevent memory leaks or memory errors related to mailbox commands. There are trivial localized fixes as well. Provide lpfc_mbox_rsrc_prep() - this routine allocates the dmabuf and the mbuf associated with it. It also catches allocation errors and returns status. Provide lpfc_mbox_rsrc_cleanup() - this routine verifies a dmabuf exists and if so releases the associated mbuf and the dmabuf memory. It then sets the ctx_buf to NULL and releases the mailbox memory to the mailbox pool. Link: https://lore.kernel.org/r/20220412222008.126521-22-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d51cf5bd926c7d00bd8a77fc39db73766fbf2a27 Author: James Smart Date: Tue Apr 12 15:20:02 2022 -0700 scsi: lpfc: Fix field overload in lpfc_iocbq data structure The lpfc_iocbq data structure has void * pointers that are overloaded to be as many as 8 different data types and the driver translates the void * by casting. This patch removes the void * pointers by declaring the specific types needed by the driver. It also expands the context_un to include more seldom used pointer types to save structure bytes. It also groups the u8 types together to pack the 8 bytes needed. This work allows the lpfc_iocbq data structure to be more strongly typed and keeps it from being allocated from the 512 byte slab. [mkp: rolled in zeroday fix] Link: https://lore.kernel.org/r/20220412222008.126521-21-jsmart2021@gmail.com Reported-by: kernel test robot Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1045592fc968fe1e4b360b3bce2e9b522f173cdc Author: James Smart Date: Tue Apr 12 15:20:01 2022 -0700 scsi: lpfc: Introduce FC_RSCN_MEMENTO flag for tracking post RSCN completion During an NVMe target reboot, the target may initialize itself as FCP only during the first RSCN and shortly after trigger a second RSCN claiming NVMe support. The timing of these RSCNs occur before FCP-PRLI for the first RSCN completes leading discovery issues over NVMe. Change RSCN and NVME-PRLI send logic based on a new FC_RSCN_MEMENTO flag that signals when lpfc_end_rscn() is completed and serves as a memento that discovery was started from RSCN. Link: https://lore.kernel.org/r/20220412222008.126521-20-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6c983d327b9e628923916f9780bb0d107740d76b Author: James Smart Date: Tue Apr 12 15:20:00 2022 -0700 scsi: lpfc: Register for Application Services FC-4 type in Fabric topology Add new FC-4 type 0x60 Application Services for fabric registration when VMID is enabled. Modified rft struture to indicate __be format. Removed redundant ipReg variable as it was not used. Link: https://lore.kernel.org/r/20220412222008.126521-19-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6c8a3ce64b2cb36e4006a61533aedc998723b41b Author: James Smart Date: Tue Apr 12 15:19:59 2022 -0700 scsi: lpfc: Remove false FDMI NVMe FC-4 support for NPIV ports FDMI FC-4 Active Type for vports mistakenly shows NVMe support. Add a check to only set the NVMe support bit for the physical port. Link: https://lore.kernel.org/r/20220412222008.126521-18-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit c364c453d30a07e5f8b97481cbe346df075c3e13 Author: James Smart Date: Tue Apr 12 15:19:58 2022 -0700 scsi: lpfc: Revise FDMI reporting of supported port speed for trunk groups Trunk port FDMI supported port speed shows single port supported speed rather than the trunked port speed. Modify supported port speed logic calculation during registration. Link: https://lore.kernel.org/r/20220412222008.126521-17-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d6d45f67a11136cb88a70a29ab22ea6db8ae6bd5 Author: James Smart Date: Tue Apr 12 15:19:57 2022 -0700 scsi: lpfc: Fix call trace observed during I/O with CMF enabled The following was seen with CMF enabled: BUG: using smp_processor_id() in preemptible code: systemd-udevd/31711 kernel: caller is lpfc_update_cmf_cmd+0x214/0x420 [lpfc] kernel: CPU: 12 PID: 31711 Comm: systemd-udevd kernel: Call Trace: kernel: kernel: dump_stack_lvl+0x44/0x57 kernel: check_preemption_disabled+0xbf/0xe0 kernel: lpfc_update_cmf_cmd+0x214/0x420 [lpfc] kernel: lpfc_nvme_fcp_io_submit+0x23b4/0x4df0 [lpfc] this_cpu_ptr() calls smp_processor_id() in a preemptible context. Fix by using per_cpu_ptr() with raw_smp_processor_id() instead. Link: https://lore.kernel.org/r/20220412222008.126521-16-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5295d19d4f97d66d88cea26ff3ef779a37264134 Author: James Smart Date: Tue Apr 12 15:19:56 2022 -0700 scsi: lpfc: Correct CRC32 calculation for congestion stats lpfc_cgn_calc_crc32() is returning 32 bits, and lpfc_cgn_update_stat() was using u16 to store the crc32 value. Correct by redeclaring the local variable to u32. Link: https://lore.kernel.org/r/20220412222008.126521-15-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 39a1a86b9da22738f45460b50938515de8b9e48e Author: James Smart Date: Tue Apr 12 15:19:55 2022 -0700 scsi: lpfc: Move MI module parameter check to handle dynamic disable lpfc_refresh_params() can be called for an async event handler. This could potentially override the value initialized by lpfc_cmf_setup(). Move module parameter check to lpfc_refresh_params(). Link: https://lore.kernel.org/r/20220412222008.126521-14-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit d531d9874da85e36fc99ce75175ed47c9c360c20 Author: James Smart Date: Tue Apr 12 15:19:54 2022 -0700 scsi: lpfc: Remove unnecessary NULL pointer assignment for ELS_RDF path The command IOCB ndlp pointer is overwritten in lpfc_issue_els_rdf(), and the original ndlp pointer is stored ahead of time. This null ptr assignment can be safely removed. Link: https://lore.kernel.org/r/20220412222008.126521-13-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 76395c88d0afb82c9bec87e99e282c4ff11ea5f4 Author: James Smart Date: Tue Apr 12 15:19:53 2022 -0700 scsi: lpfc: Transition to NPR state upon LOGO cmpl if link down or aborted In P2P topology, a target controller reboot sometimes results in not reestablishing a login because the ndlp is stuck in LOGO state. Fix by transitioning to NPR state if we get link down before LOGO completes. Link: https://lore.kernel.org/r/20220412222008.126521-12-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 31e887864eb2c0cce3d0c448a7b1ef9792e850b7 Author: James Smart Date: Tue Apr 12 15:19:52 2022 -0700 scsi: lpfc: Update fc_prli_sent outstanding only after guaranteed IOCB submit If lpfc_sli_issue_iocb() fails, then the fc_prli_sent is never decremented. Move the fc_prli_sent++ to after a guaranteed IOCB submit. Link: https://lore.kernel.org/r/20220412222008.126521-11-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 672d1cb40551ea9c95efad43ab6d45e4ab4e015f Author: James Smart Date: Tue Apr 12 15:19:51 2022 -0700 scsi: lpfc: Protect memory leak for NPIV ports sending PLOGI_RJT There is a potential memory leak in lpfc_ignore_els_cmpl() and lpfc_els_rsp_reject() that was allocated from NPIV PLOGI_RJT (lpfc_rcv_plogi()'s login_mbox). Check if cmdiocb->context_un.mbox was allocated in lpfc_ignore_els_cmpl(), and then free it back to phba->mbox_mem_pool along with mbox->ctx_buf for service parameters. For lpfc_els_rsp_reject() failure, free both the ctx_buf for service parameters and the login_mbox. Link: https://lore.kernel.org/r/20220412222008.126521-10-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 577a942df3de2666f6947bdd3a5c9e8d30073424 Author: James Smart Date: Tue Apr 12 15:19:50 2022 -0700 scsi: lpfc: Fix null pointer dereference after failing to issue FLOGI and PLOGI If lpfc_issue_els_flogi() fails and returns non-zero status, the node reference count is decremented to trigger the release of the nodelist structure. However, if there is a prior registration or dev-loss-evt work pending, the node may be released prematurely. When dev-loss-evt completes, the released node is referenced causing a use-after-free null pointer dereference. Similarly, when processing non-zero ELS PLOGI completion status in lpfc_cmpl_els_plogi(), the ndlp flags are checked for a transport registration before triggering node removal. If dev-loss-evt work is pending, the node may be released prematurely and a subsequent call to lpfc_dev_loss_tmo_handler() results in a use after free ndlp dereference. Add test for pending dev-loss before decrementing the node reference count for FLOGI, PLOGI, PRLI, and ADISC handling. Link: https://lore.kernel.org/r/20220412222008.126521-9-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 3483a44bdfb475432081a27b38ea7fb8305814af Author: James Smart Date: Tue Apr 12 15:19:49 2022 -0700 scsi: lpfc: Clear fabric topology flag before initiating a new FLOGI Previous topologies may no longer be in fabric mode, so clear FC_FABRIC in fc_flag for every new FLOGI. Link: https://lore.kernel.org/r/20220412222008.126521-8-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 03cbbd7c2f5ee288f648f4aeedc765a181188553 Author: James Smart Date: Tue Apr 12 15:19:48 2022 -0700 scsi: lpfc: Fix SCSI I/O completion and abort handler deadlock During stress I/O tests with 500+ vports, hard LOCKUP call traces are observed. CPU A: native_queued_spin_lock_slowpath+0x192 _raw_spin_lock_irqsave+0x32 lpfc_handle_fcp_err+0x4c6 lpfc_fcp_io_cmd_wqe_cmpl+0x964 lpfc_sli4_fp_handle_cqe+0x266 __lpfc_sli4_process_cq+0x105 __lpfc_sli4_hba_process_cq+0x3c lpfc_cq_poll_hdler+0x16 irq_poll_softirq+0x76 __softirqentry_text_start+0xe4 irq_exit+0xf7 do_IRQ+0x7f CPU B: native_queued_spin_lock_slowpath+0x5b _raw_spin_lock+0x1c lpfc_abort_handler+0x13e scmd_eh_abort_handler+0x85 process_one_work+0x1a7 worker_thread+0x30 kthread+0x112 ret_from_fork+0x1f Diagram of lockup: CPUA CPUB ---- ---- lpfc_cmd->buf_lock phba->hbalock lpfc_cmd->buf_lock phba->hbalock Fix by reordering the taking of the lpfc_cmd->buf_lock and phba->hbalock in lpfc_abort_handler routine so that it tries to take the lpfc_cmd->buf_lock first before phba->hbalock. Link: https://lore.kernel.org/r/20220412222008.126521-7-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b6474465e962369c1cd4b00324c2e175e2cf30cf Author: James Smart Date: Tue Apr 12 15:19:47 2022 -0700 scsi: lpfc: Requeue SCSI I/O to upper layer when fw reports link down During heavy I/O stress tests with 100+ vports and cable pulls, it may take a while before the vport logs back into the fabric to resume I/O. Currently, the driver immediately fails the I/O with DID_ERROR. Change behavior to return DID_REQUEUE, and rely on SCSI layer's max retry of 5 before erroring out the I/O. Link: https://lore.kernel.org/r/20220412222008.126521-6-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 787d0580ca181d254f4dfd8b281cbea31120bde3 Author: James Smart Date: Tue Apr 12 15:19:46 2022 -0700 scsi: lpfc: Zero SLI4 fcp_cmnd buffer's fcpCntl0 field It's possible that the fcpCntl0 reserved field is allocated non-zero. For certain target storage arrays this could cause problems expecting reserved fields to be all zero. SLI3 path already allocates fcp_cmnd buffer with dma_pool_zalloc() in lpfc_new_scsi_buf_s3. The fcpCntl0 field itself is never proactively set throughout the SCSI I/O path. Thus, we only change the SLI4 fcp_cmnd buffer allocation to dma_pool_zalloc. Link: https://lore.kernel.org/r/20220412222008.126521-5-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit a6de9a2fa0d67ac33ce398333e7398ae24c7af2a Author: James Smart Date: Tue Apr 12 15:19:45 2022 -0700 scsi: lpfc: Fix diagnostic fw logging after a function reset The lpfc_sli4_ras_setup() routine is only called from the lpfc_pci_probe_one_s4() routine, which means diagnostic fw logging initialization only occurs during probing. Thus, any path involving a reset of the HBA that restarts the state of the SLI port does not reinitialize diagnostic fw logging. Move lpfc_sli4_ras_setup() into lpfc_sli4_hba_setup() so that the LOWLEVEL_SET_DIAG_LOG_OPTIONS mailbox command can be sent after a function reset. Link: https://lore.kernel.org/r/20220412222008.126521-4-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit e294647b1aed4247fe52851f3a3b2b19ae906228 Author: James Smart Date: Tue Apr 12 15:19:44 2022 -0700 scsi: lpfc: Move cfg_log_verbose check before calling lpfc_dmp_dbg() In an attempt to log message 0126 with LOG_TRACE_EVENT, the following hard lockup call trace hangs the system. Call Trace: _raw_spin_lock_irqsave+0x32/0x40 lpfc_dmp_dbg.part.32+0x28/0x220 [lpfc] lpfc_cmpl_els_fdisc+0x145/0x460 [lpfc] lpfc_sli_cancel_jobs+0x92/0xd0 [lpfc] lpfc_els_flush_cmd+0x43c/0x670 [lpfc] lpfc_els_flush_all_cmd+0x37/0x60 [lpfc] lpfc_sli4_async_event_proc+0x956/0x1720 [lpfc] lpfc_do_work+0x1485/0x1d70 [lpfc] kthread+0x112/0x130 ret_from_fork+0x1f/0x40 Kernel panic - not syncing: Hard LOCKUP The same CPU tries to claim the phba->port_list_lock twice. Move the cfg_log_verbose checks as part of the lpfc_printf_vlog() and lpfc_printf_log() macros before calling lpfc_dmp_dbg(). There is no need to take the phba->port_list_lock within lpfc_dmp_dbg(). Link: https://lore.kernel.org/r/20220412222008.126521-3-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit b83a8c21f3fe874e12eb2b6e6c5cfb220d35c446 Author: James Smart Date: Tue Apr 12 15:19:43 2022 -0700 scsi: lpfc: Tweak message log categories for ELS/FDMI/NVMe rescan Several log message categories were updated: - Enable msg 4623 (Xmit of ECD) to display for ELS logging. - Change msg 0220 (FDMI cmd failed) to display for ELS logging. - Change msg 6460 (FDMI RPA failure) to be warning not hard error. - Change msg 6172 (NVME rescan of DID) to be logged under NVMe discovery. Link: https://lore.kernel.org/r/20220412222008.126521-2-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 08c84a75ddf340acf14bb04021045fe5bbdccc93 Merge: 25a0bf213b8a5 70a3baeec4e89 Author: Martin K. Petersen Date: Mon Apr 18 22:46:38 2022 -0400 Merge branch '5.18/scsi-fixes' into 5.19/scsi-staging Pull in 5.18 fixes branch which contains a bunch of fixes required for the lpfc driver update. Signed-off-by: Martin K. Petersen commit 25a0bf213b8a563c5244326ae992456e8c9bb373 Author: Po-Wen Kao Date: Tue Apr 12 15:31:28 2022 +0800 scsi: ufs: core: Remove redundant HPB unmap Since the HPB mapping is already reset in ufshpb_init() by setting flag QUERY_FLAG_IDN_HPB_RESET, there is no need doing so again in ufshpb_hpb_lu_prepared(). This also resolves the issue where HPB WRITE BUFFER is issued before UAC is cleared. Link: https://lore.kernel.org/r/20220412073131.10644-1-powen.kao@mediatek.com Acked-by: Bean Huo Signed-off-by: Po-Wen Kao Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit e66f62acc42d8f7a938b6f92e1feb065f2bb63cb Author: Max Krummenacher Date: Mon Apr 11 17:22:33 2022 +0200 ARM: dts: imx6dl-colibri: Add support for Toradex Aster carrier board Add support for Toradex Aster, small form-factor with header compatible with Arduino Uno and Raspberry Pi (RPi) maker boards. Additional detail available at https://www.toradex.com/products/carrier-boards/aster-carrier-board Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 1b6e37fe919fe5174ed0f49b4bd51dd2c663a025 Author: Max Krummenacher Date: Mon Apr 11 17:22:32 2022 +0200 ARM: dts: imx6dl-colibri: Add support for Toradex Iris carrier boards Add support for Toradex Iris, small form-factor Pico-ITX Colibri Arm Computer Module family Carrier Board. Additional details available at https://www.toradex.com/products/carrier-board/iris-carrier-board Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 6cc75a081d757857a4803c1139c08837ef535c67 Author: Max Krummenacher Date: Mon Apr 11 17:22:31 2022 +0200 ARM: dts: imx6dl-colibri: Add usdhc1 sleep pin configuration The Toradex board Iris V2 has a SD-card slot with switchable power. Add a pinctrl sleep used when the card power is off to avoid backfeeding to the card and add the "sleep" pinctrl to the usdhc1 controller. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 965f2ca42cbd59053f93d67587c4055e994680c4 Author: Max Krummenacher Date: Mon Apr 11 17:22:30 2022 +0200 ARM: dts: imx6dl-colibri: Cleanup - Sort pinctrl nodes alphabetically - End all pinctrl node names in grp and avoid using dashes - Change pinctrl_usbc_id_1's node name to not use underscores - Change the pmic's node name to pmic@8 per binding requirement - Add sound-dai-cells to the codec node per binding requirement Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 1524b27c94a63713fabb53542cca2e23384f79c3 Author: Max Krummenacher Date: Mon Apr 11 17:22:29 2022 +0200 ARM: dts: imx6dl-colibri: Move common nodes to SoM dtsi The following two nodes define module level functionality, move them from the carrier board dts file to the SoM file. While at it, reorder the properties in the gpio-keys node alphabetical. - gpio-keys defining the wakeup pin - memory node The atmel touchscreen node can be used on any carrier board. Move it from the carrier board to the module-level device tree and keep it disabled. Set the default pinmuxing to the dedicated connector available on newer carrier boards and rename the pinctrl labels specifying the INT/Reset signal to a common pattern. pinctrl_atmel_conn - uses 107/106 pins as used on dedicated connector pinctrl_atmel_adap - uses 28/30 pins as used with jumper wires Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit bccf73ecd098570e98177e654371542667e32cd8 Author: Max Krummenacher Date: Mon Apr 11 17:22:28 2022 +0200 ARM: dts: imx6dl-colibri: Add additional pingroups The Toradex board Iris V2 has an LVDS transceiver which is configured with 4 signals. Add corresponding pins into the separate pingroup to be able to manage the transceiver. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 4e0483652664750dc0c50d3634478fac661bfd7f Author: Max Krummenacher Date: Mon Apr 11 17:22:27 2022 +0200 ARM: dts: imx6dl-colibri: Command pmic to standby for poweroff The Colibri iMX6 HW doesn't allow to use the PWR_ON_REQ signal for poweroff. Use the fsl,pmic-stby-poweroff property to command the PMIC into a low power mode in poweroff. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 5ab9c76a82670f369969a08677c0afba22a8da15 Author: Max Krummenacher Date: Mon Apr 11 17:22:26 2022 +0200 ARM: dts: imx6dl-colibri: Disable add-on accessories The Toradex Colibri family is composed of SoM that can be plugged in various carrier board, with carrier boards allowing multiple optional add-on (e.g. display, camera, ...). Keep all the SoM specific part into the module .dtsi, disabling everything that is not self-contained on the board. The carrier board dts can reuse/enable anything that is defined in the module dtsi. Additional device tree overlays can be used for any accessories that are plugged in the carrier board. Disable parallel RGB: The parallel RGB interface (lcd_display) and all related nodes can be enabled in an overlay if used. Keep all nodes disabled in the module-level device tree. Rename display interface node to match imx6qdl-apalis to make it easier to use overlays. The pwm-backlight binding now requires the power-supply property, add it. Disable stmpe touchscreen: The touchscreen can be enabled in an overlay if used. Add labels to the stmpe sub nodes. Disable hdmi interface: HDMI can be enabled in an overlay if used. Update SPDX-License spelling to latest convention. Update Copyright year. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 96a34c46e9dba69e4fe4b3edaaf278190f4c53be Author: Oleksandr Suvorov Date: Mon Apr 11 17:22:25 2022 +0200 ARM: dts: imx6dl-colibri: Add gpio-line-names Add GPIO line names on module level. Those are all GPIOs which a user might use on his custom carrier board. If more meaningful names are available on the carrier board, the user can overwrite the line names in the carrier board level device tree. Signed-off-by: Oleksandr Suvorov Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 5f5c579a34a87117c20b411df583ae816c1ec84f Author: Max Krummenacher Date: Mon Apr 11 17:22:24 2022 +0200 ARM: dts: imx6dl-colibri: Fix I2C pinmuxing Fix names of extra pingroup node and property for gpio bus recovery. Without the change i2c2 is not functional. Fixes: 56f0df6b6b58 ("ARM: dts: imx*(colibri|apalis): add missing recovery modes to i2c") Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 6045ab5fea4c849153ebeb0acb532da5f29d69c4 Author: Niklas Cassel Date: Thu Apr 14 11:10:18 2022 +0200 binfmt_flat: do not stop relocating GOT entries prematurely on riscv bFLT binaries are usually created using elf2flt. The linker script used by elf2flt has defined the .data section like the following for the last 19 years: .data : { _sdata = . ; __data_start = . ; data_start = . ; *(.got.plt) *(.got) FILL(0) ; . = ALIGN(0x20) ; LONG(-1) . = ALIGN(0x20) ; ... } It places the .got.plt input section before the .got input section. The same is true for the default linker script (ld --verbose) on most architectures except x86/x86-64. The binfmt_flat loader should relocate all GOT entries until it encounters a -1 (the LONG(-1) in the linker script). The problem is that the .got.plt input section starts with a GOTPLT header (which has size 16 bytes on elf64-riscv and 8 bytes on elf32-riscv), where the first word is set to -1. See the binutils implementation for riscv [1]. This causes the binfmt_flat loader to stop relocating GOT entries prematurely and thus causes the application to crash when running. Fix this by skipping the whole GOTPLT header, since the whole GOTPLT header is reserved for the dynamic linker. The GOTPLT header will only be skipped for bFLT binaries with flag FLAT_FLAG_GOTPIC set. This flag is unconditionally set by elf2flt if the supplied ELF binary has the symbol _GLOBAL_OFFSET_TABLE_ defined. ELF binaries without a .got input section should thus remain unaffected. Tested on RISC-V Canaan Kendryte K210 and RISC-V QEMU nommu_virt_defconfig. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-riscv.c;hb=binutils-2_38#l3275 Cc: Signed-off-by: Niklas Cassel Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20220414091018.896737-1-niklas.cassel@wdc.com Fixed-by: kernel test robot Link: https://lore.kernel.org/lkml/202204182333.OIUOotK8-lkp@intel.com Signed-off-by: Kees Cook commit 40f458b7816bd3ddddc068998523b4e039c04818 Merge: c6ed9f66eb70a c54b39a565227 Author: Paul Cercueil Date: Mon Apr 18 20:44:36 2022 +0100 Merge drm/drm-next into drm-misc-next drm/drm-next has a build fix for the NewVision NV3052C panel (drivers/gpu/drm/panel/panel-newvision-nv3052c.c), which needs to be merged back to drm-misc-next, as it was failing to build there. Signed-off-by: Paul Cercueil commit 4f3e79b36d7fdbc3315efe5612a01800931fa25d Author: Linus Walleij Date: Wed Apr 6 22:51:56 2022 +0200 gpio: ixp4xx: Detect special machines by compatible There are some special clock amendments for two machines formerly detected by their machine_is() boardfile macro. They are now migrated to device tree so use of_machine_is_compatible() instead. Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit c6ed9f66eb70aeaac9998bd3552ada740d90e20c Author: Tom Rix Date: Mon Apr 18 11:28:10 2022 -0400 drm/nouveau/gr/gf100-: change gf108_gr_fwif from global to static Smatch reports this issue gf108.c:147:1: warning: symbol 'gf108_gr_fwif' was not declared. Should it be static? gf108_gr_fwif is only used in gf108.c. Single file variables should not be global so change gf108_gr_fwif's storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220418152810.3280502-1-trix@redhat.com commit f6e0a6b09edc61d567ccf6199b3bb6f3c5f9e077 Author: Tom Rix Date: Mon Apr 18 10:18:42 2022 -0400 drm/nouveau: change base917c_format from global to static Smatch reports this issue base917c.c:26:1: warning: symbol 'base917c_format' was not declared. Should it be static? base917c_format is only used in base917.c. Single file variables should not be global so change base917c_format's storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220418141842.296386-1-trix@redhat.com commit 58b7c856519fe946620ee68dd0c37bd3c695484a Author: Peng Fan Date: Fri Apr 15 10:57:37 2022 +0800 remoteproc: imx_rproc: Ignore create mem entry for resource table Resource table is used by Linux to get information published by remote processor. It should be not be used for memory allocation, so not create rproc mem entry. Fixes: b29b4249f8f0 ("remoteproc: imx_rproc: add i.MX specific parse fw hook") Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220415025737.1561976-1-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 87e0a30e9a73a84820835910fb7bf161d0294324 Author: Ian Rogers Date: Wed Apr 13 14:05:03 2022 -0700 perf vendor events intel: Update goldmont event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f51c401f113b4a28241818849412e849b3485ae4 Author: Ian Rogers Date: Wed Apr 13 14:05:02 2022 -0700 perf vendor events intel: Update goldmontplus event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8f1a69825fe045086a0844240fb8cac4b1d61db7 Author: Ian Rogers Date: Wed Apr 13 14:05:01 2022 -0700 perf vendor events intel: Update elkhartlake event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 44a4b9ad8eb3f1e7a8dc27dda1547073d5725887 Author: Ian Rogers Date: Wed Apr 13 14:05:00 2022 -0700 perf vendor events intel: Update westmereex event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7f2c72fa697705f11601ac18280157d4816205d1 Author: Ian Rogers Date: Wed Apr 13 14:04:59 2022 -0700 perf vendor events intel: Update westmereep-sp event topics Apply topic updates from: p https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a01174fc9e9e6edb2d9d224cbaf383cb4b2bbf70 Author: Ian Rogers Date: Wed Apr 13 14:04:58 2022 -0700 perf vendor events intel: Update westmereep-dp event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 55ae1b759e4b7119edd6e32c51d152d3f2b6ce34 Author: Ian Rogers Date: Wed Apr 13 14:04:57 2022 -0700 perf vendor events intel: Update tremontx uncore and topics Update the topic of BTCLEAR.ANY and add additional uncore event names as per: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang 1 Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 45d97cdd2f795460598999698efb6b7237590323 Author: Ian Rogers Date: Wed Apr 13 14:04:56 2022 -0700 perf vendor events intel: Update tigerlake topic Update the topic of ASSISTS.ANY as per: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit da578feb702660c1ca67b0e5bfeaaab37341a5af Author: Ian Rogers Date: Wed Apr 13 14:04:55 2022 -0700 perf vendor events intel: Update nehalemep event topics Apply topic updates from: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 339ec95167f224c1db757f4e2988f547f16ae006 Author: Ian Rogers Date: Wed Apr 13 14:04:54 2022 -0700 perf vendor events intel: Update SKX uncore JSON uncore events are generated for Skylake Server for v1.26 with events from: https://download.01.org/perfmon/SKX/ New event names are added, that match the original JSON names, due to an update to: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dd498d08044c0a7e94571915ddc4bfecddf173ba Author: Ian Rogers Date: Wed Apr 13 14:04:53 2022 -0700 perf vendor events intel: Update CLX uncore to v1.14 JSON uncore events are generated for CascadeLake Server for v1.14 with events from: https://download.01.org/perfmon/CLX/ New event names are added, that match the original JSON names, due to an update to: https://github.com/intel/event-converter-for-linux-perf/ Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 12c6385eebb8b24814055b257eaeaa9f931faccf Author: Ian Rogers Date: Wed Apr 13 14:04:52 2022 -0700 perf vendor events intel: Add sapphirerapids events Events were generated from 01.org using: https://github.com/intel/event-converter-for-linux-perf Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit cbeee6caa4e90b3901cee6257f526757fcce2e03 Author: Ian Rogers Date: Wed Apr 13 14:04:51 2022 -0700 perf vendor events intel: Fix icelakex cstate metrics Apply cstate fix from: https://github.com/intel/event-converter-for-linux-perf/ so that metrics for cstates that exist on the particular architecture are generated. This corrects issues with metric testing. Also correct topic of ASSISTS.ANY event. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2c77f36a9a8e5adbfaf28eb804f57be636b9022a Author: Ian Rogers Date: Wed Apr 13 14:04:50 2022 -0700 perf vendor events intel: Fix icelake cstate metrics Apply cstate fix from: https://github.com/intel/event-converter-for-linux-perf/ so that metrics for cstates that exist on the particular architecture are generated. This corrects issues with metric testing. Also correct topic of ASSISTS.ANY event. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220413210503.3256922-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ea7c1339e3ed094dd4df48d598f9018a2587283 Author: Jack Wang Date: Wed Apr 13 14:34:20 2022 +0200 block/rnbd-clt: Avoid flush_workqueue(system_long_wq) usage Flushing system-wide workqueues is dangerous and will be forbidden. Replace system_long_wq with local rnbd_clt_wq. Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp Cc: Tetsuo Handa Signed-off-by: Jack Wang Reviewed-by: Santosh Kumar Pradhan Link: https://lore.kernel.org/r/20220413123420.66470-1-jinpu.wang@ionos.com Signed-off-by: Jens Axboe commit fdefc3750e847a9178906bb07f0efb231e0a6aca Author: Leo Yan Date: Sun Apr 17 20:45:24 2022 +0800 perf mem: Print memory operation type The memory operation types are not only for load and store, for easier reviewing the memory operation type, this patch prints out it. Before: ls 14753 [011] 3678.072400: 1 l1d-miss: 88000182 L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 l1d-access: 88000182 L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 tlb-access: 88000182 L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 memory: 88000182 L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) After: ls 14753 [011] 3678.072400: 1 l1d-miss: 88000182 |OP LOAD|LVL L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 l1d-access: 88000182 |OP LOAD|LVL L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 tlb-access: 88000182 |OP LOAD|LVL L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) ls 14753 [011] 3678.072400: 1 memory: 88000182 |OP LOAD|LVL L1 miss|SNP N/A|TLB Walker hit|LCK No|BLK N/A ffffa7c22b4b2a00 [unknown] ([kernel.kallsyms]) Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Ali Saidi Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Li Huafei Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220417124524.901148-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 8318f7c231d5be09e47410c5ab387b9bef6fe19e Author: Guo Ren Date: Wed Apr 6 21:32:22 2022 +0800 csky: optimize memcpy_{from,to}io() and memset_io() Optimize memcpy_{from,to}io() and memset_io() by transferring in 64 bit as much as possible with minimized barrier usage. This simplest optimization brings faster throughput compare to current byte-by-byte read and write with barrier in the loop. Code's skeleton is taken from the powerpc & arm64. Signed-off-by: Guo Ren Signed-off-by: Guo Ren commit e4df2d5e852a7d24df3672ae9951eb79e179be08 Author: Matteo Croce Date: Wed Mar 30 20:07:14 2022 +0800 csky: Add C based string functions Try to access RAM with the largest bit width possible, but without doing unaligned accesses. A further improvement could be to use multiple read and writes as the assembly version was trying to do. Tested on a BeagleV Starlight with a SiFive U74 core, where the improvement is noticeable. Signed-off-by: Matteo Croce Co-developed-by: Guo Ren Signed-off-by: Guo Ren commit edc5601db66411a8c9c6b08b3aacf7e154a34c6d Author: Andy Shevchenko Date: Fri Apr 1 13:36:02 2022 +0300 pinctrl: meson: Replace custom code by gpiochip_node_count() call Since we have generic function to count GPIO controller nodes under a given device, there is no need to open code it. Replace custom code by gpiochip_node_count() call. Signed-off-by: Andy Shevchenko Tested-by: Marek Szyprowski Reviewed-by: Neil Armstrong commit 6671d0bc17866f71b8ca7ea3fb7e6dfc2a8069d2 Author: Andy Shevchenko Date: Fri Apr 1 13:36:01 2022 +0300 pinctrl: meson: Enable COMPILE_TEST Enable COMPILE_TEST for a better test coverage. Signed-off-by: Andy Shevchenko Tested-by: Marek Szyprowski Reviewed-by: Neil Armstrong commit 2b2dce809920b3cf92df27a484c0649dda7270b8 Author: Andy Shevchenko Date: Fri Apr 1 13:36:00 2022 +0300 pinctrl: meson: Rename REG_* to MESON_REG_* Currently compilation test fails on x86 due to name collision. The usual way to fix that is to move both conflicting parts to their own namespaces. Rename REG_* to MESON_REG_* as a prerequisite for enabling COMPILE_TEST. Signed-off-by: Andy Shevchenko Tested-by: Marek Szyprowski Reviewed-by: Neil Armstrong commit 46d34d4d502ea1030f5de434e6677ec96ca131c3 Author: Andy Shevchenko Date: Fri Apr 1 13:36:04 2022 +0300 pinctrl: armada-37xx: Reuse GPIO fwnode in armada_37xx_irqchip_register() Since we have fwnode of the first found GPIO controller assigned to the struct gpio_chip, we may reuse it in the armada_37xx_irqchip_register(). Signed-off-by: Andy Shevchenko commit 2954ce1e452567c17e3899be2df6b145bc50a05e Author: Andy Shevchenko Date: Fri Apr 1 13:36:03 2022 +0300 pinctrl: armada-37xx: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko commit d292dc80686aeafc418d809b4f9598578a7f294f Author: Christoph Hellwig Date: Wed Mar 30 07:29:17 2022 +0200 loop: don't destroy lo->workqueue in __loop_clr_fd There is no need to destroy the workqueue when clearing unbinding a loop device from a backing file. Not doing so on the other hand avoid creating a complex lock dependency chain involving the global system_transition_mutex. Based on a patch from Tetsuo Handa . Reported-by: syzbot+6479585dfd4dedd3f7e1@syzkaller.appspotmail.com Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Tested-by: syzbot+6479585dfd4dedd3f7e1@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20220330052917.2566582-16-hch@lst.de Signed-off-by: Jens Axboe commit a0e286b6a5b61d4da01bdf865071c4da417046d6 Author: Christoph Hellwig Date: Wed Mar 30 07:29:16 2022 +0200 loop: remove lo_refcount and avoid lo_mutex in ->open / ->release lo_refcount counts how many openers a loop device has, but that count is already provided by the block layer in the bd_openers field of the whole-disk block_device. Remove lo_refcount and allow opens to succeed even on devices beeing deleted - now that ->free_disk is implemented we can handle that race gracefull and all I/O on it will just fail. Similarly there is a small race window now where loop_control_remove does not synchronize the delete vs the remove due do bd_openers not being under lo_mutex protection, but we can handle that just as gracefully. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-15-hch@lst.de Signed-off-by: Jens Axboe commit 158eaeba4b8edf9940f64daa83cbd1ac7db7593c Author: Tetsuo Handa Date: Wed Mar 30 07:29:15 2022 +0200 loop: avoid loop_validate_mutex/lo_mutex in ->release Since ->release is called with disk->open_mutex held, and __loop_clr_fd() from lo_release() is called via ->release when disk_openers() == 0, we are guaranteed that "struct file" which will be passed to loop_validate_file() via fget() cannot be the loop device __loop_clr_fd(lo, true) will clear. Thus, there is no need to hold loop_validate_mutex from __loop_clr_fd() if release == true. When I made commit 3ce6e1f662a91097 ("loop: reintroduce global lock for safe loop_validate_file() traversal"), I wrote "It is acceptable for loop_validate_file() to succeed, for actual clear operation has not started yet.". But now I came to feel why it is acceptable to succeed. It seems that the loop driver was added in Linux 1.3.68, and if (lo->lo_refcnt > 1) return -EBUSY; check in loop_clr_fd() was there from the beginning. The intent of this check was unclear. But now I think that current disk_openers(lo->lo_disk) > 1 form is there for three reasons. (1) Avoid I/O errors when some process which opens and reads from this loop device in response to uevent notification (e.g. systemd-udevd), as described in commit a1ecac3b0656a682 ("loop: Make explicit loop device destruction lazy"). This opener is short-lived because it is likely that the file descriptor used by that process is closed soon. (2) Avoid I/O errors caused by underlying layer of stacked loop devices (i.e. ioctl(some_loop_fd, LOOP_SET_FD, other_loop_fd)) being suddenly disappeared. This opener is long-lived because this reference is associated with not a file descriptor but lo->lo_backing_file. (3) Avoid I/O errors caused by underlying layer of mounted loop device (i.e. mount(some_loop_device, some_mount_point)) being suddenly disappeared. This opener is long-lived because this reference is associated with not a file descriptor but mount. While race in (1) might be acceptable, (2) and (3) should be checked racelessly. That is, make sure that __loop_clr_fd() will not run if loop_validate_file() succeeds, by doing refcount check with global lock held when explicit loop device destruction is requested. As a result of no longer waiting for lo->lo_mutex after setting Lo_rundown, we can remove pointless BUG_ON(lo->lo_state != Lo_rundown) check. Signed-off-by: Tetsuo Handa Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220330052917.2566582-14-hch@lst.de Signed-off-by: Jens Axboe commit 498ef5c777d9c89693b70cc453b40c392120ea1b Author: Christoph Hellwig Date: Wed Mar 30 07:29:14 2022 +0200 loop: suppress uevents while reconfiguring the device Currently, udev change event is generated for a loop device before the device is ready for IO. Due to serialization on lo->lo_mutex in lo_open() this does not matter because anybody is able to open the device and do IO only after the configuration is finished. However this synchronization in lo_open() is going away so make sure userspace reacting to the change event will see the new device state by generating the event only when the device is setup. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-13-hch@lst.de Signed-off-by: Jens Axboe commit d2c7f56f8b5256d57f9e3fc7794c31361d43bdd9 Author: Christoph Hellwig Date: Wed Mar 30 07:29:13 2022 +0200 loop: implement ->free_disk Ensure that the lo_device which is stored in the gendisk private data is valid until the gendisk is freed. Currently the loop driver uses a lot of effort to make sure a device is not freed when it is still in use, but to to fix a potential deadlock this will be relaxed a bit soon. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-12-hch@lst.de Signed-off-by: Jens Axboe commit 1fe0b1acb14dd3113b7dc975a118cd7f08af8316 Author: Christoph Hellwig Date: Wed Mar 30 07:29:12 2022 +0200 loop: only freeze the queue in __loop_clr_fd when needed ->release is only called after all outstanding I/O has completed, so only freeze the queue when clearing the backing file of a live loop device. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220330052917.2566582-11-hch@lst.de Signed-off-by: Jens Axboe commit 46dc967445bde5300eee7e567a67796de2217586 Author: Christoph Hellwig Date: Wed Mar 30 07:29:11 2022 +0200 loop: don't freeze the queue in lo_release By the time the final ->release is called there can't be outstanding I/O. For non-final ->release there is no need for driver action at all. Thus remove the useless queue freeze. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220330052917.2566582-10-hch@lst.de Signed-off-by: Jens Axboe commit 98ded54a33839e7b8f8bed772e01a544f48e33a7 Author: Christoph Hellwig Date: Wed Mar 30 07:29:10 2022 +0200 loop: remove the racy bd_inode->i_mapping->nrpages asserts Nothing prevents a file system or userspace opener of the block device from redirtying the page right afte sync_blockdev returned. Fortunately data in the page cache during a block device change is mostly harmless anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220330052917.2566582-9-hch@lst.de Signed-off-by: Jens Axboe commit b15ed54694fbba714931dd81790f86797cf8bed2 Author: Christoph Hellwig Date: Wed Mar 30 07:29:09 2022 +0200 loop: initialize the worker tracking fields once There is no need to reinitialize idle_worker_list, worker_tree and timer every time a loop device is configured. Just initialize them once at allocation time. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Chaitanya Kulkarni Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220330052917.2566582-8-hch@lst.de Signed-off-by: Jens Axboe commit 2cf429b53c1041a0e90943e1d2a5a7a7f89accb0 Author: Christoph Hellwig Date: Wed Mar 30 07:29:08 2022 +0200 loop: de-duplicate the idle worker freeing code Use a common helper for both timer based and uncoditional freeing of idle workers. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Tested-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220330052917.2566582-7-hch@lst.de Signed-off-by: Jens Axboe commit 9acf381f3e8f715175c29f4b6d722f6b6797d139 Author: Christoph Hellwig Date: Wed Mar 30 07:29:07 2022 +0200 block: turn bdev->bd_openers into an atomic_t All manipulation of bd_openers is under disk->open_mutex and will remain so for the foreseeable future. But at least one place reads it without the lock (blkdev_get) and there are more to be added. So make sure the compiler does not do turn the increments and decrements into non-atomic sequences by using an atomic_t. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-6-hch@lst.de Signed-off-by: Jens Axboe commit dbdc1be32591af023db2812706f01e6cd2f42bfc Author: Christoph Hellwig Date: Wed Mar 30 07:29:06 2022 +0200 block: add a disk_openers helper Add a helper that returns the openers for a given gendisk to avoid having drivers poke into disk->part0 to get at this information in a somewhat cumbersome way. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-5-hch@lst.de Signed-off-by: Jens Axboe commit 7a86d6dc1493326feb0d3ce5af2f34401dd3defa Author: Christoph Hellwig Date: Wed Mar 30 07:29:05 2022 +0200 zram: cleanup zram_remove Remove the bdev variable and just use the gendisk pointed to by the zram_device directly. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-4-hch@lst.de Signed-off-by: Jens Axboe commit d666e20e2e7983d03bbf5e208b8485541ae616a1 Author: Christoph Hellwig Date: Wed Mar 30 07:29:04 2022 +0200 zram: cleanup reset_store Use a local variable for the gendisk instead of the part0 block_device, as the gendisk is what this function actually operates on. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-3-hch@lst.de Signed-off-by: Jens Axboe commit 2a852a693f8839bb877fc731ffbc9ece3a9c16d7 Author: Christoph Hellwig Date: Wed Mar 30 07:29:03 2022 +0200 nbd: use the correct block_device in nbd_bdev_reset The bdev parameter to ->ioctl contains the block device that the ioctl is called on, which can be the partition. But the openers check in nbd_bdev_reset really needs to check use the whole device, so switch to using that. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220330052917.2566582-2-hch@lst.de Signed-off-by: Jens Axboe commit 5f0614a55ecebdf55f1a17db0b5f6b787ed009f1 Author: Ming Lei Date: Sun Apr 17 22:27:13 2022 -0400 block: change exported IO accounting interface from gendisk to bdev Export IO accounting interfaces in terms of block_device now that gendisk has become more internal to block core. Rename __part_{start,end}_io_acct's first argument from part to bdev. Rename __part_{start,end}_io_acct to bdev_{start,end}_io_acct and export them. Remove disk_{start,end}_io_acct and update caller (zram) to use bdev_{start,end}_io_acct. DM can now be updated to use bdev_{start,end}_io_acct. Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer Link: https://lore.kernel.org/r/20220418022733.56168-2-snitzer@kernel.org Signed-off-by: Jens Axboe commit 7899eb6cb15d54a907adc73efacb4a373c697598 Author: Tim Harvey Date: Thu Apr 14 09:15:05 2022 -0700 arm64: dts: imx: Add i.MX8M Plus Gateworks gw7400 dts support The Gateworks GW7400 is an ARM based single board computer (SBC) featuring: - i.MX8M Plus SoC - LPDDR4 DRAM - eMMC FLASH - Gateworks System Controller (GSC) - QOS GbE - Microchip GbE Switch - Multiple multi-protocol RS232/RS485/RS422 Serial ports - USB 3.0 Front panel connector - onboard 802.11ac WiFi / BT - 3x miniPCIe socket with PCIe and USB 2.0 - 1x M.2 B/A-E socket with PCIe, USB 3.0 and dual nano-SIM sockets - off-board connectors for: MIPI DSI, MIPI CSI, SPI, GPIO, I2C - Wide range DC power input - Passive PoE - 802.3at PoE Signed-off-by: Tim Harvey Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Shawn Guo commit a997157e42e3119b13c644549a3d8381a1d825d6 Author: Luiz Angelo Daros de Luca Date: Sat Apr 16 02:27:37 2022 -0300 docs: net: dsa: describe issues with checksum offload DSA tags before IP header (categories 1 and 2) or after the payload (3) might introduce offload checksum issues. Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b5f955c099cd9bccbf44681e8ee14c3d786ea25a Author: Tommaso Merciai Date: Wed Apr 13 23:33:11 2022 +0200 arm64: dts: imx8mm-evk: add pwm1/backlight support Add pwm1/backlight support nodes for imx8mm_evk board. Align with u-boot dts References: - https://patchwork.ozlabs.org/project/uboot/patch/20220326111911.13720-9-tommaso.merciai@amarulasolutions.com/ Signed-off-by: Tommaso Merciai Signed-off-by: Shawn Guo commit e7fc48e6c7a8c3b37855703925d9320680041675 Author: Michael Walle Date: Tue Apr 12 16:32:38 2022 +0200 arm64: dts: imx8mn: add 8MNANOD3L-EVK device tree Add a device tree for the 8MNANOD3L-EVK eval board which features an IMX8MN SoC. It is similar to the 8MNANODLPD4-EVK eval board except it has an IMX8MN UltraLite SoC and DDR3L memory. It esp. differs in the PMIC configuration because the SoC has a smaller package and thus the ARM core voltage is combined with the SoC voltage and the DDR voltage is 1.35V for the DDR3L memory. Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit 2a38de067bace34e7315ce6af027fd785c31fe0f Merge: 843f77407eebe e1fad9517f0fd Author: David S. Miller Date: Mon Apr 18 11:00:19 2022 +0100 Merge branch 'mlxsw-line-card' Ido Schimmel says: ==================== mlxsw: Introduce line card support for modular switch Jiri says: This patchset introduces support for modular switch systems and also introduces mlxsw support for NVIDIA Mellanox SN4800 modular switch. It contains 8 slots to accommodate line cards - replaceable PHY modules which may contain gearboxes. Currently supported line card: 16X 100GbE (QSFP28) Other line cards that are going to be supported: 8X 200GbE (QSFP56) 4X 400GbE (QSFP-DD) There may be other types of line cards added in the future. To be consistent with the port split configuration (splitter cabels), the line card entities are treated in the similar way. The nature of a line card is not "a pluggable device", but "a pluggable PHY module". A concept of "provisioning" is introduced. The user may "provision" certain slot with a line card type. Driver then creates all instances (devlink ports, netdevices, etc) related to this line card type. It does not matter if the line card is plugged-in at the time. User is able to configure netdevices, devlink ports, setup port splitters, etc. From the perspective of the switch ASIC, all is present and can be configured. The carrier of netdevices stays down if the line card is not plugged-in. Once the line card is inserted and activated, the carrier of the related netdevices is then reflecting the physical line state, same as for an ordinary fixed port. Once user does not want to use the line card related instances anymore, he can "unprovision" the slot. Driver then removes the instances. Patches 1-4 are extending devlink driver API and UAPI in order to register, show, dump, provision and activate the line card. Patches 5-17 are implementing the introduced API in mlxsw. The last patch adds a selftest for mlxsw line cards. Example: $ devlink port # No ports are listed $ devlink lc pci/0000:01:00.0: lc 1 state unprovisioned supported_types: 16x100G lc 2 state unprovisioned supported_types: 16x100G lc 3 state unprovisioned supported_types: 16x100G lc 4 state unprovisioned supported_types: 16x100G lc 5 state unprovisioned supported_types: 16x100G lc 6 state unprovisioned supported_types: 16x100G lc 7 state unprovisioned supported_types: 16x100G lc 8 state unprovisioned supported_types: 16x100G Note that driver exposes list supported line card types. Currently there is only one: "16x100G". To provision the slot #8: $ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G $ devlink lc show pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 state active type 16x100G supported_types: 16x100G $ devlink port pci/0000:01:00.0/0: type notset flavour cpu port 0 splittable false pci/0000:01:00.0/53: type eth netdev enp1s0nl8p1 flavour physical lc 8 port 1 splittable true lanes 4 pci/0000:01:00.0/54: type eth netdev enp1s0nl8p2 flavour physical lc 8 port 2 splittable true lanes 4 pci/0000:01:00.0/55: type eth netdev enp1s0nl8p3 flavour physical lc 8 port 3 splittable true lanes 4 pci/0000:01:00.0/56: type eth netdev enp1s0nl8p4 flavour physical lc 8 port 4 splittable true lanes 4 pci/0000:01:00.0/57: type eth netdev enp1s0nl8p5 flavour physical lc 8 port 5 splittable true lanes 4 pci/0000:01:00.0/58: type eth netdev enp1s0nl8p6 flavour physical lc 8 port 6 splittable true lanes 4 pci/0000:01:00.0/59: type eth netdev enp1s0nl8p7 flavour physical lc 8 port 7 splittable true lanes 4 pci/0000:01:00.0/60: type eth netdev enp1s0nl8p8 flavour physical lc 8 port 8 splittable true lanes 4 pci/0000:01:00.0/61: type eth netdev enp1s0nl8p9 flavour physical lc 8 port 9 splittable true lanes 4 pci/0000:01:00.0/62: type eth netdev enp1s0nl8p10 flavour physical lc 8 port 10 splittable true lanes 4 pci/0000:01:00.0/63: type eth netdev enp1s0nl8p11 flavour physical lc 8 port 11 splittable true lanes 4 pci/0000:01:00.0/64: type eth netdev enp1s0nl8p12 flavour physical lc 8 port 12 splittable true lanes 4 pci/0000:01:00.0/125: type eth netdev enp1s0nl8p13 flavour physical lc 8 port 13 splittable true lanes 4 pci/0000:01:00.0/126: type eth netdev enp1s0nl8p14 flavour physical lc 8 port 14 splittable true lanes 4 pci/0000:01:00.0/127: type eth netdev enp1s0nl8p15 flavour physical lc 8 port 15 splittable true lanes 4 pci/0000:01:00.0/128: type eth netdev enp1s0nl8p16 flavour physical lc 8 port 16 splittable true lanes 4 To uprovision the slot #8: $ devlink lc set pci/0000:01:00.0 lc 8 notype ==================== Signed-off-by: David S. Miller commit e1fad9517f0fddfbe7da5605f50c362242cc7170 Author: Jiri Pirko Date: Mon Apr 18 09:42:41 2022 +0300 selftests: mlxsw: Introduce devlink line card provision/unprovision/activation tests Introduce basic line card manipulation which consists of provisioning, unprovisioning and activation of a line card. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 6445eef0f600b726da19b4d5885ebb25ba47f590 Author: Jiri Pirko Date: Mon Apr 18 09:42:40 2022 +0300 mlxsw: spectrum: Add port to linecard mapping For each port get slot_index using PMLP register. For ports residing on a linecard, identify it with the linecard by setting mapping using devlink_port_linecard_set() helper. Use linecard slot index for PMTDB register queries. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 45bf3b7267e0264ff25f85ea46ba4628d39b69b4 Author: Jiri Pirko Date: Mon Apr 18 09:42:39 2022 +0300 mlxsw: core: Extend driver ops by remove selected ports op In case of line card implementation, the core has to have a way to remove relevant ports manually. Extend the Spectrum driver ops by an op that implements port removal of selected ports upon request. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ee7a70fa671b274aa7e34c66a6e9ab55acadc59a Author: Jiri Pirko Date: Mon Apr 18 09:42:38 2022 +0300 mlxsw: core_linecards: Implement line card activation process Allow to process events generated upon line card getting "ready" and "active". When DSDSC event with "ready" bit set is delivered, that means the line card is powered up. Use MDDC register to push the line card to active state. Once FW is done with that, the DSDSC event with "active" bit set is delivered. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b217127e5e4ee0ecfce7c5f84cfe082238123bda Author: Jiri Pirko Date: Mon Apr 18 09:42:37 2022 +0300 mlxsw: core_linecards: Add line card objects and implement provisioning Introduce objects for line cards and an infrastructure around that. Use devlink_linecard_create/destroy() to register the line card with devlink core. Implement provisioning ops with a list of supported line cards. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5bade5aa4afc914dac9086500e0bfabec0d3ffbe Author: Jiri Pirko Date: Mon Apr 18 09:42:36 2022 +0300 mlxsw: reg: Add Management Binary Code Transfer Register The MBCT register allows to transfer binary INI codes from the host to the management FW by transferring it by chunks of maximum 1KB. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5290a8ff2e11e11d4f41369ec66c3bf7fc2f4a09 Author: Jiri Pirko Date: Mon Apr 18 09:42:35 2022 +0300 mlxsw: reg: Add Management DownStream Device Control Register The MDDC register allows to control downstream devices and line cards. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 505f524dc66093a5db5ef2fea8153d5b449d260d Author: Jiri Pirko Date: Mon Apr 18 09:42:34 2022 +0300 mlxsw: reg: Add Management DownStream Device Query Register The MDDQ register allows to query the DownStream device properties. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b0ec003e9a906431073628e7ecc70a84f0e54074 Author: Jiri Pirko Date: Mon Apr 18 09:42:33 2022 +0300 mlxsw: spectrum: Introduce port mapping change event processing Register PMLPE trap and process the port mapping changes delivered by it by creating related ports. Note that this happens after provisioning. The INI of the linecard is processed and merged by FW. PMLPE is generated for each port. Process this mapping change. Layout of PMLPE is the same as layout of PMLP. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit adc6462376b1a22d486ab5f6e624ba9528a380da Author: Jiri Pirko Date: Mon Apr 18 09:42:32 2022 +0300 mlxsw: Narrow the critical section of devl_lock during ports creation/removal No need to hold the lock for alloc and freecpu. So narrow the critical section. Follow-up patch is going to benefit from this by adding more code to the functions which will be out of the critical as well. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ebf0c53417319ff568d9b6238a60ba27395385f3 Author: Jiri Pirko Date: Mon Apr 18 09:42:31 2022 +0300 mlxsw: reg: Add Ports Mapping Event Configuration Register The PMECR register is used to enable/disable event triggering in case of local port mapping change. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d3ad2d88209ff8c4ec6fbcf21be7f85104767cdd Author: Jiri Pirko Date: Mon Apr 18 09:42:30 2022 +0300 mlxsw: spectrum: Allocate port mapping array of structs instead of pointers Instead of array of pointers to port mapping structures, allocate the array of structures directly. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit bac62191a3d4dddc4dbfddb4187d4952380c29c7 Author: Jiri Pirko Date: Mon Apr 18 09:42:29 2022 +0300 mlxsw: spectrum: Allow lane to start from non-zero index So far, the lane index always started from zero. That is not true for modular systems with gearbox-equipped linecards. Loose the check so the lanes can start from non-zero index. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b837585985386e05478cb17868d23a6fa87c4f8d Author: Jiri Pirko Date: Mon Apr 18 09:42:28 2022 +0300 devlink: add port to line card relationship set In order to properly inform user about relationship between port and line card, introduce a driver API to set line card for a port. Use this information to extend port devlink netlink message by line card index and also include the line card index into phys_port_name and by that into a netdevice name. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit fc9f50d5b366cd9f35bdee22fe3f8d77833cb1d8 Author: Jiri Pirko Date: Mon Apr 18 09:42:27 2022 +0300 devlink: implement line card active state Allow driver to mark a line card as active. Expose this state to the userspace over devlink netlink interface with proper notifications. 'active' state means that line card was plugged in after being provisioned. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit fcdc8ce23a309c26a67fc613a741d9b21a248311 Author: Jiri Pirko Date: Mon Apr 18 09:42:26 2022 +0300 devlink: implement line card provisioning In order to be able to configure all needed stuff on a port/netdevice of a line card without the line card being present, introduce line card provisioning. Basically by setting a type, provisioning process will start and driver is supposed to create a placeholder for instances (ports/netdevices) for a line card type. Allow the user to query the supported line card types over line card get command. Then implement two netlink command SET to allow user to set/unset the card type. On the driver API side, add provision/unprovision ops and supported types array to be advertised. Upon provision op call, the driver should take care of creating the instances for the particular line card type. Introduce provision_set/clear() functions to be called by the driver once the provisioning/unprovisioning is done on its side. These helpers are not to be called directly due to the async nature of provisioning. Example: $ devlink port # No ports are listed $ devlink lc pci/0000:01:00.0: lc 1 state unprovisioned supported_types: 16x100G lc 2 state unprovisioned supported_types: 16x100G lc 3 state unprovisioned supported_types: 16x100G lc 4 state unprovisioned supported_types: 16x100G lc 5 state unprovisioned supported_types: 16x100G lc 6 state unprovisioned supported_types: 16x100G lc 7 state unprovisioned supported_types: 16x100G lc 8 state unprovisioned supported_types: 16x100G $ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G $ devlink lc show pci/0000:01:00.0 lc 8 pci/0000:01:00.0: lc 8 state active type 16x100G supported_types: 16x100G $ devlink port pci/0000:01:00.0/0: type notset flavour cpu port 0 splittable false pci/0000:01:00.0/53: type eth netdev enp1s0nl8p1 flavour physical lc 8 port 1 splittable true lanes 4 pci/0000:01:00.0/54: type eth netdev enp1s0nl8p2 flavour physical lc 8 port 2 splittable true lanes 4 pci/0000:01:00.0/55: type eth netdev enp1s0nl8p3 flavour physical lc 8 port 3 splittable true lanes 4 pci/0000:01:00.0/56: type eth netdev enp1s0nl8p4 flavour physical lc 8 port 4 splittable true lanes 4 pci/0000:01:00.0/57: type eth netdev enp1s0nl8p5 flavour physical lc 8 port 5 splittable true lanes 4 pci/0000:01:00.0/58: type eth netdev enp1s0nl8p6 flavour physical lc 8 port 6 splittable true lanes 4 pci/0000:01:00.0/59: type eth netdev enp1s0nl8p7 flavour physical lc 8 port 7 splittable true lanes 4 pci/0000:01:00.0/60: type eth netdev enp1s0nl8p8 flavour physical lc 8 port 8 splittable true lanes 4 pci/0000:01:00.0/61: type eth netdev enp1s0nl8p9 flavour physical lc 8 port 9 splittable true lanes 4 pci/0000:01:00.0/62: type eth netdev enp1s0nl8p10 flavour physical lc 8 port 10 splittable true lanes 4 pci/0000:01:00.0/63: type eth netdev enp1s0nl8p11 flavour physical lc 8 port 11 splittable true lanes 4 pci/0000:01:00.0/64: type eth netdev enp1s0nl8p12 flavour physical lc 8 port 12 splittable true lanes 4 pci/0000:01:00.0/125: type eth netdev enp1s0nl8p13 flavour physical lc 8 port 13 splittable true lanes 4 pci/0000:01:00.0/126: type eth netdev enp1s0nl8p14 flavour physical lc 8 port 14 splittable true lanes 4 pci/0000:01:00.0/127: type eth netdev enp1s0nl8p15 flavour physical lc 8 port 15 splittable true lanes 4 pci/0000:01:00.0/128: type eth netdev enp1s0nl8p16 flavour physical lc 8 port 16 splittable true lanes 4 $ devlink lc set pci/0000:01:00.0 lc 8 notype Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c246f9b5fd617fe487f8b6f18851703f468501d6 Author: Jiri Pirko Date: Mon Apr 18 09:42:25 2022 +0300 devlink: add support to create line card and expose to user Extend the devlink API so the driver is going to be able to create and destroy linecard instances. There can be multiple line cards per devlink device. Expose this new type of object over devlink netlink API to the userspace, with notifications. Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 39772efd98adecbd5b8c6096d465d2fcbafbde6a Author: Marek Vasut Date: Sun Mar 13 13:39:49 2022 +0100 clk: imx8mp: Add DISP2 pixel clock Add pixel clock for second LCDIFv3 interface. Both LCDIFv3 interfaces use the same set of parent clock, so deduplicate imx8mp_media_disp1_pix_sels into common imx8mp_media_disp_pix_sels and use it for both. Signed-off-by: Marek Vasut Cc: Abel Vesa Cc: Fabio Estevam Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220313123949.207284-1-marex@denx.de Signed-off-by: Abel Vesa commit 843f77407eebee07c2a3300df0c4b33f64322e29 Author: Eric Dumazet Date: Sun Apr 17 11:34:32 2022 -0700 tcp: fix signed/unsigned comparison Kernel test robot reported: smatch warnings: net/ipv4/tcp_input.c:5966 tcp_rcv_established() warn: unsigned 'reason' is never less than zero. I actually had one packetdrill failing because of this bug, and was about to send the fix :) v2: Andreas Schwab also pointed out that @reason needs to be negated before we reach tcp_drop_reason() Fixes: 4b506af9c5b8 ("tcp: add two drop reasons for tcp_ack()") Signed-off-by: Eric Dumazet Reported-by: kernel test robot Reported-by: Andreas Schwab Signed-off-by: David S. Miller commit d9a9a7cf32c93c4c66b437438857f9fb7eb54d91 Author: Tim Harvey Date: Mon Apr 11 12:46:38 2022 -0700 arm64: dts: imx8m{m,n}-venice-*: add missing uart-has-rtscts property to UARTs Add the missing 'uart-has-rtscts' property to UART's that have hardware flow control capability. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 7fb061bbf60313a8e13d966a5e64d4f6035e05ac Author: Max Krummenacher Date: Mon Apr 11 17:22:34 2022 +0200 ARM: imx_v6_v7_defconfig: Enable the ADC part of the STMPE MFD The SoM Apalis/Colibri iMX6 use the ADC of a STMPE 811. Enable its driver. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 91dbd54ec55d3521f32beefddb64e81dc49e4abb Author: Max Krummenacher Date: Mon Apr 11 17:22:23 2022 +0200 ARM: dts: imx6dl-colibri: Drop dedicated v1.1 device tree Drop Colibri V1.1 device tree, this is just a duplicate of Colibri V1.0 with the possibility to use SD cards in UHS mode if the carrier board does not have 3.3V pull up resistor. The dedicated device tree kept the feature switched of by setting the no-1-8-v property and thus does not offer anything different than what the regular device tree does. Thus drop the dedicated device tree and merge the preparation to allow enabling the feature should a carrier without pull ups be used into the regular device tree. Signed-off-by: Max Krummenacher Signed-off-by: Shawn Guo commit 0d9968d98467d75cfdcb903f6c202884f2299521 Author: Ming Qian Date: Mon Apr 11 14:50:49 2022 +0800 arm64: dts: freescale: imx8q: add imx vpu codec entries Add the Video Processing Unit node for IMX8Q SoC. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Signed-off-by: Shawn Guo commit 746a72411cddb87d3c09dc42f901e6e69467744f Author: Adam Ford Date: Sun Apr 10 14:35:43 2022 -0500 arm64: dts: imx8mp: Enable HS400-ES The SDHC controller in the imx8mp has the same controller as the imx8mm which supports HS400-ES. Change the compatible fallback to imx8mm to enable it, but keep the imx7d-usdhc to prevent breaking backwards compatibility. Signed-off-by: Adam Ford Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 472f20b4f2534236fb90cdf93b42a071eb77bc5e Author: Adam Ford Date: Sun Apr 10 14:35:42 2022 -0500 arm64: dts: imx8mn: Enable HS400-ES The SDHC controller in the imx8mn has the same controller as the imx8mm which supports HS400-ES. Change the compatible fallback to imx8mm to enable it, but keep the imx7d-usdhc to prevent breaking backwards compatibility. Signed-off-by: Adam Ford Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 8d4668064cce8f8d52d4bd2b3b864feed33b1258 Author: Tzung-Bi Shih Date: Wed Feb 16 16:03:06 2022 +0800 platform/chrome: cros_ec: append newline to all logs To be consistent, append newline ("\n") to all logs. Reviewed-by: Guenter Roeck Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih commit 5781a33098c69a3b08890ad78a297b81bb69ca4b Author: Tzung-Bi Shih Date: Wed Feb 16 16:03:05 2022 +0800 platform/chrome: cros_ec: sort header inclusion alphabetically Sort header inclusion alphabetically. Reviewed-by: Guenter Roeck Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih commit 9fbe967d4e6e017c85c94aead6a1310b5f77db9a Author: Tzung-Bi Shih Date: Wed Feb 16 16:03:04 2022 +0800 platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend() `wake_enabled` indicates cros_ec_resume() needs to call disable_irq_wake() to undo enable_irq_wake() in cros_ec_suspend(). Determine `wake_enabled` in cros_ec_suspend() instead of reset-after-used in cros_ec_resume(). Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih commit f47a6113f4e87db7ca066635822e1b3ca3ed9514 Author: Tzung-Bi Shih Date: Wed Feb 16 16:03:03 2022 +0800 platform/chrome: cros_ec: remove unused variable `was_wake_device` Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih commit 2cd01bd6b117df07b1bc2852f08694fdd29e40ed Author: Tzung-Bi Shih Date: Wed Feb 16 16:03:02 2022 +0800 platform/chrome: cros_ec: fix error handling in cros_ec_register() Fix cros_ec_register() to unregister platform devices if blocking_notifier_chain_register() fails. Also use the single exit path to handle the platform device unregistration. Fixes: 42cd0ab476e2 ("platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW") Reviewed-by: Prashant Malani Signed-off-by: Tzung-Bi Shih commit 3d59142ad94cf60b94b3dc94c19fdafa23aec8b1 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:38 2022 +0200 media: dvb-usb: dib0700_devices: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/028699ec71158dbc49d710a4259eb8cdb7f673cb.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 281b21c56ed325ad5a23bf2dce45a8d7f751a577 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:37 2022 +0200 media: dvb-usb: dibusb-mc: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/f1d4fa4960b709152ae693800c830e19a4bc1f48.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit d763479abd67fc67a13aabe0ce19b4d775fbdcee Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:36 2022 +0200 media: dvb-usb: dibusb-mb: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/a300c26ad4e9bb913e86eeaf0ec7d72b9e7d5d3e.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 5710a24b34576a8873ee836953575fdb234b37e2 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:35 2022 +0200 media: dvb-usb: vp7045: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/0241bf842bf592dfa01b0ef4916afda396194f98.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 9c06331ca07f0e7288c949e7969ab108aa1c9807 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:34 2022 +0200 media: dvb-usb: vp702x: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/13bf6aab3909fae5da4c9a24c114b15e76abd146.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 0e10b7c25894420b18ca4593a5972a552351d0e2 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:33 2022 +0200 media: dvb-usb: umt-010: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/5fd3c469faa115856f48037019e607edcb41d458.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 5c1a56c9f0658d9b2d4be333fd896cd1b6cbaa82 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:32 2022 +0200 media: dvb-usb: ttusb2: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/b447d9fd3832da5eff6267e8fe742c431f1133f2.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit ff9b0c51d88619ee9e123fce87b8a931bc484d93 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:31 2022 +0200 media: technisat-usb2: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro. Link: https://lore.kernel.org/linux-media/c125c28aeb3d4344b632e1f99d81c433917f2a4c.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 710801c7ba81993d635a458cd9a0fc02f921c439 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:30 2022 +0200 media: dvb-usb: pctv452e: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/283a8c6bdf9778f832b4f6acc104c06688281668.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 22127ac8eb8d919d7366b370c1451f3b61ebc1de Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:29 2022 +0200 media: dvb-usb: opera1: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/08861d80b6706ac1ed04a68959ebb78f27cb028d.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit cb794c2b7ae5b769fd46a3cce9508f7e04bf172b Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:28 2022 +0200 media: dvb-usb: nova-t-usb2: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/58f1a356b7b75bbefef3aa07cd99896c446df32f.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 3473fd1711527c24b3d37d6b13cfd341e2d5a3c7 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:27 2022 +0200 media: dvb-usb: m920x: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/c6f6bab97c39561add54f69a75980f4d453f7c17.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 49d53e2d760464c6fc1993a291296ca6dfba83da Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:26 2022 +0200 media: dvb-usb: gp8psk: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/0d32148747df677f0c930605389c12b190c09bdf.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 2fa2002f533e0ed847922cdf9479ea0875f4e49f Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:25 2022 +0200 media: dw2102: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro, and rename some PIDs. Link: https://lore.kernel.org/linux-media/828998ef3f0843bab4e84780e42f8f0802f57be7.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 4a307b4af5fff183f866ecbdba6a41be766517de Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:24 2022 +0200 media: dtv5100: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro. Link: https://lore.kernel.org/linux-media/6e7183735aacf33fff86bc709a38aafb6b858dff.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 86fd1a41fc58108833358e3a5e238c548c98edd2 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:23 2022 +0200 media: dvb-usb: dtt200u: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/9fa3d1add4c58e1320dcc18578fda2d0106becda.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit b18869ba190dce7ac9802143253fa0a0a639d059 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:22 2022 +0200 media: digitv: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro. Link: https://lore.kernel.org/linux-media/68de8820a361e61c25bf7402acac71b3770ff906.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 671cae46917690bfbf319b1784ed15aa876bd3c8 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:21 2022 +0200 media: cxusb: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro. Link: https://lore.kernel.org/linux-media/bd1e61664e234252de3dfac16aab8bfc35b7bcd7.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit b23125a4f4968bf080dee1336ec2af94d6c9212b Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:20 2022 +0200 media: cinergyT2-core: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro and an enum with the USB model supported by this driver. Link: https://lore.kernel.org/linux-media/4b8212adab277a2bf84ab04480eb6fd37edda74f.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 5441df36e1c75efa096d23c9a86119cf6ca8328c Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:19 2022 +0200 media: dvb-usb: az6027: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/65b9775c39dcd21e5cb75a86e1e7b99b7d6eefcd.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 41c7eb3348fda1cdb31f1729690d83c3ca64d8fc Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:18 2022 +0200 media: af9005: use the newer dvb-usb macros for USB device In order to make the drivers under dvb-usb more homogeneous, use the new macro. Link: https://lore.kernel.org/linux-media/9b1749763465815af92f0a4d8f210fe170c549d5.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 1c64fd9c640862e6b5b9c7c35e789338e08cfe02 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:17 2022 +0200 media: dvb-usb: a800: use an enum for the device number The device number is currently a value that needs to be the same on two separate tables, but the code doesn't actually enforce it, leading to errors as boards get added or removed. Fix it by using an enum. Link: https://lore.kernel.org/linux-media/dc8f9ec6cc8f2e16967a61752a292c46622c01dc.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 82a4a3ba3380bafc33f58c9b8057bb6577a7f113 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:16 2022 +0200 media: dvb-usb: Add helper macros for using USB VID/PID In order to use designated initializers and to avoid avoid big lines at the USB ID tables, define some helper macros. Link: https://lore.kernel.org/linux-media/f82e376dea2e9b922f51a03d1e7730b03e49cc7d.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 7c33d85fed4b470295f9f57a44649249c066b892 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:15 2022 +0200 media: dvb-usb: vp702x: reference to usb ID table There are two commented entries that are pointing to the wrong places. Fix them. Link: https://lore.kernel.org/linux-media/fe9ee24510431e6baad5244d8a27e56ce167fc36.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 2f8bc51dd0c5b9376259ae03e2a145e5261e06a9 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:14 2022 +0200 media: dvb-usb: move USB IDs to dvb-usb-ids.h Almost all drivers based on dvb-usb place their USB IDs at dvb-usb-ids.h. In order to make it more standard, place the remaining ones also there. Link: https://lore.kernel.org/linux-media/7b32d5383169d23082758a7b69edef2f099202f3.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 964320cb45eecdcd0bd322896593bf805d8b3711 Author: Mauro Carvalho Chehab Date: Mon Mar 28 22:41:13 2022 +0200 media: dvb-usb-ids.h: sort entries The entries there are alphabetically sorted, but some are at the wrong place. Re-sort them. While here, replace spaces by tabs where needed. Link: https://lore.kernel.org/linux-media/0208dbba189b754b999759f06c2584242c879f4d.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 3cb4503a330159dc5cf2f8382181ccbabbbaa5b2 Author: Christoph Hellwig Date: Thu Feb 17 15:10:54 2022 +0100 x86: remove cruft from gets pulled in by all drivers using the DMA API. Remove x86 internal variables and unnecessary includes from it. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 6424e31b1c050a25aea033206d5f626f3523448c Author: Christoph Hellwig Date: Tue Mar 15 07:41:04 2022 +0100 swiotlb: remove swiotlb_init_with_tbl and swiotlb_init_late_with_tbl No users left. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 3f70356edf5611c28a68d8d5a9c2b442c9eb81e6 Author: Christoph Hellwig Date: Mon Mar 14 07:58:45 2022 +0100 swiotlb: merge swiotlb-xen initialization into swiotlb Reuse the generic swiotlb initialization for xen-swiotlb. For ARM/ARM64 this works trivially, while for x86 xen_swiotlb_fixup needs to be passed as the remap argument to swiotlb_init_remap/swiotlb_init_late. Note that the lower bound of the swiotlb size is changed to the smaller IO_TLB_MIN_SLABS based value with this patch, but that is fine as the 2MB value used in Xen before was just an optimization and is not the hard lower bound. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 7374153d294eb51de5a81ac38ff1c4fef8927bec Author: Christoph Hellwig Date: Mon Mar 14 08:02:57 2022 +0100 swiotlb: provide swiotlb_init variants that remap the buffer To shared more code between swiotlb and xen-swiotlb, offer a swiotlb_init_remap interface and add a remap callback to swiotlb_init_late that will allow Xen to remap the buffer without duplicating much of the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 742519538e6b07250c8085bbff4bd358bc03bf16 Author: Christoph Hellwig Date: Mon Feb 14 11:12:59 2022 +0100 swiotlb: pass a gfp_mask argument to swiotlb_init_late Let the caller chose a zone to allocate from. This will be used later on by the xen-swiotlb initialization on arm. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 8ba2ed1be90fc210126f68186564707478552c95 Author: Christoph Hellwig Date: Mon Feb 28 13:36:57 2022 +0200 swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction Power SVM wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Consolidate the support for this into the swiotlb_init interface by adding a new flag. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit c6af2aa9ffc9763826607bc2664ef3ea4475ed18 Author: Christoph Hellwig Date: Tue Mar 29 17:27:33 2022 +0200 swiotlb: make the swiotlb_init interface more useful Pass a boolean flag to indicate if swiotlb needs to be enabled based on the addressing needs, and replace the verbose argument with a set of flags, including one to force enable bounce buffering. Note that this patch removes the possibility to force xen-swiotlb use with the swiotlb=force parameter on the command line on x86 (arm and arm64 never supported that), but this interface will be restored shortly. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit a3e230926708125205ffd06d3dc2175a8263ae7e Author: Christoph Hellwig Date: Tue Mar 29 17:25:54 2022 +0200 x86: centralize setting SWIOTLB_FORCE when guest memory encryption is enabled Move enabling SWIOTLB_FORCE for guest memory encryption into common code. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 78013eaadf696d2105982abb4018fbae394ca08f Author: Christoph Hellwig Date: Mon Feb 14 14:11:44 2022 +0100 x86: remove the IOMMU table infrastructure The IOMMU table tries to separate the different IOMMUs into different backends, but actually requires various cross calls. Rewrite the code to do the generic swiotlb/swiotlb-xen setup directly in pci-dma.c and then just call into the IOMMU drivers. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit f39f8d0eb081407e470396fd4cc376c526d13066 Author: Christoph Hellwig Date: Mon Feb 14 09:27:47 2022 +0100 MIPS/octeon: use swiotlb_init instead of open coding it Use the generic swiotlb initialization helper instead of open coding it. Signed-off-by: Christoph Hellwig Acked-by: Thomas Bogendoerfer Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 9bbe7a7fc126e3d14fefa4b035854aba080926d9 Author: Stefano Stabellini Date: Fri Mar 4 15:22:54 2022 -0800 arm/xen: don't check for xen_initial_domain() in xen_create_contiguous_region It used to be that Linux enabled swiotlb-xen when running a dom0 on ARM. Since f5079a9a2a31 "xen/arm: introduce XENFEAT_direct_mapped and XENFEAT_not_direct_mapped", Linux detects whether to enable or disable swiotlb-xen based on the new feature flags: XENFEAT_direct_mapped and XENFEAT_not_direct_mapped. However, there is still a leftover xen_initial_domain() check in xen_create_contiguous_region. Remove the check as xen_create_contiguous_region is only called by swiotlb-xen during initialization. If xen_create_contiguous_region is called, we know Linux is running 1:1 mapped so there is no need for additional checks. Also update the in-code comment. Signed-off-by: Stefano Stabellini Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk commit 0d5ffd9a256d8995764f9d4a35a8c3917839d169 Author: Christoph Hellwig Date: Mon Feb 14 11:07:28 2022 +0100 swiotlb: rename swiotlb_late_init_with_default_size swiotlb_late_init_with_default_size is an overly verbose name that doesn't even catch what the function is doing, given that the size is not just a default but the actual requested size. Rename it to swiotlb_init_late. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit a2daa27c0c6137481226aee5b3136e453c642929 Author: Christoph Hellwig Date: Mon Feb 14 11:44:42 2022 +0100 swiotlb: simplify swiotlb_max_segment Remove the bogus Xen override that was usually larger than the actual size and just calculate the value on demand. Note that swiotlb_max_segment still doesn't make sense as an interface and should eventually be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 3469d36d470df148e8d940c1a6399510562bf3b0 Author: Christoph Hellwig Date: Mon Feb 14 10:01:26 2022 +0100 swiotlb: make swiotlb_exit a no-op if SWIOTLB_FORCE is set If force bouncing is enabled we can't release the buffers. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 07410559f38360885e91cff1b800168681ac515c Author: Christoph Hellwig Date: Mon Feb 14 09:44:32 2022 +0100 dma-direct: use is_swiotlb_active in dma_direct_map_page Use the more specific is_swiotlb_active check instead of checking the global swiotlb_force variable. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky commit 8fd6533ef3f7729e4aa29ead83844c042688615a Author: Haowen Bai Date: Wed Apr 6 21:07:15 2022 +0200 drbd: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./drivers/block/drbd/drbd_req.c:912:9-10: WARNING: return of 0/1 in function 'remote_due_to_read_balancing' with return type bool Signed-off-by: Haowen Bai Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-8-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit 90c6c291453922362ae026f1049843368111bdfe Author: Uladzislau Rezki (Sony) Date: Wed Apr 6 21:07:14 2022 +0200 drdb: Switch to kvfree_rcu() API Instead of invoking a synchronize_rcu() to free a pointer after a grace period we can directly make use of new API that does the same but in more efficient way. TO: Jens Axboe TO: Philipp Reisner TO: Jason Gunthorpe TO: drbd-dev@lists.linbit.com TO: linux-block@vger.kernel.org Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-7-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit e6be38a164ba2023af9c5c2c35eb728cb1825120 Author: Cai Huoqing Date: Wed Apr 6 21:07:13 2022 +0200 drbd: Replace "unsigned" with "unsigned int" when run checkpath.pl for the first patch, found that WARNING: Prefer 'unsigned int' to bare use of 'unsigned'. so fix it. BTW Signed-off-by: Cai Huoqing Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-6-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit ba6bee98d0c539a1e78fe62949fe16032e8f68fb Author: Cai Huoqing Date: Wed Apr 6 21:07:12 2022 +0200 drbd: Make use of PFN_UP helper macro it's a refactor to make use of PFN_UP helper macro Signed-off-by: Cai Huoqing Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-5-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit e1838cf01b2dbc71ac579bd762158c62a3e63f6f Author: Jiapeng Chong Date: Wed Apr 6 21:07:11 2022 +0200 block: drbd: drbd_receiver: Remove redundant assignment to err Variable err is set to '-EIO' but this value is never read as it is overwritten or not used later on, hence it is a redundant assignment and can be removed. Clean up the following clang-analyzer warning: drivers/block/drbd/drbd_receiver.c:3955:5: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-4-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit 4b28f3b448df42a202ebf2d8824280ee71e6d79a Author: Arnd Bergmann Date: Wed Apr 6 21:07:10 2022 +0200 drbd: address enum mismatch warnings gcc -Wextra warns about mixing drbd_state_rv with drbd_ret_code in a couple of places: drivers/block/drbd/drbd_nl.c: In function 'drbd_adm_set_role': drivers/block/drbd/drbd_nl.c:777:14: warning: comparison between 'enum drbd_state_rv' and 'enum drbd_ret_code' [-Wenum-compare] 777 | if (retcode != NO_ERROR) | ^~ drivers/block/drbd/drbd_nl.c:784:12: warning: implicit conversion from 'enum drbd_ret_code' to 'enum drbd_state_rv' [-Wenum-conversion] 784 | retcode = ERR_MANDATORY_TAG; | ^ drivers/block/drbd/drbd_nl.c: In function 'drbd_adm_attach': drivers/block/drbd/drbd_nl.c:1965:10: warning: implicit conversion from 'enum drbd_state_rv' to 'enum drbd_ret_code' [-Wenum-conversion] 1965 | retcode = rv; /* FIXME: Type mismatch. */ | ^ drivers/block/drbd/drbd_nl.c: In function 'drbd_adm_connect': drivers/block/drbd/drbd_nl.c:2690:10: warning: implicit conversion from 'enum drbd_state_rv' to 'enum drbd_ret_code' [-Wenum-conversion] 2690 | retcode = conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE); | ^ drivers/block/drbd/drbd_nl.c: In function 'drbd_adm_disconnect': drivers/block/drbd/drbd_nl.c:2803:11: warning: implicit conversion from 'enum drbd_state_rv' to 'enum drbd_ret_code' [-Wenum-conversion] 2803 | retcode = rv; /* FIXME: Type mismatch. */ | ^ In each case, both are passed into drbd_adm_finish(), which just takes a 32-bit integer and is happy with either, presumably intentionally. Restructure the code to pass either type directly in there in most cases, avoiding the warnings. Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-3-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit 33cb0917bbe241dd17a2b87ead63514c1b7e5615 Author: Arnd Bergmann Date: Wed Apr 6 21:07:09 2022 +0200 drbd: fix duplicate array initializer There are two initializers for P_RETRY_WRITE: drivers/block/drbd/drbd_main.c:3676:22: warning: initialized field overwritten [-Woverride-init] Remove the first one since it was already ignored by the compiler and reorder the list to match the enum definition. As P_ZEROES had no entry, add that one instead. Fixes: 036b17eaab93 ("drbd: Receiving part for the PROTOCOL_UPDATE packet") Fixes: f31e583aa2c2 ("drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire")") Signed-off-by: Arnd Bergmann Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220406190715.1938174-2-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe commit c22198e78d523c8fa079bbb70b2523bb6aa51849 Author: Christoph Hellwig Date: Fri Apr 15 06:52:58 2022 +0200 direct-io: remove random prefetches Randomly poking into block device internals for manual prefetches isn't exactly a very maintainable thing to do. And none of the performance critical direct I/O implementations still use this library function anyway, so just drop it. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20220415045258.199825-28-hch@lst.de Signed-off-by: Jens Axboe commit 44abff2c0b970ae3d310b97617525dc01f248d7c Author: Christoph Hellwig Date: Fri Apr 15 06:52:57 2022 +0200 block: decouple REQ_OP_SECURE_ERASE from REQ_OP_DISCARD Secure erase is a very different operation from discard in that it is a data integrity operation vs hint. Fully split the limits and helper infrastructure to make the separation more clear. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Ryusuke Konishi [nifs2] Acked-by: Jaegeuk Kim [f2fs] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] Acked-by: Chao Yu Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-27-hch@lst.de Signed-off-by: Jens Axboe commit 7b47ef52d0a2025fd1408a8a0990933b8e1e510f Author: Christoph Hellwig Date: Fri Apr 15 06:52:56 2022 +0200 block: add a bdev_discard_granularity helper Abstract away implementation details from file systems by providing a block_device based helper to retrieve the discard granularity. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Ryusuke Konishi Acked-by: David Sterba [btrfs] Link: https://lore.kernel.org/r/20220415045258.199825-26-hch@lst.de Signed-off-by: Jens Axboe commit 70200574cc229f6ba038259e8142af2aa09e6976 Author: Christoph Hellwig Date: Fri Apr 15 06:52:55 2022 +0200 block: remove QUEUE_FLAG_DISCARD Just use a non-zero max_discard_sectors as an indicator for discard support, similar to what is done for write zeroes. The only places where needs special attention is the RAID5 driver, which must clear discard support for security reasons by default, even if the default stacking rules would allow for it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Jan Höppner [s390] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-25-hch@lst.de Signed-off-by: Jens Axboe commit cf0fbf894bb543f472f682c486be48298eccf199 Author: Christoph Hellwig Date: Fri Apr 15 06:52:54 2022 +0200 block: add a bdev_max_discard_sectors helper Add a helper to query the number of sectors support per each discard bio based on the block device and use this helper to stop various places from poking into the request_queue to see if discard is supported and if so how much. This mirrors what is done e.g. for write zeroes as well. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Christoph Böhmwalder [drbd] Acked-by: Coly Li [bcache] Acked-by: David Sterba [btrfs] Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-24-hch@lst.de Signed-off-by: Jens Axboe commit e3cc28ea28b5f8794db2aed24f8a0282ad2e85a2 Author: Christoph Hellwig Date: Fri Apr 15 06:52:53 2022 +0200 block: refactor discard bio size limiting Move all the logic to limit the discard bio size into a common helper so that it is better documented. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: Coly Li Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-23-hch@lst.de Signed-off-by: Jens Axboe commit 5c4b4a5c6f11c869a57c6bd977143430bc9dc43d Author: Christoph Hellwig Date: Fri Apr 15 06:52:52 2022 +0200 block: move {bdev,queue_limit}_discard_alignment out of line No need to inline these fairly larger helpers. Also fix the return value to be unsigned, just like the field in struct queue_limits. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220415045258.199825-22-hch@lst.de Signed-off-by: Jens Axboe commit f0f975a4dde890bfe25ce17bf07a6495453988a4 Author: Christoph Hellwig Date: Fri Apr 15 06:52:51 2022 +0200 block: use bdev_discard_alignment in part_discard_alignment_show Use the bdev based alignment helper instead of open coding it. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220415045258.199825-21-hch@lst.de Signed-off-by: Jens Axboe commit 4e1462ffe8998749884d61f91be251a7a8719677 Author: Christoph Hellwig Date: Fri Apr 15 06:52:50 2022 +0200 block: remove queue_discard_alignment Just use bdev_alignment_offset in disk_discard_alignment_show instead. That helpers is the same except for an always false branch that doesn't matter in this slow path. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220415045258.199825-20-hch@lst.de Signed-off-by: Jens Axboe commit 89098b075cb74a80083bc4ed6b71d0ee18b6898f Author: Christoph Hellwig Date: Fri Apr 15 06:52:49 2022 +0200 block: move bdev_alignment_offset and queue_limit_alignment_offset out of line No need to inline these fairly larger helpers. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220415045258.199825-19-hch@lst.de Signed-off-by: Jens Axboe commit 640f2a23911b8388989547f89d055afbb910b88e Author: Christoph Hellwig Date: Fri Apr 15 06:52:48 2022 +0200 block: use bdev_alignment_offset in disk_alignment_offset_show This does the same as the open coded variant except for an extra branch, and allows to remove queue_alignment_offset entirely. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220415045258.199825-18-hch@lst.de Signed-off-by: Jens Axboe commit 64dcc7c2717395b7c83ffb10f040d3be795d03c1 Author: Christoph Hellwig Date: Fri Apr 15 06:52:47 2022 +0200 block: use bdev_alignment_offset in part_alignment_offset_show Replace the open coded offset calculation with the proper helper. This is an ABI change in that the -1 for a misaligned partition is properly propagated, which can be considered a bug fix and matches what is done on the whole device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-17-hch@lst.de Signed-off-by: Jens Axboe commit 2aba0d19f4d8c8929b4b3b94a9cfde2aa20e6ee2 Author: Christoph Hellwig Date: Fri Apr 15 06:52:46 2022 +0200 block: add a bdev_max_zone_append_sectors helper Add a helper to check the max supported sectors for zone append based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Acked-by: Damien Le Moal Reviewed-by: Martin K. Petersen Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-16-hch@lst.de Signed-off-by: Jens Axboe commit 36d254893aa6a6e204075c3cce94bb572ac32c04 Author: Christoph Hellwig Date: Fri Apr 15 06:52:45 2022 +0200 block: add a bdev_stable_writes helper Add a helper to check the stable writes flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-15-hch@lst.de Signed-off-by: Jens Axboe commit a557e82e5a01826f902bd94fc925c03f253cb712 Author: Christoph Hellwig Date: Fri Apr 15 06:52:44 2022 +0200 block: add a bdev_fua helper Add a helper to check the FUA flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-14-hch@lst.de Signed-off-by: Jens Axboe commit 08e688fdb8f7e862092ae64cee20bc8b463d1046 Author: Christoph Hellwig Date: Fri Apr 15 06:52:43 2022 +0200 block: add a bdev_write_cache helper Add a helper to check the write cache flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-13-hch@lst.de Signed-off-by: Jens Axboe commit 10f0d2a517796b8f6dc04fb0cc3e49003ae6b0bc Author: Christoph Hellwig Date: Fri Apr 15 06:52:42 2022 +0200 block: add a bdev_nonrot helper Add a helper to check the nonrot flag based on the block_device instead of having to poke into the block layer internal request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Acked-by: David Sterba [btrfs] Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-12-hch@lst.de Signed-off-by: Jens Axboe commit 9964e674559b02619fee2012a56839624143d02e Author: Christoph Hellwig Date: Fri Apr 15 06:52:41 2022 +0200 mm: use bdev_is_zoned in claim_swapfile Use the bdev based helper instead of poking into the queue. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-11-hch@lst.de Signed-off-by: Jens Axboe commit f09dac9afb8e3ce4b6485dbc091a9b9c742db023 Author: Christoph Hellwig Date: Fri Apr 15 06:52:40 2022 +0200 ntfs3: use bdev_logical_block_size instead of open coding it Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220415045258.199825-10-hch@lst.de Signed-off-by: Jens Axboe commit c1e7b24416400ef13ff92a1c60c336c9a2834d7b Author: Christoph Hellwig Date: Fri Apr 15 06:52:39 2022 +0200 btrfs: use bdev_max_active_zones instead of open coding it Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Acked-by: David Sterba Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-9-hch@lst.de Signed-off-by: Jens Axboe commit 998e9cbcd615e5e6a7baa69e673ee845f812744e Author: Christoph Hellwig Date: Fri Apr 15 06:52:38 2022 +0200 drbd: cleanup decide_on_discard_support Sanitize the calling conventions and use a goto label to cleanup the code flow. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-8-hch@lst.de Signed-off-by: Jens Axboe commit c6f23b1a05441a26f765e59dd95e8ba7354f9388 Author: Christoph Hellwig Date: Fri Apr 15 06:52:37 2022 +0200 drbd: use bdev_alignment_offset instead of queue_alignment_offset The bdev version does the right thing for partitions, so use that. Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support") Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-7-hch@lst.de Signed-off-by: Jens Axboe commit 7a38acce229685968b770d1d9e64e01396b93643 Author: Christoph Hellwig Date: Fri Apr 15 06:52:36 2022 +0200 drbd: use bdev based limit helpers in drbd_send_sizes Use the bdev based limits helpers where they exist. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-6-hch@lst.de Signed-off-by: Jens Axboe commit 40349d0e16cedd0de561f59752c3249780fb749b Author: Christoph Hellwig Date: Fri Apr 15 06:52:35 2022 +0200 drbd: remove assign_p_sizes_qlim Fold each branch into its only caller. Signed-off-by: Christoph Hellwig Acked-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220415045258.199825-5-hch@lst.de Signed-off-by: Jens Axboe commit 968786b9ef56e75e0109158a4936ffffea962c1e Author: Christoph Hellwig Date: Fri Apr 15 06:52:34 2022 +0200 target: fix discard alignment on partitions Use the proper bdev_discard_alignment helper that accounts for partition offsets. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-4-hch@lst.de Signed-off-by: Jens Axboe commit 817e8b51eb3d927ce6d56ecf9f48bc3c5b26168b Author: Christoph Hellwig Date: Fri Apr 15 06:52:33 2022 +0200 target: pass a block_device to target_configure_unmap_from_queue The SCSI target drivers is a consumer of the block layer and shoul d generally work on struct block_device. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-3-hch@lst.de Signed-off-by: Jens Axboe commit 179d8609d8424529e95021df939ed7b0b82b37f1 Author: Christoph Hellwig Date: Fri Apr 15 06:52:32 2022 +0200 target: remove an incorrect unmap zeroes data deduction For block devices, the SCSI target drivers implements UNMAP as calls to blkdev_issue_discard, which does not guarantee zeroing just because Write Zeroes is supported. Note that this does not affect the file backed path which uses fallocate to punch holes. Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout") Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220415045258.199825-2-hch@lst.de Signed-off-by: Jens Axboe commit 075a53b78b815301f8d3dd1ee2cd99554e34f0dd Author: Jan Kara Date: Fri Apr 1 12:27:50 2022 +0200 bfq: Make sure bfqg for which we are queueing requests is online Bios queued into BFQ IO scheduler can be associated with a cgroup that was already offlined. This may then cause insertion of this bfq_group into a service tree. But this bfq_group will get freed as soon as last bio associated with it is completed leading to use after free issues for service tree users. Fix the problem by making sure we always operate on online bfq_group. If the bfq_group associated with the bio is not online, we pick the first online parent. CC: stable@vger.kernel.org Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support") Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-9-jack@suse.cz Signed-off-by: Jens Axboe commit 4e54a2493e582361adc3bfbf06c7d50d19d18837 Author: Jan Kara Date: Fri Apr 1 12:27:49 2022 +0200 bfq: Get rid of __bio_blkcg() usage BFQ usage of __bio_blkcg() is a relict from the past. Furthermore if bio would not be associated with any blkcg, the usage of __bio_blkcg() in BFQ is prone to races with the task being migrated between cgroups as __bio_blkcg() calls at different places could return different blkcgs. Convert BFQ to the new situation where bio->bi_blkg is initialized in bio_set_dev() and thus practically always valid. This allows us to save blkcg_gq lookup and noticeably simplify the code. CC: stable@vger.kernel.org Fixes: 0fe061b9f03c ("blkcg: fix ref count issue with bio_blkcg() using task_css") Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-8-jack@suse.cz Signed-off-by: Jens Axboe commit 09f871868080c33992cd6a9b72a5ca49582578fa Author: Jan Kara Date: Fri Apr 1 12:27:48 2022 +0200 bfq: Track whether bfq_group is still online Track whether bfq_group is still online. We cannot rely on blkcg_gq->online because that gets cleared only after all policies are offlined and we need something that gets updated already under bfqd->lock when we are cleaning up our bfq_group to be able to guarantee that when we see online bfq_group, it will stay online while we are holding bfqd->lock lock. CC: stable@vger.kernel.org Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-7-jack@suse.cz Signed-off-by: Jens Axboe commit 5f550ede5edf846ecc0067be1ba80514e6fe7f8e Author: Jan Kara Date: Fri Apr 1 12:27:47 2022 +0200 bfq: Remove pointless bfq_init_rq() calls We call bfq_init_rq() from request merging functions where requests we get should have already gone through bfq_init_rq() during insert and anyway we want to do anything only if the request is already tracked by BFQ. So replace calls to bfq_init_rq() with RQ_BFQQ() instead to simply skip requests untracked by BFQ. We move bfq_init_rq() call in bfq_insert_request() a bit earlier to cover request merging and thus can transfer FIFO position in case of a merge. CC: stable@vger.kernel.org Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-6-jack@suse.cz Signed-off-by: Jens Axboe commit fc84e1f941b91221092da5b3102ec82da24c5673 Author: Jan Kara Date: Fri Apr 1 12:27:46 2022 +0200 bfq: Drop pointless unlock-lock pair In bfq_insert_request() we unlock bfqd->lock only to call trace_block_rq_insert() and then lock bfqd->lock again. This is really pointless since tracing is disabled if we really care about performance and even if the tracepoint is enabled, it is a quick call. CC: stable@vger.kernel.org Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-5-jack@suse.cz Signed-off-by: Jens Axboe commit ea591cd4eb270393810e7be01feb8fde6a34fbbe Author: Jan Kara Date: Fri Apr 1 12:27:45 2022 +0200 bfq: Update cgroup information before merging bio When the process is migrated to a different cgroup (or in case of writeback just starts submitting bios associated with a different cgroup) bfq_merge_bio() can operate with stale cgroup information in bic. Thus the bio can be merged to a request from a different cgroup or it can result in merging of bfqqs for different cgroups or bfqqs of already dead cgroups and causing possible use-after-free issues. Fix the problem by updating cgroup information in bfq_merge_bio(). CC: stable@vger.kernel.org Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support") Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-4-jack@suse.cz Signed-off-by: Jens Axboe commit 3bc5e683c67d94bd839a1da2e796c15847b51b69 Author: Jan Kara Date: Fri Apr 1 12:27:44 2022 +0200 bfq: Split shared queues on move between cgroups When bfqq is shared by multiple processes it can happen that one of the processes gets moved to a different cgroup (or just starts submitting IO for different cgroup). In case that happens we need to split the merged bfqq as otherwise we will have IO for multiple cgroups in one bfqq and we will just account IO time to wrong entities etc. Similarly if the bfqq is scheduled to merge with another bfqq but the merge didn't happen yet, cancel the merge as it need not be valid anymore. CC: stable@vger.kernel.org Fixes: e21b7a0b9887 ("block, bfq: add full hierarchical scheduling and cgroups support") Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-3-jack@suse.cz Signed-off-by: Jens Axboe commit c1cee4ab36acef271be9101590756ed0c0c374d9 Author: Jan Kara Date: Fri Apr 1 12:27:43 2022 +0200 bfq: Avoid merging queues with different parents It can happen that the parent of a bfqq changes between the moment we decide two queues are worth to merge (and set bic->stable_merge_bfqq) and the moment bfq_setup_merge() is called. This can happen e.g. because the process submitted IO for a different cgroup and thus bfqq got reparented. It can even happen that the bfqq we are merging with has parent cgroup that is already offline and going to be destroyed in which case the merge can lead to use-after-free issues such as: BUG: KASAN: use-after-free in __bfq_deactivate_entity+0x9cb/0xa50 Read of size 8 at addr ffff88800693c0c0 by task runc:[2:INIT]/10544 CPU: 0 PID: 10544 Comm: runc:[2:INIT] Tainted: G E 5.15.2-0.g5fb85fd-default #1 openSUSE Tumbleweed (unreleased) f1f3b891c72369aebecd2e43e4641a6358867c70 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack_lvl+0x46/0x5a print_address_description.constprop.0+0x1f/0x140 ? __bfq_deactivate_entity+0x9cb/0xa50 kasan_report.cold+0x7f/0x11b ? __bfq_deactivate_entity+0x9cb/0xa50 __bfq_deactivate_entity+0x9cb/0xa50 ? update_curr+0x32f/0x5d0 bfq_deactivate_entity+0xa0/0x1d0 bfq_del_bfqq_busy+0x28a/0x420 ? resched_curr+0x116/0x1d0 ? bfq_requeue_bfqq+0x70/0x70 ? check_preempt_wakeup+0x52b/0xbc0 __bfq_bfqq_expire+0x1a2/0x270 bfq_bfqq_expire+0xd16/0x2160 ? try_to_wake_up+0x4ee/0x1260 ? bfq_end_wr_async_queues+0xe0/0xe0 ? _raw_write_unlock_bh+0x60/0x60 ? _raw_spin_lock_irq+0x81/0xe0 bfq_idle_slice_timer+0x109/0x280 ? bfq_dispatch_request+0x4870/0x4870 __hrtimer_run_queues+0x37d/0x700 ? enqueue_hrtimer+0x1b0/0x1b0 ? kvm_clock_get_cycles+0xd/0x10 ? ktime_get_update_offsets_now+0x6f/0x280 hrtimer_interrupt+0x2c8/0x740 Fix the problem by checking that the parent of the two bfqqs we are merging in bfq_setup_merge() is the same. Link: https://lore.kernel.org/linux-block/20211125172809.GC19572@quack2.suse.cz/ CC: stable@vger.kernel.org Fixes: 430a67f9d616 ("block, bfq: merge bursts of newly-created queues") Tested-by: "yukuai (C)" Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-2-jack@suse.cz Signed-off-by: Jens Axboe commit 70456e5210f40ffdb8f6d905acfdcec5bd5fad9e Author: Jan Kara Date: Fri Apr 1 12:27:42 2022 +0200 bfq: Avoid false marking of bic as stably merged bfq_setup_cooperator() can mark bic as stably merged even though it decides to not merge its bfqqs (when bfq_setup_merge() returns NULL). Make sure to mark bic as stably merged only if we are really going to merge bfqqs. CC: stable@vger.kernel.org Tested-by: "yukuai (C)" Fixes: 430a67f9d616 ("block, bfq: merge bursts of newly-created queues") Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-1-jack@suse.cz Signed-off-by: Jens Axboe commit 852ad96cb03621f7995764b4b31cbff9801d8bcd Author: Christoph Hellwig Date: Wed Apr 6 08:12:28 2022 +0200 pktcdvd: stop using bio_reset Just initialize the bios on-demand. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220406061228.410163-6-hch@lst.de Signed-off-by: Jens Axboe commit 066ff571011d8416e903d3d4f1f41e0b5eb91e1d Author: Christoph Hellwig Date: Wed Apr 6 08:12:27 2022 +0200 block: turn bio_kmalloc into a simple kmalloc wrapper Remove the magic autofree semantics and require the callers to explicitly call bio_init to initialize the bio. This allows bio_free to catch accidental bio_put calls on bio_init()ed bios as well. Signed-off-by: Christoph Hellwig Acked-by: Coly Li Acked-by: Mike Snitzer Link: https://lore.kernel.org/r/20220406061228.410163-5-hch@lst.de Signed-off-by: Jens Axboe commit 7655db80932d95f501a0811544d9520ec720e38d Author: Christoph Hellwig Date: Wed Apr 6 08:12:26 2022 +0200 target/pscsi: remove pscsi_get_bio Remove pscsi_get_bio and simplify the code flow in the only caller. Signed-off-by: Christoph Hellwig Acked-by: Martin K. Petersen Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220406061228.410163-4-hch@lst.de Signed-off-by: Jens Axboe commit 46a2d4ccc49903923506685a8368ca88312bbdc9 Author: Christoph Hellwig Date: Wed Apr 6 08:12:25 2022 +0200 squashfs: always use bio_kmalloc in squashfs_bio_read If a plain kmalloc that is not backed by a mempool is safe here for a large read (and the actual page allocations), it must also be for a small one, so simplify the code a bit. Signed-off-by: Christoph Hellwig Acked-by: Phillip Lougher Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220406061228.410163-3-hch@lst.de Signed-off-by: Jens Axboe commit f9e69aa9ccd7e51c47b147e45e03987ea0ef9aa3 Author: Christoph Hellwig Date: Wed Apr 6 08:12:24 2022 +0200 btrfs: simplify ->flush_bio handling Use and embedded bios that is initialized when used instead of bio_kmalloc plus bio_reset. Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220406061228.410163-2-hch@lst.de Signed-off-by: Jens Axboe commit 925fbe1f7eb6fa7077d92b591b7ced1367358563 Author: Jae Hyun Yoo Date: Tue Mar 29 10:39:30 2022 -0700 dt-bindings: pinctrl: aspeed-g6: add FWQSPI function/group Add FWQSPI function/group to support QSPI mode on the dedicated FWSPI interface. Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220329173932.2588289-6-quic_jaehyoo@quicinc.com Signed-off-by: Linus Walleij commit f8b61bb62908d4e5129db79796a9ec7b59712da3 Author: Johnny Huang Date: Tue Mar 29 10:39:29 2022 -0700 pinctrl: pinctrl-aspeed-g6: add FWQSPI function-group Add FWSPIDQ2 (AE12) and FWSPIDQ3 (AF12) function-group to support AST2600 FW SPI quad mode. These pins can be used with dedicated FW SPI pins - FWSPICS0# (AB14), FWSPICK (AF13), FWSPIMOSI (AC14) and FWSPIMISO (AB13). Signed-off-by: Johnny Huang Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20220329173932.2588289-5-quic_jaehyoo@quicinc.com Signed-off-by: Linus Walleij commit d08afeb445ca8e97e25976e1082631e9fc07cf23 Author: Jae Hyun Yoo Date: Tue Mar 29 10:39:28 2022 -0700 dt-bindings: pinctrl: aspeed-g6: remove FWQSPID group FWQSPID is not a group of FWSPID so remove it. Fixes: 7488838f2315 ("dt-bindings: pinctrl: aspeed: Document AST2600 pinmux") Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220329173932.2588289-4-quic_jaehyoo@quicinc.com Signed-off-by: Linus Walleij commit 05ffcd0d6287ef84dc2bd9ccf1e5b18917adfceb Author: Jae Hyun Yoo Date: Tue Mar 29 10:39:27 2022 -0700 pinctrl: pinctrl-aspeed-g6: remove FWQSPID group in pinctrl FWSPIDQ2 and FWSPIDQ3 are not part of FWSPI18 interface so remove FWQSPID group in pinctrl. These pins must be used with the FWSPI pins that are dedicated for boot SPI interface which provides same 3.3v logic level. Fixes: 2eda1cdec49f ("pinctrl: aspeed: Add AST2600 pinmux support") Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20220329173932.2588289-3-quic_jaehyoo@quicinc.com Signed-off-by: Linus Walleij commit f8970fdc73173649d7615df50d73fd2117ea00ca Author: Chris Packham Date: Fri Apr 15 11:30:53 2022 +1200 pinctrl: mvebu: pinctrl driver for 98DX2530 SoC This pinctrl driver supports the 98DX25xx and 98DX35xx family of chips from Marvell. It is based on the Marvell SDK with additions for various (non-gpio) pin configurations based on the datasheet. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220414233055.586962-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Linus Walleij commit 9247752bac3a66a752f3f926c40996935da14e69 Author: Chris Packham Date: Fri Apr 15 11:30:52 2022 +1200 dt-bindings: pinctrl: mvebu: Document bindings for AC5 Add JSON schema for marvell,ac5-pinctrl present on the Marvell 98DX2530 SoC. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220414233055.586962-2-chris.packham@alliedtelesis.co.nz Signed-off-by: Linus Walleij commit 90337380c80944381160897934b463ad47332adf Author: Bhupesh Sharma Date: Sun Feb 27 00:10:26 2022 +0530 pinctrl: qcom: sm8150: Specify PDC map Specify the PDC mapping for SM8150, so that gpio interrupts are properly mapped to the wakeup IRQs of the PDC. Cc: Maulik Shah Cc: Bjorn Andersson Cc: Linus Walleij Signed-off-by: Bhupesh Sharma Acked-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220226184028.111566-3-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit 6d289c378af46e4832b3425fb31d96438b2b38e6 Author: Bhupesh Sharma Date: Sun Feb 27 00:10:25 2022 +0530 dt-bindings: qcom,pdc: Add compatible for SM8150 Add the compatible string for SM8150 SoC from Qualcomm. Cc: Bjorn Andersson Cc: Vinod Koul Cc: Marc Zyngier Acked-by: Rob Herring Signed-off-by: Bhupesh Sharma Reviewed-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20220226184028.111566-2-bhupesh.sharma@linaro.org Signed-off-by: Linus Walleij commit 66ab05c75642712f382a17a887eb558caa6646e1 Author: Jeff LaBundy Date: Sun Apr 17 16:05:07 2022 -0700 Input: iqs7222 - avoid dereferencing a NULL pointer Select callers of iqs7222_parse_props() do not expect a child node to be derived and returned via pointer. As such, these callers set **child_node to NULL. However, this pointer is dereferenced in all cases. To solve this problem, dereference the pointer only for cases that expect a child node in the first place. In these cases, the caller provides a valid pointer. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Reported-by: Dan Carpenter Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220417214132.497487-1-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit b53f3dcd705e52a07bd0311870dbfb6842e88c91 Author: Mike Snitzer Date: Thu Mar 24 16:35:25 2022 -0400 block: allow use of per-cpu bio alloc cache by block drivers Refine per-cpu bio alloc cache interfaces so that DM and other block drivers can properly create and use the cache: DM uses bioset_init_from_src() to do its final bioset initialization, so must update bioset_init_from_src() to set BIOSET_PERCPU_CACHE if %src bioset has a cache. Also move bio_clear_polled() to include/linux/bio.h to allow users outside of block core. Signed-off-by: Mike Snitzer Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220324203526.62306-3-snitzer@kernel.org Signed-off-by: Jens Axboe commit 0df71650c051ab106c921de257f4b38e9e3dd251 Author: Mike Snitzer Date: Thu Mar 24 16:35:24 2022 -0400 block: allow using the per-cpu bio cache from bio_alloc_bioset Replace the BIO_PERCPU_CACHE bio-internal flag with a REQ_ALLOC_CACHE one that can be passed to bio_alloc / bio_alloc_bioset, and implement the percpu cache allocation logic in a helper called from bio_alloc_bioset. This allows any bio_alloc_bioset user to use the percpu caches instead of having the functionality tied to struct kiocb. Signed-off-by: Mike Snitzer [hch: refactored a bit] Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220324203526.62306-2-snitzer@kernel.org Signed-off-by: Jens Axboe commit eba697b3c30320933aeb19b0606c2099fe880e51 Author: Dan Carpenter Date: Sun Apr 17 13:03:53 2022 -0700 Input: iqs7222 - propagate some error codes correctly If fwnode_property_count_u32() returns a negative error code then, because of type promotion, the "count > ARRAY_SIZE(pins)" condition will be true. The negative "count" is type promoted to a high unsigned size_t value. That means the "else if (count < 0)" condition will always be false and we don't print that error message or propagate the error code from fwnode_property_count_u32() as intended. Fix this by re-ordering the checks so that we check for negative first. Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220412153954.GA15406@kili Signed-off-by: Dmitry Torokhov commit 5dc91f2d4f3c160199fea9421d6b08f67a906947 Author: Borislav Petkov Date: Wed Feb 2 20:24:30 2022 +0100 x86/boot: Add an efi.h header for the decompressor Copy the needed symbols only and remove the kernel proper includes. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/YlCKWhMJEMUgJmjF@zn.tnic commit 53c33a16d0688fc20b38e00dbbc2cb2b695e7020 Merge: 7925c2d93005a 8fbf195798b56 Author: David S. Miller Date: Sun Apr 17 13:31:32 2022 +0100 Merge branch 'tcp-drop-reason-additions' Eric Dumazet says: ==================== tcp: drop reason additions Currently, TCP is either missing drop reasons, or pretending that some useful packets are dropped. This patch series makes "perf record -a -e skb:kfree_skb" much more usable. ==================== Signed-off-by: David S. Miller commit 8fbf195798b56e1e87f62d01be636a6425c304c2 Author: Eric Dumazet Date: Fri Apr 15 17:10:48 2022 -0700 tcp: add drop reason support to tcp_ofo_queue() packets in OFO queue might be redundant, and dropped. tcp_drop() is no longer needed. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 659affdb5140599f25418807c3354b060d4b1b88 Author: Eric Dumazet Date: Fri Apr 15 17:10:47 2022 -0700 tcp: add drop reasons to tcp_rcv_synsent_state_process() Re-use existing reasons. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit c337578a6592d671c5e78accc55f00cc594fe2da Author: Eric Dumazet Date: Fri Apr 15 17:10:46 2022 -0700 tcp: make tcp_rcv_synsent_state_process() drop monitor friend 1) A valid RST packet should be consumed, to not confuse drop monitor. 2) Same remark for packet validating cross syn setup, even if we might ignore part of it. 3) When third packet of 3WHS is delayed, do not pretend the SYNACK was dropped. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e7c89ae4078eab24af71ba26b91642e819a4bd7f Author: Eric Dumazet Date: Fri Apr 15 17:10:45 2022 -0700 tcp: add drop reason support to tcp_prune_ofo_queue() Add one reason for packets dropped from OFO queue because of memory pressure. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 4b506af9c5b8de0da34097d50d9448dfb33d70c3 Author: Eric Dumazet Date: Fri Apr 15 17:10:44 2022 -0700 tcp: add two drop reasons for tcp_ack() Add TCP_TOO_OLD_ACK and TCP_ACK_UNSENT_DATA drop reasons so that tcp_rcv_established() can report them. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 669da7a71890b2b2a31a7e9571c0fdf1123e26ef Author: Eric Dumazet Date: Fri Apr 15 17:10:43 2022 -0700 tcp: add drop reasons to tcp_rcv_state_process() Add basic support for drop reasons in tcp_rcv_state_process() Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 37fd4e842391a1b947789969ae8454f1596735c8 Author: Eric Dumazet Date: Fri Apr 15 17:10:42 2022 -0700 tcp: make tcp_rcv_state_process() drop monitor friendly tcp_rcv_state_process() incorrectly drops packets instead of consuming it, making drop monitor very noisy, if not unusable. Calling tcp_time_wait() or tcp_done() is part of standard behavior, packets triggering these actions were not dropped. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit da40b613f89c43c58986e6f30560ad6573a4d569 Author: Eric Dumazet Date: Fri Apr 15 17:10:41 2022 -0700 tcp: add drop reason support to tcp_validate_incoming() Creates four new drop reasons for the following cases: 1) packet being rejected by RFC 7323 PAWS check 2) packet being rejected by SEQUENCE check 3) Invalid RST packet 4) Invalid SYN packet Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b5ec1e6205a1cb719ab188472f00ae81b0800f2e Author: Eric Dumazet Date: Fri Apr 15 17:10:40 2022 -0700 tcp: get rid of rst_seq_match Small cleanup in tcp_validate_incoming(), no need for rst_seq_match setting and testing. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d9d024f96609016628d750ebc8ee4a6f0d80e6e1 Author: Eric Dumazet Date: Fri Apr 15 17:10:39 2022 -0700 tcp: consume incoming skb leading to a reset Whenever tcp_validate_incoming() handles a valid RST packet, we should not pretend the packet was dropped. Create a special section at the end of tcp_validate_incoming() to handle this case. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7925c2d93005ac943bc8517e16f6377132fd251f Merge: f9a2fb73318eb 8d1af50842bf2 Author: David S. Miller Date: Sun Apr 17 13:28:29 2022 +0100 Merge branch 'qca8k_preiv-shrink' Ansuel Smith says: ==================== net: Reduce qca8k_priv space usage These 6 patch is a first attempt at reducting qca8k_priv space. The code changed a lot during times and we have many old logic that can be replaced with new implementation The first patch drop the tracking of MTU. We mimic what was done for mtk and we change MTU only when CPU port is changed. The second patch finally drop a piece of story of this driver. The ar8xxx_port_status struct was used by the first implementation of this driver to put all sort of status data for the port... With the evolution of DSA all that stuff got dropped till only the enabled state was the only part of the that struct. Since it's overkill to keep an array of int, we convert the variable to a simple u8 where we store the status of each port. This is needed to don't reanable ports on system resume. The third patch is a preparation for patch 4. As Vladimir explained in another patch, we waste a tons of space by keeping a duplicate of the switch dsa ops in qca8k_priv. The only reason for this is to dynamically set the correct mdiobus configuration (a legacy dsa one, or a custom dedicated one) To solve this problem, we just drop the phy_read/phy_write and we declare a custom mdiobus in any case. This way we can use a static dsa switch ops struct and we can drop it from qca8k_priv Patch 4 drop the duplicated dsa_switch_ops. Patch 5 is a fixup for mdio read error. Patch 6 is an effort to standardize how bus name are done. This series is just a start of more cleanup. The idea is to move this driver to the qca dir and split common code from specific code. Also the mgmt eth code still requires some love and can totally be optimized by recycling the same skb over time. Also while working on the MTU it was notice some problem with the stmmac driver and with the reloading phase that cause all sort of problems with qca8k. I'm sending this here just to try to keep small series instead of proposing monster series hard to review. v2: - Rework MTU patch v3: - Drop unrealated changes from patch 3 - Add fixup patch for mdio read - Unify bus name for legacy and OF mdio bus ==================== Signed-off-by: David S. Miller commit 8d1af50842bf2774f4edc57054206e909117469b Author: Christian Marangi Date: Sat Apr 16 01:30:17 2022 +0200 net: dsa: qca8k: unify bus id naming with legacy and OF mdio bus Add support for multiple switch with OF mdio bus declaration. Unify the bus id naming and use the same logic for both legacy and OF mdio bus. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 6cfc03b602200c5cbbd8d906fd905547814e83df Author: Christian Marangi Date: Sat Apr 16 01:30:16 2022 +0200 net: dsa: qca8k: correctly handle mdio read error Restore original way to handle mdio read error by returning 0xffff. This was wrongly changed when the internal_mdio_read was introduced, now that both legacy and internal use the same function, make sure that they behave the same way. Fixes: ce062a0adbfe ("net: dsa: qca8k: fix kernel panic with legacy mdio mapping") Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 2349b83a2486c55b9dd225326f0172a84a43c5e4 Author: Christian Marangi Date: Sat Apr 16 01:30:15 2022 +0200 net: dsa: qca8k: drop dsa_switch_ops from qca8k_priv Now that dsa_switch_ops is not switch specific anymore, we can drop it from qca8k_priv and use the static ops directly for the dsa_switch pointer. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8255212e4130bd2dc1463286a3dddb74797bbdc1 Author: Christian Marangi Date: Sat Apr 16 01:30:14 2022 +0200 net: dsa: qca8k: rework and simplify mdiobus logic In an attempt to reduce qca8k_priv space, rework and simplify mdiobus logic. We now declare a mdiobus instead of relying on DSA phy_read/write even if a mdio node is not present. This is all to make the qca8k ops static and not switch specific. With a legacy implementation where port doesn't have a phy map declared in the dts with a mdio node, we declare a 'qca8k-legacy' mdiobus. The conversion logic is used as legacy read and write ops are used instead of the internal one. Also drop the legacy_phy_port_mapping as we now declare mdiobus with ops that already address the workaround. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 2b8fd87af7f156942971789abac8ee2bb60c03bc Author: Christian Marangi Date: Sat Apr 16 01:30:13 2022 +0200 net: dsa: qca8k: drop port_sts from qca8k_priv Port_sts is a thing of the past for this driver. It was something present on the initial implementation of this driver and parts of the original struct were dropped over time. Using an array of int to store if a port is enabled or not to handle PM operation seems overkill. Switch and use a simple u8 to store the port status where each bit correspond to a port. (bit is set port is enabled, bit is not set, port is disabled) Also add some comments to better describe why we need to track port status. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 69fd055957a02309ffdc23d887a01988b6e5bab1 Author: Christian Marangi Date: Sat Apr 16 01:30:12 2022 +0200 net: dsa: qca8k: drop MTU tracking from qca8k_priv DSA set the CPU port based on the largest MTU of all the slave ports. Based on this we can drop the MTU array from qca8k_priv and set the port_change_mtu logic on DSA changing MTU of the CPU port as the switch have a global MTU settingfor each port. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit f9a2fb73318eb4dbf8cd84866b8b0dd012d8b116 Author: Arun Ajith S Date: Fri Apr 15 08:34:02 2022 +0000 net/ipv6: Introduce accept_unsolicited_na knob to implement router-side changes for RFC9131 Add a new neighbour cache entry in STALE state for routers on receiving an unsolicited (gratuitous) neighbour advertisement with target link-layer-address option specified. This is similar to the arp_accept configuration for IPv4. A new sysctl endpoint is created to turn on this behaviour: /proc/sys/net/ipv6/conf/interface/accept_unsolicited_na. Signed-off-by: Arun Ajith S Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 58990892ca29c310eca7df1d39d3dbc1b18c2d0e Author: Len Brown Date: Sat Apr 16 23:50:52 2022 -0400 tools/power turbostat: version 2022.04.16 Signed-off-by: Len Brown commit 9878bf7a9fb08cfb9798cb5a42e9f5b916153db8 Author: Len Brown Date: Sat Apr 16 23:45:18 2022 -0400 tools/power turbostat: No build warnings with -Wextra Signed-off-by: Len Brown commit 164d7a965b3e31b1ea109d2bf5dd68e1b41e020f Author: Len Brown Date: Sat Apr 16 22:25:45 2022 -0400 tools/power turbostat: be more useful as non-root Don't exit if used this way: sudo setcap cap_sys_nice,cap_sys_rawio=+ep ./turbostat sudo chmod +r /dev/cpu/*/msr ./turbostat note: cap_sys_admin is now also needed for the perf IPC counter: sudo setcap cap_sys_admin,cap_sys_nice,cap_sys_rawio=+ep ./turbostat Reported-by: Artem S. Tashkinov Reported-by: Toby Broom Signed-off-by: Len Brown commit 6397b6418935773a34b533b3348b03f4ce3d7050 Author: Len Brown Date: Thu Feb 10 21:06:56 2022 -0500 tools/power turbostat: fix ICX DRAM power numbers ICX (and its duplicates) require special hard-coded DRAM RAPL units, rather than using the generic RAPL energy units. Reported-by: Srinivas Pandruvada Signed-off-by: Len Brown commit eae97e053fe306edbbe60c934031edf9a8affd3f Author: Chen Yu Date: Fri Nov 12 19:51:59 2021 +0800 tools/power turbostat: Support thermal throttle count print The turbostat data is collected by end user for power evaluationit. However it looks like we are missing enough thermal context there. Already a couple of time we found that power management developer asking something like this: grep -r . /sys/devices/system/cpu/cpu*/thermal_throttle/* Print the per core thermal throttle count so as to get suffificent thermal context. turbostat -i 5 -s Core,CPU,CoreThr Core CPU CoreThr - - 104 0 0 61 0 4 1 1 0 1 5 2 2 104 2 6 3 3 7 3 7 Suggested-by: Artem Bityutskiy Signed-off-by: Chen Yu Signed-off-by: Len Brown commit c7e399f839689e9ead863456132f19b88abc3bc9 Author: Zephaniah E. Loss-Cutler-Hull Date: Mon Oct 4 21:54:39 2021 -0700 tools/power turbostat: Allow printing header every N iterations This gives the ability to reprint the header every N iterations, so you can ensure that a scrolling display always has the header visible somewhere on the screen. Signed-off-by: Zephaniah E. Loss-Cutler-Hull Signed-off-by: Len Brown commit 0fc521bc3339b029b2ac172a5b00bd7c9867e83d Author: Zephaniah E. Loss-Cutler-Hull Date: Mon Oct 4 21:54:38 2021 -0700 tools/power turbostat: Allow -e for all names. Currently, there are a number of variables which are displayed by default, enabled with -e all, and listed by --list, but which you can not give to --enable/-e. So you can enable CPU0c1 (in the bic array), but you can't enable C1 or C1% (not in the bic array, but exists in sysfs). This runs counter to both the documentation and user expectations, and it's just not very user friendly. As such, the mechanism used by --hide has been duplicated, and is now also used by --enable, so we can handle unknown names gracefully. Note: One impact of this is that truly unknown fields given to --enable will no longer generate errors, they will be silently ignored, as --hide does. Signed-off-by: Zephaniah E. Loss-Cutler-Hull Signed-off-by: Len Brown commit 6b398625ae6da31783e28b74458c14d2b921ec0f Author: Sumeet Pawnikar Date: Thu Sep 30 18:40:18 2021 +0530 tools/power turbostat: print power values upto three decimal Print power values upto three decimal places in watts. Suggested-by: Tony Luck Signed-off-by: Sumeet Pawnikar Signed-off-by: Len Brown commit f52ba93190457aa285ae805a3e8360a50552cfd8 Author: Sumeet Pawnikar Date: Fri Aug 20 17:42:43 2021 +0530 tools/power turbostat: Add Power Limit4 support Add Power Limit4 support. Signed-off-by: Sumeet Pawnikar Acked-by: Zhang Rui Signed-off-by: Len Brown commit 6799ba84cab7784cb9f060a24790482de209e318 Author: Dan Merillat Date: Sun May 9 05:08:55 2021 -0400 tools/power turbostat: fix dump for AMD cpus turbostat --Dump exits early with status 243 (-13) get_counters() calls get_msr_sum() on zen CPUS for MSR_PKG_ENERGY_STAT, but per_cpu_msr_sum has not been initialized. Signed-off-by: Dan Merillat Signed-off-by: Len Brown commit 5dc241f2b299898f4faadb44ea3cb0a9bb00eda1 Author: Len Brown Date: Fri Jul 16 11:55:03 2021 -0400 tools/power turbostat: tweak --show and --hide capability allow invocations such as # turbostat --show power,Busy% previously the "Busy%" was ignored Signed-off-by: Len Brown commit 2e53b877dc1258d4ac3de98f496bb88ec3bf5e25 Author: Kees Cook Date: Fri Mar 11 12:00:42 2022 -0800 lkdtm: Add CFI_BACKWARD to test ROP mitigations In order to test various backward-edge control flow integrity methods, add a test that manipulates the return address on the stack. Currently only arm64 Pointer Authentication and Shadow Call Stack is supported. $ echo CFI_BACKWARD | cat >/sys/kernel/debug/provoke-crash/DIRECT Under SCS, successful test of the mitigation is reported as: lkdtm: Performing direct entry CFI_BACKWARD lkdtm: Attempting unchecked stack return address redirection ... lkdtm: ok: redirected stack return address. lkdtm: Attempting checked stack return address redirection ... lkdtm: ok: control flow unchanged. Under PAC, successful test of the mitigation is reported by the PAC exception handler: lkdtm: Performing direct entry CFI_BACKWARD lkdtm: Attempting unchecked stack return address redirection ... lkdtm: ok: redirected stack return address. lkdtm: Attempting checked stack return address redirection ... Unable to handle kernel paging request at virtual address bfffffc0088d0514 Mem abort info: ESR = 0x86000004 EC = 0x21: IABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault [bfffffc0088d0514] address between user and kernel address ranges ... If the CONFIGs are missing (or the mitigation isn't working), failure is reported as: lkdtm: Performing direct entry CFI_BACKWARD lkdtm: Attempting unchecked stack return address redirection ... lkdtm: ok: redirected stack return address. lkdtm: Attempting checked stack return address redirection ... lkdtm: FAIL: stack return address was redirected! lkdtm: This is probably expected, since this kernel was built *without* CONFIG_ARM64_PTR_AUTH_KERNEL=y nor CONFIG_SHADOW_CALL_STACK=y Co-developed-by: Dan Li Signed-off-by: Dan Li Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Kees Cook Link: https://lore.kernel.org/lkml/20220416001103.1524653-1-keescook@chromium.org commit b9cff8783439ff1803709128af3a0e04c5f5f047 Author: Arınç ÜNAL Date: Sun Apr 10 12:44:55 2022 +0300 ARM: dts: BCM5301X: Disable gmac0 and enable port@8 on Asus RT-AC88U Disable gmac0 which is not connected to any switch MAC. Enable port@8 of the Broadcom switch which is connected to gmac2. Signed-off-by: Arınç ÜNAL Signed-off-by: Florian Fainelli commit 4ee7b96163f2e16f0a919398968115420008bcf4 Author: Rex-BC Chen Date: Mon Apr 11 11:58:43 2022 +0800 dt-bindings: display: mediatek: Update disp_aal binding for MT8192 and MT8195 Disp_aal of MT8192 and MT8195 are fully compatible with disp_aal of MT8183. Therefore, we move the them to item "mediatek,mt8183-disp-aal". Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220406094654.29722-4-rex-bc.chen@mediatek.com/ Signed-off-by: Rex-BC Chen Acked-by: Rob Herring Signed-off-by: Chun-Kuang Hu commit 402fc936d5a9328779f175893b30ae165d45a11e Author: Rex-BC Chen Date: Mon Apr 11 11:58:41 2022 +0800 dt-bindings: display: mediatek: Update disp_aal binding for MT8183 The driver data of MT8183 and MT8173 are different. For MT8173, the gamma module is inside disp_aal. When we need to adjust gamma value, we need to use "has_gamma" to control gamma function inside disp_aal to adjust the gamma value. For successors like MT8183, disp_gamma is separated from disp_aal. We just need to control disp_gamma directly and don't need to control gamma function inside disp_aal. With this modification, the driver doesn't require any functional changes. We only update the dt-binding and DTS node to make it clear. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220411035843.19847-2-rex-bc.chen@mediatek.com/ Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Signed-off-by: Chun-Kuang Hu commit 6c757e9f55f02fbc226823f8d441cd03cc282109 Author: Jui-Tse Huang Date: Fri Apr 15 11:36:18 2022 +0800 docs/scheduler: fix unit error The unit mentioned in the documentation of scheduler statistics is outdated which may mislead the readers. The unit of statistics that is reported by /proc/schedstat is modified to nanosecond, and the unit of statistics that is reported by /proc/PID/schedstat is provided as well to make the context consistent. The rq_cpu_time and the rq_sched_info.run_delay of a run queue, and the sched_info.run_delay of a task are all updated based on the clock of the run queue, while the se.sum_exec_runtime of a task is updated based on the clock_task of the run queue of the task. Both the clock and clock_task are relied on the return value of the function sched_clock() which is in the unit of nanosecond. Signed-off-by: Jui-Tse Huang Signed-off-by: Jonathan Corbet commit 389cfd96703ea7390c2ba3968dbdac0e48c396cf Author: Randy Dunlap Date: Sat Apr 2 22:48:22 2022 -0700 docs/admin: alphabetize parts of kernel-parameters.txt (part 2) Alphabetize several of the kernel boot parameters in kernel-parameters.txt. Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Jonathan Corbet commit d2fc83c149a7a690ec2ef98e540950c5f18e983f Author: Randy Dunlap Date: Sat Apr 2 22:48:21 2022 -0700 Docs/admin: alphabetize some kernel-parameters (part 1) Move some out-of-place kernel parameters into their correct locations. Move one out-of-order keyword/legend in kernel-parameters.rst. Add some missing keyword legends in kernel-parameters.rst: HIBERNATION HYPER_V and drop some obsolete/removed keyword legends: EIDE IOSCHED OSS TS XT Correct the location of the setup.h file. Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "Rafael J. Wysocki" Cc: Pavel Machek Signed-off-by: Jonathan Corbet commit 59bdbbd5bcd4c4d4266ac7e4e35e98c9fe8bde70 Author: Randy Dunlap Date: Sat Apr 2 22:48:20 2022 -0700 Docs: admin/kernel-parameters: edit a few boot options Clean up some of admin-guide/kernel-parameters.txt: a. "smt" should be "smt=" (S390) b. (dropped) c. Sparc supports the vdso= boot option d. make the tp_printk options (2) formatting similar to other options by adding spacing e. add "trace_clock=" with a reference to Documentation/trace/ftrace.rst f. use [IA-64] as documented instead of [ia64] g. fix formatting and text for test_suspend= h. fix formatting for swapaccount= i. fix formatting and grammar for video.brightness_switch_enabled= Signed-off-by: Randy Dunlap Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Cc: Steven Rostedt Cc: Ingo Molnar Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Cc: Michael Ellerman Cc: linux-ia64@vger.kernel.org Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Len Brown Cc: linux-pm@vger.kernel.org Cc: linux-acpi@vger.kernel.org Cc: Johannes Weiner Cc: Andrew Morton Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Acked-by: Rafael J. Wysocki Signed-off-by: Jonathan Corbet commit 82850028aab5b44923e2c8a2fe875ecd32590835 Author: Akihiko Odaki Date: Mon Mar 21 13:58:53 2022 +0900 x86/efi: Remove references of EFI earlyprintk from documentation x86 EFI earlyprink was removed with commit 69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation"). Signed-off-by: Akihiko Odaki Reviewed-by: Ard Biesheuvel Signed-off-by: Jonathan Corbet commit bad3fbb2568abf8a9744720c5ef3a5ffc97531c9 Author: Dylan Yudaken Date: Tue Apr 5 02:54:14 2022 -0700 docs: fault-injection: fix defaults ignore-gfp-wait and ignore-gfp-highmem defaults are actually true (Y) in both failslab and fail_page_alloc, not false as the docs suggest. See page_alloc.c:3762 and failslab.c:13 At the same time use 'Y' instead of '1' in the example scripts just for consistency. (though 1 would work) Signed-off-by: Dylan Yudaken Reviewed-by: Akinobu Mita Signed-off-by: Jonathan Corbet commit e01159c71394f4137aff1bcb75402bec7754dc1c Author: Bagas Sanjaya Date: Thu Apr 7 11:58:30 2022 +0700 Documentation: arch_pgtable_helpers: demote pgtable list headings All page title headings in arch_pgtable_helpers.txt except "Architecture Page Table Helpers" should have been subheadings instead. Demote them to chapter headings. Cc: Andrew Morton Cc: Anshuman Khandual Signed-off-by: Bagas Sanjaya Signed-off-by: Jonathan Corbet commit 532578ed4d91bc8bc315fa5aa67606bf63ad45c3 Author: Zhou Yuheng Date: Wed Mar 16 07:24:28 2022 +0800 docs/zh_CN: Fix typo in process/howto.rst Correct the url of linux-next Signed-off-by: Zhou Yuheng Reviewed-by: Alex Shi Acked-by: Tang Yizhou Signed-off-by: Jonathan Corbet commit ab0167d9d45799a81b8397eaa45da746fa173aae Author: Yanteng Si Date: Fri Apr 8 10:35:25 2022 +0800 docs/zh_CN: add vm hugetlbfs_reserv translation Translate .../vm/hugetlbfs_reserv.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit ddb21d27a6a508eae9aa8b72a924d989fb260dea Author: Chunguang Xu Date: Fri Apr 8 17:31:06 2022 +0800 docs/scheduler: Change unit of cpu_time and rq_time to nanoseconds In the current implementation, cpu_time and rq_time should be in nanoseconds, so this document needs to be modified. Signed-off-by: Chunguang Xu Signed-off-by: Jonathan Corbet commit 6c300a7142c190d01916e7fcef8a7c403cfe8221 Author: Tang Yizhou Date: Fri Apr 8 22:47:42 2022 +0800 docs/zh_CN: Add spinlocks Chinese translation Translate locking/spinlocks.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 43e3df81ee591973c49e95b3900c765c9d616db4 Author: Tang Yizhou Date: Fri Apr 8 22:47:41 2022 +0800 docs/zh_CN: Add locking/index Chinese translation Translate locking/index.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit bcfc713f11f957711f9494f69c740b95ed335d57 Author: Rodrigo Vivi Date: Thu Mar 31 16:17:37 2022 -0700 drm/i915/hwconfig: Add DG2 support v2: * Jordan: Drop stepping/skew checking as suggested by John. Signed-off-by: Rodrigo Vivi Signed-off-by: John Harrison Signed-off-by: Ramalingam C Tested-by: Jordan Justen Signed-off-by: Jordan Justen Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220331231737.315957-1-jordan.l.justen@intel.com commit a57f9b4dd6f5772750d8776c08c0d23c6b823da9 Author: Lucas Tanure Date: Sat Apr 9 17:43:34 2022 +0100 i2c: meson: Use 50% duty cycle for I2C clock The duty cycle of 33% is less than the required by the I2C specs for the LOW period of the SCL clock. Move the duty cyle to 50% for 100Khz or lower clocks, and (40% High SCL / 60% Low SCL) duty cycle for clocks above 100Khz. Signed-off-by: Lucas Tanure Reviewed-by: Neil Armstrong Signed-off-by: Wolfram Sang commit 1b9a8a6d433f254f3a0dc61c217aa692468e254c Author: Lucas Tanure Date: Sat Apr 9 17:43:33 2022 +0100 i2c: meson: Use _SHIFT and _MASK for register definitions Differentiate between masks and shifts Signed-off-by: Lucas Tanure Reviewed-by: Neil Armstrong Signed-off-by: Wolfram Sang commit 8d0e3decf26bc423d8b1c42c05636ccc05ea6b17 Author: Ashutosh Dixit Date: Thu Apr 14 17:25:11 2022 -0700 drm/i915: Don't show engine information in fdinfo with GuC submission At present i915 does not fetch busyness information from GuC, resulting in incorrect busyness values in fdinfo. Because engine information is coupled with busyness in fdinfo, skip showing client engine information in fdinfo with GuC submission till fetching busyness is supported in the i915 GuC submission backend. v2 (Daniele): Make commit title and description more precise Add FIXME with brief description at code change s/intel_guc_submission_is_used/intel_uc_uses_guc_submission/ v3 (Daniele): Drop FIXME in comment Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/5564 Fixes: 055634e4b62f ("drm/i915: Expose client engine utilisation via fdinfo") Cc: Daniele Ceraolo Spurio Cc: Umesh Nerlige Ramappa Signed-off-by: Ashutosh Dixit Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/b614c2c61a954de06fbe2c3a7c70d3a91804407e.1649982207.git.ashutosh.dixit@intel.com commit 633c0e7559ea88d2cbd5a6a06d6accfddf55542f Author: Wolfram Sang Date: Tue Apr 5 12:07:56 2022 +0200 i2c: rcar: add support for I2C_M_RECV_LEN With this feature added, SMBus Block reads and Proc calls are now supported. This patch is the best of two independent developments by Wolfram and Bhuvanesh + Andrew, refactored again by Wolfram. Signed-off-by: Bhuvanesh Surachari Signed-off-by: Andrew Gabbasov Signed-off-by: Wolfram Sang Reviewed-by: Eugeniu Rosca Tested-by: Eugeniu Rosca Signed-off-by: Wolfram Sang commit c562570e00799c919d64e793e5b4c334d6978ce2 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:50 2022 +0200 dt-bindings: i2c: qcom,i2c-qup: convert to dtschema Convert the Qualcomm Universal Peripheral (QUP) I2C controller to DT Schema. Add missing properties: dma and dma-names, pinctrl states (to indicate support for sleep pinctrl). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 0339d25a2807d913f5645b8d5e485640915f9702 Author: Eric Dumazet Date: Wed Apr 13 13:56:53 2022 -0700 ipv6: fix NULL deref in ip6_rcv_core() idev can be NULL, as the surrounding code suggests. Fixes: 4daf841a2ef3 ("net: ipv6: add skb drop reasons to ip6_rcv_core()") Signed-off-by: Eric Dumazet Cc: Menglong Dong Cc: Jiang Biao Cc: Hao Peng Link: https://lore.kernel.org/r/20220413205653.1178458-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit c9a40d1c87e9b5c74b5ac73e81ed3d5be4d1b1af Author: Eric Dumazet Date: Wed Apr 13 18:10:04 2022 -0700 net_sched: make qdisc_reset() smaller For some unknown reason qdisc_reset() is using a convoluted way of freeing two lists of skbs. Use __skb_queue_purge() instead. Signed-off-by: Eric Dumazet Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20220414011004.2378350-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 31248b5a354b6871afecb259690dd615de730ef0 Author: Leon Romanovsky Date: Thu Apr 14 10:52:42 2022 +0300 octeon_ep: Remove custom driver version In review comment [1] was pointed that new code is not supposed to set driver version and should rely on kernel version instead. As an outcome of that comment all the dance around setting such driver version to FW should be removed too, because in upstream kernel whole driver will have same version so read/write from/to FW will give same result. [1] https://lore.kernel.org/all/YladGTmon1x3dfxI@unreal Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/5d76f3116ee795071ec044eabb815d6c2bdc7dbd.1649922731.git.leonro@nvidia.com Signed-off-by: Jakub Kicinski commit a992005cc88bdb6628110b97afe8651baa87f1e3 Merge: 7b05c54226015 93b1ebb348a94 Author: Jakub Kicinski Date: Fri Apr 15 14:02:09 2022 -0700 Merge branch 'ibmvnic-use-a-set-of-ltbs-per-pool' Sukadev Bhattiprolu says: ==================== ibmvnic: Use a set of LTBs per pool ibmvnic uses a single large long term buffer (LTB) per rx or tx pool (queue). This has two limitations. First, if we need to free/allocate an LTB (eg during a reset), under low memory conditions, the allocation can fail. Second, the kernel limits the size of single LTB (DMA buffer) to 16MB (based on MAX_ORDER). With jumbo frames (mtu = 9000) we can only have about 1763 buffers per LTB (16MB / 9588 bytes per frame) even though the max supported buffers is 4096. (The 9588 instead of 9088 comes from IBMVNIC_BUFFER_HLEN.) To overcome these limitations, allow creating a set of LTBs per queue. ==================== Link: https://lore.kernel.org/r/20220413171026.1264294-1-drt@linux.ibm.com Signed-off-by: Jakub Kicinski commit 93b1ebb348a94a04ae4bfbd028f89005090cf8c7 Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:26 2022 -0400 ibmvnic: Allow multiple ltbs in txpool ltb_set Allow multiple LTBs in the txpool's ltb_set. i.e rather than using a single large LTB, use several smaller LTBs. The first n-1 LTBs will all be of the same size. The size of the last LTB in the set depends on the number of buffers and buffer (mtu) size. This strategy hopefully allows more reuse of the initial LTBs and also reduces the chances of an allocation failure (of the large LTB) when system is low in memory. Suggested-by: Brian King Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit a75de820575d54185a7569494e89f83dca49368e Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:25 2022 -0400 ibmvnic: Allow multiple ltbs in rxpool ltb_set Allow multiple LTBs in the rxpool's ltb_set. The first n-1 LTBs will all be of the same size. The size of the last LTB in the set depends on the number of buffers and buffer (mtu) size. Having a set of LTBs per pool provides a couple of benefits. First, with the current value of IBMVNIC_MAX_LTB_SIZE of 16MB, with an MTU of 9000, we need a LTB (DMA buffer) of that size but the allocation can fail in low memory conditions. With a set of LTBs per pool, we can use several smaller (8MB) LTBs and hopefully have fewer allocation failures. (See also comments in ibmvnic.h on the trade-off with smaller LTBs) Second since the kernel limits the size of the DMA buffer to 16MB (based on MAX_ORDER), with a single DMA buffer per pool, the pool is also limited to 16MB. This in turn limits the number of buffers per pool to 1763 when MTU is 9000. With a set of LTBs per pool, we can have upto the max of 4096 buffers per pool even when MTU is 9000. Suggested-by: Brian King Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit d6b458509035db32b935f15922b530373fb6d27e Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:24 2022 -0400 ibmvnic: convert rxpool ltb to a set of ltbs Define and use interfaces that treat the long term buffer (LTB) of an rxpool as a set of LTBs rather than a single LTB. The set only has one LTB for now. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit 0c91bf9ceba6296892010a48c5eef0bd17ec35d5 Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:23 2022 -0400 ibmvnic: define map_txpool_buf_to_ltb() Define a helper to map a given txpool buffer into its corresponding long term buffer (LTB) and offset. Currently there is just one LTB per txpool so the mapping is trivial. When we add support for multiple LTBs per txpool, this helper will be more useful. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit 2872a67c6bcfbd996fda08ea0a8119be230f428e Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:22 2022 -0400 ibmvnic: define map_rxpool_buf_to_ltb() Define a helper to map a given rx pool buffer into its corresponding long term buffer (LTB) and offset. Currently there is just one LTB per pool so the mapping is trivial. When we add support for multiple LTBs per pool, this helper will be more useful. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit 8880fc669deda4fafde3ce90b3128f079567447f Author: Sukadev Bhattiprolu Date: Wed Apr 13 13:10:21 2022 -0400 ibmvnic: rename local variable index to bufidx The local variable 'index' is heavily used in some functions and is confusing with the presence of other "index" fields like pool->index, ->consumer_index, etc. Rename it to bufidx to better reflect that its the index of a buffer in the pool. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski commit f5df4d88661401637623015cd56dd564d857f125 Author: Vinay Belgaumkar Date: Tue Apr 12 15:48:52 2022 -0700 drm/i915/guc/slpc: Use i915_probe_error instead of drm_err This will ensure we don't have false positives when we run error injection tests. Signed-off-by: Vinay Belgaumkar Reviewed-by: Anshuman Gupta Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220412224852.21501-1-vinay.belgaumkar@intel.com commit d3e3116f253591a473873fab8363ecb998ddde13 Author: Minghao Chi Date: Tue Apr 12 08:29:23 2022 +0000 soc: ti: knav_dma: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifying code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Nishanth Menon Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20220412082923.2532649-1-chi.minghao@zte.com.cn commit a6af504184c981efd253f986e6fc54db57b1d39f Author: Philipp Zabel Date: Mon Apr 4 11:45:00 2022 +0200 reset: ti-sci: Allow building under COMPILE_TEST Since commit 043cfff99a18 ("firmware: ti_sci: Fix compilation failure when CONFIG_TI_SCI_PROTOCOL is not defined") it is possible to build reset-ti-sci under CONFIG_COMPILE_TEST. Signed-off-by: Philipp Zabel Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220404094500.2708816-1-p.zabel@pengutronix.de commit ba56291e297d28aa6eb82c5c1964fae2d7594746 Author: QintaoShen Date: Thu Mar 24 15:44:03 2022 +0800 soc: ti: ti_sci_pm_domains: Check for null return of devm_kcalloc The allocation funciton devm_kcalloc may fail and return a null pointer, which would cause a null-pointer dereference later. It might be better to check it and directly return -ENOMEM just like the usage of devm_kcalloc in previous code. Signed-off-by: QintaoShen Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/1648107843-29077-1-git-send-email-unSimple1993@163.com commit 5d79fa0d33258d8e79064316ce8fae37e27bd34b Author: YueHaibing Date: Thu Apr 7 15:46:12 2022 +0800 ftrace: Fix build warning If CONFIG_SYSCTL and CONFIG_DYNAMIC_FTRACE is n, build warns: kernel/trace/ftrace.c:7912:13: error: ‘is_permanent_ops_registered’ defined but not used [-Werror=unused-function] static bool is_permanent_ops_registered(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/trace/ftrace.c:89:12: error: ‘last_ftrace_enabled’ defined but not used [-Werror=unused-variable] static int last_ftrace_enabled; ^~~~~~~~~~~~~~~~~~~ Move is_permanent_ops_registered() to ifdef block and mark last_ftrace_enabled as __maybe_unused to fix this. Fixes: 7cde53da38a3 ("ftrace: move sysctl_ftrace_enabled to ftrace.c") Signed-off-by: YueHaibing Acked-by: Steven Rostedt (Google) Signed-off-by: Luis Chamberlain commit cabfa5b46573b4e5ded52b4296a831745c6d32b5 Author: Minghao Chi (CGEL ZTE) Date: Mon Mar 7 03:37:36 2022 +0000 soc: ti: omap_prm: Use of_device_get_match_data() Since omap_prm_id_table all have (and expected to have) data entries, use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220307033736.2075221-1-chi.minghao@zte.com.cn commit 0fb53aabc5fcdf848ec7adc777baff25a1c6c335 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:15 2022 +0200 xsk: Drop ternary operator from xskq_cons_has_entries Simplify the mentioned helper function by removing ternary operator. The expression that is there outputs the boolean value by itself. This helper might be used in the hot path so this simplification can also be considered as micro optimization. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-15-maciej.fijalkowski@intel.com commit 4efad196163f4302c5cdc020899074b174eaf956 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:14 2022 +0200 ice, xsk: Avoid refilling single Rx descriptors Call alloc Rx routine for ZC driver only when the amount of unallocated descriptors exceeds given threshold. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-14-maciej.fijalkowski@intel.com commit a817ead4154d86c74bf98936f3a385e8a21974ff Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:13 2022 +0200 stmmac, xsk: Diversify return values from xsk_wakeup call paths Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIOs in stmmac's ndo_xsk_wakeup() implementation to EINVALs, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-13-maciej.fijalkowski@intel.com commit 7b7f2f273d8722d518758cc0770e784872cec781 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:12 2022 +0200 mlx5, xsk: Diversify return values from xsk_wakeup call paths Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIO in mlx5's ndo_xsk_wakeup() implementation to EINVAL, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-12-maciej.fijalkowski@intel.com commit 0f8bf018899e0c3137912cb6d547d0d072fc3d20 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:11 2022 +0200 ixgbe, xsk: Diversify return values from xsk_wakeup call paths Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIOs in ixgbe's ndo_xsk_wakeup() implementation to EINVALs, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-11-maciej.fijalkowski@intel.com commit ed7ae2d6221708971eb20a92f3775dac9cddec14 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:10 2022 +0200 i40e, xsk: Diversify return values from xsk_wakeup call paths Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIOs in i40e's ndo_xsk_wakeup() implementation to EINVALs, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-10-maciej.fijalkowski@intel.com commit ed8a6bc60f9eed76b8097456676e18d09b5dea7b Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:09 2022 +0200 ice, xsk: Diversify return values from xsk_wakeup call paths Currently, when debugging AF_XDP workloads, one can correlate the -ENXIO return code as the case that XSK is not in the bound state. Returning same code from ndo_xsk_wakeup can be misleading and simply makes it harder to follow what is going on. Change ENXIOs in ice's ndo_xsk_wakeup() implementation to EINVALs, so that when probing it is clear that something is wrong on the driver side, not the xsk_{recv,send}msg. There is a -ENETDOWN that can happen from both kernel/driver sides though, but I don't have a correct replacement for this on one of the sides, so let's keep it that way. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-9-maciej.fijalkowski@intel.com commit c7dd09fd46283029a41615b2b7034aea26b22ee0 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:08 2022 +0200 ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full When XSK pool uses need_wakeup feature, correlate -ENOBUFS that was returned from xdp_do_redirect() with a XSK Rx queue being full. In such case, terminate the Rx processing that is being done on the current HW Rx ring and let the user space consume descriptors from XSK Rx queue so that there is room that driver can use later on. Introduce new internal return code IXGBE_XDP_EXIT that will indicate case described above. Note that it does not affect Tx processing that is bound to the same NAPI context, nor the other Rx rings. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-8-maciej.fijalkowski@intel.com commit b8aef650e54982728660919a0cf9cdacb079ef86 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:07 2022 +0200 i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full When XSK pool uses need_wakeup feature, correlate -ENOBUFS that was returned from xdp_do_redirect() with a XSK Rx queue being full. In such case, terminate the Rx processing that is being done on the current HW Rx ring and let the user space consume descriptors from XSK Rx queue so that there is room that driver can use later on. Introduce new internal return code I40E_XDP_EXIT that will indicate case described above. Note that it does not affect Tx processing that is bound to the same NAPI context, nor the other Rx rings. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-7-maciej.fijalkowski@intel.com commit 50ae066480738e0d3ce72a90c8c0f4d9de6092e0 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:06 2022 +0200 ice, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full When XSK pool uses need_wakeup feature, correlate -ENOBUFS that was returned from xdp_do_redirect() with a XSK Rx queue being full. In such case, terminate the Rx processing that is being done on the current HW Rx ring and let the user space consume descriptors from XSK Rx queue so that there is room that driver can use later on. Introduce new internal return code ICE_XDP_EXIT that will indicate case described above. Note that it does not affect Tx processing that is bound to the same NAPI context, nor the other Rx rings. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-6-maciej.fijalkowski@intel.com commit d090c885860f6ef85aa080bdfc94e69c525490a2 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:05 2022 +0200 ixgbe, xsk: Decorate IXGBE_XDP_REDIR with likely() ixgbe_run_xdp_zc() suggests to compiler that XDP_REDIRECT is the most probable action returned from BPF program that AF_XDP has in its pipeline. Let's also bring this suggestion up to the callsite of ixgbe_run_xdp_zc() so that compiler will be able to generate more optimized code which in turn will make branch predictor happy. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-5-maciej.fijalkowski@intel.com commit 0bd5ab511e30a8c462c377d0fdda3374fc6200a4 Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:04 2022 +0200 ice, xsk: Decorate ICE_XDP_REDIR with likely() ice_run_xdp_zc() suggests to compiler that XDP_REDIRECT is the most probable action returned from BPF program that AF_XDP has in its pipeline. Let's also bring this suggestion up to the callsite of ice_run_xdp_zc() so that compiler will be able to generate more optimized code which in turn will make branch predictor happy. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413153015.453864-4-maciej.fijalkowski@intel.com commit 2be4a677ccb2cae1f72a9467e922642655efc0be Author: Maciej Fijalkowski Date: Wed Apr 13 17:30:03 2022 +0200 xsk: Diversify return codes in xsk_rcv_check() Inspired by patch that made xdp_do_redirect() return values for XSKMAP more meaningful, return -ENXIO instead of -EINVAL for socket being unbound in xsk_rcv_check() as this is the usual value that is returned for such event. In turn, it is now possible to easily distinguish what went wrong, which is a bit harder when for both cases checked, -EINVAL was returned. Return codes can be counted in a nice way via bpftrace oneliner that Jesper has shown: bpftrace -e 'tracepoint:xdp:xdp_redirect* {@err[-args->err] = count();}' Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20220413153015.453864-3-maciej.fijalkowski@intel.com commit c6c1f11b691e619802474f886355cb3bc9034021 Author: Björn Töpel Date: Wed Apr 13 17:30:02 2022 +0200 xsk: Improve xdp_do_redirect() error codes The error codes returned by xdp_do_redirect() when redirecting a frame to an AF_XDP socket has not been very useful. A driver could not distinguish between different errors. Prior this change the following codes where used: Socket not bound or incorrect queue/netdev: EINVAL XDP frame/AF_XDP buffer size mismatch: ENOSPC Could not allocate buffer (copy mode): ENOSPC AF_XDP Rx buffer full: ENOSPC After this change: Socket not bound or incorrect queue/netdev: EINVAL XDP frame/AF_XDP buffer size mismatch: ENOSPC Could not allocate buffer (copy mode): ENOMEM AF_XDP Rx buffer full: ENOBUFS An AF_XDP zero-copy driver can now potentially determine if the failure was due to a full Rx buffer, and if so stop processing more frames, yielding to the userland AF_XDP application. Signed-off-by: Björn Töpel Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20220413153015.453864-2-maciej.fijalkowski@intel.com commit 7b05c54226015807993a7d1bab0ba59d00e592ad Merge: 0a03f3c511f57 1f702c1643f2f Author: Jakub Kicinski Date: Fri Apr 15 11:41:56 2022 -0700 Merge branch 'net-ethool-add-support-to-get-set-tx-push-by-ethtool-g-g' Jie Wang says: ==================== net: ethool: add support to get/set tx push by ethtool -G/g These three patches add tx push in ring params and adapt the set and get APIs of ring params. ==================== Link: https://lore.kernel.org/r/20220412020121.14140-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 1f702c1643f2f9657f9dd03085b309ab9a1de1d7 Author: Jie Wang Date: Tue Apr 12 10:01:21 2022 +0800 net: hns3: add tx push support in hns3 ring param process This patch adds tx push param to hns3 ring param and adapts the set and get API of ring params. So users can set it by cmd ethtool -G and get it by cmd ethtool -g. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit bde292c07b480e23137060dad83cca24d55c4cc4 Author: Jie Wang Date: Tue Apr 12 10:01:20 2022 +0800 net: ethtool: move checks before rtnl_lock() in ethnl_set_rings Currently these two checks in ethnl_set_rings are added after rtnl_lock() which will do useless works if the request is invalid. So this patch moves these checks before the rtnl_lock() to avoid these costs. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit 4dc84c06a343fcb95fd5a0acb537aefa4ebdd1b0 Author: Jie Wang Date: Tue Apr 12 10:01:19 2022 +0800 net: ethtool: extend ringparam set/get APIs for tx_push Currently tx push is a standard driver feature which controls use of a fast path descriptor push. So this patch extends the ringparam APIs and data structures to support set/get tx push by ethtool -G/g. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski commit c94fde8f516610b0961b65a59bc8885e6df23cb9 Author: Matt Atwood Date: Thu Apr 14 12:22:30 2022 -0700 drm/i915/uapi: Add DRM_I915_QUERY_GEOMETRY_SUBSLICES Newer platforms have DSS that aren't necessarily available for both geometry and compute, two queries will need to exist. This introduces the first, when passing a valid engine class and engine instance in the flags returns a topology describing geometry. Based on past discussion, we currently only support this new query item on Xe_HP and beyond; earlier platforms do not need to worry about geometry and compute pipelines having access to different topology and should continue to use the existing topology query. v2: fix white space errors v3: change flags from hosting 2 8 bit numbers to holding a i915_engine_class_instance struct v4: add error if non rcs engine passed. v5 (by MattR): - Improve kerneldoc and cross references to related structs/enums. (Daniel) - Clarify that geometry query is only supported on render engines (Francisco) - Clarify that the new query is only supported on Xe_HP+. - Fix checkpatch warnings. Cc: Ashutosh Dixit Cc: Matt Roper Cc: Joonas Lahtinen Cc: Francisco Jerez UMD (mesa): https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14143 Testcase: igt@i915_query@test-query-geometry-subslices Signed-off-by: Matt Atwood Signed-off-by: Matt Roper Reviewed-by: Francisco Jerez Link: https://patchwork.freedesktop.org/patch/msgid/20220414192230.749771-4-matthew.d.roper@intel.com commit 1c671ad753dbbf5f5da7b18175d05acc3cccf1a8 Author: Matt Roper Date: Thu Apr 14 12:22:29 2022 -0700 drm/i915/doc: Link query items to their uapi structs Document the possible options for drm_i915_query_item.query_id with links to the corresponding uapi structures. Signed-off-by: Matt Roper Reviewed-by: Francisco Jerez Link: https://patchwork.freedesktop.org/patch/msgid/20220414192230.749771-3-matthew.d.roper@intel.com commit a2e5402691e2326991704b1fb73646fa2efde1c3 Author: Matt Roper Date: Thu Apr 14 12:22:28 2022 -0700 drm/i915/doc: Convert perf UAPI comments to kerneldoc Convert the comments for drm_i915_query_perf_config and drm_i915_perf_oa_config to kerneldoc so that they will show up in the generated documentation. Also correct a couple places that referred to query_id when they actually meant to refer to query_item.flags. Signed-off-by: Matt Roper Reviewed-by: Francisco Jerez Link: https://patchwork.freedesktop.org/patch/msgid/20220414192230.749771-2-matthew.d.roper@intel.com commit 462ac1cdf4d7acf100f9b21ad8bf72c88ceb902f Author: Matt Roper Date: Thu Apr 14 12:22:27 2022 -0700 drm/i915/doc: Convert drm_i915_query_topology_info comment to kerneldoc This structure has a great comment describing the fields, but it's not currently in kerneldoc form and does not show up in the generated documentation. Let's fix that and also clarify the description of what "subslice" refers to on gen12 platforms and beyond and that "slice" is no longer meaningful on Xe_HP and beyond. Signed-off-by: Matt Roper Reviewed-by: Francisco Jerez Link: https://patchwork.freedesktop.org/patch/msgid/20220414192230.749771-1-matthew.d.roper@intel.com commit 0a03f3c511f57da4d7159a150f1ab4b87f62c040 Author: Yang Yingliang Date: Fri Apr 15 10:39:57 2022 +0800 octeon_ep: fix error return code in octep_probe() If register_netdev() fails , it should return error code in octep_probe(). Fixes: 862cd659a6fb ("octeon_ep: Add driver framework and device initialization") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 48b48b654c2213e102aa939c15cadb5a5172d100 Merge: 81669e7c6ca44 7240bf6fb216e Author: David S. Miller Date: Fri Apr 15 11:46:29 2022 +0100 Merge branch 'emaclite-cleanups' Radhey Shyam Pandey says: ==================== net: emaclite: Trivial code cleanup This patchset fix coding style issues, remove BUFFER_ALIGN macro and also update copyright text. I have to resend as earlier series didn't reach mailing list due to some configuration issue. ==================== Signed-off-by: David S. Miller commit 7240bf6fb216e03fb9add3a3dd23117ad589a0c7 Author: Shravya Kumbham Date: Thu Apr 14 18:07:11 2022 +0530 net: emaclite: Remove custom BUFFER_ALIGN macro BUFFER_ALIGN macro is used to calculate the number of bytes required for the next alignment. Instead of this, we can directly use the skb_reserve(skb, NET_IP_ALIGN) to make the protocol header buffer aligned on at least a 4-byte boundary, where the NET_IP_ALIGN is by default defined as 2. So removing the BUFFER_ALIGN and its related defines which it can be done by the skb_reserve() itself. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 7ae7d494f626a2f1a598fcf15b789a347c2d451a Author: Michal Simek Date: Thu Apr 14 18:07:10 2022 +0530 net: emaclite: Update copyright text to correct format Based on recommended guidance Copyright term should be also present in front of (c). That's why aligned driver to match this pattern. It helps automated tools with source code scanning. Signed-off-by: Michal Simek Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 945e659dffad2d2e11a105c477d423cb1b5edd95 Author: Radhey Shyam Pandey Date: Thu Apr 14 18:07:09 2022 +0530 net: emaclite: Fix coding style Make coding style changes to fix checkpatch script warnings. There is no functional change. Fixes below check and warnings- CHECK: Blank lines aren't necessary after an open brace '{' CHECK: spinlock_t definition without comment CHECK: Please don't use multiple blank lines WARNING: Prefer 'unsigned int' to bare use of 'unsigned' CHECK: braces {} should be used on all arms of this statement CHECK: Unbalanced braces around else statement CHECK: Alignment should match open parenthesis WARNING: Missing a blank line after declarations Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit 81669e7c6ca44746d869925f337d9bbb0a252fc1 Author: Minghao Chi Date: Thu Apr 14 09:08:00 2022 +0000 net: ethernet: ti: davinci_emac: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit bb578430d05b8b9114195ef2c25284374fdf9549 Author: Colin Ian King Date: Thu Apr 14 09:08:34 2022 +0100 octeon_ep: Fix spelling mistake "inerrupts" -> "interrupts" There is a spelling mistake in a dev_info message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 25f428f990ddd116e266bd278bb7396f966af4d9 Merge: be52d266d2930 03978fb88b06b Author: David S. Miller Date: Fri Apr 15 11:06:13 2022 +0100 Merge branch 'mlxsw-line-card-prep' Ido Schimmel says: ==================== mlxsw: Preparations for line cards support Currently, mlxsw registers thermal zones as well as hwmon entries for objects such as transceiver modules and gearboxes. In upcoming modular systems, these objects are no longer found on the main board (i.e., slot 0), but on plug-able line cards. This patchset prepares mlxsw for such systems in terms of hwmon, thermal and cable access support. Patches #1-#3 gradually prepare mlxsw for transceiver modules access support for line cards by splitting some of the internal structures and some APIs. Patches #4-#5 gradually prepare mlxsw for hwmon support for line cards by splitting some of the internal structures and augmenting them with a slot index. Patches #6-#7 do the same for thermal zones. Patch #8 selects cooling device for binding to a thermal zone by exact name match to prevent binding to non-relevant devices. Patch #9 replaces internal define for thermal zone name length with a common define. ==================== Signed-off-by: David S. Miller commit 03978fb88b06bdbe6c404ffb49cf8290d2d015a5 Author: Vadim Pasternak Date: Wed Apr 13 18:17:33 2022 +0300 mlxsw: core_thermal: Use common define for thermal zone name length Replace internal define 'MLXSW_THERMAL_ZONE_MAX_NAME' by common 'THERMAL_NAME_LENGTH'. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 739d56bc635e9ba642777445d8c9c37e4a35ba3c Author: Vadim Pasternak Date: Wed Apr 13 18:17:32 2022 +0300 mlxsw: core_thermal: Use exact name of cooling devices for binding Modular system supports additional cooling devices "mlxreg_fan1", "mlxreg_fan2", etcetera. Thermal zones in "mlxsw" driver should be bound to the same device as before called "mlxreg_fan". Used exact match for cooling device name to avoid binding to new additional cooling devices. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 6d94449a7d7dca9d4b9b5a2792db537b2b69b4b7 Author: Vadim Pasternak Date: Wed Apr 13 18:17:31 2022 +0300 mlxsw: core_thermal: Add line card id prefix to line card thermal zone name Add prefix "lc#n" to thermal zones associated with the thermal objects found on line cards. For example thermal zone for module #9 located at line card #7 will have type: mlxsw-lc7-module9. And thermal zone for gearbox #3 located at line card #5 will have type: mlxsw-lc5-gearbox3. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ef0df4fa324af23a5b55d3518f5799c87b6b665a Author: Vadim Pasternak Date: Wed Apr 13 18:17:30 2022 +0300 mlxsw: core_thermal: Extend internal structures to support multi thermal areas Introduce intermediate level for thermal zones areas. Currently all thermal zones are associated with thermal objects located within the main board. Such objects are created during driver initialization and removed during driver de-initialization. For line cards in modular system the thermal zones are to be associated with the specific line card. They should be created whenever new line card is available (inserted, validated, powered and enabled) and removed, when line card is getting unavailable. The thermal objects found on the line card #n are accessed by setting slot index to #n, while for access to objects found on the main board slot index should be set to default value zero. Each thermal area contains the set of thermal zones associated with particular slot index. Thus introduction of thermal zone areas allows to use the same APIs for the main board and line cards, by adding slot index argument. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit fd27849dd6fd6913c35948653f8e167672655438 Author: Vadim Pasternak Date: Wed Apr 13 18:17:29 2022 +0300 mlxsw: core_hwmon: Introduce slot parameter in hwmon interfaces Add 'slot' parameter to 'mlxsw_hwmon_dev' structure. Use this parameter in mlxsw_reg_mtmp_pack(), mlxsw_reg_mtbr_pack(), mlxsw_reg_mgpir_pack() and mlxsw_reg_mtmp_slot_index_set() routines. For main board it'll always be zero, for line cards it'll be set to the physical slot number in modular systems. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b890ad418e1feada06dddc3f00ee2c8cccf77c13 Author: Vadim Pasternak Date: Wed Apr 13 18:17:28 2022 +0300 mlxsw: core_hwmon: Extend internal structures to support multi hwmon objects Currently, mlxsw supports a single hwmon device and registers it with attributes corresponding to the various objects found on the main board such as fans and gearboxes. Line cards can have the same objects, but unlike the main board they can be added and removed while the system is running. The various hwmon objects found on these line cards should be created when the line card becomes available and destroyed when the line card becomes unavailable. The above can be achieved by representing each line card as a different hwmon device and registering / unregistering it when the line card becomes available / unavailable. Prepare for multi hwmon device support by splitting 'struct mlxsw_hwmon' into 'struct mlxsw_hwmon' and 'struct mlxsw_hwmon_dev'. The first will hold information relevant to all hwmon devices, whereas the second will hold per-hwmon device information. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b244143a085e1e6b9bee83bafe99b4e1fc9ee51e Author: Vadim Pasternak Date: Wed Apr 13 18:17:27 2022 +0300 mlxsw: core: Move port module events enablement to a separate function Use a separate function for enablement of port module events such plug/unplug and temperature threshold crossing. The motivation is to reuse the function for line cards. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e5b6a5bac8cc12790eccf69e01372e135f9e4af2 Author: Vadim Pasternak Date: Wed Apr 13 18:17:26 2022 +0300 mlxsw: core: Extend port module data structures for line cards The port module core is tasked with module operations such as setting power mode policy and reset. The per-module information is currently stored in one large array suited for non-modular systems where only the main board is present (i.e., slot index 0). As a preparation for line cards support, allocate a per line card array according to the queried number of slots in the system. For each line card, allocate a module array according to the queried maximum number of modules per-slot. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 349454526f5fe6488083c35306b04acd0d065bbb Author: Vadim Pasternak Date: Wed Apr 13 18:17:25 2022 +0300 mlxsw: core: Extend interfaces for cable info access with slot argument Extend all cable info APIs with 'slot_index' argument. For main board, slot will always be set to zero and these APIs will work as before. If reading cable information is required from cages located on line cards, slot should be set to the physical slot number, where line card is located in modular systems. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit be52d266d2930f8963e49de68c59be3ca431b98d Author: Minghao Chi Date: Wed Apr 13 09:38:36 2022 +0000 net: ethernet: ti: cpsw_priv: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit 85648865bb95e3c2b10d22687fc5998cb5ae37cc Author: Minghao Chi Date: Wed Apr 13 09:38:01 2022 +0000 net: stmmac: stmmac_main: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit c557a9ae4960a8aaede722833e567897f05aa9ef Author: Minghao Chi Date: Wed Apr 13 09:35:29 2022 +0000 net: ethernet: ti: cpsw_new: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit f623f83ae77396a5eda25451335295c0141c8c46 Author: Paolo Abeni Date: Wed Apr 13 10:44:40 2022 +0200 geneve: avoid indirect calls in GRO path, when possible In the most common setups, the geneve tunnels use an inner ethernet encapsulation. In the GRO path, when such condition is true, we can call directly the relevant GRO helper and avoid a few indirect calls. Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 4867d750b227fa1affb171cd257dd9dde48d7d32 Merge: edf45f007a31e b3fc79225f055 Author: David S. Miller Date: Fri Apr 15 10:43:48 2022 +0100 Merge branch 'mneta-page_pool_get_stats' Lorenzo Bianconi says: ==================== net: mvneta: add support for page_pool_get_stats Introduce page_pool stats ethtool APIs in order to avoid driver duplicated code. Changes since v4: - rebase on top of net-next Changes since v3: - get rid of wrong for loop in page_pool_ethtool_stats_get() - add API stubs when page_pool_stats are not compiled in Changes since v2: - remove enum list of page_pool stats in page_pool.h - remove leftover change in mvneta.c for ethtool_stats array allocation Changes since v1: - move stats accounting to page_pool code - move stats string management to page_pool code ==================== Signed-off-by: David S. Miller commit b3fc79225f055af7ef48b47a90752c31cc062e6e Author: Lorenzo Bianconi Date: Tue Apr 12 18:31:59 2022 +0200 net: mvneta: add support for page_pool_get_stats Introduce support for the page_pool stats API into mvneta driver. Report page_pool stats through ethtool. Reviewed-by: Andrew Lunn Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit f3c5264f452a5b0ac1de1f2f657efbabdea3c76a Author: Lorenzo Bianconi Date: Tue Apr 12 18:31:58 2022 +0200 net: page_pool: introduce ethtool stats Introduce page_pool APIs to report stats through ethtool and reduce duplicated code in each driver. Signed-off-by: Lorenzo Bianconi Reviewed-by: Jakub Kicinski Reviewed-by: Ilias Apalodimas Signed-off-by: David S. Miller commit f398e0aa325c61fa20903833a5b534ecb8e6e418 Author: Sherry Sun Date: Mon Mar 21 19:22:11 2022 +0800 tty: serial: fsl_lpuart: fix potential bug when using both of_alias_get_id and ida_simple_get Now fsl_lpuart driver use both of_alias_get_id() and ida_simple_get() in .probe(), which has the potential bug. For example, when remove the lpuart7 alias in dts, of_alias_get_id() will return error, then call ida_simple_get() to allocate the id 0 for lpuart7, this may confilct with the lpuart4 which has alias 0. aliases { ... serial0 = &lpuart4; serial1 = &lpuart5; serial2 = &lpuart6; serial3 = &lpuart7; } So remove the ida_simple_get() in .probe(), return an error directly when calling of_alias_get_id() fails, which is consistent with other uart drivers behavior. Fixes: 3bc3206e1c0f ("serial: fsl_lpuart: Remove the alias node dependence") Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220321112211.8895-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit 18c9d4a3c249e9dcb1006bfd7d781616e152d77b Author: Al Cooper Date: Thu Mar 24 10:56:20 2022 -0400 serial: When UART is suspended, set RTS to false When flow control is enabled, the UART should set RTS to false during suspend to stop incoming data. Currently, the suspend routine sets the mctrl register in the uart to zero, but leaves the shadow version in the uart_port struct alone so that resume can restore it. This causes a problem later in suspend when serial8250_do_shutdown() is called which uses the shadow mctrl register to clear some additional bits but ends up restoring RTS. The solution is to clear RTS from the shadow version before serial8250_do_shutdown() is called and restore it after. Signed-off-by: Al Cooper Link: https://lore.kernel.org/r/20220324145620.41573-1-alcooperx@gmail.com Signed-off-by: Greg Kroah-Hartman commit bec1f1b66a662310e0021a3710e7d03dfe920e5a Author: Eric Tremblay Date: Wed Mar 30 12:46:42 2022 +0200 serial: 8250: add compatible for fsl,16550-FIFO64 Signed-off-by: Eric Tremblay Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220330104642.229507-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 296385fe127f97e06638e8c496a68080b48b4745 Author: Eric Tremblay Date: Wed Mar 30 12:46:41 2022 +0200 serial: 8250: Add UART_CAP_NOTEMT on PORT_16550A_FSL64 The Freescale variant of the 16550A doesn't have an interrupt on TEMT available when using the FIFO mode. Signed-off-by: Eric Tremblay Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220330104642.229507-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit f6f586102add59d57bcc6eea06fdeaae11bb17a1 Author: Eric Tremblay Date: Wed Mar 30 12:46:40 2022 +0200 serial: 8250: Handle UART without interrupt on TEMT using em485 Introduce the UART_CAP_NOTEMT capability. The capability indicates that the UART doesn't have an interrupt available on TEMT. In the case where the device does not support it, we calculate the maximum time it could take for the transmitter to empty the shift register. When we get in the situation where we get the THRE interrupt, we check if the TEMT bit is set. If it's not, we start the a timer and recall __stop_tx() after the delay. The transmit sequence is a bit modified when the capability is set. The new timer is used between the last interrupt(THRE) and a potential stop_tx timer. Signed-off-by: Giulio Benetti [moved to use added UART_CAP_TEMT] Signed-off-by: Heiko Stuebner [moved to use added UART_CAP_NOTEMT, improve timeout] Signed-off-by: Eric Tremblay [rebased to v5.17, making use of tty_get_frame_size] Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220330104642.229507-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0e0fd55719fa081de6f9e5d9e6cef48efb04d34a Author: Miaoqian Lin Date: Mon Apr 4 14:38:40 2022 +0000 serial: 8250_aspeed_vuart: Fix potential NULL dereference in aspeed_vuart_probe platform_get_resource() may fail and return NULL, so we should better check it's return value to avoid a NULL pointer dereference. Fixes: 54da3e381c2b ("serial: 8250_aspeed_vuart: use UPF_IOREMAP to set up register mapping") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404143842.16960-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 60efd0513916f195dd85bfbf21653f74f9ab019c Author: Lino Sanfilippo Date: Sun Apr 10 12:46:42 2022 +0200 serial: atmel: remove redundant assignment in rs485_config In uart_set_rs485_config() the serial core already assigns the passed serial_rs485 struct to the uart port. So remove the assignment from the drivers rs485_config() function to avoid redundancy. Reviewed-by: Claudiu Beznea Acked-by: Richard Genoud Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-10-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit e5d4d733fc1dc958d6272c01f1d1f9b5c44c41fa Author: Lino Sanfilippo Date: Sun Apr 10 12:46:41 2022 +0200 serial: fsl_lpuart: remove redundant code in rs485_config functions In uart_set_rs485_config() the serial core already ensures that only one of both options RTS on send or RTS after send is set. It also assigns the passed serial_rs485 struct to the uart port. So remove the check and the assignment from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-9-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit 915162460152571d3f09009af080b5dd4a963de1 Author: Lino Sanfilippo Date: Sun Apr 10 12:46:40 2022 +0200 serial: imx: remove redundant assignment in rs485_config In uart_set_rs485_config() the serial core already assigns the passed serial_rs485 struct to the uart port. So remove the assignment in the drivers rs485_config() function to avoid reduncancy. Acked-by: Uwe Kleine-König Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-8-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit e767aa14f7c527c11f15ac2b3cf9b1f69a557c80 Author: Lino Sanfilippo Date: Sun Apr 10 12:46:39 2022 +0200 serial: max310: remove redundant memset in rs485_config In uart_set_rs485_config() the serial core already nullifies the padding field of the passed serial_rs485 struct before returning it to userspace. Doing the same in the drivers rs485_config() function is redundant, so remove the concerning memset in this function. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-7-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit d84b01cd0497c0efe4bc4517f99c2fbdfddf4129 Author: Lino Sanfilippo Date: Sun Apr 10 12:46:38 2022 +0200 serial: omap: remove redundant code in rs485_config In uart_set_rs485_config() the serial core already clamps the RTS delays. It also assigns the passed serial_rs485 struct to the uart port. So remove these tasks from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-6-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit afea2a93c2307a64aa8406a42db37a42d7f97e5e Author: Lino Sanfilippo Date: Sun Apr 10 12:46:37 2022 +0200 serial: sc16is7xx: remove redundant check in rs485_config In uart_set_rs485_config() the serial core already ensures that only one of both options RTS on send or RTS after send is set. So remove this check from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-5-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit f633eb294af9001873671c2fac398653b168d250 Author: Lino Sanfilippo Date: Sun Apr 10 12:46:36 2022 +0200 serial: stm32: remove redundant code in rs485_config In uart_set_rs485_config() the serial core already ensures that only one of both options RTS on send or RTS after send is set. It also assigns the passed serial_rs485 struct to the uart port. So remove the check and the assignment from the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-4-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit a9efa452486ed59b38f15c2287d3e7e129f6e7fc Author: Lino Sanfilippo Date: Sun Apr 10 12:46:35 2022 +0200 serial: amba-pl011: remove redundant code in rs485_config In uart_set_rs485_config() the serial core already - ensures that only one of both options RTS on send or RTS after send is set - nullifies the padding field of the passed serial_rs485 struct - clamps the RTS delays - assigns the passed serial_rs485 struct to the uart port So remove these tasks from the code of the drivers rs485_config() function to avoid redundancy. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-3-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit 0ed12afa5655512ee418047fb3546d229df20aa1 Author: Lino Sanfilippo Date: Sun Apr 10 12:46:34 2022 +0200 serial: core: move RS485 configuration tasks from drivers into core Several drivers that support setting the RS485 configuration via userspace implement one or more of the following tasks: - in case of an invalid RTS configuration (both RTS after send and RTS on send set or both unset) fall back to enable RTS on send and disable RTS after send - nullify the padding field of the returned serial_rs485 struct - copy the configuration into the uart port struct - limit RTS delays to 100 ms Move these tasks into the serial core to make them generic and to provide a consistent behaviour among all drivers. Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220410104642.32195-2-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit 368ab68b18de104719f386a5cfe3595673cc96de Author: Yu Tu Date: Thu Apr 7 16:13:53 2022 +0800 tty: serial: meson: Use DIV_ROUND_CLOSEST to calculate baud rates Due to chip process differences, chip designers recommend using baud rates as close to and larger as possible in order to reduce clock errors. Signed-off-by: Yu Tu Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20220407081355.13602-2-yu.tu@amlogic.com Signed-off-by: Greg Kroah-Hartman commit 19401e9755313ba681e9c8f41e8c176cd95663bb Author: Kuldeep Singh Date: Mon Apr 4 23:59:36 2022 +0530 dt-bindings: serial: Update Qualcomm geni based QUP UART bindings Similar to I2C controller, move geni based QUP UART controller binding out from parent schema to an individual binding and let parent refer to child schema later on. UART binding also stand incomplete right now similar to I2C, complete it along this process. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220404182938.29492-4-singh.kuldeep87k@gmail.com Signed-off-by: Greg Kroah-Hartman commit e0239ba3ffdd32fb479fcad00390ce2708caae2c Author: Maciej W. Rozycki Date: Thu Mar 31 08:11:33 2022 +0100 serial: 8250: Report which option to enable for blacklisted PCI devices Provide information in the kernel log as to what configuration option to enable for PCI UART devices that have been blacklisted in the generic PCI 8250 UART driver and which have a dedicated driver available to handle that has been disabled. The rationale is there is no easy way for the user to map a specific PCI vendor:device pair to an individual dedicated driver while the generic driver has this information readily available and it will likely be confusing that the generic driver does not register such a port. This is unlike usual drivers, such as drivers/net/ethernet/3com/3c59x.c which handles all the hardware family members regardless of differences between them, and following an existing example where a serio driver provides suggestions as to the correct configuration options to use: psmouse serio1: synaptics: The touchpad can support a better bus than the too old PS/2 protocol. Make sure MOUSE_PS2_SYNAPTICS_SMBUS and RMI4_SMB are enabled to get a better touchpad experience. A message is then printed like: serial 0000:04:00.3: ignoring port, enable SERIAL_8250_PERICOM to handle when an affected device is encountered and the generic driver rejects it. Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203310054120.44113@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 65a8b287023da68c4550deab5c764e6891cf1caf Author: Daniel Gibson Date: Wed Mar 30 01:58:10 2022 +0200 tty: n_tty: Restore EOF push handling behavior TTYs in ICANON mode have a special case that allows "pushing" a line without a regular EOL character (like newline), by using EOF (the EOT character - ASCII 0x4) as a pseudo-EOL. It is silently discarded, so the reader of the PTS will receive the line *without* EOF or any other terminating character. This special case has an edge case: What happens if the readers buffer is the same size as the line (without EOF)? Will they be able to tell if the whole line is received, i.e. if the next read() will return more of the same line or the next line? There are two possibilities, that both have (dis)advantages: 1. The next read() returns 0. FreeBSD (13.0) and OSX (10.11) do this. Advantage: The reader can interpret this as "the line is over". Disadvantage: read() returning 0 means EOF, the reader could also interpret it as "there's no more data" and stop reading or even close the PT. 2. The next read() returns the next line, the EOF is silently discarded. Solaris (or at least OpenIndiana 2021.10) does this, Linux has done do this since commit 40d5e0905a03 ("n_tty: Fix EOF push handling"); this behavior was recently broken by commit 359303076163 ("tty: n_tty: do not look ahead for EOL character past the end of the buffer"). Advantage: read() won't return 0 (EOF), reader less likely to be confused (and things like `while(read(..)>0)` don't break) Disadvantage: The reader can't really know if the read() continues the last line (that filled the whole read buffer) or starts a new line. As both options are defensible (and are used by other Unix-likes), it's best to stick to the "old" behavior since "n_tty: Fix EOF push handling" of 2013, i.e. silently discard that EOF. This patch - that I actually got from Linus for testing and only modified slightly - restores that behavior by skipping an EOF character if it's the next character after reading is done. Based on a patch from Linus Torvalds. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215611 Fixes: 359303076163 ("tty: n_tty: do not look ahead for EOL character past the end of the buffer") Cc: Peter Hurley Cc: Greg Kroah-Hartman Cc: Jiri Slaby Reviewed-and-tested-by: Daniel Gibson Acked-by: Linus Torvalds Signed-off-by: Daniel Gibson Link: https://lore.kernel.org/r/20220329235810.452513-2-daniel@gibson.sh Signed-off-by: Greg Kroah-Hartman commit 857f971328e8c4f45b3d382c2d45610418386027 Author: Phil Edworthy Date: Wed Mar 30 16:40:16 2022 +0100 serial: 8250: Make SERIAL_8250_EM available for arm64 systems This is needed for the Renesas RZ/V2M (r9a09g011) SoC. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220330154024.112270-6-phil.edworthy@renesas.com Signed-off-by: Greg Kroah-Hartman commit 7bb301812b62809903e07ceaf5c176f20798e3c6 Author: Phil Edworthy Date: Wed Mar 30 16:40:13 2022 +0100 dt-bindings: serial: renesas,em-uart: Document r9a09g011 bindings The Renesas RZ/V2M (r9a09g011) SoC uses a uart that is compatible with the EMMA Mobile SoC. Signed-off-by: Phil Edworthy Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220330154024.112270-3-phil.edworthy@renesas.com Acked-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 77edd0de002813629bb3b6efd336a630fab68aa0 Author: Peng Fan Date: Wed Mar 23 17:36:59 2022 +0800 dt-bindings: serial: fsl-lpuart: Add imx93 compatible string The lpuart on i.MX93 is derived from i.MX7ULP with some industrial enhancements, it uses two compatible strings, so update the compatible string for i.MX93. Acked-by: Rob Herring Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220323093659.1722463-1-peng.fan@oss.nxp.com Signed-off-by: Greg Kroah-Hartman commit e5fe471f7156c96a9da34b25f955dae5b0dfb46a Author: Kunihiko Hayashi Date: Wed Mar 30 14:15:38 2022 +0900 dt-bindings: serial: uniphier: Add "resets" property as optional UniPhier UART controller has a reset lines from system controller. Add "resets" property to fix the following warning. uniphier-ld11-global.dtb: serial@54006800: 'resets' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/serial/socionext,uniphier-uart.yaml Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1648617338-8600-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Greg Kroah-Hartman commit ef9a23f358383376009bac2a0262be1fff3eda70 Author: Kunihiko Hayashi Date: Wed Mar 30 14:15:37 2022 +0900 dt-bindings: serial: uniphier: Use maxItems for a single clock 'maxItems' is preferred for a single entry, not 'minItems'. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1648617338-8600-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Greg Kroah-Hartman commit bcea0f547ec1a2ee44d429aaf0334633e386e67c Author: Miaoqian Lin Date: Mon Mar 7 10:51:35 2022 +0000 tty: serial: owl: Fix missing clk_disable_unprepare() in owl_uart_probe Fix the missing clk_disable_unprepare() before return from owl_uart_probe() in the error handling case. Fixes: abf42d2f333b ("tty: serial: owl: add "much needed" clk_prepare_enable()") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220307105135.11698-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit b45b0a12200893732a0b0ec4a6df18521fd976ad Author: Tianjia Zhang Date: Mon Apr 11 11:13:13 2022 +0800 crypto: arm64/sm4 - Fix wrong dependency of NEON/CE implementation Commit d2825fa9365d ("crypto: sm3,sm4 - move into crypto directory") moved the sm4 library implementation from the lib/crypto directory to the crypto directory and configured the name as CRYPTO_SM4. The arm64 SM4 NEON/CE implementation depends on this and needs to be modified uniformly. Fixes: 4f1aef9b806f ("crypto: arm64/sm4 - add ARMv8 NEON implementation") Fixes: 5b33e0ec881c ("crypto: arm64/sm4 - add ARMv8 Crypto Extensions implementation") Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 948e35f13181a8ee85ca5b8cf50248746dfc6291 Author: Yang Shen Date: Sat Apr 9 17:33:09 2022 +0800 crypto: hisilicon/sgl - align the hardware sgl dma address The hardware needs aligned sgl dma address. So expend the sgl_size to align 64 bytes. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 5bfabd50c6fa7fe817e492091fa9428a9202a045 Author: Kai Ye Date: Sat Apr 9 16:03:28 2022 +0800 crypto: hisilicon/zip - support last word dumping 1. Add some debugging registers. 2. Add last word dumping function during zip engine controller reset. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 42123e81fdba56ce5712a1f5d39a600c4d44ddad Author: Kai Ye Date: Sat Apr 9 16:03:27 2022 +0800 crypto: hisilicon/hpre - support last word dumping 1. Add some debugging registers. 2. Add last word dumping function during hpre engine controller reset. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 8a88d0914529f3558bb160cb862ef4daafebb7b4 Author: Kai Ye Date: Sat Apr 9 16:03:26 2022 +0800 crypto: hisilicon/sec - support last word dumping Add last word dumping function during sec engine controller reset. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit a888ccd6c66683a49977ba6a2b91fe52fbec9367 Author: Kai Ye Date: Sat Apr 9 16:03:25 2022 +0800 crypto: hisilicon/qm - add last word dumping for ACC Add last word dumping function during acc engines controller reset. The last words are reported to the printed information during the reset. The dmesg information included qm debugging registers and engine debugging registers. It can help to improve debugging capability. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 30169c5b550a71a47b0aecd9c254dc3a1d5bf4a7 Author: Kai Ye Date: Sat Apr 9 16:03:24 2022 +0800 Documentation: update debugfs doc for Hisilicon ZIP Update documentation describing DebugFS that could help to check the change of register values. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 73e3b46e90a34657bc31fa4886f21800041fd397 Author: Kai Ye Date: Sat Apr 9 16:03:23 2022 +0800 Documentation: update debugfs doc for Hisilicon SEC Update documentation describing DebugFS that could help to check the change of register values. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit a7dbdfda0c42bda6088d02da15c4e56f5094426a Author: Kai Ye Date: Sat Apr 9 16:03:22 2022 +0800 Documentation: update debugfs doc for Hisilicon HPRE Update documentation describing DebugFS that could help to check the change of register values. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 9b0c97dfc215b87208a699870881a69e762301ca Author: Kai Ye Date: Sat Apr 9 16:03:21 2022 +0800 crypto: hisilicon/zip - support register checking The value of the register is changed after the task running. A debugfs file node is added to help users to check the change of register values. Signed-off-by: Longfang Liu Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 16175030bb5b53ab125480af6cfb73ae8064d780 Author: Kai Ye Date: Sat Apr 9 16:03:20 2022 +0800 crypto: hisilicon/sec - support register checking The value of the register is changed after the task running. A debugfs file node is added to help users to check the change of register values. Signed-off-by: Longfang Liu Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 9210bdaa0d49d271fcff901d47ecadfaf1786a76 Author: Kai Ye Date: Sat Apr 9 16:03:19 2022 +0800 crypto: hisilicon/hpre - support register checking The value of the register is changed after the task running. A debugfs file node is added to help users to check the change of register values. Signed-off-by: Longfang Liu Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit f1724d397c60d296c0805c95a46ae7fc7163b70c Author: Kai Ye Date: Sat Apr 9 16:03:18 2022 +0800 crypto: hisilicon/qm - add register checking for ACC Add register detection function to accelerator. Provided a tool that user can checking differential register through Debugfs. e.g. cd /sys/kernel/debug/hisi_zip//zip_dfx cat diff_regs Signed-off-by: Longfang Liu Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 10299073bc35ce051530fef318598b2f8b36e383 Author: Yihao Han Date: Fri Apr 8 07:23:49 2022 -0700 crypto: ux500/hash - simplify if-if to if-else Replace `if (!req_ctx->updated)` with `else` for simplification and add curly brackets according to the kernel coding style: "Do not unnecessarily use braces where a single statement will do." ... "This does not apply if only one branch of a conditional statement is a single statement; in the latter case use braces in both branches" Please refer to: https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html Signed-off-by: Yihao Han Signed-off-by: Herbert Xu commit 716a757c83ad6208a743dd8fb1577055d0867ee8 Author: Conor Dooley Date: Fri Apr 8 10:09:12 2022 +0000 hwrng: mpfs - add polarfire soc hwrng support Add a driver to access the hardware random number generator on the Polarfire SoC. The hwrng can only be accessed via the system controller, so use the mailbox interface the system controller exposes to access the hwrng. Signed-off-by: Conor Dooley Signed-off-by: Herbert Xu commit ebd26229a7b343268c231008f295841ef45d0b96 Author: Marco Chiappero Date: Thu Apr 7 17:54:55 2022 +0100 crypto: qat - remove line wrapping for pfvf_ops functions Remove unnecessary line wrapping for the adf_enable_vf2pf_interrupts() function, and harmonize pfvf_ops text. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit fa374954836779a08cfb773ff20fe2083cb9d420 Author: Marco Chiappero Date: Thu Apr 7 17:54:54 2022 +0100 crypto: qat - use u32 variables in all GEN4 pfvf_ops Change adf_gen4_enable_vf2pf_interrupts() to use a u32 variable, consistently with both other GEN4 pfvf_ops and pfvf_ops of other generations. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit e3e668fc77153591553a14c4077c619b2ab55974 Author: Marco Chiappero Date: Thu Apr 7 17:54:53 2022 +0100 crypto: qat - replace disable_vf2pf_interrupts() As a consequence of the refactored VF2PF interrupt handling logic, a function that disables specific VF2PF interrupts is no longer needed. Instead, a simpler function that disables all the interrupts, also hiding the device specific amount of VFs to be disabled from the pfvf_ops users, would be sufficient. This patch replaces disable_vf2pf_interrupts() with the new disable_all_vf2pf_interrupts(), which doesn't need any argument and disables all the VF2PF interrupts. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 8314ae8f5363ff8e7dece6d0eb884970a5530969 Author: Marco Chiappero Date: Thu Apr 7 17:54:52 2022 +0100 crypto: qat - leverage the GEN2 VF mask definiton Replace hard coded VF masks in adf_gen2_pfvf.c with the recently introduced ADF_GEN2_VF_MSK. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit c690c7f6312ce69b426af08ae1da2b9e48a0246f Author: Marco Chiappero Date: Thu Apr 7 17:54:51 2022 +0100 crypto: qat - rework the VF2PF interrupt handling logic Change the VF2PF interrupt handler in the PF ISR and the definition of the internal PFVF API to correct the current implementation, which can result in missed interrupts. More specifically, current HW generations consider a write to the mask register, regardless of the value, as an acknowledge of any pending VF2PF interrupt. Therefore, if there is an interrupt between the source register read and the mask register write, such interrupt will not be delivered and silently acknowledged, resulting in a lost VF2PF message. To work around the problem, rather than disabling specific interrupts, disable all the interrupts and re-enable only the ones that we are not serving (excluding the already disabled ones too). This will force any other pending interrupt to be triggered and be serviced by a subsequent ISR. This new approach requires, however, changes to the interrupt related pfvf_ops functions. In particular, get_vf2pf_sources() has now been removed in favor of disable_pending_vf2pf_interrupts(), which not only retrieves and returns the pending (and enabled) sources, but also disables them. As a consequence, introduce the adf_disable_pending_vf2pf_interrupts() utility in place of adf_disable_vf2pf_interrupts_irq(), which is no longer needed. Cc: stable@vger.kernel.org Fixes: 993161d ("crypto: qat - fix handling of VF to PF interrupts") Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit dd3d081b7ea6754913222ed0313fcf644edcc7e6 Author: Marco Chiappero Date: Thu Apr 7 17:54:50 2022 +0100 crypto: qat - fix off-by-one error in PFVF debug print PFVF Block Message requests for CRC use 0-based values to indicate amounts, which have to be remapped to 1-based values on the receiving side. This patch fixes one debug print which was however using the wire value. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 2ca1e0a7fafa65fc6bd8d0236146f8fb8e8a3f81 Author: Marco Chiappero Date: Thu Apr 7 17:54:49 2022 +0100 crypto: qat - fix wording and formatting in code comment Remove an unintentional extra space and improve the readability of a PFVF related code comment. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 27c0f3a14f9fd16eed4e0167cf58225ca28ab4f8 Author: Marco Chiappero Date: Thu Apr 7 17:54:48 2022 +0100 crypto: qat - test PFVF registers for spurious interrupts on GEN4 Spurious PFVF interrupts can happen when either the ISR is invoked without a valid source being set or, otherwise, when no interrupt bit is set in the PFVF register containing the message. The latter test was present for GEN2 devices but missing for GEN4, this patch fills the gap. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 4b61d2bd346de12bb62668ae0dc2f332643067a3 Author: Wojciech Ziemba Date: Thu Apr 7 17:54:47 2022 +0100 crypto: qat - add check for invalid PFVF protocol version 0 PFVF protocol version 0 is not a valid version, but PF drivers currently would report any such version from VFs as compatible. This patch adds an extra check for the invalid PFVF protocol version 0. Signed-off-by: Wojciech Ziemba Signed-off-by: Marco Chiappero Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 569b462e6604fab6ec4dc6649d06ac62564567ce Author: Marco Chiappero Date: Thu Apr 7 17:54:46 2022 +0100 crypto: qat - add missing restarting event notification in VFs VF drivers are notified via PFVF of the VFs being disabled, but such notification was not propagated within the VF driver. Dispatch the ADF_EVENT_RESTARTING event by adding a missing call to adf_dev_restarting_notify(). Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit f9f8f2b7415705448118102764076504c0850082 Author: Marco Chiappero Date: Thu Apr 7 17:54:45 2022 +0100 crypto: qat - remove unnecessary tests to detect PFVF support Previously, the GEN4 host driver supported SR-IOV but had no working implementation of the PFVF protocol to communicate with VF drivers. Since all the host drivers for QAT devices now support both SR-IOV and PFVF, remove the old and unnecessary checks to test PFVF support. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 80280aeb2d51140f61ebd88343cd30daf22b4dc2 Author: Giovanni Cabiddu Date: Thu Apr 7 17:54:44 2022 +0100 crypto: qat - remove unused PFVF stubs The functions adf_enable_pf2vf_interrupts(), adf_flush_vf_wq() and adf_disable_pf2vf_interrupts() are not referenced when the driver is compiled with CONFIG_PCI_IOV=n. This patch removes these unused stubs. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 992ec1fa86919933bfe2963473ef291b2031556d Author: Marco Chiappero Date: Thu Apr 7 17:54:43 2022 +0100 crypto: qat - remove unneeded braces Remove unnecessary braces around a single statement in a for loop. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 9ff9139b5ddbd4d3ea93558a2d477a6bab4eff94 Author: Marco Chiappero Date: Thu Apr 7 17:54:42 2022 +0100 crypto: qat - fix ETR sources enabled by default on GEN2 devices When the driver starts the device, it enables all the necessary interrupts. However interrupts associated to host rings are enabled by default on all GEN2 devices (except for dh895x) even when SR-IOV is active. Fix this behaviour by checking if data structures associated to VFs have been allocated to determine whether to enable such interrupts or not. Since the logic for the fix is the same across GEN2 devices, replace the function to be fixed (adf_enable_ints()) with a single one (adf_gen2_enable_ints()) in the common GEN2 code in adf_gen2_hw_data.c. Likewise, remove the unnecessary duplication of defines too. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 0eaa51543273fd0f4ba9bea83638f7033436e5eb Author: Giovanni Cabiddu Date: Thu Apr 7 17:54:41 2022 +0100 crypto: qat - set COMPRESSION capability for DH895XCC The capability detection logic clears bits for the features that are disabled in a certain SKU. For example, if the bit associate to compression is not present in the LEGFUSE register, the correspondent bit is cleared in the capability mask. This change adds the compression capability to the mask as this was missing in the commit that enhanced the capability detection logic. Fixes: cfe4894eccdc ("crypto: qat - set COMPRESSION capability for QAT GEN2") Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 6a23804cb8bcb85c6998bf193d94d4036db26f51 Author: Giovanni Cabiddu Date: Thu Apr 7 17:54:40 2022 +0100 crypto: qat - set CIPHER capability for DH895XCC Set the CIPHER capability for QAT DH895XCC devices if the hardware supports it. This is done if both the CIPHER and the AUTHENTICATION engines are available on the device. Fixes: ad1332aa67ec ("crypto: qat - add support for capability detection") Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit a260436c98171cd825955a84a7f6e62bc8f4f00d Author: Gilad Ben-Yossef Date: Wed Apr 6 11:11:39 2022 +0300 crypto: ccree - use fine grained DMA mapping dir Use a fine grained specification of DMA mapping directions in certain cases, allowing both a more optimized operation as well as shushing out a harmless, though persky dma-debug warning. Signed-off-by: Gilad Ben-Yossef Reported-by: Corentin Labbe Signed-off-by: Herbert Xu commit 476c9ab75976c3aea1f7f05e1ebbd1219a0f11bb Author: Gilad Ben-Yossef Date: Wed Apr 6 11:11:38 2022 +0300 crypto: ccree - rearrange init calls to avoid race Rearrange init calls to avoid the rare race condition of the cipher algs being registered and used while we still init the hash code which uses the HW without proper lock. Signed-off-by: Gilad Ben-Yossef Reported-by: Dung Nguyen Tested-by: Jing Dan Tested-by: Dung Nguyen Fixes: 63893811b0fc("crypto: ccree - add ahash support") Signed-off-by: Herbert Xu commit c79c09ad31e2c0a5ba0166b284f433b95d9c4c18 Author: Robin Murphy Date: Tue Apr 5 13:25:11 2022 +0100 crypto: qat - stop using iommu_present() Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. Signed-off-by: Robin Murphy Acked-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit edf45f007a31e86738f6be3065591ddad94477d1 Merge: caf968b483351 d20339fa93e98 Author: Paolo Abeni Date: Fri Apr 15 09:26:00 2022 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net commit e73b5c7f3d34c159447de0d24110f1df6d1b6615 Author: Jaewon Kim Date: Thu Apr 7 16:16:19 2022 +0900 tty: serial: samsung: add spin_lock for interrupt and console_write The console_write and IRQ handler can run concurrently. Problems may occurs console_write is continuously executed while the IRQ handler is running. Reviewed-by: Jiri Slaby Signed-off-by: Jaewon Kim Link: https://lore.kernel.org/r/20220407071619.102249-2-jaewon02.kim@samsung.com Signed-off-by: Greg Kroah-Hartman commit ee157a79e7c82b01ae4c25de0ac75899801f322c Author: Huang Guobin Date: Thu Mar 31 17:10:05 2022 +0800 tty: Fix a possible resource leak in icom_probe When pci_read_config_dword failed, call pci_release_regions() and pci_disable_device() to recycle the resource previously allocated. Reviewed-by: Jiri Slaby Signed-off-by: Huang Guobin Link: https://lore.kernel.org/r/20220331091005.3290753-1-huangguobin4@huawei.com Signed-off-by: Greg Kroah-Hartman commit 570f749f4d54bd2db9b44c51aac3a6883f45a171 Author: Christophe Leroy Date: Sat Apr 2 12:20:19 2022 +0200 tty: serial: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Reviewed-by: Jiri Slaby Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/49fc0d4b6446da630b1e9f29c4bab38f8ed087bf.1648833419.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit 8fbb3fc9c4142522efaf5da6acbd512683fc4a54 Author: Christophe Leroy Date: Sat Apr 2 12:18:55 2022 +0200 tty: hvc: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/8b3dbd25bbeb7949e1b0a2170fee7b9cc5a6f806.1648833418.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit 507b05063d1b7a1fcb9f7d7c47586fc4f3508f98 Author: Wang Weiyang Date: Mon Mar 28 19:58:44 2022 +0800 tty: goldfish: Use tty_port_destroy() to destroy port In goldfish_tty_probe(), the port initialized through tty_port_init() should be destroyed in error paths.In goldfish_tty_remove(), qtty->port also should be destroyed or else might leak resources. Fix the above by calling tty_port_destroy(). Fixes: 666b7793d4bf ("goldfish: tty driver") Reviewed-by: Jiri Slaby Signed-off-by: Wang Weiyang Link: https://lore.kernel.org/r/20220328115844.86032-1-wangweiyang2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 2584b3549f4c4081918bfd4109148b1003b2626b Author: John Harrison Date: Tue Apr 12 15:59:55 2022 -0700 drm/i915/guc: Update to GuC version 70.1.1 The latest GuC firmware drops the context descriptor pool in favour of passing all creation data in the create H2G. It also greatly simplifies the work queue and removes the process descriptor used for multi-LRC submission. So, remove all mention of LRC and process descriptors and update the registration code accordingly. Unfortunately, the new API also removes the ability to set default values for the scheduling policies at context registration time. Instead, a follow up H2G must be sent. The individual scheduling policy update H2G commands are also dropped in favour of a single KLV based H2G. So, change the update wrappers accordingly and call this during context registration.. Of course, this second H2G per registration might fail due to being backed up. The registration code has a complicated state machine to cope with the actual registration call failing. However, if that works then there is no support for unwinding if a further call should fail. Unwinding would require sending a H2G to de-register - but that can't be done because the CTB is already backed up. So instead, add a new flag to say whether the context has a pending policy update. This is set if the policy H2G fails at registration time. The submission code checks for this flag and retries the policy update if set. If that call fails, the submission path early exists with a retry error. This is something that is already supported for other reasons. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220412225955.1802543-2-John.C.Harrison@Intel.com commit 6a9e261cbbee08c499f2331910027e8c40c8f81f Author: Paul Moore Date: Thu Apr 14 16:40:10 2022 -0400 selinux: don't sleep when CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE is true Unfortunately commit 81200b0265b1 ("selinux: checkreqprot is deprecated, add some ssleep() discomfort") added a five second sleep during early kernel boot, e.g. start_kernel(), which could cause a "scheduling while atomic" panic. This patch fixes this problem by moving the sleep out of checkreqprot_set() and into sel_write_checkreqprot() so that we only sleep when the checkreqprot setting is set during runtime, after the kernel has booted. The error message remains the same in both cases. Fixes: 81200b0265b1 ("selinux: checkreqprot is deprecated, add some ssleep() discomfort") Reported-by: J. Bruce Fields Signed-off-by: Paul Moore commit cabfa2bbe617ddf0a0cc4d01f72b584dae4939ad Author: Helge Deller Date: Thu Apr 14 22:17:18 2022 +0200 Revert "video: fbdev: fbmem: fix pointer reference to null device field" This reverts commit d6cd978f7e6b6f6895f8d0c4ce6e5d2c8e979afe. It has been solved differently already. Signed-off-by: Helge Deller Acked-by: Paul Menzel Link: https://patchwork.freedesktop.org/patch/msgid/20220210065824.368355-1-zhouzhouyi@gmail.com commit 3c3b352863ec4f88cc3ca8fcb4dff4d6f18483f0 Author: Linus Walleij Date: Wed Apr 13 20:46:33 2022 +0200 ARM: dts: ux500: Add NFC to the Codina This adds the PN544 NFC chip mounted on some of the Codina models numbered GT-I8160P. The "P" at the end of the product number indicates that an NFC chip is mounted. Signed-off-by: Linus Walleij commit d6cd978f7e6b6f6895f8d0c4ce6e5d2c8e979afe Author: Zhouyi Zhou Date: Thu Feb 10 14:58:24 2022 +0800 video: fbdev: fbmem: fix pointer reference to null device field In function do_remove_conflicting_framebuffers, if device is NULL, there will be null pointer reference. The patch add a check to the if expression. Signed-off-by: Zhouyi Zhou Acked-by: Paul Menzel Signed-off-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20220210065824.368355-1-zhouzhouyi@gmail.com commit 16a54d4ee7c8aa1c4b59a91bea24799f48bcc5b5 Author: Yang Guang Date: Tue Nov 30 08:05:08 2021 +0800 fbcon: replace snprintf in show functions with sysfs_emit Use sysfs_emit instead of scnprintf or sprintf. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/0cb7ca73d9cd7162988a22a24cd18bbcd3d8bb27.1638156341.git.yang.guang5@zte.com.cn commit d68cf992ded575928cf4ddf7c64faff0d8dcce14 Author: Gavin Wan Date: Wed Apr 13 11:09:22 2022 -0400 drm/amd/amdgpu: Remove static from variable in RLCG Reg RW [why] These static variables save the RLC Scratch registers address. When we install multiple GPUs (for example: XGMI setting) and multiple GPUs call the function at same time. The RLC Scratch registers address are changed each other. Then it caused reading/writing from/to wrong GPU. [how] Removed the static from the variables. The variables are on the stack. Fixes: 5d447e29670148 ("drm/amdgpu: add helper for rlcg indirect reg access") Reviewed-by: Alex Deucher Signed-off-by: Gavin Wan Signed-off-by: Alex Deucher commit 250e64a3f06c42e993e7b8c6f727d43b5b9f8c96 Author: Felix Kuehling Date: Tue Apr 12 16:24:49 2022 -0400 drm/amdkfd: fix race condition in kfd_wait_on_events Add the waiters to the wait queue during initialization, while holding the event spinlock. Otherwise the waiter will not get activated if the event signals before being added to the wait queue. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 9e12b5947bbaa74db32e24d77ebf3bd71015970c Author: Rodrigo Siqueira Date: Tue Apr 12 14:32:51 2022 -0400 Revert "drm/amd/display: Pass HostVM enable flag into DCN3.1 DML" This reverts commit 863fa85e6a01c8b239009825dd9de1f64d7d020a. While we were testing DCN3.1 with a hub, we noticed that only one of 2 connected displays lights up when using some specific display resolution. In summary, this was the setup: 1. Displays: * Sharp LQ156M1JW26 (eDP): 1080@240 * BENQ SW320 (DP): 4k@60 * BENQ EX3203R (DP): 4k@60 2. Hub: Club3D CSV-7300 3. ASIC: DCN3.1 After bisecting this issue, we figured out the commit mentioned above introduced this issue. We are investigating why this patch introduced this regression, but we need to revert it for now. Cc: Harry Wentland Cc: Mark Broadworth Cc: Michael Strauss Acked-by: Alex Deucher Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7c703a7d3f2b50a6187267420a4d3d7e62fa3206 Author: xinhui pan Date: Tue Apr 12 19:52:16 2022 +0800 drm/amdgpu: Fix one use-after-free of VM VM might already be freed when amdgpu_vm_tlb_seq_cb() is called. We see the calltrace below. Fix it by keeping the last flush fence around and wait for it to signal BUG kmalloc-4k (Not tainted): Poison overwritten 0xffff9c88630414e8-0xffff9c88630414e8 @offset=5352. First byte 0x6c instead of 0x6b Allocated in amdgpu_driver_open_kms+0x9d/0x360 [amdgpu] age=44 cpu=0 pid=2343 __slab_alloc.isra.0+0x4f/0x90 kmem_cache_alloc_trace+0x6b8/0x7a0 amdgpu_driver_open_kms+0x9d/0x360 [amdgpu] drm_file_alloc+0x222/0x3e0 [drm] drm_open+0x11d/0x410 [drm] Freed in amdgpu_driver_postclose_kms+0x3e9/0x550 [amdgpu] age=22 cpu=1 pid=2485 kfree+0x4a2/0x580 amdgpu_driver_postclose_kms+0x3e9/0x550 [amdgpu] drm_file_free+0x24e/0x3c0 [drm] drm_close_helper.isra.0+0x90/0xb0 [drm] drm_release+0x97/0x1a0 [drm] __fput+0xb6/0x280 ____fput+0xe/0x10 task_work_run+0x64/0xb0 Suggested-by: Christian König Signed-off-by: xinhui pan Reviewed-by: Christian König Signed-off-by: Alex Deucher commit abb5bc59490067b88ed006cdb58f3ff1d12057cc Author: Dan Carpenter Date: Wed Apr 13 10:36:40 2022 +0300 drm/amdkfd: potential NULL dereference in kfd_set/reset_event() If lookup_event_by_id() returns a NULL "ev" pointer then the spin_lock(&ev->lock) will crash. This was detected by Smatch: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_events.c:644 kfd_set_event() error: we previously assumed 'ev' could be null (see line 639) Fixes: 5273e82c5f47 ("drm/amdkfd: Improve concurrency of event handling") Signed-off-by: Dan Carpenter Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit af47d8033fc731f19600efd27ba4a7d0fdfcc77c Author: Andy Shevchenko Date: Thu Apr 14 21:42:48 2022 +0300 gpiolib: Introduce a helper to get first GPIO controller node Introduce a helper to get first GPIO controller node which drivers may want to use. Signed-off-by: Andy Shevchenko Tested-by: Marek Szyprowski commit 492fca28fae8e4aa93c1b054423c152d540a36e8 Author: Andy Shevchenko Date: Mon Apr 11 14:53:53 2022 +0300 pinctrl: samsung: Switch to use for_each_gpiochip_node() helper Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, switch to fwnode APIs where it makes sense. Signed-off-by: Andy Shevchenko Tested-by: Krzysztof Kozlowski commit 954445c72fc75823b23c7046a9790e55dcf4f7f1 Author: Andy Shevchenko Date: Mon Apr 11 14:49:05 2022 +0300 pinctrl: samsung: Drop redundant node parameter in samsung_banks_of_node_get() The node is taken from the device pointer, which is supplied as a parameter, hence no need to have a separate parameter for node. Drop redundant node parameter in samsung_banks_of_node_get(). While at it, drop "of_" part in the samsung_banks_of_node_get() and samsung_banks_of_node_put() function names to avoid additional churn in the next changes. Signed-off-by: Andy Shevchenko Tested-by: Krzysztof Kozlowski commit d8bb92e70a434584f5b8a882eb46930cc22fd45a Author: Imre Deak Date: Mon Apr 11 16:25:39 2022 +0300 drm/dp: Factor out a function to probe a DPCD address Factor out from drm_dp_dpcd_read() a function to probe a DPCD address with a 1-byte read access. This will be needed by the next patch doing a read from an LTTPR address, which must happen without the preceding wake-up read in drm_dp_dpcd_read(). While at it add tracing for the 1 byte read even if the read was successful. v2: Add a probe function instead of exporting drm_dp_dpcd_access(). (Jani) v3: Add tracing for the 1-byte read even if the read was successful. (Khaled) Cc: Jani Nikula Cc: Khaled Almahallawy Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220411132539.984647-1-imre.deak@intel.com commit 5e6a0e05270e3a4bb9289a0415d062966c27d192 Author: Shengjiu Wang Date: Mon Mar 28 10:20:12 2022 +0800 remoteproc: core: Move state checking to remoteproc_core There is no mutex protection of these state checking for 'stop' and 'detach' which can't guarantee there is no another instance is trying to do same operation. Consider two instances case: Instance1: echo stop > /sys/class/remoteproc/remoteproc0/state Instance2: echo stop > /sys/class/remoteproc/remoteproc0/state The issue is that the instance2 case may success, Or it may fail with -EINVAL, which is uncertain. So move this state checking in rproc_cdev_write() and state_store() for 'stop', 'detach' operation to 'rproc_shutdown' , 'rproc_detach' function under the mutex protection. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1648434012-16655-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mathieu Poirier commit 8f454f950dbb663180f596db18c3dc7ec26497f0 Author: Shengjiu Wang Date: Mon Mar 28 10:20:11 2022 +0800 remoteproc: core: Remove state checking before calling rproc_boot() There is no mutex protection of the state checking before rproc_boot(), which can't guarantee there is no another instance is trying to do same operation. Consider two instances case: Instance1: echo start > /sys/class/remoteproc/remoteproc0/state Instance2: echo start > /sys/class/remoteproc/remoteproc0/state ... Instance2: echo stop > /sys/class/remoteproc/remoteproc0/state ... Instance1: echo stop > /sys/class/remoteproc/remoteproc0/state The one issue is that the instance2 case may success when 'start' happens at same time as instance1, then rproc->power = 2; Or it may fail with -BUSY, then rproc->power = 1; which is uncertain. The another issue is for 'stop' operation, if the rproc->power = 1, when instance2 'stop' the remoteproc the instance1 will be impacted for it still needs the service at that time. The reference counter rproc->power is used to manage state changing and there is mutex protection in each operation function for multi instance case. So remove this state checking in rproc_cdev_write() and state_store() for 'start' operation, just let reference counter rproc->power to manage the behaviors. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1648434012-16655-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mathieu Poirier commit 19aed2d6cdb72a7c92909832b9480d9cadebeef9 Author: Akihiko Odaki Date: Fri Apr 8 13:11:14 2022 +0900 ASoC: soc-card: Create jack kcontrol without pins snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown commit 9c3a431a486d0c494a68941045885333a5bc1975 Author: Jiri Slaby Date: Mon Apr 11 12:45:06 2022 +0200 tty: serial: altera: use altera_jtaguart_stop_tx() altera_jtaguart_tx_chars() duplicates what altera_jtaguart_stop_tx() already does. So instead of the duplication, call the helper instead. Not only it makes the code cleaner, but it also says what the "if" really does. Cc: Tobias Klauser Acked-by: Tobias Klauser Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411104506.8990-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit d9b80d07db686402bbb3b237692a98da93125ace Author: Jiri Slaby Date: Mon Apr 11 12:45:05 2022 +0200 tty: serial: owl-uart, send x_char even if stopped Flow control characters should be sent even if the TX is stopped. So fix owl-uart to behave the same as other drivers. This unification also allows the use of the TX helper in the future. Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411104506.8990-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 83ead219292afb5dd401b68c4ee3becf8d26b6e4 Author: Jiri Slaby Date: Mon Apr 11 12:45:04 2022 +0200 tty: serial: mpc52xx_uart: remove double ifdeffery The code now contains: #ifdef CONFIG_PPC_MPC512x ... #endif #ifdef CONFIG_PPC_MPC512x ... #endif So remove the endif+ifdef from the middle, provided it's about the same define. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411104506.8990-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 689ca31c542687709ba21ec2195c1fbce34fd029 Author: Zheyu Ma Date: Sun Apr 10 19:48:14 2022 +0800 tty: synclink_gt: Fix null-pointer-dereference in slgt_clean() When the driver fails at alloc_hdlcdev(), and then we remove the driver module, we will get the following splat: [ 25.065966] general protection fault, probably for non-canonical address 0xdffffc0000000182: 0000 [#1] PREEMPT SMP KASAN PTI [ 25.066914] KASAN: null-ptr-deref in range [0x0000000000000c10-0x0000000000000c17] [ 25.069262] RIP: 0010:detach_hdlc_protocol+0x2a/0x3e0 [ 25.077709] Call Trace: [ 25.077924] [ 25.078108] unregister_hdlc_device+0x16/0x30 [ 25.078481] slgt_cleanup+0x157/0x9f0 [synclink_gt] Fix this by checking whether the 'info->netdev' is a null pointer first. Reviewed-by: Jiri Slaby Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220410114814.3920474-1-zheyuma97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fb4028fbb97d6c71c30556e81eb8ce07eef7b8b Author: Jiri Slaby Date: Mon Apr 11 13:01:43 2022 +0200 Documentation: tty: n_gsm, use power of ReST Reformat the whole document, so that automatic numbering and TOC is properly generated. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e937eb43b8791cd55bd518d1ffc747d3430d8ec9 Author: Jiri Slaby Date: Mon Apr 11 13:01:42 2022 +0200 Documentation: tty: n_gsm, delete "Additional Documentation" All of the URLs give 404. There is a little point to preserve them. If really need be, we could try archive.org if the documents are not there by a chance. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5b437ae9fcbb22fe6de3c715534515209207a092 Author: Jiri Slaby Date: Mon Apr 11 13:01:41 2022 +0200 Documentation: tty: move moxa-smartio.rst to tty It is a tty_driver, not serial -- uart_driver. So move it to the tty docs dir too. (The same as the driver itself.) Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e26595034dada8a1e6c10f0e0187f43edec72698 Author: Jiri Slaby Date: Mon Apr 11 13:01:40 2022 +0200 Documentation: tty: move n_gsm to tty We have n_tty documented in Documentation/driver-api/tty/. n_gsm belongs there too, so move from serial/ to tty/ too. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 1a4a8f6bbac07e3270805009c69e89c7de801df1 Author: Jiri Slaby Date: Mon Apr 11 13:01:39 2022 +0200 Documentation: tty: introduce "Other Documentation" So far only n_tty belongs here, but in the next patches, more will come. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit b96cd8b05ead8939b972192c4f4ac2fc2dffceb7 Author: Jiri Slaby Date: Mon Apr 11 13:01:38 2022 +0200 Documentation: move tty to driver-api Based on discussion starting as 87mthw2o93.fsf@meer.lwn.net, let's move the tty documentation to driver-api. It's more appropriate there. Cc: Jonathan Corbet Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220411110143.10019-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit bed6d200f8ca38e1ecbdd8fb7e0564884002abd1 Author: Colin Ian King Date: Thu Apr 14 11:36:50 2022 +0100 staging: rtl8192u: make read-only array EWC11NHTCap static const Don't populate the read-only array EWC11NHTCap on the stack but instead make it static const. Also makes the object code a little smaller. Remove comment. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220414103650.297396-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 548f8b21ae6053680c61fe7ca79e2380b0b3964e Author: Krzysztof Kozlowski Date: Mon Apr 11 17:55:28 2022 +0200 dt-bindings: soc: qcom,smp2p: convert to dtschema Convert the Qualcomm Shared Memory Point 2 Point bindings to DT Schema. Changes against original bindings: enforce only specific names of child nodes, instead of any names. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220411155528.502889-1-krzysztof.kozlowski@linaro.org commit 73f93db5c49b9f52c902e5dc6c750bf9832e0450 Author: Paul Kocialkowski Date: Thu Apr 14 10:40:40 2022 +0200 spi: core: Initialize returned status in spi_setup The previous commit that made bits-per-word validation conditional results in leaving no unconditional affectation of the status variable. Since the variable is returned at the end of the function, initialize it to avoid returning an undefined value. Signed-off-by: Paul Kocialkowski Fixes: b3fe2e516741 ("spi: core: Only check bits_per_word validity when explicitly provided") Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/20220414084040.975520-1-paul.kocialkowski@bootlin.com Signed-off-by: Mark Brown commit ce8abf340e40e1126bfcb9e7679b3d6b524ae3e0 Merge: fde33ca4cb2ba 3dc6ffae2da20 Author: Thomas Gleixner Date: Thu Apr 14 16:55:47 2022 +0200 Merge tag 'tai-for-tracing' into timers/core Pull in the NMI safe TAI accessor which was provided for the tracing tree to prepare for further changes in this area. commit 3dc6ffae2da201284cb24af66af77ee0bbb2efaa Author: Kurt Kanzenbach Date: Thu Apr 14 11:18:03 2022 +0200 timekeeping: Introduce fast accessor to clock tai Introduce fast/NMI safe accessor to clock tai for tracing. The Linux kernel tracing infrastructure has support for using different clocks to generate timestamps for trace events. Especially in TSN networks it's useful to have TAI as trace clock, because the application scheduling is done in accordance to the network time, which is based on TAI. With a tai trace_clock in place, it becomes very convenient to correlate network activity with Linux kernel application traces. Use the same implementation as ktime_get_boot_fast_ns() does by reading the monotonic time and adding the TAI offset. The same limitations as for the fast boot implementation apply. The TAI offset may change at run time e.g., by setting the time or using adjtimex() with an offset. However, these kind of offset changes are rare events. Nevertheless, the user has to be aware and deal with it in post processing. An alternative approach would be to use the same implementation as ktime_get_real_fast_ns() does. However, this requires to add an additional u64 member to the tk_read_base struct. This struct together with a seqcount is designed to fit into a single cache line on 64 bit architectures. Adding a new member would violate this constraint. Signed-off-by: Kurt Kanzenbach Signed-off-by: Thomas Gleixner Cc: Steven Rostedt Link: https://lore.kernel.org/r/20220414091805.89667-2-kurt@linutronix.de commit fde33ca4cb2bae6472714123b451475fdfd9995c Author: Anna-Maria Behnsen Date: Mon Apr 11 16:01:15 2022 +0200 tracing/timer: Add missing argument documentation of trace points Documentation of trace points timer_start, timer_expire_entry and hrtimer_start lack always the last argument. Add it to keep implementation and documentation in sync. Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/20220411140115.24185-1-anna-maria@linutronix.de commit c48c8b829d2b966a6649827426bcdba082ccf922 Author: Marc Zyngier Date: Thu Apr 14 15:00:11 2022 +0100 genirq: Take the proposed affinity at face value if force==true Although setting the affinity of an interrupt to a set of CPUs that doesn't have any online CPU is generally frowned apon, there are a few limited cases where such affinity is set from a CPUHP notifier, setting the affinity to a CPU that isn't online yet. The saving grace is that this is always done using the 'force' attribute, which gives a hint that the affinity setting can be outside of the online CPU mask and the callsite set this flag with the knowledge that the underlying interrupt controller knows to handle it. This restores the expected behaviour on Marek's system. Fixes: 33de0aa4bae9 ("genirq: Always limit the affinity to online CPUs") Reported-by: Marek Szyprowski Signed-off-by: Marc Zyngier Signed-off-by: Thomas Gleixner Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/4b7fc13c-887b-a664-26e8-45aed13f048a@samsung.com Link: https://lore.kernel.org/r/20220414140011.541725-1-maz@kernel.org commit f1e4c916f97f6adc0848515d269b3899661873ce Author: Jani Nikula Date: Mon Apr 11 17:00:35 2022 +0300 drm/edid: add EDID block count and size helpers Add some helpers to figure out the EDID extension block count, block count, size, pointers to blocks. Unfortunately, we'll need to cast away the const in a few places where we actually need to access the data. v3: fix (!edid_extension_block_count(edid) == 0) (kernel test robot) v2: fix s/j/i/ introduced in a rebase Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/dc7b0850293d837439fb3914c8a9d81e39018b4b.1649685475.git.jani.nikula@intel.com commit 1c788f69f2643f38e7fdf0ba6c8a88bc0b3aefd7 Author: Jani Nikula Date: Mon Apr 11 17:00:34 2022 +0300 drm/edid: add single point of return to drm_do_get_edid() This will be useful in the future. Use fail label for fail exit. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/8e564e9415baa4dc9dc3127e4200b2618a8a3ba0.1649685475.git.jani.nikula@intel.com commit b3eb97b66d4f2f919f5dd683c8ea62058fde1a93 Author: Jani Nikula Date: Mon Apr 11 17:00:33 2022 +0300 drm/edid: drop extra local var We don't need override as a variable for anything. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/4d249173b34758e1d6c4a74eb98518d180f0a8ae.1649685475.git.jani.nikula@intel.com commit d3da3f4072c82e5be5aaafd6168c8effdea1be19 Author: Jani Nikula Date: Mon Apr 11 17:00:32 2022 +0300 drm/edid: convert extension block read to EDID block read helper Use the EDID block read helper also for extension block reads, making edid_block_read() the only place with the read retry logic. Note: We observe that drm_do_get_edid() does not use invalid extension blocks to flag the EDID as corrupt. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/a6328b898db40235b85ad4635374bc0768b5a970.1649685475.git.jani.nikula@intel.com commit c12561ce43358ce59fc0f2275fc1853e24980908 Author: Jani Nikula Date: Mon Apr 11 17:00:31 2022 +0300 drm/edid: use EDID block read helper in drm_do_get_edid() Convert drm_do_get_edit() from the base block read helper to the generic block read helper. There's quite a bit going on here, as the corrupt and null EDID information is moved back to the caller. As we see, they were not all that clear to begin with, and this change underlines that. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/3bcf98453770757ee93386da0cfbc6552d42a312.1649685475.git.jani.nikula@intel.com commit 2deaf1c2561d5ec152ee2f2ce547a15b85d38b55 Author: Jani Nikula Date: Mon Apr 11 17:00:30 2022 +0300 drm/edid: abstract an EDID block read helper We have an abstraction for the EDID base block read, yet duplicating the retries and error handling for extension block reads. Introduce a more generic EDID block read helper. Switch to the helper piecemeal, starting with drm_edid_get_panel_id(), which doesn't need or have access to the connector anyway. The subtle change is switching from drm_edid_block_valid() to edid_block_check(). We also status print once, not for every attempt. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/47560f7530e4a7b32b56cb9038178244fe30a4af.1649685475.git.jani.nikula@intel.com commit 89fb7536ad2fdcdaf95eee44b9e162d0522f48dc Author: Jani Nikula Date: Mon Apr 11 17:00:29 2022 +0300 drm/edid: add typedef for block read function Make the callback a bit easier on the eye. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/10b8721bb7ea8c7df1fd0c1d97c5d446905abbf4.1649685475.git.jani.nikula@intel.com commit 63cae081538de1be12a335b267b462c533785ca9 Author: Jani Nikula Date: Mon Apr 11 17:00:28 2022 +0300 drm/edid: pass struct edid to connector_bad_edid() Avoid casting here and there, and make it const. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/4f9fdc961dfd9b36f4649e8ba57d05e43375fc92.1649685475.git.jani.nikula@intel.com commit 9c7345de9b66f66007bec39b60b04b68d7723e20 Author: Jani Nikula Date: Mon Apr 11 17:00:27 2022 +0300 drm/edid: add a helper to log dump an EDID block Unify debug log dumping. There's duplication in the error paths for EDID block validity checks, but this should be neglible. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/b56f120a26f54b0defc43faa6d49e26f072d4d8f.1649685475.git.jani.nikula@intel.com commit cee2ce1ac25d0aedaa06e81a7bc7170aafb1ea14 Author: Jani Nikula Date: Mon Apr 11 17:00:26 2022 +0300 drm/edid: refactor EDID block status printing Split out a function to log EDID block status. The printouts get changed slightly. Unfortunately, not all users will have struct drm_device available, so we convert to pr_* debug logging instead of drm device based logging. v2: Complain more loudly about unknown status codes (Ville) Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/98d12db95e55e2e18548822078ec3b16ae006732.1649685475.git.jani.nikula@intel.com commit 49dc0558f764e02ba8c13ee56c1012a6883a981b Author: Jani Nikula Date: Mon Apr 11 17:00:25 2022 +0300 drm/edid: have edid_block_check() detect blocks that are all zero We have the check function, have it also detect blocks that are all zero instead of leaving that to callers. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/f9ad302e6b7dbcd1dff98d94ec5500ce27bebe10.1649685475.git.jani.nikula@intel.com commit 8baccb27db403afa865b7f9a1452371a23d9bf45 Author: Jani Nikula Date: Mon Apr 11 17:00:24 2022 +0300 drm/edid: convert edid_is_zero() to edid_block_is_zero() for blocks As edid_is_zero() is only ever used on EDID blocks, convert it to edid_block_is_zero() with implicit block size. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/5cc9387e22b4a61243df4053d1ebcc14b0007dc8.1649685475.git.jani.nikula@intel.com commit caf968b483351d8825e68b06d77de5eb618aeb64 Merge: 9386ebccfc599 171cfae6b78c3 Author: Paolo Abeni Date: Thu Apr 14 15:08:16 2022 +0200 Merge branch 'rndis_host-handle-bogus-mac-addresses-in-zte-rndis-devices' Lech Perczak says: ==================== rndis_host: handle bogus MAC addresses in ZTE RNDIS devices When porting support of ZTE MF286R to OpenWrt [1], it was discovered, that its built-in LTE modem fails to adjust its target MAC address, when a random MAC address is assigned to the interface, due to detection of "locally-administered address" bit. This leads to dropping of ingress trafficat the host. The modem uses RNDIS as its primary interface, with some variants exposing both of them simultaneously. Then it was discovered, that cdc_ether driver contains a fixup for that exact issue, also appearing on CDC ECM interfaces. I discussed how to proceed with that with Bjørn Mork at OpenWrt forum [3], with the first approach would be to trust the locally-administered MAC again, and add a quirk for the problematic ZTE devices, as suggested by Kristian Evensen. before [4], but reusing the fixup from cdc_ether looks like a safer and more generic solution. Finally, according to Bjørn's suggestion. limit the scope of bogus MAC addressdetection to ZTE devices, the same way as it is done in cdc_ether, as this trait wasn't really observed outside of ZTE devices. Do that for both flavours of RNDIS devices, with interface classes 02/02/ff and e0/01/03, as both types are reported by different modems. [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=7ac8da00609f42b8aba74b7efc6b0d055b7cef3e [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bfe9b9d2df669a57a95d641ed46eb018e204c6ce [3] https://forum.openwrt.org/t/problem-with-modem-in-zte-mf286r/120988 [4] https://lore.kernel.org/all/CAKfDRXhDp3heiD75Lat7cr1JmY-kaJ-MS0tt7QXX=s8RFjbpUQ@mail.gmail.com/T/ Cc: Bjørn Mork Cc: Kristian Evensen Cc: Oliver Neukum v3: Fixed wrong identifier commit description and whitespace in patch 2. v2: ensure that MAC fixup is applied to all Ethernet frames in RNDIS batch, by introducing a driver flag, and integrating the fixup inside rndis_rx_fixup(). ==================== Link: https://lore.kernel.org/r/20220413014416.2306843-1-lech.perczak@gmail.com Signed-off-by: Paolo Abeni commit 171cfae6b78c3b73d8cd3d405a63e38f15f363f2 Author: Lech Perczak Date: Wed Apr 13 03:44:16 2022 +0200 rndis_host: limit scope of bogus MAC address detection to ZTE devices Reporting of bogus MAC addresses and ignoring configuration of new destination address wasn't observed outside of a range of ZTE devices, among which this seems to be the common bug. Align rndis_host driver with implementation found in cdc_ether, which also limits this workaround to ZTE devices. Suggested-by: Bjørn Mork Cc: Kristian Evensen Cc: Oliver Neukum Signed-off-by: Lech Perczak Signed-off-by: Paolo Abeni commit 36e747972d8b4c09e6e3275e31a3acba46e2c4d2 Author: Lech Perczak Date: Wed Apr 13 03:44:15 2022 +0200 rndis_host: enable the bogus MAC fixup for ZTE devices from cdc_ether Certain ZTE modems, namely: MF823. MF831, MF910, built-in modem from MF286R, expose both CDC-ECM and RNDIS network interfaces. They have a trait of ignoring the locally-administered MAC address configured on the interface both in CDC-ECM and RNDIS part, and this leads to dropping of incoming traffic by the host. However, the workaround was only present in CDC-ECM, and MF286R explicitly requires it in RNDIS mode. Re-use the workaround in rndis_host as well, to fix operation of MF286R module, some versions of which expose only the RNDIS interface. Do so by introducing new flag, RNDIS_DRIVER_DATA_DST_MAC_FIXUP, and testing for it in rndis_rx_fixup. This is required, as RNDIS uses frame batching, and all of the packets inside the batch need the fixup. This might introduce a performance penalty, because test is done for every returned Ethernet frame. Apply the workaround to both "flavors" of RNDIS interfaces, as older ZTE modems, like MF823 found in the wild, report the USB_CLASS_COMM class interfaces, while MF286R reports USB_CLASS_WIRELESS_CONTROLLER. Suggested-by: Bjørn Mork Cc: Kristian Evensen Cc: Oliver Neukum Signed-off-by: Lech Perczak Signed-off-by: Paolo Abeni commit 64b97df995f0c943be469a019d6117c89e2131bc Author: Lech Perczak Date: Wed Apr 13 03:44:14 2022 +0200 cdc_ether: export usbnet_cdc_zte_rx_fixup Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling") introduces a workaround for certain ZTE modems reporting invalid MAC addresses over CDC-ECM. The same issue was present on their RNDIS interface,which was fixed in commit a5a18bdf7453 ("rndis_host: Set valid random MAC on buggy devices"). However, internal modem of ZTE MF286R router, on its RNDIS interface, also exhibits a second issue fixed already in CDC-ECM, of the device not respecting configured random MAC address. In order to share the fixup for this with rndis_host driver, export the workaround function, which will be re-used in the following commit in rndis_host. Cc: Kristian Evensen Cc: Bjørn Mork Cc: Oliver Neukum Signed-off-by: Lech Perczak Signed-off-by: Paolo Abeni commit 203d8919a9eda5d1bc68ac3cd7637588334c9dc1 Author: Brian Gerst Date: Fri Mar 25 11:39:53 2022 -0400 x86/asm: Merge load_gs_index() Merge the 32- and 64-bit implementations of load_gs_index(). Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220325153953.162643-5-brgerst@gmail.com commit 24f378e66021f559e90f2699e66581784718b2d9 Author: Ian Rogers Date: Wed Apr 13 18:46:42 2022 -0700 perf test: Add basic perf record tests Test the --per-thread flag. Test Intel machine state capturing. Suggested-by: Namhyung Kim Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220414014642.3308206-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3a24a60854d2ef19e0edcd11cdbbb4fabc655dde Author: Brian Gerst Date: Fri Mar 25 11:39:52 2022 -0400 x86/32: Remove lazy GS macros GS is always a user segment now. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220325153953.162643-4-brgerst@gmail.com commit 9554e908fb5d02e48a681d1eca180225bf109e83 Author: Brian Gerst Date: Fri Mar 25 11:39:51 2022 -0400 ELF: Remove elf_core_copy_kernel_regs() x86-32 was the last architecture that implemented separate user and kernel registers. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Acked-by: Andy Lutomirski Acked-by: Michael Ellerman Link: https://lore.kernel.org/r/20220325153953.162643-3-brgerst@gmail.com commit 2adacd7f0a9f88891acf667ce6957437051550eb Author: James Clark Date: Wed Apr 13 09:40:21 2022 +0100 perf docs: Add man page entry for Arm SPE The SPE integration in Perf has quite a few usability quirks that can't be found by just reading the reference manual. So document this and at the same time add a summary of the feature that is also hard to find elsewhere. Reviewed-by: Leo Yan Signed-off-by: James Clark Co-authored-by: Al Grant Co-authored-by: Luke Dare Cc: Alexander Shishkin Cc: German Gomez Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220413084021.2556142-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 101826e02ac6c829bf4e768295e79ae9c37b4b2a Author: Haowen Bai Date: Thu Apr 14 18:04:17 2022 +0800 virt: sevguest: Fix bool function returning negative value The function enc_payload() is wrongly declared bool but returns an integer value. Correct it. [ bp: Massage commit message. ] Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Signed-off-by: Haowen Bai Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/1649930657-10837-1-git-send-email-baihaowen@meizu.com commit dbb5ab6d2c0a7397d77c9f60fe23844d4fe4e634 Author: Jiapeng Chong Date: Thu Apr 14 14:21:10 2022 +0800 x86/process: Fix kernel-doc warning due to a changed function name Fix the following scripts/kernel-doc warning: arch/x86/kernel/process.c:412: warning: expecting prototype for tss_update_io_bitmap(). Prototype was for native_tss_update_io_bitmap() instead. [ bp: Massage. ] Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220414062110.60343-1-jiapeng.chong@linux.alibaba.com commit e7676a00bc52b994960f89b118b0d548e4542372 Author: Mike Leach Date: Wed Apr 13 22:49:25 2022 +0100 arm64: dts: juno: add CTI entries to device tree Add Coresight Cross Trigger Interface(CTI) entries to the device tree for all the Juno variants. Link: https://lore.kernel.org/r/20220413214925.30359-1-mike.leach@linaro.org Reviewed-by: Mathieu Poirier Signed-off-by: Mike Leach Signed-off-by: Sudeep Holla commit 8dd3cdeaf3032728e30a7ec5e79ca780fc86cf7a Author: Sudeep Holla Date: Wed Apr 13 10:35:47 2022 +0100 arm64: dts: juno: Fix SCMI power domain IDs for ETF and CS funnel The SCMI power domain ID for all the coresight components is 8 while the previous/older SCPI domain was 0. When adding SCMI variant, couple of instances retained SCPI domain ID by mistake. Fix the same by using the correct SCMI power domain ID of 8. Link: https://lore.kernel.org/r/20220413093547.1699535-1-sudeep.holla@arm.com Fixes: 96bb0954860a ("arm64: dts: juno: Add separate SCMI variants") Cc: Robin Murphy Reported-by: Mike Leach Acked-by: Robin Murphy Signed-off-by: Sudeep Holla commit da0595ae91da837929a00470ab40546090e5b9ae Author: Ramalingam C Date: Tue Apr 5 20:38:40 2022 +0530 drm/i915/migrate: Evict and restore the flatccs capable lmem obj When we are swapping out the local memory obj on flat-ccs capable platform, we need to capture the ccs data too along with main meory and we need to restore it when we are swapping in the content. When lmem object is swapped into a smem obj, smem obj will have the extra pages required to hold the ccs data corresponding to the lmem main memory. So main memory of lmem will be copied into the initial pages of the smem and then ccs data corresponding to the main memory will be copied to the subsequent pages of smem. ccs data is 1/256 of lmem size. Swapin happens exactly in reverse order. First main memory of lmem is restored from the smem's initial pages and the ccs data will be restored from the subsequent pages of smem. Extracting and restoring the CCS data is done through a special cmd called XY_CTRL_SURF_COPY_BLT v2: Fixing the ccs handling v3: Handle the ccs data at same loop as main memory [Thomas] v4: changes for emit_copy_ccs v5: handle non-flat-ccs scenario Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-10-ramalingam.c@intel.com commit 76a6d563db7150103db46a02e7345218d4e9d939 Author: Ramalingam C Date: Tue Apr 5 20:38:39 2022 +0530 drm/i915/gem: Add extra pages in ttm_tt for ccs data On Xe-HP and later devices, dedicated compression control state (CCS) stored in local memory is used for each surface, to support the 3D and media compression formats. The memory required for the CCS of the entire local memory is 1/256 of the local memory size. So before the kernel boot, the required memory is reserved for the CCS data and a secure register will be programmed with the CCS base address So when an object is allocated in local memory, dont need to explicitly allocate the space for ccs data. But when the obj is evicted into the smem, to hold the compression related data along with the obj extra space is needed in smem. i.e obj_size + (obj_size/256). Hence when a smem pages are allocated for an obj with lmem placement possibility we create with the extra pages required for the ccs data for the obj size. v2: Used imperative wording [Thomas] v3: Inflate the pages only when obj's placement is lmem only v4: GEM_BUG_ON if the ttm->num_pages > obj page size [Thomas] Signed-off-by: Ramalingam C cc: Christian Koenig cc: Hellstrom Thomas Reviewed-by: Thomas Hellstrom Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-9-ramalingam.c@intel.com commit c8f8a7484673dfed227ac48a471a73eef7a67544 Author: Ramalingam C Date: Tue Apr 5 20:38:38 2022 +0530 drm/i915/selftest_migrate: Check CCS meta data clear Extend the live migrate selftest, to verify the ccs surface clearing during the Flat-CCS capable lmem obj clear. v2: Look at right places for ccs data [Thomas] Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-8-ramalingam.c@intel.com commit a785d3a8affd11d19955464f376602dd711ad309 Author: Ramalingam C Date: Tue Apr 5 20:38:37 2022 +0530 drm/i915/selftest_migrate: Consider the possible roundup of size Consider the possible round up happened at obj size alignment to min_page_size during the obj allocation. Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-7-ramalingam.c@intel.com commit 48760ffe923aeb2cc73865ea36b3509718d102e3 Author: Ramalingam C Date: Tue Apr 5 20:38:36 2022 +0530 drm/i915/gt: Clear compress metadata for Flat-ccs objects Xe-HP and latest devices support Flat CCS which reserved a portion of the device memory to store compression metadata, during the clearing of device memory buffer object we also need to clear the associated CCS buffer. XY_CTRL_SURF_COPY_BLT is a BLT cmd used for reading and writing the ccs surface of a lmem memory. So on Flat-CCS capable platform we use XY_CTRL_SURF_COPY_BLT to clear the CCS meta data. v2: Fixed issues with platform naming [Lucas] v3: Rebased [Ram] Used the round_up funcs [Bob] v4: Fixed ccs blk calculation [Ram] Added Kdoc on flat-ccs. v5: GENMASK is used [Matt] mocs fix [Matt] Comments Fix [Matt] Flush address programming [Ram] v6: FLUSH_DW is fixed Few coding style fix v7: Adopting the XY_FAST_COLOR_BLT (Thomas] v8: XY_CTRL_SURF_COPY_BLT for ccs clearing. v9: emit_copy_ccs is used. v10: ctrl_surf cmds are filled in caller itself. [Thomas] only one ctrl surf cmd is used as size of lmem is <=8M [Thomas] Signed-off-by: Ramalingam C Signed-off-by: Ayaz A Siddiqui Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-6-ramalingam.c@intel.com commit 310bf25df2fcccc1d91f96928adb66bdc26613b5 Author: Ramalingam C Date: Tue Apr 5 20:38:35 2022 +0530 drm/i915/gt: Pass the -EINVAL when emit_pte doesn't update any PTE When emit_pte doesn't update any PTE with return value as 0, interpret it as -EINVAL. v2: Add missing goto [Thomas] Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-5-ramalingam.c@intel.com commit 6e6bc8c0a81576839d1dbebbfd0a534949cb0d11 Author: Ramalingam C Date: Tue Apr 5 20:38:34 2022 +0530 drm/i915/gt: Optimize the migration and clear loop Move the static calculations out of the loops for copy and clear. v2: Fix the loss of proper error code on emit_pte Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-4-ramalingam.c@intel.com commit a0ed9c95cce69384862b567b3d23472770cf1648 Author: Ramalingam C Date: Tue Apr 5 20:38:33 2022 +0530 drm/i915/gt: Use XY_FAST_COLOR_BLT to clear obj on graphics ver 12+ Use faster XY_FAST_COLOR_BLT cmd on graphics version of 12 and more, for clearing (Zero out) the pages of the newly allocated object. XY_FAST_COLOR_BLT is faster than the older XY_COLOR_BLT. v2: Typo fix at title [Thomas] v3: XY_FAST_COLOR_BLT is used only for FLAT_CCS capable gen12+ Signed-off-by: Ramalingam C Signed-off-by: Chris Wilson Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-3-ramalingam.c@intel.com commit fd5803e5eebec174ae1d86cae2dbceebd45b7cf9 Author: Ramalingam C Date: Tue Apr 5 20:38:32 2022 +0530 drm/i915/gt: use engine instance directly for offset To make it uniform across copy and clear, use the engine offset directly to calculate the offset in the cmd forming for emit_clear. Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-2-ramalingam.c@intel.com commit 1f26a60b55aa654c73b5b9eb9eab8a7d687d429d Author: Geert Uytterhoeven Date: Wed Apr 13 15:49:21 2022 +0200 memory: renesas-rpc-if: Simplify single/double data register access For manual write and read, factor out the common access to the first data register by keeping track of the current data pointer. Signed-off-by: Geert Uytterhoeven Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/c3b2a8d1a69f1b1e8d1a460148406cfb83e52eb4.1649857740.git.geert+renesas@glider.be Signed-off-by: Krzysztof Kozlowski commit 194193dd06848c1839d928090cb2032eec8b2f9c Author: Aliya Rahmani Date: Thu Apr 14 02:16:49 2022 +0530 staging: ks7010: coding style fix: use tabs for indent Added tabs for indent to fix the checkpatch error. Signed-off-by: Aliya Rahmani Link: https://lore.kernel.org/r/20220413204648.60358-1-aliyarahmani786@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4f7224d3c557dac2c757de84eb39dd84e5c9bedb Author: Aliya Rahmani Date: Wed Apr 13 23:53:04 2022 +0530 staging: rtl8712: Remove unnecessary parentheses Remove redundant parentheses reported by checkpatch. Signed-off-by: Aliya Rahmani Link: https://lore.kernel.org/r/20220413182303.34807-1-aliyarahmani786@gmail.com Signed-off-by: Greg Kroah-Hartman commit ee25681ac9a6382cc3ca2685ebe8160dabaf681e Author: Aliya Rahmani Date: Wed Apr 13 17:05:31 2022 +0530 staging: rtl8712: cmd: remove redundant space after cast Remove the unnecessary space immediately after a cast. Identified by checkpatch: CHECK: No space is necessary after a cast. Signed-off-by: Aliya Rahmani Link: https://lore.kernel.org/r/20220413113531.31224-1-aliyarahmani786@gmail.com Signed-off-by: Greg Kroah-Hartman commit a8789783f1fca29b86c9a0188df22219de2e4ddc Author: Martin Kaiser Date: Wed Apr 13 22:07:42 2022 +0200 staging: r8188eu: pkt_newalloc is not used pkg_newalloc in struct recv_buf is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413200742.276806-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7bb528c6da7f9f8dd77867ab962e3ddd9a746c60 Author: Martin Kaiser Date: Wed Apr 13 22:07:41 2022 +0200 staging: r8188eu: use ieee80211 helpers in mgt_dispatcher Use structs and functions from ieee80211.h in mgt_dispatcher to parse the incoming frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413200742.276806-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7897aa28c0a2c295ecfd24af42d47521ff74ab88 Author: Martin Kaiser Date: Wed Apr 13 22:07:40 2022 +0200 staging: r8188eu: merge _mgt_dispatcher into mgt_dispatcher All that the _mgt_dispatcher function does is to call a function from a function pointer. It's not worth having a separate function for this. Merge _mgt_dispatcher into mgt_dispatcher. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413200742.276806-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4d76451c0fccd488029aed0cc6e9f83a017cde3c Author: Martin Kaiser Date: Wed Apr 13 22:07:39 2022 +0200 staging: r8188eu: use ieee80211 helper to read the qos tid Replace the driver-specific GetPriority macro with ieee80211_get_tid, which does exactly the same thing. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413200742.276806-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 176735b4a2123d35bea5c267bf8cc3662ea266be Author: Martin Kaiser Date: Wed Apr 13 21:36:54 2022 +0200 staging: r8188eu: remove unused timer functions rtw_get_passing_time_ms and rtw_systime_to_ms are not used any more. Remove them. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b0a347be3f46e31326fcb54eb538409d66ec74f8 Author: Martin Kaiser Date: Wed Apr 13 21:36:53 2022 +0200 staging: r8188eu: remove the bInSuspend loop Remove the loop in rtw_pwr_wakeup that waits while the system is suspended. pwrpriv->bInSuspend is set in rtw_suspend and cleared in rtw_resume. These functions are the .suspend and .resume functions of the struct usb_driver for r8188eu. A usb_driver's suspend and resume functions are called when the entire system goes into suspend or runtime suspend. All of the code paths for rtw_pwr_wakeup start at ioctl handlers. We can remove the loop that checks bInSuspend. It's not possible to call an ioctl while the entire system is suspended. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1dd0ac70494c1d04073de2dd5b51a60215f4d760 Author: Martin Kaiser Date: Wed Apr 13 21:36:52 2022 +0200 staging: r8188eu: clean up the code to set ips_deny_time Clean up the code in rtw_pwr_wakeup that sets pwrpriv->ips_deny_time. Make ips_deny_time an unsigned long, this type is used by the kernel functions that process jiffies. Remove the temporary variable ips_deffer_ms and use RTW_PWR_STATE_CHK_INTERVAL directly. There's no need to set ips_deny_time twice, it's sufficient to set it at the end of rtw_pwr_wakeup. Use time_before to check if ips_deny_time should be updated. We can now remove rtw_ms_to_systime, this function is not used any more. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3b9d0da6aa08a34426489b2836d2f63ab7bc2051 Author: Martin Kaiser Date: Wed Apr 13 21:36:51 2022 +0200 staging: r8188eu: use kernel functions for timeout handling Use the kernel functions to set a timeout and to check if it's expired. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 294e69c69c4d4a4e29dda2a0b5a5c11cf53ea7f4 Author: Martin Kaiser Date: Wed Apr 13 21:36:50 2022 +0200 staging: r8188eu: summarize two if statements Summarize two if statements in rtw_pwr_wakeup and place the constants on the right side of the comparison. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 26b9887917c3dceb9f90840e4af46ae148b74670 Author: Martin Kaiser Date: Wed Apr 13 21:36:49 2022 +0200 staging: r8188eu: simplify the ps_processing check It's sufficient to check pwrpriv->ps_processing as part of the while-loop. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a9f136fa7e67fdef97ad6c4be5f04f60ad78b5f3 Author: Martin Kaiser Date: Wed Apr 13 21:36:48 2022 +0200 staging: r8188eu: make return values consistent rtw_pwr_wakeup should return _SUCCESS or _FAIL. Replace false with _FAIL in one place and reformat the if-statement. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c5c3e3464ec36c6d91bf39a647b07e3ed9d4fe81 Author: Martin Kaiser Date: Wed Apr 13 21:36:47 2022 +0200 staging: r8188eu: simplify delay conditions in rtw_pwr_wakeup Simplify the conditions for a loop in rtw_pwr_wakeup that waits while the system is suspended. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220413193654.258507-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a7a5bc5fe8acc9381e38a34ef18f1115c5c22079 Author: Eric Biggers Date: Wed Apr 13 22:34:15 2022 -0700 fscrypt: log when starting to use inline encryption When inline encryption is used, the usual message "fscrypt: AES-256-XTS using implementation " doesn't appear in the kernel log. Add a similar message for the blk-crypto case that indicates that inline encryption was used, and whether blk-crypto-fallback was used or not. This can be useful for debugging performance problems. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220414053415.158986-1-ebiggers@kernel.org commit c54b39a565227538c52ead2349eb17d54aadd6f7 Merge: b85ffe47c4ec1 b39d2c6202426 Author: Dave Airlie Date: Thu Apr 14 12:03:08 2022 +1000 Merge tag 'drm-intel-next-2022-04-13-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull for v5.19: Features and functionality: - Add support for new Tile 4 format on DG2 (Stan) - Add support for new CCS clear color compression on DG2 (Mika, Juha-Pekka) - Add support for new render and media compression formats on DG2 (Matt) - Support multiple eDP and LVDS native mode refresh rates (Ville) - Support static DRRS (Ville) - ATS-M platform info (Matt) - RPL-S PCI IDs (Tejas) - Extend DP HDR support to HSW+ (Uma) - Bump ADL-P DMC version to v2.16 (Madhumitha) - Let users disable PSR2 while enabling PSR1 (José) Refactoring and cleanups: - Massive DRRS and panel fixed mode refactoring and cleanups (Ville) - Power well refactoring and cleanup (Imre) - Clean up and refactor crtc readout and compute config (Ville) - Use kernel string helpers (Lucas) - Refactor gmbus pin lookups and allocation (Jani) - PCH display cleanups (Ville) - DPLL and DPLL manager refactoring (Ville) - Include and header refactoring (Jani, Tvrtko) - DMC abstractions (Jani) - Non-x86 build refactoring (Casey) - VBT parsing refactoring (Ville) - Bigjoiner refactoring (Ville) - Optimize plane, pfit, scaler, etc. programming using unlocked writes (Ville) - Split several register writes in commit to noarm+arm pairs (Ville) - Clean up SAGV handling (Ville) - Clean up bandwidth and ddb allocation (Ville) - FBC cleanups (Ville) Fixes: - Fix native HDMI and DP HDMI DFP clock limits on deep color/4:2:0 (Ville) - Fix DMC firmware platform check (Lucas) - Fix cursor coordinates on bigjoiner secondary (Ville) - Fix MSO vs. bigjoiner timing confusion (Ville) - Fix ADL-P eDP voltage swing (José) - Fix VRR capability property update (Manasi) - Log DG2 SNPS PHY calibration errors (Matt, Lucas) - Fix PCODE request status checks (Stan) - Fix uncore unclaimed access warnings (Lucas) - Fix VBT new max TMDS clock parsing (Shawn) - Fix ADL-P non-existent underrun recovery (Swathi Dhanavanthri) - Fix ADL-N stepping info (Tejas) - Fix DPT mapping flags to contiguous (Stan) - Fix DG2 max display bandwidth (Vinod) - Fix DP low voltage SKU checks (Ankit) - Fix RPL-S VT-d translation enable via quirk (Tejas) - Fixes to PSR2 (José) - Fix PIPE_MBUS_DBOX_CTL programming (José) - Fix LTTPR capability read/check on DP 1.2 (Imre) - Fix ADL-P register corruption after DDI clock enabling (Imre) - Fix ADL-P MBUS DBOX BW and B credits (Caz) Merges: - Backmerge drm-next (Rodrigo, Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/874k2xgewe.fsf@intel.com commit 8feecea4de7ee1bd9712947bb85d495b1d1e438d Author: Lad Prabhakar Date: Mon Apr 11 14:43:05 2022 +0200 dt-bindings: ata: renesas,rcar-sata: Add r8a774e1 support Document SATA support for the RZ/G2H SoC, no driver change required. Signed-off-by: Lad Prabhakar Reviewed-by: Marian-Cristian Rotariu Acked-by: Rob Herring Signed-off-by: Geert Uytterhoeven Acked-by: Damien Le Moal Signed-off-by: Damien Le Moal commit 241d50ec5d79b94694adf13853c1f55d0f0b85e6 Author: Yu Zhe Date: Tue Apr 12 18:50:48 2022 -0700 bpf: Remove unnecessary type castings Remove/clean up unnecessary void * type castings. Signed-off-by: Yu Zhe Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220413015048.12319-1-yuzhe@nfschina.com commit 694ed9922bc821e7208bc6593b5eeb88f8382fd5 Author: Marek Vasut Date: Mon Apr 11 00:05:14 2022 +0200 dt-bindings: rcc: Add optional external ethernet RX clock properties Describe optional external ethernet RX clock in the DT binding to fix dtbs_check warnings like: arch/arm/boot/dts/stm32mp153c-dhcom-drc02.dt.yaml: rcc@50000000: 'assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'clocks' do not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Gabriel Fernandez Cc: Rob Herring To: devicetree@vger.kernel.org Acked-by: Gabriel Fernandez Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220410220514.21779-1-marex@denx.de commit 5d521a307526871f5613d24a8e71babf1869c486 Author: Brian Norris Date: Tue Mar 8 11:09:01 2022 -0800 PM / devfreq: rk3399_dmc: Avoid static (reused) profile This static struct can get reused if the device gets removed/reprobed, and that causes use-after-free in its ->freq_table. Let's just move the struct to our dynamic allocation. Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit cb178a9585946d5f2691d784640038edd4111cd1 Author: Brian Norris Date: Tue Mar 8 11:09:00 2022 -0800 PM / devfreq: rk3399_dmc: Use devm_pm_opp_of_add_table() This simplifies error-cleanup and remove(). Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit 2fccf9e6050e0e3b8b4cd275d41daf7f7fa22804 Author: Brian Norris Date: Tue Mar 8 11:08:59 2022 -0800 PM / devfreq: rk3399_dmc: Disable edev on remove() Otherwise we hit an unablanced enable-count when unbinding the DFI device: [ 1279.659119] ------------[ cut here ]------------ [ 1279.659179] WARNING: CPU: 2 PID: 5638 at drivers/devfreq/devfreq-event.c:360 devfreq_event_remove_edev+0x84/0x8c ... [ 1279.659352] Hardware name: Google Kevin (DT) [ 1279.659363] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO BTYPE=--) [ 1279.659371] pc : devfreq_event_remove_edev+0x84/0x8c [ 1279.659380] lr : devm_devfreq_event_release+0x1c/0x28 ... [ 1279.659571] Call trace: [ 1279.659582] devfreq_event_remove_edev+0x84/0x8c [ 1279.659590] devm_devfreq_event_release+0x1c/0x28 [ 1279.659602] release_nodes+0x1cc/0x244 [ 1279.659611] devres_release_all+0x44/0x60 [ 1279.659621] device_release_driver_internal+0x11c/0x1ac [ 1279.659629] device_driver_detach+0x20/0x2c [ 1279.659641] unbind_store+0x7c/0xb0 [ 1279.659650] drv_attr_store+0x2c/0x40 [ 1279.659663] sysfs_kf_write+0x44/0x58 [ 1279.659672] kernfs_fop_write_iter+0xf4/0x190 [ 1279.659684] vfs_write+0x2b0/0x2e4 [ 1279.659693] ksys_write+0x80/0xec [ 1279.659701] __arm64_sys_write+0x24/0x30 [ 1279.659714] el0_svc_common+0xf0/0x1d8 [ 1279.659724] do_el0_svc_compat+0x28/0x3c [ 1279.659738] el0_svc_compat+0x10/0x1c [ 1279.659746] el0_sync_compat_handler+0xa8/0xcc [ 1279.659758] el0_sync_compat+0x188/0x1c0 [ 1279.659768] ---[ end trace cec200e5094155b4 ]--- Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit fd5b8479ef7e6a6cf1cf83ed62349c11b3864f12 Author: Brian Norris Date: Tue Mar 8 11:08:56 2022 -0800 PM / devfreq: rk3399_dmc: Support new *-ns properties We want to keep the idle time fixed, so compute based on the current DDR frequency. The old properties were deprecated and never used, so we can safely drop them from the driver. This is a rewritten version of work by Lin Huang . Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit e442172191782d2488c5543b5a43f22f912ed9b5 Author: Brian Norris Date: Tue Mar 8 11:08:55 2022 -0800 PM / devfreq: rk3399_dmc: Support new disable-freq properties Implement the newly-defined properties to allow disabling certain power-saving-at-idle features at higher frequencies. This is a rewritten version of work by Lin Huang . Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit a5ca18540dab8f9477883ad9365d33a88abca958 Author: Brian Norris Date: Tue Mar 8 11:08:54 2022 -0800 PM / devfreq: rk3399_dmc: Use bitfield macro definitions for ODT_PD We're going to add new usages, and it's cleaner to work with macros instead of comments and magic numbers. Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit b82acf8215c40fcb7d29e34aab17c51df58c4f40 Author: Brian Norris Date: Tue Mar 8 11:08:53 2022 -0800 PM / devfreq: rk3399_dmc: Drop excess timing properties All of these properties are initialized by ARM Trusted Firmware, and have been since the early days of this chip. It's redundant (and possibly wrong) to do this here now. What's more, there seems to be some confusion about the units and some of the definitions of this timing struct: the DT docs say MHz for many of these, but downstream users were in Hz (and therefore, the ATF interface was Hz). Also, the in-driver usage for some of these (e.g., for comparing to target frequency) were in Hz too. So doubly wrong. We can avoid thinking about who got the right units by dropping the unnecessary code and properties. They are marked deprecated in the binding schema. Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit 5f50c52f13f12d63699feaae54ee2b1e4aee5a86 Author: Brian Norris Date: Tue Mar 8 11:08:52 2022 -0800 PM / devfreq: rk3399_dmc: Drop undocumented ondemand DT props These properties are: * undocumented * directly representing software properties, not hardware properties * unused (no in-tree users, yet; this IP block has so far only been used in downstream kernels) Let's just stick the values that downstream users have been using directly in the driver and call it a day. Signed-off-by: Brian Norris Signed-off-by: Chanwoo Choi commit a86fb6a9a21d20aa643448d742da4eec065091f7 Author: Brian Norris Date: Tue Mar 8 11:08:51 2022 -0800 dt-bindings: devfreq: rk3399_dmc: Add more disable-freq properties DDR DVFS tuning has found that several power-saving features don't have good tradeoffs at higher frequencies -- at higher frequencies, we'll see glitches or other errors. Provide tuning controls so these can be disabled at higher OPPs, and left active only at the lower ones. Signed-off-by: Brian Norris Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 77c188085b466434b2180ffe917a60ed442c8739 Author: Brian Norris Date: Tue Mar 8 11:08:50 2022 -0800 dt-bindings: devfreq: rk3399_dmc: Specify idle params in nanoseconds It's inefficient to use the same number of cycles for all OPPs, since lower frequencies make for longer idle times. Let's specify the idle time instead, so software can pick the optimal number of cycles on its own. NB: these bindings aren't used anywhere yet. Signed-off-by: Brian Norris Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 4de8fd02a55f2b00fe952cdfb2757968827f3c0e Author: Brian Norris Date: Tue Mar 8 11:08:49 2022 -0800 dt-bindings: devfreq: rk3399_dmc: Fix Hz units The driver and all downstream device trees [1] are using Hz units, but the document claims MHz. DRAM frequency for these systems can't possibly exceed 2^32-1 Hz, so the choice of unit doesn't really matter than much. Rather than add unnecessary risk in getting the units wrong, let's just go with the unofficial convention and make the docs match reality. A sub-1MHz frequency is extremely unlikely, so include a minimum in the schema, to help catch anybody who might have believed this was MHz. [1] And notably, also those trying to upstream them: https://lore.kernel.org/lkml/20210308233858.24741-3-daniel.lezcano@linaro.org/ Signed-off-by: Brian Norris Reviewed-by: Rob Herring Acked-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 76d136b56fc13d12f9b0d68b9a626dfaf8e2b7ae Author: Brian Norris Date: Tue Mar 8 11:08:48 2022 -0800 dt-bindings: devfreq: rk3399_dmc: Deprecate unused/redundant properties These DRAM configuration properties are all handled in ARM Trusted Firmware (and have been since the early days of this SoC), and there are no in-tree users of the DMC binding yet. It's better to just defer to firmware instead of maintaining this large list of properties. There's also some confusion about units: many of these are specified in MHz, but the downstream users and driver code are treating them as Hz, I believe. Rather than straighten all that out, I just drop them. Signed-off-by: Brian Norris Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 2142c27ef06bf8f9c0bd784395ea5aa1924cad49 Author: Brian Norris Date: Tue Mar 8 11:08:47 2022 -0800 dt-bindings: devfreq: rk3399_dmc: Convert to YAML I want to add, deprecate, and bugfix some properties, as well as add the first users. This is easier with a proper schema. The transformation is mostly straightforward, plus a few notable tweaks: * Renamed rockchip,dram_speed_bin to rockchip,ddr3_speed_bin. The driver code and the example matched, but the description was different. I went with the implementation. Note that this property is also slated for deprecation/deletion in the subsequent patches. * Drop upthreshold and downdifferential properties from the example. These were undocumented (so, wouldn't pass validation), but were representing software properties (governor tweaks). I drop them from the driver in subsequent patches. * Rename clock from pclk_ddr_mon to dmc_clk. The driver, DT example, and all downstream users matched -- the binding definition was the exception. Anyway, "dmc_clk" is a more appropriately generic name. * Choose a better filename and location (this is a memory controller). Signed-off-by: Brian Norris Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Chanwoo Choi commit 63cec1389e116ae0e2a15e612a5b49651e04be3f Author: Eric Biggers Date: Mon Apr 4 18:09:14 2022 -0700 fscrypt: split up FS_CRYPTO_BLOCK_SIZE FS_CRYPTO_BLOCK_SIZE is neither the filesystem block size nor the granularity of encryption. Rather, it defines two logically separate constraints that both arise from the block size of the AES cipher: - The alignment required for the lengths of file contents blocks - The minimum input/output length for the filenames encryption modes Since there are way too many things called the "block size", and the connection with the AES block size is not easily understood, split FS_CRYPTO_BLOCK_SIZE into two constants FSCRYPT_CONTENTS_ALIGNMENT and FSCRYPT_FNAME_MIN_MSG_LEN that more clearly describe what they are. Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20220405010914.18519-1-ebiggers@kernel.org commit 376eb490c7811b026ebfed32280688620dd1c0ca Author: Drew Fustini Date: Sat Apr 9 14:12:14 2022 -0700 dt-bindings: wkup-m3-ipc: Add vtt toggle gpio pin property Document Wakeup M3 IPC property that indicates a GPIO pin is connected to the enable pin on DDR VTT regulator and can be toggled during low power mode transitions. Signed-off-by: Dave Gerlach [dfustini: converted to YAML, removed unnecessary "ti,needs-vtt-toggle"] Signed-off-by: Drew Fustini Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220409211215.2529387-2-dfustini@baylibre.com commit 9d79799193b728b62c9899d931b5009da1f89b67 Author: Daniel Vetter Date: Wed Apr 13 10:21:28 2022 +0200 fbcon: Fix delayed takeover locking I messed up the delayed takover path in the locking conversion in 6e7da3af008b ("fbcon: Move console_lock for register/unlink/unregister"). If CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is enabled, fbcon take-over doesn't take place when calling fbcon_fb_registered(). Instead, is deferred using a workqueue and its fbcon_register_existing_fbs() function calls to fbcon_fb_registered() again for each registered fbcon fb. This leads to the console_lock tried to be held twice, causing a deadlock. Fix it by re-extracting the lockless function and using it in the delayed takeover path, where we need to hold the lock already to iterate over the list of already registered fb. Well the current code still is broken in there (since the list is protected by a registration_lock, which we can't take here because it nests the other way round with console_lock), but in the future this will be a list protected by console_lock when this is all sorted out. While reviewing the broken commit I realized that I've left some outdated comments about the locking behind. Fix those too. v2: Improve commit message (Javier) Reported-by: Nathan Chancellor Tested-by: Nathan Chancellor Reviewed-by: Javier Martinez Canillas Cc: Nathan Chancellor Fixes: 6e7da3af008b ("fbcon: Move console_lock for register/unlink/unregister") Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: Du Cheng Cc: Claudio Suarez Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Matthew Wilcox Cc: Zheyu Ma Cc: Guenter Roeck Cc: Helge Deller Cc: Geert Uytterhoeven Cc: Javier Martinez Canillas Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220413082128.348186-1-daniel.vetter@ffwll.ch commit 68477ede4354858c77d230d31472cfc257931ed4 Merge: 0f8619929c572 2900005ea287b Author: Daniel Borkmann Date: Wed Apr 13 21:37:57 2022 +0200 Merge branch 'pr/bpf-sysctl' into bpf-next Pull the migration of the BPF sysctl handling into BPF core. This work is needed in both sysctl-next and bpf-next tree. Signed-off-by: Daniel Borkmann Cc: Luis Chamberlain Link: https://lore.kernel.org/bpf/b615bd44-6bd1-a958-7e3f-dd2ff58931a1@iogearbox.net commit 383189718496c1fe163f378526f9b86dc7f0cf77 Merge: 8e4e83b2278bd 2900005ea287b Author: Luis Chamberlain Date: Wed Apr 13 12:44:35 2022 -0700 Merge remote-tracking branch 'bpf-next/pr/bpf-sysctl' into sysctl-next Signed-off-by: Luis Chamberlain commit 2900005ea287b11dcc8c1b9fcf24893b7ff41d6d Author: Yan Zhu Date: Thu Apr 7 15:07:59 2022 +0800 bpf: Move BPF sysctls from kernel/sysctl.c to BPF core We're moving sysctls out of kernel/sysctl.c as it is a mess. We already moved all filesystem sysctls out. And with time the goal is to move all sysctls out to their own subsystem/actual user. kernel/sysctl.c has grown to an insane mess and its easy to run into conflicts with it. The effort to move them out into various subsystems is part of this. Signed-off-by: Yan Zhu Signed-off-by: Daniel Borkmann Cc: Luis Chamberlain Link: https://lore.kernel.org/bpf/20220407070759.29506-1-zhuyan34@huawei.com commit 75d8cce128c516fe6cf4b8683e8fe1a59e919902 Author: Sebastian Andrzej Siewior Date: Sun Apr 10 14:49:36 2022 +0200 lib/irq_poll: Prevent softirq pending leak in irq_poll_cpu_dead() irq_poll_cpu_dead() pulls the blk_cpu_iopoll backlog from the dead CPU and raises the POLL softirq with __raise_softirq_irqoff() on the CPU it is running on. That just sets the bit in the pending softirq mask. This means the handling of the softirq is delayed until the next interrupt or a local_bh_disable/enable() pair. As a consequence the CPU on which this code runs can reach idle with the POLL softirq pending, which triggers a warning in the NOHZ idle code. Add a local_bh_disable/enable() pair around the interrupts disabled section in irq_poll_cpu_dead(). local_bh_enable will handle the pending softirq. [tglx: Massaged changelog and comment] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/87k0bxgl27.ffs@tglx commit d308077e5e4dc8c93f97f5ebc70274e7c7a92d49 Author: Steven Price Date: Mon Apr 11 16:22:33 2022 +0100 cpu/hotplug: Initialise all cpuhp_cpu_state structs earlier Rather than waiting until a CPU is first brought online, do the initialisation of the cpuhp_cpu_state structure for each CPU during the __init phase. This saves a (small) amount of non-__init memory and avoids potential confusion about when the cpuhp_cpu_state struct is valid. Suggested-by: Thomas Gleixner Signed-off-by: Steven Price Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220411152233.474129-3-steven.price@arm.com commit 3927368bebe2e7af4ae18bdd77e02aa0d2629411 Merge: c7dfb2591b238 b7ba6d8dc3569 Author: Thomas Gleixner Date: Wed Apr 13 21:27:00 2022 +0200 Merge branch 'smp/urgent' into smp/core Pick up the hotplug fix for dependent changes. commit e6f3b3c9c109ed57230996cf4a4c1b8ae7e36a81 Author: Sami Tolvanen Date: Tue Apr 5 15:16:18 2022 -0700 cfi: Use __builtin_function_start Clang 14 added support for the __builtin_function_start function, which allows us to implement the function_nocfi macro without architecture-specific inline assembly and in a way that also works with static initializers. Change CONFIG_CFI_CLANG to depend on Clang >= 14, define function_nocfi using __builtin_function_start, and remove the arm64 inline assembly implementation. Link: https://github.com/llvm/llvm-project/commit/ec2e26eaf63558934f5b73a6e530edc453cf9508 Link: https://github.com/ClangBuiltLinux/linux/issues/1353 Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Reviewed-by: Mark Rutland Tested-by: Mark Rutland Acked-by: Will Deacon # arm64 Reviewed-by: Nathan Chancellor Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220405221618.633743-1-samitolvanen@google.com commit 75c1182e18f4a66bbd2c91511b6b629dac6a27dc Author: Bill Wendling Date: Thu Apr 7 10:59:30 2022 -0700 security: don't treat structure as an array of struct hlist_head The initialization of "security_hook_heads" is done by casting it to another structure pointer type, and treating it as an array of "struct hlist_head" objects. This requires an exception be made in "randstruct", because otherwise it will emit an error, reducing the effectiveness of the hardening technique. Instead of using a cast, initialize the individual struct hlist_head elements in security_hook_heads explicitly. This removes the need for the cast and randstruct exception. Signed-off-by: Bill Wendling Cc: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220407175930.471870-1-morbo@google.com commit 1109a5d907015005cdbe9eaa4fec40213e2f9010 Author: Matthew Wilcox (Oracle) Date: Mon Jan 10 23:15:30 2022 +0000 usercopy: Remove HARDENED_USERCOPY_PAGESPAN There isn't enough information to make this a useful check any more; the useful parts of it were moved in earlier patches, so remove this set of checks now. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Kees Cook Reviewed-by: David Hildenbrand Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220110231530.665970-5-willy@infradead.org commit ab502103ae3ce4c0fc393e598455efede3e523c9 Author: Matthew Wilcox (Oracle) Date: Mon Jan 10 23:15:29 2022 +0000 mm/usercopy: Detect large folio overruns Move the compound page overrun detection out of CONFIG_HARDENED_USERCOPY_PAGESPAN and convert it to use folios so it's enabled for more people. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Kees Cook Reviewed-by: David Hildenbrand Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220110231530.665970-4-willy@infradead.org commit 0aef499f3172a60222ae7460d61b364c134d6e1a Author: Matthew Wilcox (Oracle) Date: Mon Jan 10 23:15:28 2022 +0000 mm/usercopy: Detect vmalloc overruns If you have a vmalloc() allocation, or an address from calling vmap(), you cannot overrun the vm_area which describes it, regardless of the size of the underlying allocation. This probably doesn't do much for security because vmalloc comes with guard pages these days, but it prevents usercopy aborts when copying to a vmap() of smaller pages. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220110231530.665970-3-willy@infradead.org commit 4e140f59d285c1ca1e5c81b4c13e27366865bd09 Author: Matthew Wilcox (Oracle) Date: Mon Jan 10 23:15:27 2022 +0000 mm/usercopy: Check kmap addresses properly If you are copying to an address in the kmap region, you may not copy across a page boundary, no matter what the size of the underlying allocation. You can't kmap() a slab page because slab pages always come from low memory. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220110231530.665970-2-willy@infradead.org commit fee6de80bdd3df976a43f3092a165cb43c072f20 Author: Marek Vasut Date: Thu Apr 7 12:30:16 2022 +0200 dt-bindings: nvmem: snvs-lpgpr: Add i.MX8M compatible strings Add compatible strings for i.MX8M(Q), i.MX8M Mini, i.MX8M Nano, i.MX8M Plus. All these SoCs have the SNVS LPGPR registers and they are at the same offset as on i.MX7D. Signed-off-by: Marek Vasut Cc: Anson Huang Cc: Fabio Estevam Cc: Oleksij Rempel Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: NXP Linux Team Cc: devicetree@vger.kernel.org To: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407103016.16543-1-marex@denx.de commit 3a506ca2cc042bb16d563078e10ef9493588e545 Author: Jeff Brasen Date: Fri Mar 11 16:53:10 2022 +0000 ACPI: SPCR: Add support for NVIDIA 16550-compatible port subtype Add support for the NVIDIA specific 16550 subtype to SPCR table parsing routine. Signed-off-by: Jeff Brasen Signed-off-by: Jon Hunter Signed-off-by: Rafael J. Wysocki commit e802ca757b29ef98d9e155dec686a2ec8f832b65 Author: Andy Shevchenko Date: Wed Apr 13 14:59:12 2022 +0300 ACPI: docs: enumeration: Unify Package () for properties (part 2) Unify Package () representation for properties: - make them one line where it's possible - add spaces between parentheses and curly braces - drop the explicit size of package Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit a090931524d03a4975c84b89a32210420d852313 Author: Liu Xinpeng Date: Tue Apr 12 11:05:19 2022 +0800 ACPI: APEI: Fix missing ERST record id Read a record is cleared by others, but the deleted record cache entry is still created by erst_get_record_id_next. When next enumerate the records, get the cached deleted record, then erst_read() return -ENOENT and try to get next record, loop back to first ID will return 0 in function __erst_record_id_cache_add_one and then set record_id as APEI_ERST_INVALID_RECORD_ID, finished this time read operation. It will result in read the records just in the cache hereafter. This patch cleared the deleted record cache, fix the issue that "./erst-inject -p" shows record counts not equal to "./erst-inject -n". A reproducer of the problem(retry many times): [root@localhost erst-inject]# ./erst-inject -c 0xaaaaa00011 [root@localhost erst-inject]# ./erst-inject -p rc: 273 rcd sig: CPER rcd id: 0xaaaaa00012 rc: 273 rcd sig: CPER rcd id: 0xaaaaa00013 rc: 273 rcd sig: CPER rcd id: 0xaaaaa00014 [root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000006 [root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000007 [root@localhost erst-inject]# ./erst-inject -i 0xaaaaa000008 [root@localhost erst-inject]# ./erst-inject -p rc: 273 rcd sig: CPER rcd id: 0xaaaaa00012 rc: 273 rcd sig: CPER rcd id: 0xaaaaa00013 rc: 273 rcd sig: CPER rcd id: 0xaaaaa00014 [root@localhost erst-inject]# ./erst-inject -n total error record count: 6 Signed-off-by: Liu Xinpeng Reviewed-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit 0076ca940e3f1a1eae6b5e39b6594c96934713a2 Author: Bob Moore Date: Mon Apr 11 21:04:03 2022 +0200 ACPICA: Update version to 20220331 ACPICA commit ada5b805eaa7480930082af9bc3d689c6f181329 Version 20220331. Link: https://github.com/acpica/acpica/commit/ada5b805 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit bf285d25406ed44d1711d59155a658032d31a11c Author: Bob Moore Date: Mon Apr 11 21:03:16 2022 +0200 ACPICA: exsystem.c: Use ACPI_FORMAT_UINT64 for 64-bit output ACPICA commit 82a46ba57fe03ae99342740b92a04d8a8184860d %llu fails on 32-bit compilers. Link: https://github.com/acpica/acpica/commit/82a46ba5 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 4fd147530edd44439a099dda6b22f1a390f306ab Author: Shameer Kolothum Date: Mon Apr 11 21:02:33 2022 +0200 ACPICA: IORT: Updates for revision E.d ACPICA commit 87a2e39b8abdfedfb86b0a105708e37e895becd9 IORT revision is now updated to E.d (ARM DEN 0049E.d) and contains a few additions like, -Added descriptor in the root complex node for specifying PASID width supported by the root complex. -Updated RMR node Flags field. -Introduced memory access attributes in the RMR node. Please note that IORT Rev E.c is deprecated and not supported. Link: https://github.com/acpica/acpica/commit/87a2e39b Signed-off-by: Shameer Kolothum Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 3d6c6552f1c1b174e1bc27102f55942ec94f144d Author: Selvarasu Ganesan Date: Mon Apr 11 21:01:36 2022 +0200 ACPICA: executer/exsystem: Fix some typo mistakes ACPICA commit 441747f1dcff770d692acbfd4d85b2cfaabdb38a Link: https://github.com/acpica/acpica/commit/441747f1 Signed-off-by: Selvarasu Ganesan Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit da6a9bbedc79c49ba94a6ca746580a9b43931641 Author: Bob Moore Date: Mon Apr 11 21:00:45 2022 +0200 ACPICA: iASL/MADT: Add OEM-defined subtable ACPICA commit 4450b89b596a2b54b0cdfe2357b49a63445c2e03 Adds support for the "reserved for OEM use" subtable (types 0x80 to 0xFF). Link: https://github.com/acpica/acpica/commit/4450b89b Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 6eaf08770ee8562ea497c8b3f1c0079832953e20 Author: Paul Menzel Date: Mon Apr 11 20:59:51 2022 +0200 ACPICA: executer/exsystem: Warn about sleeps greater than 10 ms ACPICA commit 2a0d1d475e7ea1c815bee1e0692d81db9a7c909c Quick boottime is important, so warn about sleeps greater than 10 ms. Distribution Linux kernels reach initrd in 350 ms, so excessive delays should be called out. 10 ms is chosen randomly, but three of such delays would already make up ten percent of the boottime. Link: https://github.com/acpica/acpica/commit/2a0d1d47 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Reported-by: kernel test robot commit ace8f1c54a02b96036b50defa9d842c10292b6bb Author: Paul Menzel Date: Mon Apr 11 20:59:00 2022 +0200 ACPICA: executer/exsystem: Inform users about ACPI spec violation ACPICA commit 05ba545ce7859392250b18c10081db25c90ed8d7 Values greater than 100 microseconds violate the ACPI specification, so warn users about it. From ACPI Specification version 6.2 Errata A, 19.6.128 *Stall (Stall for a Short Time)*: > The implementation of Stall is OS-specific, but must not relinquish > control of the processor. Because of this, delays longer than 100 > microseconds must use Sleep instead of Stall. Link: https://github.com/acpica/acpica/commit/05ba545c Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Reported-by: kernel test robot commit 1c5d62f5dd979dbe7f4b16a5bd3c64fbecb7d92a Author: Besar Wicaksono Date: Mon Apr 11 20:58:04 2022 +0200 ACPICA: Add support for ARM Performance Monitoring Unit Table. ACPICA commit 002165ecc0a3dc703bb24c789aaa02fdada01675 The specification of this table is described in "ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document" ARM DEN0117. This patch adds the necessary types and support for compiling/disassembling APMT. Link: https://github.com/acpica/acpica/commit/002165ec Signed-off-by: Besar Wicaksono Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 1838ffe7001bf37e3e31796c7b04e5e083df886e Author: Paul Menzel Date: Mon Apr 11 20:57:02 2022 +0200 ACPICA: executer/exsystem: Add units to time variable names ACPICA commit b69cbef7a83eadb102a1ff6c6f6fc5abce34805a `how_long` refers to different units in both functions, so make it more clear, what unit they expect. That also makes one comment superfluous. Link: https://github.com/acpica/acpica/commit/b69cbef7 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit aa29b2083e11722a0ceedfa2a87de74cc7cfa676 Author: Gustavo A. R. Silva Date: Mon Apr 11 20:56:15 2022 +0200 ACPICA: Headers: Replace zero-length array with flexible-array member ACPICA commit 98835f452c698b015d4da999944405ecb90da670 There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/acpica/acpica/commit/98835f45 Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 45882a817d4bae5a3b63c3861cb62b9b9a025de5 Author: Bob Moore Date: Mon Apr 11 20:55:10 2022 +0200 ACPICA: Removed some tabs and // comments ACPICA commit 0914618b553d6f3366e568409cebf2656891ca69 Automated cleanup; No functional changes. Link: https://github.com/acpica/acpica/commit/0914618b Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 487ea80a2848b7147eede3b73a4ee160c150f567 Author: Bob Moore Date: Mon Apr 11 20:54:22 2022 +0200 ACPICA: Update copyright notices to the year 2022 ACPICA commit 738d7b0726e6c0458ef93c0a01c0377490888d1e Affects all source modules and utility signons. Link: https://github.com/acpica/acpica/commit/738d7b07 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 1cf0cee1da04548be15f24b67889cf6be8306f86 Author: Tom Rix Date: Mon Apr 11 20:53:22 2022 +0200 ACPICA: Clean up double word in comment ACPICA commit 01f43b049722fa7613fca3c9fa657b150fae8ac1 Remove the second 'know' and 'than'. Link: https://github.com/acpica/acpica/commit/01f43b04 Signed-off-by: Tom Rix Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit e468e39f7cabce2095a2f19dadbfdbf3c21f18f1 Author: Bob Moore Date: Mon Apr 11 20:52:26 2022 +0200 ACPICA: Add new ACPI 6.4 semantics for LoadTable() operator ACPICA commit b32dde35e26a63a85d78d4dc0a7260b61e626ac1 DDB_HANDLE is gone, now LoadTable() returns a pass/fail integer. Link: https://github.com/acpica/acpica/commit/b32dde35 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 39ea1bbf270a617c81369f2867ca14b8eac331bd Author: Bob Moore Date: Mon Apr 11 20:51:27 2022 +0200 ACPICA: Add new ACPI 6.4 semantics to the Load() operator ACPICA commit 84bf573ab7222c4e1c22167b22d29c4da1552b20 DDB_HANDLE is gone, now Load() returns a pass/fail integer, as well as storing it in an optional 2nd argument. Link: https://github.com/acpica/acpica/commit/84bf573a Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 8bd24835db1781685f9abd0d1b628eaaac20d7c1 Author: Piotr Maziarz Date: Mon Apr 11 20:50:25 2022 +0200 ACPICA: iASL: NHLT: Rename linux specific strucures to device_info ACPICA commit 68c7e542075319d57129467872fcbe98906f2b2c Those structures aren't used by Linux drivers, and in other NHLT related tools they are called device_info. Link: https://github.com/acpica/acpica/commit/68c7e542 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit ab1ba87bd71a507286781b8a7f5c64e1eb7a2d34 Author: Piotr Maziarz Date: Mon Apr 11 20:49:08 2022 +0200 ACPICA: iASL: NHLT: Fix parsing undocumented bytes at the end of Endpoint Descriptor ACPICA commit 961221a76814ffa0ecc92219ddf857579b0f7d54 Undocumented bytes at the end of Endpoint Descriptor can be present independently of Linux-specific structures. Their size can also vary. Link: https://github.com/acpica/acpica/commit/961221a7 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 90037551c68d08facd6fb56a971352a9cd189c44 Author: Piotr Maziarz Date: Mon Apr 11 20:48:21 2022 +0200 ACPICA: iASL: NHLT: Treat Terminator as specific_config ACPICA commit 23a659e190cf3ed0edd46cddf12bbbcfeaa09396 specific_config has 4 bytes of size and then an amount of bytes specified by size. All of the terminators that I've seen had a size equal to 4, but theoretically it can vary. Link: https://github.com/acpica/acpica/commit/23a659e1 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit a95d2fb08538f29f6e9f54a803dffc303b5263cd Author: Lawrence Hileman Date: Mon Apr 11 20:47:40 2022 +0200 ACPICA: Add the subtable CFMWS to the CEDT table ACPICA commit 19b11f91660b1a38a8e9655b0b1a4ad51ec4db1e Link: https://github.com/acpica/acpica/commit/19b11f91 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 62b32fd961cf2d8b2c9fdcd8d58abeb184bb439b Author: Mario Limonciello Date: Mon Apr 11 20:47:00 2022 +0200 ACPICA: Add support for the Windows 11 _OSI string ACPICA commit f2e9fb8345b9146a67f8c63474b65ccfc06d962a See https://github.com/microsoft_docs/windows-driver-docs/commit/a061e31fd77c20cc8e6eb0234e5d3a83e417f48 Link: https://github.com/acpica/acpica/commit/f2e9fb83 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 022fe6bc8f3bd0f2b1f9bc778bacc38020dfd420 Author: Andy Shevchenko Date: Fri Apr 8 21:48:42 2022 +0300 device property: Drop 'test' prefix in parameters of fwnode_is_ancestor_of() The part 'is' in the function name implies the test against something. Drop unnecessary 'test' prefix in the fwnode_is_ancestor_of() parameters. No functional change intended. Signed-off-by: Andy Shevchenko Reviewed-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 87ffea09470d94c93dd6a5a22d4b2216b395d1ea Author: Andy Shevchenko Date: Fri Apr 8 21:48:41 2022 +0300 device property: Introduce fwnode_for_each_parent_node() In a few cases the functionality of fwnode_for_each_parent_node() is already in use. Introduce a common helper macro for it. It may be used by others as well in the future. Signed-off-by: Andy Shevchenko Reviewed-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 002752af7b89b74c64fe6bec8c5fde3d3a7810d8 Author: Andy Shevchenko Date: Fri Apr 8 21:48:40 2022 +0300 device property: Allow error pointer to be passed to fwnode APIs Some of the fwnode APIs might return an error pointer instead of NULL or valid fwnode handle. The result of such API call may be considered optional and hence the test for it is usually done in a form of fwnode = fwnode_find_reference(...); if (IS_ERR(fwnode)) ...error handling... Nevertheless the resulting fwnode may have bumped the reference count and hence caller of the above API is obliged to call fwnode_handle_put(). Since fwnode may be not valid either as NULL or error pointer the check has to be performed there. This approach uglifies the code and adds a point of making a mistake, i.e. forgetting about error point case. To prevent this, allow an error pointer to be passed to the fwnode APIs. Fixes: 83b34afb6b79 ("device property: Introduce fwnode_find_reference()") Reported-by: Nuno Sá Tested-by: Nuno Sá Acked-by: Nuno Sá Reviewed-by: Sakari Ailus Reviewed-by: Heikki Krogerus Signed-off-by: Andy Shevchenko Tested-by: Michael Walle Signed-off-by: Rafael J. Wysocki commit 79a43db93399cfc7825a908a03320677c52ef919 Author: Daniel Baluta Date: Thu Mar 31 13:32:37 2022 +0300 remoteproc: imx_dsp_rproc: Make rsc_table optional There are cases when we want to test a simple "hello world" app on the DSP and we do not need a resource table. remoteproc core allows us having an optional rsc_table. Signed-off-by: Daniel Baluta Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220331103237.340796-1-daniel.baluta@oss.nxp.com Signed-off-by: Mathieu Poirier commit 1bbc21785b7336619fb6a67f1fff5afdaf229acc Author: Lorenzo Pieralisi Date: Thu Apr 7 11:51:20 2022 +0100 ACPI: sysfs: Fix BERT error region memory mapping Currently the sysfs interface maps the BERT error region as "memory" (through acpi_os_map_memory()) in order to copy the error records into memory buffers through memory operations (eg memory_read_from_buffer()). The OS system cannot detect whether the BERT error region is part of system RAM or it is "device memory" (eg BMC memory) and therefore it cannot detect which memory attributes the bus to memory support (and corresponding kernel mapping, unless firmware provides the required information). The acpi_os_map_memory() arch backend implementation determines the mapping attributes. On arm64, if the BERT error region is not present in the EFI memory map, the error region is mapped as device-nGnRnE; this triggers alignment faults since memcpy unaligned accesses are not allowed in device-nGnRnE regions. The ACPI sysfs code cannot therefore map by default the BERT error region with memory semantics but should use a safer default. Change the sysfs code to map the BERT error region as MMIO (through acpi_os_map_iomem()) and use the memcpy_fromio() interface to read the error region into the kernel buffer. Link: https://lore.kernel.org/linux-arm-kernel/31ffe8fc-f5ee-2858-26c5-0fd8bdd68702@arm.com Link: https://lore.kernel.org/linux-acpi/CAJZ5v0g+OVbhuUUDrLUCfX_mVqY_e8ubgLTU98=jfjTeb4t+Pw@mail.gmail.com Signed-off-by: Lorenzo Pieralisi Tested-by: Veronika Kabatova Tested-by: Aristeu Rozanski Acked-by: Ard Biesheuvel Signed-off-by: Rafael J. Wysocki commit 3bd561e1572ee02a50cd1a5be339abf1a5b78d56 Author: Sakari Ailus Date: Wed Apr 6 16:12:08 2022 +0300 ACPI: property: Release subnode properties with data nodes struct acpi_device_properties describes one source of properties present on either struct acpi_device or struct acpi_data_node. When properties are parsed, both are populated but when released, only those properties that are associated with the device node are freed. Fix this by also releasing memory of the data node properties. Fixes: 5f5e4890d57a ("ACPI / property: Allow multiple property compatible _DSD entries") Cc: 4.20+ # 4.20+ Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit b57a7c9dd732ca29c4400a9a710c56c55877086d Author: Eric DeVolder Date: Wed Apr 13 12:42:30 2022 -0400 x86/crash: Fix minor typo/bug in debug message The pr_debug() intends to display the memsz member, but the parameter is actually the bufsz member (which is already displayed). Correct this to display memsz value. Signed-off-by: Eric DeVolder Signed-off-by: Borislav Petkov Acked-by: Baoquan He Link: https://lore.kernel.org/r/20220413164237.20845-2-eric.devolder@oracle.com commit 5d6c7de6446e9ab3fb41d6f7d82770e50998f3de Author: Sean Christopherson Date: Wed Feb 2 00:49:45 2022 +0000 KVM: x86: Bail to userspace if emulation of atomic user access faults Exit to userspace when emulating an atomic guest access if the CMPXCHG on the userspace address faults. Emulating the access as a write and thus likely treating it as emulated MMIO is wrong, as KVM has already confirmed there is a valid, writable memslot. Signed-off-by: Sean Christopherson Message-Id: <20220202004945.2540433-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1c2361f667f3648855ceae25f1332c18413fdb9f Author: Sean Christopherson Date: Wed Feb 2 00:49:44 2022 +0000 KVM: x86: Use __try_cmpxchg_user() to emulate atomic accesses Use the recently introduce __try_cmpxchg_user() to emulate atomic guest accesses via the associated userspace address instead of mapping the backing pfn into kernel address space. Using kvm_vcpu_map() is unsafe as it does not coordinate with KVM's mmu_notifier to ensure the hva=>pfn translation isn't changed/unmapped in the memremap() path, i.e. when there's no struct page and thus no elevated refcount. Fixes: 42e35f8072c3 ("KVM/X86: Use kvm_vcpu_map in emulator_cmpxchg_emulated") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220202004945.2540433-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f122dfe4476890d60b8c679128cd2259ec96a24c Author: Sean Christopherson Date: Wed Feb 2 00:49:43 2022 +0000 KVM: x86: Use __try_cmpxchg_user() to update guest PTE A/D bits Use the recently introduced __try_cmpxchg_user() to update guest PTE A/D bits instead of mapping the PTE into kernel address space. The VM_PFNMAP path is broken as it assumes that vm_pgoff is the base pfn of the mapped VMA range, which is conceptually wrong as vm_pgoff is the offset relative to the file and has nothing to do with the pfn. The horrific hack worked for the original use case (backing guest memory with /dev/mem), but leads to accessing "random" pfns for pretty much any other VM_PFNMAP case. Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs") Debugged-by: Tadeusz Struk Tested-by: Tadeusz Struk Reported-by: syzbot+6cde2282daa792c49ab8@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220202004945.2540433-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 989b5db215a2f22f89d730b607b071d964780f10 Author: Peter Zijlstra Date: Wed Feb 2 00:49:42 2022 +0000 x86/uaccess: Implement macros for CMPXCHG on user addresses Add support for CMPXCHG loops on userspace addresses. Provide both an "unsafe" version for tight loops that do their own uaccess begin/end, as well as a "safe" version for use cases where the CMPXCHG is not buried in a loop, e.g. KVM will resume the guest instead of looping when emulation of a guest atomic accesses fails the CMPXCHG. Provide 8-byte versions for 32-bit kernels so that KVM can do CMPXCHG on guest PAE PTEs, which are accessed via userspace addresses. Guard the asm_volatile_goto() variation with CC_HAS_ASM_GOTO_TIED_OUTPUT, the "+m" constraint fails on some compilers that otherwise support CC_HAS_ASM_GOTO_OUTPUT. Cc: stable@vger.kernel.org Signed-off-by: Peter Zijlstra (Intel) Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Message-Id: <20220202004945.2540433-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1aa0e8b144b6474c4914439d232d15bfe883636b Author: Sean Christopherson Date: Wed Feb 2 00:49:41 2022 +0000 Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug Add a config option to guard (future) usage of asm_volatile_goto() that includes "tied outputs", i.e. "+" constraints that specify both an input and output parameter. clang-13 has a bug[1] that causes compilation of such inline asm to fail, and KVM wants to use a "+m" constraint to implement a uaccess form of CMPXCHG[2]. E.g. the test code fails with :1:29: error: invalid operand in inline asm: '.long (${1:l}) - .' int foo(int *x) { asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); return *x; bar: return 0; } ^ :1:29: error: unknown token in expression :1:9: note: instantiated into assembly here .long () - . ^ 2 errors generated. on clang-13, but passes on gcc (with appropriate asm goto support). The bug is fixed in clang-14, but won't be backported to clang-13 as the changes are too invasive/risky. gcc also had a similar bug[3], fixed in gcc-11, where gcc failed to account for its behavior of assigning two numbers to tied outputs (one for input, one for output) when evaluating symbolic references. [1] https://github.com/ClangBuiltLinux/linux/issues/1512 [2] https://lore.kernel.org/all/YfMruK8%2F1izZ2VHS@google.com [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98096 Suggested-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220202004945.2540433-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c24a950ec7d60c4da91dc3f273295c7f438b531e Author: Peter Gonda Date: Thu Apr 7 14:02:33 2022 -0700 KVM, SEV: Add KVM_EXIT_SHUTDOWN metadata for SEV-ES If an SEV-ES guest requests termination, exit to userspace with KVM_EXIT_SYSTEM_EVENT and a dedicated SEV_TERM type instead of -EINVAL so that userspace can take appropriate action. See AMD's GHCB spec section '4.1.13 Termination Request' for more details. Suggested-by: Sean Christopherson Suggested-by: Paolo Bonzini Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Gonda Reported-by: kernel test robot Message-Id: <20220407210233.782250-1-pgonda@google.com> [Add documentatino. - Paolo] Signed-off-by: Paolo Bonzini commit 9bd1f0efa859b61950d109b32ff8d529cc33a3ad Author: Sean Christopherson Date: Thu Apr 7 00:23:15 2022 +0000 KVM: nVMX: Clear IDT vectoring on nested VM-Exit for double/triple fault Clear the IDT vectoring field in vmcs12 on next VM-Exit due to a double or triple fault. Per the SDM, a VM-Exit isn't considered to occur during event delivery if the exit is due to an intercepted double fault or a triple fault. Opportunistically move the default clearing (no event "pending") into the helper so that it's more obvious that KVM does indeed handle this case. Note, the double fault case is worded rather wierdly in the SDM: The original event results in a double-fault exception that causes the VM exit directly. Temporarily ignoring injected events, double faults can _only_ occur if an exception occurs while attempting to deliver a different exception, i.e. there's _always_ an original event. And for injected double fault, while there's no original event, injected events are never subject to interception. Presumably the SDM is calling out that a the vectoring info will be valid if a different exit occurs after a double fault, e.g. if a #PF occurs and is intercepted while vectoring #DF, then the vectoring info will show the double fault. In other words, the clause can simply be read as: The VM exit is caused by a double-fault exception. Fixes: 4704d0befb07 ("KVM: nVMX: Exiting from L2 to L1") Cc: Chenyi Qiang Signed-off-by: Sean Christopherson Message-Id: <20220407002315.78092-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c3634d25fbee88e2368a8e0903ae0d0670eb9e71 Author: Sean Christopherson Date: Thu Apr 7 00:23:14 2022 +0000 KVM: nVMX: Leave most VM-Exit info fields unmodified on failed VM-Entry Don't modify vmcs12 exit fields except EXIT_REASON and EXIT_QUALIFICATION when performing a nested VM-Exit due to failed VM-Entry. Per the SDM, only the two aformentioned fields are filled and "All other VM-exit information fields are unmodified". Fixes: 4704d0befb07 ("KVM: nVMX: Exiting from L2 to L1") Signed-off-by: Sean Christopherson Message-Id: <20220407002315.78092-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 45846661d10422ce9e22da21f8277540b29eca22 Author: Sean Christopherson Date: Thu Apr 7 00:23:13 2022 +0000 KVM: x86: Drop WARNs that assert a triple fault never "escapes" from L2 Remove WARNs that sanity check that KVM never lets a triple fault for L2 escape and incorrectly end up in L1. In normal operation, the sanity check is perfectly valid, but it incorrectly assumes that it's impossible for userspace to induce KVM_REQ_TRIPLE_FAULT without bouncing through KVM_RUN (which guarantees kvm_check_nested_state() will see and handle the triple fault). The WARN can currently be triggered if userspace injects a machine check while L2 is active and CR4.MCE=0. And a future fix to allow save/restore of KVM_REQ_TRIPLE_FAULT, e.g. so that a synthesized triple fault isn't lost on migration, will make it trivially easy for userspace to trigger the WARN. Clearing KVM_REQ_TRIPLE_FAULT when forcibly leaving guest mode is tempting, but wrong, especially if/when the request is saved/restored, e.g. if userspace restores events (including a triple fault) and then restores nested state (which may forcibly leave guest mode). Ignoring the fact that KVM doesn't currently provide the necessary APIs, it's userspace's responsibility to manage pending events during save/restore. ------------[ cut here ]------------ WARNING: CPU: 7 PID: 1399 at arch/x86/kvm/vmx/nested.c:4522 nested_vmx_vmexit+0x7fe/0xd90 [kvm_intel] Modules linked in: kvm_intel kvm irqbypass CPU: 7 PID: 1399 Comm: state_test Not tainted 5.17.0-rc3+ #808 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:nested_vmx_vmexit+0x7fe/0xd90 [kvm_intel] Call Trace: vmx_leave_nested+0x30/0x40 [kvm_intel] vmx_set_nested_state+0xca/0x3e0 [kvm_intel] kvm_arch_vcpu_ioctl+0xf49/0x13e0 [kvm] kvm_vcpu_ioctl+0x4b9/0x660 [kvm] __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae ---[ end trace 0000000000000000 ]--- Fixes: cb6a32c2b877 ("KVM: x86: Handle triple fault in L2 without killing L1") Cc: stable@vger.kernel.org Cc: Chenyi Qiang Signed-off-by: Sean Christopherson Message-Id: <20220407002315.78092-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1921f3aa9263977f6c31b1c3eb2814bff2e84a12 Author: Like Xu Date: Tue Mar 29 23:50:54 2022 +0000 KVM: x86: Use static calls to reduce kvm_pmu_ops overhead Use static calls to improve kvm_pmu_ops performance, following the same pattern and naming scheme used by kvm-x86-ops.h. Here are the worst fenced_rdtsc() cycles numbers for the kvm_pmu_ops functions that is most often called (up to 7 digits of calls) when running a single perf test case in a guest on an ICX 2.70GHz host (mitigations=on): | legacy | static call ------------------------------------------------------------ .pmc_idx_to_pmc | 1304840 | 994872 (+23%) .pmc_is_enabled | 978670 | 1011750 (-3%) .msr_idx_to_pmc | 47828 | 41690 (+12%) .is_valid_msr | 28786 | 30108 (-4%) Signed-off-by: Like Xu [sean: Handle static call updates in pmu.c, tweak changelog] Signed-off-by: Sean Christopherson Message-Id: <20220329235054.3534728-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 34886e796c413273908b036df57cc9ae731badae Author: Like Xu Date: Tue Mar 29 23:50:53 2022 +0000 KVM: x86: Move .pmu_ops to kvm_x86_init_ops and tag as __initdata The pmu_ops should be moved to kvm_x86_init_ops and tagged as __initdata. That'll save those precious few bytes, and more importantly make the original ops unreachable, i.e. make it harder to sneak in post-init modification bugs. Suggested-by: Sean Christopherson Signed-off-by: Like Xu Reviewed-by: Sean Christopherson Signed-off-by: Sean Christopherson Message-Id: <20220329235054.3534728-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 8f969c0c3443183972ac7311d2bd656806082579 Author: Like Xu Date: Tue Mar 29 23:50:52 2022 +0000 KVM: x86: Copy kvm_pmu_ops by value to eliminate layer of indirection Replace the kvm_pmu_ops pointer in common x86 with an instance of the struct to save one pointer dereference when invoking functions. Copy the struct by value to set the ops during kvm_init(). Signed-off-by: Like Xu [sean: Move pmc_is_enabled(), make kvm_pmu_ops static] Signed-off-by: Sean Christopherson Message-Id: <20220329235054.3534728-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit fdc298da866165ec0288fe227982f1aa0467bf5c Author: Like Xu Date: Tue Mar 29 23:50:51 2022 +0000 KVM: x86: Move kvm_ops_static_call_update() to x86.c The kvm_ops_static_call_update() is defined in kvm_host.h. That's completely unnecessary, it should have exactly one caller, kvm_arch_hardware_setup(). Move the helper to x86.c and have it do the actual memcpy() of the ops in addition to the static call updates. This will also allow for cleanly giving kvm_pmu_ops static_call treatment. Suggested-by: Sean Christopherson Signed-off-by: Like Xu [sean: Move memcpy() into the helper and rename accordingly] Signed-off-by: Sean Christopherson Message-Id: <20220329235054.3534728-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ca2a7c22a115d1a9a60ce4f61fe43d5fcaaaa516 Author: Sean Christopherson Date: Tue Mar 29 11:01:07 2022 +0800 KVM: x86/mmu: Derive EPT violation RWX bits from EPTE RWX bits Derive the mask of RWX bits reported on EPT violations from the mask of RWX bits that are shoved into EPT entries; the layout is the same, the EPT violation bits are simply shifted by three. Use the new shift and a slight copy-paste of the mask derivation instead of completely open coding the same to convert between the EPT entry bits and the exit qualification when synthesizing a nested EPT Violation. No functional change intended. Cc: SU Hang Signed-off-by: Sean Christopherson Message-Id: <20220329030108.97341-3-darcy.sh@antgroup.com> Signed-off-by: Paolo Bonzini commit aecce510fee5620bf1906f94772fdda3b9966455 Author: SU Hang Date: Tue Mar 29 11:01:06 2022 +0800 KVM: VMX: replace 0x180 with EPT_VIOLATION_* definition Using self-expressing macro definition EPT_VIOLATION_GVA_VALIDATION and EPT_VIOLATION_GVA_TRANSLATED instead of 0x180 in FNAME(walk_addr_generic)(). Signed-off-by: SU Hang Reviewed-by: Sean Christopherson Message-Id: <20220329030108.97341-2-darcy.sh@antgroup.com> Signed-off-by: Paolo Bonzini commit 77d727926607ba42f0c4ba82baaec1076e8cbebf Author: Wanpeng Li Date: Tue Mar 8 00:18:49 2022 -0800 x86/kvm: Don't waste kvmclock memory if there is nopv parameter When the "nopv" command line parameter is used, it should not waste memory for kvmclock. Signed-off-by: Wanpeng Li Message-Id: <1646727529-11774-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 6e97b2b822902f80142be26614fc0f6a8053ac45 Author: Peng Hao Date: Mon Feb 28 11:09:02 2022 +0800 kvm: vmx: remove redundant parentheses Remove redundant parentheses. Signed-off-by: Peng Hao Message-Id: <20220228030902.88465-1-flyingpeng@tencent.com> Signed-off-by: Paolo Bonzini commit 8176472563fb1a233f46f3f0441738c82afd88da Author: Peng Hao Date: Mon Feb 28 11:07:49 2022 +0800 kvm: x86: Adjust the location of pkru_mask of kvm_mmu to reduce memory Adjust the field pkru_mask to the back of direct_map to make up 8-byte alignment.This reduces the size of kvm_mmu by 8 bytes. Signed-off-by: Peng Hao Message-Id: <20220228030749.88353-1-flyingpeng@tencent.com> Signed-off-by: Paolo Bonzini commit 42c35fdc340ffbf6b3a8ffbdd5b53d856ecf924b Author: Like Xu Date: Wed Apr 6 14:37:14 2022 +0800 selftests: kvm/x86/xen: Replace a comma in the xen_shinfo_test with semicolon +WARNING: Possible comma where semicolon could be used +#397: FILE: tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c:700: ++ tmr.type = KVM_XEN_VCPU_ATTR_TYPE_TIMER, ++ vcpu_ioctl(vm, VCPU_ID, KVM_XEN_VCPU_GET_ATTR, &tmr); Fixes: 25eaeebe710c ("KVM: x86/xen: Add self tests for KVM_XEN_HVM_CONFIG_EVTCHN_SEND") Signed-off-by: Like Xu Message-Id: <20220406063715.55625-4-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 04c975121cae872acb553e1ad0a132f9b4a2640b Author: Like Xu Date: Wed Apr 6 14:37:12 2022 +0800 KVM: x86/xen: Remove the redundantly included header file lapic.h The header lapic.h is included more than once, remove one of them. Signed-off-by: Like Xu Message-Id: <20220406063715.55625-2-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit a4cfff3f0f8c07f1f7873a82bdeb3995807dac8c Merge: 42dcbe7d8bac9 8d5678a76689a Author: Paolo Bonzini Date: Fri Apr 8 12:43:40 2022 -0400 Merge branch 'kvm-older-features' into HEAD Merge branch for features that did not make it into 5.18: * New ioctls to get/set TSC frequency for a whole VM * Allow userspace to opt out of hypercall patching Nested virtualization improvements for AMD: * Support for "nested nested" optimizations (nested vVMLOAD/VMSAVE, nested vGIF) * Allow AVIC to co-exist with a nested guest running * Fixes for LBR virtualizations when a nested guest is running, and nested LBR virtualization support * PAUSE filtering for nested hypervisors Guest support: * Decoupling of vcpu_is_preempted from PV spinlocks Signed-off-by: Paolo Bonzini commit e7cc4244bc2086f4074b8e4d4f78e7b9f5007224 Merge: 6f381481a5b23 f4cf11df69c04 Author: Mark Brown Date: Wed Apr 13 18:33:28 2022 +0100 spi: Pull in Atmel fix Pull in Atmel fix series, only first patch of which is for Linus Signed-off-by: Mark Brown commit aa480379d8bdb33920d68acfd90f823c8af32578 Author: Jan Kiszka Date: Fri Mar 4 07:36:37 2022 +0100 efi: Add missing prototype for efi_capsule_setup_info Fixes "no previous declaration for 'efi_capsule_setup_info'" warnings under W=1. Fixes: 2959c95d510c ("efi/capsule: Add support for Quark security header") Signed-off-by: Jan Kiszka Link: https://lore.kernel.org/r/c28d3f86-dd72-27d1-e2c2-40971b8da6bd@siemens.com Signed-off-by: Ard Biesheuvel commit c7457143668a98e5ddb0ab92d1c61d8899f7ac74 Author: Peng Fan Date: Wed Apr 13 11:30:38 2022 +0800 remoteproc: imx_dsp_rproc: use common rproc_elf_load_segments remoteproc elf loader supports the specific case that segments have PT_LOAD and memsz/filesz set to zero, so no duplicate code. Acked-by: Daniel Baluta Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220413033038.1715945-3-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit f340d5a19dc76c6b29eeb23537fd7345611e9117 Author: Peng Fan Date: Wed Apr 13 11:30:37 2022 +0800 remoteproc: elf_loader: skip segment with memsz as zero Per elf specification, p_filesz: This member gives the number of bytes in the file image of the segment; it may be zero. p_memsz: This member gives the number of bytes in the memory image of the segment; it may be zero. There is a case that i.MX DSP firmware has segment with PT_LOAD and p_memsz/p_filesz set to zero. Such segment needs to be ignored, otherwize rproc_da_to_va would report error. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220413033038.1715945-2-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 7419995a331c24a239bc0bce5df24360544c7038 Author: Dov Murik Date: Tue Apr 12 21:21:27 2022 +0000 docs: security: Add secrets/coco documentation Add documentation for the efi_secret module which allows access to Confidential Computing injected secrets. Signed-off-by: Dov Murik Reviewed-by: Gerd Hoffmann Link: https://lore.kernel.org/r/20220412212127.154182-5-dovmurik@linux.ibm.com Signed-off-by: Ard Biesheuvel commit 20ffd9205ef60fca8912bc9df1602bb627756602 Author: Dov Murik Date: Tue Apr 12 21:21:26 2022 +0000 efi: Register efi_secret platform device if EFI secret area is declared During efi initialization, check if coco_secret is defined in the EFI configuration table; in such case, register platform device "efi_secret". This allows udev to automatically load the efi_secret module (platform driver), which in turn will populate the /secrets/coco directory in guests into which secrets were injected. Note that a declared address of an EFI secret area doesn't mean that secrets where indeed injected to that area; if the secret area is not populated, the driver will not load (but the platform device will still be registered). Signed-off-by: Dov Murik Reviewed-by: Gerd Hoffmann Link: https://lore.kernel.org/r/20220412212127.154182-4-dovmurik@linux.ibm.com Signed-off-by: Ard Biesheuvel commit cbabf03c3ef3cce74a97f140cf57611a9e8a21bc Author: Dov Murik Date: Tue Apr 12 21:21:25 2022 +0000 virt: Add efi_secret module to expose confidential computing secrets The new efi_secret module exposes the confidential computing (coco) EFI secret area via securityfs interface. When the module is loaded (and securityfs is mounted, typically under /sys/kernel/security), a "secrets/coco" directory is created in securityfs. In it, a file is created for each secret entry. The name of each such file is the GUID of the secret entry, and its content is the secret data. This allows applications running in a confidential computing setting to read secrets provided by the guest owner via a secure secret injection mechanism (such as AMD SEV's LAUNCH_SECRET command). Removing (unlinking) files in the "secrets/coco" directory will zero out the secret in memory, and remove the filesystem entry. If the module is removed and loaded again, that secret will not appear in the filesystem. Signed-off-by: Dov Murik Reviewed-by: Gerd Hoffmann Link: https://lore.kernel.org/r/20220412212127.154182-3-dovmurik@linux.ibm.com Signed-off-by: Ard Biesheuvel commit 1227418989346af3af179742cf42ce842e0ad484 Author: Dov Murik Date: Tue Apr 12 21:21:24 2022 +0000 efi: Save location of EFI confidential computing area Confidential computing (coco) hardware such as AMD SEV (Secure Encrypted Virtualization) allows a guest owner to inject secrets into the VMs memory without the host/hypervisor being able to read them. Firmware support for secret injection is available in OVMF, which reserves a memory area for secret injection and includes a pointer to it the in EFI config table entry LINUX_EFI_COCO_SECRET_TABLE_GUID. If EFI exposes such a table entry, uefi_init() will keep a pointer to the EFI config table entry in efi.coco_secret, so it can be used later by the kernel (specifically drivers/virt/coco/efi_secret). It will also appear in the kernel log as "CocoSecret=ADDRESS"; for example: [ 0.000000] efi: EFI v2.70 by EDK II [ 0.000000] efi: CocoSecret=0x7f22e680 SMBIOS=0x7f541000 ACPI=0x7f77e000 ACPI 2.0=0x7f77e014 MEMATTR=0x7ea0c018 The new functionality can be enabled with CONFIG_EFI_COCO_SECRET=y. Signed-off-by: Dov Murik Reviewed-by: Gerd Hoffmann Link: https://lore.kernel.org/r/20220412212127.154182-2-dovmurik@linux.ibm.com Signed-off-by: Ard Biesheuvel commit a031651ff2144a3d81d4916856c093bc1ea0a413 Author: Javier Martinez Canillas Date: Thu Mar 31 17:16:54 2022 +0200 efi: Allow to enable EFI runtime services by default on RT Commit d9f283ae71af ("efi: Disable runtime services on RT") disabled EFI runtime services by default when the CONFIG_PREEMPT_RT option is enabled. The rationale for that commit is that some EFI calls could take too much time, leading to large latencies which is an issue for Real-Time kernels. But a side effect of that change was that now is not possible anymore to enable the EFI runtime services by default when CONFIG_PREEMPT_RT is set, without passing an efi=runtime command line parameter to the kernel. Instead, let's add a new EFI_DISABLE_RUNTIME boolean Kconfig option, that would be set to n by default but to y if CONFIG_PREEMPT_RT is enabled. That way, the current behaviour is preserved but gives users a mechanism to enable the EFI runtimes services in their kernels if that is required. For example, if the firmware could guarantee bounded time for EFI calls. Also, having a separate boolean config could allow users to disable the EFI runtime services by default even when CONFIG_PREEMPT_RT is not set. Reported-by: Alexander Larsson Fixes: d9f283ae71af ("efi: Disable runtime services on RT") Signed-off-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20220331151654.184433-1-javierm@redhat.com Signed-off-by: Ard Biesheuvel commit c86dd9869128156696b4482b2a073790d3db2cfb Author: James Clark Date: Fri Mar 4 17:19:12 2022 +0000 coresight: etm4x: Cleanup TRCRSCTLRn register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-16-james.clark@arm.com /* Removed extra new lines */ Signed-off-by: Mathieu Poirier commit 67493ca4cbe7e8335b94dfe71b12eae79a07b8b8 Author: James Clark Date: Fri Mar 4 17:19:11 2022 +0000 coresight: etm4x: Cleanup TRCBBCTLR register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-15-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 66192082e78a9d346eefd05c0539d31ab45757f9 Author: James Clark Date: Fri Mar 4 17:19:10 2022 +0000 coresight: etm4x: Cleanup TRCSSPCICRn register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-14-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 0544f32b717972cc4d080c02461e0cd0432566d7 Author: James Clark Date: Fri Mar 4 17:19:09 2022 +0000 coresight: etm4x: Cleanup TRCSSCCRn and TRCSSCSRn register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-13-james.clark@arm.com Signed-off-by: Mathieu Poirier commit f5def7722b9c407c7f3895ca6a687ccf2d69c153 Author: James Clark Date: Fri Mar 4 17:19:08 2022 +0000 coresight: etm4x: Cleanup TRCACATRn register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-12-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 4bc500ef252e44fd95c0402fb0b2c714a5bf94b8 Author: James Clark Date: Fri Mar 4 17:19:07 2022 +0000 coresight: etm3x: Cleanup ETMTECR1 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. These fields already have macros to define them so use them instead of magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-11-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 6ba7f2bc12e8a913f6164a4caf6ce7b93e991e32 Author: James Clark Date: Fri Mar 4 17:19:06 2022 +0000 coresight: etm4x: Cleanup TRCVICTLR register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-10-james.clark@arm.com Signed-off-by: Mathieu Poirier commit b5bc16ab04fe8b8b2f4276e926672dc4b23bcfe4 Author: James Clark Date: Fri Mar 4 17:19:05 2022 +0000 coresight: etm4x: Cleanup TRCSTALLCTLR register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-9-james.clark@arm.com Signed-off-by: Mathieu Poirier commit eeae6dddfd34e6f0522b7bdb86d16fdd2b0fa80b Author: James Clark Date: Fri Mar 4 17:19:04 2022 +0000 coresight: etm4x: Cleanup TRCEVENTCTL1R register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-8-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 1cf50f6494644ffb67cafa8f5141cbeaf21a5102 Author: James Clark Date: Fri Mar 4 17:19:03 2022 +0000 coresight: etm4x: Cleanup TRCCONFIGR register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-7-james.clark@arm.com Signed-off-by: Mathieu Poirier commit 028e5460915afd4a3067e380eb4d03cb4500acdc Author: James Clark Date: Fri Mar 4 17:19:02 2022 +0000 coresight: etm4x: Cleanup TRCIDR5 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-6-james.clark@arm.com Signed-off-by: Mathieu Poirier commit ea69dbb893d9f4446c2c66ebb11081af9269721f Author: James Clark Date: Fri Mar 4 17:19:01 2022 +0000 coresight: etm4x: Cleanup TRCIDR4 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-5-james.clark@arm.com Signed-off-by: Mathieu Poirier commit f4d1f2142a608667a1849894b48b9c6e3343210c Author: James Clark Date: Fri Mar 4 17:19:00 2022 +0000 coresight: etm4x: Cleanup TRCIDR3 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-4-james.clark@arm.com Signed-off-by: Mathieu Poirier commit cf0c7f18d30eb9bba44ac04a87fef5035953b283 Author: James Clark Date: Fri Mar 4 17:18:59 2022 +0000 coresight: etm4x: Cleanup TRCIDR2 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-3-james.clark@arm.com Signed-off-by: Mathieu Poirier commit e601cc9a3a9b94b48de7f120b583d94c2d9fe3b5 Author: James Clark Date: Fri Mar 4 17:18:58 2022 +0000 coresight: etm4x: Cleanup TRCIDR0 register accesses This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20220304171913.2292458-2-james.clark@arm.com Signed-off-by: Mathieu Poirier commit daf3af4705ba8f49d33ea9b7bafdc9fd9efd49e0 Author: Thomas Gleixner Date: Tue Apr 12 22:34:21 2022 +0200 x86/apic: Clarify i82489DX bit overlap in APIC_LVT0 Daniel stumbled over the bit overlap of the i82498DX external APIC and the TSC deadline timer configuration bit in modern APICs, which is neither documented in the code nor in the current SDM. Maciej provided links to the original i82489DX/486 documentation. See Link. Remove the i82489DX macro maze, use a i82489DX specific define in the apic code and document the overlap in a comment. Reported-by: Daniel Vacek Signed-off-by: Thomas Gleixner Cc: Maciej W. Rozycki Link: https://lore.kernel.org/r/87ee22f3ci.ffs@tglx commit f4cf11df69c048948b73ff0bebaf9fc5fa5caddd Author: Tudor Ambarus Date: Wed Apr 6 16:36:04 2022 +0300 spi: atmel-quadspi: Remove duplicated DTR checks Remove the DTR checks as they are already handled in spi_mem_default_supports_op(). This code removal was intentionally not done in the previous patch that introduced the use of the spi_mem_default_supports_op() core helper and fixed the buswidth adjustment between SPIMEM and the SPI controller, so that the fix can be easily backported to stable kernels. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20220406133604.455356-2-tudor.ambarus@microchip.com Signed-off-by: Mark Brown commit addca285120b0edf2fef795f7809c83774cf74b7 Author: Chen Yu Date: Fri Apr 8 07:42:58 2022 +0800 cpufreq: intel_pstate: Handle no_turbo in frequency invariance Problem statement: Once the user has disabled turbo frequency by # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo the cfs_rq's util_avg becomes quite small when compared with CPU capacity. Step to reproduce: # echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo # ./x86_cpuload --count 1 --start 3 --timeout 100 --busy 99 would launch 1 thread and bind it to CPU3, lasting for 100 seconds, with a CPU utilization of 99%. [1] top result: %Cpu3 : 98.4 us, 0.0 sy, 0.0 ni, 1.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st check util_avg: cat /sys/kernel/debug/sched/debug | grep "cfs_rq\[3\]" -A 20 | grep util_avg .util_avg : 611 So the util_avg/cpu capacity is 611/1024, which is much smaller than 98.4% shown in the top result. This might impact some logic in the scheduler. For example, group_is_overloaded() would compare the group_capacity and group_util in the sched group, to check if this sched group is overloaded or not. With this gap, even when there is a nearly 100% workload, the sched group will not be regarded as overloaded. Besides group_is_overloaded(), there are also other victims. There is a ongoing work that aims to optimize the task wakeup in a LLC domain. The main idea is to stop searching idle CPUs if the sched domain is overloaded[2]. This proposal also relies on the util_avg/CPU capacity to decide whether the LLC domain is overloaded. Analysis: CPU frequency invariance has caused this difference. In summary, the util_sum of cfs rq would decay quite fast when the CPU is in idle, when the CPU frequency invariance is enabled. The detail is as followed: As depicted in update_rq_clock_pelt(), when the frequency invariance is enabled, there would be two clock variables on each rq, clock_task and clock_pelt: The clock_pelt scales the time to reflect the effective amount of computation done during the running delta time but then syncs back to clock_task when rq is idle. absolute time | 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|16 @ max frequency ------******---------------******--------------- @ half frequency ------************---------************--------- clock pelt | 1| 2| 3| 4| 7| 8| 9| 10| 11|14|15|16 The fast decay of util_sum during idle is due to: 1. rq->clock_pelt is always behind rq->clock_task 2. rq->last_update is updated to rq->clock_pelt' after invoking ___update_load_sum() 3. Then the CPU becomes idle, the rq->clock_pelt' would be suddenly increased a lot to rq->clock_task 4. Enters ___update_load_sum() again, the idle period is calculated by rq->clock_task - rq->last_update, AKA, rq->clock_task - rq->clock_pelt'. The lower the CPU frequency is, the larger the delta = rq->clock_task - rq->clock_pelt' will be. Since the idle period will be used to decay the util_sum only, the util_sum drops significantly during idle period. Proposal: This symptom is not only caused by disabling turbo frequency, but it would also appear if the user limits the max frequency at runtime. Because, if the frequency is always lower than the max frequency, CPU frequency invariance would decay the util_sum quite fast during idle. As some end users would disable turbo after boot up, this patch aims to present this symptom and deals with turbo scenarios for now. It might be ideal if CPU frequency invariance is aware of the max CPU frequency (user specified) at runtime in the future. Link: https://github.com/yu-chen-surf/x86_cpuload.git #1 Link: https://lore.kernel.org/lkml/20220310005228.11737-1-yu.c.chen@intel.com/ #2 Signed-off-by: Chen Yu Acked-by: Peter Zijlstra (Intel) Reviewed-by: Giovanni Gherdovich Signed-off-by: Rafael J. Wysocki commit 82586a721595fde2c1bc0dac7deed2fe9d42c106 Author: Rafael J. Wysocki Date: Wed Apr 13 17:30:32 2022 +0200 PM: runtime: Avoid device usage count underflows A PM-runtime device usage count underflow is potentially critical, because it may cause a device to be suspended when it is expected to be operational. It is also a programming problem that would be good to catch and warn about. For this reason, (1) make rpm_check_suspend_allowed() return an error when the device usage count is negative to prevent devices from being suspended in that case, (2) introduce rpm_drop_usage_count() that will detect device usage count underflows, warn about them and fix them up, and (3) use it to drop the usage count in a few places instead of atomic_dec_and_test(). Signed-off-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson commit 62d528712c1db609fd5afc319378ca053ac9247e Author: Rafael J. Wysocki Date: Mon Apr 4 17:25:04 2022 +0200 PCI: ACPI: PM: Power up devices in D3cold before scanning them The initial configuration of ACPI power resources on some systems implies that some PCI devices on them are initially in D3cold. In some cases, especially for PCIe Root Ports, this is a "logical" D3cold, meaning that the configuration space of the device is accessible, but some of its functionality may be missing, but it very well may be real D3cold, in which case the device will not be accessible at all. However, the PCI bus type driver will need to access its configuration space in order to enumerate it. To prevent possible device enumeration failures that may ensue as a result of ACPI power resources being initially in the "off" state, power up all children of the host bridge ACPI device object that hold valid _ADR objects (which indicates that they will be enumerated by the PCI bus type driver) and do that to all children of the ACPI device objects corresponding to PCI bridges (including PCIe ports). Signed-off-by: Rafael J. Wysocki Acked-by: Bjorn Helgaas Reviewed-by: Mika Westerberg commit b7dd6298db81ea6dd902f1787eaf9a43228e2707 Author: Rafael J. Wysocki Date: Mon Apr 4 17:23:13 2022 +0200 ACPI: PM: Introduce acpi_dev_power_up_children_with_adr() Introduce a function powering up all of the children of a given ACPI device object that are power-manageable and hold valid _ADR ACPI objects so as to make it possible to prepare the corresponding "physical" devices for enumeration carried out by a bus type driver, like PCI. This function will be used in a subsequent change set. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg commit cf6ba0750a22a54f5101986401271429995cc4a0 Author: Rafael J. Wysocki Date: Mon Apr 4 17:21:50 2022 +0200 ACPI: bus: Introduce acpi_dev_for_each_child() Introduce a wrapper around device_for_each_child() to iterate over the children of a given ACPI device object. This function will be used in subsequent change sets. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg commit f4f3548dc8d53d683770b058fdafa01fd7c07669 Author: Rafael J. Wysocki Date: Mon Apr 4 17:03:11 2022 +0200 ACPI: PM: Unify debug messages in acpi_device_set_power() Convert all of the debug messages printed by acpi_device_set_power() to acpi_handle_debug() and adjust them slightly for consistency with acpi_device_get_power() and other acpi_device_set_power() debug messages. Signed-off-by: Rafael J. Wysocki commit 255a04cc457e57c1b429c2a5c0f4d7604b1ef41b Author: Rafael J. Wysocki Date: Mon Apr 4 17:02:00 2022 +0200 ACPI: PM: Change pr_fmt() in device_pm.c All messages printed by functions in this file either contain the "ACPI" or "acpi" string regardless of the format, or they don't need to contain it at all. In the former case, the "ACPI:" string added by the format is redundant, so drop it from there. Signed-off-by: Rafael J. Wysocki commit 198ee4377b9675898a53c1a02f6ba55d186cc806 Author: Rafael J. Wysocki Date: Mon Apr 4 17:00:45 2022 +0200 ACPI: PM: Convert debug message in acpi_device_get_power() Convert the debug message printed by acpi_device_get_power() to acpi_handle_debug(), because that function is also called when the ACPI device object name has not been set yet and the dev_dbg() message printed by it at that time is not useful. Signed-off-by: Rafael J. Wysocki commit 95996a675757a0f3f75babb8cd4f2ebcd0bda478 Author: Christophe Leroy Date: Fri Apr 1 19:24:28 2022 +0200 cpufreq: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit e5a3b0c5b6a194c94d6d64308311eff7d46e57c0 Author: Haowen Bai Date: Fri Apr 1 18:01:34 2022 +0800 PM: hibernate: Don't mark comment as kernel-doc Change the comment to a normal (non-kernel-doc) comment to avoid these kernel-doc warnings: kernel/power/snapshot.c:335: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Data types related to memory bitmaps. Signed-off-by: Haowen Bai Signed-off-by: Rafael J. Wysocki commit eefa861810a896e55f9d9246ac824f544f0700b3 Author: Krzysztof Kozlowski Date: Fri Apr 1 10:49:50 2022 +0200 PM: domains: Extend dev_pm_domain_detach() doc Mention all domain attach menthods which dev_pm_domain_detach() reverses. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rafael J. Wysocki commit 84958f38d897f85b34036356f64e908e4754170f Author: Amadeusz Sławiński Date: Tue Mar 29 15:33:52 2022 +0200 x86/ACPI: Preserve ACPI-table override during hibernation When overriding NHLT ACPI-table tests show that on some platforms there is problem that NHLT contains garbage after hibernation/resume cycle. Problem stems from the fact that ACPI override performs early memory allocation using memblock_phys_alloc_range() in memblock_phys_alloc_range(). This memory block is later being marked as ACPI memory block in arch_reserve_mem_area(). Later when memory areas are considered for hibernation it is being marked as nosave in e820__register_nosave_regions(). Fix this by marking ACPI override memory area as ACPI NVS (Non-Volatile-Sleeping), which according to specification needs to be saved on entering S4 and restored when leaving and is implemented as such in kernel. Signed-off-by: Amadeusz Sławiński Signed-off-by: Rafael J. Wysocki commit b947769b8f778db130aad834257fcaca25df2edc Author: Kant Fan Date: Fri Mar 25 15:30:30 2022 +0800 thermal: devfreq_cooling: use local ops instead of global ops Fix access illegal address problem in following condition: There are multiple devfreq cooling devices in system, some of them has EM model but others do not. Energy model ops such as state2power will append to global devfreq_cooling_ops when the cooling device with EM model is registered. It makes the cooling device without EM model also use devfreq_cooling_ops after appending when registered later by of_devfreq_cooling_register_power() or of_devfreq_cooling_register(). The IPA governor regards the cooling devices without EM model as a power actor, because they also have energy model ops, and will access illegal address at dfc->em_pd when execute cdev->ops->get_requested_power, cdev->ops->state2power or cdev->ops->power2state. Fixes: 615510fe13bd2 ("thermal: devfreq_cooling: remove old power model and use EM") Cc: 5.13+ # 5.13+ Signed-off-by: Kant Fan Reviewed-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit 467df4cfdc10cb497ac8a977458e50b8266f915f Author: Yang Li Date: Fri Mar 25 09:44:15 2022 +0800 PM: hibernate: Fix some kernel-doc comments Add parameter description in alloc_rtree_node() kernel-doc comment and fix several inconsistent function name descriptions. Remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. kernel/power/snapshot.c:438: warning: Function parameter or member 'gfp_mask' not described in 'alloc_rtree_node' kernel/power/snapshot.c:438: warning: Function parameter or member 'safe_needed' not described in 'alloc_rtree_node' kernel/power/snapshot.c:438: warning: Function parameter or member 'ca' not described in 'alloc_rtree_node' kernel/power/snapshot.c:438: warning: Function parameter or member 'list' not described in 'alloc_rtree_node' kernel/power/snapshot.c:916: warning: expecting prototype for memory_bm_rtree_next_pfn(). Prototype was for memory_bm_next_pfn() instead kernel/power/snapshot.c:1947: warning: expecting prototype for alloc_highmem_image_pages(). Prototype was for alloc_highmem_pages() instead kernel/power/snapshot.c:2230: warning: expecting prototype for load header(). Prototype was for load_header() instead Reported-by: Abaci Robot Signed-off-by: Yang Li [ rjw: Comment adjustments to avoid line breaks ] Signed-off-by: Rafael J. Wysocki commit 7bb732fea3944171afa45b4a71298f822589c8a6 Author: Hesham Almatary Date: Thu Mar 24 10:34:43 2022 +0000 thermal: hisi_termal: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Cleaning up the driver to use pm_sleep_ptr() macro instead of #ifdef guards is simpler and allows the compiler to remove those functions if built without CONFIG_PM_SLEEP support. Signed-off-by: Hesham Almatary Reviewed-by: Paul Cercueil Signed-off-by: Rafael J. Wysocki commit ce1cb680ff1c5b88505f878137796b1723e00193 Author: David Cohen Date: Thu Mar 24 08:07:30 2022 +0000 PM: sleep: enable dynamic debug support within pm_pr_dbg() Currently pm_pr_dbg() is used to filter kernel pm debug messages based on pm_debug_messages_on flag. The problem is if we enable/disable this flag it will affect all pm_pr_dbg() calls at once, so we can't individually control them. This patch changes pm_pr_dbg() implementation as such: - If pm_debug_messages_on is enabled, print the message. - If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is enabled, only print the messages explicitly enabled on /sys/kernel/debug/dynamic_debug/control. - If pm_debug_messages_on is disabled and CONFIG_DYNAMIC_DEBUG is disabled, don't print the message. Signed-off-by: David Cohen Signed-off-by: Rafael J. Wysocki commit ae20cb9aec91ec3c668e413b93a6080803464ae5 Author: David Cohen Date: Thu Mar 24 08:07:24 2022 +0000 PM: sleep: Narrow down -DDEBUG on kernel/power/ files The macro -DDEBUG is broadly enabled on kernel/power/ directory if CONFIG_DYNAMIC_DEBUG is enabled. As side effect all debug messages using pr_debug() and dev_dbg() are enabled by default on dynamic debug. We're reworking pm_pr_dbg() to support dynamic debug, where pm_pr_dbg() will print message if either pm_debug_messages_on flag is set or if it's explicitly enabled on dynamic debug's control. That means if we let -DDEBUG broadly set, the pm_debug_messages_on flag will be bypassed by default on pm_pr_dbg() if dynamic debug is also enabled. The files that directly use pr_debug() and dev_dbg() on kernel/power/ are: - swap.c - snapshot.c - energy_model.c And those files do not use pm_pr_dbg(). So if we limit -DDEBUG to them, we keep the same functional behavior while allowing the pm_pr_dbg() refactor. Signed-off-by: David Cohen Signed-off-by: Rafael J. Wysocki commit 83c784e7003625d63ff4609500c9f11736edebed Author: Marek Vasut Date: Fri Apr 1 18:21:54 2022 +0200 drm/panel: lvds: Use bus_flags from DT panel-timing property This driver currently rewrites bus_flags based solely on the value of DT property 'data-mirror' and ignores bus_flags which might have been set in DT panel-timing node. Specificaly, the 'de-active' DT property sets DRM_BUS_FLAG_DE_ bus_flags. Since of_get_drm_panel_display_mode() conveniently parses the bus_flags out of DT panel-timing property, just ORR them with bus_flags inferred from 'data-mirror' DT property and use the result as panel bus_flags. This fixes handling of panels with 'panel-timing { de-active = <1>; };'. Reviewed-by: Laurent Pinchart Tested-by: Christoph Niedermaier Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220401162154.295152-2-marex@denx.de commit 985a67709a66c456414182ed179544786e00321e Author: Lukasz Luba Date: Mon Mar 21 09:57:29 2022 +0000 powercap: DTPM: Check for Energy Model type The Energy Model power values might be artificial. In such case it's safe to bail out during the registration, since the PowerCap framework supports only micro-Watts. Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit 9926bbec3ae6c10d4e6fc297afde6a7ef7ad640b Author: Lukasz Luba Date: Mon Mar 21 09:57:28 2022 +0000 thermal: cooling: Check Energy Model type in cpufreq_cooling and devfreq_cooling The Energy Model can now be artificial, which means the power values are mathematically generated to leverage EAS while not expected to be on an uniform scale with other devices providing power information. If this EM type is in use, the thermal governor IPA should not be allowed to operate, since the relation between cooling devices is not properly defined. Thus, it might be possible that big GPU has lower power values than a Little CPU. To mitigate a misbehaviour of the thermal control algorithm, simply do not register the cooling device as IPA's power actor. Signed-off-by: Lukasz Luba Acked-by: Viresh Kumar Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit 015f569c4649fe9595ed465dc8e4301d34937f8f Author: Lukasz Luba Date: Mon Mar 21 09:57:27 2022 +0000 Documentation: EM: Add artificial EM registration description Add description about new artificial EM registration and use cases. Update also the documentation with the new .get_cost() callback description and usage. Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit 03fa454bb666f243d2ffe8ee7395b89cf4e3c27d Author: Marek Vasut Date: Fri Apr 1 18:21:53 2022 +0200 drm/panel: lvds: Simplify mode parsing The mode parsing is currently implemented in three steps: of_get_display_timing() - DT panel-timing to struct display_timing videomode_from_timing() - struct display_timing to struct videomode drm_display_mode_from_videomode() - struct videomode to struct drm_display_mode Replace all that with simple of_get_drm_panel_display_mode() call, which already populates struct drm_display_mode and then duplicate that mode in panel_lvds_get_modes() each time, since the mode does not change. Nice bonus is the bus_flags parsed by of_get_drm_panel_display_mode() out of panel-timing DT node, which is used in subsequent patch to fix handling of 'de-active' DT property. Tested-by: Christoph Niedermaier Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220401162154.295152-1-marex@denx.de commit 16857482b830544f5849daa1048f82d00b68957e Author: Lukasz Luba Date: Mon Mar 21 09:57:26 2022 +0000 PM: EM: Remove old debugfs files and print all 'flags' The Energy Model gets more bits used in 'flags'. Avoid adding another debugfs file just to print what is the status of a new flag. Simply remove old debugfs files and add one generic which prints all flags as a hex value. Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit 75a3a99a5a9886af13be44e640cb415ebda80db2 Author: Lukasz Luba Date: Mon Mar 21 09:57:25 2022 +0000 PM: EM: Change the order of arguments in the .active_power() callback The .active_power() callback passes the device pointer when it's called. Aligned with a convetion present in other subsystems and pass the 'dev' as a first argument. It looks more cleaner. Adjust all affected drivers which implement that API callback. Suggested-by: Ionela Voinescu Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit 91362463114eb63ead5f02c11d58c46064c339e7 Author: Lukasz Luba Date: Mon Mar 21 09:57:24 2022 +0000 PM: EM: Use the new .get_cost() callback while registering EM The Energy Model (EM) allows to provide the 'cost' values when the device driver provides the .get_cost() optional callback. This removes restriction which is in the EM calculation function of the 'cost' for each performance state. Now, the driver is in charge of providing the right values which are then used by Energy Aware Scheduler. Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit fc3a9a9858478ab5f8441765a3f9552a0ceba10c Author: Pierre Gondois Date: Mon Mar 21 09:57:23 2022 +0000 PM: EM: Add artificial EM flag The Energy Model (EM) can be used on platforms which are missing real power information. Those platforms would implement .get_cost() which populates needed values for the Energy Aware Scheduler (EAS). The EAS doesn't use 'power' fields from EM, but other frameworks might use them. Thus, to avoid miss-usage of this specific type of EM, introduce a new flags which can be checked by other frameworks. Signed-off-by: Pierre Gondois Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit bdc21a4d286c6917fe966fd765de99411095b1b4 Author: Lukasz Luba Date: Mon Mar 21 09:57:22 2022 +0000 PM: EM: Add .get_cost() callback The Energy Model (EM) supports devices which report abstract power scale, not only real Watts. The primary goal for EM is to enable the Energy Aware Scheduler (EAS) for a given platform. Some of the platforms might not be able to deliver proper power values. The only information that they might have is the relative efficiency between CPU types. Thus, it makes sense to remove some restrictions in the EM framework and introduce a mechanism which would support those platforms. What is crucial for EAS to operate is the 'cost' field in the EM. The 'cost' is calculated internally in EM framework based on knowledge from 'power' values. The 'cost' values must be strictly increasing. The existing API with its 'power' value size restrictions cannot guarantee that the 'cost' will meet this requirement. Since the platform is missing this detailed information, but has only efficiency details, introduce a new custom callback in the EM framework. The new callback would allow to provide the 'cost' values which reflect efficiency of the CPUs. This would allow to provide EAS information which has different relation than what would be forced by the EM internal formulas calculating 'cost' values. Thanks to this new callback it is possible to create a system view for EAS which has no overlapping performance states across many Performance Domains. Signed-off-by: Lukasz Luba Reviewed-by: Ionela Voinescu Signed-off-by: Rafael J. Wysocki commit fb47723aba6fb62a6dce34eb108c886d9d469f9c Author: Marek Vasut Date: Sun Apr 3 19:10:04 2022 +0200 drm: bridge: icn6211: Convert to regmap To make debugging easier, convert driver to regmap. Implement read and write regmap tables for known registers, keep all known register readable and mark those which are obviously read-only as not writeable. Use common I2C regmap for the I2C configuration, implement custom regmap bus for DSI configuration. The later is mandatory as this chip requires one extra byte set to read access length between register address and data. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Mark Brown Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Acked-by: Mark Brown Link: https://patchwork.freedesktop.org/patch/msgid/20220403171004.368464-1-marex@denx.de commit b39d2c6202426b560641e5800c5523851b5db586 Author: Ville Syrjälä Date: Tue Mar 15 16:00:01 2022 +0200 drm/i915/fbc: Call intel_fbc_activate() directly from frontbuffer flush Remove the pointless detour via __intel_fbc_post_update() during frontbuffer flush. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-8-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit b65cbb983f2a0a21f0fcf96eaa5a9c20966f8bd8 Author: Ville Syrjälä Date: Tue Mar 15 16:00:00 2022 +0200 drm/i915/fbc: Introduce intel_fbc_sanitize() Let's make sure FBC is always disabled when we start to take over the hardware state. I suspect this should never really happen, since the only time when we really should be taking over with the display already active is when the previous state was progammed by the BIOS, which likely shouldn't use FBC. This could be driver init, or S4 resume when the boot kernel doesn't load i915. But I suppose no harm in keeping this code around for exra safety since it's quite trivial. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-7-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 29118f126a25d9a1341359d84be530b22b5f9df4 Author: Ville Syrjälä Date: Tue Mar 15 15:59:59 2022 +0200 drm/i915/fbc: Remove intel_fbc_global_disable() By the time intel_fbc_global_disable() gets called during driver teardown we should have already disabled all the crtcs, so no way FBC should be enabled at this point. And I have no idea what the other user (i915_restore_display()) is even trying to achieve. So let's just throw intel_fbc_global_disable() into the bin. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-6-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 7cfd1a18c5f9697639cf85fc1aadd6997de085fa Author: Ville Syrjälä Date: Tue Mar 15 15:59:58 2022 +0200 drm/i915: Remove remaining locks from i9xx plane udpates Now that fbc no longer nukes while a flip is pending we can remove the last uncore.lock from the i9xx plane code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-5-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit de5bd083d247cfcc0c21524366b473967fef7031 Author: Ville Syrjälä Date: Tue Mar 15 15:59:57 2022 +0200 drm/i915/fbc: Skip nuke when flip is pending Don't issue a nuke from frontbuffer flush while a flip is pending. This avoids the DSPADDR/DSPSURF rmw abuse from the pre-snb nuke from racing with the DSPADDR/DSPSURF write being performed by the flip/plane update. The flip itself will already cause the nuke so a double nuke is redundant. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-4-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 529b43dfcd267f2773116611f2ce9cc755be986b Author: Ville Syrjälä Date: Tue Mar 15 15:59:56 2022 +0200 drm/i915/fbc: Streamline frontbuffer busy bits handling If the frontbuffer bits say this fbc instance isn't affected just skip the whole thing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-3-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 20bea20a550a4343cdf473148372bd6a91369614 Author: Ville Syrjälä Date: Tue Mar 15 15:59:55 2022 +0200 drm/i915/fbc: Eliminate possible_framebuffer_bits Not sure what the point of this fbc->possible_frontbuffer_bits is. And especially don't see why it's returning all the bits when fbc is not even enabled. So let's just get rid of this and only say we are interested in the plane's frontbuffer bits when fbc is actually enabled. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315140001.1172-2-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola Acked-by: Jani Nikula commit 9386ebccfc599de5578a278ffb16d90cc696969a Author: Dylan Muller Date: Tue Apr 12 17:26:00 2022 +0200 nfp: update nfp_X logging definitions Previously it was not possible to determine which code path was responsible for generating a certain message after a call to the nfp_X messaging definitions for cases of duplicate strings. We therefore modify nfp_err, nfp_warn, nfp_info, nfp_dbg and nfp_printk to print the corresponding file and line number where the nfp_X definition is used. Signed-off-by: Dylan Muller Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit a85ee6401a47ae3fc64ba506cacb3e7873823c65 Author: Kevin Hao Date: Sun Jan 23 20:45:08 2022 +0800 cpufreq: governor: Use kobject release() method to free dbs_data The struct dbs_data embeds a struct gov_attr_set and the struct gov_attr_set embeds a kobject. Since every kobject must have a release() method and we can't use kfree() to free it directly, so introduce cpufreq_dbs_data_release() to release the dbs_data via the kobject::release() method. This fixes the calltrace like below: ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x34 WARNING: CPU: 12 PID: 810 at lib/debugobjects.c:505 debug_print_object+0xb8/0x100 Modules linked in: CPU: 12 PID: 810 Comm: sh Not tainted 5.16.0-next-20220120-yocto-standard+ #536 Hardware name: Marvell OcteonTX CN96XX board (DT) pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0xb8/0x100 lr : debug_print_object+0xb8/0x100 sp : ffff80001dfcf9a0 x29: ffff80001dfcf9a0 x28: 0000000000000001 x27: ffff0001464f0000 x26: 0000000000000000 x25: ffff8000090e3f00 x24: ffff80000af60210 x23: ffff8000094dfb78 x22: ffff8000090e3f00 x21: ffff0001080b7118 x20: ffff80000aeb2430 x19: ffff800009e8f5e0 x18: 0000000000000000 x17: 0000000000000002 x16: 00004d62e58be040 x15: 013590470523aff8 x14: ffff8000090e1828 x13: 0000000001359047 x12: 00000000f5257d14 x11: 0000000000040591 x10: 0000000066c1ffea x9 : ffff8000080d15e0 x8 : ffff80000a1765a8 x7 : 0000000000000000 x6 : 0000000000000001 x5 : ffff800009e8c000 x4 : ffff800009e8c760 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0001474ed040 Call trace: debug_print_object+0xb8/0x100 __debug_check_no_obj_freed+0x1d0/0x25c debug_check_no_obj_freed+0x24/0xa0 kfree+0x11c/0x440 cpufreq_dbs_governor_exit+0xa8/0xac cpufreq_exit_governor+0x44/0x90 cpufreq_set_policy+0x29c/0x570 store_scaling_governor+0x110/0x154 store+0xb0/0xe0 sysfs_kf_write+0x58/0x84 kernfs_fop_write_iter+0x12c/0x1c0 new_sync_write+0xf0/0x18c vfs_write+0x1cc/0x220 ksys_write+0x74/0x100 __arm64_sys_write+0x28/0x3c invoke_syscall.constprop.0+0x58/0xf0 do_el0_svc+0x70/0x170 el0_svc+0x54/0x190 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 irq event stamp: 189006 hardirqs last enabled at (189005): [] finish_task_switch.isra.0+0xe0/0x2c0 hardirqs last disabled at (189006): [] el1_dbg+0x24/0xa0 softirqs last enabled at (188966): [] __do_softirq+0x4b0/0x6a0 softirqs last disabled at (188957): [] __irq_exit_rcu+0x108/0x1a4 [ rjw: Because can be freed by the gov_attr_set_put() in cpufreq_dbs_governor_exit() now, it is also necessary to put the invocation of the governor ->exit() callback into the new cpufreq_dbs_data_release() function. ] Fixes: c4435630361d ("cpufreq: governor: New sysfs show/store callbacks for governor tunables") Signed-off-by: Kevin Hao Signed-off-by: Rafael J. Wysocki commit 46d18d510d78318c4aa5aaeff66782f1ec42c2ec Author: Mukul Joshi Date: Wed Apr 6 20:07:37 2022 -0400 drm/amdkfd: Cleanup IO links during KFD device removal Currently, the IO-links to the device being removed from topology, are not cleared. As a result, there would be dangling links left in the KFD topology. This patch aims to fix the following: 1. Cleanup all IO links to the device being removed. 2. Ensure that node numbering in sysfs and nodes proximity domain values are consistent after the device is removed: a. Adding a device and removing a GPU device are made mutually exclusive. b. The global proximity domain counter is no longer required to be an atomic counter. A normal 32-bit counter can be used instead. 3. Update generation_count to let user-mode know that topology has changed due to device removal. CC: Shuotao Xu Reviewed-by: Shuotao Xu Reviewed-by: Felix Kuehling Signed-off-by: Mukul Joshi Signed-off-by: Alex Deucher commit eb85fc238970afe4a309bb307bdeecc2938ba7b2 Author: Yongqiang Sun Date: Fri Apr 8 10:53:14 2022 -0400 drm/amd/amdgpu: Not request init data for MS_HYPERV with vega10 MS_HYPERV with vega10 doesn't have the interface to process request init data msg. Check hypervisor type to not send the request for MS_HYPERV. Signed-off-by: Yongqiang Sun Reviewed-by: Alice Wong Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3925f9b4fed1b51bfe17770a63609a7a0f6e4808 Author: Lang Yu Date: Tue Apr 12 10:41:53 2022 +0800 drm/amdkfd: shrink bitmap size in struct svm_validate_context A MAX_GPU_INSTANCE bits bitmap will suffice. Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a5b7994306f66a62acb48734b5577809a87a1cf2 Author: Wenjing Liu Date: Fri Mar 25 16:12:14 2022 -0400 drm/amd/display: extract update stream allocation to link_hwss [why] Extract update stream allocation table into link hwss as part of the link hwss refactor work. Reviewed-by: George Shen Reviewed-by: Fangzhi Zuo Acked-by: Pavle Kotarac Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 9dd941015718c1387d6f7f61bd4394d38d273c50 Author: David Zhang Date: Wed Mar 23 23:11:48 2022 -0400 drm/amd/display: implement shared PSR-SU sink validation helper [why] creating a generic helper for AMD specific PSR-SU sink validation. Moving the function to the power module to reference it across all OS. [how] - drop PSRSU specific sink validation helper and move to power module by reading PSR version and other PSR caps - call the new helper from linux DM (amdgpu_dm_psr) Acked-by: Pavle Kotarac Acked-by: Tom Chung Signed-off-by: David Zhang Signed-off-by: Alex Deucher commit 72907bff3bd346ef4879bd1dfc89ba12133da368 Author: David Zhang Date: Thu Mar 31 11:55:49 2022 -0400 drm: add PSR2 support and capability definition as per eDP 1.5 [why & how] As per eDP 1.5 spec, add the below two DPCD bit fields for PSR-SU support and capability: 1. DP_PSR2_WITH_Y_COORD_ET_SUPPORTED 2. DP_PSR2_SU_AUX_FRAME_SYNC_NOT_NEEDED changes in v2 ------------------ * fixed the typo * explicitly list what DPCD bit fields are added Signed-off-by: David Zhang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 619fdc47f821139f312a87b397a75ff69ec6f8b6 Author: Krzysztof Kozlowski Date: Mon Apr 11 12:59:03 2022 +0200 regulator: dt-bindings: qcom,rpmh: document h and k ID Document used PMIC IDs: 'h' (sm8450-hdk, sm8450-qrd) and 'k' (sc7280-crd). Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220411105903.230733-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 5947b2726beb61fe7911580f239222ec9c4f6967 Author: Zheyu Ma Date: Sat Apr 9 22:39:50 2022 +0800 ASoC: SOF: Intel: Check the bar size before remapping The driver should use the pci_resource_len() to get the actual length of pci bar, and compare it with the expect value. If the bar size is too small (such as a broken device), the driver should return an error. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220409143950.2570186-1-zheyuma97@gmail.com Signed-off-by: Mark Brown commit d0a3ef604801e8e8564d15bdeb29497607a0d65a Author: Bjorn Andersson Date: Tue Apr 12 14:29:59 2022 -0700 dmaengine: qcom: gpi: Add SM8350 support The Qualcomm SM8350 platform does, like the SM8450, provide a set of GPI controllers with an ee-offset of 0x10000. Add this to the driver. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220412212959.2385085-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit a5c7a39f508ae1fd3288493b96dd26079bae41bf Author: Petr Mladek Date: Tue Apr 5 13:48:29 2022 +0200 printk/index: Printk index feature documentation Document the printk index feature. The primary motivation is to explain that it is not creating KABI from particular printk() calls. Acked-by: Sergey Senozhatsky Reviewed-by: Chris Down Signed-off-by: Petr Mladek commit 6316572cf30283d784df0ecf3d517daf020b4507 Author: Vinod Koul Date: Wed Apr 6 18:55:08 2022 +0530 dmaengine: qcom: gpi: Add support for ee_offset Controller on newer SoCs like SM8450 have registers at at offset. Add ee_offset to driver_data and add this compatible for the driver. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220406132508.1029348-3-vkoul@kernel.org Signed-off-by: Vinod Koul commit dd45d96bd9d3a052f1497f3d813a76d8308af25e Author: Vinod Koul Date: Wed Apr 6 18:55:07 2022 +0530 dt-bindings: dmaengine: qcom: gpi: add compatible for sm8350/sm8350 Add the compatible for newer qcom socs with gpi dma i.e qcom sm8350 and sm8450. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220406132508.1029348-2-vkoul@kernel.org Signed-off-by: Vinod Koul commit 94b8f0e58fa138455edc5414aa097694fede8836 Author: Vinod Koul Date: Wed Apr 6 18:55:06 2022 +0530 dmaengine: qcom: gpi: set chain and link flag for duplex Newer platforms seem to have strict requirement for TRE flags which causes transaction to timeout. This was resolved to missing chain and link flag for duplex spi transaction. So add these two flags. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Tested-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220406132508.1029348-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 735cb16bfe5349e14edf9f51c48c4ea86e676ee0 Merge: dba47afdc7d51 eeab7e7ff43eb Author: David S. Miller Date: Wed Apr 13 13:09:57 2022 +0100 Merge branch 'ip-ingress-skb-reason' Menglong Dong says: ==================== net: ip: add skb drop reasons to ip ingress In the series "net: use kfree_skb_reason() for ip/udp packet receive", skb drop reasons are added to the basic ingress path of IPv4. And in the series "net: use kfree_skb_reason() for ip/neighbour", the egress paths of IPv4 and IPv6 are handled. Related links: https://lore.kernel.org/netdev/20220205074739.543606-1-imagedong@tencent.com/ https://lore.kernel.org/netdev/20220226041831.2058437-1-imagedong@tencent.com/ Seems we still have a lot work to do with IP layer, including IPv6 basic ingress path, IPv4/IPv6 forwarding, IPv6 exthdrs, fragment and defrag, etc. In this series, skb drop reasons are added to the basic ingress path of IPv6 protocol and IPv4/IPv6 packet forwarding. Following functions, which are used for IPv6 packet receiving are handled: ip6_pkt_drop() ip6_rcv_core() ip6_protocol_deliver_rcu() And following functions that used for IPv6 TLV parse are handled: ip6_parse_tlv() ipv6_hop_ra() ipv6_hop_ioam() ipv6_hop_jumbo() ipv6_hop_calipso() ipv6_dest_hao() Besides, ip_forward() and ip6_forward(), which are used for IPv4/IPv6 forwarding, are also handled. And following new drop reasons are added: /* host unreachable, corresponding to IPSTATS_MIB_INADDRERRORS */ SKB_DROP_REASON_IP_INADDRERRORS /* network unreachable, corresponding to IPSTATS_MIB_INADDRERRORS */ SKB_DROP_REASON_IP_INNOROUTES /* packet size is too big, corresponding to * IPSTATS_MIB_INTOOBIGERRORS */ SKB_DROP_REASON_PKT_TOO_BIG In order to simply the definition and assignment for 'enum skb_drop_reason', some helper functions are introduced in the 1th patch. I'm not such if this is necessary, but it makes the code simpler. For example, we can replace the code: if (reason == SKB_DROP_REASON_NOT_SPECIFIED) reason = SKB_DROP_REASON_IP_INHDR; with: SKB_DR_OR(reason, IP_INHDR); In the 6th patch, the statistics for skb in ipv6_hop_jum() is removed, as I think it is redundant. There are two call chains for ipv6_hop_jumbo(). The first one is: ipv6_destopt_rcv() -> ip6_parse_tlv() -> ipv6_hop_jumbo() On this call chain, the drop statistics will be done in ipv6_destopt_rcv() with 'IPSTATS_MIB_INHDRERRORS' if ipv6_hop_jumbo() returns false. The second call chain is: ip6_rcv_core() -> ipv6_parse_hopopts() -> ip6_parse_tlv() And the drop statistics will also be done in ip6_rcv_core() with 'IPSTATS_MIB_INHDRERRORS' if ipv6_hop_jumbo() returns false. Therefore, the statistics in ipv6_hop_jumbo() is redundant, which means the drop is counted twice. The statistics in ipv6_hop_jumbo() is almost the same as the outside, except the 'IPSTATS_MIB_INTRUNCATEDPKTS', which seems that we have to ignore it. ====================================================================== Here is a basic test for IPv6 forwarding packet drop that monitored by 'dropwatch' tool: drop at: ip6_forward+0x81a/0xb70 (0xffffffff86c73f8a) origin: software input port ifindex: 7 timestamp: Wed Apr 13 11:51:06 2022 130010176 nsec protocol: 0x86dd length: 94 original length: 94 drop reason: IP_INADDRERRORS The origin cause of this case is that IPv6 doesn't allow to forward the packet with LOCAL-LINK saddr, and results the 'IP_INADDRERRORS' drop reason. ==================== Signed-off-by: David S. Miller commit eeab7e7ff43eb216e4e89482e03fe95a7e4c915e Author: Menglong Dong Date: Wed Apr 13 16:16:00 2022 +0800 net: ipv6: add skb drop reasons to ip6_protocol_deliver_rcu() Replace kfree_skb() used in ip6_protocol_deliver_rcu() with kfree_skb_reason(). No new reasons are added. Some paths are ignored, as they are not common, such as encapsulation on non-final protocol. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit 4daf841a2ef3b2e987894c8107d309ce2b67c202 Author: Menglong Dong Date: Wed Apr 13 16:15:59 2022 +0800 net: ipv6: add skb drop reasons to ip6_rcv_core() Replace kfree_skb() used in ip6_rcv_core() with kfree_skb_reason(). No new drop reasons are added. Seems now we use 'SKB_DROP_REASON_IP_INHDR' for too many case during ipv6 header parse or check, just like what 'IPSTATS_MIB_INHDRERRORS' do. Will it be too general and hard to know what happened? Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit 7d9dbdfbfdc5e52131bea94a7318ee35b15a5f19 Author: Menglong Dong Date: Wed Apr 13 16:15:58 2022 +0800 net: ipv6: add skb drop reasons to TLV parse Replace kfree_skb() used in TLV encoded option header parsing with kfree_skb_reason(). Following functions are involved: ip6_parse_tlv() ipv6_hop_ra() ipv6_hop_ioam() ipv6_hop_jumbo() ipv6_hop_calipso() ipv6_dest_hao() Most skb drops during this process are regarded as 'InHdrErrors', as 'IPSTATS_MIB_INHDRERRORS' is used when ip6_parse_tlv() fails, which make we use 'SKB_DROP_REASON_IP_INHDR' correspondingly. However, 'IP_INHDR' is a relatively general reason. Therefore, we can use other reasons with higher priority in some cases. For example, 'SKB_DROP_REASON_UNHANDLED_PROTO' is used for unknown TLV options. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit bba98083499f63f62419edf42022275d34a72470 Author: Menglong Dong Date: Wed Apr 13 16:15:57 2022 +0800 net: ipv6: remove redundant statistics in ipv6_hop_jumbo() There are two call chains for ipv6_hop_jumbo(). The first one is: ipv6_destopt_rcv() -> ip6_parse_tlv() -> ipv6_hop_jumbo() On this call chain, the drop statistics will be done in ipv6_destopt_rcv() with 'IPSTATS_MIB_INHDRERRORS' if ipv6_hop_jumbo() returns false. The second call chain is: ip6_rcv_core() -> ipv6_parse_hopopts() -> ip6_parse_tlv() And the drop statistics will also be done in ip6_rcv_core() with 'IPSTATS_MIB_INHDRERRORS' if ipv6_hop_jumbo() returns false. Therefore, the statistics in ipv6_hop_jumbo() is redundant, which means the drop is counted twice. The statistics in ipv6_hop_jumbo() is almost the same as the outside, except the 'IPSTATS_MIB_INTRUNCATEDPKTS', which seems that we have to ignore it. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit 1ad6d548e2a452f21bcee4606ee4ec7afcde5f37 Author: Menglong Dong Date: Wed Apr 13 16:15:56 2022 +0800 net: icmp: introduce function icmpv6_param_prob_reason() In order to add the skb drop reasons support to icmpv6_param_prob(), introduce the function icmpv6_param_prob_reason() and make icmpv6_param_prob() an inline call to it. This new function will be used in the following patches. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit 2edc1a383fda8d2f580216292dfd9daeae691e47 Author: Menglong Dong Date: Wed Apr 13 16:15:55 2022 +0800 net: ip: add skb drop reasons to ip forwarding Replace kfree_skb() which is used in ip6_forward() and ip_forward() with kfree_skb_reason(). The new drop reason 'SKB_DROP_REASON_PKT_TOO_BIG' is introduced for the case that the length of the packet exceeds MTU and can't fragment. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit 3ae42cc8092be3201093f277ac3b3d62c97a3767 Author: Menglong Dong Date: Wed Apr 13 16:15:54 2022 +0800 net: ipv6: add skb drop reasons to ip6_pkt_drop() Replace kfree_skb() used in ip6_pkt_drop() with kfree_skb_reason(). No new reason is added. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit c4eb664191b4a5ff6856478f903924176697719e Author: Menglong Dong Date: Wed Apr 13 16:15:53 2022 +0800 net: ipv4: add skb drop reasons to ip_error() Eventually, I find out the handler function for inputting route lookup fail: ip_error(). The drop reasons we used in ip_error() are almost corresponding to IPSTATS_MIB_*, and following new reasons are introduced: SKB_DROP_REASON_IP_INADDRERRORS SKB_DROP_REASON_IP_INNOROUTES Isn't the name SKB_DROP_REASON_IP_HOSTUNREACH and SKB_DROP_REASON_IP_NETUNREACH more accurate? To make them corresponding to IPSTATS_MIB_*, we keep their name still. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit d6d3146ce532268ad0ffd8d92d2b7492898decf1 Author: Menglong Dong Date: Wed Apr 13 16:15:52 2022 +0800 skb: add some helpers for skb drop reasons In order to simply the definition and assignment for 'enum skb_drop_reason', introduce some helpers. SKB_DR() is used to define a variable of type 'enum skb_drop_reason' with the 'SKB_DROP_REASON_NOT_SPECIFIED' initial value. SKB_DR_SET() is used to set the value of the variable. Seems it is a little useless? But it makes the code shorter. SKB_DR_OR() is used to set the value of the variable if it is not set yet, which means its value is SKB_DROP_REASON_NOT_SPECIFIED. Signed-off-by: Menglong Dong Reviewed-by: Jiang Biao Reviewed-by: Hao Peng Signed-off-by: David S. Miller commit dba47afdc7d51b22dd9223a391d2b5ceb9bbe30c Merge: 92716869375bd 5cc256e79bff0 Author: David S. Miller Date: Wed Apr 13 12:56:32 2022 +0100 Merge branch 'octeon_ep-driver' Veerasenareddy Burru says: ==================== Add octeon_ep driver This driver implements networking functionality of Marvell's Octeon PCI Endpoint NIC. This driver support following devices: * Network controller: Cavium, Inc. Device b200 V4 -> V5: - Fix warnings reported by clang. - Address comments from community reviews. V3 -> V4: - Fix warnings and errors reported by "make W=1 C=1". V2 -> V3: - Fix warnings and errors reported by kernel test robot: "Reported-by: kernel test robot " V1 -> V2: - Address review comments on original patch series. - Divide PATCH 1/4 from the original series into 4 patches in v2 patch series: PATCH 1/7 to PATCH 4/7. - Fix clang build errors. ==================== Signed-off-by: David S. Miller commit 5cc256e79bff06d299e4416d75786bdc411fa0e6 Author: Veerasenareddy Burru Date: Tue Apr 12 20:35:03 2022 -0700 octeon_ep: add ethtool support for Octeon PCI Endpoint NIC Add support for the following ethtool commands: ethtool -i|--driver devname ethtool devname ethtool -s devname [speed N] [autoneg on|off] [advertise N] ethtool -S|--statistics devname Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 37d79d0596062057f588bdbb2ebad5455a43d353 Author: Veerasenareddy Burru Date: Tue Apr 12 20:35:02 2022 -0700 octeon_ep: add Tx/Rx processing and interrupt support Add support to enable MSI-x and register interrupts. Add support to process Tx and Rx traffic. Includes processing Tx completions and Rx refill. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 6a610a46bad1fd9886d9bf19f4220ecbb7c1b9ef Author: Veerasenareddy Burru Date: Tue Apr 12 20:35:01 2022 -0700 octeon_ep: add support for ndo ops Add support for ndo ops to set MAC address, change MTU, get stats. Add control path support to set MAC address, change MTU, get stats, set speed, get and set link mode. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 397dfb57dcc25f393b32506eeb00600c56fe2444 Author: Veerasenareddy Burru Date: Tue Apr 12 20:35:00 2022 -0700 octeon_ep: add Tx/Rx ring resource setup and cleanup Implement Tx/Rx ring resource allocation and cleanup. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 4ca2fbdd0bb630948d52b9b727dde58783d21e22 Author: Veerasenareddy Burru Date: Tue Apr 12 20:34:59 2022 -0700 octeon_ep: Add mailbox for control commands Add mailbox between host and NIC to send control commands from host to NIC and receive responses and notifications from NIC to host driver, like link status update. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 1f2c2d0cee023ca93299c322e3393af8be234ef8 Author: Veerasenareddy Burru Date: Tue Apr 12 20:34:58 2022 -0700 octeon_ep: add hardware configuration APIs Implement hardware resource init and shutdown helper APIs. This includes hardware Tx/Rx queue init/enable/disable/reset, non queue interrupt handler that decodes non-queue interrupt type. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 862cd659a6fbac664f1fcdd7149046040a7a7e9c Author: Veerasenareddy Burru Date: Tue Apr 12 20:34:57 2022 -0700 octeon_ep: Add driver framework and device initialization Add driver framework and device setup and initialization for Octeon PCI Endpoint NIC. Add implementation to load module, initilaize, register network device, cleanup and unload module. Signed-off-by: Veerasenareddy Burru Signed-off-by: Abhijit Ayarekar Signed-off-by: Satananda Burla Signed-off-by: David S. Miller commit 6494e4f90503cb4027632dfcedcb7a683d829db0 Author: Biju Das Date: Sat Apr 2 09:13:28 2022 +0100 arm64: dts: renesas: rzg2ul-smarc-som: Enable Ethernet on SMARC platform Enable Ethernet{0,1} interfaces on RZ/G2UL SMARC EVK. Ethernet0 pins are muxed with CAN0, CAN1, SSI1 and RSPI1 pins and Ethernet0 device selection is based on the SW1[3] switch position. Set SW1[3] to position OFF for selecting CAN0, CAN1, SSI1 and RSPI1. Set SW1[3] to position ON for selecting Ethernet0. This patch disables Ethernet0 on RZ/G2UL SMARC platform by default. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-8-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ed8efe50b76e751791a9aa4ce1f95fe3d9d794ac Author: Biju Das Date: Sat Apr 2 09:13:27 2022 +0100 arm64: dts: renesas: rzg2ul-smarc-som: Enable eMMC on SMARC platform RZ/G2UL SoM has both 64GB eMMC and microSD connected to SDHI0. Both these interfaces are mutually exclusive and the SD0 device selection is based on SW1[2] on SoM module. Set SW1[2] to position OFF for selecting eMMC Set SW1[2] to position ON for selecting microSD This patch enables eMMC on RZ/G2UL SMARC platform by default. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-7-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a74a0bf3f329415008c1a374118d27023a3d4735 Author: Biju Das Date: Sat Apr 2 09:13:26 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Enable microSD on SMARC platform Enable the microSD card slot connected to SDHI1 on the RZ/G2UL SMARC platform by removing the sdhi1 override which disabled it, and by adding the necessary pinmux required for SDHI1. This patch also adds gpios property to vccq_sdhi1 regulator. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-6-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 13ea8b3584c09f0ab94d5447ff2965d255329a88 Author: Biju Das Date: Sat Apr 2 09:13:25 2022 +0100 arm64: dts: renesas: r9a07g043: Add GbEthernet nodes Add Gigabit Ethernet{0,1} nodes to SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 20e63d3948985672b9e8efa98ff3643d91378e84 Author: Biju Das Date: Sat Apr 2 09:13:24 2022 +0100 arm64: dts: renesas: r9a07g043: Add SDHI nodes Add SDHI{0, 1} nodes to RZ/G2UL SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4e44055440e1fef93e830bd06111bbbb0a89fa44 Author: Biju Das Date: Sat Apr 2 09:13:23 2022 +0100 arm64: dts: renesas: rzg2ul-smarc: Add scif0 and audio clk pins Add scif0 and audio clk pins to soc pinctrl dtsi and drop deleting the pinctrl-0 and pinctrl-names properties for scif0 node so that we now actually make use of these properties for scif0. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 2d10555298576a95b637a5087751d0aad570964d Author: Biju Das Date: Sat Apr 2 09:13:22 2022 +0100 arm64: dts: renesas: r9a07g043: Fillup the pinctrl stub node Fillup the pinctrl(GPIO) stub node in RZ/G2UL SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402081328.26292-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 895199bc4e5261b67b688a915c592dd4c3af113c Author: Biju Das Date: Tue Apr 12 17:13:14 2022 +0100 arm64: dts: renesas: Add initial device tree for RZ/G2UL Type-1 SMARC EVK Add basic support for RZ/G2UL SMARC EVK (based on R9A07G043U11): - memory - External input clock - CPG - DMA - SCIF It shares the same carrier board with RZ/G2L, but the pin mapping is different. Disable the device nodes which are not tested and delete the corresponding pinctrl definitions. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220412161314.13800-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit cf40c9689e5109bf5e4c29038c9f450223aaad2b Author: Biju Das Date: Tue Apr 12 17:13:13 2022 +0100 arm64: dts: renesas: Add initial DTSI for RZ/G2UL SoC Add initial DTSI for RZ/G2UL SoC. Both RZ/G2L and RZ/G2UL uses the same SMARC EVK. Therefore they share the common dtsi (rz-smarc.dtsi) file. Place holders are added in device nodes to avoid compilation errors for the devices which have not been enabled yet on RZ/G2UL SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220412161314.13800-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0faf567d6df616f2f2434ad71250fefe5529d7a0 Merge: f40846e7c9f50 eb2789785428e Author: Geert Uytterhoeven Date: Wed Apr 13 13:56:04 2022 +0200 Merge tag 'renesas-r9a07g043-dt-binding-defs-tag' into HEAD Renesas RZ/G2UL DT Binding Definitions Clock and reset definitions for the Renesas RZ/G2UL (R9A07G043) SoC, shared by driver and DT source files. commit f40846e7c9f50bfbba96d566c63cbdb57b817249 Author: Biju Das Date: Fri Apr 1 18:54:27 2022 +0100 arm64: dts: renesas: rzg2l-smarc: Move gpios property of vccq_sdhi1 from common dtsi On RZ/G2{L,LC} SoM module, gpio for power selection is connected to P39_1 whereas on RZ/G2UL it is connected to P6_1. So move gpios property of vccq_sdhi1 regulator from common dtsi to soc specific dtsi. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220401175427.19078-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 061ba41c7449a9cf4bbf2b6930eb0ded69e5eead Author: Biju Das Date: Fri Apr 1 15:57:02 2022 +0100 arm64: dts: renesas: rzg2lc-smarc: Enable RSPI1 on carrier board RSPI1 (SPI1) interface is available on PMOD0 connector (J1) on the carrier board. This patch adds pinmux and spi1 nodes to the carrier board dtsi file and drops deleting pinctl* properties from DTS file. RSPI1 interface is tested by setting the macro SW_RSPI_CAN to 0. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220401145702.17954-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 79e903fbf43b734badb33723525a84d2ffeb9c8d Author: Geert Uytterhoeven Date: Tue Mar 29 14:20:05 2022 +0200 arm64: dts: renesas: ulcb: Add RPC HyperFlash device node Add the RPC HyperFlash device node along with its partitions to the common ULCB board DTS file. Based on a patch in the BSP by Valentine Barshak. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/61a63e819d4296760ca7ae83ef5226a2c4d7bd93.1648548339.git.geert+renesas@glider.be commit 1ee6674bbe1cd6bd38216be3b7693ef1e5e2eabf Author: Geert Uytterhoeven Date: Tue Mar 29 14:20:04 2022 +0200 arm64: dts: renesas: salvator-common: Add RPC HyperFlash device node Add the RPC HyperFlash device node along with its partitions to the common Salvator-X(S) board DTS file. Based on a patch in the BSP by Valentine Barshak. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/cfc6af8a4c42febcc405b7356c38448eec8e29b0.1648548339.git.geert+renesas@glider.be commit 5f300a7f3953aea5b2ce996a0bdec31ffd108999 Author: Geert Uytterhoeven Date: Tue Mar 29 14:20:03 2022 +0200 arm64: dts: renesas: ebisu: Add RPC HyperFlash device node Add the RPC HyperFlash device node along with its partitions to the common Ebisu board DTS file. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b14c769f62211b67d90dbd2f127357756e6cb4fa.1648548339.git.geert+renesas@glider.be commit a1de91f0ac71cfd3ff3dd630ab560238db05bef6 Author: Geert Uytterhoeven Date: Tue Mar 29 14:20:02 2022 +0200 arm64: dts: renesas: draak: Add RPC HyperFlash device node Add the RPC HyperFlash device node along with its partitions to the common Draak board DTS file. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0f3d3018ecfcdce1bce67708708a6d3a98368b10.1648548339.git.geert+renesas@glider.be commit f191fba76916dc18c41cf6183d71dbf9a1d821c8 Author: Geert Uytterhoeven Date: Tue Mar 29 14:20:01 2022 +0200 arm64: dts: renesas: rcar-gen3: Add RPC device nodes Add device nodes for the SPI Multi I/O Bus Controllers (RPC-IF) on the various R-Car Gen3 SoCs that do not have support for them yet in their device trees (R-Car H3, M3-W, M3-W+, M3-N, E3, and D3). Based on patches in the BSP by Valentine Barshak. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/3231749c7b63df1a2134daabe66446a3e0e5515b.1648548339.git.geert+renesas@glider.be commit b0c07116c894325d40a218f558047f925e4b3bdb Author: Mario Limonciello Date: Mon Apr 11 09:38:20 2022 -0500 platform/x86: amd-pmc: Avoid reading SMU version at probe time Currently the SMU version only used to determine whether the SMU supports reading the idle mask. To speed up startup, move it to the first time the idle mask is read. This decreases the startup time from ~28500us to 100us. Reviewed-by: Hans de Goede Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220411143820.13971-3-mario.limonciello@amd.com Signed-off-by: Hans de Goede commit 63585d5958dacd1f2ac73bff0f1f37a98ba348e4 Author: Mario Limonciello Date: Mon Apr 11 09:38:19 2022 -0500 platform/x86: amd-pmc: Move FCH init to first use FCH address is accessed only when looking at s0ix stats. As this is unnecessary for initialization, move it ito the first time stats are accessed from sysfs. This descrease startup time by about 200us. Reviewed-by: Hans de Goede Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220411143820.13971-2-mario.limonciello@amd.com Signed-off-by: Hans de Goede commit 0c211cecc6af608b5e3137d0d898b08fc7fc14ed Author: Mario Limonciello Date: Mon Apr 11 09:38:18 2022 -0500 platform/x86: amd-pmc: Move SMU logging setup out of init SMU logging is setup when the device is probed currently. In analyzing boot performance it was observed that amd_pmc_probe is taking ~116800us on startup on an OEM platform. This is longer than expected, and is caused by enabling SMU logging at startup. As the SMU logging is only needed for debugging, initialize it only upon use. This decreases the time for amd_pmc_probe to ~28800us. Reviewed-by: Hans de Goede Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220411143820.13971-1-mario.limonciello@amd.com Signed-off-by: Hans de Goede commit 42d17fa78560303ed59176cf53e7a893ef3da518 Author: Jorge Lopez Date: Mon Apr 4 15:36:21 2022 -0500 platform/x86: hp-wmi: Correct code style related issues Update hp-wmi driver to address all code style issues reported by checkpatch.pl script. All changes were validated on a HP ZBook Workstation, HP EliteBook x360, and HP EliteBook 850 G8 notebooks. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220404203626.4311-2-jorge.lopez2@hp.com Signed-off-by: Hans de Goede commit 264e8de27baab1c64e30b962888650032834b52a Author: Jakob Koschel Date: Thu Mar 24 08:20:15 2022 +0100 platform/x86: wmi: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324072015.62063-1-jakobkoschel@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 34354476f06dad3c126cc8774d31fbed20294c38 Author: Daniel Beer Date: Mon Mar 21 16:16:27 2022 +1300 platform/x86: winmate-fm07-keys: Winmate FM07/FM07P buttons Winmate FM07 and FM07P in-vehicle computers have a row of five buttons below the display. This module adds an input device that delivers key events when these buttons are pressed. Signed-off-by: Daniel Beer Link: https://lore.kernel.org/r/623a110a.1c69fb81.64f39.0118@mx.google.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 92716869375bdec958900281ce011b611384eb07 Merge: ae10162c7e0b1 0dbe886a4d8da Author: David S. Miller Date: Wed Apr 13 12:46:26 2022 +0100 Merge branch 'br-flush-filtering' Nikolay Aleksandrov says: ==================== net: bridge: add flush filtering support This patch-set adds support to specify filtering conditions for a bulk delete (flush) operation. This version uses a new nlmsghdr delete flag called NLM_F_BULK in combination with a new ndo_fdb_del_bulk op which is used to signal that the driver supports bulk deletes (that avoids pushing common mac address checks to ndo_fdb_del implementations and also has a different prototype and parsed attribute expectations, more info in patch 03). The new delete flag can be used for any RTM_DEL* type, implementations just need to be careful with older kernels which are doing non-strict attribute parses. A new rtnl flag (RTNL_FLAG_BULK_DEL_SUPPORTED) is used to show that the delete supports NLM_F_BULK. A proper error is returned if bulk delete is not supported. For old kernels I use the fact that mac address attribute (lladdr) is mandatory in the classic fdb del case, but it's not allowed if bulk deleting so older kernels will error out. Patch 01 and 02 are minor rtnetlink cleanups to make the code easier to read. They remove hardcoded values and use names instead. Patch 03 uses BIT() for rtnl flags. Patch 04 adds the new NLM_F_BULK delete request modifier, patch 05 adds the new bulk delete flag and checks for it if the delete requests have NLM_F_BULK set, it also warns if rtnl register is called with a non-delete kind and the bulk delete flag is set. Patch 06 adds the new ndo_fdb_del_bulk call. Patch 07 adds NLM_F_BULK support to rtnl_fdb_del, on such request strict parsing is used only for the supported attributes, and if the ndo is implemented it's called, the NTF_SELF/MASTER rules are the same as for the standard rtnl_fdb_del. Patch 08 implements bridge-specific minimal ndo_fdb_del_bulk call which uses the current br_fdb_flush to delete all entries. Patch 09 adds filtering support to the new bridge flush op which supports target ifindex (port or bridge), vlan id and flags/state mask. Patch 10 adds ndm state and flags mask attributes which will be used for filtering. Patch 11 converts ndm state/flags and their masks to bridge-private flags and fills them in the filter descriptor for matching. Finally patch 12 fills in the target ifindex (after validating it) and vlan id (already validated by rtnl_fdb_flush) for matching. Flush filtering is needed because user-space applications need a quick way to delete only a specific set of entries, e.g. mlag implementations need a way to flush only dynamic entries excluding externally learned ones or only externally learned ones without static entries etc. Also apps usually want to target only a specific vlan or port/vlan combination. The current 2 flush operations (per port and bridge-wide) are not extensible and cannot provide such filtering. I decided against embedding new attrs into the old flush attributes for multiple reasons - proper error handling on unsupported attributes, older kernels silently flushing all, need for a second mechanism to signal that the attribute should be parsed (e.g. using boolopts), special treatment for permanent entries. Examples: $ bridge fdb flush dev bridge vlan 100 static < flush all static entries on vlan 100 > $ bridge fdb flush dev bridge vlan 1 dynamic < flush all dynamic entries on vlan 1 > $ bridge fdb flush dev bridge port ens16 vlan 1 dynamic < flush all dynamic entries on port ens16 and vlan 1 > $ bridge fdb flush dev ens16 vlan 1 dynamic master < as above: flush all dynamic entries on port ens16 and vlan 1 > $ bridge fdb flush dev bridge nooffloaded nopermanent self < flush all non-offloaded and non-permanent entries > $ bridge fdb flush dev bridge static noextern_learn < flush all static entries which are not externally learned > $ bridge fdb flush dev bridge permanent < flush all permanent entries > $ bridge fdb flush dev bridge port bridge permanent < flush all permanent entries pointing to the bridge itself > Example of a flush call with unsupported netlink attribute (NDA_DST): $ bridge fdb flush dev bridge vlan 100 dynamic dst Error: Unsupported attribute. Example of a flush call on an older kernel: $ bridge fdb flush dev bridge dynamic Error: invalid address. Example of calling PF_UNSPEC RTM_DELNEIGH which doesn't support bulk delete with NLM_F_BULK set (ip neigh is changed to add the flag): $ ip n del 192.168.122.5 lladdr 00:11:22:33:44:55 dev ens3 Error: Bulk delete is not supported. Note that all flags have their negated version (static vs nostatic etc) and there are some tricky cases to handle like "static" which in flag terms means fdbs that have NUD_NOARP but *not* NUD_PERMANENT, so the mask matches on both but we need only NUD_NOARP to be set. That's because permanent entries have both set so we can't just match on NUD_NOARP. Also note that this flush operation doesn't treat permanent entries in a special way (fdb_delete vs fdb_delete_local), it will delete them regardless if any port is using them. We can extend the api with a flag to do that if needed in the future. Patch-sets (in order): - Initial bulk del infra and fdb flush filtering (this set) - iproute2 support - selftests v4: Add and check for rtnl del bulk supported flag when using NLM_F_BULK (new patch 05), patches 01 - 03 are also new minor cleanups to remove use of raw values and make code easier to read, don't rename br_fdb_flush in patch 08, set port ifindex as flush target if NDA_IFINDEX is missing and flush was called with port netdev and NTF_MASTER (patch 12). v3: Add NLM_F_BULK delete modifier and ndo_fdb_del_bulk callback, patches 01 - 03 and 06 are new. Patch 04 is changed to implement bulk_del instead of flush, patches 05, 07 and 08 are adjusted to use NDA_ attributes ==================== Signed-off-by: David S. Miller commit 0dbe886a4d8da1852b1ece67808d0bead74b1244 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:52:02 2022 +0300 net: bridge: fdb: add support for flush filtering based on ifindex and vlan Add support for fdb flush filtering based on destination ifindex and vlan id. The ifindex must either match a port's device ifindex or the bridge's. The vlan support is trivial since it's already validated by rtnl_fdb_del, we just need to fill it in. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 564445fb4f0f7f3764320966a3d1e7c2711fd256 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:52:01 2022 +0300 net: bridge: fdb: add support for flush filtering based on ndm flags and state Add support for fdb flush filtering based on ndm flags and state. NDM state and flags are mapped to bridge-specific flags and matched according to the specified masks. NTF_USE is used to represent added_by_user flag since it sets it on fdb add and we don't have a 1:1 mapping for it. Only allowed bits can be set, NTF_SELF and NTF_MASTER are ignored. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit ea2c0f9e3fc2f94f090d693b7235c02af1289629 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:52:00 2022 +0300 net: rtnetlink: add ndm flags and state mask attributes Add ndm flags/state masks which will be used for bulk delete filtering. All of these are used by the bridge and vxlan drivers. Also minimal attr policy validation is added, it is up to ndo_fdb_del_bulk implementers to further validate them. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 1f78ee14eeac03952ec765cea7ce23cbf12d6894 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:59 2022 +0300 net: bridge: fdb: add support for fine-grained flushing Add the ability to specify exactly which fdbs to be flushed. They are described by a new structure - net_bridge_fdb_flush_desc. Currently it can match on port/bridge ifindex, vlan id and fdb flags. It is used to describe the existing dynamic fdb flush operation. Note that this flush operation doesn't treat permanent entries in a special way (fdb_delete vs fdb_delete_local), it will delete them regardless if any port is using them, so currently it can't directly replace deletes which need to handle that case, although we can extend it later for that too. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit edaef191722439591bfba75b4e5650bfd39c9123 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:58 2022 +0300 net: bridge: fdb: add ndo_fdb_del_bulk Add a minimal ndo_fdb_del_bulk implementation which flushes all entries. Support for more fine-grained filtering will be added in the following patches. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 9e83425993f38bb89e0ea07849ba0039a748e85b Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:57 2022 +0300 net: rtnetlink: add NLM_F_BULK support to rtnl_fdb_del When NLM_F_BULK is specified in a fdb del message we need to handle it differently. First since this is a new call we can strictly validate the passed attributes, at first only ifindex and vlan are allowed as these will be the initially supported filter attributes, any other attribute is rejected. The mac address is no longer mandatory, but we use it to error out in older kernels because it cannot be specified with bulk request (the attribute is not allowed) and then we have to dispatch the call to ndo_fdb_del_bulk if the device supports it. The del bulk callback can do further validation of the attributes if necessary. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 1306d5362a591493a2d07f685ed2cc480dcda320 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:56 2022 +0300 net: add ndo_fdb_del_bulk Add a new netdev op called ndo_fdb_del_bulk, it will be later used for driver-specific bulk delete implementation dispatched from rtnetlink. The first user will be the bridge, we need it to signal to rtnetlink from the driver that we support bulk delete operation (NLM_F_BULK). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit a6cec0bcd34264be8887791594be793b3f12719f Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:55 2022 +0300 net: rtnetlink: add bulk delete support flag Add a new rtnl flag (RTNL_FLAG_BULK_DEL_SUPPORTED) which is used to verify that the delete operation allows bulk object deletion. Also emit a warning if anyone tries to set it for non-delete kind. Suggested-by: David Ahern Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 545528d788556c724eeb5400757f828ef27782a8 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:54 2022 +0300 net: netlink: add NLM_F_BULK delete request modifier Add a new delete request modifier called NLM_F_BULK which, when supported, would cause the request to delete multiple objects. The flag is a convenient way to signal that a multiple delete operation is requested which can be gradually added to different delete requests. In order to make sure older kernels will error out if the operation is not supported instead of doing something unintended we have to break a required condition when implementing support for this flag, f.e. for neighbors we will omit the mandatory mac address attribute. Initially it will be used to add flush with filtering support for bridge fdbs, but it also opens the door to add similar support to others. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 0569e31f1bc2f50613ba4c219f3ecc0d1174d841 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:53 2022 +0300 net: rtnetlink: use BIT for flag values Use BIT to define flag values. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 2e9ea3e30f696fd438319c07836422bb0bbb4608 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:52 2022 +0300 net: rtnetlink: add helper to extract msg type's kind Add a helper which extracts the msg type's kind using the kind mask (0x3). Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 12dc5c2cb7b269c5a1c6d02844f40bfce942a7a6 Author: Nikolay Aleksandrov Date: Wed Apr 13 13:51:51 2022 +0300 net: rtnetlink: add msg kind names Add rtnl kind names instead of using raw values. We'll need to check for DEL kind later to validate bulk flag support. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit ccc0dd722e66daac9d31d7c584f6c2ceabf6c493 Author: Wolfram Sang Date: Tue Mar 22 10:55:12 2022 +0100 arm64: dts: renesas: rcar-gen4: Add interrupt properties to watchdog nodes Driver doesn't use it yet, but let's describe the HW properly. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220322095512.4707-6-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 7ac8afba2257f08e95ef7d0e3ed2ac47cad9195b Author: Wolfram Sang Date: Tue Mar 22 10:55:11 2022 +0100 arm64: dts: renesas: rzg2: Add interrupt properties to watchdog nodes Driver doesn't use it yet, but let's describe the HW properly. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220322095512.4707-5-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 2bc0aa18ee9f34613876f6ac7bf944ad65d63e17 Author: Wolfram Sang Date: Tue Mar 22 10:55:10 2022 +0100 arm64: dts: renesas: rcar-gen3: Add interrupt properties to watchdog nodes Driver doesn't use it yet, but let's describe the HW properly. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220322095512.4707-4-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit cb97d4855589ec097fd385a4068f21ba92373a88 Author: Wolfram Sang Date: Tue Mar 22 10:55:09 2022 +0100 ARM: dts: rzg1: Add interrupt properties to watchdog nodes Driver doesn't use it yet, but let's describe the HW properly. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220322095512.4707-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 2e4d5fd6f58af8319273a8a7253e0dff2a3e17c1 Author: Wolfram Sang Date: Tue Mar 22 10:55:08 2022 +0100 ARM: dts: rcar-gen2: Add interrupt properties to watchdog nodes Driver doesn't use it yet, but let's describe the HW properly. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220322095512.4707-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit ae10162c7e0b1a55e6ef78e4c3e2a30c7e7b0435 Merge: 1a95e04e29a11 127c9e970f59e Author: David S. Miller Date: Wed Apr 13 12:42:40 2022 +0100 Merge branch 'net-ti-storm-prevention-support' Grygorii Strashko says: ==================== net: ethernet: ti: enable bc/mc storm prevention support This series first adds supports for the ALE feature to rate limit number ingress broadcast(BC)/multicast(MC) packets per/sec which main purpose is BC/MC storm prevention. And then enables corresponding support for ingress broadcast(BC)/multicast(MC) packets rate limiting for TI CPSW switchdev and AM65x/J221E CPSW_NUSS drivers by implementing HW offload for simple tc-flower with policer action with matches on dst_mac/mask: - ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff has to be used for BC packets rate limiting (exact match) - 01:00:00:00:00:00/01:00:00:00:00:00 fixed value has to be used for MC packets rate limiting The CPSW supports MC/BC packets rate limiting in packets/sec and affects all ingress MC/BC packets and serves as BC/MC storm prevention feature. Examples: - BC rate limit to 1000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \ action police pkts_rate 1000 pkts_burst 1 drop - MC rate limit to 20000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 \ action police rate pkts_rate 20000 pkts_burst 1 drop pkts_burst - not used. The solution inspired patch from Vladimir Oltean [1]. Changes in v3: - comments applied - policer validation added Changes in v2: - switch to packet-per-second policing introduced by commit 2ffe0395288a ("net/sched: act_police: add support for packet-per-second policing") [2] v2: https://patchwork.kernel.org/project/netdevbpf/cover/20211101170122.19160-1-grygorii.strashko@ti.com/ v1: https://patchwork.kernel.org/project/netdevbpf/cover/20201114035654.32658-1-grygorii.strashko@ti.com/ [1] https://lore.kernel.org/patchwork/patch/1217254/ [2] https://patchwork.kernel.org/project/netdevbpf/cover/20210312140831.23346-1-simon.horman@netronome.com/ ==================== Signed-off-by: David S. Miller commit 127c9e970f59edaaaa7a7134e55752314c9691da Author: Grygorii Strashko Date: Tue Apr 12 13:29:29 2022 +0300 net: ethernet: ti: cpsw_new: enable bc/mc storm prevention support This patch enables support for ingress broadcast(BC)/multicast(MC) packets rate limiting in TI CPSW switchdev driver (the corresponding ALE support was added in previous patch) by implementing HW offload for simple tc-flower with policer action with matches on dst_mac: - ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff has to be used for BC packets rate limiting (exact match) - 01:00:00:00:00:00/01:00:00:00:00:00 fixed value has to be used for MC packets rate limiting The CPSW supports MC/BC packets rate limiting in packets/sec and affects all ingress MC/BC packets and serves as BC/MC storm prevention feature. Examples: - BC rate limit to 1000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \ action police pkts_rate 1000 pkts_burst 1 drop - MC rate limit to 20000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 \ action police rate pkts_rate 10000 pkts_burst 1 drop pkts_burst - not used. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 5ec836be11b3f7dfbdeaee8dd86137f134df6f6f Author: Grygorii Strashko Date: Tue Apr 12 13:29:28 2022 +0300 net: ethernet: ti: am65-cpsw: enable bc/mc storm prevention support This patch enables support for ingress broadcast(BC)/multicast(MC) packets rate limiting in TI AM65x CPSW driver (the corresponding ALE support was added in previous patch) by implementing HW offload for simple tc-flower with policer action with matches on dst_mac/mask: - ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff has to be used for BC packets rate limiting (exact match) - 01:00:00:00:00:00/01:00:00:00:00:00 fixed value has to be used for MC packets rate limiting The CPSW supports MC/BC packets rate limiting in packets/sec and affects all ingress MC/BC packets and serves as BC/MC storm prevention feature. Examples: - BC rate limit to 1000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \ action police pkts_rate 1000 pkts_burst 1 drop - MC rate limit to 20000pps: tc qdisc add dev eth0 clsact tc filter add dev eth0 ingress flower skip_sw dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 \ action police rate pkts_rate 20000 pkts_burst 1 drop pkts_burst - not used. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit e3a5e33fae99b69d72296b2c6afea1db4a397779 Author: Grygorii Strashko Date: Tue Apr 12 13:29:27 2022 +0300 drivers: net: cpsw: ale: add broadcast/multicast rate limit support The CPSW ALE supports feature to rate limit number ingress broadcast(BC)/multicast(MC) packets per/sec which main purpose is BC/MC storm prevention. The ALE BC/MC packet rate limit configuration consist of two parts: - global ALE_CONTROL.ENABLE_RATE_LIMIT bit 0 which enables rate limiting globally ALE_PRESCALE.PRESCALE specifies rate limiting interval - per-port ALE_PORTCTLx.BCASTMCAST/_LIMIT specifies number of BC/MC packets allowed per rate limiting interval. When port.BCASTMCAST/_LIMIT is 0 rate limiting is disabled for Port. When BC/MC packet rate limiting is enabled the number of allowed packets per/sec is defined as: number_of_packets/sec = (Fclk / ALE_PRESCALE) * port.BCASTMCAST/_LIMIT Hence, the ALE_PRESCALE configuration is common for all ports the 1ms interval is selected and configured during ALE initialization while port.BCAST/MCAST_LIMIT are configured per-port. This allows to achieve: - min number_of_packets = 1000 when port.BCAST/MCAST_LIMIT = 1 - max number_of_packets = 1000 * 255 = 255000 when port.BCAST/MCAST_LIMIT = 0xFF The ALE_CONTROL.ENABLE_RATE_LIMIT can also be enabled once during ALE initialization as rate limiting enabled by non zero port.BCASTMCAST/_LIMIT values. This patch implements above logic in ALE and adds new ALE APIs cpsw_ale_rx_ratelimit_bc(); cpsw_ale_rx_ratelimit_mc(); Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 1a95e04e29a116c3424988c70c441ca8ec2779ff Author: Russell King (Oracle) Date: Tue Apr 12 11:24:00 2022 +0100 net: phylink: remove phylink_helper_basex_speed() As there are now no users of phylink_helper_basex_speed(), we can remove this obsolete functionality. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 17a5f6a78dc7b8db385de346092d7d9f9dc24df6 Author: Dan Carpenter Date: Tue Apr 12 12:24:19 2022 +0300 net: ethernet: mtk_eth_soc: use after free in __mtk_ppe_check_skb() The __mtk_foe_entry_clear() function frees "entry" so we have to use the _safe() version of hlist_for_each_entry() to prevent a use after free. Fixes: 33fc42de3327 ("net: ethernet: mtk_eth_soc: support creating mac address based offload entries") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 2240514cb6441641111ac1fabab03e9df9972d7f Author: Minghao Chi Date: Tue Apr 12 09:05:15 2022 +0000 net: ethernet: ti: am65-cpsw-nuss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller commit 1b0e81416a24d6e9b8c2341e22e8bf48f8b8bfc9 Author: Lin Ma Date: Tue Apr 12 13:32:08 2022 +0800 NFC: NULL out the dev->rfkill to prevent UAF Commit 3e3b5dfcd16a ("NFC: reorder the logic in nfc_{un,}register_device") assumes the device_is_registered() in function nfc_dev_up() will help to check when the rfkill is unregistered. However, this check only take effect when device_del(&dev->dev) is done in nfc_unregister_device(). Hence, the rfkill object is still possible be dereferenced. The crash trace in latest kernel (5.18-rc2): [ 68.760105] ================================================================== [ 68.760330] BUG: KASAN: use-after-free in __lock_acquire+0x3ec1/0x6750 [ 68.760756] Read of size 8 at addr ffff888009c93018 by task fuzz/313 [ 68.760756] [ 68.760756] CPU: 0 PID: 313 Comm: fuzz Not tainted 5.18.0-rc2 #4 [ 68.760756] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 68.760756] Call Trace: [ 68.760756] [ 68.760756] dump_stack_lvl+0x57/0x7d [ 68.760756] print_report.cold+0x5e/0x5db [ 68.760756] ? __lock_acquire+0x3ec1/0x6750 [ 68.760756] kasan_report+0xbe/0x1c0 [ 68.760756] ? __lock_acquire+0x3ec1/0x6750 [ 68.760756] __lock_acquire+0x3ec1/0x6750 [ 68.760756] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 68.760756] ? register_lock_class+0x18d0/0x18d0 [ 68.760756] lock_acquire+0x1ac/0x4f0 [ 68.760756] ? rfkill_blocked+0xe/0x60 [ 68.760756] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 68.760756] ? mutex_lock_io_nested+0x12c0/0x12c0 [ 68.760756] ? nla_get_range_signed+0x540/0x540 [ 68.760756] ? _raw_spin_lock_irqsave+0x4e/0x50 [ 68.760756] _raw_spin_lock_irqsave+0x39/0x50 [ 68.760756] ? rfkill_blocked+0xe/0x60 [ 68.760756] rfkill_blocked+0xe/0x60 [ 68.760756] nfc_dev_up+0x84/0x260 [ 68.760756] nfc_genl_dev_up+0x90/0xe0 [ 68.760756] genl_family_rcv_msg_doit+0x1f4/0x2f0 [ 68.760756] ? genl_family_rcv_msg_attrs_parse.constprop.0+0x230/0x230 [ 68.760756] ? security_capable+0x51/0x90 [ 68.760756] genl_rcv_msg+0x280/0x500 [ 68.760756] ? genl_get_cmd+0x3c0/0x3c0 [ 68.760756] ? lock_acquire+0x1ac/0x4f0 [ 68.760756] ? nfc_genl_dev_down+0xe0/0xe0 [ 68.760756] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 68.760756] netlink_rcv_skb+0x11b/0x340 [ 68.760756] ? genl_get_cmd+0x3c0/0x3c0 [ 68.760756] ? netlink_ack+0x9c0/0x9c0 [ 68.760756] ? netlink_deliver_tap+0x136/0xb00 [ 68.760756] genl_rcv+0x1f/0x30 [ 68.760756] netlink_unicast+0x430/0x710 [ 68.760756] ? memset+0x20/0x40 [ 68.760756] ? netlink_attachskb+0x740/0x740 [ 68.760756] ? __build_skb_around+0x1f4/0x2a0 [ 68.760756] netlink_sendmsg+0x75d/0xc00 [ 68.760756] ? netlink_unicast+0x710/0x710 [ 68.760756] ? netlink_unicast+0x710/0x710 [ 68.760756] sock_sendmsg+0xdf/0x110 [ 68.760756] __sys_sendto+0x19e/0x270 [ 68.760756] ? __ia32_sys_getpeername+0xa0/0xa0 [ 68.760756] ? fd_install+0x178/0x4c0 [ 68.760756] ? fd_install+0x195/0x4c0 [ 68.760756] ? kernel_fpu_begin_mask+0x1c0/0x1c0 [ 68.760756] __x64_sys_sendto+0xd8/0x1b0 [ 68.760756] ? lockdep_hardirqs_on+0xbf/0x130 [ 68.760756] ? syscall_enter_from_user_mode+0x1d/0x50 [ 68.760756] do_syscall_64+0x3b/0x90 [ 68.760756] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 68.760756] RIP: 0033:0x7f67fb50e6b3 ... [ 68.760756] RSP: 002b:00007f67fa91fe90 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 68.760756] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f67fb50e6b3 [ 68.760756] RDX: 000000000000001c RSI: 0000559354603090 RDI: 0000000000000003 [ 68.760756] RBP: 00007f67fa91ff00 R08: 00007f67fa91fedc R09: 000000000000000c [ 68.760756] R10: 0000000000000000 R11: 0000000000000293 R12: 00007ffe824d496e [ 68.760756] R13: 00007ffe824d496f R14: 00007f67fa120000 R15: 0000000000000003 [ 68.760756] [ 68.760756] [ 68.760756] Allocated by task 279: [ 68.760756] kasan_save_stack+0x1e/0x40 [ 68.760756] __kasan_kmalloc+0x81/0xa0 [ 68.760756] rfkill_alloc+0x7f/0x280 [ 68.760756] nfc_register_device+0xa3/0x1a0 [ 68.760756] nci_register_device+0x77a/0xad0 [ 68.760756] nfcmrvl_nci_register_dev+0x20b/0x2c0 [ 68.760756] nfcmrvl_nci_uart_open+0xf2/0x1dd [ 68.760756] nci_uart_tty_ioctl+0x2c3/0x4a0 [ 68.760756] tty_ioctl+0x764/0x1310 [ 68.760756] __x64_sys_ioctl+0x122/0x190 [ 68.760756] do_syscall_64+0x3b/0x90 [ 68.760756] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 68.760756] [ 68.760756] Freed by task 314: [ 68.760756] kasan_save_stack+0x1e/0x40 [ 68.760756] kasan_set_track+0x21/0x30 [ 68.760756] kasan_set_free_info+0x20/0x30 [ 68.760756] __kasan_slab_free+0x108/0x170 [ 68.760756] kfree+0xb0/0x330 [ 68.760756] device_release+0x96/0x200 [ 68.760756] kobject_put+0xf9/0x1d0 [ 68.760756] nfc_unregister_device+0x77/0x190 [ 68.760756] nfcmrvl_nci_unregister_dev+0x88/0xd0 [ 68.760756] nci_uart_tty_close+0xdf/0x180 [ 68.760756] tty_ldisc_kill+0x73/0x110 [ 68.760756] tty_ldisc_hangup+0x281/0x5b0 [ 68.760756] __tty_hangup.part.0+0x431/0x890 [ 68.760756] tty_release+0x3a8/0xc80 [ 68.760756] __fput+0x1f0/0x8c0 [ 68.760756] task_work_run+0xc9/0x170 [ 68.760756] exit_to_user_mode_prepare+0x194/0x1a0 [ 68.760756] syscall_exit_to_user_mode+0x19/0x50 [ 68.760756] do_syscall_64+0x48/0x90 [ 68.760756] entry_SYSCALL_64_after_hwframe+0x44/0xae This patch just add the null out of dev->rfkill to make sure such dereference cannot happen. This is safe since the device_lock() already protect the check/write from data race. Fixes: 3e3b5dfcd16a ("NFC: reorder the logic in nfc_{un,}register_device") Signed-off-by: Lin Ma Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 5ee6ad1dcae8be7c101d1ffb2bbf4a01670e66cc Author: Guo Zhengkui Date: Tue Apr 12 11:20:58 2022 +0800 ipv6: exthdrs: use swap() instead of open coding it Address the following coccicheck warning: net/ipv6/exthdrs.c:620:44-45: WARNING opportunity for swap() by using swap() for the swapping of variable values and drop the tmp (`addr`) variable that is not needed any more. Signed-off-by: Guo Zhengkui Signed-off-by: David S. Miller commit 816cda9ae531b27c30356a673e8dc9f037cd90d1 Author: Alaa Mohamed Date: Tue Apr 12 04:04:31 2022 +0200 selftests: net: fib_rule_tests: add support to select a test to run Add boilerplate test loop in test to run all tests in fib_rule_tests.sh Signed-off-by: Alaa Mohamed Signed-off-by: David S. Miller commit 4263f77a5144f708a00aa8e9570b392777ab2482 Author: Lorenzo Bianconi Date: Mon Apr 11 12:13:25 2022 +0200 net: ethernet: mtk_eth_soc: use standard property for cci-control-port Rely on standard cci-control-port property to identify CCI port reference. Update mt7622 dts binding. Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 17e415cf6aa9f0fc4a1f556287fe9bd37a9f4fc3 Merge: 8f1c385078594 a941d5ee4c579 Author: David S. Miller Date: Wed Apr 13 11:57:55 2022 +0100 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2022-04-12 This series contains updates to i40e and ice drivers. Joe Damato adds TSO support for MPLS packets on i40e and ice drivers. He also adds tracking and reporting of tx_stopped statistic for i40e. Nabil S. Alramli adds reporting of tx_restart to ethtool for i40e. Mateusz adds new device id support for i40e. ==================== Signed-off-by: David S. Miller commit 8f1c385078594c2eabda813ad1d7145bfac36345 Merge: f45ba67eb74ab a4ae58cdb6e8e Author: David S. Miller Date: Wed Apr 13 11:45:39 2022 +0100 Merge branch 'tls-rx-refactor-part-3' Jakub Kicinski says: ==================== tls: rx: random refactoring part 3 TLS Rx refactoring. Part 3 of 3. This set is mostly around rx_list and async processing. The last two patches are minor optimizations. A couple of features to follow. ==================== Signed-off-by: David S. Miller commit a4ae58cdb6e8ed6b00428f65515d5948e1b56deb Author: Jakub Kicinski Date: Mon Apr 11 12:19:17 2022 -0700 tls: rx: only copy IV from the packet for TLS 1.2 TLS 1.3 and ChaChaPoly don't carry IV in the packet. The code before this change would copy out iv_size worth of whatever followed the TLS header in the packet and then for TLS 1.3 | ChaCha overwrite that with the sequence number. Waste of cycles especially with TLS 1.2 being close to dead and TLS 1.3 being the common case. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit f7d45f4b52fe259c152139f1f6b2f80474b7b96f Author: Jakub Kicinski Date: Mon Apr 11 12:19:16 2022 -0700 tls: rx: use MAX_IV_SIZE for allocations IVs are 8 or 16 bytes, no point reading out the exact value for quantities this small. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 3547a1f9d988d88ecff4fc365d2773037c849f49 Author: Jakub Kicinski Date: Mon Apr 11 12:19:15 2022 -0700 tls: rx: use async as an in-out argument Propagating EINPROGRESS thru multiple layers of functions is error prone. Use darg->async as an in/out argument, like we use darg->zc today. On input it tells the code if async is allowed, on output if it took place. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit f314bfee81b1bf8e01168177b2f65f24eb8da63a Author: Jakub Kicinski Date: Mon Apr 11 12:19:14 2022 -0700 tls: rx: return the already-copied data on crypto error async crypto handler will report the socket error no need to report it again. We can, however, let the data we already copied be reported to user space but we need to make sure the error will be reported next time around. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4dcdd971b9c7a5c38f65d81f7c548fea2e337373 Author: Jakub Kicinski Date: Mon Apr 11 12:19:13 2022 -0700 tls: rx: treat process_rx_list() errors as transient process_rx_list() only fails if it can't copy data to user space. There is no point recording the error onto sk->sk_err or giving up on the data which was read partially. Treat the return value like a normal socket partial read. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 1c699ffa48a15710746989c36a82cbfb07e8d17f Author: Jakub Kicinski Date: Mon Apr 11 12:19:12 2022 -0700 tls: rx: assume crypto always calls our callback If crypto didn't always invoke our callback for async we'd not be clearing skb->sk and would crash in the skb core when freeing it. This if must be dead code. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 72f3ad73bc866a53340cce6a0ad500d29295a8b8 Author: Jakub Kicinski Date: Mon Apr 11 12:19:11 2022 -0700 tls: rx: don't handle TLS 1.3 in the async crypto callback Async crypto never worked with TLS 1.3 and was explicitly disabled in commit 8497ded2d16c ("net/tls: Disable async decrytion for tls1.3"). There's no need for us to handle TLS 1.3 padding in the async cb. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 284b4d93daee56dff3e10029ddf2e03227f50dbf Author: Jakub Kicinski Date: Mon Apr 11 12:19:10 2022 -0700 tls: rx: move counting TlsDecryptErrors for sync Move counting TlsDecryptErrors to tls_do_decryption() where differences between sync and async crypto are reconciled. No functional changes, this code just always gave me a pause. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0775639ce1ca953503121e350d6b885366f56a52 Author: Jakub Kicinski Date: Mon Apr 11 12:19:09 2022 -0700 tls: rx: reuse leave_on_list label for psock The code is identical, we can save a few LoC. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit a30295c454725b293c7b2f45f6e60fcce0bc435e Author: Jakub Kicinski Date: Mon Apr 11 12:19:08 2022 -0700 tls: rx: consistently use unlocked accessors for rx_list rx_list is protected by the socket lock, no need to take the built-in spin lock on accesses. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 59086e4193f4fc920a23d2045a473f62450b4269 Author: Biju Das Date: Sat Apr 2 08:46:26 2022 +0100 clk: renesas: r9a07g043: Add SDHI clock and reset entries Add SDHI{0,1} mux, clock and reset entries to CPG driver Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402074626.25624-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e11f804afc12e1c622f0a6f966fafd05b7022f8a Author: Biju Das Date: Sat Apr 2 08:46:25 2022 +0100 clk: renesas: r9a07g043: Add GbEthernet clock/reset Add ETH{0,1} clock/reset entries to CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402074626.25624-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f201eb84450f98decb1834e73409bb2271441dd7 Author: Biju Das Date: Sat Apr 2 08:46:24 2022 +0100 clk: renesas: r9a07g043: Add ethernet clock sources Ethernet reference clock can be sourced from PLL5_500 or PLL6. Add support for ethernet source clock selection using SEL_PLL_6_2 mux. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402074626.25624-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6c185664b3d481292c41fbfe66ea19c84cb0237a Author: Biju Das Date: Sat Apr 2 08:46:23 2022 +0100 clk: renesas: r9a07g043: Add GPIO clock and reset entries Add GPIO clock and reset entries in CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220402074626.25624-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c8b088224c25ef4f5270f9de6a3516181b63f38c Author: Biju Das Date: Tue Apr 12 17:13:12 2022 +0100 clk: renesas: Add support for RZ/G2UL SoC The clock structure for RZ/G2UL is almost identical to RZ/G2L SoC with fewer IP blocks. The IP blocks such as WDT1, GPT, H264, GPU and POEG are not present on RZ/G2UL. This patch adds minimal clock and reset entries required to boot the system on Renesas RZ/G2UL SMARC EVK and binds it with the RZ/G2L CPG core driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220412161314.13800-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 948f592433f87f8b9c38d43995478eb4561b8629 Merge: 880c3fa319b24 eb2789785428e Author: Geert Uytterhoeven Date: Wed Apr 13 12:28:47 2022 +0200 Merge tag 'renesas-r9a07g043-dt-binding-defs-tag' into renesas-clk-for-v5.19 Renesas RZ/G2UL DT Binding Definitions Clock and reset definitions for the Renesas RZ/G2UL (R9A07G043) SoC, shared by driver and DT source files. commit 880c3fa319b24c1a8ccb4dfc171a3329ad14943a Author: Geert Uytterhoeven Date: Mon Apr 11 14:59:44 2022 +0200 clk: renesas: Move RPC core clocks The RPC and RPCD2 core clocks were added to the sections for internal core clocks, while they are core clock outputs, visible from DT. Move them to the correct sections. Rename the ".rpc" clock on R-Car S4 to "rpc". Fixup nearby whitespace to increase uniformity. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/a938b938f00939b9206d7fbaba78e2ef09915f5f.1649681891.git.geert+renesas@glider.be commit 29db30c45f07c929c86c40a5b85f18b69c89c638 Author: Geert Uytterhoeven Date: Mon Feb 21 17:25:20 2022 +0100 clk: renesas: rzg2l: Simplify multiplication/shift logic "a * (1 << b)" == "a << b". No change in generated code. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/71e1cf2e30fb2d7966fc8ec6bab23eb7e24aa1c4.1645460687.git.geert+renesas@glider.be commit eb2789785428e2dbc3d5f413b16c67ff90d828c1 Author: Biju Das Date: Sat Apr 2 08:30:34 2022 +0100 dt-bindings: clock: Add R9A07G043 CPG Clock and Reset Definitions Define RZ/G2UL (R9A07G043U) Clock Pulse Generator Core Clock and module clock outputs, as listed in Table 7.1.4.2 ("Clock List r0.51") and also add Reset definitions referring to registers CPG_RST_* in Section 7.2.3 ("Register configuration") of the RZ/G2UL Hardware User's Manual (Rev. 0.51, Nov. 2021). Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220402073037.23947-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 05d39fc06cee5b11b195d0d5fec55d01da2781cb Author: Biju Das Date: Sat Apr 2 08:32:34 2022 +0100 dt-bindings: arm: renesas: Document Renesas RZ/G2UL SMARC EVK Document the Renesas SMARC EVK board which is based on the Renesas RZ/G2UL Type-1 (R9A07G043U11) SoC. The SMARC EVK consists of an RZ/G2UL Type-1 SoM module and a SMARC carrier board. The SoM module sits on top of the carrier board. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20220402073234.24625-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e72659b69f0650f8f0e7e1587e5f261d2a431697 Author: Swapnil Jakhade Date: Thu Mar 3 06:50:26 2022 +0100 phy: cadence: Sierra: Add TI J721E specific PCIe multilink lane configuration This patch adds workaround for TI J721E errata i2183 (https://www.ti.com/lit/er/sprz455a/sprz455a.pdf). PCIe fails to link up if SERDES lanes not used by PCIe are assigned to another protocol. For example, link training fails if lanes 2 and 3 are assigned to another protocol while lanes 0 and 1 are used for PCIe to form a two lane link. This failure is due to an incorrect tie-off on an internal status signal indicating electrical idle. Status signals going from SERDES to PCIe Controller are tied-off when a lane is not assigned to PCIe. Signal indicating electrical idle is incorrectly tied-off to a state that indicates non-idle. As a result, PCIe sees unused lanes to be out of electrical idle and this causes LTSSM to exit Detect.Quiet state without waiting for 12ms timeout to occur. If a receiver is not detected on the first receiver detection attempt in Detect.Active state, LTSSM goes back to Detect.Quiet and again moves forward to Detect.Active state without waiting for 12ms as required by PCIe base specification. Since wait time in Detect.Quiet is skipped, multiple receiver detect operations are performed back-to-back without allowing time for capacitance on the transmit lines to discharge. This causes subsequent receiver detection to always fail even if a receiver gets connected eventually. The workaround only works for 1-lane PCIe configuration. This workaround involves enabling receiver detect override by setting TX_RCVDET_OVRD_PREG_j register of the lane running PCIe to 0x2. This causes SERDES to indicate successful receiver detect when LTSSM is in Detect.Active state, whether a receiver is actually present or not. If the receiver is present, LTSSM proceeds to link up as expected. However if receiver is not present, LTSSM will time out in Polling.Configuration substate since the expected training sequence packets will not be received. Signed-off-by: Swapnil Jakhade Link: https://lore.kernel.org/r/20220303055026.24899-1-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 2404387f521eda1d0eded58411bac2c719985d9c Author: Minghao Chi (CGEL ZTE) Date: Fri Mar 4 01:17:55 2022 +0000 phy/rockchip: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Link: https://lore.kernel.org/r/20220304011755.2061529-1-chi.minghao@zte.com.cn Signed-off-by: Vinod Koul commit 3eb836df4da779c0e42946b02b1cc61dbf7e8622 Author: Minghao Chi (CGEL ZTE) Date: Thu Mar 3 01:44:06 2022 +0000 phy/rockchip: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Link: https://lore.kernel.org/r/20220303014406.2059140-1-chi.minghao@zte.com.cn Signed-off-by: Vinod Koul commit 84ab41db1734c7764a4f29a99d3106586495638c Author: Christian König Date: Wed Apr 13 11:11:36 2022 +0200 drm/ttm: fix kerneldoc for ttm_lru_bulk_move Update the kerneldoc for the members as well. Signed-off-by: Christian König Fixes: b0e2c9ea5afc ("drm/ttm: allow bulk moves for all domains") Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220413091242.638413-1-christian.koenig@amd.com commit 7be2bb8c2ff3f769c49f5a527e7ea992b81e9ca1 Author: Matthew Auld Date: Wed Apr 13 09:21:33 2022 +0100 drm/ttm: fixup ttm_bo_add_move_fence v2 It looks like we still need to call dma_fence_put() on the man->move, otherwise we just end up leaking it, leading to fireworks later. v2(Daniel): - Simplify the function tail Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5689 Fixes: 8bb31587820a ("drm/ttm: remove bo->moving") Cc: Christian König Cc: Daniel Vetter Signed-off-by: Matthew Auld Reviewed-by: Daniel Vetter Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220413082133.272445-1-matthew.auld@intel.com commit faf5933c79545412ea63f0c3d15c261d104e1dde Merge: 651a88798412e 24d0c9f0e7de9 Author: Takashi Iwai Date: Wed Apr 13 10:49:39 2022 +0200 Merge branch 'for-linus' into for-next Back-merge the 5.18-rc3 devel branch, as it influences on the further development. Signed-off-by: Takashi Iwai commit 651a88798412e216f337d70181127e847f00a4b7 Merge: 1b6a6fc5280e9 bb06c203f8676 Author: Takashi Iwai Date: Wed Apr 13 10:43:03 2022 +0200 Merge branch 'topic/cs35l41' into for-next Pull CS35L41 codec updates Signed-off-by: Takashi Iwai commit bb06c203f86766fc2c37cbce0e20e9daae786f6e Author: Lucas Tanure Date: Wed Apr 13 09:37:28 2022 +0100 ASoC: cs35l41: Support external boost Add support for external boost voltage, where GPIO1 must control a switch to isolate CS35L41 from the external Boost Voltage Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220413083728.10730-17-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 4b047ec3a15d1eda7a3d8526566796ad4f4930c0 Author: David Rhodes Date: Wed Apr 13 09:37:27 2022 +0100 ASoC: cs35l41: Document CS35l41 External Boost Document internal and external boost feature for ASoC CS35L41. For internal boost the following properties are required: - cirrus,boost-peak-milliamp - cirrus,boost-ind-nanohenry - cirrus,boost-cap-microfarad For external boost, the GPIO1 must be configured as output, so the following properties are required: - cirrus,gpio1-src-select = <1> - cirrus,gpio1-output-enable Signed-off-by: David Rhodes Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Reviewed-by: Rob Herring Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220413083728.10730-16-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 5577dd2329d03ef88a7c87c17d4c127f3d666192 Author: Lucas Tanure Date: Wed Apr 13 09:37:26 2022 +0100 ALSA: hda: cs35l41: Move external boost handling to lib for ASoC use To add support for external boost for ASoC move the HDA external boost implementation to the shared lib. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-15-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 734b965e67c637c1c59206e302985eea413d588c Author: Lucas Tanure Date: Wed Apr 13 09:37:25 2022 +0100 ALSA: hda: cs35l41: Handle all external boost setups the same way External boost enables sequences for devices with or without GPIO1 as VSPK switch are the same if devices are put in safe mode from reset. As a previous patch put all external boost devices into safe mode from reset, all external boost devices can be handled in the same way for stream open and close. The only difference is that devices without an VSPK switch can not be put in reset and devices with it can be put into reset if a configuration is applied. The function cs35l41_hda_safe_reset is created to handle the safe reset of the chip, and as systems without VSPK switch are not supported anymore, only the CS35L41 HDA driver should check its return. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-14-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b50a99979865555381780dc1fea10afb3a0f98fa Author: Lucas Tanure Date: Wed Apr 13 09:37:24 2022 +0100 ALSA: hda: cs35l41: Reorganize log for playback actions For each case, only log the last regmap access, so it doesn't get overwritten, and as all regmap access should show the same issues logging the last one should be enough. Change to dev_err to log this error. Also, differentiate between a regmap access failure and invalid playback action. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-13-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit fabcf7f12b5fc8e26606fe831843c3ee7023142c Author: Lucas Tanure Date: Wed Apr 13 09:37:23 2022 +0100 ALSA: hda: cs35l41: Remove cs35l41_hda_reg_sequence struct Remove cs35l41_hd_reg_sequence as it adds a layer of flexibility not needed. As cs35l41_hda_(start/stop)_bst is a single register, it can be replaced by regmap_update_bits with usleep_range to wait for the same 3000us that reg_sequence had. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-12-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 5fdb68a7618e3c25816d458e07fd102803493400 Author: Lucas Tanure Date: Wed Apr 13 09:37:22 2022 +0100 ALSA: hda: cs35l41: Move boost config to initialization code Having CS35L41_PWR_CTRL2 on cs35l41_hda_config overwrites the boost configuration for internal boost. So move it to the initialization part and use regmap_update_bits to only change the correct bits. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-11-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ca17707f441f7a033364fe18ed5590ab326d0b29 Author: Lucas Tanure Date: Wed Apr 13 09:37:21 2022 +0100 ALSA: cs35l41: Enable Internal Boost in shared lib Internal Boost enable is the default option from reset, but with external boost support, internal boost must be disabled. Add the enable of internal boost in cs35l41_boost_config to centralize the internal boost configuration. Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220413083728.10730-10-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f29db0892b2a9b2827f4a1afd3abebb82bcf843c Author: Lucas Tanure Date: Wed Apr 13 09:37:20 2022 +0100 ALSA: hda: cs35l41: Mute the device before shutdown Mute the device before shutdown to avoid pops and clicks for all types of boost. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-9-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f04bb4cae18b8eb7e7e7bc35a8e07f1f26bbb919 Author: Lucas Tanure Date: Wed Apr 13 09:37:19 2022 +0100 ALSA: hda: cs35l41: Put the device into safe mode for external boost To facilitate the configuration of external boost devices, put all devices, with or without VSPK switch, into safe mode from the start. That allows the following parts of the driver to handle all external boost devices in the same way. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-8-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b8388a1aba32bef84884c06c8270efa9eec91267 Author: Lucas Tanure Date: Wed Apr 13 09:37:18 2022 +0100 ALSA: hda: cs35l41: Add Boost type flag Replace vspk_always_on by a enum that better characterizes the boost type, as there is 3 types of boost hardware. And with the new boost type other parts of the driver can better handle the configuration of the chip. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-7-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0256949baa327b42aa9224bb10c00b17edd84956 Author: Lucas Tanure Date: Wed Apr 13 09:37:17 2022 +0100 ALSA: hda: cs35l41: Always configure the DAI The dai configuration is always the same and should always configured during the opening the stream. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-6-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 1e616a9c468a481616b0d00f35674865ec99296f Author: Lucas Tanure Date: Wed Apr 13 09:37:16 2022 +0100 ALSA: hda: cs35l41: Fix I2S params comments Fix clock and slot size comments Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220413083728.10730-5-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit fcad8950a50dec5962b1b7b18a285daf7c137178 Author: Lucas Tanure Date: Wed Apr 13 09:37:15 2022 +0100 ALSA: cs35l41: Move cs35l41_gpio_config to shared lib ASoC and HDA can use a single function to configure the chip gpios. Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220413083728.10730-4-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2603c974b45dbfeece80474ee32173756aac3ba1 Author: Lucas Tanure Date: Wed Apr 13 09:37:14 2022 +0100 ALSA: cs35l41: Check hw_config before using it The driver can receive an empty hw_config, so mark as valid if successfully read from device tree/ACPI or set by the driver itself. Platforms not marked with a valid hw config will not be supported. Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220413083728.10730-3-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f7f207375d4e6eb9acc78d312eed8806b37d101a Author: Lucas Tanure Date: Wed Apr 13 09:37:13 2022 +0100 ALSA: cs35l41: Unify hardware configuration Both ASoC and HDA require to configure the GPIOs and Boost, so create a single shared struct for hardware configuration. Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220413083728.10730-2-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 8585b1be79528cabc86164530dbd3326d38623cf Author: Rohit Agarwal Date: Tue Apr 12 10:47:32 2022 +0530 phy: qcom-qmp: Add support for SDX65 QMP PHY Add support for USB3 QMP PHY found in SDX65 platform. SDX65 uses version 5.0.0 of the QMP PHY IP. Signed-off-by: Rohit Agarwal Acked-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/1649740652-17515-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Vinod Koul commit aa1855a79a95960cc51c51ce714d4cd4d3cf1757 Author: Rohit Agarwal Date: Tue Apr 12 10:47:31 2022 +0530 dt-bindings: phy: qcom,qmp: Add SDX65 USB PHY binding Add devicetree YAML binding for Qualcomm QMP Super Speed (SS) PHY found in SDX65. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1649740652-17515-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Vinod Koul commit f038084355376a69e99d39ea85f2b3f76ebbf16f Author: AngeloGioacchino Del Regno Date: Mon Mar 28 13:10:46 2022 +0200 phy: mediatek: phy-mtk-hdmi: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220328111046.210736-1-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul commit b7b930f3b3da34543fa20a0172bc4854bac879c3 Author: AngeloGioacchino Del Regno Date: Mon Mar 28 16:52:17 2022 +0200 phy: mediatek: phy-mtk-mipi-dsi: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220328145217.228457-1-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul commit 33647783deb674b60bb492718cef102c3e9dce6b Author: Ohhoon Kwon Date: Mon Apr 11 01:25:11 2022 +0900 mm/slab_common: move dma-kmalloc caches creation into new_kmalloc_cache() There are four types of kmalloc_caches: KMALLOC_NORMAL, KMALLOC_CGROUP, KMALLOC_RECLAIM, and KMALLOC_DMA. While the first three types are created using new_kmalloc_cache(), KMALLOC_DMA caches are created in a separate logic. Let KMALLOC_DMA caches be also created using new_kmalloc_cache(), to enhance readability. Historically, there were only KMALLOC_NORMAL caches and KMALLOC_DMA caches in the first place, and they were initialized in two separate logics. However, when KMALLOC_RECLAIM was introduced in v4.20 via commit 1291523f2c1d ("mm, slab/slub: introduce kmalloc-reclaimable caches") and KMALLOC_CGROUP was introduced in v5.14 via commit 494c1dfe855e ("mm: memcg/slab: create a new set of kmalloc-cg- caches"), their creations were merged with KMALLOC_NORMAL's only. KMALLOC_DMA creation logic should be merged with them, too. By merging KMALLOC_DMA initialization with other types, the following two changes might occur: 1. The order dma-kmalloc- caches added in slab_cache list may be sorted by size. i.e. the order they appear in /proc/slabinfo may change as well. 2. slab_state will be set to UP after KMALLOC_DMA is created. In case of slub, freelist randomization is dependent on slab_state>=UP, and therefore KMALLOC_DMA cache's freelist will not be randomized in creation, but will be deferred to init_freelist_randomization(). Co-developed-by: JaeSang Yoo Signed-off-by: JaeSang Yoo Signed-off-by: Ohhoon Kwon Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220410162511.656541-1-ohkwon1043@gmail.com commit 6b6efe23942536f3a2d2ae25c92d34d885f020c8 Author: JaeSang Yoo Date: Sat Apr 9 23:42:39 2022 +0900 mm/slub: remove meaningless node check in ___slab_alloc() node_match() with node=NUMA_NO_NODE always returns 1. Duplicate check by goto statement is meaningless. Remove it. Signed-off-by: JaeSang Yoo Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Muchun Song Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220409144239.2649257-1-jsyoo5b@gmail.com commit 27c08f751cb1fc874562e9b18d70ea2af33ca889 Author: Jiyoup Kim Date: Sun Apr 10 00:05:37 2022 +0900 mm/slub: remove duplicate flag in allocate_slab() In allocate_slab(), __GFP_NOFAIL flag is removed twice when trying higher-order allocation. Remove it. Signed-off-by: Jiyoup Kim Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Muchun Song Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220409150538.1264-1-lakroforce@gmail.com commit c0f81a94d405621bb492becf905f6d8267a14f9a Author: JaeSang Yoo Date: Mon Apr 11 16:25:34 2022 +0900 mm/slub: remove unused parameter in setup_object*() setup_object_debug() and setup_object() has unused parameter, "struct slab *slab". Remove it. By the commit 3ec0974210fe ("SLUB: Simplify debug code"), setup_object_debug() were introduced to refactor previous code blocks in the setup_object(). Previous code used SlabDebug() to init_object() and init_tracking(). As the SlabDebug() takes "struct page *page" as argument, the setup_object_debug() checks flag of "struct kmem_cache *s" which doesn't require "struct page *page". As the struct page were changed into struct slab by commit bb192ed9aa719 ("mm/slub: Convert most struct page to struct slab by spatch"), but it's still unused parameter. Suggested-by: Ohhoon Kwon Signed-off-by: JaeSang Yoo Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220411072534.3372768-1-jsyoo5b@gmail.com commit 973ac0eb3a7dfedecd385bd2b48b12e62a0492f2 Author: Chandan Babu R Date: Wed Aug 11 10:33:20 2021 +0530 xfs: Add XFS_SB_FEAT_INCOMPAT_NREXT64 to the list of supported flags This commit enables XFS module to work with fs instances having 64-bit per-inode extent counters by adding XFS_SB_FEAT_INCOMPAT_NREXT64 flag to the list of supported incompat feature flags. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit c3c4ecb529c5a1f0590cffb70649d407ee79b8a8 Author: Chandan Babu R Date: Wed Mar 9 12:58:37 2022 +0000 xfs: Enable bulkstat ioctl to support 64-bit per-inode extent counters The following changes are made to enable userspace to obtain 64-bit extent counters, 1. Carve out a new 64-bit field xfs_bulkstat->bs_extents64 from xfs_bulkstat->bs_pad[] to hold 64-bit extent counter. 2. Define the new flag XFS_BULK_IREQ_BULKSTAT for userspace to indicate that it is capable of receiving 64-bit extent counters. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R commit 5b35d922c5279804be87cab60e4810403038488b Author: Chandan Babu R Date: Wed Mar 9 12:34:04 2022 +0000 xfs: Decouple XFS_IBULK flags from XFS_IWALK flags A future commit will add a new XFS_IBULK flag which will not have a corresponding XFS_IWALK flag. In preparation for the change, this commit separates XFS_IBULK_* flags from XFS_IWALK_* flags. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R commit 4f86bb4b66c999ad9ddcfd49fec93992eeba2715 Author: Chandan Babu R Date: Wed Mar 9 07:49:36 2022 +0000 xfs: Conditionally upgrade existing inodes to use large extent counters This commit enables upgrading existing inodes to use large extent counters provided that underlying filesystem's superblock has large extent counter feature enabled. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 83a21c18441f75aec64548692b52d34582b98a6a Author: Chandan Babu R Date: Tue Mar 29 06:14:00 2022 +0000 xfs: Directory's data fork extent counter can never overflow The maximum file size that can be represented by the data fork extent counter in the worst case occurs when all extents are 1 block in length and each block is 1KB in size. With XFS_MAX_EXTCNT_DATA_FORK_SMALL representing maximum extent count and with 1KB sized blocks, a file can reach upto, (2^31) * 1KB = 2TB This is much larger than the theoretical maximum size of a directory i.e. XFS_DIR2_SPACE_SIZE * 3 = ~96GB. Since a directory's inode can never overflow its data fork extent counter, this commit removes all the overflow checks associated with it. xfs_dinode_verify() now performs a rough check to verify if a diretory's data fork is larger than 96GB. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R commit a848981be6e8cb762f2166cdc1daf58783c5c3d1 Author: Michael Straube Date: Tue Apr 12 20:57:54 2022 +0200 staging: r8188eu: clean up long lines in block_write() Store the address and the data pointer for calls to rtw_writeN() and rtw_write8() in local variables. This avoids long lines and improves readability. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 067b22afad2f26a80b66dd21b72bc6978fe61a9b Author: Michael Straube Date: Tue Apr 12 20:57:53 2022 +0200 staging: r8188eu: remove unneeded initializations The variables i and offset in block_write() are set in the code before they are used. Remove the unneeded initializations. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5a9f53b44a15ed04cf9fdeaa654377cf527e9b15 Author: Michael Straube Date: Tue Apr 12 20:57:52 2022 +0200 staging: r8188eu: reduce variables in block_write() For cleaner code and improved readability we can reduce the number of local variables in block_write(). Use a single variable for block size, number of blocks and remaining size. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c8e68e7728b0ec62484775deb14f568825e9def3 Author: Michael Straube Date: Tue Apr 12 20:57:51 2022 +0200 staging: r8188eu: change void parameters to u8 The second parameter of write_fw(), page_write() and block_write() is a void pointer, but we always pass an u8 pointer. We can convert this parameter to an u8 pointer. The pointer is not changed in the functions, so we can safely remove the local variable bufferPtr. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e8f2410669f15e359729c0618d81c44d3a7013dc Author: Michael Straube Date: Tue Apr 12 20:57:50 2022 +0200 staging: r8188eu: rename parameter of block_write() Rename the parameter buffSize of block_write() to avoid camel case. buffSize -> size Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 826c0e77a44def47f18c3863c3fad9986a9f60e2 Author: Michael Straube Date: Tue Apr 12 20:57:49 2022 +0200 staging: r8188eu: correct macro spelling mistake Correct a macro spelling mistake in rtw_fw.c. MAX_REG_BOLCK_SIZE -> MAX_REG_BLOCK_SIZE Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220412185754.8695-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0fcddf9c7c10202946d5b19409efbdff744fba88 Author: Duoming Zhou Date: Sat Apr 9 15:21:35 2022 +0800 drivers: staging: rtl8192eu: Fix deadlock in rtw_joinbss_event_prehandle There is a deadlock in rtw_joinbss_event_prehandle(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_joinbss_event_prehandle()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | rtw_join_timeout_handler() | _rtw_join_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_joinbss_event_prehandle() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() to spin_lock_irq() in _rtw_join_timeout_handler() in order to prevent deadlock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220409072135.74248-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 041879b12ddb0c6c83ed9c0bdd10dc82a056f2fc Author: Duoming Zhou Date: Sat Apr 9 14:49:53 2022 +0800 drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle() There is a deadlock in rtw_joinbss_event_prehandle(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_joinbss_event_prehandle()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | _rtw_join_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_joinbss_event_prehandle() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() to spin_lock_irq() in _rtw_join_timeout_handler() in order to prevent deadlock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220409064953.67420-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit cc7ad0d77b51c872d629bcd98aea463a3c4109e7 Author: Duoming Zhou Date: Sat Apr 9 14:18:35 2022 +0800 drivers: staging: rtl8723bs: Fix deadlock in rtw_surveydone_event_callback() There is a deadlock in rtw_surveydone_event_callback(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_surveydone_event_callback()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | rtw_scan_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_surveydone_event_callback() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() in rtw_scan_timeout_handler() to spin_lock_irq(). Otherwise, spin_lock_bh() will also cause deadlock() in timer handler. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220409061836.60529-1-duoming@zju.edu.cn Signed-off-by: Greg Kroah-Hartman commit 45a47f0d22c41d2f611c4a61753a2b9b86373c19 Author: Mahak Gupta Date: Wed Apr 13 11:15:17 2022 +0530 staging: r8188eu: add space around operators Adhere to linux coding style. Reported by checkpatch: spaces preferred around that '{operator}'. Signed-off-by: Mahak Gupta Link: https://lore.kernel.org/r/20220413054517.6343-1-mahak_g@cs.iitr.ac.in Signed-off-by: Greg Kroah-Hartman commit cfb121803d42c51745b386f1747ba2f13215fa92 Author: Jaehee Park Date: Wed Apr 13 00:38:52 2022 -0400 staging: greybus: remove empty callback function Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type. Suggested-by: Dan Carpenter Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/12037ae2502ad7d0311bcdf2178c3d2156293236.1649824370.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5a9bdd6fd69b88acbf4e623c77872b4d7d7933dc Author: Jaehee Park Date: Wed Apr 13 00:38:51 2022 -0400 staging: greybus: correct typo in comment Correct a spelling typo from 'Atleast' to 'At least' in comment. Issue found by checkpatch. Reviewed-by: Alex Elder Signed-off-by: Jaehee Park Link: https://lore.kernel.org/r/2feb03de97ca4dbd27c22cf40f8e185f7dfaae29.1649824370.git.jhpark1013@gmail.com Signed-off-by: Greg Kroah-Hartman commit 59c5a7c6122e6978e559f9fad6ed518f1e03f861 Author: Mahak Gupta Date: Wed Apr 13 10:57:58 2022 +0530 staging: r8188eu: remove else after return and break statements Else is not necessary after return and break statements, hence remove it. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Mahak Gupta Link: https://lore.kernel.org/r/20220413052759.4859-1-mahak_g@cs.iitr.ac.in Signed-off-by: Greg Kroah-Hartman commit 143b67f19ba1d72b010e6fb3d254d36a86d2bc03 Author: Adrien Thierry Date: Fri Apr 8 11:03:58 2022 -0400 staging: bcm2835-audio: remove compat ALSA card Remove compat ALSA card, which has overlapping functionality with the two other cards described by the driver (HDMI and headphones) This handles TODO item "Revisit multi-cards options and PCM route mixer control". Move the S/PDIF device that was part of the compat ALSA card to the HDMI card. Only enable headphones card by default, because HDMI breaks when using both vc4 and bcm2835-audio with HDMI card enabled. Signed-off-by: Adrien Thierry Link: https://lore.kernel.org/r/20220408150359.26661-1-athierry@redhat.com Signed-off-by: Greg Kroah-Hartman commit 09cc358a39d41152236e8f2653a94ab39b35cd3f Author: Kunihiko Hayashi Date: Wed Mar 30 19:55:15 2022 +0900 dt-bindings: phy: uniphier: Clean up clocks, resets, and their names using compatible string Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks, clock-names, resets, and reset-names that can be taken by the compatible string. The order of clock-names and reset-names doesn't change here. Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648637715-19262-6-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 45d1f841d5a4afb415415f9f87c9d4ce15e19f42 Author: Kunihiko Hayashi Date: Wed Mar 30 19:55:14 2022 +0900 dt-bindings: phy: uniphier-usb3hs: Fix incorrect clock-names and reset-names There is no clock-names and reset-names for Pro5 SoC, that should have two properties, "gio" and "link" like usb3-ssphy. And according to the existing PXs2 devicetree, the clock-names for PXs2 SoC should have "link" and "phy", and minItems of clocks should be 2. Fixes: 134ab2845acb ("dt-bindings: phy: Convert UniPhier USB3-PHY conroller to json-schema") Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648637715-19262-5-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit fccd2f32deb1bef32915b2240dfd603633eef960 Author: Kunihiko Hayashi Date: Wed Mar 30 19:55:13 2022 +0900 dt-bindings: phy: uniphier-ahci: Fix missing reset-names UniPhier AHCI PHY controller needs to specify 6 reset lines, so this adds missing "phy" to reset-names and increases maxItems of resets. Fixes: 34f92b67621f ("dt-bindings: phy: uniphier-ahci: Add bindings for Pro4 SoC") Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648637715-19262-4-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 61a37dc9c36fe4be455cef89e17388fa6e9c1e82 Author: Kunihiko Hayashi Date: Wed Mar 30 19:55:12 2022 +0900 dt-bindings: phy: uniphier-usb3ss: Treat vbus-supply as optional The usb-device doesn't need "vbus-supply" property, so the property should be removed from required. Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648637715-19262-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit cfe4c1021ef5621384878f1de0bc8fdab761a702 Author: Kunihiko Hayashi Date: Wed Mar 30 19:55:11 2022 +0900 dt-bindings: phy: uniphier-usb2: Add vbus-supply UniPhier USB2 PHY controller can apply vbus-supply. Add "vbus-supply" property to fix the following warning. uniphier-pro4-ace.dtb: usb-glue: phy@2: 'vbus-supply' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/phy/socionext,uniphier-usb2-phy.yaml Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648637715-19262-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit dc4246eff026699c48b27d5bae944b664a5c8035 Author: Ping-Ke Shih Date: Wed Apr 13 09:08:04 2022 +0800 rtw89: pci: correct return value handling of rtw89_write16_mdio_mask() Fix wrong checking statement. Fortunately, this wrong code doesn't affect existing chip. Fixes: 740c431c22fe ("rtw89: pci: add register definition to rtw89_pci_info to generalize pci code") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413010804.8941-5-pkshih@realtek.com commit 0a6f299b6782c522be67074d37e4e0da56389ddc Author: Ping-Ke Shih Date: Wed Apr 13 09:08:03 2022 +0800 rtw89: configure security CAM for V1 chip Add to configure security CAM while mac80211 calls set_key and del_key. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413010804.8941-4-pkshih@realtek.com commit 04b5983ef700d49cc2b30beee95b7f0ba5693dd3 Author: Ping-Ke Shih Date: Wed Apr 13 09:08:02 2022 +0800 rtw89: add new H2C to configure security CAM via DCTL for V1 chip DCTL is short for D-MAC control that V1 chip uses this H2C to configure security CAM. Implement the callers in next patch. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413010804.8941-3-pkshih@realtek.com commit aa7f148bedcaab5b6f6072de6154f36f8876e118 Author: Ping-Ke Shih Date: Wed Apr 13 09:08:01 2022 +0800 rtw89: extend H2C of CMAC control info In order to support new chip that has capability of 160M, we need new format to fill new information, so add a new V1 ID for newer use. Since most fields are the same, fill fields according to the function ID of chip. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220413010804.8941-2-pkshih@realtek.com commit a639b2b18a240d497109631d48016b620fb354f9 Author: Jens Wiklander Date: Wed Jan 12 17:06:32 2022 +0100 optee: add FF-A capability OPTEE_FFA_SEC_CAP_ARG_OFFSET Adds the secure capability OPTEE_FFA_SEC_CAP_ARG_OFFSET to indicate that OP-TEE with FF-A can support an argument struct at a non-zero offset into a passed shared memory object. Signed-off-by: Jens Wiklander commit ed8faf6c8f8c1f7e9ee88342a915ce5f09ca9736 Author: Jens Wiklander Date: Wed Nov 3 11:42:30 2021 +0100 optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG Adds OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG where the struct optee_msg_arg to be used for RPC is appended in the memory following the normal argument struct optee_msg_arg. This is an optimization to avoid caching the RPC argument struct while still maintaining similar performance as if it was cached. OPTEE_SMC_CALL_WITH_REGD_ARG optimized one step further by using a registered shared memory object instead. It's in other aspects identical to OPTEE_SMC_CALL_WITH_RPC_ARG. The presence of OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG is indicated by the new OPTEE_SMC_SEC_CAP_RPC_ARG bit returned by OPTEE_SMC_EXCHANGE_CAPABILITIES. OPTEE_SMC_EXCHANGE_CAPABILITIES also reports the number of arguments that the RPC argument struct must have room for. OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_ARG can be used interleaved with difference that when OPTEE_SMC_CALL_WITH_RPC_ARG is used the RPC argument struct to be used is the one appended to the normal argument struct. The same is true for OPTEE_SMC_CALL_WITH_REGD_ARG. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 30c375a7f6bd2b65243b58cf0aa39791978f2b0b Author: Jens Wiklander Date: Wed Mar 16 13:28:31 2022 +0100 optee: rename rpc_arg_count to rpc_param_count Renames the field rpc_arg_count in struct optee to rpc_param_count. Function parameter names and local variables are also renamed to match. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 35577381b55ffb4d87cdc9c0d0ada0e81a7d3657 Author: Sergey Shtylyov Date: Tue Apr 12 23:39:52 2022 +0300 ata: pata_via: fix sloppy typing in via_do_set_mode() The local variables 'T' and 'UT' are needlessly declared as *unsigned* *long* -- the corresponding parameters of ata_timing_compute() are both declared as *int*. While fixing up those declarations, also make the 'via_clock' and 'T' variables *const* as they are never re-assigned after initialization -- the object code should remain the same as gcc previously used copy propagation anyway... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit dafbbf5c57dd6ae01d20b894bc2200e9d9834c4e Author: Sergey Shtylyov Date: Tue Apr 12 20:26:46 2022 +0300 ata: pata_sil680: fix result type of sil680_sel{dev|reg}() sil680_sel{dev|reg}() return a PCI config space address but needlessly use the *unsigned long* type for that, whereas the PCI config space accessors take *int* for the address parameter. Switch these functions to returning *int*, updating the local variables at their call sites. Get rid of the 'base' local variables in these functions, while at it... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 78254f3b7d7c07e1feced158f909e00109c94bd2 Author: Rohit Agarwal Date: Mon Apr 11 15:20:14 2022 +0530 ARM: dts: qcom: sdx65: Add support for TCSR Mutex Add TCSR Mutex node to support Qualcomm Hardware Mutex block on SDX65 platform. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649670615-21268-7-git-send-email-quic_rohiagar@quicinc.com commit 98187f7b74bf52ff8f7d28e6b987b6c260b68810 Author: Rohit Agarwal Date: Mon Apr 11 15:20:13 2022 +0530 ARM: dts: qcom: sdx65: Enable ARM SMMU Add a node for the ARM SMMU found in the SDX65. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649670615-21268-6-git-send-email-quic_rohiagar@quicinc.com commit dc1a380fcb6736c78804174566fe64800b0175d4 Author: Rohit Agarwal Date: Mon Apr 11 15:20:11 2022 +0530 ARM: dts: qcom: sdx65: Add support for SDHCI controller Add devicetree support for SDHCI controller found in Qualcomm SDX65 platform. The SDHCI controller is based on the MSM SDHCI v5 IP. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649670615-21268-4-git-send-email-quic_rohiagar@quicinc.com commit a30be44449c8847280c775b88c7904f52621791b Author: Rohit Agarwal Date: Mon Apr 11 15:20:09 2022 +0530 ARM: dts: qcom: sdx65: Add reserved memory nodes Add reserved memory nodes to the SDX65 dtsi as defined by the memory map. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649670615-21268-2-git-send-email-quic_rohiagar@quicinc.com commit 43cdc159d203eb6d02b312409e634a3fa06632ac Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:32 2022 +0200 ARM: dts: qcom: do not use underscore in node name Align RPM requests node with DT schema by using hyphen instead of underscore. Signed-off-by: Krzysztof Kozlowski [bjorn: Fixed up qcom-{apq8074,msm8974}-*.dts to match the qcom-msm8974.dtsi] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-8-krzysztof.kozlowski@linaro.org commit c19865df6b142276ec4371ad534a1eb6fef5782d Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:30 2022 +0200 ARM: dts: qcom: msm8974-samsung-klte: move gpio-keys out of soc The GPIO keys are not part of SoC and they should be defined inside of the root node. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-6-krzysztof.kozlowski@linaro.org commit d3eff0e174e5feecb8f45cf630a30f47f02f921c Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:29 2022 +0200 ARM: dts: qcom: msm8974-lge-nexus5: move gpio-keys out of soc The GPIO keys are not part of SoC and they should be defined inside of the root node. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-5-krzysztof.kozlowski@linaro.org commit dc39466a735b9a926e3101560ce094afdfeff9d3 Author: Rohit Agarwal Date: Wed Mar 16 11:47:27 2022 +0530 ARM: dts: qcom: sdx65-mtp: Add regulator nodes Add the regulators found on SDX65 MTP. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-7-git-send-email-quic_rohiagar@quicinc.com commit 52fedb2f324d9be967cf760dcdc894b37f5a95d9 Author: Rohit Agarwal Date: Wed Mar 16 11:47:25 2022 +0530 ARM: dts: qcom: sdx65: Add rpmpd node Add rpmpd node and opps for this node to the SDX65 dts. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-5-git-send-email-quic_rohiagar@quicinc.com commit 1ebc5adc2612679fae6678251dd50b63f9bac6af Author: Rohit Agarwal Date: Wed Mar 16 11:47:24 2022 +0530 ARM: dts: qcom: sdx65-mtp: Add pmx65 pmic SDX65-mtp features PMX65 pmic, so include the dts as well. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-4-git-send-email-quic_rohiagar@quicinc.com commit 73de2adfb2cd56299c869d5f9b0b9d6af893b66e Author: Rohit Agarwal Date: Wed Mar 16 11:47:26 2022 +0530 ARM: dts: qcom: Add PMIC pmx65 dts Add DTS for PMIC PMX65 found in Qualcomm platforms. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-6-git-send-email-quic_rohiagar@quicinc.com commit 7b5d44212076e7474bc8d86bcf38829992a14cc2 Author: Krzysztof Kozlowski Date: Mon Apr 4 08:40:17 2022 +0200 dt-bindings: qcom: qcom,geni-se: refer to dtschema for SPI After adding DT schema for the SPI controller, the Qualcomm GENI Serial Engine QUP Wrapper Controller bindings can reference it directly for full schema validation. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Kuldeep Singh Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220404064017.68634-2-krzysztof.kozlowski@linaro.org commit e5baef55f891b0ef6518bd5eeeee75a5f8b676dc Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:35 2022 +0200 dt-bindings: clock: qcom,rpmcc: add clocks property The RPM clock controller receive input clock ("xo"). It is modelled on only one chip - MSM8953. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-11-krzysztof.kozlowski@linaro.org commit 05a24414fd5ee93f6aa7a6ad684657cd0d36777a Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:34 2022 +0200 dt-bindings: clock: qcom,rpmcc: convert to dtschema Convert the Qualcomm RPM Clock Controller bindings to DT schema and include it in parent's schema (SMD RPM). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-10-krzysztof.kozlowski@linaro.org commit 375eed5f51a84dee4cf933a2ec0710bab9a8df69 Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:33 2022 +0200 dt-bindings: soc: qcom,smd: convert to dtschema Convert the Qualcomm Shared Memory Driver bindings to DT Schema. Changes against original bindings: enforce only specific names of child nodes, instead of any names. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-9-krzysztof.kozlowski@linaro.org commit 812b0b61ee6a281047f433b143b4e9127f1ad97c Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:28 2022 +0200 arm64: dts: qcom: add RPM clock controller fallback compatible The bindings require a fallback compatible to RPM clock controller. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-4-krzysztof.kozlowski@linaro.org commit 0e324e9f49220055a9a81b027443740d3fc5ca07 Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:27 2022 +0200 arm64: dts: qcom: msm8994: remove SMD qcom,local-pid property The Qualcomm SMD does not use qcom,local-pid property. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-3-krzysztof.kozlowski@linaro.org commit b3d26821d9394be7d17435168448db01bd8bc494 Author: Krzysztof Kozlowski Date: Fri Apr 1 22:10:26 2022 +0200 arm64: dts: qcom: msm8953: do not use underscore in node name Align RPM requests node with DT schema by using hyphen instead of underscore. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401201035.189106-2-krzysztof.kozlowski@linaro.org commit 22437c436c3be0bb92cd44bd2aead00747394ce0 Author: Luca Weiss Date: Fri Mar 25 11:18:41 2022 +0100 arm64: dts: qcom: sm7225-fairphone-fp4: Enable wifi Configure regulators used by the wifi hardware and enable it. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220325101841.172304-2-luca.weiss@fairphone.com commit 48cc9bb1d38d8bca1e1fcd98812c965ed13abc3e Author: Luca Weiss Date: Fri Mar 25 11:18:40 2022 +0100 arm64: dts: qcom: sm6350: Add wifi node Add a node describing the wifi hardware found on sm6350. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220325101841.172304-1-luca.weiss@fairphone.com commit d8023f3a8e55907f5b463d571b9797feae59ead9 Author: Konrad Dybcio Date: Sat Mar 19 18:46:45 2022 +0100 arm64: dts: qcom: msm8994: Add mmc aliases Set the aliases for both SDHCI controllers. Signed-off-by: Konrad Dybcio Reviewed-by: Petr Vorel Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-16-konrad.dybcio@somainline.org commit e0be93fb3818b1eb7fc04ebd6c03bb8ba2d67814 Author: Konrad Dybcio Date: Sat Mar 19 18:46:44 2022 +0100 arm64: dts: qcom: msm8994: Add watchdog timer node Add and configure the watchdog node. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-15-konrad.dybcio@somainline.org commit 1ae438d26b620979ed004d559c304d31c42173ae Author: Konrad Dybcio Date: Sat Mar 19 18:46:43 2022 +0100 arm64: dts: qcom: msm8994: Fix BLSP[12]_DMA channels count MSM8994 actually features 24 DMA channels for each BLSP, fix it! Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-14-konrad.dybcio@somainline.org commit 9d511d0a7926c86e259e5084ae1b25fd61a428f3 Author: Konrad Dybcio Date: Sat Mar 19 18:46:42 2022 +0100 arm64: dts: qcom: msm8994: Add OCMEM node Add OCMEM node to allow for GPU SRAM access. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-13-konrad.dybcio@somainline.org commit 410e1619d51720ee5efa7ef59e4784128ee9801a Author: Konrad Dybcio Date: Sat Mar 19 18:46:41 2022 +0100 arm64: dts: qcom: msm8994-kitakami: Update regulator configuration Remove regulator-always-on property where not necessary and mark regulators that are not supposed to be voted active on boot with regulator-boot-on. While at it, reorder the load properties to make it look more decent. Reorder PMICs to fix a probe defer caused by messy dependencies and Linux's inability to handle them (at least for now). Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-12-konrad.dybcio@somainline.org commit 7d9379bf1ecfbf0a7b30a773137006b04a713dd4 Author: Konrad Dybcio Date: Sat Mar 19 18:46:40 2022 +0100 arm64: dts: qcom: msm8994-kitakami: Disable a mistakengly enabled I2C host I2C4 turns out not to be used on Kitakami after all and it only blocks a GPIO used by camera hardware. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-11-konrad.dybcio@somainline.org commit 9e398b4c4ed8f926fcbd9d7d8013d6620d9833ea Author: Konrad Dybcio Date: Sat Mar 19 18:46:39 2022 +0100 arm64: dts: qcom: msm8992-libra: Fix up the framebuffer Make sure the necessary clocks are kept on after clk_cleanup (until MDSS is properly handled by its own driver) and touch up the fb address to prevent some weird shifting. It's still not perfect, but at least the kernel log doesn't start a third deep into your screen.. Signed-off-by: Konrad Dybcio [bjorn: Folded in change of framebuffer base address, from Konrad] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-10-konrad.dybcio@somainline.org commit 049c46f31a726bf8d202ff1681661513447fac84 Author: Konrad Dybcio Date: Sat Mar 19 18:46:38 2022 +0100 arm64: dts: qcom: msm8994: Fix the cont_splash_mem address The default memory map places cont_splash_mem at 3401000, which was overlooked.. Fix it! Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-9-konrad.dybcio@somainline.org commit b0b5687a2ce5b27dc76acda2b48415c69b5a5a95 Author: Konrad Dybcio Date: Sat Mar 19 18:46:37 2022 +0100 arm64: dts: qcom: msm8992: Use the correct MMCC compatible Now that proper msm8992 support is in the driver, switch to the new compatible. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-8-konrad.dybcio@somainline.org commit 355ea704c887303aa1a4b3c8e228cb7ccc2d54c0 Author: Konrad Dybcio Date: Sat Mar 19 18:46:36 2022 +0100 arm64: dts: qcom: msm8992: Use the correct GCC compatible Now that proper msm8992 support is in the driver, switch to the new compatible. Signed-off-by: Konrad Dybcio Reviewed-by: Petr Vorel Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-7-konrad.dybcio@somainline.org commit e9b0eb542027195382c27158ffc83ef77cfb5ba6 Author: Konrad Dybcio Date: Sat Mar 19 18:46:35 2022 +0100 arm64: dts: qcom: msm8994: Add MMCC node Describe the Multimedia Clock Controller block in the DT. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-6-konrad.dybcio@somainline.org commit 2d0f45f760fe8ff5c9b7b58640bd4d665aac80f7 Author: Konrad Dybcio Date: Sat Mar 19 18:46:34 2022 +0100 arm64: dts: qcom: msm8992-libra: Remove superfluous status = "okay" The framebuffer is already enabled by default. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-5-konrad.dybcio@somainline.org commit ed288ae94af0875fba3934893ae3490387d4adc1 Author: Konrad Dybcio Date: Sat Mar 19 18:46:33 2022 +0100 arm64: dts: qcom: msm8992-libra: Temporarily restrict CPU count to 1 The phone seems to randomly crash when more than 1 CPU is enabled, which is probably related to lack of some driver. Restrict the device to only use a single core until this is solved. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-4-konrad.dybcio@somainline.org commit 13cff03303676148bc8f0bbe73a6d40d5fdd020e Author: Konrad Dybcio Date: Sat Mar 19 18:46:32 2022 +0100 arm64: dts: qcom: msm8992-libra: Add CPU regulators Specify CPU regulator voltages for both VDD_APC rails. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-3-konrad.dybcio@somainline.org commit 5827e28304673444f8e1cf426c2b08cc16382290 Author: Konrad Dybcio Date: Sat Mar 19 18:46:31 2022 +0100 arm64: dts: qcom: msm8994: Fix sleep clock name The sleep clock name expected by GCC is actually "sleep" and not "sleep_clk". Fix the clock-names value for it to make sure it is provided. Fixes: 9204da57cd65 ("arm64: dts: qcom: msm8994: Provide missing "xo_board" and "sleep_clk" to GCC") Signed-off-by: Konrad Dybcio Reviewed-by: Petr Vorel Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220319174645.340379-2-konrad.dybcio@somainline.org commit 26380f298b2b06b9e22155649b822d1e2038e754 Author: Rohit Agarwal Date: Wed Mar 16 11:47:23 2022 +0530 ARM: dts: qcom: sdx65-mtp: Add pmk8350b and pm8150b pmic SDX65-mtp features PMK8350b and PM8150B pmic, so include the dts as well Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-3-git-send-email-quic_rohiagar@quicinc.com commit 324db76df18f980a928b8d37c8a6426c09ab52e4 Author: Rohit Agarwal Date: Wed Mar 16 11:47:22 2022 +0530 ARM: dts: qcom: sdx65: Add spmi node Add SPMI node to SDX65 dtsi. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647411447-25249-2-git-send-email-quic_rohiagar@quicinc.com commit 3bfef00d767124838b4b285de8da66fdf395da0d Author: Akhil P Oommen Date: Sat Feb 26 00:51:32 2022 +0530 arm64: dts: qcom: sc7280: Support gpu speedbin Add speedbin fuse and additional OPPs for gpu to support sc7280 SKUs. Signed-off-by: Akhil P Oommen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226005021.v2.5.I4c2cb95f06f0c37038c80cc1ad20563fdf0618e2@changeid commit a5ba119455c77a07e05f2fe0af446c8bf43d1a00 Author: Christian Marangi Date: Sat Feb 26 14:52:35 2022 +0100 ARM: dts: qcom: add syscon and cxo/pxo clock to gcc node for ipq8064 Add syscon compatible required for tsens driver to correctly probe driver and access the reg. Also add cxo and pxo tag and declare them as gcc clock now requires them for the ipq8064 gcc driver that has now been modernized. Signed-off-by: Ansuel Smith Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-16-ansuelsmth@gmail.com commit 34128350b838840b17a1770269158dc0430177d3 Author: Adam Skladowski Date: Mon Mar 7 20:17:25 2022 +0100 firmware: qcom_scm: Add compatible for MSM8976 SoC Add compatible for SCM on MSM8976. Signed-off-by: Adam Skladowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220307191726.10869-5-a39.skl@gmail.com commit a175c6faaa36b1a4c7d945bd3fb0c354c9323623 Author: Adam Skladowski Date: Mon Mar 7 20:17:24 2022 +0100 dt-bindings: firmware: qcom-scm: Document msm8976 bindings SCM driver on MSM8976 requires 3 clocks. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220307191726.10869-4-a39.skl@gmail.com commit d3236c598e08ba1ca5106211a8fb5cb1573571c8 Author: Luca Weiss Date: Sat Feb 26 11:19:39 2022 +0100 ARM: dts: qcom: Add support for ASUS ZenWatch 2 Add support for this smartwatch, based on Snapdragon 400 SoC. Currently supported functionality: * Internal storage * USB * Charger * Power button * Vibration motor * Bluetooth * Wifi Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226101939.1011551-2-luca@z3ntu.xyz commit b736cedce53390705887d5188678b0f25a9b9c23 Author: Luca Weiss Date: Sat Feb 26 11:19:38 2022 +0100 dt-bindings: arm: qcom: Document asus,sparrow device Document the ASUS ZenWatch 2 ("sparrow") which is a smartwatch based on Snapdragon 400 SoC. Signed-off-by: Luca Weiss Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226101939.1011551-1-luca@z3ntu.xyz commit f607dd767f5d6800ffbdce5b99ba81763b023781 Author: Kathiravan T Date: Fri Feb 11 17:44:15 2022 +0530 arm64: dts: qcom: ipq8074: fix the sleep clock frequency Sleep clock frequency should be 32768Hz. Lets fix it. Cc: stable@vger.kernel.org Fixes: 41dac73e243d ("arm64: dts: Add ipq8074 SoC and HK01 board support") Link: https://lore.kernel.org/all/e2a447f8-6024-0369-f698-2027b6edcf9e@codeaurora.org/ Signed-off-by: Kathiravan T Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1644581655-11568-1-git-send-email-quic_kathirav@quicinc.com commit 6ffe07ba141b483c432458e881ca39f80f582470 Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:11 2022 +0300 ARM: dts: qcom: msm8974: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Fixes: 5a9fc531f6ec ("ARM: dts: msm8974: add display support") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-6-dmitry.baryshkov@linaro.org commit be633329928a3b33d91b3cd2b41e9b7f522d1416 Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:10 2022 +0300 arm64: dts: qcom: sm8250: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Reviewed-by: Stephen Boyd Fixes: 7c1dffd471b1 ("arm64: dts: qcom: sm8250.dtsi: add display system nodes") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-5-dmitry.baryshkov@linaro.org commit 0316da6bbcb7d78017f8f177399bff5ff889456a Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:09 2022 +0300 arm64: dts: qcom: sdm845: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Reviewed-by: Stephen Boyd Fixes: 08c2a076d18f ("arm64: dts: qcom: sdm845: Add dpu to sdm845 dts file") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-4-dmitry.baryshkov@linaro.org commit 63ddd8a54d4be02976e63ff06bb1cc98226c6981 Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:08 2022 +0300 arm64: dts: qcom: sdm660: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Reviewed-by: Stephen Boyd Fixes: ab290284398d ("arm64: dts: qcom: sdm660: Add required nodes for DSI1") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-3-dmitry.baryshkov@linaro.org commit 2a11b3bfc51ac4d5dcb17a22dd98741f26350e5f Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:07 2022 +0300 arm64: dts: qcom: sdm630: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Reviewed-by: Stephen Boyd Fixes: b52555d590d1 ("arm64: dts: qcom: sdm630: Add MDSS nodes") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-2-dmitry.baryshkov@linaro.org commit 7b36ab2673b359d1daf4da9e42597edc5ef866fa Author: Dmitry Baryshkov Date: Thu Mar 3 01:54:06 2022 +0300 arm64: dts: qcom: msm8996: Drop flags for mdss irqs The number of interrupt cells for the mdss interrupt controller is 1, meaning there should only be one cell for the interrupt number, not two. Drop the second cell containing (unused) irq flags. Reviewed-by: Stephen Boyd Fixes: 12d540375736 ("arm64: dts: qcom: msm8996: Add DSI0 nodes") Fixes: 3a4547c1fc2f ("arm64: qcom: msm8996.dtsi: Add Display nodes") Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Abhinav Kumar Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302225411.2456001-1-dmitry.baryshkov@linaro.org commit f1383348ad0fe0d568dfd37f2552b0b4f044dbe5 Author: Deepak Kumar Singh Date: Tue Mar 1 20:48:33 2022 +0530 soc: qcom: smem: validate fields of shared structures Structures in shared memory that can be modified by remote processors may have untrusted values, they should be validated before use. Adding proper validation before using fields of shared structures. Signed-off-by: Deepak Kumar Singh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1646147913-15791-2-git-send-email-quic_deesin@quicinc.com commit 20bb6c9de1b7e13f11d2ffe73686f4449c426807 Author: Deepak Kumar Singh Date: Tue Mar 1 20:48:32 2022 +0530 soc: qcom: smem: map only partitions used by local HOST SMEM driver is IO mapping complete region and CPU is doing a speculative read into a partition where local HOST does not have permission resulting in a NOC error. Map only those partitions which are accessibly to local HOST. Signed-off-by: Deepak Kumar Singh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1646147913-15791-1-git-send-email-quic_deesin@quicinc.com commit 37ebe34fc04e62a019006912d49e0b5fb0731986 Author: Dmitry Baryshkov Date: Tue Mar 1 09:15:00 2022 +0300 arm64: dts: qcom: sm8450-hdk: add pcie nodes Add device tree nodes for PCIe0/PCIe1 controllers and corresponding PHYs. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-8-dmitry.baryshkov@linaro.org commit bce9887e0f4e4ef4ffc5a5af4d7b6769fa18c949 Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:59 2022 +0300 arm64: dts: qcom: sm8450-qrd: enable PCIe0 host Enable PCIe0 host on SM8450 QRD device. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-7-dmitry.baryshkov@linaro.org commit 3795221250b60b1a3a9f60a22fd447f2f9e17b57 Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:58 2022 +0300 arm64: dts: qcom: sm8450-qrd: enable PCIe0 PHY device Enable PCIe0 PHY on the SM8450 QRD device. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-6-dmitry.baryshkov@linaro.org commit bc6588bc25fb30b25125660d39222d3ca4a44eb6 Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:57 2022 +0300 arm64: dts: qcom: sm8450: add PCIe1 root device Add device tree node for the second PCIe host found on the Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-5-dmitry.baryshkov@linaro.org commit 334d91d2410d76b9045d3821bc02ae92a9e0b23b Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:56 2022 +0300 arm64: dts: qcom: sm8450: add PCIe1 PHY node Add device tree node for the second PCIe PHY device found on the Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-4-dmitry.baryshkov@linaro.org commit 7b09b1b47335b7a6d869df6b77a55cdc2b75e14e Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:55 2022 +0300 arm64: dts: qcom: sm8450: add PCIe0 RC device Add device tree node for the first PCIe host found on the Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Acked-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-3-dmitry.baryshkov@linaro.org commit d41a72c24ce3fdbbc75d13e90700d6878cbad49c Author: Dmitry Baryshkov Date: Tue Mar 1 09:14:54 2022 +0300 arm64: dts: qcom: sm8450: add PCIe0 PHY node Add device tree node for the first PCIe PHY device found on the Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220301061500.2110569-2-dmitry.baryshkov@linaro.org commit ce91bc005e076acd3415d557d7e7c488aa9ab10d Author: Rohit Agarwal Date: Tue Feb 22 10:26:24 2022 +0530 ARM: dts: qcom: sdx65: Add support for APCS block The APCS block on SDX65 acts as a mailbox controller and also provides clock output for the Cortex A7 CPU. Signed-off-by: Rohit Agarwal Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645505785-2271-5-git-send-email-quic_rohiagar@quicinc.com commit 02c5553523c6cfdab4335ab26ff65f679c7c91ac Author: Rohit Agarwal Date: Tue Feb 22 10:26:23 2022 +0530 ARM: dts: qcom: sdx65: Add support for A7 PLL clock On SDX65 there is a separate A7 PLL which is used to provide high frequency clock to the Cortex A7 CPU via a MUX. Signed-off-by: Rohit Agarwal Reviewed-by: Manivannan Sadhasivam Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645505785-2271-4-git-send-email-quic_rohiagar@quicinc.com commit c20aa951ee14fe0dfa2beed19aaee1fd33d50a6e Author: Rayyan Ansari Date: Wed Feb 9 16:38:40 2022 +0000 ARM: dts: qcom: pm8226: Add VADC node Add a node for the voltage ADC (VADC) found in PM8226. Signed-off-by: Rayyan Ansari Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220209163841.7360-1-rayyan@ansari.sh commit 9499240d15f29760d2271371eea963ca6f761463 Author: Taniya Das Date: Wed Feb 2 11:02:07 2022 +0530 arm64: dts: qcom: sc7280: Add lpasscore & lpassaudio clock controllers Add the low pass audio clock controller device nodes. Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220202053207.14256-1-tdas@codeaurora.org commit ef043b0dbf3ca84733253ed5028751a9b04c1249 Merge: 095a7137ba363 4185b27b3bef9 Author: Bjorn Andersson Date: Tue Apr 12 21:18:13 2022 -0500 Merge branch '20220223172248.18877-1-tdas@codeaurora.org' into arm64-for-5.19 commit a9dd26639d0567043bb3d8761380d505f2318e44 Author: Taniya Das Date: Wed Feb 23 22:52:48 2022 +0530 clk: qcom: lpass: Add support for LPASS clock controller for SC7280 The Low Power Audio subsystem core and audio clocks are required for Audio client to be able to request for the clocks and power domains. Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220223172248.18877-2-tdas@codeaurora.org commit 298af153e9afa04e7f885669d524e159c2f42df7 Merge: 41219ff601d61 4185b27b3bef9 Author: Bjorn Andersson Date: Tue Apr 12 21:17:30 2022 -0500 Merge branch '20220223172248.18877-1-tdas@codeaurora.org' into clk-for-5.19 commit 4185b27b3bef9ce724a3dafd8193c935e845fcdc Author: Taniya Das Date: Wed Feb 23 22:52:47 2022 +0530 dt-bindings: clock: Add YAML schemas for LPASS clocks on SC7280 The LPASS(Low Power Audio Subsystem) clock provider have a bunch of generic properties that are needed in a device tree. Also add clock ids for LPASS core clocks and audio clock IDs for LPASS client to request for the clocks. Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220223172248.18877-1-tdas@codeaurora.org commit 35ee1f499091c76bd5f5d52f5ef79c3568ac74a6 Author: Dan Williams Date: Fri Apr 8 12:30:29 2022 -0700 cxl/mem: Replace redundant debug message with a comment cxl_mem_probe() already emits a log message when HDM operation can not be established. Delete the similar one in cxl_hdm_decode_init(). What is less obvious is why global_ctrl being enabled makes positive values of info->ranges irrelevant, and the Linux behavior with respect to the spec recommendation to mirror CXL Range registers with HDM Decoder Base + Size registers. Cc: Ben Widawsky Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164944616743.454665.7055846627973202403.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 31e624a77e748e4ab7d5c9c3ddc46ba7735bd75e Author: Dan Williams Date: Mon Mar 14 18:22:44 2022 -0700 cxl/mem: Rename cxl_dvsec_decode_init() to cxl_hdm_decode_init() cxl_dvsec_decode_init() is tasked with checking whether legacy DVSEC range based decode is in effect, or whether HDM can be enabled / already is enabled. As such it either succeeds or fails and that result is the return value. The @do_hdm_init variable is misleading in the case where HDM operation is already found to be active, so just call it @retval. Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164730736435.3806189.2537160791687837469.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 36bfc6ad508af38f212cf5a38147d867fb3f80a8 Author: Dan Williams Date: Mon Mar 14 18:22:38 2022 -0700 cxl/pci: Make cxl_dvsec_ranges() failure not fatal to cxl_pci cxl_dvsec_ranges(), the helper for enumerating the presence of an active legacy CXL.mem configuration on a CXL 2.0 Memory Expander, is not fatal for cxl_pci because there is still value to enable mailbox operations even if CXL.mem operation is disabled. Recall that the reason cxl_pci does this initialization and not cxl_mem is to preserve the useful property (for unit testing) that cxl_mem is cxl_memdev + mmio generic, and does not require access to a 'struct pci_dev' to issue config cycles. Update 'struct cxl_endpoint_dvsec_info' to carry either a positive number of non-zero size legacy CXL DVSEC ranges, or the negative error code from __cxl_dvsec_ranges() in its @ranges member. Reported-by: Krzysztof Zach Fixes: 560f78559006 ("cxl/pci: Retrieve CXL DVSEC memory info") Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164730735869.3806189.4032428192652531946.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit fbaf2b079d2a0a9c7114fbd4d1c0f3dd7a3cb3ad Author: Dan Williams Date: Mon Mar 14 18:22:33 2022 -0700 cxl/mem: Make cxl_dvsec_range() init failure fatal In preparation for the cxl_pci driver to continue operation after cxl_dvsec_range() failure, update cxl_mem to check for negative error codes in info->ranges. Treat that condition as fatal regardless of the state of the HDM configuration since cxl_mem needs positive confirmation that legacy ranges were not established by platform firmware or another agent. Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164730735324.3806189.4167509857771192422.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit e39f9be08d9dfe685c8a325ac1755c04f383effc Author: Dan Williams Date: Mon Mar 14 18:22:28 2022 -0700 cxl/pci: Add debug for DVSEC range init failures In preparation for not treating DVSEC range initialization failures as fatal to cxl_pci_probe() add individual dev_dbg() statements for each of the major failure reasons in cxl_dvsec_ranges(). The rationale for cxl_dvsec_ranges() failure not being fatal is that there is still value for cxl_pci to enable mailbox operations even if CXL.mem operation is disabled. Reviewed-by: Jonathan Cameron Reviewed-by: Ben Widawsky Reviewed-by: Davidlohr Bueso Link: https://lore.kernel.org/r/164730734812.3806189.2726330688692684104.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit e08063fb87944b1db963e94b833608318179708d Author: Dan Williams Date: Mon Mar 14 18:22:22 2022 -0700 cxl/mem: Drop DVSEC vs EFI Memory Map sanity check When the driver finds legacy DVSEC ranges active on a CXL Memory Expander it indicates that platform firmware is not aware of, or is deliberately disabling common CXL 2.0 operation. In this case Linux generally has no choice, but to leave the device alone. The driver attempts to validate that the DVSEC range is in the EFI memory map. Remove that logic since there is no requirement that the BIOS publish DVSEC ranges in the EFI Memory Map. In the future the driver will want to permanently reserve this capacity out of the available CFMWS capacity and hide it from request_free_mem_region(), but it serves no purpose to warn about the range not appearing in the EFI Memory Map. Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron Reviewed-by: Ben Widawsky Link: https://lore.kernel.org/r/164730734246.3806189.13995924771963139898.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 7224013d4b5a64c43be23204bcfb4070dbd7fd76 Author: Kuldeep Singh Date: Sun Apr 10 23:20:55 2022 +0530 ARM: dts: qcom: ipq8064: User generic node name for DMA Qcom BAM DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410175056.79330-6-singh.kuldeep87k@gmail.com commit a86efc02b34104b93a0f9707d1e61577671fc4ad Author: Kuldeep Singh Date: Sun Apr 10 23:20:54 2022 +0530 ARM: dts: qcom: ipq4019: User generic node name for DMA Qcom BAM DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410175056.79330-5-singh.kuldeep87k@gmail.com commit 095a7137ba3630bcca11e6017bfd4ab48b7fc12e Author: Kuldeep Singh Date: Sun Apr 10 23:20:53 2022 +0530 arm64: dts: qcom: msm8996: User generic node name for DMA Qcom BAM DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410175056.79330-4-singh.kuldeep87k@gmail.com commit 73f62e60d80c2d74491933ca49006b9e70563738 Author: Kees Cook Date: Thu Mar 3 16:31:16 2022 -0800 lkdtm: Move crashtype definitions into each category It's long been annoying that to add a new LKDTM test one had to update lkdtm.h and core.c to get it "registered". Switch to a per-category list and update the crashtype walking code in core.c to handle it. This also means that all the lkdtm_* tests themselves can be static now. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Kees Cook commit 8bfdbddd68249e0d8598777cca8249619ee51df0 Author: Christophe Leroy Date: Mon Apr 11 21:13:39 2022 +0200 lkdtm/bugs: Don't expect thread termination without CONFIG_UBSAN_TRAP When you don't select CONFIG_UBSAN_TRAP, you get: # echo ARRAY_BOUNDS > /sys/kernel/debug/provoke-crash/DIRECT [ 102.265827] ================================================================================ [ 102.278433] UBSAN: array-index-out-of-bounds in drivers/misc/lkdtm/bugs.c:342:16 [ 102.287207] index 8 is out of range for type 'char [8]' [ 102.298722] ================================================================================ [ 102.313712] lkdtm: FAIL: survived array bounds overflow! [ 102.318770] lkdtm: Unexpected! This kernel (5.16.0-rc1-s3k-dev-01884-g720dcf79314a ppc) was built with CONFIG_UBSAN_BOUNDS=y It is not correct because when CONFIG_UBSAN_TRAP is not selected you can't expect array bounds overflow to kill the thread. Modify the logic so that when the kernel is built with CONFIG_UBSAN_BOUNDS but without CONFIG_UBSAN_TRAP, you get a warning about CONFIG_UBSAN_TRAP not been selected instead. This also require a fix of pr_expected_config(), otherwise the following error is encountered. CC drivers/misc/lkdtm/bugs.o drivers/misc/lkdtm/bugs.c: In function 'lkdtm_ARRAY_BOUNDS': drivers/misc/lkdtm/bugs.c:351:2: error: 'else' without a previous 'if' 351 | else | ^~~~ Fixes: c75be56e35b2 ("lkdtm/bugs: Add ARRAY_BOUNDS to selftests") Signed-off-by: Christophe Leroy Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/363b58690e907c677252467a94fe49444c80ea76.1649704381.git.christophe.leroy@csgroup.eu commit f387e86d3a74407bdd9c5815820ac9d060962840 Author: Kees Cook Date: Wed Feb 16 12:15:03 2022 -0800 lkdtm/usercopy: Expand size of "out of frame" object To be sufficiently out of range for the usercopy test to see the lifetime mismatch, expand the size of the "bad" buffer, which will let it be beyond current_stack_pointer regardless of stack growth direction. Paired with the recent addition of stack depth checking under CONFIG_HARDENED_USERCOPY=y, this will correctly start tripping again. Reported-by: Muhammad Usama Anjum Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reviewed-by: Muhammad Usama Anjum Link: https://lore.kernel.org/lkml/762faf1b-0443-5ddf-4430-44a20cf2ec4d@collabora.com/ Signed-off-by: Kees Cook commit 42db2594e4cd4a3c29aad87f80b1c00bf7751afe Author: Kees Cook Date: Wed Feb 16 10:20:47 2022 -0800 lkdtm/heap: Note conditions for SLAB_LINEAR_OVERFLOW It wasn't clear when SLAB_LINEAR_OVERFLOW would be expected to trip. Explicitly describe it and include the CONFIGs in the kselftest. Cc: Muhammad Usama Anjum Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook commit 4a9800c81d2f34afb66b4b42e0330ae8298019a2 Author: Jiasheng Jiang Date: Thu Jan 20 17:29:36 2022 +0800 lkdtm/bugs: Check for the NULL pointer after calling kmalloc As the possible failure of the kmalloc(), the not_checked and checked could be NULL pointer. Therefore, it should be better to check it in order to avoid the dereference of the NULL pointer. Also, we need to kfree the 'not_checked' and 'checked' to avoid the memory leak if fails. And since it is just a test, it may directly return without error number. Fixes: ae2e1aad3e48 ("drivers/misc/lkdtm/bugs.c: add arithmetic overflow and array bounds checks") Signed-off-by: Jiasheng Jiang Acked-by: Dan Carpenter Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220120092936.1874264-1-jiasheng@iscas.ac.cn commit c43e036d6f861f4c68b50eea49ab55b539eaab02 Author: Davidlohr Bueso Date: Sun Apr 3 19:12:16 2022 -0700 cxl/mbox: Use new return_code handling Use the global cxl_mbox_cmd_rc table to improve debug messaging in __cxl_pci_mbox_send_cmd() and allow cxl_mbox_send_cmd() to map to proper kernel style errno codes - this patch continues to use -ENXIO only so no change in semantics. Signed-off-by: Davidlohr Bueso Reviewed by: Adam Manzanares Link: https://lore.kernel.org/r/20220404021216.66841-5-dave@stgolabs.net Signed-off-by: Dan Williams commit 92fcc1abab095dceb2337444f79875c8a85063df Author: Davidlohr Bueso Date: Sun Apr 3 19:12:15 2022 -0700 cxl/mbox: Improve handling of mbox_cmd hw return codes Upon a completed command the caller is still expected to check the actual return_code register to ensure it succeed. This adds, per the spec, the potential command return codes. It maps the hardware return code with the kernel's errno style, and by default continues to use -ENXIO (Command completed, but device reported an error). Signed-off-by: Davidlohr Bueso Reviewed by: Adam Manzanares Link: https://lore.kernel.org/r/20220404021216.66841-4-dave@stgolabs.net Signed-off-by: Dan Williams commit cbe83a2052682c6f57d45f76fe7fea4bf254acd9 Author: Davidlohr Bueso Date: Sun Apr 3 19:12:14 2022 -0700 cxl/pci: Use CXL_MBOX_SUCCESS to check against mbox_cmd return code Also mention the need for the caller to check against any errors from the hardware in return_code. Signed-off-by: Davidlohr Bueso Reviewed by: Adam Manzanares Link: https://lore.kernel.org/r/20220404021216.66841-3-dave@stgolabs.net Signed-off-by: Dan Williams commit ee92c7e261fd4b58ed5991a776ae9b25e9a5e030 Author: Davidlohr Bueso Date: Sun Apr 3 19:12:13 2022 -0700 cxl/mbox: Drop mbox_mutex comment ... we have lockdep for this. Signed-off-by: Davidlohr Bueso Reviewed by: Adam Manzanares Link: https://lore.kernel.org/r/20220404021216.66841-2-dave@stgolabs.net Signed-off-by: Dan Williams commit 6aa657f416b65f23d7a3c9d04f144b1c4aa2ebc1 Author: Alison Schofield Date: Wed Mar 30 18:27:19 2022 -0700 cxl/pmem: Remove CXL SET_PARTITION_INFO from exclusive_cmds list With SET_PARTITION_INFO on the exclusive_cmds list for the CXL_PMEM driver, userspace cannot execute a set-partition command without first unbinding the pmem driver from the device. When userspace requests a partition change to take effect on the next reboot this unbind requirement is unnecessarily restrictive. The driver does not need to enforce an unbind because partitions will not change until the next reboot. Of course, userspace still needs to be aware that changing the size of persistent capacity on the next reboot will result in the loss of data stored. That can happen regardless of whether it is presently bound at the time of issuing the set-partition command. When userspace requests a partition change to take effect immediately, restrictions are needed. The CXL_MEM driver currently blocks the usage of immediate mode, making the presence of SET_PARTITION_INFO, in this exclusive commands list, redundant. In the future, when the CXL_MEM driver adds support for immediate changes to device partitions it will ensure that the partition change will not affect any active decode. That means the work will not fall right back here, onto the CXL_PMEM driver. Signed-off-by: Alison Schofield Link: https://lore.kernel.org/r/accc6abc878f0662093b81490a1a052f2ff6f06e.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 6179045ccc0c6229dc449afc1701dc7fbd40571f Author: Alison Schofield Date: Wed Mar 30 18:27:18 2022 -0700 cxl/mbox: Block immediate mode in SET_PARTITION_INFO command User space may send the SET_PARTITION_INFO mailbox command using the IOCTL interface. Inspect the input payload and fail if the immediate flag is set. This is the first instance of the driver inspecting an input payload from user space. Assume there will be more such cases and implement with an extensible helper. In order for the kernel to react to an immediate partition change it needs to assert that the change will not affect any active decode. At a minimum this requires validating that the device is using HDM decoders instead of the CXL DVSEC for decode, and that none of the active HDM decoders are affected by the partition change. For now, just fail until that support arrives. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/241821186c363833980adbc389e2c547bc5a6395.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 2dd5600a0e4e1aca8541e1c5bb2bc26bc0441d4d Author: Alison Schofield Date: Wed Mar 30 18:27:17 2022 -0700 cxl/mbox: Move cxl_mem_command param to a local variable cxl_validate_command_from_user() is now the single point of validation for mailbox commands coming from user space. Previously, it returned a a cxl_mem_command, but that was not sufficient when validation of the actual mailbox command became a requirement. Now, it returns a fully validated cxl_mbox_cmd. Remove the extraneous cxl_mem_command parameter. Define and use a local version only. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/c11a437896d914daf36f5ac8ec62f999c5ec2da7.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit d97fe8eec2b895b2aa2f7bb3d55e7b88bc2d53f3 Author: Alison Schofield Date: Wed Mar 30 18:27:16 2022 -0700 cxl/mbox: Make handle_mailbox_cmd_from_user() use a mbox param Previously, handle_mailbox_cmd_from_user(), constructed the mailbox command and dispatched it to the hardware. The construction work has moved to the validation path. handle_mailbox_cmd_from_user() now expects a fully validated mbox param. Make it's caller, cxl_send_cmd(), deliver it. Update the comments and dereferencing of the new mbox parameter. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/77050ba512d6c30eccf7505467509e460dd325a0.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 82b8ba29538e5dae0a4e481dbbea4d5015c683af Author: Alison Schofield Date: Wed Mar 30 18:27:15 2022 -0700 cxl/mbox: Remove dependency on cxl_mem_command for a debug msg In preparation for removing access to struct cxl_mem_command, change this debug message to use cxl_mbox_cmd fields instead. Retrieve the pretty command name from cxl_mbox_cmd using a new opcode to command name helper. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/57265751d336a6e95f5ca31a9c77189408b05742.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 9ae016aeb722504703c67e6e59c673719868f467 Author: Alison Schofield Date: Wed Mar 30 18:27:14 2022 -0700 cxl/mbox: Construct a users cxl_mbox_cmd in the validation path This is a step in refactoring the handling of user space mailbox commands. The intent is to have all the validation work originate in cxl_validate_cmd_from_user(). Move the construction and validation of a mailbox command to the validation path. Continue to pass both the out_cmd and the mbox_cmd until handle_mbox_cmd_from_user() learns how to use a mbox_cmd param. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/c9fbdad968a2b619f9108bb6c37cef1a853cdf5a.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 63cf60b7e0a556b3542e6e915dfe9c93eaa559fd Author: Alison Schofield Date: Wed Mar 30 18:27:13 2022 -0700 cxl/mbox: Move build of user mailbox cmd to a helper functions In preparation for moving the construction of a mailbox command to the validation path, extract the work into a helper functions. Signed-off-by: Alison Schofield Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/493d7618a846d787c3ae28778935ca35e2b85eed.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 39ed8da4f341c8dbe9c15f716d3a328269a07fc7 Author: Alison Schofield Date: Wed Mar 30 18:27:12 2022 -0700 cxl/mbox: Move raw command warning to raw command validation This move serves two purposes: 1) Emit the warning in the raw command validation path, and 2) Remove the dependency on the struct cxl_mem_command in handle_mailbox_cmd_from_user() in preparation for a refactor of that function. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/df5f0e0ec8afa1f75299aa86b4226ab4479ef325.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 6dd0e5cc87b33aee9cfe4d485c4d8b8382701558 Author: Alison Schofield Date: Wed Mar 30 18:27:11 2022 -0700 cxl/mbox: Move cxl_mem_command construction to helper funcs Sanitizing and constructing a cxl_mem_command from a userspace command is part of the validation process prior to submitting the command to a CXL device. Move this work to helper functions: cxl_to_mem_cmd(), cxl_to_mem_cmd_raw(). This declutters cxl_validate_cmd_from_user() in preparation for adding new validation steps. Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/7d9b826f29262e3a484cb4bb7b63872134d60bd7.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit f45ba67eb74ab4b775616af731bdf8944afce3f1 Author: Lv Ruyi Date: Tue Apr 12 08:51:26 2022 +0000 ixp4xx_eth: fix error check return value of platform_get_irq() platform_get_irq() return negative value on failure, so null check of return value is incorrect. Fix it by comparing whether it is less than zero. Fixes: 9055a2f59162 ("ixp4xx_eth: make ptp support a platform driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220412085126.2532924-1-lv.ruyi@zte.com.cn Signed-off-by: Jakub Kicinski commit 2e5b3d4cb16e0be22f714475849bd14435b72583 Author: Minghao Chi Date: Tue Apr 12 08:28:47 2022 +0000 net: ethernet: ti: cpsw: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Grygorii Strashko Link: https://lore.kernel.org/r/20220412082847.2532584-1-chi.minghao@zte.com.cn Signed-off-by: Jakub Kicinski commit 753b953774b5840825c9b7bc6413036292138467 Author: Coco Li Date: Mon Apr 11 14:37:17 2022 -0700 fou: Remove XRFM from NET_FOU Kconfig XRFM is no longer needed for configuring FOU tunnels (CONFIG_NET_FOU_IP_TUNNELS), remove from Kconfig. Also remove the xrfm.h dependency in fou.c. It was added in '23461551c006 ("fou: Support for foo-over-udp RX path")' for depencies of udp_del_offload and udp_offloads, which were removed in 'd92283e338f6 ("fou: change to use UDP socket GRO")'. Built and installed kernel and setup GUE/FOU tunnels. Signed-off-by: Coco Li Link: https://lore.kernel.org/r/20220411213717.3688789-1-lixiaoyan@google.com Signed-off-by: Jakub Kicinski commit ad1661b0c91d55f1c194fa4bb059056e48937adb Author: Vinod Koul Date: Fri Feb 25 10:10:33 2022 +0530 arm64: defconfig: Enable Qualcomm GPI DMA Driver Qualcomm GPI DMA Driver is used for DMA transfers for Serial engines like Geni I2C and SPI. Enable this dma driver Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225044033.1376769-1-vkoul@kernel.org commit d999ad1079f574be06a8f1701cd24a5dc0ada48c Author: Manasi Navare Date: Thu Mar 3 15:32:22 2022 -0800 drm/i915/display/vrr: Reset VRR capable property on a long hpd With some VRR panels, user can turn VRR ON/OFF on the fly from the panel settings. When VRR is turned OFF ,sends a long HPD to the driver clearing the Ignore MSA bit in the DPCD. Currently the driver parses that onevery HPD but fails to reset the corresponding VRR Capable Connector property. Hence the userspace still sees this as VRR Capable panel which is incorrect. Fix this by explicitly resetting the connector property. v2: Reset vrr capable if status == connector_disconnected v3: Use i915 and use bool vrr_capable (Jani Nikula) v4: Move vrr_capable to after update modes call (Jani N) Remove the redundant comment (Jan N) v5: Fixes the regression on older platforms by resetting the VRR only if HAS_VRR v6: Remove the checks from driver, add in drm core before setting VRR prop (Ville) v7: Move VRR set/reset to set/unset_edid (Ville) Cc: Jani Nikula Cc: Ville Syrjälä Fixes: 9bc34b4d0f3c ("drm/i915/display/vrr: Reset VRR capable property on a long hpd") Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303233222.4698-1-manasi.d.navare@intel.com commit 90b76a3cb9bf208286851560cfc70830c91c1d3f Author: Janusz Krzysztofik Date: Thu Apr 7 21:12:02 2022 +0200 ASoC: ti: osk5912: Make it CCF clk API compatible The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220407191202.46206-1-jmkrzyszt@gmail.com Signed-off-by: Mark Brown commit 62c6f4f9bb08a8b18fc6e12d865284991ec3776a Author: Changcheng Deng Date: Wed Feb 9 08:48:10 2022 +0000 fbcon: use min() to make code cleaner Use min() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Sam Ravnborg Signed-off-by: Helge Deller Link: https://patchwork.freedesktop.org/patch/msgid/20220209084810.1561184-1-deng.changcheng@zte.com.cn commit 372c1c3dd709700bdec6c0d377363783fc7c1618 Author: Stephan Gerhold Date: Sun Apr 10 21:51:13 2022 +0200 arm64: dts: qcom: msm8916-huawei-g7: Add sound card The huawei-g7 uses the msm8916-wcd-digital/analog audio codecs similar to apq8016-sbc, so we can mostly copy paste it from there to make audio work correctly. The main difference is the hphl-jack-type-normally-open property, which is needed to avoid inverted audio jack detection. Note that at least on my device the jack detection is not fully reliable: sometimes headphones are detected as headsets (with microphone). However, this is not a big problem for typical usage. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410195113.13646-3-stephan@gerhold.net commit d317344d6e5ecc8cfa90463e801f9ec60bb4ef50 Author: Stephan Gerhold Date: Sun Apr 10 21:51:12 2022 +0200 arm64: dts: qcom: msm8916-huawei-g7: Clarify installation instructions The comment with installation instructions in the huawei-g7 device tree is a bit misleading and does not describe the recommended installation steps very well. The bootloader is actually not patched; to avoid all trouble with the vendor bootloader it is easier to bypass it completely by jumping to a custom bootloader (e.g. based on the open-source LK released by Qualcomm). To avoid confusion, simplify the comment to state only the problem and then refer to the wiki article which contains detailed suggested installation instructions. This will also make it easier to keep it up to date with new developments in the future. Fixes: 55056b229189 ("arm64: dts: qcom: msm8916: Add device tree for Huawei Ascend G7") Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410195113.13646-2-stephan@gerhold.net commit fb1bdb7e787a6037f501869b5aaf9e5cabe7a7bc Author: Kuldeep Singh Date: Sun Apr 10 23:20:51 2022 +0530 ARM: dts: qcom: apq8064: User generic node name for DMA Qcom BAM DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410175056.79330-2-singh.kuldeep87k@gmail.com commit fbf64afd16b9581ae5a89c6924b50f83041463e0 Author: Kuldeep Singh Date: Sun Apr 10 23:20:52 2022 +0530 ARM: dts: qcom: mdm9615: User generic node name for DMA Qcom BAM DT spec expects generic DMA controller node name as "dma-controller" to enable validations. Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410175056.79330-3-singh.kuldeep87k@gmail.com commit 551b614e235389063341b47f3b5bade763353589 Author: Konrad Dybcio Date: Tue Feb 22 02:48:05 2022 +0100 arm64: dts: qcom: sm8250-edo: Add dual CS35L41 amps Add nodes for dual Cirrus Logic CS35L41 audio amps connected via I2C. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220222014806.22446-1-konrad.dybcio@somainline.org commit 959cb513074386954629cbdc914612d6ff755b8c Author: Shaik Sajida Bhanu Date: Tue Apr 12 16:02:08 2022 +0530 arm64: dts: qcom: sc7280: Add reset entries for SDCC controllers Add gcc hardware reset entries for eMMC and SD card. Signed-off-by: Shaik Sajida Bhanu Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1649759528-15125-3-git-send-email-quic_c_sbhanu@quicinc.com commit 41219ff601d6135768ed9fbe7c8a2ad279d0b523 Merge: 3123109284176 a9ed9e2bf7940 Author: Bjorn Andersson Date: Tue Apr 12 13:41:27 2022 -0500 Merge tag '20220323085010.1753493-4-dmitry.baryshkov@linaro.org' into clk-for-5.19 v5.18-rc1 + 20220323085010.1753493-2-dmitry.baryshkov@linaro.org + 20220323085010.1753493-3-dmitry.baryshkov@linaro.org + 20220323085010.1753493-4-dmitry.baryshkov@linaro.org commit a9ed9e2bf7940353d2ffa4faa2ad2b75a24f3ac0 Author: Dmitry Baryshkov Date: Wed Mar 23 11:50:08 2022 +0300 clk: qcom: gcc-sc7280: use new clk_regmap_mux_safe_ops for PCIe pipe clocks Use newly defined clk_regmap_mux_safe_ops for PCIe pipe clocks to let the clock framework automatically park the clock when the clock is switched off and restore the parent when the clock is switched on. Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220323085010.1753493-4-dmitry.baryshkov@linaro.org commit fa5ad5c51706e5407a3bb56c9542a63c81e35a2f Author: Dmitry Baryshkov Date: Wed Mar 23 11:50:07 2022 +0300 clk: qcom: gcc-sm8450: use new clk_regmap_mux_safe_ops for PCIe pipe clocks Use newly defined clk_regmap_mux_safe_ops for PCIe pipe clocks to let the clock framework automatically park the clock when the clock is switched off and restore the parent when the clock is switched on. Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220323085010.1753493-3-dmitry.baryshkov@linaro.org commit e9a4c7f667ed16a95da0e9d68cc88b381dcd99f9 Author: Dmitry Baryshkov Date: Wed Mar 23 11:50:06 2022 +0300 clk: qcom: regmap-mux: add pipe clk implementation On recent Qualcomm platforms the QMP PIPE clocks feed into a set of muxes which must be parked to the "safe" source (bi_tcxo) when corresponding GDSC is turned off and on again. Currently this is handcoded in the PCIe driver by reparenting the gcc_pipe_N_clk_src clock. However the same code sequence should be applied in the pcie-qcom endpoint, USB3 and UFS drivers. Rather than copying this sequence over and over again, follow the example of clk_rcg2_shared_ops and implement this parking in the enable() and disable() clock operations. As we are changing the parent behind the back of the clock framework, also implement custom set_parent() and get_parent() operations behaving accroding to the clock framework expectations (cache the new parent if the clock is in disabled state, return cached parent). Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220323085010.1753493-2-dmitry.baryshkov@linaro.org commit e91033621d56e055803c4c4ba507fbbb2d145a7f Author: Samuel Holland Date: Tue Apr 12 00:15:28 2022 -0500 of/irq: Use interrupts-extended to find parent The RISC-V PLIC binding uses interrupts-extended to specify its parent domain(s). That binding does not allow the interrupt-parent property to appear in the irqchip node. This prevents of_irq_init from properly detecting the irqchip hierarchy. If no interrupt-parent property is present in the enclosing bus or root node, then desc->interrupt_parent will be NULL for both the per-CPU RISC-V INTC (the actual root domain) and the RISC-V PLIC. Similarly, if the bus or root node specifies `interrupt-parent = <&plic>`, then of_irq_init will hit the `desc->interrupt_parent == np` check, and again all parents will be NULL. So things happen to work today for some boards due to Makefile ordering. However, things break when another irqchip ("foo") is stacked on top of the PLIC. The bus or root node will have `interrupt-parent = <&foo>`, since that is what all of the other peripherals need. When of_irq_init runs, it will try to find the PLIC's parent domain. of_irq_find_parent will fall back to using the interrupt-parent property of the PLIC's parent node (i.e. the bus or root node), and of_irq_init will see "foo" as the PLIC's parent domain. But this is wrong, because "foo" is actually the PLIC's child domain! So of_irq_init wrongly attempts to init the stacked irqchip before the PLIC. This fails and breaks booting. Fix this by using the first node referenced by interrupts-extended as the parent when that property is present. This allows of_irq_init to see the relationship between the PLIC and the per-CPU RISC-V INTC, and thus only the RISC-V INTC is (correctly) considered a root domain. Signed-off-by: Samuel Holland Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220412051529.6293-1-samuel@sholland.org commit c2e4b0a97cc2ed0590fade2aebc4d912dd868ff3 Author: Aric Cyr Date: Mon Apr 4 00:22:58 2022 -0400 drm/amd/display: 3.2.181 Title: DC Patches Apri 6, 2022 This DC patchset brings improvements in multiple areas. In summary, we highlight: *Disabling Z10 on DCN31 *Fix issue breaking 32bit Linux build *Fix inconsistent timestamp type *Add DCN30 support FEC init *Fix crash on setting VRR with no display connected *Disable FEC if DSC not supported for EDP *Add odm seamless boot support *Select correct DTO source *Power down hardware if timer not trigger Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit e9b1bfa548be678fcfd706291637b51f35ee92b8 Author: Dillon Varone Date: Fri Apr 1 16:45:40 2022 -0400 drm/amd/display: Select correct DTO source [WHY&HOW] Change criteria for setting DTO source value, and always set it regardless of the signal type. Reviewed-by: Ariel Bernstein Acked-by: Pavle Kotarac Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 34d292d57973dd432e93425de33f8f120cfbdab3 Author: Felix Kuehling Date: Thu Apr 7 22:08:03 2022 -0400 drm/amdkfd: Asynchronously free events The synchronize_rcu call in destroy_events can take several ms, which noticeably slows down applications destroying many events. Use kfree_rcu to free the event structure asynchronously and eliminate the synchronize_rcu call in the user thread. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 634c67ee33a7bfb574aba1796d89493ff6614ab7 Author: hersen wu Date: Fri Apr 1 15:25:41 2022 -0400 drm/amd/display: expose skip_detection_link_training to debugfs [Why] within dc link detecion, dp link training will be executed for external sst dp. for debug purpose, we may need skip dp link training. [How] expose dc debug option to skip_detection_link_training to debugfs Reviewed-by: Roman Li Acked-by: Pavle Kotarac Signed-off-by: hersen wu Signed-off-by: Alex Deucher commit 3b69632c85ebb687c35e03be4d4ef70e384fd990 Author: Dillon Varone Date: Wed Mar 30 18:42:24 2022 -0400 drm/amd/display: Add dtb clock to dc_clocks Reviewed-by: Ariel Bernstein Acked-by: Pavle Kotarac Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit 19a2e1e36a2b14d7549a6d9584be131f4286f757 Author: Angus Wang Date: Thu Mar 31 09:33:10 2022 -0400 drm/amd/display: Fix inconsistent timestamp type [WHY] An unsigned int timestamp variable is assigned with an unsigned long long value. Also, the assignment directly converts the tick value to us without using built-in get elapsed time function. [HOW] Cast the assigned value correctly and also use built-in function to get the timestamp in the unit we want. v2: squash in 64 bit division fix Reviewed-by: Aric Cyr Acked-by: Pavle Kotarac Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit 30ffa74a04b6e48080f3181b29d2693b8486ca1e Author: Jingwen Zhu Date: Fri Apr 1 06:30:56 2022 +0800 drm/amd/display: add DCN30 support FEC init [Why] FEC init used on DCN30. [How] Check fec active when HW init. Co-authored-by: Jingwen Zhu Reviewed-by: Wenjing Liu Acked-by: Pavle Kotarac Signed-off-by: Jingwen Zhu Signed-off-by: Alex Deucher commit 663d2daeaee6fa55530d8493979e9349070cd47c Author: Duncan Ma Date: Thu Mar 31 15:13:22 2022 -0400 drm/amd/display: Add odm seamless boot support [WHY] Implement changes to transition from Pre-OS odm to Post-OS odm support. Seamless boot case is also considered. [HOW] Revised validation logic when marking for seamless boot. Init resources accordingly when Pre-OS has odm enabled. Reset odm and det size when transitioning Pre-OS odm to Post-OS non-odm to avoid corruption. Apply logic to set odm accordingly upon commit. Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Duncan Ma Signed-off-by: Alex Deucher commit 56b5b1c7b3d7319d4bf980cf0dd05d7c808c230d Author: Oliver Logush Date: Tue Mar 29 17:39:04 2022 -0400 drm/amd/display: Always update DPPCLK_DTO when clock increase [why] Need to update the update_clock sequence to a fully tested sequence for dcn30 [how] Removed the check to see if clock is lowered Reviewed-by: Charlene Liu Acked-by: Pavle Kotarac Signed-off-by: Oliver Logush Signed-off-by: Alex Deucher commit c1b972a18d05d007f0ddff31db2ff50790576e92 Author: Oliver Logush Date: Tue Mar 22 10:26:19 2022 -0400 drm/amd/display: Insert pulling smu busy status before sending another request [why] Make sure smu is not busy before sending another request, this is to prevent stress failures from MS. [how] Check to make sure the SMU fw busy signal is cleared before sending another request Reviewed-by: Charlene Liu Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Oliver Logush Signed-off-by: Alex Deucher commit 593692d2de458a68c8e2326d48d1325d87947d90 Author: Paul Hsieh Date: Wed Mar 16 06:59:46 2022 +0800 drm/amd/display: Power down hardware if timer not trigger [WHY] In headless systems, if SetMode/Power down timer is not called, hardware will not be powered down causing HW/SW discrepancies. Powering down hardware on SetPowerState to D3 will ensure SW/HW state is accurate. [HOW] 1. If PowerDownThread timer is not trigger but OS call SetPowerState to D3, power down hardware. 2. Update HDMI hang w/a to apply to all TMDS signals on headless system Reviewed-by: Martin Leung Acked-by: Pavle Kotarac Signed-off-by: Paul Hsieh Signed-off-by: Alex Deucher commit 382aceb305789d2e038baf2565c39e4117fa58d5 Author: Charlene Liu Date: Wed Mar 30 15:25:00 2022 -0400 drm/amd/display: remove dtbclk_ss compensation for dcn316 [why] dcn316's dtbclk is from non_ss clock source. no compensation required here. Reviewed-by: Chris Park Acked-by: Pavle Kotarac Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit aa4be41617a8034f73aa7fdaf7d8a0573a6a2b9d Author: Evgenii Krasnikov Date: Wed Jan 26 15:11:53 2022 -0500 drm/amd/display: ensure PSR force_static flag can always be set [HOW&WHY] Make sure psr_force_static() can always be called regardless of psr_allow_active value. Reviewed-by: Harry Vanzylldejong Reviewed-by: Evgenii Krasnikov Reviewed-by: Nicholas Choi Acked-by: Pavle Kotarac Signed-off-by: Evgenii Krasnikov Signed-off-by: Alex Deucher commit da8c25929b78b39438eb62b87e213c45dfad6038 Author: Harry VanZyllDeJong Date: Tue Jan 11 15:11:42 2022 -0500 drm/amd/display: Fix crash on setting VRR with no display connected [HOW&WHY] VRR was getting set at the same time the timing generator would be null when there was no display connected. Added null check to the timing generator variable so it does not get referenced if it is null. Reviewed-by: Harry Vanzylldejong Reviewed-by: Evgenii Krasnikov Reviewed-by: Nicholas Choi Acked-by: Pavle Kotarac Signed-off-by: Harry VanZyllDeJong Signed-off-by: Alex Deucher commit 9e6a04651e0231c4ad660e1580b40e56d6d5fde5 Author: Iswara Nagulendran Date: Wed Jan 5 17:56:25 2022 -0500 drm/amd/display: Disable FEC if DSC not supported for EDP [WHY] Screen was seen corrupted for a few ms when switching both ways. There was also not enough bandwidth for HDR to be enabled in HG disabled mode. This was due to FEC being enabled although DSC was not supported or disabled for the EDP. [HOW] Check for EDP DSC support in DC caps or if DSC should be disabled for EDP before enabling FEC for EDP. Reviewed-by: Harry Vanzylldejong Reviewed-by: Evgenii Krasnikov Reviewed-by: Nicholas Choi Acked-by: Pavle Kotarac Signed-off-by: Iswara Nagulendran Signed-off-by: Alex Deucher commit a941d5ee4c579682e36063dd966e041bd8368ab8 Author: Mateusz Palczewski Date: Tue Mar 29 09:35:43 2022 +0200 i40e: Add Ethernet Connection X722 for 10GbE SFP+ support Add support for Ethernet Connection X722 for 10GbE SFP+ cards. Make possible for the driver to bind to the card. Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit c8631e61f4d459ce9259ffddbb23baafd514c98d Author: Nabil S. Alramli Date: Thu Mar 24 20:03:38 2022 +0000 i40e: Add vsi.tx_restart to i40e ethtool stats Add vsi.tx_restart to the i40e driver ethtool statistics Signed-off-by: Nabil S. Alramli Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit f728fa01666952fc077801f2a12a088a49d3b543 Author: Joe Damato Date: Thu Mar 24 12:46:58 2022 -0700 i40e: Add tx_stopped stat Track TX queue stop events and export the new stat with ethtool. Signed-off-by: Joe Damato Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 69e66c04c672d8ff83f76e625c27a4d7cd717c08 Author: Joe Damato Date: Thu Mar 17 21:12:12 2022 -0700 ice: Add mpls+tso support Attempt to add mpls+tso support. I don't have ice hardware available to test myself, but I just implemented this feature in i40e and thought it might be useful to implement for ice while this is fresh in my brain. Hoping some one at intel will be able to test this on my behalf. Signed-off-by: Joe Damato Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 61cada8da2f4c67026e41915f91673f045d4b18c Author: Krzysztof Kozlowski Date: Mon Apr 11 11:53:17 2022 +0200 dt-bindings: power: renesas,rcar-sysc: correct typo in path Fix typo '.' -> '/' in the path to headers. Fixes: 981a34054038 ("dt-bindings: power: renesas,rcar-sysc: drop useless consumer example") Reported-by: Geert Uytterhoeven Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220411095317.221317-1-krzysztof.kozlowski@linaro.org commit d3c17b5df3620317e67f6643f904ac7ff3d23664 Merge: 590032a4d2133 e94295e0ed274 Author: Jakub Kicinski Date: Tue Apr 12 09:51:43 2022 -0700 Merge branch 'mlxsw-extend-device-registers-for-line-cards-support' Ido Schimmel says: ==================== mlxsw: Extend device registers for line cards support This patch set prepares mlxsw for line cards support by extending device registers with a slot index, which allows accessing components found on a line card at a given slot. Currently, only slot index 0 (main board) is used. No user visible changes that I am aware of. ==================== Link: https://lore.kernel.org/r/20220411144657.2655752-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit e94295e0ed274b86f42d93b8b63d207deb484459 Author: Vadim Pasternak Date: Mon Apr 11 17:46:57 2022 +0300 mlxsw: reg: Add new field to Management General Peripheral Information Register Add new field 'max_modules_per_slot' to provide maximum number of modules that can be connected per slot. This field will always be zero, if 'slot_index' in query request is set to non-zero value, otherwise value in this field will provide maximum modules number, which can be equipped on device inserted at any slot. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 64e65a540e6df27944c61b03ed2ac8fe797a0afa Author: Vadim Pasternak Date: Mon Apr 11 17:46:56 2022 +0300 mlxsw: core_env: Pass slot index during PMAOS register write call Pass the slot index down to PMAOS pack helper alongside with the module. Signed-off-by: Jiri Pirko Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit b691602c6f96369542d8f9e078610f89af2ad673 Author: Vadim Pasternak Date: Mon Apr 11 17:46:55 2022 +0300 mlxsw: reg: Extend MGPIR register with new slot fields Extend MGPIR (Management General Peripheral Information Register) with new fields specifying the slot number and number of the slots available on system. The purpose of these fields is: - to support access to MPGIR register on modular system for getting the number of cages, equipped on the line card, inserted at specified slot. In case slot number is set zero, MGPIR will provide the information for the main board. For Top of the Rack (non-modular) system it will provide the same as before. - to provide the number of slots supported by system. This data is relevant only in case slot number is set zero. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 7cb85d3c696ef16405db354c8ef00ea9c666fba8 Author: Vadim Pasternak Date: Mon Apr 11 17:46:54 2022 +0300 mlxsw: reg: Extend PMMP register with new slot number field Extend PMMP (Port Module Memory Map Properties Register) with new field specifying the slot number. The purpose of this field is to enable overriding the cable/module memory map advertisement. For non-modular systems the 'module' number uniquely identifies the transceiver location. For modular systems the transceivers are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'module', specifying cage transceiver within the line card. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 655cbb1d7530e0d13e0cbfc2a39cc3281a7596e2 Author: Vadim Pasternak Date: Mon Apr 11 17:46:53 2022 +0300 mlxsw: reg: Extend MCION register with new slot number field Extend MCION (Management Cable IO and Notifications Register) with new field specifying the slot number. The purpose of this field is to support access to MCION register for query cage transceiver on modular system. For non-modular systems the 'module' number uniquely identifies the transceiver location. For modular systems the transceivers are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'module', specifying cage transceiver within the line card. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 89dd6fcd07f9adda02ea3be31966a9a7fc4eed2a Author: Vadim Pasternak Date: Mon Apr 11 17:46:52 2022 +0300 mlxsw: reg: Extend MCIA register with new slot number field Extend MCIA (Management Cable Info Access Register) with new field specifying the slot number. The purpose of this field is to support access to MCIA register for reading cage cable information on modular system. For non-modular systems the 'module' number uniquely identifies the transceiver location. For modular systems the transceivers are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'module', specifying cage transceiver within the line card. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit c6e6ad703ed29af57af85ac8647b34763ae06cdf Author: Vadim Pasternak Date: Mon Apr 11 17:46:51 2022 +0300 mlxsw: reg: Extend MTBR register with new slot number field Extend MTBR (Management Temperature Bulk Register) with new field specifying the slot number. The purpose of this field is to support access to MTBR register for reading temperature sensors on modular system. For non-modular systems the 'sensor_index' uniquely identifies the cage sensors. For modular systems the sensors are identified by two indexes: - 'slot_index', specifying the slot number, where line card is located; - 'sensor_index', specifying cage sensor within the line card. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit d30bed29a71806c6f686fc8776b5279e897cc742 Author: Vadim Pasternak Date: Mon Apr 11 17:46:50 2022 +0300 mlxsw: reg: Extend MTMP register with new slot number field Extend MTMP (Management Temperature Register) with new field specifying the slot index. The purpose of this field is to support access to MTMP register for reading temperature sensors on modular systems. For non-modular systems the 'sensor_index' uniquely identifies the cage sensors, while 'slot_index' is always 0. For modular systems the sensors are identified by: - 'slot_index', specifying the slot index, where line card is located; - 'sensor_index', specifying cage sensor within the line card. Signed-off-by: Vadim Pasternak Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit b30026f9ff3195cb93f9fbbb633dce5532b1260a Merge: 68d9787bdd5cb eac3e5b1c12f8 Author: Mathieu Poirier Date: Tue Apr 12 10:31:19 2022 -0600 Merge branch 'rproc-fixes' into rproc-next commit b4fb2d33514a511312e1c0e470771eaa4a94d8ec Author: Joe Damato Date: Wed Mar 2 17:29:07 2022 -0800 i40e: Add support for MPLS + TSO This change adds support for TSO of MPLS packets. In my tests with tcpdump it seems to work. Note this test setup has a 9000 byte MTU: MPLS (label 100, exp 0, [S], ttl 64) IP srcip.50086 > dstip.1234: Flags [P.], seq 593345:644401, ack 0, win 420, options [nop,nop,TS val 45022534 ecr 1722291395], length 51056 IP dstip.1234 > srcip.50086: Flags [.], ack 593345, win 122, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 IP dstip.1234 > srcip.50086: Flags [.], ack 602289, win 105, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 IP dstip.1234 > srcip.50086: Flags [.], ack 620177, win 71, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 MPLS (label 100, exp 0, [S], ttl 64) IP srcip.50086 > dstip.1234: Flags [P.], seq 644401:655953, ack 0, win 420, options [nop,nop,TS val 45022534 ecr 1722291395], length 11552 IP dstip.1234 > srcip.50086: Flags [.], ack 638065, win 37, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 IP dstip.1234 > srcip.50086: Flags [.], ack 644401, win 25, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 IP dstip.1234 > srcip.50086: Flags [.], ack 653345, win 8, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 IP dstip.1234 > srcip.50086: Flags [.], ack 655953, win 3, options [nop,nop,TS val 1722291395 ecr 45022534], length 0 Signed-off-by: Joe Damato Co-developed-by: Mike Gallo Signed-off-by: Mike Gallo Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit eac3e5b1c12f85732e60f5f8b985444d273866bb Author: Christophe JAILLET Date: Sat Apr 9 08:27:54 2022 +0200 remoteproc: mtk_scp: Fix a potential double free 'scp->rproc' is allocated using devm_rproc_alloc(), so there is no need to free it explicitly in the remove function. Fixes: c1407ac1099a ("remoteproc: mtk_scp: Use devm variant of rproc_alloc()") Signed-off-by: Christophe JAILLET Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/1d15023b4afb94591435c48482fe1276411b9a07.1648981531.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier commit 6f381481a5b236cb53d6de2c49c6ef83a4d0f432 Author: Biju Das Date: Mon Apr 11 18:31:15 2022 +0100 spi: spi-rspi: Remove setting {src,dst}_{addr,addr_width} based on DMA direction The direction field in the DMA config is deprecated. The rspi driver sets {src,dst}_{addr,addr_width} based on the DMA direction and it results in dmaengine_slave_config() failure as RZ DMAC driver validates {src,dst}_addr_width values independent of DMA direction. This patch fixes the issue by passing both {src,dst}_{addr,addr_width} values independent of DMA direction. Signed-off-by: Biju Das Suggested-by: Vinod Koul Reviewed-by: Vinod Koul Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220411173115.6619-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit b3fe2e516741368a643d79527ebccfe557217a53 Author: Paul Kocialkowski Date: Tue Apr 12 14:22:07 2022 +0200 spi: core: Only check bits_per_word validity when explicitly provided On SPI device probe, the core will call spi_setup in spi_add_device before the corresponding driver was probed. When this happens, the bits_per_word member of the device is not yet set by the driver, resulting in the default being set to 8 bits-per-word. However some controllers do not support 8 bits-per-word at all, which results in a failure when checking the bits-per-word validity. In order to support these devices, skip the bits-per-word validity check when it is not explicitly provided by drivers. Signed-off-by: Paul Kocialkowski Link: https://lore.kernel.org/r/20220412122207.130181-1-paul.kocialkowski@bootlin.com Signed-off-by: Mark Brown commit c6cf1fafb65dda10f3babcec76991cbc304d02b9 Author: Minghao Chi Date: Tue Apr 12 07:09:06 2022 +0000 spi: spi-stm32-qspi: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20220412070906.2532091-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit c721905c54d913db0102973dbcdfb48d91146a2d Author: Minghao Chi Date: Tue Apr 12 08:30:00 2022 +0000 ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220412083000.2532711-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 506840600613027f139d30447a2c27ec8088c698 Author: Corentin Labbe Date: Mon Apr 11 19:44:09 2022 +0000 ASoC: fix invalid yaml The word "or" is useless and breaks yaml validation. Signed-off-by: Corentin Labbe Link: https://lore.kernel.org/r/20220411194409.3390002-1-clabbe@baylibre.com Signed-off-by: Mark Brown commit 122cef68f1035e704ff7fe778c07d596bf5a1fa2 Merge: 09b955f676d93 cbd5ce7f428b4 Author: Mark Brown Date: Tue Apr 12 17:16:54 2022 +0100 ASoC: remaining simple i2c probe changes Merge series from Stephen Kitt : This series covers all the remaining changes to migrate sound/soc/codecs i2c probes to probe_new, where the const struct i2c_client * argument is unused; there are a few remaining files which use the argument and will need i2c_match_id migration. commit 09b955f676d93ca69f4eaa5e13f100911084d5fa Merge: 2f7f0994cc964 e760f102c92c1 Author: Mark Brown Date: Tue Apr 12 17:16:52 2022 +0100 ASoC: SOF: Abstractions for top-level IPC ops Merge series from Ranjani Sridharan : This series is continuation of the IPC abstraction in the SOF driver in preparation for supporting the new IPC supported by the SOF firmware. It introduces abstraction for top-level IPC ops for sending/receiving regular and large IPC's. Peter Ujfalusi (15): ASoC: SOF: Add helper function to prepare and send an IPC message ASoC: SOF: Add high level IPC IO callback definitions to ipc_ops ASoC: SOF: ipc3: Implement the tx_msg IPC ops ASoC: SOF: ipc3: Use sof_ipc3_tx_msg() internally for message sending ASoC: SOF: ipc3: Implement the set_get_data IPC ops ASoC: SOF: ipc3: Implement the get_reply IPC ops ASoC: SOF: ipc3: Implement rx_msg IPC ops ASoC: SOF: ipc: Separate the ops checks by functions/topics ASoC: SOF: ipc: Add check for mandatory IPC message handling ops ASoC: SOF: ipc: Use the get_reply ops in snd_sof_ipc_get_reply() ASoC: SOF: ipc: Switch over to use the tx_msg and set_get_data ops ASoC: SOF: ipc: Switch over to use the rx_msg ops ASoC: SOF: Add widget_kcontrol_setup control ops for IPC3 ASoC: SOF: sof-audio: Use the widget_kcontrol_setup ops for kcontrol set up ASoC: SOF: ipc: Move the ipc_set_get_comp_data() local to ipc3-control sound/soc/sof/ipc.c | 858 ++--------------------------------- sound/soc/sof/ipc3-control.c | 131 +++++- sound/soc/sof/ipc3.c | 682 +++++++++++++++++++++++++++- sound/soc/sof/sof-audio.c | 54 +-- sound/soc/sof/sof-audio.h | 7 +- sound/soc/sof/sof-priv.h | 28 +- 6 files changed, 880 insertions(+), 880 deletions(-) -- 2.25.1 commit 2f7f0994cc964529cb47eb073baf2bd1ed7563ad Merge: 31c90dd56ae29 5426f506b5842 Author: Mark Brown Date: Tue Apr 12 17:16:51 2022 +0100 Allow detecting ACP6x DMIC via _DSD Merge series from Mario Limonciello : It's not possible to probe for the presence of a DMIC, so the ACP6x machine driver currently has a hardcoded list of all the systems known to have a DMIC connected to the ACP. Although this design works it means that the acp6x driver needs to always grow with more systems and worse, if an OEM introduces a new system there will be a mismatch in time that even if the driver (otherwise) works fine it needs their system added to the list to work. So this series introduces a _DSD that OEMs can populate into the BIOS to indicate presence of a DMIC. commit 79649041edc8323ba7c159e5c7e2d2d55aaa9733 Merge: 780d9c48a05a2 4a5fb1bbcdf1c Author: Kalle Valo Date: Tue Apr 12 17:31:44 2022 +0300 Merge branch 'wfx-move-out-of-staging' This is an immutable branch shared between wireless-next and staging-next for moving wfx driver out of staging to drivers/net/wireless directory. commit 5a026558d2a994a5e58ca6fcab34008b95fea7e1 Author: Douglas Anderson Date: Mon Apr 11 14:13:39 2022 -0700 arm64: dts: qcom: sc7280-herobrine: Audio codec wants 1.8V, not 1.62V The L2C rail on herobrine boards is intended to go to the audio codec. Let's override the 1.62V specified in the qcard.dtsi file to be 1.8V. Signed-off-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411141332.v2.1.I9f06fec63b978699fe62591fec9e5ac31bb3a69d@changeid commit 7011db96f69316e8055961b366ac92b6c28403dd Author: Bhupesh Sharma Date: Mon Feb 28 18:00:17 2022 +0530 arm64: dts: qcom: ipq6018: Fix qmp usb3 phy node Fix the following 'make dtbs_check' warning(s) by using phy@ instead of lanes@ and by moving '#clock-cells' to sub-node: arch/arm64/boot/dts/qcom/ipq6018-cp01-c1.dt.yaml: ssphy@78000: 'lane@78200' does not match any of the regexes: '^phy@[0-9a-f]+$', 'pinctrl-[0-9]+' Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Reviewed-by: Shawn Guo [bjorn: s/clock-names/clock-cells/ per Shawn's feedback] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228123019.382037-7-bhupesh.sharma@linaro.org commit c769a3521dd5b8605b35ed246b7a0cb4567cdec4 Author: Bhupesh Sharma Date: Mon Feb 28 18:00:16 2022 +0530 arm64: dts: qcom: sm8450: Fix qmp ufs phy node (use phy@ instead of lanes@) Fix the 'make dtbs_check' warning: arch/arm64/boot/dts/qcom/sm8450-qrd.dt.yaml: phy@1d87000: 'lanes@1d87400' does not match any of the regexes: '^phy@[0-9a-f]+$', 'pinctrl-[0-9]+' Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Reviewed-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228123019.382037-6-bhupesh.sharma@linaro.org commit 56205c56ea2a050ee6a237ba686cea0b38860c84 Author: Bhupesh Sharma Date: Mon Feb 28 18:00:15 2022 +0530 arm64: dts: qcom: sc7280: Fix qmp phy node (use phy@ instead of lanes@) Fix the 'make dtbs_check' warning: arch/arm64/boot/dts/qcom/sc7280-idp.dt.yaml: phy@1c0e000: 'lanes@1c0e200' does not match any of the regexes: '^phy@[0-9a-f]+$', 'pinctrl-[0-9]+' Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Reviewed-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228123019.382037-5-bhupesh.sharma@linaro.org commit cde8b4d070bd98587f5e13a5a5e63e88cfe31322 Author: Bhupesh Sharma Date: Mon Feb 28 18:00:14 2022 +0530 arm64: dts: qcom: msm8996-xiaomi: Drop max-microamp and vddp-ref-clk properties from QMP PHY The following properties are not supported and causing dtbs_check warnings. - vdda-phy-max-microamp - vdda-pll-max-microamp - vddp-ref-clk-max-microamp - vddp-ref-clk-always-on arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dt.yaml: phy@627000: 'vdda-phy-max-microamp', 'vddp-ref-clk-always-on', 'vddp-ref-clk-max-microamp' do not match any of the regexes: '^phy@[0-9a-f]+$', 'pinctrl-[0-9]+' Drop them from QMP PHY nodes for 'msm8996-xiaomi' dts. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228123019.382037-4-bhupesh.sharma@linaro.org commit c38406aa46da8f417ee30e6ba1fad71f891ec8be Author: Stephan Gerhold Date: Mon Feb 28 23:54:00 2022 +0100 arm64: dts: qcom: msm8916: Add BAM-DMUX for WWAN network interfaces The BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, including MSM8916. Add the nodes for the BAM DMA engine and BAM-DMUX to enable using WWAN on smartphones/tablets based on MSM8916. This should work out of the box with open-source WWAN userspace such as ModemManager. The nodes are disabled by default to avoid loading unnecessary drivers on devices that cannot use BAM-DMUX (e.g. DragonBoard 410c). However, strictly speaking the nodes could be enabled by default since both the bam_dma and bam_dmux driver will simply do nothing if the modem does not announce any BAM-DMUX channels. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228225400.146555-3-stephan@gerhold.net commit 64d3cb73b317a60d162f08533533aa5f1d9cfe72 Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:35 2022 +0300 arm64: dts: qcom: add pm8450 support Add PM8450 PMIC device tree include file. It is going to be used by SM8450-based devices. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-8-dmitry.baryshkov@linaro.org commit 7dc11169a0990f7efcd9515e012f9257aa6035b6 Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:33 2022 +0300 arm64: dts: qcom: pmr735a: stop depending on thermal_zones label Most of SoC device trees do not provide the thermal_zones label. Thus stop depending on it and use the full path to the thermal zones nodes. Fixes: 7a3544e5d4e8 ("arm64: dts: qcom: pmr735a: Add temp-alarm support") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-6-dmitry.baryshkov@linaro.org commit d67ddd17dedd1b7f1c287a9f32f5db084a7c85eb Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:32 2022 +0300 arm64: dts: qcom: pm8350c: stop depending on thermal_zones label Most of SoC device trees do not provide the thermal_zones label. Thus stop depending on it and use the full path to the thermal zones nodes. Fixes: 3795fe7d497b ("arm64: dts: qcom: pm8350c: Add temp-alarm support") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-5-dmitry.baryshkov@linaro.org commit 6f3426b3dea42abbe8d797560966056303d7cbd6 Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:31 2022 +0300 arm64: dts: qcom: pmr735b: add temp sensor and thermal zone config Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-4-dmitry.baryshkov@linaro.org commit 5c1399299d9d82cb378bd22049da0ae08c4efa54 Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:30 2022 +0300 arm64: dts: qcom: pm8350b: add temp sensor and thermal zone config Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-3-dmitry.baryshkov@linaro.org commit 7a79b95f4288c67b72a1c90c90a4fb6ad6fc0c6d Author: Dmitry Baryshkov Date: Sat Feb 26 23:50:29 2022 +0300 arm64: dts: qcom: pm8350: add temp sensor and thermal zone config Add temp-alarm device tree node and a default configuration for the corresponding thermal zone for this PMIC. Temperatures are based on downstream values. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226205035.1826360-2-dmitry.baryshkov@linaro.org commit a2d2c809cfeeb35b9e0a17940fcee90ff195b592 Author: Baruch Siach Date: Mon Feb 28 08:58:44 2022 +0200 arm64: dts: qcom: ipq6018: Add mdio bus description The IPQ60xx has the same MDIO bug block as IPQ4019. Add IO range and clock resources description. Reviewed-by: Bryan O'Donoghue Signed-off-by: Baruch Siach Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/ef01a79ccc6ef86dc3a10d0fa3331794d49e9859.1646031524.git.baruch@tkos.co.il commit 726111e687192575e47de9e286ad0e45e2ce1466 Author: Jami Kettunen Date: Fri Feb 25 23:56:42 2022 +0200 arm64: dts: qcom: msm8998-oneplus-common: Add NFC The OnePlus 5/5T both have an NXP PN553 which is supported by the nxp-nci-i2c driver in mainline. It detects/reads NFC tags using "nfctool" and with the NearD test scripts data can also be written to be received by another device. Signed-off-by: Jami Kettunen Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225215642.3916-1-jami.kettunen@somainline.org commit e036b77be77d232f41a1f6dd91e4f1f238cbb680 Author: Sankeerth Billakanti Date: Wed Mar 16 23:05:46 2022 +0530 arm64: dts: qcom: sc7280: rename edp_out label to mdss_edp_out Rename the edp_out label in the sc7280 platform to mdss_edp_out so that the nodes related to mdss are all grouped together in the board specific files. Signed-off-by: Sankeerth Billakanti Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647452154-16361-2-git-send-email-quic_sbillaka@quicinc.com commit c5cb42cc8411c8313b0265777b90715e6d032ba1 Author: Vinod Koul Date: Fri Mar 25 22:05:37 2022 +0530 arm64: dts: qcom: sa8155p-adp: Enable ethernet node Enable the ethernet node, add the phy node and pinctrl for ethernet. [bhsharma: Correct ethernet/rgmii related pinmuxs, specify multi-queues and plug in the PHY interrupt for WOL] Cc: Bjorn Andersson Signed-off-by: Vinod Koul Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220325163537.1579969-3-bhupesh.sharma@linaro.org commit 05f333b746d48c985f6df3c4e7cc8e63a0f30840 Author: Vinod Koul Date: Fri Mar 25 22:05:36 2022 +0530 arm64: dts: qcom: sm8150: add ethernet node SM8150 SoC supports ethqos ethernet controller so add the node for it Cc: Bjorn Andersson Signed-off-by: Vinod Koul [bhsharma: Correct ethernet interrupt numbers and add power-domain] Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220325163537.1579969-2-bhupesh.sharma@linaro.org commit 606efee95767b54e8da4cce0429f1587ff1a3cb0 Author: Luca Weiss Date: Mon Mar 21 14:33:18 2022 +0100 arm64: dts: qcom: sm7225-fairphone-fp4: Enable UFS Configure and enable the nodes for UFS that are used for internal storage on FP4. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220321133318.99406-7-luca.weiss@fairphone.com commit 5a814af5fc229b2649c814921a39ae1f652e366d Author: Luca Weiss Date: Mon Mar 21 14:33:17 2022 +0100 arm64: dts: qcom: sm6350: Add UFS nodes Add the necessary nodes for UFS and its PHY. Signed-off-by: Luca Weiss Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220321133318.99406-6-luca.weiss@fairphone.com commit 0e0a8e35d72533b3eef3365e900baacd7cede8e2 Author: Dmitry Baryshkov Date: Tue Mar 15 17:11:04 2022 +0300 arm64: dts: qcom: sdm845: correct dynamic power coefficients Following sm8150/sm8250 update sdm845 capacity-dmips-mhz and dynamic-power-coefficient based on the measurements [1], [2]. The energy model dynamic-power-coefficient values were calculated with DPC = µW / MHz / V^2 for each OPP, and averaged across all OPPs within each cluster for the final coefficient. Voltages were obtained from the qcom-cpufreq-hw driver that reads voltages from the OSM LUT programmed into the SoC. Normalized DMIPS/MHz capacity scale values for each CPU were calculated from CoreMarks/MHz (CoreMark iterations per second per MHz), which serves the same purpose. For each CPU, the final capacity-dmips-mhz value is the C/MHz value of its maximum frequency normalized to SCHED_CAPACITY_SCALE (1024) for the fastest CPU in the system. For more details on measurement process see the commit message for the commit 6aabed5526ee ("arm64: dts: qcom: sm8250: Add CPU capacities and energy model"). [1] https://github.com/kdrag0n/freqbench [2] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main Cc: Danny Lin Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220315141104.730235-1-dmitry.baryshkov@linaro.org commit 6127d8e4cd096c4f5c8590617e22a2fdc80aee30 Author: Bhupesh Sharma Date: Sun Feb 27 00:10:28 2022 +0530 arm64: dts: qcom: sm8150: Add PDC as the interrupt parent for tlmm Several wakeup gpios supported by the Top Level Mode Multiplexer (TLMM) block on sm8150 can be used as interrupt sources and these interrupts are routed to the PDC interrupt controller. So, specify PDC as the interrupt parent for the TLMM block. Cc: Bjorn Andersson Cc: Vinod Koul Cc: Rob Herring Signed-off-by: Bhupesh Sharma Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226184028.111566-5-bhupesh.sharma@linaro.org commit 91d70eb70867f3fa4f0380c68253cda9e77e8bfc Author: Dmitry Baryshkov Date: Sun Apr 10 23:59:01 2022 +0300 arm64: dts: qcom: sm8450: add fastrpc nodes Add fastrpc device tree nodes for aDSP, cDSP and SLPI. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410205901.1672089-3-dmitry.baryshkov@linaro.org commit b36e493cecae89038ccafc59fb45ded3ae8a9bf4 Author: Dmitry Baryshkov Date: Sun Apr 10 23:59:00 2022 +0300 arm64: dts: qcom: sm8450-hdk: Enable remoteproc instances Enable the audio, compute, sensor and modem remoteproc and specify firmware path for these on the Qualcomm SM8450 HDK. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220410205901.1672089-2-dmitry.baryshkov@linaro.org commit 66d7cadb7a4362b317764b7bb859ef76bddfe43a Author: Dmitry Baryshkov Date: Mon Apr 11 14:58:08 2022 +0300 arm64: dts: qcom: msm8996: remove snps,dw-pcie compatibles On MSM8996 PCI controller bindings are not compatible with snps,dw-pcie binding. The platform doesn't provide second (global) IRQ, it requires additional glue code. To prevent it from probing against the dw-pcie driver, remove corresponding compatible. Fixes: ed965ef89227 ("arm64: dts: qcom: msm8996: add support to pcie") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411115808.1976500-2-dmitry.baryshkov@linaro.org commit b4f3996c756ad9e13a6c5ce06c56c2f1dd05768d Author: Dmitry Baryshkov Date: Mon Apr 11 14:58:07 2022 +0300 arm64: dts: qcom: sdm845: remove snps,dw-pcie compatibles On SDM845 PCI controller bindings are not compatible with snps,dw-pcie binding. The platform doesn't provide second (global) IRQ, it requires additional glue code. To prevent it from probing against the dw-pcie driver, remove corresponding compatible. Fixes: 5c538e09cb19 ("arm64: dts: qcom: sdm845: Add first PCIe controller and PHY") Fixes: 42ad231338c1 ("arm64: dts: qcom: sdm845: Add second PCIe PHY and controller") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220411115808.1976500-1-dmitry.baryshkov@linaro.org commit 61fd9113f0c743153c76f6bc72938800bbb57ccc Author: Dmitry Baryshkov Date: Sun Apr 3 22:39:11 2022 +0300 arm64: dts: qcom: apq8096-db820c: enable MSS node APQ8096 provides a 'modem' with reduced functionality, mainly targeting location services. Enable corresponding device tree node. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220403193911.1393920-3-dmitry.baryshkov@linaro.org commit 73f7731b6831876fb61c32be1e75c4ad6ac25dbf Author: Yassine Oudjana Date: Sun Sep 26 19:06:45 2021 +0000 arm64: dts: qcom: msm8996-xiaomi-*: Enable MSS and SLPI Enable mss_pil and slpi_pil and set their firmware paths. Signed-off-by: Yassine Oudjana Tested-by: Dmitry Baryshkov #db820c Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210926190555.278589-6-y.oudjana@protonmail.com commit 127dd2f08d274d9be9a6b1172035ebf7b7d51bc7 Author: Yassine Oudjana Date: Sun Sep 26 19:06:35 2021 +0000 arm64: dts: qcom: msm8996: Add MSS and SLPI Add nodes for the MSS and SLPI remoteprocs. Signed-off-by: Yassine Oudjana Tested-by: Dmitry Baryshkov #db820c Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210926190555.278589-5-y.oudjana@protonmail.com commit 6d338feb553a32efee3ca50f503ab36e01455924 Author: Yassine Oudjana Date: Sun Sep 26 19:06:28 2021 +0000 arm64: dts: qcom: msm8996: Unify smp2p naming Rename smp2p-modem to smp2p-mpss, and make the subnode labels of smp2p_adsp and smp2p_slpi follow the _smp2p_ layout. Also move smp2p_slpi_out above smp2p_slpi_in to make it match mpss and adsp where master-kernel is the first subnode. This patch brings no functional change. Signed-off-by: Yassine Oudjana Tested-by: Dmitry Baryshkov #db820c Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210926190555.278589-4-y.oudjana@protonmail.com commit 902d97a44211b17bae49442b770ac5311b7c0b32 Author: Yassine Oudjana Date: Sun Sep 26 19:06:16 2021 +0000 arm64: dts: qcom: msm8996: Revamp reserved memory Fix a total overlap between zap_shader_region and slpi_region, and rename all regions to match the naming convention in other Qualcomm SoC device trees. Signed-off-by: Yassine Oudjana Tested-by: Dmitry Baryshkov #db820c Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210926190555.278589-2-y.oudjana@protonmail.com commit 0deb2624e2d09aa158495ead66906fb437a67148 Author: Bhupesh Sharma Date: Sun Apr 3 20:11:51 2022 +0530 arm64: dts: qcom: sa8155p-adp: Add support for uSD card Add support for uSD card on SA8155p-ADP board using the SDHC2 interface. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220403144151.92572-3-bhupesh.sharma@linaro.org commit 876644c7603440279545fab4988edd424aea6d9f Author: Bhupesh Sharma Date: Sun Apr 3 20:11:50 2022 +0530 arm64: dts: qcom: sm8150: Add support for SDC2 Add support for SDC2 which can be used to interface uSD card. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220403144151.92572-2-bhupesh.sharma@linaro.org commit 6b834df8391b5f1ee710b4750d2ed39a6d0c693d Author: Dmitry Baryshkov Date: Sun Apr 3 13:57:11 2022 +0300 arm64: dts: qcom: sdm845-db845c: add wifi variant property Dragonboard845c doesn't have board-specific board-id programmed, it uses generic 0xff. Thus add the property with the 'variant' of the calibration data. Note: the driver will check for the calibration data for the following IDs, so older board-2.bin files that were distributed as a part of Linaro releases will continue to work. - 'bus=snoc,qmi-board-id=ff,qmi-chip-id=30214,variant=Thundercomm_DB845C' - 'bus=snoc,qmi-board-id=ff,qmi-chip-id=30214' - 'bus=snoc,qmi-board-id=ff' For the reference, the board is identified by the driver in the following way: ath10k_snoc 18800000.wifi: qmi chip_id 0x30214 chip_family 0x4001 board_id 0xff soc_id 0x40030001 ath10k_snoc 18800000.wifi: qmi fw_version 0x2009856b fw_build_timestamp 2018-07-19 12:28 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1 Fixes: 3f72e2d3e682 ("arm64: dts: qcom: Add Dragonboard 845c") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220403105711.1173161-1-dmitry.baryshkov@linaro.org commit 2374b99e19ac7f2beca2d4e62ebb96803db0e66b Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:44 2022 +0200 arm64: dts: qcom: align clocks in I2C/SPI with DT schema The DT schema expects clocks core-iface order. No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-3-krzysztof.kozlowski@linaro.org commit 0e1b27f4f69e86b8b62ba5bedb78936341433247 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:43 2022 +0200 arm64: dts: qcom: align dmas in I2C/SPI/UART with DT schema The DT schema expects dma channels in tx-rx order. No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-2-krzysztof.kozlowski@linaro.org commit dcd0a663544fe978d658520709dfeaeb95ee855a Author: Krzysztof Kozlowski Date: Tue Apr 5 08:57:51 2022 +0200 arm64: dts: qcom: msm8916: rename WCNSS child name to bluetooth The "bluetooth" is more popular and more descriptive than "bt", for a Bluetooth device. The WCNSS DT schema will expect such naming. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405065752.27389-2-krzysztof.kozlowski@linaro.org commit 0fa44edd0f8fe2bd829827adcc5659304c8ab7fa Author: Souradeep Chowdhury Date: Wed Apr 6 15:03:48 2022 +0530 arm64: dts: qcom: sc7280: Set the default dr_mode for usb2 Set the default dr_mode for usb2 node to "otg" to enable role-switch for EUD(Embedded USB Debugger) connector node. Signed-off-by: Souradeep Chowdhury Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/451392a942f90aa9805b00afad7dff894604d189.1649235218.git.quic_schowdhu@quicinc.com commit cdbfb815d63a792fb565ab15c8f565833bb86c8b Author: Manikanta Pubbisetty Date: Wed Apr 6 16:43:03 2022 +0530 arm64: dts: qcom: sc7280: Add WCN6750 WiFi node Add DTS node for WCN6750 WiFi chipset. Signed-off-by: Manikanta Pubbisetty Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220406111303.27670-1-quic_mpubbise@quicinc.com commit 7ba57d11e5bb57095e6d312b518ae9ceb7efcbf1 Author: Krzysztof Kozlowski Date: Thu Apr 7 11:27:25 2022 +0200 arm64: dts: qcom: sm8350: drop duplicated ref_clk in UFS ref_clk clock in UFS node is already there with a <0 0> frequency, which matches other DTSI files. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407092725.232463-3-krzysztof.kozlowski@linaro.org commit 64ff698424433dc5d2e827de2a4cc927300d7fe2 Author: Krzysztof Kozlowski Date: Thu Apr 7 11:27:24 2022 +0200 arm64: dts: qcom: msm8996: correct UFS compatible The Qualcomm UFS bindings require to use specific (qcom,msm8996-ufshc) and generic (jedec,ufs-2.0) compatibles. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407092725.232463-2-krzysztof.kozlowski@linaro.org commit b32846a38fc2a68f6a9c1149b495fa4ca2552f20 Author: Krzysztof Kozlowski Date: Thu Apr 7 11:27:23 2022 +0200 arm64: dts: qcom: msm8996: drop unsupported UFS vddp-ref-clk-max-microamp The property vddp-ref-clk-max-microamp (for VDDP ref clk supply which is l25 regulator) is not documented in MSM8996 UFS PHY bindings (qcom,msm8996-qmp-ufs-phy). It is mentioned in the other UFS PHY bindings for qcom,msm8996-ufs-phy-qmp-14nm. The MSM8996-based Xiaomi devices configure l25 regulator in a conflicting way: 1. with maximum 100 uAmp for VDDP ref clk supply of UFS PHY, 2. with maximum 450 mAmp for VCCQ supply of UFS. Since the vddp-ref-clk-max-microamp property is basically not documented for that UFS PHY and has a conflicting values, drop it entirely as it looks like not tested and not used ever. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407092725.232463-1-krzysztof.kozlowski@linaro.org commit 2b6d37f6b7fe2f98197b77adcce81d4198aeb305 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:31:12 2022 +0200 arm64: dts: qcom: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407143112.294930-2-krzysztof.kozlowski@linaro.org commit aff4d695b4eb3b279bfff53d2f06f464e363ee4a Author: Rob Herring Date: Thu Apr 7 17:52:54 2022 -0500 arm64: dts: qcom: sdm845: shift6mq: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Cc: Andy Gross Cc: Bjorn Andersson Cc: Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Rob Herring [bjorn: Updated subject prefix] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407225254.2178644-1-robh@kernel.org commit 2f917af777011c88e977b9b9a5d00b280d3a59ce Author: Xiao Yang Date: Sun Apr 10 19:35:13 2022 +0800 RDMA/rxe: Generate a completion for unsupported/invalid opcode Current rxe_requester() doesn't generate a completion when processing an unsupported/invalid opcode. If rxe driver doesn't support a new opcode (e.g. RDMA Atomic Write) and RDMA library supports it, an application using the new opcode can reproduce this issue. Fix the issue by calling "goto err;". Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20220410113513.27537-1-yangx.jy@fujitsu.com Signed-off-by: Xiao Yang Signed-off-by: Jason Gunthorpe commit 780d9c48a05a2945912a9f7e0f511c8024e38f40 Author: Lv Ruyi Date: Mon Apr 11 03:24:58 2022 +0000 rtlwifi: rtl8192cu: Fix spelling mistake "writting" -> "writing" There are some spelling mistakes in the comments. Fix it. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220411032458.2517551-1-lv.ruyi@zte.com.cn commit e8c241d4a7fa07c0a21a69eb68a98efd818f2a77 Author: Lv Ruyi Date: Fri Apr 8 09:58:03 2022 +0000 rtlwifi: Fix spelling mistake "cacluated" -> "calculated" There are some spelling mistakes in the comments. Fix it. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408095803.2495336-1-lv.ruyi@zte.com.cn commit f96f8ae08d33eeae65581b6dbf25d12e307e7b2c Author: Davidlohr Bueso Date: Mon Apr 11 08:16:20 2022 -0700 staging/rtl8192e,ieee80211: replace ps tasklet with work Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. rtllib_sta_ps() and ieee80211_sta_ps() will now run in process context and have further concurrency (tasklets being serialized among themselves), but this is done holding the ieee->lock, so it should be fine. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-7-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit 2a2849a87c7272e1cb8ca9cea70c664904c9e0f9 Author: Davidlohr Bueso Date: Mon Apr 11 08:16:19 2022 -0700 staging/rtl8712: remove event_tasklet This is unused. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-6-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit a2b0b41619e16e8f3d1461ba7588f2da6a92a1ea Author: Davidlohr Bueso Date: Mon Apr 11 08:16:18 2022 -0700 staging/ks7010: replace SME taslet with work Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. The execution of the SME event will now occur in task context. There are, however, changes in concurrency. Workqueues, unlike tasklets, are not serialized among themselves and can run concurrently updating sme_i.qhead. However, the current code is already exposed in same ways, regardless of the deferral mechanism, in that hostif_sme_enqueue() does unserialized enqueues updating sme_i.qtail. Also get rid of the bogus (power save) tasklet enabling, as it is never disabled to begin with. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-5-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit 9442e81d7e7c4987411b5be7e0f33b8c6e670b86 Author: Davidlohr Bueso Date: Mon Apr 11 08:16:17 2022 -0700 staging/wlan-ng, prism2usb: replace completion_bh tasklet with work Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. The completion_bh tasklet will now run in process context and have further concurrency (tasklets being serialized among themselves), but this is done holding the ctlxq.lock, so it should be fine. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-4-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit cbe0f674a2d63e88d9c2de2aab02d6da68b109f2 Author: Davidlohr Bueso Date: Mon Apr 11 08:16:16 2022 -0700 staging/wlan-ng, prism2usb: replace reaper_bh tasklet with work Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. The reaper_bh tasklet will now run in process context and have further concurrency (tasklets being serialized among themselves), but this is done holding the ctlxq.lock, so it should be fine. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-3-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit 5fb6bc718cf965cb6171cc5bbafd5546d5e68474 Author: Davidlohr Bueso Date: Mon Apr 11 08:16:15 2022 -0700 staging/most, dim2: convert dim2_tasklet to threaded irq Tasklets have long been deprecated as being too heavy on the system by running in irq context - and this is not a performance critical path. If a higher priority process wants to run, it must wait for the tasklet to finish before doing so. A more suitable equivalent is to converted to threaded irq instead and service channels in regular task context. Signed-off-by: Davidlohr Bueso Link: https://lore.kernel.org/r/20220411151620.129178-2-dave@stgolabs.net Signed-off-by: Greg Kroah-Hartman commit b2268fd81c18302ed3443db09b7f06d52e6dcf03 Author: Minghao Chi Date: Fri Apr 8 08:12:05 2022 +0000 wlcore: debugfs: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408081205.2494512-1-chi.minghao@zte.com.cn commit b9eb5f0742d107ca9c0f33da58f61ce83e3ce2fc Author: Jimmy Hon Date: Thu Apr 7 02:51:23 2022 -0500 rtw88: 8821ce: Disable PCIe ASPM L1 for 8821CE using chip ID Make workaround work for other 8821CE devices with different PCI ID Signed-off-by: Jimmy Hon Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407075123.420696-3-honyuenkwun@gmail.com commit d5286826201ec226a683964122e207be60f62fbf Author: Jimmy Hon Date: Thu Apr 7 02:51:22 2022 -0500 rtw88: 8821ce: add support for device ID 0xb821 New device ID 0xb821 found on TP-Link T2E Tested it with c821 driver. 2.4GHz and 5GHz works. PCI id: 05:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b821 Subsystem: Realtek Semiconductor Co., Ltd. Device b821 Signed-off-by: Jimmy Hon Reviewed-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407075123.420696-2-honyuenkwun@gmail.com commit ece31c93d4d68f7eb8eea4431b052aacdb678de2 Author: Po-Hao Huang Date: Thu Apr 7 17:58:58 2022 +0800 rtw88: 8821c: fix debugfs rssi value RSSI value per frame is reported to mac80211 but not maintained in our own statistics, add it back to help us debug. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-7-pkshih@realtek.com commit f5207c122102cac22c78f438610d937a924aee3a Author: Ping-Ke Shih Date: Thu Apr 7 17:58:57 2022 +0800 rtw88: do PHY calibration while starting AP Calling calibration to yield expected PHY performance. We do this in STA mode, so do this in AP mode as well. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-6-pkshih@realtek.com commit f1c4dabfe68df7321cba0a07a30b2776a303abb2 Author: Po-Hao Huang Date: Thu Apr 7 17:58:56 2022 +0800 rtw88: 8821c: Enable TX report for management frames Without this setting, hardware would not report to driver even if management frames are transmitted successfully. So we fix it. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-5-pkshih@realtek.com commit f2217968ffdae702c21cc00fa804fbbd9ee6bb4b Author: Po-Hao Huang Date: Thu Apr 7 17:58:55 2022 +0800 rtw88: Add update beacon flow for AP mode To support stations in power saving mode, AP should notify stations that there are frames buffered at the AP via TIM during beacons. Driver used to transmit identical beacons that were downloaded to hardware during the initiation phase. This beacon will become obsolete over time. If the beacon does not contain sufficient information, station would not be able to percept that there is data to receive. Hence it won't wake up and start the PS-poll procedure, this could lead to timeout and/or lost data segments. In order to resolve this issue, driver will now download beacon to hardware whenever the content is updated. Enable hardware to update dtim_count for more efficiency, this reduces the overhead of downloading beacon at every beacon interval since most of the time only the dtim_count needs to be updated. Change queue mapping for broadcast/multicast frames to high queue, so these frames can be prioritized and sent when dtim_count is zero. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-4-pkshih@realtek.com commit 6723c0cde84fde582a261c186ce84100dcfa0019 Author: Po-Hao Huang Date: Thu Apr 7 17:58:54 2022 +0800 rtw88: fix incorrect frequency reported We should only fill in frequency reported by firmware during scan. Add this so frames won't be dropped by mac80211 due to frequency mismatch. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407095858.46807-3-pkshih@realtek.com commit c1edc86472fc3a5aa3b5c5c53c4e20f6a24992a6 Author: Po-Hao Huang Date: Thu Apr 7 17:58:53 2022 +0800 rtw88: add ieee80211:sta_rc_update ops Adding this allows us to get notification when bitrate configuration of the station changes. Update according parameters to firmware so the rate control algorithm 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/20220407095858.46807-2-pkshih@realtek.com commit 88d33bb87968d1c2ffa76feb6b94241750c8bcf7 Author: Philipp Hortmann Date: Mon Apr 11 22:49:54 2022 +0200 staging: vt6655: Remove macro PCAvDelayByIO Remove do-while(0) and CamelCase macro PCAvDelayByIO as it is not accepted by checkpatch.pl As the macro is just used once with a constant <= 50 the functionality of the macro is implemented by using udelay() directly. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e8267e7566d389f318a72d911083e52b02e37210.1649706687.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ffb3c2688e3807806f06944c5ced64a5245dbd49 Author: Aliya Rahmani Date: Tue Apr 12 12:44:57 2022 +0530 staging: rtl8712: efuse: code style - avoid macro argument precedence issues This patch fixes checkpatch warnings of precedence issues. Added parentheses around macro arguments 'offset' and 'word_en'. Signed-off-by: Aliya Rahmani Link: https://lore.kernel.org/r/20220412071456.40980-1-aliyarahmani786@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5e080cd771e827e26c1e55af11144b2dfe8b9eb3 Author: Martin Kaiser Date: Sat Apr 9 18:32:11 2022 +0200 staging: r8188eu: improve timeout handling in efuse_read_phymap_from_txpktbuf Use the standard kernel functions to define and check the timeout in efuse_read_phymap_from_txpktbuf. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit efe20b73c5caefa68509ad076d4f6459c4a17420 Author: Martin Kaiser Date: Sat Apr 9 18:32:10 2022 +0200 staging: r8188eu: improve timeout handling in iol_execute Use the standard kernel functions to define and check the timeout in iol_execute. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 11788aac9228875cac0a6b1a303521fe47115d24 Author: Martin Kaiser Date: Sat Apr 9 18:32:09 2022 +0200 staging: r8188eu: improve timeout handling in LPS_RF_ON_check Use the standard kernel functions to define and check the timeout in LPS_RF_ON_check. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2b1795e42a48b1fc398dd16c5df975e9c26d9195 Author: Martin Kaiser Date: Sat Apr 9 18:32:08 2022 +0200 staging: r8188eu: make LPS_RF_ON_check static LPS_RF_ON_check is used only in rtw_pwrctrl.c. Make it a static function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8d3ea8302f6264756ae958bceae18f395dc121fc Author: Martin Kaiser Date: Sat Apr 9 18:32:07 2022 +0200 staging: r8188eu: improve timeout handling in rtw_check_join_candidate Use the standard kernel functions to define and check the timeout in rtw_check_join_candidate. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1060ec636d8ba086ad56f558d4618b715c4d67d3 Author: Martin Kaiser Date: Sat Apr 9 18:32:06 2022 +0200 staging: r8188eu: improve timeout handling in rtl8188e_firmware_download Use the standard kernel functions to define and check the timeout in rtl8188e_firmware_download. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 72b94dcb9adf57736a5fcab57fe1f540c52b2b30 Author: Martin Kaiser Date: Sat Apr 9 18:32:05 2022 +0200 staging: r8188eu: summarize two if statements Summarize the two if statements at the end of send_beacon. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 24a24f95a22cf50091ef06950c2ce5dc723c051d Author: Martin Kaiser Date: Sat Apr 9 18:32:04 2022 +0200 staging: r8188eu: remove unnecessary rtw_get_passing_time_ms call Remove the rtw_get_passing_time_ms call in send_beacon. Calling rtw_get_passing_time_ms makes no sense if we discard the result. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 05a1e43e487693fb2d53778fe20f94d399549dfe Author: Martin Kaiser Date: Sat Apr 9 18:32:03 2022 +0200 staging: r8188eu: no need for an else after return The else branch at the end of send_beacon is not necessary. We return in the if branch. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220409163212.241122-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4b6c9a368967bf060a407a4ff2f182481b23b2ed Author: Uwe Kleine-König Date: Mon Apr 11 13:30:10 2022 +0200 staging: greybus: pwm: Drop assignment to struct pwm_chip::base Since commit f9a8ee8c8bcd ("pwm: Always allocate PWM chip base ID dynamically") the value held in base isn't used any more in the PWM framework. All PMWs get assigned a dynamic ID, so the assignment is redundant and can be dropped. Reviewed-by: Johan Hovold Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220411113010.208500-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 327ec68be709c7abe1bb8edd17e85b6653420eb1 Author: Michael Straube Date: Sat Apr 9 14:06:27 2022 +0200 staging: r8188eu: remove HW_VAR_H2C_FW_PWRMODE Remove the HW_VAR_H2C_FW_PWRMODE case from SetHwReg8188EU() and move its functionality to a new function in rtw_pwrctrl.c. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220409120627.10633-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7c05493bcfb522326867d99222a044a589272c0f Author: Michael Straube Date: Sat Apr 9 14:06:26 2022 +0200 staging: r8188eu: remove HW_VAR_FIFO_CLEARN_UP Remove the HW_VAR_FIFO_CLEARN_UP case from SetHwReg8188EU() and move its functionality to a new static function in os_intfs.c. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220409120627.10633-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 26209855c3ed06ce08b20f5b70188d2d0b0f3563 Author: Michael Straube Date: Sat Apr 9 14:06:25 2022 +0200 staging: r8188eu: remove HW_VAR_MLME_JOIN Remove the HW_VAR_MLME_JOIN case from SetHwReg8188EU() and move its functionality to a new static function in rtw_mlme_ext.c. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220409120627.10633-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3e401185209a3dfd34383ebdf323518d4bf9ef91 Author: Michael Straube Date: Sat Apr 9 14:06:24 2022 +0200 staging: r8188eu: remove HW_VAR_INITIAL_GAIN Remove the HW_VAR_INITIAL_GAIN case from SetHwReg8188EU() and move its functionality to a new static function in rtw_mlme_ext.c. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220409120627.10633-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 047c76286457b9ab4270665ab459bc2dea53edb9 Author: Michael Straube Date: Fri Apr 8 18:38:25 2022 +0200 staging: r8188eu: convert else if to else in rtw_led.c The else if in this block is redundant, it can be a simple else. if (x) { ... } else if (!x) { ... } Convert two such else if statements to simple else in rw_led.c. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220408163825.29069-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bab735aa5a49964e8b1ed337db9691e37b2ca821 Author: Yihao Han Date: Fri Apr 8 07:44:40 2022 -0700 staging: rtl8723bs: tidy up error handling The check for if rtw_skb_alloc() fails is done twice and is written in a confusing way. Move the "if (!recvbuf->pskb)" right after the allocation. The "if (recvbuf->pskb)" check can now be deleted and the code pulled in one tab. Suggested-by: Dan Carpenter Reviewed-by: Dan Carpenter Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220408144442.17611-1-hanyihao@vivo.com Signed-off-by: Greg Kroah-Hartman commit 7bf5323b059587b60cdf41fe2694cc2da45eff63 Merge: 6f4f5cf982338 2984287c4c199 Author: Jason Gunthorpe Date: Tue Apr 12 10:43:36 2022 -0300 Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Leon Romanovsky says: ==================== Mellanox shared branch that includes: * Removal of FPGA TLS code https://lore.kernel.org/all/cover.1649073691.git.leonro@nvidia.com Mellanox INNOVA TLS cards are EOL in May, 2018 [1]. As such, the code is unmaintained, untested and not in-use by any upstream/distro oriented customers. In order to reduce code complexity, drop the kernel code, clean build config options and delete useless kTLS vs. TLS separation. [1] https://network.nvidia.com/related-docs/eol/LCR-000286.pdf * Removal of FPGA IPsec code https://lore.kernel.org/all/cover.1649232994.git.leonro@nvidia.com Together with FPGA TLS, the IPsec went to EOL state in the November of 2019 [1]. Exactly like FPGA TLS, no active customers exist for this upstream code and all the complexity around that area can be deleted. [2] https://network.nvidia.com/related-docs/eol/LCR-000535.pdf * Fix to undefined behavior from Borislav https://lore.kernel.org/all/20220405151517.29753-11-bp@alien8.de ==================== * 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Remove not-implemented IPsec capabilities net/mlx5: Remove ipsec_ops function table net/mlx5: Reduce kconfig complexity while building crypto support net/mlx5: Move IPsec file to relevant directory net/mlx5: Remove not-needed IPsec config net/mlx5: Align flow steering allocation namespace to common style net/mlx5: Unify device IPsec capabilities check net/mlx5: Remove useless IPsec device checks net/mlx5: Remove ipsec vs. ipsec offload file separation RDMA/core: Delete IPsec flow action logic from the core RDMA/mlx5: Drop crypto flow steering API RDMA/mlx5: Delete never supported IPsec flow action net/mlx5: Remove FPGA ipsec specific statistics net/mlx5: Remove XFRM no_trailer flag net/mlx5: Remove not-used IDA field from IPsec struct net/mlx5: Delete metadata handling logic net/mlx5_fpga: Drop INNOVA IPsec support IB/mlx5: Fix undefined behavior due to shift overflowing the constant net/mlx5: Cleanup kTLS function names and their exposure net/mlx5: Remove tls vs. ktls separation as it is the same net/mlx5: Remove indirection in TLS build net/mlx5: Reliably return TLS device capabilities net/mlx5_fpga: Drop INNOVA TLS support Link: https://lore.kernel.org/r/20220409055303.1223644-1-leon@kernel.org Reviewed-by: Jason Gunthorpe commit f5d9283ecb33329073033029fe427155aa0abfb1 Author: Brian Gerst Date: Fri Mar 25 11:39:50 2022 -0400 x86/32: Simplify ELF_CORE_COPY_REGS GS is now always a user segment, so there is no difference between user and kernel registers. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220325153953.162643-2-brgerst@gmail.com commit af5175acc8e2fa7990c59a3e4420bbe74e047d40 Author: Joe Perches Date: Thu Apr 7 13:14:44 2022 -0700 rtw89: rtw89_ser: add const to struct state_ent and event_ent Change the struct and the uses to const to reduce data. $ size drivers/net/wireless/realtek/rtw89/ser.o* (x86-64 defconfig w/ rtw89) text data bss dec hex filename 3741 8 0 3749 ea5 drivers/net/wireless/realtek/rtw89/ser.o.new 3437 312 0 3749 ea5 drivers/net/wireless/realtek/rtw89/ser.o.old Signed-off-by: Joe Perches Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/2fd88e6119f62b968477ef9781abb1832d399fd6.camel@perches.com commit 065cf8f9777f28fcf1115a7e3a6cdc93ed2d30d1 Author: Chia-Yuan Li Date: Fri Apr 8 08:13:49 2022 +0800 rtw89: 8852c: add 8852c specific BT-coexistence initial function Initialize registers to default values, such as PTA and GNT pin, and set pin MUX according to number of antenna on hardware module. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-10-pkshih@realtek.com commit d264edb1cc65df8e0054b275f7eaaddb795c1d18 Author: Johnson Lin Date: Fri Apr 8 08:13:48 2022 +0800 rtw89: Skip useless dig gain and igi related settings for 8852C Separated DIG RX gain, IGI configurations from not supportted HW using "support_igi" capability flag. Signed-off-by: Johnson Lin Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-9-pkshih@realtek.com commit ec356ffb2917a29c6cb7c0d9030a072eb125c907 Author: Chia-Yuan Li Date: Fri Apr 8 08:13:47 2022 +0800 rtw89: 8852c: disable firmware watchdog if CPU disabled Disable watchdog timer to prevent it timeout suddenly. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-8-pkshih@realtek.com commit 181751970107746c1b4e6870b01d74e4ac0f3fb8 Author: Ping-Ke Shih Date: Fri Apr 8 08:13:46 2022 +0800 rtw89: reset BA CAM BA CAM is used to react receiving AMPDU packets, so reset them to be expected initial state. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-7-pkshih@realtek.com commit 9a1ab283c709a058593f1bf0d69a05a5e8b90f72 Author: Ping-Ke Shih Date: Fri Apr 8 08:13:45 2022 +0800 rtw89: change station scheduler setting for hardware TX mode The bit B_AX_SS_NONEMPTY_SS2FINFO_EN should be clear, because we configure C-MAC as hardware TX/RX mode. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-6-pkshih@realtek.com commit 9f405b0162ba92bf8317ce1329aad96fecc89273 Author: Ping-Ke Shih Date: Fri Apr 8 08:13:44 2022 +0800 rtw89: ser: configure top ERR IMR for firmware to recover Turn on ERR IMR, and then firmware can capture interrupts reflecting errors to recover hardware states. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-5-pkshih@realtek.com commit d86369e937f1ca4f87b9375d055c3ef9a6aa5360 Author: Chia-Yuan Li Date: Fri Apr 8 08:13:43 2022 +0800 rtw89: ser: configure C-MAC interrupt mask Similarly, create functions to set specific C-MAC masks for firmware recovery. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-4-pkshih@realtek.com commit eeadcd2a47f855d14ba85f46a8b9206182ea110c Author: Chia-Yuan Li Date: Fri Apr 8 08:13:42 2022 +0800 rtw89: ser: configure D-MAC interrupt mask These interrupts are used by firmware to recover hardware. Create functions to set specific D-MAC masks to replace plain register settings. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-3-pkshih@realtek.com commit 5ddfffd6da9b94e5f6397843ad1a54d6a211f652 Author: Zong-Zhe Yang Date: Fri Apr 8 08:13:41 2022 +0800 rtw89: ser: fix unannotated fall-through add `break` to fix warning of unannotated fall-through between switch labels. Fixes: 14f9f4790048 ("rtw89: ser: control hci interrupts on/off by state") Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408001353.17188-2-pkshih@realtek.com commit 590032a4d2133ecc10d3078a8db1d85a4842f12c Author: Lorenzo Bianconi Date: Mon Apr 11 16:05:26 2022 +0200 page_pool: Add recycle stats to page_pool_put_page_bulk Add missing recycle stats to page_pool_put_page_bulk routine. Reviewed-by: Joe Damato Signed-off-by: Lorenzo Bianconi Reviewed-by: Ilias Apalodimas Link: https://lore.kernel.org/r/3712178b51c007cfaed910ea80e68f00c916b1fa.1649685634.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit d7ceee8051ba226f1a481edadd06e34e200fcbab Author: Yang Li Date: Fri Apr 8 08:01:13 2022 +0800 ath9k: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. Eliminate the follow coccicheck warning: ./drivers/net/wireless/ath/ath9k/ahb.c:103:2-9: line 103 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408000113.129906-2-yang.lee@linux.alibaba.com commit 2578171ff85ed71d2575cd6abcd9c37c4b642b52 Author: Yang Li Date: Fri Apr 8 08:01:12 2022 +0800 wcn36xx: clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/net/wireless/ath/wcn36xx/smd.c:3151 wcn36xx_smd_gtk_offload_get_info_rsp() warn: inconsistent indenting Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220408000113.129906-1-yang.lee@linux.alibaba.com commit 405342ebea2ab776df070ee54c308f1f59723844 Author: Colin Ian King Date: Thu Apr 7 11:28:20 2022 +0100 ath11k: Fix spelling mistake "reseting" -> "resetting" There is a spelling mistake in an ath11k_warn message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220407102820.613881-1-colin.i.king@gmail.com commit 24584d4f0afc75faa57883dd694e0df61af0ad40 Author: Peter Seiderer Date: Sat Apr 2 17:30:13 2022 +0200 ath9k: fix ath_get_rate_txpower() to respect the rate list end tag Stop reading (and copying) from ieee80211_tx_rate to ath_tx_info.rates after list end tag (count == 0, idx < 0), prevents copying of garbage to card registers. Note: no need to write to the remaining ath_tx_info.rates entries as the complete ath_tx_info struct is already initialized to zero from both call sites. Signed-off-by: Peter Seiderer Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220402153014.31332-1-ps.report@gmx.net commit ec095263a965720e1ca39db1d9c5cd47846c789b Author: Oliver Hartkopp Date: Mon Apr 11 14:49:55 2022 +0200 net: remove noblock parameter from recvmsg() entities The internal recvmsg() functions have two parameters 'flags' and 'noblock' that were merged inside skb_recv_datagram(). As a follow up patch to commit f4b41f062c42 ("net: remove noblock parameter from skb_recv_datagram()") this patch removes the separate 'noblock' parameter for recvmsg(). Analogue to the referenced patch for skb_recv_datagram() the 'flags' and 'noblock' parameters are unnecessarily split up with e.g. err = sk->sk_prot->recvmsg(sk, msg, size, flags & MSG_DONTWAIT, flags & ~MSG_DONTWAIT, &addr_len); or in err = INDIRECT_CALL_2(sk->sk_prot->recvmsg, tcp_recvmsg, udp_recvmsg, sk, msg, size, flags & MSG_DONTWAIT, flags & ~MSG_DONTWAIT, &addr_len); instead of simply using only flags all the time and check for MSG_DONTWAIT where needed (to preserve for the formerly separated no(n)block condition). Signed-off-by: Oliver Hartkopp Link: https://lore.kernel.org/r/20220411124955.154876-1-socketcan@hartkopp.net Signed-off-by: Paolo Abeni commit c63462184b35316fed7657d3c92dc5099ad5fab2 Author: Matthew Auld Date: Mon Apr 11 09:56:03 2022 +0100 drm/ttm: stop passing NULL fence in ttm_bo_move_sync_cleanup If we hit the sync case, like when skipping clearing for kernel internal objects, or when falling back to cpu clearing, like in i915, we end up trying to add a NULL fence, but with some recent changes in this area this now just results in NULL deref in dma_resv_add_fence: <1>[ 5.466383] BUG: kernel NULL pointer dereference, address: 0000000000000008 <1>[ 5.466384] #PF: supervisor read access in kernel mode <1>[ 5.466385] #PF: error_code(0x0000) - not-present page <6>[ 5.466386] PGD 0 P4D 0 <4>[ 5.466387] Oops: 0000 [#1] PREEMPT SMP NOPTI <4>[ 5.466389] CPU: 5 PID: 267 Comm: modprobe Not tainted 5.18.0-rc2-CI-CI_DRM_11481+ #1 <4>[ 5.466391] RIP: 0010:dma_resv_add_fence+0x63/0x260 <4>[ 5.466395] Code: 38 85 c0 0f 84 df 01 00 00 0f 88 e8 01 00 00 83 c0 01 0f 88 df 01 00 00 8b 05 35 89 10 01 49 8d 5e 68 85 c0 0f 85 45 01 00 00 <48> 8b 45 08 48 3d c0 a5 0a 82 0f 84 5c 01 00 00 48 3d 60 a5 0a 82 <4>[ 5.466396] RSP: 0018:ffffc90000e974f8 EFLAGS: 00010202 <4>[ 5.466397] RAX: 0000000000000001 RBX: ffff888123e88b28 RCX: 00000000ffffffff <4>[ 5.466398] RDX: 0000000000000001 RSI: ffffffff822e4f50 RDI: ffffffff8233f087 <4>[ 5.466399] RBP: 0000000000000000 R08: ffff8881313dbc80 R09: 0000000000000001 <4>[ 5.466399] R10: 0000000000000001 R11: 00000000da354294 R12: 0000000000000000 <4>[ 5.466400] R13: ffff88810927dc58 R14: ffff888123e88ac0 R15: ffff88810a88d600 <4>[ 5.466401] FS: 00007f5fa1193540(0000) GS:ffff88845d880000(0000) knlGS:0000000000000000 <4>[ 5.466402] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4>[ 5.466402] CR2: 0000000000000008 CR3: 0000000106dd6003 CR4: 00000000003706e0 <4>[ 5.466403] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 <4>[ 5.466404] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 <4>[ 5.466404] Call Trace: <4>[ 5.466405] <4>[ 5.466406] ttm_bo_move_accel_cleanup+0x62/0x270 [ttm] <4>[ 5.466411] ? i915_rsgt_from_buddy_resource+0x185/0x1e0 [i915] <4>[ 5.466529] i915_ttm_move+0xfd/0x430 [i915] <4>[ 5.466833] ? dma_resv_reserve_fences+0x4e/0x320 <4>[ 5.466836] ? ttm_bo_add_move_fence.constprop.20+0xf7/0x140 [ttm] <4>[ 5.466841] ttm_bo_handle_move_mem+0xa1/0x140 [ttm] <4>[ 5.466845] ttm_bo_validate+0xee/0x160 [ttm] <4>[ 5.466849] __i915_ttm_get_pages+0x4f/0x210 [i915] <4>[ 5.466976] i915_ttm_get_pages+0xad/0x140 [i915] <4>[ 5.467094] ____i915_gem_object_get_pages+0x32/0xf0 [i915] <4>[ 5.467210] __i915_gem_object_get_pages+0x89/0xa0 [i915] <4>[ 5.467323] i915_vma_get_pages+0x114/0x1d0 [i915] <4>[ 5.467446] i915_vma_pin_ww+0xd3/0xa90 [i915] <4>[ 5.467570] i915_vma_pin.constprop.10+0x119/0x1b0 [i915] <4>[ 5.467700] ? __mutex_unlock_slowpath+0x3e/0x2b0 <4>[ 5.467704] intel_alloc_initial_plane_obj.isra.6+0x1a9/0x390 [i915] <4>[ 5.467833] intel_crtc_initial_plane_config+0x83/0x340 [i915] In the ttm_bo_move_sync_cleanup() case it seems we only really care about calling ttm_bo_wait_free_node(), so let's instead just call that directly. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Christian König Cc: Lucas De Marchi Cc: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220411085603.58156-1-matthew.auld@intel.com commit c7dfb2591b23856182e2c9da6b1d526ef7fd6b2e Author: Longpeng(Mike) Date: Wed Feb 9 09:02:14 2022 +0100 cpu/hotplug: Allow the CPU in CPU_UP_PREPARE state to be brought up again. A CPU will not show up in virtualized environment which includes an Enclave. The VM splits its resources into a primary VM and a Enclave VM. While the Enclave is active, the hypervisor will ignore all requests to bring up a CPU and this CPU will remain in CPU_UP_PREPARE state. The kernel will wait up to ten seconds for CPU to show up (do_boot_cpu()) and then rollback the hotplug state back to CPUHP_OFFLINE leaving the CPU state in CPU_UP_PREPARE. The CPU state is set back to CPUHP_TEARDOWN_CPU during the CPU_POST_DEAD stage. After the Enclave VM terminates, the primary VM can bring up the CPU again. Allow to bring up the CPU if it is in the CPU_UP_PREPARE state. [bigeasy: Rewrite commit description.] Signed-off-by: Longpeng(Mike) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Tested-by: Dongli Zhang Reviewed-by: Valentin Schneider Reviewed-by: Henry Wang Link: https://lore.kernel.org/r/20220209080214.1439408-3-bigeasy@linutronix.de commit e8a69f12f01f487c6a0e704eb14ccf2dd015277d Author: Boris Ostrovsky Date: Wed Feb 9 09:02:13 2022 +0100 x86/xen: Allow to retry if cpu_initialize_context() failed. If memory allocation in cpu_initialize_context() fails then it will bring up the VCPU and leave with the corresponding CPU bit set in xen_cpu_initialized_map. The following (presumably successful) CPU bring up will BUG in xen_pv_cpu_up() because nothing for that VCPU would be initialized. Clear the CPU bits, that were set in cpu_initialize_context() in case the memory allocation fails. [ bigeasy: Creating a patch from Boris' email. ] Signed-off-by: Boris Ostrovsky Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220209080214.1439408-2-bigeasy@linutronix.de commit f01598090048f5f732ea7aa64b2f194131ce60d2 Author: Daniele Palmas Date: Mon Apr 11 15:59:43 2022 +0200 net: usb: qmi_wwan: add Telit 0x1057 composition Add the following Telit FN980 composition: 0x1057: tty, adb, rmnet, tty, tty, tty, tty, tty Signed-off-by: Daniele Palmas Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/20220411135943.4067264-1-dnlplm@gmail.com Signed-off-by: Paolo Abeni commit 2759f38b6c9551e4a1184131bc660d6a520a7cf4 Author: Xiaoke Wang Date: Thu Apr 7 15:37:22 2022 +0800 clk: imx: scu: fix a potential memory leak in __imx_clk_gpr_scu() In __imx_clk_gpr_scu(), if imx_scu_clk_is_valid(rsrc_id) fails, then `clk_node` which is allocated by kzalloc() is not properly released, which may lead to memory leak. So this patch added kfree(clk_node) on the above error path before return ERR_PTR(-EINVAL). Signed-off-by: Xiaoke Wang Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/tencent_27FF59903EE6AB5C0D0E6D0A8E7059A59007@qq.com Signed-off-by: Abel Vesa commit ed713e2bc093239ccd380c2ce8ae9e4162f5c037 Author: Jiasheng Jiang Date: Thu Mar 10 16:02:57 2022 +0800 clk: imx: Add check for kcalloc As the potential failure of the kcalloc(), it should be better to check it in order to avoid the dereference of the NULL pointer. Fixes: 379c9a24cc23 ("clk: imx: Fix reparenting of UARTs not associated with stdout") Signed-off-by: Jiasheng Jiang Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220310080257.1988412-1-jiasheng@iscas.ac.cn Signed-off-by: Abel Vesa commit ce0fc2f00fa26310cd29e462f816a5e660754d68 Author: Alvin Šipraga Date: Thu Mar 17 23:35:59 2022 +0100 clk: imx8mn: add GPT support Add support for the General Purpose Timer (GPT) clocks on the i.MX8MN. The i.MX8MN GPT IP block is the same as on the i.MX8MM, on which this patch is based. Signed-off-by: Alvin Šipraga Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220317223600.175894-2-alvin@pqrs.dk Signed-off-by: Abel Vesa commit 9b30501949f773777f3632d891e6defbb363daf5 Author: Alvin Šipraga Date: Thu Mar 17 23:35:58 2022 +0100 dt-bindings: imx: add clock bindings for i.MX8MN GPT The i.MX8MN has a General Purpose Timer (GPT) just like the i.MX8MM, which already has such bindings. Add the relevant bindings for the Nano SoC too. Signed-off-by: Alvin Šipraga Acked-by: Krzysztof Kozlowski Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220317223600.175894-1-alvin@pqrs.dk Signed-off-by: Abel Vesa commit 56fddc6996c95d846d90abf212718628056669d5 Author: Jacky Bai Date: Thu Mar 10 17:34:04 2022 +0800 clk: imx: Remove the snvs clock The SNVS moudule is not used only by the linux, it may also used by other SW component is secure world. No sense to populate it in linux, so remove it. Signed-off-by: Jacky Bai Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220310093404.236966-1-ping.bai@nxp.com Signed-off-by: Abel Vesa commit bb7e897b002aaf698e4ede6332bff38e77557a4b Author: Peng Fan Date: Mon Feb 28 20:41:12 2022 +0800 clk: imx8m: check mcore_booted before register clk If mcore_booted is true, ignore the clk root gate registration and this will simplify AMP clock management and avoid system hang unexpectly especially Linux shutdown clk used by mcore. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220228124112.3974242-2-peng.fan@oss.nxp.com [abelvesa@kernel.org: Removed if-case for when mcore_booted is true] Signed-off-by: Abel Vesa commit 1b6a6fc5280e97559287b61eade2d4b363e836f2 Author: Amadeusz Sławiński Date: Tue Apr 12 11:16:28 2022 +0200 ALSA: jack: Access input_dev under mutex It is possible when using ASoC that input_dev is unregistered while calling snd_jack_report, which causes NULL pointer dereference. In order to prevent this serialize access to input_dev using mutex lock. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220412091628.3056922-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Takashi Iwai commit 93c1a40075a3ba4b3578cda3f6b319c6f2806475 Merge: 80ecb114f23ba d78eaf06b5d9f Author: Paolo Abeni Date: Tue Apr 12 12:13:32 2022 +0200 Merge branch 'sfc-remove-some-global-definitions' Martin Habets says: ==================== sfc: Remove some global definitions These are some small cleanups to remove definitions that need not be defined in .h files. ==================== Link: https://lore.kernel.org/r/164967635861.17602.16525009567130361754.stgit@palantir17.mph.net Signed-off-by: Paolo Abeni commit d78eaf06b5d9f4686846ca4e35207025c415ba85 Author: Martin Habets Date: Mon Apr 11 12:27:20 2022 +0100 sfc: Remove global definition of efx_reset_type_names The strings are only used in efx_common.c so the definitions can be static in there. Signed-off-by: Martin Habets Signed-off-by: Paolo Abeni commit cc42e4e3f1014f2d24437955bc1e90b77cef343e Author: Martin Habets Date: Mon Apr 11 12:27:15 2022 +0100 sfc: Remove duplicate definition of efx_xmit_done It is defined both in efx.h and tx_common.h. Remove the definition in efx.h. Signed-off-by: Martin Habets Signed-off-by: Paolo Abeni commit 54fccfdd7c663a2e23de85ea4ed6a123b6abcc35 Author: Martin Habets Date: Mon Apr 11 12:27:10 2022 +0100 sfc: efx_default_channel_type APIs can be static This means we can remove them from efx_channel.h and avoid naming conflicts later. efx_channel_dummy_op_void() cannot be static as it is used in ef100_nic.c. Signed-off-by: Martin Habets Signed-off-by: Paolo Abeni commit 680025dcc4004a8e799a5a7193a882a561a687d4 Author: Juha-Pekka Heikkilä Date: Mon Apr 11 17:34:05 2022 +0300 drm/i915/dg2: Add support for DG2 clear color compression Add support for the DG2 specific render compression with clear color framebuffer format. DG2 onwards discrete gfx has support for new flat CCS mapping, which brings in display feature in to avoid Aux walk for compressed surface. This support build on top of Flat CCS support added in XEHPSDV. FLAT CCS surface base address should be 64k aligned, Compressed displayable surfaces must use tile4 format. HAS: 1407880786 B.Spec : 7655 B.Spec : 53902 v2: Merge all bits required for the support of functionality into this patch from the patch adding the corresponding modifier. Cc: Mika Kahola Signed-off-by: Anshuman Gupta Signed-off-by: Juha-Pekka Heikkilä Signed-off-by: Ramalingam C Signed-off-by: Imre Deak Acked-by: Anshuman Gupta Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220411143405.1073845-5-imre.deak@intel.com commit 9035039e1ed691cd893777a42e048003a2f349d6 Author: Mika Kahola Date: Mon Apr 11 17:34:04 2022 +0300 drm/fourcc: Introduce format modifier for DG2 clear color DG2 clear color render compression uses Tile4 layout. Therefore, we need to define a new format modifier for uAPI to support clear color rendering. v2: Display version is fixed. [Imre] KDoc is enhanced for cc modifier. [Nanley & Lionel] v3: Split out the modifier addition to a separate patch. Clarify the modifier layout description. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Mika Kahola cc: Anshuman Gupta Signed-off-by: Juha-Pekka Heikkilä Signed-off-by: Ramalingam C Signed-off-by: Imre Deak Acked-by: Nanley Chery Reviewed-by: Juha-Pekka Heikkila Acked-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20220411143405.1073845-4-imre.deak@intel.com commit 4c3afa72138c3c8c115cc2cc10619b82613e710a Author: Matt Roper Date: Mon Apr 11 17:34:03 2022 +0300 drm/i915/dg2: Add support for DG2 render and media compression Add support for DG2 render and media compression, for the description of buffer layouts see the previous patch adding the corresponding frame buffer modifiers. v2: Display version fix [Imre] v3: Split out modifier addition to separate patch. Signed-off-by: Matt Roper cc: Radhakrishna Sripada Signed-off-by: Mika Kahola cc: Anshuman Gupta Signed-off-by: Juha-Pekka Heikkilä Signed-off-by: Ramalingam C Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20220411143405.1073845-3-imre.deak@intel.com commit 764b2668cffafdfde47f51f22b0949315bd0b96a Author: Matt Roper Date: Mon Apr 11 17:34:02 2022 +0300 drm/fourcc: Introduce format modifiers for DG2 render and media compression The render/media engines on DG2 unify render compression and media compression into a single format for the first time, using the Tile 4 layout for main surfaces. The compression algorithm is different from any previous platform and the display engine must still be configured to decompress either a render or media compressed surface; as such, we need new RC and MC framebuffer modifiers to represent buffers in this format. v2: Clarify modifier layout description. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Matt Roper Signed-off-by: Imre Deak Acked-by: Nanley Chery Reviewed-by: Juha-Pekka Heikkila Acked-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20220411143405.1073845-2-imre.deak@intel.com commit 8f06bd1f89ca8b58dd8c4447b0eeae6ebe63ca0e Author: Mohan Kumar Date: Mon Apr 11 13:02:10 2022 +0530 ALSA: hda/tegra: Enable Jack poll for tegra Enable HDA Jack polling for the tegra platforms as Jack detection logic doesn't work when the HDACODEC in runtime suspended state as unsol event won't be triggered during D3 state. This will help the userspace audio setting controls to correctly show available audio devices in gui. Signed-off-by: Mohan Kumar Link: https://lore.kernel.org/r/20220411073210.23445-3-mkumard@nvidia.com Signed-off-by: Takashi Iwai commit b33115bd05afda6fe16fdd142779a9ff95d63317 Author: Mohan Kumar Date: Mon Apr 11 13:02:09 2022 +0530 ALSA: hda: Jack detection poll in suspend state HDA Jack detection logic doesn't work when the HDACODEC in runtime suspended state as unsol event won't be triggered during D3 state. As pulseaudio server in userspace rely on the jack mixer control status to show the audio devices in gui and any display sink device hotplug event during D3 state will never updates the jack status which will result in no audio device option available in userspace settings. The possible option available to resolve this issue is to run Jack polling worker thread even after codec suspend state. The choice can be made based on compromise between power saving or Jack detection in suspend state. Signed-off-by: Mohan Kumar Link: https://lore.kernel.org/r/20220411073210.23445-2-mkumard@nvidia.com Signed-off-by: Takashi Iwai commit 80ecb114f23ba089571e1320abdfa728795f4b03 Merge: 1a915b234291d 7b972512ec0e1 Author: Paolo Abeni Date: Tue Apr 12 10:33:17 2022 +0200 Merge branch 'net-dsa-mt7530-updates-for-phylink-changes' Russell King says: ==================== net: dsa: mt7530: updates for phylink changes This revised series is a partial conversion of the mt7530 DSA driver to the modern phylink infrastructure. This driver has some exceptional cases which prevent - at the moment - its full conversion (particularly with the Autoneg bit) to using phylink_generic_validate(). Patch 1 fixes the incorrect test highlighted in the first RFC series. Patch 2 fixes the incorrect assumption that RGMII is unable to support 1000BASE-X. Patch 3 populates the supported_interfaces for each port Patch 4 removes the interface checks that become unnecessary as a result of patch 3. Patch 5 removes use of phylink_helper_basex_speed() which is no longer required by phylink. Patch 6 becomes possible after patch 5, only indicating the ethtool modes that can be supported with a particular interface mode - this involves removing some modes and adding others as per phylink documentation. Patch 7 switches the driver to use phylink_get_linkmodes(), which moves the driver as close as we can to phylink_generic_validate() due to the Autoneg bit issue mentioned above. Patch 8 converts the driver to the phylink pcs support, removing a bunch of driver private indirected methods. We include TRGMII as a PCS even though strictly TRGMII does not have a PCS. This is convenient to allow the change in patch 9 to be made. Patch 9 moves the special autoneg handling to the PCS validate method, which means we can convert the MAC side to the generic validator. Patch 10 marks the driver as non-legacy. The series was posted on 23 February, and a ping sent on 3 March, but no feedback has been received. The previous posting also received no feedback on the actual patches either. v2: - fix build issue in patch 5 - add Marek's tested-by drivers/net/dsa/mt7530.c | 330 +++++++++++++++++++++-------------------------- drivers/net/dsa/mt7530.h | 26 ++-- 2 files changed, 159 insertions(+), 197 deletions(-) ==================== Link: https://lore.kernel.org/r/YlP4vGKVrlIJUUHK@shell.armlinux.org.uk Signed-off-by: Paolo Abeni commit 7b972512ec0e16df298366b31326f3707f5dbbdd Author: Russell King (Oracle) Date: Mon Apr 11 10:46:37 2022 +0100 net: dsa: mt7530: mark as non-legacy The mt7530 driver does not make use of the speed, duplex, pause or advertisement in its phylink_mac_config() implementation, so it can be marked as a non-legacy driver. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 9d0df207c002e1532c109fb06c8895d1855fba40 Author: Russell King (Oracle) Date: Mon Apr 11 10:46:32 2022 +0100 net: dsa: mt7530: move autoneg handling to PCS validation Move the autoneg bit handling to the PCS validation, which allows us to get rid of mt753x_phylink_validate() and rely on the default phylink_generic_validate() implementation for the MAC side. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit cbd1f243bc41056c76fcfc5f3380cfac1f00d37b Author: Russell King (Oracle) Date: Mon Apr 11 10:46:27 2022 +0100 net: dsa: mt7530: partially convert to phylink_pcs Partially convert the mt7530 driver to use phylink's PCS support. This is a partial implementation as we don't move anything into the pcs_config method yet - this driver supports SGMII or 1000BASE-X without in-band. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 6789d6d76e8183a0cd19f4a45fc265de81b5c7e6 Author: Russell King (Oracle) Date: Mon Apr 11 10:46:22 2022 +0100 net: dsa: mt7530: switch to use phylink_get_linkmodes() Switch mt7530 to use phylink_get_linkmodes() to generate the ethtool linkmodes that can be supported. We are unable to use the generic helper for this as pause modes are dependent on the interface as the Autoneg bit depends on the interface mode. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 7c04c8489115a46cc2ad6769f2e0c96237b6e75c Author: Russell King (Oracle) Date: Mon Apr 11 10:46:17 2022 +0100 net: dsa: mt7530: only indicate linkmodes that can be supported Now that mt7530 is not using the basex helper, it becomes unnecessary to indicate support for both 1000baseX and 2500baseX when one of the 803.3z PHY interface modes is being selected. Ensure that the driver indicates only those linkmodes that can actually be supported by the PHY interface mode. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit fd301137e6b30c836c710001f9915f8776d7955e Author: Russell King (Oracle) Date: Mon Apr 11 10:46:12 2022 +0100 net: dsa: mt7530: drop use of phylink_helper_basex_speed() Now that we have a better method to select SFP interface modes, we no longer need to use phylink_helper_basex_speed() in a driver's validation function. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 26f6d881028281094203a49869121f727ec52bfa Author: Russell King (Oracle) Date: Mon Apr 11 10:46:06 2022 +0100 net: dsa: mt7530: remove interface checks As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 59c2215f36040ac0040f9cfb6fbcc4cb2a705f11 Author: Russell King (Oracle) Date: Mon Apr 11 10:46:01 2022 +0100 net: dsa: mt7530: populate supported_interfaces and mac_capabilities Populate the supported interfaces and MAC capabilities for mt7530, mt7531 and mt7621 DSA switches. Filling this in will enable phylink to pre-check the PHY interface mode against the the supported interfaces bitmap prior to calling the validate function, and will eventually allow us to convert to using the generic validation. Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit 66f862563ed68717dfd84e808ca12705ed275ced Author: Russell King (Oracle) Date: Mon Apr 11 10:45:56 2022 +0100 net: dsa: mt7530: 1G can also support 1000BASE-X link mode When using an external PHY connected using RGMII to mt7531 port 5, the PHY can be used to used support 1000BASE-X connections. Moreover, if 1000BASE-T is supported, then we should allow 1000BASE-X as well, since which are supported is a property of the PHY. Therefore, it makes no sense to exclude this from the linkmodes when 1000BASE-T is supported. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Tested-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: Paolo Abeni commit c16c8bfa09d5f318c1bd65698d058d3739970c24 Merge: 8e7e5c077cd57 b85ffe47c4ec1 Author: Joonas Lahtinen Date: Tue Apr 12 11:28:42 2022 +0300 Merge drm/drm-next into drm-intel-gt-next Pull in TTM changes needed for DG2 CCS enabling from Ram. Signed-off-by: Joonas Lahtinen commit 19565ea12d61c69ef2be97a97b426ba5c55572ff Author: Peng Fan Date: Mon Feb 28 20:41:11 2022 +0800 clk: imx: add mcore_booted module paratemter Add mcore_booted boot parameter which could simplify AMP clock management. To i.MX8M, there is CCM(clock control Module) to generate clock root clock, anatop(analog PLL module) to generate PLL, and CCGR (clock gating) to gate clocks to peripherals. As below: anatop->ccm->ccgr->peripheral Linux handles the clock management and the auxiliary core is under control of Linux. Although there is per hardware domain control for CCGR and CCM, auxiliary core normally only use CCGR hardware domain control to avoid linux gate off the clk to peripherals and leave CCM ana anatop to Linux. Per NXP hardware design, because CCGR already support gate to peripherals, and clk root gate power leakage is negligible. So when in AMP case, we could not register the clk root gate. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220228124112.3974242-1-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 1a915b234291d66a19f7b74dea89ef7cb4077d4e Merge: ac6bef064f716 50fe062c806ed Author: Paolo Abeni Date: Tue Apr 12 10:06:57 2022 +0200 Merge branch 'net-bridge-add-support-for-host-l2-mdb-entries' Joachim Wiberg says: ==================== net: bridge: add support for host l2 mdb entries Fix to an obvious omissions for layer-2 host mdb entries, this v2 adds the missing selftest and some minor style fixes. Note: this patch revealed some worrying problems in how the bridge forwards unknown BUM traffic and also how unknown multicast is forwarded when a IP multicast router is known, which a another (RFC) patch series intend to address. That series will build on this selftest, hence the name of the test. v2: - Add braces to other if/else clauses (Jakub) - Add selftest to verify add/del of mac/ipv4/ipv6 mdb entries (Jakub) ==================== Link: https://lore.kernel.org/r/20220411084054.298807-1-troglobit@gmail.com Signed-off-by: Paolo Abeni commit 50fe062c806ed76fbee11e23251717e5be497d4c Author: Joachim Wiberg Date: Mon Apr 11 10:40:54 2022 +0200 selftests: forwarding: new test, verify host mdb entries Boiler plate for testing static mdb entries. This first test verifies adding and removing host mdb entries for all supported types: IPv4, IPv6, and MAC multicast. Signed-off-by: Joachim Wiberg Signed-off-by: Paolo Abeni commit e65693b0179ebb1e58134e048b31781709380232 Author: Joachim Wiberg Date: Mon Apr 11 10:40:53 2022 +0200 net: bridge: add support for host l2 mdb entries This patch expands on the earlier work on layer-2 mdb entries by adding support for host entries. Due to the fact that host joined entries do not have any flag field, we infer the permanent flag when reporting the entries to userspace, which otherwise would be listed as 'temp'. Before patch: ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent Error: bridge: Flags are not allowed for host groups. ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee Error: bridge: Only permanent L2 entries allowed. After patch: ~# bridge mdb add dev br0 port br0 grp 01:00:00:c0:ff:ee permanent ~# bridge mdb show dev br0 port br0 grp 01:00:00:c0:ff:ee permanent vid 1 Signed-off-by: Joachim Wiberg Acked-by: Nikolay Aleksandrov Signed-off-by: Paolo Abeni commit b85ffe47c4ec172214a38b7e7087c60582c488f0 Merge: ce522ba9ef7e2 c8d4c18bfbc4a Author: Dave Airlie Date: Tue Apr 12 17:39:45 2022 +1000 Merge tag 'drm-misc-next-2022-04-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.19: UAPI Changes: Cross-subsystem Changes: Core Changes: - atomic: Add atomic_print_state to private objects - edid: Constify the EDID parsing API, rework of the API - dma-buf: Add dma_resv_replace_fences, dma_resv_get_singleton, make dma_resv_excl_fence private - format: Support monochrome formats - fbdev: fixes for cfb_imageblit and sys_imageblit, pagelist corruption fix - selftests: several small fixes - ttm: Rework bulk move handling Driver Changes: - Switch all relevant drivers to drm_mode_copy or drm_mode_duplicate - bridge: conversions to devm_drm_of_get_bridge and panel_bridge, autosuspend for analogix_dp, audio support for it66121, DSI to DPI support for tc358767, PLL fixes and I2C support for icn6211 - bridge_connector: Enable HPD if supported - etnaviv: fencing improvements - gma500: GEM and GTT improvements, connector handling fixes - komeda: switch to plane reset helper - mediatek: MIPI DSI improvements - omapdrm: GEM improvements - panel: DT bindings fixes for st7735r, few fixes for ssd130x, new panels: ltk035c5444t, B133UAN01, NV3052C - qxl: Allow to run on arm64 - sysfb: Kconfig rework, support for VESA graphic mode selection - vc4: Add a tracepoint for CL submissions, HDMI YUV output, HDMI and clock improvements - virtio: Remove restriction of non-zero blob_flags, - vmwgfx: support for CursorMob and CursorBypass 4, various improvements and small fixes [airlied: fixup conflict with newvision panel callbacks] Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220407085940.pnflvjojs4qw4b77@houat commit ac6bef064f716ba67ab81054d53856f285bec307 Author: Lv Ruyi Date: Mon Apr 11 03:25:46 2022 +0000 sfc: Fix spelling mistake "writting" -> "writing" There are some spelling mistakes in the comment. Fix it. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220411032546.2517628-1-lv.ruyi@zte.com.cn Signed-off-by: Paolo Abeni commit a3342f4d5af16888e385980a4bea4cc195c36bc0 Author: Ville Syrjälä Date: Fri Feb 18 12:04:03 2022 +0200 drm: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-23-ville.syrjala@linux.intel.com Reviewed-by: Andrzej Hajda commit 563c4a7599d8ac0f6826b33f312d886eda7938aa Author: Ville Syrjälä Date: Fri Feb 18 12:04:02 2022 +0200 drm: Use drm_mode_init() for on-stack modes Initialize on-stack modes with drm_mode_init() to guarantee no stack garbage in the list head, or that we aren't copying over another mode's list head. Based on the following cocci script, with manual fixups: @decl@ identifier M; expression E; @@ - struct drm_display_mode M = E; + struct drm_display_mode M; @@ identifier decl.M; expression decl.E; statement S, S1; @@ struct drm_display_mode M; ... when != S + drm_mode_init(&M, &E); + S1 @@ expression decl.E; @@ - &*E + E Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-22-ville.syrjala@linux.intel.com Reviewed-by: Andrzej Hajda commit 5ab58d6996d7befd3273379100f45214d7f58790 Author: Ville Syrjälä Date: Tue Apr 5 20:33:54 2022 +0300 drm/i915/bios: Validate the panel_name table In addition to the fp_timing,dvo_timing,panel_pnp_id tables there also exists a panel_name table. Unlike the others this is just one offset+table_size even though there are still 16 actual panel_names in the data block. The panel_name table made its first appearance somewhere around VBT version 156-163. The exact version is not known. But we don't need to know that since we can just check whether the pointers block has enough room for it or not. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220405173410.11436-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 58b2e3829ec6558d6d0edf709579b82550ecea61 Author: Ville Syrjälä Date: Tue Apr 5 20:33:53 2022 +0300 drm/i915/bios: Trust the LFP data pointers Now that we've sufficiently validated the LFP data pointers we can trust them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220405173410.11436-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 514003e1421e165aa048467af0c6768aab3bb099 Author: Ville Syrjälä Date: Tue Apr 5 20:33:52 2022 +0300 drm/i915/bios: Validate LFP data table pointers Make sure the LFP data table pointers sane. Sensible looking table entries, everything points correctly into the data block, etc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220405173410.11436-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 918f3025960f72b6551a229af68e1c596f1a5e9f Author: Ville Syrjälä Date: Tue Apr 5 20:33:51 2022 +0300 drm/i915/bios: Use the copy of the LFP data table always Currently get_lvds_fp_timing() still returns a pointer to the original data block rather than our copy. Let's convert the data pointer offsets to be relative to the data block rather than the whole BDB. With that we can make get_lvds_fp_timing() return a pointer to the copy. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220405173410.11436-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e163cfb4c96d022b93ab0006ab306de50b6d7c6b Author: Ville Syrjälä Date: Wed Apr 6 16:38:17 2022 +0300 drm/i915/bios: Make copies of VBT data blocks Make a copy of each VBT data block with a guaranteed minimum size. The extra (if any) will just be left zeroed. This means we don't have to worry about going out of bounds when accessing any of the structure members. Otherwise that could easliy happen if we simply get the version check wrong, or if the VBT is broken/malicious. v2: Don't do arithmetic between bdb header and copy of the LFP data block (Jani) v3: Make all the copies up front v4: Only WARN about min_size==0 if we found the block Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220406133817.30652-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d58a3d699797a59dae53542b20e2f03ba3f05036 Author: Ville Syrjälä Date: Tue Apr 5 20:33:49 2022 +0300 drm/i915/bios: Use the cached BDB version We have the BDB version cached, use it. We're going to have to start doing some of the BDB block parsing later, at which point we may no longer have the VBT around anymore (we free it at the end of intel_bios_init() when it didn't come via OpRegion). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220405173410.11436-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit b66bfc131c69bd9a5ed3ae90be4cf47ec46c1526 Author: Minghao Chi Date: Mon Apr 11 01:38:12 2022 +0000 net/cadence: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220411013812.2517212-1-chi.minghao@zte.com.cn Signed-off-by: Jakub Kicinski commit b8ff3395fbdf3b79a99d0ef410fc34c51044121e Author: Haowen Bai Date: Mon Apr 11 09:32:37 2022 +0800 sfc: ef10: Fix assigning negative value to unsigned variable fix warning reported by smatch: 251 drivers/net/ethernet/sfc/ef10.c:2259 efx_ef10_tx_tso_desc() warn: assigning (-208) to unsigned variable 'ip_tot_len' Signed-off-by: Haowen Bai Acked-by: Edward Cree Link: https://lore.kernel.org/r/1649640757-30041-1-git-send-email-baihaowen@meizu.com Signed-off-by: Jakub Kicinski commit c3976a3f84451ca05ea5be013af6071bf9acab2c Author: Arınç ÜNAL Date: Sun Apr 10 16:42:27 2022 +0300 net: bridge: offload BR_HAIRPIN_MODE, BR_ISOLATED, BR_MULTICAST_TO_UNICAST Add BR_HAIRPIN_MODE, BR_ISOLATED and BR_MULTICAST_TO_UNICAST port flags to BR_PORT_FLAGS_HW_OFFLOAD so that switchdev drivers which have an offloaded data plane have a chance to reject these bridge port flags if they don't support them yet. It makes the code path go through the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS driver handlers, which return -EINVAL for everything they don't recognize. For drivers that don't catch SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS at all, switchdev will return -EOPNOTSUPP for those which is then ignored, but those are in the minority. Signed-off-by: Arınç ÜNAL Reviewed-by: Ido Schimmel Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220410134227.18810-1-arinc.unal@arinc9.com Signed-off-by: Jakub Kicinski commit 808cee167bae3bae45287421ccefd96c96a870d3 Merge: d6967d04145eb 2ea1cbac267e2 Author: Jakub Kicinski Date: Mon Apr 11 20:50:04 2022 -0700 Merge branch 'net-lan966x-add-support-for-fdma' Horatiu Vultur says: ==================== net: lan966x: Add support for FDMA Currently when injecting or extracting a frame from CPU, the frame is given to the HW each word at a time. There is another way to inject/extract frames from CPU using FDMA(Frame Direct Memory Access). In this way the entire frame is given to the HW. This improves both RX and TX bitrate. ==================== Tested-by: Michael Walle # on kontron-kswitch-d10 Link: https://lore.kernel.org/r/20220408070357.559899-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 2ea1cbac267e2a39546982612fc00084b6d93e40 Author: Horatiu Vultur Date: Fri Apr 8 09:03:57 2022 +0200 net: lan966x: Update FDMA to change MTU. When changing the MTU, it is required to change also the size of the DBs. In case those frames will arrive to CPU. Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit c8349639324a79f60106126c8193bd2fcd574fe8 Author: Horatiu Vultur Date: Fri Apr 8 09:03:56 2022 +0200 net: lan966x: Add FDMA functionality Ethernet frames can be extracted or injected to or from the device's DDR memory. There is one channel for injection and one channel for extraction. Each of these channels contain a linked list of DCBs which contains DB. The DCB contains only 1 DB for both the injection and extraction. Each DB contains a frame. Every time when a frame is received or transmitted an interrupt is generated. It is not possible to use both the FDMA and the manual injection/extraction of the frames. Therefore the FDMA has priority over the manual because of better performance values. FDMA: iperf -c 192.168.1.1 [ 5] 0.00-10.02 sec 420 MBytes 352 Mbits/sec 0 sender [ 5] 0.00-10.03 sec 420 MBytes 351 Mbits/sec receiver iperf -c 192.168.1.1 -R [ 5] 0.00-10.01 sec 528 MBytes 442 Mbits/sec 0 sender [ 5] 0.00-10.00 sec 524 MBytes 440 Mbits/sec receiver Manual: iperf -c 192.168.1.1 [ 5] 0.00-10.02 sec 93.8 MBytes 78.5 Mbits/sec 0 sender [ 5] 0.00-10.03 sec 93.8 MBytes 78.4 Mbits/sec receiver ipers -c 192.168.1.1 -R [ 5] 0.00-10.03 sec 121 MBytes 101 Mbits/sec 0 sender [ 5] 0.00-10.01 sec 118 MBytes 99.0 Mbits/sec receiver Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit 8f2c7d9ad778e38c38a43932869ee6fc971b2b6c Author: Horatiu Vultur Date: Fri Apr 8 09:03:55 2022 +0200 net: lan966x: Expose functions that are needed by FDMA Expose the following functions 'lan966x_hw_offload', 'lan966x_ifh_get_src_port' and 'lan966x_ifh_get_timestamp' in lan966x_main.h so they can be accessed by FDMA. Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit fdb2981c00bb6ec82d3f96940a2f751ef9ca6bb4 Author: Horatiu Vultur Date: Fri Apr 8 09:03:54 2022 +0200 net: lan966x: Add registers that are used for FDMA. Add the registers that are used to configure the FDMA. Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski commit d6967d04145eb5471ce8b3c75dfc563a03bd3377 Author: Jonathan Neuschäfer Date: Sat Apr 9 20:21:45 2022 +0200 net: calxedaxgmac: Fix typo (doubled "the") Fix a doubled word in the comment above xgmac_poll. Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220409182147.2509788-1-j.neuschaefer@gmx.net Signed-off-by: Jakub Kicinski commit bfa323c659b1016c8e896920ba08cd6914cc3b0c Author: YueHaibing Date: Sat Apr 9 18:59:31 2022 +0800 net: ethernet: ti: am65-cpsw: Fix build error without PHYLINK If PHYLINK is n, build fails: drivers/net/ethernet/ti/am65-cpsw-ethtool.o: In function `am65_cpsw_set_link_ksettings': am65-cpsw-ethtool.c:(.text+0x118): undefined reference to `phylink_ethtool_ksettings_set' drivers/net/ethernet/ti/am65-cpsw-ethtool.o: In function `am65_cpsw_get_link_ksettings': am65-cpsw-ethtool.c:(.text+0x138): undefined reference to `phylink_ethtool_ksettings_get' drivers/net/ethernet/ti/am65-cpsw-ethtool.o: In function `am65_cpsw_set_eee': am65-cpsw-ethtool.c:(.text+0x158): undefined reference to `phylink_ethtool_set_eee' Select PHYLINK for TI_K3_AM65_CPSW_NUSS to fix this. Fixes: e8609e69470f ("net: ethernet: ti: am65-cpsw: Convert to PHYLINK") Signed-off-by: YueHaibing Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220409105931.9080-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski commit e69a837f5801207a2d1ff7bc3de1f024a343021a Merge: e2d0acd40c876 2984287c4c199 Author: Jakub Kicinski Date: Mon Apr 11 20:34:01 2022 -0700 Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Leon Romanovsky says: ==================== Mellanox shared branch that includes: * Removal of FPGA TLS code https://lore.kernel.org/all/cover.1649073691.git.leonro@nvidia.com Mellanox INNOVA TLS cards are EOL in May, 2018 [1]. As such, the code is unmaintained, untested and not in-use by any upstream/distro oriented customers. In order to reduce code complexity, drop the kernel code, clean build config options and delete useless kTLS vs. TLS separation. [1] https://network.nvidia.com/related-docs/eol/LCR-000286.pdf * Removal of FPGA IPsec code https://lore.kernel.org/all/cover.1649232994.git.leonro@nvidia.com Together with FPGA TLS, the IPsec went to EOL state in the November of 2019 [1]. Exactly like FPGA TLS, no active customers exist for this upstream code and all the complexity around that area can be deleted. [2] https://network.nvidia.com/related-docs/eol/LCR-000535.pdf * Fix to undefined behavior from Borislav https://lore.kernel.org/all/20220405151517.29753-11-bp@alien8.de * 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: (23 commits) net/mlx5: Remove not-implemented IPsec capabilities net/mlx5: Remove ipsec_ops function table net/mlx5: Reduce kconfig complexity while building crypto support net/mlx5: Move IPsec file to relevant directory net/mlx5: Remove not-needed IPsec config net/mlx5: Align flow steering allocation namespace to common style net/mlx5: Unify device IPsec capabilities check net/mlx5: Remove useless IPsec device checks net/mlx5: Remove ipsec vs. ipsec offload file separation RDMA/core: Delete IPsec flow action logic from the core RDMA/mlx5: Drop crypto flow steering API RDMA/mlx5: Delete never supported IPsec flow action net/mlx5: Remove FPGA ipsec specific statistics net/mlx5: Remove XFRM no_trailer flag net/mlx5: Remove not-used IDA field from IPsec struct net/mlx5: Delete metadata handling logic net/mlx5_fpga: Drop INNOVA IPsec support IB/mlx5: Fix undefined behavior due to shift overflowing the constant net/mlx5: Cleanup kTLS function names and their exposure net/mlx5: Remove tls vs. ktls separation as it is the same ... ==================== Link: https://lore.kernel.org/r/20220409055303.1223644-1-leon@kernel.org Signed-off-by: Jakub Kicinski commit e2d0acd40c876ad0cd3e8805adcf2325b910360c Author: Minghao Chi Date: Fri Apr 8 08:12:50 2022 +0000 net: stmmac: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220408081250.2494588-1-chi.minghao@zte.com.cn Signed-off-by: Jakub Kicinski commit 09e3dac420316dbeedbf8d1d5d28901e87af5f4f Author: Jack Matthews Date: Wed Feb 9 16:57:41 2022 +0000 ARM: dts: qcom: pm8226: add node for RTC Add a node for PM8226's real time clock. Signed-off-by: Jack Matthews Reviewed-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220209165742.652890-1-jm5112356@gmail.com commit ca1666463eec6a80724701bf58f33530f5642a2b Author: Krzysztof Kozlowski Date: Fri Apr 1 22:27:59 2022 +0200 dt-bindings: qcom,smd-rpm: update maintainers (drop Kathiravan) Kathiravan's email bounces (585: Recipient address rejected: undeliverable address: No such user here) so switch maintainers to Andy and Bjorn (as Qualcomm platform maintainers). Signed-off-by: Krzysztof Kozlowski Acked-by: Mark Brown Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401202759.191560-1-krzysztof.kozlowski@linaro.org commit e4cbe44ec67b0073aefdbcf6d0d6aa213b9b4328 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:47 2022 +0200 ARM: dts: qcom: msm8660: disable GSBI8 The GSBI8 child node (I2C controller) is disabled, so as parent GSBI node should be the same. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-6-krzysztof.kozlowski@linaro.org commit bec819180790f27659176056273ffa4b6aa6c397 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:46 2022 +0200 ARM: dts: qcom: ipq4019: align clocks in I2C with DT schema The DT schema expects clocks core-iface order. No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-5-krzysztof.kozlowski@linaro.org commit 17c15a4ccf93e1bae322f1748bbd404165d90d92 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:45 2022 +0200 ARM: dts: qcom: ipq4019: align dmas in SPI/UART with DT schema The DT schema expects dma channels in tx-rx order. No functional change. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-4-krzysztof.kozlowski@linaro.org commit 1dcf37365e7de6214af55587c69f4cced06262de Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:51 2022 +0200 dt-bindings: qcom: qcom,gsbi: convert to dtschema Convert the Qualcomm General Serial Bus Interface (GSBI) to DT Schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405063451.12011-10-krzysztof.kozlowski@linaro.org commit a5ffbc04ad0327919157a643cc56de513a4c6928 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:57:52 2022 +0200 dt-bindings: soc: qcom,wcnss: convert to dtschema Convert the Qualcomm WCNSS bindings to DT Schema. Changes against original bindings: fix qcom,smd-channels and qcom,smem-states names (how they are used in DTS and driver), enforce child node naming of bluetooth and wifi. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405065752.27389-3-krzysztof.kozlowski@linaro.org commit 0f375d3aa6e2bde1c7c642caa0da37989d31f3e1 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:57:50 2022 +0200 ARM: dts: qcom: rename WCNSS child name to bluetooth The "bluetooth" is more popular and more descriptive than "bt", for a Bluetooth device. The WCNSS DT schema will expect such naming. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405065752.27389-1-krzysztof.kozlowski@linaro.org commit d00004c4563f6c00a79f7228524966ac7a1aa29c Author: Krzysztof Kozlowski Date: Tue Apr 5 08:55:12 2022 +0200 dt-bindings: soc: qcom,smsm: convert to dtschema Convert the Qualcomm Shared Memory State Machine to DT schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220405065512.26521-1-krzysztof.kozlowski@linaro.org commit 50769f32af218c07b07096b55a5ecad319458609 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:31:11 2022 +0200 ARM: dts: qcom: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220407143112.294930-1-krzysztof.kozlowski@linaro.org commit 413821b7777d062b57f8dc66ab088ed390cbc3ec Author: Luca Weiss Date: Fri Apr 8 13:53:10 2022 +0200 arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics Add a node for the haptics driver found on the phone. Signed-off-by: Luca Weiss Reported-by: kernel test robot Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220408115311.237039-3-luca.weiss@fairphone.com commit 7be9f3ae250e97859e28c26daf457b1be3f58d17 Author: Luca Weiss Date: Fri Apr 8 13:42:05 2022 +0200 arm64: dts: qcom: sm6350: Add I2C busses Add nodes for the I2C busses on sm6350. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220408114205.234635-2-luca.weiss@fairphone.com commit 9e5c45a5aac0ccb0d3433c8ea6b577c0473351ef Author: Luca Weiss Date: Fri Apr 8 13:42:04 2022 +0200 arm64: dts: qcom: sm6350: Fix naming of uart9 The uart9 was previously mistakenly called uart2. Fix this. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220408114205.234635-1-luca.weiss@fairphone.com commit e7773dbc87674aec210432185d9624ed346a46f1 Author: Petr Vorel Date: Wed Mar 23 21:48:40 2022 +0100 arm64: dts: qcom: msm8994-huawei-angler: Add sdhc1 definition Angler does not have SD card, thus sdhc2 kept disabled. Signed-off-by: Petr Vorel Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220323204840.22832-1-petr.vorel@gmail.com commit 3a6a7187f09a0b1add76aaf4015f215a381ab616 Author: Wan Jiabing Date: Thu Apr 7 15:24:42 2022 +0800 scsi: megaraid_sas: Remove unnecessary memset instance->cmd_list is allocated by kcalloc(). The memory is already set to zero. It is unnecessary to call memset again. Link: https://lore.kernel.org/r/20220407072442.4137977-1-wanjiabing@vivo.com Acked-by: Sumit Saxena Signed-off-by: Wan Jiabing Signed-off-by: Martin K. Petersen commit 5334a3b12a7233b31788de60d61bfd890059d783 Author: Bjorn Andersson Date: Fri Apr 8 14:33:36 2022 -0700 soc: qcom: llcc: Add MODULE_DEVICE_TABLE() The llcc-qcom driver can be compiled as a module, but lacks MODULE_DEVICE_TABLE() and will therefore not be loaded automatically. Fix this. Fixes: a3134fb09e0b ("drivers: soc: Add LLCC driver") Signed-off-by: Bjorn Andersson Reviewed-by: Sai Prakash Ranjan Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220408213336.581661-3-bjorn.andersson@linaro.org commit 1cb9d3b6185b2a4d1d592632a7faf5d8c8e5f9b3 Author: Haiyang Zhang Date: Thu Apr 7 13:21:34 2022 -0700 hv_netvsc: Add support for XDP_REDIRECT Handle XDP_REDIRECT action in netvsc driver. Also, transparently pass ndo_xdp_xmit to VF when available. Signed-off-by: Haiyang Zhang Link: https://lore.kernel.org/r/1649362894-20077-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Jakub Kicinski commit 2e36437f44b3b71f383c36491b86be4bdd7fd12a Merge: d072c88c28e1e 9f6982e9a3c26 Author: Jakub Kicinski Date: Mon Apr 11 17:38:02 2022 -0700 Merge branch 'ipv4-convert-several-tos-fields-to-dscp_t' Guillaume Nault says: ==================== ipv4: Convert several tos fields to dscp_t Continue the work started with commit a410a0cf9885 ("ipv6: Define dscp_t and stop taking ECN bits into account in fib6-rules") and convert more structure fields and variables to dscp_t. This series focuses on struct fib_rt_info, struct fib_entry_notifier_info and their users (networking drivers). The purpose of dscp_t is to ensure that ECN bits don't influence IP route lookups. It does so by ensuring that dscp_t variables have the ECN bits cleared. Notes: * This series is entirely about type annotation and isn't supposed to have any user visible effect. * The first two patches have to introduce a few dsfield <-> dscp conversions in the affected drivers, but those are then removed when converting the internal driver structures (patches 3-5). In the end, drivers don't have to handle any conversion. ==================== Link: https://lore.kernel.org/r/cover.1649445279.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit 9f6982e9a3c26a9db226cefd91c21a3e325ca397 Author: Guillaume Nault Date: Fri Apr 8 22:08:50 2022 +0200 net: marvell: prestera: Use dscp_t in struct prestera_kern_fib_cache Use the new dscp_t type to replace the kern_tos field of struct prestera_kern_fib_cache. This ensures ECN bits are ignored and makes it compatible with the dscp fields of struct fib_entry_notifier_info and struct fib_rt_info. This also allows sparse to flag potential incorrect uses of DSCP and ECN bits. Signed-off-by: Guillaume Nault Reviewed-by: Yevhen Orlov Signed-off-by: Jakub Kicinski commit 046eabbf1991c65d50d1d842f1a3011b53ca9b0a Author: Guillaume Nault Date: Fri Apr 8 22:08:46 2022 +0200 mlxsw: Use dscp_t in struct mlxsw_sp_fib4_entry Use the new dscp_t type to replace the tos field of struct mlxsw_sp_fib4_entry. This ensures ECN bits are ignored and makes it compatible with the dscp fields of fib_entry_notifier_info and fib_rt_info. This also allows sparse to flag potential incorrect uses of DSCP and ECN bits. Signed-off-by: Guillaume Nault Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 20bbf32efe1e3b937e7d3a53604dd643b686af3c Author: Guillaume Nault Date: Fri Apr 8 22:08:43 2022 +0200 netdevsim: Use dscp_t in struct nsim_fib4_rt Use the new dscp_t type to replace the tos field of struct nsim_fib4_rt. This ensures ECN bits are ignored and makes it compatible with the dscp fields of struct fib_entry_notifier_info and struct fib_rt_info. This also allows sparse to flag potential incorrect uses of DSCP and ECN bits. Signed-off-by: Guillaume Nault Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 568a3f33b4273833f1b1e4a39d4a3410c4770c32 Author: Guillaume Nault Date: Fri Apr 8 22:08:40 2022 +0200 ipv4: Use dscp_t in struct fib_entry_notifier_info Use the new dscp_t type to replace the tos field of struct fib_entry_notifier_info. This ensures ECN bits are ignored and makes it compatible with the dscp field of struct fib_rt_info. This also allows sparse to flag potential incorrect uses of DSCP and ECN bits. Signed-off-by: Guillaume Nault Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 888ade8f90d7dbbdc8552ae9b23d311f9e61ab0e Author: Guillaume Nault Date: Fri Apr 8 22:08:37 2022 +0200 ipv4: Use dscp_t in struct fib_rt_info Use the new dscp_t type to replace the tos field of struct fib_rt_info. This ensures ECN bits are ignored and makes it compatible with the fa_dscp field of struct fib_alias. This also allows sparse to flag potential incorrect uses of DSCP and ECN bits. Signed-off-by: Guillaume Nault Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit a28c1ab312712c26a8d004af1f68628d625dafac Author: Sergey Shtylyov Date: Sat Apr 9 22:13:56 2022 +0300 ata: libata-core: fix parameter type in ata_xfer_mode2shift() The data transfer mode that corresponds to the 'xfer_mode' parameter for ata_xfer_mode2shift() is a 8-bit *unsigned* value. Using *unsigned long* to declare the parameter leads to a problematic implicit *int* to *unsigned long* cast and was most probably a result of a copy/paste mistake -- use the 'u8' type instead, as in ata_xfer_mode2mask()... Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit c708b08c65a0dfae127b9ee33b0fb73535a5e066 Author: Paul E. McKenney Date: Wed Feb 23 17:29:37 2022 -0800 rcu: Check for jiffies going backwards A report of a 12-jiffy normal RCU CPU stall warning raises interesting questions about the nature of time on the offending system. This commit instruments rcu_sched_clock_irq(), which is RCU's hook into the scheduling-clock interrupt, checking for the jiffies counter going backwards. Reported-by: Saravanan D Signed-off-by: Paul E. McKenney commit 90d2efe7bdbde5371b6122174af0718843f805c6 Author: Paul E. McKenney Date: Wed Feb 16 09:54:56 2022 -0800 rcu: Fix rcu_preempt_deferred_qs_irqrestore() strict QS reporting Suppose we have a kernel built with both CONFIG_RCU_STRICT_GRACE_PERIOD=y and CONFIG_PREEMPT=y. Suppose further that an RCU reader from which RCU core needs a quiescent state ends in rcu_preempt_deferred_qs_irqrestore(). This function will then invoke rcu_report_qs_rdp() in order to immediately report that quiescent state. Unfortunately, it will not have cleared that reader's CPU's rcu_data structure's ->cpu_no_qs.b.norm field. As a result, rcu_report_qs_rdp() will take an early exit because it will believe that this CPU has not yet encountered a quiescent state, and there will be no reporting of the current quiescent state. This commit therefore causes rcu_preempt_deferred_qs_irqrestore() to clear the ->cpu_no_qs.b.norm field before invoking rcu_report_qs_rdp(). Kudos to Boqun Feng and Neeraj Upadhyay for helping with analysis of this issue! Signed-off-by: Paul E. McKenney commit d22959aa93528c6cf4583560696856cf6bba6b72 Author: Paul E. McKenney Date: Wed Feb 2 09:10:04 2022 -0800 rcu: Clarify fill-the-gap comment in rcu_segcblist_advance() Reported-by: Frederic Weisbecker Reported-by: Neeraj Upadhyay Reported-by: Boqun Feng Signed-off-by: Paul E. McKenney commit 930c4acc064edacd2c9d5bec1a66acacb2fb2589 Author: Willy Tarreau Date: Mon Feb 7 17:23:14 2022 +0100 tools/nolibc: guard the main file against multiple inclusion Including nolibc.h multiple times results in build errors due to multiple definitions. Let's add a guard against multiple inclusions. Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 9c2970fbb425cca0256ecf0f96490e4f253fda24 Author: Willy Tarreau Date: Mon Feb 7 17:23:13 2022 +0100 tools/nolibc: use pselect6 on RISCV This arch doesn't provide the old-style select() syscall, we have to use pselect6(). Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 8e82c28ea2b4c6096c7673c59a285c658c9f389f Author: Paul Menzel Date: Tue Feb 22 13:07:16 2022 +0100 torture: Make thread detection more robust by using lspcu For consecutive numbers the lscpu command collapses the output and just shows the range with start and end. The processors are numbered that way on POWER8. $ sudo ppc64_cpu --smt=8 $ lscpu | grep '^NUMA node' NUMA node(s): 2 NUMA node0 CPU(s): 0-79 NUMA node8 CPU(s): 80-159 This causes the heuristic to detect the number threads per core, looking for the number after the first comma, to fail, and QEMU aborts because of invalid arguments. $ lscpu | grep '^NUMA node0' | sed -e 's/^[^,-]*(,|\-)\([0-9]*\),.*$/\1/' NUMA node0 CPU(s): 0-79 But the lscpu command shows the number of threads per core: $ sudo ppc64_cpu --smt=8 $ lscpu | grep 'Thread(s) per core' Thread(s) per core: 8 $ sudo ppc64_cpu --smt=off $ lscpu | grep 'Thread(s) per core' Thread(s) per core: 1 This commit therefore directly uses that value and replaces use of grep with "sed -n" and its "p" command. Signed-off-by: Paul Menzel Signed-off-by: Paul E. McKenney commit 98bb264bdbbc0fe9d6b0340057fcc4e8e7043760 Author: Paul E. McKenney Date: Fri Feb 18 17:52:13 2022 -0800 torture: Permit running of experimental torture types This commit weakens the checks of the kvm.sh script's --torture parameter and the kvm-recheck.sh script's parsing so that experimental torture tests may be created without updating these two scripts. The changes required are to the appropriate Makefile and Kconfig file, plus a directory whose name begins with "X" must be added to the rcutorture/configs file. This new directory's name can then be passed in via the kvm.sh script's --torture parameter. Signed-off-by: Paul E. McKenney commit b20842baf89955a18ade95e6de6d94be757d6e5f Author: Paul E. McKenney Date: Tue Feb 15 17:22:32 2022 -0800 torture: Use "-o Batchmode=yes" to disable ssh password requests The torture.sh script normally runs unattended, so there is not much point in the "ssh" command asking for a password. This commit therefore adds the "-o Batchmode=yes" argument to each "ssh" command to cause it to fail rather than ask for a password. Signed-off-by: Paul E. McKenney commit ab3ecd0bce32705e722f356a504694f4fd51d4c0 Author: Paul E. McKenney Date: Tue Feb 15 17:19:31 2022 -0800 torture: Reposition so that $? collects ssh code in torture.sh An "echo" slipped in between an "ssh" and the "ret=$?" that was intended to collect its exit code, which prevents torture.sh from detecting "ssh" failure. This commit therefore reassociates the two. Signed-off-by: Paul E. McKenney commit 46e861be589881e0905b9ade3d8439883858721c Author: Paul E. McKenney Date: Thu Mar 17 09:30:10 2022 -0700 rcu: Make TASKS_RUDE_RCU select IRQ_WORK The TASKS_RUDE_RCU does not select IRQ_WORK, which can result in build failures for kernels that do not otherwise select IRQ_WORK. This commit therefore causes the TASKS_RUDE_RCU Kconfig option to select IRQ_WORK. Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Paul E. McKenney commit bd6c375b92c3f367e184d164e12952e4b9d9fb4f Author: Frederic Weisbecker Date: Tue Mar 15 16:33:38 2022 +0100 rcutorture: Call preempt_schedule() through static call/key The rcutorture test suite sometimess triggers a random scheduler preemption call while simulating a read delay. Unfortunately, its direct call to preempt_schedule() bypasses the static call/key filter used by CONFIG_PREEMPT_DYNAMIC. This breaks the no-preempt assumption when the dynamic preemption mode is "none". For example, rcu_blocking_is_gp() is fooled and abbreviates grace periods when the CPU runs in no-preempt UP mode. Fix this by making torture_preempt_schedule() call __preempt_schedule(), which uses the static call/key. Reported-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 80dcee695143255261f30c7cc2a041ba413717a4 Author: David Vernet Date: Mon Mar 7 14:46:57 2022 -0800 rcutorture: Add missing return and use __func__ in warning The rcutorture module has an rcu_torture_writer task that repeatedly performs writes, synchronizations, and deletes. There is a corner-case check in rcu_torture_writer() wherein if nsynctypes is 0, a warning is issued and the task waits to be stopped via a call to torture_kthread_stopping() rather than performing any work. There should be a return statement following this call to torture_kthread_stopping(), as the intention with issuing the call to torture_kthread_stopping() in the first place is to avoid the rcu_torture_writer task from performing any work. Some of the work may even be dangerous to perform, such as potentially causing a #DE due to nsynctypes being used in a modulo operator when querying for sync updates to issue. This patch adds the missing return call. As a bonus, it also fixes a checkpatch warning that was emitted due to the WARN_ONCE() call using the name of the function rather than __func__. Signed-off-by: David Vernet Signed-off-by: Paul E. McKenney commit 39b3cab92d3754e18b1f9b5de8158642145b2405 Author: David Vernet Date: Mon Mar 7 14:46:55 2022 -0800 rcutorture: Avoid corner-case #DE with nsynctypes check The rcutorture module is used to run torture tests that validate RCU. rcutorture takes a variety of module parameters that configure the functionality of the test. Amongst these parameters are the types of synchronization mechanisms that the rcu_torture_writer and rcu_torture_fakewriter tasks may use, and the torture_type of the run which determines what read and sync operations are used by the various writer and reader tasks that run throughout the test. When the module is configured to only use sync types for which the specified torture_type does not implement the necessary operations, we can end up in a state where nsynctypes is 0. This is not an erroneous state, but it currently crashes the kernel with a #DE due to nsynctypes being used with a modulo operator in rcu_torture_fakewriter(). Here is an example of such a #DE: $ insmod ./rcutorture.ko gp_cond=1 gp_cond_exp=0 gp_exp=0 gp_poll_exp=0 gp_normal=0 gp_poll=0 gp_poll_exp=0 verbose=9999 torture_type=trivial ... [ 8536.525096] divide error: 0000 [#1] PREEMPT SMP PTI [ 8536.525101] CPU: 30 PID: 392138 Comm: rcu_torture_fak Kdump: loaded Tainted: G S 5.17.0-rc1-00179-gc8c42c80febd #24 [ 8536.525105] Hardware name: Quanta Twin Lakes MP/Twin Lakes Passive MP, BIOS F09_3A23 12/08/2020 [ 8536.525106] RIP: 0010:rcu_torture_fakewriter+0xf1/0x2d0 [rcutorture] [ 8536.525121] Code: 00 31 d2 8d 0c f5 00 00 00 00 48 63 c9 48 f7 f1 48 85 d2 0f 84 79 ff ff ff 48 89 e7 e8 78 78 01 00 48 63 0d 29 ca 00 00 31 d2 <48> f7 f1 8b 04 95 00 05 4e a0 83 f8 06 0f 84 ad 00 00 00 7f 1f 83 [ 8536.525124] RSP: 0018:ffffc9000777fef0 EFLAGS: 00010246 [ 8536.525127] RAX: 00000000223d006e RBX: cccccccccccccccd RCX: 0000000000000000 [ 8536.525130] RDX: 0000000000000000 RSI: ffffffff824315b9 RDI: ffffc9000777fef0 [ 8536.525132] RBP: ffffc9000487bb30 R08: 0000000000000002 R09: 000000000002a580 [ 8536.525134] R10: ffffffff82c5f920 R11: 0000000000000000 R12: ffff8881a2c35d00 [ 8536.525136] R13: ffff8881540c8d00 R14: ffffffffa04d39d0 R15: 0000000000000000 [ 8536.525137] FS: 0000000000000000(0000) GS:ffff88903ff80000(0000) knlGS:0000000000000000 [ 8536.525140] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8536.525142] CR2: 00007f839f022000 CR3: 0000000002c0a006 CR4: 00000000007706e0 [ 8536.525144] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 8536.525145] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 8536.525147] PKRU: 55555554 [ 8536.525148] Call Trace: [ 8536.525150] [ 8536.525153] kthread+0xe8/0x110 [ 8536.525161] ? kthread_complete_and_exit+0x20/0x20 [ 8536.525167] ret_from_fork+0x22/0x30 [ 8536.525174] The solution is to gracefully handle the case of nsynctypes being 0 in rcu_torture_fakewriter() by not performing any work. This is already being done in rcu_torture_writer(), though there is a missing return on that path which will be fixed in a subsequent patch. Signed-off-by: David Vernet Signed-off-by: Paul E. McKenney commit 8106bddbab5f0ba180e6d693c7c1fc6926d57caa Author: Paul E. McKenney Date: Mon Feb 28 17:40:49 2022 -0800 scftorture: Fix distribution of short handler delays The scftorture test module's scf_handler() function is supposed to provide three different distributions of short delays (including "no delay") and one distribution of long delays, if specified by the scftorture.longwait module parameter. However, the second of the two non-zero-wait short delays is disabled due to the first such delay's "goto out" not being enclosed in the "then" clause with the "udelay()". This commit therefore adjusts the code to provide the intended set of delays. Fixes: e9d338a0b179 ("scftorture: Add smp_call_function() torture test") Signed-off-by: Paul E. McKenney commit 99d6a2acb8955f12489bfba04f2db22bc0b57726 Author: Paul E. McKenney Date: Fri Feb 4 12:45:18 2022 -0800 rcutorture: Suppress debugging grace period delays during flooding Tree RCU supports grace-period delays using the rcutree.gp_cleanup_delay, rcutree.gp_init_delay, and rcutree.gp_preinit_delay kernel boot parameters. These delays are strictly for debugging purposes, and have proven quite effective at exposing bugs involving race with CPU-hotplug operations. However, these delays can result in false positives when used in conjunction with callback flooding, for example, those generated by the rcutorture.fwd_progress kernel boot parameter. This commit therefore suppresses grace-period delays while callback flooding is in progress. Signed-off-by: Paul E. McKenney commit b6f3c6a2b1fe2d754acb7bf64a20e64a8f2c8a1b Author: Paul E. McKenney Date: Thu Feb 3 17:53:22 2022 -0800 torture: Add rcu_normal and rcu_expedited runs to torture.sh Currently, the rcupdate.rcu_normal and rcupdate.rcu_expedited kernel boot parameters are not regularly tested. The potential addition of polled expedited grace-period APIs increases the amount of code that is affected by these kernel boot parameters. This commit therefore adds a "--do-rt" argument to torture.sh to exercise these kernel-boot options. Signed-off-by: Paul E. McKenney commit ab2756ea6b74987849b44ad0e33c3cfec159033b Author: Paul E. McKenney Date: Fri Apr 8 09:21:50 2022 -0700 rcu-tasks: Handle sparse cpu_possible_mask in rcu_tasks_invoke_cbs() If the cpu_possible_mask is sparse (for example, if bits are set only for CPUs 0, 4, 8, ...), then rcu_tasks_invoke_cbs() will access per-CPU data for a CPU not in cpu_possible_mask. It makes these accesses while doing a workqueue-based binary search for non-empty callback lists. Although this search must pass through CPUs not represented in cpu_possible_mask, it has no need to check the callback list for such CPUs. This commit therefore changes the rcu_tasks_invoke_cbs() function's binary search so as to only check callback lists for CPUs present in cpu_possible_mask. Reported-by: Eric Dumazet Signed-off-by: Paul E. McKenney commit 07d95c34e8125a7bf833a94bc3c9d51992d92c45 Author: Eric Dumazet Date: Mon Apr 4 12:30:18 2022 -0700 rcu-tasks: Handle sparse cpu_possible_mask If the rcupdate.rcu_task_enqueue_lim kernel boot parameter is set to something greater than 1 and less than nr_cpu_ids, the code attempts to use a subset of the CPU's RCU Tasks callback lists. This works, but only if the cpu_possible_mask is contiguous. If there are "holes" in this mask, the callback-enqueue code might attempt to access a non-existent per-CPU ->rtcpu variable for a non-existent CPU. For example, if only CPUs 0, 4, 8, 12, 16 and so on are in cpu_possible_mask, specifying rcupdate.rcu_task_enqueue_lim=4 would cause the code to attempt to use callback queues for non-existent CPUs 1, 2, and 3. Because such systems have existed in the past and might still exist, the code needs to gracefully handle this situation. This commit therefore checks to see whether the desired CPU is present in cpu_possible_mask, and, if not, searches for the next CPU. This means that the systems administrator of a system with a sparse cpu_possible_mask will need to account for this sparsity when specifying the value of the rcupdate.rcu_task_enqueue_lim kernel boot parameter. For example, setting this parameter to the value 4 will use only CPUs 0 and 4, which CPU 4 getting three times the callback load of CPU 0. This commit assumes that bit (nr_cpu_ids - 1) is always set in cpu_possible_mask. Link: https://lore.kernel.org/lkml/CANn89iKaNEwyNZ=L_PQnkH0LP_XjLYrr_dpyRKNNoDJaWKdrmg@mail.gmail.com/ Signed-off-by: Eric Dumazet Signed-off-by: Paul E. McKenney commit 10b3742f939c51d53619a31a5c03055c5e0952b4 Author: Paul E. McKenney Date: Mon Mar 28 16:00:05 2022 -0700 rcu-tasks: Make show_rcu_tasks_generic_gp_kthread() check all CPUs Currently, the show_rcu_tasks_generic_gp_kthread() function only looks at CPU 0's callback lists. Although this is not fatal, it can confuse debugging efforts in cases where any of the Tasks RCU flavors are in per-CPU queueing mode. This commit therefore causes this function to scan all CPUs' callback queues. Signed-off-by: Paul E. McKenney commit bddf7122f7e321d5a677a695e8597064d987482c Author: Paul E. McKenney Date: Fri Mar 18 08:08:14 2022 -0700 rcu-tasks: Restore use of timers for non-RT kernels The use of hrtimers for RCU-tasks grace-period delays works well in general, but can result in excessive grace-period delays for some corner-case workloads. This commit therefore reverts to the use of timers for non-RT kernels to mitigate those grace-period delays. Signed-off-by: Paul E. McKenney commit 777570d9ef820e470736fa9e02b8e3e48891c050 Author: Sebastian Andrzej Siewior Date: Tue Mar 8 09:54:13 2022 -0800 rcu-tasks: Use schedule_hrtimeout_range() to wait for grace periods The synchronous RCU-tasks grace-period-wait primitives invoke schedule_timeout_idle() to give readers a chance to exit their read-side critical sections. Unfortunately, this fails during early boot on PREEMPT_RT because PREEMPT_RT relies solely on ksoftirqd to run timer handlers. Because ksoftirqd cannot operate until its kthreads are spawned, there is a brief period of time following scheduler initialization where PREEMPT_RT cannot run the timer handlers that schedule_timeout_idle() relies on, resulting in a hang. To avoid this boot-time hang, this commit replaces schedule_timeout_idle() with schedule_hrtimeout(), so that the timer expires in hardirq context. This is ensures that the timer fires even on PREEMPT_RT throughout the irqs-enabled portions of boot as well as during runtime. The timer is set to expire between fract and fract + HZ / 2 jiffies in order to align with any other timers that might expire during that time, thus reducing the number of wakeups. Note that RCU-tasks grace periods are infrequent, so the use of hrtimer should be fine. In contrast, in common-case code, user of hrtimer could result in performance issues. Cc: Martin KaFai Lau Cc: Andrii Nakryiko Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Paul E. McKenney commit 5d90070816534882b9158f14154b7e2cdef1194a Author: Paul E. McKenney Date: Fri Mar 4 10:41:44 2022 -0800 rcu-tasks: Make Tasks RCU account for userspace execution The main Tasks RCU quiescent state is voluntary context switch. However, userspace execution is also a valid quiescent state, and is a valuable one for userspace applications that spin repeatedly executing light-weight non-sleeping system calls. Currently, such an application can delay a Tasks RCU grace period for many tens of seconds. This commit therefore enlists the aid of the scheduler-clock interrupt to provide a Tasks RCU quiescent state when it interrupted a task executing in userspace. [ paulmck: Apply feedback from kernel test robot. ] Cc: Martin KaFai Lau Cc: Neil Spring Signed-off-by: Paul E. McKenney commit 88db792bbe9b140680c74e9f2f801ac00f54e05e Author: Sebastian Andrzej Siewior Date: Fri Mar 4 12:07:25 2022 +0100 rcu-tasks: Use rcuwait for the rcu_tasks_kthread() The waitqueue used by rcu_tasks_kthread() has always only one waiter. With a guaranteed only one waiter, this can be replaced with rcuwait which is smaller and simpler. With rcuwait based wake counterpart, the irqwork function (call_rcu_tasks_iw_wakeup()) can be invoked hardirq context because it is only a wake up and no sleeping locks are involved (unlike the wait_queue_head). As a side effect, this is also one piece of the puzzle to pass the RCU selftest at early boot on PREEMPT_RT. Replace wait_queue_head with rcuwait and let the irqwork run in hardirq context on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Paul E. McKenney commit f25390033fa2445cdc4d6cf8243a9b85d942845f Author: Paul E. McKenney Date: Fri Feb 25 16:01:12 2022 -0800 rcu-tasks: Print pre-stall-warning informational messages RCU-tasks stall-warning messages are printed after the grace period is ten minutes old. Unfortunately, most of us will have rebooted the system in response to an apparently-hung command long before the ten minutes is up, and will thus see what looks to be a silent hang. This commit therefore adds pr_info() messages that are printed earlier. These should avoid being classified as errors, but should give impatient users a hint. These are controlled by new rcupdate.rcu_task_stall_info and rcupdate.rcu_task_stall_info_mult kernel-boot parameters. The former defines the initial delay in jiffies (defaulting to 10 seconds) and the latter defines the multiplier (defaulting to 3). Thus, by default, the first message will appear 10 seconds into the RCU-tasks grace period, the second 40 seconds in, and the third 160 seconds in. There would be a fourth at 640 seconds in, but the stall warning message appears 600 seconds in, and once a stall warning is printed for a given grace period, no further informational messages are printed. Signed-off-by: Paul E. McKenney commit f75fd4b9221d93177c50dcfde671b2e907f53e86 Author: Padmanabha Srinivasaiah Date: Thu Feb 17 16:25:19 2022 +0100 rcu-tasks: Fix race in schedule and flush work While booting secondary CPUs, cpus_read_[lock/unlock] is not keeping online cpumask stable. The transient online mask results in below calltrace. [ 0.324121] CPU1: Booted secondary processor 0x0000000001 [0x410fd083] [ 0.346652] Detected PIPT I-cache on CPU2 [ 0.347212] CPU2: Booted secondary processor 0x0000000002 [0x410fd083] [ 0.377255] Detected PIPT I-cache on CPU3 [ 0.377823] CPU3: Booted secondary processor 0x0000000003 [0x410fd083] [ 0.379040] ------------[ cut here ]------------ [ 0.383662] WARNING: CPU: 0 PID: 10 at kernel/workqueue.c:3084 __flush_work+0x12c/0x138 [ 0.384850] Modules linked in: [ 0.385403] CPU: 0 PID: 10 Comm: rcu_tasks_rude_ Not tainted 5.17.0-rc3-v8+ #13 [ 0.386473] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT) [ 0.387289] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.388308] pc : __flush_work+0x12c/0x138 [ 0.388970] lr : __flush_work+0x80/0x138 [ 0.389620] sp : ffffffc00aaf3c60 [ 0.390139] x29: ffffffc00aaf3d20 x28: ffffffc009c16af0 x27: ffffff80f761df48 [ 0.391316] x26: 0000000000000004 x25: 0000000000000003 x24: 0000000000000100 [ 0.392493] x23: ffffffffffffffff x22: ffffffc009c16b10 x21: ffffffc009c16b28 [ 0.393668] x20: ffffffc009e53861 x19: ffffff80f77fbf40 x18: 00000000d744fcc9 [ 0.394842] x17: 000000000000000b x16: 00000000000001c2 x15: ffffffc009e57550 [ 0.396016] x14: 0000000000000000 x13: ffffffffffffffff x12: 0000000100000000 [ 0.397190] x11: 0000000000000462 x10: ffffff8040258008 x9 : 0000000100000000 [ 0.398364] x8 : 0000000000000000 x7 : ffffffc0093c8bf4 x6 : 0000000000000000 [ 0.399538] x5 : 0000000000000000 x4 : ffffffc00a976e40 x3 : ffffffc00810444c [ 0.400711] x2 : 0000000000000004 x1 : 0000000000000000 x0 : 0000000000000000 [ 0.401886] Call trace: [ 0.402309] __flush_work+0x12c/0x138 [ 0.402941] schedule_on_each_cpu+0x228/0x278 [ 0.403693] rcu_tasks_rude_wait_gp+0x130/0x144 [ 0.404502] rcu_tasks_kthread+0x220/0x254 [ 0.405264] kthread+0x174/0x1ac [ 0.405837] ret_from_fork+0x10/0x20 [ 0.406456] irq event stamp: 102 [ 0.406966] hardirqs last enabled at (101): [] _raw_spin_unlock_irq+0x78/0xb4 [ 0.408304] hardirqs last disabled at (102): [] el1_dbg+0x24/0x5c [ 0.409410] softirqs last enabled at (54): [] local_bh_enable+0xc/0x2c [ 0.410645] softirqs last disabled at (50): [] local_bh_disable+0xc/0x2c [ 0.411890] ---[ end trace 0000000000000000 ]--- [ 0.413000] smp: Brought up 1 node, 4 CPUs [ 0.413762] SMP: Total of 4 processors activated. [ 0.414566] CPU features: detected: 32-bit EL0 Support [ 0.415414] CPU features: detected: 32-bit EL1 Support [ 0.416278] CPU features: detected: CRC32 instructions [ 0.447021] Callback from call_rcu_tasks_rude() invoked. [ 0.506693] Callback from call_rcu_tasks() invoked. This commit therefore fixes this issue by applying a single-CPU optimization to the RCU Tasks Rude grace-period process. The key point here is that the purpose of this RCU flavor is to force a schedule on each online CPU since some past event. But the rcu_tasks_rude_wait_gp() function runs in the context of the RCU Tasks Rude's grace-period kthread, so there must already have been a context switch on the current CPU since the call to either synchronize_rcu_tasks_rude() or call_rcu_tasks_rude(). So if there is only a single CPU online, RCU Tasks Rude's grace-period kthread does not need to anything at all. It turns out that the rcu_tasks_rude_wait_gp() function's call to schedule_on_each_cpu() causes problems during early boot. During that time, there is only one online CPU, namely the boot CPU. Therefore, applying this single-CPU optimization fixes early-boot instances of this problem. Link: https://lore.kernel.org/lkml/20220210184319.25009-1-treasure4paddy@gmail.com/T/ Suggested-by: Paul E. McKenney Signed-off-by: Padmanabha Srinivasaiah Signed-off-by: Paul E. McKenney commit 87c5adf06bfbf14c9d13e59d5d174ff5f2aafc0e Author: Frederic Weisbecker Date: Wed Feb 16 16:42:08 2022 +0100 rcu/nocb: Initialize nocb kthreads only for boot CPU prior SMP initialization The rcu_spawn_gp_kthread() function is called as an early initcall, which means that SMP initialization hasn't happened yet and only the boot CPU is online. Therefore, create only the NOCB kthreads related to the boot CPU. Signed-off-by: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Signed-off-by: Paul E. McKenney commit 3352911fa9b47a90165e5c6fed440048c55146d1 Author: Frederic Weisbecker Date: Wed Feb 16 16:42:07 2022 +0100 rcu: Initialize boost kthread only for boot node prior SMP initialization The rcu_spawn_gp_kthread() function is called as an early initcall, which means that SMP initialization hasn't happened yet and only the boot CPU is online. Therefore, create only the boost kthread for the leaf node of the boot CPU. Signed-off-by: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Signed-off-by: Paul E. McKenney commit 2eed973adc6e749439730e53e6220b122398d319 Author: Frederic Weisbecker Date: Wed Feb 16 16:42:06 2022 +0100 rcu: Assume rcu_init() is called before smp The rcu_init() function is called way before SMP is initialized and therefore only the boot CPU should be online at this stage. Simplify the boot per-cpu initialization accordingly. Signed-off-by: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Signed-off-by: Paul E. McKenney commit 8d2aaa9b7c290e766a41f29c71ec72192851d538 Author: Frederic Weisbecker Date: Mon Feb 14 14:23:39 2022 +0100 rcu/nocb: Move rcu_nocb_is_setup to rcu_state This commit moves the RCU nocb initialization witness within rcu_state to consolidate RCU's global state. Reported-by: Paul E. McKenney Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit beb84099f1cf51e005e5df77d05b1644e490409e Author: Frederic Weisbecker Date: Wed Feb 16 16:42:04 2022 +0100 rcu: Remove rcu_is_nocb_cpu() The rcu_is_nocb_cpu() function is no longer used, so this commmit removes it. Reported-by: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Joel Fernandes Cc: Boqun Feng Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 9f2e91d94c91558e3764fe4e01c5e6281a90f239 Author: Paul E. McKenney Date: Thu Jan 27 20:32:05 2022 -0800 srcu: Add contention-triggered addition of srcu_node tree This commit instruments the acquisitions of the srcu_struct structure's ->lock, enabling the initiation of a transition from SRCU_SIZE_SMALL to SRCU_SIZE_BIG when sufficient contention is experienced. The instrumentation counts the number of trylock failures within the confines of a single jiffy. If that number exceeds the value specified by the srcutree.small_contention_lim kernel boot parameter (which defaults to 100), and if the value specified by the srcutree.convert_to_big kernel boot parameter has the 0x10 bit set (defaults to 0), then a transition will be automatically initiated. By default, there will never be any transitions, so that none of the srcu_struct structures ever gains an srcu_node array. The useful values for srcutree.convert_to_big are: 0x00: Never convert. 0x01: Always convert at init_srcu_struct() time. 0x02: Convert when rcutorture prints its first round of statistics. 0x03: Decide conversion approach at boot given system size. 0x10: Convert if contention is encountered. 0x12: Convert if contention is encountered or when rcutorture prints its first round of statistics, whichever comes first. The value 0x11 acts the same as 0x01 because the conversion happens before there is any chance of contention. [ paulmck: Apply "static" feedback from kernel test robot. ] Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 99659f64b14e55cfa48980f5396f83820bafd028 Author: Paul E. McKenney Date: Thu Jan 27 14:56:39 2022 -0800 srcu: Create concurrency-safe helper for initiating size transition Once there are contention-initiated size transitions, it will be possible for rcutorture to initiate a transition at the same time as a contention-initiated transition. This commit therefore creates a concurrency-safe helper function named srcu_transition_to_big() to safely initiate size transitions. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit ee5e2448bceb9400aa27207f0c0220f9dedd85eb Author: Paul E. McKenney Date: Thu Jan 27 13:47:42 2022 -0800 srcu: Explain srcu_funnel_gp_start() call to list_add() is safe This commit adds a comment explaining why an unprotected call to list_add() from srcu_funnel_gp_start() can be safe. TL;DR: It is only called during very early boot when we don't have no steeking concurrency! Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 46470cf85d2b61abd37c6f66c4dacc1bc510d10f Author: Paul E. McKenney Date: Thu Jan 27 13:20:49 2022 -0800 srcu: Prevent cleanup_srcu_struct() from freeing non-dynamic ->sda When an srcu_struct structure is created (but not in a kernel module) by DEFINE_SRCU() and friends, the per-CPU srcu_data structure is statically allocated. In all other cases, that structure is obtained from alloc_percpu(), in which case cleanup_srcu_struct() must invoke free_percpu() on the resulting ->sda pointer in the srcu_struct pointer. Which it does. Except that it also invokes free_percpu() on the ->sda pointer referencing the statically allocated per-CPU srcu_data structures. Which free_percpu() is surprisingly OK with. This commit nevertheless stops cleanup_srcu_struct() from freeing statically allocated per-CPU srcu_data structures. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 4a230f8046454df18139ed1232f1a1e8a6dd36c5 Author: Paul E. McKenney Date: Thu Jan 27 11:43:11 2022 -0800 srcu: Avoid NULL dereference in srcu_torture_stats_print() You really shouldn't invoke srcu_torture_stats_print() after invoking cleanup_srcu_struct(), but there is really no reason to get a compiler-obfuscated per-CPU-variable NULL pointer dereference as the diagnostic. This commit therefore checks for NULL ->sda and makes a more polite console-message complaint in that case. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit db8f1471c61336477e2bf74dcb00e67d650e6dea Author: Alexander Aring Date: Wed Jan 26 10:03:54 2022 -0500 srcu: Use export for srcu_struct defined by DEFINE_STATIC_SRCU() If an srcu_struct structure defined by tree SRCU's DEFINE_STATIC_SRCU() is used by a module, sparse will give the following diagnostic: sparse: symbol '__srcu_struct_nodes_srcu' was not declared. Should it be static? The problem is that a within-module DEFINE_STATIC_SRCU() must define a non-static srcu_struct because it is exported by referencing it in a special '__section("___srcu_struct_ptrs")'. This reference is needed so that module load and unloading can invoke init_srcu_struct() and cleanup_srcu_struct(), respectively. Unfortunately, sparse is unaware of '__section("___srcu_struct_ptrs")', resulting in the above false-positive diagnostic. To avoid this false positive, this commit therefore creates a prototype of the srcu_struct with an "extern" keyword. Signed-off-by: Alexander Aring Signed-off-by: Paul E. McKenney commit c69a00a12e26cf4faffdcdb340cb2d059b61d57e Author: Paul E. McKenney Date: Tue Jan 25 15:41:10 2022 -0800 srcu: Add boot-time control over srcu_node array allocation This commit adds an srcu_tree.convert_to_big kernel parameter that either refuses to convert at all (0), converts immediately at init_srcu_struct() time (1), or lets rcutorture convert it (2). An addition contention-based dynamic conversion choice will be added, along with documentation. [ paulmck: Apply callback-scanning feedback from Neeraj Upadhyay. ] Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 0f8619929c572609f7cdfa366d0424c2c2552e60 Author: Alan Maguire Date: Mon Apr 11 16:21:36 2022 +0100 libbpf: Usdt aarch64 arg parsing support Parsing of USDT arguments is architecture-specific. On aarch64 it is relatively easy since registers used are x[0-31] and sp. Format is slightly different compared to x86_64. Possible forms are: - "size@[reg[,offset]]" for dereferences, e.g. "-8@[sp,76]" and "-4@[sp]"; - "size@reg" for register values, e.g. "-4@x0"; - "size@value" for raw values, e.g. "-8@1". Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1649690496-1902-2-git-send-email-alan.maguire@oracle.com commit 0b56f953908a751716f2c8f907942674b60d8db5 Author: Neeraj Upadhyay Date: Tue Feb 22 11:39:01 2022 +0530 srcu: Ensure snp nodes tree is fully initialized before traversal For configurations where snp node tree is not initialized at init time (added in subsequent commits), srcu_funnel_gp_start() and srcu_funnel_exp_start() can potential traverse and observe the snp nodes' transient (uninitialized) states. This can potentially happen, when init_srcu_struct_nodes() initialization of sdp->mynode races with srcu_funnel_gp_start() and srcu_funnel_exp_start() Consider the case below where srcu_funnel_gp_start() observes sdp->mynode to be not NULL and uses an uninitialized sdp->grpmask P1 P2 init_srcu_struct_nodes() void srcu_funnel_gp_start(...) { for_each_possible_cpu(cpu) { ... sdp->mynode = &snp_first[...]; for (snp = sdp->mynode;...) struct srcu_node *snp_leaf = smp_load_acquire(&sdp->mynode) ... if (snp_leaf) { for (snp = snp_leaf; ...) ... if (snp == snp_leaf) snp->srcu_data_have_cbs[idx] |= sdp->grpmask; sdp->grpmask = 1 << (cpu - sdp->mynode->grplo); } } Similarly, init_srcu_struct_nodes() and srcu_funnel_exp_start() can race, where srcu_funnel_exp_start() could observe state of snp lock before spin_lock_init(). P1 P2 init_srcu_struct_nodes() void srcu_funnel_exp_start(...) { srcu_for_each_node_breadth_first(ssp, snp) { for (; ...) { spin_lock_...(snp, ) spin_lock_init(&ACCESS_PRIVATE(snp, lock)); ... } for_each_possible_cpu(cpu) { ... sdp->mynode = &snp_first[...]; To avoid these issues, ensure that snp node tree initialization is complete i.e. after SRCU_SIZE_WAIT_BARRIER srcu_size_state is reached, before traversing the tree. Given that srcu_funnel_gp_start() and srcu_funnel_exp_start() are called within SRCU read side critical sections, this check is safe, in the sense that all callbacks are enqueued on CPU0 srcu_cblist until SRCU_SIZE_WAIT_CALL is entered, and these read side critical sections (containing srcu_funnel_gp_start() and srcu_funnel_exp_start()) need to complete, before SRCU_SIZE_WAIT_CALL is reached. Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit cbdc98e93efa7bbf6f2fcd68c73df82c37b5fa65 Author: Paul E. McKenney Date: Wed Jan 26 17:03:06 2022 -0800 srcu: Use invalid initial value for srcu_node GP sequence numbers Currently, tree SRCU relies on the srcu_node structures being initialized at the same time that the srcu_struct itself is initialized, and thus use the initial grace-period sequence number as the initial value for the srcu_node structure's ->srcu_have_cbs[] and ->srcu_gp_seq_needed_exp fields. Although this has a high probability of also working when the srcu_node array is allocated and initialized at some random later time, it would be better to avoid leaving such things to chance. This commit therefore initializes these fields with 0x2, which is a recognizable invalid value. It then adds the required checks for this invalid value in order to avoid confusion on long-running kernels (especially those on 32-bit systems) that allocate and initialize srcu_node arrays late in life. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit aeb9b39b8f4aac1233302c53a1fd99a73fd2c262 Author: Paul E. McKenney Date: Wed Jan 26 16:01:26 2022 -0800 srcu: Compute snp_seq earlier in srcu_funnel_gp_start() Currently, srcu_funnel_gp_start() tests snp->srcu_have_cbs[idx] and then separately assigns it to the snp_seq local variable. This commit does the assignment earlier to simplify the code a bit. While in the area, this commit also takes advantage of the 100-character line limit to put the call to srcu_schedule_cbs_sdp() on a single line. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 3bedebcf63c2ad7396f1be138bbef91a402f33cd Author: Paul E. McKenney Date: Mon Jan 24 17:05:51 2022 -0800 srcu: Make rcutorture dump the SRCU size state This commit adds the numeric and string version of ->srcu_size_state to the Tree-SRCU-specific portion of the rcutorture output. [ paulmck: Apply feedback from kernel test robot and Dan Carpenter. ] [ quic_neeraju: Apply feedback from Jiapeng Chong. ] Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit e2f638365dd6283b7df1cb5e82f5b2746359f062 Author: Paul E. McKenney Date: Mon Jan 24 15:41:32 2022 -0800 srcu: Add size-state transitioning code This is just dead code at the moment, and will be used once the state-transition code is activated. Because srcu_barrier() must be aware of transition before call_srcu(), the state machine waits for an SRCU grace period before callbacks are queued to the non-CPU-0 queues. This requres that portions of srcu_barrier() be enclosed in an SRCU read-side critical section. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 2ec303113d978931ef368886c4c6bc854493e8bf Author: Paul E. McKenney Date: Fri Jan 21 16:13:52 2022 -0800 srcu: Dynamically allocate srcu_node array This commit shrinks the srcu_struct structure by converting its ->node field from a fixed-size compile-time array to a pointer to a dynamically allocated array. In kernels built with large values of NR_CPUS that boot on systems with smaller numbers of CPUs, this can save significant memory. [ paulmck: Apply kernel test robot feedback. ] Reported-by: A cast of thousands Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 994f706872e6ce080506bd795ecf783d5b617de6 Author: Paul E. McKenney Date: Mon Jan 24 09:46:57 2022 -0800 srcu: Make Tree SRCU able to operate without snp_node array This commit makes Tree SRCU able to operate without an snp_node array, that is, when the srcu_data structures' ->mynode pointers are NULL. This can result in high contention on the srcu_struct structure's ->lock, but only when there are lots of call_srcu(), synchronize_srcu(), and synchronize_srcu_expedited() calls. Note that when there is no snp_node array, all SRCU callbacks use CPU 0's callback queue. This is optimal in the common case of low update-side load because it removes the need to search each CPU for the single callback that made the grace period happen. Co-developed-by: Neeraj Upadhyay Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 7b9e9b5856e188c1b3ff51185f3600ee79b4ab41 Author: Paul E. McKenney Date: Thu Jan 20 13:39:33 2022 -0800 srcu: Make srcu_funnel_gp_start() cache ->mynode in snp_leaf Currently, the srcu_funnel_gp_start() walks its local variable snp up the tree and reloads sdp->mynode whenever it is necessary to check whether it is still at the leaf srcu_node level. This works, but is a bit more obtuse than absolutely necessary. In addition, upcoming commits will dynamically size srcu_struct structures, in which case sdp->mynode will no longer necessarily be a constant, and this commit helps prepare for that dynamic sizing. Signed-off-by: Paul E. McKenney commit 95ebe80d99de3cb849c522a1f768e5e8befa0b7c Author: Paul E. McKenney Date: Thu Jan 20 13:16:18 2022 -0800 srcu: Fix s/is/if/ typo in srcu_node comment This commit fixed a typo in the srcu_node structure's ->srcu_have_cbs comment. While in the area, redo a couple of comments to take advantage of 100-character line lengths. Signed-off-by: Paul E. McKenney commit 8ed00760203d8018bee042fbfe8e076579be2c2b Author: Paul E. McKenney Date: Wed Jan 12 09:52:44 2022 -0800 srcu: Tighten cleanup_srcu_struct() GP checks Currently, cleanup_srcu_struct() checks for a grace period in progress, but it does not check for a grace period that has not yet started but which might start at any time. Such a situation could result in a use-after-free bug, so this commit adds a check for a grace period that is needed but not yet started to cleanup_srcu_struct(). Signed-off-by: Paul E. McKenney commit 52136021f69aef59190078c0ca304680b32f2533 Author: Xinlei Lee Date: Mon Apr 11 10:53:03 2022 +0800 dt-bindings: display: mediatek: dpi: Add compatible for MediaTek MT8186 Add dt-binding documentation of dpi for MediaTek MT8186 SoC. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/1649645584-13186-2-git-send-email-xinlei.lee@mediatek.com/ Signed-off-by: Xinlei Lee Reviewed-by: Rex-BC Chen Signed-off-by: Chun-Kuang Hu commit 8a26ea19d4dc7905305c3ccc2dd2fc69ef90c002 Author: Rex-BC Chen Date: Wed Apr 6 11:00:08 2022 +0800 dt-bindings: display: mediatek: add MT8186 SoC binding Add MT8186 SoC binding to AAL, CCORR, COLOR, DITHER, GAMMA, MUTEX, OVL, POSTMASK and RDMA. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220406030009.2357-4-rex-bc.chen@mediatek.com/ Signed-off-by: Rex-BC Chen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 95862bd9781edc5b3272e03320609efb3aef2807 Author: Rex-BC Chen Date: Wed Apr 6 11:00:07 2022 +0800 dt-bindings: display: mediatek: change to use enum for mutex All single entry cases in mutex can be merged as a single enum. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220406030009.2357-3-rex-bc.chen@mediatek.com/ Signed-off-by: Rex-BC Chen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 516ca27b6033a07d7654e7838520f2c00b1ec606 Author: Stephen Boyd Date: Fri Mar 25 14:16:40 2022 -0700 arm64: dts: qcom: sc7180-trogdor: Simplify SAR sensor enabling The SAR node, ap_sar_sensor, needs to be enabled in addition to the i2c bus it resides on. Let's simplify this by leaving the sensor node enabled by default while leaving the i2c bus disabled by default. On boards that use the sensor, we already enable the i2c bus so we can simply remove the extra bit that enables the sar sensor node. This saves some lines but is otherwise a non-functional change. Cc: Douglas Anderson Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220325211640.54228-1-swboyd@chromium.org commit dbcbeed94f3b6f7f24349a7f335cc603a682e7a7 Author: Stephen Boyd Date: Wed Mar 16 18:06:39 2022 -0700 arm64: dts: qcom: sc7280-herobrine: Drop outputs on fpmcu pins Having these pins with outputs is good on a fresh boot because it puts the boot and reset pins in a known "good" state. Unfortunately, that conflicts with the fingerprint firmware flashing code. The firmware flashing process binds and unbinds the cros-ec and spidev drivers and that reapplies the pin output values after the flashing code has overridden the gpio values. This causes a problem because we try to put the device into bootloader mode, bind the spidev driver and that inadvertently puts it right back into normal boot mode, breaking the flashing process. Fix this by removing the outputs. We'll introduce a binding for fingerprint cros-ec specifically to set the gpios properly via gpio APIs during cros-ec driver probe instead. Cc: Douglas Anderson Cc: Matthias Kaehlcke Cc: Alexandru M Stan Fixes: 116f7cc43d28 ("arm64: dts: qcom: sc7280: Add herobrine-r1") Signed-off-by: Stephen Boyd Reviewed-by: Douglas Anderson Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220317010640.2498502-2-swboyd@chromium.org commit 2229276c5283264b8c2241c1ed972bbb136cab22 Author: Darrick J. Wong Date: Tue Apr 12 06:49:42 2022 +1000 xfs: use a separate frextents counter for rt extent reservations As mentioned in the previous commit, the kernel misuses sb_frextents in the incore mount to reflect both incore reservations made by running transactions as well as the actual count of free rt extents on disk. This results in the superblock being written to the log with an underestimate of the number of rt extents that are marked free in the rtbitmap. Teaching XFS to recompute frextents after log recovery avoids operational problems in the current mount, but it doesn't solve the problem of us writing undercounted frextents which are then recovered by an older kernel that doesn't have that fix. Create an incore percpu counter to mirror the ondisk frextents. This new counter will track transaction reservations and the only time we will touch the incore super counter (i.e the one that gets logged) is when those transactions commit updates to the rt bitmap. This is in contrast to the lazysbcount counters (e.g. fdblocks), where we know that log recovery will always fix any incorrect counter that we log. As a bonus, we only take m_sb_lock at transaction commit time. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 5a605fd6cb1da0ec9cb6e54c06bcf58f706d2f83 Author: Darrick J. Wong Date: Tue Apr 12 06:49:42 2022 +1000 xfs: recalculate free rt extents after log recovery I've been observing periodic corruption reports from xfs_scrub involving the free rt extent counter (frextents) while running xfs/141. That test uses an error injection knob to induce a torn write to the log, and an arbitrary number of recovery mounts, frextents will count fewer free rt extents than can be found the rtbitmap. The root cause of the problem is a combination of the misuse of sb_frextents in the incore mount to reflect both incore reservations made by running transactions as well as the actual count of free rt extents on disk. The following sequence can reproduce the undercount: Thread 1 Thread 2 xfs_trans_alloc(rtextents=3) xfs_mod_frextents(-3) xfs_attr_set() xfs_bmap_attr_addfork() xfs_add_attr2() xfs_log_sb() xfs_sb_to_disk() xfs_trans_commit() Note that thread 1 subtracts 3 from sb_frextents even though it never commits to using that space. Thread 2 writes the undercounted value to the ondisk superblock and logs it to the xattr transaction, which is then flushed to disk. At next mount, log recovery will find the logged superblock and write that back into the filesystem. At the end of log recovery, we reread the superblock and install the recovered undercounted frextents value into the incore superblock. From that point on, we've effectively leaked thread 1's transaction reservation. The correct fix for this is to separate the incore reservation from the ondisk usage, but that's a matter for the next patch. Because the kernel has been logging superblocks with undercounted frextents for a very long time and we don't demand that sysadmins run xfs_repair after a crash, fix the undercount by recomputing frextents after log recovery. Gating this on log recovery is a reasonable balance (I think) between correcting the problem and slowing down every mount attempt. Note that xfs_repair will fix undercounted frextents. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit f34061f554feba68e12b7a73008c350d2a9afd0c Author: Darrick J. Wong Date: Tue Apr 12 06:49:41 2022 +1000 xfs: pass explicit mount pointer to rtalloc query functions Pass an explicit xfs_mount pointer to the rtalloc query functions so that they can support transactionless queries. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit f3bf67c6c6fe863b7946ac0c2214a147dc50523d Author: Matthew Wilcox (Oracle) Date: Tue Apr 12 06:49:40 2022 +1000 xfs: Use generic_file_open() Remove the open-coded check of O_LARGEFILE. This changes the errno to be the same as other filesystems; it was changed generically in 2.6.24 but that fix skipped XFS. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit 9464b00e6a118b2712092d453b07ec835deb327f Author: Douglas Anderson Date: Tue Mar 8 12:52:35 2022 -0800 arm64: dts: qcom: sc7280: Delete herobrine-r0 As talked about in commit 61a6262f95e0 ("arm64: dts: qcom: sc7280: Move herobrine-r0 to its own dts"), herobrine evolved pretty significantly after -r0 and newer revisions are pretty different. Nobody needs the old boards to keep working, so let's delete to avoid the maintenance burden. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308125044.1.I3e4a1a9c102d194698b68661e69efebafec8af1c@changeid commit 0d40497d054194768b3ddbf3a676d481b38b96eb Author: Douglas Anderson Date: Thu Mar 10 13:04:34 2022 -0800 arm64: dts: qcom: sc7280-herobrine: Fix PCIe regulator glitch at bootup While scoping signals, we found that the PCIe signals weren't compliant at bootup. Specifically, the bootloader was setting up PCIe and leaving it configured, then jumping to the kernel. The kernel was turning off the regulator while leaving the PCIe clock running, which was a violation. In the regulator bindings (and the Linux kernel driver that uses them), there's currently no way to specify that a GPIO-controlled regulator should keep its state at bootup. You've got to pick either "on" or "off". Let's switch it so that the PCIe regulator defaults to "on" instead of "off". This should be a much safer way to go and avoids the timing violation. The regulator will still be turned off later if there are no users. Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220310130429.1.Id41fda1d7f5d9230bc45c1b85b06b0fb0ddd29af@changeid commit 6675ac9d0046201af945c7abfe5dd794df22230b Author: Matthias Kaehlcke Date: Wed Mar 16 17:28:20 2022 -0700 arm64: dts: qcom: sc7280: Add CRD rev5 Add support for Qualcomm's SC7280 CRD rev5 (aka CRD 3.0/3.1). Signed-off-by: Matthias Kaehlcke Reviewed-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220316172814.v1.4.I37bdb77fdd06fb4143056366d7ec35b929528002@changeid commit 533ca1c3c1996ea49a1b31a83ba978f2f96fea9b Author: Matthias Kaehlcke Date: Wed Mar 16 17:28:19 2022 -0700 arm64: dts: qcom: sc7280: herobrine: disable some regulators by default Not all herobrine boards have a world facing camera or a fingerprint sensor, disable the regulators that feed these devices by default and only enable them for the boards that use them. Similarly the audio configuration can vary between boards, not all boards have the regulator pp3300_codec, disable it by default. Signed-off-by: Matthias Kaehlcke Reviewed-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220316172814.v1.3.Iad21bd53f3ac14956b8dbbf3825fc7ab29abdf97@changeid commit f226c660533416c308fcde62d1b785527528974d Author: Matthias Kaehlcke Date: Wed Mar 16 17:28:18 2022 -0700 arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin' Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries are kept to make sure the board keeps booting with older bootloader versions. The compatible string 'google,piglin' (without revision information) is still used by the IDP2 board, which is not expected to evolve further. Signed-off-by: Matthias Kaehlcke Reviewed-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220316172814.v1.2.Ib0fbb7e5218201c81a2d064ff13c9bc1b0863212@changeid commit 737f9ea6cee76fb0004c116479a9db34a67fb814 Author: Matthias Kaehlcke Date: Wed Mar 16 17:28:17 2022 -0700 arm64: dts: qcom: sc7280: Rename crd to crd-r3 There are multiple revisions of CRD boards. The current sc7280-crd.dts describes revision 3 and 4 (aka CRD 1.0 and 2.0). Support for a newer version will be added by another patch. Add the revision number to distinguish it from the versionn. Also add the revision numbers to the compatible string. Signed-off-by: Matthias Kaehlcke Reviewed-by: Rajendra Nayak Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220316172814.v1.1.I2deda8f2cd6adfbb525a97d8fee008a8477b7b0e@changeid commit 33495eb77ee4ed1850aa70801afd2a24e8d738bd Author: Ivy Jian Date: Tue Mar 22 09:25:26 2022 +0800 arm64: dts: qcom: switch panel compatible to "edp-panel" for limozeen some panel can't light up with new board with ps8640, switch compatible panel define to make it workable. Signed-off-by: Pan Sheng-Liang Signed-off-by: Ivy Jian Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220322092524.1.Ied05fc4b996737e3481861c6ab130a706f288412@changeid commit 476dce6e50bb21ec0752d54b6754306e30b3f868 Author: Rakesh Pillai Date: Mon Mar 28 12:37:01 2022 +0530 arm64: dts: qcom: sc7280: Add WPSS remoteproc node Add the WPSS remoteproc node in dts for PIL loading. Reviewed-by: Stephen Boyd Signed-off-by: Rakesh Pillai Signed-off-by: Manikanta Pubbisetty Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220328070701.28551-1-quic_mpubbise@quicinc.com commit ee2a621160156000da338280c0b8e45bcfb5db8f Author: Matthias Kaehlcke Date: Tue Mar 29 10:59:34 2022 -0700 arm64: dts: qcom: sc7280: Add device tree for herobrine villager Add a basic device tree for the herobrine villager board. Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220329105854.v3.2.Iebdb5af0db7d3d6364cb229a27cd7c668f1063ae@changeid commit 70137d1d8a63d5bbb1ad8bf8181299dbc3aab3e7 Author: Matthias Kaehlcke Date: Tue Mar 29 10:59:33 2022 -0700 arm64: dts: qcom: sc7280: Add SAR sensors for herobrine Add nodes for the two SX9324 SAR proximity sensors. Not all herobrine boards have these sensors, so leave them disabled by default. Signed-off-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220329105854.v3.1.Icedb2e3cd5e21f3a4ec535ddf756fa44d053b6ed@changeid commit f31c834d3976652753f39eb319170c8c4ac3ce55 Author: Stephen Boyd Date: Thu Mar 24 15:33:31 2022 -0700 arm64: dts: qcom: sc7280: Fix sar1_irq_odl node name This node should be named sar1-irq-odl, not sar0-irq-odl. Otherwise we'll overwrite the settings for sar0 with what is intended for sar1, leading to probe failures for sar1 that are quite confusing. Fixes: 116f7cc43d28 ("arm64: dts: qcom: sc7280: Add herobrine-r1") Cc: Douglas Anderson Cc: Matthias Kaehlcke Signed-off-by: Stephen Boyd Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220324223331.876199-1-swboyd@chromium.org commit 41204da4c16071be9090940b18f566832d46becc Author: Carsten Haitzler Date: Wed Mar 9 12:28:57 2022 +0000 perf test: Shell - Limit to only run executable scripts in tests 'perf test''s shell runner will just run everything in the tests directory (as long as it's not another directory or does not begin with a dot), but sometimes you find files in there that are not shell scripts - perf.data output for example if you do some testing and then the next time you run perf test it tries to run these. Check the files are executable so they are actually intended to be test scripts and not just some "random junk" files there. Signed-off-by: Carsten Haitzler Reviewed-by: Leo Yan Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20220309122859.31487-1-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ae24e9b53d5ead0c8cc758c0b32e716f0ba91138 Author: Eelco Chaudron Date: Tue Feb 22 10:11:10 2022 -0500 perf scripting python: Expose symbol offset and source information This change adds the symbol offset to the data exported for each call-chain entry. This can not be calculated from the script and only the ip value, and no related mmap information. In addition, also export the source file and line information, if available, to avoid an external lookup if this information is needed. Signed-off-by: Eelco Chaudron Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/164554263724.752731.14651017093796049736.stgit@wsfd-netdev64.ntdv.lab.eng.bos.redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 335f70faa26330304eee235d743881162ddf667e Author: Eric Lin Date: Wed Apr 6 22:26:06 2022 +0800 perf jitdump: Add riscv64 support This patch enables perf jitdump for riscv64 and was tested with V8 on qemu rv64. Qemu rv64: $ perf record -e cpu-clock -c 1000 -g -k mono ./d8_rv64 --perf-prof --no-write-protect-code-memory test.js $ perf inject -j -i perf.data -o perf.data.jitted $ perf report -i perf.data.jitted Output: To display the perf.data header info, please use --header/--header-only options. Total Lost Samples: 0 Samples: 87K of event 'cpu-clock' Event count (approx.): 87974000 Children Self Command Shared Object Symbol .... 0.28% 0.06% d8_rv64 d8_rv64 [.] _ZN2v88internal6WasmJs7InstallEPNS0_7IsolateEb 0.28% 0.00% d8_rv64 d8_rv64 [.] _ZN2v88internal10ParserBaseINS0_6ParserEE22ParseLogicalExpressionEv 0.28% 0.03% d8_rv64 jitted-112-76.so [.] Builtin:InterpreterEntryTrampoline 0.12% 0.00% d8_rv64 d8_rv64 [.] _ZN2v88internal19ContextDeserializer11DeserializeEPNS0_7IsolateENS0_6HandleINS0_13JSGlobalProxyEEENS_33DeserializeInternalFieldsCallbackE 0.12% 0.01% d8_rv64 jitted-112-651.so [.] Builtin:CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit .... Signed-off-by: Eric Lin Cc: Albert Ou Cc: Alexander Shishkin Cc: Ilya Leoshkevich Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: greentime.hu@sifive.com Cc: linux-riscv@lists.infradead.org Link: http://lore.kernel.org/lkml/20220406142606.18464-2-eric.lin@sifive.com Signed-off-by: Arnaldo Carvalho de Melo commit aa1b02e674fe69acd04624f5bcdef94928bc8695 Author: Yuntao Wang Date: Sun Apr 10 14:00:19 2022 +0800 bpf: Remove redundant assignment to meta.seq in __task_seq_show() The seq argument is assigned to meta.seq twice, the second one is redundant, remove it. This patch also removes a redundant space in bpf_iter_link_attach(). Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220410060020.307283-1-ytcoode@gmail.com commit 1af7c26c59ebcf241e865dd16dcc251e61472a37 Author: Shlomo Pongratz Date: Sun Apr 10 13:52:13 2022 +0300 PCI/P2PDMA: Whitelist Intel Skylake-E Root Ports at any devfn In 7b94b53db34f ("PCI/P2PDMA: Add Intel Sky Lake-E Root Ports B, C, D to the whitelist"), Andrew Maier added Skylake-E 2031, 2032, and 2033 Root Ports to the pci_p2pdma_whitelist[], so we assume P2PDMA between devices below these ports works. Previously we only checked the whitelist for a device at devfn 00.0 on the root bus, which is often a "host bridge". But these Skylake Root Ports may be at any devfn and there may be no "host bridge" device. Generalize pci_host_bridge_dev() so we check the first device on the root bus, whether it is devfn 00.0 or a PCIe Root Port, against the whitelist. [bhelgaas: commit log, comment] Link: https://lore.kernel.org/r/20220410105213.690-2-shlomop@pliops.com Tested-by: Maor Gottlieb Signed-off-by: Shlomo Pongratz Signed-off-by: Bjorn Helgaas Cc: Andrew Maier commit 8b1ea69a63eb62f97cef63e6d816b64ed84e8760 Author: Miaoqian Lin Date: Mon Apr 11 11:10:33 2022 +0000 spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout wait_for_completion_timeout() returns unsigned long not int. It returns 0 if timed out, and positive if completed. The check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case. Fixes: 5720ec0a6d26 ("spi: spi-ti-qspi: Add DMA support for QSPI mmap read") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220411111034.24447-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 31c90dd56ae2945ce46ffa9728d1e1502f5a0c2e Author: Richard Fitzgerald Date: Mon Apr 11 17:59:29 2022 +0100 ASoC: cs35l45: Make exports namespaced Use the new EXPORT_SYMBOL_NS_GPL() for exports from the set of drivers for cs35l45. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220411165929.1302333-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit dc7680ca7ac6c32b8c18aff36bca728a2f83e2a0 Author: YueHaibing Date: Mon Apr 11 10:09:08 2022 +0800 ASoC: tegra186_asrc: mark runtime-pm functions as __maybe_unused sound/soc/tegra/tegra186_asrc.c:90:12: error: ‘tegra186_asrc_runtime_resume’ defined but not used [-Werror=unused-function] static int tegra186_asrc_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/tegra/tegra186_asrc.c:80:12: error: ‘tegra186_asrc_runtime_suspend’ defined but not used [-Werror=unused-function] static int tegra186_asrc_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mark these functions as __maybe_unused to avoid this kind of warning. Fixes: a2df8c2d5b36 ("ASoC: tegra: Add Tegra186 based ASRC driver") Signed-off-by: YueHaibing Reviewed-by: Sameer Pujar Link: https://lore.kernel.org/r/20220411020908.580-1-yuehaibing@huawei.com Signed-off-by: Mark Brown commit b1630fcbfde6c071d964b1c475871db0ebc96048 Author: Vijendar Mukunda Date: Mon Apr 11 19:11:15 2022 +0530 ASoC: amd: yc: add new YC platform varaint support Update PCI revision id check for the new YC platform varaint. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20220411134119.1767646-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit cbd5ce7f428b4caf3f1e3b07cd068cc073eab909 Author: Stephen Kitt Date: Tue Apr 5 18:58:36 2022 +0200 ASoC: uda1380: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-15-steve@sk2.org Signed-off-by: Mark Brown commit 2d4668c6b16fd5b476e84a7fcc54cd38f326e0eb Author: Stephen Kitt Date: Tue Apr 5 18:58:35 2022 +0200 ASoC: ts3a227e: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-14-steve@sk2.org Signed-off-by: Mark Brown commit 9ba0daa6efa30b1837560a5ce5f41d31093adb42 Author: Stephen Kitt Date: Tue Apr 5 18:58:34 2022 +0200 ASoC: tlv320*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-13-steve@sk2.org Signed-off-by: Mark Brown commit 33108917c8a6b597782cff0bd31bea3c7737df3b Author: Stephen Kitt Date: Tue Apr 5 18:58:33 2022 +0200 ASoC: tda7419: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-12-steve@sk2.org Signed-off-by: Mark Brown commit ad11678fd0c39a766318f2dd0385008dd111b5fc Author: Stephen Kitt Date: Tue Apr 5 18:58:32 2022 +0200 ASoC: tas*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-11-steve@sk2.org Signed-off-by: Mark Brown commit 6f51c15877ae7a2b57bd4ec90eeb146dbac36fa5 Author: Stephen Kitt Date: Tue Apr 5 18:58:31 2022 +0200 ASoC: sta*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-10-steve@sk2.org Signed-off-by: Mark Brown commit 7f7d7214bb5208454aa4ce13780de326402e89c3 Author: Stephen Kitt Date: Tue Apr 5 18:58:30 2022 +0200 ASoC: pcm*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-9-steve@sk2.org Signed-off-by: Mark Brown commit 7325ed4d1250ddb838dc6f96d1f20492a3d52b20 Author: Stephen Kitt Date: Tue Apr 5 18:58:29 2022 +0200 ASoC: nau8*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-8-steve@sk2.org Signed-off-by: Mark Brown commit f7537e3a99fd8f9cd8702bfa52dcfd56d5ac2db7 Author: Stephen Kitt Date: Tue Apr 5 18:58:28 2022 +0200 ASoC: ml26124: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-7-steve@sk2.org Signed-off-by: Mark Brown commit fead49e33b3df85326cf00eb27a461a8d2ac32a1 Author: Stephen Kitt Date: Tue Apr 5 18:58:27 2022 +0200 ASoC: max9*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-6-steve@sk2.org Signed-off-by: Mark Brown commit 182f3ebd5d34437f8bf53fe4d37ccc817b003648 Author: Stephen Kitt Date: Tue Apr 5 18:58:26 2022 +0200 ASoC: lm4857: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-5-steve@sk2.org Signed-off-by: Mark Brown commit a327bdc6c69521bc9ad9ed931a01e505956d4947 Author: Stephen Kitt Date: Tue Apr 5 18:58:25 2022 +0200 ASoC: es83*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-4-steve@sk2.org Signed-off-by: Mark Brown commit e86e7de1c52afefec61b5cfe254d888117a6d5ab Author: Stephen Kitt Date: Tue Apr 5 18:58:24 2022 +0200 ASoC: cx2072x: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-3-steve@sk2.org Signed-off-by: Mark Brown commit a1111048ec4629ddc273d8821b2299ca23480153 Author: Stephen Kitt Date: Tue Apr 5 18:58:23 2022 +0200 ASoC: ak4*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405165836.2165310-2-steve@sk2.org Signed-off-by: Mark Brown commit 5426f506b58424f8ab2cd741bacf4b18b5fe578e Author: Mario Limonciello Date: Mon Apr 11 08:45:32 2022 -0500 ASoC: amd: Add support for enabling DMIC on acp6x via _DSD Currently the acp6x machine driver requires a hardcoded list of systems that physically have DMIC connected. To avoid having to continually add to an evergrowing list of systems add support for a _DSD that can advertise this. OEMs can add this _DSD to their BIOS under the ACP device to automatically add the device to this driver without requiring any driver modifications. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220411134532.13538-3-mario.limonciello@amd.com Signed-off-by: Mark Brown commit e521f087780d07731e8c950f2f34d08358c86bc9 Author: Mario Limonciello Date: Mon Apr 11 08:45:31 2022 -0500 ASoC: amd: Add driver data to acp6x machine driver Currently all of the quirked systems use the same card and so the DMI quirk list doesn't contain driver data. Add driver data to these quirks and then check the data was present or not. This will allow potentially setting quirks for systems with faulty firmware that claims to have a DMIC but doesn't really. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220411134532.13538-2-mario.limonciello@amd.com Signed-off-by: Mark Brown commit e760f102c92c16307abebffd24a31bdb3ccd78ac Author: Peter Ujfalusi Date: Tue Apr 5 10:27:08 2022 -0700 ASoC: SOF: ipc: Move the ipc_set_get_comp_data() local to ipc3-control The snd_sof_ipc_set_get_comp_data() only used for kcontrol data update and it is an IPC3 message parsing function. Move it out from the generic ipc.c to ipc3-control.c and rename it to better describe it's function. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 50d4d8cf544dfbb9668dce87a21580fedb6e827f Author: Peter Ujfalusi Date: Tue Apr 5 10:27:07 2022 -0700 ASoC: SOF: sof-audio: Use the widget_kcontrol_setup ops for kcontrol set up Remove the local implementation and switch to the IPC neutral ops to set up the kcontrols associated with the swidget. The set up call uses snd_sof_ipc_set_get_comp_data() which is largely an IPC3 parsing function. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit e394ffb82f9c24fd6f7f4d896cb4ef32771dae7a Author: Peter Ujfalusi Date: Tue Apr 5 10:27:06 2022 -0700 ASoC: SOF: Add widget_kcontrol_setup control ops for IPC3 Define and set the widget_kcontrol_setup control IPC ops for IPC3. The widget_kcontrol_setup callback can be used to set up all kcontrols associated with the swidget. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 2f1f5a438899a9d2933ef004a1f0f2c962b29fb4 Author: Peter Ujfalusi Date: Tue Apr 5 10:27:05 2022 -0700 ASoC: SOF: ipc: Switch over to use the rx_msg ops Use the new ops for handling message reception. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 85d0f881471531ffb081711b13df32b1f6f1f637 Author: Peter Ujfalusi Date: Tue Apr 5 10:27:04 2022 -0700 ASoC: SOF: ipc: Switch over to use the tx_msg and set_get_data ops Use the new ops for sending messages and to handle large component data set get operation. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 045bc49bc9572f883db1a0740cb36bf6eeb206db Author: Peter Ujfalusi Date: Tue Apr 5 10:27:03 2022 -0700 ASoC: SOF: ipc: Use the get_reply ops in snd_sof_ipc_get_reply() Use the get_reply ops to allow IPC dependent handling of the reply message. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit defad9d2e2703b040c3a001978c09c75970357f0 Author: Peter Ujfalusi Date: Tue Apr 5 10:27:02 2022 -0700 ASoC: SOF: ipc: Add check for mandatory IPC message handling ops Make sure that the mandatory IPC message handling ops are provided by the IPC implementation. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 785b3fbe61c6c1c413b696e335e9f288aaec4364 Author: Peter Ujfalusi Date: Tue Apr 5 10:27:01 2022 -0700 ASoC: SOF: ipc: Separate the ops checks by functions/topics Separate the mandatory ops checks by topics (pcm and topology for now) to be able to provide intuitive feedback on the possible missing ops and to make it easier to add new mandatory ops checks in the future. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 74ad8ed6512186134527fc82440f62007a98ff48 Author: Peter Ujfalusi Date: Tue Apr 5 10:27:00 2022 -0700 ASoC: SOF: ipc3: Implement rx_msg IPC ops Add the implementation for the rx_msg callback to handle message reception for IPC3. The implementation is equivalent to the currently used code in ipc.c Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 783b5f1797595a9df4476dd66f7bf34915be246b Author: Peter Ujfalusi Date: Tue Apr 5 10:26:59 2022 -0700 ASoC: SOF: ipc3: Implement the get_reply IPC ops Add the implementation for the get_reply callback to copy the reply message from mailbox to msg->reply_data buffer. The implementation is equivalent to the currently used code in ipc.c Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit e974b8e190d30fdd0c5edc1447ee1425a30d15ea Author: Peter Ujfalusi Date: Tue Apr 5 10:26:58 2022 -0700 ASoC: SOF: ipc3: Implement the set_get_data IPC ops Add the implementation for the set_get_data callback for handling large data set and get. The set_get_data() in IPC3 can be used only for component messages. The function expects the caller to prepare the message behind the data pointer for sending/receiving data. The callback only implements the needed code to be able to split up a message if needed for transfer. The set_get_data ops is based on the existing snd_sof_ipc_set_get_comp_data() and sof_set_get_large_ctrl_data() but made it generic entry point. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit dbcf543cf91edc7f6fe833d51b58fe65265f2a72 Author: Peter Ujfalusi Date: Tue Apr 5 10:26:57 2022 -0700 ASoC: SOF: ipc3: Use sof_ipc3_tx_msg() internally for message sending Instead of using sof_ipc_tx_message() for sending message, use the sof_ipc3_tx_msg() directly within ipc3.c Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 0881918087ac7adfeed2652a03b4edb1131826ba Author: Peter Ujfalusi Date: Tue Apr 5 10:26:56 2022 -0700 ASoC: SOF: ipc3: Implement the tx_msg IPC ops Add the implementation for the IPC3 tx_msg callback for sending a single IPC message. The implementation is equivalent to the currently used code in ipc.c Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 25e77672c4e18fe76dbf2e21ab8c7c36d6a323cc Author: Peter Ujfalusi Date: Tue Apr 5 10:26:55 2022 -0700 ASoC: SOF: Add high level IPC IO callback definitions to ipc_ops Add tx_msg(), rx_msg(), set_get_data() and get_reply() ops, which can be used as a generic API for sending, receiving single messages and to write and read large data. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220405172708.122168-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit b4dcafe45e46f107b5f65a004d49e11e56fe4f87 Author: Peter Ujfalusi Date: Tue Apr 5 10:26:54 2022 -0700 ASoC: SOF: Add helper function to prepare and send an IPC message The new sof_ipc_send_msg() can be used by IPC dependent code to prepare the ipc->msg for a new message transmission and then call in to platform code to send the message. Higher level code should be handling the completion and reply. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 82c362f2c690009469e0f1c732269fb36765170e Author: Lucas De Marchi Date: Sat Apr 9 23:15:36 2022 -0700 drm/i915/dg2: Do not explode on phy calibration error When the PHY fails on calibration we were previously skipping the ddi initialization. However the driver is not really prepared for that, ultimately leading to a NULL pointer dereference: [ 75.748348] i915 0000:03:00.0: [drm:intel_modeset_init_nogem [i915]] SNPS PHY A failed to calibrate; output will not be used. ... [ 75.750336] i915 0000:03:00.0: [drm:intel_modeset_setup_hw_state [i915]] [CRTC:80:pipe A] hw state readout: enabled ... ( no DDI A/PHY A ) [ 75.753080] i915 0000:03:00.0: [drm:intel_modeset_setup_hw_state [i915]] [ENCODER:235:DDI B/PHY B] hw state readout: disabled, pipe A [ 75.753164] i915 0000:03:00.0: [drm:intel_modeset_setup_hw_state [i915]] [ENCODER:245:DDI C/PHY C] hw state readout: disabled, pipe A ... [ 75.754425] i915 0000:03:00.0: [drm] *ERROR* crtc 80: Can't calculate constants, dotclock = 0! [ 75.765558] i915 0000:03:00.0: drm_WARN_ON_ONCE(drm_drv_uses_atomic_modeset(dev)) [ 75.765569] WARNING: CPU: 5 PID: 1759 at drivers/gpu/drm/drm_vblank.c:728 drm_crtc_vblank_helper_get_vblank_timestamp_internal+0x347/0x360 ... [ 75.781230] BUG: kernel NULL pointer dereference, address: 000000000000007c [ 75.788198] #PF: supervisor read access in kernel mode [ 75.793347] #PF: error_code(0x0000) - not-present page [ 75.798480] PGD 0 P4D 0 [ 75.801019] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 75.805377] CPU: 5 PID: 1759 Comm: modprobe Tainted: G W 5.18.0-rc1-demarchi+ #199 [ 75.827613] RIP: 0010:icl_aux_power_well_disable+0x3b/0x200 [i915] [ 75.833890] Code: 83 ec 30 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 48 8b 06 0f b6 70 1c f6 40 20 04 8d 56 fa 0f 45 f2 e8 88 bd ff ff 48 89 ef <8b> 70 7c e8 ed 67 ff ff 48 89 ef 89 c6 e8 73 67 ff ff 84 c0 75 0a [ 75.852629] RSP: 0018:ffffc90003a7fb30 EFLAGS: 00010246 [ 75.857852] RAX: 0000000000000000 RBX: ffff8881145e8f10 RCX: 0000000000000000 [ 75.864978] RDX: ffff888115220840 RSI: 0000000000000000 RDI: ffff888115220000 [ 75.872106] RBP: ffff888115220000 R08: ffff88888effffe8 R09: 00000000fffdffff [ 75.879234] R10: ffff88888e200000 R11: ffff88888ed00000 R12: ffff8881145e8f10 [ 75.886363] R13: 0000000000000001 R14: ffff888115223240 R15: 0000000000000000 [ 75.893490] FS: 00007ff6e753a740(0000) GS:ffff88888f680000(0000) knlGS:0000000000000000 [ 75.901573] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 75.907313] CR2: 000000000000007c CR3: 00000001216a6001 CR4: 0000000000770ee0 [ 75.914446] PKRU: 55555554 [ 75.917153] Call Trace: [ 75.919603] [ 75.921709] intel_power_domains_sanitize_state+0x88/0xb0 [i915] [ 75.927814] intel_modeset_init_nogem+0x317/0xef0 [i915] [ 75.933205] i915_driver_probe+0x5f6/0xdf0 [i915] [ 75.937976] i915_pci_probe+0x51/0x1d0 [i915] We skip the initialization of PHY A, but later we try to find out what is the phy for that power well and dereference dig_port, which is NULL. Failing the PHY calibration could be left as a warning or error, like it was before commit b4eb76d82a0e ("drm/i915/dg2: Skip output init on PHY calibration failure"). However that often fails for outputs not being used, which would make the warning/error appear on systems that have no visible issues. Anyway, there is still a need to fix those failures, but that is left for later. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220410061537.4187383-1-lucas.demarchi@intel.com commit 6f3652c952d8d8d22da1d535c470906da6e1afde Author: Luca Weiss Date: Mon Mar 21 14:33:15 2022 +0100 phy: qcom-qmp: Add SM6350 UFS PHY support The SM6350 UFS PHY is compatible with the one from SDM845. Add a compatible for that. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20220321133318.99406-4-luca.weiss@fairphone.com Signed-off-by: Vinod Koul commit 082ffee0505810bba7c4add343fa178861e26212 Author: Luca Weiss Date: Mon Mar 21 14:33:14 2022 +0100 dt-bindings: phy: qcom,qmp: Add SM6350 UFS PHY bindings Document the compatible string for the UFS PHY found in SM6350. Signed-off-by: Luca Weiss Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220321133318.99406-3-luca.weiss@fairphone.com Signed-off-by: Vinod Koul commit 6866a60a8ef7f320eeaf737d4e2428ea40d252ff Author: Tom Rix Date: Sat Apr 9 13:11:31 2022 -0400 drm/radeon: remove r600_blit_shaders.[c|h] The only use of the global variables in r600_blit_shaders.c were in the old drivers/gpu/drm/radeon/r600_blit.c This file was removed in commit 8333f607a631 ("drm/radeon: remove UMS support") So remove the r600_blit_shaders.[c|h] files Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 1b5c30bf41586fdf4f2313d0b37545975568e29f Author: Max Erenberg Date: Tue Nov 23 15:10:16 2021 -0500 drm/amd/display: Disallow entering PSR when panel is disconnected [WHY] The dGPU cannot enter PSR when it is not connected to a panel. [HOW] Added a check to dc_link_set_psr_allow_active which returns early if panel is disconnected. Reviewed-by: Harry Vanzylldejong Reviewed-by: Evgenii Krasnikov Reviewed-by: Nicholas Choi Acked-by: Pavle Kotarac Signed-off-by: Max Erenberg Signed-off-by: Alex Deucher commit 5d5af34072c8b11f60960c3bea57ff9de5877791 Author: Saaem Rizvi Date: Mon Mar 28 14:25:16 2022 -0400 drm/amd/display: Disabling Z10 on DCN31 [WHY] Z10 is should not be enabled by default on DCN31. [HOW] Using DC debug flags to disable Z10 by default on DCN31. Reviewed-by: Eric Yang Acked-by: Pavle Kotarac Signed-off-by: Saaem Rizvi Signed-off-by: Alex Deucher commit 2513ed4f937999c0446fd824f7564f76b697d722 Author: Josip Pavic Date: Thu Mar 24 12:08:43 2022 -0400 drm/amd/display: do not wait for mpc idle if tg is disabled [Why] When booting, the driver waits for the MPC idle bit to be set as part of pipe initialization. However, on some systems this occurs before OTG is enabled, and since the MPC idle bit won't be set until the vupdate signal occurs (which requires OTG to be enabled), this never happens and the wait times out. This can add hundreds of milliseconds to the boot time. [How] Do not wait for mpc idle if tg is disabled Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: Josip Pavic Signed-off-by: Alex Deucher commit a0bd69e1268ba74c712e91afd6afb283f0b4d7ae Author: Eric Yang Date: Sat Mar 19 16:34:24 2022 -0400 drm/amd/display: undo clearing of z10 related function pointers [Why] Z10 and S0i3 have some shared path. Previous code clean up , incorrectly removed these pointers, which breaks s0i3 restore [How] Do not clear the function pointers based on Z10 disable. Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Eric Yang Signed-off-by: Alex Deucher commit 05eee31c0821c7209409ef0991b95df3511c0326 Author: Stanley.Yang Date: Thu Apr 7 23:56:07 2022 +0800 drm/amdgpu: add umc query error status function In order to debug ras error, driver will print IPID/SYND/MISC0 register value if detect correctable or uncorrectable error. Provide umc_query_error_status_helper function to reduce code redundancy. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 1754cea1763e2bdc6a2153220440fe9aa9e0f2c9 Author: Alex Deucher Date: Thu Apr 7 15:46:06 2022 -0400 drm/amd/display: fix 64 bit divide in freesync code Use div_u64() rather than a a 64 bit divide. Fixes: 3fe5739db48843 ("drm/amd/display: Add flip interval workaround") Reviewed-by: Nathan Chancellor Reported-by: kernel test robot Signed-off-by: Alex Deucher Cc: Angus Wang Cc: Anthony Koo Cc: Aric Cyr Cc: Nathan Chancellor commit 6f90a49bc0c9a2d8590dea3323c9b0c61ee78add Author: Grigory Vasilyev Date: Fri Apr 8 10:58:17 2022 +0300 drm/amdgpu: Fix incorrect enum type Instead of the 'amdgpu_ring_priority_level' type, the 'amdgpu_gfx_pipe_priority' type was used, which is an error when setting ring priority. This is a minor error, but may cause problems in the future. Instead of AMDGPU_RING_PRIO_2 = 2, we can use AMDGPU_RING_PRIO_MAX = 3, but AMDGPU_RING_PRIO_2 = 2 is used for compatibility with AMDGPU_GFX_PIPE_PRIO_HIGH = 2, and not change the behavior of the code. Signed-off-by: Grigory Vasilyev Signed-off-by: Alex Deucher commit 024106930ce7d8192f97f0341f233e8d34db7e5c Author: Tom Rix Date: Thu Apr 7 17:46:59 2022 -0400 drm/radeon: change cayman_default_state table from global to static cayman_default_state and cayman_default_size are only used in ni.c. Single file symbols should be static. So move their definitions to cayman_blit_shaders.h and change their storage-class-specifier to static. Remove unneeded cayman_blit_shader.c cayman_ps/vs definitions were removed with commit 4f8629675800 ("drm/radeon/kms: remove r6xx+ blit copy routines") So their declarations in cayman_blit_shader.h are not needed, so remove them. Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit dc2947b35f519efbcdd67815ec965b8c9056d274 Author: Tom St Denis Date: Fri Apr 8 09:14:22 2022 -0400 drm/amd/amdgpu: Update debugfs GCA data The data revision was not changed to 5 from 4 when the CG flags were extended to 64-bits. Since this was missed I took the opportunity to add future upper 64-bits of PG flags as well so we don't need to bump it again when that comes. Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d9e50239a9611b9a1759e007e9a810c8d178da28 Author: Yongqiang Sun Date: Fri Apr 8 09:26:14 2022 -0400 drm/amd/amdgpu: Fix asm/hypervisor.h build error. Add CONFIG_X86 check to fix the build error. Fixes: 49aa98ca30cd18 ("drm/amd/amdgpu: Only reserve vram for firmware with vega9 MS_HYPERV host.") Reported-by: kernel test robot Signed-off-by: Yongqiang Sun Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit edd11922e3d01549fc6f5a1fa1413eb2f7d5be55 Author: Philip Yang Date: Tue Apr 5 22:24:42 2022 -0400 drm/amdkfd: Handle drain retry fault race with XNACK mode change Application could change XNACK enabled to disabled while KFD is draining stale retry fault, therefore the check for whether to drain retry faults must be before the check for whether xnack_enabled, to avoid report incorrect vm fault after application changes XNACK mode. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 73bce7a423c3bb7c3441177aca868ff5f2cf93fa Author: Lijo Lazar Date: Fri Apr 8 09:11:04 2022 +0530 drm/amdgpu: Use flexible array member Use flexible array member in ip discovery struct as recommended[1]. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays v2: squash in struct_size fixes Signed-off-by: Lijo Lazar Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 73c3ed7495c67b8fbdc31cf58e6ca8757df31a33 Author: Jiasheng Jiang Date: Tue Dec 14 18:08:37 2021 +0800 drm: mali-dp: potential dereference of null pointer The return value of kzalloc() needs to be checked. To avoid use of null pointer '&state->base' in case of the failure of alloc. Fixes: 99665d072183 ("drm: mali-dp: add malidp_crtc_state struct") Signed-off-by: Jiasheng Jiang Reviewed-by: Brian Starkey Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20211214100837.46912-1-jiasheng@iscas.ac.cn commit b5c7d19736a17115f0c3489a2ebfa5c5181902b9 Author: Robin Murphy Date: Tue Apr 5 15:11:18 2022 +0100 drm/arm/malidp: Stop using iommu_present() iommu_get_domain_for_dev() is already perfectly happy to return NULL if the given device has no IOMMU. Drop the unnecessary check. Signed-off-by: Robin Murphy Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/5049994e6c2ba92c2f30d51850c8929136d0f8ca.1649167878.git.robin.murphy@arm.com commit c8f76c37cc3668ee45e081e76a15f24a352ebbdd Author: Liviu Dudau Date: Thu Dec 2 17:00:33 2021 +0000 drm/komeda: return early if drm_universal_plane_init() fails. If drm_universal_plane_init() fails early we jump to the common cleanup code that calls komeda_plane_destroy() which in turn could access the uninitalised drm_plane and crash. Return early if an error is detected without going through the common code. Reported-by: Steven Price Reviewed-by: Steven Price Signed-off-by: Liviu Dudau Link: https://lore.kernel.org/dri-devel/20211203100946.2706922-1-liviu.dudau@arm.com commit f5e284bb74ab296f98122673c7ecd22028b2c200 Author: Zhou Qingyang Date: Wed Dec 1 11:37:03 2021 +0800 drm/komeda: Fix an undefined behavior bug in komeda_plane_add() In komeda_plane_add(), komeda_get_layer_fourcc_list() is assigned to formats and used in drm_universal_plane_init(). drm_universal_plane_init() passes formats to __drm_universal_plane_init(). __drm_universal_plane_init() further passes formats to memcpy() as src parameter, which could lead to an undefined behavior bug on failure of komeda_get_layer_fourcc_list(). Fix this bug by adding a check of formats. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_DRM_KOMEDA=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: 61f1c4a8ab75 ("drm/komeda: Attach komeda_dev to DRM-KMS") Signed-off-by: Zhou Qingyang Signed-off-by: Liviu Dudau Link: https://lore.kernel.org/dri-devel/20211201033704.32054-1-zhou1615@umn.edu commit 68d9787bdd5cbfa76e795c4015f8d58b84955a01 Author: Manivannan Sadhasivam Date: Tue Mar 29 21:16:16 2022 +0530 remoteproc: Don't bother checking the return value of debugfs_create* DebugFS APIs are designed to return only the error pointers and not NULL in the case of failure. So these return pointers are safe to be passed on to the successive debugfs_create* APIs. Therefore, let's just get rid of the checks. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220329154616.58902-1-manivannan.sadhasivam@linaro.org Signed-off-by: Mathieu Poirier commit c7bda0dca98cca351a9bc852b3df8b9b99ffd400 Author: Borislav Petkov Date: Thu Jan 13 14:26:10 2022 +0100 x86: Remove a.out support Commit eac616557050 ("x86: Deprecate a.out support") deprecated a.out support with the promise to remove it a couple of releases later. That commit landed in v5.1. Now it is more than a couple of releases later, no one has complained so remove it. Fold in a hunk removing the reference to arch/x86/ia32/ia32_aout.c in MAINTAINERS: https://lore.kernel.org/r/20220316050828.17255-1-lukas.bulwahn@gmail.com Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220113160115.5375-1-bp@alien8.de commit e50abbf788c239d529f9ab81e325f8e8f8432c9d Author: Yang Yingliang Date: Mon Apr 11 19:12:13 2022 +0800 virt: sevguest: Fix return value check in alloc_shared_pages() If alloc_pages() fails, it returns a NULL pointer. Replace the wrong IS_ERR() check with the proper NULL pointer check. Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Borislav Petkov Reviewed-by: Brijesh Singh Link: https://lore.kernel.org/r/20220411111213.1477853-1-yangyingliang@huawei.com commit f20e232d74ee0ace386be0b7db1ff993ea69b4c4 Author: Tinghan Shen Date: Mon Mar 21 14:03:40 2022 +0800 remoteproc: mediatek: Fix side effect of mt8195 sram power on The definition of L1TCM_SRAM_PDN bits on mt8195 is different to mt8192. L1TCM_SRAM_PDN bits[3:0] control the power of mt8195 L1TCM SRAM. L1TCM_SRAM_PDN bits[7:4] control the access path to EMI for SCP. These bits have to be powered on to allow EMI access for SCP. Bits[7:4] also affect audio DSP because audio DSP and SCP are placed on the same hardware bus. If SCP cannot access EMI, audio DSP is blocked too. L1TCM_SRAM_PDN bits[31:8] are not used. This fix removes modification of bits[7:4] when power on/off mt8195 SCP L1TCM. It's because the modification introduces a short period of time blocking audio DSP to access EMI. This was not a problem until we have to load both SCP module and audio DSP module. audio DSP needs to access EMI because it has source/data on DRAM. Audio DSP will have unexpected behavior when it accesses EMI and the SCP driver blocks the EMI path at the same time. Fixes: 79111df414fc ("remoteproc: mediatek: Support mt8195 scp") Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20220321060340.10975-1-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit f4fd706f738338e78f413db36d0a483a11c53cd1 Author: Geliang Tang Date: Sat Apr 9 07:58:17 2022 +0800 selftests/bpf: Drop duplicate max/min definitions Drop duplicate macros min() and MAX() definitions in prog_tests and use MIN() or MAX() in sys/param.h instead. Signed-off-by: Geliang Tang Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/1ae276da9925c2de59b5bdc93b693b4c243e692e.1649462033.git.geliang.tang@suse.com commit 88115ea6308d6faf94b67e260209180a582bb2f1 Author: Nehal Bakulchandra Shah Date: Fri Apr 8 15:17:17 2022 +0530 HID: amd_sfh: Remove name from maintainers list Remove my name from maintainer-ship of AMD SENSOR FUSION HUB DRIVER Signed-off-by: Nehal Bakulchandra Shah Acked-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 71f56b27550986d0e53988ed18db386c106bab55 Author: Paul Boddie Date: Thu Apr 7 13:16:11 2022 +0200 drm/ingenic: Add dw-hdmi driver specialization for jz4780 A specialisation of the generic Synopsys HDMI driver is employed for JZ4780 HDMI support. This requires a new driver, plus device tree and configuration modifications. Here we add Kconfig DRM_INGENIC_DW_HDMI, Makefile and driver code. Note that there is no hpd-gpio installed on the CI20 board HDMI connector. Hence there is no hpd detection by the connector driver and we have to enable polling in the dw-hdmi core driver. For that we need to set .poll_enabled but that struct component can only be accessed by core code. Hence we use the public setter function drm_kms_helper_hotplug_event() introduced before. Also note that we disable Color Space Conversion since it is not working on jz4780. Signed-off-by: Paul Boddie Signed-off-by: Ezequiel Garcia Signed-off-by: H. Nikolaus Schaller Reviewed-by: Neil Armstrong Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/e5cdf9cd44bde52cce379cc830f2d6117ea15c32.1649330171.git.hns@goldelico.com commit 33e799ed905b84a53b9efa71c6f2b62cbbca40dd Author: Paul Cercueil Date: Thu Apr 7 13:16:10 2022 +0200 drm/ingenic: Implement proper .atomic_get_input_bus_fmts The .atomic_get_input_bus_fmts() callback of our top bridge should return the possible input formats for a given output format. If the requested output format is not supported, then NULL should be returned, otherwise the bus format negociation will end with a bus format that the encoder does not support. Signed-off-by: H. Nikolaus Schaller Reviewed-by: Neil Armstrong Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/ab25925723cff2f3e773e7137567ef86fff5fdba.1649330171.git.hns@goldelico.com commit 6de79dd3a920a138a292231e2da82ab8e019ec99 Author: H. Nikolaus Schaller Date: Thu Apr 7 13:16:09 2022 +0200 drm/bridge: display-connector: add ddc-en gpio support "hdmi-connector.yaml" bindings defines an optional property "ddc-en-gpios" for a single gpio to enable DDC operation. Usually this controls +5V power on the HDMI connector. This +5V may also be needed for HPD. This was not reflected in code but is needed to make the CI20 board work. Now, the driver activates the ddc gpio after probe and deactivates after remove so it is "almost on". But only if this driver is loaded (and not e.g. blacklisted as module). Signed-off-by: H. Nikolaus Schaller Reviewed-by: Laurent Pinchart Reviewed-by: Neil Armstrong Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/3607e924b7c0cf0be956c0d49894be1442dbda41.1649330171.git.hns@goldelico.com commit dd642ccb45ecce1402eb2550f5284fc6bb9ed7b8 Author: Pu Lehui Date: Sun Apr 10 18:12:46 2022 +0800 riscv, bpf: Implement more atomic operations for RV64 This patch implement more BPF atomic operations for RV64. The newly added operations are shown below: atomic[64]_[fetch_]add atomic[64]_[fetch_]and atomic[64]_[fetch_]or atomic[64]_xchg atomic[64]_cmpxchg Since riscv specification does not provide AMO instruction for CAS operation, we use lr/sc instruction for cmpxchg operation, and AMO instructions for the rest ops. Tests "test_bpf.ko" and "test_progs -t atomic" have passed, as well as "test_verifier" with no new failure cases. Signed-off-by: Pu Lehui Signed-off-by: Daniel Borkmann Acked-by: Song Liu Acked-by: Björn Töpel Link: https://lore.kernel.org/bpf/20220410101246.232875-1-pulehui@huawei.com commit c3e6e59af2a0c7937815808804eb4d9ddc9df9be Author: Nikolai Kondrashov Date: Thu Mar 3 08:47:34 2022 +0100 HID: uclogic: Add support for Huion touch ring reports Support touch ring reports found in Huion HS610 to the UC-Logic driver. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 3e200d6cdb7d5c892fb4819be66c65385673a980 Author: Nikolai Kondrashov Date: Thu Mar 3 08:47:33 2022 +0100 HID: uclogic: Allow three frame parameter sets Allow three frame parameter sets per each UC-Logic tablet interface. Bump the number of supported subreports to three as well to accommodate ID routing. This allows supporting the dial on Huion Q620M. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit ee0070367e1da844e385562fb4f33453b7f7c587 Author: Nikolai Kondrashov Date: Thu Mar 3 08:47:32 2022 +0100 HID: uclogic: Support custom device suffix for frames Support assigning custom device name suffixes to frame input devices instead of just "Pad". This allows distinguishing multiple frame input devices, e.g. for Huion HS610. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit d170e8e02729ad3bc4924005cec1ad38409d82af Author: Nikolai Kondrashov Date: Thu Mar 3 08:47:31 2022 +0100 HID: uclogic: Add support for touch ring reports Add support for touch ring to UC-Logic driver. The touch ring reports can be flipped around a specific point to match the orientation and direction reported by the Wacom drivers. The proximity will also be reported similar to the Wacom drivers. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit e4d4371253029528c02bfb43a46c252e1c3d035f Author: Aswath Govindraju Date: Fri Apr 8 16:43:16 2022 +0530 phy: phy-can-transceiver: Add support for setting mux On some boards, for routing CAN signals from controller to transceiver, muxes might need to be set. Therefore, add support for setting the mux by reading the mux-states property from the device tree node. Signed-off-by: Aswath Govindraju Link: https://lore.kernel.org/r/20220408111316.21189-1-a-govindraju@ti.com Signed-off-by: Vinod Koul commit 046d2e7c50e3087a32a85fd384c21f896dbccf83 Author: Sriram R Date: Mon Apr 4 21:11:23 2022 +0530 mac80211: prepare sta handling for MLO support Currently in mac80211 each STA object is represented using sta_info datastructure with the associated STA specific information and drivers access ieee80211_sta part of it. With MLO (Multi Link Operation) support being added in 802.11be standard, though the association is logically with a single Multi Link capable STA, at the physical level communication can happen via different advertised links (uniquely identified by Channel, operating class, BSSID) and hence the need to handle multiple link STA parameters within a composite sta_info object called the MLD STA. The different link STA part of MLD STA are identified using the link address which can be same or different as the MLD STA address and unique link id based on the link vif. To support extension of such a model, the sta_info datastructure is modified to hold multiple link STA objects with link specific params currently within sta_info moved to this new structure. Similarly this is done for ieee80211_sta as well which will be accessed within mac80211 as well as by drivers, hence trivial driver changes are expected to support this. For current non MLO supported drivers, only one link STA is present and link information is accessed via 'deflink' member. For MLO drivers, we still need to define the APIs etc. to get the correct link ID and access the correct part of the station info. Currently in mac80211, all link STA info are accessed directly via deflink. These will be updated to access via link pointers indexed by link id with MLO support patches, with link id being 0 for non MLO supported cases. Except for couple of macro related changes, below spatch takes care of updating mac80211 and driver code to access to the link STA info via deflink. @ieee80211_sta@ struct ieee80211_sta *s; struct sta_info *si; identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr}; @@ ( s-> - var + deflink.var | si->sta. - var + deflink.var ) @sta_info@ struct sta_info *si; identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth}; @@ ( si-> - var + deflink.var ) Signed-off-by: Sriram R Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com [remove MLO-drivers notes from commit message, not clear yet; run spatch] Signed-off-by: Johannes Berg commit 52126d4c03798cc55aa927fea4c776ab26b5a5f0 Author: Christophe JAILLET Date: Sun Feb 6 10:47:45 2022 +0100 dmaengine: Remove a useless mutex According to lib/idr.c, The IDA handles its own locking. It is safe to call any of the IDA functions without synchronisation in your code. so the 'chan_mutex' mutex can just be removed. It is here only to protect some ida_alloc()/ida_free() calls. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/7180452c1d77b039e27b6f9418e0e7d9dd33c431.1644140845.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 2d7991fe867974a8e5065ee9691451a406b9320d Author: Dave Jiang Date: Fri Mar 11 16:23:22 2022 -0700 dmaengine: idxd: update IAA definitions for user header Add additional structure definitions for Intel In-memory Analytics Accelerator (IAA/IAX). See specification (1) for more details. 1: https://cdrdv2.intel.com/v1/dl/getContent/721858 Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164704100212.1373038.18362680016033557757.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit ee17028009d49fffed8cc963455d33b1fd3f1d08 Author: Akhil R Date: Fri Feb 25 18:50:44 2022 +0530 dmaengine: tegra: Add tegra gpcdma driver Adding GPC DMA controller driver for Tegra. The driver supports dma transfers between memory to memory, IO peripheral to memory and memory to IO peripheral. Co-developed-by: Pavan Kunapuli Signed-off-by: Pavan Kunapuli Co-developed-by: Rajesh Gumasta Signed-off-by: Rajesh Gumasta Signed-off-by: Akhil R Reviewed-by: Jon Hunter Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20220225132044.14478-3-akhilrajeev@nvidia.com Signed-off-by: Vinod Koul commit 729106266a50400181c3baa508c79bead46eb8e0 Author: Akhil R Date: Fri Feb 25 18:50:43 2022 +0530 dt-bindings: dmaengine: Add doc for tegra gpcdma Add DT binding document for Nvidia Tegra GPCDMA controller. Signed-off-by: Rajesh Gumasta Signed-off-by: Akhil R Reviewed-by: Jon Hunter Reviewed-by: Rob Herring Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20220225132044.14478-2-akhilrajeev@nvidia.com Signed-off-by: Vinod Koul commit d72dcbe9fce505228dae43bef9da8f2b707d1b3d Author: Christian König Date: Mon Apr 11 15:21:59 2022 +0200 drm/ttm: fix logic inversion in ttm_eu_reserve_buffers That should have been max, not min. Signed-off-by: Christian König Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4") Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220411134537.2854-1-christian.koenig@amd.com commit 6f4f5cf9823387acc4f52e3d30f96b879acdff37 Author: Haoyue Xu Date: Sat Apr 9 16:32:54 2022 +0800 RDMA/hns: Init the variable at the suitable place Assigning a value to ret in the init statement of a for-loop makes the code less readable. Link: https://lore.kernel.org/r/20220409083254.9696-6-liangwenpeng@huawei.com Signed-off-by: Haoyue Xu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit ac88da750f09c749e1c0ab0b8e5468c533704e52 Author: Wenpeng Liang Date: Sat Apr 9 16:32:53 2022 +0800 RDMA/hns: Add judgment on the execution result of CMDQ that free vf resource CDMQ may fail to execute, so its return value should not be ignored. Link: https://lore.kernel.org/r/20220409083254.9696-5-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 601cdd861cf551e330c85c4dfa6d25bef3b8d554 Author: Guofeng Yue Date: Sat Apr 9 16:32:52 2022 +0800 RDMA/hns: Remove redundant variable "ret" It is completely redundant for this function to use "ret" to store the return value of the subfunction. Link: https://lore.kernel.org/r/20220409083254.9696-4-liangwenpeng@huawei.com Signed-off-by: Guofeng Yue Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 9216d05943833bdedefb8c88680a48f9e5e4aafc Author: Yixing Liu Date: Sat Apr 9 16:32:51 2022 +0800 RDMA/hns: Remove unused function to_hns_roce_state() This function is only used in HIP06, which has been removed. So remove it. Link: https://lore.kernel.org/r/20220409083254.9696-3-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit c2fcafa78a33576b7fe47f5e4f85d413a62c2fe2 Author: Chengchang Tang Date: Sat Apr 9 16:32:50 2022 +0800 RDMA/hns: Remove unnecessary check for the sgid_attr when modifying QP The sgid_attr cannot be null in this scenario. This judgment is redundant. Fixes: 606bf89e98ef ("RDMA/hns: Refactor for hns_roce_v2_modify_qp function") Link: https://lore.kernel.org/r/20220409083254.9696-2-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit cc4abaa67e051ddc1bb4e00186870adbd780d1cd Author: Olivier Dautricourt Date: Thu Mar 17 18:56:56 2022 +0100 dt-bindings: altr,msgdma: update my email address This email should now be used to contact me. Signed-off-by: Olivier Dautricourt Acked-by: Rob Herring Link: https://lore.kernel.org/r/dc3decf1dae172c688017bd3ada2ad2b7d060c1e.1647539776.git.olivier.dautricourt@orolia.com Signed-off-by: Vinod Koul commit 745bd600941375ed6d2b4139f3b90619ac0fcd12 Author: Olivier Dautricourt Date: Thu Mar 17 18:56:55 2022 +0100 MAINTAINERS: update my email address This email should now be used to contact me. Signed-off-by: Olivier Dautricourt Link: https://lore.kernel.org/r/85c4174fa162bd946ccf3e08dcfc9b83cfe69b5c.1647539776.git.olivier.dautricourt@orolia.com Signed-off-by: Vinod Koul commit 81f5eb2b11ba748ee7e393e2faf32af773ae332d Author: Dave Jiang Date: Mon Mar 21 13:40:51 2022 -0700 dmaengine: idxd: remove trailing white space on input str for wq name Add string processing with strim() in order to remove trailing white spaces that may be input by user for the wq->name. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164789525123.2799661.13795829125221129132.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 5c6dd7bd569b54c0d2904125d7366aa93f077f67 Author: Peter Seiderer Date: Mon Apr 4 18:54:14 2022 +0200 mac80211: minstrel_ht: fix where rate stats are stored (fixes debugfs output) Using an ath9k card the debugfs output of minstrel_ht looks like the following (note the zero values for the first four rates sum-of success/attempts): best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] OFDM 1 DP 6.0M 272 1640 5.2 3.1 53.8 3 0 0 0 0 OFDM 1 C 9.0M 273 1104 7.7 4.6 53.8 4 0 0 0 0 OFDM 1 B 12.0M 274 836 10.0 6.0 53.8 4 0 0 0 0 OFDM 1 A S 18.0M 275 568 14.3 8.5 53.8 5 0 0 0 0 OFDM 1 S 24.0M 276 436 18.1 0.0 0.0 5 0 1 80 1778 OFDM 1 36.0M 277 300 24.9 0.0 0.0 0 0 1 0 107 OFDM 1 S 48.0M 278 236 30.4 0.0 0.0 0 0 0 0 75 OFDM 1 54.0M 279 212 33.0 0.0 0.0 0 0 0 0 72 Total packet count:: ideal 16582 lookaround 885 Average # of aggregated frames per A-MPDU: 1.0 Debugging showed that the rate statistics for the first four rates where stored in the MINSTREL_CCK_GROUP instead of the MINSTREL_OFDM_GROUP because in minstrel_ht_get_stats() the supported check was not honoured as done in various other places, e.g net/mac80211/rc80211_minstrel_ht_debugfs.c: 74 if (!(mi->supported[i] & BIT(j))) 75 continue; With the patch applied the output looks good: best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] OFDM 1 D 6.0M 272 1640 5.2 5.2 100.0 3 0 0 1 1 OFDM 1 C 9.0M 273 1104 7.7 7.7 100.0 4 0 0 38 38 OFDM 1 B 12.0M 274 836 10.0 9.9 89.5 4 2 2 372 395 OFDM 1 A P 18.0M 275 568 14.3 14.3 97.2 5 52 53 6956 7181 OFDM 1 S 24.0M 276 436 18.1 0.0 0.0 0 0 1 6 163 OFDM 1 36.0M 277 300 24.9 0.0 0.0 0 0 1 0 35 OFDM 1 S 48.0M 278 236 30.4 0.0 0.0 0 0 0 0 38 OFDM 1 S 54.0M 279 212 33.0 0.0 0.0 0 0 0 0 38 Total packet count:: ideal 7097 lookaround 287 Average # of aggregated frames per A-MPDU: 1.0 Signed-off-by: Peter Seiderer Link: https://lore.kernel.org/r/20220404165414.1036-1-ps.report@gmx.net Signed-off-by: Johannes Berg commit 40a56956e55a766622c35106a510c10a105436b4 Author: Stanislav Lisovskiy Date: Mon Apr 11 11:13:43 2022 +0300 drm/i915: Swap ret and status returned from skl_pcode_request If ret isn't zero, it is almost for sure ETIMEDOUT, because we use it in wait_for macro which does continuous retries until timeout is reached. If we still ran out of time and retries, we most likely would be interested in getting status, to understand what was the actual error propagated from PCode, rather than to find out that we had a time out, which is anyway quite obvious, if the function fails. v2: Make it status ? status : ret(thanks Vinod for the hint) Signed-off-by: Stanislav Lisovskiy Reviewed-by: Vinod Govindapillai Link: https://patchwork.freedesktop.org/patch/msgid/20220411081343.18099-1-stanislav.lisovskiy@intel.com commit 9e0a1c3c3fcbf9d819d1ee584e43c87318772fdc Author: Stanislav Lisovskiy Date: Fri Apr 8 15:51:59 2022 +0300 drm/i915: Fix skl_pcode_try_request function Currently skl_pcode_try_request function doesn't properly handle return value it gets from snb_pcode_rw, but treats status != 0 as success, returning true, which basically doesn't allow to use retry/timeout mechanisms if PCode happens to be busy and returns EGAIN or some other status code not equal to 0. We saw this on real hw and also tried simulating this by always returning -EAGAIN from snb_pcode_rw for 6 times, which currently will just result in false success, while it should have tried until timeout is reached: [ 22.357729] i915 0000:00:02.0: [drm:intel_cdclk_dump_config [i915]] Changing CDCLK to 307200 kHz, VCO 614400 kHz, ref 38400 kHz, bypass 19200 kHz, voltage level 0 [ 22.357831] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 1 [ 22.357892] i915 0000:00:02.0: [drm:skl_pcode_request [i915]] Success, exiting [ 22.357936] i915 0000:00:02.0: [drm] ERROR Failed to inform PCU about cdclk change (err -11, freq 307200) We see en error because higher level api, still notices that status was wrong, however we still did try only once. We fix it by requiring _both_ the status to be 0 and request/reply match for success(true) and function should return failure(false) if either status turns out to be EAGAIN, EBUSY or whatever or reply/request masks do not match. So now we see this in the logs: [ 22.318667] i915 0000:00:02.0: [drm:intel_cdclk_dump_config [i915]] Changing CDCLK to 307200 kHz, VCO 614400 kHz, ref 38400 kHz, bypass 19200 kHz, voltage level 0 [ 22.318782] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 1 [ 22.318849] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 2 [ 22.319006] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 3 [ 22.319091] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 4 [ 22.319158] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 5 [ 22.319224] i915 0000:00:02.0: [drm:__snb_pcode_rw [i915]] Returning EAGAIN retry 6 Reviewed-by: Vinod Govindapillai Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220408125200.9069-2-stanislav.lisovskiy@intel.com commit f25d2b2b554133b935e72c61deb40d82287a6f75 Author: Minghao Chi Date: Fri Apr 8 08:08:53 2022 +0000 soc: ti: pruss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Nishanth Menon Reviewed-by: Dave Gerlach Link: https://lore.kernel.org/r/20220408080853.2494292-1-chi.minghao@zte.com.cn commit d281a982c2693c6a7bffaa1ae1ff3b400d6e6c74 Author: Jakob Koschel Date: Thu Mar 24 08:25:03 2022 +0100 soc: ti: 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. Signed-off-by: Jakob Koschel Signed-off-by: Nishanth Menon Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Link: https://lore.kernel.org/r/20220324072503.63244-1-jakobkoschel@gmail.com commit 1f854536a8336c61c89ab040bbc874c75325d37c Author: Paul Kocialkowski Date: Thu Mar 31 15:41:14 2022 +0200 dmaengine: Clarify cyclic transfer residue documentation The current documentation for the residue reported in a cyclic transfer case mentions that the reported residue should be relative to the current period only. However the definition of DMA_RESIDUE_GRANULARITY_SEGMENT specifies that the residue should be updated after each period for a cyclic transfer, which is in direct contradiction. Moreover the pcm_dmaengine common code uses the residue relative to the whole cyclic buffer size, not one period. Correct the residue-related documentation to reflect this. Signed-off-by: Paul Kocialkowski Link: https://lore.kernel.org/r/20220331134114.703782-1-paul.kocialkowski@bootlin.com Signed-off-by: Vinod Koul commit c2b0390132edffad1b52e4e84f797343b10f5ef2 Author: Yihao Han Date: Thu Mar 3 04:44:44 2022 -0800 soc: ti: wkup_m3_ipc: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20220303124444.3373-1-hanyihao@vivo.com commit 5f77876013d08fe9d43bb4b7f9f7a81e4d3b63a9 Author: Arunpravin Paneer Selvam Date: Mon Apr 11 13:08:34 2022 +0530 drm: add a check to verify the size alignment Add a simple check to reject any size not aligned to the min_page_size. when size is not aligned to min_page_size, driver module should handle in their own way either to round_up() the size value to min_page_size or just to enable WARN_ON(). If we dont handle the alignment properly, we may hit the following bug, Unigine Heaven has allocation requests for example required pages are 257 and alignment request is 256. To allocate the left over 1 page, continues the iteration to find the order value which is 0 and when it compares with min_order = 8, triggers the BUG_ON(order < min_order). v2: add more commit description v3: remove WARN_ON() Signed-off-by: Arunpravin Paneer Selvam Suggested-by: Matthew Auld Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220411073834.15210-1-Arunpravin.PaneerSelvam@amd.com Signed-off-by: Christian König commit a75971bc2b8453630e9f85e0beaa4da8db8277a3 Author: Johannes Berg Date: Fri Mar 18 13:46:57 2022 +0100 nl80211: show SSID for P2P_GO interfaces There's no real reason not to send the SSID to userspace when it requests information about P2P_GO, it is, in that respect, exactly the same as AP interfaces. Fix that. Fixes: 44905265bc15 ("nl80211: don't expose wdev->ssid for most interfaces") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220318134656.14354ae223f0.Ia25e85a512281b92e1645d4160766a4b1a471597@changeid Signed-off-by: Johannes Berg commit ec834f1cc7cf471b090bb0a6ee077a7bb90a3549 Author: Amelie Delaunay Date: Wed Mar 30 12:36:45 2022 +0200 dmaengine: stm32-mdma: check the channel availability (secure or not) STM32_MDMA_CCR bit[8] is used to enable Secure Mode (SM). If this bit is set, it means that all the channel registers are write-protected. So the channel is not available for Linux use. Add stm32_mdma_filter_fn() callback filter and give it to __dma_request_chan (instead of dma_get_any_slave_channel()), to exclude the channel if it is marked Secure. Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220330103645.99969-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 6d945a33f2b0aa24fc210dadaa0af3e8218e7002 Author: Lorenzo Bianconi Date: Fri Mar 25 11:42:41 2022 +0100 mac80211: introduce BSS color collision detection Add ieee80211_rx_check_bss_color_collision routine in order to introduce BSS color collision detection in mac80211 if it is not supported in HW/FW (e.g. for mt7915 chipset). Add IEEE80211_HW_DETECTS_COLOR_COLLISION flag to let the driver notify BSS color collision detection is supported in HW/FW. Set this for ath11k which apparently didn't need this code. Tested-by: Peter Chiu Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/a05eeeb1841a84560dc5aaec77894fcb69a54f27.1648204871.git.lorenzo@kernel.org [clarify commit message a bit, move flag to mac80211] Signed-off-by: Johannes Berg commit e5c95ca094cfe59a4013d711f87ff034cba30f80 Author: Toke Høiland-Jørgensen Date: Mon Apr 4 23:01:08 2022 +0200 mac80211: Improve confusing comment around tx_info clearing The comment above the ieee80211_tx_info_clear_status() helper was somewhat confusing as to which fields it was or wasn't clearing. So replace it by something that is hopefully more, well, clear. Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220404210108.2684907-1-toke@toke.dk Signed-off-by: Johannes Berg commit 450c271d508f47577cce509582f1041eeb947e6e Author: Lorenzo Bianconi Date: Thu Apr 7 12:36:58 2022 +0200 mac80211: protect ieee80211_assign_beacon with next_beacon check Even if it is not a real issue since ieee80211_set_after_csa_beacon() or ieee80211_set_after_color_change_beacon() are run only when csa or bcc is active, move next_beacon check before running ieee80211_assign_beacon routine. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/041764ed7e9781bcee66c33b41f1365aa4205932.1649327683.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit c7d7d0ce29175251f0212a91703ab8e78b1e2784 Author: Tony Lindgren Date: Fri Feb 4 10:43:38 2022 +0200 ARM: dts: Drop custom clkctrl compatible and update omap5 l4per We can now use the clock-output-names and don't need custom compatible values for each clkctrl instance. And we can use a generic name also for the clock manager instance. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204084339.12341-5-tony@atomide.com> commit 7359c0aee7616107fe07c47525c54d76281a1619 Author: Tony Lindgren Date: Fri Feb 4 10:43:37 2022 +0200 ARM: dts: Add clock-output-names for omap5 To stop using the non-standard node name based clock naming, let's first add the clock-output-names property. This allows us to stop using the internal legacy clock naming and unify the naming for the TI SoCs in the following patches. Note that we must wait on fixing the node naming issues until after the internal clock names have been updated to avoid adding name translation unnecessarily. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204084339.12341-4-tony@atomide.com> commit 0752506039c4ea0309979166042544ff2026ea6a Author: Tony Lindgren Date: Fri Feb 4 10:43:36 2022 +0200 ARM: dts: Drop custom clkctrl compatible and update omap4 l4per We can now use the clock-output-names and don't need custom compatible values for each clkctrl instance. And we can use a generic name also for the clock manager instance. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204084339.12341-3-tony@atomide.com> commit da541a6c196e60cbad74a4c941afbef1b0331f7f Author: Tony Lindgren Date: Fri Feb 4 10:43:35 2022 +0200 ARM: dts: Add clock-output-names for omap4 To stop using the non-standard node name based clock naming, let's first add the clock-output-names property. This allows us to stop using the internal legacy clock naming and unify the naming for the TI SoCs in the following patches. Note that we must wait on fixing the node naming issues until after the internal clock names have been updated to avoid adding name translation unnecessarily. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204084339.12341-2-tony@atomide.com> commit f8ca5f5ae57fa931b6cc6e622500ee7e9ce3bd8e Author: Tony Lindgren Date: Fri Feb 4 10:15:29 2022 +0200 ARM: dts: Use clock-output-names for am4 With the TI clocks supporting the use of clock-output-names devicetree property, we no longer need to use non-standard node names for clocks. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204081529.57694-1-tony@atomide.com> commit e4920169e7a2a839836d3a0d8cda1bae8caa3056 Author: Tony Lindgren Date: Fri Feb 4 10:08:42 2022 +0200 ARM: dts: Use clock-output-names for dra7 With the TI clocks supporting the use of clock-output-names devicetree property, we no longer need to use non-standard node names for clocks. Depends-on: 31aa7056bbec ("ARM: dts: Don't use legacy clock defines for dra7 clkctrl") Depends-on: 9206a3af4fc0 ("clk: ti: Move dra7 clock devices out of the legacy section") Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204080842.40673-1-tony@atomide.com> commit ec7aa25fa4839e05f73b17a838e46dc591df75f0 Author: Tony Lindgren Date: Fri Feb 4 09:33:33 2022 +0200 ARM: dts: Use clock-output-names for am3 With the TI clocks supporting the use of clock-output-names devicetree property, we no longer need to use non-standard node names for clocks. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204073333.18175-5-tony@atomide.com> commit 9bc059f71c0ad5a1a9a94556a2e77fde6416fcec Author: Tony Lindgren Date: Fri Feb 4 09:33:32 2022 +0200 ARM: dts: Add clksel node for am3 clkout Let's add a clksel node for the component clocks to avoid devicetree unique_unit_address warnings. The component clocks can now get IO address from the parent clksel node. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204073333.18175-4-tony@atomide.com> commit 00950028d0796f2f130a6bb04903fe91b988b4e7 Author: Tony Lindgren Date: Fri Feb 4 09:33:31 2022 +0200 ARM: dts: Add clksel node for am3 gfx Let's add a clksel node for the component clocks to avoid devicetree unique_unit_address warnings. The component clocks can now get IO address from the parent clksel node. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204073333.18175-3-tony@atomide.com> commit c2f2646057bcf3f86a75f6a8aa9fbd159a1d4784 Author: Tony Lindgren Date: Fri Feb 4 09:33:30 2022 +0200 ARM: dts: Add clksel node for am3 ehrpwm Let's add a clksel node for the component clocks to avoid devicetree unique_unit_address warnings. The component clocks can now get IO address from the parent clksel node. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Message-Id: <20220204073333.18175-2-tony@atomide.com> commit fc3d39d5758dc001662df5aac825b2b6bcb6476f Author: Tony Lindgren Date: Thu Feb 3 13:23:37 2022 +0200 dt-bindings: clock: ti: Add clock-output-names for TI composite clocks For the TI composite clocks, we currently have only the divider clock list clock-output-names as an optional devicetree property. Let's add clock-output-names for all the TI composite clock bindings. This allows us to use clock-output-names for the clockctrl instance name instead of relying on a custom compatible or non-standard node names. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Acked-by: Rob Herring Message-Id: <20220203112337.19821-3-tony@atomide.com> commit 8ab423081a263cc84f4377d518d98330d4f78072 Author: Tony Lindgren Date: Thu Feb 3 13:23:36 2022 +0200 dt-bindings: clock: ti: Add clock-output-names for clockctrl This allows us to use clock-output-names for the clockctrl instance name instead of relying on a custom compatible or non-standard node names. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Acked-by: Rob Herring Message-Id: <20220203112337.19821-2-tony@atomide.com> commit 26ad4834da921ffcadad3ba177dbb137d36c9248 Author: Tony Lindgren Date: Thu Feb 3 13:23:35 2022 +0200 dt-bindings: omap: Add clock-output-names and #clock-cells This allows us to use clock-output-names for the clock manager instance name instead of relying on non-standard node names. Cc: Stephen Boyd Cc: Tero Kristo Signed-off-by: Tony Lindgren Acked-by: Rob Herring Message-Id: <20220203112337.19821-1-tony@atomide.com> commit 83970cd63b9f864525761137b500113ab0b49c94 Merge: 618f5df1f6a5a 3123109284176 Author: Jani Nikula Date: Mon Apr 11 16:01:56 2022 +0300 Merge drm/drm-next into drm-intel-next Sync up with v5.18-rc1, in particular to get 5e3094cfd9fb ("drm/i915/xehpsdv: Add has_flat_ccs to device info"). Signed-off-by: Jani Nikula commit 456733feb0da2dbb1288b9e8f5765df163620c2c Author: Christian Hewitt Date: Sat Apr 9 06:42:57 2022 +0000 arm64: dts: meson: alpa sort the board Makefile Let's alpha-sort the board Makefile to keep things organised. Signed-off-by: Christian Hewitt Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220409064257.24453-1-christianshewitt@gmail.com commit 571dda6ca5136c1213bd36b9f298d4487e2b6622 Author: Jisheng Zhang Date: Sun Dec 26 15:49:10 2021 +0800 PCI: tegra194: Remove unnecessary MSI enable reg save and restore The integrated MSI Receiver enable register is always initialized in dw_pcie_setup_rc() which is also called in resume code path, so we don't need to save/restore the enable register during suspend/resume. Link: https://lore.kernel.org/r/20211226074910.2722-1-jszhang@kernel.org Signed-off-by: Jisheng Zhang Signed-off-by: Lorenzo Pieralisi Acked-by: Vidya Sagar commit d3bf3dc4bbbf6109bd9b4bd60089d36205ec4a37 Author: Sander Vanheule Date: Sat Apr 9 21:55:51 2022 +0200 gpio: realtek-otto: Add RTL931x support The RTL931x SoC series has support for 32 GPIOs, although not all lines may be broken out to a physical pad. The GPIO bank's parent interrupt can be routed to either or both of the SoC's CPU cores by the GIC. Line-by-line IRQ balancing is not possible on these SoCs. Signed-off-by: Sander Vanheule Signed-off-by: Bartosz Golaszewski commit d0b55b6912f3c249097977eba8f3ed580d5f1c6b Author: Sander Vanheule Date: Sat Apr 9 21:55:50 2022 +0200 dt-bindings: gpio: realtek-otto: Add rtl9310 compatible Add the "realtek,rlt9310-gpio", "realtek,otto-gpio" compatible for GPIO nodes on the RTL931x SoC series. Signed-off-by: Sander Vanheule Acked-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit deaf1cecdeb052cdb5e92fd642016198724b44a4 Author: Sander Vanheule Date: Sat Apr 9 21:55:49 2022 +0200 gpio: realtek-otto: Add RTL930x support The RTL930x SoC series has support for 24 GPIOs, with the port order reversed compared to RTL838x and RTL839x. The RTL930x series also has two CPUs (VPEs) and can distribute individual GPIO interrupts between them. Signed-off-by: Sander Vanheule Signed-off-by: Bartosz Golaszewski commit 95fa6dbe58f286a8f87cb37b7516232eb678de2d Author: Sander Vanheule Date: Sat Apr 9 21:55:48 2022 +0200 gpio: realtek-otto: Support per-cpu interrupts On SoCs with multiple cores, it is possible that the GPIO interrupt controller supports assigning specific pins to one or more cores. IRQ balancing can be performed on a line-by-line basis if the parent interrupt is routed to all available cores, which is the default upon initialisation. Signed-off-by: Sander Vanheule Signed-off-by: Bartosz Golaszewski commit 105989311442e4d74a0226e555503dd57aa1e896 Author: Christophe Leroy Date: Sat Apr 2 11:54:25 2022 +0200 dmaengine: bestcomm: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/f98acba303489bdf003e7256460696225b00702e.1648833428.git.christophe.leroy@csgroup.eu Signed-off-by: Vinod Koul commit 9060a7a46a9463ec519a9436fa2b84f5407b138e Author: jianchunfu Date: Sun Apr 3 20:31:20 2022 +0800 dmaengine: ep93xx: Remove redundant word in comment Remove the second 'to' which is repeated. Signed-off-by: jianchunfu Link: https://lore.kernel.org/r/20220403123120.7794-1-jianchunfu@cmss.chinamobile.com Signed-off-by: Vinod Koul commit 3157dd0a366183adaea2f4d8721961637d562fee Author: Dave Jiang Date: Thu Apr 7 11:28:28 2022 -0700 dmaengine: idxd: don't load pasid config until needed The driver currently programs the system pasid to the WQ preemptively when system pasid is enabled. Given that a dwq will reprogram the pasid and possibly a different pasid, the programming is not necessary. The pasid_en bit can be set for swq as it does not need pasid programming but needs the pasid_en bit. Remove system pasid programming on device config write. Add pasid programming for kernel wq type on wq driver enable. The char dev driver already reprograms the dwq on ->open() call so there's no change. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164935607115.1660372.6734518676950372366.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit d072c88c28e1e2c886681bbb0f1748b8e6ff105f Author: Grygorii Strashko Date: Fri Apr 8 16:48:38 2022 +0300 net: ethernet: ti: cpsw: drop CPSW_HEADROOM define Since commit 1771afd47430 ("net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account") the TI CPSW driver was switched to use correct define CPSW_HEADROOM_NA to avoid alignment faults, but there are two places left where CPSW_HEADROOM is still used (without causing issues). Hence, completely drop CPSW_HEADROOM define and use CPSW_HEADROOM_NA everywhere to avoid further mistakes in code. Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller commit 512c5be35223d9baa2629efa1084cf5210eaee80 Author: Sander Vanheule Date: Sat Apr 9 21:55:47 2022 +0200 gpio: realtek-otto: Support reversed port layouts The GPIO port layout on the RTL930x SoC series is reversed compared to the RTL838x and RTL839x SoC series. Add new port offset calculator functions to ensure the correct order is used when reading port IRQ data, and ensure bgpio uses the right byte ordering. Signed-off-by: Sander Vanheule Signed-off-by: Bartosz Golaszewski commit 06a6a774f6b8ed94aefcf60caa56fe92d3a18e17 Author: Sander Vanheule Date: Sat Apr 9 21:55:46 2022 +0200 dt-bindings: gpio: realtek-otto: Add rtl9300 compatible Add the "realtek,rlt9300-gpio", "realtek,otto-gpio" compatible for GPIO nodes on the RTL930x SoC series. This SoC requires an extra register range, defining the interrupt CPU mapping registers. Signed-off-by: Sander Vanheule Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 80380f89d0f56e0efa43e24c11f989e89b4af952 Author: Lad Prabhakar Date: Mon Apr 4 16:55:57 2022 +0100 dmaengine: mediatek-cqdma: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220404155557.27316-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul commit bb40bb695ec8b90bee4bfd7db52ba92c4a0b7586 Author: Lad Prabhakar Date: Mon Apr 4 16:55:56 2022 +0100 dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220404155557.27316-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul commit 8b0c99371ac8c8db25ce68ce207fee3b22627597 Author: Lad Prabhakar Date: Mon Apr 4 16:55:55 2022 +0100 dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). There are no non-DT users for this driver so interrupt range (irq_res->start-irq_res->end) is no longer required and with DT we will be sure it will be a single IRQ resource for each index. Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220404155557.27316-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul commit e782f5bad3c87c9e237a8bf0dcaf022bb489cc33 Merge: 4696ad36d7642 f2ae0fa68e28f Author: David S. Miller Date: Mon Apr 11 11:55:54 2022 +0100 Merge branch 'mptcp-next' Mat Martineau says: ==================== mptcp: Miscellaneous changes for 5.19 Four separate groups of patches here: Patch 1 optimizes flag checking when releasing mptcp socket locks. Patches 2 and 3 update the packet scheduler when subflow priorities change. Patch 4 adds some pernet helper functions for MPTCP. Patches 5-8 add diag support for MPTCP listeners, including a selftest. ==================== Signed-off-by: David S. Miller commit f2ae0fa68e28f53df245c0d9e4c7a7db6d58638d Author: Florian Westphal Date: Fri Apr 8 12:46:01 2022 -0700 selftests/mptcp: add diag listen tests Check dumping of mptcp listener sockets: 1. filter by dport should not return any results 2. filter by sport should return listen sk 3. filter by saddr+sport should return listen sk 4. no filter should return listen sk Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4fa39b701ce9be7ec2169f7fba4f8dc1a3b92aac Author: Florian Westphal Date: Fri Apr 8 12:46:00 2022 -0700 mptcp: listen diag dump support makes 'ss -Ml' show mptcp listen sockets. Iterate over the tcp listen sockets and pick those that have mptcp ulp info attached. mptcp_diag_get_info() is modified to prefer msk->first for mptcp sockets in listen state. This reports accurate number for recv and send queue (pending / max connection backlog counters). Sample output: ss -Mil State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 20 127.0.0.1:12000 0.0.0.0:* subflows_max:2 Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit e8887b716142e41d5b975309a96fdcbe8e5bd698 Author: Florian Westphal Date: Fri Apr 8 12:45:59 2022 -0700 mptcp: remove locking in mptcp_diag_fill_info Problem is that listener iteration would call this from atomic context so this locking is not allowed. One way is to drop locks before calling the helper, but afaics the lock isn't really needed, all values are fetched via READ_ONCE(). Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 6b9ea5c81ea2bed80dc98a38d475124a87e7ab5d Author: Florian Westphal Date: Fri Apr 8 12:45:58 2022 -0700 mptcp: diag: switch to context structure Raw access to cb->arg[] is deprecated, use a context structure. Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit c682bf536cf4fd8bb5395f9b7147233087107793 Author: Geliang Tang Date: Fri Apr 8 12:45:57 2022 -0700 mptcp: add pm_nl_pernet helpers This patch adds two pm_nl_pernet related helpers, named pm_nl_get_pernet() and pm_nl_get_pernet_from_msk() to get pm_nl_pernet from 'net' or 'msk'. Use these helpers instead of using net_generic() directly. Suggested-by: Florian Westphal Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 0e203c324752e13d22624ab7ffafe934fa06ab50 Author: Paolo Abeni Date: Fri Apr 8 12:45:56 2022 -0700 mptcp: reset the packet scheduler on PRIO change Similar to the previous patch, for priority changes requested by the local PM. Reported-and-suggested-by: Davide Caratti Fixes: 067065422fcd ("mptcp: add the outgoing MP_PRIO support") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 43f5b111d1ff16161ce60e19aeddb999cb6f0b01 Author: Paolo Abeni Date: Fri Apr 8 12:45:55 2022 -0700 mptcp: reset the packet scheduler on incoming MP_PRIO When an incoming MP_PRIO option changes the backup status of any subflow, we need to reset the packet scheduler status, or the next send could keep using the previously selected subflow, without taking in account the new priorities. Reported-by: Davide Caratti Fixes: 40453a5c61f4 ("mptcp: add the incoming MP_PRIO support") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 65a569b03ca832ebc93ce45a7466137e2bb62254 Author: Paolo Abeni Date: Fri Apr 8 12:45:54 2022 -0700 mptcp: optimize release_cb for the common case The mptcp release callback checks several flags in atomic context, but only MPTCP_CLEAN_UNA can be up frequently. Reorganize the code to avoid multiple conditionals in the most common scenarios. Additional clarify a related comment. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4696ad36d76423c56df02b5485a14629dbcbb9af Merge: a21437d2b4855 0c7b27616fbd6 Author: David S. Miller Date: Mon Apr 11 11:47:58 2022 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next: 1) Replace unnecessary list_for_each_entry_continue() in nf_tables, from Jakob Koschel. 2) Add struct nf_conntrack_net_ecache to conntrack event cache and use it, from Florian Westphal. 3) Refactor ctnetlink_dump_list(), also from Florian. 4) Bump module reference counter on cttimeout object addition/removal, from Florian. 5) Consolidate nf_log MAC printer, from Phil Sutter. 6) Add basic logging support for unknown ethertype, from Phil Sutter. 7) Consolidate check for sysctl nf_log_all_netns toggle, also from Phil. 8) Replace hardcode value in nft_bitwise, from Jeremy Sowden. 9) Rename BASIC-like goto tags in nft_bitwise to more meaningful names, also from Jeremy. 10) nft_fib support for reverse path filtering with policy-based routing on iif. Extend selftests to cover for this new usecase, from Florian. ==================== Signed-off-by: David S. Miller commit 9d18f81b35355f63a39b04869d0a013194925d1a Author: Geert Uytterhoeven Date: Tue Mar 29 11:44:26 2022 +0200 clk: renesas: r8a77995: Add RPC clocks Describe the various clocks used by the SPI Multi I/O Bus Controller (RPC-IF) on the R-Car D3 SoC: RPCSRC internal clock, RPC{,D2} clocks derived from it, and RPC-IF module clock. The RPCSRC clock divider on R-Car D3 is very similar to the one on R-Car E3, but uses a different pre-divider for the PLL0 parent. Add a new macro to describe it, reusing the existing clock type for R-Car E3. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/3fd1e886b7737cd0e199603bae81d01be9dcf3aa.1648546700.git.geert+renesas@glider.be commit 0c7b27616fbd64b3b86c59ad5441f82a1a0c4176 Author: Florian Westphal Date: Thu Mar 31 15:46:52 2022 +0200 selftests: netfilter: add fib expression forward test case Its now possible to use fib expression in the forward chain (where both the input and output interfaces are known). Add a simple test case for this. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit be8be04e5ddb9842d4ff2c1e4eaeec6ca801c573 Author: Pablo Neira Ayuso Date: Thu Mar 31 17:14:47 2022 +0200 netfilter: nft_fib: reverse path filter for policy-based routing on iif If policy-based routing using the iif selector is used, then the fib expression fails to look up for the reverse path from the prerouting hook because the input interface cannot be inferred. In order to support this scenario, extend the fib expression to allow to use after the route lookup, from the forward hook. This patch also adds support for the input hook for usability reasons. Since the prerouting hook cannot be used for the scenario described above, users need two rules: one for the forward chain and another rule for the input chain to check for the reverse path check for locally targeted traffic. Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2a214607e4a335f9ebfb08ae3bf7f2c905a0c9c9 Author: Geert Uytterhoeven Date: Tue Mar 29 11:44:25 2022 +0200 clk: renesas: r8a77990: Add RPC clocks Describe the various clocks used by the SPI Multi I/O Bus Controller (RPC-IF) on the R-Car E3 SoC: RPCSRC internal clock, RPC{,D2} clocks derived from it, and RPC-IF module clock. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/3295013f27f1e4b8fbf3f79b950d65157ea95ef2.1648546700.git.geert+renesas@glider.be commit 713c4ff8859c3db4dc8dbf5eec33434b9a3fb76b Author: Borislav Petkov Date: Tue Mar 8 18:05:43 2022 +0100 EDAC/mc: Get rid of edac_align_ptr() Get rid of it now that it is unused. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220310095254.1510-6-bp@alien8.de commit 599fdfddc8fcdde92b41444613549ff99cff7adb Author: Geert Uytterhoeven Date: Thu Feb 3 16:26:49 2022 +0100 arm64: dts: renesas: spider: Add Ethernet sub-board Add a DTS file for the Spider Ether TSN sub-board (RTP8A779F0ASKB0ST0S), and include it from the main r8a779f0-spider.dts. For now its contents are limited to the Board ID EEPROM. Extracted from a larger patch in the BSP by LUU HOAI. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/5aa58816182b34d9e5795bc1e22784f4e4879d13.1643898884.git.geert+renesas@glider.be commit b74d5d65afce4332b2c781c4b252ff9af4885b1f Author: Geert Uytterhoeven Date: Thu Feb 3 16:26:48 2022 +0100 arm64: dts: renesas: spider-cpu: Add I2C4 and EEPROMs Enable the I2C4 bus on the Falcon CPU board, and describe the I2C EEPROMs present on the Spider CPU and BreakOut boards. Extracted from a larger patch in the BSP by LUU HOAI. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/6d8917e49f83b6a932970ca169100eb086d11f16.1643898884.git.geert+renesas@glider.be commit bd04437341962d4bff32a8410d69c4ab974c86d1 Author: Geert Uytterhoeven Date: Thu Feb 3 16:26:47 2022 +0100 arm64: dts: renesas: r8a779f0: Add I2C nodes Add device nodes for the I2C Bus Interfaces on the Renesas R-Car S4-8 (R8A779F0) SoC. Based on a larger patch in the BSP by LUU HOAI. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e1c7fb17801bc82a74aa5364212d02ba51535dd2.1643898884.git.geert+renesas@glider.be commit a21437d2b4855980a15cc9e5dc230f95c7563772 Author: Lv Ruyi Date: Fri Apr 8 09:49:01 2022 +0000 bnx2x: Fix spelling mistake "regiser" -> "register" There are some spelling mistakes in the comments for macro. Fix it. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: David S. Miller commit 0d24a49e88b563608f9a0393cc99bf117e9fba5b Author: Borislav Petkov Date: Tue Mar 8 17:45:40 2022 +0100 EDAC/device: Sanitize edac_device_alloc_ctl_info() definition Shorten argument names, correct formatting, sort local vars in reverse x-mas tree order. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220310095254.1510-5-bp@alien8.de commit 4d65f9b6869a756e89172d858671688349e77671 Author: Felix Fietkau Date: Fri Apr 8 10:59:45 2022 +0200 net: ethernet: mtk_eth_soc/wed: fix sparse endian warnings Descriptor fields are little-endian Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Reported-by: kernel test robot Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 05d51e42df06f0211c7029ab9aa46c492ee85043 Author: Laurent Vivier Date: Wed Apr 6 22:15:23 2022 +0200 m68k: Introduce a virtual m68k machine This machine allows to have up to 3.2 GiB and 128 Virtio devices. It is based on android goldfish devices. Signed-off-by: Laurent Vivier Link: https://lore.kernel.org/r/20220406201523.243733-5-laurent@vivier.eu Signed-off-by: Geert Uytterhoeven commit c92e7ef16400bf035e8b49c7dd091bfce4f99773 Author: Laurent Vivier Date: Wed Apr 6 22:15:22 2022 +0200 clocksource/drivers: Add a goldfish-timer clocksource Add a clocksource based on the goldfish-rtc device. Move the timer register definition to This kernel implementation is based on the QEMU upstream implementation: https://git.qemu.org/?p=qemu.git;a=blob_plain;f=hw/rtc/goldfish_rtc.c goldfish-timer is a high-precision signed 64-bit nanosecond timer. It is part of the 'goldfish' virtual hardware platform used to run some emulated Android systems under QEMU. This timer only supports oneshot event. Signed-off-by: Laurent Vivier Acked-by: Daniel Lezcano Link: https://lore.kernel.org/r/20220406201523.243733-4-laurent@vivier.eu Signed-off-by: Geert Uytterhoeven commit 3378c7f48f497b5ad93a43dcd4f8d406a2609562 Author: Laurent Vivier Date: Wed Apr 6 22:15:21 2022 +0200 rtc: goldfish: Use gf_ioread32()/gf_iowrite32() Replace readl()/writel() by gf_ioread32()/gf_iowrite32() as done for goldfish-tty. Signed-off-by: Laurent Vivier Acked-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220406201523.243733-3-laurent@vivier.eu Signed-off-by: Geert Uytterhoeven commit 2e2ac4a3327479f7e2744cdd88a5c823f2057bad Author: Laurent Vivier Date: Wed Apr 6 22:15:20 2022 +0200 tty: goldfish: Introduce gf_ioread32()/gf_iowrite32() The goldfish TTY device was clearly defined as having little-endian registers, but the switch to __raw_{read,write}l(() broke its driver when running on big-endian kernels (if anyone ever tried this). The m68k qemu implementation got this wrong, and assumed native-endian registers. While this is a bug in qemu, it is probably impossible to fix that since there is no way of knowing which other operating systems have started relying on that bug over the years. Hence revert commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()", and define gf_ioread32()/gf_iowrite32() to be able to use accessors defined by the architecture. Cc: stable@vger.kernel.org # v5.11+ Fixes: da31de35cd2fb78f ("tty: goldfish: use __raw_writel()/__raw_readl()") Signed-off-by: Laurent Vivier Link: https://lore.kernel.org/r/20220406201523.243733-2-laurent@vivier.eu [geert: Add rationale based on Arnd's comments] Signed-off-by: Geert Uytterhoeven commit b559edfaf3f3f3eb726f99f65b181ab310b3d4bc Author: Yang Yingliang Date: Fri Apr 8 11:22:46 2022 +0800 net: ethernet: mtk_eth_soc: fix return value check in mtk_wed_add_hw() If syscon_regmap_lookup_by_phandle() fails, it never return NULL pointer, change the check to IS_ERR(). Fixes: 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 9fb9ce392aae0c6654efc42c80e2f6bab88d5fe3 Author: Borislav Petkov Date: Tue Mar 8 14:16:17 2022 +0100 EDAC/device: Get rid of the silly one-shot memory allocation in edac_device_alloc_ctl_info() Use boring kzalloc() instead. Add pointers to the different allocated members in struct edac_device_ctl_info for easier freeing later. One of the reasons, perhaps, why it was done this way is to be able to do a single kfree(ctl_info) without having to kfree() the other parts of the struct too but that is not nearly a sensible reason as to why there should be this obscure pointer alignment. There should be no functional changes resulting from this. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220310095254.1510-4-bp@alien8.de commit 750d019d700964e8140d7945b7df88f11b2b8c03 Merge: 516a2f1f6f3ce b384c95a861ee Author: David S. Miller Date: Mon Apr 11 10:38:38 2022 +0100 Merge branch 'icmp-skb-reason' Menglong Dong says: ==================== net: icmp: add skb drop reasons to icmp In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()"), we added the support of reporting the reasons of skb drops to kfree_skb tracepoint. And in this series patches, reasons for skb drops are added to ICMP protocol. In order to report the reasons of skb drops in 'sock_queue_rcv_skb()', the function 'sock_queue_rcv_skb_reason()' is introduced in the 1th patch, which is used in the 3th patch. As David Ahern suggested, the reasons for skb drops should be more general and not be code based. Therefore, in the 2th patch, SKB_DROP_REASON_PTYPE_ABSENT is renamed to SKB_DROP_REASON_UNHANDLED_PROTO, which is used for the cases of no L3 protocol handler, no L4 protocol handler, version extensions, etc. In the 3th patch, we introduce the new function __ping_queue_rcv_skb() to report drop reasons by its return value and keep the return value of ping_queue_rcv_skb() still. In the 4th patch, we make ICMP message handler functions return drop reasons, which means we change the return type of 'handler()' in 'struct icmp_control' from 'bool' to 'enum skb_drop_reason'. This changed its original intention, as 'false' means failure, but 'SKB_NOT_DROPPED_YET', which is 0, means success now. Therefore, we have to change all usages of these handler. Following "handler" functions are involved: icmp_unreach() icmp_redirect() icmp_echo() icmp_timestamp() icmp_discard() And following drop reasons are added(what they mean can be see in the document for them): SKB_DROP_REASON_ICMP_CSUM SKB_DROP_REASON_INVALID_PROTO The reason 'INVALID_PROTO' is introduced for the case that the packet doesn't follow rfc 1122 and is dropped. I think this reason is different from the 'UNHANDLED_PROTO', as the 'UNHANDLED_PROTO' means the packet is fine, and it is just not supported. This is not a common case, and I believe we can locate the problem from the data in the packet. For now, this 'INVALID_PROTO' is used for the icmp broadcasts with wrong types. Maybe there should be a document file for these reasons. For example, list all the case that causes the 'INVALID_PROTO' drop reason. Therefore, users can locate their problems according to the document. Changes since v4: - rename SKB_DROP_REASON_RFC_1122 to SKB_DROP_REASON_INVALID_PROTO Changes since v3: - rename SKB_DROP_REASON_PTYPE_ABSENT to SKB_DROP_REASON_UNHANDLED_PROTO in the 2th patch - fix the return value problem of ping_queue_rcv_skb() in the 3th patch - remove SKB_DROP_REASON_ICMP_TYPE and SKB_DROP_REASON_ICMP_BROADCAST and introduce the SKB_DROP_REASON_RFC_1122 in the 4th patch Changes since v2: - fix aliegnment problem in the 2th patch Changes since v1: - introduce __ping_queue_rcv_skb() instead of change the return value of ping_queue_rcv_skb() in the 2th patch, as Paolo suggested ==================== Signed-off-by: David S. Miller commit b384c95a861eebf47e88695cf6a29f34e0b10b0f Author: Menglong Dong Date: Thu Apr 7 14:20:52 2022 +0800 net: icmp: add skb drop reasons to icmp protocol Replace kfree_skb() used in icmp_rcv() and icmpv6_rcv() with kfree_skb_reason(). In order to get the reasons of the skb drops after icmp message handle, we change the return type of 'handler()' in 'struct icmp_control' from 'bool' to 'enum skb_drop_reason'. This may change its original intention, as 'false' means failure, but 'SKB_NOT_DROPPED_YET' means success now. Therefore, all 'handler' and the call of them need to be handled. Following 'handler' functions are involved: icmp_unreach() icmp_redirect() icmp_echo() icmp_timestamp() icmp_discard() And following new drop reasons are added: SKB_DROP_REASON_ICMP_CSUM SKB_DROP_REASON_INVALID_PROTO The reason 'INVALID_PROTO' is introduced for the case that the packet doesn't follow rfc 1122 and is dropped. This is not a common case, and I believe we can locate the problem from the data in the packet. For now, this 'INVALID_PROTO' is used for the icmp broadcasts with wrong types. Maybe there should be a document file for these reasons. For example, list all the case that causes the 'UNHANDLED_PROTO' and 'INVALID_PROTO' drop reason. Therefore, users can locate their problems according to the document. Reviewed-by: Hao Peng Reviewed-by: Jiang Biao Signed-off-by: Menglong Dong Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 41a95a00ebeffd4d735977d8c602d77fb6b3eed2 Author: Menglong Dong Date: Thu Apr 7 14:20:51 2022 +0800 net: icmp: introduce __ping_queue_rcv_skb() to report drop reasons In order to avoid to change the return value of ping_queue_rcv_skb(), introduce the function __ping_queue_rcv_skb(), which is able to report the reasons of skb drop as its return value, as Paolo suggested. Meanwhile, make ping_queue_rcv_skb() a simple call to __ping_queue_rcv_skb(). The kfree_skb() and sock_queue_rcv_skb() used in ping_queue_rcv_skb() are replaced with kfree_skb_reason() and sock_queue_rcv_skb_reason() now. Reviewed-by: Hao Peng Reviewed-by: Jiang Biao Signed-off-by: Menglong Dong Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 9f8ed577c28813410614b418bad42285840c1a00 Author: Menglong Dong Date: Thu Apr 7 14:20:50 2022 +0800 net: skb: rename SKB_DROP_REASON_PTYPE_ABSENT As David Ahern suggested, the reasons for skb drops should be more general and not be code based. Therefore, rename SKB_DROP_REASON_PTYPE_ABSENT to SKB_DROP_REASON_UNHANDLED_PROTO, which is used for the cases of no L3 protocol handler, no L4 protocol handler, version extensions, etc. From previous discussion, now we have the aim to make these reasons more abstract and users based, avoiding code based. Signed-off-by: Menglong Dong Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c1b8a56755ee121f9fa374de9eec36c91a7da25f Author: Menglong Dong Date: Thu Apr 7 14:20:49 2022 +0800 net: sock: introduce sock_queue_rcv_skb_reason() In order to report the reasons of skb drops in 'sock_queue_rcv_skb()', introduce the function 'sock_queue_rcv_skb_reason()'. As the return value of 'sock_queue_rcv_skb()' is used as the error code, we can't make it as drop reason and have to pass extra output argument. 'sock_queue_rcv_skb()' is used in many places, so we can't change it directly. Introduce the new function 'sock_queue_rcv_skb_reason()' and make 'sock_queue_rcv_skb()' an inline call to it. Reviewed-by: Hao Peng Reviewed-by: Jiang Biao Signed-off-by: Menglong Dong Reviewed-by: David Ahern Signed-off-by: David S. Miller commit fb8cd45ca39bdb216e358e36063d8b9962242107 Author: Borislav Petkov Date: Tue Mar 8 08:37:11 2022 +0100 EDAC/pci: Get rid of the silly one-shot memory allocation in edac_pci_alloc_ctl_info() Use boring kzalloc() instead. There should be no functional changes resulting from this. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220310095254.1510-3-bp@alien8.de commit 0bbb265f7089584aaa6d440805ca75ea4f3930d4 Author: Borislav Petkov Date: Sun Feb 20 22:34:54 2022 +0100 EDAC/mc: Get rid of silly one-shot struct allocation in edac_mc_alloc() This has probably meant something at some point but there's no need for it anymore - the struct mem_ctl_info allocation can happen with normal, boring k*alloc() calls like everyone else does it. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220310095254.1510-2-bp@alien8.de commit 51a4a71d974c25dc102216a52462ff6d53eced15 Author: Roger Quadros Date: Sat Mar 26 10:07:26 2022 +0200 mtd: rawnand: omap_elm: Add compatible for AM64 ELM The AM64 SoC has the Error Locator Module. Add compatible id for it. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220326080726.30372-4-rogerq@kernel.org commit 05691c0287886806616a1bb0ecbce6ec5e8f43cc Author: Roger Quadros Date: Sat Mar 26 10:07:25 2022 +0200 dt-bindings: mtd: ti,elm: Add support for AM64 ELM TI's AM64 SoC has the Error Locator Module. Add compatible and related properties to support ELM on AM64 SoC. Signed-off-by: Roger Quadros Reviewed-by: Krzysztof Kozlowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220326080726.30372-3-rogerq@kernel.org commit 6863c612024f92dfba656cc4f74b19d348cfce8f Author: Roger Quadros Date: Sat Mar 26 10:07:24 2022 +0200 dt-bindings: mtd: ti,elm: Convert to yaml Convert elm.txt to ti,elm.yaml. hwmod framework use is deprecated for new platforms so mark it so. Signed-off-by: Roger Quadros Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220326080726.30372-2-rogerq@kernel.org commit adb5680b8dfdd09756f13450bfc1ed874d895935 Author: Kirill A. Shutemov Date: Sun Apr 10 23:00:25 2022 +0300 x86/kaslr: Fix build warning in KASLR code in boot stub lib/kaslr.c is used by both the main kernel and the boot stub. It includes asm/io.h which is supposed to be used in the main kernel. It leads to build warnings like this with clang 13: warning: implicit declaration of function 'outl' is invalid in C99 [-Wimplicit-function-declaration] Replace with which is suitable for both cases. Fixes: 1e8f93e18379 ("x86: Consolidate port I/O helpers") Reported-by: Borislav Petkov Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220410200025.3stf4jjvwfe5oxew@box.shutemov.name commit 908662dc823e5b19eb1efd8c3f2059499e8c8403 Merge: 6b58692032c1d ce522ba9ef7e2 Author: Greg Kroah-Hartman Date: Mon Apr 11 08:43:42 2022 +0200 Merge 5.18-rc2 into staging-next We need the staging fix in here as well. Signed-off-by: Greg Kroah-Hartman commit ba9fe460dc2cfe90dc115b22af14dd3f13cffa0f Author: Krzysztof Kozlowski Date: Thu Apr 7 16:31:54 2022 +0200 ARM: dts: imx: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 3d397a1277853498e8b7b305f2610881357c033f Author: Thorsten Scherer Date: Wed Apr 6 06:39:45 2022 +0200 ARM: dts: ci4x10: Adapt to changes in imx6qdl.dtsi regarding fec clocks Commit f3e7dae323ab ("ARM: dts: imx6qdl: add enet_out clk support") added another item to the list of clocks for the fec device. As imx6dl-eckelmann-ci4x10.dts only overwrites clocks, but not clock-names this resulted in an inconsistency with clocks having one item more than clock-names. Also overwrite clock-names with the same value as in imx6qdl.dtsi. This is a no-op today, but prevents similar inconsistencies if the soc file will be changed in a similar way in the future. Signed-off-by: Thorsten Scherer Reviewed-by: Uwe Kleine-König Fixes: f3e7dae323ab ("ARM: dts: imx6qdl: add enet_out clk support") Signed-off-by: Shawn Guo commit 9498c011f518399f328d460a9647a0df521facce Author: Manivannan Sadhasivam Date: Mon Apr 4 12:12:26 2022 +0530 MAINTAINERS: Update Hemant's email id The codeaurora email domain is no longer available for Qualcomm employees. Qualcomm employees should now use the new email ids from quicinc domain for opensource contributions. So let's use the new email id for Hemant. Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20220404064226.59825-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam commit 52a4a14842ef940e5bab1c949e5adc8f027327dc Author: Chandan Babu R Date: Tue Mar 8 09:34:28 2022 +0000 xfs: Introduce per-inode 64-bit extent counters This commit introduces new fields in the on-disk inode format to support 64-bit data fork extent counters and 32-bit attribute fork extent counters. The new fields will be used only when an inode has XFS_DIFLAG2_NREXT64 flag set. Otherwise we continue to use the regular 32-bit data fork extent counters and 16-bit attribute fork extent counters. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R Suggested-by: Dave Chinner commit 8314bca03a1aa94ad8e7551f13c5664968200e41 Author: Chandan Babu R Date: Tue Mar 8 09:19:46 2022 +0000 xfs: Replace numbered inode recovery error messages with descriptive ones This commit also prints inode fields with invalid values instead of printing addresses of inode and buffer instances. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R Suggested-by: Dave Chinner commit df9ad5cc7a524048ea7ff983d6feeb6d8c47a761 Author: Chandan Babu R Date: Tue Nov 16 09:54:37 2021 +0000 xfs: Introduce macros to represent new maximum extent counts for data/attr forks This commit defines new macros to represent maximum extent counts allowed by filesystems which have support for large per-inode extent counters. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 0c35e7ba18508e9344a1f27b412924bc8b34eba8 Author: Chandan Babu R Date: Tue Nov 16 09:20:01 2021 +0000 xfs: Use uint64_t to count maximum blocks that can be used by BMBT Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 9b7d16e34bbebc0398b1dd4f2d64ae6793fdc5ea Author: Chandan Babu R Date: Tue Nov 16 09:04:43 2021 +0000 xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers This commit adds the new per-inode flag XFS_DIFLAG2_NREXT64 to indicate that an inode supports 64-bit extent counters. This flag is also enabled by default on newly created inodes when the corresponding filesystem has large extent counter feature bit (i.e. XFS_FEAT_NREXT64) set. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 7c05aa9d9d2014937c8dacbd514bca2592b11f48 Author: Chandan Babu R Date: Tue Nov 16 07:56:54 2021 +0000 xfs: Introduce XFS_FSOP_GEOM_FLAGS_NREXT64 XFS_FSOP_GEOM_FLAGS_NREXT64 indicates that the current filesystem instance supports 64-bit per-inode extent counters. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 919819f5e18097e6e888764c30625b1288d416c5 Author: Chandan Babu R Date: Tue Nov 16 08:39:32 2021 +0000 xfs: Introduce XFS_SB_FEAT_INCOMPAT_NREXT64 and associated per-fs feature bit XFS_SB_FEAT_INCOMPAT_NREXT64 incompat feature bit will be set on filesystems which support large per-inode extent counters. This commit defines the new incompat feature bit and the corresponding per-fs feature bit (along with inline functions to work on it). Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 755c38ffe1a5937d8fa03419018f49f3a23fa9a7 Author: Chandan Babu R Date: Tue Nov 16 07:28:40 2021 +0000 xfs: Promote xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits respectively A future commit will introduce a 64-bit on-disk data extent counter and a 32-bit on-disk attr extent counter. This commit promotes xfs_extnum_t and xfs_aextnum_t to 64 and 32-bits in order to correctly handle in-core versions of these quantities. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 1e7384f93db57c2135a9fa176e27b1c72ad860e3 Author: Chandan Babu R Date: Tue Nov 16 07:20:39 2021 +0000 xfs: Use basic types to define xfs_log_dinode's di_nextents and di_anextents A future commit will increase the width of xfs_extnum_t in order to facilitate larger per-inode extent counters. Hence this patch now uses basic types to define xfs_log_dinode->[di_nextents|dianextents]. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit dd95a6ce31d6441dfd5fd3aa5d7208b0fc61782f Author: Chandan Babu R Date: Thu Aug 27 15:34:34 2020 +0530 xfs: Introduce xfs_dfork_nextents() helper This commit replaces the macro XFS_DFORK_NEXTENTS() with the helper function xfs_dfork_nextents(). As of this commit, xfs_dfork_nextents() returns the same value as XFS_DFORK_NEXTENTS(). A future commit which extends inode's extent counter fields will add more logic to this helper. This commit also replaces direct accesses to xfs_dinode->di_[a]nextents with calls to xfs_dfork_nextents(). No functional changes have been made. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit bb1d50494cbdd9c5991ddc7feeeb14982872b2a8 Author: Chandan Babu R Date: Fri Feb 26 11:24:31 2021 +0530 xfs: Use xfs_extnum_t instead of basic data types xfs_extnum_t is the type to use to declare variables which have values obtained from xfs_dinode->di_[a]nextents. This commit replaces basic types (e.g. uint32_t) with xfs_extnum_t for such variables. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 9feb8f19665c8ba051c6a81aa7897149e7748e1e Author: Chandan Babu R Date: Thu Aug 27 15:09:10 2020 +0530 xfs: Introduce xfs_iext_max_nextents() helper xfs_iext_max_nextents() returns the maximum number of extents possible for one of data, cow or attribute fork. This helper will be extended further in a future commit when maximum extent counts associated with data/attribute forks are increased. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 95f0b95e2b686ceaa3f465e9fa079f22e0fe7665 Author: Chandan Babu R Date: Mon Aug 9 12:05:22 2021 +0530 xfs: Define max extent length based on on-disk format definition The maximum extent length depends on maximum block count that can be stored in a BMBT record. Hence this commit defines MAXEXTLEN based on BMBT_BLOCKCOUNT_BITLEN. While at it, the commit also renames MAXEXTLEN to XFS_MAX_BMBT_EXTLEN. Suggested-by: Darrick J. Wong Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 3b0d9fd369ea48419ccb578e0bafa4c54df63ba6 Author: Chandan Babu R Date: Wed Oct 7 15:00:03 2020 +0530 xfs: Move extent count limits to xfs_format.h Maximum values associated with extent counters i.e. Maximum extent length, Maximum data extents and Maximum xattr extents are dictated by the on-disk format. Hence move these definitions over to xfs_format.h. Reviewed-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Chandan Babu R commit 33fc250c3e76f99015f5cdbee1de1dd8500d29cc Merge: d252a4a499a07 451b5fbc2c56f Author: Andrii Nakryiko Date: Sun Apr 10 20:17:16 2022 -0700 Merge branch 'bpf: RLIMIT_MEMLOCK cleanups' Yafang Shao says: ==================== We have switched to memcg-based memory accouting and thus the rlimit is not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in libbpf for backward compatibility, so we can use it instead now. This patchset cleanups the usage of RLIMIT_MEMLOCK in tools/bpf/, tools/testing/selftests/bpf and samples/bpf. The file tools/testing/selftests/bpf/bpf_rlimit.h is removed. The included header sys/resource.h is removed from many files as it is useless in these files. - v4: Squash patches and use customary subject prefixes. (Andrii) - v3: Get rid of bpf_rlimit.h and fix some typos (Andrii) - v2: Use libbpf_set_strict_mode instead. (Andrii) - v1: https://lore.kernel.org/bpf/20220320060815.7716-2-laoar.shao@gmail.com/ ==================== Signed-off-by: Andrii Nakryiko commit 451b5fbc2c56f19f39be4c9e11b3420a0c5f5d3d Author: Yafang Shao Date: Sat Apr 9 12:59:58 2022 +0000 tools/runqslower: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK Explicitly set libbpf 1.0 API mode, then we can avoid using the deprecated RLIMIT_MEMLOCK. Signed-off-by: Yafang Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409125958.92629-5-laoar.shao@gmail.com commit a777e18f1bcd32528ff5dfd10a6629b655b05eb8 Author: Yafang Shao Date: Sat Apr 9 12:59:57 2022 +0000 bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK We have switched to memcg-based memory accouting and thus the rlimit is not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in libbpf for backward compatibility, so we can use it instead now. libbpf_set_strict_mode always return 0, so we don't need to check whether the return value is 0 or not. Signed-off-by: Yafang Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409125958.92629-4-laoar.shao@gmail.com commit b858ba8c52b64c038de156c455a39a89bfd214e8 Author: Yafang Shao Date: Sat Apr 9 12:59:56 2022 +0000 selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK We have switched to memcg-based memory accouting and thus the rlimit is not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in libbpf for backward compatibility, so we can use it instead now. After this change, the header tools/testing/selftests/bpf/bpf_rlimit.h can be removed. This patch also removes the useless header sys/resource.h from many files in tools/testing/selftests/bpf/. Signed-off-by: Yafang Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409125958.92629-3-laoar.shao@gmail.com commit b25acdafd3730110254f8452b113a6311ab5cf2d Author: Yafang Shao Date: Sat Apr 9 12:59:55 2022 +0000 samples/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK We have switched to memcg-based memory accouting and thus the rlimit is not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in libbpf for backward compatibility, so we can use it instead now. This patch also removes the useless header sys/resource.h from many files in samples/bpf. Signed-off-by: Yafang Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409125958.92629-2-laoar.shao@gmail.com commit d252a4a499a07bec21c65873f605c3a1ef52ffed Author: Runqing Yang Date: Sat Apr 9 22:49:28 2022 +0800 libbpf: Fix a bug with checking bpf_probe_read_kernel() support in old kernels Background: Libbpf automatically replaces calls to BPF bpf_probe_read_{kernel,user} [_str]() helpers with bpf_probe_read[_str](), if libbpf detects that kernel doesn't support new APIs. Specifically, libbpf invokes the probe_kern_probe_read_kernel function to load a small eBPF program into the kernel in which bpf_probe_read_kernel API is invoked and lets the kernel checks whether the new API is valid. If the loading fails, libbpf considers the new API invalid and replaces it with the old API. static int probe_kern_probe_read_kernel(void) { struct bpf_insn insns[] = { BPF_MOV64_REG(BPF_REG_1, BPF_REG_10), /* r1 = r10 (fp) */ BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -8), /* r1 += -8 */ BPF_MOV64_IMM(BPF_REG_2, 8), /* r2 = 8 */ BPF_MOV64_IMM(BPF_REG_3, 0), /* r3 = 0 */ BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_probe_read_kernel), BPF_EXIT_INSN(), }; int fd, insn_cnt = ARRAY_SIZE(insns); fd = bpf_prog_load(BPF_PROG_TYPE_KPROBE, NULL, "GPL", insns, insn_cnt, NULL); return probe_fd(fd); } Bug: On older kernel versions [0], the kernel checks whether the version number provided in the bpf syscall, matches the LINUX_VERSION_CODE. If not matched, the bpf syscall fails. eBPF However, the probe_kern_probe_read_kernel code does not set the kernel version number provided to the bpf syscall, which causes the loading process alwasys fails for old versions. It means that libbpf will replace the new API with the old one even the kernel supports the new one. Solution: After a discussion in [1], the solution is using BPF_PROG_TYPE_TRACEPOINT program type instead of BPF_PROG_TYPE_KPROBE because kernel does not enfoce version check for tracepoint programs. I test the patch in old kernels (4.18 and 4.19) and it works well. [0] https://elixir.bootlin.com/linux/v4.19/source/kernel/bpf/syscall.c#L1360 [1] Closes: https://github.com/libbpf/libbpf/issues/473 Signed-off-by: Runqing Yang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409144928.27499-1-rainkin1993@gmail.com commit 61ddff373ffa843155eba6a507973b1b78bb5a14 Author: Mykola Lysenko Date: Fri Apr 8 17:17:49 2022 -0700 selftests/bpf: Improve by-name subtest selection logic in prog_tests Improve subtest selection logic when using -t/-a/-d parameters. In particular, more than one subtest can be specified or a combination of tests / subtests. -a send_signal -d send_signal/send_signal_nmi* - runs send_signal test without nmi tests -a send_signal/send_signal_nmi*,find_vma - runs two send_signal subtests and find_vma test -a 'send_signal*' -a find_vma -d send_signal/send_signal_nmi* - runs 2 send_signal test and find_vma test. Disables two send_signal nmi subtests -t send_signal -t find_vma - runs two *send_signal* tests and one *find_vma* test This will allow us to have granular control over which subtests to disable in the CI system instead of disabling whole tests. Also, add new selftest to avoid possible regression when changing prog_test test name selection logic. Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220409001750.529930-1-mykolal@fb.com commit e270356944ccba0a9c23b4d0751d2e029184ad21 Author: Jonathan Lassoff Date: Mon Apr 11 13:06:39 2022 +1000 xfs: Add XFS messages to printk index In order for end users to quickly react to new issues that come up in production, it is proving useful to leverage the printk indexing system. This printk index enables kernel developers to use calls to printk() with changeable format strings (as they always have; no change of expectations), while enabling end users to examine format strings to detect changes. Since end users are using regular expressions to match messages printed through printk(), being able to detect changes in chosen format strings from release to release provides a useful signal to review printk()-matching regular expressions for any necessary updates. So that detailed XFS messages are captures by this printk index, this patch wraps the xfs_ and xfs_alert_tag functions. Signed-off-by: Jonathan Lassoff Reviewed-by: Chris Down Reviewed-by: Petr Mladek Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit e60aa787f43f1e469632b8719e3e3ab1d9e7b720 Author: Jonathan Lassoff Date: Mon Apr 11 13:06:28 2022 +1000 xfs: Simplify XFS logging methods. Rather than have a constructor to define many nearly-identical functions, use preprocessor macros to pass down a kernel logging level to a common function. Signed-off-by: Jonathan Lassoff Reviewed-by: Chris Down Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner commit c14faabf5364c5b1be115bbc660310966ca7371f Author: Xiaomeng Tong Date: Thu Mar 31 16:30:18 2022 +0800 opp: use list iterator only inside the loop 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 dedicated pointer variable [1]. In this case, use a new variable 'iter' as the list iterator, while use the old variable 'new_dev' as a dedicated pointer to point to the found entry. And BUG_ON(!new_dev);. [1]: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Xiaomeng Tong Signed-off-by: Viresh Kumar commit 95073b721c03c0438b7ee692c20ad2075d3a937a Author: Jakob Koschel Date: Thu Mar 24 08:18:15 2022 +0100 opp: 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/ Signed-off-by: Jakob Koschel Signed-off-by: Viresh Kumar commit 543256d239b4156bf5817049fb92138f6661f15f Author: Krzysztof Kozlowski Date: Fri Apr 8 13:10:52 2022 +0200 PM: opp: simplify with dev_err_probe() Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar commit 907ed123b9d096c73e9361f6cd4097f0691497f2 Author: Dan Carpenter Date: Wed Apr 6 09:40:14 2022 +0300 OPP: call of_node_put() on error path in _bandwidth_supported() This code does not call of_node_put(opp_np) if of_get_next_available_child() returns NULL. But it should. Fixes: 45679f9b508f ("opp: Don't parse icc paths unnecessarily") Signed-off-by: Dan Carpenter Signed-off-by: Viresh Kumar commit a39ed23bdf6ec7eb0f093b6ef0391e1f3d152f71 Author: Marcel Ziswiler Date: Fri Apr 8 16:57:25 2022 +0200 arm64: dts: freescale: add initial support for verdin imx8m plus This patch adds the device tree to support Toradex Verdin iMX8M Plus [1] a computer on module which can be used on different carrier boards. The module consists of an NXP i.MX 8M Plus family SoC (either i.MX 8M Plus Quad or 8M Plus QuadLite), a PCA9450C PMIC, a Gigabit Ethernet PHY, 1, 2, 4 or 8 GB of LPDDR4 RAM, an eMMC, a TLA2024 ADC, an I2C EEPROM, an RX8130 RTC, an optional I2C temperature sensor plus an optional Bluetooth/Wi-Fi module. Anything that is not self-contained on the module is disabled by default. The device tree for the Dahlia includes the module's device tree and enables the supported peripherals of the carrier board. The device tree for the Verdin Development Board includes the module's device tree as well as the Dahlia one as it is a superset and supports almost all peripherals available. So far there is no display functionality supported at all but basic console UART, USB host, eMMC and Ethernet functionality work fine. [1] https://www.toradex.com/computer-on-modules/verdin-arm-family/nxp-imx-8m-plus Signed-off-by: Marcel Ziswiler Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: Shawn Guo commit a00f1fa615803cfe5eeb834fc411ab6c560b1952 Author: Marcel Ziswiler Date: Fri Apr 8 16:57:23 2022 +0200 arm64: dts: imx8mp: add uart2 dma Add DMA properties to uart2 node. Signed-off-by: Marcel Ziswiler Reviewed-by: Laurent Pinchart Signed-off-by: Shawn Guo commit 0738599856542bab0ebcd73cab9d8f15bddedcee Author: Vladimir Isaev Date: Sat Apr 9 01:44:42 2022 +0300 libbpf: Add ARC support to bpf_tracing.h Add PT_REGS macros suitable for ARCompact and ARCv2. Signed-off-by: Vladimir Isaev Signed-off-by: Sergey Matyukevich Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220408224442.599566-1-geomatsi@gmail.com commit aba3a3fb8ebc8672288f287176286d39abcd7515 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:31:55 2022 +0200 arm64: dts: freescale: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 7cbeeb0553615d4c8beaab36170f26b138f718ee Author: Kuldeep Singh Date: Sun Apr 3 00:38:55 2022 +0530 arm64: dts: lx2160a: Update can node property fsl,clk-source property is of type uint8 and need to be defined as "/bits/ 8 <0>". Simply setting value to 0 raise warning: can@2180000: fsl,clk-source:0: [0, 0, 0, 0] is too long Signed-off-by: Kuldeep Singh Signed-off-by: Shawn Guo commit 73d901d6dc6158e3a7474b184f319260a2ebc921 Author: Michael Walle Date: Wed Mar 30 13:34:42 2022 +0200 arm64: dts: ls1028a: default to OTG mode for USB At the moment, the dtsi will force the dr_mode to host. This is problematic because it will always turn on the Vbus voltage regardless if the port is host or device. This might lead to a "shortcut" between the two USB endpoints because both might have their Vbus supplies enabled. Therefore, the default should be "otg" for any ports which aren't host only (from a SoC point of view) and have a user of the dtsi file overwrite that explicitly. Move the 'dr_mode = "host";' into the board dts. Now that the dtsi doesn't set the dr_mode anymore, we can also drop the 'dr_mode = "otg";' in the board dts because that is the default value if dr_mode is not set. Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit be0b178c50c37a666d54f435da71cf9f008362a0 Author: Michael Walle Date: Wed Mar 30 13:33:29 2022 +0200 arm64: dts: ls1028a: sl28: use ocelot-8021q tagging by default Enable the ocelot-8021q tagger by default which supports ethernet flow control. The new default is set in the common board dtsi. The actual switch node is enabled on a per board variant basis. Because of this we set the new tagger default for both internal ports and a particular variant is free to choose among the two port. Signed-off-by: Michael Walle Reviewed-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 4f6b5de98560d27638dea2b43d9a97fa88b79e4b Author: Marcel Ziswiler Date: Thu Mar 24 16:56:49 2022 +0100 arm64: dts: imx8mm-verdin: add sd1 sleep pinctrl Add SD1 sleep pinctrl to avoid backfeeding during sleep. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit f84ccff6d8f34b7b1513411bcb172e8c903fc14e Author: Marcel Ziswiler Date: Thu Mar 24 16:56:48 2022 +0100 arm64: dts: imx8mm-verdin: note about disabled sd1 pull-ups Add a note about us using discrete external on-module resistors pulling-up to the on-module +V3.3_1.8_SD (LDO5) rail and explicitly disabling the internal pull-ups due to ERR050080 [1]: IO: Degradation of internal IO pullup/pulldown current capability for IO’s continuously driven in a 3.3V operating mode [1] https://www.nxp.com/webapp/Download?colCode=IMX8MM_0N87W Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 473b34b8ce38f02b7b0c0272b90e30c99d8d4fdd Author: Marcel Ziswiler Date: Thu Mar 24 16:56:47 2022 +0100 arm64: dts: imx8mm-verdin: capitalisation of verdin comments Fix capitalisation of Verdin in comments. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 593c535b0ddcc48325c1199549afcae74ccbfb96 Author: Marcel Ziswiler Date: Thu Mar 24 16:56:46 2022 +0100 arm64: dts: imx8mm-verdin: re-order pinctrl groups Alphabetically re-order pinctrl groups. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 60f01b5b5c7df32360329aea9b455d13b76d2a5f Author: Marcel Ziswiler Date: Thu Mar 24 16:56:45 2022 +0100 arm64: dts: imx8mm-verdin: update iomux configuration Update IOMUX configuration as required by the hardware design team. Signed-off-by: Andrejs Cainikovs Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 79c1c8509cbc3ce586fa7903cb1f9905b9f8326d Author: Marcel Ziswiler Date: Thu Mar 24 16:56:44 2022 +0100 arm64: dts: imx8mm-verdin: comment about i2c level shifter Add a note about the bootloader being expected to switch on the I2C level shifter for the TLA2024 ADC behind this PMIC. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 9847725e3a775832376646907159ce644d90bb18 Author: Marcel Ziswiler Date: Thu Mar 24 16:56:43 2022 +0100 arm64: dts: imx8mm-verdin: only dashes in node names Make sure we only have dashes rather than underscores in node names by renaming ctrl_sleep_moci-hog to ctrl-sleep-moci-hog. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 344acf05d89ff9a5d3e3d047d36d328efc799fee Author: Marcel Ziswiler Date: Thu Mar 24 16:56:42 2022 +0100 arm64: dts: imx8mm-verdin: alphabetically re-order nodes Alphabetically re-order nodes. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 98e4f1930ef1561042a1be3b3b4fef7c3c271729 Author: Marcel Ziswiler Date: Thu Mar 24 16:56:41 2022 +0100 arm64: dts: imx8mm-verdin: multi-line comment style Fix multi-line comment style. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 97a07703cf9674823f4432facc0fbcbaed683eeb Author: Marcel Ziswiler Date: Thu Mar 24 16:56:40 2022 +0100 arm64: dts: imx8mm-verdin: update regulator names Annotate regulators which are on-module. Rename usb_otg{1/2}_vbus to USB_{1/2}_EN more in-line with Verdin spec. Annotate PMIC regulators with information on which BUCK/LDO they are on. Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 68b7cf5d91d4c7e8a690693a53738e66d60113f1 Author: Sherry Sun Date: Mon Mar 21 15:51:31 2022 +0800 arm64: dts: imx8mp: add ddr controller node to support EDAC on imx8mp i.MX8MP use synopsys V3.70a ddr controller IP, so add edac support for i.MX8MP based on "snps,ddrc-3.80a" synopsys edac driver. Signed-off-by: Sherry Sun Acked-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 21a14c68f3a34e1ad06d05c153446644fefa748b Author: Marek Vasut Date: Fri Mar 11 18:23:52 2022 +0100 arm64: dts: imx8mp: Add cpu-freq support Add A53 OPP table and cpu regulator to support cpu-freq driver. Signed-off-by: Marek Vasut Cc: Anson Huang Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 9ad9773e89f8e06148b2a0e77fcdcd716f8f3b18 Author: Marek Vasut Date: Fri Mar 11 18:23:51 2022 +0100 arm64: dts: imx8mp: Add missing speed grade phandle And missing speed grade phandle to cpu@0 node. Signed-off-by: Marek Vasut Cc: Anson Huang Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Signed-off-by: Shawn Guo commit 94382f08702efdd6b6bb3e875726942954a723d3 Author: Uwe Kleine-König Date: Fri Mar 25 18:19:55 2022 +0100 ARM: dts: imx6qdl-tx6: Drop some duplicated properties clocks and clock-names are already present in imx6qdl.dtsi since commit f3e7dae323ab ("ARM: dts: imx6qdl: add enet_out clk support"). The change to imx6qdl.dtsi was explicitly done to avoid this construct in this file, so benefit from the change and drop these properties. Signed-off-by: Uwe Kleine-König Signed-off-by: Shawn Guo commit 4f1a22ee7b576a38dc5705837c9b0de0c7b5b064 Author: John Garry Date: Fri Apr 8 17:04:12 2022 +0800 libata: Improve ATA queued command allocation Improve ATA queued command allocation as follows: - For attaining a qc tag for a SAS host we need to allocate a bit in ata_port.sas_tag_allocated bitmap. However we already have a unique tag per device in range [0, ATA_MAX_QUEUE -1] in the scsi cmnd budget token, so just use that instead. - It is a bit pointless to have ata_qc_new_init() in libata-core.c since it pokes scsi internals, so inline it in ata_scsi_qc_new() (in libata-scsi.c). Also update Doc accordingly. - Use standard SCSI helpers set_host_byte() and set_status_byte() in ata_scsi_qc_new(). Christoph Hellwig originally contributed the change to inline ata_qc_new_init(). Signed-off-by: John Garry Reviewed-by: Christoph Hellwig Signed-off-by: Damien Le Moal commit c956b92ee19b978bd8da50e30271a0a4c62bea28 Author: Christophe Leroy Date: Fri Apr 1 19:18:36 2022 +0200 ata: pata_mpc52xx: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 53070cfa8228bdc64148d1e8c76c9f97ed0dfd62 Author: Johan Jonker Date: Wed Mar 30 15:39:52 2022 +0200 ARM: dts: rockchip: rename pcfg_pull_default node name on rk3036 Rename pcfg_pull_default node name so that it fits the regex. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220330133952.1949-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit c2a911d302b0d014a4d0d732a2bfc319e643eb62 Author: Yury Norov Date: Thu Feb 10 14:49:09 2022 -0800 x86/mm: Replace nodes_weight() with nodes_empty() where appropriate Various mm code calls nodes_weight() to check if any bit of a given nodemask is set. This can be done more efficiently with nodes_empty() because nodes_empty() stops traversing the nodemask as soon as it finds first set bit, while nodes_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220210224933.379149-26-yury.norov@gmail.com commit 3a5ff1f6dd50f5e1c2aa87491910dd6d275af24b Author: Yury Norov Date: Thu Feb 10 14:49:00 2022 -0800 x86: Replace cpumask_weight() with cpumask_empty() where appropriate In some cases, x86 code calls cpumask_weight() to check if any bit of a given cpumask is set. This can be done more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Signed-off-by: Thomas Gleixner Reviewed-by: Steve Wahl Link: https://lore.kernel.org/r/20220210224933.379149-17-yury.norov@gmail.com commit 8afbcaf8690dac19ebf570a4e4fef9c59c75bf8e Author: Yury Norov Date: Thu Feb 10 14:49:07 2022 -0800 clocksource: Replace cpumask_weight() with cpumask_empty() clocksource_verify_percpu() calls cpumask_weight() to check if any bit of a given cpumask is set. This can be done more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220210224933.379149-24-yury.norov@gmail.com commit 0de61d739c21003201a0adb1f5c403f89a7c2441 Author: Yury Norov Date: Thu Feb 10 14:49:04 2022 -0800 irqchip/bmips: Replace cpumask_weight() with cpumask_empty() bcm6345_l1_of_init() calls cpumask_weight() to check if any bit of a given cpumask is set. This can be done more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Signed-off-by: Thomas Gleixner Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220210224933.379149-21-yury.norov@gmail.com commit 911488de0565f1d53bd36174d20917ebc4b44c0e Author: Yury Norov Date: Thu Feb 10 14:49:05 2022 -0800 genirq/affinity: Replace cpumask_weight() with cpumask_empty() where appropriate __irq_build_affinity_masks() calls cpumask_weight() to check if any bit of a given cpumask is set. This can be done more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220210224933.379149-22-yury.norov@gmail.com commit 3f893a5962d31c0164efdbf6174ed0784f1d7603 Author: Marc Zyngier Date: Tue Apr 5 19:50:40 2022 +0100 irqchip/gic-v3: Always trust the managed affinity provided by the core code Now that the core code has been fixed to always give us an affinity that only includes online CPUs, directly use this affinity when computing a target CPU. Signed-off-by: Marc Zyngier Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220405185040.206297-4-maz@kernel.org commit 33de0aa4bae982ed6f7c777f86b5af3e627ac937 Author: Marc Zyngier Date: Tue Apr 5 19:50:39 2022 +0100 genirq: Always limit the affinity to online CPUs When booting with maxcpus= (or even loading a driver while most CPUs are offline), it is pretty easy to observe managed affinities containing a mix of online and offline CPUs being passed to the irqchip driver. This means that the irqchip cannot trust the affinity passed down from the core code, which is a bit annoying and requires (at least in theory) all drivers to implement some sort of affinity narrowing. In order to address this, always limit the cpumask to the set of online CPUs. Signed-off-by: Marc Zyngier Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220405185040.206297-3-maz@kernel.org commit d802057c7c553ad426520a053da9f9fe08e2c35a Author: Marc Zyngier Date: Tue Apr 5 19:50:38 2022 +0100 genirq/msi: Shutdown managed interrupts with unsatifiable affinities When booting with maxcpus=, interrupt controllers such as the GICv3 ITS may not be able to satisfy the affinity of some managed interrupts, as some of the HW resources are simply not available. The same thing happens when loading a driver using managed interrupts while CPUs are offline. In order to deal with this, do not try to activate such interrupt if there is no online CPU capable of handling it. Instead, place it in shutdown state. Once a capable CPU shows up, it will be activated. Reported-by: John Garry Reported-by: David Decotigny Signed-off-by: Marc Zyngier Signed-off-by: Thomas Gleixner Tested-by: John Garry Link: https://lore.kernel.org/r/20220405185040.206297-2-maz@kernel.org commit f9814e2ef9056fd919e774e95f721e12420648e6 Author: Philip Rinn Date: Thu Apr 7 17:51:45 2022 +0200 arm64: dts: allwinner: a64: olinuxino: Enable audio Enable the audio hardware on the Olimex A64-OLinuXino board family. Tested on the A64-OLinuXino-2Ge8G-IND variant. Signed-off-by: Philip Rinn Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220407155145.10891-1-rinni@inventati.org commit 80bc6f34c559c97069b75d6eb453d4218c3ed017 Author: Lin Huang Date: Tue Mar 8 11:08:58 2022 -0800 arm64: dts: rockchip: Enable dmc and dfi nodes on gru Enable the DMC (Dynamic Memory Controller) and the DFI (DDR PHY Interface) nodes on gru boards so we can support DDR DVFS. Signed-off-by: Lin Huang Signed-off-by: Enric Balletbo i Serra Signed-off-by: Gaël PORTAY Signed-off-by: Daniel Lezcano Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220308110825.v4.12.I3a5c7f21ecd8221b42c2dbcd618386bce7b3e9a6@changeid Signed-off-by: Heiko Stuebner commit 1b3f36854ab74839693582bc957930f4416ce8ff Author: Lin Huang Date: Tue Mar 8 11:08:57 2022 -0800 arm64: dts: rockchip: Add dfi and dmc nodes to rk3399 These are required to support DDR DVFS on RK3399 platforms. Change since Daniel's posting: reordered by unit address, per existing style Signed-off-by: Lin Huang Signed-off-by: Enric Balletbo i Serra Signed-off-by: Gaël PORTAY Signed-off-by: Daniel Lezcano Signed-off-by: Brian Norris Link: https://lore.kernel.org/r/20220308110825.v4.11.Ie97993621975c5463d7928a8646f3737c9f2921d@changeid Signed-off-by: Heiko Stuebner commit 14fc86b9aa5435bf7dd75839c9a73d9a85a98396 Author: Johan Jonker Date: Tue Mar 29 17:07:42 2022 +0200 arm64: dts: rockchip: add clocks property to cru nodes rk3399 Add clocks property to rk3399 cru nodes to fix warnings like: 'clocks' is a dependency of 'assigned-clocks'. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329150742.22093-6-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit e03774ff21493f4f82ec7853b33fb3ccc35e4363 Author: Johan Jonker Date: Tue Mar 29 17:07:41 2022 +0200 arm64: dts: rockchip: use generic node name for pmucru on rk3399 The node names should be generic, so fix this for the rk3399 pmucru node and rename it to "clock-controller". Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329150742.22093-5-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 7adc1b98bb6e6611bc9122de77737b193b693122 Author: Johan Jonker Date: Tue Mar 29 17:07:40 2022 +0200 dt-bindings: clock: fix rk3399 cru clock issues The current rk3399 cru DT node gives warnings like: 'clocks' is a dependency of 'assigned-clocks'. With the YAML conversion somehow "assigned-xxx" properties where added. If a proper clock is added to the cru node these properties are no longer needed, so removed them. Currently only one clock will be added, so limit the clock maxItems to 1. Add a clock name to be able to differentiate and filter bogus entries. Signed-off-by: Johan Jonker Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329150742.22093-4-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 91154f0cd889ed3772a0ac0e24ee363f93fe784c Author: Johan Jonker Date: Tue Mar 29 17:07:39 2022 +0200 dt-bindings: clock: use generic node name for pmucru example in rockchip,rk3399-cru.yaml The node names should be generic, so fix this for the pmucru node example in the rockchip,rk3399-cru.yaml file and rename it to "clock-controller". Signed-off-by: Johan Jonker Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329150742.22093-3-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 50cfde33494072c74bf39a0c281cfa0c3289bd57 Author: Johan Jonker Date: Tue Mar 29 17:07:38 2022 +0200 dt-bindings: clock: replace a maintainer for rockchip,rk3399-cru.yaml With the rk3399 cru YAML conversion the original text author was somehow added as a maintainer, but who's currently no longer involved on the subject. Replace this position with the Rockchip clock maintainer on her request. Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/20220329150742.22093-2-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 04d3e427148f8ed7322f70e324731c81460671df Author: Johan Jonker Date: Tue Mar 29 17:07:37 2022 +0200 dt-bindings: clock: fix some conversion style issues for rockchip,rk3399-cru.yaml With the conversion of rockchip,rk3399-cru.txt a table with external clocks was copied. Make it a bit cleaner by aligning the columns. Also fix a description. Phrases start with a capital. Signed-off-by: Johan Jonker Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220329150742.22093-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 551e645fed5dd2ed4c81c9e3d3b4827862f51dc6 Author: Frank Wunderlich Date: Sat Apr 9 13:21:36 2022 +0200 arm64: dts: rockchip: Add SATA support to BPI-R2-Pro Enable the Combphy and Sata nodes in Bananapi R2 Pro Board. Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220409112136.164481-3-linux@fw-web.de Signed-off-by: Heiko Stuebner commit f29ffce32b4e1204b67f82fd80584ec4173cca54 Author: Frank Wunderlich Date: Sat Apr 9 13:21:35 2022 +0200 arm64: dts: rockchip: Add USB nodes for BPI-R2-Pro Add usb2 nodes to Bananapi R2 Pro board Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220409112136.164481-2-linux@fw-web.de Signed-off-by: Heiko Stuebner commit d6cfb110b0fdfb4e61ef4e3c3ab89a8f21b4d1b8 Author: Michael Riesch Date: Fri Apr 8 11:12:37 2022 -0400 arm64: dts: rockchip: add usb3 support to rk3568-evb1-v10 The Rockchip RK3568 EVB1 features one USB 3.0 device-only (USB 2.0 OTG) port and one USB 3.0 host-only port. Activate the USB 3.0 controller nodes and phy nodes in the device tree. Signed-off-by: Sascha Hauer Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220408151237.3165046-6-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit e432309ff8bf2a148bbdd4946ca1580c6b5b610c Author: Peter Geis Date: Fri Apr 8 11:12:36 2022 -0400 arm64: dts: rockchip: enable dwc3 on quartz64-a The quartz64 model a has support for both the dwc3 otg port and the dwc3 host port. Add the otg power supply and dwc3 nodes to the device tree to enable support for these. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220408151237.3165046-5-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 9f4c480f24e2ce1d464ff9d5f8a249a485acdc7f Author: Peter Geis Date: Fri Apr 8 11:12:35 2022 -0400 arm64: dts: rockchip: add rk356x dwc3 usb3 nodes Add the dwc3 device nodes to the rk356x device trees. The rk3566 has one usb2 capable dwc3 otg controller and one usb3 capable dwc3 host controller. The rk3568 has one usb3 capable dwc3 otg controller and one usb3 capable dwc3 host controller. Signed-off-by: Peter Geis Tested-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220408151237.3165046-4-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 5c0bb71138770d85ea840acd379edc6471b867ee Author: Peter Geis Date: Fri Apr 8 11:12:34 2022 -0400 soc: rockchip: set dwc3 clock for rk3566 The rk3566 dwc3 otg port clock is unavailable at boot, as it defaults to the combophy as the clock source. As combophy0 doesn't exist on rk3566, we need to set the clock source to the usb2 phy instead. Add handling to the grf driver to handle this on boot. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220408151237.3165046-3-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 2a872dd86eeb349f169df0a204668afa578a94b2 Author: Peter Geis Date: Fri Apr 8 11:12:33 2022 -0400 dt-bindings: soc: rockchip: add rk3566-pipe-grf compatible The rk3566 requires special handling for the dwc3-otg clock in order for the port to function correctly. Add a binding for the rk3566-pipe-grf so we can handle setup with the grf driver. Signed-off-by: Peter Geis Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220408151237.3165046-2-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit 07905844f4880df27a3d80adb07342ec152fd2d7 Author: Sebastian Fricke Date: Sat Mar 26 19:34:50 2022 +0100 soc: rockchip: pm_domains: Fix typo in comment s/eject devices form power domain/eject devices from the power domain/ Signed-off-by: Sebastian Fricke Link: https://lore.kernel.org/r/20220326183451.66115-1-sebastian.fricke@collabora.com Signed-off-by: Heiko Stuebner commit 8a1b63b14fe7df811439235606c146faa15faa52 Author: Johan Jonker Date: Thu Mar 24 13:01:22 2022 +0100 dt-bindings: soc: rockchip: add naneng combo phy register compatible Add Naneng combo phy register compatible. Signed-off-by: Johan Jonker Signed-off-by: Yifeng Zhao Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220324120122.1339-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 22a442e6586c898a6da1fbc57fab1b31dfc3e4b5 Author: Michael Riesch Date: Thu Mar 10 22:03:51 2022 +0100 arm64: dts: rockchip: add basic dts for the radxa rock3 model a Add basic device tree for the Radxa ROCK3 Model A board (with the Rockchip RK3568 SoC) including Ethernet, USB2 and headphone connector. Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220310210352.451136-3-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit 6648d167fbd16eaa4ef4972b4904adde2717f722 Author: Michael Riesch Date: Thu Mar 10 22:03:50 2022 +0100 dt-bindings: arm: rockchip: add radxa rock3 model a Add entry for the Radxa ROCK3 Model A board (with the Rockchip RK3568 SoC). Signed-off-by: Michael Riesch Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220310210352.451136-2-michael.riesch@wolfvision.net Signed-off-by: Heiko Stuebner commit ef5814e75b2bd9714dbfd60bfc360f940092ba62 Author: Heiko Stuebner Date: Mon Apr 4 10:49:42 2022 +0200 arm64: dts: rockchip: fix Makefile sorting for BananaPi R2 Pro Banana before evb of course. Fixes: f901aaadaa2a ("arm64: dts: rockchip: Add Bananapi R2 Pro") Signed-off-by: Heiko Stuebner commit c043dee9cb6bc332746cd60ec42d5f8220d90332 Author: Krzysztof Kozlowski Date: Thu Sep 17 20:52:11 2020 +0200 arm64: dts: rockchip: correct interrupt flags on rk3399 boards 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: 1. GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE 2. GPIO_ACTIVE_LOW = 1 = IRQ_TYPE_EDGE_RISING 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/20200917185211.5483-2-krzk@kernel.org Signed-off-by: Heiko Stuebner commit 516a2f1f6f3ce1a87931579cc21de6e7e33440bd Merge: 626a5aaa50673 f940b6efb1725 Author: David S. Miller Date: Sun Apr 10 17:32:12 2022 +0100 Merge branch 'tls-rx-refactoring-part-2' Jakub Kicinski says: ==================== tls: rx: random refactoring part 2 TLS Rx refactoring. Part 2 of 3. This one focusing on the main loop. A couple of features to follow. ==================== commit f940b6efb17257844341d04b4fc622752c23cb9f Author: Jakub Kicinski Date: Fri Apr 8 11:31:34 2022 -0700 tls: rx: jump out for cases which need to leave skb on list The current invese logic is harder to follow (and adds extra tests to the fast path). We have to enumerate all cases which need to keep the skb before consuming it. It's simpler to jump out of the full record flow as we detect those cases. This makes it clear that partial consumption and peek can only reach end of the function thru the !zc case so move the code up there. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit b1a2c1786330286f4b31c4bb9fd1d5ac8bb09807 Author: Jakub Kicinski Date: Fri Apr 8 11:31:33 2022 -0700 tls: rx: clear ctx->recv_pkt earlier Whatever we do in the loop the skb should not remain on as ctx->recv_pkt afterwards. We can clear that pointer and restart strparser earlier. This adds overhead of extra linking and unlinking to rx_list but that's not large (upcoming change will switch to unlocked skb list operations). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 465ea73535675ed3eb39e54a3631998f0c64e8d7 Author: Jakub Kicinski Date: Fri Apr 8 11:31:32 2022 -0700 tls: rx: inline consuming the skb at the end of the loop tls_sw_advance_skb() always consumes the skb at the end of the loop. To fall here the following must be true: !async && !is_peek && !retain_skb retain_skb => !zc && rxm->full_len > len # but non-full record implies !zc, so above can be simplified as retain_skb => rxm->full_len > len !async && !is_peek && !(rxm->full_len > len) !async && !is_peek && rxm->full_len <= len tls_sw_advance_skb() returns false if len < rxm->full_len which can't be true given conditions above. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ba13609df18dabf1d892a247201bd3fe38012ff9 Author: Jakub Kicinski Date: Fri Apr 8 11:31:31 2022 -0700 tls: rx: pull most of zc check out of the loop Most of the conditions deciding if zero-copy can be used do not change throughout the iterations, so pre-calculate them. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7da18bcc5e4cfd14ea520367546c5697e64ae592 Author: Jakub Kicinski Date: Fri Apr 8 11:31:30 2022 -0700 tls: rx: don't track the async count We track both if the last record was handled by async crypto and how many records were async. This is not necessary. We implicitly assume once crypto goes async it will stay that way, otherwise we'd reorder records. So just track if we're in async mode, the exact number of records is not necessary. This change also forces us into "async" mode more consistently in case crypto ever decided to interleave async and sync. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit fc8da80f990696a50ea76628daca6e63331b18b7 Author: Jakub Kicinski Date: Fri Apr 8 11:31:29 2022 -0700 tls: rx: don't handle async in tls_sw_advance_skb() tls_sw_advance_skb() caters to the async case when skb argument is NULL. In that case it simply unpauses the strparser. These are surprising semantics to a person reading the code, and result in higher LoC, so inline the __strp_unpause and only call tls_sw_advance_skb() when we actually move past an skb. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 06554f4ffc2595ae52ee80aec4a13bd77d22bed7 Author: Jakub Kicinski Date: Fri Apr 8 11:31:28 2022 -0700 tls: rx: factor out writing ContentType to cmsg cmsg can be filled in during rx_list processing or normal receive. Consolidate the code. We don't need to keep the boolean to track if the cmsg was created. 0 is an invalid content type. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 37943f047bfb88ba4dfc7a522563f57c86d088a0 Author: Jakub Kicinski Date: Fri Apr 8 11:31:27 2022 -0700 tls: rx: simplify async wait Since we are protected from async completions by decrypt_compl_lock we can drop the async_notify and reinit the completion before we start waiting. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4175eac37123a68ebee71f288826339fb89bfec7 Author: Jakub Kicinski Date: Fri Apr 8 11:31:26 2022 -0700 tls: rx: wrap decryption arguments in a structure We pass zc as a pointer to bool a few functions down as an in/out argument. This is error prone since C will happily evalue a pointer as a boolean (IOW forgetting *zc and writing zc leads to loss of developer time..). Wrap the arguments into a structure. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9bdf75ccffa690237cd0b472cd598cf6d22873dc Author: Jakub Kicinski Date: Fri Apr 8 11:31:25 2022 -0700 tls: rx: don't report text length from the bowels of decrypt We plumb pointer to chunk all the way to the decryption method. It's set to the length of the text when decrypt_skb_update() returns. I think the code is written this way because original TLS implementation passed &chunk to zerocopy_from_iter() and this was carried forward as the code gotten more complex, without any refactoring. The fix for peek() introduced a new variable - to_decrypt which for all practical purposes is what chunk is going to get set to. Spare ourselves the pointer passing, use to_decrypt. Use this opportunity to clean things up a little further. Note that chunk / to_decrypt was mostly needed for the async path, since the sync path would access rxm->full_len (decryption transforms full_len from record size to text size). Use the right source of truth more explicitly. We have three cases: - async - it's TLS 1.2 only, so chunk == to_decrypt, but we need the min() because to_decrypt is a whole record and we don't want to underflow len. Note that we can't handle partial record by falling back to sync as it would introduce reordering against records in flight. - zc - again, TLS 1.2 only for now, so chunk == to_decrypt, we don't do zc if len < to_decrypt, no need to check again. - normal - it already handles chunk > len, we can factor out the assignment to rxm->full_len and share it with zc. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d4bd88e67666c73cfa9d75c282e708890d4f10a7 Author: Jakub Kicinski Date: Fri Apr 8 11:31:24 2022 -0700 tls: rx: drop unnecessary arguments from tls_setup_from_iter() sk is unused, remove it to make it clear the function doesn't poke at the socket. size_used is always 0 on input and @length on success. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit f67c6c73cb07a4778425a2064640333ef7bfa42b Author: Miquel Raynal Date: Mon Feb 7 15:38:39 2022 +0100 iio: core: Simplify the registration of kfifo buffers Among all the users of the kfifo buffers, no one uses the INDIO_BUFFER_HARDWARE mode. So let's take this as a general rule and simplify a little bit the internals - overall the documentation - by eliminating unused specific cases. Use the INDIO_BUFFER_SOFTWARE mode by default with kfifo buffers, which will basically mimic what all the "non direct" modes do. Cc: Benson Leung Cc: Guenter Roeck Cc: Jyoti Bhayana Cc: Jean-Baptiste Maneyrol Cc: Lorenzo Bianconi Cc: Michael Hennerich Cc: Greg Kroah-Hartman Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-13-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 51570c9d4b3a678f77a50ac139f67290e946ec86 Author: Miquel Raynal Date: Mon Feb 7 15:38:38 2022 +0100 iio: core: Move the currentmode entry to the opaque structure This entry should, under no situation, be modified by device drivers. Now that we have limited its read access to device drivers really needing it and did so through a dedicated helper, we can easily move this variable to the opaque structure in order to prevent any further modification from non-authorized code (out of the core, basically). Signed-off-by: Miquel Raynal Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20220207143840.707510-12-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 8c576f87ad7eb639b8bd4472a9bb830e0696dda5 Author: Miquel Raynal Date: Mon Feb 7 15:38:37 2022 +0100 iio: core: Hide read accesses to iio_dev->currentmode In order to later move this variable within the opaque structure, let's create a helper for accessing it in read-only mode. This helper will be exposed to device drivers and kept accessible for the few that could need it. The write access to this variable however should be fully reserved to the core so in a second step we will hide this variable into the opaque structure. Cc: Eugen Hristev Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-11-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 2f53b4adfede66f1bc1c8bb7efd7ced2bad1191a Author: Miquel Raynal Date: Mon Feb 7 15:38:36 2022 +0100 iio: Un-inline iio_buffer_enabled() As we are going to hide the currentmode inside the opaque structure, this helper would soon need to call a non-inline function which would simply drop the benefit of having the helper defined inline in a header. One alternative is to move this helper in the core as there is no more interest in defining it inline in a header. We will pay the minor cost either way. Let's do like the iio_device_id() helper which also refers to the opaque structure and gets defined in the core. Suggested-by: Jonathan Cameron Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-10-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 2da03b432ddfb7c914f3611c88f7feb5eebd3690 Author: Miquel Raynal Date: Mon Feb 7 15:38:35 2022 +0100 iio: st_sensors: Use iio_device_claim/release_direct_mode() when relevant The st_sensors_core driver hardcodes the content of the iio_device_claim_direct_mode() and iio_device_release_direct_mode() helpers. Let's get rid of this handcrafted implementation and use the proper core helpers instead. Additionally, this lowers the tab level (which is always good) and prevents the use of the ->currentmode variable which is not supposed to be used like this anyway. Cc: Denis Ciocca Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-9-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 1234596839ada476b89314bf65f7ab9d422b3721 Author: Miquel Raynal Date: Mon Feb 7 15:38:34 2022 +0100 iio: st_sensors: Stop abusing mlock to ensure internal coherency An odr_lock has been introduced to protect local accesses to the odr internal cache and ensure the cached value always reflected the actual value. Using the mlock() for this purpose is no longer needed, so let's drop these extra mutex_lock/unlock() calls. Suggested-by: Jonathan Cameron Cc: Denis Ciocca Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-8-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 474010127e2505fc463236470908e1ff5ddb3578 Author: Miquel Raynal Date: Mon Feb 7 15:38:33 2022 +0100 iio: st_sensors: Add a local lock for protecting odr Right now the (framework) mlock lock is (ab)used for multiple purposes: 1- protecting concurrent accesses over the odr local cache 2- avoid changing samplig frequency whilst buffer is running Let's start by handling situation #1 with a local lock. Suggested-by: Jonathan Cameron Cc: Denis Ciocca Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-7-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 05a32f1aeb05c41dd33d95c060ee5d1b81f70e55 Author: Miquel Raynal Date: Mon Feb 7 15:38:32 2022 +0100 iio: st_sensors: Drop the protection on _avail functions The use of a lock there seems pointless. Besides preventing to read these information from userspace while buffers are enabled (which is not supposed to happen), it only protect read accesses over static const values, which are never supposed to be written anyway. Drop these lock calls. Suggested-by: Jonathan Cameron Cc: Denis Ciocca Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-6-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit 69c9887997729cc989849e6cba17fb11093ade1d Author: Miquel Raynal Date: Mon Feb 7 15:38:31 2022 +0100 iio: st_sensors: Return as early as possible from the _write_raw() callbacks As there is no cleanup to do, let's return as early as possible in the various ST sensor drivers _write_raw() callback functions. There is no functional change. Suggested-by: Jonathan Cameron Cc: Denis Ciocca Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-5-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit f8ac59f5379f05b2f43b891672a222da72e036f2 Author: Miquel Raynal Date: Mon Feb 7 15:38:30 2022 +0100 iio: adc: stm32-dfsdm: Avoid dereferencing ->currentmode This is an internal variable of the core, let's use the iio_buffer_enabled() helper which is exported for the following purpose: telling if the current mode is a buffered mode, which is precisely what this driver looks for. Cc: Olivier Moysan Cc: Fabrice Gasnier Signed-off-by: Miquel Raynal Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220207143840.707510-4-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit f4d7f88339a5c31cf312cf31e3ed216351bfc5ae Author: Miquel Raynal Date: Mon Feb 7 15:38:29 2022 +0100 iio: magnetometer: rm3100: Stop abusing the ->currentmode This is an internal variable for the core, here it is set to a "default" value by the driver in order to later be able to perform checks against it. None of this is needed because this check actually cares about the buffers being enabled or not. So it is an unproper side-channel access to the information "are the buffers enabled?", returned officially by the iio_buffer_enabled() helper. Use this helper instead. Cc: Song Qiang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-3-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit a8b6d6708bb682108d8c899bc0cb7873240daf8a Author: Miquel Raynal Date: Mon Feb 7 15:38:28 2022 +0100 iio: core: Enhance the kernel doc of modes and currentmodes iio_dev entries Let's provide more details about these two variables because their understanding may not be straightforward for someone not used to the IIO subsystem internal logic. The different modes will soon be also be more documented for the same reason. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220207143840.707510-2-miquel.raynal@bootlin.com Signed-off-by: Jonathan Cameron commit c25f23459c117d950e657458b0d3dcaaf9039ec9 Author: Maciej W. Rozycki Date: Thu Mar 31 08:11:14 2022 +0100 x86/PCI: Fix coding style in PIRQ table verification Remove an extraneous space with a cast in `pirq_check_routing_table'. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203310017260.44113@angie.orcam.me.uk commit 4969e223b109754c2340a26bba9b1cf44f0cba9b Author: Maciej W. Rozycki Date: Thu Mar 31 08:11:10 2022 +0100 x86/PCI: Fix ALi M1487 (IBC) PIRQ router link value interpretation Fix an issue with commit 1ce849c75534 ("x86/PCI: Add support for the ALi M1487 (IBC) PIRQ router") and correct ALi M1487 (IBC) PIRQ router link value (`pirq' cookie) interpretation according to findings in the BIOS. Credit to Nikolai Zhubr for the detective work as to the bit layout. Fixes: 1ce849c75534 ("x86/PCI: Add support for the ALi M1487 (IBC) PIRQ router") Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203310013270.44113@angie.orcam.me.uk commit b584db0c84db5ed9230356d5fa6610de55d297e6 Author: Maciej W. Rozycki Date: Thu Mar 31 08:11:05 2022 +0100 x86/PCI: Add $IRT PIRQ routing table support Handle the $IRT PCI IRQ Routing Table format used by AMI for its BCP (BIOS Configuration Program) external tool meant for tweaking BIOS structures without the need to rebuild it from sources[1]. The $IRT format has been invented by AMI before Microsoft has come up with its $PIR format and a $IRT table is therefore there in some systems that lack a $PIR table, such as the DataExpert EXP8449 mainboard based on the ALi FinALi 486 chipset (M1489/M1487), which predates DMI 2.0 and cannot therefore be easily identified at run time. Unlike with the $PIR format there is no alignment guarantee as to the placement of the $IRT table, so scan the whole BIOS area bytewise. Credit to Michal Necasek for helping me chase documentation for the format. References: [1] "What is BCP? - AMI", Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Tested-by: Dmitry Osipenko # crosvm Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203302228410.9038@angie.orcam.me.uk commit ac7cd5e16df8696c39e29b03dfedf069a025b822 Author: Maciej W. Rozycki Date: Thu Mar 31 08:11:01 2022 +0100 x86/PCI: Handle PIRQ routing tables with no router device given PIRQ routing tables provided by the PCI BIOS usually specify the PCI vendor:device ID as well as the bus address of the device implementing the PIRQ router, e.g.: PCI: Interrupt Routing Table found at 0xc00fde10 [...] PCI: Attempting to find IRQ router for [8086:7000] pci 0000:00:07.0: PIIX/ICH IRQ router [8086:7000] however in some cases they do not, in which case we fail to match the router handler, e.g.: PCI: Interrupt Routing Table found at 0xc00fdae0 [...] PCI: Attempting to find IRQ router for [0000:0000] PCI: Interrupt router not found at 00:00 This is because we always match the vendor:device ID and the bus address literally, even if they are all zeros. Handle this case then and iterate over all PCI devices until we find a matching router handler if the vendor ID given by the routing table is the invalid value of zero: PCI: Attempting to find IRQ router for [0000:0000] PCI: Trying IRQ router for [1039:0496] pci 0000:00:05.0: SiS85C497 IRQ router [1039:0496] Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Tested-by: Nikolai Zhubr Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203302018570.9038@angie.orcam.me.uk commit 5d64089aa4a5bd3d7e00e3d6ddf4943dd34627b3 Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:55 2022 +0100 x86/PCI: Add PIRQ routing table range checks Verify that the PCI IRQ Routing Table header as well as individual slot entries are all wholly contained within the BIOS memory area. Do not even call the checksum calculator if the header would overrun the area and then bail out early if any slot would. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301735510.22465@angie.orcam.me.uk commit fe62bc23620fa027162e05594a610ff5e556496a Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:46 2022 +0100 x86/PCI: Add support for the SiS85C497 PIRQ router The SiS 85C496/497 486 Green PC VESA/ISA/PCI Chipset has support for PCI steering and the ELCR register implemented. These features are handled by the SiS85C497 AT Bus Controller & Megacell (ATM) ISA bridge, however the device is wired as a peer bridge directly to the host bus and has its PCI configuration registers decoded at addresses 0x80-0xff by the accompanying SiS85C496 PCI & CPU Memory Controller (PCM) host bridge[1]. Therefore we need to match on the host bridge's vendor and device ID. Like with the SiS85C503 PIRQ router handle link value ranges of 1-4 and 0xc0-0xc3, corresponding respectively to PIRQ line numbers counted from 1 and link register PCI configuration space addresses. References: [1] "486 Green PC VESA/ISA/PCI Chipset, SiS 85C496/497", Rev 3.0, Silicon Integrated Systems Corp., July 1995, Part IV, Section 3. "PCI Configuration Space Registers (00h ~ FFh)", p. 114 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Tested-by: Nikolai Zhubr Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301610490.22465@angie.orcam.me.uk commit 5a0e5fa957db79177baa851d687b6f6aa5a0be96 Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:39 2022 +0100 x86/PCI: Disambiguate SiS85C503 PIRQ router code entities In preparation to adding support for the SiS85C497 PIRQ router add `503' to the names of SiS85C503 PIRQ router code entities so that they clearly indicate which device they refer to. Also restructure `sis_router_probe' such that new device IDs will be just new switch cases. No functional change. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301610000.22465@angie.orcam.me.uk commit d88a8b1cf472a245e146f2edfc65f37db860836a Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:25 2022 +0100 x86/PCI: Handle IRQ swizzling with PIRQ routers Similarly to MP-tables PIRQ routing tables may not list devices behind PCI-to-PCI bridges, leading to interrupt routing failures, e.g.: pci 0000:00:07.0: PIIX/ICH IRQ router [8086:7000] pci 0000:02:00.0: ignoring bogus IRQ 255 pci 0000:02:01.0: ignoring bogus IRQ 255 pci 0000:02:02.0: ignoring bogus IRQ 255 pci 0000:04:00.0: ignoring bogus IRQ 255 pci 0000:04:00.3: ignoring bogus IRQ 255 pci 0000:00:11.0: PCI INT A -> PIRQ 63, mask deb8, excl 0c20 pci 0000:00:11.0: PCI INT A -> newirq 0 PCI: setting IRQ 11 as level-triggered pci 0000:00:11.0: found PCI INT A -> IRQ 11 pci 0000:00:11.0: sharing IRQ 11 with 0000:00:07.2 pci 0000:02:00.0: PCI INT A not found in routing table pci 0000:02:01.0: PCI INT A not found in routing table pci 0000:02:02.0: PCI INT A not found in routing table pci 0000:04:00.0: PCI INT A not found in routing table pci 0000:04:00.3: PCI INT D not found in routing table pci 0000:06:05.0: PCI INT A not found in routing table pci 0000:06:08.0: PCI INT A not found in routing table pci 0000:06:08.1: PCI INT B not found in routing table pci 0000:06:08.2: PCI INT C not found in routing table and consequently non-working devices. Since PCI-to-PCI bridges have a standardised way of routing interrupts by the means of swizzling do it for configurations that use a PIRQ router as well, like with APIC-based setups, and use the determined corresponding topmost bridge's interrupt pin assignment to route a given device's interrupt: pci 0000:00:07.0: PIIX/ICH IRQ router [8086:7000] pci 0000:02:00.0: ignoring bogus IRQ 255 pci 0000:02:01.0: ignoring bogus IRQ 255 pci 0000:02:02.0: ignoring bogus IRQ 255 pci 0000:04:00.0: ignoring bogus IRQ 255 pci 0000:04:00.3: ignoring bogus IRQ 255 pci 0000:00:11.0: PCI INT A -> PIRQ 63, mask deb8, excl 0c20 pci 0000:00:11.0: PCI INT A -> newirq 0 PCI: setting IRQ 11 as level-triggered pci 0000:00:11.0: found PCI INT A -> IRQ 11 pci 0000:00:11.0: sharing IRQ 11 with 0000:00:07.2 pci 0000:02:00.0: using bridge 0000:00:11.0 INT A to get INT A pci 0000:00:11.0: sharing IRQ 11 with 0000:02:00.0 pci 0000:02:01.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:02.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:04:00.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:04:00.3: using bridge 0000:00:11.0 INT A to get INT D pci 0000:00:11.0: sharing IRQ 11 with 0000:04:00.3 pci 0000:06:05.0: using bridge 0000:00:11.0 INT D to get INT A pci 0000:06:08.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:06:08.1: using bridge 0000:00:11.0 INT D to get INT B pci 0000:06:08.2: using bridge 0000:00:11.0 INT A to get INT C pci 0000:00:11.0: sharing IRQ 11 with 0000:06:08.2 pci 0000:02:01.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:01.0: PCI INT A -> PIRQ 60, mask deb8, excl 0c20 pci 0000:02:01.0: PCI INT A -> newirq 0 PCI: setting IRQ 10 as level-triggered pci 0000:02:01.0: found PCI INT A -> IRQ 10 pci 0000:02:01.0: sharing IRQ 10 with 0000:00:14.0 pci 0000:02:00.0: using bridge 0000:00:11.0 INT A to get INT A pci 0000:02:01.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:02.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:04:00.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:01.0: sharing IRQ 10 with 0000:04:00.0 pci 0000:04:00.3: using bridge 0000:00:11.0 INT A to get INT D pci 0000:06:05.0: using bridge 0000:00:11.0 INT D to get INT A pci 0000:06:08.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:06:08.1: using bridge 0000:00:11.0 INT D to get INT B pci 0000:06:08.2: using bridge 0000:00:11.0 INT A to get INT C pci 0000:02:02.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:02:02.0: PCI INT A -> PIRQ 61, mask deb8, excl 0c20 pci 0000:02:02.0: PCI INT A -> newirq 0 PCI: setting IRQ 5 as level-triggered pci 0000:02:02.0: found PCI INT A -> IRQ 5 pci 0000:02:02.0: sharing IRQ 5 with 0000:00:13.0 pci 0000:02:00.0: using bridge 0000:00:11.0 INT A to get INT A pci 0000:02:01.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:02.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:04:00.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:04:00.3: using bridge 0000:00:11.0 INT A to get INT D pci 0000:06:05.0: using bridge 0000:00:11.0 INT D to get INT A pci 0000:06:08.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:02:02.0: sharing IRQ 5 with 0000:06:08.0 pci 0000:06:08.1: using bridge 0000:00:11.0 INT D to get INT B pci 0000:06:08.2: using bridge 0000:00:11.0 INT A to get INT C pci 0000:06:05.0: using bridge 0000:00:11.0 INT D to get INT A pci 0000:06:05.0: PCI INT A -> PIRQ 62, mask deb8, excl 0c20 pci 0000:06:05.0: PCI INT A -> newirq 0 pci 0000:06:05.0: found PCI INT A -> IRQ 5 pci 0000:06:05.0: sharing IRQ 5 with 0000:00:12.0 pci 0000:02:00.0: using bridge 0000:00:11.0 INT A to get INT A pci 0000:02:01.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:02:02.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:04:00.0: using bridge 0000:00:11.0 INT B to get INT A pci 0000:04:00.3: using bridge 0000:00:11.0 INT A to get INT D pci 0000:06:05.0: using bridge 0000:00:11.0 INT D to get INT A pci 0000:06:08.0: using bridge 0000:00:11.0 INT C to get INT A pci 0000:06:08.1: using bridge 0000:00:11.0 INT D to get INT B pci 0000:06:05.0: sharing IRQ 5 with 0000:06:08.1 pci 0000:06:08.2: using bridge 0000:00:11.0 INT A to get INT C Adjust log messages accordingly. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301538440.22465@angie.orcam.me.uk commit 3132450254f28428cb0a4368b0115a26cd85d170 Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:21 2022 +0100 x86/PCI: Also match function number in $PIR table Contrary to the PCI BIOS specification[1] some systems include the PCI function number for onboard devices in their $PIR table. Consequently the wrong entry can be matched leading to interrupt routing failures. For example the Tyan Tomcat IV S1564D board has: 00:07.1 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:00/deb8 00:07.2 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:63/deb8 for its IDE interface and USB controller functions of the 82371SB PIIX3 southbridge. Consequently the first entry matches causing the inability to route the USB interrupt in the `noapic' mode, in which case we need to rely on the interrupt line set by the BIOS: uhci_hcd 0000:00:07.2: runtime IRQ mapping not provided by arch uhci_hcd 0000:00:07.2: PCI INT D not routed uhci_hcd 0000:00:07.2: enabling bus mastering uhci_hcd 0000:00:07.2: UHCI Host Controller uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1 uhci_hcd 0000:00:07.2: irq 11, io base 0x00006000 Try to match the PCI device and function combined then and if that fails move on to PCI device matching only. Compliant systems will only have a single $PIR table entry per PCI device, so this update does not change the semantics with them, while systems that have several entries for individual functions of a single PCI device each will match the correct entry: uhci_hcd 0000:00:07.2: runtime IRQ mapping not provided by arch uhci_hcd 0000:00:07.2: PCI INT D -> PIRQ 63, mask deb8, excl 0c20 uhci_hcd 0000:00:07.2: PCI INT D -> newirq 11 uhci_hcd 0000:00:07.2: found PCI INT D -> IRQ 11 uhci_hcd 0000:00:07.2: sharing IRQ 11 with 0000:00:11.0 uhci_hcd 0000:00:07.2: enabling bus mastering uhci_hcd 0000:00:07.2: UHCI Host Controller uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1 uhci_hcd 0000:00:07.2: irq 11, io base 0x00006000 [1] "PCI BIOS Specification", Revision 2.1, PCI Special Interest Group, August 26, 1994, Table 4-1 "Layout of IRQ routing table entry.", p. 12 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301536020.22465@angie.orcam.me.uk commit dc0e64087213768a6232af980076a517aaaa4adb Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:17 2022 +0100 x86/PCI: Include function number in $PIR table dump Contrary to the PCI BIOS specification[1] some systems include the PCI function number for motherboard devices in their $PIR table, e.g. this is what the Tyan Tomcat IV S1564D board reports: 00:14 slot=01 0:60/deb8 1:61/deb8 2:62/deb8 3:63/deb8 00:13 slot=02 0:61/deb8 1:62/deb8 2:63/deb8 3:60/deb8 00:12 slot=03 0:62/deb8 1:63/deb8 2:60/deb8 3:61/deb8 00:11 slot=04 0:63/deb8 1:60/deb8 2:61/deb8 3:62/deb8 00:07 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:00/deb8 00:07 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:63/deb8 Print the function number then in the debug $PIR table dump: 00:14.0 slot=01 0:60/deb8 1:61/deb8 2:62/deb8 3:63/deb8 00:13.0 slot=02 0:61/deb8 1:62/deb8 2:63/deb8 3:60/deb8 00:12.0 slot=03 0:62/deb8 1:63/deb8 2:60/deb8 3:61/deb8 00:11.0 slot=04 0:63/deb8 1:60/deb8 2:61/deb8 3:62/deb8 00:07.1 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:00/deb8 00:07.2 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:63/deb8 References: [1] "PCI BIOS Specification", Revision 2.1, PCI Special Interest Group, August 26, 1994, Table 4-1 "Layout of IRQ routing table entry.", p. 12 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301534440.22465@angie.orcam.me.uk commit 613fa6e217e1f216109da784d6f127cc708026c0 Author: Maciej W. Rozycki Date: Thu Mar 31 08:10:12 2022 +0100 x86/PCI: Show the physical address of the $PIR table It makes no sense to hide the address of the $PIR table in a debug dump: PCI: Interrupt Routing Table found at 0x(ptrval) let alone print its virtual address, given that this is a BIOS entity at a fixed location in the system's memory map. Show the physical address instead then, e.g.: PCI: Interrupt Routing Table found at 0xfde10 Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203301532330.22465@angie.orcam.me.uk commit efaa0227f6c6a5073951b20cf2f8c63c4155306c Author: tangmeng Date: Tue Feb 15 14:50:19 2022 +0800 timers: Move timer sysctl into the timer code This is part of the effort to reduce kernel/sysctl.c to only contain the core logic. Signed-off-by: tangmeng Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220215065019.7520-1-tangmeng@uniontech.com commit 2966a9918dfab183a1cb6be6794981ebe2abff83 Author: Jakob Koschel Date: Thu Mar 31 23:57:07 2022 +0200 clockevents: Use 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. Signed-off-by: Jakob Koschel Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Link: https://lore.kernel.org/r/20220331215707.883957-1-jakobkoschel@gmail.com commit 234c52097ce416028854d2167afb38b7718b9a94 Author: Andy Shevchenko Date: Fri Apr 8 21:18:53 2022 +0300 gpiolib: Extract gpio_chip_get_value() wrapper In couple of cases we are using the same code to wrap ->get() callback. Extract that code into a helper for the sake of better maintenance. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 3de69ae1c407da6cbeca75fd3ee6a40237d899dd Author: Andy Shevchenko Date: Fri Apr 8 21:18:52 2022 +0300 gpiolib: Refactor gpiolib_dbg_show() with help of for_each_gpio_desc() Use for_each_gpio_desc() and since we would need to touch the entire conditionals, do the following: - rename last occurrence of gdesc to desc - use short ternary operator ?: - join two seq_printf() calls into single one - fix indentation of the seq_printf() parameters Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 66f46e370a9aec05524cdffde4062953e6ba2e08 Author: Andy Shevchenko Date: Fri Apr 8 21:18:51 2022 +0300 gpiolib: Split out for_each_gpio_desc() macro In some cases we want to traverse all GPIO descriptors for given chip, let's split out for_each_gpio_desc() macro for such cases. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 57017edd46f835c85642fe8299f13b0db61d4c31 Author: Andy Shevchenko Date: Fri Apr 8 21:18:50 2022 +0300 gpiolib: Embed iterator variable into for_each_gpio_desc_with_flag() The iterator loop is used exclusively to get a descriptor, which in its turn is what is being used by the caller. Embed the iterator variable into the loop in the for_each_gpio_desc_with_flag() macro helper. Suggested-by: Bartosz Golaszewski Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 24a9dbb1c1575b9890bb7d9028cc89894da6dc22 Author: Andy Shevchenko Date: Wed Mar 30 17:59:10 2022 +0300 gpiolib: Move error message out of a spinlock An error path is a slow path, no need to block other CPUs when printing error messages. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit a2026e44eff5d74a83d7ffee6325a007bef85385 Author: Thomas Gleixner Date: Mon Apr 4 16:47:55 2022 +0200 timers: Simplify calc_index() The level granularity round up of calc_index() does: (x + (1 << n)) >> n which is obviously equivalent to (x >> n) + 1 but compilers can't figure that out despite the fact that the input range is known to not cause an overflow. It's neither intuitive to read. Just write out the obvious. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/87h778j46c.ffs@tglx commit 2731aa7d65dbb31c6dad14347c37d522bb3bc7c6 Author: Anna-Maria Behnsen Date: Tue Apr 5 21:17:31 2022 +0200 timers: Initialize base::next_expiry_recalc in timers_prepare_cpu() When base::next_expiry_recalc is not initialized to false during cpu bringup in HOTPLUG_CPU and is accidently true and no timer is queued in the meantime, the loop through the wheel to find __next_timer_interrupt() might be done for nothing. Therefore initialize base::next_expiry_recalc to false in timers_prepare_cpu(). Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20220405191732.7438-2-anna-maria@linutronix.de commit 9e916fb9bc3d16066286f19fc9c51d26a6aec6bd Author: Krzysztof Kozlowski Date: Sun Mar 27 11:08:54 2022 -0700 ARM: dts: s5pv210: align DMA channels with dtschema dtschema expects DMA channels in specific order (tx, rx and tx-sec). The order actually should not matter because dma-names is used however let's make it aligned with dtschema to suppress warnings like: i2s@eee30000: dma-names: ['rx', 'tx', 'tx-sec'] is not valid under any of the given schemas Signed-off-by: Krzysztof Kozlowski Co-developed-by: Jonathan Bakker Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/CY4PR04MB056779A9C50DC95987C5272ACB1C9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Krzysztof Kozlowski commit 21e4b7d151af9a3191fb251e2b4044e361a56102 Author: Jonathan Bakker Date: Sun Mar 27 11:08:53 2022 -0700 ARM: dts: s5pv210: Adjust DMA node names to match spec DMA node names should be dma-controller according to the DT spec, so rename them from pdma/mdma. Prevents warnings when running make dtbs_check Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/CY4PR04MB0567F52ABAE0A3CCD3C7CE59CB1C9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Krzysztof Kozlowski commit 9576ec12261c4b639cd802fd9c13e3c9605165da Author: Jonathan Bakker Date: Sun Mar 27 11:08:52 2022 -0700 ARM: dts: s5pv210: Adjust memory reg entries to match spec The reg property of memory nodes should have pairs of offset, size; not all memory banks lumped in as one. Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/CY4PR04MB05677849A13F41BF603906DFCB1C9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Krzysztof Kozlowski commit 3f5e3d3a8b895c8a11da8b0063ba2022dd9e2045 Author: Jonathan Bakker Date: Sun Mar 27 11:08:51 2022 -0700 ARM: dts: s5pv210: Correct interrupt name for bluetooth in Aries Correct the name of the bluetooth interrupt from host-wake to host-wakeup. Fixes: 1c65b6184441b ("ARM: dts: s5pv210: Correct BCM4329 bluetooth node") Cc: Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/CY4PR04MB0567495CFCBDC8D408D44199CB1C9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Krzysztof Kozlowski commit 096f58507374e1293a9e9cff8a1ccd5f37780a20 Author: Jonathan Bakker Date: Sun Mar 27 11:08:50 2022 -0700 ARM: dts: s5pv210: Remove spi-cs-high on panel in Aries Since commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors"), the panel has been blank due to an inverted CS GPIO. In order to correct this, drop the spi-cs-high from the panel SPI device. Fixes: 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors") Cc: Signed-off-by: Jonathan Bakker Link: https://lore.kernel.org/r/CY4PR04MB05670C771062570E911AF3B4CB1C9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Krzysztof Kozlowski commit 618f5df1f6a5a3f29fad824116da291a7d14ab5e Author: Lucas De Marchi Date: Fri Apr 8 09:48:37 2022 -0700 drm/i915/uncore: Warn only if unclaimed access remains flagged Commit 4b276ed3c7ac ("drm/i915/uncore: Warn on previous unclaimed accesses") tried to improve our report of unclaimed register access, however it unveiled cases that were not previously causing any harm. Downgrade the first message to debug so we can still see them and eventually fix, but don't warn. Fixes: 4b276ed3c7ac ("drm/i915/uncore: Warn on previous unclaimed accesses") Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220408164837.3845786-1-lucas.demarchi@intel.com commit 00bd435208e5201eb935d273052930bd3b272b6f Author: Jeremy Sowden Date: Mon Apr 4 13:04:15 2022 +0100 netfilter: bitwise: improve error goto labels Replace two labels (`err1` and `err2`) with more informative ones. Signed-off-by: Jeremy Sowden Signed-off-by: Florian Westphal commit c70b921fc1e877243f0fb495d18bb884a776b273 Author: Jeremy Sowden Date: Mon Apr 4 13:04:14 2022 +0100 netfilter: bitwise: replace hard-coded size with `sizeof` expression When calculating the length of an array, use the appropriate `sizeof` expression for its type, rather than an integer literal. Signed-off-by: Jeremy Sowden Signed-off-by: Florian Westphal commit 2984287c4c19949d7eb451dcad0bd5c54a2a376f Author: Leon Romanovsky Date: Wed Apr 6 11:25:52 2022 +0300 net/mlx5: Remove not-implemented IPsec capabilities Clean a capabilities enum to remove not-implemented bits. Link: https://lore.kernel.org/r/1044bb7b779107ff38e48e3f6553421104f3f819.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit f2b41b32cde8453a0a26875261f0e26809c2805a Author: Leon Romanovsky Date: Wed Apr 6 11:25:51 2022 +0300 net/mlx5: Remove ipsec_ops function table There is only one IPsec implementation and ipsec_ops is not needed at all in this situation. Together with removal of ipsec_ops, we can drop the entry checks as these functions are called for IPsec devices only. Link: https://lore.kernel.org/r/bc8dd1c8a77b65dbf5e2cf92c813ffaca2505c5f.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit f03c7b183ef93032582131cd25940245fbee433a Author: Leon Romanovsky Date: Wed Apr 6 11:25:50 2022 +0300 net/mlx5: Reduce kconfig complexity while building crypto support Both IPsec and kTLS need two functions declared in the lib/crypto.c file. These functions are advertised through general mlx5.h file and don't have any protection from attempts to call them without proper config option. Instead of creating stubs just for two functions, simply build that *.c file as part of regular mlx5_eth build and rely on compiler to throw them away if no callers exist in produced code. Link: https://lore.kernel.org/r/37f02171da06886c1b403d44dd18b2a56b19219d.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 16fe5a1c5c074a836626e3bd9560d3c4a39a3fcf Author: Leon Romanovsky Date: Wed Apr 6 11:25:49 2022 +0300 net/mlx5: Move IPsec file to relevant directory IPsec is part of ethernet side of mlx5 driver and needs to be placed in en_accel folder. Link: https://lore.kernel.org/r/a0ca88f4d9c602c574106c0de0511803e7dcbdff.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 54deb0e77561973f4ca4515e18ab972c281eea1d Author: Leon Romanovsky Date: Wed Apr 6 11:25:48 2022 +0300 net/mlx5: Remove not-needed IPsec config In current code, the CONFIG_MLX5_IPSEC and CONFIG_MLX5_EN_IPSEC are the same. So remove useless indirection. Link: https://lore.kernel.org/r/fd14492cbc01a0d51a5bfedde02bcd2154123fde.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit a6a9eaf14222434ba1bdfcdaa2c5a27dbd126972 Author: Leon Romanovsky Date: Wed Apr 6 11:25:47 2022 +0300 net/mlx5: Align flow steering allocation namespace to common style Flow steering is a low level internal driver API, as such it relies on the callers to check if namespace is supported and not rely on some compilation flag. Link: https://lore.kernel.org/r/cfb411a8a9ed2a1471810af254bdc0f03469f79c.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 2451da081a343e079d9f5a7b063fcdf0bc439aa8 Author: Leon Romanovsky Date: Wed Apr 6 11:25:46 2022 +0300 net/mlx5: Unify device IPsec capabilities check Merge two different function to one in order to provide coherent picture if the device is IPsec capable or not. Link: https://lore.kernel.org/r/8f10ea06ad19c6f651e9fb33921009658f01e1d5.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 5a985aa3c922b680cc5bdfb347fee42961dc0e51 Author: Leon Romanovsky Date: Wed Apr 6 11:25:45 2022 +0300 net/mlx5: Remove useless IPsec device checks The mlx5_is_ipsec_device() check was to distinguish ConnectX device related ops from FPGA, so post removing FPGA IPsec code this check can be removed as no other device implements it. It is safe to do it as there is already embedded check of IPsec device in mlx5_accel_ipsec_device_caps(). Link: https://lore.kernel.org/r/e45362abfcabe18e8af20ec8d1acdc99355978f3.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 7e4e849121398ac4f7c7c2cf1d878c2ca6f62929 Author: Leon Romanovsky Date: Wed Apr 6 11:25:44 2022 +0300 net/mlx5: Remove ipsec vs. ipsec offload file separation The IPsec won't be initialized at all if device doesn't support IPsec offload. It means that we can combine the ipsec.c and ipsec_offload.c files to one file. Such change will allow us to remove ipsec_ops indirection. Link: https://lore.kernel.org/r/d0ac1fb7b14c10ae20a21ae17a393ee860c72ac3.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 32313c6ae622ed7aa553fa1ee22d8e5f24146f0e Author: Leon Romanovsky Date: Wed Apr 6 11:25:43 2022 +0300 RDMA/core: Delete IPsec flow action logic from the core The removal of mlx5 flow steering logic, left the kernel without any RDMA drivers that implements flow action callbacks supplied by RDMA/core. Any user access to them caused to EOPNOTSUPP error, which can be achieved by simply removing ioctl implementation. Link: https://lore.kernel.org/r/a638e376314a2eb1c66f597c0bbeeab2e5de7faf.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Acked-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit de8bdb476908e64805df4bfbad20618cbb1f9ffa Author: Leon Romanovsky Date: Wed Apr 6 11:25:42 2022 +0300 RDMA/mlx5: Drop crypto flow steering API The mlx5 flow steering crypto API was intended to be used in FPGA devices, which is not supported for years already. The removal of mlx5 crypto FPGA code together with inability to configure encryption keys makes the low steering API completely unusable. So delete the code, so any ESP flow steering requests will fail with not supported error, as it is happening now anyway as no device support this type of API. Link: https://lore.kernel.org/r/634a5face7734381463d809bfb89850f6998deac.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 74ec29bdb0ebe09d5490cd50df5ab3c309d6b276 Author: Leon Romanovsky Date: Wed Apr 6 11:25:41 2022 +0300 RDMA/mlx5: Delete never supported IPsec flow action The IPSEC_REQUIRED_METADATA capability bit is never set, and can be safely removed from the flow action flags. Link: https://lore.kernel.org/r/697cd60bd5c9b6a004c449c1a41c2798fac844ff.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 0d90bd551446b0a3c7e8777b120c67a7d741657c Author: Leon Romanovsky Date: Wed Apr 6 11:25:40 2022 +0300 net/mlx5: Remove FPGA ipsec specific statistics Delete the statistics that is not used anymore. Link: https://lore.kernel.org/r/3f194752881e095910c887dd5cede1dcba6acaf3.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 3c811a6b45524a64fb9bc7e1c3292f7216279a75 Author: Leon Romanovsky Date: Wed Apr 6 11:25:39 2022 +0300 net/mlx5: Remove XFRM no_trailer flag Only FPGA needed this NO_TRAILER flag, so remove this assignment. Link: https://lore.kernel.org/r/636d75421e1ca4254a062537eea001ab0e50e19b.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 501a9b23b23cb356362740347f40f7a46a9e866f Author: Leon Romanovsky Date: Wed Apr 6 11:25:38 2022 +0300 net/mlx5: Remove not-used IDA field from IPsec struct The IDA halloc variable is not needed and can be removed. Link: https://lore.kernel.org/r/cbecfbe01621e1b8bde746aa7f6c08497e656a25.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit df439fcb1cd4fe8e8b1c4065db4ef1b544aa5d9e Author: Leon Romanovsky Date: Wed Apr 6 11:25:37 2022 +0300 net/mlx5: Delete metadata handling logic Remove specific to FPGS IPsec metadata handling logic which is not required for mlx5 NICs devices. Link: https://lore.kernel.org/r/fe67a1de4fc6032a940e18c8a6461a1ccf902fc4.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 2fa33b3518a8da0a5345b7ae0064223b5e4e156f Author: Leon Romanovsky Date: Wed Apr 6 11:25:36 2022 +0300 net/mlx5_fpga: Drop INNOVA IPsec support Mellanox INNOVA IPsec cards are EOL in Nov, 2019 [1]. As such, the code is unmaintained, untested and not in-use by any upstream/distro oriented customers. In order to reduce code complexity, drop the kernel code. [1] https://network.nvidia.com/related-docs/eol/LCR-000535.pdf Link: https://lore.kernel.org/r/2afe88ec5020a491079eacf6fe3c89b64d65195c.1649232994.git.leonro@nvidia.com Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky commit 626a5aaa50673a1340ef46e049929709c83d184a Author: Colin Foster Date: Thu Apr 7 16:44:45 2022 -0700 net: mdio: mscc-miim: add local dev variable to cleanup probe function Create a local device *dev in order to not dereference the platform_device several times throughout the probe function. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 90f38145e6dd25ff0d9ebe48d28b8ae3a814d52d Author: Alexander Stein Date: Thu Mar 3 16:06:53 2022 +0100 ARM: dts: imx7s: fix iomuxc_lpsr node name Schema requires the node being named 'pinctrl'. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit e505edaedcb9e7d16eefddc62d2189afaea0febc Author: Jeff LaBundy Date: Fri Apr 8 19:15:20 2022 -0700 Input: add support for Azoteq IQS7222A/B/C This patch adds support for the Azoteq IQS7222A/B/C family of capacitive touch controllers. Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220403221659.865997-3-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit 44dc42d254bf7f0be0c8c4f0361db6452f5ce967 Author: Jeff LaBundy Date: Fri Apr 8 19:15:08 2022 -0700 dt-bindings: input: Add bindings for Azoteq IQS7222A/B/C This patch adds bindings for the Azoteq IQS7222A/B/C family of capacitive touch controllers. Signed-off-by: Jeff LaBundy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220403221659.865997-2-jeff@labundy.com Signed-off-by: Dmitry Torokhov commit db6c4ee7838c3a91ef15777f8d0f80a3cd5d3bb8 Author: AngeloGioacchino Del Regno Date: Fri Apr 8 18:32:58 2022 -0700 Input: mt6779-keypad - move iomem pointer to probe function The mmio base address is used for the only purpose of initializing regmap for this driver, hence it's not necessary to have it in the main driver structure, as it is used only in the probe() callback. Move it local to function mt6779_keypad_pdrv_probe(). This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220406115654.115093-1-angelogioacchino.delregno@collabora.com Signed-off-by: Dmitry Torokhov commit 03d470ce2b70f269cecf2aeacee41e228cafde44 Author: Bhupesh Sharma Date: Sat Mar 26 11:27:54 2022 +0530 arm64: dts: qcom: sa8155: Enable PCIe nodes SA8155p ADP board supports the PCIe0 controller in the RC mode (only). So add the support for the same. Cc: Bjorn Andersson Cc: Vinod Koul Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220326055754.1796146-3-bhupesh.sharma@linaro.org commit a1c86c6805336503ad2460426736456cc324d4a3 Author: Bhupesh Sharma Date: Sat Mar 26 11:27:53 2022 +0530 arm64: dts: qcom: sm8150: Add PCIe nodes Add nodes for the two PCIe controllers found on the SM8150 SoC. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220326055754.1796146-2-bhupesh.sharma@linaro.org commit fe75b0c4a6911243fe239fd0c2b2bda4fd398f6e Author: Bhupesh Sharma Date: Thu Mar 24 02:00:52 2022 +0530 arm64: dts: qcom: sm8150: Add ufs power-domain entries Add power-domain entries for UFS phy node in sm8150 dts. Cc: Bjorn Andersson Cc: Rob Herring Signed-off-by: Bhupesh Sharma [bjorn: Dropped power-domain-names] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220323203052.1124683-1-bhupesh.sharma@linaro.org commit 397ad94668c14b558d8dcf2bf29bce4bf78222ba Author: Bhupesh Sharma Date: Sun Feb 27 00:10:27 2022 +0530 arm64: dts: qcom: sm8150: Add pdc interrupt controller node Add pdc interrupt controller for sm8150. Cc: Maulik Shah Cc: Bjorn Andersson Cc: Vinod Koul Cc: Rob Herring Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226184028.111566-4-bhupesh.sharma@linaro.org commit 34ba23b44c664792a4308ec37b5788a3162944ec Merge: bd4a2697e5e27 b45043192b3e4 Author: Jakub Kicinski Date: Fri Apr 8 17:07:29 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-04-09 We've added 63 non-merge commits during the last 9 day(s) which contain a total of 68 files changed, 4852 insertions(+), 619 deletions(-). The main changes are: 1) Add libbpf support for USDT (User Statically-Defined Tracing) probes. USDTs are an abstraction built on top of uprobes, critical for tracing and BPF, and widely used in production applications, from Andrii Nakryiko. 2) While Andrii was adding support for x86{-64}-specific logic of parsing USDT argument specification, Ilya followed-up with USDT support for s390 architecture, from Ilya Leoshkevich. 3) Support name-based attaching for uprobe BPF programs in libbpf. The format supported is `u[ret]probe/binary_path:[raw_offset|function[+offset]]`, e.g. attaching to libc malloc can be done in BPF via SEC("uprobe/libc.so.6:malloc") now, from Alan Maguire. 4) Various load/store optimizations for the arm64 JIT to shrink the image size by using arm64 str/ldr immediate instructions. Also enable pointer authentication to verify return address for JITed code, from Xu Kuohai. 5) BPF verifier fixes for write access checks to helper functions, e.g. rd-only memory from bpf_*_cpu_ptr() must not be passed to helpers that write into passed buffers, from Kumar Kartikeya Dwivedi. 6) Fix overly excessive stack map allocation for its base map structure and buckets which slipped-in from cleanups during the rlimit accounting removal back then, from Yuntao Wang. 7) Extend the unstable CT lookup helpers for XDP and tc/BPF to report netfilter connection tracking tuple direction, from Lorenzo Bianconi. 8) Improve bpftool dump to show BPF program/link type names, Milan Landaverde. 9) Minor cleanups all over the place from various others. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (63 commits) bpf: Fix excessive memory allocation in stack_map_alloc() selftests/bpf: Fix return value checks in perf_event_stackmap test selftests/bpf: Add CO-RE relos into linked_funcs selftests libbpf: Use weak hidden modifier for USDT BPF-side API functions libbpf: Don't error out on CO-RE relos for overriden weak subprogs samples, bpf: Move routes monitor in xdp_router_ipv4 in a dedicated thread libbpf: Allow WEAK and GLOBAL bindings during BTF fixup libbpf: Use strlcpy() in path resolution fallback logic libbpf: Add s390-specific USDT arg spec parsing logic libbpf: Make BPF-side of USDT support work on big-endian machines libbpf: Minor style improvements in USDT code libbpf: Fix use #ifdef instead of #if to avoid compiler warning libbpf: Potential NULL dereference in usdt_manager_attach_usdt() selftests/bpf: Uprobe tests should verify param/return values libbpf: Improve string parsing for uprobe auto-attach libbpf: Improve library identification for uprobe binary path resolution selftests/bpf: Test for writes to map key from BPF helpers selftests/bpf: Test passing rdonly mem to global func bpf: Reject writes for PTR_TO_MAP_KEY in check_helper_mem_access bpf: Check PTR_TO_MEM | MEM_RDONLY in check_helper_mem_access ... ==================== Link: https://lore.kernel.org/r/20220408231741.19116-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit b45043192b3e481304062938a6561da2ceea46a6 Author: Yuntao Wang Date: Thu Apr 7 21:04:23 2022 +0800 bpf: Fix excessive memory allocation in stack_map_alloc() The 'n_buckets * (value_size + sizeof(struct stack_map_bucket))' part of the allocated memory for 'smap' is never used after the memlock accounting was removed, thus get rid of it. [ Note, Daniel: Commit b936ca643ade ("bpf: rework memlock-based memory accounting for maps") moved `cost += n_buckets * (value_size + sizeof(struct stack_map_bucket))` up and therefore before the bpf_map_area_alloc() allocation, sigh. In a later step commit c85d69135a91 ("bpf: move memory size checks to bpf_map_charge_init()"), and the overflow checks of `cost >= U32_MAX - PAGE_SIZE` moved into bpf_map_charge_init(). And then 370868107bf6 ("bpf: Eliminate rlimit-based memory accounting for stackmap maps") finally removed the bpf_map_charge_init(). Anyway, the original code did the allocation same way as /after/ this fix. ] Fixes: b936ca643ade ("bpf: rework memlock-based memory accounting for maps") Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220407130423.798386-1-ytcoode@gmail.com commit a1793920b6647447e4757aec4434eb919840acb8 Author: Bjorn Andersson Date: Thu Feb 24 19:54:15 2022 -0800 dt-bindings: arm: qcom: Document sa8540p, sc8180x and sc8280xp Add compatibles for the sa8540p automotive, as well as sc8180x and sc8280xp compute platforms. Also add compatibles for the ADP devboard, the Lenovo Flex 5G, Microsoft Surface Pro X and the sc8280xp QRD. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220225035415.2294821-1-bjorn.andersson@linaro.org commit bd4a2697e5e27a33d345827dfbdebb8f28f4aa87 Author: Bert Kenward Date: Thu Apr 7 16:24:02 2022 +0100 sfc: use hardware tx timestamps for more than PTP The 8000 series and newer NICs all get hardware timestamps from the MAC and can provide timestamps on a normal TX queue, rather than via a slow path through the MC. As such we can use this path for any packet where a hardware timestamp is requested. This also enables support for PTP over transports other than IPv4+UDP. Signed-off-by: Bert Kenward Signed-off-by: Edward Cree Link: https://lore.kernel.org/r/510652dc-54b4-0e11-657e-e37ee3ca26a9@gmail.com Signed-off-by: Jakub Kicinski commit 25faeddcf3c3f31f9f43de5c55f7cbdd13d3ebc7 Author: Evan Quan Date: Fri Mar 25 18:00:02 2022 +0800 drm/amdgpu: expand cg_flags from u32 to u64 With this, we can support more CG flags. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b61b76dfef30945f175d4acfecb9beb862174f01 Author: Marek Vasut Date: Thu Apr 7 23:01:31 2022 +0200 dt-bindings: trivial-devices: Document CPLD on Menlo boards The CPLD on Menlo boards is used to operate custom hardware, document the CPLD DT binding as trivial SPI device. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Mark Brown Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: NXP Linux Team To: linux-spi@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407210131.256045-1-marex@denx.de commit 7057081cfcc584d9eb68ff8d42e5609655301992 Author: Marek Vasut Date: Thu Apr 7 23:01:06 2022 +0200 dt-bindings: trivial-devices: Document CPLD on DH electronics boards The CPLD on DH electronics boards is used to model arbitrary custom glue logic, however it does have SPI interface. Document the CPLD DT binding as trivial SPI device. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Mark Brown Cc: Peng Fan Cc: Rob Herring Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: NXP Linux Team To: linux-spi@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407210106.256027-1-marex@denx.de commit 58389c00d49cf4f9bee50530901834a8503240b6 Author: Marek Vasut Date: Thu Apr 7 12:55:34 2022 +0200 net: phy: micrel: ksz9031/ksz9131: add cabletest support Add cable test support for Micrel KSZ9x31 PHYs. Tested on i.MX8M Mini with KSZ9131RNX in 100/Full mode with pairs shuffled before magnetics: (note: Cable test started/completed messages are omitted) mx8mm-ksz9131-a-d-connected$ ethtool --cable-test eth0 Pair A code OK Pair B code Short within Pair Pair B, fault length: 0.80m Pair C code Short within Pair Pair C, fault length: 0.80m Pair D code OK mx8mm-ksz9131-a-b-connected$ ethtool --cable-test eth0 Pair A code OK Pair B code OK Pair C code Short within Pair Pair C, fault length: 0.00m Pair D code Short within Pair Pair D, fault length: 0.00m Tested on R8A77951 Salvator-XS with KSZ9031RNX and all four pairs connected: (note: Cable test started/completed messages are omitted) r8a7795-ksz9031-all-connected$ ethtool --cable-test eth0 Pair A code OK Pair B code OK Pair C code OK Pair D code OK The CTRL1000 CTL1000_ENABLE_MASTER and CTL1000_AS_MASTER bits are not restored by calling phy_init_hw(), they must be manually cached in ksz9x31_cable_test_start() and restored at the end of ksz9x31_cable_test_get_status(). Signed-off-by: Marek Vasut Cc: Heiner Kallweit Cc: Oleksij Rempel Cc: Paolo Abeni Reviewed-by: Andrew Lunn Tested-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220407105534.85833-1-marex@denx.de Signed-off-by: Jakub Kicinski commit 658d87687cd5a6c8762d1de8abee1e6792d8d71e Author: Yuntao Wang Date: Fri Apr 8 12:14:52 2022 +0800 selftests/bpf: Fix return value checks in perf_event_stackmap test The bpf_get_stackid() function may also return 0 on success as per UAPI BPF helper documentation. Therefore, correct checks from 'val > 0' to 'val >= 0' to ensure that they cover all possible success return values. Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220408041452.933944-1-ytcoode@gmail.com commit 8555defe48610a7efe9f2d72689e2d4f006898d7 Author: Andrii Nakryiko Date: Fri Apr 8 11:14:25 2022 -0700 selftests/bpf: Add CO-RE relos into linked_funcs selftests Add CO-RE relocations into __weak subprogs for multi-file linked_funcs selftest to make sure libbpf handles such combination well. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220408181425.2287230-4-andrii@kernel.org commit 2fa5b0f290e19bb34393e1983be511aab18b683e Author: Andrii Nakryiko Date: Fri Apr 8 11:14:24 2022 -0700 libbpf: Use weak hidden modifier for USDT BPF-side API functions Use __weak __hidden for bpf_usdt_xxx() APIs instead of much more confusing `static inline __noinline`. This was previously impossible due to libbpf erroring out on CO-RE relocations pointing to eliminated weak subprogs. Now that previous patch fixed this issue, switch back to __weak __hidden as it's a more direct way of specifying the desired behavior. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220408181425.2287230-3-andrii@kernel.org commit e89d57d938c8fa80c457982154ed6110804814fe Author: Andrii Nakryiko Date: Fri Apr 8 11:14:23 2022 -0700 libbpf: Don't error out on CO-RE relos for overriden weak subprogs During BPF static linking, all the ELF relocations and .BTF.ext information (including CO-RE relocations) are preserved for __weak subprograms that were logically overriden by either previous weak subprogram instance or by corresponding "strong" (non-weak) subprogram. This is just how native user-space linkers work, nothing new. But libbpf is over-zealous when processing CO-RE relocation to error out when CO-RE relocation belonging to such eliminated weak subprogram is encountered. Instead of erroring out on this expected situation, log debug-level message and skip the relocation. Fixes: db2b8b06423c ("libbpf: Support CO-RE relocations for multi-prog sections") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220408181425.2287230-2-andrii@kernel.org commit 587323cf6a6a6da074f0518444ee7da10f517f45 Author: Lorenzo Bianconi Date: Tue Apr 5 16:15:14 2022 +0200 samples, bpf: Move routes monitor in xdp_router_ipv4 in a dedicated thread In order to not miss any netlink message from the kernel, move routes monitor to a dedicated thread. Fixes: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper") Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/e364b817c69ded73be24b677ab47a157f7c21b64.1649167911.git.lorenzo@kernel.org commit 8e7e5c077cd57ee9a36d58c65f07257dc49a88d5 Author: Matt Roper Date: Thu Apr 7 09:18:39 2022 -0700 drm/i915: Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL The intent of the version check in the mmap ioctl was to maintain support for existing platforms (i.e., ADL/RPL and earlier), but drop support on all future igpu platforms. As we've seen on the dgpu side, the hardware teams are using a more fine-grained numbering system for IP version numbers these days, so it's possible the version number associated with our next igpu could be some form of "12.xx" rather than 13 or higher. Comparing against the full ver.release number will ensure the intent of the check is maintained no matter what numbering the hardware teams settle on. Fixes: d3f3baa3562a ("drm/i915: Reinstate the mmap ioctl for some platforms") Cc: Thomas Hellström Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220407161839.1073443-1-matthew.d.roper@intel.com commit c9cfafc51ec9feff3f10f3517ff398c0e01adeac Author: Drew Fustini Date: Thu Apr 7 08:46:20 2022 -0700 dt-bindings: soc: ti: wkup_m3_ipc: convert bindings to json-schema Convert the wkup_m3_ipc bindings documentation to json-schema. Link: https://lore.kernel.org/linux-arm-kernel/20220221125522.l3tntb6i7yjxp6vb@flattered/ Suggested-by: Nishanth Menon Reviewed-by: Krzysztof Kozlowski Signed-off-by: Drew Fustini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407154618.2297171-1-dfustini@baylibre.com commit 448a0994cc698d41d056f14fb9065305b14f3c75 Author: Lad Prabhakar Date: Wed Apr 6 09:04:17 2022 +0100 dmaengine: sh: Kconfig: Make RZ_DMAC depend on ARCH_RZG2L The DMAC block is identical on Renesas RZ/G2L, RZ/G2UL and RZ/V2L SoC's, so instead of adding dependency for each SoC's add dependency on ARCH_RZG2L. The ARCH_RZG2L config option is already selected by ARCH_R9A07G043, ARCH_R9A07G044 and ARCH_R9A07G054. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220406080417.14593-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul commit 98c8026331ceabe1df579940b81eec75eb49cdd9 Author: Bob Pearson Date: Thu Apr 7 16:04:45 2022 -0500 RDMA/rxe: Remove reliable datagram support The rdma_rxe driver does not actually support the reliable datagram transport but contains two references to RD opcodes in driver code. This commit removes these references to RD transport opcodes which are never used. Link: https://lore.kernel.org/r/cce0f07d-25fc-5880-69e7-001d951750b7@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 409baed5d743c1873a67fcd34d40871a97f037b3 Author: Bob Pearson Date: Thu Apr 7 13:54:17 2022 -0500 RDMA/rxe: Remove support for SMI QPs from rdma_rxe Currently the rdma_rxe driver supports SMI type QPs in a few places which is incorrect. RoCE devices never should support SMI QPs. This commit removes SMI QP support from the driver. Link: https://lore.kernel.org/r/20220407185416.16372-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 5c477ee76810cedb73f6bc7c5e4dbc66b572d16c Author: Bob Pearson Date: Thu Apr 7 13:48:50 2022 -0500 RDMA/rxe: Remove mc_grp_pool from struct rxe_dev Remove struct rxe_dev mc_grp_pool field. This field is no longer used. Link: https://lore.kernel.org/r/20220407184849.14359-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 9227b6cec55e7ab859063918dc2921cc607cef28 Author: Bob Pearson Date: Thu Apr 7 13:43:22 2022 -0500 RDMA/rxe: Remove type 2A memory window capability Currently the rdma_rxe driver claims to support both 2A and 2B type memory windows. But the IBA requires 010-37.2.31: If an HCA supports the Base Memory Management extensions, the HCA shall support either Type 2A or Type 2B MWs, but not both. This commit removes the device capability bit for type 2A memory windows and adds a clarifying comment to rxe_mw.c. Link: https://lore.kernel.org/r/20220407184321.14207-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit ce21211b4d6b992bd727fb8338bf2a8319288503 Author: José Roberto de Souza Date: Wed Apr 6 14:05:40 2022 -0700 drm/i915/display: Fix warnings about PSR lock not held Commit 3b6f409547fb ("drm/i915/display/psr: Lock and unlock PSR around pipe updates") did not took into account async flips with PSR1 and PSR2 HW tracking, causing PSR lock not be held and causing warnings when intel_psr2_program_trans_man_trk_ctl() is executed. So here taking the PSR lock before the earlier return in intel_pipe_update_start/end(). Cc: Jouni Högander Reported-by: Imre Deak Fixes: 3b6f409547fb ("drm/i915/display/psr: Lock and unlock PSR around pipe updates") Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220406210540.493610-1-jose.souza@intel.com commit cc97c6d94ed536020ab26d5c2951958a3735f4c6 Author: Robin Murphy Date: Tue Apr 5 15:35:59 2022 +0100 RDMA/usnic: Refactor usnic_uiom_alloc_pd() Rather than hard-coding pci_bus_type, pass the PF device through to usnic_uiom_alloc_pd() and retrieve its bus there. This prepares for iommu_domain_alloc() changing to take a device rather than a bus_type. Link: https://lore.kernel.org/r/ef607cb3f5a09920b86971b8c8e60af8c647457e.1649169359.git.robin.murphy@arm.com Signed-off-by: Robin Murphy Reported-by: kernel test robot Signed-off-by: Jason Gunthorpe commit d9539fb7c21ef5f47db0aeed0c32588479e32184 Author: Robin Murphy Date: Tue Apr 5 13:19:59 2022 +0100 RDMA/usnic: Stop using iommu_present() Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device(s) we care about. Replace iommu_present() with a more appropriate check at probe time, and garbage-collect the resulting empty init function. Link: https://lore.kernel.org/r/f707b4248e1d33b6d2c7f1d7c94febb802cf9890.1649161199.git.robin.murphy@arm.com Signed-off-by: Robin Murphy Signed-off-by: Jason Gunthorpe commit 4302005f07d2607b1122bd2bc9226e9d1a0595ac Author: Jakob Koschel Date: Thu Mar 31 11:16:34 2022 +0200 IB/SA: 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. 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/r/20220331091634.644840-1-jakobkoschel@gmail.com Reviewed-by: Leon Romanovsky Signed-off-by: Jakob Koschel Signed-off-by: Jason Gunthorpe commit 4c5e242d3e937bb9f9c226d06888d9189826879d Author: Bjorn Helgaas Date: Thu Mar 3 16:00:39 2022 -0600 x86/PCI: Clip only host bridge windows for E820 regions ACPI firmware advertises PCI host bridge resources via PNP0A03 _CRS methods. Some BIOSes include non-window address space in _CRS, and if we allocate that non-window space for PCI devices, they don't work. 4dc2287c1805 ("x86: avoid E820 regions when allocating address space") works around this issue by clipping out any regions mentioned in the E820 table in the allocate_resource() path, but the implementation has a couple issues: - The clipping is done for *all* allocations, not just those for PCI address space, and - The clipping is done at each allocation instead of being done once when setting up the host bridge windows. Rework the implementation so we only clip PCI host bridge windows, and we do it once when setting them up. Example output changes: BIOS-e820: [mem 0x00000000b0000000-0x00000000c00fffff] reserved + acpi PNP0A08:00: clipped [mem 0xc0000000-0xfebfffff window] to [mem 0xc0100000-0xfebfffff window] for e820 entry [mem 0xb0000000-0xc00fffff] - pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff window] + pci_bus 0000:00: root bus resource [mem 0xc0100000-0xfebfffff window] Link: https://lore.kernel.org/r/20220304035110.988712-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg Acked-by: Rafael J. Wysocki commit 31bf0f4333254469ebf34d7f17d64a57bce516d4 Author: Bjorn Helgaas Date: Thu Apr 7 17:42:02 2022 -0500 x86: Log resource clipping for E820 regions When remove_e820_regions() clips a resource because an E820 region overlaps it, log a note in dmesg to add in debugging. Signed-off-by: Bjorn Helgaas commit 1ceaccf2b267165fcff39e374f8596dfccd2321b Author: Krzysztof Kozlowski Date: Thu Apr 7 22:41:15 2022 +0200 arm64: dts: synaptics: remove unused DTSI for AS370 The as370.dtsi for Synaptics AS370 SoC does not have a user (DTS board file), is uncompilable and untestable. It was added back in 2018. No user appeared since that time, so assume it won't be added. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Arnd Bergmann commit 3a06ec0a996dc8c4bc518f0b6bedc3587dd15169 Author: Andrii Nakryiko Date: Thu Apr 7 16:04:46 2022 -0700 libbpf: Allow WEAK and GLOBAL bindings during BTF fixup During BTF fix up for global variables, global variable can be global weak and will have STB_WEAK binding in ELF. Support such global variables in addition to non-weak ones. This is not the problem when using BPF static linking, as BPF static linker "fixes up" BTF during generation so that libbpf doesn't have to do it anymore during bpf_object__open(), which led to this not being noticed for a while, along with a pretty rare (currently) use of __weak variables and maps. Reported-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220407230446.3980075-2-andrii@kernel.org commit 3c0dfe6e4c43ea0cf252ff4cb7a332423866d488 Author: Andrii Nakryiko Date: Thu Apr 7 16:04:45 2022 -0700 libbpf: Use strlcpy() in path resolution fallback logic Coverity static analyzer complains that strcpy() can cause buffer overflow. Use libbpf_strlcpy() instead to be 100% sure this doesn't happen. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220407230446.3980075-1-andrii@kernel.org commit 0173ce55e50800a1a59dddcb972fe459cff0fee4 Author: Andy Shevchenko Date: Fri Apr 1 13:35:59 2022 +0300 pinctrl: npcm7xx: Switch to use for_each_gpiochip_node() helper Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, do the following: - use a temporary variable for struct device pointer to shorten a few lines - get rid of a temporary variable for vIRQ number, assign it directly - switch to fwnode APIs where it makes sense Signed-off-by: Andy Shevchenko commit 5e455dd93397b3cad0b6767654d29919d28d3a89 Author: Andy Shevchenko Date: Fri Apr 1 13:35:58 2022 +0300 pinctrl: renesas: rza1: Switch to use for_each_gpiochip_node() helper Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, switch to fwnode APIs where it makes sense. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven commit 1e0afd470e26f83c674ff239dd5b5347cdc24fdb Author: Andy Shevchenko Date: Fri Apr 1 13:35:57 2022 +0300 pinctrl: renesas: rza1: Replace custom code by gpiochip_node_count() call Since we have generic function to count GPIO controller nodes under a given device, there is no need to open code it. Replace custom code by gpiochip_node_count() call. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven commit 3d427228f7370894680580fcd0381c0349624fa1 Author: Arnd Bergmann Date: Sat Apr 2 16:52:55 2022 +0200 ARM: ixp4xx: enable multiplatform support After all the work that Linus Walleij did on this platform, it can be part of a generic kernel build as well. Note that there are known bugs in little-endian mode on ixp4xx, and no other ARMv5 platform at this point supports big-endian mode, or is likely to in the future, so there is limited practical value in this, but it helps with build testing and ixp4xx little-endian support may get fixed in the future. Reviewed-by: Linus Walleij Tested-by: Linus Walleij Signed-off-by: Arnd Bergmann commit 5d6f52671e76ca2d55d74e676ac4c38ceb14a2d3 Author: Arnd Bergmann Date: Mon Apr 4 11:52:31 2022 +0200 ARM: rework endianess selection Choosing big-endian vs little-endian kernels in Kconfig has not worked correctly since the introduction of CONFIG_ARCH_MULTIPLATFORM a long time ago. The problems is that CONFIG_BIG_ENDIAN depends on ARCH_SUPPORTS_BIG_ENDIAN, which can set by any one platform in the config, but would actually have to be supported by all of them. This was mostly ok for ARMv6/ARMv7 builds, since these are BE8 and tend to just work aside from problems in nonportable device drivers. For ARMv4/v5 machines, CONFIG_BIG_ENDIAN and CONFIG_ARCH_MULTIPLATFORM were never set together, so this was disabled on all those machines except for IXP4xx. As IXP4xx can now become part of ARCH_MULTIPLATFORM, it seems better to formalize this logic: all ARMv4/v5 platforms get an explicit dependency on being either big-endian (ixp4xx) or little-endian (the rest). We may want to fix ixp4xx in the future to support both, but it does not work in LE mode at the moment. For the ARMv6/v7 platforms, there are two ways this could be handled a) allow both modes only for platforms selecting 'ARCH_SUPPORTS_BIG_ENDIAN' today, but only LE mode for the others, given that these were added intentionally at some point. b) allow both modes everwhere, given that it was already possible to build that way by e.g. selecting ARCH_VIRT, and that the list is not an accurate reflection of which platforms may or may not work. Out of these, I picked b) because it seemed slighly more logical to me. Signed-off-by: Arnd Bergmann commit a3102fafdce6f150e5a46e1725bb1732f8953a01 Author: Arnd Bergmann Date: Sat Apr 2 16:45:07 2022 +0200 ARM: iop32x: enable multiplatform support After iop32x was converted to the generic multi-irq entry code, nothing really stops us from building it into a generic kernel. The two last headers can simply be removed, the mach/irqs.h gets replaced with the sparse-irq intiialization from the board specific .nr_irqs value, and the decompressor debug output can use the debug_ll hack that all other platforms use. Signed-off-by: Arnd Bergmann commit 8c1fb11b8a77dc489a8ef6d96c38c1297b629d06 Author: Arnd Bergmann Date: Sat Apr 2 16:08:11 2022 +0200 ARM: s3c: enable s3c24xx multiplatform support With the custom ISA I/O and the missing sparse-irq support out of the way, s3c24xx can now be built into the same kernel as all other ARM9 based platforms. Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 8f0e3af81711bf72b9c6138b0138bdc330d8c388 Author: Geert Uytterhoeven Date: Tue Mar 29 11:38:03 2022 +0200 dt-bindings: memory: renesas,rpc-if: Document R-Car H3/M3/E3 support Document support for the SPI Multi I/O Bus Controller (RPC-IF) in the R-Car H3, M3-W, M3-W+, M3-N, and E3 SoCs. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Acked-by: Rob Herring Link: https://lore.kernel.org/r/3784b6cb76a008fb56d6cb4ba228d78c77e710fa.1648546583.git.geert+renesas@glider.be Signed-off-by: Krzysztof Kozlowski commit 239556a34385706562a481f452ce0963fb569cb8 Author: Raphael-Xu <13691752556@139.com> Date: Fri Apr 8 22:11:19 2022 +0800 ASoC: update to support either TAS2764 or TAS2780 update tas27xx.yaml to support either TAS2764 or TAS2780 Signed-off-by: Raphael-Xu <13691752556@139.com> Link: https://lore.kernel.org/r/20220408141119.958-2-13691752556@139.com Signed-off-by: Mark Brown commit aecf03614d5ded3f930143cda2ba3d76d09b107d Author: Raphael-Xu <13691752556@139.com> Date: Fri Apr 8 22:11:18 2022 +0800 ASoC: rename tas2764 to tas27xx rename tas2764.yaml to tas27xx.yaml Signed-off-by: Raphael-Xu <13691752556@139.com> Link: https://lore.kernel.org/r/20220408141119.958-1-13691752556@139.com Signed-off-by: Mark Brown commit 7a80167b08f52e7b5eaa18a9d515efdcff9085fc Merge: a2c11c5b68f49 6181ab31824f7 Author: Mark Brown Date: Fri Apr 8 15:43:43 2022 +0100 ASoC: mediatek: mt8192: support rt1015p_rt5682s Merge series from Jiaxin Yu : The series reuses mt8192-mt6359-rt1015-rt5682.c for supporting machine driver with rt1015p speaker amplifier and rt5682s headset codec. commit a2c11c5b68f49b36be9ad4a60165bfbeca5cbb1d Author: Lv Ruyi Date: Fri Apr 8 10:03:09 2022 +0000 ASoC: mediatek: mt8195: Make sure of_device_id table are NULL terminated Fix the following coccicheck review: ./sound/soc/mediatek/mt8195/mt8195-mt6359.c:1657:1-2: mt8195_mt6359_dt_match is not NULL terminated at line 1657 Fixes: 86a6b9c9dfff ("ASoC: mediatek: mt8195: add machine support for max98390 and rt5682") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220408100309.2495462-1-lv.ruyi@zte.com.cn Signed-off-by: Mark Brown commit 88557685cd72cf0db686a4ebff3fad4365cb6071 Author: Jiantao Zhang Date: Wed Mar 9 20:01:04 2022 +0800 PCI: dwc: Fix setting error return on MSI DMA mapping failure When dma_mapping_error() returns error because of no enough memory, but dw_pcie_host_init() returns success, which will mislead the callers. Link: https://lore.kernel.org/r/30170911-0e2f-98ce-9266-70465b9073e5@huawei.com Fixes: 07940c369a6b ("PCI: dwc: Fix MSI page leakage in suspend/resume") Signed-off-by: Jianrong Zhang Signed-off-by: Jiantao Zhang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 214e0d8fe4a813ae6ffd62bc2dfe7544c20914f4 Author: Miaoqian Lin Date: Wed Mar 9 09:19:52 2022 +0000 PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup() The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Link: https://lore.kernel.org/r/20220309091953.5630-1-linmq006@gmail.com Fixes: 87e8657ba99c ("PCI: mediatek: Add new method to get shared pcie-cfg base address") Signed-off-by: Miaoqian Lin Signed-off-by: Lorenzo Pieralisi Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Acked-by: Rob Herring commit 0bd1767942625c0f7654b7f0829920e1dabcfbcf Author: Luca Weiss Date: Mon Dec 13 09:26:06 2021 +0100 dt-bindings: thermal: tsens: Add SM6350 compatible Add devicetree compatible for tsens on SM6350 SoC. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211213082614.22651-6-luca.weiss@fairphone.com commit 998282c6dad8ff0f981d2f18b1d0278760ff5d81 Author: Luca Weiss Date: Mon Dec 13 09:26:04 2021 +0100 dt-bindings: qcom,pdc: Add SM6350 compatible Add devicetree compatible for pdc on SM6350 SoC. Also correct the compatibles for sm8250 and sm8350. Signed-off-by: Luca Weiss Acked-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211213082614.22651-4-luca.weiss@fairphone.com commit 700a6ef1fa6096b2782c03a6be41af0f88afad1d Merge: ded6dffaed5ed bd022685bd441 Author: Andrii Nakryiko Date: Thu Apr 7 20:59:12 2022 -0700 Merge branch 'Add USDT support for s390' Ilya Leoshkevich says: ==================== This series adds USDT support for s390, making the "usdt" test pass there. Patch 1 is a collection of minor cleanups, patch 2 adds BPF-side support, patch 3 adds userspace-side support. ==================== Signed-off-by: Andrii Nakryiko commit bd022685bd441056365e9a44a6bf940f45054250 Author: Ilya Leoshkevich Date: Thu Apr 7 23:44:11 2022 +0200 libbpf: Add s390-specific USDT arg spec parsing logic The logic is superficially similar to that of x86, but the small differences (no need for register table and dynamic allocation of register names, no $ sign before constants) make maintaining a common implementation too burdensome. Therefore simply add a s390x-specific version of parse_usdt_arg(). Note that while bcc supports index registers, this patch does not. This should not be a problem in most cases, since s390 uses a default value "nor" for STAP_SDT_ARG_CONSTRAINT. Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220407214411.257260-4-iii@linux.ibm.com commit b9c7ba58777acfd0892b808aea25074d46e0618f Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:39 2022 +0300 Documentation/x86: Document TDX kernel architecture Document the TDX guest architecture details like #VE support, shared memory, etc. [ dhansen: made some wording changes, including removing all the plural "#VE's" and "#VEs". ] Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-31-kirill.shutemov@linux.intel.com commit 6b58692032c1d9ee9694e446929ebf9f8f2e0f6e Author: Michael Straube Date: Fri Apr 8 14:46:15 2022 +0200 staging: r8188eu: remove SetHalDefVar8188EUsb() In SetHalDefVar8188EUsb() there is only the case HAL_DEF_DBG_DM_FUNC. Move its functionality to a new static function in ioctl_linux.c and remove SetHalDefVar8188EUsb(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220408124615.3687-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f90613bb2cb6496874ea4aad5561727550e84ce3 Author: Michael Straube Date: Thu Apr 7 21:28:19 2022 +0200 staging: r8188eu: clean up rtw_ioctl.h There are lots of unused macros, structs, etc. in the header rtw_ioctl.h. Remove them. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 245be6d3cfd568eddd4b3757c46ad9bc10c1ff3f Author: Michael Straube Date: Thu Apr 7 21:28:18 2022 +0200 staging: r8188eu: remove header usb_vendor_req.h Nothing from the header usb_vendor_req.h is used in the driver code. Remove the header. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0f0360ca067cdab8eb9a33247f27cd99dba24d96 Author: Michael Straube Date: Thu Apr 7 21:28:17 2022 +0200 staging: r8188eu: remove unused prototype usbvendorrequest() Remove unused prototype usbvendorrequest(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61e95eac86971c19566c16cd3e4b608d4fd077bd Author: Michael Straube Date: Thu Apr 7 21:28:16 2022 +0200 staging: r8188eu: remove unused enums from odm.h Remove unused enums from odm.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c03a2dc6db8b0596fbda57df21262dd1bb9ac05 Author: Michael Straube Date: Thu Apr 7 21:28:15 2022 +0200 staging: r8188eu: remove unused fields from struct eeprom_priv Remove unused fields from struct eeprom_priv. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d9448fa5c13d8345d6c6f5461e94697d2e1ce036 Author: Michael Straube Date: Thu Apr 7 21:28:14 2022 +0200 staging: r8188eu: ROMVer is always zero The variable ROMVer in struct HAL_VERSION is set to zero and never changed. Remove it and replace its use with zero. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8fd86c6b8e70ec3d6edac8da1f69b86c009eb14d Author: Michael Straube Date: Thu Apr 7 21:28:13 2022 +0200 staging: r8188eu: move struct rt_firmware to rtw_fw.h Move the rt_firmware structure to the header rtw_fw.h to have firmware related things in one place. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a6c757f21d313ad227615d896c2dcafe4f7783ff Author: Michael Straube Date: Thu Apr 7 21:28:12 2022 +0200 staging: r8188eu: remove unused macros from basic_types.h Remove unused macros from basic_types.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407192819.10661-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9c916fa3407d344f384fb78baa5cfdd9cfdf8bc0 Author: Michael Straube Date: Fri Apr 8 10:19:56 2022 +0200 staging: rtl8723bs: remove header rtw_ioctl.h Nothing from the header rtw_ioctl.h is used in the driver code. Remove the header. Reviewed-by: Hans de Goede Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220408081956.1093-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f8ab914705853aa7a971977121c493fc244adb04 Author: Rebecca Mckeever Date: Thu Apr 7 20:12:51 2022 -0500 staging: rtl8192u: use min_t/max_t macros instead of if else Replace if else statement with min_t or max_t macros to increase readability and conform to Linux kernel coding style. The _t versions of the macros must be used to avoid applying typeof to the bit fields pPeerHTCap->MaxRxAMPDUFactor, and pPeerHTCap->MPDUDensity. Using u32 assures the reader that the value with not be truncated without having to look up the types of the variables involved. Found with minmax coccinelle script. Reviewed-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/65518c0b366bf199903c6c530774c61ba6087165.1649378587.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 49ce1b1fbca89e8c4b1cbbd7064b26f7b9d1a365 Author: Rebecca Mckeever Date: Thu Apr 7 20:12:50 2022 -0500 staging: rtl8192u: replace ternary statement with if and assignment Replace ternary statement with an if statement followed by an assignment to increase readability and make error handling more obvious. Found with minmax coccinelle script. Reviewed-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/36059ec66a2f3d58a8e339aa4f262772eabd3ef0.1649378587.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 096950e230b8d83645c7cf408b9f399f58c08b96 Author: Dan Carpenter Date: Tue Mar 15 09:59:44 2022 +0300 PCI: rockchip: Fix find_first_zero_bit() limit The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits. Link: https://lore.kernel.org/r/20220315065944.GB13572@kili Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Signed-off-by: Dan Carpenter Signed-off-by: Lorenzo Pieralisi commit 0aa3a0937feeb91a0e4e438c3c063b749b194192 Author: Dan Carpenter Date: Tue Mar 15 09:58:29 2022 +0300 PCI: cadence: Fix find_first_zero_bit() limit The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits. Link: https://lore.kernel.org/r/20220315065829.GA13572@kili Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller") Signed-off-by: Dan Carpenter Signed-off-by: Lorenzo Pieralisi commit 4bdb11926e486757ae01312228df60d7a215b3e5 Author: Lucas Stach Date: Wed Mar 30 12:46:20 2022 +0200 arm64: dts: imx8mp: add GPU nodes Add the DT nodes for both the 3D and 2D GPU cores found on the i.MX8MP. etnaviv-gpu 38000000.gpu: model: GC7000, revision: 6204 etnaviv-gpu 38008000.gpu: model: GC520, revision: 5341 [drm] Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0 Signed-off-by: Lucas Stach Reviewed-by: Laurent Pinchart Tested-by: Alexander Stein Tested-by: Peng Fan Signed-off-by: Shawn Guo commit fc0f051246212675de77c352ce955a5738e1419d Author: Lucas Stach Date: Wed Mar 30 12:46:19 2022 +0200 arm64: dts: imx8mp: add GPC node with GPU power domains Add the power domains for the GPUs, which do not require any interaction with a blk-ctrl, but are simply two PU domains nested inside a MIX domain. Signed-off-by: Lucas Stach Reviewed-by: Laurent Pinchart Tested-by: Peng Fan Signed-off-by: Shawn Guo commit b49ceddc4b1958f44755ce447664203f73dd7c66 Author: Bjorn Andersson Date: Wed Feb 16 20:02:05 2022 -0800 arm64: defconfig: Enable Qualcomm PCIe Gen2 PHY The Qualcomm QCS404 platform uses the PCIe Gen2 PHY, enable the driver for this to ensure that PCIe is functional. Signed-off-by: Bjorn Andersson Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20220217040205.1898644-1-bjorn.andersson@linaro.org commit e2dfce24f4175e8ba183d5800f669fc89843df54 Author: Zong Li Date: Mon Mar 28 17:52:25 2022 +0800 dmaengine: sf-pdma: Get number of channel by device tree It currently assumes that there are always four channels, it would cause the error if there is actually less than four channels. Change that by getting number of channel from device tree. For backwards-compatibility, it uses the default value (i.e. 4) when there is no 'dma-channels' information in dts. Signed-off-by: Zong Li Acked-by: Palmer Dabbelt Reviewed-by: Bin Meng Link: https://lore.kernel.org/r/f08a95b6582a51712c5b2c3cb859136d07bfa8b9.1648461096.git.zong.li@sifive.com Signed-off-by: Vinod Koul commit 06006ad29abeee1f94d1793107309ce100067e46 Author: Zong Li Date: Mon Mar 28 17:52:22 2022 +0800 dt-bindings: dma-engine: sifive,fu540: Add dma-channels property and modify compatible Add dma-channels property, then we can determine how many channels there by device tree, rather than statically defining it in PDMA driver. In addition, we also modify the compatible for PDMA versioning scheme. Signed-off-by: Zong Li Reviewed-by: Rob Herring Suggested-by: Palmer Dabbelt Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Acked-by: Krzysztof Kozlowski Reviewed-by: Bin Meng Link: https://lore.kernel.org/r/7cc9a7b5f7e6c28fc9eb172c441b5aed2159b8a0.1648461096.git.zong.li@sifive.com Signed-off-by: Vinod Koul commit bb949ed9b16ba4575c76f7be55d4279e35ddccc1 Author: Andy Shevchenko Date: Fri Apr 1 13:35:55 2022 +0300 pinctrl: stm32: Switch to use for_each_gpiochip_node() helper Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, switch to fwnode APIs where it makes sense. Signed-off-by: Andy Shevchenko Reviewed-by: Fabien Dessenne commit d9463201ec0824037a9ca84b9bb03a79d4460cfb Author: Andy Shevchenko Date: Fri Apr 1 13:35:54 2022 +0300 pinctrl: stm32: Replace custom code by gpiochip_node_count() call Since we have generic function to count GPIO controller nodes under a given device, there is no need to open code it. Replace custom code by gpiochip_node_count() call. Signed-off-by: Andy Shevchenko Reviewed-by: Fabien Dessenne commit 0b19dde90ad004592792a928c75e80612be3e2e8 Author: Andy Shevchenko Date: Fri Apr 1 13:35:53 2022 +0300 gpiolib: Introduce gpiochip_node_count() helper The gpiochip_node_count() helper iterates over the device child nodes that have the "gpio-controller" property set. It returns the number of such nodes under a given device. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Bartosz Golaszewski commit 85ebb1a6bd62147ebcfa70500d513331a8daf9e0 Author: Andy Shevchenko Date: Fri Apr 1 13:35:52 2022 +0300 gpiolib: Introduce for_each_gpiochip_node() loop helper Introduce for_each_gpiochip_node() loop helper which iterates over the GPIO controller child nodes of a given device. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Acked-by: Bartosz Golaszewski commit 85b15c268f29263658dc9e9dff5847be935d4f0f Merge: 4a778f3d53df3 fd23e0e250c6a Author: David S. Miller Date: Fri Apr 8 13:45:44 2022 +0100 Merge branch 'net-sched-offload-failure-error-reporting' Ido Schimmel says: ==================== net/sched: Better error reporting for offload failures This patchset improves error reporting to user space when offload fails during the flow action setup phase. That is, when failures occur in the actions themselves, even before calling device drivers. Requested / reported in [1]. This is done by passing extack to the offload_act_setup() callback and making use of it in the various actions. Patches #1-#2 change matchall and flower to log error messages to user space in accordance with the verbose flag. Patch #3 passes extack to the offload_act_setup() callback from the various call sites, including matchall and flower. Patches #4-#11 make use of extack in the various actions to report offload failures. Patch #12 adds an error message when the action does not support offload at all. Patches #13-#14 change matchall and flower to stop overwriting more specific error messages. [1] https://lore.kernel.org/netdev/20220317185249.5mff5u2x624pjewv@skbuf/ ==================== Signed-off-by: David S. Miller commit fd23e0e250c6a7a7fd8a2ec9ab4253299471c163 Author: Ido Schimmel Date: Thu Apr 7 10:35:33 2022 +0300 net/sched: flower: Avoid overwriting error messages The various error paths of tc_setup_offload_action() now report specific error messages. Remove the generic messages to avoid overwriting the more specific ones. Before: # tc filter add dev dummy0 ingress pref 1 proto ip flower skip_sw dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 Error: cls_flower: Failed to setup flow action. We have an error talking to the kernel After: # tc filter add dev dummy0 ingress pref 1 proto ip flower skip_sw dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 Error: act_police: Offload not supported when conform/exceed action is "reclassify". We have an error talking to the kernel Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 0cba5c34b8f4b4b81e5102992c8a9e189ec27768 Author: Ido Schimmel Date: Thu Apr 7 10:35:32 2022 +0300 net/sched: matchall: Avoid overwriting error messages The various error paths of tc_setup_offload_action() now report specific error messages. Remove the generic messages to avoid overwriting the more specific ones. Before: # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000 Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel After: # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000 Error: act_police: Offload not supported when conform/exceed action is "reclassify". We have an error talking to the kernel Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit c440615ffbcb9c06975103e5abbcb094589329d1 Author: Ido Schimmel Date: Thu Apr 7 10:35:31 2022 +0300 net/sched: cls_api: Add extack message for unsupported action offload For better error reporting to user space, add an extack message when the requested action does not support offload. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action nat ingress 192.0.2.1 198.51.100.1 Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-181 [000] b..1. 88.406093: netlink_extack: msg=Action does not support offload tc-181 [000] ..... 88.406108: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit f8fab3169464623b88d0f423f8de2b28809c2fcf Author: Ido Schimmel Date: Thu Apr 7 10:35:30 2022 +0300 net/sched: act_vlan: Add extack message for offload failure For better error reporting to user space, add an extack message when vlan action offload fails. Currently, the failure cannot be triggered, but add a message in case the action is extended in the future to support more than the current set of modes. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit ee367d44b93664feaeea739c1324e914817be6f5 Author: Ido Schimmel Date: Thu Apr 7 10:35:29 2022 +0300 net/sched: act_tunnel_key: Add extack message for offload failure For better error reporting to user space, add an extack message when tunnel_key action offload fails. Currently, the failure cannot be triggered, but add a message in case the action is extended in the future to support more than set/release modes. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit a9c64939b669b3c83cc54738d1986430e6beaff2 Author: Ido Schimmel Date: Thu Apr 7 10:35:28 2022 +0300 net/sched: act_skbedit: Add extack messages for offload failure For better error reporting to user space, add extack messages when skbedit action offload fails. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action skbedit queue_mapping 1234 Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-185 [002] b..1. 31.802414: netlink_extack: msg=act_skbedit: Offload not supported when "queue_mapping" option is used tc-185 [002] ..... 31.802418: netlink_extack: msg=cls_matchall: Failed to setup flow action # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action skbedit inheritdsfield Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-187 [002] b..1. 45.985145: netlink_extack: msg=act_skbedit: Offload not supported when "inheritdsfield" option is used tc-187 [002] ..... 45.985160: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit b50e462bc22df4488ec04d85606646e3db5952b8 Author: Ido Schimmel Date: Thu Apr 7 10:35:27 2022 +0300 net/sched: act_police: Add extack messages for offload failure For better error reporting to user space, add extack messages when police action offload fails. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000 Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-182 [000] b..1. 21.592969: netlink_extack: msg=act_police: Offload not supported when conform/exceed action is "reclassify" tc-182 [000] ..... 21.592982: netlink_extack: msg=cls_matchall: Failed to setup flow action # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action police rate 100Mbit burst 10000 conform-exceed drop/continue Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-184 [000] b..1. 38.882579: netlink_extack: msg=act_police: Offload not supported when conform/exceed action is "continue" tc-184 [000] ..... 38.882593: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit bf3b99e4f9ce52e8da6158894be5679d1217082b Author: Ido Schimmel Date: Thu Apr 7 10:35:26 2022 +0300 net/sched: act_pedit: Add extack message for offload failure For better error reporting to user space, add an extack message when pedit action offload fails. Currently, the failure cannot be triggered, but add a message in case the action is extended in the future to support more than set/add commands. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit bca3821d19d9aa05cd8164e4f716150d6ef7e5a5 Author: Ido Schimmel Date: Thu Apr 7 10:35:25 2022 +0300 net/sched: act_mpls: Add extack messages for offload failure For better error reporting to user space, add extack messages when mpls action offload fails. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action mpls dec_ttl Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-182 [000] b..1. 18.693915: netlink_extack: msg=act_mpls: Offload not supported when "dec_ttl" option is used tc-182 [000] ..... 18.693921: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 4dcaa50d02927f045c8653ba992aadc7c94ee71a Author: Ido Schimmel Date: Thu Apr 7 10:35:24 2022 +0300 net/sched: act_mirred: Add extack message for offload failure For better error reporting to user space, add an extack message when mirred action offload fails. Currently, the failure cannot be triggered, but add a message in case the action is extended in the future to support more than ingress/egress mirror/redirect. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 69642c2ab2f553fd8c4c121fcdf3b3054c727e86 Author: Ido Schimmel Date: Thu Apr 7 10:35:23 2022 +0300 net/sched: act_gact: Add extack messages for offload failure For better error reporting to user space, add extack messages when gact action offload fails. Example: # echo 1 > /sys/kernel/tracing/events/netlink/netlink_extack/enable # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action continue Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-181 [002] b..1. 105.493450: netlink_extack: msg=act_gact: Offload of "continue" action is not supported tc-181 [002] ..... 105.493466: netlink_extack: msg=cls_matchall: Failed to setup flow action # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action reclassify Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-183 [002] b..1. 124.126477: netlink_extack: msg=act_gact: Offload of "reclassify" action is not supported tc-183 [002] ..... 124.126489: netlink_extack: msg=cls_matchall: Failed to setup flow action # tc filter add dev dummy0 ingress pref 1 proto all matchall skip_sw action pipe action drop Error: cls_matchall: Failed to setup flow action. We have an error talking to the kernel # cat /sys/kernel/tracing/trace_pipe tc-185 [002] b..1. 137.097791: netlink_extack: msg=act_gact: Offload of "pipe" action is not supported tc-185 [002] ..... 137.097804: netlink_extack: msg=cls_matchall: Failed to setup flow action Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit c2ccf84ecb715bb81dc7f51e69d680a95bf055ae Author: Ido Schimmel Date: Thu Apr 7 10:35:22 2022 +0300 net/sched: act_api: Add extack to offload_act_setup() callback The callback is used by various actions to populate the flow action structure prior to offload. Pass extack to this callback so that the various actions will be able to report accurate error messages to user space. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 11c95317bc1a70b305b978ac4bec39e224142094 Author: Ido Schimmel Date: Thu Apr 7 10:35:21 2022 +0300 net/sched: flower: Take verbose flag into account when logging error messages The verbose flag was added in commit 81c7288b170a ("sched: cls: enable verbose logging") to avoid suppressing logging of error messages that occur "when the rule is not to be exclusively executed by the hardware". However, such error messages are currently suppressed when setup of flow action fails. Take the verbose flag into account to avoid suppressing error messages. This is done by using the extack pointer initialized by tc_cls_common_offload_init(), which performs the necessary checks. Before: # tc filter add dev dummy0 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 # tc filter add dev dummy0 ingress pref 2 proto ip flower verbose dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 After: # tc filter add dev dummy0 ingress pref 1 proto ip flower dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 # tc filter add dev dummy0 ingress pref 2 proto ip flower verbose dst_ip 198.51.100.1 action police rate 100Mbit burst 10000 Warning: cls_flower: Failed to setup flow action. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 4c096ea2d67cad959b5de9f98015e9291c7b7b56 Author: Ido Schimmel Date: Thu Apr 7 10:35:20 2022 +0300 net/sched: matchall: Take verbose flag into account when logging error messages The verbose flag was added in commit 81c7288b170a ("sched: cls: enable verbose logging") to avoid suppressing logging of error messages that occur "when the rule is not to be exclusively executed by the hardware". However, such error messages are currently suppressed when setup of flow action fails. Take the verbose flag into account to avoid suppressing error messages. This is done by using the extack pointer initialized by tc_cls_common_offload_init(), which performs the necessary checks. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 4a778f3d53df3c8582d7417d9ea62bb8d099446a Merge: e89006be0bc2b e33163a40d1a1 Author: David S. Miller Date: Fri Apr 8 13:41:31 2022 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/nex t-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-04-07 Alexander Lobakin says: This hunts down several places around packet templates/dummies for switch rules which are either repetitive, fragile or just not really readable code. It's a common need to add new packet templates and to review such changes as well, try to simplify both with the help of a pair macros and aliases. ice_find_dummy_packet() became very complex at this point with tons of nested if-elses. It clearly showed this approach does not scale, so convert its logics to the simple mask-match + static const array. bloat-o-meter is happy about that (built w/ LLVM 13): add/remove: 0/1 grow/shrink: 1/1 up/down: 2/-1058 (-1056) Function old new delta ice_fill_adv_dummy_packet 289 291 +2 ice_adv_add_update_vsi_list 201 - -201 ice_add_adv_rule 2950 2093 -857 Total: Before=414512, After=413456, chg -0.25% add/remove: 53/52 grow/shrink: 0/0 up/down: 4660/-3988 (672) RO Data old new delta ice_dummy_pkt_profiles - 672 +672 Total: Before=37895, After=38567, chg +1.77% Diffstat also looks nice, and adding new packet templates now takes less lines. We'll probably come out with dynamic template crafting in a while, but for now let's improve what we have currently. ==================== Signed-off-by: David S. Miller commit c3e348666713bda41c76fb7f2b3606b143421dfd Author: Phil Sutter Date: Thu Mar 24 16:34:22 2022 +0100 netfilter: nf_log_syslog: Consolidate entry checks Every syslog logging callback has to perform the same check to cover for rogue containers, introduce a helper for clarity. Drop the FIXME as there is a viable solution since commit 2851940ffee31 ("netfilter: allow logging from non-init namespaces"). Suggested-by: Florian Westphal Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 0c8783806f63ce7cfbb4025d67e0f65fda6dde6b Author: Phil Sutter Date: Thu Mar 24 15:03:41 2022 +0100 netfilter: nf_log_syslog: Don't ignore unknown protocols With netdev and bridge nfprotos, loggers may see arbitrary ethernet frames. Print at least basic info like interfaces and MAC header data. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 39ab798fc14dc8b8fdab4177c69ffc06e3d99698 Author: Phil Sutter Date: Thu Mar 24 15:03:40 2022 +0100 netfilter: nf_log_syslog: Merge MAC header dumpers The functions for IPv4 and IPv6 were almost identical apart from extra SIT tunnel device handling in the latter. Signed-off-by: Phil Sutter Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit a8a2c274dda4ae0d63ffbe9812e67dc2cf5dcdd9 Author: Lucas Stach Date: Wed Mar 30 12:46:18 2022 +0200 soc: imx: gpcv2: add support for i.MX8MP power domains This adds driver support for all the GPC power domains found on the i.MX8MP SoC. Signed-off-by: Lucas Stach Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Tested-by: Peng Fan Signed-off-by: Shawn Guo commit d9651b99dd65e861b1c525d0e8ab8da0d37642ca Author: Lucas Stach Date: Wed Mar 30 12:46:16 2022 +0200 soc: imx: gpcv2: add PGC control register indirection The PGC control registers in the shared (not per-PGC) region of the GPC address space have different offsets on i.MX8MP to make space for additional interrupt control registers. Signed-off-by: Lucas Stach Reviewed-by: Laurent Pinchart Tested-by: Peng Fan Signed-off-by: Shawn Guo commit 579df4288896f22c5e8c38aee771edc5f25bf461 Author: Michael Walle Date: Mon Feb 28 14:25:23 2022 +0100 arm64: dts: imx8mn-evk: add QSPI flash There is a 32MiB Micron MT25QU256ABA1 serial NOR flash on the EVK board. Add a device tree node for it. Tested on a 8MNANOD3L-EVK. Signed-off-by: Michael Walle Tested-by: Heiko Thiery Signed-off-by: Shawn Guo commit 3870b54e0684a17ac95ae7ec8fffbcb6357731ea Author: Maxime Ripard Date: Mon Mar 28 17:36:59 2022 +0200 drm/vc4: kms: Improve logging When debugging, finding out what muxing decisions were made and what the actual core clock rate is is always useful, so let's add some more messages. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-7-maxime@cerno.tech commit 457e5184b9e0e14b26044c7fed5940bcbe7698a7 Author: Maxime Ripard Date: Mon Mar 28 17:36:58 2022 +0200 drm/vc4: kms: Warn if we have an incompatible muxing setup The documentation explicitly states we must prevent the output 2 and 3 from feeding from the same HVS channel. Let's add a warning to make some noise if we ever find ourselves in such a case. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-6-maxime@cerno.tech commit f47d37a91e60990f0ee3006004639487906e3125 Author: Maxime Ripard Date: Mon Mar 28 17:36:57 2022 +0200 drm/vc4: kms: Store channel in local variable We use the channel from our vc4_crtc_state structure in multiple places, let's store it in a local variable to make it cleaner. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-5-maxime@cerno.tech commit 5453343a88ede8b12812fced81ecd24cb888ccc3 Author: Maxime Ripard Date: Mon Mar 28 17:36:56 2022 +0200 drm/vc4: txp: Force alpha to be 0xff if it's disabled If we use a format that has padding instead of the alpha component (such as XRGB8888), it appears that the Transposer will fill the padding to 0, disregarding what was stored in the input buffer padding. This leads to issues with IGT, since it will set the padding to 0xff, but will then compare the CRC of the two frames which will thus fail. Another nice side effect is that it is now possible to just use the buffer as ARGB. Fixes: 008095e065a8 ("drm/vc4: Add support for the transposer block") Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-4-maxime@cerno.tech commit 234998df929f14d00cbf2f1e81a7facb69fd9266 Author: Maxime Ripard Date: Mon Mar 28 17:36:55 2022 +0200 drm/vc4: txp: Don't set TXP_VSTART_AT_EOF The TXP_VSTART_AT_EOF will generate a second VSTART signal to the HVS. However, the HVS waits for VSTART to enable the FIFO and will thus start filling the FIFO before the start of the frame. This leads to corruption at the beginning of the first frame, and content from the previous frame at the beginning of the next frames. Since one VSTART is enough, let's get rid of it. Fixes: 008095e065a8 ("drm/vc4: Add support for the transposer block") Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-3-maxime@cerno.tech commit 8514e6b1f40319e31ac4aa3fbf606796786366c9 Author: Maxime Ripard Date: Mon Mar 28 17:36:54 2022 +0200 drm/vc4: hvs: Reset muxes at probe time By default, the HVS driver will force the HVS output 3 to be muxed to the HVS channel 2. However, the Transposer can only be assigned to the HVS channel 2, so whenever we try to use the writeback connector, we'll mux its associated output (Output 2) to the channel 2. This leads to both the output 2 and 3 feeding from the same channel, which is explicitly discouraged in the documentation. In order to avoid this, let's reset all the output muxes to their reset value. Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically") Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220328153659.2382206-2-maxime@cerno.tech commit a3b18f5f1d42e7e08eda5d131a34b352a50deb6e Author: Li Yang Date: Fri Mar 11 17:49:38 2022 -0600 dt-bindings: pci: layerscape-pci: define AER/PME interrupts Different platforms using this controller are using different numbers of interrupt lines and the routing of events to these interrupt lines are different too. So instead of trying to define names for these interrupt lines, we define the more specific AER/PME events that are routed to these interrupt lines. For platforms which only has a single interrupt line for miscellaneous controller events, we can keep using the original "intr" name for backward compatibility. Also change the example from ls1021a to ls1088a for better representation. Link: https://lore.kernel.org/r/20220311234938.8706-5-leoyang.li@nxp.com Signed-off-by: Li Yang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit cddc1a9ab360d10891bf05e178ea225fb2791355 Author: Xiaowei Bao Date: Fri Mar 11 17:49:37 2022 -0600 dt-bindings: pci: layerscape-pci: Add EP mode compatible strings for ls1028a Add EP mode compatible string for ls1028a. Link: https://lore.kernel.org/r/20220311234938.8706-4-leoyang.li@nxp.com Signed-off-by: Xiaowei Bao Signed-off-by: Hou Zhiqiang Signed-off-by: Li Yang Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 84f293b204ab1ef519278e7993e9930f03879627 Author: Hou Zhiqiang Date: Fri Mar 11 17:49:36 2022 -0600 dt-bindings: pci: layerscape-pci: Update the description of SCFG property Update the description of the second entry of 'fsl,pcie-scfg' property, as the LS1043A PCIe controller also has some control registers in SCFG block, while it has 3 controllers. Link: https://lore.kernel.org/r/20220311234938.8706-3-leoyang.li@nxp.com Signed-off-by: Hou Zhiqiang Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 6c389328c985a3aa8575cf3a573a05c1d121fceb Author: Hou Zhiqiang Date: Fri Mar 11 17:49:35 2022 -0600 dt-bindings: pci: layerscape-pci: Add a optional property big-endian This property is to indicate the endianness when accessing the PEX_LUT and PF register block, so if these registers are implemented in big-endian, specify this property. Link: https://lore.kernel.org/r/20220311234938.8706-2-leoyang.li@nxp.com Signed-off-by: Hou Zhiqiang Signed-off-by: Lorenzo Pieralisi Acked-by: Rob Herring commit 3d5746a187a0e2a10025ead3472f796a761abd26 Merge: 5cfe477f6a3f9 aa70527d36d74 Author: Mark Brown Date: Fri Apr 8 12:22:10 2022 +0100 ASoC: Merge fixes Pull in wm8731 fix. Signed-off-by: Mark Brown commit e89006be0bc2b88700108bb4f51c4e922f182346 Merge: e05afd0848f84 e6df1b4a2759d Author: David S. Miller Date: Fri Apr 8 12:20:52 2022 +0100 Merge branch 'aspeed-mdio-c45' Potin Lai says: ==================== mdio: aspeed: Add Clause 45 support for Aspeed MDIO This patch series add Clause 45 support for Aspeed MDIO driver, and separate c22 and c45 implementation into different functions. LINK: [v1] https://lore.kernel.org/all/20220329161949.19762-1-potin.lai@quantatw.com/ LINK: [v2] https://lore.kernel.org/all/20220406170055.28516-1-potin.lai@quantatw.com/ Changes v2 --> v3: - sort local variable sequence in reverse Christmas tree format. Changes v1 --> v2: - add C45 to probe_capabilities - break one patch into 3 small patches ==================== Signed-off-by: David S. Miller commit e6df1b4a2759d3781f17ae9cdf96bc607e20d0b8 Author: Potin Lai Date: Thu Apr 7 09:17:38 2022 +0800 net: mdio: aspeed: Add c45 support Add Clause 45 support for Aspeed mdio driver. Signed-off-by: Potin Lai Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit eb0571932314e6f4f0cb4e05c590fe78c01acbd7 Author: Potin Lai Date: Thu Apr 7 09:17:37 2022 +0800 net: mdio: aspeed: Introduce read write function for c22 and c45 Add following additional functions to move out the implementation from aspeed_mdio_read() and aspeed_mdio_write(). c22: - aspeed_mdio_read_c22() - aspeed_mdio_write_c22() c45: - aspeed_mdio_read_c45() - aspeed_mdio_write_c45() Signed-off-by: Potin Lai Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 737ca352569e744bf753b4522a6f91b120a734f1 Author: Potin Lai Date: Thu Apr 7 09:17:36 2022 +0800 net: mdio: aspeed: move reg accessing part into separate functions Add aspeed_mdio_op() and aseed_mdio_get_data() for register accessing. aspeed_mdio_op() handles operations, write command to control register, then check and wait operations is finished (bit 31 is cleared). aseed_mdio_get_data() fetchs the result value of operation from data register. Signed-off-by: Potin Lai Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6181ab31824f7b5f2ac3ee33aed583b8bb7513f0 Author: Jiaxin Yu Date: Fri Apr 8 14:05:52 2022 +0800 ASoC: mediatek: mt8192: support rt1015p_rt5682s Add support for using the rt5682s codec together with rt1015p on mt8192-mt6359 machines. All configurations are shared with the rt5682 codec variant, so simply select the SND_SOC_RT5682S config to ensure the codec is present and set the correct card name. The codec will be linked to by pointing to it in the headset-codec property in the devicetree. While at it, also create macros for the names of the different codec variants supported by this driver, as well as rename occurrences of rt1015p_rt5682 to rt1015p_rt5682x, since they are shared between rt5682 and rt5682s. Signed-off-by: Jiaxin Yu Reviewed-by: Tzung-Bi Shih Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220408060552.26607-5-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit f8910fb4985a00c0a1e6932dc5bda6181c549b76 Author: Jiaxin Yu Date: Fri Apr 8 14:05:51 2022 +0800 ASoC: mediatek: mt8192: refactor for I2S8/I2S9 DAI links of headset As part of the refactoring to allow the same machine driver to be used for the rt1015(p) and rt5682(s) codecs on the MT8192 platform, parse the rt5682(s) codec from the headset-codec property in the devicetree and wire it to the I2S8 and I2S9 backends. Signed-off-by: Jiaxin Yu Reviewed-by: Tzung-Bi Shih Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220408060552.26607-4-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit e1e408e60e856b99782b26308a9dc3937b1ba8bf Author: Jiaxin Yu Date: Fri Apr 8 14:05:50 2022 +0800 ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speaker As part of the refactoring to allow the same machine driver to be used for the rt1015(p) and rt5682(s) codecs on the MT8192 platform, parse the rt1015(p) codecs from the speaker-codecs property in the devicetree and wire them to the I2S3 backend, instead of hardcoding the links and selecting through the compatible. Signed-off-by: Jiaxin Yu Reviewed-by: Tzung-Bi Shih Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220408060552.26607-3-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit 1efe7eca170d344c5101c69ac51df6982de764e4 Author: Jiaxin Yu Date: Fri Apr 8 14:05:49 2022 +0800 ASoC: dt-bindings: mt8192-mt6359: add new compatible and new properties 1. Adds new compatible string "mt8192_mt6359_rt1015p_rt5682s" for machines with rt1015p and rt5682s. 2. Adds new property "headset-codec" for getting headset codec. 3. Adds new property "speaker-codecs" for getting speaker codecs. Signed-off-by: Jiaxin Yu Reviewed-by: Rob Herring Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220408060552.26607-2-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit e05afd0848f8452edb7b4138536fae2aaf01552a Author: Jakub Kicinski Date: Tue Apr 5 21:16:27 2022 -0700 net: atm: remove the ambassador driver The driver for ATM Ambassador devices spews build warnings on microblaze. The virt_to_bus() calls discard the volatile keyword. The right thing to do would be to migrate this driver to a modern DMA API but it seems unlikely anyone is actually using it. There had been no fixes or functional changes here since the git era begun. In fact it sounds like the FW loading was broken from 2008 'til 2012 - see commit fcdc90b025e6 ("atm: forever loop loading ambassador firmware"). Let's remove this driver, there isn't much changing in the APIs, if users come forward we can apologize and revert. Link: https://lore.kernel.org/all/20220321144013.440d7fc0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9362a07a0c5d6e566d614e988bc9c96102774a9d Author: Matthew Auld Date: Fri Apr 8 09:42:05 2022 +0100 drm/i915: fix i915_gem_object_wait_moving_fence All of CI is just failing with the following, which prevents loading of the module: i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error. v2(Lucas): handle ret == 0 Fixes: 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency") Signed-off-by: Matthew Auld Cc: Christian König Cc: Lucas De Marchi Cc: Daniel Vetter Reviewed-by: Christian König #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20220408084205.1353427-1-matthew.auld@intel.com Signed-off-by: Christian König commit c9cad937c0c58618fe5b0310fd539a854dc1ae95 Author: Arunpravin Paneer Selvam Date: Fri Apr 8 04:18:43 2022 +0530 drm/amdgpu: add drm buddy support to amdgpu - Switch to drm buddy allocator - Add resource cursor support for drm buddy v2(Matthew Auld): - replace spinlock with mutex as we call kmem_cache_zalloc (..., GFP_KERNEL) in drm_buddy_alloc() function - lock drm_buddy_block_trim() function as it calls mark_free/mark_split are all globally visible v3(Matthew Auld): - remove trim method error handling as we address the failure case at drm_buddy_block_trim() function v4: - fix warnings reported by kernel test robot v5: - fix merge conflict issue v6: - fix warnings reported by kernel test robot v7: - remove DRM_BUDDY_RANGE_ALLOCATION flag usage v8: - keep DRM_BUDDY_RANGE_ALLOCATION flag usage - resolve conflicts created by drm/amdgpu: remove VRAM accounting v2 v9(Christian): - merged the below patch - drm/amdgpu: move vram inline functions into a header - rename label name as fallback - move struct amdgpu_vram_mgr to amdgpu_vram_mgr.h - remove unnecessary flags from struct amdgpu_vram_reservation - rewrite block NULL check condition - change else style as per coding standard - rewrite the node max size - add a helper function to fetch the first entry from the list v10(Christian): - rename amdgpu_get_node() function name as amdgpu_vram_mgr_first_block v11: - if size is not aligned with min_page_size, enable is_contiguous flag, therefore, the size round up to the power of two and trimmed to the original size. v12: - rename the function names having prefix as amdgpu_vram_mgr_*() - modify the round_up() logic conforming to contiguous flag enablement or if size is not aligned to min_block_size - modify the trim logic - rename node as block wherever applicable Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220407224843.2416-1-Arunpravin.PaneerSelvam@amd.com Signed-off-by: Christian König commit 6e8805de30011959a4b3ffaa6614e3662ba4adce Merge: d1f66ac69f37b 9f4b28301ce6a Author: David S. Miller Date: Fri Apr 8 11:52:48 2022 +0100 Merge branch 'bnxt-xdp-multi-buffer' Michael Chan says: ==================== bnxt: Support XDP multi buffer This series adds XDP multi buffer support, allowing MTU to go beyond the page size limit. v4: Rebase with latest net-next v3: Simplify page mode buffer size calculation Check to make sure XDP program supports multipage packets v2: Fix uninitialized variable warnings in patch 1 and 10. ==================== Signed-off-by: David S. Miller commit 9f4b28301ce6a594a692a0abc2002d0bb912f2b7 Author: Andy Gospodarek Date: Fri Apr 8 03:59:06 2022 -0400 bnxt: XDP multibuffer enablement Allow aggregation buffers to be in place in the receive path and allow XDP programs to be attached when using a larger than 4k MTU. v3: Add a check to sure XDP program supports multipage packets. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a7559bc8c17c3f9a91dcbeefe8642ba757fd09e8 Author: Andy Gospodarek Date: Fri Apr 8 03:59:05 2022 -0400 bnxt: support transmit and free of aggregation buffers This patch adds the following features: - Support for XDP_TX and XDP_DROP action when using xdp_buff with frags - Support for freeing all frags attached to an xdp_buff - Cleanup of TX ring buffers after transmits complete - Slight change in definition of bnxt_sw_tx_bd since nr_frags and RX producer may both need to be used - Clear out skb_shared_info at the end of the buffer v2: Fix uninitialized variable warning in bnxt_xdp_buff_frags_free(). Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 1dc4c557bfedfcdf7fc0c46795857773b7ad66e7 Author: Andy Gospodarek Date: Fri Apr 8 03:59:04 2022 -0400 bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff Since we have an xdp_buff with frags there needs to be a way to convert that into a valid sk_buff in the event that XDP_PASS is the resulting operation. This adds a new rx_skb_func when the netdev has an MTU that prevents the packets from sitting in a single page. This also make sure that GRO/LRO stay disabled even when using the aggregation ring for large buffers. v3: Use BNXT_PAGE_MODE_BUF_SIZE for build_skb Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 9a6aa3504885331a2fbf843c8cb7fa6be49a3d40 Author: Andy Gospodarek Date: Fri Apr 8 03:59:03 2022 -0400 bnxt: add page_pool support for aggregation ring when using xdp If we are using aggregation rings with XDP enabled, allocate page buffers for the aggregation rings from the page_pool. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 32861236190bf1247d18e245cee0814603d2c29f Author: Andy Gospodarek Date: Fri Apr 8 03:59:02 2022 -0400 bnxt: change receive ring space parameters Modify ring header data split and jumbo parameters to account for the fact that the design for XDP multibuffer puts close to the first 4k of data in a page and the remaining portions of the packet go in the aggregation ring. v3: Simplified code around initial buffer size calculation Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 31b9998bf225eca51f0d9f8d694d807495bf80a8 Author: Andy Gospodarek Date: Fri Apr 8 03:59:01 2022 -0400 bnxt: set xdp_buff pfmemalloc flag if needed Set the pfmemaloc flag in the xdp buff so that this can be copied to the skb if needed for an XDP_PASS action. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 4c6c123c9af9c94be4726134ca72ba5a0be0ebd0 Author: Andy Gospodarek Date: Fri Apr 8 03:59:00 2022 -0400 bnxt: adding bnxt_rx_agg_pages_xdp for aggregated xdp This patch adds a new function that will read pages from the aggregation ring and create an xdp_buff with frags based on the entries in the aggregation ring. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 23e4c0469ad03f695993cceccb50cbddf9ef8963 Author: Andy Gospodarek Date: Fri Apr 8 03:58:59 2022 -0400 bnxt: rename bnxt_rx_pages to bnxt_rx_agg_pages_skb Clarify that this is reading buffers from the aggregation ring. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ca1df2dd8e2f2c18a90d21e59ad56d43c2e9322e Author: Andy Gospodarek Date: Fri Apr 8 03:58:58 2022 -0400 bnxt: refactor bnxt_rx_pages operate on skb_shared_info Rather than operating on an sk_buff, add frags from the aggregation ring into the frags of an skb_shared_info. This will allow the caller to use either an sk_buff or xdp_buff. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ee536dcbdce4966009b4ea15f03cba045161249a Author: Andy Gospodarek Date: Fri Apr 8 03:58:57 2022 -0400 bnxt: add flag to denote that an xdp program is currently attached This will be used to determine if bnxt_rx_xdp should be called rather than calling it every time. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b231c3f3414cfc7bf8fb1e246ed5a3d523616520 Author: Andy Gospodarek Date: Fri Apr 8 03:58:56 2022 -0400 bnxt: refactor bnxt_rx_xdp to separate xdp_init_buff/xdp_prepare_buff Move initialization of xdp_buff outside of bnxt_rx_xdp to prepare for allowing bnxt_rx_xdp to operate on multibuffer xdp_buffs. v2: Fix uninitalized variables warning in bnxt_xdp.c. v3: Add new define BNXT_PAGE_MODE_BUF_SIZE Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit d1f66ac69f37bd4923bb0fc494d7129c54e94a22 Merge: dc2e0617f1fd0 71471ca32505a Author: David S. Miller Date: Fri Apr 8 11:49:09 2022 +0100 Merge branch 'tls-rx-refactor-part-1' Jakub Kicinski says: ==================== tls: rx: random refactoring part 1 TLS Rx refactoring. Part 1 of 3. A couple of features to follow. ==================== Signed-off-by: David S. Miller commit 71471ca32505afa7c3f7f6a8268716e1ddb81cd4 Author: Jakub Kicinski Date: Thu Apr 7 20:38:23 2022 -0700 tls: hw: rx: use return value of tls_device_decrypted() to carry status Instead of tls_device poking into internals of the message return 1 from tls_device_decrypted() if the device handled the decryption. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 3764ae5ba6615095de86698a00e814513b9ad0d5 Author: Jakub Kicinski Date: Thu Apr 7 20:38:22 2022 -0700 tls: rx: refactor decrypt_skb_update() Use early return and a jump label to remove two indentation levels. No functional changes. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5dbda02d322db7762f1a0348117cde913fb46c13 Author: Jakub Kicinski Date: Thu Apr 7 20:38:21 2022 -0700 tls: rx: don't issue wake ups when data is decrypted We inform the applications that data is available when the record is received. Decryption happens inline inside recvmsg or splice call. Generating another wakeup inside the decryption handler seems pointless as someone must be actively reading the socket if we are executing this code. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5deee41b19b3259debdc2d607f1065f28ac80070 Author: Jakub Kicinski Date: Thu Apr 7 20:38:20 2022 -0700 tls: rx: replace 'back' with 'offset' The padding length TLS 1.3 logic is searching for content_type from the end of text. IMHO the code is easier to parse if we calculate offset and decrement it rather than try to maintain positive offset from the end of the record called "back". Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit a8340cc02beed4ffbb5e7b1b0eadca445323fc6a Author: Jakub Kicinski Date: Thu Apr 7 20:38:19 2022 -0700 tls: rx: use a define for tag length TLS 1.3 has to strip padding, and it starts out 16 bytes from the end of the record. Make it clear this is because of the auth tag. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 863533e316b235d40c07e49cd39bbd6dcb9f5a1d Author: Jakub Kicinski Date: Thu Apr 7 20:38:18 2022 -0700 tls: rx: init decrypted status in tls_read_size() We set the record type in tls_read_size(), can as well init the tlm->decrypted field there. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 7dc59c33d62c4520a119051d4486c214ef5caa23 Author: Jakub Kicinski Date: Thu Apr 7 20:38:17 2022 -0700 tls: rx: don't store the decryption status in socket context Similar justification to previous change, the information about decryption status belongs in the skb. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c3f6bb74137c68b515b7e2ff123a80611e801013 Author: Jakub Kicinski Date: Thu Apr 7 20:38:16 2022 -0700 tls: rx: don't store the record type in socket context Original TLS implementation was handling one record at a time. It stashed the type of the record inside tls context (per socket structure) for convenience. When async crypto support was added [1] the author had to use skb->cb to store the type per-message. The use of skb->cb overlaps with strparser, however, so a hybrid approach was taken where type is stored in context while parsing (since we parse a message at a time) but once parsed its copied to skb->cb. Recently a workaround for sockmaps [2] exposed the previously private struct _strp_msg and started a trend of adding user fields directly in strparser's header. This is cleaner than storing information about an skb in the context. This change is not strictly necessary, but IMHO the ownership of the context field is confusing. Information naturally belongs to the skb. [1] commit 94524d8fc965 ("net/tls: Add support for async decryption of tls records") [2] commit b2c4618162ec ("bpf, sockmap: sk_skb data_end access incorrect when src_reg = dst_reg") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d5123edd10cf9d324fcb88e276bdc7375f3c5321 Author: Jakub Kicinski Date: Thu Apr 7 20:38:15 2022 -0700 tls: rx: drop pointless else after goto Pointless else branch after goto makes the code harder to refactor down the line. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit bfc06e1aaa130b86a81ce3c41ec71a2f5e191690 Author: Jakub Kicinski Date: Thu Apr 7 20:38:14 2022 -0700 tls: rx: jump to a more appropriate label 'recv_end:' checks num_async and decrypted, and is then followed by the 'end' label. Since we know that decrypted and num_async are 0 at the start we can jump to 'end'. Move the init of decrypted and num_async to let the compiler catch if I'm wrong. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9694ed9bcf3b761c05d7787739eb4e77bd86c367 Author: Guido Günther Date: Mon Feb 28 14:12:22 2022 +0100 arm64: dts: imx8mq-librem5-r4: add the correct panel The r4 ("Evergreen") hardware revision of the Librem 5 phone includes a slightly different panel than the revisions before it. Since its' description is available, describe it properly for the board. Signed-off-by: Guido Günther Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit c3e9d4547a9e15b56c2ceefa54ec04057b3276eb Author: Angus Ainslie Date: Mon Feb 28 14:12:21 2022 +0100 arm64: dts: imx8mq-librem5: add a RO firmware partition This partition will hold a squashfs firmware jail. Only one read-only partition is needed. Signed-off-by: Angus Ainslie Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 2bf475ce12e6a67b971045f3ed53494bbcbf0b65 Author: Guido Günther Date: Mon Feb 28 14:12:20 2022 +0100 arm64: dts: imx8mq-librem5: higher boost regulation current 1,5A is what's used by the type-c controller on the Librem 5 board so increase ti,boost-max-current to 1,5A too. Signed-off-by: Guido Günther Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit b019694c8be088bef1011fb21ea6fc4180727c6e Author: Martin Kepplinger Date: Mon Feb 28 14:12:19 2022 +0100 arm64: dts: imx8mq-librem5: remove description of CHG_STATUS_B That pin is not connected on the board so no need to describe it. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit a3b2fc4f76de7d307a5ed865b88fb35c69ebd172 Author: Martin Kepplinger Date: Mon Feb 28 14:12:18 2022 +0100 arm64: dts: imx8mq-librem5: make the volume buttons a wakeup source They turn on the display currently so to be consistent, let's make them wake the system from suspend as well. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 523895e5b278b5d7f2e29323b877193fe2d1b9dc Author: Florian Westphal Date: Wed Mar 23 14:22:06 2022 +0100 netfilter: cttimeout: inc/dec module refcount per object, not per use refcount There is no need to increment the module refcount again, its enough to obtain one reference per object, i.e. take a reference on object creation and put it on object destruction. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 49001a2e83a80f6d9c4287c46ffa41a03667bbd1 Author: Florian Westphal Date: Wed Mar 23 14:22:03 2022 +0100 netfilter: conntrack: split inner loop of list dumping to own function This allows code re-use in the followup patch. No functional changes intended. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 9027ce0b071a1bbd046682907fc2e23ca3592883 Author: Florian Westphal Date: Wed Mar 23 14:22:01 2022 +0100 netfilter: ecache: move to separate structure This makes it easier for a followup patch to only expose ecache related parts of nf_conntrack_net structure. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1e0e7f10c4431c704369b6c715a808faf806011d Author: Shuai Xue Date: Tue Mar 8 22:40:53 2022 +0800 efi/cper: Reformat CPER memory error location to more readable Remove the space after the colon in cper_mem_err_location() so that it is easier to parse its output this way, both by humans and tools. No functional changes. Signed-off-by: Shuai Xue Signed-off-by: Borislav Petkov Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220308144053.49090-4-xueshuai@linux.alibaba.com commit ed27b5df3877458eb24615fd9c202178660db009 Author: Shuai Xue Date: Tue Mar 8 22:40:52 2022 +0800 EDAC/ghes: Unify CPER memory error location reporting Switch the GHES EDAC memory error reporting functions to use the common CPER ones and get rid of code duplication. [ bp: - rewrite commit message, remove useless text - rip out useless reformatting - align function params on the opening brace - rename function to a more descriptive name - drop useless function exports - handle buffer lengths properly when printing other detail - remove useless casting ] Signed-off-by: Shuai Xue Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220308144053.49090-3-xueshuai@linux.alibaba.com commit bdae79651453df0bca20963fc2ab970146ef2a37 Author: Shuai Xue Date: Tue Mar 8 22:40:51 2022 +0800 efi/cper: Add a cper_mem_err_status_str() to decode error description Introduce a new helper function cper_mem_err_status_str() to decode the error status value into a human readable string. [ bp: Massage. ] Signed-off-by: Shuai Xue Signed-off-by: Borislav Petkov Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220308144053.49090-2-xueshuai@linux.alibaba.com commit e720ea52e85c9d00cf8c5769795d0a3e585524f6 Author: Peter Gonda Date: Thu Mar 17 14:19:13 2022 -0700 x86/sev-es: Replace open-coded hlt-loop with sev_es_terminate() Replace the halt loop in handle_vc_boot_ghcb() with an sev_es_terminate(). The HLT gives the system no indication the guest is unhappy. The termination request will signal there was an error during VC handling during boot. [ bp: Update it to pass the reason set too. ] Signed-off-by: Peter Gonda Signed-off-by: Borislav Petkov Reviewed-by: Joerg Roedel Link: https://lore.kernel.org/r/20220317211913.1397427-1-pgonda@google.com commit 17b048d4c6143ac9ca8a6952da7a37416bf135b0 Author: Matthew Auld Date: Thu Apr 7 17:45:31 2022 +0100 drm/i915: fix broken build I guess this was missed in the conversion or something. Fixes: 7bc80a5462c3 ("dma-buf: add enum dma_resv_usage v4") Signed-off-by: Matthew Auld Reviewed-by: Christian König Cc: Christian König Cc: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407164532.1242578-1-matthew.auld@intel.com Signed-off-by: Christian König commit 7b2206d8809259b0dd297f0ccf017bf2dea98a02 Author: Jakob Koschel Date: Thu Mar 31 23:59:10 2022 +0200 crypto: cavium/nitrox - remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Signed-off-by: Herbert Xu commit 4e2c87949f2b9909d3daa8d9cd4b6d5077b6e0c2 Author: Mario Limonciello Date: Thu Mar 31 16:12:13 2022 -0500 crypto: ccp - When TSME and SME both detected notify user CC_ATTR_HOST_MEM_ENCRYPT is used to relay that memory encryption has been activated by the kernel. As it's technically possible to enable both SME and TSME at the same time, detect this scenario and notify the user that enabling TSME and SME at the same time is unnecessary. Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 84ee393b1e82628ac7f183d8a68d8ac2cf0ed876 Author: Mario Limonciello Date: Thu Mar 31 16:12:12 2022 -0500 crypto: ccp - Allow PSP driver to load without SEV/TEE support Previously the PSP probe routine would fail if both SEV and TEE were missing. This is possibly the case for some client parts. As capabilities can now be accessed from userspace, it may still be useful to have the PSP driver finish loading so that those capabilities can be read. Signed-off-by: Mario Limonciello Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 50c4decc1b15313afa31f9a99da0904fa9c9b071 Author: Mario Limonciello Date: Thu Mar 31 16:12:11 2022 -0500 crypto: ccp - Export PSP security bits to userspace The PSP sets several pre-defined bits in the capabilities register to indicate that security attributes of the platform. Export these attributes into userspace for administrators to confirm platform is properly locked down. Acked-by: Tom Lendacky Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit cac32cd4f1436b0f926a9112039d3f7ce1cd6cab Author: Mario Limonciello Date: Thu Mar 31 16:12:10 2022 -0500 crypto: ccp - cache capability into psp device The results of the capability register will be used by future code at runtime rather than just initialization. Acked-by: Tom Lendacky Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit f17f9e9069f20f4400ae0bb3ee830d34104ff8f7 Author: Eric Biggers Date: Sat Mar 26 00:11:59 2022 -0700 crypto: testmgr - test in-place en/decryption with two sglists As was established in the thread https://lore.kernel.org/linux-crypto/20220223080400.139367-1-gilad@benyossef.com/T/#u, many crypto API users doing in-place en/decryption don't use the same scatterlist pointers for the source and destination, but rather use separate scatterlists that point to the same memory. This case isn't tested by the self-tests, resulting in bugs. This is the natural usage of the crypto API in some cases, so requiring API users to avoid this usage is not reasonable. Therefore, update the self-tests to start testing this case. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f16a005cde3b1f31cad5ecba0cc810652c3874ec Author: Randy Dunlap Date: Wed Mar 16 12:20:09 2022 -0700 crypto: x86 - eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 64b94ceae8c1 ("crypto: blowfish - add x86_64 assembly implementation") Fixes: 676a38046f4f ("crypto: camellia-x86_64 - module init/exit functions should be static") Fixes: 0b95ec56ae19 ("crypto: camellia - add assembler implementation for x86_64") Fixes: 56d76c96a9f3 ("crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher") Fixes: b9f535ffe38f ("[CRYPTO] twofish: i586 assembly version") Fixes: ff0a70fe0536 ("crypto: twofish-x86_64-3way - module init/exit functions should be static") Fixes: 8280daad436e ("crypto: twofish - add 3-way parallel x86_64 assembler implemention") Signed-off-by: Randy Dunlap Cc: Jussi Kivilinna Cc: Joachim Fritschi Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Herbert Xu commit 4cda2f4a0ee68a23cadfa8cc0fce9af548c29fe2 Author: Hui Tang Date: Wed Mar 16 19:26:03 2022 +0800 crypto: hisilicon/qm - optimize the barrier operation A 'dma_wmb' barrier is enough to guarantee previous writes before accessing by acc device in the outer shareable domain. A 'smp_wmb' barrier is enough to guarantee previous writes before accessing by other cpus in the inner shareble domain. Signed-off-by: Hui Tang Signed-off-by: Herbert Xu commit d5db91d26af5207b18cf2a80d7a7094bd4f57896 Author: Yang Li Date: Wed Mar 16 09:03:01 2022 +0800 crypto: engine - Add parameter description in crypto_transfer_request() kernel-doc comment Add the description of @need_pump in crypto_transfer_request() kernel-doc comment to remove warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. crypto/crypto_engine.c:260: warning: Function parameter or member 'need_pump' not described in 'crypto_transfer_request' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Herbert Xu commit 5b33e0ec881c609d96c9cce63fe15e0d0af457db Author: Tianjia Zhang Date: Tue Mar 15 17:44:54 2022 +0800 crypto: arm64/sm4 - add ARMv8 Crypto Extensions implementation This adds ARMv8 implementations of SM4 in ECB, CBC, CFB and CTR modes using Crypto Extensions, also includes key expansion operations because the Crypto Extensions instruction is much faster than software implementations. The Crypto Extensions for SM4 can only run on ARMv8 implementations that have support for these optional extensions. Benchmark on T-Head Yitian-710 2.75 GHz, the data comes from the 218 mode of tcrypt. The abscissas are blocks of different lengths. The data is tabulated and the unit is Mb/s: sm4-generic | 16 64 128 256 1024 1420 4096 ECB enc | 80.05 91.42 93.66 94.77 95.69 95.77 95.86 ECB dec | 79.98 91.41 93.64 94.76 95.66 95.77 95.85 CBC enc | 78.55 86.50 88.02 88.77 89.36 89.42 89.48 CBC dec | 76.82 89.06 91.52 92.77 93.75 93.83 93.96 CFB enc | 77.64 86.13 87.62 88.42 89.08 88.83 89.18 CFB dec | 77.57 88.34 90.36 91.45 92.34 92.00 92.44 CTR enc | 77.80 88.28 90.23 91.22 92.11 91.81 92.25 CTR dec | 77.83 88.22 90.22 91.22 92.04 91.82 92.28 sm4-neon ECB enc | 28.31 112.77 203.03 209.89 215.49 202.11 210.59 ECB dec | 28.36 113.45 203.23 210.00 215.52 202.13 210.65 CBC enc | 79.32 87.02 88.51 89.28 89.85 89.89 89.97 CBC dec | 28.29 112.20 203.30 209.82 214.99 201.51 209.95 CFB enc | 79.59 87.16 88.54 89.30 89.83 89.62 89.92 CFB dec | 28.12 111.05 202.47 209.02 214.21 210.90 209.12 CTR enc | 28.04 108.81 200.62 206.65 211.78 208.78 206.74 CTR dec | 28.02 108.82 200.45 206.62 211.78 208.74 206.70 sm4-ce-cipher ECB enc | 336.79 587.13 682.70 747.37 803.75 811.52 818.06 ECB dec | 339.18 584.52 679.72 743.68 798.82 803.83 811.54 CBC enc | 316.63 521.47 597.00 647.14 690.82 695.21 700.55 CBC dec | 291.80 503.79 585.66 640.82 689.86 695.16 701.72 CFB enc | 294.79 482.31 552.13 594.71 631.60 628.91 638.92 CFB dec | 293.09 466.44 526.56 563.17 594.41 592.26 601.97 CTR enc | 309.61 506.13 576.86 620.47 656.38 654.51 665.10 CTR dec | 306.69 505.57 576.84 620.18 657.09 654.52 665.32 sm4-ce ECB enc | 366.96 1329.81 2024.29 2755.50 3790.07 3861.91 4051.40 ECB dec | 367.30 1323.93 2018.72 2747.43 3787.39 3862.55 4052.62 CBC enc | 358.09 682.68 807.24 885.35 958.29 963.60 973.73 CBC dec | 366.51 1303.63 1978.64 2667.93 3624.53 3683.41 3856.08 CFB enc | 351.51 681.26 807.81 893.10 968.54 969.17 985.83 CFB dec | 354.98 1266.61 1929.63 2634.81 3614.23 3611.59 3841.68 CTR enc | 324.23 1121.25 1689.44 2256.70 2981.90 3007.79 3060.74 CTR dec | 324.18 1120.44 1694.31 2258.32 2982.01 3010.09 3060.99 Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 4f1aef9b806f58ef76fdac0b4d9cfab6e66aeef1 Author: Tianjia Zhang Date: Tue Mar 15 17:44:53 2022 +0800 crypto: arm64/sm4 - add ARMv8 NEON implementation This adds ARMv8 NEON implementations of SM4 in ECB, CBC, CFB and CTR modes. This implementation uses the plain NEON instruction set, All S-BOX substitutions uses the tbl/tbx instructions of ARMv8, combined with the out-of-order execution in CPU, this optimization supports encryption of up to 8 blocks at the same time. The performance of encrypting one block is not as good as software implementation, so the encryption operations of CBC and CFB still use pure software algorithms. Benchmark on T-Head Yitian-710 2.75 GHz, the data comes from the 218 mode of tcrypt. The abscissas are blocks of different lengths. The data is tabulated and the unit is Mb/s: sm4-generic | 16 64 128 256 1024 1420 4096 ECB enc | 80.05 91.42 93.66 94.77 95.69 95.77 95.86 ECB dec | 79.98 91.41 93.64 94.76 95.66 95.77 95.85 CBC enc | 78.55 86.50 88.02 88.77 89.36 89.42 89.48 CBC dec | 76.82 89.06 91.52 92.77 93.75 93.83 93.96 CFB enc | 77.64 86.13 87.62 88.42 89.08 88.83 89.18 CFB dec | 77.57 88.34 90.36 91.45 92.34 92.00 92.44 CTR enc | 77.80 88.28 90.23 91.22 92.11 91.81 92.25 CTR dec | 77.83 88.22 90.22 91.22 92.04 91.82 92.28 sm4-neon ECB enc | 28.31 112.77 203.03 209.89 215.49 202.11 210.59 ECB dec | 28.36 113.45 203.23 210.00 215.52 202.13 210.65 CBC enc | 79.32 87.02 88.51 89.28 89.85 89.89 89.97 CBC dec | 28.29 112.20 203.30 209.82 214.99 201.51 209.95 CFB enc | 79.59 87.16 88.54 89.30 89.83 89.62 89.92 CFB dec | 28.12 111.05 202.47 209.02 214.21 210.90 209.12 CTR enc | 28.04 108.81 200.62 206.65 211.78 208.78 206.74 CTR dec | 28.02 108.82 200.45 206.62 211.78 208.74 206.70 Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 02436762f5ff4b3f662bc196c70a563bcbc92b7d Author: Tianjia Zhang Date: Tue Mar 15 17:44:52 2022 +0800 crypto: arm64/sm4-ce - rename to sm4-ce-cipher The subsequent patches of the series will have an implementation of SM4-ECB/CBC/CFB/CTR accelerated by the CE instruction set, which conflicts with the current module name. In order to keep the naming rules of the AES algorithm consistent, the sm4-ce algorithm is renamed to sm4-ce-cipher. In addition, the speed of sm4-ce-cipher is better than that of SM4 NEON. By the way, the priority of the algorithm is adjusted to 300, which is also to leave room for the priority of SM4 NEON. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 73c919d314ad57be900437fd329990b1d846b763 Author: Tianjia Zhang Date: Tue Mar 15 17:44:51 2022 +0800 crypto: sm4 - export sm4 constant arrays Export the constant arrays fk, ck, sbox of the SM4 algorithm, and add the 'crypto_sm4_' prefix, where sbox is used in the SM4 NEON implementation for the tbl/tbx instruction to replace the S-BOX, and the fk, ck arrays are used in the SM4 CE implementation. Use the sm4ekey instruction to speed up key expansion operations. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit d2825fa9365d0101571ed16534b16b7c8d261ab3 Author: Jason A. Donenfeld Date: Sun Mar 13 21:11:01 2022 -0600 crypto: sm3,sm4 - move into crypto directory The lib/crypto libraries live in lib because they are used by various drivers of the kernel. In contrast, the various helper functions in crypto are there because they're used exclusively by the crypto API. The SM3 and SM4 helper functions were erroniously moved into lib/crypto/ instead of crypto/, even though there are no in-kernel users outside of the crypto API of those functions. This commit moves them into crypto/. Cc: Herbert Xu Cc: Tianjia Zhang Cc: Eric Biggers Signed-off-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit e8662d0832431a069f0138da72c638cb6a377bdd Author: Krzysztof Kozlowski Date: Thu Apr 7 16:21:58 2022 +0200 ARM: dts: meson: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220407142159.293836-1-krzysztof.kozlowski@linaro.org commit 8771ce5eadb5b73daab190c2451172e43e16ae41 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:21:59 2022 +0200 arm64: dts: meson: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220407142159.293836-2-krzysztof.kozlowski@linaro.org commit cfb24463a53edeb388f3563e166ad7f9591dad3d Author: Deyan Wang Date: Mon Feb 14 20:02:50 2022 +0800 csky: Fix versioncheck warnings $make versioncheck arch/csky/include/asm/io.h: 8 linux/version.h not needed. arch/csky/kernel/process.c: 5 linux/version.h not needed. arch/csky/mm/dma-mapping.c: 12 linux/version.h not needed. comments from Randy: The patch makes sense but these are not compile warnings. They come from scripts/checkversion.pl, which can be called by 'make versioncheck', so I suppose that something in your build system is running 'make versioncheck'. Signed-off-by: Deyan Wang Acked-by: Randy Dunlap Signed-off-by: Guo Ren Signed-off-by: Guo Ren commit dc2e0617f1fd0c5a6f601502b4379113a84ffecf Merge: 27a5a5685d373 73b193f265096 Author: Jakub Kicinski Date: Thu Apr 7 23:24:23 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 27a5a5685d373cd8c18b1d83f42a83e5a2f93e6c Author: GONG, Ruiqi Date: Wed Apr 6 19:46:29 2022 +0800 net: mpls: fix memdup.cocci warning Simply use kmemdup instead of explicitly allocating and copying memory. Generated by: scripts/coccinelle/api/memdup.cocci Signed-off-by: GONG, Ruiqi Link: https://lore.kernel.org/r/20220406114629.182833-1-gongruiqi1@huawei.com Signed-off-by: Jakub Kicinski commit 26894cd971168d14fd8f4c05435aef59188c9514 Author: Andrea Parri (Microsoft) Date: Thu Apr 7 06:40:34 2022 +0200 hv_netvsc: Print value of invalid ID in netvsc_send_{completion,tx_complete}() That being useful for debugging purposes. Notice that the packet descriptor is in "private" guest memory, so that Hyper-V can not tamper with it. While at it, remove two unnecessary u64-casts. Signed-off-by: Andrea Parri (Microsoft) Signed-off-by: Jakub Kicinski commit 4daf5f1956308641092769aa1924286b19513328 Author: Xiaomeng Tong Date: Wed Apr 6 09:59:21 2022 +0800 qed: remove an unneed NULL check on list iterator The define for_each_pci_dev(d) is: while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) Thus, the list iterator 'd' is always non-NULL so it doesn't need to be checked. So just remove the unnecessary NULL check. Also remove the unnecessary initializer because the list iterator is always initialized. Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220406015921.29267-1-xiam0nd.tong@gmail.com Signed-off-by: Jakub Kicinski commit 6a62924c0a81316b2aff713566593405b57545d5 Author: Robin Murphy Date: Tue Apr 5 14:40:55 2022 +0100 sfc: Stop using iommu_present() Even if an IOMMU might be present for some PCI segment in the system, that doesn't necessarily mean it provides translation for the device we care about. It appears that what we care about here is specifically whether DMA mapping ops involve any IOMMU overhead or not, so check for translation actually being active for our device. Signed-off-by: Robin Murphy Acked-by: Edward Cree Link: https://lore.kernel.org/r/7350f957944ecfce6cce90f422e3992a1f428775.1649166055.git.robin.murphy@arm.com Signed-off-by: Jakub Kicinski commit e9f656b7a21408866ba04c112ccbac73885529bd Author: Ian Wienand Date: Wed Apr 6 19:36:36 2022 +1000 net: ethernet: set default assignment identifier to NET_NAME_ENUM As noted in the original commit 685343fc3ba6 ("net: add name_assign_type netdev attribute") ... when the kernel has given the interface a name using global device enumeration based on order of discovery (ethX, wlanY, etc) ... are labelled NET_NAME_ENUM. That describes this case, so set the default for the devices here to NET_NAME_ENUM. Current popular network setup tools like systemd use this only to warn if you're setting static settings on interfaces that might change, so it is expected this only leads to better user information, but not changing of interfaces, etc. Signed-off-by: Ian Wienand Link: https://lore.kernel.org/r/20220406093635.1601506-1-iwienand@redhat.com Signed-off-by: Jakub Kicinski commit 6f403d9d530635f533577d37929c61474d6c5d7f Author: Ilya Leoshkevich Date: Thu Apr 7 23:44:10 2022 +0200 libbpf: Make BPF-side of USDT support work on big-endian machines BPF_USDT_ARG_REG_DEREF handling always reads 8 bytes, regardless of the actual argument size. On little-endian the relevant argument bits end up in the lower bits of val, and later on the code that handles all the argument types expects them to be there. On big-endian they end up in the upper bits of val, breaking that expectation. Fix by right-shifting val on big-endian. Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220407214411.257260-3-iii@linux.ibm.com commit e1b6df598aa86e351437135c76ed38c9a5e3d397 Author: Ilya Leoshkevich Date: Thu Apr 7 23:44:09 2022 +0200 libbpf: Minor style improvements in USDT code Fix several typos and references to non-existing headers. Also use __BYTE_ORDER__ instead of __BYTE_ORDER for consistency with the rest of the bpf code - see commit 45f2bebc8079 ("libbpf: Fix endianness detection in BPF_CORE_READ_BITFIELD_PROBED()") for rationale). Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220407214411.257260-2-iii@linux.ibm.com commit 15fcdf6ae116d1e8da4ff76c6fd82514f5ea501b Author: Ping Gan Date: Wed Apr 6 09:09:56 2022 +0800 tcp: Add tracepoint for tcp_set_ca_state The congestion status of a tcp flow may be updated since there is congestion between tcp sender and receiver. It makes sense to add tracepoint for congestion status set function to summate cc status duration and evaluate the performance of network and congestion algorithm. the backgound of this patch is below. Link: https://github.com/iovisor/bcc/pull/3899 Signed-off-by: Ping Gan Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220406010956.19656-1-jacky_gam_2001@163.com Signed-off-by: Jakub Kicinski commit 794c24e9921f32ded4422833a990ccf11dc3c00e Author: Jeffrey Ji Date: Wed Apr 6 17:26:00 2022 +0000 net-core: rx_otherhost_dropped to core_stats Increment rx_otherhost_dropped counter when packet dropped due to mismatched dest MAC addr. An example when this drop can occur is when manually crafting raw packets that will be consumed by a user space application via a tap device. For testing purposes local traffic was generated using trafgen for the client and netcat to start a server Tested: Created 2 netns, sent 1 packet using trafgen from 1 to the other with "{eth(daddr=$INCORRECT_MAC...}", verified that iproute2 showed the counter was incremented. (Also had to modify iproute2 to show the stat, additional patch for that coming next.) Signed-off-by: Jeffrey Ji Reviewed-by: Brian Vazquez Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220406172600.1141083-1-jeffreyjilinux@gmail.com Signed-off-by: Jakub Kicinski commit 4d242a190f7df8db6f10a68db84f5413af5e3da2 Merge: e8bd70250a821 6264f58ca0e54 Author: Jakub Kicinski Date: Thu Apr 7 20:32:12 2022 -0700 Merge branch 'net-create-a-net-core-internal-header' Jakub Kicinski says: ==================== net: create a net/core/ internal header We are adding stuff to netdevice.h which really should be local to net/core/. Create a net/core/dev.h header and use it. Minor cleanups precede. ==================== Link: https://lore.kernel.org/r/20220406213754.731066-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 6264f58ca0e54e41d63c2d00334a48bac28fbf30 Author: Jakub Kicinski Date: Wed Apr 6 14:37:54 2022 -0700 net: extract a few internals from netdevice.h There's a number of functions and static variables used under net/core/ but not from the outside. We currently dump most of them into netdevice.h. That bad for many reasons: - netdevice.h is very cluttered, hard to figure out what the APIs are; - netdevice.h is very long; - we have to touch netdevice.h more which causes expensive incremental builds. Create a header under net/core/ and move some declarations. The new header is also a bit of a catch-all but that's fine, if we create more specific headers people will likely over-think where their declaration fit best. And end up putting them in netdevice.h, again. More work should be done on splitting netdevice.h into more targeted headers, but that'd be more time consuming so small steps. Signed-off-by: Jakub Kicinski commit 2cc6cdd44a1655ac5a9863529a2fd6dbed2d092c Author: Jakub Kicinski Date: Wed Apr 6 14:37:53 2022 -0700 net: unexport a handful of dev_* functions We have a bunch of functions which are only used under net/core/ yet they get exported. Remove the exports. Signed-off-by: Jakub Kicinski commit e416531f04594de678614f9dc63a84bd12b4ef24 Author: Jakub Kicinski Date: Wed Apr 6 14:37:52 2022 -0700 net: hyperv: remove use of bpf_op_t Following patch will hide that typedef. There seems to be no strong reason for hyperv to use it, so let's not. Acked-by: Wei Liu Signed-off-by: Jakub Kicinski commit 78f02394b3cbedd8f6f01557560585d560e4bf81 Author: Bryan O'Donoghue Date: Mon Jan 31 23:27:21 2022 +0300 arm64: defconfig: Enable SM8250 video clock controller Enable the building of the sm8250 video clock controller by default. Signed-off-by: Bryan O'Donoghue Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220131202721.2122605-2-dmitry.baryshkov@linaro.org commit 9eb75512b1de36ba06e63f3518fcb4f50f7912d8 Author: Aníbal Limón Date: Mon Jan 31 23:27:20 2022 +0300 arm64: defconfig: Enable PM8916 watchdog driver Enable watchdog driver for pm8916 block. It is used on msm8916/apq8016 platforms (e.g. Dragonboard 410c). Signed-off-by: Aníbal Limón [DB: changed to =m, expanded commit message] Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220131202721.2122605-1-dmitry.baryshkov@linaro.org commit 231a136fdf4632aa83402fcb7dc7ea5a6c79be82 Author: Dmitry Baryshkov Date: Mon Jan 31 19:50:53 2022 +0300 arm64: defconfig: enable ath11k driver Enable Atheros Ath11k driver to be built on arm64 platforms. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220131165056.2117434-2-dmitry.baryshkov@linaro.org commit fc739069aa92af5ff038fbd2f490752d724d4d70 Author: Dmitry Baryshkov Date: Mon Jan 31 19:50:52 2022 +0300 arm64: defconfig: Enable some Qualcomm drivers Enable coincell, fastrpc, mailbox and adc-tm5 drivers to be built as modules. These driver are used on many of Qualcomm platforms. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220131165056.2117434-1-dmitry.baryshkov@linaro.org commit e77817b4953dcf59a83bfab18ca5af80d9231d72 Author: Dmitry Baryshkov Date: Tue Apr 5 00:59:13 2022 +0300 arm64: defconfig: reenable SM_DISPCC_8250 CONFIG_SM_DISPCC_8250 is not enabled by default, but it is still necessary for the Qualcomm RB5 board. Reenable it (as it was enabled before the commit dde8cd786e37 ("arm64: defconfig: rebuild default configuration")). Cc: Marcel Ziswiler Fixes: dde8cd786e37 ("arm64: defconfig: rebuild default configuration") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220404215913.1497172-1-dmitry.baryshkov@linaro.org commit 56d16703b4911ff579eaa132f3d3bb88672242a5 Author: Dmitry Baryshkov Date: Mon Apr 4 00:13:29 2022 +0300 arm64: defconfig: enable wcd9335 codec as module Enable CONFIG_SND_SOC_WCD9335 to built as module. This enable audio codec used on the Qualcomm Dragonboard820c device. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220403211329.1410725-1-dmitry.baryshkov@linaro.org commit d2b2c059c1acdf255c4f6ecb64c7d99097930ead Author: Dmitry Baryshkov Date: Fri Apr 1 22:32:30 2022 +0300 arm64: defconfig: enable Qualcomm RX and TX macro for SM8250 audio Add two config options required to enable audio on Qualcomm SM8250 hardware. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220401193230.846207-1-dmitry.baryshkov@linaro.org commit 889b94dbc5539c8c45131aeead6d5923508f535b Author: Brian Masney Date: Fri Mar 11 10:49:19 2022 -0500 ARM: qcom_defconfig: enable debug fs support Enable CONFIG_DEBUG_FS since this is useful to have around. Signed-off-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220311154919.1797920-3-bmasney@redhat.com commit 7fb940d9f670c3adba863b226e0d8cfe149f52d1 Author: Brian Masney Date: Fri Mar 11 10:49:18 2022 -0500 ARM: qcom_defconfig: enable options for Qualcomm random number generator Enable the driver for the Qualcomm random number generator and the userspace crypto API. This was a tested on a Nexus 5 phone (msm8974 SoC). Signed-off-by: Brian Masney Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220311154919.1797920-2-bmasney@redhat.com commit 3be066542ec400e7cdbcef2a6ac1d36c5366a6f6 Author: Jakob Koschel Date: Thu Mar 24 08:24:35 2022 +0100 soc: qcom: pdr: 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/ Signed-off-by: Jakob Koschel Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220324072435.63070-1-jakobkoschel@gmail.com commit 3edff6262c48fe73feedc7277a3a6ebc3ed35a37 Author: Rohit Agarwal Date: Wed Mar 16 11:37:15 2022 +0530 soc: qcom: rpmhpd: Add SDX65 power domains Add power domains found in Qualcomm SDX65 SoC. Signed-off-by: Rohit Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647410837-22537-5-git-send-email-quic_rohiagar@quicinc.com commit ccc706353d1b89d8ff1726e575dd4a10f8550fb7 Author: Rohit Agarwal Date: Wed Mar 16 11:37:14 2022 +0530 dt-bindings: power: Add rpm power domain bindings for SDX65 Add RPM power domain bindings for the SDX65 SoC. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1647410837-22537-4-git-send-email-quic_rohiagar@quicinc.com commit aad66a3c78da668f4506356c2fdb70b7a19ecc76 Author: Miaoqian Lin Date: Tue Mar 8 07:36:48 2022 +0000 soc: qcom: smsm: Fix missing of_node_put() in smsm_parse_ipc The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: c97c4090ff72 ("soc: qcom: smsm: Add driver for Qualcomm SMSM") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308073648.24634-1-linmq006@gmail.com commit 8fd3f18ea31a398ecce4a6d3804433658678b0a3 Author: Miaoqian Lin Date: Tue Mar 8 07:19:42 2022 +0000 soc: qcom: smp2p: Fix missing of_node_put() in smp2p_parse_ipc The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 50e99641413e ("soc: qcom: smp2p: Qualcomm Shared Memory Point to Point") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308071942.22942-1-linmq006@gmail.com commit 54c2e9256a5688a98225207734688b4b7c0f40c9 Author: Dmitry Baryshkov Date: Mon Feb 28 22:00:13 2022 +0300 soc: qcom: socinfo: Add another ID for SM8450 Add another id for SM8450. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228190013.1790617-1-dmitry.baryshkov@linaro.org commit 4a77579c73413deb4aa562b6e781e3c65ff7abb2 Author: Douglas Anderson Date: Mon Mar 21 16:15:55 2022 -0700 soc: qcom: socinfo: add SC7280 entry to soc_id array Add an entry for SC7280 SoC. Signed-off-by: Douglas Anderson Reviewed-by: Sai Prakash Ranjan Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220321161546.1.Ifc4270fbe9bad536f08a47696e00cca5a0714abd@changeid commit 981a340540381532652731a500ba9df768bcef7d Author: Krzysztof Kozlowski Date: Thu Apr 7 21:35:42 2022 +0200 dt-bindings: power: renesas,rcar-sysc: drop useless consumer example Consumer examples in the bindings of resource providers are trivial, useless and duplication of code. Remove the example code for consumer. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407193542.17230-1-krzysztof.kozlowski@linaro.org commit ded6dffaed5edc68f1e64b523353da14db673460 Author: Andrii Nakryiko Date: Thu Apr 7 13:38:42 2022 -0700 libbpf: Fix use #ifdef instead of #if to avoid compiler warning As reported by Naresh: perf build errors on i386 [1] on Linux next-20220407 [2] usdt.c:1181:5: error: "__x86_64__" is not defined, evaluates to 0 [-Werror=undef] 1181 | #if __x86_64__ | ^~~~~~~~~~ usdt.c:1196:5: error: "__x86_64__" is not defined, evaluates to 0 [-Werror=undef] 1196 | #if __x86_64__ | ^~~~~~~~~~ cc1: all warnings being treated as errors Use #ifdef instead of #if to avoid this. Fixes: 4c59e584d158 ("libbpf: Add x86-specific USDT arg spec parsing logic") Reported-by: Naresh Kamboju Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220407203842.3019904-1-andrii@kernel.org commit 49aa98ca30cd186ab33fc5802066e2024d3bfa39 Author: Yongqiang Sun Date: Wed Mar 30 10:48:19 2022 -0400 drm/amd/amdgpu: Only reserve vram for firmware with vega9 MS_HYPERV host. driver loading failed on VEGA10 SRIOV VF with linux host due to a wide range of stolen reserved vram. Since VEGA10 SRIOV VF need to reserve vram for firmware with windows Hyper_V host specifically, check hypervisor type to only reserve memory for it, and the range of the reserved vram can be limited to between 5M-7M area. Fixes: faad5ccac1eaae ("drm/amdgpu: Add stolen reserved memory for MI25 SRIOV.") Signed-off-by: Yongqiang Sun Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3cd3e731f34ff2f021165aeefd640acba9dd0993 Author: Felix Kuehling Date: Wed Apr 6 16:58:24 2022 -0400 drm/amdkfd: Fix NULL pointer dereference Check that adev->gfx.ras is valid before using it. Fixes: 6475ae2b742876 ("drm/amdgpu: add UTCL2 RAS poison query for Aldebaran (v2)") CC: Tao Zhou Signed-off-by: Felix Kuehling Reviewed-by: Mukul Joshi Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dac1655cb2a92e6ba13f37dee1a56cb8a7d7f753 Author: Tom Rix Date: Sun Apr 3 10:21:37 2022 -0400 drm/amd/display: cleanup extern usage in function definition Smatch reports this issue hdcp1_execution.c:500:29: warning: function 'mod_hdcp_hdcp1_dp_execution' with external linkage has definition The storage-class-specifier extern is not needed in a definition, so remove it. Reviewed-by: Harry Wentland Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit 9b6a1ec7924e9feee70ece3f779bc058ff25f716 Author: Tomasz Moń Date: Wed Apr 6 21:49:21 2022 +0200 drm/amdgpu: Enable gfxoff quirk on MacBook Pro Enabling gfxoff quirk results in perfectly usable graphical user interface on MacBook Pro (15-inch, 2019) with Radeon Pro Vega 20 4 GB. Without the quirk, X server is completely unusable as every few seconds there is gpu reset due to ring gfx timeout. Signed-off-by: Tomasz Moń Signed-off-by: Alex Deucher commit 9e051720f9d37ef6f878a6106478c82fb9b375d1 Author: Kai-Heng Feng Date: Thu Apr 7 20:12:28 2022 +0800 drm/amdgpu: Ensure HDA function is suspended before ASIC reset DP/HDMI audio on AMD PRO VII stops working after S3: [ 149.450391] amdgpu 0000:63:00.0: amdgpu: MODE1 reset [ 149.450395] amdgpu 0000:63:00.0: amdgpu: GPU mode1 reset [ 149.450494] amdgpu 0000:63:00.0: amdgpu: GPU psp mode1 reset [ 149.983693] snd_hda_intel 0000:63:00.1: refused to change power state from D0 to D3hot [ 150.003439] amdgpu 0000:63:00.0: refused to change power state from D0 to D3hot ... [ 155.432975] snd_hda_intel 0000:63:00.1: CORB reset timeout#2, CORBRP = 65535 The offending commit is daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)"). Commit 34452ac3038a7 ("drm/amdgpu: don't use BACO for reset in S3 ") doesn't help, so the issue is something different. Assuming that to make HDA resume to D0 fully realized, it needs to be successfully put to D3 first. And this guesswork proves working, by moving amdgpu_asic_reset() to noirq callback, so it's called after HDA function is in D3. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Signed-off-by: Kai-Heng Feng Signed-off-by: Alex Deucher commit dd481828975f1a7e535e51f0e10178ae8e05fe33 Author: Alex Deucher Date: Wed Apr 6 14:39:03 2022 -0400 drm/amdgpu: fix VCN 3.1.2 firmware name Drop the trailing vcn. Fixes: afc2f276057ea1 ("drm/amdgpu/vcn: add vcn support for vcn 3.1.2") Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 67229b27ed6fdb6bfce04f61ce4026c57b32ba15 Author: Melissa Wen Date: Tue Mar 29 19:18:35 2022 -0100 drm/amd/display: don't ignore alpha property on pre-multiplied mode "Pre-multiplied" is the default pixel blend mode for KMS/DRM, as documented in supported_modes of drm_plane_create_blend_mode_property(): https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_blend.c In this mode, both 'pixel alpha' and 'plane alpha' participate in the calculation, as described by the pixel blend mode formula in KMS/DRM documentation: out.rgb = plane_alpha * fg.rgb + (1 - (plane_alpha * fg.alpha)) * bg.rgb Considering the blend config mechanisms we have in the driver so far, the alpha mode that better fits this blend mode is the _PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN, where the value for global_gain is the plane alpha (global_alpha). With this change, alpha property stops to be ignored. It also addresses Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1734 v2: * keep the 8-bit value for global_alpha_value (Nicholas) * correct the logical ordering for combined global gain (Nicholas) * apply to dcn10 too (Nicholas) Signed-off-by: Melissa Wen Tested-by: Rodrigo Siqueira Reviewed-by: Harry Wentland Tested-by: Simon Ser Signed-off-by: Alex Deucher commit 5273e82c5f47fff94058ff8ee002650476e24719 Author: Felix Kuehling Date: Tue Mar 1 20:40:45 2022 -0500 drm/amdkfd: Improve concurrency of event handling Use rcu_read_lock to read p->event_idr concurrently with other readers and writers. Use p->event_mutex only for creating and destroying events and in kfd_wait_on_events. Protect the contents of the kfd_event structure with a per-event spinlock that can be taken inside the rcu_read_lock critical section. This eliminates contention of p->event_mutex in set_event, which tends to be on the critical path for dispatch latency even when busy waiting is used. It also eliminates lock contention in event interrupt handlers. Since the p->event_mutex is now used much less, the impact of requiring it in kfd_wait_on_events should also be much smaller. This should improve event handling latency for processes using multiple GPUs concurrently. v2: Reschedule the worker periodically to avoid soft lockup warnings Signed-off-by: Felix Kuehling Reviewed-by: Sean Keely # v1 Tested-by: Sanjay Tripathi Signed-off-by: Alex Deucher commit c9bdd50d2019f78bf4c1f6a79254c27771901023 Author: Krzysztof Kozlowski Date: Thu Apr 7 21:30:22 2022 +0200 ARM: dts: socfpga: align interrupt controller node name with dtschema Fixes dtbs_check warnings like: $nodename:0: 'intc@fffed000' does not match '^interrupt-controller(@[0-9a-f,]+)*$' Signed-off-by: Krzysztof Kozlowski Acked-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220317115705.450427-2-krzysztof.kozlowski@canonical.com commit fbcd5ad7a419ad40644a0bb8b4152bc660172d8a Author: Krzysztof Kozlowski Date: Thu Apr 7 21:29:59 2022 +0200 ARM: dts: ox820: align interrupt controller node name with dtschema Fixes dtbs_check warnings like: gic@1000: $nodename:0: 'gic@1000' does not match '^interrupt-controller(@[0-9a-f,]+)*$' Signed-off-by: Krzysztof Kozlowski Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20220317115705.450427-1-krzysztof.kozlowski@canonical.com commit fa04ccac619085332563fb433ffc4ecc8ba5489e Author: Krzysztof Kozlowski Date: Thu Apr 7 21:29:38 2022 +0200 ARM: dts: nspire: use lower case hex addresses in node unit addresses Convert all hex addresses in node unit addresses to lower case to fix dt_binding_check and dtc W=1 warnings. Conversion was done using sed: $ sed -e 's/@\([a-zA-Z0-9_-]*\) {/@\L\1 {/' -i arch/arm/boot/dts/nspire* $ sed -e 's/<0x\([a-zA-Z0-9_-]*\) /<0x\L\1 /g' -i arch/arm/boot/dts/nspire* Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220317115542.450032-2-krzysztof.kozlowski@canonical.com commit 673283a3be1718a58ab9ff7762ef4ec6bcf505c4 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:34:05 2022 +0200 dt-bindings: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Acked-by: Mark Brown Reviewed-by: Miquel Raynal Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407143405.295907-1-krzysztof.kozlowski@linaro.org commit ad2c6e3cdd6121bdabf0726355dbe04b987c92e0 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:11 2022 +0200 arm64: dts: broadcom: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit ae6a766f4fc1ff1e0174ff6f6ba1fe24986f6852 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:10 2022 +0200 ARM: dts: broadcom: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit e58c5c9717460851047f63b8615ea0760a6f3a2e Author: Haowen Bai Date: Thu Apr 7 10:38:17 2022 +0800 libbpf: Potential NULL dereference in usdt_manager_attach_usdt() link could be null but still dereference bpf_link__destroy(&link->link) and it will lead to a null pointer access. Signed-off-by: Haowen Bai Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1649299098-2069-1-git-send-email-baihaowen@meizu.com commit 502b0e3dcb326cf38334dad35957b12d9cdcf633 Merge: 9fc4476a08b6d 1717e248014c3 Author: Andrii Nakryiko Date: Thu Apr 7 11:42:51 2022 -0700 Merge branch 'libbpf: uprobe name-based attach followups' Alan Maguire says: ==================== Follow-up series to [1] to address some suggestions from Andrii to improve parsing and make it more robust (patches 1, 2) and to improve validation of u[ret]probe firing by validating expected argument and return values (patch 3). [1] https://lore.kernel.org/bpf/164903521182.13106.12656654142629368774.git-patchwork-notify@kernel.org/ Changes since v1: - split library name, auto-attach parsing into separate patches (Andrii, patches 1, 2) - made str_has_sfx() static inline, avoided repeated strlen()s by storing lengths, used strlen() instead of strnlen() (Andrii, patch 1) - fixed sscanf() arg to use %li, switched logging to use "prog '%s'" format, used direct strcmp() on probe_type instead of prefix check (Andrii, patch 2) - switched auto-attach tests to log parameter/return values to be checked by user-space side of tests. Needed to add pid filtering to avoid capturing stray malloc()s (Andrii, patch 3) ==================== Signed-off-by: Andrii Nakryiko commit 1717e248014c33a81d7a1cdc048c6b3bed7bb3f8 Author: Alan Maguire Date: Wed Apr 6 12:43:51 2022 +0100 selftests/bpf: Uprobe tests should verify param/return values uprobe/uretprobe tests don't do any validation of arguments/return values, and without this we can't be sure we are attached to the right function, or that we are indeed attached to a uprobe or uretprobe. To fix this record argument and return value for auto-attached functions and ensure these match expectations. Also need to filter by pid to ensure we do not pick up stray malloc()s since auto-attach traces libc system-wide. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1649245431-29956-4-git-send-email-alan.maguire@oracle.com commit 90db26e6be01cea519d380c59db3491e75b96b7f Author: Alan Maguire Date: Wed Apr 6 12:43:50 2022 +0100 libbpf: Improve string parsing for uprobe auto-attach For uprobe auto-attach, the parsing can be simplified for the SEC() name to a single sscanf(); the return value of the sscanf can then be used to distinguish between sections that simply specify "u[ret]probe" (and thus cannot auto-attach), those that specify "u[ret]probe/binary_path:function+offset" etc. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1649245431-29956-3-git-send-email-alan.maguire@oracle.com commit a1c9d61b19cbc0b9618c0a0400c304ecb63221d5 Author: Alan Maguire Date: Wed Apr 6 12:43:49 2022 +0100 libbpf: Improve library identification for uprobe binary path resolution In the process of doing path resolution for uprobe attach, libraries are identified by matching a ".so" substring in the binary_path. This matches a lot of patterns that do not conform to library.so[.version] format, so instead match a ".so" _suffix_, and if that fails match a ".so." substring for the versioned library case. Suggested-by: Andrii Nakryiko Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1649245431-29956-2-git-send-email-alan.maguire@oracle.com commit 081e8432adb192dd61a346eb23d3c415acb2fcaf Author: Philipp Zabel Date: Thu Apr 7 16:58:02 2022 +0200 dt-bindings: reset: Drop the hisilicon,hi6220-reset binding The hisilicon,hi6220-sysctrl, hisilicon,hi6220-mediactrl, and hisilicon,hi6220-aoctrl controllers are already described in: Documentation/devicetree/bindings/arm/hisilicon/controller/sysctrl.yaml Documentation/devicetree/bindings/arm/hisilicon/controller/hi6220-domain-ctrl.yaml Signed-off-by: Philipp Zabel Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407145802.4060130-1-p.zabel@pengutronix.de commit fe88f5f70b9f1df16eabab4a558cf5cf567a1940 Author: AngeloGioacchino Del Regno Date: Thu Apr 7 11:47:53 2022 +0200 dt-bindings: i2c: convert i2c-mt65xx to json-schema Convert I2C binding for MediaTek SoCs to Devicetree schema. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220407094753.13282-1-angelogioacchino.delregno@collabora.com commit bc4f661a45205ccd60bae2641b1be2333621c90c Author: Mahak Gupta Date: Thu Apr 7 17:39:45 2022 +0530 staging: rtl8712: fix camel case in function r8712_generate_ie Adhere to linux kernel coding style. Reported by checkpatch: CHECK: Avoid CamelCase: Signed-off-by: Mahak Gupta Link: https://lore.kernel.org/r/20220407120945.31030-1-mahak_g@cs.iitr.ac.in Signed-off-by: Greg Kroah-Hartman commit 847a04d676ef41b1b336cddfbd75badd09511bef Author: Alaa Mohamed Date: Wed Apr 6 17:49:21 2022 +0200 staging: rtl8192e: remove multiple blank lines Reported by checkpatch: CHECK: Please don't use multiple blank lines Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220406154921.15532-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit ed42eb4b2b401462c0100754a0ba83260d7a7829 Author: Sevinj Aghayeva Date: Tue Apr 5 12:16:43 2022 -0400 staging: rtl8723bs: fix indentation Adhere to Linux kernel coding indentation style. Also remove the comments that became irrelevant after fixing indentation. Reported by checkpatch: WARNING: suspect code indent for conditional statements Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220405161643.GA630826@euclid Signed-off-by: Greg Kroah-Hartman commit 2b18b93e199510429fce0f799df6418eadf9bd08 Author: Krzysztof Kozlowski Date: Wed Apr 6 18:07:28 2022 +0200 dt-bindings: vendor-prefixes: add Enclustra Add vendor prefix for Enclustra GmbH (https://www.enclustra.com). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220406160728.720902-1-krzysztof.kozlowski@linaro.org commit 808d5dbeec7863db7c85217dafee02203a4bec94 Author: Rebecca Mckeever Date: Wed Apr 6 03:31:00 2022 -0500 staging: r8188eu: use sizeof(*pvar) for allocating structs Use sizeof(*pvar) instead of sizeof(struct var) when allocating memory. This conforms to Linux kernel coding style, improves readability, and decreases the opportunity for bugs if the pointer variable type is changed. Issue found by checkpatch messages of the following format: CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...) Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/5b526d8c178d89328de935ff4ff57651bdd8379b.1649233201.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit cb9d73dbe2376600d2cfcc262d972e44cbe0a3c2 Author: Rebecca Mckeever Date: Wed Apr 6 03:30:59 2022 -0500 staging: r8188eu: correct misspelling in comment 'tppe' -> 'type' Correct spelling typo. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/edaab7d38893e4f1cbb3c281b617c74fa91f0fe7.1649233201.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 94c82e10ecff6ee0060a800687b255e9d1818052 Author: Rebecca Mckeever Date: Wed Apr 6 03:30:58 2022 -0500 staging: r8188eu: remove extra 'the' Remove repeated 'the' in comment to be grammatically correct and conform to Linux kernel coding style. Found with checkpatch: WARNING: Possible repeated word: 'the' Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/e259a035b79c814f871b490aa277bf0dfe23fe11.1649233201.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 95b8f316aea3b741fb8028d984e15bb0d1d9a1ac Author: Rebecca Mckeever Date: Wed Apr 6 03:30:57 2022 -0500 staging: r8188eu: format comments in drivers/net style Format comments according to the Linux kernerl coding style for drivers/net so they do not need to be reformatted after this driver is accepted into the drivers/net tree. Suggested-by: Larry Finger Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/bd7960acafb871c17ef733cd98b37294f38ad3fb.1649233201.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9cd3cf7d44453824f914b459808002e07e21e4e1 Author: Alaa Mohamed Date: Thu Apr 7 14:59:47 2022 +0200 staging: rtl8712: remove unnecessary parentheses Reported by checkpatch: Remove unnecessary parentheses around structure field references Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220407125947.8525-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0557dc5ea2e4b9f8fb85f61445873fba26078b03 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:51 2022 +0200 dt-bindings: qcom: qcom,gsbi: convert to dtschema Convert the Qualcomm General Serial Bus Interface (GSBI) to DT Schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220405063451.12011-10-krzysztof.kozlowski@linaro.org commit 71f333a1dddccdd636d42118c66dda68aee149ed Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:50 2022 +0200 dt-bindings: i2c: qcom,i2c-qup: convert to dtschema Convert the Qualcomm Universal Peripheral (QUP) I2C controller to DT Schema. Add missing properties: dma and dma-names, pinctrl states (to indicate support for sleep pinctrl). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220405063451.12011-9-krzysztof.kozlowski@linaro.org commit a5b7063f6dde18f9a5b0356a1941e1ea4a499ea1 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:49 2022 +0200 dt-bindings: serial: qcom,msm-uartdm: convert to dtschema Convert the Qualcomm MSM Serial UARTDM bindings to DT Schema. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220405063451.12011-8-krzysztof.kozlowski@linaro.org commit d6a4371c3cdd4febb6ccb860832409fd9a61e12a Author: Krzysztof Kozlowski Date: Tue Apr 5 08:34:48 2022 +0200 spi: dt-bindings: qcom,spi-qup: convert to dtschema Convert the Qualcomm Universal Peripheral (QUP) Serial Peripheral Interface (SPI) bindings to DT Schema. Signed-off-by: Krzysztof Kozlowski Acked-by: Kuldeep Singh Reviewed-by: Rob Herring Acked-by: Mark Brown Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220405063451.12011-7-krzysztof.kozlowski@linaro.org commit de0f170888513978d73fbfe055ae041c21ba83b7 Author: Michael Straube Date: Thu Apr 7 14:57:42 2022 +0200 staging: r8188eu: remove unused _RND* from osdep_service.h Remove the unused macro _RND() and the unused functions _RND256(), _RND512() from osdep_service.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407125742.7814-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1d3319b2cc45dde29878c9710171b4cfec9c39ce Author: Michael Straube Date: Thu Apr 7 14:57:41 2022 +0200 staging: r8188eu: use round_up() instead of _RND128() Use in-kernel round_up() instead of custom _RND128(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407125742.7814-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c63e792bb7ccc3c1091272d6a009d6eb6ad18614 Author: Michael Straube Date: Thu Apr 7 14:57:40 2022 +0200 staging: r8188eu: use round_up() instead of _RND8() Use in-kernel round_up() instead of custom _RND8(). Just remove _RND8 where it is not necessary to round up. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407125742.7814-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 79f5d88f16fe13e13d9255502ec8367352250314 Author: Michael Straube Date: Thu Apr 7 14:57:39 2022 +0200 staging: r8188eu: use round_up() instead of _RND4() Use in-kernel round_up() instead of custom _RND4(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407125742.7814-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 727841e02b65b36505fde45ec4983ed1291e1729 Author: Michael Straube Date: Thu Apr 7 14:57:38 2022 +0200 staging: r8188eu: use PTR_ALIGN() instead of RND4() Use in-kernel PTR_ALIGN() instead of custom RND4(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220407125742.7814-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 92298ea34a8546f11989d122e8f0937d002faeb6 Author: Krzysztof Kozlowski Date: Tue Apr 5 08:37:24 2022 +0200 dt-bindings: qcom: update maintainers (drop Akash and Mukesh) Emails to Akash Asthana and Mukesh Savaliya bounce (550: Recipient address rejected: User unknown in virtual alias table), so switch maintainer to Bjorn (as active Qualcomm platform maintainer). Cc: Bjorn Andersson Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Mark Brown Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220405063724.12850-1-krzysztof.kozlowski@linaro.org commit f8525b9763c61f54d1abdcce2821468dc416cda1 Merge: 7288ff561de65 4a5fb1bbcdf1c Author: Greg Kroah-Hartman Date: Thu Apr 7 19:40:39 2022 +0200 Merge branch 'wfx-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next into staging-next This moves the wfx driver out of staging. * 'wfx-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: wfx: get out from the staging area commit 65adf7234a0dd68217f58715b0b5fd940b630529 Author: Kunihiko Hayashi Date: Tue Apr 5 16:55:03 2022 +0900 regulator: uniphier: Use unevaluatedProperties This refers common bindings, so this is preferred for unevaluatedProperties instead of additionalProperties. Signed-off-by: Kunihiko Hayashi Acked-by: Rob Herring Link: https://lore.kernel.org/r/1649145303-30221-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 2eacc8479c1f6610288f619a23c374502176ca66 Author: Kunihiko Hayashi Date: Tue Apr 5 16:55:02 2022 +0900 regulator: uniphier: Clean up clocks, resets, and their names using compatible string Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks, resets, and their names that can be taken by the compatible string. The order of clock-names and reset-names doesn't change here. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1649145303-30221-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 5cfe477f6a3f9a4d9b2906d442964f2115b0403f Author: YC Hung Date: Wed Apr 6 14:40:46 2022 -0500 ASoC: SOF: mediatek: mt8195 add shutdown callback Add mt8195 shutdown callback function implementation to ensure that shutdown flow is called to shutdown dsp core, disable adsp clock, and power off dsp sram correctly during reboot flow. Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220406194048.289787-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fe70300c70baa82fd3024af9a1d2838610a35005 Author: YC Hung Date: Wed Apr 6 14:40:45 2022 -0500 ASoC: SOF: OF: Add shutdown callback for SOF OF device Add shutdown callback function for SOF OF device and call snd_sof_device_shutdown in sof_of_shutdown callback for DSP shutdown sequence. Signed-off-by: YC Hung Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220406194048.289787-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 03038d84ace72678a9944524508f218a00377dc0 Author: Mika Westerberg Date: Tue Apr 5 12:38:10 2022 +0300 PCI/ASPM: Make Intel DG2 L1 acceptable latency unlimited Intel DG2 discrete graphics PCIe endpoints advertise L1 acceptable exit latency to be < 1us even though they can actually tolerate unlimited exit latencies just fine. Quirk the L1 acceptable exit latency for these endpoints to be unlimited so ASPM L1 can be enabled. [bhelgaas: use FIELD_GET/FIELD_PREP, wordsmith comment & commit log] Link: https://lore.kernel.org/r/20220405093810.76613-1-mika.westerberg@linux.intel.com Signed-off-by: Mika Westerberg Signed-off-by: Bjorn Helgaas Reviewed-by: Rodrigo Vivi commit e2efb6359e620521d1e13f69b2257de8ceaa9475 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:38 2022 +0300 ACPICA: Avoid cache flush inside virtual machines While running inside virtual machine, the kernel can bypass cache flushing. Changing sleep state in a virtual machine doesn't affect the host system sleep state and cannot lead to data loss. Before entering sleep states, the ACPI code flushes caches to prevent data loss using the WBINVD instruction. This mechanism is required on bare metal. But, any use WBINVD inside of a guest is worthless. Changing sleep state in a virtual machine doesn't affect the host system sleep state and cannot lead to data loss, so most hypervisors simply ignore it. Despite this, the ACPI code calls WBINVD unconditionally anyway. It's useless, but also normally harmless. In TDX guests, though, WBINVD stops being harmless; it triggers a virtualization exception (#VE). If the ACPI cache-flushing WBINVD were left in place, TDX guests would need handling to recover from the exception. Avoid using WBINVD whenever running under a hypervisor. This both removes the useless WBINVDs and saves TDX from implementing WBINVD handling. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Reviewed-by: Dan Williams Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-30-kirill.shutemov@linux.intel.com commit f4c9361f97c40d365c34f9cb8b8bc3eae0ee7778 Author: Isaku Yamahata Date: Wed Apr 6 02:29:37 2022 +0300 x86/tdx/ioapic: Add shared bit for IOAPIC base address The kernel interacts with each bare-metal IOAPIC with a special MMIO page. When running under KVM, the guest's IOAPICs are emulated by KVM. When running as a TDX guest, the guest needs to mark each IOAPIC mapping as "shared" with the host. This ensures that TDX private protections are not applied to the page, which allows the TDX host emulation to work. ioremap()-created mappings such as virtio will be marked as shared by default. However, the IOAPIC code does not use ioremap() and instead uses the fixmap mechanism. Introduce a special fixmap helper just for the IOAPIC code. Ensure that it marks IOAPIC pages as "shared". This replaces set_fixmap_nocache() with __set_fixmap() since __set_fixmap() allows custom 'prot' values. AMD SEV gets IOAPIC pages shared because FIXMAP_PAGE_NOCACHE has _ENC bit clear. TDX has to set bit to share the page with the host. Signed-off-by: Isaku Yamahata Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-29-kirill.shutemov@linux.intel.com commit 968b493173ac5205fe75f6330ee767f96bf88e57 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:36 2022 +0300 x86/mm: Make DMA memory shared for TD guest Intel TDX doesn't allow VMM to directly access guest private memory. Any memory that is required for communication with the VMM must be shared explicitly. The same rule applies for any DMA to and from the TDX guest. All DMA pages have to be marked as shared pages. A generic way to achieve this without any changes to device drivers is to use the SWIOTLB framework. The previous patch ("Add support for TDX shared memory") gave TDX guests the _ability_ to make some pages shared, but did not make any pages shared. This actually marks SWIOTLB buffers *as* shared. Start returning true for cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) in TDX guests. This has several implications: - Allows the existing mem_encrypt_init() to be used for TDX which sets SWIOTLB buffers shared (aka. "decrypted"). - Ensures that all DMA is routed via the SWIOTLB mechanism (see pci_swiotlb_detect()) Stop selecting DYNAMIC_PHYSICAL_MASK directly. It will get set indirectly by selecting X86_MEM_ENCRYPT. mem_encrypt_init() is currently under an AMD-specific #ifdef. Move it to a generic area of the header. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-28-kirill.shutemov@linux.intel.com commit 7dbde7631629896b478bc5b1f4c3e52e6d518d12 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:35 2022 +0300 x86/mm/cpa: Add support for TDX shared memory Intel TDX protects guest memory from VMM access. Any memory that is required for communication with the VMM must be explicitly shared. It is a two-step process: the guest sets the shared bit in the page table entry and notifies VMM about the change. The notification happens using MapGPA hypercall. Conversion back to private memory requires clearing the shared bit, notifying VMM with MapGPA hypercall following with accepting the memory with AcceptPage hypercall. Provide a TDX version of x86_platform.guest.* callbacks. It makes __set_memory_enc_pgtable() work right in TDX guest. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-27-kirill.shutemov@linux.intel.com commit 9aa6ea69852c46e551f4180dce4208bd53df418c Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:34 2022 +0300 x86/tdx: Make pages shared in ioremap() In TDX guests, guest memory is protected from host access. If a guest performs I/O, it needs to explicitly share the I/O memory with the host. Make all ioremap()ed pages that are not backed by normal memory (IORES_DESC_NONE or IORES_DESC_RESERVED) mapped as shared. The permissions in PAGE_KERNEL_IO already work for "decrypted" memory on AMD SEV/SME systems. That means that they have no need to make a pgprot_decrypted() call. TDX guests, on the other hand, _need_ change to PAGE_KERNEL_IO for "decrypted" mappings. Add a pgprot_decrypted() for TDX. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-26-kirill.shutemov@linux.intel.com commit bae1a962ac2c5e6be08319ff3f7d6df542584fce Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:33 2022 +0300 x86/topology: Disable CPU online/offline control for TDX guests Unlike regular VMs, TDX guests use the firmware hand-off wakeup method to wake up the APs during the boot process. This wakeup model uses a mailbox to communicate with firmware to bring up the APs. As per the design, this mailbox can only be used once for the given AP, which means after the APs are booted, the same mailbox cannot be used to offline/online the given AP. More details about this requirement can be found in Intel TDX Virtual Firmware Design Guide, sec titled "AP initialization in OS" and in sec titled "Hotplug Device". Since the architecture does not support any method of offlining the CPUs, disable CPU hotplug support in the kernel. Since this hotplug disable feature can be re-used by other VM guests, add a new CC attribute CC_ATTR_HOTPLUG_DISABLED and use it to disable the hotplug support. Attempt to offline CPU will fail with -EOPNOTSUPP. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-25-kirill.shutemov@linux.intel.com commit 77a512e35db7609a8c909e2006b2ea82f2b1616f Author: Sean Christopherson Date: Wed Apr 6 02:29:32 2022 +0300 x86/boot: Avoid #VE during boot for TDX platforms There are a few MSRs and control register bits that the kernel normally needs to modify during boot. But, TDX disallows modification of these registers to help provide consistent security guarantees. Fortunately, TDX ensures that these are all in the correct state before the kernel loads, which means the kernel does not need to modify them. The conditions to avoid are: * Any writes to the EFER MSR * Clearing CR4.MCE This theoretically makes the guest boot more fragile. If, for instance, EFER was set up incorrectly and a WRMSR was performed, it will trigger early exception panic or a triple fault, if it's before early exceptions are set up. However, this is likely to trip up the guest BIOS long before control reaches the kernel. In any case, these kinds of problems are unlikely to occur in production environments, and developers have good debug tools to fix them quickly. Change the common boot code to work on TDX and non-TDX systems. This should have no functional effect on non-TDX systems. Signed-off-by: Sean Christopherson Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Dan Williams Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-24-kirill.shutemov@linux.intel.com commit 9cf30606405f37b68ee1c0f6846253313c077088 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:31 2022 +0300 x86/boot: Set CR0.NE early and keep it set during the boot TDX guest requires CR0.NE to be set. Clearing the bit triggers #GP(0). If CR0.NE is 0, the MS-DOS compatibility mode for handling floating-point exceptions is selected. In this mode, the software exception handler for floating-point exceptions is invoked externally using the processor’s FERR#, INTR, and IGNNE# pins. Using FERR# and IGNNE# to handle floating-point exception is deprecated. CR0.NE=0 also limits newer processors to operate with one logical processor active. Kernel uses CR0_STATE constant to initialize CR0. It has NE bit set. But during early boot kernel has more ad-hoc approach to setting bit in the register. During some of this ad-hoc manipulation, CR0.NE is cleared. This causes a #GP in TDX guests and makes it die in early boot. Make CR0 initialization consistent, deriving the initial value of CR0 from CR0_STATE. Since CR0_STATE always has CR0.NE=1, this ensures that CR0.NE is never 0 and avoids the #GP. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-23-kirill.shutemov@linux.intel.com commit f39642d0dbacded8b4a816a9197a73efb74e5702 Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:30 2022 +0300 x86/acpi/x86/boot: Add multiprocessor wake-up support Secondary CPU startup is currently performed with something called the "INIT/SIPI protocol". This protocol requires assistance from VMMs to boot guests. As should be a familiar story by now, that support can not be provded to TDX guests because TDX VMMs are not trusted by guests. To remedy this situation a new[1] "Multiprocessor Wakeup Structure" has been added to to an existing ACPI table (MADT). This structure provides the physical address of a "mailbox". A write to the mailbox then steers the secondary CPU to the boot code. Add ACPI MADT wake structure parsing support and wake support. Use this support to wake CPUs whenever it is present instead of INIT/SIPI. While this structure can theoretically be used on 32-bit kernels, there are no 32-bit TDX guest kernels. It has not been tested and can not practically *be* tested on 32-bit. Make it 64-bit only. 1. Details about the new structure can be found in ACPI v6.4, in the "Multiprocessor Wakeup Structure" section. Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Rafael J. Wysocki Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-22-kirill.shutemov@linux.intel.com commit ff2e64684f153a61f6ae553e860af4b6ef2f4ca5 Author: Sean Christopherson Date: Wed Apr 6 02:29:29 2022 +0300 x86/boot: Add a trampoline for booting APs via firmware handoff Historically, x86 platforms have booted secondary processors (APs) using INIT followed by the start up IPI (SIPI) messages. In regular VMs, this boot sequence is supported by the VMM emulation. But such a wakeup model is fatal for secure VMs like TDX in which VMM is an untrusted entity. To address this issue, a new wakeup model was added in ACPI v6.4, in which firmware (like TDX virtual BIOS) will help boot the APs. More details about this wakeup model can be found in ACPI specification v6.4, the section titled "Multiprocessor Wakeup Structure". Since the existing trampoline code requires processors to boot in real mode with 16-bit addressing, it will not work for this wakeup model (because it boots the AP in 64-bit mode). To handle it, extend the trampoline code to support 64-bit mode firmware handoff. Also, extend IDT and GDT pointers to support 64-bit mode hand off. There is no TDX-specific detection for this new boot method. The kernel will rely on it as the sole boot method whenever the new ACPI structure is present. The ACPI table parser for the MADT multiprocessor wake up structure and the wakeup method that uses this structure will be added by the following patch in this series. Signed-off-by: Sean Christopherson Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Dan Williams Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-21-kirill.shutemov@linux.intel.com commit cfb8ec7a31f234b4519c104f1cc9accbc8b393a9 Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:28 2022 +0300 x86/tdx: Wire up KVM hypercalls KVM hypercalls use the VMCALL or VMMCALL instructions. Although the ABI is similar, those instructions no longer function for TDX guests. Make vendor-specific TDVMCALLs instead of VMCALL. This enables TDX guests to run with KVM acting as the hypervisor. Among other things, KVM hypercall is used to send IPIs. Since the KVM driver can be built as a kernel module, export tdx_kvm_hypercall() to make the symbols visible to kvm.ko. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-20-kirill.shutemov@linux.intel.com commit 32e72854fa5fef6bc72e27c54f31897db9092acb Author: Andi Kleen Date: Wed Apr 6 02:29:27 2022 +0300 x86/tdx: Port I/O: Add early boot support TDX guests cannot do port I/O directly. The TDX module triggers a #VE exception to let the guest kernel emulate port I/O by converting them into TDCALLs to call the host. But before IDT handlers are set up, port I/O cannot be emulated using normal kernel #VE handlers. To support the #VE-based emulation during this boot window, add a minimal early #VE handler support in early exception handlers. This is similar to what AMD SEV does. This is mainly to support earlyprintk's serial driver, as well as potentially the VGA driver. The early handler only supports I/O-related #VE exceptions. Unhandled or failed exceptions will be handled via early_fixup_exceptions() (like normal exception failures). At runtime I/O-related #VE exceptions (along with other types) handled by virt_exception_kernel(). Signed-off-by: Andi Kleen Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dan Williams Reviewed-by: Thomas Gleixner Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-19-kirill.shutemov@linux.intel.com commit 03149948832a078f759022ed5b92e722d8d23c26 Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:26 2022 +0300 x86/tdx: Port I/O: Add runtime hypercalls TDX hypervisors cannot emulate instructions directly. This includes port I/O which is normally emulated in the hypervisor. All port I/O instructions inside TDX trigger the #VE exception in the guest and would be normally emulated there. Use a hypercall to emulate port I/O. Extend the tdx_handle_virt_exception() and add support to handle the #VE due to port I/O instructions. String I/O operations are not supported in TDX. Unroll them by declaring CC_ATTR_GUEST_UNROLL_STRING_IO confidential computing attribute. == Userspace Implications == The ioperm() facility allows userspace access to I/O instructions like inb/outb. Among other things, this allows writing userspace device drivers. This series has no special handling for ioperm(). Users will be able to successfully request I/O permissions but will induce a #VE on their first I/O instruction which leads SIGSEGV. If this is undesirable users can enable kernel lockdown feature with 'lockdown=integrity' kernel command line option. It makes ioperm() fail. More robust handling of this situation (denying ioperm() in all TDX guests) will be addressed in follow-on work. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Dan Williams Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-18-kirill.shutemov@linux.intel.com commit 4c5b9aac6cade51aef64cc6ed67f2ad5acda9aed Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:25 2022 +0300 x86/boot: Port I/O: Add decompression-time support for TDX Port I/O instructions trigger #VE in the TDX environment. In response to the exception, kernel emulates these instructions using hypercalls. But during early boot, on the decompression stage, it is cumbersome to deal with #VE. It is cleaner to go to hypercalls directly, bypassing #VE handling. Hook up TDX-specific port I/O helpers if booting in TDX environment. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-17-kirill.shutemov@linux.intel.com commit eb4ea1ae8f45e3249e7586f30be8977478202a37 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:24 2022 +0300 x86/boot: Port I/O: Allow to hook up alternative helpers Port I/O instructions trigger #VE in the TDX environment. In response to the exception, kernel emulates these instructions using hypercalls. But during early boot, on the decompression stage, it is cumbersome to deal with #VE. It is cleaner to go to hypercalls directly, bypassing #VE handling. Add a way to hook up alternative port I/O helpers in the boot stub with a new pio_ops structure. For now, set the ops structure to just call the normal I/O operation functions. out*()/in*() macros redefined to use pio_ops callbacks. It eliminates need in changing call sites. io_delay() changed to use port I/O helper instead of inline assembly. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-16-kirill.shutemov@linux.intel.com commit 1e8f93e18379d05da9fd130eb7d50988a20f8b9a Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:23 2022 +0300 x86: Consolidate port I/O helpers There are two implementations of port I/O helpers: one in the kernel and one in the boot stub. Move the helpers required for both to and use the one implementation everywhere. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-15-kirill.shutemov@linux.intel.com commit 15104de122a4f0258981b06ed94cf616a6eb03ef Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:22 2022 +0300 x86: Adjust types used in port I/O helpers Change port I/O helpers to use u8/u16/u32 instead of unsigned char/short/int for values. Use u16 instead of int for port number. It aligns the helpers with implementation in boot stub in preparation for consolidation. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-14-kirill.shutemov@linux.intel.com commit 4b05f81504bfcaab51083d3a271fada75e6b8904 Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:21 2022 +0300 x86/tdx: Detect TDX at early kernel decompression time The early decompression code does port I/O for its console output. But, handling the decompression-time port I/O demands a different approach from normal runtime because the IDT required to support #VE based port I/O emulation is not yet set up. Paravirtualizing I/O calls during the decompression step is acceptable because the decompression code doesn't have a lot of call sites to IO instruction. To support port I/O in decompression code, TDX must be detected before the decompression code might do port I/O. Detect whether the kernel runs in a TDX guest. Add an early_is_tdx_guest() interface to query the cached TDX guest status in the decompression code. TDX is detected with CPUID. Make cpuid_count() accessible outside boot/cpuflags.c. TDX detection in the main kernel is very similar. Move common bits into . The actual port I/O paravirtualization will come later in the series. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-13-kirill.shutemov@linux.intel.com commit 31d58c4e557d46fa7f8557714250fb6f89c941ae Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:20 2022 +0300 x86/tdx: Handle in-kernel MMIO In non-TDX VMs, MMIO is implemented by providing the guest a mapping which will cause a VMEXIT on access and then the VMM emulating the instruction that caused the VMEXIT. That's not possible for TDX VM. To emulate an instruction an emulator needs two things: - R/W access to the register file to read/modify instruction arguments and see RIP of the faulted instruction. - Read access to memory where instruction is placed to see what to emulate. In this case it is guest kernel text. Both of them are not available to VMM in TDX environment: - Register file is never exposed to VMM. When a TD exits to the module, it saves registers into the state-save area allocated for that TD. The module then scrubs these registers before returning execution control to the VMM, to help prevent leakage of TD state. - TDX does not allow guests to execute from shared memory. All executed instructions are in TD-private memory. Being private to the TD, VMMs have no way to access TD-private memory and no way to read the instruction to decode and emulate it. In TDX the MMIO regions are instead configured by VMM to trigger a #VE exception in the guest. Add #VE handling that emulates the MMIO instruction inside the guest and converts it into a controlled hypercall to the host. This approach is bad for performance. But, it has (virtually) no impact on the size of the kernel image and will work for a wide variety of drivers. This allows TDX deployments to use arbitrary devices and device drivers, including virtio. TDX customers have asked for the capability to use random devices in their deployments. In other words, even if all of the work was done to paravirtualize all x86 MMIO users and virtio, this approach would still be needed. There is essentially no way to get rid of this code. This approach is functional for all in-kernel MMIO users current and future and does so with a minimal amount of code and kernel image bloat. MMIO addresses can be used with any CPU instruction that accesses memory. Address only MMIO accesses done via io.h helpers, such as 'readl()' or 'writeq()'. Any CPU instruction that accesses memory can also be used to access MMIO. However, by convention, MMIO access are typically performed via io.h helpers such as 'readl()' or 'writeq()'. The io.h helpers intentionally use a limited set of instructions when accessing MMIO. This known, limited set of instructions makes MMIO instruction decoding and emulation feasible in KVM hosts and SEV guests today. MMIO accesses performed without the io.h helpers are at the mercy of the compiler. Compilers can and will generate a much more broad set of instructions which can not practically be decoded and emulated. TDX guests will oops if they encounter one of these decoding failures. This means that TDX guests *must* use the io.h helpers to access MMIO. This requirement is not new. Both KVM hosts and AMD SEV guests have the same limitations on MMIO access. === Potential alternative approaches === == Paravirtualizing all MMIO == An alternative to letting MMIO induce a #VE exception is to avoid the #VE in the first place. Similar to the port I/O case, it is theoretically possible to paravirtualize MMIO accesses. Like the exception-based approach offered here, a fully paravirtualized approach would be limited to MMIO users that leverage common infrastructure like the io.h macros. However, any paravirtual approach would be patching approximately 120k call sites. Any paravirtual approach would need to replace a bare memory access instruction with (at least) a function call. With a conservative overhead estimation of 5 bytes per call site (CALL instruction), it leads to bloating code by 600k. Many drivers will never be used in the TDX environment and the bloat cannot be justified. == Patching TDX drivers == Rather than touching the entire kernel, it might also be possible to just go after drivers that use MMIO in TDX guests *and* are performance critical to justify the effrort. Right now, that's limited only to virtio. All virtio MMIO appears to be done through a single function, which makes virtio eminently easy to patch. This approach will be adopted in the future, removing the bulk of MMIO #VEs. The #VE-based MMIO will remain serving non-virtio use cases. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-12-kirill.shutemov@linux.intel.com commit c141fa2c2bbaff0d1f2dc51160626dd22bc16ae2 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:19 2022 +0300 x86/tdx: Handle CPUID via #VE In TDX guests, most CPUID leaf/sub-leaf combinations are virtualized by the TDX module while some trigger #VE. Implement the #VE handling for EXIT_REASON_CPUID by handing it through the hypercall, which in turn lets the TDX module handle it by invoking the host VMM. More details on CPUID Virtualization can be found in the TDX module specification, the section titled "CPUID Virtualization". Note that VMM that handles the hypercall is not trusted. It can return data that may steer the guest kernel in wrong direct. Only allow VMM to control range reserved for hypervisor communication. Return all-zeros for any CPUID outside the hypervisor range. It matches CPU behaviour for non-supported leaf. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-11-kirill.shutemov@linux.intel.com commit ae87f609cd52825fa7fa36f02b29e4357fd29eaa Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:18 2022 +0300 x86/tdx: Add MSR support for TDX guests Use hypercall to emulate MSR read/write for the TDX platform. There are two viable approaches for doing MSRs in a TD guest: 1. Execute the RDMSR/WRMSR instructions like most VMs and bare metal do. Some will succeed, others will cause a #VE. All of those that cause a #VE will be handled with a TDCALL. 2. Use paravirt infrastructure. The paravirt hook has to keep a list of which MSRs would cause a #VE and use a TDCALL. All other MSRs execute RDMSR/WRMSR instructions directly. The second option can be ruled out because the list of MSRs was challenging to maintain. That leaves option #1 as the only viable solution for the minimal TDX support. Kernel relies on the exception fixup machinery to handle MSR access errors. #VE handler uses the same exception fixup code as #GP. It covers MSR accesses along with other types of fixups. For performance-critical MSR writes (like TSC_DEADLINE), future patches will replace the WRMSR/#VE sequence with the direct TDCALL. RDMSR and WRMSR specification details can be found in Guest-Host-Communication Interface (GHCI) for Intel Trust Domain Extensions (Intel TDX) specification, sec titled "TDG.VP. VMCALL" and "TDG.VP.VMCALL". Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-10-kirill.shutemov@linux.intel.com commit bfe6ed0c672782ac2a8edffac93b1ba84b0ff984 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:17 2022 +0300 x86/tdx: Add HLT support for TDX guests The HLT instruction is a privileged instruction, executing it stops instruction execution and places the processor in a HALT state. It is used in kernel for cases like reboot, idle loop and exception fixup handlers. For the idle case, interrupts will be enabled (using STI) before the HLT instruction (this is also called safe_halt()). To support the HLT instruction in TDX guests, it needs to be emulated using TDVMCALL (hypercall to VMM). More details about it can be found in Intel Trust Domain Extensions (Intel TDX) Guest-Host-Communication Interface (GHCI) specification, section TDVMCALL[Instruction.HLT]. In TDX guests, executing HLT instruction will generate a #VE, which is used to emulate the HLT instruction. But #VE based emulation will not work for the safe_halt() flavor, because it requires STI instruction to be executed just before the TDCALL. Since idle loop is the only user of safe_halt() variant, handle it as a special case. To avoid *safe_halt() call in the idle function, define the tdx_guest_idle() and use it to override the "x86_idle" function pointer for a valid TDX guest. Alternative choices like PV ops have been considered for adding safe_halt() support. But it was rejected because HLT paravirt calls only exist under PARAVIRT_XXL, and enabling it in TDX guest just for safe_halt() use case is not worth the cost. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-9-kirill.shutemov@linux.intel.com commit 9a22bf6debbf5169f750af53c7f86eb4e3cd6712 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:16 2022 +0300 x86/traps: Add #VE support for TDX guest Virtualization Exceptions (#VE) are delivered to TDX guests due to specific guest actions which may happen in either user space or the kernel: * Specific instructions (WBINVD, for example) * Specific MSR accesses * Specific CPUID leaf accesses * Access to specific guest physical addresses Syscall entry code has a critical window where the kernel stack is not yet set up. Any exception in this window leads to hard to debug issues and can be exploited for privilege escalation. Exceptions in the NMI entry code also cause issues. Returning from the exception handler with IRET will re-enable NMIs and nested NMI will corrupt the NMI stack. For these reasons, the kernel avoids #VEs during the syscall gap and the NMI entry code. Entry code paths do not access TD-shared memory, MMIO regions, use #VE triggering MSRs, instructions, or CPUID leaves that might generate #VE. VMM can remove memory from TD at any point, but access to unaccepted (or missing) private memory leads to VM termination, not to #VE. Similarly to page faults and breakpoints, #VEs are allowed in NMI handlers once the kernel is ready to deal with nested NMIs. During #VE delivery, all interrupts, including NMIs, are blocked until TDGETVEINFO is called. It prevents #VE nesting until the kernel reads the VE info. TDGETVEINFO retrieves the #VE info from the TDX module, which also clears the "#VE valid" flag. This must be done before anything else as any #VE that occurs while the valid flag is set escalates to #DF by TDX module. It will result in an oops. Virtual NMIs are inhibited if the #VE valid flag is set. NMI will not be delivered until TDGETVEINFO is called. For now, convert unhandled #VE's (everything, until later in this series) so that they appear just like a #GP by calling the ve_raise_fault() directly. The ve_raise_fault() function is similar to #GP handler and is responsible for sending SIGSEGV to userspace and CPU die and notifying debuggers and other die chain users. Co-developed-by: Sean Christopherson Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Sean Christopherson Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-8-kirill.shutemov@linux.intel.com commit 775acc82a88fd36f5e89a08d39874fdeeaa04247 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:15 2022 +0300 x86/traps: Refactor exc_general_protection() TDX brings a new exception -- Virtualization Exception (#VE). Handling of #VE structurally very similar to handling #GP. Extract two helpers from exc_general_protection() that can be reused for handling #VE. No functional changes. Suggested-by: Thomas Gleixner Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Link: https://lkml.kernel.org/r/20220405232939.73860-7-kirill.shutemov@linux.intel.com commit 65fab5bc033aad1a9faf976caec46558c2f88319 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:14 2022 +0300 x86/tdx: Exclude shared bit from __PHYSICAL_MASK In TDX guests, by default memory is protected from host access. If a guest needs to communicate with the VMM (like the I/O use case), it uses a single bit in the physical address to communicate the protected/shared attribute of the given page. In the x86 ARCH code, __PHYSICAL_MASK macro represents the width of the physical address in the given architecture. It is used in creating physical PAGE_MASK for address bits in the kernel. Since in TDX guest, a single bit is used as metadata, it needs to be excluded from valid physical address bits to avoid using incorrect addresses bits in the kernel. Enable DYNAMIC_PHYSICAL_MASK to support updating the __PHYSICAL_MASK. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-6-kirill.shutemov@linux.intel.com commit 41394e33f3a0ce791caf0e086e1fca850832ddec Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:13 2022 +0300 x86/tdx: Extend the confidential computing API to support TDX guests Confidential Computing (CC) features (like string I/O unroll support, memory encryption/decryption support, etc) are conditionally enabled in the kernel using cc_platform_has() API. Since TDX guests also need to use these CC features, extend cc_platform_has() API and add TDX guest-specific CC attributes support. CC API also provides an interface to deal with encryption mask. Extend it to cover TDX. Details about which bit in the page table entry to be used to indicate shared/private state is determined by using the TDINFO TDCALL. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Reviewed-by: Borislav Petkov Link: https://lkml.kernel.org/r/20220405232939.73860-5-kirill.shutemov@linux.intel.com commit eb94f1b6a70a683040d60d21bbb6ad65f082600a Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:12 2022 +0300 x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions Guests communicate with VMMs with hypercalls. Historically, these are implemented using instructions that are known to cause VMEXITs like VMCALL, VMLAUNCH, etc. However, with TDX, VMEXITs no longer expose the guest state to the host. This prevents the old hypercall mechanisms from working. So, to communicate with VMM, TDX specification defines a new instruction called TDCALL. In a TDX based VM, since the VMM is an untrusted entity, an intermediary layer -- TDX module -- facilitates secure communication between the host and the guest. TDX module is loaded like a firmware into a special CPU mode called SEAM. TDX guests communicate with the TDX module using the TDCALL instruction. A guest uses TDCALL to communicate with both the TDX module and VMM. The value of the RAX register when executing the TDCALL instruction is used to determine the TDCALL type. A leaf of TDCALL used to communicate with the VMM is called TDVMCALL. Add generic interfaces to communicate with the TDX module and VMM (using the TDCALL instruction). __tdx_module_call() - Used to communicate with the TDX module (via TDCALL instruction). __tdx_hypercall() - Used by the guest to request services from the VMM (via TDVMCALL leaf of TDCALL). Also define an additional wrapper _tdx_hypercall(), which adds error handling support for the TDCALL failure. The __tdx_module_call() and __tdx_hypercall() helper functions are implemented in assembly in a .S file. The TDCALL ABI requires shuffling arguments in and out of registers, which proved to be awkward with inline assembly. Just like syscalls, not all TDVMCALL use cases need to use the same number of argument registers. The implementation here picks the current worst-case scenario for TDCALL (4 registers). For TDCALLs with fewer than 4 arguments, there will end up being a few superfluous (cheap) instructions. But, this approach maximizes code reuse. For registers used by the TDCALL instruction, please check TDX GHCI specification, the section titled "TDCALL instruction" and "TDG.VP.VMCALL Interface". Based on previous patch by Sean Christopherson. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Reviewed-by: Borislav Petkov Link: https://lkml.kernel.org/r/20220405232939.73860-4-kirill.shutemov@linux.intel.com commit 527a534c732604931959e73e9c3a8952d8c1a994 Author: Kirill A. Shutemov Date: Wed Apr 6 02:29:11 2022 +0300 x86/tdx: Provide common base for SEAMCALL and TDCALL C wrappers Secure Arbitration Mode (SEAM) is an extension of VMX architecture. It defines a new VMX root operation (SEAM VMX root) and a new VMX non-root operation (SEAM VMX non-root) which are both isolated from the legacy VMX operation where the host kernel runs. A CPU-attested software module (called 'TDX module') runs in SEAM VMX root to manage and protect VMs running in SEAM VMX non-root. SEAM VMX root is also used to host another CPU-attested software module (called 'P-SEAMLDR') to load and update the TDX module. Host kernel transits to either P-SEAMLDR or TDX module via the new SEAMCALL instruction, which is essentially a VMExit from VMX root mode to SEAM VMX root mode. SEAMCALLs are leaf functions defined by P-SEAMLDR and TDX module around the new SEAMCALL instruction. A guest kernel can also communicate with TDX module via TDCALL instruction. TDCALLs and SEAMCALLs use an ABI different from the x86-64 system-v ABI. RAX is used to carry both the SEAMCALL leaf function number (input) and the completion status (output). Additional GPRs (RCX, RDX, R8-R11) may be further used as both input and output operands in individual leaf. TDCALL and SEAMCALL share the same ABI and require the largely same code to pass down arguments and retrieve results. Define an assembly macro that can be used to implement C wrapper for both TDCALL and SEAMCALL. Suggested-by: Thomas Gleixner Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dave Hansen Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-3-kirill.shutemov@linux.intel.com commit 59bd54a84d15e9335de5b8abe7b3b9713a36b99b Author: Kuppuswamy Sathyanarayanan Date: Wed Apr 6 02:29:10 2022 +0300 x86/tdx: Detect running as a TDX guest in early boot In preparation of extending cc_platform_has() API to support TDX guest, use CPUID instruction to detect support for TDX guests in the early boot code (via tdx_early_init()). Since copy_bootdata() is the first user of cc_platform_has() API, detect the TDX guest status before it. Define a synthetic feature flag (X86_FEATURE_TDX_GUEST) and set this bit in a valid TDX guest platform. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Dave Hansen Reviewed-by: Borislav Petkov Reviewed-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20220405232939.73860-2-kirill.shutemov@linux.intel.com commit 327c348988c6f0bacd7abd29c151f37bdf1e2a02 Author: Mike Travis Date: Wed Apr 6 14:51:49 2022 -0500 x86/platform/uv: Log gap hole end size Show value of gap end in the kernel log which equates to number of physical address bits used by system. Signed-off-by: Mike Travis Signed-off-by: Steve Wahl Signed-off-by: Borislav Petkov Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220406195149.228164-4-steve.wahl@hpe.com commit bb3ab81bdbd53f88f26ffabc9fb15bd8466486ec Author: Mike Travis Date: Wed Apr 6 14:51:48 2022 -0500 x86/platform/uv: Update TSC sync state for UV5 The UV5 platform synchronizes the TSCs among all chassis, and will not proceed to OS boot without achieving synchronization. Previous UV platforms provided a register indicating successful synchronization. This is no longer available on UV5. On this platform TSC_ADJUST should not be reset by the kernel. Signed-off-by: Mike Travis Signed-off-by: Steve Wahl Signed-off-by: Borislav Petkov Reviewed-by: Dimitri Sivanich Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220406195149.228164-3-steve.wahl@hpe.com commit d812f7c475c6a4dcfff02a85fbfd7a9c87e6a094 Author: Mike Travis Date: Wed Apr 6 14:51:47 2022 -0500 x86/platform/uv: Update NMI Handler for UV5 Update NMI handler for UV5 hardware. A platform register changed, and UV5 only uses one of the two NMI methods used on previous hardware. Signed-off-by: Mike Travis Signed-off-by: Steve Wahl Signed-off-by: Borislav Petkov Reviewed-by: Dimitri Sivanich Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220406195149.228164-2-steve.wahl@hpe.com commit e33163a40d1a1f7fead2ce26f9b75da6b581a49e Author: Alexander Lobakin Date: Mon Mar 21 11:59:54 2022 +0100 ice: switch: convert packet template match code to rodata Trade text size for rodata size and replace tons of nested if-elses to the const mask match based structs. The almost entire ice_find_dummy_packet() now becomes just one plain while-increment loop. The order in ice_dummy_pkt_profiles[] should be same with the if-elses order previously, as masks become less and less strict through the array to follow the original code flow. Apart from removing 80 locs of 4-level if-elses, it brings a solid text size optimization: add/remove: 0/1 grow/shrink: 1/1 up/down: 2/-1058 (-1056) Function old new delta ice_fill_adv_dummy_packet 289 291 +2 ice_adv_add_update_vsi_list 201 - -201 ice_add_adv_rule 2950 2093 -857 Total: Before=414512, After=413456, chg -0.25% add/remove: 53/52 grow/shrink: 0/0 up/down: 4660/-3988 (672) RO Data old new delta ice_dummy_pkt_profiles - 672 +672 Total: Before=37895, After=38567, chg +1.77% Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 07a28842bb4f65e66aa297a031a57dec4828d6a0 Author: Alexander Lobakin Date: Mon Mar 21 11:59:53 2022 +0100 ice: switch: use convenience macros to declare dummy pkt templates Declarations of dummy/template packet headers and offsets can be minified to improve readability and simplify adding new templates. Move all the repetitive constructions into two macros and let them do the name and type expansions. Linewrap removal is yet another positive side effect. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 1b699f81dba78c724f6f94b02f01e216b64bf88b Author: Alexander Lobakin Date: Mon Mar 21 11:59:52 2022 +0100 ice: switch: use a struct to pass packet template params ice_find_dummy_packet() contains a lot of boilerplate code and a nice room for copy-paste mistakes. Instead of passing 3 separate pointers back and forth to get packet template (dummy) params, directly return a structure containing them. Then, use a macro to compose compound literals and avoid code duplication on return path. Now, dummy packet type/name is needed only once to return a full correct triple pkt-pkt_len-offsets, and those are all one-liners. dummy_ipv4_gtpu_ipv4_packet_offsets is just moved around and renamed (as well as dummy_ipv6_gtp_packet_offsets) with no function changes. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 27ffa273a0405b546b4562b1c65e616d41a1f30e Author: Alexander Lobakin Date: Mon Mar 21 11:59:51 2022 +0100 ice: switch: unobscurify bitops loop in ice_fill_adv_dummy_packet() A loop performing header modification according to the provided mask in ice_fill_adv_dummy_packet() is very cryptic (and error-prone). Replace two identical cast-deferences with a variable. Replace three struct-member-array-accesses with a variable. Invert the condition, reduce the indentation by one -> eliminate line wraps. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 135a161a5ea9e4f01b37defa53e7f5db43a7ca99 Author: Alexander Lobakin Date: Mon Mar 21 11:59:50 2022 +0100 ice: switch: add and use u16[] aliases to ice_adv_lkup_elem::{h, m}_u ice_adv_lkup_elem fields h_u and m_u are being accessed as raw u16 arrays in several places. To reduce cast and braces burden, add permanent array-of-u16 aliases with the same size as the `union ice_prot_hdr` itself via anonymous unions to the actual struct declaration, and just access them directly. This: - removes the need to cast the union to u16[] and then dereference it each time -> reduces the horizon for potential bugs; - improves -Warray-bounds coverage -- the array size is now known at compilation time; - addresses cppcheck complaints. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit e425ac99b1573692fc4bb5bda1040caccb127490 Author: Alexander Aring Date: Thu Apr 7 10:45:42 2022 -0400 fs: dlm: cast resource pointer to uintptr_t This patch fixes the following warning when doing a 32 bit kernel build when pointers are 4 byte long: In file included from ./include/linux/byteorder/little_endian.h:5, from ./arch/x86/include/uapi/asm/byteorder.h:5, from ./include/asm-generic/qrwlock_types.h:6, from ./arch/x86/include/asm/spinlock_types.h:7, from ./include/linux/spinlock_types_raw.h:7, from ./include/linux/ratelimit_types.h:7, from ./include/linux/printk.h:10, from ./include/asm-generic/bug.h:22, from ./arch/x86/include/asm/bug.h:87, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./include/linux/gfp.h:5, from ./include/linux/slab.h:15, from fs/dlm/dlm_internal.h:19, from fs/dlm/rcom.c:12: fs/dlm/rcom.c: In function ‘dlm_send_rcom_lock’: ./include/uapi/linux/byteorder/little_endian.h:32:43: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] #define __cpu_to_le64(x) ((__force __le64)(__u64)(x)) ^ ./include/linux/byteorder/generic.h:86:21: note: in expansion of macro ‘__cpu_to_le64’ #define cpu_to_le64 __cpu_to_le64 ^~~~~~~~~~~~~ fs/dlm/rcom.c:457:14: note: in expansion of macro ‘cpu_to_le64’ rc->rc_id = cpu_to_le64(r); The rc_id value in dlm rcom is handled as u64. The rcom implementation uses for an unique number generation the pointer value of the used dlm_rsb instance. However if the pointer value is 4 bytes long -Wpointer-to-int-cast will print a warning. We get rid of that warning to cast the pointer to uintptr_t which is either 4 or 8 bytes. There might be a very unlikely case where this number isn't unique anymore if using dlm in a mixed cluster of nodes and sizeof(uintptr_t) returns 4 and 8. However this problem was already been there and this patch should get rid of the warning. Fixes: 2f9dbeda8dc0 ("dlm: use __le types for rcom messages") Reported-by: kernel test robot Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit efc3acbc105af79bce2ccf97a6159255b7cf6b38 Author: Daniel Vetter Date: Tue Apr 5 23:03:35 2022 +0200 fbcon: Maintain a private array of fb_info Accessing the one in fbmem.c without taking the right locks is a bad idea. Instead maintain our own private copy, which is fully protected by console_lock() (like everything else in fbcon.c). That copy is serialized through fbcon_fb_registered/unregistered() calls. Also this means we do not need to hold a full fb_info reference, which is nice because doing so would mean a refcount loop between the console and the fb_info. But it's also not nice since it means console_lock() must be held absolutely everywhere. Well strictly speaking we could still try to do some refcounting games again by calling get_fb_info before we drop the console_lock. But things will get tricky. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Du Cheng Cc: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-18-daniel.vetter@ffwll.ch commit c75300b5c64b013a6a04c8385094eeff849595ba Author: Daniel Vetter Date: Tue Apr 5 23:03:34 2022 +0200 fbcon: untangle fbcon_exit There's a bunch of confusions going on here: - The deferred fbcon setup notifier should only be cleaned up from fb_console_exit(), to be symmetric with fb_console_init() - We also need to make sure we don't race with the work, which means temporarily dropping the console lock (or we can deadlock) - That also means no point in clearing deferred_takeover, we are unloading everything anyway. - Finally rename fbcon_exit to fbcon_release_all and move it, since that's what's it doing when being called from consw->con_deinit through fbcon_deinit. To answer a question from Sam just quoting my own reply: > We loose the call to fbcon_release_all() here [in fb_console_exit()]. > We have part of the old fbcon_exit() above, but miss the release parts. Ah yes that's the entire point of this change. The release_all in the fbcon exit path was only needed when fbcon was a separate module indepedent from core fb.ko. Which means it was possible to unload fbcon while having fbdev drivers registered. But since we've merged them that has become impossible, so by the time the fb.ko module can be unloaded, there's guaranteed to be no fbdev drivers left. And hence removing them is pointless. v2: Explain the why better (Sam) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Claudio Suarez Cc: Du Cheng Cc: Tetsuo Handa Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-17-daniel.vetter@ffwll.ch commit 3647d6d3dbdafc55f8c4ca8225966963252abe7b Author: Daniel Vetter Date: Tue Apr 5 23:03:33 2022 +0200 fbcon: Move more code into fbcon_release con2fb_release_oldinfo() has a bunch more kfree() calls than fbcon_exit(), but since kfree() on NULL is harmless doing that in both places should be ok. This is also a bit more symmetric now again with fbcon_open also allocating the fbcon_ops structure. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Greg Kroah-Hartman Cc: Du Cheng Cc: Claudio Suarez Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-16-daniel.vetter@ffwll.ch commit 6e7da3af008b72520f5318507f455f344b27f022 Author: Daniel Vetter Date: Tue Apr 5 23:03:32 2022 +0200 fbcon: Move console_lock for register/unlink/unregister Ideally console_lock becomes an implementation detail of fbcon.c and doesn't show up anywhere in fbmem.c. We're still pretty far from that, but at least the register/unregister code is there now. With this the do_fb_ioctl() handler is the only code in fbmem.c still calling console_lock(). Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Du Cheng Cc: Claudio Suarez Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Matthew Wilcox Cc: Sam Ravnborg Cc: Zheyu Ma Cc: Guenter Roeck Cc: Alex Deucher Cc: Zhen Lei Cc: Xiyu Yang Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-15-daniel.vetter@ffwll.ch commit 43553559121ca90965b572cf8a1d6d0fd618b449 Author: Daniel Vetter Date: Tue Apr 5 23:03:31 2022 +0200 fbcon: Consistently protect deferred_takeover with console_lock() This shouldn't be a problem in practice since until we've actually taken over the console there's nothing we've registered with the console/vt subsystem, so the exit/unbind path that check this can't do the wrong thing. But it's confusing, so fix it by moving it a tad later. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Du Cheng Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-14-daniel.vetter@ffwll.ch commit 04933a294dacca3aaa480889d53e6195778d4578 Author: Daniel Vetter Date: Tue Apr 5 23:03:30 2022 +0200 fbcon: use lock_fb_info in fbcon_open/release Now we get to the real motiviation, because fbmem.c insists that that's the right lock for these. Ofc fbcon.c has a lot more places where it probably should call lock_fb_info(). But looking at fbmem.c at least most of these seem to be protected by console_lock() too, which is probably what papers over any issues. Note that this means we're shuffling around a bit the locking sections for some of the console takeover and unbind paths, but not all: - console binding/unbinding from the console layer never with lock_fb_info - unbind (as opposed to unlink) never bother with lock_fb_info Also the real serialization against set_par and set_pan are still doing by wrapping the entire ioctl code in console_lock(). So this shuffling shouldn't be worse than what we had from a "can you trigger races?" pov, but it's at least clearer. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Claudio Suarez Cc: Tetsuo Handa Cc: Thomas Zimmermann Cc: Greg Kroah-Hartman Cc: Du Cheng Cc: Sam Ravnborg Cc: Matthew Wilcox Cc: William Kucharski Cc: Alex Deucher Cc: Zheyu Ma Cc: Zhen Lei Cc: Xiyu Yang Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-13-daniel.vetter@ffwll.ch commit d443d93864726ad68c0a741d1e7b03934a9af143 Author: Daniel Vetter Date: Tue Apr 5 23:03:29 2022 +0200 fbcon: move more common code into fb_open() No idea why con2fb_acquire_newinfo() initializes much less than fbcon_startup(), but so be it. From a quick look most of the un-initialized stuff should be fairly harmless, but who knows. Note that the error handling for the con2fb_acquire_newinfo() failure case was very strange: Callers updated con2fb_map to the new value before calling this function, but upon error con2fb_acquire_newinfo reset it to the old value. Since I removed the call to fbcon_release anyway that strange error path was sticking out like a sore thumb, hence I removed it. Which also allows us to remove the oldidx parameter from that function. v2: Explain what's going on with oldidx and error paths (Sam) v3: Drop unused variable (0day) v4: Rebased over bisect fix in previous patch, unchagend end result. Acked-by: Sam Ravnborg (v2) Acked-by: Thomas Zimmermann Cc: kernel test robot Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Thomas Zimmermann Cc: Claudio Suarez Cc: Du Cheng Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-12-daniel.vetter@ffwll.ch commit b07db39584856e16814e2f065380e533a001535d Author: Daniel Vetter Date: Tue Apr 5 23:03:28 2022 +0200 fbcon: Ditch error handling for con2fb_release_oldinfo It doesn't ever fail anymore. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Greg Kroah-Hartman Cc: Claudio Suarez Cc: Du Cheng Cc: Tetsuo Handa Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-11-daniel.vetter@ffwll.ch commit bd6026a8c4e6b7edf4bafcb71da885b284b8f4fd Author: Daniel Vetter Date: Tue Apr 5 23:03:27 2022 +0200 fbcon: Extract fbcon_open/release helpers There's two minor behaviour changes in here: - in error paths we now consistently call fb_ops->fb_release - fb_release really can't fail (fbmem.c ignores it too) and there's no reasonable cleanup we can do anyway. Note that everything in fbcon.c is protected by the big console_lock() lock (especially all the global variables), so the minor changes in ordering of setup/cleanup do not matter. v2: Explain a bit better why this is all correct (Sam) Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Claudio Suarez Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Du Cheng Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-10-daniel.vetter@ffwll.ch commit 6b2060cf9138a2cd5f3468a949d3869abed049ef Author: Daniel Vetter Date: Tue Apr 5 23:03:26 2022 +0200 fb: Delete fb_info->queue It was only used by fbcon, and that now switched to its own, private work. Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: linux-fbdev@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-9-daniel.vetter@ffwll.ch commit cae69e453d735c546fc407d049ba048e80adf05e Author: Daniel Vetter Date: Tue Apr 5 23:03:25 2022 +0200 fbcon: Replace FBCON_FLAGS_INIT with a boolean It's only one flag and slightly tidier code. Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Tetsuo Handa Cc: Greg Kroah-Hartman Cc: Du Cheng Cc: Thomas Zimmermann Cc: Claudio Suarez Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-8-daniel.vetter@ffwll.ch commit 3b0fb6ab25dda03f6077bf8fce9407bb0d4db6ea Author: Daniel Vetter Date: Tue Apr 5 23:03:24 2022 +0200 fbcon: Use delayed work for cursor Allows us to delete a bunch of hand-rolled stuff using a timer plus a separate work). Also to simplify the code we initialize the cursor_work completely when we allocate the fbcon_ops structure, instead of trying to cope with console re-initialization. The motiviation here is that fbcon code stops using the fb_info.queue, which helps with locking issues around cleanup and all that in a later patch. Also note that this allows us to ditch the hand-rolled work cleanup in fbcon_exit - we already call fbcon_del_cursor_timer, which takes care of everything. Plus this was racy anyway. v2: - Only INIT_DELAYED_WORK when kzalloc succeeded (Tetsuo) - Explain that we replace both the timer and a work with the combined delayed_work (Javier) Reviewed-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Claudio Suarez Cc: Du Cheng Cc: Thomas Zimmermann Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-7-daniel.vetter@ffwll.ch commit 9ad5cc9bcfd62b0f39e7f85992d2a371ff369324 Author: Daniel Vetter Date: Tue Apr 5 23:03:23 2022 +0200 fbdev/sysfs: Fix locking fb_set_var requires we hold the fb_info lock. Or at least this now matches what the ioctl does ... Note that ps3fb and sh_mobile_lcdcfb are busted in different ways here, but I will not fix them up. Also in practice this isn't a big deal, because really variable fbdev state is actually protected by console_lock (because fbcon just doesn't bother with lock_fb_info() at all), and lock_fb_info protecting anything is really just a neat lie. But that's a much bigger fish to fry. Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Qing Wang Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-6-daniel.vetter@ffwll.ch commit 9b0a490e71ebf76b0b59ab9382f5289f8a3dcf9e Author: Daniel Vetter Date: Tue Apr 5 23:03:22 2022 +0200 fbcon: delete delayed loading code Before commit 6104c37094e729f3d4ce65797002112735d49cd1 Author: Daniel Vetter Date: Tue Aug 1 17:32:07 2017 +0200 fbcon: Make fbcon a built-time depency for fbdev it was possible to load fbcon and fbdev drivers in any order, which means that fbcon init had to handle the case where fbdev drivers where already registered. This is no longer possible, hence delete that code. Note that the exit case is a bit more complex and will be done in a separate patch. Since I had to audit the entire fbcon load code I also spotted a wrong function name in a comment in fbcon_startup(), which this patch also fixes. v2: Explain why we also fix the comment (Sam) Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Claudio Suarez Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Du Cheng Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-5-daniel.vetter@ffwll.ch commit 409d6c95f9c68bb7046410a3502e26e454a1e636 Author: Daniel Vetter Date: Tue Apr 5 23:03:21 2022 +0200 fbcon: Introduce wrapper for console->fb_info lookup Half of it is protected by console_lock, but the other half is a lot more awkward: Registration/deregistration of fbdev are serialized, but we don't really clear out anything in con2fb_map and so there's potential for use-after free mixups. First step is to encapsulate the lookup. Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Greg Kroah-Hartman Cc: Tetsuo Handa Cc: Du Cheng Cc: Claudio Suarez Cc: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-4-daniel.vetter@ffwll.ch commit 689333136327b6cd618df85d83d79f2aa620d585 Author: Daniel Vetter Date: Tue Apr 5 23:03:20 2022 +0200 fbcon: Move fbcon_bmove(_rec) functions Avoids two forward declarations, and more importantly, matches what I've done in my fbcon scrolling restore patches - so I need this to avoid a bunch of conflicts in rebasing since we ended up merging Helge's series instead. Acked-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Du Cheng Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-3-daniel.vetter@ffwll.ch commit 9ad7acdad1d91545b99bf9fda3de4b86cf48b272 Author: Daniel Vetter Date: Tue Apr 5 23:03:19 2022 +0200 fbcon: delete a few unneeded forward decl I didn't bother with any code movement to fix the others, these just got a bit in the way. v2: Rebase on top of Helge's reverts. Acked-by: Thomas Zimmermann Acked-by: Sam Ravnborg (v1) Reviewed-by: Geert Uytterhoeven (v1) Signed-off-by: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Thomas Zimmermann Cc: Du Cheng Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-2-daniel.vetter@ffwll.ch commit 92a99584d965b930988b28f36d925bd9675828b3 Author: Michael Roth Date: Thu Feb 24 10:56:25 2022 -0600 virt: sevguest: Add documentation for SEV-SNP CPUID Enforcement Update the documentation with information regarding SEV-SNP CPUID Enforcement details and what sort of assurances it provides to guests. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-47-brijesh.singh@amd.com commit d80b494f712317493d464a55652698c4d1b7bb0f Author: Brijesh Singh Date: Mon Mar 7 15:33:55 2022 -0600 virt: sevguest: Add support to get extended report Version 2 of GHCB specification defines Non-Automatic-Exit (NAE) to get extended guest report which is similar to the SNP_GET_REPORT ioctl. The main difference is related to the additional data that will be returned. That additional data returned is a certificate blob that can be used by the SNP guest user. The certificate blob layout is defined in the GHCB specification. The driver simply treats the blob as a opaque data and copies it to userspace. [ bp: Massage commit message, cast 1st arg of access_ok() ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-46-brijesh.singh@amd.com commit 68de0b2f938642079c0c853b219bdb88c4dc4d13 Author: Brijesh Singh Date: Thu Feb 24 10:56:23 2022 -0600 virt: sevguest: Add support to derive key The SNP_GET_DERIVED_KEY ioctl interface can be used by the SNP guest to ask the firmware to provide a key derived from a root key. The derived key may be used by the guest for any purposes it chooses, such as a sealing key or communicating with the external entities. See SEV-SNP firmware spec for more information. [ bp: No need to memset "req" - it will get overwritten. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Liam Merwick Link: https://lore.kernel.org/r/20220307213356.2797205-45-brijesh.singh@amd.com commit fce96cf0443083e37455eff8f78fd240c621dae3 Author: Brijesh Singh Date: Mon Mar 7 15:33:53 2022 -0600 virt: Add SEV-SNP guest driver The SEV-SNP specification provides the guest a mechanism to communicate with the PSP without risk from a malicious hypervisor who wishes to read, alter, drop or replay the messages sent. The driver uses snp_issue_guest_request() to issue GHCB SNP_GUEST_REQUEST or SNP_EXT_GUEST_REQUEST NAE events to submit the request to PSP. The PSP requires that all communication should be encrypted using key specified through a struct snp_guest_platform_data descriptor. Userspace can use SNP_GET_REPORT ioctl() to query the guest attestation report. See SEV-SNP spec section Guest Messages for more details. [ bp: Remove the "what" from the commit message, massage. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-44-brijesh.singh@amd.com commit 3a45b3753849c4a12cca2dd176c0192cd2a63e62 Author: Brijesh Singh Date: Thu Feb 24 10:56:21 2022 -0600 x86/sev: Register SEV-SNP guest request platform device Version 2 of the GHCB specification provides a Non Automatic Exit (NAE) event type that can be used by the SEV-SNP guest to communicate with the PSP without risk from a malicious hypervisor who wishes to read, alter, drop or replay the messages sent. SNP_LAUNCH_UPDATE can insert two special pages into the guest’s memory: the secrets page and the CPUID page. The PSP firmware populates the contents of the secrets page. The secrets page contains encryption keys used by the guest to interact with the firmware. Because the secrets page is encrypted with the guest’s memory encryption key, the hypervisor cannot read the keys. See SEV-SNP firmware spec for further details on the secrets page format. Create a platform device that the SEV-SNP guest driver can bind to get the platform resources such as encryption key and message id to use to communicate with the PSP. The SEV-SNP guest driver provides a userspace interface to get the attestation report, key derivation, extended attestation report etc. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-43-brijesh.singh@amd.com commit d5af44dde5461d125d1602ac913ab5c6bdf09b8b Author: Brijesh Singh Date: Mon Mar 7 15:33:51 2022 -0600 x86/sev: Provide support for SNP guest request NAEs Version 2 of GHCB specification provides SNP_GUEST_REQUEST and SNP_EXT_GUEST_REQUEST NAE that can be used by the SNP guest to communicate with the PSP. While at it, add a snp_issue_guest_request() helper that will be used by driver or other subsystem to issue the request to PSP. See SEV-SNP firmware and GHCB spec for more details. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-42-brijesh.singh@amd.com commit ba37a1438aeb540cc48722d629f4b2e7e4398466 Author: Michael Roth Date: Mon Mar 7 15:33:50 2022 -0600 x86/sev: Add a sev= cmdline option For debugging purposes it is very useful to have a way to see the full contents of the SNP CPUID table provided to a guest. Add an sev=debug kernel command-line option to do so. Also introduce some infrastructure so that additional options can be specified via sev=option1[,option2] over time in a consistent manner. [ bp: Massage, simplify string parsing. ] Suggested-by: Borislav Petkov Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-41-brijesh.singh@amd.com commit 30612045e69d088f1effd748048ebb0e282984ec Author: Michael Roth Date: Mon Mar 7 15:33:49 2022 -0600 x86/sev: Use firmware-validated CPUID for SEV-SNP guests SEV-SNP guests will be provided the location of special 'secrets' and 'CPUID' pages via the Confidential Computing blob. This blob is provided to the run-time kernel either through a boot_params field that was initialized by the boot/compressed kernel, or via a setup_data structure as defined by the Linux Boot Protocol. Locate the Confidential Computing blob from these sources and, if found, use the provided CPUID page/table address to create a copy that the run-time kernel will use when servicing CPUID instructions via a #VC handler. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-40-brijesh.singh@amd.com commit b190a043c49af4587f5e157053f909192820522a Author: Michael Roth Date: Thu Feb 24 10:56:18 2022 -0600 x86/sev: Add SEV-SNP feature detection/setup Initial/preliminary detection of SEV-SNP is done via the Confidential Computing blob. Check for it prior to the normal SEV/SME feature initialization, and add some sanity checks to confirm it agrees with SEV-SNP CPUID/MSR bits. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-39-brijesh.singh@amd.com commit 76f61e1e89b32f3e5d639f1b57413a919066da06 Author: Michael Roth Date: Thu Feb 24 10:56:17 2022 -0600 x86/compressed/64: Add identity mapping for Confidential Computing blob The run-time kernel will need to access the Confidential Computing blob very early during boot to access the CPUID table it points to. At that stage, it will be relying on the identity-mapped page table set up by the boot/compressed kernel, so make sure the blob and the CPUID table it points to are mapped in advance. [ bp: Massage. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-38-brijesh.singh@amd.com commit a9ee679b1f8c3803490ed2eeffb688aaee56583f Author: Michael Roth Date: Thu Feb 24 10:56:16 2022 -0600 x86/compressed: Export and rename add_identity_map() SEV-specific code will need to add some additional mappings, but doing this within ident_map_64.c requires some SEV-specific helpers to be exported and some SEV-specific struct definitions to be pulled into ident_map_64.c. Instead, export add_identity_map() so SEV-specific (and other subsystem-specific) code can be better contained outside of ident_map_64.c. While at it, rename the function to kernel_add_identity_map(), similar to the kernel_ident_mapping_init() function it relies upon. No functional changes. Suggested-by: Borislav Petkov Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-37-brijesh.singh@amd.com commit 5f211f4fc49622473667e6983bb57beab755f6f6 Author: Michael Roth Date: Thu Feb 24 10:56:15 2022 -0600 x86/compressed: Use firmware-validated CPUID leaves for SEV-SNP guests SEV-SNP guests will be provided the location of special 'secrets' 'CPUID' pages via the Confidential Computing blob. This blob is provided to the boot kernel either through an EFI config table entry, or via a setup_data structure as defined by the Linux Boot Protocol. Locate the Confidential Computing from these sources and, if found, use the provided CPUID page/table address to create a copy that the boot kernel will use when servicing CPUID instructions via a #VC CPUID handler. [ bp: s/cpuid/CPUID/ ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-36-brijesh.singh@amd.com commit c01fce9cef8491974f7f007f90281f1608400768 Author: Michael Roth Date: Thu Feb 24 10:56:14 2022 -0600 x86/compressed: Add SEV-SNP feature detection/setup Initial/preliminary detection of SEV-SNP is done via the Confidential Computing blob. Check for it prior to the normal SEV/SME feature initialization, and add some sanity checks to confirm it agrees with SEV-SNP CPUID/MSR bits. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-35-brijesh.singh@amd.com commit 8c9c509baf660f1062bc758c26008b7f9bbc39f3 Author: Michael Roth Date: Thu Feb 24 10:56:13 2022 -0600 x86/boot: Add a pointer to Confidential Computing blob in bootparams The previously defined Confidential Computing blob is provided to the kernel via a setup_data structure or EFI config table entry. Currently, these are both checked for by boot/compressed kernel to access the CPUID table address within it for use with SEV-SNP CPUID enforcement. To also enable that enforcement for the run-time kernel, similar access to the CPUID table is needed early on while it's still using the identity-mapped page table set up by boot/compressed, where global pointers need to be accessed via fixup_pointer(). This isn't much of an issue for accessing setup_data, and the EFI config table helper code currently used in boot/compressed *could* be used in this case as well since they both rely on identity-mapping. However, it has some reliance on EFI helpers/string constants that would need to be accessed via fixup_pointer(), and fixing it up while making it shareable between boot/compressed and run-time kernel is fragile and introduces a good bit of ugliness. Instead, add a boot_params->cc_blob_address pointer that the boot/compressed kernel can initialize so that the run-time kernel can access the CC blob from there instead of re-scanning the EFI config table. Also document these in Documentation/x86/zero-page.rst. While there, add missing documentation for the acpi_rsdp_addr field, which serves a similar purpose in providing the run-time kernel a pointer to the ACPI RSDP table so that it does not need to [re-]scan the EFI configuration table. [ bp: Fix typos, massage commit message. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-34-brijesh.singh@amd.com commit ee0bfa08a345370df28c07288e886abcbaac481f Author: Michael Roth Date: Thu Feb 24 10:56:12 2022 -0600 x86/compressed/64: Add support for SEV-SNP CPUID table in #VC handlers CPUID instructions generate a #VC exception for SEV-ES/SEV-SNP guests, for which early handlers are currently set up to handle. In the case of SEV-SNP, guests can use a configurable location in guest memory that has been pre-populated with a firmware-validated CPUID table to look up the relevant CPUID values rather than requesting them from hypervisor via a VMGEXIT. Add the various hooks in the #VC handlers to allow CPUID instructions to be handled via the table. The code to actually configure/enable the table will be added in a subsequent commit. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-33-brijesh.singh@amd.com commit 801baa693c1f6d7327475c39100c456db340cd3e Author: Michael Roth Date: Thu Feb 24 10:56:11 2022 -0600 x86/sev: Move MSR-based VMGEXITs for CPUID to helper This code will also be used later for SEV-SNP-validated CPUID code in some cases, so move it to a common helper. While here, also add a check to terminate in cases where the CPUID function/subfunction is indexed and the subfunction is non-zero, since the GHCB MSR protocol does not support non-zero subfunctions. Suggested-by: Sean Christopherson Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-32-brijesh.singh@amd.com commit b66370db9a90b3fa4c4a1a732af3e7e38d6d4c7c Author: Michael Roth Date: Thu Feb 24 10:56:10 2022 -0600 KVM: x86: Move lookup of indexed CPUID leafs to helper Determining which CPUID leafs have significant ECX/index values is also needed by guest kernel code when doing SEV-SNP-validated CPUID lookups. Move this to common code to keep future updates in sync. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-31-brijesh.singh@amd.com commit 5ea98e01ab524cbc53dad8aebd27b434ebe5d074 Author: Brijesh Singh Date: Mon Mar 7 15:33:39 2022 -0600 x86/boot: Add Confidential Computing type to setup_data While launching encrypted guests, the hypervisor may need to provide some additional information during the guest boot. When booting under an EFI-based BIOS, the EFI configuration table contains an entry for the confidential computing blob that contains the required information. To support booting encrypted guests on non-EFI VMs, the hypervisor needs to pass this additional information to the guest kernel using a different method. For this purpose, introduce SETUP_CC_BLOB type in setup_data to hold the physical address of the confidential computing blob location. The boot loader or hypervisor may choose to use this method instead of an EFI configuration table. The CC blob location scanning should give preference to a setup_data blob over an EFI configuration table. In AMD SEV-SNP, the CC blob contains the address of the secrets and CPUID pages. The secrets page includes information such as a VM to PSP communication key and the CPUID page contains PSP-filtered CPUID values. Define the AMD SEV confidential computing blob structure. While at it, define the EFI GUID for the confidential computing blob. [ bp: Massage commit message, mark struct __packed. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220307213356.2797205-30-brijesh.singh@amd.com commit be273ecfbe8a32fd8f875cc2990223cfc8a32031 Author: Javier Martinez Canillas Date: Thu Apr 7 15:19:50 2022 +0200 drm/vc4: Use newer fence API properly to fix build errors The commit 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7") ported all the DRM drivers to use the newer fence API that specifies the usage with the enum dma_resv_usage rather than doing an explicit shared / exclusive distinction. But the commit didn't do it properly in two callers of the vc4 driver, leading to build errors. Fixes: 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7") Signed-off-by: Javier Martinez Canillas Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220407131950.915091-1-javierm@redhat.com commit 7cee157b4225089cb831f77515f9c4f4f7c24182 Author: Chen-Yu Tsai Date: Thu Apr 7 01:29:56 2022 +0800 drm/ssd130x: Add support for SINO WEALTH SH1106 The SINO WEALTH SH1106 is an OLED display driver that is somewhat compatible with the SSD1306. It supports a slightly wider display, at 132 instead of 128 pixels. The basic commands are the same, but the SH1106 doesn't support the horizontal or vertical address modes. Add support for this display driver. The default values for some of the hardware settings are taken from the datasheet. Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220406172956.3953-5-wens@kernel.org commit b0daaa5cfaa561477b8d3d10fb0697a2cce0c2ba Author: Chen-Yu Tsai Date: Thu Apr 7 01:29:55 2022 +0800 drm/ssd130x: Support page addressing mode On the SINO WEALTH SH1106, which is mostly compatible with the SSD1306, only the basic page addressing mode is supported. This addressing mode is not as easy to use compared to the currently supported horizontal addressing mode, as the page address has to be set prior to writing out each page, and each page must be written out separately as a result. Also, there is no way to force the column address to wrap around early, thus the column address must also be reset for each page to be accurate. Add support for this addressing mode, with a flag to choose it. This flag is designed to be set from the device info data structure, but can be extended to be explicitly forced on through a device tree property if such a need arises. Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220406172956.3953-4-wens@kernel.org commit 97a40c23cda5d64a1c5e968e448435084ebc8c9b Author: Chen-Yu Tsai Date: Thu Apr 7 01:29:54 2022 +0800 dt-bindings: display: ssd1307fb: Add entry for SINO WEALTH SH1106 The SINO WEALTH SH1106 is an OLED display driver that is somewhat compatible with the SSD1306. It supports a slightly wider display, at 132 instead of 128 pixels. The basic commands are the same, but the SH1106 doesn't support the horizontal or vertical address modes. Add a compatible string for it. Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220406172956.3953-3-wens@kernel.org commit 2f073eb41230cf10d0c1fd0719fdb3f19e8497dd Author: Chen-Yu Tsai Date: Thu Apr 7 01:29:53 2022 +0800 dt-bindings: vendor-prefixes: Add prefix for SINO WEALTH Eletronics Ltd. Add a vendor prefix entry for SINO WEALTH Eletronics Ltd. (http://www.sinowealth.com). Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220406172956.3953-2-wens@kernel.org commit 56758cc4595509b6f6d0be56d08003bd87b75635 Author: Ashutosh Dixit Date: Wed Apr 6 12:18:48 2022 -0700 drm/i915/rps: Centralize computation of freq caps Freq caps (i.e. RP0, RP1 and RPn frequencies) are read from HW. However the formats (bit positions, widths, registers and units) of these vary for different generations with even more variations arriving in the future. In order not to have to do identical computation for these caps in multiple places, here we centralize the computation of these caps. This makes the code cleaner and also more extensible for the future. v2: Clarify that caps are in "hw units" in comments (Lucas De Marchi) v3: Minor checkpatch fix v4: s/intel_rps_get_freq_caps/gen6_rps_get_freq_caps/ (Badal Nilawar) v5: Changes comments to kernel doc (Anshuman Gupta) Cc: Anshuman Gupta Signed-off-by: Ashutosh Dixit Reviewed-by: Badal Nilawar Acked-by: Anshuman Gupta Signed-off-by: Anshuman Gupta Link: https://patchwork.freedesktop.org/patch/msgid/20220406191848.20895-1-ashutosh.dixit@intel.com commit 807ff7ed34d2c83e09d7987bd6506cc3d520dcdf Author: Christian König Date: Thu Apr 7 13:43:15 2022 +0200 futex: add missing rtmutex.h include This isn't included here any more since the removal of ww_mutex.h from seqlock.h which causes a build break. Signed-off-by: Christian König Acked-by: Shashank Sharma Fixes: e84815cbbc76 ("seqlock: drop seqcount_ww_mutex_t") Link: https://patchwork.freedesktop.org/patch/msgid/20220407114619.961750-1-christian.koenig@amd.com commit 266d57dd430404e4edbf0a61ed4ad38dce17a056 Merge: 4917e54997b0c 2a826d9c4251e Author: Mark Brown Date: Thu Apr 7 13:52:16 2022 +0100 regulator Add Richtek RT5759 buck converter support Merge series from cy_huang : This patch series add Richtek RT5759 buck converter support. commit 891163adf180bc369b2f11c9dfce6d2758d2a5bd Author: GUO Zihua Date: Thu Apr 7 10:16:19 2022 +0800 ima: remove the IMA_TEMPLATE Kconfig option The original 'ima' measurement list template contains a hash, defined as 20 bytes, and a null terminated pathname, limited to 255 characters. Other measurement list templates permit both larger hashes and longer pathnames. When the "ima" template is configured as the default, a new measurement list template (ima_template=) must be specified before specifying a larger hash algorithm (ima_hash=) on the boot command line. To avoid this boot command line ordering issue, remove the legacy "ima" template configuration option, allowing it to still be specified on the boot command line. The root cause of this issue is that during the processing of ima_hash, we would try to check whether the hash algorithm is compatible with the template. If the template is not set at the moment we do the check, we check the algorithm against the configured default template. If the default template is "ima", then we reject any hash algorithm other than sha1 and md5. For example, if the compiled default template is "ima", and the default algorithm is sha1 (which is the current default). In the cmdline, we put in "ima_hash=sha256 ima_template=ima-ng". The expected behavior would be that ima starts with ima-ng as the template and sha256 as the hash algorithm. However, during the processing of "ima_hash=", "ima_template=" has not been processed yet, and hash_setup would check the configured hash algorithm against the compiled default: ima, and reject sha256. So at the end, the hash algorithm that is actually used will be sha1. With template "ima" removed from the configured default, we ensure that the default tempalte would at least be "ima-ng" which allows for basically any hash algorithm. This change would not break the algorithm compatibility checks for IMA. Fixes: 4286587dccd43 ("ima: add Kconfig default measurement list template") Signed-off-by: GUO Zihua Cc: Signed-off-by: Mimi Zohar commit 73ab99aad50cd05ed0bc230aea39c733ebb9711d Author: Marek Vasut Date: Tue Jan 18 21:29:58 2022 +0100 ARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM The DHCOM SoM has two options for supplying ETHRX clock to the DWMAC block and PHY. Either (1) ETHCK_K generates 50 MHz clock on ETH_CLK pad for the PHY and the same 50 MHz clock are fed back to ETHRX via internal eth_clk_fb clock connection OR (2) ETH_CLK is not used at all, MCO2 generates 50 MHz clock on MCO2 output pad for the PHY and the same MCO2 clock are fed back into ETHRX via ETH_RX_CLK input pad using external pad-to-pad connection. Option (1) has two downsides. ETHCK_K is supplied directly from either PLL3_Q or PLL4_P, hence the PLL output is limited to exactly 50 MHz and since the same PLL output is also used to supply SDMMC blocks, the performance of SD and eMMC access is affected. The second downside is that using this option, the EMI of the SoM is higher. Option (2) solves both of those problems, so implement it here. In this case, the PLL4_P is no longer limited and can be operated faster, at 100 MHz, which improves SDMMC performance (read performance is improved from ~41 MiB/s to ~57 MiB/s with dd if=/dev/mmcblk1 of=/dev/null bs=64M count=1). The EMI interference also decreases. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Christophe Roullier Cc: Gabriel Fernandez Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Tested-by: Johann Neuhauser Signed-off-by: Alexandre Torgue commit f6f39403ce6120226308124b80af7f18731192e7 Author: Marek Vasut Date: Tue Jan 18 21:29:57 2022 +0100 ARM: dts: stm32: Add alternate pinmux for mco2 pins Add pinmux option for MCO2 pin. This is used on DHCOM when the ethernet PHY 50 MHz clock is generated by the MCO2 on PG2 pin. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Christophe Roullier Cc: Gabriel Fernandez Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Tested-by: Johann Neuhauser Signed-off-by: Alexandre Torgue commit 7828494f78e4596e24d3fcce5bb2872f42ab9632 Author: Marek Vasut Date: Tue Jan 18 21:29:56 2022 +0100 ARM: dts: stm32: Add alternate pinmux for ethernet0 pins Add another mux option for ethernet0 pins, this is used on DHCOM when the ethernet PHY 50 MHz clock is generated by the MCO2 on PG2 pin and then fed back via PA1 pin. Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Christophe Roullier Cc: Gabriel Fernandez Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-arm-kernel@lists.infradead.org Tested-by: Johann Neuhauser Signed-off-by: Alexandre Torgue commit e84815cbbc767617221e6891e77f2486c9199dfa Author: Christian König Date: Thu Apr 7 10:20:55 2022 +0200 seqlock: drop seqcount_ww_mutex_t Daniel pointed out that this series removes the last user of seqcount_ww_mutex_t, so let's drop this. Signed-off-by: Christian König Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: Waiman Long Cc: Boqun Feng Cc: linux-kernel@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-16-christian.koenig@amd.com commit 8f94eda39952a8c7323bad2bf752bdfe78101b20 Author: Christian König Date: Mon Apr 4 14:58:37 2022 +0200 dma-buf: drop seq count based update This should be possible now since we don't have the distinction between exclusive and shared fences any more. The only possible pitfall is that a dma_fence would be reused during the RCU grace period, but even that could be handled with a single extra check. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-15-christian.koenig@amd.com commit 8bb31587820a6e04cb613b49238b1800d1a97223 Author: Christian König Date: Tue Nov 23 11:30:35 2021 +0100 drm/ttm: remove bo->moving This is now handled by the DMA-buf framework in the dma_resv obj. Also remove the workaround inside VMWGFX to update the moving fence. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-14-christian.koenig@amd.com commit 1d7f5e6c5240c324afa138738a7d50218a7584c5 Author: Christian König Date: Wed Dec 22 11:23:56 2021 +0100 drm/i915: drop bo->moving dependency That should now be handled by the common dma_resv framework. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-13-christian.koenig@amd.com commit 46b35b33cc561f0b1e61dcd518e2588cb168dd3f Author: Christian König Date: Tue Nov 23 09:58:36 2021 +0100 dma-buf: wait for map to complete for static attachments We have previously done that in the individual drivers but it is more defensive to move that into the common code. Dynamic attachments should wait for map operations to complete by themselves. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-12-christian.koenig@amd.com commit 0cc848a75b742c3f9800e643cd2c03b9cfdc3d69 Author: Christian König Date: Tue Nov 9 11:08:18 2021 +0100 dma-buf: add DMA_RESV_USAGE_BOOKKEEP v3 Add an usage for submissions independent of implicit sync but still interesting for memory management. v2: cleanup the kerneldoc a bit v3: separate amdgpu changes from this Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-10-christian.koenig@amd.com commit 61e55c6f5ce11b15b1c21ba9211c09d2354dbe66 Author: Christian König Date: Mon Apr 4 13:20:02 2022 +0200 RDMA: use DMA_RESV_USAGE_KERNEL We only need to wait for kernel submissions here. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-9-christian.koenig@amd.com commit 91f0c245dd5cd7039090283031b485384b315852 Author: Christian König Date: Mon Apr 4 12:59:32 2022 +0200 drm/radeon: use DMA_RESV_USAGE_KERNEL Always wait for kernel fences before kmap and not only for UVD kmaps. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-7-christian.koenig@amd.com commit c35fcfa344c7544c899610dd5e512f7d630a152c Author: Christian König Date: Mon Apr 4 12:57:30 2022 +0200 drm/amdgpu: use DMA_RESV_USAGE_KERNEL Wait only for kernel fences before kmap or UVD direct submission. This also makes sure that we always wait in amdgpu_bo_kmap() even when returning a cached pointer. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-6-christian.koenig@amd.com commit b29895e18304feb7e8afc6388db7ece60327b23c Author: Christian König Date: Fri Nov 26 14:12:42 2021 +0100 dma-buf: add DMA_RESV_USAGE_KERNEL v3 Add an usage for kernel submissions. Waiting for those are mandatory for dynamic DMA-bufs. As a precaution this patch also changes all occurrences where fences are added as part of memory management in TTM, VMWGFX and i915 to use the new value because it now becomes possible for drivers to ignore fences with the WRITE usage. v2: use "must" in documentation, fix whitespaces v3: separate out some driver changes and better document why some changes should still be part of this patch. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-5-christian.koenig@amd.com commit 047a1b877ed48098bed71fcfb1d4891e1b54441d Author: Christian König Date: Tue Nov 23 09:33:07 2021 +0100 dma-buf & drm/amdgpu: remove dma_resv workaround Rework the internals of the dma_resv object to allow adding more than one write fence and remember for each fence what purpose it had. This allows removing the workaround from amdgpu which used a container for this instead. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-4-christian.koenig@amd.com commit 73511edf8b196e6f1ccda0fdf294ff57aa2dc9db Author: Christian König Date: Tue Nov 9 11:08:18 2021 +0100 dma-buf: specify usage while adding fences to dma_resv obj v7 Instead of distingting between shared and exclusive fences specify the fence usage while adding fences. Rework all drivers to use this interface instead and deprecate the old one. v2: some kerneldoc comments suggested by Daniel v3: fix a missing case in radeon v4: rebase on nouveau changes, fix lockdep and temporary disable warning v5: more documentation updates v6: separate internal dma_resv changes from this patch, avoids to disable warning temporary, rebase on upstream changes v7: fix missed case in lima driver, minimize changes to i915_gem_busy_ioctl Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-3-christian.koenig@amd.com commit 7bc80a5462c37eab58a9ea386064307c0f447fd1 Author: Christian König Date: Tue Nov 9 11:08:18 2021 +0100 dma-buf: add enum dma_resv_usage v4 This change adds the dma_resv_usage enum and allows us to specify why a dma_resv object is queried for its containing fences. Additional to that a dma_resv_usage_rw() helper function is added to aid retrieving the fences for a read or write userspace submission. This is then deployed to the different query functions of the dma_resv object and all of their users. When the write paratermer was previously true we now use DMA_RESV_USAGE_WRITE and DMA_RESV_USAGE_READ otherwise. v2: add KERNEL/OTHER in separate patch v3: some kerneldoc suggestions by Daniel v4: some more kerneldoc suggestions by Daniel, fix missing cases lost in the rebase pointed out by Bas. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220407085946.744568-2-christian.koenig@amd.com commit a8f23dd166651dcda2c02f16e524f56a4bd49084 Author: Yixuan Cao Date: Thu Apr 7 16:09:58 2022 +0800 mm/slab.c: fix comments While reading the source code, I noticed some language errors in the comments, so I fixed them. Signed-off-by: Yixuan Cao Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220407080958.3667-1-caoyixuan2019@email.szu.edu.cn commit 6e87601b7e3e067a6a6c083914e8a109edcded86 Author: Julia Lawall Date: Mon Mar 14 12:53:40 2022 +0100 drm/sti: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Alain Volmat Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20220314115354.144023-17-Julia.Lawall@inria.fr commit ae686e220b5f3962f9188e6661bc370941845a3f Author: Matthew Auld Date: Wed Apr 6 18:30:23 2022 +0100 drm/i915/selftests: handle more rounding Ensure we account for potential rounding up of lmem objects. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5485 Signed-off-by: Matthew Auld Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220406173023.1039107-1-matthew.auld@intel.com commit 15431b110cc5984967646384ea1d47999c677ce3 Author: Colin Ian King Date: Fri Oct 4 09:27:06 2019 +0100 drm: sti: fix spelling mistake: rejec -> rejection In other places of the driver the string hdmi_rejection_pll is used instead of the truncated hdmi_rejec_pll, so use this string instead to be consistent. Signed-off-by: Colin Ian King Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20191004082706.26478-1-colin.king@canonical.com commit 25d4cb51d6cde1229edb42f24a215f3ef8325393 Author: Randy Dunlap Date: Sat Mar 26 16:51:32 2022 -0700 drm: sti: don't use kernel-doc markers Don't mark static functions as kernel-doc. Prevents multiple kernel-doc build warnings: drivers/gpu/drm/sti/sti_hdmi.c:187: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * HDMI interrupt handler threaded drivers/gpu/drm/sti/sti_hdmi.c:219: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * HDMI interrupt handler drivers/gpu/drm/sti/sti_hdmi.c:241: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Set hdmi active area depending on the drm display mode selected drivers/gpu/drm/sti/sti_hdmi.c:262: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Overall hdmi configuration drivers/gpu/drm/sti/sti_hdmi.c:340: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Helper to concatenate infoframe in 32 bits word drivers/gpu/drm/sti/sti_hdmi.c:357: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Helper to write info frame drivers/gpu/drm/sti/sti_hdmi.c:427: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Prepare and configure the AVI infoframe drivers/gpu/drm/sti/sti_hdmi.c:470: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Prepare and configure the AUDIO infoframe drivers/gpu/drm/sti/sti_hdmi.c:555: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Software reset of the hdmi subsystem Fixes: 5402626c83a2 ("drm: sti: add HDMI driver") Signed-off-by: Randy Dunlap Cc: Aditya Srivastava Cc: Benjamin Gaignard Cc: Alain Volmat Cc: David Airlie Cc: Daniel Vetter Acked-by: Alain Volmat Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20220326235132.25192-1-rdunlap@infradead.org commit 2e6c86be0e57079d1fb6c7c7e5423db096d0548a Author: Xiaomeng Tong Date: Sun Mar 27 13:53:55 2022 +0800 stm: ltdc: fix two incorrect NULL checks on list iterator The two bugs are here: if (encoder) { if (bridge && bridge->timings) The list iterator value 'encoder/bridge' will *always* be set and non-NULL by drm_for_each_encoder()/list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found. To fix the bug, use a new variable '*_iter' as the list iterator, while use the old variable 'encoder/bridge' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: 99e360442f223 ("drm/stm: Fix bus_flags handling") Signed-off-by: Xiaomeng Tong Acked-by: Raphael Gallais-Pou Signed-off-by: Philippe Cornu Link: https://patchwork.freedesktop.org/patch/msgid/20220327055355.3808-1-xiam0nd.tong@gmail.com commit cdc86e473b353c8a026a337ee9fb9e1fbbe2276b Author: Peng Fan Date: Fri Feb 25 17:00:02 2022 +0800 clk: imx8mq: add 27m phy pll ref clock According to pll documentation, the 3rd pll ref clock should be hdmi phy 27m clock, not dummy clock. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220225090002.2497057-3-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 8c4d16471e2babe9bdfe41d6ef724526629696cb Author: Guo Ren Date: Wed Apr 6 22:28:43 2022 +0800 csky: patch_text: Fixup last cpu should be master These patch_text implementations are using stop_machine_cpuslocked infrastructure with atomic cpu_count. The original idea: When the master CPU patch_text, the others should wait for it. But current implementation is using the first CPU as master, which couldn't guarantee the remaining CPUs are waiting. This patch changes the last CPU as the master to solve the potential risk. Fixes: 33e53ae1ce41 ("csky: Add kprobes supported") Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Masami Hiramatsu Cc: commit c78a41fc04f0209cba1e62ccbe6a4844633515e7 Author: Arnd Bergmann Date: Sat Apr 2 15:28:18 2022 +0200 ARM: s3c24xx: convert to sparse-irq As a final bit of preparation for converting to ARCH_MULTIPLATFORM, change the interrupt handling for s3c24xx to use sparse IRQs. Since the number of possible interrupts is already fixed and relatively small per chip, just make it use all legacy interrupts preallocated using the .nr_irqs field in the machine descriptor, rather than actually allocating domains on the fly. Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit 91276c0fa4b405c90d7a7fafdca84ae18a516bbf Author: Arnd Bergmann Date: Sat Apr 2 12:29:36 2022 +0200 ARM: s3c24xx: remove support for ISA drivers on BAST PC/104 BAST is the one machine that theoretically supports unmodified ISA drivers for hardware on its PC/104 connector, using a custom version of the inb()/outb() and inw()/outw() macros. This is incompatible with the generic version used in asm/io.h, and can't easily be used in a multiplatform kernel. Removing the special case for 16-bit I/O port access on BAST gets us closer to multiplatform, at the expense of any PC/104 users with 16-bit cards having to either use an older kernel or modify their ISA drivers to manually ioremap() the area and use readw()/write() in place of inw()/outw(). Either way is probably ok, given that there is a recurring discussion about dropping s3c24xx altogether, and many traditional ISA drivers are already gone. Machines other than BAST already have no support for ISA drivers, though a couple of them do map one of the external chip-selects into the ISA port range, using the same address for 8-bit and 16-bit I/O. It is unlikely that anything actually uses this mapping, but it's also easy to keep this working by mapping it to the normal platform-independent PCI I/O base that is otherwise unused on s3c24xx. The mach/map-base.h file is no longer referenced in global headers and can be moved into the platform directory. Acked-by: Krzysztof Kozlowski Signed-off-by: Arnd Bergmann commit e8bd70250a821edb541c3abe1eacdad9f8dc7adf Author: Volodymyr Mytnyk Date: Tue Apr 5 16:20:14 2022 +0300 prestera: acl: add action hw_stats support Currently, when user adds a tc action and the action gets offloaded, the user expects the HW stats to be counted also. This limits the amount of supported offloaded filters, as HW counter resources may be quite limited. Without counter assigned, the HW is capable to carry much more filters. To resolve the issue above, the following types of HW stats are offloaded and supported by the driver: any - current default, user does not care about the type. delayed - polled from HW periodically. disabled - no HW stats needed. immediate - not supported. Example: tc filter add dev PORT ingress proto ip flower skip_sw ip_proto 0x11 \ action drop tc filter add dev PORT ingress proto ip flower skip_sw ip_proto 0x12 \ action drop hw_stats disabled tc filter add dev sw1p1 ingress proto ip flower skip_sw ip_proto 0x14 \ action drop hw_stats delayed Signed-off-by: Volodymyr Mytnyk Link: https://lore.kernel.org/r/1649164814-18731-1-git-send-email-volodymyr.mytnyk@plvision.eu Signed-off-by: Jakub Kicinski commit 51454ea42c1ab4e0c2828bb0d4d53957976980de Author: Niels Dossche Date: Mon Apr 4 01:15:24 2022 +0200 ipv6: fix locking issues with loops over idev->addr_list idev->addr_list needs to be protected by idev->lock. However, it is not always possible to do so while iterating and performing actions on inet6_ifaddr instances. For example, multiple functions (like addrconf_{join,leave}_anycast) eventually call down to other functions that acquire the idev->lock. The current code temporarily unlocked the idev->lock during the loops, which can cause race conditions. Moving the locks up is also not an appropriate solution as the ordering of lock acquisition will be inconsistent with for example mc_lock. This solution adds an additional field to inet6_ifaddr that is used to temporarily add the instances to a temporary list while holding idev->lock. The temporary list can then be traversed without holding idev->lock. This change was done in two places. In addrconf_ifdown, the list_for_each_entry_safe variant of the list loop is also no longer necessary as there is no deletion within that specific loop. Suggested-by: Paolo Abeni Signed-off-by: Niels Dossche Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220403231523.45843-1-dossche.niels@gmail.com Signed-off-by: Jakub Kicinski commit 0848ccaea664970e559d99348484615ba0f7ab63 Author: Christophe JAILLET Date: Wed Mar 23 21:32:22 2022 +0100 scsi: vmw_pvscsi: No need to clear memory after a dma_alloc_coherent() call dma_alloc_coherent() already clear the allocated memory, there is no need to explicitly call memset(). Since 'config_page' and 'header' are the same, a memset() call can be avoided. Link: https://lore.kernel.org/r/cd1220c628c89465dcfcbf4aa9bd53110898a529.1648067518.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 9ad659be37612b036fdbfb535d5f831901f37db2 Author: Krzysztof Kozlowski Date: Fri Apr 1 10:50:50 2022 +0200 scsi: ufs: ufshcd-pltfrm: Simplify pdev->dev usage The 'struct device' pointer is already cached as a local variable in ufshcd_pltfrm_init(), so use it. Link: https://lore.kernel.org/r/20220401085050.119323-1-krzysztof.kozlowski@linaro.org Reviewed-by: Chanho Park Signed-off-by: Krzysztof Kozlowski Signed-off-by: Martin K. Petersen commit 80890c5ea068661d6fe4a34beb362ca0f2c49c90 Author: Maurizio Lombardi Date: Mon Mar 28 12:39:40 2022 +0200 scsi: target: Allow changing dbroot if there are no registered devices The target driver prevents the users from changing the database root directory if a target module like ib_srpt has been registered. This makes it difficult for users to set their preferred database directory if the module gets loaded during the system boot. Let the users modify dbroot if there are no registered devices Link: https://lore.kernel.org/r/20220328103940.19977-1-mlombard@redhat.com Reviewed-by: Mike Christie Signed-off-by: Maurizio Lombardi Signed-off-by: Martin K. Petersen commit 40658542d7713b6f1b51556ef91822f9ca8942d0 Author: Stephen Kitt Date: Tue Apr 5 19:39:52 2022 +0200 ASoC: wm8731: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220405173952.2180743-1-steve@sk2.org Signed-off-by: Mark Brown commit 67f51bfecf9e72511419ded0e4148e2b7a7a30b1 Author: Stephen Kitt Date: Tue Apr 5 18:40:31 2022 +0200 ASoC: sgtl5000: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20220405164031.2160888-1-steve@sk2.org Signed-off-by: Mark Brown commit 953b1388a58e8fd70c034c7679d7031d41c7d8ec Author: Stephen Kitt Date: Tue Apr 5 19:11:58 2022 +0200 ASoC: rt1016: enable building The rt1016 driver wasn't listed in Kconfig and Makefile, which AFAICT means it isn't ever built. This patch adds the appropriate entries to Kconfig and Makefile. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405171158.2168762-1-steve@sk2.org Signed-off-by: Mark Brown commit 5a07a41fed93e7c7f7ba5ac710c2ccdf3a168bee Author: Stephen Kitt Date: Tue Apr 5 18:36:18 2022 +0200 ASoC: pcm3060: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405163618.2158090-1-steve@sk2.org Signed-off-by: Mark Brown commit 0a480df0b87a75b315cc6eef62bfb597111ee630 Author: Christophe JAILLET Date: Sun Mar 20 07:22:26 2022 +0100 ASoC: SOF: topology: Avoid open coded arithmetic in memory allocation Use kcalloc() instead of kzalloc()+open coded multiplication. This is safer and saves a few lines of code. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3bbf03cfd1966bc6fb6dd0939e039fc161078a61.1647757329.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 35b8885805002564906086cbd691e88850257294 Author: Stephen Kitt Date: Tue Apr 5 15:03:26 2022 +0200 ASoC: rt*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405130326.2107293-1-steve@sk2.org Signed-off-by: Mark Brown commit f950ef9180351f73c319ca81e612c4cc98c07cbd Author: Stephen Kitt Date: Tue Apr 5 18:34:00 2022 +0200 ASoC: tscs*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405163400.2156631-1-steve@sk2.org Signed-off-by: Mark Brown commit 97b0b6e3fb8a390205f3266b1fba3e195b9edf30 Author: Stephen Kitt Date: Tue Apr 5 14:24:11 2022 +0200 ASoC: wm*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. wm8731.c is excluded and will be submitted separately. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220405122411.2096387-1-steve@sk2.org Signed-off-by: Mark Brown commit 6b84012ef242c8793c1fdcc002db48c822bb641b Author: Stephen Kitt Date: Tue Apr 5 18:35:33 2022 +0200 ASoC: lm49xxx: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405163533.2157401-1-steve@sk2.org Signed-off-by: Mark Brown commit b6d7a80d654fe7c03d4fb0227af2a5ae12ed6632 Author: Stephen Kitt Date: Tue Apr 5 18:37:50 2022 +0200 ASoC: mt6660: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Link: https://lore.kernel.org/r/20220405163750.2158916-1-steve@sk2.org Signed-off-by: Mark Brown commit 8b3520f7f6f6b54bb6b6e50b88f707a6b8113887 Author: Zhen Ni Date: Mon Mar 14 13:46:21 2022 +0800 ASoC: Intel: boards: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Zhen Ni Link: https://lore.kernel.org/r/20220314054621.14694-1-nizhen@uniontech.com Signed-off-by: Mark Brown commit b7560e8a4de6331009e4ed72afc876d131d1860c Merge: 97da0ed735cfa f28dbaa958fbd Author: Mark Brown Date: Wed Apr 6 23:37:26 2022 +0100 ASoC: ak4613: add TDM256 test support Merge series from Kuninori Morimoto : Renesas is the only user of ak4613 driver on upstream for now. It has STEREO/TDM512/TDM256/TDM128 mode, but STEREO only is used, because of Renesas board connection. I noticed that I can test first 2ch out of TDM256 mode 8ch Playback even in such a situation. base-commit: 3123109284176b1532874591f7c81f3837bbdc17 commit 97da0ed735cfaa249639cab7e5b0b04deb9d890b Merge: cc93a1a1f74c2 98b7630a583fe Author: Mark Brown Date: Wed Apr 6 22:41:58 2022 +0100 Update dt-bindings for sc7280 platform Merge series from Srinivasa Rao Mandadapu : This patch set is to update required clocks, power domain names for sc7280 platforms, and add mic bias supply for wcd938x codec. commit 8e4e83b2278bdfb55cb2b13de07cf0a721ce8af7 Author: Wei Xiao Date: Wed Feb 23 19:11:53 2022 +0800 ftrace: move sysctl_ftrace_enabled to ftrace.c This moves ftrace_enabled to trace/ftrace.c. We move sysctls to places where features actually belong to improve the readability of the code and reduce the risk of code merge conflicts. At the same time, the proc-sysctl maintainers do not want to know what sysctl knobs you wish to add for your owner piece of code, we just care about the core logic. Signed-off-by: Wei Xiao Acked-by: Steven Rostedt (Google) Signed-off-by: Luis Chamberlain commit d772cc2c321900f3f463a124eebeb7218e66dda6 Author: tangmeng Date: Fri Feb 18 18:59:49 2022 +0800 kernel/do_mount_initrd: move real_root_dev sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the real_root_dev sysctl to its own file, kernel/do_mount_initrd.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit 1186618a6a35d43a865448472a261184b608d13c Author: tangmeng Date: Fri Feb 18 18:59:36 2022 +0800 kernel/delayacct: move delayacct sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the delayacct sysctl to its own file, kernel/delayacct.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit 801b501439d1b366d524dee4fc1e6b3473a95b9a Author: tangmeng Date: Fri Feb 18 18:59:23 2022 +0800 kernel/acct: move acct sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the acct sysctl to its own file, kernel/acct.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit 9df918698408fd914493aba0b7858fef50eba63a Author: tangmeng Date: Fri Feb 18 18:59:12 2022 +0800 kernel/panic: move panic sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the oops_all_cpu_backtrace sysctl to its own file, kernel/panic.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit f79c9b8ae8bde10126586c1bb55b5fd027276d8e Author: tangmeng Date: Fri Feb 18 18:58:57 2022 +0800 kernel/lockdep: move lockdep sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the prove_locking and lock_stat sysctls to its own file, kernel/lockdep.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit aa779e5102195e1d9ade95dcbc0bfbd8f916eb59 Author: zhanglianjie Date: Thu Feb 17 18:51:51 2022 -0800 mm: move page-writeback sysctls to their own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the page-writeback sysctls to its own file. [akpm@linux-foundation.org: coding-style cleanups] akpm@linux-foundation.org: fix CONFIG_SYSCTL=n warnings] Link: https://lkml.kernel.org/r/20220129012955.26594-1-zhanglianjie@uniontech.com Signed-off-by: zhanglianjie Cc: Kees Cook Cc: Iurii Zaikin Cc: Luis Chamberlain Signed-off-by: Andrew Morton Signed-off-by: Luis Chamberlain commit 43fe219aa56a2fdd8f0623c9470a32b14b0617a5 Author: sujiaxun Date: Thu Feb 17 18:51:48 2022 -0800 mm: move oom_kill sysctls to their own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the oom_kill sysctls to their own file, mm/oom_kill.c [sfr@canb.auug.org.au: null-terminate the array] Link: https://lkml.kernel.org/r/20220216193202.28838626@canb.auug.org.au Link: https://lkml.kernel.org/r/20220215093203.31032-1-sujiaxun@uniontech.com Signed-off-by: sujiaxun Signed-off-by: Stephen Rothwell Cc: Kees Cook Cc: Iurii Zaikin Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Luis Chamberlain commit 06d177662fb86b80c7fc2290667b9a14cb0bd925 Author: tangmeng Date: Thu Feb 17 12:23:21 2022 +0800 kernel/reboot: move reboot sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the poweroff_cmd and ctrl-alt-del sysctls to its own file, kernel/reboot.c. Signed-off-by: tangmeng Signed-off-by: Luis Chamberlain commit 8a0441415b3f9b9a920a6a5086580ea3daa7b884 Author: Zhen Ni Date: Tue Feb 15 19:46:04 2022 +0800 sched: Move energy_aware sysctls to topology.c move energy_aware sysctls to topology.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit d4ae80ffa64f87b9c355692b680b603add084e96 Author: Zhen Ni Date: Tue Feb 15 19:46:03 2022 +0800 sched: Move cfs_bandwidth_slice sysctls to fair.c move cfs_bandwidth_slice sysctls to fair.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit 3267e0156c3341ac25b37a0f60551cdae1634b60 Author: Zhen Ni Date: Tue Feb 15 19:46:02 2022 +0800 sched: Move uclamp_util sysctls to core.c move uclamp_util sysctls to core.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit 28f152cd0926596e69d412467b11b6fe6fe4e864 Author: Baisong Zhong Date: Fri Mar 18 10:54:17 2022 +0800 sched/rt: fix build error when CONFIG_SYSCTL is disable Avoid random build errors which do not select CONFIG_SYSCTL by depending on it in Kconfig. This fixes the following warning: In file included from kernel/sched/build_policy.c:43: At top level: kernel/sched/rt.c:3017:12: error: ‘sched_rr_handler’ defined but not used [-Werror=unused-function] 3017 | static int sched_rr_handler(struct ctl_table *table, int write, void *buffer, | ^~~~~~~~~~~~~~~~ kernel/sched/rt.c:2978:12: error: ‘sched_rt_handler’ defined but not used [-Werror=unused-function] 2978 | static int sched_rt_handler(struct ctl_table *table, int write, void *buffer, | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [scripts/Makefile.build:310: kernel/sched/build_policy.o] Error 1 make[1]: *** [scripts/Makefile.build:638: kernel/sched] Error 2 make[1]: *** Waiting for unfinished jobs.... Reported-by: Hulk Robot Signed-off-by: Baisong Zhong [mcgrof: small build fix, we need sched_rt_can_attach() even when CONFIG_SYSCTL is disabled] Signed-off-by: Luis Chamberlain commit dafd7a9dad22fadcb290b24dff54e2eae3b89776 Author: Zhen Ni Date: Tue Feb 15 19:46:01 2022 +0800 sched: Move rr_timeslice sysctls to rt.c move rr_timeslice sysctls to rt.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit 84227c12888b1105725cd2de14705b029bcbb4b2 Author: Zhen Ni Date: Tue Feb 15 19:46:00 2022 +0800 sched: Move deadline_period sysctls to deadline.c move deadline_period sysctls to deadline.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit d9ab0e63fa7f8405fbb19e28c5191e0880a7f2db Author: Zhen Ni Date: Tue Feb 15 19:45:59 2022 +0800 sched: Move rt_period/runtime sysctls to rt.c move rt_period/runtime sysctls to rt.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit f5ef06d58be8311a9425e6a54a053ecb350952f3 Author: Zhen Ni Date: Tue Feb 15 19:45:58 2022 +0800 sched: Move schedstats sysctls to core.c move schedstats sysctls to core.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit a60707d74bd1d119cf7bcc5101cda912fc46d5e3 Author: Zhen Ni Date: Tue Feb 15 19:45:57 2022 +0800 sched: Move child_runs_first sysctls to fair.c move child_runs_first sysctls to fair.c and use the new register_sysctl_init() to register the sysctl interface. Signed-off-by: Zhen Ni Signed-off-by: Luis Chamberlain commit 4b276ed3c7ace7ca41e8963b199358fd55f493af Author: Lucas De Marchi Date: Mon Apr 4 17:11:49 2022 -0700 drm/i915/uncore: Warn on previous unclaimed accesses Since gen6 we use FPGA_DBG register to detect unclaimed MMIO registers. This register is in the display engine IP and can only ever detect unclaimed accesses to registers in this area. However sometimes there are reports of this triggering for registers in other areas, which should not be possible. Right now we always warn after the read/write of registers going through unclaimed_reg_debug(). However places using __raw_uncore_* may be triggering the unclaimed access and those being later accounted to a different register. Let's warn both before and after the read/write with a slightly different message, so it's clear if the register reported in the warning is actually the culprit. Commit dda960335e02 ("drm/i915: Just clear the mmiodebug before a register access") attempted to solve the same issue by removing the warning when if FPGA_DBG flags before the mmio read/write. However, it doesn't solve it completely as FPGA_DBG may remain set when reading registers outside display. So in the end the check after the mmio read/write triggers the warning pointing to the wrong register. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220405001149.2675226-1-lucas.demarchi@intel.com commit 37384b81bc255bca3412536c50598fa50d05c751 Author: Andre Przywara Date: Thu Mar 17 16:23:49 2022 +0000 ARM: dts: suniv: licheepi-nano: add SPI flash Most LicheePi Nano boards come with soldered SPI flash, so enable SPI0 in the .dts and describe the flash chip. There is evidence of different flash chips used, also of boards with no flash chip soldered, but the Winbond 16MiB model is the most common, so use that for the compatible string. The actual flash chip model will be auto-detected at runtime anyway. Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-13-andre.przywara@arm.com commit 335f57508a7a3220feb161400f0475e7f42be1b3 Author: Andre Przywara Date: Thu Mar 17 16:23:48 2022 +0000 ARM: dts: suniv: F1C100: add SPI support The F1C100 series contains two SPI controllers, and many boards use SPI0 for a SPI flash, as the BROM is able to boot from that. Describe the two controllers in the SoC .dtsi, and also add the PortC pins for SPI0, since this is where BROM looks at when trying to boot from the commonly used SPI flash. The SPI controller seems to be the same as in the H3 chips, but it lacks a separate mod clock. The manual says it's connected to AHB directly. We don't export that AHB clock directly, but can use the AHB *gate* clock as a clock source, since the SPI driver is not supposed to change the AHB frequency anyway. Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-12-andre.przywara@arm.com commit 382e0d4f9ece6d1b282ac70c246bdc7be5edc053 Author: Andre Przywara Date: Thu Mar 17 16:23:47 2022 +0000 dt-bindings: spi: sunxi: document F1C100 controllers The Allwinner F1C100 series contains two SPI controllers, which are compatible to the IP block used in the Allwinner H3 as well. The only difference in the integration is the missing mod clock in the F1C100, but that does not affect the SPI controller binding, as we can still supply the correct clock (AHB parent) easily. Signed-off-by: Andre Przywara Acked-by: Samuel Holland Acked-by: Rob Herring Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-11-andre.przywara@arm.com commit 30b6259f8bb8f17377d13c61e47b66d71ec3abfe Author: Jesse Taube Date: Thu Mar 17 16:23:46 2022 +0000 ARM: dts: suniv: licheepi-nano: add microSD card Enable MMC0 and supply the board setting to enable the microSD card slot on the LicheePi Nano board. Apart from the always missing write protect switch on microSD slots, the card-detect pin is not connected to anything, so we use the broken-cd property. Signed-off-by: Jesse Taube [Andre: add alias and vmmc supply] Signed-off-by: Andre Przywara Acked-by: Samuel Holland Tested-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-10-andre.przywara@arm.com commit a672a3f2f0221bc56e94d6508e3b3fc74442065b Author: Jesse Taube Date: Thu Mar 17 16:23:45 2022 +0000 ARM: dts: suniv: F1C100: add MMC controllers The F1C100 series contains two MMC controllers, where the first one is typically connected to an (micro)SD card slot (as this is the one the BROM is able to boot from). Describe the two controllers in the SoC .dtsi. We also add the pinctrl description for MMC0, since this is the only pin set supporting that function anyway, and SD cards are very common across boards. Signed-off-by: Jesse Taube Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-9-andre.przywara@arm.com commit a26123f355f23d8ba980d7ecf4899d309d5cd708 Author: Andre Przywara Date: Thu Mar 17 16:23:44 2022 +0000 ARM: dts: suniv: F1C100: fix timer node The Allwinner F1C100s has three timer instances, each with their own interrupt line. Add the missing two interrupts to the DT node, to match the DT binding. Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-8-andre.przywara@arm.com commit a6d9efb62a482c2da1078d9654b68a0777aa2fc6 Author: Andre Przywara Date: Thu Mar 17 16:23:43 2022 +0000 ARM: dts: suniv: F1C100: fix CPU node The /cpu node in the f1c100s.dtsi is not spec compliant, it's missing the reg property, and the corresponding address and size cells properties. Add them to make the bindings check pass. Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-7-andre.przywara@arm.com commit 1aba2af585fc594f08e2a90e37d7f943b6d68730 Author: Jesse Taube Date: Thu Mar 17 16:23:42 2022 +0000 ARM: dts: suniv: F1C100: add clock and reset macros Include clock and reset macros and replace magic numbers. Signed-off-by: Jesse Taube Reviewed-by: Andre Przywara Signed-off-by: Andre Przywara Acked-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-6-andre.przywara@arm.com commit fb2dcdd7c44652add88ac518c67b208e5133a7a9 Author: Andre Przywara Date: Thu Mar 17 16:23:41 2022 +0000 dt-bindings: arm: sunxi: document LicheePi Nano name The top level LicheePi Nano compatible name was never documented in the bindings, so add the currently used string. As for the manufacturer name, Samuel reports: ========== From what I can tell, "Lichee Pi Nano" [1][2] is the original board, and the "Sipeed Lichee Nano" [3] is a newer batch by some of the same people [4]. Other than the silkscreen and the addition of the resistive touchscreen IC, the boards look identical. And in fact I was able to find an intermediate version of the schematic [5] that uses the old styling but includes the touchscreen IC. ========== [1]: https://licheepizero.us/ [2]: http://nano.lichee.pro/ [3]: https://wiki.sipeed.com/hardware/en/lichee/Nano/Nano.html [4]: see e.g. http://bbs.lichee.pro/ [5]: https://github.com/hongxuyao/F1C100s_with_Keil_RTX4_emWin5/blob/spl-separated/doc/lichee-nano/lichee_nano-Schematic.pdf Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland Acked-by: Rob Herring Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-5-andre.przywara@arm.com commit 01a850ee61cbf0ab77dcbf26bb133fec2dd640d6 Author: Andre Przywara Date: Thu Mar 17 16:23:40 2022 +0000 ARM: dts: suniv: F1C100: fix watchdog compatible The F1C100 series of SoCs actually have their watchdog IP being compatible with the newer Allwinner generation, not the older one. The currently described sun4i-a10-wdt actually does not work, neither the watchdog functionality (just never fires), nor the reset part (reboot hangs). Replace the compatible string with the one used by the newer generation. Verified to work with both the watchdog and reboot functionality on a LicheePi Nano. Also add the missing interrupt line and clock source, to make it binding compliant. Fixes: 4ba16d17efdd ("ARM: dts: suniv: add initial DTSI file for F1C100s") Signed-off-by: Andre Przywara Acked-by: Guenter Roeck Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-4-andre.przywara@arm.com commit 42b91bb160815d82d36cc1cfe28f1edd9079d912 Author: Andre Przywara Date: Thu Mar 17 16:23:39 2022 +0000 dt-bindings: watchdog: sunxi: clarify clock support Most Allwinner SoCs have just one input clock to drive the watchdog peripheral. So far this is the 24 MHz "HOSC" oscillator, divided down internally to 32 KHz. The F1C100 series watchdog however uses the unchanged 32 KHz "LOSC" as its only clock input, which has the same effect, but let's the binding description mismatch. Change the binding description to name the clocks more loosely, so both the LOSC and divided HOSC match the description. As the fixed clock names now make less sense, drop them from SoCs supporting just one clock input, they were not used by any DT anyway. For the newer SoCs, supporting a choice of two input clocks, we keep both the description and clock-names requirement. Signed-off-by: Andre Przywara Reviewed-by: Guenter Roeck Reviewed-by: Samuel Holland Reviewed-by: Rob Herring Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-3-andre.przywara@arm.com commit 6d41e13041a306f85ad6cbeb3d532f35cc5cc90a Author: Andre Przywara Date: Thu Mar 17 16:23:38 2022 +0000 dt-bindings: watchdog: sunxi: fix F1C100s compatible The F1C100 series actually features a newer generation watchdog IP, so the compatible string was wrong. Signed-off-by: Andre Przywara Reviewed-by: Samuel Holland Acked-by: Rob Herring Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220317162349.739636-2-andre.przywara@arm.com commit 8dd7cdb0f473407fdcd231c3eccef07371fd5e58 Author: Borislav Petkov Date: Tue Apr 5 17:15:09 2022 +0200 bnx2x: Fix undefined behavior due to shift overflowing the constant Fix: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c: In function ‘bnx2x_check_blocks_with_parity3’: drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c:4917:4: error: case label does not reduce to an integer constant case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Ariel Elior Cc: Sudarsana Kalluru Cc: Manish Chopra Cc: Paolo Abeni Link: https://lore.kernel.org/r/20220405151517.29753-4-bp@alien8.de Signed-off-by: Jakub Kicinski commit 40570375356c874b1578e05c1dcc3ff7c1322dbe Author: Eric Dumazet Date: Tue Apr 5 16:35:38 2022 -0700 tcp: add accessors to read/set tp->snd_cwnd We had various bugs over the years with code breaking the assumption that tp->snd_cwnd is greater than zero. Lately, syzbot reported the WARN_ON_ONCE(!tp->prior_cwnd) added in commit 8b8a321ff72c ("tcp: fix zero cwnd in tcp_cwnd_reduction") can trigger, and without a repro we would have to spend considerable time finding the bug. Instead of complaining too late, we want to catch where and when tp->snd_cwnd is set to an illegal value. Signed-off-by: Eric Dumazet Suggested-by: Yuchung Cheng Cc: Neal Cardwell Acked-by: Yuchung Cheng Link: https://lore.kernel.org/r/20220405233538.947344-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit dc1acd5c94699389a9ed023e94dd860c846ea1f6 Author: Jakob Koschel Date: Wed Apr 6 14:05:31 2022 -0400 dlm: 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 Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c490b3afaa579ab238f78c762d703441ccc898bd Author: Jakob Koschel Date: Wed Apr 6 14:05:30 2022 -0400 dlm: remove usage of list iterator for list_add() after the loop body In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Before, the code implicitly used the head when no element was found when using &pos->list. Since the new variable is only set if an element was found, the list_add() is performed within the loop and only done after the loop if it is done on the list head directly. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit ba58995909b5098ca4003af65b0ccd5a8d13dd25 Author: Alexander Aring Date: Wed Apr 6 13:34:16 2022 -0400 dlm: fix pending remove if msg allocation fails This patch unsets ls_remove_len and ls_remove_name if a message allocation of a remove messages fails. In this case we never send a remove message out but set the per ls ls_remove_len ls_remove_name variable for a pending remove. Unset those variable should indicate possible waiters in wait_pending_remove() that no pending remove is going on at this moment. Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f6f7418357457ed58cbb020fc97e74d4e0e7b47f Author: Alexander Aring Date: Wed Apr 6 13:34:15 2022 -0400 dlm: fix wake_up() calls for pending remove This patch move the wake_up() call at the point when a remove message completed. Before it was only when a remove message was going to be sent. The possible waiter in wait_pending_remove() waits until a remove is done if the resource name matches with the per ls variable ls->ls_remove_name. If this is the case we must wait until a pending remove is done which is indicated if DLM_WAIT_PENDING_COND() returns false which will always be the case when ls_remove_len and ls_remove_name are unset to indicate that a remove is not going on anymore. Fixes: 21d9ac1a5376 ("fs: dlm: use event based wait for pending remove") Cc: stable@vger.kernel.org Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2c3fa6ae4d520d59727dac33a3e14d42f3dd36d8 Author: Alexander Aring Date: Mon Apr 4 16:06:46 2022 -0400 dlm: check required context while close This patch adds a WARN_ON() check to validate the right context while dlm_midcomms_close() is called. Even before commit 489d8e559c65 ("fs: dlm: add reliable connection if reconnect") in this context dlm_lowcomms_close() flushes all ongoing transmission triggered by dlm application stack. If we do that, it's required that no new message will be triggered by the dlm application stack. The function dlm_midcomms_close() is not called often so we can check if all lockspaces are in such context. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 401597485cfc702ee75c4dc73345dcfcdb002d04 Author: Alexander Aring Date: Mon Apr 4 16:06:45 2022 -0400 dlm: cleanup lock handling in dlm_master_lookup This patch will remove the following warning by sparse: fs/dlm/lock.c:1049:9: warning: context imbalance in 'dlm_master_lookup' - different lock contexts for basic block I tried to find any issues with the current handling and I did not find any. However it is hard to follow the lock handling in this area of dlm_master_lookup() and I suppose that sparse cannot realize that there are no issues. The variable "toss_list" makes it really hard to follow the lock handling because if it's set the rsb lock/refcount isn't held but the ls->ls_rsbtbl[b].lock is held and this is one reason why the rsb lock/refcount does not need to be held. If it's not set the ls->ls_rsbtbl[b].lock is not held but the rsb lock/refcount is held. The indicator of toss_list will be used to store the actual lock state. Another possibility is that a retry can happen and then it's hard to follow the specific code part. I did not find any issues but sparse cannot realize that there are no issues. To make it more easier to understand for developers and sparse as well, we remove the toss_list variable which indicates a specific lock state and move handling in between of this lock state in a separate function. This function can be called now in case when the initial lock states are taken which was previously signalled if toss_list was set or not. The advantage here is that we can release all locks/refcounts in mostly the same code block as it was taken. Afterwards sparse had no issues to figure out that there are no problems with the current lock behaviour. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit e91ce03b27b6815cae064bb3d608b7cd26f3fab4 Author: Alexander Aring Date: Mon Apr 4 16:06:44 2022 -0400 dlm: remove found label in dlm_master_lookup This patch cleanups a not necessary label found which can be replaced by a proper else handling to jump over a specific code block. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c087eabde171cf7009e513781d8e81f923630d5e Author: Alexander Aring Date: Mon Apr 4 16:06:43 2022 -0400 dlm: remove __user conversion warnings This patch avoids the following sparse warning: fs/dlm/user.c:111:38: warning: incorrect type in assignment (different address spaces) fs/dlm/user.c:111:38: expected void [noderef] __user *castparam fs/dlm/user.c:111:38: got void * fs/dlm/user.c:112:37: warning: incorrect type in assignment (different address spaces) fs/dlm/user.c:112:37: expected void [noderef] __user *castaddr fs/dlm/user.c:112:37: got void * fs/dlm/user.c:113:38: warning: incorrect type in assignment (different address spaces) fs/dlm/user.c:113:38: expected void [noderef] __user *bastparam fs/dlm/user.c:113:38: got void * fs/dlm/user.c:114:37: warning: incorrect type in assignment (different address spaces) fs/dlm/user.c:114:37: expected void [noderef] __user *bastaddr fs/dlm/user.c:114:37: got void * fs/dlm/user.c:115:33: warning: incorrect type in assignment (different address spaces) fs/dlm/user.c:115:33: expected struct dlm_lksb [noderef] __user *lksb fs/dlm/user.c:115:33: got void * fs/dlm/user.c:130:39: warning: cast removes address space '__user' of expression fs/dlm/user.c:131:40: warning: cast removes address space '__user' of expression fs/dlm/user.c:132:36: warning: cast removes address space '__user' of expression So far I see there is no direct handling of copying a pointer value to another pointer value. The handling only copies the actual pointer address to a scalar type or vice versa. This should be okay because it never handles dereferencing anything of those addresses in the kernel space. To get rid of those warnings we doing some different casting which results in no warnings in sparse or compiler. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 14a92fd7038279bf652b6daa5ab6e4241b66fad6 Author: Alexander Aring Date: Mon Apr 4 16:06:42 2022 -0400 dlm: move conversion to compile time This patch is a cleanup to move the byte order conversion to compile time. In a simple comparison like this it's possible to move it to static values so the compiler will always convert those values at compile time. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 00e99ccde75722599faf089416341bfed7e4edb5 Author: Alexander Aring Date: Mon Apr 4 16:06:41 2022 -0400 dlm: use __le types for dlm messages This patch changes to use __le types directly in the dlm message structure which is casted at the right dlm message buffer positions. The main goal what is reached here is to remove sparse warnings regarding to host to little byte order conversion or vice versa. Leaving those sparse issues ignored and always do it in out/in functionality tends to leave it unknown in which byte order the variable is being handled. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2f9dbeda8dc04b5b754e032000adf6bab03aa9be Author: Alexander Aring Date: Mon Apr 4 16:06:40 2022 -0400 dlm: use __le types for rcom messages This patch changes to use __le types directly in the dlm rcom structure which is casted at the right dlm message buffer positions. The main goal what is reached here is to remove sparse warnings regarding to host to little byte order conversion or vice versa. Leaving those sparse issues ignored and always do it in out/in functionality tends to leave it unknown in which byte order the variable is being handled. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 3428785a65dabf05bc899b6c5334984e98286184 Author: Alexander Aring Date: Mon Apr 4 16:06:39 2022 -0400 dlm: use __le types for dlm header This patch changes to use __le types directly in the dlm header structure which is casted at the right dlm message buffer positions. The main goal what is reached here is to remove sparse warnings regarding to host to little byte order conversion or vice versa. Leaving those sparse issues ignored and always do it in out/in functionality tends to leave it unknown in which byte order the variable is being handled. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d9efd005fdd1d3f7ac2b9aaec025d58343d2ba45 Author: Alexander Aring Date: Mon Apr 4 16:06:38 2022 -0400 dlm: use __le types for options header This patch changes to use __le types directly in the dlm option headers structures which are casted at the right dlm message buffer positions. Currently only midcomms.c using those headers which already was calling endian conversions on-the-fly without using in/out functionality like other endianness handling in dlm. Using __le types now will hopefully get useful warnings in future if we do comparison against host byte order values. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a8449f232ee316208185ef7fbedc4a2c48da2a34 Author: Alexander Aring Date: Mon Apr 4 16:06:37 2022 -0400 dlm: add __CHECKER__ for false positives This patch will adds #ifndef __CHECKER__ for false positives warnings about an imbalance lock/unlock srcu handling. Which are shown by running sparse checks: fs/dlm/midcomms.c:1065:20: warning: context imbalance in 'dlm_midcomms_get_mhandle' - wrong count at exit Using __CHECKER__ will tell sparse to ignore these sections. Those imbalances are false positive because from upper layer it is always required to call a function in sequence, e.g. if dlm_midcomms_get_mhandle() is successful there must be a dlm_midcomms_commit_mhandle() call afterwards. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 314a5540ffee6cedcfdd6c8439f322282c0e76ae Author: Alexander Aring Date: Mon Apr 4 16:06:36 2022 -0400 dlm: move global to static inits Instead of init global module at module loading time we can move the initialization of those global variables at memory initialization of the module loader. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 16d58904dfeb13cc9758194df99cb1a756f11fbc Author: Alexander Aring Date: Mon Apr 4 16:06:35 2022 -0400 dlm: remove unnecessary INIT_LIST_HEAD() There is no need to call INIT_LIST_HEAD() when it's set directly afterwards by list_add_tail(). Reported-by: Andreas Gruenbacher Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit bcfad4265cedf3adcac355e994ef9771b78407bd Author: Alexander Aring Date: Mon Apr 4 16:06:34 2022 -0400 dlm: improve plock logging if interrupted This patch changes the log level if a plock is removed when interrupted from debug to info. Additional it signals now that the plock entity was removed to let the user know what's happening. If on a dev_write() a pending plock cannot be find it will signal that it might have been removed because wait interruption. Before this patch there might be a "dev_write no op ..." info message and the users can only guess that the plock was removed before because the wait interruption. To be sure that is the case we log both messages on the same log level. Let both message be logged on info layer because it should not happened a lot and if it happens it should be clear why the op was not found. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a800ba77fd285c6391a82819867ac64e9ab3af46 Author: Alexander Aring Date: Mon Apr 4 16:06:33 2022 -0400 dlm: rearrange async condition return This patch moves the return of FILE_LOCK_DEFERRED a little bit earlier than checking afterwards again if the request was an asynchronous request. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit bcbb4ba6c9ba81e6975b642a2cade68044cd8a66 Author: Alexander Aring Date: Mon Apr 4 16:06:32 2022 -0400 dlm: cleanup plock_op vs plock_xop Lately the different casting between plock_op and plock_xop and list holders which was involved showed some issues which were hard to see. This patch removes the "plock_xop" structure and introduces a "struct plock_async_data". This structure will be set in "struct plock_op" in case of asynchronous lock handling as the original "plock_xop" was made for. There is no need anymore to cast pointers around for additional fields in case of asynchronous lock handling. As disadvantage another allocation was introduces but only needed in the asynchronous case which is currently only used in combination with nfs lockd. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit a559790caa1c6ce9e6cc52c6cb7bf04306653792 Author: Alexander Aring Date: Mon Apr 4 16:06:31 2022 -0400 dlm: replace sanity checks with WARN_ON There are several sanity checks and recover handling if they occur in the dlm plock handling. From my understanding those operation can't run in parallel with any list manipulation which involved setting the list holder of plock_op, if so we have a bug which this sanity check will warn about. Previously if such sanity check occurred the dlm plock handling was trying to recover from it by deleting the plock_op from a list which the holder was set to. However there is a bug in the dlm plock handling if this case ever happens. To make such bugs are more visible for further investigations we add a WARN_ON() on those sanity checks and remove the recovering handling because other possible side effects. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 42252d0d2aa9b94d168241710a761588b3959019 Author: Alexander Aring Date: Mon Apr 4 16:06:30 2022 -0400 dlm: fix plock invalid read This patch fixes an invalid read showed by KASAN. A unlock will allocate a "struct plock_op" and a followed send_op() will append it to a global send_list data structure. In some cases a followed dev_read() moves it to recv_list and dev_write() will cast it to "struct plock_xop" and access fields which are only available in those structures. At this point an invalid read happens by accessing those fields. To fix this issue the "callback" field is moved to "struct plock_op" to indicate that a cast to "plock_xop" is allowed and does the additional "plock_xop" handling if set. Example of the KASAN output which showed the invalid read: [ 2064.296453] ================================================================== [ 2064.304852] BUG: KASAN: slab-out-of-bounds in dev_write+0x52b/0x5a0 [dlm] [ 2064.306491] Read of size 8 at addr ffff88800ef227d8 by task dlm_controld/7484 [ 2064.308168] [ 2064.308575] CPU: 0 PID: 7484 Comm: dlm_controld Kdump: loaded Not tainted 5.14.0+ #9 [ 2064.310292] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 [ 2064.311618] Call Trace: [ 2064.312218] dump_stack_lvl+0x56/0x7b [ 2064.313150] print_address_description.constprop.8+0x21/0x150 [ 2064.314578] ? dev_write+0x52b/0x5a0 [dlm] [ 2064.315610] ? dev_write+0x52b/0x5a0 [dlm] [ 2064.316595] kasan_report.cold.14+0x7f/0x11b [ 2064.317674] ? dev_write+0x52b/0x5a0 [dlm] [ 2064.318687] dev_write+0x52b/0x5a0 [dlm] [ 2064.319629] ? dev_read+0x4a0/0x4a0 [dlm] [ 2064.320713] ? bpf_lsm_kernfs_init_security+0x10/0x10 [ 2064.321926] vfs_write+0x17e/0x930 [ 2064.322769] ? __fget_light+0x1aa/0x220 [ 2064.323753] ksys_write+0xf1/0x1c0 [ 2064.324548] ? __ia32_sys_read+0xb0/0xb0 [ 2064.325464] do_syscall_64+0x3a/0x80 [ 2064.326387] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 2064.327606] RIP: 0033:0x7f807e4ba96f [ 2064.328470] Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 39 87 f8 ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 7c 87 f8 ff 48 [ 2064.332902] RSP: 002b:00007ffd50cfe6e0 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 [ 2064.334658] RAX: ffffffffffffffda RBX: 000055cc3886eb30 RCX: 00007f807e4ba96f [ 2064.336275] RDX: 0000000000000040 RSI: 00007ffd50cfe7e0 RDI: 0000000000000010 [ 2064.337980] RBP: 00007ffd50cfe7e0 R08: 0000000000000000 R09: 0000000000000001 [ 2064.339560] R10: 000055cc3886eb30 R11: 0000000000000293 R12: 000055cc3886eb80 [ 2064.341237] R13: 000055cc3886eb00 R14: 000055cc3886f590 R15: 0000000000000001 [ 2064.342857] [ 2064.343226] Allocated by task 12438: [ 2064.344057] kasan_save_stack+0x1c/0x40 [ 2064.345079] __kasan_kmalloc+0x84/0xa0 [ 2064.345933] kmem_cache_alloc_trace+0x13b/0x220 [ 2064.346953] dlm_posix_unlock+0xec/0x720 [dlm] [ 2064.348811] do_lock_file_wait.part.32+0xca/0x1d0 [ 2064.351070] fcntl_setlk+0x281/0xbc0 [ 2064.352879] do_fcntl+0x5e4/0xfe0 [ 2064.354657] __x64_sys_fcntl+0x11f/0x170 [ 2064.356550] do_syscall_64+0x3a/0x80 [ 2064.358259] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 2064.360745] [ 2064.361511] Last potentially related work creation: [ 2064.363957] kasan_save_stack+0x1c/0x40 [ 2064.365811] __kasan_record_aux_stack+0xaf/0xc0 [ 2064.368100] call_rcu+0x11b/0xf70 [ 2064.369785] dlm_process_incoming_buffer+0x47d/0xfd0 [dlm] [ 2064.372404] receive_from_sock+0x290/0x770 [dlm] [ 2064.374607] process_recv_sockets+0x32/0x40 [dlm] [ 2064.377290] process_one_work+0x9a8/0x16e0 [ 2064.379357] worker_thread+0x87/0xbf0 [ 2064.381188] kthread+0x3ac/0x490 [ 2064.383460] ret_from_fork+0x22/0x30 [ 2064.385588] [ 2064.386518] Second to last potentially related work creation: [ 2064.389219] kasan_save_stack+0x1c/0x40 [ 2064.391043] __kasan_record_aux_stack+0xaf/0xc0 [ 2064.393303] call_rcu+0x11b/0xf70 [ 2064.394885] dlm_process_incoming_buffer+0x47d/0xfd0 [dlm] [ 2064.397694] receive_from_sock+0x290/0x770 [dlm] [ 2064.399932] process_recv_sockets+0x32/0x40 [dlm] [ 2064.402180] process_one_work+0x9a8/0x16e0 [ 2064.404388] worker_thread+0x87/0xbf0 [ 2064.406124] kthread+0x3ac/0x490 [ 2064.408021] ret_from_fork+0x22/0x30 [ 2064.409834] [ 2064.410599] The buggy address belongs to the object at ffff88800ef22780 [ 2064.410599] which belongs to the cache kmalloc-96 of size 96 [ 2064.416495] The buggy address is located 88 bytes inside of [ 2064.416495] 96-byte region [ffff88800ef22780, ffff88800ef227e0) [ 2064.422045] The buggy address belongs to the page: [ 2064.424635] page:00000000b6bef8bc refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xef22 [ 2064.428970] flags: 0xfffffc0000200(slab|node=0|zone=1|lastcpupid=0x1fffff) [ 2064.432515] raw: 000fffffc0000200 ffffea0000d68b80 0000001400000014 ffff888001041780 [ 2064.436110] raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 [ 2064.439813] page dumped because: kasan: bad access detected [ 2064.442548] [ 2064.443310] Memory state around the buggy address: [ 2064.445988] ffff88800ef22680: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc [ 2064.449444] ffff88800ef22700: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc [ 2064.452941] >ffff88800ef22780: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc [ 2064.456383] ^ [ 2064.459386] ffff88800ef22800: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc [ 2064.462788] ffff88800ef22880: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc [ 2064.466239] ================================================================== reproducer in python: import argparse import struct import fcntl import os parser = argparse.ArgumentParser() parser.add_argument('-f', '--file', help='file to use fcntl, must be on dlm lock filesystem e.g. gfs2') args = parser.parse_args() f = open(args.file, 'wb+') lockdata = struct.pack('hhllhh', fcntl.F_WRLCK,0,0,0,0,0) fcntl.fcntl(f, fcntl.F_SETLK, lockdata) lockdata = struct.pack('hhllhh', fcntl.F_UNLCK,0,0,0,0,0) fcntl.fcntl(f, fcntl.F_SETLK, lockdata) Fixes: 586759f03e2e ("gfs2: nfs lock support for gfs2") Cc: stable@vger.kernel.org Signed-off-by: Andreas Gruenbacher Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 67e4d8c51dc6e1cc1c2e559ed6fcf9ea1bca654a Author: Alexander Aring Date: Mon Apr 4 16:06:29 2022 -0400 dlm: fix missing check in validate_lock_args This patch adds a additional check if lkb->lkb_wait_count is non zero as it is done in validate_unlock_args() to check if any operation is in progress. While on it add a comment taken from validate_unlock_args() to signal what the check is doing. There might be no changes because if lkb->lkb_wait_type is non zero implies that lkb->lkb_wait_count is non zero. However we should add the check as it does validate_unlock_args(). Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 1f4f10845e14690b02410de50d9ea9684625a4ae Author: Dan Carpenter Date: Mon Apr 4 16:06:28 2022 -0400 dlm: uninitialized variable on error in dlm_listen_for_all() The "sock" variable is not initialized on this error path. Cc: stable@vger.kernel.org Fixes: 2dc6b1158c28 ("fs: dlm: introduce generic listen") Signed-off-by: Dan Carpenter Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit e945c653c8e972d1b81a88e474d79f801b60213a Author: Jason Gunthorpe Date: Mon Apr 4 12:26:42 2022 -0300 RDMA: Split kernel-only global device caps from uverbs device caps Split out flags from ib_device::device_cap_flags that are only used internally to the kernel into kernel_cap_flags that is not part of the uapi. This limits the device_cap_flags to being the same bitmap that will be copied to userspace. This cleanly splits out the uverbs flags from the kernel flags to avoid confusion in the flags bitmap. Add some short comments describing which each of the kernel flags is connected to. Remove unused kernel flags. Link: https://lore.kernel.org/r/0-v2-22c19e565eef+139a-kern_caps_jgg@nvidia.com Reviewed-by: Christoph Hellwig Reviewed-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit ce3d4d7f33148ed70ddf5f243f1d76e12a8ee7cc Author: Casey Bowman Date: Wed Mar 30 16:48:09 2022 -0700 drm/i915: Require INTEL_GTT to depend on X86 The intel-gtt module is not used on other, non-x86 platforms, so we will restrict it to x86 platforms only. Signed-off-by: Casey Bowman Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220330234809.1218210-3-casey.g.bowman@intel.com commit 7a5c922377b41c008b6f20ecea788bf1d80e9ddb Author: Casey Bowman Date: Wed Mar 30 16:48:08 2022 -0700 drm/i915/gt: Split intel-gtt functions by arch Some functions defined in the intel-gtt module are used in several areas, but is only supported on x86 platforms. By separating these calls and their static underlying functions to another area, we are able to compile out these functions for non-x86 builds and provide stubs for the non-x86 implementations. In addition to the problematic calls, we are moving the gmch-related functions to the new area. Signed-off-by: Casey Bowman Acked-by: Tvrtko Ursulin Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220330234809.1218210-2-casey.g.bowman@intel.com commit 9b5a7f4a2a8dcda461f9c7a6671150f4a8a902e8 Author: Dave Hansen Date: Thu Mar 31 10:57:28 2022 -0700 x86/configs: Add x86 debugging Kconfig fragment plus docs The kernel has a wide variety of debugging options to help catch and squash bugs. However, new debugging is added all the time and the existing options can be hard to find. Add a Kconfig fragment with the debugging options which tip maintainers expect to be used to test contributions. This should make it easier for contributors to test their code and find issues before submission. [ bp: Add to "make help" output, fix DEBUG_INFO selection as pointed out by Nathan Chancellor . ] Signed-off-by: Dave Hansen Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220331175728.299103A0@davehans-spike.ostc.intel.com commit 9fc4476a08b6dc61e406c2c0c4e0690512f60e82 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 19 13:38:27 2022 +0530 selftests/bpf: Test for writes to map key from BPF helpers When invoking bpf_for_each_map_elem callback, we are passed a PTR_TO_MAP_KEY, previously writes to this through helper may be allowed, but the fix in previous patches is meant to prevent that case. The test case tries to pass it as writable memory to helper, and fails test if it succeeds to pass the verifier. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220319080827.73251-6-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 7cb29b1c99f4244c3f1de04e88eb9aed842a0cba Author: Kumar Kartikeya Dwivedi Date: Sat Mar 19 13:38:26 2022 +0530 selftests/bpf: Test passing rdonly mem to global func Add two test cases, one pass read only map value pointer to global func, which should be rejected. The same code checks it for kfunc, so that is covered as well. Second one tries to use the missing check for PTR_TO_MEM's MEM_RDONLY flag and tries to write to a read only memory pointer. Without prior patches, both of these tests fail. Reviewed-by: Hao Luo Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220319080827.73251-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 7b3552d3f9f6897851fc453b5131a967167e43c2 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 19 13:38:25 2022 +0530 bpf: Reject writes for PTR_TO_MAP_KEY in check_helper_mem_access It is not permitted to write to PTR_TO_MAP_KEY, but the current code in check_helper_mem_access would allow for it, reject this case as well, as helpers taking ARG_PTR_TO_UNINIT_MEM also take PTR_TO_MAP_KEY. Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220319080827.73251-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 97e6d7dab1ca4648821c790a2b7913d6d5d549db Author: Kumar Kartikeya Dwivedi Date: Sat Mar 19 13:38:24 2022 +0530 bpf: Check PTR_TO_MEM | MEM_RDONLY in check_helper_mem_access The commit being fixed was aiming to disallow users from incorrectly obtaining writable pointer to memory that is only meant to be read. This is enforced now using a MEM_RDONLY flag. For instance, in case of global percpu variables, when the BTF type is not struct (e.g. bpf_prog_active), the verifier marks register type as PTR_TO_MEM | MEM_RDONLY from bpf_this_cpu_ptr or bpf_per_cpu_ptr helpers. However, when passing such pointer to kfunc, global funcs, or BPF helpers, in check_helper_mem_access, there is no expectation MEM_RDONLY flag will be set, hence it is checked as pointer to writable memory. Later, verifier sets up argument type of global func as PTR_TO_MEM | PTR_MAYBE_NULL, so user can use a global func to get around the limitations imposed by this flag. This check will also cover global non-percpu variables that may be introduced in kernel BTF in future. Also, we update the log message for PTR_TO_BUF case to be similar to PTR_TO_MEM case, so that the reason for error is clear to user. Fixes: 34d3a78c681e ("bpf: Make per_cpu_ptr return rdonly PTR_TO_MEM.") Reviewed-by: Hao Luo Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220319080827.73251-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit be77354a3d7ebd4897ee18eca26dca6df9224c76 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 19 13:38:23 2022 +0530 bpf: Do write access check for kfunc and global func When passing pointer to some map value to kfunc or global func, in verifier we are passing meta as NULL to various functions, which uses meta->raw_mode to check whether memory is being written to. Since some kfunc or global funcs may also write to memory pointers they receive as arguments, we must check for write access to memory. E.g. in some case map may be read only and this will be missed by current checks. However meta->raw_mode allows for uninitialized memory (e.g. on stack), since there is not enough info available through BTF, we must perform one call for read access (raw_mode = false), and one for write access (raw_mode = true). Fixes: e5069b9c23b3 ("bpf: Support pointers in global func args") Fixes: d583691c47dc ("bpf: Introduce mem, size argument pair support for kfunc") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20220319080827.73251-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit ebaf24c589d7c714b763a80856d1a6df3ba25b84 Author: Artem Savkov Date: Wed Apr 6 10:54:08 2022 +0200 selftests/bpf: Use bpf_num_possible_cpus() in per-cpu map allocations bpf_map_value_size() uses num_possible_cpus() to determine map size, but some of the tests only allocate enough memory for online cpus. This results in out-of-bound writes in userspace during bpf(BPF_MAP_LOOKUP_ELEM) syscalls in cases when number of online cpus is lower than the number of possible cpus. Fix by switching from get_nprocs_conf() to bpf_num_possible_cpus() when determining the number of processors in these tests (test_progs/netcnt and test_cgroup_storage). Signed-off-by: Artem Savkov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220406085408.339336-1-asavkov@redhat.com commit a8d600f6bcd453f1807703b5a016212f5484ffa1 Author: Colin Ian King Date: Wed Apr 6 09:08:35 2022 +0100 libbpf: Fix spelling mistake "libaries" -> "libraries" There is a spelling mistake in a pr_warn message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220406080835.14879-1-colin.i.king@gmail.com commit 958ddfd75d83d83e713027677c8786781e1f4576 Author: Yuntao Wang Date: Wed Apr 6 08:36:22 2022 +0800 selftests/bpf: Fix issues in parse_num_list() The function does not check that parsing_end is false after parsing argument. Thus, if the final part of the argument is something like '4-', which is invalid, parse_num_list() will discard it instead of returning -EINVAL. Before: $ ./test_progs -n 2,4- #2 atomic_bounds:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED After: $ ./test_progs -n 2,4- Failed to parse test numbers. Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220406003622.73539-1-ytcoode@gmail.com commit 1963c740dc2b52f45ba3d3748a50a0ab35db098a Author: Lorenzo Bianconi Date: Sat Apr 2 16:19:14 2022 +0200 net: netfilter: Reports ct direction in CT lookup helpers for XDP and TC-BPF Report connection tracking tuple direction in bpf_skb_ct_lookup/bpf_xdp_ct_lookup helpers. Direction will be used to implement snat/dnat through xdp ebpf program. Signed-off-by: Lorenzo Bianconi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/aa1aaac89191cfc64078ecef36c0a48c302321b9.1648908601.git.lorenzo@kernel.org commit 59207e63801fbcd39ca68df6e2ba5ae90f76c0c3 Author: Imre Deak Date: Wed Mar 23 22:17:49 2022 +0200 drm/i915/adlp: Fix register corruption after DDI clock enabling Accessing the DDI_BUF_CTL register without the port's DDI clock being enabled (to set/clear the TypeC PHY ownership for the port) can lead to a corrupted value read during any i915 register access right after the DDI clock is enabled. The root cause is the way clock synchronization works for this register, controlled by the CHICKEN_DCPR_1 DDI_CLOCK_REG_ACCESS flag. Correctly this flag should be cleared on ADLP (see the Bspec link below), however after bootup the flag is set. One easily reproducible issue is an unclaimed register access of the PWR_WELL_CTL_DDI2 register, programmed right after DDI clock enabling to enable the port's DDI_IO power well (see the HSDES, VLK links below). With the correct setting above this problem can't be reproduced. Bspec: 49189 HSDES: 18019028154 VLK: 28328, 28655 Cc: Jouni Högander Cc: Arthur J Runyan Signed-off-by: Imre Deak Acked-by: Arthur J Runyan Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323201749.288566-1-imre.deak@intel.com commit 3225de1be4c57ab1371fa2f4717672abdbf98755 Author: Rui Miguel Silva Date: Thu Mar 31 16:45:34 2022 +0100 dt-bindings: net: smsc,lan91c111 convert to schema Convert the smsc lan91c9x and lan91c1xx controller device tree bindings documentation to json-schema. Signed-off-by: Rui Miguel Silva Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220331154536.1544220-2-rui.silva@linaro.org commit c900a670362be43258a4a2ab8c37d5f0da714487 Author: Casey Bowman Date: Thu Mar 31 13:43:43 2022 -0700 drm/i915: Split i915_run_as_guest into x86 and non-x86 Split i915_run_as_guest() into a more arch-friendly function as non-x86 builds do not support this functionality. Signed-off-by: Casey Bowman Acked-by: Tvrtko Ursulin Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220331204343.1256150-2-casey.g.bowman@intel.com commit 6ded3d7471d8bb01eb87ac2d506db7e8a839986a Author: Krzysztof Kozlowski Date: Wed Apr 6 18:00:07 2022 +0200 memory: emif: remove unneeded ENOMEM error messages Memory subsystem already prints message about failed memory allocation, there is no need to do it in the drivers. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220304082339.230938-1-krzysztof.kozlowski@canonical.com commit 805f04d42a6b5f4187935b43c9c39ae03ccfa761 Author: José Roberto de Souza Date: Tue Apr 5 08:53:44 2022 -0700 drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations Instead of exit PSR when a frontbuffer invalidation happens, we can enable the PSR2 selective fetch continuous full frame, that will keep the panel updated like PSR was disabled but without keeping PSR active. So as soon as the frontbuffer flush happens we can disable the continuous full frame and start to do selective fetches much quicker than the path that would enable PSR, that will wait a few frames to actually activate PSR. Also this approach has proven to fix some glitches found in Alderlake-P when there are a lot of invalidations happening together with page flips. Some may ask why it is writing to CURSURFLIVE(), it is because that is the way that hardware team provided us to poke display to handle PSR updates, and it is being used since display 9. v2: - handling possible race conditions between frontbuffer rendering and page flips Reviewed-by: Jouni Högander Cc: Khaled Almahallawy Cc: Shawn C Lee Cc: Jouni Högander Cc: Mika Kahola Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220405155344.47219-3-jose.souza@intel.com commit 3b6f409547fbeeae9381a1dd3473a2c9ea9e988a Author: José Roberto de Souza Date: Tue Apr 5 08:53:43 2022 -0700 drm/i915/display/psr: Lock and unlock PSR around pipe updates Frontbuffer rendering and page flips can race with each other and this can potentialy cause issues with PSR2 selective fetch. And because pipe/crtc updates are time sentive we can't grab the PSR lock after intel_pipe_update_start() and before intel_pipe_update_end(). So here adding the lock and unlock functions and calls, the proper PSR2 selective fetch handling will come in a separated patch. v2: - fixed new functions documentation Reviewed-by: Jouni Högander Cc: Jouni Högander Cc: Mika Kahola Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220405155344.47219-2-jose.souza@intel.com commit aa94bf3089f0502e611faaab608dca29fe3cce4a Author: José Roberto de Souza Date: Tue Apr 5 08:53:42 2022 -0700 drm/i915/display/psr: Set partial frame enable when forcing full frame fetch Following up what was done in commit 804f46885317 ("drm/i915/psr: Set "SF Partial Frame Enable" also on full update") and also setting partial frame enable when psr_force_hw_tracking_exit() is called. Also as PSR2_MAN_TRK_CTL is a double buffered registers do a RMW is not a good idea so here also setting the man_trk_ctl_enable_bit() that is required in TGL and only doing a register write. v2: - not doing a rmw v3: - removing the inline from functions that return PSR2_MAN_TRK_CTL bits Reviewed-by: Jouni Högander Cc: Jouni Högander Cc: Mika Kahola Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220405155344.47219-1-jose.souza@intel.com commit db85474594609fc6f6a37fe5d5001fa9341971ed Author: Krzysztof Kozlowski Date: Wed Apr 6 17:40:50 2022 +0200 dt-bindings: soc: samsung: usi: refer to dtschema for SPI After adding DT schema for Samsung SPI controller, the Samsung USI bindings can reference it directly for proper schema validation. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220324134106.103588-1-krzk@kernel.org commit c8d4c18bfbc4ab467188dbe45cc8155759f49d9e Author: Christian König Date: Tue Nov 16 15:20:45 2021 +0100 dma-buf/drivers: make reserving a shared slot mandatory v4 Audit all the users of dma_resv_add_excl_fence() and make sure they reserve a shared slot also when only trying to add an exclusive fence. This is the next step towards handling the exclusive fence like a shared one. v2: fix missed case in amdgpu v3: and two more radeon, rename function v4: add one more case to TTM, fix i915 after rebase Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220406075132.3263-2-christian.koenig@amd.com commit 824f37783189a48db914488fb41eba36ec57ebb7 Author: Michael Roth Date: Thu Feb 24 10:56:08 2022 -0600 x86/compressed/acpi: Move EFI kexec handling into common code Future patches for SEV-SNP-validated CPUID will also require early parsing of the EFI configuration. Incrementally move the related code into a set of helpers that can be re-used for that purpose. In this instance, the current acpi.c kexec handling is mainly used to get the alternative EFI config table address provided by kexec via a setup_data entry of type SETUP_EFI. If not present, the code then falls back to normal EFI config table address provided by EFI system table. This would need to be done by all call-sites attempting to access the EFI config table, so just have efi_get_conf_table() handle that automatically. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-29-brijesh.singh@amd.com commit dee602dd5d1489b5aa4651c561dfbe90eaee1589 Author: Michael Roth Date: Thu Feb 24 10:56:07 2022 -0600 x86/compressed/acpi: Move EFI vendor table lookup to helper Future patches for SEV-SNP-validated CPUID will also require early parsing of the EFI configuration. Incrementally move the related code into a set of helpers that can be re-used for that purpose. [ bp: Unbreak unnecessarily broken lines. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-28-brijesh.singh@amd.com commit 61c14ceda8405f37545a0983d6b9bc45c6236793 Author: Michael Roth Date: Thu Feb 24 10:56:06 2022 -0600 x86/compressed/acpi: Move EFI config table lookup to helper Future patches for SEV-SNP-validated CPUID will also require early parsing of the EFI configuration. Incrementally move the related code into a set of helpers that can be re-used for that purpose. [ bp: Remove superfluous zeroing of a stack variable. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-27-brijesh.singh@amd.com commit 58f3e6b71f42f99ab5d0ab26ddf6e7ee5631f5db Author: Michael Roth Date: Thu Feb 24 10:56:05 2022 -0600 x86/compressed/acpi: Move EFI system table lookup to helper Future patches for SEV-SNP-validated CPUID will also require early parsing of the EFI configuration. Incrementally move the related code into a set of helpers that can be re-used for that purpose. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-26-brijesh.singh@amd.com commit 7c4146e8885512719a50b641e9277a1712e052ff Author: Michael Roth Date: Wed Feb 9 12:10:18 2022 -0600 x86/compressed/acpi: Move EFI detection to helper Future patches for SEV-SNP-validated CPUID will also require early parsing of the EFI configuration. Incrementally move the related code into a set of helpers that can be re-used for that purpose. First, carve out the functionality which determines the EFI environment type the machine is booting on. [ bp: Massage commit message. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-25-brijesh.singh@amd.com commit 469693d8f62299709e8ba56d8fb3da9ea990213c Author: Michael Roth Date: Wed Feb 9 12:10:17 2022 -0600 x86/head/64: Re-enable stack protection Due to 103a4908ad4d ("x86/head/64: Disable stack protection for head$(BITS).o") kernel/head{32,64}.c are compiled with -fno-stack-protector to allow a call to set_bringup_idt_handler(), which would otherwise have stack protection enabled with CONFIG_STACKPROTECTOR_STRONG. While sufficient for that case, there may still be issues with calls to any external functions that were compiled with stack protection enabled that in-turn make stack-protected calls, or if the exception handlers set up by set_bringup_idt_handler() make calls to stack-protected functions. Subsequent patches for SEV-SNP CPUID validation support will introduce both such cases. Attempting to disable stack protection for everything in scope to address that is prohibitive since much of the code, like the SEV-ES #VC handler, is shared code that remains in use after boot and could benefit from having stack protection enabled. Attempting to inline calls is brittle and can quickly balloon out to library/helper code where that's not really an option. Instead, re-enable stack protection for head32.c/head64.c, and make the appropriate changes to ensure the segment used for the stack canary is initialized in advance of any stack-protected C calls. For head64.c: - The BSP will enter from startup_64() and call into C code (startup_64_setup_env()) shortly after setting up the stack, which may result in calls to stack-protected code. Set up %gs early to allow for this safely. - APs will enter from secondary_startup_64*(), and %gs will be set up soon after. There is one call to C code prior to %gs being setup (__startup_secondary_64()), but it is only to fetch 'sme_me_mask' global, so just load 'sme_me_mask' directly instead, and remove the now-unused __startup_secondary_64() function. For head32.c: - BSPs/APs will set %fs to __BOOT_DS prior to any C calls. In recent kernels, the compiler is configured to access the stack canary at %fs:__stack_chk_guard [1], which overlaps with the initial per-cpu '__stack_chk_guard' variable in the initial/"master" .data..percpu area. This is sufficient to allow access to the canary for use during initial startup, so no changes are needed there. [1] 3fb0fdb3bbe7 ("x86/stackprotector/32: Make the canary into a regular percpu variable") [ bp: Massage commit message. ] Suggested-by: Joerg Roedel #for 64-bit %gs set up Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-24-brijesh.singh@amd.com commit 0afb6b660a6b58cb336d1175ed687bf9525849a4 Author: Tom Lendacky Date: Mon Mar 7 15:33:32 2022 -0600 x86/sev: Use SEV-SNP AP creation to start secondary CPUs To provide a more secure way to start APs under SEV-SNP, use the SEV-SNP AP Creation NAE event. This allows for guest control over the AP register state rather than trusting the hypervisor with the SEV-ES Jump Table address. During native_smp_prepare_cpus(), invoke an SEV-SNP function that, if SEV-SNP is active, will set/override apic->wakeup_secondary_cpu. This will allow the SEV-SNP AP Creation NAE event method to be used to boot the APs. As a result of installing the override when SEV-SNP is active, this method of starting the APs becomes the required method. The override function will fail to start the AP if the hypervisor does not have support for AP creation. [ bp: Work in forgotten review comments. ] Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-23-brijesh.singh@amd.com commit 4df6836dbbdb6a00af5f9ab6233e33cec3a73961 Author: Michal Simek Date: Tue Mar 22 20:30:18 2022 +0530 spi: spi-cadence: Fix kernel-doc format for resume/suspend Kernel function name don't match with function name. Error log: drivers/spi/spi-cadence.c:661: warning: expecting prototype for cdns_spi_runtime_resume(). Prototype was for cnds_runtime_resume() instead drivers/spi/spi-cadence.c:690: warning: expecting prototype for cdns_spi_runtime_suspend(). Prototype was for cnds_runtime_suspend() instead Fixes: d36ccd9f7ea4 ("spi: cadence: Runtime pm adaptation") Signed-off-by: Michal Simek Signed-off-by: Amit Kumar Mahapatra Link: https://lore.kernel.org/r/20220322150018.12736-1-amit.kumar-mahapatra@xilinx.com Signed-off-by: Mark Brown commit 4917e54997b0c5fbf39a3bd574802a16fa705096 Author: Andy Shevchenko Date: Fri Mar 25 20:45:08 2022 +0200 regulator: rpi-panel-attiny: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove these assignment all at once. For the details one may look into the of_gpio_dev_init() implementation. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220325184508.45670-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 46bc0d98cf16cac4cb4f73b61a754e5be7148480 Author: Rex-BC Chen Date: Wed Apr 6 11:00:06 2022 +0800 dt-bindings: display: mediatek: revise enum to const There won't be more than 1 fallback for these bindings, so we modify them to use const instead of enum. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220406030009.2357-2-rex-bc.chen@mediatek.com/ Signed-off-by: Rex-BC Chen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit d17ecf443d8fdccf2e1674b1ac9d73bc9c9429c7 Author: Julia Lawall Date: Fri Mar 18 11:37:09 2022 +0100 csky: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Guo Ren commit 2c5d69b0a141e1e98febe3111e6f4fd8420493a5 Author: Miles Chen Date: Wed Mar 16 07:23:00 2022 +0800 drm/mediatek: Fix mtk_cec_mask() In current implementation, mtk_cec_mask() writes val into target register and ignores the mask. After talking to our hdmi experts, mtk_cec_mask() should read a register, clean only mask bits, and update (val | mask) bits to the register. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220315232301.2434-1-miles.chen@mediatek.com/ Fixes: 8f83f26891e1 ("drm/mediatek: Add HDMI support") Signed-off-by: Miles Chen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Cc: Zhiqiang Lin Cc: CK Hu Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 487dc3ca60e3e420d54bcc613cb49e8e85f34569 Author: Hongbin Wang Date: Tue Apr 5 22:06:34 2022 -0400 ip6_tunnel: Remove duplicate assignments There is a same action when the variable is initialized Signed-off-by: Hongbin Wang Signed-off-by: David S. Miller commit a5b116a0fa90d6d0e7af4f39199a6ae1f0afc9c7 Author: Jakub Kicinski Date: Tue Apr 5 21:15:48 2022 -0700 net: wan: remove the lanmedia (lmc) driver The driver for LAN Media WAN interfaces spews build warnings on microblaze. The virt_to_bus() calls discard the volatile keyword. The right thing to do would be to migrate this driver to a modern DMA API but it seems unlikely anyone is actually using it. There had been no fixes or functional changes here since the git era begun. Let's remove this driver, there isn't much changing in the APIs, if users come forward we can apologize and revert. Link: https://lore.kernel.org/all/20220321144013.440d7fc0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ Signed-off-by: Jakub Kicinski Acked-by: Arnd Bergmann Acked-by: Thomas Bogendoerfer Signed-off-by: David S. Miller commit 8d2aad983de2a332bf8c22798ab6799f06864fed Author: Lv Ruyi Date: Wed Apr 6 07:28:40 2022 +0000 drm/amd/dc: remove duplicate include 'dm_services.h' included in 'freesync,c' is duplicated, so remove one. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Alex Deucher commit 9bbcf182060842a652c30f63692c6b6a8eb54386 Author: Alex Deucher Date: Fri Apr 1 11:08:48 2022 -0400 drm/amdgpu/smu10: fix SoC/fclk units in auto mode SMU takes clock limits in Mhz units. socclk and fclk were using 10 khz units in some cases. Switch to Mhz units. Fixes higher than required SoC clocks. Fixes: 97cf32996c46d9 ("drm/amd/pm: Removed fixed clock in auto mode DPM") Reviewed-by: Paul Menzel Signed-off-by: Alex Deucher commit 60f6fe665e854f94486aac6251950d62b1356a48 Author: Dmytro Laktyushkin Date: Wed Mar 30 16:05:50 2022 -0400 drm/amd/display: update dcn315 clock table read [Why & How] Make dcn315 base its clock table off dcfclk rather than fclk. This change also adds some sanity checking to make sure an empty pmfw table does not result in invalid dal clocks. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit d1826081bb31f1ed5daa1ba5bb7f0daf51afc2a7 Author: Grigory Vasilyev Date: Tue Apr 5 02:33:04 2022 +0300 drm/amdgpu: Remove leftover igp_lane_info Variable igp_lane_info always is 0. 0 & any value = 0 and false. In this way, all сonditional statements will false. The code was leftover from when the code was ported from radeon where igp_lane_info was derived from the vbios on supported platforms. [update commit message - Alex] Signed-off-by: Grigory Vasilyev Signed-off-by: Alex Deucher commit b0778bb0afb10d36de47a435abdc4ca4ecfc3f89 Author: Tom Rix Date: Mon Apr 4 18:57:10 2022 -0400 drm/radeon: change si_default_state table from global to static Smatch reports these issues si_blit_shaders.c:31:11: warning: symbol 'si_default_state' was not declared. Should it be static? si_blit_shaders.c:253:11: warning: symbol 'si_default_size' was not declared. Should it be static? Both symbols are only used in si.c. Single file symbols should be static. So move the definition of si_default_state and si_default_size to si_blit_shader.h and change their storage-class-specifier to static. Remove unneeded si_blit_shader.c Reviewed-by: Christian König Signed-off-by: Tom Rix Signed-off-by: Alex Deucher commit fa458eb10dc7218146a84e6d2e072424e64d188a Author: Benjamin Marty Date: Wed Mar 23 22:08:26 2022 +0100 drm/amdgpu/display: change pipe policy for DCN 2.1 Fixes crash on MST Hub disconnect. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1849 Fixes: ee2698cf79cc ("drm/amd/display: Changed pipe split policy to allow for multi-display pipe split") Signed-off-by: Benjamin Marty Signed-off-by: Alex Deucher commit 69f0b547e68c27a2e432a2d0459915babf015cb3 Author: Guo Zhengkui Date: Fri Apr 1 10:59:29 2022 +0800 drm/radeon: simplify if-if to if-else Replace `if (!ret)` with `else` for simplification. Signed-off-by: Guo Zhengkui Signed-off-by: Alex Deucher commit 207d924dcf324fa4334938a38463aa0f1fcdc756 Author: Wang Qing Date: Wed Apr 6 02:17:03 2022 -0700 net: usb: remove duplicate assignment netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed, no need to repeat assignment. Signed-off-by: Wang Qing Signed-off-by: David S. Miller commit be8d9d05271c961dfe366793a3886f4bd6f39dca Author: Wang Qing Date: Wed Apr 6 02:17:26 2022 -0700 net: ethernet: xilinx: use of_property_read_bool() instead of of_get_property "little-endian" has no specific content, use more helper function of_property_read_bool() instead of of_get_property() Signed-off-by: Wang Qing Signed-off-by: David S. Miller commit 96621ca578dbadeb12bd190e0733cdc5c76899d8 Author: Philip Yang Date: Mon Apr 4 17:25:23 2022 -0400 drm/amdkfd: Add missing NULL check in svm_range_map_to_gpu bo_adev is NULL for system memory mapping to GPU. Fixes: 30671b44aa570a ("drm/amdgpu: fix TLB flushing during eviction") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 42457494b8d6ef90e9c63e66bf2df7fa53406d6b Author: Arnd Bergmann Date: Wed Mar 16 19:36:47 2022 +0100 drm/tegra: vic: Fix unused-function warnings The use of the old-style SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() macros requires function definitions to be hidden to avoid drivers/gpu/drm/tegra/vic.c:326:12: error: 'vic_runtime_suspend' defined but not used [-Werror=unused-function] 326 | static int vic_runtime_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/tegra/vic.c:292:12: error: 'vic_runtime_resume' defined but not used [-Werror=unused-function] 292 | static int vic_runtime_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~ Use the new-style SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() instead. Fixes: 1e15f5b911d6 ("drm/tegra: vic: Stop channel on suspend") Signed-off-by: Arnd Bergmann Signed-off-by: Thierry Reding commit 74bb98dd91106fcfd16aad852fafa5970a268427 Author: Jon Hunter Date: Fri Jan 14 14:04:53 2022 +0000 gpu: host1x: Show all allocated syncpts via debugfs When the host1x syncpts status is dumped via the debugfs, syncpts that have been allocated but not yet used are not shown and so currently it is not possible to see all the allocated syncpts. Update the path for dumping the syncpt status via the debugfs to show all allocated syncpts even if they have not been used yet. Note that when the syncpt status is dumped by the kernel itself for debugging only the active syncpt are shown. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit d5becc32308c31c6c88bfdf55c1ec8c537a8cdd1 Author: Julia Lawall Date: Fri Mar 18 11:37:03 2022 +0100 ARM: tegra: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Thierry Reding commit 71f69ffa0129bf04205edf0e7dc73dc4777b2588 Author: Ashish Singhal Date: Wed Mar 9 00:00:26 2022 +0530 arm64: tegra: Add QSPI controllers on Tegra234 This adds the QSPI controllers on the Tegra234 SoC and populates the SPI NOR flash device for the Jetson AGX Orin platform. Signed-off-by: Ashish Singhal Signed-off-by: Jon Hunter Signed-off-by: Krishna Yarlagadda Reviewed-by: Jon Hunter Acked-by: Rob Herring Signed-off-by: Thierry Reding commit cc93a1a1f74c20528aead8be33fadb4d893f766a Merge: 7704a82e271ad 0d463d016000d Author: Mark Brown Date: Wed Apr 6 14:23:49 2022 +0100 ASoC: Add a driver for the Cirrus Logic CS35L45 Smart Amplifier Merge series from Richard Fitzgerald : This adds basic audio support for the Cirrus Logic CS35L45 amplifier. The first two patches add two generic helpers to ASoC, and patch 3 is a kunit test for patch 2. commit 5472b7df7c795352f73e9dfa68c6e5eb5db7fac8 Author: Peng Fan Date: Fri Feb 25 17:00:01 2022 +0800 arm64: dts: imx8mq: add hdmi phy 27m clock The i.MX8MQ PLL support hdmi phy 27m as pll reference clock, so add a fixed clock for it. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Signed-off-by: Shawn Guo commit 20b734c11243ecf97030345b51ff37fcb7dd060f Author: Sui Jingfeng <15330273260@189.cn> Date: Wed Apr 6 15:30:36 2022 +0800 drm/drm_modeset_helper_vtables.h: fix a typo change upate to update Signed-off-by: Sui Jingfeng <15330273260@189.cn> Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220406073036.276288-1-15330273260@189.cn commit 7ac853ba789d1d9fb22b05f4ebd3a37fd1bb11c1 Author: Aniruddha Rao Date: Wed Mar 16 15:14:45 2022 +0530 arm64: tegra: Update SDMMC1/3 clock source for Tegra194 The default parent for SDMMC1/3 clock sources can provide maximum frequency of 136MHz for SDR104 mode. Update parent clock source for SDMMC1/SDMMC3 instances to increase the output clock frequency to 195MHz and improve the perf. Signed-off-by: Aniruddha Rao Signed-off-by: Thierry Reding commit bc046b952a5494b0dc53be28779460cee1214a3f Author: Michael Walle Date: Thu Feb 24 11:30:30 2022 +0100 arm64: dts: imx8mn-evk: fix the min/max voltages of the PMIC Use the proper voltages as supported by the board instead of the ones supported by the PMIC. The voltages were taken from both the schematic of the 8MNANOLPD4-EVK eval board and the datasheet of the IMX8MN SoC. Signed-off-by: Michael Walle Reviewed-by: Heiko Thiery Signed-off-by: Shawn Guo commit 1cfa1e68af8d40ab233d5d27bc8446e4c5107571 Author: Michael Walle Date: Thu Feb 24 11:30:29 2022 +0100 arm64: dts: imx8mn-evk: use proper names for PMIC outputs Use the power signal names as given in the schematics of the reference board. Signed-off-by: Michael Walle Reviewed-by: Heiko Thiery Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3454f01abfa05a9534c841f87b22d3826cedcff4 Author: Maxime Ripard Date: Thu Mar 31 16:37:44 2022 +0200 drm/vc4: hvs: Use pointer to HVS in HVS_READ and HVS_WRITE macros Those macros are really about the HVS itself, and thus its associated structure vc4_hvs, rather than the entire (virtual) vc4 device. Let's change those macros to use the hvs pointer directly, and change the calling sites accordingly. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-8-maxime@cerno.tech commit d65661ace1880d6c0d4a34770c7b0d54e7675534 Author: Maxime Ripard Date: Thu Mar 31 16:37:43 2022 +0200 drm/vc4: kms: Ignore atomic_flush if we're disabled atomic_flush will be called for each CRTC even if they aren't enabled. The whole code we have there will thus run without a properly affected channel, which can then result in all sorts of weird behaviour. Fortunately, the DRM_PLANE_COMMIT_ACTIVE_ONLY flag will skip the CRTC atomic_begin and atomic_flush, and the planes atomic_update, if they aren't enabled. Our plane atomic_update is a nop, and atomic_begin will copy the current HVS channel to the vc4_crtc structure for the interrupt handler to consume, but the handler won't run if the CRTC is disabled. So in the end, it will only skip our CRTC atomic_flush, which is what we want. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-7-maxime@cerno.tech commit 4dfcaa09164eabe7c141e74c7bc34add0fea360c Author: Maxime Ripard Date: Thu Mar 31 16:37:42 2022 +0200 drm/vc4: hvs: Move the dlist setup to its own function The vc4_hvs_update_dlist function mostly deals with setting up the vblank events and setting up the dlist entry pointer to our current active one. We'll want to do the former separately from the vblank handling in later patches, so let's move it to a function of its own. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-6-maxime@cerno.tech commit a7609858bfcd6a700853f669719764991ac15120 Author: Maxime Ripard Date: Thu Mar 31 16:37:41 2022 +0200 drm/vc4: hvs: Remove dlist setup duplication Setting the DISPLISTx register needs to occur in every case, and we don't need to protect the register using the event_lock, so we can just move it after the if branches and simplify a bit the function. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-5-maxime@cerno.tech commit e418639d19f5f3d4dbc541fd3d40f921f202d356 Author: Maxime Ripard Date: Thu Mar 31 16:37:40 2022 +0200 drm/vc4: hvs: Store channel in variable The assigned_channel field of our vc4_crtc_state structure is accessed multiple times in vc4_hvs_atomic_flush, so let's move it to a variable that can be used in all those places. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-4-maxime@cerno.tech commit b51cd7ad143d2eb31a6df81c2183128920e47c2b Author: Maxime Ripard Date: Thu Mar 31 16:37:39 2022 +0200 drm/vc4: hvs: Fix frame count register readout In order to get the field currently being output, the driver has been using the display FIFO frame count in the HVS, reading a 6-bit field at the offset 12 in the DISPSTATx register. While that field is indeed at that location for the FIFO 1 and 2, the one for the FIFO0 is actually in the DISPSTAT1 register, at the offset 18. Fixes: e538092cb15c ("drm/vc4: Enable precise vblank timestamping for interlaced modes.") Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-3-maxime@cerno.tech commit 748acfc98adab21a93ae7a1b5bed0f048463e873 Author: Maxime Ripard Date: Thu Mar 31 16:37:38 2022 +0200 drm/vc4: kms: Take old state core clock rate into account During a commit, the core clock, which feeds the HVS, needs to run at a minimum of 500MHz. While doing that commit, we can also change the mode to one that requires a higher core clock, so we take the core clock rate associated to that new state into account for that boost. However, the old state also needs to be taken into account if it requires a core clock higher that the new one and our 500MHz limit, since it's still live in hardware at the beginning of our commit. Fixes: 16e101051f32 ("drm/vc4: Increase the core clock based on HVS load") Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220331143744.777652-2-maxime@cerno.tech commit 3e9c4584336149146fe15cb5703fc10a2ca2d2a0 Author: Thierry Reding Date: Thu Mar 24 11:30:25 2022 +0100 gpu: host1x: Do not use mapping cache for job submissions Buffer mappings used in job submissions are usually small and not rapidly reused as opposed to framebuffers (which are usually large and rapidly reused, for example when page-flipping between double-buffered framebuffers). Avoid going through the mapping cache for these buffers since the cache would also lead to leaks if nobody is ever releasing the cache's last reference. For DRM/KMS these last references are dropped when the framebuffers are removed and therefore no longer needed. While at it, also add a note about the need to explicitly remove the final reference to the mapping in the cache. Reviewed-by: Jon Hunter Tested-by: Jon Hunter Signed-off-by: Thierry Reding commit f90e5a3d5b8c6069505eb216884efd0f08fe4bea Merge: 44ec5f71a035e 33fc42de33278 Author: David S. Miller Date: Wed Apr 6 14:08:52 2022 +0100 Merge branch 'mtk_eth_soc-flo-offload-plus-wireless' Felix Fietkau says: ==================== MediaTek SoC flow offload improvements + wireless support This series contains the following improvements to mediatek ethernet flow offload support: - support dma-coherent on ethernet to improve performance - add ipv6 offload support - rework hardware flow table entry handling to improve dealing with hash collisions and competing flows - support creating offload entries from user space - support creating offload entries with just source/destination mac address, vlan and output device information - add driver changes for supporting the Wireless Ethernet Dispatch core, which can be used to offload flows from ethernet to MT7915 PCIe WLAN devices Changes in v2: - add missing dt-bindings patches ==================== Signed-off-by: David S. Miller commit 33fc42de33278b2b3ec6f3390512987bc29a62b7 Author: Felix Fietkau Date: Tue Apr 5 21:57:55 2022 +0200 net: ethernet: mtk_eth_soc: support creating mac address based offload entries This will be used to implement a limited form of bridge offloading. Since the hardware does not support flow table entries with just source and destination MAC address, the driver has to emulate it. The hardware automatically creates entries entries for incoming flows, even when they are bridged instead of routed, and reports when packets for these flows have reached the minimum PPS rate for offloading. After this happens, we look up the L2 flow offload entry based on the MAC header and fill in the output routing information in the flow table. The dynamically created per-flow entries are automatically removed when either the hardware flowtable entry expires, is replaced, or if the offload rule they belong to is removed Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 8ff25d377445dcc587584b7c0228bf0eafb26f9f Author: Felix Fietkau Date: Tue Apr 5 21:57:54 2022 +0200 net: ethernet: mtk_eth_soc: remove bridge flow offload type entry support According to MediaTek, this feature is not supported in current hardware Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit c4f033d9e03e99fb024b2300d61e099aa7646bb7 Author: Felix Fietkau Date: Tue Apr 5 21:57:53 2022 +0200 net: ethernet: mtk_eth_soc: rework hardware flow table management The hardware was designed to handle flow detection and creation of flow entries by itself, relying on the software primarily for filling in egress routing information. When there is a hash collision between multiple flows, this allows the hardware to maintain the entry for the most active flow. Additionally, the hardware only keeps offloading active for entries with at least 30 packets per second. With this rework, the code no longer creates a hardware entries directly. Instead, the hardware entry is only created when the PPE reports a matching unbound flow with the minimum target rate. In order to reduce CPU overhead, looking for flows belonging to a hash entry is rate limited to once every 100ms. This rework is also used as preparation for emulating bridge offload by managing L4 offload entries on demand. Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 1ccc723b5829d63a29627e1d2de2da84efd037c2 Author: Felix Fietkau Date: Tue Apr 5 21:57:52 2022 +0200 net: ethernet: mtk_eth_soc: allocate struct mtk_ppe separately Preparation for adding more data to it, which will increase its size. Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit bb14c19122b768c3d659da2e91fb9324a2374d06 Author: Felix Fietkau Date: Tue Apr 5 21:57:51 2022 +0200 net: ethernet: mtk_eth_soc: support TC_SETUP_BLOCK for PPE offload This allows offload entries to be created from user space Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 817b2fdf166766b462a034a8cc87d0b53c0054ec Author: David Bentham Date: Tue Apr 5 21:57:50 2022 +0200 net: ethernet: mtk_eth_soc: add ipv6 flow offload support Add the missing IPv6 flow offloading support for routing only. Hardware flow offloading is done by the packet processing engine (PPE) of the Ethernet MAC and as it doesn't support mangling of IPv6 packets, IPv6 NAT cannot be supported. Signed-off-by: David Bentham Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit e9b65ecb7c3050dd34ee22ce17f1cf95e8405b15 Author: Felix Fietkau Date: Tue Apr 5 21:57:49 2022 +0200 arm64: dts: mediatek: mt7622: introduce nodes for Wireless Ethernet Dispatch Introduce wed0 and wed1 nodes in order to enable offloading forwarding between ethernet and wireless devices on the mt7622 chipset. Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit a333215e10cb5d3b1e0685ca117f0e9452215485 Author: Felix Fietkau Date: Tue Apr 5 21:57:48 2022 +0200 net: ethernet: mtk_eth_soc: implement flow offloading to WED devices This allows hardware flow offloading from Ethernet to WLAN on MT7622 SoC Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 804775dfc2885e93a0a4b35db1914c2cc25172b5 Author: Felix Fietkau Date: Tue Apr 5 21:57:47 2022 +0200 net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED) The Wireless Ethernet Dispatch subsystem on the MT7622 SoC can be configured to intercept and handle access to the DMA queues and PCIe interrupts for a MT7615/MT7915 wireless card. It can manage the internal WDMA (Wireless DMA) controller, which allows ethernet packets to be passed from the packet switch engine (PSE) to the wireless card, bypassing the CPU entirely. This can be used to implement hardware flow offloading from ethernet to WLAN. Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit f14ac41b785f231573fe935a2eb5aaf737447f0c Author: Lorenzo Bianconi Date: Tue Apr 5 21:57:46 2022 +0200 dt-bindings: arm: mediatek: document the pcie mirror node on MT7622 This patch adds the pcie mirror document bindings for MT7622 SoC. The feature is used for intercepting PCIe MMIO access for the WED core Add related info in mediatek-net bindings. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 55c1c4e945fa98a91fac699914c4b456e63d8fad Author: Lorenzo Bianconi Date: Tue Apr 5 21:57:45 2022 +0200 dt-bindings: arm: mediatek: document WED binding for MT7622 Document the binding for the Wireless Ethernet Dispatch core on the MT7622 SoC, which is used for Ethernet->WLAN offloading Add related info in mediatek-net bindings. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 3abd063019b6a01762f9fccc39505f29d029360a Author: Felix Fietkau Date: Tue Apr 5 21:57:44 2022 +0200 arm64: dts: mediatek: mt7622: add support for coherent DMA It improves performance by eliminating the need for a cache flush on rx and tx Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit d776a57e4a284b33bc839687afe9c381f3577eee Author: Felix Fietkau Date: Tue Apr 5 21:57:43 2022 +0200 net: ethernet: mtk_eth_soc: add support for coherent DMA It improves performance by eliminating the need for a cache flush on rx and tx In preparation for supporting WED (Wireless Ethernet Dispatch), also add a function for disabling coherent DMA at runtime. Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit 1dafd0d607032ac3cdb7f6298342b93b9dc7b3e1 Author: Lorenzo Bianconi Date: Tue Apr 5 21:57:42 2022 +0200 dt-bindings: net: mediatek: add optional properties for the SoC ethernet core Introduce dma-coherent, cci-control and hifsys optional properties to the mediatek ethernet controller bindings Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: David S. Miller commit fe696ccb277d332dc4e625b5b20b988b04d16c04 Author: Randy Dunlap Date: Sun Apr 3 15:53:54 2022 -0700 gpu: host1x: Fix a kernel-doc warning Add @cache description to eliminate a kernel-doc warning. include/linux/host1x.h:104: warning: Function parameter or member 'cache' not described in 'host1x_client' Fixes: 1f39b1dfa53c ("drm/tegra: Implement buffer object cache") Signed-off-by: Randy Dunlap Cc: Thierry Reding Cc: linux-tegra@vger.kernel.org Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Thierry Reding commit 8bcbcbba9109d6e26029c089826b708164a2cb12 Author: Andrej Picej Date: Tue Feb 22 10:16:06 2022 +0100 ARM: dts: imx6ul: peb-av-02: move to 3 cell pwm Instead of changing default pwm-cells property, use the default "#pwm-cells = <3>" and add the third option. Signed-off-by: Andrej Picej Signed-off-by: Shawn Guo commit 0b08af343ab0b2dc53f34e7b2c7b98562b60cc93 Author: Alexander Bauer Date: Tue Feb 22 10:16:05 2022 +0100 ARM: dts: imx6ull: Add support for PHYTEC phyGATE-Tauri-S with i.MX 6ULL Add support for the PHYTEC phyGATE-Tauri-S with i.MX 6ULL with eMMC or NAND. Supported features: * eMMC/NAND * i2c RTC * i2c TEMP * PMIC * PWM * debug UART * CAN * SD card * 2x 1Gbit Ethernet * RS232/RS485 * USB 2.0 Host * TPM * SPI-NOR Signed-off-by: Alexander Bauer Signed-off-by: Jens Lang Signed-off-by: Andrej Picej Signed-off-by: Shawn Guo commit 44ec5f71a035ec736c2c59f1ef75ce70cff570d7 Merge: 1ee375d77bb94 bb2a1934ca01d Author: David S. Miller Date: Wed Apr 6 14:04:17 2022 +0100 Merge branch 'mscc-miim' Michael Walle says: ==================== net: phy: mscc-miim: add MDIO bus frequency support Introduce MDIO bus frequency support. This way the board can have a faster (or maybe slower) bus frequency than the hardware default. changes since v2: - resend, no RFC anymore, because net-next is open again ==================== Signed-off-by: David S. Miller commit bb2a1934ca01d32ab7d8d109e574682199725afd Author: Michael Walle Date: Tue Apr 5 14:09:51 2022 +0200 net: phy: mscc-miim: add support to set MDIO bus frequency Until now, the MDIO bus will have the hardware default bus frequency. Read the desired frequency of the bus from the device tree and configure it. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b0385d4c1fffe0152eabf4f20ff5f937524e9398 Author: Michael Walle Date: Tue Apr 5 14:09:50 2022 +0200 dt-bindings: net: mscc-miim: add clock and clock-frequency Add the (optional) clock input of the MDIO controller and indicate that the common clock-frequency property is supported. The driver can use it to set the desired MDIO bus frequency. Signed-off-by: Michael Walle Acked-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit ed941f65da8166a0ffb82fec30ac331f348fb4d1 Author: Michael Walle Date: Tue Apr 5 14:09:49 2022 +0200 dt-bindings: net: convert mscc-miim to YAML format Convert the mscc-miim device tree binding to the new YAML format. The original binding don't mention if the interrupt property is optional or not. But on the SparX-5 SoC, for example, the interrupt property isn't used, thus in the new binding that property is optional. FWIW the driver doesn't use interrupts at all. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit d3ed7526543db9d26341b9df97064b332262b626 Author: Sandipan Patra Date: Fri Apr 1 20:03:43 2022 +0530 soc/tegra: pmc: Update Tegra234 reset sources Update the tegra234_reset_sources array to contain all reset sources for Tegra234 and NULL out the entries that do not actually exist. Signed-off-by: Sandipan Patra Reviewed-by: Andy Shevchenko Signed-off-by: Thierry Reding commit cbff1ae6bf3b9ecf0f4bf6afc509ce4b9aa70191 Author: Alexander Stein Date: Tue Feb 22 08:09:45 2022 +0100 ARM: dts: imx6ull: add TQ-Systems MBa6ULLxL device trees Add device trees for the MBa6ULx mainboard with TQMa6ULLxL SoMs. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 05c44ed0b776170fdf031080463cb5abd62cbed8 Author: Alexander Stein Date: Tue Feb 22 08:09:44 2022 +0100 ARM: dts: imx6ull: add TQ-Systems MBa6ULLx device trees Add device trees for the MBa6ULx mainboard with TQMa6ULLx SoMs. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit a333f3e46d76ecbe1cb8337fade76ee0d8514a8a Author: Alexander Stein Date: Tue Feb 22 08:09:43 2022 +0100 ARM: dts: imx6ul: add TQ-Systems MBa6ULxL device trees Add device trees for the MBa6ULx mainboard with TQMa6ULxL SoMs. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 7b8861d8e6279a27873b85e3786fba8706fde7c9 Author: Alexander Stein Date: Tue Feb 22 08:09:42 2022 +0100 ARM: dts: imx6ul: add TQ-Systems MBa6ULx device trees Add device trees for the MBa6ULx mainboard with TQMa6ULx SoMs. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 942501661fa65f13bf9b5582e8248e92770b2d93 Author: Sagar Kamble Date: Thu Mar 24 17:38:48 2022 +0530 soc/tegra: fuse: Add nvmem cell lookup entries for Tegra194 Add nvmem cell lookup entries for below FUSE cells: - gcplex-config-fuse - pdi0 - pdi1 Also include the device name prefix "gpu-" in the names of the GPU FUSE cells in nvmem_cell_info. Signed-off-by: Sagar Kamble Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 1c6add99c2bf1b19175e80826534b025c967afdd Author: Oleksij Rempel Date: Wed Feb 16 08:49:27 2022 +0100 arm64: dts: imx8mm-kontron: fix ethernet node name The node name of Ethernet controller should be "ethernet" instead of "usbether" as required by Ethernet controller devicetree schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml This patch can potentially affect boot loaders patching against full node path instead of using device aliases. Signed-off-by: Oleksij Rempel Acked-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 1ee375d77bb944321c969b456aa73994566cecf6 Author: Nick Desaulniers Date: Mon Apr 4 10:54:47 2022 -0700 net, uapi: remove inclusion of arpa/inet.h In include/uapi/linux/tipc_config.h, there's a comment that it includes arpa/inet.h for ntohs; but ntohs is not defined in any UAPI header. For now, reuse the definitions from include/linux/byteorder/generic.h, since the various conversion functions do exist in UAPI headers: include/uapi/linux/byteorder/big_endian.h include/uapi/linux/byteorder/little_endian.h We would like to get to the point where we can build UAPI header tests with -nostdinc, meaning that kernel UAPI headers should not have a circular dependency on libc headers. Link: https://android-review.googlesource.com/c/platform/bionic/+/2048127 Suggested-by: Jakub Kicinski Signed-off-by: Nick Desaulniers Signed-off-by: David S. Miller commit f4b41f062c424209e3939a81e6da022e049a45f2 Author: Oliver Hartkopp Date: Mon Apr 4 18:30:22 2022 +0200 net: remove noblock parameter from skb_recv_datagram() skb_recv_datagram() has two parameters 'flags' and 'noblock' that are merged inside skb_recv_datagram() by 'flags | (noblock ? MSG_DONTWAIT : 0)' As 'flags' may contain MSG_DONTWAIT as value most callers split the 'flags' into 'flags' and 'noblock' with finally obsolete bit operations like this: skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MSG_DONTWAIT, &rc); And this is not even done consistently with the 'flags' parameter. This patch removes the obsolete and costly splitting into two parameters and only performs bit operations when really needed on the caller side. One missing conversion thankfully reported by kernel test robot. I missed to enable kunit tests to build the mctp code. Reported-by: kernel test robot Signed-off-by: Oliver Hartkopp Signed-off-by: David S. Miller commit 92bbf95df7683d3ab1ab1aa3aaa029c5c5870591 Author: Meng Tang Date: Wed Apr 6 09:54:44 2022 +0800 ipw2x00: use DEVICE_ATTR_*() macro Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Meng Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220406015444.14408-1-tangmeng@uniontech.com commit 3223e922ccf8b5c3dd0b05faeaba407655ee0774 Author: Christophe Leroy Date: Sat Apr 2 12:10:37 2022 +0200 orinoco: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/4e3bfd4ffe2ed6b713ddd99b69dcc3d96adffe34.1648833427.git.christophe.leroy@csgroup.eu commit e8366bbabe1d207cf7c5b11ae50e223ae6fc278b Author: Haowen Bai Date: Fri Apr 1 15:10:54 2022 +0800 ipw2x00: Fix potential NULL dereference in libipw_xmit() crypt and crypt->ops could be null, so we need to checking null before dereference Signed-off-by: Haowen Bai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1648797055-25730-1-git-send-email-baihaowen@meizu.com commit 11800d893b38e0e12d636c170c1abc19c43c730c Author: Haowen Bai Date: Fri Mar 25 18:15:15 2022 +0800 b43: Fix assigning negative value to unsigned variable fix warning reported by smatch: drivers/net/wireless/broadcom/b43/phy_n.c:585 b43_nphy_adjust_lna_gain_table() warn: assigning (-2) to unsigned variable '*(lna_gain[0])' Signed-off-by: Haowen Bai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1648203315-28093-1-git-send-email-baihaowen@meizu.com commit 3f6b867559b3d43a7ce1b4799b755e812fc0d503 Author: Haowen Bai Date: Fri Mar 25 18:17:13 2022 +0800 b43legacy: Fix assigning negative value to unsigned variable fix warning reported by smatch: drivers/net/wireless/broadcom/b43legacy/phy.c:1181 b43legacy_phy_lo_b_measure() warn: assigning (-772) to unsigned variable 'fval' Signed-off-by: Haowen Bai Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1648203433-8736-1-git-send-email-baihaowen@meizu.com commit bd917b3d28c9815e2c55b9ff16680fdc2ba28d68 Author: Chris Chiu Date: Fri Mar 25 11:57:35 2022 +0800 rtl8xxxu: fill up txrate info for gen1 chips RTL8188CUS/RTL8192CU(gen1) don't support rate adaptive report hence no real txrate info can be retrieved. The vendor driver reports the highest rate in HT capabilities from the IEs to avoid empty txrate. This commit initiates the txrate information with the highest supported rate negotiated with AP. The gen2 chip keeps update the txrate from the rate adaptive reports, and gen1 chips at least have non-NULL txrate after associated. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325035735.4745-3-chris.chiu@canonical.com commit 21338c5bdeb969bfb2d78bd06a71a40b9a82a51e Author: Chris Chiu Date: Fri Mar 25 11:57:34 2022 +0800 rtl8xxxu: feed antenna information for cfg80211 Fill up the available TX/RX antenna so the iw commands can show correct antenna information for different chips. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325035735.4745-2-chris.chiu@canonical.com commit a0ff2a87194a968b9547fd4d824a09092171d1ea Author: Jakob Koschel Date: Thu Mar 24 08:21:24 2022 +0100 rtlwifi: 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/ Signed-off-by: Jakob Koschel Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220324072124.62458-1-jakobkoschel@gmail.com commit 92cadedd9d5f4355d8ca2765f2259708f0e5592c Author: Ulf Hansson Date: Wed Mar 23 09:39:50 2022 +0100 brcmfmac: Avoid keeping power to SDIO card unless WOWL is used Keeping the power to the SDIO card during system wide suspend, consumes energy. Especially on battery driven embedded systems, this can be a problem. Therefore, let's change the behaviour into allowing the SDIO card to be powered off, unless WOWL is supported and enabled. Note that, the downside from this change, is that during system resume the SDIO card needs to be re-initialized and the FW must be re-programmed. Even if this may take some time to complete, it should we worth it, rather than draining the battery. Signed-off-by: Ulf Hansson Tested-by: Christophe Roullier Reviewed-by: Yann Gautier Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220323083950.414783-1-ulf.hansson@linaro.org commit 3e12968f6d12a34b540c39cbd696a760cc4616f0 Author: Niels Dossche Date: Mon Mar 21 23:55:16 2022 +0100 mwifiex: add mutex lock for call in mwifiex_dfs_chan_sw_work_queue cfg80211_ch_switch_notify uses ASSERT_WDEV_LOCK to assert that net_device->ieee80211_ptr->mtx (which is the same as priv->wdev.mtx) is held during the function's execution. mwifiex_dfs_chan_sw_work_queue is one of its callers, which does not hold that lock, therefore violating the assertion. Add a lock around the call. Disclaimer: I am currently working on a static analyser to detect missing locks. This was a reported case. I manually verified the report by looking at the code, so that I do not send wrong information or patches. After concluding that this seems to be a true positive, I created this patch. However, as I do not in fact have this particular hardware, I was unable to test it. Reviewed-by: Brian Norris Signed-off-by: Niels Dossche Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220321225515.32113-1-dossche.niels@gmail.com commit dc3f3d2474b80eaee8be89f4c5eb344f10648f42 Author: Brijesh Singh Date: Thu Feb 24 10:56:01 2022 -0600 x86/mm: Validate memory when changing the C-bit Add the needed functionality to change pages state from shared to private and vice-versa using the Page State Change VMGEXIT as documented in the GHCB spec. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-22-brijesh.singh@amd.com commit 9704c07bf9f7682a83aec4e66f2d9154dbd8577f Author: Brijesh Singh Date: Wed Feb 9 12:10:14 2022 -0600 x86/kernel: Validate ROM memory before accessing when SEV-SNP is active probe_roms() accesses the memory range (0xc0000 - 0x10000) to probe various ROMs. The memory range is not part of the E820 system RAM range. The memory range is mapped as private (i.e encrypted) in the page table. When SEV-SNP is active, all the private memory must be validated before accessing. The ROM range was not part of E820 map, so the guest BIOS did not validate it. An access to invalidated memory will cause a exception yet, so validate the ROM memory regions before it is accessed. [ bp: Massage commit message. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-21-brijesh.singh@amd.com commit efac0eedfab515e523cde5cb7a62289eb2ee58f8 Author: Brijesh Singh Date: Wed Feb 9 12:10:13 2022 -0600 x86/kernel: Mark the .bss..decrypted section as shared in the RMP table The encryption attribute for the .bss..decrypted section is cleared in the initial page table build. This is because the section contains the data that need to be shared between the guest and the hypervisor. When SEV-SNP is active, just clearing the encryption attribute in the page table is not enough. The page state needs to be updated in the RMP table. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-20-brijesh.singh@amd.com commit 5e5ccff60a2977142d39b987a8b90e422d9fc634 Author: Brijesh Singh Date: Wed Feb 9 12:10:12 2022 -0600 x86/sev: Add helper for validating pages in early enc attribute changes early_set_memory_{encrypted,decrypted}() are used for changing the page state from decrypted (shared) to encrypted (private) and vice versa. When SEV-SNP is active, the page state transition needs to go through additional steps. If the page is transitioned from shared to private, then perform the following after the encryption attribute is set in the page table: 1. Issue the page state change VMGEXIT to add the page as a private in the RMP table. 2. Validate the page after its successfully added in the RMP table. To maintain the security guarantees, if the page is transitioned from private to shared, then perform the following before clearing the encryption attribute from the page table. 1. Invalidate the page. 2. Issue the page state change VMGEXIT to make the page shared in the RMP table. early_set_memory_{encrypted,decrypted}() can be called before the GHCB is setup so use the SNP page state MSR protocol VMGEXIT defined in the GHCB specification to request the page state change in the RMP table. While at it, add a helper snp_prep_memory() which will be used in probe_roms(), in a later patch. [ bp: Massage commit message. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-19-brijesh.singh@amd.com commit 95d33bfaa3e169cfec1926e0d0f0c6b0ea75d763 Author: Brijesh Singh Date: Wed Feb 9 12:10:11 2022 -0600 x86/sev: Register GHCB memory when SEV-SNP is active The SEV-SNP guest is required by the GHCB spec to register the GHCB's Guest Physical Address (GPA). This is because the hypervisor may prefer that a guest uses a consistent and/or specific GPA for the GHCB associated with a vCPU. For more information, see the GHCB specification section "GHCB GPA Registration". [ bp: Cleanup comments. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-18-brijesh.singh@amd.com commit 87294bdb7b4b73555b0fba45da1cdecdc6a0d5a8 Author: Brijesh Singh Date: Wed Feb 9 12:10:10 2022 -0600 x86/compressed: Register GHCB memory when SEV-SNP is active The SEV-SNP guest is required by the GHCB spec to register the GHCB's Guest Physical Address (GPA). This is because the hypervisor may prefer that a guest use a consistent and/or specific GPA for the GHCB associated with a vCPU. For more information, see the GHCB specification section "GHCB GPA Registration". If hypervisor can not work with the guest provided GPA then terminate the guest boot. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-17-brijesh.singh@amd.com commit 4f9c403e44e5e88feb27d5e617d1adc9cc7ef684 Author: Brijesh Singh Date: Wed Feb 9 12:10:09 2022 -0600 x86/compressed: Add helper for validating pages in the decompression stage Many of the integrity guarantees of SEV-SNP are enforced through the Reverse Map Table (RMP). Each RMP entry contains the GPA at which a particular page of DRAM should be mapped. The VMs can request the hypervisor to add pages in the RMP table via the Page State Change VMGEXIT defined in the GHCB specification. Inside each RMP entry is a Validated flag; this flag is automatically cleared to 0 by the CPU hardware when a new RMP entry is created for a guest. Each VM page can be either validated or invalidated, as indicated by the Validated flag in the RMP entry. Memory access to a private page that is not validated generates a #VC. A VM must use the PVALIDATE instruction to validate a private page before using it. To maintain the security guarantee of SEV-SNP guests, when transitioning pages from private to shared, the guest must invalidate the pages before asking the hypervisor to change the page state to shared in the RMP table. After the pages are mapped private in the page table, the guest must issue a page state change VMGEXIT to mark the pages private in the RMP table and validate them. Upon boot, BIOS should have validated the entire system memory. During the kernel decompression stage, early_setup_ghcb() uses set_page_decrypted() to make the GHCB page shared (i.e. clear encryption attribute). And while exiting from the decompression, it calls set_page_encrypted() to make the page private. Add snp_set_page_{private,shared}() helpers that are used by set_page_{decrypted,encrypted}() to change the page state in the RMP table. [ bp: Massage commit message and comments. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-16-brijesh.singh@amd.com commit 81cc3df9a90e7817494421ecc48ede6bd5e8132b Author: Brijesh Singh Date: Wed Feb 9 12:10:08 2022 -0600 x86/sev: Check the VMPL level The Virtual Machine Privilege Level (VMPL) feature in the SEV-SNP architecture allows a guest VM to divide its address space into four levels. The level can be used to provide hardware isolated abstraction layers within a VM. VMPL0 is the highest privilege level, and VMPL3 is the least privilege level. Certain operations must be done by the VMPL0 software, such as: * Validate or invalidate memory range (PVALIDATE instruction) * Allocate VMSA page (RMPADJUST instruction when VMSA=1) The initial SNP support requires that the guest kernel is running at VMPL0. Add such a check to verify the guest is running at level 0 before continuing the boot. There is no easy method to query the current VMPL level, so use the RMPADJUST instruction to determine whether the guest is running at the VMPL0. [ bp: Massage commit message. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-15-brijesh.singh@amd.com commit 0bd6f1e526070271dbe0f626b123b4f6b01dc79c Author: Brijesh Singh Date: Wed Feb 9 12:10:07 2022 -0600 x86/sev: Add a helper for the PVALIDATE instruction An SNP-active guest uses the PVALIDATE instruction to validate or rescind the validation of a guest page’s RMP entry. Upon completion, a return code is stored in EAX and rFLAGS bits are set based on the return code. If the instruction completed successfully, the carry flag (CF) indicates if the content of the RMP were changed or not. See AMD APM Volume 3 for additional details. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-14-brijesh.singh@amd.com commit cbd3d4f7c4e5a93edae68e5142a269368fde77d6 Author: Brijesh Singh Date: Wed Feb 9 12:10:06 2022 -0600 x86/sev: Check SEV-SNP features support Version 2 of the GHCB specification added the advertisement of features that are supported by the hypervisor. If the hypervisor supports SEV-SNP then it must set the SEV-SNP features bit to indicate that the base functionality is supported. Check that feature bit while establishing the GHCB; if failed, terminate the guest. Version 2 of the GHCB specification adds several new Non-Automatic Exits (NAEs), most of them are optional except the hypervisor feature. Now that the hypervisor feature NAE is implemented, bump the GHCB maximum supported protocol version. While at it, move the GHCB protocol negotiation check from the #VC exception handler to sev_enable() so that all feature detection happens before the first #VC exception. While at it, document why the GHCB page cannot be setup from load_stage2_idt(). [ bp: Massage commit message. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-13-brijesh.singh@amd.com commit 2ea29c5abbc27147c2d9e2ab5e05436aca706b65 Author: Brijesh Singh Date: Wed Feb 9 12:10:05 2022 -0600 x86/sev: Save the negotiated GHCB version The SEV-ES guest calls sev_es_negotiate_protocol() to negotiate the GHCB protocol version before establishing the GHCB. Cache the negotiated GHCB version so that it can be used later. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-12-brijesh.singh@amd.com commit 6c0f74d678c94060932683738b3e227995b363d3 Author: Brijesh Singh Date: Wed Feb 9 12:10:04 2022 -0600 x86/sev: Define the Linux-specific guest termination reasons The GHCB specification defines the reason code for reason set 0. The reason codes defined in the set 0 do not cover all possible causes for a guest to request termination. The reason sets 1 to 255 are reserved for the vendor-specific codes. Reserve the reason set 1 for the Linux guest. Define the error codes for reason set 1 so that one can have meaningful termination reasons and thus better guest failure diagnosis. While at it, change sev_es_terminate() to accept a reason set parameter. [ bp: Massage commit message. ] Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-11-brijesh.singh@amd.com commit f742b90e61bb53b27771f64bdae05db03a6ab1f2 Author: Brijesh Singh Date: Thu Feb 24 10:55:49 2022 -0600 x86/mm: Extend cc_attr to include AMD SEV-SNP The CC_ATTR_GUEST_SEV_SNP can be used by the guest to query whether the SNP (Secure Nested Paging) feature is active. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-10-brijesh.singh@amd.com commit bcce829083339bf862d66df602cbb111943da8fb Author: Michael Roth Date: Wed Feb 9 12:10:02 2022 -0600 x86/sev: Detect/setup SEV/SME features earlier in boot sme_enable() handles feature detection for both SEV and SME. Future patches will also use it for SEV-SNP feature detection/setup, which will need to be done immediately after the first #VC handler is set up. Move it now in preparation. Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-9-brijesh.singh@amd.com commit ec1c66af3a30d45c2420da0974c01d3515dba26e Author: Michael Roth Date: Wed Feb 9 12:10:01 2022 -0600 x86/compressed/64: Detect/setup SEV/SME features earlier during boot With upcoming SEV-SNP support, SEV-related features need to be initialized earlier during boot, at the same point the initial #VC handler is set up, so that the SEV-SNP CPUID table can be utilized during the initial feature checks. Also, SEV-SNP feature detection will rely on EFI helper functions to scan the EFI config table for the Confidential Computing blob, and so would need to be implemented at least partially in C. Currently set_sev_encryption_mask() is used to initialize the sev_status and sme_me_mask globals that advertise what SEV/SME features are available in a guest. Rename it to sev_enable() to better reflect that (SME is only enabled in the case of SEV guests in the boot/compressed kernel), and move it to just after the stage1 #VC handler is set up so that it can be used to initialize SEV-SNP as well in future patches. While at it, re-implement it as C code so that all SEV feature detection can be better consolidated with upcoming SEV-SNP feature detection, which will also be in C. The 32-bit entry path remains unchanged, as it never relied on the set_sev_encryption_mask() initialization to begin with. [ bp: Massage commit message. ] Signed-off-by: Michael Roth Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-8-brijesh.singh@amd.com commit 950d00558a920227b5703d1fcc4751cfe03853cd Author: Michael Roth Date: Wed Feb 9 12:10:00 2022 -0600 x86/boot: Use MSR read/write helpers instead of inline assembly Update all C code to use the new boot_rdmsr()/boot_wrmsr() helpers instead of relying on inline assembly. Suggested-by: Borislav Petkov Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-7-brijesh.singh@amd.com commit 176db622573f028f85221873ea4577e096785315 Author: Michael Roth Date: Wed Feb 9 12:09:59 2022 -0600 x86/boot: Introduce helpers for MSR reads/writes The current set of helpers used throughout the run-time kernel have dependencies on code/facilities outside of the boot kernel, so there are a number of call-sites throughout the boot kernel where inline assembly is used instead. More will be added with subsequent patches that add support for SEV-SNP, so take the opportunity to provide a basic set of helpers that can be used by the boot kernel to reduce reliance on inline assembly. Use boot_* prefix so that it's clear these are helpers specific to the boot kernel to avoid any confusion with the various other MSR read/write helpers. [ bp: Disambiguate parameter names and trim comment. ] Suggested-by: Borislav Petkov Signed-off-by: Michael Roth Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220307213356.2797205-6-brijesh.singh@amd.com commit fd5894fa2413cca3e6a3ea713b2bd57281af2e86 Author: Maxime Ripard Date: Fri Feb 25 15:35:34 2022 +0100 drm/vc4: hdmi: Remove clock rate initialization Now that the clock driver makes sure we never end up with a rate of 0, the HDMI driver doesn't need to care anymore. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220225143534.405820-13-maxime@cerno.tech commit 5b6ef06ea6225570bc0b33325306c7b8c6bdf5eb Author: Maxime Ripard Date: Fri Feb 25 15:35:33 2022 +0100 drm/vc4: Add logging and comments The HVS core clock isn't really obvious, so let's add a bunch more comments and some logging for easier debugging. Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20220225143534.405820-12-maxime@cerno.tech commit dc6dc3e7a73fc09c9ce773bc23bc2864d4c13284 Author: Masahiro Yamada Date: Tue Apr 5 20:33:50 2022 +0900 kbuild: do not remove empty *.symtypes explicitly Presumably, 'test -s $@ || rm -f $@' intends to remove the output when the genksyms command fails. It is unneeded because .DELETE_ON_ERROR automatically removes the output on failure. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit f43e31d5cb7859189a8be5699f4347e07b07c1df Author: Masahiro Yamada Date: Tue Apr 5 20:33:49 2022 +0900 kbuild: factor out genksyms command from cmd_gensymtypes_{c,S} The genksyms command part in cmd_gensymtypes_{c,S} is duplicated. Factor it out into the 'genksyms' macro. For the readability, I slightly refactor the arguments to genksyms. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Nicolas Schier commit cab802b7b8c9eea6fe30161dab77a05d20d76195 Author: Necip Fazil Yildiran Date: Tue Apr 5 00:33:51 2022 -0400 docs: kbuild: add references on Kconfig semantics Add references to 1) a research paper which provides a definition of Kconfig semantics, 2) the kismet tool, which checks for unmet direct dependency bugs in Kconfig specifications. Signed-off-by: Paul Gazzillo Signed-off-by: Necip Fazil Yildiran Signed-off-by: Masahiro Yamada commit 6d3b3d34e39eb4ee9a7dbe7e28e2588e160f9c0f Author: Tom Lendacky Date: Mon Mar 7 15:33:14 2022 -0600 KVM: SVM: Update the SEV-ES save area mapping This is the final step in defining the multiple save areas to keep them separate and ensuring proper operation amongst the different types of guests. Update the SEV-ES/SEV-SNP save area to match the APM. This save area will be used for the upcoming SEV-SNP AP Creation NAE event support. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-5-brijesh.singh@amd.com commit b249004491c732cf7b0af4df29fad95a47ec8aa1 Author: Ashutosh Dixit Date: Mon Mar 14 09:13:10 2022 -0700 drm/i915/pmu: Drop redundant IS_VALLEYVIEW check in __get_rc6() Because VLV_GT_RENDER_RC6 == GEN6_GT_GFX_RC6, the IS_VALLEYVIEW() check is not needed. Neither is the check present in other code paths which call intel_rc6_residency_ns() (in functions gen6_drpc(), rc6_residency() and rc6_residency_ms_show()). v2: Elimintate VLV_GT_RENDER_RC6 #define (Jani) Cc: Jani Nikula Signed-off-by: Ashutosh Dixit Reviewed-by: Badal Nilawar Signed-off-by: Anshuman Gupta Link: https://patchwork.freedesktop.org/patch/msgid/20220314161310.6468-1-ashutosh.dixit@intel.com commit a4690359eaec985a1351786da887df1ba92440a0 Author: Tom Lendacky Date: Mon Mar 7 15:33:13 2022 -0600 KVM: SVM: Create a separate mapping for the GHCB save area The initial implementation of the GHCB spec was based on trying to keep the register state offsets the same relative to the VM save area. However, the save area for SEV-ES has changed within the hardware causing the relation between the SEV-ES save area to change relative to the GHCB save area. This is the second step in defining the multiple save areas to keep them separate and ensuring proper operation amongst the different types of guests. Create a GHCB save area that matches the GHCB specification. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-4-brijesh.singh@amd.com commit 3dd2775b74c9b1b01d19805877ab45bc47c4a5a5 Author: Tom Lendacky Date: Tue Apr 5 13:27:43 2022 -0500 KVM: SVM: Create a separate mapping for the SEV-ES save area The save area for SEV-ES/SEV-SNP guests, as used by the hardware, is different from the save area of a non SEV-ES/SEV-SNP guest. This is the first step in defining the multiple save areas to keep them separate and ensuring proper operation amongst the different types of guests. Create an SEV-ES/SEV-SNP save area and adjust usage to the new save area definition where needed. Signed-off-by: Tom Lendacky Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220405182743.308853-1-brijesh.singh@amd.com commit 66230cc9b68a0b20d5ab5573e80adbafe2c6284f Author: Marek Vasut Date: Fri Apr 1 13:33:17 2022 +0200 drm: bridge: icn6211: Drop I2C module owner assignment The module owner = THIS_MODULE is set by I2C core, drop duplicate assignment. Fixes: 8dde6f7452a1 ("drm: bridge: icn6211: Add I2C configuration support") Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Reviewed-by: Jagan Teki Link: https://patchwork.freedesktop.org/patch/msgid/20220401113317.7033-1-marex@denx.de commit 9f04b55f003ccd00cf5e47bfb4116457f591d6de Author: Oliver Glitta Date: Tue Jun 8 10:45:17 2021 +0200 slab, documentation: add description of debugfs files for SLUB caches Add description of debugfs files alloc_traces and free_traces to SLUB cache documentation. [ vbabka@suse.cz: some rewording ] Signed-off-by: Oliver Glitta Signed-off-by: Vlastimil Babka Cc: Jonathan Corbet Cc: Randy Dunlap Cc: linux-doc@vger.kernel.org Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: Mike Rapoport Acked-by: David Rientjes commit 553c0369b3e132b4c1081700029f6d9e1a7332cf Author: Oliver Glitta Date: Fri May 21 14:11:26 2021 +0200 mm/slub: sort debugfs output by frequency of stack traces Sort the output of debugfs alloc_traces and free_traces by the frequency of allocation/freeing stack traces. Most frequently used stack traces will be printed first, e.g. for easier memory leak debugging. Signed-off-by: Oliver Glitta Signed-off-by: Vlastimil Babka Reviewed-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes commit 8ea9fb921bc68376081a9db410cf1d6afa0c6fb9 Author: Oliver Glitta Date: Fri May 21 14:11:25 2021 +0200 mm/slub: distinguish and print stack traces in debugfs files Aggregate objects in slub cache by unique stack trace in addition to caller address when producing contents of debugfs files alloc_traces and free_traces in debugfs. Also add the stack traces to the debugfs output. This makes it much more useful to e.g. debug memory leaks. Signed-off-by: Oliver Glitta Signed-off-by: Vlastimil Babka Reviewed-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 5cf909c553e9efed573811de4b3f5172898d5515 Author: Oliver Glitta Date: Wed Jul 7 18:07:47 2021 -0700 mm/slub: use stackdepot to save stack trace in objects Many stack traces are similar so there are many similar arrays. Stackdepot saves each unique stack only once. Replace field addrs in struct track with depot_stack_handle_t handle. Use stackdepot to save stack trace. The benefits are smaller memory overhead and possibility to aggregate per-cache statistics in the following patch using the stackdepot handle instead of matching stacks manually. [ vbabka@suse.cz: rebase to 5.17-rc1 and adjust accordingly ] This was initially merged as commit 788691464c29 and reverted by commit ae14c63a9f20 due to several issues, that should now be fixed. The problem of unconditional memory overhead by stackdepot has been addressed by commit 2dba5eb1c73b ("lib/stackdepot: allow optional init and stack_table allocation by kvmalloc()"), so the dependency on stackdepot will result in extra memory usage only when a slab cache tracking is actually enabled, and not for all CONFIG_SLUB_DEBUG builds. The build failures on some architectures were also addressed, and the reported issue with xfs/433 test did not reproduce on 5.17-rc1 with this patch. Signed-off-by: Oliver Glitta Signed-off-by: Vlastimil Babka Reviewed-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes Cc: David Rientjes Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim commit 0cd1a02901858049d14b5b9d4c5c680b012c8cc1 Author: Vlastimil Babka Date: Fri Feb 4 17:44:40 2022 +0100 mm/slub: move struct track init out of set_track() set_track() either zeroes out the struct track or fills it, depending on the addr parameter. This is unnecessary as there's only one place that calls it for the initialization - init_tracking(). We can simply do the zeroing there, with a single memset() that covers both TRACK_ALLOC and TRACK_FREE as they are adjacent. Signed-off-by: Vlastimil Babka Reviewed-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes commit 65ee4971a262a024e239e5d2b7f4dee1b3dff40e Author: Po Hao Huang Date: Fri Apr 1 13:50:43 2022 +0800 rtw89: fix misconfiguration on hw_scan channel time Without this patch, hw scan won't stay long enough on DFS/passive channels. Found previous logic error and fix it. Signed-off-by: Po Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401055043.12512-5-pkshih@realtek.com commit 841f2633840ea2eb1ecea4a7efab9d19d9abaf62 Author: Ching-Te Ku Date: Fri Apr 1 13:50:42 2022 +0800 rtw89: coex: Add case for scan offload Turn off coexistence driver control, let firmware can control the traffic during scan. This prevents potential unexpected behavior of the BT driver. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401055043.12512-4-pkshih@realtek.com commit 2b8219e9b746ee3090baa1daa192b16e5bc72f9d Author: Po Hao Huang Date: Fri Apr 1 13:50:41 2022 +0800 rtw89: packet offload handler to avoid warning Add a dummy function for packet offload to eliminate warning message "c2h class 1 func 2 not support". This c2h is for debug purpose and its presence itself can do the work, so further parsing won't be required for now. Signed-off-by: Po Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401055043.12512-3-pkshih@realtek.com commit ee20d538c4989daddd383b6a89129a2b514580e6 Author: Po Hao Huang Date: Fri Apr 1 13:50:40 2022 +0800 rtw89: change idle mode condition during hw_scan Previously we only consider single interface's status, idle mode behavior could be unexpected when multiple interfaces is active. Change to enter/leave idle mode by mac80211's configuration state. Signed-off-by: Po Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401055043.12512-2-pkshih@realtek.com commit a5f1783be29adae15666fd803efd7d2979130869 Author: Vlastimil Babka Date: Wed Mar 2 12:02:22 2022 +0100 lib/stackdepot: allow requesting early initialization dynamically In a later patch we want to add stackdepot support for object owner tracking in slub caches, which is enabled by slub_debug boot parameter. This creates a bootstrap problem as some caches are created early in boot when slab_is_available() is false and thus stack_depot_init() tries to use memblock. But, as reported by Hyeonggon Yoo [1] we are already beyond memblock_free_all(). Ideally memblock allocation should fail, yet it succeeds, but later the system crashes, which is a separately handled issue. To resolve this boostrap issue in a robust way, this patch adds another way to request stack_depot_early_init(), which happens at a well-defined point of time. In addition to build-time CONFIG_STACKDEPOT_ALWAYS_INIT, code that's e.g. processing boot parameters (which happens early enough) can call a new function stack_depot_want_early_init(), which sets a flag that stack_depot_early_init() will check. In this patch we also convert page_owner to this approach. While it doesn't have the bootstrap issue as slub, it's also a functionality enabled by a boot param and can thus request stack_depot_early_init() with memblock allocation instead of later initialization with kvmalloc(). As suggested by Mike, make stack_depot_early_init() only attempt memblock allocation and stack_depot_init() only attempt kvmalloc(). Also change the latter to kvcalloc(). In both cases we can lose the explicit array zeroing, which the allocations do already. As suggested by Marco, provide empty implementations of the init functions for !CONFIG_STACKDEPOT builds to simplify the callers. [1] https://lore.kernel.org/all/YhnUcqyeMgCrWZbd@ip-172-31-19-208.ap-northeast-1.compute.internal/ Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Suggested-by: Mike Rapoport Suggested-by: Marco Elver Signed-off-by: Vlastimil Babka Reviewed-by: Marco Elver Reviewed-and-tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Mike Rapoport Acked-by: David Rientjes commit 9fb4862e913ceb5f6e668033c214e07eca7ee18a Author: Ping-Ke Shih Date: Fri Mar 25 14:00:55 2022 +0800 rtw89: update ptcl_init ptcl_init, standing for protocol initialization, is updated to the latest version. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-17-pkshih@realtek.com commit 75fd91aa92f91a441b115368f07b381b47130fb8 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:54 2022 +0800 rtw89: update TMAC parameters TMAC is short for TX MAC, and this patch is to configure FIFO thresholds. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-16-pkshih@realtek.com commit 19cb94273f40b08dbb5677619d05a4c594226ac9 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:53 2022 +0800 rtw89: initialize NAV control Configure NAV function and its parameters. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-15-pkshih@realtek.com commit c49154ff8bcb995467b23c50afcee74c11265547 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:52 2022 +0800 rtw89: update scheduler setting Update IC specific settings accordingly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-14-pkshih@realtek.com commit b61adeed5409380479b3a9b43113348c26881342 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:51 2022 +0800 rtw89: 8852c: update security engine setting The security setting of 8852A and 8852C are different, so change the settings accordingly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-13-pkshih@realtek.com commit 5cb5562d2a21637d1aa23791bec1e45368494ba4 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:50 2022 +0800 rtw89: Turn on CR protection of CMAC CMAC is Control MAC, and this patch is to turn on CR (control registers) protection. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-12-pkshih@realtek.com commit 61ebeecb3d670f1e37e20095ff2504960404538f Author: Ping-Ke Shih Date: Fri Mar 25 14:00:49 2022 +0800 rtw89: add chip_ops::{enable,disable}_bb_rf to support v1 chip The v1 chip use specific functions to enable and disable BB/RF. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-11-pkshih@realtek.com commit cf7b8b8088111d32a16c31f01be2438e8d411c7a Author: Ping-Ke Shih Date: Fri Mar 25 14:00:48 2022 +0800 rtw89: update STA scheduler parameters for v1 chip The v1 chip has additional setting of STA scheduler, so add it. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-10-pkshih@realtek.com commit a7d82a7aae656089c478b5ccf83ede38d49ac223 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:47 2022 +0800 rtw89: extend dmac_pre_init to support 8852C DMAC is short for data MAC. 8852C has more settings than 8852A, so add them. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-9-pkshih@realtek.com commit e1e7a574b20ff3ce474c67ef6dfbc715d0870e9a Author: Ping-Ke Shih Date: Fri Mar 25 14:00:46 2022 +0800 rtw89: pci: add L1 settings Configure L1 settings of enter and exit. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-8-pkshih@realtek.com commit 22a66e7c3abe48237853239b2184751cf97aca07 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:45 2022 +0800 rtw89: pci: add deglitch setting Add setting to support 8852ce. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-7-pkshih@realtek.com commit bab9e239178679db33d0cca8e14ce448419a3078 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:44 2022 +0800 rtw89: pci: set address info registers depends on chips Address info registers are used to configure size of DMA address info to point skb->data. With different size, it can support different number of scatters. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-6-pkshih@realtek.com commit 0db862fb025c933675e3efb388eb96da781d6365 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:43 2022 +0800 rtw89: pci: add LTR setting for v1 chip Add LTR handle to PCI deinit as well. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-5-pkshih@realtek.com commit 1e3f205548155af7df781bb23bed15af17aa8ace Author: Chia-Yuan Li Date: Fri Mar 25 14:00:42 2022 +0800 rtw89: pci: refine pci pre_init function The pre_init is used to initialize partial PCI function during PCI probe. It doesn't need to initialize all functions, so probe can be faster. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-4-pkshih@realtek.com commit b9467e94b1f2c0ade913ad3767cffa310787de5b Author: Ping-Ke Shih Date: Fri Mar 25 14:00:41 2022 +0800 rtw89: pci: add pci attributes to configure operating mode Refine operating mode function to support variant chips. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-3-pkshih@realtek.com commit 740c431c22fedc2425c9cd263654745b806b6fc7 Author: Ping-Ke Shih Date: Fri Mar 25 14:00:40 2022 +0800 rtw89: pci: add register definition to rtw89_pci_info to generalize pci code The PCI code of 8852AE and 8852CE are different, but the flow and register names are similar. To reuse the code, add a struct to define register or value accordingly. We also use chip id to control the slightly different flow. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325060055.58482-2-pkshih@realtek.com commit ebc7a4962765ad789b678c5445ee8b749662fb5f Merge: 26bb93407c748 b9e34ba6b3147 Author: Kalle Valo Date: Wed Apr 6 11:37:55 2022 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.19. Major changes: ath11k * Wake-on-WLAN support for QCA6390 and WCN6855 * device recovery (firmware restart) support for QCA6390 and WCN6855 wcn36xx * support for transmit rate reporting to user space commit b9e34ba6b314780a47ac40f450ec04f18be85b5e Author: Kalle Valo Date: Tue Apr 5 11:26:44 2022 +0300 ath11k: mhi: remove unnecessary goto from ath11k_mhi_start() No need to have goto for a return statement, so simplify the code. While at it, print warning messages if power up calls fail. No functional changes. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401173042.17467-4-kvalo@kernel.org commit 3e80fcbca37221cd1e5a33eea4b0f215f66a7a00 Author: Kalle Valo Date: Tue Apr 5 11:26:39 2022 +0300 ath11k: mhi: add error handling for suspend and resume While reviewing the mhi.c I noticed we were just ignoring the errors coming from MHI subsystem during suspend and resume. Add proper checks and warning messages. Also pass the error value to callers. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401173042.17467-3-kvalo@kernel.org commit 121210ec935c47b076709974d95360f5e9c9b869 Author: Kalle Valo Date: Fri Apr 1 20:30:40 2022 +0300 ath11k: mhi: remove state machine State machines are difficult to understand and in this case it's just useless, which is shown by the diffstat. So remove it entirely to make the code simpler. No functional changes. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220401173042.17467-2-kvalo@kernel.org commit a285909f471d6703a04b2b3942c352e27131c92b Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Wed Apr 6 15:00:03 2022 +0900 mm/slub, kunit: Make slub_kunit unaffected by user specified flags slub_kunit does not expect other debugging flags to be set when running tests. When SLAB_RED_ZONE flag is set globally, test fails because the flag affects number of errors reported. To make slub_kunit unaffected by user specified debugging flags, introduce SLAB_NO_USER_FLAGS to ignore them. With this flag, only flags specified in the code are used and others are ignored. Suggested-by: Vlastimil Babka Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/Yk0sY9yoJhFEXWOg@hyeyoo commit 2829a9fcb738f742baad9d15de4c6eac84bcfd08 Author: Lucas Stach Date: Wed Mar 23 17:08:25 2022 +0100 drm/etnaviv: reap idle softpin mappings when necessary Right now the only point where softpin mappings get removed from the MMU context is when the mapped GEM object is destroyed. However, userspace might want to reuse that address space before the object is destroyed, which is a valid usage, as long as all mapping in that region of the address space are no longer used by any GPU jobs. Implement reaping of idle MMU mappings that would otherwise prevent the insertion of a softpin mapping. Signed-off-by: Lucas Stach Tested-by: Guido Günther Acked-by: Guido Günther Reviewed-by: Christian Gmeiner commit 9247fcca3982a29b04b002f0d30def9ff50740d5 Author: Lucas Stach Date: Wed Mar 23 17:08:24 2022 +0100 drm/etnaviv: move flush_seq increment into etnaviv_iommu_map/unmap The flush sequence is a marker that the page tables have been changed and any affected TLBs need to be flushed. Move the flush_seq increment a little further down the call stack to place it next to the actual page table manipulation. Not functional change. Signed-off-by: Lucas Stach Reviewed-by: Philipp Zabel Tested-by: Guido Günther Acked-by: Guido Günther commit 11ad6a1f181f28dccbe47a7fb41f56557573941a Author: Lucas Stach Date: Wed Mar 23 17:08:23 2022 +0100 drm/etnaviv: move MMU context ref/unref into map/unmap_gem This makes it a little more clear that the mapping holds a reference to the context once the buffer has been successfully mapped into that context and simplifies the error handling a bit. Signed-off-by: Lucas Stach Reviewed-by: Philipp Zabel Tested-by: Guido Günther Acked-by: Guido Günther commit e168c25526cd0368af098095c2ded4a008007e1b Author: Lucas Stach Date: Wed Mar 23 17:08:22 2022 +0100 drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem When the mapping is already reaped the unmap must be a no-op, as we would otherwise try to remove the mapping twice, corrupting the involved data structures. Cc: stable@vger.kernel.org # 5.4 Signed-off-by: Lucas Stach Reviewed-by: Philipp Zabel Tested-by: Guido Günther Acked-by: Guido Günther commit 26bb93407c748d731f25581ccae196e1016072bf Author: Ping-Ke Shih Date: Fri Mar 18 11:52:02 2022 +0800 rtw89: handle potential uninitialized variable The smatch reports: rtw8852a.c:1857 rtw8852a_btc_set_wl_txpwr_ctrl() error: uninitialized symbol '_cur'. rtw8852a.c:1858 rtw8852a_btc_set_wl_txpwr_ctrl() error: uninitialized symbol '_cur'. This is because rtw89_mac_txpwr_read32() can possibly return before setting argument _cur, and the caller will use the uninitialized value. To fix this problem, check the return value of rtw89_mac_txpwr_read32(). Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318035202.42437-1-pkshih@realtek.com commit 84fc6999f0d01920687d8555e3f1bb87625a66ed Author: Ping-Ke Shih Date: Fri Mar 18 10:32:14 2022 +0800 rtw89: read RX bandwidth from v1 type RX descriptor 8852C uses different fields to represent RX bandwidth. Since other fields are the same, I check chip_id to get bandwidth instead of creating another v1 function. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-12-pkshih@realtek.com commit 79a6c9a4f3c4473dd508a7384ae328bf683b7382 Author: Ping-Ke Shih Date: Fri Mar 18 10:32:13 2022 +0800 rtw89: support hardware generate security header The newer chip will generate security header itself, so don't set IEEE80211_KEY_FLAG_GENERATE_IV in this kind of chip. But, it needs to fill key_index, PN and 802.11 header length to TX descriptor, and then hardware uses these to generate security header. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-11-pkshih@realtek.com commit f59acdde5197f3ea96ebf3d6bd95741d210dab9b Author: Ping-Ke Shih Date: Fri Mar 18 10:32:12 2022 +0800 rtw89: support variant of fill_txdesc The txdesc is descriptor related to skb->data. The v1 version contains 8 dwords txwd_body and 6 dwords txwd_info, and the format is also different from original one. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-10-pkshih@realtek.com commit 6d5b5d6290ece7fd3652546ebc1ba98236327b5f Author: Ping-Ke Shih Date: Fri Mar 18 10:32:11 2022 +0800 rtw89: pci: support variant of fill_txaddr_info The txaddr_info is used to fill the DMA address of skb->data. The v1 version can support up to 10 entries, but the maximum size of each entry is 2047, so it fill more than one entry for large packet, like 3000 bytes. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-9-pkshih@realtek.com commit a95bd62ec01df487b18f57eacc4c38d6d73a059a Author: Ping-Ke Shih Date: Fri Mar 18 10:32:10 2022 +0800 rtw89: add chip_info::h2c_desc_size/fill_txdesc_fwcmd to support new chips 8852A and 8852C use different H2C header and size, so add h2c_desc_size to allocate different header size and fill content by fill_txdesc_fwcmd. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-8-pkshih@realtek.com commit 1e6f0d2a677a6bd0f719158f9a1453ce7b11bb0c Author: Johnson Lin Date: Fri Mar 18 10:32:09 2022 +0800 rtw89: disabled IGI configuration for unsupported hardware Bypass IGI, known as Rx gain, adjustment flow for incompatible hardware architectures. Signed-off-by: Johnson Lin Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-7-pkshih@realtek.com commit bed4045ffb9c7453d2b6627f5d29b27973f1f653 Author: Johnson Lin Date: Fri Mar 18 10:32:08 2022 +0800 rtw89: packed IGI configuration flow into function for DIG feature Refinement of DIG flow, a mechanism to adjust Rx gain for better Rx performance, by packing IGI(initial gain index) configuration flow into one function. Signed-off-by: Johnson Lin Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-6-pkshih@realtek.com commit 1ae30c37ecf11781efea733e84927f4480e12ebd Author: Zong-Zhe Yang Date: Fri Mar 18 10:32:07 2022 +0800 rtw89: regd: update mapping table to R59-R32 Update notes: Configure rtw89_regulatory for 6G band according to country. Adjust country GB to use RTW89_UK entry on all bands. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-5-pkshih@realtek.com commit 034307088cb2bdf9b2f79cdc3ddc2be22c89bbfd Author: Zong-Zhe Yang Date: Fri Mar 18 10:32:06 2022 +0800 rtw89: regd: consider 6G band Wrap regd debug dump into a macro and add dump for 6G band field. Extend the macro used to configure regd table to account for multiple bands beyond 2G and 5G. And the follow-up commit will configure the corresponding values for 6G band into regd table. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-4-pkshih@realtek.com commit c504bf23290c980588a19f228ffe6b37097dc460 Author: Zong-Zhe Yang Date: Fri Mar 18 10:32:05 2022 +0800 rtw89: 8852a: update txpwr tables to HALRF_027_00_038 Update notes: TX power by rate table is not changed. TX power limit table configures values for UK. TX power limit RU table configures values for UK. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-3-pkshih@realtek.com commit 5a0e776bec96e373940731875f9e58f9a747a6e4 Author: Zong-Zhe Yang Date: Fri Mar 18 10:32:04 2022 +0800 rtw89: add UK to regulation type Add RTW89_UK to enum rtw89_regulation_type. The follow-up commit will configure the corresponding values for it to TX power tables. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318023214.32411-2-pkshih@realtek.com commit 306451188062a788c59d6b708acd1f2ba2274bd9 Author: Ping-Ke Shih Date: Tue Mar 15 09:55:22 2022 +0800 rtw89: reduce export symbol number of mac size and quota An export symbol costs about 40 bytes (in x86 with gcc), so use a structure containing these small arrays to reduce code size. text data bss dec hex filename 34932 1410 0 36342 8df6 mac.o (before) 34276 1258 0 35534 8ace mac.o (after) Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220315015522.11366-1-pkshih@realtek.com commit edb896297abeef8c95c150247607b09517469a9a Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:50 2022 +0800 rtw89: support FW crash simulation Originally, there is already a mechanism, SER (system error recover), to deal with HW/FW recovery. After FW v0.13.36.0, FW supports a H2C (host to chip) command to make a CPU exception. Then, SER is supposed to catch this FW crash and do L2 reset. This feature is a simulation to verify if flow of recovering from FW crash works. Usage of fw_crash debugfs is as the following. $ echo 1 > fw_crash // trigger FW crash and wait SER handling $ cat fw_crash // return 0 if restart has been done Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-9-pkshih@realtek.com commit 11fe4ccda8672db5375f8bfcb209756a31c89a82 Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:49 2022 +0800 rtw89: reconstruct fw feature As the fw features gradually increase, it would be better that we have a set of methods to maintain fw features instead of using scattered bool variables. We reconstruct the way fw recognize features, and introduce RTW89_CHK_FW_FEATURE() / RTW89_SET_FW_FEATURE() to check / set fw features for uses. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-8-pkshih@realtek.com commit f5e246846412175f38f830d9082fae0f72470843 Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:48 2022 +0800 rtw89: ser: dump fw backtrace while L2 reset Read FW backtrace entry through FW reserved payload engine, and then add FW backtrace dump during SER (system error recover) L2 reset process. It contains a list of RA (return address) and SP (stack pointer) which gives us a chance to trace back the call stack of FW. Moreover, if core dump might have wrong content due to error during dumping, we won't invoke device core dump framework. For this case, rtw89_ser_cd_free() is added to free buffer by ourselves. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-7-pkshih@realtek.com commit 9f8004bfed038ae22661f483c358ffc4c076739f Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:47 2022 +0800 rtw89: ser: dump memory for fw payload engine while L2 reset When FW encounters exception or assertion, SER L2 reset process will start. It will dump some error information and re-download FW eventually. Since such errors are usually critical, we would like to keep more information about error to increase possibility of analysis and debugging FW. We first add FW payload engine (fw reserved playoad engine, fw_rsvd_ple) memory dump. FW will record things like CPU registers, backtrace entry, etc. in it for debugging. Moreover, device core dump framework is used and wrapped to collect kinds of dumps during SER L2 reset process. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-6-pkshih@realtek.com commit 14f9f4790048f684c2b151c899895feae0b5731a Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:46 2022 +0800 rtw89: ser: control hci interrupts on/off by state While SER (system error recover) is processing, it's supposed to mean something is under recovery. So, disable interrupts (excluding the one of halt which could be used during SER) to avoid unexpected behavior. And then, enable interrupts after SER is done. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-5-pkshih@realtek.com commit 198b6cf70146ca6b575efe35c123e4951f9724f1 Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:45 2022 +0800 rtw89: mac: correct decision on error status by scenario The raw error code might combine error scenario and error status. But, the error scenario isn't parsed previously. It makes us mishandle cpu exception and assertion. Now, we correct the error status for them. Besides, a few uses of error status are refined. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-4-pkshih@realtek.com commit e1400b115cace4528dbe0f2b72103241d0d11892 Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:44 2022 +0800 rtw89: mac: move table of mem base addr to common Previously, mac_mem_base_addr_table was declared in debug.c locally because it's only used via debugfs to dump mac memory. Now, we plan to refine SER (system error recover) flow which will also need to dump mac memory to somewhere as information for error which is catched. So, we move mac_mem_base_addr_table to mac.c rtw89_mac_mem_base_addrs earlier as common code. (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/20220314071250.40292-3-pkshih@realtek.com commit b169f877f001a474fb89939842c390518160bcc5 Author: Zong-Zhe Yang Date: Mon Mar 14 15:12:43 2022 +0800 rtw89: ser: fix CAM leaks occurring in L2 reset The CAM, meaning address CAM and bssid CAM here, will get leaks during SER (system error recover) L2 reset process and ieee80211_restart_hw() which is called by L2 reset process eventually. The normal flow would be like -> add interface (acquire 1) -> enter ips (release 1) -> leave ips (acquire 1) -> connection (occupy 1) <(A) 1 leak after L2 reset if non-sec connection> The ieee80211_restart_hw() flow (under connection) -> ieee80211 reconfig -> add interface (acquire 1) -> leave ips (acquire 1) -> connection (occupy (A) + 2) <(B) 1 more leak> Originally, CAM is released before HW restart only if connection is under security. Now, release CAM whatever connection it is to fix leak in (A). OTOH, check if CAM is already valid to avoid acquiring multiple times to fix (B). Besides, if AP mode, release address CAM of all stations before HW restart. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314071250.40292-2-pkshih@realtek.com commit 29ed2d7606bb674c9ee38f59ca5b155aaea72df3 Author: Po-Hao Huang Date: Fri Mar 18 11:43:16 2022 +0800 rtw88: change idle mode condition during hw_scan Previously we only consider single interface's status, idle mode behavior could be unexpected when multiple interfaces is active. Change to enter/leave idle mode by mac80211's configuration state. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318034316.40720-1-pkshih@realtek.com commit 61fe0ab26e36998cebec48805d6873e31f0d79d7 Author: Xiaomeng Tong Date: Fri Apr 1 19:50:18 2022 +0800 drm/gma500: fix a missing break in psb_intel_crtc_mode_set Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. when found the entry, add a break after the switch statement. Signed-off-by: Xiaomeng Tong Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220401115018.9335-1-xiam0nd.tong@gmail.com commit 7a828f1f1fe30024cd153452b808a07ddf07c153 Author: Marek Vasut Date: Wed Apr 6 03:42:50 2022 +0200 drm: bridge: icn6211: Mark module exit callback with __exit Fix copy-paste error, module exit function should be marked with __exit instead of __init. Fixes: 8dde6f7452a1 ("drm: bridge: icn6211: Add I2C configuration support") Reported-by: Stephen Rothwell Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Stephen Rothwell Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220406014250.902187-1-marex@denx.de Reviewed-by: Robert Foss commit b9bd4832074b3484f4b4b2ca2eae4629baa729c2 Author: Tvrtko Ursulin Date: Tue Apr 5 16:53:45 2022 +0100 drm/i915: Fixup kerneldoc in struct i915_gem_context Mixup in rebasing and patchwork re-runs made me push the wrong version of the patch. Or I even forgot to send out the fixed version. Fix it up. Signed-off-by: Tvrtko Ursulin Fixes: 49bd54b390c2 ("drm/i915: Track all user contexts per client") Cc: Umesh Nerlige Ramappa Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220405155345.3292769-1-tvrtko.ursulin@linux.intel.com commit c5f675748cf0e1db5ba5514e1f34360dfb95a6ba Author: Gustavo A. R. Silva Date: Wed Feb 16 13:50:30 2022 -0600 iwlwifi: mei: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220216195030.GA904170@embeddedor commit 34e63cd5ba29fb832f3fe31e37cea28027979c1d Author: Gustavo A. R. Silva Date: Wed Feb 16 13:50:15 2022 -0600 iwlwifi: fw: Replace zero-length arrays with flexible-array members There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220216195015.GA904148@embeddedor commit 0276bd3a94c072de3f69b5afe6224e488cc76635 Author: Borislav Petkov Date: Tue Apr 5 17:15:16 2022 +0200 IB/mlx5: Fix undefined behavior due to shift overflowing the constant Fix: drivers/infiniband/hw/mlx5/main.c: In function ‘translate_eth_legacy_proto_oper’: drivers/infiniband/hw/mlx5/main.c:370:2: error: case label does not reduce to an integer constant case MLX5E_PROT_MASK(MLX5E_50GBASE_KR2): ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Link: https://lore.kernel.org/all/20220405151517.29753-11-bp@alien8.de Signed-off-by: Borislav Petkov Cc: Leon Romanovsky Cc: Saeed Mahameed Cc: linux-rdma@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Leon Romanovsky commit 7a9104ea9011c0e15176c2951a97bda43c4beabf Author: Leon Romanovsky Date: Mon Apr 4 15:08:19 2022 +0300 net/mlx5: Cleanup kTLS function names and their exposure The _accel_ part of the function is not relevant anymore, so rename kTLS functions to be without it, together with header cleanup to do not have declarations that are not used. Link: https://lore.kernel.org/r/72319e6020fb2553d02b3bbc7476bda363f6d60c.1649073691.git.leonro@nvidia.com Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 943aa7bda37301eefc363e4940c4805d8e166478 Author: Leon Romanovsky Date: Mon Apr 4 15:08:18 2022 +0300 net/mlx5: Remove tls vs. ktls separation as it is the same After removal FPGA TLS, we can remove tls->ktls indirection too, as it is the same thing. Link: https://lore.kernel.org/r/67e596599edcffb0de43f26551208dfd34ac777e.1649073691.git.leonro@nvidia.com Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 691f17b980d028e74ae168ef9e5be7d6021dbf23 Author: Leon Romanovsky Date: Mon Apr 4 15:08:17 2022 +0300 net/mlx5: Remove indirection in TLS build The dream described in the commit 1ae173228489 ("net/mlx5: Accel, Add TLS tx offload interface") never came true, even an opposite happened when FPGA TLS support was dropped. Such removal revealed the problematic flow in the build process: build of unrelated files in case of TLS or IPsec are enabled. In both cases, the MLX5_ACCEL is enabled, which built both TLS and IPsec. As a solution, simply merge MLX5_TLS and MLX5_EN_TLS options and move TLS related files to the eth part of the mlx5_core. Link: https://lore.kernel.org/r/0d1ea8cdc3a15922640b8b764d2bdb8f587b52c2.1649073691.git.leonro@nvidia.com Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit e59437aa7ae6757111e633d02acb9868c1a7ec03 Author: Leon Romanovsky Date: Mon Apr 4 15:08:16 2022 +0300 net/mlx5: Reliably return TLS device capabilities The capabilities returned from the FW are independent to the compiled kernel and traditionally rely on the relevant CAPs bit only. The mlx5_accel_is_ktls_*() functions are compiled out if CONFIG_MLX5_TLS is not set, which "hides" from the user the information that TLS can be enabled on this device. Link: https://lore.kernel.org/r/a333ce541fb9497d04126b11c4a0052f9807d141.1649073691.git.leonro@nvidia.com Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 40379a0084c2f65eb62c102f5bbf5cdc14a50410 Author: Leon Romanovsky Date: Mon Apr 4 15:08:15 2022 +0300 net/mlx5_fpga: Drop INNOVA TLS support Mellanox INNOVA TLS cards are EOL in May, 2018 [1]. As such, the code is unmaintained, untested and not in-use by any upstream/distro oriented customers. In order to reduce code complexity, drop the kernel code. [1] https://network.nvidia.com/related-docs/eol/LCR-000286.pdf Link: https://lore.kernel.org/r/b88add368def721ea9d054cb69def72d9e3f67aa.1649073691.git.leonro@nvidia.com Reviewed-by: Tariq Toukan Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky commit 4a5fb1bbcdf1cccae1f6b9c0277b3796b2a468ef Author: Jérôme Pouiller Date: Sat Feb 26 10:21:42 2022 +0100 wfx: get out from the staging area The wfx driver is now mature enough to leave the staging area. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo commit 7bb9b9e34b8742afc0cd8547103ef0106012947b Author: David Jander Date: Mon Feb 21 10:53:12 2022 +0100 ARM: dts: imx6qdl-victgo: add CAN termination support The gpio1 0 pin is controlling CAN termination, not USB H1 VBUS. So, remove wrong regulator and assign this gpio to new DT CAN termination property. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit e310ba3c0fd5d9d017831501e81dad7e5a9aa2d7 Author: Robin van der Gracht Date: Mon Feb 21 10:53:11 2022 +0100 ARM: dts: imx6dl-victgo: The TGO uses a lg,lb070wv8 compatible 7" display This series of devices is using lg,lb070wv8 instead of kyo,tcg121xglp. Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 05ed0bc09a5377825b37240c0212a894aa4dad49 Author: Robin van der Gracht Date: Mon Feb 21 10:53:10 2022 +0100 ARM: dts: imx6dl-victgo: Add interrupt-counter nodes Interrupt counter is mainlined, now we can add missing counter nodes. Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit cb15ebbc10b5d35af76f34f18b1592abc39c3f5b Author: David Jander Date: Mon Feb 21 10:53:08 2022 +0100 ARM: dts: imx6qdl-vicut1: update gpio-line-names for some GPIOs countedX lines have different board names (YACO_x). And REV_ and BOARD_ pins have multiple functions. So, use names exposed to the OS. Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 98efa526a0c436efea4cdc834ab632f66f13ac0b Author: David Jander Date: Mon Feb 21 10:53:07 2022 +0100 ARM: dts: imx6qdl-vicut1/vicutgo: Add backlight_led node backlight_led is the dimmable backlight for the rubber border on the case. It is also used to highlight the power- and some other buttons. MX6QDL_PAD_SD4_DAT1__PWM3_OUT is also assigned as output for pwm3. Since we need pwm3 for the backlight, we're forced to disable user space hardware revision detection. The bootloader will have to supply this information (i.e. through device tree). Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 156a722b39315e95dd018dbc614e2becf4782237 Author: David Jander Date: Mon Feb 21 10:53:06 2022 +0100 ARM: dts: imx6qdl-vicut1/vicutgo: Rename backlight to backlight_lcd We have two backlight sources on this boards. Use more specific name for the LCD backlight to see the difference. Signed-off-by: David Jander Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit e931a6f79620c2cc0e9dde215e35f016a3be33f4 Author: David Jander Date: Mon Feb 21 10:53:05 2022 +0100 ARM: dts: imx6qdl-vicut1/vicutgo: Set default backlight brightness to maximum Recover default behavior of the device and set maximal brightness Signed-off-by: David Jander Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 583f24ae42a0786dbb70fde03a3652059811a9c6 Author: Marek Vasut Date: Mon Feb 21 01:17:38 2022 +0100 arm64: dts: imx8mm: Add support for Data Modul i.MX8M Mini eDM SBC Add support for Data Modul i.MX8M Mini eDM SBC board. This is an evaluation board for various custom display units. Currently supported are serial console, ethernet, eMMC, SD, PCIe, SPI NOR, USB host and USB OTG. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Reviewed-by: Peng Fan Signed-off-by: Shawn Guo commit 236b8cfac4e3f007b9c4f014b3d25e63cc376ef7 Author: Ariel D'Alessandro Date: Wed Mar 23 10:56:01 2022 -0300 arm64: dts: imx8mn-bsh-smm-s2pro: Add tlv320aic31xx audio card node BSH SystemMaster (SMM) S2 PRO board comes with an audio card based on tlv320aic31xx family codec. The audio card exposes two playback devices, one of them using the EASRC (Enhanced Asynchronous Sample Rate Converter) module. Note that this would require SDMA and EASRC firmware in order to work. Signed-off-by: Ariel D'Alessandro Signed-off-by: Michael Trimarchi Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2d0df01974ce2b59b6f7d5bd3ea58d74f12ddf85 Author: Yuntao Wang Date: Tue Apr 5 22:57:11 2022 +0800 selftests/bpf: Fix file descriptor leak in load_kallsyms() Currently, if sym_cnt > 0, it just returns and does not close file, fix it. Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220405145711.49543-1-ytcoode@gmail.com commit cfab37ff31afcd0f99f3cccbff1f8ffa11e44c00 Author: Chen-Yu Tsai Date: Fri Feb 25 11:27:54 2022 +0800 drm/mediatek: Fix DPI component detection for MT8192 When support for MT8192 was added, the DPI device was not added to the list of components to look for. This causes the secondary display pipeline to not be able to fully bind, and the DRM driver subsequently defers probing. Add the DPI device compatible to list of DPI components to fix this. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220225032754.140168-1-wenst@chromium.org/ Fixes: 01365f549c88 ("drm/mediatek: Add support for Mediatek SoC MT8192") Signed-off-by: Chen-Yu Tsai Signed-off-by: Chun-Kuang Hu commit 21d139a95682c6ade89a2151e44012c9797c0309 Author: Marek Vasut Date: Sat Apr 2 02:41:18 2022 +0200 drm: bridge: icn6211: Fix DSI-to-DPI PLL configuration The datasheet for this bridge is not available, the PLL behavior has been inferred from [1] and [2] and by analyzing the DPI pixel clock with scope. After further testing with other displays and different DSI data lane count, it turns out the P-factor is not 1/2^N divider, but rather only 1/N divider. It also turns out the input into the PLL seem to be ByteClock instead of DSI HS clock. Rework the P-factor calculation such that the PLL calculation code handles P-factor from 1..32 with P-factors above 16 must be even. In case P-factor is even, enable built-in 1:2 divider and program P-factor/2 to PLL_REF_DIV, otherwise configure only the P-factor into PLL_REF_DIV register. Switch the PLL factor calculation from kHz to Hz to maintain precision. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c [2] https://github.com/tdjastrzebski/ICN6211-Configurator Fixes: f30cf0ece691 ("drm: bridge: icn6211: Add generic DSI-to-DPI PLL configuration") Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220402004118.897014-1-marex@denx.de commit b74d921b900b6ce38c6247c0a1c86be9f3746493 Author: Rex-BC Chen Date: Mon Mar 21 15:23:20 2022 +0800 drm/mediatek: Add vblank register/unregister callback functions We encountered a kernel panic issue that callback data will be NULL when it's using in ovl irq handler. There is a timing issue between mtk_disp_ovl_irq_handler() and mtk_ovl_disable_vblank(). To resolve this issue, we use the flow to register/unregister vblank cb: - Register callback function and callback data when crtc creates. - Unregister callback function and callback data when crtc destroies. With this solution, we can assure callback data will not be NULL when vblank is disable. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220321072320.15019-1-rex-bc.chen@mediatek.com/ Fixes: 9b0704988b15 ("drm/mediatek: Register vblank callback function") Signed-off-by: Rex-BC Chen Reviewed-by: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit 973a9ba5fe489bcb323cc4f4e9ece3959dd50686 Author: Linus Walleij Date: Sat Mar 5 00:36:03 2022 +0100 ARM: dts: ux500: Add GPS to Skomer device tree Signed-off-by: Linus Walleij commit 330e01653ac13e2e51896e3843e4969017b6d28f Author: Linus Walleij Date: Sat Mar 5 00:37:37 2022 +0100 ARM: dts: ux500: Add GPS to Janice device tree This adds the CSR GSD4t GPS to the Janice device tree. Signed-off-by: Linus Walleij commit 07fb1e5babd5d3d4228517295db2ea4067ce2a79 Author: AngeloGioacchino Del Regno Date: Tue Jan 18 14:37:59 2022 +0100 drm/mediatek: mtk_drm_crtc: Use kmalloc in mtk_drm_crtc_duplicate_state Optimize mtk_drm_crtc_duplicate_state() by switching from kzalloc() to kmalloc(): the only variable of this struct that gets checked in other functions is `pending_config`, but if that's set to false, then all of the remaining variables will only ever be set, but not read - so, also set `pending_config` to false. This saves us some small overhead. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220118133759.112458-2-angelogioacchino.delregno@collabora.com/ Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit d327bc37c16a9c55e7d243ada2a58ba764e2bc58 Author: AngeloGioacchino Del Regno Date: Tue Jan 18 14:37:58 2022 +0100 drm/mediatek: mtk_drm_plane: Use kmalloc in mtk_plane_duplicate_state There is no need to zero out the newly allocated memory because we are duplicating all members of struct mtk_plane_state: switch to kmalloc to save some overhead. Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220118133759.112458-1-angelogioacchino.delregno@collabora.com/ Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Chun-Kuang Hu commit 042152c27c3bc3e20882f75c289ced32331f4010 Author: Xu Kuohai Date: Sat Apr 2 03:39:42 2022 -0400 bpf, arm64: Sign return address for JITed code Sign return address for JITed code when the kernel is built with pointer authentication enabled: 1. Sign LR with paciasp instruction before LR is pushed to stack. Since paciasp acts like landing pads for function entry, no need to insert bti instruction before paciasp. 2. Authenticate LR with autiasp instruction after LR is popped from stack. For BPF tail call, the stack frame constructed by the caller is reused by the callee. That is, the stack frame is constructed by the caller and destructed by the callee. Thus LR is signed and pushed to the stack in the caller's prologue, and poped from the stack and authenticated in the callee's epilogue. For BPF2BPF call, the caller and callee construct their own stack frames, and sign and authenticate their own LRs. Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://events.static.linuxfound.org/sites/events/files/slides/slides_23.pdf Link: https://lore.kernel.org/bpf/20220402073942.3782529-1-xukuohai@huawei.com commit 0b5c21bbc01e92745ca1ca4f6fd87d878fa3ea5e Author: Johannes Berg Date: Mon Apr 4 11:38:47 2022 +0200 net: ensure net_todo_list is processed quickly In [1], Will raised a potential issue that the cfg80211 code, which does (from a locking perspective) rtnl_lock() wiphy_lock() rtnl_unlock() might be suspectible to ABBA deadlocks, because rtnl_unlock() calls netdev_run_todo(), which might end up calling rtnl_lock() again, which could then deadlock (see the comment in the code added here for the scenario). Some back and forth and thinking ensued, but clearly this can't happen if the net_todo_list is empty at the rtnl_unlock() here. Clearly, the code here cannot actually put an entry on it, and all other users of rtnl_unlock() will empty it since that will always go through netdev_run_todo(), emptying the list. So the only other way to get there would be to add to the list and then unlock the RTNL without going through rtnl_unlock(), which is only possible through __rtnl_unlock(). However, this isn't exported and not used in many places, and none of them seem to be able to unregister before using it. Therefore, add a WARN_ON() in the code to ensure this invariant won't be broken, so that the cfg80211 (or any similar) code stays safe. [1] https://lore.kernel.org/r/Yjzpo3TfZxtKPMAG@google.com Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220404113847.0ee02e4a70da.Ic73d206e217db20fd22dcec14fe5442ca732804b@changeid Signed-off-by: Jakub Kicinski commit a271bf324150846a253f5cf5406faf600bf64b0c Author: Christophe Branchereau Date: Mon Mar 21 14:36:51 2022 +0100 drm/panel: innolux-ej030na and abt-y030xx067a: add .enable and .disable Following the introduction of bridge_atomic_enable in the ingenic drm driver, the crtc is enabled between .prepare and .enable, if it exists. Add it so the backlight is only enabled after the crtc is, to avoid graphical issues. As we're moving the "sleep out" command out of the init sequence into .enable for the ABT, we need to switch the regmap cache to REGCACHE_FLAT to be able to use regmap_set_bits, given this panel registers are write-ony and read as 0. Signed-off-by: Christophe Branchereau Signed-off-by: Paul Cercueil [pcercuei: Remove empty line after opening brace] Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-4-cbranchereau@gmail.com commit 49956b505c53923723370a8960ae8fcd9e2b2116 Author: Christophe Branchereau Date: Mon Mar 21 14:36:50 2022 +0100 drm/panel: Add panel driver for NewVision NV3052C based LCDs This driver supports the NewVision NV3052C based LCDs. Right now, it only supports the LeadTek LTK035C5444T 2.4" 640x480 TFT LCD panel, which can be found in the Anbernic RG-350M handheld console. Signed-off-by: Christophe Branchereau Signed-off-by: Paul Cercueil [pcercuei: Change msleep(5) to usleep_range(5000, 20000)] Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-3-cbranchereau@gmail.com commit aa46154355e1e81ef746470d2e88bdb283508bff Author: Christophe Branchereau Date: Mon Mar 21 14:36:49 2022 +0100 drm/ingenic: Add ingenic_drm_bridge_atomic_enable and disable ingenic_drm_bridge_atomic_enable allows the CRTC to be enabled after panels have slept out, and before their display is turned on, solving a graphical bug on the newvision nv3502c. Also add ingenic_drm_bridge_atomic_disable to balance it out. Signed-off-by: Christophe Branchereau Signed-off-by: Paul Cercueil Acked-by: Artur Rojek Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-2-cbranchereau@gmail.com commit 6f2f36e5f932c58e370bff79aba7f05963ea1c2a Author: Tom Rix Date: Sat Apr 2 08:15:16 2022 -0400 mlxsw: spectrum_router: simplify list unwinding The setting of i here err_nexthop6_group_get: i = nrt6; Is redundant, i is already nrt6. So remove this statement. The for loop for the unwinding err_rt6_create: for (i--; i >= 0; i--) { Is equivelent to for (; i > 0; i--) { Two consecutive labels can be reduced to one. Signed-off-by: Tom Rix Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220402121516.2750284-1-trix@redhat.com Signed-off-by: Jakub Kicinski commit 9a7ef9f86b96be22d009422e4c0ba52e1292492f Merge: 568189310c209 00a0fa2d7d496 Author: Alexei Starovoitov Date: Tue Apr 5 13:16:08 2022 -0700 Merge branch 'Add libbpf support for USDTs' Andrii Nakryiko says: ==================== Add libbpf support for USDT (User Statically-Defined Tracing) probes. USDTs is important part of tracing, and BPF, ecosystem, widely used in mission-critical production applications for observability, performance analysis, and debugging. And while USDTs themselves are pretty complicated abstraction built on top of uprobes, for end-users USDT is as natural a primitive as uprobes themselves. And thus it's important for libbpf to provide best possible user experience when it comes to build tracing applications relying on USDTs. USDTs historically presented a lot of challenges for libbpf's no compilation-on-the-fly general approach to BPF tracing. BCC utilizes power of on-the-fly source code generation and compilation using its embedded Clang toolchain, which was impractical for more lightweight and thus more rigid libbpf-based approach. But still, with enough diligence and BPF cookies it's possible to implement USDT support that feels as natural as tracing any uprobe. This patch set is the culmination of such effort to add libbpf USDT support following the spirit and philosophy of BPF CO-RE (even though it's not inherently relying on BPF CO-RE much, see patch #1 for some notes regarding this). Each respective patch has enough details and explanations, so I won't go into details here. In the end, I think the overall usability of libbpf's USDT support *exceeds* the status quo set by BCC due to the elimination of awkward runtime USDT supporting code generation. It also exceeds BCC's capabilities due to the use of BPF cookie. This eliminates the need to determine a USDT call site (and thus specifics about how exactly to fetch arguments) based on its *absolute IP address*, which is impossible with shared libraries if no PID is specified (as we then just *can't* know absolute IP at which shared library is loaded, because it might be different for each process). With BPF cookie this is not a problem as we record "call site ID" directly in a BPF cookie value. This makes it possible to do a system-wide tracing of a USDT defined in a shared library. Think about tracing some USDT in libc across any process in the system, both running at the time of attachment and all the new processes started *afterwards*. This is a very powerful capability that allows more efficient observability and tracing tooling. Once this functionality lands, the plan is to extend libbpf-bootstrap ([0]) with an USDT example. It will also become possible to start converting BCC tools that rely on USDTs to their libbpf-based counterparts ([1]). It's worth noting that preliminary version of this code was currently used and tested in production code running fleet-wide observability toolkit. Libbpf functionality is broken down into 5 mostly logically independent parts, for ease of reviewing: - patch #1 adds BPF-side implementation; - patch #2 adds user-space APIs and wires bpf_link for USDTs; - patch #3 adds the most mundate pieces: handling ELF, parsing USDT notes, dealing with memory segments, relative vs absolute addresses, etc; - patch #4 adds internal ID allocation and setting up/tearing down of BPF-side state (spec and IP-to-ID mapping); - patch #5 implements x86/x86-64-specific logic of parsing USDT argument specifications; - patch #6 adds testing of various basic aspects of handling of USDT; - patch #7 extends the set of tests with more combinations of semaphore, executable vs shared library, and PID filter options. [0] https://github.com/libbpf/libbpf-bootstrap [1] https://github.com/iovisor/bcc/tree/master/libbpf-tools v2->v3: - fix typos, leave link to systemtap doc, acks, etc (Dave); - include sys/sdt.h to avoid extra system-wide package dependencies; v1->v2: - huge high-level comment describing how all the moving parts fit together (Alan, Alexei); - switched from `__hidden __weak` to `static inline __noinline` for now, as there is a bug in BPF linker breaking final BPF object file due to invalid .BTF.ext data; I want to fix it separately at which point I'll switch back to __hidden __weak again. The fix isn't trivial, so I don't want to block on that. Same for __weak variable lookup bug that Henqi reported. - various fixes and improvements, addressing other feedback (Alan, Hengqi); Cc: Alan Maguire Cc: Dave Marchevsky Cc: Hengqi Chen ==================== Signed-off-by: Alexei Starovoitov commit 00a0fa2d7d496824648b125256c5566f36b48dad Author: Andrii Nakryiko Date: Mon Apr 4 16:42:02 2022 -0700 selftests/bpf: Add urandom_read shared lib and USDTs Extend urandom_read helper binary to include USDTs of 4 combinations: semaphore/semaphoreless (refcounted and non-refcounted) and based in executable or shared library. We also extend urandom_read with ability to report it's own PID to parent process and wait for parent process to ready itself up for tracing urandom_read. We utilize popen() and underlying pipe properties for proper signaling. Once urandom_read is ready, we add few tests to validate that libbpf's USDT attachment handles all the above combinations of semaphore (or lack of it) and static or shared library USDTs. Also, we validate that libbpf handles shared libraries both with PID filter and without one (i.e., -1 for PID argument). Having the shared library case tested with and without PID is important because internal logic differs on kernels that don't support BPF cookies. On such older kernels, attaching to USDTs in shared libraries without specifying concrete PID doesn't work in principle, because it's impossible to determine shared library's load address to derive absolute IPs for uprobe attachments. Without absolute IPs, it's impossible to perform correct look up of USDT spec based on uprobe's absolute IP (the only kind available from BPF at runtime). This is not the problem on newer kernels with BPF cookie as we don't need IP-to-ID lookup because BPF cookie value *is* spec ID. So having those two situations as separate subtests is good because libbpf CI is able to test latest selftests against old kernels (e.g., 4.9 and 5.5), so we'll be able to disable PID-less shared lib attachment for old kernels, but will still leave PID-specific one enabled to validate this legacy logic is working correctly. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20220404234202.331384-8-andrii@kernel.org commit 630301b0d59dd85e43cca29382c459f9880af5f0 Author: Andrii Nakryiko Date: Mon Apr 4 16:42:01 2022 -0700 selftests/bpf: Add basic USDT selftests Add semaphore-based USDT to test_progs itself and write basic tests to valicate both auto-attachment and manual attachment logic, as well as BPF-side functionality. Also add subtests to validate that libbpf properly deduplicates USDT specs and handles spec overflow situations correctly, as well as proper "rollback" of partially-attached multi-spec USDT. BPF-side of selftest intentionally consists of two files to validate that usdt.bpf.h header can be included from multiple source code files that are subsequently linked into final BPF object file without causing any symbol duplication or other issues. We are validating that __weak maps and bpf_usdt_xxx() API functions defined in usdt.bpf.h do work as intended. USDT selftests utilize sys/sdt.h header that on Ubuntu systems comes from systemtap-sdt-devel package. But to simplify everyone's life, including CI but especially casual contributors to bpf/bpf-next that are trying to build selftests, I've checked in sys/sdt.h header from [0] directly. This way it will work on all architectures and distros without having to figure it out for every relevant combination and adding any extra implicit package dependencies. [0] https://sourceware.org/git?p=systemtap.git;a=blob_plain;f=includes/sys/sdt.h;h=ca0162b4dc57520b96638c8ae79ad547eb1dd3a1;hb=HEAD Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20220404234202.331384-7-andrii@kernel.org commit 4c59e584d1581b1bca143dda83d5c3e5baddbf20 Author: Andrii Nakryiko Date: Mon Apr 4 16:42:00 2022 -0700 libbpf: Add x86-specific USDT arg spec parsing logic Add x86/x86_64-specific USDT argument specification parsing. Each architecture will require their own logic, as all this is arch-specific assembly-based notation. Architectures that libbpf doesn't support for USDTs will pr_warn() with specific error and return -ENOTSUP. We use sscanf() as a very powerful and easy to use string parser. Those spaces in sscanf's format string mean "skip any whitespaces", which is pretty nifty (and somewhat little known) feature. All this was tested on little-endian architecture, so bit shifts are probably off on big-endian, which our CI will hopefully prove. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Reviewed-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20220404234202.331384-6-andrii@kernel.org commit 999783c8bbda2e82390cb8c39ed9e3954cf51b82 Author: Andrii Nakryiko Date: Mon Apr 4 16:41:59 2022 -0700 libbpf: Wire up spec management and other arch-independent USDT logic Last part of architecture-agnostic user-space USDT handling logic is to set up BPF spec and, optionally, IP-to-ID maps from user-space. usdt_manager performs a compact spec ID allocation to utilize fixed-sized BPF maps as efficiently as possible. We also use hashmap to deduplicate USDT arg spec strings and map identical strings to single USDT spec, minimizing the necessary BPF map size. usdt_manager supports arbitrary sequences of attachment and detachment, both of the same USDT and multiple different USDTs and internally maintains a free list of unused spec IDs. bpf_link_usdt's logic is extended with proper setup and teardown of this spec ID free list and supporting BPF maps. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Reviewed-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20220404234202.331384-5-andrii@kernel.org commit 74cc6311cec906daf1d64cefe4922dbf79c416c9 Author: Andrii Nakryiko Date: Mon Apr 4 16:41:58 2022 -0700 libbpf: Add USDT notes parsing and resolution logic Implement architecture-agnostic parts of USDT parsing logic. The code is the documentation in this case, it's futile to try to succinctly describe how USDT parsing is done in any sort of concreteness. But still, USDTs are recorded in special ELF notes section (.note.stapsdt), where each USDT call site is described separately. Along with USDT provider and USDT name, each such note contains USDT argument specification, which uses assembly-like syntax to describe how to fetch value of USDT argument. USDT arg spec could be just a constant, or a register, or a register dereference (most common cases in x86_64), but it technically can be much more complicated cases, like offset relative to global symbol and stuff like that. One of the later patches will implement most common subset of this for x86 and x86-64 architectures, which seems to handle a lot of real-world production application. USDT arg spec contains a compact encoding allowing usdt.bpf.h from previous patch to handle the above 3 cases. Instead of recording which register might be needed, we encode register's offset within struct pt_regs to simplify BPF-side implementation. USDT argument can be of different byte sizes (1, 2, 4, and 8) and signed or unsigned. To handle this, libbpf pre-calculates necessary bit shifts to do proper casting and sign-extension in a short sequences of left and right shifts. The rest is in the code with sometimes extensive comments and references to external "documentation" for USDTs. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Reviewed-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20220404234202.331384-4-andrii@kernel.org commit 2e4913e025fdef740972ac70277297436cccb27f Author: Andrii Nakryiko Date: Mon Apr 4 16:41:57 2022 -0700 libbpf: Wire up USDT API and bpf_link integration Wire up libbpf USDT support APIs without yet implementing all the nitty-gritty details of USDT discovery, spec parsing, and BPF map initialization. User-visible user-space API is simple and is conceptually very similar to uprobe API. bpf_program__attach_usdt() API allows to programmatically attach given BPF program to a USDT, specified through binary path (executable or shared lib), USDT provider and name. Also, just like in uprobe case, PID filter is specified (0 - self, -1 - any process, or specific PID). Optionally, USDT cookie value can be specified. Such single API invocation will try to discover given USDT in specified binary and will use (potentially many) BPF uprobes to attach this program in correct locations. Just like any bpf_program__attach_xxx() APIs, bpf_link is returned that represents this attachment. It is a virtual BPF link that doesn't have direct kernel object, as it can consist of multiple underlying BPF uprobe links. As such, attachment is not atomic operation and there can be brief moment when some USDT call sites are attached while others are still in the process of attaching. This should be taken into consideration by user. But bpf_program__attach_usdt() guarantees that in the case of success all USDT call sites are successfully attached, or all the successfuly attachments will be detached as soon as some USDT call sites failed to be attached. So, in theory, there could be cases of failed bpf_program__attach_usdt() call which did trigger few USDT program invocations. This is unavoidable due to multi-uprobe nature of USDT and has to be handled by user, if it's important to create an illusion of atomicity. USDT BPF programs themselves are marked in BPF source code as either SEC("usdt"), in which case they won't be auto-attached through skeleton's __attach() method, or it can have a full definition, which follows the spirit of fully-specified uprobes: SEC("usdt/::"). In the latter case skeleton's attach method will attempt auto-attachment. Similarly, generic bpf_program__attach() will have enought information to go off of for parameterless attachment. USDT BPF programs are actually uprobes, and as such for kernel they are marked as BPF_PROG_TYPE_KPROBE. Another part of this patch is USDT-related feature probing: - BPF cookie support detection from user-space; - detection of kernel support for auto-refcounting of USDT semaphore. The latter is optional. If kernel doesn't support such feature and USDT doesn't rely on USDT semaphores, no error is returned. But if libbpf detects that USDT requires setting semaphores and kernel doesn't support this, libbpf errors out with explicit pr_warn() message. Libbpf doesn't support poking process's memory directly to increment semaphore value, like BCC does on legacy kernels, due to inherent raciness and danger of such process memory manipulation. Libbpf let's kernel take care of this properly or gives up. Logistically, all the extra USDT-related infrastructure of libbpf is put into a separate usdt.c file and abstracted behind struct usdt_manager. Each bpf_object has lazily-initialized usdt_manager pointer, which is only instantiated if USDT programs are attempted to be attached. Closing BPF object frees up usdt_manager resources. usdt_manager keeps track of USDT spec ID assignment and few other small things. Subsequent patches will fill out remaining missing pieces of USDT initialization and setup logic. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220404234202.331384-3-andrii@kernel.org commit d72e2968fb2583460062e15d53760d44e2d09ae6 Author: Andrii Nakryiko Date: Mon Apr 4 16:41:56 2022 -0700 libbpf: Add BPF-side of USDT support Add BPF-side implementation of libbpf-provided USDT support. This consists of single header library, usdt.bpf.h, which is meant to be used from user's BPF-side source code. This header is added to the list of installed libbpf header, along bpf_helpers.h and others. BPF-side implementation consists of two BPF maps: - spec map, which contains "a USDT spec" which encodes information necessary to be able to fetch USDT arguments and other information (argument count, user-provided cookie value, etc) at runtime; - IP-to-spec-ID map, which is only used on kernels that don't support BPF cookie feature. It allows to lookup spec ID based on the place in user application that triggers USDT program. These maps have default sizes, 256 and 1024, which are chosen conservatively to not waste a lot of space, but handling a lot of common cases. But there could be cases when user application needs to either trace a lot of different USDTs, or USDTs are heavily inlined and their arguments are located in a lot of differing locations. For such cases it might be necessary to size those maps up, which libbpf allows to do by overriding BPF_USDT_MAX_SPEC_CNT and BPF_USDT_MAX_IP_CNT macros. It is an important aspect to keep in mind. Single USDT (user-space equivalent of kernel tracepoint) can have multiple USDT "call sites". That is, single logical USDT is triggered from multiple places in user application. This can happen due to function inlining. Each such inlined instance of USDT invocation can have its own unique USDT argument specification (instructions about the location of the value of each of USDT arguments). So while USDT looks very similar to usual uprobe or kernel tracepoint, under the hood it's actually a collection of uprobes, each potentially needing different spec to know how to fetch arguments. User-visible API consists of three helper functions: - bpf_usdt_arg_cnt(), which returns number of arguments of current USDT; - bpf_usdt_arg(), which reads value of specified USDT argument (by it's zero-indexed position) and returns it as 64-bit value; - bpf_usdt_cookie(), which functions like BPF cookie for USDT programs; this is necessary as libbpf doesn't allow specifying actual BPF cookie and utilizes it internally for USDT support implementation. Each bpf_usdt_xxx() APIs expect struct pt_regs * context, passed into BPF program. On kernels that don't support BPF cookie it is used to fetch absolute IP address of the underlying uprobe. usdt.bpf.h also provides BPF_USDT() macro, which functions like BPF_PROG() and BPF_KPROBE() and allows much more user-friendly way to get access to USDT arguments, if USDT definition is static and known to the user. It is expected that majority of use cases won't have to use bpf_usdt_arg_cnt() and bpf_usdt_arg() directly and BPF_USDT() will cover all their needs. Last, usdt.bpf.h is utilizing BPF CO-RE for one single purpose: to detect kernel support for BPF cookie. If BPF CO-RE dependency is undesirable, user application can redefine BPF_USDT_HAS_BPF_COOKIE to either a boolean constant (or equivalently zero and non-zero), or even point it to its own .rodata variable that can be specified from user's application user-space code. It is important that BPF_USDT_HAS_BPF_COOKIE is known to BPF verifier as static value (thus .rodata and not just .data), as otherwise BPF code will still contain bpf_get_attach_cookie() BPF helper call and will fail validation at runtime, if not dead-code eliminated. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220404234202.331384-2-andrii@kernel.org commit b2fa90ef62558ed65f09201b4c8b79ece4468275 Author: Christophe Leroy Date: Thu Mar 31 12:13:10 2022 +0200 powerpc/85xx: Remove fsl,85... bindings Since 8a4ab218ef70 ("powerpc/85xx: Change deprecated binding for 85xx-based boards") those bindings are not used anymore. A comment in drivers/edac/mpc85xx_edac.c say they are to be removed with kernel 2.6.30. Remove them now. Signed-off-by: Christophe Leroy Signed-off-by: Borislav Petkov Acked-by: Krzysztof Kozlowski Acked-by: Scott Wood Link: https://lore.kernel.org/r/82a8bc4450a4daee50ee5fada75621fecb3703ff.1648721299.git.christophe.leroy@csgroup.eu commit 0205f8a738ab9e62d849e88e543cfa6ce4c13163 Author: Ricardo Cañuelo Date: Fri Apr 1 09:45:17 2022 +0200 x86/speculation/srbds: Do not try to turn mitigation off when not supported When SRBDS is mitigated by TSX OFF, update_srbds_msr() will still read and write to MSR_IA32_MCU_OPT_CTRL even when that MSR is not supported due to not having loaded the appropriate microcode. Check for X86_FEATURE_SRBDS_CTRL which is set only when the respective microcode which adds MSR_IA32_MCU_OPT_CTRL is loaded. Based on a patch by Thadeu Lima de Souza Cascardo . [ bp: Massage commit message. ] Suggested-by: Pawan Gupta Signed-off-by: Ricardo Cañuelo Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220401074517.1848264-1-ricardo.canuelo@collabora.com commit 59729170afcd4900e08997a482467ffda8d88c7f Author: David Gow Date: Sat Apr 2 12:35:29 2022 +0800 kunit: Make kunit_remove_resource() idempotent The kunit_remove_resource() function is used to unlink a resource from the list of resources in the test, making it no longer show up in kunit_find_resource(). However, this could lead to a race condition if two threads called kunit_remove_resource() on the same resource at the same time: the resource would be removed from the list twice (causing a crash at the second list_del()), and the refcount for the resource would be decremented twice (instead of once, for the reference held by the resource list). Fix both problems, the first by using list_del_init(), and the second by checking if the resource has already been removed using list_empty(), and only decrementing its refcount if it has not. Also add a KUnit test for the kunit_remove_resource() function which tests this behaviour. Reported-by: Daniel Latypov Signed-off-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 1ff522b6ef4b40e7f46a9d8efe7554b2f3d36311 Author: David Gow Date: Sat Mar 5 15:40:20 2022 +0800 list: test: Test the hlist structure Add KUnit tests to the hlist linked-list structure which is used by hashtables. This should give coverage of every function and macro in list.h, as well as (combined with the KUnit tests for the hash functions) get very close to having tests for the hashtable structure. The tests here mirror the existing list tests, and are found in a new suite titled 'hlist'. Signed-off-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e5f28623ceb103e13fc3d7bd45edf9818b227fd0 Author: Ammar Faizi Date: Tue Mar 29 17:47:05 2022 +0700 x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails In mce_threshold_create_device(), if threshold_create_bank() fails, the previously allocated threshold banks array @bp will be leaked because the call to mce_threshold_remove_device() will not free it. This happens because mce_threshold_remove_device() fetches the pointer through the threshold_banks per-CPU variable but bp is written there only after the bank creation is successful, and not before, when threshold_create_bank() fails. Add a helper which unwinds all the bank creation work previously done and pass into it the previously allocated threshold banks array for freeing. [ bp: Massage. ] Fixes: 6458de97fc15 ("x86/mce/amd: Straighten CPU hotplug path") Co-developed-by: Alviro Iskandar Setiawan Signed-off-by: Alviro Iskandar Setiawan Co-developed-by: Yazen Ghannam Signed-off-by: Yazen Ghannam Signed-off-by: Ammar Faizi Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220329104705.65256-3-ammarfaizi2@gnuweeb.org commit 9f1b19b977ee3cbd3fe9135ff63dbf221eac1d6a Author: Smita Koralahalli Date: Fri Feb 25 13:33:40 2022 -0600 x86/mce: Avoid unnecessary padding in struct mce_bank Convert struct mce_bank member "init" from bool to a bitfield to get rid of unnecessary padding. $ pahole -C mce_bank arch/x86/kernel/cpu/mce/core.o before: /* size: 16, cachelines: 1, members: 2 */ /* padding: 7 */ /* last cacheline: 16 bytes */ after: /* size: 16, cachelines: 1, members: 3 */ /* last cacheline: 16 bytes */ No functional changes. Signed-off-by: Smita Koralahalli Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220225193342.215780-2-Smita.KoralahalliChannabasappa@amd.com commit b86eb74098a92afd789da02699b4b0dd3f73b889 Author: Ammar Faizi Date: Tue Mar 29 17:47:04 2022 +0700 x86/delay: Fix the wrong asm constraint in delay_loop() The asm constraint does not reflect the fact that the asm statement can modify the value of the local variable loops. Which it does. Specifying the wrong constraint may lead to undefined behavior, it may clobber random stuff (e.g. local variable, important temporary value in regs, etc.). This is especially dangerous when the compiler decides to inline the function and since it doesn't know that the value gets modified, it might decide to use it from a register directly without reloading it. Change the constraint to "+a" to denote that the first argument is an input and an output argument. [ bp: Fix typo, massage commit message. ] Fixes: e01b70ef3eb3 ("x86: fix bug in arch/i386/lib/delay.c file, delay_loop function") Signed-off-by: Ammar Faizi Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220329104705.65256-2-ammarfaizi2@gnuweeb.org commit ad47f8343a96cc1ebd3654a645d86c63eaeefb39 Author: Davidlohr Bueso Date: Thu Mar 24 12:09:50 2022 -0700 thermal: int340x: Clean up _OSC context init Now that the UUID is already sanitized by the caller, lets trivially clean up some of the context arming. Signed-off-by: Davidlohr Bueso Acked-by: Zhang Rui [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit 9e5d3d6be66472037c4b20b7d2b43e916207ab77 Author: Davidlohr Bueso Date: Thu Mar 24 12:09:49 2022 -0700 thermal: int340x: Consolidate freeing of acpi_buffer pointer Introduce a single point of freeing/exit after ensuring no error in int3400_setup_gddv(). Signed-off-by: Davidlohr Bueso Acked-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit bdff938d04409aba0e43e408ee47d45d1486b2ae Author: Davidlohr Bueso Date: Thu Mar 24 12:09:48 2022 -0700 thermal: int340x: Clean up unnecessary acpi_buffer pointer freeing It is the caller's responsibility to free only upon ACPI_SUCCESS. Signed-off-by: Davidlohr Bueso Acked-by: Zhang Rui [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit bd8284e968ecfc7777703cd76eabbbbf9f3ac9ff Author: Jonathan Cameron Date: Fri Apr 1 15:06:05 2022 +0100 iio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace Avoid unnecessary pollution of the global symbol namespace by moving library functions in to a specific namespace and import that into the drivers that make use of the functions. For more info: https://lwn.net/Articles/760045/ Signed-off-by: Jonathan Cameron Cc: Tomasz Duszynski Signed-off-by: Rafael J. Wysocki commit a8e2512efc65892a1cbf608d9c03c8bcbe5a623a Author: Jonathan Cameron Date: Fri Apr 1 15:06:04 2022 +0100 PM: core: Add NS varients of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and runtime pm equiv As more drivers start to use namespaces, we need to have varients of these useful macros that allow the export to be in a particular namespace. Signed-off-by: Jonathan Cameron Cc: Paul Cercueil Signed-off-by: Rafael J. Wysocki commit 95d5a7214b86e64dc97db3d35f6d97533f89fb32 Author: Jonathan Cameron Date: Fri Apr 1 15:06:03 2022 +0100 iio: chemical: scd30: Export dev_pm_ops instead of suspend() and resume() Whilst here move to the new infrastructure using pm_sleep_ptr() and EXPORT_DEV_PM_OPS() so as to let the compiler remove the unused code if CONFIG_SLEEP is not defined. Signed-off-by: Jonathan Cameron Cc: Tomasz Duszynski Signed-off-by: Rafael J. Wysocki commit 98b7630a583fe970f59742dc855d1c03e258d645 Author: Srinivasa Rao Mandadapu Date: Mon Mar 21 14:26:21 2022 +0530 ASoC: dt-bindings: lpass-cpu: Update clocks and power domain names for sc7280 platform Update required clock-names used for MI2S primary path, VA macro's codec memory path and HDMI path in sc7280 based platforms. Update power domain names required for sc7280 platforms. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1647852981-27895-4-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 9108c3446f6e86146f0d3141b94415eb98c39566 Author: Srinivasa Rao Mandadapu Date: Mon Mar 21 14:26:20 2022 +0530 ASoC: dt-bindings: wcd938x: Add mic bias supply property Add vdd mic bias supply, which is required to provide bias for wcd938x codec. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Acked-by: Rob Herring Link: https://lore.kernel.org/r/1647852981-27895-3-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 852fda58d99a6c397f8303a8cd8ccec8702d82f5 Author: Srinivasa Rao Mandadapu Date: Mon Mar 21 14:26:19 2022 +0530 ASoC: qcom: dt-bindings: Update bindings for clocks in lpass digital codes Update dt-bindings for clocks as per ADSP bypass solutions, in which macro dcodec GDSCs are enabled using power domains in lpass digital codec drivers. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1647852981-27895-2-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit f28dbaa958fbd8fb7ffe40211b0e083156191f84 Author: Kuninori Morimoto Date: Tue Apr 5 02:06:51 2022 +0000 ASoC: ak4613: add TDM256 support AK4613 has STEREO/TDM512/TDM256/TDM128 mode. Renesas is the only user of ak4613 on upstream for now, and is using it as STEREO mode, because of board connection. Thus, current driver is supporting STEREO mode only, and other modes are not supported. But I noticed that I can try first 2ch out of TDM256 mode 8ch Playback even in such a situation. But because of board connection, I can't test full TDM256 mode, and/or other TDM mode. Thus I don't want to add new DT propaty for now. This patch enables TDM256 mode test by "ifdef style", but it has no effect to current supported STEREO mode. You can define AK4613_ENABLE_TDM_TEST to try TDM256 mode. Please don't hesitate to break current code if you can add full TDM256 and/or other TDM mode. You don't need to care compatibility with Renesas. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/878rskp9l0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7bbb049c961a4e6b33520ab56d4b3abd947315ca Author: Kuninori Morimoto Date: Tue Apr 5 02:06:44 2022 +0000 ASoC: ak4613: rename constraint to constraint_rates TDM support needs to use constraint_channels. This patch renames current constraint to constraint_rates for it. This is prepare for TDM support. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87a6d0p9l7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e67d19a400cb12650169e4f57b8943e41266de53 Author: Kuninori Morimoto Date: Tue Apr 5 02:06:34 2022 +0000 ASoC: ak4613: priv has ctrl1 instead of iface Current priv is using ->iface, but it is not good match to support TDM. This patch adds ->ctrl1 instead of it. This is prepare for TDM support. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87bkxgp9lh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c08673ede71fba70a10be0470565ed2470ef1fe5 Author: Kuninori Morimoto Date: Tue Apr 5 02:06:25 2022 +0000 ASoC: ak4613: return error if it was setup as clock provider Renesas is only user of ak4613 on upstream, and it is tested only under "clock consumer" because of board mounting situation. Thus, "clock provider" is not supperted/tested. This patch return error if it was setup as clock provider. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87czhwp9lq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit f7c0e14f5717aabc5db7e4eb6324d750d415d022 Author: Kuninori Morimoto Date: Tue Apr 5 02:06:17 2022 +0000 ASoC: ak4613: tidyup ak4613_interface ak4613 driver is assuming symmetric format. Thus, we don't need to have asymmetric table for judging the iface at .hw_param. This patch cleanup ak4613_interface for it. This is prepare for TDM support. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ee2cp9lz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3407e36dc78f4a980588c9347076aee9925ca51f Author: Kuninori Morimoto Date: Tue Apr 5 02:06:08 2022 +0000 ASoC: ak4613: add missing mutex_lock() We need to use mutex_lock() for priv->cnt / priv->iface, but we are missing it at ak4613_dai_startup(). This patch adds missing mutex_lock() for it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fsmsp9m7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0d463d016000d68d7e982720b5e4380b2d83409a Author: James Schulman Date: Tue Apr 5 14:54:19 2022 +0100 ASoC: cs35l45: Add driver for Cirrus Logic CS35L45 Smart Amp The CS35L45 is a 15 V Boosted Mono Class D Amplifier with DSP Speaker Protection and Adaptive Battery Management. This initial driver provides standard non-boosted audio operation without the DSP. Signed-off-by: James Schulman Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220405135419.1230088-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 72661ff7662acc00d51976d4b2d2d13eb5628385 Author: Richard Fitzgerald Date: Tue Apr 5 14:54:18 2022 +0100 ASoC: dt-bindings: cs35l45: Cirrus Logic CS35L45 Smart Amp This adds the schema binding for the Cirrus Logic CS35L45 Smart Amp and associated header file. Signed-off-by: Richard Fitzgerald Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220405135419.1230088-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 89342fa38bbaade51584f255eee5cd43621f4e10 Author: Richard Fitzgerald Date: Tue Apr 5 14:54:17 2022 +0100 ASoC: soc-utils: Add kunit test for snd_soc_tdm_params_to_bclk() Create a new kunit test for soc-utils and use it to test snd_soc_tdm_params_to_bclk(). The test uses a table of values to avoid the possibility that an on-the-fly generator contains the same algorithmic error as the function-under-test and so fails to detect a bug. There is no need to test every possible combination of values. Enough test cases are included to give confidence that the function is producing the correct results. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220405135419.1230088-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 1ef34dd2b90d78a9830398441801658ef86eee9d Author: Richard Fitzgerald Date: Tue Apr 5 14:54:16 2022 +0100 ASoC: soc-utils: Add helper to calculate BCLK from TDM info Add a helper function snd_soc_tdm_params_to_bclk() to calculate the bclk from params info and the tdm sots configuration. When using a TDM frame of N slots of width W bits: bclk = sample_rate * N * W As a convenience to simplify calling code, if the slot count or slot width are 0 a value will be obtained from the params. This allows calling code to use this one function to handle cases of TDM where only one parameter is fixed, or I2S where the slot width is fixed (for example to set a 32-bit slot for 24-bit samples). Also as a convenience the slot count can optionally be rounded up to a multiple. This is mainly useful for I2S systems, since I2S has two phases of LRCLK the number of slots is always a multiple of 2. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220405135419.1230088-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit bc8cb02976cd602b8d7631a6f4a54a9cf305d38c Author: Richard Fitzgerald Date: Tue Apr 5 14:54:15 2022 +0100 ASoC: soc.h: Add SOC_SINGLE_S_TLV() macro Add a convenience macro for defining a single (mono) TLV control with a signed value. This can already be done by using SOC_DOUBLE_R_S_TLV() with the same address for left and right registers, but a dedicated macro is more readable. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220405135419.1230088-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit e1907d37514b8564ba18b4a768a35beee71cb011 Author: Muralidhara M K Date: Thu Mar 24 17:57:29 2022 +0530 x86/amd_nb: Unexport amd_cache_northbridges() amd_cache_northbridges() is exported by amd_nb.c and is called by amd64-agp.c and amd64_edac.c modules at module_init() time so that NB descriptors are properly cached before those drivers can use them. However, the init_amd_nbs() initcall already does call amd_cache_northbridges() unconditionally and thus makes sure the NB descriptors are enumerated. That initcall is a fs_initcall type which is on the 5th group (starting from 0) of initcalls that gets run in increasing numerical order by the init code. The module_init() call is turned into an __initcall() in the MODULE=n case and those are device-level initcalls, i.e., group 6. Therefore, the northbridges caching is already finished by the time module initialization starts and thus the correct initialization order is retained. Unexport amd_cache_northbridges(), update dependent modules to call amd_nb_num() instead. While at it, simplify the checks in amd_cache_northbridges(). [ bp: Heavily massage and *actually* explain why the change is ok. ] Signed-off-by: Muralidhara M K Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324122729.221765-1-nchatrad@amd.com commit 046f773be106ec8eb92b13414c90f8e279deffe0 Author: Brijesh Singh Date: Mon Mar 7 15:33:11 2022 -0600 KVM: SVM: Define sev_features and VMPL field in the VMSA The hypervisor uses the sev_features field (offset 3B0h) in the Save State Area to control the SEV-SNP guest features such as SNPActive, vTOM, ReflectVC etc. An SEV-SNP guest can read the sev_features field through the SEV_STATUS MSR. While at it, update dump_vmcb() to log the VMPL level. See APM2 Table 15-34 and B-4 for more details. Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lore.kernel.org/r/20220307213356.2797205-2-brijesh.singh@amd.com commit 4407cca0109c47da912d1035b5ed344ac85eed32 Author: Tang Yizhou Date: Tue Mar 29 15:23:58 2022 +0800 docs/zh_CN: Add schedutil Chinese translation Translate scheduler/schedutil.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 0dc089481308f0acf6bfd722df9d6fed2f534d5d Author: Tang Yizhou Date: Thu Mar 17 10:59:14 2022 +0800 docs/zh_CN: Add sched-debug Chinese translation Translate scheduler/sched-debug.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Signed-off-by: Jonathan Corbet commit d4cd2389d053d27ed00a80ddd2217791eebe3185 Author: Chin En Lin Date: Fri Mar 18 22:25:36 2022 +0800 Documentation: x86: Fix obsolete name of page fault handler Since commit 91eeafea1e4b ("x86/entry: Switch page fault exception to IDTENTRY_RAW"), the function name of the page fault handler is out of date. And because of commit aa37c51b9421 ("x86/mm: Break out user address space handling"), the description of search_exception_table is not correct anymore. It may mislead the user who wants to use the documentation to figure out the page fault handler. Also, fix typo and add the parentheses after function and macro name. Signed-off-by: Chin En Lin Signed-off-by: Jonathan Corbet commit b2405aa948b95afc5246fa56fc05c3512cd6185c Author: Takashi Sakamoto Date: Tue Apr 5 16:22:21 2022 +0900 firewire: add kernel API to access packet structure in request structure for AR context In 1394 OHCI specification, descriptor of Asynchronous Receive DMA context has timeStamp field in its trailer quadlet. The field is written by the host controller for the time to receive asynchronous request subaction in isochronous cycle time. In Linux FireWire subsystem, the value of field is stored to fw_packet structure and copied to fw_request structure as the part. The fw_request structure is hidden from unit driver and passed as opaque pointer when calling registered handler. It's inconvenient to the unit driver which needs timestamp of packet. This commit adds kernel API to pick up timestamp from opaque pointer to fw_request structure. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220405072221.226217-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit baa914cd81f51f4e4f3bae5bb59764b32ad8c353 Author: Takashi Sakamoto Date: Tue Apr 5 16:22:20 2022 +0900 firewire: add kernel API to access CYCLE_TIME register 1394 OHCI specification defined Isochronous Cycle Timer Register to get value of CYCLE_TIME register defined by IEEE 1394 for CSR architecture defined by ISO/IEC 13213. Unit driver can calculate packet time by compute with the value of CYCLE_TIME and timeStamp field in descriptor of each isochronous and asynchronous context. The resolution of CYCLE_TIME is 49.576 MHz, while the one of timeStamp is 8,000 Hz. Current implementation of Linux FireWire subsystem allows the driver to get the value of CYCLE_TIMER CSR register by transaction service. The transaction service has overhead in regard of access to MMIO register. This commit adds kernel API for unit driver to access the register directly. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220405072221.226217-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit e70b6693cec229717dda683699ae1fd9ed160e3d Author: Hector Martin Date: Tue Apr 5 16:22:19 2022 +0900 firewire: Add dummy read_csr/write_csr functions (Hector Martin wrote) This fixes segfaults when a card gets yanked off of the PCIe bus while busy, e.g. with a userspace app trying to get the cycle time: [8638860.994310] Call Trace: [8638860.994313] ioctl_get_cycle_timer2+0x4f/0xd0 [firewire_core] [8638860.994323] fw_device_op_ioctl+0xae/0x150 [firewire_core] [8638860.994328] __x64_sys_ioctl+0x7d/0xb0 [8638860.994332] do_syscall_64+0x45/0x80 [8638860.994337] entry_SYSCALL_64_after_hwframe+0x44/0xae (Takashi Sakamoto wrote) As long as reading commit 20802224298c ("firewire: core: add forgotten dummy driver methods, remove unused ones"), three functions are not implemeted in dummy driver for reason; .read_csr, .write_csr, and .set_config_rom. In core of Linux FireWire subsystem, the callback of .set_config_rom is under acquisition of mutual exclusive for local list of card. The acquision is also done in process for removal of card, therefore it's safe for missing implementation of .set_config_rom. On the other hand, no lock primitive accompanies any call of .read_csr and .write_csr. For userspace client, check of node shutdown is done in the beginning of dispatch of ioctl request, while node shifts to shutdown state in workqueue context enough after card shifts to dummy driver. It's probable that these two functions are called for the dummy driver by the code of userspace client. In-kernel unit driver has similar situation. It's better to add implementation of the two functions for dummy driver. Signed-off-by: Hector Martin Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220405072221.226217-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 7808c934120e6ffa95c0b11d3e079cb617f195fc Author: Markus Reichl Date: Mon Mar 21 13:04:11 2022 +0100 w1: w1_therm: Document Maxim MAX31850 thermoelement IF. w1_therm driver supports now MAX31850, too. Add it to documentation and fix a small typo. Signed-off-by: Markus Reichl Signed-off-by: Jonathan Corbet commit 6ac2eec3f008ed08dd20a9e3d598d792aee779ad Author: Colin Ian King Date: Tue Apr 5 14:54:12 2022 +0100 ALSA: echoaudio: remove redundant assignment to variable i The variable i is being assigned a value that is never read, it is being re-assigned in the following for-loop. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220405135412.199251-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai commit ca3d0b5dfc6bdb4ce33330fec313e4a0afb2c3d4 Author: Catalin Marinas Date: Thu Mar 24 15:16:05 2022 +0000 Documentation/process: Update ARM contact for embargoed hardware issues With Grant taking a prominent role in Linaro, I will take over as the process ambassador for ARM w.r.t. embargoed hardware issues. Signed-off-by: Catalin Marinas Cc: Grant Likely Cc: Jonathan Corbet Cc: Greg Kroah-Hartman Signed-off-by: Jonathan Corbet commit e7ff672165c081e115aa8dbba52c9f6aa3078ce8 Author: Robin Murphy Date: Tue Apr 5 14:27:54 2022 +0100 ALSA: emu10k1: Stop using iommu_present() iommu_get_domain_for_dev() is already perfectly happy to return NULL if the given device has no IOMMU. Drop the unnecessary check in favour of just handling that condition appropriately. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9b506b4a4fe8a7f40aa8bad1aafc82426cf3dd92.1649165210.git.robin.murphy@arm.com Signed-off-by: Takashi Iwai commit b2851926c6d9d977ff60f613aff95f4900b9620e Author: Christophe Leroy Date: Sat Apr 2 12:11:56 2022 +0200 PCI: hotplug: Clean up include files arch/powerpc/include/asm/prom.h includes some headers that it doesn't need itself. Add the missing headers to files that include prom.h so we can remove them from prom.h. Link: https://lore.kernel.org/r/79201f5fae8d003164ac36ed3be7789db1bc5ab4.1648833421.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Bjorn Helgaas commit 6dbc3a5bdb46ab41d6316d32a23f8dbd3593dafc Author: Yanteng Si Date: Mon Mar 28 17:59:54 2022 +0800 docs/zh_CN: add vm zsmalloc translation Translate .../vm/zsmalloc.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 2154e5e7d0123a7f1da2db527c59523f00cd7d3b Author: Yanteng Si Date: Mon Mar 28 17:59:53 2022 +0800 docs/zh_CN: add vm z3fold translation Translate .../vm/z3fold.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 11e85082a19f8d830ceaa5f9fae979e09b147d75 Author: Yanteng Si Date: Mon Mar 28 17:59:52 2022 +0800 docs/zh_CN: add vm split_page_table_lock translation Translate .../vm/split_page_table_lock.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 114b27cd15453541a7e34d0dc64a90032b26adc7 Author: Yanteng Si Date: Mon Mar 28 17:59:51 2022 +0800 docs/zh_CN: add vm remap_file_pages translation Translate .../vm/remap_file_pages.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit dc742b017439b18847745c1095e0ee997d586d85 Author: Yanteng Si Date: Mon Mar 28 17:59:50 2022 +0800 docs/zh_CN: add vm page_table_check translation Translate .../vm/page_table_check.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 7bdc0a9515dd627a2d4daa4f5c0cbaac052b140d Author: Yanteng Si Date: Mon Mar 28 17:59:49 2022 +0800 docs/zh_CN: add vm page_owner translation Translate .../vm/page_owner.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit f51debc256f88b49b8356d6ce4957380310791ef Author: Yanteng Si Date: Mon Mar 28 17:59:48 2022 +0800 docs/zh_CN: add vm page_frags translation Translate .../vm/page_frags.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 273bfe7ba7adb04cc259bca1cc6f3e7166aa7520 Author: Yanteng Si Date: Mon Mar 28 17:59:47 2022 +0800 docs/zh_CN: add vm overcommit-accounting translation Translate .../vm/overcommit-accounting.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit d1c84942e113802bacd14185cc4684b16be0ce29 Author: Yanteng Si Date: Mon Mar 28 17:59:46 2022 +0800 docs/zh_CN: add vm mmu_notifier translation Translate .../vm/mmu_notifier.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 457d2de7ee647aa1ed77a066cfbe314253ccffe2 Author: Yanteng Si Date: Mon Mar 28 17:59:45 2022 +0800 docs/zh_CN: add vm memory-model translation Translate .../vm/memory-model.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 19a05e35dd92e49b287ec2f66c609338e93b1e57 Author: Yanteng Si Date: Mon Mar 28 17:59:44 2022 +0800 docs/zh_CN: add vm hwpoison translation Translate .../vm/hwpoison.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 9859b277bffe78e070bfdcf2be19520160e3a619 Author: Yanteng Si Date: Mon Mar 28 17:59:43 2022 +0800 docs/zh_CN: add vm frontswap translation Translate .../vm/_free_page_reporting.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 712ca54c5387d13853978776dbfb7646906ee969 Author: Yanteng Si Date: Mon Mar 28 20:48:35 2022 +0800 docs/zh_CN/damon: typo fix The word in original doc is: 'enabled', not 'enable'. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit b22fe865dbf4fba1bd8f8d388ffa5bdc8cc69751 Author: Yanteng Si Date: Mon Mar 28 20:48:34 2022 +0800 docs/zh_CN/damon: add sysfs interface Since 3d029480f24e("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface") add sysfs interface, let's sync update. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit c57f3dbc3bd9ae3c4cf72c9937de205458815c8d Author: Yanteng Si Date: Mon Mar 28 20:48:33 2022 +0800 docs/zh_CN/damon: update outdated term 'regions update interval' Since 072fd1b47215("Docs/damon: update outdated term 'regions update interval'") use update interval,zh_CN should use 更新间隔, so let's sync update. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Signed-off-by: Jonathan Corbet commit 452c4915c18ce26b08a0e108513e803a196babfd Author: Bagas Sanjaya Date: Tue Mar 29 11:52:35 2022 +0700 Documentation: sphinx: replace "Introduction" chapter heading with page title Replace first chapter heading ("Introduction") with page title named "Using Sphinx for kernel documentation". This way, the first-level TOC for doc-guide contains title instead of chapter headings for this page. Cc: Jonathan Corbet Cc: "David S. Miller" Cc: Greg Kroah-Hartman Cc: Tony Nguyen Cc: Vinod Koul Cc: Daniel Borkmann Cc: Mauro Carvalho Chehab Cc: Akira Yokosawa Cc: "Rafael J. Wysocki" Cc: Jens Axboe Cc: linux-kernel@vger.kernel.org Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Bagas Sanjaya Signed-off-by: Jonathan Corbet commit 980c3799c5000d1d1d007b1d51b7fb1bb9745a14 Author: Bagas Sanjaya Date: Tue Mar 29 11:52:34 2022 +0700 Documentation: kernel-doc: Promote two chapter headings to page title Promote "Writing kernel-doc comments" heading to page title, in accordance to kernel documentation guidelines. Also promote "Including kernel-doc comments" heading because both headings deserve their own chapters in PDF output. There is no differences in the resulting output except formatting semantics. Cc: Jonathan Corbet Cc: "David S. Miller" Cc: Greg Kroah-Hartman Cc: Tony Nguyen Cc: Vinod Koul Cc: Daniel Borkmann Cc: Mauro Carvalho Chehab Cc: Akira Yokosawa Cc: "Rafael J. Wysocki" Cc: Jens Axboe Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Signed-off-by: Jonathan Corbet commit f35cf1a59e9a5afd1ce8f020830a18adf2d86db3 Author: Konstantin Ryabitsev Date: Tue Mar 29 15:51:17 2022 -0400 Documentation: kernel-hacking: minor edits for style Rusty's kernel-hacking guides provide important information, however they are written in a narrative style that some readers may interpret as off-putting. Since the goal is to make kernel documentation accessible to as many new developers as possible, it's best to avoid the turns of phrase that require a specific cultural context to properly understand. Signed-off-by: Konstantin Ryabitsev Signed-off-by: Jonathan Corbet commit a32d5c0fc12b1dec44ddd97434cbb0203c7e60e5 Author: Marcelo Schmitt Date: Wed Mar 30 18:49:59 2022 -0300 Documentation: dev-tools: Enhance static analysis section with discussion Enhance the static analysis tools section with a discussion on when to use each of them. This was mainly taken from Dan Carpenter and Julia Lawall's comments on a previous documentation patch for static analysis tools. Lore: https://lore.kernel.org/linux-doc/20220329090911.GX3293@kadam/T/#mb97770c8e938095aadc3ee08f4ac7fe32ae386e6 Signed-off-by: Marcelo Schmitt Acked-by: David Gow Cc: Dan Carpenter Cc: Julia Lawall Signed-off-by: Jonathan Corbet commit 12379401c000495e683c5c5574b82a64f8d826d6 Author: Marcelo Schmitt Date: Wed Mar 30 18:49:33 2022 -0300 Documentation: dev-tools: Add a section for static analysis tools Complement the Kernel Testing Guide documentation page by adding a section about static analysis tools. Signed-off-by: Marcelo Schmitt Acked-by: Daniel Latypov Acked-by: Dan Carpenter Acked-by: Julia Lawall Reviewed-by: David Gow Reviewed-by: Shuah Khan Signed-off-by: Jonathan Corbet commit 2c2de6f2e2bc444eed65eaa949b4fdadab93f6b3 Author: Akira Yokosawa Date: Sat Apr 2 08:19:05 2022 +0900 docs: driver-api/thermal/intel_dptf: Use copyright symbol Using a substitution pattern of "|copy|" without including isonum.txt causes a doc build warning. Using the symbol "©" itself is a better choice for those who read .rst sources. Reported by: Randy Dunlap Fixes: 16c02447f3e1 ("Documentation: thermal: DPTF Documentation") Suggested-by: Jonathan Corbet Signed-off-by: Akira Yokosawa Cc: "Rafael J. Wysocki" Cc: Srinivas Pandruvada Cc: linux-pm@vger.kernel.org Cc: linux-doc@vger.kernel.org Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Jonathan Corbet commit eeaec7801c421e17edda6e45a32d4a5596b633da Author: Christophe Leroy Date: Wed Feb 23 13:02:16 2022 +0100 powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx book3s/32 and 8xx have a separate area for allocating modules, defined by MODULES_VADDR / MODULES_END. On book3s/32, it is not possible to protect against execution on a page basis. A full 256M segment is either Exec or NoExec. The module area is in an Exec segment while vmalloc area is in a NoExec segment. In order to protect module data against execution, select ARCH_WANTS_MODULES_DATA_IN_VMALLOC. For the 8xx (and possibly other 32 bits platform in the future), there is no such constraint on Exec/NoExec protection, however there is a critical distance between kernel functions and callers that needs to remain below 32Mbytes in order to avoid costly trampolines. By allocating data outside of module area, we increase the chance for module text to remain within acceptable distance from kernel core text. So select ARCH_WANTS_MODULES_DATA_IN_VMALLOC for 8xx as well. Signed-off-by: Christophe Leroy Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Luis Chamberlain commit 55ce556dbf92ec779b65336593d213ceef3f26f3 Author: Christophe Leroy Date: Wed Feb 23 13:02:15 2022 +0100 module: Remove module_addr_min and module_addr_max Replace module_addr_min and module_addr_max by mod_tree.addr_min and mod_tree.addr_max Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 01dc0386efb769056257410ba5754558384006a7 Author: Christophe Leroy Date: Wed Feb 23 13:02:14 2022 +0100 module: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC to allow architectures to request having modules data in vmalloc area instead of module area. This is required on powerpc book3s/32 in order to set data non executable, because it is not possible to set executability on page basis, this is done per 256 Mbytes segments. The module area has exec right, vmalloc area has noexec. This can also be useful on other powerpc/32 in order to maximize the chance of code being close enough to kernel core to avoid branch trampolines. Cc: Jason Wessel Acked-by: Daniel Thompson Cc: Douglas Anderson Signed-off-by: Christophe Leroy [mcgrof: rebased in light of kernel/module/kdb.c move] Signed-off-by: Luis Chamberlain commit 6ab9942c44b2d213a16b2620e4baf0223122222f Author: Christophe Leroy Date: Wed Feb 23 13:02:13 2022 +0100 module: Introduce data_layout In order to allow separation of data from text, add another layout, called data_layout. For architectures requesting separation of text and data, only text will go in core_layout and data will go in data_layout. For architectures which keep text and data together, make data_layout an alias of core_layout, that way data_layout can be used for all data manipulations, regardless of whether data is in core_layout or data_layout. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 446d55666d5599ca58c1ceac25ce4b5191e70835 Author: Christophe Leroy Date: Wed Feb 23 13:02:12 2022 +0100 module: Prepare for handling several RB trees In order to separate text and data, we need to setup two rb trees. Modify functions to give the tree as a parameter. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 80b8bf4369906aefbcb63a03012aed7a1abcbd18 Author: Christophe Leroy Date: Wed Feb 23 13:02:11 2022 +0100 module: Always have struct mod_tree_root In order to separate text and data, we need to setup two rb trees. This means that struct mod_tree_root is required even without MODULES_TREE_LOOKUP. Signed-off-by: Christophe Leroy Reviewed-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 7337f929d5672e37a80c8582d357f084320f475f Author: Christophe Leroy Date: Wed Feb 23 10:01:01 2022 +0100 module: Rename debug_align() as strict_align() debug_align() was added by commit 84e1c6bb38eb ("x86: Add RO/NX protection for loadable kernel modules") At that time the config item was CONFIG_DEBUG_SET_MODULE_RONX. But nowadays it has changed to CONFIG_STRICT_MODULE_RWX and debug_align() is confusing because it has nothing to do with DEBUG. Rename it strict_align() Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit ef505058dc5524488a84423b4d5e8a7598a23a2e Author: Christophe Leroy Date: Wed Feb 23 10:01:00 2022 +0100 module: Rework layout alignment to avoid BUG_ON()s Perform layout alignment verification up front and WARN_ON() and fail module loading instead of crashing the machine. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 32a08c17d8096f0fd2c6600bc5fe8464aaf68ea7 Author: Christophe Leroy Date: Wed Feb 23 10:00:59 2022 +0100 module: Move module_enable_x() and frob_text() in strict_rwx.c Move module_enable_x() together with module_enable_nx() and module_enable_ro(). Those three functions are going together, they are all used to set up the correct page flags on the different sections. As module_enable_x() is used independently of CONFIG_STRICT_MODULE_RWX, build strict_rwx.c all the time and use IS_ENABLED(CONFIG_STRICT_MODULE_RWX) when relevant. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 0597579356fe5b6c0b99196e4743d4c2978f654a Author: Christophe Leroy Date: Wed Feb 23 10:00:58 2022 +0100 module: Make module_enable_x() independent of CONFIG_ARCH_HAS_STRICT_MODULE_RWX module_enable_x() has nothing to do with CONFIG_ARCH_HAS_STRICT_MODULE_RWX allthough by coincidence architectures who need module_enable_x() are selection CONFIG_ARCH_HAS_STRICT_MODULE_RWX. Enable module_enable_x() for everyone everytime. If an architecture already has module text set executable, it's a no-op. Don't check text_size alignment. When CONFIG_STRICT_MODULE_RWX is set the verification is already done in frob_rodata(). When CONFIG_STRICT_MODULE_RWX is not set it is not a big deal to have the start of data as executable. Just make sure we entirely get the last page when the boundary is not aligned. And don't BUG on misaligned base as some architectures like nios2 use kmalloc() for allocating modules. So just bail out in that case. If that's a problem, a page fault will occur later anyway. Signed-off-by: Christophe Leroy Signed-off-by: Luis Chamberlain commit 47889798da4307ed78346f04c5d95c87abbf696b Author: Aaron Tomlin Date: Tue Mar 22 14:03:44 2022 +0000 module: Move version support into a separate file No functional change. This patch migrates module version support out of core code into kernel/module/version.c. In addition simple code refactoring to make this possible. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit f64205a42046d3802c423fa2059e7fca39af127c Author: Aaron Tomlin Date: Tue Mar 22 14:03:43 2022 +0000 module: Move kdb module related code out of main kdb code No functional change. This patch migrates the kdb 'lsmod' command support out of main kdb code into its own file under kernel/module. In addition to the above, a minor style warning i.e. missing a blank line after declarations, was resolved too. The new file was added to MAINTAINERS. Finally we remove linux/module.h as it is entirely redundant. Reviewed-by: Daniel Thompson Acked-by: Daniel Thompson Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 44c09535de4784f31d151aa1047efcf4797ca3cd Author: Aaron Tomlin Date: Tue Mar 22 14:03:42 2022 +0000 module: Move sysfs support into a separate file No functional change. This patch migrates module sysfs support out of core code into kernel/module/sysfs.c. In addition simple code refactoring to make this possible. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 0ffc40f6c8ab684e694774ebc835b198398129a8 Author: Aaron Tomlin Date: Tue Mar 22 14:03:41 2022 +0000 module: Move procfs support into a separate file No functional change. This patch migrates code that allows one to generate a list of loaded/or linked modules via /proc when procfs support is enabled into kernel/module/procfs.c. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 08126db5ff739fa011fc5b8af683ad759f2cba9a Author: Aaron Tomlin Date: Tue Mar 22 14:03:40 2022 +0000 module: kallsyms: Fix suspicious rcu usage No functional change. The purpose of this patch is to address the various Sparse warnings due to the incorrect dereference/or access of an __rcu pointer. Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 91fb02f31505dc22262b13a129550f470ab90a79 Author: Aaron Tomlin Date: Tue Mar 22 14:03:39 2022 +0000 module: Move kallsyms support into a separate file No functional change. This patch migrates kallsyms code out of core module code kernel/module/kallsyms.c Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 473c84d1856e83faebf059a52a8e49bdb89026d3 Author: Aaron Tomlin Date: Tue Mar 22 14:03:38 2022 +0000 module: Move kmemleak support to a separate file No functional change. This patch migrates kmemleak code out of core module code into kernel/module/debug_kmemleak.c Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 0c1e42805c25c87eb7a6f3b18bdbf3b3b7840aff Author: Aaron Tomlin Date: Tue Mar 22 14:03:37 2022 +0000 module: Move extra signature support out of core code No functional change. This patch migrates additional module signature check code from core module code into kernel/module/signing.c. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit b33465fe9c52a3719f013deeca261bd82af235ee Author: Aaron Tomlin Date: Tue Mar 22 14:03:36 2022 +0000 module: Move strict rwx support to a separate file No functional change. This patch migrates code that makes module text and rodata memory read-only and non-text memory non-executable from core module code into kernel/module/strict_rwx.c. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 58d208de3e8d87dbe196caf0b57cc58c7a3836ca Author: Aaron Tomlin Date: Tue Mar 22 14:03:35 2022 +0000 module: Move latched RB-tree support to a separate file No functional change. This patch migrates module latched RB-tree support (e.g. see __module_address()) from core module code into kernel/module/tree_lookup.c. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 1be9473e31ab87ad1b6ecf9fd11df461930ede85 Author: Aaron Tomlin Date: Tue Mar 22 14:03:34 2022 +0000 module: Move livepatch support to a separate file No functional change. This patch migrates livepatch support (i.e. used during module add/or load and remove/or deletion) from core module code into kernel/module/livepatch.c. At the moment it contains code to persist Elf information about a given livepatch module, only. The new file was added to MAINTAINERS. Reviewed-by: Petr Mladek Tested-by: Petr Mladek Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 5aff4dfdb4ae2741cfff759d917f597f2c7f70aa Author: Aaron Tomlin Date: Tue Mar 22 14:03:33 2022 +0000 module: Make internal.h and decompress.c more compliant This patch will address the following warning and style violations generated by ./scripts/checkpatch.pl in strict mode: WARNING: Use #include instead of #10: FILE: kernel/module/internal.h:10: +#include CHECK: spaces preferred around that '-' (ctx:VxV) #18: FILE: kernel/module/internal.h:18: +#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) CHECK: Please use a blank line after function/struct/union/enum declarations #69: FILE: kernel/module/internal.h:69: +} +static inline void module_decompress_cleanup(struct load_info *info) ^ CHECK: extern prototypes should be avoided in .h files #84: FILE: kernel/module/internal.h:84: +extern int mod_verify_sig(const void *mod, struct load_info *info); WARNING: Missing a blank line after declarations #116: FILE: kernel/module/decompress.c:116: + struct page *page = module_get_next_page(info); + if (!page) { WARNING: Missing a blank line after declarations #174: FILE: kernel/module/decompress.c:174: + struct page *page = module_get_next_page(info); + if (!page) { CHECK: Please use a blank line after function/struct/union/enum declarations #258: FILE: kernel/module/decompress.c:258: +} +static struct kobj_attribute module_compression_attr = __ATTR_RO(compression); Note: Fortunately, the multiple-include optimisation found in include/linux/module.h will prevent duplication/or inclusion more than once. Fixes: f314dfea16a0 ("modsign: log module name in the event of an error") Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 8ab4ed08a24f88359f22439e37cac65c95cf6ac2 Author: Aaron Tomlin Date: Tue Mar 22 14:03:32 2022 +0000 module: Simple refactor in preparation for split No functional change. This patch makes it possible to move non-essential code out of core module code. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 0c603a5c704fcfead5e85e4c89c297d2be68b671 Author: Krzysztof Kozlowski Date: Sat Apr 2 12:07:06 2022 +0200 Documentation/process: mention patch changelog in review process Extend the "Respond to review comments" section of "Submitting patches" with reference to patch changelogs. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jonathan Corbet commit 78174f477081b61b21c6f8b616234b00ce556840 Author: Anthony Koo Date: Sat Mar 26 15:20:21 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.111.0 - Add options to allow for configurable PHY options during PSR active state - Remove unused versioning and git hash Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 73b1da69f5314d96e1f963468863eaa884ee1030 Author: Michael Strauss Date: Wed Mar 23 16:06:25 2022 -0400 drm/amd/display: Check for invalid input params when building scaling params [WHY] Function to calculate scaling ratios can be called with invalid plane src/dest, causing a divide by zero. [HOW] Fail building scaling params if plane state src/dest rects are unpopulated Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit 176cd4385aea1e1c1e41c1b8e02764558e4f6a3c Author: Leo (Hanghong) Ma Date: Wed Mar 23 15:35:57 2022 -0400 drm/amd/display: Move link_trace for edp to dp_trace [Why & How] The dp_trace structure is self contained component designed for all dp trace, and the edp link trace should be a part of it; Suggested-by: Wenjing Liu Tested-by: Daniel Wheeler Reviewed-by: Wenjing Liu Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit 68cdbf631b56a97c75891d8292900791713ba0ad Author: Aric Cyr Date: Mon Mar 28 09:41:01 2022 -0400 drm/amd/display: 3.2.180 - [FW Promotion] Release 0.0.111.0 - Check for invalid input params when building scaling params - Move link_trace for edp to dp_trace - Fix missing-prototypes warning - Enable 3 plane for DCN 3.0 and 3.02 - Extract set stream attribute into link_hwss - Revert Power down hardware if timer not trigger - Add support for handling 128b/132b link training test request - Add configuration options for AUX wake work around - Remove underflow IRQ type - Add flip interval workaround for low FPS in some game - Remove assert for odm transition case Tested-by: Daniel Wheeler Acked-by: Tom Chung Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 24566aab61c98116e6c39db7b27b005f6d7776d8 Author: Becle Lee Date: Mon Mar 28 11:18:23 2022 +0800 drm/amd/display: fix missing-prototypes warning [Why] No declaration of hubp1_wait_pipe_read_start found in header file. [How] Add its declaration. Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Becle Lee Signed-off-by: Alex Deucher commit 0191d384176c00fa28b52393997c61fce346564f Author: Krunoslav Kovac Date: Fri Mar 25 14:41:49 2022 -0400 drm/amd/display: Enable 3 plane for DCN 3.0 and 3.02 [WHY&HOW] Increase num of bottom planes to 2. Note that DCN 3.03 is left out since it has max 2 planes. Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Krunoslav Kovac Signed-off-by: Alex Deucher commit eff5e11508244cba6b24e26d3673f06332c61cfc Author: Wenjing Liu Date: Thu Mar 24 17:24:55 2022 -0400 drm/amd/display: extract set stream attribute to link_hwss [why] Extract set stream attribute into link_hwss as part of the link hwss refactor work. Tested-by: Daniel Wheeler Reviewed-by: George Shen Acked-by: Tom Chung Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 3f68934528633459e4bd7a986938612d65e13557 Author: Martin Leung Date: Fri Mar 25 12:48:57 2022 -0400 drm/amd/display: revert Power down hardware if timer not trigger Tested-by: Daniel Wheeler Reviewed-by: George Shen Acked-by: Tom Chung Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit 180c4592e27ab808e1d85be113ef178ac95e7131 Author: Wenjing Liu Date: Fri Mar 18 12:22:35 2022 -0400 drm/amd/display: add support for handling 128b/132b link training test request [why] DP2.x added new enum values for UHBR link rates in link training test request for test automation. We need to add UHBR link rates test request support in preparation for compliance test automation. [how] added a function that translate test link rate to dc link rate. Call the translation function to decide the requested test link rate. Tested-by: Daniel Wheeler Reviewed-by: George Shen Acked-by: Tom Chung Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit bb90786fa8d9ab1259c7d38516de5fb5ed145c01 Author: Jimmy Kizito Date: Tue Mar 22 19:12:47 2022 -0400 drm/amd/display: Add configuration options for AUX wake work around. [Why] Work around to try to wake unresponsive DP sinks may need to be adjusted for certain sinks. [How] Add options to disable work around or adjust time spent trying to wake unresponsive DPRX. Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Jimmy Kizito Signed-off-by: Alex Deucher commit ec313220c39a195afb1b2948a78f0c88b31cee14 Author: Angus Wang Date: Wed Mar 23 12:40:16 2022 -0400 drm/amd/display: Remove underflow IRQ type [WHY] Feature using the underflow IRQ type reverted [HOW] Removed underflow IRQ type entry Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit 3fe5739db488434bc0368577615ea7275b0f43a5 Author: Angus Wang Date: Tue Mar 22 15:37:15 2022 -0400 drm/amd/display: Add flip interval workaround [WHY] Some games experience low FPS issues when FreeSync is on and VSync is toggled to half refresh rate. [HOW] First create a function to determine workaround conditions, which is when we detect 2 or more VSync interrupts between flips and a very short VSync to flip interval. We do the workaround during VSync interrupts and set the v_total_max and min to nominal. We also cleanup after we exit the game. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit 35b2186b13b66075035fa008e9390d14b331e1b3 Author: Eric Bernstein Date: Mon Mar 21 10:42:34 2022 -0400 drm/amd/display: remove assert for odm transition case Remove assert that will hit during odm transition case, since this is a valid case. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Tom Chung Signed-off-by: Eric Bernstein Signed-off-by: Alex Deucher commit 0f12a22f375400a3fc42b86a0f8c23da530fb0fc Author: Philip Yang Date: Fri Apr 1 15:30:12 2022 -0400 drm/amdgpu: Flush TLB after mapping for VG20+XGMI For VG20 + XGMI bridge, all mappings PTEs cache in TC, this may have stall invalid PTEs in TC because one cache line has 8 pages. Need always flush_tlb after updating mapping. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 34452ac3038a7dea7e5407c0f06f762412e679f3 Author: Alex Deucher Date: Fri Mar 25 11:53:39 2022 -0400 drm/amdgpu: don't use BACO for reset in S3 Seems to cause a reboots or hangs on some systems. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1924 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1953 Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 7e97de3e7f1fb33e8c7057101095d7ddf046077c Author: Haowen Bai Date: Fri Apr 1 14:28:05 2022 +0800 drm/amdgpu/vcn: Remove unneeded semicolon report by coccicheck: drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1951:2-3: Unneeded semicolon Fixes: c543dcbe4237 ("drm/amdgpu/vcn: Add VCN ras error query support") Signed-off-by: Haowen Bai Signed-off-by: Alex Deucher commit 7da7b02e97c8e4332a497a179575db6892cbeca5 Author: Aashish Sharma Date: Thu Mar 24 19:10:31 2022 +0530 drm/amd/display: Fix unused-but-set-variable warning Fix the kernel test robot warning below: drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12: warning: variable 'temp' set but not used [-Wunused-but-set-variable] Replaced the assignment to the unused temp variable with READ_ONCE() macro to flush the writes. READ_ONCE() helps avoid the use of volatile and makes it obvious from the code that the read here is intentional. Also verified on x86 that the generated code is exactly the same as before. Reported-by: kernel test robot Signed-off-by: Aashish Sharma Signed-off-by: Alex Deucher commit a68bec2ce7d6d89136b91160c3428caf683acb91 Author: Marko Zekovic Date: Mon Mar 28 12:37:30 2022 +0200 amdgpu/pm: Enable sysfs nodes for vclk and dclk for NAVI12 SMI clock measure API is failing on NAVI12, because sysfs node for pp_dpm_vclk is not existing. Enable sysfs node for pp_dpm_vclk for NAVI12. v2: Also enable sysfs node for pp_dpm_dclk. Reviewed-by: Lijo Lazar Signed-off-by: Marko Zekovic Signed-off-by: Alex Deucher commit 30671b44aa570a2953aead09999d13e3b5a24d30 Author: Christian König Date: Wed Mar 30 10:53:15 2022 +0200 drm/amdgpu: fix TLB flushing during eviction Testing the valid bit is not enough to figure out if we need to invalidate the TLB or not. During eviction it is quite likely that we move a BO from VRAM to GTT and update the page tables immediately to the new GTT address. Rework the whole function to get all the necessary parameters directly as value. Signed-off-by: Christian König Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 50e6cb3fd2cde554db646282ea10df7236e6493c Author: CHANDAN VURDIGERE NATARAJ Date: Tue Mar 29 13:10:31 2022 +0530 drm/amd/display: Fix by adding FPU protection for dcn30_internal_validate_bw [Why] Below general protection fault observed when WebGL Aquarium is run for longer duration. If drm debug logs are enabled and set to 0x1f then the issue is observed within 10 minutes of run. [ 100.717056] general protection fault, probably for non-canonical address 0x2d33302d32323032: 0000 [#1] PREEMPT SMP NOPTI [ 100.727921] CPU: 3 PID: 1906 Comm: DrmThread Tainted: G W 5.15.30 #12 d726c6a2d6ebe5cf9223931cbca6892f916fe18b [ 100.754419] RIP: 0010:CalculateSwathWidth+0x1f7/0x44f [ 100.767109] Code: 00 00 00 f2 42 0f 11 04 f0 48 8b 85 88 00 00 00 f2 42 0f 10 04 f0 48 8b 85 98 00 00 00 f2 42 0f 11 04 f0 48 8b 45 10 0f 57 c0 42 0f 2a 04 b0 0f 57 c9 f3 43 0f 2a 0c b4 e8 8c e2 f3 ff 48 8b [ 100.781269] RSP: 0018:ffffa9230079eeb0 EFLAGS: 00010246 [ 100.812528] RAX: 2d33302d32323032 RBX: 0000000000000500 RCX: 0000000000000000 [ 100.819656] RDX: 0000000000000001 RSI: ffff99deb712c49c RDI: 0000000000000000 [ 100.826781] RBP: ffffa9230079ef50 R08: ffff99deb712460c R09: ffff99deb712462c [ 100.833907] R10: ffff99deb7124940 R11: ffff99deb7124d70 R12: ffff99deb712ae44 [ 100.841033] R13: 0000000000000001 R14: 0000000000000000 R15: ffffa9230079f0a0 [ 100.848159] FS: 00007af121212640(0000) GS:ffff99deba780000(0000) knlGS:0000000000000000 [ 100.856240] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 100.861980] CR2: 0000209000fe1000 CR3: 000000011b18c000 CR4: 0000000000350ee0 [ 100.869106] Call Trace: [ 100.871555] [ 100.873655] ? asm_sysvec_reschedule_ipi+0x12/0x20 [ 100.878449] CalculateSwathAndDETConfiguration+0x1a3/0x6dd [ 100.883937] dml31_ModeSupportAndSystemConfigurationFull+0x2ce4/0x76da [ 100.890467] ? kallsyms_lookup_buildid+0xc8/0x163 [ 100.895173] ? kallsyms_lookup_buildid+0xc8/0x163 [ 100.899874] ? __sprint_symbol+0x80/0x135 [ 100.903883] ? dm_update_plane_state+0x3f9/0x4d2 [ 100.908500] ? symbol_string+0xb7/0xde [ 100.912250] ? number+0x145/0x29b [ 100.915566] ? vsnprintf+0x341/0x5ff [ 100.919141] ? desc_read_finalized_seq+0x39/0x87 [ 100.923755] ? update_load_avg+0x1b9/0x607 [ 100.927849] ? compute_mst_dsc_configs_for_state+0x7d/0xd5b [ 100.933416] ? fetch_pipe_params+0xa4d/0xd0c [ 100.937686] ? dc_fpu_end+0x3d/0xa8 [ 100.941175] dml_get_voltage_level+0x16b/0x180 [ 100.945619] dcn30_internal_validate_bw+0x10e/0x89b [ 100.950495] ? dcn31_validate_bandwidth+0x68/0x1fc [ 100.955285] ? resource_build_scaling_params+0x98b/0xb8c [ 100.960595] ? dcn31_validate_bandwidth+0x68/0x1fc [ 100.965384] dcn31_validate_bandwidth+0x9a/0x1fc [ 100.970001] dc_validate_global_state+0x238/0x295 [ 100.974703] amdgpu_dm_atomic_check+0x9c1/0xbce [ 100.979235] ? _printk+0x59/0x73 [ 100.982467] drm_atomic_check_only+0x403/0x78b [ 100.986912] drm_mode_atomic_ioctl+0x49b/0x546 [ 100.991358] ? drm_ioctl+0x1c1/0x3b3 [ 100.994936] ? drm_atomic_set_property+0x92a/0x92a [ 100.999725] drm_ioctl_kernel+0xdc/0x149 [ 101.003648] drm_ioctl+0x27f/0x3b3 [ 101.007051] ? drm_atomic_set_property+0x92a/0x92a [ 101.011842] amdgpu_drm_ioctl+0x49/0x7d [ 101.015679] __se_sys_ioctl+0x7c/0xb8 [ 101.015685] do_syscall_64+0x5f/0xb8 [ 101.015690] ? __irq_exit_rcu+0x34/0x96 [How] It calles populate_dml_pipes which uses doubles to initialize. Adding FPU protection avoids context switch and probable loss of vba context as there is potential contention while drm debug logs are enabled. Signed-off-by: CHANDAN VURDIGERE NATARAJ Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7288ff561de650d4139fab80e9cb0da9b5b32434 Author: Xiaoke Wang Date: Tue Apr 5 12:43:07 2022 +0800 staging: rtl8712: fix a potential memory leak in r871xu_drv_init() In r871xu_drv_init(), if r8712_init_drv_sw() fails, then the memory allocated by r8712_alloc_io_queue() in r8712_usb_dvobj_init() is not properly released as there is no action will be performed by r8712_usb_dvobj_deinit(). To properly release it, we should call r8712_free_io_queue() in r8712_usb_dvobj_deinit(). Besides, in r871xu_dev_remove(), r8712_usb_dvobj_deinit() will be called by r871x_dev_unload() under condition `padapter->bup` and r8712_free_io_queue() is called by r8712_free_drv_sw(). However, r8712_usb_dvobj_deinit() does not rely on `padapter->bup` and calling r8712_free_io_queue() in r8712_free_drv_sw() is negative for better understading the code. So I move r8712_usb_dvobj_deinit() into r871xu_dev_remove(), and remove r8712_free_io_queue() from r8712_free_drv_sw(). Reviewed-by: Dan Carpenter Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_B8048C592777830380A23A7C4409F9DF1305@qq.com Signed-off-by: Greg Kroah-Hartman commit a461466e60d2a009ce83ac7a25d931c1ec5e17ad Author: Vihas Makwana Date: Tue Apr 5 18:12:38 2022 +0530 staging: r8188eu: drop redundant if check in IS_MCAST The if check is redundant. Drop it and simplify the funciton. Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220405124239.3372-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 09ff203cb0c5f66ed61db358496e82b8b91b117d Author: Michael Straube Date: Tue Apr 5 12:49:10 2022 +0200 staging: r8188eu: remove GetHalDefVar8188EUsb() The local variable odm_flag in rtw_dbg_port() is set but never used. This are the last two remaining calls to GetHalDefVar8188EUsb(). Both calls can be removed and we finally can remove GetHalDefVar8188EUsb() itself. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405104910.9769-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 72b304d013e9f2b859c2a5795986018dd50d02c8 Author: Michael Straube Date: Tue Apr 5 12:49:09 2022 +0200 staging: r8188eu: remove HAL_DEF_CURRENT_ANTENNA In order to get rid of the function GetHalDefVar8188EUsb(), remove the HAL_DEF_CURRENT_ANTENNA case from it and move the functionality into a new function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405104910.9769-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0b465150b3226e7b718c0e17aafb0269b53d3338 Author: Michael Straube Date: Tue Apr 5 12:49:08 2022 +0200 staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIV In order to get rid of the function GetHalDefVar8188EUsb(), remove the HAL_DEF_IS_SUPPORT_ANT_DIV case from it and move the functionality into a new function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405104910.9769-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a290d640a303773e78e30a90e811f643a519b8ad Author: Michael Straube Date: Tue Apr 5 12:49:07 2022 +0200 staging: r8188eu: cur_ant is set but never used In rtw_select_and_join_from_scanned_queue() the local variable cur_ant is set but never used. Remove the variable and related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405104910.9769-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2025f3c9a9079698e57b527b130f096f51c90f97 Author: Michael Straube Date: Tue Apr 5 08:08:13 2022 +0200 staging: r8188eu: remove unused macros from ieee80211.h Remove unused macros from ieee80211.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405060813.8448-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7893ce1e63fc460e46fc6ddebe6d909142d5e83f Author: Michael Straube Date: Tue Apr 5 08:08:12 2022 +0200 staging: r8188eu: remove unncessary ternary operator There are some uses of ternary operator where it explicitly sets true or false but the condition already evaluates to true or false. In this cases the ternary operator is redundant and can be removed. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fc39b7845a30b022fc944e9aab132119427c3905 Author: Philipp Hortmann Date: Mon Apr 4 22:48:42 2022 +0200 staging: vt6655: Rename constant definitions with CamelCase Rename constant definitions with CamelCase in mac.h as they are not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/19cfb3ec78eaba8e839578b1ea5a6eb09e8c09be.1649103348.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit cc1bea295750116cb6aa6207ecefc7870c214e52 Author: Philipp Hortmann Date: Mon Apr 4 22:48:35 2022 +0200 staging: vt6655: Remove unused macros in mac.h Remove unused macros with do-while(0) loop or CamelCase in mac.h as they are not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/78f72d0aa3d1bdddf3c415fd4c458399aa5e7cbf.1649103348.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 848448bf1d6cd68c6c934d8f50c438573be5340e Author: Sevinj Aghayeva Date: Mon Apr 4 23:16:12 2022 -0400 staging: rtl8723bs: remove space after function name Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: space prohibited between function name and open parenthesis Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/86494fef795f1c3e28c55e556d68b407dadd1488.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1663863a15cf1ad72cde5b75997fdd93d9e2c169 Author: Sevinj Aghayeva Date: Mon Apr 4 23:16:09 2022 -0400 staging: rtl8723bs: remove redundant else branches Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/fcb50e467d5ac81becf222379bcc21136966b86b.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3c22d17793e4384ae1cebbc0b0253d3556552dff Author: Sevinj Aghayeva Date: Mon Apr 4 23:16:10 2022 -0400 staging: rtl8723bs: remove return from a function returning void Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: void function return statements are not generally useful Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/d1aa09f34cd192e284048999ba8e20d26a224483.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman commit 826fdfafeb383c2ab88f37913177ebcdbf776cee Author: Sevinj Aghayeva Date: Mon Apr 4 23:16:08 2022 -0400 staging: rtl8723bs: remove redundant braces in if statements Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/5f3a013af7ca5ac02b4d680fa22a23049f5712db.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman commit f9ceb182bad81b7c2fc238cc16ce826b7a3d3e48 Author: Rebecca Mckeever Date: Mon Apr 4 20:10:44 2022 -0500 staging: rtl8723bs: combine both sides of conditional statement Both sides of conditional statement are the same except for the comment. Additional instances found with git grep. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/23cfd782614e09f57a514aab68407183702b0a2c.1649120568.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0780158f909fa3f1e2c43071ae77bc8602c028b4 Author: Rebecca Mckeever Date: Mon Apr 4 20:10:43 2022 -0500 staging: rtl8723bs: remove handlerOS independent comment The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instances found with git grep. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/416ed753b7b3062cc8c674dea9028fc901e85426.1649120568.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7e8be11afd8781f0a36db213962855a55fe5c18c Author: Sevinj Aghayeva Date: Sun Apr 3 18:42:07 2022 -0400 staging: rtl8723bs: simplify control flow Checkpatch issues "WARNING: else is not generally useful after a break or return" for the following code: while (1) { do_join_r = rtw_do_join(padapter); if (do_join_r == _SUCCESS) { break; } else { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } } We simplify this code in multiple steps. First, we remove do_join_r variable because it is only used right after it is assigned. Second, we remove the unnecessary else statement right after break: while (1) { if (rtw_do_join(padapter) == _SUCCESS) break; rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } Next, we move the call to rtw_do_join into the while test because the while will loop only until the call is successful: while (rtw_do_join(padapter) != _SUCCESS) { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } Finally, looking at the code above, it is clear that the code will break out of the loop if rtw_to_roam call is <= 0. Hence: while (rtw_do_join(padapter) != _SUCCESS) { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) <= 0) { rtw_indicate_disconnect(padapter); break; } } Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220403224207.GA397480@euclid Signed-off-by: Greg Kroah-Hartman commit 9f2d13a65d1aca945cfc6845cb100ceab33ddb0d Author: Sevinj Aghayeva Date: Sun Apr 3 12:53:25 2022 -0400 staging: rtl8712: simplify control flow The function iterates an index from 0 to NUM_PMKID_CACHE and returns the first index for which the condition is true. If no such index is found, the function returns -1. Current code has a complex control flow that obfuscates this simple task. Replace it with a loop. Also, given the shortened function body, replace the long variable name psecuritypriv with a short variable name p. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220403165325.GA374638@euclid Signed-off-by: Greg Kroah-Hartman commit 8a4b1870f8b2e5908536ffad4cea2ae943b9106c Author: Sevinj Aghayeva Date: Sun Apr 3 12:42:50 2022 -0400 staging: r8188eu: simplify control flow The function iterates an index from 0 to NUM_PMKID_CACHE and returns the first index for which the condition is true. If no such index is found, the function returns -1. Current code has a complex control flow that obfuscates this simple task. Replace it with a loop. Also, given the shortened function body, replace the long variable name psecuritypriv with a short variable name p. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220403164250.GA371601@euclid Signed-off-by: Greg Kroah-Hartman commit c1b068defdd91eabf59f11bd364f37c926d65460 Author: Alaa Mohamed Date: Mon Apr 4 23:19:42 2022 +0200 staging: rtl8712: remove Unnecessary parentheses Reported by checkpatch: CHECK: Unnecessary parentheses Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220404211942.11446-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit b68e5a50c80108bfd6905513e5ddab6478c29e38 Author: Alaa Mohamed Date: Mon Apr 4 23:00:10 2022 +0200 staging: rtl8712: Fix multiple line dereference Reported by checkpatch: WARNING: Avoid multiple line dereference Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220404210010.9795-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 981ef8697418fb534d496cd1e1cf1d4c6b786f88 Author: Alaa Mohamed Date: Mon Apr 4 16:52:17 2022 +0200 staging: r8188eu: remove unnecessary blank lines Reported by checkpatch: CHECK: Blank lines aren't necessary before a close brace '}' Acked_by: Larry Finger Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220404145217.15069-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 89d6bffa51ce191293227ae26508ede69b93cff6 Author: Alaa Mohamed Date: Mon Apr 4 16:39:17 2022 +0200 staging: r8188eu: Add line after declarations Reported by checkpatch: WARNING: Missing a blank line after declarations Acked_by: Larry Finger Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/19d8f316e43d16c9341f7fe94e68534cf60cc05c.1649082939.git.eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 99c63707bafd15bcf97fbd6bef1c92d5bfa01d28 Author: Sakari Ailus Date: Thu Mar 31 15:54:50 2022 +0300 device property: Add irq_get to fwnode operation Add irq_get() fwnode operation to implement fwnode_irq_get() through fwnode operations, moving the code in fwnode_irq_get() to OF and ACPI frameworks. Signed-off-by: Sakari Ailus Acked-by: Rob Herring Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 68b979d068d3d0dceb14c446f664433d96f20a7e Author: Sakari Ailus Date: Thu Mar 31 15:54:49 2022 +0300 device property: Add iomap to fwnode operations Add iomap() fwnode operation to implement fwnode_iomap() through fwnode operations, moving the code in fwnode_iomap() to OF framework. Note that the IS_ENABLED(CONFIG_OF_ADDRESS) && is_of_node(fwnode) check is needed for Sparc that has its own implementation of of_iomap anyway. Let the pre-compiler to handle that check. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 55dcbc05827ebcefe888a2829e0a59343ce6ae0a Author: Sakari Ailus Date: Thu Mar 31 15:54:48 2022 +0300 ACPI: property: Move acpi_fwnode_device_get_match_data() up Move acpi_fwnode_device_get_match_data() up below acpi_fwnode_device_is_available() so the order matches that in struct fwnode_operations. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 8c756a0a2de17f1535ef885ac7e556e016735eb2 Author: Sakari Ailus Date: Thu Mar 31 15:54:47 2022 +0300 device property: Convert device_{dma_supported,get_dma_attr} to fwnode Make the device_dma_supported and device_get_dma_attr functions to use the fwnode ops, and move the implementation to ACPI and OF frameworks. Signed-off-by: Sakari Ailus Acked-by: Rob Herring Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 43ebbb92e43fc9d85f6ff8b2a01c20ab5cf08678 Author: Geert Uytterhoeven Date: Mon Apr 4 17:29:49 2022 +0200 gpio: rcar: Add R-Car Gen4 support R-Car V3U (R8A779A0) was the first member of the R-Car Gen4 family. Generalize the support for R-Car V3U to other SoCs in the R-Car Gen4 family by adding a family-specific compatible value. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Bartosz Golaszewski commit afd24a50c73c8fa6619fee093ceee2ab40bb2146 Author: Geert Uytterhoeven Date: Mon Apr 4 17:29:48 2022 +0200 dt-bindings: gpio: renesas,rcar-gpio: Add r8a779f0 support Document support for the GPIO controller blocks in the Renesas R-Car S4-8 (R8A779F0) SoC, including a new family-specific compatible value for the R-Car Gen4 family. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Bartosz Golaszewski commit 1cef8b5019769d46725932eeace7a383bca97905 Author: Andy Shevchenko Date: Wed Mar 30 18:06:20 2022 +0300 gpiolib: 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. In case of IOCTLs use switch-case pattern that seems the usual in such cases. While at it, clarify necessity of else in gpiod_direction_output() by attaching else if to the closing curly brace on a previous line. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 92bc908af5cd6633a167638c4ff432d9fe107fa7 Author: Animesh Manna Date: Fri Mar 25 21:41:40 2022 +0530 drm/i915/dsb: modified to drm_info in dsb_prepare() The request to aqquire gem resources is failing for DSB in rare scenario where it is busy and the register programming will be done through mmio fallback path. DSB has extra advantage of faster register programming which may go away through mmio path. Adding wait for gem resource also may not be right as anyways losing time. To make the CI execution happy replaced drm_err() to drm_info() for printing debug info during dsb buffer preparation. v1: Initial version. v2: Added print for mmio fallback at out label. [Nirmoy] v3: Improved debug message. [Nirmoy] Cc: Nirmoy Das Signed-off-by: Animesh Manna Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20220325161140.11906-1-animesh.manna@intel.com Reviewed-by: Nirmoy Das commit 10377d42281e8d16058471754d3ad62cfe9aa208 Author: Jakob Koschel Date: Tue Mar 22 11:56:44 2022 +0100 netfilter: nf_tables: replace unnecessary use of list_for_each_entry_continue() Since there is no way for list_for_each_entry_continue() to start interating in the middle of the list they can be replaced with a call to list_for_each_entry(). In preparation to limit the scope of the list iterator to the list traversal loop, the list iterator variable 'rule' should not be used past the loop. v1->v2: - also replace first usage of list_for_each_entry_continue() (Florian Westphal) Signed-off-by: Jakob Koschel Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7704a82e271ad7bbafd08dac7a5d9dc4c29bc681 Author: Kuninori Morimoto Date: Tue Apr 5 00:34:54 2022 +0000 ASoC: rsnd: use inclusive language for DAIFMT mask It is still using discriminatory terms on DAIFMT mask. This patch tidyup it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ilropdu9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 05654431a18fe24e5e46a375d98904134628a102 Author: Miaoqian Lin Date: Mon Apr 4 09:35:25 2022 +0000 ASoC: mediatek: Fix missing of_node_put in mt2701_wm8960_machine_probe This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 8625c1dbd876 ("ASoC: mediatek: Add mt2701-wm8960 machine driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404093526.30004-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 4f4e0454e226de3bf4efd7e7924d1edc571c52d5 Author: Miaoqian Lin Date: Mon Apr 4 09:29:01 2022 +0000 ASoC: mediatek: Fix error handling in mt8173_max98090_dev_probe Call of_node_put(platform_node) to avoid refcount leak in the error path. Fixes: 94319ba10eca ("ASoC: mediatek: Use platform_of_node for machine drivers") Fixes: 493433785df0 ("ASoC: mediatek: mt8173: fix device_node leak") Signed-off-by: Miaoqian Lin Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220404092903.26725-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 33f2069fb6a9c2d6509accc39521d3f4d6369576 Author: Christian König Date: Mon Nov 8 12:54:59 2021 +0100 drm/nouveau: support more than one write fence in fenv50_wndw_prepare_fb Use dma_resv_get_singleton() here to eventually get more than one write fence as single fence. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-14-christian.koenig@amd.com commit 9a2c98418930c60e25b89a140c8b42a8cd6d84a6 Merge: 66e384d86ff53 0b3d5d2e358ca Author: Mark Brown Date: Tue Apr 5 10:29:12 2022 +0100 ASoC: Pull in fixes cs35l41 is getting some active work and conflicts, plus some of the fixes are needed for my testing. Signed-off-by: Mark Brown commit 774227cfb9f570538999ea7713589c87300f21b6 Merge: d50d7e91c6e5c a4765dfb80a73 Author: Mark Brown Date: Tue Apr 5 10:25:09 2022 +0100 spi: mediatek: add single/quad mode support Merge series from Leilk Liu : This series of patches are based on spi for-next, and provide 3 patches to support MT7986. commit 310584018e1af38d17101761d81c0f23bdf2242c Merge: 610d8188ea9d1 417dfad7e4f05 Author: Mark Brown Date: Tue Apr 5 10:25:07 2022 +0100 Add support for MediaTek PMIC MT6366 Merge series from Johnson Wang : This patchset adds support for MediaTek PMIC MT6366. MT6366 is the primary PMIC for MT8186 and probably other SOCs. commit 610d8188ea9d19f1febd7f5c256ba6f9db2f590a Merge: 261f06315cf7c f0e3c6261af18 Author: Mark Brown Date: Tue Apr 5 10:25:06 2022 +0100 regulator: Add support for MediaTek PMIC MT6366 Merge series from Johnson Wang : This patchset adds support for MediaTek PMIC MT6366. MT6366 is the primary PMIC for MT8186 and probably other SOCs. commit 66e384d86ff533b3352a1f897c6bc7bf7f1adafe Merge: bcb3d07226a86 76821c139d7e0 Author: Mark Brown Date: Tue Apr 5 10:25:03 2022 +0100 ASoC: ASRC support on Tegra186 and later Merge series from Sameer Pujar : This series adds support for Asynchronous Sample Rate Converter (ASRC) module on Tegra186 and later generations of SoCs. ASRC is a client of AHUB. The driver and DT support is added to make it work with Tegra audio graph card. The module can be plugged into audio path using ALSA mixer controls. ASRC supports two modes of operation, where it gets the ratio info from SW and ratio detector module. Presently the support is added for SW mode. commit bcb3d07226a86fb2b3ea8aeee9abaeee1ef1402c Merge: 5c5c69e94308d 430791dd92072 Author: Mark Brown Date: Tue Apr 5 10:25:02 2022 +0100 ASoC: topology: Cleanup patches Merge series from Amadeusz Sławiński : Following patches contain minor changes, cleaning up code to be easier to read. Clean up few loops, to be simpler or altogether remove them. Rename some things to make code easier to understand. commit 5c5c69e94308d505a34402c1522ccfe1e5c8f1c3 Merge: 5f6c3f9084534 64a1a4e04e445 Author: Mark Brown Date: Tue Apr 5 10:25:00 2022 +0100 ASoC: wm8731: Overhaul of the driver Merge series from Mark Brown : This series contains a bunch of fairly minor changes which overhaul and modernise the WM8731 driver, there should be no impact on the driver's functionality. commit 5f6c3f90845343316d32a08bafea9faddbdfa6de Merge: e0e1d166b5f5f 9e116f5a6e95e Author: Mark Brown Date: Tue Apr 5 10:24:59 2022 +0100 ASoC: SOF: Miscellaneous fixes for IPC and trace Merge series from Ranjani Sridharan : This series includes some miscellaenous fixes pertaining to IPC, DMA buffer and DMA trace. commit e0e1d166b5f5f23a3b6ce91d19367557617f9f5a Merge: 514ed489c684d cae34da5323b6 Author: Mark Brown Date: Tue Apr 5 10:24:57 2022 +0100 ASoC: mediatek: Add support for MT8195 sound card with max98390 and rt5682 Merge series from Trevor Wu : This series of patches adds support for mt8195 board with mt6359, max98390 and rt5682. To prevent from copy-paste components, mt8195 machine drivers and dt-bindings are merged in the patch. commit 514ed489c684deb15f8dbe7d073bd2f7c8ba7b16 Merge: b695f5c0a86ea 01251dd004d8e Author: Mark Brown Date: Tue Apr 5 10:24:56 2022 +0100 ASoC: atmel: Fixes for AT91SAM9G20-EK audio driver Merge series from Mark Brown : At some point the machine driver for the audio subsystem on the AT91SAM9G20-EK appears to have bitrotted, no longer probing due to effects of the transition to the common clock framework. The first patch in this series fixes the initial probe problem, with the rest of the series being random other fixes and cleanups I noticed while looking at the driver. commit b695f5c0a86ea685500a72b6a9959da041f26da6 Author: Cezary Rojewski Date: Sun Apr 3 16:16:47 2022 +0200 ASoC: Intel: catpt: Drop redundant enum constant CATPT_SSP_IFACE_LAST is being used only to calculate CATPT_SSP_COUNT. Make CATPT_SSP_COUNT part of the enum directly and remove the redundant constant. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220403141647.1037173-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit bc0505bdfb85fc2eb8767c7eb5aec556e176cb41 Author: Derek Fang Date: Mon Mar 28 13:33:38 2022 +0800 ASoC: rt5682s: Separate the regulator consumer controls Control the regulators separately instead of using regulator_bulk to accord to the timing request in the datasheet. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20220328053338.21441-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit a403993ce98fb401f696da7c4f374739a7609cff Author: Peter Ujfalusi Date: Thu Mar 31 14:47:57 2022 +0300 ASoC: SOF: ipc3-topology: Set scontrol->priv to NULL after freeing it Since the scontrol->priv is freed up during load operation it should be set to NULL to be safe against double freeing attempt. Fixes: b5cee8feb1d48 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220331114757.32551-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4a4043456cb82df20e146902cfb3dd84bc393cd3 Author: Stephen Kitt Date: Fri Mar 25 18:07:34 2022 +0100 ASoC: cs*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Reviewed-by: Wolfram Sang Reviewed-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325170734.1216018-1-steve@sk2.org Signed-off-by: Mark Brown commit 6d8f318b949aaa43a415947ee834890546e4e81b Author: Stephen Kitt Date: Fri Mar 25 17:25:15 2022 +0100 ASoC: wm*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325162515.1204107-1-steve@sk2.org Signed-off-by: Mark Brown commit b79bd63a66894ca6c75fb9827dc8f3f7fc1233e2 Author: Stephen Kitt Date: Fri Mar 25 17:48:28 2022 +0100 ASoC: ada*, ssm*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Reviewed-by: Nuno Sá Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20220325164828.1209201-1-steve@sk2.org Signed-off-by: Mark Brown commit 9f342904216f378e88008bb0ce1ae200a4b99fe8 Author: Hui Wang Date: Mon Mar 28 20:35:35 2022 +0800 ASoC: cs35l41: Fix an out-of-bounds access in otp_packed_element_t The CS35L41_NUM_OTP_ELEM is 100, but only 99 entries are defined in the array otp_map_1/2[CS35L41_NUM_OTP_ELEM], this will trigger UBSAN to report a shift-out-of-bounds warning in the cs35l41_otp_unpack() since the last entry in the array will result in GENMASK(-1, 0). UBSAN reports this problem: UBSAN: shift-out-of-bounds in /home/hwang4/build/jammy/jammy/sound/soc/codecs/cs35l41-lib.c:836:8 shift exponent 64 is too large for 64-bit type 'long unsigned int' CPU: 10 PID: 595 Comm: systemd-udevd Not tainted 5.15.0-23-generic #23 Hardware name: LENOVO \x02MFG_IN_GO/\x02MFG_IN_GO, BIOS N3GET19W (1.00 ) 03/11/2022 Call Trace: show_stack+0x52/0x58 dump_stack_lvl+0x4a/0x5f dump_stack+0x10/0x12 ubsan_epilogue+0x9/0x45 __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef ? regmap_unlock_mutex+0xe/0x10 cs35l41_otp_unpack.cold+0x1c6/0x2b2 [snd_soc_cs35l41_lib] cs35l41_hda_probe+0x24f/0x33a [snd_hda_scodec_cs35l41] cs35l41_hda_i2c_probe+0x65/0x90 [snd_hda_scodec_cs35l41_i2c] ? cs35l41_hda_i2c_remove+0x20/0x20 [snd_hda_scodec_cs35l41_i2c] i2c_device_probe+0x252/0x2b0 Fixes: 6450ef559056 ("ASoC: cs35l41: CS35L41 Boosted Smart Amplifier") Reviewed-by: Lucas Tanure Acked-by: Charles Keepax Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220328123535.50000-2-hui.wang@canonical.com Signed-off-by: Mark Brown commit 0f91bc71fe1f24b29e8980504a23681324713a0f Author: Hui Wang Date: Mon Mar 28 20:35:34 2022 +0800 ASoC: cs35l41: Add one more variable in the debug log otp_map[].size is a key variable to compute the value of otp_val and to update the bit_offset, it is helpful to debug if could put it in the debug log. Reviewed-by: Lucas Tanure Signed-off-by: Hui Wang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220328123535.50000-1-hui.wang@canonical.com Signed-off-by: Mark Brown commit 5449fd7bd01fc13266979a6ab48493d4d2e43725 Author: Rikard Falkeborn Date: Wed Mar 30 22:42:27 2022 +0200 ASoC: samsung: Constify snd_soc_dapm_{route,widget} structs These structs only have their address assigned to the dapm_{routes,widget} fields in the snd_soc_card struct, both which are pointers to const data. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220330204227.25081-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 5e9058ea2bc6e73aeb54b585af38d043490a8509 Author: Stephen Kitt Date: Fri Mar 25 18:19:04 2022 +0100 ASoC: da7218: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. This patch follows the model set by da7218_of_get_id(). Signed-off-by: Stephen Kitt Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20220325171904.1223539-1-steve@sk2.org Signed-off-by: Mark Brown commit 89be5dc60d67b377be60b47dd12d1a3ee142aacb Author: Stephen Kitt Date: Fri Mar 25 18:12:43 2022 +0100 ASoC: da[79]*: use simple i2c probe function The i2c probe functions here don't use the id information provided in their second argument, so the single-parameter i2c probe function ("probe_new") can be used instead. This avoids scanning the identifier tables during probes. Signed-off-by: Stephen Kitt Reviewed-by: Adam Thomson Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20220325171243.1218003-1-steve@sk2.org Signed-off-by: Mark Brown commit c5198db82d4c257d4d9fb9dc0db329482f3d08b9 Author: Judy Hsiao Date: Thu Mar 31 16:42:01 2022 +0800 ASoC: qcom: Add driver support for ALC5682I-VS Add Machine driver support for ALC5682I-VS codec. Signed-off-by: Judy Hsiao Link: https://lore.kernel.org/r/20220331084201.62815-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 290186e14c3bbef07a6c68e689f26bf076259ee4 Author: Takashi Iwai Date: Tue Mar 22 16:48:26 2022 +0100 ASoC: intel: atom: Remove superfluous flush_scheduled_work() It seems that flush_scheduled_work() is called without any real purpose at sst_context_cleanup() (the driver doesn't put works on the global queue at all). As the flush_schedule_work() function is going to be abolished in near future, let's drop it now. Cc: Tetsuo Handa Signed-off-by: Takashi Iwai Reviewed-by: Cezary Rojewski Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220322154826.19400-1-tiwai@suse.de Signed-off-by: Mark Brown commit e5cd0623d7879eb98059223b9eb233a686d58b40 Author: Stephen Kitt Date: Fri Mar 25 17:54:52 2022 +0100 ASoC: ad1*, ada*, ssm*: use i2c_match_id and simple i2c probe As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220325165452.1212975-1-steve@sk2.org Signed-off-by: Mark Brown commit 900dedd7e47cc3f8d93dfa0ae6ac6cf49eda0c97 Author: Martin Povišer Date: Thu Mar 31 02:04:48 2022 +0200 ASoC: Introduce snd_soc_of_get_dai_link_cpus This function is an analogue of snd_soc_of_get_dai_link_codecs to help machine drivers read CPU DAI lists from devicetrees. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220331000449.41062-5-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 1a8ee4cf84187bce17c76886eb6dd9389c3b99a8 Author: Srinivasa Rao Mandadapu Date: Tue Mar 22 21:48:57 2022 +0530 ASoC: codecs: Fix error handling in power domain init and exit handlers Update error handling in power domain init and exit handlers, as existing handling may cause issues in device remove function. Use appropriate pm core api for power domain get and sync to avoid redundant code. Fixes: 9e3d83c52844 ("ASoC: codecs: Add power domains support in digital macro codecs") Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1647965937-32203-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown commit 9b014266ef8ad0159b39920a752f191bcd6f356c Author: Jaroslav Kysela Date: Tue Mar 29 14:00:39 2022 +0200 ASoC: SOF: topology: use new sound control LED layer Use the new sound control LED layer instead the direct ledtrig_audio_set() call - see 22d8de62f11b ("ALSA: control - add generic LED trigger module as the new control layer"). Signed-off-by: Jaroslav Kysela Cc: Bard Liao Cc: Pierre-Louis Bossart Reviewed-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220329120039.2394138-1-perex@perex.cz Signed-off-by: Mark Brown commit d50d7e91c6e5ccd71f21ba1aec3fef7ee4229fd6 Author: Jakob Koschel Date: Thu Mar 24 08:25:34 2022 +0100 spi: spidev: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324072534.63420-1-jakobkoschel@gmail.com Signed-off-by: Mark Brown commit 02b3024824f48a270f6170901f1abeb1edb1619f Author: Christophe Leroy Date: Sat Apr 2 11:50:21 2022 +0200 spi: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/5ed3298d8b5b1b5bf681d79584c61cb495852f4e.1648833423.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown commit e23d86c49a9c78e8dbe3abff20b30812b26ab427 Author: Kuldeep Singh Date: Tue Mar 29 00:50:06 2022 +0530 spi: qcom-qspi: Add minItems to interconnect-names Add minItems constraint to interconnect-names as well. The schema currently tries to match 2 names and fail for DTs with single entry. With the change applied, below interconnect-names values are possible: ['qspi-config'], ['qspi-config', 'qspi-memory'] Fixes: 8f9c291558ea ("dt-bindings: spi: Add interconnect binding for QSPI") Signed-off-by: Kuldeep Singh Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220328192006.18523-1-singh.kuldeep87k@gmail.com Signed-off-by: Mark Brown commit 88a285192084edab6657e819f7f130f9cfcb0579 Author: Andy Shevchenko Date: Wed Mar 23 16:02:15 2022 +0200 spi: spidev: Replace OF specific code by device property API Instead of calling the OF specific APIs, use device property ones. It also prevents misusing PRP0001 in ACPI when trying to instantiate spidev directly. We only support special SPI test devices there. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220323140215.2568-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 2a7f669dd8f6561d227e724ca2614c25732f4799 Author: Andy Shevchenko Date: Wed Mar 23 16:02:14 2022 +0200 spi: spidev: Replace ACPI specific code by device_get_match_data() Instead of calling the ACPI specific APIs, use device_get_match_data(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220323140215.2568-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit d21b94bf3ac44aa7759c0de6f72c0a887eb9e23b Author: Andy Shevchenko Date: Wed Mar 23 16:02:13 2022 +0200 spi: spidev: Convert BUILD_BUG_ON() to static_assert() static_assert() is a preferred method to fail build when the certain constraints are not met. Convert BUILD_BUG_ON() to static_assert(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220323140215.2568-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 1e703d0548e0a2766e198c64797737d50349f46e Author: Miaohe Lin Date: Tue Mar 22 17:14:21 2022 +0800 mm/slab: remove some unused functions alternate_node_alloc and ____cache_alloc_node are always called when CONFIG_NUMA. So we can remove the unused !CONFIG_NUMA variant. Also forward declaration for alternate_node_alloc is unnecessary. Remove it too. [ vbabka@suse.cz: move ____cache_alloc_node() declaration closer to its callers ] Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Roman Gushchin Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220322091421.25285-1-linmiaohe@huawei.com commit 9cbbd694a58bdf24def2462276514c90cab7cf80 Merge: 71d637823cac7 3123109284176 Author: Maxime Ripard Date: Tue Apr 5 11:06:58 2022 +0200 Merge drm/drm-next into drm-misc-next Let's start the 5.19 development cycle. Signed-off-by: Maxime Ripard commit 089c02ae2771a14af2928c59c56abfb9b885a8d7 Author: Valentin Schneider Date: Fri Nov 12 18:52:03 2021 +0000 ftrace: Use preemption model accessors for trace header printout Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Steven Rostedt (VMware) Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20211112185203.280040-5-valentin.schneider@arm.com commit cfe43f478b79ba45573ca22d52d0d8823be068fa Author: Valentin Schneider Date: Fri Nov 12 18:52:01 2021 +0000 preempt/dynamic: Introduce preemption model accessors CONFIG_PREEMPT{_NONE, _VOLUNTARY} designate either: o The build-time preemption model when !PREEMPT_DYNAMIC o The default boot-time preemption model when PREEMPT_DYNAMIC IOW, using those on PREEMPT_DYNAMIC kernels is meaningless - the actual model could have been set to something else by the "preempt=foo" cmdline parameter. Same problem applies to CONFIG_PREEMPTION. Introduce a set of helpers to determine the actual preemption model used by the live kernel. Suggested-by: Marco Elver Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marco Elver Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20211112185203.280040-3-valentin.schneider@arm.com commit 5693fa74f98afed5421ac0165e9e9291bde7d9e1 Author: Valentin Schneider Date: Fri Nov 12 18:52:02 2021 +0000 kcsan: Use preemption model accessors Per PREEMPT_DYNAMIC, checking CONFIG_PREEMPT doesn't tell you the actual preemption model of the live kernel. Use the newly-introduced accessors instead. Signed-off-by: Valentin Schneider Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marco Elver Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20211112185203.280040-4-valentin.schneider@arm.com commit 7bebfe9dd802b80abff5a43e00ab68d98893a22c Author: Yang Jihong Date: Thu Mar 24 11:19:57 2022 +0800 perf/x86: Unify format of events sysfs show Sysfs show formats of files in /sys/devices/cpu/events/ are not unified, some end with "\n", and some do not. Modify sysfs show format of events defined by EVENT_ATTR_STR to end with "\n". Before: $ ls /sys/devices/cpu/events/* | xargs -i sh -c 'echo -n "{}: "; cat -A {}; echo' branch-instructions: event=0xc4$ branch-misses: event=0xc5$ bus-cycles: event=0x3c,umask=0x01$ cache-misses: event=0x2e,umask=0x41$ cache-references: event=0x2e,umask=0x4f$ cpu-cycles: event=0x3c$ instructions: event=0xc0$ ref-cycles: event=0x00,umask=0x03$ slots: event=0x00,umask=0x4 topdown-bad-spec: event=0x00,umask=0x81 topdown-be-bound: event=0x00,umask=0x83 topdown-fe-bound: event=0x00,umask=0x82 topdown-retiring: event=0x00,umask=0x80 After: $ ls /sys/devices/cpu/events/* | xargs -i sh -c 'echo -n "{}: "; cat -A {}; echo' /sys/devices/cpu/events/branch-instructions: event=0xc4$ /sys/devices/cpu/events/branch-misses: event=0xc5$ /sys/devices/cpu/events/bus-cycles: event=0x3c,umask=0x01$ /sys/devices/cpu/events/cache-misses: event=0x2e,umask=0x41$ /sys/devices/cpu/events/cache-references: event=0x2e,umask=0x4f$ /sys/devices/cpu/events/cpu-cycles: event=0x3c$ /sys/devices/cpu/events/instructions: event=0xc0$ /sys/devices/cpu/events/ref-cycles: event=0x00,umask=0x03$ /sys/devices/cpu/events/slots: event=0x00,umask=0x4$ Signed-off-by: Yang Jihong Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220324031957.135595-1-yangjihong1@huawei.com commit d5616bac7adadbf42a3b63b8717e75eb82a2cc2c Author: Stephane Eranian Date: Tue Mar 22 15:15:13 2022 -0700 perf/x86/amd: Add idle hooks for branch sampling On AMD Fam19h Zen3, the branch sampling (BRS) feature must be disabled before entering low power and re-enabled (if was active) when returning from low power. Otherwise, the NMI interrupt may be held up for too long and cause problems. Stopping BRS will cause the NMI to be delivered if it was held up. Define a perf_amd_brs_lopwr_cb() callback to stop/restart BRS. The callback is protected by a jump label which is enabled only when AMD BRS is detected. In all other cases, the callback is never called. Signed-off-by: Stephane Eranian [peterz: static_call() and build fixes] Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-10-eranian@google.com commit 2a606a18cd672a16343d146a126721b34cc6adbd Author: Stephane Eranian Date: Tue Mar 22 15:15:12 2022 -0700 ACPI: Add perf low power callback Add an optional callback needed by some PMU features, e.g., AMD BRS, to give a chance to the perf_events code to change its state before a CPU goes to low power and after it comes back. The callback is void when the PERF_NEEDS_LOPWR_CB flag is not set. This flag must be set in arch specific perf_event.h header whenever needed. When not set, there is no impact on the ACPI code. Signed-off-by: Stephane Eranian [peterz: build fix] Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-9-eranian@google.com commit cc37e520a236069c0de0e7ea455082fa11c73b12 Author: Stephane Eranian Date: Tue Mar 22 15:15:11 2022 -0700 perf/x86/amd: Make Zen3 branch sampling opt-in Add a kernel config option CONFIG_PERF_EVENTS_AMD_BRS to make the support for AMD Zen3 Branch Sampling (BRS) an opt-in compile time option. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-8-eranian@google.com commit ba2fe7500845a30fc845a72081999cf632051862 Author: Stephane Eranian Date: Tue Mar 22 15:15:10 2022 -0700 perf/x86/amd: Add AMD branch sampling period adjustment Add code to adjust the sampling event period when used with the Branch Sampling feature (BRS). Given the depth of the BRS (16), the period is reduced by that depth such that in the best case scenario, BRS saturates at the desired sampling period. In practice, though, the processor may execute more branches. Given a desired period P and a depth D, the kernel programs the actual period at P - D. After P occurrences of the sampling event, the counter overflows. It then may take X branches (skid) before the NMI is caught and held by the hardware and BRS activates. Then, after D branches, BRS saturates and the NMI is delivered. With no skid, the effective period would be (P - D) + D = P. In practice, however, it will likely be (P - D) + X + D. There is no way to eliminate X or predict X. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-7-eranian@google.com commit 8910075d61a37e5b0d82e6c83ed9a0a31fe9ea08 Author: Stephane Eranian Date: Tue Mar 22 15:15:09 2022 -0700 perf/x86/amd: Enable branch sampling priv level filtering The AMD Branch Sampling features does not provide hardware filtering by privilege level. The associated PMU counter does but not the branch sampling by itself. Given how BRS operates there is a possibility that BRS captures kernel level branches even though the event is programmed to count only at the user level. Implement a workaround in software by removing the branches which belong to the wrong privilege level. The privilege level is evaluated on the target of the branch and not the source so as to be compatible with other architectures. As a consequence of this patch, the number of entries in the PERF_RECORD_BRANCH_STACK buffer may be less than the maximum (16). It could even be zero. Another consequence is that consecutive entries in the branch stack may not reflect actual code path and may have discontinuities, in case kernel branches were suppressed. But this is no different than what happens on other architectures. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-6-eranian@google.com commit 44175993efbae04e8b2d7f7795ff512c3a726db0 Author: Stephane Eranian Date: Tue Mar 22 15:15:08 2022 -0700 perf/x86/amd: Add branch-brs helper event for Fam19h BRS Add a pseudo event called branch-brs to help use the FAM Fam19h Branch Sampling feature (BRS). BRS samples taken branches, so it is best used when sampling on a retired taken branch event (0xc4) which is what BRS captures. Instead of trying to remember the event code or actual event name, users can simply do: $ perf record -b -e cpu/branch-brs/ -c 1000037 ..... Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-5-eranian@google.com commit ada543459cab7f653dcacdaba4011a8bb19c627c Author: Stephane Eranian Date: Tue Mar 22 15:15:07 2022 -0700 perf/x86/amd: Add AMD Fam19h Branch Sampling support Add support for the AMD Fam19h 16-deep branch sampling feature as described in the AMD PPR Fam19h Model 01h Revision B1. This is a model specific extension. It is not an architected AMD feature. The Branch Sampling (BRS) operates with a 16-deep saturating buffer in MSR registers. There is no branch type filtering. All control flow changes are captured. BRS relies on specific programming of the core PMU of Fam19h. In particular, the following requirements must be met: - the sampling period be greater than 16 (BRS depth) - the sampling period must use a fixed and not frequency mode BRS interacts with the NMI interrupt as well. Because enabling BRS is expensive, it is only activated after P event occurrences, where P is the desired sampling period. At P occurrences of the event, the counter overflows, the CPU catches the interrupt, activates BRS for 16 branches until it saturates, and then delivers the NMI to the kernel. Between the overflow and the time BRS activates more branches may be executed skewing the period. All along, the sampling event keeps counting. The skid may be attenuated by reducing the sampling period by 16 (subsequent patch). BRS is integrated into perf_events seamlessly via the same PERF_RECORD_BRANCH_STACK sample format. BRS generates perf_branch_entry records in the sampling buffer. No prediction information is supported. The branches are stored in reverse order of execution. The most recent branch is the first entry in each record. No modification to the perf tool is necessary. BRS can be used with any sampling event. However, it is recommended to use the RETIRED_BRANCH_INSTRUCTIONS event because it matches what the BRS captures. $ perf record -b -c 1000037 -e cpu/event=0xc2,name=ret_br_instructions/ test $ perf report -D 56531696056126 0x193c000 [0x1a8]: PERF_RECORD_SAMPLE(IP, 0x2): 18122/18230: 0x401d24 period: 1000037 addr: 0 ... branch stack: nr:16 ..... 0: 0000000000401d24 -> 0000000000401d5a 0 cycles 0 ..... 1: 0000000000401d5c -> 0000000000401d24 0 cycles 0 ..... 2: 0000000000401d22 -> 0000000000401d5c 0 cycles 0 ..... 3: 0000000000401d5e -> 0000000000401d22 0 cycles 0 ..... 4: 0000000000401d20 -> 0000000000401d5e 0 cycles 0 ..... 5: 0000000000401d3e -> 0000000000401d20 0 cycles 0 ..... 6: 0000000000401d42 -> 0000000000401d3e 0 cycles 0 ..... 7: 0000000000401d3c -> 0000000000401d42 0 cycles 0 ..... 8: 0000000000401d44 -> 0000000000401d3c 0 cycles 0 ..... 9: 0000000000401d3a -> 0000000000401d44 0 cycles 0 ..... 10: 0000000000401d46 -> 0000000000401d3a 0 cycles 0 ..... 11: 0000000000401d38 -> 0000000000401d46 0 cycles 0 ..... 12: 0000000000401d48 -> 0000000000401d38 0 cycles 0 ..... 13: 0000000000401d36 -> 0000000000401d48 0 cycles 0 ..... 14: 0000000000401d4a -> 0000000000401d36 0 cycles 0 ..... 15: 0000000000401d34 -> 0000000000401d4a 0 cycles 0 ... thread: test:18230 ...... dso: test Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-4-eranian@google.com commit dc1f7893a70fe403983bd8492f177bf993940e2c Author: Peter Zijlstra Date: Wed Mar 30 13:06:54 2022 +0200 locking/mutex: Make contention tracepoints more consistent wrt adaptive spinning Have the trace_contention_*() tracepoints consistently include adaptive spinning. In order to differentiate between the spinning and non-spinning states add LCB_F_MUTEX and combine with LCB_F_SPIN. The consequence is that a mutex contention can now triggler multiple _begin() tracepoints before triggering an _end(). Additionally, this fixes one path where mutex would trigger _end() without ever seeing a _begin(). Signed-off-by: Peter Zijlstra (Intel) commit a77d41ac3a0f41c80120ec5b8b08ab284fec950a Author: Stephane Eranian Date: Tue Mar 22 15:15:06 2022 -0700 x86/cpufeatures: Add AMD Fam19h Branch Sampling feature Add a cpu feature for AMD Fam19h Branch Sampling feature as bit 31 of EBX on CPUID leaf function 0x80000008. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-3-eranian@google.com commit bfe4daf850f45d92dcd3da477f0b0456620294c3 Author: Stephane Eranian Date: Tue Mar 22 15:15:05 2022 -0700 perf/core: Add perf_clear_branch_entry_bitfields() helper Make it simpler to reset all the info fields on the perf_branch_entry by adding a helper inline function. The goal is to centralize the initialization to avoid missing a field in case more are added. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220322221517.2510440-2-eranian@google.com commit ee042be16cb455116d0fe99b77c6bc8baf87c8c6 Author: Namhyung Kim Date: Tue Mar 22 11:57:09 2022 -0700 locking: Apply contention tracepoints in the slow path Adding the lock contention tracepoints in various lock function slow paths. Note that each arch can define spinlock differently, I only added it only to the generic qspinlock for now. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Link: https://lkml.kernel.org/r/20220322185709.141236-3-namhyung@kernel.org commit 16edd9b511a13e7760ed4b92ba4e39bacda5c86f Author: Namhyung Kim Date: Tue Mar 22 11:57:08 2022 -0700 locking: Add lock contention tracepoints This adds two new lock contention tracepoints like below: * lock:contention_begin * lock:contention_end The lock:contention_begin takes a flags argument to classify locks. I found it useful to identify what kind of locks it's tracing like if it's spinning or sleeping, reader-writer lock, real-time, and per-cpu. Move tracepoint definitions into mutex.c so that we can use them without lockdep. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Link: https://lkml.kernel.org/r/20220322185709.141236-2-namhyung@kernel.org commit 1ee326196c66583006b0c95356a4b7dc51bf3531 Author: Waiman Long Date: Tue Mar 22 11:20:59 2022 -0400 locking/rwsem: Always try to wake waiters in out_nolock path For writers, the out_nolock path will always attempt to wake up waiters. This may not be really necessary if the waiter to be removed is not the first one. For readers, no attempt to wake up waiter is being made. However, if the HANDOFF bit is set and the reader to be removed is the first waiter, the waiter behind it will inherit the HANDOFF bit and for a write lock waiter waking it up will allow it to spin on the lock to acquire it faster. So it can be beneficial to do a wakeup in this case. Add a new rwsem_del_wake_waiter() helper function to do that consistently for both reader and writer out_nolock paths. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220322152059.2182333-4-longman@redhat.com commit 54c1ee4d614d52844cf24c46d8415bf1392021d0 Author: Waiman Long Date: Tue Mar 22 11:20:58 2022 -0400 locking/rwsem: Conditionally wake waiters in reader/writer slowpaths In an analysis of a recent vmcore, a reader-owned rwsem was found with 385 readers but no writer in the wait queue. That is kind of unusual but it may be caused by some race conditions that we have not fully understood yet. In such a case, all the readers in the wait queue should join the other reader-owners and acquire the read lock. In rwsem_down_write_slowpath(), an incoming writer will try to wake up the front readers under such circumstance. That is not the case for rwsem_down_read_slowpath(), add a new helper function rwsem_cond_wake_waiter() to do wakeup and use it in both reader and writer slowpaths to have a consistent and correct behavior. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220322152059.2182333-3-longman@redhat.com commit f9e21aa9e6fb11355e54c8949a390d49ca21cde1 Author: Waiman Long Date: Tue Mar 22 11:20:57 2022 -0400 locking/rwsem: No need to check for handoff bit if wait queue empty Since commit d257cc8cb8d5 ("locking/rwsem: Make handoff bit handling more consistent"), the handoff bit is always cleared if the wait queue becomes empty. There is no need to check for RWSEM_FLAG_HANDOFF when the wait list is known to be empty. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220322152059.2182333-2-longman@redhat.com commit 8b023accc8df70e72f7704d29fead7ca914d6837 Author: Nick Desaulniers Date: Mon Mar 14 15:19:03 2022 -0700 lockdep: Fix -Wunused-parameter for _THIS_IP_ While looking into a bug related to the compiler's handling of addresses of labels, I noticed some uses of _THIS_IP_ seemed unused in lockdep. Drive by cleanup. -Wunused-parameter: kernel/locking/lockdep.c:1383:22: warning: unused parameter 'ip' kernel/locking/lockdep.c:4246:48: warning: unused parameter 'ip' kernel/locking/lockdep.c:4844:19: warning: unused parameter 'ip' Signed-off-by: Nick Desaulniers Signed-off-by: Peter Zijlstra (Intel) Acked-by: Waiman Long Link: https://lore.kernel.org/r/20220314221909.2027027-1-ndesaulniers@google.com commit af65840f199fa3cdeaca3a8476cb0a821dd4887a Author: Ville Syrjälä Date: Tue Mar 22 14:00:14 2022 +0200 drm/i915/dp: Fix DFP rgb->ycbcr conversion matrix Our YCbCr output is always supposed to be limited range BT.709. That's what we send with native HDMI. The conn_state->colorspace stuff is entirely independent of that and is not supposed to alter the generated output in any way. If we want a way to do that then we need a new proprty for it. Make it so that the RGB->YCbCr conversion when performed by the DPF will match the BT.709 we would transmit with native HDMI. Cc: Ankit Nautiyal Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-12-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 56185b90488a9a51d0b5cc03e29d83f210a09abd Author: Ville Syrjälä Date: Tue Mar 22 14:00:13 2022 +0200 drm/i915/dp: Duplicate native HDMI TMDS clock limit handling for DP HDMI DFPs With native HDMI we allow the user to override the mode with something that may not respect the downstream (sink,dual-mode adapter) TMDS clock limits. Let's reuse the same logic for DP HDMI DFPs so that behaviour is more or less uniform. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-11-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 632f853525fa3c21e0f38d0357bdf03cad1d4f62 Author: Ville Syrjälä Date: Tue Mar 22 14:00:12 2022 +0200 drm/i915/dp: Add support for "4:2:0 also" modes for DP Currently we only support "4:2:0 also" modes on native HDMI. Extend that support for DP as well. With all the HDMI DFP TMDS clock handling sorted out this is now going to work for both native DP and DP->HDMI converters. As with native HDMI we first check if RGB output is possible, and if not we try YCbCr 4:2:0 instead. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-10-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 7299b530741e0b6944cbbe29c3c2a02fdfc6e418 Author: Ville Syrjälä Date: Tue Mar 22 14:00:11 2022 +0200 drm/i915/dp: Rework HDMI DFP TMDS clock handling Rework the HDMI DFP TMDS clock checks to also check at 8bpc. Previously we only checked the deep color cases. But I suppose a sink could potentially declare "4:2:0 also" modes that only actually fit within its own limits when using 4:2:0. Even if that is too nuts to be real there is no real harm in running through the full checks for everything. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-9-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 84116d8bf600df16dfab0a416fca990305cc3708 Author: Ville Syrjälä Date: Tue Mar 22 14:00:10 2022 +0200 drm/i915/dp: Make intel_dp_output_format() usable for "4:2:0 also" modes Hoist the drm_mode_is_420_only() from intel_dp_output_format() into the caller. This will allow intel_dp_output_format() to be reused for "4:2:0 also" modes. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-8-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 2cad4279f419c3ebc6ca8989df405d49cfbfe8ac Author: Ville Syrjälä Date: Tue Mar 22 14:00:09 2022 +0200 drm/i915/dp: Pass around intel_connector rather than drm_connector Prefer to use intel_connector over drm_connector. Also clean up the related variable names a bit. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-7-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit dd934010759422f294e09ecc16861a9eaa2caa07 Author: Ville Syrjälä Date: Tue Mar 22 14:00:08 2022 +0200 drm/i915/dp: Reorder intel_dp_compute_config() a bit Consolidate the double pfit call, and reorder things so that intel_dp_output_format() and intel_dp_compute_link_config() are back-to-back. They are intimately related, and will need to be called twice to properly handle the "4:2:0 also" modes. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-6-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit ca4ca33917af95e8a6e8ba92566ee610d4f44bbc Author: Ville Syrjälä Date: Tue Mar 22 14:00:07 2022 +0200 drm/i915/dp: s/intel_dp_hdmi_ycbcr420/intel_dp_is_ycbcr420/ intel_dp_hdmi_ycbcr420() does account for native DP 4:2:0 output as well, so lets rename it a bit. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-5-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 97e04764f50db2aa7acfee85c0c721f8d735a71c Author: Ville Syrjälä Date: Tue Mar 22 14:00:06 2022 +0200 drm/i915/dp: Extract intel_dp_has_audio() Declutter intel_dp_compute_config() a bit by moving the has_audio computation into a helper. HDMI already does the same thing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-4-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 633469e3bac10650ecff421ba6b9603d67da884b Author: Nagarajan Maran Date: Fri Apr 1 14:53:10 2022 +0300 ath11k: fix driver initialization failure with WoW unsupported hw In the "ath11k_wow_init", error value "EINVAL" is returned when the check for firmware support of WoW feature fails, which in turn stops the driver initialization. Warning message: [ 31.040144] ------------[ cut here ]------------ [ 31.040185] WARNING: CPU: 1 PID: 51 at drivers/net/wireless/ath/ath11k/wow.c:813 ath11k_wow_init+0xc8/0x13a8 [ath11k] [ 31.043846] Modules linked in: ath11k_pci ath11k qmi_helpers [ 31.054341] CPU: 1 PID: 51 Comm: kworker/u8:1 Tainted: G W 5.17.0-wt-ath-594817-ga7f6aa925cf8-dirty #17 [ 31.060078] Hardware name: Qualcomm Technologies, Inc. IPQ8074/AP-HK10-C2 (DT) [ 31.070578] Workqueue: ath11k_qmi_driver_event ath11k_qmi_driver_event_work [ath11k] [ 31.077782] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 31.085676] pc : ath11k_wow_init+0xc8/0x13a8 [ath11k] [ 31.092359] lr : ath11k_mac_register+0x548/0xb98 [ath11k] [ 31.097567] sp : ffff80000aa13c40 [ 31.102944] x29: ffff80000aa13c40 x28: ffff800009184390 x27: ffff000002959f20 [ 31.106251] x26: ffff000002828000 x25: ffff000002830000 x24: ffff000002830000 [ 31.113369] x23: ffff000002820000 x22: ffff00000282854c x21: 0000000000000000 [ 31.120487] x20: ffff00000295cf20 x19: ffff000002828540 x18: 0000000000000031 [ 31.127605] x17: 0000000000000004 x16: ffff0000028285fc x15: ffff00000295b040 [ 31.134723] x14: 0000000000000067 x13: ffff00000282859c x12: 000000000000000d [ 31.141840] x11: 0000000000000018 x10: 0000000000000004 x9 : 0000000000000000 [ 31.148959] x8 : ffff00000289d680 x7 : 0000000000000000 x6 : 000000000000003f [ 31.156077] x5 : 0000000000000040 x4 : 0000000000000000 x3 : ffff000002820968 [ 31.163196] x2 : 0000000000000080 x1 : 0080008af9981779 x0 : ffff000002959f20 [ 31.170314] Call trace: [ 31.177421] ath11k_wow_init+0xc8/0x13a8 [ath11k] [ 31.179684] ath11k_core_qmi_firmware_ready+0x430/0x5e0 [ath11k] [ 31.184548] ath11k_qmi_driver_event_work+0x16c/0x4f8 [ath11k] [ 31.190623] process_one_work+0x134/0x350 [ 31.196262] worker_thread+0x12c/0x450 [ 31.200340] kthread+0xf4/0x110 [ 31.203986] ret_from_fork+0x10/0x20 [ 31.207026] ---[ end trace 0000000000000000 ]--- [ 31.210894] ath11k_pci 0000:01:00.0: failed to init wow: -22 [ 31.215467] ath11k_pci 0000:01:00.0: failed register the radio with mac80211: -22 [ 31.221117] ath11k_pci 0000:01:00.0: failed to create pdev core: -22 Fix this by returning value "0" when FW doesn't support WoW to allow driver to proceed with initialize sequence and also remove the unnecessary "WARN_ON". Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Fixes: ba9177fcef21 ("ath11k: Add basic WoW functionalities") Signed-off-by: Nagarajan Maran Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220331073110.3846-1-quic_nmaran@quicinc.com commit 069b78f5d1d3888fb6903822efbc087a82303ceb Author: Ville Syrjälä Date: Tue Mar 22 14:00:05 2022 +0200 drm/i915/dp: Respect the sink's max TMDS clock when dealing with DP->HDMI DFPs Currently we only look at the DFPs max TMDS clock limit when considering whether the mode is valid, or whether we can do deep color. The sink's max TMDS clock limit may be lower than the DFPs, so we need to account for it as well. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4095 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2844 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-3-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 2dd398dee7aa5ec6b296d9915bbb1c1a76199b4a Author: Baochen Qiang Date: Fri Apr 1 14:53:10 2022 +0300 ath11k: Remove unnecessary delay in ath11k_core_suspend The intended delay in ath11k_core_suspend is introduced in commit d1b0c33850d2 ("ath11k: implement suspend for QCA6390 PCI devices"), now with ath11k_mac_wait_tx_complete added in commit ba9177fcef21 ("ath11k: Add basic WoW functionalities"), that delay is not necessary now, so remove it. This is found in code review. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02431-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220331002105.1162099-1-quic_bqiang@quicinc.com commit a707a55fcbf033bb2f2db31605474bad5f479660 Author: Ville Syrjälä Date: Tue Mar 22 14:00:04 2022 +0200 drm/i915/dp: Extract intel_dp_tmds_clock_valid() We're currently duplicating the DFP min/max TMDS clock checks in .mode_valid() and .compute_config(). Extract a helper suitable for both use cases. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-2-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 50dc9ce9f80554a88e33b73c30851acf2be36ed3 Author: Karthikeyan Kathirvel Date: Fri Apr 1 14:53:09 2022 +0300 ath11k: Change max no of active probe SSID and BSSID to fw capability The maximum number of SSIDs in a for active probe requests is currently reported as 16 (WLAN_SCAN_PARAMS_MAX_SSID) when registering the driver. The scan_req_params structure only has the capacity to hold 10 SSIDs. This leads to a buffer overflow which can be triggered from wpa_supplicant in userspace. When copying the SSIDs into the scan_req_params structure in the ath11k_mac_op_hw_scan route, it can overwrite the extraie pointer. Firmware supports 16 ssid * 4 bssid, for each ssid 4 bssid combo probe request will be sent, so totally 64 probe requests supported. So set both max ssid and bssid to 16 and 4 respectively. Remove the redundant macros of ssid and bssid. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01300-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Kathirvel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220329150221.21907-1-quic_kathirve@quicinc.com commit 5b32b6dd966338005671780c1df02327582c4be4 Author: Manikanta Pubbisetty Date: Fri Apr 1 14:53:08 2022 +0300 ath11k: Remove core PCI references from PCI common code Remove core PCI and ath11k PCI references(struct ath11k_pci) from PCI common code. Since, PCI common code will be used by hybrid bus devices, this code should be independent from ATH11K PCI references and Linux core PCI references like struct pci_dev. Since this change introduces function callbacks for bus wakeup and bus release operations, wakeup_mhi HW param is no longer needed and hence it is removed completely. Alternatively, bus wakeup/release ops for QCA9074 are initialized to NULL as QCA9704 does not need bus wakeup/release for register accesses. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328055714.6449-6-quic_mpubbise@quicinc.com commit 0cfaf2243e9eef8ed32cdde6467a7e123a9f915f Author: Manikanta Pubbisetty Date: Fri Apr 1 14:53:08 2022 +0300 ath11k: Refactor MSI logic to support WCN6750 Refactor MSI logic in order to support hybrid bus devices like WCN6750. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328055714.6449-5-quic_mpubbise@quicinc.com commit 8d06b8023ace027dc31a9cb3c85c3c8fe83289c5 Author: Manikanta Pubbisetty Date: Fri Apr 1 14:53:08 2022 +0300 ath11k: Choose MSI config based on HW revision Instead of selecting MSI config based on magic numbers, make the assignment based on HW revision. The logic is similar to the selection of HW params. This improves readability of the code and also simplifies new additions. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328055714.6449-4-quic_mpubbise@quicinc.com commit bbfdc5a751a634fcdaae669cc98b3d0e1dc0eedf Author: Manikanta Pubbisetty Date: Fri Apr 1 14:53:08 2022 +0300 ath11k: Refactor PCI code to support WCN6750 Unlike other ATH11K PCIe devices which are enumerated by APSS processor (Application Processor SubSystem), WCN6750 gets enumerated by the WPSS Q6 processor (Wireless Processor SubSystem); In simple terms, though WCN6750 is PCIe device, it is not attached to the APSS processor, APSS will not know of such a device being present in the system and therefore WCN6750 will be registered as a platform device to the kernel core like other supported AHB devices. WCN6750 needs both AHB and PCI APIs for it's operation, it uses AHB APIs for device probe/boot and PCI APIs for device setup and register accesses. Because of this nature, it is referred as a hybrid bus device. Refactor PCI code to support hybrid bus devices like WCN6750. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328055714.6449-3-quic_mpubbise@quicinc.com commit 948171b5f6fcf11253355bd836e6e8b613bea12f Author: Manikanta Pubbisetty Date: Fri Apr 1 14:53:08 2022 +0300 ath11k: PCI changes to support WCN6750 In order to add the support for WCN6750 in ATH11K , it is required to move certain PCI definitions to the header file. As a result, add ATH11K_PCI_* prefix to these definitions. Also, change the scope of certain PCI APIs that are required to enable WCN6750 from static to global. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manikanta Pubbisetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328055714.6449-2-quic_mpubbise@quicinc.com commit d5ea4fece4508bf8e72b659cd22fa4840d8d61e5 Author: Chun-Tse Shao Date: Fri Apr 1 23:18:02 2022 +0000 kbuild: Allow kernel installation packaging to override pkg-config Add HOSTPKG_CONFIG to allow tooling that builds the kernel to override what pkg-config and parameters are used. Signed-off-by: Chun-Tse Shao Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 9a22717b9b074d75baf7dd6041487730e53b4dbb Author: Nick Desaulniers Date: Wed Mar 30 11:34:06 2022 -0700 kbuild: uapi: use -fsyntax-only rather than -S The UAPI header tests are checking that the generated headers do not have syntax errors. There's no need to run the rest of the compilation pipeline after semantic analysis has run. Replace -S -o /dev/null with -fsyntax-only. Signed-off-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 71d637823cac7748079a912e0373476c7cf6f985 Author: Christian König Date: Wed Nov 3 13:35:14 2021 +0100 dma-buf: finally make dma_resv_excl_fence private v2 Drivers should never touch this directly. v2: fix rebase clash Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-10-christian.koenig@amd.com Reviewed-by: Daniel Vetter commit 055634e4b62f109a47727c2c50586e2e318595a9 Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:05 2022 +0100 drm/i915: Expose client engine utilisation via fdinfo Similar to AMD commit 874442541133 ("drm/amdgpu: Add show_fdinfo() interface"), using the infrastructure added in previous patches, we add basic client info and GPU engine utilisation for i915. Example of the output: pos: 0 flags: 0100002 mnt_id: 21 drm-driver: i915 drm-pdev: 0000:00:02.0 drm-client-id: 7 drm-engine-render: 9288864723 ns drm-engine-copy: 2035071108 ns drm-engine-video: 0 ns drm-engine-video-enhance: 0 ns v2: * Update for removal of name and pid. v3: * Use drm_driver.name. v4: * Added drm-engine-capacity- tag. * Fix typo. (Umesh) v5: * Don't output engine data before Gen8. Signed-off-by: Tvrtko Ursulin Cc: David M Nieto Cc: Christian König Cc: Daniel Vetter Cc: Chris Healy Acked-by: Christian König Reviewed-by: Umesh Nerlige Ramappa Acked-by: Rob Clark Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-9-tvrtko.ursulin@linux.intel.com commit e2d0ff3525b9be7287c583708ff2475c623cfa5c Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:04 2022 +0100 drm/i915: Count engine instances per uabi class This will be useful to have at hand in a following patch. Signed-off-by: Tvrtko Ursulin Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-8-tvrtko.ursulin@linux.intel.com commit 2d12d3da5374433d44692a8681417bc7c424439b Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:03 2022 +0100 drm: Document fdinfo format specification Proposal to standardise the fdinfo text format as optionally output by DRM drivers. Idea is that a simple but, well defined, spec will enable generic userspace tools to be written while at the same time avoiding a more heavy handed approach of adding a mid-layer to DRM. i915 implements a subset of the spec, everything apart from the memory stats currently, and a matching intel_gpu_top tool exists. Open is to see if AMD can migrate to using the proposed GPU utilisation key-value pairs, or if they are not workable to see whether to go vendor specific, or if a standardised alternative can be found which is workable for both drivers. Same for the memory utilisation key-value pairs proposal. v2: * Update for removal of name and pid. v3: * 'Drm-driver' tag will be obtained from struct drm_driver.name. (Daniel) v4: * Added drm-engine-capacity- tag. Signed-off-by: Tvrtko Ursulin Cc: David M Nieto Cc: Christian König Cc: Daniel Vetter Cc: Daniel Stone Cc: Chris Healy Acked-by: Christian König Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-7-tvrtko.ursulin@linux.intel.com commit bb6287cb18866e49501da5c92a130830db6f5a18 Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:02 2022 +0100 drm/i915: Track context current active time Track context active (on hardware) status together with the start timestamp. This will be used to provide better granularity of context runtime reporting in conjunction with already tracked pphwsp accumulated runtime. The latter is only updated on context save so does not give us visibility to any currently executing work. As part of the patch the existing runtime tracking data is moved under the new ce->stats member and updated under the seqlock. This provides the ability to atomically read out accumulated plus active runtime. v2: * Rename and make __intel_context_get_active_time unlocked. v3: * Use GRAPHICS_VER. Signed-off-by: Tvrtko Ursulin Reviewed-by: Aravind Iddamsetty # v1 Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-6-tvrtko.ursulin@linux.intel.com commit 49bd54b390c2095708faec9c4d2f9fde4acf2f59 Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:01 2022 +0100 drm/i915: Track all user contexts per client We soon want to start answering questions like how much GPU time is the context belonging to a client which exited still using. To enable this we start tracking all context belonging to a client on a separate list. Signed-off-by: Tvrtko Ursulin Reviewed-by: Aravind Iddamsetty Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-5-tvrtko.ursulin@linux.intel.com commit 8399eec8a127c5bf70e93220421e12d9f7b2b3df Author: Tvrtko Ursulin Date: Fri Apr 1 15:22:00 2022 +0100 drm/i915: Track runtime spent in closed and unreachable GEM contexts As contexts are abandoned we want to remember how much GPU time they used (per class) so later we can used it for smarter purposes. As GEM contexts are closed we want to have the DRM client remember how much GPU time they used (per class) so later we can used it for smarter purposes. v2: * Size past runtimes array by uabi class, not internal. Signed-off-by: Tvrtko Ursulin Reviewed-by: Aravind Iddamsetty # v1 Reviewed-by: Chris Wilson # v1 Signed-off-by: Chris Wilson Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-4-tvrtko.ursulin@linux.intel.com commit 43c504607dc3e5e38b6afa76badebb6686e2cf05 Author: Tvrtko Ursulin Date: Fri Apr 1 15:21:59 2022 +0100 drm/i915: Make GEM contexts track DRM clients Make GEM contexts keep a reference to i915_drm_client for the whole of of their lifetime which will come handy in following patches. v2: Don't bother supporting selftests contexts from debugfs. (Chris) v3 (Lucas): Finish constructing ctx before adding it to the list v4 (Ram): Rebase. v5: Trivial rebase for proto ctx changes. v6: Rebase after clients no longer track name and pid. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson # v5 Reviewed-by: Aravind Iddamsetty # v5 Signed-off-by: Chris Wilson Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-3-tvrtko.ursulin@linux.intel.com commit 5f0d4d1463cc64a2a1eb49a69ca3b55929ea36e1 Author: Tvrtko Ursulin Date: Fri Apr 1 15:21:58 2022 +0100 drm/i915: Explicitly track DRM clients Tracking DRM clients more explicitly will allow later patches to accumulate past and current GPU usage in a centralised place and also consolidate access to owning task pid/name. Unique client id is also assigned for the purpose of distinguishing/ consolidating between multiple file descriptors owned by the same process. v2: Chris Wilson: * Enclose new members into dedicated structs. * Protect against failed sysfs registration. v3: * sysfs_attr_init. v4: * Fix for internal clients. v5: * Use cyclic ida for client id. (Chris) * Do not leak pid reference. (Chris) * Tidy code with some locals. v6: * Use xa_alloc_cyclic to simplify locking. (Chris) * No need to unregister individial sysfs files. (Chris) * Rebase on top of fpriv kref. * Track client closed status and reflect in sysfs. v7: * Make drm_client more standalone concept. v8: * Simplify sysfs show. (Chris) * Always track name and pid. v9: * Fix cyclic id assignment. v10: * No need for a mutex around xa_alloc_cyclic. * Refactor sysfs into own function. * Unregister sysfs before freeing pid and name. * Move clients setup into own function. v11: * Call clients init directly from driver init. (Chris) v12: * Do not fail client add on id wrap. (Maciej) v13 (Lucas): Rebase. v14: * Dropped sysfs bits. v15: * Dropped tracking of pid/ and name. * Dropped RCU freeing of the client object. Signed-off-by: Tvrtko Ursulin Reviewed-by: Chris Wilson # v11 Reviewed-by: Aravind Iddamsetty # v11 Signed-off-by: Chris Wilson Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220401142205.3123159-2-tvrtko.ursulin@linux.intel.com commit 756cc94d15fae4aaaf55dc131b098c0e5221db11 Author: Christian König Date: Wed Nov 3 10:29:41 2021 +0100 drm/nouveau: stop using dma_resv_excl_fence Instead use the new dma_resv_get_singleton function. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: nouveau@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-6-christian.koenig@amd.com commit 3e47235eaee09488c7e467b9aaccb7c93c862c6b Author: Phil Chang Date: Fri Feb 25 23:20:40 2022 +0800 tee: make tee_shm_register_kernel_buf vmalloc supported In some low-memory devices, it's hard to aquire large-orders pages, this patch allowed user using scatter pages to register shm. Signed-off-by: Phil Chang Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit a4b75fe8e1c15c96c4eb083e211ccbbfd56599f9 Author: Jan Engelhardt Date: Tue Dec 28 20:57:37 2021 +0100 tee: combine "config" and "menu" for TEE's menuconfig Don't let TEE occupy two lines in menuconfig when practically no other (sub)menu does either. Signed-off-by: Jan Engelhardt Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 60657fb9b19d4ff310bdebfd1fd5a075678c29fb Author: Srinivasa Rao Mandadapu Date: Thu Mar 3 19:32:08 2022 +0530 dt-bindings: soundwire: qcom: Add bindings for audio clock reset control property Update description for audio clock reset control property, which is required for latest chipsets, to allow rx, tx and wsa bus clock enabling in software control mode by configuring dynamic clock gating control registers. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Stephen Boyd Acked-by: Rob Herring Link: https://lore.kernel.org/r/1646316128-21082-3-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Vinod Koul commit d6de188ad678feb7bc3043c9776cb8b6a7406c2f Author: Srinivasa Rao Mandadapu Date: Thu Mar 3 19:32:07 2022 +0530 soundwire: qcom: Add compatible name for v1.6.0 Update compatible string and master data information in soundwire driver to support v1.6.0 in lpass sc7280 based platform. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1646316128-21082-2-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Vinod Koul commit a7ad7ce41815145ccdb69554b2618fc084fc38a1 Author: Wang Wensheng Date: Mon Mar 7 07:40:39 2022 +0000 soundwire: stream: Fix error return code in do_bank_switch() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wang Wensheng Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307074039.117488-1-wangwensheng4@huawei.com Signed-off-by: Vinod Koul commit d146de3430d2b21054f6dc8a890f84062515f4d2 Author: Dan Carpenter Date: Mon Mar 7 15:58:15 2022 +0300 soundwire: qcom: fix an error message in swrm_wait_for_frame_gen_enabled() The logical AND && is supposed to be bitwise AND & so it will sometimes print "connected" instead of "disconnected". Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220307125814.GD16710@kili Signed-off-by: Vinod Koul commit a1a2b7125e1079cfcc13a116aa3af3df2f9e002b Author: Lad Prabhakar Date: Wed Mar 16 20:06:33 2022 +0000 of/platform: Drop static setup of IRQ resource from DT core Now that all the DT drivers have switched to platform_get_irq() we can now safely drop the static setup of IRQ resource from DT core code. With the above change hierarchical setup of irq domains is no longer bypassed and thus allowing hierarchical interrupt domains to describe interrupts using "interrupts" DT property. Signed-off-by: Lad Prabhakar Acked-by: Marc Zyngier Tested-by: Marc Zyngier Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220316200633.28974-1-prabhakar.mahadev-lad.rj@bp.renesas.com commit 7a150b0d850e37e7bdfc87459edd0ff302f67478 Author: Krzysztof Kozlowski Date: Sun Apr 3 10:18:49 2022 +0200 docs: dt: writing-schema: mention coding style Mention the usage of YAML coding style. Describe explicitly that four-space indentation in DTS examples is preferred, because: 1. The YAML's default two-space indentation for DTS code makes it significantly less readable. 2. Linux coding style tabs would introduce inconsistency (entire file is indented with spaces). 3. On the other hand, eight spaces would not align with example's opening ' - |' part. Four spaces makes the code nicely aligned with it. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220403081849.8051-2-krzysztof.kozlowski@linaro.org commit 44c8a51a5f28436622fde18fd057c857b42ac28c Author: Krzysztof Kozlowski Date: Sun Apr 3 10:18:48 2022 +0200 docs: dt: writing-bindings: describe typical cases Add a chapter for caveats or typical mistakes. Source: Rob Herring's (Devicetree bindings maintainer) comments on LKML. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220403081849.8051-1-krzysztof.kozlowski@linaro.org commit d49b3ae4294f00f268a76648d920dc2a2a07ec90 Author: Krzysztof Kozlowski Date: Sat Apr 2 17:55:51 2022 +0200 dt-bindings: net: qcom,ipa: finish the qcom,smp2p example The example using qcom,smp2p should have all necessary properties, to avoid DT schema validation warnings. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alex Elder Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220402155551.16509-2-krzysztof.kozlowski@linaro.org commit 2d091155cdc38bfd149b44d0b745b607f4c325f5 Author: Krzysztof Kozlowski Date: Sat Apr 2 21:28:19 2022 +0200 dt-bindings: white-space cleanups Remove trailing white-spaces and trailing blank lines (yamllint with default options does not like them). Suggested-by: Corentin Labbe Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220402192819.154691-1-krzysztof.kozlowski@linaro.org commit d9a64c5eb0e1388c2905961e542b26b2dcae482c Author: Kunihiko Hayashi Date: Wed Mar 30 14:23:33 2022 +0900 dt-bindings: PCI: uniphier: Convert uniphier-pcie.txt to json-schema Convert the file into a JSON description at the yaml format. Signed-off-by: Kunihiko Hayashi Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1648617814-9217-2-git-send-email-hayashi.kunihiko@socionext.com commit 568189310c2096e204674edd2f0da036cd50676a Author: Ilya Leoshkevich Date: Tue Apr 5 00:50:20 2022 +0200 libbpf: Support Debian in resolve_full_path() attach_probe selftest fails on Debian-based distros with `failed to resolve full path for 'libc.so.6'`. The reason is that these distros embraced multiarch to the point where even for the "main" architecture they store libc in /lib/. This is configured in /etc/ld.so.conf and in theory it's possible to replicate the loader's parsing and processing logic in libbpf, however a much simpler solution is to just enumerate the known library paths. Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220404225020.51029-1-iii@linux.ibm.com commit 5a0893088a20252cc268cbeabb25e883c2b6f94f Author: Ira Weiny Date: Thu Mar 31 11:06:55 2022 -0700 x86/pkeys: Remove __arch_set_user_pkey_access() declaration In the x86 code __arch_set_user_pkey_access() is not used and is not defined. Remove the dead declaration. Signed-off-by: Ira Weiny Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220331180655.2946086-1-ira.weiny@intel.com commit 70431c63d7ed31baf18b0083ba5473274363a174 Author: Ira Weiny Date: Thu Mar 31 11:05:54 2022 -0700 x86/pkeys: Clean up arch_set_user_pkey_access() declaration arch_set_user_pkey_access() was declared two times in the header. Remove the 2nd declaration. Suggested-by: "Edgecombe, Rick P" Signed-off-by: Ira Weiny Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220331180554.2945884-1-ira.weiny@intel.com commit b04d1a8dc7e7ff7ca91a20bef053bcc04265d83a Author: Daniel Latypov Date: Fri Mar 25 17:33:56 2022 -0700 Documentation: kunit: update kconfig options needed for UML coverage Recent changes have made it so the current set is not sufficient. Namely, CONFIG_DEBUG_INFO is not being set even when explicitly asked. Specifying a version of the debug info fixes this. Pick CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT as an option that's hopefully less fragile (esp. given we're tied to GCC 6 and lower). Signed-off-by: Daniel Latypov Reviewed-by: David Gow Tested-by: Maxime Ripard Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit cdebea6968faafa955b3cc9196003e7f17f78955 Author: Daniel Latypov Date: Mon Mar 28 10:41:43 2022 -0700 kunit: split resource API impl from test.c into new resource.c We've split out the declarations from include/kunit/test.h into resource.h. This patch splits out the definitions as well for consistency. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C13 lib/kunit/resource.c Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 61695f8c5d5190db11aece403304f06d22c90597 Author: Daniel Latypov Date: Mon Mar 28 10:41:42 2022 -0700 kunit: split resource API from test.h into new resource.h Background: Currently, a reader looking at kunit/test.h will find the file is quite long, and the first meaty comment is a doc comment about struct kunit_resource. Most users will not ever use the KUnit resource API directly. They'll use kunit_kmalloc() and friends, or decide it's simpler to do cleanups via labels (it often can be) instead of figuring out how to use the API. It's also logically separate from everything else in test.h. Removing it from the file doesn't cause any compilation errors (since struct kunit has `struct list_head resources` to store them). This commit: Let's move it into a kunit/resource.h file and give it a separate page in the docs, kunit/api/resource.rst. We include resource.h at the bottom of test.h since * don't want to force existing users to add a new include if they use the API * it accesses `lock` inside `struct kunit` in a inline func * so we can't just forward declare, and the alternatives require uninlining the func, adding hepers to lock/unlock, or other more invasive changes. Now the first big comment in test.h is about kunit_case, which is a lot more relevant to what a new user wants to know. A side effect of this is git blame won't properly track history by default, users need to run $ git blame -L ,1 -C17 include/kunit/resource.h Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit baa3331503271c84c252ab42475729c028b07acf Author: Daniel Latypov Date: Sat Feb 26 13:23:25 2022 -0800 kunit: tool: more descriptive metavars/--help output Before, our help output contained lines like --kconfig_add KCONFIG_ADD --qemu_config qemu_config --jobs jobs They're not very helpful. The former kind come from the automatic 'metavar' we get from argparse, the uppercase version of the flag name. The latter are where we manually specified metavar as the flag name. After: --build_dir DIR --make_options X=Y --kunitconfig PATH --kconfig_add CONFIG_X=Y --arch ARCH --cross_compile PREFIX --qemu_config FILE --jobs N --timeout SECONDS --raw_output [{all,kunit}] --json [FILE] This patch tries to make the code more clear by specifying the _type_ of input we expect, e.g. --build_dir is a DIR, --qemu_config is a FILE. I also switched it to uppercase since it looked more clearly like placeholder text that way. This patch also changes --raw_output to specify `choices` to make it more clear what the options are, and this way argparse can validate it for us, as shown by the added test case. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit d298761746d59ca169dfe68b4d0a983c3053573b Author: Ilya Leoshkevich Date: Mon Apr 4 16:21:01 2022 +0200 selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for aarch64 attach_probe selftest fails on aarch64 with `failed to create kprobe 'sys_nanosleep+0x0' perf event: No such file or directory`. This is because, like on several other architectures, nanosleep has a prefix. Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Tested-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220404142101.27900-1-iii@linux.ibm.com commit 7224a0737c46cb7a385dc75f1c2e1c8e783e8adb Merge: 4eeebce6ac4ad 7b53eaa656c34 Author: Andrii Nakryiko Date: Mon Apr 4 14:51:48 2022 -0700 Merge branch 'bpf/bpftool: add program & link type names' Milan Landaverde says: ==================== With the addition of the syscall prog type we should now be able to see feature probe info for that prog type: $ bpftool feature probe kernel ... eBPF program_type syscall is available ... eBPF helpers supported for program type syscall: ... - bpf_sys_bpf - bpf_sys_close And for the link types, their names should aid in the output. Before: $ bpftool link show 50: type 7 prog 5042 bpf_cookie 0 pids vfsstat(394433) After: $ bpftool link show 57: perf_event prog 5058 bpf_cookie 0 pids vfsstat(394725) ==================== Signed-off-by: Andrii Nakryiko commit 7b53eaa656c34d5b521e245cbfc3aee2d7b89eac Author: Milan Landaverde Date: Thu Mar 31 11:45:55 2022 -0400 bpftool: Handle libbpf_probe_prog_type errors Previously [1], we were using bpf_probe_prog_type which returned a bool, but the new libbpf_probe_bpf_prog_type can return a negative error code on failure. This change decides for bpftool to declare a program type is not available on probe failure. [1] https://lore.kernel.org/bpf/20220202225916.3313522-3-andrii@kernel.org/ Signed-off-by: Milan Landaverde Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220331154555.422506-4-milan@mdaverde.com commit fff3dfab17866f6ac5c5666839f6132b6c52f306 Author: Milan Landaverde Date: Thu Mar 31 11:45:54 2022 -0400 bpftool: Add missing link types Will display the link type names in bpftool link show output Signed-off-by: Milan Landaverde Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220331154555.422506-3-milan@mdaverde.com commit 380341637ebb41f56031a0fd0779e85413a1da59 Author: Milan Landaverde Date: Thu Mar 31 11:45:53 2022 -0400 bpftool: Add syscall prog type In addition to displaying the program type in bpftool prog show this enables us to be able to query bpf_prog_type_syscall availability through feature probe as well as see which helpers are available in those programs (such as bpf_sys_bpf and bpf_sys_close) Signed-off-by: Milan Landaverde Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220331154555.422506-2-milan@mdaverde.com commit 4eeebce6ac4ad80ee8243bb847c98e0e55848d47 Author: Quentin Monnet Date: Mon Apr 4 15:09:44 2022 +0100 selftests/bpf: Fix parsing of prog types in UAPI hdr for bpftool sync The script for checking that various lists of types in bpftool remain in sync with the UAPI BPF header uses a regex to parse enum bpf_prog_type. If this enum contains a set of values different from the list of program types in bpftool, it complains. This script should have reported the addition, some time ago, of the new BPF_PROG_TYPE_SYSCALL, which was not reported to bpftool's program types list. It failed to do so, because it failed to parse that new type from the enum. This is because the new value, in the BPF header, has an explicative comment on the same line, and the regex does not support that. Let's update the script to support parsing enum values when they have comments on the same line. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220404140944.64744-1-quentin@isovalent.com commit fc843ccd8e4c084fa5d605a876db2d3a3c38be88 Author: Alexander Lobakin Date: Mon Apr 4 13:54:51 2022 +0200 samples: bpf: Fix linking xdp_router_ipv4 after migration Users of the xdp_sample_user infra should be explicitly linked with the standard math library (`-lm`). Otherwise, the following happens: /usr/bin/ld: xdp_sample_user.c:(.text+0x59fc): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5a0d): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5adc): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x5b01): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5c1e): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x5c43): undefined reference to `ceil [...] That happened previously, so there's a block of linkage flags in the Makefile. xdp_router_ipv4 has been transferred to this infra quite recently, but hasn't been added to it. Fix. Fixes: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper") Signed-off-by: Alexander Lobakin Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220404115451.1116478-1-alexandr.lobakin@intel.com commit 35f91d1fe106cd474ac0463157d012c675385e18 Author: Song Chen Date: Sat Apr 2 16:57:08 2022 +0800 sample: bpf: syscall_tp_user: Print result of verify_map At the end of the test, we already print out prog : map ids <...> <...> Value is the number read from kernel through bpf map, further print out verify map: val:<...> will help users to understand the program runs successfully. Signed-off-by: Song Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648889828-12417-1-git-send-email-chensong_2000@189.cn commit 1c3b2a27def609473ed13b1cd668cb10deab49b4 Author: Xiaomeng Tong Date: Sun Mar 27 15:58:24 2022 +0800 drm/nouveau/clk: Fix an incorrect NULL check on list iterator The bug is here: if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp)) return cstate; The list iterator value 'cstate' will *always* be set and non-NULL by list_for_each_entry_from_reverse(), so it is incorrect to assume that the iterator value will be unchanged if the list is empty or no element is found (In fact, it will be a bogus pointer to an invalid structure object containing the HEAD). Also it missed a NULL check at callsite and may lead to invalid memory access after that. To fix this bug, just return 'encoder' when found, otherwise return NULL. And add the NULL check. Cc: stable@vger.kernel.org Fixes: 1f7f3d91ad38a ("drm/nouveau/clk: Respect voltage limits in nvkm_cstate_prog") Signed-off-by: Xiaomeng Tong Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220327075824.11806-1-xiam0nd.tong@gmail.com commit d34f82d67d2b1bdbed6bf343f0c9e6d828438976 Author: Kees Cook Date: Wed Feb 23 21:53:50 2022 -0800 kunit: tool: Do not colorize output when redirected Filling log files with color codes makes diffs and other comparisons difficult. Only emit vt100 codes when the stdout is a TTY. Cc: Brendan Higgins Cc: linux-kselftest@vger.kernel.org Cc: kunit-dev@googlegroups.com Signed-off-by: Kees Cook Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 885210d348f71e14b91bdf626d5d9039bf1afb03 Author: Daniel Latypov Date: Thu Feb 24 11:20:36 2022 -0800 kunit: tool: properly report the used arch for --json, or '' if not known Before, kunit.py always printed "arch": "UM" in its json output, but... 1. With `kunit.py parse`, we could be parsing output from anywhere, so we can't say that. 2. Capitalizing it is probably wrong, as it's `ARCH=um` 3. Commit 87c9c1631788 ("kunit: tool: add support for QEMU") made it so kunit.py could knowingly run a different arch, yet we'd still always claim "UM". This patch addresses all of those. E.g. 1. $ ./tools/testing/kunit/kunit.py parse .kunit/test.log --json | grep -o '"arch.*' | sort -u "arch": "", 2. $ ./tools/testing/kunit/kunit.py run --json | ... "arch": "um", 3. $ ./tools/testing/kunit/kunit.py run --json --arch=x86_64 | ... "arch": "x86_64", Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit ee96d25f2fa657a29ab59345898dc4ff616cfe84 Author: Daniel Latypov Date: Thu Feb 24 11:20:35 2022 -0800 kunit: tool: refactor how we plumb metadata into JSON When using --json, kunit.py run/exec/parse will produce results in KernelCI json format. As part of that, we include the build_dir that was used, and we (incorrectly) hardcode in the arch, etc. We'll want a way to plumb more values (as well as the correct `arch`), so this patch groups those fields into kunit_json.Metadata type. This patch should have no user visible changes. And since we only used build_dir in KunitParseRequest for json, we can now move it out of that struct and add it into KunitExecRequest, which needs it and used to get it via inheritance. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 6bd0f52ee8f400a558f1c0f33e1f3fd3ef4922a8 Author: Daniel Latypov Date: Thu Feb 24 11:20:34 2022 -0800 kunit: tool: readability tweaks in KernelCI json generation logic Use a more idiomatic check that a list is non-empty (`if mylist:`) and simplify the function body by dedenting and using a dict to map between the kunit TestStatus enum => KernelCI json status string. The dict hopefully makes it less likely to have bugs like commit 9a6bb30a8830 ("kunit: tool: fix --json output for skipped tests"). Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 5c7502397e0ccd5fa9dd762223ed29641355947b Author: Linus Walleij Date: Sat Feb 26 02:29:48 2022 +0100 ARM: dts: ux500: Add line impedance to fuel gauge The line impedance is used to improve battery capacity estimation. Signed-off-by: Linus Walleij commit 003cac14f543cc3475255f10cfd6fa150c5c0e3e Author: Linus Walleij Date: Wed Feb 16 00:46:27 2022 +0100 ARM: dts: ux500: Register Amstaos proximity sensor The proximity sensor on the Codina is actually an Amstaos TMD2672, not Mouser, so alter the DTS to reflect this. Tested successfully with the IIO driver. Signed-off-by: Linus Walleij commit 8388234ec562d77128ab9dbc6d26dff0c7b13af0 Author: Linus Walleij Date: Wed Feb 23 00:33:13 2022 +0100 ARM: dts: ux500: Add Codina TMO device tree This adds a device tree for "Codina TMO" also known as Samsung Galaxy Exhibit or Samsung SGH-T599. It is quite different from the vanilla Codina despite sharing the same board file in the vendor tree. Fix up some comments in the Codina DTS while we're at it. Cc: phone-devel@vger.kernel.org Cc: Markuss Broks Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220222233313.1774416-2-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit 1034eb1a6ab812b5c20063a0002de0b3b7f1d9ce Author: Linus Walleij Date: Wed Feb 23 00:33:12 2022 +0100 dt-bindings: arm: ux500: Document Codina-TMO This is a U8500-based phone named Samsung Galaxy Exhibit or Samsung SGH-T599, codenamed "Codina TMO" as it was made for T-Mobile. Cc: phone-devel@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220222233313.1774416-1-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit 4db7a4d7efe5cd249967e8867bf227ec5d9edb8e Author: Kuldeep Singh Date: Sat Mar 12 17:08:53 2022 +0530 ARM: dts: ste-dbx: Update spi clock-names property Now that spi pl022 binding only accept "sspclk" as clock name, ST ericsson platform with "SSPCLK" clock name start raising dtbs_check warnings. Make necessary changes to update this property in order to make it compliant with binding. clock-names:0: 'sspclk' was expected Signed-off-by: Kuldeep Singh Link: https://lore.kernel.org/r/20220312113853.63446-5-singh.kuldeep87k@gmail.com Signed-off-by: Linus Walleij commit 5f91bd9f1e7ad5a2025a2f95a2bc002cb7c9e0f9 Author: Ricardo Ribalda Date: Fri Feb 11 17:42:46 2022 +0100 apparmor: test: Use NULL macros Replace the PTR_EQ NULL checks with the more idiomatic and specific NULL macros. Acked-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Acked-by: Brendan Higgins Signed-off-by: Shuah Khan commit 741c9286ffad332fd0ff1cae01d497ec4b0176e5 Author: Ricardo Ribalda Date: Fri Feb 11 17:42:45 2022 +0100 mctp: test: Use NULL macros Replace the PTR_EQ NULL checks wit the NULL macros. More idiomatic and specific. Acked-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Acked-by: Brendan Higgins Signed-off-by: Shuah Khan commit ccad78f17f9f2a9acc811f8762aa428644205c9b Author: Ricardo Ribalda Date: Fri Feb 11 17:42:44 2022 +0100 kasan: test: Use NULL macros Replace PTR_EQ checks with the more idiomatic and specific NULL macros. Acked-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Acked-by: Brendan Higgins Signed-off-by: Shuah Khan commit 7aadf84333572fa011ada2dbf469295b84587739 Author: Ricardo Ribalda Date: Fri Feb 11 17:42:43 2022 +0100 thunderbolt: test: use NULL macros Replace the NULL checks with the more specific and idiomatic NULL macros. Acked-by: Mika Westerberg Acked-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Acked-by: Brendan Higgins Signed-off-by: Shuah Khan commit de82c15dc0a2d007b0aa02b832eef926d7135eb7 Author: Ricardo Ribalda Date: Fri Feb 11 17:42:42 2022 +0100 kunit: use NULL macros Replace the NULL checks with the more specific and idiomatic NULL macros. Reviewed-by: Brendan Higgins Reviewed-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Signed-off-by: Shuah Khan commit caae9458db3aef14b96921cf02c6093340350c4a Author: Ricardo Ribalda Date: Fri Feb 11 17:42:41 2022 +0100 kunit: Introduce _NULL and _NOT_NULL macros Today, when we want to check if a pointer is NULL and not ERR we have two options: KUNIT_EXPECT_TRUE(test, ptr == NULL); or KUNIT_EXPECT_PTR_NE(test, ptr, (struct mystruct *)NULL); Create a new set of macros that take care of NULL checks. Reviewed-by: Brendan Higgins Reviewed-by: Daniel Latypov Signed-off-by: Ricardo Ribalda Signed-off-by: Shuah Khan commit 29d1c2b47ef3b39a5bc58e060a4ee23ccf3d052e Author: Colin Ian King Date: Tue Mar 1 12:07:32 2022 +0000 ima: remove redundant initialization of pointer 'file'. The pointer 'file' is being initialized with a value that is never read, it is being re-assigned the same value later on closer to where it is being first used. The initialization is redundant and can be removed. Cleans up clang scan build warning: security/integrity/ima/ima_main.c:434:15: warning: Value stored to 'file' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Mimi Zohar commit aa1c05558e71422564a664fc4cafbf5999f1de0f Author: Daniel Latypov Date: Tue Jan 18 11:09:22 2022 -0800 kunit: tool: simplify code since build_dir can't be None --build_dir is set to a default of '.kunit' since commit ddbd60c779b4 ("kunit: use --build_dir=.kunit as default"), but even before then it was explicitly set to ''. So outside of one unit test, there was no way for the build_dir to be ever be None, and we can simplify code by fixing the unit test and enforcing that via updated type annotations. E.g. this lets us drop `get_file_path()` since it's now exactly equivalent to os.path.join(). Note: there's some `if build_dir` checks that also fail if build_dir is explicitly set to '' that just guard against passing "O=" to make. But running `make O=` works just fine, so drop these checks. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e6f61920653925e6fa9aceb5cdb47ecf543986c8 Author: Daniel Latypov Date: Tue Jan 18 11:09:21 2022 -0800 kunit: tool: drop last uses of collections.namedtuple Since we formally require python3.7+ since commit df4b0807ca1a ("kunit: tool: Assert the version requirement"), we can just use @dataclasses.dataclass instead. In kunit_config.py, we used namedtuple to create a hashable type that had `name` and `value` fields and had to subclass it to define a custom `__str__()`. @datalcass lets us just define one type instead. In qemu_config.py, we use namedtuple to allow modules to define various parameters. Using @dataclass, we can add type-annotations for all these fields, making our code more typesafe and making it easier for users to figure out how to define new configs. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 89aa72cd3052b70ade40fa02a018f8f509355790 Author: Daniel Latypov Date: Tue Jan 18 11:09:20 2022 -0800 kunit: tool: drop unused KernelDirectoryPath var Commit be886ba90cce ("kunit: run kunit_tool from any directory") introduced this variable, but it was unused even in that commit. Since it's still unused now and callers can instead use get_kernel_root_path(), delete this var. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 00f75043e46d5bd2bba87b3fada6c1090b61bd40 Author: Daniel Latypov Date: Tue Jan 18 11:09:19 2022 -0800 kunit: tool: make --json handling a bit clearer Currently kunit_json.get_json_result() will output the JSON-ified test output to json_path, but iff it's not "stdout". Instead, move the responsibility entirely over to the one caller. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 81200b0265b15609dcecf192e3f7fb238ec0d3da Author: Paul Moore Date: Tue Mar 8 17:11:57 2022 -0500 selinux: checkreqprot is deprecated, add some ssleep() discomfort The checkreqprot functionality was disabled by default back in Linux v4.4 (2015) with commit 2a35d196c160e3 ("selinux: change CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE default") and it was officially marked as deprecated in Linux v5.7. It was always a bit of a hack to workaround very old userspace and to the best of our knowledge, the checkreqprot functionality has been disabled by Linux distributions for quite some time. This patch moves the deprecation messages from KERN_WARNING to KERN_ERR and adds a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail. Signed-off-by: Paul Moore commit 43b666622c60bc001f2f8a19f5f97946ff53a5cc Author: Paul Moore Date: Tue Mar 1 17:53:01 2022 -0500 selinux: runtime disable is deprecated, add some ssleep() discomfort We deprecated the SELinux runtime disable functionality in Linux v5.6, and it is time to get a bit more serious about removing it. Add a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail, including how to add kernel command line parameters to some of the more popular Linux distributions. Acked-by: Casey Schaufler Signed-off-by: Paul Moore commit cfc1d277891eb499b3b5354df33b30f598683e90 Author: Aaron Tomlin Date: Tue Mar 22 14:03:31 2022 +0000 module: Move all into module/ No functional changes. This patch moves all module related code into a separate directory, modifies each file name and creates a new Makefile. Note: this effort is in preparation to refactor core module code. Reviewed-by: Christophe Leroy Signed-off-by: Aaron Tomlin Signed-off-by: Luis Chamberlain commit 0a9876f36b08706d9954d8ccb42d0cd85f210333 Author: Michal Orzel Date: Thu Mar 31 19:33:57 2022 +0200 selinux: Remove redundant assignments Get rid of redundant assignments which end up in values not being read either because they are overwritten or the function ends. Reported by clang-tidy [deadcode.DeadStores] Signed-off-by: Michal Orzel Signed-off-by: Paul Moore commit 0346e33d558c3372a5f8138ad8086f9414177a06 Author: Arınç ÜNAL Date: Sat Apr 2 23:46:22 2022 +0300 dt-bindings: arm: bcm: add bindings for Asus RT-AC88U Add Asus RT-AC88U under BCM47094 based boards. Signed-off-by: Arınç ÜNAL Reviewed-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit 69bb5c6f3f41fe6baa86a775c8a3e69dd27f85d6 Author: Arınç ÜNAL Date: Sat Apr 2 23:46:21 2022 +0300 ARM: dts: BCM5301X: Fix compatible strings for BCM53012 and BCM53016 SoC Fix compatible strings for devicetrees using the BCM53012 and BCM53016 SoC. Signed-off-by: Arınç ÜNAL Acked-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit ca41a8b302601b2547ea8aac4306efd8356d85a6 Author: Arınç ÜNAL Date: Sat Apr 2 23:46:20 2022 +0300 dt-bindings: arm: bcm: create new description for BCM53016 Create a new description for BCM53016 and move Meraki MR32 under it. Signed-off-by: Arınç ÜNAL Signed-off-by: Florian Fainelli commit e403fff3b848107e2da92b9a567a926aa5943f7d Author: Arınç ÜNAL Date: Sat Apr 2 23:46:19 2022 +0300 dt-bindings: arm: bcm: fix BCM53012 and BCM53016 SoC strings Fix inaccurate SoC strings brcm,brcm53012 and brcm,brcm53016 to respectively brcm,bcm53012 and brcm,bcm53016. Fixes: 4cb5201fcb5d ("dt-bindings: arm: bcm: Convert BCM4708 to YAML") Fixes: a2e385f5374d ("dt-bindings: ARM: add bindings for the Meraki MR32") Signed-off-by: Arınç ÜNAL Reviewed-by: Krzysztof Kozlowski Signed-off-by: Florian Fainelli commit 7f7f8c7b9f3cbae1355fb3b0ce4ea9d6f1552521 Author: Arınç ÜNAL Date: Fri Apr 1 13:20:01 2022 +0300 ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on Asus RT-AC88U The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node. Signed-off-by: Arınç ÜNAL Acked-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 4b7a67420a34ebd8fbf0111221a8bfd8001d418d Author: Arınç ÜNAL Date: Fri Apr 1 13:20:00 2022 +0300 ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on Asus RT-AC88U Define phy-mode of the Broadcom switch's port@5 as rgmii. This doesn't seem to matter but let's explicitly define it since phy-mode as rgmii is defined on the other side which is port@6 of the Realtek switch. Signed-off-by: Arınç ÜNAL Signed-off-by: Florian Fainelli commit e5ff0a7aab3ef5dd8ec7636b936c95179aa5ddfa Author: Arınç ÜNAL Date: Fri Apr 1 13:19:59 2022 +0300 ARM: dts: BCM5301X: Remove cell properties from srab ports on Asus RT-AC88U Remove #address-cells and #size-cells properties from the ports node of &srab. They are already defined on bcm5301x.dtsi, there's no need to define them again. Signed-off-by: Arınç ÜNAL Acked-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 90103611d573c5c238350f9b1d7cb682c62f5681 Author: Arınç ÜNAL Date: Fri Apr 1 13:19:58 2022 +0300 ARM: dts: BCM5301X: Fix DTC warning for NAND node Remove the unnecessary #address-cells and #size-cells properties on the nand@0 node to fix the warning below. Warning (avoid_unnecessary_addr_size): /nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Arınç ÜNAL Acked-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 130b5e32ba9d2d2313e39cf3f6d0729bff02b76a Author: Rafał Miłecki Date: Wed Mar 30 14:05:27 2022 +0200 ARM: dts: BCM5301X: Update pin controller node name This fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: cru-bus@100: 'pin-controller@1c0' does not match any of the regexes: '^clock-controller@[a-f0-9]+$', '^phy@[a-f0-9]+$', '^pinctrl@[a-f0-9]+$', '^syscon@[a-f0-9]+$', '^thermal@[a-f0-9]+$' From schema: Documentation/devicetree/bindings/mfd/brcm,cru.yaml arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: pin-controller@1c0: $nodename:0: 'pin-controller@1c0' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' From schema: Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml Ref: e7391b021e3f ("dt-bindings: mfd: brcm,cru: Rename pinctrl node") Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 0a5ccc9109fa08f2dd6179490f24005e02ee2356 Author: Julia Lawall Date: Fri Mar 18 11:37:29 2022 +0100 ARM: brcmstb: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Florian Fainelli commit a14a56a3dd6bb45aa7c0ef1a665839656f2bcce3 Author: Kuldeep Singh Date: Fri Mar 11 14:11:14 2022 +0530 ARM: dts: bcm-cygnus: Update spi clock properties PL022 binding require two clocks to be defined but broadcom cygnus platform doesn't comply with bindings and define only one clock. Update spi clocks and clocks-names property by adding appropriate clock reference to make it compliant with bindings. CC: Florian Fainelli Signed-off-by: Kuldeep Singh Signed-off-by: Florian Fainelli commit 944fad4583bc8a6d7dd80fbe39db50141da95793 Author: Lukas Bulwahn Date: Tue Feb 1 15:40:55 2022 +0100 x86/fault: Cast an argument to the proper address space in prefetch() Commit in Fixes uses accessors based on the access mode, i.e., it distinguishes its access if instr carries a user address or a kernel address. Since that commit, sparse complains about passing an argument without __user annotation to get_user(), which expects a pointer of the __user address space: arch/x86/mm/fault.c:152:29: warning: incorrect type in argument 1 (different address spaces) arch/x86/mm/fault.c:152:29: expected void const volatile [noderef] __user *ptr arch/x86/mm/fault.c:152:29: got unsigned char *[assigned] instr Cast instr to __user when accessing user memory. No functional change. No change in the generated object code. [ bp: Simplify commit message. ] Fixes: 35f1c89b0cce ("x86/fault: Fix AMD erratum #91 errata fixup for user code") Signed-off-by: Lukas Bulwahn Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220201144055.5670-1-lukas.bulwahn@gmail.com commit 22cbc6c2681a0a4fe76150270426e763d52353a4 Author: Niels Dossche Date: Mon Feb 28 20:51:44 2022 +0100 IB/rdmavt: add missing locks in rvt_ruc_loopback The documentation of the function rvt_error_qp says both r_lock and s_lock need to be held when calling that function. It also asserts using lockdep that both of those locks are held. rvt_error_qp is called form rvt_send_cq, which is called from rvt_qp_complete_swqe, which is called from rvt_send_complete, which is called from rvt_ruc_loopback in two places. Both of these places do not hold r_lock. Fix this by acquiring a spin_lock of r_lock in both of these places. The r_lock acquiring cannot be added in rvt_qp_complete_swqe because some of its other callers already have r_lock acquired. Link: https://lore.kernel.org/r/20220228195144.71946-1-dossche.niels@gmail.com Signed-off-by: Niels Dossche Signed-off-by: Jason Gunthorpe commit 05e3a8cb079b965e4a0759551770bc507dcfa90f Author: Julia Lawall Date: Fri Mar 18 11:37:08 2022 +0100 ARM: mm: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Florian Fainelli commit 170a0c56c5ec597fa15447e63272827a80a19be1 Author: Julia Lawall Date: Fri Mar 18 11:37:26 2022 +0100 ARM: s3c: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220318103729.157574-31-Julia.Lawall@inria.fr Signed-off-by: Krzysztof Kozlowski commit 061d09499fd1fcf793291009d9a21899c4fb871f Author: Krzysztof Kozlowski Date: Mon Apr 4 18:56:11 2022 +0200 ARM: dts: s5pv210: Use standard arrays of generic PHYs for EHCI/OHCI device Move USB PHYs to a standard arrays for S5PV210 EHCI/OHCI devices. This resolves the conflict between S5PV210 EHCI/OHCI sub-nodes and generic USB device bindings. Suggested-by: Måns Rullgård Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220314181948.246434-3-krzysztof.kozlowski@canonical.com commit ab92681ca16194c966844ed4dd2c336705e0c727 Author: Krzysztof Kozlowski Date: Mon Apr 4 18:55:46 2022 +0200 ARM: dts: s5pv210: align EHCI/OHCI nodes with dtschema The node names should be generic and USB DT schema expects "usb" names. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220314181948.246434-2-krzysztof.kozlowski@canonical.com commit b412be7d3c0a248db0de4b7b53ee6ad44d49c71b Author: Krzysztof Kozlowski Date: Mon Apr 4 18:55:19 2022 +0200 ARM: dts: exynos: align EHCI/OHCI nodes with dtschema on Exynos4 The node names should be generic and USB DT schema expects "usb" names. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220314181948.246434-1-krzysztof.kozlowski@canonical.com commit 04398e04173f1be0b21d7cd50c54e8affcebe106 Author: Krzysztof Kozlowski Date: Mon Apr 4 18:54:46 2022 +0200 ARM: dts: exynos: drop deprecated SFR region from MIPI phy Commit e4b3d38088df ("phy: exynos-video-mipi: Fix regression by adding support for PMU regmap") deprecated the usage of unit address in MIPI phy node, in favor of a syscon phandle. Deprecating was a correct approach because that unit address was actually coming from Power Management Unit SFR range so its usage here caused overlapped memory mapping. In 2016 commit 26dbadba495f ("phy: exynos-mipi-video: Drop support for direct access to PMU") fully removed support for parsing that MIPI phy unit address (SFR range) but the address stayed in Exynos5250 DTSI for compatibility reasons. Remove that deprecated unit address from Exynos5250 MIPI phy, because it has been almost 6 years since it was deprecated and it causes now DT schema validation warnings: video-phy@10040710: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+' Any out-of-tree users of Exynos5250 DTSI, should update their code to use newer syscon property. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220314184113.251013-1-krzysztof.kozlowski@canonical.com commit 22cbcb8f4a17c194d208f686fc3ea37fc860bd71 Author: Krzysztof Kozlowski Date: Mon Apr 4 18:53:08 2022 +0200 arm64: dts: tesla: add a specific compatible to MCT on FSD One compatible is used for the Multi-Core Timer on Tesla FSD SoC, which is correct but not specific enough. The MCT blocks have different number of interrupts, so add a second specific compatible to Tesla FSD. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220304122424.307885-5-krzysztof.kozlowski@canonical.com commit 2616922241706ec5c2c5ae95d5ac1d3120575ded Author: Krzysztof Kozlowski Date: Mon Apr 4 18:52:55 2022 +0200 arm64: dts: exynos: add a specific compatible to MCT One compatible is used for the Multi-Core Timer on most of the Samsung Exynos SoCs, which is correct but not specific enough. These MCT blocks have different number of interrupts, so add a second specific compatible to Exynos5433 and Exynos850. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220304122424.307885-4-krzysztof.kozlowski@canonical.com commit cca50a59f60a6b2b5aa2c90d8c173da89f567ee3 Author: Krzysztof Kozlowski Date: Mon Apr 4 18:51:20 2022 +0200 ARM: dts: exynos: add a specific compatible to MCT One compatible is used for the Multi-Core Timer on most of the Samsung Exynos SoCs, which is correct but not specific enough. These MCT blocks have different number of interrupts, so add a second specific compatible to Exynos3250 and all Exynos5 SoCs. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220304122424.307885-3-krzysztof.kozlowski@canonical.com commit f4324583cd4d4979ff2e885a44b8335eb4c4bfa3 Author: Krzysztof Kozlowski Date: Mon Apr 4 18:47:40 2022 +0200 arm64: dts: exynos: move aliases to board in Exynos850 The aliases for typical blocks which are disabled by default in DTSI (like I2C, UART and MMC) should be defined in the board DTS. The board should add aliases only for enabled blocks according to its specific order. On Exynos850, move aliases of enabled blocks to E850-96 board and remove unused ones. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220221075219.10827-1-krzysztof.kozlowski@canonical.com commit aa8ea8cc95dec8bc7370773271e133c1b3cc864a Author: Oleksij Rempel Date: Wed Feb 16 08:49:22 2022 +0100 ARM: dts: bcm283x: fix ethernet node name It should be "ethernet@x" instead of "usbether@x" as required by Ethernet controller devicetree schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml This patch can potentially affect boot loaders patching against full node path instead of using device aliases. Signed-off-by: Oleksij Rempel Signed-off-by: Florian Fainelli commit c3d3727c8531ba78fc725995ce34cf948ebf1dae Author: Krzysztof Kozlowski Date: Mon Apr 4 18:46:08 2022 +0200 ARM: dts: exynos: remove deprecated unit address for LPDDR3 timings on Odroid Passing maximum frequency of LPDDR3 memory timings as unit address was deprecated in favor of 'max-freq' property. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220206135918.211990-1-krzysztof.kozlowski@canonical.com commit 56653827f0d7bc7c2d8bac0e119fd1521fa9990a Author: Christophe JAILLET Date: Sun Mar 20 08:10:30 2022 +0100 memory: samsung: exynos5422-dmc: Avoid some over memory allocation 'dmc->counter' is a 'struct devfreq_event_dev **', so there is some over memory allocation. 'counters_size' should be computed with 'sizeof(struct devfreq_event_dev *)'. Use 'sizeof(*dmc->counter)' instead to fix it. While at it, use devm_kcalloc() instead of devm_kzalloc()+open coded multiplication. Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/69d7e69346986e2fdb994d4382954c932f9f0993.1647760213.git.christophe.jaillet@wanadoo.fr Signed-off-by: Krzysztof Kozlowski commit a0861079a218aeca314eba38245a47f33d51f476 Author: Uwe Kleine-König Date: Mon Mar 28 10:26:38 2022 +0200 ARM: s3c: Drop config symbol S3C24XX_PWM The only effect of this symbol is to select PWM_SAMSUNG. Drop it and fix the affected defconfigs to still keep PWM_SAMSUNG=y. Developers using MACH_NEO1973_GTA02 and/or MACH_RX1950 now have to manually select PWM and PWM_SAMSUNG (and get the freedom to select is as a module or not at all). A side effect of this change is that allmodconfig now contains PWM_SAMSUNG=m (which was =y before). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220328082638.112185-1-u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski commit 2e33a7b5fdb3930a9b1051bc792dbdc6a7490aae Author: Oleksij Rempel Date: Wed Feb 16 08:49:24 2022 +0100 ARM: dts: exynos: fix compatible strings for Ethernet USB devices Fix compatible string for Ethernet USB device as required by USB device schema: Documentation/devicetree/bindings/usb/usb-device.yaml The textual representation of VID and PID shall be in lower case hexadecimal with leading zeroes suppressed. Since there are no kernel driver matching against this compatibles, I expect no regressions with this patch. At the same time, without this fix, we are not be able to validate this device nodes with newly provided DT schema. Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220216074927.3619425-7-o.rempel@pengutronix.de Signed-off-by: Krzysztof Kozlowski commit c1ed0f41032f54e47c03088f096f8b37cae40d8e Author: Oleksij Rempel Date: Wed Feb 16 08:49:23 2022 +0100 ARM: dts: exynos: fix ethernet node name for different odroid boards The node name of Ethernet controller should be "ethernet" instead of "usbether" as required by Ethernet controller devicetree schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml This patch can potentially affect boot loaders patching against full node path instead of using device aliases. Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220216074927.3619425-6-o.rempel@pengutronix.de Signed-off-by: Krzysztof Kozlowski commit 36fe4f24ff1f156343fab1583ea496860f8ca970 Author: Randy Dunlap Date: Mon Apr 4 17:59:36 2022 +0200 drm/format_helper: fix a kernel-doc typo It looks like the incorrect name of a function parameter was used in the kernel-doc notation, so just change it to the function's parameter name to quell the kernel-doc warning. drivers/gpu/drm/drm_format_helper.c:640: warning: Function parameter or member 'vaddr' not described in 'drm_fb_xrgb8888_to_mono_reversed' drivers/gpu/drm/drm_format_helper.c:640: warning: Excess function parameter 'src' description in 'drm_fb_xrgb8888_to_mono_reversed' Fixes: bcf8b616deb8 ("drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()") Signed-off-by: Randy Dunlap Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: Javier Martinez Canillas Cc: Maarten Lankhorst CC: Maxime Ripard CC: Thomas Zimmermann Reviewed-by: Simon Ser Reviewed-by: Javier Martinez Canillas Signed-off-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/480560/ commit 353520811fe70fb720a29ffd8833778d88ae9dee Author: Randy Dunlap Date: Sun Apr 3 16:10:40 2022 -0700 drm: fix a kernel-doc typo Fix a build warning from 'make htmldocs' by correcting the lock name in the kernel-doc comment. include/drm/drm_file.h:369: warning: Function parameter or member 'master_lookup_lock' not described in 'drm_file' Signed-off-by: Randy Dunlap Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Reviewed-by: Simon Ser Signed-off-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/20220403231040.18540-1-rdunlap@infradead.org commit b892d39199df8daa2ce6e65a111f5a15be58ae5b Author: Daniel Vetter Date: Thu Mar 31 22:46:50 2022 +0200 drm/sched: Check locking in drm_sched_job_add_implicit_dependencies You really need to hold the reservation here or all kinds of funny things can happen between grabbing the dependencies and inserting the new fences. v2: Fix commit summary (Christian) Acked-by: Melissa Wen Reviewed-by: "Christian König" Signed-off-by: Daniel Vetter Cc: "Christian König" Cc: Daniel Vetter Cc: Luben Tuikov Cc: Andrey Grodzovsky Cc: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-4-daniel.vetter@ffwll.ch commit d44c2642c40b6c11e4a0afc76d491287c074376c Author: Daniel Vetter Date: Thu Mar 31 22:46:49 2022 +0200 drm/gem: Delete gem array fencing helpers Integrated into the scheduler now and all users converted over. v2: Rebased over changes from König. Acked-by: Christian König Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Sumit Semwal Cc: "Christian König" Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-3-daniel.vetter@ffwll.ch commit b827c84f5e845aa10d218f89b6eb67ee9c2e79a1 Author: Daniel Vetter Date: Thu Mar 31 22:46:48 2022 +0200 drm/etnaviv: Use scheduler dependency handling We need to pull the drm_sched_job_init much earlier, but that's very minor surgery. v2: Actually fix up cleanup paths by calling drm_sched_job_init, which I wanted to to in the previous round (and did, for all other drivers). Spotted by Lucas. v3: Rebase over renamed functions to add dependencies. v4: Rebase over patches from Christian. v5: More rebasing over work from Christian. Acked-by: Lucas Stach Reviewed-by: Christian König Signed-off-by: Daniel Vetter Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: Sumit Semwal Cc: "Christian König" Cc: etnaviv@lists.freedesktop.org Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20220331204651.2699107-2-daniel.vetter@ffwll.ch commit e54e00a28837656d0564e572f33de3f405e01710 Author: Michael Straube Date: Mon Apr 4 10:21:42 2022 +0200 staging: r8188eu: ps_flag is never set The field ps_flag in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220404082142.4639-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 93bf50ec9740168c0719d6f3914db98ba5f63a2f Author: Michael Straube Date: Mon Apr 4 10:21:41 2022 +0200 staging: r8188eu: pwr_state_check_cnts is always zero The field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and never changed. Remove it and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220404082142.4639-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ff99fdb280a58305a1ee189677f97f3a5028e04a Author: Michael Straube Date: Mon Apr 4 10:21:40 2022 +0200 staging: r8188eu: pnp_bstop_trx is never set The field pnp_bstop_trx in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220404082142.4639-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d08a738ff1d06bd66cc8b9a9b8c9ffd4df53c029 Author: Michael Straube Date: Mon Apr 4 10:21:39 2022 +0200 staging: r8188eu: reg_rfoff is never set The field reg_rfoff in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220404082142.4639-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 091bfe946a9678926f0fef482783ed3e0aafe4f1 Author: Michael Straube Date: Mon Apr 4 10:21:38 2022 +0200 staging: r8188eu: remove unused fields from struct pwrctrl_priv There are some unused fields in the pwrctrl_priv structure. Remove them. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220404082142.4639-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 054cd1b71de08bdb177cf53c167acaf357fec554 Author: Sathish Kumar Date: Mon Apr 4 09:22:13 2022 +0530 staging: rtl8712: Fix multiple blank lines warning from .c files This patch fixes the checkpatch.pl warnings like: CHECK: Please don't use multiple blank lines + + from rtl871x_ioctl_rtl.c, rtl871x_ioctl_set.c, rtl871x_recv.c, and rtl871x_security.c Signed-off-by: Sathish Kumar Link: https://lore.kernel.org/r/20220404035213.2609-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0eaf4a6239136068c439494e0c68a25c2cbb816a Author: Sathish Kumar Date: Mon Apr 4 09:17:06 2022 +0530 staging: rtl8712: Fix multiple blank lines warning from .h files This patch fixes the checkpatch.pl warnings like: CHECK: Please don't use multiple blank lines + + from rtl8712_*.h, rtl871x_*.h, sta_info.h, and wifi.h Signed-off-by: Sathish Kumar Link: https://lore.kernel.org/r/20220404034706.2384-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman commit e1977dc8bbf3752b7844b2b9d12f07a0bd7d6562 Author: Rebecca Mckeever Date: Sun Apr 3 14:17:06 2022 -0500 staging: r8188eu: add blank line between functions Conform to Linux kernel coding style. Noticed when completing a different patch. Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/ccacca6f679a879ad2032dc0aeb0b0156e3a847b.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit db5d5ae504f57fc2820dab18332d2762891d9a82 Author: Rebecca Mckeever Date: Sun Apr 3 14:17:05 2022 -0500 staging: r8188eu: combine both sides of conditional statement Both sides of conditional statement are the same except for the comment. Additional instance found with git grep. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/d33c51bc3a20fa25e4737b258f3b1c42cc8124e3.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 189a9bb7724cc7088a9bdedac29ce63eaa1f6bb8 Author: Rebecca Mckeever Date: Sun Apr 3 14:17:04 2022 -0500 staging: r8188eu: remove handlerOS independent comment The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instance found with git grep. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/7d0d2253d86f46bc0def0447de424727d70f03a7.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03173e16fb207bf46ef3e15a4f56df8bfb5ca0d8 Author: Martin Kaiser Date: Sun Apr 3 18:54:38 2022 +0200 staging: r8188eu: remove the bretry variable Remove the bretry variable. It's set and used only once. Call the ieee80211 helper directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7a074dc8145eabd09413c6e68e3f978ab0f37b4f Author: Martin Kaiser Date: Sun Apr 3 18:54:37 2022 +0200 staging: r8188eu: don't call get_hdr_bssid Do not call get_hdr_bssid from validate_recv_data_frame. We already distinguish between the four cases for to_ds, from_ds. Copy the bssid address as described in the "DS bit usage" table in include/linux/ieee80211.h. Eventually, we should remove get_hdr_bssid (and other similar driver-specific parsing functions). Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a9207f5e5101272c8bfd5e1aee6494be48f7c878 Author: Martin Kaiser Date: Sun Apr 3 18:54:36 2022 +0200 staging: r8188eu: remove psa, pda Remove the psa, pda variables. They are set and read only once. We can use the ieee80211 helpers directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d88a36bdc5e421207b1ba9eb26cce16bb61bb9cd Author: Martin Kaiser Date: Sun Apr 3 18:54:35 2022 +0200 staging: r8188eu: ra and ta do not depend on to_ds, from_ds The "DS bit usage" table in include/linux/ieee80211.h shows that ra is always addr1 and ta is always addr2. We can set pattrib->ra and pattrib->ta regardless of the to_ds and from_ds bits. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1a90b6e23bf9b97e29de9c8666b239fbcd457a46 Author: Martin Kaiser Date: Sun Apr 3 18:54:34 2022 +0200 staging: r8188eu: remove to_fr_ds from struct rx_pkt_attrib to_fr_ds in struct rx_pkt_attrib stores the values of the to_ds and from_ds bits of an incoming data frame. to_fr_ds is set by parsing the frame control bytes and it's used only in validate_recv_data_frame. Remove to_fr_ds from struct rx_pkt_attrib and use the ieee80211 helpers to distinguish between the four different cases for to_ds, from_ds. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d9290327e6f52851c82db5997deb76405df976a6 Author: Martin Kaiser Date: Sun Apr 3 18:54:33 2022 +0200 staging: r8188eu: don't copy ra and ta before we fail In validate_recv_data_frame, we return an error if both to_ds and from_ds are set in the incoming data frame. There's no need to populate patrib->ra and ta before we return. The caller will free the received frame, including pattrib. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit eafbade349fdc21feba0997918cb070b629ad9b4 Author: Martin Kaiser Date: Sun Apr 3 18:54:32 2022 +0200 staging: r8188eu: to_fr_ds cannot be 3 here Remove two unnecessary ternary operators in validate_recv_data_frame. pattrib->to_fr_ds cannot be 3 in these places. If it was 3, we'd already have returned an error to the caller. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d3a0a1dccc20618efdb575f5d95b746a7c4e2a3e Author: Martin Kaiser Date: Sun Apr 3 18:54:31 2022 +0200 staging: r8188eu: simplify error handling Simplify the error handling in validate_recv_data_frame. The function does not have to do any cleanup for errors, we can return immediately. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d296a81b551eeefdcd2cd5f7d28e6a7a7a089668 Author: Martin Kaiser Date: Sun Apr 3 18:54:30 2022 +0200 staging: r8188eu: use ieee80211 helper for retry bit Use the ieee80211 helper to check if the retry bit is set in the incoming data frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cdd99aa12bad9a534f981fa5c114c1d3f6ef0941 Author: Martin Kaiser Date: Sun Apr 3 18:54:29 2022 +0200 staging: r8188eu: use ieee80211 helper for destination address Use the ieee80211_get_DA helper to get a pointer to the destination address of the incoming data frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9dedacd9fa04baa15ddecc5ce7800af096ab359f Author: Martin Kaiser Date: Sun Apr 3 18:54:28 2022 +0200 staging: r8188eu: use ieee80211 helper for source address Use the ieee80211_get_SA helper to get a pointer to the source address of the incoming data frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403165438.357728-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 93d256cd3c1e93c4093e8015b371e832de4c4146 Author: Bjorn Helgaas Date: Thu Mar 3 18:04:43 2022 -0600 x86/PCI: Eliminate remove_e820_regions() common subexpressions Add local variables to reduce repetition later. No functional change intended. Link: https://lore.kernel.org/r/20220304035110.988712-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Hans de Goede Reviewed-by: Mika Westerberg Acked-by: Rafael J. Wysocki commit dff6139015dc68e93be3822a7bd406a1d138628b Author: Mario Limonciello Date: Thu Mar 31 22:40:03 2022 -0500 PCI/ACPI: Allow D3 only if Root Port can signal and wake from D3 acpi_pci_bridge_d3(dev) returns "true" if "dev" is a hotplug bridge that can handle hotplug events while in D3. Previously this meant either: - "dev" has a _PS0 or _PR0 method (acpi_pci_power_manageable()), or - The Root Port above "dev" has a _DSD with a "HotPlugSupportInD3" property with value 1. This did not consider _PRW, which tells us about wakeup GPEs (ACPI v6.4, sec 7.3.13). Without a wakeup GPE, from an ACPI perspective the Root Port has no way of generating wakeup signals, so hotplug events will be lost if we use D3. Similarly, it did not consider _S0W, which tells us the deepest D-state from which a device can wake itself (sec 7.3.20). If _S0W tells us the device cannot wake from D3, hotplug events will again be lost if we use D3. Some platforms, e.g., AMD Yellow Carp, supply "HotPlugSupportInD3" without _PRW or with an _S0W that says the Root Port cannot wake from D3. On those platforms, we previously put bridges in D3hot, hotplug events were lost, and hotplugged devices would not be recognized without manually rescanning. Allow bridges to be put in D3 only if the Root Port can generate wakeup GPEs (wakeup.flags.valid), it can wake from D3 (_S0W), AND it has the "HotPlugSupportInD3" property. Neither Windows 10 nor Windows 11 puts the bridge in D3 when the firmware is configured this way, and this change aligns the handling of the situation to be the same. [bhelgaas: commit log, tidy "HotPlugSupportInD3" check and comment] Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/07_Power_and_Performance_Mgmt/device-power-management-objects.html?highlight=s0w#s0w-s0-device-wake-state Link: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-pcie-root-ports-supporting-hot-plug-in-d3 Link: https://lore.kernel.org/r/20220401034003.3166-1-mario.limonciello@amd.com Fixes: 26ad34d510a87 ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") Signed-off-by: Mario Limonciello Signed-off-by: Bjorn Helgaas Reviewed-by: Rafael J. Wysocki commit aada014aa50cb2c93ea72c38a79270cd4b66b170 Author: Martin Kaiser Date: Sun Apr 3 18:45:26 2022 +0200 staging: r8188eu: use ieee80211 struct for aid Remove the GetAid macro and map the frame data to a struct ieee80211_pspoll instead. We can then read the aid component. psta->aid is in host endianness and has a 0x3FFF mask applied. We have to convert our read value as well and apply the mask before we compare it to psta->aid. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403164526.357371-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a32dad7d97eadb69fcddc5fdb3dd98e684a7a870 Author: Martin Kaiser Date: Sun Apr 3 18:45:25 2022 +0200 staging: r8188eu: use ieee80211 structs for addresses Map the incoming frame data to a struct ieee80211_hdr and extract the addresses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403164526.357371-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1988a52484af6ee69673ff241636827bf743e246 Author: Martin Kaiser Date: Sun Apr 3 18:45:24 2022 +0200 staging: r8188eu: exit straight away if we have no pspoll frame validate_recv_ctrl_frame wraps nearly all of its code into a large if (pspoll) { ... } clause. Revert this condition and exit if the incoming frame is not a pspoll frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403164526.357371-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 45d433b817970714fc9d77a7033631d0f47ce97c Author: Martin Kaiser Date: Sun Apr 3 18:45:23 2022 +0200 staging: r8188eu: use ieee80211 helper to check for pspoll Use the ieee80211 helper to check if our incoming ctrl frame is a pspoll frame. We can drop the initial ctrl frame check as ieee80211_is_pspoll checks for a control frame with subtype pspoll. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403164526.357371-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 797afdf24872a087567b680402bde62b06697b42 Author: Martin Kaiser Date: Sun Apr 3 18:45:22 2022 +0200 staging: r8188eu: make validate_recv_ctrl_frame return void Make validate_recv_ctrl_frame return void. At the moment, the function always returns _FAIL, the caller does not check the return value. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403164526.357371-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5a3fe21cc4317682494aa1ff568eff54c50be596 Author: Martin Kaiser Date: Sun Apr 3 18:38:18 2022 +0200 staging: r8188eu: use ieee80211 helpers in validate_recv_mgnt_frame Use the ieee80211 helpers to detect the frame subtype in and to parse mac addresses in validate_recv_mgnt_frame. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403163818.357173-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 51e260ca8084864daa9c759f6aefa25ad17698ca Author: Martin Kaiser Date: Sun Apr 3 18:38:17 2022 +0200 staging: r8188eu: make validate_recv_mgnt_frame return void Change the validate_recv_mgnt_frame function to not return a status. It always returns _SUCCESS, its only caller does not check the return value. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403163818.357173-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4edee67c4b84a4c21a6602c29d79fb3f4516a96f Author: Martin Kaiser Date: Sun Apr 3 18:32:06 2022 +0200 staging: r8188eu: remove constant variable wifi_test_chk_rate is always 1. Remove the variable and the code to check it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403163206.357004-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c44e7782b5239664b13a154514aa391831de93a2 Author: Martin Kaiser Date: Sun Apr 3 18:32:05 2022 +0200 staging: r8188eu: remove unnecessary jump Don't jump to _continue, we go there anyway. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220403163206.357004-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 01416de7fc45c259395e70148e3d9a2d7cea55cd Author: Bruno Moreira-Guedes Date: Sun Apr 3 19:27:28 2022 -0300 staging: vme_user: Fixed typo in the MODULE_AUTHOR The MODULE_AUTHOR line missed the '>' character in the end of the author's e-mail address. Just added it. Signed-off-by: Bruno Moreira-Guedes Link: https://lore.kernel.org/r/20220403222728.276111-1-codeagain@codeagain.dev Signed-off-by: Greg Kroah-Hartman commit 0cc4dfbbd7758076aea3ce5a13f0225c8dbcadb7 Author: Jaehee Park Date: Fri Apr 1 10:53:50 2022 -0400 staging: wfx: change variable name to be consistent Change variable name to be consistent with the naming conventions. ssidlen was changed to ssid_len and ssidie was changed to ssid_ie to be consistent. This makes the variables more readable. The other ssid names in the code are separated by an underscore. For example, bssid_filter and num_of_ssids have the ssid separated from the rest of the words with an underscore. Signed-off-by: Jaehee Park Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20220401145350.GA45053@jaehee-ThinkPad-X1-Extreme Signed-off-by: Greg Kroah-Hartman commit f0e3c6261af183f0c2246cfe691abec78377622c Author: Johnson Wang Date: Fri Apr 1 16:02:11 2022 +0800 regulator: mt6366: Add support for MT6366 regulator The MT6366 is a regulator found on boards based on MediaTek MT8186 and probably other SoCs. It is a so called pmic and connects as a slave to SoC using SPI, wrapped inside the pmic-wrapper. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Johnson Wang Link: https://lore.kernel.org/r/20220401080212.27383-2-johnson.wang@mediatek.com Signed-off-by: Mark Brown commit f704882033a70cbc27f6944e831e325eb3214c73 Author: Johnson Wang Date: Fri Apr 1 16:02:12 2022 +0800 regulator: Add BUCK and LDO document for MT6358 and MT6366 Add buck_vcore_sshub and ldo_vsram_others_sshub regulators to binding document for MT6358 and MT6366. Reviewed-by: Rob Herring Signed-off-by: Johnson Wang Link: https://lore.kernel.org/r/20220401080212.27383-3-johnson.wang@mediatek.com Signed-off-by: Mark Brown commit ca2a3c9204ec556f45957c063c36dc6cdeec6402 Author: Ville Syrjälä Date: Thu Mar 17 19:19:38 2022 +0200 drm/i915/bios: Extract struct lvds_lfp_data_ptr_table All the LFP data table pointers have uniform layout. Turn that into a struct. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220317171948.10400-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f8eee759b989f3e04158c754954d8c1e663fa1da Author: Ville Syrjälä Date: Mon Mar 21 21:50:06 2022 +0200 drm/i915: Remove dead members from dev_priv Remove some zombies from our device structure. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220321195006.775-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e97798e254b17a62b061f31e1d2061e936f94e2e Author: Ville Syrjälä Date: Mon Mar 21 21:50:05 2022 +0200 drm/i915: Use drm_connector_attach_hdr_output_metadata_property() Stop hand rolling drm_connector_attach_hdr_output_metadata_property(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220321195006.775-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f543a3e82bb275349961f8507ee195f34132ffb4 Author: Xiao Yang Date: Thu Mar 31 11:24:19 2022 +0800 IB/uverbs: Move part of enum ib_device_cap_flags to uapi 1) Part of enum ib_device_cap_flags are used by ibv_query_device(3) or ibv_query_device_ex(3), so we define them in include/uapi/rdma/ib_user_verbs.h and only expose them to userspace. 2) Reformat enum ib_device_cap_flags by removing the indent before '='. Link: https://lore.kernel.org/r/20220331032419.313904-2-yangx.jy@fujitsu.com Signed-off-by: Xiao Yang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 30ad63e784dd71cbc608a0d039a88e6df12aa258 Author: Xiao Yang Date: Thu Mar 31 11:24:18 2022 +0800 IB/uverbs: Move enum ib_raw_packet_caps to uapi This enum is used by ibv_query_device_ex(3) so it should be defined in include/uapi/rdma/ib_user_verbs.h. Link: https://lore.kernel.org/r/20220331032419.313904-1-yangx.jy@fujitsu.com Signed-off-by: Xiao Yang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 45bf247218ebea198ad339edcbd2552ac4bc1053 Author: Zhu Yanjun Date: Wed Mar 23 19:01:35 2022 -0400 RDMA/irdma: Remove the redundant variable In the function irdma_puda_get_next_send_wqe, the variable wqe is not necessary. So remove it. Link: https://lore.kernel.org/r/20220323230135.291813-1-yanjun.zhu@intel.com Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 01251dd004d8e106295c3aa8e3ba890f0dd55e02 Author: Mark Brown Date: Fri Mar 25 15:42:41 2022 +0000 ASoC: atmel: Don't squash error codes from atmel_ssc_set_audio() The AT91SAM9G20-EK audio driver is replacing any error code returned by atmel_ssc_set_audio() with -EINVAL which could be unhelpful for debugging. Pass through the error code, and include it in the log message we print for good measure. Signed-off-by: Mark Brown Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220325154241.1600757-4-broonie@kernel.org commit 28103509248b94392e04a8ffcbc47da5e3e31dfc Author: Mark Brown Date: Fri Mar 25 15:42:40 2022 +0000 ASoC: atmel: Fix error handling in at91samg20ek probe() The error handling in the AT91SAM9G20-EK machine driver probe did not consistently free the SSC in error paths, sometimes immediately returning an error rather than doing cleanup. Fix this. Signed-off-by: Mark Brown Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220325154241.1600757-3-broonie@kernel.org commit fba2689ee77e63b05e203b3f26079ef915e55660 Merge: 3123109284176 1c4b5ecb7ea19 Author: Arnd Bergmann Date: Mon Apr 4 14:42:49 2022 +0200 Merge branch 'remove-h8300' of git://git.infradead.org/users/hch/misc into asm-generic * 'remove-h8300' of git://git.infradead.org/users/hch/misc: remove the h8300 architecture This is clearly the least actively maintained architecture we have at the moment, and probably the least useful. It is now the only one that does not support MMUs at all, and most of the boards only support 4MB of RAM, out of which the defconfig kernel needs more than half just for .text/.data. Guenter Roeck did the original patch to remove the architecture in 2013 after it had already been obsolete for a while, and Yoshinori Sato brought it back in a much more modern form in 2015. Looking at the git history since the reinstantiation, it's clear that almost all commits in the tree are build fixes or cross-architecture cleanups: $ git log --no-merges --format=%an v4.5.. arch/h8300/ | sort | uniq -c | sort -rn | head -n 12 25 Masahiro Yamada 18 Christoph Hellwig 14 Mike Rapoport 9 Arnd Bergmann 8 Mark Rutland 7 Peter Zijlstra 6 Kees Cook 6 Ingo Molnar 6 Al Viro 5 Randy Dunlap 4 Yury Norov Signed-off-by: Arnd Bergmann commit 9d7370a56d1871e924377872985a13f6cd104e82 Author: AngeloGioacchino Del Regno Date: Wed Mar 23 10:19:32 2022 +0100 soc: mediatek: mmsys: Add sw0_rst_offset for MT8192 MT8192 has the same sw0 reset offset as MT8186: add the parameter to be able to use mmsys as a reset controller for managing at least the DSI reset line. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rex-BC Chen Link: https://lore.kernel.org/r/20220323091932.10648-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit aa8f3711fc87f7d9b8edee6f09e44b3f9113f081 Author: Allen-KH Cheng Date: Wed Mar 30 21:38:15 2022 +0800 arm64: dts: mt8192: Add H264 venc device node Adds H264 venc node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220330133816.30806-4-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit e530d080932d0db52071c9bec20d60b4a3d9035c Author: Allen-KH Cheng Date: Wed Mar 30 21:38:13 2022 +0800 arm64: dts: mt8192: Add PCIe node Add PCIe node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220330133816.30806-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit b2edd51979d2861e75a9b20ac0e566e9a0770d81 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:29 2022 +0800 arm64: dts: mt8192: Add dpi node Add dpi node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220318144534.17996-18-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 7663f7a26b335a53102a0893824689182ac64e42 Author: Tinghan Shen Date: Wed Feb 16 19:31:29 2022 +0800 dt-bindings: arm: mediatek: Add mt8195 pericfg compatible Add mt8195 pericfg compatible to binding document. Signed-off-by: Tinghan Shen Acked-by: Rob Herring Acked-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220216113131.13145-2-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 19c66219e4d5b813ebbd28621cfe9c450659ded7 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:31 2022 +0800 arm64: dts: mt8192: Add the mmsys reset bit to reset the dsi0 Reset the DSI hardware is needed to prevent different settings between the bootloader and the kernel. Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220318144534.17996-20-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 4a65b0f1bec51872b406a8f74a66c0e6e298423c Author: Allen-KH Cheng Date: Fri Mar 18 22:45:26 2022 +0800 arm64: dts: mt8192: Add m4u and smi nodes Add m4u and smi nodes for mt8192 SoC Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220318144534.17996-15-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 4d50a433d0fde2c610628a7b40a0291899861482 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:23 2022 +0800 arm64: dts: mt8192: Add efuse node Add efuse node for mt8192 SoC Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220318144534.17996-12-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 27f0eb16b0d417c155e96b5d3b89074699944e09 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:22 2022 +0800 arm64: dts: mt8192: Fix nor_flash status disable typo Correct nor_flash status disable typo of mt8192 SoC. Fixes: d0a197a0d064a ("arm64: dts: mt8192: add nor_flash device node") Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Miles Chen Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220318144534.17996-11-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit e5aac2258e666cdfe7e027766b89af639cd5fb08 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:18 2022 +0800 arm64: dts: mt8192: Add xhci node Add xhci node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220318144534.17996-7-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 40de66b8bbbb6137022652954167d5c570bb93c2 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:17 2022 +0800 arm64: dts: mt8192: Add usb-phy node Add xhci node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220318144534.17996-6-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit c63556ec6bfe21cde6ab2fb0b651112bc5e99e56 Author: Allen-KH Cheng Date: Fri Mar 18 22:45:16 2022 +0800 arm64: dts: mt8192: Add SCP node Add SCP node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220318144534.17996-5-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 261691b40128e6b76bb94d562457d8a5236cc7fa Author: Allen-KH Cheng Date: Fri Mar 18 22:45:13 2022 +0800 arm64: dts: mt8192: Add pwrap node Add pwrap node for mt8192 SoC. Signed-off-by: Allen-KH Cheng Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220318144534.17996-2-allen-kh.cheng@mediatek.com Signed-off-by: Matthias Brugger commit 33c7874b44324fe9657d19ca01ef4ae4403a5a4b Author: Nícolas F. R. A. Prado Date: Tue Mar 1 15:31:47 2022 -0500 arm64: dts: mediatek: Format mediatek,larbs as an array of phandles Commit 39bd2b6a3783 ("dt-bindings: Improve phandle-array schemas") updated the mediatek,larbs property in the mediatek,iommu.yaml dt-binding to make it clearer that the phandles passed to the property are independent, rather than subsequent arguments to the first phandle. Update the mediatek,larbs property in the arm64 Devicetrees to use the same formatting. This change doesn't impact any behavior: the compiled dtb is exactly the same. It does however fix the warnings generated by dtbs_check. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220301203147.1143782-2-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 265a3bf486d4aac913d1bcbe81b01e271328a265 Author: Kunihiko Hayashi Date: Wed Mar 30 14:17:03 2022 +0900 dt-bindings: gpio: uniphier: Add hogs parsing Allow parsing GPIO controller children nodes with GPIO hogs to fix the following warning: uniphier-ld11-ref.dtb: gpio@55000000: 'xirq0-hog' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 95cd2cdc88c755dcd0a58b951faeb77742c733a4 Author: Tao Jin Date: Sun Apr 3 12:57:44 2022 -0400 HID: multitouch: add quirks to enable Lenovo X12 trackpoint This applies the similar quirks used by previous generation devices such as X1 tablet for X12 tablet, so that the trackpoint and buttons can work. This patch was applied and tested working on 5.17.1 . Cc: stable@vger.kernel.org # 5.8+ given that it relies on 40d5bb87377a Signed-off-by: Tao Jin Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/CO6PR03MB6241CB276FCDC7F4CEDC34F6E1E29@CO6PR03MB6241.namprd03.prod.outlook.com commit 03941ed91c7231e4973fb50de6c349974405df4e Author: Jakob Koschel Date: Thu Mar 24 08:27:00 2022 +0100 thunderbolt: 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/ Signed-off-by: Jakob Koschel Signed-off-by: Mika Westerberg commit ae059c0b1cbf13867369deb8d831a11cac3b00a0 Author: Liu Ying Date: Fri Apr 1 09:58:28 2022 +0800 drm/bridge: nwl-dsi: Drop the drm_of_panel_bridge_remove() function call Since this driver has been changed to use the resource managed devm_drm_of_get_bridge() to get bridge from ->attach(), it's unnecessary to call drm_of_panel_bridge_remove() to remove the bridge from ->detach(). So, let's drop the drm_of_panel_bridge_remove() function call. As nwl_dsi_bridge_detach() only calls drm_of_panel_bridge_remove(), it can also be dropped. Cc: Robert Foss Cc: Guido Günther Cc: Jagan Teki Cc: NXP Linux Team Signed-off-by: Liu Ying Reviewed-by: Jagan Teki Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220401015828.2959505-1-victor.liu@nxp.com commit 3730bc6147b05109b419ccff7b6f9ef3e3e71ffe Author: Jagan Teki Date: Fri Apr 1 20:35:33 2022 +0530 drm: bridge: mcde_dsi: Drop explicit bridge remove This driver has been changed to use the resource managed devm_drm_of_get_bridge() to get bridge from ->bind(), it's unnecessary to call drm_of_panel_bridge_remove() to remove the bridge from ->unbind() as devm_drm_of_get_bridge() is automatically remove the bridge when @dev is unbound. Drop it the drm_bridge_remove(). Cc: Linus Walleij Reported-by: Maxime Ripard Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220401150533.7777-1-jagan@amarulasolutions.com commit ca9df4a75a208f3294a9a09b84ffa1bc89d3e0df Author: Lad Prabhakar Date: Tue Mar 8 14:00:33 2022 +0000 arm64: defconfig: Enable ARCH_R9A07G054 Enable support for the Renesas RZ/V2L SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220308140033.10501-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0182581a9f63764bcbdbc68e98881b50e03fc4c4 Author: Koji Matsuoka Date: Sat Mar 19 23:33:05 2022 +0100 arm64: dts: renesas: r8a77961: Add CAN-FD node Add the device node for the CAN-FD device on R-Car M3-W+. Signed-off-by: Koji Matsuoka Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220319223306.60782-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit d2194187aa4f9a4c2df010962e4e008efc3f930b Author: Ulrich Hecht Date: Wed Mar 9 17:26:08 2022 +0100 arm64: dts: renesas: falcon: Enable CANFD 0 and 1 Enables confirmed-working CAN interfaces 0 and 1 on the Falcon board. Signed-off-by: Ulrich Hecht Link: https://lore.kernel.org/r/20220309162609.3726306-4-uli+renesas@fpond.eu Signed-off-by: Geert Uytterhoeven commit d63833b8699c585d9ed32d968563b5eba69df9f6 Author: Ulrich Hecht Date: Wed Mar 9 17:26:07 2022 +0100 arm64: dts: renesas: r8a779a0: Add CANFD device node This patch adds a CANFD device node for r8a779a0. Based on patch by Kazuya Mizuguchi. Signed-off-by: Ulrich Hecht Link: https://lore.kernel.org/r/20220309162609.3726306-3-uli+renesas@fpond.eu Signed-off-by: Geert Uytterhoeven commit 9a4259e59694136add708608fce861a1beff9635 Author: Kieran Bingham Date: Wed Mar 9 19:06:31 2022 +0000 arm64: dts: renesas: falcon-cpu: Use INTC_EX for SN65DSI86 The INTC block is a better choice for handling the interrupts on the V3U as the INTC will always be powered, while the GPIO block may be de-clocked if not in use. Further more, it may be likely to have a lower power consumption as it does not need to drive the pins. Switch the interrupt parent and interrupts definition from gpio1 to irq0 on intc_ex, and configure the PFC accordingly. Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20220309190631.1576372-1-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit f6a2f28ab19ca5ce5bbd3a821fe19468d7c921dc Author: Lad Prabhakar Date: Tue Mar 8 22:33:24 2022 +0000 arm64: dts: renesas: r9a07g054: Add TSU node Add TSU and thermal-zones nodes to RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220308223324.7456-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4b7e7f10835a504501a04a82498234da78c4117e Author: Lad Prabhakar Date: Tue Mar 8 22:33:23 2022 +0000 arm64: dts: renesas: r9a07g054: Add OPP table Add OPP table for RZ/V2L SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220308223324.7456-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 809823b853a2559d04948ea43800408f00c8db23 Author: Lad Prabhakar Date: Tue Mar 8 22:33:22 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the GPU node Renesas RZ/V2L SoC has Mali-G31 GPU, this patch fills up the GPU node and adds opp table to RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220308223324.7456-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6f57895c49bc36a6ba125b9926d4b9699376e656 Author: Biju Das Date: Mon Mar 7 19:24:35 2022 +0000 arm64: dts: renesas: rzg2lc-smarc-som: Add vdd core regulator Add vdd core regulator (1.1 V) for GPU. This patch add regulator support for GPU. The H/W manual mentions nothing about a GPU regulator. So using vdd core regulator for GPU. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220307192436.13237-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a081c4fe98f6662fbddb1597a6203be669641af1 Author: Biju Das Date: Mon Mar 7 19:24:34 2022 +0000 arm64: dts: renesas: rzg2lc-smarc-som: Enable OSTM Enable OSTM{1, 2} interfaces on RZ/G2LC SMARC EVK. OSTM0 is reserved for TF-A. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220307192436.13237-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 018d7b93477fbb04ba7b4bc4c355793d644e45da Author: Biju Das Date: Mon Mar 7 19:24:33 2022 +0000 arm64: dts: renesas: rzg2lc-smarc-som: Enable serial NOR flash Enable mt25qu512a flash connected to QSPI0. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220307192436.13237-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4eb6a6bb8ef31491c217167ecce2c0a26fd4f34e Author: Biju Das Date: Thu Mar 3 16:41:55 2022 +0000 arm64: dts: renesas: rzg2lc-smarc: Enable Audio Enable Audio on RZ/G2LC SMARC EVK by deleting ssi0 entries from board DT and adding pincontrol entries to the soc-pinctrl dtsi, so that entries from common dtsi kick in and make audio functionality operational. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220303164155.7706-5-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4fa1edc83b2b2b467ed47bd682c7beab81a38ef5 Author: Biju Das Date: Thu Mar 3 16:41:54 2022 +0000 arm64: dts: renesas: rzg2lc-smarc: Enable i2c{0,1,2} Enable i2c{0,1} on RZ/G2LC SMARC EVK by deleting respective entries from board dts and adding pincontrol entries to the soc-pinctrl dtsi. Also enable i2c2 by adding to soc dtsi. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220303164155.7706-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0a7c1c888a0c0276837f2cd7190683474a136506 Author: Biju Das Date: Thu Mar 3 16:41:53 2022 +0000 arm64: dts: renesas: rzg2l-smarc: Move out i2c3 and Audio codec from common dtsi On RZ/G2L SoM module, the Audio codec is connected to i2c3 bus whereas on RZ/G2LC, it is connected to i2c2 bus. So move out i2c3 and wm8978 nodes from common dtsi to soc specific dtsi. While at it add wm8978 node to RZ/G2LC SoC specific dtsi to fix the build error. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220303164155.7706-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a2b642d89e4beeddbfbd7be6108db2b7aaef78b6 Author: Biju Das Date: Thu Mar 3 16:41:52 2022 +0000 arm64: dts: renesas: rzg2lc-smarc-pinfunction: Sort the nodes Sort the pinctrl nodes alphabetically. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220303164155.7706-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1889f4798c443dfd4993ba9bbbf4ed7bf801d94b Author: Biju Das Date: Wed Mar 2 07:40:43 2022 +0000 arm64: dts: renesas: r9a07g044c2-smarc: Enable usb2.0 Enable usb2.0 host/device functionality on RZ/G2LC SMARC EVK by deleting phyrst, usb2_phy{0,1}, ehci/ohci{0,1} and hsusb entries from board DT, so that entries from common dtsi kick in and make USB2.0 functionality operational. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220302074043.21525-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3f3c46d4e2cb38bfa7d1f24c2099a20229867d9d Author: Lad Prabhakar Date: Sun Feb 27 20:37:44 2022 +0000 arm64: dts: renesas: r9a07g054: Add SPI{0,2} nodes and fillup SPI1 stub node Add SPI{0,2} nodes and fillup SPI1 stub node in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-13-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c9c4e5b7d202cce2f488a56c06332016380890b3 Author: Lad Prabhakar Date: Sun Feb 27 20:37:43 2022 +0000 arm64: dts: renesas: r9a07g054: Add USB2.0 device support Fillup the hsusb stub node in RZ/V2L (R9A07G054) SoC DTSI which enables USB2.0 device support. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-12-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a8e2a77b644ac23319f0e7c3e8d9dcd6dc9aebd1 Author: Lad Prabhakar Date: Sun Feb 27 20:37:42 2022 +0000 arm64: dts: renesas: r9a07g054: Add USB2.0 phy and host support Add USB2.0 phy and host support to RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-11-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit cd0339ec25895c0be45656908442bc121bbadacb Author: Lad Prabhakar Date: Sun Feb 27 20:37:41 2022 +0000 arm64: dts: renesas: r9a07g054: Add SSI{1,2,3} nodes and fillup the SSI0 stub node Add SSI{1,2,3} nodes and fillup the SSI0 stub node in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-10-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f35a868bcf95c066a00dcae9e7ee42d85eaf05b2 Author: Lad Prabhakar Date: Sun Feb 27 20:37:40 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the WDT{0,1,2} stub nodes Fillup the WDT{0,1,2} stub nodes in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-9-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit f458b7707c9c4acabb7cdf6c0fcfde1a506b360f Author: Lad Prabhakar Date: Sun Feb 27 20:37:39 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the OSTM{0,1,2} stub nodes Fillup the OSTM{0,1,2} stub nodes in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-8-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8d3da65c4c40d77977799f58fa6465bdc723536f Author: Lad Prabhakar Date: Sun Feb 27 20:37:38 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the sbc stub node Fillup the sbc stub node in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e46a72e0398e570fbab5905ea6be67dc76d678f4 Author: Lad Prabhakar Date: Sun Feb 27 20:37:37 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the I2C{0,1,2,3} stub nodes Fillup the I2C{0,1,2,3} stub nodes in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 2f89bef90de4740be33b2cb4ba95e0107df0d25e Author: Biju Das Date: Tue Mar 15 14:26:39 2022 +0000 soc: renesas: Identify RZ/G2UL SoC Add support for identifying the RZ/G2UL SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220315142644.17660-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3f285c301cd788164fa776e1f95458c56e68a6ee Author: Biju Das Date: Tue Mar 15 14:26:38 2022 +0000 dt-bindings: power: renesas,rzg2l-sysc: Document RZ/G2UL SoC Add DT binding documentation for SYSC controller found on RZ/G2UL SoC's. SYSC controller found on the RZ/G2UL SoC is almost identical to one found on the RZ/G2L SoC's only difference being that the RZ/G2UL has only CA55 core0 reset vector address configuration register. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220315142644.17660-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 3733db1f77130588c9a2c1596937294998bd7d27 Author: Biju Das Date: Tue Mar 15 14:29:15 2022 +0000 dt-bindings: clock: renesas: Document RZ/G2UL SoC Document the device tree binding for the Renesas RZ/G2UL Type-1 and Type-2 SoC. RZ/G2UL Type-2 has fewer clocks than RZ/G2UL Type-1 SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220315142915.17764-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 53367bd28f3bf143355e66f20cb6cb83b70e9122 Author: Phil Edworthy Date: Fri Mar 4 14:32:41 2022 +0000 clk: renesas: rzg2l: Remove unused notifiers notifiers is not used. Signed-off-by: Phil Edworthy Link: https://lore.kernel.org/r/20220304143241.8523-1-phil.edworthy@renesas.com Signed-off-by: Geert Uytterhoeven commit e3ab4573761418ba1b853ec33e5db723db279ff5 Author: Lad Prabhakar Date: Sun Feb 27 20:37:36 2022 +0000 arm64: dts: renesas: r9a07g054l2-smarc: Drop deleting can{0,1}-stb-hog nodes Drop deleting can{0,1}-stb-hog nodes so that CAN becomes operational on Renesas RZ/V2L SMARC EVK. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 791b7e1dcb9fe9f9e7f7dd1b6714cd8e0f6ee349 Author: Lad Prabhakar Date: Sun Feb 27 20:37:35 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the CANFD stub node Fillup the CANFD stub node in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b0bb96e5162368814acdc76da7fdb2cd574f58c2 Author: Lad Prabhakar Date: Sun Feb 27 20:37:34 2022 +0000 arm64: dts: renesas: r9a07g054l2-smarc: Drop deleting gpio-hog pins related to SDHI Drop deleting gpio-hog pins related to SDHI0/1 so that SDHI functionality gets enabled on Renesas RZ/V2L SMARC EVK. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ffe3f135dd28295114233d2a8073b3b15774b528 Author: Lad Prabhakar Date: Sun Feb 27 20:37:33 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the SDHI{0,1} stub nodes Fillup the SDHI{0,1} stub nodes in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220227203744.18355-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8eb5092e64de30c003d8fe16a7eeacbfe29b7b84 Author: Lad Prabhakar Date: Thu Feb 24 12:58:43 2022 +0000 arm64: dts: renesas: r9a07g054: Fillup the ADC stub node Fillup the ADC stub node in RZ/V2L (R9A07G054) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20220224125843.29733-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 2946aa908bb63539b566fc3ba0b867022787602b Author: Julia Lawall Date: Fri Mar 18 11:37:27 2022 +0100 ARM: rockchip: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220318103729.157574-32-Julia.Lawall@inria.fr Signed-off-by: Heiko Stuebner commit f7c48bccf1a0262a763f7e39f28c5c6798f2d6c3 Author: Rafał Miłecki Date: Sat Mar 26 17:33:04 2022 +0100 mtd: rawnand: print offset instead of page number for bad blocks This makes printed info consistent with other kernel messages. After scanning NAND BBT create_bbt() prints offset of each bad block. This change makes is easy to verify nand_erase_nand() failure reason. Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220326163304.30806-1-zajec5@gmail.com commit 54647cd003c08b714474a5b599a147ec6a160486 Author: Chuanhong Guo Date: Sun Mar 20 18:00:01 2022 +0800 mtd: spinand: gigadevice: add support for GD5FxGM7xExxG Add support for: GD5F{1,2}GM7{U,R}ExxG GD5F4GM8{U,R}ExxG These are new 27nm counterparts for the GD5FxGQ4 chips from GigaDevice with 8b/512b on-die ECC capability. These chips (and currently supported GD5FxGQ5 chips) have QIO DTR instruction for reading page cache. It isn't added in this patch because I don't have a DTR spi controller for testing. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-6-gch981213@gmail.com commit 194ec04b3a9e7fa97d1fbef296410631bc3cf1c8 Author: Chuanhong Guo Date: Sun Mar 20 18:00:00 2022 +0800 mtd: spinand: gigadevice: add support for GD5F{2, 4}GQ5xExxG Add support for: GD5F2GQ5{U,R}ExxG GD5F4GQ6{U,R}ExxG These chips uses 4 dummy bytes for quad io and 2 dummy bytes for dual io. Besides that and memory layout, they are identical to their 1G variant. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-5-gch981213@gmail.com commit 620a988813403318023296b61228ee8f3fcdb8e0 Author: Chuanhong Guo Date: Sun Mar 20 17:59:59 2022 +0800 mtd: spinand: gigadevice: add support for GD5F1GQ5RExxG This chip is the 1.8v version of GD5F1GQ5UExxG. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-4-gch981213@gmail.com commit 573eec222bc82fb5e724586267fbbb1aed9ffd03 Author: Chuanhong Guo Date: Sun Mar 20 17:59:58 2022 +0800 mtd: spinand: gigadevice: add support for GD5FxGQ4xExxG Add support for: GD5F1GQ4RExxG GD5F2GQ4{U,R}ExxG These chips differ from GD5F1GQ4UExxG only in chip ID, voltage and capacity. Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-3-gch981213@gmail.com commit a4f9dd55c5e1bb951db6f1dee20e62e0103f3438 Author: Chuanhong Guo Date: Sun Mar 20 17:59:57 2022 +0800 mtd: spinand: gigadevice: fix Quad IO for GD5F1GQ5UExxG Read From Cache Quad IO (EBH) uses 2 dummy bytes on this chip according to page 23 of the datasheet[0]. [0]: https://www.gigadevice.com/datasheet/gd5f1gq5xexxg/ Fixes: 469b99248985 ("mtd: spinand: gigadevice: Support GD5F1GQ5UExxG") Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-2-gch981213@gmail.com commit 6425dd136ddc40fc434156d1957a3adb367dd874 Author: Wang Weiyang Date: Thu Mar 17 19:39:07 2022 +0800 mtd: rawnand: davinci: Remove redundant unsigned comparison to zero Since core_chipsel is uint32_t, comparison to zero is redundant Signed-off-by: Wang Weiyang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220317113907.96006-1-wangweiyang2@huawei.com commit 4c38eded807043f40f4dc49da6df097f9dcac393 Author: Rafał Miłecki Date: Thu Mar 17 12:43:16 2022 +0100 mtd: parsers: bcm47xxpart: print correct offset on read error mtd_read() gets called with offset + 0x8000 as argument so use the same value in pr_err(). Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220317114316.29827-1-zajec5@gmail.com commit 09f6b27d5ddd9ad0ec096d1b0f8decdacc70f0f8 Author: Arnd Bergmann Date: Sun Feb 23 11:30:13 2014 +0100 ARM: dove: multiplatform support The dove platform is now ready to be enabled for multiplatform support, this patch does the switch over by modifying the Kconfig file, the defconfig and removing the last mach/*.h header that becomes obsolete with this. This work was originally done in 2015 as all the ARMv7 machiens gove moved over to multiplatform builds, but at the time it conflicted with some patches that Russell was trying to upstream, so we left it at that. I hope that there is no longer a need to keep dove separate from the rest, so we can either add it to the other ARMv7 platforms, or just replace it with the DT based platform code for the same hardware in mach-mvebu and remove mach-dove entirely. Acked-by: Andrew Lunn Cc: Russell King Cc: Jason Cooper Cc: Sebastian Hesselbarth Cc: Gregory Clement Signed-off-by: Arnd Bergmann commit 0361c7e504b1fa3c2901643088e2f29c0354ab31 Author: Arnd Bergmann Date: Fri Apr 1 15:58:09 2022 +0200 ARM: ep93xx: multiplatform support With the clock support and the interrupts out of the way, ep93xx can be compiled into the same kernel image as the other ARMv4/v5 platforms. The last obstacle are the two workarounds for broken boot loaders that require us to re-initialize the ethernet controller and/or the watchdog on certain machines. Move this code into the decompressor sources directly, checking for each possibly affected machine individually. Signed-off-by: Arnd Bergmann commit 4e5f36f84614ce59b140ae6706603d76e6e0cdbe Author: Arnd Bergmann Date: Fri Sep 20 10:18:31 2019 +0200 ARM: ep93xx: make mach/ep93xx-regs.h local Nothing relies on it outside of arch/arm/mach-ep93xx/, so just move it there. Cc: Hartley Sweeten Tested-by: Alexander Sverdlin Signed-off-by: Arnd Bergmann commit 36f1a4ae6b60a9fbd9a35a3b257dc6e53b5feff1 Author: Arnd Bergmann Date: Fri Sep 20 10:10:03 2019 +0200 ARM: ep93xx: enable SPARSE_IRQ Without CONFIG_SPARSE_IRQ, we rely on mach/irqs.h to define NR_IRQS globally. Do the minimal conversion by setting .nr_irqs in each machine descriptor. Only the vision_ep9307 machine has extra IRQs for GPIOs, so make .nr_irqs the original value there, while using the plain NR_EP93XX_IRQS everywhere else. Cc: Hartley Sweeten Cc: Hubert Feurstein Cc: Lukasz Majewski Tested-by: Alexander Sverdlin Signed-off-by: Arnd Bergmann commit 482c27273f52ad336e8d076f96f91b358dcb7d0c Author: Arnd Bergmann Date: Tue Oct 22 10:42:51 2019 +0200 ARM: ep93xx: renumber interrupts With the move to irq domains, no irqchip must start at number 0, so shift all the hardwired IRQ numbers by one. Tested-by: Alexander Sverdlin Signed-off-by: Arnd Bergmann commit d7445676e86900f8dc363825033ff62416c216e0 Author: Arnd Bergmann Date: Fri Apr 1 14:35:42 2022 +0200 ARM: versatile: move integrator/realview/vexpress to versatile These are all fairly small platforms by now, and they are closely related. Just move them all into a single directory. Cc: Linus Walleij Cc: Liviu Dudau Cc: Lorenzo Pieralisi Tested-by: Sudeep Holla Acked-by: Sudeep Holla Signed-off-by: Arnd Bergmann commit f8858b5eff30d1b2be15ef1ea6285964013b95e6 Author: Borislav Petkov Date: Thu Jan 27 12:56:26 2022 +0100 x86/cpu: Remove "noclflush" Not really needed anymore and there's clearcpuid=. Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-7-bp@alien8.de commit 76ea0025a214cdf0d2c204f4c21cbffa9fb57c32 Author: Borislav Petkov Date: Thu Jan 27 12:56:25 2022 +0100 x86/cpu: Remove "noexec" It doesn't make any sense to disable non-executable mappings - security-wise or else. So rip out that switch and move the remaining code into setup.c and delete setup_nx.c Signed-off-by: Borislav Petkov Reviewed-by: Lai Jiangshan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-6-bp@alien8.de commit 385d2ae0a1b5efacb30e13a0f0e521490441d9bb Author: Borislav Petkov Date: Thu Jan 27 12:56:24 2022 +0100 x86/cpu: Remove "nosmep" There should be no need to disable SMEP anymore. Signed-off-by: Borislav Petkov Reviewed-by: Lai Jiangshan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-5-bp@alien8.de commit dbae0a934f09208075ec3e73491bd0844e1397b3 Author: Borislav Petkov Date: Thu Jan 27 12:56:23 2022 +0100 x86/cpu: Remove CONFIG_X86_SMAP and "nosmap" Those were added as part of the SMAP enablement but SMAP is currently an integral part of kernel proper and there's no need to disable it anymore. Rip out that functionality. Leave --uaccess default on for objtool as this is what objtool should do by default anyway. If still needed - clearcpuid=smap. Signed-off-by: Borislav Petkov Reviewed-by: Lai Jiangshan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-4-bp@alien8.de commit c949110ef4e31cb5d3387bd8273fd5de66b5227b Author: Borislav Petkov Date: Thu Jan 27 12:56:22 2022 +0100 x86/cpu: Remove "nosep" That chicken bit was added by 4f88651125e2 ("[PATCH] i386: allow disabling X86_FEATURE_SEP at boot") but measuring int80 vsyscall performance on 32-bit doesn't matter anymore. If still needed, one can boot with clearcpuid=sep to disable that feature for testing. Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-3-bp@alien8.de commit 1625c833db93516faaac5feedadf8d19c14238b6 Author: Borislav Petkov Date: Thu Jan 27 12:56:21 2022 +0100 x86/cpu: Allow feature bit names from /proc/cpuinfo in clearcpuid= Having to give the X86_FEATURE array indices in order to disable a feature bit for testing is not really user-friendly. So accept the feature bit names too. Some feature bits don't have names so there the array indices are still accepted, of course. Clearing CPUID flags is not something which should be done in production so taint the kernel too. An exemplary cmdline would then be something like: clearcpuid=de,440,smca,succory,bmi1,3dnow ("succory" is wrong on purpose). And it says: [ ... ] Clearing CPUID bits: de 13:24 smca (unknown: succory) bmi1 3dnow [ Fix CONFIG_X86_FEATURE_NAMES=n build error as reported by the 0day robot: https://lore.kernel.org/r/202203292206.ICsY2RKX-lkp@intel.com ] Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20220127115626.14179-2-bp@alien8.de commit ace1a98519270c586c0d4179419292df67441cd1 Author: Borislav Petkov Date: Wed Mar 23 23:24:12 2022 +0100 x86/mm: Force-inline __phys_addr_nodebug() Fix: vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x8b: call to __phys_addr_nodebug() leaves .noinstr.text section Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220324183607.31717-4-bp@alien8.de commit 6b91ec4ad290a808a894e7d3448eb82d0b8ef8d5 Author: Borislav Petkov Date: Wed Mar 23 21:52:44 2022 +0100 x86/kvm/svm: Force-inline GHCB accessors In order to fix: vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x4c: call to ghcb_set_sw_exit_code() leaves .noinstr.text section Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220324183607.31717-3-bp@alien8.de commit e87f4152e542610d0b4c6c8548964a68a59d2040 Author: Borislav Petkov Date: Wed Mar 23 20:02:41 2022 +0100 task_stack, x86/cea: Force-inline stack helpers Force-inline two stack helpers to fix the following objtool warnings: vmlinux.o: warning: objtool: in_task_stack()+0xc: call to task_stack_page() leaves .noinstr.text section vmlinux.o: warning: objtool: in_entry_stack()+0x10: call to cpu_entry_stack() leaves .noinstr.text section Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220324183607.31717-2-bp@alien8.de commit b28bc9ebbe2320f919e4f4cf70fafbc8a0ac328d Author: Marek Vasut Date: Mon Mar 28 21:47:25 2022 +0200 iio: adc: ti-ads1015: Switch to read_avail Replace sysfs attributes with read_avail() callback. This also permits removal of ads1115_info, since the scale attribute tables are now part of chip data. Signed-off-by: Marek Vasut Cc: Daniel Baluta Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220328194725.149150-10-marex@denx.de Signed-off-by: Jonathan Cameron commit ad202fe8edd18536198f7b98ec1893b81be490af Author: Marek Vasut Date: Mon Mar 28 21:47:24 2022 +0200 iio: adc: ti-ads1015: Replace data_rate with chip data struct ads1015_data Instead of storing only data_rate in private data, store pointer to the whole chip data and use the data_rate from chip data throughout the driver. No functional change. This is done in preparation for switching to read_avail(). Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-9-marex@denx.de Signed-off-by: Jonathan Cameron commit 0ca269a4ae3982845a7ff97b8feaaf3562ac1c8d Author: Marek Vasut Date: Mon Mar 28 21:47:23 2022 +0200 iio: adc: ti-ads1015: Convert to OF match data Replace chip type enumeration in match data with pointer to static constant structure which contains all the different chip properties in one place, and then replace handling of chip type in probe() with simple copy of fields in the new match data structure into struct iio_dev. This reduces code and increases static data. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-8-marex@denx.de Signed-off-by: Jonathan Cameron commit 3139ff24e2bc25d619ef822491651ecfb886db90 Author: Marek Vasut Date: Mon Mar 28 21:47:22 2022 +0200 iio: adc: ti-ads1015: Add static assert to test if shifted realbits fit into storagebits Add compile-time static_assert wrapper to verify that shifted realbits fit into storagebits. The macro is implemented in a more generic way so it can be used to verify other values if required. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-7-marex@denx.de Signed-off-by: Jonathan Cameron commit f1c9ce0ced2d2596bd979933ca9f57fdf8aabdfc Author: Marek Vasut Date: Mon Mar 28 21:47:21 2022 +0200 iio: adc: ti-ads1015: Add TLA2024 support Add support for TI TLA2024 ADC. This chip is compatible with ADS1015 except it has no comparator in it, hence the comparator configuration bits are missing in Configuration Register and the Hi_Thresh/Lo_Thresh registers are missing as well and so is event support. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-6-marex@denx.de Signed-off-by: Jonathan Cameron commit 6a954b9624ba5f494168370d3b6c7d8307077d5e Author: Marek Vasut Date: Mon Mar 28 21:47:20 2022 +0200 iio: adc: ti-ads1015: Make channel event_spec optional Pass event_spec and num_event_specs to ADS1015_V_CHAN and ADS1015_V_DIFF_CHAN macros, to make it possible to pass no event_spec at all for chips which have no comparator and thus no events. No functional change. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-5-marex@denx.de Signed-off-by: Jonathan Cameron commit fba6ca2a27d32835776f9056febc1a5e3c95f696 Author: Marek Vasut Date: Mon Mar 28 21:47:19 2022 +0200 iio: adc: ti-ads1015: Deduplicate channel macros These macros differ only in the number of valid bits of each ADC sample and the shift of those bits, i.e. ADS1015 is 12bit ADC shifted by 4 left, ADS1115 is 16bit ADC shifted by 0. No functional change. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-4-marex@denx.de Signed-off-by: Jonathan Cameron commit c86334652ac66f3e21c04dffbba766c57ff1f050 Author: Marek Vasut Date: Mon Mar 28 21:47:18 2022 +0200 iio: adc: ti-ads1015: Switch to static const writeable ranges table Switch the driver from code implementing test whether a regmap register is writeable to static const tables describing the test. No functional change. Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Link: https://lore.kernel.org/r/20220328194725.149150-3-marex@denx.de Signed-off-by: Jonathan Cameron commit 94d9f3cb97f4a2c88d9040504cfcef114adb0741 Author: Marek Vasut Date: Mon Mar 28 21:47:17 2022 +0200 dt-bindings: iio: adc: ti,ads1015: Add TLA2024 compatible string Add ti,tla2024 compatible string. This device is compatible with ADS1015 except it has no on-chip comparator. Acked-by: Krzysztof Kozlowski Signed-off-by: Marek Vasut Reviewed-by: Andy Shevchenko Cc: Daniel Baluta Cc: Rob Herring Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20220328194725.149150-2-marex@denx.de Signed-off-by: Jonathan Cameron commit 210b9ddbcdbcb91d1ed45848863c7d4c68298278 Author: Marek Vasut Date: Mon Mar 28 21:47:16 2022 +0200 dt-bindings: iio: adc: ti,ads1015: Add missing ADS1115 compatible string Add missing ti,ads1115 compatible string. This compatible string is supported by the Linux kernel driver and the ads1015 is a 12bit ADC while ads1115 is 16bit ADC. Add the missing compatible string. Acked-by: Krzysztof Kozlowski Signed-off-by: Marek Vasut Cc: Daniel Baluta Cc: Rob Herring Cc: devicetree@vger.kernel.org Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220328194725.149150-1-marex@denx.de Signed-off-by: Jonathan Cameron commit fd542c5eda7b494627833f81e05399587f2dceed Author: Marek Vasut Date: Mon Mar 28 21:53:07 2022 +0200 iio: core: Print error and fail iio_device_register() in case sample bits do not fit storage bits Add runtime check to verify whether storagebits are at least as big as shifted realbits. This should help spot broken drivers which may set realbits + shift above storagebits. Signed-off-by: Marek Vasut Cc: Daniel Baluta Reviewed-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220328195307.154422-1-marex@denx.de Signed-off-by: Jonathan Cameron commit 94059c522707d3d75b1b7c045143bb30b9c385af Author: Paul Lemmermann Date: Mon Mar 28 16:23:03 2022 -0500 iio: accel: kxsd9-spi: changed leading spaces to tabs Changed the leading spaces to tabs, in accordance with kernel coding conventions, and removed trailing comma. Found with checkpatch. Signed-off-by: Paul Lemmermann Link: https://lore.kernel.org/r/YkInN6SL7pP2f5Sf@hp-amd-paul Signed-off-by: Jonathan Cameron commit b22c8925a63f6b9a8a1654eb00376248ea728a98 Author: Paul Lemmermann Date: Mon Mar 28 16:48:16 2022 -0500 iio: accel: dmard09: fixed code styling issues Cleaning up code. Found with checkpatch. Signed-off-by: Paul Lemmermann Link: https://lore.kernel.org/r/YkItIE5sp3P4sZdY@hp-amd-paul Signed-off-by: Jonathan Cameron commit d958095b4a97715a6b010f55f9c5f029e3e7a527 Author: Jakob Koschel Date: Fri Apr 1 01:06:32 2022 +0200 iio: sysfs-trigger: 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 Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220331230632.957634-3-jakobkoschel@gmail.com Signed-off-by: Jonathan Cameron commit a25d525c685021ab1a9c14fb59c25712b048ef2b Author: Jakob Koschel Date: Fri Apr 1 01:06:31 2022 +0200 iio: ssp_sensors: 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 Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220331230632.957634-2-jakobkoschel@gmail.com Signed-off-by: Jonathan Cameron commit c22e60c315c80ffeb33c7225cbeea33acf0a0f4b Author: Jakob Koschel Date: Fri Apr 1 01:06:30 2022 +0200 iio: buffer: remove usage of list iterator variable for list_for_each_entry_continue_reverse() In preparation to limit the scope of the list iterator variable to the list traversal loop, use a dedicated pointer to iterate through the list [1]. Since that variable should not be used past the loop iteration, a separate variable is used to 'remember the current location within the loop'. To either continue iterating from that position or start a new iteration (if the previous iteration was complete) list_prepare_entry() is used. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220331230632.957634-1-jakobkoschel@gmail.com Signed-off-by: Jonathan Cameron commit a8e1f0ba138e0c7c51cdf268b2edef758581a31e Author: H. Nikolaus Schaller Date: Tue Mar 8 13:53:03 2022 +0100 iio: palmas: shut up warning about calibration mismatch (due to noise) Although technically checking for ADC values below 0 is correct, because they are outside of the calibration values, there is usually noise which spuriously fills the console log with error messages if calculated input voltage gets close to 0V. Ignore small negative calculated values, but clamp them to 0. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/1cee45bfc3fa2ab59dcc17242fb52468035360a1.1646743982.git.hns@goldelico.com Signed-off-by: Jonathan Cameron commit 44b0be6eb3736501f11f9c630910169c35431f6e Author: Alexandru Tachici Date: Tue Mar 22 12:50:29 2022 +0200 iio: adc: ad7192: add sequencer support Add sequencer support for AD7192. Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220322105029.86389-7-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit 5cfe8a1c2577ab24b38127f01c3bfa9dafd859da Author: Alexandru Tachici Date: Tue Mar 22 12:50:28 2022 +0200 iio: adc: ad7124: add sequencer support Add sequencer support for AD7124. Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220322105029.86389-6-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit 8bea9af887de4c99a95f93f2ce400ef63e8b4e9b Author: Lars-Peter Clausen Date: Tue Mar 22 12:50:27 2022 +0200 iio: adc: ad_sigma_delta: Add sequencer support Some sigma-delta chips support sampling of multiple channels in continuous mode. When the operating with more than one channel enabled, the channel sequencer cycles through the enabled channels in sequential order, from first channel to the last one. If a channel is disabled, it is skipped by the sequencer. If more than one channel is used in continuous mode, instruct the device to append the status to the SPI transfer (1 extra byte) every time we receive a sample. All sigma-delta chips possessing a sampling sequencer have this ability. Inside the status register there will be the number of the converted channel. In this way, even if the CPU won't keep up with the sampling rate, it won't send to userspace wrong channel samples. When multiple channels are enabled in continuous mode, the device needs to perform a measurement on all slots before we can push to userspace the sample. If, during sequencing and data reading, a channel measurement is lost, a desync occurred. In this case, ad_sigma_delta drops the incomplete sample and waits for the device to send the measurement on the first active slot. Co-developed-by: Alexandru Tachici Signed-off-by: Alexandru Tachici Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20220322105029.86389-5-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit fe7d929a63c3a0b7908ae5d7b9fdf456acd66a43 Author: Alexandru Tachici Date: Tue Mar 22 12:50:26 2022 +0200 iio: adc: ad7192: Add update_scan_mode The callback .set_channel cannot be used to enable multiple channels at once, only one is allowed simultaneously. By adding an update_scan_mode callback, every time the continuous mode is activated, channels will be enabled/disabled accordingly. Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220322105029.86389-4-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit fd5ba89e4cd4fa501ab277c32a623218e11129f4 Author: Alexandru Tachici Date: Tue Mar 22 12:50:25 2022 +0200 iio: adc: ad7124: Add update_scan_mode The callback .set_channel cannot be used to enable and disable multiple channels at once as they are presented in the active_scan_mask. By adding an update_scan_mode callback, every time the continuous mode is activated, channels will be enabled/disabled accordingly. Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220322105029.86389-3-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit fe78ccf79b0e29fd6d8dc2e2c3b0dbeda4ce3ad8 Author: Alexandru Tachici Date: Tue Mar 22 12:50:24 2022 +0200 iio: adc: ad7124: Remove shift from scan_type The 24 bits data is stored in 32 bits in BE. There is no need to shift it. This confuses user-space apps. Fixes: b3af341bbd966 ("iio: adc: Add ad7124 support") Signed-off-by: Alexandru Tachici Link: https://lore.kernel.org/r/20220322105029.86389-2-alexandru.tachici@analog.com Signed-off-by: Jonathan Cameron commit 6dc2c8711abcf87bb10039e99a0efb6f8b3a2cf9 Author: Michael Srba Date: Wed Mar 23 13:15:50 2022 +0100 iio: imu: inv_mpu6050: Add support for ICM-20608-D The difference between the ICM-20608-D and the other ICM-20608 variants is the addition of a DMP (Digital Motion Processor) core. This difference is deemed substantial enough to change the WHOAMI register value. Since this driver doesn't currently acknowledge the exisence of something like a DMP core, simply copy ICM-20608 except for the aforementioned WHOAMI register. Signed-off-by: Michael Srba Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20220323121550.16096-3-michael.srba@seznam.cz Signed-off-by: Jonathan Cameron commit c4dbfed37fef7e86a82cd28c97ca7d25b2516e37 Author: Michael Srba Date: Wed Mar 23 13:15:49 2022 +0100 dt-bindings: iio: imu: mpu6050: Document invensense,icm20608d ICM-20608-D differs from the other ICM-20608 variants by having a DMP (Digital Motion Processor) core tacked on. Despite having a different WHOAMI register, this variant is completely interchangeable with the other ICM-20608 variants by simply pretending the DMP core doesn't exist. Signed-off-by: Michael Srba Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220323121550.16096-2-michael.srba@seznam.cz Signed-off-by: Jonathan Cameron commit 0cddfc92e29bbb77a33bd465de6dcf2c66407682 Author: Lorenzo Bianconi Date: Thu Mar 24 12:05:43 2022 +0100 MAINTAINERS: updated Lorenzo's email address Using my kernel.org email for iio devices. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c75f0e1c683b6ad0333d5504fb00c6f1b14dd1bf.1648114531.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit bc4c94994ffe581bf7d2fbc3bd0974b6d9b0d746 Author: Andy Shevchenko Date: Mon Mar 7 22:36:06 2022 +0200 iio: temperature: ltc2983: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. The conversion slightly changes the logic behind property reading for the configuration values. Original code allocates just as much memory as needed. Then for each separate 32- or 64-bit value it reads it from the property and converts to a raw one which will be fed to the sensor. In the new code we allocate the amount of memory needed to retrieve all values at once from the property and then convert them as required. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Tested-by: Nuno Sá Link: https://lore.kernel.org/r/20220307203606.87258-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit e59b18a28909af502f41f2201109a1a1ac2d486c Author: Andy Shevchenko Date: Mon Mar 7 22:36:05 2022 +0200 iio: temperature: ltc2983: Use single error path to put OF node There are several, possibly copied'n'pasted, places in the functions, where OF node is put and error returned directly, while the common exit point exists. Unify all these cases to use a single error path. Suggested-by: Jonathan Cameron Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220307203606.87258-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 8868a172f471f903bf1d440435d21c8f5bc44649 Author: Andy Shevchenko Date: Mon Mar 7 22:36:04 2022 +0200 iio: temperature: ltc2983: Don't hard code defined constants in messages In a couple of messages the constants, which have their definitions, are hard coded into the message text. Unhardcode them. While at it, add a trailing \n where it's currently missing. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220307203606.87258-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit ba93642188a6fed754bf7447f638bc410e05a929 Author: Xiaoke Wang Date: Sat Mar 5 11:14:05 2022 +0800 iio: dummy: iio_simple_dummy: check the return value of kstrdup() kstrdup() is also a memory allocation-related function, it returns NULL when some memory errors happen. So it is better to check the return value of it so to catch the memory error in time. Besides, there should have a kfree() to clear up the allocation if we get a failure later in this function to prevent memory leak. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_C920CFCC33B9CC1C63141FE1334A39FF8508@qq.com Signed-off-by: Jonathan Cameron commit 879a52379704e479237d0b97822fd9302fed0675 Author: Andy Shevchenko Date: Wed Mar 2 18:00:25 2022 +0200 iio: multiplexer: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Acked-by: Peter Rosin Link: https://lore.kernel.org/r/20220302160025.54348-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit fee4ac32996d5fce8713aa3ad591a135f9545b96 Author: Andy Shevchenko Date: Wed Mar 2 17:31:42 2022 +0200 iio: dac: ltc2688: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220302153142.52743-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 8a7449d68670a8f9033d57b9e7997af77a900d53 Author: Sicelo A. Mhlongo Date: Mon Mar 7 15:25:02 2022 +0200 iio: accel: add support for LIS302DL variant Add support for STMicroelectronics LIS302DL accelerometer to the st_accel framework. Datasheet: https://www.st.com/resource/en/datasheet/lis302dl.pdf Reviewed-by: Linus Walleij Signed-off-by: Sicelo A. Mhlongo Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220307132502.73854-4-absicsz@gmail.com Signed-off-by: Jonathan Cameron commit a85257f0df58e71830bf833fdd3dc4de30b79f5d Author: Sicelo A. Mhlongo Date: Mon Mar 7 15:25:01 2022 +0200 iio: accel: Remove unused enum in st_accel The st_accel_type enum is not used anywhere else in the code, and can be removed Suggested-by: Jonathan Cameron Signed-off-by: Sicelo A. Mhlongo Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220307132502.73854-3-absicsz@gmail.com Signed-off-by: Jonathan Cameron commit ce92d6743fd55331b2466e0b4e6fa004f2cc6cad Author: Sicelo A. Mhlongo Date: Mon Mar 7 15:25:00 2022 +0200 dt-bindings: iio: st,st-sensors add LIS302DL Update st,st-sensors bindings for STMicroelectronics LIS302DL variant Reviewed-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Sicelo A. Mhlongo Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220307132502.73854-2-absicsz@gmail.com Signed-off-by: Jonathan Cameron commit f4decb4c6e374a4ded59a6a76b8236695e44d8bc Author: Alexander Vorwerk Date: Sat Mar 12 19:03:43 2022 +0100 iio: core: fix a few code style issues * Fix indent in else statement * Remove unnecessary 'else' after 'break' * Remove space in '* attr' Signed-off-by: Alexander Vorwerk Link: https://lore.kernel.org/r/20220312180343.8935-1-alexander.vorwerk@stud.uni-goettingen.de Signed-off-by: Jonathan Cameron commit 085f7a298a14ed2a088c8ba01d2feda2499cbc72 Author: Shunzhou Jiang Date: Fri Apr 1 19:03:06 2022 +0800 arm64: dts: add support for S4 power domain controller Enable power domain controller for Meson s4 SoC Signed-off-by: Shunzhou Jiang Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220401110306.3364551-1-shunzhou.jiang@amlogic.com commit 393633936976fb8bd2c26ae76fa8d30822bb7fee Author: Qianggui Song Date: Thu Mar 10 17:26:45 2022 +0800 arm64: dts: meson-s4: add gpio_intc node Add gpio interrupt controller node Signed-off-by: Qianggui Song Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220310092645.4303-1-qianggui.song@amlogic.com commit 6383f5a212a6b569ff15bc98ba8b3041a35db6ee Author: Qianggui Song Date: Thu Mar 10 11:04:10 2022 +0800 arm64: dts: meson-s4: add pinctrl node Add pinctrl node for mesonn-s4 Signed-off-by: Qianggui Song Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220310030410.718-1-qianggui.song@amlogic.com commit a070d3b857d4961e1202754f7a86a0f796f808cd Author: Robin Murphy Date: Tue Mar 15 22:08:10 2022 +0000 arm64: dts: rockchip: Add some pins for NanoPi4 The NanoPi4 boards have the RK808's always-on 32KHz clock wired to the SoC, so have it claim the relevant pinctrl to actually enable the CLK32K_IN input. The RK808's SLEEP pin is also wired to the SoC's AP_PWROFF output, so we may as well claim that too. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e870284a872567f163868b77267c01b77ed6f22a.1647381986.git.robin.murphy@arm.com Signed-off-by: Heiko Stuebner commit 16c0f95d9ed14f033b5f1bd37e96d257b60c198c Author: Frank Wunderlich Date: Fri Mar 11 22:03:57 2022 +0100 arm64: dts: rockchip: Add sata nodes to rk356x RK356x supports up to 3 sata controllers which were compatible with the existing snps,dwc-ahci binding. Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220311210357.222830-7-linux@fw-web.de Signed-off-by: Heiko Stuebner commit 4246d0bab2a8685e3d4aec2cb0ef8c526689ce96 Author: Shawn Lin Date: Tue Mar 15 17:27:06 2022 +0800 arm64: dts: rockchip: Move drive-impedance-ohm to emmc phy on rk3399 drive-impedance-ohm is introduced for emmc phy instead of pcie phy. Fixes: fb8b7460c995 ("arm64: dts: rockchip: Define drive-impedance-ohm for RK3399's emmc-phy.") Signed-off-by: Shawn Lin Link: https://lore.kernel.org/r/1647336426-154797-1-git-send-email-shawn.lin@rock-chips.com Signed-off-by: Heiko Stuebner commit 87a87657249316616138c103c2bdb7525c34d987 Author: Vyacheslav Bocharov Date: Sat Mar 26 10:51:10 2022 +0300 arm64: meson: update WiFi SDIO in dts for JetHub D1 Fix the dts to match board's reference design: - update the maximum SDIO frequency to match 3.3v regulator (Wi-Fi SDIO module) Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220326075110.1462301-5-adeep@lexina.in commit 81bbd2bd24a9ebac3871b293060df50445458c79 Author: Vyacheslav Bocharov Date: Sat Mar 26 10:51:09 2022 +0300 arm64: meson: update SDIO voltage in dts for JetHub D1 Fix the dts to match board's reference design: - update vddio_boot regulator to 3.3v (Wi-Fi SDIO module) - add vccq_1v8 regulator with 1.8v for eMMC SDIO In the first revision of JetHub D1 the vccq_1v8 regulator was 3.3v. All installed eMMC modules were tested to work in HS200 mode at 3.3v supply voltage. In the next revisions of the board eMMC will be powered with 1.8v according to the standard. Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220326075110.1462301-4-adeep@lexina.in commit cf94e26508ad411c2a618b00dfaae515affd0ca7 Author: Vyacheslav Bocharov Date: Sat Mar 26 10:51:08 2022 +0300 arm64: meson: dts: update serial alias in dts for JetHub D1 Change zigbee serial port alias to ttyAML2 for backward compatibility. Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220326075110.1462301-3-adeep@lexina.in commit 2bda08dfc501967a7a7bd6f77f04afef14dc7271 Author: Vyacheslav Bocharov Date: Sat Mar 26 10:51:07 2022 +0300 arm64: meson: add dts bluetooth node for JetHub H1 Add bluetooth node for RTL8822CS uart to JetHub H1 dts file. Signed-off-by: Vyacheslav Bocharov Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220326075110.1462301-2-adeep@lexina.in commit 146c9a346fdd0506228cace62cf324e4c1e3705a Author: Johan Jonker Date: Thu Mar 31 14:56:44 2022 +0200 ARM: dts: rockchip: use generic node name for dma rk3036/rk322x The node names should be generic, so fix this for the rk3036 and rk322x dma node and rename it to "dma-controller". Signed-off-by: Johan Jonker Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220331125644.6841-1-jbx6244@gmail.com Signed-off-by: Heiko Stuebner commit 7e5a7e39d767b60d8631792bd3d7820a6f4a43f8 Author: Krzysztof Kozlowski Date: Thu Sep 17 20:52:10 2020 +0200 ARM: dts: rockchip: correct interrupt flags on rk3188 boards 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: 1. GPIO_ACTIVE_HIGH = 0 = IRQ_TYPE_NONE 2. GPIO_ACTIVE_LOW = 1 = IRQ_TYPE_EDGE_RISING Correct the interrupt flags without affecting the code: ACTIVE_HIGH => IRQ_TYPE_NONE Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200917185211.5483-1-krzk@kernel.org Signed-off-by: Heiko Stuebner commit 261f06315cf7c3744731e36bfd8d4434949e3389 Author: Mark Brown Date: Fri Mar 25 14:46:37 2022 +0000 regulator: Flag uncontrollable regulators as always_on While we currently assume that regulators with no control available are just uncontionally enabled this isn't always as clearly displayed to users as is desirable, for example the code for disabling unused regulators will log that it is about to disable them. Clean this up a bit by setting always_on during constraint evaluation if we have no available mechanism for controlling the regualtor so things that check the constraint will do the right thing. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220325144637.1543496-1-broonie@kernel.org Signed-off-by: Mark Brown commit a4765dfb80a7333aaac394a5ba20056d11b55636 Author: Leilk Liu Date: Mon Mar 21 09:39:21 2022 +0800 spi: support hclk this patch support hclk for AHB bus. Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220321013922.24067-3-leilk.liu@mediatek.com Signed-off-by: Mark Brown commit a740f4e684c020ea57a8a198a9322d739f7ab6d5 Author: Leilk Liu Date: Mon Mar 21 09:39:22 2022 +0800 spi: mediatek: support hclk this patch adds hclk support. Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220321013922.24067-4-leilk.liu@mediatek.com Signed-off-by: Mark Brown commit 9f763fd20da7d892ffaedac0c58d821922f8a674 Author: Leilk Liu Date: Mon Mar 21 09:39:20 2022 +0800 spi: mediatek: add spi memory support for ipm design this patch add the support of spi-mem for ipm design. Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220321013922.24067-2-leilk.liu@mediatek.com Signed-off-by: Mark Brown commit 6c315afe65d05dc6eebf2d6b73a191990aada218 Author: Mark Brown Date: Thu Mar 24 20:18:54 2022 +0000 regulator: fixed: Remove print on allocation failure OOMs are very verbose, we don't need to print an additional error message when we fail to allocate. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220324201854.3107077-1-broonie@kernel.org Signed-off-by: Mark Brown commit 41812783057c01e4e5f1eec649607e4773124dba Author: Krzysztof Kozlowski Date: Fri Apr 1 17:37:11 2022 +0200 regulator: dt-bindings: richtek,rt4801: minor comments adjustments Correct grammar in 'enable-gpios' description and remove useless comment about regulator nodes, because these are obvious from patternProperties. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220401153711.1057853-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 2a826d9c4251e4a64aa79113aac8cedf7cd0ff57 Author: ChiYuan Huang Date: Sat Mar 26 19:39:47 2022 +0800 regulator: Add binding for Richtek RT5759 DCDC converter Add bindings for Richtek RT5759 high-performance DCDC converter. Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1648294788-11758-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 7b36ddb208bd1744f4769f11e530bc08c3701964 Author: ChiYuan Huang Date: Sat Mar 26 19:39:48 2022 +0800 regulator: rt5759: Add support for Richtek RT5759 DCDC converter Add support for Richtek RT5759 high-performance DCDC converter. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1648294788-11758-3-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown commit 417dfad7e4f0501853e05a46742a4e47075f034c Author: Johnson Wang Date: Thu Mar 17 11:04:02 2022 +0800 regulator: Add BUCK and LDO document for MT6358 and MT6366 Add buck_vcore_sshub and ldo_vsram_others_sshub regulators to binding document for MT6358 and MT6366. Reviewed-by: Rob Herring Reviewed-by: Mark Brown Signed-off-by: Johnson Wang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220317030402.24894-3-johnson.wang@mediatek.com Signed-off-by: Mark Brown commit d077002c9d07dc6f64d07a362202a1e1081b2f6c Author: Johnson Wang Date: Thu Mar 17 11:04:01 2022 +0800 regulator: mt6366: Add support for MT6366 regulator The MT6366 is a regulator found on boards based on MediaTek MT8186 and probably other SoCs. It is a so called pmic and connects as a slave to SoC using SPI, wrapped inside the pmic-wrapper. Reviewed-by: Mark Brown Signed-off-by: Johnson Wang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220317030402.24894-2-johnson.wang@mediatek.com Signed-off-by: Mark Brown commit bd941dfaae3503c6b707d8544696205f759e57a3 Author: Rikard Falkeborn Date: Wed Mar 30 23:41:10 2022 +0200 regmap: Constify static regmap_bus structs The only usage of these is to pass their address to __regmap_init() or __devm_regmap_init(), both which takes pointers to const struct regmap_bus. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20220330214110.36337-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit cae34da5323b6ce4d0dc365d1b971f838dcff318 Author: Trevor Wu Date: Thu Mar 24 13:38:51 2022 +0800 ASoC: dt-bindings: mediatek: mt8195: support mt8195-mt6359-max98390-rt5682 This patch adds compatible string "mediatek,mt8195-mt6359-max98390-rt5682" to support mt8195 board with mt6359, max98390 and rt5682. Signed-off-by: Trevor Wu Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220324053851.27350-7-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 86a6b9c9dffff1bd653d582cfc5138da75e5f7b0 Author: Trevor Wu Date: Thu Mar 24 13:38:50 2022 +0800 ASoC: mediatek: mt8195: add machine support for max98390 and rt5682 This patch adds support for mt8195 board with mt6359, max98390 and rt5682. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220324053851.27350-6-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 3a0323c26c6720447fd5eff6495c1aea514b77d5 Author: Trevor Wu Date: Thu Mar 24 13:38:49 2022 +0800 ASoC: mediatek: mt8195: rename card controls In order to be able to reuse the same configurations in user space, rename the controls to generic names. "Headphone Jack" -> "Headphone" "Speakers" -> "Ext Spk" "Left Speaker" -> "Left Spk" "Right Speaker" -> "Right SPk" Signed-off-by: Trevor Wu Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220324053851.27350-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit dc16399078aea4c98f17aa99f0cdea9d5ac9c4a9 Author: Trevor Wu Date: Thu Mar 24 13:38:48 2022 +0800 ASoC: dt-bindings: mediatek: mt8195: merge mt8195 machine yaml Because the same binding components can be shared by all codecs combinations, we only reserve one binding file for mt8195 machine driver and rename to a generic name. We use compatible string to separate different codec combination instead of creating a new binding file for new codec combination. Signed-off-by: Trevor Wu Reviewed-by: Miles Chen Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220324053851.27350-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 094e30efa444a118a535cb67ec000bbee9f8d150 Author: Trevor Wu Date: Thu Mar 24 13:38:47 2022 +0800 ASoC: mediatek: mt8195: merge machine driver Because most functions can be reused in different codec combinations, mt8195 machine drivers are combined to one common file. The model and compatible string are used to decide which codecs are being used. As a result, We can prevent from copy-paste functions when new codec combination is introduced. Signed-off-by: Trevor Wu Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220324053851.27350-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 4dbc714fe07641e7a07731f82152448ef09f3002 Author: Trevor Wu Date: Thu Mar 24 13:38:46 2022 +0800 ASoC: mediatek: mt8195: revise mt8195-mt6359-rt1019-rt5682.c Revise driver for the coming driver combination. There are two major parts including in the patch. 1. Apply some suggested changes used in mt8195-mt6359-rt1011-rt5682.c. 2. Reorder the layout for centralizing the codec related code. Signed-off-by: Trevor Wu Reviewed-by: Tzung-Bi Shih Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220324053851.27350-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 64a1a4e04e4450a89940adc8f339a85e2c01d905 Author: Mark Brown Date: Fri Mar 25 15:31:21 2022 +0000 ARM: configs: Update multi_v5_defconfig for WM8731 bus refactoring The WM8731 driver has been refactored so the I2C and SPI bus code is separate modules. Refresh multi_v5_defconfig to reflect this. Signed-off-by: Mark Brown Cc: soc@kernel.org Acked-by: Arnd Bergmann Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-8-broonie@kernel.org Signed-off-by: Mark Brown commit 0e336eeaf467cdd86d827d696e24081b638ef61c Author: Mark Brown Date: Fri Mar 25 15:31:20 2022 +0000 ASoC: wm8731: Convert DT bindings to YAML format Convert the WM8731 DT bindings to YAML format, including addition of documentation for the regulator and clock bindings which the driver has had for some time but which were not covered in the bindings document. Signed-off-by: Mark Brown Cc: Rob Herring Cc: devicetree@vger.kernel.org Acked-by: Charles Keepax Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220325153121.1598494-7-broonie@kernel.org Signed-off-by: Mark Brown commit 9dc15f81baf273b5aaaa3302ee8faacd78f361fd Author: Mark Brown Date: Fri Mar 25 15:31:19 2022 +0000 ASoC: wm8731: Factor out the I2C and SPI bus code into separate modules Placing both the I2C and SPI code in the same module causes problems with mixes of modular and non-modular builds of the buses so it's generally bad practice. As with other drivers split the bus code out of the WM8731 driver into separate modules. Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-6-broonie@kernel.org Signed-off-by: Mark Brown commit 8875d104af6c237bfedb47309afd938984a3c05b Author: Mark Brown Date: Fri Mar 25 15:31:18 2022 +0000 ASoC: wm8731: Factor our MCLK and mutex initialisation The code for initialising the MCLK and mutex is identical in the I2C and SPI probe functions so just move this out into wm8731_init(). Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-5-broonie@kernel.org Signed-off-by: Mark Brown commit 5f1b9d1e424b91a8ae04211cbe4d354463c83583 Author: Mark Brown Date: Fri Mar 25 15:31:17 2022 +0000 ASoC: wm8731: Move regulator request into wm8731_init() The supplies used by the wm8731 do not depend on the bus and there is no need to do anything with the supplies prior to instantiating the regmap so move the request into wm8731_init(). Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-4-broonie@kernel.org Signed-off-by: Mark Brown commit 3f4fb905510911f6149593a7321ae1825259b242 Author: Mark Brown Date: Fri Mar 25 15:31:16 2022 +0000 ASoC: wm8731: Factor component init out of bus code Both the I2C and SPI bus code register the component immediately after they call wm8731_hw_init(), factor the code out into the the common function and rename it to just be plain wm8731_init() while we're at it since it's not just for hardware init any more. This refactoring means we need to move the function after the declaration of the component driver. Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-3-broonie@kernel.org Signed-off-by: Mark Brown commit 00b87e18f3c0a98e2e22a95eb205c2ae03862a23 Author: Mark Brown Date: Fri Mar 25 15:31:15 2022 +0000 ASoC: wm8731: Update to modern DAI terminology As part of retiring the old defines used to specify DAI formats update the wm8731 driver to use the modern names. Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220325153121.1598494-2-broonie@kernel.org Signed-off-by: Mark Brown commit 430791dd9207271099002b65aa65fd5e6aa31236 Author: Amadeusz Sławiński Date: Fri Apr 1 14:02:00 2022 +0200 ASoC: topology: Rename soc_tplg_init_kcontrol() function Other functions used for callbacks are named after function they call, however function calling control_load seems to be an exception. Rename it to soc_tplg_control_load(). Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 34b310451cbf4dedcee56b4534085c20203c6b53 Author: Amadeusz Sławiński Date: Fri Apr 1 14:01:59 2022 +0200 ASoC: topology: Correct error message Error message refers to mixer, but it is used for various other types of controls, so change it to refer to generic "controls". Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 5e2cd47a36b386080e7a29c1efbb0247ed6ed365 Author: Amadeusz Sławiński Date: Fri Apr 1 14:01:58 2022 +0200 ASoC: topology: Rename SOC_TPLG_PASS_MIXER to _CONTROL Name of SOC_TPLG_PASS_MIXER pass is bit confusing, suggesting that it may only apply to mixers. As it is used for all control types, change name to SOC_TPLG_PASS_CONTROL. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 4fad3cc6eb962a6fe32ab9fb9d30b08a88298f63 Author: Amadeusz Sławiński Date: Fri Apr 1 14:01:57 2022 +0200 ASoC: topology: Return bool instead of int In practice soc_tplg_is_eof() returns boolean value and caller uses the return value in such way, so convert the function to really do it. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 0db627c4f5df704d44699ed27dd81caa6d782a17 Author: Amadeusz Sławiński Date: Fri Apr 1 14:01:56 2022 +0200 ASoC: topology: Remove unnecessary looping Functions creating kcontrols as written allow for creation of multiple kcontrols at the same time, but in practice they are called for each kcontrol individually. Remove unnecessary loop as code always loops once anyway. This reduces intendation level allowing for some code to be put on one line instead of multiple lines. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 395f8fd616086310c40ddc4e9686440f147d5c00 Author: Amadeusz Sławiński Date: Fri Apr 1 14:01:55 2022 +0200 ASoC: topology: Use for loop instead of while The 'while' loop can be replaced with a 'for' loop, making it more clear about what possible values there are, by having all of it in one place, instead of scattered around. Signed-off-by: Amadeusz Sławiński Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220401120200.4047867-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 76821c139d7e0429845e7c0798747e7eec16ec83 Author: Sameer Pujar Date: Thu Mar 31 19:33:29 2022 +0530 ASoC: tegra: AHUB routes for ASRC module Add AHUB routes for ASRC module. The ASRC module can be plugged into audio path as per the need. The routing controls can be used to setup the audio path with ASRC similar to the already existing routes. The routes are added to Tegra186 and later Tegra SoCs where ASRC module is present. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1648735412-32220-4-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit a2df8c2d5b36fc66b9a6e674f3e0c87c0b9d0a48 Author: Sameer Pujar Date: Thu Mar 31 19:33:28 2022 +0530 ASoC: tegra: Add Tegra186 based ASRC driver Asynchronous Sample Rate Converter (ASRC) converts the sampling frequency of the input signal from one frequency to another. It can handle over a wide range of sample rate ratios (freq_in/freq_out) from 1:24 to 24:1. ASRC has two modes of operation. One where ratio can be programmed in SW and the other where it gets the information from ratio estimator module. The latter mode above can help address the cases where the sample rate is not known at the stream set up time or is potentially time varying. In addition, the ratio between input and output sample rate can be any arbitrary number and the input and output clocks could be derived from asynchronous clocks. This patch registers ASRC driver with ASoC framework. The component driver exposes DAPM widgets, routes and kcontrols for the device. The DAI driver exposes ASRC interfaces, which can be used to connect different components in the ASoC layer. Makefile and Kconfig support is added to allow build the driver. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1648735412-32220-3-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit c54ce1a17232215c4a518149292b41835992eee8 Author: Sameer Pujar Date: Thu Mar 31 19:33:27 2022 +0530 ASoC: tegra: Add binding doc for ASRC module This patch adds YAML schema for DT bindings of Asynchronous Sample Rate Converter (ASRC) module. It will be registered as an ASoC component and can be plugged into an audio path as per need via ALSA mixer controls. The bindings are applicable on Tegra186 and later where the ASRC device is present. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1648735412-32220-2-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit 9e116f5a6e95e59145f90a82ad37ee0e53f686a9 Author: tangmeng Date: Wed Mar 30 13:19:26 2022 -0700 ASoC: SOF: Remove redundant return statements After the free PCM action is executed, no matter what the return result is, it will return directly in sof_pcm_trigger. So the return statement here is redundant. Signed-off-by: tangmeng Reviewed-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 30b50b9734ddf08b0bb7321f47f4b849cba54875 Author: Peter Ujfalusi Date: Wed Mar 30 13:19:25 2022 -0700 ASoC: SOF: Remove header from struct snd_sof_ipc_msg The header field is no longer used by the underlying code and can be dropped from the snd_sof_ipc_msg struct. Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 2a51c0f81adda8cc32b02e8ca7b7d9d13ad4376a Author: Peter Ujfalusi Date: Wed Mar 30 13:19:24 2022 -0700 ASoC: SOF: Drop 'header' parameter from tx_message() API The header parameter is not used anymore and now it can be dropped from the parameter list of tx_message(). Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 5db8eb5b9e35c712cc63fcebf04c80ace9812961 Author: Peter Ujfalusi Date: Wed Mar 30 13:19:23 2022 -0700 ASoC: SOF: ipc: Use msg->reply_data directly in snd_sof_ipc_get_reply() Instead of using a local reply to first read out the header from the mailbox then memcpy it or read it again to msg->reply_data, read it directly to it's final place from the start. If we received an error we do not need to do a memcpy anymore. If the reply is reporting a success then we don not need to read the reply again from the mailbox if the reply_size equals to the already read header size. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 249ee180874dd48a809caf70981b2aa800329d27 Author: Libin Yang Date: Wed Mar 30 13:19:22 2022 -0700 ASoC: SOF: disable dma trace in s0ix When system enters s0ix, the dma trace won't be used. Otherwise, the DMA will access the host memory, which will prevent entering S0ix. Driver has notified firmware not to send message through dma trace. Let's also trigger stop dma trace in driver side. Signed-off-by: Libin Yang Reviewed-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 758f24d49bff2707812fb8dfac53930603e26312 Author: Libin Yang Date: Wed Mar 30 13:19:21 2022 -0700 ASoC: SOF: extend the interface to stop DMA trace Change the interface to stop the DMA trace for suspend. Replace the snd_sof_init_trace_ipc() and snd_sof_release_trace() calls with more explicit interface for PM (the sole user for this interface). The new snd_sof_trace_suspend() call takes the target PM state as argument, allowing the trace implementation to decide how to handle the transition. Use this information to release DMA resources only if DSP is suspended and will not remain in D0. Signed-off-by: Peter Ujfalusi Signed-off-by: Libin Yang Reviewed-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 7d8e9d79276492cbc66575a301d7ab8b92786699 Author: Peter Ujfalusi Date: Wed Mar 30 13:19:20 2022 -0700 ASoC: SOF: Drop support for mapped control data Access through mmapped memory is not supported and it is explicitly disabled with scontrol->readback_offset = 0; when a control is created. Remove the dead code and the confusion around this feature. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 78935913573b7c0397b5e3d4512ee0f67b280d3b Author: Peter Ujfalusi Date: Wed Mar 30 13:19:19 2022 -0700 ASoC: SOF: ipc: Use ipc->max_payload_size for message/reply size checking Use the ipc->max_payload_size for validating that the message or reply size can be supported. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit a3e6b3691b35c6312cff32127ffc01e81d6e6d41 Author: Peter Ujfalusi Date: Wed Mar 30 13:19:18 2022 -0700 ASoC: SOF: ipc: Add max_payload_size field in struct snd_sof_ipc The max_payload_size is an IPC level constraint. Add a new field, max_payload_size to struct snd_sof_ipc and set it during IPC init. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 7f0a1335d3b67745d4b51dc634c3b400c3f1d42b Author: Peter Ujfalusi Date: Wed Mar 30 13:19:17 2022 -0700 ASoC: SOF: Remove dmab and dmab_bdl from snd_sof_dev struct The dmab and dmab_bdl is not used by any platform, it can be removed from struct snd_sof_dev. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit ea5ffef079a72478d8612b4071c2986e364f82d2 Author: Peter Ujfalusi Date: Wed Mar 30 13:19:16 2022 -0700 ASoC: SOF: Intel: hda-loader: Use local snd_dma_buffer There is no reason to use the sdev->dmab and sdev->dmab_bdl as the buffers are only used locally: allocated used and freed in the same function. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220330201926.1330402-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 927d8fd465adbaaad6cce82f840d489d7c378f29 Author: Maxime Ripard Date: Mon Feb 21 10:59:17 2022 +0100 drm/imx: ipuv3-plane: Remove redundant color encoding and range initialisation The imx KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Limited Range, respectively. Since the initial value wasn't carried over in the state, the driver had to set it again in ipu_plane_state_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore. Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Fabio Estevam Cc: Pengutronix Kernel Team Cc: Philipp Zabel Cc: Sascha Hauer Cc: Shawn Guo Signed-off-by: Maxime Ripard Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220221095918.18763-22-maxime@cerno.tech commit aa72b0866a0375d3694dd929a366433b4f5ee2b5 Author: Maxime Ripard Date: Mon Feb 21 10:59:07 2022 +0100 drm/imx: ipuv3-plane: Remove redundant zpos initialisation The imx KMS driver will call drm_plane_create_zpos_property() with an init value depending on the plane purpose. Since the initial value wasn't carried over in the state, the driver had to set it again in ipu_plane_state_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore. Cc: linux-arm-kernel@lists.infradead.org Cc: NXP Linux Team Cc: Fabio Estevam Cc: Pengutronix Kernel Team Cc: Philipp Zabel Cc: Sascha Hauer Cc: Shawn Guo Signed-off-by: Maxime Ripard Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220221095918.18763-12-maxime@cerno.tech commit 090fd63d99f26eb0180f4152c7272085b6556886 Author: Colin Ian King Date: Sun Jan 23 22:34:17 2022 +0000 drm/imx: make static read-only array channel_offsets const The static array channel_offsets is read-only so it make sense to make it const. Signed-off-by: Colin Ian King Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220123223417.6244-1-colin.i.king@gmail.com commit 344c50dd4954e4592c0a17784a1b23b92796719f Author: Cai Huoqing Date: Tue Aug 31 21:55:52 2021 +0800 drm/imx: imx-tve: Make use of the helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210831135553.4426-1-caihuoqing@baidu.com Signed-off-by: Philipp Zabel commit 180a49e32be29b0d0b26dcb3ac80fbf9e3b8bd9d Author: Salah Triki Date: Tue Jul 13 15:05:21 2021 +0100 gpu: ipu-v3: image-convert: use swap() Use swap() instead of implementing it since it makes code cleaner. Signed-off-by: Salah Triki Link: https://lore.kernel.org/r/20210713140521.GA1873885@pc [p.zabel@pengutronix.de: add "image-convert:" prefix to commit description] Signed-off-by: Philipp Zabel commit 08ba32541b7a48078fe9cee5953097622f3774e9 Author: Haowen Bai Date: Wed Mar 23 12:02:03 2022 +0800 fs: ext2: Fix duplicate included linux/dax.h Clean up the following includecheck warning: fs/ext2/inode.c: linux/dax.h is included more than once. No functional change. Signed-off-by: Haowen Bai Reviewed-by: Ritesh Harjani Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/1648008123-32485-1-git-send-email-baihaowen@meizu.com commit 57c27d38ff937976afd207c1eaf1264d086d855c Author: Michael Straube Date: Sun Apr 3 12:37:13 2022 +0200 staging: r8188eu: clean up comment for rtw_pwr_wakeup() Clean up the comment for rtw_pwr_wakeup() by removing obvious information. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220403103713.12883-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 719cf66c8a2b065926f622ae65f5595739e4a7f6 Author: Michael Straube Date: Sun Apr 3 12:37:12 2022 +0200 staging: r8188eu: remove macro rtw_pwr_wakeup() After previous cleanups the rtw_pwr_wakeup() macro is just an alias for _rtw_pwr_wakeup(). Remove the macro and rename _rtw_pwr_wakeup() to rtw_pwr_wakeup(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220403103713.12883-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5f668fd1e33695ee29e2b4680052b56eab7c5f8 Author: Michael Straube Date: Sun Apr 3 12:37:11 2022 +0200 staging: r8188eu: remove constant parameter from _rtw_pwr_wakeup() The parameter 'ips_deffer_ms' of _rtw_pwr_wakeup() is always RTW_PWR_STATE_CHK_INTERVAL. Make it local. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220403103713.12883-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 81a1027030455c0c9579e47a13e35b949c7d64cd Author: Michael Straube Date: Sun Apr 3 12:37:10 2022 +0200 staging: r8188eu: remove unused parameter from _rtw_pwr_wakeup() The parameter 'caller' of _rtw_pwr_wakeup() is not used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220403103713.12883-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 67fda6c2df8223c6bd5e8daee929c9a8179190cf Author: Michael Straube Date: Sat Apr 2 11:23:32 2022 +0200 staging: r8188eu: remove HW_VAR_H2C_FW_P2P_PS_OFFLOAD from SetHwReg8188EU() The HW_VAR_H2C_FW_P2P_PS_OFFLOAD case in SetHwReg8188EU() just calls a function. Call the function directly and remove the HW_VAR_H2C_FW_P2P_PS_OFFLOAD case from SetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f234f5f7bce383dba4ad8b639c9befe5c7be05c2 Author: Michael Straube Date: Sat Apr 2 11:23:31 2022 +0200 staging: r8188eu: remove HW_VAR_H2C_FW_JOINBSSRPT from SetHwReg8188EU() The HW_VAR_H2C_FW_JOINBSSRPT case in SetHwReg8188EU() just calls a function. Call the function directly and remove the HW_VAR_H2C_FW_JOINBSSRPT case from SetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 36b7257d76844107139213576dfd60c3c1e5e84d Author: Michael Straube Date: Sat Apr 2 11:23:30 2022 +0200 staging: r8188eu: remove HW_VAR_RPT_TIMER_SETTING from SetHwReg8188EU() Remove the HW_VAR_RPT_TIMER_SETTING case from SetHwReg8188EU() and move its functionality to rtw_cmd.c where it is actually used. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b9c023d1369ba58346ae7e55021d2f82f9290eae Author: Michael Straube Date: Sat Apr 2 11:23:29 2022 +0200 staging: r8188eu: remove HW_VAR_ANTENNA_DIVERSITY_SELECT from SetHwReg8188EU() Remove the HW_VAR_ANTENNA_DIVERSITY_SELECT case from SetHwReg8188EU() and move its functionality to rtw_cmd.c where it is actually used. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e665487795a64376fccf662ad43b18cee1f9ff23 Author: Michael Straube Date: Sat Apr 2 11:23:28 2022 +0200 staging: r8188eu: remove HW_VAR_AMPDU_MIN_SPACE from SetHwReg8188EU() Remove the HW_VAR_AMPDU_MIN_SPACE case from SetHwReg8188EU() and move its functionality to rtw_wlan_util.c where it is actually used. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 484e4259a6a9ccad7f08f13fefcba3b976256b37 Author: Michael Straube Date: Sat Apr 2 11:23:27 2022 +0200 staging: r8188eu: remove HW_VAR_ACK_PREAMBLE from SetHwReg8188EU() Remove the HW_VAR_ACK_PREAMBLE case from SetHwReg8188EU() and move its functionality to rtw_wlan_util.c where it is actually used. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7c1972941ad3243c16415f3c78c4e264d6c3b7de Author: Michael Straube Date: Sat Apr 2 11:23:26 2022 +0200 staging: r8188eu: remove HW_VAR_BSSID from SetHwReg8188EU() Remove the HW_VAR_BSSID case from SetHwReg8188EU() and move its functionality to rtw_mlme_ext.c where it is actually used. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220402092332.6627-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 258b1bd5e2358d8f2f9d7cc3fbd7eaa9499ddffb Author: 白浩文 Date: Fri Apr 1 18:44:41 2022 +0800 staging: r8188eu: Fix misspelling in comment "cacluated" -> "calculated" This patch fixes some spelling typo in error message reported by checkpatch.pl WARNING: 'cacluated' may be misspelled - perhaps 'calculated'? Signed-off-by: 白浩文 Link: https://lore.kernel.org/r/1648809881-2777-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit aaec586a3ca5d24ed67faee54f7a54d3e6ac1107 Author: Fabio M. De Francesco Date: Sat Apr 2 19:56:55 2022 +0200 staging: sm750fb: Call iounmap() to free mapped bus memory If ioremap_wc() fails, the code jumps to the "exit" label and forgets to free the bus memory mapped into "sm750_dev->pvReg". Mapped bus memory must always be freed by calling iounmap(). Call iounmap(sm750_dev->pvReg) when the above-mentioned failures happen. The site of the missing iounmap() has been detected by Smatch. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220402175655.31512-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit c9736770e6c30295dfd1802dde87b7f727d699f7 Author: Fabio M. De Francesco Date: Sat Apr 2 18:34:39 2022 +0200 staging: r8188eu: Use the ARRAY_SIZE() macro Use the ARRAY_SIZE() macro in places where there are open coded calculations of the size of arrays. ARRAY_SIZE(arr) makes sure that "arr" is an array, it's safer than sizeof(arr) / sizeof(arr[0]), and improves readibility. Detected with the help of Coccinelle. Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220402163439.20457-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 28f7545d9f08f49d02e02fc1ee556161bfa95a5e Author: Fabio M. De Francesco Date: Sat Apr 2 16:06:57 2022 +0200 staging: r8188eu: Remove redundant code from rtw_free_netdev() In rtw_free_netdev() there are two redundant tests. The first checks for a valid pointer to a "struct net_device". This pointer is the argument of rtw_free_netdev(). The two callers of this function already test this parameter immediatelly before the calls. The second checks for a valid pointer to a "struct rtw_netdev_priv_indicator". This pointer is always valid and, even if it were not, vfree() is a no-op on NULL pointers. Therefore the above-mentioned two "if" statements are unnecessary and redundant. For this reason, remove these two tests. After removing these tests there is no more need of the "RETURN" label. Therefore, remove also the "RETURN" label. Cc: Pavel Skripkin Cc: Martin Kaiser Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220402140657.10549-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit e25abea603179b0204ba9487d7f123b8642e4741 Author: Rebecca Mckeever Date: Sat Apr 2 03:50:48 2022 -0500 staging: r8188eu: remove spaces before tabs Conform to Linux kernel coding style. Reported by checkpatch: WARNING: please, no space before tabs Acked-by: Larry Finger Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/2fd10f393e3bc7381a85d0bfc1ec04a80af4eabb.1648888462.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit e1eb5ef03165dbe5eaebfc4cce04e36bc9390428 Author: Rebecca Mckeever Date: Sat Apr 2 03:50:47 2022 -0500 staging: r8188eu: remove unnecessary braces in conditional statements Conform to Linux kernel coding style. Reported by checkpatch: WARNING: braces {} are not necessary for single statement blocks WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/2b46501bb3965a8cf27e7134407c50551c36b7e8.1648888462.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 34b19431d968790596a9db15a9b47d4ad4dffbfc Author: Rebecca Mckeever Date: Sat Apr 2 03:50:46 2022 -0500 staging: r8188eu: format block comments Add ' * ' or ' ' to beginning of block comment lines to conform to Linux kernel coding style. Reported by checkpatch: WARNING: Block comments use * on subsequent lines Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/0387f3df49d89c17acf96cf072e70c98e81e58f7.1648888462.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 95cfe1f0b22e0aca085b96a8f446532fb138909f Author: Rebecca Mckeever Date: Sat Apr 2 03:50:45 2022 -0500 staging: r8188eu: correct misspelling in comment "conider" -> "consider" Correct spelling typo. Reported by checkpatch: CHECK: 'conider' may be misspelled - perhaps 'consider'? Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/5799315f84e50db2a7d05b74cd4ed9ec2f28a8e2.1648888461.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit c29050b7706be451201ea60d35b20f013064d1a6 Author: Rebecca Mckeever Date: Sat Apr 2 03:50:44 2022 -0500 staging: r8188eu: remove else after return Conform to Linux kernel coding style. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/84db0348481b54f58cb0b6200fa9ae471ee06b3b.1648888461.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5b547d5c8d1fdc5f5e982a2a4176970794ff478d Author: Rebecca Mckeever Date: Sat Apr 2 03:50:43 2022 -0500 staging: r8188eu: place constants on the right side of tests Conform to Linux kernel coding style. Reported by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/0f3db3586b3668d6d784e075bc52ffd88b0920d2.1648888461.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman commit c10f66779f40209cce8b076060072effaee3bf9d Author: Alaa Mohamed Date: Sat Apr 2 13:37:33 2022 +0200 staging: wlan-ng: Fix Alignment with parenthesis Fix " CHECK: Alignment should match open parenthesis " Reported by checkpath Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/08641d36aaee60797f8c68683b013ebf0215ba2e.1648899123.git.eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 00bb97dd7fc2441f5162e462a972c3243d700e19 Author: Alaa Mohamed Date: Sat Apr 2 13:37:32 2022 +0200 staging: wlan-ng: Fix Lines shouldn't end with '(' Fix "CHECK: Lines should not end with a '('" for lines 331 and 485 Reported By checkpatch Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/82bb0ca2bad1bafbaca8ded6fe82b94e4761f648.1648899123.git.eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 875e957087b5f8624a1fbfe9d9b9647ec7912bd4 Author: Sevinj Aghayeva Date: Fri Apr 1 07:46:35 2022 -0400 staging: rtl8723bs: simplify control flow The function iterates an index from 0 to NUM_PMKID_CACHE and returns the first index for which the condition is true. If no such index is found, the function returns -1. Current code has a complex control flow that obfuscates this simple task. Replace it with a loop. Also, given the shortened function body, replace the long variable name psecuritypriv with a short variable name p. Reported by checkpatch: WARNING: else is not generally useful after a break or return Reviewed-by: Ira Weiny Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220401114635.GA567659@euclid Signed-off-by: Greg Kroah-Hartman commit 47f46a873d9bd29f1d663517eff4a4ad7c1654b9 Author: Fabio M. De Francesco Date: Wed Mar 30 21:14:14 2022 +0200 staging: vc04_services: Convert kmap() to kmap_local_page() The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. In file interface/vchiq_arm/vchiq_arm.c, function free_pagelist() calls kmap() / kunmap() from two places. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. Therefore, free_pagelist() is a function where the use of kmap_local_page() in place of kmap() is correctly suited. Convert to kmap_local_page() but, instead of open coding it, use the memcpy_to_page() helper. Reviewed-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220330191414.23141-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8a56b5ce774e4fd9aaa8959a706fc3bb226bf3d8 Author: Michael Straube Date: Thu Mar 31 23:41:46 2022 +0200 staging: rtl8723bs: refactor rtw_ch2freq() Convert the array ch_freq_map to a simple integer array and use the indices as channel numbers. This simplifies the code and avoids looping through the array to get the frequency. To avoid out of bounds array access return a default value for invalid channel values, like the original code did. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331214146.15161-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f232da0fa9151571ddfd830e0d1cd8941e60b5be Author: Michael Straube Date: Thu Mar 31 23:41:45 2022 +0200 staging: rtl8723bs: remove 5 GHz channels from ch_freq_map According to the Realtek documentation the chips this driver supports are 2.4 GHz only chips. Frequencies for 5 GHz channels can be removed from the ch_freq_map array. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331214146.15161-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 48e4f94766e16dc7025067ddb0da711ce9aa32e3 Author: Rebecca Mckeever Date: Thu Mar 31 13:19:45 2022 -0500 staging: r8188eu: remove handlerOS independent comment The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Suggested-by: Dan Carpenter Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/YkXwwfYBE+P0UObq@bertie Signed-off-by: Greg Kroah-Hartman commit a76d5a6e3dc11e97aae17f3f029dcc3f22d50c5b Author: Rebecca Mckeever Date: Thu Mar 31 12:16:04 2022 -0500 staging: r8188eu: use sizeof(*pvar) for allocating structs Use sizeof(*pvar) instead of sizeof(struct var) when allocating memory. This conforms to Linux kernel coding style, improves readability, and decreases the opportunity for bugs if the pointer variable type is changed. Issue found by checkpatch messages of the following format: CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...) Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/YkXh1HBqaHwT38UC@bertie Signed-off-by: Greg Kroah-Hartman commit acc24ef13ebdb893b2c348cbbaf508f96b1b40ca Author: Fabio M. De Francesco Date: Thu Mar 31 08:47:51 2022 +0200 staging: unisys: Remove "struct dentry *eth_debugfs_dir" There is no need for "struct dentry *eth_debugfs_dir" which is used for debug / sysfs directories. Therefore, remove this "struct dentry" and everything related (i.e., creation and removal). As a side effect of this change, the code has no more need of the "cleanup_register_netdev" label, which can also be removed. Suggested-by: Dan Carpenter Suggested-by: Greg Kroah-Hartman Reviewed-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220331064751.29634-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit d8a130d1349759b693367b1b70901d0a7603d188 Author: Michael Straube Date: Thu Mar 31 15:05:22 2022 +0200 staging: r8188eu: remove GetHwReg8188EU() The only call to GetHwReg8188EU() that is left over from previous cleanups sets a variable that is immediately overwritten. This call is useless and we can finally remove the GetHwReg8188EU() function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331130522.6648-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 61f514799bea3b127d3125b4da5807a1dca4f24b Author: Michael Straube Date: Thu Mar 31 15:05:21 2022 +0200 staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU() Move the functionality of the HW_VAR_FWLPS_RF_ON case in GetHwReg8188EU() to a static function in rtw_pwrctrl.c and remove the HW_VAR_FWLPS_RF_ON case from GetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331130522.6648-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9494dba5d73416aee074b8b0991bd225f8575dc0 Author: Michael Straube Date: Thu Mar 31 15:05:20 2022 +0200 staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() The HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() just calls rtw_read32(). Remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() and call rtw_read32() directly. Move the call to a new function to indicate what it actually does. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331130522.6648-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ae3d0470ab5709b9eb8e56db1de0b05e19536ab2 Author: Michael Straube Date: Thu Mar 31 15:05:19 2022 +0200 staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU() The HW_VAR_BCN_VALID from GetHwReg8188EU() just calls rtw_read8(). Remove HW_VAR_BCN_VALID from GetHwReg8188EU() and call rtw_read8() directly. Move the call to a new function to indicate what it actually does. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331130522.6648-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit db975705cbbe65f8c87699fc5a1c602fe7f87626 Author: Michael Straube Date: Thu Mar 31 15:05:18 2022 +0200 staging: r8188eu: rename clear_bacon_valid_bit() Rename clear_bacon_valid_bit(). Actually it should be clear_beacon_valid_bit(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220331130522.6648-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a0ff667592ee4786f9f6fb8866a5743127614dfa Author: Alaa Mohamed Date: Thu Mar 31 15:09:48 2022 +0200 staging: rtl8723bs: Fix No space before tabs Fix "WARNING: please, no space before tabs" reported by checkpatch Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220331130948.74835-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit 94579b02720bb63096312c4bc7694fd2f6df7cbb Author: Sevinj Aghayeva Date: Thu Mar 31 07:32:45 2022 -0400 staging: rtl8723bs: remove redundant braces in if statements Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220331113245.GA425141@euclid Signed-off-by: Greg Kroah-Hartman commit 58cafef9ec657672e9c9d32edacc673bae4f8ceb Author: Wang Qing Date: Thu Mar 31 05:08:34 2022 -0700 staging: r8188eu: remove duplicate assignment netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed, no need to repeat assignment. Signed-off-by: Wang Qing Link: https://lore.kernel.org/r/1648728514-37390-1-git-send-email-wangqing@vivo.com Signed-off-by: Greg Kroah-Hartman commit 5cb47847fcce158f52172af002fa2f5141503814 Author: Sevinj Aghayeva Date: Thu Mar 31 08:26:18 2022 -0400 staging: rtl8723bs: place constants on the right side of tests Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220331122618.GA434796@euclid Signed-off-by: Greg Kroah-Hartman commit 9fcee167d81c4121b620b0a885f766007a41e841 Author: Xiaoke Wang Date: Wed Mar 30 19:30:05 2022 +0800 staging: r8188eu: add a check for rtw_cbuf_alloc() kmalloc() is called by rtw_cbuf_alloc() and it returns pointer of srtuct rtw_cbuf, NULL for allocation failure. So it is better to check the return value of it. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_D95ACC78B93B1CDD14C4E13E4A66FF892008@qq.com Signed-off-by: Greg Kroah-Hartman commit f6ca689d12dfcd8cf917de018391ae84d8a084f4 Author: Martin Kaiser Date: Wed Mar 30 22:12:10 2022 +0200 staging: r8188eu: remove the "dump tx packet" fragments Remove the code fragments for printing outgoing packets. There's only a hal variable HAL_DEF_DBG_DUMP_TXPKT and the bDumpTxPkt component of struct hal_data_8188e. The hal variable is set by a private ioctl, it's never read. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220330201210.175941-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 76d86eccadd75f66e9574c6d88fe9299557870cc Author: Martin Kaiser Date: Wed Mar 30 22:12:09 2022 +0200 staging: r8188eu: remove the "dump rx packet" fragments Remove the code fragments for printing incoming packets. There's only a hal variable HAL_DEF_DBG_DUMP_RXPKT and the bDumpRxPkt component of struct hal_data_8188e. The hal variable is set by a private ioctl, it's read in validate_recv_frame but it's not used. All of this can be removed, there's no code to dump the packets. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220330201210.175941-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 70eb91dfa2adfd18bb4701f61a3ebc85160f07aa Author: Sevinj Aghayeva Date: Wed Mar 30 08:07:09 2022 -0400 staging: rtl8723bs: place constants on the right side of tests Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220330120709.GA339788@euclid Signed-off-by: Greg Kroah-Hartman commit 1c57b2dc93ab14010b2596ae5c7f7f138a1e1fbf Author: Haowen Bai Date: Wed Mar 30 18:31:15 2022 +0800 staging: r8188eu: Fix misspelling in comment "writting" -> "writing" This patch fixes some spelling typo in error message reported by checkpatch.pl WARNING: 'writting' may be misspelled - perhaps 'writing'? Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1648636275-13558-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 781d44b7d824492c977048b51c9b44ad5214f8d4 Author: Haowen Bai Date: Wed Mar 30 15:27:21 2022 +0800 staging: r8188eu: Fix misspelling in comment "Tranceiver" -> "Transceiver" This patch fixes some spelling typo in error message reported by checkpatch.pl WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'? WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'? WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'? WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'? Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1648625242-12678-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 2d959a842a8ff26c8c9c01f60a4db156cf3f55f6 Author: Charlie Sands Date: Tue Mar 29 23:14:05 2022 -0400 staging: r8188eu: Fix sparse endianness warnings. This patch fixes sparse warnings about the endianness of different integers in the driver. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reviewed-by: Dan Carpenter Signed-off-by: Charlie Sands Link: https://lore.kernel.org/r/YkPK/QmLAp3BkygY@sckzor-linux.localdomain Signed-off-by: Greg Kroah-Hartman commit 2487b7c46b1a06cd32d85f065bca75c3fe1d544d Author: Michael Straube Date: Tue Mar 29 22:21:41 2022 +0200 staging: r8188eu: remove HW_VAR_BCN_VALID from SetHwReg8188EU() The HW_VAR_BCN_VALID case in SetHwReg8188EU() just calls rtw_write8(). Remove HW_VAR_BCN_VALID from SetHwReg8188EU() and call rtw_write8() directly. Move the call to a new function to indicate what it actually does. This is part of the ongoing effort to getrid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1664532112d3928fc364693aa5c9cfa08b060b98 Author: Michael Straube Date: Tue Mar 29 22:21:40 2022 +0200 staging: r8188eu: remove HW_VAR_TX_RPT_MAX_MACID from SetHwReg8188EU() The HW_VAR_TX_RPT_MAX_MACID case in SetHwReg8188EU() just calls rtw_write8(). Remove HW_VAR_TX_RPT_MAX_MACID from SetHwReg8188EU() and call rtw_write8() directly. Move the call to a new function to indicate what it actually does. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a90b92ede242d07801c238bcfe4a28382a8219cb Author: Michael Straube Date: Tue Mar 29 22:21:39 2022 +0200 staging: r8188eu: simplify if-else statement Simplify a nested if-else statement to a single if-else statement in rtw_set_threshold(). This improves readability and allows us to remove the local variable threshold. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2ac32870ebf824ff493bd1f2aaf522141fc2e150 Author: Michael Straube Date: Tue Mar 29 22:21:38 2022 +0200 staging: r8188eu: remove HW_VAR_RXDMA_AGG_PG_TH from SetHwReg8188EU() The HW_VAR_RXDMA_AGG_PG_TH case in SetHwReg8188EU() just sets a variable conditionally and then calls rtw_write8(). Set the variable in the caller and call rtw_write8() directly. Move the functionality into a new static function to make the code cleaner. Remove the HW_VAR_RXDMA_AGG_PG_TH case from SetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03ab00243006d64f5ba75c98e899a8f2c1d8710e Author: Michael Straube Date: Tue Mar 29 22:21:37 2022 +0200 staging: r8188eu: remove HW_VAR_ACM_CTRL from SetHwReg8188EU() SetHwReg8188EU() is called with HW_VAR_ACM_CTRL only from a function in rtw_wlan_util.c. Move the functionality into a static function in rtw_wlan_util.c and remove the HW_VAR_ACM_CTRL case from SetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c427ab4688bf6f1ce6ab1a5c05275f6a962402f7 Author: Michael Straube Date: Tue Mar 29 22:21:36 2022 +0200 staging: r8188eu: rename some macros to upper case Rename some macros to upper case to avoid camel case and improve readability. While at it, remove some unused macros. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0161f67730908e20e7c0275d0dec045af1ce2d44 Author: Michael Straube Date: Tue Mar 29 22:21:35 2022 +0200 staging: r8188eu: remove HW_VAR_MLME_DISCONNECT from SetHwReg8188EU() SetHwReg8188EU() is called with HW_VAR_MLME_DISCONNECT only from functions in rtw_mlme_ext.c. Move the functionality into a static function in rtw_mlme_ext.c and remove the HW_VAR_MLME_DISCONNECT case from SetHwReg8188EU(). This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e73ff996e2463a15d6fc7776c9ee007c1a2af273 Author: Michael Straube Date: Tue Mar 29 22:21:34 2022 +0200 staging: r8188eu: remove HW_VAR_RESP_SIFS from SetHwReg8188EU() SetHwReg8188EU() is called with HW_VAR_RESP_SIFS only in one place. Remove the HW_VAR_RESP_SIFS case from SetHwReg8188EU() and call rtw_write8() directly instead. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329202141.7028-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e327cf83db4985a80c8c533bb7b0adf3eee87f1a Author: Haowen Bai Date: Wed Mar 30 09:28:59 2022 +0800 staging: r8188eu: Directly return _SUCCESS instead of using local ret variable As init_mlme_ext_priv function always returns SUCCESS , We can change return type from int to void. fixes coccinelle warning: ./drivers/staging/r8188eu/core/rtw_mlme_ext.c:357:5-8: Unneeded variable: "res". Return "_SUCCESS" on line 380 Reviewed-by: Dan Carpenter Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1648603740-14760-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman commit 18ce31aa638d52139b38496c1d53f536a8f06811 Author: Fabio M. De Francesco Date: Wed Mar 30 16:33:31 2022 +0200 staging: rts5208: Convert kmap() to kmap_local_page() The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. With kmap_local_page(), the mapping is per thread, CPU local and not globally visible. Therefore rtsx_stor_access_xfer_buf() is a function where the use of kmap_local_page() in place of kmap() is correctly suited. Convert to kmap_local_page() but, instead of open coding it, use the helpers memcpy_to_page() and memcpy_from_page(). Make a minor change to a comment related to scatter-gather. Reviewed-by: Dan Carpenter Reviewed-by: Ira Weiny Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220330143331.8306-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit dbf6851f199b9bf69e373d9403feab0f6e89b831 Author: Alaa Mohamed Date: Wed Mar 30 19:59:49 2022 +0200 staging: rtl8723bs: remove code suspect indent Fix "WARNING: suspect code indent for conditional statements (16, 32)" for line 1240 founded by checkpatch.pl Signed-off-by: Alaa Mohamed Link: https://lore.kernel.org/r/20220330175949.95564-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman commit bc62ae5616081b76ec99eb693ba2d8ddf1a8e8fa Author: Rebecca Mckeever Date: Wed Mar 30 08:07:36 2022 -0500 staging: r8188eu: remove unnecessary spaces Conform to Linux kernel coding style. Issue found by checkpatch: WARNING: Statements should start on a tabstop Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/YkRWGCmMytlqgvkZ@bertie Signed-off-by: Greg Kroah-Hartman commit 25a0065f27ae03b59b3a10fe0adffdc9e53b1273 Author: Jaehee Park Date: Tue Mar 29 18:25:34 2022 -0400 staging: wfx: remove space at the start of the line Remove spaces at the start of the line to follow the linux kernel coding style. Issue found by checkpatch: WARNING: please, no spaces at the start of a line. Signed-off-by: Jaehee Park Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20220329222534.GA1002253@jaehee-ThinkPad-X1-Extreme Signed-off-by: Greg Kroah-Hartman commit b49f6911899b60086b818c452c842e5fb92095d3 Author: Michael Straube Date: Tue Mar 29 12:37:56 2022 +0200 staging: r8188eu: convert rtw_inc_and_chk_continual_urb_error() to bool Function rtw_inc_and_chk_continual_urb_error() returns boolean values. Change its return type from int to bool. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329103756.6740-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b2bfb60c083c5addd7daf5d2817ce4e09ffaf625 Author: Michael Straube Date: Tue Mar 29 12:37:55 2022 +0200 staging: r8188eu: convert rtw_usb_bulk_size_boundary() to bool Function rtw_usb_bulk_size_boundary() returns boolean values. Change its return type from u8 to bool. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329103756.6740-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0166ffdc89bf4d5f50852eb4bc86bbd18cffd4f9 Author: Michael Straube Date: Tue Mar 29 12:37:54 2022 +0200 staging: r8188eu: refactor rtw_inc_and_chk_continual_urb_error() Refactor rtw_inc_and_chk_continual_urb_error(). Return directly instead of using a return variable and initialize the variable 'value' at declaration. This shortens the code and improves readability. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329103756.6740-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b5ea08d84f2d3a37835688ca713bfa460891c168 Author: Michael Straube Date: Tue Mar 29 12:37:53 2022 +0200 staging: r8188eu: refactor rtw_usb_bulk_size_boundary() Using ternary operator to set a variable to true or false is not needed. Convert two such uses of ternary operator in rtw_usb_bulk_size_boundary() to just use the condition and return the value directly instead of using a return variable. This shortens the code and improves readability. While at it, remove an unneeded line break from the function head. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220329103756.6740-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 38238ecbfb63bbcfb27ee28951b2b0692daf6133 Author: Martin Kaiser Date: Sun Mar 27 20:09:44 2022 +0200 staging: r8188eu: use ieee80211 define for fragment number Use the IEEE80211_SCTL_FRAG define to extract the fragment number from an incoming frame. pattrib->frag_num must be in host endianness, we have to convert hdr->seq_ctrl, this field is little-endian. Remove the local GetFragNum macro, it is not used any more. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 16405e4689d128435019f9d02a4d38cf28e94227 Author: Martin Kaiser Date: Sun Mar 27 20:09:43 2022 +0200 staging: r8188eu: use ieee80211 macro for sequence number Use the IEEE80211_SEQ_TO_SN macro in function validate_recv_frame to get the sequence number of an incoming frame. Map the incoming rx bytes to a struct ieee80211_hdr. Replace the fc variable with struct ieee80211_hdr's frame control component. The IEEE80211_SEQ_TO_SN macro takes the sequence control field of an ieee80211 header and extracts the sequence number. The macro's input parameter must be in host endianness, the sequence number in the 80211 header is little-endian, we have to convert it to host endianness. Remove the local GetSequence macro, it is not used any more. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6cb1bfc9995d275e9641908798868ef3a8c29ef9 Author: Martin Kaiser Date: Sun Mar 27 20:09:42 2022 +0200 staging: r8188eu: remove unused control frame subtypes Remove unused defines for control frame subtypes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit dd85cfe6c6ab73acb406bdf0e9bd4cce2ad96761 Author: Martin Kaiser Date: Sun Mar 27 20:09:41 2022 +0200 staging: r8188eu: remove unused data frame subtypes Remove unused defines for data frame subtypes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 129d140db906aa5e98601a14db751bcd98c0ed7e Author: Martin Kaiser Date: Sun Mar 27 20:09:40 2022 +0200 staging: r8188eu: use standard mechanisms for qos data frames Use defines and macros from ieee80211.h to check for qos data frames and to mark a frame as qos data. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit baa1bb800277b9aa4dd19f0aea1e2432f214e838 Author: Martin Kaiser Date: Sun Mar 27 20:09:39 2022 +0200 staging: r8188eu: use standard mechanisms for data frames Use defines and macros from ieee80211.h to check for data frames and to define data frame subtypes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c3ba49e32b9ddbde956d30b7df6b03a07ef1319e Author: Martin Kaiser Date: Sun Mar 27 20:09:38 2022 +0200 staging: r8188eu: use standard mechanisms for control frames Use defines and macros from ieee80211.h to check for control frames and to define control frame subtypes. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e894c76b6b2c4676657e4aae3ef641b4c0b276ce Author: Martin Kaiser Date: Sun Mar 27 20:09:37 2022 +0200 staging: r8188eu: use ieee80211 helper to read the pwr bit Use the ieee80211 helper to read the power management bit. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ea1728b5cdb7496305d9b5a43a1070f3a413d022 Author: Martin Kaiser Date: Sun Mar 27 20:09:36 2022 +0200 staging: r8188eu: use ieee80211 define for version check Use the IEEE80211_FCTL_VERS define to check the version number of a received frame. Covert IEEE80211_FCTL_VERS to le16 before using it as a mask for fc, which is also an le16 value. The ieee80211_... helper functions use the same approach. Reported-by: kernel test robot Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220327180944.712545-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b4c5ec356c7215beba2d54700c27d58926b7684c Author: Martin Kaiser Date: Tue Mar 22 21:24:39 2022 +0100 staging: r8188eu: remove empty rtw_fwdbg_event_callback Remove the empty function rtw_fwdbg_event_callback. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220322202439.157999-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 34a2968579360e237aee2c1f7fd138e89789de6d Author: Martin Kaiser Date: Tue Mar 22 21:24:38 2022 +0100 staging: r8188eu: remove empty rtw_dummy_event_callback Remove the empty function rtw_dummy_event_callback. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220322202439.157999-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4c5e5a769ac9705963f8442260ba17de95965ce7 Author: Martin Kaiser Date: Tue Mar 22 21:24:37 2022 +0100 staging: r8188eu: the MCS_rate_2R array is not used The MCS_rate_2R array is not used in the r8188eu driver. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220322202439.157999-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit afd61671982b751f5e2b6993d50b9b9ed95249c5 Author: Martin Kaiser Date: Tue Mar 22 21:24:36 2022 +0100 staging: r8188eu: make _rtw_init_mlme_priv static The _rtw_init_mlme_priv function is used only in rtw_mlme.c. It can be declared as static. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220322202439.157999-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 66f663a294e7095b1f6a78990e193c2a977f06ce Author: Jakob Koschel Date: Thu Mar 24 08:30:24 2022 +0100 staging: vchiq: 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/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220324073024.65943-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9619a47f7eada0916824d6e73993150512868fc6 Author: Martin Kaiser Date: Mon Mar 21 21:30:31 2022 +0100 staging: r8188eu: refactor dm func set and clear Refactor the code to set and clear "dm functions". The only remaining callers of Switch_DM_Func use Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true) or Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false). Remove Switch_DM_Func and call SetHwReg8188EU directly. For HW_VAR_DM_FUNC_SET, the parameter is always DYNAMIC_ALL_FUNC_ENABLE. This operation resets podmpriv->SupportAbility to the initial value. Rename HW_VAR_DM_FUNC_SET to HW_VAR_DM_FUNC_RESET and drop the unused else branch. For HW_VAR_DM_FUNC_CLR, the parameter is always DYNAMIC_FUNC_DISABLE (0x00). We can set podmpriv->SupportAbility to 0 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 07142f8cd77fc70799cdf0de2d92bd33b39a5386 Author: Martin Kaiser Date: Mon Mar 21 21:30:30 2022 +0100 staging: r8188eu: DYNAMIC_RF_CALIBRATION is not used Remove the DYNAMIC_RF_CALIBRATION capability. It's cleared in one place but never checked. DYNAMIC_RF_CALIBRATION is part of podmpriv->SupportAbility, there are no users that check SupportAbility as a whole and use DYNAMIC_RF_CALIBRATION implicitly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4a67fc31bd0c7f1a80ad8ce153e314f274b53d38 Author: Martin Kaiser Date: Mon Mar 21 21:30:29 2022 +0100 staging: r8188eu: DYNAMIC_BB_ANT_DIV is not used Remove the DYNAMIC_BB_ANT_DIV capability. It's cleared in one place but never checked. DYNAMIC_BB_ANT_DIV is part of podmpriv->SupportAbility, there are no users that check SupportAbility as a whole and use DYNAMIC_BB_ANT_DIV implicitly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b06c22b2ea6ab537f3e7734a4c4d257e694d1b58 Author: Martin Kaiser Date: Mon Mar 21 21:30:28 2022 +0100 staging: r8188eu: DYNAMIC_BB_DYNAMIC_TXPWR is not used Remove the DYNAMIC_BB_DYNAMIC_TXPWR capability. It is cleared but not used. DYNAMIC_BB_DYNAMIC_TXPWR defines a bit in podmpriv->SupportAbility that's set or cleared. There's no code that checks this bit explicitly. There's also no code that makes a copy of SupportAbility and checks the DYNAMIC_BB_DYNAMIC_TXPWR in the copy. SupportAbility is copied to podmpriv->BK_SupportAbility. The only use of BK_SupportAbility is to restore a previously saved value. The other remaining reader of SupportAbility is a private debug ioctl. It's safe to assume that DYNAMIC_BB_DYNAMIC_TXPWR is not used, not even indirectly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ea4ec3d1f09f41199dc8b64fa3463e78baa036f5 Author: Martin Kaiser Date: Mon Mar 21 21:30:27 2022 +0100 staging: r8188eu: remove unused defines for dynamic functions Remove a couple of DYNAMIC_BB_... defines which are not used by this driver. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ad9b9e9c50144468e20321b6109558e2dcf0b450 Author: Martin Kaiser Date: Mon Mar 21 21:30:26 2022 +0100 staging: r8188eu: remove two limit defines Remove two unused defines related to limits. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220321203031.143486-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit eb563e69877abc956911ff2d74f5697a5b0ea9d9 Author: Martin Kaiser Date: Sat Mar 19 19:03:42 2022 +0100 staging: r8188eu: remove local BIT macro The r8188eu driver defines a local BIT(x) macro. Remove this local macro and use the one from include/linux/bits.h. The global BIT macro returns an unsigned long value, the removed local BIT macro used a signed int. DYNAMIC_BB_DYNAMIC_TXPWR is defined as BIT(2), ~DYNAMIC_BB_DYNAMIC_TXPWR is passed to Switch_DM_Func as a u32 parameter. We need a cast in this case as ~DYNAMIC_BB_DYNAMIC_TXPWR is a 64-bit value on x86_64 systems. Reviewed-by: Dan Carpenter Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220319180342.3143734-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 84ef256550196bc06e6849a34224c998b45bd557 Author: Jakob Koschel Date: Mon Mar 21 13:36:26 2022 +0100 staging: greybus: codecs: fix type confusion of list iterator variable If the list does not exit early then data == NULL and 'module' does not point to a valid list element. Using 'module' in such a case is not valid and was therefore removed. Fixes: 6dd67645f22c ("greybus: audio: Use single codec driver registration") Reviewed-by: Dan Carpenter Reviewed-by: Vaibhav Agarwal Reviewed-by: Mark Greer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220321123626.3068639-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c73d3203c5fcf9078e6d35352df4418bcab7888 Author: Jakob Koschel Date: Mon Mar 21 13:37:12 2022 +0100 staging: greybus: codecs: use dedicated list iterator variable In preparation to limit the scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Reviewed-by: Dan Carpenter Reviewed-by: Vaibhav Agarwal Reviewed-by: Mark Greer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220321123712.3068778-1-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman commit 77714e53dde8aac19ee2025dfe491087ccfacb3f Author: Sathish Kumar Date: Tue Mar 22 14:13:34 2022 +0530 staging: vt6656: Fix multiple blank lines warning This patch fixes the checkpatch.pl warnings like: CHECK: Please don't use multiple blank lines + + Signed-off-by: Sathish Kumar Link: https://lore.kernel.org/r/20220322084334.4077-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman commit a3515f20535fc6a3813da45268911a65f5ebe362 Author: Sathish Kumar Date: Wed Mar 23 10:25:15 2022 +0530 staging: rtl8712: Use completions for signaling r8712_sitesurvey_cmd() uses a variable to notify r8712_SetFilter() that it has completed operation. There is no sort of assurance that the variable will actually change and it could cache the value the first time it is read and then never update it for the whole loop logic. Use completion variables because they are better suited for the purpose. This patch fixes the checkpatch.pl warnings like: CHECK: Avoid CamelCase: + u8 blnEnableRxFF0Filter; Reviewed-by: Fabio M. De Francesco Signed-off-by: Sathish Kumar Link: https://lore.kernel.org/r/20220323045515.2513-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman commit 52a0af7091b41deb8cd27d7954b43d30ab27f3ab Author: Chris Morgan Date: Wed Mar 23 10:42:37 2022 -0500 staging: rtl8723bs: Change rtw_ndev_notifier_call message to dbg The message received in the kernel log for the state of the notifier call doesn't seem to be of much help to end users. Changing the message type from info to dbg to hide the message unless you are debugging the kernel or the network subsystem. Reviewed-by: Hans de Goede Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20220323154237.21736-1-macroalpha82@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4610e57a7d2edeef14aa852cd945f9920e1759da Author: Sevinj Aghayeva Date: Tue Mar 29 07:09:04 2022 -0700 staging: rtl8723bs: Remove redundant else branches. This patch fixes the following checkpatch.pl warning: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva Link: https://lore.kernel.org/r/20220329140904.GA3566@ubuntu Signed-off-by: Greg Kroah-Hartman commit 610e8066785d4bad554b75ac424835aa6bacd784 Author: Rebecca Mckeever Date: Tue Mar 29 02:53:36 2022 -0500 staging: r8188eu: fix suspect code indent for conditional statements Align the if and else if branches of the conditional statement to improve readability. Prevent bugs that could be introduced if developers misread the code. Issue found by checkpatch. Signed-off-by: Rebecca Mckeever Link: https://lore.kernel.org/r/YkK7ABTVt0TCbd18@bertie Signed-off-by: Greg Kroah-Hartman commit 5d4be19cbe6aadfad0a5f40df91bd478cedd8344 Author: Manivannan Sadhasivam Date: Mon Nov 29 16:35:35 2021 +0530 bus: mhi: ep: Add uevent support for module autoloading Add uevent support to MHI endpoint bus so that the client drivers can be autoloaded by udev when the MHI endpoint devices gets created. The client drivers are expected to provide MODULE_DEVICE_TABLE with the MHI id_table struct so that the alias can be exported. The MHI endpoint reused the mhi_device_id structure of the MHI bus. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 5fb83d97aa176035e1f55af1025128f5df59d878 Author: Manivannan Sadhasivam Date: Mon Nov 29 16:25:24 2021 +0530 bus: mhi: ep: Add support for suspending and resuming channels Add support for suspending and resuming the channels in MHI endpoint stack. The channels will be moved to the suspended state during M3 state transition and will be resumed during M0 transition. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit f2a72d2410be8ad33a78b6d989861440def2c736 Author: Manivannan Sadhasivam Date: Mon Nov 29 15:32:42 2021 +0530 bus: mhi: ep: Add support for queueing SKBs to the host Add support for queueing SKBs to the host over the transfer ring of the relevant channel. The mhi_ep_queue_skb() API will be used by the client networking drivers to queue the SKBs to the host over MHI bus. The host will add ring elements to the transfer ring periodically for the device and the device will write SKBs to the ring elements. If a single SKB doesn't fit in a ring element (TRE), it will be placed in multiple ring elements and the overflow event will be sent for all ring elements except the last one. For the last ring element, the EOT event will be sent indicating the packet boundary. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 494a6f63937744d447630c9ab2f4a58f105b69f5 Author: Manivannan Sadhasivam Date: Sat Feb 12 21:32:02 2022 +0530 bus: mhi: ep: Add support for processing channel rings Add support for processing the channel rings from host. For the channel ring associated with DL channel, the xfer callback will simply invoked. For the case of UL channel, the ring elements will be read in a buffer till the write pointer and later passed to the client driver using the xfer callback. The client drivers should provide the callbacks for both UL and DL channels during registration. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 20c01fde1b36dec0a3ffdbd22f6d117a29cf586d Author: Manivannan Sadhasivam Date: Sat Feb 12 21:09:23 2022 +0530 bus: mhi: ep: Add support for reading from the host Data transfer between host and the ep device happens over the transfer ring associated with each bi-directional channel pair. Host defines the transfer ring by allocating memory for it. The read and write pointer addresses of the transfer ring are stored in the channel context. Once host places the elements in the transfer ring, it increments the write pointer and rings the channel doorbell. Device will receive the doorbell interrupt and will process the transfer ring elements. This commit adds support for reading the transfer ring elements from the transfer ring till write pointer, incrementing the read pointer and finally sending the completion event to the host through corresponding event ring. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 2b231a40e9073a6828fb960f055b07707b6dd205 Author: Manivannan Sadhasivam Date: Sat Feb 12 20:56:27 2022 +0530 bus: mhi: ep: Add support for processing command rings Add support for processing the command rings. Command ring is used by the host to issue channel specific commands to the ep device. Following commands are supported: 1. Start channel 2. Stop channel 3. Reset channel Once the device receives the command doorbell interrupt from host, it executes the command and generates a command completion event to the host in the primary event ring. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 1b54f3e8b4bb960f4b447460cc2e6dfb572b0e4a Author: Manivannan Sadhasivam Date: Mon Nov 29 15:11:38 2021 +0530 bus: mhi: ep: Add support for handling SYS_ERR condition Add support for handling SYS_ERR (System Error) condition in the MHI endpoint stack. The SYS_ERR flag will be asserted by the endpoint device when it detects an internal error. The host will then issue reset and reinitializes MHI to recover from the error state. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 2ee735c1734783ef0dbe604076676820006ff107 Author: Manivannan Sadhasivam Date: Mon Nov 29 15:00:07 2021 +0530 bus: mhi: ep: Add support for handling MHI_RESET Add support for handling MHI_RESET in MHI endpoint stack. MHI_RESET will be issued by the host during shutdown and during error scenario so that it can recover the endpoint device without restarting the whole device. MHI_RESET handling involves resetting the internal MHI registers, data structures, state machines, resetting all channels/rings and setting MHICTRL.RESET bit to 0. Additionally the device will also move to READY state if the reset was due to SYS_ERR. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit c6dba8924201079093e1187a61934c6863b9efc1 Author: Manivannan Sadhasivam Date: Mon Nov 29 13:59:16 2021 +0530 bus: mhi: ep: Add support for powering down the MHI endpoint stack Add support for MHI endpoint power_down that includes stopping all available channels, destroying the channels, resetting the event and transfer rings and freeing the host cache. The stack will be powered down whenever the physical bus link goes down. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 7de7780c43b1c793d67b5fb16232ab5df00a676c Author: Manivannan Sadhasivam Date: Mon Nov 29 13:48:05 2021 +0530 bus: mhi: ep: Add support for powering up the MHI endpoint stack Add support for MHI endpoint power_up that includes initializing the MMIO and rings, caching the host MHI registers, and setting the MHI state to M0. After registering the MHI EP controller, the stack has to be powered up for usage. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit b6c52d410cb464f5cc5d962b92205f7232cb18b8 Author: Manivannan Sadhasivam Date: Mon Nov 29 14:19:29 2021 +0530 bus: mhi: ep: Add support for processing MHI endpoint interrupts Add support for processing MHI endpoint interrupts such as control interrupt, command interrupt and channel interrupt from the host. The interrupts will be generated in the endpoint device whenever host writes to the corresponding doorbell registers. The doorbell logic is handled inside the hardware internally. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 484e04faa8a0487843808a08ff8b11e0684972f5 Author: Manivannan Sadhasivam Date: Mon Nov 29 12:53:51 2021 +0530 bus: mhi: ep: Add support for managing MHI state machine Add support for managing the MHI state machine by controlling the state transitions. Only the following MHI state transitions are supported: 1. Ready state 2. M0 state 3. M3 state 4. SYS_ERR state Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 6f7cb6e7883962b6393dbfbf188550a11d1490b3 Author: Manivannan Sadhasivam Date: Mon Nov 29 12:47:50 2021 +0530 bus: mhi: ep: Add support for sending events to the host Add support for sending the events to the host over MHI bus from the endpoint. Following events are supported: 1. Transfer completion event 2. Command completion event 3. State change event 4. Execution Environment (EE) change event An event is sent whenever an operation has been completed in the MHI EP device. Event is sent using the MHI event ring and additionally the host is notified using an IRQ if required. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit edf549e7b2396172ff374e044f3bfe843de3cf4c Author: Manivannan Sadhasivam Date: Mon Nov 29 12:39:35 2021 +0530 bus: mhi: ep: Add support for ring management Add support for managing the MHI ring. The MHI ring is a circular queue of data structures used to pass the information between host and the endpoint. MHI support 3 types of rings: 1. Transfer ring 2. Event ring 3. Command ring All rings reside inside the host memory and the MHI EP device maps it to the device memory using blocks like PCIe iATU. The mapping is handled in the MHI EP controller driver itself. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 37867094faf16d636f47a06b7acc035009dc2cd3 Author: Manivannan Sadhasivam Date: Mon Nov 29 12:36:28 2021 +0530 bus: mhi: ep: Add support for managing MMIO registers Add support for managing the Memory Mapped Input Output (MMIO) registers of the MHI bus. All MHI operations are carried out using the MMIO registers by both host and the endpoint device. The MMIO registers reside inside the endpoint device memory (fixed location based on the platform) and the address is passed by the MHI EP controller driver during its registration. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 03f44035a5863bd30cf6f24ea2e2a4f7da40a81d Author: Manivannan Sadhasivam Date: Fri Nov 26 19:58:00 2021 +0530 bus: mhi: ep: Add support for creating and destroying MHI EP devices This commit adds support for creating and destroying MHI endpoint devices. The MHI endpoint devices binds to the MHI endpoint channels and are used to transfer data between MHI host and endpoint device. There is a single MHI EP device for each channel pair. The devices will be created when the corresponding channels has been started by the host and will be destroyed during MHI EP power down and reset. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 36b7cae6a0328cd8560fe6b4ccdda921c600d154 Author: Manivannan Sadhasivam Date: Fri Nov 26 19:52:20 2021 +0530 bus: mhi: ep: Add support for registering MHI endpoint client drivers This commit adds support for registering MHI endpoint client drivers with the MHI endpoint stack. MHI endpoint client drivers bind to one or more MHI endpoint devices inorder to send and receive the upper-layer protocol packets like IP packets, modem control messages, and diagnostics messages over MHI bus. Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit 0cf35347830ce981428833789ef77fb0b2347ae0 Author: Manivannan Sadhasivam Date: Fri Nov 26 19:15:24 2021 +0530 bus: mhi: ep: Add support for registering MHI endpoint controllers This commit adds support for registering MHI endpoint controller drivers with the MHI endpoint stack. MHI endpoint controller drivers manage the interaction with the host machines (such as x86). They are also the MHI endpoint bus master in charge of managing the physical link between the host and endpoint device. Eventhough the MHI spec is bus agnostic, the current implementation is entirely based on PCIe bus. The endpoint controller driver encloses all information about the underlying physical bus like PCIe. The registration process involves parsing the channel configuration and allocating an MHI EP device. Channels used in the endpoint stack follows the perspective of the MHI host stack. i.e., UL - From host to endpoint DL - From endpoint to host Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam commit e93f39998d8f8ed456dfbb4ca68f9a159906cc6f Author: Yuntao Wang Date: Mon Apr 4 08:53:20 2022 +0800 libbpf: Don't return -EINVAL if hdr_len < offsetofend(core_relo_len) Since core relos is an optional part of the .BTF.ext ELF section, we should skip parsing it instead of returning -EINVAL if header size is less than offsetofend(struct btf_ext_header, core_relo_len). Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220404005320.1723055-1-ytcoode@gmail.com commit 88d01a57113a361c1e62abaeed0563745d637888 Merge: 85bf1f51691c0 579c3196b2180 Author: Andrii Nakryiko Date: Sun Apr 3 17:55:46 2022 -0700 Merge branch 'libbpf: name-based u[ret]probe attach' Alan Maguire says: ==================== This patch series focuses on supporting name-based attach - similar to that supported for kprobes - for uprobe BPF programs. Currently attach for such probes is done by determining the offset manually, so the aim is to try and mimic the simplicity of kprobe attach, making use of uprobe opts to specify a name string. Patch 1 supports expansion of the binary_path argument used for bpf_program__attach_uprobe_opts(), allowing it to determine paths for programs and shared objects automatically, allowing for specification of "libc.so.6" rather than the full path "/usr/lib64/libc.so.6". Patch 2 adds the "func_name" option to allow uprobe attach by name; the mechanics are described there. Having name-based support allows us to support auto-attach for uprobes; patch 3 adds auto-attach support while attempting to handle backwards-compatibility issues that arise. The format supported is u[ret]probe/binary_path:[raw_offset|function[+offset]] For example, to attach to libc malloc: SEC("uprobe//usr/lib64/libc.so.6:malloc") ..or, making use of the path computation mechanisms introduced in patch 1 SEC("uprobe/libc.so.6:malloc") Finally patch 4 add tests to the attach_probe selftests covering attach by name, with patch 5 covering skeleton auto-attach. Changes since v4 [1]: - replaced strtok_r() usage with copying segments from static char *; avoids unneeded string allocation (Andrii, patch 1) - switched to using access() instead of stat() when checking path-resolved binary (Andrii, patch 1) - removed computation of .plt offset for instrumenting shared library calls within binaries. Firstly it proved too brittle, and secondly it was somewhat unintuitive in that this form of instrumentation did not support function+offset as the "local function in binary" and "shared library function in shared library" cases did. We can still instrument library calls, just need to do it in the library .so (patch 2) - added binary path logging in cases where it was missing (Andrii, patch 2) - avoid strlen() calcuation in checking name match (Andrii, patch 2) - reword comments for func_name option (Andrii, patch 2) - tightened SEC() name validation to support "u[ret]probe" and fail on other permutations that do not support auto-attach (i.e. have u[ret]probe/binary_path:func format (Andrii, patch 3) - fixed selftests to fail independently rather than skip remainder on failure (Andrii, patches 4,5) Changes since v3 [2]: - reworked variable naming to fit better with libbpf conventions (Andrii, patch 2) - use quoted binary path in log messages (Andrii, patch 2) - added path determination mechanisms using LD_LIBRARY_PATH/PATH and standard locations (patch 1, Andrii) - changed section lookup to be type+name (if name is specified) to simplify use cases (patch 2, Andrii) - fixed .plt lookup scheme to match symbol table entries with .plt index via the .rela.plt table; also fix the incorrect assumption that the code in the .plt that does library linking is the same size as .plt entries (it just happens to be on x86_64) - aligned with pluggable section support such that uprobe SEC() names that do not conform to auto-attach format do not cause skeleton load failure (patch 3, Andrii) - no longer need to look up absolute path to libraries used by test_progs since we have mechanism to determine path automatically - replaced CHECK()s with ASSERT*()s for attach_probe test (Andrii, patch 4) - added auto-attach selftests also (Andrii, patch 5) Changes since RFC [3]: - used "long" for addresses instead of ssize_t (Andrii, patch 1). - used gelf_ interfaces to avoid assumptions about 64-bit binaries (Andrii, patch 1) - clarified string matching in symbol table lookups (Andrii, patch 1) - added support for specification of shared object functions in a non-shared object binary. This approach instruments the Procedure Linking Table (PLT) - malloc@PLT. - changed logic in symbol search to check dynamic symbol table first, then fall back to symbol table (Andrii, patch 1). - modified auto-attach string to require "/" separator prior to path prefix i.e. uprobe//path/to/binary (Andrii, patch 2) - modified auto-attach string to use ':' separator (Andrii, patch 2) - modified auto-attach to support raw offset (Andrii, patch 2) - modified skeleton attach to interpret -ESRCH errors as a non-fatal "unable to auto-attach" (Andrii suggested -EOPNOTSUPP but my concern was it might collide with other instances where that value is returned and reflects a failure to attach a to-be-expected attachment rather than skip a program that does not present an auto-attachable section name. Admittedly -EOPNOTSUPP seems a more natural value here). - moved library path retrieval code to trace_helpers (Andrii, patch 3) [1] https://lore.kernel.org/bpf/1647000658-16149-1-git-send-email-alan.maguire@oracle.com/ [2] https://lore.kernel.org/bpf/1643645554-28723-1-git-send-email-alan.maguire@oracle.com/ [3] https://lore.kernel.org/bpf/1642678950-19584-1-git-send-email-alan.maguire@oracle.com/ ==================== Signed-off-by: Andrii Nakryiko commit 579c3196b21800538e0cfd512a05619ee80fb19a Author: Alan Maguire Date: Wed Mar 30 16:26:40 2022 +0100 selftests/bpf: Add tests for uprobe auto-attach via skeleton tests that verify auto-attach works for function entry/return for local functions in program and library functions in a library. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648654000-21758-6-git-send-email-alan.maguire@oracle.com commit ba7499bc9d52f7ea93301a48c05caa370c68b213 Author: Alan Maguire Date: Wed Mar 30 16:26:39 2022 +0100 selftests/bpf: Add tests for u[ret]probe attach by name add tests that verify attaching by name for 1. local functions in a program 2. library functions in a shared object ...succeed for uprobe and uretprobes using new "func_name" option for bpf_program__attach_uprobe_opts(). Also verify auto-attach works where uprobe, path to binary and function name are specified, but fails with -EOPNOTSUPP with a SEC name that does not specify binary path/function. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648654000-21758-5-git-send-email-alan.maguire@oracle.com commit 39f8dc43b7a05ab0e352655a14a9d613c2308b92 Author: Alan Maguire Date: Wed Mar 30 16:26:38 2022 +0100 libbpf: Add auto-attach for uprobes based on section name Now that u[ret]probes can use name-based specification, it makes sense to add support for auto-attach based on SEC() definition. The format proposed is SEC("u[ret]probe/binary:[raw_offset|[function_name[+offset]]") For example, to trace malloc() in libc: SEC("uprobe/libc.so.6:malloc") ...or to trace function foo2 in /usr/bin/foo: SEC("uprobe//usr/bin/foo:foo2") Auto-attach is done for all tasks (pid -1). prog can be an absolute path or simply a program/library name; in the latter case, we use PATH/LD_LIBRARY_PATH to resolve the full path, falling back to standard locations (/usr/bin:/usr/sbin or /usr/lib64:/usr/lib) if the file is not found via environment-variable specified locations. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648654000-21758-4-git-send-email-alan.maguire@oracle.com commit 433966e3ae04165811b116af492a684bad7a158c Author: Alan Maguire Date: Wed Mar 30 16:26:37 2022 +0100 libbpf: Support function name-based attach uprobes kprobe attach is name-based, using lookups of kallsyms to translate a function name to an address. Currently uprobe attach is done via an offset value as described in [1]. Extend uprobe opts for attach to include a function name which can then be converted into a uprobe-friendly offset. The calcualation is done in several steps: 1. First, determine the symbol address using libelf; this gives us the offset as reported by objdump 2. If the function is a shared library function - and the binary provided is a shared library - no further work is required; the address found is the required address 3. Finally, if the function is local, subtract the base address associated with the object, retrieved from ELF program headers. The resultant value is then added to the func_offset value passed in to specify the uprobe attach address. So specifying a func_offset of 0 along with a function name "printf" will attach to printf entry. The modes of operation supported are then 1. to attach to a local function in a binary; function "foo1" in "/usr/bin/foo" 2. to attach to a shared library function in a shared library - function "malloc" in libc. [1] https://www.kernel.org/doc/html/latest/trace/uprobetracer.html Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648654000-21758-3-git-send-email-alan.maguire@oracle.com commit 1ce3a60e3c287479f15147ffc61c35b2e436a0d5 Author: Alan Maguire Date: Wed Mar 30 16:26:36 2022 +0100 libbpf: auto-resolve programs/libraries when necessary for uprobes bpf_program__attach_uprobe_opts() requires a binary_path argument specifying binary to instrument. Supporting simply specifying "libc.so.6" or "foo" should be possible too. Library search checks LD_LIBRARY_PATH, then /usr/lib64, /usr/lib. This allows users to run BPF programs prefixed with LD_LIBRARY_PATH=/path2/lib while still searching standard locations. Similarly for non .so files, we check PATH and /usr/bin, /usr/sbin. Path determination will be useful for auto-attach of BPF uprobe programs using SEC() definition. Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1648654000-21758-2-git-send-email-alan.maguire@oracle.com commit 85bf1f51691c078e77f524a7addf37faa6635a6e Author: Lorenzo Bianconi Date: Wed Mar 16 08:13:23 2022 +0100 samples: bpf: Convert xdp_router_ipv4 to XDP samples helper Rely on the libbpf skeleton facility and other utilities provided by XDP sample helpers in xdp_router_ipv4 sample. Signed-off-by: Lorenzo Bianconi Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/7f4d98ee2c13c04d5eb924eebf79ced32fee8418.1647414711.git.lorenzo@kernel.org commit 66df0fdb5981052f3ad97c9879eda93712bdefc2 Author: Haiyue Wang Date: Sun Apr 3 19:53:26 2022 +0800 bpf: Correct the comment for BTF kind bitfield The commit 8fd886911a6a ("bpf: Add BTF_KIND_FLOAT to uapi") has extended the BTF kind bitfield from 4 to 5 bits, correct the comment. Signed-off-by: Haiyue Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220403115327.205964-1-haiyue.wang@intel.com commit 9bbad6dab8279905c4593be69b06704b77b31403 Author: Yuntao Wang Date: Sun Apr 3 21:52:45 2022 +0800 selftests/bpf: Fix cd_flavor_subdir() of test_progs Currently, when we run test_progs with just executable file name, for example 'PATH=. test_progs-no_alu32', cd_flavor_subdir() will not check if test_progs is running as a flavored test runner and switch into corresponding sub-directory. This will cause test_progs-no_alu32 executed by the 'PATH=. test_progs-no_alu32' command to run in the wrong directory and load the wrong BPF objects. Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220403135245.1713283-1-ytcoode@gmail.com commit f6d60facd9b65614594f1feaa4eee18ac60a9a18 Author: Haowen Bai Date: Fri Apr 1 10:15:54 2022 +0800 selftests/bpf: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./tools/testing/selftests/bpf/progs/test_xdp_noinline.c:567:9-10: WARNING: return of 0/1 in function 'get_packet_dst' with return type bool ./tools/testing/selftests/bpf/progs/test_l4lb_noinline.c:221:9-10: WARNING: return of 0/1 in function 'get_packet_dst' with return type bool Signed-off-by: Haowen Bai Signed-off-by: Andrii Nakryiko Reviewed-by: Shuah Khan Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/1648779354-14700-1-git-send-email-baihaowen@meizu.com commit e299bcd4d16ff86f46c48df1062c8aae0eca1ed8 Author: Nikolay Borisov Date: Thu Mar 31 17:09:49 2022 +0300 selftests/bpf: Fix vfs_link kprobe definition Since commit 6521f8917082 ("namei: prepare for idmapped mounts") vfs_link's prototype was changed, the kprobe definition in profiler selftest in turn wasn't updated. The result is that all argument after the first are now stored in different registers. This means that self-test has been broken ever since. Fix it by updating the kprobe definition accordingly. Signed-off-by: Nikolay Borisov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220331140949.1410056-1-nborisov@suse.com commit 185da3da9379948ffbe45051b16d526c428fb06e Author: Jakob Koschel Date: Thu Mar 31 11:19:29 2022 +0200 bpf: Replace usage of supported 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 the found variable (existed & supported) and simply checking if the variable was set, can determine if the break/goto was hit. [1] https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220331091929.647057-1-jakobkoschel@gmail.com commit ba5f33cccc7586c7b3f87f73b826786d8974a835 Author: Christian König Date: Mon Nov 8 14:03:29 2021 +0100 drm/amdgpu: use dma_resv_get_singleton in amdgpu_pasid_free_cb Makes the code a bit more simpler. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-15-christian.koenig@amd.com commit c382df714a8433dfdd4b84fecc00dc46fc755eb7 Author: Christian König Date: Thu Nov 4 15:18:46 2021 +0100 drm/atomic-helper: support more than one write fence in drm_gem_plane_helper_prepare_fb Use dma_resv_get_singleton() here to eventually get more than one write fence as single fence. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-13-christian.koenig@amd.com commit 644704740b8282c9ee9483a38666ee4a4561c37c Author: Christian König Date: Wed Nov 3 13:22:42 2021 +0100 drm/amdgpu: use dma_resv_for_each_fence for CS workaround v2 Get the write fence using dma_resv_for_each_fence instead of accessing it manually. v2: add TODO comment Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-9-christian.koenig@amd.com commit 9b53fddf3f1e908aab422cd990b5fbb44d2fe33c Author: Christian König Date: Wed Nov 3 11:31:59 2021 +0100 drm/radeon: stop using dma_resv_excl_fence Instead use the new dma_resv_get_singleton function. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-8-christian.koenig@amd.com commit 2029a6d0281c584bd8c92b7c34ae4da10b803b65 Author: Christian König Date: Wed Nov 3 10:40:20 2021 +0100 drm/vmwgfx: stop using dma_resv_excl_fence v2 Instead use the new dma_resv_get_singleton function. v2: drop the TODO comment. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Reviewed-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-7-christian.koenig@amd.com commit 92cedee6a6a3e6fcc3ffc0e3866baae5f6f76ac1 Author: Christian König Date: Wed Nov 3 10:02:08 2021 +0100 dma-buf: add dma_resv_get_singleton v2 Add a function to simplify getting a single fence for all the fences in the dma_resv object. v2: fix ref leak in error handling Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-3-christian.koenig@amd.com commit d791aec9ff43df4ea0a6690eabd6c395e982ef6f Author: Sui Jingfeng <15330273260@189.cn> Date: Sat Apr 2 21:44:13 2022 +0800 drivers/dma-buf: dma-buf.c: fix a typo Signed-off-by: Sui Jingfeng <15330273260@189.cn> Link: https://patchwork.freedesktop.org/patch/msgid/20220402134413.1705246-1-15330273260@189.cn Reviewed-by: Christian König Signed-off-by: Christian König commit 8d5678a76689acbf91245a3791fe853ab773090f Author: Hou Wenlong Date: Tue Mar 15 17:35:13 2022 +0800 KVM: x86/mmu: Don't rebuild page when the page is synced and no tlb flushing is required Before Commit c3e5e415bc1e6 ("KVM: X86: Change kvm_sync_page() to return true when remote flush is needed"), the return value of kvm_sync_page() indicates whether the page is synced, and kvm_mmu_get_page() would rebuild page when the sync fails. But now, kvm_sync_page() returns false when the page is synced and no tlb flushing is required, which leads to rebuild page in kvm_mmu_get_page(). So return the return value of mmu->sync_page() directly and check it in kvm_mmu_get_page(). If the sync fails, the page will be zapped and the invalid_list is not empty, so set flush as true is accepted in mmu_sync_children(). Cc: stable@vger.kernel.org Fixes: c3e5e415bc1e6 ("KVM: X86: Change kvm_sync_page() to return true when remote flush is needed") Signed-off-by: Hou Wenlong Acked-by: Lai Jiangshan Message-Id: <0dabeeb789f57b0d793f85d073893063e692032d.1647336064.git.houwenlong.hwl@antgroup.com> [mmu_sync_children should not flush if the page is zapped. - Paolo] Signed-off-by: Paolo Bonzini commit 945024d764a18b1484428f0055439072ea58e349 Author: Jon Kohler Date: Wed Mar 23 20:44:39 2022 -0400 KVM: x86: optimize PKU branching in kvm_load_{guest|host}_xsave_state kvm_load_{guest|host}_xsave_state handles xsave on vm entry and exit, part of which is managing memory protection key state. The latest arch.pkru is updated with a rdpkru, and if that doesn't match the base host_pkru (which about 70% of the time), we issue a __write_pkru. To improve performance, implement the following optimizations: 1. Reorder if conditions prior to wrpkru in both kvm_load_{guest|host}_xsave_state. Flip the ordering of the || condition so that XFEATURE_MASK_PKRU is checked first, which when instrumented in our environment appeared to be always true and less overall work than kvm_read_cr4_bits. For kvm_load_guest_xsave_state, hoist arch.pkru != host_pkru ahead one position. When instrumented, I saw this be true roughly ~70% of the time vs the other conditions which were almost always true. With this change, we will avoid 3rd condition check ~30% of the time. 2. Wrap PKU sections with CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS, as if the user compiles out this feature, we should not have these branches at all. Signed-off-by: Jon Kohler Message-Id: <20220324004439.6709-1-jon@nutanix.com> Signed-off-by: Paolo Bonzini commit f44509f849fe55bbd81bd3f099b9aecd19002243 Author: Maxim Levitsky Date: Tue Mar 22 19:40:50 2022 +0200 KVM: x86: SVM: allow AVIC to co-exist with a nested guest running Inhibit the AVIC of the vCPU that is running nested for the duration of the nested run, so that all interrupts arriving from both its vCPU siblings and from KVM are delivered using normal IPIs and cause that vCPU to vmexit. Note that unlike normal AVIC inhibition, there is no need to update the AVIC mmio memslot, because the nested guest uses its own set of paging tables. That also means that AVIC doesn't need to be inhibited VM wide. Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit d5fa597ed87047117dc62ce1d38ba1d007442359 Author: Maxim Levitsky Date: Tue Mar 22 19:40:49 2022 +0200 KVM: x86: allow per cpu apicv inhibit reasons Add optional callback .vcpu_get_apicv_inhibit_reasons returning extra inhibit reasons that prevent APICv from working on this vCPU. Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 0b349662184ba76b335af84579f3ed50baf54607 Author: Maxim Levitsky Date: Tue Mar 22 19:40:48 2022 +0200 KVM: x86: nSVM: implement nested vGIF In case L1 enables vGIF for L2, the L2 cannot affect L1's GIF, regardless of STGI/CLGI intercepts, and since VM entry enables GIF, this means that L1's GIF is always 1 while L2 is running. Thus in this case leave L1's vGIF in vmcb01, while letting L2 control the vGIF thus implementing nested vGIF. Also allow KVM to toggle L1's GIF during nested entry/exit by always using vmcb01. Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 74fd41ed16fd71725e69e2cb90b755505326c2e6 Author: Maxim Levitsky Date: Tue Mar 22 19:40:47 2022 +0200 KVM: x86: nSVM: support PAUSE filtering when L0 doesn't intercept PAUSE Expose the pause filtering and threshold in the guest CPUID and support PAUSE filtering when possible: - If the L0 doesn't intercept PAUSE (cpu_pm=on), then allow L1 to have full control over PAUSE filtering. - if the L1 doesn't intercept PAUSE, use host values and update the adaptive count/threshold even when running nested. - Otherwise always exit to L1; it is not really possible to merge the fields correctly. It is expected that in this case, userspace will not enable this feature in the guest CPUID, to avoid having the guest update both fields pointlessly. Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit d20c796ca3709801f8a7fa36e8770a3dd8ebd34e Author: Maxim Levitsky Date: Tue Mar 22 19:40:46 2022 +0200 KVM: x86: nSVM: implement nested LBR virtualization This was tested with kvm-unit-test that was developed for this purpose. Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-3-mlevitsk@redhat.com> [Copy all of DEBUGCTL except for reserved bits. - Paolo] Signed-off-by: Paolo Bonzini commit 1d5a1b5860ed6f623071329112e5935db043eb55 Author: Maxim Levitsky Date: Tue Mar 22 19:40:45 2022 +0200 KVM: x86: nSVM: correctly virtualize LBR msrs when L2 is running When L2 is running without LBR virtualization, we should ensure that L1's LBR msrs continue to update as usual. Signed-off-by: Maxim Levitsky Message-Id: <20220322174050.241850-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit ea91559b005443ddd9ea180ffdec4b4fda21d477 Author: Maxim Levitsky Date: Tue Mar 22 19:24:49 2022 +0200 KVM: x86: SVM: remove vgif_enabled() KVM always uses vgif when allowed, thus there is no need to query current vmcb for it Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit db663af4a0012a1ab0f966621a62617ce5907b35 Author: Maxim Levitsky Date: Tue Mar 22 19:24:44 2022 +0200 kvm: x86: SVM: use vmcb* instead of svm->vmcb where it makes sense This makes the code a bit shorter and cleaner. No functional change intended. Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 1ee73a332f80ddb05b9becde53a644d6efc666c7 Author: Maxim Levitsky Date: Tue Mar 22 18:24:43 2022 +0100 KVM: x86: SVM: use vmcb01 in init_vmcb Clarify that this function is not used to initialize any part of the vmcb02. No functional change intended. Signed-off-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit d063de55f4799261858676d5cfa49a1612cd57ea Author: Li RongQing Date: Wed Mar 9 16:46:50 2022 +0800 KVM: x86: Support the vCPU preemption check with nopvspin and realtime hint If guest kernel is configured with nopvspin, or CONFIG_PARAVIRT_SPINLOCK is disabled, or guest find its has dedicated pCPUs from realtime hint feature, the pvspinlock will be disabled, and vCPU preemption check is disabled too. Hoever, KVM still can emulating HLT for vCPU for both cases. Checking if a vCPU is preempted or not can still boost performance in IPI-heavy scenarios such as unixbench file copy and pipe-based context switching tests: Here the vCPU is running with a dedicated pCPU, so the guest kernel has nopvspin but is emulating HLT for the vCPU: Testcase Base with patch System Benchmarks Index Values INDEX INDEX Dhrystone 2 using register variables 3278.4 3277.7 Double-Precision Whetstone 822.8 825.8 Execl Throughput 1296.5 941.1 File Copy 1024 bufsize 2000 maxblocks 2124.2 2142.7 File Copy 256 bufsize 500 maxblocks 1335.9 1353.6 File Copy 4096 bufsize 8000 maxblocks 4256.3 4760.3 Pipe Throughput 1050.1 1054.0 Pipe-based Context Switching 243.3 352.0 Process Creation 820.1 814.4 Shell Scripts (1 concurrent) 2169.0 2086.0 Shell Scripts (8 concurrent) 7710.3 7576.3 System Call Overhead 672.4 673.9 ======== ======= System Benchmarks Index Score 1467.2 1483.0 Move the setting of pv_ops.lock.vcpu_is_preempted to kvm_guest_init, so that it does not depend on pvspinlock. Signed-off-by: Li RongQing Message-Id: <1646815610-43315-1-git-send-email-lirongqing@baidu.com> Signed-off-by: Paolo Bonzini commit e467b0de82b260a4ee2c3ea53ef76ac40259498f Author: David Woodhouse Date: Fri Feb 25 14:53:04 2022 +0000 KVM: x86: Test case for TSC scaling and offset sync Signed-off-by: David Woodhouse Message-Id: <20220225145304.36166-4-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 741e511b42086a100c05dbe8fd1baeec42e7c584 Author: Sean Christopherson Date: Fri Feb 25 14:53:03 2022 +0000 KVM: x86: Don't snapshot "max" TSC if host TSC is constant Don't snapshot tsc_khz into max_tsc_khz during KVM initialization if the host TSC is constant, in which case the actual TSC frequency will never change and thus capturing the "max" TSC during initialization is unnecessary, KVM can simply use tsc_khz during VM creation. On CPUs with constant TSC, but not a hardware-specified TSC frequency, snapshotting max_tsc_khz and using that to set a VM's default TSC frequency can lead to KVM thinking it needs to manually scale the guest's TSC if refining the TSC completes after KVM snapshots tsc_khz. The actual frequency never changes, only the kernel's calculation of what that frequency is changes. On systems without hardware TSC scaling, this either puts KVM into "always catchup" mode (extremely inefficient), or prevents creating VMs altogether. Ideally, KVM would not be able to race with TSC refinement, or would have a hook into tsc_refine_calibration_work() to get an alert when refinement is complete. Avoiding the race altogether isn't practical as refinement takes a relative eternity; it's deliberately put on a work queue outside of the normal boot sequence to avoid unnecessarily delaying boot. Adding a hook is doable, but somewhat gross due to KVM's ability to be built as a module. And if the TSC is constant, which is likely the case for every VMX/SVM-capable CPU produced in the last decade, the race can be hit if and only if userspace is able to create a VM before TSC refinement completes; refinement is slow, but not that slow. For now, punt on a proper fix, as not taking a snapshot can help some uses cases and not taking a snapshot is arguably correct irrespective of the race with refinement. [ dwmw2: Rebase on top of KVM-wide default_tsc_khz to ensure that all vCPUs get the same frequency even if we hit the race. ] Cc: Suleiman Souhlal Cc: Anton Romanov Signed-off-by: Sean Christopherson Signed-off-by: David Woodhouse Message-Id: <20220225145304.36166-3-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit ffbb61d09fc56c85e28b110494f3788d0ed4d1f8 Author: David Woodhouse Date: Fri Feb 25 14:53:02 2022 +0000 KVM: x86: Accept KVM_[GS]ET_TSC_KHZ as a VM ioctl. This sets the default TSC frequency for subsequently created vCPUs. Signed-off-by: David Woodhouse Message-Id: <20220225145304.36166-2-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit fe3787a0d14920fa98c38a21431001c9d4edfe93 Author: Like Xu Date: Tue Mar 1 20:02:17 2022 +0800 KVM: x86/i8259: Remove a dead store of irq in a conditional block The [clang-analyzer-deadcode.DeadStores] helper reports that the value stored to 'irq' is never read. Signed-off-by: Like Xu Message-Id: <20220301120217.38092-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 1421211ae1de8cc547753080e9c9ffae8b67790f Author: Zeng Guang Date: Tue Mar 15 22:58:36 2022 +0800 KVM: VMX: Prepare VMCS setting for posted interrupt enabling when APICv is available Currently KVM setup posted interrupt VMCS only depending on per-vcpu APICv activation status at the vCPU creation time. However, this status can be toggled dynamically under some circumstance. So potentially, later posted interrupt enabling may be problematic without VMCS readiness. To fix this, always settle the VMCS setting for posted interrupt as long as APICv is available and lapic locates in kernel. Signed-off-by: Zeng Guang Message-Id: <20220315145836.9910-1-guang.zeng@intel.com> Signed-off-by: Paolo Bonzini commit a29833e36b43b326e6371c181474119069d6073a Author: David Woodhouse Date: Wed Mar 9 14:38:35 2022 +0000 KVM: x86/xen: Update self test for Xen PV timers Add test cases for timers in the past, and reading the status of a timer which has already fired. Signed-off-by: David Woodhouse Message-Id: <20220309143835.253911-3-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 25eaeebe710c8c3aa588ee0830155fefb2548c28 Author: David Woodhouse Date: Thu Mar 3 15:41:27 2022 +0000 KVM: x86/xen: Add self tests for KVM_XEN_HVM_CONFIG_EVTCHN_SEND Test a combination of event channel send, poll and timer operations. Signed-off-by: David Woodhouse Message-Id: <20220303154127.202856-18-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 1a65105a5aba9f7c6ea68cf687e569d055a94685 Author: Boris Ostrovsky Date: Thu Mar 3 15:41:26 2022 +0000 KVM: x86/xen: handle PV spinlocks slowpath Add support for SCHEDOP_poll hypercall. This implementation is optimized for polling for a single channel, which is what Linux does. Polling for multiple channels is not especially efficient (and has not been tested). PV spinlocks slow path uses this hypercall, and explicitly crash if it's not supported. [ dwmw2: Rework to use kvm_vcpu_halt(), not supported for 32-bit guests ] Signed-off-by: Boris Ostrovsky Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-17-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 661a20fab7d156cf6b9a407c946a1e558a633151 Author: David Woodhouse Date: Thu Mar 3 15:41:25 2022 +0000 KVM: x86/xen: Advertise and document KVM_XEN_HVM_CONFIG_EVTCHN_SEND At the end of the patch series adding this batch of event channel acceleration features, finally add the feature bit which advertises them and document it all. For SCHEDOP_poll we need to wake a polling vCPU when a given port is triggered, even when it's masked — and we want to implement that in the kernel, for efficiency. So we want the kernel to know that it has sole ownership of event channel delivery. Thus, we allow userspace to make the 'promise' by setting the corresponding feature bit in its KVM_XEN_HVM_CONFIG call. As we implement SCHEDOP_poll bypass later, we will do so only if that promise has been made by userspace. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-16-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit fde0451be8fb3208d4d146b8602d99ee8139e515 Author: David Woodhouse Date: Thu Mar 3 15:41:24 2022 +0000 KVM: x86/xen: Support per-vCPU event channel upcall via local APIC Windows uses a per-vCPU vector, and it's delivered via the local APIC basically like an MSI (with associated EOI) unlike the traditional guest-wide vector which is just magically asserted by Xen (and in the KVM case by kvm_xen_has_interrupt() / kvm_cpu_get_extint()). Now that the kernel is able to raise event channel events for itself, being able to do so for Windows guests is also going to be useful. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-15-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 28d1629f751c4a5f9437fbaa0ee4ed81d1a8e587 Author: David Woodhouse Date: Thu Mar 3 15:41:23 2022 +0000 KVM: x86/xen: Kernel acceleration for XENVER_version Turns out this is a fast path for PV guests because they use it to trigger the event channel upcall. So letting it bounce all the way up to userspace is not great. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-14-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 536395260582be7443b0b35b0bbb89ffe3947f62 Author: Joao Martins Date: Thu Mar 3 15:41:22 2022 +0000 KVM: x86/xen: handle PV timers oneshot mode If the guest has offloaded the timer virq, handle the following hypercalls for programming the timer: VCPUOP_set_singleshot_timer VCPUOP_stop_singleshot_timer set_timer_op(timestamp_ns) The event channel corresponding to the timer virq is then used to inject events once timer deadlines are met. For now we back the PV timer with hrtimer. [ dwmw2: Add save/restore, 32-bit compat mode, immediate delivery, don't check timer in kvm_vcpu_has_event() ] Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-13-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 942c2490c23f2800ad8143f5eb84a79b859aa743 Author: David Woodhouse Date: Thu Mar 3 15:41:21 2022 +0000 KVM: x86/xen: Add KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID In order to intercept hypercalls such as VCPUOP_set_singleshot_timer, we need to be aware of the Xen CPU numbering. This looks a lot like the Hyper-V handling of vpidx, for obvious reasons. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-12-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 0ec6c5c5bb6585320a2e51a316c2fd381fdec836 Author: Joao Martins Date: Thu Mar 3 15:41:20 2022 +0000 KVM: x86/xen: handle PV IPI vcpu yield Cooperative Linux guests after an IPI-many may yield vcpu if any of the IPI'd vcpus were preempted (i.e. runstate is 'runnable'.) Support SCHEDOP_yield for handling yield. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-11-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 2fd6df2f2b47d4301b1ee0fe9d627d1c061a5988 Author: Joao Martins Date: Thu Mar 3 15:41:19 2022 +0000 KVM: x86/xen: intercept EVTCHNOP_send from guests Userspace registers a sending @port to either deliver to an @eventfd or directly back to a local event channel port. After binding events the guest or host may wish to bind those events to a particular vcpu. This is usually done for unbound and and interdomain events. Update requests are handled via the KVM_XEN_EVTCHN_UPDATE flag. Unregistered ports are handled by the emulator. Co-developed-by: Ankur Arora Co-developed-By: David Woodhouse Signed-off-by: Joao Martins Signed-off-by: Ankur Arora Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-10-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 35025735a79eaa894c43837b94fd33c9d6b122df Author: David Woodhouse Date: Thu Mar 3 15:41:18 2022 +0000 KVM: x86/xen: Support direct injection of event channel events This adds a KVM_XEN_HVM_EVTCHN_SEND ioctl which allows direct injection of events given an explicit { vcpu, port, priority } in precisely the same form that those fields are given in the IRQ routing table. Userspace is currently able to inject 2-level events purely by setting the bits in the shared_info and vcpu_info, but FIFO event channels are harder to deal with; we will need the kernel to take sole ownership of delivery when we support those. A patch advertising this feature with a new bit in the KVM_CAP_XEN_HVM ioctl will be added in a subsequent patch. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-9-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 8733068b9bdbc7a54f02dcc59eb0e4789cd60942 Author: David Woodhouse Date: Thu Mar 3 15:41:17 2022 +0000 KVM: x86/xen: Make kvm_xen_set_evtchn() reusable from other places Clean it up to return -errno on error consistently, while still being compatible with the return conventions for kvm_arch_set_irq_inatomic() and the kvm_set_irq() callback. We use -ENOTCONN to indicate when the port is masked. No existing users care, except that it's negative. Also allow it to optimise the vCPU lookup. Unless we abuse the lapic map, there is no quick lookup from APIC ID to a vCPU; the logic in kvm_get_vcpu_by_id() will just iterate over all vCPUs till it finds the one it wants. So do that just once and stash the result in the struct kvm_xen_evtchn for next time. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-8-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 69d413cfcf77920bb4d7c4bbfbf305781fa53a0e Author: David Woodhouse Date: Thu Mar 3 15:41:16 2022 +0000 KVM: x86/xen: Use gfn_to_pfn_cache for vcpu_time_info This switches the final pvclock to kvm_setup_pvclock_pfncache() and now the old kvm_setup_pvclock_page() can be removed. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-7-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 7caf9571563eade546976d600dd023674b1c3185 Author: David Woodhouse Date: Thu Mar 3 15:41:15 2022 +0000 KVM: x86/xen: Use gfn_to_pfn_cache for vcpu_info Currently, the fast path of kvm_xen_set_evtchn_fast() doesn't set the index bits in the target vCPU's evtchn_pending_sel, because it only has a userspace virtual address with which to do so. It just sets them in the kernel, and kvm_xen_has_interrupt() then completes the delivery to the actual vcpu_info structure when the vCPU runs. Using a gfn_to_pfn_cache allows kvm_xen_set_evtchn_fast() to do the full delivery in the common case. Clean up the fallback case too, by moving the deferred delivery out into a separate kvm_xen_inject_pending_events() function which isn't ever called in atomic contexts as __kvm_xen_has_interrupt() is. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-6-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 916d3608df8265a2e3f6214200dbb0b39a5ca383 Author: David Woodhouse Date: Thu Mar 3 15:41:14 2022 +0000 KVM: x86: Use gfn_to_pfn_cache for pv_time Add a new kvm_setup_guest_pvclock() which parallels the existing kvm_setup_pvclock_page(). The latter will be removed once we convert all users to the gfn_to_pfn_cache version. Using the new cache, we can potentially let kvm_set_guest_paused() set the PVCLOCK_GUEST_STOPPED bit directly rather than having to delegate to the vCPU via KVM_REQ_CLOCK_UPDATE. But not yet. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-5-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit a795cd43c5b5819b8ee94690f22caa5e2e4d8620 Author: David Woodhouse Date: Thu Mar 3 15:41:13 2022 +0000 KVM: x86/xen: Use gfn_to_pfn_cache for runstate area Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-4-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 249f32493304e2ab04ed53cc634909629b8dc4c6 Author: Maxim Levitsky Date: Tue Mar 1 15:55:23 2022 +0200 KVM: x86: mark synthetic SMM vmexit as SVM_EXIT_SW Use a dummy unused vmexit reason to mark the 'VM exit' that is happening when kvm exits to handle SMM, which is not a real VM exit. This makes it a bit easier to read the KVM trace, and avoids other potential problems due to a stale vmexit reason in the vmcb. If SVM_EXIT_SW somehow reaches svm_invoke_exit_handler(), instead, svm_check_exit_valid() will return false and a WARN will be logged. Signed-off-by: Maxim Levitsky Message-Id: <20220301135526.136554-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit edf721238576544ed8daf9943ab398bb27da8e6b Author: Maxim Levitsky Date: Tue Mar 1 16:36:49 2022 +0200 KVM: x86: SVM: allow to force AVIC to be enabled Apparently on some systems AVIC is disabled in CPUID but still usable. Allow the user to override the CPUID if the user is willing to take the risk. Signed-off-by: Maxim Levitsky Message-Id: <20220301143650.143749-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit b9f3973ab3a80141a6decc34f4740e6494ca7d51 Author: Maxim Levitsky Date: Tue Mar 1 16:36:46 2022 +0200 KVM: x86: nSVM: implement nested VMLOAD/VMSAVE This was tested by booting L1,L2,L3 (all Linux) and checking that no VMLOAD/VMSAVE vmexits happened. Signed-off-by: Maxim Levitsky Message-Id: <20220301143650.143749-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 6c2fa8b20d0cad3719b024ba0f25a50199a90c9a Author: Oliver Upton Date: Wed Mar 16 00:55:38 2022 +0000 selftests: KVM: Test KVM_X86_QUIRK_FIX_HYPERCALL_INSN Add a test that asserts KVM rewrites guest hypercall instructions to match the running architecture (VMCALL on VMX, VMMCALL on SVM). Additionally, test that with the quirk disabled, KVM no longer rewrites guest instructions and instead injects a #UD. Signed-off-by: Oliver Upton Message-Id: <20220316005538.2282772-3-oupton@google.com> Signed-off-by: Paolo Bonzini commit f1a9761fbb00639c5e73835f7f373ef834bb867f Author: Oliver Upton Date: Wed Mar 16 00:55:37 2022 +0000 KVM: x86: Allow userspace to opt out of hypercall patching KVM handles the VMCALL/VMMCALL instructions very strangely. Even though both of these instructions really should #UD when executed on the wrong vendor's hardware (i.e. VMCALL on SVM, VMMCALL on VMX), KVM replaces the guest's instruction with the appropriate instruction for the vendor. Nonetheless, older guest kernels without commit c1118b3602c2 ("x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only") do not patch in the appropriate instruction using alternatives, likely motivating KVM's intervention. Add a quirk allowing userspace to opt out of hypercall patching. If the quirk is disabled, KVM synthesizes a #UD in the guest. Signed-off-by: Oliver Upton Message-Id: <20220316005538.2282772-2-oupton@google.com> Signed-off-by: Paolo Bonzini commit e36764ecf87cb86051f26cc8e5a9a665784a9f39 Author: Ramalingam C Date: Fri Apr 1 18:07:49 2022 +0530 drm/ttm: Add a parameter to add extra pages into ttm_tt Add a parameter called "extra_pages" for ttm_tt_init, to indicate that driver needs extra pages in ttm_tt. v2: Used imperative wording [Thomas and Christian] Signed-off-by: Ramalingam C cc: Christian Koenig cc: Hellstrom Thomas Reviewed-by: Thomas Hellstrom Reviewed-by: Christian Konig Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220401123751.27771-8-ramalingam.c@intel.com commit 891663ace74c23321a40f4bae13e45a1803d5e20 Author: Yauheni Kaliuta Date: Tue Mar 29 11:11:00 2022 +0300 bpf, test_offload.py: Skip base maps without names The test fails: # ./test_offload.py [...] Test bpftool bound info reporting (own ns)... FAIL: 3 BPF maps loaded, expected 2 File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 1177, in check_dev_info(False, "") File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 645, in check_dev_info maps = bpftool_map_list(expected=2, ns=ns) File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 190, in bpftool_map_list fail(True, "%d BPF maps loaded, expected %d" % File "/root/bpf-next/tools/testing/selftests/bpf/./test_offload.py", line 86, in fail tb = "".join(traceback.extract_stack().format()) Some base maps do not have names and they cannot be added due to compatibility with older kernels, see [0]. So, just skip the unnamed maps. [0] https://lore.kernel.org/bpf/CAEf4BzY66WPKQbDe74AKZ6nFtZjq5e+G3Ji2egcVytB9R6_sGQ@mail.gmail.com/ Signed-off-by: Yauheni Kaliuta Signed-off-by: Daniel Borkmann Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220329081100.9705-1-ykaliuta@redhat.com commit 8eb943fc5e5fa62751248302fe8f6c9856d81c09 Author: Yuntao Wang Date: Wed Mar 23 15:36:26 2022 +0800 bpf: Remove redundant assignment to smap->map.value_size The attr->value_size is already assigned to smap->map.value_size in bpf_map_init_from_attr(), there is no need to do it again in stack_map_alloc(). Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Acked-by: Joanne Koong Link: https://lore.kernel.org/bpf/20220323073626.958652-1-ytcoode@gmail.com commit fe4625d8b0536c0098845065a6bb3fdeaa6ad940 Author: Eyal Birger Date: Tue Mar 29 18:49:14 2022 +0300 selftests/bpf: Remove unused variable from bpf_sk_assign test Was never used in bpf_sk_assign_test(), and was removed from handle_{tcp,udp}() in commit 0b9ad56b1ea6 ("selftests/bpf: Use SOCKMAP for server sockets in bpf_sk_assign test"). Fixes: 0b9ad56b1ea6 ("selftests/bpf: Use SOCKMAP for server sockets in bpf_sk_assign test") Signed-off-by: Eyal Birger Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220329154914.3718658-1-eyal.birger@gmail.com commit 11e17ae423778f48c84da6a2e215f140610e1973 Author: Jiapeng Chong Date: Tue Mar 22 14:21:49 2022 +0800 bpf: Use swap() instead of open coding it Clean the following coccicheck warning: ./kernel/trace/bpf_trace.c:2263:34-35: WARNING opportunity for swap(). ./kernel/trace/bpf_trace.c:2264:40-41: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220322062149.109180-1-jiapeng.chong@linux.alibaba.com commit ab0609a5fb301b035702171c04b3ee532682b726 Author: Jani Nikula Date: Thu Mar 31 21:45:09 2022 +0300 drm/edid: reduce magic when updating the EDID block checksum The code modifying the EDID block should not need to do tricks to fix the checksum. We have a function for computing the checksum, use it. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/5a11435419d804a58ef356c0b9acf445cffc1354.1648752228.git.jani.nikula@intel.com commit ccc97def44ecc087b7c8018f3765467851cd8c80 Author: Jani Nikula Date: Thu Mar 31 21:45:08 2022 +0300 drm/edid: track invalid blocks in drm_do_get_edid() Track invalid blocks instead of valid extensions to minimize impact on the happy day scenario, and hide the details in the separate function. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/6215f85b01c579a44c66129d2b5f41e1ab9294de.1648752228.git.jani.nikula@intel.com commit 4ec53461d69010b7b5d39fdc558e9c3044418288 Author: Jani Nikula Date: Thu Mar 31 21:45:07 2022 +0300 drm/edid: split out invalid block filtering to a separate function It's such a special case there's no point in keeping it inline in the happy day scenario, confusing matters. v2: Rebase on the invalid block filtering fix Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/ea8ccd654b5beca6ccf99666754aea09c836b6a5.1648752228.git.jani.nikula@intel.com commit 23e38d7b48fda3730fe0a7ebc9293dd2810b49d7 Author: Jani Nikula Date: Thu Mar 31 21:45:06 2022 +0300 drm/edid: simplify block check when filtering invalid blocks There's no need to handle complicated scenarios or debug log when filtering blocks that have already been identified as invalid. Simplify by adding an edid_block_valid() helper that operates on const data and prints nothing. (Finally, here's the justification for the previously added separate edid_block_status_valid() function!) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/aa25131c3454c7dbc1e8fdb46549f3787bdf6354.1648752228.git.jani.nikula@intel.com commit 18d83450468ca57b66c754ec1ec455d5cc853ab4 Author: Jani Nikula Date: Thu Mar 31 21:45:05 2022 +0300 drm/edid: use a better variable name for EDID block read retries Just i is a bit terse, clarify what it's about. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/9c95c01445f5735332cbbd9eae6cd078e152050f.1648752228.git.jani.nikula@intel.com commit 1f221284ab631d6136ce773ba360b7d3d5d40a81 Author: Jani Nikula Date: Thu Mar 31 21:45:04 2022 +0300 drm/edid: split drm_edid_block_valid() to check and act parts Add edid_block_check() that only checks the EDID block validity, without any actions. Turns out it's simple and crystal clear. Rewrite drm_edid_block_valid() around it, keeping all the functionality fairly closely the same, warts and all. Turns out it's incredibly complicated for a function you'd expect to be simple, with all the fixing and printing and special casing. (Maybe we'll want to simplify it in the future.) To slightly simplify, drop the warning for EDID minor revisions > 4. v2: - Fix edid_fixup clamp (Ville) - s/base/is_base_block/ (Ville) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/b7d108b69acccb7dccbdecc0ca06c2b3ca2e33ca.1648752228.git.jani.nikula@intel.com commit 0a612bbd91bc35391c4b0dac3b6d2200f70f7196 Author: Jani Nikula Date: Thu Mar 31 21:45:03 2022 +0300 drm/edid: split out edid_header_fix() Give a name to the EDID header fixup instead of having an inline memcpy. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/c10c24b179e942548cd5d693d159bb0d12be4d26.1648752228.git.jani.nikula@intel.com commit aa6292a3802215b28e696d6d2c74efb41c09c442 Author: Jani Nikula Date: Thu Mar 31 21:45:02 2022 +0300 drm/edid: clean up edid_is_zero() Simplify, rename, take void pointer. No need for the drm_ prefix for internal helpers. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/15220580f07b63c92a3e448347cf59b297990407.1648752228.git.jani.nikula@intel.com commit 6d987ddd68434bf60650dfdd05343d642643ee44 Author: Jani Nikula Date: Thu Mar 31 21:45:01 2022 +0300 drm/edid: make drm_edid_header_is_valid() accept void pointer It will be useful to accept a struct edid *, but for compatibility with existing usage accept void *. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/33fbe1615a3bd82112eaf4077bbb521793cbb91a.1648752228.git.jani.nikula@intel.com commit 4ba0f53ce685b0dcfc932342e0de85707747ea7e Author: Jani Nikula Date: Thu Mar 31 21:45:00 2022 +0300 drm/edid: add edid_block_tag() helper to get the EDID extension tag The extension tag at offset 0 is not present in struct edid, add a helper for it to reduce the need to use u8 *. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/3f27c67db63c186a48e83fdee2d1ac8a17714e78.1648752228.git.jani.nikula@intel.com commit 70e49ebe90033ae69831b311bd6cd0ad267ebec9 Author: Jani Nikula Date: Thu Mar 31 21:44:59 2022 +0300 drm/edid: clean up EDID block checksum functions Have two clear functions, one to compute the checksum over the EDID, and another to get the checksum from the EDID. Throw away the diff function. Ditch the drm_ prefix for static functions, and accept const void * to help transition to struct edid * usage. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/36641401c8eb0e403c0e33365ff4ad9a28f9fd4a.1648752228.git.jani.nikula@intel.com commit e9a9e0768ba49d9cad3b698860af1842c53c717f Author: Jani Nikula Date: Thu Mar 31 21:44:58 2022 +0300 drm/edid: use struct edid * in drm_do_get_edid() Mixing u8 * and struct edid * is confusing, switch to the latter. v2: - Rebase on the invalid block filtering fix - Rename struct edid *base to *dest_block for clarity (Ville) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/18bf820c1d20e616076b3275627e7ebf01bce7a3.1648752228.git.jani.nikula@intel.com commit e11da6799fe0b1e49668cec68ab646b46712c57c Author: Chris Down Date: Wed Mar 30 15:32:20 2022 +0100 MAINTAINERS: Add printk indexing maintainers on mention of printk_index This will primarily catch new and changed printk_index_subsys_emit calls, but it's also worth catching changes to other printk indexing infrastructure outside of kernel/printk/index.c. This avoids churn due to missing ccs when adding new printk indexes, as was the case recently for the first round of the XFS printk indexing patches. Signed-off-by: Chris Down Cc: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/YkRp9IhToTmTnkl7@chrisdown.name commit 9149a94adad204a1301b55bd49ea1c12c179d144 Author: Benjamin Stürz Date: Mon Mar 28 23:29:12 2022 +0200 wcn36xx: Improve readability of wcn36xx_caps_name Use macros to force strict ordering of the elements. Signed-off-by: Benjamin Stürz Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328212912.283393-1-benni@stuerz.xyz commit 7c45823064122e8bdc97972e9861ea03b086d0ab Author: Wenli Looi Date: Fri Mar 25 23:47:55 2022 -0600 ath9k: make is2ghz consistent in ar9003_eeprom Replace a "mode" variable indicating "is 5ghz" with an "is2ghz" variable to make it consistent with other functions in the file. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220326054754.27812-1-wlooi@ucalgary.ca commit d930e2560ebee73411cfa5d5b0de4e82254c33e9 Author: Erik Stromdahl Date: Wed Mar 30 11:11:49 2022 +0300 ath10k: enable napi on RX path for usb commit cfee8793a74dc3afabb08fc9 ("ath10k: enable napi on RX path for sdio") introduced napi for SDIO and updated the htt interface for high latency devices. These changes breaks USB, so USB code must be updated to use napi as well in order to have a working RX path. Tested-on: QCA9377 hw1.0 USB 1.0.0.299 Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220327171340.7893-2-erik.stromdahl@gmail.com commit 2c977be2cc5cd4743d2f223360e685d91f0cdffc Author: Erik Stromdahl Date: Wed Mar 30 11:11:49 2022 +0300 ath10k: add support for MSDU IDs for USB devices commit 93bbdec6683e1c8ba2cc4e6 ("ath10k: htt: support MSDU ids with SDIO") introduced MSDU ID allocation in the htt TX path for high latency devices. This feature needs to be enabled for USB as well in order to have a functional TX path. Tested-on: QCA9377 hw1.0 USB 1.0.0.299 Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220327171340.7893-1-erik.stromdahl@gmail.com commit 15325e3c1013035c2e3e266ba79a0c3bef905f25 Author: Christian König Date: Thu Nov 11 15:18:34 2021 +0100 dma-buf: drop the DAG approach for the dma_resv object v3 So far we had the approach of using a directed acyclic graph with the dma_resv obj. This turned out to have many downsides, especially it means that every single driver and user of this interface needs to be aware of this restriction when adding fences. If the rules for the DAG are not followed then we end up with potential hard to debug memory corruption, information leaks or even elephant big security holes because we allow userspace to access freed up memory. Since we already took a step back from that by always looking at all fences we now go a step further and stop dropping the shared fences when a new exclusive one is added. v2: Drop some now superflous documentation v3: Add some more documentation for the new handling. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-11-christian.koenig@amd.com commit e45422695c196dbc665a95526c85ff4b8752aff2 Author: Lee Jones Date: Thu Mar 31 13:21:17 2022 +0100 drm/amdkfd: Create file descriptor after client is added to smi_clients list This ensures userspace cannot prematurely clean-up the client before it is fully initialised which has been proven to cause issues in the past. Cc: Felix Kuehling 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 Signed-off-by: Lee Jones Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit cf8cc382aa7c60f25386a8515b6a5e74aef9d0aa Author: Ma Jun Date: Wed Mar 23 21:16:19 2022 +0800 drm/amdgpu: Sync up header and implementation to use the same parameter names Sync up header and implementation to use the same parameter names in function amdgpu_ring_init. ring_size -> max_dw, prio -> hw_prio Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Ma Jun Signed-off-by: Alex Deucher commit 058497e1f596985dd21910eae7b4a2b39f94ef23 Author: Ruili Ji Date: Thu Mar 31 12:19:00 2022 +0800 drm/amdgpu: fix incorrect GCR_GENERAL_CNTL address gfx10.3.3/gfx10.3.6/gfx10.3.7 shall use 0x1580 address for GCR_GENERAL_CNTL Acked-by: Prike Liang Acked-by: Yifan Zhang Reviewed-by: Aaron Liu Signed-off-by: Ruili Ji Signed-off-by: Alex Deucher commit 5e9c445172fde2ee761af91ad302e41041de6be8 Author: Kent Russell Date: Wed Mar 30 09:27:41 2022 -0400 drm/amdgpu: Fix unique_id references for Sienna Cichlid Since unique_id is only supported in PMFW 0x3A5300 and higher, we will only be able to use it inside Smu_Metrics_V3_t, which requires PMFW 0x3A4900 and higher. Remove the unique_id/serial_number references from the v1 and v2 tables to avoid any confusion, and return 0 if metrics_v1 or metrics_v2 are used to try to get the unique_id/serial_number. Signed-off-by: Kent Russell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 9696679bf7ac40a8fb6a488a75bd66d4414cd3c3 Author: Melissa Wen Date: Sat Mar 26 19:24:48 2022 -0100 drm/amd/display: remove DC_FP_* wrapper from dml folder FPU documentation states that developers must not use DC_FP_START/END inside dml files, but use this macro to wrap calls to FPU functions in dc folder (outside dml folder). Therefore, this patch removes DC_FP_* wrappers from dml folder and wraps calls for these FPU operations outside dml, as required. Acked-by: Christian König Reviewed-by: Rodrigo Siqueira Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 851c5f242a03d7e9b00d2d1537d959e54fa101e8 Author: Melissa Wen Date: Sat Mar 26 19:24:47 2022 -0100 drm/amd/display: detach fpu operations from dcn10_validate_bandwidth in calcs dcn10_validate_bandwidth is only used on dcn10 files, but is declared in dcn_calcs files. Rename dcn10_* to dcn_* in calcs, remove DC_FP_* wrapper inside DML folder and create an specific dcn10_validate_bandwidth in dcn10_resources that calls dcn_validate_bandwidth and properly wraps that FPU function with DC_FP_* macro. Acked-by: Christian König Reviewed-by: Rodrigo Siqueira Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit ebd9c071d29e56b21ef5155757e0da9926d8d814 Author: Kent Russell Date: Wed Feb 9 19:56:46 2022 -0500 drm/amdgpu: Add unique_id support for sienna cichlid This is being added to SMU Metrics, so add the required tie-ins in the kernel. Also create the corresponding unique_id sysfs file. v2: Add FW version check, remove SMU mutex v3: Fix style warning v4: Add MP1 IP_VERSION check to FW version check Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4a93d938a4cbebaafa20cb3ca449eb501f118b40 Author: Kent Russell Date: Tue Mar 29 09:46:11 2022 -0400 drm/amdgpu: Use metrics data function to get unique_id for Aldebaran This is abstracted well enough in the get_metrics_data function, so use the function Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6e5d64e3eaf663f7564297412575074741421444 Author: Kent Russell Date: Tue Mar 29 09:42:58 2022 -0400 drm/amdgpu: Add UNIQUE_ID to MetricsMember_t This will allow us to use the generic *_get_metrics_data functions for ASICs that support unique_id Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 60044748f2c816aad2b5f95c46774ce0aaccf4ca Author: Kent Russell Date: Fri Mar 25 10:11:36 2022 -0400 drm/amdgpu: Use switch case for unique_id To ease readability, use switch to set unique_id as supported for the supported IP_VERSIONs, and set it to unsupported by default for all other ASICs. This makes it easier to add IP_VERSIONs later on, and makes it obvious that it is not supported by default, instead of the current logic that assumes that it is supported unless it is not one of the specified IP_VERSIONs. v2: Rebase onto previous IP_VERSION change Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 8fde0248a32d29228520b876b8b27d0c44133734 Author: Philip Yang Date: Fri Mar 25 20:17:28 2022 -0400 drm/amdkfd: Use atomic64_t type for pdd->tlb_seq To support multi-thread update page table. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4499c90e902f399d69248cb887b222fb3d342d20 Author: Christian König Date: Fri Mar 11 14:10:13 2022 +0100 drm/amdgpu: fix incorrect size printing in error msg That are bytes not pages. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 55a2d21bba3db088f25d124c76d8bbaa2f4f5771 Author: Christian König Date: Fri Mar 25 10:22:36 2022 +0100 drm/amdgpu: fix some kerneldoc in the VM code v2 Fix two incorrect kerneldocs for the recent VM code changes. v2: fix one more typo Signed-off-by: Christian König Reported-by: kernel test robot Reported-by: Stephen Rothwell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8f3286942f80650b502532870d7558d206b72484 Author: Shirish S Date: Fri Mar 11 20:30:17 2022 +0530 amd/display: set backlight only if required [Why] comparing pwm bl values (coverted) with user brightness(converted) levels in commit_tail leads to continuous setting of backlight via dmub as they don't to match. This leads overdrive in queuing of commands to DMCU that sometimes lead to depending on load on DMCU fw: "[drm:dc_dmub_srv_wait_idle] *ERROR* Error waiting for DMUB idle: status=3" [How] Store last successfully set backlight value and compare with it instead of pwm reads which is not what we should compare with. Signed-off-by: Shirish S Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 6452c544fbab3030f81229d677c15b9e52d0d934 Author: Randy Dunlap Date: Sat Mar 26 16:37:26 2022 -0700 drm/amd/display: DCN3.1: don't mark as kernel-doc There is no need for this one static function to be marked as kernel-doc notation. Avoid this doc build warning: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enable CRTC Fixes: 110d3968fe95 ("drm/amd/display: Add DCN3.1 OPTC") Signed-off-by: Randy Dunlap Cc: Alex Deucher Cc: Nicholas Kazlauskas Cc: amd-gfx@lists.freedesktop.org Cc: Christian König Cc: "Pan, Xinhui" Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e84c8ab52dc76b09cb1c8885950ad4eaaf340bf6 Author: Haowen Bai Date: Thu Mar 24 17:46:02 2022 +0800 drm/amd/display: Fix pointer dereferenced before checking The value actual_pix_clk_100Hz is dereferencing pointer pix_clk_params before pix_clk_params is being null checked. Fix this by assigning pix_clk_params->requested_pix_clk_100hz to actual_pix_clk_100Hz only if pix_clk_params is not NULL, otherwise just NULL. Signed-off-by: Haowen Bai Signed-off-by: Alex Deucher commit 44e121fbf155edc93eceaae273038afbf90f52a7 Author: Philip Yang Date: Sun Mar 27 22:22:44 2022 -0400 drm/amdgpu: Add tlb_cb for unlocked update Flush TLB needs wait for GPU update fence done. MMU notify callback to unmap range from GPUs uses unlocked GPU page table update, so add tlb_cb to unlocked update fence to increase vm->tlb_seq. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 9563e1ec9292254a5feb3dd1b7fbef0bed512c8f Author: Philip Yang Date: Sun Mar 27 22:02:56 2022 -0400 drm/amdgpu: Correct unlocked update fence handling To fix two issues with unlocked update fence: 1. vm->last_unlocked store the latest fence without taking refcount. 2. amdgpu_vm_bo_update_mapping returns old fence, not the latest fence. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 3222a81148ca273af66cb67f8445114bc633e747 Author: Haowen Bai Date: Thu Mar 24 17:27:14 2022 +0800 drm/amd/display: Fix pointer dereferenced before checking The pointer edid_buf is dereferencing pointer edid before edid is being null checked. Fix this by assigning edid->raw_edid to edid_buf only if edid is not NULL, otherwise just NULL. Signed-off-by: Haowen Bai Signed-off-by: Alex Deucher commit c4af42b4eb5beb6f5ae96b5be786862bbb9cfb16 Author: Roman Li Date: Thu Mar 17 19:55:05 2022 -0400 drm/amd/display: Fix allocate_mst_payload assert on resume [Why] On resume we do link detection for all non-MST connectors. MST is handled separately. However the condition for telling if connector is on mst branch is not enough for mst hub case. Link detection for mst branch link leads to mst topology reset. That causes assert in dc_link_allocate_mst_payload() [How] Use link type as indicator for mst link. Reviewed-by: Wayne Lin Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9510d365e0626ff6f7ed5b23f70ae49828b68039 Author: Aric Cyr Date: Sun Mar 20 14:35:12 2022 -0400 drm/amd/display: 3.2.179 - [FW Promotion] Release 0.0.110.0 - Revert FEC check in validation - Update LTTPR UHBR link rate support struct - Add support for USBC connector - Add work around for AUX failure on wake - Clear optc false state when disable otg - Enable power gating before init_pipes - Remove redundant dsc power gating from init_hw - Power down hardware if timer not trigger - Correct Slice reset calculation - Enable 3-plane MPO for DCN31 - Set fec register init value - Remove SW w/a for HDCP 1.4 1A-07 failure based on ECO fix - Create underflow interrupt IRQ type Acked-by: Alex Hung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ad371c8a2f66c5e14a8baa26472ec833ffa8342b Author: Anthony Koo Date: Sat Mar 19 13:09:57 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.110.0 - Revert save/restore PANEL_PWRSEQ_REF_DIV2 and other psr phy optimizations Reviewed-by: Aric Cyr Acked-by: Alex Hung Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4304b8a434b6b95449cd81f02e953f9de357a707 Author: Martin Leung Date: Fri Mar 18 11:12:36 2022 -0400 drm/amd/display: Revert FEC check in validation why and how: causes failure on install on certain machines Reviewed-by: George Shen Acked-by: Alex Hung Signed-off-by: Martin Leung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a772105cfaca3c7b28bbe8a4e22a08efa561b603 Author: Michael Strauss Date: Thu Mar 17 10:17:01 2022 -0400 drm/amd/display: Update LTTPR UHBR link rate support struct [WHY] Update field order to match DP2.0 spec SCR Reviewed-by: George Shen Acked-by: Alex Hung Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8cb3c169fc7574cb889deb3b59a3c8e783fb4685 Author: Samson Tam Date: Wed Mar 16 01:06:42 2022 -0400 drm/amd/display: Add support for USBC connector [Why] Add support for CONNECTOR_ID_USBC Reviewed-by: Alvin Lee Acked-by: Alex Hung Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 84d1ce0631c746c7fe025cbb49da6ade1aa80a1f Author: Jimmy Kizito Date: Wed Mar 9 18:26:47 2022 -0500 drm/amd/display: Add work around for AUX failure on wake. [Why] When waking from low-power states, a DP sink may remain unresponsive to AUX transactions. [How] Try to toggle DPCD SET_POWER register repeatedly (up to a maximum timeout value) until DP sink becomes responsive. Reviewed-by: Mustapha Ghaddar Acked-by: Alex Hung Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a905f0b59fefe819c59bacf9d0cfa678c96fcb8c Author: Charlene Liu Date: Tue Mar 15 16:42:33 2022 -0400 drm/amd/display: Clear optc false state when disable otg [why] when disable optc, need to clear the underflow status as well. Reviewed-by: Chris Park Acked-by: Alex Hung Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 384bd90d1cc1168dc845ad2735d7a3d49459fbba Author: Roman Li Date: Tue Mar 15 16:31:14 2022 -0400 drm/amd/display: Enable power gating before init_pipes [Why] In init_hw() we call init_pipes() before enabling power gating. init_pipes() tries to power gate dsc but it may fail because required force-ons are not released yet. As a result with dsc config the following errors observed on resume: "REG_WAIT timeout 1us * 1000 tries - dcn20_dsc_pg_control" "REG_WAIT timeout 1us * 1000 tries - dcn20_dpp_pg_control" "REG_WAIT timeout 1us * 1000 tries - dcn20_hubp_pg_control" [How] Move enable_power_gating_plane() before init_pipes() in init_hw() Reviewed-by: Anthony Koo Reviewed-by: Eric Yang Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 75c95f4550e3d4584ff100fef53c240f3291f7cd Author: Roman Li Date: Tue Mar 15 14:57:34 2022 -0400 drm/amd/display: Remove redundant dsc power gating from init_hw [Why] DSC Power down code has been moved from dcn31_init_hw into init_pipes() Need to remove it from dcn10_init_hw() as well to avoid duplicated action on dcn1.x/2.x [How] Remove DSC power down code from dcn10_init_hw() Fixes: 8fa6f4c5715c ("drm/amd/display: fixed the DSC power off sequence during Driver PnP") Reviewed-by: Anthony Koo Reviewed-by: Eric Yang Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 06bab5897c51e15d9a6b7ec11b1eacc4f2e1a145 Author: Paul Hsieh Date: Wed Mar 16 06:59:46 2022 +0800 drm/amd/display: Power down hardware if timer not trigger [WHY] In headless systems, if SetMode/Power down timer is not called, hardware will not be powered down causing HW/SW discrepancies. Powering down hardware on SetPowerState to D3 will ensure SW/HW state is accurate. [HOW] If PowerDownThread timer is not trigger but OS call SetPowerState to D3, power down hardware. Reviewed-by: Eric Yang Acked-by: Alex Hung Signed-off-by: Paul Hsieh Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 83bb503275bdf651c67f02e0d25f2d0db2ca865b Author: Chris Park Date: Tue Mar 15 12:21:43 2022 -0400 drm/amd/display: Correct Slice reset calculation [Why] Once DSC slice cannot fit pixel clock, we incorrectly reset min slices to 0 and allow max slice to operate, even when max slice itself cannot fit the pixel clock properly. [How] Change the sequence such that we correctly determine DSC is not possible when both min slices and max slices cannot fit pixel clock per slice. Reviewed-by: Wenjing Liu Acked-by: Alex Hung Signed-off-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e9ebc23b3fb2949e18c6df98a6e6fd94429e498e Author: Krunoslav Kovac Date: Fri Mar 11 16:12:58 2022 -0500 drm/amd/display: Enable 3-plane MPO for DCN31 [WHY&HOW] It can be enabled by users, but proper way is to report max_slave_planes in DC caps for each ASIC. Some structures use hardcoded max_plane=2, this is also addressed here. Reviewed-by: Nevenko Stupar Reviewed-by: Aric Cyr Acked-by: Alex Hung Signed-off-by: Krunoslav Kovac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5abef8e5ce910545079f078ba4383f2650389e00 Author: Jingwen Zhu Date: Tue Mar 15 13:15:27 2022 +0800 drm/amd/display: Set fec register init value [Why] We don't include this eDP FEC init on fastboot. [How] Set the fec to init value when stopping driver &get the fec register value to check should enable FEC. Co-authored-by: Jingwen Zhu Reviewed-by: Wenjing Liu Acked-by: Alex Hung Signed-off-by: Jingwen Zhu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 71d7a553645f9aba80b318ee5b4385d264ac3efa Author: Oliver Logush Date: Thu Mar 10 11:16:09 2022 -0500 drm/amd/display: Remove SW w/a for HDCP 1.4 1A-07 failure based on ECO fix [why] W/a no longer needed Reviewed-by: Charlene Liu Acked-by: Alex Hung Signed-off-by: Oliver Logush Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1aa6b091f622bab0a805edc52bbb95cc96d55f30 Author: Angus Wang Date: Tue Mar 8 09:33:24 2022 -0500 drm/amd/display: Create underflow interrupt IRQ type [WHY] We want another entry in IRQ type that can be used to help find the underflow interrupt source. [HOW] Added another mapping in IRQ type enum. Reviewed-by: Jun Lei Acked-by: Alex Hung Signed-off-by: Angus Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 38608ee7b6907830f157818d81f7b2393d49c808 Author: Xu Kuohai Date: Mon Mar 21 11:28:52 2022 -0400 bpf, tests: Add load store test case for tail call Add test case to enusre that the caller and callee's fp offsets are correct during tail call (mainly asserting for arm64 JIT). Tested on both big-endian and little-endian arm64 qemu, result: test_bpf: Summary: 1026 PASSED, 0 FAILED, [1014/1014 JIT'ed] test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321152852.2334294-6-xukuohai@huawei.com commit f516420f683d147d8f4cfd83bbc7c3c6ad1c61b5 Author: Xu Kuohai Date: Mon Mar 21 11:28:51 2022 -0400 bpf, tests: Add tests for BPF_LDX/BPF_STX with different offsets This patch adds tests to verify the behavior of BPF_LDX/BPF_STX + BPF_B/BPF_H/BPF_W/BPF_DW with negative offset, small positive offset, large positive offset, and misaligned offset. Tested on both big-endian and little-endian arm64 qemu, result: test_bpf: Summary: 1026 PASSED, 0 FAILED, [1014/1014 JIT'ed]'] test_bpf: test_tail_calls: Summary: 8 PASSED, 0 FAILED, [8/8 JIT'ed] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321152852.2334294-5-xukuohai@huawei.com commit 5b3d19b9bd4080d7f5e260f91ce8f639e19eb499 Author: Xu Kuohai Date: Mon Mar 21 11:28:50 2022 -0400 bpf, arm64: Adjust the offset of str/ldr(immediate) to positive number The BPF STX/LDX instruction uses offset relative to the FP to address stack space. Since the BPF_FP locates at the top of the frame, the offset is usually a negative number. However, arm64 str/ldr immediate instruction requires that offset be a positive number. Therefore, this patch tries to convert the offsets. The method is to find the negative offset furthest from the FP firstly. Then add it to the FP, calculate a bottom position, called FPB, and then adjust the offsets in other STR/LDX instructions relative to FPB. FPB is saved using the callee-saved register x27 of arm64 which is not used yet. Before adjusting the offset, the patch checks every instruction to ensure that the FP does not change in run-time. If the FP may change, no offset is adjusted. For example, for the following bpftrace command: bpftrace -e 'kprobe:do_sys_open { printf("opening: %s\n", str(arg1)); }' Without this patch, jited code(fragment): 0: bti c 4: stp x29, x30, [sp, #-16]! 8: mov x29, sp c: stp x19, x20, [sp, #-16]! 10: stp x21, x22, [sp, #-16]! 14: stp x25, x26, [sp, #-16]! 18: mov x25, sp 1c: mov x26, #0x0 // #0 20: bti j 24: sub sp, sp, #0x90 28: add x19, x0, #0x0 2c: mov x0, #0x0 // #0 30: mov x10, #0xffffffffffffff78 // #-136 34: str x0, [x25, x10] 38: mov x10, #0xffffffffffffff80 // #-128 3c: str x0, [x25, x10] 40: mov x10, #0xffffffffffffff88 // #-120 44: str x0, [x25, x10] 48: mov x10, #0xffffffffffffff90 // #-112 4c: str x0, [x25, x10] 50: mov x10, #0xffffffffffffff98 // #-104 54: str x0, [x25, x10] 58: mov x10, #0xffffffffffffffa0 // #-96 5c: str x0, [x25, x10] 60: mov x10, #0xffffffffffffffa8 // #-88 64: str x0, [x25, x10] 68: mov x10, #0xffffffffffffffb0 // #-80 6c: str x0, [x25, x10] 70: mov x10, #0xffffffffffffffb8 // #-72 74: str x0, [x25, x10] 78: mov x10, #0xffffffffffffffc0 // #-64 7c: str x0, [x25, x10] 80: mov x10, #0xffffffffffffffc8 // #-56 84: str x0, [x25, x10] 88: mov x10, #0xffffffffffffffd0 // #-48 8c: str x0, [x25, x10] 90: mov x10, #0xffffffffffffffd8 // #-40 94: str x0, [x25, x10] 98: mov x10, #0xffffffffffffffe0 // #-32 9c: str x0, [x25, x10] a0: mov x10, #0xffffffffffffffe8 // #-24 a4: str x0, [x25, x10] a8: mov x10, #0xfffffffffffffff0 // #-16 ac: str x0, [x25, x10] b0: mov x10, #0xfffffffffffffff8 // #-8 b4: str x0, [x25, x10] b8: mov x10, #0x8 // #8 bc: ldr x2, [x19, x10] [...] With this patch, jited code(fragment): 0: bti c 4: stp x29, x30, [sp, #-16]! 8: mov x29, sp c: stp x19, x20, [sp, #-16]! 10: stp x21, x22, [sp, #-16]! 14: stp x25, x26, [sp, #-16]! 18: stp x27, x28, [sp, #-16]! 1c: mov x25, sp 20: sub x27, x25, #0x88 24: mov x26, #0x0 // #0 28: bti j 2c: sub sp, sp, #0x90 30: add x19, x0, #0x0 34: mov x0, #0x0 // #0 38: str x0, [x27] 3c: str x0, [x27, #8] 40: str x0, [x27, #16] 44: str x0, [x27, #24] 48: str x0, [x27, #32] 4c: str x0, [x27, #40] 50: str x0, [x27, #48] 54: str x0, [x27, #56] 58: str x0, [x27, #64] 5c: str x0, [x27, #72] 60: str x0, [x27, #80] 64: str x0, [x27, #88] 68: str x0, [x27, #96] 6c: str x0, [x27, #104] 70: str x0, [x27, #112] 74: str x0, [x27, #120] 78: str x0, [x27, #128] 7c: ldr x2, [x19, #8] [...] Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321152852.2334294-4-xukuohai@huawei.com commit 7db6c0f1d8ee051e0a7d8c58c5982990e4491f39 Author: Xu Kuohai Date: Mon Mar 21 11:28:49 2022 -0400 bpf, arm64: Optimize BPF store/load using arm64 str/ldr(immediate offset) The current BPF store/load instruction is translated by the JIT into two instructions. The first instruction moves the immediate offset into a temporary register. The second instruction uses this temporary register to do the real store/load. In fact, arm64 supports addressing with immediate offsets. So This patch introduces optimization that uses arm64 str/ldr instruction with immediate offset when the offset fits. Example of generated instuction for r2 = *(u64 *)(r1 + 0): without optimization: mov x10, 0 ldr x1, [x0, x10] with optimization: ldr x1, [x0, 0] If the offset is negative, or is not aligned correctly, or exceeds max value, rollback to the use of temporary register. Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321152852.2334294-3-xukuohai@huawei.com commit 30c90f6757a7b38bc95069725657a647873e2ab3 Author: Xu Kuohai Date: Mon Mar 21 11:28:48 2022 -0400 arm64, insn: Add ldr/str with immediate offset This patch introduces ldr/str with immediate offset support to simplify the JIT implementation of BPF LDX/STX instructions on arm64. Although arm64 ldr/str immediate is available in pre-index, post-index and unsigned offset forms, the unsigned offset form is sufficient for BPF, so this patch only adds this type. Signed-off-by: Xu Kuohai Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321152852.2334294-2-xukuohai@huawei.com commit 3d7039e1e64980a5eb424373b3a5843b7d7891aa Author: Jagan Teki Date: Thu Mar 31 21:15:03 2022 +0530 drm: bridge: mcde_dsi: Switch to devm_drm_of_get_bridge devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Linus Walleij Signed-off-by: Jagan Teki Reviewed-by: Linus Walleij Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-5-jagan@amarulasolutions.com commit 1c74c1fb83ebb414c017d459e7875abe777654d7 Author: Jagan Teki Date: Thu Mar 31 21:15:02 2022 +0530 drm: bridge: dw-mipi-dsi: Switch to devm_drm_of_get_bridge devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Signed-off-by: Jagan Teki Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-4-jagan@amarulasolutions.com commit 1d0b536304455cab5ef71329d704bf310d74f34b Author: Jagan Teki Date: Thu Mar 31 21:15:01 2022 +0530 drm: bridge: mtk_dsi: Switch to devm_drm_of_get_bridge devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Cc: Chun-Kuang Hu Cc: Philipp Zabel Signed-off-by: Jagan Teki Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-3-jagan@amarulasolutions.com commit 4f4601071ca544559b27b49a043167c009b77c64 Author: Jagan Teki Date: Thu Mar 31 21:15:00 2022 +0530 drm: bridge: nwl-dsi: Switch to devm_drm_of_get_bridge devm_drm_of_get_bridge is capable of looking up the downstream bridge and panel and trying to add a panel bridge if the panel is found. Replace explicit finding calls with devm_drm_of_get_bridge. Reviewed-by: Guido Günther Signed-off-by: Jagan Teki Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-2-jagan@amarulasolutions.com commit 65af9070cd09a9a5a5306ffc2b39b1674c7e5716 Author: Jagan Teki Date: Thu Mar 31 21:14:59 2022 +0530 Revert "drm/bridge: dw-mipi-dsi: Find the possible DSI devices" This reverts commit c206c7faeb3263a7cc7b4de443a3877cd7a5e74b. In order to avoid any probe ordering issues, the I2C based downstream bridge drivers now register and attach the DSI devices at the probe instead of doing it on drm_bridge_function.attach(). Examples of those commits are: commit <6ef7ee48765f> ("drm/bridge: sn65dsi83: Register and attach our DSI device at probe") commit ("drm/bridge: lt8912b: Register and attach our DSI device at probe") commit <864c49a31d6b> ("drm/bridge: adv7511: Register and attach our DSI device at probe") dw-mipi-dsi has panel or bridge finding code based on previous downstream bridges, so revert the same and make the panel or bridge funding in host attach as before. Signed-off-by: Jagan Teki Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331154503.66054-1-jagan@amarulasolutions.com commit ee2f7c9d878905054e3df5126a9bbaec1923e2ff Author: Marek Vasut Date: Thu Mar 31 17:39:23 2022 +0200 drm/bridge: lt9611: Add atomic_get_input_bus_fmts Implement .atomic_get_input_bus_fmts callback, which sets up the input (scanout-engine-end) formats, so that those formats can then be used in pipeline format negotiation between this bridge and the scanout engine. Signed-off-by: Marek Vasut Cc: Dave Airlie Cc: John Stultz Cc: Maxime Ripard Cc: Sam Ravnborg Cc: Thomas Zimmermann Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331153923.14314-2-marex@denx.de commit 97d7ca798a79a93b2a3168f60024fddcc8e0d6b0 Author: Marek Vasut Date: Thu Mar 31 17:39:22 2022 +0200 drm/bridge: lt9611: Switch to atomic operations Use the atomic version of the enable/disable operations to continue the transition to the atomic API. This will be needed to access the mode from the atomic state. Signed-off-by: Marek Vasut Cc: Dave Airlie Cc: John Stultz Cc: Maxime Ripard Cc: Sam Ravnborg Cc: Thomas Zimmermann Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331153923.14314-1-marex@denx.de commit 85854fa95972455fd8ff340d7810dde57fe36d44 Author: Marek Vasut Date: Sun Feb 13 03:26:48 2022 +0100 drm/bridge: ti-sn65dsi83: Check link status register after enabling the bridge In rare cases, the bridge may not start up correctly, which usually leads to no display output. In case this happens, warn about it in the kernel log. Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Robert Foss Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220213022648.495895-1-marex@denx.de commit 17a9c1aaa8485b7be0f20233bdc5bf0b4527f4a7 Author: Marek Vasut Date: Thu Mar 31 17:05:09 2022 +0200 drm: bridge: icn6211: Read and validate chip IDs before configuration Read out the Vendor/Chip/Version ID registers from the chip before performing any configuration, and validate that the registers have correct values. This is mostly a simple test whether DSI register access does work, since that tends to be broken on various bridges. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-12-marex@denx.de commit 33f1036b785caeb5f0b7935ee771214cfd75b3f8 Author: Marek Vasut Date: Thu Mar 31 17:05:08 2022 +0200 drm: bridge: icn6211: Rework ICN6211_DSI to chipone_writeb() Rename and inline macro ICN6211_DSI() into function chipone_writeb() to keep all function names lower-case. No functional change. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-11-marex@denx.de commit 8dde6f7452a198a870f74a38118bb1a63da7632e Author: Marek Vasut Date: Thu Mar 31 17:05:07 2022 +0200 drm: bridge: icn6211: Add I2C configuration support The ICN6211 chip starts in I2C configuration mode after cold boot. Implement support for configuring the chip via I2C in addition to the current DSI LP command mode configuration support. The later seems to be available only on chips which have additional MCU on the panel/bridge board which preconfigures the ICN6211, while the I2C configuration mode added by this patch does not require any such MCU. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-10-marex@denx.de commit cda3822a5db30372abc33a6d63885c38f51d7489 Author: Marek Vasut Date: Thu Mar 31 17:05:06 2022 +0200 drm: bridge: icn6211: Implement atomic_get_input_bus_fmts Implement .atomic_get_input_bus_fmts callback, which sets up the input (DSI-end) format, and that format can then be used in pipeline format negotiation between the DSI-end of this bridge and the other component closer to the scanout engine. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-9-marex@denx.de commit 75122915dbb46d33294e9078bef615d6fdf8ec0d Author: Marek Vasut Date: Thu Mar 31 17:05:05 2022 +0200 drm: bridge: icn6211: Set SYS_CTRL_1 to value used in examples Both example code [1], [2] as well as one provided by custom panel vendor set register SYS_CTRL_1 to 0x88. What exactly does the value mean is unknown due to unavailable datasheet. Align this register value with example code. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c [2] https://github.com/tdjastrzebski/ICN6211-Configurator Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-8-marex@denx.de commit aedfd0b9ae0a5759e4db1a6185637aa89b3df5f3 Author: Marek Vasut Date: Thu Mar 31 17:05:04 2022 +0200 drm: bridge: icn6211: Disable DPI color swap The chip is capable of swapping DPI RGB channels. The driver currently does not implement support for this functionality. Write the MIPI_PN_SWAP register to 0 to assure the color swap is disabled. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-7-marex@denx.de commit 00404824b8ad2551df2df8e74ac37a46fad941f6 Author: Marek Vasut Date: Thu Mar 31 17:05:03 2022 +0200 drm: bridge: icn6211: Use DSI burst mode without EoT and with LP command mode The DSI burst mode is more energy efficient than the DSI sync pulse mode, make use of the burst mode since the chip supports it as well. Disable the generation of EoT packet, the chip ignores it, so no point in emitting it. Enable transmission of data in LP mode, otherwise register read via DSI does not work with this chip. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-6-marex@denx.de commit f30cf0ece6916ca6c5b896d8c31443565f4dda24 Author: Marek Vasut Date: Thu Mar 31 17:05:02 2022 +0200 drm: bridge: icn6211: Add generic DSI-to-DPI PLL configuration The chip contains fractional PLL, however the driver currently hard-codes one specific PLL setting. Implement generic PLL parameter calculation code, so any DPI panel with arbitrary pixel clock can be attached to this bridge. The datasheet for this bridge is not available, the PLL behavior has been inferred from [1] and [2] and by analyzing the DPI pixel clock with scope. The PLL limits might be wrong, but at least the calculated values match all the example code available. This is better than one hard-coded pixel clock value anyway. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c [2] https://github.com/tdjastrzebski/ICN6211-Configurator Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-5-marex@denx.de commit 2dff97f2b37ff5439554d3548ce3197620dcb57b Author: Marek Vasut Date: Thu Mar 31 17:05:01 2022 +0200 drm: bridge: icn6211: Add HS/VS/DE polarity handling The driver currently hard-codes HS/VS polarity to active-low and DE to active-high, which is not correct for a lot of supported DPI panels. Add the missing mode flag handling for HS/VS/DE polarity. Acked-by: Maxime Ripard Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-4-marex@denx.de commit c0ff7a649d62105a9308cc3ac36e52a4669d9cb4 Author: Marek Vasut Date: Thu Mar 31 17:05:00 2022 +0200 drm: bridge: icn6211: Fix HFP_HSW_HBP_HI and HFP_MIN handling The HFP_HSW_HBP_HI register must be programmed with 2 LSbits of each Horizontal Front Porch/Sync/Back Porch. Currently the driver programs this register to 0, which breaks displays with either value above 255. The HFP_MIN register must be set to the same value as HFP_LI, otherwise there is visible image distortion, usually in the form of missing lines at the bottom of the panel. Fix this by correctly programming the HFP_HSW_HBP_HI and HFP_MIN registers. Acked-by: Maxime Ripard Fixes: ce517f18944e3 ("drm: bridge: Add Chipone ICN6211 MIPI-DSI to RGB bridge") Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-3-marex@denx.de commit 2dcec57b3734029cc1adc5cb872f61e21609eed4 Author: Marek Vasut Date: Thu Mar 31 17:04:59 2022 +0200 drm: bridge: icn6211: Fix register layout The chip register layout has nothing to do with MIPI DCS, the registers incorrectly marked as MIPI DCS in the driver are regular chip registers often with completely different function. Fill in the actual register names and bits from [1] and [2] and add the entire register layout, since the documentation for this chip is hard to come by. [1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c [2] https://github.com/tdjastrzebski/ICN6211-Configurator Acked-by: Maxime Ripard Fixes: ce517f18944e3 ("drm: bridge: Add Chipone ICN6211 MIPI-DSI to RGB bridge") Signed-off-by: Marek Vasut Cc: Jagan Teki Cc: Maxime Ripard Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220331150509.9838-2-marex@denx.de commit 95a2441e4347b93809c39e142fb1d73149e15345 Author: Jagan Teki Date: Thu Mar 3 22:06:54 2022 +0530 drm: exynos: dsi: Switch to atomic funcs The new support drm bridges are moving towards atomic functions. Replace atomic version of functions to continue the transition to the atomic API. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-7-jagan@amarulasolutions.com commit f9bfd326f57eb2a7d70b1045f75f1ad27ec70fa6 Author: Jagan Teki Date: Thu Mar 3 22:06:53 2022 +0530 drm: exynos: dsi: Convert to bridge driver Convert the encoders to bridge drivers in order to standardize on a single API with built-in dumb encoder support for compatibility with existing component drivers. Driver bridge conversion will help to reuse the same bridge on different platforms as exynos dsi driver can be used as a Samsung DSIM and use it for i.MX8MM platform. Bridge conversion, - Drops drm_encoder_helper_funcs. - Adds drm_bridge_funcs and register a drm bridge. - Drops bridge_chain. - Separate pre_enable from enable function. - Separate post_disable from disable function. Convert it. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-6-jagan@amarulasolutions.com commit 711c7adc4687250deb550ee8a6994203f817b2ca Author: Jagan Teki Date: Thu Mar 3 22:06:52 2022 +0530 drm: exynos: dsi: Use drm panel_bridge API Replace the manual panel handling code by a drm panel_bridge via devm_drm_of_get_bridge(). Adding panel_bridge handling, - Drops drm_connector and related operations as drm_bridge_attach creates connector during attachment. - Drops panel pointer and iterate the bridge, so-that it can operate the normal bridge and panel_bridge in constitutive callbacks. This simplifies the driver and allows all components in the display pipeline to be treated as bridges. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-5-jagan@amarulasolutions.com commit dd8b6803bc4914cbcd15470eccc4b887fbaa7642 Author: Jagan Teki Date: Thu Mar 3 22:06:51 2022 +0530 exynos: drm: dsi: Attach in_bridge in MIC driver MIC drivers in the Exynos5433 display pipeline are already registered as bridge drivers and it is more advisable to attach the downstream bridge on the bridge attach call instead of doing the same in the DSI driver. This makes bridge attachment more meaningful and avoids the races during bridge function calls. So, move the bridge finding and drm_bridge_attach from DSI to MIC. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-4-jagan@amarulasolutions.com commit 934aef885f9d99662a02690de3737b3b70116121 Author: Jagan Teki Date: Thu Mar 3 22:06:50 2022 +0530 drm: bridge: panel: Reset the connector state pointer Trigger hotplug event with drm_kms_helper_hotplug_event might fail if the connector state pointer is NULL. BUG observed in exynos dsi driver where drm_bridge_attach is trying to register a connector in panel_bridge before the hotplug event is triggered. WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_atomic_state_helper.c:494 drm_atomic_helper_connector_duplicate_state+0x94/0x9c Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W 5.16.0-rc1-00009-g704b1dbfa4c2 #11058 Hardware name: Samsung Exynos (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack_lvl+0x58/0x70) [] (dump_stack_lvl) from [] (__warn+0xd0/0x134) [] (__warn) from [] (warn_slowpath_fmt+0x5c/0xb4) [] (warn_slowpath_fmt) from [] (drm_atomic_helper_connector_duplicate_state+0x94/0x9c) [] (drm_atomic_helper_connector_duplicate_state) from [] (drm_atomic_get_connector_state+0xd4/0x190) [] (drm_atomic_get_connector_state) from [] (__drm_atomic_helper_set_config+0x314/0x368) [] (__drm_atomic_helper_set_config) from [] (drm_client_modeset_commit_atomic+0x170/0x278) [] (drm_client_modeset_commit_atomic) from [] (drm_client_modeset_commit_locked+0x60/0x1c8) [] (drm_client_modeset_commit_locked) from [] (drm_client_modeset_commit+0x24/0x40) [] (drm_client_modeset_commit) from [] (drm_fb_helper_set_par+0xb8/0xf8) [] (drm_fb_helper_set_par) from [] (fbcon_init+0x2c0/0x518) [] (fbcon_init) from [] (visual_init+0xc0/0x108) [] (visual_init) from [] (do_bind_con_driver+0x1b8/0x3a4) [] (do_bind_con_driver) from [] (do_take_over_console+0x13c/0x1e8) [] (do_take_over_console) from [] (do_fbcon_takeover+0x78/0xd8) [] (do_fbcon_takeover) from [] (register_framebuffer+0x208/0x2e0) [] (register_framebuffer) from [] (__drm_fb_helper_initial_config_and_unlock+0x400/0x63c) [] (__drm_fb_helper_initial_config_and_unlock) from [] (drm_kms_helper_hotplug_event+0x24/0x30) [] (drm_kms_helper_hotplug_event) from [] (exynos_dsi_host_attach+0x174/0x1fc) [] (exynos_dsi_host_attach) from [] (s6e8aa0_probe+0x1b4/0x218) So reset the atomic state for a given connector by freeing the state pointer and allocate a new empty state object. This can be done using connector funcs->reset helper and has to be done before the hotplug even calls. This patch calls the connector->funcs->reset in panel_bridge_attach. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-3-jagan@amarulasolutions.com commit b2831dd4be4e98c6f62976a821d7e852f0c9c08b Author: Jagan Teki Date: Thu Mar 3 22:06:49 2022 +0530 drm: bridge: tc358764: Use drm panel_bridge API Replace the manual panel handling code by a drm panel_bridge via devm_drm_of_get_bridge(). Adding panel_bridge handling, - Drops drm_connector and related operations as drm_bridge_attach creates connector during attachment. - Drops panel pointer and panel healpers. This simplifies the driver and allows all components in the display pipeline to be treated as bridges. Signed-off-by: Jagan Teki Acked-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303163654.3381470-2-jagan@amarulasolutions.com commit bbfd3190b65629117ae1535499e3de9791499ddc Author: Marek Vasut Date: Tue Mar 29 10:50:15 2022 +0200 drm/bridge: tc358767: Add DSI-to-DPI mode support The TC358767/TC358867/TC9595 are all capable of operating in multiple modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Add support for the DSI-to-DPI mode. This requires skipping most of the (e)DP initialization code, which is currently a large part of this driver, hence it is better to have far simpler separate tc_dpi_bridge_funcs and their implementation. The configuration of DPI output is also much simpler. The configuration of the DSI input is rather similar to the other TC bridge chips. The Pixel PLL in DPI output mode does not have the 65..150 MHz limitation imposed on the (e)DP output mode, so this limitation is skipped to permit operating panels with far slower pixel clock, even below 9 MHz. This mode of operation of the PLL is valid and tested. The detection of bridge mode is now added into tc_probe_bridge_mode(), where in case a DPI panel is found on port@1 endpoint@1, the mode is assumed to be DSI-to-DPI. If (e)DP is detected on port@2, the mode is assumed to be DPI-to-(e)DP. The DSI-to-(e)DP mode is not supported due to lack of proper hardware, but this would be some sort of mix between the two aforementioned modes. Reviewed-by: Lucas Stach Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-12-marex@denx.de commit aebe58a7af42d2126dc8ca39825cb5a624649115 Author: Marek Vasut Date: Tue Mar 29 10:50:14 2022 +0200 drm/bridge: tc358767: Split tc_set_video_mode() into common and (e)DP part The tc_set_video_mode() sets up both common and (e)DP video mode settings of the bridge chip. Split the function into tc_set_common_video_mode() to set the common settings and tc_set_edp_video_mode() to set the (e)DP specific settings. No functional change. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-11-marex@denx.de commit 71f7d9c03118fc98c487e7ecd3a039da9c1cc513 Author: Marek Vasut Date: Tue Mar 29 10:50:13 2022 +0200 drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT The TC358767/TC358867/TC9595 are all capable of operating in multiple modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Only the first mode is currently supported. It is possible to find out the mode in which the bridge should be operated by testing connected endpoints in DT. Port allocation: port@0 - DSI input port@1 - DPI input/output port@2 - eDP output Possible connections: DPI -> port@1 -> port@2 -> eDP :: [port@0 is not connected] DSI -> port@0 -> port@2 -> eDP :: [port@1 is not connected] DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected] Add function to determine the bridge mode based on connected endpoints. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-10-marex@denx.de commit dd1fd5ab7cd6dca15af6553b936a08cfc354e406 Author: Marek Vasut Date: Tue Mar 29 10:50:12 2022 +0200 drm/bridge: tc358767: Move bridge ops setup into tc_probe_edp_bridge_endpoint() The bridge ops are specific to the bridge configuration, move them into tc_probe_edp_bridge_endpoint() to permit cleaner addition of DSI-to-DPI mode. No functional change. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-9-marex@denx.de commit 824c7bb46c9c2b5fbdc910425357fe863db93c26 Author: Marek Vasut Date: Tue Mar 29 10:50:11 2022 +0200 drm/bridge: tc358767: Wrap (e)DP aux I2C registration into tc_aux_link_setup() This bit of code is (e)DP and aux I2C link specific, move it into tc_aux_link_setup() to permit cleaner addition of DSI-to-DPI mode. No functional change. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-8-marex@denx.de commit 8478095a8c4bcea3c83b0767d6c9127434160761 Author: Marek Vasut Date: Tue Mar 29 10:50:10 2022 +0200 drm/bridge: tc358767: Move (e)DP bridge endpoint parsing into dedicated function The TC358767/TC358867/TC9595 are all capable of operating in multiple modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Only the first mode is currently supported. In order to support the rest of the modes without making the tc_probe() overly long, split the bridge endpoint parsing into dedicated function, where the necessary logic to detect the bridge mode based on which endpoints are connected, can be implemented. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-7-marex@denx.de commit 65fdbb714d7f5764b6571b86f0617782cbe28ab1 Author: Marek Vasut Date: Tue Mar 29 10:50:09 2022 +0200 drm/bridge: tc358767: Implement atomic_check callback Implement .atomic_check callback which prevents user space from setting unsupported mode. The tc_edp_common_atomic_check() variant is already prepared for DSI-to-DPI mode addition, which has different frequency limits. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-6-marex@denx.de commit f5be62394dec1d05ba662c2068b0e512c29e1c36 Author: Marek Vasut Date: Tue Mar 29 10:50:08 2022 +0200 drm/bridge: tc358767: Convert to atomic ops Use the atomic version of the enable/disable operations to continue the transition to the atomic API. This will be needed to access the mode from the atomic state. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-5-marex@denx.de commit a219062b9a87fd0a1591266413e62596d9bd8316 Author: Marek Vasut Date: Tue Mar 29 10:50:07 2022 +0200 drm/bridge: tc358767: Change tc_ prefix to tc_edp_ for (e)DP specific functions These functions are specific to (e)DP output initialization and operation, add specific tc_edp_ prefix to those functions to discern them from DPI output functions that will be added later in this series. No functional change. Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Sam Ravnborg Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-4-marex@denx.de commit 9ba328035e68a2eae973f0c9fbb5df15f160612c Author: Marek Vasut Date: Tue Mar 29 10:50:06 2022 +0200 dt-bindings: display: bridge: tc358867: Document DSI data-lanes property It is necessary to specify the number of connected/used DSI data lanes when using the DSI input port of this bridge. Document the 'data-lanes' property of the DSI input port. Reviewed-by: Rob Herring Acked-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-3-marex@denx.de commit dd550c7cdbe3087adfd51360931938db4de8e832 Author: Marek Vasut Date: Tue Mar 29 10:50:05 2022 +0200 dt-bindings: display: bridge: tc358867: Document DPI output support The TC358767/TC358867/TC9595 are all capable of operating in multiple modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Document support for the DPI output port, which can now be connected both as input and output. Acked-by: Rob Herring Reviewed-by: Lucas Stach Tested-by: Lucas Stach # In both DPI to eDP and DSI to DPI mode. Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Neil Armstrong Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-2-marex@denx.de commit 7ed2b0dabf7a22874cb30f8878df239ef638eb53 Author: Lucas Stach Date: Mon Mar 21 11:47:05 2022 +0100 drm/bridge: adv7511: clean up CEC adapter when probe fails When the probe routine fails we also need to clean up the CEC adapter registered in adv7511_cec_init(). Fixes: 3b1b975003e4 ("drm: adv7511/33: add HDMI CEC support") Signed-off-by: Lucas Stach Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220321104705.2804423-1-l.stach@pengutronix.de commit 6f5efd118efafa22139e8670a4e4b506ba757dfd Author: Yang Yingliang Date: Sat Mar 26 15:33:26 2022 +0800 drm/bridge: anx7625: add missing destroy_workqueue() in anx7625_i2c_probe() Add the missing destroy_workqueue() before return from anx7625_i2c_probe() in the error handling case. Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Yang Yingliang Reviewed-by: Hsin-Yi Wang Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220326073326.3389347-1-yangyingliang@huawei.com commit 001b6169a9204d9b4013c4c0ff24fca08bf1ad16 Author: Ville Syrjälä Date: Thu Mar 31 14:28:22 2022 +0300 drm/i915: Allow static DRRS on LVDS Nothing special about static DRRS on LVDS, it's just your bog standard modeset. Let's allow it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-12-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 1159c83392787d9f7ad6dc443025b8eeed14085b Author: Ville Syrjälä Date: Thu Mar 31 14:28:21 2022 +0300 drm/i915: Allow static DRRS on all eDP ports Only seamless DRRS has specific hardware requirements so we can allow static DRRS on any eDP port. And we can replace these port checks and whatnot with a simple check to make sure the transcoder(s) we're about to use are capable of seamless DRRS. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-11-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit f244cdfa72b828d775f24251dac85b04ad1c4829 Author: Ville Syrjälä Date: Thu Mar 31 14:28:20 2022 +0300 drm/i915: Move intel_drrs_compute_config() into intel_dp.c intel_drrs_compute_config() is 100% DP specific. DRRS on other types of encoders wouldn't do any of these M2/N2 calculations etc. So let's move this into intel_dp.c so all the DP state calculation is more concentrated into one place. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit c19909d037b640a5e3580c68f420e7ba058c68e4 Author: Ville Syrjälä Date: Thu Mar 31 14:28:19 2022 +0300 drm/i915: Allow higher refresh rate alternate fixed modes We shouldn't restrict ourselves to just downclock modes with lower refresh rate than the preferred mode. Laptops these days can offer higher refresh rate modes as well. Remove the arbitrary limit and allow all modes that, apart from the clock, match the preferred mode. v2: s/add_edid_downclock_modes/add_edid_alt_fixed_modes/ (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7634bef123bcf42e64acb694d545ba93b79d5b5b Author: Ville Syrjälä Date: Thu Mar 31 14:28:18 2022 +0300 drm/i915: Allow an arbitrary number of downclock modes Remove the "two fixed modes only" limit and grab as many downclock modes from the EDID as we can find. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ccaa910128c52547102ba2e769cbadda5675df57 Author: Ville Syrjälä Date: Thu Mar 31 14:28:17 2022 +0300 drm/i915: Stop duplicating the EDID fixed/downclock modes Instead of duplicating the fixed/downclock modes we can just grab the originals straight from the probed_modes list and keep them. The next .get_modes() is going to repopulate the probed_modes list anyway so whatever we leave there is just going to sit around until that time wasting memory. In fact let's clear out the probed modes list entirely to make sure we get 100% consistent behaviour starting already from the very first real .get_modes(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 3a3c4ce92962a42d5ee9b1db435b4b3ffa5a4fc4 Author: Ville Syrjälä Date: Thu Mar 31 14:28:16 2022 +0300 drm/i915: Combine the EDID fixed_mode+downclock_mode lookup into one The intel_panel_add_edid_fixed_mode() vs. intel_panel_add_edid_downclock_mode() split is not really helpful. Let's just roll those into a single function so that the connector init code doesn't have to care too much about this. All we need to know is whether DRRS should be allowed or not. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 05d2d45e8736e91dfb7da28c2f51aa8e5cdc7d1f Author: Ville Syrjälä Date: Thu Mar 31 14:28:15 2022 +0300 drm/i915: Nuke intel_drrs_init() intel_drrs_init() is a mostly pointless wrapper around intel_panel_add_edid_downclock_mode(), get rid of it. The only really useful thing left in there is the debug print regarding the DRRS type supported by the connector. Let's just move that into intel_panel_init(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 54746f57f08959c68986c335b3156da6846d0ec2 Author: Ville Syrjälä Date: Thu Mar 31 14:28:14 2022 +0300 drm/i915: Refactor non-EDID fixed mode duplication All the non-EDID fixed mode functions basically do the exact same thing. Let's refactor the common bits into a shared function. There are minor differences on how the mode types are populated, whether the display info physical size is updated, and the debug print. The differences are purely accidental, so unifying them is actually a good thing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit db10c14a2523071369e87c24af854928d52dad34 Author: Ville Syrjälä Date: Thu Mar 31 14:28:13 2022 +0300 drm/i915: Put fixed modes directly onto the panel's fixed_modes list Rather than having the connector init get the fixed mode back from intel_panel and then feed it straight back into intel_panel_init() let's just make the fixed mode lookup put the mode directly onto the panel's fixed_modes list. Avoids the pointless round trip and opens the door for further enhancements to the fixed mode handling. v2: Make the debug message correct by using intel_panel_drrs_type() (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 1c05183a3709fbef6aea66cd50002e718aec2e95 Author: Ville Syrjälä Date: Thu Mar 31 14:28:12 2022 +0300 drm/i915: Extract intel_edp_has_drrs() Pull all the eDP specific platform/port checks out from intel_drrs_init() into intel_edp_has_drrs(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220331112822.11462-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit aeb9f0a4a3dc001b2ce382820d26fdf805cf0f9b Author: José Roberto de Souza Date: Thu Mar 31 11:41:52 2022 -0700 drm/i915/display: Add HAS_MBUS_JOINING This will make easy to extend MBUS joining support to future platforms that also supports this feature. Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220331184152.1086943-1-jose.souza@intel.com commit 9c67d9e84c7d4a3a2371a54ee2dddc4699002000 Author: Jani Nikula Date: Wed Mar 30 14:34:17 2022 +0300 drm/i915/dmc: split out dmc registers to a separate file Clean up the massive i915_reg.h a bit with this isolated set of registers. v2: Remove stale comment (Lucas) Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-3-jani.nikula@intel.com commit fe1295e628c911bf33ce7ecd2b2caae67065c639 Author: Jani Nikula Date: Wed Mar 30 14:34:16 2022 +0300 drm/i915/dmc: hide DMC version macros The macros are now only needed within intel_dmc.c, so move them there. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-2-jani.nikula@intel.com commit 5efde05f6af1c5dd1abf63cd26c004bdfb4bbb5c Author: Jani Nikula Date: Wed Mar 30 14:34:15 2022 +0300 drm/i915/dmc: abstract GPU error state dump Only intel_dmc.c should be accessing dmc details directly. Need to add an i915_error_printf() stub for CONFIG_DRM_I915_CAPTURE_ERROR=n. v2: Add the stub (kernel test robot ) Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi # v1 Link: https://patchwork.freedesktop.org/patch/msgid/20220330113417.220964-1-jani.nikula@intel.com commit bc58192a9b59fa75d5666bed9cc1b45fa49c6e0b Author: Vinod Govindapillai Date: Tue Mar 29 02:00:00 2022 +0300 drm/i915: Handle the DG2 max bw properly Update DG2 init bw info similar to other platforms even though DG2 has constant bandwidh. This will avoid branching out DG2 specific max bw calls. V3: Fix dg2_get_bw_info() and avoid handle special cases for DG2 (Ville Syrjälä) cc: Ville Syrjälä cc: Stanislav Lisovskiy Signed-off-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220328230000.215094-1-vinod.govindapillai@intel.com commit 3aefc722ff52076407203b6af9713de567993adf Author: Jani Nikula Date: Wed Mar 30 20:04:26 2022 +0300 drm/edid: fix invalid EDID extension block filtering The invalid EDID block filtering uses the number of valid EDID extensions instead of all EDID extensions for looping the extensions in the copy. This is fine, by coincidence, if all the invalid blocks are at the end of the EDID. However, it's completely broken if there are invalid extensions in the middle; the invalid blocks are included and valid blocks are excluded. Fix it by modifying the base block after, not before, the copy. Fixes: 14544d0937bf ("drm/edid: Only print the bad edid when aborting") Reported-by: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220330170426.349248-1-jani.nikula@intel.com commit 66bfe59dd307b0b601ef721d348d850c8bf2396e Author: Maxime Ripard Date: Mon Mar 28 14:43:04 2022 +0200 drm/vc4: Implement atomic_print_state for HVS channel state The HVS state configuration is useful when debugging what's going on in the vc4 hardware pipeline. Add an implementation of .atomic_print_state. Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220328124304.2309418-5-maxime@cerno.tech commit 220f125cd5153f570022b11a89d2f96b0e0979cf Author: Maxime Ripard Date: Mon Mar 28 14:43:03 2022 +0200 drm/vc4: Constify private state accessors None of those helpers modify the pointed data, let's make them const. Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220328124304.2309418-4-maxime@cerno.tech commit 97a1f01b3f2f734bd3982aa5639b2b54632f8f7d Author: Maxime Ripard Date: Mon Mar 28 14:43:02 2022 +0200 drm/atomic: Add atomic_print_state to private objects A number of drivers (amdgpu, komeda, vc4, etc.) leverage the drm_private_state structure, but we don't have any infrastructure to provide debugging like we do for the other components state. Let's add an atomic_print_state hook to be consistent. Reviewed-by: Daniel Vetter Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220328124304.2309418-3-maxime@cerno.tech commit 018ad18f6ab062a198627ec1bd5fd9d797c90238 Author: Maxime Ripard Date: Mon Mar 28 14:43:01 2022 +0200 drm/atomic: Print the state every non-blocking commit The DRM_UT_STATE controls whether we're calling drm_atomic_print_new_state() whenever a new state is committed. However, that call is made in the drm_mode_atomic_ioctl(), whereas we have multiple users of the drm_atomic_commit() function in the kernel (framebuffer emulation, drm_atomic_helper_dirtyfb, etc.). This leads to multiple states being committed but never actually displayed even though we asked to have verbose atomic state debugging. Let's move the call to drm_atomic_print_new_state() to drm_atomic_commit() to make sure we don't miss any. Non-blocking commits were never logged though, and it would create too much churn in the logs to do so, so leave them out for now. Signed-off-by: Maxime Ripard Reviewed-by: Daniel Vetter Link: https://lore.kernel.org/r/20220328124304.2309418-2-maxime@cerno.tech commit d049a24b15d8c1c90461933f0526b582a8cdf9b4 Author: Matthias Kaehlcke Date: Wed Mar 30 09:04:44 2022 -0700 drm/panel-edp: Fix AUO B133UAN01 panel id Two digits are swapped in the AUO B133UAN01 panel id (0x8495 instead of 0x8594). This went initially unnoticed because the panel is still detected, though it is set up with a conservative default timing. Fix the digit swap. Fixes: ec57376fba5a ("drm/panel-edp: Add AUO B133UAN01") Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220330090435.1.Id1522250dd07a6b574c1cc7826023fc6acd141b4@changeid commit 47e794d69c0d8a4a1ff91fcb6e3d69bc38fcfef2 Author: José Roberto de Souza Date: Wed Mar 30 08:57:24 2022 -0700 drm/i915/display/adlp: Fix programing of PIPE_MBUS_DBOX_CTL PIPE_MBUS_DBOX_CTL was only being programmed when a pipe is being enabled but that could potentially cause issues as it could have mismatching values while pipes are being enabled. So here moving the PIPE_MBUS_DBOX_CTL programming of all pipes to be executed before the function that enables all pipes, leaving all pipes with a matching A_CREDIT value. While at it, also moving it to intel_pm.c as we are trying to reduce the gigantic size of intel_display.c and intel_pm.c have other MBUS programing sequences. v2: - do not program PIPE_MBUS_DBOX_CTL if pipe will not be active or when it do not needs modeset - remove the checks to wait a vblank v3: - checking if dbuf state is present in state before using it v4: - removing redundant checks - calling intel_atomic_get_new_dbuf_state instead of intel_atomic_get_dbuf_state BSpec: 49213 BSpec: 50343 Reviewed-by: Ville Syrjälä Cc: Ville Syrjälä Cc: Stanislav Lisovskiy Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220330155724.255226-3-jose.souza@intel.com commit 291f63e72e56a6433910d80e23da384c62077538 Author: Caz Yokoyama Date: Wed Mar 30 08:57:23 2022 -0700 drm/i915/display/adlp: Adjust MBUS DBOX BW and B credits Alderlake-P has different MBUS DBOX BW and B credits than other platforms, so here setting it properly. BSpec: 49213 BSpec: 50343 Cc: Matt Roper Cc: Stanislav Lisovskiy Cc: Jani Nikula Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Caz Yokoyama Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220330155724.255226-2-jose.souza@intel.com commit d7ade5f20e5319a2104e22c47fc414619453ca93 Author: José Roberto de Souza Date: Wed Mar 30 08:57:22 2022 -0700 drm/i915/display/tgl+: Set default values for all registers in PIPE_MBUS_DBOX_CTL MBUS_DBOX_B2B_TRANSACTIONS_MAX, MBUS_DBOX_B2B_TRANSACTIONS_DELAY and MBUS_DBOX_REGULATE_B2B_TRANSACTIONS_EN were being programmed with zeros while specification has different default values for this registers in display 12 and newer. While at it also converting all MBUS_DBOX macros to use REG_* macros. BSpec: 50343 BSpec: 20231 Reviewed-by: Ville Syrjälä Cc: Ville Syrjälä Cc: Stanislav Lisovskiy Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220330155724.255226-1-jose.souza@intel.com commit 3f654e14825effb1d68ea481f96dc027e404365a Author: José Roberto de Souza Date: Fri Mar 25 07:22:49 2022 -0700 drm/i915/dg2: Add Wa_22014226127 New DG2 workaround added to specification. BSpec: 54077 BSpec: 66622 BSpec: 54833 Cc: Matt Roper Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220325142249.81443-1-jose.souza@intel.com commit 1dedcdd0336c356e7ac8eb9b3bc3fe3b4faeac8d Author: Jani Nikula Date: Wed Mar 30 12:30:19 2022 +0300 drm/i915/dp: make DSC usage logging actually useful Debug log when DSC is going to be used, and why, instead of unconditionally logging the rarely used debug option setting, which might not have any bearing on whether DSC is going to be used or not. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220330093019.4150386-1-jani.nikula@intel.com commit 179db7c1be5c09aa1b1493d45e6f88aebd525b96 Author: Jani Nikula Date: Wed Mar 30 12:41:09 2022 +0300 drm/i915/audio: move has_audio checks to within codec enable/disable Reduce duplication. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220330094109.4164326-2-jani.nikula@intel.com commit 1f31e35f2e88d7e222f8246d2a34db02aa035c60 Author: Jani Nikula Date: Wed Mar 30 12:41:08 2022 +0300 drm/i915/audio: unify audio codec enable/disable debug logging The audio codec enable/disable debug logging is spread around in callers and the platform specific hooks. Put them all together in one place on both the enable and disable paths. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220330094109.4164326-1-jani.nikula@intel.com commit 10ec4afd238d82a4840491a46484d2311db39500 Author: Even Xu Date: Wed Mar 30 22:27:45 2022 +0800 HID: intel-ish-hid: ipc: add ADL and RPL device id Add device IDs of Alder Lake N and Raptor Lake S into ishtp support list. Signed-off-by: Even Xu Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit a7f46d5b91a5eb005e9719cae55eb08774f59201 Author: Tvrtko Ursulin Date: Tue Mar 29 10:02:04 2022 +0100 drm/i915: Move intel_vtd_active and run_as_guest to i915_utils Continuation of the effort to declutter i915_drv.h. Also, component specific helpers which consult the iommu/virtualization helpers moved to respective component source/header files as appropriate. v2: * s/dev_priv/i915/ in intel_scanout_needs_vtd_wa. (Lucas) Signed-off-by: Tvrtko Ursulin Cc: Jani Nikula Cc: Lucas De Marchi Acked-by: Jani Nikula Reviewed-by: Lucas De Marchi Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220329090204.2324499-1-tvrtko.ursulin@linux.intel.com [tursulin: fixup conflict in i915_drv.h] commit ca2cae9a48dd09b90b7c33d20f12ec718ef0b571 Author: Jani Nikula Date: Mon Mar 21 15:50:32 2022 +0200 drm/i915/dmc: fix i915_reg_t usage i915_reg_t is supposed to be a somewhat opaque data type, not to be looked inside. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/b813d0cf1b800386742eb3f919b0ba8d5c182a2a.1647870374.git.jani.nikula@intel.com commit f0147745f78685350e027c430449e242bdc2ec1e Author: Jani Nikula Date: Mon Mar 21 15:50:31 2022 +0200 drm/i915/dmc: move dmc debugfs to intel_dmc.c Continue localizing DMC register and data access to intel_dmc.c. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/3b7bc0fc117b030d59dd74891af104c165bf9b39.1647870374.git.jani.nikula@intel.com commit 790daf744ea8edf4cf8df0c1d24154af294da3f9 Author: Jani Nikula Date: Mon Mar 21 15:50:30 2022 +0200 drm/i915/dmc: move assert_dmc_loaded() to intel_dmc.c Start localizing DMC register and data access to intel_dmc.c. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/4b96fe56c9c01bc671992dd6fe619638b157878f.1647870374.git.jani.nikula@intel.com commit 78a574deef7f4addf3eb6f90ddf209ef21788d76 Author: Jani Nikula Date: Mon Mar 21 15:50:29 2022 +0200 drm/i915/dmc: simplify intel_dmc_load_program() conditions intel_dmc_load_program() is only ever called when intel_dmc_has_payload() is true. Move the condition within intel_dmc_load_program() to let it be called directly. Also note that intel_dmc_has_payload() will always return false when HAS_DMC() is false. Remove the redundant check. Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/c8ec46a44071f80b9c97617391b30e0c61ebc3e6.1647870374.git.jani.nikula@intel.com commit 1f682dc9fb3790aa7ec27d3d122ff32b1eda1365 Author: Wen Gong Date: Sun Mar 27 23:58:32 2022 -0400 ath11k: reduce the wait time of 11d scan and hw scan while add interface Currently ath11k will wait 11d scan complete while add interface in ath11k_mac_op_add_interface(), when system resume without enable wowlan, ath11k_mac_op_add_interface() is called for each resume, thus it increase the resume time of system. And ath11k_mac_op_hw_scan() after ath11k_mac_op_add_interface() also needs some time cost because the previous 11d scan need more than 5 seconds when 6 GHz is enabled, then the scan started event will indicated to ath11k after the 11d scan completed. While 11d scan/hw scan is running in firmware, if ath11k update channel list to firmware by WMI_SCAN_CHAN_LIST_CMDID, then firmware will cancel the current scan which is running, it lead the scan failed. The patch commit 9dcf6808b253 ("ath11k: add 11d scan offload support") used finish_11d_scan/finish_11d_ch_list/pending_11d to synchronize the 11d scan/hw scan/channel list between ath11k/firmware/mac80211 and to avoid the scan fail. Add wait operation before ath11k update channel list, function ath11k_reg_update_chan_list() will wait until the current 11d scan/hw scan completed. And remove the wait operation of start 11d scan and waiting channel list complete in hw scan. After these changes, resume time cost reduce about 5 seconds and also hw scan time cost reduced obviously, and scan failed not seen. The 11d scan is sent to firmware only one time for each interface added in mac.c, and it is moved after the 1st hw scan because 11d scan will cost some time and thus leads the AP scan result update to UI delay. Currently priority of ath11k's hw scan is WMI_SCAN_PRIORITY_LOW, and priority of 11d scan in firmware is WMI_SCAN_PRIORITY_MEDIUM, then the 11d scan which sent after hw scan will cancel the hw scan in firmware, so change the priority to WMI_SCAN_PRIORITY_MEDIUM for the hw scan which is in front of the 11d scan, thus it will not happen scan cancel in firmware. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 9dcf6808b253 ("ath11k: add 11d scan offload support") Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328035832.14122-1-quic_wgong@quicinc.com commit 801cb1d234288d9bc2afeaa98c7e98f8038b7a6c Author: Wen Gong Date: Mon Mar 28 14:57:19 2022 +0300 ath11k: add support to search regdb data in board-2.bin for WCN6855 Currently ath11k only download the same regdb.bin file for all WCN6855 chips, actually ath11k needs to distinguish all different WCN6855 chips. This is to re-use the string type which include bus, chip id, board id, vendor, device, subsystem-vendor, subsystem-device and variant for WCN6855 to distinguish different regdb in board-2.bin. ath11k will first load board-2.bin and search in it for the regdb data with the above parameters, if matched one regdb data, then download it to firmware, if not matched any one, then ath11k will download the file regdb.bin to firmware. Add enum value ATH11K_BD_IE_REGDB and enum type ath11k_bd_ie_regdb_type to distinguish regdb data and board data since they are in the same file board-2.bin. This only take effect for WCN6855 which supports regdb in hardware parameters. Test log: [ 3833.091948] ath11k_pci 0000:05: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' [ 3833.092072] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 205316 [ 3833.092079] ath11k_pci 0000:05:00.0: board name [ 3833.092083] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092088] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31 -id=1 [ 3833.092091] ath11k_pci 0000:05:00.0: board name [ 3833.092095] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092099] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32 -id=2 [ 3833.092102] ath11k_pci 0000:05:00.0: board name [ 3833.092105] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092109] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33 -id=3 [ 3833.092112] ath11k_pci 0000:05:00.0: board name [ 3833.092116] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [ 3833.092119] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [ 3833.092123] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [ 3833.092126] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [ 3833.092130] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [ 3833.092133] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [ 3833.092137] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36 2c 76 61 72 69 61 ard-id=266,varia [ 3833.092140] ath11k_pci 0000:05:00.0: 00000070: 6e 74 3d 48 50 5f 47 38 5f 4c 61 6e 63 69 61 31 nt=HP_G8_Lancia1 [ 3833.092144] ath11k_pci 0000:05:00.0: 00000080: 35 5 [ 3833.092147] ath11k_pci 0000:05:00.0: board name [ 3833.092150] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [ 3833.092154] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [ 3833.092157] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [ 3833.092161] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [ 3833.092165] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [ 3833.092168] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [ 3833.092172] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36 ard-id=266 [ 3833.092206] ath11k_pci 0000:05:00.0: board name [ 3833.092209] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [ 3833.092213] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [ 3833.092216] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [ 3833.092220] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [ 3833.092223] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [ 3833.092227] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [ 3833.092230] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32 ard-id=262 [ 3833.092234] ath11k_pci 0000:05:00.0: boot found match regdb data for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262' [ 3833.092238] ath11k_pci 0000:05:00.0: board name [ 3833.092241] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092245] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31 31 -id=11 [ 3833.092248] ath11k_pci 0000:05:00.0: board name [ 3833.092251] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092255] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32 32 -id=22 [ 3833.092258] ath11k_pci 0000:05:00.0: board name [ 3833.092261] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70 bus=pci,qmi-chip [ 3833.092265] ath11k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33 33 -id=33 [ 3833.092268] ath11k_pci 0000:05:00.0: boot found regdb data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262' [ 3833.092272] ath11k_pci 0000:05: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/20220319023543.14288-4-quic_wgong@quicinc.com commit 1216c4d30723f5ed5b7576a2b96dafc4c5a8cbf9 Author: Edmond Gagnon Date: Fri Mar 25 17:42:12 2022 -0500 wcn36xx: Implement tx_rate reporting Currently, the driver reports a tx_rate of 6.0 MBit/s no matter the true rate: root@linaro-developer:~# iw wlan0 link Connected to 6c:f3:7f:eb:9b:92 (on wlan0) SSID: SQ-DEVICETEST freq: 5200 RX: 4141 bytes (32 packets) TX: 2082 bytes (15 packets) signal: -77 dBm rx bitrate: 135.0 MBit/s MCS 6 40MHz short GI tx bitrate: 6.0 MBit/s bss flags: short-slot-time dtim period: 1 beacon int: 100 This patch requests HAL_GLOBAL_CLASS_A_STATS_INFO via a hal_get_stats firmware message and reports it via ieee80211_ops::sta_statistics. root@linaro-developer:~# iw wlan0 link Connected to 6c:f3:7f:eb:73:b2 (on wlan0) SSID: SQ-DEVICETEST freq: 5700 RX: 26788094 bytes (19859 packets) TX: 1101376 bytes (12119 packets) signal: -75 dBm rx bitrate: 135.0 MBit/s MCS 6 40MHz short GI tx bitrate: 108.0 MBit/s VHT-MCS 5 40MHz VHT-NSS 1 bss flags: short-slot-time dtim period: 1 beacon int: 100 Tested on MSM8939 with WCN3680B running firmware CNSS-PR-2-0-1-2-c1-00083, and verified by sniffing frames over the air with Wireshark to ensure the MCS indices match. Signed-off-by: Edmond Gagnon Reviewed-by: Benjamin Li Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220325224212.159690-1-egagnon@squareup.com commit 412c942bdfae114bd3e1570936cef59d5aeb4f54 Author: Matt Roper Date: Mon Mar 28 17:08:21 2022 -0700 drm/i915/ats-m: add ATS-M platform info ATS-M is a server platform based on Xe_HPG and Xe_HPM, but without display support. From a driver point of view, it's easiest to just handle it as DG2 (including identifying as PLATFORM_DG2), but with the display disabled in the device info. Signed-off-by: Matt Roper Reviewed-by: Balasubramani Vivekanandan Link: https://patchwork.freedesktop.org/patch/msgid/20220329000822.1323195-1-matthew.d.roper@intel.com commit ec57376fba5abc0e571617ff88e2ade7970c2e4b Author: Matthias Kaehlcke Date: Thu Mar 24 13:48:25 2022 -0700 drm/panel-edp: Add AUO B133UAN01 Add support for the AUO B133UAN01 13.3" WUXGA panel. Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220324134819.v2.1.I816014b6c62da5a33af5021f3cc35cea66552c00@changeid commit 756b807f6a3e01d238c346925006cdfd6a59e341 Author: Tejas Upadhyay Date: Tue Mar 22 09:36:16 2022 +0530 drm/i915: Add RPL-S PCI IDs Add couple of RPL-S device ids Bspec : 53655 Cc: Matt Roper Signed-off-by: Tejas Upadhyay Reviewed-by: Anshuman Gupta Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220322040616.1078009-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit 50203b943b4f8522e6991e38e0f11594cd6845f8 Author: Ville Syrjälä Date: Wed Mar 23 20:29:35 2022 +0200 drm/i915: Change SDVO fixed mode handling SDVO is the only connector type currently returning the VBT fixed mode directly from .get_modes(), everyone else just adds it to the fixed_modes list and then returns that from .get_modes(). Adjust SDVO to follow the common behaviour. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7a36980cd2360141b5a6930236399a33c7cbbbb6 Author: Ville Syrjälä Date: Wed Mar 23 20:29:34 2022 +0200 drm/i915: Use intel_panel_edid_fixed_mode() for sdvo Despite the name intel_panel_edid_fixed_mode() doesn't actually look in the EDID. All it does is dig out the preferred mode from the connector's probed_modes list. That is also what the SDVO LVDS code is doing by hand. Let's just call intel_panel_edid_fixed_mode(). The slight difference in behaviour is that the SDVO code currently bails if it can't find the preferred mode, whereas intel_panel_edid_fixed_mode() will fall back to just returning the first mode from the probed_modes list. Can't imagine why such an LVDS panel would even exist, and also why would you have a panel and be expected to not use it? So I'm going to assume this is a total non-issue. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5248cc781d2f4a087cf20ee3c806e2945af03725 Author: Ville Syrjälä Date: Wed Mar 23 20:29:33 2022 +0200 drm/i915: Extract intel_panel_encoder_fixed_mode() Apart from the EDID and VBT based mechanism we also sometimes use the encoder's current mode as the panel fixed mode. We currently have the same code for that duplicated in two places. Let's unify. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 14daee248f0102359898e21706f570c274c11948 Author: Ville Syrjälä Date: Wed Mar 23 20:29:32 2022 +0200 drm/i915: Extract intel_panel_vbt_sdvo_fixed_mode() We have a function for duplicating the VBT LFP mode. Add the same for the VBT SDVO mode. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 688a9bbccb9034952c40b442f0f03a6a0c07d36f Author: Ville Syrjälä Date: Wed Mar 23 20:29:31 2022 +0200 drm/i915: Rename intel_panel_vbt_fixed_mode() Rename intel_panel_vbt_fixed_mode() to intel_panel_vbt_lfp_fixed_mode() to be more descriptive. We'll have another VBT fixed mode function soon and we don't want to confuse the two. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f6d39f563cf73f3e2608d0f171babe24c0394c9b Author: Ville Syrjälä Date: Wed Mar 23 20:29:30 2022 +0200 drm/i915: Use intel_panel_preferred_fixed_mode() more Use intel_panel_preferred_fixed_mode() for all the orientation quirk setup and compute_is_dual_link_lvds()). All of these happen after intel_panel_init() so the panel fixed_mode list is already in place. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e9ebf1359514ab6cfe972cddf87a9cb8ad859214 Author: Ville Syrjälä Date: Wed Mar 23 20:29:29 2022 +0200 drm/i915: Extract intel_edp_add_properties() Pull the drm_connector_set_panel_orientation_with_quirk() into intel_edp_add_properties() to match how the DSI encoders do it. Less clutter in intel_edp_init_connector() overall. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f01bae2dca3ec54fc607b8879dd4558e8a336dde Author: Ville Syrjälä Date: Wed Mar 23 20:29:28 2022 +0200 drm/i915: Use DRM_MODE_FMT+DRM_MODE_ARG() Replace all drm_mode_debug_printmodeline() calls with DRM_MODE_FMT+DRM_MODE_ARG(). Makes the debug output a bit more terse in places where we previously had a newline in the precedeing drm_dbg_kms(), and avoids anything else sneaking in between the two printk()s in all cases. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5d2fd49db9b48c37041d0f9565b1c6fad2c09ce3 Author: Ville Syrjälä Date: Wed Mar 23 20:29:27 2022 +0200 drm/i915: Pass intel_connector to intel_panel_{init,fini}() All the other intel_panel functions take struct intel_connector, so might as well make init()/fini() take one as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323182935.4701-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d13dde4495800c4e7b98d81eab9472ae248ff49e Author: Ville Syrjälä Date: Thu Feb 24 18:51:03 2022 +0200 drm/i915: Split pipe+output CSC programming to noarm+arm pair Move most of the pipe+output CSC programming to the .color_commit_noarm() hook which runs before vblank evasion. Only PIPE_CSC_MODE (the arming register) needs to remain in inside the critical section. A test case that just updates the CTM in a loop produces the following i915_update_info numbers on ilk (w/o lockdep): old new Updates: 10012 Updates: 10008 | | 1us |** 1us |********** |************* |************* 4us |********* 4us |* |* |** 16us | 16us | | | 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 1345ns Min update: 1268ns Max update: 16672ns Max update: 15656ns Average update: 3914ns Average update: 2185ns Overruns > 100us: 0 Overruns > 100us: 0 And here is tgl (forced to update both pipe CSC and output CSC, and with lockdep enabled): old new Updates: 10012 Updates: 10012 | | 1us | 1us | | | 4us |* 4us |** |** |********** 16us |************* 16us |************* |* | 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 5204ns Min update: 5176ns Max update: 176038ns Max update: 186685ns Average update: 23931ns Average update: 16654ns Overruns > 250us: 0 Overruns > 250us: 0 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-5-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit e9b14658d51950d5ab6ef219fb3c9483c70a18ec Author: Ville Syrjälä Date: Thu Feb 24 18:51:02 2022 +0200 drm/i915: Split color_commit() into noarm+arm pair To reduce the amount of registers written during the vblank evade critical section let's also split the .color_commit() hook to noarm+arm pair. The noarm hook runs before the vblank evasion with the arm hook staying inside the critical section. Just the framework here, actually moving stuff out into the noarm hook will follow. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 46fc66be60e806c90d5ca3c85887dfb12857ba47 Author: Ville Syrjälä Date: Thu Feb 24 18:51:01 2022 +0200 drm/i915: Make ilk+ pfit regiser unlocked The ilk+ panel fitter register are sitting nicely on their own cacheline, so no need for global serialization via uncore.lock. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit e0c603ef705019ae28d195a0faa5f568372f3bf9 Author: Ville Syrjälä Date: Thu Feb 24 18:51:00 2022 +0200 drm/i915: Remove locks around skl+ scaler programming All the skl+ scaler registers are suitably confined to their own cachelines so we don't need the uncore.lock to globally serialize access to these registers. We actually already dropped some of this in commit 14ad15296d1f ("drm/i915: Make skl+ universal plane registers unlocked") as the plane scaler enabling/reconfiguration became lockless. So let's complete that and remove the rest of the locks from the scaler programming as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224165103.15682-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit fd04847372ba86347066c536ba99bc3c1f351334 Author: José Roberto de Souza Date: Fri Mar 25 11:38:32 2022 -0700 docs: gpu: i915.rst: Fix DRRS documentation intel_drrs_enable() and intel_drrs_disable() were renamed to intel_drrs_activate() and intel_drrs_deactivate() in commit 54903c7a6b40 ("drm/i915: s/enable/active/ for DRRS") and it is causing warnings when generating the kernel documentation. But as for a while DRRS has its own file, so here just let the tool generate the documentation for all exported and documented functions in intel_drrs.c. Cc: Ville Syrjälä Cc: Rodrigo Vivi Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220325183832.146472-1-jose.souza@intel.com commit f40ab034b6aebb7ee9461d402915ca83e693d1bd Author: Jani Nikula Date: Mon Mar 28 17:34:33 2022 +0300 drm/edid: split drm_add_edid_modes() to two Reduce the size of the function that actually modifies the EDID. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/437c3c79f68d1144444fb2dd18a678f3aa97272c.1648477901.git.jani.nikula@intel.com commit f4e558ec9d9fb9484c30221a41cc5bfa73d33e6c Author: Jani Nikula Date: Mon Mar 28 17:34:32 2022 +0300 drm/edid: add more general struct edid constness in the interfaces With this, the remaining non-const parts are the ones that actually modify the EDID, for example to fix corrupt EDID. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/c7156f22494b585c55a00a6732462bde0cc19dbf.1648477901.git.jani.nikula@intel.com commit c14e724114fe0e90685297e6c10ebdb14d40a7ec Author: Jani Nikula Date: Mon Mar 28 17:34:31 2022 +0300 drm/edid: constify struct edid passed around in callbacks and closure Finalize detailed timing parsing constness by making struct edid also const in callbacks and closure. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/8229be49b5a7686856c17428aa9291b4c4cf1bd5.1648477901.git.jani.nikula@intel.com commit eed628f116a7004f9ef751537d603f8b3d785298 Author: Jani Nikula Date: Mon Mar 28 17:34:30 2022 +0300 drm/edid: constify struct edid passed to detailed blocks Constify the first level of struct edid in detailed timing parsing. Also switch to struct edid instead of u8. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/ec7acb8a9ee0e2868bbb2afdfdd7db114ae180e1.1648477901.git.jani.nikula@intel.com commit 4194442daf053754cc6b726b3d624223dd5458d8 Author: Jani Nikula Date: Mon Mar 28 17:34:29 2022 +0300 drm/edid: constify struct detailed_timing in parsing callbacks Moving one level higher, constify struct detailed_timing pointers in callbacks. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/9b617068d2349a574a837ad6207b1d45c4d79eb5.1648477901.git.jani.nikula@intel.com commit fcfb2ea19868f18065ba49add81cc10533d237da Author: Jani Nikula Date: Mon Mar 28 17:34:28 2022 +0300 drm/edid: constify struct detailed_timing in lower level parsing Start constifying the struct detailed_timing pointers being passed around from bottom up. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/0b7fafcc7784db0003e454544916c273a9eb1250.1648477901.git.jani.nikula@intel.com commit c8a4beba19a56cb45cfc8b68f146eb63a25f7841 Author: Jani Nikula Date: Mon Mar 28 17:34:27 2022 +0300 drm/edid: use struct detailed_timing member access in gtf2 functions Use struct detailed_timing member access instead of direct offsets to avoid casting. Use BUILD_BUG_ON() for sanity check. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/9fe5f5c39039e585fecfffb390297d49262e5fd3.1648477901.git.jani.nikula@intel.com commit 90fd588f03a6392533c9e46c16dd4e50a12184ae Author: Jani Nikula Date: Mon Mar 28 17:34:26 2022 +0300 drm/edid: use struct detailed_timing member access in is_rb() Use struct detailed_timing member access instead of direct offsets to avoid casting. Use BUILD_BUG_ON() for sanity check. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/c069669c2fe8f9c3061c7d1a413c75a33ec48813.1648477901.git.jani.nikula@intel.com commit a9b1f15f53313f967edd5088a60970cc829ab5a6 Author: Jani Nikula Date: Mon Mar 28 17:34:25 2022 +0300 drm/edid: pass a timing pointer to is_detailed_timing_descriptor() Use struct member access instead of direct offsets to avoid a cast. Use BUILD_BUG_ON() for sanity check. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/0b5213383e14f11c6a505b10a7342fb2ff4f2a11.1648477901.git.jani.nikula@intel.com commit e379814b5fb719b22c01c7a81f14b98cbaac3c42 Author: Jani Nikula Date: Mon Mar 28 17:34:24 2022 +0300 drm/edid: pass a timing pointer to is_display_descriptor() Use struct member access instead of direct offsets to avoid lots of casts all over the place. Use BUILD_BUG_ON() for sanity check. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/ccc54b45ea628874c0290dd64114da6cefff1819.1648477901.git.jani.nikula@intel.com commit 73091e4fb78b5d88913593012ad74a1c0ff266da Author: Jani Nikula Date: Mon Mar 28 17:34:23 2022 +0300 drm/edid: fix reduced blanking support check The reduced blanking bit is valid only for CVT, indicated by display range limits flags 0x04. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/5dea5ee24065450716bbc177dd6850d3193dbeec.1648477901.git.jani.nikula@intel.com commit faacff8e6a5209b0b6a57fa58ba292742ab442d2 Author: Jani Nikula Date: Mon Mar 28 17:34:22 2022 +0300 drm/edid: don't modify EDID while parsing We'll want to keep the EDID immutable while parsing. Stop modifying the EDID because of the quirks. In theory, this does have userspace implications, but the userspace is supposed to use the modes exposed via KMS API, not by parsing the EDID directly. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Emil Velikov Link: https://patchwork.freedesktop.org/patch/msgid/45d5cf067eaad49b321ac82836090d9de524374e.1648477901.git.jani.nikula@intel.com commit 657586e474bd025d534d4ea355ec3211d9883cd8 Author: Imre Deak Date: Tue Mar 22 16:38:44 2022 +0200 drm/i915: Add a DP1.2 compatible way to read LTTPR capabilities At least some DELL monitors (P2715Q) with DPCD_REV 1.2 return corrupted DPCD register values when reading from the 0xF0000- LTTPR range with an AUX transaction block size bigger than 1. The DP standard requires 0 to be returned - as for any other reserved/invalid addresses - but these monitors return the DPCD_REV register value repeated in each byte of the read buffer. This will in turn corrupt the values returned by the LTTPRs between the source and the monitor: LTTPRs must adjust the values they read from the downstream DPRX, for instance right-shift/init the downstream DP_PHY_REPEATER_CNT value. Since the value returned by the monitor's DPRX is non-zero the adjusted values will be corrupt. Reading the LTTPR registers one-by-one instead of reading all of them with a single AUX transfer works around the issue. According to the DP standard's 0xF0000 register description: "LTTPR-related registers at DPCD Addresses F0000h through F02FFh are valid only for DPCD r1.4 (or higher)." While it's unclear if DPCD r1.4 refers to the DPCD_REV or to the LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV register (tickets filed at the VESA site to clarify this haven't been addressed), one possibility is that it's a restriction due to non-compliant monitors described above. Disabling the non-transparent LTTPR mode for all such monitors is not a viable solution: the transparent LTTPR mode has its own issue causing link training failures and this would affect a lot of monitors in use with DPCD_REV < 1.4. Instead this patch works around the problem by reading the LTTPR common and PHY cap registers one-by-one for any monitor with a DPCD_REV < 1.4. The standard requires the DPCD capabilities to be read after the LTTPR common capabilities are read, so re-read the DPCD capabilities after the LTTPR common and PHY caps were read out. v2: - Use for instead of a while loop. (Ville) - Add to code comment the monitor model with the problem. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4531 Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220322143844.42616-1-imre.deak@intel.com commit 8b917cbe38e9b0d002492477a9fc2bfee2412ce4 Author: Xiaomeng Tong Date: Sun Mar 27 14:15:16 2022 +0800 tilcdc: tilcdc_external: fix an incorrect NULL check on list iterator The bug is here: if (!encoder) { The list iterator value 'encoder' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found. To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'encoder' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: ec9eab097a500 ("drm/tilcdc: Add drm bridge support for attaching drm bridge drivers") Signed-off-by: Xiaomeng Tong Reviewed-by: Jyri Sarha Tested-by: Jyri Sarha Signed-off-by: Jyri Sarha Link: https://patchwork.freedesktop.org/patch/msgid/20220327061516.5076-1-xiam0nd.tong@gmail.com commit bdef417d84536715145f6dc9cc3275c46f26295a Author: Xiaomeng Tong Date: Sun Mar 27 13:20:28 2022 +0800 gma500: fix an incorrect NULL check on list iterator The bug is here: return crtc; The list iterator value 'crtc' will *always* be set and non-NULL by list_for_each_entry(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found. To fix the bug, return 'crtc' when found, otherwise return NULL. Cc: stable@vger.kernel.org fixes: 89c78134cc54d ("gma500: Add Poulsbo support") Signed-off-by: Xiaomeng Tong Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220327052028.2013-1-xiam0nd.tong@gmail.com commit 77ef271faee9c3be65fc5e5dcd66c45d4ffbe494 Author: Christian König Date: Fri Jul 16 14:37:14 2021 +0200 drm/amdgpu: drop amdgpu_gtt_node We have the BO pointer in the base structure now as well. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Tested-by: Bas Nieuwenhuizen Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-6-christian.koenig@amd.com commit fee2ede155423b0f7a559050a39750b98fe9db69 Author: Christian König Date: Mon Jan 24 11:07:15 2022 +0100 drm/ttm: rework bulk move handling v5 Instead of providing the bulk move structure for each LRU update set this as property of the BO. This should avoid costly bulk move rebuilds with some games under RADV. v2: some name polishing, add a few more kerneldoc words. v3: add some lockdep v4: fix bugs, handle pin/unpin as well v5: improve kerneldoc Signed-off-by: Christian König Tested-by: Bas Nieuwenhuizen Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-5-christian.koenig@amd.com commit 7842cf65b0401814a9df518a86a41641255c84d3 Author: Christian König Date: Tue Feb 15 17:29:59 2022 +0100 drm/ttm: de-inline ttm_bo_pin/unpin Those functions are going to become more complex, don't inline them any more. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-4-christian.koenig@amd.com commit 552caa1fdbb8624d98964e3f0200fe78f4906a1a Author: Matthew Auld Date: Thu Mar 24 17:21:43 2022 +0000 drm/i915/migrate: move the sanity check Move the sanity check that both src and dst are never both system memory, which should never happen on discrete, and likely means we have a bug. The only exception is on integrated where we trigger this path in the selftests. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Reviewed-by: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220324172143.377104-2-matthew.auld@intel.com commit 66ddc69373a8d5a08fe4341d9e912bfdac602248 Author: Matthew Auld Date: Thu Mar 24 17:21:42 2022 +0000 drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS We only need this when allocating device local-memory, where this influences the drm_buddy. Currently there is some funny behaviour where an "in limbo" system memory object is lacking the relevant placement flags etc. before we first allocate the ttm_tt, leading to ttm performing a move when not needed, since the current placement is seen as not compatible. Suggested-by: Thomas Hellström Fixes: 2ed38cec5606 ("drm/i915: opportunistically apply ALLOC_CONTIGIOUS") Signed-off-by: Matthew Auld Cc: Nirmoy Das Reviewed-by: Thomas Hellström Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220324172143.377104-1-matthew.auld@intel.com commit d8b932014c4aa5a70bb6add0f14d9329e7c489c2 Author: Fei Yang Date: Mon Mar 28 10:16:50 2022 -0700 drm/i915: avoid concurrent writes to aux_inv GPU hangs have been observed when multiple engines write to the same aux_inv register at the same time. To avoid this each engine should only invalidate its own auxiliary table. The function gen12_emit_flush_xcs() currently invalidate the auxiliary table for all engines because the rq->engine is not necessarily the engine eventually carrying out the request, and potentially the engine could even be a virtual one (with engine->instance being -1). With the MMIO remap feature, we can actually set bit 17 of MI_LRI instruction and let the hardware to figure out the local aux_inv register at runtime to avoid invalidating auxiliary table for all engines. Bspec: 45728 v2: Invalidate AUX table for indirect context as well. Cc: Stuart Summers Cc: Tvrtko Ursulin Signed-off-by: Chris Wilson Signed-off-by: Fei Yang Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220328171650.1900674-1-fei.yang@intel.com commit 6ce4431c7ba7954c4fa6a96ce16ca1b2943e1a83 Author: Xiaomeng Tong Date: Sun Mar 27 15:39:25 2022 +0800 drm/nouveau/kms/nv50-: atom: fix an incorrect NULL check on list iterator The bug is here: return encoder; The list iterator value 'encoder' will *always* be set and non-NULL by drm_for_each_encoder_mask(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element found. Otherwise it will bypass some NULL checks and lead to invalid memory access passing the check. To fix this bug, just return 'encoder' when found, otherwise return NULL. Cc: stable@vger.kernel.org Fixes: 12885ecbfe62d ("drm/nouveau/kms/nvd9-: Add CRC support") Signed-off-by: Xiaomeng Tong Reviewed-by: Lyude Paul [Changed commit title] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220327073925.11121-1-xiam0nd.tong@gmail.com commit b0e2c9ea5afc769476fd85a6a28cc370ddd44ee8 Author: Christian König Date: Mon Jan 24 09:37:43 2022 +0100 drm/ttm: allow bulk moves for all domains Not just TT and VRAM. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Tested-by: Bas Nieuwenhuizen Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-3-christian.koenig@amd.com commit 5d05b988f1c0fddc4aaffa5fa3c3f5a9e7b84d5b Author: Christian König Date: Tue Jun 8 11:13:21 2021 +0200 drm/ttm: add resource iterator v4 Instead of duplicating that at different places add an iterator over all the resources in a resource manager. v2: add lockdep annotation and kerneldoc v3: fix various bugs pointed out by Felix v4: simplify the code a bit more Signed-off-by: Christian König Tested-by: Bas Nieuwenhuizen Reviewed-by: Daniel Vetter (v2) Reviewed-by: Felix Kuehling Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-2-christian.koenig@amd.com commit 6a9b028994025f5033f10d1da30b29dfdc713384 Author: Christian König Date: Fri Jul 16 14:00:10 2021 +0200 drm/ttm: move the LRU into resource handling v4 This way we finally fix the problem that new resource are not immediately evict-able after allocation. That has caused numerous problems including OOM on GDS handling and not being able to use TTM as general resource manager. v2: stop assuming in ttm_resource_fini that res->bo is still valid. v3: cleanup kerneldoc, add more lockdep annotation v4: consistently use res->num_pages Signed-off-by: Christian König Tested-by: Bas Nieuwenhuizen Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321132601.2161-1-christian.koenig@amd.com commit 749831acb1f6bf5837aeeec93b96da1d91534775 Author: Mohammad Zafar Ziya Date: Wed Mar 23 12:10:00 2022 +0800 drm/amdgpu/jpeg: Add jpeg ras error query support RAS error query support addition for JPEG 2.6 V2: removed unused options and corrected comment format. Moved register definition to header file. V3: poison query status check added. Removed the error query support V4: Return statement refactored. Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit c543dcbe4237e03b23fa40e0fba979cfd8514954 Author: Mohammad Zafar Ziya Date: Wed Mar 23 12:06:49 2022 +0800 drm/amdgpu/vcn: Add VCN ras error query support RAS error query support addition for VCN 2.6 V2: removed unused option and corrected comment format Moved the register definition under header file V3: poison query status check added. Removed error query interface V4: MMSCH poison check option removed, return true/false refactored. Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit f0a339a8c0963abc80640975585df469e27ba3df Author: Mohammad Zafar Ziya Date: Wed Mar 23 10:54:15 2022 +0800 drm/amdgpu/vcn: Add vcn and jpeg ver 2.6 ras register definition Adding vcn and jpeg ver 2.6 ras register definition Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit edd08fa137d39b1100296049c86c514682dbf378 Author: Mohammad Zafar Ziya Date: Thu Mar 17 09:53:03 2022 +0800 drm/amdgpu/jpeg: Add jpeg block ras support Ras support addition for JPEG block V2: removed default callback Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 60fce7417fd6c0fef34ca1661bb17d63cf6db30b Author: Mohammad Zafar Ziya Date: Thu Mar 17 09:49:19 2022 +0800 drm/amdgpu/vcn: Add vcn ras support VCN block ras feature support addition V2: default ras callback removed Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit a3d63c62bdf06c5a3f8a71c207f13b26fc6030f5 Author: Mohammad Zafar Ziya Date: Thu Mar 17 09:45:42 2022 +0800 drm/amdgpu: Add vcn and jpeg ras support flag Add vcn and jpeg ras support options V2: vcn and jpeg ras flag enabled for aldebaran asic only V3: vcn and jpeg ras flag disabled for error counter query Generic poison query interface added VCN and JPEG ras enabled based on IP version check V4: vcn and jpeg ras flag moved under ecc flag for dGPU Signed-off-by: Mohammad Zafar Ziya Reviewed-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 425d7a87e54ee358f580eaf10cf28dc95f7121c1 Author: tiancyin Date: Sun Mar 27 19:07:13 2022 +0800 drm/amd/vcn: fix an error msg on vcn 3.0 Some video card has more than one vcn instance, passing 0 to vcn_v3_0_pause_dpg_mode is incorrect. Error msg: Register(1) [mmUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000002 Reviewed-by: James Zhu Signed-off-by: tiancyin Signed-off-by: Alex Deucher commit 9f07550b3c8a79cbb996a368f699c9eb619d8322 Author: Sean Paul Date: Fri Mar 25 00:06:19 2022 +0000 drm/amdgpu: Re-classify some log messages in commit path ATOMIC and DRIVER log categories do not typically contain per-frame log messages. This patch re-classifies some messages in amd to chattier categories to keep ATOMIC/DRIVER quiet. Acked-by: Christian König Reviewed-by: Harry Wentland Signed-off-by: Sean Paul Signed-off-by: Alex Deucher commit 8ecad8d66d7f03ccc8fa7b4921d45041e9b77680 Author: Lijo Lazar Date: Fri Mar 25 13:19:36 2022 +0530 drm/amd/pm: Check feature support using IP version Instead of ASIC type, use GC and MP1 IP versions for feature support checks. Signed-off-by: Lijo Lazar Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit e3026a057f9675884840979f17cd230e52685792 Author: Boyuan Zhang Date: Thu Mar 24 12:19:06 2022 -0400 drm/amdgpu/vcn3: send smu interface type For VCN FW to detect ASIC type, in order to use different mailbox registers. V2: simplify codes and fix format issue. Signed-off-by: Boyuan Zhang Acked-by Huang Rui Signed-off-by: Alex Deucher commit a63e6b83c21424b6ecfca7ecbf605f9af75ae296 Author: Darren Powell Date: Mon Mar 7 21:40:35 2022 -0500 amdgpu/pm: Implement emit_clk_levels for vega10 (v1) - implement emit_clk_levels for vega10, based on print_clk_levels, but using sysfs_emit rather than sprintf - modify local int vars to use uint32_t to match arg type of called functions - add return of error codes - refactor OD_XXX cases to return early with -EOPNOTSUPP if !(hwmgr->od_enabled) Signed-off-by: Darren Powell Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 5d8539d2fbe39ce24e76dfe72b7de7093d3fac6d Author: Darren Powell Date: Fri Mar 4 23:45:25 2022 -0500 amdgpu/pm: Add new hwmgr API function "emit_clock_levels" Extend commit 7f36948c92b2 ("amdgpu/pm: Implement new API function "emit" that accepts buffer base and write offset") Add new hwmgr API function "emit_clock_levels" - add member emit_clock_levels to pp_hwmgr_func - Implemented pp_dpm_emit_clock_levels - add pp_dpm_emit_clock_levels to pp_dpm_funcs Signed-off-by: Darren Powell Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 7e4e0e5c38493b81cef7e2d6420d85bf783eb73d Author: Uma Shankar Date: Thu Mar 24 17:34:38 2022 +0530 drm/i915/display: Extend DP HDR support to hsw+ HSW+ platforms are able to send out HDR Metadata SDP DIP packet as GMP. Hence, extending the support for HDR on DP encoders for the same. v2: Limited to non eDP ports on hsw/bdw and removed it for lspcon as it is done separately (suggested by Ville) v3: Added helper and limited eDP restriction to port A (Ville) v4: Dropped some redundant checks (Ville) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5389 Cc: Ville Syrjälä Signed-off-by: Uma Shankar Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220324120438.1876445-1-uma.shankar@intel.com commit e795df5bbcf27abd6250a0fb9fa8ad7a9748959f Author: Andrey Grodzovsky Date: Mon Mar 28 09:25:32 2022 -0400 drm/sched: Fix htmldoc warning. Fixes the warning. Signed-off-by: Andrey Grodzovsky Reported-by: Stephen Rothwell Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220328132532.406572-1-andrey.grodzovsky@amd.com commit 27f26359de9b63131a4990ec341dba969860f2fa Author: Xin Ji Date: Tue Mar 22 16:02:12 2022 +0800 drm/bridge: anx7625: Set downstream sink into normal status As downstream sink was set into standby mode while bridge disabled, this patch used for setting downstream sink into normal status while enable bridge. Signed-off-by: Xin Ji Reviewed-by: Pin-Yen Lin Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220322080213.1487134-1-xji@analogixsemi.com commit b2beae327e039736299f3c6559f3467323fe68c5 Author: Wen Gong Date: Wed Mar 23 21:18:56 2022 -0400 ath11k: store and send country code to firmware after recovery Currently ath11k does not send the country code to firmware after device recovery, as a result the regdomain info is reported from firmware by default. Regdomain info is important, so ath11k also need to restore it to the value which was used before recovery. 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/20220324011856.11014-1-quic_wgong@quicinc.com commit 3fd6afb623ba0f908af4f81794ccdff4dd5e671e Author: Ankit Nautiyal Date: Wed Mar 23 15:13:07 2022 +0530 drm/i915/intel_combo_phy: Print I/O voltage info Print I/O voltage and process info for each combo phy ports. v2: Used drm_dbg_kms for logs. (Jani) Added names for different voltage levels. (Imre) v3: Used const char * for names. (Jani) v4: Dropped the procom values and changed commit msg (Imre) Suggested-by: Imre Deak Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220323094307.2439004-1-ankit.k.nautiyal@intel.com commit 73867c8709b569cdd7fda67f01dfe02c8d055521 Author: Ankit Nautiyal Date: Tue Mar 15 13:32:46 2022 +0530 drm/i915/display: Remove check for low voltage sku for max dp source rate The low voltage sku check can be ignored as OEMs need to consider that when designing the board and then put any limits in VBT. Same is now changed in Bspec pages. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5272 Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20220315080247.1161844-2-ankit.k.nautiyal@intel.com commit 3ccd59f93004c369cc4c0f0939f80cb069f0fc2d Author: Ivaylo Dimitrov Date: Wed Jan 19 12:23:11 2022 +0200 drm: omapdrm: Do no allocate non-scanout GEMs through DMM/TILER On devices with DMM, all allocations are done through either DMM or TILER. DMM/TILER being a limited resource means that such allocations will start to fail before actual free memory is exhausted. What is even worse is that with time DMM/TILER space gets fragmented to the point that even if we have enough free DMM/TILER space and free memory, allocation fails because there is no big enough free block in DMM/TILER space. Such failures can be easily observed with OMAP xorg DDX, for example - starting few GUI applications (so buffers for their windows are allocated) and then rotating landscape<->portrait while closing and opening new windows soon results in allocation failures. Fix that by mapping buffers through DMM/TILER only when really needed, like, for scanout buffers. Signed-off-by: Ivaylo Dimitrov Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/1642587791-13222-4-git-send-email-ivo.g.dimitrov.75@gmail.com commit 1948d28db6215d055930f0cbb6e300622ede5931 Author: Ivaylo Dimitrov Date: Wed Jan 19 12:23:10 2022 +0200 drm: omapdrm: Support exporting of non-contiguous GEM BOs Currently code allocates non-scanout BOs from SHMEM and those objects are accessible to userspace by mmap(). However, on devices with no DMM (like OMAP3), the same objects are not accessible by kernel drivers that want to render to them as code refuses to export them. In turn this means that on devices with no DMM, all buffers must be allocated as scanout, otherwise only CPU can access them. On those devices, scanout buffers are allocated from CMA, making those allocations highly unreliable. Fix that by implementing functionality to export SHMEM backed buffers on devices with no DMM. This makes CMA memory only being used when needed, instead for every buffer that has to be off-CPU rendered. Tested on Motorola Droid4 and Nokia N900 Signed-off-by: Ivaylo Dimitrov Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/1642587791-13222-3-git-send-email-ivo.g.dimitrov.75@gmail.com commit 86ad0397250c585096d242dc3c0f774320ed1a80 Author: Ivaylo Dimitrov Date: Wed Jan 19 12:23:09 2022 +0200 drm: omapdrm: simplify omap_gem_pin Move tiler related code to its own function. Signed-off-by: Ivaylo Dimitrov Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/1642587791-13222-2-git-send-email-ivo.g.dimitrov.75@gmail.com commit be658e705d08d14eb1b7803c89e6964b5d1c5c0a Author: CQ Tang Date: Thu Mar 24 14:31:23 2022 +0000 drm/i915: add lmem_size modparam lmem_size is used to limit the amount of lmem for testing purposes. Default is to use hardware available lmem size. Signed-off-by: CQ Tang Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220324143123.348590-2-matthew.auld@intel.com commit c0c73850637c6ad6a56a6b5ee181897cb35c6c31 Author: Daniele Ceraolo Spurio Date: Wed Mar 23 17:04:39 2022 -0700 drm/i915/guc: Correctly free guc capture struct on error On error the "new" allocation is not freed, so add the required kfree. Fixes: 247f8071d5893 ("drm/i915/guc: Pre-allocate output nodes for extraction") Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220324000439.2370440-1-daniele.ceraolospurio@intel.com commit 8f8cc3fb43508a2b1682e3809d6d39ce1871a5ee Author: Christian König Date: Thu Mar 17 14:29:22 2022 +0100 drm/amdgpu: remove table_freed param from the VM code Better to leave the decision when to flush the VM changes in the TLB to the VM code. Signed-off-by: Christian König Reviewed-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4d30a83c740e9904c7f54f071ec121f9e6932f63 Author: Christian König Date: Thu Mar 17 14:08:36 2022 +0100 drm/amdkfd: use tlb_seq from the VM subsystem for SVM as well v2 Instead of hand rolling the table_freed parameter. v2: add some changes suggested by Philip Signed-off-by: Christian König Reviewed-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit bffa91dadf599155200b3efb46217ec108078a30 Author: Christian König Date: Thu Mar 17 09:53:55 2022 +0100 drm/amdkfd: start using tlb_seq from the VM subsystem Instead of trying to figure out if a TLB flush is necessary or not use the information provided by the VM subsystem now. Signed-off-by: Christian König Reviewed-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5255e146c99a677d4d55fdb988544bd20c539a0b Author: Christian König Date: Tue Mar 15 15:27:45 2022 +0100 drm/amdgpu: rework TLB flushing Instead of tracking the VM updates through the dependencies just use a sequence counter for page table updates which indicates the need to flush the TLB. This reduces the need to flush the TLB drastically. v2: squash in NULL check fix (Christian) Signed-off-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit e997b82745a5b2419bc5b72735811d7162ac994a Author: Christian König Date: Tue Mar 8 15:06:49 2022 +0100 drm/amdgpu: simplify VM update tracking a bit Store the 64bit sequence directly. Makes it simpler to use and saves a bit of fence reference counting overhead. Signed-off-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 184a69ca4d4125eee07f853cde45ee19dd21c437 Author: Christian König Date: Tue Mar 15 08:51:24 2022 +0100 drm/amdgpu: separate VM PT handling into amdgpu_vm_pt.c Separate the VM page table backend operations from the state machine since the amdgpu_vm.c file is becoming to complex. The allocating, freeing and updating page tables and page directories can easily be moved into a separate file. While at it cleanup everything checkpatch.pl reported and rename the functions a bit to make more clear that they belong together. Signed-off-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6e97c2f9689227b3fb6e2563127669f2146b5df5 Author: Christian König Date: Mon Mar 14 13:11:28 2022 +0100 drm/amdgpu: move VM PDEs to idle after update Move the page tables to the idle list after updating the PDEs. We have gone back and forth with that a couple of times because of problems with the inter PD dependencies, but it should work now that we have the state handling cleanly separated. Signed-off-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3f8951cc123f102a4e21d61390993bc7d142b723 Author: Melissa Wen Date: Mon Mar 7 14:48:01 2022 -0100 drm/amd/display: move FPU related code from dcn316 to dml/dcn31 folder Moves FPU-related structs and dcn316_update_bw_bounding_box from dcn316 driver to dml/dcn31 that centralize FPU operations for DCN 3.1x Signed-off-by: Melissa Wen Reviewed-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fa896297b31b1100ad13f83a7dd83a715e815042 Author: Melissa Wen Date: Mon Mar 7 14:48:00 2022 -0100 drm/amd/display: move FPU related code from dcn315 to dml/dcn31 folder Moves related structs and dcn315_update_bw_bounding_box from dcn315 driver code to dml/dcn31_fpu that centralizes FPU code for DCN 3.1x. Signed-off-by: Melissa Wen Reviewed-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 26f4712aedbdf4b9f5e3888a50a2a4b130ee4a9b Author: Melissa Wen Date: Mon Mar 7 14:47:59 2022 -0100 drm/amd/display: move FPU related code from dcn31 to dml/dcn31 folder Creates FPU files in dml/dcn31 folder to centralize FPU operations from 3.1x drivers and moves all FPU-associated code from dcn31 driver to there. It includes the struct _vcs_dpi_ip_params_st and _vcs_dpi_soc_bounding_box_st and functions: - dcn31_calculate_wm_and_dlg_fp() - dcn31_update_bw_bounding_box() adding dc_assert_fp_enabled to them and drop DC_FP_START/END inside functions that was moved to dml folder, as required. Signed-off-by: Melissa Wen Reviewed-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1918a0455d360457b2fbcda889cff19876d01b9e Author: Aric Cyr Date: Sun Mar 13 21:04:59 2022 -0400 drm/amd/display: 3.2.178 This version brings along following fixes: - HDCP SEND AKI INIT error - fix audio format not updated after edid updated - Reduce stack size - FEC check in timing validation - Add fSMC_MSG_SetDtbClk support - Update VTEM Infopacket definition - [FW Promotion] Release 0.0.109.0 Acked-by: Alex Hung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 31f714b44959821f44fae105bd1d024b0f6b7ed5 Author: Anthony Koo Date: Sun Mar 13 14:06:05 2022 -0400 drm/amd/display: [FW Promotion] Release 0.0.109.0 Reviewed-by: Aric Cyr Acked-by: Alex Hung Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ed94aca6dbca2519cb71a73c2d276c97fe857596 Author: Tao Zhou Date: Mon Mar 21 15:45:31 2022 +0800 drm/amdkfd: print unmap queue status for RAS poison consumption (v3) Print the status out when it passes, and also tell user gpu reset is triggered when we fall back to legacy way. v2: make the message more explicit. v3: change succeeds to succeeded. replace pr_warn with dev_warn. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4268d081619a55019e44bf0a62222d47e1e09470 Author: Ahmad Othman Date: Fri Mar 4 11:56:19 2022 -0500 drm/amd/display: Fix HDCP SEND AKI INIT error [why] HDCP sends AKI INIT error in case of multiple display on dock [how] Add new checks and method to handle display adjustment for multiple display cases Reviewed-by: Wenjing Liu Acked-by: Alex Hung Signed-off-by: Ahmad Othman Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f3fa490960e8acf089ace0301a7ccb6d44ec9641 Author: Guchun Chen Date: Wed Mar 16 14:51:31 2022 +0800 drm/amdgpu: drop redundant check of harvest info Harvest bit setting in IP data structure promises this, so no need to set it explicitly. Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2f78f0d3e3a89e76a7fe184fdef19efd85063f61 Author: Colin Ian King Date: Tue Mar 15 20:19:59 2022 +0000 drm/amdgpu: Fix spelling mistake "regiser" -> "register" There is a spelling mistake in a dev_error error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 1990e29b1900758f596434204d4067955f6e904e Author: Tao Zhou Date: Wed Mar 16 14:38:12 2022 +0800 drm/amdkfd: add RAS poison consumption handling for UTCL2 (v2) Do RAS page retirement and use gpu reset as fallback in UTCL2 fault handler. v2: replace vm fault event with posion consumed event in UTCL2 poison consumption. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6475ae2b742876aa9b2a0aff7ba60f5c81917614 Author: Tao Zhou Date: Tue Mar 15 17:48:18 2022 +0800 drm/amdgpu: add UTCL2 RAS poison query for Aldebaran (v2) Add help functions to query and reset RAS UTCL2 poison status. v2: implement it on amdgpu side and kfd only calls it. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9d8a8d78d95261241fdc009ff5b44cfa9f78c8e7 Author: Tao Zhou Date: Wed Mar 16 12:03:51 2022 +0800 drm/amdkfd: replace source_id with client_id for RAS poison consumption Client ID is more accruate here and we can deal with more different cases with client ID. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit eed41975307a365d1c0f6ed5c388b130ffdd2664 Author: Tao Zhou Date: Tue Mar 15 17:07:21 2022 +0800 drm/amdkfd: refine event_interrupt_poison_consumption Combine reading and setting poison flag as one atomic operation and add print message for the function. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c5b266810c5105b6c115de6236247049c23502db Author: Alex Deucher Date: Mon Mar 14 14:42:03 2022 -0400 drm/amdgpu: make amdgpu_display_gem_fb_verify_and_init() static Unused outside of amdgpu_display.c. Reviewed-by: Guchun Chen Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 60da2f7440f22dba48944602c2a0373068f13880 Author: Alex Deucher Date: Mon Mar 14 14:40:33 2022 -0400 drm/amdgpu: drop amdgpu_display_gem_fb_init() Unused. Reviewed-by: Guchun Chen Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 31d5c52346cce168022b69b962023186b03eb43c Author: Alex Deucher Date: Mon Mar 14 14:38:19 2022 -0400 drm/amdgpu: make amdgpu_display_framebuffer_init() static It's not used outside of amdgpu_display.c. Reviewed-by: Guchun Chen Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 034d47b25b2ce627f1e1b04242d72db4180f3525 Author: Tvrtko Ursulin Date: Fri Mar 25 09:49:16 2022 +0000 drm/i915/uapi: Document DRM_I915_QUERY_HWCONFIG_BLOB UAPI with absolutely no documentation should not have been added - clarify blob format and content will be described externally. Fixes: 78e1fb3112c0 ("drm/i915/uapi: Add query for hwconfig blob") Signed-off-by: Tvrtko Ursulin Co-developed-by: Jordan Justen Cc: Jon Bloomfield Cc: Daniel Vetter Cc: John Harrison Cc: Jon Ewins Cc: Joonas Lahtinen Cc: Rodrigo Vivi Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220325094916.2186367-1-tvrtko.ursulin@linux.intel.com [tursulin: Fixed spelling s/meading/meaning/.] commit 59ab4ee012f0166873ae15d235b2450f21dcb5e7 Author: Cong Liu Date: Thu Mar 24 18:49:28 2022 +0800 drm/qxl: fix qxl can't use in arm64 qxl use ioremap to map ram_header and rom, in the arm64 implementation, the device is mapped as DEVICE_nGnRE, it can not support unaligned access. and qxl is a virtual device, it can be treated more like RAM than actual MMIO registers. use ioremap_wc() replace it. Signed-off-by: Cong Liu Acked-by: Christian König Link: http://patchwork.freedesktop.org/patch/msgid/20220324104928.2959545-1-liucong2@kylinos.cn Signed-off-by: Gerd Hoffmann commit ec3cbb30893be248d180dd748ee9148d408a99d1 Author: Rob Clark Date: Sat Feb 19 09:03:01 2022 -0800 drm/virtio: Remove restriction of non-zero blob_flags With native userspace drivers in guest, a lot of GEM objects need to be neither shared nor mappable. And in fact making everything mappable and/or sharable results in unreasonably high fd usage in host VMM. Signed-off-by: Rob Clark Reviewed-by: Chia-I Wu Link: http://patchwork.freedesktop.org/patch/msgid/20220219170301.545432-1-robdclark@gmail.com Signed-off-by: Gerd Hoffmann commit 194d250cdc4a40ccbd179afd522a9e9846957402 Author: Liu Zixian Date: Tue Mar 22 17:17:30 2022 +0800 drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes drm_cvt_mode may return NULL and we should check it. This bug is found by syzkaller: FAULT_INJECTION stacktrace: [ 168.567394] FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 [ 168.567403] CPU: 1 PID: 6425 Comm: syz Kdump: loaded Not tainted 4.19.90-vhulk2201.1.0.h1035.kasan.eulerosv2r10.aarch64 #1 [ 168.567406] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 168.567408] Call trace: [ 168.567414] dump_backtrace+0x0/0x310 [ 168.567418] show_stack+0x28/0x38 [ 168.567423] dump_stack+0xec/0x15c [ 168.567427] should_fail+0x3ac/0x3d0 [ 168.567437] __should_failslab+0xb8/0x120 [ 168.567441] should_failslab+0x28/0xc0 [ 168.567445] kmem_cache_alloc_trace+0x50/0x640 [ 168.567454] drm_mode_create+0x40/0x90 [ 168.567458] drm_cvt_mode+0x48/0xc78 [ 168.567477] virtio_gpu_conn_get_modes+0xa8/0x140 [virtio_gpu] [ 168.567485] drm_helper_probe_single_connector_modes+0x3a4/0xd80 [ 168.567492] drm_mode_getconnector+0x2e0/0xa70 [ 168.567496] drm_ioctl_kernel+0x11c/0x1d8 [ 168.567514] drm_ioctl+0x558/0x6d0 [ 168.567522] do_vfs_ioctl+0x160/0xf30 [ 168.567525] ksys_ioctl+0x98/0xd8 [ 168.567530] __arm64_sys_ioctl+0x50/0xc8 [ 168.567536] el0_svc_common+0xc8/0x320 [ 168.567540] el0_svc_handler+0xf8/0x160 [ 168.567544] el0_svc+0x10/0x218 KASAN stacktrace: [ 168.567561] BUG: KASAN: null-ptr-deref in virtio_gpu_conn_get_modes+0xb4/0x140 [virtio_gpu] [ 168.567565] Read of size 4 at addr 0000000000000054 by task syz/6425 [ 168.567566] [ 168.567571] CPU: 1 PID: 6425 Comm: syz Kdump: loaded Not tainted 4.19.90-vhulk2201.1.0.h1035.kasan.eulerosv2r10.aarch64 #1 [ 168.567573] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 168.567575] Call trace: [ 168.567578] dump_backtrace+0x0/0x310 [ 168.567582] show_stack+0x28/0x38 [ 168.567586] dump_stack+0xec/0x15c [ 168.567591] kasan_report+0x244/0x2f0 [ 168.567594] __asan_load4+0x58/0xb0 [ 168.567607] virtio_gpu_conn_get_modes+0xb4/0x140 [virtio_gpu] [ 168.567612] drm_helper_probe_single_connector_modes+0x3a4/0xd80 [ 168.567617] drm_mode_getconnector+0x2e0/0xa70 [ 168.567621] drm_ioctl_kernel+0x11c/0x1d8 [ 168.567624] drm_ioctl+0x558/0x6d0 [ 168.567628] do_vfs_ioctl+0x160/0xf30 [ 168.567632] ksys_ioctl+0x98/0xd8 [ 168.567636] __arm64_sys_ioctl+0x50/0xc8 [ 168.567641] el0_svc_common+0xc8/0x320 [ 168.567645] el0_svc_handler+0xf8/0x160 [ 168.567649] el0_svc+0x10/0x218 Signed-off-by: Liu Zixian Link: http://patchwork.freedesktop.org/patch/msgid/20220322091730.1653-1-liuzixian4@huawei.com Signed-off-by: Gerd Hoffmann commit 673424ce0e77450c24b300153387e271f470fc7c Author: Wenli Looi Date: Sun Mar 20 17:30:10 2022 -0600 ath9k: add functions to get paprd rate mask This removes some code duplication with le32_to_cpu. This may also be required for QCN550x support, to provide an abstraction over the underlying EEPROM format. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-7-wlooi@ucalgary.ca commit 193025378c446d53fa36bfefc33c170f1ec374c8 Author: Wenli Looi Date: Sun Mar 20 17:30:09 2022 -0600 ath9k: refactor ar9003_hw_spur_mitigate_ofdm Similar to ar9003_hw_spur_mitigate_mrc_cck, simplify the code by using ar9003_get_spur_chan_ptr. This may also be required for QCN550x support, to provide an abstraction over the underlying EEPROM format. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-6-wlooi@ucalgary.ca commit 9aaff3864b603408c02c629957ae8d8ff5d5a4f2 Author: Wenli Looi Date: Sun Mar 20 17:30:08 2022 -0600 ath9k: fix ar9003_get_eepmisc The current implementation is reading the wrong eeprom type. Fixes: d8ec2e2a63e8 ("ath9k: Add an eeprom_ops callback for retrieving the eepmisc value") Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-5-wlooi@ucalgary.ca commit 3096a4d9eb9bf8a0975c222bd7013d2db323d749 Author: Wenli Looi Date: Sun Mar 20 17:30:07 2022 -0600 ath9k: use AR9300_MAX_CHAINS when appropriate Replace other constants with AR9300_MAX_CHAINS when appropriate. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-4-wlooi@ucalgary.ca commit a96474a794e11eda2c96b06270178ac1ccd6e1c0 Author: Wenli Looi Date: Sun Mar 20 17:30:06 2022 -0600 ath9k: split set11nRateFlags and set11nChainSel This makes the code clearer since set11nRateFlags currently sets both the rate flags and chain sel. This may also be required for QCN550x support, where the rate flags and chain sel are in separate fields. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-3-wlooi@ucalgary.ca commit 26c31016fe7eb1911e9ffa50dbaac6f2c42c799c Author: Wenli Looi Date: Sun Mar 20 17:30:05 2022 -0600 ath9k: make ATH_SREV macros more consistent This makes the macros more consistent and removes hidden dependencies on ah for macros that take _ah as a parameter. This change does not appear to affect the final binary. Signed-off-by: Wenli Looi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220320233010.123106-2-wlooi@ucalgary.ca commit 7b0c70d92a435913f6e11d6a248b935697e8a3eb Author: Karthikeyan Periyasamy Date: Wed Mar 23 11:14:17 2022 +0200 ath11k: Add peer rhash table support When more clients (128) are connected, the UL data traffic KPI measurement is low compared to single client. This issue is due to more CPU cycles spent on the peer lookup operation with more clients. So reduce the peer lookup operation by modifying the linear based lookup operation into the rhash based lookup operation. This improve the peak throughput measurement. Since this is a software algorithm change, it is applicable for all the platforms. TCP UL 128 Clients test case Observation (64bit system): Previous: ~550 Mbps Now : ~860 Mbps Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644036628-5334-1-git-send-email-quic_periyasa@quicinc.com commit 9d97114d222047c0699bbdbf8f128907f423bbe6 Author: Wen Gong Date: Wed Mar 23 11:14:17 2022 +0200 ath11k: add read variant from SMBIOS for download board data This is to read variant from SMBIOS such as read from DT, the variant string will be used to one part of string which used to search board data from board-2.bin. 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/20220315104721.26649-3-quic_wgong@quicinc.com commit 62abdc06c50eb18e3fa62f7136e66842a96f6b58 Author: Wen Gong Date: Wed Mar 23 11:14:16 2022 +0200 ath11k: add fallback board name without variant while searching board-2.bin Sometimes it has a variant value which read from DT or SMBIOS by ath11k, and meanwhile it does not have the matched board name in board-2.bin, then it will failed at boot up phase. Add fallback board name which removed variant value and search again in board-2.bin when failed with variant and try to load the board data again to increase boot up success rate. dmesg log after this patch: [169547.248472] ath11k_pci 0000:05: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,variant=test' [169547.248565] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 180324 [169547.248568] ath11k_pci 0000:05:00.0: board name [169547.248570] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [169547.248571] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [169547.248572] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [169547.248574] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [169547.248575] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [169547.248576] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [169547.248577] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32 ard-id=262 [169547.248578] ath11k_pci 0000:05:00.0: board name [169547.248579] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [169547.248581] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [169547.248582] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [169547.248583] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [169547.248584] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [169547.248585] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [169547.248587] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36 ard-id=266 [169547.248588] ath11k_pci 0000:05:00.0: board name [169547.248589] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [169547.248590] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [169547.248591] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [169547.248592] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [169547.248594] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [169547.248595] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 31 38 2c 71 6d 69 2d 62 chip-id=18,qmi-b [169547.248596] ath11k_pci 0000:05:00.0: 00000060: 6f 61 72 64 2d 69 64 3d 32 36 36 oard-id=266 [169547.248597] ath11k_pci 0000:05:00.0: failed to fetch board data for bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262,variant=test from ath11k/WCN6855/hw2.0/board-2.bin [169547.248476] ath11k_pci 0000:05: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' [169547.248634] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/board-2.bin size 180324 [169547.248636] ath11k_pci 0000:05:00.0: board name [169547.248637] ath11k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31 bus=pci,vendor=1 [169547.248638] ath11k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c 7cb,device=1103, [169547.248639] ath11k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72 subsystem-vendor [169547.248641] ath11k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d =17cb,subsystem- [169547.248642] ath11k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d device=3374,qmi- [169547.248643] ath11k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f chip-id=2,qmi-bo [169547.248645] ath11k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32 ard-id=262 [169547.248646] ath11k_pci 0000:05:00.0: boot found match for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262' [169547.248647] ath11k_pci 0000:05:00.0: boot found board data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262' [169547.248649] ath11k_pci 0000:05:00.0: using board api 2 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/20220315104721.26649-2-quic_wgong@quicinc.com commit e769a3504e273309c9fe4a417d427c8dbff4cf1c Author: Maxime Ripard Date: Tue Feb 22 17:40:42 2022 +0100 drm/vc4: hdmi: Support HDMI YUV output In addition to the RGB444 output, the BCM2711 HDMI controller supports the YUV444 and YUV422 output formats. Let's add support for them in the driver, but still use RGB as the preferred format. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-8-maxime@cerno.tech commit dd39d024a8471e88951f8494f19e693c9e3185a9 Author: Maxime Ripard Date: Tue Feb 22 17:40:41 2022 +0100 drm/vc4: hdmi: Always try to have the highest bpc Currently we take the max_bpc property as the bpc value and do not try anything else. However, what the other drivers seem to be doing is that they would try with the highest bpc allowed by the max_bpc property and the hardware capabilities, test if it results in an acceptable configuration, and if not decrease the bpc and try again. Let's use the same logic. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-7-maxime@cerno.tech commit f785dcfc596c378a19af01a6a337b8b67e5e4534 Author: Maxime Ripard Date: Tue Feb 22 17:40:40 2022 +0100 drm/vc4: hdmi: Take bpp into account for the scrambler The current code only base its decision for whether the scrambler must be enabled or not on the pixel clock of the mode, but doesn't take the bits per color into account. Let's leverage the new function to compute the clock rate in the scrambler setup code. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-6-maxime@cerno.tech commit 15a809211a6971cac5262c309aeadddc158c64d9 Author: Maxime Ripard Date: Tue Feb 22 17:40:39 2022 +0100 drm/vc4: hdmi: Take the sink maximum TMDS clock into account In the function that validates that the clock isn't too high, we've only taken our controller limitations into account so far. However, the sink can have a limit on the maximum TMDS clock it can deal with too which is exposed through the EDID and the drm_display_info. Make sure we check it. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-5-maxime@cerno.tech commit 595dcf4eb859d043de9919f50d44272304e75422 Author: Maxime Ripard Date: Tue Feb 22 17:40:38 2022 +0100 drm/vc4: hdmi: Move clock calculation into its own function The code to compute our clock rate for a given setup will be called in multiple places in the next patches, so let's create a separate function for it. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-4-maxime@cerno.tech commit ccbf364f329cd43c9b148a2613881a8890f97237 Author: Maxime Ripard Date: Tue Feb 22 17:40:37 2022 +0100 drm/vc4: hdmi: Move clock validation to its own function Our code is doing the same clock rate validation in multiple instances. Let's create a helper to share the rate validation. Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-3-maxime@cerno.tech commit 6135ee07702781cd8206bcb1c202c4630d6e3c9c Author: Maxime Ripard Date: Tue Feb 22 17:40:36 2022 +0100 drm/vc4: hdmi: Rename pixel_rate variable The pixel_rate field in the vc4_hdmi_connector_state struct actually stores the TMDS character rate, let's rename it for consistency. Suggested-by: Ville Syrjälä Signed-off-by: Maxime Ripard Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220222164042.403112-2-maxime@cerno.tech commit 3dd4834a6efe4eb3c086526e1870bb768776d86a Author: YueHaibing Date: Thu Mar 17 17:47:24 2022 +0800 drm/bridge: it6505: Fix build error If DRM_ITE_IT6505 is y but DRM_DP_HELPER is m, building failed: drivers/gpu/drm/bridge/ite-it6505.o: In function `it6505_i2c_remove': ite-it6505.c:(.text+0x35c): undefined reference to `drm_dp_aux_unregister' drivers/gpu/drm/bridge/ite-it6505.o: In function `it6505_dpcd_read': ite-it6505.c:(.text+0x420): undefined reference to `drm_dp_dpcd_read' drivers/gpu/drm/bridge/ite-it6505.o: In function `it6505_get_dpcd': ite-it6505.c:(.text+0x4a4): undefined reference to `drm_dp_dpcd_read' drivers/gpu/drm/bridge/ite-it6505.o: In function `it6505_dpcd_write': ite-it6505.c:(.text+0x52c): undefined reference to `drm_dp_dpcd_write' Select DRM_DP_HELPER for DRM_ITE_IT6505 to fix this. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: YueHaibing Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220317094724.25972-1-yuehaibing@huawei.com commit 8938d48451f5d7cb565dfa68aa0bd0e81985da09 Author: Christian König Date: Fri Sep 24 14:19:22 2021 +0200 dma-buf: finally make the dma_resv_list private v2 Drivers should never touch this directly. v2: drop kerneldoc for now internal handling Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-2-christian.koenig@amd.com commit 548e7432dc2da475a18077b612e8d55b8ff51891 Author: Christian König Date: Fri Sep 24 10:55:45 2021 +0200 dma-buf: add dma_resv_replace_fences v2 This function allows to replace fences from the shared fence list when we can gurantee that the operation represented by the original fence has finished or no accesses to the resources protected by the dma_resv object any more when the new fence finishes. Then use this function in the amdkfd code when BOs are unmapped from the process. v2: add an example when this is usefull. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-1-christian.koenig@amd.com commit f30bceab16d1d6a97cbe262623e25ed2873896f0 Author: Christian König Date: Wed Sep 22 13:01:04 2021 +0200 RDMA: use dma_resv_wait() instead of extracting the fence Use dma_resv_wait() instead of extracting the exclusive fence and waiting on it manually. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Acked-by: Jason Gunthorpe Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: Maor Gottlieb Cc: Gal Pressman Cc: linux-media@vger.kernel.org Cc: linaro-mm-sig@lists.linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-4-christian.koenig@amd.com commit 0941a4e3c629c902e7d229218dbc36a146ca699c Author: Christian König Date: Wed Nov 3 09:34:29 2021 +0100 drm/etnaviv: stop using dma_resv_excl_fence v2 We can get the excl fence together with the shared ones as well. v2: rename the member to fences as well Signed-off-by: Christian König Reviewed-by: Daniel Vetter Reviewed-by: Lucas Stach Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: etnaviv@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-5-christian.koenig@amd.com commit e0fd83dbe92426e4f09b01111d260d2a7dc72fdb Author: Nicolas Belin Date: Wed Mar 16 14:57:33 2022 +0100 drm: bridge: it66121: Add audio support Adding the audio support on the HDMI bridge for I2S only. Signed-off-by: Nicolas Belin Signed-off-by: Andy.Hsieh Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220316135733.173950-4-nbelin@baylibre.com commit 003a1bd6a2a55c16cb2451153533dbedb12bebec Author: Nicolas Belin Date: Wed Mar 16 14:57:32 2022 +0100 drm: bridge: it66121: Fix the register page length Set the register page length or window length to 0x100 according to the documentation. Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver") Signed-off-by: Nicolas Belin Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220316135733.173950-3-nbelin@baylibre.com commit cc2f2df48a17980e815fa09a43b81861f7ebad85 Author: Nicolas Belin Date: Wed Mar 16 14:57:31 2022 +0100 dt-bindings: display: bridge: it66121: Add audio support Update the ITE bridge HDMI it66121 bindings in order to support audio. Signed-off-by: Nicolas Belin Acked-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220316135733.173950-2-nbelin@baylibre.com commit 52e527f28776e4a8188fed0fe092d9f4d5e39f1c Author: Patrik Jakobsson Date: Tue Mar 22 14:17:42 2022 +0100 drm/gma500: Add crtc prefix to vblank functions These functions operate on a crtc and should be prefixed properly. Suggested-by: Thomas Zimmermann Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-7-patrik.r.jakobsson@gmail.com commit d9f6e81272de653812e8b2aa77c93f16939e02e9 Author: Patrik Jakobsson Date: Tue Mar 22 14:17:41 2022 +0100 drm/gma500: Declare a few functions static These functions are not used outside of their file scope so can be declared as static. Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-6-patrik.r.jakobsson@gmail.com commit 12e67cca85a06b1227b0fd797d436ddffadd01a8 Author: Patrik Jakobsson Date: Tue Mar 22 14:17:40 2022 +0100 drm/gma500: Free the correct connector allocation The allocation is made for the gma_connector object so we must use the same address when free()ing the object. Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-5-patrik.r.jakobsson@gmail.com commit 9f8308f4c94afc7486ea4ad41298031af0b91a92 Author: Patrik Jakobsson Date: Tue Mar 22 14:17:39 2022 +0100 drm/gma500: gma500 don't register non-hotpluggable connectors According to docs we should only register connectors that are hotpluggable. No connectors in gma500 are hotpluggable. Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-4-patrik.r.jakobsson@gmail.com commit b1a7d0ddb169774c3db5afe9e64124daea7fdd9f Author: Patrik Jakobsson Date: Tue Mar 22 14:17:38 2022 +0100 drm/gma500: Make use of the drm connector iterator This makes sure we're using proper locking when iterating the list of connectors. Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-3-patrik.r.jakobsson@gmail.com commit 3e712b3cfb580752e5d0f848883bf2d074f09bdd Author: Patrik Jakobsson Date: Tue Mar 22 14:17:37 2022 +0100 drm/gma500: Uninstall interrupts on driver removal Reloading the driver revealed that the interrupt handler never got uninstalled. Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-2-patrik.r.jakobsson@gmail.com commit c89717bd0a0f4fd35e86ea26072de608482a7710 Author: Patrik Jakobsson Date: Tue Mar 22 14:17:36 2022 +0100 drm/gma500: Use managed drmm_mode_config_init() Signed-off-by: Patrik Jakobsson Reviewed-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220322131742.11566-1-patrik.r.jakobsson@gmail.com commit 1e4ac7173c9394de7f54a4a861377ac3f030c614 Author: Baochen Qiang Date: Mon Oct 11 13:56:02 2021 +0800 ath11k: enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability In Qualcomm ARM platforms there is WL_EN pin and other power regulators which can be controlled at platform side to completely reset the chip. For most of x86 and other platforms, the chip is connected via PCIe M.2 interface, and there is no way to control WL_EN pin. Instead the host driver needs to reset the chip via PCIE_SOC_GLOBAL_RESET hardware register, just like ath11k does currently. But when using PCIE_SOC_GLOBAL_RESET there are some hardware registers which are not cleared/restored. To handle those cases we can enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability to tell the firmware to do some platform specific operations after firmware download. This does not fix any known issues, but is recommended by the firmware team, so enable the capability on QCA6390 and WCN6855 PCI devices. It is currently unclear if this should be enabled also on QCN9074, so leave it disabled for now. On AHB devices this is not needed as they don't use PCIE_SOC_GLOBAL_RESET. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211011055602.77342-1-bqiang@codeaurora.org commit 0d7a8a6204ea9271f1d0a8c66a9fd2f54d2e3cbc Author: Wen Gong Date: Mon Mar 21 13:17:08 2022 +0200 ath11k: fix the warning of dev_wake in mhi_pm_disable_transition() When test device recovery with below command, it has warning in message as below. echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash warning message: [ 1965.642121] ath11k_pci 0000:06:00.0: simulating firmware assert crash [ 1968.471364] ieee80211 phy0: Hardware restart was requested [ 1968.511305] ------------[ cut here ]------------ [ 1968.511368] WARNING: CPU: 3 PID: 1546 at drivers/bus/mhi/core/pm.c:505 mhi_pm_disable_transition+0xb37/0xda0 [mhi] [ 1968.511443] Modules linked in: ath11k_pci ath11k mac80211 libarc4 cfg80211 qmi_helpers qrtr_mhi mhi qrtr nvme nvme_core [ 1968.511563] CPU: 3 PID: 1546 Comm: kworker/u17:0 Kdump: loaded Tainted: G W 5.17.0-rc3-wt-ath+ #579 [ 1968.511629] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021 [ 1968.511704] Workqueue: mhi_hiprio_wq mhi_pm_st_worker [mhi] [ 1968.511787] RIP: 0010:mhi_pm_disable_transition+0xb37/0xda0 [mhi] [ 1968.511870] Code: a9 fe ff ff 4c 89 ff 44 89 04 24 e8 03 46 f6 e5 44 8b 04 24 41 83 f8 01 0f 84 21 fe ff ff e9 4c fd ff ff 0f 0b e9 af f8 ff ff <0f> 0b e9 5c f8 ff ff 48 89 df e8 da 9e ee e3 e9 12 fd ff ff 4c 89 [ 1968.511923] RSP: 0018:ffffc900024efbf0 EFLAGS: 00010286 [ 1968.511969] RAX: 00000000ffffffff RBX: ffff88811d241250 RCX: ffffffffc0176922 [ 1968.512014] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff888118a90a24 [ 1968.512059] RBP: ffff888118a90800 R08: 0000000000000000 R09: ffff888118a90a27 [ 1968.512102] R10: ffffed1023152144 R11: 0000000000000001 R12: ffff888118a908ac [ 1968.512229] R13: ffff888118a90928 R14: dffffc0000000000 R15: ffff888118a90a24 [ 1968.512310] FS: 0000000000000000(0000) GS:ffff888234200000(0000) knlGS:0000000000000000 [ 1968.512405] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1968.512493] CR2: 00007f5538f443a8 CR3: 000000016dc28001 CR4: 00000000003706e0 [ 1968.512587] Call Trace: [ 1968.512672] [ 1968.512751] ? _raw_spin_unlock_irq+0x1f/0x40 [ 1968.512859] mhi_pm_st_worker+0x3ac/0x790 [mhi] [ 1968.512959] ? mhi_pm_mission_mode_transition.isra.0+0x7d0/0x7d0 [mhi] [ 1968.513063] process_one_work+0x86a/0x1400 [ 1968.513184] ? pwq_dec_nr_in_flight+0x230/0x230 [ 1968.513312] ? move_linked_works+0x125/0x290 [ 1968.513416] worker_thread+0x6db/0xf60 [ 1968.513536] ? process_one_work+0x1400/0x1400 [ 1968.513627] kthread+0x241/0x2d0 [ 1968.513733] ? kthread_complete_and_exit+0x20/0x20 [ 1968.513821] ret_from_fork+0x22/0x30 [ 1968.513924] Reason is mhi_deassert_dev_wake() from mhi_device_put() is called but mhi_assert_dev_wake() from __mhi_device_get_sync() is not called in progress of recovery. Commit 8e0559921f9a ("bus: mhi: core: Skip device wake in error or shutdown state") add check for the pm_state of mhi in __mhi_device_get_sync(), and the pm_state is not the normal state untill recovery is completed, so it leads the dev_wake is not 0 and above warning print in mhi_pm_disable_transition() while checking mhi_cntrl->dev_wake. Add check in ath11k_pci_write32()/ath11k_pci_read32() to skip call mhi_device_put() if mhi_device_get_sync() does not really do wake, then the warning gone. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220228064606.8981-5-quic_wgong@quicinc.com commit 78e3e6094220a71504e7136c42b49fc8ed3a72b4 Author: Wen Gong Date: Mon Mar 21 13:17:03 2022 +0200 ath11k: Add hw-restart option to simulate_fw_crash Add hw-restart to directly restart wlan. Like UTF mode start it will restart hardware and download firmware again. Usage: 1. Run command: echo hw-restart > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash echo hw-restart > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash 2. wlan will be restart and do recovery process and success. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220228064606.8981-4-quic_wgong@quicinc.com commit 38194f3a605e4a961f28bc38a73a4f4d43123968 Author: Wen Gong Date: Mon Mar 21 13:16:57 2022 +0200 ath11k: add synchronization operation between reconfigure of mac80211 and ath11k_base ieee80211_reconfig() of mac80211 is the main function for recovery of each ieee80211_hw and ath11k, and ath11k_core_reconfigure_on_crash() is the main function for recovery of ath11k_base, it has more than one ieee80211_hw and ath11k for each ath11k_base, so it need to add synchronization between them, otherwise it has many issue. For example, when ath11k_core_reconfigure_on_crash() is not complete, mac80211 send a hw scan request to ath11k, it leads firmware crash, because firmware has not been initialized at that moment, firmware is only finished downloaded and loaded, it can not receive scan command. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220228064606.8981-3-quic_wgong@quicinc.com commit 13da397f884d9c9a3fb6616206eeb6c6ab097287 Author: Wen Gong Date: Mon Feb 28 01:46:03 2022 -0500 ath11k: add support for device recovery for QCA6390/WCN6855 Currently ath11k has device recovery logic, it is introduced by this patch "ath11k: Add support for subsystem recovery" which is upstream by https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath11k-bringup&id=3a7b4838b6f6f234239f263ef3dc02e612a083ad. The patch is for AHB devices such as IPQ8074, it has remote proc module which is used to download the firmware and boots the processor which firmware is running on. If firmware crashed, remote proc module will detect it and download and boot firmware again. Below command will trigger a firmware crash, and then user can test feature of device recovery. Test command: echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash Unfortunately, QCA6390 is PCIe bus, it does not have the remote proc module, it use mhi module to communicate between firmware and ath11k. So ath11k does not support device recovery for QCA6390 currently. This patch is to add the extra logic which is different for QCA6390. When firmware crashed, MHI_CB_EE_RDDM event will be indicate by firmware and then ath11k_mhi_op_status_cb which is the callback of mhi_controller will receive the MHI_CB_EE_RDDM event, then ath11k will start to do recovery process, ath11k_core_reset() calls ath11k_hif_power_down()/ath11k_hif_power_up(), then the mhi/ath11k will start to download and boot firmware. There are some logic to avoid deadloop recovery and two simultaneous recovery operations. And because it has muti-radios for the soc, so it add some logic in ath11k_mac_op_reconfig_complete() to make sure all radios has reconfig complete and then complete the device recovery. Also it add workqueue_aux, because ab->workqueue is used when receive ATH11K_QMI_EVENT_FW_READY in recovery process(queue_work(ab->workqueue, &ab->restart_work)), and ath11k_core_reset will wait for max ATH11K_RESET_TIMEOUT_HZ for the previous restart_work finished, if ath11k_core_reset also queued in ab->workqueue, then it will delay restart_work of previous recovery and lead previous recovery fail. ath11k recovery success for QCA6390/WCN6855 after apply this patch. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220228064606.8981-2-quic_wgong@quicinc.com commit 0c104b6163e344e972dbbd255ca2441c171a8a87 Author: Wen Gong Date: Mon Mar 21 13:03:29 2022 +0200 ath11k: disable regdb support for QCA6390 Currently it does not have regdb files for QCA6390, so disable its regdb support feature now. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220319023543.14288-3-quic_wgong@quicinc.com commit 7fb376ad7d3f200575b9f9374e21b39d30b57267 Author: Wen Gong Date: Mon Mar 21 13:03:23 2022 +0200 ath11k: remove unused ATH11K_BD_IE_BOARD_EXT Currently ATH11K_BD_IE_BOARD_EXT is not used, so remove it. 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/20220319023543.14288-2-quic_wgong@quicinc.com commit 2db80f93869d491be57cbc2b36f30d0d3a0e5bde Author: Niels Dossche Date: Mon Mar 21 12:58:23 2022 +0200 ath11k: acquire ab->base_lock in unassign when finding the peer by addr ath11k_peer_find_by_addr states via lockdep that ab->base_lock must be held when calling that function in order to protect the list. All callers except ath11k_mac_op_unassign_vif_chanctx have that lock acquired when calling ath11k_peer_find_by_addr. That lock is also not transitively held by a path towards ath11k_mac_op_unassign_vif_chanctx. The solution is to acquire the lock when calling ath11k_peer_find_by_addr inside ath11k_mac_op_unassign_vif_chanctx. I am currently working on a static analyser to detect missing locks and this was a reported case. I manually verified the report by looking at the code, but I do not have real hardware so this is compile tested only. Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390") Signed-off-by: Niels Dossche Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314215253.92658-1-dossche.niels@gmail.com commit a0f1f7b4f74fc6eaee0b6783af40dacf431df7b4 Author: Alan Previn Date: Mon Mar 21 09:45:27 2022 -0700 drm/i915/guc: Print the GuC error capture output register list. Print the GuC captured error state register list (string names and values) when gpu_coredump_state printout is invoked via the i915 debugfs for flushing the gpu error-state that was captured prior. Since GuC could have reported multiple engine register dumps in a single notification event, parse the captured data (appearing as a stream of structures) to identify each dump as a different 'engine-capture-group-output'. Finally, for each 'engine-capture-group-output' that is found, verify if the engine register dump corresponds to the engine_coredump content that was previously populated by the i915_gpu_coredump function. That function would have copied the context's vma's including the bacth buffer during the G2H-context-reset notification that occurred earlier. Perform this verification check by comparing guc_id, lrca and engine- instance obtained from the 'engine-capture-group-output' vs a copy of that same info taken during i915_gpu_coredump. If they match, then print those vma's as well (such as the batch buffers). NOTE: the output format was verified using the gem_exec_capture IGT test. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-14-alan.previn.teres.alexis@intel.com commit a6f0f9cf330a86971f587333762d9a61a218bc30 Author: Alan Previn Date: Mon Mar 21 09:45:26 2022 -0700 drm/i915/guc: Plumb GuC-capture into gpu_coredump Add a flags parameter through all of the coredump creation functions. Add a bitmask flag to indicate if the top level gpu_coredump event is triggered in response to a GuC context reset notification. Using that flag, ensure all coredump functions that read or print mmio-register values related to work submission or command-streamer engines are skipped and replaced with a calls guc-capture module equivalent functions to retrieve or print the register dump. While here, split out display related register reading and printing into its own function that is called agnostic to whether GuC had triggered the reset. For now, introduce an empty printing function that can filled in on a subsequent patch just to handle formatting. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-13-alan.previn.teres.alexis@intel.com commit 247f8071d589333cd0fc559c8802edd13e21e203 Author: Alan Previn Date: Mon Mar 21 09:45:25 2022 -0700 drm/i915/guc: Pre-allocate output nodes for extraction In the rare but possible scenario where we are in the midst of multiple GuC error-capture (and engine reset) events and the user also triggers a forced full GT reset or the internal watchdog triggers the same, intel_guc_submission_reset_prepare's call to flush_work(&guc->ct.requests.worker) can cause the G2H message handler to trigger intel_guc_capture_store_snapshot upon receiving new G2H error-capture notifications. This can happen despite the prior call to disable_submission(guc);. However, there's no race-free way for intel_guc_capture_store_snapshot to know that we are in the midst of a reset. That said, we can never dynamically allocate the output nodes in this handler. Thus, we shall pre-allocate a fixed number of empty nodes up front (at the time of ADS registration) that we can consume from or return to an internal cached list of nodes. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-12-alan.previn.teres.alexis@intel.com commit f5718a7265a6f562dc706e0b610f060ded4c3739 Author: Alan Previn Date: Mon Mar 21 09:45:24 2022 -0700 drm/i915/guc: Extract GuC error capture lists on G2H notification. - Upon the G2H Notify-Err-Capture event, parse through the GuC Log Buffer (error-capture-subregion) and generate one or more capture-nodes. A single node represents a single "engine- instance-capture-dump" and contains at least 3 register lists: global, engine-class and engine-instance. An internal link list is maintained to store one or more nodes. - Because the link-list node generation happen before the call to i915_gpu_codedump, duplicate global and engine-class register lists for each engine-instance register dump if we find dependent-engine resets in a engine-capture-group. - When i915_gpu_coredump calls into capture_engine, (in a subsequent patch) we detach the matching node (guc-id, LRCA, etc) from the link list above and attach it to i915_gpu_coredump's intel_engine_coredump structure when have matching LRCA/guc-id/engine-instance. Additional notes to be aware of: - GuC generates the error capture dump into the GuC log buffer but this buffer is one big log buffer with 3 independent subregions within it. Each subregion is populated with different content and used in different ways and timings but all regions operate behave as independent ring buffers. Each guc-log subregion (general-logs, crash-dump and error- capture) has it's own guc_log_buffer_state that contain independent read and write pointers. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-11-alan.previn.teres.alexis@intel.com commit d7c15d76a5547eec420aa9b2940c3e5e7cb77a5a Author: Alan Previn Date: Mon Mar 21 09:45:23 2022 -0700 drm/i915/guc: Check sizing of guc_capture output Add intel_guc_capture_output_min_size_est function to provide a reasonable minimum size for error-capture region before allocating the shared buffer. Signed-off-by: Alan Previn Reviewed-by: Matthew Brost Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-10-alan.previn.teres.alexis@intel.com commit daff407a083da2a50bc5a46c07756a9ccd7842df Author: Alan Previn Date: Mon Mar 21 09:45:22 2022 -0700 drm/i915/guc: Add capture region into intel_guc_log GuC log buffer regions for debug-log-events, crash-dumps and error-state-capture are all part of a single bo allocation that also includes the guc_log_buffer_state structures. Now that we support it, increase the size allocation for error-capture. Since the error-capture region is accessed at non-deterministic times (as part of GuC triggered context reset) while debug-log- events region is accessed as part of relay logging or during debugfs triggered dumps, move the mapping and unmapping of the shared buffer into intel_guc_log_create and intel_guc_log_destroy so that it's always mapped throughout life of GuC operation. Additionally, while here, update the guc log region layout diagram to follow the order according to the enum definition as per the GuC interface. NOTE: A future effort to visit (part of baseline code) is that buf_addr should be updated to be a io_sys_map and use the io_sys_map wrapper functions to access the various GuC log buffer regions. Signed-off-by: Alan Previn Reviewed-by: Matthew Brost Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-9-alan.previn.teres.alexis@intel.com commit 580329a3a4a2ffb5168b43e7a1fc1610e6bcae98 Author: Alan Previn Date: Mon Mar 21 09:45:21 2022 -0700 drm/i915/guc: Update GuC-log relay function names For the sake of better code readibility, change previous relay logging function names with "capture_logs" to "copy_debug_logs" to differentiate from error capture functions that will use a different region of the same buffer. Signed-off-by: Alan Previn Reviewed-by: Matthew Brost Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-8-alan.previn.teres.alexis@intel.com commit bd1a78b04b68fb8cba94309f6d426dfc50eba873 Author: Alan Previn Date: Mon Mar 21 09:45:20 2022 -0700 drm/i915/guc: Add GuC's error state capture output structures. Add GuC's error capture output structures and definitions as how they would appear in GuC log buffer's error capture subregion after an error state capture G2H event notification. Signed-off-by: Alan Previn Reviewed-by: Matthew Brost Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-7-alan.previn.teres.alexis@intel.com commit dce2bd5423374973f2a66d6e00e932eb0a5d32d6 Author: Alan Previn Date: Mon Mar 21 09:45:19 2022 -0700 drm/i915/guc: Add Gen9 registers for GuC error state capture. Abstract out a Gen9 register list as the default for all other platforms we don't yet formally support GuC submission on. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-6-alan.previn.teres.alexis@intel.com commit 33a220f6fcfc7fd9819f96aac69356593a63b10f Author: Alan Previn Date: Mon Mar 21 09:45:18 2022 -0700 drm/i915/guc: Add DG2 registers for GuC error state capture. Add additional DG2 registers for GuC error state capture. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-5-alan.previn.teres.alexis@intel.com commit 193be3f448ca75f9bfd36a7b489201f3572a8b49 Author: Alan Previn Date: Mon Mar 21 09:45:17 2022 -0700 drm/i915/guc: Add XE_LP steered register lists support Add the ability for runtime allocation and freeing of steered register list extentions that depend on the detected HW config fuses. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-4-alan.previn.teres.alexis@intel.com commit 8b72c21618de6039d53b3300d4d5f3a3dd69c077 Author: Alan Previn Date: Mon Mar 21 09:45:16 2022 -0700 drm/i915/guc: Add XE_LP static registers for GuC error capture. Add device specific tables and register lists to cover different engines class types for GuC error state capture for XE_LP products. Signed-off-by: Alan Previn Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-3-alan.previn.teres.alexis@intel.com commit 24492514ccbd57121f168bb14939f32d8905d579 Author: Alan Previn Date: Mon Mar 21 09:45:15 2022 -0700 drm/i915/guc: Update GuC ADS size for error capture lists Update GuC ADS size allocation to include space for the lists of error state capture register descriptors. Then, populate GuC ADS with the lists of registers we want GuC to report back to host on engine reset events. This list should include global, engine-class and engine-instance registers for every engine-class type on the current hardware. Ensure we allocate a persistent store for the register lists that are populated into ADS so that we don't need to allocate memory during GT resets when GuC is reloaded and ADS population happens again. NOTE: Start with a sample static table of register lists to layout the framework before adding real registers in subsequent patch. This static register tables are a different format from the ADS populated list. Signed-off-by: Alan Previn Reviewed-by: Matthew Brost Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321164527.2500062-2-alan.previn.teres.alexis@intel.com commit 61c5ed946da28e45edc3470e8d9f4da19cb15c8d Author: Michael Cheng Date: Mon Mar 21 15:38:19 2022 -0700 drm/i915/gt: replace cache_clflush_range Replace all occurrence of cache_clflush_range with drm_clflush_virt_range. This will prevent compile errors on non-x86 platforms. Signed-off-by: Michael Cheng Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220321223819.72833-6-michael.cheng@intel.com commit 89754df82f1565f2223293c0a0062b779a33d136 Author: Michael Cheng Date: Mon Mar 21 15:38:18 2022 -0700 drm/i915/: Re-work clflush_write32 Use drm_clflush_virt_range instead of clflushopt and remove the memory barrier, since drm_clflush_virt_range takes care of that. v2(Michael Cheng): Use sizeof(*addr) instead of sizeof(addr) to get the actual size of the page. Thanks to Matt Roper for pointing this out. Signed-off-by: Michael Cheng Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220321223819.72833-5-michael.cheng@intel.com commit 92b0cba49e80759e4b67757e0eb3499575dc7e06 Author: Michael Cheng Date: Mon Mar 21 15:38:17 2022 -0700 drm/i915/gt: Re-work reset_csb Use drm_clflush_virt_range instead of directly invoking clflush. This will prevent compiler errors when building for non-x86 architectures. v2(Michael Cheng): Remove extra clflush v3(Michael Cheng): Remove memory barrier since drm_clflush_virt_range takes care of it. v4(Michael Cheng): Get the size of value and not the size of the pointer when passing in execlists->csb_write. Thanks to Matt Roper for pointing this out. Signed-off-by: Michael Cheng Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220321223819.72833-4-michael.cheng@intel.com commit dc0406820ee750f17d516824666fbd6fe5b34537 Author: Michael Cheng Date: Mon Mar 21 15:38:16 2022 -0700 drm/i915/gt: Drop invalidate_csb_entries Drop invalidate_csb_entries and directly call drm_clflush_virt_range. This allows for one less function call, and prevent complier errors when building for non-x86 architectures. v2(Michael Cheng): Drop invalidate_csb_entries function and directly invoke drm_clflush_virt_range. Thanks to Tvrtko for the sugguestion. v3(Michael Cheng): Use correct parameters for drm_clflush_virt_range. Thanks to Tvrtko for pointing this out. v4(Michael Cheng): Simplify &execlists->csb_status[0] to execlists->csb_status. Thanks to Matt Roper for the suggestion. Signed-off-by: Michael Cheng Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220321223819.72833-3-michael.cheng@intel.com commit 055f15e7be2e03634b54bae53feb134ff1240d13 Author: Michael Cheng Date: Mon Mar 21 15:38:15 2022 -0700 drm/i915/gt: Re-work intel_write_status_page Re-work intel_write_status_page to use drm_clflush_virt_range. This will prevent compiler errors when building for non-x86 architectures. Signed-off-by: Michael Cheng Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220321223819.72833-2-michael.cheng@intel.com commit 6f30158f4014d346552cf3b999fd060e856e66d3 Author: Jani Nikula Date: Mon Mar 21 15:59:55 2022 +0200 drm/i915/gt: fix i915_reg_t initialization The initialization is there only to silence the compiler, but use the correct initializer for i915_reg_t. Cc: Lucas De Marchi Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220321135955.922791-1-jani.nikula@intel.com commit 7d14db8b4d83164c2fafed2ee5a12877103b5775 Author: Andi Shyti Date: Mon Mar 21 14:27:59 2022 +0200 drm/i915/debugfs: Do not return '0' if there is nothing to return Change functions that always return '0' to be void type. Signed-off-by: Andi Shyti Reviewed-by: Maciej Patelczyk Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220321122759.227091-1-andi.shyti@linux.intel.com commit 54903c7a6b40e34c3b0da3a3a5bb93f909295ce3 Author: Ville Syrjälä Date: Tue Mar 15 15:27:52 2022 +0200 drm/i915: s/enable/active/ for DRRS Rename the DRRS functiosn to say "(de)activate" rather than "enable/disable". This let's us differentiate between the logically enabled vs. actually currently active cases. v2: Fix kernel doc for intel_drrs_deactivate() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-10-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 6185587b6675e1852c49235e00fb76f7d81ff0d9 Author: Ville Syrjälä Date: Fri Feb 18 12:03:57 2022 +0200 drm/tilcdc: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Cc: Jyri Sarha Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-17-ville.syrjala@linux.intel.com Reviewed-by: Tomi Valkeinen commit cc436b1c674e4247b4d4873f2236039f697f4e57 Author: Ville Syrjälä Date: Fri Feb 18 12:03:48 2022 +0200 drm/gma500: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Cc: Patrik Jakobsson Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-8-ville.syrjala@linux.intel.com Acked-by: Patrik Jakobsson commit ea0839691816b9742ca1371d4e1645192f1a733d Author: Ville Syrjälä Date: Thu Mar 3 21:12:07 2022 +0200 drm/i915: Add "maximum pipe read bandwidth" checks Make sure the CDCLK is high enough to support the so called "maximum pipe read bandwidth" limitation. Specified as 51.2 x CDCLK. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-10-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 5ac860cc52540df8bca27e0bb25b6744df67e8f0 Author: Ville Syrjälä Date: Thu Mar 3 21:12:06 2022 +0200 drm/i915: Fix DBUF bandwidth vs. cdclk handling Make the dbuf bandwidth min cdclk calculations match the spec more closely. Supposedly the arbiter can only guarantee an equal share of the total bandwidth of the slice to each active plane on that slice. So we take the max bandwidth of any of the planes on each slice and multiply that by the number of active planes on the slice to get a worst case estimate on how much bandwidth we require. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-9-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 6731eb046cf71e30a79e60bae8ed31f5450928fa Author: Ville Syrjälä Date: Thu Mar 3 21:12:05 2022 +0200 drm/i915: Properly write lock bw_state when it changes The current code also forgets to call intel_atomic_lock_global_state() when other stuff besides the final min_cdlck changes in the state. That means we may throw away data which actually has changed, and thus we can't be at all sure what the code ends up doing during subsequent commits. Do the write lock properly. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-8-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 6c69d0bb9f15cdbc8fd6134e2c66438b69bb9581 Author: Ville Syrjälä Date: Thu Mar 3 21:12:04 2022 +0200 drm/i915: Round up when calculating display bandwidth requirements We should round up when doing bandwidth calculations to make sure our estimates don't fall short of the actual number. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-7-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 7243867c6f9617c451c763a7751fa743c3f04f4a Author: Ville Syrjälä Date: Thu Mar 3 21:12:03 2022 +0200 drm/i915: Nuke intel_bw_calc_min_cdclk() intel_bw_calc_min_cdclk() is entirely pointless. All it manages to do is somehow conflate the per-pipe min cdclk with dbuf min cdclk. There is no (at least documented) dbuf min cdclk limit on pre-skl so let's just get rid of all this confusion. Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-6-ville.syrjala@linux.intel.com commit 0d21fd10fb3c7485e4701d9f89bf463965e28339 Author: Ville Syrjälä Date: Thu Mar 3 21:12:02 2022 +0200 drm/i915: Remove total[] and uv_total[] from ddb allocation There's really no need to maintain these total[] arrays to track the size of each plane's ddb allocation. We just stick the results straight into the crtc_state ddb tracking structures. The main annoyance with all this is the mismatch between wm_uv vs. ddb_y on pre-icl. If only the hw was consistent in what it considers the primary source of information we could avoid some of the uglyness. But since that is not the case we need a bit of special casing for planar formats. v2: Keep the ddb entry zeroed when the plane is disabled Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-5-ville.syrjala@linux.intel.com commit c034363ca898ea0f809efb113e232dfd0b3e59f2 Author: Ville Syrjälä Date: Thu Mar 3 21:12:01 2022 +0200 drm/i915: Pre-calculate plane relative data rate Handle the plane relative data rate in exactly the same way as we already handle the real data rate. Ie. pre-calculate it during intel_plane_atomic_check_with_state(), and assign/clear it for the Y plane as needed. This should guarantee that the tracking is 100% consistent, and makes me have to think less when the same apporach is used by both types of data rate. We might even want to consider replacing the relative data rate with the real data rate entirely, but it's not clear if that will produce less optimal plane ddb allocations. So for now lets keep using the current approach. v2: Rebase due to async flip wm optimization Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-4-ville.syrjala@linux.intel.com commit 943ed3cc02191b220eb430dc855509ccc2c1a28e Author: Ville Syrjälä Date: Thu Mar 3 21:12:00 2022 +0200 drm/i915: Split plane data_rate into data_rate+data_rate_y Split the currently combined plane data_rate into the proper Y vs. CbCr components. This matches how we now track the plane dbuf allocations, and thus will make the dbuf bandwidth calculations actually produce the correct numbers for each dbuf slice. Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-3-ville.syrjala@linux.intel.com commit 7d4561722c3b9233865e327e0497e269eee76d28 Author: Ville Syrjälä Date: Thu Mar 3 21:11:59 2022 +0200 drm/i915: Tweak plane ddb allocation tracking Let's store the plane allocation in a manner which more closely matches how the hw operates. That is, we store the packed/CbCr ddb in one struct, and the Y ddb in another. Currently we're storing packed/Y in one struct, CbCr in the other. This also works pretty well for icl+ where the UV plane is the main plane and the Y plane is subservient to it. Although in this case we do not even use ddb_y as we do the ddb allocation in terms of hw planes. v2: Rebase Reviewed-by: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303191207.27931-2-ville.syrjala@linux.intel.com commit f99f55690798b7fb9ce8877c74d1c126998a14b7 Author: José Roberto de Souza Date: Tue Mar 15 13:51:22 2022 -0700 drm/i915/display/adlp: More voltage swing table updates A few more updates in the alderlake-P voltage swing tables. eDP HBR3 table was the same as icelake one but now it has changes for voltage 0 and pre-emphasis 2 line. And DP tables also had one line change in each. Bspec: 49291 Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315205122.202701-1-jose.souza@intel.com commit 6f6f9788d821ee39c8a28e389a35027d6a5f143b Author: Zack Rusin Date: Fri Mar 18 13:43:31 2022 -0400 drm/vmwgfx: Disable command buffers on svga3 without gbobjects With very limited vram on svga3 it's difficult to handle all the surface migrations. Without gbobjects, i.e. the ability to store surfaces in guest mobs, there's no reason to support intermediate svga2 features, especially because we can fall back to fb traces and svga3 will never support those in-between features. On svga3 we wither want to use fb traces or screen targets (i.e. gbobjects), nothing in between. This fixes presentation on a lot of fusion/esxi tech previews where the exposed svga3 caps haven't been finalized yet. Signed-off-by: Zack Rusin Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3") Cc: # v5.14+ Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-5-zack@kde.org commit 8bb75aeb58bd688d70827ae179bd3da57b6d975b Author: Zack Rusin Date: Fri Mar 18 13:43:30 2022 -0400 drm/vmwgfx: validate the screen formats The kms code wasn't validating the modifiers and was letting through unsupported formats. rgb8 was never properly supported and has no matching svga screen target format so remove it. This fixes format/modifier failures in kms_addfb_basic from IGT. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-4-zack@kde.org commit ab709795e38637320fea9fdc8e06b64f670b58ee Author: Zack Rusin Date: Fri Mar 18 13:43:29 2022 -0400 drm/vmwgfx: Fix mob cursor allocation race Writes to SVGA_REG_CURSOR_MOBID did not wait for the buffers to be fully populated. This sometimes results in the device not being aware of the buffer when the cursor mob register was written. Properly wait for the buffer to be fully populated before setting it as a cursor mob. Signed-off-by: Zack Rusin Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-3-zack@kde.org commit 10a26e0d5fc3574f63ce8a6cf28381b126317f40 Author: Zack Rusin Date: Fri Mar 18 13:43:28 2022 -0400 drm/vmwgfx: Fix an invalid read vmw_move assumed that buffers to be moved would always be vmw_buffer_object's but after introduction of new placement for mob pages that's no longer the case. The resulting invalid read didn't have any practical consequences because the memory isn't used unless the object actually is a vmw_buffer_object. Fix it by moving the cast to the spot where the results are used. Signed-off-by: Zack Rusin Fixes: f6be23264bba ("drm/vmwgfx: Introduce a new placement for MOB page tables") Reported-by: Chuck Lever III Reviewed-by: Martin Krastev Tested-by: Chuck Lever Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-2-zack@kde.org commit 008bd15c4f17432f44cc48d38e97bb86110fd305 Author: Jani Nikula Date: Thu Mar 17 19:33:55 2022 +0200 drm/i915/sdvo: prefer __packed over __attribute__((packed)) The kernel preference is to use the __packed macro instead of the direct __attribute__. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220317173355.336835-1-jani.nikula@intel.com commit 230523ba24bda5387637188ad56530bf6abd3f6c Author: Vivek Kasireddy Date: Sun Mar 20 17:54:31 2022 -0700 drm/i915/gem: Don't evict unmappable VMAs when pinning with PIN_MAPPABLE (v2) On platforms capable of allowing 8K (7680 x 4320) modes, pinning 2 or more framebuffers/scanout buffers results in only one that is mappable/ fenceable. Therefore, pageflipping between these 2 FBs where only one is mappable/fenceable creates latencies large enough to miss alternate vblanks thereby producing less optimal framerate. This mainly happens because when i915_gem_object_pin_to_display_plane() is called to pin one of the FB objs, the associated vma is identified as misplaced -- because there is no space for it in the aperture -- and therefore i915_vma_unbind() is called which unbinds and evicts it. This misplaced vma gets subseqently pinned only when i915_gem_object_ggtt_pin_ww() is called without PIN_MAPPABLE. This whole thing results in a latency of ~10ms and happens every other repaint cycle. Therefore, to fix this issue, we just ensure that the misplaced VMA does not get evicted when we try to pin it with PIN_MAPPABLE -- by returning early if the mappable/fenceable flag is not set. Testcase: Running Weston and weston-simple-egl on an Alderlake_S (ADLS) platform with a 8K@60 mode results in only ~40 FPS (compared to ~59 FPS with this patch). Since upstream Weston submits a frame ~7ms before the next vblank, the latencies seen between atomic commit and flip event are 7, 24 (7 + 16.66), 7, 24..... suggesting that it misses the vblank every other frame. Here is the ftrace snippet that shows the source of the ~10ms latency: i915_gem_object_pin_to_display_plane() { 0.102 us | i915_gem_object_set_cache_level(); i915_gem_object_ggtt_pin_ww() { 0.390 us | i915_vma_instance(); 0.178 us | i915_vma_misplaced(); i915_vma_unbind() { __i915_active_wait() { 0.082 us | i915_active_acquire_if_busy(); 0.475 us | } intel_runtime_pm_get() { 0.087 us | intel_runtime_pm_acquire(); 0.259 us | } __i915_active_wait() { 0.085 us | i915_active_acquire_if_busy(); 0.240 us | } __i915_vma_evict() { ggtt_unbind_vma() { gen8_ggtt_clear_range() { 10507.255 us | } 10507.689 us | } 10508.516 us | } v2: - Expand the code comments to describe the ping-pong issue. Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Signed-off-by: Vivek Kasireddy Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220321005431.1113890-1-vivek.kasireddy@intel.com commit 72a9bff386545d3f8e9c432cb8e036272ad4e1fa Author: Hari Chandrakanthan Date: Wed Mar 9 16:54:25 2022 +0530 ath11k: change fw build id format in driver init log Currently fw build id is printed during init as follows. fw_version 0x250684a5 fw_build_timestamp 2021-07-13 10:57 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 The string "QC_IMAGE_VERSION_STRING=" is removed from the log to improve readability. With this patch the fw build id is printed during init as follows. fw_version 0x250684a5 fw_build_timestamp 2021-07-13 10:57 fw_build_id WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Hari Chandrakanthan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1646825065-7736-1-git-send-email-quic_haric@quicinc.com commit 997dc60f0855b39aec0400511b37d65781da9255 Author: Karthikeyan Periyasamy Date: Mon Feb 28 10:24:39 2022 +0530 ath11k: Refactor the peer delete Introduce new helper function for peer delete to reuse this logic in all peer cleanup procedures. Found this in code review. Also this change is applicable for all the platform. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1646024079-26391-1-git-send-email-quic_periyasa@quicinc.com commit c4e9705c50121771e7582830359894431f24db73 Author: Meng Tang Date: Fri Mar 18 10:53:31 2022 +0800 ath10k: Use of_device_get_match_data() helper Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). Signed-off-by: Meng Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220318025331.23030-1-tangmeng@uniontech.com commit 2c3fc50591ff3b7c90afb39c6f4ac67a0ffeeb76 Author: Youghandhar Chintala Date: Tue Mar 15 13:59:44 2022 +0530 ath10k: Trigger sta disconnect on hardware restart Currently after the hardware restart triggered from the driver, the station interface connection remains intact, since a disconnect trigger is not sent to userspace. This can lead to a problem in targets where the wifi mac sequence is added by the firmware. After the target restart, its wifi mac sequence number gets reset to zero. Hence AP to which our device is connected will receive frames with a wifi mac sequence number jump to the past, thereby resulting in the AP dropping all these frames, until the frame arrives with a wifi mac sequence number which AP was expecting. To avoid such frame drops, its better to trigger a station disconnect upon target hardware restart which can be done with API ieee80211_reconfig_disconnect exposed to mac80211. 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.1-01040-QCAHLSWMTPLZ-1 Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1 Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00048 Signed-off-by: Youghandhar Chintala Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220315082944.12406-3-youghand@codeaurora.org commit fa68bff7cf27d83e0ca83c6388d6bc2ddc599905 Author: Sujaritha Sundaresan Date: Sat Mar 19 01:39:37 2022 +0200 drm/i915/gt: Add sysfs throttle frequency interfaces Throttling here refers to the GT frequency being clipped. Each of the throttle reason attributes will have a 0 or 1 value depending upon whether there is throttling and also the specific reason for it. The following is a brief description of the sysfs throttle frequency attributes added: - throttle_reason_status: when set indicates that there is GT frequency clipping. - throttle_reason_pl1: when set indicates that PBM PL1 (platform or package PL1) has caused GT frequency clipping. - throttle_reason_pl2: when set indicates that PBM PL2 or PL3 (platform or package PL2 or PL3) has caused GT frequency clipping. - throttle_reason_pl4: when set indicates that PL4 or IccMax has caused GT frequency clipping. - throttle_reason_thermal: when set indicates that Thermal event has caused GT frequency clipping. - throttle_reason_prochot: when set indicates that PROCHOT# has caused GT frequency clipping. - throttle_reason_ratl: when set indicates that Running Average Thermal Limit has caused GT frequency clipping. - throttle_reason_vr_thermalert: when set indicates that Hot VR (any processor VR) has caused GT frequency clipping. - throttle_reason_vr_tdc: when set indicates that VR TDC (Thermal Design Current) has caused GT frequency clipping. Signed-off-by: Sujaritha Sundaresan Signed-off-by: Andi Shyti Cc: Dale B Stimson Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-8-andi.shyti@linux.intel.com commit 56a709cf77468e3a422b0ce3d58f8c2257bac2f1 Author: Andi Shyti Date: Sat Mar 19 01:39:36 2022 +0200 drm/i915/gt: Create per-tile RPS sysfs interfaces Now tiles have their own sysfs interfaces under the gt/ directory. Because RPS is a property that can be configured on a tile basis, then each tile should have its own interface The new sysfs structure will have a similar layout for the 4 tile case: /sys/.../card0 ├── gt │   ├── gt0 │   │   ├── id │   │   ├── rc6_enable │   │   ├── rc6_residency_ms │   │   ├── rps_act_freq_mhz │   │   ├── rps_boost_freq_mhz │   │   ├── rps_cur_freq_mhz │   │   ├── rps_max_freq_mhz │   │   ├── rps_min_freq_mhz │   │   ├── rps_RP0_freq_mhz │   │   ├── rps_RP1_freq_mhz │   │  └── rps_RPn_freq_mhz . . . . . . │   └── gtN │   ├── id │   ├── rc6_enable │   ├── rc6_residency_ms │   ├── rps_act_freq_mhz │   ├── rps_boost_freq_mhz │   ├── rps_cur_freq_mhz │   ├── rps_max_freq_mhz │   ├── rps_min_freq_mhz │   ├── rps_RP0_freq_mhz │   ├── rps_RP1_freq_mhz │   └── rps_RPn_freq_mhz ├── gt_act_freq_mhz -+ ├── gt_boost_freq_mhz | ├── gt_cur_freq_mhz | Original interface ├── gt_max_freq_mhz +─-> kept as existing ABI; ├── gt_min_freq_mhz | it points to gt0/ ├── gt_RP0_freq_mhz | ├── gt_RP1_freq_mhz | └── gt_RPn_freq_mhz -+ The existing interfaces have been kept in their original location to preserve the existing ABI. They act on all the GTs: when writing they loop through all the GTs and write the information on each interface. When reading they provide the average value from all the GTs. This patch is not really adding exposing new interfaces (new ABI) other than adapting the existing one to more tiles. In any case this new set of interfaces will be a basic tool for system managers and administrators when using i915. Signed-off-by: Andi Shyti Signed-off-by: Lucas De Marchi Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Matt Roper Cc: Sujaritha Sundaresan Cc: Tvrtko Ursulin Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-7-andi.shyti@linux.intel.com commit 80cf8af17af042cd4b287716aca917422053f873 Author: Andi Shyti Date: Sat Mar 19 01:39:35 2022 +0200 drm/i915/gt: Create per-tile RC6 sysfs interface Now tiles have their own sysfs interfaces under the gt/ directory. Because RC6 is a property that can be configured on a tile basis, then each tile should have its own interface The new sysfs structure will have a similar layout for the 4 tile case: /sys/.../card0 ├── gt │   ├── gt0 │   │   ├── id │   │   ├── rc6_enable │   │   ├── rc6_residency_ms . . . . . . . . │   └── gtN │   ├── id │   ├── rc6_enable │   ├── rc6_residency_ms │ . │ . │ └── power/ -+ ├── rc6_enable | Original interface ├── rc6_residency_ms +-> kept as existing ABI; . | it multiplexes over . | the GTs -+ The existing interfaces have been kept in their original location to preserve the existing ABI. They act on all the GTs: when reading they provide the average value from all the GTs. This patch is not really adding exposing new interfaces (new ABI) other than adapting the existing one to more tiles. In any case this new set of interfaces will be a basic tool for system managers and administrators when using i915. Signed-off-by: Andi Shyti Signed-off-by: Lucas De Marchi Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Matt Roper Cc: Sujaritha Sundaresan Cc: Tvrtko Ursulin Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-6-andi.shyti@linux.intel.com commit b770bcfae9ad816cd9efce6b0fff4dab47084578 Author: Andi Shyti Date: Sat Mar 19 01:39:34 2022 +0200 drm/i915/gt: create per-tile sysfs interface Now that we have tiles we want each of them to have its own interface. A directory "gt/" is created under "cardN/" that will contain as many diroctories as the tiles. In the coming patches tile related interfaces will be added. For now the sysfs gt structure simply has an id interface related to the current tile count. The directory structure will follow this scheme: /sys/.../card0 └── gt    ├── gt0    │   └── id : : └─- gtN       └── id This new set of interfaces will be a basic tool for system managers and administrators when using i915. Signed-off-by: Andi Shyti Cc: Chris Wilson Cc: Matt Roper Cc: Sujaritha Sundaresan Cc: Tvrtko Ursulin Reviewed-by: Sujaritha Sundaresan Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-5-andi.shyti@linux.intel.com commit bec68cc9ea42d853f00da347793cefe49575a574 Author: Tvrtko Ursulin Date: Sat Mar 19 01:39:33 2022 +0200 drm/i915: Prepare for multiple GTs On a multi-tile platform, each tile has its own registers + GGTT space, and BAR 0 is extended to cover all of them. Up to four GTs are supported in i915->gt[], with slot zero shadowing the existing i915->gt0 to enable source compatibility with legacy driver paths. A for_each_gt macro is added to iterate over the GTs and will be used by upcoming patches that convert various parts of the driver to be multi-gt aware. Only the primary/root tile is initialized for now; the other tiles will be detected and plugged in by future patches once the necessary infrastructure is in place to handle them. Signed-off-by: Abdiel Janulgue Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Tvrtko Ursulin Signed-off-by: Matt Roper Signed-off-by: Andi Shyti Cc: Daniele Ceraolo Spurio Cc: Joonas Lahtinen Cc: Matthew Auld Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-4-andi.shyti@linux.intel.com commit b9741faadbd64db562a85dc79b31b85fa354eeb5 Author: Andi Shyti Date: Sat Mar 19 01:39:32 2022 +0200 drm/i915/gt: add gt_is_root() helper The "gt_is_root(struct intel_gt *gt)" helper return true if the gt is the root gt, which means that its id is 0. Return false otherwise. Suggested-by: Michal Wajdeczko Signed-off-by: Andi Shyti Reviewed-by: Michal Wajdeczko Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-3-andi.shyti@linux.intel.com commit fa732088378fa0492bd85f32a89f1f39b305d363 Author: Andi Shyti Date: Sat Mar 19 01:39:31 2022 +0200 drm/i915: Rename INTEL_REGION_LMEM with INTEL_REGION_LMEM_0 With the upcoming multitile support each tile will have its own local memory. Mark the current LMEM with the suffix '0' to emphasise that it belongs to the root tile. Suggested-by: Michal Wajdeczko Signed-off-by: Andi Shyti Reviewed-by: Michal Wajdeczko Reviewed-by: Andrzej Hajda Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220318233938.149744-2-andi.shyti@linux.intel.com commit 6f270e1488d7a85e0c93e6536d0073796adf8b4f Author: Matthew Brost Date: Wed Mar 16 16:45:38 2022 -0700 drm/i915: Add logical mapping for video decode engines Add logical mapping for VDBOXs. This mapping is required for split-frame workloads, which otherwise fail with 00000000-F8C53528: [GUC] 0441-INVALID_ENGINE_SUBMIT_MASK ... if the application is using the logical id to reorder the engines and then using it for the batch buffer submission. It's not a big problem on media version 11 and 12 as they have only 2 instances of VCS and the logical to physical mapping is monotonically increasing - if the application is not using the logical id. Changing it for the previous platforms allows the media driver implementation for the next ones (12.50 and above) to be the same, checking the logical id. It should also not introduce any bug for the old versions of userspace not checking the id. The mapping added here is the complete map needed by XEHPSDV. Previous platforms with only 2 instances will just use a partial map and should still work. v2: Remove static from map variable (José) Cc: Matt Roper Signed-off-by: Matthew Brost [ Extend the mapping to media versions 11 and 12 and give proper justification in the commit message why ] Signed-off-by: Lucas De Marchi Acked-by: Matthew Brost Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220316234538.434357-2-lucas.demarchi@intel.com commit b4ac33b973233dc08a56c8ef9d3c2edeab7a4370 Author: Lucas De Marchi Date: Wed Mar 16 16:45:37 2022 -0700 drm/i915: Fix renamed struct field Earlier versions of commit a5b7ef27da60 ("drm/i915: Add struct to hold IP version") named "ver" as "arch" and then when it was renamed it missed the rename on MEDIA_VER_FULL() since it it's currently not used. Fixes: a5b7ef27da60 ("drm/i915: Add struct to hold IP version") Cc: José Roberto de Souza Cc: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220316234538.434357-1-lucas.demarchi@intel.com commit 4bdba4f4db4cdb34c6d11e8e4030c9044046cb6a Author: Ville Syrjälä Date: Wed Mar 9 18:49:48 2022 +0200 drm/i915: Rename QGV request/response bits Name all the ICL_PCODE_SAGV_DE_MEM_SS_CONFIG request/response bits in a manner that we can actually understand what they're doing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-9-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit f8a1cb3ff4397c2a295712953452946b3dff70c8 Author: Ville Syrjälä Date: Wed Mar 9 18:49:47 2022 +0200 drm/i915: Unconfuses QGV vs. PSF point masks Use separate bitmasks for QGV vs. PSF GV points during the computation. Makes the whole thing a lot less confusing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-8-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 0fed4ddd18f064d2359b430c6e83ee60dd1f49b1 Author: Ville Syrjälä Date: Wed Mar 9 18:49:46 2022 +0200 drm/i915: Fix PSF GV point mask when SAGV is not possible Don't just mask off all the PSF GV points when SAGV gets disabled. This should in fact cause the Pcode to reject the request since at least one PSF point must remain enabled at all times. Cc: stable@vger.kernel.org Cc: Stanislav Lisovskiy Fixes: 192fbfb76744 ("drm/i915: Implement PSF GV point support") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-7-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 4593e8e064353c4db3c1ad0f774d389af33d31c5 Author: Ville Syrjälä Date: Wed Mar 9 18:49:45 2022 +0200 drm/i915: Rename pre-icl SAGV enable/disable functions Give the pre-icl SAGV control functions a skl_ prefix instead of the intel_ prefix to make it a bit more clear that they are not some kind of universal things that can be called on any platform. Also make the functions void since we never use the return value anyway. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-6-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit de2cac863da9427f4476edfc9af35343d0b19a56 Author: Ville Syrjälä Date: Wed Mar 9 18:49:44 2022 +0200 drm/i915: Reject excessive SAGV block time If the mailbox returns an exceesively large SAGV block time let's just reject it. This avoids having to worry about overflows when we add the SAGV block time to the wm0 latency. We shall put the limit arbitrarily at U16_MAX. >65msec latency doesn't really make sense to me in any case. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-5-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 15fc156f22db140ea2d25ecd4aff15e3d800ec35 Author: Ville Syrjälä Date: Wed Mar 9 18:49:43 2022 +0200 drm/i915: Probe whether SAGV works on pre-icl Instead of leaving the SAGV enable/disable to the first commit let's try to disable it first thing to see if we can do it or not (disabling SAGV is a safe thing to at any time). This avoids running the code in this funny intermediate state where we don't know if SAGV is available or not. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit c0074e71bf8d0d16459ecb0de682fcb4192326c1 Author: Ville Syrjälä Date: Wed Mar 9 18:49:42 2022 +0200 drm/i915: Rework SAGV block time probing I'd like to see the SAGV block time we got from the mailbox in the logs regardless of whether other factors prevent the use of SAGV. So let's adjust the code to always query the SAGV block time, log it, and then reset it if SAGV is not actually supported. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit d8f5855b31c0523ea3b171db8dfb998830e8735d Author: Ville Syrjälä Date: Wed Mar 9 18:49:41 2022 +0200 drm/i915: Treat SAGV block time 0 as SAGV disabled For modern platforms the spec explicitly states that a SAGV block time of zero means that SAGV is not supported. Let's extend that to all platforms. Supposedly there should be no systems where this isn't true, and it'll allow us to: - use the same code regardless of older vs. newer platform - wm latencies already treat 0 as disabled, so this fits well with other related code - make it a bit more clear when SAGV is used vs. not - avoid overflows from adding U32_MAX with a u16 wm0 latency value which could cause us to miscalculate the SAGV watermarks on tgl+ Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 856082f021a28221db2c32bd0531614a8382be67 Author: Chuansheng Liu Date: Fri Mar 18 08:50:03 2022 +0800 fbdev: defio: fix the pagelist corruption Easily hit the below list corruption: == list_add corruption. prev->next should be next (ffffffffc0ceb090), but was ffffec604507edc8. (prev=ffffec604507edc8). WARNING: CPU: 65 PID: 3959 at lib/list_debug.c:26 __list_add_valid+0x53/0x80 CPU: 65 PID: 3959 Comm: fbdev Tainted: G U RIP: 0010:__list_add_valid+0x53/0x80 Call Trace: fb_deferred_io_mkwrite+0xea/0x150 do_page_mkwrite+0x57/0xc0 do_wp_page+0x278/0x2f0 __handle_mm_fault+0xdc2/0x1590 handle_mm_fault+0xdd/0x2c0 do_user_addr_fault+0x1d3/0x650 exc_page_fault+0x77/0x180 ? asm_exc_page_fault+0x8/0x30 asm_exc_page_fault+0x1e/0x30 RIP: 0033:0x7fd98fc8fad1 == Figure out the race happens when one process is adding &page->lru into the pagelist tail in fb_deferred_io_mkwrite(), another process is re-initializing the same &page->lru in fb_deferred_io_fault(), which is not protected by the lock. This fix is to init all the page lists one time during initialization, it not only fixes the list corruption, but also avoids INIT_LIST_HEAD() redundantly. V2: change "int i" to "unsigned int i" (Geert Uytterhoeven) Signed-off-by: Chuansheng Liu Fixes: 105a940416fc ("fbdev/defio: Early-out if page is already enlisted") Cc: Thomas Zimmermann Cc: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220318005003.51810-1-chuansheng.liu@intel.com commit ca6920811aa5428270dd78af0a7a36b10119065a Author: Akeem G Abodunrin Date: Thu Mar 17 19:10:51 2022 -0700 drm/i915/dg2: Add preemption changes for Wa_14015141709 Starting with DG2, preemption can no longer be controlled using userspace on a per-context basis. Instead, the hardware only allows us to enable or disable preemption in a global, system-wide basis. Also, we lose the ability to specify the preemption granularity (such as batch-level vs command-level vs object-level). v2 (MattR): - Move debugfs interface to a separate patch. (Jani) v3 (MattR): - Drop the debugfs support completely for now. Cc: Matt Roper Cc: Prathap Kumar Valsan Cc: John Harrison Cc: Joonas Lahtinen Cc: Jani Nikula Cc: Tvrtko Ursulin Signed-off-by: Akeem G Abodunrin Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20220318021051.2073847-1-matthew.d.roper@intel.com commit b7d174479c8ac365828d474b385da2da858f2089 Author: Julia Lawall Date: Mon Mar 14 12:53:27 2022 +0100 ath6kl: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314115354.144023-4-Julia.Lawall@inria.fr commit 9503a1fc123d9c9c502a7e518634296874a7b8cc Author: Minghao Chi Date: Mon Mar 14 06:45:01 2022 +0000 ath9k: Use platform_get_irq() to get the interrupt It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314064501.2114002-1-chi.minghao@zte.com.cn commit a16d9b50cfbaf112401b8e5ccfa852709f498cd4 Author: Carl Huang Date: Mon Mar 14 07:18:16 2022 +0200 ath11k: support GTK rekey offload Host sets GTK related info to firmware before WoW is enabled, and gets rekey replay_count and then disables GTK rekey when WoW quits. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-7-git-send-email-quic_cjhuang@quicinc.com commit c3c36bfe998b3ad14aa87a57037a05d861889ac8 Author: Carl Huang Date: Mon Mar 14 07:18:16 2022 +0200 ath11k: support ARP and NS offload Support ARP and NS offload in WoW state. Tested this way: put machine A with QCA6390 to WoW state, ping/ping6 machine A from another machine B, check sniffer to see any ARP response and Neighbour advertisement from machine A. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-6-git-send-email-quic_cjhuang@quicinc.com commit 90bf5c8d0f7ecddf96fc1cd9434af4e157b51970 Author: Carl Huang Date: Mon Mar 14 07:18:16 2022 +0200 ath11k: purge rx pktlog when entering WoW This change is to purge rx pktlog when entering WoW and reap the mon_status buffer to keep it empty. When leaving WoW, host restarts the reap timer. In WoW state, it's not allowed to feed into mon_status rings per firmware team's recommendation. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-5-git-send-email-quic_cjhuang@quicinc.com commit c417b247ba042161ddfb34f26a42ec67edc5c378 Author: Carl Huang Date: Mon Mar 14 07:18:16 2022 +0200 ath11k: implement hardware data filter Host needs to set hardware data filter before entering WoW to let firmware drop needless broadcast/mulitcast frames to avoid frequent wakeup. Host clears hardware data filter when leaving WoW. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-4-git-send-email-quic_cjhuang@quicinc.com commit fec4b898f369a9b9d516f7bfc459eb4a8c5ceb2c Author: Carl Huang Date: Mon Mar 14 07:18:16 2022 +0200 ath11k: Add WoW net-detect functionality Implement net-detect feature by setting flag WIPHY_WOWLAN_NET_DETECT if firmware supports this feature. Driver sets the related PNO configuration to firmware before entering WoW and firmware then scans periodically and wakes up host if a specific SSID is found. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-3-git-send-email-quic_cjhuang@quicinc.com commit ba9177fcef21fa98406e73c472b5ac2eb4ec5f31 Author: Carl Huang Date: Mon Mar 14 07:18:15 2022 +0200 ath11k: Add basic WoW functionalities Implement basic WoW functionalities such as magic-packet, disconnect and pattern. The logic is very similar to ath10k. When WoW is configured, ath11k_core_suspend and ath11k_core_resume are skipped as WoW configuration and hif suspend/resume are done in ath11k_wow_op_suspend() and ath11k_wow_op_resume(). Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Baochen Qiang Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1644308006-22784-2-git-send-email-quic_cjhuang@quicinc.com commit 78e1fb3112c0ac440bf9dce080a4aefbaa547d52 Author: Rodrigo Vivi Date: Sun Mar 6 15:21:57 2022 -0800 drm/i915/uapi: Add query for hwconfig blob In this interface i915 is returning a blob of data which it receives from the guc software. This blob provides some useful data about the hardware for drivers. The format of this blob will be documented in the Programmer Reference Manuals when released. Cc: Tvrtko Ursulin Cc: Kenneth Graunke Cc: Michal Wajdeczko Cc: Slawomir Milczarek Cc: Joonas Lahtinen Signed-off-by: Rodrigo Vivi Signed-off-by: John Harrison Reviewed-by: Matthew Brost Acked-by: Jordan Justen Tested-by: Jordan Justen Acked-by: Jon Bloomfield Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220306232157.1174335-3-jordan.l.justen@intel.com commit 8781f0515247f441623a01f6e036a1d7898170e2 Author: John Harrison Date: Sun Mar 6 15:21:56 2022 -0800 drm/i915/guc: Add fetch of hwconfig blob Implement support for fetching the hardware description table from the GuC. The call is made twice - once without a destination buffer to query the size and then a second time to fill in the buffer. The table is stored in the GT structure so that it can be fetched once at driver load time. Keeping inside a GuC structure would mean it would be release and reloaded on a GuC reset (part of a full GT reset). However, the table does not change just because the GT has been reset and the GuC reloaded. Also, dynamic memory allocations inside the reset path are a problem. Note that the table is only available on ADL-P and later platforms. v2 (John's v2 patch): * Move to GT level to avoid memory allocation during reset path (and unnecessary re-read of the table on a reset). v5 (of Jordan's posting): * Various changes made by Jordan and recommended by Michal - Makefile ordering - Adjust "struct intel_guc_hwconfig hwconfig" comment - Set Copyright year to 2022 in intel_guc_hwconfig.c/.h - Drop inline from hwconfig_to_guc() - Replace hwconfig param with guc in __guc_action_get_hwconfig() - Move zero size check into guc_hwconfig_discover_size() - Change comment to say zero size offset/size is needed to get size - Add has_guc_hwconfig to devinfo and drop has_table() - Change drm_err to notice in __uc_init_hw() and use %pe v6 (of Jordan's posting): * Added a couple more small changes recommended by Michal * Merge in John's v2 patch, but note: - Using drm_notice as recommended by Michal - Reverted Michal's suggestion of using devinfo v7 (of Jordan's posting): * Change back to drm_err as preferred by John Cc: Michal Wajdeczko Signed-off-by: Rodrigo Vivi Signed-off-by: John Harrison Reviewed-by: Matthew Brost Acked-by: Jon Bloomfield Signed-off-by: Jordan Justen Reviewed-by: Michal Wajdeczko Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220306232157.1174335-2-jordan.l.justen@intel.com commit 9f493fd71d4b132ed87e88b39cd46acf6b963062 Author: Sankeerth Billakanti Date: Wed Mar 16 23:05:49 2022 +0530 drm/panel-edp: add LQ140M1JW46 edp panel entry Add panel identification entry for the sharp LQ140M1JW46 eDP panel with power sequencing delay information. Signed-off-by: Sankeerth Billakanti Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/1647452154-16361-5-git-send-email-quic_sbillaka@quicinc.com commit daa83f744a31ca1c4f6cde7c4fcae0c89aa2dadc Author: Christophe Branchereau Date: Fri Mar 11 18:02:40 2022 +0100 dt-bindings: display/panel: Add Leadtek ltk035c5444t Add binding for the leadtek ltk035c5444t, which is a 640x480 mipi-dbi over spi / 24-bit RGB panel based on the newvision NV03052C chipset. It is found in the Anbernic RG350M mips handheld. Signed-off-by: Christophe Branchereau Signed-off-by: Paul Cercueil Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220311170240.173846-5-cbranchereau@gmail.com commit 7438f52b578afbac3807396531361aac85d43a06 Author: Thomas Zimmermann Date: Sun Mar 13 20:29:52 2022 +0100 fbdev: Fix cfb_imageblit() for arbitrary image widths Commit 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()") broke cfb_imageblit() for image widths that are not aligned to 8-bit boundaries. Fix this by handling the trailing pixels on each line separately. The performance improvements in the original commit do not regress by this change. Signed-off-by: Thomas Zimmermann Fixes: 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()") Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter Tested-by: Marek Szyprowski Reported-by: Marek Szyprowski Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220313192952.12058-3-tzimmermann@suse.de commit 61bfcb6a3b981e8f19e044ac8c3de6edbe6caf70 Author: Thomas Zimmermann Date: Sun Mar 13 20:29:51 2022 +0100 fbdev: Fix sys_imageblit() for arbitrary image widths Commit 6f29e04938bf ("fbdev: Improve performance of sys_imageblit()") broke sys_imageblit() for image width that are not aligned to 8-bit boundaries. Fix this by handling the trailing pixels on each line separately. The performance improvements in the original commit do not regress by this change. Signed-off-by: Thomas Zimmermann Fixes: 6f29e04938bf ("fbdev: Improve performance of sys_imageblit()") Reviewed-by: Javier Martinez Canillas Acked-by: Daniel Vetter Tested-by: Geert Uytterhoeven Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220313192952.12058-2-tzimmermann@suse.de commit 109d101e273d81ba079306308e9512a8b1673ca9 Author: Jani Nikula Date: Fri Mar 11 12:06:39 2022 +0200 drm/i915: include uapi/drm/i915_drm.h directly where needed Remove the uapi/drm/i915_drm.h include from drm/i915_drm.h, and stop being a proxy for uapi/drm/i915_drm.h. Include uapi/drm/i915_drm.h and drm/i915_drm.h only where needed. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311100639.114685-2-jani.nikula@intel.com commit 5d5fb74630c1896aa80f01a551d0a0e82e4d5765 Author: Patrik Jakobsson Date: Thu Mar 17 10:25:55 2022 +0100 drm/gma500: Cosmetic cleanup of irq code Use the gma_ prefix instead of psb_ since the code is common for all chips. Various coding style fixes. Removal of unused code. Removal of duplicate function declarations. Signed-off-by: Patrik Jakobsson Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220317092555.17882-4-patrik.r.jakobsson@gmail.com commit 76feffd16cc9728a4d6adf2080fe7f79242822c7 Author: Patrik Jakobsson Date: Thu Mar 17 10:25:54 2022 +0100 drm/gma500: Don't store crtc_funcs in psb_ops The drm_crtc_funcs are all generic and no chip specific functions are necessary. We can therefore directly put gma_crtc_funcs into the drm_crtc. Signed-off-by: Patrik Jakobsson Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220317092555.17882-3-patrik.r.jakobsson@gmail.com commit a29c6f882418ecc7a2046d8cf9b5a8aa92b68693 Author: Patrik Jakobsson Date: Thu Mar 17 10:25:53 2022 +0100 drm/gma500: Move gma_intel_crtc_funcs into gma_display.c All functions live in gma_display.c already so move the vtable. Also shorten the name to gma_crtc_funcs. Signed-off-by: Patrik Jakobsson Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220317092555.17882-2-patrik.r.jakobsson@gmail.com commit 3138ba6e0653f62828d02e4d99e7e033e628076e Author: Patrik Jakobsson Date: Thu Mar 17 10:25:52 2022 +0100 drm/gma500: Remove unused declarations and other cruft Most of these are old leftovers from one of the driver merges. This is all dead code. Signed-off-by: Patrik Jakobsson Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220317092555.17882-1-patrik.r.jakobsson@gmail.com commit 044feb974801140d923ecae66bc1685592b19865 Author: Melissa Wen Date: Tue Feb 1 20:26:51 2022 -0100 drm/vc4: add tracepoints for CL submissions Trace submit_cl_ioctl and related IRQs for CL submission and bin/render jobs execution. It might be helpful to get a rendering timeline and track job throttling. Signed-off-by: Melissa Wen Reviewed-by: Jose Maria Casanova Crespo Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220201212651.zhltjmaokisffq3x@mail.igalia.com commit 4442ac1af10442d6e7e824fdc226f89ed94d5b53 Author: Geert Uytterhoeven Date: Thu Mar 17 09:18:29 2022 +0100 drm/ssd130x: Reduce temporary buffer sizes ssd130x_clear_screen() allocates a temporary buffer sized to hold one byte per pixel, while it only needs to hold one bit per pixel. ssd130x_fb_blit_rect() allocates a temporary buffer sized to hold one byte per pixel for the whole frame buffer, while it only needs to hold one bit per pixel for the part that is to be updated. Pass dst_pitch to drm_fb_xrgb8888_to_mono(), as we have already calculated it anyway. Fixes: a61732e808672cfa ("drm: Add driver for Solomon SSD130x OLED displays") Signed-off-by: Geert Uytterhoeven Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220317081830.1211400-5-geert@linux-m68k.org commit a97e753fd358e23155ae42c61292dfd57eb54c4a Author: Geert Uytterhoeven Date: Thu Mar 17 09:18:28 2022 +0100 drm/ssd130x: Fix rectangle updates The rectangle update functions ssd130x_fb_blit_rect() and ssd130x_update_rect() do not behave correctly when x1 != 0 or y1 != 0, or when y1 or y2 are not aligned to display page boundaries. E.g. when used as a text console, only the first line of text is shown on the display. 1. The buffer passed by ssd130x_fb_blit_rect() points to the first byte of monochrome bitmap data, and thus has its origin at (x1, y1), while ssd130x_update_rect() assumes it is at (0, 0). Fix ssd130x_update_rect() by changing the vertical and horizontal loop ranges, and adding the offsets only when needed. 2. In ssd130x_fb_blit_rect(), align y1 and y2 to the display page boundaries before doing the color conversion, so the full page is converted and updated. Remove the correction for an unaligned y1 from ssd130x_update_rect(), and add a check to make sure y1 is aligned. Fixes: a61732e808672cfa ("drm: Add driver for Solomon SSD130x OLED displays") Signed-off-by: Geert Uytterhoeven Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220317081830.1211400-4-geert@linux-m68k.org commit 7392f2459eefcdab1d998af002d2b8b16fe4a2fd Author: Geert Uytterhoeven Date: Thu Mar 17 09:18:27 2022 +0100 drm/format-helper: Fix XRGB888 to monochrome conversion The conversion functions drm_fb_xrgb8888_to_mono() and drm_fb_gray8_to_mono_line() do not behave correctly when the horizontal boundaries of the clip rectangle are not multiples of 8: a. When x1 % 8 != 0, the calculated pitch is not correct, b. When x2 % 8 != 0, the pixel data for the last byte is wrong. Simplify the code and fix (a) by: 1. Removing start_offset, and always storing the first pixel in the first bit of the monochrome destination buffer. Drivers that require the first pixel in a byte to be located at an x-coordinate that is a multiple of 8 can always align the clip rectangle before calling drm_fb_xrgb8888_to_mono(). Note that: - The ssd130x driver does not need the alignment, as the monochrome buffer is a temporary format, - The repaper driver always updates the full screen, so the clip rectangle is always aligned. 2. Passing the number of pixels to drm_fb_gray8_to_mono_line(), instead of the number of bytes, and the number of pixels in the last byte. Fix (b) by explicitly setting the target bit, instead of always setting bit 7 and shifting the value in each loop iteration. Remove the bogus pitch check, which operates on bytes instead of pixels, and triggers when e.g. flashing the cursor on a text console with a font that is 8 pixels wide. Drop the confusing comment about scanlines, as a pitch in bytes always contains a multiple of 8 pixels. While at it, use the drm_rect_height() helper instead of open-coding the same operation. Update the comments accordingly. Fixes: bcf8b616deb87941 ("drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()") Signed-off-by: Geert Uytterhoeven Acked-by: Javier Martinez Canillas Reviewed-by: Andy Shevchenko Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220317081830.1211400-3-geert@linux-m68k.org commit 9b13a3fcd35fc24045d2fd0f0e13ddd8d7985b4b Author: Geert Uytterhoeven Date: Thu Mar 17 09:18:26 2022 +0100 drm/format-helper: Rename drm_fb_xrgb8888_to_mono_reversed() There is no "reversed" handling in drm_fb_xrgb8888_to_mono_reversed(): the function just converts from color to grayscale, and reduces the number of grayscale levels from 256 to 2 (i.e. brightness 0-127 is mapped to 0, 128-255 to 1). All "reversed" handling is done in the repaper driver, where this function originated. Hence make this clear by renaming drm_fb_xrgb8888_to_mono_reversed() to drm_fb_xrgb8888_to_mono(), and documenting the black/white pixel mapping. Fixes: bcf8b616deb87941 ("drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed()") Signed-off-by: Geert Uytterhoeven Acked-by: Javier Martinez Canillas Reviewed-by: Andy Shevchenko Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220317081830.1211400-2-geert@linux-m68k.org commit aa457ff1b2be72c0d89ee2118769859e513e6fc8 Author: Jeffrey Hugo Date: Mon Mar 7 08:32:36 2022 -0700 drm/doc: Clarify what ioctls can be used on render nodes The documentation for render nodes indicates that only "PRIME-related" ioctls are valid on render nodes, but the documentation does not clarify what that means. If the reader is not familiar with PRIME, they may beleive this to be only the ioctls with "PRIME" in the name and not other ioctls such as set of syncobj ioctls. Clarify the situation for the reader by referencing where the reader will find a current list of valid ioctls. Signed-off-by: Jeffrey Hugo Acked-by: Pekka Paalanen Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1646667156-16366-1-git-send-email-quic_jhugo@quicinc.com commit 0438fd1aa69cb97dffa4c4285b1a330e46ef8832 Author: Jani Nikula Date: Wed Mar 16 11:50:18 2022 +0200 drm/i915: move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] Move i915_gem_object_needs_bit17_swizzle() to i915_gem_tiling.[ch] as a i915_gem_object function related to tiling. Also un-inline while at it; does not seem like this is a function needed in hot paths. v2: i915_gem_tiling.[ch] instead of intel_ggtt_fencing.[ch] (Chris) Cc: Tvrtko Ursulin Signed-off-by: Jani Nikula Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220316095018.137998-1-jani.nikula@intel.com commit f33b21f1397ee0f22f1d514cf6c3344c6c731a8b Author: Colin Ian King Date: Tue Mar 15 22:19:29 2022 +0000 drm/nouveau: Fix spelling mistake "endianess" -> "endianness" There is a spelling mistake in a nvdev_error error message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220315221929.2959700-1-colin.i.king@gmail.com commit 7fe7c2a679dcec878d3f5ed4ee0dc064bfb91719 Author: Matthew Auld Date: Tue Mar 15 18:14:25 2022 +0000 drm/i915: fixup the initial fb base on DGFX On integrated it looks like the GGTT base should always 1:1 maps to somewhere within DSM. On discrete the base seems to be pre-programmed with a normal lmem address, and is not 1:1 mapped with the base address. On such devices probe the lmem address directly from the PTE. v2(Ville): - The base is actually the pre-programmed GGTT address, which is then meant to 1:1 map to somewhere inside dsm. In the case of dgpu the base looks to just be some offset within lmem, but this also happens to be the exact dsm start, on dg1. Therefore we should only need to fudge the physical address, before allocating from stolen. - Bail if it's not located in dsm. v3: - Scratch that. There doesn't seem to be any relationship with the base and PTE address, on at least DG1. Let's instead just grab the lmem address from the PTE itself. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ville Syrjälä Cc: Nirmoy Das Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-7-matthew.auld@intel.com commit 51dc0e1a58798417e794d67b7193fe8f01cc2c86 Author: CQ Tang Date: Tue Mar 15 18:14:24 2022 +0000 drm/i915/display: Check mappable aperture when pinning preallocated vma When system does not have mappable aperture, ggtt->mappable_end=0. In this case if we pass PIN_MAPPABLE when pinning vma, the pinning code will return -ENOSPC. So conditionally set PIN_MAPPABLE if HAS_GMCH(). Suggested-by: Chris P Wilson Signed-off-by: CQ Tang Cc: Radhakrishna Sripada Cc: Ap Kamal Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ville Syrjälä Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-6-matthew.auld@intel.com commit ecbf20604848eccc007030766efaed2bb5533191 Author: Matthew Auld Date: Tue Mar 15 18:14:23 2022 +0000 drm/i915/ttm: wire up the object offset For the ttm backend we can use existing placements fpfn and lpfn to force the allocator to place the object at the requested offset, potentially evicting stuff if the spot is currently occupied. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-5-matthew.auld@intel.com commit 9b78b5dade2d26e2b77f1ac27044946e4e8e7247 Author: Matthew Auld Date: Tue Mar 15 18:14:22 2022 +0000 drm/i915: add i915_gem_object_create_region_at() Add a generic interface for allocating an object at some specific offset, and convert stolen over. Later we will want to hook this up to different backends. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-4-matthew.auld@intel.com commit d511d013e2869bed51191b6f70f8073e64c600a1 Author: Matthew Auld Date: Tue Mar 15 18:14:21 2022 +0000 drm/i915/stolen: consider I915_BO_ALLOC_GPU_ONLY Keep the behaviour consistent with normal lmem, where we assume CPU access if by default required. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-3-matthew.auld@intel.com commit b8ca8fef58d4656859a46a9d0e84821d3b6551b1 Author: Akeem G Abodunrin Date: Tue Mar 15 18:14:20 2022 +0000 drm/i915/stolen: don't treat small BAR as an error On client platforms with reduced LMEM BAR, we should be able to continue with driver load with reduced io_size. Instead of using the BAR size to determine the how large stolen should be, we should instead use the ADDR_RANGE register to figure this out(at least on platforms like DG2). For simplicity we don't attempt to support partially mappable stolen. v2: rearrange the io_mapping_init_wc slightly, since the stolen setup might result in reduced io_size. Signed-off-by: Akeem G Abodunrin Co-developed-by: Matthew Auld Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-2-matthew.auld@intel.com commit 56eda725c929da5d0a0141a923151d418856b364 Author: Matthew Auld Date: Tue Mar 15 18:14:19 2022 +0000 drm/i915/lmem: don't treat small BAR as an error Just pass along the probed io_size. The backend should be able to utilize the entire range here, even if some of it is non-mappable. It does leave open with what to do with stolen local-memory. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-1-matthew.auld@intel.com commit 07739597b4d0eae539c9020ea321f636afd878ee Author: Thomas Zimmermann Date: Tue Mar 8 20:52:22 2022 +0100 drm/gma500: Move GTT memory-range setup into helper Move the setup code for GTT/GATT memory ranges into a new helper and call the function from psb_gtt_init() and psb_gtt_resume(). Removes code duplication. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-13-tzimmermann@suse.de commit 5169f3592d48be8fd84b2a9e23c07a1c2977d19c Author: Thomas Zimmermann Date: Tue Mar 8 20:52:21 2022 +0100 drm/gma500: Move GTT enable and disable code into helpers Move the code for enabling and disabling the GTT into helpers and call the functions in psb_gtt_init(), psb_gtt_fini() and psb_gtt_resume(). Removes code duplication. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-12-tzimmermann@suse.de commit d339386c9ffa69d20fcc34f3636dea80ea71818c Author: Thomas Zimmermann Date: Tue Mar 8 20:52:20 2022 +0100 drm/gma500: Move GEM memory management functions to gem.c Move GEM functions from gtt.c to gem.c. Adapt some names. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-11-tzimmermann@suse.de commit 42ceddb696a01e6e31e90c456b882392f1572d69 Author: Thomas Zimmermann Date: Tue Mar 8 20:52:19 2022 +0100 drm/gma500: Inline psb_gtt_restore() Inline psb_gtt_restore() into its only caller in power.c. Perform the GTT restoration in psb_gem_mm_resume(). The restoration step is part of GEM anyway and will be moved over at some point. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-10-tzimmermann@suse.de commit d00f44ddfbb18d73fab98492e5fcb43281564f4f Author: Thomas Zimmermann Date: Tue Mar 8 20:52:18 2022 +0100 drm/gma500: Split GTT init/resume/fini into GTT and GEM functions The GTT init, fini and resume functions contain both, GTT and GEM, code. Split each into a separate GTT and a GEM function. The GEM code is responsible for mmap_mutex and the stolen memory area. The rest of the functionality is left in GTT functions. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-9-tzimmermann@suse.de commit 6069fd815d287e786a5ac1b0f875fa92aac798ff Author: Thomas Zimmermann Date: Tue Mar 8 20:52:17 2022 +0100 drm/gma500: Cleanup GTT uninit and error handling Replace psb_gtt_takedown() with finalizer function that is only called for unloading the driver. Use roll-back pattern for error handling in psb_gtt_init() and _resume(). Also fixes a bug where vmap_addr was never unmapped. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-8-tzimmermann@suse.de commit 97bd66c46d8bfbc02406d848ebb53c6a2992e03f Author: Thomas Zimmermann Date: Tue Mar 8 20:52:16 2022 +0100 drm/gma500: Move GTT resume logic out of psb_gtt_init() The current implementation of psb_gtt_init() also does resume handling. Move the resume code into its own helper. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-7-tzimmermann@suse.de commit 60a78f9ea0e6940cf14422eadfd537292e4562cf Author: Thomas Zimmermann Date: Tue Mar 8 20:52:15 2022 +0100 drm/gma500: Move GTT setup and restoration into helper funtions The GTT init and restore functions contain logic to populate the GTT entries. Move the code into helper functions. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-6-tzimmermann@suse.de commit e160b70ba1604b0c88f97f7f8756d126515ed039 Author: Thomas Zimmermann Date: Tue Mar 8 20:52:14 2022 +0100 drm/gma500: Remove struct psb_gtt.sem sempahore The semaphore at struct psb_mmu_driver.sem protects access to the MMU fields. Additional locking with struct psb_gtt.sem is unnecessary. Remove the field and related code. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-5-tzimmermann@suse.de commit 14e92dd104cde77db5612b111baf2f41f1eba127 Author: Thomas Zimmermann Date: Tue Mar 8 20:52:13 2022 +0100 drm/gma500: Move GTT locking into GTT helpers Acquire the GTT mutex in psb_gtt_{insert,remove}_pages(). Remove locking from callers. Also remove the GTT locking around the resume code. Resume does not run concurrently with other GTT operations. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-4-tzimmermann@suse.de commit 16dad99de8f2abfcec9836e2031613a713e339d2 Author: Thomas Zimmermann Date: Tue Mar 8 20:52:12 2022 +0100 drm/gma500: Acquire reservation lock for GEM objects Protect concurrent access to struct psb_gem_object by acquiring the GEM object's reservation lock; as it's supposed to be. The use of the GTT mutex can now be moved into GTT code. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-3-tzimmermann@suse.de commit de2d1822f9489268e0707b2d188dd789d5effd08 Author: Thomas Zimmermann Date: Tue Mar 8 20:52:11 2022 +0100 drm/gma500: Remove struct psb_gem_object.npage Calculate the number of pages in the BO's backing storage from the size. Remove the npage field. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-2-tzimmermann@suse.de commit e5086cb3f3d3f94091be29eec38cf13f8a75a778 Author: Ville Syrjälä Date: Fri Mar 11 23:28:45 2022 +0200 drm/i915: Reject unsupported TMDS rates on ICL+ ICL+ PLLs can't genenerate certain frequencies. Running the PLL algorithms through for all frequencies 25-594MHz we see a gap just above 500 MHz. Specifically 500-522.8MHZ for TC PLLs, and 500-533.2 MHz for combo PHY PLLs. Reject those frequencies hdmi_port_clock_valid() so that we properly filter out unsupported modes and/or color depths for HDMI. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5247 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311212845.32358-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 47042e0ddd218f100292cebc5208cb1eff7473b6 Author: YueHaibing Date: Sat Mar 12 14:34:37 2022 +0800 drm/solomon: Make DRM_SSD130X depends on MMU WARNING: unmet direct dependencies detected for DRM_GEM_SHMEM_HELPER Depends on [n]: HAS_IOMEM [=y] && DRM [=m] && MMU [=n] Selected by [m]: - DRM_SSD130X [=m] && HAS_IOMEM [=y] && DRM [=m] DRM_GEM_SHMEM_HELPER depends on MMU, DRM_SSD130X should also depends on MMU. Fixes: a61732e80867 ("drm: Add driver for Solomon SSD130x OLED displays") Signed-off-by: YueHaibing Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220312063437.19160-1-yuehaibing@huawei.com commit 579899c7da714fac736b13fdb202e0a2cb9d3d27 Author: Ville Syrjälä Date: Tue Mar 15 15:27:51 2022 +0200 drm/i915: Deal with bigjoiner vs. DRRS DRRS operates on transcoder level, so we should only poke at it from the master crtc rather than letting every joined pipe give it potentially conflicting input. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-9-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 1b333c679a0fdfd899269b7e10a002aad334a15e Author: Ville Syrjälä Date: Tue Mar 15 23:39:44 2022 +0200 drm/i915: Do DRRS disable/enable during pre/post_plane_update() Let's just do a full DRRS disable/enable across all pipe updates. This guarantees that the DRRS work doesn't interfere with anything while the atomic commit is busy reprogramming the pipe. Needed so that we can start reprogramming M/N seamlessly during fastsets whenever possible. Also avoids the pre-bdw DRRS PIPECONF rmw racing with the potential PIPECONF write from the atomic commit (eg. due to GAMMA_MODE changes). v2: Include has_drrs in state dump (José) Reviewed-by: José Roberto de Souza Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315213944.17132-1-ville.syrjala@linux.intel.com commit 1c00404769dcd4b51c691aeba9eb98d72632720e Author: Ville Syrjälä Date: Tue Mar 15 15:27:49 2022 +0200 drm/i915: Schedule DRRS work from intel_drrs_enable() Schedule the DRRS downclock work already from intel_drrs_enable() instead of waiting around for a frontbuffer flush that may or may not ever come. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-7-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit fb4ae6e6500a7ca70b41a765eb4189740b7725f0 Author: Ville Syrjälä Date: Tue Mar 15 15:27:48 2022 +0200 drm/i915: Don't cancel/schedule drrs work if the pipe wasn't affected Skip all the DRRS work cancel/schedule stuff if the pipe's frontbuffer bits were not among those affected by the frontbuffer rendering. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-6-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 70e10a2b7e989d1e1069f701c4159c20f52a1dac Author: Ville Syrjälä Date: Tue Mar 15 15:27:47 2022 +0200 drm/i915: Determine DRRS frontbuffer_bits ahead of time Pre-determine the frontbuffer_bits for the each pipe during intel_drrs_enable(). Will become useful for bigjoiner use cases soon. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-5-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 18f23b92187ff75f8381aecd8b89c8feeddcab09 Author: Ville Syrjälä Date: Tue Mar 15 15:27:46 2022 +0200 drm/i915: Fix DRRS frontbuffer_bits handling Now that DRRS can operate on multiple pipes we need to make sure one pipe doesn't throw away the other pipe's frontbuffer_bits before said pipe can handle them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-4-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit ead8fb9c78483bec601c5a8ac885dcb1f8ecf783 Author: Ville Syrjälä Date: Tue Mar 15 15:27:45 2022 +0200 drm/i915: Add missing tab to DRRS debugfs The DRRS refresh rate should be indented by one tab like the other per-crtc DRRS stuff. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-3-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 2260e4d8f51c014575eef595873351c83bc9ce4d Author: Ville Syrjälä Date: Tue Mar 15 15:27:44 2022 +0200 drm/i915: Put the downclock_mode check back into can_enable_drrs() With static DRRS the user might ask for the lowest possible refresh rate of the panel, in which case we're not going to find a suitable downclock mode for it and we should not try to enable seamless DRRS. This will in fact oops. We used to check for the presence of the downclock mode here, but that got removed in commit f0a57798fb5c ("drm/i915: Introduce intel_panel_drrs_type()") as redundant (which it was at the time). But we do need the check again now that static DRRS is a thing. I must have not re-tested static DRRS fully after introducing intel_panel_drrs_type() :/ Fixes: c5ee23437cae ("drm/i915: Implement static DRRS") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 1c7cea157912ec8229b116c9274a18653689e193 Author: Ville Syrjälä Date: Fri Feb 18 12:04:00 2022 +0200 drm/i915: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-20-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a4f24ada636dc0262621213988f0d15beb5596bb Author: Dmitry Baryshkov Date: Wed Mar 16 10:46:48 2022 +0300 drm/blend: fix typo in the comment The documentation for drm_rotation_simplify() uses DRM_MODE_ROTATE_X, while it's clear the comment should mention DRM_MODE_REFLECT_X instead. The example passes all flags except the DRM_MODE_REFLECT_X as supported and expects to eliminate this flag. Fixes: c2c446ad2943 ("drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI") Signed-off-by: Dmitry Baryshkov Reviewed-by: Simon Ser Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220316074648.7009-1-dmitry.baryshkov@linaro.org commit 31a86f0019b12f22546ca434f375194415834278 Author: Matt Roper Date: Mon Mar 14 16:42:03 2022 -0700 drm/i915: Add support for steered register writes Upcoming patches will need to steer writes to multicast registers as well as reading them. Although the setting of the 'multicast' bit should only really matter for write operations (reads always operate in a unicast manner and give us the result from one specific instance), Wa_22013088509 suggests that we leave the multicast bit enabled when performing read operations, so we follow suit here. Cc: Harish Chegondi Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220314234203.799268-4-matthew.d.roper@intel.com commit 10343606ad287d2b8d8ebce0a5cebe5e877f341c Author: Daniele Ceraolo Spurio Date: Mon Mar 14 16:42:02 2022 -0700 drm/i915/guc: add steering info to GuC register save/restore list GuC has its own steering mechanism and can't use the default set by i915, so we need to provide the steering information that the FW will need to save/restore registers while processing an engine reset. The GUC interface allows us to do so as part of the register save/restore list and it requires us to specify the steering for all multicast register, even those that would be covered by the default setting for cpu access. Given that we do not distinguish between registers that do not need steering and registers that are guaranteed to work the default steering, we set the steering for all entries in the guc list that do not require a special steering (e.g. mslice) to the default settings; this will cost us a few extra writes during engine reset but allows us to keep the steering logic simple. Cc: John Harrison Cc: Matt Roper Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220314234203.799268-3-matthew.d.roper@intel.com commit b7563ec7d906ef87dcd15f39c66e0f35f58c2003 Author: Matt Roper Date: Tue Mar 15 10:02:50 2022 -0700 drm/i915: Report steering details in debugfs Add a new 'steering' node in each gt's debugfs directory that tells whether we're using explicit steering for various types of MCR ranges and, if so, what MMIO ranges it applies to. We're going to be transitioning away from implicit steering, even for slice/dss steering soon, so the information reported here will become increasingly valuable once that happens. v2: - Adding missing 'static' on intel_steering_types[] (Jose, sparse) v3: - "static const char *" -> "static const char * const" (sparse) Cc: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220315170250.954380-1-matthew.d.roper@intel.com commit 4dc3a1e52fece14c8bf05d5b46c9834d31c8dbf4 Author: John Harrison Date: Mon Mar 14 19:08:05 2022 -0700 drm/i915: Reduce stack usage in debugfs due to SSEU sseu_dev_info is already a pretty large structure which will likely continue to grow when future platforms increase potential DSS and EU counts. Let's switch the stack placement of this structure in debugfs with a dynamic allocation. Signed-off-by: John Harrison Signed-off-by: Matt Roper Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220315020805.844962-1-matthew.d.roper@intel.com commit 15f26bdc81f7f03561aaea5a10d87bd6638e1459 Author: José Roberto de Souza Date: Fri Mar 11 10:51:49 2022 -0800 drm/i915/display: Do not re-enable PSR after it was marked as not reliable If a error happens and sink_not_reliable is set, PSR should be disabled for good but that is not happening. It would be disabled by the function handling the PSR error but then on the next fastset it would be enabled again in _intel_psr_post_plane_update(). It would only be disabled for good in the next modeset where has_psr will be set false. v2: - release psr lock before continue Fixes: 9ce5884e5139 ("drm/i915/display: Only keep PSR enabled if there is active planes") Reported-by: Khaled Almahallawy Reported-by: Charlton Lin Cc: Jouni Högander Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-2-jose.souza@intel.com commit 8f0c1c0949b609acfad62b8d5f742a3b5e7b05ab Author: José Roberto de Souza Date: Fri Mar 11 10:51:48 2022 -0800 drm/i915/display: Fix HPD short pulse handling for eDP Commit 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") completely broke short pulse handling for eDP as it is usually generated by sink when it is displaying image and there is some error or status that source needs to handle. When power panel is enabled, this state is enough to power aux transactions and VDD override is disabled, so intel_pps_have_power() is always returning false causing short pulses to be ignored. So here better naming this function that intends to check if aux lines are powered to avoid the endless cycle mentioned in the commit being fixed and fixing the check for what it is intended. v2: - renamed to intel_pps_have_panel_power_or_vdd() - fixed indentation Fixes: 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") Cc: Anshuman Gupta Cc: Jani Nikula Cc: Uma Shankar Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-1-jose.souza@intel.com commit 345b7c4b86884cf413735be3edc8e28d0d494916 Author: Ville Syrjälä Date: Mon Mar 14 17:27:37 2022 +0200 drm/i915: Convert fixed_mode/downclock_mode into a list Store the fixed_mode and downclock_mode as a real list, in preparation for exposing other supported modes as well. v2: Init the list in intel_sdvo_connector_alloc() too v3: Use list_first_entry_or_null() (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220314152737.9125-1-ville.syrjala@linux.intel.com commit c5ee23437cae2cffadc1a96ebd444ae2504e0408 Author: Ville Syrjälä Date: Fri Mar 11 19:24:27 2022 +0200 drm/i915: Implement static DRRS Let's start supporting static DRRS by trying to match the refresh rate the user has requested, assuming the panel supports suitable timings. For now we stick to just our current two timings: - fixed_mode: the panel's preferred mode - downclock_mode: the lowest refresh rate mode we found Some panels may support more timings than that, but we'll have to convert our fixed_mode/downclock_mode pointers into a full list before we can handle that. v2: Rebase due to intel_panel_get_modes() Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-16-ville.syrjala@linux.intel.com commit c2f12155536a28ee99fbf9960c1d83ceff81d9ae Author: Ville Syrjälä Date: Fri Mar 11 19:24:26 2022 +0200 drm/i915: Enable eDP DRRS on ilk/snb port A Nothing special about ivb+ here, if DRRS works on ivb+ port A it should work just as well on ilk/snb. So let's enable that. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-15-ville.syrjala@linux.intel.com commit e8ae25df50803b93fa9530ed7048bc67531eb7da Author: Ville Syrjälä Date: Fri Mar 11 19:24:25 2022 +0200 drm/i915: Move DRRS enable/disable higher up No reason to keep the DRRS enable/disable hidden insider the encoder hooks. Let's just move them all the way up into platform independent code so that all platforms get to use them. These are nops when the state computation doesn't think DRRS is possible. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-14-ville.syrjala@linux.intel.com commit 851f15fe4c1a2541ac80fa5158c786bf83a2b8e8 Author: Ville Syrjälä Date: Fri Mar 11 19:24:24 2022 +0200 drm/i915: Stash DRRS state under intel_crtc Ger rid of one more ugly crtc->config usage by storing the DRRS state under intel_crtc. intel_drrs_enable() copies what it needs from the crtc state, after which DRRS can be blissfully ignorant of anything going on around it. This also lets multiple pipes do DRRS simultanously and entirely independently. v2: Split out some stuff (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-13-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ba770ce36b60c5ca40976579c16f75ac0cf9fb84 Author: Ville Syrjälä Date: Fri Mar 11 19:24:23 2022 +0200 drm/i915: Eliminate the intel_dp dependency from DRRS The DRRS code has no use for the intel_dp, replace it with just a crtc pointer. This is just an intermediate step towards making DRRS truly per-crtc. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-12-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a1b952d4d0a4c2df46f8982d89377e752576c7fa Author: Ville Syrjälä Date: Fri Mar 11 19:24:22 2022 +0200 drm/i915: Introduce intel_drrs_type_str() Add helper to get the drrs type as a string, and use it in a couple of places. Also pimp the debugfs output a bit while at it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f0a57798fb5c68e7537e75a4acd81f697fd6c089 Author: Ville Syrjälä Date: Fri Mar 11 19:24:21 2022 +0200 drm/i915: Introduce intel_panel_drrs_type() Add a helper to determine which type of DRRS the panel supports. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 43af674357114db77cfa19be06aa48d8159610f7 Author: Ville Syrjälä Date: Fri Mar 11 19:24:20 2022 +0200 drm/i915: Introduce intel_panel_preferred_fixed_mode() There are a couple of cases where we essentially just want to get/check the preferred fixed mode of the panel. Add a small helper for that to abstract away the direct pointer lookup. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 53f64f3a24c115bac05a7a343282623005a16c90 Author: Ville Syrjälä Date: Fri Mar 11 19:24:19 2022 +0200 drm/i915: Introduce intel_panel_get_modes() Several connectors want to return the fixed_mode from .get_modes(), add a helper to do that (and hide the details inside intel_panel.c). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 092706786e1143fa947f7387600d275113a4043c Author: Ville Syrjälä Date: Fri Mar 11 19:24:18 2022 +0200 drm/i915: Introduce intel_panel_{fixed,downclock}_mode() Abstract away the details on where we store the fixed/downclock modes, and also how we select them. Will be useful for static DRRS (aka. allowing the user to select the refresh rate for the panel). We pass in the user requested mode to intel_panel_fixed_mode() so that in the future it may try to match the refresh rate. And intel_panel_downclock_mode() gets passed the adjusted_mode we actually chose to use so that it may find a suitable lower resresh rate variant. v2: Hook it up for all encoders s/fixed_mode/adjusted_mode/ in intel_panel_downclock_mode() (Jani) Elaborate on the choice or arguments for the functions (Jani) Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit c25300f0797be30dd63d74fcc38b5238a2844932 Author: Ville Syrjälä Date: Fri Mar 11 19:24:17 2022 +0200 drm/i915: Nuke dev_priv->drrs.type When we found a downclock mode dev_priv->drrs.type is just a straight copy of dev_priv->vbt.drrs_type. And in case we couldn't find a downclock mode can_enable_drrs() won't let us enable DRRS anyway so the minor distinction between the two is irrelevant. So let's just nuke dev_priv->drrs.type and consult the VBT version directly. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0032cfd670203a12b96985601ccf0ca1b818ef58 Author: Ville Syrjälä Date: Fri Mar 11 19:24:16 2022 +0200 drm/i915: Simplify intel_panel_info() No need for all this connector type special casing. If the connector has a fixed mode just print it, otherwise don't. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 457e992b35089ec6ffb4a95cd2a4a5ce001ad219 Author: Ville Syrjälä Date: Fri Mar 11 19:24:15 2022 +0200 drm/i915/lvds: Pass fixed_mode to compute_is_dual_link_lvds() We want to eventually get rid of the connector->panel.fixed_mode pointer so avoid using it during LVDS setup. Since this all happens during the encoder init we already have the fixed_mode around, just pass that in. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 54b6af690925f79eb1cbb6f3b7e39b52fc5391eb Author: Ville Syrjälä Date: Fri Mar 11 19:24:14 2022 +0200 drm/i915/sdvo: Pass the requesed mode to intel_sdvo_create_preferred_input_timing() We want to stop using connector->panel.fixed_mode directtly. In order to look it up in the future we'll need to have the requested mode around, so pass that in fully (instead of just passing bits of it). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit dee5488737dcfde8db61a44dd2b410d9fc4cbc8d Author: Ville Syrjälä Date: Fri Mar 11 19:24:13 2022 +0200 drm/i915/dsi: Pass fixed_mode to *_dsi_add_properties() We want to eventually get rid of the connector->panel.fixed_mode pointer so avoid using it during DSI property setup. Since this all happens during the encoder init we already have the fixed_mode around, just pass that in. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 776c6c8343b94f3760eb7eff69f107e6f5eaca74 Author: José Roberto de Souza Date: Mon Mar 14 08:27:53 2022 -0700 drm/i915/display/adlp: Update eDP voltage swing table Up to now alderlake-p was using the same eDP voltage swing table for frequencies up to HBR2 as icelake but now it has its own table. BSpec: 49291 Cc: Clinton A Taylor Signed-off-by: José Roberto de Souza Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220314152753.85081-1-jose.souza@intel.com commit cc1338f259a21afd09aaaa011b87f3b83388d545 Author: Matt Roper Date: Fri Mar 11 14:54:59 2022 -0800 drm/i915/xehp: Update topology dumps for Xe_HP When running on Xe_HP or beyond, let's use an updated format for describing topology in our error state dumps and debugfs to give a more accurate view of the hardware: - Just report DSS directly without the legacy "slice0" output that's no longer meaningful. - Indicate whether each DSS is accessible for geometry and/or compute. - Rename "rcs_topology" to "sseu_topology" since the information reported is common to both RCS and CCS engines now. v2: - Name static functions in a more consistent manner. (Lucas) Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220311225459.385515-2-matthew.d.roper@intel.com commit 144ce0ac634a38a123f970a62210da70b4ce662a Author: Matt Roper Date: Fri Mar 11 14:54:58 2022 -0800 drm/i915/sseu: Don't overallocate subslice storage Xe_HP removed "slice" as a first-class unit in the hardware design. Instead we now have a single pool of subslices (which are now referred to as "DSS") that different hardware units have different ways of grouping ("compute slices," "geometry slices," etc.). For the purposes of topology representation, we treat Xe_HP-based platforms as having a single slice that contains all of the platform's DSS. There's no need to allocate storage space for (max legacy slices * max dss); let's update some of our macros to minimize the storage requirement for sseu topology. We'll also document some of the constants to make it a little bit more clear what they represent. v2: - s/LEGACY/HSW/ in macro names. (Lucas) - Rename MAX() to SSEU_MAX() to avoid any potential clashes with other definitions elsewhere. Unfortunately max()/max_t() from linux/minmax.h cannot be used in this context. (Lucas) Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220311225459.385515-1-matthew.d.roper@intel.com commit 5f1b97cb9af6c5471825b16306ad7da419cda563 Author: Jani Nikula Date: Fri Mar 11 12:06:38 2022 +0200 x86/gpu: include drm/i915_pciids.h directly in early quirks early-quirks.c is the only user of drm/i915_drm.h that also needs drm/i915_pciids.h. Include the masses of PCI ID macros only where needed. Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Jani Nikula Acked-by: Bjorn Helgaas Link: https://patchwork.freedesktop.org/patch/msgid/20220311100639.114685-1-jani.nikula@intel.com commit ec5d4a723b57721ca0f3c1c86576412e32a50579 Author: Ville Syrjälä Date: Fri Feb 18 12:04:01 2022 +0200 drm/panel: Use drm_mode_duplicate() Replace the hand rolled drm_mode_duplicate() with the real thing. @is_dup@ @@ drm_mode_duplicate(...) { ... } @depends on !is_dup@ expression dev, oldmode; identifier newmode; @@ - newmode = drm_mode_create(dev); + newmode = drm_mode_duplicate(dev, oldmode); ... - drm_mode_copy(newmode, oldmode); Signed-off-by: Ville Syrjälä Cc: Thierry Reding Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-21-ville.syrjala@linux.intel.com Acked-by: Sam Ravnborg commit 193c4df5b0dcbb7ea0efb99ca13bd05cd1adaddb Author: Ville Syrjälä Date: Fri Feb 18 12:03:50 2022 +0200 drm/imx: Use drm_mode_duplicate() Replace the hand rolled drm_mode_duplicate() with the real thing. @is_dup@ @@ drm_mode_duplicate(...) { ... } @depends on !is_dup@ expression dev, oldmode; identifier newmode; @@ - newmode = drm_mode_create(dev); + newmode = drm_mode_duplicate(dev, oldmode); ... - drm_mode_copy(newmode, oldmode); Cc: Philipp Zabel Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-10-ville.syrjala@linux.intel.com Reviewed-by: Philipp Zabel commit d008bc331fb135ea1a5cddc3c4e283ba74596ad2 Author: Ville Syrjälä Date: Fri Feb 18 12:03:47 2022 +0200 drm/bridge: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-7-ville.syrjala@linux.intel.com Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart commit 2d3eec8970335148278a6e350bc4840374f06471 Author: Ville Syrjälä Date: Fri Feb 18 12:03:42 2022 +0200 drm: Add drm_mode_init() Add a variant of drm_mode_copy() that explicitly clears out the list head of the destination mode. Helpful to guarantee we don't have stack garbage left in there for on-stack modes. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-2-ville.syrjala@linux.intel.com Reviewed-by: Andrzej Hajda Reviewed-by: Harry Wentland commit b861de246912e10c5bda32cb100bff429a5e1ec4 Author: Zack Rusin Date: Wed Mar 2 10:24:26 2022 -0500 drm/vmwgfx: Stop using surface dma commands on most configurations Initial version of guest backed objects in the host had some performance issues that made using surface-dma's instead of direct copies faster. Surface dma's force a migration to vram which at best is slow and at worst is impossible (e.g. on svga3 where there's not enough vram to migrate fb's to it). Slowly migrate away from surface dma's to direct copies by limiting their usage to systems with more than 32MB of vram. Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-9-zack@kde.org commit 32160e6a98f33cd96fde52cd56b9b758b59d3603 Author: Zack Rusin Date: Mon Mar 7 11:24:12 2022 -0500 drm/vmwgfx: Implement MSI/MSI-X support for IRQs SVGAv3 deprecates legacy interrupts and adds support for MSI/MSI-X. With MSI the driver visible side remains largely unchanged but with MSI-X each interrupt gets delivered on its own vector. Add support for MSI/MSI-X while preserving the old functionality for SVGAv2. Code between the SVGAv2 and SVGAv3 is exactly the same, only the number of available vectors changes, in particular between legacy and MSI-X interrupts. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220307162412.1183049-1-zack@kde.org commit 5405d25b9e8e6e0d3bdb04833d528a9bb35fe7ce Author: Zack Rusin Date: Wed Mar 2 10:24:24 2022 -0500 drm/vmwgfx: Initialize drm_mode_fb_cmd2 Transition to drm_mode_fb_cmd2 from drm_mode_fb_cmd left the structure unitialized. drm_mode_fb_cmd2 adds a few additional members, e.g. flags and modifiers which were never initialized. Garbage in those members can cause random failures during the bringup of the fbcon. Initializing the structure fixes random blank screens after bootup due to flags/modifiers mismatches during the fbcon bring up. Fixes: dabdcdc9822a ("drm/vmwgfx: Switch to mode_cmd2") Signed-off-by: Zack Rusin Cc: Daniel Vetter Cc: # v4.10+ Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-7-zack@kde.org commit 23b0e695d4ca92e9ebd97689e2e51e497957cb48 Author: Zack Rusin Date: Wed Mar 2 10:24:23 2022 -0500 drm/vmwgfx: Allow querying of the SVGA PCI id from the userspace Mesa3D loaders require knowledge of the devices PCI id. SVGAv2 and v3 have different PCI id's, but the same driver is used to handle them both. To allow Mesa3D svga driver to be loaded automatically for both SVGAv2 and SVGAv3 make the kernel return the PCI id of the currently running device. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-6-zack@kde.org commit c593197b6ece417675256e220b5eac25c0b33290 Author: Zack Rusin Date: Wed Mar 2 10:24:22 2022 -0500 drm/vmwgfx: Fix fencing on SVGAv3 Port of the vmwgfx to SVGAv3 lacked support for fencing. SVGAv3 removed FIFO's and replaced them with command buffers and extra registers. The initial version of SVGAv3 lacked support for most advanced features (e.g. 3D) which made fences unnecessary. That is no longer the case, especially as 3D support is being turned on. Switch from FIFO commands and capabilities to command buffers and extra registers to enable fences on SVGAv3. Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-5-zack@kde.org commit af326e28380ab858cf7e0c67ba04c4f38a7a41ea Author: Zack Rusin Date: Wed Mar 2 10:24:21 2022 -0500 drm/vmwgfx: Print capabilities early during the initialization Capabilities were logged at the end of initialization so any early errors would make them not appear in the logs. Which is also when they're needed the most. Print the the capabilities right after fetching them, before the init code starts using them to make sure they always show up in the logs. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-4-zack@kde.org commit bb30d8d8c1b0002712f112c519c9caf4fdf8c9d1 Author: Zack Rusin Date: Wed Mar 2 10:24:20 2022 -0500 drm/vmwgfx: Cleanup multimon initialization code The results of the legacy display unit initialization were being silently ignored. Unifying the selection of number of display units based on whether the underlying device supports multimon makes it easier to add error checking to all paths. This makes the driver report the errors in ldu initialization paths and try to recover from them. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-3-zack@kde.org commit 485d98d472d53f9617ffdfba5e677ac29ad4fe20 Author: Martin Krastev Date: Wed Mar 2 10:24:19 2022 -0500 drm/vmwgfx: Add support for CursorMob and CursorBypass 4 * Add support for CursorMob * Add support for CursorBypass 4 * Refactor vmw_du_cursor_plane_atomic_update to be kms-helper-atomic -- move BO mappings to vmw_du_cursor_plane_prepare_fb -- move BO unmappings to vmw_du_cursor_plane_cleanup_fb Cursor mobs are a new svga feature which enables support for large cursors, e.g. large accessibility cursor on platforms with vmwgfx. It also cleans up the cursor code and makes it more uniform with the rest of modern guest backed objects support. Signed-off-by: Martin Krastev Reviewed-by: Zack Rusin Reviewed-by: Maaz Mombasawala Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-2-zack@kde.org commit 239bbb2fe927ed762bfe6307ba6a2e2d94e739da Author: Matt Roper Date: Thu Mar 10 22:28:35 2022 -0800 drm/i915/gt: Remove GEN12_SFC_DONE_MAX from register defs header We shouldn't really be keeping track of how many SFC_DONE registers our platforms can have, but rather how many SFC hardware units there can be (each SFC unit will have one corresponding SFC_DONE register). So drop the stray GEN12_SFC_DONE_MAX definition we had in the register definition file and replace it with an I915_MAX_SFC that follows the pattern we use for other hardware units. Note that our hardware has a 2:1:1 ratio of VD:VE:SFC, and as far as we know that pattern should carry forward to future platforms, so we'll define it as #VCS/2. Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220311062835.163744-1-matthew.d.roper@intel.com commit 661412e301e2ca86799aa4f400d1cf0bd38c57c6 Author: Mastan Katragadda Date: Thu Mar 3 11:34:28 2022 +0530 drm/i915/gem: add missing boundary check in vm_access A missing bounds check in vm_access() can lead to an out-of-bounds read or write in the adjacent memory area, since the len attribute is not validated before the memcpy later in the function, potentially hitting: [ 183.637831] BUG: unable to handle page fault for address: ffffc90000c86000 [ 183.637934] #PF: supervisor read access in kernel mode [ 183.637997] #PF: error_code(0x0000) - not-present page [ 183.638059] PGD 100000067 P4D 100000067 PUD 100258067 PMD 106341067 PTE 0 [ 183.638144] Oops: 0000 [#2] PREEMPT SMP NOPTI [ 183.638201] CPU: 3 PID: 1790 Comm: poc Tainted: G D 5.17.0-rc6-ci-drm-11296+ #1 [ 183.638298] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake H DDR4 RVP, BIOS CNLSFWR1.R00.X208.B00.1905301319 05/30/2019 [ 183.638430] RIP: 0010:memcpy_erms+0x6/0x10 [ 183.640213] RSP: 0018:ffffc90001763d48 EFLAGS: 00010246 [ 183.641117] RAX: ffff888109c14000 RBX: ffff888111bece40 RCX: 0000000000000ffc [ 183.642029] RDX: 0000000000001000 RSI: ffffc90000c86000 RDI: ffff888109c14004 [ 183.642946] RBP: 0000000000000ffc R08: 800000000000016b R09: 0000000000000000 [ 183.643848] R10: ffffc90000c85000 R11: 0000000000000048 R12: 0000000000001000 [ 183.644742] R13: ffff888111bed190 R14: ffff888109c14000 R15: 0000000000001000 [ 183.645653] FS: 00007fe5ef807540(0000) GS:ffff88845b380000(0000) knlGS:0000000000000000 [ 183.646570] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 183.647481] CR2: ffffc90000c86000 CR3: 000000010ff02006 CR4: 00000000003706e0 [ 183.648384] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 183.649271] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 183.650142] Call Trace: [ 183.650988] [ 183.651793] vm_access+0x1f0/0x2a0 [i915] [ 183.652726] __access_remote_vm+0x224/0x380 [ 183.653561] mem_rw.isra.0+0xf9/0x190 [ 183.654402] vfs_read+0x9d/0x1b0 [ 183.655238] ksys_read+0x63/0xe0 [ 183.656065] do_syscall_64+0x38/0xc0 [ 183.656882] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 183.657663] RIP: 0033:0x7fe5ef725142 [ 183.659351] RSP: 002b:00007ffe1e81c7e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 183.660227] RAX: ffffffffffffffda RBX: 0000557055dfb780 RCX: 00007fe5ef725142 [ 183.661104] RDX: 0000000000001000 RSI: 00007ffe1e81d880 RDI: 0000000000000005 [ 183.661972] RBP: 00007ffe1e81e890 R08: 0000000000000030 R09: 0000000000000046 [ 183.662832] R10: 0000557055dfc2e0 R11: 0000000000000246 R12: 0000557055dfb1c0 [ 183.663691] R13: 00007ffe1e81e980 R14: 0000000000000000 R15: 0000000000000000 Changes since v1: - Updated if condition with range_overflows_t [Chris Wilson] Fixes: 9f909e215fea ("drm/i915: Implement vm_ops->access for gdb access into mmaps") Signed-off-by: Mastan Katragadda Suggested-by: Adam Zabrocki Reported-by: Jackson Cody Cc: Chris Wilson Cc: Jon Bloomfield Cc: Sudeep Dutt Cc: # v5.8+ Reviewed-by: Matthew Auld [mauld: tidy up the commit message and add Cc: stable] Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220303060428.1668844-1-mastanx.katragadda@intel.com commit dd7ae6b3e857f230a804ce8706700891e526cc64 Author: Ville Syrjälä Date: Thu Mar 10 02:47:57 2022 +0200 drm/i915: Rename PIPECONF refresh select bits Rename the PIPECONF refresh rate select bits to be less cryptic. Also nothing eDP specific about these as they also select between FP0 vs. FP1 for the DPLL and thus can be used to change the refresh rate on other output types as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5a220c536b50b90c4577247ce451a6957fbd1aff Author: Ville Syrjälä Date: Thu Mar 10 02:47:56 2022 +0200 drm/i915: Clean up DRRS refresh rate enum Make the DRRS refresh rate enum less magical. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8e9c9848d846167a6f5bff4a0535a898bc465fe1 Author: Ville Syrjälä Date: Thu Mar 10 02:47:55 2022 +0200 drm/i915: Polish drrs type enum Make the drrs type enum less convoluted. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 1fa7bb121401325f91e92a966e84af3075b783ed Author: Ville Syrjälä Date: Thu Mar 10 02:47:54 2022 +0200 drm/i915: Program MSA timing delay on ilk/snb/ivb Grab the DRRS MSA timing delay value from the VBT and program things accordingly. Only ilk/snb/ivb have this so presumably on hsw+ we don't need it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit b395c29add3c8b8966789c4642bac164943fc044 Author: Ville Syrjälä Date: Thu Mar 10 02:47:53 2022 +0200 drm/i915: Read DRRS MSA timing delay from VBT VBT hsa a field for the MSA timing delay, which supposedly should be used with DRRS. Extract the data from the VBT. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 5f6a9bea163711dd544d6ba93e18bbb847eb8e12 Author: Ville Syrjälä Date: Thu Mar 10 02:47:52 2022 +0200 drm/i915: Pimp DRRS debugs Use the standard [CONNECTOR:%d:%s] format in the DRRS debugs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit faf6e8fc73aab9db01964753adf112f1d1ac6524 Author: Ville Syrjälä Date: Thu Mar 10 02:47:51 2022 +0200 drm/i915: Constify intel_drrs_init() args Pass the fixed_mode as const to intel_drrs_init() since it's not supposed to mutate the mode. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 2953d732745656982bf8b45ae5bdc89041bb7897 Author: Ville Syrjälä Date: Thu Mar 10 02:47:50 2022 +0200 drm/i915: Fix up some DRRS type checks Only seamless DRRS needs the frontbuffer tracking, so check for that. Also use != consistently instead of randomly picking < as the comparison operator. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 15deead931a11b65474eb58b44eefa19f931716c Author: Ville Syrjälä Date: Tue Mar 8 01:39:40 2022 +0200 drm/i915: Remove struct dp_link_dpll struct dp_link_dpll is a pointless wrapper around struct dpll. Just store the desired link rate into struct dpll::dot and we're done. v2: Document the full divider as a proper decimal number on chv Nuke bogus eDP 1.4 comments for chv while at it Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8b3ed19ccf9fc80d8d750f61c620eaf9836008ad Author: Ville Syrjälä Date: Tue Mar 8 01:39:39 2022 +0200 drm/i915: Populate bxt/glk DPLL clock limits a bit more Set the bxt/glk DPLL min dotclock to 25MHz (HDMI minimum) and the max to 594 MHz (HDMI max). The supported DP frequencies (162MHz-540MHz) fit within the same range. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-8-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit 3917f4846532266f84a308333713d869b124b05a Author: Ville Syrjälä Date: Tue Mar 8 01:39:38 2022 +0200 drm/i915: Replace hand rolled bxt vco calculation with chv_calc_dpll_params() Use chv_calc_dpll_params() to calculate the BXT DP DPLL VCO frequency. We need to add the m1 divider into bxt_dp_clk_val[] for this to work. v2: Make the WARN_ON() sensible Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit fe649940c2a060cee986633d59381c96205d300e Author: Ville Syrjälä Date: Tue Mar 8 01:39:37 2022 +0200 drm/i915: Replace bxt_clk_div with struct dpll bxt_clk_div is basically the same as struct dpll. Just use the latter. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-6-ville.syrjala@linux.intel.com commit 734fe6f17237e6107b6f984e51d2b6b769a594e7 Author: Ville Syrjälä Date: Tue Mar 8 01:39:36 2022 +0200 drm/i915: Store the m2 divider as a whole in bxt_clk_div Get rid of the pointless m2 int vs. frac split in bxt_clk_div and just store the whole divider as one. v2: Document the full divider as a proper decimal number Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8b080334e97e1aa2ce78259a11e92895ae073482 Author: Ville Syrjälä Date: Tue Mar 8 01:39:35 2022 +0200 drm/i915: Clean up bxt/glk PLL registers Use REG_BIT() & co. for bxt/glk PLL registers. v2: Reorder a few bits for consistency Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8e38c6b57e5d1481c43a0b9f77a80e3deeeb7721 Author: Ville Syrjälä Date: Tue Mar 8 01:39:34 2022 +0200 drm/i915: Remove redundant/wrong comments Remove the comment specifying the exact formulat for calculating the DPLL frequency from the *_find_best_dpll() functions. Each platform variant has its own way to calculate these and we have the code already to do that. These comments are entirely redundant and often even wrong so just get rid of them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220307233940.4161-3-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit 9ca48a806cf241e9fe374206b8b0dd9c80ccdde3 Author: Ville Syrjälä Date: Wed Mar 9 23:43:01 2022 +0200 drm/i915: Store the /5 target clock in struct dpll on vlv/chv Unify vlv/chv with earlier platforms so that the sturct dpll::dot represents the /5 clock frequency (ie. DP symbol rate or HDMI TMDS rate) rather than the *5 fast clock (/2 of the bitrate). Makes life a little less confusing to get the same number back in .dot which we fed into the DPLL algorithm. v2: Actually just include the 5x in the final P divider Do the same change to the hand rolled gvt code v3: Missed a few *5 in *_find_best_dpll() Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309214301.22899-1-ville.syrjala@linux.intel.com commit 8d8b2dd3995f80f26723ad61865e1eb265225561 Author: Ville Syrjälä Date: Wed Feb 23 15:13:15 2022 +0200 drm/i915: Make the PIPESRC rect relative to the entire bigjoiner area When using bigjoiner it's useful to know the offset of each individual pipe in the whole set of joined pipes. Let's include that information in our PIPESRC rectangle. With this we can make the plane clipping code blissfully unaware of bigjoiner usage, as all we have to do is remove the pipe's offset from the final plane destination coordinates. v2: Use intel_bigjoiner_num_pipes() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-14-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 353bb6a5f2ac495f289b7c7a528c7d134c9a8ec4 Author: Simon Trimmer Date: Wed Mar 9 13:00:17 2022 +0000 ASoC: wm_adsp: Compressed stream DSP memory structs should be __packed The compressed stream code has a bunch of structs that are used to represent DSP memory but have not been marked __packed. This isn't safe, they could get padded on a 64-bit build. Signed-off-by: Simon Trimmer Link: https://lore.kernel.org/r/20220309130017.2816-1-simont@opensource.cirrus.com Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 759b30f70597562ebfa60b516c4c5cbfc2f432dc Author: Ville Syrjälä Date: Tue Mar 8 19:32:25 2022 +0200 drm/i915: Remove leftover cnl SAGV block time GLK doesn't support SAGV, so with CNL gone there is no use for having a DISPLAY_VER==10 SAGV block time in the code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220308173230.4182-2-ville.syrjala@linux.intel.com Reviewed-by: Vinod Govindapillai commit f28dd50756757cde90dbf139c100fb45b13dccb3 Author: Brian Norris Date: Tue Mar 1 18:11:39 2022 -0800 drm/bridge: analogix_dp: Enable autosuspend DP AUX transactions can consist of many short operations. There's no need to power things up/down in short intervals. I pick an arbitrary 100ms; for the systems I'm testing (Rockchip RK3399), runtime-PM transitions only take a few microseconds. Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220301181107.v4.2.I48b18ab197c9b649d376cf8cfd934e59d338f86d@changeid commit 8fb6c44fe8468f92ac7b8bbfcca4404a4e88645f Author: Brian Norris Date: Tue Mar 1 18:11:38 2022 -0800 drm/bridge: analogix_dp: Grab runtime PM reference for DP-AUX If the display is not enable()d, then we aren't holding a runtime PM reference here. Thus, it's easy to accidentally cause a hang, if user space is poking around at /dev/drm_dp_aux0 at the "wrong" time. Let's get a runtime PM reference, and check that we "see" the panel. Don't force any panel power-up, etc., because that can be intrusive, and that's not what other drivers do (see drivers/gpu/drm/bridge/ti-sn65dsi86.c and drivers/gpu/drm/bridge/parade-ps8640.c.) Fixes: 0d97ad03f422 ("drm/bridge: analogix_dp: Remove duplicated code") Cc: Cc: Tomeu Vizoso Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20220301181107.v4.1.I773a08785666ebb236917b0c8e6c05e3de471e75@changeid commit 46db48f25ed116bf028eca583a0d85a8ae86dd0a Author: Douglas Anderson Date: Tue Mar 8 11:06:59 2022 -0800 drm/bridge: Add myself as a reviewer for the Parade PS8640 bridge chip Though the parade bridge chip is a little bit of a black box, I'm at least interested in hearing about changes to the driver since this bridge chip is used on some Chromebooks that I'm involved with. Signed-off-by: Douglas Anderson Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220308110615.3.I04f99fbcc14b8c09610b4b18f0696c992a44d2b7@changeid commit 59c217b3dde5927ceb37dd403d1058fa9b98cc7a Author: Douglas Anderson Date: Tue Mar 8 11:06:58 2022 -0800 drm/bridge: Add myself as a reviewer for the TI SN65DSI86 bridge chip I've spent quite a bit of time poking at this driver and it's used on several Chromebooks I'm involved with. I'd like to get notified about patches. Add myself as a reviewer. It's expected that changes will still be landed through drm-misc as they always have been. Signed-off-by: Douglas Anderson Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220308110615.2.I4485769d5b25a8096508e839b8fea12ce7b836d3@changeid commit 73a46da4fa7ca088e7bbf8be817114b9ec40f01b Author: Douglas Anderson Date: Tue Mar 8 11:06:57 2022 -0800 drm/bridge: Add MAINTAINERS entry for DRM drivers for bridge chip bindings The bindings for bridge chips should also get the same maintainers entry so the right people get notified about bindings changes. Signed-off-by: Douglas Anderson Reviewed-by: Laurent Pinchart Acked-by: Neil Armstrong Acked-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220308110615.1.I1f1b10daf7361feb6705f789deb680b8d7720de9@changeid commit 9e82ea0fb1dfc6eef917ff69f909b39dbaa38702 Author: José Expósito Date: Mon Feb 21 08:28:35 2022 +0100 drm/bridge: anx7625: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Reviewed-by: Maxime Ripard Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220221072835.10032-1-jose.exposito89@gmail.com commit a134109c301736ea2ac5054ba3c29c30c87f6ba7 Author: Chen-Yu Tsai Date: Wed Mar 9 00:07:58 2022 +0800 drm: ssd130x: Always apply segment remap setting Currently the ssd130x driver only sets the segment remap setting when the device tree requests it; it however does not clear the setting if it is not requested. This leads to the setting incorrectly persisting if the hardware is always on and has no reset GPIO wired. This might happen when a developer is trying to find the correct settings for an unknown module, and cause the developer to get confused because the settings from the device tree are not consistently applied. Make the driver apply the segment remap setting consistently, setting the value correctly based on the device tree setting. This also makes this setting's behavior consistent with the other settings, which are always applied. Fixes: a61732e80867 ("drm: Add driver for Solomon SSD130x OLED displays") Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220308160758.26060-2-wens@kernel.org commit efb37e66b7572ce4696aa0ac21675e17d6b9a17d Author: Chen-Yu Tsai Date: Wed Mar 9 00:07:57 2022 +0800 drm: ssd130x: Fix COM scan direction register mask The SSD130x's command to toggle COM scan direction uses bit 3 and only bit 3 to set the direction of the scanout. The driver has an incorrect GENMASK(3, 2), causing the setting to be set on bit 2, rendering it ineffective. Fix the mask to only bit 3, so that the requested setting is applied correctly. Fixes: a61732e80867 ("drm: Add driver for Solomon SSD130x OLED displays") Signed-off-by: Chen-Yu Tsai Acked-by: Javier Martinez Canillas Tested-by: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220308160758.26060-1-wens@kernel.org commit 14a28e79f5f6c756f281a021555f1b7578a67098 Author: José Expósito Date: Mon Feb 28 19:39:54 2022 +0100 drm/bridge: ti-sn65dsi86: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Reviewed-by: Kieran Bingham Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220228183955.25508-1-jose.exposito89@gmail.com commit d583e752732421b26fef0d65020565f3bef12248 Author: Tom Rix Date: Thu Mar 3 12:19:43 2022 -0800 drm/bridge: anx7625: check the return on anx7625_aux_trans Clang static analysis reports this issue anx7625.c:876:13: warning: The left operand of '&' is a garbage value if (!(bcap & 0xOA01)) { ~~~~ ^ bcap is only set by a successful call to anx7625_aux_trans(). So check. Fixes: cd1637c7e480 ("drm/bridge: anx7625: add HDCP support") Signed-off-by: Tom Rix Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220303201943.501746-1-trix@redhat.com Reviewed-by: Robert Foss commit 4404cdb59b336279b7dcb40c5ef01dbcdbebc941 Author: Rex-BC Chen Date: Wed Mar 9 15:36:37 2022 +0800 drm/bridge: anx7625: config hs packets end aligned to avoid screen shift This device requires the packets on lanes aligned at the end to fix screen shift or scroll. Signed-off-by: Jitao Shi Signed-off-by: Rex-BC Chen Acked-by: AngeloGioacchino Del Regno Reviewed-by: Xin Ji Reviewed-by: Andrzej Hajda Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220309073637.3591-4-rex-bc.chen@mediatek.com commit 7d8d0b4dcc535357d44ddeff154508f147c14e2a Author: Rex-BC Chen Date: Wed Mar 9 15:36:36 2022 +0800 drm/mediatek: implement the DSI HS packets aligned Some DSI RX devices (for example, anx7625) require last alignment of packets on all lanes after each row of data is sent. Otherwise, there will be some issues of shift or scroll for screen. Take horizontal_sync_active_byte for a example, we roundup the HSA packet data to lane number, and the subtraction of 2 is the packet data value added by the roundup operation, making the long packets are integer multiples of lane number. This value (2) varies with the lane number, and that is the reason we do this operation when the lane number is 4. In the previous operation of function "mtk_dsi_config_vdo_timing", the length of HSA and HFP data packets has been adjusted to an integration multiple of lane number. Since the number of RGB data packets cannot be guaranteed to be an integer multiple of lane number, we modify the data packet length of HBP so that the number of HBP + RGB is equal to the lane number. So after sending a line of data (HSA + HBP + RGB + HFP), the data lanes are aligned. Signed-off-by: Jitao Shi Signed-off-by: Rex-BC Chen Signed-off-by: Xinlei Lee Reviewed-by: Andrzej Hajda Reviewed-by: AngeloGioacchino Del Regno Acked-by: Chun-Kuang Hu Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220309073637.3591-3-rex-bc.chen@mediatek.com commit 1498915233dde830061e008ad639b482fd76f93d Author: Rex-BC Chen Date: Wed Mar 9 15:36:35 2022 +0800 drm/dsi: transfer DSI HS packets ending at the same time Since a HS transmission is composed of an arbitrary number of bytes that may not be an integer multiple of lanes, some lanes may run out of data before others. (Defined in 6.1.3 of mipi_DSI_specification_v.01-02-00) However, for some DSI RX devices (for example, anx7625), there is a limitation that packet number should be the same on all DSI lanes. In other words, they need to end a HS at the same time. Because this limitation is for some specific DSI RX devices, it is more reasonable to put the enable control in these DSI RX drivers. If DSI TX driver knows the information, they can adjust the setting for this situation. Signed-off-by: Jitao Shi Signed-off-by: Rex-BC Chen Acked-by: AngeloGioacchino Del Regno Reviewed-by: Andrzej Hajda Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220309073637.3591-2-rex-bc.chen@mediatek.com commit df0a9e8d3008050f61241f471c70438ef1e90a1b Author: Noralf Trønnes Date: Wed Nov 24 16:07:54 2021 +0100 dt-bindings: display: sitronix, st7735r: Remove spi-max-frequency limit The datasheet lists the minimum Serial clock cycle (Write) as 66ns which is 15MHz. Mostly it can do much better than that and is in fact often run at 32MHz. With a clever driver that runs configuration commands at a low speed and only the pixel data at the maximum speed the configuration can't be messed up by transfer errors and the speed is only limited by the amount of pixel glitches that one is able to tolerate. Signed-off-by: Noralf Trønnes Acked-by: Rob Herring Acked-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20211124150757.17929-4-noralf@tronnes.org commit a2e8cbb27722b0992aceb93b35e9d9433d8a758e Author: Noralf Trønnes Date: Wed Nov 24 16:07:53 2021 +0100 dt-bindings: display: sitronix, st7735r: Make reset-gpios optional There are other ways than using a gpio to reset the controller so make this property optional. Signed-off-by: Noralf Trønnes Acked-by: Rob Herring Acked-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20211124150757.17929-3-noralf@tronnes.org commit 471e201f543559e2cb19b182b680ebf04d80ee31 Author: Noralf Trønnes Date: Wed Nov 24 16:07:52 2021 +0100 dt-bindings: display: sitronix, st7735r: Fix backlight in example The backlight property was lost during conversion to yaml in commit abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema"). Put it back. Fixes: abdd9e3705c8 ("dt-bindings: display: sitronix,st7735r: Convert to DT schema") Signed-off-by: Noralf Trønnes Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: David Lechner Link: https://patchwork.freedesktop.org/patch/msgid/20211124150757.17929-2-noralf@tronnes.org commit d296089b5bc3bc23eddb73efd04ac56b0c2a898b Author: Changcheng Deng Date: Tue Mar 8 09:16:55 2022 +0000 drm/i915/dsi: use min_t() to make code cleaner Use min_t() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220308091655.2078825-1-deng.changcheng@zte.com.cn commit 1f5c135ee509e89e0cc274333a65f73c62cb16e5 Author: Alexey Gladkov Date: Mon Feb 14 19:18:15 2022 +0100 ipc: Store ipc sysctls in the ipc namespace The ipc sysctls are not available for modification inside the user namespace. Following the mqueue sysctls, we changed the implementation to be more userns friendly. So far, the changes do not provide additional access to files. This will be done in a future patch. Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/be6f9d014276f4dddd0c3aa05a86052856c1c555.1644862280.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit dc55e35f9e810f23dd69cfdc91a3d636023f57a2 Author: Alexey Gladkov Date: Mon Feb 14 19:18:14 2022 +0100 ipc: Store mqueue sysctls in the ipc namespace Right now, the mqueue sysctls take ipc namespaces into account in a rather hacky way. This works in most cases, but does not respect the user namespace. Within the user namespace, the user cannot change the /proc/sys/fs/mqueue/* parametres. This poses a problem in the rootless containers. To solve this I changed the implementation of the mqueue sysctls just like some other sysctls. So far, the changes do not provide additional access to files. This will be done in a future patch. v3: * Don't implemenet set_permissions to keep the current behavior. v2: * Fixed compilation problem if CONFIG_POSIX_MQUEUE_SYSCTL is not specified. Reported-by: kernel test robot Signed-off-by: Alexey Gladkov Link: https://lkml.kernel.org/r/b0ccbb2489119f1f20c737cf1930c3a9c4e4243a.1644862280.git.legion@kernel.org Signed-off-by: Eric W. Biederman commit 6639fabb16852b2473c4c78c38a3b18689eb6ac3 Author: Matt Roper Date: Mon Feb 28 21:29:52 2022 -0800 drm/i915/xehp: Drop aux table invalidation on FlatCCS platforms Platforms with FlatCCS do not use auxiliary planes for compression control data and thus do not need traditional aux table invalidation (and the registers no longer even exist). Original-author: CQ Tang Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220301052952.1706597-1-matthew.d.roper@intel.com commit 07b58d61275ebbb39b678d18f7c4e472050b13eb Author: Matthew Auld Date: Tue Feb 8 15:12:28 2022 +0000 drm/doc: pull in drm_buddy.c Make sure we pull in the kernel-doc for this. Reported-by: Daniel Vetter Signed-off-by: Matthew Auld Cc: Arunpravin Cc: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220208151228.344997-1-matthew.auld@intel.com Signed-off-by: Christian König Reviewed-by: Christian König commit 2ed38cec5606dfe50893b36a1363379f9609e0bb Author: Matthew Auld Date: Wed Feb 2 17:31:54 2022 +0000 drm/i915: opportunistically apply ALLOC_CONTIGIOUS It looks like this code was accidentally dropped at some point(in a slightly different form), so add it back. The gist is that if we know the allocation will be one single chunk, then we can just annotate the BO with I915_BO_ALLOC_CONTIGUOUS, even if the user doesn't bother. In the future this should allow us to avoid using vmap for such objects, in some upcoming patches. v2(Thomas): - Tweak the commit message to mention the future motivation Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220202173154.3758970-1-matthew.auld@intel.com commit c64fa77dd4609cb8cd53fbb73b02434ae8212c7a Author: Matthew Auld Date: Thu Mar 3 10:02:29 2022 +0000 drm/i915/gtt: reduce overzealous alignment constraints for GGTT Currently this will enforce both 2M alignment and padding for any LMEM pages inserted into the GGTT. However, this was only meant to be applied to the compact-pt layout with the ppGTT. For the GGTT we can reduce the alignment and padding to 64K. Bspec: 45015 Fixes: 87bd701ee268 ("drm/i915: enforce min GTT alignment for discrete cards") Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Robert Beckett Cc: Ramalingam C Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220303100229.839282-1-matthew.auld@intel.com commit c1b16fbd1698d07bbb0b0ddc3da5a7f1f0854edd Author: José Expósito Date: Mon Feb 28 19:37:24 2022 +0100 drm/bridge: ti-sn65dsi83: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228183724.25030-1-jose.exposito89@gmail.com commit aec9a8576eecaf4a75f29ade79e679f171edf622 Author: José Expósito Date: Mon Feb 28 19:35:37 2022 +0100 drm/bridge: tc358775: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228183537.24600-1-jose.exposito89@gmail.com commit 0d9c5e6733a773ce590a1b08a446daca04781c57 Author: José Expósito Date: Mon Feb 28 19:33:42 2022 +0100 drm/bridge: tc358762: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228183342.24129-1-jose.exposito89@gmail.com commit 5486eac81004febf512c6d344cd8f612a1e597ae Author: José Expósito Date: Mon Feb 28 19:31:31 2022 +0100 drm/bridge: parade-ps8640: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228183131.23494-1-jose.exposito89@gmail.com commit 55ad1a56b4f991f9879f4f5019f485fa713426ae Author: José Expósito Date: Mon Feb 28 19:29:04 2022 +0100 drm/bridge: parade-ps8622: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228182904.22982-1-jose.exposito89@gmail.com commit bbefe708816a6c559bf170031e99bca32c0743e4 Author: José Expósito Date: Mon Feb 28 19:26:00 2022 +0100 drm/bridge: nxp-ptn3460: switch to devm_drm_of_get_bridge The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Signed-off-by: José Expósito Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228182600.22463-1-jose.exposito89@gmail.com commit e026f2880235025643fd7d68dbe972d544d7f44f Author: Maxime Ripard Date: Mon Feb 21 10:59:15 2022 +0100 drm/komeda: plane: Remove redundant color encoding and range initialisation The komeda KMS driver will call drm_plane_create_color_properties() with a default encoding and range values of BT601 and Limited Range, respectively. Since the initial value wasn't carried over in the state, the driver had to set it again in komeda_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore. Cc: Brian Starkey Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Signed-off-by: Maxime Ripard Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-20-maxime@cerno.tech commit c410976a72823015341ffeeebede36e4a9a08eb2 Author: Maxime Ripard Date: Mon Feb 21 10:59:05 2022 +0100 drm/komeda: plane: Remove redundant zpos initialisation The komeda KMS driver will call drm_plane_create_zpos_property() with an init value of the plane index. Since the initial value wasn't carried over in the state, the driver had to set it again in komeda_plane_reset(). However, the helpers have been adjusted to set it properly at reset, so this is not needed anymore. Cc: Brian Starkey Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Signed-off-by: Maxime Ripard Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-10-maxime@cerno.tech commit 8a0982b60f5a4a66c8a28eed37769021c20d8c50 Author: Maxime Ripard Date: Mon Feb 21 10:58:57 2022 +0100 drm/komeda: plane: switch to plane reset helper komeda_plane_reset() does the state initialisation by copying a lot of the code found in the __drm_atomic_helper_plane_reset(). Let's switch to that helper and reduce the boilerplate. Cc: Brian Starkey Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Signed-off-by: Maxime Ripard Acked-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-2-maxime@cerno.tech commit 8f2a3970c969d0d8d7289a4c65edcedafc16fd92 Author: Wan Jiabing Date: Mon Mar 7 17:56:12 2022 +0800 drm/omap: fix NULL but dereferenced coccicheck error Fix the following coccicheck warning: ./drivers/gpu/drm/omapdrm/omap_overlay.c:89:22-25: ERROR: r_ovl is NULL but dereferenced. Here should be ovl->idx rather than r_ovl->idx. Fixes: e02b5cc9e898ad ("drm/omap: Add a 'right overlay' to plane state") Signed-off-by: Wan Jiabing Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20220307095612.409090-1-wanjiabing@vivo.com commit 016d1ca3f6ad05676fd9e418715ddce1f4ab5a73 Author: Dan Carpenter Date: Mon Mar 7 15:54:58 2022 +0300 drm/selftests: missing error code in igt_buddy_alloc_smoke() Set the error code to -ENOMEM if drm_random_order() fails. Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase") Signed-off-by: Dan Carpenter Reviewed-by: Arunpravin Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220307125458.GA16710@kili commit f6e68388443ff50088e224b3a75090bdc0403be6 Author: Geert Uytterhoeven Date: Thu Mar 3 13:44:56 2022 +0100 drm: Drop commas after SoC match table sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Neil Armstrong Acked-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/298f0644275d7d0b4aa3ee7143756a2431a4900c.1646311443.git.geert+renesas@glider.be commit e4b3ee71ec2a6378ce9d4f4a3160b00921241f48 Author: Matthew Auld Date: Fri Mar 4 17:42:52 2022 +0000 drm/i915: stop checking for NULL vma->obj This is no longer possible since e6e1a304d759 ("drm/i915: vma is always backed by an object."). Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220304174252.1000238-1-matthew.auld@intel.com commit 833124a0d1698912f47090683908484a1a937a13 Author: Matthew Auld Date: Fri Mar 4 09:59:34 2022 +0000 drm/i915: limit the async bind to bind_async_flags If the vm doesn't request async binding, like for example with the dpt, then we should be able to skip the async path and avoid calling i915_vm_lock_objects() altogether. Currently if we have a moving fence set for the BO(even though it might have signalled), we still take the async patch regardless of the bind_async setting, and then later still end up just doing i915_gem_object_wait_moving_fence() anyway. Alternatively we would need to add dummy scratch object which can be locked, just for the dpt. Suggested-by: Thomas Hellström Signed-off-by: Matthew Auld Cc: Stanislav Lisovskiy Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220304095934.925036-2-matthew.auld@intel.com commit 17e571fe720dae18eb5e743b0e6217f235d5338c Author: Jani Nikula Date: Fri Mar 4 12:14:26 2022 +0200 drm/i915/gmbus: use to_intel_gmbus() instead of open coding We have a helper for getting at the enclosing gmbus struct from the embedded i2c_adapter, use it. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220304101426.1891347-2-jani.nikula@intel.com commit 71abfcbeae3e8b48c40c0ff58cec907269b7db73 Author: Jani Nikula Date: Fri Mar 4 12:14:25 2022 +0200 drm/i915/gmbus: move some local bus variables within loops Limit the scope. Suggested-by: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220304101426.1891347-1-jani.nikula@intel.com commit 892bfb8a604d464925edca9a5c3d2b2062c2124d Author: Matthew Auld Date: Fri Mar 4 09:59:33 2022 +0000 drm/i915/fbdev: fixup setting screen_size Since we are actually mapping the object and not the vma, when dealing with LMEM, we should be careful and use the backing store size here, since the vma->node.size could have all kinds of funny padding constraints, which could result in us writing to OOB address. v2(Chris): - Prefer vma->size here, which should be the backing store size. Some more rework is needed here to stop using node.size in some other places. Signed-off-by: Matthew Auld Cc: Stanislav Lisovskiy Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220304095934.925036-1-matthew.auld@intel.com commit eb950819218af113b57cd5cd3441af4077a9baaf Author: Thomas Hellström Date: Fri Mar 4 09:26:41 2022 +0100 drm/i915/gem: Remove some unnecessary code The test for vma should always return true, and when assigning -EBUSY to ret, the variable should already have that value. Signed-off-by: Thomas Hellström Reviewed-by: Niranjana Vishwanathapura Link: https://patchwork.freedesktop.org/patch/msgid/20220304082641.308069-4-thomas.hellstrom@linux.intel.com commit d93939730347360db0afe6a4367451b6f84ab7b1 Author: Thomas Hellström Date: Fri Mar 4 09:26:40 2022 +0100 drm/i915: Remove the vma refcount Now that i915_vma_parked() is taking the object lock on vma destruction, and the only user of the vma refcount, i915_gem_object_unbind() also takes the object lock, remove the vma refcount. v3: Documentation update. Signed-off-by: Thomas Hellström Reviewed-by: Niranjana Vishwanathapura Link: https://patchwork.freedesktop.org/patch/msgid/20220304082641.308069-3-thomas.hellstrom@linux.intel.com commit e1a7ab4fca0caa0d637d08a2440592637c0a3675 Author: Thomas Hellström Date: Fri Mar 4 09:26:39 2022 +0100 drm/i915: Remove the vm open count vms are not getting properly closed. Rather than fixing that, Remove the vm open count and instead rely on the vm refcount. The vm open count existed solely to break the strong references the vmas had on the vms. Now instead make those references weak and ensure vmas are destroyed when the vm is destroyed. Unfortunately if the vm destructor and the object destructor both wants to destroy a vma, that may lead to a race in that the vm destructor just unbinds the vma and leaves the actual vma destruction to the object destructor. However in order for the object destructor to ensure the vma is unbound it needs to grab the vm mutex. In order to keep the vm mutex alive until the object destructor is done with it, somewhat hackishly grab a vm_resv refcount that is released late in the vma destruction process, when the vm mutex is no longer needed. v2: Address review-comments from Niranjana - Clarify that the struct i915_address_space::skip_pte_rewrite is a hack and should ideally be replaced in an upcoming patch. - Remove an unneeded continue in clear_vm_list and update comment. v3: - Documentation update - Commit message formatting Co-developed-by: Niranjana Vishwanathapura Signed-off-by: Niranjana Vishwanathapura Signed-off-by: Thomas Hellström Reviewed-by: Niranjana Vishwanathapura Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220304082641.308069-2-thomas.hellstrom@linux.intel.com commit d028a7690d872d4720628c7475dbd1a25cfa73df Author: Gwan-gyeong Mun Date: Fri Feb 25 15:13:16 2022 +0200 drm/i915/dmabuf: Fix prime_mmap to work when using LMEM The current implementation of i915 prime mmap only works when initializing drm_i915_gem_object with shmem_region. When using LMEM, drm_i915_gem_object is initialized with ttm_system_region. In order to make prime mmap work even this case, when using LMEM (when using ttm in i915), dma_buf_ops.mmap callback function calls drm_gem_prime_mmap(). drm_gem_prime_mmap() of drm core calls internally i915_gem_mmap() so that prime mmap can perform normally. The fake offset is processed inside drm_gem_prime_mmap(). Testcase: igt/prime_mmap Cc: Thomas Hellström Cc: Matthew Auld Signed-off-by: Gwan-gyeong Mun Reviewed-by: Nirmoy Das Signed-off-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220225131316.1433515-3-gwan-gyeong.mun@intel.com commit dcb62550c4e46a9af18c7e5876bc1189c7115329 Author: Gwan-gyeong Mun Date: Fri Feb 25 15:13:15 2022 +0200 drm/i915/dmabuf: Update dma_buf_ops.unmap_dma_buf callback to use drm_gem_unmap_dma_buf() The dma_buf_ops.unmap_dma_buf callback used in i915, i915_gem_unmap_dma_buf(), has the same code as drm_gem_unmap_dma_buf(). In order to eliminate defining and using duplicate function, it updates the dma_buf_ops.unmap_dma_buf callback to use drm_gem_unmap_dma_buf(). Signed-off-by: Gwan-gyeong Mun Reviewed-by: Nirmoy Das Signed-off-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220225131316.1433515-2-gwan-gyeong.mun@intel.com commit fd8be27e50e04f6e80af0f3e327cced525558256 Author: Michal Suchanek Date: Fri Feb 25 21:51:35 2022 +0100 efifb: Remove redundant efifb_setup_from_dmi stub efifb is the only user of efifb_setup_from_dmi which is provided by sysfb which is selected by efifb. That makes the stub redundant. Signed-off-by: Michal Suchanek Reviewed-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/7416c439d68e9e96068ea5c77e05c99c7df41750.1645822213.git.msuchanek@suse.de commit 8b766b0f8eece55155146f7628610ce54a065e0f Author: Michal Suchanek Date: Fri Feb 25 21:51:34 2022 +0100 sysfb: Enable boot time VESA graphic mode selection Since switch to simplefb/simpledrm VESA graphic mode selection with vga= kernel parameter is no longer available with legacy BIOS. The x86 realmode boot code enables the VESA graphic modes when option FB_BOOT_VESA_SUPPORT is enabled. This option is selected by vesafb but not simplefb/simpledrm. To enable use of VESA modes with simplefb in legacy BIOS boot mode drop dependency of BOOT_VESA_SUPPORT on FB, also drop the FB_ prefix. Select the option from sysfb rather than the drivers that depend on it. The BOOT_VESA_SUPPORT is not specific to framebuffer but rather to x86 platform, move it from fbdev to x86 Kconfig. Fixes: e3263ab389a7 ("x86: provide platform-devices for boot-framebuffers") Signed-off-by: Michal Suchanek Reviewed-by: Javier Martinez Canillas Acked-by: Borislav Petkov Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/948c39940a4e99f5b43bdbcbe537faae71a43e1d.1645822213.git.msuchanek@suse.de commit a4a072d98d8c2370476de3b5f0c94f2cf2fd35bf Author: Michal Suchanek Date: Fri Feb 25 21:51:33 2022 +0100 sysfb: Make config option dependencies explicit efifb and vesafb requires sysfb implicitly but this is not stated in Kconfig. Add the dependency. With that all drivers that require sysfb depend on it so it can default to disabled. Signed-off-by: Michal Suchanek Reviewed-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/a0fa41e9186653e4c41ad0a28259e5cdc71b1f66.1645822213.git.msuchanek@suse.de commit 09077bc3116581f4d1cb961ec359ad56586e370b Author: Nikita Yushchenko Date: Sat Dec 25 09:31:51 2021 +0300 drm/bridge_connector: enable HPD by default if supported Hotplug events reported by bridge drivers over drm_bridge_hpd_notify() get ignored unless somebody calls drm_bridge_hpd_enable(). When the connector for the bridge is bridge_connector, such a call is done from drm_bridge_connector_enable_hpd(). However drm_bridge_connector_enable_hpd() is never called on init paths, documentation suggests that it is intended for suspend/resume paths. In result, once encoders are switched to bridge_connector, bridge-detected HPD stops working. This patch adds a call to that API on init path. This fixes HDMI HPD with rcar-du + adv7513 case when adv7513 reports HPD events via interrupts. Fixes: c24110a8fd09 ("drm: rcar-du: Use drm_bridge_connector_init() helper") Signed-off-by: Nikita Yushchenko Signed-off-by: Paul Cercueil Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20211225063151.2110878-1-nikita.yoush@cogentembedded.com commit 8b986e2a051c2910851d3661a8419721028d2f02 Author: Ville Syrjälä Date: Wed Feb 23 15:13:14 2022 +0200 drm/i915: Use bigjoiner_pipes more Replace the hardcoded 2 pipe assumptions when we're massaging pipe_mode and the pipe_src rect to be suitable for bigjoiner. Instead we can just count the number of pipes in the bitmask. v2: Introduce intel_bigjoiner_num_pipes() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-13-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 4d1b53dfbf2445a7cf35ca18c90c2c6712fea163 Author: Ville Syrjälä Date: Wed Feb 23 15:13:13 2022 +0200 drm/i915: Eliminate bigjoiner boolean Since we now have the bigjoiner_pipes bitmask the boolean is redundant. Get rid of it. Also, populating bigjoiner_pipes already during encoder->compute_config() allows us to use it much earlier during the state calculation as well. The initial aim is to use it in intel_crtc_compute_config(). v2: Move the hweight(bigjoiner_pipes) stuff to a later patch Reviewed-by: Ankit Nautiyal #v1 Reviewed-by: Manasi Navare #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-12-ville.syrjala@linux.intel.com commit 26111a161ab56e7033d3b3086270c5a1dcfe0f2f Author: Ville Syrjälä Date: Wed Feb 23 15:13:12 2022 +0200 drm/i915: Start tracking PIPESRC as a drm_rect Instead of just having the pipe_src_{w,h} let's use a full drm_rect for it. This will be particularly useful to astract away some bigjoiner details. v2: No hweight() stuff yet Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-11-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 0fa1d65e7dda66f12f703b2f00146d836211acc8 Author: Ville Syrjälä Date: Tue Mar 1 19:31:23 2022 +0200 drm/i915: Use designated initializers for bxt_dp_clk_val[] Use designated initializers to make it clear what is what, and to decouple us from the specific ordering of the members. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220301173128.6988-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 392f662b930dcadede4e184fc4a40c9db953a2e6 Author: Ville Syrjälä Date: Tue Mar 1 19:31:22 2022 +0200 drm/i915: Remove bxt m2_frac_en Remove the pointless m2_frac_en from bxt_clk_div. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220301173128.6988-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 2dfac87c7c4ae55cf49d656b77a06d85414f0344 Author: Ville Syrjälä Date: Tue Mar 1 19:31:20 2022 +0200 drm/i915: Clean up some struct/array initializers Use the simple '= {}' form to initialize empty arrays/structs. Also add some missing whitespace. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220301173128.6988-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit fe70b262e781de9949a6c26b50767867d9da71b3 Author: Ville Syrjälä Date: Tue Mar 1 19:31:19 2022 +0200 drm/i915: Move a bunch of stuff into rodata from the stack Toss a bunch if constants into .rodata drom the stack. Also shrink the types of some of the arrays to reduce the size. bloat-o-meter -c intel_dpll_mgr.o: add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-86 (-86) Function old new delta icl_get_dplls 3393 3372 -21 skl_get_dpll 2069 2004 -65 Total: Before=28029, After=27943, chg -0.31% add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) Data old new delta Total: Before=17, After=17, chg +0.00% add/remove: 2/0 grow/shrink: 0/2 up/down: 28/-129 (-101) RO Data old new delta dco_central_freq - 24 +24 div1_vals - 4 +4 odd_dividers 28 7 -21 even_dividers 144 36 -108 Total: Before=3600, After=3499, chg -2.81% Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220301173128.6988-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4a1e1758b2db6c9dbbbf138abb1c1df4e7a3e30a Author: Ville Syrjälä Date: Tue Mar 1 19:31:18 2022 +0200 drm/i915: Nuke skl_wrpll_context_init() We can trivially replace skl_wrpll_context_init() with a single designated initializer. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220301173128.6988-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a97087026d0ef0cb1a915f94c78bca5dbabdb201 Author: Ville Syrjälä Date: Mon Feb 21 13:03:56 2022 +0200 drm/i915: Relocate a few more pch transcoder bits Move intel_crtc_pch_transcoder() and has_pch_trancoder() to a more appropritate place (intel_pch_display.c). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220221110356.5532-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 108a112f5ebaf9481af805a32167f8ce805e3608 Author: Ville Syrjälä Date: Mon Feb 21 13:03:55 2022 +0200 drm/i915: Relocate ibx pch port sanitation code Move the ibx pch port sanitation code into intel_pch_display.c where it now belongs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220221110356.5532-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 6561a9d6381355df23b1ef1980609124a628eff4 Author: Ville Syrjälä Date: Mon Feb 21 13:03:54 2022 +0200 drm/i915: Remove framestart_delay sanitation Now that we track framestart_delay in the crtc state with readout and state checker support we can remove the explicit framestart_delay sanitation code. Also I'm not convinced reprogramming this while the pipe is running is even valid. CHICKEN_TRANS (hsw+) and TRANS_CHICKEN2 (cpt+) docs at least make no mention of double buffering which seems to imply that live reprogramming is not supported. On older platforms PIPECONF and PCH_TRANSCONF (ibx) are double buffered though, so might be that we could do this on the older platforms. But doesn't really make sense to special case old platforms for this. So from now on if the BIOS has misprogrammed this we shall simply do a full modeset at boot to fix it up. Such systems will of course lose fastboot, but I think less code (and less uncertainty what reprogramming this on a running pipe will even do) outweighs that. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220221110356.5532-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 50c335f94d71c8b68560abf3fe273962111adcaa Author: Ville Syrjälä Date: Mon Feb 21 13:03:53 2022 +0200 drm/i915: Move framestart_delay to crtc_state We need to make framestart_delay dynamic for DRRS on PCH ports. To that end move it into the crtc state. As a bonus we get state check+dump for it. Will also allow us to get rid of the somewhat questionable framestart_delay sanitation code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220221110356.5532-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 85f50a373fac7c3c34fec5ebed77852de445d2fa Author: Madhumitha Tolakanahalli Pradeep Date: Wed Feb 23 14:28:01 2022 -0800 drm/i915/dmc: Update DMC to v2.16 on ADL-P Changes since v2.14: - Release Notes for v2.15 Fix for corruption issue when DC States are enabled. - Release Notes for v2.16 Fix for cases with flip queue and DC6v are enabled. Signed-off-by: Madhumitha Tolakanahalli Pradeep Reviewed-by: Radhakrishna Sripada Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220223222801.397632-2-madhumitha.tolakanahalli.pradeep@intel.com commit 18ac067bcbde92518a1fc3c0605d030fc3e3f94b Author: Stuart Summers Date: Thu Mar 3 14:34:35 2022 -0800 drm/i915: Add RCS mask to GuC ADS params If RCS is not enumerated, GuC will return invalid parameters. Make sure we do not send RCS supported when we have not enumerated it. Cc: Vinay Belgaumkar Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220303223435.2793124-2-matthew.d.roper@intel.com commit f9576e36c6b4f070d0b95fd968c1a73fec5a193b Author: Matt Roper Date: Thu Mar 3 14:34:34 2022 -0800 drm/i915/xehp: Support platforms with CCS engines but no RCS In the past we've always assumed that an RCS engine is present on every platform. However now that we have compute engines there may be platforms that have CCS engines but no RCS, or platforms that are designed to have both, but have the RCS engine fused off. Various engine-centric initialization that only needs to be done a single time for the group of RCS+CCS engines can't rely on being setup with the RCS now; instead we add a I915_ENGINE_FIRST_RENDER_COMPUTE flag that will be assigned to a single engine in the group; whichever engine has this flag will be responsible for some of the general setup (RCU_MODE programming, initialization of certain workarounds, etc.). Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220303223435.2793124-1-matthew.d.roper@intel.com commit fc3785fb56a27304c769af730d079f4337d4dc76 Author: Arunpravin Date: Fri Mar 4 01:46:02 2022 +0530 drm/selftests: fix a shift-out-of-bounds bug pass the correct size value computed using the max_order. [ 68.124177][ T1] UBSAN: shift-out-of-bounds in include/linux/log2.h:67:13 [ 68.125333][ T1] shift exponent 4294967295 is too large for 32-bit type 'long unsigned int' [ 68.126563][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc2-00311-g39ec47bbfd5d #2 [ 68.127758][ T1] Call Trace: [ 68.128187][ T1] dump_stack_lvl (lib/dump_stack.c:108) [ 68.128793][ T1] dump_stack (lib/dump_stack.c:114) [ 68.129331][ T1] ubsan_epilogue (lib/ubsan.c:152) [ 68.129958][ T1] __ubsan_handle_shift_out_of_bounds.cold (arch/x86/include/asm/smap.h:85) [ 68.130791][ T1] ? drm_block_alloc+0x28/0x80 [ 68.131582][ T1] ? rcu_read_lock_sched_held (kernel/rcu/update.c:125) [ 68.132215][ T1] ? kmem_cache_alloc (include/trace/events/kmem.h:54 mm/slab.c:3501) [ 68.132878][ T1] ? mark_free+0x2e/0x80 [ 68.133524][ T1] drm_buddy_init.cold (include/linux/log2.h:67 drivers/gpu/drm/drm_buddy.c:131) [ 68.134145][ T1] ? test_drm_cmdline_init (drivers/gpu/drm/selftests/test-drm_buddy.c:87) [ 68.134770][ T1] igt_buddy_alloc_limit (drivers/gpu/drm/selftests/test-drm_buddy.c:30) [ 68.135472][ T1] ? vprintk_default (kernel/printk/printk.c:2257) [ 68.136057][ T1] ? test_drm_cmdline_init (drivers/gpu/drm/selftests/test-drm_buddy.c:87) [ 68.136812][ T1] test_drm_buddy_init (drivers/gpu/drm/selftests/drm_selftest.c:77 drivers/gpu/drm/selftests/test-drm_buddy.c:95) [ 68.137475][ T1] do_one_initcall (init/main.c:1300) [ 68.138111][ T1] ? parse_args (kernel/params.c:609 kernel/params.c:146 kernel/params.c:188) [ 68.138717][ T1] do_basic_setup (init/main.c:1372 init/main.c:1389 init/main.c:1408) [ 68.139366][ T1] kernel_init_freeable (init/main.c:1617) [ 68.140040][ T1] ? rest_init (init/main.c:1494) [ 68.140634][ T1] kernel_init (init/main.c:1504) [ 68.141155][ T1] ret_from_fork (arch/x86/entry/entry_32.S:772) [ 68.141607][ T1] ================================================================================ [ 68.146730][ T1] ------------[ cut here ]------------ [ 68.147460][ T1] kernel BUG at drivers/gpu/drm/drm_buddy.c:140! [ 68.148280][ T1] invalid opcode: 0000 [#1] [ 68.148895][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc2-00311-g39ec47bbfd5d #2 [ 68.149896][ T1] EIP: drm_buddy_init (drivers/gpu/drm/drm_buddy.c:140 (discriminator 1)) For more details: https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/FDIF3HCILZNN5UQAZMOR7E3MQSMHHKWU/ Signed-off-by: Arunpravin Reported-by: kernel test robot Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220303201602.2365-1-Arunpravin.PaneerSelvam@amd.com Signed-off-by: Christian König commit e9b67ec2d38aef0987975b95f57ac56947895819 Author: Jani Nikula Date: Thu Mar 3 20:19:31 2022 +0200 drm/i915: include linux/highmem.h and linux/swap.h where needed Include linux/highmem.h and linux/swap.h explicitly where needed so we can drop the linux/i2c.h include from i915_drv.h where it pulled in the dependencies implicitly. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-5-jani.nikula@intel.com commit 63a78bbb418c6e047bd002616bd4de9add0b6974 Author: Jani Nikula Date: Thu Mar 3 20:19:30 2022 +0200 drm/i915/gmbus: alloc intel_gmbus dynamically Allocate the individual intel_gmbus structs dynamically. This lets us hide struct intel_gmbus inside intel_gmbus.c completely. Also use the cleanup function on the error path to avoid duplication. Leave #include in i915_drv.h for now, as it pulls in a bunch of implicit dependencies. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-4-jani.nikula@intel.com commit 65cd963ea239a9c4bf0e5fdf9a86213908276554 Author: Jani Nikula Date: Thu Mar 3 20:19:29 2022 +0200 drm/i915/gmbus: pass gpio reg to intel_gpio_setup() Avoid the additional gmbus lookup on the pin. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-3-jani.nikula@intel.com commit 39a8c428fedf5675475ac4c7a1dabaedb3358c77 Author: Jani Nikula Date: Thu Mar 3 20:19:28 2022 +0200 drm/i915/gmbus: reduce gmbus pin lookups in gmbus setup Avoid separate pin lookups for validity and name. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-2-jani.nikula@intel.com commit 69e807a5a9ffe595853277cb00d7d3fdd583b0fa Author: Jani Nikula Date: Thu Mar 3 20:19:27 2022 +0200 drm/i915/gmbus: combine gmbus pin lookups to one function Combine the platform specific if ladders for array lookup and size checks into one. This is cleaner and avoids duplication, but hopefully also helps any static analyzers that seem to have trouble with the bounds checks. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-1-jani.nikula@intel.com commit 8d80cceecdd98de6d2281d39d6571a1fe08e5af9 Author: Tejas Upadhyay Date: Thu Mar 3 17:02:52 2022 +0530 drm/i915/adl-n: Add stepping info Add ADL-N stepping-substepping info in accordance to BSpec. Bspec: 68397 Cc: Matt Roper Signed-off-by: Tejas Upadhyay Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220303113252.212873-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit e1dd871442c05ad5f53bc1eac22f71b53eb48a8a Author: John Harrison Date: Tue Mar 1 16:33:57 2022 -0800 drm/i915/guc: Fix potential invalid pointer dereferences when decoding G2Hs Some G2H handlers were reading the context id field from the payload before checking the payload met the minimum length required. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-9-John.C.Harrison@Intel.com commit d4de9a3eaede440717244672ddc16114e388bc2f Author: John Harrison Date: Tue Mar 1 16:33:56 2022 -0800 drm/i915/guc: Drop obsolete H2G definitions The CTB registration process changed significantly a while back using a single KLV based H2G. So drop the original and now obsolete H2G definitions. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-8-John.C.Harrison@Intel.com commit 77dcbffbb5d6f822b0679f8a29242487c7c0bbb4 Author: John Harrison Date: Tue Mar 1 16:33:55 2022 -0800 drm/i915/guc: Rename desc_idx to ctx_id The LRC descriptor pool is going away. So, stop naming context ids as descriptor pool indecies. While at it, add a bunch of missing line feeds to some error messages. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-7-John.C.Harrison@Intel.com commit 8e2e9c435e2bdcf3cbd53a0e82877616ae9a513a Author: John Harrison Date: Tue Mar 1 16:33:54 2022 -0800 drm/i915/guc: Move lrc desc setup to where it is needed The LRC descriptor was being initialised early on in the context registration sequence. It could then be determined that the actual registration needs to be delayed and the descriptor would be wiped out. This is inefficient, so move the setup to later in the process after the point of no return. v2: Move some split changes into the split patch (and do them correctly). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-6-John.C.Harrison@Intel.com commit 58ea7d620c5ebc8f6181bf08d82aa44d2ec8af96 Author: John Harrison Date: Tue Mar 1 16:33:53 2022 -0800 drm/i915/guc: Split guc_lrc_desc_pin apart The LRC descriptor pool is going away. Further, the function that was populating it was also doing a bunch of logic about the context registration sequence. So, split that code apart into separate state setup and try to register functions. Note that some of those 'try to register' code paths actually undo the state setup and leave it to be redone again later (with potentially different values). This is inefficient. The next patch will correct this. Also, move a comment about ignoring return values to the place where the return values are actually ignored. v2: Move some more splitting from a later patch (and do it correctly). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-5-John.C.Harrison@Intel.com commit d124902242241171b704d051ef2830dd344dff84 Author: John Harrison Date: Tue Mar 1 16:33:52 2022 -0800 drm/i915/guc: Better name for context id limit The LRC descriptor pool is going away. So, stop using it as the limit for how many context ids are available. Instead, size the pool according to the number of contexts allowed. Note that this is just a naming change, the actual limit is identical in value. While at it, also update a kzalloc(sizeof()*count) to be a kcalloc(count,size). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-4-John.C.Harrison@Intel.com commit 09570c5010411b51348b83af08c83a080bf59830 Author: John Harrison Date: Tue Mar 1 16:33:51 2022 -0800 drm/i915/guc: Add an explicit 'submission_initialized' flag The LRC descriptor pool is going away. So, stop using it as a check for whether submission has been initialised or not. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-3-John.C.Harrison@Intel.com commit 02942b4213f30bed4291e2b53d9073a98839f45a Author: John Harrison Date: Tue Mar 1 16:33:50 2022 -0800 drm/i915/guc: Do not conflate lrc_desc with GuC id for registration The LRC descriptor pool is going away. So, stop using it as a check for context registration, use the GuC id instead (being the thing that actually gets registered with the GuC). Also, rename the set/clear/query helper functions for context id mappings to better reflect their purpose and to differentiate from other registration related helper functions. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220302003357.4188363-2-John.C.Harrison@Intel.com commit 2046e733e125fa58ed997f3d26d43543faf82c95 Author: Guo Zhengkui Date: Mon Feb 28 22:23:50 2022 +0800 drm/nouveau/instmem: fix uninitialized_var.cocci warning Fix following coccicheck warning: drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c:316:11-12: WARNING this kind of initialization is deprecated. `void *map = map` has the same form of uninitialized_var() macro. I remove the redundant assignement. It has been tested with gcc (Debian 8.3.0-6) 8.3.0. The patch which removed uninitialized_var() is: https://lore.kernel.org/all/20121028102007.GA7547@gmail.com/ And there is very few "/* GCC */" comments in the Linux kernel code now. Signed-off-by: Guo Zhengkui Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220228142352.18006-1-guozhengkui@vivo.com commit 6b4e414ce8dab7042a002f861b7bcae50a1e2b6d Author: Ville Syrjälä Date: Mon Feb 14 12:55:32 2022 +0200 drm/i915: Pimp async flip debugs Print the offending plane/crtc id+name in the async flip debugs. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-5-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 2e08437160d1e8f2cd3f0d56d59e74423602116e Author: Ville Syrjälä Date: Mon Feb 14 12:55:31 2022 +0200 drm/i915: Fix the async flip wm0/ddb optimization The current implementation of the async flip wm0/ddb optimization does not work at all. The biggest problem is that we skip the whole intel_pipe_update_{start,end}() dance and thus never actually complete the commit that is trying to do the wm/ddb change. To fix this we need to move the do_async_flip flag to the crtc state since we handle commits per-pipe, not per-plane. Also since all planes can now be included in the first/last "async flip" (which gets converted to a sync flip to do the wm/ddb mangling) we need to be more careful when checking if the plane state is async flip comptatible. Only planes doing the async flip should be checked and other planes are perfectly fine not adhereing to any async flip related limitations. However for subsequent commits which are actually going do the async flip in hardware we want to make sure no other planes are in the state. That should never happen assuming we did our job correctly, so we'll toss in a WARN to make sure we catch any bugs here. Cc: Stanislav Lisovskiy Fixes: c3639f3be480 ("drm/i915: Use wm0 only during async flips for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit b0b2bed2a1305c8f977c6b7d5fa162773693a212 Author: Ville Syrjälä Date: Mon Feb 14 12:55:30 2022 +0200 drm/i915: Check async flip capability early on Since the async flip state check is done very late and thus it can see potentially all the planes in the state (due to the wm/ddb optimization) we need to move the "can the requested plane do async flips at all?" check much earlier. For this purpose we introduce intel_async_flip_check_uapi() that gets called early during the atomic check. And for good measure we'll throw in a couple of basic checks: - is the crtc active? - was a modeset flagged? - is+was the plane enabled? Though atm all of those should be guaranteed by the fact that the async flip can only be requested through the legacy page flip ioctl. Cc: Stanislav Lisovskiy Fixes: c3639f3be480 ("drm/i915: Use wm0 only during async flips for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 6475e106821babc0dc478a9cb3fc3973739c43fb Author: Ville Syrjälä Date: Mon Feb 14 12:55:29 2022 +0200 drm/i915: Don't skip ddb allocation if data_rate==0 data_rate==0 no longer means a plane is disabled, it could also mean we want to use the minimum ddb allocation for it. Hence we can't bail out early during ddb allocation or else we'll simply forget to allocate any ddb for such planes. Cc: Stanislav Lisovskiy Fixes: 6a4d8cc6bbbf ("drm/i915: Don't allocate extra ddb during async flip for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 98bf4f47a86c7b4edf85ebaa3016615c0bb71fb5 Author: Stanislav Lisovskiy Date: Thu Dec 9 16:18:17 2021 +0200 drm/i915/dg2: Use I915_BO_ALLOC_CONTIGUOUS flag for DPT Do mapping using CONTIGUOUS flag - otherwise i915_gem_object_is_contiguous warn is triggered. Signed-off-by: Stanislav Lisovskiy Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211209141817.16038-1-stanislav.lisovskiy@intel.com commit 9c95f96392d99e5915838e0ca83b25bad3f93e3c Author: José Roberto de Souza Date: Thu Feb 24 12:25:23 2022 -0800 drm/i915/display: Allow users to disable PSR2 Some users are suffering with PSR2 issues that are under debug or issues that were root caused to panel firmware bugs, to make life of those users easier here adding a option to disable PSR2 with kernel parameters so they can still benefit from PSR1 power savings. Using the same enable_psr that is current used to turn the whole feature on or off and allowing user to select up to what PSR version it should enable. Right now users only set this parameter to 0 when they want to disable PSR1 and PSR2 or don't add it at all leaving it to per-chip behavior so it should not cause a bad impact on users. v2: - changing enable_psr values (Ville and Rodrigo) Link: https://gitlab.freedesktop.org/drm/intel/-/issues/4951 Cc: Jouni Högander Cc: Rodrigo Vivi Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220224202523.993560-1-jose.souza@intel.com commit 8d5516d18b323cf7274d1cf5fe76f4a691f879c6 Author: Jouni Högander Date: Fri Feb 25 09:02:28 2022 +0200 drm/i915/psr: Set "SF Partial Frame Enable" also on full update Currently we are observing occasional screen flickering when PSR2 selective fetch is enabled. More specifically glitch seems to happen on full frame update when cursor moves to coords x = -1 or y = -1. According to Bspec SF Single full frame should not be set if SF Partial Frame Enable is not set. This happened to be true for ADLP as PSR2_MAN_TRK_CTL_ENABLE is always set and for ADL_P it's actually "SF Partial Frame Enable" (Bit 31). Setting "SF Partial Frame Enable" bit also on full update seems to fix screen flickering. Also make code more clear by setting PSR2_MAN_TRK_CTL_ENABLE only if not on ADL_P. Bit 31 has different meaning in ADL_P. Bspec: 49274 v2: Fix Mihai Harpau email address v3: Modify commit message and remove unnecessary comment Tested-by: Lyude Paul Fixes: 7f6002e58025 ("drm/i915/display: Enable PSR2 selective fetch by default") Reported-by: Lyude Paul Cc: Mihai Harpau Cc: José Roberto de Souza Cc: Ville Syrjälä Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/5077 Signed-off-by: Jouni Högander Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220225070228.855138-1-jouni.hogander@intel.com commit 5708fe0db0edfaaf6ef83106a4404bc102afe129 Author: Lee Shawn C Date: Thu Mar 3 16:38:02 2022 +0800 drm/i915: update new TMDS clock setting defined by VBT VBT 249 update to support more TMDS clock rate 3.00G, 3.40G and 5.94G. Refer to this new definition to configure max TMDS clock rate for HDMI driver. BSpec: 20124 v2: new subject Cc: Jani Nikula Cc: Ville Syrjala Cc: Ankit Nautiyal Signed-off-by: Lee Shawn C Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303083802.5071-1-shawn.c.lee@intel.com commit 09550c7fcde1e0d50dde1093abdf54d9de06a2bf Author: Swathi Dhanavanthri Date: Wed Mar 2 15:11:19 2022 -0800 drm/i915/display/adlp: Remove code related to underrun recovery This is not supported for ADLP and is not needed. Signed-off-by: Swathi Dhanavanthri Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220302231119.16876-1-swathi.dhanavanthri@intel.com commit 0a967f5bfd9134b89681cae58deb222e20840e76 Author: Tejas Upadhyay Date: Wed Mar 2 10:02:56 2022 +0530 iommu/vt-d: Add RPLS to quirk list to skip TE disabling The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before completing the translation enable command and reflecting the status of the command through the TES field in the Global Status register. Unfortunately, some integrated graphic devices fail to do so after some kind of power state transition. As the result, the system might stuck in iommu_disable_translati on(), waiting for the completion of TE transition. This adds RPLS to a quirk list for those devices and skips TE disabling if the qurik hits. Link: https://gitlab.freedesktop.org/drm/intel/-/issues/4898 Tested-by: Raviteja Goud Talla Cc: Rodrigo Vivi Acked-by: Lu Baolu Signed-off-by: Tejas Upadhyay Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20220302043256.191529-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit f79a568add12affc44152455fd7f7502aeea8e31 Author: Lucas De Marchi Date: Fri Feb 25 15:46:31 2022 -0800 drm/i915: Use str_on_off() Remove the local onoff() implementation and adopt the str_on_off() from linux/string_helpers.h. Signed-off-by: Lucas De Marchi Acked-by: Daniel Vetter Acked-by: Jani Nikula Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-4-lucas.demarchi@intel.com commit ff9fbe7ce1c13dc472ac4a5cb22064a37aeca69a Author: Lucas De Marchi Date: Fri Feb 25 15:46:30 2022 -0800 drm/i915: Use str_enabled_disabled() Remove the local enableddisabled() implementation and adopt the str_enabled_disabled() from linux/string_helpers.h. Signed-off-by: Lucas De Marchi Acked-by: Daniel Vetter Acked-by: Jani Nikula Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-3-lucas.demarchi@intel.com commit 707c3a7d99b1a6c483ac773a6327972144152c92 Author: Lucas De Marchi Date: Fri Feb 25 15:46:29 2022 -0800 drm/i915: Use str_enable_disable() Remove the local enabledisable() implementation and adopt the str_enable_disable() from linux/string_helpers.h. Signed-off-by: Lucas De Marchi Acked-by: Daniel Vetter Acked-by: Jani Nikula Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-2-lucas.demarchi@intel.com commit 01fabda8e3d62e9f45b6f2a86869fa02e5587ddf Author: Lucas De Marchi Date: Fri Feb 25 15:46:28 2022 -0800 drm/i915: Use str_yes_no() Remove the local yesno() implementation and adopt the str_yes_no() from linux/string_helpers.h. Signed-off-by: Lucas De Marchi Acked-by: Daniel Vetter Acked-by: Jani Nikula Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-1-lucas.demarchi@intel.com commit 230bc2bed518632602bd2cdad6ba5d2081d448b5 Merge: 17003d109e6cd 38a15ad9488e2 Author: Rodrigo Vivi Date: Wed Mar 2 11:28:33 2022 -0500 Merge drm/drm-next into drm-intel-next To catch up with recent rounds of pull requests and get some drm-misc dependencies so we can merge linux/string_helpers related changes. Signed-off-by: Rodrigo Vivi commit 17003d109e6cd08d4db5f6525a1023537ce6c743 Author: Colin Ian King Date: Wed Feb 23 12:09:23 2022 +0000 drm/i915: make a handful of read-only arrays static const Don't populate the read-only arrays on the stack but instead make them static const and signed 8 bit ints. Also makes the object code a little smaller. Reformat the statements to clear up checkpatch warning. Signed-off-by: Colin Ian King Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223120923.239867-1-colin.i.king@gmail.com commit 47f16fe53545289e2e90e59a1c4679c87e833cf9 Author: Imre Deak Date: Tue Feb 22 18:51:37 2022 +0200 drm/i915: Move intel_display_power_well_is_enabled() to intel_display_power_well.c Move intel_display_power_well_is_enabled() to intel_power_well.c, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden. Eventually the call to this function and in general accessing power wells directly from elsewhere in the driver should be replaced by the use of power domains. No functional change. Suggested-by: Jani Nikula Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-9-imre.deak@intel.com commit 3ab5e051cb329745ef2fd0053906f345ed82979d Author: Imre Deak Date: Tue Feb 22 18:51:36 2022 +0200 drm/i915: Add functions to get a power well's state/name/domains/mask/refcount Add functions to get a power well's actual- and cached-enabled state, name, domain mask and refcount, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden. No functional change. Suggested-by: Jani Nikula Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-8-imre.deak@intel.com commit 90cf356bb4eb46a9f71248a28b2a5f1983a78a10 Author: Imre Deak Date: Tue Feb 22 18:51:35 2022 +0200 drm/i915: Add function to call a power well's sync_hw() hook Add a function to call a power well's sync_hw() hook, instead of open-coding the same, as a step towards making the low-level power well internals (i915_power_well_ops/desc structs) hidden. The cached-enable state should be always up-to-date, so update it whenever sync_hw() is called. No functional change. Suggested-by: Jani Nikula Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-7-imre.deak@intel.com commit ef1e170891904f0339af8fffbaad990243c7125b Author: Imre Deak Date: Tue Feb 22 18:51:34 2022 +0200 drm/i915: Move power well get/put/enable/disable functions to a new file Move the power well get/put/enable/disable hooks to the new intel_display_power_well.c file. The motivation is to reduce the clutter in intel_display_power.c, keeping the functionality related to power domains in that file and moving the low-level power well functionality to intel_display_power_well.c. No functional change. Suggested-by: Jani Nikula Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-6-imre.deak@intel.com commit 314fe7dce4139e80fe3df834d1c451917a1b0bc0 Author: Imre Deak Date: Tue Feb 22 18:51:33 2022 +0200 drm/i915: Move i915_power_well_regs struct into i915_power_well_ops Move the i915_power_well_regs struct into i915_power_well_ops. Most of the power wells use the same ops/regs combination, so this saves some space and also simplifies the platform power domain->power well definitions. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-5-imre.deak@intel.com commit a5c517331279916e99e4ea02a50bfdd578861651 Author: Imre Deak Date: Tue Feb 22 18:51:32 2022 +0200 drm/i915: Remove redundant state verification during TypeC AUX power well disabling Commit d5ce34da31456a ("drm/i915: Add state verification for the TypeC port mode") added a verification to the TypeC AUX power well enable()/disable() hooks to check if the TypeC port related to this power well is properly locked. If the disabling happens asynchronously the verification is skipped, since in this case the port is unlocked. The detection of asnychronous disabling doesn't work as intended though, since the power well's reference count is always 0 when its disable() hook is called (and since there won't be any domain reference held for this power well either, the verification is always skipped); remove the verification from the disable() hook for now. In the power well's enable() hook the power well's reference will be always >0 and there won't be any asynchronous disabling pending for it, so we can drop the async refcount check from there. No functional change. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-4-imre.deak@intel.com commit 359441cdc5e7f872f3c53757606cdd6bd6b842df Author: Imre Deak Date: Tue Feb 22 18:51:31 2022 +0200 drm/i915: Sanitize open-coded power well enable()/disable() calls Instead of open-coding the call of the power wells' enable()/disable() hooks use the corresponding helper functions. This will also ensure that the power well's cached-enable state is always up-to-date. Luckily the lack of this updating hasn't been a problem, since the state either didn't change (in intel_display_power_set_target_dc_state()), or got updated subsequently (for vlv_cmnlane_wa(), in the following intel_power_domains_sync_hw()). Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-3-imre.deak@intel.com commit 492c1ae2f27c327ef8d0f2019cac66408a41d808 Author: Imre Deak Date: Tue Feb 22 18:51:30 2022 +0200 drm/i915: Fix the VDSC_PW2 power domain enum value The POWER_DOMAIN_TRANSCODER() macro depends on the POWER_DOMAIN_TRANSCODER_A/B .. DSI_A/C enum values to be consecutive, move POWER_DOMAIN_TRANSCODER_VDSC_PW2 after these to ensure this. The wrong order didn't cause a problem, since the DSI_A/C domains are in always-on power wells on all relevant platforms. The same power well ends up being enabled/disabled when the VDSC_PW2 domain is selected incorrectly. While at it add a code comment about enum values that need to stay consecutive. Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220222165137.1004194-2-imre.deak@intel.com commit 5c190e5394cc7773feaff1b54701a2c2f73ef011 Author: Jani Nikula Date: Wed Feb 23 12:35:17 2022 +0200 drm/i915/wm: use REG_FIELD_{PREP,GET} for PLANE_WM_BLOCKS_MASK Use REG_FIELD_{PREP,GET} for completeness, and to avoid bitwise operations with different sizes. v2: Also use REG_FIELD_GET in skl_wm_level_from_reg_val() (Ville) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223103517.634229-1-jani.nikula@intel.com commit 2d0539575abb9dfda27eb7653bb442448fb8982a Author: Ville Syrjälä Date: Wed Feb 23 15:13:11 2022 +0200 drm/i915: Fix MSO vs. bigjoiner timings confusion When calculating pipe_mode and when doing readout we need to order our steps correctly. 1. We start with adjusted_mode crtc timings being populated with the transcoder timings (either via readout or compute_config(). These will be per-segment for MSO. 2. For all other uses we want the full crtc timings so we ask intel_splitter_adjust_timings() to expand the per-segment numbers to their full glory 3. If bigjoiner is used we the divide the full numbers down to per-pipe numbers using intel_bigjoiner_adjust_timings() During readout we also have to reconstruct the adjusted_mode normal timings (ie. not the crtc_ stuff). These are supposed to reflect the full timings of the display. So we grab these between steps 2 and 3. The "user" mode readout (mainly done for fastboot purposes) should be whatever mode the user would have used had they asked us to do a modeset. We want the full timings for this as the per-segment timings are not suppoesed to be user visible. Also the user mode normal timings hdisplay/vdisplay need to match PIPESRC (that is where we get our PIPESRC size we doing a modeset with a user supplied mode). And we end up with - adjusted_mode normal timigns == full timings - adjusted_mode crtc timings == transcoder timings (per-segment timings for MSO, full timings otherwise) - pipe_mode normal/crtc timings == pipe timings (full timings divided by the number of bigjoiner pipes, if any) - user mode normal timings == full timings with hdisplay/vdisplay replaced with PIPESRC size - user mode crtc timings == full timings Yes, that is a lot of timings. One day we'll try to remove some of the ones we don't actually need to keep around... Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-10-ville.syrjala@linux.intel.com commit 6f4cafdfe77c396d6029d80a645e949f62e670c9 Author: Ville Syrjälä Date: Wed Feb 23 15:13:10 2022 +0200 drm/i915: Extract intel_crtc_compute_pipe_mode() Pull intel_crtc_compute_pipe_mode() out from intel_crtc_compute_config(). Since it's semi related we'll suck in the max dotclock/double wide checks in as well. And we'll pimp the debugs while at it. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-9-ville.syrjala@linux.intel.com commit 9c1197a0f82d4a8a32e29ba4c3c044b5057376c3 Author: Ville Syrjälä Date: Wed Feb 23 15:13:09 2022 +0200 drm/i915: Extract intel_crtc_compute_pipe_src() intel_crtc_compute_config() doesn't really tell a unified story. Let's chunk it up into pieces. We'll start with intel_crtc_compute_pipe_src(). Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-8-ville.syrjala@linux.intel.com commit 0338ba69234be65d2afd518c9ed7ee81c39e52e8 Author: Ville Syrjälä Date: Wed Feb 23 15:13:08 2022 +0200 drm/i915: Extract intel_bigjoiner_adjust_timings() Deduplicate the code to convert the full timings to per-pipe timings for bigjoiner usage. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-7-ville.syrjala@linux.intel.com commit a8c0109c520092115fabdfa5dae340a7590b201a Author: Ville Syrjälä Date: Wed Feb 23 15:13:07 2022 +0200 drm/i915: Extract intel_splitter_adjust_timings() Let's not replicate the same piece of code to expand the MSO segment timings to full width in many places. Pull it into a helper Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-6-ville.syrjala@linux.intel.com commit 3dda9ee49ea5d332359ca372728ee13e570b7e04 Author: Ville Syrjälä Date: Wed Feb 23 15:13:06 2022 +0200 drm/i915: Rename variables in intel_crtc_compute_config() Do the s/dev_priv/i915/ and s/pipe_config/crtc_state/ renames to intel_crtc_compute_config(). I want to start splitting this up a bit and doing the renames now avoids spreading these old nameing conventions elsewhere. No functional changes. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-5-ville.syrjala@linux.intel.com commit c2393a1d8bd1a69ff74ee769fa5d36e4900d4fba Author: Ville Syrjälä Date: Wed Feb 23 15:13:05 2022 +0200 drm/i915: Remove nop bigjoiner state copy We just copied over the whole master crtc state, including cpu_transcoder+has_audio. No need to copy those again. Also get rid of the unhelpful comment. Reviewed-by: Ankit Nautiyal Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-4-ville.syrjala@linux.intel.com commit 6c6465fc33c5679a418fb06ff582cd38e68eb5e2 Author: Ville Syrjälä Date: Wed Feb 23 15:13:04 2022 +0200 drm/i915: Fix cursor coordinates on bigjoiner slave Adjust the cursor dst coordinates appripriately when it's on the bigjoiner slave pipe. intel_atomic_plane_check_clipping() already did this but with the cursor we discard those results (apart from uapi.visible and error checks) since the hardware will be doing the clipping for us. v2: Rebase due to bigjoiner bitmask usage Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-3-ville.syrjala@linux.intel.com commit cccc71b552a1040ad3d738d7ec95570801fb0bf6 Author: Ville Syrjälä Date: Wed Feb 23 15:13:03 2022 +0200 drm/i915: Avoid negative shift due to bigjoiner_pipes==0 bigjoiner_pipes==0 leads bigjoiner_master_pipe() to do BIT(ffs(0)-1) which is undefined behaviour. The code should actually still work fine since the only place we provoke that is intel_crtc_bigjoiner_slave_pipes() and it'll bitwise AND the result with 0, so doesn't really matter what we get out of bigjoiner_master_pipe(). But best not provoke undefined behaviour anyway. Reported-by: kernel test robot Fixes: a6e7a006f5d5 ("drm/i915: Change bigjoiner state tracking to use the pipe bitmask") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-2-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 53581504a8e216d435f114a4f2596ad0dfd902fc Author: Ville Syrjälä Date: Thu Feb 24 15:21:42 2022 +0200 drm/i915: s/JSP2/ICP2/ PCH This JSP2 PCH actually seems to be some special Apple specific ICP variant rather than a JSP. Make it so. Or at least all the references to it seem to be some Apple ICL machines. Didn't manage to find these PCI IDs in any public chipset docs unfortunately. The only thing we're losing here with this JSP->ICP change is Wa_14011294188, but based on the HSD that isn't actually needed on any ICP based design (including JSP), only TGP based stuff (including MCC) really need it. The documented w/a just never made that distinction because Windows didn't want to differentiate between JSP and MCC (not sure how they handle hpd/ddc/etc. then though...). Cc: stable@vger.kernel.org Cc: Matt Roper Cc: Vivek Kasireddy Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4226 Fixes: 943682e3bd19 ("drm/i915: Introduce Jasper Lake PCH") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224132142.12927-1-ville.syrjala@linux.intel.com Acked-by: Vivek Kasireddy Tested-by: Tomas Bzatek commit 2ff5560e23c863b22afb7db01208a76d9f1d1046 Author: Lucas De Marchi Date: Wed Feb 23 13:09:33 2022 -0800 drm/i915/dmc: Do not try loading wrong DMC version Checking by >= DISPLAY_VER(12) made sense when the support for Tiger Lake was added. However now it only leads to wrong behavior when adding more platforms since it's expected they either don't have DMC to load or they have their own blob. Logs from DG2 loading on a CFL host, without having a DMC firmware defined: <6>[ 0.000000] DMI: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWR1.R00.X220.B00.2103302221 03/30/2021 ... <6>[ 2.706607] pci 0000:03:00.0: [8086:56a0] type 00 class 0x030000 ... <7>[ 6.340397] i915 0000:03:00.0: [drm:intel_dmc_ucode_init [i915]] Loading i915/tgl_dmc_ver2_12.bin <7>[ 6.341841] i915 0000:03:00.0: [drm:intel_fbc_init [i915]] Sanitized enable_fbc value: 1 <3>[ 6.342432] genirq: Flags mismatch irq 0. 00000080 (i915) vs. 00015a00 (timer) <6>[ 6.346283] i915 0000:03:00.0: [drm] Finished loading DMC firmware i915/tgl_dmc_ver2_12.bin (v2.12) <3>[ 6.385756] i915 0000:03:00.0: Device initialization failed (-16) <5>[ 6.385778] i915 0000:03:00.0: Please file a bug on drm/i915; see https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs for details. <4>[ 6.385782] i915: probe of 0000:03:00.0 failed with error -16 TGL is the only platform left with DISPLAY_VER() == 12 that is not handled already in the if/else ladder, so handle it specifically. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Signed-off-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220223210933.3049143-1-lucas.demarchi@intel.com commit b4eb76d82a0ea92241f5079874a7aea10c5cc4ae Author: Matt Roper Date: Wed Feb 23 08:54:21 2022 -0800 drm/i915/dg2: Skip output init on PHY calibration failure If one of our PHYs fails to complete calibration, we should skip the general initialization of the corresponding output. Most likely this is going to happen on outputs that don't actually exist on the board; in theory we should have already decided to skip this output based on the VBT, but we can't always rely on the VBT being accurate. Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220223165421.3949883-1-matthew.d.roper@intel.com commit 772ba8d68515fb8d5414eb714a1d4d446903eb13 Author: Ville Syrjälä Date: Thu Feb 10 08:24:03 2022 +0200 drm/i915: Make pre-skl sprite plane registers unlocked Drop the locks around sprite plane register writes. The lock isn't needed since each plane's register are neatly contained on their own cachelines. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220210062403.18690-6-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 7ad9993b2368f2a861f335184cd2bb1909f13827 Author: Ville Syrjälä Date: Thu Feb 10 08:24:02 2022 +0200 drm/i915: Make most pre-skl primary plane registers unlocked Drop the locks around most primary plane register writes. The lock isn't needed since each plane's register are neatly contained on their own cachelines. The one exception we have to make is DSPADDR/DSPSURF which is (ab)used to also trigger FBC nukes on pre-snb (since the hardware doesn't seem to have any dedicated mechanism to trigger nukes). So we need to keep the lock around it to protect against the rmw performed by the fbc code. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220210062403.18690-5-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 0225a90981c83408e9606b52a65edee1c6891106 Author: Ville Syrjälä Date: Fri Feb 11 11:26:04 2022 +0200 drm/i915: Make cursor plane registers unlocked Drop the locks around cursor plane register writes. The lock isn't needed since each plane's register are neatly contained on their own cachelines. The locking did have a secondary effect of disabling interrupts around the cursor registers writes though. If we drop that then we open outselves up for sceduling delays and whatnot while on the middle of the register writes. That increases the chance of not all the register writes land during the same frame. For normal atomic commits this is not a concern as the vblank evade mechanism anyway disables interrupts around the update, but the legacy cursor codepath does not. Technically we should do a vblank evade there as well, but so far no one has bothered to hook that up. So in the meantime let's put an explicit local irq disable/enable around the legacy cursor update to keep the race window minimal. v2: local_irq_{disable,enable}() for legacy cursor ioctl Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220211092604.393-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 14ad15296d1fd067e54ad04d96056fe0aed61f2d Author: Ville Syrjälä Date: Thu Feb 10 08:24:00 2022 +0200 drm/i915: Make skl+ universal plane registers unlocked Drop the locks around most universal plane register writes. The lock isn't needed since each plane's register are neatly contained on their own cachelines. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220210062403.18690-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit f8a005eb89720c913e59707d061a1b7e9c8b3358 Author: Ville Syrjälä Date: Thu Feb 10 08:23:59 2022 +0200 drm/i915: Optimize icl+ universal plane programming On icl+ all plane registers are armed by PLANE_SURF, so we can move almost everything over into the update_noarm() hook. The PLANE_CTL write has to stay in the icl_update_arm() hook though as it still exhibits the somewhat annoying self-arming behaviour when the plane transitioning from disabled to enabled. We could either do a full split for skl+ vs. icl+, or we could try some other kind of split where we'd eg. keep most things in the skl+ functions and call them from the icl+ functions. I think a full split is probably the cleaner approach since we've anyway accumulated quite a bit of icl+ specific things, so that is what I opted to do. Some i915_update_info stats for tgl: before: after: Updates: 5043 Updates: 5043 | | 1us | 1us | |** |*** 4us |****** 4us |******** |********** |*********** 16us |*********** 16us |********** |**** |* 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 3494ns Min update: 2983ns Max update: 49491ns Max update: 39986ns Average update: 18031ns Average update: 13423ns Overruns > 100us: 0 Overruns > 100us: 0 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220210062403.18690-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 072ce4164f973bc762b25ce9a41636bffe75ab36 Author: Stanislav Lisovskiy Date: Tue Jan 18 13:55:44 2022 +0200 drm/i915/dg2: Tile 4 plane format support Tile4 in bspec format is 4K tile organized into 64B subtiles with same basic shape as for legacy TileY which will be supported by Display13. v2: - Moved Tile4 associating struct for modifier/display to the beginning(Imre Deak) - Removed unneeded case I915_FORMAT_MOD_4_TILED modifier checks(Imre Deak) - Fixed I915_FORMAT_MOD_4_TILED to be 9 instead of 12 (Imre Deak) v3: - Rebased patch on top of new changes related to plane_caps. - Added static assert to check that PLANE_CTL_TILING_YF matches PLANE_CTL_TILING_4(Nanley Chery) - Fixed naming and layout description for Tile 4 in drm uapi header(Nanley Chery) v4: - Extracted drm_fourcc changes to separate patch(Nanley Chery) Reviewed-by: Imre Deak Cc: Matt Roper Cc: Maarten Lankhorst Signed-off-by: Stanislav Lisovskiy Signed-off-by: Matt Roper Signed-off-by: Juha-Pekka Heikkilä Link: https://patchwork.freedesktop.org/patch/msgid/20220118115544.15116-3-stanislav.lisovskiy@intel.com commit c6e7deb0f092616bd8cb19e8c436b212c64daaab Author: Stanislav Lisovskiy Date: Tue Jan 18 13:55:43 2022 +0200 drm/i915: Introduce new Tile 4 format This tiling layout uses 4KB tiles in a row-major layout. It has the same shape as Tile Y at two granularities: 4KB (128B x 32) and 64B (16B x 4). It only differs from Tile Y at the 256B granularity in between. At this granularity, Tile Y has a shape of 16B x 32 rows, but this tiling has a shape of 64B x 8 rows. Reviewed-by: Imre Deak Acked-by: Nanley Chery Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20220118115544.15116-2-stanislav.lisovskiy@intel.com commit 1c4b5ecb7ea190fa3e9f9d6891e6c90b60e04f24 Author: Christoph Hellwig Date: Wed Feb 23 08:47:20 2022 +0100 remove the h8300 architecture Signed-off-by: Christoph Hellwig commit b8e508f42138b42b44f65679d02aad3c200aff68 Author: Miquel Raynal Date: Tue Feb 1 19:06:29 2022 +0100 net: ieee802154: Drop duration settings when the core does it already The core now knows how to set the symbol duration in a few cases, when drivers correctly advertise the protocols used on each channel. For these drivers, there is no more need to bother with symbol duration, lifs and sifs periods so just drop the duplicated code. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220201180629.93410-5-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 781830c800ddd19566846c634de09fadf37eafde Author: Miquel Raynal Date: Tue Feb 1 19:06:28 2022 +0100 net: mac802154: Set durations automatically As depicted in the IEEE 802.15.4 specification, modulation/bands are tight to a number of page/channels so we can for most of them derive the durations automatically. The two locations that must call this new helper to set the variou symbol durations are: - when manually requesting a channel change though the netlink interface - at PHY creation, once the device driver has set the default page/channel If an information is missing, the symbol duration is not touched, a debug message is eventually printed. This keeps the compatibility with the unconverted drivers for which it was too complicated for me to find their precise information. If they initially provided a symbol duration, it would be kept. If they don't, the symbol duration value is left untouched. Once the symbol duration derived, the lifs and sifs durations are updated as well. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220201180629.93410-4-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 731cddce6dd110fb2cdee34eddb48599e7251517 Author: Miquel Raynal Date: Tue Feb 1 19:06:27 2022 +0100 net: mac802154: Convert the symbol duration into nanoseconds Tdsym is often given in the spec as pretty small numbers in microseconds and hence was reflected in the code as symbol_duration and was stored as a u8. Actually, for UWB PHYs, the symbol duration is given in nanoseconds and are as precise as picoseconds. In order to handle better these PHYs, change the type of symbol_duration to u32 and store this value in nanoseconds. All the users of this variable are updated in a mechanical way. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220201180629.93410-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit cfa1e01ecf516511bfc0fa87f96aa19bc6ee401f Author: Miquel Raynal Date: Tue Feb 1 19:06:26 2022 +0100 net: ieee802154: ca8210: Fix lifs/sifs periods These periods are expressed in time units (microseconds) while 40 and 12 are the number of symbol durations these periods will last. We need to multiply them both with the symbol_duration in order to get these values in microseconds. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220201180629.93410-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 3928cf08334ed895a31458cbebd8d4ec6d84c080 Author: Randy Dunlap Date: Sun Jan 23 09:40:31 2022 -0800 pcmcia: db1xxx_ss: restrict to MIPS_DB1XXX boards When the MIPS_ALCHEMY board selection is MIPS_XXS1500 instead of MIPS_DB1XXX, the PCMCIA driver 'db1xxx_ss' has build errors due to missing DB1XXX symbols. The PCMCIA driver should be restricted to MIPS_DB1XXX instead of MIPS_ALCHEMY to fix this build error. ERROR: modpost: "bcsr_read" [drivers/pcmcia/db1xxx_ss.ko] undefined! ERROR: modpost: "bcsr_mod" [drivers/pcmcia/db1xxx_ss.ko] undefined! Fixes: 42a4f17dc356 ("MIPS: Alchemy: remove SOC_AU1X00 in favor of MIPS_ALCHEMY") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Arnd Bergmann Cc: Daniel Vetter Cc: Kees Cook Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Acked-by: Manuel Lauss Signed-off-by: Dominik Brodowski commit 6c00ef0d3c680c1d7a852c7a6a656df1851d2951 Author: tangmeng Date: Thu Jan 27 15:15:09 2022 +0800 drivers/pcmcia: Fix typo in comment Replace unavaibale with unavailable. Signed-off-by: tangmeng Signed-off-by: Dominik Brodowski commit 52e00ea6b26e45fb8159e3b57cdde8d3f9bdd8e9 Author: Konstantin Komarov Date: Mon Oct 25 18:48:38 2021 +0300 fs/ntfs3: Update valid size if -EIOCBQUEUED Update valid size if write is still in I/O queue. Fixes xfstest generic/240 Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Konstantin Komarov commit 114346978cf61de02832cc3cc68432a3de70fb38 Author: Konstantin Komarov Date: Mon Oct 25 18:34:06 2021 +0300 fs/ntfs3: Check new size for limits We must check size before trying to allocate. Size can be set for example by "ulimit -f". Fixes xfstest generic/228 Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 3880f2b816a7e4ca889b7e8a42e6c62c5706ed36 Author: Konstantin Komarov Date: Mon Oct 25 18:31:28 2021 +0300 fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space) Two problems: 1. ntfs3_setattr can't truncate preallocated space; 2. if allocated fragment "cross" valid size, then fragment splits into two parts: - normal part; - unwritten part (here we must return FIEMAP_EXTENT_LAST). Before this commit we returned FIEMAP_EXTENT_LAST for whole fragment. Fixes xfstest generic/092 Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Signed-off-by: Konstantin Komarov commit 9186d472ee780fabf74424756c4c00545166157e Author: Konstantin Komarov Date: Wed Nov 24 15:08:19 2021 +0300 fs/ntfs3: In function ntfs_set_acl_ex do not change inode->i_mode if called from function ntfs_init_acl ntfs_init_acl sets mode. ntfs_init_acl calls ntfs_set_acl_ex. ntfs_set_acl_ex must not change this mode. Fixes xfstest generic/444 Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Reviewed-by: Joe Perches Signed-off-by: Konstantin Komarov commit 3a2154b25a9f461a1848371b3e8f6f316434ae1f Author: Konstantin Komarov Date: Fri Oct 22 18:30:22 2021 +0300 fs/ntfs3: Optimize locking in ntfs_save_wsl_perm Right now in ntfs_save_wsl_perm we lock/unlock 4 times. This commit fixes this situation. We add "locked" argument to ntfs_set_ea. Suggested-by: Kari Argillander Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit 2d44667c306e7806848a3478820f87343feb5421 Author: Konstantin Komarov Date: Fri Oct 22 18:35:43 2021 +0300 fs/ntfs3: Update i_ctime when xattr is added Ctime wasn't updated after setfacl command. This commit fixes xfstest generic/307 Fixes: be71b5cba2e6 ("fs/ntfs3: Add attrib operations") Signed-off-by: Konstantin Komarov commit 87e21c99bad763524c953ff4d1a61ee19038ddc2 Author: Konstantin Komarov Date: Fri Oct 22 18:15:36 2021 +0300 fs/ntfs3: Restore ntfs_xattr_get_acl and ntfs_xattr_set_acl functions Apparently we need to maintain these functions with ntfs_get_acl_ex and ntfs_set_acl_ex. This commit fixes xfstest generic/099 Fixes: 95dd8b2c1ed0 ("fs/ntfs3: Remove unnecessary functions") Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit e95113ed4d428219e3395044e29f5713fc446720 Author: Konstantin Komarov Date: Fri Oct 22 17:37:52 2021 +0300 fs/ntfs3: Keep preallocated only if option prealloc enabled If size of file was reduced, we still kept allocated blocks. This commit makes ntfs3 work as other fs like btrfs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214719 Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Reported-by: Ganapathi Kamath Tested-by: Ganapathi Kamath Reviewed-by: Kari Argillander Signed-off-by: Konstantin Komarov commit e589f9b7078e1c0191613cd736f598e81d2390de Author: Christophe JAILLET Date: Thu Nov 11 08:45:44 2021 +0100 fs/ntfs3: Fix some memory leaks in an error handling path of 'log_replay()' All error handling paths lead to 'out' where many resources are freed. Do it as well here instead of a direct return, otherwise 'log', 'ra' and 'log->one_page_buf' (at least) will leak. Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") Signed-off-by: Christophe JAILLET Signed-off-by: Konstantin Komarov